PageSourceSearch

https://www.tax-free.no/chunk-CNBMOLNM.js

js tax-free.no collected 2026-10-06 15:04:04 UTC 41,819 bytes, 1 lines download raw bytes

1import{c as Xr}from"./chunk-JC5PZU5R.js";import{B as ot,E as zr,F as De,G as q,H as Kr,I as Qr,J as Me,K as Zr,L as Jr,P as f,S as z,c as Ur,d as wr,e as Or,f as Vr,g as Lr,h as $r,i as jr,j as xr,k as Nr,l as Pr,m as Gr,p as me,q as Te,r as _e,s as kr,t as Yr,u as Br,v as Hr,w as Wr,x as qr}from"./chunk-SU7S3GV3.js";import{zb as br}from"./chunk-LJH5OBMW.js";import{$ as or,$d as tt,$e as it,$f as Tr,Ag as _t,Bg as x,C as ir,Df as Ar,F as l,Gg as Re,H as sr,Hg as at,L as M,N as J,Ne as d,Ng as ct,Oe as ge,Of as j,Og as Dt,P as nr,Pa as ve,Qe as vr,Re as w,S as y,Se as Er,Sf as b,Td as Ee,Te as L,Tf as Rr,Ue as Tt,Uf as W,V as D,Vd as hr,W as ar,Yf as mr,Ze as rt,_ as cr,_c as dr,a as mt,ae as m,ag as _r,be as F,ca as pe,ce as Cr,de as lr,df as gr,e as tr,fg as Dr,ga as v,ge as S,he as et,ie as g,je as pr,jf as st,ka as P,kf as Ir,ma as E,mf as fr,mg as Ae,n as V,o as T,of as Ie,pb as B,qa as p,qf as Sr,qg as Mr,r as er,ra as Y,rf as nt,sa as X,sd as ur,sf as H,sg as Fr,ta as o,u as c,ua as A,uf as fe,v as Z,vf as Se,w as _,wf as ye,x as rr,xf as yr}from"./chunk-PMSJWPYZ.js";import{a as C,b as I}from"./chunk-NIF3MU5U.js";var di="cart",h="[Multi Cart] Multi Cart Data",k="addVoucher",ie="[Cart-entry] Add Entry",St="[Cart-entry] Add Entry Success",se="[Cart-entry] Add Entry Fail",xe="[Cart-entry] Remove Entry",ne="[Cart-entry] Remove Entry Success",Ne="[Cart-entry] Remove Entry Fail",Pe="[Cart-entry] Update Entry",ae="[Cart-entry] Update Entry Success",Ge="[Cart-entry] Update Entry Fail",ut=class extends d.EntityProcessesIncrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=ie}},ht=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=St}},Ct=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=se,this.error=n.error}},Mt=class extends d.EntityProcessesIncrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=xe}},Ft=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=ne}},bt=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Ne,this.error=n.error}},Ut=class extends d.EntityProcessesIncrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Pe}},wt=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=ae}},Ot=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Ge,this.error=n.error}},yt="[Cart-voucher] Add Cart Vouchers",ke="[Cart-voucher] Add Cart Voucher Fail",ce="[Cart-voucher] Add Cart Voucher Success",ui="[Cart-voucher] Reset Add Cart Voucher",oe="[Cart-voucher] Remove Cart Voucher",Ye="[Cart-voucher] Remove Cart Voucher Fail",de="[Cart-voucher] Remove Cart Voucher Success",Vt=class extends d.EntityLoadAction{constructor(n){super(ct,k),this.payload=n,this.type=yt}},Lt=class extends d.EntityFailAction{constructor(n){super(ct,k,n.error),this.payload=n,this.type=ke}},$t=class extends d.EntitySuccessAction{constructor(n){super(ct,k),this.payload=n,this.type=ce}},jt=class extends d.EntityLoaderResetAction{constructor(){super(ct,k),this.type=ui}},xt=class extends d.EntityProcessesIncrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=oe}},Nt=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Ye,this.error=n.error}},Pt=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=de}},K="[Cart] Create Cart",Be="[Cart] Create Cart Fail",Q="[Cart] Create Cart Success",lt="[Cart] Load Cart",hi="[Cart] Load Cart Fail",G="[Cart] Load Cart Success",He="[Cart] Load Carts Success",We="[Cart] Add Email to Cart",Ci="[Cart] Add Email to Cart Fail",li="[Cart] Add Email to Cart Success",ue="[Cart] Merge Cart",qe="[Cart] Merge Cart Success",pi="[Cart] Merge Cart Abort",vi="[Cart] Reset Cart Details",Ei="[Cart] Reset Cart Details By Ids",ze="[Cart] Remove Cart",he="[Cart] Delete Cart",Ce="[Cart] Delete Cart Success",Ke="[Cart] Delete Cart Fail",pt=class extends d.EntityLoadAction{constructor(n){super(h,n.tempCartId),this.payload=n,this.type=K}},Gt=class extends d.EntityFailAction{constructor(n){super(h,n.tempCartId,n.error),this.payload=n,this.type=Be}},vt=class extends d.EntitySuccessAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Q}},kt=class extends d.EntityProcessesIncrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=We}},Yt=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Ci,this.error=n.error}},Bt=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=li}},R=class extends d.EntityLoadAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=lt}},Et=class extends d.EntityFailAction{constructor(n){super(h,n.cartId,n.error),this.payload=n,this.type=hi}},Ht=class extends d.EntitySuccessAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=G}},Fe=class extends d.EntitySuccessAction{constructor(n){super(h,n.map(t=>t?.code??"")),this.payload=n,this.type=He}},Wt=class{constructor(n){this.payload=n,this.type=ue}},qt=class extends d.EntityProcessesIncrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=ue}},zt=class extends d.EntityRemoveAction{constructor(n){super(h,n.oldCartId),this.payload=n,this.type=qe}},gt=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=pi,this.error=n.error}},Kt=class extends d.ProcessesLoaderResetAction{constructor(){super(h),this.type=vi}},Qt=class extends d.EntityProcessesLoaderResetAction{constructor(n){super(h,n.cartIds),this.payload=n,this.type=Ei}},N=class extends d.EntityRemoveAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=ze}},Zt=class{constructor(n){this.payload=n,this.type=he}},Jt=class extends d.EntityRemoveAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Ce}},Xt=class{constructor(n){this.payload=n,this.type=Ke,this.error=n.error}},gi="[Cart] Cart Processes Increment",Ii="[Cart] Cart Processes Decrement",te="[Cart] Set Active Cart Id",Qe="[Cart] Clear 
1Cart State",Ze="[Cart] Set cart type index",Je="[Cart] Set cart data",ee=class extends d.EntityProcessesIncrementAction{constructor(n){super(h,n),this.payload=n,this.type=gi}},It=class extends d.EntityProcessesDecrementAction{constructor(n){super(h,n),this.payload=n,this.type=Ii}},ft=class{constructor(n){this.payload=n,this.type=te}},re=class extends d.EntityRemoveAllAction{constructor(){super(h),this.type=Qe}},O=class{constructor(n){this.payload=n,this.type=Ze}},be=class extends d.EntitySuccessAction{constructor(n){super(h,n.cartId),this.payload=n,this.type=Je}},Vs=Object.freeze({__proto__:null,ADD_EMAIL_TO_CART:We,ADD_EMAIL_TO_CART_FAIL:Ci,ADD_EMAIL_TO_CART_SUCCESS:li,AddEmailToCart:kt,AddEmailToCartFail:Yt,AddEmailToCartSuccess:Bt,CART_ADD_ENTRY:ie,CART_ADD_ENTRY_FAIL:se,CART_ADD_ENTRY_SUCCESS:St,CART_ADD_VOUCHER:yt,CART_ADD_VOUCHER_FAIL:ke,CART_ADD_VOUCHER_SUCCESS:ce,CART_PROCESSES_DECREMENT:Ii,CART_PROCESSES_INCREMENT:gi,CART_REMOVE_ENTRY:xe,CART_REMOVE_ENTRY_FAIL:Ne,CART_REMOVE_ENTRY_SUCCESS:ne,CART_REMOVE_VOUCHER:oe,CART_REMOVE_VOUCHER_FAIL:Ye,CART_REMOVE_VOUCHER_SUCCESS:de,CART_RESET_ADD_VOUCHER:ui,CART_UPDATE_ENTRY:Pe,CART_UPDATE_ENTRY_FAIL:Ge,CART_UPDATE_ENTRY_SUCCESS:ae,CLEAR_CART_STATE:Qe,CREATE_CART:K,CREATE_CART_FAIL:Be,CREATE_CART_SUCCESS:Q,CartAddEntry:ut,CartAddEntryFail:Ct,CartAddEntrySuccess:ht,CartAddVoucher:Vt,CartAddVoucherFail:Lt,CartAddVoucherSuccess:$t,CartProcessesDecrement:It,CartProcessesIncrement:ee,CartRemoveEntry:Mt,CartRemoveEntryFail:bt,CartRemoveEntrySuccess:Ft,CartRemoveVoucher:xt,CartRemoveVoucherFail:Nt,CartRemoveVoucherSuccess:Pt,CartResetAddVoucher:jt,CartUpdateEntry:Ut,CartUpdateEntryFail:Ot,CartUpdateEntrySuccess:wt,ClearCartState:re,CreateCart:pt,CreateCartFail:Gt,CreateCartSuccess:vt,DELETE_CART:he,DELETE_CART_FAIL:Ke,DELETE_CART_SUCCESS:Ce,DeleteCart:Zt,DeleteCartFail:Xt,DeleteCartSuccess:Jt,LOAD_CART:lt,LOAD_CARTS_SUCCESS:He,LOAD_CART_FAIL:hi,LOAD_CART_SUCCESS:G,Loa
1dCart:R,LoadCartFail:Et,LoadCartSuccess:Ht,LoadCartsSuccess:Fe,MERGE_CART:ue,MERGE_CART_ABORT:pi,MERGE_CART_SUCCESS:qe,MergeCart:Wt,MergeCartAbort:gt,MergeCartAndIncrementProcessesCount:qt,MergeCartSuccess:zt,REMOVE_CART:ze,RESET_CART_DETAILS:vi,RESET_CART_DETAILS_BY_IDS:Ei,RemoveCart:N,ResetCartDetails:Kt,ResetCartDetailsByIds:Qt,SET_ACTIVE_CART_ID:te,SET_CART_DATA:Je,SET_CART_TYPE_INDEX:Ze,SetActiveCartId:ft,SetCartData:be,SetCartTypeIndex:O}),Ue=class{},fi=(()=>{class e{constructor(t){this.adapter=t}add(t,r,i,s,a){return this.adapter.add(t,r,i,s,a)}update(t,r,i,s,a,u=!1){return this.adapter.update(t,r,i,s,a,u)}remove(t,r,i){return this.adapter.remove(t,r,i)}static{this.\u0275fac=function(r){return new(r||e)(o(Ue))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Ui=(()=>{class e{constructor(t,r){this.actions$=t,this.cartEntryConnector=r,this.contextChange$=this.actions$.pipe(g(st.CURRENCY_CHANGE,st.LANGUAGE_CHANGE)),this.logger=A(it),this.globalMessageService=A(_t,{optional:!0}),this.addEntry$=S(()=>this.actions$.pipe(g(ie),c(i=>i.payload),J(i=>this.cartEntryConnector.add(i.userId,i.cartId,i.productCode,i.quantity,i.pickupStore).pipe(c(s=>new ht(C(C({},i),s))),M(s=>V([new Ct(I(C({},i),{error:b(s,this.logger)})),new R({cartId:i.cartId,userId:i.userId})])))),j(this.contextChange$))),this.removeEntry$=S(()=>this.actions$.pipe(g(xe),c(i=>i.payload),J(i=>this.cartEntryConnector.remove(i.userId,i.cartId,i.entryNumber).pipe(c(()=>(this.globalMessageService?.add({key:"cartItems.itemRemoved"},x.MSG_TYPE_CONFIRMATION),new Ft(C({},i)))),M(s=>V([new bt(I(C({},i),{error:b(s,this.logger)})),new R({cartId:i.cartId,userId:i.userId})])))),j(this.contextChange$))),this.updateEntry$=S(()=>this.actions$.pipe(g(Pe),c(i=>i.payload),J(i=>this.cartEntryConnector.update(i.userId,i.cartId,i.entryNumber,i.quantity,i.pickupStore,i.pickupToDelivery).pipe(c(()=>new wt(C({},i))),M(s=>V([new Ot(I(C({},i),{error:b(s,this.logger)})),new R({cartId:i.cartId,userId:i.userId})])))),j(this.contextChange$)))}static{this.\u0275fac=function(r){return new(r||e)(o(et),o(fi))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),we=class{},Si=(()=>{class e{constructor(t){this.adapter=t}add(t,r,i){return this.adapter.add(t,r,i)}remove(t,r,i){return this.adapter.remove(t,r,i)}static{this.\u0275fac=function(r){return new(r||e)(o(we))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),wi=(()=>{class e{constructor(t,r,i){this.actions$=t,this.cartVoucherConnector=r,this.messageService=i,this.logger=A(it),this.addCartVoucher$=S(()=>this.actions$.pipe(g(yt),c(s=>s.payload),_(s=>this.cartVoucherConnector.add(s.userId,s.cartId,s.voucherId).pipe(c(()=>(this.showGlobalMessage("voucher.applyVoucherSuccess",s.voucherId,x.MSG_TYPE_CONFIRMATION),new $t(C({},s)))),M(a=>V([new Lt(I(C({},s),{error:b(a,this.logger)})),new It(s.cartId),new R({userId:s.userId,cartId:s.cartId})])))))),this.removeCartVoucher$=S(()=>this.actions$.pipe(g(oe),c(s=>s.payload),_(s=>this.cartVoucherConnector.remove(s.userId,s.cartId,s.voucherId).pipe(c(()=>(this.showGlobalMessage("voucher.removeVoucherSuccess",s.voucherId,x.MSG_TYPE_INFO),new Pt({userId:s.userId,cartId:s.cartId,voucherId:s.voucherId}))),M(a=>V([new Nt({error:b(a,this.logger),cartId:s.cartId,userId:s.userId,voucherId:s.voucherId}),new R({userId:s.userId,cartId:s.cartId})]))))))}showGlobalMessage(t,r,i){this.messageService.add({key:t,params:{voucherCode:r}},i)}static{this.\u0275fac=function(r){return new(r||e)(o(et),o(Si),o(_t))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})();function $(e,n){return n===w?e?.guid??"":e?.code??""}function yi(e=""){return e.startsWith("selectivecart")}function Ai(e){return e.reason==="notFound"&&e.subjectType==="cart"&&!yi(e.subject)}function Oi(e){return e.message==="coupon.already.redeemed"}function Vi(e){return e.message==="coupon.invalid.code.provided"}function Li(e){return e.type==="VoucherOperationError"}function $i(e){return e.type==="CartError"||e.type==="CartAddressError"||e.type==="CartEntryError"||e.type==="CartEntryGroupError"}function ti(e){return e.startsWith("temp-")}function dt(e){return!e||typeof e=="object"&&Object.keys(e).length===0}function ji(e){return e?!!e.match(Ar):!1}function xi(e,n){return e!==w&&n!==e}var le=Cr(di),At=F(le,e=>e.carts),Ni=e=>F(At,n=>d.entityProcessesLoaderStateSelector(n,e)),Ri=e=>F(At,n=>d.entityValueSelector(n,e)),Pi=e=>F(At,n=>d.entityIsStableSelector(n,e)),Gi=e=>F(At,n=>d.entityHasPendingProcessesSelector(n,e)),Oe=e=>F(Ri(e),n=>n&&n.entries?n.entries:[]),ki=(e,n)=>F(Oe(e),t=>t.find(r=>r.product?.code===n)),Yi=F(At,e=>Object.keys(e.entities).map(n=>d.entityValueSelector(e,n))),Bi=F(le,e=>e.index),Hi=e=>F(Bi,n=>n&&n[e]),Ve=class{},mi=(()=>{class e{constructor(t){this.adapter=t}loadAll(t){return this.adapter.loadAll(t)}load(t,r){return this.adapter.load(t,r)}create(t,r,i){return this.adapter.create(t,r,i)}delete(t,r){return this.adapter.delete(t,r)}save(t,r,i,s){return this.adapter.save(t,r,i,s)}addEmail(t,r,i){return this.adapter.addEmail(t,r,i)}static{this.\u0275fac=function(r){return new(r||e)(o(Ve))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Wi=(()=>{class e{handleLoadCartError(t,r){if(r?.error?.errors){if(r.error.errors.filter(a=>a.reason==="invalid").length>0)return T(new R(C({},t)));if(r.error.errors.filter(a=>Ai(a)||a.reason==="UnknownResourceError").length>0)return T(new N({cartId:t.cartId}))}return T(new Et(I(C({},t),{error:b(r,this.logger)})))}constructor(t,r,i){this.actions$=t,this.cartConnector=r,this.store=i,this.featureToggles=A(ge),this.enableCartReloadOnContextChange=this.featureToggles.enableCartReloadOnContextChange,this.contextChange$=this.actions$.pipe(g(st.CURRENCY_CHANGE,st.LANGUAGE_CHANGE)),this.logger=A(it),this.loadCart$=S(()=>this.actions$.pipe(g(lt),c(s=>s.payload),cr(s=>s.cartId),_(s=>s.pipe(v(a=>T(a).pipe(E(this.store.pipe(m(Gi(a.cartId)))))),l(([a,u])=>!u),c(([a])=>a),v(a=>this.cartConnector.load(a.userId,a.cartId).pipe(_(u=>{let U=[];return u?(U.push(new Ht(I(C({},a),{cart:u,cartId:$(u,a.userId)}))),a.cartId===L&&U.push(new N({cartId:L}))):U=[new Et(I(C({},a),{error:{}}))],U}),M(u=>this.handleLoadCartError(a,u)))))),j(this.contextChange$))),this.createCart$=S(()=>this.actions$.pipe(g(K),c(s=>s.payload),_(s=>this.cartConnector.create(s.userId,s.oldCartId,s.toMergeCartGuid).pipe(v(a=>{let u=[];return s.oldCartId&&u.push(new zt({extraData:s.extraData,userId:s.userId,tempCartId:s.tempCartId,cartId:$(a,s.userId),oldCartId:s.oldCartId})),[new vt(I(C({}
1,s),{cart:a,cartId:$(a,s.userId)})),new N({cartId:s.tempCartId}),...u]}),M(a=>T(new Gt(I(C({},s),{error:b(a,this.logger)})))))),j(this.contextChange$))),this.mergeCart$=S(()=>this.actions$.pipe(g(ue),c(s=>s.payload),v(s=>this.cartConnector.load(s.userId,L).pipe(_(a=>a?.code!==s.cartId?T(new pt({userId:s.userId,oldCartId:s.cartId,toMergeCartGuid:a?a.guid:void 0,extraData:s.extraData,tempCartId:s.tempCartId})):T(new vt({userId:s.userId,cart:a,cartId:$(a,s.userId),extraData:s.extraData,tempCartId:s.tempCartId}),new gt({cartId:$(a,s.userId)}))),M(a=>rr(T(new gt({cartId:s.cartId,error:b(a,this.logger)})),T(new N({cartId:s.cartId})))),l(rt))),j(this.contextChange$))),this.refresh$=S(()=>this.actions$.pipe(g(ce),c(s=>s.payload),J(s=>V([new It(s.cartId),new R({userId:s.userId,cartId:s.cartId})])))),this.refreshWithoutProcesses$=S(()=>this.actions$.pipe(g(St,ne,ae,de),c(s=>s.payload),c(s=>new R({userId:s.userId,cartId:s.cartId})))),this.resetCartDetailsOnSiteContextChange$=S(()=>this.contextChange$.pipe(l(()=>!this.enableCartReloadOnContextChange),_(()=>[new Kt]))),this.refreshCartDetailsOnSiteContextChange$=S(()=>this.contextChange$.pipe(l(()=>!!this.enableCartReloadOnContextChange),E(this.store.pipe(m(le))),_(([s,a])=>{let u=a?.index?.[f.ACTIVE],Rt=Object.keys(a?.carts?.entities??{}).filter(bi=>bi!==u),Xe=Rt.length?[new Qt({cartIds:Rt})]:[];return u&&Xe.push(new R({cartId:u,userId:vr})),Xe}))),this.addEmail$=S(()=>this.actions$.pipe(g(We),c(s=>s.payload),_(s=>this.cartConnector.addEmail(s.userId,s.cartId,s.email).pipe(_(()=>[new Bt(C({},s)),new R({userId:s.userId,cartId:s.cartId})]),M(a=>V([new Yt(I(C({},s),{error:b(a,this.logger)})),new R({userId:s.userId,cartId:s.cartId})])))),j(this.contextChange$))),this.deleteCart$=S(()=>this.actions$.pipe(g(he),c(s=>s.payload),_(s=>this.cartConnector.delete(s.userId,s.cartId).pipe(c(()=>new Jt(C({},s))),M(a=>V([new Xt(I(C({},s),{error:b(a,this.logger)})),new R(C({},s))]))))))}static{this.\u0275fac=function(r){return new(r||e)(o(et),o(mi),o(tt))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),Ti=(()=>{class e{getActiveCartTypeOnLoadSuccess(t){if(t?.payload?.extraData?.active)return t.payload?.cart.saveTime?new O({cartType:f.ACTIVE,cartId:""}):new O({cartType:f.ACTIVE,cartId:t.meta.entityId})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),qi=(()=>{class e{getActiveCartTypeOnLoad(t){if(t?.payload?.cartId===L)return new O({cartType:f.ACTIVE,cartId:""})}getActiveCartTypeOnLoadSuccess(t){return this.multiCartEffectsService.getActiveCartTypeOnLoadSuccess(t)}getActiveCartTypeOnCreate(t){if(t?.payload?.extraData?.active)return new O({cartType:f.ACTIVE,cartId:t.meta.entityId})}constructor(t,r){this.actions$=t,this.multiCartEffectsService=r,this.processesIncrement$=S(()=>this.actions$.pipe(g(yt),c(i=>i.payload),c(i=>new ee(i.cartId)))),this.setSelectiveId$=S(()=>this.actions$.pipe(g(G),c(i=>{switch(i.type){case G:{let s=i.payload;if(yi(s.cartId))return new O({cartType:f.SELECTIVE,cartId:s.cartId});break}}}),l(rt))),this.setActiveCartId$=S(()=>this.actions$.pipe(g(G,lt,Q,K,te),c(i=>{switch(i.type){case lt:return this.getActiveCartTypeOnLoad(i);case G:return this.getActiveCartTypeOnLoadSuccess(i);case K:return this.getActiveCartTypeOnCreate(i);case Q:return new O({cartType:i?.payload?.extraData?.active?f.ACTIVE:f.NEW_CREATED,cartId:i.meta.entityId});case te:return new O({cartType:f.ACTIVE,cartId:i.payload})}}),l(rt)))}static{this.\u0275fac=function(r){return new(r||e)(o(et),o(Ti))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),zi=[Ui,wi,Wi,qi],ei={[f.ACTIVE]:""};function Ki(e=ei,n){switch(n.type){case Ze:return I(C({},e),{[n.payload.cartType]:n.payload.cartId});case ze:case Ce:return n.payload?.cartId===e[f.ACTIVE]?I(C({},e),{[f.ACTIVE]:""}):e;case Qe:return ei}return e}var Qi=void 0;function Zi(e=Qi,n){switch(n.type){case He:return n.payload;case G:case Q:case Je:return n.payload.cart}return e}function Ji(e){return function(n,t){return t.type===Tr.LOGOUT&&(n=void 0),e(n,t)}}var Xi=[Ji],_i=new X("MultiCartReducers");function ts(){return{carts:d.entityProcessesLoaderReducer(h,Zi),index:Ki}}var es={provide:_i,useFactory:ts};var rs=(()=>{class e{constructor(t,r,i){this.statePersistenceService=t,this.store=r,this.siteContextParamsService=i,this.subscription=new mt}initSync(){this.subscription.add(this.statePersistenceService.syncWithStorage({key:"cart",state$:this.getCartState(),context$:this.siteContextParamsService.getValues([gr]),storageType:fr.LOCAL_STORAGE,onRead:t=>this.onRead(t)}))}getCartState(){return this.store.pipe(l(t=>!!t.cart),m(le),l(t=>!!t),c(t=>t.index),ar("Active"),c(t=>({active:t[f.ACTIVE]??""})))}onRead(t){this.store.dispatch(new re),t?this.store.dispatch(new ft(t.active)):this.store.dispatch(new ft(""))}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(r){return new(r||e)(o(Rr),o(tt),o(Mr))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function is(e,n){return()=>er(n.getStable("context").pipe(P(()=>{e.initSync()})))}function ss(){return n=>(t,r)=>{let i=C({},t);return r.type==="@ngrx/store/init"&&(i.cart=I(C({},i.cart),{index:{[f.ACTIVE]:void 0}})),n(i,r)}}var ns=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=B({type:e})}static{this.\u0275inj=Y({providers:[{provide:yr,useFactory:is,deps:[rs,_r],multi:!0},{provide:hr,useFactory:ss,multi:!0}]})}}return e})(),Le=class{},Di=(()=>{class e{constructor(){this.adapter=A(Le)}getCartAccessCode(t,r){return this.adapter.getCartAccessCode(t,r)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),Ls=new X("CartAccessCodeNormalizer"),$e=class{},Mi=(()=>{class e{constructor(){this.adapter=A($e)}createCartGuestUser(t,r,i){return this.adapter.createCartGuestUser(t,r,i)}updateCartGuestUser(t,r,i){return this.adapter.updateCartGuestUser(t,r,i)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),$s=new X("CartGuestUserNormalizer"),js=new X("CartValidationNormalizer"),je=class{},Fi=(()=>{class e{constructor(t){this.adapter=t}validate(t,r){return this.adapter.validate(t,r)}static{this.\u0275fac=function(r){return new(r||e)(o(je))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),as=(()=>{class e{constructor(t,r,i,s){this.actionsSubject=t,this.event=r,this.activeCartService=i,this.stateEventService=s,this.register()}register(){this.registerCreateCart(),this.registerAddEntry(),this.registerRemoveEntry(),this.registerUpdateEntry(),this.registerDeleteCart(),this.registerAddCartVoucher(),this.registerRemoveCartVoucher(),this.registerMergeCartSuccess()}registerAddEntry(){this.registerMapped({action:ie,event:Vr}),this.registerMapped({action:St,event:Lr}),this.registerMapped({action:se,event:$r})}registerRemoveEntry(){this.registerMapped({action:ne,event:xr}),this.registerMapped({action:Ne,event:jr})}registerUpdateEntry(){this.registerMapped({action:ae,event:Nr}),this.registerMapped({action:Ge,event:Pr})}registerMergeCartSuccess(){this.registerMapped({action:qe,event:Gr})}registerCreateCart(){this.stateEventService.register({action:K,event:Ur}),this.stateEventService.register({action:Q,event:wr}),this.stateEventService.register({action:Be,event:Or})}registerDeleteCart(){this.stateEventService.register({action:he,event:me,factory:t=>H(me,I(C({},t.payload),{cartCode:t.payload.cartId}))}),this.stateEventService.register({action:Ce,event:Te,factory:t=>H(Te,I(C({},t.payload),{cartCode:t.payload.cartId}))}),this.stateEventService.register({action:Ke,event:_e,factory:t=>H(_e,I(C({},t.payload),{cartCode:t.payload.cartId}))})}registerAddCartVoucher(){this.stateEventService.register({action:yt,event:kr}),this.stateEventService.register({action:ce,event:Yr}),this.stateEventService.register({action:ke,event:Br})}registerRemoveCartVoucher(){this.stateEventService.register({action:oe,event:Hr}),this.stateEventService.register({action:de,event:Wr}),this.stateEventService.register({action:Ye,event:qr})}registerMapped(t){let r=this.getAction(t.action).pipe(v(i=>T(i).pipe(E(this.activeCartService.getActive(),this.activeCartService.getActiveCartId()))),l(([i,s,a])=>i.payload.cartId===a),c(([i,s])=>H(t.event,I(C({},i.payload),{cartCode:s.code,entry:i.payload.entry?i.payload.entry:s.entries?.[Number(i.payload.entryNumber)]}
1))));return this.event.register(t.event,r)}getAction(t){return this.actionsSubject.pipe(g(...[].concat(t)))}static{this.\u0275fac=function(r){return new(r||e)(o(Ee),o(fe),o(q),o(Dr))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),cs=(()=>{class e{constructor(t){}static{this.\u0275fac=function(r){return new(r||e)(o(as))}}static{this.\u0275mod=B({type:e})}static{this.\u0275inj=Y({})}}return e})(),os=(()=>{class e{constructor(t){this.eventService=t,this.register()}register(){this.eventService.register(De,this.buildCartPageEvent())}buildCartPageEvent(){return this.eventService.get(br).pipe(l(t=>t.semanticRoute==="cart"),c(t=>H(De,{navigation:t})))}static{this.\u0275fac=function(r){return new(r||e)(o(fe))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),ds=(()=>{class e{constructor(t){}static{this.\u0275fac=function(r){return new(r||e)(o(os))}}static{this.\u0275mod=B({type:e})}static{this.\u0275inj=Y({})}}return e})(),ri=(()=>{class e{constructor(t,r,i){this.multiCartFacade=t,this.userIdService=r,this.winRef=i,this.subscription=new mt,this.activeCartId$=this.userIdService.getUserId().pipe(y(1),v(()=>this.multiCartFacade.getCartIdByType(f.ACTIVE)),l(s=>s!==void 0),c(s=>s===""?L:s)),this.cartEntity$=this.activeCartId$.pipe(v(s=>this.multiCartFacade.getCartEntity(s))),this.shouldLoadCartOnCodeFlow=!0,this.checkInitLoad=void 0,this.initActiveCart(),this.detectUserChange()}initActiveCart(){let t=this.cartEntity$.pipe(c(i=>({cart:i.value,isStable:!i.loading&&i.processesCount===0,loaded:!!((i.error||i.success)&&!i.loading)})),l(({isStable:i,cart:s})=>i||dt(s))),r=t.pipe(E(this.activeCartId$,this.userIdService.getUserId()),P(([{cart:i,loaded:s,isStable:a},u,U])=>{a&&dt(i)&&!s&&!ti(u)&&this.shouldLoadCartOnCodeFlow&&this.load(u,U)}));this.activeCart$=sr(()=>r.subscribe(),()=>t).pipe(c(({cart:i})=>i||{}),D(),pe({bufferSize:1,refCount:!0}))}detectUserChange(){this.subscription.add(this.userIdService.getUserId().pipe(or(),E(this.activeCartId$)).subscribe(([[t,r],i])=>{xi(r,t)&&this.loadOrMerge(i,r,t)})),this.isLoggedInWithCodeFlow()&&(this.shouldLoadCartOnCodeFlow=!1,this.subscription.add(this.userIdService.getUserId().pipe(E(this.activeCartId$)).subscribe(([t,r])=>{this.loadOrMerge(r,t,w),this.winRef?.localStorage?.removeItem(Ae)})))}getActive(){return this.activeCart$}takeActive(){return this.isStable().pipe(l(t=>t),v(()=>this.getActive()),l(t=>!!t),y(1))}getActiveCartId(){return this.activeCart$.pipe(E(this.userIdService.getUserId()),c(([t,r])=>$(t,r)),D())}takeActiveCartId(){return this.isStable().pipe(l(t=>t),v(()=>this.getActiveCartId()),l(t=>!!t),y(1))}getEntries(){return this.activeCartId$.pipe(v(t=>this.multiCartFacade.getEntries(t)),D())}getLastEntry(t){return this.activeCartId$.pipe(v(r=>this.multiCartFacade.getLastEntry(r,t)),D())}getLoading(){return this.cartEntity$.pipe(c(t=>!!t.loading),D())}isStable(){return this.activeCartId$.pipe(v(t=>this.multiCartFacade.isStable(t)))}load(t,r){r===w&&t===L||this.multiCartFacade.loadCart({userId:r,cartId:t,extraData:{active:!0}})}loadOrMerge(t,r,i){t===L||i!==w?this.multiCartFacade.loadCart({userId:r,cartId:t,extraData:{active:!0}}):ye(this.isGuestCart())?this.guestCartMerge(t):this.multiCartFacade.mergeToCurrentCart({userId:r,cartId:t,extraData:{active:!0}})}guestCartMerge(t){this.getEntries().pipe(y(1)).subscribe(r=>{this.multiCartFacade.deleteCart(t,w),this.addEntriesGuestMerge(r)})}addEntriesGuestMerge(t){let r=t.map(i=>({productCode:i.product?.code??"",quantity:i.quantity??0}));this.requireLoadedCart(!0).pipe(E(this.userIdService.getUserId())).subscribe(([i,s])=>{this.multiCartFacade.addEntries(s,$(i,s),r)})}isCartCreating(t,r){return ti(r)&&(t.loading||t.success||t.error)}isLoggedInWithCodeFlow(){return!!this.winRef?.localStorage?.getItem(Ae)}requireLoadedCart(t=!1){this.checkInitLoad=this.checkInitLoad===void 0;let r=(t?this.cartEntity$.pipe(l(()=>!ye(this.isGuestCart()))):this.cartEntity$).pipe(l(i=>!i.loading||!!this.checkInitLoad));return this.activeCartId$.pipe(E(r),l(([i,s])=>!this.isCartCreating(s,i)),c(([,i])=>i),y(1)).pipe(E(this.userIdService.getUserId()),P(([i,s])=>{dt(i.value)&&s!==w&&!i.loading&&this.load(L,s),this.checkInitLoad=!1}),v(()=>r),E(this.userIdService.getUserId()),l(([i,s])=>!!(s===w||i.success||i.error)),y(1)).pipe(P(([i,s])=>{dt(i.value)&&this.multiCartFacade.createCart({userId:s,extraData:{active:!0}})}),v(()=>r),l(i=>!!(i.success||i.error)),E(this.activeCartId$),l(([i,s])=>!this.isCartCreating(i,s)),c(([i])=>i.value),l(i=>!dt(i)),y(1))}addEntry(t,r,i){this.requireLoadedCart().pipe(E(this.userIdService.getUserId())).subscribe(([s,a])=>{this.multiCartFacade.addEntry(a,$(s,a),t,r,i)})}removeEntry(t){this.activeCartId$.pipe(E(this.userIdService.getUserId()),y(1)).subscribe(([r,i])=>{this.multiCartFacade.removeEntry(i,r,t.entryNumber)})}updateEntry(t,r,i,s=!1){this.activeCartId$.pipe(E(this.userIdService.getUserId()),y(1)).subscribe(([a,u])=>{this.multiCartFacade.updateEntry(u,a,t,r,i,s)})}getEntry(t){return this.activeCartId$.pipe(v(r=>this.multiCartFacade.getEntry(r,t)),D())}addEmail(t){this.activeCartId$.pipe(E(this.userIdService.getUserId()),y(1)).subscribe(([r,i])=>{this.multiCartFacade.assignEmail(r,i,t)}
1)}getAssignedUser(){return this.activeCart$.pipe(c(t=>t.user))}isGuestCart(t){return t?T(this.isCartUserGuest(t)):this.activeCart$.pipe(c(r=>this.isCartUserGuest(r)),D())}isCartUserGuest(t){let r=t.user;return!!(r&&(r.name===Er||ji(r.uid?.split("|").slice(1).join("|"))))}addEntries(t){let r=t.map(i=>({productCode:i.product?.code??"",quantity:i.quantity??0}));this.requireLoadedCart().pipe(E(this.userIdService.getUserId())).subscribe(([i,s])=>{i&&this.multiCartFacade.addEntries(s,$(i,s),r)})}reloadActiveCart(){Z([this.getActiveCartId(),this.userIdService.takeUserId()]).pipe(y(1),c(([t,r])=>{this.multiCartFacade.loadCart({cartId:t,userId:r,extraData:{active:!0}})})).subscribe()}hasPickupItems(){return this.getActive().pipe(c(t=>t.pickupItemsQuantity?t.pickupItemsQuantity>0:!1))}hasDeliveryItems(){return this.getActive().pipe(c(t=>t.deliveryItemsQuantity?t.deliveryItemsQuantity>0:!1))}getPickupEntries(){return this.getEntries().pipe(c(t=>t.filter(r=>r.deliveryPointOfService!==void 0)))}getDeliveryEntries(){return this.getEntries().pipe(c(t=>t.filter(r=>r.deliveryPointOfService===void 0)))}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(r){return new(r||e)(o(ot),o(W),o(Tt))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),ii=(()=>{class e{constructor(){this.queryService=A(Se),this.commandService=A(nt),this.cartAccessCodeConnector=A(Di),this.getCartAccessCodeCommand=this.commandService.create(({userId:t,cartId:r})=>this.cartAccessCodeConnector.getCartAccessCode(t,r))}getCartAccessCode(t,r){return this.getCartAccessCodeCommand.execute({userId:t,cartId:r})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),si=(()=>{class e{constructor(){this.queryService=A(Se),this.commandService=A(nt),this.cartGuestUserConnector=A(Mi),this.createCartGuestUserCommand=this.commandService.create(({userId:t,cartId:r,guestUserDetails:i})=>this.cartGuestUserConnector.createCartGuestUser(t,r,i)),this.updateCartGuestUserCommand=this.commandService.create(({userId:t,cartId:r,guestUserDetails:i})=>this.cartGuestUserConnector.updateCartGuestUser(t,r,i))}createCartGuestUser(t,r,i){return this.createCartGuestUserCommand.execute({userId:t,cartId:r,guestUserDetails:i})}updateCartGuestUser(t,r,i){return this.updateCartGuestUserCommand.execute({userId:t,cartId:r,guestUserDetails:i})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),us=(()=>{class e{constructor(t){this.routingService=t,this.NAVIGATION_SKIPS=2,this.navigationIdCount=0,this.subscription=new mt,this.cartValidationResult$=new tr(1),this.checkForValidationResultClear$=this.routingService.getRouterState().pipe(E(this.cartValidationResult$),P(([r,i])=>{this.navigationIdCount+this.NAVIGATION_SKIPS<=r.navigationId&&i.length&&(this.cartValidationResult$.next([]),this.navigationIdCount=r.navigationId)})),this.setInitialState()}ngOnDestroy(){this.subscription.unsubscribe()}setInitialState(){this.setNavigationIdStep(),this.subscription.add(this.checkForValidationResultClear$.subscribe())}updateValidationResultAndRoutingId(t){this.cartValidationResult$.next(t),this.setNavigationIdStep()}setNavigationIdStep(){this.routingService.getRouterState().pipe(y(1)).subscribe(t=>this.navigationIdCount=t.navigationId)}static{this.\u0275fac=function(r){return new(r||e)(o(Fr))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),ni=(()=>{class e{constructor(t,r,i,s,a){this.cartValidationConnector=t,this.command=r,this.userIdService=i,this.activeCartFacade=s,this.cartValidationStateService=a,this.validateCartCommand=this.command.create(()=>Z([this.activeCartFacade.getActiveCartId(),this.userIdService.takeUserId(),this.activeCartFacade.isStable()]).pipe(l(([u,U,Rt])=>Rt),y(1),v(([u,U])=>this.cartValidationConnector.validate(u,U))),{strategy:Sr.CancelPrevious})}validateCart(){return this.validateCartCommand.execute()}getValidationResults(){return this.cartValidationStateService.cartValidationResult$}static{this.\u0275fac=function(r){return new(r||e)(o(Fi),o(nt),o(W),o(q),o(us))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),ai=(()=>{class e{constructor(t,r,i){this.store=t,this.activeCartFacade=r,this.userIdService=i}addVoucher(t,r){this.combineUserAndCartId(r).subscribe(([i,s])=>this.store.dispatch(new Vt({userId:i,cartId:s,voucherId:t})))}removeVoucher(t,r){this.combineUserAndCartId(r).subscribe(([i,s])=>this.store.dispatch(new xt({userId:i,cartId:s,voucherId:t})))}getAddVoucherResultError(){return this.store.pipe(m(Dt.getProcessErrorFactory(k)))}getAddVoucherResultSuccess(){return this.store.pipe(m(Dt.getProcessSuccessFactory(k)))}getAddVoucherResultLoading(){return this.store.pipe(m(Dt.getProcessLoadingFactory(k)))}resetAddVoucherProcessingState(){this.store.dispatch(new jt)}combineUserAndCartId(t){return t?this.userIdService.getUserId().pipe(y(1),c(r=>[r,t])):Z([this.userIdService.getUserId(),this.activeCartFacade.getActiveCartId()]).pipe(y(1))}static{this.\u0275fac=function(r){return new(r||e)(o(tt),o(q),o(W))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),ci=(()=>{class e{constructor(t,r){this.store=t,this.userIdService=r,this.featureToggles=A(ge),this.windowRef=A(Tt)}getCart(t){return this.store.pipe(m(Ri(t)))}getCarts(){return this.store.pipe(m(Yi))}getCartEntity(t){return this.store.pipe(m(Ni(t)))}isStable(t){return this.store.pipe(m(Pi(t)),nr(r=>r?ir(0):T(void 0)),D())}generateTempCartId(){let t=new Uint32Array(1);return this.windowRef.nativeWindow?.crypto.getRandomValues(t),`temp-${t[0].toString(36).substring(2,11)}`}createCart({userId:t,oldCartId:r,toMergeCartGuid:i,extraData:s}){let a=this.generateTempCartId();return this.store.dispatch(new pt({extraData:s,userId:t,oldCartId:r,toMergeCartGuid:i,tempCartId:a})),this.getCartIdByType(s?.active?f.ACTIVE:f.NEW_CREATED).pipe(v(u=>this.getCart(u)),l(rt))}mergeToCurrentCart({userId:t,cartId:r,extraData:i}){let s=this.generateTempCartId();this.featureToggles.incrementProcessesCountForMergeCart||this.featureToggles.authorizationCodeFlowByDefault?this.store.dispatch(new qt({userId:t,cartId:r,extraData:i,tempCartId:s})):this.store.dispatch(new Wt({userId:t,cartId:r,extraData:i,tempCartId:s}))}loadCart({cartId:t,userId:r,extraData:i}){this.store.dispatch(new R({userId:r,cartId:t,extraData:i}))}getEntries(t){return this.store.pipe(m(Oe(t)))}getLastEntry(t,r){return this.store.pipe(m(Oe(t)),c(i=>{let s=i.filter(a=>a.product?.code===r);return s?s[s.length-1]:void 0}))}addEntry(t,r,i,s,a){this.store.dispatch(new ut({userId:t,cartId:r,productC
1ode:i,quantity:s,pickupStore:a}))}addEntries(t,r,i){i.forEach(s=>{this.store.dispatch(new ut({userId:t,cartId:r,productCode:s.productCode,quantity:s.quantity}))})}removeEntry(t,r,i){this.store.dispatch(new Mt({userId:t,cartId:r,entryNumber:`${i}`}))}updateEntry(t,r,i,s,a,u=!1){s!==void 0&&s<=0?this.removeEntry(t,r,i):this.store.dispatch(new Ut({userId:t,cartId:r,pickupStore:a,pickupToDelivery:u,entryNumber:`${i}`,quantity:s}))}getEntry(t,r){return this.store.pipe(m(ki(t,r)))}assignEmail(t,r,i){this.store.dispatch(new kt({userId:r,cartId:t,email:i}))}removeCart(t){this.store.dispatch(new N({cartId:t}))}deleteCart(t,r){this.store.dispatch(new Zt({userId:r,cartId:t}))}reloadCart(t,r){this.userIdService.takeUserId().subscribe(i=>this.store.dispatch(new R({userId:i,cartId:t,extraData:r})))}getCartIdByType(t){return this.store.pipe(m(Hi(t)),D())}static{this.\u0275fac=function(r){return new(r||e)(o(tt),o(W))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),oi=(()=>{class e{constructor(t,r,i,s){this.userProfileFacade=t,this.multiCartFacade=r,this.baseSiteService=i,this.userIdService=s}getCart(){return this.selectiveCart$||(this.selectiveCart$=Z([this.getSelectiveCartId(),this.userProfileFacade.get(),this.userIdService.getUserId(),this.baseSiteService.getActive()]).pipe(D(),P(([t,r,i,s])=>{!t&&i!==w&&r?.customerId&&this.multiCartFacade.loadCart({userId:i,cartId:`selectivecart${s}${r.customerId}`})}),l(([t])=>!!t),v(([t])=>this.multiCartFacade.getCart(t)),pe({bufferSize:1,refCount:!0}))),this.selectiveCart$}getEntries(){return this.getSelectiveCartId().pipe(v(t=>this.multiCartFacade.getEntries(t)))}isStable(){return this.getSelectiveCartId().pipe(v(t=>this.multiCartFacade.isStable(t)))}addEntry(t,r){this.getSelectiveIdWithUserId().subscribe(([i,s])=>{this.multiCartFacade.addEntry(s,i,t,r)})}removeEntry(t){this.getSelectiveIdWithUserId().subscribe(([r,i])=>{this.multiCartFacade.removeEntry(i,r,t.entryNumber)})}updateEntry(t,r){this.getSelectiveIdWithUserId().subscribe(([i,s])=>{this.multiCartFacade.updateEntry(s,i,t,r)})}getEntry(t){return this.getSelectiveCartId().pipe(v(r=>this.multiCartFacade.getEntry(r,t)))}getSelectiveCartId(){return this.multiCartFacade.getCartIdByType(f.SELECTIVE)}getSelectiveIdWithUserId(){return this.getSelectiveCartId().pipe(D(),E(this.userIdService.getUserId()),y(1))}static{this.\u0275fac=function(r){return new(r||e)(o(Xr),o(ot),o(Ir),o(W))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac})}}return e})(),hs=[ri,{provide:q,useExisting:ri},ai,{provide:Zr,useExisting:ai},ci,{provide:ot,useExisting:ci},oi,{provide:Jr,useExisting:oi},ni,{provide:Me,useExisting:ni},ii,{provide:Kr,useExisting:ii},si,{provide:Qr,useExisting:si}],Cs=(()=>{class e extends at{constructor(){super(...arguments),this.responseStatus=Re.BAD_REQUEST}getPriority(){return Ie.NORMAL}hasMatch(t){return super.hasMatch(t)&&this.getErrors(t).some($i)}handleError(t,r){this.handleCartNotFoundError(t,r),this.handleOtherCartErrors(t,r)}handleCartNotFoundError(t,r){this.getErrors(r).filter(i=>Ai(i)).forEach(()=>{this.globalMessageService.add({key:"httpHandlers.cartNotFound"},x.MSG_TYPE_ERROR)})}handleOtherCartErrors(t,r){this.getErrors(r).filter(i=>i.reason!=="notFound"||i.subjectType!=="cart").forEach(i=>{this.globalMessageService.add(i.message?i.message:{key:"httpHandlers.otherCartErrors"},x.MSG_TYPE_ERROR)})}getErrors(t){return(t.error?.errors||[]).filter(r=>r.type!=="JaloObjectNoLongerValidError")}static{this.\u0275fac=(()=>{let t;return function(i){return(t||(t=ve(e)))(i||e)}})()}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),ls=(()=>{class e extends at{constructor(){super(...arguments),this.responseStatus=Re.BAD_REQUEST}getPriority(){return Ie.NORMAL}hasMatch(t){return super.hasMatch(t)&&this.getErrors(t).some(Li)}handleError(t,r){this.handleVoucherExceededError(t,r),this.handleVoucherInvalidError(t,r)}handleVoucherExceededError(t,r){this.getErrors(r).filter(i=>Oi(i)).forEach(()=>{this.globalMessageService.add({key:"httpHandlers.voucherExceeded"},x.MSG_TYPE_ERROR)})}handleVoucherInvalidError(t,r){this.getErrors(r).filter(i=>
1Vi(i)).forEach(()=>{this.globalMessageService.add({key:"httpHandlers.invalidCodeProvided"},x.MSG_TYPE_ERROR)})}getErrors(t){return(t.error?.errors||[]).filter(r=>r.type!=="JaloObjectNoLongerValidError")}static{this.\u0275fac=(()=>{let t;return function(i){return(t||(t=ve(e)))(i||e)}})()}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),ps=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=B({type:e})}static{this.\u0275inj=Y({providers:[es,Ti],imports:[ur,mr,lr.forFeature(di,_i,{metaReducers:Xi}),pr.forFeature(zi)]})}}return e})(),xs=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=B({type:e})}static{this.\u0275inj=Y({providers:[mi,fi,Si,Fi,Di,Mi,...hs,{provide:at,useExisting:Cs,multi:!0},{provide:at,useExisting:ls,multi:!0}],imports:[cs,ps,ns,ds]})}}return e})(),Ns=(()=>{class e{constructor(t){this.config=t}isSelectiveCartEnabled(){return!!this.config?.cart?.selectiveCart?.enabled}isCartValidationEnabled(){return!!this.config?.cart?.validation?.enabled}static{this.\u0275fac=function(r){return new(r||e)(o(zr))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Ps=(()=>{class e{constructor(t){this.actionsSubject=t,this.logger=A(it)}getResults(t){return this.actionsSubject.pipe(g(St,se),l(r=>r.payload.cartId===t),c(r=>this.mapMessages(r)))}
1mapMessages(t){let{productCode:r}=t.payload;if(t instanceof ht){let{quantity:i,quantityAdded:s,entry:a,statusCode:u}=t.payload;if(u===z.LOW_STOCK)return{productCode:r,statusCode:u,productName:a?.product?.name,quantity:i,quantityAdded:s};if(u===z.SUCCESS||u===z.NO_STOCK)return{productCode:r,statusCode:u,productName:a?.product?.name}}else if(t instanceof Ct){let{error:i}=t.payload;if(i?.details[0]?.type==="UnknownIdentifierError")return{productCode:r,statusCode:z.UNKNOWN_IDENTIFIER}}return dr()&&this.logger.warn("Unrecognized cart add entry action type while mapping messages",t),{productCode:r,statusCode:z.UNKNOWN_ERROR}}static{this.\u0275fac=function(r){return new(r||e)(o(Ee))}}static{this.\u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{Vs as a,Ue as b,we as c,$ as d,Ve as e,rs as f,Le as g,Ls as h,$e as i,Mi as j,$s as k,js as l,je as m,ri as n,si as o,xs as p,Ns as q,Ps as r};

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.