PageSourceSearch

https://connections.icu/assets/boot-aegis-bearer-client-Ctb3OF33.js

js connections.icu collected 2026-10-02 01:02:20 UTC 31,068 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/media-U1n7udq9.js","assets/rolldown-runtime-hePW80VL.js","assets/app-shared-BkUJ2nm4.js","assets/legacy-browser-polyfills-DajVwVs5.js","assets/vendor-vue-BZLFRIHw.js","assets/vendor-aws-BvgeiiVI.js"])))=>i.map(i=>d[i]);
2import{$s as e,Bc as t,Ds as n,Es as r,Fo as i,Io as a,Ms as o,Ns as s,Oc as c,Os as l,Ps as u,Qs as d,Ts as ee,Wo as f,Zs as te,ds as p,ec as ne,js as re,ks as ie,ls as m,ps as h,ss as g,us as _,ws as v,xs as y,ys as ae,zc as oe}from"./app-shared-BkUJ2nm4.js";import{c as b}from"./vendor-aws-BvgeiiVI.js";function se(e,t){return e[t]===!0}function ce(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=t.phone,r=typeof n==`string`&&n.trim()?n.trim():null;return{emailVerified:se(t,`emailVerified`),phone:r,phoneVerified:se(t,`phoneVerified`)}}var le=`/dev-session-broker`,ue=`cx-dev-session-request`,de=`cx-dev-session`,fe=15e3,pe=250;function x(){return typeof window<`u`&&!!window.location.hostname&&oe.test(window.location.hostname)}async function me(){if(typeof window>`u`||typeof document>`u`)return null;let{hostname:e,protocol:t,origin:n}=window.location;if(!e||!oe.test(e))return null;let r=c(`accounts`,e,t);return r===n?null:new Promise(e=>{let t=!1,n=document.createElement(`iframe`);n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1,n.style.cssText=`position:absolute;width:0;height:0;border:0;visibility:hidden;left:-9999px`,n.src=`${r}${le}`;let i=r=>{t||(t=!0,window.removeEventListener(`message`,a),window.clearInterval(s),window.clearTimeout(c),n.remove(),e(r))},a=e=>{if(e.origin!==r)return;let t=e.data;if(!t||t.type!==de)return;let n=t.session;i(n&&typeof n.accessToken==`string`&&typeof n.idToken==`string`?{accessToken:n.accessToken,idToken:n.idToken,expiresIn:n.expiresIn,userSub:n.userSub}:null)},o=()=>{try{n.contentWindow?.postMessage({type:ue},r)}catch{}};n.addEventListener(`load`,o);let s=window.setInterval(o,pe),c=window.setTimeout(()=>i(null),fe);window.addEventListener(`message`,a),document.body.appendChild(n),fetch(`${r}${le}`,{mode:`no-cors`,cache:`no-store`}).catch(()=>i(null))})}var S=`CXDEVSESSION.v1:`;function he(){if(!x())return null;try{let e=window.name;if(!e||!e.startsWith(S))return null;window.name=``;let t=JSON.parse(e.slice(16));return typeof t.accessToken!=`string`||typeof t.idToken!=`string`?null:{accessToken:t.accessToken,idToken:t.idToken,refreshToken:typeof t.refreshToken==`string`?t.refreshToken:void 0,expiresAt:typeof t.expiresAt==`number`?t.expiresAt:void 0,userSub:typeof t.userSub==`string`?t.userSub:void 0}}catch{return null}}var C=new Set([`co.uk`,`org.uk`,`ac.uk`,`gov.uk`,`co.jp`,`ne.jp`,`or.jp`,`co.nz`,`co.za`,`com.au`,`net.au`,`org.au`,`com.br`,`com.mx`,`co.in`,`co.id`,`com.sg`,`com.hk`,`co.kr`]);function w(e){let t=e.split(`.`);if(t.length<=2)return e;let n=t.slice(-2).join(`.`),r=C.has(n)?3:2;return t.slice(-r).join(`.`)}function ge(e){if(typeof window>`u`||x()||t(window.location.origin))return!1;try{return w(window.location.hostname)!==w(new URL(e).hostname)}catch{return!1}}var _e=class extends Error{constructor(e,t){super(e),b(this,`status`,void 0),this.status=t,this.name=`ProfilePhotoUploadError`}};async function ve(e,t){let n=(e??``).trim();if(!/^data:image\//i.test(n))return t.landImageSource(n);let r=n;try{let{optimizeImageSourceToDataUrl:e}=await y(async()=>{let{optimizeImageSourceToDataUrl:e}=await import(`./media-U1n7udq9.js`).then(e=>e.a);return{optimizeImageSourceToDataUrl:e}},__vite__mapDeps([0,1,2,3,4,5]));r=await e(n,{maxEdge:1024,quality:.8})}catch(e){console.warn(`[profile-photo] optimize failed; uploading original`,v(e,String(e)))}return t.landImageSource(r)}async function ye(e){let t=await e.json().catch(()=>null);if(!e.ok)throw new _e(typeof t?.error==`string`&&t.error||`Update profile photo failed (${e.status}).`,e.status);return typeof t?.image==`string`?t.image:``}function be(e){return Array.isArray(e)?Array.from(new Set(e.map(e=>typeof e==`string`?e.trim():``).filter(Boolean))):typeof e!=`string`||!e.trim()?[]:Array.from(new Set(e.split(/[\s,]+/).map(e=>
2e.trim()).filter(Boolean)))}function xe(e){let t=new Set(be(e.system_roles));return e.role===`admin`&&t.add(`admin`),Array.from(t)}function T(e){return xe(e).includes(`admin`)}var Se=`purpose`,Ce=[`deal-flow-invite`,`contact-sales`,`event-rsvp`];function E(e){return Ce.find(t=>t===e)??null}var we=`name_hint`,D=120;function O(e){return(e??``).trim().slice(0,D).trim()}var Te=`origin_page`,Ee=`origin_touch`,De=300,Oe=1200;function ke(e){let t=(e??``).trim();if(!t.startsWith(`/`)||t.startsWith(`//`))return null;let n=t.split(/[?#]/,1)[0]??``;return n?n.slice(0,De):null}function Ae(e){let{channel:t,referrerHandle:n,utmSource:r,utmMedium:i,utmCampaign:a,landingUrl:o,referrerHost:s,firstTouchAt:c}=e,l={channel:t,referrerHandle:n,utmSource:r,utmMedium:i,utmCampaign:a,landingUrl:o,referrerHost:s,firstTouchAt:c},u=JSON.stringify(l);if(u.length<=Oe)return u;let d=JSON.stringify({...l,landingUrl:null});return d.length<=Oe?d:null}var je=`september-2026`,k=[`pre-versioning`,`april-2026`,`july-2026`,`september-2026`];function Me(e){let t=k.indexOf(e);return t<0?!1:t>=k.indexOf(je)}var A=`pre-versioning`,j=`connections.cookie-consent.v1`,M=`connections_consent`,Ne=33696e3,N=`connections:cookie-consent-decided`,P=`connections:cookie-consent-synced`;function F(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(t.version!==1||t.decision!==`accepted-all`&&t.decision!==`rejected-all`&&t.decision!==`custom`||!t.categories||typeof t.categories!=`object`||t.categories.functional!==!0||typeof t.categories.analytics!=`boolean`||typeof t.categories.personalization!=`boolean`||typeof t.timestamp!=`number`)}function I(e){if(F(e)){let t=typeof e.categories.preciseLocation==`boolean`,n=typeof e.policyVersion==`string`&&e.policyVersion?e.policyVersion:null;return{version:1,decision:e.decision,categories:{functional:!0,analytics:e.categories.analytics,personalization:e.categories.personalization,preciseLocation:e.categories.preciseLocation===!0},timestamp:e.timestamp,policyVersion:t&&n?n:A}}if(!e||typeof e!=`object`)return null;let t=e;if(t.schemaVersion!==1||typeof t.analytics!=`boolean`||typeof t.decidedAt!=`string`||t.decidedAt.length===0)return null;let n=Date.parse(t.decidedAt);return Number.isFinite(n)?{version:1,decision:t.analytics?`custom`:`rejected-all`,categories:{functional:!0,analytics:t.analytics,personalization:!1,preciseLocation:!1},timestamp:n,policyVersion:A}:null}function Pe(e){return{...e,schemaVersion:1,analytics:e.categories.analytics,decidedAt:new Date(e.timestamp).toISOString()}}function L(){return i(M,I)}function Fe(e){a(M,e,Ne,e=>JSON.stringify(e))}function Ie(){return I(g(j))}function Le(e){e===null?_(j):p(j,Pe(e))}function Re(){return L()??Ie()}function R(e){if(!(typeof window>`u`||typeof CustomEvent!=`function`))try{window.dispatchEvent(new CustomEvent(N,{detail:{record:e,analytics:e.categories.analytics,decidedAt:new Date(e.timestamp).toISOString()}}))}catch{}}function ze(e){if(!(typeof window>`u`||typeof CustomEvent!=`function`))try{window.dispatchEvent(new CustomEvent(P,{detail:{analytics:e.categories.analytics,decidedAt:new Date(e.timestamp).toISOString()}}))}catch{}}var Be=`connections.first-touch-attribution.v1`,Ve=1,He=`cx_ft`,Ue=7776e3,We=512,z=null;function B(e){if(typeof e!=`string`)return null;let t=e.trim();return t?t.length>We?t.slice(0,We):t:null}function V(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.channel==`string`&&typeof t.firstTouchAt==`string`}function H(){if(z)return z;let e=m(Be,Ve,{validate:V});if(e)return z=e,e;let t=Ge();return t&&(z=t),t}function Ge(){if(typeof document>`u`)return null;try{let e=document.cookie.split(`; `).find(e=>e.startsWith(`${He}=`));if(!e)return null;let t=decodeURIComponent(e.slice(6)),n=JSON.parse(t);return V(n)?n:null}catch{return null}}function U(e){if(!(typeof document>`u`))try{let t=encodeURIComponent(JSON.stringify(e)),n=typeof window<`u`&&window.location.protocol===`https:`?`; Secure`:``;document.cookie=`${He}=${t}; Max-Age=${Ue}; Path=/; SameSite=Lax${n}`}catch{}}function W(){return Re()?.categories.analytics===!0}function Ke(e){z=e,W()&&(h(Be,Ve,e),U(e))}function qe(){if(_(Be),!(typeof document>`u`))try{document.cookie=`${He}=; Max-Age=0; Path=/; SameSite=Lax`}catch{}}var G=!1;function Je(){G||typeof window>`u`||(G=!0,window.addEventListener(N,()=>{W()?z&&Ke(z):qe()}
2))}var Ye=/^[A-Za-z0-9_-]{8,255}$/;function Xe(e){let t=B(e);return t&&Ye.test(t)?t:null}function Ze(e){let t=Xe(e.get(`client_id`));if(t)return t;let n=e.get(`return`);if(!n)return null;try{return Xe(new URL(n,`https://accounts.invalid`).searchParams.get(`client_id`))}catch{return null}}function Qe(e,t){let n=B(e.get(`plusone`));if(n)return{channel:`plus_one`,referrerHandle:n};let r=B(e.get(`ref`))??B(e.get(`from`));return r?{channel:`referral`,referrerHandle:r}:/^\/intro\//i.test(t)?{channel:`intro_link`,referrerHandle:B(t.replace(/^\/intro\//i,``).split(/[/?#]/)[0]??``)}:B(e.get(`utm_source`))||B(e.get(`utm_campaign`))||B(e.get(`utm_medium`))||$e(e)?{channel:`utm`,referrerHandle:null}:Ze(e)?{channel:`oauth_app`,referrerHandle:null}:{channel:`direct`,referrerHandle:null}}function $e(e){return e.has(`gclid`)||e.has(`gbraid`)||e.has(`wbraid`)||e.has(`dclid`)?{clickIdClass:`google`,source:`google`,medium:`cpc`}:e.has(`fbclid`)?{clickIdClass:`facebook`,source:`facebook`,medium:`paid-social`}:e.has(`msclkid`)?{clickIdClass:`bing`,source:`bing`,medium:`cpc`}:e.has(`ttclid`)?{clickIdClass:`tiktok`,source:`tiktok`,medium:`paid-social`}:e.has(`li_fat_id`)?{clickIdClass:`linkedin`,source:`linkedin`,medium:`paid-social`}:e.has(`twclid`)?{clickIdClass:`x`,source:`x`,medium:`paid-social`}:e.has(`sccid`)?{clickIdClass:`snapchat`,source:`snapchat`,medium:`paid-social`}:e.has(`rdt_cid`)?{clickIdClass:`reddit`,source:`reddit`,medium:`paid-social`}:null}function et(){if(typeof document>`u`||!document.referrer)return null;try{let e=new URL(document.referrer);return typeof window<`u`&&e.origin===window.location.origin?null:B(e.host)}catch{return null}}function tt(){if(typeof window>`u`)return null;Je();let e=H(),t=new URLSearchParams(window.location.search),n=window.location.pathname||`/`,{channel:r,referrerHandle:i}=Qe(t,n),a=$e(t);if(e)return e;let o={channel:r,referrerHandle:i,utmSource:B(t.get(`utm_source`))??a?.source??null,utmMedium:B(t.get(`utm_medium`))??a?.medium??null,utmCampaign:B(t.get(`utm_campaign`)),utmContent:B(t.get(`utm_content`)),utmTerm:B(t.get(`utm_term`)),clickIdClass:a?.clickIdClass??null,landingUrl:B(n),referrerHost:et(),oauthClientId:Ze(t),firstTouchAt:new Date().toISOString()};return Ke(o),f(`first_touch_captured`,{app:`connections`,channel:o.channel,referrer_handle:o.referrerHandle??void 0,utm_source:o.utmSource??void 0,utm_medium:o.utmMedium??void 0,utm_campaign:o.utmCampaign??void 0,utm_content:o.utmContent??void 0,utm_term:o.utmTerm??void 0,click_id_class:o.clickIdClass??void 0,referrer_host:o.referrerHost??void 0,landing_path:o.landingUrl??void 0,oauth_client_id:o.oauthClientId??void 0}),o}function nt(){return H()}function rt(){let e=H();return qe(),z=null,e}function it(){let e=H();return e?{channel:e.channel,referrerHandle:e.referrerHandle,utmSource:e.utmSource,utmMedium:e.utmMedium,utmCampaign:e.utmCampaign,landingUrl:e.landingUrl,referrerHost:e.referrerHost,oauthClientId:e.oauthClientId??null,firstTouchAt:e.firstTouchAt}:null}var at=36e5,ot=6e4,K=`cx-tab-account`,q=`cx-u`,J=`u`,Y=`${K}-pending-index`,st=`${K}-detail`,X=`${K}-index`;function Z(){try{return(typeof window<`u`?window.sessionStorage.getItem(K):null)?.trim()||null}catch{return null}}function ct(e){try{typeof window<`u`&&e.trim()&&window.sessionStorage.setItem(K,e.trim())}catch{}}function lt(){if(typeof window>`u`)return null;try{let e=new URL(window.location.href).searchParams,t=e.get(J)?.trim();return t&&/^\d+$/.test(t)?t:e.get(q)?.trim()||null}catch{return null}}function ut(){try{let e=typeof window<`u`?window.sessionStorage.getItem(Y):null;if(!e)return null;let t=Number(e);return Number.isInteger(t)&&t>=0?t:null}catch{return null}}function dt(){try{typeof window<`u`&&window.sessionStorage.removeItem(Y)}catch{}}function ft(){try{let e=typeof window<`u`?window.sessionStorage.getItem(X):null;if(!e)return null;let t=Number(e);return Number.isInteger(t)&&t>=0?t:null}catch{return null}}function Q(e=!1){try{typeof window<`u`&&(window.sessionStorage.removeItem(K),window.sessionStorage.removeItem(Y),window.sessionStorage.removeItem(st),window.sessionStorage.removeItem(X))}catch{}if(e&&!(typeof window>`u`))try{let e=new URL(window.location.href);if(!pt(e))return;window.history.replaceState(window.history.state,``,e.pathname+e.search+e.hash)}catch{}}function pt(e){let t=e.searchParams.has(J)||e.searchParams.has(q);return e.searchParams.delete(J),e.searchParams.delete(q),t}function mt(e){let t=`https://return.invalid`;try{let n=new URL(e,t);return pt(n)?n.origin===t?n.pathname+n.search+n.hash:n.href:e}catch{return e}}function ht(){if(typeof window>`u`)return;let e;try{e=new URL(window.location.href)}catch{return}let t=e.searchParams.get(J)?.trim();if(t&&/^\d+$/.test(t)){let e=Number(t);if(Z()!==null&&ft()===e)return;if(Z()!==null)try{window.sessionStorage.removeItem(K),window.sessionStorage.removeItem(st),window.sessionStorage.removeItem(X)}catch{}try{window.sessionStorage.setItem(Y,t)}catch{}return}let n=e.searchParams.get(q)?.trim();if(n&&Z()!==n){try{window.sessionStorage.removeItem(st),window.sessionStorage.removeItem(X),window.sessionStorage.removeItem(Y)}catch{}ct(n)}}function gt(e){if(!(typeof window>`u`)&&!(typeof e!=`number`||!Number.isInteger(e)||e<0))try{let t=new URL(window.location.href);if(!t.searchParams.has(q))return;t.searchParams.delete(q),t.searchParams.set(J,String(e)),window.sessionStorage.setItem(X,String(e)),window.history.replaceState(window.history.state,``,t.pathname+t.search+t.hash)}catch{}}
2var $=class extends Error{constructor(e,t,n){super(e),b(this,`code`,void 0),b(this,`status`,void 0),this.code=t,this.status=n,this.name=`AegisAuthError`}};function _t(e,t){try{let n=e.split(`.`)[1]??``,r=atob(n.replace(/-/g,`+`).replace(/_/g,`/`)),i=JSON.parse(r),a=e=>typeof i[e]==`string`?i[e]:null;return{sub:a(`sub`)??t,email:a(`email`),name:a(`name`)??a(`given_name`),picture:l(a(`picture`)),isAdmin:T(i),systemRoles:xe(i)}}catch{return{sub:t,email:null,name:null,picture:null,isAdmin:!1,systemRoles:[]}}}function vt(e,t,n){let r=t?new URL(t,n.origin).href:n.href;return`${e}/dev-handoff?returnTo=${encodeURIComponent(r)}`}function yt(e){let t=typeof e==`string`?new URLSearchParams(e):e,n=(t.get(`email`)??t.get(`login_hint`)??``).trim(),r=t.get(`mode`)===`signup`?`signup`:void 0,i=O(t.get(`name`)),a=E(t.get(Se));if(!(!n&&!r&&!i&&!a))return{...n?{email:n}:{},...r?{mode:r}:{},...i?{name:i}:{},...a?{purpose:a}:{}}}function bt(e,t){if(e)return{prompt:`none`};let n={},r=(t?.email??``).trim();r&&(n.login_hint=r),t?.mode===`signup`&&(n.prompt=`create`),t?.purpose&&(n[Se]=t.purpose);let i=O(t?.name);return i&&(n[we]=i),n}function xt(e,t,n){if(e)return{};let r={},i=ke(t);i&&(r[Te]=i);let a=n?Ae(n):null;return a&&(r[Ee]=a),r}function St(i){let a=i.stateKeyPrefix,l=`/${(i.routeBase??`/`).replace(/^\/+|\/+$/g,``)}/`.replace(/^\/\/$/,`/`),f=(i.directSessionOrigin||d).replace(/\/+$/,``),p=`${f}/auth/refresh`,m=`${f}/auth/me`,h=null,g=new Set,_=0,y=`${a}dev-session.v1`;function oe(e){if(x())try{window.localStorage.setItem(y,JSON.stringify({accessToken:e.accessToken,idToken:e.idToken,expiresAt:e.expiresAt,sub:e.identity.sub,refreshToken:e.refreshToken}))}catch{}}function b(){if(x())try{window.localStorage.removeItem(y)}catch{}}function se(){if(!x())return null;try{let e=window.localStorage.getItem(y);if(!e)return null;let t=JSON.parse(e);return typeof t.accessToken!=`string`||typeof t.idToken!=`string`||typeof t.expiresAt!=`number`||Date.now()>=t.expiresAt-ot?null:{accessToken:t.accessToken,idToken:t.idToken,identity:_t(t.idToken,typeof t.sub==`string`?t.sub:``),expiresAt:t.expiresAt,refreshToken:typeof t.refreshToken==`string`?t.refreshToken:void 0}}catch{return null}}function le(){let e=he();if(!(!e||typeof e.expiresAt!=`number`))try{window.localStorage.setItem(y,JSON.stringify({accessToken:e.accessToken,idToken:e.idToken,expiresAt:e.expiresAt,sub:e.userSub??``,refreshToken:e.refreshToken})),ie(_t(e.idToken,e.userSub??``))}catch{}}let ue=`${a}central-session.v1`,de=`${a}central-bounce.v1`;function fe(){try{let e=window.sessionStorage.getItem(de);if(e===null)return 0;let t=Number.parseInt(e,10);return!Number.isFinite(t)||t<1?2:t}catch{return 2}}function pe(e,t){if(!(typeof e.switchToken!=`string`||!e.switchToken||!t||typeof window>`u`))try{let n={switchToken:e.switchToken,sub:t,...typeof e.deviceId==`string`&&e.deviceId?{deviceId:e.deviceId}:{}};window.localStorage.setItem(ue,JSON.stringify(n))}catch{}}function S(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(ue);if(!e)return null;let t=JSON.parse(e);return!t||typeof t.switchToken!=`string`||!t.switchToken||typeof t.sub!=`string`?null:{switchToken:t.switchToken,sub:t.sub,...typeof t.deviceId==`string`?{deviceId:t.deviceId}:{}}}catch{return null}}function C(){if(!(typeof window>`u`))try{window.localStorage.removeItem(ue)}catch{}}function w(){let e=S();return e?.deviceId?{authorization:`Device ${e.switchToken}.${e.deviceId}`}:{}}function be(){let e=S()?.deviceId;return e?{deviceId:e}:{}}function xe(e,t){return{switchToken:e.switchToken,...e.deviceId?{deviceId:e.deviceId}:{},...t?{scope:t}:{}}}async function T(e,t=`refresh`){try{return await fetch(p,{method:`POST`,credentials:`include`,headers:e?{"content-type":`application/json`,accept:`application/json`}:{accept:`application/json`},...e?{body:JSON.stringify(e)}:{}})}catch(e){throw new $(v(e,`Network error during ${t}.`),`AUTH_ERROR`)}}function Se(){if(typeof window>`u`||typeof document>`u`)return!1;try{if(window.parent!==window.self)return!1}catch{return!1}return x()||t(window.location.origin)||!o()?!1:fe()<2}function Ce(){return ge(f)}let E=!1;async function we(){try{window.sessionStorage.setItem(de,String(fe()+1))}catch{return}E=!0;let e=`${Ae(window.location.pathname)}${window.location.search}${window.location.hash}`;try{window.location.assign(await k(!0,e))}catch(e){throw E=!1,e}}function D(e){throw je()?new $(`Sign-in completion in progress.`,`AUTH_ERROR`,e):E?new $(`Redirecting to the central session.`,`AUTH_ERROR`,e):Se()?(we(),new $(`Redirecting to the central session.`,`AUTH_ERROR`,e)):new $(`Signed out.`,`SIGNED_OUT`,e)}function O(){return Ce()&&!S()&&!o()}function Te(){if(!x())return null;try{let e=window.localStorage.getItem(y);if(!e)return null;let t=JSON.parse(e);return typeof t.refreshToken==`string`&&t.refreshToken?t.refreshToken:null}catch{return null}}le(),h=se(),h&&ae(h.identity.isAdmin??!1);function Ee(e){for(let t of[...g])try{t(e)}catch{}}function De(e,t){try{sessionStorage.setItem(`${a}${e}`,JSON.stringify(t));for(let e=sessionStorage.length-1;e>=0;--e){let t=sessionStorage.key(e);if(!(!t?.startsWith(a)||t===de))try{let e=JSON.parse(sessionStorage.getItem(t)??``);(!e?.createdAt||Date.now()-e.createdAt>at)&&sessionStorage.removeItem(t)}catch{sessionStorage.removeItem(t)}}}catch{}}function Oe(e){try{let t=sessionStorage.getItem(`${a}${e}`);return t?JSON.parse(t):null}catch{return null}}function ke(){return`${window.location.origin}${l}
2aegis/callback`}function Ae(e){return l===`/`?e:`${e}/`===l?`/`:e.startsWith(l)?`/${e.slice(l.length)}`:e}function je(){return typeof window<`u`&&window.location.pathname===new URL(ke()).pathname}async function k(t,n,r){let i=e(48),a=e(24),o=await ne(i),s=ke();De(a,{verifier:i,redirectUri:s,returnTo:n??`/`,createdAt:Date.now(),...t?{silent:!0}:{}});let c=new URL(`${d}/oauth/authorize`);c.searchParams.set(`client_id`,te),c.searchParams.set(`redirect_uri`,s),c.searchParams.set(`response_type`,`code`),c.searchParams.set(`scope`,`profile photo`),c.searchParams.set(`state`,a),c.searchParams.set(`code_challenge`,o),c.searchParams.set(`code_challenge_method`,`S256`);for(let[e,n]of Object.entries(bt(t,r)))c.searchParams.set(e,n);for(let[e,r]of Object.entries(xt(t,n,t?null:it())))c.searchParams.set(e,r);return c.toString()}async function Me(e,n){if(!E){if(typeof window<`u`&&t(window.location.origin)){let t=c(`accounts`,window.location.hostname,window.location.protocol);window.location.assign(vt(t,e,window.location));return}window.location.assign(await k(!1,e,n))}}async function A(e){return k(!0,e)}function j(e,t){if(t!==void 0&&t!==_)throw new $(`Signed out while this session refresh was in flight.`,`SIGNED_OUT`);let n=typeof e.expiresIn==`number`&&e.expiresIn>0?e.expiresIn:3600,r=_t(e.idToken,e.userSub??``),i=ce(e.profile);return i&&(r.profileFacts=i),h={accessToken:e.accessToken,idToken:e.idToken,identity:r,expiresAt:Date.now()+n*1e3,refreshToken:e.refreshToken},ie(h.identity),oe(h),pe(e,h.identity.sub),re(h.identity.sub),ae(h.identity.isAdmin??!1),Ee(h.identity),Pe(),h}function M(){let e=h!==null;_+=1,h=null,b(),C(),r(),ae(!1),Pe(),e&&Ee(null)}async function Ne(e,t,n=_){let r=S();if(r&&r.sub===e)return N(xe(r,`tab`),n);t===void 0&&O()&&D();let i=t!==void 0,a=t??[];if(t===void 0&&({accounts:a,read:i}=await W()),i||(await new Promise(e=>setTimeout(e,400)),{accounts:a}=await W()),a.length===0)throw!r&&Ce()&&D(),new $(`Device chooser unreachable during tab-scoped refresh.`,`AUTH_ERROR`);let o=a.find(t=>t.sub===e);if(!o?.switchToken||o.isAlive===!1)throw Q(),new $(`Pinned account is no longer signed in on this device.`,`SIGNED_OUT`);return N({switchToken:o.switchToken,...be(),scope:`tab`},n,o.index)}async function N(e,t,n){let r=await T(e,`tab-scoped refresh`),i=await r.json().catch(()=>null);if(!r.ok){let t=typeof i?.code==`string`?i.code:``;throw r.status===401||t===`NO_REFRESH_COOKIE`||t===`INVALID_REFRESH`?(Q(),S()?.switchToken===e.switchToken&&C(),new $(`Signed out.`,`SIGNED_OUT`,r.status)):new $(typeof i?.error==`string`&&i.error||`Tab-scoped refresh failed (${r.status}).`,`AUTH_ERROR`,r.status)}if(!i||typeof i.accessToken!=`string`||typeof i.idToken!=`string`)throw new $(`Tab-scoped refresh response missing tokens.`,`AUTH_ERROR`,r.status);let a=j(i,t);return n!==void 0&&gt(n),{identity:a.identity}}let P=!1,F=null,I=null;function Pe(){I=null}async function L(){if(F)return F;if(I&&Date.now()<I.expiresAt){let e=I.result;return I=null,e}let e=Fe();F=e;try{return await e}finally{F=null,I={result:e,expiresAt:Date.now()+400}}}async function Fe(){let e=_;ht();let t=Z();if(t)return Ne(t,void 0,e);let n=ut();if(n!==null)try{let t=await W(),{accounts:r}=t;if(t.read||(await new Promise(e=>setTimeout(e,400)),{accounts:r}=await W()),r.length>0){let t=u(n),i=t?r.find(e=>e.sub===t&&e.isAlive!==!1):void 0;if(i?.sub||(i=r.find(e=>e.index===n)),dt(),i?.sub){ct(i.sub);try{window.sessionStorage.setItem(X,String(n))}catch{}return Ne(i.sub,r,e)}P=!0}}catch{}let r=await me();if(r)return{identity:j(r,e).identity};if(x()){if(h&&Date.now()<h.expiresAt-ot)return{identity:h.identity};let t=se();if(t)return h=t,ae(h.identity.isAdmin??!1),Ee(h.identity),{identity:h.identity};let n=h?.refreshToken??Te();if(i.devReMintSession&&n){try{let t=await i.devReMintSession(n);if(t?.accessToken&&t.idToken)return{identity:j({...t,refreshToken:n},e).identity}}catch{}b()}throw new $(`Signed out.`,`SIGNED_OUT`)}let a=lt()!==null,o=ut()!==null||a;if(!P&&!o&&!O())try{let t=await W(),{accounts:n,defaultSub:r}=t;if(t.read||(await new Promise(e=>setTimeout(e,400)),{accounts:n,defaultSub:r}=await W()),n.length>0&&(P=!0),r){let t=n.find(e=>e.sub===r&&e.isAlive!==!1);
2if(t?.switchToken)try{return ct(t.sub),await Ne(t.sub,n,e)}catch{Q()}}}catch{}O()&&D();let s=S(),c=await T(s?xe(s):null);s&&c.status===401&&(C(),c=await T(null));let l=await c.json().catch(()=>null);if(!c.ok){let e=typeof l?.code==`string`?l.code:``;throw(c.status===401||e===`NO_REFRESH_COOKIE`||e===`INVALID_REFRESH`)&&D(c.status),new $(typeof l?.error==`string`&&l.error||`Refresh failed (${c.status}).`,`AUTH_ERROR`,c.status)}if(!l||typeof l.accessToken!=`string`||typeof l.idToken!=`string`)throw new $(`Refresh response missing tokens.`,`AUTH_ERROR`,c.status);let d=j(l,e);return d.identity?.sub&&Z()===null&&ut()===null&&ct(d.identity.sub),{identity:d.identity}}async function Ie(){try{return await L(),`signed-in`}catch(e){return e instanceof $&&e.code===`SIGNED_OUT`?`signed-out`:`indeterminate`}}async function Le(){if(h&&Date.now()<h.expiresAt-ot)return h.accessToken;if(await L(),!h)throw new $(`Signed out.`,`SIGNED_OUT`);return h.accessToken}async function Re(){if(h&&Date.now()<h.expiresAt-ot)return{accessToken:h.accessToken,idToken:h.idToken,expiresAt:h.expiresAt};if(await L(),!h)throw new $(`Signed out.`,`SIGNED_OUT`);return{accessToken:h.accessToken,idToken:h.idToken,expiresAt:h.expiresAt}}function R(){return h?.identity??null}function ze(){return h?{accessToken:h.accessToken,idToken:h.idToken,expiresAt:h.expiresAt}:null}function Be(){if(R())return!0;try{return s()!=null}catch{return!1}}function Ve(){let e=R();if(e)return e.sub;try{return s()?.sub??``}catch{return``}}function He(e){return j(e).identity}function Ue(e){return g.add(e),()=>{g.delete(e)}}async function We(){M(),n()}async function z(){if(typeof window<`u`&&t(window.location.origin)){M(),n();return}let e=typeof AbortController<`u`?new AbortController:null,r=e?setTimeout(()=>e.abort(),3e3):null,i=S();try{await B(i?.switchToken??``,e?.signal),await fetch(p,{method:`DELETE`,credentials:`include`,signal:e?.signal,...i?{headers:{"content-type":`application/json`,accept:`application/json`},body:JSON.stringify({switchToken:i.switchToken})}:{}})}catch{}finally{r&&clearTimeout(r),M(),n()}}async function B(e,t){let n=w(),r=await fetch(m,{credentials:`include`,signal:t,headers:{accept:`application/json`,...n}});if(!r.ok)return;let i=((await r.json().catch(()=>null))?.accounts??[]).map(e=>e.isAlive!==!1&&typeof e.switchToken==`string`?e.switchToken:``).filter(t=>t&&t!==e);await Promise.allSettled(i.map(e=>fetch(`${f}/auth/me/account`,{method:`DELETE`,credentials:`include`,signal:t,headers:{"content-type":`application/json`,accept:`application/json`,...n},body:JSON.stringify({switchToken:e,mode:`signout`})})))}let V=`cx-last-tier:`;function H(e){if(!e||typeof window>`u`)return``;try{return window.localStorage.getItem(V+e)??``}catch{return``}}function Ge(e,t){if(!(!e||typeof window>`u`))try{window.localStorage.setItem(V+e,t)}catch{}}let U=null;async function W(e){if(U)return U;let t=Ke(e);U=t;try{return await t}finally{U=null}}async function Ke(e){let n={activeEmail:``,activeSub:``,defaultSub:``,activeTier:``,accounts:[],read:!1};if(typeof window<`u`&&t(window.location.origin)){let e=R();return e?{activeEmail:e.email??``,activeSub:e.sub,defaultSub:``,activeTier:``,accounts:[{sub:e.sub,email:e.email??``,name:e.name??``,image:e.picture??void 0,isAlive:!0}],read:!0}:{...n,read:!0}}try{let t=e?.freshTier?`fresh`:e?.waitForTier?`wait`:null,r=t?`${m}${m.includes(`?`)?`&`:`?`}tiers=${t}`:m,i=w(),a=await fetch(r,{credentials:`include`,headers:{accept:`application/json`,...i}});if(a.status===401&&i.authorization)return{...n,read:!0};if(!a.ok)return n;let o=await a.json().catch(()=>null);if(!o)return n;let s=Array.isArray(o.accounts)?o.accounts:[],c=R()?.sub??``,l=c?s.find(e=>e.sub===c):void 0,u=l?l.tier:o.primary?.tier,d=l?c:o.primary?.sub??``,ee=c||(o.primary?.sub??``),f=typeof u==`string`?u:``;return f?Ge(d,f):f=H(ee),{activeEmail:o.primary?.email??``,activeSub:o.primary?.sub??``,defaultSub:o.defaultSub??``,activeTier:f,accounts:s,read:!0}}catch{return n}}async function qe(e){let t;try{t=await fetch(p,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`,accept:`application/json`},body:JSON.stringify({switchToken:e,...be()})})}catch(e){throw new $(v(e,`Network error during account switch.`),`AUTH_ERROR`)}if(!t.ok){let e=await t.json().catch(()=>null);throw new $(typeof e?.error==`string`&&e.error||`Account switch failed (${t.status}).`,`AUTH_ERROR`,t.status)}Q(!0);let n=await t.json().catch(()=>null);n&&typeof n.userSub==`string`&&pe(n,n.userSub)}async function G(e,t,n,r){let i;try{i=await fetch(e,{method:t,credentials:`include`,headers:{"content-type":`application/json`,accept:`application/json`,...w()},body:JSON.stringify(n)})}catch(e){throw new $(v(e,`Network error during ${r}.`),`AUTH_ERROR`)}if(!i.ok){let e=await i.json().catch(()=>null);throw new $(typeof e?.error==`string`&&e.error||`${r} failed (${i.status}).`,`AUTH_ERROR`,i.status)}}async function Je(e){return G(`${f}/auth/me/account`,`DELETE`,{switchToken:e},`forget account`)}async function Ye(e){return G(`${f}/auth/me/account`,`DELETE`,{switchToken:e,mode:`signout`},`sign out account`)}async function Xe(e){return G(`${f}/auth/me/default`,`POST`,{switchToken:e},`set default account`)}async function Ze(){let e=window.top===window?ee(window.location.search):null;if(e)return window.location.replace(e),new Promise(()=>{});let t=new URLSearchParams(window.location.search),n=t.get(`code`)??``,i=t.get(`state`)??``,a=t.get(`error`),o=i?Oe(i):null;if(a)return o?.silent?(a===`login_required`&&r(),{ok:!1,returnTo:o.returnTo||`/`,error:a,silent:!0}):{ok:!1,returnTo:`/welcome`,error:a};if(!n||!o)return{ok:!1,returnTo:`/welcome`,error:`missing_code_or_state`};let s=await T({code:n,codeVerifier:o.verifier,redirectUri:o.redirectUri},`sign-in completion`).catch(e=>e);if(s instanceof $)return Qe(o,s.message);let c=await s.json().catch(()=>null);if(!s.ok)return Qe(o,typeof c?.error==`string`&&c.error||`Sign-in completion failed (${s.status}).`);if(!c||typeof c.accessToken!=`string`||typeof c.idToken!=`string`)return Qe(o,`Sign-in completion response missing tokens.`);let{identity:l}=j(c),u=o.returnTo||`/`,d=Z();return!o.silent&&d&&d!==l.sub&&(Q(),u=mt(u)),{ok:!0,returnTo:u}}function Qe(e,t){return e.silent?{ok:!1,returnTo:e.returnTo||`/`,error:t,silent:!0}:{ok:!1,returnTo:`/welcome`,error:t}}async function $e(e,t){let n;try{n=await fetch(`${f}/auth/session`,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json`,authorization:`Bearer ${e}`},body:JSON.stringify({action:`update_image`,newImageUrl:t})})}catch(e){throw new $(v(e,`Network error updating profile photo.`),`AUTH_ERROR`)}return ye(n)}async function et(e){let t=await Le();try{return await ve(e,{landImageSource:e=>$e(t,e)})}catch(e){throw e instanceof _e?new $(e.message,`AUTH_ERROR`,e.status):e}}function tt(){let e=S();return e?{refreshUrl:p,...e}:null}return{startAegisLogin:Me,silentAegisLoginUrl:A,refreshAegisSession:L,directSessionProbe:Ie,ensureAcce
2ssToken:Le,ensureTokens:Re,cachedIdentity:R,currentTokens:ze,hasSignedInHint:Be,signedInHintSub:Ve,adoptTokens:He,subscribe:Ue,nativeRefreshCredential:tt,clearAegisTokens:M,signOutAegisSession:We,signOutEverywhere:z,finishAegisLogin:Ze,fetchCentralAccounts:W,switchCentralAccount:qe,forgetCentralAccount:Je,signOutCentralAccount:Ye,setCentralDefaultAccount:Xe,uploadProfilePhoto:et}}export{ye as _,rt as a,x as b,P as c,Re as d,Fe as f,Me as g,A as h,tt as i,R as l,je as m,St as n,nt as o,Le as p,yt as r,N as s,$ as t,ze as u,ve as v,ge as y};

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.