import{Q as x,x as y,w as B,Z as b,B as s,U as u,bD as N,bg as j,S as m,a9 as p,R as v,W as r,a_ as S,ao as f,ab as d,a0 as l,a4 as o,a$ as c,c9 as T,Y as C,bE as D}from"./index-CER3Y8WH.js";import{E as O}from"./EditConfig-BwBrKCsD.js";import{n as _}from"./index.browser-OxPLOBIU.js";import{b as I}from"./VBtn-Do0ASNFF.js";import"./VForm-DHdy4n75.js";import"./VCheckboxBtn-3gFb0eok.js";import"./VExpansionPanels-C5Hmlivf.js";import"./VAlert-_iyaxWIb.js";import"./VSwitch-D7rcjkBZ.js";import"./VTextField-Dt6QeC_M.js";import"./VVirtualScroll-Bsoo1OHJ.js";import"./VSlider-S5KSn-8o.js";import"./VDialog-BoVsCtTf.js";import"./VSpacer-DnooLekf.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const R={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},h=x({__name:"EditCoreConfig",props:{domain:{}},setup(k){const V=D(),t=y(),w=_(11),i=y(!1),E=k;B(()=>E.domain,async a=>{a&&(t.value=await o.getCoreConfig(a))},{immediate:!0});const M=async function(a){i.value=!0,o.saveCoreConfig(t.value.domain,a).then(()=>{i.value=!1,V.push({name:"providersettings"})}).catch(e=>{alert(e),i.value=!1})},$=async function(a,e){i.value=!0;for(const n of Object.values(t.value.values))n.value!==void 0&&e[n.key]==null&&(e[n.key]=n.value);e.session_id=w,o.getCoreConfigEntries(t.value.domain,a,e).then(n=>{t.value.values={};for(const g of n)t.value.values[g.key]=g;i.value=!1}).catch(n=>{alert(n),i.value=!1})};return(a,e)=>(m(),b("section",null,[s(N,null,{default:u(()=>[t.value?(m(),b("div",R,[s(S,null,{default:u(()=>[f(d(a.$t("settings.setup_provider",[l(o).providerManifests[t.value.domain].name])),1)]),_:1}),s(c,null,{default:u(()=>[f(d(l(o).providerManifests[t.value.domain].description),1)]),_:1}),e[3]||(e[3]=r("br",null,null,-1)),l(o).providerManifests[t.value.domain].codeowners.length?(m(),v(c,{key:0},{default:u(()=>[r("b",null,d(a.$t("settings.codeowners"))+": ",1),f(d(l(o).providerManifests[t.value.domain].codeowners.join(" / ")),1)]),_:1})):p("",!0),l(o).providerManifests[t.value.domain].documentation?(m(),v(c,{key:1},{default:u(()=>[r("b",null,d(a.$t("settings.need_help_setup_provider")),1),e[2]||(e[2]=f("  ")),r("a",{onClick:e[0]||(e[0]=n=>l(T)(l(o).providerManifests[t.value.domain].documentation))},d(a.$t("settings.check_docs")),1)]),_:1})):p("",!0),e[4]||(e[4]=r("br",null,null,-1)),s(C),e[5]||(e[5]=r("br",null,null,-1)),e[6]||(e[6]=r("br",null,null,-1))])):p("",!0),s(C),t.value?(m(),v(O,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:M,onAction:$},null,8,["config-entries"])):p("",!0)]),_:1}),s(j,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=n=>i.value=n),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:u(()=>[s(I,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{h as default};
