import{Q as E,x as b,w as N,Z as y,B as s,U as u,bF as $,bh as j,S as m,a9 as p,R as v,W as r,b0 as S,ao as f,ab as d,a0 as l,a4 as o,b1 as c,ca as T,Y as C,bG as O}from"./index-Dgb2Jv0W.js";import{E as D}from"./EditConfig-lZy34s6t.js";import{n as I}from"./index.browser-OxPLOBIU.js";import{b as R}from"./VBtn-DuScqEn1.js";import"./VForm-D3vVGrIr.js";import"./VCheckboxBtn-CmCi1_nS.js";import"./VExpansionPanels-BtLgc7tU.js";import"./VAlert-D-qqP7Pv.js";import"./VSwitch-DM3Rm0eZ.js";import"./VTextField-ERCRwdIS.js";import"./VVirtualScroll-Dsnd1ROl.js";import"./VSlider-D58wYNEc.js";import"./VDialog-YxDgK53D.js";import"./VSpacer-BOxMbL4y.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const U={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},X=E({__name:"EditCoreConfig",props:{domain:{}},setup(k){const V=O(),t=b(),w=I(11),i=b(!1),M=k;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,V.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(),y("section",null,[s($,null,{default:u(()=>[t.value?(m(),y("div",U,[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(D,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:x,onAction:B},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(R,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{X as default};
