import{_ as w}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{n as y,h as $}from"./index-BTglIPU2.js?v=1773287522785";import{i as N,r as S}from"./tools-CMJvIbk2.js?v=1773287522785";import{a1 as W,a6 as A,aH as R,B as V}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as E,R as L,r as _,e as P,$ as j,Z as D,a0 as a,a9 as n,_ as H,S as l,j as p,aa as u}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./rules-pmZEUQ_o.js?v=1773287522785";const I={class:"p-20px pt-24px pb-8px"},O={class:"w-260px"},K=E({__name:"clear",setup(T,{expose:m}){const{t:i}=L(),r=_(null),t=P({site:[]}),f={site:{trigger:["change"],validator:()=>t.site.length===0?new Error(i("Waf.Block.index_27")):!0}},s=_([]),d=()=>{t.site=s.value.map(e=>e.value)},g=()=>{t.site=[]},v=async()=>{const{message:e}=await N();y(e)&&(s.value=e.map(o=>({label:o.siteName,value:o.siteName})))},x=async()=>{var e;return await((e=r.value)==null?void 0:e.validate()),$({title:i("Waf.Block.index_28"),content:i("Waf.Block.index_29"),onConfirm:async()=>{const o=t.site.length===s.value.length;await S({safe_logs:0,site_all:o?1:0,site_logs:t.site})}}),!1};return v(),m({onConfirm:x}),(e,o)=>{const c=V,h=R,k=A,B=W,b=w;return j(),D("div",I,[a(b,{ref_key:"formRef",ref:r,model:l(t),rules:f},{default:n(()=>[a(B,{label:e.$t("Waf.Block.index_25"),path:"site"},{default:n(()=>[H("div",O,[a(k,{value:l(t).site,"onUpdate:value":o[0]||(o[0]=C=>l(t).site=C),options:l(s),multiple:!0,filterable:!0,"max-tag-count":"responsive",placeholder:e.$t("Waf.Block.index_27")},{header:n(()=>[a(h,{class:"w-full"},{default:n(()=>[a(c,{class:"flex-1",onClick:d},{default:n(()=>[p(u(e.$t("Public.All")),1)]),_:1}),a(c,{class:"flex-1",onClick:g},{default:n(()=>[p(u(e.$t("Public.Btn.Cancel")),1)]),_:1})]),_:1})]),_:1},8,["value","options","placeholder"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{K as default};
