1import{E as B}from"./chunk-4ZH7OCQT.js";import{e as k,k as z}from"./chunk-TYHNJDIL.js";import"./chunk-FPGJCOAR.js";import{Bb as E,Bc as I,Hb as y,Lb as p,Mb as u,Pa as s,Ua as i,Uc as w,V as P,Vb as l,Vc as U,Wb as c,Xb as m,Zb as h,_,_b as d,ea as f,fa as b,fc as C,gc as r,jb as v,oc as M,pc as D,qb as O,tc as S,uc as L,vc as H,zb as T}from"./chunk-TU7EUU3B.js";import"./chunk-IMPBB4AK.js";var g=class e{_http=_(k);doOptOutPostal(o){return o!==void 0?this._http.post(`/api/v2/optOutPostal/${o}`,{responseType:"text"}):null}static \u0275fac=function(t){return new(t||e)};static \u0275prov=P({token:e,factory:e.\u0275fac,providedIn:"root"})};var A=["userIdSelector"];function j(e,o){if(e&1&&(l(0,"div",3),m(1,"h3",12)(2,"p",13),c()),e&2){let t,n,a=r(2);i(),d("innerHTML",(t=a.appData())==null?null:t.generalUnsubscribePostalShortText,s),i(),d("innerHTML",(n=a.appData())==null?null:n.generalUnsubscribePostalLongText,s)}}function q(e,o){if(e&1&&(l(0,"p",6),L(1),c()),e&2){let t=r(2);i(),H(t.emptyUserIdError)}}function R(e,o){if(e&1){let t=h();l(0,"button",14),C("click",function(){f(t);let a=r(2);return b(a.callForOptout())}),c()}if(e&2){let t,n=r(2);d("innerHTML",(t=n.appData())==null?null:t.generalUnsubscribePostalButtonSubmitText,s)}}function F(e,o){if(e&1&&m(0,"div",9),e&2){let t,n=r(2);d("innerHTML",(t=n.appData())==null?null:t.generalUnsubscribePostalSuccessText,s)}}function Q(e,o){if(e&1&&m(0,"div",10),e&2){let t,n=r(2);d("innerHTML",(t=n.appData())==null?null:t.generalUnsubscribePostalFailedText,s)}}function J(e,o){if(e&1&&m(0,"div",10),e&2){let t=r(2);d("innerHTML",t.optoutTextError,s)}}function Y(e,o){if(e&1){let t=h();l(0,"button",15),C("click",function(){let a;f(t);let x=r(2);return b(x.utilityService.manualNavigation((a=x.appData())==null?null:a.generalUnsubscribePostalLinkLogin))}),c()}if(e&2){let t,n=r(2);d("innerHTML",(t=n.appData())==null?null:t.generalUnsubscribePostalButtonLoginText,s)}}function $(e,o){if(e&1&&(l(0,"div")(1,"div",1)(2,"div",2),p(3,j,3,2,"div",3),l(4,"div",4),m(5,"input",5,0),c(),p(7,q,2,1,"p",6),l(8,"div",7),p(9,R,1,1,"button",8),c(),p(10,F,1,1,"div",9),p(11,Q,1,1,"div",10),p(12,J,1,1,"div",10),l(13,"div",7),p(14,Y,1,1,"button",11),c()()()()),e&2){let t=r();S(I("module_",t.id())),i(3),u(t.showOptoutMaineText?3:-1),i(4),u(t.showUserIdRequiredError?7:-1),i(2),u(t.showOptoutSubmitButton?9:-1),i(),u(t.showOptoutSuccessText?10:-1),i(),u(t.showOptoutAlreadyUnsubscribedText?11:-1),i(),u(t.showOptoutErrorText?12:-1),i(2),u(t.showOptoutLoginButton?14:-1)}}function G(e,o){e&1&&m(0,"div")}var N=class e{utilityService=_(B);sanitizer=_(z);postalService=_(g);inputElementDom=U("userIdSelector");appData=w(null);id=w("0");showOptoutMaineText=!0;showOptoutSubmitButton=!0;showOptoutSuccessText=!1;showOptoutAlreadyUnsubscribedText=!1;showOptoutErrorText=!1;showOptoutLoginButton=!1;showUserIdRequiredError=!1;optoutTextError="";emptyUserIdError="Please enter user id";ngAfterViewInit(){let o=this.inputElementDom();o&&o.nativeElement.addEventListener("input",t=>{if(t.data&&!this.utilityService.containsOnlyNumbers(t.data)){let n=this.inputElementDom();n&&(n.nativeElement.value=n.nativeElement.value.slice(0,-1))}})}callForOptout(){let o=document.getElementById("firstNameId").value;if(o==""){this.showUserIdRequiredError=!0;return}let t=JSON.stringify(this.sanitizer.bypassSecurityTrustHtml(o)),n=JSON.parse(t),a=this.postalService.doOptOutPostal(n.changingThisBreaksApplicationSecurity);a?a.subscribe(x=>{x.result===!0?(this.showOptoutSubmitButton=!1,this.showOptoutSuccessText=!0,this.showOptoutMaineText=!1,this.showOptoutLoginButton=!0,setTimeout(()=>{this.utilityService.manualNavigation(this.appData()?.generalUnsubscribePostalLinkLogin)},1e4)):(this.showOptoutSubmitButton=!1,this.showOptoutAlreadyUnsubscribedText=!0,this.showOptoutMaineText=!1,this.showOptoutLoginButton=!0)},x=>{this.showError()}):this.showError()}showError(){this.optoutTextError=`Oops something went wrong and your details were not captured. Your request has not 2 been processed. Please try again. If you prefer you can send an email to supp
2ort or login to your account 3 to unsubscribe from future communications.`,this.showOptoutSubmitButton=!1,this.showOptoutErrorText=!0,this.showOptoutMaineText=!1,this.showOptoutLoginButton=!0}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=v({type:e,selectors:[["app-postal"]],viewQuery:function(t,n){t&1&&M(n.inputElementDom,A,5),t&2&&D()},inputs:{appData:[1,"appData"],id:[1,"id"]},decls:4,vars:0,consts:[["userIdSelector",""],[1,"optout_wrapper"],[1,"optout_box"],[1,"optout_text"],[1,"typeTextArea"],["id","firstNameId","type","text","name","userId"],[1,"user-id-required"],[1,"buttons-wrapper"],["type","submit",1,"optout_button","general_buttonone","optout_button_one",3,"innerHTML"],[1,"optout-msg_success",3,"innerHTML"],[1,"optout-msg_error",3,"innerHTML"],[1,"optout_button","general_buttontwo","optout_button_two",3,"innerHTML"],[1,"optout_title",3,"innerHTML"],[1,"optout_paragraph",3,"innerHTML"],["type","submit",1,"optout_button","general_buttonone","optout_button_one",3,"click","innerHTML"],[1,"optout_button","general_buttontwo","optout_button_two",3,"click","innerHTML"]],template:function(t,n){t&1&&(O(0,$,15,10)(1,G,1,0),T(2,0,null,null,1),E(),y(0,-1))},styles:[".general_header_position[_ngcontent-%COMP%]{position:fixed}.add-margin-top[_ngcontent-%COMP%]{margin-top:80px}.optout_wrapper[_ngcontent-%COMP%]{padding:80px 10px}.optout_box[_ngcontent-%COMP%]{margin:0 auto;padding:40px 20px;text-align:center;max-width:400px}.optout_text[_ngcontent-%COMP%]{margin-bottom:15px;font-size:16px}.optout_text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{padding-top:5px}.optout_text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-weight:700}.optout-msg_success[_ngcontent-%COMP%]{font-size:16px;margin:0;padding:5px;color:#308c41}.optout-msg_error[_ngcontent-%COMP%]{font-size:16px;margin:0;padding:5px;color:red}.optout_button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:10px 20px;margin:0 10px;cursor:pointer;max-width:40%}.buttons-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}.optout_logo[_ngcontent-%COMP%]{padding:10px;max-height:70px;width:auto;cursor:pointer}.optout_buttonthree[_ngcontent-%COMP%]{color:#fff;background-color:#bc0452;border-color:#bc0452;border-radius:20px;width:120px;margin:5px}.optout_buttonthree[_ngcontent-%COMP%]:hover{background-color:#c22669;border-color:#c22669}.optout_wrapper[_ngcontent-%COMP%] #firstNameId[_ngcontent-%COMP%]{cursor:auto;font-size:19px;border:1px solid rgb(160,150,150);height:38px;width:175px;background:transparent;font-weight:500;text-align:center}.optout_wrapper[_ngcontent-%COMP%] .typeTextArea[_ngcontent-%COMP%]{margin-bottom:10px}.user-id-required[_ngcontent-%COMP%]{color:red}@media only screen and (max-width: 767px){op-header-module[_ngcontent-%COMP%]{height:55px}.add-margin-top[_ngcontent-%COMP%]{margin-top:55px}}.cdk-global-overlay-wrapper[_ngcontent-%COMP%] .cdk-overlay-pane[_ngcontent-%COMP%]{bottom:530px}"],changeDetection:0})};export{N as PostalComponent};
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.