PageSourceSearch

https://www.lapp.com/chunk-HTB5LJVK.js

js lapp.com collected 2026-09-26 00:41:42 UTC 102,793 bytes, 1 lines download raw bytes

1import{a as me,b as sn,c as an,d as he,f as cn,g as Dt,j as rt,k as ot,l as st,m as Rt,n as ln}from"./chunk-W6VBUJD4.js";import{c as Mt}from"./chunk-E55KD4MH.js";import{d as Oe}from"./chunk-3AJ2BILB.js";import{B as rn,G as on}from"./chunk-GEB2B2G7.js";import{Ab as Ji,B as tt,Bb as Xi,Cb as en,Da as ji,Db as tn,E as Oi,Ea as Ie,F as Et,Fa as B,G as ge,Ga as X,H as Ce,J as Ni,K as Ui,N as It,O as it,P as Fe,Q as Pi,Wa as nt,X as Be,Ya as Lt,c as Te,e as le,eb as zi,fb as Hi,g as Ae,h as Me,ha as Vi,k as Mi,l as ki,m as Fi,mc as nn,n as Bi,nb as wt,o as ke,ob as Gi,qb as Wi,r as At,rb as qi,sb as Qi,tb as Ki,u as Xe,v as et,ya as Ee,yb as Yi,za as $i,zb as Zi}from"./chunk-3XNWBP7W.js";import{$a as r,Af as Ti,Ag as ye,B as Jt,Bb as y,Cf as Ai,Eg as xt,F as Xt,Fa as dt,Fc as oe,Fd as _e,G as L,Gc as se,Jb as l,Je as Z,Jg as bt,Jh as Tt,Kb as m,Kg as ne,L as q,Lb as u,Mb as x,Md as ht,N as ve,Nb as He,Nc as a,Ob as Ge,Oc as c,P as je,Pb as oi,Pc as We,Pd as xe,Pg as yt,Q as F,Qb as A,Rb as E,Rc as U,Sb as gt,T as De,Te as D,Ud as _i,Wb as b,Xa as ni,Xf as J,Y as ei,Yb as h,Yf as Ei,Yh as $,Z as ti,Zb as si,Ze as fi,Zf as Je,Zh as Ri,_a as ri,_b as p,_e as vi,a as Q,af as ft,bd as pi,bg as Ii,cc as Se,cf as vt,da as ii,dc as G,e as K,ec as W,ei as Re,fe as Qe,ff as be,ge as ce,ha as de,he as ie,i as Zt,ic as w,ie as gi,jb as S,je as Ci,jg as Li,ka as H,kc as N,lf as Si,lg as wi,mb as O,mc as ai,me as Ke,nb as te,nc as g,ne as Ye,o as re,oc as M,od as Ct,oe as Ze,of as xi,pb as _t,pc as C,pe as hi,pf as bi,qa as P,qc as ci,qd as qe,ra as ee,rd as Y,sa as ze,sb as d,ta as T,tc as li,u as R,ua as V,uc as mi,uf as St,v as pe,vc as ui,wd as di,wg as Di,xd as ae,y as pt,ya as f,yf as yi,za as v,zc as k}from"./chunk-53A2PL7G.js";import{a as z,b as $e}from"./chunk-JGSK7KMF.js";var kt=(function(t){return t.NAVIGATE="NAVIGATE",t})(kt||{});B.ASM_CUSTOMER_360="ASM_CUSTOMER_360";var Ne=class{},Le=(()=>{class t{constructor(e){this.asmAdapter=e}customerSearch(e){return this.asmAdapter.customerSearch(e)}customerLists(){return this.asmAdapter.customerLists()}bindCart(e){return this.asmAdapter.bindCart(e)}createCustomer(e){return this.asmAdapter.createCustomer(e)}createAsmSessionEvent(e){return this.asmAdapter.createAsmSessionEvent(e)}static{this.\u0275fac=function(i){return new(i||t)(T(Ne))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),hn=new ze("CustomerSearchPageNormalizer"),fn=new ze("CustomerListsNormalizer"),mn=(()=>{class t{constructor(e,i,n){this.commandService=e,this.asmConnector=i,this.userAccountFacade=n,this.bindCartCommand$=this.commandService.create(o=>this.userAccountFacade.get().pipe(R(_=>{if(_?.uid)return _.uid;throw new Error("No identifier for authenticated user found.")}),F(1),ve(_=>this.asmConnector.bindCart({cartId:o,customerId:_}))))}bindCart(e){return this.bindCartCommand$.execute(e)}static{this.\u0275fac=function(i){return new(i||t)(T(St),T(Le),T(Oe))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac})}}return t})(),un=(()=>{class t{constructor(e,i){this.asmConnector=e,this.command=i,this.createCustomerCommand=this.command.create(({user:n})=>this.asmConnector.createCustomer(n))}createCustomer(e){return this.createCustomerCommand.execute({user:e})}static{this.\u0275fac=function(i){return new(i||t)(T(Le),T(St))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac})}}return t})(),vn="[Asm] UI Update",at=class{constructor(s){this.payload=s,this.type=vn}},Sn="asm",Ue="[asm] Customer search data",Pe="[asm] Customer list customers search data",xn="[Asm] Customer Search",bn="[Asm] Customer Search Fail",Wn="[Asm] Customer Search Success",qn="[Asm] Customer Search Reset",yn="[Asm] Customer List Customers Search",Qn="[Asm] Customer List Customers Search Fail",Kn="[Asm] Customer List Customers Search Success",Yn="[Asm] Customer List Customers Search Reset",Ft=class extends D.LoaderLoadAction{constructor(s){super(Ue),this.payload=s,this.type=xn}},Bt=class extends D.LoaderFailAction{constructor(s){super(Ue,s),this.payload=s,this.type=bn}},ct=class extends D.LoaderSuccessAction{constructor(s){super(Ue),this.payload=s,this.type=Wn}},Ot=class extends D.LoaderResetAction{constructor(){super(Ue),this.type=qn}},Nt=class extends D.LoaderLoadAction{constructor(s){super(Pe),this.payload=s,this.type=yn}}
1,Ut=class extends D.LoaderFailAction{constructor(s){super(Pe,s),this.payload=s,this.type=Qn}},Pt=class extends D.LoaderSuccessAction{constructor(s){super(Pe),this.payload=s,this.type=Kn}},Vt=class extends D.LoaderResetAction{constructor(){super(Pe),this.type=Yn}},Zn="[Auth] Logout Customer Support Agent";var $t="[Asm] Assisted Session Event creation",pn="[Asm] Assisted Session Event creation Fail",dn="[Asm] Assisted Session Event creation Success",jt=class extends D.LoaderLoadAction{constructor(s){super($t),this.payload=s,this.type=$t}},zt=class extends D.LoaderFailAction{constructor(s){super(pn,s),this.payload=s,this.type=pn}},Ht=class extends D.LoaderSuccessAction{constructor(){super(dn),this.type=dn}};var Jn=(()=>{class t{constructor(){this.logger=V(be),this.asmConnector=V(Le),this.actions$=V(Ye),this.createAsmSessionEvent$=Ke(()=>this.actions$.pipe(Ze($t),R(e=>e.payload),de(e=>this.asmConnector.createAsmSessionEvent(e).pipe(R(()=>new Ht),q(i=>re(new zt(J(i,this.logger))))))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac})}}return t})(),Xn=(()=>{class t{constructor(e,i,n){this.actions$=e,this.asmConnector=i,this.logger=n,this.customerSearch$=Ke(()=>this.actions$.pipe(Ze(xn),R(o=>o.payload),de(o=>this.asmConnector.customerSearch(o).pipe(R(_=>new ct(_)),q(_=>_.status===400&&_.details?.[0]?.message?.indexOf("Wrong orderId")>-1?re(new ct({entries:[]})):re(new Bt(J(_,this.logger)))))))),this.customerListCustomersSearch$=Ke(()=>this.actions$.pipe(Ze(yn),R(o=>o.payload),de(o=>this.asmConnector.customerSearch(o).pipe(R(_=>new Pt(_)),q(_=>re(new Ut(J(_,this.logger))))))))}static{this.\u0275fac=function(i){return new(i||t)(T(Ye),T(Le),T(be))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac})}}return t})(),er=[Xn,Jn],tr={collapsed:!1};function ir(t=tr,s){switch(s.type){case vn:return z(z({},t),s.payload);case bn:return z(z({},t),s.payload);default:return t}}function nr(){return{customerSearchResult:D.loaderReducer(Ue),customerListCustomersSearchResult:D.loaderReducer(Pe),asmUi:ir}}var Tn=new ze("AsmReducers"),rr={provide:Tn,useFactory:nr};function or(t){return function(s,e){return e.type===Zn&&(s=$e(z({},s),{customerSearchResult:{}})),t(s,e)}}var sr=[or],Wt=gi(Sn),An=ie(Wt,t=>t.asmUi),En=ie(Wt,t=>t.customerSearchResult),ar=ie(En,t=>D.loaderValueSelector(t)),cr=ie(En,t=>D.loaderLoadingSelector(t)),qt=ie(Wt,t=>t.customerListCustomersSearchResult),lr=ie(qt,t=>D.loaderValueSelector(t)),mr=ie(qt,t=>D.loaderLoadingSelector(t)),ur=ie(qt,t=>D.loaderErrorSelector(t));var _n=(()=>{class t{constructor(e,i,n){this.queryService=e,this.asmConnector=i,this.store=n,this.customerListQuery$=this.queryService.create(()=>this.asmConnector.customerLists(),{reloadOn:void 0,resetOn:void 0})}getCustomerLists(){return this.customerListQuery$.get()}getCustomerListsState(){return this.customerListQuery$.getState()}customerListCustomersSearch(e){this.store.dispatch(new Nt(e))}getCustomerListCustomersSearchResults(){return this.store.pipe(ce(lr))}getCustomerListCustomersSearchResultsLoading(){return this.store.pipe(ce(mr))}customerListCustomersSearchReset(){this.store.dispatch(new Vt)}getCustomerListCustomersSearchResultsError(){return this.store.pipe(ce(ur))}static{this.\u0275fac=function(i){return new(i||t)(T(yi),T(Le),T(Qe))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac})}}return t})(),pr=[_n,{provide:st,useExisting:_n},mn,{provide:rt,useExisting:mn},un,{provide:ot,useExisting:un}],dr=(()=>{class t{constructor(e,i,n){this.statePersistenceService=e,this.store=i,this.authStorageService=n,this.subscription=new Q,this.key="asm"}initSync(){this.subscription.add(this.statePersistenceService.syncWithStorage({key:this.key,state$:this.getAsmState(),onRead:e=>this.onRead(e)}))}getAsmState(){return pe([this.store.pipe(L(e=>!!e.asm),ce(An)),re(this.authStorageService.getEmulatedUserToken()),this.authStorageService.getTokenTarget()]).pipe(R(([e,i,n])=>{let o=i;return o&&(o=z({},i),delete o.refresh_token),{ui:e,emulatedUserToken:o,tokenTarget:n}}))}onRead(e){e&&(e.ui&&this.store.dispatch(new at(e.ui)),e.emulatedUserToken&&this.authStorageService.setEmulatedUserToken(e.emulatedUserToken),e.tokenTarget&&this.authStorageService.setTokenTarget(e.tokenTarget))}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(T(Ei),T(Qe),T(cn))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),_r=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=te({type:t})}static{this.\u0275inj=ee({providers:[rr],imports:[_e,Ii,Ci.forFeature
1(Sn,Tn,{metaReducers:sr}),hi.forFeature(er)]})}}return t})();function gr(t){return()=>t.initSync()}var In=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=te({type:t})}static{this.\u0275inj=ee({providers:[Le,{provide:Ti,useFactory:gr,deps:[dr],multi:!0},...pr],imports:[_e,_r]})}}return t})(),lt=(()=>{class t{constructor(e){this.store=e}customerSearch(e){this.store.dispatch(new Ft(e))}customerSearchReset(){this.store.dispatch(new Ot)}getCustomerSearchResults(){return this.store.pipe(ce(ar))}getCustomerSearchResultsLoading(){return this.store.pipe(ce(cr))}updateAsmUiState(e){this.store.dispatch(new at(e))}getAsmUiState(){return this.store.pipe(ce(An))}createAsmSessionEvent(e){this.store.dispatch(new jt(e))}static{this.\u0275fac=function(i){return new(i||t)(T(Qe))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var j=(function(t){return t[t.ASC=1]="ASC",t[t.DESC=-1]="DESC",t})(j||{});function Cr(t=j.ASC){return(s,e)=>s===e?0:(s===!0?-1:1)*t}var xa=Cr(j.ASC);function hr(t=j.ASC){return(s,e)=>s===e?0:(s<e?-1:1)*t}var ba=hr(j.ASC);function Ln(t=j.ASC){return(s,e)=>{let i=s==null,n=e==null;return i===n?0:(i?-1:1)*t}}var ya=Ln(j.ASC),Ta=Ln(j.DESC);function wn(t=j.ASC){return(s,e)=>s===e?0:(s-e<0?-1:1)*t}var Aa=wn(j.ASC),Ea=wn(j.DESC);function fr(t=j.ASC,s,e){return(i,n)=>(i??"").localeCompare(n??"",s,e)*t}var Ia=fr(j.ASC);function Sr(t,s){if(t&1){let e=b();m(0,"cx-message",16),a(1,"cxTranslate"),h("closeMessage",function(){f(e);let n=p(2);return v(n.closeDialogAlert())}),u()}if(t&2){let e=p(2);l("text",c(1,2,"asm.saveCart.dialog.saveInfo"))("type",e.globalMessageType.MSG_TYPE_INFO)}}function xr(t,s){if(t&1&&(A(0),m(1,"div",14),d(2,Sr,2,4,"cx-message",15),a(3,"async"),u(),E()),t&2){let e=p();r(2),l("ngIf",c(3,1,e.showDialogAlert$))}}function br(t,s){if(t&1){let e=b();m(0,"cx-message",16),a(1,"cxTranslate"),h("closeMessage",function(){f(e);let n=p(2);return v(n.closeDialogAlert())}),u()}if(t&2){let e=p(2);l("text",c(1,2,"asm.saveCart.dialog.disableInfo"))("type",e.globalMessageType.MSG_TYPE_WARNING)}}function yr(t,s){if(t&1&&(m(0,"div",14),d(1,br,2,4,"cx-message",15),a(2,"async"),u()),t&2){let e=p();r(),l("ngIf",c(2,1,e.showDialogAlert$))}}var Tr=["bindToCart"],Ar=["saveInactiveCart"];function Er(t,s){if(t&1){let e=b();m(0,"button",8,1),a(2,"async"),a(3,"async"),a(4,"async"),h("click",function(){f(e);let n=p();return v(n.bindCartToCustomer())}),m(5,"span"),a(6,"async"),g(7),a(8,"cxTranslate"),u(),x(9,"cx-dot-spinner"),a(10,"async"),a(11,"cxTranslate"),u()}if(t&2){let e=p();N("cx-asm-active",c(2,9,e.valid$))("cx-bind-loading",c(3,11,e.loading$)),l("disabled",!c(4,13,e.valid$)),r(5),y("aria-hidden",c(6,15,e.loading$)),r(2),C(" ",c(8,17,"asm.bindCart.bindCartToCustomer")," "),r(2),y("aria-hidden",!c(10,19,e.loading$))("aria-label",c(11,21,"common.loading"))}}function Ir(t,s){if(t&1){let e=b();m(0,"button",9,2),a(2,"async"),h("click",function(){f(e);let n=p();return v(n.onSaveInactiveCart())}),m(3,"span"),a(4,"async"),g(5),a(6,"cxTranslate"),u(),x(7,"cx-dot-spinner"),a(8,"async"),a(9,"cxTranslate"),u()}if(t&2){let e=p();N("cx-bind-loading",c(2,6,e.loading$)),r(3),y("aria-hidden",c(4,8,e.loading$)),r(2),C(" ",c(6,10,"asm.saveCart.saveCartBtn")," "),r(2),y("aria-hidden",!c(8,12,e.loading$))("aria-label",c(9,14,"common.loading"))}}function Lr(t,s){if(t&1){let e=b();m(0,"cx-message",14),a(1,"cxTranslate"),h("closeMessage",function(){f(e);let n=p();return v(n.closeDialogInfoAlert())}),u()}if(t&2){let e=p();l("text",c(1,2,"asm.createCustomerForm.createAccountAlert"))("type",e.globalMessageType.MSG_TYPE_INFO)}}function wr(t,s){if(t&1){let e=b();m(0,"cx-message",14),h("closeMessage",function(){f(e);let n=p().index,o=p();return v(o.closeDialogBackendErroAlert(n))}),u()}if(t&2){let e=p().$implicit,i=p();l("text",e)("type",i.globalMessageType.MSG_TYPE_ERROR)}}function Dr(t,s){if(t&1&&(A(0),d(1,wr,1,2,"cx-message",8),E()),t&2){let e=s.index,i=p();r(),l("ngIf",i.showDialogBackendErrorAlerts[e])}}function Rr(t,s){if(t&1&&(m(0,"div"),x(1,"cx-form-required-legend"),m(2,"div",15)(3,"label")(4,"span",16),g(5),a(6,"cxTranslate"),x(7,"cx-form-required-asterisks"),u(),x(8,"input",17),a(9,"cxTranslate"),x(10,"cx-form-errors",18),u()(),m(11,"div",15)(12,"label")(13,"span",16),g(14),a(15,"cxTranslate"),x(16,"cx-form-required-asterisks"),u(),x(17,"input",19),a(18,"cxTranslate"),x(19,"cx-form-errors",20),u()(),m(20,"div",15)(21,"label")(22,"span",16),g(23),a(24,"cxTranslate"),x(25,"cx-form-required-asterisks"),u(),x(26,"input",21),a(27,"cxTranslate"),x(28,"cx-form-errors",22),u()()()),t&2){let e,i,n,o=p();r(5),C("",c(6,18,"asm.createCustomerForm.firstName.label")," "),r(3),l("placeholder",k(c(9,20,"asm.createCustomerForm.firstName.placeholder"))),y("aria-invalid",((e=o.registerForm.get("firstName"))==null?null:e.touched)&&((e=o.registerForm.get("firstName"))==null?null:e.invalid))("aria-errormessage","firstNameError"),r(2),l("control",o.registerForm.get("firstName")),r(4),C("",c(1
15,22,"asm.createCustomerForm.lastName.label")," "),r(3),l("placeholder",k(c(18,24,"asm.createCustomerForm.lastName.placeholder"))),y("aria-invalid",((i=o.registerForm.get("lastName"))==null?null:i.touched)&&((i=o.registerForm.get("lastName"))==null?null:i.invalid))("aria-errormessage","lastNameError"),r(2),l("control",o.registerForm.get("lastName")),r(4),C("",c(24,26,"asm.createCustomerForm.emailAddress.label")," "),r(3),l("placeholder",k(c(27,28,"asm.createCustomerForm.emailAddress.placeholder"))),y("aria-invalid",((n=o.registerForm.get("email"))==null?null:n.touched)&&((n=o.registerForm.get("email"))==null?null:n.invalid))("aria-errormessage","emailError"),r(2),l("control",o.registerForm.get("email"))}}function Mr(t,s){t&1&&(m(0,"div",23),x(1,"cx-spinner"),u())}function kr(t,s){t&1&&(m(0,"span",3),g(1),a(2,"cxTranslate"),u()),t&2&&(r(),C(" ",c(2,1,"asm.toggleUi.collapse")," "))}function Fr(t,s){t&1&&(m(0,"span",3),g(1),a(2,"cxTranslate"),u()),t&2&&(r(),C(" ",c(2,1,"asm.toggleUi.expand")," "))}var Dn=t=>({label:t});function Br(t,s){if(t&1){let e=b();m(0,"form",2),h("ngSubmit",function(){f(e);let n=p();return v(n.onSubmit())}),m(1,"span",3),g(2),a(3,"cxTranslate"),u(),m(4,"label"),x(5,"input",4),a(6,"cxTranslate"),x(7,"cx-form-errors",5),a(8,"cxTranslate"),u(),m(9,"span",3),g(10),a(11,"cxTranslate"),u(),m(12,"label"),x(13,"input",6),a(14,"cxTranslate"),x(15,"cx-form-errors",7),a(16,"cxTranslate"),u(),m(17,"button",8),g(18),a(19,"cxTranslate"),u()()}if(t&2){let e,i,n=p();l("formGroup",n.csAgentLoginForm),r(2),C(" ",c(3,14,"asm.loginForm.userId.label")," "),r(3),y("aria-label",c(6,16,"asm.loginForm.userId.label"))("aria-invalid",((e=n.csAgentLoginForm.get("userId"))==null?null:e.touched)&&((e=n.csAgentLoginForm.get("userId"))==null?null:e.invalid))("aria-errormessage","userIdError"),r(2),l("translationParams",oe(28,Dn,c(8,18,"asm.loginForm.userId.label")))("control",n.csAgentLoginForm.get("userId")),r(3),C(" ",c(11,20,"asm.loginForm.password.label")," "),r(3),y("aria-label",c(14,22,"asm.loginForm.password.label"))("aria-invalid",((i=n.csAgentLoginForm.get("password"))==null?null:i.touched)&&((i=n.csAgentLoginForm.get("password"))==null?null:i.invalid))("aria-errormessage","passwordError"),r(2),l("translationParams",oe(30,Dn,c(16,24,"asm.loginForm.password.label")))("control",n.csAgentLoginForm.get("password")),r(3),C(" ",c(19,26,"asm.loginForm.submit")," ")}}function Or(t,s){t&1&&(x(0,"cx-dot-spinner",9),a(1,"cxTranslate")),t&2&&y("aria-label",c(1,1,"common.loading"))}var Nr=["asmCustomer360Launcher"];function Ur(t,s){if(t&1){let e=b();m(0,"button",7,0),h("click",function(){f(e);let n=p(2);return v(n.openAsmCustomer360())}),g(2),a(3,"cxTranslate"),u()}t&2&&(r(2),C(" ",c(3,1,"asm.asmCustomer360ViewButton")," "))}function Pr(t,s){if(t&1){let e=b();A(0),m(1,"div",2)(2,"label",3),g(3),u(),m(4,"label",4),g(5),u()(),x(6,"cx-asm-bind-cart"),d(7,Ur,4,3,"button",5),m(8,"button",6),a(9,"cxTranslate"),h("click",function(){f(e);let n=p();return v(n.logoutCustomer())}),g(10),a(11,"cxTranslate"),u(),E()}if(t&2){let e=p();r(3),M(e.customer==null?null:e.customer.name),r(2),M(e.customer==null?null:e.customer.uid),r(2),l("ngIf",e.isAsmCustomer360Configured&&e.customer),r(),y("aria-label",c(9,5,"asm.endSessionAriaLabel")),r(2),C(" ",c(11,7,"asm.endSession")," ")}}var Vr=["resultList"],$r=["searchTerm"],jr=["searchOrder"],zr=["createCustomerLink"],Hr=["searchResultItem"];function Gr(t,s){if(t&1){let e=b();m(0,"span",20,3),h("click",function(){f(e);let n=p(3);return v(n.createCustomer())}),g(2),a(3,"cxTranslate"),u()}t&2&&(r(2),C(" ",c(3,1,"asm.customerSearch.createCustomer")," "))}function Wr(t,s){if(t&1&&(m(0,"div",13)(1,"div",14)(2,"div",15)(3,"span",16),x(4,"cx-icon",17),u(),m(5,"span",18),g(6),a(7,"cxTranslate"),u(),d(8,Gr,4,3,"span",19),u()()()),t&2){let e=p(2);r(6),C("",c(7,2,"asm.customerSearch.noCustomerMatchResult")," "),r(2),l("ngIf",e.config.asm==null||e.config.asm.createCustomer==null?null:e.config.asm.createCustomer.enable)}}function qr(t,s){if(t&1){let e=b();m(0,"button",23,4),h("keydown.arrowup",function(n){f(e);let o=p(3);return v(o.focusPreviousChild(n))})("keydown.arrowdown",function(n){f(e);let o=p(3);return v(o.focusNextChild(n))})("keydown.arrowright",function(n){f(e);let o=p(3);return v(o.focusInputText(n))})("keydown.arrowleft",function(n){f(e);let o=p(3);return v(o.focusInputText(n))})("keydown.enter",function(n){let o=f(e).$implicit,_=p(3);return v(_.selectCustomerFromList(n,o))})("keydown.escape",function(n){f(e);let o=p(3);return v(o.closeResults(n))})("keydown.home",function(n){f(e);let o=p(3);return v(o.focusInputText(n))})("keydown.end",function(n){f(e);let o=p(3);return v(o.focusInputText(n))})("click",function(n){let o=f(e).$implicit,_=p(3);return v(_.selectCustomerFromList(n,o))}),m(2,"div",24),g(3),u(),m(4,"div",25)(5,"span"),g(6),u()()()}if(t&2){let e=s.$implicit,i=s.index,n=p(3);N("active",n.activeFocusedButtonIndex===i),l("tabindex",n.activeFocusedButtonIndex===i?0:-1),y("aria-selected",n.activeFocusedButtonIndex===i),r(3),M(e.name),r(3),M(e.uid)}}function Qr(t,s){if(t&1&&(m(0,"div",21),d(1,qr,7,6,"button",22),u()),t&2){let e=p().ngIf;r(),l("ngForOf",e.entries)}}function Kr(t,s){if(t&1&&(m(0,"div",null,2),d(2,Wr,9,4,"div",12)(3,Qr,2,1,"div",9),u()),t&2){let e=s.ngIf,i=p(),n=w(6);r(2),l("ngIf",i.isNoResultMessageInfoVisible(e,i.searchByCustomer,n)),r(),l("ngIf",i.isSearchResultsVisible(e,i.searchByCustomer))}}function Yr(t,s){t&1&&(m(0,"div",21),x(1,"cx-dot-spinner",26),a(2,"cxTranslate"),u()),t&2&&(r(),y("aria-label",c(2,1,"common.loading")))}function Zr(t,s){t&1&&(m(0,"div",13)(1,"div",14)(2,"div",15)(3,"span",16),x(4,"cx-icon",17),u(),m(5,"span",18),g(6),a(7,"cxTranslate"),u()()()()),t&2&&(r(6),C(" ",c(7,1,"asm.customerSearch.noOrderMatchResult")," "))}function Jr(t,s){if(t&1){let e=b();m(0,"button",23,4),h("keydown.arrowup",function(n){f(e);let o=p(3);return v(o.focusPreviousChild(n))})("keydown.arrowdown",function(n){f(e);let o=p(3);return v(o.focusNextChild(n))})("keydown.arrowright",function(n){f(e);let o=p(3);return v(o.focusOrderSearchInputText(n))})("keydown.arrowleft",function(n){f(e);let o=p(3);return v(o.focusOrderSearchInputText(n))})("keydown.enter",function(n){let o=f(e).$implicit,_=p(3);return v(_.selectCustomerFromList(n,o))})("keydown.escape",function(n){f(e);let o=p(3);return v(o.closeOrderSearchResults(n))})("keydown.home",function(n){f(e);let o=p(3);return v(o.focusOrderSearchInputText(n))})("keydown.end",function(n){f(e);let o=p(3);return v(o.focusOrderSearchInputText(n))})("click",function(n){let o=f(e).$implicit,_=p(3);return v(_.selectCustomerFromList(n,o))}),m(2,"div",24),g(3),u(),m(4,"div",25)(5,"span"),g(6),u()()()}if(t&2){let e=s.$implicit,i=s.index,n=p(3),o=w(17);N("active",n.activeFocusedButtonIndex===i),l("tabindex",n.activeFocusedButtonIndex===i?0:-1),y("aria-selected",n.activeFocusedButtonIndex===i),r(3),M(o.value),r(3),M(e.name)}}function Xr(t,s){if(t&1&&(m(0,"div",21),d(1,Jr,7,6,"button",22),u()),t&2){let e=p().ngIf;r(),l("ngForOf",e.entries)}}function eo(t,s){if(t&1&&(m(0,"div",null,2),d(2,Zr,8,3,"div",12)(3,Xr,2,1,"div",9),u()),t&2){let e=s.ngIf,i=p(),n=w(17);r(2),l("ngIf",i.isNoResultMessageInfoVisible(e,i.searchByOrder,n)),r(),l("ngIf",i.isSearchResultsVisible(e,i.searchByOrder))}}function to(t,s){t&1&&(m(0,"div",21),x(1,"cx-dot-spinner",26),a(2,"cxTranslate"),u()),t&2&&(r(),y("aria-label",c(2,1,"common.loading")))}var io=["customerListLink"],Rn=["addNewCustomerLink"];function no(t,s){if(t&1){let e=b();m(0,"div",16)(1,"a",17,0),h("click",function(){f(e);let n=p();return v(n.showCustomList())}),x(3,"cx-icon",10),m(4,"span"),g(5),a(6,"cxTranslate"),u()()()}if(t&2){let e=p();r(3),l("type",e.iconTypes.USER_FRIENDS),r(2),M(c(6,2,"asm.customers"))}}function ro(t,s){t&1&&x(0,"cx-asm-toggle-ui")}function oo(t,s){if(t&1&&(A(0),d(1,ro,1,0,"cx-asm-toggle-ui",13),a(2,"async"),E()),t&2){let e=p();r(),l("ngIf",c(2,1,e.customerSupportAgentLoggedIn$))}}function so(t,s){t&1&&x(0,"cx-asm-session-timer")}function ao(t,s){if(t&1){let e=b();m(0,"div",16)(1,"a",18),h("click",function(){f(e);let n=p(2);return v(n.loginCustomerSupportAgentWithAuthorizationCodeFlow())}),g(2),a(3,"cxTranslate"),u()()}t&2&&(r(2),M(c(3,1,"asm.asmSignIn")))}function co(t,s){if(t&1&&(A(0),d(1,ao,4,3,"div",11),a(2,"async"),E()),t&2){let e=p();r(),l("ngIf",!c(2,1,e.customerSupportAgentLoggedIn$))}}function lo(t,s){if(t&1){let e=b();m(0,"button",19),a(1,"cxTranslate"),h("click",function(){f(e);let n=p();return v(n.hideUi())}
1),u()}t&2&&l("title",k(c(1,2,"asm.hideUi")))}function mo(t,s){if(t&1){let e=b();m(0,"button",20),a(1,"cxTranslate"),h("click",function(){f(e);let n=p();return v(n.logout())}),u()}t&2&&l("title",k(c(1,2,"asm.logout")))}function uo(t,s){t&1&&x(0,"cx-customer-emulation")}function po(t,s){if(t&1){let e=b();m(0,"cx-message",23),a(1,"cxTranslate"),h("closeMessage",function(){f(e);let n=p(4);return v(n.closeDialogConfirmationAlert())}),u()}if(t&2){let e=p(4);l("text",c(1,2,"asm.createCustomerSuccessfullyAlert"))("type",e.globalMessageType.MSG_TYPE_CONFIRMATION)}}function _o(t,s){if(t&1){let e=b();m(0,"cx-message",23),a(1,"cxTranslate"),h("closeMessage",function(){f(e);let n=p(4);return v(n.closeDeeplinkCartInfoAlert())}),u()}if(t&2){let e=p(4);l("text",c(1,2,e.deeplinkCartAlertKey))("type",e.globalMessageType.MSG_TYPE_INFO)}}function go(t,s){if(t&1){let e=b();m(0,"cx-message",23),a(1,"cxTranslate"),h("closeMessage",function(){f(e);let n=p(4);return v(n.closeCustomerEmulationInfoAlert())}),u()}if(t&2){let e=p(4);l("text",c(1,2,"asm.startCustomerEmulationAlertInfo"))("type",e.globalMessageType.MSG_TYPE_INFO)}}function Co(t,s){if(t&1&&(A(0),d(1,uo,1,0,"cx-customer-emulation",13)(2,po,2,4,"cx-message",22)(3,_o,2,4,"cx-message",22),a(4,"async"),d(5,go,2,4,"cx-message",22),E()),t&2){let e=p(2).ngIf,i=p();r(),l("ngIf",e),r(),l("ngIf",e&&i.showCreateCustomerSuccessfullyAlert),r(),l("ngIf",c(4,4,i.showDeeplinkCartInfoAlert$)),r(2),l("ngIf",e&&i.showCustomerEmulationInfoAlert)}}function ho(t,s){if(t&1){let e=b();m(0,"cx-customer-selection",25),h("submitEvent",function(n){f(e);let o=p(4);return v(o.startCustomerEmulationSession(n,n.parameters))}),u()}}function fo(t,s){if(t&1&&d(0,ho,1,0,"cx-customer-selection",24),t&2){let e=p(2).ngIf;l("ngIf",e)}}function vo(t,s){if(t&1&&(A(0),d(1,Co,6,6,"ng-container",21),a(2,"async"),d(3,fo,1,1,"ng-template",null,2,U),E()),t&2){let e=w(4),i=p(2);r(),l("ngIf",c(2,2,i.customer$))("ngIfElse",e)}}function So(t,s){if(t&1){let e=b();m(0,"cx-csagent-login-form",27),a(1,"async"),h("submitEvent",function(n){f(e);let o=p(4);return v(o.loginCustomerSupportAgent(n))}),u()}if(t&2){let e=p(4);l("csAgentTokenLoading",c(1,1,e.csAgentTokenLoading$))}}function xo(t,s){if(t&1&&(A(0),d(1,So,2,3,"cx-csagent-login-form",26),E()),t&2){let e=p(2).ngIf;r(),l("ngIf",e)}}function bo(t,s){t&1&&d(0,xo,2,1,"ng-container",12),t&2&&l("cxFeature","!authorizationCodeFlowByDefault")}function yo(t,s){if(t&1&&(A(0),d(1,vo,5,4,"ng-container",21),a(2,"async"),d(3,bo,1,1,"ng-template",null,1,U),E()),t&2){let e=w(4),i=p();r(),l("ngIf",c(2,2,i.customerSupportAgentLoggedIn$))("ngIfElse",e)}}var To=(t,s)=>({customerA:t,customerB:s}),Ao=t=>({customerListsPage:t}),Eo=t=>({customerSearchPage:t}),Io=(t,s)=>({customerEntry:t,column:s,showHeader:!1}),Kt=(t,s)=>({customerEntry:t,column:s,showHeader:!0}),Mn=(t,s)=>({column:t,customerEntry:s}),kn=t=>({count:t}),Lo=t=>({ariaLabel:t,ariaControls:"asm-cusomer-list-table"});function wo(t,s){}function Do(t,s){t&1&&d(0,wo,0,0,"ng-template")}function Ro(t,s){}function Mo(t,s){t&1&&d(0,Ro,0,0,"ng-template")}function ko(t,s){}function Fo(t,s){t&1&&d(0,ko,0,0,"ng-template")}function Bo(t,s){}function Oo(t,s){t&1&&d(0,Bo,0,0,"ng-template")}function No(t,s){}function Uo(t,s){t&1&&d(0,No,0,0,"ng-template")}function Po(t,s){if(t&1&&(m(0,"div",24),a(1,"async"),m(2,"div",25),a(3,"async"),d(4,Mo,1,0,null,26)(5,Fo,1,0,null,26),a(6,"async"),u(),m(7,"div",27),a(8,"async"),d(9,Oo,1,0,null,14)(10,Uo,1,0,null,14),u()()),t&2){let e=s.ngIf,i=p(),n=w(35),o=w(37),_=w(39),I=w(43);N("tablet-mobile",c(1,12,i.breakpoint$)!==i.BREAKPOINT.md),r(2),N("mobile",c(3,14,i.breakpoint$)===i.BREAKPOINT.xs),r(2),l("ngTemplateOutlet",I)("ngTemplateOutletContext",oe(20,Ao,e)),r(),l("ngTemplateOutlet",o)("ngTemplateOutletContext",oe(22,Eo,c(6,16,i.customerSearchPage$))),r(2),N("mobile",c(8,18,i.breakpoint$)===i.BREAKPOINT.xs),r(2),l("ngTemplateOutlet",_),r(),l("ngTemplateOutlet",n)}}function Vo(t,s){t&1&&(m(0,"div",28),g(1),a(2,"cxTranslate"),u()),t&2&&(r(),C(" ",c(2,1,"asm.customerList.noLists")," "))}function $o(t,s){t&1&&(m(0,"div",28),g(1),a(2,"cxTranslate"),u()),t&2&&(r(),C(" ",c(2,1,"asm.customerList.listsError")," "))}function jo(t,s){t&1&&(m(0,"div",28),g(1),a(2,"cxTranslate"),u()),t&2&&(r(),C(" ",c(2,1,"generalErrors.pageFailure")," "))}function zo(t,s){t&1&&x(0,"cx-spinner")}function Ho(t,s){t&1&&(A(0),g(1),a(2,"cxTranslate"),E()),t&2&&(r(),C(" ",c(2,1,"asm.customerList.tableHeader.customerName")," "))}function Go(t,s){t&1&&(A(0),g(1),a(2,"cxTranslate"),E()),t&2&&(r(),C(" ",c(2,1,"asm.customerList.tableHeader.emailId")," "))}function Wo(t,s){if(t&1&&(A(0),g(1),a(2,"cxTranslate"),E()),t&2){let e=p(2).$implicit;r(),C(" ",c(2,1,e.headerLocalizationKey)," ")}}function qo(t,s){if(t&1&&(m(0,"span"),d(1,Ho,3,3,"ng-container",20)(2,Go,3,3,"ng-container",20)(3,Wo,3,3,"ng-container",20),u(
1)),t&2){let e=p().$implicit;r(),l("ngIf",e.headerLocalizationKey==="asm.customerList.tableHeader.customer"),r(),l("ngIf",e.headerLocalizationKey==="asm.customerList.tableHeader.email"),r(),l("ngIf",e.headerLocalizationKey!=="asm.customerList.tableHeader.customer"&&e.headerLocalizationKey!=="asm.customerList.tableHeader.email")}}function Qo(t,s){if(t&1&&(m(0,"th",36),d(1,qo,4,3,"span",20),u()),t&2){let e=s.$implicit;r(),l("ngIf",e.headerLocalizationKey&&e.headerLocalizationKey!=="hideHeaders")}}function Ko(t,s){if(t&1&&(m(0,"thead")(1,"tr",34),d(2,Qo,2,1,"th",35),u()()),t&2){let e=p(3);r(2),l("ngForOf",e.customerListConfig==null?null:e.customerListConfig.columns)}}function Yo(t,s){}function Zo(t,s){t&1&&d(0,Yo,0,0,"ng-template")}function Jo(t,s){if(t&1&&(m(0,"td",39),d(1,Zo,1,0,null,26),u()),t&2){let e=s.$implicit,i=p(2).$implicit;p(3);let n=w(31);r(),l("ngTemplateOutlet",n)("ngTemplateOutletContext",se(2,Io,i,e))}}function Xo(t,s){if(t&1&&(A(0),d(1,Jo,2,5,"td",38),E()),t&2){let e=p(4);r(),l("ngForOf",e.customerListConfig==null?null:e.customerListConfig.columns)}}function es(t,s){}function ts(t,s){t&1&&d(0,es,0,0,"ng-template")}function is(t,s){if(t&1&&(A(0),d(1,ts,1,0,null,26),E()),t&2){let e=p().$implicit,i=p(2).$implicit;p(3);let n=w(31);r(),l("ngTemplateOutlet",n)("ngTemplateOutletContext",se(2,Kt,i,e))}}function ns(t,s){if(t&1&&(A(0),d(1,is,2,5,"ng-container",20),E()),t&2){let e=s.even;r(),l("ngIf",e)}}function rs(t,s){}function os(t,s){t&1&&d(0,rs,0,0,"ng-template")}function ss(t,s){if(t&1&&(A(0),d(1,os,1,0,null,26),E()),t&2){let e=p().$implicit,i=p(2).$implicit;p(3);let n=w(31);r(),l("ngTemplateOutlet",n)("ngTemplateOutletContext",se(2,Kt,i,e))}}function as(t,s){if(t&1&&(A(0),d(1,ss,2,5,"ng-container",20),E()),t&2){let e=s.odd;r(),l("ngIf",e)}}function cs(t,s){if(t&1&&(A(0),m(1,"td",40),d(2,ns,2,1,"ng-container",41),u(),m(3,"td",40),d(4,as,2,1,"ng-container",41),u(),E()),t&2){let e=p(4);r(2),l("ngForOf",e.customerListConfig==null?null:e.customerListConfig.columns),r(2),l("ngForOf",e.customerListConfig==null?null:e.customerListConfig.columns)}}function ls(t,s){}function ms(t,s){t&1&&d(0,ls,0,0,"ng-template")}function us(t,s){if(t&1&&(A(0),d(1,ms,1,0,null,26),E()),t&2){let e=s.$implicit,i=p(2).$implicit;p(3);let n=w(31);r(),l("ngTemplateOutlet",n)("ngTemplateOutletContext",se(2,Kt,i,e))}}function ps(t,s){if(t&1&&(m(0,"td",40),d(1,us,2,5,"ng-container",41),u()),t&2){let e=p(4);r(),l("ngForOf",e.customerListConfig==null?null:e.customerListConfig.columns)}}function ds(t,s){if(t&1&&(m(0,"tr",34),d(1,Xo,2,1,"ng-container",20),a(2,"async"),d(3,cs,5,2,"ng-container",20),a(4,"async"),d(5,ps,2,1,"td",37),a(6,"async"),u()),t&2){let e=p(3);r(),l("ngIf",c(2,3,e.breakpoint$)===e.BREAKPOINT.md),r(2),l("ngIf",c(4,5,e.breakpoint$)===e.BREAKPOINT.sm),r(2),l("ngIf",c(6,7,e.breakpoint$)===e.BREAKPOINT.xs)}}function _s(t,s){if(t&1&&(m(0,"table",31)(1,"caption",32),g(2),a(3,"cxTranslate"),u(),d(4,Ko,3,1,"thead",20),a(5,"async"),m(6,"tbody"),d(7,ds,7,9,"tr",33),u()()),t&2){let e=p().ngIf,i=p();r(2),C(" ",c(3,3,"asm.customerList.title")," "),r(2),l("ngIf",c(5,5,i.breakpoint$)===i.BREAKPOINT.md),r(3),l("ngForOf",e==null?null:e.entries)}}function gs(t,s){t&1&&(m(0,"div",42),g(1),a(2,"cxTranslate"),u()),t&2&&(r(),C(" ",c(2,1,"asm.customerList.noCustomers")," "))}function Cs(t,s){if(t&1&&(m(0,"div"),d(1,_s,8,7,"table",29)(2,gs,3,3,"div",30),u()),t&2){let e=s.ngIf,i=p();r(),l("ngIf",i.loaded),r(),l("ngIf",!(e!=null&&e.entries.length))}}function hs(t,s){if(t&1){let e=b();m(0,"div")(1,"cx-pagination",44),h("viewPageEvent",function(n){f(e);let o=p(2);return v(o.changePage(n))}),u()()}if(t&2){let e=s.ngIf;r(),l("pagination",e.pagination)}}function fs(t,s){if(t&1&&(m(0,"div",43),a(1,"async"),m(2,"div",27),a(3,"async"),d(4,hs,2,1,"div",20),a(5,"async"),u()()),t&2){let e=p();N("asm-mobile-pagination",c(1,5,e.breakpoint$)!==e.BREAKPOINT.md),r(2),N("mobile",c(3,7,e.breakpoint$)===e.BREAKPOINT.xs),r(2),l("ngIf",c(5,9,e.customerSearchPage$))}}function vs(t,s){if(t&1&&(m(0,"span",50),g(1),a(2,"cxTranslate"),u()),t&2){let e=p(2).column;r(),C(" ",c(2,1,e.headerLocalizationKey)," ")}}function Ss(t,s){t&1&&gt(0)}function xs(t,s){if(t&1&&(A(0),d(1,Ss,1,0,"ng-container",26),E()),t&2){let e=p(2),i=e.customerEntry,n=e.column;p();let o=w(33);r(),l("ngTemplateOutlet",o)("ngTemplateOutletContext",se(2,Mn,n,i))}}function bs(t,s){if(t&1&&(x(0,"img",54),a(1,"cxTranslate"),a(2,"cxTranslate")),t&2){let e=p(3).customerEntry,i=p();l("alt",k(c(1,5,"asm.mainLogoLabel")))("title",k(c(2,7,"asm.mainLogoLabel"))),y("src",(i.occConfig==null||i.occConfig.backend==null||i.occConfig.backend.occ==null?null:i.occConfig.backend.occ.baseUrl)+(e==null||e.userAvatar==null?null:e.userAvatar.url),ni)}}function ys(t,s){if(t&1&&(m(0,"div",55),g(1),u()),t&2){let e=p(3).customerEntry,i=p();r(),C(" ",i.getBadgeText(e)," ")}}function Ts(t,s){if(t&1&&(m(0,"div",51),d(1,bs,3,9,"img",52)(2,ys,2,1,"div",53),u()),t&2){let e=p(2).customerEntry;r(),l("ngIf",e==null||e.userAvatar==null?null:e.userAvatar.url),r(),l("ngIf",!(!(e==null||e.userAvatar==null)&&e.userAvatar.url))}}function As(t,s){t&1&&gt(0)}function Es(t,s){if(t&1){let e=b();m(0,"button",56),a(1,"cxTranslate"),a(2,"cxTranslate"),h("click",function(){f(e);let n=p(2),o=n.customerEntry,_=n.column,I=p();return v(I.startColumnAction(o,_.actionType))}),d(3,As,1,0,"ng-container",26),u()}if(t&2){let e=p(2),i=e.customerEntry,n=e.column,o=p(),_=w(33);ai((n.actionType==="ACTIVE_CART"?"cx-cart ":"")+(n.actionType!=="START_SESSION"?"cx-action-disable":"")),l("disabled",o.isRequired(i,n.actionType)),y("title",n.icon?c(1,7,n.icon.captionLocalizationKey??n.headerLocalizationKey):void 0)("aria-label",n.icon?c(2,9,n.icon.captionLocalizationKey??n.headerLocalizationKey):void 0),r(3),l("ngTemplateOutlet",_)("ngTemplateOutletContext",se(11,Mn,n,i))}}function Is(t,s){if(t&1&&(m(0,"div",46),d(1,vs,3,3,"span",47)(2,xs,2,5,"ng-container",20)(3,Ts,3,2,"div",48)(4,Es,4,14,"button",49),u()),t&2){let e=p(),i=e.column,n=e.showHeader,o=p();r(),l("ngIf",n),r(),l("ngIf",!i.actionType),r(),l("ngIf",(o.customerListConfig==null?null:o.customerListConfig.showAvatar)&&(i==null?null:i.actionType)===(o.customerListColumnActionType==null?null:o.customerListColumnActionType.START_SESSION)),r(),l("ngIf",i.actionType)}}function Ls(t,s){if(t&1&&d(0,Is,5,4,"div",45),t&2){let e=s.column;l("ngIf",e.headerLocalizationKey!=="hideHeaders")}}function ws(t,s){if(t&1&&(m(0,"span"),g(1),u()),t&2){let e=p(),i=e.customerEntry,n=e.column;r(),M((n.renderer==null?null:n.renderer(i))||"")}}function Ds(t,s){if(t&1&&(x(0,"cx-icon",58),a(1,"cxTranslate"),a(2,"cxTranslate")),t&2){let e=p(),i=e.customerEntry,n=e.column,o=p();N("cx-action-color",n.actionType&&!o.isRequired(i,n.actionType)),l("type",n.icon.symbol),y("title",n.actionType?void 0:c(1,5,n.icon.captionLocalizationKey??n.headerLocalizationKey))("aria-label",n.actionType?void 0:c(2,7,n.icon.captionLocalizationKey??n.headerLocalizationKey))}}function Rs(t,s){if(t&1&&(m(0,"div"),d(1,ws,2,1,"span",20)(2,Ds,3,9,"cx-icon",57),u()),t&2){let e=s.column;r(),l("ngIf",!e.icon),r(),l("ngIf",e.icon)}}function Ms(t,s){if(t&1){let e=b();m(0,"div",59)(1,"input",60),a(2,"cxTranslate"),h("keyup",function(n){f(e);let o=p();return v(o.onKey(n))}
1),u(),m(3,"cx-icon",61),a(4,"cxTranslate"),a(5,"cxTranslate"),h("click",function(){f(e);let n=p();return v(n.searchCustomers())}),u()()}if(t&2){let e=p();r(),l("placeholder",k(c(2,6,"asm.customerList.searchBox")))("formControl",e.searchBox),r(2),l("type",e.iconTypes.SEARCH)("title",c(4,8,"storeFinder.searchNearestStores")),y("aria-label",c(5,10,"storeFinder.searchNearestStores"))}}function ks(t,s){if(t&1&&(A(0),g(1),a(2,"cxTranslate"),E()),t&2){let e=p(2).customerSearchPage;r(),C(" ",We(2,1,"asm.customerList.noOfCustomers",oe(4,kn,e==null||e.pagination==null?null:e.pagination.totalResults))," ")}}function Fs(t,s){t&1&&(A(0),g(1),a(2,"cxTranslate"),E()),t&2&&(r(),C(" ",c(2,1,"asm.customerList.oneCustomer")," "))}function Bs(t,s){if(t&1&&(m(0,"span",63),d(1,ks,3,6,"ng-container",20)(2,Fs,3,3,"ng-container",20),u()),t&2){let e=p().customerSearchPage;r(),l("ngIf",(e==null||e.pagination==null?null:e.pagination.totalResults)>1),r(),l("ngIf",(e==null||e.pagination==null?null:e.pagination.totalResults)===1)}}function Os(t,s){if(t&1&&d(0,Bs,3,2,"span",62),t&2){let e=s.customerSearchPage;l("ngIf",e==null||e.pagination==null?null:e.pagination.totalResults)}}function Ns(t,s){if(t&1){let e=b();m(0,"label")(1,"span",64),g(2),a(3,"cxTranslate"),u(),m(4,"cx-sorting",65),a(5,"cxTranslate"),a(6,"async"),h("sortListEvent",function(n){f(e);let o=p();return v(o.changeSortCode(n))}),u()()}if(t&2){let e=p();r(2),M(c(3,7,"asm.customerList.tableSort.sortBy")),r(2),l("placeholder",k(c(5,9,"asm.customerList.tableSort.sortBy")))("sortOptions",e.sorts)("sortLabels",c(6,11,e.getSortLabels()))("selectedOption",e.sortCode)("ariaLabel",e.sortCode)}}function Us(t,s){if(t&1){let e=b();m(0,"button",69),h("click",function(){f(e);let n=p(2);return v(n.goToPreviousPage())}),x(1,"cx-icon",70),m(2,"span"),g(3),a(4,"cxTranslate"),u()()}if(t&2){let e=p(2);l("disabled",e.currentPage===0||!e.loaded),r(),l("type",e.iconTypes.CARET_LEFT),r(2),M(c(4,3,"asm.customerList.page.previous"))}}function Ps(t,s){if(t&1){let e=b();m(0,"button",71),h("click",function(){f(e);let n=p(2);return v(n.goToNextPage())}),m(1,"span"),g(2),a(3,"cxTranslate"),u(),x(4,"cx-icon",72),u()}if(t&2){let e=p(2);l("disabled",e.currentPage===e.maxPage||!e.loaded),r(2),M(c(3,3,"asm.customerList.page.next")),r(2),l("type",e.iconTypes.CARET_RIGHT)}}function Vs(t,s){if(t&1&&(m(0,"div",66)(1,"div"),g(2),a(3,"cxTranslate"),u(),d(4,Us,5,5,"button",67)(5,Ps,5,5,"button",68),u()),t&2){let e=p();r(2),C(" ",We(3,3,"asm.customerList.page.page",oe(6,kn,e.currentPage+1))," "),r(2),l("ngIf",e.maxPage>0),r(),l("ngIf",e.maxPage>0)}}function $s(t,s){if(t&1){let e=b();m(0,"label")(1,"span",64),g(2),a(3,"cxTranslate"),u(),m(4,"ng-select",73),a(5,"cxTranslate"),a(6,"cxTranslate"),h("change",function(){f(e);let n=p();return v(n.onChangeCustomerGroup())}),ui("ngModelChange",function(n){f(e);let o=p();return mi(o.selectedUserGroupId,n)||(o.selectedUserGroupId=n),v(n)}),u()()}if(t&2){let e=s.customerListsPage,i=p();r(2),M(c(3,9,"asm.customerList.title")),r(2),l("ariaLabelDropdown",k(c(5,11,"common.ngSelectDropdownOptionsList")))("searchable",!1)("clearable",!1)("tabIndex",0),li("ngModel",i.selectedUserGroupId),l("items",e==null?null:e.userGroups)("cxNgSelectA11y",oe(15,Lo,c(6,13,"asm.customerList.title")))}}function js(t,s){if(t&1){let e=b();m(0,"button",74),a(1,"cxTranslate"),a(2,"cxTranslate"),h("click",function(){f(e);let n=p();return v(n.closeModal("Cross click"))}),m(3,"span",75),x(4,"cx-icon",58),u()()}if(t&2){let e=p();l("title",k(c(1,4,"common.close"))),y("aria-label",c(2,6,"common.close")),r(4),l("type",e.iconTypes.CLOSE)}}function zs(t,s){if(t&1){let e=b();m(0,"button",77),h("click",function(){f(e);let n=p(2);return v(n.createCustomer())}),x(1,"cx-icon",58),m(2,"span"),g(3),a(4,"cxTranslate"),u()()}if(t&2){let e=p(2);r(),l("type",e.iconTypes.USER_PLUS),r(2),M(c(4,2,"asm.customerList.createCustomer"))}}function Hs(t,s){if(t&1&&d(0,zs,5,4,"button",76),t&2){let e=p();l("ngIf",e.asmConfig.asm==null||e.asmConfig.asm.createCustomer==null?null:e.asmConfig.asm.createCustomer.enable)}}var mt=(function(t){return t.CANCEL="CANCEL",t.REPLACE="REPLACE",t})(mt||{}),Gs=(()=>{class t{constructor(e){this.launchDialogService=e,this.BIND_CART_ACTION=mt,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0}}closeModal(e){this.launchDialogService.closeDialog(e)}static{this.\u0275fac=function(i){return new(i||t)(S(X))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-bind-cart-dialog"]],decls:20,vars:19,consts:[["role","dialog","aria-labelledby","asm-bind-cart-dialog-title",1,"cx-asm-bind-cart-dialog","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal
1-header"],["id","asm-bind-cart-dialog-title",1,"title","modal-title"],[1,"cx-dialog-body","modal-body"],[1,"cx-dialog-row"],[1,"cx-dialog-item"],[1,"cx-dialog-footer","modal-footer"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-secondary",3,"click"]],template:function(i,n){i&1&&(m(0,"div",0),h("esc",function(){return n.closeModal(n.BIND_CART_ACTION.CANCEL)}),m(1,"div",1)(2,"div",2)(3,"h2",3),g(4),a(5,"cxTranslate"),u()(),m(6,"div",4)(7,"div",5)(8,"div",6),g(9),a(10,"cxTranslate"),u()()(),m(11,"div",7)(12,"button",8),a(13,"cxTranslate"),h("click",function(){return n.closeModal(n.BIND_CART_ACTION.REPLACE)}),g(14),a(15,"cxTranslate"),u(),m(16,"button",9),a(17,"cxTranslate"),h("click",function(){return n.closeModal(n.BIND_CART_ACTION.CANCEL)}),g(18),a(19,"cxTranslate"),u()()()()),i&2&&(l("cxFocus",n.focusConfig),r(4),C(" ",c(5,7,"asm.bindCart.dialog.title")," "),r(5),C(" ",c(10,9,"asm.bindCart.dialog.body")," "),r(3),y("aria-label",c(13,11,"asm.bindCart.dialog.actions.replace")),r(2),C(" ",c(15,13,"asm.bindCart.dialog.actions.replace")," "),r(2),y("aria-label",c(17,15,"common.cancel")),r(2),C(" ",c(19,17,"common.cancel")," "))},dependencies:[Ee,$],encapsulation:2})}}return t})(),ut=(function(t){return t.CANCEL="CANCEL",t.SAVE="SAVE",t})(ut||{}),Fn=(()=>{class t{constructor(e,i){this.launchDialogService=e,this.savedCartFacade=i,this.BIND_CART_ACTION=ut,this.showDialogAlert$=new K(!0),this.globalMessageType=ne,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0}}ngOnInit(){this.launchDialogService.data$.pipe(F(1)).subscribe(e=>{this.cart=e,this.setCartTotalQty()})}setCartTotalQty(){let e=0;if(this.cart.entries)for(let i of this.cart.entries)e+=i.quantity?i.quantity:0;this.cartQty=e}closeDialogAlert(){this.showDialogAlert$.next(!1)}closeModal(e){e===ut.SAVE&&this.saveCart(),this.launchDialogService.closeDialog(e)}saveCart(){this.savedCartFacade.saveCart({cartId:this.cart.code,saveCartName:this.cart.code,saveCartDescription:"-"})}static{this.\u0275fac=function(i){return new(i||t)(S(X),S(Mt))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-save-cart-dialog"]],decls:38,vars:31,consts:[["showSaveCartWarning",""],["role","dialog","aria-labelledby","asm-save-cart-dialog-title",1,"cx-asm-save-cart-dialog","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal-header"],["id","asm-save-cart-dialog-title",1,"title","modal
1-title"],[1,"cx-dialog-body","modal-body"],[4,"ngIf","ngIfElse"],[1,"cx-dialog-content"],[1,"cx-dialog-row","row"],[1,"cx-dialog-item","col-sm-6","col-md-6","text-right","item-left-text"],[1,"cx-dialog-item","col-sm-6","col-md-6","text-left","item-right-text"],[1,"cx-dialog-footer","modal-footer"],["id","asm-save-cart-dialog-btn","type","button",1,"btn","btn-primary",3,"click","disabled"],["type","button",1,"btn","btn-secondary",3,"click"],[1,"message-container"],[3,"text","type","closeMessage",4,"ngIf"],[3,"closeMessage","text","type"]],template:function(i,n){if(i&1&&(m(0,"div",1),h("esc",function(){return n.closeModal(n.BIND_CART_ACTION.CANCEL)}),m(1,"div",2)(2,"div",3)(3,"h2",4),g(4),a(5,"cxTranslate"),u()(),m(6,"div",5),d(7,xr,4,3,"ng-container",6)(8,yr,3,3,"ng-template",null,0,U),m(10,"div",7)(11,"div",8)(12,"div",9),g(13),a(14,"cxTranslate"),u(),m(15,"div",10),g(16),u()(),m(17,"div",8)(18,"div",9),g(19),a(20,"cxTranslate"),u(),m(21,"div",10),g(22),u()(),m(23,"div",8)(24,"div",9),g(25),a(26,"cxTranslate"),u(),m(27,"div",10),g(28),u()()()(),m(29,"div",11)(30,"button",12),a(31,"cxTranslate"),h("click",function(){return n.closeModal(n.BIND_CART_ACTION.SAVE)}),g(32),a(33,"cxTranslate"),u(),m(34,"button",13),a(35,"cxTranslate"),h("click",function(){return n.closeModal(n.BIND_CART_ACTION.CANCEL)}),g(36),a(37,"cxTranslate"),u()()()()),i&2){let o=w(9);l("cxFocus",n.focusConfig),r(4),C(" ",c(5,15,"asm.saveCart.dialog.title")," "),r(3),l("ngIf",n.cartQty>0)("ngIfElse",o),r(6),C(" ",c(14,17,"asm.saveCart.dialog.row.id")," "),r(3),C(" ",n.cart.code," "),r(3),C(" ",c(20,19,"asm.saveCart.dialog.row.qtyFull")," "),r(3),C(" ",n.cartQty," "),r(3),C(" ",c(26,21,"asm.saveCart.dialog.row.total")," "),r(3),C(" ",n.cart.totalPriceWithTax==null?null:n.cart.totalPriceWithTax.formattedValue," "),r(2),l("disabled",n.cartQty===0),y("aria-label",c(31,23,"asm.saveCart.dialog.actions.save")),r(2),C(" ",c(33,25,"asm.saveCart.dialog.actions.save")," "),r(2),y("aria-label",c(35,27,"common.cancel")),r(2),C(" ",c(37,29,"common.cancel")," ")}},dependencies:[Ee,Y,nt,ae,$],encapsulation:2})}}return t})(),Yt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cx-dot-spinner"]],decls:3,vars:0,template:function(i,n){i&1&&oi(0,"div")(1,"div")(2,"div")},encapsulation:2,changeDetection:0})}}return t})(),Ve=(()=>{class t{constructor(e,i,n,o,_){this.authService=e,this.csAgentAuthService=i,this.winRef=n,this.asmEnablerService=o,this.asmDeepLinkService=_,this.isEmulatedByDeepLink$=new K(!1),this.showDeeplinkCartInfoAlert$=new K(!1),this.routingService=V(ye)}getSearchParameter(e){return this.asmDeepLinkService?.getSearchParameter(e)}isEmulatedByDeepLink(){return this.isEmulatedByDeepLink$}setEmulatedByDeepLink(e){this.isEmulatedByDeepLink$.next(e)}setShowDeeplinkCartInfoAlert(e){this.showDeeplinkCartInfoAlert$.next(e)}shouldShowDeeplinkCartInfoAlert(){return this.showDeeplinkCartInfoAlert$}logoutCustomerSupportAgentAndCustomer(){this.csAgentAuthService.logoutCustomerSupportAgent()}logoutCustomer(){this.authService.logout()}isCustomerEmulationSessionInProgress(){return this.csAgentAuthService.isCustomerEmulated()}unload(){this.winRef.localStorage&&this.winRef.localStorage.removeItem(sn)}isEmulateInURL(){return this.asmDeepLinkService?.isEmulateInURL()||!1}getDeepLinkUrlParams(){return this.asmDeepLinkService?.getParamsInUrl()}handleDeepLinkNavigation(e=this.getDeepLinkUrlParams()){this.asmDeepLinkService?.handleNavigation(e)}handleAsmDialogAction(e){typeof e=="object"&&e.actionType===kt.NAVIGATE&&this.routingService.go(e.route)}static{this.\u0275fac=function(i){return new(i||t)(T(xt),T(Dt),T(vi),T(an),T(ln))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Bn=(()=>{class t{constructor(e,i,n,o,_,I,ue,we){this.globalMessageService=e,this.activeCartFacade=i,this.multiCartFacade=n,this.asmBindCartFacade=o,this.launchDialogService=_,this.savedCartFacade=I,this.asmComponentService=ue,this.routing=we,this.activeCartValidator=fe=>fe.value===this.activeCartId?{activeCartError:!0}:(this.deepLinkCartId&&fe.value!==this.deepLinkCartId&&this.resetDeeplinkCart(),null),this.cartId=new ki("",[le.required,le.minLength(1),this.activeCartValidator]),this.loading$=new K(!1),this.valid$=this.cartId.statusChanges.pipe(R(fe=>fe==="VALID"),ii(1)),this.activeCartId="",this.deepLinkCartId="",this.displayBindCartBtn$=new K(!0),this.displaySaveCartBtn$=new K(!1),this.subscription=new Q}ngOnInit(){this.subscribeForDeeplinkCart(),this.subscription.add(this.activeCartFacade.getActiveCartId().subscribe(e=>{this.activeCartId=e??""}))}bindCartToCustomer(){let e=this.cartId.value,i=pe([this.loading$.asObservable(),this.valid$]).pipe(F(1),L(([n,o])=>!n&&o),H(()=>this.loading$.next(!0)),ve(()=>this.activeCartFacade.getActive().pipe(R(n=>n.deliveryItemsQuantity??0),F(1))),ve(n=>Jt(()=>!!(this.activeCartId&&n),this.openDialog(this.activeCartId,e),this.simpleBindCart(e))),ei(()=>this.loading$.next(!1))).subscribe({next:()=>{this.globalMessageService.add({key:"asm.bindCart.success"},ne.MSG_TYPE_CONFIRMATION)},error:n=>{this.globalMessageService.add(n.details?.[0].message??"",ne.MSG_TYPE_ERROR)}});this.subscription.add(i)}onSaveInactiveCart(){this.asmComponentService?.setShowDeeplinkCartInfoAlert(!1);let e=this.asmComponentService?.getSearchParameter("customerId");this.multiCartFacade.loadCart({cartId:this.deepLinkCartId,userId:e}),this.multiCartFacade.getCartEntity(this.deepLinkCartId).pipe(L(i=>i.loading===!1&&i.success===!0),F(1),R(i=>i.value),L(i=>!!i)).subscribe(i=>{this.openASMSaveCartDialog(i)}),this.afterCloseASMSaveCartDialog()}clearText(){this.cartId.setValue(""),this.resetDeeplinkCart()}resetDeeplinkCart(){this.deepLinkCartId="",this.displayBindCartBtn$.next(!0),this.displaySaveCartBtn$.next(!1),this.asmComponentService?.setShowDeeplinkCartInfoAlert(!1)}ngOnDestroy(){this.subscription.unsubscribe()}simpleBindCart(e){return pt(()=>this.asmBindCartFacade.bindCart(e)).pipe(H(()=>this.multiCartFacade.reloadCart(fi)))}openDialog(e,i){return pt(()=>
1(this.launchDialogService.openDialogAndSubscribe(B.ASM_BIND_CART,this.bindToCartElemRef),this.launchDialogService.dialogClose.pipe(L(n=>!!n),F(1)))).pipe(L(n=>!!n),ve(n=>this.selectBindAction(e,i,n)))}selectBindAction(e,i,n){switch(n){case mt.REPLACE:return this.replaceCart(e,i);case mt.CANCEL:default:return Zt}}replaceCart(e,i){return this.simpleBindCart(i).pipe(H(()=>{this.savedCartFacade.saveCart({cartId:e,saveCartName:e,saveCartDescription:"-"})}))}subscribeForDeeplinkCart(){this.subscription.add(this.asmComponentService?.isEmulatedByDeepLink().pipe(L(e=>e&&!!this.asmComponentService?.getSearchParameter("cartId"))).subscribe(()=>{let e=this.asmComponentService?.getSearchParameter("cartType");(e==="inactive"||e==="active")&&(this.displayBindCartBtn$.next(!1),this.displaySaveCartBtn$.next(e==="inactive"),this.deepLinkCartId=this.asmComponentService?.getSearchParameter("cartId"),e==="inactive"&&this.cartId.setValue(this.deepLinkCartId),this.asmComponentService?.setShowDeeplinkCartInfoAlert(!0),this.asmComponentService?.handleDeepLinkNavigation())}))}openASMSaveCartDialog(e){this.launchDialogService.openDialogAndSubscribe(B.ASM_SAVE_CART,this.saveInactiveCartElemRef,e)}afterCloseASMSaveCartDialog(){this.launchDialogService.dialogClose.pipe(L(e=>e===ut.SAVE),F(1),H(()=>this.loading$.next(!0))).subscribe(),this.savedCartFacade.getSaveCartProcessSuccess().pipe(L(e=>e),F(1),H(()=>this.loading$.next(!1))).subscribe(()=>{this.goToSavedCartDetails(this.deepLinkCartId),this.displaySaveCartBtn$.next(!1)}),this.savedCartFacade.getSaveCartProcessError().pipe(L(e=>e),F(1),H(()=>this.loading$.next(!1))).subscribe()}goToSavedCartDetails(e){this.routing?.go({cxRoute:"savedCartsDetails",params:{savedCartId:e}})}static{this.\u0275fac=function(i){return new(i||t)(S(bt),S(on),S(rn),S(rt),S(X),S(Mt),S(Ve),S(ye))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-bind-cart"]],viewQuery:function(i,n){if(i&1&&Se(Tr,5)(Ar,5),i&2){let o;
1G(o=W())&&(n.bindToCartElemRef=o.first),G(o=W())&&(n.saveInactiveCartElemRef=o.first)}},decls:12,vars:15,consts:[["cartIdElement",""],["bindToCart",""],["saveInactiveCart",""],["for","cartNumber"],[3,"click","ngClass"],["id","cartNumber","autocomplete","off","formcontrolname","cartNumber",3,"keydown.enter","formControl"],["class","cx-asm-bindCartToCustomer","type","submit",3,"disabled","cx-asm-active","cx-bind-loading","click",4,"ngIf"],["id","asm-save-inactive-cart-btn","class","cx-asm-bindCartToCustomer cx-asm-active","type","submit",3,"cx-bind-loading","click",4,"ngIf"],["type","submit",1,"cx-asm-bindCartToCustomer",3,"click","disabled"],["id","asm-save-inactive-cart-btn","type","submit",1,"cx-asm-bindCartToCustomer","cx-asm-active",3,"click"]],template:function(i,n){if(i&1){let o=b();m(0,"form")(1,"label",3),g(2),a(3,"cxTranslate"),u(),m(4,"div",4),a(5,"async"),h("click",function(){f(o);let I=w(7);return v(I.focus())}),m(6,"input",5,0),h("keydown.enter",function(){return n.bindCartToCustomer()}),u()(),d(8,Er,12,23,"button",6),a(9,"async"),d(10,Ir,10,16,"button",7),a(11,"async"),u()}i&2&&(r(2),C("",c(3,7,"asm.bindCart.cartNumber")," "),r(2),N("active",c(5,9,n.valid$)),l("ngClass","cx-asm-assignCart-input-show-no-button"),r(2),l("formControl",n.cartId),r(2),l("ngIf",c(9,11,n.displayBindCartBtn$)),r(2),l("ngIf",c(11,13,n.displaySaveCartBtn$)))},dependencies:[ge,ke,Te,Ae,Me,Mi,Ct,Ce,At,Y,Yt,ae,$],encapsulation:2,changeDetection:0})}}return t})(),On=(()=>{class t{constructor(e,i,n,o){this.launchDialogService=e,this.fb=i,this.asmCreateCustomerFacade=n,this.translationService=o,this.iconTypes=it,this.isLoading$=new K(!1),this.showDialogInfoAlert=!0,this.globalMessageType=ne,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0},this.registerForm=this.fb.group({firstName:["",le.required],lastName:["",le.required],email:["",[le.required,nn.emailValidator]]})}submitForm(){this.registerForm.valid?this.registerUser():this.registerForm.markAllAsTouched()}registerUser(){this.isLoading$.next(!0);let{firstName:e,lastName:i,email:n}=this.registerForm.value;this.createdCustomer={firstName:e??"",lastName:i??"",email:n??""};let o=this.asmCreateCustomerFacade.createCustomer(this.collectDataFromRegisterForm());o.subscribe({next:_=>this.onRegisterUserSuccess(_),error:_=>this.onRegisterUserFail(_)}),o.subscribe({complete:()=>this.isLoading$.next(!1)})}collectDataFromRegisterForm(){return{firstName:this.createdCustomer.firstName,lastName:this.createdCustomer.lastName,emailAddress:this.createdCustomer.email}}closeModal(e){this.launchDialogService.closeDialog(e)}closeDialogInfoAlert(){this.showDialogInfoAlert=!1}closeDialogBackendErroAlert(e){this.showDialogBackendErrorAlerts[e]=!1}onRegisterUserSuccess(e){this.launchDialogService.closeDialog(e)}onRegisterUserFail(e){this.isLoading$.next(!1),this.backendErrorMessages=[],this.showDialogBackendErrorAlerts=[];let i="httpHandlers.unknownError",n=e.details??[];n.length===0&&this.addErrorMessage(i),n.forEach(o=>{switch(o.type||""){case"ValidationError":this.addErrorMessage(`asm.createCustomerForm.validationErrors.${o.subject}`);break;case"AssistedServiceDuplicatedUidError":this.addErrorMessage("asm.createCustomerForm.badRequestDuplicatedEmail",{emailAddress:this.createdCustomer.email});break;default:this.addErrorMessage(i)}})}addErrorMessage(e,i){this.translationService.translate(e,i).pipe(ti()).subscribe(n=>{this.backendErrorMessages.push(n),this.showDialogBackendErrorAlerts.push(!0)})}static{this.\u0275fac=function(i){return new(i||t)(S(X),S(Oi),S(ot),S(Tt))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-create-customer-form"]],decls:23,vars:17,consts:[["loading",""],["role","dialog","aria-labelledby","asm-create-customer-form-title",1,"cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[3,"ngSubmit","formGroup"],[1,"cx-dialog-header","modal-header"],["id","asm-create-customer-form-title",1,"title","modal
1-title"],[1,"cx-dialog-body","modal-body"],[1,"message-container"],[3,"text","type","closeMessage",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"modal-footer"],["type","submit",1,"btn","cx-asm-create-customer-btn","cx-asm-create-customer-btn-create"],["type","button",1,"btn","cx-asm-create-customer-btn","cx-asm-create-customer-btn-cancel",3,"click"],[3,"closeMessage","text","type"],[1,"form-group"],[1,"label-content"],["required","true","formControlName","firstName","name","text",1,"form-control",3,"placeholder"],["id","firstNameError",3,"control"],["required","true","name","text","formControlName","lastName",1,"form-control",3,"placeholder"],["id","lastNameError",3,"control"],["required","true","name","email","formControlName","email",1,"form-control",3,"placeholder"],["id","emailError",3,"control"],[1,"cx-spinner"]],template:function(i,n){if(i&1&&(m(0,"div",1),h("esc",function(){return n.closeModal("Escape clicked")}),m(1,"div",2),A(2),m(3,"form",3),h("ngSubmit",function(){return n.submitForm()}),m(4,"div",4)(5,"h2",5),g(6),a(7,"cxTranslate"),u()(),m(8,"div",6)(9,"div",7),d(10,Lr,2,4,"cx-message",8)(11,Dr,2,1,"ng-container",9),u(),d(12,Rr,29,30,"div",10),a(13,"async"),u(),m(14,"div",11)(15,"button",12),g(16),a(17,"cxTranslate"),u(),m(18,"button",13),h("click",function(){return n.closeModal("Cancel click")}),g(19),a(20,"cxTranslate"),u()()(),E(),u()(),d(21,Mr,2,0,"ng-template",null,0,U)),i&2){let o=w(22);l("cxFocus",n.focusConfig),r(3),l("formGroup",n.registerForm),r(3),C(" ",c(7,9,"asm.createCustomerForm.title")," "),r(4),l("ngIf",n.showDialogInfoAlert),r(),l("ngForOf",n.backendErrorMessages),r(),l("ngIf",!c(13,11,n.isLoading$))("ngIfElse",o),r(4),C(" ",c(17,13,"asm.createCustomerForm.createAccount")," "),r(3),C(" ",c(20,15,"asm.createCustomerForm.cancel")," ")}},dependencies:[Ee,ge,ke,Te,Ae,Me,tt,Ce,et,Xe,Y,nt,qe,wt,Qi,Ki,Lt,ae,$],encapsulation:2})}}return t})(),Ws={launch:{ASM_CREATE_CUSTOMER_FORM:{inlineRoot:!0,component:On,dialogType:Ie.DIALOG}}},qs=(()=>{class t{transform(e){e<0&&(e=0);let i=Math.floor(e/60),n=e%60,o;i<10?o=("00"+i).slice(-2):o=i+"";let _=("00"+n).slice(-2);return`${o}:${_}`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=_t({name:"formatTimer",type:t,pure:!0})}}return t})(),Qs=(()=>{class t{constructor(e,i,n,o,_){this.config=e,this.asmComponentService=i,this.routingService=n,this.changeDetectorRef=o,this.userIdService=_,this.subscriptions=new Q,this.maxStartDelayInSeconds=6e4}ngOnInit(){this.initTimer(),this.interval=setInterval(()=>{let e=new Date().getTime()/1e3;this.timeLeft=Math.floor(this.expiredTime-e),this.timeLeft<=0&&(clearInterval(this.interval),this.asmComponentService.logoutCustomerSupportAgentAndCustomer()),this.changeDetectorRef.markForCheck()},1e3),this.resetOnNavigate(),this.resetOnCustomerSessionChange()}resetOnNavigate(){this.subscriptions.add(this.routingService.isNavigating().subscribe(e=>{e&&this.resetTimer()}))}resetOnCustomerSessionChange(){this.subscriptions.add(this.userIdService.getUserId().pipe(De()).subscribe(()=>this.resetTimer()))}initTimer(){let e=this.getTimerStartDelayInSeconds(),i=new Date().getTime()/1e3;this.timeLeft=e,this.expiredTime=i+this.timeLeft}resetTimer(){this.timeLeft>0&&this.initTimer()}getTimerStartDelayInSeconds(){return this.config.asm?.agentSessionTimer?.startingDelayInSeconds===void 0?600:this.config.asm.agentSessionTimer.startingDelayInSeconds>this.maxStartDelayInSeconds?this.maxStartDelayInSeconds:this.config.asm.agentSessionTimer.startingDelayInSeconds}ngOnDestroy(){this.subscriptions.unsubscribe(),this.interval&&clearInterval(this.interval)}static{this.\u0275fac=function(i){return new(i||t)(S(me),S(Ve),S(ye),S(pi),S(Je))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-session-timer"]],decls:12,vars:19,consts:[["aria-hidden","true",1,"label"],["role","timer","tabindex","0",1,"time"],[1,"reset",3,"click"]],template:function(i,n){i&1&&(He(0,"span",0),g(1),a(2,"cxTranslate"),Ge(),He(3,"span",1),a(4,"cxTranslate"),a(5,"formatTimer"),a(6,"cxTranslate"),g(7),a(8,"formatTimer"),a(9,"cxTranslate"),Ge(),He(10,"button",2),a(11,"cxTranslate"),si("click",function(){return n.resetTimer()}),Ge()),i&2&&(r(),C("",c(2,5,"asm.agentSessionTimer.label"),":"),r(2),y("aria-label",c(4,7,"asm.agentSessionTimer.label")+": "+c(5,9,n.timeLeft)+" "+c(6,11,"asm.agentSessionTimer.minutes")),r(4),ci("",c(8,13,n.timeLeft)," ",c(9,15,"asm.agentSessionTimer.minutes")),r(3),y("aria-label",c(11,17,"asm.agentSessionTimer.reset")))},dependencies:[$,qs],encapsulation:2})}}return t})(),Ks=(()=>{class t{constructor(e){this.asmService=e,this.subscription=new Q}ngOnInit(){this.subscription.add(this.asmService.getAsmUiState().subscribe(e=>{this.isCollapsed=e.collapsed===void 0?!1:e.collapsed}))}toggleUi(){this.asmService.updateAsmUiState({collapsed:!this.isCollapsed})}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(S(lt))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-toggle-ui"]],decls:4,vars:3,consts:[["tabindex","0","role","button",1,"toggleUi",3,"click"],[3,"ngClass"],["class","label",4,"ngIf"],[1,"label"]],template:function(i,n){i&1&&(m(0,"a",0),h("click",function(){return n.toggleUi()}),x(1,"span",1),d(2,kr,3,3,"span",2)(3,Fr,3,3,"span",2),u()),i&2&&(r(),l("ngClass",n.isCollapsed?"expandIcon":"collapseIcon"),r(),l("ngIf",!n.isCollapsed),r(),l("ngIf",n.isCollapsed))},dependencies:[Ct,Y,$],encapsulation:2})}}return t})(),Nn=(()=>{class t{constructor(e){this.fb=e,this.csAgentTokenLoading=!1,this.submitEvent=ne
1w dt}ngOnInit(){this.csAgentLoginForm=this.fb.group({userId:["",[le.required]],password:["",[le.required]]})}onSubmit(){this.csAgentLoginForm.valid?this.submitEvent.emit({userId:this.csAgentLoginForm.get("userId")?.value,password:this.csAgentLoginForm.get("password")?.value}):this.csAgentLoginForm.markAllAsTouched()}static{this.\u0275fac=function(i){return new(i||t)(S(Et))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-csagent-login-form"]],hostAttrs:["ngSkipHydration","true"],inputs:{csAgentTokenLoading:"csAgentTokenLoading"},outputs:{submitEvent:"submitEvent"},decls:2,vars:2,consts:[[3,"formGroup","ngSubmit",4,"ngIf"],["aria-hidden","false",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"label-content"],["required","true","type","text","formControlName","userId"],["id","userIdError",3,"translationParams","control"],["required","true","type","password","formControlName","password","cxPasswordVisibilitySwitch",""],["id","passwordError",3,"translationParams","control"],["type","submit"],["aria-hidden","false"]],template:function(i,n){i&1&&d(0,Br,20,32,"form",0)(1,Or,2,3,"cx-dot-spinner",1),i&2&&(l("ngIf",!n.csAgentTokenLoading),r(),l("ngIf",n.csAgentTokenLoading))},dependencies:[Y,ge,ke,Te,Ae,Me,tt,Ce,et,Xe,wt,Wi,Yt,$],encapsulation:2})}}return t})(),Un=(()=>{class t{constructor(e,i,n,o){this.asmComponentService=e,this.userAccountFacade=i,this.launchDialogService=n,this.featureModules=o,this.isAsmCustomer360Configured=!1,this.isAsmCustomer360Loaded$=new K(!1),this.subscription=new Q}ngOnInit(){this.isAsmCustomer360Configured=this.featureModules?.isConfigured("asmCustomer360"),this.isAsmCustomer360Configured&&this.featureModules?.resolveFeature("asmCustomer360").subscribe(()=>{this.isAsmCustomer360Loaded$.next(!0)}),this.subscription.add(this.userAccountFacade.get().subscribe(e=>{e&&(this.customer=e)})),this.isCustomerEmulationSessionInProgress$=this.asmComponentService.isCustomerEmulationSessionInProgress()}logoutCustomer(){this.asmComponentService.logoutCustomer()}openAsmCustomer360(){this.subscription.add(this.isAsmCustomer360Loaded$.pipe(L(e=>!!e)).subscribe(()=>{let e={customer:this.customer};this.launchDialogService?.openDialogAndSubscribe(B.ASM_CUSTOMER_360,this.asmCustomer360LauncherElement,e),this.subscription.add(this.launchDialogService?.dialogClose.pipe(L(i=>!!i)).subscribe(i=>{this.asmComponentService.handleAsmDialogAction(i)}))}))}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(S(Ve),S(Oe),S(X),S(Re))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-customer-emulation"]],viewQuery:function(i,n){if(i&1&&Se(Nr,5),i&2){let o;
1G(o=W())&&(n.asmCustomer360LauncherElement=o.first)}},decls:2,vars:3,consts:[["asmCustomer360Launcher",""],[4,"ngIf"],[1,"cx-asm-customerInfo"],[1,"cx-asm-name"],[1,"cx-asm-uid"],["class","cx-360-button",3,"click",4,"ngIf"],["formcontrolname","logoutCustomer",3,"click"],[1,"cx-360-button",3,"click"]],template:function(i,n){i&1&&(d(0,Pr,12,9,"ng-container",1),a(1,"async")),i&2&&l("ngIf",c(1,1,n.isCustomerEmulationSessionInProgress$))},dependencies:[Y,Bn,ae,$],encapsulation:2})}}return t})(),Pn=(()=>{class t{constructor(e,i,n,o,_){this.fb=e,this.asmService=i,this.config=n,this.directionService=o,this.launchDialogService=_,this.subscription=new Q,this.searchByCustomer=!1,this.searchByOrder=!1,this.isLoading=!1,this.activeFocusedButtonIndex=-1,this.submitEvent=new dt}ngOnInit(){this.customerSelectionForm=this.fb.group({searchTerm:"",searchOrder:""}),this.subscription.add(this.customerSelectionForm.controls.searchOrder.valueChanges.pipe(je(300)).subscribe(e=>{this.searchByCustomer=!1,this.searchByOrder=!0,this.handleSearchByOrder(e)})),this.asmService.customerSearchReset(),this.searchResultsLoading$=this.asmService.getCustomerSearchResultsLoading(),this.searchResults=this.asmService.getCustomerSearchResults(),this.subscription.add(this.customerSelectionForm.controls.searchTerm.valueChanges.pipe(je(300)).subscribe(e=>{this.searchByCustomer=!0,this.searchByOrder=!1,this.handleSearchByCustomer(e)})),this.subscription.add(this.searchResultsLoading$.subscribe(e=>{this.isLoading=e}))}handleSearchTerm(e){this.selectedCustomer&&e!==this.selectedCustomer.name&&(this.selectedCustomer=void 0),!this.selectedCustomer&&(this.asmService.customerSearchReset(),this.activeFocusedButtonIndex=-1,e.trim().length>=3&&this.asmService.customerSearch({query:e,pageSize:this.config.asm?.customerSearch?.maxResults}))}handleSearchByCustomer(e){this.selectedCustomer&&(this.selectedCustomer=void 0),this.customerSelectionForm.controls.searchOrder.value&&this.customerSelectionForm.controls.searchOrder.setValue(void 0,{emitEvent:!1}),this.asmService.customerSearchReset(),this.activeFocusedButtonIndex=-1,e.trim().length>=3&&this.asmService.customerSearch({query:e,pageSize:this.config.asm?.customerSearch?.maxResults})}handleSearchByOrder(e){this.selectedCustomer&&(this.selectedCustomer=void 0),this.customerSelectionForm.controls.searchTerm.value&&this.customerSelectionForm.controls.searchTerm.setValue(void 0,{emitEvent:!1}),this.asmService.customerSearchReset(),this.activeFocusedButtonIndex=-1,e.trim().length>=3&&this.asmService.customerSearch({orderId:e,pageSize:this.config.asm?.customerSearch?.maxResults})}isNoResultMessageInfoVisible(e,i,n){let o=n.value.length>=3,_=!!e.entries&&e.entries.length>0;return!this.isLoading&&o&&i&&!_}isSearchResultsVisible(e,i){return!!e.entries&&i&&e.entries.length>0}selectCustomerFromList(e,i){this.selectedCustomer=i,this.customerSelectionForm.controls.searchTerm.setValue(this.selectedCustomer.name,{emitEvent:!1}),this.asmService.customerSearchReset(),e.preventDefault(),e.stopPropagation()}onSubmit(){this.selectedCustomer?this.submitEvent.emit({customerId:this.selectedCustomer.customerId,parameters:{orderId:this.customerSelectionForm.controls.searchOrder.value}}):this.customerSelectionForm.markAllAsTouched()}onDocumentClick(e){if(this.resultList){if(this.resultList.nativeElement.contains(e.target)||this.searchTerm.nativeElement.contains(e.target))return;this.asmService.customerSearchReset()}}closeResults(e){this.asmService.customerSearchReset(),this.searchTerm.nativeElement.focus(),e.preventDefault(),e.stopPropagation()}closeOrderSearchResults(e){this.asmService.customerSearchReset(),this.searchOrder.nativeElement.focus(),e.preventDefault(),e.stopPropagation()}ngOnDestroy(){this.subscription.unsubscribe(),this.asmService.customerSearchReset()}focusFirstItem(e){e.preventDefault(),this.activeFocusedButtonIndex=0,this.updateItemIndex(this.activeFocusedButtonIndex)}setSelectionEnd(e){if(e.preventDefault(),this.searchTerm.nativeElement.value?.length){let i=this.searchTerm.nativeElement.value.length;this.searchTerm.nativeElement.selectionStart=i,this.searchTerm.nativeElement.selectionEnd=i}}setOrderSearchSelectionEnd(e){if(e.preventDefault(),this.searchOrder.nativeElement.value?.length){let i=this.searchOrder.nativeElement.value.length;this.searchOrder.nativeElement.selectionStart=i,this.searchOrder.nativeElement.selectionEnd=i}}focusPreviousChild(e){e.preventDefault(),this.activeFocusedButtonIndex--,this.activeFocusedButtonIndex<0&&(this.activeFocusedButtonIndex=this.searchResultItems.length-1),this.updateItemIndex(this.activeFocusedButtonIndex)}focusNextChild(e){e.preventDefault(),this.activeFocusedButtonIndex++,this.activeFocusedButtonIndex>this.searchResultItems.length-1&&(this.activeFocusedButtonIndex=0),this.updateItemIndex(this.activeFocusedButtonIndex)}focusInputText(e){if(e.preventDefault(),this.activeFocusedButtonIndex=-1,this.searchTerm.nativeElement.focus(),this.searchTerm.nativeElement.value?.length){let i=this.searchTerm.nativeElement.selectionEnd,n=this.searchTerm.nativeElement.value.length;this.isBackNavigation(e)?i=i<=0?0:i-1:this.isForwardsNavigation(e)?i=i>=n?n:i+1:e.code==="Home"?i=0:e.code==="End"&&(i=n),this.searchTerm.nativeElement.selectionStart=i,this.searchTerm.nativeElement.selectionEnd=i}}focusOrderSearchInputText(e){if(e.preventDefault(),this.activeFocusedButtonIndex=-1,this.searchOrder.nativeElement.focus(),this.searchOrder.nativeElement.value?.length){let i=this.searchOrder.nativeElement.selectionEnd,n=this.searchOrder.nativeElement.value.length;this.isBackNavigation(e)?i=i<=0?0:i-1:this.isForwardsNavigation(e)?i=i>=n?n:i+1:e.code==="Home"?i=0:e.code==="End"&&(i=n),this.searchOrder.nativeElement.selectionStart=i,this.searchOrder.nativeElement.selectionEnd=i}}updateItemIndex(e){this.searchResultItems.toArray()?.[e]?.nativeElement.focus()}createCustomer(){this.asmService.customerSearchReset(),this.launchDialogService.openDialogAndSubscribe(B.ASM_CREATE_CUSTOMER_FORM,this.createCustomerLink),setTimeout(()=>{this.searchTerm.nativeElement.blur()})}isForwardsNavigation(e){return e.code==="ArrowRight"&&this.isLTRDirection()||e.code==="ArrowLeft"&&this.isRTLDirection()}isBackNavigation(e){return e.code==="ArrowLeft"&&this.isLTRDirection()||e.code==="ArrowRight"&&this.isRTLDirection()}isLTRDirection(){return this.directionService.getDirection()===It.LTR}isRTLDirection(){return this.directionService.getDirection()===It.RTL}static{this.\u0275fac=function(i){return new(i||t)(S(Et),S(lt),S(me),S(ji),S(X))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-customer-selection"]],viewQuery:function(i,n){if(i&1&&Se(Vr,5)($r,5)(jr,5)(zr,5)(Hr,5),i&2){let o;
1G(o=W())&&(n.resultList=o.first),G(o=W())&&(n.searchTerm=o.first),G(o=W())&&(n.searchOrder=o.first),G(o=W())&&(n.createCustomerLink=o.first),G(o=W())&&(n.searchResultItems=o)}},hostBindings:function(i,n){i&1&&h("click",function(_){return n.onDocumentClick(_)},ri)},outputs:{submitEvent:"submitEvent"},decls:26,vars:35,consts:[["searchTerm",""],["searchOrder",""],["resultList",""],["createCustomerLink",""],["searchResultItem",""],[3,"ngSubmit","formGroup"],[1,"searchLabel"],["required","true","type","text","formControlName","searchTerm",3,"keydown.arrowdown","keydown.end","placeholder"],[4,"ngIf"],["class","asm-results",4,"ngIf"],["required","true","type","text","formControlName","searchOrder",3,"keydown.arrowdown","keydown.end","placeholder"],["type","submit",3,"disabled"],["class","cx-message cx-message-info selection-message-info",4,"ngIf"],[1,"cx-message","cx-message-info","selection-message-info"],[1,"cx-message-content"],[1,"cx-message-header"],[1,"cx-message-icon"],["ng-reflect-type","INFO",1,"cx-icon","fas","fa-info-circle"],[1,"cx-message-text"],["class","linkStyleLabel",3,"click",4,"ngIf"],[1,"linkStyleLabel",3,"click"],[1,"asm-results"],[3,"tabindex","active","keydown.arrowup","keydown.arrowdown","keydown.arrowright","keydown.arrowleft","keydown.enter","keydown.escape","keydown.home","keydown.end","click",4,"ngFor","ngForOf"],[3,"keydown.arrowup","keydown.arrowdown","keydown.arrowright","keydown.arrowleft","keydown.enter","keydown.escape","keydown.home","keydown.end","click","tabindex"],[1,"result-name"],[1,"result-id"],["aria-hidden","false"]],template:function(i,n){i&1&&(m(0,"form",5),h("ngSubmit",function(){return n.onSubmit()}),m(1,"span",6),g(2),a(3,"cxTranslate"),u(),m(4,"label")(5,"input",7,0),a(7,"cxTranslate"),a(8,"cxTranslate"),h("keydown.arrowdown",function(_){return n.focusFirstItem(_)})("keydown.end",function(_){return n.setSelectionEnd(_)}),u(),d(9,Kr,4,2,"div",8),a(10,"async"),d(11,Yr,3,3,"div",9),u(),m(12,"span",6),g(13),a(14,"cxTranslate"),u(),m(15,"label")(16,"input",10,1),a(18,"cxTranslate"),a(19,"cxTranslate"),h("keydown.arrowdown",function(_){return n.focusFirstItem(_)})("keydown.end",function(_){return n.setOrderSearchSelectionEnd(_)}),u(),d(20,eo,4,2,"div",8),a(21,"async"),d(22,to,3,3,"div",9),u(),m(23,"button",11),g(24),a(25,"cxTranslate"),u()()),i&2&&(l("formGroup",n.customerSelectionForm),r(2),M(c(3,17,"asm.customerSearch.customer")),r(3),l("placeholder",k(c(7,19,"asm.customerSearch.searchCustomer.label"))),y("aria-label",c(8,21,"asm.customerSearch.searchCustomer.label")),r(4),l("ngIf",c(10,23,n.searchResults)),r(2),l("ngIf",n.isLoading&&n.searchByCustomer),r(2),M(c(14,25,"asm.customerSearch.orderID")),r(3),l("placeholder",k(c(18,27,"asm.customerSearch.searchOrder.label"))),y("aria-label",c(19,29,"asm.customerSearch.searchOrder.label")),r(4),l("ngIf",c(21,31,n.searchResults)),r(2),l("ngIf",n.isLoading&&n.searchByOrder),r(),N("active",n.selectedCustomer),l("disabled",!n.selectedCustomer),r(),C(" ",c(25,33,"asm.customerSearch.submit")," "))},dependencies:[ge,ke,Te,Ae,Me,tt,Ce,et,Xe,Y,Fe,qe,Yt,ae,$],encapsulation:2})}}return t})(),Ys={active:"asm.activeCartAlertInfo",inactive:"asm.saveInactiveCartAlertInfo"},Vn=(()=>{class t{constructor(e,i,n,o,_,I,ue,we){this.authService=e,this.csAgentAuthService=i,this.asmComponentService=n,this.globalMessageService=o,this.routingService=_,this.asmService=I,this.userAccountFacade=ue,this.launchDialogService=we,this.iconTypes=it,this.forbiddenResponseStatus=yt.FORBIDDEN,this.showDeeplinkCartInfoAlert$=this.asmComponentService.shouldShowDeeplinkCartInfoAlert(),this.deeplinkCartAlertKey="",this.showCreateCustomerSuccessfullyAlert=!1,this.globalMessageType=ne,this.disabled=!1,this.startingCustomerSession=!1,this.showCustomerEmulationInfoAlert=!0,this.subscription=new Q,this.isAsmCustomer360Configured=!1,this.isAsmCustomer360Loaded$=new K(!1),this.featureModules=V(Re),this.asmConfig=V(me),this.oAuthLibWrapperService=V(Di),this.isAsmSessionConfigured=!1}ngOnInit(){this.isAsmCustomer360Configured=this.featureModules.isConfigured("asmCustomer360"),this.isAsmCustomer360Configured&&this.featureModules.resolveFeature
1("asmCustomer360").subscribe(()=>{this.isAsmCustomer360Loaded$.next(!0)}),this.isAsmSessionConfigured=this.asmConfig.asm?.asmSessionSupport?.enabled??!1,this.customerSupportAgentLoggedIn$=this.csAgentAuthService.isCustomerSupportAgentLoggedIn().pipe(De(),H(e=>{e||this.closeModal()})),this.csAgentTokenLoading$=this.csAgentAuthService.getCustomerSupportAgentTokenLoading(),this.customer$=this.authService.isUserLoggedIn().pipe(de(e=>e?(this.handleCustomerSessionStartRedirection(),this.userAccountFacade.get()):re(void 0))),this.isCollapsed$=this.asmService.getAsmUiState().pipe(R(e=>e.collapsed===void 0?!1:e.collapsed)),this.asmService.getAsmUiState().subscribe(e=>{e.status===this.forbiddenResponseStatus&&(this.logout(),this.hideUi(),this.asmService.updateAsmUiState({status:void 0}))}),this.subscription.add(this.launchDialogService.dialogClose.pipe(L(e=>!!e)).subscribe(e=>{typeof e!="string"&&("selectedUser"in e?(this.startCustomerEmulationSession(e.selectedUser),e.actionType===he.ORDER_HISTORY&&this.routingService.go({cxRoute:"orders"})):"customerId"in e&&(this.startCustomerEmulationSession({customerId:e.customerId}),this.showCreateCustomerSuccessfullyAlert=!0,this.routingService.go("/")),"actionType"in e&&e.actionType===he.ACTIVE_CART?this.routingService.go({cxRoute:"cart"}):"actionType"in e&&e.actionType===he.CUSTOMER_360&&this.customer$.pipe(L(i=>!!i),F(1)).subscribe(i=>{this.showC360Dialog(i)})),e===Rt.FORBIDDEN&&(this.logout(),this.hideUi())})),this.subscription.add(pe([this.customerSupportAgentLoggedIn$,this.asmComponentService.isCustomerEmulationSessionInProgress()]).pipe(je(500),De(),L(([e])=>!!e)).subscribe(()=>{this.asmService.customerSearch({query:"autoSearchToAvoidUnauthorizedLogin",pageSize:1})})),this.subscribeForDeeplink()}showC360Dialog(e){this.isAsmCustomer360Loaded$.pipe(L(i=>!!i)).subscribe(()=>{let i={customer:e};this.launchDialogService.openDialogAndSubscribe(B.ASM_CUSTOMER_360,this.element,i)}),this.subscription.add(this.launchDialogService.dialogClose.pipe(L(i=>!!i)).subscribe(i=>{this.asmComponentService.handleAsmDialogAction(i)}))}subscribeForDeeplink(){this.asmComponentService.isEmulateInURL()&&this.routingService.go("/");let e=this.asmComponentService.getDeepLinkUrlParams()??{customerId:this.asmComponentService.getSearchParameter("customerId"),orderId:this.asmComponentService.getSearchParameter("orderId"),ticketId:this.asmComponentService.getSearchParameter("ticketId"),cartId:this.asmComponentService.getSearchParameter("cartId"),cartType:this.asmComponentService.getSearchParameter("cartType"),emulated:!1};this.deeplinkCartAlertKey=Ys[e.cartType||""],this.subscription.add(pe([this.customerSupportAgentLoggedIn$,this.authService.isUserLoggedIn(),this.asmComponentService.isEmulatedByDeepLink()]).subscribe(([i,n,o])=>{i&&e.customerId&&(!o&&n?this.confirmSwitchCustomer(e.customerId):setTimeout(()=>this.startSessionWithParameters($e(z({},e),{emulated:o}))))}))}confirmSwitchCustomer(e){this.customer$.pipe(L(i=>!!i),F(1)).subscribe(i=>{i?.customerId!==e?this.userAccountFacade.getById(e).subscribe({next:n=>{this.launchDialogService.openDialogAndSubscribe(B.ASM_SWITCH_CUSTOMER,this.element,{curCustomer:i,switchCustomer:n})},error:n=>{this.globalMessageService.add(n.details?.[0].message??"",ne.MSG_TYPE_ERROR)}}):this.asmComponentService.setEmulatedByDeepLink(!0)})}startSessionWithParameters(e){e.emulated||(this.asmComponentService.setEmulatedByDeepLink(!0),this.startCustomerEmulationSession({customerId:e.customerId},e))}handleCustomerSessionStartRedirection(){this.asmComponentService.isCustomerEmulationSessionInProgress().pipe(F(1)).subscribe(e=>{this.startingCustomerSession&&e&&(this.startingCustomerSession=!1,this.globalMessageService.remove(ne.MSG_TYPE_ERROR),this.routingService.go("/"))})}loginCustomerSupportAgent({userId:e,password:i}){this.csAgentAuthService.authorizeCustomerSupportAgent(e,i)}loginCustomerSupportAgentWithAuthorizationCodeFlow(){this.csAgentAuthService.authorizeCustomerSupportAgentWhenUseCodeFlow()}logout(){this.asmComponentService.logoutCustomerSupportAgentAndCustomer()}startCustomerEmulationSession({customerId:e},i){e?(this.csAgentAuthService.startCustomerEmulationSession(e),this.startingCustomerSession=!0,this.showCustomerEmulationInfoAlert=!0,this.showCreateCustomerSuccessfullyAlert=!1,this.isAsmSessionConfigured&&this.asmService.createAsmSessionEvent({eventType:"StartSession"}),i&&this.asmComponentService.handleDeepLinkNavigation(z({customerId:e},i))):this.globalMessageService.add({key:"asm.error.noCustomerId"},ne.MSG_TYPE_ERROR)}hideUi(){this.disabled=!0,this.asmComponentService.unload(),this.oAuthLibWrapperService.refreshAuthConfig(),this.authService.updateIsUsingASMClient(!1)}showCustomList(){this.launchDialogService.openDialogAndSubscribe(B.ASM_CUSTOMER_LIST,this.element)}closeModal(){this.launchDialogService.closeDialog("logout")}createCustomer(){this.launchDialogService?.openDialogAndSubscribe(B.ASM_CREATE_CUSTOMER_FORM,this.addNewCustomerLink)}closeDialogConfirmationAlert(){this.showCreateCustomerSuccessfullyAlert=!1}closeDeeplinkCartInfoAlert(){this.asmComponentService.setShowDeeplinkCartInfoAlert(!1)}closeCustomerEmulationInfoAlert(){this.showCustomerEmulationInfoAlert=!1}ngOnDestroy(){this.subscription?.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(S(xt),S(Dt),S(Ve),S(bt),S(ye),S(lt),S(Oe),S(X))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-main-ui"]],viewQuery:function(i,n){if(i&1&&Se(io,5)(Rn,5),i&2){let o;
1G(o=W())&&(n.element=o.first),G(o=W())&&(n.addNewCustomerLink=o.first)}},hostVars:2,hostBindings:function(i,n){i&2&&N("hidden",n.disabled)},decls:28,vars:34,consts:[["customerListLink",""],["showLoginForm",""],["showCustomerSelection",""],[1,"asm-bar"],[1,"asm-bar-branding"],["src","data:image/png;base64,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","width","48","height","24",1,"logo",3,"alt","title"],[1,"asm-title"],[1,"asm-bar-actions"],[1,"cx-asm-help-portal"],["href","https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/d1ca9a1517f847a5b57b4e08400807c1/2367ff04ccb649ac82a3795ecf72a804.html?locale=en-US","target","_blank","rel","noopener noreferrer","role","button"],[3,"type"],["class","cx-asm-customer-list",4,"ngIf"],[4,"cxFeature"],[4,"ngIf"],["class","close",3,"title","click",4,"ngIf"],["class","logout",3,"title","click",4,"ngIf"],[1,"cx-asm-customer-list"],["tabindex","0","role","button",1,"cx-asm-customer-list-link",3,"click"],["role","link",1,"cx-asm-customer-list-link",3,"click"],[1,"close",3,"click","title"],[1,"logout",3,"click","title"],[4,"ngIf","ngIfElse"],[3,"text","type","closeMessage",4,"ngIf"],[3,"closeMessage","text","type"],[3,"submitEvent",4,"ngIf"],[3,"submitEvent"],[3,"csAgentTokenLoading","submitEvent",4,"ngIf"],[3,"submitEvent","csAgentTokenLoading"]],template:function(i,n){i&1&&(m(0,"div",3)(1,"div",4),x(2,"img",5),a(3,"cxTranslate"),a(4,"cxTranslate"),m(5,"div",6),g(6),a(7,"cxTranslate"),u()(),m(8,"div",7)(9,"div",8)(10,"a",9),x(11,"cx-icon",10),m(12,"span"),g(13),a(14,"cxTranslate"),u()()(),d(15,no,7,4,"div",11),a(16,"async"),d(17,oo,3,3,"ng-container",12)(18,so,1,0,"cx-asm-session-timer",13),a(19,"async"),d(20,co,3,3,"ng-container",12)(21,lo,2,4,"button",14),a(22,"async"),a(23,"async"),d(24,mo,2,4,"button",15),a(25,"async"),u()(),d(26,yo,5,4,"ng-container",13),a(27,"async")),i&2&&(r(2),l("alt",k(c(3,14,"asm.mainLogoLabel")))("title",k(c(4,16,"asm.mainLogoLabel"))),r(4),C(" ",c(7,18,"asm.mainTitle")," "),r(5),l("type",n.iconTypes.HELP),r(2),M(c(14,20,"asm.helpPortalUrl")),r(2),l("ngIf",c(16,22,n.customerSupportAgentLoggedIn$)),r(2),l("cxFeature","!authorizationCodeFlowByDefault"),r(),l("ngIf",c(19,24,n.customerSupportAgentLoggedIn$)),r(2),l("cxFeature","authorizationCodeFlowByDefault"),r(),l("ngIf",!c(22,26,n.customerSupportAgentLoggedIn$)&&!c(23,28,n.csAgentTokenLoading$)),r(3),l("ngIf",c(25,30,n.customerSupportAgentLoggedIn$)),r(2),l("ngIf",!c(27,32,n.isCollapsed$)))},dependencies:[Fe,Y,Li,Ks,Qs,Un,nt,Pn,Nn,ae,$],encapsulation:2})}}return t})(),Qt=(function(t){return t.CANCEL="CANCEL",t.SWITCH="SWITCH",t})(Qt||{}),$n=(()=>{class t{constructor(e,i){this.launchDialogService=e,this.asmComponentService=i,this.SWITCH_CUSTOMER_DIALOG_ACTION=Qt,this.focusConfig={trap:!0,block:!0,autofocus:!0,focusOnEscape:!0}}ngOnInit(){this.launchDialogService.data$.pipe(F(1)).subscribe(e=>{this.curCustomerName=e.curCustomer.name||"",this.switchCustomerName=e.switchCustomer.name||""})}closeModal(e){e===Qt.SWITCH&&this.asmComponentService.logoutCustomer(),this.launchDialogService.closeDialog(e)}static{this.\u0275fac=function(i){return new(i||t)(S(X),S(Ve))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-asm-switch-customer-dialog"]],decls:23,vars:23,consts:[["role","dialog","aria-labelledby","asm-switch-customer-dialog-title",1,"cx-asm-switch-customer-dialog","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal
1-header"],["type","WARNING"],["id","asm-switch-customer-dialog-title",1,"title","modal-title"],[1,"cx-dialog-body","modal-body"],[1,"cx-dialog-row","switch-customer-content"],[1,"cx-dialog-item"],[1,"cx-dialog-footer","modal-footer"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-secondary",3,"click"]],template:function(i,n){i&1&&(m(0,"div",0),h("esc",function(){return n.closeModal(n.SWITCH_CUSTOMER_DIALOG_ACTION.CANCEL)}),m(1,"div",1)(2,"div",2)(3,"div")(4,"span"),x(5,"cx-icon",3),u(),m(6,"span",4),g(7),a(8,"cxTranslate"),u()()(),m(9,"div",5)(10,"div",6)(11,"div",7),g(12),a(13,"cxTranslate"),u()()(),m(14,"div",8)(15,"button",9),a(16,"cxTranslate"),h("click",function(){return n.closeModal(n.SWITCH_CUSTOMER_DIALOG_ACTION.SWITCH)}),g(17),a(18,"cxTranslate"),u(),m(19,"button",10),a(20,"cxTranslate"),h("click",function(){return n.closeModal(n.SWITCH_CUSTOMER_DIALOG_ACTION.CANCEL)}),g(21),a(22,"cxTranslate"),u()()()()),i&2&&(l("cxFocus",n.focusConfig),r(7),C(" ",c(8,7,"asm.switchCustomer.dialog.title")," "),r(5),C(" ",We(13,9,"asm.switchCustomer.dialog.body",se(20,To,n.curCustomerName,n.switchCustomerName))," "),r(3),y("aria-label",c(16,12,"asm.switchCustomer.dialog.actions.switch")),r(2),C(" ",c(18,14,"asm.switchCustomer.dialog.actions.switch")," "),r(2),y("aria-label",c(20,16,"common.cancel")),r(2),C(" ",c(22,18,"common.cancel")," "))},dependencies:[Ee,Fe,$],encapsulation:2})}}return t})(),jn=(()=>{class t{constructor(e,i,n,o,_,I){this.launchDialogService=e,this.breakpointService=i,this.asmConfig=n,this.translation=o,this.asmCustomerListFacade=_,this.occConfig=I,this.DEFAULT_PAGE_SIZE=5,this.focusConfig={trap:!0,block:!0,autofocus:"customer-list-selector",focusOnEscape:!0},this.iconTypes=it,this.BREAKPOINT=Be,this.currentPage=0,this.maxPage=0,this.loaded=!1,this.listsError=!1,this.listsEmpty=!1,this.enableAsmB2bCustomerList=!1,this.customerListColumnActionType=he,this.searchBox=new Fi,this.forbiddenResponseStatus=yt.FORBIDDEN,this.teardown=new Q,this.isAsmCustomer360Configured=!1,this.featureModules=V(Re),this.breakpoint$=this.getBreakpoint()}ngOnInit(){this.isAsmCustomer360Configured=this.featureModules.isConfigured("asmCustomer360"),this.pageSize=this.asmConfig.asm?.customerList?.pageSize??this.DEFAULT_PAGE_SIZE,this.customerListConfig=this.asmConfig?.asm?.customerList,this.customerListsPage$=this.asmCustomerListFacade.getCustomerListsState().pipe(H(e=>this.listsError=!!e.error),R(e=>{if(e.error&&typeof e.error=="object"&&"status"in e.error&&e.error.status===this.forbiddenResponseStatus&&this.launchDialogService.closeDialog(Rt.FORBIDDEN),e?.data?.userGroups?.length===0){this.listsEmpty=!0;return}else return e.data}),De(),H(e=>{this.selectedUserGroupId||(this.selectedUserGroupId=e?.userGroups?.[0]?.uid,this.sorts=null,this.fetchCustomers())}))??Xt,this.customerSearchLoading$=this.asmCustomerListFacade.getCustomerListCustomersSearchResultsLoading().pipe(H(e=>this.loaded=!e)),this.teardown.add(this.customerSearchLoading$.subscribe()),this.teardown.add(()=>this.asmCustomerListFacade.customerListCustomersSearchReset()),this.customerSearchError$=this.asmCustomerListFacade.getCustomerListCustomersSearchResultsError(),this.customerSearchPage$=this.asmCustomerListFacade.getCustomerListCustomersSearchResults().pipe(H(e=>{e?.sorts&&(this.sorts=e.sorts,this.sortCode=e.pagination?.sort),e?.entries.length<this.pageSize?this.maxPage=e.pagination?.currentPage??0:this.maxPage=this.currentPage+1}))}ngOnDestroy(){this.teardown.unsubscribe()}changePage(e){let i={customerListId:this.selectedUserGroupId,pageSize:this.pageSize,page:e,sort:this.sortCode};this.searchBox?.value&&(i.query=this.searchBox.value),this.asmCustomerListFacade.customerListCustomersSearch(i)}fetchCustomers(){if(this.enableAsmB2bCustomerList=this.selectedUserGroupId==="b2bCustomerList",this.selectedUserGroupId){let e={customerListId:this.selectedUserGroupId,pageSize:this.pageSize,page:this.currentPage};this.sortCode&&(e.sort=this.sortCode),this.searchBox?.value&&(e.query=this.searchBox.value),this.asmCustomerListFacade.customerListCustomersSearchReset(),this.asmCustomerListFacade.customerListCustomersSearch(e)}this.updateCustomerListColumns()}updateCustomerListColumns(){let e=this.customerListConfig?.columns||[];for(let i of e)(i.headerLocalizationKey==="asm.customerList.tableHeader.account"||i.headerLocalizationKey==="hideHeaders")&&(i.headerLocalizationKey=this.enableAsmB2bCustomerList?"asm.customerList.tableHeader.account":"hideHeaders"),!this.isAsmCustomer360Configured&&i.headerLocalizationKey==="asm.customerList.tableHeader.customer360"&&(i.headerLocalizationKey="hideHeaders")}onChangeCustomerGroup(){this.currentPage=0,this.sorts=null,this.sortCode="",this.fetchCustomers()}getGroupName(e,i){return e?.userGroups?.find(n=>n.uid===i)?.name??""}getBadgeText(e){return(e.firstName?.charAt(0)??"")+(e.lastName?.charAt(0)??"")}startColumnAction(e,i){this.selectedCustomer=e;let n={actionType:i,selectedUser:e};this.closeModal(n)}onKey(e){e.key==="Enter"&&this.searchCustomers()}searchCustomers(){this.currentPage=0,this.fetchCustomers()}isRequired(e,i){return i===he.ACTIVE_CART&&!e.lastCartId||i===he.ORDER_HISTORY&&e.hasOrder!==!0}changeSortCode(e){this.sortCode=e,this.fetchCustomers()}goToNextPage(){this.currentPage>=this.maxPage?this.currentPage=this.maxPage:this.loaded&&(this.currentPage++,this.fetchCustomers())}goToPreviousPage(){this.currentPage<=0?this.currentPage=0:this.loaded&&(this.currentPage--,this.fetchCustomers())}closeModal(e){this.launchDialogService.closeDialog(e)}getSortLabels(){return pe([this.translation.translate("asm.customerList.tableSort.byName"),this.translation.translate("asm.customerList.tableSort.byNameAsc"),this.translation.translate("asm.customerList.tableSort.byNameDesc"),this.translation.translate("asm.customerList.tableSort.byDateAsc"),this.translation.translate("asm.customerList.tableSort.byDateDesc"),this.translation.translate("asm.customerList.tableSort.byOrderDateAsc"),this.translation.translate("asm.customerList.tableSort.byOrderDateDesc"),this.translation.translate("asm.customerList.tableSort.byUnit"),this.translation.translate("asm.customerList.tableSort.byUnitDesc")]).pipe(R(([e,i,n,o,_,I,ue,we,fe])=>({byName:e,byNameAsc:i,byNameDesc:n,byOrderDateAsc:I,byOrderDateDesc:ue,byDateAsc:o,byDateDesc:_,byUnit:we,byUnitDesc:fe})))}createCustomer(){this.launchDialogService.closeDialog("Create customer click"),this.launchDialogService?.openDialogAndSubscribe(B.ASM_CREATE_CUSTOMER_FORM,this.addNewCustomerLink)}
1getBreakpoint(){return this.breakpointService.breakpoint$.pipe(R(e=>((e===Be.lg||e===Be.xl)&&(e=Be.md),e)))}static{this.\u0275fac=function(i){return new(i||t)(S(X),S(Vi),S(me),S(Tt),S(st),S(Si))}}static{this.\u0275cmp=O({type:t,selectors:[["cx-customer-list"]],viewQuery:function(i,n){if(i&1&&Se(Rn,5),i&2){let o;G(o=W())&&(n.addNewCustomerLink=o.first)}},decls:48,vars:28,consts:[["cell",""],["cellContent",""],["search",""],["total",""],["sort",""],["pagination",""],["groupSelector",""],["closeButton",""],["createCustomerButton",""],["role","dialog","aria-labelledby","asm-customer-list-title",1,"cx-asm-customer-list","cx-modal-container","cx-asm-dialog",3,"esc","cxFocus"],[1,"cx-modal-content"],[1,"cx-dialog-header","modal-header"],["id","asm-customer-list-title",1,"title","modal-title"],["id","asm-customer-list-desc",1,"cx-visually-hidden"],[4,"ngTemplateOutlet"],["class","cx-dialog-sub-header modal-header",3,"tablet-mobile",4,"ngIf"],[1,"cx-dialog-body","modal-body"],[1,"cx-dialog-row"],[1,"cx-dialog-item"],["class","cx-error-state",4,"ngIf"],[4,"ngIf"],["class","cx-dialog-sub-header modal-header cx-dialog-foot",3,"asm-mobile-pagination",4,"ngIf"],[1,"cx-dialog-footer","modal-footer"],["type","button",1,"btn","cx-asm-customer-list-btn-cancel",3,"click"],[1,"cx-dialog-sub-header","modal-header"],[1,"cx-header-select"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"cx-header-actions"],[1,"cx-error-state"],["id","asm-cusomer-list-table","role","table","class","table",4,"ngIf"],["class","cx-empty-state",4,"ngIf"],["id","asm-cusomer-list-table","role","table",1,"table"],[1,"cx-visually-hidden"],["role","row",4,"ngFor","ngForOf"],["role","row"],["role","columnheader",4,"ngFor","ngForOf"],["role","columnheader"],["role","cell","class","cx-multi-cell",4,"ngIf"],["role","cell",4,"ngFor","ngForOf"],["role","cell"],["role","cell",1,"cx-multi-cell"],[4,"ngFor","ngForOf"],[1,"cx-empty-state"],[1,"cx-dialog-sub-header","modal-header","cx-dialog-foot"],[3,"viewPageEvent","pagination"],["class","cx-cell-container",4,"ngIf"],[1,"cx-cell-container"],["class","cx-header-text",4,"ngIf"],["class","cx-avatar",4,"ngIf"],["class","btn btn-link cx-action-link cx-btn-cell",3,"class","disabled","click",4,"ngIf"],[1,"cx-header-text"],[1,"cx-avatar"],[3,"alt","title",4,"ngIf"],["class","cx-avatar-text",4,"ngIf"],[3,"alt","title"],[1,"cx-avatar-text"],[1,"btn","btn-link","cx-action-link","cx-btn-cell",3,"click","disabled"],[3,"cx-action-color","type",4,"ngIf"],[3,"type"],[1,"form-group","search-wrapper"],["type","text",1,"form-control",3,"keyup","formControl","placeholder"],["role","button",1,"search",3,"click","type","title"],["class","cx-total",4,"ngIf"],[1,"cx-total"],[1,"label-content"],["ariaControls","asm-cusomer-list-table",1,"sort-selector",3,"sortListEvent","sortOptions","sortLabels","selectedOption","placeholder","ariaLabel"],[1,"cx-pagination-buttons"],["class","btn btn-link cx-action-link cx-btn-previous",3,"disabled","click",4,"ngIf"],["class","btn btn-link cx-action-link cx-btn-next",3,"disabled","click",4,"ngIf"],[1,"btn","btn-link","cx-action-link","cx-btn-previous",3,"click","disabled"],[1,"previous",3,"type"],[1,"btn","btn-link","cx-action-link","cx-btn-next",3,"click","disabled"],[1,"next",3,"type"],["bindLabel","name","bindValue","uid",1,"customer-list-selector",3,"change","ngModelChange","searchable","clearable","tabIndex","ngModel","items","ariaLabelDropdown","cxNgSelectA11y"],["type","button",1,"close",3,"click","title"],["aria-hidden","true"],["type","button","class","btn cx-asm-create-customer-btn",3,"click",4,"ngIf"],["type","button",1,"btn","cx-asm-create-customer-btn",3,"click"]],template:function(i,n){if(i&1&&(m(0,"div",9),h("esc",function(){return n.closeModal("Escape clicked")}),m(1,"div",10),A(2),m(3,"div",11)(4,"h2",12),g(5),a(6,"cxTranslate"),u(),m(7,"div",13),g(8),a(9,"cxTranslate"),u(),d(10,Do,1,0,null,14),u(),d(11,Po,11,24,"div",15),a(12,"async"),m(13,"div",16)(14,"div",17)(15,"div",18),d(16,Vo,3,3,"div",19)(17,$o,3,3,"div",19)(18,jo,3,3,"div",19),a(19,"async"),d(20,zo,1,0,"cx-spinner",20),a(21,"async"),d(22,Cs,3,2,"div",20),a(23,"async"),u()()(),d(24,fs,6,11,"div",21),a(25,"async"),m(26,"div",22)(27,"button",23),h("click",function(){return n.closeModal("Cancel click")}),g(28),a(29,"cxTranslate"),u()(),E(),u()(),d(30,Ls,1,1,"ng-template",null,0,U)(32,Rs,3,2,"ng-template",null,1,U)(34,Ms,6,12,"ng-template",null,2,U)(36,Os,1,1,"ng-template",null,3,U)(38,Ns,7,13,"ng-template",null,4,U)(40,Vs,6,8,"ng-template",null,5,U)(42,$s,7,17,"ng-template",null,6,U)(44,js,5,8,"ng-template",null,7,U)(46,Hs,1,1,"ng-template",null,8,U)),i&2){let o=w(47);l("cxFocus",n.focusConfig),r(5),C(" ",c(6,12,"asm.customerList.title")," "),r(3),C(" ",c(9,14,"asm.customerList.description")," "),r(2),l("ngTemplateOutlet",o),r(),l("ngIf",c(12,16,n.customerListsPage$)),r(5),l("ngIf",n.listsEmpty),r(),l("ngIf",n.listsError),r(),l("ngIf",c(19,18,n.customerSearchError$)),r(2),l("ngIf",c(21,20,n.customerSearchLoading$)),r(2),l("ngIf",c(23,22,n.customerSearchPage$)),r(2),l("ngIf",c(25,24,n.customerListsPage$)),r(4),C(" ",c(29,26,"asm.createCustomerForm.cancel")," ")}},dependencies:[Ee,di,Y,Lt,qe,en,Fe,ge,Te,Ae,Bi,Ce,At,Zi,Ni,Yi,ae,$],encapsulation:2})}}return t})(),Zs={launch:{ASM_CUSTOMER_LIST:{inlineRoot:!0,component:jn,dialogType:Ie.DIALOG}}},Js={launch:{ASM:{outlet:"cx-storefront",component:Vn}}},Xs={pagination:{rangeCount:2,addPrevious:!0,addNext:!0,addStart:!1,addEnd:!1,addFirst:!0,addLast:!0,addDots:!0,substituteDotsForSingularPage:!0,dotsLabel:"\xB7\xB7\xB7"}},ea={launch:{[B.ASM_BIND_CART]:{inlineRoot:!0,component:Gs,dialogType:Ie.DIALOG}}},ta={launch:{[B.ASM_SAVE_CART]:{inlineRoot:!0,component:Fn,dialogType:Ie.DIALOG}}},ia={launch:{[B.ASM_SWITCH_CUSTOMER]:{inlineRoot:!0,component:$n,dialogType:Ie.DIALOG}}},zn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=te({type:t})}static{this.\u0275inj=ee({providers:[Z(Js),Z(ea),Z(ta),Z(ia),Z(Zs),Z(Xs),Z(Ws)],imports:[_e,Ce,Ri,Gi,Pi,Ui,ge,Hi,qi,$i,Ji,Xi,tn,zi,wi,Fn,Vn,Nn,jn,Pn,Un,Bn,$n,On]})}}return t})();var na=(()=>{class t{constructor(e,i,n,o,_){this.http=e,this.occEndpointsService=i,this.converterService=n,this.config=o,this.baseSiteService=_,this.logger=V(be),this.userIdService=V(Je),this.baseSiteService.getActive().subscribe(I=>this.activeBaseSite=I),this.userIdService.getUserId().subscribe(I=>this.currentUserId=I)}createAsmSessionEvent(e){let i=this.getHeaders(),n=new xe,o=z({},e),_=this.occEndpointsService.buildUrl("asmSessionEvent",{urlParam
1s:{baseSiteId:this.activeBaseSite,userId:this.currentUserId}},{baseSite:!1,prefix:!1});return this.http.post(_,o,{headers:i,params:n}).pipe(q(I=>{throw J(I,this.logger)}))}getHeaders(){return vt.createHeader(ft,!0,new ht)}customerLists(){let e=this.getHeaders(),i=new xe().set("baseSite",this.activeBaseSite),n=this.occEndpointsService.buildUrl("asmCustomerLists",{},{baseSite:!1,prefix:!1});return this.http.get(n,{headers:e,params:i}).pipe(q(o=>{throw J(o,this.logger)}),this.converterService.pipeable(fn))}customerSearch(e){let i=this.getHeaders(),n=new xe().set("baseSite",this.activeBaseSite),o={};e.sort!==void 0?n=n.set("sort",e.sort):e.customerListId||(n=n.set("sort","byNameAsc")),e.query!==void 0&&(o.query=e.query),e.orderId!==void 0&&(o.orderId=e.orderId),e.pageSize!==void 0&&(n=n.set("pageSize",e.pageSize.toString())),e.page!==void 0&&(n=n.set("page",e.page.toString())),e.customerListId!==void 0&&(o.customerListId=e.customerListId);let _=this.occEndpointsService.buildUrl("asmCustomerSearch",{},{baseSite:!1,prefix:!1});return this.http.post(_,o,{headers:i,params:n}).pipe(q(I=>{throw J(I,this.logger)}),this.converterService.pipeable(hn))}bindCart({cartId:e,customerId:i}){let n=vt.createHeader(ft,!0,new ht().set("Content-Type","application/x-www-form-urlencoded")),o=new xe().set("baseSite",this.activeBaseSite),_=new URLSearchParams;_.set("cartId",e),_.set("customerId",i);let I=this.occEndpointsService.buildUrl("asmBindCart",{},{baseSite:!1,prefix:!1});return this.http.post(I,_,{headers:n,params:o}).pipe(q(ue=>{throw J(ue,this.logger)}))}createCustomer(e){let i=this.getHeaders(),n=new xe().set("baseSite",this.activeBaseSite),o=this.occEndpointsService.buildUrl("asmCreateCustomer",{},{baseSite:!1,prefix:!1});return this.http.post(o,e,{headers:i,params:n}).pipe(q(_=>{throw J(_,this.logger)}))}static{this.\u0275fac=function(i){return new(i||t)(T(_i),T(bi),T(Ai),T(me),T(xi))}}static{this.\u0275prov=P({token:t,factory:t.\u0275fac})}}return t})(),ra={backend:{occ:{endpoints:{asmCustomerSearch:"/assistedservicewebservices/customers/search",asmCustomerLists:"/assistedservicewebservices/customerlists",asmBindCart:"/assistedservicewebservices/bind-cart",asmCreateCustomer:"/assistedservicewebservices/customers",asmSessionEvent:"assistedservicewebservices/${baseSiteId}/users/${userId}/asmSessionEvents"}}}},Hn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=te({type:t})}static{this.\u0275inj=ee({providers:[Z(ra),{provide:Ne,useClass:na}],imports:[_e]})}}return t})();var gc=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=te({type:t})}static{this.\u0275inj=ee({imports:[zn,In,Hn]})}}return t})();export{gc as AsmModule};

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.