Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@clerk/shared

Package Overview
Dependencies
Maintainers
9
Versions
1822
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clerk/shared - npm Package Compare versions

Comparing version 0.13.0-staging.0 to 0.13.0

dist/esm/chunk-A53LO6A7.js

2

dist/esm/index.js

@@ -1,2 +0,2 @@

import{A as tr,B as rr,C as nr,D as ir,E as ar,F as or,G as sr,H as ur,I as lr,J as fr,K as cr,L as dr,M as vr,N as gr,O as mr,P as hr,Q as pr,R as br,S as Or,T as yr,U as Cr,V as zr,W as Rr,X as xr,Y as Er,c as St,d as Pt,e as kt,f as Ut,g as At,h as Dt,i as Vt,j as Ft,k as Wt,l as _t,m as Nt,n as Kt,o as $t,p as Ht,q as Gt,r as qt,s as jt,t as Jt,u as Yt,v as Bt,w as Zt,x as Qt,y as Xt,z as er}from"./chunk-EREY7YFW.js";var tt=Object.freeze({InvalidFrontendApiErrorMessage:"The frontendApi passed to Clerk is invalid. You can get your Frontend API key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.dev/last-active?path=api-keys."});function wr({packageName:e,customMessages:i}){let t=e,n={...tt,...i};function a(r,o){if(!o)return`${t}: ${r}`;let l=r,d=r.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(let s of d){let f=(o[s[1]]||"").toString();l=l.replace(`{{${s[1]}}}`,f)}return`${t}: ${l}`}return{setPackageName({packageName:r}){return typeof r=="string"&&(t=r),this},setMessages({customMessages:r}){return Object.assign(n,r||{}),this},throwInvalidPublishableKeyError(r){throw new Error(a(n.InvalidPublishableKeyErrorMessage,r))},throwInvalidFrontendApiError(r){throw new Error(a(n.InvalidFrontendApiErrorMessage,r))},throwInvalidProxyUrl(r){throw new Error(a(n.InvalidProxyUrlErrorMessage,r))},throwMissingPublishableKeyError(){throw new Error(a(n.MissingPublishableKeyErrorMessage))}}}import de from"react";function rt(e,i){if(!e)throw typeof i=="string"?new Error(i):new Error(`${i.displayName} not found`)}var H=(e,i)=>{let{assertCtxFn:t=rt}=i||{},n=de.createContext(void 0);return n.displayName=e,[n,()=>{let o=de.useContext(n);return t(o,`${e} not found`),o.value},()=>{let o=de.useContext(n);return o?o.value:{}}]};var[kr,G]=H("ClerkInstanceContext"),[Ur,Ie]=H("UserContext"),[Ar,Dr]=H("ClientContext"),[Vr,Se]=H("SessionContext"),[Fr,Pe]=H("OrganizationContext");import{useEffect as nt,useLayoutEffect as it,createContext as at,useContext as De,useState as Ve,createElement as ot,useRef as W,useCallback as me,useDebugValue as st}from"react";function Fe(e,i,t,n){function a(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function l(f){try{s(n.next(f))}catch(v){o(v)}}function d(f){try{s(n.throw(f))}catch(v){o(v)}}function s(f){f.done?r(f.value):a(f.value).then(l,d)}s((n=n.apply(e,i||[])).next())})}function We(e,i){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(s){return function(f){return d([s,f])}}function d(s){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,a&&(r=s[0]&2?a.return:s[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;switch(a=0,r&&(s=[s[0]&2,r.value]),s[0]){case 0:case 1:r=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,a=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){t.label=s[1];break}if(s[0]===6&&t.label<r[1]){t.label=r[1],r=s;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(s);break}r[2]&&t.ops.pop(),t.trys.pop();continue}s=i.call(e,t)}catch(f){s=[6,f],a=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var M=function(){},h=M(),Q=Object,b=function(e){return e===h},U=function(e){return typeof e=="function"},S=function(e,i){return Q.assign({},e,i)},Ce="undefined",ze=function(){return typeof window!=Ce},ut=function(){return typeof document!=Ce},lt=function(){return ze()&&typeof window.requestAnimationFrame!=Ce},ie=new WeakMap,ft=0,te=function(e){var i=typeof e,t=e&&e.constructor,n=t==Date,a,r;if(Q(e)===e&&!n&&t!=RegExp){if(a=ie.get(e),a)return a;if(a=++ft+"~",ie.set(e,a),t==Array){for(a="@",r=0;r<e.length;r++)a+=te(e[r])+",";ie.set(e,a)}if(t==Q){a="#";for(var o=Q.keys(e).sort();!b(r=o.pop());)b(e[r])||(a+=r+":"+te(e[r])+",");ie.set(e,a)}}else a=n?e.toJSON():i=="symbol"?e.toString():i=="string"?JSON.stringify(e):""+e;return a},he=!0,ct=function(){return he},_e=ze(),Re=ut(),pe=_e&&window.addEventListener?window.addEventListener.bind(window):M,dt=Re?document.addEventListener.bind(document):M,be=_e&&window.removeEventListener?window.removeEventListener.bind(window):M,vt=Re?document.removeEventListener.bind(document):M,gt=function(){var e=Re&&document.visibilityState;return b(e)||e!=="hidden"},mt=function(e){return dt("visibilitychange",e),pe("focus",e),function(){vt("visibilitychange",e),be("focus",e)}},ht=function(e){var i=function(){he=!0,e()},t=function(){he=!1};return pe("online",i),pe("offline",t),function(){be("online",i),be("offline",t)}},pt={isOnline:ct,isVisible:gt},bt={initFocus:mt,initReconnect:ht},ae=!ze()||"Deno"in window,Ot=function(e){return lt()?window.requestAnimationFrame(e):setTimeout(e,1)},X=ae?nt:it,ve=typeof navigator<"u"&&navigator.connection,ke=!ae&&ve&&(["slow-2g","2g"].includes(ve.effectiveType)||ve.saveData),Ne=function(e){if(U(e))try{e=e()}catch{e=""}var i=[].concat(e);e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?te(e):"";var t=e?"$swr$"+e:"";return[e,i,t]},_=new WeakMap,Ke=0,$e=1,He=2,ee=function(e,i,t,n,a,r,o){o===void 0&&(o=!0);var l=_.get(e),d=l[0],s=l[1],f=l[3],v=d[i],c=s[i];if(o&&c)for(var z=0;z<c.length;++z)c[z](t,n,a);return r&&(delete f[i],v&&v[0])?v[0](He).then(function(){return e.get(i)}):e.get(i)},yt=0,Oe=function(){return++yt},Ge=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return Fe(void 0,void 0,void 0,function(){var t,n,a,r,o,l,d,s,f,v,c,z,N,O,g,u,q,A,T,E,D;return We(this,function(P){switch(P.label){case 0:if(t=e[0],n=e[1],a=e[2],r=e[3],o=typeof r=="boolean"?{revalidate:r}:r||{},l=b(o.populateCache)?!0:o.populateCache,d=o.revalidate!==!1,s=o.rollbackOnError!==!1,f=o.optimisticData,v=Ne(n),c=v[0],z=v[2],!c)return[2];if(N=_.get(t),O=N[2],e.length<3)return[2,ee(t,c,t.get(c),h,h,d,!0)];if(g=a,q=Oe(),O[c]=[q,0],A=!b(f),T=t.get(c),A&&(E=U(f)?f(T):f,t.set(c,E),ee(t,c,E)),U(g))try{g=g(t.get(c))}catch(V){u=V}return g&&U(g.then)?[4,g.catch(function(V){u=V})]:[3,2];case 1:if(g=P.sent(),q!==O[c][0]){if(u)throw u;return[2,g]}else u&&A&&s&&(l=!0,g=T,t.set(c,T));P.label=2;case 2:return l&&(u||(U(l)&&(g=l(g,T)),t.set(c,g)),t.set(z,S(t.get(z),{error:u}))),O[c][1]=Oe(),[4,ee(t,c,g,u,h,d,!!l)];case 3:if(D=P.sent(),u)throw u;return[2,l?D:g]}})})},Ue=function(e,i){for(var t in e)e[t][0]&&e[t][0](i)},qe=function(e,i){if(!_.has(e)){var t=S(bt,i),n={},a=Ge.bind(h,e),r=M;if(_.set(e,[n,{},{},{},a]),!ae){var o=t.initFocus(setTimeout.bind(h,Ue.bind(h,n,Ke))),l=t.initReconnect(setTimeout.bind(h,Ue.bind(h,n,$e)));r=function(){o&&o(),l&&l(),_.delete(e)}}return[e,a,r]}return[e,_.get(e)[4]]},Ct=function(e,i,t,n,a){var r=t.errorRetryCount,o=a.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*t.errorRetryInterval;!b(r)&&o>r||setTimeout(n,l,a)},je=qe(new Map),Je=je[0],zt=je[1],Ye=S({onLoadingSlow:M,onSuccess:M,onError:M,onErrorRetry:Ct,onDiscarded:M,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ke?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ke?5e3:3e3,compare:function(e,i){return te(e)==te(i)},isPaused:function(){return!1},cache:Je,mutate:zt,fallback:{}},pt),Be=function(e,i){var t=S(e,i);if(i){var n=e.use,a=e.fallback,r=i.use,o=i.fallback;n&&r&&(t.use=n.concat(r)),a&&o&&(t.fallback=S(a,o))}return t},ye=at({}),Rt=function(e){var i=e.value,t=Be(De(ye),i),n=i&&i.provider,a=Ve(function(){return n?qe(n(t.cache||Je),i):h})[0];return a&&(t.cache=a[0],t.mutate=a[1]),X(function(){return a?a[2]:h},[]),ot(ye.Provider,S(e,{value:t}))},xt=function(e,i){var t=Ve({})[1],n=W(e),a=W({data:!1,error:!1,isValidating:!1}),r=me(function(o){var l=!1,d=n.current;for(var s in o){var f=s;d[f]!==o[f]&&(d[f]=o[f],a.current[f]&&(l=!0))}l&&!i.current&&t({})},[]);return X(function(){n.current=e}),[n,a.current,r]},Et=function(e){return U(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}]},wt=function(){return S(Ye,De(ye))},Lt=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=wt(),r=Et(t),o=r[0],l=r[1],d=r[2],s=Be(a,d),f=e,v=s.use;if(v)for(var c=v.length;c-- >0;)f=v[c](f);return f(o,l||s.fetcher,s)}},Ae=function(e,i,t){var n=i[e]||(i[e]=[]);return n.push(t),function(){var a=n.indexOf(t);a>=0&&(n[a]=n[n.length-1],n.pop())}},ge={dedupe:!0},Mt=function(e,i,t){var n=t.cache,a=t.compare,r=t.fallbackData,o=t.suspense,l=t.revalidateOnMount,d=t.refreshInterval,s=t.refreshWhenHidden,f=t.refreshWhenOffline,v=_.get(n),c=v[0],z=v[1],N=v[2],O=v[3],g=Ne(e),u=g[0],q=g[1],A=g[2],T=W(!1),E=W(!1),D=W(u),P=W(i),V=W(t),m=function(){return V.current},oe=function(){return m().isVisible()&&m().isOnline()},re=function(R){return n.set(A,S(n.get(A),R))},Ee=n.get(u),Qe=b(r)?t.fallback[u]:r,I=b(Ee)?Qe:Ee,we=n.get(A)||{},j=we.error,Le=!T.current,Me=function(){return Le&&!b(l)?l:m().isPaused()?!1:o?b(I)?!1:t.revalidateIfStale:b(I)||t.revalidateIfStale},Xe=function(){return!u||!i?!1:we.isValidating?!0:Le&&Me()},se=Xe(),ue=xt({data:I,error:j,isValidating:se},E),K=ue[0],le=ue[1],ne=ue[2],F=me(function(R){return Fe(void 0,void 0,void 0,function(){var y,C,x,J,Y,w,p,k,L,fe,B,$,ce;return We(this,function(Z){switch(Z.label){case 0:if(y=P.current,!u||!y||E.current||m().isPaused())return[2,!1];J=!0,Y=R||{},w=!O[u]||!Y.dedupe,p=function(){return!E.current&&u===D.current&&T.current},k=function(){var Te=O[u];Te&&Te[1]===x&&delete O[u]},L={isValidating:!1},fe=function(){re({isValidating:!1}),p()&&ne(L)},re({isValidating:!0}),ne({isValidating:!0}),Z.label=1;case 1:return Z.trys.push([1,3,,4]),w&&(ee(n,u,K.current.data,K.current.error,!0),t.loadingTimeout&&!n.get(u)&&setTimeout(function(){J&&p()&&m().onLoadingSlow(u,t)},t.loadingTimeout),O[u]=[y.apply(void 0,q),Oe()]),ce=O[u],C=ce[0],x=ce[1],[4,C];case 2:return C=Z.sent(),w&&setTimeout(k,t.dedupingInterval),!O[u]||O[u][1]!==x?(w&&p()&&m().onDiscarded(u),[2,!1]):(re({error:h}),L.error=h,B=N[u],!b(B)&&(x<=B[0]||x<=B[1]||B[1]===0)?(fe(),w&&p()&&m().onDiscarded(u),[2,!1]):(a(K.current.data,C)?L.data=K.current.data:L.data=C,a(n.get(u),C)||n.set(u,C),w&&p()&&m().onSuccess(C,u,t),[3,4]));case 3:return $=Z.sent(),k(),m().isPaused()||(re({error:$}),L.error=$,w&&p()&&(m().onError($,u,t),(typeof t.shouldRetryOnError=="boolean"&&t.shouldRetryOnError||U(t.shouldRetryOnError)&&t.shouldRetryOnError($))&&oe()&&m().onErrorRetry($,u,t,F,{retryCount:(Y.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return J=!1,fe(),p()&&w&&ee(n,u,L.data,L.error,!1),[2,!0]}})})},[u]),et=me(Ge.bind(h,n,function(){return D.current}),[]);if(X(function(){P.current=i,V.current=t}),X(function(){if(!!u){var R=u!==D.current,y=F.bind(h,ge),C=function(p,k,L){ne(S({error:k,isValidating:L},a(K.current.data,p)?h:{data:p}))},x=0,J=function(p){if(p==Ke){var k=Date.now();m().revalidateOnFocus&&k>x&&oe()&&(x=k+m().focusThrottleInterval,y())}else if(p==$e)m().revalidateOnReconnect&&oe()&&y();else if(p==He)return F()},Y=Ae(u,z,C),w=Ae(u,c,J);return E.current=!1,D.current=u,T.current=!0,R&&ne({data:I,error:j,isValidating:se}),Me()&&(b(I)||ae?y():Ot(y)),function(){E.current=!0,Y(),w()}}},[u,F]),X(function(){var R;function y(){var x=U(d)?d(I):d;x&&R!==-1&&(R=setTimeout(C,x))}function C(){!K.current.error&&(s||m().isVisible())&&(f||m().isOnline())?F(ge).then(y):y()}return y(),function(){R&&(clearTimeout(R),R=-1)}},[d,s,f,F]),st(I),o&&b(I)&&u)throw P.current=i,V.current=t,E.current=!1,b(j)?F(ge):j;return{mutate:et,get data(){return le.data=!0,I},get error(){return le.error=!0,j},get isValidating(){return le.isValidating=!0,se}}},Nr=Q.defineProperty(Rt,"default",{value:Ye});var xe=Lt(Mt);var Gr=e=>{let{invitationList:i,membershipList:t}=e||{},{organization:n,lastOrganizationMember:a,lastOrganizationInvitation:r}=Pe(),o=Se(),l=G(),d=l.loaded&&o&&n,s=l.loaded?()=>l.organization?.getPendingInvitations(i):()=>[],f=l.loaded?()=>l.organization?.getMemberships(t):()=>[],{data:v,isValidating:c,mutate:z}=xe(d&&i?Ze("invites",n,r,i):null,s),{data:N,isValidating:O,mutate:g}=xe(d&&t?Ze("memberships",n,a,t):null,f);return n===void 0?{isLoaded:!1,organization:void 0,invitationList:void 0,membershipList:void 0,membership:void 0}:n===null?{isLoaded:!0,organization:null,invitationList:null,membershipList:null,membership:null}:!l.loaded&&n?{isLoaded:!0,organization:n,invitationList:void 0,membershipList:void 0,membership:void 0}:{isLoaded:!O&&!c,organization:n,membershipList:N,membership:Tt(o.user.organizationMemberships,n.id),invitationList:v,unstable__mutate:()=>{g(),z()}}};function Tt(e,i){return e.find(t=>t.organization.id===i)}function Ze(e,i,t,n){return[e,i.id,t?.id,t?.updatedAt,n.offset,n.limit].filter(Boolean).join("-")}var Jr=()=>{let e=G(),i=Ie();return!e.loaded||!i?{isLoaded:!1,organizationList:void 0,createOrganization:void 0,setActive:void 0}:{isLoaded:!0,organizationList:It(i.organizationMemberships),setActive:e.setActive,createOrganization:e.createOrganization}};function It(e){return e.map(i=>({membership:i,organization:i.organization}))}var Zr=()=>{let e=G();return e.loaded?{isLoaded:!0,createOrganization:e.createOrganization,getOrganizationMemberships:e.getOrganizationMemberships,getOrganization:e.getOrganization}:{isLoaded:!1,createOrganization:void 0,getOrganizationMemberships:void 0,getOrganization:void 0}};export{kr as ClerkInstanceContext,Ar as ClientContext,ar as LocalStorageBroadcastChannel,Fr as OrganizationContext,mr as Poller,Vr as SessionContext,Ur as UserContext,Rr as addClerkPrefix,Zt as addYears,rt as assertContextExists,wr as buildErrorThrower,er as buildPublishableKey,cr as camelToSnake,Ht as colorToSameTypeString,H as createContextAndHook,qt as createCookieHandler,Er as createDeferredPromise,gr as createWorkerTimers,jt as dateTo12HourTime,dr as deepCamelToSnake,vr as deepSnakeToCamel,kt as detectUserAgentRobot,Jt as differenceInCalendarDays,or as extension,Bt as formatRelative,Nt as hasAlpha,Gt as hexStringToRgbaColor,Pt as inBrowser,yr as inClientSide,Wt as isHSLColor,pr as isHttpOrHttps,ur as isIPV4Address,nr as isLegacyFrontendApiKey,br as isProxyUrlRelative,rr as isPublishableKey,Ft as isRGBColor,ir as isRetinaDisplay,_t as isTransparent,Ut as isValidBrowserOnline,At as isValidHexString,Vt as isValidHslaString,hr as isValidProxyUrl,Dt as isValidRgbaString,Xt as isomorphicAtob,sr as noop,Yt as normalizeDate,tr as parsePublishableKey,Cr as parseSearchParams,Or as proxyUrlToAbsoluteURL,Qt as readJSONFile,xr as runWithExponentialBackOff,fr as snakeToCamel,Kt as stringToHslaColor,$t as stringToSameTypeColor,zr as stripScheme,lr as titleize,St as toSentence,G as useClerkInstanceContext,Dr as useClientContext,Gr as useOrganization,Pe as useOrganizationContext,Jr as useOrganizationList,Zr as useOrganizations,Se as useSessionContext,Ie as useUserContext};
import{A as tr,B as rr,C as nr,D as ir,E as ar,F as or,G as sr,H as ur,I as lr,J as fr,K as cr,L as dr,M as vr,N as gr,O as mr,P as hr,Q as pr,R as br,S as Or,T as yr,U as Cr,V as zr,W as Rr,X as xr,Y as Er,Z as wr,c as St,d as Pt,e as kt,f as Ut,g as At,h as Dt,i as Vt,j as Ft,k as Wt,l as _t,m as Nt,n as Kt,o as $t,p as Ht,q as Gt,r as qt,s as jt,t as Jt,u as Yt,v as Bt,w as Zt,x as Qt,y as Xt,z as er}from"./chunk-A53LO6A7.js";var tt=Object.freeze({InvalidFrontendApiErrorMessage:"The frontendApi passed to Clerk is invalid. You can get your Frontend API key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.dev/last-active?path=api-keys."});function Lr({packageName:e,customMessages:i}){let t=e,n={...tt,...i};function a(r,o){if(!o)return`${t}: ${r}`;let l=r,d=r.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(let s of d){let f=(o[s[1]]||"").toString();l=l.replace(`{{${s[1]}}}`,f)}return`${t}: ${l}`}return{setPackageName({packageName:r}){return typeof r=="string"&&(t=r),this},setMessages({customMessages:r}){return Object.assign(n,r||{}),this},throwInvalidPublishableKeyError(r){throw new Error(a(n.InvalidPublishableKeyErrorMessage,r))},throwInvalidFrontendApiError(r){throw new Error(a(n.InvalidFrontendApiErrorMessage,r))},throwInvalidProxyUrl(r){throw new Error(a(n.InvalidProxyUrlErrorMessage,r))},throwMissingPublishableKeyError(){throw new Error(a(n.MissingPublishableKeyErrorMessage))}}}import de from"react";function rt(e,i){if(!e)throw typeof i=="string"?new Error(i):new Error(`${i.displayName} not found`)}var H=(e,i)=>{let{assertCtxFn:t=rt}=i||{},n=de.createContext(void 0);return n.displayName=e,[n,()=>{let o=de.useContext(n);return t(o,`${e} not found`),o.value},()=>{let o=de.useContext(n);return o?o.value:{}}]};var[Ur,G]=H("ClerkInstanceContext"),[Ar,Ie]=H("UserContext"),[Dr,Vr]=H("ClientContext"),[Fr,Se]=H("SessionContext"),[Wr,Pe]=H("OrganizationContext");import{useEffect as nt,useLayoutEffect as it,createContext as at,useContext as De,useState as Ve,createElement as ot,useRef as W,useCallback as me,useDebugValue as st}from"react";function Fe(e,i,t,n){function a(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function l(f){try{s(n.next(f))}catch(v){o(v)}}function d(f){try{s(n.throw(f))}catch(v){o(v)}}function s(f){f.done?r(f.value):a(f.value).then(l,d)}s((n=n.apply(e,i||[])).next())})}function We(e,i){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(s){return function(f){return d([s,f])}}function d(s){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,a&&(r=s[0]&2?a.return:s[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;switch(a=0,r&&(s=[s[0]&2,r.value]),s[0]){case 0:case 1:r=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,a=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){t.label=s[1];break}if(s[0]===6&&t.label<r[1]){t.label=r[1],r=s;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(s);break}r[2]&&t.ops.pop(),t.trys.pop();continue}s=i.call(e,t)}catch(f){s=[6,f],a=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var M=function(){},h=M(),Q=Object,b=function(e){return e===h},U=function(e){return typeof e=="function"},S=function(e,i){return Q.assign({},e,i)},Ce="undefined",ze=function(){return typeof window!=Ce},ut=function(){return typeof document!=Ce},lt=function(){return ze()&&typeof window.requestAnimationFrame!=Ce},ie=new WeakMap,ft=0,te=function(e){var i=typeof e,t=e&&e.constructor,n=t==Date,a,r;if(Q(e)===e&&!n&&t!=RegExp){if(a=ie.get(e),a)return a;if(a=++ft+"~",ie.set(e,a),t==Array){for(a="@",r=0;r<e.length;r++)a+=te(e[r])+",";ie.set(e,a)}if(t==Q){a="#";for(var o=Q.keys(e).sort();!b(r=o.pop());)b(e[r])||(a+=r+":"+te(e[r])+",");ie.set(e,a)}}else a=n?e.toJSON():i=="symbol"?e.toString():i=="string"?JSON.stringify(e):""+e;return a},he=!0,ct=function(){return he},_e=ze(),Re=ut(),pe=_e&&window.addEventListener?window.addEventListener.bind(window):M,dt=Re?document.addEventListener.bind(document):M,be=_e&&window.removeEventListener?window.removeEventListener.bind(window):M,vt=Re?document.removeEventListener.bind(document):M,gt=function(){var e=Re&&document.visibilityState;return b(e)||e!=="hidden"},mt=function(e){return dt("visibilitychange",e),pe("focus",e),function(){vt("visibilitychange",e),be("focus",e)}},ht=function(e){var i=function(){he=!0,e()},t=function(){he=!1};return pe("online",i),pe("offline",t),function(){be("online",i),be("offline",t)}},pt={isOnline:ct,isVisible:gt},bt={initFocus:mt,initReconnect:ht},ae=!ze()||"Deno"in window,Ot=function(e){return lt()?window.requestAnimationFrame(e):setTimeout(e,1)},X=ae?nt:it,ve=typeof navigator<"u"&&navigator.connection,ke=!ae&&ve&&(["slow-2g","2g"].includes(ve.effectiveType)||ve.saveData),Ne=function(e){if(U(e))try{e=e()}catch{e=""}var i=[].concat(e);e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?te(e):"";var t=e?"$swr$"+e:"";return[e,i,t]},_=new WeakMap,Ke=0,$e=1,He=2,ee=function(e,i,t,n,a,r,o){o===void 0&&(o=!0);var l=_.get(e),d=l[0],s=l[1],f=l[3],v=d[i],c=s[i];if(o&&c)for(var z=0;z<c.length;++z)c[z](t,n,a);return r&&(delete f[i],v&&v[0])?v[0](He).then(function(){return e.get(i)}):e.get(i)},yt=0,Oe=function(){return++yt},Ge=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return Fe(void 0,void 0,void 0,function(){var t,n,a,r,o,l,d,s,f,v,c,z,N,O,g,u,q,A,T,E,D;return We(this,function(P){switch(P.label){case 0:if(t=e[0],n=e[1],a=e[2],r=e[3],o=typeof r=="boolean"?{revalidate:r}:r||{},l=b(o.populateCache)?!0:o.populateCache,d=o.revalidate!==!1,s=o.rollbackOnError!==!1,f=o.optimisticData,v=Ne(n),c=v[0],z=v[2],!c)return[2];if(N=_.get(t),O=N[2],e.length<3)return[2,ee(t,c,t.get(c),h,h,d,!0)];if(g=a,q=Oe(),O[c]=[q,0],A=!b(f),T=t.get(c),A&&(E=U(f)?f(T):f,t.set(c,E),ee(t,c,E)),U(g))try{g=g(t.get(c))}catch(V){u=V}return g&&U(g.then)?[4,g.catch(function(V){u=V})]:[3,2];case 1:if(g=P.sent(),q!==O[c][0]){if(u)throw u;return[2,g]}else u&&A&&s&&(l=!0,g=T,t.set(c,T));P.label=2;case 2:return l&&(u||(U(l)&&(g=l(g,T)),t.set(c,g)),t.set(z,S(t.get(z),{error:u}))),O[c][1]=Oe(),[4,ee(t,c,g,u,h,d,!!l)];case 3:if(D=P.sent(),u)throw u;return[2,l?D:g]}})})},Ue=function(e,i){for(var t in e)e[t][0]&&e[t][0](i)},qe=function(e,i){if(!_.has(e)){var t=S(bt,i),n={},a=Ge.bind(h,e),r=M;if(_.set(e,[n,{},{},{},a]),!ae){var o=t.initFocus(setTimeout.bind(h,Ue.bind(h,n,Ke))),l=t.initReconnect(setTimeout.bind(h,Ue.bind(h,n,$e)));r=function(){o&&o(),l&&l(),_.delete(e)}}return[e,a,r]}return[e,_.get(e)[4]]},Ct=function(e,i,t,n,a){var r=t.errorRetryCount,o=a.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*t.errorRetryInterval;!b(r)&&o>r||setTimeout(n,l,a)},je=qe(new Map),Je=je[0],zt=je[1],Ye=S({onLoadingSlow:M,onSuccess:M,onError:M,onErrorRetry:Ct,onDiscarded:M,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ke?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ke?5e3:3e3,compare:function(e,i){return te(e)==te(i)},isPaused:function(){return!1},cache:Je,mutate:zt,fallback:{}},pt),Be=function(e,i){var t=S(e,i);if(i){var n=e.use,a=e.fallback,r=i.use,o=i.fallback;n&&r&&(t.use=n.concat(r)),a&&o&&(t.fallback=S(a,o))}return t},ye=at({}),Rt=function(e){var i=e.value,t=Be(De(ye),i),n=i&&i.provider,a=Ve(function(){return n?qe(n(t.cache||Je),i):h})[0];return a&&(t.cache=a[0],t.mutate=a[1]),X(function(){return a?a[2]:h},[]),ot(ye.Provider,S(e,{value:t}))},xt=function(e,i){var t=Ve({})[1],n=W(e),a=W({data:!1,error:!1,isValidating:!1}),r=me(function(o){var l=!1,d=n.current;for(var s in o){var f=s;d[f]!==o[f]&&(d[f]=o[f],a.current[f]&&(l=!0))}l&&!i.current&&t({})},[]);return X(function(){n.current=e}),[n,a.current,r]},Et=function(e){return U(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}]},wt=function(){return S(Ye,De(ye))},Lt=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=wt(),r=Et(t),o=r[0],l=r[1],d=r[2],s=Be(a,d),f=e,v=s.use;if(v)for(var c=v.length;c-- >0;)f=v[c](f);return f(o,l||s.fetcher,s)}},Ae=function(e,i,t){var n=i[e]||(i[e]=[]);return n.push(t),function(){var a=n.indexOf(t);a>=0&&(n[a]=n[n.length-1],n.pop())}},ge={dedupe:!0},Mt=function(e,i,t){var n=t.cache,a=t.compare,r=t.fallbackData,o=t.suspense,l=t.revalidateOnMount,d=t.refreshInterval,s=t.refreshWhenHidden,f=t.refreshWhenOffline,v=_.get(n),c=v[0],z=v[1],N=v[2],O=v[3],g=Ne(e),u=g[0],q=g[1],A=g[2],T=W(!1),E=W(!1),D=W(u),P=W(i),V=W(t),m=function(){return V.current},oe=function(){return m().isVisible()&&m().isOnline()},re=function(R){return n.set(A,S(n.get(A),R))},Ee=n.get(u),Qe=b(r)?t.fallback[u]:r,I=b(Ee)?Qe:Ee,we=n.get(A)||{},j=we.error,Le=!T.current,Me=function(){return Le&&!b(l)?l:m().isPaused()?!1:o?b(I)?!1:t.revalidateIfStale:b(I)||t.revalidateIfStale},Xe=function(){return!u||!i?!1:we.isValidating?!0:Le&&Me()},se=Xe(),ue=xt({data:I,error:j,isValidating:se},E),K=ue[0],le=ue[1],ne=ue[2],F=me(function(R){return Fe(void 0,void 0,void 0,function(){var y,C,x,J,Y,w,p,k,L,fe,B,$,ce;return We(this,function(Z){switch(Z.label){case 0:if(y=P.current,!u||!y||E.current||m().isPaused())return[2,!1];J=!0,Y=R||{},w=!O[u]||!Y.dedupe,p=function(){return!E.current&&u===D.current&&T.current},k=function(){var Te=O[u];Te&&Te[1]===x&&delete O[u]},L={isValidating:!1},fe=function(){re({isValidating:!1}),p()&&ne(L)},re({isValidating:!0}),ne({isValidating:!0}),Z.label=1;case 1:return Z.trys.push([1,3,,4]),w&&(ee(n,u,K.current.data,K.current.error,!0),t.loadingTimeout&&!n.get(u)&&setTimeout(function(){J&&p()&&m().onLoadingSlow(u,t)},t.loadingTimeout),O[u]=[y.apply(void 0,q),Oe()]),ce=O[u],C=ce[0],x=ce[1],[4,C];case 2:return C=Z.sent(),w&&setTimeout(k,t.dedupingInterval),!O[u]||O[u][1]!==x?(w&&p()&&m().onDiscarded(u),[2,!1]):(re({error:h}),L.error=h,B=N[u],!b(B)&&(x<=B[0]||x<=B[1]||B[1]===0)?(fe(),w&&p()&&m().onDiscarded(u),[2,!1]):(a(K.current.data,C)?L.data=K.current.data:L.data=C,a(n.get(u),C)||n.set(u,C),w&&p()&&m().onSuccess(C,u,t),[3,4]));case 3:return $=Z.sent(),k(),m().isPaused()||(re({error:$}),L.error=$,w&&p()&&(m().onError($,u,t),(typeof t.shouldRetryOnError=="boolean"&&t.shouldRetryOnError||U(t.shouldRetryOnError)&&t.shouldRetryOnError($))&&oe()&&m().onErrorRetry($,u,t,F,{retryCount:(Y.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return J=!1,fe(),p()&&w&&ee(n,u,L.data,L.error,!1),[2,!0]}})})},[u]),et=me(Ge.bind(h,n,function(){return D.current}),[]);if(X(function(){P.current=i,V.current=t}),X(function(){if(!!u){var R=u!==D.current,y=F.bind(h,ge),C=function(p,k,L){ne(S({error:k,isValidating:L},a(K.current.data,p)?h:{data:p}))},x=0,J=function(p){if(p==Ke){var k=Date.now();m().revalidateOnFocus&&k>x&&oe()&&(x=k+m().focusThrottleInterval,y())}else if(p==$e)m().revalidateOnReconnect&&oe()&&y();else if(p==He)return F()},Y=Ae(u,z,C),w=Ae(u,c,J);return E.current=!1,D.current=u,T.current=!0,R&&ne({data:I,error:j,isValidating:se}),Me()&&(b(I)||ae?y():Ot(y)),function(){E.current=!0,Y(),w()}}},[u,F]),X(function(){var R;function y(){var x=U(d)?d(I):d;x&&R!==-1&&(R=setTimeout(C,x))}function C(){!K.current.error&&(s||m().isVisible())&&(f||m().isOnline())?F(ge).then(y):y()}return y(),function(){R&&(clearTimeout(R),R=-1)}},[d,s,f,F]),st(I),o&&b(I)&&u)throw P.current=i,V.current=t,E.current=!1,b(j)?F(ge):j;return{mutate:et,get data(){return le.data=!0,I},get error(){return le.error=!0,j},get isValidating(){return le.isValidating=!0,se}}},Kr=Q.defineProperty(Rt,"default",{value:Ye});var xe=Lt(Mt);var qr=e=>{let{invitationList:i,membershipList:t}=e||{},{organization:n,lastOrganizationMember:a,lastOrganizationInvitation:r}=Pe(),o=Se(),l=G(),d=l.loaded&&o&&n,s=l.loaded?()=>l.organization?.getPendingInvitations(i):()=>[],f=l.loaded?()=>l.organization?.getMemberships(t):()=>[],{data:v,isValidating:c,mutate:z}=xe(d&&i?Ze("invites",n,r,i):null,s),{data:N,isValidating:O,mutate:g}=xe(d&&t?Ze("memberships",n,a,t):null,f);return n===void 0?{isLoaded:!1,organization:void 0,invitationList:void 0,membershipList:void 0,membership:void 0}:n===null?{isLoaded:!0,organization:null,invitationList:null,membershipList:null,membership:null}:!l.loaded&&n?{isLoaded:!0,organization:n,invitationList:void 0,membershipList:void 0,membership:void 0}:{isLoaded:!O&&!c,organization:n,membershipList:N,membership:Tt(o.user.organizationMemberships,n.id),invitationList:v,unstable__mutate:()=>{g(),z()}}};function Tt(e,i){return e.find(t=>t.organization.id===i)}function Ze(e,i,t,n){return[e,i.id,t?.id,t?.updatedAt,n.offset,n.limit].filter(Boolean).join("-")}var Yr=()=>{let e=G(),i=Ie();return!e.loaded||!i?{isLoaded:!1,organizationList:void 0,createOrganization:void 0,setActive:void 0}:{isLoaded:!0,organizationList:It(i.organizationMemberships),setActive:e.setActive,createOrganization:e.createOrganization}};function It(e){return e.map(i=>({membership:i,organization:i.organization}))}var Qr=()=>{let e=G();return e.loaded?{isLoaded:!0,createOrganization:e.createOrganization,getOrganizationMemberships:e.getOrganizationMemberships,getOrganization:e.getOrganization}:{isLoaded:!1,createOrganization:void 0,getOrganizationMemberships:void 0,getOrganization:void 0}};export{Ur as ClerkInstanceContext,Dr as ClientContext,ar as LocalStorageBroadcastChannel,Wr as OrganizationContext,mr as Poller,Fr as SessionContext,Ar as UserContext,Rr as addClerkPrefix,Zt as addYears,rt as assertContextExists,Lr as buildErrorThrower,er as buildPublishableKey,cr as camelToSnake,Ht as colorToSameTypeString,H as createContextAndHook,qt as createCookieHandler,wr as createDeferredPromise,gr as createWorkerTimers,jt as dateTo12HourTime,dr as deepCamelToSnake,vr as deepSnakeToCamel,kt as detectUserAgentRobot,Jt as differenceInCalendarDays,or as extension,Bt as formatRelative,Nt as hasAlpha,Gt as hexStringToRgbaColor,Pt as inBrowser,yr as inClientSide,Wt as isHSLColor,pr as isHttpOrHttps,ur as isIPV4Address,nr as isLegacyFrontendApiKey,br as isProxyUrlRelative,rr as isPublishableKey,Ft as isRGBColor,ir as isRetinaDisplay,_t as isTransparent,Ut as isValidBrowserOnline,At as isValidHexString,Vt as isValidHslaString,hr as isValidProxyUrl,Dt as isValidRgbaString,Xt as isomorphicAtob,sr as noop,Yt as normalizeDate,tr as parsePublishableKey,Cr as parseSearchParams,xr as pathFromFullPath,Or as proxyUrlToAbsoluteURL,Qt as readJSONFile,Er as runWithExponentialBackOff,fr as snakeToCamel,Kt as stringToHslaColor,$t as stringToSameTypeColor,zr as stripScheme,lr as titleize,St as toSentence,G as useClerkInstanceContext,Vr as useClientContext,qr as useOrganization,Pe as useOrganizationContext,Yr as useOrganizationList,Qr as useOrganizations,Se as useSessionContext,Ie as useUserContext};
/*! *****************************************************************************

@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation.

@@ -1,2 +0,2 @@

import{G as o,a as n,b as e}from"../chunk-EREY7YFW.js";var t={};n(t,{noop:()=>o,render:()=>m,userEvent:()=>p});var r={};n(r,{noop:()=>o,render:()=>m,userEvent:()=>p});import"@testing-library/jest-dom/extend-expect";import{render as a}from"@testing-library/react";e(r,R);import*as R from"@testing-library/react";import{default as p}from"@testing-library/user-event";var m=(i,s)=>a(i,s);e(t,r);export{o as noop,m as render,p as userEvent};
import{G as o,a as n,b as e}from"../chunk-A53LO6A7.js";var t={};n(t,{noop:()=>o,render:()=>m,userEvent:()=>p});var r={};n(r,{noop:()=>o,render:()=>m,userEvent:()=>p});import"@testing-library/jest-dom/extend-expect";import{render as a}from"@testing-library/react";e(r,R);import*as R from"@testing-library/react";import{default as p}from"@testing-library/user-event";var m=(i,s)=>a(i,s);e(t,r);export{o as noop,m as render,p as userEvent};
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

"use strict";var Pt=Object.create;var ae=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var _t=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var Wt=(e,r)=>{for(var t in r)ae(e,t,{get:r[t],enumerable:!0})},Ze=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of At(r))!Ut.call(e,o)&&o!==t&&ae(e,o,{get:()=>r[o],enumerable:!(n=Dt(r,o))||n.enumerable});return e};var Ft=(e,r,t)=>(t=e!=null?Pt(_t(e)):{},Ze(r||!e||!e.__esModule?ae(t,"default",{value:e,enumerable:!0}):t,e)),Vt=e=>Ze(ae({},"__esModule",{value:!0}),e);var hn={};Wt(hn,{ClerkInstanceContext:()=>Nt,ClientContext:()=>Bt,LocalStorageBroadcastChannel:()=>He,OrganizationContext:()=>Xt,Poller:()=>on,SessionContext:()=>jt,UserContext:()=>Kt,addClerkPrefix:()=>dn,addYears:()=>$r,assertContextExists:()=>Qe,buildErrorThrower:()=>Ht,buildPublishableKey:()=>Kr,camelToSnake:()=>Ke,colorToSameTypeString:()=>yt,createContextAndHook:()=>$,createCookieHandler:()=>Wr,createDeferredPromise:()=>vn,createWorkerTimers:()=>he,dateTo12HourTime:()=>Fr,deepCamelToSnake:()=>en,deepSnakeToCamel:()=>tn,detectUserAgentRobot:()=>bt,differenceInCalendarDays:()=>wt,extension:()=>Jr,formatRelative:()=>Vr,hasAlpha:()=>Sr,hexStringToRgbaColor:()=>xt,inBrowser:()=>ht,inClientSide:()=>un,isHSLColor:()=>Fe,isHttpOrHttps:()=>It,isIPV4Address:()=>Zr,isLegacyFrontendApiKey:()=>Gr,isProxyUrlRelative:()=>Ge,isPublishableKey:()=>Et,isRGBColor:()=>We,isRetinaDisplay:()=>jr,isTransparent:()=>fe,isValidBrowserOnline:()=>Tr,isValidHexString:()=>ne,isValidHslaString:()=>de,isValidProxyUrl:()=>an,isValidRgbaString:()=>ce,isomorphicAtob:()=>ve,noop:()=>G,normalizeDate:()=>ge,parsePublishableKey:()=>Br,parseSearchParams:()=>ln,proxyUrlToAbsoluteURL:()=>sn,readJSONFile:()=>Hr,runWithExponentialBackOff:()=>gn,snakeToCamel:()=>Ne,stringToHslaColor:()=>Lr,stringToSameTypeColor:()=>Mr,stripScheme:()=>cn,titleize:()=>Qr,toSentence:()=>Cr,useClerkInstanceContext:()=>H,useClientContext:()=>Gt,useOrganization:()=>vr,useOrganizationContext:()=>Ee,useOrganizationList:()=>br,useOrganizations:()=>xr,useSessionContext:()=>Oe,useUserContext:()=>we});module.exports=Vt(hn);var $t=Object.freeze({InvalidFrontendApiErrorMessage:"The frontendApi passed to Clerk is invalid. You can get your Frontend API key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.dev/last-active?path=api-keys."});function Ht({packageName:e,customMessages:r}){let t=e,n={...$t,...r};function o(i,a){if(!a)return`${t}: ${i}`;let u=i,f=i.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(let s of f){let c=(a[s[1]]||"").toString();u=u.replace(`{{${s[1]}}}`,c)}return`${t}: ${u}`}return{setPackageName({packageName:i}){return typeof i=="string"&&(t=i),this},setMessages({customMessages:i}){return Object.assign(n,i||{}),this},throwInvalidPublishableKeyError(i){throw new Error(o(n.InvalidPublishableKeyErrorMessage,i))},throwInvalidFrontendApiError(i){throw new Error(o(n.InvalidFrontendApiErrorMessage,i))},throwInvalidProxyUrl(i){throw new Error(o(n.InvalidProxyUrlErrorMessage,i))},throwMissingPublishableKeyError(){throw new Error(o(n.MissingPublishableKeyErrorMessage))}}}var se=Ft(require("react"));function Qe(e,r){if(!e)throw typeof r=="string"?new Error(r):new Error(`${r.displayName} not found`)}var $=(e,r)=>{let{assertCtxFn:t=Qe}=r||{},n=se.default.createContext(void 0);return n.displayName=e,[n,()=>{let a=se.default.useContext(n);return t(a,`${e} not found`),a.value},()=>{let a=se.default.useContext(n);return a?a.value:{}}]};var[Nt,H]=$("ClerkInstanceContext"),[Kt,we]=$("UserContext"),[Bt,Gt]=$("ClientContext"),[jt,Oe]=$("SessionContext"),[Xt,Ee]=$("OrganizationContext");var p=require("react");function nt(e,r,t,n){function o(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function u(c){try{s(n.next(c))}catch(m){a(m)}}function f(c){try{s(n.throw(c))}catch(m){a(m)}}function s(c){c.done?i(c.value):o(c.value).then(u,f)}s((n=n.apply(e,r||[])).next())})}function it(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(s){return function(c){return f([s,c])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,o=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1],i=s;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(s);break}i[2]&&t.ops.pop(),t.trys.pop();continue}s=r.call(e,t)}catch(c){s=[6,c],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var z=function(){},b=z(),Q=Object,x=function(e){return e===b},_=function(e){return typeof e=="function"},P=function(e,r){return Q.assign({},e,r)},De="undefined",Ae=function(){return typeof window!=De},Yt=function(){return typeof document!=De},Jt=function(){return Ae()&&typeof window.requestAnimationFrame!=De},ue=new WeakMap,qt=0,re=function(e){var r=typeof e,t=e&&e.constructor,n=t==Date,o,i;if(Q(e)===e&&!n&&t!=RegExp){if(o=ue.get(e),o)return o;if(o=++qt+"~",ue.set(e,o),t==Array){for(o="@",i=0;i<e.length;i++)o+=re(e[i])+",";ue.set(e,o)}if(t==Q){o="#";for(var a=Q.keys(e).sort();!x(i=a.pop());)x(e[i])||(o+=i+":"+re(e[i])+",");ue.set(e,o)}}else o=n?e.toJSON():r=="symbol"?e.toString():r=="string"?JSON.stringify(e):""+e;return o},Ie=!0,Zt=function(){return Ie},ot=Ae(),_e=Yt(),ze=ot&&window.addEventListener?window.addEventListener.bind(window):z,Qt=_e?document.addEventListener.bind(document):z,Le=ot&&window.removeEventListener?window.removeEventListener.bind(window):z,er=_e?document.removeEventListener.bind(document):z,tr=function(){var e=_e&&document.visibilityState;return x(e)||e!=="hidden"},rr=function(e){return Qt("visibilitychange",e),ze("focus",e),function(){er("visibilitychange",e),Le("focus",e)}},nr=function(e){var r=function(){Ie=!0,e()},t=function(){Ie=!1};return ze("online",r),ze("offline",t),function(){Le("online",r),Le("offline",t)}},ir={isOnline:Zt,isVisible:tr},or={initFocus:rr,initReconnect:nr},le=!Ae()||"Deno"in window,ar=function(e){return Jt()?window.requestAnimationFrame(e):setTimeout(e,1)},ee=le?p.useEffect:p.useLayoutEffect,ke=typeof navigator<"u"&&navigator.connection,et=!le&&ke&&(["slow-2g","2g"].includes(ke.effectiveType)||ke.saveData),at=function(e){if(_(e))try{e=e()}catch{e=""}var r=[].concat(e);e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?re(e):"";var t=e?"$swr$"+e:"";return[e,r,t]},N=new WeakMap,st=0,ut=1,lt=2,te=function(e,r,t,n,o,i,a){a===void 0&&(a=!0);var u=N.get(e),f=u[0],s=u[1],c=u[3],m=f[r],l=s[r];if(a&&l)for(var v=0;v<l.length;++v)l[v](t,n,o);return i&&(delete c[r],m&&m[0])?m[0](lt).then(function(){return e.get(r)}):e.get(r)},sr=0,Me=function(){return++sr},ct=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return nt(void 0,void 0,void 0,function(){var t,n,o,i,a,u,f,s,c,m,l,v,C,T,g,d,j,U,L,k,W;return it(this,function(D){switch(D.label){case 0:if(t=e[0],n=e[1],o=e[2],i=e[3],a=typeof i=="boolean"?{revalidate:i}:i||{},u=x(a.populateCache)?!0:a.populateCache,f=a.revalidate!==!1,s=a.rollbackOnError!==!1,c=a.optimisticData,m=at(n),l=m[0],v=m[2],!l)return[2];if(C=N.get(t),T=C[2],e.length<3)return[2,te(t,l,t.get(l),b,b,f,!0)];if(g=o,j=Me(),T[l]=[j,0],U=!x(c),L=t.get(l),U&&(k=_(c)?c(L):c,t.set(l,k),te(t,l,k)),_(g))try{g=g(t.get(l))}catch(F){d=F}return g&&_(g.then)?[4,g.catch(function(F){d=F})]:[3,2];case 1:if(g=D.sent(),j!==T[l][0]){if(d)throw d;return[2,g]}else d&&U&&s&&(u=!0,g=L,t.set(l,L));D.label=2;case 2:return u&&(d||(_(u)&&(g=u(g,L)),t.set(l,g)),t.set(v,P(t.get(v),{error:d}))),T[l][1]=Me(),[4,te(t,l,g,d,b,f,!!u)];case 3:if(W=D.sent(),d)throw d;return[2,u?W:g]}})})},tt=function(e,r){for(var t in e)e[t][0]&&e[t][0](r)},dt=function(e,r){if(!N.has(e)){var t=P(or,r),n={},o=ct.bind(b,e),i=z;if(N.set(e,[n,{},{},{},o]),!le){var a=t.initFocus(setTimeout.bind(b,tt.bind(b,n,st))),u=t.initReconnect(setTimeout.bind(b,tt.bind(b,n,ut)));i=function(){a&&a(),u&&u(),N.delete(e)}}return[e,o,i]}return[e,N.get(e)[4]]},ur=function(e,r,t,n,o){var i=t.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*t.errorRetryInterval;!x(i)&&a>i||setTimeout(n,u,o)},ft=dt(new Map),pt=ft[0],lr=ft[1],mt=P({onLoadingSlow:z,onSuccess:z,onError:z,onErrorRetry:ur,onDiscarded:z,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:et?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:et?5e3:3e3,compare:function(e,r){return re(e)==re(r)},isPaused:function(){return!1},cache:pt,mutate:lr,fallback:{}},ir),gt=function(e,r){var t=P(e,r);if(r){var n=e.use,o=e.fallback,i=r.use,a=r.fallback;n&&i&&(t.use=n.concat(i)),o&&a&&(t.fallback=P(o,a))}return t},Pe=(0,p.createContext)({}),cr=function(e){var r=e.value,t=gt((0,p.useContext)(Pe),r),n=r&&r.provider,o=(0,p.useState)(function(){return n?dt(n(t.cache||pt),r):b})[0];return o&&(t.cache=o[0],t.mutate=o[1]),ee(function(){return o?o[2]:b},[]),(0,p.createElement)(Pe.Provider,P(e,{value:t}))},dr=function(e,r){var t=(0,p.useState)({})[1],n=(0,p.useRef)(e),o=(0,p.useRef)({data:!1,error:!1,isValidating:!1}),i=(0,p.useCallback)(function(a){var u=!1,f=n.current;for(var s in a){var c=s;f[c]!==a[c]&&(f[c]=a[c],o.current[c]&&(u=!0))}u&&!r.current&&t({})},[]);return ee(function(){n.current=e}),[n,o.current,i]},fr=function(e){return _(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}]},pr=function(){return P(mt,(0,p.useContext)(Pe))},mr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=pr(),i=fr(t),a=i[0],u=i[1],f=i[2],s=gt(o,f),c=e,m=s.use;if(m)for(var l=m.length;l-- >0;)c=m[l](c);return c(a,u||s.fetcher,s)}},rt=function(e,r,t){var n=r[e]||(r[e]=[]);return n.push(t),function(){var o=n.indexOf(t);o>=0&&(n[o]=n[n.length-1],n.pop())}},Se={dedupe:!0},gr=function(e,r,t){var n=t.cache,o=t.compare,i=t.fallbackData,a=t.suspense,u=t.revalidateOnMount,f=t.refreshInterval,s=t.refreshWhenHidden,c=t.refreshWhenOffline,m=N.get(n),l=m[0],v=m[1],C=m[2],T=m[3],g=at(e),d=g[0],j=g[1],U=g[2],L=(0,p.useRef)(!1),k=(0,p.useRef)(!1),W=(0,p.useRef)(d),D=(0,p.useRef)(r),F=(0,p.useRef)(t),h=function(){return F.current},be=function(){return h().isVisible()&&h().isOnline()},ie=function(O){return n.set(U,P(n.get(U),O))},je=n.get(d),zt=x(i)?t.fallback[d]:i,M=x(je)?zt:je,Xe=n.get(U)||{},X=Xe.error,Ye=!L.current,Je=function(){return Ye&&!x(u)?u:h().isPaused()?!1:a?x(M)?!1:t.revalidateIfStale:x(M)||t.revalidateIfStale},Lt=function(){return!d||!r?!1:Xe.isValidating?!0:Ye&&Je()},ye=Lt(),xe=dr({data:M,error:X,isValidating:ye},k),K=xe[0],Ce=xe[1],oe=xe[2],V=(0,p.useCallback)(function(O){return nt(void 0,void 0,void 0,function(){var R,w,E,Y,J,S,y,A,I,Te,q,B,Re;return it(this,function(Z){switch(Z.label){case 0:if(R=D.current,!d||!R||k.current||h().isPaused())return[2,!1];Y=!0,J=O||{},S=!T[d]||!J.dedupe,y=function(){return!k.current&&d===W.current&&L.current},A=function(){var qe=T[d];qe&&qe[1]===E&&delete T[d]},I={isValidating:!1},Te=function(){ie({isValidating:!1}),y()&&oe(I)},ie({isValidating:!0}),oe({isValidating:!0}),Z.label=1;case 1:return Z.trys.push([1,3,,4]),S&&(te(n,d,K.current.data,K.current.error,!0),t.loadingTimeout&&!n.get(d)&&setTimeout(function(){Y&&y()&&h().onLoadingSlow(d,t)},t.loadingTimeout),T[d]=[R.apply(void 0,j),Me()]),Re=T[d],w=Re[0],E=Re[1],[4,w];case 2:return w=Z.sent(),S&&setTimeout(A,t.dedupingInterval),!T[d]||T[d][1]!==E?(S&&y()&&h().onDiscarded(d),[2,!1]):(ie({error:b}),I.error=b,q=C[d],!x(q)&&(E<=q[0]||E<=q[1]||q[1]===0)?(Te(),S&&y()&&h().onDiscarded(d),[2,!1]):(o(K.current.data,w)?I.data=K.current.data:I.data=w,o(n.get(d),w)||n.set(d,w),S&&y()&&h().onSuccess(w,d,t),[3,4]));case 3:return B=Z.sent(),A(),h().isPaused()||(ie({error:B}),I.error=B,S&&y()&&(h().onError(B,d,t),(typeof t.shouldRetryOnError=="boolean"&&t.shouldRetryOnError||_(t.shouldRetryOnError)&&t.shouldRetryOnError(B))&&be()&&h().onErrorRetry(B,d,t,V,{retryCount:(J.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return Y=!1,Te(),y()&&S&&te(n,d,I.data,I.error,!1),[2,!0]}})})},[d]),Mt=(0,p.useCallback)(ct.bind(b,n,function(){return W.current}),[]);if(ee(function(){D.current=r,F.current=t}),ee(function(){if(!!d){var O=d!==W.current,R=V.bind(b,Se),w=function(y,A,I){oe(P({error:A,isValidating:I},o(K.current.data,y)?b:{data:y}))},E=0,Y=function(y){if(y==st){var A=Date.now();h().revalidateOnFocus&&A>E&&be()&&(E=A+h().focusThrottleInterval,R())}else if(y==ut)h().revalidateOnReconnect&&be()&&R();else if(y==lt)return V()},J=rt(d,v,w),S=rt(d,l,Y);return k.current=!1,W.current=d,L.current=!0,O&&oe({data:M,error:X,isValidating:ye}),Je()&&(x(M)||le?R():ar(R)),function(){k.current=!0,J(),S()}}},[d,V]),ee(function(){var O;function R(){var E=_(f)?f(M):f;E&&O!==-1&&(O=setTimeout(w,E))}function w(){!K.current.error&&(s||h().isVisible())&&(c||h().isOnline())?V(Se).then(R):R()}return R(),function(){O&&(clearTimeout(O),O=-1)}},[f,s,c,V]),(0,p.useDebugValue)(M),a&&x(M)&&d)throw D.current=r,F.current=t,k.current=!1,x(X)?V(Se):X;return{mutate:Mt,get data(){return Ce.data=!0,M},get error(){return Ce.error=!0,X},get isValidating(){return Ce.isValidating=!0,ye}}},On=Q.defineProperty(cr,"default",{value:mt});var Ue=mr(gr);var vr=e=>{let{invitationList:r,membershipList:t}=e||{},{organization:n,lastOrganizationMember:o,lastOrganizationInvitation:i}=Ee(),a=Oe(),u=H(),f=u.loaded&&a&&n,s=u.loaded?()=>u.organization?.getPendingInvitations(r):()=>[],c=u.loaded?()=>u.organization?.getMemberships(t):()=>[],{data:m,isValidating:l,mutate:v}=Ue(f&&r?vt("invites",n,i,r):null,s),{data:C,isValidating:T,mutate:g}=Ue(f&&t?vt("memberships",n,o,t):null,c);return n===void 0?{isLoaded:!1,organization:void 0,invitationList:void 0,membershipList:void 0,membership:void 0}:n===null?{isLoaded:!0,organization:null,invitationList:null,membershipList:null,membership:null}:!u.loaded&&n?{isLoaded:!0,organization:n,invitationList:void 0,membershipList:void 0,membership:void 0}:{isLoaded:!T&&!l,organization:n,membershipList:C,membership:hr(a.user.organizationMemberships,n.id),invitationList:m,unstable__mutate:()=>{g(),v()}}};function hr(e,r){return e.find(t=>t.organization.id===r)}function vt(e,r,t,n){return[e,r.id,t?.id,t?.updatedAt,n.offset,n.limit].filter(Boolean).join("-")}var br=()=>{let e=H(),r=we();return!e.loaded||!r?{isLoaded:!1,organizationList:void 0,createOrganization:void 0,setActive:void 0}:{isLoaded:!0,organizationList:yr(r.organizationMemberships),setActive:e.setActive,createOrganization:e.createOrganization}};function yr(e){return e.map(r=>({membership:r,organization:r.organization}))}var xr=()=>{let e=H();return e.loaded?{isLoaded:!0,createOrganization:e.createOrganization,getOrganizationMemberships:e.getOrganizationMemberships,getOrganization:e.getOrganization}:{isLoaded:!1,createOrganization:void 0,getOrganizationMemberships:void 0,getOrganization:void 0}};var Cr=e=>{if(e.length==0)return"";if(e.length==1)return e[0];let r=e.slice(0,-1).join(", ");return r+=`, or ${e.slice(-1)}`,r};function ht(){return typeof window<"u"}function bt(e){return new RegExp([/bot/,/spider/,/crawl/,/APIs-Google/,/AdsBot/,/Googlebot/,/mediapartners/,/Google Favicon/,/FeedFetcher/,/Google-Read-Aloud/,/DuplexWeb-Google/,/googleweblight/,/bing/,/yandex/,/baidu/,/duckduck/,/yahoo/,/ecosia/,/ia_archiver/,/facebook/,/instagram/,/pinterest/,/reddit/,/slack/,/twitter/,/whatsapp/,/youtube/,/semrush/].map(t=>t.source).join("|"),"i").test(e)}function Tr(){let e=window?.navigator;if(!ht()||!e)return!1;let r=bt(e?.userAgent),t=e?.webdriver,n=e?.onLine,o=e?.connection?.rtt!==0&&e?.connection?.downlink!==0;return!r&&!t&&o&&n}var Rr=/^#?([A-F0-9]{6}|[A-F0-9]{3})$/i,wr=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/i,Or=/^rgba\((\d+),\s*(\d+),\s*(\d+)(,\s*\d+(\.\d+)?)\)$/i,Er=/^hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)$/i,kr=/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%(,\s*\d+(\.\d+)?)*\)$/i,ne=e=>!!e.match(Rr),ce=e=>!!(e.match(wr)||e.match(Or)),de=e=>!!e.match(Er)||!!e.match(kr),We=e=>typeof e!="string"&&"r"in e,Fe=e=>typeof e!="string"&&"h"in e,fe=e=>e==="transparent",Sr=e=>typeof e!="string"&&e.a!=null&&e.a<1;var Ir=/[hsla()]/g,zr=/[rgba()]/g,Lr=e=>e==="transparent"?{h:0,s:0,l:0,a:0}:ne(e)?Ar(e):de(e)?Rt(e):ce(e)?Ct(e):null,Mr=e=>(e=e.trim(),ne(e)?e.startsWith("#")?e:`#${e}`:ce(e)?Tt(e):de(e)?Rt(e):fe(e)?e:""),yt=e=>typeof e=="string"&&(ne(e)||fe(e))?e:We(e)?Pr(e):Fe(e)?Dr(e):"",xt=e=>{e=e.replace("#","");let r=parseInt(e.substring(0,2),16),t=parseInt(e.substring(2,4),16),n=parseInt(e.substring(4,6),16);return{r,g:t,b:n}},Pr=e=>{let{a:r,b:t,g:n,r:o}=e;return e.a===0?"transparent":e.a!=null?`rgba(${o},${n},${t},${r})`:`rgb(${o},${n},${t})`},Dr=e=>{let{h:r,s:t,l:n,a:o}=e,i=Math.round(t*100),a=Math.round(n*100);return e.a===0?"transparent":e.a!=null?`hsla(${r},${i}%,${a}%,${o})`:`hsl(${r},${i}%,${a}%)`},Ar=e=>{let r=yt(xt(e));return Ct(r)},Ct=e=>{let r=Tt(e),t=r.r/255,n=r.g/255,o=r.b/255,i=Math.max(t,n,o),a=Math.min(t,n,o),u,f,s=(i+a)/2;if(i==a)u=f=0;else{let l=i-a;switch(f=s>=.5?l/(2-(i+a)):l/(i+a),i){case t:u=(n-o)/l*60;break;case n:u=((o-t)/l+2)*60;break;default:u=((t-n)/l+4)*60;break}}let c={h:Math.round(u),s:f,l:s},m=r.a;return m!=null&&(c.a=m),c},Tt=e=>{let[r,t,n,o]=e.replace(zr,"").split(",").map(i=>Number.parseFloat(i));return{r,g:t,b:n,a:o}},Rt=e=>{let[r,t,n,o]=e.replace(Ir,"").split(",").map(i=>Number.parseFloat(i));return{h:r,s:t/100,l:n/100,a:o}};function pe(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)e[n]=t[n]}return e}var _r={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ve(e,r){function t(o,i,a){if(!(typeof document>"u")){a=pe({},r,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var f in a)!a[f]||(u+="; "+f,a[f]!==!0&&(u+="="+a[f].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+u}}function n(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},u=0;u<i.length;u++){var f=i[u].split("="),s=f.slice(1).join("=");try{var c=decodeURIComponent(f[0]);if(a[c]=e.read(s,c),o===c)break}catch{}}return o?a[o]:a}}return Object.create({set:t,get:n,remove:function(o,i){t(o,"",pe({},i,{expires:-1}))},withAttributes:function(o){return Ve(this.converter,pe({},this.attributes,o))},withConverter:function(o){return Ve(pe({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(e)}})}var Ur=Ve(_r,{path:"/"}),me=Ur;function Wr(e){return{get(){return me.get(e)},set(r,t={}){return me.set(e,r,t)},remove(r){me.remove(e,r)}}}function Fr(e){return e?e.toLocaleString("en-US",{hour:"2-digit",minute:"numeric",hour12:!0}):""}function wt(e,r,{absolute:t=!0}={}){if(!e||!r)return 0;let n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),o=Date.UTC(r.getFullYear(),r.getMonth(),r.getDate()),i=Math.floor((o-n)/864e5);return t?Math.abs(i):i}function ge(e){try{return new Date(e||new Date)}catch{return new Date}}function Vr(e){let{date:r,relativeTo:t}=e;if(!r||!t)return null;let n=ge(r),o=ge(t),i=wt(o,n,{absolute:!1});return i<-6?{relativeDateCase:"other",date:n}:i<-1?{relativeDateCase:"previous6Days",date:n}:i===-1?{relativeDateCase:"lastDay",date:n}:i===0?{relativeDateCase:"sameDay",date:n}:i===1?{relativeDateCase:"nextDay",date:n}:i<7?{relativeDateCase:"next6Days",date:n}:{relativeDateCase:"other",date:n}}function $r(e,r){let t=ge(e);return t.setFullYear(t.getFullYear()+r),t}function Hr(e){return new Promise((r,t)=>{let n=new FileReader;n.addEventListener("load",function(){let o=JSON.parse(n.result);r(o)}),n.addEventListener("error",t),n.readAsText(e)})}var ve=e=>typeof atob<"u"&&typeof atob=="function"?atob(e):typeof global<"u"&&global.Buffer?new global.Buffer(e,"base64").toString():e;var $e="pk_live_",Ot="pk_test_",Nr=/^(([a-z]+)-){2}([0-9]{1,2})\.clerk\.accounts([a-z.]*)(dev|com)$/i;function Kr(e){return`${Nr.test(e)?Ot:$e}${btoa(`${e}$`)}`}function Br(e){if(e=e||"",!Et(e))return null;let r=e.startsWith($e)?"production":"development",t=ve(e.split("_")[2]);return t.endsWith("$")?(t=t.slice(0,-1),{instanceType:r,frontendApi:t}):null}function Et(e){e=e||"";let r=e.startsWith($e)||e.startsWith(Ot),t=ve(e.split("_")[2]||"").endsWith("$");return r&&t}function Gr(e){return e=e||"",e.startsWith("clerk.")}function jr(){if(!window.matchMedia)return!1;let e=window.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)");return e&&e.matches||window.devicePixelRatio>1}var Xr="__lsbc__",He=class{constructor(r){this.eventTarget=window;this.postMessage=r=>{try{localStorage.setItem(this.channelKey,JSON.stringify(r)),localStorage.removeItem(this.channelKey)}catch{}};this.addEventListener=(r,t)=>{this.eventTarget.addEventListener(this.prefixEventName(r),n=>{t(n)})};this.setupLocalStorageListener=()=>{let r=t=>{if(!(t.key!==this.channelKey||!t.newValue))try{let n=JSON.parse(t.newValue||""),o=new MessageEvent(this.prefixEventName("message"),{data:n});this.eventTarget.dispatchEvent(o)}catch{}};window.addEventListener("storage",r)};this.channelKey=Xr+r,this.setupLocalStorageListener()}prefixEventName(r){return this.channelKey+r}};var Yr=Object.freeze({"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/x-icon":"ico","image/vnd.microsoft.icon":"ico"}),Jr=e=>Yr[e];var G=(...e)=>{};var qr=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;function Zr(e){return qr.test(e||"")}function Qr(e){let r=e||"";return r.charAt(0).toUpperCase()+r.slice(1)}function Ne(e){return e?e.replace(/([-_][a-z])/g,r=>r.toUpperCase().replace(/-|_/,"")):""}function Ke(e){return e?e.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`):""}var kt=e=>{let r=t=>{if(!t)return t;if(Array.isArray(t))return t.map(i=>typeof i=="object"||Array.isArray(i)?r(i):i);let n={...t},o=Object.keys(n);for(let i of o){let a=e(i.toString());a!==i&&(n[a]=n[i],delete n[i]),typeof n[a]=="object"&&(n[a]=r(n[a]))}return n};return r},en=kt(Ke),tn=kt(Ne);var Be=`const respond=r=>{self.postMessage(r)},workerToTabIds={};self.addEventListener("message",r=>{const e=r.data;switch(e.type){case"setTimeout":workerToTabIds[e.id]=setTimeout(()=>{respond({id:e.id})},e.ms);break;case"clearTimeout":workerToTabIds[e.id]&&(clearTimeout(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break;case"setInterval":workerToTabIds[e.id]=setInterval(()=>{respond({id:e.id})},e.ms);break;case"clearInterval":workerToTabIds[e.id]&&(clearInterval(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break}});
`;var St=(e,r={})=>{if(typeof Worker>"u")return null;try{let t=new Blob([e],{type:"application/javascript; charset=utf-8"}),n=globalThis.URL.createObjectURL(t);return new Worker(n,r)}catch{return console.warn("Clerk: Cannot create worker from blob. Consider adding worker-src blob:; to your CSP"),null}},nn=()=>{let e=globalThis.setTimeout.bind(globalThis),r=globalThis.setInterval.bind(globalThis),t=globalThis.clearTimeout.bind(globalThis),n=globalThis.clearInterval.bind(globalThis);return{setTimeout:e,setInterval:r,clearTimeout:t,clearInterval:n,cleanup:G}},he=()=>{let e=0,r=()=>e++,t=new Map,n=(l,v)=>l?.postMessage(v),o=l=>{t.get(l.data.id)?.()},i=St(Be,{name:"clerk-timers"});if(i?.addEventListener("message",o),!i)return nn();let a=()=>{i||(i=St(Be,{name:"clerk-timers"}),i?.addEventListener("message",o))};return{setTimeout:(l,v)=>{a();let C=r();return t.set(C,l),n(i,{type:"setTimeout",id:C,ms:v}),C},setInterval:(l,v)=>{a();let C=r();return t.set(C,l),n(i,{type:"setInterval",id:C,ms:v}),C},clearTimeout:l=>{a(),t.delete(l),n(i,{type:"clearTimeout",id:l})},clearInterval:l=>{a(),t.delete(l),n(i,{type:"clearInterval",id:l})},cleanup:()=>{i&&(i.terminate(),i=null,t.clear())}}};function on({delayInMs:e}={delayInMs:1e3}){let r=he(),t,n=!1,o=()=>{t&&(r.clearTimeout(t),r.cleanup()),n=!0},i=async a=>{n=!1,await a(o),!n&&(t=r.setTimeout(()=>{i(a)},e))};return{run:i,stop:o}}function an(e){return e?It(e)||Ge(e):!0}function It(e){return/^http(s)?:\/\//.test(e||"")}function Ge(e){return e.startsWith("/")}function sn(e){return e?Ge(e)?new URL(e,window.location.origin).toString():e:""}var un=()=>typeof window<"u";function ln(e=""){return e.startsWith("?")&&(e=e.slice(1)),new URLSearchParams(e)}function cn(e=""){return(e||"").replace(/^.+:\/\//,"")}function dn(e){if(!e)return"";let r;return e?.match(/(clerk\.)+dev$/)?r=/(clerk\.)*(?=clerk\.)/:r=/clerk\./gi,`clerk.${e.replace(r,"")}`}var fn={maxRetries:10,firstDelay:125,timeMultiple:2,shouldRetry:()=>!0},pn=async e=>new Promise(r=>setTimeout(r,e)),mn=e=>{let r=0,t=()=>{let n=e.firstDelay,o=e.timeMultiple;return n*Math.pow(o,r)};return async()=>{await pn(t()),r++}},gn=async(e,r={})=>{let t=0,{maxRetries:n,shouldRetry:o,firstDelay:i,timeMultiple:a}={...fn,...r},u=()=>t===n,f=mn({firstDelay:i,timeMultiple:a});for(;!u();)try{return await e()}catch(s){if(t++,!o(s,t)||u())throw s;await f()}throw new Error("Something went wrong")};var vn=()=>{let e=G,r=G;return{promise:new Promise((n,o)=>{e=n,r=o}),resolve:e,reject:r}};0&&(module.exports={ClerkInstanceContext,ClientContext,LocalStorageBroadcastChannel,OrganizationContext,Poller,SessionContext,UserContext,addClerkPrefix,addYears,assertContextExists,buildErrorThrower,buildPublishableKey,camelToSnake,colorToSameTypeString,createContextAndHook,createCookieHandler,createDeferredPromise,createWorkerTimers,dateTo12HourTime,deepCamelToSnake,deepSnakeToCamel,detectUserAgentRobot,differenceInCalendarDays,extension,formatRelative,hasAlpha,hexStringToRgbaColor,inBrowser,inClientSide,isHSLColor,isHttpOrHttps,isIPV4Address,isLegacyFrontendApiKey,isProxyUrlRelative,isPublishableKey,isRGBColor,isRetinaDisplay,isTransparent,isValidBrowserOnline,isValidHexString,isValidHslaString,isValidProxyUrl,isValidRgbaString,isomorphicAtob,noop,normalizeDate,parsePublishableKey,parseSearchParams,proxyUrlToAbsoluteURL,readJSONFile,runWithExponentialBackOff,snakeToCamel,stringToHslaColor,stringToSameTypeColor,stripScheme,titleize,toSentence,useClerkInstanceContext,useClientContext,useOrganization,useOrganizationContext,useOrganizationList,useOrganizations,useSessionContext,useUserContext});
"use strict";var Mt=Object.create;var ae=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var _t=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var Wt=(e,r)=>{for(var t in r)ae(e,t,{get:r[t],enumerable:!0})},Ze=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of At(r))!Ut.call(e,o)&&o!==t&&ae(e,o,{get:()=>r[o],enumerable:!(n=Dt(r,o))||n.enumerable});return e};var Ft=(e,r,t)=>(t=e!=null?Mt(_t(e)):{},Ze(r||!e||!e.__esModule?ae(t,"default",{value:e,enumerable:!0}):t,e)),Vt=e=>Ze(ae({},"__esModule",{value:!0}),e);var bn={};Wt(bn,{ClerkInstanceContext:()=>Nt,ClientContext:()=>Bt,LocalStorageBroadcastChannel:()=>He,OrganizationContext:()=>Xt,Poller:()=>on,SessionContext:()=>jt,UserContext:()=>Kt,addClerkPrefix:()=>dn,addYears:()=>$r,assertContextExists:()=>Qe,buildErrorThrower:()=>Ht,buildPublishableKey:()=>Kr,camelToSnake:()=>Ke,colorToSameTypeString:()=>yt,createContextAndHook:()=>$,createCookieHandler:()=>Wr,createDeferredPromise:()=>hn,createWorkerTimers:()=>he,dateTo12HourTime:()=>Fr,deepCamelToSnake:()=>en,deepSnakeToCamel:()=>tn,detectUserAgentRobot:()=>bt,differenceInCalendarDays:()=>wt,extension:()=>Jr,formatRelative:()=>Vr,hasAlpha:()=>Sr,hexStringToRgbaColor:()=>xt,inBrowser:()=>ht,inClientSide:()=>un,isHSLColor:()=>Fe,isHttpOrHttps:()=>It,isIPV4Address:()=>Zr,isLegacyFrontendApiKey:()=>Gr,isProxyUrlRelative:()=>Ge,isPublishableKey:()=>Et,isRGBColor:()=>We,isRetinaDisplay:()=>jr,isTransparent:()=>fe,isValidBrowserOnline:()=>Rr,isValidHexString:()=>ne,isValidHslaString:()=>de,isValidProxyUrl:()=>an,isValidRgbaString:()=>ce,isomorphicAtob:()=>ve,noop:()=>G,normalizeDate:()=>ge,parsePublishableKey:()=>Br,parseSearchParams:()=>ln,pathFromFullPath:()=>fn,proxyUrlToAbsoluteURL:()=>sn,readJSONFile:()=>Hr,runWithExponentialBackOff:()=>vn,snakeToCamel:()=>Ne,stringToHslaColor:()=>Lr,stringToSameTypeColor:()=>Pr,stripScheme:()=>cn,titleize:()=>Qr,toSentence:()=>Cr,useClerkInstanceContext:()=>H,useClientContext:()=>Gt,useOrganization:()=>vr,useOrganizationContext:()=>Ee,useOrganizationList:()=>br,useOrganizations:()=>xr,useSessionContext:()=>Oe,useUserContext:()=>we});module.exports=Vt(bn);var $t=Object.freeze({InvalidFrontendApiErrorMessage:"The frontendApi passed to Clerk is invalid. You can get your Frontend API key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.dev/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.dev/last-active?path=api-keys."});function Ht({packageName:e,customMessages:r}){let t=e,n={...$t,...r};function o(i,a){if(!a)return`${t}: ${i}`;let u=i,f=i.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(let s of f){let c=(a[s[1]]||"").toString();u=u.replace(`{{${s[1]}}}`,c)}return`${t}: ${u}`}return{setPackageName({packageName:i}){return typeof i=="string"&&(t=i),this},setMessages({customMessages:i}){return Object.assign(n,i||{}),this},throwInvalidPublishableKeyError(i){throw new Error(o(n.InvalidPublishableKeyErrorMessage,i))},throwInvalidFrontendApiError(i){throw new Error(o(n.InvalidFrontendApiErrorMessage,i))},throwInvalidProxyUrl(i){throw new Error(o(n.InvalidProxyUrlErrorMessage,i))},throwMissingPublishableKeyError(){throw new Error(o(n.MissingPublishableKeyErrorMessage))}}}var se=Ft(require("react"));function Qe(e,r){if(!e)throw typeof r=="string"?new Error(r):new Error(`${r.displayName} not found`)}var $=(e,r)=>{let{assertCtxFn:t=Qe}=r||{},n=se.default.createContext(void 0);return n.displayName=e,[n,()=>{let a=se.default.useContext(n);return t(a,`${e} not found`),a.value},()=>{let a=se.default.useContext(n);return a?a.value:{}}]};var[Nt,H]=$("ClerkInstanceContext"),[Kt,we]=$("UserContext"),[Bt,Gt]=$("ClientContext"),[jt,Oe]=$("SessionContext"),[Xt,Ee]=$("OrganizationContext");var p=require("react");function nt(e,r,t,n){function o(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function u(c){try{s(n.next(c))}catch(m){a(m)}}function f(c){try{s(n.throw(c))}catch(m){a(m)}}function s(c){c.done?i(c.value):o(c.value).then(u,f)}s((n=n.apply(e,r||[])).next())})}function it(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(s){return function(c){return f([s,c])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,o=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1],i=s;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(s);break}i[2]&&t.ops.pop(),t.trys.pop();continue}s=r.call(e,t)}catch(c){s=[6,c],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var z=function(){},b=z(),Q=Object,x=function(e){return e===b},_=function(e){return typeof e=="function"},M=function(e,r){return Q.assign({},e,r)},De="undefined",Ae=function(){return typeof window!=De},Yt=function(){return typeof document!=De},Jt=function(){return Ae()&&typeof window.requestAnimationFrame!=De},ue=new WeakMap,qt=0,re=function(e){var r=typeof e,t=e&&e.constructor,n=t==Date,o,i;if(Q(e)===e&&!n&&t!=RegExp){if(o=ue.get(e),o)return o;if(o=++qt+"~",ue.set(e,o),t==Array){for(o="@",i=0;i<e.length;i++)o+=re(e[i])+",";ue.set(e,o)}if(t==Q){o="#";for(var a=Q.keys(e).sort();!x(i=a.pop());)x(e[i])||(o+=i+":"+re(e[i])+",");ue.set(e,o)}}else o=n?e.toJSON():r=="symbol"?e.toString():r=="string"?JSON.stringify(e):""+e;return o},Ie=!0,Zt=function(){return Ie},ot=Ae(),_e=Yt(),ze=ot&&window.addEventListener?window.addEventListener.bind(window):z,Qt=_e?document.addEventListener.bind(document):z,Le=ot&&window.removeEventListener?window.removeEventListener.bind(window):z,er=_e?document.removeEventListener.bind(document):z,tr=function(){var e=_e&&document.visibilityState;return x(e)||e!=="hidden"},rr=function(e){return Qt("visibilitychange",e),ze("focus",e),function(){er("visibilitychange",e),Le("focus",e)}},nr=function(e){var r=function(){Ie=!0,e()},t=function(){Ie=!1};return ze("online",r),ze("offline",t),function(){Le("online",r),Le("offline",t)}},ir={isOnline:Zt,isVisible:tr},or={initFocus:rr,initReconnect:nr},le=!Ae()||"Deno"in window,ar=function(e){return Jt()?window.requestAnimationFrame(e):setTimeout(e,1)},ee=le?p.useEffect:p.useLayoutEffect,ke=typeof navigator<"u"&&navigator.connection,et=!le&&ke&&(["slow-2g","2g"].includes(ke.effectiveType)||ke.saveData),at=function(e){if(_(e))try{e=e()}catch{e=""}var r=[].concat(e);e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?re(e):"";var t=e?"$swr$"+e:"";return[e,r,t]},N=new WeakMap,st=0,ut=1,lt=2,te=function(e,r,t,n,o,i,a){a===void 0&&(a=!0);var u=N.get(e),f=u[0],s=u[1],c=u[3],m=f[r],l=s[r];if(a&&l)for(var v=0;v<l.length;++v)l[v](t,n,o);return i&&(delete c[r],m&&m[0])?m[0](lt).then(function(){return e.get(r)}):e.get(r)},sr=0,Pe=function(){return++sr},ct=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return nt(void 0,void 0,void 0,function(){var t,n,o,i,a,u,f,s,c,m,l,v,C,R,g,d,j,U,L,k,W;return it(this,function(D){switch(D.label){case 0:if(t=e[0],n=e[1],o=e[2],i=e[3],a=typeof i=="boolean"?{revalidate:i}:i||{},u=x(a.populateCache)?!0:a.populateCache,f=a.revalidate!==!1,s=a.rollbackOnError!==!1,c=a.optimisticData,m=at(n),l=m[0],v=m[2],!l)return[2];if(C=N.get(t),R=C[2],e.length<3)return[2,te(t,l,t.get(l),b,b,f,!0)];if(g=o,j=Pe(),R[l]=[j,0],U=!x(c),L=t.get(l),U&&(k=_(c)?c(L):c,t.set(l,k),te(t,l,k)),_(g))try{g=g(t.get(l))}catch(F){d=F}return g&&_(g.then)?[4,g.catch(function(F){d=F})]:[3,2];case 1:if(g=D.sent(),j!==R[l][0]){if(d)throw d;return[2,g]}else d&&U&&s&&(u=!0,g=L,t.set(l,L));D.label=2;case 2:return u&&(d||(_(u)&&(g=u(g,L)),t.set(l,g)),t.set(v,M(t.get(v),{error:d}))),R[l][1]=Pe(),[4,te(t,l,g,d,b,f,!!u)];case 3:if(W=D.sent(),d)throw d;return[2,u?W:g]}})})},tt=function(e,r){for(var t in e)e[t][0]&&e[t][0](r)},dt=function(e,r){if(!N.has(e)){var t=M(or,r),n={},o=ct.bind(b,e),i=z;if(N.set(e,[n,{},{},{},o]),!le){var a=t.initFocus(setTimeout.bind(b,tt.bind(b,n,st))),u=t.initReconnect(setTimeout.bind(b,tt.bind(b,n,ut)));i=function(){a&&a(),u&&u(),N.delete(e)}}return[e,o,i]}return[e,N.get(e)[4]]},ur=function(e,r,t,n,o){var i=t.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*t.errorRetryInterval;!x(i)&&a>i||setTimeout(n,u,o)},ft=dt(new Map),pt=ft[0],lr=ft[1],mt=M({onLoadingSlow:z,onSuccess:z,onError:z,onErrorRetry:ur,onDiscarded:z,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:et?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:et?5e3:3e3,compare:function(e,r){return re(e)==re(r)},isPaused:function(){return!1},cache:pt,mutate:lr,fallback:{}},ir),gt=function(e,r){var t=M(e,r);if(r){var n=e.use,o=e.fallback,i=r.use,a=r.fallback;n&&i&&(t.use=n.concat(i)),o&&a&&(t.fallback=M(o,a))}return t},Me=(0,p.createContext)({}),cr=function(e){var r=e.value,t=gt((0,p.useContext)(Me),r),n=r&&r.provider,o=(0,p.useState)(function(){return n?dt(n(t.cache||pt),r):b})[0];return o&&(t.cache=o[0],t.mutate=o[1]),ee(function(){return o?o[2]:b},[]),(0,p.createElement)(Me.Provider,M(e,{value:t}))},dr=function(e,r){var t=(0,p.useState)({})[1],n=(0,p.useRef)(e),o=(0,p.useRef)({data:!1,error:!1,isValidating:!1}),i=(0,p.useCallback)(function(a){var u=!1,f=n.current;for(var s in a){var c=s;f[c]!==a[c]&&(f[c]=a[c],o.current[c]&&(u=!0))}u&&!r.current&&t({})},[]);return ee(function(){n.current=e}),[n,o.current,i]},fr=function(e){return _(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}]},pr=function(){return M(mt,(0,p.useContext)(Me))},mr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=pr(),i=fr(t),a=i[0],u=i[1],f=i[2],s=gt(o,f),c=e,m=s.use;if(m)for(var l=m.length;l-- >0;)c=m[l](c);return c(a,u||s.fetcher,s)}},rt=function(e,r,t){var n=r[e]||(r[e]=[]);return n.push(t),function(){var o=n.indexOf(t);o>=0&&(n[o]=n[n.length-1],n.pop())}},Se={dedupe:!0},gr=function(e,r,t){var n=t.cache,o=t.compare,i=t.fallbackData,a=t.suspense,u=t.revalidateOnMount,f=t.refreshInterval,s=t.refreshWhenHidden,c=t.refreshWhenOffline,m=N.get(n),l=m[0],v=m[1],C=m[2],R=m[3],g=at(e),d=g[0],j=g[1],U=g[2],L=(0,p.useRef)(!1),k=(0,p.useRef)(!1),W=(0,p.useRef)(d),D=(0,p.useRef)(r),F=(0,p.useRef)(t),h=function(){return F.current},be=function(){return h().isVisible()&&h().isOnline()},ie=function(O){return n.set(U,M(n.get(U),O))},je=n.get(d),zt=x(i)?t.fallback[d]:i,P=x(je)?zt:je,Xe=n.get(U)||{},X=Xe.error,Ye=!L.current,Je=function(){return Ye&&!x(u)?u:h().isPaused()?!1:a?x(P)?!1:t.revalidateIfStale:x(P)||t.revalidateIfStale},Lt=function(){return!d||!r?!1:Xe.isValidating?!0:Ye&&Je()},ye=Lt(),xe=dr({data:P,error:X,isValidating:ye},k),K=xe[0],Ce=xe[1],oe=xe[2],V=(0,p.useCallback)(function(O){return nt(void 0,void 0,void 0,function(){var T,w,E,Y,J,S,y,A,I,Re,q,B,Te;return it(this,function(Z){switch(Z.label){case 0:if(T=D.current,!d||!T||k.current||h().isPaused())return[2,!1];Y=!0,J=O||{},S=!R[d]||!J.dedupe,y=function(){return!k.current&&d===W.current&&L.current},A=function(){var qe=R[d];qe&&qe[1]===E&&delete R[d]},I={isValidating:!1},Re=function(){ie({isValidating:!1}),y()&&oe(I)},ie({isValidating:!0}),oe({isValidating:!0}),Z.label=1;case 1:return Z.trys.push([1,3,,4]),S&&(te(n,d,K.current.data,K.current.error,!0),t.loadingTimeout&&!n.get(d)&&setTimeout(function(){Y&&y()&&h().onLoadingSlow(d,t)},t.loadingTimeout),R[d]=[T.apply(void 0,j),Pe()]),Te=R[d],w=Te[0],E=Te[1],[4,w];case 2:return w=Z.sent(),S&&setTimeout(A,t.dedupingInterval),!R[d]||R[d][1]!==E?(S&&y()&&h().onDiscarded(d),[2,!1]):(ie({error:b}),I.error=b,q=C[d],!x(q)&&(E<=q[0]||E<=q[1]||q[1]===0)?(Re(),S&&y()&&h().onDiscarded(d),[2,!1]):(o(K.current.data,w)?I.data=K.current.data:I.data=w,o(n.get(d),w)||n.set(d,w),S&&y()&&h().onSuccess(w,d,t),[3,4]));case 3:return B=Z.sent(),A(),h().isPaused()||(ie({error:B}),I.error=B,S&&y()&&(h().onError(B,d,t),(typeof t.shouldRetryOnError=="boolean"&&t.shouldRetryOnError||_(t.shouldRetryOnError)&&t.shouldRetryOnError(B))&&be()&&h().onErrorRetry(B,d,t,V,{retryCount:(J.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return Y=!1,Re(),y()&&S&&te(n,d,I.data,I.error,!1),[2,!0]}})})},[d]),Pt=(0,p.useCallback)(ct.bind(b,n,function(){return W.current}),[]);if(ee(function(){D.current=r,F.current=t}),ee(function(){if(!!d){var O=d!==W.current,T=V.bind(b,Se),w=function(y,A,I){oe(M({error:A,isValidating:I},o(K.current.data,y)?b:{data:y}))},E=0,Y=function(y){if(y==st){var A=Date.now();h().revalidateOnFocus&&A>E&&be()&&(E=A+h().focusThrottleInterval,T())}else if(y==ut)h().revalidateOnReconnect&&be()&&T();else if(y==lt)return V()},J=rt(d,v,w),S=rt(d,l,Y);return k.current=!1,W.current=d,L.current=!0,O&&oe({data:P,error:X,isValidating:ye}),Je()&&(x(P)||le?T():ar(T)),function(){k.current=!0,J(),S()}}},[d,V]),ee(function(){var O;function T(){var E=_(f)?f(P):f;E&&O!==-1&&(O=setTimeout(w,E))}function w(){!K.current.error&&(s||h().isVisible())&&(c||h().isOnline())?V(Se).then(T):T()}return T(),function(){O&&(clearTimeout(O),O=-1)}},[f,s,c,V]),(0,p.useDebugValue)(P),a&&x(P)&&d)throw D.current=r,F.current=t,k.current=!1,x(X)?V(Se):X;return{mutate:Pt,get data(){return Ce.data=!0,P},get error(){return Ce.error=!0,X},get isValidating(){return Ce.isValidating=!0,ye}}},En=Q.defineProperty(cr,"default",{value:mt});var Ue=mr(gr);var vr=e=>{let{invitationList:r,membershipList:t}=e||{},{organization:n,lastOrganizationMember:o,lastOrganizationInvitation:i}=Ee(),a=Oe(),u=H(),f=u.loaded&&a&&n,s=u.loaded?()=>u.organization?.getPendingInvitations(r):()=>[],c=u.loaded?()=>u.organization?.getMemberships(t):()=>[],{data:m,isValidating:l,mutate:v}=Ue(f&&r?vt("invites",n,i,r):null,s),{data:C,isValidating:R,mutate:g}=Ue(f&&t?vt("memberships",n,o,t):null,c);return n===void 0?{isLoaded:!1,organization:void 0,invitationList:void 0,membershipList:void 0,membership:void 0}:n===null?{isLoaded:!0,organization:null,invitationList:null,membershipList:null,membership:null}:!u.loaded&&n?{isLoaded:!0,organization:n,invitationList:void 0,membershipList:void 0,membership:void 0}:{isLoaded:!R&&!l,organization:n,membershipList:C,membership:hr(a.user.organizationMemberships,n.id),invitationList:m,unstable__mutate:()=>{g(),v()}}};function hr(e,r){return e.find(t=>t.organization.id===r)}function vt(e,r,t,n){return[e,r.id,t?.id,t?.updatedAt,n.offset,n.limit].filter(Boolean).join("-")}var br=()=>{let e=H(),r=we();return!e.loaded||!r?{isLoaded:!1,organizationList:void 0,createOrganization:void 0,setActive:void 0}:{isLoaded:!0,organizationList:yr(r.organizationMemberships),setActive:e.setActive,createOrganization:e.createOrganization}};function yr(e){return e.map(r=>({membership:r,organization:r.organization}))}var xr=()=>{let e=H();return e.loaded?{isLoaded:!0,createOrganization:e.createOrganization,getOrganizationMemberships:e.getOrganizationMemberships,getOrganization:e.getOrganization}:{isLoaded:!1,createOrganization:void 0,getOrganizationMemberships:void 0,getOrganization:void 0}};var Cr=e=>{if(e.length==0)return"";if(e.length==1)return e[0];let r=e.slice(0,-1).join(", ");return r+=`, or ${e.slice(-1)}`,r};function ht(){return typeof window<"u"}function bt(e){return new RegExp([/bot/,/spider/,/crawl/,/APIs-Google/,/AdsBot/,/Googlebot/,/mediapartners/,/Google Favicon/,/FeedFetcher/,/Google-Read-Aloud/,/DuplexWeb-Google/,/googleweblight/,/bing/,/yandex/,/baidu/,/duckduck/,/yahoo/,/ecosia/,/ia_archiver/,/facebook/,/instagram/,/pinterest/,/reddit/,/slack/,/twitter/,/whatsapp/,/youtube/,/semrush/].map(t=>t.source).join("|"),"i").test(e)}function Rr(){let e=window?.navigator;if(!ht()||!e)return!1;let r=bt(e?.userAgent),t=e?.webdriver,n=e?.onLine,o=e?.connection?.rtt!==0&&e?.connection?.downlink!==0;return!r&&!t&&o&&n}var Tr=/^#?([A-F0-9]{6}|[A-F0-9]{3})$/i,wr=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/i,Or=/^rgba\((\d+),\s*(\d+),\s*(\d+)(,\s*\d+(\.\d+)?)\)$/i,Er=/^hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)$/i,kr=/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%(,\s*\d+(\.\d+)?)*\)$/i,ne=e=>!!e.match(Tr),ce=e=>!!(e.match(wr)||e.match(Or)),de=e=>!!e.match(Er)||!!e.match(kr),We=e=>typeof e!="string"&&"r"in e,Fe=e=>typeof e!="string"&&"h"in e,fe=e=>e==="transparent",Sr=e=>typeof e!="string"&&e.a!=null&&e.a<1;var Ir=/[hsla()]/g,zr=/[rgba()]/g,Lr=e=>e==="transparent"?{h:0,s:0,l:0,a:0}:ne(e)?Ar(e):de(e)?Tt(e):ce(e)?Ct(e):null,Pr=e=>(e=e.trim(),ne(e)?e.startsWith("#")?e:`#${e}`:ce(e)?Rt(e):de(e)?Tt(e):fe(e)?e:""),yt=e=>typeof e=="string"&&(ne(e)||fe(e))?e:We(e)?Mr(e):Fe(e)?Dr(e):"",xt=e=>{e=e.replace("#","");let r=parseInt(e.substring(0,2),16),t=parseInt(e.substring(2,4),16),n=parseInt(e.substring(4,6),16);return{r,g:t,b:n}},Mr=e=>{let{a:r,b:t,g:n,r:o}=e;return e.a===0?"transparent":e.a!=null?`rgba(${o},${n},${t},${r})`:`rgb(${o},${n},${t})`},Dr=e=>{let{h:r,s:t,l:n,a:o}=e,i=Math.round(t*100),a=Math.round(n*100);return e.a===0?"transparent":e.a!=null?`hsla(${r},${i}%,${a}%,${o})`:`hsl(${r},${i}%,${a}%)`},Ar=e=>{let r=yt(xt(e));return Ct(r)},Ct=e=>{let r=Rt(e),t=r.r/255,n=r.g/255,o=r.b/255,i=Math.max(t,n,o),a=Math.min(t,n,o),u,f,s=(i+a)/2;if(i==a)u=f=0;else{let l=i-a;switch(f=s>=.5?l/(2-(i+a)):l/(i+a),i){case t:u=(n-o)/l*60;break;case n:u=((o-t)/l+2)*60;break;default:u=((t-n)/l+4)*60;break}}let c={h:Math.round(u),s:f,l:s},m=r.a;return m!=null&&(c.a=m),c},Rt=e=>{let[r,t,n,o]=e.replace(zr,"").split(",").map(i=>Number.parseFloat(i));return{r,g:t,b:n,a:o}},Tt=e=>{let[r,t,n,o]=e.replace(Ir,"").split(",").map(i=>Number.parseFloat(i));return{h:r,s:t/100,l:n/100,a:o}};function pe(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)e[n]=t[n]}return e}var _r={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ve(e,r){function t(o,i,a){if(!(typeof document>"u")){a=pe({},r,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var f in a)!a[f]||(u+="; "+f,a[f]!==!0&&(u+="="+a[f].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+u}}function n(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},u=0;u<i.length;u++){var f=i[u].split("="),s=f.slice(1).join("=");try{var c=decodeURIComponent(f[0]);if(a[c]=e.read(s,c),o===c)break}catch{}}return o?a[o]:a}}return Object.create({set:t,get:n,remove:function(o,i){t(o,"",pe({},i,{expires:-1}))},withAttributes:function(o){return Ve(this.converter,pe({},this.attributes,o))},withConverter:function(o){return Ve(pe({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(e)}})}var Ur=Ve(_r,{path:"/"}),me=Ur;function Wr(e){return{get(){return me.get(e)},set(r,t={}){return me.set(e,r,t)},remove(r){me.remove(e,r)}}}function Fr(e){return e?e.toLocaleString("en-US",{hour:"2-digit",minute:"numeric",hour12:!0}):""}function wt(e,r,{absolute:t=!0}={}){if(!e||!r)return 0;let n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),o=Date.UTC(r.getFullYear(),r.getMonth(),r.getDate()),i=Math.floor((o-n)/864e5);return t?Math.abs(i):i}function ge(e){try{return new Date(e||new Date)}catch{return new Date}}function Vr(e){let{date:r,relativeTo:t}=e;if(!r||!t)return null;let n=ge(r),o=ge(t),i=wt(o,n,{absolute:!1});return i<-6?{relativeDateCase:"other",date:n}:i<-1?{relativeDateCase:"previous6Days",date:n}:i===-1?{relativeDateCase:"lastDay",date:n}:i===0?{relativeDateCase:"sameDay",date:n}:i===1?{relativeDateCase:"nextDay",date:n}:i<7?{relativeDateCase:"next6Days",date:n}:{relativeDateCase:"other",date:n}}function $r(e,r){let t=ge(e);return t.setFullYear(t.getFullYear()+r),t}function Hr(e){return new Promise((r,t)=>{let n=new FileReader;n.addEventListener("load",function(){let o=JSON.parse(n.result);r(o)}),n.addEventListener("error",t),n.readAsText(e)})}var ve=e=>typeof atob<"u"&&typeof atob=="function"?atob(e):typeof global<"u"&&global.Buffer?new global.Buffer(e,"base64").toString():e;var $e="pk_live_",Ot="pk_test_",Nr=/^(([a-z]+)-){2}([0-9]{1,2})\.clerk\.accounts([a-z.]*)(dev|com)$/i;function Kr(e){return`${Nr.test(e)?Ot:$e}${btoa(`${e}$`)}`}function Br(e){if(e=e||"",!Et(e))return null;let r=e.startsWith($e)?"production":"development",t=ve(e.split("_")[2]);return t.endsWith("$")?(t=t.slice(0,-1),{instanceType:r,frontendApi:t}):null}function Et(e){e=e||"";let r=e.startsWith($e)||e.startsWith(Ot),t=ve(e.split("_")[2]||"").endsWith("$");return r&&t}function Gr(e){return e=e||"",e.startsWith("clerk.")}function jr(){if(!window.matchMedia)return!1;let e=window.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)");return e&&e.matches||window.devicePixelRatio>1}var Xr="__lsbc__",He=class{constructor(r){this.eventTarget=window;this.postMessage=r=>{try{localStorage.setItem(this.channelKey,JSON.stringify(r)),localStorage.removeItem(this.channelKey)}catch{}};this.addEventListener=(r,t)=>{this.eventTarget.addEventListener(this.prefixEventName(r),n=>{t(n)})};this.setupLocalStorageListener=()=>{let r=t=>{if(!(t.key!==this.channelKey||!t.newValue))try{let n=JSON.parse(t.newValue||""),o=new MessageEvent(this.prefixEventName("message"),{data:n});this.eventTarget.dispatchEvent(o)}catch{}};window.addEventListener("storage",r)};this.channelKey=Xr+r,this.setupLocalStorageListener()}prefixEventName(r){return this.channelKey+r}};var Yr=Object.freeze({"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/x-icon":"ico","image/vnd.microsoft.icon":"ico"}),Jr=e=>Yr[e];var G=(...e)=>{};var qr=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;function Zr(e){return qr.test(e||"")}function Qr(e){let r=e||"";return r.charAt(0).toUpperCase()+r.slice(1)}function Ne(e){return e?e.replace(/([-_][a-z])/g,r=>r.toUpperCase().replace(/-|_/,"")):""}function Ke(e){return e?e.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`):""}var kt=e=>{let r=t=>{if(!t)return t;if(Array.isArray(t))return t.map(i=>typeof i=="object"||Array.isArray(i)?r(i):i);let n={...t},o=Object.keys(n);for(let i of o){let a=e(i.toString());a!==i&&(n[a]=n[i],delete n[i]),typeof n[a]=="object"&&(n[a]=r(n[a]))}return n};return r},en=kt(Ke),tn=kt(Ne);var Be=`const respond=r=>{self.postMessage(r)},workerToTabIds={};self.addEventListener("message",r=>{const e=r.data;switch(e.type){case"setTimeout":workerToTabIds[e.id]=setTimeout(()=>{respond({id:e.id})},e.ms);break;case"clearTimeout":workerToTabIds[e.id]&&(clearTimeout(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break;case"setInterval":workerToTabIds[e.id]=setInterval(()=>{respond({id:e.id})},e.ms);break;case"clearInterval":workerToTabIds[e.id]&&(clearInterval(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break}});
`;var St=(e,r={})=>{if(typeof Worker>"u")return null;try{let t=new Blob([e],{type:"application/javascript; charset=utf-8"}),n=globalThis.URL.createObjectURL(t);return new Worker(n,r)}catch{return console.warn("Clerk: Cannot create worker from blob. Consider adding worker-src blob:; to your CSP"),null}},nn=()=>{let e=globalThis.setTimeout.bind(globalThis),r=globalThis.setInterval.bind(globalThis),t=globalThis.clearTimeout.bind(globalThis),n=globalThis.clearInterval.bind(globalThis);return{setTimeout:e,setInterval:r,clearTimeout:t,clearInterval:n,cleanup:G}},he=()=>{let e=0,r=()=>e++,t=new Map,n=(l,v)=>l?.postMessage(v),o=l=>{t.get(l.data.id)?.()},i=St(Be,{name:"clerk-timers"});if(i?.addEventListener("message",o),!i)return nn();let a=()=>{i||(i=St(Be,{name:"clerk-timers"}),i?.addEventListener("message",o))};return{setTimeout:(l,v)=>{a();let C=r();return t.set(C,l),n(i,{type:"setTimeout",id:C,ms:v}),C},setInterval:(l,v)=>{a();let C=r();return t.set(C,l),n(i,{type:"setInterval",id:C,ms:v}),C},clearTimeout:l=>{a(),t.delete(l),n(i,{type:"clearTimeout",id:l})},clearInterval:l=>{a(),t.delete(l),n(i,{type:"clearInterval",id:l})},cleanup:()=>{i&&(i.terminate(),i=null,t.clear())}}};function on({delayInMs:e}={delayInMs:1e3}){let r=he(),t,n=!1,o=()=>{t&&(r.clearTimeout(t),r.cleanup()),n=!0},i=async a=>{n=!1,await a(o),!n&&(t=r.setTimeout(()=>{i(a)},e))};return{run:i,stop:o}}function an(e){return e?It(e)||Ge(e):!0}function It(e){return/^http(s)?:\/\//.test(e||"")}function Ge(e){return e.startsWith("/")}function sn(e){return e?Ge(e)?new URL(e,window.location.origin).toString():e:""}var un=()=>typeof window<"u";function ln(e=""){return e.startsWith("?")&&(e=e.slice(1)),new URLSearchParams(e)}function cn(e=""){return(e||"").replace(/^.+:\/\//,"")}function dn(e){if(!e)return"";let r;if(e.match(/^(clerk\.)+\w*$/))r=/(clerk\.)*(?=clerk\.)/;else{if(e.match(/\.clerk.accounts/))return e;r=/^(clerk\.)*/gi}return`clerk.${e.replace(r,"")}`}var fn=e=>e.replace(/CLERK-ROUTER\/(.*?)\//,"");var pn={maxRetries:10,firstDelay:125,timeMultiple:2,shouldRetry:()=>!0},mn=async e=>new Promise(r=>setTimeout(r,e)),gn=e=>{let r=0,t=()=>{let n=e.firstDelay,o=e.timeMultiple;return n*Math.pow(o,r)};return async()=>{await mn(t()),r++}},vn=async(e,r={})=>{let t=0,{maxRetries:n,shouldRetry:o,firstDelay:i,timeMultiple:a}={...pn,...r},u=()=>t===n,f=gn({firstDelay:i,timeMultiple:a});for(;!u();)try{return await e()}catch(s){if(t++,!o(s,t)||u())throw s;await f()}throw new Error("Something went wrong")};var hn=()=>{let e=G,r=G;return{promise:new Promise((n,o)=>{e=n,r=o}),resolve:e,reject:r}};0&&(module.exports={ClerkInstanceContext,ClientContext,LocalStorageBroadcastChannel,OrganizationContext,Poller,SessionContext,UserContext,addClerkPrefix,addYears,assertContextExists,buildErrorThrower,buildPublishableKey,camelToSnake,colorToSameTypeString,createContextAndHook,createCookieHandler,createDeferredPromise,createWorkerTimers,dateTo12HourTime,deepCamelToSnake,deepSnakeToCamel,detectUserAgentRobot,differenceInCalendarDays,extension,formatRelative,hasAlpha,hexStringToRgbaColor,inBrowser,inClientSide,isHSLColor,isHttpOrHttps,isIPV4Address,isLegacyFrontendApiKey,isProxyUrlRelative,isPublishableKey,isRGBColor,isRetinaDisplay,isTransparent,isValidBrowserOnline,isValidHexString,isValidHslaString,isValidProxyUrl,isValidRgbaString,isomorphicAtob,noop,normalizeDate,parsePublishableKey,parseSearchParams,pathFromFullPath,proxyUrlToAbsoluteURL,readJSONFile,runWithExponentialBackOff,snakeToCamel,stringToHslaColor,stringToSameTypeColor,stripScheme,titleize,toSentence,useClerkInstanceContext,useClientContext,useOrganization,useOrganizationContext,useOrganizationList,useOrganizations,useSessionContext,useUserContext});
/*! *****************************************************************************

@@ -4,0 +4,0 @@ Copyright (c) Microsoft Corporation.

@@ -1,3 +0,3 @@

"use strict";var S=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of D(t))!I.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(i=E(t,n))||i.enumerable});return e},l=(e,t,r)=>(d(e,t,"default"),r&&d(r,t,"default")),_=(e,t,r)=>(r=e!=null?S(P(e)):{},d(t||!e||!e.__esModule?f(r,"default",{value:e,enumerable:!0}):r,e)),L=e=>d(f({},"__esModule",{value:!0}),e);var g={};y(g,{noop:()=>u,render:()=>w,userEvent:()=>h.default});module.exports=L(g);var a={};y(a,{noop:()=>u,render:()=>w,userEvent:()=>h.default});var qe=require("@testing-library/jest-dom/extend-expect"),R=require("@testing-library/react");function m(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)e[i]=r[i]}return e}var A={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function b(e,t){function r(n,s,o){if(!(typeof document>"u")){o=m({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var p in o)!o[p]||(c+="; "+p,o[p]!==!0&&(c+="="+o[p].split(";")[0]));return document.cookie=n+"="+e.write(s,n)+c}}function i(n){if(!(typeof document>"u"||arguments.length&&!n)){for(var s=document.cookie?document.cookie.split("; "):[],o={},c=0;c<s.length;c++){var p=s[c].split("="),k=p.slice(1).join("=");try{var x=decodeURIComponent(p[0]);if(o[x]=e.read(k,x),n===x)break}catch{}}return n?o[n]:o}}return Object.create({set:r,get:i,remove:function(n,s){r(n,"",m({},s,{expires:-1}))},withAttributes:function(n){return b(this.converter,m({},this.attributes,n))},withConverter:function(n){return b(m({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Z=b(A,{path:"/"});var pe=Object.freeze({"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/x-icon":"ico","image/vnd.microsoft.icon":"ico"});var u=(...e)=>{};function C(e){return e?e.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace(/-|_/,"")):""}function T(e){return e?e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`):""}var v=e=>{let t=r=>{if(!r)return r;if(Array.isArray(r))return r.map(s=>typeof s=="object"||Array.isArray(s)?t(s):s);let i={...r},n=Object.keys(i);for(let s of n){let o=e(s.toString());o!==s&&(i[o]=i[s],delete i[s]),typeof i[o]=="object"&&(i[o]=t(i[o]))}return i};return t},ge=v(T),xe=v(C);l(a,require("@testing-library/react"));var h=_(require("@testing-library/user-event")),w=(e,t)=>(0,R.render)(e,t);l(g,a,module.exports);0&&(module.exports={noop,render,userEvent});
"use strict";var E=Object.create;var f=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of D(t))!I.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(i=S(t,n))||i.enumerable});return e},l=(e,t,r)=>(d(e,t,"default"),r&&d(r,t,"default")),_=(e,t,r)=>(r=e!=null?E(P(e)):{},d(t||!e||!e.__esModule?f(r,"default",{value:e,enumerable:!0}):r,e)),L=e=>d(f({},"__esModule",{value:!0}),e);var g={};y(g,{noop:()=>u,render:()=>w,userEvent:()=>h.default});module.exports=L(g);var a={};y(a,{noop:()=>u,render:()=>w,userEvent:()=>h.default});var qe=require("@testing-library/jest-dom/extend-expect"),R=require("@testing-library/react");function m(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)e[i]=r[i]}return e}var A={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function b(e,t){function r(n,s,o){if(!(typeof document>"u")){o=m({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var p in o)!o[p]||(c+="; "+p,o[p]!==!0&&(c+="="+o[p].split(";")[0]));return document.cookie=n+"="+e.write(s,n)+c}}function i(n){if(!(typeof document>"u"||arguments.length&&!n)){for(var s=document.cookie?document.cookie.split("; "):[],o={},c=0;c<s.length;c++){var p=s[c].split("="),k=p.slice(1).join("=");try{var x=decodeURIComponent(p[0]);if(o[x]=e.read(k,x),n===x)break}catch{}}return n?o[n]:o}}return Object.create({set:r,get:i,remove:function(n,s){r(n,"",m({},s,{expires:-1}))},withAttributes:function(n){return b(this.converter,m({},this.attributes,n))},withConverter:function(n){return b(m({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Z=b(A,{path:"/"});var pe=Object.freeze({"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/x-icon":"ico","image/vnd.microsoft.icon":"ico"});var u=(...e)=>{};function C(e){return e?e.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace(/-|_/,"")):""}function T(e){return e?e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`):""}var v=e=>{let t=r=>{if(!r)return r;if(Array.isArray(r))return r.map(s=>typeof s=="object"||Array.isArray(s)?t(s):s);let i={...r},n=Object.keys(i);for(let s of n){let o=e(s.toString());o!==s&&(i[o]=i[s],delete i[s]),typeof i[o]=="object"&&(i[o]=t(i[o]))}return i};return t},ge=v(T),xe=v(C);l(a,require("@testing-library/react"));var h=_(require("@testing-library/user-event")),w=(e,t)=>(0,R.render)(e,t);l(g,a,module.exports);0&&(module.exports={noop,render,userEvent});
/*! js-cookie v3.0.1 | MIT */
//# sourceMappingURL=index.js.map
export declare function parseSearchParams(queryString?: string): URLSearchParams;
export declare function stripScheme(url?: string): string;
export declare function addClerkPrefix(str: string | undefined): string;
export declare const pathFromFullPath: (fullPath: string) => string;
//# sourceMappingURL=url.d.ts.map
{
"name": "@clerk/shared",
"version": "0.13.0-staging.0",
"version": "0.13.0",
"description": "Internal package utils used by the Clerk SDKs",

@@ -21,3 +21,3 @@ "types": "./dist/types/index.d.ts",

"devDependencies": {
"@clerk/types": "^3.30.0-staging.0",
"@clerk/types": "^3.30.0",
"@testing-library/dom": "8.19.0",

@@ -43,3 +43,3 @@ "@testing-library/jest-dom": "5.16.5",

"license": "ISC",
"gitHead": "7a557bd59e4e326c202cbe60b64f8b5c12bf8b2c",
"gitHead": "c60ae469dced00320272958d12e0854bee8a7f56",
"publishConfig": {

@@ -46,0 +46,0 @@ "access": "public"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc