import{aA as x,b as n,aB as V,M as C,d as S,P as D,br as N}from"./app-QjDgb7aF.js";import{F as P}from"./suspense-jJyLIr98.js";import{_ as j}from"./MkTab.vue_vue_type_style_index_0_lang-Cn_SAquG.js";import{b as T,E as m,j as u,g as k,i as a,k as r,I as f,u as e,q as p,D as l,J as _,H as U,a as b,f as g}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const w={value:"block"},A={value:"silence"},G=T({__name:"instance-block",setup(F){let i=b(""),c=b(""),d=b("block");async function v(){const t=await S("admin/meta");t&&(i.value=t.blockedHosts.join(`
`),c.value=t.silencedHosts.join(`
`))}function B(){D("admin/update-meta",{blockedHosts:i.value.split(`
`).map(t=>t.trim())||[],silencedHosts:c.value.split(`
`).map(t=>t.trim())||[]}).then(()=>{N()})}const M=g(()=>[]),h=g(()=>[]);return x({title:n.ts.instanceBlocking,icon:"ph-prohibit ph-bold ph-lg"}),(t,s)=>{const y=m("MkPageHeader"),H=m("MkSpacer"),I=m("MkStickyContainer");return u(),k(I,null,{header:a(()=>[r(y,{actions:M.value,tabs:h.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:a(()=>[r(H,{"content-max":700,"margin-min":16,"margin-max":32},{default:a(()=>[r(j,{modelValue:e(d),"onUpdate:modelValue":s[0]||(s[0]=o=>f(d)?d.value=o:d=o),class:"_formBlock"},{default:a(()=>[p("option",w,l(e(n).ts.blockedInstances),1),p("option",A,l(e(n).ts.silencedInstances),1)]),_:1},8,["modelValue"]),r(P,{p:v},{default:a(()=>[e(d)==="block"?(u(),k(V,{key:0,modelValue:e(i),"onUpdate:modelValue":s[1]||(s[1]=o=>f(i)?i.value=o:i=o),class:"_formBlock"},{caption:a(()=>[_(l(e(n).ts.blockedInstancesDescription),1)]),default:a(()=>[p("span",null,l(e(n).ts.blockedInstances),1)]),_:1},8,["modelValue"])):e(d)==="silence"?(u(),k(V,{key:1,modelValue:e(c),"onUpdate:modelValue":s[2]||(s[2]=o=>f(c)?c.value=o:c=o),class:"_formBlock"},{caption:a(()=>[_(l(e(n).ts.silencedInstancesDescription),1)]),default:a(()=>[p("span",null,l(e(n).ts.silencedInstances),1)]),_:1},8,["modelValue"])):U("",!0),r(C,{primary:"",class:"_formBlock",onClick:B},{default:a(()=>[s[3]||(s[3]=p("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1)),_(" "+l(e(n).ts.save),1)]),_:1})]),_:1})]),_:1})]),_:1})}}});export{G as default};
//# sourceMappingURL=instance-block-D8sb55pH.js.map
