import{v as M,aa as B,r as g,w as N,y as m,E as y,l as r,A as l,Q as c,N as u,x as d,z as p,B as i,I as f,L as n}from"./index-5804982a.js";import{_ as $}from"./EditConfig.vue_vue_type_style_index_0_lang-884cccde.js";import{n as j}from"./index.browser-342e672c.js";import{a as E,V as O}from"./VCardText-963b2439.js";import{a as v}from"./VCard-cc8044ef.js";import{k as h,x as S}from"./forwardRefs-03519353.js";import{f as T}from"./VMenu-18f2572a.js";import"./VExpansionPanel-3bba88b7.js";import"./VInput-fe7a35fc.js";import"./VSlideGroup-711de993.js";import"./VForm-85034c32.js";/* empty css              */import"./VDialog-c56f60de.js";import"./VAlert-8600f5db.js";import"./VTextField-b58cde95.js";import"./VSelect-e6597dd4.js";import"./VVirtualScroll-72995e2a.js";const z={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},A=i("br",null,null,-1),D=["href"],I=i("br",null,null,-1),L=i("br",null,null,-1),P=i("br",null,null,-1),ne=M({__name:"EditCoreConfig",props:{domain:{}},setup(C){const V=B(),e=g(),k=j(11),s=g(!1),b=C;N(()=>b.domain,async t=>{t&&(e.value=await n.getCoreConfig(t))},{immediate:!0});const w=async function(t){s.value=!0,n.saveCoreConfig(e.value.domain,t).then(()=>{s.value=!1,V.push({name:"providersettings"})}).catch(o=>{alert(o),s.value=!1})},x=async function(t,o){s.value=!0;for(const a of Object.values(e.value.values))a.value!==void 0&&o[a.key]==null&&(o[a.key]=a.value);o.session_id=k,n.getCoreConfigEntries(e.value.domain,t,o).then(a=>{e.value.values={};for(const _ of a)e.value.values[_.key]=_;s.value=!1}).catch(a=>{alert(a),s.value=!1})};return(t,o)=>(m(),y("section",null,[r(O,null,{default:l(()=>[e.value?(m(),y("div",z,[r(E,null,{default:l(()=>[c(u(t.$t("settings.setup_provider",[d(n).providerManifests[e.value.domain].name])),1)]),_:1}),r(v,null,{default:l(()=>[c(u(d(n).providerManifests[e.value.domain].description),1)]),_:1}),A,d(n).providerManifests[e.value.domain].codeowners.length?(m(),p(v,{key:0},{default:l(()=>[i("b",null,u(t.$t("settings.codeowners"))+": ",1),c(u(d(n).providerManifests[e.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),d(n).providerManifests[e.value.domain].documentation?(m(),p(v,{key:1},{default:l(()=>[i("b",null,u(t.$t("settings.need_help_setup_provider")),1),c("  "),i("a",{href:d(n).providerManifests[e.value.domain].documentation,target:"_blank"},u(t.$t("settings.check_docs")),9,D)]),_:1})):f("",!0),I,r(h),L,P])):f("",!0),r(h),e.value?(m(),p($,{key:1,"config-entries":Object.values(e.value.values),disabled:!1,onSubmit:w,onAction:x},null,8,["config-entries"])):f("",!0)]),_:1}),r(T,{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=a=>s.value=a),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:l(()=>[r(S,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{ne as default};
