(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,591431,e=>{"use strict";function t(e){return function(t){let r=t??this;if(!r)throw TypeError(`${e.kind||e.name} type guard requires an error object`);return r instanceof e}}var r=class{static kind="ClerkApiError";code;message;longMessage;meta;constructor(e){const t={code:e.code,message:e.message,longMessage:e.long_message,meta:{paramName:e.meta?.param_name,sessionId:e.meta?.session_id,emailAddresses:e.meta?.email_addresses,identifiers:e.meta?.identifiers,zxcvbn:e.meta?.zxcvbn,plan:e.meta?.plan,isPlanUpgradePossible:e.meta?.is_plan_upgrade_possible}};this.code=t.code,this.message=t.message,this.longMessage=t.longMessage,this.meta=t.meta}};function n(e=[]){return e.length>0?e.map(e=>new r(e)):[]}function i(e){return new r(e)}function o(e){return{code:e?.code||"",message:e?.message||"",long_message:e?.longMessage,meta:{param_name:e?.meta?.paramName,session_id:e?.meta?.sessionId,email_addresses:e?.meta?.emailAddresses,identifiers:e?.meta?.identifiers,zxcvbn:e?.meta?.zxcvbn,plan:e?.meta?.plan,is_plan_upgrade_possible:e?.meta?.isPlanUpgradePossible}}}t(r);var s=class e extends Error{static kind="ClerkError";clerkError=!0;code;longMessage;docsUrl;cause;get name(){return this.constructor.name}constructor(t){super(new.target.formatMessage(new.target.kind,t.message,t.code,t.docsUrl),{cause:t.cause}),Object.setPrototypeOf(this,e.prototype),this.code=t.code,this.docsUrl=t.docsUrl,this.longMessage=t.longMessage,this.cause=t.cause}toString(){return`[${this.name}]
Message:${this.message}`}static formatMessage(e,t,r,n){let i="Clerk:",o=RegExp(i.replace(" ","\\s*"),"i");return t=t.replace(o,""),t=`${i} ${t.trim()}

(code="${r}")

`,n&&(t+=`

Docs: ${n}`),t}},a=class e extends s{static kind="ClerkAPIResponseError";status;clerkTraceId;retryAfter;errors;constructor(t,n){const{data:i,status:o,clerkTraceId:s,retryAfter:a}=n;super({...n,message:t,code:"api_response_error"}),Object.setPrototypeOf(this,e.prototype),this.status=o,this.clerkTraceId=s,this.retryAfter=a,this.errors=(i||[]).map(e=>new r(e))}toString(){let e=`[${this.name}]
Message:${this.message}
Status:${this.status}
Serialized errors: ${this.errors.map(e=>JSON.stringify(e))}`;return this.clerkTraceId&&(e+=`
Clerk Trace ID: ${this.clerkTraceId}`),e}static formatMessage(e,t,r,n){return t}};let l=t(a),u=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 d({packageName:e,customMessages:t}){let r=e;function n(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}`}let i={...u,...t};return{setPackageName({packageName:e}){return"string"==typeof e&&(r=e),this},setMessages({customMessages:e}){return Object.assign(i,e||{}),this},throwInvalidPublishableKeyError(e){throw Error(n(i.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw Error(n(i.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw Error(n(i.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(n(i.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw Error(n(i.MissingClerkProvider,e))},throw(e){throw Error(n(e))}}}var c=class e extends Error{code;constructor(t){super(t),this.code=t,this.name="EmailLinkError",Object.setPrototypeOf(this,e.prototype)}};let h={Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"},p={Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"};var f=class e extends s{static kind="ClerkRuntimeError";clerkRuntimeError=!0;constructor(t,r){super({...r,message:t}),Object.setPrototypeOf(this,e.prototype)}};let g=t(f);var m=class extends f{code;constructor(e,{code:t}){super(e,{code:t}),this.code=t}};function v(e){let t=e?.status;return e?.errors?.[0]?.code==="authentication_invalid"&&401===t}function k(e){return["captcha_invalid","captcha_not_enabled","captcha_missing_token"].includes(e.errors[0].code)}function y(e){let t=e?.status;return!!t&&t>=400&&t<500}function b(e){return(`${e.message}${e.name}`||"").toLowerCase().replace(/\s+/g,"").includes("networkerror")}function _(e){return P(e)||E(e)||C(e)}function P(e){return e&&"clerkError"in e}function C(e){return"clerkRuntimeError"in e}function S(e){return C(e)&&"reverification_cancelled"===e.code}function E(e){return"code"in e&&[4001,32602,32603].includes(e.code)&&"message"in e}function w(e){return P(e)&&e.errors?.[0]?.code==="user_locked"}function O(e){return P(e)&&e.errors?.[0]?.code==="form_password_pwned"}function j(e){return P(e)&&e.errors?.[0]?.code==="form_password_compromised"}function M(e){return"EmailLinkError"===e.name}function I(e){for(let[t,r]of Object.entries({isClerkApiResponseError:l,isClerkRuntimeError:g}))Object.assign(e,{[t]:r});return e}e.s(["ClerkAPIError",()=>r,"ClerkAPIResponseError",()=>a,"ClerkError",()=>s,"ClerkRuntimeError",()=>f,"ClerkWebAuthnError",()=>m,"EmailLinkError",()=>c,"EmailLinkErrorCode",()=>h,"EmailLinkErrorCodeStatus",()=>p,"buildErrorThrower",()=>d,"createClerkGlobalHookError",()=>I,"errorToJSON",()=>o,"is4xxError",()=>y,"isCaptchaError",()=>k,"isClerkAPIResponseError",()=>P,"isClerkRuntimeError",()=>C,"isEmailLinkError",()=>M,"isKnownError",()=>_,"isMetamaskError",()=>E,"isNetworkError",()=>b,"isPasswordCompromisedError",()=>j,"isPasswordPwnedError",()=>O,"isReverificationCancelledError",()=>S,"isUnauthorizedError",()=>v,"isUserLockedError",()=>w,"parseError",()=>i,"parseErrors",()=>n])},399402,e=>{"use strict";let t={strict_mfa:{afterMinutes:10,level:"multi_factor"},strict:{afterMinutes:10,level:"second_factor"},moderate:{afterMinutes:60,level:"second_factor"},lax:{afterMinutes:1440,level:"second_factor"}},r=new Set(["first_factor","second_factor","multi_factor"]),n=new Set(["strict_mfa","strict","moderate","lax"]),i=(e,t)=>{let{org:r,user:n}=o(e),[i,s]=t.split(":"),a=s||i;return"org"===i?r.includes(a):"user"===i?n.includes(a):[...r,...n].includes(a)},o=e=>{let t=e?e.split(",").map(e=>e.trim()):[];return{org:t.filter(e=>e.split(":")[0].includes("o")).map(e=>e.split(":")[1]),user:t.filter(e=>e.split(":")[0].includes("u")).map(e=>e.split(":")[1])}},s=e=>{let i,o;if(!e)return!1;let s="string"==typeof e&&n.has(e),a="object"==typeof e&&(i=e.level,r.has(i))&&"number"==typeof(o=e.afterMinutes)&&o>0;return(!!s||!!a)&&(e=>"string"==typeof e?t[e]:e).bind(null,e)},a=e=>t=>{if(!e.userId)return!1;let r=((e,t)=>{let{features:r,plans:n}=t;return e.feature&&r?i(r,e.feature):e.plan&&n?i(n,e.plan):null})(t,e),n=((e,t)=>{let{orgId:r,orgRole:n,orgPermissions:i}=t;return(e.role||e.permission)&&r&&n&&i?e.permission?i.includes(e.permission.replace(/^(org:)*/,"org:")):e.role?n.replace(/^(org:)*/,"org:")===e.role.replace(/^(org:)*/,"org:"):null:null})(t,e),o=((e,{factorVerificationAge:t})=>{if(!e.reverification||!t)return null;let r=s(e.reverification);if(!r)return null;let{level:n,afterMinutes:i}=r(),[o,a]=t,l=-1!==o?i>o:null,u=-1!==a?i>a:null;switch(n){case"first_factor":return l;case"second_factor":return -1!==a?u:l;case"multi_factor":return -1===a?l:l&&u}})(t,e);return[r||n,o].some(e=>null===e)?[r||n,o].some(e=>!0===e):[r||n,o].every(e=>!0===e)},l=({authObject:{sessionId:e,sessionStatus:t,userId:r,actor:n,orgId:i,orgRole:o,orgSlug:s,signOut:a,getToken:l,has:u,sessionClaims:d},options:{treatPendingAsSignedOut:c=!0}})=>void 0===e&&void 0===r?{isLoaded:!1,isSignedIn:void 0,sessionId:e,sessionClaims:void 0,userId:r,actor:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,has:void 0,signOut:a,getToken:l}:null===e&&null===r?{isLoaded:!0,isSignedIn:!1,sessionId:e,userId:r,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:a,getToken:l}:c&&"pending"===t?{isLoaded:!0,isSignedIn:!1,sessionId:null,userId:null,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:a,getToken:l}:e&&d&&r&&i&&o?{isLoaded:!0,isSignedIn:!0,sessionId:e,sessionClaims:d,userId:r,actor:n||null,orgId:i,orgRole:o,orgSlug:s||null,has:u,signOut:a,getToken:l}:e&&d&&r&&!i?{isLoaded:!0,isSignedIn:!0,sessionId:e,sessionClaims:d,userId:r,actor:n||null,orgId:null,orgRole:null,orgSlug:null,has:u,signOut:a,getToken:l}:void 0;e.s(["createCheckAuthorization",()=>a,"resolveAuthState",()=>l,"splitByScope",()=>o,"validateReverificationConfig",()=>s])},855168,e=>{"use strict";var t=e.i(951672),r=e.i(151510),n=e.i(48641),i=class{#e;#t=864e5;constructor(e){this.#e=e}isEventThrottled(e){let t=Date.now(),r=this.#r(e),n=this.#e.getItem(r);return!!n&&!(t-n>this.#t)||(this.#e.setItem(r,t),!1)}#r(e){let{sk:t,pk:r,payload:n,...i}=e,o={...n,...i};return JSON.stringify(Object.keys({...n,...i}).sort().map(e=>o[e]))}},o=class{#n="clerk_telemetry_throttler";getItem(e){return this.#i()[e]}setItem(e,t){try{let r=this.#i();r[e]=t,localStorage.setItem(this.#n,JSON.stringify(r))}catch(e){e instanceof DOMException&&("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&localStorage.length>0&&localStorage.removeItem(this.#n)}}removeItem(e){try{let t=this.#i();delete t[e],localStorage.setItem(this.#n,JSON.stringify(t))}catch{}}#i(){try{let e=localStorage.getItem(this.#n);if(!e)return{};return JSON.parse(e)}catch{return{}}}static isSupported(){return"undefined"!=typeof window&&!!window.localStorage}},s=class{#e=new Map;#o=1e4;getItem(e){return this.#e.size>this.#o?void this.#e.clear():this.#e.get(e)}setItem(e,t){this.#e.set(e,t)}removeItem(e){this.#e.delete(e)}};let a=new Set(["error","warn","info","debug","trace"]);var l=class{#s;#a;#l={};#u=[];#d=null;constructor(e){this.#s={maxBufferSize:e.maxBufferSize??5,samplingRate:e.samplingRate??1,perEventSampling:e.perEventSampling??!0,disabled:e.disabled??!1,debug:e.debug??!1,endpoint:"https://clerk-telemetry.com"},e.clerkVersion||"undefined"!=typeof window?this.#l.clerkVersion=e.clerkVersion??"":this.#l.clerkVersion="",this.#l.sdk=e.sdk,this.#l.sdkVersion=e.sdkVersion,this.#l.publishableKey=e.publishableKey??"";const t=(0,r.parsePublishableKey)(e.publishableKey);t&&(this.#l.instanceType=t.instanceType),e.secretKey&&(this.#l.secretKey=e.secretKey.substring(0,16)),this.#a=new i(o.isSupported()?new o:new s)}get isEnabled(){return!("development"!==this.#l.instanceType||this.#s.disabled||void 0!==t.default&&t.default.env&&(0,n.isTruthy)(t.default.env.CLERK_TELEMETRY_DISABLED)||"undefined"!=typeof window&&window?.navigator?.webdriver)}get isDebug(){return this.#s.debug||void 0!==t.default&&t.default.env&&(0,n.isTruthy)(t.default.env.CLERK_TELEMETRY_DEBUG)}record(e){try{let t=this.#c(e.event,e.payload);if(this.#h(t.event,t),!this.#p(t,e.eventSamplingRate))return;this.#u.push({kind:"event",value:t}),this.#f()}catch(e){console.error("[clerk/telemetry] Error recording telemetry event",e)}}recordLog(e){try{if(!this.#g(e))return;let t="string"==typeof e?.level&&a.has(e.level),r="string"==typeof e?.message&&e.message.trim().length>0,n=null,i=e?.timestamp;if("number"==typeof i||"string"==typeof i){let e=new Date(i);Number.isNaN(e.getTime())||(n=e)}if(!t||!r||null===n){this.isDebug&&"undefined"!=typeof console&&console.warn("[clerk/telemetry] Dropping invalid telemetry log entry",{levelIsValid:t,messageIsValid:r,timestampIsValid:null!==n});return}let o=this.#m(),s={sdk:o.name,sdkv:o.version,cv:this.#l.clerkVersion??"",lvl:e.level,msg:e.message,ts:n.toISOString(),pk:this.#l.publishableKey||null,payload:this.#v(e.context)};this.#u.push({kind:"log",value:s}),this.#f()}catch(e){console.error("[clerk/telemetry] Error recording telemetry log entry",e)}}#p(e,t){return this.isEnabled&&!this.isDebug&&this.#k(e,t)}#g(e){return!0}#k(e,t){let r=Math.random();return!!(r<=this.#s.samplingRate&&(!1===this.#s.perEventSampling||void 0===t||r<=t))&&!this.#a.isEventThrottled(e)}#f(){if("undefined"==typeof window)return void this.#y();if(this.#u.length>=this.#s.maxBufferSize){this.#d&&("undefined"!=typeof cancelIdleCallback?cancelIdleCallback(Number(this.#d)):clearTimeout(Number(this.#d))),this.#y();return}this.#d||("requestIdleCallback"in window?this.#d=requestIdleCallback(()=>{this.#y(),this.#d=null}):this.#d=setTimeout(()=>{this.#y(),this.#d=null},0))}#y(){let e=[...this.#u];if(this.#u=[],this.#d=null,0===e.length)return;let t=e.filter(e=>"event"===e.kind).map(e=>e.value),r=e.filter(e=>"log"===e.kind).map(e=>e.value);t.length>0&&fetch(new URL("/v1/event",this.#s.endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({events:t})}).catch(()=>void 0),r.length>0&&fetch(new URL("/v1/logs",this.#s.endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({logs:r})}).catch(()=>void 0)}#h(e,t){this.isDebug&&(void 0!==console.groupCollapsed?(console.groupCollapsed("[clerk/telemetry]",e),console.log(t),console.groupEnd()):console.log("[clerk/telemetry]",e,t))}#m(){let e={name:this.#l.sdk,version:this.#l.sdkVersion};if("undefined"!=typeof window){let t=window;if(t.Clerk){let r=t.Clerk;if("object"==typeof r&&null!==r&&"constructor"in r&&"function"==typeof r.constructor&&r.constructor.sdkMetadata){let{name:t,version:n}=r.constructor.sdkMetadata;void 0!==t&&(e.name=t),void 0!==n&&(e.version=n)}}}return e}#c(e,t){let r=this.#m();return{event:e,cv:this.#l.clerkVersion??"",it:this.#l.instanceType??"",sdk:r.name,sdkv:r.version,...this.#l.publishableKey?{pk:this.#l.publishableKey}:{},...this.#l.secretKey?{sk:this.#l.secretKey}:{},payload:t}}#v(e){if(null==e||"object"!=typeof e)return null;try{let t=JSON.parse(JSON.stringify(e));if(t&&"object"==typeof t&&!Array.isArray(t))return t;return null}catch{return null}}};let u="COMPONENT_MOUNTED",d=new Set(["SignIn","SignUp"]);function c(e){return d.has(e)?1:.1}function h(e){return function(t,r,n){return{event:e,eventSamplingRate:e===u?c(t):.1,payload:{component:t,appearanceProp:!!r?.appearance,baseTheme:!!r?.appearance?.baseTheme,elements:!!r?.appearance?.elements,variables:!!r?.appearance?.variables,...n}}}}function p(e,t,r){return h(u)(e,t,r)}function f(e,t,r){return h("COMPONENT_OPENED")(e,t,r)}function g(e,t={}){return{event:u,eventSamplingRate:c(e),payload:{component:e,...t}}}function m(e,t){return{event:"METHOD_CALLED",eventSamplingRate:.1,payload:{method:e,...t}}}function v(e){return{event:"FRAMEWORK_METADATA",eventSamplingRate:.1,payload:e}}let k="THEME_USAGE";function y(e){return{event:k,eventSamplingRate:1,payload:function(e){let t;if(!e||"object"!=typeof e)return{};let r=e.theme||e.baseTheme;if(!r)return{};if(Array.isArray(r))for(let e of r){let r=b(e);if(r){t=r;break}}else t=b(r);return{themeName:t}}(e)}}function b(e){return"string"==typeof e?e:"object"==typeof e&&null!==e&&"name"in e&&"string"==typeof e.name?e.name:void 0}e.s(["EVENT_SAMPLING_RATE",()=>1,"EVENT_THEME_USAGE",()=>k,"TelemetryCollector",()=>l,"eventComponentMounted",()=>g,"eventFrameworkMetadata",()=>v,"eventMethodCalled",()=>m,"eventPrebuiltComponentMounted",()=>p,"eventPrebuiltComponentOpened",()=>f,"eventThemeUsage",()=>y])},954772,e=>{"use strict";let t="reverification-error",r=e=>({clerk_error:{type:"forbidden",reason:t,metadata:{reverification:e}}}),n=e=>e&&"object"==typeof e&&"clerk_error"in e&&e.clerk_error?.type==="forbidden"&&e.clerk_error?.reason===t;e.s(["isReverificationHint",()=>n,"reverificationError",()=>r])},56099,e=>{"use strict";function t(e,t){return e.find(e=>e.organization.id===t)}e.s(["getCurrentOrganizationMembership",()=>t])},501829,(e,t,r)=>{"use strict";var n=e.r(136357),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 d="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,d=n[1];return a(function(){i.value=r,i.getSnapshot=t,u(i)&&d({inst:i})},[e,r,t]),s(function(){return u(i)&&d({inst:i}),e(function(){u(i)&&d({inst:i})})},[e]),l(r),r};r.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:d},129360,(e,t,r)=>{"use strict";t.exports=e.r(501829)},562066,294044,232749,698821,495291,352581,340185,527012,635025,876726,89922,691779,674673,561247,e=>{"use strict";var t=e.i(136357),r=e.i(129360);e.s(["ERROR_REVALIDATE_EVENT",()=>3,"FOCUS_EVENT",()=>0,"MUTATE_EVENT",()=>2,"RECONNECT_EVENT",()=>1],603736);var n=Object.prototype.hasOwnProperty;let i=new WeakMap,o=()=>{},s=o(),a=Object,l=e=>e===s,u=e=>"function"==typeof e,d=(e,t)=>({...e,...t}),c=e=>u(e.then),h={},p={},f="undefined",g=typeof window!=f,m=typeof document!=f,v=g&&"Deno"in window,k=(e,t)=>{let r=i.get(e);return[()=>!l(t)&&e.get(t)||h,n=>{if(!l(t)){let i=e.get(t);t in p||(p[t]=i),r[5](t,d(i,n),i||h)}},r[6],()=>!l(t)&&t in p?p[t]:!l(t)&&e.get(t)||h]},y=!0,[b,_]=g&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[o,o],P={initFocus:e=>(m&&document.addEventListener("visibilitychange",e),b("focus",e),()=>{m&&document.removeEventListener("visibilitychange",e),_("focus",e)}),initReconnect:e=>{let t=()=>{y=!0,e()},r=()=>{y=!1};return b("online",t),b("offline",r),()=>{_("online",t),_("offline",r)}}},C=!t.default.useId,S=!g||v,E=e=>g&&typeof window.requestAnimationFrame!=f?window.requestAnimationFrame(e):setTimeout(e,1),w=S?t.useEffect:t.useLayoutEffect,O="undefined"!=typeof navigator&&navigator.connection,j=!S&&O&&(["slow-2g","2g"].includes(O.effectiveType)||O.saveData),M=new WeakMap,I=(e,t)=>e===`[object ${t}]`,U=0,z=e=>{let t,r,n=typeof e,i=a.prototype.toString.call(e),o=I(i,"Date"),s=I(i,"RegExp"),u=I(i,"Object");if(a(e)!==e||o||s)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=M.get(e))return t;if(t=++U+"~",M.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=z(e[r])+",";M.set(e,t)}if(u){t="#";let n=a.keys(e).sort();for(;!l(r=n.pop());)l(e[r])||(t+=r+":"+z(e[r])+",");M.set(e,t)}}return t},T=e=>{if(u(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?z(e):"",t]},R=0,A=()=>++R;async function L(...e){let[t,r,n,o]=e,a=d({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{}),h=a.populateCache,p=a.rollbackOnError,f=a.optimisticData,g=a.throwOnError;if(u(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 o,[d]=T(r);if(!d)return;let[m,v]=k(t,d),[y,b,_,P]=i.get(t),C=()=>{let e=y[d];return(u(a.revalidate)?a.revalidate(m().data,r):!1!==a.revalidate)&&(delete _[d],delete P[d],e&&e[0])?e[0](2).then(()=>m().data):m().data};if(e.length<3)return C();let S=n,E=!1,w=A();b[d]=[w,0];let O=!l(f),j=m(),M=j.data,I=j._c,U=l(I)?M:I;if(O&&v({data:f=u(f)?f(U,M):f,_c:U}),u(S))try{S=S(U)}catch(e){o=e,E=!0}if(S&&c(S)){let e;if(S=await S.catch(e=>{o=e,E=!0}),w!==b[d][0]){if(E)throw o;return S}E&&O&&(e=o,"function"==typeof p?p(e):!1!==p)&&(h=!0,v({data:U,_c:s}))}if(h&&!E&&(u(h)?v({data:h(S,U),error:s,_c:s}):v({data:S,error:s,_c:s})),b[d][1]=A(),Promise.resolve(C()).then(()=>{v({_c:s})}),E){if(g)throw o;return}return S}}let x=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},N=(e,t)=>{if(!i.has(e)){let r=d(P,t),n=Object.create(null),a=L.bind(s,e),l=o,u=Object.create(null),c=(e,t)=>{let r=u[e]||[];return u[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},h=(t,r,n)=>{e.set(t,r);let i=u[t];if(i)for(let e of i)e(r,n)},p=()=>{if(!i.has(e)&&(i.set(e,[n,Object.create(null),Object.create(null),Object.create(null),a,h,c]),!S)){let t=r.initFocus(setTimeout.bind(s,x.bind(s,n,0))),o=r.initReconnect(setTimeout.bind(s,x.bind(s,n,1)));l=()=>{t&&t(),o&&o(),i.delete(e)}}};return p(),[e,a,p,l]}return[e,i.get(e)[4]]},[D,W]=N(new Map),F=d({onLoadingSlow:o,onSuccess:o,onError:o,onErrorRetry:(e,t,r,n,i)=>{let o=r.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*r.errorRetryInterval;(l(o)||!(s>o))&&setTimeout(n,a,i)},onDiscarded:o,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:j?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:j?5e3:3e3,compare:function e(t,r){var i,o;if(t===r)return!0;if(t&&r&&(i=t.constructor)===r.constructor){if(i===Date)return t.getTime()===r.getTime();if(i===RegExp)return t.toString()===r.toString();if(i===Array){if((o=t.length)===r.length)for(;o--&&e(t[o],r[o]););return -1===o}if(!i||"object"==typeof t){for(i in o=0,t)if(n.call(t,i)&&++o&&!n.call(r,i)||!(i in r)||!e(t[i],r[i]))return!1;return Object.keys(r).length===o}}return t!=t&&r!=r},isPaused:()=>!1,cache:D,mutate:W,fallback:{}},{isOnline:()=>y,isVisible:()=>{let e=m&&document.visibilityState;return l(e)||"hidden"!==e}}),B=(e,t)=>{let r=d(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=d(i,s))}return r},K=(0,t.createContext)({}),V=e=>{let{value:r}=e,n=(0,t.useContext)(K),i=u(r),o=(0,t.useMemo)(()=>i?r(n):r,[i,n,r]),a=(0,t.useMemo)(()=>i?o:B(n,o),[i,n,o]),l=o&&o.provider,c=(0,t.useRef)(s);l&&!c.current&&(c.current=N(l(a.cache||D),o));let h=c.current;return h&&(a.cache=h[0],a.mutate=h[1]),w(()=>{if(h)return h[2]&&h[2](),h[3]},[]),(0,t.createElement)(K.Provider,d(e,{value:a}))};e.s(["B",()=>c,"I",()=>C,"O",()=>a,"S",()=>K,"U",()=>s,"a",()=>u,"b",()=>i,"c",()=>D,"d",()=>F,"e",()=>l,"f",()=>B,"g",()=>V,"i",()=>g,"m",()=>d,"n",()=>L,"o",()=>A,"r",()=>S,"s",()=>T,"t",()=>E,"u",()=>w,"z",()=>k],294044);var $=e.i(603736);let q="$inf$";e.s(["INFINITE_PREFIX",()=>q],232749);let G=g&&window.__SWR_DEVTOOLS_USE__,J=G?window.__SWR_DEVTOOLS_USE__:[],H=e=>u(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],Y=()=>d(F,(0,t.useContext)(K)),X=J.concat(e=>(t,r,n)=>{let o=r&&((...e)=>{let[n]=T(t),[,,,o]=i.get(D);if(n.startsWith(q))return r(...e);let s=o[n];return l(s)?r(...e):(delete o[n],s)});return e(t,o,n)}),Q=e=>function(...t){let r=Y(),[n,i,o]=H(t),s=B(r,o),a=e,{use:l}=s,u=(l||[]).concat(X);for(let e=u.length;e--;)a=u[e](a);return a(n,i||s.fetcher||null,s)},Z=(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())}},ee=(e,t)=>(...r)=>{let[n,i,o]=H(r),s=(o.use||[]).concat(t);return e(n,i,{...o,use:s})};G&&(window.__SWR_DEVTOOLS_REACT__=t.default),e.s(["subscribeCallback",()=>Z,"useSWRConfig",()=>Y,"withArgs",()=>Q,"withMiddleware",()=>ee],698821),e.s(["SWRGlobalState",()=>i],495291),e.s(["serialize",()=>T],352581),e.s(["createCacheHelper",()=>k],340185),e.s(["isUndefined",()=>l],527012),e.s(["UNDEFINED",()=>s],635025),e.s(["getTimestamp",()=>A],876726),e.s(["isFunction",()=>u],89922);e.s(["useIsomorphicLayoutEffect",()=>w],691779),e.s(["IS_REACT_LEGACY",()=>C],674673),e.s(["mergeObjects",()=>d],561247);let et=()=>{},er=et(),en=(new WeakMap,t.default.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}})),ei={dedupe:!0},eo=a.defineProperty(V,"defaultValue",{value:F}),es=Q((e,n,o)=>{let{cache:a,compare:h,suspense:p,fallbackData:f,revalidateOnMount:g,revalidateIfStale:m,refreshInterval:v,refreshWhenHidden:y,refreshWhenOffline:b,keepPreviousData:_}=o,[P,O,j,M]=i.get(a),[I,U]=T(e),z=(0,t.useRef)(!1),R=(0,t.useRef)(!1),x=(0,t.useRef)(I),N=(0,t.useRef)(n),D=(0,t.useRef)(o),W=()=>D.current.isVisible()&&D.current.isOnline(),[F,B,K,V]=k(a,I),q=(0,t.useRef)({}).current,G=l(f)?l(o.fallback)?s:o.fallback[I]:f,J=(e,t)=>{for(let r in q)if("data"===r){if(!h(e[r],t[r])&&(!l(e[r])||!h(es,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},H=(0,t.useMemo)(()=>{let e=!!I&&!!n&&(l(g)?!D.current.isPaused()&&!p&&!1!==m:g),t=t=>{let r=d(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},r=F(),i=V(),o=t(r),s=r===i?o:t(i),a=o;return[()=>{let e=t(F());return J(e,a)?(a.data=e.data,a.isLoading=e.isLoading,a.isValidating=e.isValidating,a.error=e.error,a):(a=e,e)},()=>s]},[a,I]),Y=(0,r.useSyncExternalStore)((0,t.useCallback)(e=>K(I,(t,r)=>{J(r,t)||e()}),[a,I]),H[0],H[1]),X=!z.current,Q=P[I]&&P[I].length>0,ee=Y.data,et=l(ee)?G&&c(G)?en(G):G:ee,er=Y.error,eo=(0,t.useRef)(et),es=_?l(ee)?l(eo.current)?et:eo.current:ee:et,ea=(!Q||!!l(er))&&(X&&!l(g)?g:!D.current.isPaused()&&(p?!l(et)&&m:l(et)||m)),el=!!(I&&n&&X&&ea),eu=l(Y.isValidating)?el:Y.isValidating,ed=l(Y.isLoading)?el:Y.isLoading,ec=(0,t.useCallback)(async e=>{let t,r,n=N.current;if(!I||!n||R.current||D.current.isPaused())return!1;let i=!0,a=e||{},d=!j[I]||!a.dedupe,c=()=>C?!R.current&&I===x.current&&z.current:I===x.current,p={isValidating:!1,isLoading:!1},f=()=>{B(p)},g=()=>{let e=j[I];e&&e[1]===r&&delete j[I]},m={isValidating:!0};l(F().data)&&(m.isLoading=!0);try{if(d&&(B(m),o.loadingTimeout&&l(F().data)&&setTimeout(()=>{i&&c()&&D.current.onLoadingSlow(I,o)},o.loadingTimeout),j[I]=[n(U),A()]),[t,r]=j[I],t=await t,d&&setTimeout(g,o.dedupingInterval),!j[I]||j[I][1]!==r)return d&&c()&&D.current.onDiscarded(I),!1;p.error=s;let e=O[I];if(!l(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return f(),d&&c()&&D.current.onDiscarded(I),!1;let a=F().data;p.data=h(a,t)?a:t,d&&c()&&D.current.onSuccess(t,I,o)}catch(r){g();let e=D.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(p.error=r,d&&c()&&(e.onError(r,I,e),(!0===t||u(t)&&t(r))&&(!D.current.revalidateOnFocus||!D.current.revalidateOnReconnect||W())&&e.onErrorRetry(r,I,e,e=>{let t=P[I];t&&t[0]&&t[0]($.ERROR_REVALIDATE_EVENT,e)},{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return i=!1,f(),!0},[I,a]),eh=(0,t.useCallback)((...e)=>L(a,x.current,...e),[]);if(w(()=>{N.current=n,D.current=o,l(ee)||(eo.current=ee)}),w(()=>{if(!I)return;let e=ec.bind(s,ei),t=0;D.current.revalidateOnFocus&&(t=Date.now()+D.current.focusThrottleInterval);let r=Z(I,P,(r,n={})=>{if(r==$.FOCUS_EVENT){let r=Date.now();D.current.revalidateOnFocus&&r>t&&W()&&(t=r+D.current.focusThrottleInterval,e())}else if(r==$.RECONNECT_EVENT)D.current.revalidateOnReconnect&&W()&&e();else if(r==$.MUTATE_EVENT)return ec();else if(r==$.ERROR_REVALIDATE_EVENT)return ec(n)});return R.current=!1,x.current=I,z.current=!0,B({_k:U}),ea&&!j[I]&&(l(et)||S?e():E(e)),()=>{R.current=!0,r()}},[I]),w(()=>{let e;function t(){let t=u(v)?v(F().data):v;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!F().error&&(y||D.current.isVisible())&&(b||D.current.isOnline())?ec(ei).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[v,y,b,I]),(0,t.useDebugValue)(es),p&&l(et)&&I){if(!C&&S)throw Error("Fallback data is required when using Suspense in SSR.");N.current=n,D.current=o,R.current=!1;let e=M[I];if(l(e)||en(eh(e)),l(er)){let e=ec(ei);l(es)||(e.status="fulfilled",e.value=!0),en(e)}else throw er}return{mutate:eh,get data(){return q.data=!0,es},get error(){return q.error=!0,er},get isValidating(){return q.isValidating=!0,eu},get isLoading(){return q.isLoading=!0,ed}}});e.s(["SWRConfig",()=>eo,"default",()=>es],562066)},423528,e=>{"use strict";let t,r;e.i(767303),e.i(398883),e.i(400484),e.i(151510);var n,i,o=e.i(954772),s=e.i(399402),a=e.i(591431);e.i(158558);var l=e.i(100856);e.i(48641);var u=e.i(56099),d=e.i(855168),c=e.i(136357),h=e.i(562066),p=e.i(698821),f=e.i(495291),g=e.i(294044),g=g,m=e.i(232749),v=e.i(340185),k=e.i(527012),y=e.i(691779),b=e.i(635025),_=e.i(352581),P=e.i(89922),C=e.i(129360);let S=()=>{},E=S(),w=Object,O=e=>e===E,j=new WeakMap,M=(e,t)=>e===`[object ${t}]`,I=0,U=e=>{let t,r,n=typeof e,i=w.prototype.toString.call(e),o=M(i,"Date"),s=M(i,"RegExp"),a=M(i,"Object");if(w(e)!==e||o||s)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=j.get(e))return t;if(t=++I+"~",j.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=U(e[r])+",";j.set(e,t)}if(a){t="#";let n=w.keys(e).sort();for(;!O(r=n.pop());)O(e[r])||(t+=r+":"+U(e[r])+",");j.set(e,t)}}return t},z=Promise.resolve(),T=(0,p.withMiddleware)(h.default,e=>(t,r,n)=>{let i,o=(0,c.useRef)(!1),{cache:s,initialSize:a=1,revalidateAll:l=!1,persistSize:u=!1,revalidateFirstPage:d=!0,revalidateOnMount:h=!1,parallel:p=!1}=n,[,,,S]=f.SWRGlobalState.get(g.c);try{(i=(e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?U(e):"",t]})(t?t(0,null):null)[0])&&(i=m.INFINITE_PREFIX+i)}catch(e){}let[E,w,O]=(0,v.createCacheHelper)(s,i),j=(0,c.useCallback)(()=>(0,k.isUndefined)(E()._l)?a:E()._l,[s,i,a]);(0,C.useSyncExternalStore)((0,c.useCallback)(e=>i?O(i,()=>{e()}):()=>{},[s,i]),j,j);let M=(0,c.useCallback)(()=>{let e=E()._l;return(0,k.isUndefined)(e)?a:e},[i,a]),I=(0,c.useRef)(M());(0,y.useIsomorphicLayoutEffect)(()=>{if(!o.current){o.current=!0;return}i&&w({_l:u?I.current:M()})},[i,s]);let T=h&&!o.current,R=e(i,async e=>{let i=E()._i,o=E()._r;w({_r:b.UNDEFINED});let a=[],u=M(),[c]=(0,v.createCacheHelper)(s,e),h=c().data,f=[],g=null;for(let e=0;e<u;++e){let[u,c]=(0,_.serialize)(t(e,p?null:g));if(!u)break;let[m,y]=(0,v.createCacheHelper)(s,u),b=m().data,P=l||i||(0,k.isUndefined)(b)||d&&!e&&!(0,k.isUndefined)(h)||T||h&&!(0,k.isUndefined)(h[e])&&!n.compare(h[e],b);if(r&&("function"==typeof o?o(b,c):P)){let t=async()=>{if(u in S){let e=S[u];delete S[u],b=await e}else b=await r(c);y({data:b,_k:c}),a[e]=b};p?f.push(t):await t()}else a[e]=b;p||(g=b)}return p&&await Promise.all(f.map(e=>e())),w({_i:b.UNDEFINED}),a},n),A=(0,c.useCallback)(function(e,t){let r="boolean"==typeof t?{revalidate:t}:t||{},n=!1!==r.revalidate;return i?(n&&((0,k.isUndefined)(e)?w({_i:!0,_r:r.revalidate}):w({_i:!1,_r:r.revalidate})),arguments.length?R.mutate(e,{...r,revalidate:n}):R.mutate()):z},[i,s]),L=(0,c.useCallback)(e=>{let r;if(!i)return z;let[,n]=(0,v.createCacheHelper)(s,i);if((0,P.isFunction)(e)?r=e(M()):"number"==typeof e&&(r=e),"number"!=typeof r)return z;n({_l:r}),I.current=r;let o=[],[a]=(0,v.createCacheHelper)(s,i),l=null;for(let e=0;e<r;++e){let[r]=(0,_.serialize)(t(e,l)),[n]=(0,v.createCacheHelper)(s,r),i=r?n().data:b.UNDEFINED;if((0,k.isUndefined)(i))return A(a().data);o.push(i),l=i}return A(o)},[i,s,A,M]);return{size:M(),setSize:L,mutate:A,get data(){return R.data},get error(){return R.error},get isValidating(){return R.isValidating},get isLoading(){return R.isLoading}}});var R=Object.prototype.hasOwnProperty;function A(e,t,r){for(r of e.keys())if(L(r,t))return r}function L(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--&&L(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=A(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=A(t,i))||!L(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(R.call(e,r)&&++n&&!R.call(t,r)||!(r in t)||!L(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!=e&&t!=t}var x=e.i(674673),N=e.i(561247),D=e.i(876726);let W=x.IS_REACT_LEGACY?e=>{e()}:c.default.startTransition,F=(0,p.withMiddleware)(h.default,()=>(e,t,r={})=>{let{mutate:n}=(0,p.useSWRConfig)(),i=(0,c.useRef)(e),o=(0,c.useRef)(t),s=(0,c.useRef)(r),a=(0,c.useRef)(0),[l,u,d]=(e=>{let[,t]=(0,c.useState)({}),r=(0,c.useRef)(!1),n=(0,c.useRef)(e),i=(0,c.useRef)({data:!1,error:!1,isValidating:!1}),o=(0,c.useCallback)(e=>{let o=!1,s=n.current;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&s[t]!==e[t]&&(s[t]=e[t],i.current[t]&&(o=!0));o&&!r.current&&t({})},[]);return(0,y.useIsomorphicLayoutEffect)(()=>(r.current=!1,()=>{r.current=!0})),[n,i.current,o]})({data:b.UNDEFINED,error:b.UNDEFINED,isMutating:!1}),h=l.current,f=(0,c.useCallback)(async(e,t)=>{let[r,l]=(0,_.serialize)(i.current);if(!o.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!r)throw Error("Can’t trigger the mutation: missing key.");let u=(0,N.mergeObjects)((0,N.mergeObjects)({populateCache:!1,throwOnError:!0},s.current),t),c=(0,D.getTimestamp)();a.current=c,d({isMutating:!0});try{let t=await n(r,o.current(l,{arg:e}),(0,N.mergeObjects)(u,{throwOnError:!0}));return a.current<=c&&(W(()=>d({data:t,isMutating:!1,error:void 0})),null==u.onSuccess||u.onSuccess.call(u,t,r,u)),t}catch(e){if(a.current<=c&&(W(()=>d({error:e,isMutating:!1})),null==u.onError||u.onError.call(u,e,r,u),u.throwOnError))throw e}},[]),g=(0,c.useCallback)(()=>{a.current=(0,D.getTimestamp)(),d({data:b.UNDEFINED,error:b.UNDEFINED,isMutating:!1})},[]);return(0,y.useIsomorphicLayoutEffect)(()=>{i.current=e,o.current=t,s.current=r}),{trigger:f,reset:g,get data(){return u.data=!0,h.data},get error(){return u.error=!0,h.error},get isMutating(){return u.isMutating=!0,h.isMutating}}});function B(e,t){if(!e)throw"string"==typeof t?Error(t):Error(`${t.displayName} not found`)}let K=(e,t)=>{let{assertCtxFn:r=B}=t||{},n=c.default.createContext(void 0);return n.displayName=e,[n,()=>{let t=c.default.useContext(n);return r(t,`${e} not found`),t.value},()=>{let e=c.default.useContext(n);return e?e.value:{}}]};function V({swrConfig:e,children:t}){return c.default.createElement(h.SWRConfig,{value:e},t)}let[$,q]=K("ClerkInstanceContext"),[G,J]=K("UserContext"),[H,Y]=K("ClientContext"),[X,Q]=K("SessionContext");c.default.createContext({});let[Z,ee]=K("CheckoutContext"),et=({children:e,...t})=>c.default.createElement(Z.Provider,{value:{value:t}},e),[er,en]=K("OrganizationContext"),ei=({children:e,organization:t,swrConfig:r})=>c.default.createElement(V,{swrConfig:r},c.default.createElement(er.Provider,{value:{value:{organization:t}}},e));function eo(e){if(!c.default.useContext($)){if("function"==typeof e)return void e();throw Error(`${e} can only be used within the <ClerkProvider /> component.

Possible fixes:
1. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used.
2. Check for multiple versions of the \`@clerk/shared\` package in your project. Use a tool like \`npm ls @clerk/shared\` to identify multiple versions, and update your dependencies to only rely on one.

Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}function es(e){return{queryKey:[e.stablePrefix,e.authenticated,e.tracked,e.untracked],invalidationKey:[e.stablePrefix,e.authenticated,e.tracked],stableKey:e.stablePrefix,authenticated:e.authenticated}}function ea(e){let{queryKey:t}=e;return{type:t[0],...t[2],...t[3].args}}let el=(e,t)=>{let r="boolean"==typeof e&&e,n=(0,c.useRef)(r?t.initialPage:e?.initialPage??t.initialPage),i=(0,c.useRef)(r?t.pageSize:e?.pageSize??t.pageSize),o={};for(let n of Object.keys(t))o[n]=r?t[n]:e?.[n]??t[n];return{...o,initialPage:n.current,pageSize:i.current}};function eu(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}let ed={dedupingInterval:6e4,focusThrottleInterval:12e4},ec={...ed,revalidateFirstPage:!1},eh=e=>{let t,r,{fetcher:n,config:i,keys:o}=e,[s,a]=(0,c.useState)(i.initialPage??1),l=(0,c.useRef)(i.initialPage??1),u=(0,c.useRef)(i.pageSize??10),d=i.enabled??!0,p="cache"===i.__experimental_mode,f=i.infinite??!1,g=i.keepPreviousData??!1,m=i.isSignedIn,v={...ea(o),initialPage:s,pageSize:u.current},k=(t=(0,c.useRef)(m),r=(0,c.useRef)(null),t.current!==m&&(r.current=t.current,t.current=m),r.current),y=!f&&d&&(!!p||!!n),{data:b,isValidating:_,isLoading:P,error:C,mutate:S}=(0,h.default)("boolean"==typeof m?!0===k&&!1===m||m&&y?v:null:y?v:null,!p&&n?e=>!1===m||!1===y?null:n(eu(e,{type:o.queryKey[0],...o.queryKey[2]})):null,{keepPreviousData:g,...ed}),{data:E,isLoading:w,isValidating:O,error:j,size:M,setSize:I,mutate:U}=T(e=>f&&d&&!1!==m?{...ea(o),initialPage:l.current+e,pageSize:u.current}:null,e=>{let t=eu(e,{type:o.queryKey[0],...o.queryKey[2]});return n?.(t)},ec),z=(0,c.useMemo)(()=>f?M:s,[f,M,s]),R=(0,c.useCallback)(e=>f?void I(e):a(e),[I,f]),A=(0,c.useMemo)(()=>f?E?.map(e=>e?.data).flat()??[]:b?.data??[],[f,b,E]),L=(0,c.useMemo)(()=>f?E?.[E?.length-1]?.total_count||0:b?.total_count??0,[f,b,E]),x=f?w:P,N=f?O:_,D=(f?j:C)??null,W=(0,c.useCallback)(()=>{R(e=>Math.max(0,e+1))},[R]),F=(0,c.useCallback)(()=>{R(e=>Math.max(0,e-1))},[R]),B=(l.current-1)*u.current;return{data:A,count:L,error:D,isLoading:x,isFetching:N,isError:!!D,page:z,pageCount:Math.ceil((L-B)/u.current),fetchPage:R,fetchNext:W,fetchPrevious:F,hasNextPage:L-B*u.current>z*u.current,hasPreviousPage:(z-1)*u.current>B*u.current,revalidate:f?()=>U():()=>S(),setData:f?e=>U(e,{revalidate:!1}):e=>S(e,{revalidate:!1})}},ep=()=>(eo("useClerk"),q());function ef(e){let t=ep(),r=(0,c.useRef)(!1);(0,c.useEffect)(()=>{r.current||(r.current=!0,t.__internal_attemptToEnableEnvironmentSetting?.({for:"organizations",caller:e}))},[t,e])}let eg={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};function em(e){let{domains:t,membershipRequests:r,memberships:n,invitations:i}=e||{};eo("useOrganization"),ef("useOrganization");let{organization:o}=en(),s=Q(),a=el(t,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,enrollmentMode:void 0}),l=el(r,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),c=el(n,{initialPage:1,pageSize:10,role:void 0,keepPreviousData:!1,infinite:!1,query:void 0}),h=el(i,{initialPage:1,pageSize:10,status:["pending"],keepPreviousData:!1,infinite:!1}),p=q();p.telemetry?.record((0,d.eventMethodCalled)("useOrganization"));let f=void 0===t?void 0:{initialPage:a.initialPage,pageSize:a.pageSize,enrollmentMode:a.enrollmentMode},g=void 0===r?void 0:{initialPage:l.initialPage,pageSize:l.pageSize,status:l.status},m=void 0===n?void 0:{initialPage:c.initialPage,pageSize:c.pageSize,role:c.role,query:c.query},v=void 0===i?void 0:{initialPage:h.initialPage,pageSize:h.pageSize,status:h.status},k=eh({fetcher:o?.getDomains,config:{keepPreviousData:a.keepPreviousData,infinite:a.infinite,enabled:!!f,isSignedIn:!!o,initialPage:a.initialPage,pageSize:a.pageSize},keys:es({stablePrefix:"domains",authenticated:!!o,tracked:{organizationId:o?.id},untracked:{args:f}})}),y=eh({fetcher:o?.getMembershipRequests,config:{keepPreviousData:l.keepPreviousData,infinite:l.infinite,enabled:!!g,isSignedIn:!!o,initialPage:l.initialPage,pageSize:l.pageSize},keys:es({stablePrefix:"membershipRequests",authenticated:!!o,tracked:{organizationId:o?.id},untracked:{args:g}})}),b=eh({fetcher:o?.getMemberships,config:{keepPreviousData:c.keepPreviousData,infinite:c.infinite,enabled:!!m,isSignedIn:!!o,initialPage:c.initialPage,pageSize:c.pageSize},keys:es({stablePrefix:"memberships",authenticated:!!o,tracked:{organizationId:o?.id},untracked:{args:m}})}),_=eh({fetcher:o?.getInvitations,config:{keepPreviousData:h.keepPreviousData,infinite:h.infinite,enabled:!!v,isSignedIn:!!o,initialPage:h.initialPage,pageSize:h.pageSize},keys:es({stablePrefix:"invitations",authenticated:!!o,tracked:{organizationId:o?.id},untracked:{args:v}})});return void 0===o?{isLoaded:!1,organization:void 0,membership:void 0,domains:eg,membershipRequests:eg,memberships:eg,invitations:eg}:null===o?{isLoaded:!0,organization:null,membership:null,domains:null,membershipRequests:null,memberships:null,invitations:null}:!p.loaded&&o?{isLoaded:!0,organization:o,membership:void 0,domains:eg,membershipRequests:eg,memberships:eg,invitations:eg}:{isLoaded:p.loaded,organization:o,membership:(0,u.getCurrentOrganizationMembership)(s.user.organizationMemberships,o.id),domains:k,membershipRequests:y,memberships:b,invitations:_}}let ev={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};function ek(e){let{userMemberships:t,userInvitations:r,userSuggestions:n}=e||{};eo("useOrganizationList"),ef("useOrganizationList");let i=el(t,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1}),o=el(r,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),s=el(n,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),a=q(),l=J();a.telemetry?.record((0,d.eventMethodCalled)("useOrganizationList"));let u=void 0===t?void 0:{initialPage:i.initialPage,pageSize:i.pageSize},c=void 0===r?void 0:{initialPage:o.initialPage,pageSize:o.pageSize,status:o.status},h=void 0===n?void 0:{initialPage:s.initialPage,pageSize:s.pageSize,status:s.status},p=!!(a.loaded&&l),f=eh({fetcher:l?.getOrganizationMemberships,config:{keepPreviousData:i.keepPreviousData,infinite:i.infinite,enabled:!!u,isSignedIn:!!l,initialPage:i.initialPage,pageSize:i.pageSize},keys:es({stablePrefix:"userMemberships",authenticated:!!l,tracked:{userId:l?.id},untracked:{args:u}})}),g=eh({fetcher:l?.getOrganizationInvitations,config:{keepPreviousData:o.keepPreviousData,infinite:o.infinite,enabled:!!c,isSignedIn:!!l,initialPage:o.initialPage,pageSize:o.pageSize},keys:es({stablePrefix:"userInvitations",authenticated:!!l,tracked:{userId:l?.id},untracked:{args:c}})}),m=eh({fetcher:l?.getOrganizationSuggestions,config:{keepPreviousData:s.keepPreviousData,infinite:s.infinite,enabled:!!h,isSignedIn:!!l,initialPage:s.initialPage,pageSize:s.pageSize},keys:es({stablePrefix:"userSuggestions",authenticated:!!l,tracked:{userId:l?.id},untracked:{args:h}})});return p?{isLoaded:p,setActive:a.setActive,createOrganization:a.createOrganization,userMemberships:f,userInvitations:g,userSuggestions:m}:{isLoaded:!1,createOrganization:void 0,setActive:void 0,userMemberships:ev,userInvitations:ev,userSuggestions:ev}}let ey="undefined"!=typeof window?c.default.useLayoutEffect:c.default.useEffect,eb="useSession",e_=()=>{eo(eb);let e=Q(),t=q();return(t.telemetry?.record((0,d.eventMethodCalled)(eb)),void 0===e)?{isLoaded:!1,isSignedIn:void 0,session:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,session:null}:{isLoaded:!0,isSignedIn:t.isSignedIn,session:e}},eP="useSessionList",eC=()=>{eo(eP);let e=q(),t=Y();return(q().telemetry?.record((0,d.eventMethodCalled)(eP)),t)?{isLoaded:!0,sessions:t.sessions,setActive:e.setActive}:{isLoaded:!1,sessions:void 0,setActive:void 0}},eS="useUser";function eE(){eo(eS);let e=J();return(q().telemetry?.record((0,d.eventMethodCalled)(eS)),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}}async function ew(e){try{let t=await e;if(t instanceof Response)return t.json();return t}catch(e){if((0,a.isClerkAPIResponseError)(e)&&e.errors.find(({code:e})=>"session_reverification_required"===e))return(0,o.reverificationError)();throw e}}let eO=(e,t)=>{let{__internal_openReverification:r,telemetry:n}=ep(),i=(0,c.useRef)(e),u=(0,c.useRef)(t);return n?.record((0,d.eventMethodCalled)("useReverification",{onNeedsReverification:!!t?.onNeedsReverification})),ey(()=>{i.current=e,u.current=t}),(0,c.useCallback)((...e)=>{var t;return(t={openUIComponent:r,telemetry:n,...u.current},function(e){return async(...r)=>{let n=await ew(e(...r));if((0,o.isReverificationHint)(n)){let i=(0,l.createDeferredPromise)(),o=(0,s.validateReverificationConfig)(n.clerk_error.metadata?.reverification),u=o?o().level:void 0,d=()=>{i.reject(new a.ClerkRuntimeError("User cancelled attempted verification",{code:"reverification_cancelled"}))},c=()=>{i.resolve(!0)};void 0===t.onNeedsReverification?t.openUIComponent?.({level:u,afterVerification:c,afterVerificationCancelled:d}):t.onNeedsReverification({cancel:d,complete:c,level:u}),await i.promise,n=await ew(e(...r))}return n}})(i.current)(...e)},[r,n])};function ej({hookName:e,resourceType:t,useFetcher:r,options:n}){return function(i){let{for:o,enabled:s,...a}=i||{},l=o||"user";eo(e);let u=r(l),c=el(a,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,__experimental_mode:void 0}),h=q(),p=J(),{organization:f}=en();h.telemetry?.record((0,d.eventMethodCalled)(e));let g="organization"===l,m=function(e){let t=q(),r=e?.enabled??!0,n=t.__unstable__environment,i=J(),{organization:o}=en(),s=e?.for==="organization",a=s?n?.commerceSettings.billing.organization.enabled:n?.commerceSettings.billing.user.enabled,l=!(e?.authenticated??!0)||(!s||!!o?.id)&&!!i?.id;return a&&r&&t.loaded&&l}({for:l,enabled:s,authenticated:!n?.unauthenticated}),v=void 0===a?void 0:{initialPage:c.initialPage,pageSize:c.pageSize,...n?.unauthenticated?{}:g?{orgId:f?.id}:{}},k=!!v&&h.loaded&&!!m;return eh({fetcher:u,config:{keepPreviousData:c.keepPreviousData,infinite:c.infinite,enabled:k,...n?.unauthenticated?{}:{isSignedIn:null!==p},__experimental_mode:c.__experimental_mode,initialPage:c.initialPage,pageSize:c.pageSize},keys:es({stablePrefix:t,authenticated:!n?.unauthenticated,tracked:n?.unauthenticated?{for:l}:{userId:p?.id,...g?{_orgId:f?.id}:{}},untracked:{args:v}})})}}ej({hookName:"useStatements",resourceType:"billing-statements",useFetcher:()=>{let e=q();if(e.loaded)return e.billing.getStatements}}),ej({hookName:"usePaymentAttempts",resourceType:"billing-payment-attempts",useFetcher:()=>{let e=q();if(e.loaded)return e.billing.getPaymentAttempts}}),ej({hookName:"usePaymentMethods",resourceType:"billing-payment-methods",useFetcher:e=>{let{organization:t}=en(),r=J();return"organization"===e?t?.getPaymentMethods:r?.getPaymentMethods}}),ej({hookName:"usePlans",resourceType:"billing-plans",useFetcher:e=>{let t=q();if(t.loaded)return r=>t.billing.getPlans({...r,for:e})},options:{unauthenticated:!0}});let eM=e=>{let t=ee(),{for:r,planId:n,planPeriod:i}=e||t,o=ep(),{organization:s}=en(),{isLoaded:a,user:l}=eE();if(!a)throw Error("Clerk: Ensure that `useCheckout` is inside a component wrapped with `<ClerkLoaded />`.");if(!l)throw Error("Clerk: Ensure that `useCheckout` is inside a component wrapped with `<SignedIn />`.");if("organization"===r&&!s)throw Error("Clerk: Ensure your flow checks for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object");let u=(0,c.useMemo)(()=>o.__experimental_checkout({planId:n,planPeriod:i,for:r}),[l.id,s?.id,n,i,r]),d=(0,c.useSyncExternalStore)(e=>u.subscribe(e),()=>u.getState(),()=>u.getState());return{checkout:{...(0,c.useMemo)(()=>{if(!d.checkout)return{id:null,externalClientSecret:null,externalGatewayId:null,totals:null,isImmediatePlanChange:null,planPeriod:null,plan:null,paymentMethod:null,freeTrialEndsAt:null,payer:null,needsPaymentMethod:null,planPeriodStart:null};let{reload:e,confirm:t,pathRoot:r,...n}=d.checkout;return n},[d.checkout]),getState:u.getState,start:u.start,confirm:u.confirm,clear:u.clear,finalize:u.finalize,isStarting:d.isStarting,isConfirming:d.isConfirming,error:d.error,status:d.status,fetchStatus:d.fetchStatus}}},eI=e=>{let t=(0,c.useRef)(e);return(0,c.useEffect)(()=>{t.current=e},[e]),t.current},eU=(e,t,r)=>{let n=!!r,i=(0,c.useRef)(r);(0,c.useEffect)(()=>{i.current=r},[r]),(0,c.useEffect)(()=>{if(!n||!e)return()=>{};let r=(...e)=>{i.current&&i.current(...e)};return e.on(t,r),()=>{e.off(t,r)}},[n,t,e,i])},ez=c.default.createContext(null);ez.displayName="ElementsContext";let eT=(e,t)=>{if(!e)throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);return e},eR=({stripe:e,options:t,children:r})=>{let n=c.default.useMemo(()=>ex(e),[e]),[i,o]=c.default.useState(()=>({stripe:"sync"===n.tag?n.stripe:null,elements:"sync"===n.tag?n.stripe.elements(t):null}));c.default.useEffect(()=>{let e=!0,r=e=>{o(r=>r.stripe?r:{stripe:e,elements:e.elements(t)})};return"async"!==n.tag||i.stripe?"sync"!==n.tag||i.stripe||r(n.stripe):n.stripePromise.then(t=>{t&&e&&r(t)}),()=>{e=!1}},[n,i,t]);let s=eI(e);c.default.useEffect(()=>{null!==s&&s!==e&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[s,e]);let a=eI(t);return c.default.useEffect(()=>{if(!i.elements)return;let e=eF(t,a,["clientSecret","fonts"]);e&&i.elements.update(e)},[t,a,i.elements]),c.default.createElement(ez.Provider,{value:i},r)},eA="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",eL=(e,t=eA)=>{if(null===e||eW(e))return e;throw Error(t)},ex=(e,t=eA)=>{if(eD(e))return{tag:"async",stripePromise:Promise.resolve(e).then(e=>eL(e,t))};let r=eL(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},eN=e=>null!==e&&"object"==typeof e,eD=e=>eN(e)&&"function"==typeof e.then,eW=e=>eN(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment,eF=(e,t,r)=>eN(e)?Object.keys(e).reduce((n,i)=>{let o=!eN(t)||!eK(e[i],t[i]);return r.includes(i)?(o&&console.warn(`Unsupported prop change: options.${i} is not a mutable property.`),n):o?{...n||{},[i]:e[i]}:n},null):null,eB="[object Object]",eK=(e,t)=>{if(!eN(e)||!eN(t))return e===t;let r=Array.isArray(e);if(r!==Array.isArray(t))return!1;let n=Object.prototype.toString.call(e)===eB;if(n!==(Object.prototype.toString.call(t)===eB))return!1;if(!n&&!r)return e===t;let i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;let s={};for(let e=0;e<i.length;e+=1)s[i[e]]=!0;for(let e=0;e<o.length;e+=1)s[o[e]]=!0;let a=Object.keys(s);return a.length===i.length&&a.every(r=>eK(e[r],t[r]))},eV=e=>eT(c.default.useContext(ez),e),e$=(n="payment",i="undefined"==typeof window,t=`${n.charAt(0).toUpperCase()+n.slice(1)}Element`,(r=i?e=>{eV(`mounts <${t}>`);let{id:r,className:n}=e;return c.default.createElement("div",{id:r,className:n})}:({id:e,className:r,fallback:i,options:o={},onBlur:s,onFocus:a,onReady:l,onChange:u,onEscape:d,onClick:h,onLoadError:p,onLoaderStart:f,onNetworksChange:g,onConfirm:m,onCancel:v,onShippingAddressChange:k,onShippingRateChange:y})=>{let b,_=eV(`mounts <${t}>`),P="elements"in _?_.elements:null,[C,S]=c.default.useState(null),E=c.default.useRef(null),w=c.default.useRef(null),[O,j]=(0,c.useState)(!1);eU(C,"blur",s),eU(C,"focus",a),eU(C,"escape",d),eU(C,"click",h),eU(C,"loaderror",p),eU(C,"loaderstart",f),eU(C,"networkschange",g),eU(C,"confirm",m),eU(C,"cancel",v),eU(C,"shippingaddresschange",k),eU(C,"shippingratechange",y),eU(C,"change",u),l&&(b=()=>{j(!0),l(C)}),eU(C,"ready",b),c.default.useLayoutEffect(()=>{if(null===E.current&&null!==w.current&&P){let e=null;P&&(e=P.create(n,o)),E.current=e,S(e),e&&e.mount(w.current)}},[P,o]);let M=eI(o);return c.default.useEffect(()=>{if(!E.current)return;let e=eF(o,M,["paymentRequest"]);e&&"update"in E.current&&E.current.update(e)},[o,M]),c.default.useLayoutEffect(()=>()=>{if(E.current&&"function"==typeof E.current.destroy)try{E.current.destroy(),E.current=null}catch{}},[]),c.default.createElement(c.default.Fragment,null,!O&&i,c.default.createElement("div",{id:e,style:{height:O?"unset":"0px",visibility:O?"visible":"hidden"},className:r,ref:w}))}).displayName=t,r.__elementType=n,r),[eq,eG]=K("PaymentElementContext"),[eJ,eH]=K("StripeUtilsContext"),eY=({children:e})=>{let t=(()=>{let{stripe:e}=eV("calls useStripe()");return e})(),r=(()=>{let{elements:e}=eT(c.default.useContext(ez),"calls useElements()");return e})();return c.default.createElement(eJ.Provider,{value:{value:{stripe:t,elements:r}}},e)},eX=({children:e})=>c.default.createElement(eJ.Provider,{value:{value:{}}},e),eQ=({children:e,...t})=>{let r=((e="user")=>{let t,r=(t=ep(),(0,h.default)("clerk-stripe-sdk",async()=>({loadStripe:await t.__internal_loadStripeJs()}),{keepPreviousData:!0,revalidateOnFocus:!1,dedupingInterval:1/0}).data??null),n=ep().__unstable__environment,{initializedPaymentMethod:i,initializePaymentMethod:o}=function(e){let{for:t="user"}=e??{},{organization:r}=en(),n=J(),i="organization"===t?r:n,{data:o,trigger:s}=F(i?.id?{key:"billing-payment-method-initialize",resourceId:i.id,for:t}:null,()=>i?.initializePaymentMethod({gateway:"stripe"}));return(0,c.useEffect)(()=>{i?.id&&s().catch(()=>{})},[i?.id,s]),{initializedPaymentMethod:o,initializePaymentMethod:s}}({for:e}),s=n?.commerceSettings.billing.stripePublishableKey??void 0;return{stripe:function(e){let{stripeClerkLibs:t,externalGatewayId:r,stripePublishableKey:n}=e;return(0,h.default)(t&&r&&n?{key:"stripe-sdk",externalGatewayId:r,stripePublishableKey:n}:null,({stripePublishableKey:e,externalGatewayId:r})=>t?.loadStripe(e,{stripeAccount:r}),{keepPreviousData:!0,revalidateOnFocus:!1,dedupingInterval:6e4}).data}({stripeClerkLibs:r,externalGatewayId:i?.externalGatewayId,stripePublishableKey:s}),initializePaymentMethod:o,externalClientSecret:i?.externalClientSecret,paymentMethodOrder:i?.paymentMethodOrder}})(t.for),[n,i]=(0,c.useState)(!1);return c.default.createElement(eq.Provider,{value:{value:{...t,...r,setIsPaymentElementReady:i,isPaymentElementReady:n}}},e)},eZ=({children:e,...t})=>c.default.createElement(eQ,t,c.default.createElement(e0,null,e)),e0=e=>{let{stripe:t,externalClientSecret:r,stripeAppearance:n}=eG(),i=(()=>{let e=ep(),t="en";try{t=e.__internal_getOption("localization")?.locale||"en"}catch{}return t.split("-")[0]})();return t&&r?c.default.createElement(eR,{key:r,stripe:t,options:{loader:"never",clientSecret:r,appearance:{variables:n},locale:i}},c.default.createElement(eY,null,e.children)):c.default.createElement(eX,null,e.children)},e1=({fallback:e})=>{let{setIsPaymentElementReady:t,paymentMethodOrder:r,checkout:n,stripe:i,externalClientSecret:o,paymentDescription:s,for:a}=eG(),l=ep().__unstable__environment,u=(0,c.useMemo)(()=>{if(n&&n.totals&&n.plan)return{recurringPaymentRequest:{paymentDescription:s||"",managementURL:"organization"===a?l?.displayConfig.organizationProfileUrl||"":l?.displayConfig.userProfileUrl||"",regularBilling:{amount:n.totals.totalDueNow?.amount||n.totals.grandTotal.amount,label:n.plan.name,recurringPaymentIntervalUnit:"annual"===n.planPeriod?"year":"month"}}}},[n,s,a,l]),d=(0,c.useMemo)(()=>({layout:{type:"tabs",defaultCollapsed:!1},paymentMethodOrder:r,applePay:u}),[u,r]),h=(0,c.useCallback)(()=>{t(!0)},[t]);return i&&o?c.default.createElement(e$,{fallback:e,onReady:h,options:d}):c.default.createElement(c.default.Fragment,null,e)},e3=()=>{throw Error("Clerk: Unable to submit, Stripe libraries are not yet loaded. Be sure to check `isFormReady` before calling `submit`.")},e5=()=>{let{isPaymentElementReady:e,initializePaymentMethod:t}=eG(),{stripe:r,elements:n}=eH(),{externalClientSecret:i}=eG(),o=(0,c.useCallback)(async()=>{if(!r||!n)return e3();let{setupIntent:e,error:t}=await r.confirmSetup({elements:n,confirmParams:{return_url:window.location.href},redirect:"if_required"});return t?{data:null,error:{gateway:"stripe",error:{code:t.code,message:t.message,type:t.type}}}:{data:{gateway:"stripe",paymentToken:e.payment_method},error:null}},[r,n]),s=(0,c.useCallback)(async()=>{if(!r||!n)return e3();await t()},[r,n,t]),a=!!(r&&i);return a?{submit:o,reset:s,isFormReady:e,provider:{name:"stripe"},isProviderReady:a}:{submit:e3,reset:e3,isFormReady:!1,provider:void 0,isProviderReady:!1}};e.s(["ClerkInstanceContext",()=>$,"ClientContext",()=>H,"OrganizationProvider",()=>ei,"SessionContext",()=>X,"UserContext",()=>G,"__experimental_CheckoutProvider",()=>et,"__experimental_PaymentElement",()=>e1,"__experimental_PaymentElementProvider",()=>eZ,"__experimental_useCheckout",()=>eM,"__experimental_usePaymentElement",()=>e5,"createContextAndHook",()=>K,"isDeeplyEqual",()=>L,"useAssertWrappedByClerkProvider",()=>eo,"useClerk",()=>ep,"useClerkInstanceContext",()=>q,"useClientContext",()=>Y,"useOrganization",()=>em,"useOrganizationList",()=>ek,"useReverification",()=>eO,"useSession",()=>e_,"useSessionContext",()=>Q,"useSessionList",()=>eC,"useUser",()=>eE],423528)},895764,65397,830995,54393,752013,758766,115530,30396,168931,337630,32007,e=>{"use strict";let t;e.i(951672);var r,n,i,o,s,a,l,u,d,c,h=e.i(591431);e.s([],65397);var p=e.i(399402);e.i(767303),e.i(398883),e.i(400484);var f=e.i(151510);e.i(48641);var g=e.i(855168);e.s([],830995);var m=e.i(136357),v=e.i(423528),k=(0,h.buildErrorThrower)({packageName:"@clerk/clerk-react"});function y(e){k.setMessages(e).setPackageName(e)}var[b,_]=(0,v.createContextAndHook)("AuthContext"),P=v.ClerkInstanceContext,C=v.useClerkInstanceContext,S="You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.",E=e=>`You've passed multiple children components to <${e}/>. You can only pass a single child component or text.`,w="Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.",O="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",j="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",M="<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 />`.",U=e=>`<${e} /> can only accept <${e}.Page /> and <${e}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,z=e=>`Missing props. <${e}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,T=e=>`Missing props. <${e}.Link /> component requires the following props: url, label and labelIcon.`,R=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'} />`,A=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`,L="<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",x="<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",N="<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.",D="<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.",W="<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.",F="Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.",B="Missing props. <UserButton.Action /> component requires the following props: label.",K=e=>{(0,v.useAssertWrappedByClerkProvider)(()=>{k.throwMissingClerkProviderError({source:e})})},V=e=>new Promise(t=>{let r=n=>{["ready","degraded"].includes(n)&&(t(),e.off("status",r))};e.on("status",r,{notify:!0})}),$=(e={})=>{var t;K("useAuth");let{treatPendingAsSignedOut:r,...n}=null!=e?e:{},i=_();void 0===i.sessionId&&void 0===i.userId&&(i=null!=n?n:{});let o=C(),s=(0,m.useCallback)(async e=>(await V(o),o.session)?o.session.getToken(e):null,[o]),a=(0,m.useCallback)(async(...e)=>(await V(o),o.signOut(...e)),[o]);return null==(t=o.telemetry)||t.record((0,g.eventMethodCalled)("useAuth",{treatPendingAsSignedOut:r})),q({...i,getToken:s,signOut:a},{treatPendingAsSignedOut:r})};function q(e,{treatPendingAsSignedOut:t=!0}={}){let{userId:r,orgId:n,orgRole:i,has:o,signOut:s,getToken:a,orgPermissions:l,factorVerificationAge:u,sessionClaims:d}=null!=e?e:{},c=(0,m.useCallback)(e=>o?o(e):(0,p.createCheckAuthorization)({userId:r,orgId:n,orgRole:i,orgPermissions:l,factorVerificationAge:u,features:(null==d?void 0:d.fea)||"",plans:(null==d?void 0:d.pla)||""})(e),[o,r,n,i,l,u,d]),h=(0,p.resolveAuthState)({authObject:{...e,getToken:a,signOut:s,has:c},options:{treatPendingAsSignedOut:t}});return h||k.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}=m.default.useMemo(()=>e.createEmailLinkFlow(),[e]);return m.default.useEffect(()=>r,[]),{startEmailLinkFlow:t,cancelEmailLinkFlow:r}}var J=()=>{var e;K("useSignIn");let t=C(),r=(0,v.useClientContext)();return(null==(e=t.telemetry)||e.record((0,g.eventMethodCalled)("useSignIn")),r)?{isLoaded:!0,signIn:r.signIn,setActive:t.setActive}:{isLoaded:!1,signIn:void 0,setActive:void 0}},H=()=>{var e;K("useSignUp");let t=C(),r=(0,v.useClientContext)();return(null==(e=t.telemetry)||e.record((0,g.eventMethodCalled)("useSignUp")),r)?{isLoaded:!0,signUp:r.signUp,setActive:t.setActive}:{isLoaded:!1,signUp:void 0,setActive:void 0}},Y=(e,t)=>{let r=("string"==typeof t?t:null==t?void 0:t.component)||e.displayName||e.name||"Component";e.displayName=r;let n="string"==typeof t?void 0:t,i=t=>{K(r||"withClerk");let i=C();return i.loaded||(null==n?void 0:n.renderWhileLoading)?m.default.createElement(e,{...t,component:r,clerk:i}):null};return i.displayName=`withClerk(${r})`,i};e.s(["AuthContext",()=>b,"IsomorphicClerkContext",()=>P,"customLinkWrongProps",()=>T,"customMenuItemsIgnoredComponent",()=>x,"customPageWrongProps",()=>z,"customPagesIgnoredComponent",()=>U,"errorThrower",()=>k,"incompatibleRoutingWithPathProvidedError",()=>A,"multipleChildrenInButtonComponent",()=>E,"multipleClerkProvidersError",()=>S,"noPathProvidedError",()=>R,"organizationProfileLinkRenderedError",()=>I,"organizationProfilePageRenderedError",()=>M,"setErrorThrowerOptions",()=>y,"unsupportedNonBrowserDomainOrProxyUrlFunction",()=>w,"useAssertWrappedByClerkProvider",()=>K,"useAuth",()=>$,"useDerivedAuth",()=>q,"useEmailLink",()=>G,"useIsomorphicClerkContext",()=>C,"useSignIn",()=>J,"useSignUp",()=>H,"userButtonIgnoredComponent",()=>L,"userButtonMenuActionRenderedError",()=>D,"userButtonMenuItemLinkWrongProps",()=>F,"userButtonMenuItemsActionWrongsProps",()=>B,"userButtonMenuItemsRenderedError",()=>N,"userButtonMenuLinkRenderedError",()=>W,"userProfileLinkRenderedError",()=>j,"userProfilePageRenderedError",()=>O,"withClerk",()=>Y],54393);var X=e.i(936578);let Q=new Set,Z=(e,t,r)=>{let n=(0,X.isTestEnvironment)()||(0,X.isProductionEnvironment)(),i=r??e;Q.has(i)||n||(Q.add(i),console.warn(`Clerk - DEPRECATION WARNING: "${e}" is deprecated and will be removed in the next major release.
${t}`))};var ee=({children:e,treatPendingAsSignedOut:t})=>{K("SignedIn");let{userId:r}=$({treatPendingAsSignedOut:t});return r?e:null},et=({children:e,treatPendingAsSignedOut:t})=>{K("SignedOut");let{userId:r}=$({treatPendingAsSignedOut:t});return null===r?e:null},er=({children:e})=>(K("ClerkLoaded"),C().loaded)?e:null,en=({children:e})=>(K("ClerkLoading"),"loading"!==C().status)?null:e,ei=({children:e})=>(K("ClerkFailed"),"error"!==C().status)?null:e,eo=({children:e})=>(K("ClerkDegraded"),"degraded"!==C().status)?null:e,es=({children:e,fallback:t,treatPendingAsSignedOut:r,...n})=>{K("Protect");let{isLoaded:i,has:o,userId:s}=$({treatPendingAsSignedOut:r});if(!i)return null;let a=null!=t?t:null;return s?"function"==typeof n.condition?n.condition(o)?e:a:n.role||n.permission||n.feature||n.plan?o(n)?e:a:e:a},ea=Y(({clerk:e,...t})=>{let{client:r,session:n}=e,i=r.signedInSessions?r.signedInSessions.length>0:r.activeSessions&&r.activeSessions.length>0;return m.default.useEffect(()=>{null===n&&i?e.redirectToAfterSignOut():e.redirectToSignIn(t)},[]),null},"RedirectToSignIn"),el=Y(({clerk:e,...t})=>(m.default.useEffect(()=>{e.redirectToSignUp(t)},[]),null),"RedirectToSignUp"),eu=Y(({clerk:e,...t})=>(m.default.useEffect(()=>{e.redirectToTasks(t)},[]),null),"RedirectToTasks"),ed=Y(({clerk:e})=>(m.default.useEffect(()=>{Z("RedirectToUserProfile","Use the `redirectToUserProfile()` method instead."),e.redirectToUserProfile()},[]),null),"RedirectToUserProfile"),ec=Y(({clerk:e})=>(m.default.useEffect(()=>{Z("RedirectToOrganizationProfile","Use the `redirectToOrganizationProfile()` method instead."),e.redirectToOrganizationProfile()},[]),null),"RedirectToOrganizationProfile"),eh=Y(({clerk:e})=>(m.default.useEffect(()=>{Z("RedirectToCreateOrganization","Use the `redirectToCreateOrganization()` method instead."),e.redirectToCreateOrganization()},[]),null),"RedirectToCreateOrganization"),ep=Y(({clerk:e,...t})=>(m.default.useEffect(()=>{e.handleRedirectCallback(t)},[]),null),"AuthenticateWithRedirectCallback"),ef=({children:e})=>{K("MultisessionAppSupport");let t=(0,v.useSessionContext)();return m.default.createElement(m.default.Fragment,{key:t?t.id:"no-users"},e)};e.s(["AuthenticateWithRedirectCallback",()=>ep,"ClerkDegraded",()=>eo,"ClerkFailed",()=>ei,"ClerkLoaded",()=>er,"ClerkLoading",()=>en,"MultisessionAppSupport",()=>ef,"Protect",()=>es,"RedirectToCreateOrganization",()=>eh,"RedirectToOrganizationProfile",()=>ec,"RedirectToSignIn",()=>ea,"RedirectToSignUp",()=>el,"RedirectToTasks",()=>eu,"RedirectToUserProfile",()=>ed,"SignedIn",()=>ee,"SignedOut",()=>et],752013),e.i(952335);var eg=e.i(144512),em=m,ev=e.i(77625);let ek=(e,...t)=>{let r={...e};for(let e of t)delete r[e];return r};var ey=e=>t=>{try{return em.default.Children.only(e)}catch{return k.throw(E(t))}},eb=(e,t)=>(e||(e=t),"string"==typeof e&&(e=em.default.createElement("button",null,e)),e),e_=e=>(...t)=>{if(e&&"function"==typeof e)return e(...t)};function eP(e){return"function"==typeof e}var eC=new Map;function eS(e,t,r){let n=e.displayName||e.name||t||"Component",i=n=>(!function(e,t,r=1){em.default.useEffect(()=>{let n=eC.get(e)||0;return n==r?k.throw(t):(eC.set(e,n+1),()=>{eC.set(e,(eC.get(e)||1)-1)})},[])}(t,r),em.default.createElement(e,{...n}));return i.displayName=`withMaxAllowedInstancesGuard(${n})`,i}var eE=e=>{let[t,r]=(0,em.useState)(new Map);return e.map(e=>({id:e.id,mount:t=>r(r=>new Map(r).set(String(e.id),t)),unmount:()=>r(t=>{let r=new Map(t);return r.set(String(e.id),null),r}),portal:()=>{let r=t.get(String(e.id));return r?(0,ev.createPortal)(e.component,r):null}}))},ew=(e,t)=>!!e&&em.default.isValidElement(e)&&(null==e?void 0:e.type)===t,eO=(e,t)=>eI({children:e,reorderItemsLabels:["account","security","billing","apiKeys"],LinkComponent:e$,PageComponent:eV,MenuItemsComponent:eJ,componentName:"UserProfile"},t),ej=(e,t)=>eI({children:e,reorderItemsLabels:["general","members","billing","apiKeys"],LinkComponent:eZ,PageComponent:eQ,componentName:"OrganizationProfile"},t),eM=e=>{let t=[],r=[eZ,eQ,eJ,eV,e$];return em.default.Children.forEach(e,e=>{r.some(t=>ew(e,t))||t.push(e)}),t},eI=(e,t)=>{let{children:r,LinkComponent:n,PageComponent:i,MenuItemsComponent:o,reorderItemsLabels:s,componentName:a}=e,{allowForAnyChildren:l=!1}=t||{},u=[];em.default.Children.forEach(r,e=>{if(!ew(e,i)&&!ew(e,n)&&!ew(e,o)){e&&!l&&(0,eg.logErrorInDevMode)(U(a));return}let{props:t}=e,{children:r,label:d,url:c,labelIcon:h}=t;if(ew(e,i))if(eU(t,s))u.push({label:d});else{if(!ez(t))return void(0,eg.logErrorInDevMode)(z(a));u.push({label:d,labelIcon:h,children:r,url:c})}if(ew(e,n))if(!eT(t))return void(0,eg.logErrorInDevMode)(T(a));else u.push({label:d,labelIcon:h,url:c})});let d=[],c=[],h=[];u.forEach((e,t)=>{if(ez(e)){d.push({component:e.children,id:t}),c.push({component:e.labelIcon,id:t});return}eT(e)&&h.push({component:e.labelIcon,id:t})});let p=eE(d),f=eE(c),g=eE(h),m=[],v=[];return u.forEach((e,t)=>{if(eU(e,s))return void m.push({label:e.label});if(ez(e)){let{portal:r,mount:n,unmount:i}=p.find(e=>e.id===t),{portal:o,mount:s,unmount:a}=f.find(e=>e.id===t);m.push({label:e.label,url:e.url,mount:n,unmount:i,mountIcon:s,unmountIcon:a}),v.push(r),v.push(o);return}if(eT(e)){let{portal:r,mount:n,unmount:i}=g.find(e=>e.id===t);m.push({label:e.label,url:e.url,mountIcon:n,unmountIcon:i}),v.push(r);return}}),{customPages:m,customPagesPortals:v}},eU=(e,t)=>{let{children:r,label:n,url:i,labelIcon:o}=e;return!r&&!i&&!o&&t.some(e=>e===n)},ez=e=>{let{children:t,label:r,url:n,labelIcon:i}=e;return!!t&&!!n&&!!i&&!!r},eT=e=>{let{children:t,label:r,url:n,labelIcon:i}=e;return!t&&!!n&&!!i&&!!r},eR=(e,t)=>{let{children:r,label:n,onClick:i,labelIcon:o}=e;return!r&&!i&&!o&&t.some(e=>e===n)},eA=e=>{let{label:t,labelIcon:r,onClick:n,open:i}=e;return!!r&&!!t&&("function"==typeof n||"string"==typeof i)},eL=e=>{let{label:t,href:r,labelIcon:n}=e;return!!r&&!!n&&!!t},ex=(t=(r={childList:!0,subtree:!0,isReady:(e,t)=>{var r;return!!(null==e?void 0:e.childElementCount)&&(null==(r=null==e?void 0:e.matches)?void 0:r.call(e,t))&&e.childElementCount>0}}).isReady,e=>new Promise((n,i)=>{let{root:o=null==document?void 0:document.body,selector:s,timeout:a=0}=e;if(!o)return void i(Error("No root element provided"));let l=o;if(s&&(l=null==o?void 0:o.querySelector(s)),t(l,s))return void n();let u=new MutationObserver(e=>{for(let i of e)if(!l&&s&&(l=null==o?void 0:o.querySelector(s)),(r.childList&&"childList"===i.type||r.attributes&&"attributes"===i.type)&&t(l,s)){u.disconnect(),n();return}});u.observe(o,r),a>0&&setTimeout(()=>{u.disconnect(),i(Error(`Timeout waiting for ${s}`))},a)}));function eN(e,t){let r=(0,em.useRef)(),[n,i]=(0,em.useState)("rendering");return(0,em.useEffect)(()=>{if(!e)throw Error("Clerk: no component name provided, unable to detect mount.");if("undefined"!=typeof window&&!r.current){let n=`[data-clerk-component="${e}"]`,o=null==t?void 0:t.selector;r.current=ex({selector:o?n+o:n}).then(()=>{i("rendered")}).catch(()=>{i("error")})}},[e,null==t?void 0:t.selector]),n}var eD=e=>null==e?void 0:e.map(({mountIcon:e,unmountIcon:t,...r})=>r),eW=class extends em.default.PureComponent{constructor(){super(...arguments),this.rootRef=em.default.createRef()}componentDidUpdate(e){var t,r,n,i;if(!("mount"in e)||!("mount"in this.props))return;let o=ek(e.props,"customPages","customMenuItems","children"),s=ek(this.props.props,"customPages","customMenuItems","children"),a=(null==(t=o.customPages)?void 0:t.length)!==(null==(r=s.customPages)?void 0:r.length),l=(null==(n=o.customMenuItems)?void 0:n.length)!==(null==(i=s.customMenuItems)?void 0:i.length),u=eD(e.props.customMenuItems),d=eD(this.props.props.customMenuItems);(!(0,v.isDeeplyEqual)(o,s)||!(0,v.isDeeplyEqual)(u,d)||a||l)&&this.rootRef.current&&this.props.updateProps({node:this.rootRef.current,props:this.props.props})}componentDidMount(){this.rootRef.current&&("mount"in this.props&&this.props.mount(this.rootRef.current,this.props.props),"open"in this.props&&this.props.open(this.props.props))}componentWillUnmount(){this.rootRef.current&&("mount"in this.props&&this.props.unmount(this.rootRef.current),"open"in this.props&&this.props.close())}render(){let{hideRootHtmlElement:e=!1}=this.props,t={ref:this.rootRef,...this.props.rootProps,...this.props.component&&{"data-clerk-component":this.props.component}};return em.default.createElement(em.default.Fragment,null,!e&&em.default.createElement("div",{...t}),this.props.children)}},eF=e=>{var t,r;return em.default.createElement(em.default.Fragment,null,null==(t=null==e?void 0:e.customPagesPortals)?void 0:t.map((e,t)=>(0,em.createElement)(e,{key:t})),null==(r=null==e?void 0:e.customMenuItemsPortals)?void 0:r.map((e,t)=>(0,em.createElement)(e,{key:t})))},eB=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountSignIn,unmount:e.unmountSignIn,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"SignIn",renderWhileLoading:!0}),eK=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountSignUp,unmount:e.unmountSignUp,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"SignUp",renderWhileLoading:!0});function eV({children:e}){return(0,eg.logErrorInDevMode)(O),em.default.createElement(em.default.Fragment,null,e)}function e$({children:e}){return(0,eg.logErrorInDevMode)(j),em.default.createElement(em.default.Fragment,null,e)}var eq=Object.assign(Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}},{customPages:s,customPagesPortals:a}=eO(n.children);return em.default.createElement(em.default.Fragment,null,i&&r,em.default.createElement(eW,{component:t,mount:e.mountUserProfile,unmount:e.unmountUserProfile,updateProps:e.__unstable__updateProps,props:{...n,customPages:s},rootProps:o},em.default.createElement(eF,{customPagesPortals:a})))},{component:"UserProfile",renderWhileLoading:!0}),{Page:eV,Link:e$}),eG=(0,em.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}});function eJ({children:e}){return(0,eg.logErrorInDevMode)(N),em.default.createElement(em.default.Fragment,null,e)}function eH({children:e}){return(0,eg.logErrorInDevMode)(D),em.default.createElement(em.default.Fragment,null,e)}function eY({children:e}){return(0,eg.logErrorInDevMode)(W),em.default.createElement(em.default.Fragment,null,e)}var eX=Object.assign(Y(({clerk:e,component:t,fallback:r,...n})=>{var i;let o="rendering"===eN(t)||!e.loaded,s={...o&&r&&{style:{display:"none"}}},{customPages:a,customPagesPortals:l}=eO(n.children,{allowForAnyChildren:!!n.__experimental_asProvider}),u={...n.userProfileProps,customPages:a},{customMenuItems:d,customMenuItemsPortals:c}=(({children:e,MenuItemsComponent:t,MenuActionComponent:r,MenuLinkComponent:n,UserProfileLinkComponent:i,UserProfilePageComponent:o,reorderItemsLabels:s,allowForAnyChildren:a=!1})=>{let l=[],u=[],d=[];em.default.Children.forEach(e,e=>{if(!ew(e,t)&&!ew(e,i)&&!ew(e,o)){e&&!a&&(0,eg.logErrorInDevMode)(L);return}if(ew(e,i)||ew(e,o))return;let{props:u}=e;em.default.Children.forEach(u.children,e=>{if(!ew(e,r)&&!ew(e,n)){e&&(0,eg.logErrorInDevMode)(x);return}let{props:t}=e,{label:i,labelIcon:o,href:a,onClick:u,open:d}=t;if(ew(e,r))if(eR(t,s))l.push({label:i});else{if(!eA(t))return void(0,eg.logErrorInDevMode)(B);let e={label:i,labelIcon:o};if(void 0!==u)l.push({...e,onClick:u});else{if(void 0===d)return void(0,eg.logErrorInDevMode)("Custom menu item must have either onClick or open property");l.push({...e,open:d.startsWith("/")?d:`/${d}`})}}if(ew(e,n))if(!eL(t))return void(0,eg.logErrorInDevMode)(F);else l.push({label:i,labelIcon:o,href:a})})});let c=[],h=[];l.forEach((e,t)=>{eA(e)&&c.push({component:e.labelIcon,id:t}),eL(e)&&h.push({component:e.labelIcon,id:t})});let p=eE(c),f=eE(h);return l.forEach((e,t)=>{if(eR(e,s)&&u.push({label:e.label}),eA(e)){let{portal:r,mount:n,unmount:i}=p.find(e=>e.id===t),o={label:e.label,mountIcon:n,unmountIcon:i};"onClick"in e?o.onClick=e.onClick:"open"in e&&(o.open=e.open),u.push(o),d.push(r)}if(eL(e)){let{portal:r,mount:n,unmount:i}=f.find(e=>e.id===t);u.push({label:e.label,href:e.href,mountIcon:n,unmountIcon:i}),d.push(r)}}),{customMenuItems:u,customMenuItemsPortals:d}})({children:n.children,reorderItemsLabels:["manageAccount","signOut"],MenuItemsComponent:eJ,MenuActionComponent:eH,MenuLinkComponent:eY,UserProfileLinkComponent:e$,UserProfilePageComponent:eV,allowForAnyChildren:null!=(i=({allowForAnyChildren:!!n.__experimental_asProvider}).allowForAnyChildren)&&i}),h=eM(n.children),p={mount:e.mountUserButton,unmount:e.unmountUserButton,updateProps:e.__unstable__updateProps,props:{...n,userProfileProps:u,customMenuItems:d}};return em.default.createElement(eG.Provider,{value:p},o&&r,e.loaded&&em.default.createElement(eW,{component:t,...p,hideRootHtmlElement:!!n.__experimental_asProvider,rootProps:s},n.__experimental_asProvider?h:null,em.default.createElement(eF,{customPagesPortals:l,customMenuItemsPortals:c})))},{component:"UserButton",renderWhileLoading:!0}),{UserProfilePage:eV,UserProfileLink:e$,MenuItems:eJ,Action:eH,Link:eY,__experimental_Outlet:function(e){let t=(0,em.useContext)(eG),r={...t,props:{...t.props,...e}};return em.default.createElement(eW,{...r})}});function eQ({children:e}){return(0,eg.logErrorInDevMode)(M),em.default.createElement(em.default.Fragment,null,e)}function eZ({children:e}){return(0,eg.logErrorInDevMode)(I),em.default.createElement(em.default.Fragment,null,e)}var e0=Object.assign(Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}},{customPages:s,customPagesPortals:a}=ej(n.children);return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountOrganizationProfile,unmount:e.unmountOrganizationProfile,updateProps:e.__unstable__updateProps,props:{...n,customPages:s},rootProps:o},em.default.createElement(eF,{customPagesPortals:a})))},{component:"OrganizationProfile",renderWhileLoading:!0}),{Page:eQ,Link:eZ}),e1=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountCreateOrganization,unmount:e.unmountCreateOrganization,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"CreateOrganization",renderWhileLoading:!0}),e3=(0,em.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),e5=Object.assign(Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}},{customPages:s,customPagesPortals:a}=ej(n.children,{allowForAnyChildren:!!n.__experimental_asProvider}),l={...n.organizationProfileProps,customPages:s},u=eM(n.children),d={mount:e.mountOrganizationSwitcher,unmount:e.unmountOrganizationSwitcher,updateProps:e.__unstable__updateProps,props:{...n,organizationProfileProps:l},rootProps:o,component:t};return e.__experimental_prefetchOrganizationSwitcher(),em.default.createElement(e3.Provider,{value:d},em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{...d,hideRootHtmlElement:!!n.__experimental_asProvider},n.__experimental_asProvider?u:null,em.default.createElement(eF,{customPagesPortals:a}))))},{component:"OrganizationSwitcher",renderWhileLoading:!0}),{OrganizationProfilePage:eQ,OrganizationProfileLink:eZ,__experimental_Outlet:function(e){let t=(0,em.useContext)(e3),r={...t,props:{...t.props,...e}};return em.default.createElement(eW,{...r})}}),e6=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountOrganizationList,unmount:e.unmountOrganizationList,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"OrganizationList",renderWhileLoading:!0}),e2=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,open:e.openGoogleOneTap,close:e.closeGoogleOneTap,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"GoogleOneTap",renderWhileLoading:!0}),e9=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountWaitlist,unmount:e.unmountWaitlist,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"Waitlist",renderWhileLoading:!0}),e4=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t,{selector:'[data-component-status="ready"]'})||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountPricingTable,unmount:e.unmountPricingTable,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"PricingTable",renderWhileLoading:!0}),e7=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountAPIKeys,unmount:e.unmountAPIKeys,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"ApiKeys",renderWhileLoading:!0}),e8=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountUserAvatar,unmount:e.unmountUserAvatar,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"UserAvatar",renderWhileLoading:!0}),te=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountTaskChooseOrganization,unmount:e.unmountTaskChooseOrganization,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"TaskChooseOrganization",renderWhileLoading:!0}),tt=Y(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===eN(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return em.default.createElement(em.default.Fragment,null,i&&r,e.loaded&&em.default.createElement(eW,{component:t,mount:e.mountTaskResetPassword,unmount:e.unmountTaskResetPassword,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"TaskResetPassword",renderWhileLoading:!0});e.s(["APIKeys",()=>e7,"CreateOrganization",()=>e1,"GoogleOneTap",()=>e2,"OrganizationList",()=>e6,"OrganizationProfile",()=>e0,"OrganizationSwitcher",()=>e5,"PricingTable",()=>e4,"SignIn",()=>eB,"SignUp",()=>eK,"TaskChooseOrganization",()=>te,"TaskResetPassword",()=>tt,"UserAvatar",()=>e8,"UserButton",()=>eX,"UserProfile",()=>eq,"Waitlist",()=>e9,"assertSingleChild",()=>ey,"isConstructor",()=>eP,"normalizeWithDefaultValue",()=>eb,"safeExecute",()=>e_,"withMaxAllowedInstancesGuard",()=>eS],758766);var tr=e=>{throw TypeError(e)},tn=(e,t,r)=>t.has(e)||tr("Cannot "+r),ti=(e,t,r)=>(tn(e,t,"read from private field"),r?r.call(e):t.get(e)),to=(e,t,r)=>t.has(e)?tr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ts=(e,t,r,n)=>(tn(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ta=(e,t,r)=>(tn(e,t,"access private method"),r);e.s(["__privateAdd",()=>to,"__privateGet",()=>ti,"__privateMethod",()=>ta,"__privateSet",()=>ts],115530),e.i(728578);let tl={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(e,t)=>t<5,retryImmediately:!1,jitter:!0},tu=async e=>new Promise(t=>setTimeout(t,e)),td=(e,t)=>t?e*(1+Math.random()):e,tc=async(e,t={})=>{var r;let n,i=0,{shouldRetry:o,initialDelay:s,maxDelayBetweenRetries:a,factor:l,retryImmediately:u,jitter:d,onBeforeRetry:c}={...tl,...t},h=(r={initialDelay:s,maxDelayBetweenRetries:a,factor:l,jitter:d},n=0,async()=>{let e;await tu((e=td(e=r.initialDelay*Math.pow(r.factor,n),r.jitter),Math.min(r.maxDelayBetweenRetries||e,e))),n++});for(;;)try{return await e()}catch(e){if(!o(e,++i))throw e;c&&await c(i),u&&1===i?await tu(td(100,d)):await h()}};async function th(e="",t){let{async:r,defer:n,beforeLoad:i,crossOrigin:o,nonce:s}=t||{};return tc(()=>new Promise((t,a)=>{e||a(Error("loadScript cannot be called without a src")),document&&document.body||a(Error("loadScript cannot be called when document does not exist"));let l=document.createElement("script");o&&l.setAttribute("crossorigin",o),l.async=r||!1,l.defer=n||!1,l.addEventListener("load",()=>{l.remove(),t(l)}),l.addEventListener("error",t=>{l.remove(),a(t.error??Error(`failed to load script: ${e}`))}),l.src=e,l.nonce=s,i?.(l),document.body.appendChild(l)}),{shouldRetry:(e,t)=>t<=5})}function tp(e){return e.startsWith("/")}let tf="failed_to_load_clerk_js",tg="Failed to load Clerk",{isDevOrStagingUrl:tm}=(0,f.createDevOrStagingUrlCache)(),tv=(0,h.buildErrorThrower)({packageName:"@clerk/shared"});function tk(e){tv.setPackageName({packageName:e})}function ty(){if("undefined"==typeof window||!window.Clerk)return!1;let e=window.Clerk;return"object"==typeof e&&"function"==typeof e.load}function tb(e,t){return new Promise((r,n)=>{let i=!1,o=(e,t)=>{clearTimeout(e),clearInterval(t)};t?.addEventListener("error",()=>{o(a,l),n(new h.ClerkRuntimeError(tg,{code:tf}))});let s=()=>{!i&&ty()&&(i=!0,o(a,l),r(null))},a=setTimeout(()=>{i||(i=!0,o(a,l),ty()?r(null):n(new h.ClerkRuntimeError(tg,{code:"failed_to_load_clerk_js_timeout"})))},e);s();let l=setInterval(()=>{i?clearInterval(l):s()},100)})}let t_=async e=>{let t=e?.scriptLoadTimeout??15e3;if(ty())return null;if(!e?.publishableKey)return tv.throwMissingPublishableKeyError(),null;let r=tP(e),n=document.querySelector("script[data-clerk-js-script]");if(n)if(function(e){if("undefined"==typeof window||!window.performance)return!1;let t=performance.getEntriesByName(e,"resource");if(0===t.length)return!1;let r=t[t.length-1];if(0===r.transferSize&&0===r.decodedBodySize&&(0===r.responseEnd||r.responseEnd>0&&r.responseStart>0||"responseStatus"in r&&(r.responseStatus>=400||0===r.responseStatus)))return!0;return!1}(r))n.remove();else try{return await tb(t,n),null}catch{n.remove()}let i=tb(t);return th(r,{async:!0,crossOrigin:"anonymous",nonce:e.nonce,beforeLoad:tS(e)}).catch(e=>{throw new h.ClerkRuntimeError(tg+(e.message?`, ${e.message}`:""),{code:tf,cause:e})}),i},tP=e=>{var t;let{clerkJSUrl:r,clerkJSVariant:n,clerkJSVersion:i,proxyUrl:o,domain:s,publishableKey:a}=e;if(r)return r;let l="";if(o&&(!o||(t=o,/^http(s)?:\/\//.test(t||""))||tp(o)))l=(!o?"":tp(o)?new URL(o,window.location.origin).toString():o).replace(/http(s)?:\/\//,"");else l=s&&!tm((0,f.parsePublishableKey)(a)?.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}return`clerk.${e.replace(t,"")}`}(s):(0,f.parsePublishableKey)(a)?.frontendApi||"";let u=n?`${n.replace(/\.+$/,"")}.`:"",d=((e,t="5.114.0")=>{let r;if(e)return e;let n=(r=t,r.trim().replace(/^v/,"").match(/-(.+?)(\.|$)/)?.[1]);if(n)return"snapshot"===n?"5.114.0":n;return t.trim().replace(/^v/,"").split(".")[0]})(i);return`https://${l}/npm/@clerk/clerk-js@${d}/dist/clerk.${u}browser.js`},tC=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),e.nonce&&(t.nonce=e.nonce),t},tS=e=>t=>{let r=tC(e);for(let e in r)t.setAttribute(e,r[e])};e.s(["buildClerkJsScriptAttributes",()=>tC,"clerkJsScriptUrl",()=>tP,"loadClerkJsScript",()=>t_,"setClerkJsLoadingErrorPackageName",()=>tk],30396);function tE(){return"undefined"!=typeof window}let tw=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");function tO(e){return!!e&&tw.test(e)}function tj(){let e=tE()?window?.navigator:null;return!!e&&!tO(e?.userAgent)&&!e?.webdriver}function tM(){let e=tE()?window?.navigator:null;if(!e)return!1;let t=e?.onLine;return e?.connection?.rtt!==0&&e?.connection?.downlink!==0&&t}function tI(){return tM()&&tj()}e.s(["inBrowser",()=>tE,"isBrowserOnline",()=>tM,"isValidBrowser",()=>tj,"isValidBrowserOnline",()=>tI,"userAgentIsRobot",()=>tO],168931),e.s([],337630);let tU=(e,t,r,n,i)=>{let{notify:o}=i||{},s=e.get(r);s||(s=[],e.set(r,s)),s.push(n),o&&t.has(r)&&n(t.get(r))},tz=(e,t,r)=>(e.get(t)||[]).map(e=>e(r)),tT=(e,t,r)=>{let n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},tR="status";var tA=e.i(421611);"undefined"==typeof window||window.global||(window.global=e.g);var tL=Y(({clerk:e,children:t,...r})=>{let{signUpFallbackRedirectUrl:n,forceRedirectUrl:i,fallbackRedirectUrl:o,signUpForceRedirectUrl:s,mode:a,initialValues:l,withSignUp:u,oauthFlow:d,...c}=r,h=ey(t=eb(t,"Sign in"))("SignInButton"),p=async t=>{let c;return h&&"object"==typeof h&&"props"in h&&await e_(h.props.onClick)(t),c={forceRedirectUrl:i,fallbackRedirectUrl:o,signUpFallbackRedirectUrl:n,signUpForceRedirectUrl:s,initialValues:l,withSignUp:u,oauthFlow:d},"modal"===a?e.openSignIn({...c,appearance:r.appearance}):e.redirectToSignIn({...c,signInFallbackRedirectUrl:o,signInForceRedirectUrl:i})},f={...c,onClick:p};return m.default.cloneElement(h,f)},{component:"SignInButton",renderWhileLoading:!0}),tx=Y(({clerk:e,children:t,...r})=>{let{redirectUrl:n,...i}=r,o=ey(t=eb(t,"Sign in with Metamask"))("SignInWithMetamaskButton"),s=async()=>{!async function(){await e.authenticateWithMetamask({redirectUrl:n||void 0})}()},a=async e=>(await e_(o.props.onClick)(e),s()),l={...i,onClick:a};return m.default.cloneElement(o,l)},{component:"SignInWithMetamask",renderWhileLoading:!0}),tN=Y(({clerk:e,children:t,...r})=>{let{redirectUrl:n="/",signOutOptions:i,...o}=r,s=ey(t=eb(t,"Sign out"))("SignOutButton"),a=async t=>(await e_(s.props.onClick)(t),e.signOut({redirectUrl:n,...i})),l={...o,onClick:a};return m.default.cloneElement(s,l)},{component:"SignOutButton",renderWhileLoading:!0}),tD=Y(({clerk:e,children:t,...r})=>{let{fallbackRedirectUrl:n,forceRedirectUrl:i,signInFallbackRedirectUrl:o,signInForceRedirectUrl:s,mode:a,initialValues:l,oauthFlow:u,...d}=r,c=ey(t=eb(t,"Sign up"))("SignUpButton"),h=async t=>{let d;return c&&"object"==typeof c&&"props"in c&&await e_(c.props.onClick)(t),d={fallbackRedirectUrl:n,forceRedirectUrl:i,signInFallbackRedirectUrl:o,signInForceRedirectUrl:s,initialValues:l,oauthFlow:u},"modal"===a?e.openSignUp({...d,appearance:r.appearance,unsafeMetadata:r.unsafeMetadata}):e.redirectToSignUp({...d,signUpFallbackRedirectUrl:n,signUpForceRedirectUrl:i})},p={...d,onClick:h};return m.default.cloneElement(c,p)},{component:"SignUpButton",renderWhileLoading:!0}),tW=class{constructor(e){this.isomorphicClerk=e,this.signInSignalProxy=this.buildSignInProxy(),this.signUpSignalProxy=this.buildSignUpProxy()}signInSignal(){return this.signInSignalProxy}signUpSignal(){return this.signUpSignalProxy}buildSignInProxy(){let e=this.gateProperty.bind(this),t=()=>this.client.signIn.__internal_future;return{errors:{fields:{identifier:null,password:null,code:null},raw:null,global:null},fetchStatus:"idle",signIn:{status:"needs_identifier",availableStrategies:[],isTransferable:!1,get id(){return e(t,"id",void 0)},get supportedFirstFactors(){return e(t,"supportedFirstFactors",[])},get supportedSecondFactors(){return e(t,"supportedSecondFactors",[])},get secondFactorVerification(){return e(t,"secondFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")}})},get identifier(){return e(t,"identifier",null)},get createdSessionId(){return e(t,"createdSessionId",null)},get userData(){return e(t,"userData",{})},get firstFactorVerification(){return e(t,"firstFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")}})},create:this.gateMethod(t,"create"),password:this.gateMethod(t,"password"),sso:this.gateMethod(t,"sso"),finalize:this.gateMethod(t,"finalize"),emailCode:this.wrapMethods(()=>t().emailCode,["sendCode","verifyCode"]),emailLink:this.wrapStruct(()=>t().emailLink,["sendLink","waitForVerification"],["verification"],{verification:null}),resetPasswordEmailCode:this.wrapMethods(()=>t().resetPasswordEmailCode,["sendCode","verifyCode","submitPassword"]),phoneCode:this.wrapMethods(()=>t().phoneCode,["sendCode","verifyCode"]),mfa:this.wrapMethods(()=>t().mfa,["sendPhoneCode","verifyPhoneCode","verifyTOTP","verifyBackupCode"]),ticket:this.gateMethod(t,"ticket"),passkey:this.gateMethod(t,"passkey"),web3:this.gateMethod(t,"web3")}}}buildSignUpProxy(){let e=this.gateProperty.bind(this),t=this.gateMethod.bind(this),r=this.wrapMethods.bind(this),n=()=>this.client.signUp.__internal_future;return{errors:{fields:{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null},raw:null,global:null},fetchStatus:"idle",signUp:{get id(){return e(n,"id",void 0)},get requiredFields(){return e(n,"requiredFields",[])},get optionalFields(){return e(n,"optionalFields",[])},get missingFields(){return e(n,"missingFields",[])},get username(){return e(n,"username",null)},get firstName(){return e(n,"firstName",null)},get lastName(){return e(n,"lastName",null)},get emailAddress(){return e(n,"emailAddress",null)},get phoneNumber(){return e(n,"phoneNumber",null)},get web3Wallet(){return e(n,"web3Wallet",null)},get hasPassword(){return e(n,"hasPassword",!1)},get unsafeMetadata(){return e(n,"unsafeMetadata",{})},get createdSessionId(){return e(n,"createdSessionId",null)},get createdUserId(){return e(n,"createdUserId",null)},get abandonAt(){return e(n,"abandonAt",null)},get legalAcceptedAt(){return e(n,"legalAcceptedAt",null)},get locale(){return e(n,"locale",null)},get status(){return e(n,"status","missing_requirements")},get unverifiedFields(){return e(n,"unverifiedFields",[])},get isTransferable(){return e(n,"isTransferable",!1)},create:t(n,"create"),update:t(n,"update"),sso:t(n,"sso"),password:t(n,"password"),ticket:t(n,"ticket"),web3:t(n,"web3"),finalize:t(n,"finalize"),verifications:r(()=>n().verifications,["sendEmailCode","verifyEmailCode","sendPhoneCode","verifyPhoneCode"])}}}__internal_effect(e){throw Error("__internal_effect called before Clerk is loaded")}__internal_computed(e){throw Error("__internal_computed called before Clerk is loaded")}get client(){let e=this.isomorphicClerk.client;if(!e)throw Error("Clerk client not ready");return e}gateProperty(e,t,r){return tE()&&this.isomorphicClerk.loaded?e()[t]:r}gateMethod(e,t){return async(...r)=>{if(!tE())return k.throw(`Attempted to call a method (${t}) that is not supported on the server.`);this.isomorphicClerk.loaded||await new Promise(e=>this.isomorphicClerk.addOnLoaded(e));let n=e();return n[t].apply(n,r)}}wrapMethods(e,t){return Object.fromEntries(t.map(t=>[t,this.gateMethod(e,t)]))}wrapStruct(e,t,r,n){let i={};for(let r of t)i[r]=this.gateMethod(e,r);for(let t of r)Object.defineProperty(i,t,{get:()=>this.gateProperty(e,t,n[t]),enumerable:!0});return i}};void 0===globalThis.__BUILD_DISABLE_RHC__&&(globalThis.__BUILD_DISABLE_RHC__=!1);var tF={name:"@clerk/clerk-react",version:"5.58.1",environment:"production"},tB=class t{constructor(e){to(this,d),this.clerkjs=null,this.preopenOneTap=null,this.preopenUserVerification=null,this.preopenEnableOrganizationsPrompt=null,this.preopenSignIn=null,this.preopenCheckout=null,this.preopenPlanDetails=null,this.preopenSubscriptionDetails=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenCreateOrganization=null,this.preOpenWaitlist=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserAvatarNodes=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.premountWaitlistNodes=new Map,this.premountPricingTableNodes=new Map,this.premountAPIKeysNodes=new Map,this.premountOAuthConsentNodes=new Map,this.premountTaskChooseOrganizationNodes=new Map,this.premountTaskResetPasswordNodes=new Map,this.premountAddListenerCalls=new Map,this.loadedListeners=[],to(this,n,"loading"),to(this,i),to(this,o),to(this,s),to(this,a,(()=>{let e,t,r;return e=new Map,t=new Map,r=new Map,{on:(...r)=>tU(e,t,...r),prioritizedOn:(...e)=>tU(r,t,...e),emit:(n,i)=>{t.set(n,i),tz(r,n,i),tz(e,n,i)},off:(...t)=>tT(e,...t),prioritizedOff:(...e)=>tT(r,...e),internal:{retrieveListeners:t=>e.get(t)||[]}}})()),to(this,l),this.buildSignInUrl=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildSignInUrl(e))||""};if(this.clerkjs&&this.loaded)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&&this.loaded)return t();this.premountMethodCalls.set("buildSignUpUrl",t)},this.buildAfterSignInUrl=(...e)=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildAfterSignInUrl(...e))||""};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("buildAfterSignInUrl",t)},this.buildAfterSignUpUrl=(...e)=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildAfterSignUpUrl(...e))||""};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("buildAfterSignUpUrl",t)},this.buildAfterSignOutUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterSignOutUrl())||""};if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set("buildAfterSignOutUrl",e)},this.buildNewSubscriptionRedirectUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildNewSubscriptionRedirectUrl())||""};if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set("buildNewSubscriptionRedirectUrl",e)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterMultiSessionSingleSignOutUrl())||""};if(this.clerkjs&&this.loaded)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&&this.loaded)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&&this.loaded)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&&this.loaded)return e();this.premountMethodCalls.set("buildOrganizationProfileUrl",e)},this.buildWaitlistUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildWaitlistUrl())||""};if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set("buildWaitlistUrl",e)},this.buildTasksUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildTasksUrl())||""};if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set("buildTasksUrl",e)},this.buildUrlWithAuth=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildUrlWithAuth(e))||""};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("buildUrlWithAuth",t)},this.handleUnauthenticated=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.handleUnauthenticated()};this.clerkjs&&this.loaded?e():this.premountMethodCalls.set("handleUnauthenticated",e)},this.on=(...e)=>{var t;if(null==(t=this.clerkjs)?void 0:t.on)return this.clerkjs.on(...e);ti(this,a).on(...e)},this.off=(...e)=>{var t;if(null==(t=this.clerkjs)?void 0:t.off)return this.clerkjs.off(...e);ti(this,a).off(...e)},this.addOnLoaded=e=>{this.loadedListeners.push(e),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>{this.loadedListeners.forEach(e=>e()),this.loadedListeners=[]},this.beforeLoad=e=>{if(!e)throw Error("Failed to hydrate latest Clerk JS")},this.hydrateClerkJS=e=>{var t,r;if(!e)throw Error("Failed to hydrate latest Clerk JS");return this.clerkjs=e,this.premountMethodCalls.forEach(e=>e()),this.premountAddListenerCalls.forEach((t,r)=>{t.nativeUnsubscribe=e.addListener(r)}),null==(t=ti(this,a).internal.retrieveListeners("status"))||t.forEach(e=>{this.on("status",e,{notify:!0})}),null==(r=ti(this,a).internal.retrieveListeners("queryClientStatus"))||r.forEach(e=>{this.on("queryClientStatus",e,{notify:!0})}),null!==this.preopenSignIn&&e.openSignIn(this.preopenSignIn),null!==this.preopenCheckout&&e.__internal_openCheckout(this.preopenCheckout),null!==this.preopenPlanDetails&&e.__internal_openPlanDetails(this.preopenPlanDetails),null!==this.preopenSubscriptionDetails&&e.__internal_openSubscriptionDetails(this.preopenSubscriptionDetails),null!==this.preopenSignUp&&e.openSignUp(this.preopenSignUp),null!==this.preopenUserProfile&&e.openUserProfile(this.preopenUserProfile),null!==this.preopenUserVerification&&e.__internal_openReverification(this.preopenUserVerification),null!==this.preopenOneTap&&e.openGoogleOneTap(this.preopenOneTap),null!==this.preopenOrganizationProfile&&e.openOrganizationProfile(this.preopenOrganizationProfile),null!==this.preopenCreateOrganization&&e.openCreateOrganization(this.preopenCreateOrganization),null!==this.preOpenWaitlist&&e.openWaitlist(this.preOpenWaitlist),this.preopenEnableOrganizationsPrompt&&e.__internal_openEnableOrganizationsPrompt(this.preopenEnableOrganizationsPrompt),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.premountUserAvatarNodes.forEach((t,r)=>{e.mountUserAvatar(r,t)}),this.premountUserButtonNodes.forEach((t,r)=>{e.mountUserButton(r,t)}),this.premountOrganizationListNodes.forEach((t,r)=>{e.mountOrganizationList(r,t)}),this.premountWaitlistNodes.forEach((t,r)=>{e.mountWaitlist(r,t)}),this.premountPricingTableNodes.forEach((t,r)=>{e.mountPricingTable(r,t)}),this.premountAPIKeysNodes.forEach((t,r)=>{e.mountAPIKeys(r,t)}),this.premountOAuthConsentNodes.forEach((t,r)=>{e.__internal_mountOAuthConsent(r,t)}),this.premountTaskChooseOrganizationNodes.forEach((t,r)=>{e.mountTaskChooseOrganization(r,t)}),this.premountTaskResetPasswordNodes.forEach((t,r)=>{e.mountTaskResetPassword(r,t)}),void 0===this.clerkjs.status&&ti(this,a).emit(tR,"ready"),this.emitLoaded(),this.clerkjs},this.__experimental_checkout=(...e)=>{var t;return null==(t=this.clerkjs)?void 0:t.__experimental_checkout(...e)},this.__unstable__updateProps=async e=>{let t=await ta(this,d,c).call(this);if(t&&"__unstable__updateProps"in t)return t.__unstable__updateProps(e)},this.setActive=e=>this.clerkjs?this.clerkjs.setActive(e):Promise.reject(),this.openSignIn=e=>{this.clerkjs&&this.loaded?this.clerkjs.openSignIn(e):this.preopenSignIn=e},this.closeSignIn=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.__internal_openCheckout=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openCheckout(e):this.preopenCheckout=e},this.__internal_closeCheckout=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeCheckout():this.preopenCheckout=null},this.__internal_openPlanDetails=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openPlanDetails(e):this.preopenPlanDetails=e},this.__internal_closePlanDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closePlanDetails():this.preopenPlanDetails=null},this.__internal_openSubscriptionDetails=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openSubscriptionDetails(e):this.preopenSubscriptionDetails=null!=e?e:null},this.__internal_closeSubscriptionDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeSubscriptionDetails():this.preopenSubscriptionDetails=null},this.__internal_openReverification=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openReverification(e):this.preopenUserVerification=e},this.__internal_closeReverification=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeReverification():this.preopenUserVerification=null},this.__internal_openEnableOrganizationsPrompt=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openEnableOrganizationsPrompt(e):this.preopenEnableOrganizationsPrompt=e},this.__internal_closeEnableOrganizationsPrompt=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeEnableOrganizationsPrompt():this.preopenEnableOrganizationsPrompt=null},this.openGoogleOneTap=e=>{this.clerkjs&&this.loaded?this.clerkjs.openGoogleOneTap(e):this.preopenOneTap=e},this.closeGoogleOneTap=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.openUserProfile(e):this.preopenUserProfile=e},this.closeUserProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.openOrganizationProfile(e):this.preopenOrganizationProfile=e},this.closeOrganizationProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openCreateOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.openCreateOrganization(e):this.preopenCreateOrganization=e},this.closeCreateOrganization=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openWaitlist=e=>{this.clerkjs&&this.loaded?this.clerkjs.openWaitlist(e):this.preOpenWaitlist=e},this.closeWaitlist=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeWaitlist():this.preOpenWaitlist=null},this.openSignUp=e=>{this.clerkjs&&this.loaded?this.clerkjs.openSignUp(e):this.preopenSignUp=e},this.closeSignUp=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignUp():this.preopenSignUp=null},this.mountSignIn=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignIn(e,t):this.premountSignInNodes.set(e,t)},this.unmountSignIn=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignIn(e):this.premountSignInNodes.delete(e)},this.mountSignUp=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignUp(e,t):this.premountSignUpNodes.set(e,t)},this.unmountSignUp=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignUp(e):this.premountSignUpNodes.delete(e)},this.mountUserAvatar=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserAvatar(e,t):this.premountUserAvatarNodes.set(e,t)},this.unmountUserAvatar=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserAvatar(e):this.premountUserAvatarNodes.delete(e)},this.mountUserProfile=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserProfile(e,t):this.premountUserProfileNodes.set(e,t)},this.unmountUserProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserProfile(e):this.premountUserProfileNodes.delete(e)},this.mountOrganizationProfile=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationProfile(e,t):this.premountOrganizationProfileNodes.set(e,t)},this.unmountOrganizationProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationProfile(e):this.premountOrganizationProfileNodes.delete(e)},this.mountCreateOrganization=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountCreateOrganization(e,t):this.premountCreateOrganizationNodes.set(e,t)},this.unmountCreateOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountCreateOrganization(e):this.premountCreateOrganizationNodes.delete(e)},this.mountOrganizationSwitcher=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationSwitcher(e,t):this.premountOrganizationSwitcherNodes.set(e,t)},this.unmountOrganizationSwitcher=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationSwitcher(e):this.premountOrganizationSwitcherNodes.delete(e)},this.__experimental_prefetchOrganizationSwitcher=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.__experimental_prefetchOrganizationSwitcher()};this.clerkjs&&this.loaded?e():this.premountMethodCalls.set("__experimental_prefetchOrganizationSwitcher",e)},this.mountOrganizationList=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationList(e,t):this.premountOrganizationListNodes.set(e,t)},this.unmountOrganizationList=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationList(e):this.premountOrganizationListNodes.delete(e)},this.mountUserButton=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserButton(e,t):this.premountUserButtonNodes.set(e,t)},this.unmountUserButton=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserButton(e):this.premountUserButtonNodes.delete(e)},this.mountWaitlist=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountWaitlist(e,t):this.premountWaitlistNodes.set(e,t)},this.unmountWaitlist=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountWaitlist(e):this.premountWaitlistNodes.delete(e)},this.mountPricingTable=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountPricingTable(e,t):this.premountPricingTableNodes.set(e,t)},this.unmountPricingTable=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountPricingTable(e):this.premountPricingTableNodes.delete(e)},this.mountAPIKeys=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountAPIKeys(e,t):this.premountAPIKeysNodes.set(e,t)},this.unmountAPIKeys=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountAPIKeys(e):this.premountAPIKeysNodes.delete(e)},this.__internal_mountOAuthConsent=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_mountOAuthConsent(e,t):this.premountOAuthConsentNodes.set(e,t)},this.__internal_unmountOAuthConsent=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_unmountOAuthConsent(e):this.premountOAuthConsentNodes.delete(e)},this.mountTaskChooseOrganization=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskChooseOrganization(e,t):this.premountTaskChooseOrganizationNodes.set(e,t)},this.unmountTaskChooseOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskChooseOrganization(e):this.premountTaskChooseOrganizationNodes.delete(e)},this.mountTaskResetPassword=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskResetPassword(e,t):this.premountTaskResetPasswordNodes.set(e,t)},this.unmountTaskResetPassword=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskResetPassword(e):this.premountTaskResetPasswordNodes.delete(e)},this.addListener=e=>{if(this.clerkjs)return this.clerkjs.addListener(e);{let t=()=>{var t;let r=this.premountAddListenerCalls.get(e);r&&(null==(t=r.nativeUnsubscribe)||t.call(r),this.premountAddListenerCalls.delete(e))};return this.premountAddListenerCalls.set(e,{unsubscribe:t,nativeUnsubscribe:void 0}),t}},this.navigate=e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.navigate(e)};this.clerkjs&&this.loaded?t():this.premountMethodCalls.set("navigate",t)},this.redirectWithAuth=async(...e)=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectWithAuth(...e)};return this.clerkjs&&this.loaded?t():void this.premountMethodCalls.set("redirectWithAuth",t)},this.redirectToSignIn=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectToSignIn(e)};return this.clerkjs&&this.loaded?t():void this.premountMethodCalls.set("redirectToSignIn",t)},this.redirectToSignUp=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectToSignUp(e)};return this.clerkjs&&this.loaded?t():void this.premountMethodCalls.set("redirectToSignUp",t)},this.redirectToUserProfile=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToUserProfile()};return this.clerkjs&&this.loaded?e():void this.premountMethodCalls.set("redirectToUserProfile",e)},this.redirectToAfterSignUp=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignUp()};if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set("redirectToAfterSignUp",e)},this.redirectToAfterSignIn=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignIn()};this.clerkjs&&this.loaded?e():this.premountMethodCalls.set("redirectToAfterSignIn",e)},this.redirectToAfterSignOut=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignOut()};this.clerkjs&&this.loaded?e():this.premountMethodCalls.set("redirectToAfterSignOut",e)},this.redirectToOrganizationProfile=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToOrganizationProfile()};return this.clerkjs&&this.loaded?e():void this.premountMethodCalls.set("redirectToOrganizationProfile",e)},this.redirectToCreateOrganization=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToCreateOrganization()};return this.clerkjs&&this.loaded?e():void this.premountMethodCalls.set("redirectToCreateOrganization",e)},this.redirectToWaitlist=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToWaitlist()};return this.clerkjs&&this.loaded?e():void this.premountMethodCalls.set("redirectToWaitlist",e)},this.redirectToTasks=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectToTasks(e)};return this.clerkjs&&this.loaded?t():void this.premountMethodCalls.set("redirectToTasks",t)},this.handleRedirectCallback=async e=>{var t;let r=()=>{var t;return null==(t=this.clerkjs)?void 0:t.handleRedirectCallback(e)};this.clerkjs&&this.loaded?null==(t=r())||t.catch(()=>{}):this.premountMethodCalls.set("handleRedirectCallback",r)},this.handleGoogleOneTapCallback=async(e,t)=>{var r;let n=()=>{var r;return null==(r=this.clerkjs)?void 0:r.handleGoogleOneTapCallback(e,t)};this.clerkjs&&this.loaded?null==(r=n())||r.catch(()=>{}):this.premountMethodCalls.set("handleGoogleOneTapCallback",n)},this.handleEmailLinkVerification=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.handleEmailLinkVerification(e)};if(this.clerkjs&&this.loaded)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&&this.loaded)return t();this.premountMethodCalls.set("authenticateWithMetamask",t)},this.authenticateWithCoinbaseWallet=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithCoinbaseWallet(e)};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("authenticateWithCoinbaseWallet",t)},this.authenticateWithBase=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithBase(e)};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("authenticateWithBase",t)},this.authenticateWithOKXWallet=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithOKXWallet(e)};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("authenticateWithOKXWallet",t)},this.authenticateWithWeb3=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithWeb3(e)};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("authenticateWithWeb3",t)},this.authenticateWithGoogleOneTap=async e=>(await ta(this,d,c).call(this)).authenticateWithGoogleOneTap(e),this.__internal_loadStripeJs=async()=>(await ta(this,d,c).call(this)).__internal_loadStripeJs(),this.createOrganization=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.createOrganization(e)};if(this.clerkjs&&this.loaded)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&&this.loaded)return t();this.premountMethodCalls.set("getOrganization",t)},this.joinWaitlist=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.joinWaitlist(e)};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("joinWaitlist",t)},this.signOut=async(...e)=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.signOut(...e)};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("signOut",t)},this.__internal_attemptToEnableEnvironmentSetting=e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.__internal_attemptToEnableEnvironmentSetting(e)};if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set("__internal_attemptToEnableEnvironmentSetting",t)};const{Clerk:t=null,publishableKey:r}=e||{};ts(this,s,r),ts(this,o,null==e?void 0:e.proxyUrl),ts(this,i,null==e?void 0:e.domain),this.options=e,this.Clerk=t,this.mode=tE()?"browser":"server",ts(this,l,new tW(this)),this.options.sdkMetadata||(this.options.sdkMetadata=tF),ti(this,a).emit(tR,"loading"),ti(this,a).prioritizedOn(tR,e=>ts(this,n,e)),ti(this,s)&&this.loadClerkJS()}get publishableKey(){return ti(this,s)}get loaded(){var e;return(null==(e=this.clerkjs)?void 0:e.loaded)||!1}get status(){var e;return this.clerkjs?(null==(e=this.clerkjs)?void 0:e.status)||(this.clerkjs.loaded?"ready":"loading"):ti(this,n)}static getOrCreateInstance(e){return tE()&&ti(this,u)&&(!e.Clerk||ti(this,u).Clerk===e.Clerk)&&ti(this,u).publishableKey===e.publishableKey||ts(this,u,new t(e)),ti(this,u)}static clearInstance(){ts(this,u,null)}get domain(){return"undefined"!=typeof window&&window.location?(0,tA.handleValueOrFn)(ti(this,i),new URL(window.location.href),""):"function"==typeof ti(this,i)?k.throw(w):ti(this,i)||""}get proxyUrl(){return"undefined"!=typeof window&&window.location?(0,tA.handleValueOrFn)(ti(this,o),new URL(window.location.href),""):"function"==typeof ti(this,o)?k.throw(w):ti(this,o)||""}__internal_getOption(e){var t,r;return(null==(t=this.clerkjs)?void 0:t.__internal_getOption)?null==(r=this.clerkjs)?void 0:r.__internal_getOption(e):this.options[e]}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 __internal_queryClient(){var e;return null==(e=this.clerkjs)?void 0:e.__internal_queryClient}get isSatellite(){return"undefined"!=typeof window&&window.location?(0,tA.handleValueOrFn)(this.options.isSatellite,new URL(window.location.href),!1):"function"==typeof this.options.isSatellite&&k.throw(w)}async loadClerkJS(){var t;if("browser"===this.mode&&!this.loaded){"undefined"!=typeof window&&(window.__clerk_publishable_key=ti(this,s),window.__clerk_proxy_url=this.proxyUrl,window.__clerk_domain=this.domain);try{if(this.Clerk){let t;eP(this.Clerk)?(t=new this.Clerk(ti(this,s),{proxyUrl:this.proxyUrl,domain:this.domain}),this.beforeLoad(t),await t.load(this.options)):(t=this.Clerk).loaded||(this.beforeLoad(t),await t.load(this.options)),e.g.Clerk=t}else if(!__BUILD_DISABLE_RHC__){if(e.g.Clerk||await t_({...this.options,publishableKey:ti(this,s),proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),!e.g.Clerk)throw Error("Failed to download latest ClerkJS. Contact support@clerk.com.");this.beforeLoad(e.g.Clerk),await e.g.Clerk.load(this.options)}if(null==(t=e.g.Clerk)?void 0:t.loaded)return this.hydrateClerkJS(e.g.Clerk);return}catch(e){ti(this,a).emit(tR,"error"),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}get isSignedIn(){return!!this.clerkjs&&this.clerkjs.isSignedIn}get billing(){var e;return null==(e=this.clerkjs)?void 0:e.billing}get __internal_state(){return this.loaded&&this.clerkjs?this.clerkjs.__internal_state:ti(this,l)}get apiKeys(){var e;return null==(e=this.clerkjs)?void 0:e.apiKeys}__unstable__setEnvironment(...e){this.clerkjs&&"__unstable__setEnvironment"in this.clerkjs&&this.clerkjs.__unstable__setEnvironment(e)}};function tK(e){var t,r,n;let i,o,s,a,l,u,d,c,h,p,f,g,k,y,_,C,S,E,{isomorphicClerkOptions:w,initialState:O,children:j}=e,{isomorphicClerk:M,clerkStatus:I}=tV(w),[U,z]=m.default.useState({client:M.client,session:M.session,user:M.user,organization:M.organization});m.default.useEffect(()=>M.addListener(e=>z({...e})),[]);let T=(t=M.loaded,!t&&O?(i=(r=O).userId,o=r.user,s=r.sessionId,a=r.sessionStatus,l=r.sessionClaims,{userId:i,user:o,sessionId:s,session:r.session,sessionStatus:a,sessionClaims:l,organization:r.organization,orgId:r.orgId,orgRole:r.orgRole,orgPermissions:r.orgPermissions,orgSlug:r.orgSlug,actor:r.actor,factorVerificationAge:r.factorVerificationAge}):(u=(n=U).user?n.user.id:n.user,d=n.user,c=n.session?n.session.id:n.session,h=n.session,p=n.session?.status,f=n.session?n.session.lastActiveToken?.jwt?.claims:null,g=n.session?n.session.factorVerificationAge:null,k=h?.actor,y=n.organization,_=n.organization?n.organization.id:n.organization,C=y?.slug,E=(S=y?d?.organizationMemberships?.find(e=>e.organization.id===_):y)?S.permissions:S,{userId:u,user:d,sessionId:c,session:h,sessionStatus:p,sessionClaims:f,organization:y,orgId:_,orgRole:S?S.role:S,orgSlug:C,orgPermissions:E,actor:k,factorVerificationAge:g})),R=m.default.useMemo(()=>({value:M}),[I]),A=m.default.useMemo(()=>({value:U.client}),[U.client]),{sessionId:L,sessionStatus:x,sessionClaims:N,session:D,userId:W,user:F,orgId:B,actor:K,organization:V,orgRole:$,orgSlug:q,orgPermissions:G,factorVerificationAge:J}=T,H=m.default.useMemo(()=>({value:{sessionId:L,sessionStatus:x,sessionClaims:N,userId:W,actor:K,orgId:B,orgRole:$,orgSlug:q,orgPermissions:G,factorVerificationAge:J}}),[L,x,W,K,B,$,q,J,null==N?void 0:N.__raw]),Y=m.default.useMemo(()=>({value:D}),[L,D]),X=m.default.useMemo(()=>({value:F}),[W,F]),Q=m.default.useMemo(()=>({value:{organization:V}}),[B,V]);return m.default.createElement(P.Provider,{value:R},m.default.createElement(v.ClientContext.Provider,{value:A},m.default.createElement(v.SessionContext.Provider,{value:Y},m.default.createElement(v.OrganizationProvider,{...Q.value},m.default.createElement(b.Provider,{value:H},m.default.createElement(v.UserContext.Provider,{value:X},m.default.createElement(v.__experimental_CheckoutProvider,{value:void 0},j)))))))}n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakSet,c=function(){return new Promise(e=>{this.addOnLoaded(()=>e(this.clerkjs))})},to(tB,u);var tV=e=>{let t=m.default.useRef(tB.getOrCreateInstance(e)),[r,n]=m.default.useState(t.current.status);return m.default.useEffect(()=>{t.current.__unstable__updateProps({appearance:e.appearance})},[e.appearance]),m.default.useEffect(()=>{t.current.__unstable__updateProps({options:e})},[e.localization]),m.default.useEffect(()=>(t.current.on("status",n),()=>{t.current&&t.current.off("status",n),tB.clearInstance()}),[]),{isomorphicClerk:t.current,clerkStatus:r}},t$=eS(function(e){let{initialState:t,children:r,__internal_bypassMissingPublishableKey:n,...i}=e,{publishableKey:o="",Clerk:s}=i;return s||n||(o?o&&!(0,f.isPublishableKey)(o)&&k.throwInvalidPublishableKeyError({key:o}):k.throwMissingPublishableKeyError()),m.default.createElement(tK,{initialState:t,isomorphicClerkOptions:i},r)},"ClerkProvider",S);function tq(e,t,r){let n=t.path||(null==r?void 0:r.path);return"path"===(t.routing||(null==r?void 0:r.routing)||"path")?n?{...r,...t,routing:"path"}:k.throw(R(e)):t.path?k.throw(A(e)):{...r,...t,path:void 0}}t$.displayName="ClerkProvider",y({packageName:"@clerk/clerk-react"}),tk("@clerk/clerk-react"),e.s(["ClerkProvider",()=>t$,"SignInButton",()=>tL,"SignInWithMetamaskButton",()=>tx,"SignOutButton",()=>tN,"SignUpButton",()=>tD],895764),e.s(["useRoutingProps",()=>tq],32007)},371697,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return n}});let n=e.r(710186)._(e.r(136357)).default.createContext(null)},906094,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useRouter",{enumerable:!0,get:function(){return o}});let n=e.r(136357),i=e.r(371697);function o(){return(0,n.useContext)(i.RouterContext)}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},889893,(e,t,r)=>{t.exports=e.r(906094)}]);