System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1763625242172","./vue-legacy.js?v=1763625242172","./page_layout-legacy.js?v=1763625242172","./naive-legacy.js?v=1763625242172","./__commonjsHelpers__-legacy.js?v=1763625242172","./common-legacy.js?v=1763625242172","./public-legacy.js?v=1763625242172"],(function(e,l){"use strict";var a,t,r,o,u,s,i,n,p,c,d,y,f,_,v,m,b,w,h,g,x,S,A,F,j;return{setters:[e=>{a=e._},e=>{t=e.k,r=e.P,o=e.r,u=e.e,s=e.R,i=e.S,n=e.X,p=e.a3,c=e.U,d=e.V,y=e.l,f=e.v,_=e.a2,v=e.an},e=>{m=e.b5,b=e.gW,w=e.x,h=e.l,g=e.gX,x=e.gY},e=>{S=e.dV,A=e.dP,F=e.df,j=e._},null,null,null],execute:function(){const l={class:"px-20px pt-24px pb-8px"},U={class:"w-240px"},$={class:"w-240px"},k={class:"w-240px"},E={class:"w-240px"};e("default",t({__name:"form",props:{row:{},isEdit:{type:Boolean,default:!1}},emits:["refresh"],setup(e,{expose:t,emit:P}){const C=e,H=P,{t:R}=r(),{isEdit:V,row:X}=C,B=o(null),I=u({types:"drop",choose:"all",ports:null,country:["United States"],is_update:!1}),W={country:{trigger:"change",validator:()=>0!==I.country.length||new Error(R("Security.Firewall.Area.form_8"))},ports:{trigger:["blur","input"],validator:()=>{if("point"===I.choose){if(!I.ports)return new Error(R("Security.Firewall.Area.form_9"));if(!m(`${I.ports}`))return new Error(R("Security.Firewall.Area.form_10"))}return!0}}},Y=[{label:R("Security.Firewall.Area.form_11"),value:"all"},{label:R("Security.Firewall.Area.form_3"),value:"point"}],q=[{label:R("Security.Firewall.Area.form_12"),value:"drop"}],z=o(!1),D=o([]);return(async()=>{try{z.value=!0;const{message:e}=await b();w(e)&&(D.value=e.map((e=>({label:e.CH,value:e.CH,brief:e.brief}))))}finally{z.value=!1}})(),V&&X&&(I.types=X.types,I.choose=X.ports?"point":"all",I.ports=X.ports?h(X.ports):null,I.country=X.country),t({onConfirm:async()=>{await(B.value?.validate());const e={types:I.types,choose:I.choose,ports:"point"===I.choose?`${I.ports||""}`:"",country:I.country,brief:"",is_update:I.is_update};V&&X?(e.brief=`${D.value.find((e=>e.label===X.country))?.brief||""}`,await g({...e,id:X.id})):await x(e),H("refresh")}}),(e,t)=>{const r=S,o=A,u=F,m=j,b=a;return s(),i("div",l,[n(b,{ref_key:"formRef",ref:B,model:d(I),rules:W},{default:p((()=>[n(o,{label:e.$t("Security.Firewall.Area.form_1"),path:"types"},{default:p((()=>[c("div",U,[n(r,{value:d(I).types,"onUpdate:value":t[0]||(t[0]=e=>d(I).types=e),options:q},null,8,["value"])])])),_:1},8,["label"]),n(o,{label:e.$t("Security.Firewall.Area.form_2"),path:"choose"},{default:p((()=>[c("div",$,[n(r,{value:d(I).choose,"onUpdate:value":t[1]||(t[1]=e=>d(I).choose=e),options:Y},null,8,["value"])])])),_:1},8,["label"]),y(n(o,{label:e.$t("Security.Firewall.Area.form_3"),path:"ports"},{default:p((()=>[c("div",k,[n(u,{value:d(I).ports,"onUpdate:value":t[2]||(t[2]=e=>d(I).ports=e),min:1,max:65535,"show-button":!1,placeholder:e.$t("Security.Firewall.Area.form_4")},null,8,["value","placeholder"])])])),_:1},8,["label"]),[[f,"point"===d(I).choose]]),n(o,{label:e.$t("Security.Firewall.Area.form_5"),path:"country"},{default:p((()=>[c("div",E,[n(r,{value:d(I).country,"onUpdate:value":t[3]||(t[3]=e=>d(I).country=e),filterable:"","max-tag-count":"responsive",multiple:!d(V),loading:d(z),options:d(D)},null,8,["value","multiple","loading","options"])])])),_:1},8,["label"]),d(V)?v("",!0):(s(),_(o,{key:0,label:" "},{default:p((()=>[n(m,{checked:d(I).is_update,"onUpdate:checked":t[4]||(t[4]=e=>d(I).is_update=e),label:"Update IP Pool"},null,8,["checked"])])),_:1}))])),_:1},8,["model"])])}}}))}}}));
