@spikonado/sprocket 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/package.json +6 -6
- package/web/_app/immutable/assets/0.Btn1dfCy.css +2 -0
- package/web/_app/immutable/chunks/BIoNiaeb.js +1 -0
- package/web/_app/immutable/chunks/{DtbzskMF.js → BcbRJsmf.js} +1 -1
- package/web/_app/immutable/chunks/C6UbJThZ.js +64 -0
- package/web/_app/immutable/chunks/CI5UllIC.js +1 -0
- package/web/_app/immutable/chunks/CZkwsiMM.js +6 -0
- package/web/_app/immutable/chunks/Cq37afw7.js +2 -0
- package/web/_app/immutable/chunks/{C7n7Hkve.js → PSXYTcvE.js} +1 -1
- package/web/_app/immutable/chunks/W58kGv2a.js +7 -0
- package/web/_app/immutable/entry/{app.CeGw4OSi.js → app.SPUDvldn.js} +2 -2
- package/web/_app/immutable/entry/start.C35C-bUa.js +1 -0
- package/web/_app/immutable/nodes/0.BQy7t8ld.js +1 -0
- package/web/_app/immutable/nodes/1.BKmg0DHY.js +1 -0
- package/web/_app/immutable/nodes/2.CW66SnVr.js +127 -0
- package/web/_app/immutable/nodes/{3.D40OcmEn.js → 3.D5e7ydb1.js} +1 -1
- package/web/_app/immutable/nodes/{4.coTLLCMq.js → 4.DAD6I3xt.js} +1 -1
- package/web/_app/version.json +1 -1
- package/web/callback.html +14 -13
- package/web/index.html +11 -10
- package/web/pair.html +15 -14
- package/web/_app/immutable/assets/0.CAFzdT87.css +0 -2
- package/web/_app/immutable/chunks/B2QV2lSm.js +0 -1
- package/web/_app/immutable/chunks/DQzmXkOB.js +0 -1
- package/web/_app/immutable/chunks/DXwWhsEw.js +0 -6
- package/web/_app/immutable/chunks/D_6EnlQE.js +0 -2
- package/web/_app/immutable/entry/start.B77P4R2b.js +0 -1
- package/web/_app/immutable/nodes/0.DmC-g_Lj.js +0 -1
- package/web/_app/immutable/nodes/1.Djk_ySAI.js +0 -1
- package/web/_app/immutable/nodes/2.DOq86jPW.js +0 -124
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{it as e,rt as t}from"./D-3DgMVM.js";import"./BQbJFoq8.js";import{a as n,d as r,l as i,o as a}from"./C6UbJThZ.js";var o=`localhost`;`${o}`;function s(e){let t=new URL(e);return t.hostname!==`127.0.0.1`&&t.hostname!==`[::1]`?null:(t.hostname=o,t.toString())}function c(e,t,n){return t||!n&&[`127.0.0.1`,`localhost`,`[::1]`].includes(e)}var l=Symbol.for(`functionName`),u=Symbol.for(`toReferencePath`);function ee(e){return e[u]??null}function te(e){return e.startsWith(`function://`)}function ne(e){let t;if(typeof e==`string`)t=te(e)?{functionHandle:e}:{name:e};else if(e[l])t={name:e[l]};else{let n=ee(e);if(!n)throw Error(`${e} is not a functionReference`);t={reference:n}}return t}function re(e){let t=ne(e);if(t.name===void 0)throw t.functionHandle===void 0?t.reference===void 0?Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`):Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);if(typeof e==`string`)return e;let n=e[l];if(!n)throw Error(`${e} is not a functionReference`);return n}function ie(e=[]){return new Proxy({},{get(t,n){if(typeof n==`string`)return ie([...e,n]);if(n===l){if(e.length<2){let t=[`api`,...e].join(`.`);throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``)}let t=e.slice(0,-1).join(`/`),n=e[e.length-1];return n==="default"?t:t+`:`+n}if(n===Symbol.toStringTag)return`FunctionReference`}})}var ae=ie();function oe(e,t){return new Proxy({},{get(n,r){if(typeof r==`string`)return oe(e,[...t,r]);if(r===u){if(t.length<1){let n=[e,...t].join(`.`);throw Error(`API path is expected to be of the form \`${e}.childComponent.functionName\`. Found: \`${n}\``)}return`_reference/childComponent/`+t.join(`/`)}}})}var se=()=>oe(`components`,[]),ce=e=>{throw TypeError(e)},d=(e,t,n)=>t.has(e)||ce(`Cannot `+n),f=(e,t,n)=>(d(e,t,`read from private field`),n?n.call(e):t.get(e)),p=(e,t,n)=>t.has(e)?ce(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),m=(e,t,n,r)=>(d(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),h=(e,t,n)=>(d(e,t,`access private method`),n),le=class extends Error{constructor(){super(...arguments),this.status=500,this.name=`NoClientIdProvidedException`,this.message=`Missing Client ID. Pass it to the constructor (createClient("client_01HXRMBQ9BJ3E7QSTQ9X2PHVB7"))`}};function ue(e,t){if(!t.has(`code`))return!1;let{pathname:n}=window.location,r=new URL(e).pathname;return n===r||n===`${r}/`}function de(){let e={};function t(t,n){e[t]=n}function n(t){return e[t]}function r(t){delete e[t]}function i(){e={}}return{setItem:t,getItem:n,removeItem:r,reset:i}}var g=de();async function fe(){let e=pe();return{codeVerifier:e,codeChallenge:await me(e)}}function pe(){return he(crypto.getRandomValues(new Uint32Array(96)))}async function me(e){return he(await ge(e))}function he(e){return btoa(Array.from(new Uint8Array(e),e=>String.fromCharCode(e)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function ge(e){let t=new TextEncoder().encode(e);return crypto.subtle.digest(`SHA-256`,t)}function _e(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=`=`.repeat((4-t.length%4)%4);return atob(t+n)}function ve(e){let t=e.split(`.`);if(t.length!==3)throw Error(`Invalid JWT format`);try{return{header:JSON.parse(_e(t[0])),payload:JSON.parse(_e(t[1]))}}catch(e){throw Error(`Failed to decode JWT: ${e instanceof Error?e.message:String(e)}`)}}var _={codeVerifier:`workos:code-verifier`,user:`workos:user`,accessToken:`workos:access-token`,refreshToken:`workos:refresh-token`,expiresAt:`workos:expires-at`,authenticationMethod:`workos:authentication-method`};function ye(e){return ve(e).payload}function be(e){return`${_.refreshToken}:${e}`}function xe(e,{devMode:t=!1,clientId:n}){let{user:r,accessToken:i,refreshToken:a,authenticationMethod:o}=e;g.setItem(_.user,r),g.setItem(_.accessToken,i),g.setItem(_.authenticationMethod,o),(t?window.localStorage:g).setItem(be(n),a);let{exp:s,iat:c}=ye(i),l=s-c,u=Date.now()+l*1e3;g.setItem(_.expiresAt,u)}function Se({devMode:e=!1,clientId:t}){g.removeItem(_.user),g.removeItem(_.accessToken),g.removeItem(_.authenticationMethod);let n=e?window.localStorage:g;n.removeItem(be(t)),n.removeItem(_.refreshToken)}function Ce({devMode:e=!1,clientId:t}){let n=e?window.localStorage:g,r=n.getItem(be(t))??n.getItem(_.refreshToken);return typeof r==`string`?r:void 0}function we(e){let t=new URLSearchParams,n=Object.keys(e).sort();for(let r of n){let n=e[r];n&&t.append(r,n)}return t.toString()}var v=class extends Error{},y=class extends v{constructor(e,t={}){super(e,t.cause==null?void 0:{cause:t.cause}),this.name=`RefreshError`,this.status=t.status,this.error=t.error,this.isTransient=t.isTransient??!1}},Te=class extends v{},b=class extends v{constructor(){super(...arguments),this.message=`No access token available`}},x=class extends y{constructor(e=`Timed out waiting to refresh the session.`,t){super(e,{cause:t?.cause,isTransient:!0}),this.name=`RefreshTimeoutError`}},Ee=class extends v{constructor(){super(...arguments),this.message=`SignOut() called without an active session. Provide a returnTo URL to redirect anyway.`}},De=class e{constructor(){this.locked=new Map,this.addToLocked=(e,t)=>{let n=this.locked.get(e);n===void 0?t===void 0?this.locked.set(e,[]):this.locked.set(e,[t]):t!==void 0&&(n.unshift(t),this.locked.set(e,n))},this.isLocked=e=>this.locked.has(e),this.lock=e=>new Promise((t,n)=>{this.isLocked(e)?this.addToLocked(e,t):(this.addToLocked(e),t())}),this.unlock=e=>{let t=this.locked.get(e);if(t===void 0||t.length===0){this.locked.delete(e);return}let n=t.pop();this.locked.set(e,t),n!==void 0&&setTimeout(n,0)}}static getInstance(){return e.instance===void 0&&(e.instance=new e),e.instance}};function S(){return De.getInstance()}var Oe=`browser-tabs-lock-key`,C={key:async e=>{throw Error(`Unsupported`)},getItem:async e=>{throw Error(`Unsupported`)},clear:async()=>window.localStorage.clear(),removeItem:async e=>{throw Error(`Unsupported`)},setItem:async(e,t)=>{throw Error(`Unsupported`)},keySync:e=>window.localStorage.key(e),getItemSync:e=>window.localStorage.getItem(e),clearSync:()=>window.localStorage.clear(),removeItemSync:e=>window.localStorage.removeItem(e),setItemSync:(e,t)=>window.localStorage.setItem(e,t)};function ke(e){return new Promise(t=>setTimeout(t,e))}function Ae(e){let t=``;for(let n=0;n<e;n++){let e=Math.floor(Math.random()*61);t+=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz`[e]}return t}function je(){return Date.now().toString()+Ae(15)}var Me=class e{constructor(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=je(),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,e.waiters===void 0&&(e.waiters=[])}async acquireLock(t,n=5e3){let r=Date.now()+Ae(4),i=Date.now()+n,a=`${Oe}-${t}`,o=this.storageHandler===void 0?C:this.storageHandler;for(;Date.now()<i;){if(await ke(30),o.getItemSync(a)===null){let e=`${this.id}-${t}-${r}`;await ke(Math.floor(Math.random()*25)),o.setItemSync(a,JSON.stringify({id:this.id,iat:r,timeoutKey:e,timeAcquired:Date.now(),timeRefreshed:Date.now()})),await ke(30);let n=o.getItemSync(a);if(n!==null){let e=JSON.parse(n);if(e.id===this.id&&e.iat===r)return this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(a,r),!0}}else e.lockCorrector(this.storageHandler===void 0?C:this.storageHandler),await this.waitForSomethingToChange(i);r=Date.now()+Ae(4)}return!1}async refreshLockWhileAcquired(e,t){setTimeout(async()=>{if(await S().lock(t),!this.acquiredIatSet.has(t)){S().unlock(t);return}let n=this.storageHandler===void 0?C:this.storageHandler,r=n.getItemSync(e);if(r!==null){let i=JSON.parse(r);i.timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(i)),S().unlock(t)}else{S().unlock(t);return}this.refreshLockWhileAcquired(e,t)},1e3)}async waitForSomethingToChange(t){await new Promise(n=>{let r=!1,i=Date.now(),a=!1;function o(){if(a||=(window.removeEventListener(`storage`,o),e.removeFromWaiting(o),clearTimeout(s),!0),!r){r=!0;let e=50-(Date.now()-i);e>0?setTimeout(n,e):n(null)}}window.addEventListener(`storage`,o),e.addToWaiting(o);let s=setTimeout(o,Math.max(0,t-Date.now()))})}static addToWaiting(t){this.removeFromWaiting(t),e.waiters!==void 0&&e.waiters.push(t)}static removeFromWaiting(t){e.waiters!==void 0&&(e.waiters=e.waiters.filter(e=>e!==t))}static notifyWaiters(){e.waiters!==void 0&&[...e.waiters].forEach(e=>e())}async releaseLock(e){return await this.releaseLock__private__(e)}async releaseLock__private__(t){let n=this.storageHandler===void 0?C:this.storageHandler,r=`${Oe}-${t}`,i=n.getItemSync(r);if(i===null)return;let a=JSON.parse(i);a.id===this.id&&(await S().lock(a.iat),this.acquiredIatSet.delete(a.iat),n.removeItemSync(r),S().unlock(a.iat),e.notifyWaiters())}static lockCorrector(t){let n=Date.now()-5e3,r=t,i=[],a=0;for(;;){let e=r.keySync(a);if(e===null)break;i.push(e),a++}let o=!1;for(let e=0;e<i.length;e++){let t=i[e];if(t.includes(Oe)){let e=r.getItemSync(t);if(e!==null){let i=JSON.parse(e);(i.timeRefreshed===void 0&&i.timeAcquired<n||i.timeRefreshed!==void 0&&i.timeRefreshed<n)&&(r.removeItemSync(t),o=!0)}}}o&&e.notifyWaiters()}};Me.waiters=void 0;var Ne=Me,Pe=1e4;function Fe(e,t,{timeout:n=Pe}={}){if(!e)throw TypeError(`lockName is required and must be a non-empty string.`);return`locks`in navigator?Ie(e,t,n):Le(e,t,n)}async function Ie(e,t,n){try{return await navigator.locks.request(e,{signal:AbortSignal.timeout(n)},t)}catch(t){if(t instanceof DOMException)switch(t.name){case`TimeoutError`:case`AbortError`:throw new Re(`AcquisitionTimeoutError`,e,`Native`)}throw t}}async function Le(e,t,n){let r=new Ne;try{if(await r.acquireLock(e,n))return await t();throw new Re(`AcquisitionTimeoutError`,e,`Vendor`)}finally{await r.releaseLock(e)}}var Re=class extends Error{constructor(e,t,n){super(`Lock acquisition timed out for "${t}" (${n})`),this.name=e,this.lockName=t}},ze=e=>({object:e.object,id:e.id,email:e.email,emailVerified:e.email_verified,firstName:e.first_name,profilePictureUrl:e.profile_picture_url,lastName:e.last_name,lastSignInAt:e.last_sign_in_at,externalId:e.external_id,createdAt:e.created_at,updatedAt:e.updated_at}),Be=e=>{let{user:t,organization_id:n,access_token:r,refresh_token:i,authentication_method:a,impersonator:o,...s}=e;return{user:ze(t),organizationId:n,accessToken:r,refreshToken:i,authenticationMethod:a,impersonator:o,...s}},Ve=`api.workos.com`,He=new Set([408,429,500,502,503,504]),w,T,E,Ue,D,We=class{constructor({clientId:e,hostname:t=Ve,port:n,https:r=!0}){p(this,E),p(this,w),p(this,T),m(this,w,`${r?`https`:`http`}://${t}${n?`:${n}`:``}`),m(this,T,e)}async authenticateWithRefreshToken({refreshToken:e,organizationId:t,useCookie:n}){let r=await h(this,E,D).call(this,`/user_management/authenticate`,{useCookie:n,body:{client_id:f(this,T),grant_type:`refresh_token`,...!n&&{refresh_token:e},organization_id:t}});if(r.ok)return Be(await r.json());let{status:i}=r,a=await h(this,E,Ue).call(this,r);throw new y(a.error_description,{status:i,error:a.error,isTransient:He.has(i)})}async authenticateWithCode({code:e,codeVerifier:t,useCookie:n}){let r=await h(this,E,D).call(this,`/user_management/authenticate`,{useCookie:n,body:{code:e,client_id:f(this,T),grant_type:`authorization_code`,code_verifier:t}});if(r.ok)return Be(await r.json());throw new Te((await r.json()).error_description)}getAuthorizationUrl({connectionId:e,context:t,domainHint:n,loginHint:r,organizationId:i,provider:a=`authkit`,redirectUri:o,state:s,screenHint:c,passwordResetToken:l,invitationToken:u,codeChallenge:ee,codeChallengeMethod:te}){if(!a&&!e&&!i)throw TypeError(`Incomplete arguments. Need to specify either a 'connectionId', 'organizationId', or 'provider'.`);if(a!==`authkit`&&c)throw TypeError(`'screenHint' is only supported for 'authkit' provider`);t&&console.warn("`context` is deprecated. We previously required initiate login endpoints to return the\n`context` query parameter when getting the authorization URL. This is no longer necessary.");let ne=we({connection_id:e,organization_id:i,domain_hint:n,login_hint:r,provider:a,client_id:f(this,T),redirect_uri:o,response_type:`code`,state:s,screen_hint:c,invitation_token:u,password_reset_token:l,code_challenge:ee,code_challenge_method:te});return`${f(this,w)}/user_management/authorize?${ne}`}getLogoutUrl({sessionId:e,returnTo:t}){let n=new URL(`/user_management/sessions/logout`,f(this,w));return n.searchParams.set(`session_id`,e),t&&n.searchParams.set(`return_to`,t),n}};w=new WeakMap,T=new WeakMap,E=new WeakSet,Ue=async function(e){try{return await e.json()}catch{return{}}},D=function(e,{body:t,useCookie:n}){return fetch(new URL(e,f(this,w)),{method:`POST`,...n&&{credentials:`include`},headers:{Accept:`application/json, text/plain, */*`,"Content-Type":`application/json`},body:JSON.stringify(t)})};var O=`workos_organization_id`;function k(e){return`workos-org-id:${e}`}var Ge=`WORKOS_REFRESH_SESSION`;function Ke(e){let t=document.cookie.match(/(?:^|;\s*)workos-has-session=([^;]*)/);if(!t)return!1;let n=t[1];return n===`1`||n.split(`.`).includes(e)}var A,j,M,N,P,F,I,L,R,z,B,V,qe,Je,H,U,Ye,Xe,W,G,Ze,Qe,$e,et=class{constructor(e,{apiHostname:t,https:n,port:r,redirectUri:i=window.origin,devMode:a=location.hostname===`localhost`||location.hostname===`127.0.0.1`,onBeforeAutoRefresh:o=()=>!document.hidden,onRedirectCallback:s=e=>{},onRefresh:c,onRefreshFailure:l,refreshBufferInterval:u=10}={}){if(p(this,V),p(this,A),p(this,j),p(this,M),p(this,N),p(this,P),p(this,F),p(this,I),p(this,L),p(this,R),p(this,z),p(this,B),!e)throw new le;m(this,M,e),m(this,N,new We({clientId:e,hostname:t,port:r,https:n})),m(this,F,a),m(this,P,i),m(this,A,{tag:`INITIAL`}),m(this,I,o),m(this,L,s),m(this,R,c),m(this,z,l),m(this,B,u)}async initialize(){if(f(this,A).tag!==`INITIAL`)return;let e=new URLSearchParams(window.location.search);if(ue(f(this,P),e))await h(this,V,qe).call(this);else if(Ke(f(this,M))||Ce({devMode:f(this,F),clientId:f(this,M)}))try{await h(this,V,U).call(this),h(this,V,H).call(this)}catch{h(this,V,Je).call(this)}}async getSignInUrl(e={}){return await h(this,V,W).call(this,{...e})}async getSignUpUrl(e={}){return await h(this,V,W).call(this,{...e,screenHint:`sign-up`})}async signIn(e={}){let t=await h(this,V,W).call(this,{...e});window.location.assign(t)}async signUp(e={}){let t=await h(this,V,W).call(this,{...e,screenHint:`sign-up`});window.location.assign(t)}signOut(e={navigate:!0}){let{navigate:t=!0,returnTo:n}=e,r=g.getItem(_.accessToken);if(typeof r!=`string`){if(t)throw new Ee;return Promise.reject(new Ee)}let{sid:i}=ye(r),a=f(this,N).getLogoutUrl({sessionId:i,returnTo:n});if(a){if(Se({devMode:f(this,F),clientId:f(this,M)}),sessionStorage.removeItem(k(f(this,M))),sessionStorage.removeItem(O),t)window.location.assign(a);else return new Promise(async e=>{fetch(a,{mode:`no-cors`,credentials:`include`}).catch(e=>{console.warn(`AuthKit: Failed to send logout request`,e)}).finally(e)})}}async getAccessToken(e){if(e?.forceRefresh||h(this,V,Xe).call(this))try{await h(this,V,U).call(this)}catch(t){if(t instanceof x){let t=e?.forceRefresh?void 0:h(this,V,Ze).call(this);if(t)return t;try{await h(this,V,U).call(this)}catch(e){throw e instanceof x?e:e instanceof y?e.isTransient?e:new b:e}}else if(t instanceof y){if(t.isTransient){let n=e?.forceRefresh?void 0:h(this,V,Ze).call(this);if(n)return n;throw t}throw new b}else throw t}let t=h(this,V,G).call(this);if(!t)throw new b;return t}getUser(){return g.getItem(_.user)||null}dispose(){clearTimeout(f(this,j)),g.reset()}async switchToOrganization({organizationId:e,signInOpts:t={}}){try{await h(this,V,U).call(this,{organizationId:e})}catch(n){if(n instanceof x)console.warn(`Couldn't switch organization: lock acquisition timed out.`);else if(n instanceof y){if(n.isTransient)throw n;this.signIn({...t,organizationId:e})}else throw n}}};A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,F=new WeakMap,I=new WeakMap,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakSet,qe=async function(){if(f(this,A).tag!==`INITIAL`)return;let e=new URL(window.location.href),t=e.searchParams.get(`code`),n=e.searchParams.get(`state`),r;if(n)try{r=JSON.parse(n)}catch{console.warn("AuthKit: ignoring malformed `state` parameter")}let i=window.sessionStorage.getItem(_.codeVerifier);if(t){if(i)try{m(this,A,{tag:`AUTHENTICATING`,response:f(this,N).authenticateWithCode({code:t,codeVerifier:i,useCookie:f(this,V,Qe)})});let e=await f(this,A).response;e&&(m(this,A,{tag:`AUTHENTICATED`}),h(this,V,H).call(this),xe(e,{devMode:f(this,F),clientId:f(this,M)}),h(this,V,$e).call(this,e),f(this,L).call(this,{state:r,...e}))}catch(e){m(this,A,{tag:`ERROR`}),console.error(e)}else m(this,A,{tag:`ERROR`}),console.error(`Couldn't exchange code.
|
|
2
|
+
|
|
3
|
+
An authorization_code was supplied for a login which did not originate at the application. This could happen for various reasons:
|
|
4
|
+
|
|
5
|
+
* This could have been an attempted Login CSRF attack. You were not affected.
|
|
6
|
+
* The developer may not have configured a Login Initiation endpoint.`)}let a=new URL(window.location.toString());a.searchParams.delete(`code`),a.searchParams.delete(`state`),window.sessionStorage.removeItem(_.codeVerifier),window.history.replaceState({},``,a)},Je=function(){f(this,A).tag===`AUTHENTICATED`&&h(this,V,H).call(this)},H=async function(){m(this,j,setTimeout(()=>{h(this,V,Xe).call(this)&&f(this,I).call(this)?h(this,V,U).call(this).catch(e=>{console.debug(e)}).finally(()=>h(this,V,H).call(this)):h(this,V,H).call(this)},1e3))},U=async function({organizationId:e}={}){if(f(this,A).tag===`AUTHENTICATING`){await f(this,A).response;return}let t=f(this,A);m(this,A,{tag:`AUTHENTICATING`,response:h(this,V,Ye).call(this,{organizationId:e,beginningState:t})}),await f(this,A).response},Ye=async function({organizationId:e,beginningState:t}){try{return await Fe(Ge,async()=>{if(e)sessionStorage.setItem(k(f(this,M)),e);else{let t=h(this,V,G).call(this);e=t?ye(t)?.org_id:sessionStorage.getItem(k(f(this,M)))??sessionStorage.getItem(O)??void 0}let t=await f(this,N).authenticateWithRefreshToken({refreshToken:Ce({devMode:f(this,F),clientId:f(this,M)}),organizationId:e,useCookie:f(this,V,Qe)});return m(this,A,{tag:`AUTHENTICATED`}),xe(t,{devMode:f(this,F),clientId:f(this,M)}),h(this,V,$e).call(this,t),t})}catch(e){throw e instanceof Re&&e.name===`AcquisitionTimeoutError`?(console.warn(`Couldn't acquire refresh lock.`),m(this,A,t),new x(void 0,{cause:e})):(t.tag!==`INITIAL`&&console.debug(e),e instanceof y&&!e.isTransient?(Se({devMode:f(this,F),clientId:f(this,M)}),sessionStorage.removeItem(k(f(this,M))),sessionStorage.removeItem(O),t.tag!==`INITIAL`&&f(this,z)&&f(this,z).call(this,{signIn:this.signIn.bind(this)}),m(this,A,{tag:`ERROR`})):m(this,A,{tag:`AUTHENTICATED`}),e)}},Xe=function(){switch(f(this,A).tag){case`INITIAL`:case`AUTHENTICATING`:return!0;case`ERROR`:return!1;case`AUTHENTICATED`:let e=g.getItem(_.accessToken),t=g.getItem(_.expiresAt);return!e||!t||t-f(this,B)*1e3<Date.now()}},W=async function({context:e,invitationToken:t,loginHint:n,organizationId:r,passwordResetToken:i,state:a,screenHint:o}){let{codeVerifier:s,codeChallenge:c}=await fe();return window.sessionStorage.setItem(_.codeVerifier,s),f(this,N).getAuthorizationUrl({codeChallenge:c,codeChallengeMethod:`S256`,context:e,invitationToken:t,loginHint:n,organizationId:r,passwordResetToken:i,redirectUri:f(this,P),screenHint:o,state:a?JSON.stringify(a):void 0})},G=function(){return g.getItem(_.accessToken)},Ze=function(){let e=h(this,V,G).call(this),t=g.getItem(_.expiresAt);return e&&t&&t>Date.now()?e:void 0},Qe=function(){return!f(this,F)},$e=async function(e){if(f(this,R)){let{refreshToken:t,...n}=e;f(this,R).call(this,n)}};async function tt(e,t={}){let n=new et(e,t);return await n.initialize(),n}var nt=ae;se();var K=e({isLoading:!0,isReady:!1,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,error:null}),rt=e(0),q=e(!1),it=1500,at=3e5,J=null,Y=null,ot=null,st=!1,X=null,ct=Promise.resolve();function lt(){if(ot)return ot;throw Error(`Auth bootstrap is not initialized.`)}async function ut(){if(Y)return await Y;Y=lt().query(nt.authBootstrap.getClientConfig,{});try{return await Y}catch(e){throw Y=null,e}}async function dt(){return(await ut()).workosClientId?.trim()||void 0}function ft(){let e=window.sprocketDesktopBridge;return!e?.getLocalBootstrap||!e.openExternal||!e.focusWindow?null:e}function pt(){return c(window.location.hostname,!1,!1)}async function Z(){return J||=(async()=>{let e=await dt();if(!e)return K.set({isLoading:!1,isReady:!0,isConfigured:!1,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,error:null}),null;let t=null;try{return t=await tt(e,{redirectUri:`${window.location.origin}/callback`,onRedirectCallback:()=>{window.location.replace(`/`)},onRefresh:()=>{K.update(e=>({...e,user:t?.getUser()??null,error:null}))},onRefreshFailure:()=>{K.update(e=>({...e,user:null,error:e.user&&!st?`Session refresh failed. Sign in again.`:null}))}}),K.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:t.getUser(),error:null}),t}catch(e){throw J=null,e}})(),await J}async function mt(e){ot=e,K.set({...t(K),isLoading:!0});try{let e=await Z();K.update(t=>t.isConfigured?{isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:e?.getUser()??null,error:null}:{...t,isLoading:!1,isReady:!0})}catch(e){K.update(t=>({...t,isLoading:!1,isReady:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,error:e instanceof Error?e.message:`Failed to initialize authentication.`}))}}var ht=i({nonce:r()}),gt=i({error:r().optional()}),_t=n(`status`,[i({status:a(`pending`)}),i({status:a(`complete`),code:r(),state:r()}),i({status:a(`failed`),error:r()})]);function vt(e){try{let t=ht.safeParse(JSON.parse(e));if(!t.success)return null;let n=t.data.nonce.trim();return n.length>0?n:null}catch{return e.trim()||null}}async function yt(e,t){let n=gt.safeParse(await e.json().catch(()=>null));return n.success?n.data.error??t:t}async function bt(e){let t=await fetch(`/api/auth/desktop-login/start`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({state:e})});if(!t.ok)throw Error(await yt(t,`Failed to start desktop sign-in.`))}function Q(e){return X===e&&!e.abort.signal.aborted}function $(e){if(!Q(e))throw new DOMException(`Aborted`,`AbortError`)}async function xt(e){let t=ct,n;ct=new Promise(e=>{n=e}),await t;try{$(e),await bt(e.nonce),$(e)}finally{n()}}function St(e){let t=e.desktopLoginCallbackUrl?.trim();if(t)return t.replace(/\/$/,``);let n;try{n=new URL(e.httpBaseUrl)}catch{throw Error(`Local server bootstrap URL is invalid.`)}return`http://127.0.0.1:${n.port||(n.protocol===`https:`?`443`:`80`)}/api/auth/desktop-login/callback`}async function Ct(e,t){let n=Date.now();for(;!t.aborted;){if(Date.now()-n>at)throw Error(`Sign-in timed out. Try again.`);let r=await fetch(`/api/auth/desktop-login/result`,{credentials:`include`,signal:t});if(!r.ok)throw Error(await yt(r,`Failed to check desktop sign-in status.`));let i=_t.safeParse(await r.json());if(!i.success)throw Error(`Failed to check desktop sign-in status.`);let a=i.data;if(a.status===`failed`)throw Error(a.error||`Desktop sign-in failed.`);if(a.status===`complete`){if(vt(a.state)!==e)throw Error(`Desktop sign-in state mismatch.`);return{code:a.code,state:a.state}}await new Promise((e,n)=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),e()},it);function i(){clearTimeout(r),n(new DOMException(`Aborted`,`AbortError`))}t.addEventListener(`abort`,i,{once:!0})})}throw new DOMException(`Aborted`,`AbortError`)}async function wt(e,t){let n=ft();if(!n&&!pt())throw Error(`Loopback browser sign-in is unavailable.`);Tt();let r={nonce:crypto.randomUUID(),abort:new AbortController};X=r,K.update(e=>({...e,isWaitingForBrowserSignIn:!0,browserSignInUrl:null,error:null}));try{let i=n?await n.getLocalBootstrap():{httpBaseUrl:window.location.origin};$(r);let a=St(i);await xt(r),$(r);let o=await tt(e,{redirectUri:a});$(r);let s={state:{nonce:r.nonce}},c=t===`signUp`?await o.getSignUpUrl(s):await o.getSignInUrl(s);if($(r),K.update(e=>({...e,browserSignInUrl:c})),$(r),n)n.openExternal(c).catch(e=>{if(!Q(r))return;let t=e instanceof Error?e.message.trim():``;K.update(e=>({...e,error:t||`Automatic browser open failed.`}))});else{let e=window.open(c,`_blank`);if(e)try{e.opener=null}catch{}else K.update(e=>({...e,error:`Your browser blocked the sign-in window.`}))}let l=await Ct(r.nonce,r.abort.signal);if($(r),n)try{await n.focusWindow()}catch(e){Q(r)&&console.warn(`Failed to focus desktop window after sign-in`,e)}$(r);let u=new URL(`/callback`,window.location.origin);u.searchParams.set(`code`,l.code),u.searchParams.set(`state`,l.state),$(r),window.location.href=u.toString()}catch(e){if(X!==r)return;if(e instanceof DOMException&&e.name===`AbortError`){K.update(e=>({...e,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:null}));return}K.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:e instanceof Error?e.message:`Failed to sign in with the browser.`}))}finally{X===r&&(X=null)}}function Tt(){X?.abort.abort(),X=null}function Et(){let e=X,t=ct;Tt(),K.update(e=>({...e,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:null})),e&&t.then(async()=>{await fetch(`/api/auth/desktop-login/cancel`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({state:e.nonce})})}).catch(()=>{})}function Dt(){K.update(e=>!e.isWaitingForBrowserSignIn||e.error===null?e:{...e,error:null})}async function Ot(e){let t=await Z();if(!t)return;let n=await dt();if(n){if(ft()||pt()){await wt(n,e);return}if(e===`signUp`){await t.signUp();return}await t.signIn()}}async function kt(){await Ot(`signIn`)}async function At(){await Ot(`signUp`)}async function jt(){let e=await Z();if(e){Et(),st=!0,K.update(e=>({...e,isLoading:!0}));try{await e.signOut({navigate:!1,returnTo:window.location.origin}),q.set(!1),K.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,error:null})}catch(e){K.update(t=>({...t,isLoading:!1,error:e instanceof Error?e.message:`Failed to sign out.`}))}finally{st=!1}}}async function Mt({forceRefreshToken:e=!1}={}){let t=await Z();if(!t)return null;try{return await t.getAccessToken({forceRefresh:e})}catch(e){if(e instanceof Error&&e.name===`LoginRequiredError`)return K.update(e=>({...e,user:null})),null;throw e}}function Nt(e){return e.retryPending?e.isAuthenticated?{clearPending:!0,sawLoadingDuringRetry:e.sawLoadingDuringRetry}:e.isLoading?{clearPending:!1,sawLoadingDuringRetry:!0}:e.sawLoadingDuringRetry?{clearPending:!0,sawLoadingDuringRetry:!0}:{clearPending:!1,sawLoadingDuringRetry:!1}:{clearPending:!1,sawLoadingDuringRetry:!1}}async function Pt(){K.update(e=>({...e,isLoading:!0,error:null})),q.set(!0);try{if(!await Mt({forceRefreshToken:!0}))throw Error(`Your session has expired. Sign in again.`);rt.update(e=>e+1),K.update(e=>({...e,isLoading:!1,error:null}))}catch(e){q.set(!1),K.update(t=>({...t,isLoading:!1,error:e instanceof Error?e.message:`Failed to refresh authentication.`}))}}export{q as a,mt as c,jt as d,At as f,s as h,Dt as i,Pt as l,re as m,K as n,rt as o,nt as p,Et as r,Mt as s,Nt as t,kt as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$ as e,F as t,H as n,J as r,Q as i,R as a,X as o,at as s,ct as c,dt as l}from"./D-3DgMVM.js";import{m as u}from"./CZkwsiMM.js";for(var d=`1.45.0`,f=[],p=[],m=Uint8Array,h=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,g=0,_=h.length;g<_;++g)f[g]=h[g],p[h.charCodeAt(g)]=g;p[45]=62,p[95]=63;function v(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function ee(e,t,n){return(t+n)*3/4-n}function y(e){var t,n=v(e),r=n[0],i=n[1],a=new m(ee(e,r,i)),o=0,s=i>0?r-4:r,c;for(c=0;c<s;c+=4)t=p[e.charCodeAt(c)]<<18|p[e.charCodeAt(c+1)]<<12|p[e.charCodeAt(c+2)]<<6|p[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function b(e){return f[e>>18&63]+f[e>>12&63]+f[e>>6&63]+f[e&63]}function te(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(b(r));return i.join(``)}function x(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(te(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(f[t>>2]+f[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(f[t>>10]+f[t>>4&63]+f[t<<2&63]+`=`)),i.join(``)}function S(e){if(e===void 0)return{};if(!re(e))throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function ne(e){if(e===void 0)throw Error(`Client created with undefined deployment address. If you used an environment variable, check that it's set.`);if(typeof e!=`string`)throw Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith(`http:`)||e.startsWith(`https:`)))throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(`.convex.site`))throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function re(e){let t=typeof e==`object`,n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name===`Object`;return t&&r}var ie=!0,C=BigInt(`-9223372036854775808`),w=BigInt(`9223372036854775807`),ae=BigInt(`0`),oe=BigInt(`8`),se=BigInt(`256`),ce=`This commit timestamp is unresolved: its value is assigned when the mutation commits. Read the document after the mutation completes to get its value.`,le=class{[Symbol.toPrimitive](e){if(e===`string`)return this.toString();throw Error(ce)}valueOf(){throw Error(ce)}toJSON(){throw Error(ce)}toString(){return`[unresolved commit timestamp]`}},ue=new le;function de(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function fe(e){e<ae&&(e-=C+C);let t=e.toString(16);t.length%2==1&&(t=`0`+t);let n=new Uint8Array(new ArrayBuffer(8)),r=0;for(let i of t.match(/.{2}/g).reverse())n.set([parseInt(i,16)],r++),e>>=oe;return x(n)}function pe(e){let t=y(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=ae,r=ae;for(let e of t)n+=BigInt(e)*se**r,r++;return n>w&&(n+=C+C),n}function me(e){if(e<C||w<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),x(new Uint8Array(t))}function he(e){let t=y(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}var ge=DataView.prototype.setBigInt64?me:fe,_e=DataView.prototype.getBigInt64?he:pe,ve=1024;function ye(e){if(e.length>ve)throw Error(`Field name ${e} exceeds maximum field name length ${ve}.`);if(e.startsWith(`$`))throw Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<32||n>=127)throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function T(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return e;if(Array.isArray(e))return e.map(e=>T(e));if(typeof e!=`object`)throw Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(t.length===1){let n=t[0][0];if(n===`$bytes`){if(typeof e.$bytes!=`string`)throw Error(`Malformed $bytes field on ${e}`);return y(e.$bytes).buffer}if(n===`$integer`){if(typeof e.$integer!=`string`)throw Error(`Malformed $integer field on ${e}`);return _e(e.$integer)}if(n===`$float`){if(typeof e.$float!=`string`)throw Error(`Malformed $float field on ${e}`);let t=y(e.$float);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);let n=new DataView(t.buffer).getFloat64(0,ie);if(!de(n))throw Error(`Float ${n} should be encoded as a number`);return n}if(n===`$commitTs`){if(e.$commitTs!==null)throw Error(`Malformed $commitTs field on ${e}`);return ue}if(n===`$set`)throw Error(`Received a Set which is no longer supported as a Convex type.`);if(n===`$map`)throw Error(`Received a Map which is no longer supported as a Convex type.`)}let n={};for(let[t,r]of Object.entries(e))ye(t),n[t]=T(r);return n}var be=16384;function E(e){let t=JSON.stringify(e,(e,t)=>t===void 0?`undefined`:typeof t==`bigint`?`${t.toString()}n`:t);if(t.length>be){let e=16370,n=t.codePointAt(e-1);return n!==void 0&&n>65535&&--e,t.substring(0,e)+`[...truncated]`}return t}function D(e,t,n,r){if(e===void 0){let e=n&&` (present at path ${n} in original object ${E(t)})`;throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e==`bigint`){if(e<C||w<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:ge(e)}}if(typeof e==`number`){if(de(e)){let t=new ArrayBuffer(8);return new DataView(t).setFloat64(0,e,ie),{$float:x(new Uint8Array(t))}}return e}if(typeof e==`boolean`||typeof e==`string`)return e;if(e instanceof ArrayBuffer)return{$bytes:x(new Uint8Array(e))};if(e instanceof le)return{$commitTs:null};if(Array.isArray(e))return e.map((e,r)=>D(e,t,n+`[${r}]`,!1));if(e instanceof Set)throw Error(xe(n,`Set`,[...e],t));if(e instanceof Map)throw Error(xe(n,`Map`,[...e],t));if(!re(e)){let r=e?.constructor?.name,i=r?`${r} `:``;throw Error(xe(n,i,e,t))}let i={},a=Object.entries(e);a.sort(([e,t],[n,r])=>e===n?0:e<n?-1:1);for(let[e,o]of a)o===void 0?r&&(ye(e),i[e]=Se(o,t,n+`.${e}`)):(ye(e),i[e]=D(o,t,n+`.${e}`,!1));return i}function xe(e,t,n,r){return e?`${t}${E(n)} is not a supported Convex type (present at path ${e} in original object ${E(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${E(n)} is not a supported Convex type.`}function Se(e,t,n){if(e===void 0)return{$undefined:null};if(t===void 0)throw Error(`Programming error. Current value is ${E(e)} but original value is undefined`);return D(e,t,n,!1)}function O(e){return D(e,e,``,!1)}var Ce=Object.defineProperty,we=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Te=(e,t,n)=>we(e,typeof t==`symbol`?t:t+``,n),Ee,De,Oe=Symbol.for(`ConvexError`),k=class extends (De=Error,Ee=Oe,De){constructor(e){super(typeof e==`string`?e:E(e)),Te(this,`name`,`ConvexError`),Te(this,`data`),Te(this,Ee,!0),this.data=e}},ke=Object.defineProperty,Ae=(e,t,n)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,je=(e,t,n)=>Ae(e,typeof t==`symbol`?t:t+``,n),Me=`color:rgb(0, 145, 255)`;function Ne(e){switch(e){case`query`:return`Q`;case`mutation`:return`M`;case`action`:return`A`;case`any`:return`?`}}var Pe=class{constructor(e){je(this,`_onLogLineFuncs`),je(this,`_verbose`),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let e=0;e<10&&this._onLogLineFuncs[t]!==void 0;e++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(let t of Object.values(this._onLogLineFuncs))t(`debug`,`${new Date().toISOString()}`,...e)}log(...e){for(let t of Object.values(this._onLogLineFuncs))t(`info`,...e)}warn(...e){for(let t of Object.values(this._onLogLineFuncs))t(`warn`,...e)}error(...e){for(let t of Object.values(this._onLogLineFuncs))t(`error`,...e)}};function Fe(e){let t=new Pe(e);return t.addLogLineListener((e,...t)=>{switch(e){case`debug`:console.debug(...t);break;case`info`:console.log(...t);break;case`warn`:console.warn(...t);break;case`error`:console.error(...t);break;default:console.log(...t)}}),t}function Ie(e){return new Pe(e)}function A(e,t,n,r,i){let a=Ne(n);if(typeof i==`object`&&(i=`ConvexError ${JSON.stringify(i.errorData,null,2)}`),t===`info`){let t=i.match(/^\[.*?\] /);if(t===null){e.error(`[CONVEX ${a}(${r})] Could not parse console.log`);return}let n=i.slice(1,t[0].length-2),o=i.slice(t[0].length);e.log(`%c[CONVEX ${a}(${r})] [${n}]`,Me,o)}else e.error(`[CONVEX ${a}(${r})] ${i}`)}function Le(e,t){let n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),Error(n)}function j(e,t,n){return`[CONVEX ${Ne(e)}(${t})] ${n.errorMessage}
|
|
2
|
+
Called by client`}function M(e,t){return t.data=e.errorData,t}function N(e){let t=e.split(`:`),n,r;return t.length===1?(n=t[0],r=`default`):(n=t.slice(0,t.length-1).join(`:`),r=t[t.length-1]),n.endsWith(`.js`)&&(n=n.slice(0,-3)),`${n}:${r}`}function P(e,t){return JSON.stringify({udfPath:N(e),args:O(t)})}function Re(e,t,n){let{initialNumItems:r,id:i}=n;return JSON.stringify({type:`paginated`,udfPath:N(e),args:O(t),options:O({initialNumItems:r,id:i})})}function ze(e){return JSON.parse(e).type===`paginated`}var Be=Object.defineProperty,Ve=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t,n)=>Ve(e,typeof t==`symbol`?t:t+``,n),He=class{constructor(){F(this,`nextQueryId`),F(this,`querySetVersion`),F(this,`querySet`),F(this,`queryIdToToken`),F(this,`identityVersion`),F(this,`auth`),F(this,`outstandingQueriesOlderThanRestart`),F(this,`outstandingAuthOlderThanRestart`),F(this,`paused`),F(this,`pendingQuerySetModifications`),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,t,n,r){let i=N(e),a=P(i,t),o=this.querySet.get(a);if(o!==void 0)return o.numSubscribers+=1,{queryToken:a,modification:null,unsubscribe:()=>this.removeSubscriber(a)};{let e=this.nextQueryId++,o={id:e,canonicalizedUdfPath:i,args:t,numSubscribers:1,journal:n,componentPath:r};this.querySet.set(a,o),this.queryIdToToken.set(e,a);let s=this.querySetVersion,c=this.querySetVersion+1,l={type:`Add`,queryId:e,udfPath:i,args:[O(t)],journal:n,componentPath:r};return this.paused?this.pendingQuerySetModifications.set(e,l):this.querySetVersion=c,{queryToken:a,modification:{type:`ModifyQuerySet`,baseVersion:s,newVersion:c,modifications:[l]},unsubscribe:()=>this.removeSubscriber(a)}}}transition(e){for(let t of e.modifications)switch(t.type){case`QueryUpdated`:case`QueryFailed`:{this.outstandingQueriesOlderThanRestart.delete(t.queryId);let e=t.journal;if(e!==void 0){let n=this.queryIdToToken.get(t.queryId);n!==void 0&&(this.querySet.get(n).journal=e)}break}case`QueryRemoved`:this.outstandingQueriesOlderThanRestart.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}}queryId(e,t){let n=P(N(e),t),r=this.querySet.get(n);return r===void 0?null:r.id}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:`User`,value:e};let t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:`Authenticate`,baseVersion:t,...this.auth}}setAdminAuth(e,t){let n={tokenType:`Admin`,value:e,impersonating:t};this.auth=n;let r=this.identityVersion;return this.paused||(this.identityVersion=r+1),{type:`Authenticate`,baseVersion:r,...n}}clearAuth(){this.auth=void 0,this.markAuthCompletion();let e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:`Authenticate`,tokenType:`None`,baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).canonicalizedUdfPath:null}queryArgs(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();let e=[];for(let t of this.querySet.values()){let n={type:`Add`,queryId:t.id,udfPath:t.canonicalizedUdfPath,args:[O(t.args)],journal:t.journal,componentPath:t.componentPath};e.push(n),this.outstandingQueriesOlderThanRestart.add(t.id)}this.querySetVersion=1;let t={type:`ModifyQuerySet`,baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[t,void 0];this.outstandingAuthOlderThanRestart=!0;let n={type:`Authenticate`,baseVersion:0,...this.auth};return this.identityVersion=1,[t,n]}pause(){this.paused=!0}resume(){let e=this.pendingQuerySetModifications.size>0?{type:`ModifyQuerySet`,baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,t=this.auth===void 0?void 0:{type:`Authenticate`,baseVersion:this.identityVersion++,...this.auth};return this.unpause(),[e,t]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){let t=this.querySet.get(e);if(t.numSubscribers>1)return--t.numSubscribers,null;{this.querySet.delete(e),this.queryIdToToken.delete(t.id),this.outstandingQueriesOlderThanRestart.delete(t.id);let n=this.querySetVersion,r=this.querySetVersion+1,i={type:`Remove`,queryId:t.id};return this.paused?this.pendingQuerySetModifications.has(t.id)?this.pendingQuerySetModifications.delete(t.id):this.pendingQuerySetModifications.set(t.id,i):this.querySetVersion=r,{type:`ModifyQuerySet`,baseVersion:n,newVersion:r,modifications:[i]}}}},Ue=Object.defineProperty,We=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t,n)=>We(e,typeof t==`symbol`?t:t+``,n),Ge=class{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,I(this,`inflightRequests`),I(this,`requestsOlderThanRestart`),I(this,`inflightMutationsCount`,0),I(this,`inflightActionsCount`,0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,t){let n=new Promise(n=>{let r=t?`Requested`:`NotSent`;this.inflightRequests.set(e.requestId,{message:e,status:{status:r,requestedAt:new Date,onResult:n}}),e.type===`Mutation`?this.inflightMutationsCount++:e.type===`Action`&&this.inflightActionsCount++});return this.markConnectionStateDirty(),n}onResponse(e){let t=this.inflightRequests.get(e.requestId);if(t===void 0||t.status.status===`Completed`)return null;let n=t.message.type===`Mutation`?`mutation`:`action`,r=t.message.udfPath;for(let t of e.logLines)A(this.logger,`info`,n,r,t);let i=t.status,a,o;if(e.success)a={success:!0,logLines:e.logLines,value:T(e.result)},o=()=>i.onResult(a);else{let t=e.result,{errorData:s}=e;A(this.logger,`error`,n,r,t),a={success:!1,errorMessage:t,errorData:s===void 0?void 0:T(s),logLines:e.logLines},o=()=>i.onResult(a)}return e.type===`ActionResponse`||!e.success?(o(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),t.message.type===`Action`?this.inflightActionsCount--:t.message.type===`Mutation`&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:a}):(t.status={status:`Completed`,result:a,ts:e.ts,onResolve:o},null)}removeCompleted(e){let t=new Map;for(let[n,r]of this.inflightRequests.entries()){let i=r.status;i.status===`Completed`&&i.ts.lessThanOrEqual(e)&&(i.onResolve(),t.set(n,i.result),r.message.type===`Mutation`?this.inflightMutationsCount--:r.message.type===`Action`&&this.inflightActionsCount--,this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n))}return t.size>0&&this.markConnectionStateDirty(),t}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());let e=[];for(let[t,n]of this.inflightRequests){if(n.status.status===`NotSent`){n.status.status=`Requested`,e.push(n.message);continue}if(n.message.type===`Mutation`)e.push(n.message);else if(n.message.type===`Action`){if(this.inflightRequests.delete(t),this.requestsOlderThanRestart.delete(t),this.inflightActionsCount--,n.status.status===`Completed`)throw Error(`Action should never be in 'Completed' state`);n.status.onResult({success:!1,errorMessage:`Connection lost while action was in flight`,logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){let e=[];for(let[,t]of this.inflightRequests)if(t.status.status===`NotSent`){t.status.status=`Requested`,e.push(t.message);continue}return e}hasIncompleteRequests(){for(let e of this.inflightRequests.values())if(e.status.status===`Requested`)return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(let t of this.inflightRequests.values())t.status.status!==`Completed`&&t.status.requestedAt.getTime()<e&&(e=t.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}},Ke=Object.defineProperty,qe=(e,t,n)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t,n)=>qe(e,typeof t==`symbol`?t:t+``,n),Je=class e{constructor(e){L(this,`queryResults`),L(this,`modifiedQueries`),this.queryResults=e,this.modifiedQueries=[]}getQuery(t,...n){let r=S(n[0]),i=u(t),a=this.queryResults.get(P(i,r));if(a!==void 0)return e.queryValue(a.result)}getAllQueries(t){let n=[],r=u(t);for(let t of this.queryResults.values())t.udfPath===N(r)&&n.push({args:t.args,value:e.queryValue(t.result)});return n}setQuery(e,t,n){let r=S(t),i=u(e),a=P(i,r),o;o=n===void 0?void 0:{success:!0,value:n,logLines:[]};let s={udfPath:i,args:r,result:o};this.queryResults.set(a,s),this.modifiedQueries.push(a)}static queryValue(e){if(e!==void 0&&e.success)return e.value}},Ye=class{constructor(){L(this,`queryResults`),L(this,`optimisticUpdates`),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,t){this.optimisticUpdates=this.optimisticUpdates.filter(e=>!t.has(e.mutationId));let n=this.queryResults;this.queryResults=new Map(e);let r=new Je(this.queryResults);for(let e of this.optimisticUpdates)e.update(r);let i=[];for(let[e,t]of this.queryResults){let r=n.get(e);(r===void 0||r.result!==t.result)&&i.push(e)}return i}applyOptimisticUpdate(e,t){this.optimisticUpdates.push({update:e,mutationId:t});let n=new Je(this.queryResults);return e(n),n.modifiedQueries}rawQueryResult(e){let t=this.queryResults.get(e);if(t!==void 0)return t.result}queryResult(e){let t=this.queryResults.get(e);if(t===void 0)return;let n=t.result;if(n!==void 0){if(n.success)return n.value;throw n.errorData===void 0?Error(j(`query`,t.udfPath,n)):M(n,new k(j(`query`,t.udfPath,n)))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}},Xe=Object.defineProperty,Ze=(e,t,n)=>t in e?Xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t,n)=>Ze(e,typeof t==`symbol`?t:t+``,n),z=class e{constructor(e,t){R(this,`low`),R(this,`high`),R(this,`__isUnsignedLong__`),this.low=e|0,this.high=t|0,this.__isUnsignedLong__=!0}static isLong(e){return(e&&e.__isUnsignedLong__)===!0}static fromBytesLE(t){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){let e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(t){return isNaN(t)||t<0?Qe:t>=et?tt:new e(t%B|0,t/B|0)}toString(){return(BigInt(this.high)*BigInt(B)+BigInt(this.low)).toString()}equals(t){return e.isLong(t)||(t=e.fromValue(t)),this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low}notEquals(e){return!this.equals(e)}comp(t){return e.isLong(t)||(t=e.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return this.comp(e)<=0}static fromValue(t){return typeof t==`number`?e.fromNumber(t):new e(t.low,t.high)}},Qe=new z(0,0),$e=65536,B=$e*$e,et=B*B,tt=new z(-1,-1),nt=Object.defineProperty,rt=(e,t,n)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t,n)=>rt(e,typeof t==`symbol`?t:t+``,n),it=class{constructor(e,t){V(this,`version`),V(this,`remoteQuerySet`),V(this,`queryPath`),V(this,`logger`),this.version={querySet:0,ts:z.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=t}transition(e){let t=e.startVersion;if(this.version.querySet!==t.querySet||this.version.ts.notEquals(t.ts)||this.version.identity!==t.identity)throw Error(`Invalid start version: ${t.ts.toString()}:${t.querySet}:${t.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(let t of e.modifications)switch(t.type){case`QueryUpdated`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)A(this.logger,`info`,`query`,e,n);let n=T(t.value??null);this.remoteQuerySet.set(t.queryId,{success:!0,value:n,logLines:t.logLines});break}case`QueryFailed`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)A(this.logger,`info`,`query`,e,n);let{errorData:n}=t;this.remoteQuerySet.set(t.queryId,{success:!1,errorMessage:t.errorMessage,errorData:n===void 0?void 0:T(n),logLines:t.logLines});break}case`QueryRemoved`:this.remoteQuerySet.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}};function at(e){let t=y(e);return z.fromBytesLE(Array.from(t))}function ot(e){return x(new Uint8Array(e.toBytesLE()))}function st(e){switch(e.type){case`FatalError`:case`AuthError`:case`ActionResponse`:case`TransitionChunk`:case`Ping`:return{...e};case`MutationResponse`:return e.success?{...e,ts:at(e.ts)}:{...e};case`Transition`:return{...e,startVersion:{...e.startVersion,ts:at(e.startVersion.ts)},endVersion:{...e.endVersion,ts:at(e.endVersion.ts)}}}}function ct(e){switch(e.type){case`Authenticate`:case`ModifyQuerySet`:case`Mutation`:case`Action`:case`Event`:return{...e};case`Connect`:return e.maxObservedTimestamp===void 0?{...e,maxObservedTimestamp:void 0}:{...e,maxObservedTimestamp:ot(e.maxObservedTimestamp)}}}var lt=Object.defineProperty,ut=(e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t,n)=>ut(e,typeof t==`symbol`?t:t+``,n),dt=1e3,ft=1001,pt=1005,mt=4040,U;function W(){return U===void 0&&(U=Date.now()),typeof performance>`u`||!performance.now?Date.now():Math.round(U+performance.now())}function ht(){return`t=${Math.round((W()-U)/100)/10}s`}var gt={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function _t(e){if(e===void 0)return`Unknown`;for(let t of Object.keys(gt))if(e.startsWith(t))return t;return`Unknown`}var vt=class{constructor(e,t,n,r,i,a){this.markConnectionStateDirty=i,this.debug=a,H(this,`socket`),H(this,`connectionCount`),H(this,`_hasEverConnected`,!1),H(this,`lastCloseReason`),H(this,`transitionChunkBuffer`,null),H(this,`defaultInitialBackoff`),H(this,`maxBackoff`),H(this,`retries`),H(this,`serverInactivityThreshold`),H(this,`reconnectDueToServerInactivityTimeout`),H(this,`scheduledReconnect`,null),H(this,`networkOnlineHandler`,null),H(this,`pendingNetworkRecoveryInfo`,null),H(this,`uri`),H(this,`onOpen`),H(this,`onResume`),H(this,`onMessage`),H(this,`webSocketConstructor`),H(this,`logger`),H(this,`onServerDisconnectError`),this.webSocketConstructor=n,this.socket={state:`disconnected`},this.connectionCount=0,this.lastCloseReason=`InitialConnect`,this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=t.onOpen,this.onResume=t.onResume,this.onMessage=t.onMessage,this.onServerDisconnectError=t.onServerDisconnectError,this.logger=r,this.setupNetworkListener(),this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>`u`||typeof window.addEventListener!=`function`||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose(`network online event detected`),this.tryReconnectImmediately()},window.addEventListener(`online`,this.networkOnlineHandler),this._logVerbose(`network online event listener registered`))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<`u`&&typeof window.removeEventListener==`function`&&(window.removeEventListener(`online`,this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose(`network online event listener removed`))}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,Error(`Invalid TransitionChunk`);if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){let t=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,Error(`TransitionChunk received out of order: expected part ${t}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){let e=this.transitionChunkBuffer.chunks.join(``);this.transitionChunkBuffer=null;let t=st(JSON.parse(e));if(t.type!==`Transition`)throw Error(`Expected Transition, got ${t.type} after assembling chunks`);return t}return null}connect(){if(this.socket.state===`terminated`)return;if(this.socket.state!==`disconnected`&&this.socket.state!==`stopped`)throw Error(`Didn't start connection from disconnected state: `+this.socket.state);let e=new this.webSocketConstructor(this.uri);this._logVerbose(`constructed WebSocket`),this.setSocketState({state:`connecting`,ws:e,paused:`no`}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose(`begin ws.onopen`),this.socket.state!==`connecting`)throw Error(`onopen called with socket not in connecting state`);if(this.setSocketState({state:`ready`,ws:e,paused:this.socket.paused===`yes`?`uninitialized`:`no`}),this.resetServerInactivityTimeout(),this.socket.paused===`no`&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:W()})),this.lastCloseReason!==`InitialConnect`&&(this.lastCloseReason?this.logger.log(`WebSocket reconnected at`,ht(),`after disconnect due to`,this.lastCloseReason):this.logger.log(`WebSocket reconnected at`,ht())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){let{timeSavedMs:e}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:`Event`,eventType:`NetworkRecoveryReconnect`,event:{timeSavedMs:e}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(e/1e3)}s of waiting`)}},e.onerror=e=>{this.transitionChunkBuffer=null;let t=e.message;t&&this.logger.log(`WebSocket error message: ${t}`)},e.onmessage=e=>{this.resetServerInactivityTimeout();let t=e.data.length,n=st(JSON.parse(e.data));if(this._logVerbose(`received ws message with type ${n.type}`),n.type!==`Ping`){if(n.type===`TransitionChunk`){let e=this.assembleTransition(n);if(!e)return;n=e,this._logVerbose(`assembled full ws message of type ${n.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${n.type} while buffering TransitionChunks`)),n.type===`Transition`&&this.reportLargeTransition({messageLength:t,transition:n}),this.onMessage(n).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())}},e.onclose=e=>{if(this._logVerbose(`begin ws.onclose`),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=e.reason||`closed with code ${e.code}`),e.code!==dt&&e.code!==ft&&e.code!==pt&&e.code!==mt){let t=`WebSocket closed with code ${e.code}`;e.reason&&(t+=`: ${e.reason}`),this.logger.log(t),this.onServerDisconnectError&&e.reason&&this.onServerDisconnectError(t)}let t=_t(e.reason);this.scheduleReconnect(t)}}socketState(){return this.socket.state}sendMessage(e){let t={type:e.type,...e.type===`Authenticate`&&e.tokenType===`User`?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state===`ready`&&this.socket.paused===`no`){let n=ct(e),r=JSON.stringify(n),i=!1;try{this.socket.ws.send(r),i=!0}catch(e){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${e}`),this.closeAndReconnect(`FailedToSendMessage`)}return this._logVerbose(`${i?`sent`:`failed to send`} message with type ${e.type}: ${JSON.stringify(t)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}): ${JSON.stringify(t)}`),!1}resetServerInactivityTimeout(){this.socket.state!==`terminated`&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect(`InactiveServer`)},this.serverInactivityThreshold))}scheduleReconnect(e){this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.socket={state:`disconnected`};let t=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);let n=W(),r=setTimeout(()=>{this.scheduledReconnect?.timeout===r&&(this.scheduledReconnect=null,this.connect())},t);this.scheduledReconnect={timeout:r,scheduledAt:n,backoffMs:t}}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return;case`connecting`:case`ready`:this.lastCloseReason=e,this.close(),this.scheduleReconnect(`client`);return;default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return Promise.resolve();case`connecting`:{let e=this.socket.ws;return e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)},new Promise(t=>{e.onclose=()=>{this._logVerbose(`Closed after connecting`),t()},e.onopen=()=>{this._logVerbose(`Opened after connecting`),e.close()}})}case`ready`:{this._logVerbose(`ws.close called`);let e=this.socket.ws;e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)};let t=new Promise(t=>{e.onclose=()=>{t()}});return e.close(),t}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.cleanupNetworkListener(),this.socket.state){case`terminated`:case`stopped`:case`disconnected`:case`connecting`:case`ready`:{let e=this.close();return this.setSocketState({state:`terminated`}),e}default:throw this.socket,Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case`terminated`:return Promise.resolve();case`connecting`:case`stopped`:case`disconnected`:case`ready`:{this.cleanupNetworkListener();let e=this.close();return this.socket={state:`stopped`},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case`stopped`:break;case`terminated`:case`connecting`:case`ready`:case`disconnected`:this.logger.logVerbose(`Restart called without stopping first`);return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case`disconnected`:case`stopped`:case`terminated`:return;case`connecting`:case`ready`:this.socket={...this.socket,paused:`yes`};return;default:this.socket;return}}tryReconnectImmediately(){if(this._logVerbose(`tryReconnectImmediately called`),this.socket.state!==`disconnected`){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let e=null;if(this.scheduledReconnect){let t=W()-this.scheduledReconnect.scheduledAt;e=Math.max(0,this.scheduledReconnect.backoffMs-t),this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose(`canceled scheduled reconnect`)}this.logger.log(`Network recovery detected, reconnecting immediately`),this.pendingNetworkRecoveryInfo=e===null?null:{timeSavedMs:e},this.connect()}resume(){switch(this.socket.state){case`connecting`:this.socket={...this.socket,paused:`no`};return;case`ready`:this.socket.paused===`uninitialized`?(this.socket={...this.socket,paused:`no`},this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:W()})):this.socket.paused===`yes`&&(this.socket={...this.socket,paused:`no`},this.onResume());return;case`terminated`:case`stopped`:case`disconnected`:return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state===`ready`,hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){let t=(e===`client`?100:e===`Unknown`?this.defaultInitialBackoff:gt[e].timeout)*2**this.retries;this.retries+=1;let n=Math.min(t,this.maxBackoff);return n+n*(Math.random()-.5)}reportLargeTransition({transition:e,messageLength:t}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;let n=W()-e.clientClockSkew-e.serverTs/1e6,r=`${Math.round(n)}ms`,i=`${Math.round(t/1e4)/100}MB`,a=t/(n/1e3),o=`${Math.round(a/1e4)/100}MB per second`;this._logVerbose(`received ${i} transition in ${r} at ${o}`),t>2e7?this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`):n>2e4&&this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`),this.debug&&this.sendMessage({type:`Event`,eventType:`ClientReceivedTransition`,event:{transitionTransitTime:n,messageLength:t}})}};function yt(){return bt()}function bt(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var G=class extends Error{};G.prototype.name=`InvalidTokenError`;function xt(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n}))}function St(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`base64 string is not of the correct length`)}try{return xt(t)}catch{return atob(t)}}function Ct(e,t){if(typeof e!=`string`)throw new G(`Invalid token specified: must be a string`);t||={};let n=t.header===!0?0:1,r=e.split(`.`)[n];if(typeof r!=`string`)throw new G(`Invalid token specified: missing part #${n+1}`);let i;try{i=St(r)}catch(e){throw new G(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new G(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}var wt=Object.defineProperty,Tt=(e,t,n)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t,n)=>Tt(e,typeof t==`symbol`?t:t+``,n),Et=1728e6,Dt=2,Ot=class{constructor(e,t,n){K(this,`authState`,{state:`noAuth`}),K(this,`configVersion`,0),K(this,`syncState`),K(this,`authenticate`),K(this,`stopSocket`),K(this,`tryRestartSocket`),K(this,`pauseSocket`),K(this,`resumeSocket`),K(this,`clearAuth`),K(this,`logger`),K(this,`refreshTokenLeewaySeconds`),K(this,`initialAuthTokenReuse`),K(this,`lastRefreshChange`),K(this,`tokenConfirmationAttempts`,0),this.syncState=e,this.authenticate=t.authenticate,this.stopSocket=t.stopSocket,this.tryRestartSocket=t.tryRestartSocket,this.pauseSocket=t.pauseSocket,this.resumeSocket=t.resumeSocket,this.clearAuth=t.clearAuth,this.logger=n.logger,this.refreshTokenLeewaySeconds=n.refreshTokenLeewaySeconds,this.initialAuthTokenReuse=n.initialAuthTokenReuse,this.lastRefreshChange=!1}notifyRefreshChange(e){this.authState.state!==`noAuth`&&this.authState.state!==`initialRefetch`&&this.authState.config.onRefreshChange&&this.lastRefreshChange!==e&&(this.lastRefreshChange=e,this.authState.config.onRefreshChange(e))}async setConfig(e,t,n){this.resetAuthState(),this._logVerbose(`pausing WS for auth token fetch`),this.pauseSocket();let r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});if(r.isFromOutdatedConfig)return;let i={fetchToken:e,onAuthChange:t,onRefreshChange:n};r.value?(this.setAuthState({state:`waitingForServerConfirmationOfCachedToken`,config:i,hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:`initialRefetch`,config:i}),await this.refetchToken()),this._logVerbose(`resuming WS after auth token fetch`),this.resumeSocket()}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state===`waitingForServerConfirmationOfCachedToken`){this._logVerbose(`server confirmed auth token is valid`);let t=this.syncState.getAuth()?.value;this.initialAuthTokenReuse&&t?this.scheduleTokenRefetch(t,e.clientClockSkew):this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this._logVerbose(`server confirmed new auth token is valid`),this.notifyRefreshChange(!1),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state===`waitingForServerConfirmationOfFreshToken`||this.authState.state===`waitingForServerConfirmationOfCachedToken`)){this._logVerbose(`ignoring non-auth token expired error`);return}let{baseVersion:t}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(t+1)){this._logVerbose(`ignoring auth error for previous auth attempt`);return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),this.authState.state===`noAuth`||this.authState.state===`waitingForServerConfirmationOfFreshToken`&&this.tokenConfirmationAttempts>=Dt){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!==`noAuth`&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}if(this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${Dt-this.tokenConfirmationAttempts} attempts remaining`)),this.notifyRefreshChange(!0),await this.stopSocket(),this.authState.state===`noAuth`)return;let t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value&&this.syncState.isNewAuth(t.value)?(this.authenticate(t.value),this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,config:this.authState.config,token:t.value,hadAuth:this.authState.state===`notRefetching`||this.authState.state===`waitingForScheduledRefetch`})):(this._logVerbose(`reauthentication failed, could not fetch a new token`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state===`noAuth`)return;this._logVerbose(`refetching auth token`);let e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:`notRefetching`,config:this.authState.config}):(this._logVerbose(`refetching token failed`),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose(`restarting WS after auth token fetch (if currently stopped)`),this.tryRestartSocket())}scheduleTokenRefetch(e,t){if(this.authState.state===`noAuth`)return;let n=this.decodeToken(e);if(!n){this.logger.error(`Auth token is not a valid JWT, cannot refetch the token`);return}let{iat:r,exp:i}=n;if(!r||!i){this.logger.error(`Auth token does not have required fields, cannot refetch the token`);return}let a=i-r;if(a<=2){this.logger.error(`Auth token does not live long enough, cannot refetch the token`);return}let o;t===void 0?o=a:(o=i-(Date.now()-t)/1e3,o<=0&&(o=0));let s=Math.min(Et,(o-this.refreshTokenLeewaySeconds)*1e3);s<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${o}s`),s=0);let c=setTimeout(()=>{this._logVerbose(`running scheduled token refetch`),this.refetchToken()},s);this.setAuthState({state:`waitingForScheduledRefetch`,refetchTokenTimeoutId:c,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${s}ms`)}async fetchTokenAndGuardAgainstRace(e,t){let n=++this.configVersion;this._logVerbose(`fetching token with config version ${n}`);let r=await e(t);return this.configVersion===n?{isFromOutdatedConfig:!1,value:r}:(this._logVerbose(`stale config version, expected ${n}, got ${this.configVersion}`),{isFromOutdatedConfig:!0})}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.notifyRefreshChange(!1),this.setAuthState({state:`noAuth`})}setAuthState(e){let t=e.state===`waitingForServerConfirmationOfFreshToken`?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(t)}`),e.state){case`waitingForScheduledRefetch`:case`notRefetching`:case`noAuth`:this.tokenConfirmationAttempts=0}this.authState.state===`waitingForScheduledRefetch`&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=e}decodeToken(e){try{return Ct(e)}catch(e){return this._logVerbose(`Error decoding token: ${e instanceof Error?e.message:`Unknown error`}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}},kt=[`convexClientConstructed`,`convexWebSocketOpen`,`convexFirstMessageReceived`];function At(e,t){let n={sessionId:t};typeof performance>`u`||!performance.mark||performance.mark(e,{detail:n})}function jt(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function Mt(e){if(typeof performance>`u`||!performance.getEntriesByName)return[];let t=[];for(let n of kt){let r=performance.getEntriesByName(n).filter(e=>e.entryType===`mark`).filter(t=>t.detail.sessionId===e);t.push(...r)}return t.map(jt)}var Nt=Object.defineProperty,Pt=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t,n)=>Pt(e,typeof t==`symbol`?t:t+``,n),Ft=class{constructor(e,t,n){if(q(this,`address`),q(this,`state`),q(this,`requestManager`),q(this,`webSocketManager`),q(this,`authenticationManager`),q(this,`remoteQuerySet`),q(this,`optimisticQueryResults`),q(this,`_transitionHandlerCounter`,0),q(this,`_nextRequestId`),q(this,`_onTransitionFns`,new Map),q(this,`_sessionId`),q(this,`firstMessageReceived`,!1),q(this,`debug`),q(this,`logger`),q(this,`maxObservedTimestamp`),q(this,`connectionStateSubscribers`,new Map),q(this,`nextConnectionStateSubscriberId`,0),q(this,`_lastPublishedConnectionState`),q(this,`markConnectionStateDirty`,()=>{Promise.resolve().then(()=>{let e=this.connectionState();if(JSON.stringify(e)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=e;for(let t of this.connectionStateSubscribers.values())t(e)}})}),q(this,`mark`,e=>{this.debug&&At(e,this.sessionId)}),typeof e==`object`)throw Error(`Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.`);n?.skipConvexDeploymentUrlCheck!==!0&&ne(e),n={...n};let r=n.authRefreshTokenLeewaySeconds??10,i=n.webSocketConstructor;if(!i&&typeof WebSocket>`u`)throw Error(`No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient`);i||=WebSocket,this.debug=n.reportDebugInfoToConvex??!1,this.address=e,this.logger=n.logger===!1?Ie({verbose:n.verbose??!1}):n.logger!==!0&&n.logger?n.logger:Fe({verbose:n.verbose??!1});let a=e.search(`://`);if(a===-1)throw Error(`Provided address was not an absolute URL.`);let o=e.substring(a+3),s=e.substring(0,a),c;if(s===`http`)c=`ws`;else if(s===`https`)c=`wss`;else throw Error(`Unknown parent protocol ${s}`);let l=`${c}://${o}/api/${d}/sync`;this.state=new He,this.remoteQuerySet=new it(e=>this.state.queryPath(e),this.logger),this.requestManager=new Ge(this.logger,this.markConnectionStateDirty);let u=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new Ot(this.state,{authenticate:e=>{let t=this.state.setAuth(e);return this.webSocketManager.sendMessage(t),t.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:u,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:r,initialAuthTokenReuse:n.initialAuthTokenReuse??!1}),this.optimisticQueryResults=new Ye,this.addOnTransitionHandler(e=>{t(e.queries.map(e=>e.token))}),this._nextRequestId=0,this._sessionId=yt();let{unsavedChangesWarning:f}=n;if(typeof window>`u`||window.addEventListener===void 0){if(f===!0)throw Error(`unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.`)}else f!==!1&&window.addEventListener(`beforeunload`,e=>{if(this.requestManager.hasIncompleteRequests()){e.preventDefault();let t=`Are you sure you want to leave? Your changes may not be saved.`;return(e||window.event).returnValue=t,t}});this.webSocketManager=new vt(l,{onOpen:e=>{this.mark(`convexWebSocketOpen`),this.webSocketManager.sendMessage({...e,type:`Connect`,sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new it(e=>this.state.queryPath(e),this.logger);let[t,n]=this.state.restart();n&&this.webSocketManager.sendMessage(n),this.webSocketManager.sendMessage(t);for(let e of this.requestManager.restart())this.webSocketManager.sendMessage(e)},onResume:()=>{let[e,t]=this.state.resume();t&&this.webSocketManager.sendMessage(t),e&&this.webSocketManager.sendMessage(e);for(let e of this.requestManager.resume())this.webSocketManager.sendMessage(e)},onMessage:e=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark(`convexFirstMessageReceived`),this.reportMarks()),e.type){case`Transition`:{this.observedTimestamp(e.endVersion.ts),this.authenticationManager.onTransition(e),this.remoteQuerySet.transition(e),this.state.transition(e);let t=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(t);break}case`MutationResponse`:{e.success&&this.observedTimestamp(e.ts);let t=this.requestManager.onResponse(e);t!==null&&this.notifyOnQueryResultChanges(new Map([[t.requestId,t.result]]));break}case`ActionResponse`:this.requestManager.onResponse(e);break;case`AuthError`:this.authenticationManager.onAuthError(e);break;case`FatalError`:{let t=Le(this.logger,e.error);throw this.webSocketManager.terminate(),t}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:n.onServerDisconnectError},i,this.logger,this.markConnectionStateDirty,this.debug),this.mark(`convexClientConstructed`),n.expectAuth&&u()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){let t=this.remoteQuerySet.remoteQueryResults(),n=new Map;for(let[e,r]of t){let t=this.state.queryToken(e);if(t!==null){let i={result:r,udfPath:this.state.queryPath(e),args:this.state.queryArgs(e)};n.set(t,i)}}let r=this.optimisticQueryResults.ingestQueryResultsFromServer(n,new Set(e.keys()));this.handleTransition({queries:r.map(e=>({token:e,modification:{kind:`Updated`,result:this.optimisticQueryResults.rawQueryResult(e)}})),reflectedMutations:Array.from(e).map(([e,t])=>({requestId:e,result:t})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(let t of this._onTransitionFns.values())t(e)}addOnTransitionHandler(e){let t=this._transitionHandlerCounter++;return this._onTransitionFns.set(t,e),()=>this._onTransitionFns.delete(t)}getCurrentAuthClaims(){let e=this.state.getAuth(),t={};if(e&&e.tokenType===`User`)try{t=e?Ct(e.value):{}}catch{t={}}else return;return{token:e.value,decoded:t}}setAuth(e,t,n){this.authenticationManager.setConfig(e,t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,t){let n=this.state.setAdminAuth(e,t);this.webSocketManager.sendMessage(n)}clearAuth(){let e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,t,n){let r=S(t),{modification:i,queryToken:a,unsubscribe:o}=this.state.subscribe(e,r,n?.journal,n?.componentPath);return i!==null&&this.webSocketManager.sendMessage(i),{queryToken:a,unsubscribe:()=>{let e=o();e&&this.webSocketManager.sendMessage(e)}}}localQueryResult(e,t){let n=P(e,S(t));return this.optimisticQueryResults.queryResult(n)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,t){let n=P(e,S(t));return this.optimisticQueryResults.queryLogs(n)}queryJournal(e,t){let n=P(e,S(t));return this.state.queryJournal(n)}connectionState(){let e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){let t=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(t,e),()=>{this.connectionStateSubscribers.delete(t)}}async mutation(e,t,n){let r=await this.mutationInternal(e,t,n);if(!r.success)throw r.errorData===void 0?Error(j(`mutation`,e,r)):M(r,new k(j(`mutation`,e,r)));return r.value}async mutationInternal(e,t,n,r){let{mutationPromise:i}=this.enqueueMutation(e,t,n,r);return i}enqueueMutation(e,t,n,r){let i=S(t);this.tryReportLongDisconnect();let a=this.nextRequestId;if(this._nextRequestId++,n!==void 0){let e=n.optimisticUpdate;if(e!==void 0){let t=this.optimisticQueryResults.applyOptimisticUpdate(t=>{e(t,i)instanceof Promise&&this.logger.warn(`Optimistic update handler returned a Promise. Optimistic updates should be synchronous.`)},a).map(e=>{let t=this.localQueryResultByToken(e);return{token:e,modification:{kind:`Updated`,result:t===void 0?void 0:{success:!0,value:t,logLines:[]}}}});this.handleTransition({queries:t,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}let o={type:`Mutation`,requestId:a,udfPath:e,componentPath:r,args:[O(i)]},s=this.webSocketManager.sendMessage(o);return{requestId:a,mutationPromise:this.requestManager.request(o,s)}}async action(e,t){let n=await this.actionInternal(e,t);if(!n.success)throw n.errorData===void 0?Error(j(`action`,e,n)):M(n,new k(j(`action`,e,n)));return n.value}async actionInternal(e,t,n){let r=S(t),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();let a={type:`Action`,requestId:i,udfPath:e,componentPath:n,args:[O(r)]},o=this.webSocketManager.sendMessage(a);return this.requestManager.request(a,o)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){let e=Mt(this.sessionId);this.webSocketManager.sendMessage({type:`Event`,eventType:`ClientConnect`,event:e})}}tryReportLongDisconnect(){if(!this.debug)return;let e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=6e4)return;let t=`${this.address}/api/debug_event`;fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`,"Convex-Client":`npm-${d}`},body:JSON.stringify({event:`LongWebsocketDisconnect`})}).then(e=>{e.ok||this.logger.warn(`Analytics request failed with response:`,e.body)}).catch(e=>{this.logger.warn(`Analytics response failed with error:`,e)})}};function J(e){if(typeof e!=`object`||!e||!Array.isArray(e.page)||typeof e.isDone!=`boolean`||typeof e.continueCursor!=`string`)throw Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var It=Object.defineProperty,Lt=(e,t,n)=>t in e?It(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t,n)=>Lt(e,typeof t==`symbol`?t:t+``,n),zt=class{constructor(e,t){this.client=e,this.onTransition=t,Rt(this,`paginatedQuerySet`,new Map),Rt(this,`lastTransitionTs`),this.lastTransitionTs=z.fromNumber(0),this.client.addOnTransitionHandler(e=>this.onBaseTransition(e))}subscribe(e,t,n){let r=N(e),i=Re(r,t,n),a=()=>this.removePaginatedQuerySubscriber(i),o=this.paginatedQuerySet.get(i);return o?(o.numSubscribers+=1,{paginatedQueryToken:i,unsubscribe:a}):(this.paginatedQuerySet.set(i,{token:i,canonicalizedUdfPath:r,args:t,numSubscribers:1,options:{initialNumItems:n.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:n.id}),this.addPageToPaginatedQuery(i,null,n.initialNumItems),{paginatedQueryToken:i,unsubscribe:a})}localQueryResult(e,t,n){let r=Re(N(e),t,n);return this.localQueryResultByToken(r)}localQueryResultByToken(e){let t=this.paginatedQuerySet.get(e);if(!t)return;let n=this.activePageQueryTokens(t);if(n.length===0)return{results:[],status:`LoadingFirstPage`,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)};let r=[],i=!1,a=!1;for(let e of n){let t=this.client.localQueryResultByToken(e);if(t===void 0){i=!0,a=!1;continue}let n=J(t);r=r.concat(n.page),a=!!n.isDone}let o;return o=i?r.length===0?`LoadingFirstPage`:`LoadingMore`:a?`Exhausted`:`CanLoadMore`,{results:r,status:o,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)}}onBaseTransition(e){let t=e.queries.map(e=>e.token),n=this.queriesContainingTokens(t),r=[];n.length>0&&(this.processPaginatedQuerySplits(n,e=>this.client.localQueryResultByToken(e)),r=n.map(e=>({token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}})));let i={...e,paginatedQueries:r};this.onTransition(i)}loadMoreOfPaginatedQuery(e,t){this.mustGetPaginatedQuery(e);let n=this.queryTokenForLastPageOfPaginatedQuery(e),r=this.client.localQueryResultByToken(n);if(!r)return!1;let i=J(r);if(i.isDone)return!1;this.addPageToPaginatedQuery(e,i.continueCursor,t);let a={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}}]};return this.onTransition(a),!0}queriesContainingTokens(e){if(e.length===0)return[];let t=[],n=new Set(e);for(let[e,r]of this.paginatedQuerySet)for(let i of this.allQueryTokens(r))if(n.has(i)){t.push(e);break}return t}processPaginatedQuerySplits(e,t){for(let n of e){let e=this.mustGetPaginatedQuery(n),{ongoingSplits:r,pageKeyToQuery:i,pageKeys:a}=e;for(let[n,[a,o]]of r)t(i.get(a).queryToken)!==void 0&&t(i.get(o).queryToken)!==void 0&&this.completePaginatedQuerySplit(e,n,a,o);for(let n of a){if(r.has(n))continue;let a=i.get(n);if(!a)throw Error(`No page query for active pageKey ${n}`);let o=t(a.queryToken);if(!o)continue;let s=J(o);s.splitCursor&&(s.pageStatus===`SplitRecommended`||s.pageStatus===`SplitRequired`||s.page.length>e.options.initialNumItems*2)&&this.splitPaginatedQueryPage(e,n,a.cursor,s.splitCursor,s.continueCursor)}}}splitPaginatedQueryPage(e,t,n,r,i){let a=e.nextPageKey++,o=e.nextPageKey++,s={numItems:e.options.initialNumItems,id:e.id},c=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...s,cursor:n,endCursor:r}});e.pageKeyToQuery.set(a,{...c,cursor:n});let l=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...s,cursor:r,endCursor:i}});e.pageKeyToQuery.set(o,{...l,cursor:r}),e.ongoingSplits.set(t,[a,o])}addPageToPaginatedQuery(e,t,n){let r=this.mustGetPaginatedQuery(e),i=r.nextPageKey++,a={cursor:t,numItems:n,id:r.id},o={...r.args,paginationOpts:a},s=this.client.subscribe(r.canonicalizedUdfPath,o);return r.pageKeys.push(i),r.pageKeyToQuery.set(i,{...s,cursor:t}),s}removePaginatedQuerySubscriber(e){let t=this.paginatedQuerySet.get(e);if(t&&(--t.numSubscribers,!(t.numSubscribers>0))){for(let e of t.pageKeyToQuery.values())e.unsubscribe();this.paginatedQuerySet.delete(e)}}completePaginatedQuerySplit(e,t,n,r){let i=e.pageKeyToQuery.get(t);e.pageKeyToQuery.delete(t);let a=e.pageKeys.indexOf(t);e.pageKeys.splice(a,1,n,r),e.ongoingSplits.delete(t),i.unsubscribe()}activePageQueryTokens(e){return e.pageKeys.map(t=>e.pageKeyToQuery.get(t).queryToken)}allQueryTokens(e){return Array.from(e.pageKeyToQuery.values()).map(e=>e.queryToken)}queryTokenForLastPageOfPaginatedQuery(e){let t=this.mustGetPaginatedQuery(e),n=t.pageKeys[t.pageKeys.length-1];if(n===void 0)throw Error(`No pages for paginated query ${e}`);return t.pageKeyToQuery.get(n).queryToken}mustGetPaginatedQuery(e){let t=this.paginatedQuerySet.get(e);if(!t)throw Error(`paginated query no longer exists for token `+e);return t}},Bt=Object.defineProperty,Vt=(e,t,n)=>t in e?Bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y=(e,t,n)=>Vt(e,typeof t==`symbol`?t:t+``,n),Ht,Ut=class{constructor(e,t={}){Y(this,`listeners`),Y(this,`_client`),Y(this,`_paginatedClient`),Y(this,`callNewListenersWithCurrentValuesTimer`),Y(this,`_closed`),Y(this,`_disabled`),t.skipConvexDeploymentUrlCheck!==!0&&ne(e);let{disabled:n,...r}=t;this._closed=!1,this._disabled=!!n,Ht&&!(`webSocketConstructor`in r)&&typeof WebSocket>`u`&&(r.webSocketConstructor=Ht),typeof window>`u`&&!(`unsavedChangesWarning`in r)&&(r.unsavedChangesWarning=!1),this.disabled||(this._client=new Ft(e,()=>{},r),this._paginatedClient=new zt(this._client,e=>this._transition(e))),this.listeners=new Set}get closed(){return this._closed}get client(){if(this._client)return this._client;throw Error(`ConvexClient is disabled`)}get paginatedClient(){if(this._paginatedClient)return this._paginatedClient;throw Error(`ConvexClient is disabled`)}get disabled(){return this._disabled}onUpdate(e,t,n,r){if(this.disabled)return this.createDisabledUnsubscribe();let{queryToken:i,unsubscribe:a}=this.client.subscribe(u(e),t),o={queryToken:i,callback:n,onError:r,unsubscribe:a,hasEverRun:!1,query:e,args:t,paginationOptions:void 0};this.listeners.add(o),this.queryResultReady(i)&&this.callNewListenersWithCurrentValuesTimer===void 0&&(this.callNewListenersWithCurrentValuesTimer=setTimeout(()=>this.callNewListenersWithCurrentValues(),0));let s={unsubscribe:()=>{this.closed||(this.listeners.delete(o),a())},getCurrentValue:()=>this.client.localQueryResultByToken(i),getQueryLogs:()=>this.client.localQueryLogs(i)},c=s.unsubscribe;return Object.assign(c,s),c}onPaginatedUpdate_experimental(e,t,n,r,i){if(this.disabled)return this.createDisabledUnsubscribe();let a={initialNumItems:n.initialNumItems,id:-1},{paginatedQueryToken:o,unsubscribe:s}=this.paginatedClient.subscribe(u(e),t,a),c={queryToken:o,callback:r,onError:i,unsubscribe:s,hasEverRun:!1,query:e,args:t,paginationOptions:a};this.listeners.add(c),this.paginatedClient.localQueryResultByToken(o)&&this.callNewListenersWithCurrentValuesTimer===void 0&&(this.callNewListenersWithCurrentValuesTimer=setTimeout(()=>this.callNewListenersWithCurrentValues(),0));let l={unsubscribe:()=>{this.closed||(this.listeners.delete(c),s())},getCurrentValue:()=>this.paginatedClient.localQueryResult(u(e),t,a),getQueryLogs:()=>[]},d=l.unsubscribe;return Object.assign(d,l),d}callNewListenersWithCurrentValues(){this.callNewListenersWithCurrentValuesTimer=void 0,this._transition({queries:[],paginatedQueries:[]},!0)}queryResultReady(e){return this.client.hasLocalQueryResultByToken(e)}createDisabledUnsubscribe(){let e=(()=>{});return Object.assign(e,{unsubscribe:e,getCurrentValue:()=>void 0,getQueryLogs:()=>void 0}),e}async close(){if(!this.disabled)return this.listeners.clear(),this._closed=!0,this._paginatedClient&&=void 0,this.client.close()}getAuth(){if(!this.disabled)return this.client.getCurrentAuthClaims()}setAuth(e,t){this.disabled||this.client.setAuth(e,t??(()=>{}))}setAdminAuth(e,t){if(this.closed)throw Error(`ConvexClient has already been closed.`);this.disabled||this.client.setAdminAuth(e,t)}_transition({queries:e,paginatedQueries:t},n=!1){let r=[...e.map(e=>e.token),...t.map(e=>e.token)];for(let e of this.listeners){let{callback:t,queryToken:i,onError:a,hasEverRun:o}=e,s=ze(i),c=s?!!this.paginatedClient.localQueryResultByToken(i):this.client.hasLocalQueryResultByToken(i);if(r.includes(i)||n&&!o&&c){e.hasEverRun=!0;let n;try{n=s?this.paginatedClient.localQueryResultByToken(i):this.client.localQueryResultByToken(i)}catch(e){if(!(e instanceof Error))throw e;a?a(e,`Second argument to onUpdate onError is reserved for later use`):Promise.reject(e);continue}t(n,`Second argument to onUpdate callback is reserved for later use`)}}}async mutation(e,t,n){if(this.disabled)throw Error(`ConvexClient is disabled`);return await this.client.mutation(u(e),t,n)}async action(e,t){if(this.disabled)throw Error(`ConvexClient is disabled`);return await this.client.action(u(e),t)}async query(e,t){if(this.disabled)throw Error(`ConvexClient is disabled`);let n=this.client.localQueryResult(u(e),t);return n===void 0?new Promise((n,r)=>{let{unsubscribe:i}=this.onUpdate(e,t,e=>{i(),n(e)},e=>{i(),r(e)})}):Promise.resolve(n)}connectionState(){if(this.disabled)throw Error(`ConvexClient is disabled`);return this.client.connectionState()}subscribeToConnectionState(e){return this.disabled?()=>{}:this.client.subscribeToConnectionState(e)}},X=Symbol(`convex.useQuery.skip`);function Wt(e){return typeof e==`function`&&(e=e()),e===`skip`?{skip:!0,args:void 0}:{skip:!1,args:e}}function Gt(e,t){return JSON.stringify(O(e))===JSON.stringify(O(t))}function Kt(e,t){return e===X&&t===X?!0:e===X||t===X?!1:Gt(e,t)}function Z(e){let{skip:t,args:n}=Wt(e);return t?X:l(n)}var Q=null,qt=null,Jt=[];function Yt(){if(Jt===null)return;let e=Jt;Jt=null;for(let t of e)t()}function Xt(){return Q?.closed?(Q=null,qt=null,null):Q}function Zt(){return qt}function Qt(e,t){qt=e,Q=t}function $t(){let e=Xt();if(!e)throw Error(`Convex client not initialized. Call setupConvex() or initConvex() first.`);return e}function en(e){return!e.disabled&&!e.closed}var tn=`$$_convexClient`,nn=`$$_convexAuth`,rn=()=>{let e=s(tn);if(!e)throw Error(`No ConvexClient was found in Svelte context. Did you forget to call setupConvex() in a parent component?`);return e},an=e=>c(tn,e),on=(e,t={})=>{if(!e||typeof e!=`string`)throw Error(`Expected string url property for setupConvex`);let n=Xt();if(n&&Zt()!==e)throw Error(`setupConvex() was called with ${e}, but the Convex client is already initialized for ${Zt()}. Only one deployment per app is supported. Call closeConvex() first to switch deployments.`);let r=n??new Ut(e,{disabled:!1,...t});return n||Qt(e,r),an(r),queueMicrotask(()=>Yt()),r};function sn(i,o={},s={}){let c=rn();if(typeof i==`string`)throw Error(`Query must be a functionReference object, not a string`);let d=r({result:$(s).initialData,lastResult:void 0,argsForLastResult:void 0,haveArgsEverChanged:!1});n(()=>{let e=Z(o);if(e===X){d.result=void 0,d.argsForLastResult=X;return}if(en(c))return c.onUpdate(i,e,t=>{let n=structuredClone(t);d.result=n,d.argsForLastResult=e,d.lastResult=n},t=>{d.result=t,d.argsForLastResult=e;let n=structuredClone(t);d.lastResult=n})});let f=e(()=>Z(o)),p=Z(o),m=e(()=>d.argsForLastResult!==void 0&&t(f)!==X&&d.argsForLastResult!==X&&Gt(d.argsForLastResult,t(f))),h=e(()=>!!($(s).keepPreviousData&&d.lastResult)),g=e(()=>t(f)===X);n(()=>{if(!a(()=>d.haveArgsEverChanged)){let e=Z(o);if(!Kt(p,e)){d.haveArgsEverChanged=!0;let e=$(s);e.initialData!==void 0&&(d.argsForLastResult=p===X?X:l(p),d.lastResult=e.initialData)}}});let _=e(()=>{if(t(g))return;if($(s).initialData&&!d.haveArgsEverChanged)return d.result;let e;try{e=en(c)?c.client.localQueryResult(u(i),t(f)):void 0}catch(t){if(!(t instanceof Error))throw console.error(`threw non-Error instance`,t),t;e=t}return d.result,e}),v=e(()=>t(_)===void 0?t(h)?d.lastResult:void 0:t(_)),ee=e(()=>!t(g)&&t(_)===void 0&&t(h)&&!t(m)&&t(v)!==void 0),y=e(()=>{if(!(t(v)instanceof Error))return t(v)}),b=e(()=>{if(t(v)instanceof Error)return t(v)});return{get data(){return t(y)},get isLoading(){return!t(g)&&t(b)===void 0&&t(y)===void 0},get error(){return t(b)},get isStale(){return!t(g)&&t(ee)}}}function $(e){return typeof e==`function`&&(e=e()),l(e)}function cn(e,s){let l=rn(),u=s?.initialState!==void 0,d=i(r(u?!!s.initialState.isAuthenticated:null)),f=!1,p,m=!1;if(u&&s.initialState?.isAuthenticated){let{fetchAccessToken:t}=e();m=!0,l.setAuth(t,e=>{o(d,e,!0)})}Yt(),n(()=>{let{isLoading:n,isAuthenticated:r,fetchAccessToken:i}=e();n||(f=!0);let s=a(()=>t(d));if(p=r,m)return r?(m=!1,()=>{l.setAuth(async()=>null,()=>{})}):void 0;if(n&&s!==null&&f&&o(d,null),!n&&!r&&s!==!1&&o(d,!1),r){s===!1&&o(d,null);let e=!0;return l.setAuth(i,t=>{e&&o(d,t,!0)}),()=>{e=!1,l.setAuth(async()=>null,()=>{})}}}),c(nn,{get isLoading(){return t(d)===null||t(d)===!1&&p!==void 0&&a(()=>e().isAuthenticated)!==p},get isAuthenticated(){let n=t(d);return!f&&u?n===!0:n===!0||a(()=>e().isAuthenticated)&&(n??!1)}})}function ln(){let e=s(nn);if(!e)throw Error(`useAuth() requires setupAuth() to be called in a parent component. If you are using an auth adapter (e.g. convex-better-auth-svelte), make sure its setup function is called before useAuth().`);return{get isLoading(){return e.isLoading},get isAuthenticated(){return e.isAuthenticated}}}function un(e){return(t,n)=>$t().mutation(e,t,n)}function dn(e){return t=>$t().action(e,t)}export{un as a,O as c,ln as i,on as n,sn as o,dn as r,k as s,cn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,D as t,E as n,F as r,G as i,T as a,V as o,b as s,d as c,g as l,h as u,i as d,k as f,m as p,n as m,ot as h,pt as g,q as _,st as v}from"./D-3DgMVM.js";import"./xihTtKlq.js";var y=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},b=(e,t)=>({classGroupId:e,validator:t}),x=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),S=`-`,C=[],w=`arbitrary..`,T=e=>{let t=D(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ee(e);let n=e.split(S);return E(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?y(i,t):t:i||C}return n[e]||C}}},E=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=E(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(S):e.slice(t).join(S),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ee=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?w+r:void 0})(),D=e=>{let{theme:t,classGroups:n}=e;return te(n,t)},te=(e,t)=>{let n=x();for(let r in e){let i=e[r];O(i,n,r,t)}return n},O=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];k(i,t,n,r)}},k=(e,t,n,r)=>{if(typeof e==`string`){A(e,t,n);return}if(typeof e==`function`){j(e,t,n,r);return}ne(e,t,n,r)},A=(e,t,n)=>{let r=e===``?t:M(t,e);r.classGroupId=n},j=(e,t,n,r)=>{if(N(e)){O(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(b(n,e))},ne=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];O(o,M(t,a),n,r)}},M=(e,t)=>{let n=e,r=t.split(S),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=x(),n.nextPart.set(t,i)),n=i}return n},N=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,re=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},P=`!`,ie=`:`,ae=[],F=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),I=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ie){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(P)?(c=s.slice(0,-1),l=!0):s.startsWith(P)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return F(t,l,c,u)};if(t){let e=t+ie,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):F(ae,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},L=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},oe=e=>({cache:re(e.cacheSize),parseClassName:I(e),sortModifiers:L(e),postfixLookupClassGroupIds:R(e),...T(e)}),R=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},se=/\s+/,z=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(se),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+P:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},B=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=V(n))&&(i&&(i+=` `),i+=r);return i},V=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=V(e[r]))&&(n&&(n+=` `),n+=t);return n},H=(e,...t)=>{let n,r,i,a,o=o=>(n=oe(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=z(e,n);return i(e,a),a};return a=o,(...e)=>a(B(...e))},ce=[],U=e=>{let t=t=>t[e]||ce;return t.isThemeGetter=!0,t},le=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ue=/^\((?:(\w[\w-]*):)?(.+)\)$/i,de=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,me=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,he=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>de.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),K=e=>!!e&&Number.isInteger(Number(e)),_e=e=>e.endsWith(`%`)&&G(e.slice(0,-1)),q=e=>fe.test(e),ve=()=>!0,ye=e=>pe.test(e)&&!me.test(e),be=()=>!1,xe=e=>he.test(e),Se=e=>ge.test(e),Ce=e=>!J(e)&&!X(e),we=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Te=e=>Z(e,Ve,be),J=e=>le.test(e),Y=e=>Z(e,He,ye),Ee=e=>Z(e,Ue,G),De=e=>Z(e,Ge,ve),Oe=e=>Z(e,We,be),ke=e=>Z(e,ze,be),Ae=e=>Z(e,Be,Se),je=e=>Z(e,Ke,xe),X=e=>ue.test(e),Me=e=>Q(e,He),Ne=e=>Q(e,We),Pe=e=>Q(e,ze),Fe=e=>Q(e,Ve),Ie=e=>Q(e,Be),Le=e=>Q(e,Ke,!0),Re=e=>Q(e,Ge,!0),Z=(e,t,n)=>{let r=le.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=ue.exec(e);return r?r[1]?t(r[1]):n:!1},ze=e=>e===`position`||e===`percentage`,Be=e=>e===`image`||e===`url`,Ve=e=>e===`length`||e===`size`||e===`bg-size`,He=e=>e===`length`,Ue=e=>e===`number`,We=e=>e===`family-name`,Ge=e=>e===`number`||e===`weight`,Ke=e=>e===`shadow`,qe=H(()=>{let e=U(`color`),t=U(`font`),n=U(`text`),r=U(`font-weight`),i=U(`tracking`),a=U(`leading`),o=U(`breakpoint`),s=U(`container`),c=U(`spacing`),l=U(`radius`),u=U(`shadow`),d=U(`inset-shadow`),f=U(`text-shadow`),p=U(`drop-shadow`),m=U(`blur`),h=U(`perspective`),g=U(`aspect`),_=U(`ease`),v=U(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,J,c],T=()=>[W,`full`,`auto`,...w()],E=()=>[K,`none`,`subgrid`,X,J],ee=()=>[`auto`,{span:[`full`,K,X,J]},K,X,J],D=()=>[K,`auto`,X,J],te=()=>[`auto`,`min`,`max`,`fr`,X,J],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[W,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[W,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[W,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,X,J],re=()=>[...b(),Pe,ke,{position:[X,J]}],P=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Fe,Te,{size:[X,J]}],ae=()=>[_e,Me,Y],F=()=>[``,`none`,`full`,l,X,J],I=()=>[``,G,Me,Y],L=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[G,_e,Pe,ke],se=()=>[``,`none`,m,X,J],z=()=>[`none`,G,X,J],B=()=>[`none`,G,X,J],V=()=>[G,X,J],H=()=>[W,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[q],breakpoint:[q],color:[ve],container:[q],"drop-shadow":[q],ease:[`in`,`out`,`in-out`],font:[Ce],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[q],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[q],shadow:[q],spacing:[`px`,G],text:[q],"text-shadow":[q],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,W,J,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,J]}],"container-named":[we],columns:[{columns:[G,J,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[K,`auto`,X,J]}],basis:[{basis:[W,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[G,W,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,G,X,J]}],shrink:[{shrink:[``,G,X,J]}],order:[{order:[K,`first`,`last`,`none`,X,J]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,Me,Y]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Re,De]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,_e,J]}],"font-family":[{font:[Ne,Oe,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,J]}],"line-clamp":[{"line-clamp":[G,`none`,X,Ee]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,X,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[G,`from-font`,`auto`,X,Y]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[G,`auto`,X,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[K,X,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},K,X,J],radial:[``,X,J],conic:[K,X,J]},Ie,Ae]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[G,X,J]}],"outline-w":[{outline:[``,G,Me,Y]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Le,je]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Le,je]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[G,Y]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Le,je]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[G,X,J]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[X,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,J]}],filter:[{filter:[``,`none`,X,J]}],blur:[{blur:se()}],brightness:[{brightness:[G,X,J]}],contrast:[{contrast:[G,X,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Le,je]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,G,X,J]}],"hue-rotate":[{"hue-rotate":[G,X,J]}],invert:[{invert:[``,G,X,J]}],saturate:[{saturate:[G,X,J]}],sepia:[{sepia:[``,G,X,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,J]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[G,X,J]}],"backdrop-contrast":[{"backdrop-contrast":[G,X,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,G,X,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,X,J]}],"backdrop-invert":[{"backdrop-invert":[``,G,X,J]}],"backdrop-opacity":[{"backdrop-opacity":[G,X,J]}],"backdrop-saturate":[{"backdrop-saturate":[G,X,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,G,X,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[G,`initial`,X,J]}],ease:[{ease:[`linear`,`initial`,_,X,J]}],delay:[{delay:[G,X,J]}],animate:[{animate:[`none`,v,X,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[X,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[K,X,J]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,J]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[G,Me,Y,Ee]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Je(...e){return qe(l(e))}var Ye=f(`<div><img src="/logo.png" alt=""/> <span>Sprocket</span></div>`);function Xe(n,a){v(a,!0);let s=d(a,`class`,3,``),c=d(a,`size`,3,`md`),l=e(()=>c()===`sm`?`h-6 w-6`:`h-7 w-7`),f=e(()=>c()===`sm`?`text-lg`:`text-[1.15rem]`);var m=Ye(),y=i(m),b=_(y,2);g(m),o((e,t,n)=>{p(m,1,e),p(y,1,t),p(b,1,n)},[()=>u(Je(`flex min-w-0 items-center gap-2`,s())),()=>u(Je(`shrink-0`,r(l))),()=>u(Je(`font-brand text-foreground truncate font-semibold tracking-tight`,r(f)))]),t(n,m),h()}function Ze(e){return e===`light`||e===`dark`}function Qe(e){return e??`light`}var $=0,$e=null;function et(e){document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e}function tt(e){if(!(typeof document>`u`)){if($>0){$e=e;return}et(e)}}function nt(){return typeof document>`u`?()=>{}:($===0&&($e=Ze(document.documentElement.dataset.theme)?document.documentElement.dataset.theme:Qe(null),et(`light`)),$+=1,()=>{if($=Math.max(0,$-1),$===0){let e=$e??Qe(null);$e=null,et(e)}})}var rt=f(`<p class="text-muted-foreground mt-3 text-sm leading-[1.55]"> </p>`),it=f(`<div class="mt-5 space-y-4 text-left [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden"><!></div>`),at=f(`<div class="mt-6 flex flex-wrap items-center justify-center gap-3 [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden"><!></div>`),ot=f(`<div><div class="relative z-10 w-full max-w-md"><div class="mb-8 flex justify-center"><!></div> <h1 class="font-brand text-foreground text-[1.5rem] font-semibold tracking-tight"> </h1> <!> <!> <!></div></div>`);function st(e,r){v(r,!0);let l=d(r,`description`,3,null),f=d(r,`busy`,3,!1),y=d(r,`class`,3,``);m(()=>nt());var b=ot(),x=i(b),S=i(x);Xe(i(S),{}),g(S);var C=_(S,2),w=i(C,!0);g(C);var T=_(C,2),E=e=>{var r=rt(),a=i(r,!0);g(r),o(()=>n(a,l())),t(e,r)};a(T,e=>{l()&&e(E)});var ee=_(T,2),D=e=>{var n=it(),a=i(n);s(a,()=>r.children),g(n),t(e,n)};a(ee,e=>{r.children&&e(D)});var te=_(ee,2),O=e=>{var n=at(),a=i(n);s(a,()=>r.actions),g(n),t(e,n)};a(te,e=>{r.actions&&e(O)}),g(x),g(b),o(e=>{p(b,1,e),c(x,`aria-busy`,f()?!0:void 0),c(x,`aria-live`,f()?`polite`:void 0),n(w,r.title)},[()=>u(Je(`app-entry-shell relative flex min-h-screen items-center justify-center px-8 py-10 text-center`,y()))]),t(e,b),h()}export{Je as a,Xe as i,tt as n,Qe as r,st as t};
|
|
1
|
+
import{$ as e,D as t,E as n,F as r,G as i,T as a,V as o,b as s,d as c,g as l,h as u,i as d,k as f,m as p,n as m,ot as h,pt as g,q as _,st as v}from"./D-3DgMVM.js";import"./xihTtKlq.js";var y=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},b=(e,t)=>({classGroupId:e,validator:t}),x=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),S=`-`,C=[],w=`arbitrary..`,T=e=>{let t=D(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ee(e);let n=e.split(S);return E(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?y(i,t):t:i||C}return n[e]||C}}},E=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=E(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(S):e.slice(t).join(S),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ee=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?w+r:void 0})(),D=e=>{let{theme:t,classGroups:n}=e;return te(n,t)},te=(e,t)=>{let n=x();for(let r in e){let i=e[r];O(i,n,r,t)}return n},O=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];k(i,t,n,r)}},k=(e,t,n,r)=>{if(typeof e==`string`){A(e,t,n);return}if(typeof e==`function`){j(e,t,n,r);return}ne(e,t,n,r)},A=(e,t,n)=>{let r=e===``?t:M(t,e);r.classGroupId=n},j=(e,t,n,r)=>{if(N(e)){O(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(b(n,e))},ne=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];O(o,M(t,a),n,r)}},M=(e,t)=>{let n=e,r=t.split(S),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=x(),n.nextPart.set(t,i)),n=i}return n},N=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,re=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},P=`!`,ie=`:`,ae=[],F=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),I=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ie){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(P)?(c=s.slice(0,-1),l=!0):s.startsWith(P)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return F(t,l,c,u)};if(t){let e=t+ie,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):F(ae,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},L=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},oe=e=>({cache:re(e.cacheSize),parseClassName:I(e),sortModifiers:L(e),postfixLookupClassGroupIds:R(e),...T(e)}),R=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},se=/\s+/,z=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(se),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+P:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},B=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=V(n))&&(i&&(i+=` `),i+=r);return i},V=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=V(e[r]))&&(n&&(n+=` `),n+=t);return n},H=(e,...t)=>{let n,r,i,a,o=o=>(n=oe(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=z(e,n);return i(e,a),a};return a=o,(...e)=>a(B(...e))},ce=[],U=e=>{let t=t=>t[e]||ce;return t.isThemeGetter=!0,t},le=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ue=/^\((?:(\w[\w-]*):)?(.+)\)$/i,de=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,me=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,he=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>de.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),K=e=>!!e&&Number.isInteger(Number(e)),_e=e=>e.endsWith(`%`)&&G(e.slice(0,-1)),q=e=>fe.test(e),ve=()=>!0,ye=e=>pe.test(e)&&!me.test(e),be=()=>!1,xe=e=>he.test(e),Se=e=>ge.test(e),Ce=e=>!J(e)&&!X(e),we=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Te=e=>Z(e,Ve,be),J=e=>le.test(e),Y=e=>Z(e,He,ye),Ee=e=>Z(e,Ue,G),De=e=>Z(e,Ge,ve),Oe=e=>Z(e,We,be),ke=e=>Z(e,ze,be),Ae=e=>Z(e,Be,Se),je=e=>Z(e,Ke,xe),X=e=>ue.test(e),Me=e=>Q(e,He),Ne=e=>Q(e,We),Pe=e=>Q(e,ze),Fe=e=>Q(e,Ve),Ie=e=>Q(e,Be),Le=e=>Q(e,Ke,!0),Re=e=>Q(e,Ge,!0),Z=(e,t,n)=>{let r=le.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=ue.exec(e);return r?r[1]?t(r[1]):n:!1},ze=e=>e===`position`||e===`percentage`,Be=e=>e===`image`||e===`url`,Ve=e=>e===`length`||e===`size`||e===`bg-size`,He=e=>e===`length`,Ue=e=>e===`number`,We=e=>e===`family-name`,Ge=e=>e===`number`||e===`weight`,Ke=e=>e===`shadow`,qe=H(()=>{let e=U(`color`),t=U(`font`),n=U(`text`),r=U(`font-weight`),i=U(`tracking`),a=U(`leading`),o=U(`breakpoint`),s=U(`container`),c=U(`spacing`),l=U(`radius`),u=U(`shadow`),d=U(`inset-shadow`),f=U(`text-shadow`),p=U(`drop-shadow`),m=U(`blur`),h=U(`perspective`),g=U(`aspect`),_=U(`ease`),v=U(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,J,c],T=()=>[W,`full`,`auto`,...w()],E=()=>[K,`none`,`subgrid`,X,J],ee=()=>[`auto`,{span:[`full`,K,X,J]},K,X,J],D=()=>[K,`auto`,X,J],te=()=>[`auto`,`min`,`max`,`fr`,X,J],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[W,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[W,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[W,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,X,J],re=()=>[...b(),Pe,ke,{position:[X,J]}],P=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Fe,Te,{size:[X,J]}],ae=()=>[_e,Me,Y],F=()=>[``,`none`,`full`,l,X,J],I=()=>[``,G,Me,Y],L=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[G,_e,Pe,ke],se=()=>[``,`none`,m,X,J],z=()=>[`none`,G,X,J],B=()=>[`none`,G,X,J],V=()=>[G,X,J],H=()=>[W,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[q],breakpoint:[q],color:[ve],container:[q],"drop-shadow":[q],ease:[`in`,`out`,`in-out`],font:[Ce],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[q],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[q],shadow:[q],spacing:[`px`,G],text:[q],"text-shadow":[q],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,W,J,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,J]}],"container-named":[we],columns:[{columns:[G,J,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[K,`auto`,X,J]}],basis:[{basis:[W,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[G,W,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,G,X,J]}],shrink:[{shrink:[``,G,X,J]}],order:[{order:[K,`first`,`last`,`none`,X,J]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,Me,Y]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Re,De]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,_e,J]}],"font-family":[{font:[Ne,Oe,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,J]}],"line-clamp":[{"line-clamp":[G,`none`,X,Ee]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,X,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[G,`from-font`,`auto`,X,Y]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[G,`auto`,X,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[K,X,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},K,X,J],radial:[``,X,J],conic:[K,X,J]},Ie,Ae]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[G,X,J]}],"outline-w":[{outline:[``,G,Me,Y]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Le,je]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Le,je]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[G,Y]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Le,je]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[G,X,J]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[X,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,J]}],filter:[{filter:[``,`none`,X,J]}],blur:[{blur:se()}],brightness:[{brightness:[G,X,J]}],contrast:[{contrast:[G,X,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Le,je]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,G,X,J]}],"hue-rotate":[{"hue-rotate":[G,X,J]}],invert:[{invert:[``,G,X,J]}],saturate:[{saturate:[G,X,J]}],sepia:[{sepia:[``,G,X,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,J]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[G,X,J]}],"backdrop-contrast":[{"backdrop-contrast":[G,X,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,G,X,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,X,J]}],"backdrop-invert":[{"backdrop-invert":[``,G,X,J]}],"backdrop-opacity":[{"backdrop-opacity":[G,X,J]}],"backdrop-saturate":[{"backdrop-saturate":[G,X,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,G,X,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[G,`initial`,X,J]}],ease:[{ease:[`linear`,`initial`,_,X,J]}],delay:[{delay:[G,X,J]}],animate:[{animate:[`none`,v,X,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[X,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[K,X,J]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,J]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[G,Me,Y,Ee]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Je(...e){return qe(l(e))}var Ye=f(`<div><img src="/logo.png" alt=""/> <span>Sprocket</span></div>`);function Xe(n,a){v(a,!0);let s=d(a,`class`,3,``),c=d(a,`size`,3,`md`),l=e(()=>c()===`sm`?`h-6 w-6`:`h-7 w-7`),f=e(()=>c()===`sm`?`text-lg`:`text-[1.15rem]`);var m=Ye(),y=i(m),b=_(y,2);g(m),o((e,t,n)=>{p(m,1,e),p(y,1,t),p(b,1,n)},[()=>u(Je(`flex min-w-0 items-center gap-2`,s())),()=>u(Je(`shrink-0`,r(l))),()=>u(Je(`font-brand text-foreground truncate font-semibold tracking-tight`,r(f)))]),t(n,m),h()}function Ze(e){return e===`light`||e===`dark`}function Qe(e){return e??`light`}var $=0,$e=null;function et(e){document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e}function tt(e){if(globalThis.document){if($>0){$e=e;return}et(e)}}function nt(){return globalThis.document?($===0&&($e=Ze(document.documentElement.dataset.theme)?document.documentElement.dataset.theme:Qe(null),et(`light`)),$+=1,()=>{if($=Math.max(0,$-1),$===0){let e=$e??Qe(null);$e=null,et(e)}}):()=>{}}var rt=f(`<p class="text-muted-foreground mt-3 text-sm leading-[1.55]"> </p>`),it=f(`<div class="mt-5 space-y-4 text-left [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden"><!></div>`),at=f(`<div class="mt-6 flex flex-wrap items-center justify-center gap-3 [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden"><!></div>`),ot=f(`<div><div class="relative z-10 w-full max-w-md"><div class="mb-8 flex justify-center"><!></div> <h1 class="font-brand text-foreground text-[1.5rem] font-semibold tracking-tight"> </h1> <!> <!> <!></div></div>`);function st(e,r){v(r,!0);let l=d(r,`description`,3,null),f=d(r,`busy`,3,!1),y=d(r,`class`,3,``);m(()=>nt());var b=ot(),x=i(b),S=i(x);Xe(i(S),{}),g(S);var C=_(S,2),w=i(C,!0);g(C);var T=_(C,2),E=e=>{var r=rt(),a=i(r,!0);g(r),o(()=>n(a,l())),t(e,r)};a(T,e=>{l()&&e(E)});var ee=_(T,2),D=e=>{var n=it(),a=i(n);s(a,()=>r.children),g(n),t(e,n)};a(ee,e=>{r.children&&e(D)});var te=_(ee,2),O=e=>{var n=at(),a=i(n);s(a,()=>r.actions),g(n),t(e,n)};a(te,e=>{r.actions&&e(O)}),g(x),g(b),o(e=>{p(b,1,e),c(x,`aria-busy`,f()?!0:void 0),c(x,`aria-live`,f()?`polite`:void 0),n(w,r.title)},[()=>u(Je(`app-entry-shell relative flex min-h-screen items-center justify-center px-8 py-10 text-center`,y()))]),t(e,b),h()}export{Je as a,Xe as i,tt as n,Qe as r,st as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,t as l}from"./C6UbJThZ.js";var u=a({error:n().optional()}),d=a({authenticated:i().optional()}),f=a({httpBaseUrl:n(),desktopLoginCallbackUrl:n().optional(),pairingCredential:n()}),p=a({parentPath:n(),entries:c(a({name:n(),fullPath:n()})),volumeList:i().optional()}),m=a({skills:c(a({name:n(),description:n()})),warnings:c(n())}),h=a({workspacePath:n(),displayName:n(),repositoryKey:n()}),g=a({workspacePath:n(),repositoryKey:n(),displayName:n(),availability:l([`available`,`unavailable`]),lastValidatedAt:t(),lastUsedAt:t(),unavailableReason:n().optional(),previousRepositoryKey:n().optional()}),_=a({runId:n()}),v=a({imageUploadId:n(),name:n(),mediaType:n(),size:t(),storageId:n(),url:n().optional()}),y=a({number:t(),sourceKey:n(),kind:l([`prompt`,`completion`,`tool`]),runId:n(),prompt:a({text:n(),imageUploads:c(v)}).optional(),completion:a({streamId:n().optional(),items:c(r())}).optional(),tool:a({jobId:n().optional(),toolInvocationId:n().optional(),callId:n(),name:n(),output:r().optional(),status:l([`started`,`completed`,`failed`,`cancelled`])}).optional()}),b=a({threadId:n(),totalParts:t(),historyFromNumber:t(),stale:i(),parts:c(y),nextBefore:t().optional(),contextSummary:n().optional()}),x=a({eventType:n(),totalParts:t().optional(),stale:i()}),S=a({threadId:n(),runId:n(),runStatus:l([`queued`,`running`,`awaiting_executor`,`completed`,`failed`,`cancelled`]),streamId:n().optional(),text:n(),parts:c(r()),runStartedAt:t()}),C=e(`eventType`,[a({eventType:s(`updated`),live:S}),a({eventType:s(`cleared`)})]),w=a({threadId:n(),repositoryKey:n(),title:n(),selectedModel:n(),reasoningEffort:n(),serviceTier:n(),lastMessageAt:t(),threadStatus:l([`active`,`archived`]),latestRunStatus:l([`queued`,`running`,`awaiting_executor`,`completed`,`failed`,`cancelled`]).nullable().optional(),latestRunId:n().nullable().optional(),latestRunStartedAt:t().nullable().optional(),latestRunClaimExpiresAt:t().nullable().optional(),hasActiveRun:i()}),T=a({status:l([`loading`,`live`,`reconnecting`,`offline`,`error`]),lastSyncedAt:t().nullable()}),E=T.extend({threads:c(w)});function D(e){return e}function O(e){return e}function k(e){return{threadId:D(e.threadId),totalParts:e.totalParts,historyFromNumber:e.historyFromNumber,stale:e.stale,nextBefore:e.nextBefore,contextSummary:e.contextSummary,parts:e.parts.map(j)}}function A(e){let t={callId:e.callId,name:e.name,status:e.status};return e.jobId&&(t.jobId=D(e.jobId)),e.toolInvocationId&&(t.toolInvocationId=e.toolInvocationId),e.output!==void 0&&(t.output=e.output),t}function j(e){return{number:e.number,sourceKey:e.sourceKey,kind:e.kind,runId:D(e.runId),prompt:e.prompt?{text:e.prompt.text,imageUploads:e.prompt.imageUploads.map(e=>({...e,imageUploadId:D(e.imageUploadId)}))}:void 0,completion:e.completion?{streamId:e.completion.streamId,items:e.completion.items}:void 0,tool:e.tool?A(e.tool):void 0}}function M(e){return{threadId:D(e.threadId),runId:D(e.runId),runStatus:e.runStatus,streamId:e.streamId,text:e.text,parts:e.parts,runStartedAt:e.runStartedAt}}function N(e){return{threadId:D(e.threadId),repositoryKey:e.repositoryKey,title:e.title,selectedModel:e.selectedModel,reasoningEffort:e.reasoningEffort,serviceTier:e.serviceTier,lastMessageAt:e.lastMessageAt,threadStatus:e.threadStatus,latestRunStatus:e.latestRunStatus??null,latestRunId:e.latestRunId?D(e.latestRunId):null,latestRunStartedAt:e.latestRunStartedAt??void 0,latestRunClaimExpiresAt:e.latestRunClaimExpiresAt??void 0,hasActiveRun:e.hasActiveRun}}function P(e){return{status:e.status,lastSyncedAt:e.lastSyncedAt}}function F(e){return{...P(e),threads:e.threads.map(N)}}function I(e){return e.eventType===`updated`?{eventType:`updated`,live:M(e.live)}:{eventType:`cleared`}}async function L(e,t,n){if(!e.body)return;let r=e.body.getReader(),i=new TextDecoder,a=``;try{for(;!t.aborted;){let{done:e,value:o}=await r.read();if(e)break;a+=i.decode(o,{stream:!0});let s=a.indexOf(`
|
|
2
|
+
|
|
3
|
+
`);for(;s>=0;){let e=a.slice(0,s);a=a.slice(s+2);let r=e.split(`
|
|
4
|
+
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart());r.length>0&&!t.aborted&&n(r.join(`
|
|
5
|
+
`)),s=a.indexOf(`
|
|
6
|
+
|
|
7
|
+
`)}}}catch(e){if(t.aborted)return;throw e}finally{r.releaseLock()}}function R(e,t){return Error(t?.error??`Local request failed (${e}).`)}async function z(e){let t=u.safeParse(await e.json().catch(()=>null));return R(e.status,t.success?t.data:void 0)}async function B(e,t,n,r){let i=await fetch(e,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:n});if(!i.ok)throw await z(i);await L(i,n,r)}function V(){return globalThis.window?globalThis.window.location.origin:null}function H(e){if(!globalThis.window)return null;let t=globalThis.window.location.hash.startsWith(`#`)?globalThis.window.location.hash.slice(1):globalThis.window.location.hash;return new URLSearchParams(t).get(e)}function U(){return H(`token`)}function W(){return H(`workspace`)}function G(e){return`#${new URLSearchParams({workspace:e}).toString()}`}function K(){if(!globalThis.window)return;let e=new URL(globalThis.window.location.href);e.hash=``,globalThis.window.history.replaceState(null,``,`${e.pathname}${e.search}`)}async function q(e,t){let n=await fetch(`${e}/api/auth/bootstrap`,{method:`POST`,headers:{"content-type":`application/json`},credentials:`include`,body:JSON.stringify({credential:t})});if(!n.ok){let e=u.safeParse(await n.json().catch(()=>null));throw Error(e.success?e.data.error??`Failed to authenticate with the Sprocket server.`:`Failed to authenticate with the Sprocket server.`)}}async function J(e){let t=await fetch(`${e}/api/auth/session`,{credentials:`include`});if(!t.ok)return!1;let n=d.safeParse(await t.json());return n.success?!!n.data.authenticated:!1}async function Y(e,t){if(await J(e))return;let n=U();if(n){await q(e,n),K();return}if(t?.pairingCredential){await q(e,t.pairingCredential);return}let r=await X(e);if(r?.pairingCredential){await q(e,r.pairingCredential);return}throw Error(`Pair with your Sprocket server to continue.`)}async function X(e){try{let t=await fetch(`${e}/api/auth/desktop-bootstrap`);if(!t.ok)return null;let n=f.safeParse(await t.json());return n.success?n.data:null}catch{return null}}async function Z(e){return globalThis.window?.sprocketDesktopBridge?.getLocalBootstrap?await globalThis.window.sprocketDesktopBridge.getLocalBootstrap():await X(e)}async function Q(e,t){let n=e.headers.get(`content-type`)??``,r=await e.text();if(!n.includes(`application/json`)){let e=r.trim().slice(0,120);if(e.startsWith(`<!`)){let e=V();throw Error(e?`The Sprocket API at ${e} returned a web page instead of JSON. Make sure the server is running correctly.`:`The Sprocket API returned a web page instead of JSON. Make sure the server is running correctly.`)}throw Error(e.length>0?`Local API returned an unexpected response: ${e}`:`Local API returned an empty response.`)}let i=t.safeParse(JSON.parse(r));if(!i.success)throw Error(`Local API returned an unexpected response.`);return i.data}function $(e){async function n(t,n,r){let i=await fetch(`${e}${t}`,{...r,credentials:`include`,headers:{"content-type":`application/json`,...r?.headers}});if(!i.ok)try{let e=await Q(i,u);throw Error(e.error??`Local request failed (${i.status}).`)}catch(e){throw e instanceof Error&&e.message!==`Local request failed (${i.status}).`?e:Error(`Local request failed (${i.status}).`,{cause:e})}if(i.status===204)throw Error(`Local API returned an empty response.`);return await Q(i,n)}return{browseFilesystem:e=>{let t=e.cwd?{partialPath:e.partialPath,cwd:e.cwd}:{partialPath:e.partialPath};return n(`/api/workspace/browse`,p,{method:`POST`,body:JSON.stringify(t)})},listWorkspaceSkills:e=>n(`/api/workspace/skills`,m,{method:`POST`,body:JSON.stringify({workspacePath:e.workspacePath})}),resolveWorkspacePath:e=>{let t=e.createIfMissing?{workspacePath:e.workspacePath,createIfMissing:!0}:{workspacePath:e.workspacePath};return n(`/api/workspace/resolve`,h,{method:`POST`,body:JSON.stringify(t)})},listProjectAttachments:async()=>(await n(`/api/workspace/projects`,c(g))).map(O),attachProject:async e=>O(await n(`/api/workspace/projects`,g,{method:`POST`,body:JSON.stringify(e)})),runAgent:async e=>({runId:D((await n(`/api/agent/run`,_,{method:`POST`,body:JSON.stringify(e)})).runId)}),fetchTranscriptPage:async e=>k(await n(`/api/transcript/page`,b,{method:`POST`,body:JSON.stringify(e)})),watchTranscript:async(t,n)=>{await B(`${e}/api/transcript/watch`,t,n.signal,e=>{let t=x.safeParse(JSON.parse(e));t.success&&n.onEvent(t.data)})},watchLiveCompletion:async(t,n)=>{await B(`${e}/api/agent/live`,t,n.signal,e=>{let t=C.safeParse(JSON.parse(e));t.success&&n.onEvent(I(t.data))})},clearTranscriptReplica:async t=>{let n=await fetch(`${e}/api/transcript/clear`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw await z(n)},fetchTranscriptAttachment:async t=>{let n=await fetch(`${e}/api/transcript/attachment`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.status===404||!n.ok?null:await n.blob()},registerThreadCache:async e=>P(await n(`/api/threads/register`,T,{method:`POST`,body:JSON.stringify(e)})),fetchThreadSnapshot:async e=>F(await n(`/api/threads/snapshot`,E,{method:`POST`,body:JSON.stringify(e)})),syncArchivedThreads:async e=>P(await n(`/api/threads/archive-sync`,T,{method:`POST`,body:JSON.stringify(e)})),watchThreadCache:async(t,n)=>{await B(`${e}/api/threads/watch`,t,n.signal,e=>{let t=T.safeParse(JSON.parse(e));t.success&&n.onEvent(P(t.data))})},renameThread:async e=>await n(`/api/threads/rename`,i(),{method:`POST`,body:JSON.stringify(e)}),archiveThread:async e=>await n(`/api/threads/archive`,i(),{method:`POST`,body:JSON.stringify(e)}),restoreThread:async e=>await n(`/api/threads/restore`,i(),{method:`POST`,body:JSON.stringify(e)}),rekeyRepository:async e=>await n(`/api/threads/rekey`,t(),{method:`POST`,body:JSON.stringify(e)}),requestRunCancellation:async e=>{await n(`/api/threads/cancel`,i(),{method:`POST`,body:JSON.stringify(e)})},endAccountSession:async e=>{await n(`/api/threads/account-session/end`,o(),{method:`POST`,body:JSON.stringify(e)})}}}async function ee(){let e=V();if(!e)throw Error(`Unable to resolve the Sprocket server URL.`);return await Y(e,await Z(e)),$(e)}export{W as a,G as c,U as i,K as n,ee as o,X as r,V as s,q as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{$ as e,D as t,E as n,F as r,G as i,H as a,K as o,L as s,O as c,Q as l,T as u,U as d,V as f,X as p,i as m,j as h,k as g,n as _,ot as v,pt as y,q as b,r as x,s as S,st as C,y as w}from"../chunks/D-3DgMVM.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=E(t,n),t=s(t),t in D)return;D[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:T,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},k={},A=g(`<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>`),j=g(`<!> <!>`,1);function M(g,x){C(x,!0);let T=m(x,`components`,23,()=>[]),E=m(x,`data_0`,3,null),D=m(x,`data_1`,3,null);d(()=>x.stores.page.set(x.page)),a(()=>{x.stores,x.page,x.constructors,T(),x.form,E(),D(),x.stores.page.notify()});let O=l(!1),k=l(!1),M=l(null);_(()=>{let e=x.stores.page.subscribe(()=>{r(O)&&(p(k,!0),s().then(()=>{p(M,document.title||`untitled page`,!0)}))});return p(O,!0),e});let N=e(()=>x.constructors[1]);var P=j(),F=o(P),I=n=>{let i=e(()=>x.constructors[0]);var a=c(),s=o(a);w(s,()=>r(i),(e,n)=>{S(n(e,{get data(){return E()},get form(){return x.form},get params(){return x.page.params},children:(e,n)=>{var i=c(),a=o(i);w(a,()=>r(N),(e,t)=>{S(t(e,{get data(){return D()},get form(){return x.form},get params(){return x.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),t(e,i)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),t(n,a)},L=n=>{let i=e(()=>x.constructors[0]);var a=c(),s=o(a);w(s,()=>r(i),(e,t)=>{S(t(e,{get data(){return E()},get form(){return x.form},get params(){return x.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),t(n,a)};u(F,e=>{x.constructors[1]?e(I):e(L,-1)});var R=b(F,2),z=e=>{var a=A(),o=i(a),s=e=>{var i=h();f(()=>n(i,r(M))),t(e,i)};u(o,e=>{r(k)&&e(s)}),y(a),t(e,a)};u(R,e=>{r(O)&&e(z)}),t(g,P),v()}var N=x(M),P=[()=>O(()=>import(`../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BQy7t8ld.js","../chunks/D-3DgMVM.js","../chunks/xihTtKlq.js","../chunks/CZkwsiMM.js","../chunks/BQbJFoq8.js","../chunks/C6UbJThZ.js","../chunks/Cq37afw7.js","../assets/0.Btn1dfCy.css","../nodes/1.BKmg0DHY.js","../chunks/BIoNiaeb.js","../chunks/BcbRJsmf.js","../nodes/2.CW66SnVr.js","../chunks/PSXYTcvE.js","../chunks/W58kGv2a.js","../nodes/3.D5e7ydb1.js","../chunks/CI5UllIC.js","../nodes/4.DAD6I3xt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,D as t,E as n,F as r,G as i,H as a,K as o,L as s,O as c,Q as l,T as u,U as d,V as f,X as p,i as m,j as h,k as g,n as _,ot as v,pt as y,q as b,r as x,s as S,st as C,y as w}from"../chunks/D-3DgMVM.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=E(t,n),t=s(t),t in D)return;D[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:T,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},k={},A=g(`<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>`),j=g(`<!> <!>`,1);function M(g,x){C(x,!0);let T=m(x,`components`,23,()=>[]),E=m(x,`data_0`,3,null),D=m(x,`data_1`,3,null);d(()=>x.stores.page.set(x.page)),a(()=>{x.stores,x.page,x.constructors,T(),x.form,E(),D(),x.stores.page.notify()});let O=l(!1),k=l(!1),M=l(null);_(()=>{let e=x.stores.page.subscribe(()=>{r(O)&&(p(k,!0),s().then(()=>{p(M,document.title||`untitled page`,!0)}))});return p(O,!0),e});let N=e(()=>x.constructors[1]);var P=j(),F=o(P),I=n=>{let i=e(()=>x.constructors[0]);var a=c(),s=o(a);w(s,()=>r(i),(e,n)=>{S(n(e,{get data(){return E()},get form(){return x.form},get params(){return x.page.params},children:(e,n)=>{var i=c(),a=o(i);w(a,()=>r(N),(e,t)=>{S(t(e,{get data(){return D()},get form(){return x.form},get params(){return x.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),t(e,i)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),t(n,a)},L=n=>{let i=e(()=>x.constructors[0]);var a=c(),s=o(a);w(s,()=>r(i),(e,t)=>{S(t(e,{get data(){return E()},get form(){return x.form},get params(){return x.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),t(n,a)};u(F,e=>{x.constructors[1]?e(I):e(L,-1)});var R=b(F,2),z=e=>{var a=A(),o=i(a),s=e=>{var i=h();f(()=>n(i,r(M))),t(e,i)};u(o,e=>{r(k)&&e(s)}),y(a),t(e,a)};u(R,e=>{r(O)&&e(z)}),t(g,P),v()}var N=x(M),P=[()=>O(()=>import(`../nodes/0.BQy7t8ld.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),()=>O(()=>import(`../nodes/1.BKmg0DHY.js`),__vite__mapDeps([8,1,2,9,10,4]),import.meta.url),()=>O(()=>import(`../nodes/2.CW66SnVr.js`),__vite__mapDeps([11,1,10,4,2,3,5,6,9,12,13]),import.meta.url),()=>O(()=>import(`../nodes/3.D5e7ydb1.js`),__vite__mapDeps([14,1,10,4,2,3,5,12,15]),import.meta.url),()=>O(()=>import(`../nodes/4.DAD6I3xt.js`),__vite__mapDeps([16,1,10,4,2,12,13,5,15]),import.meta.url)],F=[],I={"/":[2],"/callback":[3],"/pair":[4]},L={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},R=Object.fromEntries(Object.entries(L.transport).map(([e,t])=>[e,t.decode])),z=Object.fromEntries(Object.entries(L.transport).map(([e,t])=>[e,t.encode])),B=!1,V=(e,t)=>R[e](t),H=()=>O(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{V as decode,R as decoders,I as dictionary,z as encoders,H as get_error_template,B as hash,L as hooks,k as matchers,P as nodes,N as root,F as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,s as t}from"../chunks/BcbRJsmf.js";export{t as load_css,e as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,H as t,K as n,O as r,b as i,gt as a,nt as o,ot as s,st as c,tt as l}from"../chunks/D-3DgMVM.js";import"../chunks/xihTtKlq.js";import{c as u,n as d,o as f,s as p}from"../chunks/CZkwsiMM.js";import{d as m,l as h,u as g}from"../chunks/C6UbJThZ.js";import{n as _,t as v}from"../chunks/Cq37afw7.js";var y=a({load:()=>x,prerender:()=>!0,ssr:()=>!1}),b=h({env:g(m(),m())});async function x({fetch:e}){let t=await e(`/api/config`);if(!t.ok)throw Error(`Failed to load Sprocket runtime config.`);let n=b.safeParse(await t.json());if(!n.success)throw Error(`Failed to load Sprocket runtime config.`);return n.data}function S(a,m){c(m,!0);let h=()=>o(f,`$convexAuthRetryVersion`,y),g=()=>o(d,`$authState`,y),[y,b]=l(),x=()=>m.data.env.PUBLIC_CONVEX_URL,S=_(x()||`https://invalid.invalid`,{disabled:!x(),unsavedChangesWarning:!1});v(()=>(h(),{isLoading:!g().isReady||g().isLoading,isAuthenticated:!!g().user,fetchAccessToken:p})),t(()=>{x()&&u(S)});var C=r(),w=n(C);i(w,()=>m.children),e(a,C),s(),b()}export{S as component,y as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,E as t,G as n,K as r,V as i,k as a,ot as o,pt as s,q as c,st as l}from"../chunks/D-3DgMVM.js";import"../chunks/xihTtKlq.js";import{t as u}from"../chunks/BIoNiaeb.js";var d=a(`<h1> </h1> <p> </p>`,1);function f(a,f){l(f,!0);var p=d(),m=r(p),h=n(m,!0);s(m);var g=c(m,2),_=n(g,!0);s(g),i(()=>{t(h,u.status),t(_,u.error?.message)}),e(a,p),o()}export{f as component};
|