import{d as $,r as y,ae as j,c as b,b as s,w as u,bJ as x,bm as B,o as m,e as f,h as v,a as r,b4 as T,b5 as p,t as d,u as l,v as a,b6 as c,ch as O,y as C,f as S}from"./index-CD7iYaFT.js";import{E as D}from"./EditConfig-BoSMCX1M.js";import{n as I}from"./index.browser-OxPLOBIU.js";import{b as _}from"./VBtn-B0XatuYF.js";import"./VForm-CSOJ83b-.js";import"./VInput-DDFZ8lhb.js";import"./VExpansionPanels-TUY6dJc5.js";import"./VAlert-cuze2JsR.js";import"./VSwitch-Bf96mRby.js";import"./VTextField-CVfOZKc3.js";import"./VVirtualScroll-BREm3RjH.js";import"./VSlider-Vu2fOVGH.js";import"./VDialog-3VB6G7S5.js";import"./VSpacer-B8t0Vh55.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const h={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},Z=$({__name:"EditCoreConfig",props:{domain:{}},setup(k){const V=S(),t=y(),w=I(11),i=y(!1),M=k;j(()=>M.domain,async n=>{n&&(t.value=await a.getCoreConfig(n))},{immediate:!0});const E=async function(n){i.value=!0,a.saveCoreConfig(t.value.domain,n).then(()=>{i.value=!1,V.push({name:"providersettings"})}).catch(e=>{alert(e),i.value=!1})},N=async function(n,e){i.value=!0;for(const o of Object.values(t.value.values))o.value!==void 0&&e[o.key]==null&&(e[o.key]=o.value);e.session_id=w,a.getCoreConfigEntries(t.value.domain,n,e).then(o=>{t.value.values={};for(const g of o)t.value.values[g.key]=g;i.value=!1}).catch(o=>{alert(o),i.value=!1})};return(n,e)=>(m(),b("section",null,[s(x,null,{default:u(()=>[t.value?(m(),b("div",h,[s(T,null,{default:u(()=>[p(d(n.$t("settings.setup_provider",[l(a).providerManifests[t.value.domain].name])),1)]),_:1}),s(c,null,{default:u(()=>[p(d(l(a).providerManifests[t.value.domain].description),1)]),_:1}),e[3]||(e[3]=r("br",null,null,-1)),l(a).providerManifests[t.value.domain].codeowners.length?(m(),v(c,{key:0},{default:u(()=>[r("b",null,d(n.$t("settings.codeowners"))+": ",1),p(d(l(a).providerManifests[t.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),l(a).providerManifests[t.value.domain].documentation?(m(),v(c,{key:1},{default:u(()=>[r("b",null,d(n.$t("settings.need_help_setup_provider")),1),e[2]||(e[2]=p("  ",-1)),r("a",{onClick:e[0]||(e[0]=o=>l(O)(l(a).providerManifests[t.value.domain].documentation))},d(n.$t("settings.check_docs")),1)]),_:1})):f("",!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))])):f("",!0),s(C),t.value?(m(),v(D,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:E,onAction:N},null,8,["config-entries"])):f("",!0)]),_:1}),s(B,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=o=>i.value=o),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:u(()=>[s(_,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{Z as default};
