System.register(["./public-legacy.js?v=1753954525509","./page_layout-legacy.js?v=1753954525509","./setting-legacy.js?v=1753954525509","./naive-legacy.js?v=1753954525509","./vue-legacy.js?v=1753954525509","./common-legacy.js?v=1753954525509","./__commonjsHelpers__-legacy.js?v=1753954525509"],(function(e,l){"use strict";var a,t,n,i,s,u,c,r,o,d,p,g,f,m,y,v,V,_,x,h,b,w,S,W,k,j,E,C,P,B,N;return{setters:[e=>{a=e.b,t=e.h,n=e.d,i=e.f,s=e._},e=>{u=e.w,c=e.m},e=>{r=e.f,o=e.m,d=e.h,p=e.i,g=e.j},e=>{f=e.aq,m=e.c5,y=e.ay},e=>{v=e.k,V=e.t,_=e.P,x=e.e,h=e.r,b=e.Q,w=e.F,S=e.n,W=e.U,k=e.V,j=e.W,E=e.X,C=e.a2,P=e.j,B=e.a3,N=e.N},null,null],execute:function(){const l={class:"p-20px"},U={class:"flex mb-12px"},$={class:"flex-1 mr-12px"},z={class:"w-150px mr-12px"},D={class:"text-error"};e("default",v({__name:"index",props:{type:{}},setup(e,{expose:v}){const R=V(e,"type"),{t:q}=_(),A=x({ruleValue:"",ps:""}),F=async()=>{""!==A.ruleValue.trim()?(await g({...N(A),ruleName:R.value}),O(),A.ruleValue="",A.ps=""):c.error(q("Waf.Setting.config_194"))},H=h(null),L=h(null),{table:Q,columns:X,setLoading:G}=a([{key:"rule",title:q("Waf.Setting.config_82"),render:e=>b(w,null,[e.isEdit?b(f,{ref:H,value:e.ruleVal,size:"small",type:"textarea",autosize:{minRows:2,maxRows:2},placeholder:"",onUpdateValue:l=>{e.ruleVal=l}},null):e.rule])},{key:"ps",title:q("Waf.Setting.config_190"),width:150,render:e=>b(w,null,[e.isEdit?b(f,{ref:L,value:e.psVal,size:"small",placeholder:"",onUpdateValue:l=>{e.psVal=l}},null):e.ps])},{key:"status",title:q("Waf.Setting.config_82"),width:60,render:(e,l)=>b(m,{value:e.status,size:"small",checkedValue:1,uncheckedValue:0,onUpdateValue:async a=>{await r({index:l,ruleName:R.value}),e.status=a}},null)},t({width:100,options:(e,l)=>e.isEdit?[{label:q("Public.Btn.Save"),onClick:()=>{J(e,l)}},{label:q("Public.Btn.Cancel"),onClick:()=>{K(e)}}]:[{label:q("Public.Btn.Edit"),onClick:()=>{I(e)}},{label:q("Public.Btn.Del"),show:e.isDel,onClick:()=>{M(e,l)}}]})]),I=e=>{e.isEdit=!0,S((()=>{H.value?.focus()}))},J=async(e,l)=>{e.isEdit=!1,await o({index:l,ruleBody:e.ruleVal,rulePs:e.psVal,ruleName:R.value}),e.rule=e.ruleVal,e.ps=e.psVal},K=e=>{e.isEdit=!1,e.ruleVal=e.rule,e.psVal=e.ps},M=async(e,l)=>{n({title:q("Waf.Setting.config_195",[e.rule]),content:q("Waf.Setting.config_196"),onConfirm:async()=>{await d({index:l,ruleName:R.value}),O()}})},O=async()=>{try{G(!0);const{message:e}=await p({ruleName:R.value});u(e)&&(Q.data=e.map((e=>({rule:e[1],ruleVal:e[1],ps:e[2],psVal:e[2],status:e[0],isEdit:!1,isDel:1===e[3]}))))}finally{G(!1)}};return O(),v({init:O}),(e,a)=>{const t=y,n=i,u=s;return W(),k("div",l,[j("div",U,[j("div",$,[b(E(f),{value:E(A).ruleValue,"onUpdate:value":a[0]||(a[0]=e=>E(A).ruleValue=e),placeholder:e.$t("Waf.Setting.config_189")},null,8,["value","placeholder"])]),j("div",z,[b(E(f),{value:E(A).ps,"onUpdate:value":a[1]||(a[1]=e=>E(A).ps=e),placeholder:e.$t("Waf.Setting.config_190")},null,8,["value","placeholder"])]),b(t,{type:"primary",onClick:F},{default:C((()=>[P(B(e.$t("Public.Btn.Add")),1)])),_:1})]),b(n,{"max-height":340,loading:E(Q).loading,data:E(Q).data,columns:E(X)},null,8,["loading","data","columns"]),b(u,{class:"mt-16px"},{default:C((()=>[j("li",D,B(e.$t("Waf.Setting.config_191")),1),j("li",null,B(e.$t("Waf.Setting.config_192")),1),j("li",null,B(e.$t("Waf.Setting.config_193")),1)])),_:1})])}}}))}}}));
