import{d as j,ak as E,r as y,K as x,c as m,h as C,f as i,w as l,b as n,W as f,t as u,u as d,g as s,e as v,j as p}from"./index-CLKg64ON.js";import{E as B}from"./EditConfig-CkB1xNeb.js";import{n as N}from"./index.browser-DP16PUbO.js";import{b as $,V as O,a as c}from"./VCardText-BAUfdzDA.js";import{c as S}from"./VMenu-CLSWQG_U.js";import{V}from"./VList-BvG6-yh2.js";import{z as T}from"./VListItem-B_TSjQ1y.js";import"./VExpansionPanels-BBVj4yuE.js";import"./VCheckboxBtn-DXJHHMHd.js";import"./VAlert-CCGDAWu2.js";import"./VTextField-C1QkMZRy.js";import"./VForm-Cft_KNdc.js";import"./VVirtualScroll-DKBgr9yN.js";import"./VCard-BaRPabiE.js";import"./VSpacer-CqqJVVs3.js";/* empty css              */import"./VDialog-BpGrcp5y.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const z={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},D=["href"],te=j({__name:"EditCoreConfig",props:{domain:{}},setup(b){const k=E(),t=y(),w=N(11),r=y(!1),_=b;x(()=>_.domain,async o=>{o&&(t.value=await n.getCoreConfig(o))},{immediate:!0});const M=async function(o){r.value=!0,n.saveCoreConfig(t.value.domain,o).then(()=>{r.value=!1,k.push({name:"providersettings"})}).catch(e=>{alert(e),r.value=!1})},h=async function(o,e){r.value=!0;for(const a of Object.values(t.value.values))a.value!==void 0&&e[a.key]==null&&(e[a.key]=a.value);e.session_id=w,n.getCoreConfigEntries(t.value.domain,o,e).then(a=>{t.value.values={};for(const g of a)t.value.values[g.key]=g;r.value=!1}).catch(a=>{alert(a),r.value=!1})};return(o,e)=>(m(),C("section",null,[i($,null,{default:l(()=>[t.value?(m(),C("div",z,[i(O,null,{default:l(()=>[f(u(o.$t("settings.setup_provider",[d(n).providerManifests[t.value.domain].name])),1)]),_:1}),i(c,null,{default:l(()=>[f(u(d(n).providerManifests[t.value.domain].description),1)]),_:1}),e[2]||(e[2]=s("br",null,null,-1)),d(n).providerManifests[t.value.domain].codeowners.length?(m(),v(c,{key:0},{default:l(()=>[s("b",null,u(o.$t("settings.codeowners"))+": ",1),f(u(d(n).providerManifests[t.value.domain].codeowners.join(" / ")),1)]),_:1})):p("",!0),d(n).providerManifests[t.value.domain].documentation?(m(),v(c,{key:1},{default:l(()=>[s("b",null,u(o.$t("settings.need_help_setup_provider")),1),e[1]||(e[1]=f("  ")),s("a",{href:d(n).providerManifests[t.value.domain].documentation,target:"_blank"},u(o.$t("settings.check_docs")),9,D)]),_:1})):p("",!0),e[3]||(e[3]=s("br",null,null,-1)),i(V),e[4]||(e[4]=s("br",null,null,-1)),e[5]||(e[5]=s("br",null,null,-1))])):p("",!0),i(V),t.value?(m(),v(B,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:M,onAction:h},null,8,["config-entries"])):p("",!0)]),_:1}),i(S,{modelValue:r.value,"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:l(()=>[i(T,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{te as default};
