import{x as E,az as N,r as y,w as $,y as m,D as C,n as r,A as u,I as a,S as p,J as d,G as s,B as l,z as v,K as f,aR as j}from"./index-DuDRe8hE.js";import{E as S}from"./EditConfig-cy0cMyvl.js";import{n as T}from"./index.browser-OxPLOBIU.js";import{b as z,V as D,a as c}from"./VCardText-Dn8Yf3BC.js";import{e as I}from"./VMenu-B49kEbTj.js";import{V}from"./VList-BlpguAX2.js";import{C as O}from"./VListItem-CuoSvcqW.js";import"./VExpansionPanels-BNWc0M_m.js";import"./VCheckboxBtn-CMIUd74V.js";import"./VAlert-sqJ4UeFM.js";import"./VSwitch--4YJ0kPH.js";import"./VTextField-D5EFKWzi.js";import"./VVirtualScroll-CdwGYB7u.js";import"./VChip-BRQkwjNJ.js";import"./VSlider-BanbeyJ6.js";import"./VForm-COUW7cJR.js";import"./VCard-Cf5RelEw.js";import"./VSpacer-CYzCqmAo.js";/* empty css              */import"./VDialog-BsvLwk-0.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const A={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},ae=E({__name:"EditCoreConfig",props:{domain:{}},setup(b){const k=N(),t=y(),w=T(11),i=y(!1),M=b;$(()=>M.domain,async o=>{o&&(t.value=await a.getCoreConfig(o))},{immediate:!0});const x=async function(o){i.value=!0,a.saveCoreConfig(t.value.domain,o).then(()=>{i.value=!1,k.push({name:"providersettings"})}).catch(e=>{alert(e),i.value=!1})},B=async function(o,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,a.getCoreConfigEntries(t.value.domain,o,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(o,e)=>(m(),C("section",null,[r(z,null,{default:u(()=>[t.value?(m(),C("div",A,[r(D,null,{default:u(()=>[p(d(o.$t("settings.setup_provider",[s(a).providerManifests[t.value.domain].name])),1)]),_:1}),r(c,null,{default:u(()=>[p(d(s(a).providerManifests[t.value.domain].description),1)]),_:1}),e[3]||(e[3]=l("br",null,null,-1)),s(a).providerManifests[t.value.domain].codeowners.length?(m(),v(c,{key:0},{default:u(()=>[l("b",null,d(o.$t("settings.codeowners"))+": ",1),p(d(s(a).providerManifests[t.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),s(a).providerManifests[t.value.domain].documentation?(m(),v(c,{key:1},{default:u(()=>[l("b",null,d(o.$t("settings.need_help_setup_provider")),1),e[2]||(e[2]=p("  ")),l("a",{onClick:e[0]||(e[0]=n=>s(j)(s(a).providerManifests[t.value.domain].documentation))},d(o.$t("settings.check_docs")),1)]),_:1})):f("",!0),e[4]||(e[4]=l("br",null,null,-1)),r(V),e[5]||(e[5]=l("br",null,null,-1)),e[6]||(e[6]=l("br",null,null,-1))])):f("",!0),r(V),t.value?(m(),v(S,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:x,onAction:B},null,8,["config-entries"])):f("",!0)]),_:1}),r(I,{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(()=>[r(O,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{ae as default};
