1"use strict";(self.webpackChunkubc_consumer_main=self.webpackChunkubc_consumer_main||[]).push([[1112],{86890:(x,E,c)=>{c.d(E,{D:()=>R});var e=c(54438),h=c(86419),d=c(71580),p=(c(35785),c(92937)),g=c(96697),u=c(21626),P=c(60177),T=c(88282);const f=r=>({label:"",isChecked:r,consentId:"all-consents"}),C=r=>[r];function I(r,_){if(1&r&&(e.qex(0),e.EFF(1),e.bVm()),2&r){const n=e.XpG(3);e.R7$(),e.SpI(" ",n.consentText2," ")}}function M(r,_){1&r&&(e.qex(0),e.EFF(1," , "),e.bVm())}function L(r,_){if(1&r){const n=e.RV6();e.qex(0),e.j41(1,"span",9),e.bIt("click",function(){const o=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.openConsentPanel(o))})("keydown.enter",function(){const o=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.openConsentPanel(o))})("keydown.space",function(){const o=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.openConsentPanel(o))}),e.EFF(2),e.k0s(),e.DNE(3,I,2,1,"ng-container",10)(4,M,2,0,"ng-container",10),e.bVm()}if(2&r){const n=_.$implicit,t=_.index,o=_.last;e.R7$(2),e.JRh(n.text),e.R7$(),e.Y8G("ngIf",0===t),e.R7$(),e.Y8G("ngIf",t>0&&!o)}}function A(r,_){if(1&r){const n=e.RV6();e.j41(0,"div",4)(1,"div",5)(2,"lla-checkbox",6),e.bIt("clickHandler",function(o){e.eBV(n);const s=e.XpG();return e.Njj(s.onCheckboxChange(o))}),e.k0s(),e.j41(3,"div",7),e.EFF(4),e.DNE(5,L,5,3,"ng-container",8),e.EFF(6),e.k0s()()()}if(2&r){const n=e.XpG();e.R7$(2),e.Y8G("status",n.allConsentsChecked?"default":"error")("checkboxOptions",e.eq3(8,C,e.eq3(6,f,n.allConsentsChecked)))("isFullWidthLabel",!1),e.R7$(2),e.SpI(" ",n.consentText," "),e.R7$(),e.Y8G("ngForOf",n.consentChoices),e.R7$(),e.SpI(" ",n.consentText3," ")}}function N(r,_){if(1&r&&(e.j41(0,"p",11),e.EFF(1),e.k0s()),2&r){const n=e.XpG();e.R7$(),e.SpI(" ",n.tncErrorText,"\n")}}function S(r,_){if(1&r){const n=e.RV6();e.j41(0,"div",12)(1,"lla-checkbox",13),e.bIt("clickHandler",function(o){e.eBV(n);const s=e.XpG();return e.Njj(s.onEmailCheckboxChange(o))}),e.k0s()()}if(2&r){const n=e.XpG();e.R7$(),e.Y8G("checkboxOptions",n.emailCheckboxOptions)("checkboxLabel",!0)("checkboxLabelTypography","label-1-regular")}}function v(r,_){if(1&r&&(e.j41(0,"div",14)(1,"p",15),e.EFF(2),e.k0s()()),2&r){const n=e.XpG();e.R7$(2),e.JRh(n.errorMessage)}}let R=(()=>{class r{constructor(n,t,o,s,a,i,l,b){this.http=n,this.cdr=t,this.sidePanelService=o,this.translateService=s,this.baseService=a,this.callCenterService=i,this.dataLayerService=l,this.shoppingCartService=b,this.consentCheckboxChange=new e.bkB,this.autopayConsent=!0,this.showTncErrorTxt=!1,this.consentChoices=[],this.allConsentChoices=[],this.isLoading=!1,this.errorMessage="",this.allConsentsChecked=!0,this.callCenterAccordionData=null,this.cart=null,this.consentText="",this.consentText2="",this.consentText3="",this.tncErrorText="",this.emailconsent=!0,this.marketingCheckboxLabelEmail=this.translateService.getTranslation("MOBILE_CHECKOUT.BRAINTREE_PAYMENT.MARKETING_CONSENT_CHECKBOX_LABEL_EMAIL"),this.emailConsentChecked=!1,this.emailCheckboxOptions=[{label:this.marketingCheckboxLabelEmail,isChecked:!1}]}ngOnInit(){this.emailConsentChecked=this.emailCheckboxOptions[0].isChecked="true"===localStorage.getItem("emailMarketingConsent"),this.shoppingCartService.retrieveCart().pipe((0,g.s)(1)).subscribe(n=>{this.cart=n,this.loadCallCenterAccordionData(),this.loadConsents(),this.consentCheckboxChange.emit(this.allConsentsChecked)})}ngOnChanges(){this.consentText=this.translateService.getTranslation("MOBILE_CHECKOUT.BRAINTREE_PAYMENT.CONSENT_TEXT"),this.consentText2=this.translateService.getTranslation("MOBILE_CHECKOUT.BRAINTREE_PAYMENT.CONSENT_TEXT_2"),this.consentText3=this.translateService.getTranslation("MOBILE_CHECKOUT.BRAINTREE_PAYMENT.CONSENT_TEXT_3"),this.tncErrorText=this.translateService.getTranslation("MOBILE_CHECKOUT.BRAINTREE_PAYMENT.TERMS_AND_CONDITION_ERROR_TEXT"),this.filterConsents()}filterConsents(){!this.allConsentChoices||0===this.allConsentChoices.length||(this.consentChoices=this.allConsentChoices.filter(n=>{const t=n.value.toLowerCase();return!(t.includes("autopay")&&!this.autopayConsent||t.includes("instconsent")&&!this.hasInstallmentInCart()||t.includes("insuranceconsent")&&!this.hasInsuranceInCart()||t.includes("generaltnc")&&t.includes("prepaid")&&!this.hasPrepaidPlanInCart())}),this.cdr.markForCheck())}loadCallCenterAccordionData(){this.callCenterService.retrieveAccordionData().pipe((0,g.s)(1)).subscribe({next:n=>{n?.accordionData?(this.callCenterAccordionData=n.accordionData,this.cdr.markForCheck()):this.fetchAccordionFromAPI()},error:()=>{this.fetchAccordionFromAPI()}})}fetchAccordionFromAPI(){this.baseService.get(`${h.Nld}${h.J2X}`).subscribe({next:n=>
1{this.callCenterAccordionData=n.accordion_information,this.callCenterService.saveAccordionData({accordionData:this.callCenterAccordionData,callCenterSidepanelAccordionInfo:null}),this.cdr.markForCheck()},error:n=>{console.error("Error loading call center accordion data:",n)}})}loadConsents(){const n=localStorage.getItem("ConsentFilters");let t={};try{t=n?JSON.parse(n):{}}catch(a){console.error("JSON Parse Error:",a)}const o=this.buildQueryParam(t);this.isLoading=!0,this.errorMessage="",this.http.get(o?`${h.b4G}?type=${o}`:h.b4G).subscribe({next:a=>{this.allConsentChoices=this.sortConsents(a||[]),this.filterConsents(),this.isLoading=!1,this.cdr.markForCheck()},error:a=>{console.error("Consent API Error:",a.message),this.errorMessage=this.translateService.getTranslation("MOBILE_CHECKOUT.BRAINTREE_PAYMENT.CONSENT_ERROR"),this.isLoading=!1,this.cdr.markForCheck()}})}sortConsents(n){const t=n.map(l=>({...l,text:this.getConsentDisplayName(l.value,l.text)})),o=t.find(l=>"GeneralTnC"===l.value),s=t.find(l=>"GeneralTnCPrepaid"===l.value),a=t.filter(l=>"GeneralTnC"!==l.value&&"GeneralTnCPrepaid"!==l.value),i=[];return this.hasPrepaidPlanInCart()?(s&&i.push(s),o&&i.push(o)):(o&&i.push(o),s&&i.push(s)),i.push(...a),i}getConsentDisplayName(n,t){const o={GeneralTnC:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.LIBERTY_GENERAL"),GeneralTnCPrepaid:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.LIBERTY_GENERAL_PREPAID")||this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.LIBERTY_GENERAL")+" (Prepaid)",AutoPay:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.AUTOPAY_AUTHORIZATION"),InstConsent:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.INSTALLMENT"),InsuranceConsent:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.INSURANCE"),TradeInConsent:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.TRADEIN"),BillingPrefEmail:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.EBILL_TABLE_TITLE")};if(o[n])return o[n];const s=n.toLowerCase();for(const a in o)if(a.toLowerCase()===s)return o[a];return t}hasInstallmentInCart(){return!!this.cart?.entries&&(this.cart.entries||[]).filter(s=>s.product?.categories?.some(a=>{const i=(a.code||"").toLowerCase();return"smartphones"===i||"tablets"===i||"smartwatches"===i||"testsmartphones"===i||"testtablets"===i||"testsmartwatches"===i})).some(s=>{const a=s.installmentMonthValue;return a&&"FULL"!==a})}hasInsuranceInCart(){return!!this.cart?.entries&&(this.cart.entries||[]).some(t=>t.product?.code?.toLowerCase().includes("smart_protect")||t.product?.code?.toLowerCase().includes("insurance_addons"))}hasPrepaidPlanInCart(){return!!this.cart?.entries&&("true"===localStorage.getItem("isPrepaidCheckout")||(this.cart.entries||[]).some(s=>{if((s.product?.baseCategory?.toUpperCase()||"").includes("PREPAID"))return!0;const i=s.product?.categories||[];for(const k of i){const O=(k.code||k.name||"").toUpperCase();if(O.includes("PREPAID")||O.includes("PREPAID_UNLIMITED"))return!0}return!(!(s.product?.code?.toUpperCase()||"").includes("PREPAID")&&!(s.planType||"").toUpperCase().includes("PREPAID"))}))}hasWithoutAutopayPlan(){return!!this.cart?.entries&&this.cart.entries.some(n=>"WITHOUT_AUTOPAY"===n?.automaticPayOptions)}buildQueryParam(n){const t=[];return this.hasPrepaidPlanInCart()?t.push("GeneralTnCPrepaid"):(t.push("GeneralTnC"),t.push("BillingPrefEmail")),this.autopayConsent&&!this.hasWithoutAutopayPlan()&&t.push("AutoPay"),this.hasInstallmentInCart()&&t.push("InstConsent"),this.hasInsuranceInCart()&&t.push("InsuranceConsent"),t.join(",")}onCheckboxChange(n){n&&"all-consents"===n.consentId&&(this.allConsentsChecked=n.isChecked,this.consentCheckboxChange.emit(n.isChecked),this.cdr.markForCheck())}onEmailCheckboxChange(n){this.emailConsentChecked=n.isChecked||!1,this.emailCheckboxOptions[0].isChecked=this.emailConsentChecked,localStorage.setItem("emailMarketingConsent",this.emailConsentChecked.toString()),this.cdr.markForCheck()}handleDataLayerForConsentLick(n){let{fixedCount:t,prepaidCount:o,postpaidCount:s}=localStorage.billlingAccountFlag?JSON.parse(localStorage.billlingAccountFlag):{};const a=void 0!==t&&void 0!==o&&void 0!==s;let i="";const l=window.isExistingDetected;i=void 0===l||!1===l?localStorage.UserData&&JSON.parse(localStorage.UserData).gigyaAccount?.profile?.email?"Existing Logged":"new user":"Existing Detected";const b={event_category:"payment interaction",event_action:"link terms and conditions",event_label:n.text,step_position:localStorage?.currentStepPosition||1,user_t
1ype:i,existing_customer_config:a?"Fixed "+t+", Pre "+o+", Post "+s:void 0,buying_customer_config:a?"Fixed "+t+", Pre "+o+", Post "+s:void 0};this.dataLayerService.sendEventForConsentClick(b)}isSecondToLast(n){return n===this.consentChoices.length-2}openConsentPanel(n){if(!this.callCenterAccordionData)return;this.handleDataLayerForConsentLick(n);const t=this.getNormalizedConsentId(n.value),o=this.callCenterAccordionData?.children?.find(a=>a.consent_id===t);if(!o)return;const s={...this.callCenterAccordionData,children:[o],filteredTermsandConditions:[{id:o.consent_id,mandatory:!1,AutopayPaymentType:o.AutopayPaymentType||null}],mandatoryCheckBox:[],muleUserConsentData:[],checkedConsents:{},currentCheckedConsents:{},isButtonDisabled:!1};this.sidePanelService.showCallCenterTCSidePanel({title:this.translateService.getTranslation("CALL_CENTER.MULTILINE_CONSENT.TITLE"),callCenterSidepanelAccordionInfo:s,isCheckoutJourney:!0})}getNormalizedConsentId(n){const t={GeneralTnC:"GeneralTnC",GeneralTnCPrepaid:"GeneralTnCPrepaid",AutoPay:"AutoPay",InstConsent:"InstConsent",InsuranceConsent:"InsuranceConsent",TradeInConsent:"TradeInConsent",BillingPrefEmail:"BillingPrefEmail"};if(t[n])return t[n];const o=n.toLowerCase();for(const s in t)if(s.toLowerCase()===o)return t[s];return n}static{this.\u0275fac=function(t){return new(t||r)(e.rXU(u.Qq),e.rXU(e.gRc),e.rXU(d.J$),e.rXU(h.vXy),e.rXU(h.dDb),e.rXU(p.CallCenterService),e.rXU(h.hWh),e.rXU(d.Q2))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["lla-mobile-multiline-consent"]],inputs:{autopayConsent:"autopayConsent",showTncErrorTxt:"showTncErrorTxt"},outputs:{consentCheckboxChange:"consentCheckboxChange"},standalone:!1,features:[e.OA$],decls:4,vars:4,consts:[["class","consent-container",4,"ngIf"],["class","tnc-error-text",4,"ngIf"],["class","email-checkbox",4,"ngIf"],["class","consent-error",4,"ngIf"],[1,"consent-container"],[1,"consent-wrapper"],[3,"clickHandler","status","checkboxOptions","isFullWidthLabel"],[1,"consent-label","label-1-regular"],[4,"ngFor","ngForOf"],["role","button","tabindex","0",1,"consent-link",3,"click","keydown.enter","keydown.space"],[4,"ngIf"],[1,"tnc-error-text"],[1,"email-checkbox"],[3,"clickHandler","checkboxOptions","checkboxLabel","checkboxLabelTypography"],[1,"consent-error"],[1,"error-text","b4-regular"]],template:function(t,o){1&t&&e.DNE(0,A,7,10,"div",0)(1,N,2,1,"p",1)(2,S,2,3,"div",2)(3,v,3,1,"div",3),2&t&&(e.Y8G("ngIf",!o.isLoading&&!o.errorMessage&&o.consentChoices.length>0),e.R7$(),e.Y8G("ngIf",o.showTncErrorTxt),e.R7$(),e.Y8G("ngIf",o.emailconsent),e.R7$(),e.Y8G("ngIf",o.errorMessage))},dependencies:[P.Sq,P.bT,T.P],styles:[".consent-container[_ngcontent-%COMP%]{margin-top:16px;padding:12px 0}.consent-container[_ngcontent-%COMP%] .consent-wrapper[_ngcontent-%COMP%]{display:flex;align-items:flex-start}.consent-container[_ngcontent-%COMP%] .consent-wrapper[_ngcontent-%COMP%] lla-checkbox{flex-shrink:0}.consent-container[_ngcontent-%COMP%] .consent-wrapper[_ngcontent-%COMP%] lla-checkbox .lla-checkbox-container{align-items:flex-start}.consent-container[_ngcontent-%COMP%] .consent-wrapper[_ngcontent-%COMP%] lla-checkbox .lla-checkbox-container .checkbox-wrapper{margin-top:0;padding-top:0}.consent-container[_ngcontent-%COMP%] .consent-label[_ngcontent-%COMP%]{margin:0;padding:6px 0 0;line-height:1.5;color:#494c54;flex:1}.consent-container[_ngcontent-%COMP%] .consent-label[_ngcontent-%COMP%] .consent-link[_ngcontent-%COMP%]{color:#0071ce;cursor:pointer;text-decoration:underline}.consent-error[_ngcontent-%COMP%]{margin-top:16px;padding:12px;background-color:var(--error-50, #FEE);border-left:4px solid var(--error-400, #D00);border-radius:4px}.consent-error[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{color:var(--error-400, #D00);margin:0}.email-checkbox[_ngcontent-%COMP%] .checkbox-container{height:auto!important}.email-checkbox[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .email-checkbox[_ngcontent-%COMP%] .mat-checkbox-label[_ngcontent-%COMP%], .email-checkbox[_ngcontent-%COMP%] .mat-list-item-content[_ngcontent-%COMP%], .email-checkbox[_ngcontent-%COMP%] .mdc-list-item__content[_ngcontent-%COMP%]{color:var(--neutral-900, #1C1D1F)!important;width:100%!important;white-space:normal!important;word-wrap:break-word!important;position:relative!important;left:0!important;padding-right:10px;padding-top:2px}.email-checkbox[_ngcontent-%COMP%] .label-fullwidth-checkbox{color:#494c54!important;display:inline-flex}.tnc-error-text[_ngcontent-%COMP%]{font-weight:400;font-size:16px;line-height:22.4px;margin-top:-5px;color:var(--error-500)}"]})}}return r})()},47285:(x,E,c)=>{c.d(E,{o:()=>g});var e=c(60177),h=c(21626),d=c(71580),m=c(6629),p=c(54438);let g=(()=>{class u{static{this.\u0275fac=function(f){return new(f||u)}}static{this.\u0275mod=p.$C({type:u})}static{this.\u0275inj=p.G2t({imports:[e.MD,h.q1,d.ze,m.oW]})}}return u})()},88787:(x,E,c)=>{c.d(E,{B:()=>f,n:()=>T});const e=["true","1","y"],h=["false","0","n"];function d(C){return String(C??"").toLowerCase().trim().replace(/^"+|"+$/g,"")}function m(C){return e.includes(d(C))}function T(){if(function P(){try{const C=JSON.parse(localStorage.getItem("DetactedCustomer")||"{}"),I=String(C?.bancan||"").trim();return m(C?.isExistingCustomer)&&!!I}catch{return!1}}())return!0;const C=function p(...C){for(const I of C){const M=d(localStorage.getItem(I));if(e.includes(M))return!0;
1if(h.includes(M))return!1}return null}("isExistingCustomer","isExistingcustomer");return!(!0!==C||!function u(){try{const C=JSON.parse(localStorage.getItem("billingAccountFlag")||"{}");return m(C?.postpaidFlag)}catch{return!1}}())||!1!==C&&function g(){return!!sessionStorage.getItem("user_uid")?.trim()}()}function f(){return!T()}}}]);
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.