import{d as j,ar as E,r as _,L as x,c as m,g as y,f as s,w as l,X as c,t as u,u as d,e as p,i,j as f,b as n}from"./index-bf0eaf20.js";import{E as B}from"./EditConfig-6fbc7857.js";import{n as N}from"./index.browser-342e672c.js";import{V as $,a as O}from"./VCardText-8a9fa9c7.js";import{a as v}from"./VCard-97256dbd.js";import{V as h}from"./VList-21e2a257.js";import{z as S}from"./VListItem-223b492d.js";import{c as T}from"./VMenu-71b97cab.js";import"./VExpansionPanels-9d44bf25.js";import"./VLabel-e07a3413.js";import"./VForm-a2651940.js";import"./VTextField-ad1ef579.js";import"./VVirtualScroll-837eb7b9.js";import"./VCheckboxBtn-f3296201.js";import"./VSpacer-36b6f8a9.js";/* empty css              */import"./VDialog-18e61467.js";import"./VAlert-e2b3a5a6.js";import"./_plugin-vue_export-helper-c27b6911.js";const z={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},D=i("br",null,null,-1),A=["href"],I=i("br",null,null,-1),L=i("br",null,null,-1),P=i("br",null,null,-1),se=j({__name:"EditCoreConfig",props:{domain:{}},setup(C){const V=E(),e=_(),b=N(11),r=_(!1),k=C;x(()=>k.domain,async t=>{t&&(e.value=await n.getCoreConfig(t))},{immediate:!0});const w=async function(t){r.value=!0,n.saveCoreConfig(e.value.domain,t).then(()=>{r.value=!1,V.push({name:"providersettings"})}).catch(a=>{alert(a),r.value=!1})},M=async function(t,a){r.value=!0;for(const o of Object.values(e.value.values))o.value!==void 0&&a[o.key]==null&&(a[o.key]=o.value);a.session_id=b,n.getCoreConfigEntries(e.value.domain,t,a).then(o=>{e.value.values={};for(const g of o)e.value.values[g.key]=g;r.value=!1}).catch(o=>{alert(o),r.value=!1})};return(t,a)=>(m(),y("section",null,[s(O,null,{default:l(()=>[e.value?(m(),y("div",z,[s($,null,{default:l(()=>[c(u(t.$t("settings.setup_provider",[d(n).providerManifests[e.value.domain].name])),1)]),_:1}),s(v,null,{default:l(()=>[c(u(d(n).providerManifests[e.value.domain].description),1)]),_:1}),D,d(n).providerManifests[e.value.domain].codeowners.length?(m(),p(v,{key:0},{default:l(()=>[i("b",null,u(t.$t("settings.codeowners"))+": ",1),c(u(d(n).providerManifests[e.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),d(n).providerManifests[e.value.domain].documentation?(m(),p(v,{key:1},{default:l(()=>[i("b",null,u(t.$t("settings.need_help_setup_provider")),1),c("  "),i("a",{href:d(n).providerManifests[e.value.domain].documentation,target:"_blank"},u(t.$t("settings.check_docs")),9,A)]),_:1})):f("",!0),I,s(h),L,P])):f("",!0),s(h),e.value?(m(),p(B,{key:1,"config-entries":Object.values(e.value.values),disabled:!1,onSubmit:w,onAction:M},null,8,["config-entries"])):f("",!0)]),_:1}),s(T,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=o=>r.value=o),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:l(()=>[s(S,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{se as default};
