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