import{Q as E,x as y,w as N,Z as C,B as s,U as u,bm as T,b3 as $,S as m,a9 as p,R as v,W as r,aU as j,al as f,aa as d,a0 as l,a4 as o,aV as c,bT as S,Y as b,bn as O}from"./index-orrnp8a1.js";import{E as U}from"./EditConfig-B4rbu_aP.js";import{n as D}from"./index.browser-OxPLOBIU.js";import{f as I}from"./VBtn-BJolvyKt.js";import"./VForm-BDfEPrwE.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./VExpansionPanels-CT7PNnnx.js";import"./VAlert-BhQ3L7Kc.js";import"./VSwitch-Cg3DDPQB.js";import"./VTextField-DaF8PfrV.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VChip-DzIcRFdM.js";import"./VSlider-G4xlE4rG.js";import"./VDialog-oxeMlk6d.js";import"./VSpacer-FMK5QbR9.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const R={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},ee=E({__name:"EditCoreConfig",props:{domain:{}},setup(V){const k=O(),t=y(),w=D(11),i=y(!1),M=V;N(()=>M.domain,async a=>{a&&(t.value=await o.getCoreConfig(a))},{immediate:!0});const x=async function(a){i.value=!0,o.saveCoreConfig(t.value.domain,a).then(()=>{i.value=!1,k.push({name:"providersettings"})}).catch(e=>{alert(e),i.value=!1})},B=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(),C("section",null,[s(T,null,{default:u(()=>[t.value?(m(),C("div",R,[s(j,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(S)(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(b),e[5]||(e[5]=r("br",null,null,-1)),e[6]||(e[6]=r("br",null,null,-1))])):p("",!0),s(b),t.value?(m(),v(U,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:x,onAction:B},null,8,["config-entries"])):p("",!0)]),_:1}),s($,{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{ee as default};
