PageSourceSearch

https://app.truemetriks.com/_next/static/chunks/18hy6l7pe5dgo.js

js truemetriks.com collected 2026-09-24 09:07:04 UTC 46,603 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,386909,e=>{"use strict";let t,r,n,o,i,a;var s,l,u,_=e.i(247167);let E="1.6.23";function c(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}c({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",INVALID_USER:"Invalid user",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",TOKEN_EXPIRED:"Token expired",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CHANGE_EMAIL_DISABLED:"Change email is disabled",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_
1NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required",METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED:"POST method requires deferSessionRefresh to be enabled in session config",BODY_MUST_BE_AN_OBJECT:"Body must be an object",PASSWORD_ALREADY_SET:"User already has a password set"});let d={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var O=class extends Error{constructor(e="INTERNAL_SERVER_ERROR",t,r={},n="number"==typeof e?e:d[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=r,this.statusCode=n,this.name="APIError",this.status=e,this.headers=r,this.statusCode=n,this.body=t}};Symbol.for("better-call:api-error-headers"),s=O,l=Error,Object.defineProperty((class e extends s{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){const t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);const t=Error().stack;t&&(this.#e=function(e){let t=e.split("\n    at ");return t.length<=1?e:(t.splice(1,1),t.join("\n    at "))}(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}).prototype,"constructor",{get:()=>l,enumerable:!1,configurable:!0});var T=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function A(e){return"OR"===e?"OR":"AND"}function f(e){return Array.isArray(e)}function p(e,t){return"string"==typeof t&&e.includes(t)}function R(e){return{newRole:e=>{var t;return{authorize(e,r="AND"){let n=!1;for(let[o,i]of Object.entries(e)){let e=t[o];if(!e){if("AND"===r)return{success:!1,error:`You are not allowed to access resource: ${o}`};continue}let a=function(e,{actions:t,connector:r}){return 0!==t.length&&("OR"===r?t.some(t=>p(e,t)):t.every(t=>p(e,t)))}(e,function(e){if(f(e))return{actions:e,connector:"AND"};if(!e||"object"!=typeof e)throw new T("Invalid access control request");let{actions:t,connector:r}=e;return f(t)?{actions:t,connector:A(r)}:{actions:[],connector:A(r)}}(i));if(a&&(n=!0),a&&"OR"===r)return{success:!0};if(!a&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${o}"`}}return n?{success:!0}:{success:!1,error:"Not authorized"}},statements:t=e}},statements:e}}let h=R({user:["create","list","set-role","ban","impersonate","impersonate-admins","delete","set-password","set-email","get","update"],session:["list","revoke","delete"]}),I=h.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","set-email","get","update"],session:["list","revoke","delete"]}),N=h.newRole({user:[],session:[]}),g={admin:I,user:N},m=c({FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application",YOU_ARE_NOT_ALLOWED_TO_GET_USER:"You are not allowed to get user",NO_DATA_TO_UPDATE:"No data to update",YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:"You are not allowed to update users",YOU_CANNOT_REMOVE_YOURSELF:"You cannot remove yourself",YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:"You are not allowed to set a non-existent role value",YOU_CANNOT_IMPERSONATE_ADMINS:"You cannot impersonate admins",INVALID_ROLE_TYPE:"Invalid role type",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL:"You are not allowed to update users email",PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER:"Password cannot be updated through update-user. Use the set-user-password endpoint instead"}),S=(e,t,r,n)=>(e.events=e.events||{},e.events[r+10]||(e.events[r+10]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);n.splice(o,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}),L=(e,t)=>S(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>
1{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}});function v(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function y(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!y(e[r],t[r]))return!1;return!0}if(v(e)&&v(t)){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!(n in t)||!y(e[n],t[n]))return!1;return!0}return!1}function b(e,t){return S(e,({newValue:r,abort:n})=>{t(e.value,r)&&n()},2,t=>{let r=e.set,n=e.setKey;return e.setKey&&(e.setKey=(r,o)=>{let i;if(t({abort:()=>{i=!0},changed:r,newValue:{...e.value,[r]:o}}),!i)return n(r,o)}),e.set=e=>{let n;if(t({abort:()=>{n=!0},newValue:e}),!n)return r(e)},()=>{e.set=r,e.setKey=n}})}let U=[],D=0,w=0,P=e=>{let t=[],r={get:()=>(r.lc||r.listen(()=>{})(),r.value),init:e,lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=D+4;t<U.length;)U[t]===e?U.splice(t,4):t+=4;let n=t.indexOf(e);~n&&(t.splice(n,1),--r.lc||r.off())}),notify(e,n){w++;let o=!U.length;for(let o of t)U.push(o,r.value,e,n);if(o){for(D=0;D<U.length;D+=4)U[D](U[D+1],U[D+2],U[D+3]);U.length=0}},off(){},set(e){let t=r.value;t!==e&&(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r},C=()=>"u"<typeof window;function Y(e,t){return y(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}let M=(e,t,r,n)=>{let o=P({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>i(e)});b(o,Y);let i=async e=>new Promise(i=>{let a="function"==typeof n?n({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):n;r(t,{...a,query:{...a?.query,...e?.query},async onSuccess(e){let t=o.get(),r=null!=t.data&&null!=e.data&&y(t.data,e.data)?t.data:e.data;o.set({data:r,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await a?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,n=t.retryAttempt||0;if(r&&n<r)return;let i=401===e.error.status;o.set({error:e.error,data:i?null:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await a?.onError?.(e)},async onRequest(e){let t=o.get();o.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await a?.onRequest?.(e)}}).catch(e=>{o.set({error:e,data:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{i(void 0)})});e=Array.isArray(e)?e:[e];let a=!1,s=[];for(let t of e){let e=t.subscribe(async()=>{C()||(a?await i():L(o,()=>{let e=setTimeout(async()=>{a||(a=!0,await i())},0);return()=>{for(let e of s)e();clearTimeout(e)}}))});s.push(e)}return o},F=R({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),B=F.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),V=F.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),H=F.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),G={admin:B,owner:V,member:H},k=c({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION:"Email verification required to view or list invitations for the session email",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invali
1d resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role",ROLE_IS_ASSIGNED_TO_MEMBERS:"Cannot delete a role that is assigned to members. Please reassign the members to a different role first",INVALID_TEAM_ID:"Team id contains a reserved character"}),W=c({OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",TOO_MANY_ATTEMPTS:"Too many attempts"}),z=c({INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_REFERENCE_ID_FROM_API_KEY:"The reference id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only.",FAILED_TO_UPDATE_API_KEY:"Failed to update API key",NAME_REQUIRED:"API Key name is required.",ORGANIZATION_ID_REQUIRED:"Organization ID is required for organization-owned API keys.",USER_NOT_MEMBER_OF_ORGANIZATION:"You are not a member of the organization that owns this API key.",INSUFFICIENT_API_KEY_PERMISSIONS:"You do not have permission to perform this action on organization API keys.",NO_DEFAULT_API_KEY_CONFIGURATION_FOUND:"No default api-key configuration found.",ORGANIZATION_PLUGIN_REQUIRED:"Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin."}),j=Object.create(null),x=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?j:globalThis),$=new Proxy(j,{get:(e,t)=>x()[t]??j[t],has:(e,t)=>t in x()||t in j,set:(e,t,r)=>(x(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=x(!0);return delete r[t],!0},ownKeys:()=>Object.keys(x(!0))});function q(e,t){return void 0!==_.default&&_.default.env?_.default.env[e]??t:"u">typeof Deno?Deno.env.get(e)??t:"u">typeof Bun?Bun.env[e]??t:t}function K(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function X(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new T(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof T)throw t;throw new T(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(K(new URL(e).pathname)||"/")}catch{throw new T(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=K(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}$.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return q("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return q("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return q("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return q("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return q("NODE_ENV","development")},get PACKAGE_VERSION(){return q("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return q("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});let Z={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Q=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,J={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},ee=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,et=["javascript:","data:","vbscript:"],er={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&function(e){let t;try{t=new URL(e)}catch{return!0}return!et.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},en=Symbol.for("better-auth:broadcast-channel");var eo=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("u">typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");
1t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function ei(e="better-auth.message"){return globalThis[en]||(globalThis[en]=new eo(e)),globalThis[en]}let ea=Symbol.for("better-auth:focus-manager");var es=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||"u"<typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function el(){return globalThis[ea]||(globalThis[ea]=new es),globalThis[ea]}let eu=Symbol.for("better-auth:online-manager");var e_=class{listeners=new Set;isOnline="u"<typeof navigator||navigator.onLine;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function eE(){return globalThis[eu]||(globalThis[eu]=new e_),globalThis[eu]}let ec=()=>Math.floor(Date.now()/1e3);function ed(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function eO(e,t){return y(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function eT(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function eA(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,n=".",o){if(!eT(r))return e(t,{},n,o);let i={...r};for(let r of Object.keys(t)){if("__proto__"===r||"constructor"===r)continue;let a=t[r];null!=a&&(o&&o(i,r,a,n)||(Array.isArray(a)&&Array.isArray(i[r])?i[r]=[...a,...i[r]]:eT(a)&&eT(i[r])?i[r]=e(a,i[r],(n?`${n}.`:"")+r.toString(),o):i[r]=a))}return i})(t,r,"",e),{})}let ef=eA();eA((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),eA((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0});var ep=Object.defineProperty,eR=Object.defineProperties,eh=Object.getOwnPropertyDescriptors,eI=Object.getOwnPropertySymbols,eN=Object.prototype.hasOwnProperty,eg=Object.prototype.propertyIsEnumerable,em=(e,t,r)=>t in e?ep(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eS=(e,t)=>{for(var r in t||(t={}))eN.call(t,r)&&em(e,r,t[r]);if(eI)for(var r of eI(t))eg.call(t,r)&&em(e,r,t[r]);return e},eL=(e,t)=>eR(e,eh(t)),ev=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r,Error.captureStackTrace(this,this.constructor)}},ey=async(e,t)=>{var r,n,o,i,a,s;let l=t||{},u={onRequest:[null==t?void 0:t.onRequest],onResponse:[null==t?void 0:t.onResponse],onSuccess:[null==t?void 0:t.onSuccess],onError:[null==t?void 0:t.onError],onRetry:[null==t?void 0:t.onRetry]};if(!t||!(null==t?void 0:t.plugins))return{url:e,options:l,hooks:u};for(let _ of(null==t?void 0:t.plugins)||[]){if(_.init){let n=await (null==(r=_.init)?void 0:r.call(_,e.toString(),t));l=n.options||l,e=n.url}u.onRequest.push(null==(n=_.hooks)?void 0:n.onRequest),u.onResponse.push(null==(o=_.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(i=_.hooks)?void 0:i.onSuccess),u.onError.push(null==(a=_.hooks)?void 0:a.onError),u.onRetry.push(null==(s=_.hooks)?void 0:s.onRetry)}return{url:e,options:l,hooks:u}},eb=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},eU=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},eD=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;
1if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!o)return t;t.authorization=`${null!=n?n:""} ${o}`}}return t},ew=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function eP(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function eC(e){try{return JSON.parse(e)}catch(t){return e}}function eY(e){return"function"==typeof e}function eM(...e){let t={};for(let r of e)if(r)if(r instanceof Headers)r.forEach((e,r)=>{t[r]=e});else for(let[e,n]of Array.isArray(r)?r:Object.entries(r))null!=n&&(t[e]=n);return t}async function eF(e){let t=new Headers(eM(null==e?void 0:e.headers,await eD(e)));if(!t.has("content-type")){let r=eP(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var eB=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function eV(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new eB(r.issues);return r.value}var eH=["get","post","put","patch","delete"],eG=async(e,t)=>{var r,n,o,i,a,s,l,u;let _,{hooks:E,url:c,options:d}=await ey(e,t),O=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&eY(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&eY(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(d),T=new AbortController,A=null!=(r=d.signal)?r:T.signal,f=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];eH.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[a,s]=e.replace(i,"").split("?"),l=new URLSearchParams(s);for(let[e,t]of Object.entries(o||{})){let r;if(null!=t){if("string"==typeof t)r=t;else if(Array.isArray(t)){for(let r of t)l.append(e,r);continue}else r=JSON.stringify(t);l.set(e,r)}}let u=new Map;if(n)if(Array.isArray(n))for(let[e,t]of a.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];u.set(t,String(r))}else for(let[e,t]of Object.entries(n))u.set(`:${e}`,String(t));a=(a=a.split("/").map(e=>(function(e,t){let r,n=e;for(let[e,r]of t)n=n.replace(e,r);if("."===(r=n)||".."===r)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)})(e,u)).join("/")).replace(/^\/+/,"");let _=l.toString();return(_=_.length>0?`?${_}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${a}${_}`,i):`${i}${a}${_}`}(c,d),p=await eF(d),R=function(e,t){let r,{body:n}=e;return n?eP(n)&&"string"!=typeof n?"application/x-www-form-urlencoded"===((r=t.get("content-type"))?r.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(n).toString():JSON.stringify(n):n:null}(d,p),h=function(e,t){var r;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let n=null==(r=e.split("@")[1])?void 0:r.split("/")[0];return eH.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(c,d),I=eL(eS({},d),{url:f,headers:p,body:R,method:h,signal:A});for(let e of E.onRequest)if(e){let t=await e(I);"object"==typeof t&&null!==t&&Object.assign(I,t)}("pipeTo"in I&&"function"==typeof I.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pipe))&&!("duplex"in I)&&(I.duplex="half");let{clearTimeout:N}=(!(null==d?void 0:d.signal)&&(null==d?void 0:d.timeout)&&(_=setTimeout(()=>null==T?void 0:T.abort(),null==d?void 0:d.timeout)),{abortTimeout:_,clearTimeout:()=>{_&&clearTimeout(_)}}),g=await O(I.url,I);N();let m={response:g,request:I};for(let e of E.onResponse)if(e){let r=await e(eL(eS({},m),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?g.clone():g}));r instanceof Response?g=r:"object"==typeof r&&null!==r&&(g=r.response)}if(g.ok){if("HEAD"===I.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return ew.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(g),r={data:null,response:g,request:I};if("json"===e||"text"===e){let e=await g.text(),t=null!=(i=I.jsonParser)?i:eC;r.data=await t(e)}else r.data=await g[e]();for(let e of((null==I?void 0:I.output)&&I.output&&!I.disableValidation&&(r.data=await eV(I.output,r.data)),E.onSuccess))e&&await e(eL(eS({},r),{response:(null==(a=null==t?void 0:t.hookOptions)?void 0:a.cloneResponse)?g.clone():g}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let S=null!=(s=null==t?void 0:t.jsonParser)?s:eC,L=await g.text(),v=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(L),y=v?await S(L):null,b={response:g,responseText:L,request:I,error:eL(eS({},y),{status:g.status,statusText:g.statusText})};for(let e of E.onError)e&&await e(eL(eS({},b),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?g.clone():g}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new eb({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new eb(e);case"exponential":return new eU(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;
1if(await r.shouldAttemptRetry(n,g)){for(let e of E.onRetry)e&&await e(m);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await eG(e,eL(eS({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new ev(g.status,g.statusText,v?y:L);return{data:null,error:eL(eS({},y),{status:g.status,statusText:g.statusText})}};let ek=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,eW=/['\u2019]/g;function ez(e){return(e.replace(eW,"").match(ek)??[]).map(e=>e.toLowerCase()).join("-")}var ej=e.i(271645);let ex=function(e){var t;let{pluginPathMethods:r,pluginsActions:n,pluginsAtoms:o,$fetch:i,$store:a,atomListeners:s}=(e=>{var t;let r,n,o,i,a,s,l,u="credentials"in Request.prototype,E=function(e,t,r,n){if(e)return X(e,t);if(!1!==n){let e=$.BETTER_AUTH_URL||$.NEXT_PUBLIC_BETTER_AUTH_URL||$.PUBLIC_BETTER_AUTH_URL||$.NUXT_PUBLIC_BETTER_AUTH_URL||$.NUXT_PUBLIC_AUTH_URL||("/"!==$.BASE_URL?$.BASE_URL:void 0);if(e)return X(e,t)}r?.headers.get("x-forwarded-host"),r?.headers.get("x-forwarded-proto");if(r){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(r.url);if(!e)throw new T("Could not get origin from request. Please provide a valid base URL.");return X(e,t)}if("u">typeof window&&window.location)return X(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==_.default){if(_.default.env.NEXT_PUBLIC_AUTH_URL)return _.default.env.NEXT_PUBLIC_AUTH_URL;if("u"<typeof window){if(_.default.env.NEXTAUTH_URL)try{return _.default.env.NEXTAUTH_URL}catch{}if(_.default.env.VERCEL_URL)try{let t=_.default.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${_.default.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",c=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],d={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:O,onError:A,onRequest:f,onResponse:p,...R}=e?.fetchOptions||{},h=(t={baseURL:E,...u?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let a=e.trim(),s=a.toLowerCase();if(s.length<=9&&s in J)return J[s];if(!Q.test(a)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(Z).some(([e,t])=>{let r=t.test(a);return r&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){n&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(i&&"string"==typeof t){let e=function(e){let t=ee.exec(e);if(!t)return null;let[,r,n,o,i,a,s,l,u,_,E]=t,c=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(i,10),parseInt(a,10),parseInt(s,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(_,10)+parseInt(E,10))*("+"===u?-1:1);c.setUTCMinutes(c.getUTCMinutes()+e)}return c instanceof Date&&!isNaN(c.getTime())?c:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...R,plugins:[d,...R.plugins||[],...e?.disableDefaultFetchPlugins?[]:[er],...c]},async function(e,r){let n,o=eL(eS(eS({},t),r),{headers:eM(null==t?void 0:t.headers,null==r?void 0:r.headers),plugins:[...(null==t?void 0:t.plugins)||[],(n=t||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,i,a;let s=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(s){let r=e;(null==(i=s.config)?void 0:i.prefix)&&r.startsWith(s.config.prefix)&&(r=r.replace(s.config.prefix,""),s.config.baseURL&&(e=e.replace(s.config.prefix,s.config.baseURL))),(null==(a=s.config)?void 0:a.baseURL)&&r.startsWith(s.config.baseURL)&&(r=r.replace(s.config.baseURL,"")),r.startsWith("/")&&"@"===r.charAt(1)&&(r=r.substring(1));let n=s.schema[r];if(n){let r=null==t?void 0:t.headers;if(n.headers&&!(null==t?void 0:t.disableValidation)){let e={};if(null==t?void 0:t.headers){if(t.headers instanceof Headers)t.headers.forEac
1h((t,r)=>{e[r.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[r,n]of Object.entries(t.headers))null!=n&&(e[r.toLowerCase()]=n)}let o=await eV(n.headers,e),i={};for(let[e,t]of Object.entries(o))i[e.toLowerCase()]=t;r=i}let o=eL(eS({},t),{method:n.method,output:n.output,headers:r});return(null==t?void 0:t.disableValidation)||(o=eL(eS({},o),{body:n.input?await eV(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await eV(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await eV(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:o}}}return{url:e,options:t}}}),...(null==r?void 0:r.plugins)||[]]});if(null==t?void 0:t.catchAllError)try{return await eG(e,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await eG(e,o)}),{$sessionSignal:I,session:N,broadcastSessionUpdate:g}=(n=P(!1),b(i=P({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o=e=>s(e)}),eO),a=e=>{if(r!==e)return;let t=i.get();r=void 0,(t.isPending||t.isRefetching)&&i.set({...t,isPending:!1,isRefetching:!1,refetch:o})},s=async e=>{r?.abort();let t=new AbortController;r=t;let n=i.get();i.set({...n,isPending:null===n.data,isRefetching:!0,error:null,refetch:o});try{var s;let r=await h("/get-session",{method:"GET",query:e?.query,signal:t.signal});if(t.signal.aborted)return void a(t);let{data:n,error:l}=ed(r);if(n?.needsRefresh)try{let e=await h("/get-session",{method:"POST",signal:t.signal});if(t.signal.aborted)return void a(t);({data:n,error:l}=ed(e))}catch{if(t.signal.aborted)return void a(t)}if(l){let e=i.get(),t=l?.status===401;i.set({data:t?null:e.data,error:l,isPending:!1,isRefetching:!1,refetch:o});return}let u=(s=n)&&(null!==s.session||null!==s.user)?s:null,_=i.get(),E=null!=_.data&&null!=u&&y(_.data,u)?_.data:u;i.set({data:E,error:null,isPending:!1,isRefetching:!1,refetch:o})}catch(r){if(t.signal.aborted)return void a(t);let e=i.get();i.set({data:e.data,error:r,isPending:!1,isRefetching:!1,refetch:o})}},l=()=>{},L(i,()=>{let t;"u"<typeof window||(t=setTimeout(()=>{s()},0));let o=function(e){let{fetchSession:t,shouldPollSession:r=()=>!0,sessionSignal:n,options:o={}}=e,i=o.sessionOptions?.refetchInterval??0,a=o.sessionOptions?.refetchOnWindowFocus??!0,s=o.sessionOptions?.refetchWhenOffline??!1,l={isInitialized:!1,lastSessionRequest:0},u=e=>{if(s||eE().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=ec(),t();return}if(e?.event==="visibilitychange"){if(ec()-l.lastSessionRequest<5)return;l.lastSessionRequest=ec(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,i&&i>0&&(l.pollInterval=setInterval(()=>{r()&&u({event:"poll"})},1e3*i)),l.unsubscribeBroadcast=ei().subscribe(()=>{u({event:"storage"})}),a&&(l.unsubscribeFocus=el().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=eE().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=n.listen(()=>{t()}),l.cleanupBroadcastSetup=ei().setup(),l.cleanupFocusSetup=el().setup(),l.cleanupOnlineSetup=eE().setup())},cleanup:()=>{l.isInitialized&&(l.pollInterval&&(clearInterval(l.pollInterval),l.pollInterval=void 0),l.unsubscribeBroadcast&&(l.unsubscribeBroadcast(),l.unsubscribeBroadcast=void 0),l.unsubscribeFocus&&(l.unsubscribeFocus(),l.unsubscribeFocus=void 0),l.unsubscribeOnline&&(l.unsubscribeOnline(),l.unsubscribeOnline=void 0),l.unsubscribeSignal&&(l.unsubscribeSignal(),l.unsubscribeSignal=void 0),l.cleanupBroadcastSetup&&(l.cleanupBroadcastSetup(),l.cleanupBroadcastSetup=void 0),l.cleanupFocusSetup&&(l.cleanupFocusSetup(),l.cleanupFocusSetup=void 0),l.cleanupOnlineSetup&&(l.cleanupOnlineSetup(),l.cleanupOnlineSetup=void 0),l.isInitialized=!1,l.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:e=>{ei().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:s,shouldPollSession:()=>null!=i.get().data,sessionSignal:n,options:e});return o.init(),l=o.broadcastSessionUpdate,()=>{t&&clearTimeout(t);let e=r;e?.abort(),e&&a(e),o.cleanup()}}),{session:i,$sessionSignal:n,broadcastSessionUpdate:e=>l(e)}),m=e?.plugins||[],S={},v={$sessionSignal:I,session:N}
1,U={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},D=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||"/update-session"===e||"/sign-up/email"===e||"/sign-in/email"===e||"/delete-user"===e||"/verify-email"===e||"/revoke-sessions"===e||"/revoke-session"===e||"/revoke-other-sessions"===e||"/change-email"===e||"/change-password"===e,callback(e){"/sign-out"===e?g("signout"):("/update-user"===e||"/update-session"===e)&&g("updateUser")}}];for(let e of m)e.getAtoms&&Object.assign(v,e.getAtoms?.(h)),e.pathMethods&&Object.assign(U,e.pathMethods),e.atomListeners&&D.push(...e.atomListeners);let w={notify:e=>{v[e].set(!v[e].get())},listen:(e,t)=>{v[e].subscribe(t)},atoms:v};for(let t of m)t.getActions&&(S=ef(t.getActions?.(h,w,e)??{},S));return{get baseURL(){return E},pluginsActions:S,pluginsAtoms:v,pluginPathMethods:U,atomListeners:D,$fetch:h,$store:w}})(e),l={};for(let[e,t]of Object.entries(o))l[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let r=(0,ej.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,i=(0,ej.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n).add(void 0),e.listen((e,r,n)=>{t.has(n)&&o(e,r,n)})}return e.listen(o)},o),a=()=>r.current;return(0,ej.useSyncExternalStore)(i,a,a)})(t);return t={...n,...l,$fetch:i,$store:a},function e(n=[]){return new Proxy(function(){},{get(r,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let a=[...n,o],s=t;for(let e of a)if(s&&"object"==typeof s&&e in s)s=s[e];else{s=void 0;break}return"function"==typeof s?s:"object"==typeof(i=s)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?s:e(a)},apply:async(e,t,a)=>{let l="/"+n.map(ez).join("/"),u=a[0]||{},_=a[1]||{},{query:E,fetchOptions:c,...d}=u,O={..._,...c},T=function(e,t,r){let n=t[e],{fetchOptions:o,query:i,...a}=r||{};return n||(o?.method?o.method:a&&Object.keys(a).length>0?"POST":"GET")}(l,r,u);return await i(l,{...O,body:"GET"===T?void 0:{...d,...O?.body||{}},query:E||O?.query,method:T,async onSuccess(e){if(await O?.onSuccess?.(e),!s||O.disableSignal)return;let t=s.filter(e=>e.matcher(l));if(!t.length)return;let r=new Set;for(let e of t){let t=o[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let n=t.get();setTimeout(()=>{t.set(!n)},10),e.callback?.(l)}}})}})}()}({baseURL:"https://app.truemetriks.com",plugins:[(t={admin:I,user:N,...void 0},{id:"admin-client",version:E,$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:e=>(e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||"user").split(","),r=e.options?.roles||g;for(let n of t)if(r[n]?.authorize(e.permissions)?.success)return!0;return!1})({role:e.role,options:{ac:void 0,roles:t},permissions:e.permissions})}}),pathMethods:{"/admin/list-users":"GET","/admin/impersonate-user":"POST","/admin/stop-impersonating":"POST"},atomListeners:[{matcher:e=>"/admin/impersonate-user"===e||"/admin/stop-impersonating"===e,signal:"$sessionSignal"}],$ERROR_CODES:m}),(u={teams:{enabled:!0}},r=P(!1),n=P(!1),o=P(!1),i=P(!1),a={admin:B,member:H,owner:V,...u?.roles},{id:"organization",version:E,$InferServerPlugin:{},getActions:(e,t,r)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:e=>{let t;return((e,t)=>{if(!e.permissions)return!1;let r=e.role.split(","),n=e.options.creatorRole||"owner",o=r.includes(n),i=e.allowCreatorAllPermissions||!1;if(o&&i)return!0;for(let n of r)if(t[n]?.authorize(e.permissions)?.success)return!0;return!1})(t={role:e.role,options:{ac:u?.ac,roles:a},permissions:e.permissions},t.options.roles||G)}}}),getAtoms:e=>{let t=M(r,"/organization/list",e,{method:"GET"});return{$listOrg:r,$activeOrgSignal:n,$activeMemberSignal:o,$activeMemberRoleSignal:i,activeOrganization:M([n],"/organization/get-full-organization",e,()=>({method:"GET"})),listOrganizations:t,activeMember:M([n,o],"/organization/get-active-member",e,{method:"GET"}),activeMemberRole:M([n,i],"/organization/get-active-member-role",e,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher:e=>"/organization/create"===e||"/organization/delete"===e||"/organization/update"===e,signal:"$listOrg"},{matcher:e=>"/sign-out"===e||e.startsWith("/organization"),signal:"$activeOrgSignal"},{matcher:e=>e.startsWith("/organization/set-active")||"/organization/create"===e||"/organization/delete"===e||"/organization/remove-member"===e||"/organization/leave"===e||"/organization/accept-invitation"===e,signal:"$sessionSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberRoleSignal"}],$ERROR_CODES:k}
1),{id:"email-otp",version:E,$InferServerPlugin:{},atomListeners:[{matcher:e=>"/email-otp/verify-email"===e||"/sign-in/email-otp"===e||"/email-otp/request-email-change"===e,signal:"$sessionSignal"}],$ERROR_CODES:W},{id:"api-key",$InferServerPlugin:{},pathMethods:{"/api-key/create":"POST","/api-key/delete":"POST","/api-key/delete-all-expired-api-keys":"POST"},$ERROR_CODES:z}],fetchOptions:{credentials:"include"},socialProviders:["google","github","twitter"]});e.s(["authClient",0,ex],386909)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.