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