1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69296,e=>{"use strict";var t,i,r=e.i(90242);let s=Object.create(null),n=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?s:globalThis),o=new Proxy(s,{get:(e,t)=>n()[t]??s[t],has:(e,t)=>t in n()||t in s,set:(e,t,i)=>(n(!0)[t]=i,!0),deleteProperty(e,t){if(!t)return!1;let i=n(!0);return delete i[t],!0},ownKeys:()=>Object.keys(n(!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}o.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{constructor(e="INTERNAL_SERVER_ERROR",t,i={},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=i,this.statusCode=r,this.name="APIError",this.status=e,this.headers=i,this.statusCode=r,this.body=t}};Symbol.for("better-call:api-error-headers"),t=u,i=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:()=>i,enumerable:!1,configurable:!0});var c=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function h(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function d(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"/"!==(h(new URL(e).pathname)||"/")}catch{throw new c(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let i=h(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${i}${t}`):i}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*:/},f=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,y={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},v=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,E=["javascript:","data:","vbscript:"],g={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!E.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},b=(e,t,i,r)=>(e.events=e.events||{},e.events[i+10]||(e.events[i+10]=r(t=>{e.events[i].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[i]=e.events[i]||[],e.events[i].push(t),()=>{let r=e.events[i],s=r.indexOf(t);r.splice(s,1),r.length||(delete e.events[i],e.events[i+10](),delete e.events[i+10])});function m(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function T(e,t){if(e===t)return!0;
1if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!T(e[i],t[i]))return!1;return!0}if(m(e)&&m(t)){let i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(let r of i)if(!(r in t)||!T(e[r],t[r]))return!1;return!0}return!1}let O=Symbol.for("better-auth:broadcast-channel");var S=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 R(e="better-auth.message"){return globalThis[O]||(globalThis[O]=new S(e)),globalThis[O]}let _=Symbol.for("better-auth:focus-manager");var w=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 A(){return globalThis[_]||(globalThis[_]=new w),globalThis[_]}let I=Symbol.for("better-auth:online-manager");var L=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[I]||(globalThis[I]=new L),globalThis[I]}let C=()=>Math.floor(Date.now()/1e3),P=[],N=0,D=globalThis.nanostoresGlobal||={epoch:0},F=e=>{let t=[],i={get:()=>(i.lc||i.listen(()=>{})(),i.value),init:e,lc:0,listen:e=>(i.lc=t.push(e),()=>{for(let t=N+4;t<P.length;)P[t]===e?P.splice(t,4):t+=4;let r=t.indexOf(e);~r&&(t.splice(r,1),--i.lc||i.off())}),notify(e,r){D.epoch++;let s=!P.length;for(let s of t)P.push(s,i,e,r);s&&(()=>{for(N=0;N<P.length;N+=4)P[N](P[N+1].value,P[N+2],P[N+3]);P.length=0})()},off(){},set(e){let t=i.value;t!==e&&(i.value=e,i.notify(t))},subscribe(e){let t=i.listen(e);return e(i.value),t},value:e};return i};function j(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function M(e,t){return T(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 x(e){return(...t)=>t.reduce((t,i)=>(function e(t,i,r=".",s){if(!k(i))return e(t,{},r,s);let n=Object.assign({},i);for(let i in t){if("__proto__"===i||"constructor"===i)continue;let o=t[i];null!=o&&(s&&s(n,i,o,r)||(Array.isArray(o)&&Array.isArray(n[i])?n[i]=[...o,...n[i]]:k(o)&&k(n[i])?n[i]=e(o,n[i],(r?`${r}.`:"")+i.toString(),s):n[i]=o))}return n})(t,i,"",e),{})}let q=x();x((e,t,i)=>{if(void 0!==e[t]&&"function"==typeof i)return e[t]=i(e[t]),!0}),x((e,t,i)=>{if(Array.isArray(e[t])&&"function"==typeof i)return e[t]=i(e[t]),!0});var B=Object.defineProperty,G=Object.defineProperties,H=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,W=(e,t,i)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Y=(e,t)=>
1{for(var i in t||(t={}))V.call(t,i)&&W(e,i,t[i]);if(K)for(var i of K(t))$.call(t,i)&&W(e,i,t[i]);return e},Q=(e,t)=>G(e,H(t)),X=class extends Error{constructor(e,t,i){super(t||e.toString(),{cause:i}),this.status=e,this.statusText=t,this.error=i,Error.captureStackTrace(this,this.constructor)}},J=async(e,t)=>{var i,r,s,n,o,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==(i=c.init)?void 0:i.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==(s=c.hooks)?void 0:s.onResponse),u.onSuccess.push(null==(n=c.hooks)?void 0:n.onSuccess),u.onError.push(null==(o=c.hooks)?void 0:o.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={},i=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let r=await i(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if("Basic"===e.auth.type){let[r,s]=await Promise.all([i(e.auth.username),i(e.auth.password)]);if(!r||!s)return t;t.authorization=`Basic ${btoa(`${r}:${s}`)}`}else if("Custom"===e.auth.type){let[r,s]=await Promise.all([i(e.auth.prefix),i(e.auth.value)]);if(!s)return t;t.authorization=`${null!=r?r:""} ${s}`}}return t},et=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ei(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 es(e){return"function"==typeof e}function en(...e){let t={};for(let i of e)if(i)if(i instanceof Headers)i.forEach((e,i)=>{t[i]=e});else for(let[e,r]of Array.isArray(i)?i:Object.entries(i))null!=r&&(t[e]=r);return t}async function eo(e){let t=new Headers(en(null==e?void 0:e.headers,await ee(e)));if(!t.has("content-type")){let i=ei(null==e?void 0:e.body)?"application/json":null;i&&t.set("content-type",i)}return t}var ea=class e extends Error{constructor(t,i){super(i||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function el(e,t){let i=await e["~standard"].validate(t);if(i.issues)throw new ea(i.issues);return i.value}var eu=["get","post","put","patch","delete"],ec=async(e,t)=>{var i,r,s,n,o,a,l,u;let c,{hooks:h,url:d,options:p}=await J(e,t),f=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&es(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&es(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(p),y=new AbortController,v=null!=(i=p.signal)?i:y.signal,E=function(e,t){let{baseURL:i,params:r,query:s}=t||{query:{},params:{},baseURL:""},n=e.startsWith("http")?e.split("/").slice(0,3).join("/"):i||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];eu.includes(t)&&(e=e.replace(`@${t}/`,"/"))}n.endsWith("/")||(n+="/");let[o,a]=e.replace(n,"").split("?"),l=new URLSearchParams(a);for(let[e,t]of Object.entries(s||{})){let i;if(null!=t){if("string"==typeof t)i=t;else if(Array.isArray(t)){for(let i of t)l.append(e,i);continue}else i=JSON.stringify(t);l.set(e,i)}}let u=new Map;if(r)if(Array.isArray(r))for(let[e,t]of o.split("/").filter(e=>e.startsWith(":")).entries()){let i=r[e];u.set(t,String(i))}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t));o=(o=o.split("/").map(e=>(function(e,t){let i,r=e;for(let[e,i]of t)r=r.replace(e,i);if("."===(i=r)||".."===i)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"):"",n.startsWith("http"))?new URL(`${o}${c}`,n):`${n}${o}${c}`}(d,p),g=await eo(p),b=function(e,t){let i,{body:r}=e;return r?ei(r)&&"string"!=typeof r?"application/x-www-form-urlencoded"===((i=t.get("content-type"))?i.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(r).toString():JSON.stringify(r):r:null}(p,g),m=function(e,t){var i;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let r=null==(i=e.split("@")[1])?void 0:i.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"}(d,p),T=Q(Y({},p),{url:E,headers:g,body:b,method:m,signal:v});for(let e of h.onRequest)if(e){let t=await e(T);"object"==typeof t&&null!==t&&Object.assign(T,t)}("pipeTo"in T&&"function"==typeof T.pipeTo||"function"==typeof(null==(r=null==t?void 0:t.body)?void 0:r.pipe))&&!("duplex"in T)&&(T.duplex="half");let{clearTimeout:O}=(!(null==p?void 0:p.signal)&&(null==p?void 0:p.timeout)&&(c=setTimeout(()=>null==y?void 0:y.abort(),null==p?void 0:p.timeout)),{abortTimeout:c,clearTimeout:()=>{c&&clearTimeout(c)}}),S=await f(T.url,T);O();let R={response:S,request:T};for(let e of h.onResponse)if(e){let i=await e(Q(Y({},R),{response:(null==(s=null==t?void 0:t.hookOptions)?void 0:s.cloneResponse)?S.clone():S}));i instanceof Response?S=i:"object"==typeof i&&null!==i&&(S=i.response)}if(S.ok){if("HEAD"===T.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),i=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let r=t.split(";").shift()||"";return et.test(r)?"json":i.has(r)||r.startsWith("text/")?"text":"blob"}(S),i={data:null,response:S,request:T};if("json"===e||"text"===e){let e=await S.text(),t=null!=(n=T.jsonParser)?n:er;i.data=await t(e)}else i.data=await S[e]();for(let e of((null==T?void 0:T.output)&&T.output&&!T.disableValidation&&(i.data=await el(T.output,i.data)),h.onSuccess))e&&await e(Q(Y({},i),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?S.clone():S}));return(null==t?void 0:t.throw)?i.data:{data:i.data,error:null}}let _=null!=(a=null==t?void 0:t.jsonParser)?a:er,w=await S.text(),A=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(w),I=A?await _(w):null,L={response:S,responseText:w,request:T,error:Q(Y({},I),{status:S.status,statusText:S.statusText})};for(let e of h.onError)e&&await e(Q(Y({},L),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?S.clone():S}));if(null==t?void 0:t.retry){let i=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 i.shouldAttemptRetry(r,S)){for(let e of h.onRetry)e&&await e(R);let s=i.getDelay(r);return await new Promise(e=>setTimeout(e,s)),await ec(e,Q(Y({},t),{retryAttempt:r+1}))}}if(null==t?void 0:t.throw)throw new X(S.status,S.statusText,A?I:w);return{data:null,error:Q(Y({},I),{status:S.status,statusText:S.statusText})}};let eh=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,ed=/['\u2019]/g;function ep(e){return(e.replace(ed,"").match(eh)??[]).map(e=>e.toLowerCase()).join("-")}var ef=e.i(52957);let ey=function(){var e;let{pluginPathMethods:t,pluginsActions:i,pluginsAtoms:s,$fetch:n,$store:a,atomListeners:l}=(e=>{var t,i;let s,n,a,l,u,h,E,m="credentials"in Request.prototype,O=function(e,t,i,r){if(e)return d(e,t);if(!1!==r){let e=o.BETTER_AUTH_URL||o.NEXT_PUBLIC_BETTER_AUTH_URL||o.PUBLIC_BETTER_AUTH_URL||o.NUXT_PUBLIC_BETTER_AUTH_URL||o.NUXT_PUBLIC_AUTH_URL||("/"!==o.BASE_URL?o.BASE_URL:void 0);if(e)return d(e,t)}i?.headers.get("x-forwarded-host"),i?.headers.get("x-forwarded-proto");if(i){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(i.url);if(!e)throw new c("Could not get origin from request. Please provide a valid base URL.");return d(e,t)}if("u">typeof window&&window.location)return d(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",S=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],_={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:I,onRequest:L,onResponse:P,...N}=e?.fetchOptions||{},D=(t={baseURL:O,...m?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:i=!1,warnings:r=!1,reviver:s,parseDates:n=!0}=t;if("string"!=typeof e)return e;let o=e.trim(),a=o.toLowerCase();if(a.length<=9&&a in y)return y[a];if(!f.test(o)){if(i)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(p).some(([e,t])=>{let i=t.test(o);return i&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),i})&&i)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(o,(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(n&&"string"==typeof t){let e=function(e){let t=v.exec(e);if(!t)return null;let[,i,r,s,n,o,a,l,u,c,h]=t,d=new Date(Date.UTC(parseInt(i,10),parseInt(r,10)-1,parseInt(s,10),parseInt(n,10),parseInt(o,10),parseInt(a,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(h,10))*("+"===u?-1:1);d.setUTCMinutes(d.getUTCMinutes()+e)}return d instanceof Date&&!isNaN(d.getTime())?d:null}(t);if(e)return e}return s?s(e,t):t})}catch(t){if(i)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...N,plugins:[_,...N.plugins||[],...e?.disableDefaultFetchPlugins?[]:[g],...S]},async function(e,i){let r,s=Q(Y(Y({},t),i),{headers:en(null==t?void 0:t.headers,null==i?void 0:i.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 i,s,n,o;let a=(null==(s=null==(i=r.plugins)?void 0:i.find(t=>{var i;return null!=(i=t.schema)&&!!i.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:s.schema)||r.schema;if(a){let i=e;(null==(n=a.config)?void 0:n.prefix)&&i.startsWith(a.config.prefix)&&(i=i.replace(a.config.prefix,""),a.config.baseURL&&(e=e.replace(a.config.prefix,a.config.baseURL))),(null==(o=a.config)?void 0:o.baseURL)&&i.startsWith(a.config.baseURL)&&(i=i.replace(a.config.baseURL,"")),i.startsWith("/")&&"@"===i.charAt(1)&&(i=i.substring(1));let r=a.schema[i];if(r){let i=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.forEac
1h((t,i)=>{e[i.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[i,r]of Object.entries(t.headers))null!=r&&(e[i.toLowerCase()]=r)}let s=await el(r.headers,e),n={};for(let[e,t]of Object.entries(s))n[e.toLowerCase()]=t;i=n}let s=Q(Y({},t),{method:r.method,output:r.output,headers:i});return(null==t?void 0:t.disableValidation)||(s=Q(Y({},s),{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:s}}}return{url:e,options:t}}}),...(null==i?void 0:i.plugins)||[]]});if(null==t?void 0:t.catchAllError)try{return await ec(e,s)}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,s)}),{$sessionSignal:k,session:x,broadcastSessionUpdate:B}=(n=F(!1),l=F({data:null,error:null,isPending:!0,isRefetching:!1,refetch:a=e=>h(e)}),b(l,({newValue:e,abort:t})=>{M(l.value,e)&&t()},2,e=>{let t=l.set,i=l.setKey;return l.setKey&&(l.setKey=(t,r)=>{let s;if(e({abort:()=>{s=!0},changed:t,newValue:{...l.value,[t]:r}}),!s)return i(t,r)}),l.set=i=>{let r;if(e({abort:()=>{r=!0},newValue:i}),!r)return t(i)},()=>{l.set=t,l.setKey=i}}),u=e=>{if(s!==e)return;let t=l.get();s=void 0,(t.isPending||t.isRefetching)&&l.set({...t,isPending:!1,isRefetching:!1,refetch:a})},h=async e=>{s?.abort();let t=new AbortController;s=t;let i=l.get();l.set({...i,isPending:null===i.data,isRefetching:!0,error:null,refetch:a});try{var r;let i=await D("/get-session",{method:"GET",query:e?.query,signal:t.signal});if(t.signal.aborted)return void u(t);let{data:s,error:n}=j(i);if(s?.needsRefresh)try{let e=await D("/get-session",{method:"POST",signal:t.signal});if(t.signal.aborted)return void u(t);({data:s,error:n}=j(e))}catch{if(t.signal.aborted)return void u(t)}if(n){let e=l.get(),t=n?.status===401;l.set({data:t?null:e.data,error:n,isPending:!1,isRefetching:!1,refetch:a});return}let o=(r=s)&&(null!==r.session||null!==r.user)?r:null,c=l.get(),h=null!=c.data&&null!=o&&T(c.data,o)?c.data:o;l.set({data:h,error:null,isPending:!1,isRefetching:!1,refetch:a})}catch(i){if(t.signal.aborted)return void u(t);let e=l.get();l.set({data:e.data,error:i,isPending:!1,isRefetching:!1,refetch:a})}},E=()=>{},i=()=>{let t;"u"<typeof window||(t=setTimeout(()=>{h()},0));let i=function(e){let{fetchSession:t,shouldPollSession:i=()=>!0,sessionSignal:r,options:s={}}=e,n=s.sessionOptions?.refetchInterval??0,o=s.sessionOptions?.refetchOnWindowFocus??!0,a=s.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=C(),t();return}if(e?.event==="visibilitychange"){if(C()-l.lastSessionRequest<5)return;l.lastSessionRequest=C(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,n&&n>0&&(l.pollInterval=setInterval(()=>{i()&&u({event:"poll"})},1e3*n)),l.unsubscribeBroadcast=R().subscribe(()=>{u({event:"storage"})}),o&&(l.unsubscribeFocus=A().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=U().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=r.listen(()=>{t()}),l.cleanupBroadcastSetup=R().setup(),l.cleanupFocusSetup=A().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=>{R().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:h,shouldPollSession:()=>null!=l.get().data,sessionSignal:n,options:e});return i.init(),E=i.broadcastSessionUpdate,()=>{t&&clearTimeout(t);let e=s;e?.abort(),e&&u(e),i.cleanup()}},b(l,e=>{let t=i(e);t&&l.events[6].push(t)},5,e=>{let t=l.listen;l.listen=(...i)=>(l.lc||l.active||(l.active=!0,e()),t(...i));let i=l.off;return l.events[6]=[],l.off=()=>{i(),setTimeout(()=>{if(l.active&&!l.lc){for(let e of(l.active=!1,l.events[6]))e();l.events[6]=[]}},1e3)},()=>{l.listen=t,l.off=i}}),{session:l,$sessionSignal:n,broadcastSessionUpdate:e=>E(e)}),G=e?.plugins||[],H={},K={$sessionSignal:k,session:x}
1,V={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},$=[{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?B("signout"):("/update-user"===e||"/update-session"===e)&&B("updateUser")}}];for(let e of G)e.getAtoms&&Object.assign(K,e.getAtoms?.(D)),e.pathMethods&&Object.assign(V,e.pathMethods),e.atomListeners&&$.push(...e.atomListeners);let W={notify:e=>{K[e].set(!K[e].get())},listen:(e,t)=>{K[e].subscribe(t)},atoms:K};for(let t of G)t.getActions&&(H=q(t.getActions?.(D,W,e)??{},H));return{get baseURL(){return O},pluginsActions:H,pluginsAtoms:K,pluginPathMethods:V,atomListeners:$,$fetch:D,$store:W}})(void 0),u={};for(let[e,t]of Object.entries(s))u[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let i=(0,ef.useRef)(e.get()),{keys:r,deps:s=[e,r]}=t,n=(0,ef.useCallback)(t=>{let s=e=>{i.current!==e&&(i.current=e,t())};if(s(e.value),r?.length){let t;return t=new Set(r),e.listen((e,i,n)=>{(void 0===n?r.some(t=>e[t]!==i[t]):t.has(n)||t.has(n.split(/\.|\[/)[0]))&&s(e,i,n)})}return e.listen(s)},s),o=()=>i.current;return(0,ef.useSyncExternalStore)(n,o,o)})(t);return e={...i,...u,$fetch:n,$store:a},function i(r=[]){return new Proxy(function(){},{get(t,s){var n;if("string"!=typeof s||"then"===s||"catch"===s||"finally"===s)return;let o=[...r,s],a=e;for(let e of o)if(a&&"object"==typeof a&&e in a)a=a[e];else{a=void 0;break}return"function"==typeof a?a:"object"==typeof(n=a)&&null!==n&&"get"in n&&"function"==typeof n.get&&"lc"in n&&"number"==typeof n.lc?a:i(o)},apply:async(e,i,o)=>{let a="/"+r.map(ep).join("/"),u=o[0]||{},c=o[1]||{},{query:h,fetchOptions:d,...p}=u,f={...c,...d},y=function(e,t,i){let r=t[e],{fetchOptions:s,query:n,...o}=i||{};return r||(s?.method?s.method:o&&Object.keys(o).length>0?"POST":"GET")}(a,t,u);return await n(a,{...f,body:"GET"===y?void 0:{...p,...f?.body||{}},query:h||f?.query,method:y,async onSuccess(e){if(await f?.onSuccess?.(e),!l||f.disableSignal)return;let t=l.filter(e=>e.matcher(a));if(!t.length)return;let i=new Set;for(let e of t){let t=s[e.signal];if(!t)return;if(i.has(e.signal))continue;i.add(e.signal);let r=t.get();setTimeout(()=>{t.set(!r)},10),e.callback?.(a)}}})}})}()}(),{signIn:ev,signUp:eE,signOut:eg,useSession:eb}=ey;e.s(["authClient",0,ey,"useSession",0,eb],69296)},48313,e=>{"use strict";var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i=new class{#t=t;#i=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}};e.s(["systemSetTimeoutZero",0,function(e){setTimeout(e,0)},"timeoutManager",0,i])},24098,e=>{"use strict";var t=e.i(48313),i="u"<typeof window||"Deno"in globalThis;function r(e,t){return(t?.queryKeyHashFn||s)(e)}function s(e){return JSON.stringify(e,(e,t)=>l(t)?Object.keys(t).sort().reduce((e,i)=>(e[i]=t[i],e),{}):t)}function n(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(i=>n(e[i],t[i]))}var o=Object.prototype.hasOwnProperty;function a(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function l(e){if(!u(e))return!1;let t=e.constructor;if(void 0===t)return!0;let i=t.prototype;return!!u(i)&&!!i.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function u(e){return"[object Object]"===Object.prototype.toString.call(e)}var c=Symbol();e.s(["addConsumeAwareSignal",0,function(e,t,i){let r,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),s||(s=!0,r.aborted?i():r.addEventListener("abort",i,{once:!0})),r)}),e},"addToEnd",0,function(e,t,i=0){let r=[...e,t];return i&&r.length>i?r.slice(1):r},"addToStart",0,function(e,t,i=0){let r=[t,...e];return i&&r.length>i?r.slice(0,-1):r},"ensureQueryFn",0,function(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==c?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))},"functionalUpdate",0,function(e,t){return"function"==typeof e?e(t):e},"hashKey",0,s,"hashQueryKeyByOptions",0,r,"isServer",0,i,"isValidTimeout",0,function(e){return"number"==typeof e&&e>=0&&e!==1/0},"matchMutation",0,function(e,t){let{exact:i,status:r,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(i){if(s(t.options.mutationKey)!==s(a))return!1}
1else if(!n(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&(!o||!!o(t))},"matchQuery",0,function(e,t){let{type:i="all",exact:s,fetchStatus:o,predicate:a,queryKey:l,stale:u}=e;if(l){if(s){if(t.queryHash!==r(l,t.options))return!1}else if(!n(t.queryKey,l))return!1}if("all"!==i){let e=t.isActive();if("active"===i&&!e||"inactive"===i&&e)return!1}return("boolean"!=typeof u||t.isStale()===u)&&(!o||o===t.state.fetchStatus)&&(!a||!!a(t))},"noop",0,function(){},"partialMatchKey",0,n,"replaceData",0,function(e,t,i){return"function"==typeof i.structuralSharing?i.structuralSharing(e,t):!1!==i.structuralSharing?function e(t,i,r=0){if(t===i)return t;if(r>500)return i;let s=a(t)&&a(i);if(!s&&!(l(t)&&l(i)))return i;let n=(s?t:Object.keys(t)).length,u=s?i:Object.keys(i),c=u.length,h=s?Array(c):{},d=0;for(let a=0;a<c;a++){let l=s?a:u[a],c=t[l],p=i[l];if(c===p){h[l]=c,(s?a<n:o.call(t,l))&&d++;continue}if(null===c||null===p||"object"!=typeof c||"object"!=typeof p){h[l]=p;continue}let f=e(c,p,r+1);h[l]=f,f===c&&d++}return n===c&&d===n?t:h}(e,t):t},"resolveQueryBoolean",0,function(e,t){return"function"==typeof e?e(t):e},"resolveStaleTime",0,function(e,t){return"function"==typeof e?e(t):e},"shallowEqualObjects",0,function(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(e[i]!==t[i])return!1;return!0},"shouldThrowError",0,function(e,t){return"function"==typeof e?e(...t):!!e},"skipToken",0,c,"sleep",0,function(e){return new Promise(i=>{t.timeoutManager.setTimeout(i,e)})},"timeUntilStale",0,function(e,t){return Math.max(e+(t||0)-Date.now(),0)}])},51185,e=>{"use strict";let t,i,r,s,n,o;var a=e.i(48313).systemSetTimeoutZero,l=(t=[],i=0,r=e=>{e()},s=e=>{e()},n=a,{batch:e=>{let o;i++;try{o=e()}finally{let e;--i||(e=t,t=[],e.length&&n(()=>{s(()=>{e.forEach(e=>{r(e)})})}))}return o},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o=e=>{i?t.push(e):n(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}});e.s(["notifyManager",0,l])},31884,3215,98689,92851,e=>{"use strict";var t=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(){}};e.s(["Subscribable",0,t],3215);var i=new class extends t{#r;#s;#n;constructor(){super(),this.#n=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#s||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#s?.(),this.#s=void 0)}setEventListener(e){this.#n=e,this.#s?.(),this.#s=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",0,i],31884);var r=new class extends t{#o=!0;#s;#n;constructor(){super(),this.#n=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#s||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#s?.(),this.#s=void 0)}setEventListener(e){this.#n=e,this.#s?.(),this.#s=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};e.s(["onlineManager",0,r],98689),e.i(24098),e.s(["pendingThenable",0,function(){let e,t,i=new Promise((i,r)=>{e=i,t=r});function r(e){Object.assign(i,e),delete i.resolve,delete i.reject}return i.status="pending",i.catch(()=>{}),i.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},i.reject=e=>{r({status:"rejected",reason:e}),t(e)},i}],92851)},66239,e=>{"use strict";let t;var i=e.i(24098),r=(t=()=>i.isServer,{isServer:()=>t(),setIsServer(e){t=e}});e.s(["environmentManager",0,r])},52094,e=>{"use strict";var t=e.i(31884),i=e.i(98689),r=e.i(92851),s=e.i(66239),n=e.i(24098);function o(e){return Math.min(1e3*2**e,3e4)}function a(e){return(e??"online")!=="online"||i.onlineManager.isOnline()}
1var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};e.s(["CancelledError",0,l,"canFetch",0,a,"createRetryer",0,function(e){let u,c=!1,h=0,d=(0,r.pendingThenable)(),p=()=>t.focusManager.isFocused()&&("always"===e.networkMode||i.onlineManager.isOnline())&&e.canRun(),f=()=>a(e.networkMode)&&e.canRun(),y=e=>{"pending"===d.status&&(u?.(),d.resolve(e))},v=e=>{"pending"===d.status&&(u?.(),d.reject(e))},E=()=>new Promise(t=>{u=e=>{("pending"!==d.status||p())&&t(e)},e.onPause?.()}).then(()=>{u=void 0,"pending"===d.status&&e.onContinue?.()}),g=()=>{let t;if("pending"!==d.status)return;let i=0===h?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(y).catch(t=>{if("pending"!==d.status)return;let i=e.retry??3*!s.environmentManager.isServer(),r=e.retryDelay??o,a="function"==typeof r?r(h,t):r,l=!0===i||"number"==typeof i&&h<i||"function"==typeof i&&i(h,t);c||!l?v(t):(h++,e.onFail?.(h,t),(0,n.sleep)(a).then(()=>p()?void 0:E()).then(()=>{c?v(t):g()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let i=new l(t);v(i),e.onCancel?.(i)}},continue:()=>(u?.(),d),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:f,start:()=>(f()?g():E().then(g),d)}}])},63807,e=>{"use strict";var t=e.i(48313),i=e.i(66239),r=e.i(24098),s=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.isValidTimeout)(this.gcTime)&&(this.#a=t.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(i.environmentManager.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#a&&(t.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",0,s])},22346,e=>{"use strict";e.i(90242);var t=e.i(24098),i=e.i(51185),r=e.i(52094),s=e.i(63807);function n(e,{pages:t,pageParams:i}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,i[r],i):void 0}var o=class extends s.Removable{#l;#u;#c;#h;#d;#p;#f;#y;constructor(e){super(),this.#y=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#d=e.client,this.#h=this.#d.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#u=u(this.options),this.state=e.state??this.#u,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#l}get promise(){return this.#p?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#l=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=u(this.options);void 0!==e.data&&(this.setState(l(e.data,e.dataUpdatedAt)),this.#u=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#h.remove(this)}setData(e,i){let r=(0,t.replaceData)(this.state.data,e,this.options);return this.#v({data:r,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),r}setState(e){this.#v({type:"setState",state:e})}cancel(e){let i=this.#p?.promise;return this.#p?.cancel(e),i?i.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#u}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveQueryBoolean)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#p?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#p?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#h.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#p&&(this.#y||this.#E()?this.#p.cancel({revert:!0}):this.#p.cancelRetry()),this.scheduleGc()),this.#h.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#E(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#v({type:"invalidate"})}async fetch(e,i){var s;let o;if("idle"!==this.state.fetchStatus&&this.#p?.status()!=="rejected"){if(void 0!==this.state.data&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#p)return this.#p.continueRetry(),this.#p.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let a=new AbortController,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#y=!0,a.signal)}
1)},u=()=>{let e,r=(0,t.ensureQueryFn)(this.options,i),s=(l(e={client:this.#d,queryKey:this.queryKey,meta:this.meta}),e);return(this.#y=!1,this.options.persister)?this.options.persister(r,s,this):r(s)},c=(l(o={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#d,state:this.state,fetchFn:u}),o),h="infinite"===this.#l?(s=this.options.pages,{onFetch:(e,i)=>{let r=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],l=e.state.data?.pageParams||[],u={pages:[],pageParams:[]},c=0,h=async()=>{let i=!1,h=(0,t.ensureQueryFn)(e.options,e.fetchOptions),d=async(r,s,n)=>{let o;if(i)return Promise.reject(e.signal.reason);if(null==s&&r.pages.length)return Promise.resolve(r);let a=(o={client:e.client,queryKey:e.queryKey,pageParam:s,direction:n?"backward":"forward",meta:e.options.meta},(0,t.addConsumeAwareSignal)(o,()=>e.signal,()=>i=!0),o),l=await h(a),{maxPages:u}=e.options,c=n?t.addToStart:t.addToEnd;return{pages:c(r.pages,l,u),pageParams:c(r.pageParams,s,u)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},i=(e?function(e,{pages:t,pageParams:i}){return t.length>0?e.getPreviousPageParam?.(t[0],t,i[0],i):void 0}:n)(r,t);u=await d(t,i,e)}else{let e=s??a.length;do{let e=0===c?l[0]??r.initialPageParam:n(r,u);if(c>0&&null==e)break;u=await d(u,e),c++}while(c<e)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},i):e.fetchFn=h}}):this.options.behavior;h?.onFetch(c,this),this.#c=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#v({type:"fetch",meta:c.fetchOptions?.meta}),this.#p=(0,r.createRetryer)({initialPromise:i?.initialPromise,fn:c.fetchFn,onCancel:e=>{e instanceof r.CancelledError&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),a.abort()},onFail:(e,t)=>{this.#v({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#v({type:"pause"})},onContinue:()=>{this.#v({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{let e=await this.#p.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#h.config.onSuccess?.(e,this),this.#h.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof r.CancelledError){if(e.silent)return this.#p.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#v({type:"error",error:e}),this.#h.config.onError?.(e,this),this.#h.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#v(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...a(t.data,this.options),fetchMeta:e.meta??null};case"success":let i={...t,...l(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?i:void 0,i;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),i.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#h.notify({query:this,type:"updated",action:e})})}};function a(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,r.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function l(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,i=void 0!==t,r=i?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?r??Date.now():0,error:null,errorUpdate
1Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}e.s(["Query",0,o,"fetchState",0,a],22346)},24189,e=>{"use strict";var t=e.i(51185),i=e.i(63807),r=e.i(52094),s=class extends i.Removable{#d;#g;#b;#p;constructor(e){super(),this.#d=e.client,this.mutationId=e.mutationId,this.#b=e.mutationCache,this.#g=[],this.state=e.state||n(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#g.includes(e)||(this.#g.push(e),this.clearGcTimeout(),this.#b.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#g=this.#g.filter(t=>t!==e),this.scheduleGc(),this.#b.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#g.length||("pending"===this.state.status?this.scheduleGc():this.#b.remove(this))}continue(){return this.#p?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#v({type:"continue"})},i={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#p=(0,r.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#v({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#v({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#b.canRun(this)});let s="pending"===this.state.status,n=!this.#p.canStart();try{if(s)t();else{this.#v({type:"pending",variables:e,isPaused:n}),this.#b.config.onMutate&&await this.#b.config.onMutate(e,this,i);let t=await this.options.onMutate?.(e,i);t!==this.state.context&&this.#v({type:"pending",context:t,variables:e,isPaused:n})}let r=await this.#p.start();return await this.#b.config.onSuccess?.(r,e,this.state.context,this,i),await this.options.onSuccess?.(r,e,this.state.context,i),await this.#b.config.onSettled?.(r,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(r,null,e,this.state.context,i),this.#v({type:"success",data:r}),r}catch(t){try{await this.#b.config.onError?.(t,e,this.state.context,this,i)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,i)}catch(e){Promise.reject(e)}try{await this.#b.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,i)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,i)}catch(e){Promise.reject(e)}throw this.#v({type:"error",error:t}),t}finally{this.#b.runNext(this)}}#v(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#g.forEach(t=>{t.onMutationUpdate(e)}),this.#b.notify({mutation:this,type:"updated",action:e})})}};function n(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}e.s(["Mutation",0,s,"getDefaultState",0,n])},58931,e=>{"use strict";var t=e.i(52957),i=e.i(85177),r=t.createContext(void 0);e.s(["QueryClientProvider",0,({client:e,children:s})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(r.Provider,{value:e,children:s})),"useQueryClient",0,e=>{let i=t.useContext(r);if(e)return e;if(!i)throw Error("No QueryClient set, use QueryClientProvider to set one");return i}])}]);
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.