1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2b977d6f-6007-549f-a987-846df16fe7c6")}catch(e){}}(); 3import{a as d}from"./chunk-BBT3V5DN.js";import{$ as f}from"./chunk-IJME5RCK.js";import{b as l,l as A,p as U}from"./chunk-EIJYTSSU.js";import{b as _}from"./chunk-QRUNXDIJ.js";import{u as R,w as T}from"./chunk-QZXYJUOV.js";import{m as o}from"./chunk-HHMEJT5Q.js";import{N as p,da as E}from"./chunk-UHERDYYU.js";import{Aa as e,I as h,R as m,p as i,v as c,ya as S}from"./chunk-P7PFFTQP.js";var u=class{constructor(){this.authService=e(d),this.guestUserService=e(f),this.store=e(o),this.router=e(p),this.abTestsService=e(U),this.authLocalStorage=e(R),this.GUEST_ORDER_SUMMARY_ROUTE="/order-summary/",this.GUEST_ALLOWED_ROUTES=[this.GUEST_ORDER_SUMMARY_ROUTE,"/payment-resolution/"]}canActivate(t,r){return this.store.select(T).pipe(h(s=>s!==null),m(1),c(s=>this.resolveGuard(s,r,t)))}resolveGuard(t,r,s){return t?(this.store.dispatch({type:"AUTH_GUARD_PASSED"}),!0):this.isGuestAllowed(r,s)&&this.isGuestCheckoutEnabled(s)?this.handleGuestAccess(r):this.requireAuthentication(r)}isGuestAllowed(t,r){let s=r.queryParamMap.get("category"),G=this.router.currentNavigation()?.extras?.state?.guestLogin,g=this.GUEST_ALLOWED_ROUTES.some(D=>t.url.includes(D));return(t.url.includes(this.GUEST_ORDER_SUMMARY_ROUTE)?this.guestUserService.isGuestValidCategory(s):!0)&&(G||g)}handleGuestAccess(t){if(this.guestUserService.isGuestUser())return this.store.dispatch({type:"AUTH_GUARD_PASSED"}),!0;let r=this.router.currentNavigation()?.previousNavigation?.finalUrl;return r&&this.authLocalStorage.setGuestCheckoutSourceUrl(this.router.serializeUrl(r)),this.authLocalStorage.setReturnToUrl(t.url),this.store.dispatch({type:"AUTH_GUARD_BLOCKED"}),this.store.dispatch(new _({path:["/order-summary/guest-login"]})),!1}requireAuthentication(t){return this.redirectToSignIn(t),!1}redirectToSignIn(t){this.authService.signIn({returnToUrl:t.url}),this.store.dispatch({type:"AUTH_GUARD_BLOCKED"})}isGuestCheckoutEnabled(t){return t.queryParamMap.get("disableGuestCheckout")==="true"?!1:this.abTestsService.checkTestVariant(A.GUEST_CHECKOUT,l.EXPERIMENT)}};var a=class{constructor(){this.store=e(o)}canActivate(t,r){return t.data.skipServerAuthGuard?(this.store.dispatch({type:"USER_GUARD_DISABLED_FOR_SERVER"}),i(!0)):process.env.IS_E2E?(this.store.dispatch({type:"USER_GUARD_DISABLED_FOR_SERVER_IN_E2E"}),i(!0)):i(!1)}};function O(){return e(E).browser?new u:new a}var v=new S("AUTH_GUARD",{providedIn:"root",factory:()=>O()});export{v as a}; 4/**i18n:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855*/ 5 6//# debugId=2b977d6f-6007-549f-a987-846df16fe7c6
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.