(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6819],{95178:function(e,t,r){"use strict";var n=r(26669);r.o(n,"redirect")&&r.d(t,{redirect:function(){return n.redirect}}),r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},91934:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(77493)},77493:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var l=[],u=!1,c=-1;function d(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=a(d);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new p(e,t)),1!==l.length||u||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=f,i.addListener=f,i.once=f,i.off=f,i.removeListener=f,i.removeAllListeners=f,i.emit=f,i.prependListener=f,i.prependOnceListener=f,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},s=!0;try{t[e](o,o.exports,n),s=!1}finally{s&&delete r[e]}return o.exports}n.ab="//";var i=n(229);e.exports=i}()},4369:function(e,t,r){"use strict";var n=r(72920),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,s=n.useEffect,a=n.useLayoutEffect,l=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=o({inst:{value:r,getSnapshot:t}}),i=n[0].inst,c=n[1];return a(function(){i.value=r,i.getSnapshot=t,u(i)&&c({inst:i})},[e,r,t]),s(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},57498:function(e,t,r){"use strict";e.exports=r(4369)},14555:function(e,t,r){"use strict";r.d(t,{Vo:function(){return E},vn:function(){return en},a7:function(){return Q},qI:function(){return X},iz:function(){return j},gM:function(){return er},yB:function(){return et},N1:function(){return H},C2:function(){return Z},sO:function(){return ee},iv:function(){return P},wE:function(){return w},Gl:function(){return N},oG:function(){return x},E7:function(){return A},RM:function(){return f},RE:function(){return W},YJ:function(){return S},tF:function(){return _},KQ:function(){return z},Gv:function(){return V},Rl:function(){return I},ej:function(){return R},JM:function(){return g},qq:function(){return M},aC:function(){return q},cL:function(){return h.cL},E2:function(){return G},o8:function(){return h.o8},eW:function(){return h.eW},kP:function(){return h.kP},xo:function(){return h.xo},zq:function(){return J},QS:function(){return K},aF:function(){return h.aF},Mp:function(){return T},ge:function(){return L},r0:function(){return Y}});var n,i,o,s,a=r(58381),l=r(26244);async function u(e="",t){let{async:r,defer:n,beforeLoad:i,crossOrigin:o}=t||{};return new Promise((t,s)=>{e||s("loadScript cannot be called without a src"),document&&document.body||s("loadScript cannot be called when document does not exist");let a=document.createElement("script");o&&a.setAttribute("crossorigin",o),a.async=r||!1,a.defer=n||!1,a.addEventListener("load",()=>{a.remove(),t(a)}),a.addEventListener("error",()=>{a.remove(),s()}),a.src=e,null==i||i(a),document.body.appendChild(a)})}function c(e){return e.startsWith("/")}r(65996);var d=r(72920),h=r(20831),p=r(37581);r(12915),r(91934),new WeakMap,new WeakMap,new WeakSet,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakSet;var f=(0,a.t5)({packageName:"@clerk/clerk-react"});function g(e){f.setMessages(e).setPackageName(e)}var{isDevOrStagingUrl:m}=(0,l.MY)(),v=(e,t="5.2.10")=>{if(e)return e;let r=k(t);return r?"snapshot"===r?"5.10.2":r:b(t)},k=e=>{var t;return null==(t=e.trim().replace(/^v/,"").match(/-(.+?)(\.|$)/))?void 0:t[1]},b=e=>e.trim().replace(/^v/,"").split(".")[0],y="Clerk: Failed to load Clerk",S=e=>{let{publishableKey:t}=e;t||f.throwMissingPublishableKeyError();let r=document.querySelector("script[data-clerk-js-script]");return r?new Promise((e,t)=>{r.addEventListener("load",()=>{e(r)}),r.addEventListener("error",()=>{t(y)})}):u(w(e),{async:!0,crossOrigin:"anonymous",beforeLoad:O(e)}).catch(()=>{throw Error(y)})},w=e=>{var t,r;let{clerkJSUrl:n,clerkJSVariant:i,clerkJSVersion:o,proxyUrl:s,domain:a,publishableKey:u}=e;if(n)return n;let d="";d=s&&(!s||/^http(s)?:\/\//.test(s||"")||c(s))?(s?c(s)?new URL(s,window.location.origin).toString():s:"").replace(/http(s)?:\/\//,""):a&&!m((null==(t=(0,l.nQ)(u))?void 0:t.frontendApi)||"")?function(e){let t;if(!e)return"";if(e.match(/^(clerk\.)+\w*$/))t=/(clerk\.)*(?=clerk\.)/;else{if(e.match(/\.clerk.accounts/))return e;t=/^(clerk\.)*/gi}let r=e.replace(t,"");return`clerk.${r}`}(a):(null==(r=(0,l.nQ)(u))?void 0:r.frontendApi)||"";let h=i?`${i.replace(/\.+$/,"")}.`:"",p=v(o);return`https://${d}/npm/@clerk/clerk-js@${p}/dist/clerk.${h}browser.js`},P=e=>{let t={};return e.publishableKey&&(t["data-clerk-publishable-key"]=e.publishableKey),e.proxyUrl&&(t["data-clerk-proxy-url"]=e.proxyUrl),e.domain&&(t["data-clerk-domain"]=e.domain),t},O=e=>t=>{let r=P(e);for(let e in r)t.setAttribute(e,r[e])},[E,C]=(0,h.uH)("AuthContext"),j=h.b5,U=h.rI,z="You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.",_=e=>`You've passed multiple children components to <${e}/>. You can only pass a single child component or text.`,M="Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.",L="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",T="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",R="<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",I="<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",A=e=>`<${e} /> can only accept <${e}.Page /> and <${e}.Link /> as its children. Any other provided component will be ignored.`,x=e=>`Missing props. <${e}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,N=e=>`Missing props. <${e}.Link /> component requires the following props: url, label and labelIcon.`,V=e=>`The <${e}/> component uses path-based routing by default unless a different routing strategy is provided using the \`routing\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \`path\` prop. Example: <${e} path={'/my-path'} />`,W=e=>`The \`path\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \`routing='path'\` to the <${e}/> component, or drop the \`path\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`,D=e=>{(0,h.Rm)(()=>{f.throwMissingClerkProviderError({source:e})})},F=e=>new Promise(t=>{e.loaded&&t(),e.addOnLoaded(t)}),$=e=>async t=>(await F(e),e.session)?e.session.getToken(t):null,B=e=>async(...t)=>(await F(e),e.signOut(...t)),q=()=>{D("useAuth");let{sessionId:e,userId:t,actor:r,orgId:n,orgRole:i,orgSlug:o,orgPermissions:s}=C(),a=U(),l=(0,d.useCallback)($(a),[a]),u=(0,d.useCallback)(B(a),[a]),c=(0,d.useCallback)(e=>((null==e?void 0:e.permission)||(null==e?void 0:e.role)||f.throw('Missing parameters. `has` from `useAuth` requires a permission or role key to be passed. Example usage: `has({permission: "org:posts:edit"`'),!!n&&!!t&&!!i&&!!s&&(e.permission?s.includes(e.permission):!!e.role&&i===e.role)),[n,i,t,s]);return void 0===e&&void 0===t?{isLoaded:!1,isSignedIn:void 0,sessionId:e,userId:t,actor:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,has:void 0,signOut:u,getToken:l}:null===e&&null===t?{isLoaded:!0,isSignedIn:!1,sessionId:e,userId:t,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:u,getToken:l}:e&&t&&n&&i?{isLoaded:!0,isSignedIn:!0,sessionId:e,userId:t,actor:r||null,orgId:n,orgRole:i,orgSlug:o||null,has:c,signOut:u,getToken:l}:e&&t&&!n?{isLoaded:!0,isSignedIn:!0,sessionId:e,userId:t,actor:r||null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:u,getToken:l}:f.throw("Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support")};function G(e){let{startEmailLinkFlow:t,cancelEmailLinkFlow:r}=d.useMemo(()=>e.createEmailLinkFlow(),[e]);return d.useEffect(()=>r,[]),{startEmailLinkFlow:t,cancelEmailLinkFlow:r}}var J=()=>{var e;D("useSignIn");let t=U(),r=(0,h.sX)();return(null==(e=t.telemetry)||e.record((0,p.J)("useSignIn")),r)?{isLoaded:!0,signIn:r.signIn,setActive:t.setActive}:{isLoaded:!1,signIn:void 0,setActive:void 0}},K=()=>{var e;D("useSignUp");let t=U(),r=(0,h.sX)();return(null==(e=t.telemetry)||e.record((0,p.J)("useSignUp")),r)?{isLoaded:!0,signUp:r.signUp,setActive:t.setActive}:{isLoaded:!1,signUp:void 0,setActive:void 0}},Y=(e,t)=>{t=t||e.displayName||e.name||"Component",e.displayName=t;let r=r=>{D(t||"withClerk");let n=U();return n.loaded?d.createElement(e,{...r,clerk:n}):null};return r.displayName=`withClerk(${t})`,r},Q=({children:e})=>(D("ClerkLoaded"),U().loaded)?d.createElement(d.Fragment,null,e):null,X=({children:e})=>(D("ClerkLoading"),U().loaded)?null:d.createElement(d.Fragment,null,e),H=Y(({clerk:e,...t})=>{let{client:r,session:n}=e,i=r.activeSessions&&r.activeSessions.length>0;return d.useEffect(()=>{null===n&&i?e.redirectToAfterSignOut():e.redirectToSignIn(t)},[]),null},"RedirectToSignIn"),Z=Y(({clerk:e,...t})=>(d.useEffect(()=>{e.redirectToSignUp(t)},[]),null),"RedirectToSignUp"),ee=Y(({clerk:e})=>(d.useEffect(()=>{e.redirectToUserProfile()},[]),null),"RedirectToUserProfile"),et=Y(({clerk:e})=>(d.useEffect(()=>{e.redirectToOrganizationProfile()},[]),null),"RedirectToOrganizationProfile"),er=Y(({clerk:e})=>(d.useEffect(()=>{e.redirectToCreateOrganization()},[]),null),"RedirectToCreateOrganization"),en=Y(({clerk:e,...t})=>(d.useEffect(()=>{e.handleRedirectCallback(t)},[]),null),"AuthenticateWithRedirectCallback")},57997:function(e,t,r){"use strict";r.d(t,{vn:function(){return c.vn},a7:function(){return c.a7},qI:function(){return c.qI},El:function(){return eu},Gp:function(){return K},Kb:function(){return X},Bg:function(){return Q},A:function(){return J},Li:function(){return Y},gM:function(){return c.gM},yB:function(){return c.yB},N1:function(){return c.N1},C2:function(){return c.C2},sO:function(){return c.sO},cL:function(){return V},$d:function(){return H},qu:function(){return et},AM:function(){return ee},Mo:function(){return W},gX:function(){return Z},l8:function(){return B},Iw:function(){return $},aC:function(){return c.aC},ll:function(){return c.cL},E2:function(){return c.E2},o8:function(){return c.o8},eW:function(){return c.eW},kP:function(){return c.kP},xo:function(){return c.xo},zq:function(){return c.zq},QS:function(){return c.QS},aF:function(){return c.aF}});var n,i,o,s,a,l,u,c=r(14555),d=e=>{throw TypeError(e)},h=(e,t,r)=>t.has(e)||d("Cannot "+r),p=(e,t,r)=>(h(e,t,"read from private field"),r?r.call(e):t.get(e)),f=(e,t,r)=>t.has(e)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),g=(e,t,r,n)=>(h(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),m=(e,t,r)=>(h(e,t,"access private method"),r),v=r(18086),k=r(20831),b=r(72920),y=r(25966),S=r(26244),w=r(52751);function P(e,t,r){return"function"==typeof e?e(t):void 0!==e?e:void 0!==r?r:void 0}r(65996),"undefined"==typeof window||window.global||(window.global="undefined"==typeof global?window:global);var O=e=>t=>{try{return b.Children.only(e)}catch(e){return c.RM.throw((0,c.tF)(t))}},E=(e,t)=>(e||(e=t),"string"==typeof e&&(e=b.createElement("button",null,e)),e),C=e=>(...t)=>{if(e&&"function"==typeof e)return e(...t)},j=new Map,U=e=>{let t=Array(e.length).fill(null),[r,n]=(0,b.useState)(t);return e.map((e,t)=>({id:e.id,mount:e=>n(r=>r.map((r,n)=>n===t?e:r)),unmount:()=>n(e=>e.map((e,r)=>r===t?null:e)),portal:()=>b.createElement(b.Fragment,null,r[t]?(0,y.createPortal)(e.component,r[t]):null)}))},z=(e,t)=>!!e&&b.isValidElement(e)&&(null==e?void 0:e.type)===t,_=e=>L({children:e,reorderItemsLabels:["account","security"],LinkComponent:F,PageComponent:D,componentName:"UserProfile"}),M=e=>L({children:e,reorderItemsLabels:["general","members"],LinkComponent:G,PageComponent:q,componentName:"OrganizationProfile"}),L=({children:e,LinkComponent:t,PageComponent:r,reorderItemsLabels:n,componentName:i})=>{let o=[];b.Children.forEach(e,e=>{if(!z(e,r)&&!z(e,t)){e&&(0,v.yJ)((0,c.E7)(i));return}let{props:s}=e,{children:a,label:l,url:u,labelIcon:d}=s;if(z(e,r)){if(T(s,n))o.push({label:l});else if(R(s))o.push({label:l,labelIcon:d,children:a,url:u});else{(0,v.yJ)((0,c.oG)(i));return}}if(z(e,t)){if(I(s))o.push({label:l,labelIcon:d,url:u});else{(0,v.yJ)((0,c.Gl)(i));return}}});let s=[],a=[],l=[];o.forEach((e,t)=>{if(R(e)){s.push({component:e.children,id:t}),a.push({component:e.labelIcon,id:t});return}I(e)&&l.push({component:e.labelIcon,id:t})});let u=U(s),d=U(a),h=U(l),p=[],f=[];return o.forEach((e,t)=>{if(T(e,n)){p.push({label:e.label});return}if(R(e)){let{portal:r,mount:n,unmount:i}=u.find(e=>e.id===t),{portal:o,mount:s,unmount:a}=d.find(e=>e.id===t);p.push({label:e.label,url:e.url,mount:n,unmount:i,mountIcon:s,unmountIcon:a}),f.push(r),f.push(o);return}if(I(e)){let{portal:r,mount:n,unmount:i}=h.find(e=>e.id===t);p.push({label:e.label,url:e.url,mountIcon:n,unmountIcon:i}),f.push(r);return}}),{customPages:p,customPagesPortals:f}},T=(e,t)=>{let{children:r,label:n,url:i,labelIcon:o}=e;return!r&&!i&&!o&&t.some(e=>e===n)},R=e=>{let{children:t,label:r,url:n,labelIcon:i}=e;return!!t&&!!n&&!!i&&!!r},I=e=>{let{children:t,label:r,url:n,labelIcon:i}=e;return!t&&!!n&&!!i&&!!r},A=e=>"mount"in e,x=e=>"open"in e,N=class extends b.PureComponent{constructor(){super(...arguments),this.portalRef=b.createRef()}componentDidUpdate(e){var t,r;if(!A(e)||!A(this.props))return;let n=(0,v.zu)(e.props,"customPages","children"),i=(0,v.zu)(this.props.props,"customPages","children"),o=(null==(t=n.customPages)?void 0:t.length)!==(null==(r=i.customPages)?void 0:r.length);(!(0,k.c1)(n,i)||o)&&this.props.updateProps({node:this.portalRef.current,props:this.props.props})}componentDidMount(){this.portalRef.current&&(A(this.props)&&this.props.mount(this.portalRef.current,this.props.props),x(this.props)&&this.props.open(this.props.props))}componentWillUnmount(){this.portalRef.current&&(A(this.props)&&this.props.unmount(this.portalRef.current),x(this.props)&&this.props.close())}render(){var e,t;return b.createElement(b.Fragment,null,b.createElement("div",{ref:this.portalRef}),A(this.props)&&(null==(t=null==(e=this.props)?void 0:e.customPagesPortals)?void 0:t.map((e,t)=>(0,b.createElement)(e,{key:t}))))}},V=(0,c.r0)(({clerk:e,...t})=>b.createElement(N,{mount:e.mountSignIn,unmount:e.unmountSignIn,updateProps:e.__unstable__updateProps,props:t}),"SignIn"),W=(0,c.r0)(({clerk:e,...t})=>b.createElement(N,{mount:e.mountSignUp,unmount:e.unmountSignUp,updateProps:e.__unstable__updateProps,props:t}),"SignUp");function D({children:e}){return(0,v.yJ)(c.ge),b.createElement(b.Fragment,null,e)}function F({children:e}){return(0,v.yJ)(c.Mp),b.createElement(b.Fragment,null,e)}var $=Object.assign((0,c.r0)(({clerk:e,...t})=>{let{customPages:r,customPagesPortals:n}=_(t.children);return b.createElement(N,{mount:e.mountUserProfile,unmount:e.unmountUserProfile,updateProps:e.__unstable__updateProps,props:{...t,customPages:r},customPagesPortals:n})},"UserProfile"),{Page:D,Link:F}),B=Object.assign((0,c.r0)(({clerk:e,...t})=>{let{customPages:r,customPagesPortals:n}=_(t.children),i=Object.assign(t.userProfileProps||{},{customPages:r});return b.createElement(N,{mount:e.mountUserButton,unmount:e.unmountUserButton,updateProps:e.__unstable__updateProps,props:{...t,userProfileProps:i},customPagesPortals:n})},"UserButton"),{UserProfilePage:D,UserProfileLink:F});function q({children:e}){return(0,v.yJ)(c.ej),b.createElement(b.Fragment,null,e)}function G({children:e}){return(0,v.yJ)(c.Rl),b.createElement(b.Fragment,null,e)}var J=Object.assign((0,c.r0)(({clerk:e,...t})=>{let{customPages:r,customPagesPortals:n}=M(t.children);return b.createElement(N,{mount:e.mountOrganizationProfile,unmount:e.unmountOrganizationProfile,updateProps:e.__unstable__updateProps,props:{...t,customPages:r},customPagesPortals:n})},"OrganizationProfile"),{Page:q,Link:G}),K=(0,c.r0)(({clerk:e,...t})=>b.createElement(N,{mount:e.mountCreateOrganization,unmount:e.unmountCreateOrganization,updateProps:e.__unstable__updateProps,props:t}),"CreateOrganization"),Y=Object.assign((0,c.r0)(({clerk:e,...t})=>{let{customPages:r,customPagesPortals:n}=M(t.children),i=Object.assign(t.organizationProfileProps||{},{customPages:r});return b.createElement(N,{mount:e.mountOrganizationSwitcher,unmount:e.unmountOrganizationSwitcher,updateProps:e.__unstable__updateProps,props:{...t,organizationProfileProps:i},customPagesPortals:n})},"OrganizationSwitcher"),{OrganizationProfilePage:q,OrganizationProfileLink:G}),Q=(0,c.r0)(({clerk:e,...t})=>b.createElement(N,{mount:e.mountOrganizationList,unmount:e.unmountOrganizationList,updateProps:e.__unstable__updateProps,props:t}),"OrganizationList"),X=(0,c.r0)(({clerk:e,...t})=>b.createElement(N,{open:e.openGoogleOneTap,close:e.closeGoogleOneTap,props:t}),"GoogleOneTap"),H=(0,c.r0)(({clerk:e,children:t,...r})=>{let{signUpFallbackRedirectUrl:n,forceRedirectUrl:i,fallbackRedirectUrl:o,signUpForceRedirectUrl:s,mode:a,...l}=r,u=O(t=E(t,"Sign in"))("SignInButton"),c=()=>{let t={forceRedirectUrl:i,fallbackRedirectUrl:o,signUpFallbackRedirectUrl:n,signUpForceRedirectUrl:s};return"modal"===a?e.openSignIn(t):e.redirectToSignIn({...t,signInFallbackRedirectUrl:o,signInForceRedirectUrl:i})},d=async e=>(u&&"object"==typeof u&&"props"in u&&await C(u.props.onClick)(e),c()),h={...l,onClick:d};return b.cloneElement(u,h)},"SignInButton"),Z=(0,c.r0)(({clerk:e,children:t,...r})=>{let{fallbackRedirectUrl:n,forceRedirectUrl:i,signInFallbackRedirectUrl:o,signInForceRedirectUrl:s,mode:a,unsafeMetadata:l,...u}=r,c=O(t=E(t,"Sign up"))("SignUpButton"),d=()=>{let t={fallbackRedirectUrl:n,forceRedirectUrl:i,signInFallbackRedirectUrl:o,signInForceRedirectUrl:s,unsafeMetadata:l};return"modal"===a?e.openSignUp(t):e.redirectToSignUp({...t,signUpFallbackRedirectUrl:n,signUpForceRedirectUrl:i})},h=async e=>(c&&"object"==typeof c&&"props"in c&&await C(c.props.onClick)(e),d()),p={...u,onClick:h};return b.cloneElement(c,p)},"SignUpButton"),ee=(0,c.r0)(({clerk:e,children:t,...r})=>{let{redirectUrl:n="/",signOutOptions:i,...o}=r,s=O(t=E(t,"Sign out"))("SignOutButton"),a=()=>e.signOut({redirectUrl:n}),l=async e=>(await C(s.props.onClick)(e),a()),u={...o,onClick:l};return b.cloneElement(s,u)},"SignOutButton"),et=(0,c.r0)(({clerk:e,children:t,...r})=>{let{redirectUrl:n,...i}=r,o=O(t=E(t,"Sign in with Metamask"))("SignInWithMetamaskButton"),s=async()=>{!async function(){await e.authenticateWithMetamask({redirectUrl:n||void 0})}()},a=async e=>(await C(o.props.onClick)(e),s()),l={...i,onClick:a};return b.cloneElement(o,l)},"SignInWithMetamask"),er={name:"@clerk/clerk-react",version:"5.2.10",environment:"production"},en=class e{constructor(e){f(this,l),this.clerkjs=null,this.preopenOneTap=null,this.preopenSignIn=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenCreateOrganization=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this.premountOrganizationProfileNodes=new Map,this.premountCreateOrganizationNodes=new Map,this.premountOrganizationSwitcherNodes=new Map,this.premountOrganizationListNodes=new Map,this.premountMethodCalls=new Map,this.loadedListeners=[],f(this,n,!1),f(this,i),f(this,o),f(this,s),this.buildSignInUrl=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildSignInUrl(e))||""};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("buildSignInUrl",t)},this.buildSignUpUrl=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildSignUpUrl(e))||""};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("buildSignUpUrl",t)},this.buildAfterSignInUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterSignInUrl())||""};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("buildAfterSignInUrl",e)},this.buildAfterSignUpUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterSignUpUrl())||""};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("buildAfterSignUpUrl",e)},this.buildAfterSignOutUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterSignOutUrl())||""};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("buildAfterSignOutUrl",e)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterMultiSessionSingleSignOutUrl())||""};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("buildAfterMultiSessionSingleSignOutUrl",e)},this.buildUserProfileUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildUserProfileUrl())||""};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("buildUserProfileUrl",e)},this.buildCreateOrganizationUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildCreateOrganizationUrl())||""};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("buildCreateOrganizationUrl",e)},this.buildOrganizationProfileUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildOrganizationProfileUrl())||""};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("buildOrganizationProfileUrl",e)},this.buildUrlWithAuth=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildUrlWithAuth(e))||""};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("buildUrlWithAuth",t)},this.handleUnauthenticated=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.handleUnauthenticated()};this.clerkjs&&p(this,n)?e():this.premountMethodCalls.set("handleUnauthenticated",e)},this.addOnLoaded=e=>{this.loadedListeners.push(e),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>{this.loadedListeners.forEach(e=>e()),this.loadedListeners=[]},this.hydrateClerkJS=e=>{if(!e)throw Error("Failed to hydrate latest Clerk JS");return this.clerkjs=e,this.premountMethodCalls.forEach(e=>e()),null!==this.preopenSignIn&&e.openSignIn(this.preopenSignIn),null!==this.preopenSignUp&&e.openSignUp(this.preopenSignUp),null!==this.preopenUserProfile&&e.openUserProfile(this.preopenUserProfile),null!==this.preopenOneTap&&e.openGoogleOneTap(this.preopenOneTap),null!==this.preopenOrganizationProfile&&e.openOrganizationProfile(this.preopenOrganizationProfile),null!==this.preopenCreateOrganization&&e.openCreateOrganization(this.preopenCreateOrganization),this.premountSignInNodes.forEach((t,r)=>{e.mountSignIn(r,t)}),this.premountSignUpNodes.forEach((t,r)=>{e.mountSignUp(r,t)}),this.premountUserProfileNodes.forEach((t,r)=>{e.mountUserProfile(r,t)}),this.premountUserButtonNodes.forEach((t,r)=>{e.mountUserButton(r,t)}),this.premountOrganizationListNodes.forEach((t,r)=>{e.mountOrganizationList(r,t)}),g(this,n,!0),this.emitLoaded(),this.clerkjs},this.__unstable__updateProps=async e=>{let t=await m(this,l,u).call(this);if(t&&"__unstable__updateProps"in t)return t.__unstable__updateProps(e)},this.setActive=({session:e,organization:t,beforeEmit:r})=>this.clerkjs?this.clerkjs.setActive({session:e,organization:t,beforeEmit:r}):Promise.reject(),this.openSignIn=e=>{this.clerkjs&&p(this,n)?this.clerkjs.openSignIn(e):this.preopenSignIn=e},this.closeSignIn=()=>{this.clerkjs&&p(this,n)?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.openGoogleOneTap=e=>{this.clerkjs&&p(this,n)?this.clerkjs.openGoogleOneTap(e):this.preopenOneTap=e},this.closeGoogleOneTap=()=>{this.clerkjs&&p(this,n)?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=e=>{this.clerkjs&&p(this,n)?this.clerkjs.openUserProfile(e):this.preopenUserProfile=e},this.closeUserProfile=()=>{this.clerkjs&&p(this,n)?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=e=>{this.clerkjs&&p(this,n)?this.clerkjs.openOrganizationProfile(e):this.preopenOrganizationProfile=e},this.closeOrganizationProfile=()=>{this.clerkjs&&p(this,n)?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openCreateOrganization=e=>{this.clerkjs&&p(this,n)?this.clerkjs.openCreateOrganization(e):this.preopenCreateOrganization=e},this.closeCreateOrganization=()=>{this.clerkjs&&p(this,n)?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openSignUp=e=>{this.clerkjs&&p(this,n)?this.clerkjs.openSignUp(e):this.preopenSignUp=e},this.closeSignUp=()=>{this.clerkjs&&p(this,n)?this.clerkjs.closeSignUp():this.preopenSignUp=null},this.mountSignIn=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountSignIn(e,t):this.premountSignInNodes.set(e,t)},this.unmountSignIn=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountSignIn(e):this.premountSignInNodes.delete(e)},this.mountSignUp=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountSignUp(e,t):this.premountSignUpNodes.set(e,t)},this.unmountSignUp=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountSignUp(e):this.premountSignUpNodes.delete(e)},this.mountUserProfile=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountUserProfile(e,t):this.premountUserProfileNodes.set(e,t)},this.unmountUserProfile=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountUserProfile(e):this.premountUserProfileNodes.delete(e)},this.mountOrganizationProfile=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountOrganizationProfile(e,t):this.premountOrganizationProfileNodes.set(e,t)},this.unmountOrganizationProfile=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountOrganizationProfile(e):this.premountOrganizationProfileNodes.delete(e)},this.mountCreateOrganization=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountCreateOrganization(e,t):this.premountCreateOrganizationNodes.set(e,t)},this.unmountCreateOrganization=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountCreateOrganization(e):this.premountCreateOrganizationNodes.delete(e)},this.mountOrganizationSwitcher=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountOrganizationSwitcher(e,t):this.premountOrganizationSwitcherNodes.set(e,t)},this.unmountOrganizationSwitcher=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountOrganizationSwitcher(e):this.premountOrganizationSwitcherNodes.delete(e)},this.mountOrganizationList=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountOrganizationList(e,t):this.premountOrganizationListNodes.set(e,t)},this.unmountOrganizationList=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountOrganizationList(e):this.premountOrganizationListNodes.delete(e)},this.mountUserButton=(e,t)=>{this.clerkjs&&p(this,n)?this.clerkjs.mountUserButton(e,t):this.premountUserButtonNodes.set(e,t)},this.unmountUserButton=e=>{this.clerkjs&&p(this,n)?this.clerkjs.unmountUserButton(e):this.premountUserButtonNodes.delete(e)},this.addListener=e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.addListener(e)};return this.clerkjs?t():(this.premountMethodCalls.set("addListener",t),()=>this.premountMethodCalls.delete("addListener"))},this.navigate=e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.navigate(e)};this.clerkjs&&p(this,n)?t():this.premountMethodCalls.set("navigate",t)},this.redirectWithAuth=async(...e)=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectWithAuth(...e)};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("redirectWithAuth",t)},this.redirectToSignIn=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectToSignIn(e)};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("redirectToSignIn",t)},this.redirectToSignUp=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectToSignUp(e)};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("redirectToSignUp",t)},this.redirectToUserProfile=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToUserProfile()};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("redirectToUserProfile",e)},this.redirectToAfterSignUp=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignUp()};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("redirectToAfterSignUp",e)},this.redirectToAfterSignIn=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignIn()};this.clerkjs&&p(this,n)?e():this.premountMethodCalls.set("redirectToAfterSignIn",e)},this.redirectToAfterSignOut=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignOut()};this.clerkjs&&p(this,n)?e():this.premountMethodCalls.set("redirectToAfterSignOut",e)},this.redirectToOrganizationProfile=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToOrganizationProfile()};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("redirectToOrganizationProfile",e)},this.redirectToCreateOrganization=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToCreateOrganization()};if(this.clerkjs&&p(this,n))return e();this.premountMethodCalls.set("redirectToCreateOrganization",e)},this.handleRedirectCallback=e=>{var t;let r=()=>{var t;return null==(t=this.clerkjs)?void 0:t.handleRedirectCallback(e)};this.clerkjs&&p(this,n)?null==(t=r())||t.catch(()=>{}):this.premountMethodCalls.set("handleRedirectCallback",r)},this.handleGoogleOneTapCallback=(e,t)=>{var r;let i=()=>{var r;return null==(r=this.clerkjs)?void 0:r.handleGoogleOneTapCallback(e,t)};this.clerkjs&&p(this,n)?null==(r=i())||r.catch(()=>{}):this.premountMethodCalls.set("handleGoogleOneTapCallback",i)},this.handleEmailLinkVerification=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.handleEmailLinkVerification(e)};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("handleEmailLinkVerification",t)},this.authenticateWithMetamask=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithMetamask(e)};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("authenticateWithMetamask",t)},this.authenticateWithGoogleOneTap=async e=>(await m(this,l,u).call(this)).authenticateWithGoogleOneTap(e),this.createOrganization=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.createOrganization(e)};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("createOrganization",t)},this.getOrganization=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.getOrganization(e)};if(this.clerkjs&&p(this,n))return t();this.premountMethodCalls.set("getOrganization",t)},this.signOut=async(e,t)=>{let r=()=>{var r;return null==(r=this.clerkjs)?void 0:r.signOut(e,t)};if(this.clerkjs&&p(this,n))return r();this.premountMethodCalls.set("signOut",r)};let{Clerk:t=null,publishableKey:r}=e||{};g(this,s,r),g(this,o,null==e?void 0:e.proxyUrl),g(this,i,null==e?void 0:e.domain),this.options=e,this.Clerk=t,this.mode=(0,w._f)()?"browser":"server",this.options.sdkMetadata||(this.options.sdkMetadata=er),this.loadClerkJS()}get publishableKey(){return p(this,s)}get loaded(){return p(this,n)}static getOrCreateInstance(t){return(0,w._f)()&&p(this,a)&&(!t.Clerk||p(this,a).Clerk===t.Clerk)||g(this,a,new e(t)),p(this,a)}static clearInstance(){g(this,a,null)}get domain(){return"undefined"!=typeof window&&window.location?P(p(this,i),new URL(window.location.href),""):"function"==typeof p(this,i)?c.RM.throw(c.qq):p(this,i)||""}get proxyUrl(){return"undefined"!=typeof window&&window.location?P(p(this,o),new URL(window.location.href),""):"function"==typeof p(this,o)?c.RM.throw(c.qq):p(this,o)||""}get sdkMetadata(){var e;return(null==(e=this.clerkjs)?void 0:e.sdkMetadata)||this.options.sdkMetadata||void 0}get instanceType(){var e;return null==(e=this.clerkjs)?void 0:e.instanceType}get frontendApi(){var e;return(null==(e=this.clerkjs)?void 0:e.frontendApi)||""}get isStandardBrowser(){var e;return(null==(e=this.clerkjs)?void 0:e.isStandardBrowser)||this.options.standardBrowser||!1}get isSatellite(){return"undefined"!=typeof window&&window.location?P(this.options.isSatellite,new URL(window.location.href),!1):"function"==typeof this.options.isSatellite&&c.RM.throw(c.qq)}async loadClerkJS(){var e,t;if(!("browser"!==this.mode||p(this,n))){"undefined"!=typeof window&&(window.__clerk_publishable_key=p(this,s),window.__clerk_proxy_url=this.proxyUrl,window.__clerk_domain=this.domain);try{if(this.Clerk){let e;(t=this.Clerk,"function"==typeof t)?(e=new this.Clerk(p(this,s),{proxyUrl:this.proxyUrl,domain:this.domain}),await e.load(this.options)):(e=this.Clerk).loaded||await e.load(this.options),global.Clerk=e}else{if(global.Clerk||await (0,c.YJ)({...this.options,publishableKey:p(this,s),proxyUrl:this.proxyUrl,domain:this.domain}),!global.Clerk)throw Error("Failed to download latest ClerkJS. Contact support@clerk.com.");await global.Clerk.load(this.options)}if(null==(e=global.Clerk)?void 0:e.loaded)return this.hydrateClerkJS(global.Clerk);return}catch(e){console.error(e.stack||e.message||e);return}}}get version(){var e;return null==(e=this.clerkjs)?void 0:e.version}get client(){return this.clerkjs?this.clerkjs.client:void 0}get session(){return this.clerkjs?this.clerkjs.session:void 0}get user(){return this.clerkjs?this.clerkjs.user:void 0}get organization(){return this.clerkjs?this.clerkjs.organization:void 0}get telemetry(){return this.clerkjs?this.clerkjs.telemetry:void 0}get __unstable__environment(){return this.clerkjs?this.clerkjs.__unstable__environment:void 0}__unstable__setEnvironment(...e){this.clerkjs&&"__unstable__setEnvironment"in this.clerkjs&&this.clerkjs.__unstable__setEnvironment(e)}};n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakMap,l=new WeakSet,u=function(){return new Promise(e=>{this.addOnLoaded(()=>e(this.clerkjs))})},f(en,a);var ei=(e,t,r)=>!e&&r?eo(r):es(t),eo=e=>{let t=e.userId,r=e.user,n=e.sessionId,i=e.session,o=e.organization,s=e.orgId,a=e.orgRole;return{userId:t,user:r,sessionId:n,session:i,organization:o,orgId:s,orgRole:a,orgPermissions:e.orgPermissions,orgSlug:e.orgSlug,actor:e.actor}},es=e=>{var t;let r=e.user?e.user.id:e.user,n=e.user,i=e.session?e.session.id:e.session,o=e.session,s=null==o?void 0:o.actor,a=e.organization,l=e.organization?e.organization.id:e.organization,u=null==a?void 0:a.slug,c=a?null==(t=null==n?void 0:n.organizationMemberships)?void 0:t.find(e=>e.organization.id===l):a,d=c?c.permissions:c;return{userId:r,user:n,sessionId:i,session:o,organization:a,orgId:l,orgRole:c?c.role:c,orgSlug:u,orgPermissions:d,actor:s}};function ea(e){let{isomorphicClerkOptions:t,initialState:r,children:n}=e,{isomorphicClerk:i,loaded:o}=el(t),[s,a]=b.useState({client:i.client,session:i.session,user:i.user,organization:i.organization});b.useEffect(()=>i.addListener(e=>a({...e})),[]);let l=ei(o,s,r),u=b.useMemo(()=>({value:i}),[o]),d=b.useMemo(()=>({value:s.client}),[s.client]),{sessionId:h,session:p,userId:f,user:g,orgId:m,actor:v,organization:y,orgRole:S,orgSlug:w,orgPermissions:P}=l,O=b.useMemo(()=>({value:{sessionId:h,userId:f,actor:v,orgId:m,orgRole:S,orgSlug:w,orgPermissions:P}}),[h,f,v,m,S,w]),E=b.useMemo(()=>({value:g}),[f,g]),C=b.useMemo(()=>({value:p}),[h,p]),j=b.useMemo(()=>({value:{organization:y}}),[m,y]);return b.createElement(c.iz.Provider,{value:u},b.createElement(k.RY.Provider,{value:d},b.createElement(k.B3.Provider,{value:C},b.createElement(k.f0,{...j.value},b.createElement(c.Vo.Provider,{value:O},b.createElement(k.St.Provider,{value:E},n))))))}var el=e=>{let[t,r]=b.useState(!1),n=b.useMemo(()=>en.getOrCreateInstance(e),[]);return b.useEffect(()=>{n.__unstable__updateProps({appearance:e.appearance})},[e.appearance]),b.useEffect(()=>{n.__unstable__updateProps({options:e})},[e.localization]),b.useEffect(()=>{n.addOnLoaded(()=>r(!0))},[]),b.useEffect(()=>()=>{en.clearInstance()},[]),{isomorphicClerk:n,loaded:t}},eu=function(e,t,r){let n=e.displayName||e.name||t||"Component",i=n=>(!function(e,t,r=1){b.useEffect(()=>{let n=j.get(e)||0;return n==r?c.RM.throw(t):(j.set(e,n+1),()=>{j.set(e,(j.get(e)||1)-1)})},[])}(t,r),b.createElement(e,{...n}));return i.displayName=`withMaxAllowedInstancesGuard(${n})`,i}(function(e){let{initialState:t,children:r,...n}=e,{publishableKey:i="",Clerk:o}=n;return o||(i?i&&!(0,S.x9)(i)&&c.RM.throwInvalidPublishableKeyError({key:i}):c.RM.throwMissingPublishableKeyError()),b.createElement(ea,{initialState:t,isomorphicClerkOptions:n},r)},"ClerkProvider",c.KQ);eu.displayName="ClerkProvider",(0,c.JM)({packageName:"@clerk/clerk-react"})},65996:function(e,t,r){"use strict";r.d(t,{U9:function(){return f},ac:function(){return h},qx:function(){return p},r2:function(){return l},yA:function(){return c}});var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=e=>{throw TypeError(e)},l=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(u(e,t,"default"),r&&u(r,t,"default")),d=(e,t,r)=>t.has(e)||a("Cannot "+r),h=(e,t,r)=>(d(e,t,"read from private field"),r?r.call(e):t.get(e)),p=(e,t,r,n)=>(d(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),f=(e,t,r)=>(d(e,t,"access private method"),r)},52751:function(e,t,r){"use strict";function n(){return"undefined"!=typeof window}r.d(t,{_f:function(){return n}}),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","i")},12915:function(e,t,r){"use strict";r.d(t,{fQ:function(){return i}});var n=e=>{let t=r=>{if(!r)return r;if(Array.isArray(r))return r.map(e=>"object"==typeof e||Array.isArray(e)?t(e):e);let n={...r};for(let r of Object.keys(n)){let i=e(r.toString());i!==r&&(n[i]=n[r],delete n[r]),"object"==typeof n[i]&&(n[i]=t(n[i]))}return n};return t};function i(e){if("boolean"==typeof e)return e;if(null==e)return!1;if("string"==typeof e){if("true"===e.toLowerCase())return!0;if("false"===e.toLowerCase())return!1}let t=parseInt(e,10);return!isNaN(t)&&t>0}n(function(e){return e?e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`):""}),n(function(e){return e?e.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace(/-|_/,"")):""})},38243:function(e,t,r){"use strict";r.d(t,{MY:function(){return l},x9:function(){return a},nQ:function(){return s}});var n=e=>"undefined"!=typeof atob&&"function"==typeof atob?atob(e):"undefined"!=typeof global&&global.Buffer?new global.Buffer(e,"base64").toString():e,i=r(44852),o="pk_live_";function s(e,t={}){if(!(e=e||"")||!a(e)){if(t.fatal)throw Error("Publishable key not valid.");return null}let r=e.startsWith(o)?"production":"development",i=n(e.split("_")[2]);return i=i.slice(0,-1),t.proxyUrl?i=t.proxyUrl:"development"!==r&&t.domain&&(i=`clerk.${t.domain}`),{instanceType:r,frontendApi:i}}function a(e){let t=(e=e||"").startsWith(o)||e.startsWith("pk_test_"),r=n(e.split("_")[2]||"").endsWith("$");return t&&r}function l(){let e=new Map;return{isDevOrStagingUrl:t=>{if(!t)return!1;let r="string"==typeof t?t:t.hostname,n=e.get(r);return void 0===n&&(n=i.vO.some(e=>r.endsWith(e)),e.set(r,n)),n}}}},94309:function(e,t,r){"use strict";r.d(t,{t5:function(){return i}});var n=Object.freeze({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.com/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingSecretKeyErrorMessage:"Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingClerkProvider:"{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider"});function i({packageName:e,customMessages:t}){let r=e,i={...n,...t};function o(e,t){if(!t)return`${r}: ${e}`;let n=e;for(let r of e.matchAll(/{{([a-zA-Z0-9-_]+)}}/g)){let e=(t[r[1]]||"").toString();n=n.replace(`{{${r[1]}}}`,e)}return`${r}: ${n}`}return{setPackageName({packageName:e}){return"string"==typeof e&&(r=e),this},setMessages({customMessages:e}){return Object.assign(i,e||{}),this},throwInvalidPublishableKeyError(e){throw Error(o(i.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw Error(o(i.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw Error(o(i.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(o(i.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw Error(o(i.MissingClerkProvider,e))},throw(e){throw Error(o(e))}}}},37581:function(e,t,r){"use strict";function n(e,t){return{event:"METHOD_CALLED",payload:{method:e,...t}}}r.d(t,{J:function(){return n}})},44852:function(e,t,r){"use strict";r.d(t,{Fo:function(){return a},Iq:function(){return l},Xv:function(){return u},cM:function(){return s},iF:function(){return o},mv:function(){return n},vO:function(){return i}});var n=[".lcl.dev",".lclstage.dev",".lclclerk.com"],i=[".lcl.dev",".stg.dev",".lclstage.dev",".stgstage.dev",".dev.lclclerk.com",".stg.lclclerk.com",".accounts.lclclerk.com","accountsstage.dev","accounts.dev"],o=[".lcl.dev","lclstage.dev",".lclclerk.com",".accounts.lclclerk.com"],s=[".accountsstage.dev"],a="https://api.lclclerk.com",l="https://api.clerkstage.dev",u="https://api.clerk.com"},58381:function(e,t,r){"use strict";r.d(t,{t5:function(){return n.t5}});var n=r(94309);r(65996)},18086:function(e,t,r){"use strict";r.d(t,{rx:function(){return o},yJ:function(){return s},zu:function(){return n}});var n=(e,...t)=>{let r={...e};for(let e of t)delete r[e];return r};r(12915),r(94309),Object.freeze({"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/x-icon":"ico","image/vnd.microsoft.icon":"ico"}),r(52751);var i=()=>!1,o=()=>{try{return!0}catch(e){}return!1};r(65996);var s=e=>{i()&&console.error(`Clerk: ${e}`)}},26244:function(e,t,r){"use strict";r.d(t,{MY:function(){return n.MY},nQ:function(){return n.nQ},x9:function(){return n.x9}});var n=r(38243);r(65996)},20831:function(e,t,r){"use strict";let n;r.d(t,{b5:function(){return eb},RY:function(){return eP},f0:function(){return ez},B3:function(){return eE},St:function(){return eS},uH:function(){return ev},c1:function(){return eG},Rm:function(){return e_},cL:function(){return eF},rI:function(){return ey},sX:function(){return eO},o8:function(){return eA},eW:function(){return eN},kP:function(){return eV},xo:function(){return eW},aF:function(){return eD}});var i={};r.r(i),r.d(i,{SWRConfig:function(){return el},default:function(){return eu},mutate:function(){return q},preload:function(){return et},unstable_serialize:function(){return eo},useSWRConfig:function(){return ee}});var o=r(37581),s=r(65996),a=r(72920),l=r(57498);let u=()=>{},c=u(),d=Object,h=e=>e===c,p=e=>"function"==typeof e,f=(e,t)=>({...e,...t}),g=e=>p(e.then),m=new WeakMap,v=0,k=e=>{let t,r;let n=typeof e,i=e&&e.constructor,o=i==Date;if(d(e)!==e||o||i==RegExp)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=m.get(e))return t;if(t=++v+"~",m.set(e,t),i==Array){for(r=0,t="@";r<e.length;r++)t+=k(e[r])+",";m.set(e,t)}if(i==d){t="#";let n=d.keys(e).sort();for(;!h(r=n.pop());)h(e[r])||(t+=r+":"+k(e[r])+",");m.set(e,t)}}return t},b=new WeakMap,y={},S={},w="undefined",P=typeof window!=w,O=typeof document!=w,E=()=>P&&typeof window.requestAnimationFrame!=w,C=(e,t)=>{let r=b.get(e);return[()=>!h(t)&&e.get(t)||y,n=>{if(!h(t)){let i=e.get(t);t in S||(S[t]=i),r[5](t,f(i,n),i||y)}},r[6],()=>!h(t)&&t in S?S[t]:!h(t)&&e.get(t)||y]},j=!0,[U,z]=P&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[u,u],_={initFocus:e=>(O&&document.addEventListener("visibilitychange",e),U("focus",e),()=>{O&&document.removeEventListener("visibilitychange",e),z("focus",e)}),initReconnect:e=>{let t=()=>{j=!0,e()},r=()=>{j=!1};return U("online",t),U("offline",r),()=>{z("online",t),z("offline",r)}}},M=!a.useId,L=!P||"Deno"in window,T=e=>E()?window.requestAnimationFrame(e):setTimeout(e,1),R=L?a.useEffect:a.useLayoutEffect,I="undefined"!=typeof navigator&&navigator.connection,A=!L&&I&&(["slow-2g","2g"].includes(I.effectiveType)||I.saveData),x=e=>{if(p(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?k(e):"",t]},N=0,V=()=>++N;var W={ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1};async function D(...e){let[t,r,n,i]=e,o=f({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),s=o.populateCache,a=o.rollbackOnError,l=o.optimisticData,u=e=>"function"==typeof a?a(e):!1!==a,d=o.throwOnError;if(p(r)){let e=[];for(let n of t.keys())!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n);return Promise.all(e.map(m))}return m(r);async function m(r){let i;let[a]=x(r);if(!a)return;let[f,m]=C(t,a),[v,k,y,S]=b.get(t),w=()=>{let e=v[a];return(p(o.revalidate)?o.revalidate(f().data,r):!1!==o.revalidate)&&(delete y[a],delete S[a],e&&e[0])?e[0](2).then(()=>f().data):f().data};if(e.length<3)return w();let P=n,O=V();k[a]=[O,0];let E=!h(l),j=f(),U=j.data,z=j._c,_=h(z)?U:z;if(E&&m({data:l=p(l)?l(_,U):l,_c:_}),p(P))try{P=P(_)}catch(e){i=e}if(P&&g(P)){if(P=await P.catch(e=>{i=e}),O!==k[a][0]){if(i)throw i;return P}i&&E&&u(i)&&(s=!0,m({data:_,_c:c}))}if(s&&!i&&(p(s)?m({data:s(P,_),error:c,_c:c}):m({data:P,error:c,_c:c})),k[a][1]=V(),Promise.resolve(w()).then(()=>{m({_c:c})}),i){if(d)throw i;return}return P}}let F=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},$=(e,t)=>{if(!b.has(e)){let r=f(_,t),n={},i=D.bind(c,e),o=u,s={},a=(e,t)=>{let r=s[e]||[];return s[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},l=(t,r,n)=>{e.set(t,r);let i=s[t];if(i)for(let e of i)e(r,n)},d=()=>{if(!b.has(e)&&(b.set(e,[n,{},{},{},i,l,a]),!L)){let t=r.initFocus(setTimeout.bind(c,F.bind(c,n,0))),i=r.initReconnect(setTimeout.bind(c,F.bind(c,n,1)));o=()=>{t&&t(),i&&i(),b.delete(e)}}};return d(),[e,i,d,o]}return[e,b.get(e)[4]]},[B,q]=$(new Map),G=f({onLoadingSlow:u,onSuccess:u,onError:u,onErrorRetry:(e,t,r,n,i)=>{let o=r.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*r.errorRetryInterval;(h(o)||!(s>o))&&setTimeout(n,a,i)},onDiscarded:u,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:A?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:A?5e3:3e3,compare:(e,t)=>k(e)==k(t),isPaused:()=>!1,cache:B,mutate:q,fallback:{}},{isOnline:()=>j,isVisible:()=>{let e=O&&document.visibilityState;return h(e)||"hidden"!==e}}),J=(e,t)=>{let r=f(e,t);if(t){let{use:n,fallback:i}=e,{use:o,fallback:s}=t;n&&o&&(r.use=n.concat(o)),i&&s&&(r.fallback=f(i,s))}return r},K=(0,a.createContext)({}),Y=e=>{let{value:t}=e,r=(0,a.useContext)(K),n=p(t),i=(0,a.useMemo)(()=>n?t(r):t,[n,r,t]),o=(0,a.useMemo)(()=>n?i:J(r,i),[n,r,i]),s=i&&i.provider,l=(0,a.useRef)(c);s&&!l.current&&(l.current=$(s(o.cache||B),i));let u=l.current;return u&&(o.cache=u[0],o.mutate=u[1]),R(()=>{if(u)return u[2]&&u[2](),u[3]},[]),(0,a.createElement)(K.Provider,f(e,{value:o}))},Q="$inf$",X=P&&window.__SWR_DEVTOOLS_USE__,H=X?window.__SWR_DEVTOOLS_USE__:[],Z=e=>p(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],ee=()=>f(G,(0,a.useContext)(K)),et=(e,t)=>{let[r,n]=x(e),[,,,i]=b.get(B);if(i[r])return i[r];let o=t(n);return i[r]=o,o},er=H.concat(e=>(t,r,n)=>{let i=r&&((...e)=>{let[n]=x(t),[,,,i]=b.get(B);if(n.startsWith(Q))return r(...e);let o=i[n];return h(o)?r(...e):(delete i[n],o)});return e(t,i,n)}),en=e=>function(...t){let r=ee(),[n,i,o]=Z(t),s=J(r,o),a=e,{use:l}=s,u=(l||[]).concat(er);for(let e=u.length;e--;)a=u[e](a);return a(n,i||s.fetcher||null,s)},ei=(e,t,r)=>{let n=t[e]||(t[e]=[]);return n.push(r),()=>{let e=n.indexOf(r);e>=0&&(n[e]=n[n.length-1],n.pop())}};X&&(window.__SWR_DEVTOOLS_REACT__=a);let eo=e=>x(e)[0],es=a.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}),ea={dedupe:!0},el=d.defineProperty(Y,"defaultValue",{value:G}),eu=en((e,t,r)=>{let{cache:n,compare:i,suspense:o,fallbackData:s,revalidateOnMount:u,revalidateIfStale:d,refreshInterval:g,refreshWhenHidden:m,refreshWhenOffline:v,keepPreviousData:k}=r,[y,S,w,P]=b.get(n),[O,E]=x(e),j=(0,a.useRef)(!1),U=(0,a.useRef)(!1),z=(0,a.useRef)(O),_=(0,a.useRef)(t),I=(0,a.useRef)(r),A=()=>I.current,N=()=>A().isVisible()&&A().isOnline(),[F,$,B,q]=C(n,O),G=(0,a.useRef)({}).current,J=h(s)?r.fallback[O]:s,K=(e,t)=>{for(let r in G)if("data"===r){if(!i(e[r],t[r])&&(!h(e[r])||!i(en,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},Y=(0,a.useMemo)(()=>{let e=!!O&&!!t&&(h(u)?!A().isPaused()&&!o&&(!!h(d)||d):u),r=t=>{let r=f(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=F(),i=q(),s=r(n),a=n===i?s:r(i),l=s;return[()=>{let e=r(F());return K(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>a]},[n,O]),Q=(0,l.useSyncExternalStore)((0,a.useCallback)(e=>B(O,(t,r)=>{K(r,t)||e()}),[n,O]),Y[0],Y[1]),X=!j.current,H=y[O]&&y[O].length>0,Z=Q.data,ee=h(Z)?J:Z,et=Q.error,er=(0,a.useRef)(ee),en=k?h(Z)?er.current:Z:ee,eo=(!H||!!h(et))&&(X&&!h(u)?u:!A().isPaused()&&(o?!h(ee)&&d:h(ee)||d)),el=!!(O&&t&&X&&eo),eu=h(Q.isValidating)?el:Q.isValidating,ec=h(Q.isLoading)?el:Q.isLoading,ed=(0,a.useCallback)(async e=>{let t,n;let o=_.current;if(!O||!o||U.current||A().isPaused())return!1;let s=!0,a=e||{},l=!w[O]||!a.dedupe,u=()=>M?!U.current&&O===z.current&&j.current:O===z.current,d={isValidating:!1,isLoading:!1},f=()=>{$(d)},g=()=>{let e=w[O];e&&e[1]===n&&delete w[O]},m={isValidating:!0};h(F().data)&&(m.isLoading=!0);try{if(l&&($(m),r.loadingTimeout&&h(F().data)&&setTimeout(()=>{s&&u()&&A().onLoadingSlow(O,r)},r.loadingTimeout),w[O]=[o(E),V()]),[t,n]=w[O],t=await t,l&&setTimeout(g,r.dedupingInterval),!w[O]||w[O][1]!==n)return l&&u()&&A().onDiscarded(O),!1;d.error=c;let e=S[O];if(!h(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return f(),l&&u()&&A().onDiscarded(O),!1;let a=F().data;d.data=i(a,t)?a:t,l&&u()&&A().onSuccess(t,O,r)}catch(r){g();let e=A(),{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=r,l&&u()&&(e.onError(r,O,e),(!0===t||p(t)&&t(r))&&(!A().revalidateOnFocus||!A().revalidateOnReconnect||N())&&e.onErrorRetry(r,O,e,e=>{let t=y[O];t&&t[0]&&t[0](W.ERROR_REVALIDATE_EVENT,e)},{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return s=!1,f(),!0},[O,n]),eh=(0,a.useCallback)((...e)=>D(n,z.current,...e),[]);if(R(()=>{_.current=t,I.current=r,h(Z)||(er.current=Z)}),R(()=>{if(!O)return;let e=ed.bind(c,ea),t=0,r=ei(O,y,(r,n={})=>{if(r==W.FOCUS_EVENT){let r=Date.now();A().revalidateOnFocus&&r>t&&N()&&(t=r+A().focusThrottleInterval,e())}else if(r==W.RECONNECT_EVENT)A().revalidateOnReconnect&&N()&&e();else if(r==W.MUTATE_EVENT)return ed();else if(r==W.ERROR_REVALIDATE_EVENT)return ed(n)});return U.current=!1,z.current=O,j.current=!0,$({_k:E}),eo&&(h(ee)||L?e():T(e)),()=>{U.current=!0,r()}},[O]),R(()=>{let e;function t(){let t=p(g)?g(F().data):g;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!F().error&&(m||A().isVisible())&&(v||A().isOnline())?ed(ea).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[g,m,v,O]),(0,a.useDebugValue)(en),o&&h(ee)&&O){if(!M&&L)throw Error("Fallback data is required when using suspense in SSR.");_.current=t,I.current=r,U.current=!1;let e=P[O];if(h(e)||es(eh(e)),h(et)){let e=ed(ea);h(en)||(e.status="fulfilled",e.value=!0),es(e)}else throw et}return{mutate:eh,get data(){return G.data=!0,en},get error(){return G.error=!0,et},get isValidating(){return G.isValidating=!0,eu},get isLoading(){return G.isLoading=!0,ec}}}),ec=a.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}),ed={dedupe:!0};d.defineProperty(Y,"defaultValue",{value:G});let eh=en((e,t,r)=>{let{cache:n,compare:i,suspense:o,fallbackData:s,revalidateOnMount:u,revalidateIfStale:d,refreshInterval:g,refreshWhenHidden:m,refreshWhenOffline:v,keepPreviousData:k}=r,[y,S,w,P]=b.get(n),[O,E]=x(e),j=(0,a.useRef)(!1),U=(0,a.useRef)(!1),z=(0,a.useRef)(O),_=(0,a.useRef)(t),I=(0,a.useRef)(r),A=()=>I.current,N=()=>A().isVisible()&&A().isOnline(),[F,$,B,q]=C(n,O),G=(0,a.useRef)({}).current,J=h(s)?r.fallback[O]:s,K=(e,t)=>{for(let r in G)if("data"===r){if(!i(e[r],t[r])&&(!h(e[r])||!i(en,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},Y=(0,a.useMemo)(()=>{let e=!!O&&!!t&&(h(u)?!A().isPaused()&&!o&&(!!h(d)||d):u),r=t=>{let r=f(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=F(),i=q(),s=r(n),a=n===i?s:r(i),l=s;return[()=>{let e=r(F());return K(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>a]},[n,O]),Q=(0,l.useSyncExternalStore)((0,a.useCallback)(e=>B(O,(t,r)=>{K(r,t)||e()}),[n,O]),Y[0],Y[1]),X=!j.current,H=y[O]&&y[O].length>0,Z=Q.data,ee=h(Z)?J:Z,et=Q.error,er=(0,a.useRef)(ee),en=k?h(Z)?er.current:Z:ee,eo=(!H||!!h(et))&&(X&&!h(u)?u:!A().isPaused()&&(o?!h(ee)&&d:h(ee)||d)),es=!!(O&&t&&X&&eo),ea=h(Q.isValidating)?es:Q.isValidating,el=h(Q.isLoading)?es:Q.isLoading,eu=(0,a.useCallback)(async e=>{let t,n;let o=_.current;if(!O||!o||U.current||A().isPaused())return!1;let s=!0,a=e||{},l=!w[O]||!a.dedupe,u=()=>M?!U.current&&O===z.current&&j.current:O===z.current,d={isValidating:!1,isLoading:!1},f=()=>{$(d)},g=()=>{let e=w[O];e&&e[1]===n&&delete w[O]},m={isValidating:!0};h(F().data)&&(m.isLoading=!0);try{if(l&&($(m),r.loadingTimeout&&h(F().data)&&setTimeout(()=>{s&&u()&&A().onLoadingSlow(O,r)},r.loadingTimeout),w[O]=[o(E),V()]),[t,n]=w[O],t=await t,l&&setTimeout(g,r.dedupingInterval),!w[O]||w[O][1]!==n)return l&&u()&&A().onDiscarded(O),!1;d.error=c;let e=S[O];if(!h(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return f(),l&&u()&&A().onDiscarded(O),!1;let a=F().data;d.data=i(a,t)?a:t,l&&u()&&A().onSuccess(t,O,r)}catch(r){g();let e=A(),{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=r,l&&u()&&(e.onError(r,O,e),(!0===t||p(t)&&t(r))&&(!A().revalidateOnFocus||!A().revalidateOnReconnect||N())&&e.onErrorRetry(r,O,e,e=>{let t=y[O];t&&t[0]&&t[0](W.ERROR_REVALIDATE_EVENT,e)},{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return s=!1,f(),!0},[O,n]),eh=(0,a.useCallback)((...e)=>D(n,z.current,...e),[]);if(R(()=>{_.current=t,I.current=r,h(Z)||(er.current=Z)}),R(()=>{if(!O)return;let e=eu.bind(c,ed),t=0,r=ei(O,y,(r,n={})=>{if(r==W.FOCUS_EVENT){let r=Date.now();A().revalidateOnFocus&&r>t&&N()&&(t=r+A().focusThrottleInterval,e())}else if(r==W.RECONNECT_EVENT)A().revalidateOnReconnect&&N()&&e();else if(r==W.MUTATE_EVENT)return eu();else if(r==W.ERROR_REVALIDATE_EVENT)return eu(n)});return U.current=!1,z.current=O,j.current=!0,$({_k:E}),eo&&(h(ee)||L?e():T(e)),()=>{U.current=!0,r()}},[O]),R(()=>{let e;function t(){let t=p(g)?g(F().data):g;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!F().error&&(m||A().isVisible())&&(v||A().isOnline())?eu(ed).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[g,m,v,O]),(0,a.useDebugValue)(en),o&&h(ee)&&O){if(!M&&L)throw Error("Fallback data is required when using suspense in SSR.");_.current=t,I.current=r,U.current=!1;let e=P[O];if(h(e)||ec(eh(e)),h(et)){let e=eu(ed);h(en)||(e.status="fulfilled",e.value=!0),ec(e)}else throw et}return{mutate:eh,get data(){return G.data=!0,en},get error(){return G.error=!0,et},get isValidating(){return G.isValidating=!0,ea},get isLoading(){return G.isLoading=!0,el}}}),ep=e=>x(e?e(0,null):null)[0],ef=Promise.resolve(),eg=(n=e=>(t,r,n)=>{let i;let o=(0,a.useRef)(!1),{cache:s,initialSize:u=1,revalidateAll:d=!1,persistSize:f=!1,revalidateFirstPage:g=!0,revalidateOnMount:m=!1,parallel:v=!1}=n,[,,,k]=b.get(B);try{(i=ep(t))&&(i=Q+i)}catch(e){}let[y,S,w]=C(s,i),P=(0,a.useCallback)(()=>h(y()._l)?u:y()._l,[s,i,u]);(0,l.useSyncExternalStore)((0,a.useCallback)(e=>i?w(i,()=>{e()}):()=>{},[s,i]),P,P);let O=(0,a.useCallback)(()=>{let e=y()._l;return h(e)?u:e},[i,u]),E=(0,a.useRef)(O());R(()=>{if(!o.current){o.current=!0;return}i&&S({_l:f?E.current:O()})},[i,s]);let j=m&&!o.current,U=e(i,async e=>{let i=y()._i,o=y()._r;S({_r:c});let a=[],l=O(),[u]=C(s,e),p=u().data,f=[],m=null;for(let e=0;e<l;++e){let[l,u]=x(t(e,v?null:m));if(!l)break;let[c,b]=C(s,l),y=c().data,S=d||i||h(y)||g&&!e&&!h(p)||j||p&&!h(p[e])&&!n.compare(p[e],y);if(r&&("function"==typeof o?o(y,u):S)){let t=async()=>{if(l in k){let e=k[l];delete k[l],y=await e}else y=await r(u);b({data:y,_k:u}),a[e]=y};v?f.push(t):await t()}else a[e]=y;v||(m=y)}return v&&await Promise.all(f.map(e=>e())),S({_i:c}),a},n),z=(0,a.useCallback)(function(e,t){let r="boolean"==typeof t?{revalidate:t}:t||{},n=!1!==r.revalidate;return i?(n&&(h(e)?S({_i:!0,_r:r.revalidate}):S({_i:!1,_r:r.revalidate})),arguments.length?U.mutate(e,{...r,revalidate:n}):U.mutate()):ef},[i,s]),_=(0,a.useCallback)(e=>{let r;if(!i)return ef;let[,n]=C(s,i);if(p(e)?r=e(O()):"number"==typeof e&&(r=e),"number"!=typeof r)return ef;n({_l:r}),E.current=r;let o=[],[a]=C(s,i),l=null;for(let e=0;e<r;++e){let[r]=x(t(e,l)),[n]=C(s,r),i=r?n().data:c;if(h(i))return z(a().data);o.push(i),l=i}return z(o)},[i,s,z,O]);return{size:O(),setSize:_,mutate:z,get data(){return U.data},get error(){return U.error},get isValidating(){return U.isValidating},get isLoading(){return U.isLoading}}},(...e)=>{let[t,r,i]=Z(e),o=(i.use||[]).concat(n);return eh(t,r,{...i,use:o})});function em(e,t){if(!e)throw"string"==typeof t?Error(t):Error(`${t.displayName} not found`)}var ev=(e,t)=>{let{assertCtxFn:r=em}=t||{},n=a.createContext(void 0);return n.displayName=e,[n,()=>{let t=a.useContext(n);return r(t,`${e} not found`),t.value},()=>{let e=a.useContext(n);return e?e.value:{}}]},ek={};(0,s.r2)(ek,{SWRConfig:()=>el,useSWR:()=>eu,useSWRInfinite:()=>eg}),(0,s.yA)(ek,i);var[eb,ey]=ev("ClerkInstanceContext"),[eS,ew]=ev("UserContext"),[eP,eO]=ev("ClientContext"),[eE,eC]=ev("SessionContext"),[ej,eU]=ev("OrganizationContext"),ez=({children:e,organization:t,swrConfig:r})=>a.createElement(el,{value:r},a.createElement(ej.Provider,{value:{value:{organization:t}}},e));function e_(e){if(!a.useContext(eb)){if("function"==typeof e){e();return}throw Error(`${e} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`)}}function eM(e,t){let r=new Set(Object.keys(t)),n={};for(let t of Object.keys(e))r.has(t)||(n[t]=e[t]);return n}var eL=(e,t)=>{var r,n,i;let o="boolean"==typeof e&&e,s=(0,a.useRef)(o?t.initialPage:null!=(r=null==e?void 0:e.initialPage)?r:t.initialPage),l=(0,a.useRef)(o?t.pageSize:null!=(n=null==e?void 0:e.pageSize)?n:t.pageSize),u={};for(let r of Object.keys(t))u[r]=o?t[r]:null!=(i=null==e?void 0:e[r])?i:t[r];return{...u,initialPage:s.current,pageSize:l.current}},eT={dedupingInterval:6e4,focusThrottleInterval:12e4},eR=(e,t,r,n)=>{var i,o,s,l,u,c,d;let[h,p]=(0,a.useState)(null!=(i=e.initialPage)?i:1),f=(0,a.useRef)(null!=(o=e.initialPage)?o:1),g=(0,a.useRef)(null!=(s=e.pageSize)?s:10),m=null==(l=r.enabled)||l,v=null!=(u=r.infinite)&&u,k=null!=(c=r.keepPreviousData)&&c,b={...n,...e,initialPage:h,pageSize:g.current},{data:y,isValidating:S,isLoading:w,error:P,mutate:O}=eu(!v&&t&&m?b:null,e=>{let r=eM(e,n);return null==t?void 0:t(r)},{keepPreviousData:k,...eT}),{data:E,isLoading:C,isValidating:j,error:U,size:z,setSize:_,mutate:M}=eg(t=>v&&m?{...e,...n,initialPage:f.current+t,pageSize:g.current}:null,e=>{let r=eM(e,n);return null==t?void 0:t(r)},eT),L=(0,a.useMemo)(()=>v?z:h,[v,z,h]),T=(0,a.useCallback)(e=>{if(v){_(e);return}return p(e)},[_]),R=(0,a.useMemo)(()=>{var e,t;return v?null!=(e=null==E?void 0:E.map(e=>null==e?void 0:e.data).flat())?e:[]:null!=(t=null==y?void 0:y.data)?t:[]},[v,y,E]),I=(0,a.useMemo)(()=>{var e,t;return v?(null==(e=null==E?void 0:E[(null==E?void 0:E.length)-1])?void 0:e.total_count)||0:null!=(t=null==y?void 0:y.total_count)?t:0},[v,y,E]),A=v?C:w,x=v?j:S,N=null!=(d=v?U:P)?d:null,V=(0,a.useCallback)(()=>{T(e=>Math.max(0,e+1))},[T]),W=(0,a.useCallback)(()=>{T(e=>Math.max(0,e-1))},[T]),D=(f.current-1)*g.current,F=Math.ceil((I-D)/g.current),$=I-D*g.current>L*g.current,B=(L-1)*g.current>D*g.current,q=v?e=>M(e,{revalidate:!1}):e=>O(e,{revalidate:!1});return{data:R,count:I,error:N,isLoading:A,isFetching:x,isError:!!N,page:L,pageCount:F,fetchPage:T,fetchNext:V,fetchPrevious:W,hasNextPage:$,hasPreviousPage:B,revalidate:v?()=>M():()=>O(),setData:q}},eI={data:void 0,count:void 0,error:void 0,isLoading:!1,isFetching:!1,isError:!1,page:void 0,pageCount:void 0,fetchPage:void 0,fetchNext:void 0,fetchPrevious:void 0,hasNextPage:!1,hasPreviousPage:!1,revalidate:void 0,setData:void 0},eA=e=>{var t,r,n;let{domains:i,membershipRequests:s,memberships:a,invitations:l}=e||{};e_("useOrganization");let{organization:u}=eU(),c=eC(),d=eL(i,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,enrollmentMode:void 0}),h=eL(s,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),p=eL(a,{initialPage:1,pageSize:10,role:void 0,keepPreviousData:!1,infinite:!1}),f=eL(l,{initialPage:1,pageSize:10,status:["pending"],keepPreviousData:!1,infinite:!1}),g=ey();null==(t=g.telemetry)||t.record((0,o.J)("useOrganization"));let m=void 0===i?void 0:{initialPage:d.initialPage,pageSize:d.pageSize,enrollmentMode:d.enrollmentMode},v=void 0===s?void 0:{initialPage:h.initialPage,pageSize:h.pageSize,status:h.status},k=void 0===a?void 0:{initialPage:p.initialPage,pageSize:p.pageSize,role:p.role},b=void 0===l?void 0:{initialPage:f.initialPage,pageSize:f.pageSize,status:f.status},y=eR({...m},null==u?void 0:u.getDomains,{keepPreviousData:d.keepPreviousData,infinite:d.infinite,enabled:!!m},{type:"domains",organizationId:null==u?void 0:u.id}),S=eR({...v},null==u?void 0:u.getMembershipRequests,{keepPreviousData:h.keepPreviousData,infinite:h.infinite,enabled:!!v},{type:"membershipRequests",organizationId:null==u?void 0:u.id}),w=eR(k||{},null==u?void 0:u.getMemberships,{keepPreviousData:p.keepPreviousData,infinite:p.infinite,enabled:!!k},{type:"members",organizationId:null==u?void 0:u.id}),P=eR({...b},null==u?void 0:u.getInvitations,{keepPreviousData:f.keepPreviousData,infinite:f.infinite,enabled:!!b},{type:"invitations",organizationId:null==u?void 0:u.id});return void 0===u?{isLoaded:!1,organization:void 0,membership:void 0,domains:eI,membershipRequests:eI,memberships:eI,invitations:eI}:null===u?{isLoaded:!0,organization:null,membership:null,domains:null,membershipRequests:null,memberships:null,invitations:null}:!g.loaded&&u?{isLoaded:!0,organization:u,membership:void 0,domains:eI,membershipRequests:eI,memberships:eI,invitations:eI}:{isLoaded:g.loaded,organization:u,membership:(r=c.user.organizationMemberships,n=u.id,r.find(e=>e.organization.id===n)),domains:y,membershipRequests:S,memberships:w,invitations:P}},ex={data:void 0,count:void 0,error:void 0,isLoading:!1,isFetching:!1,isError:!1,page:void 0,pageCount:void 0,fetchPage:void 0,fetchNext:void 0,fetchPrevious:void 0,hasNextPage:!1,hasPreviousPage:!1,revalidate:void 0,setData:void 0},eN=e=>{var t;let{userMemberships:r,userInvitations:n,userSuggestions:i}=e||{};e_("useOrganizationList");let s=eL(r,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1}),a=eL(n,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),l=eL(i,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),u=ey(),c=ew();null==(t=u.telemetry)||t.record((0,o.J)("useOrganizationList"));let d=void 0===r?void 0:{initialPage:s.initialPage,pageSize:s.pageSize},h=void 0===n?void 0:{initialPage:a.initialPage,pageSize:a.pageSize,status:a.status},p=void 0===i?void 0:{initialPage:l.initialPage,pageSize:l.pageSize,status:l.status},f=!!(u.loaded&&c),g=eR(d||{},null==c?void 0:c.getOrganizationMemberships,{keepPreviousData:s.keepPreviousData,infinite:s.infinite,enabled:!!d},{type:"userMemberships",userId:null==c?void 0:c.id}),m=eR({...h},null==c?void 0:c.getOrganizationInvitations,{keepPreviousData:a.keepPreviousData,infinite:a.infinite,enabled:!!h},{type:"userInvitations",userId:null==c?void 0:c.id}),v=eR({...p},null==c?void 0:c.getOrganizationSuggestions,{keepPreviousData:l.keepPreviousData,infinite:l.infinite,enabled:!!p},{type:"userSuggestions",userId:null==c?void 0:c.id});return f?{isLoaded:f,setActive:u.setActive,createOrganization:u.createOrganization,userMemberships:g,userInvitations:m,userSuggestions:v}:{isLoaded:!1,createOrganization:void 0,setActive:void 0,userMemberships:ex,userInvitations:ex,userSuggestions:ex}};"undefined"!=typeof window?a.useLayoutEffect:a.useEffect;var eV=()=>{e_("useSession");let e=eC();return void 0===e?{isLoaded:!1,isSignedIn:void 0,session:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,session:null}:{isLoaded:!0,isSignedIn:!0,session:e}},eW=()=>{e_("useSessionList");let e=ey(),t=eO();return t?{isLoaded:!0,sessions:t.sessions,setActive:e.setActive}:{isLoaded:!1,sessions:void 0,setActive:void 0}};function eD(){e_("useUser");let e=ew();return void 0===e?{isLoaded:!1,isSignedIn:void 0,user:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:e}}var eF=()=>(e_("useClerk"),ey()),e$=Object.prototype.hasOwnProperty;function eB(e,t,r){for(r of e.keys())if(eq(r,t))return r}function eq(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&eq(e[n],t[n]););return -1===n}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if((i=n)&&"object"==typeof i&&!(i=eB(t,i))||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if((i=n[0])&&"object"==typeof i&&!(i=eB(t,i))||!eq(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return -1===n}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return -1===n}if(!r||"object"==typeof e){for(r in n=0,e)if(e$.call(e,r)&&++n&&!e$.call(t,r)||!(r in t)||!eq(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!=e&&t!=t}var eG=eq}}]);