1import{ag as K,k as B,a as k,aT as H,b as x,f as U,q as R,Q,g as e,B as n,j as q,ah as L,x as d,s as I,n as $,H as G,_ as j,l as z}from"./vendors-D6_U1cxw.js";import{E as Y,ap as J,q as Z}from"./sentry-DZl3svT9.js";import{at as W,aI as X,cQ as ee,bi as te}from"./main-BMr2Y4bS.js";import{_ as ae}from"./StaticContent.vue_vue_type_script_setup_true_lang-DIau5e-2.js";import{z as E}from"./zod-mSUfeT8K.js";import{t as oe,a as le}from"./vee-validate-BoCWXGUL.js";import{_ as M,F}from"./style.scss_vue_type_style_index_0_src_true_lang-zckc36yf.js";import{b as ne}from"./floating-ui-Bv8lmiPa.js";import{_ as c}from"./FeInput.vue_vue_type_style_index_0_lang-DHjZVzW-.js";import"./vue-recaptcha-DyvulmQb.js";import"./vue3-touch-events-BftI5NW8.js";import"./body-scroll-lock-upgrade-CmWMI3F6.js";import"./livechat-BavU3_q5.js";import"./firebase-K-rWttj5.js";/* empty css *//* empty css *//* empty css */import"./overlayscrollbars-Cua63DhK.js";import"./StaticContentView.vue_vue_type_script_setup_true_lang-DWGK58JE.js";import"./parseSegments-D2SkmLNY.js";const re={async freshdeskCreateTicket(C){try{return await Y("/fe-api/freshdesk/tickets",{method:"POST",body:JSON.stringify(C)})}catch(r){return W.error("FRESHDESK_CREATE_TICKET",r),{status:"failed",error:r}}}},se=C=>{const r=K(),O=(i,A)=>i!=null&&i.input?A.invalid:A.required,t=B(!1),m=B(!1),p=B(!1),_=oe(E.object({country:E.string().optional(),title:E.string().optional(),firstName:E.string().min(1,r.t("COMPLAINT_FORM.FIELDS_ERRORS.REQUIRED")),lastName:E.string().min(1,r.t("COMPLAINT_FORM.FIELDS_ERRORS.REQUIRED")),email:E.email({error:i=>O(i,{required:r.t("COMPLAINT_FORM.FIELDS_ERRORS.REQUIRED"),invalid:r.t("COMPLAINT_FORM.FIELDS_ERRORS.INVALID_EMAIL")})}),address:E.string().optional(),accountNumber:E.string().optional(),dateOfComplaint:E.iso.date({error:i=>O(i,{required:r.t("COMPLAINT_FORM.FIELDS_ERRORS.REQUIRED"),invalid:r.t("COMPLAINT_FORM.FIELDS_ERRORS.INVALID_DATE")})}),dateOfIncident:E.iso.date({error:i=>O(i,{required:r.t("COMPLAINT_FORM.FIELDS_ERRORS.REQUIRED"),invalid:r.t("COMPLAINT_FORM.FIELDS_ERRORS.INVALID_DATE")})}),requestDetails:E.string().min(1,r.t("COMPLAINT_FORM.FIELDS_ERRORS.REQUIRED")),attachment:E.string().min(1,r.t("COMPLAINT_FORM.FIELDS_ERRORS.REQUIRED"))})),{defineField:s,errors:f,validate:N,values:T,resetForm:l}=le({initialValues:C,validationSchema:_}),[D]=s("country"),[P]=s("title"),[h]=s("firstName"),[S]=s("lastName"),[v]=s("email"),[b]=s("address"),[u]=s("accountNumber"),[g]=s("dateOfComplaint"),[w]=s("dateOfIncident"),[y]=s("requestDetails"),[V]=s("attachment");return{accountNumber:u,address:b,attachment:V,country:D,dateOfComplaint:g,dateOfIncident:w,email:v,errors:f,firstName:h,isFormError:t,lastName:S,title:P,requestDetails:y,isSubmitting:m,isInvalidEmail:p,handleEmailFieldBlur:i=>{if(f.value.email){p.value=!0;return}p.value=!1},submitForm:async()=>{t.value=!1,m.value=!0;const{valid:i}=await N();if(!i){m.value=!1,f.value.email&&(p.value=!0);return}const{error:A}=await re.freshdeskCreateTicket(T);if(A){m.value=!1,t.value=!0;return}X.show({title:r.t("COMPLAINT_FORM.SUCCESS.TITLE"),text:r.t("COMPLAINT_FORM.SUCCESS.MESSAGE")}),m.value=!1,l()},keydownEvent:i=>{const A=i.target;A&&i.key==="Enter"&&A.blur()}}},ie="/dist/calendar-DwK3EZqi.svg",me={class:"complaint-form pt-6 m-auto max-w-108"},de={key:0,class:"text-caption-l text-center text-error-20 pt-2"},ue={class:"text-caption-m text-center"},Ee=k({__name:"ComplaintForm",setup(C){H(V=>({"68a327e8":r}));const r=`url(${ie})`,O=new Date().toISOString().substring(0,10),t=K(),{accountNumber:m,address:p,attachment:_,country:s,dateOfComplaint:f,dateOfIncident:N,email:T,errors:l,firstName:D,isFormError:P,lastName:h,title:S,requestDetails:v,submitForm:b,keydownEvent:u,isSubmitting:g,isInvalidEmail:w,handleEmailFieldBlur:y}=se({firstName:"",lastName:"",email:"",dateOfComplaint:O,dateOfIncident:"",requestDetails:"",attachment:""});return(V,a)=>(U(),x("div",me,[R("form",{class:"grid gap-4",novalidate:"",onSubmit:a[11]||(a[11]=Q((...o)=>e(b)&&e(b)(...o),["prevent"]))},[n(c,{modelValue:e(s),"onUpdate:modelValue":a[0]||(a[0]=o=>L(s)?s.value=o:null),name:"country",label:e(t).t("COMPLAINT_FORM.COUNTRY_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.COUNTRY_FIELD.PLACEHOLDER"),maxlength:50,onKeydown:e(u)},null,8,["modelValue","label","placeholder","onKeydown"]),n(c,{modelValue:e(S),"onUpdate:modelValue":a[1]||(a[1]=o=>
1L(S)?S.value=o:null),name:"title",label:e(t).t("COMPLAINT_FORM.TITLE_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.TITLE_FIELD.PLACEHOLDER"),maxlength:50,onKeydown:e(u)},null,8,["modelValue","label","placeholder","onKeydown"]),n(e(M),{position:e(F).bottom,"show-on-hover":!1,show:!!e(l).firstName},{activator:d(()=>[n(c,{modelValue:e(D),"onUpdate:modelValue":a[2]||(a[2]=o=>L(D)?D.value=o:null),name:"firstName",label:e(t).t("COMPLAINT_FORM.FIRSTNAME_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.FIRSTNAME_FIELD.PLACEHOLDER"),error:!!e(l).firstName,maxlength:50,onKeydown:e(u)},null,8,["modelValue","label","placeholder","error","onKeydown"])]),default:d(()=>[R("span",null,I(e(l).firstName),1)]),_:1},8,["position","show"]),n(e(M),{position:e(F).bottom,"show-on-hover":!1,show:!!e(l).lastName},{activator:d(()=>[n(c,{modelValue:e(h),"onUpdate:modelValue":a[3]||(a[3]=o=>L(h)?h.value=o:null),name:"lastName",label:e(t).t("COMPLAINT_FORM.LASTNAME_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.LASTNAME_FIELD.PLACEHOLDER"),error:!!e(l).lastName,maxlength:50,onKeydown:e(u)},null,8,["modelValue","label","placeholder","error","onKeydown"])]),default:d(()=>[R("span",null,I(e(l).lastName),1)]),_:1},8,["position","show"]),n(e(M),{position:e(F).bottom,"show-on-hover":!1,show:!!e(l).email&&e(w)},{activator:d(()=>[n(c,{modelValue:e(T),"onUpdate:modelValue":a[4]||(a[4]=o=>L(T)?T.value=o:null),name:"email",type:"email",label:e(t).t("COMPLAINT_FORM.EMAIL_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.EMAIL_FIELD.PLACEHOLDER"),error:!!e(l).email&&e(w),maxlength:65,onBlur:e(y),onKeydown:e(u)},null,8,["modelValue","label","placeholder","error","onBlur","onKeydown"])]),default:d(()=>[R("span",null,I(e(l).email),1)]),_:1},8,["position","show"]),n(c,{modelValue:e(p),"onUpdate:modelValue":a[5]||(a[5]=o=>L(p)?p.value=o:null),name:"address",label:e(t).t("COMPLAINT_FORM.ADDRESS_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.ADDRESS_FIELD.PLACEHOLDER"),maxlength:50,onKeydown:e(u)},null,8,["modelValue","label","placeholder","onKeydown"]),n(c,{modelValue:e(m),"onUpdate:modelValue":a[6]||(a[6]=o=>L(m)?m.value=o:null),name:"accountNumber",label:e(t).t("COMPLAINT_FORM.ACCOUNT_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.ACCOUNT_FIELD.PLACEHOLDER"),maxlength:50,onKeydown:e(u)},null,8,["modelValue","label","placeholder","onKeydown"]),n(e(M),{position:e(F).bottom,"show-on-hover":!1,show:!!e(l).dateOfComplaint},{activator:d(()=>[n(c,{modelValue:e(f),"onUpdate:modelValue":a[7]||(a[7]=o=>L(f)?f.value=o:null),name:"dateOfComplaint",type:"date",label:e(t).t("COMPLAINT_FORM.DATE_COMPLAINT_FIELD.LABEL"),max:e(O),error:!!e(l).dateOfComplaint,onKeydown:e(u)},null,8,["modelValue","label","max","error","onKeydown"])]),default:d(()=>[R("span",null,I(e(l).dateOfComplaint),1)]),_:1},8,["position","show"]),n(e(M),{position:e(F).bottom,"show-on-hover":!1,show:!!e(l).dateOfIncident},{activator:d(()=>[n(c,{modelValue:e(N),"onUpdate:modelValue":a[8]||(a[8]=o=>L(N)?N.value=o:null),name:"dateOfIncident",type:"date",label:e(t).t("COMPLAINT_FORM.DATE_INCIDENT_FIELD.LABEL"),max:e(O),error:!!e(l).dateOfIncident,onKeydown:e(u)},null,8,["modelValue","label","max","error","onKeydown"])]),default:d(()=>[R("span",null,I(e(l).dateOfIncident),1)]),_:1},8,["position","show"]),n(ee,{modelValue:e(v),"onUpdate:modelValue":a[9]||(a[9]=o=>L(v)?v.value=o:null),name:"requestDetails",class:$({"pb-2":e(l).requestDetails}),label:e(t).t("COMPLAINT_FORM.DETAILS_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.DETAILS_FIELD.PLACEHOLDER"),maxlength:500,error:!!e(l).requestDetails,"error-messages":e(l).requestDetails},null,8,["modelValue","class","label","placeholder","error","error-messages"]),n(e(M),{position:e(F).bottom,"show-on-hover":!1,show:!!e(l).attachment},{activator:d(()=>[n(c,{modelValue:e(_),"onUpdate:modelValue":a[10]||(a[10]=o=>L(_)?_.value=o:null),name:"attachment",label:e(t).t("COMPLAINT_FORM.ATTACHMENT_FIELD.LABEL"),placeholder:e(t).t("COMPLAINT_FORM.ATTACHMENT_FIELD.PLACEHOLDER"),error:!!e(l).attachment,maxlength:256,onKeydown:e(u)},null,8,["modelValue","label","placeholder","error","onKeydown"])]),default:d(()=>[R("span",null,I(e(l).attachment),1)]),_:1},8,["position","show"]),e(P)?(U(),x("p",de,I(e(t).t("COMPLAINT_FORM.GENERAL_ER
1ROR")),1)):q("",!0),n(e(ne),{class:"mt-2",type:"submit",disabled:e(g)},{default:d(()=>[G(I(e(t).t("COMPLAINT_FORM.SUBMIT_BUTTON")),1)]),_:1},8,["disabled"]),R("p",ue,I(e(t).t("COMPLAINT_FORM.NOTE")),1)],32)]))}}),Le={key:0,class:"grid auto-cols-auto grid-cols-1 mx-auto lg:grid-cols-12"},pe={class:"col-span-full lg:col-span-8 lg:col-start-3"},Ve=k({__name:"ComplaintFormPage",setup(C){const r=j(),{loadAppGlobalConfig:O}=J(),t=Z();return z(async()=>{var _;const m=await O();!!((_=m==null?void 0:m.licenceDomainConfig)!=null&&_.licenceId)||r.push({path:"/terms-and-conditions"})}),(m,p)=>e(t).isLicenceDomain?(U(),x("div",Le,[R("div",pe,[n(ae,{"route-name":e(te).COMPLAINT_FORM},null,8,["route-name"]),n(Ee)])])):q("",!0)}});export{Ve as default}; 2//# sourceMappingURL=ComplaintFormPage-B6b8zpv2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.