import{b as E,a as v,w as W,j as S,p as T,k as n,i as u,q as r,D as s,u as o,l as b,v as g,J as d}from"./vue-Cm77DuTi.js";import{v as B,$ as j,aA as A,b as e,a9 as y,aB as D,M as C,d as N,q as U}from"./app-QjDgb7aF.js";import{_ as q}from"./MkTab.vue_vue_type_style_index_0_lang-Cn_SAquG.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const R={class:"_formRoot"},I={value:"soft"},J={value:"hard"},P={class:"_formBlock"},O=E({__name:"word-mute",setup(z){const w=i=>i.map(t=>Array.isArray(t)?t.join(" "):t).join(`
`),p=v("soft"),m=v(w(B.state.mutedWords)),f=v(w(j.mutedWords)),c=v(!1);W(m,()=>{c.value=!0}),W(f,()=>{c.value=!0});async function x(){const i=(k,$)=>{let _=k.trim().split(`
`).map(l=>l.trim()).filter(l=>l!=="");for(let l=0;l<_.length;l++){const h=_[l],M=h.match(/^\/(.+)\/(.*)$/);if(M)try{new RegExp(M[1],M[2])}catch(V){throw U({type:"error",title:e.ts.regexpError,text:e.t("regexpErrorDescription",{tab:$,line:l+1})+`
`+V.toString()}),V}else _[l]=h.split(" ")}return _};let t,a;try{t=i(m.value,e.ts._wordMute.soft),a=i(f.value,e.ts._wordMute.hard)}catch{return}B.set("mutedWords",t),await N("i/update",{mutedWords:a}),c.value=!1}return A({title:e.ts.wordMute,icon:"ph-speaker-x ph-bold ph-lg"}),(i,t)=>(S(),T("div",R,[n(q,{modelValue:p.value,"onUpdate:modelValue":t[0]||(t[0]=a=>p.value=a),class:"_formBlock"},{default:u(()=>[r("option",I,s(o(e).ts._wordMute.soft),1),r("option",J,s(o(e).ts._wordMute.hard),1)]),_:1},8,["modelValue"]),r("div",P,[b(r("div",null,[n(y,{class:"_formBlock"},{default:u(()=>[d(s(o(e).ts._wordMute.softDescription),1)]),_:1}),n(D,{modelValue:m.value,"onUpdate:modelValue":t[1]||(t[1]=a=>m.value=a),class:"_formBlock"},{caption:u(()=>[d(s(o(e).ts._wordMute.muteWordsDescription),1),t[4]||(t[4]=r("br",null,null,-1)),d(s(o(e).ts._wordMute.muteWordsDescription2),1)]),default:u(()=>[r("span",null,s(o(e).ts._wordMute.muteWords),1)]),_:1},8,["modelValue"])],512),[[g,p.value==="soft"]]),b(r("div",null,[n(y,{class:"_formBlock"},{default:u(()=>[d(s(o(e).ts._wordMute.hardDescription)+" "+s(o(e).ts.reflectMayTakeTime),1)]),_:1}),n(D,{modelValue:f.value,"onUpdate:modelValue":t[2]||(t[2]=a=>f.value=a),class:"_formBlock"},{caption:u(()=>[d(s(o(e).ts._wordMute.muteWordsDescription),1),t[5]||(t[5]=r("br",null,null,-1)),d(s(o(e).ts._wordMute.muteWordsDescription2),1)]),default:u(()=>[r("span",null,s(o(e).ts._wordMute.muteWords),1)]),_:1},8,["modelValue"])],512),[[g,p.value==="hard"]])]),n(C,{primary:"",inline:"",disabled:!c.value,onClick:t[3]||(t[3]=a=>x())},{default:u(()=>[t[6]||(t[6]=r("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1)),d(" "+s(o(e).ts.save),1)]),_:1},8,["disabled"])]))}});export{O as default};
//# sourceMappingURL=word-mute-D2eF9ebA.js.map
