PageSourceSearch

https://fleetweb.standardfleet.com/assets/authentication-BI4ezVYR.js

js standardfleet.com collected 2026-09-25 02:42:37 UTC 2,399 bytes, 2 lines download raw bytes

1import{a as e}from"./chunk-Cyuzqnbw.js";import{t}from"./react-Bi8cP4Js.js";import{T as n,t as r}from"./communication-BzfdRHS-.js";import{D as i,r as a,t as o,u as s}from"./useMutation-JCJFZVvk.js";var c=e(t(),1);function l(e,t){let n=a(t);return d({filters:{...e,status:`pending`}},n).length}function u(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function d(e={},t){let n=a(t).getMutationCache(),r=c.useRef(e),o=c.useRef(null);return o.current===null&&(o.current=u(n,e)),c.useEffect(()=>{r.current=e}),c.useSyncExternalStore(c.useCallback(e=>n.subscribe(()=>{let t=i(o.current,u(n,r.current));o.current!==t&&(o.current=t,s.schedule(e))}),[n]),()=>o.current,()=>o.current)}var f=class extends Error{},p=new f;function m(e){return e instanceof f}var h=class extends Error{constructor(e){super(e==null?`Login failed: no response from server`:`Login failed with server status ${e}`),this.status=e,this.name=`LoginServerError`}},g={state:`unknown`,data:void 0},_={state:`logged_out`,data:void 0};function v(e){return`needs_secondary_email`in e}function y(e){return`bearer_token`in e}var b=[`userLogin`];function x(e){localStorage.setItem(`bearer_token`,e)}
1function S(){return o({mutationKey:b,gcTime:2*86400*1e3,mutationFn:e=>{let t=e?void 0:localStorage.getItem(`bearer_token`),i=new AbortController,a=setTimeout(()=>i.abort(),5*1e3);return r({url:`/v1/overview`,method:`POST`,bearerToken:t,body:e,signal:i.signal}).then(e=>{if(e&&e.status==200)return e.json();if(e&&(e.status==401||e.status==403))throw new f;let t=new h(e?.status);throw e&&n.addError(t),t}).then(e=>{let t=e;return y(t)&&x(t.bearer_token),t}).finally(()=>clearTimeout(a))}})}function C(){return o({mutationKey:b,gcTime:2*86400*1e3,mutationFn:e=>r({url:`/v1/oauth_login`,method:`POST`,body:e}).then(async e=>{if(!e)throw Error();let t=await e.json();if(e.status==200){let e=t;return localStorage.setItem(`bearer_token`,e.bearer_token),t}else throw t})})}function w(){return o({mutationKey:b,gcTime:2*86400*1e3,mutationFn:()=>(localStorage.removeItem(`bearer_token`),Promise.reject(new f))})}function T(){let e=d({filters:{mutationKey:b},select:e=>e.state.data&&y(e.state.data)?{state:`logged_in`,data:e.state.data}:e.state.data||e.state.error?_:g});return e.length>0?e.slice(-1)[0]:g}export{T as a,C as c,x as i,l,v as n,S as o,m as r,w as s,p as t,d as u};
2//# sourceMappingURL=authentication-BI4ezVYR.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.