import{r as p,o,g as a,a as e,u as n,F as K,D as B,c as N,w as V,t as g,h as y,f as m,i as r,b as u,a_ as _}from"./app-DA7OTM4Q.js";import{u as R}from"./app-BT68AfZ-.js";import{T as I}from"./app-BkWUIifj.js";import{_ as k}from"./app-DuUYZNNT.js";import{T as U}from"./app-Zes_jb7S.js";import{P}from"./app-DEIWLCpe.js";import{_ as S}from"./app-a9KqBnqw.js";const z=["value"],A={class:"label-group mb-2"},D={key:0,title:"不区分大小写"},F=e("i",{class:"icon info tiny"},null,-1),H=[F],J={key:1},L={key:2},O=e("span",{class:"small grey"},"[空]",-1),E=[O],M=["onClick"],j=e("i",{class:"icon remove small"},null,-1),q=[j],G={key:0},Q={class:"ui table definition"},W=e("td",{class:"title"},"替换前内容 *",-1),X=e("td",null,"替换后内容",-1),Y=e("td",null,"忽略大小写",-1),Z=e("i",{class:"icon remove small"},null,-1),ee=[Z],te={key:1},de={__name:"HTTPHeaderReplaceValues",props:["v-replace-values"],setup(C){const b=R(),x=C,f=p(),{values:d,isAdding:c,addingValue:l}=function(){let i=x.vReplaceValues;return i==null&&(i=[]),{values:p(i),isAdding:p(!1),addingValue:p({pattern:"",replacement:"",isCaseInsensitive:!1,isRegexp:!1})}}(),T=function(){c.value=!0,setTimeout(function(){f.value.focus()})},$=function(i){d.value.$remove(i)},v=function(){if(l.value.pattern.length==0){b.warn("替换前内容不能为空",function(){f.value.focus()});return}d.value.push(l.value),h()},h=function(){c.value=!1,l.value={pattern:"",replacement:"",isCaseInsensitive:!1,isRegexp:!1}};return(i,s)=>(o(),a("div",null,[e("input",{type:"hidden",name:"replaceValuesJSON",value:JSON.stringify(n(d))},null,8,z),e("div",A,[(o(!0),a(K,null,B(n(d),(t,w)=>(o(),N(I,{outlined:""},{default:V(()=>[e("var",null,g(t.pattern),1),t.isCaseInsensitive?(o(),a("sup",D,H)):y("",!0),m(" => "),t.replacement.length>0?(o(),a("var",J,g(t.replacement),1)):(o(),a("var",L,E)),m("  "),e("a",{href:"",onClick:r(se=>$(w),["prevent"]),title:"删除"},q,8,M)]),_:2},1024))),256))]),n(c)?(o(),a("div",G,[e("table",Q,[e("tr",null,[W,e("td",null,[u(k,{type:"text",modelValue:n(l).pattern,"onUpdate:modelValue":s[0]||(s[0]=t=>n(l).pattern=t),placeholder:"替换前内容",ref_key:"patternRef",ref:f,onKeyup:s[1]||(s[1]=_(t=>v(),["enter"])),onKeypress:_(r(t=>1,["prevent"]),["enter"]),class:"w-full"},null,8,["modelValue","onKeypress"])])]),e("tr",null,[X,e("td",null,[u(k,{type:"text",modelValue:n(l).replacement,"onUpdate:modelValue":s[2]||(s[2]=t=>n(l).replacement=t),placeholder:"替换后内容",onKeyup:s[3]||(s[3]=_(t=>v(),["enter"])),onKeypress:_(r(t=>1,["prevent"]),["enter"]),class:"w-full"},null,8,["modelValue","onKeypress"])])]),e("tr",null,[Y,e("td",null,[u(S,{modelValue:n(l).isCaseInsensitive,"onUpdate:modelValue":s[4]||(s[4]=t=>n(l).isCaseInsensitive=t)},null,8,["modelValue"])])])]),e("div",null,[u(U,{type:"button",secondary:"",size:"small",onClick:r(v,["prevent"])},{default:V(()=>[m("确定")]),_:1}),m("   "),e("a",{href:"",title:"取消",onClick:r(h,["prevent"])},ee)])])):y("",!0),n(c)?y("",!0):(o(),a("div",te,[u(P,{type:"button",secondary:"",size:"small",onClick:r(T,["prevent"])})]))]))}};export{de as _};
