1import{a as ce}from"./chunk-W55ZBRUL.js";import{f as me}from"./chunk-DCRGTQPP.js";import"./chunk-TAYWHPLE.js";import{c as pe}from"./chunk-EYCOFZDF.js";import{a as le}from"./chunk-YXYPU3MC.js";import{b as ae}from"./chunk-J76FQZ2L.js";import"./chunk-3YYKTTRK.js";import"./chunk-TYQB6DAR.js";import"./chunk-4F3YZWOP.js";import{a as re}from"./chunk-4ZJHJNLB.js";import"./chunk-3IRW6MAO.js";import"./chunk-FVZKEHFL.js";import"./chunk-CABTRMED.js";import"./chunk-7EDV3FYO.js";import"./chunk-OBUWOHWX.js";import"./chunk-AWTSZHSK.js";import"./chunk-KUHFH43V.js";import"./chunk-U6HR6JGF.js";import"./chunk-QIWZL5RQ.js";import"./chunk-MOINSKK7.js";import"./chunk-ME6REO5O.js";import"./chunk-RPX352E4.js";import{a as W}from"./chunk-CIDLE6M4.js";import"./chunk-XFNOPY4D.js";import"./chunk-SD2GF6LN.js";import"./chunk-VCI6DQU6.js";import"./chunk-ELFTTI6P.js";import"./chunk-DFKOY57W.js";import{g as Q}from"./chunk-3OSB33KW.js";import"./chunk-XERX3YYW.js";import"./chunk-AUTQTPL7.js";import"./chunk-4Z5MUJO3.js";import"./chunk-A3QLZGQA.js";import{G as ie,Y as oe,c as m,f as Z,g as ee,j as p,m as te,t as ne}from"./chunk-LJH5OBMW.js";import{Ag as K,Bg as P,Dc as V,E as T,Eb as b,Fd as U,Gb as g,Ge as B,Ja as D,Jc as v,Kc as M,Lb as a,Mb as o,Mh as X,Nb as r,Nh as J,Ob as l,Sc as x,Uf as Y,Vb as q,Xb as A,Y as E,Z as d,Zb as s,a as F,cb as i,d as S,ga as N,lf as H,mc as f,nc as C,nd as j,ob as $,pb as L,qa as y,ra as G,ua as c,vc as R,wc as k,xc as _,ya as I,za as z}from"./chunk-PMSJWPYZ.js";import"./chunk-NIF3MU5U.js";var O=(function(t){return t.PRODUCT="PRODUCT",t.EXCHANGE="EXCHANGE",t.PAYMENT="PAYMENT",t.CLICK_AND_COLLECT="CLICK_AND_COLLECT",t.FORGOTTEN_ITEM="FORGOTTEN_ITEM",t.OTHER="OTHER",t})(O||{}),w=(()=>{class t{occEndpoints=c(H);http=c(U);userIdService=c(Y);formGroup=new ee({reason:new p(null,m.required),message:new p(null,m.required),name:new p(null,m.required),email:new p(null,[m.required,ae.emailValidator]),phoneNumber:new p(null,m.required),phoneNumberCode:new p(null,m.required),phoneCountryISO:new p(null),receiptDate:new p(null,m.required),receiptNumber:new p(null,m.required),receiptId:new p(null,m.required),accountNumber:new p(null,m.required)});busy$=new S(!1);submit(){return this.formGroup.invalid?(this.formGroup.markAllAsTouched(),T):(this.busy$.next(!0),this.send$(this.getFormData(this.formGroup)).pipe(d(),E(()=>this.busy$.next(!1))))}sub=new F;constructor(){this.sub.add(this.busy$.subscribe(e=>e?this.formGroup.disable():this.formGroup.enable()))}ngOnDestroy(){this.sub.unsubscribe()}send$(e){return this.userIdService.takeUserId().pipe(d(),N(n=>this.sendComplaint$(n,e)),d())}sendComplaint$(e,n){let u=this.occEndpoints.buildUrl(`users/${e}/complaint`);return this.http.post(u,n)}getFormData(e){return{reason:e.value.reason||"",message:e.value.message||"",name:e.value.name||"",email:e.value.email||"",phoneNumber:e.value.phoneNumberCode&&e.value.phoneNumber?e.value.phoneNumberCode+e.value.phoneNumber:"",receiptDate:e.value.receiptDate||"",receiptNumber:e.value.receiptNumber,receiptId:e.value.receiptId,accountNumber:e.value.accountNumber||""}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function be(t,h){t&1&&(o(0,"div",0)(1,"div",2),l(2,"trn-icon",3),r(),o(3,"div",4)(4,"h2"),f(5),v(6,"cxTranslate"),r(),o(7,"div"),f(8),v(9,"cxTranslate"),r()()()),t&2&&(i(5),C(M(6,2,"complaint.success_banner.title")),i(3),C(M(9,4,"complaint.success_banner.description")))}function ge(t,h){if(t&1&&(o(0,"h3"),f(1),r()),t&2){s(3);let e=_(0);i(),C(e.complaintFormContentTitle)}}function fe(t,h){if(t&1&&(o(0,"p"),f(1),r()),t&2){s(3);let e=_(0);i(),C(e.complaintFormContentText)}}function Ce(t,h){if(t&1){let e=q();o(0,"div",1)(1,"div",5),b(2,ge,2,1,"h3"),b(3,fe,2,1,"p"),r(),o(4,"form",6),A("ngSubmit",function(){I(e);let u=s(2);return z(u.submit())}),o(5,"div",7)(6,"div"),l(7,"trn-select",8),r(),o(8,"div"),l(9,"trn-input-text",9),r(),o(10,"div"),l(11,"trn-input-text",10),r(),o(12,"div"),l(13,"trn-input-phone",11),r(),o(14,"div"),l(15,"trn-input-date-manual",12),r(),o(16,"div"),l(17,"trn-input-text",13),r(),o(18,"div"),l(19,"trn-input-text",14),r(),o(20,"div"),l(21,"trn-textarea",15),r(),o(22,"div"),l(23,"trn-input-text",16),r()(),o(24,"div",17),l(25,"trn-button",18),r()()()}if(t&2){let e=s(2),n=_(0);i(2),g(n.complaintFormContentTitle?2:-1),i(),g(n.complaintFormContentText?3:-1),i(),a("formGroup",e.formGroup),i(3),a("label",n.reasonFieldTitle)("placeholder",n.reasonFieldPlaceholder)("list",e.reportReasons)("form",e.formGroup),i(2),a("label",n.nameFieldTitle)("placeholder",n.nameFieldPlaceholder)("form",e.formGroup),i(2),a("label",n.emailFieldTitle)("placeholder",n.emailFieldPlaceholder)("form",e.formGroup),i(2),a("form",e.formGroup)("label",n.phoneFieldTitle)("placeholder",n.phoneFieldPlaceholder),i(2),a("form",e.formGroup)("label",n.receiptDateFieldTitle),i(2),a("label",n.receiptNumberFieldTitle)("placeholder",n.receiptNumberFieldPlaceholder)("form",e.formGroup),i(2),a("label",n.receiptIdFieldTitle)("placeholder",n.receiptIdFieldPlaceholder)("form",e.formGroup),i(2),a("label",n.messageFieldTitle)("placeholder",n.messageFieldPlaceholder)("form",e.formGroup),i(2),a("label",n.accountNumberFieldTitle)("placeholder",n.accountNumberFieldPlaceholder)("form",e.formGroup),i(2),a("size","medium")("fill",!0)("color","primary")("disabled",e.formGroup.disabled)("typeSubmit",!0)("label",n.sendButtonTitle)}}function xe(t,h){if(t&1&&b(0,be,10,6,"div",0)(1,Ce,26,36,"div",1),t&2){let e=s();g(e.submitted()?0:1)}}var se=(()=>{class t{complaintFormService=c(w);componentData=c(oe);globalMessageService=c(K);formGroup=this.complaintFormService.formGroup;onSubmit=x();onSuccess=x();onError=x();onCancel=x();reportReasons=Object.values(O).map(e=>({value:e,viewValue:"complaint.reasons."+e,translate:!0}));submitted=D(!1);data$=this.componentData.data$;submit(){this.onSubmit.emit(),this.complaintFormService.submit().pipe(d()).subscribe({next:()=>{this.onSuccess.emit(),this.submitted.set(!0),this.globalMessageService.add({key:"complaint.success_submit"},P.MSG_TYPE_CONFIRMATION),this.formGroup.reset()},error:()=>{this.onError.emit(),this.globalMessageService.add({key:"complaint.error_submit"},P.MSG_TYPE_ERROR)}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=$({type:t,selectors:[["trn-complaint-form"]],outputs:{onSubmit:"onSubmit",onSuccess:"onSuccess",onError:"onError",onCancel:"onCancel"},features:[V([w])],decls:3,vars:4,consts:[[1,"success-submit-banner"],[1,"complaint-form-wrap"],[1,"icon-wrapper"],["icon","check_circle"],[1,"text-wrapper"],[1,"form-content"],[1,"complaint-form",3,"ngSubmit","formGroup"],[1,"form-fields"],["name","reason","size","medium",3,"label","placeholder","list","form"],["size","medium","name","name",3,"label","placeholder","form"],["size","medium","name","email",3,"label","placeholder","form"],["name","phoneNumber","prefixName","phoneNumberCode",3,"form","label","placeholder"],["size","large","name","receiptDate",3,"form","label"],["size","medium","name","receiptNumber",3,"label","placeholder","form"],["size","medium","name","receiptId",3,"label","placeholder","form"],["name","message","size","medium",3,"label","placeholder","form"],["size","medium","name","accountNumber",3,"label","placeholder","form"],[1,"action-buttons"],[1,"complaint-button",3,"size","fill","color","disabled","typeSubmit","label"]],template:function(n,u){if(n&1&&(R(0),v(1,"async"),b(2,xe,2,1)),n&2){let ue=k(M(1,1,u.data$));i(2),g(ue?2:-1)}},dependencies:[J,ie,te,Z,ne,me,re,pe,le,ce,W,Q,j,X],styles:["[_nghost-%COMP%]{padding-top:16px;padding-bottom:16px}.complaint-form-wrap[_ngcontent-%COMP%], .form-fields[_ngcontent-%COMP%], .form-content[_ngcontent-%COMP%], .complaint-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.success-submit-banner[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:16px;padding:32px 16px;border-radius:12px;background-color:#e0ece4}@media all and (min-width:992px){.success-submit-banner[_ngcontent-%COMP%]{gap:24px;padding:48px}}.success-submit-banner[_ngcontent-%COMP%] .icon-wrapper[_ngcontent-%COMP%] trn-icon[_ngcontent-%COMP%]{height:24px;width:auto;font-size:24px}.success-submit-banner[_ngcontent-%COMP%] .icon-wrapper[_ngcontent-%COMP%] trn-icon[_ngcontent-%COMP%] img{height:24px;width:auto}.success-submit-banner[_ngcontent-%COMP%] .icon-wrapper[_ngcontent-%COMP%] trn-icon[_ngcontent-%COMP%]{color:#31844d}@media all and (min-width:992px){.success-submit-banner[_ngcontent-%COMP%] .icon-wrapper[_ngcontent-%COMP%] trn-icon[_ngcontent-%COMP%]{height:32px;width:auto;font-size:32px}.success-submit-banner[_ngcontent-%COMP%] .icon-wrapper[_ngcontent-%COMP%] trn-icon[_ngcontent-%COMP%] img{height:32px;width:auto}}.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;text-align:center;font-size:16px;line-height:22px;letter-spacing:normal;padding-top:1px;padding-bottom:1px}@media all and (min-width:576px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%]{font-size:16px;line-height:28px;letter-spacing:normal;padding-top:2px;padding-bottom:2px}}@media all and (min-width:992px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%]{font-size:18px;line-height:32px;letter-spacing:normal;padding-top:0;padding-bottom:0}}@media all and (min-width:576px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%]{font-size:16px;line-height:22px;letter-spacing:normal;padding-top:1px;padding-bottom:1px}}@media all and (min-width:576px)and (min-width:992px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%]{font-size:16px;line-height:28px;letter-spacing:normal;padding-top:2px;padding-bottom:2px}}@media all and (min-width:992px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%]{gap:8px}}.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-family:Ubuntu,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased;font-size:20px;line-height:28px;letter-spacing:normal;padding-top:2px;padding-bottom:2px}@media all and (min-width:576px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:40px;line-height:48px;letter-spacing:normal;padding-top:0;padding-bottom:0}}@media all and (min-width:576px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-family:Ubuntu,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased;font-size:18px;line-height:24px;letter-spacing:normal;padding-top:0;padding-bottom:0}}@media all and (min-width:576px)and (min-width:576px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:24px;line-height:32px;letter-spacing:normal;padding-top:0;padding-bottom:0}}@media all and (min-width:576px)and (min-width:992px){.success-submit-banner[_ngcontent-%COMP%] .text-wrapper[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:28px;line-height:34px;letter-spacing:normal;padding-top:3px;padding-bottom:3px}}"]})}return t})();var Ye=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=L({type:t});static \u0275inj=G({providers:[B({cmsComponents:{TrnComplaintComponent:{component:se}}})]})}return t})();export{Ye as ComplaintFormModule};
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.