import{l as M,a6 as j,r as g,w as N,v as c,A as y,j as i,y as l,N as m,J as u,q as d,x as p,I as r,D as f,H as n}from"./index-dcf0de03.js";import{_ as $}from"./EditConfig.vue_vue_type_style_index_0_lang-80768ce3.js";import{n as B}from"./index.browser-7e542916.js";import{c as D,b as v,V as E}from"./VCard-111cabcf.js";import{b as h,e as O}from"./VMenu-3bdd1b96.js";import{x as S}from"./VBtn-a0da5efe.js";import"./VExpansionPanel-286d9c63.js";import"./VTextField-f81f9175.js";import"./index-0afee102.js";import"./VCheckboxBtn-d54a899d.js";import"./VListItem-943ee224.js";import"./VSpacer-4e341220.js";import"./VDialog-ccbfddc9.js";const T={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},A=r("br",null,null,-1),I=["href"],q=r("br",null,null,-1),z=r("br",null,null,-1),H=r("br",null,null,-1),ee=M({__name:"EditCoreConfig",props:{domain:{}},setup(C){const b=C,V=j(),e=g(),k=B(11),s=g(!1);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)=>(c(),y("section",null,[i(E,null,{default:l(()=>[e.value?(c(),y("div",T,[i(D,null,{default:l(()=>[m(u(t.$t("settings.setup_provider",[d(n).providerManifests[e.value.domain].name])),1)]),_:1}),i(v,null,{default:l(()=>[m(u(d(n).providerManifests[e.value.domain].description),1)]),_:1}),A,d(n).providerManifests[e.value.domain].codeowners.length?(c(),p(v,{key:0},{default:l(()=>[r("b",null,u(t.$t("settings.codeowners"))+": ",1),m(u(d(n).providerManifests[e.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),d(n).providerManifests[e.value.domain].documentation?(c(),p(v,{key:1},{default:l(()=>[r("b",null,u(t.$t("settings.need_help_setup_provider")),1),m("  "),r("a",{href:d(n).providerManifests[e.value.domain].documentation,target:"_blank"},u(t.$t("settings.check_docs")),9,I)]),_:1})):f("",!0),q,i(h),z,H])):f("",!0),i(h),e.value?(c(),p($,{key:1,"config-entries":Object.values(e.value.values),disabled:!1,onSubmit:w,onAction:x},null,8,["config-entries"])):f("",!0)]),_:1}),i(O,{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(()=>[i(S,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{ee as default};
