1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72136,e=>{"use strict";var t,n,r=e.i(24290);let o=Object.create(null),i=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),s=new Proxy(o,{get:(e,t)=>i()[t]??o[t],has:(e,t)=>t in i()||t in o,set:(e,t,n)=>(i(!0)[t]=n,!0),deleteProperty(e,t){if(!t)return!1;let n=i(!0);return delete n[t],!0},ownKeys:()=>Object.keys(i(!0))});function a(e,t){return void 0!==r.default&&r.default.env?r.default.env[e]??t:"u">typeof Deno?Deno.env.get(e)??t:"u">typeof Bun?Bun.env[e]??t:t}s.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return a("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return a("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return a("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return a("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return a("NODE_ENV","development")},get PACKAGE_VERSION(){return a("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return a("BETTER_AUTH_TELEMETRY_ENDPOINT","")}}),Object.fromEntries(Object.entries({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"}).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]));let l={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 u=class extends Error{status;body;headers;statusCode;constructor(e="INTERNAL_SERVER_ERROR",t,n={},r="number"==typeof e?e:l[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name="APIError",this.status=e,this.headers=n,this.statusCode=r,this.body=t}};Symbol.for("better-call:api-error-headers"),t=u,n=Error,Object.defineProperty((class e extends t{#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:()=>n,enumerable:!1,configurable:!0});var c=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function d(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function f(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new c(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof c)throw t;throw new c(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(d(new URL(e).pathname)||"/")}catch{throw new c(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let n=d(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`):n}let p={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*:/},E=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,h={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},T=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,_=["javascript:","data:","vbscript:"],v={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!_.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},R=(e,t,n,r)=>(e.events=e.events||{},e.events[n+10]||(e.events[n+10]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],o=r.indexOf(t);~o&&(r.splice(o,1),r.length||(e.events[n+10](),delete e.events[n+10]))});function O(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function b(e,t){if(e===t)return!0;
1if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!b(e[n],t[n]))return!1;return!0}if(O(e)&&O(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!b(e[r],t[r]))return!1;return!0}return!1}let y=Symbol.for("better-auth:broadcast-channel");var g=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??"{}");t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function A(e="better-auth.message"){return globalThis[y]||(globalThis[y]=new g(e)),globalThis[y]}let S=Symbol.for("better-auth:focus-manager");var I=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 L(){return globalThis[S]||(globalThis[S]=new I),globalThis[S]}let m=Symbol.for("better-auth:online-manager");var w=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 U(){return globalThis[m]||(globalThis[m]=new w),globalThis[m]}let N=()=>Math.floor(Date.now()/1e3),D=[],P=0,C=globalThis.nanostoresGlobal||={epoch:0},j=e=>{let t=[],n={eq:Object.is,get:()=>(n.lc||n.listen(()=>{})(),n.value),init:e,lc:0,listen:e=>(n.lc=t.push(e),()=>{for(let t=P;t<D.length;)D[t]===e?D.splice(t,4):t+=4;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}),notify(e,r){C.epoch++;let o=!D.length;for(let o of t)D.push(o,n,e,r);o&&(()=>{let e,t;for(;P<D.length;){t=P,P+=4;try{D[t](D[t+1].value,D[t+2],D[t+3])}catch(t){e=t}}if(D.length=P=0,e)throw e})()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n};function F(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function B(e,t){return b(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function k(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 M(e){return(...t)=>t.reduce((t,n)=>(function e(t,n,r=".",o){if(!k(n))return e(t,{},r,o);let i={...n};for(let n of Object.keys(t)){if("__proto__"===n||"constructor"===n)continue;let s=t[n];null!=s&&(o&&o(i,n,s,r)||(Array.isArray(s)&&Array.isArray(i[n])?i[n]=[...s,...i[n]]:k(s)&&k(i[n])?i[n]=e(s,i[n],(r?`${r}.`:"")+n.toString(),o):i[n]=s))}return i})(t,n,"",e),{})}let x=M();M((e,t,n)=>{if(void 0!==e[t]&&"function"==typeof n)return e[t]=n(e[t]),!0}),M((e,t,n)=>{if(Array.isArray(e[t])&&"function"==typeof n)return e[t]=n(e[t]),!0});var V=Object.defineProperty,H=Object.defineProperties,q=Object.getOwnPropertyDescriptors,$=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,Y=(e,t,n
1)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t)=>{for(var n in t||(t={}))G.call(t,n)&&Y(e,n,t[n]);if($)for(var n of $(t))W.call(t,n)&&Y(e,n,t[n]);return e},X=(e,t)=>H(e,q(t)),Q=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},J=async(e,t)=>{var n,r,o,i,s,a;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 c of(null==t?void 0:t.plugins)||[]){if(c.init){let r=await (null==(n=c.init)?void 0:n.call(c,e.toString(),t));l=r.options||l,e=r.url}u.onRequest.push(null==(r=c.hooks)?void 0:r.onRequest),u.onResponse.push(null==(o=c.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(i=c.hooks)?void 0:i.onSuccess),u.onError.push(null==(s=c.hooks)?void 0:s.onError),u.onRetry.push(null==(a=c.hooks)?void 0:a.onRetry)}return{url:e,options:l,hooks:u}},z=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}},Z=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)}},ee=async e=>{let t={},n=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if("Basic"===e.auth.type){let[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if("Custom"===e.auth.type){let[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${null!=r?r:""} ${o}`}}return t},et=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function en(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 er(e){try{return JSON.parse(e)}catch(t){return e}}function eo(e){return"function"==typeof e}function ei(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else for(let[e,r]of Array.isArray(n)?n:Object.entries(n))null!=r&&(t[e]=r);return t}async function es(e){let t=new Headers(ei(null==e?void 0:e.headers,await ee(e)));if(!t.has("content-type")){let n=en(null==e?void 0:e.body)?"application/json":null;n&&t.set("content-type",n)}return t}var ea=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function el(e,t){let n=await e["~standard"].validate(t);if(n.issues)throw new ea(n.issues);return n.value}var eu=["get","post","put","patch","delete"],ec=async(e,t)=>{var n,r,o,i,s,a,l,u;let c,{hooks:d,url:f,options:p}=await J(e,t),E=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&eo(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&eo(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(p),h=new AbortController,T=null!=(n=p.signal)?n:h.signal,_=function(e,t){let{baseURL:n,params:r,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];eu.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[s,a]=e.replace(i,"").split("?"),l=new URLSearchParams(a);for(let[e,t]of Object.entries(o||{})){let n;if(null!=t){if("string"==typeof t)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}}let u=new Map;if(r)if(Array.isArray(r))for(let[e,t]of s.split("/").filter(e=>e.startsWith(":")).entries()){let n=r[e];u.set(t,String(n))}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t));s=(s=s.split("/").map(e=>(function(e,t){let n,r=e;for(let[e,n]of t)r=r.replace(e,n);if("."===(n=r)||".."===n)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(r)})(e,u)).join("/")).replace(/^\/+/,"");let c=l.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${s}${c}`,i):`${i}${s}${c}`}(f,p),v=await es(p),R=function(e,t){let n,{body:r}=e;return r?en(r)&&"string"!=typeof r?"application/x-www-form-urlencoded"===((n=t.get("content-type"))?n.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(r).toString():JSON.stringify(r):r:null}(p,v),O=function(e,t){var n;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let r=null==(n=e.split("@")[1])?void 0:n.split("/")[0];return eu.includes(r)?r.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(f,p),b=X(K({},p),{url:_,headers:v,body:R,method:O,signal:T});for(let e of d.onRequest)if(e){let t=await e(b);"object"==typeof t&&null!==t&&Object.assign(b,t)}("pipeTo"in b&&"function"==typeof b.pipeTo||"function"==typeof(null==(r=null==t?void 0:t.body)?void 0:r.pipe))&&!("duplex"in b)&&(b.duplex="half");let{clearTimeout:y}=(!(null==p?void 0:p.signal)&&(null==p?void 0:p.timeout)&&(c=setTimeout(()=>null==h?void 0:h.abort(),null==p?void 0:p.timeout)),{abortTimeout:c,clearTimeout:()=>{c&&clearTimeout(c)}}),g=await E(b.url,b);y();let A={response:g,request:b};for(let e of d.onResponse)if(e){let n=await e(X(K({},A),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?g.clone():g}));n instanceof Response?g=n:"object"==typeof n&&null!==n&&(g=n.response)}if(g.ok){if("HEAD"===b.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let r=t.split(";").shift()||"";return et.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}(g),n={data:null,response:g,request:b};if("json"===e||"text"===e){let e=await g.text(),t=null!=(i=b.jsonParser)?i:er;n.data=await t(e)}else n.data=await g[e]();for(let e of((null==b?void 0:b.output)&&b.output&&!b.disableValidation&&(n.data=await el(b.output,n.data)),d.onSuccess))e&&await e(X(K({},n),{response:(null==(s=null==t?void 0:t.hookOptions)?void 0:s.cloneResponse)?g.clone():g}));return(null==t?void 0:t.throw)?n.data:{data:n.data,error:null}}let S=null!=(a=null==t?void 0:t.jsonParser)?a:er,I=await g.text(),L=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(I),m=L?await S(I):null,w={response:g,responseText:I,request:b,error:X(K({},m),{status:g.status,statusText:g.statusText})};for(let e of d.onError)e&&await e(X(K({},w),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?g.clone():g}));if(null==t?void 0:t.retry){let n=function(e){if("number"==typeof e)return new z({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new z(e);case"exponential":return new Z(e);default:throw Error("Invalid retry strategy")}}(t.retry),r=null!=(u=t.retryAttempt)?u:0;
1if(await n.shouldAttemptRetry(r,g)){for(let e of d.onRetry)e&&await e(A);let o=n.getDelay(r);return await new Promise(e=>setTimeout(e,o)),await ec(e,X(K({},t),{retryAttempt:r+1}))}}if(null==t?void 0:t.throw)throw new Q(g.status,g.statusText,L?m:I);return{data:null,error:X(K({},m),{status:g.status,statusText:g.statusText})}};let ed=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,ef=/['\u2019]/g;function ep(e){return(e.replace(ef,"").match(ed)??[]).map(e=>e.toLowerCase()).join("-")}function eE(e,t){let n=t.split(".").flatMap(e=>(function e(t){if(eh.test(t)){let[,n,r]=t.match(eh);return[...e(n),r]}return[t]})(e)),r=e;for(let e of n){if(null==r)return;r=r[e]}return r}let eh=/(.*)\[(\d+)\]/;var eT=e.i(96505);let{useSession:e_,signOut:ev}=function(e){var t;let{pluginPathMethods:n,pluginsActions:o,pluginsAtoms:i,hydrateSession:a,$fetch:l,$store:u,atomListeners:d}=(e=>{var t,n;let o,i,a,l,u,d,_,O,y,g="credentials"in Request.prototype,S=function(e,t,n,r){if(e)return f(e,t);if(!1!==r){let e=s.BETTER_AUTH_URL||s.NEXT_PUBLIC_BETTER_AUTH_URL||s.PUBLIC_BETTER_AUTH_URL||s.NUXT_PUBLIC_BETTER_AUTH_URL||s.NUXT_PUBLIC_AUTH_URL||("/"!==s.BASE_URL?s.BASE_URL:void 0);if(e)return f(e,t)}n?.headers.get("x-forwarded-host"),n?.headers.get("x-forwarded-proto");if(n){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(n.url);if(!e)throw new c("Could not get origin from request. Please provide a valid base URL.");return f(e,t)}if("u">typeof window&&window.location)return f(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==r.default){if(r.default.env.NEXT_PUBLIC_AUTH_URL)return r.default.env.NEXT_PUBLIC_AUTH_URL;if("u"<typeof window){if(r.default.env.NEXTAUTH_URL)try{return r.default.env.NEXTAUTH_URL}catch{}if(r.default.env.VERCEL_URL)try{let t=r.default.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${r.default.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",I=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],m={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:w,onError:D,onRequest:P,onResponse:C,...k}=e?.fetchOptions||{},M=(t={baseURL:S,...g?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let s=e.trim(),a=s.toLowerCase();if(a.length<=9&&a in h)return h[a];if(!E.test(s)){if(n)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(p).some(([e,t])=>{let n=t.test(s);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(s,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(i&&"string"==typeof t){let e=function(e){let t=T.exec(e);if(!t)return null;let[,n,r,o,i,s,a,l,u,c,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(i,10),parseInt(s,10),parseInt(a,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(d,10))*("+"===u?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return f instanceof Date&&!isNaN(f.getTime())?f:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(n)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...k,plugins:[m,...k.plugins||[],...e?.disableDefaultFetchPlugins?[]:[v],...I]},async function(e,n){let r,o=X(K(K({},t),n),{headers:ei(null==t?void 0:t.headers,null==n?void 0:n.headers),plugins:[...(null==t?void 0:t.plugins)||[],(r=t||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var n,o,i,s;let a=(null==(o=null==(n=r.plugins)?void 0:n.find(t=>{var n;return null!=(n=t.schema)&&!!n.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}
1))?void 0:o.schema)||r.schema;if(a){let n=e;(null==(i=a.config)?void 0:i.prefix)&&n.startsWith(a.config.prefix)&&(n=n.replace(a.config.prefix,""),a.config.baseURL&&(e=e.replace(a.config.prefix,a.config.baseURL))),(null==(s=a.config)?void 0:s.baseURL)&&n.startsWith(a.config.baseURL)&&(n=n.replace(a.config.baseURL,"")),n.startsWith("/")&&"@"===n.charAt(1)&&(n=n.substring(1));let r=a.schema[n];if(r){let n=null==t?void 0:t.headers;if(r.headers&&!(null==t?void 0:t.disableValidation)){let e={};if(null==t?void 0:t.headers){if(t.headers instanceof Headers)t.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[n,r]of Object.entries(t.headers))null!=r&&(e[n.toLowerCase()]=r)}let o=await el(r.headers,e),i={};for(let[e,t]of Object.entries(o))i[e.toLowerCase()]=t;n=i}let o=X(K({},t),{method:r.method,output:r.output,headers:n});return(null==t?void 0:t.disableValidation)||(o=X(K({},o),{body:r.input?await el(r.input,null==t?void 0:t.body):null==t?void 0:t.body,params:r.params?await el(r.params,null==t?void 0:t.params):null==t?void 0:t.params,query:r.query?await el(r.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:o}}}return{url:e,options:t}}}),...(null==n?void 0:n.plugins)||[]]});if(null==t?void 0:t.catchAllError)try{return await ec(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 ec(e,o)}),{$sessionSignal:V,session:H,broadcastSessionUpdate:q}=(i=j(!1),a=0,l=0,i.listen(()=>{l++,a=0}),d=j({data:null,error:null,isPending:!0,isRefetching:!1,refetch:u=e=>O(e)}),R(d,({newValue:e,abort:t})=>{B(d.value,e)&&t()},2,e=>{let t=d.set,n=d.setKey;return d.setKey&&(d.setKey=(t,r)=>{let o;if(e({abort:()=>{o=!0},changed:t,newValue:{...d.value,[t]:r}}),!o)return n(t,r)}),d.set=n=>{let r;if(e({abort:()=>{r=!0},newValue:n}),!r)return t(n)},()=>{d.set=t,d.setKey=n}}),_=async(e,t)=>{let n=d.value;if(d.set({...n,isPending:null===n.data,isRefetching:!0,error:null,refetch:u}),e.aborted)return"aborted";try{var r;let n=await M("/get-session",{method:"GET",query:t?.query,signal:e});if(e.aborted)return"aborted";let{data:o,error:i}=F(n),s="fresh";if(o?.needsRefresh)try{let t=await M("/get-session",{method:"POST",signal:e});if(e.aborted)return"aborted";({data:o,error:i}=F(t))}catch{if(e.aborted)return"aborted";s="stale"}if(i){let e=d.value,t=i?.status===401;return d.set({data:t?null:e.data,error:i,isPending:!1,isRefetching:!1,refetch:u}),"failed"}let a=(r=o)&&(null!==r.session||null!==r.user)?r:null,l=d.value,c=null!=l.data&&null!=a&&b(l.data,a)?l.data:a;return d.set({data:c,error:null,isPending:!1,isRefetching:!1,refetch:u}),s}catch(n){if(e.aborted)return"aborted";let t=d.value;return d.set({data:t.data,error:n,isPending:!1,isRefetching:!1,refetch:u}),"failed"}},O=e=>{a=0,o?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?"aborted":_(t.signal,e)),revision:l};o=n;let r=e=>{if(o===n){let t,r;o=void 0,"fresh"===e&&n.revision===l&&(r=(t=d.value.data?.session?.expiresAt)instanceof Date?t.getTime():1/0,a=Math.min(Date.now()+1e3,r))}};return n.promise.then(r,()=>r("failed")),n.promise.then(()=>void 0)},y=()=>{},n=()=>{let t;"u"<typeof window||(t=setTimeout(()=>{o?.revision===l?o.promise.then(()=>void 0):Date.now()<a?Promise.resolve():O()},0));let n=function(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:o={}}=e,i=o.sessionOptions?.refetchInterval??0,s=o.sessionOptions?.refetchOnWindowFocus??!0,a=o.sessionOptions?.refetchWhenOffline??!1,l={isInitialized:!1,lastSessionRequest:0},u=e=>{if(a||U().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=N(),t();return}if(e?.event==="visibilitychange"){if(N()-l.lastSessionRequest<5)return;l.lastSessionRequest=N(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,i&&i>0&&(l.pollInterval=setInterval(()=>{n()&&u({event:"poll"})},1e3*i)),l.unsubscribeBroadcast=A().subscribe(()=>{u({event:"storage"})}),s&&(l.unsubscribeFocus=L().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=U().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=r.listen(()=>{t()}),l.cleanupBroadcastSetup=A().setup(),l.cleanupFocusSetup=L().setup(),l.cleanupOnlineSetup=U().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=>{A().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:O,shouldPollSession:()=>null!=d.value.data,sessionSignal:i,options:e});return n.init(),y=n.broadcastSessionUpdate,()=>{t&&clearTimeout(t),n.cleanup()}},R(d,e=>{let t=n(e);t&&d.events[6].push(t)},5,e=>{let t=d.listen;d.listen=(...n)=>(d.lc||d.active||(d.active=!0,e()),t(...n));let n=d.off;return d.events[6]=[],d.off=()=>{n(),setTimeout(()=>{if(d.active&&!d.lc){for(let e of(d.active=!1,d.events[6]))e();d.events[6]=[]}},1e3)},()=>{d.listen=t,d.off=n}}),{session:d,$sessionSignal:i,broadcastSessionUpdate:e=>y(e)}),$=!1,G=e?.plugins||[],W={},Y={$sessionSignal:V,session:H}
1,Q={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},J=[{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?q("signout"):("/update-user"===e||"/update-session"===e)&&q("updateUser")}}];for(let e of G)e.getAtoms&&Object.assign(Y,e.getAtoms?.(M)),e.pathMethods&&Object.assign(Q,e.pathMethods),e.atomListeners&&J.push(...e.atomListeners);let z={notify:e=>{Y[e].set(!Y[e].get())},listen:(e,t)=>{Y[e].subscribe(t)},atoms:Y};for(let t of G)t.getActions&&(W=x(t.getActions?.(M,z,e)??{},W));return{get baseURL(){return S},pluginsActions:W,pluginsAtoms:Y,pluginPathMethods:Q,atomListeners:J,hydrateSession:e=>{$||null===e||($=!0,function(e,t){if("u"<typeof window)return;let n=e.get();null===n.data&&null!==t&&e.set({...n,data:t,error:null,isPending:!1})}(H,e))},$sessionSignal:V,$fetch:M,$store:z}})(e),_={};for(let[e,t]of Object.entries(i))_[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let n=(0,eT.useRef)(e.get()),{keys:r,deps:o=[e,r]}=t,i=(0,eT.useCallback)(t=>{let o=e=>{n.current!==e&&(n.current=e,t())};if(o(e.value),r?.length){let t;return t=new Set(r),e.listen((e,n,i)=>{(void 0===i?r.some(t=>void 0===n||e[t]!==n[t]||eE(e,t)!==eE(n,t)):t.has(i)||t.has(i.split(/\.|\[/)[0]))&&o(e,n,i)})}return e.listen(o)},o),s=()=>n.current;return(0,eT.useSyncExternalStore)(i,s,s)})(t);return t={...o,..._,hydrateSession:a,$fetch:l,$store:u},function e(r=[]){return new Proxy(function(){},{get(n,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let s=[...r,o],a=t;for(let e of s)if(a&&"object"==typeof a&&e in a)a=a[e];else{a=void 0;break}return"function"==typeof a?a:"object"==typeof(i=a)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?a:e(s)},apply:async(e,t,o)=>{let s="/"+r.map(ep).join("/"),a=o[0]||{},u=o[1]||{},{query:c,fetchOptions:f,...p}=a,E={...u,...f},h=function(e,t,n){let r=t[e],{fetchOptions:o,query:i,...s}=n||{};return r||(o?.method?o.method:s&&Object.keys(s).length>0?"POST":"GET")}(s,n,a);return await l(s,{...E,body:"GET"===h?void 0:{...p,...E?.body||{}},query:c||E?.query,method:h,async onSuccess(e){if(await E?.onSuccess?.(e),!d||E.disableSignal)return;let t=d.filter(e=>e.matcher(s));if(!t.length)return;let n=new Set;for(let e of t){let t=i[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let r=t.get();setTimeout(()=>{t.set(!r)},10),e.callback?.(s)}}})}})}()}({plugins:[{id:"magic-link",version:"1.7.4",$InferServerPlugin:{}}]});e.s(["signOut",0,ev,"useSession",0,e_],72136)}]);
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.