(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86825,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!!e.kind&&"object"==typeof r&&null!==r&&"constructor"in r&&r.constructor?.kind===e.kind||r instanceof e}}var r=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,i){let n="Clerk:",a=RegExp(n.replace(" ","\\s*"),"i");return t=t.replace(a,""),t=`${n} ${t.trim()}

(code="${r}")

`,i&&(t+=`

Docs: ${i}`),t}},i=class e extends r{static kind="ClerkRuntimeError";clerkRuntimeError=!0;constructor(t,r){super({...r,message:t}),Object.setPrototypeOf(this,e.prototype)}};let n=t(i);e.s(["a",0,t,"i",0,function(e){return t(r)(e)||!!e&&"object"==typeof e&&"clerkError"in e&&!0===e.clerkError},"n",0,n,"r",0,r,"t",0,i])},86165,e=>{"use strict";var t=e.i(86825),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}};let i=(0,t.a)(r);var n=class e extends t.r{static kind="ClerkAPIResponseError";status;clerkTraceId;retryAfter;errors;constructor(t,i){const{data:n,status:a,clerkTraceId:s,retryAfter:o}=i;super({...i,message:t,code:"api_response_error"}),Object.setPrototypeOf(this,e.prototype),this.status=a,this.clerkTraceId=s,this.retryAfter=o,this.errors=(n||[]).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,i){return t}};let a=(0,t.a)(n);var s=class e extends n{static kind="MissingExpiredTokenError";static ERROR_CODE="missing_expired_token";static STATUS=422;static is(t){return a(t)&&t.status===e.STATUS&&t.errors.length>0&&t.errors[0].code===e.ERROR_CODE}},o=class e extends t.t{static kind="ClerkOfflineError";static ERROR_CODE="clerk_offline";constructor(t){super(t,{code:e.ERROR_CODE}),Object.setPrototypeOf(this,e.prototype)}static is(r){return null!=r&&(r instanceof e||(0,t.n)(r)&&r.code===e.ERROR_CODE)}};let l=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"});var u=class e extends Error{code;constructor(t){super(t),this.code=t,this.name="EmailLinkError",Object.setPrototypeOf(this,e.prototype)}},c=class extends t.t{code;constructor(e,{code:t}){super(e,{code:t}),this.code=t}};function d(e){return"code"in e&&[4001,32602,32603].includes(e.code)&&"message"in e}e.s(["C",0,a,"D",0,r,"E",0,function(e=[]){return e.length>0?e.map(e=>new r(e)):[]},"O",0,i,"S",0,n,"T",0,function(e){return new r(e)},"_",0,{Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"},"a",0,function(e){return"EmailLinkError"===e.name},"b",0,o,"c",0,function(e){return(`${e.message}${e.name}`||"").toLowerCase().replace(/\s+/g,"").includes("networkerror")},"d",0,function(e){return(0,t.n)(e)&&"reverification_cancelled"===e.code},"f",0,function(e){let t=e?.status;return 401===t||422===t},"g",0,u,"h",0,c,"i",0,function(e){return["captcha_invalid","captcha_not_enabled","captcha_missing_token"].includes(e.errors[0].code)},"l",0,function(e){return a(e)&&e.errors?.[0]?.code==="form_password_compromised"},"m",0,function(e){return a(e)&&e.errors?.[0]?.code==="user_locked"},"n",0,function(e){return e?.status===429},"o",0,function(e){return a(e)||d(e)||(0,t.n)(e)},"p",0,function(e){let t=e?.status;return e?.errors?.[0]?.code==="authentication_invalid"&&401===t},"r",0,function(e){let t=e?.status;return!!t&&t>=400&&t<500},"s",0,d,"t",0,function(e){for(let[r,i]of Object.entries({isClerkAPIResponseError:a,isClerkRuntimeError:t.n}))Object.assign(e,{[r]:i});return e},"u",0,function(e){return a(e)&&e.errors?.[0]?.code==="form_password_pwned"},"v",0,{Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"},"w",0,function(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}}},"x",0,s,"y",0,function({packageName:e,customMessages:t}){let r=e;function i(e,t){if(!t)return`${r}: ${e}`;let i=e;for(let r of e.matchAll(/{{([a-zA-Z0-9-_]+)}}/g)){let e=(t[r[1]]||"").toString();i=i.replace(`{{${r[1]}}}`,e)}return`${r}: ${i}`}let n={...l,...t};return{setPackageName({packageName:e}){return"string"==typeof e&&(r=e),this},setMessages({customMessages:e}){return Object.assign(n,e||{}),this},throwInvalidPublishableKeyError(e){throw Error(i(n.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw Error(i(n.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw Error(i(n.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(i(n.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw Error(i(n.MissingClerkProvider,e))},throw(e){throw Error(i(e))}}}])},80921,56590,95943,e=>{"use strict";let t="reverification-error";e.s(["n",0,e=>({clerk_error:{type:"forbidden",reason:t,metadata:{reverification:e}}}),"t",0,e=>e&&"object"==typeof e&&"clerk_error"in e&&e.clerk_error?.type==="forbidden"&&e.clerk_error?.reason===t],80921);let r={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"}},i=new Set(["first_factor","second_factor","multi_factor"]),n=new Set(["strict_mfa","strict","moderate","lax"]),a=new Set(["o","org","organization"]),s=new Set(["u","user"]),o=(e,t)=>{let{org:r,user:i}=l(e),[n,o]=t.split(":"),u=void 0!==o,c=o||n;if(u&&!a.has(n)&&!s.has(n))throw Error(`Invalid scope: ${n}`);if(u){if(a.has(n))return r.includes(c);if(s.has(n))return i.includes(c)}return[...r,...i].includes(c)},l=e=>{let t=[],r=[];if(!e)return{org:t,user:r};let i=e.split(",");for(let e=0;e<i.length;e++){let n=i[e].trim(),a=n.indexOf(":");if(-1===a)throw Error(`Invalid claim element (missing colon): ${n}`);let s=n.slice(0,a),o=n.slice(a+1);"o"===s?t.push(o):"u"===s?r.push(o):("ou"===s||"uo"===s)&&(t.push(o),r.push(o))}return{org:t,user:r}},u=e=>{let t,a;if(!e)return!1;let s="string"==typeof e&&n.has(e),o="object"==typeof e&&(t=e.level,i.has(t))&&"number"==typeof(a=e.afterMinutes)&&a>0;return(!!s||!!o)&&(e=>"string"==typeof e?r[e]:e).bind(null,e)};e.s(["i",0,u,"n",0,({authObject:{sessionId:e,sessionStatus:t,userId:r,actor:i,orgId:n,orgRole:a,orgSlug:s,signOut:o,getToken:l,has:u,sessionClaims:c},options:{treatPendingAsSignedOut:d=!0}})=>void 0===e&&void 0===r?{actor:void 0,getToken:l,has:()=>!1,isLoaded:!1,isSignedIn:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,sessionClaims:void 0,sessionId:e,signOut:o,userId:r}:null===e&&null===r?{actor:null,getToken:l,has:()=>!1,isLoaded:!0,isSignedIn:!1,orgId:null,orgRole:null,orgSlug:null,sessionClaims:null,sessionId:e,signOut:o,userId:r}:d&&"pending"===t?{actor:null,getToken:l,has:()=>!1,isLoaded:!0,isSignedIn:!1,orgId:null,orgRole:null,orgSlug:null,sessionClaims:null,sessionId:null,signOut:o,userId:null}:e&&c&&r&&n&&a?{actor:i||null,getToken:l,has:u,isLoaded:!0,isSignedIn:!0,orgId:n,orgRole:a,orgSlug:s||null,sessionClaims:c,sessionId:e,signOut:o,userId:r}:e&&c&&r&&!n?{actor:i||null,getToken:l,has:u,isLoaded:!0,isSignedIn:!0,orgId:null,orgRole:null,orgSlug:null,sessionClaims:c,sessionId:e,signOut:o,userId:r}:void 0,"t",0,e=>t=>{if(!e.userId)return!1;let r=((e,t)=>{let{features:r,plans:i}=t;return e.feature&&r?o(r,e.feature):e.plan&&i?o(i,e.plan):null})(t,e),i=((e,t)=>{let{orgId:r,orgRole:i,orgPermissions:n}=t;return(e.role||e.permission)&&r&&i&&n?e.permission?n.includes(e.permission.replace(/^(org:)*/,"org:")):e.role?i.replace(/^(org:)*/,"org:")===e.role.replace(/^(org:)*/,"org:"):null:null})(t,e),n=((e,{factorVerificationAge:t})=>{if(!e.reverification||!t)return null;let r=u(e.reverification);if(!r)return null;let{level:i,afterMinutes:n}=r(),[a,s]=t,o=-1!==a?n>a:null,l=-1!==s?n>s:null;switch(i){case"first_factor":return o;case"second_factor":return -1!==s?l:o;case"multi_factor":return -1===s?o:o&&l}})(t,e);return[r||i,n].some(e=>null===e)?[r||i,n].some(e=>!0===e):[r||i,n].every(e=>!0===e)}],56590);let c=e=>{let t=e.userId,r=e.user,i=e.sessionId,n=e.sessionStatus,a=e.sessionClaims;return{userId:t,user:r,sessionId:i,session:e.session,sessionStatus:n,sessionClaims:a,organization:e.organization,orgId:e.orgId,orgRole:e.orgRole,orgPermissions:e.orgPermissions,orgSlug:e.orgSlug,actor:e.actor,factorVerificationAge:e.factorVerificationAge}};e.s(["n",0,c,"r",0,(e,t,r)=>{var i;let n,a,s,o,l,u,d,h,f,p,g,m,y;return!e&&r?c(r):(n=(i=t).user?i.user.id:i.user,a=i.user,s=i.session?i.session.id:i.session,o=i.session,l=i.session?.status,u=i.session?i.session.lastActiveToken?.jwt?.claims:null,d=i.session?i.session.factorVerificationAge:null,h=o?.actor,f=i.organization,p=i.organization?i.organization.id:i.organization,g=f?.slug,y=(m=f?a?.organizationMemberships?.find(e=>e.organization.id===p):f)?m.permissions:m,{userId:n,user:a,sessionId:s,session:o,sessionStatus:l,sessionClaims:u,organization:f,orgId:p,orgRole:m?m.role:m,orgSlug:g,orgPermissions:y,actor:h,factorVerificationAge:d})}],95943)},27085,68546,e=>{"use strict";let t,r,i,n,a,s,o,l,u;var c,d,h=e.i(80921),f=e.i(56590),p=e.i(95943),g=e.i(86825),m=e.i(86165),y=e.i(80075),v=e.i(47167),b=e.i(43194),k=class{#e;#t=864e5;constructor(e){this.#e=e}isEventThrottled(e){let t=Date.now(),r=this.#r(e),i=this.#e.getItem(r);return!!i&&!(t-i>this.#t)||(this.#e.setItem(r,t),!1)}#r(e){let{sk:t,pk:r,payload:i,...n}=e,a={...i,...n};return JSON.stringify(Object.keys({...i,...n}).sort().map(e=>a[e]))}},P=class{#i="clerk_telemetry_throttler";getItem(e){return this.#n()[e]}setItem(e,t){try{let r=this.#n();r[e]=t,localStorage.setItem(this.#i,JSON.stringify(r))}catch(e){e instanceof DOMException&&("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&localStorage.length>0&&localStorage.removeItem(this.#i)}}removeItem(e){try{let t=this.#n();delete t[e],localStorage.setItem(this.#i,JSON.stringify(t))}catch{}}#n(){try{let e=localStorage.getItem(this.#i);if(!e)return{};return JSON.parse(e)}catch{return{}}}static isSupported(){return"u">typeof window&&!!window.localStorage}},S=class{#e=new Map;#a=1e4;getItem(e){return this.#e.size>this.#a?void this.#e.clear():this.#e.get(e)}setItem(e,t){this.#e.set(e,t)}removeItem(e){this.#e.delete(e)}};let E=new Set(["error","warn","info","debug","trace"]);var _=class{#s;#o;#l={};#u=[];#c=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&&"u"<typeof window?this.#l.clerkVersion="":this.#l.clerkVersion=e.clerkVersion??"",this.#l.sdk=e.sdk,this.#l.sdkVersion=e.sdkVersion,this.#l.publishableKey=e.publishableKey??"";const t=(0,b.u)(e.publishableKey);t&&(this.#l.instanceType=t.instanceType),e.secretKey&&(this.#l.secretKey=e.secretKey.substring(0,16)),this.#o=new k(P.isSupported()?new P:new S)}get isEnabled(){return!("development"!==this.#l.instanceType||this.#s.disabled||void 0!==v.default&&v.default.env&&(0,y.o)(v.default.env.CLERK_TELEMETRY_DISABLED)||"u">typeof window&&window?.navigator?.webdriver)}get isDebug(){return this.#s.debug||void 0!==v.default&&v.default.env&&(0,y.o)(v.default.env.CLERK_TELEMETRY_DEBUG)}record(e){try{let t=this.#d(e.event,e.payload);if(this.#h(t.event,t),!this.#f(t,e.eventSamplingRate))return;this.#u.push({kind:"event",value:t}),this.#p()}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&&E.has(e.level),r="string"==typeof e?.message&&e.message.trim().length>0,i=null,n=e?.timestamp;if("number"==typeof n||"string"==typeof n){let e=new Date(n);Number.isNaN(e.getTime())||(i=e)}if(!t||!r||null===i){this.isDebug&&"u">typeof console&&console.warn("[clerk/telemetry] Dropping invalid telemetry log entry",{levelIsValid:t,messageIsValid:r,timestampIsValid:null!==i});return}let a=this.#m(),s={sdk:a.name,sdkv:a.version,cv:this.#l.clerkVersion??"",lvl:e.level,msg:e.message,ts:i.toISOString(),pk:this.#l.publishableKey||null,payload:this.#y(e.context)};this.#u.push({kind:"log",value:s}),this.#p()}catch(e){console.error("[clerk/telemetry] Error recording telemetry log entry",e)}}#f(e,t){return this.isEnabled&&!this.isDebug&&this.#v(e,t)}#g(e){return!0}#v(e,t){let r=Math.random();return!!(r<=this.#s.samplingRate&&(!1===this.#s.perEventSampling||void 0===t||r<=t))&&!this.#o.isEventThrottled(e)}#p(){if("u"<typeof window)return void this.#b();if(this.#u.length>=this.#s.maxBufferSize){this.#c&&("u">typeof cancelIdleCallback?cancelIdleCallback(Number(this.#c)):clearTimeout(Number(this.#c))),this.#b();return}this.#c||("requestIdleCallback"in window?this.#c=requestIdleCallback(()=>{this.#b(),this.#c=null}):this.#c=setTimeout(()=>{this.#b(),this.#c=null},0))}#b(){let e=[...this.#u];if(this.#u=[],this.#c=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("u">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:i}=r.constructor.sdkMetadata;void 0!==t&&(e.name=t),void 0!==i&&(e.version=i)}}}return e}#d(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}}#y(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 R="COMPONENT_MOUNTED",w=new Set(["SignIn","SignUp"]);function C(e){return w.has(e)?1:.1}function I(e){return function(t,r,i){return{event:e,eventSamplingRate:e===R?C(t):.1,payload:{component:t,appearanceProp:!!r?.appearance,theme:!!r?.appearance?.theme,elements:!!r?.appearance?.elements,variables:!!r?.appearance?.variables,...i}}}}function O(e,t){return{event:"METHOD_CALLED",eventSamplingRate:.1,payload:{method:e,...t}}}let z="THEME_USAGE";function x(e){return"string"==typeof e?e:"object"==typeof e&&null!==e&&"name"in e&&"string"==typeof e.name?e.name:void 0}e.s(["a",0,O,"c",0,function(e,t,r){return I("COMPONENT_OPENED")(e,t,r)},"i",0,function(e){return{event:"FRAMEWORK_METADATA",eventSamplingRate:.1,payload:e}},"l",0,_,"n",0,z,"o",0,function(e,t={}){return{event:R,eventSamplingRate:C(e),payload:{component:e,...t}}},"r",0,function(e){return{event:z,eventSamplingRate:1,payload:function(e){let t;if(!e||"object"!=typeof e)return{};let r=e.theme;if(!r)return{};if(Array.isArray(r))for(let e of r){let r=x(e);if(r){t=r;break}}else t=x(r);return{themeName:t}}(e)}},"s",0,function(e,t,r){return I(R)(e,t,r)},"t",0,1],68546);let M=(...e)=>{};var T=e.i(71645),D=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},L={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},F=new class{#k=L;#P=!1;setTimeoutProvider(e){this.#k=e}setTimeout(e,t){return this.#k.setTimeout(e,t)}clearTimeout(e){this.#k.clearTimeout(e)}setInterval(e,t){return this.#k.setInterval(e,t)}clearInterval(e){this.#k.clearInterval(e)}},j="u"<typeof window||"Deno"in globalThis;function A(){}function Q(e){return"number"==typeof e&&e>=0&&e!==1/0}function K(e,t){return"function"==typeof e?e(t):e}function U(e,t){return"function"==typeof e?e(t):e}var N=Object.prototype.hasOwnProperty;function q(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function $(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function B(e){if(!V(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!V(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function V(e){return"[object Object]"===Object.prototype.toString.call(e)}function W(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let i=$(t)&&$(r);if(!i&&!(B(t)&&B(r)))return r;let n=(i?t:Object.keys(t)).length,a=i?r:Object.keys(r),s=a.length,o=i?Array(s):{},l=0;for(let u=0;u<s;u++){let s=i?u:a[u],c=t[s],d=r[s];if(c===d){o[s]=c,(i?u<n:N.call(t,s))&&l++;continue}if(null===c||null===d||"object"!=typeof c||"object"!=typeof d){o[s]=d;continue}let h=e(c,d);o[s]=h,h===c&&l++}return n===s&&l===n?t:o}(e,t):t}function J(e,t,r=0){let i=[...e,t];return r&&i.length>r?i.slice(1):i}function Y(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var H=Symbol(),G=new class extends D{#S;#E;#_;constructor(){super(),this.#_=e=>{if(!j&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#E||this.setEventListener(this.#_)}onUnsubscribe(){this.hasListeners()||(this.#E?.(),this.#E=void 0)}setEventListener(e){this.#_=e,this.#E?.(),this.#E=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#S!==e&&(this.#S=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#S?this.#S:globalThis.document?.visibilityState!=="hidden"}},Z=(t=[],r=0,i=e=>{e()},n=e=>{e()},a=function(e){setTimeout(e,0)},{batch:e=>{let s;r++;try{s=e()}finally{let e;--r||(e=t,t=[],e.length&&a(()=>{n(()=>{e.forEach(e=>{i(e)})})}))}return s},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s=e=>{r?t.push(e):a(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{a=e}}),X=new class extends D{#R=!0;#E;#_;constructor(){super(),this.#_=e=>{if(!j&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#E||this.setEventListener(this.#_)}onUnsubscribe(){this.hasListeners()||(this.#E?.(),this.#E=void 0)}setEventListener(e){this.#_=e,this.#E?.(),this.#E=e(this.setOnline.bind(this))}setOnline(e){this.#R!==e&&(this.#R=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#R}};function ee(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}var et=class extends D{constructor(e,t){super(),this.options=t,this.#w=e,this.#C=null,this.#I=ee(),this.bindMethods(),this.setOptions(t)}#w;#O=void 0;#z=void 0;#x=void 0;#M;#T;#I;#C;#D;#L;#F;#j;#A;#Q;#K=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#O.addObserver(this),er(this.#O,this.options)?this.#U():this.updateResult(),this.#N())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ei(this.#O,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ei(this.#O,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#q(),this.#$(),this.#O.removeObserver(this)}setOptions(e){let t=this.options,r=this.#O;if(this.options=this.#w.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof U(this.options.enabled,this.#O))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#B(),this.#O.setOptions(this.options),t._defaulted&&!q(this.options,t)&&this.#w.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#O,observer:this});let i=this.hasListeners();i&&en(this.#O,r,this.options,t)&&this.#U(),this.updateResult(),i&&(this.#O!==r||U(this.options.enabled,this.#O)!==U(t.enabled,this.#O)||K(this.options.staleTime,this.#O)!==K(t.staleTime,this.#O))&&this.#V();let n=this.#W();i&&(this.#O!==r||U(this.options.enabled,this.#O)!==U(t.enabled,this.#O)||n!==this.#Q)&&this.#J(n)}getOptimisticResult(e){var t,r;let i=this.#w.getQueryCache().build(this.#w,e),n=this.createResult(i,e);return t=this,r=n,q(t.getCurrentResult(),r)||(this.#x=n,this.#T=this.options,this.#M=this.#O.state),n}getCurrentResult(){return this.#x}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#I.status||this.#I.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#K.add(e)}getCurrentQuery(){return this.#O}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#w.defaultQueryOptions(e),r=this.#w.getQueryCache().build(this.#w,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#U({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#x))}#U(e){this.#B();let t=this.#O.fetch(this.options,e);return e?.throwOnError||(t=t.catch(A)),t}#V(){this.#q();let e=K(this.options.staleTime,this.#O);if(j||this.#x.isStale||!Q(e))return;let t=Math.max(this.#x.dataUpdatedAt+(e||0)-Date.now(),0);this.#j=F.setTimeout(()=>{this.#x.isStale||this.updateResult()},t+1)}#W(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#O):this.options.refetchInterval)??!1}#J(e){this.#$(),this.#Q=e,!j&&!1!==U(this.options.enabled,this.#O)&&Q(this.#Q)&&0!==this.#Q&&(this.#A=F.setInterval(()=>{(this.options.refetchIntervalInBackground||G.isFocused())&&this.#U()},this.#Q))}#N(){this.#V(),this.#J(this.#W())}#q(){this.#j&&(F.clearTimeout(this.#j),this.#j=void 0)}#$(){this.#A&&(F.clearInterval(this.#A),this.#A=void 0)}createResult(e,t){let r,i=this.#O,n=this.options,a=this.#x,s=this.#M,o=this.#T,l=e!==i?e.state:this.#z,{state:u}=e,c={...u},d=!1;if(t._optimisticResults){var h;let r=this.hasListeners(),a=!r&&er(e,t),s=r&&en(e,i,t,n);(a||s)&&(c={...c,...(h=u.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(e.options.networkMode??"online")!=="online"||X.isOnline()?"fetching":"paused",...void 0===h&&{error:null,status:"pending"}})}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:g}=c;r=c.data;let m=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===g){let e;a?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=a.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#F?.state.data,this.#F):t.placeholderData,void 0!==e&&(g="success",r=W(a?.data,e,t),d=!0)}if(t.select&&void 0!==r&&!m)if(a&&r===s?.data&&t.select===this.#D)r=this.#L;else try{this.#D=t.select,r=t.select(r),r=W(a?.data,r,t),this.#L=r,this.#C=null}catch(e){this.#C=e}this.#C&&(f=this.#C,r=this.#L,p=Date.now(),g="error");let y="fetching"===c.fetchStatus,v="pending"===g,b="error"===g,k=v&&y,P=void 0!==r,S={status:g,fetchStatus:c.fetchStatus,isPending:v,isSuccess:"success"===g,isError:b,isInitialLoading:k,isLoading:k,data:r,dataUpdatedAt:c.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:b&&!P,isPaused:"paused"===c.fetchStatus,isPlaceholderData:d,isRefetchError:b&&P,isStale:ea(e,t),refetch:this.refetch,promise:this.#I,isEnabled:!1!==U(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===S.status?e.reject(S.error):void 0!==S.data&&e.resolve(S.data)},r=()=>{t(this.#I=S.promise=ee())},n=this.#I;switch(n.status){case"pending":e.queryHash===i.queryHash&&t(n);break;case"fulfilled":("error"===S.status||S.data!==n.value)&&r();break;case"rejected":("error"!==S.status||S.error!==n.reason)&&r()}}return S}updateResult(){let e=this.#x,t=this.createResult(this.#O,this.options);if(this.#M=this.#O.state,this.#T=this.options,void 0!==this.#M.data&&(this.#F=this.#O),q(t,e))return;this.#x=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#K.size)return!0;let i=new Set(r??this.#K);return this.options.throwOnError&&i.add("error"),Object.keys(this.#x).some(t=>this.#x[t]!==e[t]&&i.has(t))};this.#Y({listeners:r()})}#B(){let e=this.#w.getQueryCache().build(this.#w,this.options);if(e===this.#O)return;let t=this.#O;this.#O=e,this.#z=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#N()}#Y(e){Z.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#x)}),this.#w.getQueryCache().notify({query:this.#O,type:"observerResultsUpdated"})})}};function er(e,t){return!1!==U(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&ei(e,t,t.refetchOnMount)}function ei(e,t,r){if(!1!==U(t.enabled,e)&&"static"!==K(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&ea(e,t)}return!1}function en(e,t,r,i){return(e!==t||!1===U(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ea(e,r)}function ea(e,t){return!1!==U(t.enabled,e)&&e.isStaleByTime(K(t.staleTime,e))}function es(e){return{onFetch:(t,r)=>{let i=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],s=t.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,u=async()=>{var r,u;let c=!1,d=(r=t.options,u=t.fetchOptions,!r.queryFn&&u?.initialPromise?()=>u.initialPromise:r.queryFn&&r.queryFn!==H?r.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${r.queryHash}'`))),h=async(e,r,i)=>{if(c)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let n=(()=>{var e,n;let a,s,o={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?"backward":"forward",meta:t.options.meta};return e=()=>t.signal,n=()=>c=!0,s=!1,Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(a??=e(),s||(s=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),o})(),a=await d(n),{maxPages:s}=t.options,o=i?Y:J;return{pages:o(e.pages,a,s),pageParams:o(e.pageParams,r,s)}};if(n&&a.length){let e="backward"===n,t={pages:a,pageParams:s},r=(e?el:eo)(i,t);o=await h(t,r,e)}else{let t=e??a.length;do{let e=0===l?s[0]??i.initialPageParam:eo(i,o);if(l>0&&null==e)break;o=await h(o,e),l++}while(l<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function eo(e,{pages:t,pageParams:r}){let i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function el(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var eu=class extends et{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:es()})}getOptimisticResult(e){return e.behavior=es(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var r,i;let{state:n}=e,a=super.createResult(e,t),{isFetching:s,isRefetching:o,isError:l,isRefetchError:u}=a,c=n.fetchMeta?.fetchMore?.direction,d=l&&"forward"===c,h=s&&"forward"===c,f=l&&"backward"===c,p=s&&"backward"===c;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:!!(r=n.data)&&null!=eo(t,r),hasPreviousPage:!!(i=n.data)&&!!t.getPreviousPageParam&&null!=el(t,i),isFetchNextPageError:d,isFetchingNextPage:h,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:u&&!d&&!f,isRefetching:o&&!h&&!p}}},ec=Object.prototype.hasOwnProperty;function ed(e,t,r){for(r of e.keys())if(eh(r,t))return r}function eh(e,t){var r,i,n;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((i=e.length)===t.length)for(;i--&&eh(e[i],t[i]););return -1===i}if(r===Set){if(e.size!==t.size)return!1;for(i of e)if((n=i)&&"object"==typeof n&&!(n=ed(t,n))||!t.has(n))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(i of e)if((n=i[0])&&"object"==typeof n&&!(n=ed(t,n))||!eh(i[1],t.get(n)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((i=e.byteLength)===t.byteLength)for(;i--&&e.getInt8(i)===t.getInt8(i););return -1===i}if(ArrayBuffer.isView(e)){if((i=e.byteLength)===t.byteLength)for(;i--&&e[i]===t[i];);return -1===i}if(!r||"object"==typeof e){for(r in i=0,e)if(ec.call(e,r)&&++i&&!ec.call(t,r)||!(r in t)||!eh(e[r],t[r]))return!1;return Object.keys(t).length===i}}return e!=e&&t!=t}function ef(e,t){if(!e)throw"string"==typeof t?Error(t):Error(`${t.displayName} not found`)}let ep=(e,t)=>{let{assertCtxFn:r=ef}=t||{},i=T.default.createContext(void 0);return i.displayName=e,[i,()=>{let t=T.default.useContext(i);return r(t,`${e} not found`),t.value},()=>{let e=T.default.useContext(i);return e?e.value:{}}]},[eg,em]=ep("ClerkInstanceContext"),[ey,ev]=ep("InitialStateContext");function eb({children:e,initialState:t}){let[r]=(0,T.useState)(t),i=T.default.useMemo(()=>({value:r}),[r]);return T.default.createElement(ey.Provider,{value:i},e)}function ek(){let e=ev();if(e instanceof Promise)if("use"in T.default&&"function"==typeof T.default.use)return T.default.use(e);else throw Error("initialState cannot be a promise if React version is less than 19");return e}T.default.createContext({});let[eP,eS]=ep("CheckoutContext"),eE=({children:e,...t})=>T.default.createElement(eP.Provider,{value:{value:t}},e);function e_(e){if(!T.default.useContext(eg)){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 eR(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 ew(e){if(e)return function(e){return e}}let eC=o=new Proxy(function(){},{get(e,t){if("then"!==t)return"toString"===t?()=>"[ClerkMockQueryClient]":t===Symbol.toPrimitive?()=>0:o},apply:()=>o,construct:()=>o,has:()=>!1,set:()=>!1}),eI=()=>{let e=em(),t=e.__internal_queryClient,[,r]=(0,T.useState)("object"==typeof t&&"__tag"in t&&"clerk-rq-client"===t.__tag);(0,T.useEffect)(()=>{let t=()=>r(!0);return e.on("queryClientStatus",t),()=>{e.off("queryClientStatus",t)}},[e,r]);let i="object"==typeof t&&"__tag"in t&&"clerk-rq-client"===t.__tag;return[t?.client||eC,i]};function eO(e,t){let[r,i]=eI(),n=i?r.defaultQueryOptions(e):e;n._optimisticResults="optimistic";let a=T.useMemo(()=>new t(r,n),[r]),s=a.getOptimisticResult(n),o=!1!==e.subscribed;return(T.useSyncExternalStore(T.useCallback(e=>{let t=o?a.subscribe(Z.batchCalls(e)):A;return a.updateResult(),t},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),T.useEffect(()=>{a.setOptions(n)},[n,a]),i)?n.notifyOnChangeProps?s:a.trackResult(s):{data:void 0,error:null,isLoading:!1,isFetching:!1,status:"pending"}}function ez(e){var t;let r,i,{isSignedOut:n,stableKeys:a,authenticated:s=!0,onCleanup:o}=e,l=(0,T.useRef)(a),[u]=eI(),c=(t=!n,r=(0,T.useRef)(t),i=(0,T.useRef)(null),r.current!==t&&(i.current=r.current,r.current=t),i.current);(0,T.useEffect)(()=>{!0===s&&c&&!0===n&&(u.removeQueries({predicate:e=>{let[t,r]=e.queryKey;return!0===r&&"string"==typeof t&&(Array.isArray(l.current)?l.current.includes(t):l.current===t)}}),o?.())},[s,n,c,u])}let ex=(e,t)=>{let r="boolean"==typeof e&&e,i=(0,T.useRef)(r?t.initialPage:e?.initialPage??t.initialPage),n=(0,T.useRef)(r?t.pageSize:e?.pageSize??t.pageSize),a={};for(let i of Object.keys(t))a[i]=r?t[i]:e?.[i]??t[i];return{...a,initialPage:i.current,pageSize:n.current}},eM=e=>{let t,{fetcher:r,config:i,keys:n}=e,[a,s]=(0,T.useState)(i.initialPage??1),o=(0,T.useRef)(i.initialPage??1),l=(0,T.useRef)(i.pageSize??10),u=i.enabled??!0,c=i.isSignedIn,d=i.infinite??!1,h="cache"===i.__experimental_mode,f=i.keepPreviousData??!1,[p]=eI(),g=u&&!!r&&!h&&!1!==c,[m,y]=(0,T.useState)(0),v=(0,T.useCallback)(e=>{y(e)},[]),b=(0,T.useMemo)(()=>{let[e,t,r,i]=n.queryKey;return[e,t,r,{...i,args:{...i.args,initialPage:a,pageSize:l.current}}]},[n.queryKey,a]),k=eO({queryKey:b,queryFn:({queryKey:e})=>{let{args:t}=e[3];if(r)return r(t)},staleTime:6e4,enabled:g&&!d,placeholderData:ew(f)},et),P=(0,T.useMemo)(()=>{let[e,t,r,i]=n.queryKey;return[e+"-inf",t,r,i]},[n.queryKey]),S=eO({queryKey:P,initialPageParam:i.initialPage??1,getNextPageParam:(e,t,r)=>{let n=e?.total_count??0;return(t.length+(i.initialPage?i.initialPage-1:0))*(i.pageSize??10)<n?r+1:void 0},queryFn:({pageParam:e,queryKey:t})=>{let{args:i}=t[3];if(r)return r({...i,initialPage:e,pageSize:l.current})},staleTime:6e4,enabled:g&&d},eu);ez({isSignedOut:!1===c,authenticated:n.authenticated,stableKeys:[t=n.stableKey,`${t}-inf`],onCleanup:()=>{s(o.current),Promise.resolve().then(()=>v(e=>e+1))}});let{data:E,count:_,page:R}=(0,T.useMemo)(()=>{if(d){let e=p.getQueryData(P),t=g?S.data?.pages??e?.pages??[]:e?.pages??[],r=Array.isArray(t)?t.filter(Boolean):[];return{data:r.map(e=>e?.data).flat().filter(Boolean)??[],count:r[r.length-1]?.total_count??0,page:r.length>0?r.length:o.current}}let e=g?k.data??p.getQueryData(b):p.getQueryData(b);return{data:Array.isArray(e?.data)?e.data:[],count:"number"==typeof e?.total_count?e.total_count:0,page:a}},[g,m,d,S.data?.pages,k.data,p,P,b,a]),w=(0,T.useCallback)(e=>{if(d){let t=Math.max(0,"function"==typeof e?e(R):e),r=p.getQueryData(P);t-(S.data?.pages??r?.pages??[]).length>0&&S.fetchNextPage({cancelRefetch:!1});return}return s(e)},[S,R,d,p,P]),C=d?S.isLoading:k.isLoading,I=d?S.isFetching:k.isFetching,O=(d?S.error:k.error)??null,z=(0,T.useCallback)(()=>{d?S.fetchNextPage({cancelRefetch:!1}):s(e=>Math.max(0,e+1))},[S,d]),x=(0,T.useCallback)(()=>{d||s(e=>Math.max(0,e-1))},[d]),M=(o.current-1)*l.current,D=Math.ceil((_-M)/l.current),L=d?!!S.hasNextPage:_-M>R*l.current,F=d?!!S.hasPreviousPage:(R-1)*l.current>M;return{data:E,count:_,error:O,isLoading:C,isFetching:I,isError:!!O,page:R,pageCount:D,fetchPage:w,fetchNext:z,fetchPrevious:x,hasNextPage:L,hasPreviousPage:F,revalidate:async()=>{await p.invalidateQueries({queryKey:n.invalidationKey});let[e,...t]=n.invalidationKey;return p.invalidateQueries({queryKey:[e+"-inf",...t]})},setData:e=>(d?(p.setQueryData(P,(t={})=>{let r=Array.isArray(t?.pages)?t.pages:[],i="function"==typeof e?e(r):e;return{...t,pages:i}}),v(e=>e+1)):(p.setQueryData(b,(t={data:[],total_count:0})=>"function"==typeof e?e(t):e),v(e=>e+1)),Promise.resolve())}};function eT(){let e=em(),t=ek(),r=(0,T.useCallback)(()=>t?.organization,[t?.organization]);return(0,T.useSyncExternalStore)((0,T.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,T.useCallback)(()=>e.loaded&&e.__internal_lastEmittedResources?e.__internal_lastEmittedResources.organization:r(),[e,r]),r)}function eD(){let e=em(),t=ek(),r=(0,T.useCallback)(()=>t?(0,p.n)(t)?.session:void 0,[t]);return(0,T.useSyncExternalStore)((0,T.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,T.useCallback)(()=>e.loaded&&e.__internal_lastEmittedResources?e.__internal_lastEmittedResources.session:r(),[e,r]),r)}let eL=()=>(e_("useClerk"),em());function eF(e){let t=eL(),r=(0,T.useRef)(!1);(0,T.useEffect)(()=>{r.current||(r.current=!0,t.__internal_attemptToEnableEnvironmentSetting?.({for:"organizations",caller:e}))},[t,e])}let ej={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 eA(){let e=em(),t=ek(),r=(0,T.useCallback)(()=>t?.user,[t?.user]);return(0,T.useSyncExternalStore)((0,T.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,T.useCallback)(()=>e.loaded&&e.__internal_lastEmittedResources?e.__internal_lastEmittedResources.user:r(),[e,r]),r)}let eQ="useOrganizationCreationDefaults",eK={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},eU="u">typeof window?T.default.useLayoutEffect:T.default.useEffect,eN="useSession",eq,e$=()=>eq,eB="useSessionList",eV="useUser";function eW(){e_(eV);let e=eA();return(em().telemetry?.record(O(eV)),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 eJ(e){try{let t=await e;if(t instanceof Response)return t.json();return t}catch(e){if((0,m.C)(e)&&e.errors.find(({code:e})=>"session_reverification_required"===e))return(0,h.n)();throw e}}function eY(e){let t=em(),r=e?.enabled??!0,i=t.__internal_environment,n=eA(),a=eT(),s=i?.commerceSettings.billing.user.enabled,o=i?.commerceSettings.billing.organization.enabled,l=e?.for==="organization"?o:e?.for==="user"?s:s||o,u=e?.for==="organization",c=!(e?.authenticated??!0)||(!u||!!a?.id)&&!!n?.id;return l&&r&&t.loaded&&c}function eH({hookName:e,resourceType:t,useFetcher:r,options:i}){return function(n){let{for:a,enabled:s,...o}=n||{},l=a||"user";e_(e);let u=r(l),c=ex(o,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,__experimental_mode:void 0}),d=em(),h=eA(),f=eT();d.telemetry?.record(O(e));let p="organization"===l,g=eY({for:l,enabled:s,authenticated:!i?.unauthenticated}),m=void 0===o?void 0:{initialPage:c.initialPage,pageSize:c.pageSize,...i?.unauthenticated?{}:p?{orgId:f?.id}:{}},y=!!m&&d.loaded&&!!g;return eM({fetcher:u,config:{keepPreviousData:c.keepPreviousData,infinite:c.infinite,enabled:y,...i?.unauthenticated?{}:{isSignedIn:null!==h},__experimental_mode:c.__experimental_mode,initialPage:c.initialPage,pageSize:c.pageSize},keys:eR({stablePrefix:t,authenticated:!i?.unauthenticated,tracked:i?.unauthenticated?{for:l}:{userId:h?.id,...p?{orgId:f?.id}:{}},untracked:{args:m}})})}}eH({hookName:"useStatements",resourceType:"billing-statements",useFetcher:()=>{let e=em();if(e.loaded)return e.billing.getStatements}}),eH({hookName:"usePaymentAttempts",resourceType:"billing-payment-attempts",useFetcher:()=>{let e=em();if(e.loaded)return e.billing.getPaymentAttempts}}),eH({hookName:"usePaymentMethods",resourceType:"billing-payment-methods",useFetcher:e=>{let t=eT(),r=eA();return"organization"===e?t?.getPaymentMethods:r?.getPaymentMethods}}),eH({hookName:"usePlans",resourceType:"billing-plans",useFetcher:e=>{let t=em();if(t.loaded)return r=>t.billing.getPlans({...r,for:e})},options:{unauthenticated:!0}});let eG=e=>{let t=(0,T.useRef)(e);return(0,T.useEffect)(()=>{t.current=e},[e]),t.current},eZ=(e,t,r)=>{let i=!!r,n=(0,T.useRef)(r);(0,T.useEffect)(()=>{n.current=r},[r]),(0,T.useEffect)(()=>{if(!i||!e)return()=>{};let r=(...e)=>{n.current&&n.current(...e)};return e.on(t,r),()=>{e.off(t,r)}},[i,t,e,n])},eX=T.default.createContext(null);eX.displayName="ElementsContext";let e0=(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},e1=({stripe:e,options:t,children:r})=>{let i=T.default.useMemo(()=>e5(e),[e]),[n,a]=T.default.useState(()=>({stripe:"sync"===i.tag?i.stripe:null,elements:"sync"===i.tag?i.stripe.elements(t):null}));T.default.useEffect(()=>{let e=!0,r=e=>{a(r=>r.stripe?r:{stripe:e,elements:e.elements(t)})};return"async"!==i.tag||n.stripe?"sync"!==i.tag||n.stripe||r(i.stripe):i.stripePromise.then(t=>{t&&e&&r(t)}),()=>{e=!1}},[i,n,t]);let s=eG(e);T.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 o=eG(t);return T.default.useEffect(()=>{if(!n.elements)return;let e=e3(t,o,["clientSecret","fonts"]);e&&n.elements.update(e)},[t,o,n.elements]),T.default.createElement(eX.Provider,{value:n},r)},e6="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.",e4=(e,t=e6)=>{if(null===e||e9(e))return e;throw Error(t)},e5=(e,t=e6)=>{if(e2(e))return{tag:"async",stripePromise:Promise.resolve(e).then(e=>e4(e,t))};let r=e4(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},e8=e=>null!==e&&"object"==typeof e,e2=e=>e8(e)&&"function"==typeof e.then,e9=e=>e8(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment,e3=(e,t,r)=>e8(e)?Object.keys(e).reduce((i,n)=>{let a=!e8(t)||!te(e[n],t[n]);return r.includes(n)?(a&&console.warn(`Unsupported prop change: options.${n} is not a mutable property.`),i):a?{...i||{},[n]:e[n]}:i},null):null,e7="[object Object]",te=(e,t)=>{if(!e8(e)||!e8(t))return e===t;let r=Array.isArray(e);if(r!==Array.isArray(t))return!1;let i=Object.prototype.toString.call(e)===e7;if(i!==(Object.prototype.toString.call(t)===e7))return!1;if(!i&&!r)return e===t;let n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;let s={};for(let e=0;e<n.length;e+=1)s[n[e]]=!0;for(let e=0;e<a.length;e+=1)s[a[e]]=!0;let o=Object.keys(s);return o.length===n.length&&o.every(r=>te(e[r],t[r]))},tt=e=>e0(T.default.useContext(eX),e),tr=(c="payment",d="u"<typeof window,l=`${c.charAt(0).toUpperCase()+c.slice(1)}Element`,(u=d?e=>{tt(`mounts <${l}>`);let{id:t,className:r}=e;return T.default.createElement("div",{id:t,className:r})}:({id:e,className:t,fallback:r,options:i={},onBlur:n,onFocus:a,onReady:s,onChange:o,onEscape:u,onClick:d,onLoadError:h,onLoaderStart:f,onNetworksChange:p,onConfirm:g,onCancel:m,onShippingAddressChange:y,onShippingRateChange:v})=>{let b,k=tt(`mounts <${l}>`),P="elements"in k?k.elements:null,[S,E]=T.default.useState(null),_=T.default.useRef(null),R=T.default.useRef(null),[w,C]=(0,T.useState)(!1);eZ(S,"blur",n),eZ(S,"focus",a),eZ(S,"escape",u),eZ(S,"click",d),eZ(S,"loaderror",h),eZ(S,"loaderstart",f),eZ(S,"networkschange",p),eZ(S,"confirm",g),eZ(S,"cancel",m),eZ(S,"shippingaddresschange",y),eZ(S,"shippingratechange",v),eZ(S,"change",o),s&&(b=()=>{C(!0),s(S)}),eZ(S,"ready",b),T.default.useLayoutEffect(()=>{if(null===_.current&&null!==R.current&&P){let e=null;P&&(e=P.create(c,i)),_.current=e,E(e),e&&e.mount(R.current)}},[P,i]);let I=eG(i);return T.default.useEffect(()=>{if(!_.current)return;let e=e3(i,I,["paymentRequest"]);e&&"update"in _.current&&_.current.update(e)},[i,I]),T.default.useLayoutEffect(()=>()=>{if(_.current&&"function"==typeof _.current.destroy)try{_.current.destroy(),_.current=null}catch{}},[]),T.default.createElement(T.default.Fragment,null,!w&&r,T.default.createElement("div",{id:e,style:{height:w?"unset":"0px",visibility:w?"visible":"hidden"},className:t,ref:R}))}).displayName=l,u.__elementType=c,u),[ti,tn]=ep("PaymentElementContext"),[ta,ts]=ep("StripeUtilsContext"),to=({children:e})=>{let t=(()=>{let{stripe:e}=tt("calls useStripe()");return e})(),r=(()=>{let{elements:e}=e0(T.default.useContext(eX),"calls useElements()");return e})();return T.default.createElement(ta.Provider,{value:{value:{stripe:t,elements:r}}},e)},tl=({children:e})=>T.default.createElement(ta.Provider,{value:{value:{}}},e),tu=({children:e,...t})=>{let r=((e="user")=>{let t,r=(t=eL(),eO({queryKey:["clerk-stripe-sdk"],queryFn:async()=>({loadStripe:await t.__internal_loadStripeJs()}),staleTime:1/0,refetchOnWindowFocus:!1,placeholderData:ew(!0)},et).data??null),i=eL().__internal_environment,{initializedPaymentMethod:n,initializePaymentMethod:a}=function(e){let{for:t}=e??{},r=eT(),i=eA(),n="organization"===t?r:i,a=eY(e),s="billing-payment-method-initialize",o=(0,T.useMemo)(()=>[s,!0,{resourceId:n?.id},{}],[n?.id]),l=!!n?.id&&a;ez({isSignedOut:null===i,authenticated:!0,stableKeys:s});let u=eO({queryKey:o,queryFn:async()=>{if(n)return n.initializePaymentMethod({gateway:"stripe"})},enabled:l,staleTime:6e4,refetchOnWindowFocus:!1,placeholderData:ew(l)},et),[c]=eI(),d=(0,T.useCallback)(async()=>{if(!n)return;let e=await n.initializePaymentMethod({gateway:"stripe"});return c.setQueryData(o,e),e},[c,o,n]);return{initializedPaymentMethod:u.data??void 0,initializePaymentMethod:d}}({for:e}),s=i?.commerceSettings.billing.stripePublishableKey??void 0;return{stripe:function(e){let{stripeClerkLibs:t,externalGatewayId:r,stripePublishableKey:i}=e,n=(0,T.useMemo)(()=>["stripe-sdk",{externalGatewayId:r,stripePublishableKey:i}],[r,i]),a=eY({authenticated:!0});return eO({queryKey:n,queryFn:()=>t&&r&&i?t.loadStripe(i,{stripeAccount:r}):null,enabled:!!(t&&r&&i)&&a,staleTime:6e4,refetchOnWindowFocus:!1,placeholderData:ew(!0)},et).data}({stripeClerkLibs:r,externalGatewayId:n?.externalGatewayId,stripePublishableKey:s}),initializePaymentMethod:a,externalClientSecret:n?.externalClientSecret,paymentMethodOrder:n?.paymentMethodOrder}})(t.for),[i,n]=(0,T.useState)(!1);return T.default.createElement(ti.Provider,{value:{value:{...t,...r,setIsPaymentElementReady:n,isPaymentElementReady:i}}},e)},tc=e=>{let{stripe:t,externalClientSecret:r,stripeAppearance:i}=tn(),n=(()=>{let e=eL(),t="en";try{t=e.__internal_getOption("localization")?.locale||"en"}catch{}return t.split("-")[0]})();return t&&r?T.default.createElement(e1,{key:r,stripe:t,options:{loader:"never",clientSecret:r,appearance:{variables:i},locale:n}},T.default.createElement(to,null,e.children)):T.default.createElement(tl,null,e.children)},td=()=>{throw Error("Clerk: Unable to submit, Stripe libraries are not yet loaded. Be sure to check `isFormReady` before calling `submit`.")},[th,,tf]=ep("PortalProvider"),tp=({children:e,getContainer:t})=>{let r=T.default.useMemo(()=>({value:{getContainer:t}}),[t]);return T.default.createElement(th.Provider,{value:r},e)};tp.displayName="UNSAFE_PortalProvider",e.s(["ClerkContextProvider",0,function(e){let t=e.clerk;if(t||function(){throw Error("ClerkJS: Clerk instance not found. Make sure Clerk is initialized before using any Clerk components.")}(),e.initialState instanceof Promise&&!("use"in T.default&&"function"==typeof T.default.use))throw Error("initialState cannot be a promise if React version is less than 19");let r=T.default.useMemo(()=>({value:t}),[e.clerkStatus]);return T.default.createElement(eb,{initialState:e.initialState},T.default.createElement(eg.Provider,{value:r},T.default.createElement(eE,{value:void 0},e.children)))},"InitialStateProvider",0,eb,"UNSAFE_PortalProvider",0,tp,"__experimental_CheckoutProvider",0,eE,"__experimental_PaymentElement",0,({fallback:e})=>{let{setIsPaymentElementReady:t,paymentMethodOrder:r,checkout:i,stripe:n,externalClientSecret:a,paymentDescription:s,for:o}=tn(),l=eL().__internal_environment,u=(0,T.useMemo)(()=>{if(i&&i.totals&&i.plan)return{recurringPaymentRequest:{paymentDescription:s||"",managementURL:"organization"===o?l?.displayConfig.organizationProfileUrl||"":l?.displayConfig.userProfileUrl||"",regularBilling:{amount:i.totals.totalDueNow?.amount||i.totals.grandTotal.amount,label:i.plan.name,recurringPaymentIntervalUnit:"annual"===i.planPeriod?"year":"month"}}}},[i,s,o,l]),c=(0,T.useMemo)(()=>({layout:{type:"tabs",defaultCollapsed:!1},paymentMethodOrder:r,applePay:u}),[u,r]),d=(0,T.useCallback)(()=>{t(!0)},[t]);return n&&a?T.default.createElement(tr,{fallback:e,onReady:d,options:c}):T.default.createElement(T.default.Fragment,null,e)},"__experimental_PaymentElementProvider",0,({children:e,...t})=>T.default.createElement(tu,t,T.default.createElement(tc,null,e)),"__experimental_useCheckout",0,e=>{let t=eS(),{for:r,planId:i,planPeriod:n}=e||t,a=eT(),{isLoaded:s,user:o}=eW(),l=em();if(null===o&&s)throw Error('Clerk: Ensure that `useCheckout` is inside a component wrapped with `<Show when="signed-in" />`.');if(s&&"organization"===r&&null===a)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,T.useCallback)(()=>l.__experimental_checkout({planId:i,planPeriod:n,for:r}),[o?.id,a?.id,i,n,r]),c=(0,T.useCallback)(e=>l.loaded?l.__internal_state.__internal_effect(()=>{u(),e()}):()=>{},[u,l.loaded,l.__internal_state]),d=(0,T.useCallback)(()=>u(),[u]);return(0,T.useSyncExternalStore)(c,d,d)},"__experimental_usePaymentElement",0,()=>{let{isPaymentElementReady:e,initializePaymentMethod:t}=tn(),{stripe:r,elements:i}=ts(),{externalClientSecret:n}=tn(),a=(0,T.useCallback)(async()=>{if(!r||!i)return td();let{setupIntent:e,error:t}=await r.confirmSetup({elements:i,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,i]),s=(0,T.useCallback)(async()=>{if(!r||!i)return td();await t()},[r,i,t]),o=!!(r&&n);return o?{submit:a,reset:s,isFormReady:e,provider:{name:"stripe"},isProviderReady:o}:{submit:td,reset:td,isFormReady:!1,provider:void 0,isProviderReady:!1}},"__internal_useSessionBase",0,eD,"isDeeplyEqual",0,eh,"useAssertWrappedByClerkProvider",0,e_,"useClerk",0,eL,"useClerkInstanceContext",0,em,"useInitialStateContext",0,ek,"useOrganization",0,function(e){var t,r;let{domains:i,membershipRequests:n,memberships:a,invitations:s}=e||{};e_("useOrganization"),eF("useOrganization");let o=eT(),l=eD(),u=ex(i,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,enrollmentMode:void 0}),c=ex(n,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),d=ex(a,{initialPage:1,pageSize:10,role:void 0,keepPreviousData:!1,infinite:!1,query:void 0}),h=ex(s,{initialPage:1,pageSize:10,status:["pending"],keepPreviousData:!1,infinite:!1}),f=em();f.telemetry?.record(O("useOrganization"));let p=void 0===i?void 0:{initialPage:u.initialPage,pageSize:u.pageSize,enrollmentMode:u.enrollmentMode},g=void 0===n?void 0:{initialPage:c.initialPage,pageSize:c.pageSize,status:c.status},m=void 0===a?void 0:{initialPage:d.initialPage,pageSize:d.pageSize,role:d.role,query:d.query},y=void 0===s?void 0:{initialPage:h.initialPage,pageSize:h.pageSize,status:h.status},v=eM({fetcher:o?.getDomains,config:{keepPreviousData:u.keepPreviousData,infinite:u.infinite,enabled:!!p,isSignedIn:null!==o,initialPage:u.initialPage,pageSize:u.pageSize},keys:eR({stablePrefix:"domains",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:p}})}),b=eM({fetcher:o?.getMembershipRequests,config:{keepPreviousData:c.keepPreviousData,infinite:c.infinite,enabled:!!g,isSignedIn:null!==o,initialPage:c.initialPage,pageSize:c.pageSize},keys:eR({stablePrefix:"membershipRequests",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:g}})}),k=eM({fetcher:o?.getMemberships,config:{keepPreviousData:d.keepPreviousData,infinite:d.infinite,enabled:!!m,isSignedIn:null!==o,initialPage:d.initialPage,pageSize:d.pageSize},keys:eR({stablePrefix:"memberships",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:m}})}),P=eM({fetcher:o?.getInvitations,config:{keepPreviousData:h.keepPreviousData,infinite:h.infinite,enabled:!!y,isSignedIn:null!==o,initialPage:h.initialPage,pageSize:h.pageSize},keys:eR({stablePrefix:"invitations",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:y}})});return void 0===o?{isLoaded:!1,organization:void 0,membership:void 0,domains:ej,membershipRequests:ej,memberships:ej,invitations:ej}:null===o?{isLoaded:!0,organization:null,membership:null,domains:null,membershipRequests:null,memberships:null,invitations:null}:!f.loaded&&o?{isLoaded:!0,organization:o,membership:void 0,domains:ej,membershipRequests:ej,memberships:ej,invitations:ej}:{isLoaded:f.loaded,organization:o,membership:(t=l.user.organizationMemberships,r=o.id,t.find(e=>e.organization.id===r)),domains:v,membershipRequests:b,memberships:k,invitations:P}},"useOrganizationCreationDefaults",0,function(e={}){e_(eQ);let{keepPreviousData:t=!0,enabled:r=!0}=e,i=em(),n=eA(),a=i.__internal_environment?.organizationSettings?.organizationCreationDefaults?.enabled??!1;i.telemetry?.record(O(eQ));let{queryKey:s}=function(e){let{userId:t}=e;return(0,T.useMemo)(()=>eR({stablePrefix:"organizationCreationDefaults",authenticated:!!t,tracked:{userId:t??null},untracked:{args:{}}}),[t])}({userId:n?.id??null}),o=!!n&&r&&a&&i.loaded,l=eO({queryKey:s,queryFn:n?.getOrganizationCreationDefaults,enabled:o,placeholderData:ew(t)},et);return{data:l.data,error:l.error??null,isLoading:l.isLoading,isFetching:l.isFetching}},"useOrganizationList",0,function(e){let{userMemberships:t,userInvitations:r,userSuggestions:i}=e||{};e_("useOrganizationList"),eF("useOrganizationList");let n=ex(t,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1}),a=ex(r,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),s=ex(i,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),o=em(),l=eA();o.telemetry?.record(O("useOrganizationList"));let u=void 0===t?void 0:{initialPage:n.initialPage,pageSize:n.pageSize},c=void 0===r?void 0:{initialPage:a.initialPage,pageSize:a.pageSize,status:a.status},d=void 0===i?void 0:{initialPage:s.initialPage,pageSize:s.pageSize,status:s.status},h=!!(o.loaded&&l),f=eM({fetcher:l?.getOrganizationMemberships,config:{keepPreviousData:n.keepPreviousData,infinite:n.infinite,enabled:!!u,isSignedIn:null!==l,initialPage:n.initialPage,pageSize:n.pageSize},keys:eR({stablePrefix:"userMemberships",authenticated:!0,tracked:{userId:l?.id},untracked:{args:u}})}),p=eM({fetcher:l?.getOrganizationInvitations,config:{keepPreviousData:a.keepPreviousData,infinite:a.infinite,enabled:!!c,isSignedIn:null!==l,initialPage:a.initialPage,pageSize:a.pageSize},keys:eR({stablePrefix:"userInvitations",authenticated:!0,tracked:{userId:l?.id},untracked:{args:c}})}),g=eM({fetcher:l?.getOrganizationSuggestions,config:{keepPreviousData:s.keepPreviousData,infinite:s.infinite,enabled:!!d,isSignedIn:null!==l,initialPage:s.initialPage,pageSize:s.pageSize},keys:eR({stablePrefix:"userSuggestions",authenticated:!0,tracked:{userId:l?.id},untracked:{args:d}})});return h?{isLoaded:h,setActive:o.setActive,createOrganization:o.createOrganization,userMemberships:f,userInvitations:p,userSuggestions:g}:{isLoaded:!1,createOrganization:void 0,setActive:void 0,userMemberships:eK,userInvitations:eK,userSuggestions:eK}},"usePortalRoot",0,()=>{let e=tf();return e&&"getContainer"in e&&e.getContainer?e.getContainer:()=>null},"useReverification",0,(e,t)=>{let{__internal_openReverification:r,telemetry:i}=eL(),n=(0,T.useRef)(e),a=(0,T.useRef)(t);return i?.record(O("useReverification",{onNeedsReverification:!!t?.onNeedsReverification})),eU(()=>{n.current=e,a.current=t}),(0,T.useCallback)((...e)=>{var t;return(t={openUIComponent:r,telemetry:i,...a.current},function(e){return async(...r)=>{let i=await eJ(e(...r));if((0,h.t)(i)){let n,a,s=(n=M,a=M,{promise:new Promise((e,t)=>{n=e,a=t}),resolve:n,reject:a}),o=(0,f.i)(i.clerk_error.metadata?.reverification),l=o?o().level:void 0,u=()=>{s.reject(new g.t("User cancelled attempted verification",{code:"reverification_cancelled"}))},c=()=>{s.resolve(!0)};void 0===t.onNeedsReverification?t.openUIComponent?.({level:l,afterVerification:c,afterVerificationCancelled:u}):t.onNeedsReverification({cancel:u,complete:c,level:l}),await s.promise,i=await eJ(e(...r))}return i}})(n.current)(...e)},[r,i])},"useSession",0,()=>{e_(eN);let e=eD(),t=em();return(t.telemetry?.record(O(eN)),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}},"useSessionList",0,()=>{let e;e_(eB);let t=em(),r=(e=em(),(0,T.useSyncExternalStore)((0,T.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,T.useCallback)(()=>e.loaded&&e.__internal_lastEmittedResources?e.__internal_lastEmittedResources.client:eq,[e]),e$));return(em().telemetry?.record(O(eB)),r)?{isLoaded:!0,sessions:r.sessions,setActive:t.setActive}:{isLoaded:!1,sessions:void 0,setActive:void 0}},"useUser",0,eW],27085)}]);