import{_ as k}from"./BOhf1Bbf.js";import{j as d,d as g,w,m as t,S as j,o as i,b as s,G as m,c as n,e as c,t as r,D as b,I as y,E as S,am as B}from"./Bgmy51Qv.js";import"./CNIrc0EA.js";import"./DZl4_Bww.js";import"./AmaTRG5a.js";import"./BHvLfWtM.js";import"./DuSynPle.js";import"./B2895E6R.js";import"./D_7E8SMU.js";import"./7pZkuj9N.js";const D={class:"input-wrapper"},F=["placeholder"],P={key:0,class:"error"},V={class:"input-wrapper"},C=["placeholder"],U={key:0,class:"error"},q={class:"input-wrapper"},R={class:"mr-10"},z={key:0},H={key:1},M={key:0,class:"textarea"},N=["placeholder"],A={key:2,class:"error"},Y={__name:"[id]",setup(G){const u=d(!0);d(!1);const e=d({id:"",title:"",subject:"",body:""}),f=d(null),v=()=>{e.value.body=B.sanitize(e.value.body),f.value.checkForm()},_=()=>{u.value=!u.value};return(o,l)=>{const h=k,$=j("dompurify-html");return i(),g(h,{ref_key:"dataPageRef",ref:f,"set-api":"setSubscriptionEmailFormat","get-api":"getSubscriptionEmailFormat","route-name":"subscription-email-formats",name:o.$t("dataPage.sefUp"),"validation-keys":["title","subject","body"],result:t(e),"emit-before-submit":!0,gate:"subscription_email_format","empty-store-variable":"allSubscriptionEmailFormats",onResult:l[3]||(l[3]=a=>e.value=a),onBeforeSubmit:v},{form:w(({hasError:a})=>[s("div",D,[s("label",null,r(o.$t("index.title")),1),m(s("input",{type:"text",placeholder:o.$t("index.title"),name:"title","onUpdate:modelValue":l[0]||(l[0]=p=>t(e).title=p),class:b({invalid:!t(e).title&&a})},null,10,F),[[y,t(e).title]]),!t(e).title&&a?(i(),n("span",P,r(o.$t("category.req",{type:o.$t("index.title")})),1)):c("",!0)]),s("div",V,[s("label",null,r(o.$t("util.sub")),1),m(s("input",{type:"text",placeholder:o.$t("util.sub"),name:"subject","onUpdate:modelValue":l[1]||(l[1]=p=>t(e).subject=p),class:b({invalid:!t(e).subject&&a})},null,10,C),[[y,t(e).subject]]),!t(e).subject&&a?(i(),n("span",U,r(o.$t("category.req",{type:o.$t("util.sub")})),1)):c("",!0)]),s("div",q,[s("label",null,[s("span",R,r(o.$t("profile.body")),1),s("button",{type:"button",class:"btn-clear",onClick:S(_,["prevent"])},[t(u)?(i(),n("b",z,r(o.$t("profile.vrh")),1)):(i(),n("b",H,r(o.$t("profile.vah")),1))])]),t(u)?m((i(),n("textarea",{key:1,placeholder:o.$t("profile.ebah"),"onUpdate:modelValue":l[2]||(l[2]=p=>t(e).body=p),class:b({invalid:!t(e).body&&a})},null,10,N)),[[y,t(e).body]]):m((i(),n("div",M,null,512)),[[$,t(e).body]]),!t(e).body&&a?(i(),n("span",A,r(o.$t("category.req",{type:o.$t("profile.body")})),1)):c("",!0)])]),_:1},8,["name","result"])}}};export{Y as default};
