import{l as j,a8 as x,r as g,w as B,v as c,B as y,j as i,y as l,O as f,K as u,q as d,x as v,z as r,G as m,J as n}from"./index-e5db0b73.js";import{_ as $}from"./EditConfig.vue_vue_type_style_index_0_lang-0800e29c.js";import{n as N}from"./index.browser-7e542916.js";import{c as O,b as p,V as E}from"./VCard-c9b9f4e9.js";import{V as h,w as S}from"./VImg-7a057c50.js";import{f as T}from"./VMenu-d9833a31.js";import"./VExpansionPanel-671eca9e.js";import"./VTextField-46667b30.js";import"./VCheckboxBtn-46446b67.js";import"./VVirtualScroll-01555b84.js";import"./VDialog-cda0f95b.js";const z={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},D=r("br",null,null,-1),q=["href"],A=r("br",null,null,-1),G=r("br",null,null,-1),I=r("br",null,null,-1),Y=j({__name:"EditCoreConfig",props:{domain:{}},setup(C){const V=C,b=x(),e=g(),k=N(11),s=g(!1);B(()=>V.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,b.push({name:"providersettings"})}).catch(o=>{alert(o),s.value=!1})},M=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",z,[i(O,null,{default:l(()=>[f(u(t.$t("settings.setup_provider",[d(n).providerManifests[e.value.domain].name])),1)]),_:1}),i(p,null,{default:l(()=>[f(u(d(n).providerManifests[e.value.domain].description),1)]),_:1}),D,d(n).providerManifests[e.value.domain].codeowners.length?(c(),v(p,{key:0},{default:l(()=>[r("b",null,u(t.$t("settings.codeowners"))+": ",1),f(u(d(n).providerManifests[e.value.domain].codeowners.join(" / ")),1)]),_:1})):m("",!0),d(n).providerManifests[e.value.domain].documentation?(c(),v(p,{key:1},{default:l(()=>[r("b",null,u(t.$t("settings.need_help_setup_provider")),1),f("  "),r("a",{href:d(n).providerManifests[e.value.domain].documentation,target:"_blank"},u(t.$t("settings.check_docs")),9,q)]),_:1})):m("",!0),A,i(h),G,I])):m("",!0),i(h),e.value?(c(),v($,{key:1,"config-entries":Object.values(e.value.values),disabled:!1,onSubmit:w,onAction:M},null,8,["config-entries"])):m("",!0)]),_:1}),i(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(()=>[i(S,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{Y as default};
