PageSourceSearch

https://resoflow-prod.web.app/assets/authEngine-BpTd9KNg.js

js resoflow-prod.web.app collected 2026-10-03 12:35:16 UTC 9,625 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sentryHeavy-BKpXVZnK.js","assets/index-CJ0eVksD.js","assets/vendor-react-Cg5IBgwO.js","assets/index-BbrDgIPv.css","assets/supportInboxService-BtY28HVl.js","assets/hooks-DYA9J1es.js","assets/vendor-firebase-auth-Dw-tYyLh.js","assets/vendor-firebase-db-BWYKWqg8.js","assets/firebase-DvHzvjpo.js","assets/turnstileScript-Nso5-LFr.js","assets/scopedLocalStorage-C63pQoBG.js","assets/callables-C7D6D-pO.js","assets/apiClient--m1UJa-S.js","assets/offlineActionPolicy-Djb7n2Z2.js","assets/adminCallables-Da9nsXIW.js","assets/dlq-L9pIonhG.js","assets/identity-BQXiQ7B6.js","assets/pushClient-BF_uSDi-.js"])))=>i.map(i=>d[i]);
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"1.0.0"};var s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="2724f0f5-1cd4-4fdd-af84-a7d6c55d75ec",e._sentryDebugIdIdentifier="sentry-dbid-2724f0f5-1cd4-4fdd-af84-a7d6c55d75ec")}catch(t){}}();import{N as e,_ as s,cZ as t,a8 as n,c_ as r,c$ as a,af as o,d0 as i,d1 as l,d2 as c,d3 as u,d4 as d,d5 as p,d6 as m,ae as f}from"./index-CJ0eVksD.js";import{A as h,G as g,B as y,Q as w,P as U,u as b}from"./vendor-firebase-auth-Dw-tYyLh.js";import{d as v,o as j}from"./vendor-firebase-db-BWYKWqg8.js";import{n as D}from"./notify-DLhs2xBD.js";import{auth as L,db as N}from"./firebase-DvHzvjpo.js";import{e as P,w as E,b as S,r as T}from"./sessionLifetime-Du0YXUNI.js";import{p as _,e as A}from"./planService-RCjdxSEx.js";import{c as I,r as C}from"./venuesMap-CaLoRk4f.js";import{p as M}from"./appStartPolicy-DkdNpPHP.js";import{c as R,s as O,d as k}from"./userDocNameCache-7DB8l2eC.js";import{w as V}from"./warmAppCheck-BZyyZa9n.js";import{b as F}from"./connectivityHeartbeat-BkYJQ14P.js";import{r as H,s as x}from"./themeWriteRegister-CY0ImIDj.js";import"./vendor-react-Cg5IBgwO.js";import"./errorMessages-DM6_MVJz.js";import"./offlineActionPolicy-Djb7n2Z2.js";import"./turnstileScript-Nso5-LFr.js";import"./apiClient--m1UJa-S.js";import"./deviceIdentity-yNOFb1Pe.js";import"./deviceChangePolicy-ChjwIqUA.js";import"./themeSync-BN6IDfTv.js";import"./scopedLocalStorage-C63pQoBG.js";import"./displayRoutes-BtUCGFEO.js";import"./ordersScreensModel-CcaPVjGj.js";import"./ordersBoardModel-DQ3msAji.js";import"./optionNameDisplay-B5n6urku.js";import"./orderFulfilment-B3VHUeT3.js";import"./stationModel-BOWm3zm-.js";import"./reportListenerDeath-Dlr7Syko.js";import"./cycleWindow-BHn3tM_i.js";let W=null;const Y="resoflow:retry-account-load";let B=!!L.currentUser,K=!1;const $=new Set;let z=null;function G(){K=!0}function Q(){return L.currentUser}function X(t){e?Promise.resolve():W||(W=s(()=>import("./sentryHeavy-BKpXVZnK.js"),__vite__mapDeps([0,1,2,3])).then(e=>e.addHeavyIntegrations()).catch(e=>{console.warn("[sentryLazy] heavy integrations failed to load:",e)})),V();let h=null,g=null,y=null,w=null,b=null;const G="auth-session-expired";let Q=!1,X=0,Z=null;const q=()=>{Z&&(clearInterval(Z),Z=null)},J=(e,s)=>{const n=v(N,"users",e.uid);let r=!1,a=!1;const g={perf:performance.now(),wall:Date.now()};let y=null,U=!1,b=-1/0;V(),q(),Z=setInterval(()=>{if(r||Q)return void q();const e=f(),s=performance.now(),n=Date.now(),p=o(i(g,e.lastSettledAt),s,n);!e.inFlight&&l(p)&&!U&&s-b>=c&&(U=!0,b=s,F().then(e=>{y=e}).finally(()=>{U=!1}));const m=u({totalElapsedMs:o(g,s,n),readElapsedMs:p,mintInFlight:e.inFlight,challengeVisible:e.challengeVisible,mintBlocked:e.blocked,lastMintFailed:e.lastMintFailed,linkAlive:y,listenerErrored:a,snapshotSettled:r});"failed"===m.phase&&(q(),console.warn(`[authEngine] users/{uid} first snapshot did not arrive (${m.reason}) — showing the account-load retry screen`),d(m.reason??null),t.setUserDocError(!0),t.setUserDocLoaded(!0),t.setLoading(!1))},p),h=j(n,n=>{var a,o,i,l,c,u,p,f,h;if((h={exists:n.exists(),fromCache:n.metadata.fromCache}).exists||!h.fromCache)if(r=!0,q(),d(null),t.setUserDocError(!1),n.exists()){const s=n.data(),r=I(s),u=r.role;t.setTenantId(r.tenantId),null==(a=t.setNoVenueAccess)||a.call(t,r.noVenueAccess),t.setRole(u),null==(o=t.setVenues)||o.call(t,C(s)),null==(i=t.setAccountId)||i.call(t,"string"==typeof s.accountId&&s.accountId?s.accountId:null),A("superadmin"===u),t.setUserOnboardingStep("number"==typeof s.onboardingStep?s.onboardingStep:null),t.setUserFirstName("string"==typeof s.firstName?s.firstName:null),t.setUserLastName("string"==typeof s.lastName?s.lastName:null),O(e.uid,k(s)),t.setUserPhoneNumber("string"==typeof s.phoneNumber?s.phoneNumber:null),t.setUserHowDidYouHear("string"==typeof s.howDidYouHear?s.howDidYouHear:null),null==(l=t.setUserAppStartPage)||l.call(t,M(s.appStartPage)),null==(c=t.setUserTrialEndedNoticeDismissals)||c.call(t,_(s.trialEndedNoticeDismissals));const d=s.notificationPrefs??null;t.setUserNotificationPrefs({...m,...d||{}});const p=s.inAppNotificationPrefs??{};t.setUserInAppNotificationPrefs(p&&"object"==typeof p?p:{});const f=s.lastReadWhatsNew,h=(null==f?void 0:f.toMillis)?f.toMillis():"number"==typeof f?f:null;t.setUserLastReadWhatsNew(h);const g=s.themePreference,y="light"===g||"dark"===g||"system"===g?g:null,w=H();x({remote:y,local:w,hasPendingWrites:n.metadata.hasPendingWrites,nowMs:Date.now()})?t.setUserThemePreference(y):w&&t.setUserThemePreference(w.value),t.setUserDocLoaded(!0),t.setLoading(!1);!0===s.staffPortal||!("owner"===u||"admin"===u||"superadmin"===u)||$.has(e.uid)||($.add(e.uid),(async()=>{try{const e=await S();await T(e,navigator.userAgent||"")}catch(e){console.warn("[device tracking] failed:",e)}})())}else{s||(t.setTenantId(null),t.setRole(null),null==(u=t.setVenues)||u.call(t,{}),null==(p=t.setNoVenueAccess)||p.call(t,!1),null==(f=t.setAccountId)||f.call(t,null),A(!1),t.setUserOnboardingStep(null),t.setUserFirstName(null),t.setUserLastName(null),O(e.uid,null),t.setUserPhoneNumber(null),t.setUserHowDidYouHear(null),t.setUserNotificationPrefs(null),t.setUserInAppNotificationPrefs(null),t.setUserLastReadWhatsNew(null),t.setUserThemePreference(null));"undefined"!=typeof sessionStorage&&sessionStorage.getItem("staffSession")?(t.setUserDocLoaded(!0),t.setLoading(!1)):(w&&clearTimeout(w),w=setTimeout(()=>{w=null,t.setUserDocLoaded(!0),t.setLoading(!1)},3e3))}},e=>{r=!0,a=!0,q(),console.error("Error subscribing to user document:",e),d("listener-error"),t.setUserDocError(!0),t.setUserDocLoaded(!0),t.setLoading(!1)})},ee=()=>{if(Q)return;const e=L.currentUser;if(!e)return;h&&(h(),h=null);const s=f();!s.blocked&&!0!==s.lastMintFailed||"undefined"==typeof window||window.dispatchEvent(new CustomEvent("resoflow:appcheck-retry")),t.setUserDocError(!1),t.setUserDocLoaded(!1),J(e,!0)};"undefined"!=typeof window&&window.addEventListener(Y,ee);const se=()=>{if(Q)return;if("visible"!==document.visibilityState)return;const e=L.currentUser;e&&E(e)&&P(e).then(e=>{e&&(K=!0)}).catch(()=>{})};"undefined"!=typeof document&&document.addEventListener("visibilitychange",se);const te=U(L,e=>{const o=++X;if(y&&(clearTimeout(y),y=null),w&&(clearTimeout(w),w=null),b&&(clearTimeout(b),b=null),e&&D.dismiss(G),q(),h&&(h(),h=null),e){const s=g===e.uid;g=e.uid,B=!0,K=!1;const i=()=>{Q||o!==X||(r(z,e.uid)&&(a(t),A(!1),R()),z=e.uid,t.setUser(e),n.setUser({id:e.uid,email:e.email||void 0}),J(e,s))};s?i():P(e).then(e=>{e?K=!0:i()}).catch(()=>i())}else y=setTimeout(()=>{var e,r,a;y=null;B&&!K&&(b=setTimeout(()=>{b=null,D.error("Your session expired — please sign in again.",void 0,{id:G,duration:5e3})},3e3)),g=null,z=null,B=!1,K=!1,$.clear(),s(()=>import("./marketingListCache-CRe1obHU.js"),[]).then(e=>e.clearAllMarketingCaches()).catch(()=>{}),n.setUser(null),t.setUser(null),t.setTenantId(null),t.setRole(null),null==(e=t.setVenues)||e.call(t,{}),null==(r=t.setNoVenueAccess)||r.call(t,!1),null==(a=t.setAccountId)||a.call(t,null),A(!1),t.setUserOnboardingStep(null),t.setUserFirstName(null),t.setUserLastName(null),t.setUserPhoneNumber(null),t.setUserHowDidYouHear(null),t.setUserNotificationPrefs(null),t.setUserInAppNotificationPrefs(null),t.setUserLastReadWhatsNew(null),t.setUserThemePreference(null),t.setUserDocLoaded(!1),t.setUserDocError(!1),t.setLoading(!1)},1500)});return()=>{Q=!0,q(),"undefined"!=typeof window&&window.removeEventListener(Y,ee),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",se),y&&clearTimeout(y),w&&clearTimeout(w),b&&clearTimeout(b),te(),h&&h()}}async function Z(){const e=new g;await y(L,e)}async function q(e,s){await h(L,e,s)}async function J(e,s){await w(L,e,s)}async function ee(){K=!0,await t({signOut:()=>b(L),clearCaches:async()=>{const{clearSupportThreadCaches:e,clearSupportThreadOpenKey:t}=await s(async()=>{const{clearSupportThreadCaches:e,clearSupportThreadOpenKey:s}=await import("./supportInboxService-BtY28HVl.js");return{clearSupportThreadCaches:e,clearSupportThreadOpenKey:s}},__vite__mapDeps([4,5,2,6,7,8,1,3,9,10,11,12,13,14,15,16]));e(),t();const{clearAllMarketingCaches:n}=await s(async()=>{const{clearAllMarketingCaches:e}=await import("./marketingListCache-CRe1obHU.js");return{clearAllMarketingCaches:e}},[]);n()},releasePush:async()=>{const{releasePushForSignOut:e}=await s(async()=>{const{releasePushForSignOut:e}=await import("./pushClient-BF_uSDi-.js").then(e=>e.p);return{releasePushForSignOut:e}},__vite__mapDeps([17,1,2,3,12,7,6,8,9,13]));await e()}})}
2export{Y as RETRY_ACCOUNT_LOAD_EVENT,Q as getCurrentUser,q as loginWithEmail,Z as loginWithGoogle,ee as logout,G as markUserInitiatedSignOut,J as registerWithEmail,X as startAuthEngine};
3//# sourceMappingURL=authEngine-BpTd9KNg.js.map

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.