1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5c35fa48-1537-41f8-9f7a-11b00d60724f",e._sentryDebugIdIdentifier="sentry-dbid-5c35fa48-1537-41f8-9f7a-11b00d60724f")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2069],{15006:(e,t,r)=>{r.d(t,{OS:()=>i,Rc:()=>o});let n=(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],i=n.indexOf(t);n.splice(i,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}),i=(e,t)=>n(e,t,2,t=>{let r=e.set,n=e.setKey;return e.setKey&&(e.setKey=(r,i)=>{let o;if(t({abort:()=>{o=!0},changed:r,newValue:{...e.value,[r]:i}}),!o)return n(r,i)}),e.set=e=>{let n;if(t({abort:()=>{n=!0},newValue:e}),!n)return r(e)},()=>{e.set=r,e.setKey=n}}),o=(e,t)=>n(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(()=>{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}})},30767:(e,t,r)=>{r.d(t,{A:()=>n});let n=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(r=0;r<t.length;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n);else for(r in t)t[r]&&(i&&(i+=" "),i+=r);return i}(e))&&(n&&(n+=" "),n+=t);return n}},33971:(e,t,r)=>{r.d(t,{c:()=>o});var n=r(55510);function i(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let o=i(0,n.c3);i(0,n.kc)},36332:(e,t,r)=>{r.d(t,{KM:()=>O});let n=Object.fromEntries(Object.entries({CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey",PREVIOUSLY_REGISTERED:"Previously registered",REGISTRATION_CANCELLED:"Registration cancelled",AUTH_CANCELLED:"Auth cancelled",UNKNOWN_ERROR:"Unknown error",SESSION_REQUIRED:"Passkey registration requires an authenticated session",RESOLVE_USER_REQUIRED:"Passkey registration requires either an authenticated session or a resolveUser callback when requireSession is false",RESOLVED_USER_INVALID:"Resolved user is invalid"}).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]));function i(e){let t=new Uint8Array(e),r="";for(let e of t)r+=String.fromCharCode(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function o(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4,n=atob(t.padEnd(t.length+r,"=")),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let e=0;e<n.length;e++)o[e]=n.charCodeAt(e);return i}function s(){return a.stubThis(globalThis?.PublicKeyCredential!==void 0&&"function"==typeof globalThis.PublicKeyCredential)}let a={stubThis:e=>e};function l(e){let{id:t}=e;return{...e,id:o(t),transports:e.transports}}function u(e){return"localhost"===e||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}class c extends Error{constructor({message:e,code:t,cause:r,name:n}){super(e,{cause:r}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=n??r.name,this.code=t}}class d{createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}}let f=new d,p=["cross-platform","platform"];function h(e){if(e&&!(0>p.indexOf(e)))return e}async function E(e){let t,r,n,a,d;!e.optionsJSON&&e.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:p,useAutoRegister:E=!1}=e;if(!s())throw Error("WebAuthn is not supported in this browser");let R={...p,challenge:o(p.challenge),user:{...p.user,id:o(p.user.id)},excludeCredentials:p.excludeCredentials?.map(l)},y={};E&&(y.mediation="conditional"),y.publicKey=R,y.signal=f.createNewAbortSignal();try{t=await navigator.credentials.create(y)}catch(e){throw function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new c({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(r.authenticatorSelection?.requireResidentKey===!0)return new c({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&r.authenticatorSelection?.userVerification==="required")return new c({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if(r.authenticatorSelection?.userVerification==="required")return new c({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new c({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new c({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new c(0===r.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=globalThis.location.hostname;if(!u(t))return new c({message:`${globalThis.location.hostname}
1 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rp.id!==t)return new c({message:`The RP ID "${r.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(r.user.id.byteLength<1||r.user.id.byteLength>64)return new c({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new c({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}({error:e,options:y})}if(!t)throw Error("Registration was not completed");let{id:b,rawId:T,response:w,type:m}=t;if("function"==typeof w.getTransports&&(n=w.getTransports()),"function"==typeof w.getPublicKeyAlgorithm)try{a=w.getPublicKeyAlgorithm()}catch(e){g("getPublicKeyAlgorithm()",e)}if("function"==typeof w.getPublicKey)try{let e=w.getPublicKey();null!==e&&(d=i(e))}catch(e){g("getPublicKey()",e)}if("function"==typeof w.getAuthenticatorData)try{r=i(w.getAuthenticatorData())}catch(e){g("getAuthenticatorData()",e)}return{id:b,rawId:i(T),response:{attestationObject:i(w.attestationObject),clientDataJSON:i(w.clientDataJSON),transports:n,publicKeyAlgorithm:a,publicKey:d,authenticatorData:r},type:m,clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:h(t.authenticatorAttachment)}}function g(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them. 2`,t)}let R={stubThis:e=>e};async function y(e){let t,r,n;!e.optionsJSON&&e.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:a,useBrowserAutofill:d=!1,verifyBrowserAutofillInput:p=!0}=e;if(!s())throw Error("WebAuthn is not supported in this browser");a.allowCredentials?.length!==0&&(t=a.allowCredentials?.map(l));let E={...a,challenge:o(a.challenge),allowCredentials:t},g={};if(d){if(!await function(){if(!s())return R.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?R.stubThis(new Promise(e=>e(!1))):R.stubThis(e.isConditionalMediationAvailable())}())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&p)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');g.mediation="conditional",E.allowCredentials=[]}g.publicKey=E,g.signal=f.createNewAbortSignal();try{r=await navigator.credentials.get(g)}catch(e){throw function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new c({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new c({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=globalThis.location.hostname;if(!u(t))return new c({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new c({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new c({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}({error:e,options:g})}if(!r)throw Error("Authentication was not completed");let{id:y,rawId:b,response:T,type:w}=r;return T.userHandle&&(n=i(T.userHandle)),{id:y,rawId:i(b),response:{authenticatorData:i(T.authenticatorData),clientDataJSON:i(T.clientDataJSON),signature:i(T.signature),userHandle:n},type:w,clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:h(r.authenticatorAttachment)}}var b=r(55742),T=r(93317),w=r(15006);let m=()=>"undefined"==typeof window;function v(e,t){return(0,b.r)(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}let O=()=>{let e=(0,T.eU)();
2return{id:"passkey",version:"1.6.23",$InferServerPlugin:{},getActions:(t,r)=>((e,{$listPasskeys:t,$store:r})=>({signIn:{passkey:async(i,o)=>{let s,a=await e("/passkey/generate-authenticate-options",{method:"GET",throw:!1});if(!a.data)return a;let l=a.data.extensions||i?.extensions?{...a.data.extensions||{},...i?.extensions||{}}:void 0;try{s=await y({optionsJSON:{...a.data,extensions:l},useBrowserAutofill:i?.autoFill})}catch(e){return{data:null,error:{code:e instanceof c?e.code:"AUTH_CANCELLED",message:n.AUTH_CANCELLED.message,status:400,statusText:"BAD_REQUEST"}}}try{let{clientExtensionResults:n,...a}=s,l=await e("/passkey/verify-authentication",{body:{response:a},...i?.fetchOptions,...o,method:"POST",throw:!1});if(t.set(Math.random()),r.notify("$sessionSignal"),i?.returnWebAuthnResponse)return{...l,webauthn:{response:s,clientExtensionResults:n}};return l}catch(e){return console.error("[Better Auth] Error verifying passkey",e),{data:null,error:{code:"AUTH_CANCELLED",message:n.AUTH_CANCELLED.message,status:400,statusText:"BAD_REQUEST"}}}}},passkey:{addPasskey:async(r,i)=>{let o=await e("/passkey/generate-register-options",{method:"GET",query:{...r?.authenticatorAttachment&&{authenticatorAttachment:r.authenticatorAttachment},...r?.name&&{name:r.name},...r?.context&&{context:r.context}},throw:!1});if(!o.data)return o;try{let n=o.data.extensions||r?.extensions?{...o.data.extensions||{},...r?.extensions||{}}:void 0,s=await E({optionsJSON:{...o.data,extensions:n},useAutoRegister:r?.useAutoRegister}),{clientExtensionResults:a,...l}=s,u=await e("/passkey/verify-registration",{...r?.fetchOptions,...i,body:{response:l,name:r?.name},method:"POST",throw:!1});if(!u.data)return u;if(t.set(Math.random()),r?.returnWebAuthnResponse)return{...u,webauthn:{response:s,clientExtensionResults:a}};return u}catch(e){if(e instanceof c){if("ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED"===e.code)return{data:null,error:{code:e.code,message:n.PREVIOUSLY_REGISTERED.message,status:400,statusText:"BAD_REQUEST"}};if("ERROR_CEREMONY_ABORTED"===e.code)return{data:null,error:{code:e.code,message:n.REGISTRATION_CANCELLED.message,status:400,statusText:"BAD_REQUEST"}};return{data:null,error:{code:e.code,message:e.message,status:400,statusText:"BAD_REQUEST"}}}return{data:null,error:{code:"UNKNOWN_ERROR",message:e instanceof Error?e.message:n.UNKNOWN_ERROR.message,status:500,statusText:"INTERNAL_SERVER_ERROR"}}}}},$Infer:{}}))(t,{$listPasskeys:e,$store:r}),getAtoms:t=>({listPasskeys:((e,t,r,n)=>{let i=(0,T.eU)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>o(e)});(0,b.K)(i,v);let o=async e=>new Promise(o=>{let s="function"==typeof n?n({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):n;r(t,{...s,query:{...s?.query,...e?.query},async onSuccess(e){let t=i.get(),r=null!=t.data&&null!=e.data&&(0,b.r)(t.data,e.data)?t.data:e.data;i.set({data:r,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await s?.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 o=401===e.error.status;i.set({error:e.error,data:o?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await s?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await s?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{o(void 0)})});e=Array.isArray(e)?e:[e];let s=!1,a=[];for(let t of e){let e=t.subscribe(async()=>{m()||(s?await o():(0,w.Rc)(i,()=>{let e=setTimeout(async()=>{s||(s=!0,await o())},0);return()=>{for(let e of a)e();clearTimeout(e)}}))});a.push(e)}return i})(e,"/passkey/list-user-passkeys",t,{method:"GET"}),$listPasskeys:e}),pathMethods:{"/passkey/register":"POST","/passkey/authenticate":"POST"},atomListeners:[{matcher:e=>"/passkey/verify-registration"===e||"/passkey/delete-passkey"===e||"/passkey/update-passkey"===e||"/sign-out"===e,signal:"$listPasskeys"},{matcher:e=>"/passkey/verify-authentication"===e,signal:"$sessionSignal"}],$ERROR_CODES:n}}},45204:(e,t,r)=>{r.d(t,{M:()=>ed});var n=r(40459);let i=Object.create(null),o=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?i:globalThis),s=new Proxy(i,{get:(e,t)=>o()[t]??i[t],has:(e,t)=>t in o()||t in i,set:(e,t,r)=>(o(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=o(!0);return delete r[t],!0},ownKeys:()=>Object.keys(o(!0))});function a(e,t){return void 0!==n&&n.env?n.env[e]??t:"undefined"!=typeof Deno?Deno.env.get(e)??t:"undefined"!=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")}
2,get PACKAGE_VERSION(){return a("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return a("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});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,r={},n="number"==typeof e?e:l[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"),function(e,t){class r extends e{#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}()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let 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}}Object.defineProperty(r.prototype,"constructor",{get:()=>t,enumerable:!1,configurable:!0})}(u,Error);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 r=d(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}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*:/},h=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,E={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},g=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,R=["javascript:","data:","vbscript:"],y={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!R.includes(t.protocol)}(e.data.url)&&"undefined"!=typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}};var b=r(55742);let T=Symbol.for("better-auth:broadcast-channel");var w=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("undefined"!=typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");
2t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function m(e="better-auth.message"){return globalThis[T]||(globalThis[T]=new w(e)),globalThis[T]}let v=Symbol.for("better-auth:focus-manager");var O=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("undefined"==typeof window||"undefined"==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[v]||(globalThis[v]=new O),globalThis[v]}let _=Symbol.for("better-auth:online-manager");var S=class{listeners=new Set;isOnline="undefined"==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("undefined"==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 I(){return globalThis[_]||(globalThis[_]=new S),globalThis[_]}let U=()=>Math.floor(Date.now()/1e3);var N=r(93317),L=r(15006);function P(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function D(e,t){return(0,b.r)(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function C(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 k(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,n=".",i){if(!C(r))return e(t,{},n,i);let o={...r};for(let r of Object.keys(t)){if("__proto__"===r||"constructor"===r)continue;let s=t[r];null!=s&&(i&&i(o,r,s,n)||(Array.isArray(s)&&Array.isArray(o[r])?o[r]=[...s,...o[r]]:C(s)&&C(o[r])?o[r]=e(s,o[r],(n?`${n}.`:"")+r.toString(),i):o[r]=s))}return o})(t,r,"",e),{})}let x=k();k((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),k((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0});var j=Object.defineProperty,B=Object.defineProperties,H=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,$=(e,t,r)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t)=>{for(var r in t||(t={}))F.call(t,r)&&$(e,r,t[r]);if(M)for(var r of M(t))q.call(t,r)&&$(e,r,t[r]);return e},K=(e,t)=>B(e,H(t)),V=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)}},Y=async(e,t)=>{var r,n,i,o,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 n=await (null==(r=c.init)?void 0:r.call(c,e.toString(),t));l=n.options||l,e=n.url}u.onRequest.push(null==(n=c.hooks)?void 0:n.onRequest),u.onResponse.push(null==(i=c.hooks)?void 0:i.onResponse),u.onSuccess.push(null==(o=c.hooks)?void 0:o.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}},W=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}},J=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)}},Q=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;
2if(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,i]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!i)return t;t.authorization=`Basic ${btoa(`${n}:${i}`)}`}else if("Custom"===e.auth.type){let[n,i]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!i)return t;t.authorization=`${null!=n?n:""} ${i}`}}return t},z=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function X(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 Z(e){try{return JSON.parse(e)}catch(t){return e}}function ee(e){return"function"==typeof e}function et(...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 er(e){let t=new Headers(et(null==e?void 0:e.headers,await Q(e)));if(!t.has("content-type")){let r=X(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var en=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function ei(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new en(r.issues);return r.value}var eo=["get","post","put","patch","delete"],es=async(e,t)=>{var r,n,i,o,s,a,l,u;let{hooks:c,url:d,options:f}=await Y(e,t),p=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&ee(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&ee(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(f),h=new AbortController,E=null!=(r=f.signal)?r:h.signal,g=function(e,t){let{baseURL:r,params:n,query:i}=t||{query:{},params:{},baseURL:""},o=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];eo.includes(t)&&(e=e.replace(`@${t}/`,"/"))}o.endsWith("/")||(o+="/");let[s,a]=e.replace(o,"").split("?"),l=new URLSearchParams(a);for(let[e,t]of Object.entries(i||{})){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 s.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));s=(s=s.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 c=l.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",o.startsWith("http"))?new URL(`${s}${c}`,o):`${o}${s}${c}`}(d,f),R=await er(f),y=function(e,t){let{body:r}=e;return r?X(r)&&"string"!=typeof r?"application/x-www-form-urlencoded"===function(e){let t=e.get("content-type");return t?t.split(";")[0].trim().toLowerCase():null}(t)?new URLSearchParams(r).toString():JSON.stringify(r):r:null}(f,R),b=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 eo.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(d,f),T=K(G({},f),{url:g,headers:R,body:y,method:b,signal:E});for(let e of c.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==(n=null==t?void 0:t.body)?void 0:n.pipe))&&!("duplex"in T)&&(T.duplex="half");let{clearTimeout:w}=function(e,t){let r;return!(null==e?void 0:e.signal)&&(null==e?void 0:e.timeout)&&(r=setTimeout(()=>null==t?void 0:t.abort(),null==e?void 0:e.timeout)),{abortTimeout:r,clearTimeout:()=>{r&&clearTimeout(r)}}}(f,h),m=await p(T.url,T);w();let v={response:m,request:T};for(let e of c.onResponse)if(e){let r=await e(K(G({},v),{response:(null==(i=null==t?void 0:t.hookOptions)?void 0:i.cloneResponse)?m.clone():m}));r instanceof Response?m=r:"object"==typeof r&&null!==r&&(m=r.response)}if(m.ok){if("HEAD"===T.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 z.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(m),r={data:null,response:m,request:T};if("json"===e||"text"===e){let e=await m.text(),t=null!=(o=T.jsonParser)?o:Z;r.data=await t(e)}else r.data=await m[e]();for(let e of((null==T?void 0:T.output)&&T.output&&!T.disableValidation&&(r.data=await ei(T.output,r.data)),c.onSuccess))e&&await e(K(G({},r),{response:(null==(s=null==t?void 0:t.hookOptions)?void 0:s.cloneResponse)?m.clone():m}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let O=null!=(a=null==t?void 0:t.jsonParser)?a:Z,A=await m.text(),_=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(A),S=_?await O(A):null,I={response:m,responseText:A,request:T,error:K(G({},S),{status:m.status,statusText:m.statusText})};for(let e of c.onError)e&&await e(K(G({},I),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?m.clone():m}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new W({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new W(e);
2case"exponential":return new J(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,m)){for(let e of c.onRetry)e&&await e(v);let i=r.getDelay(n);return await new Promise(e=>setTimeout(e,i)),await es(e,K(G({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new V(m.status,m.statusText,_?S:A);return{data:null,error:K(G({},S),{status:m.status,statusText:m.statusText})}},ea=r(40459);let el=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,eu=/['\u2019]/g;function ec(e){return(e.replace(eu,"").match(el)??[]).map(e=>e.toLowerCase()).join("-")}function ed(e){var t;let{pluginPathMethods:r,pluginsActions:n,pluginsAtoms:i,$fetch:o,atomListeners:a,$store:l}=((e,t)=>{let r,n="credentials"in Request.prototype,i=function(e,t,r,n,i){if(e)return f(e,t);if(!1!==n){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)}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 c("Could not get origin from request. Please provide a valid base URL.");return f(e,t)}if("undefined"!=typeof window&&window.location)return f(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,t)??(e=>{if(void 0!==ea){if(ea.env.NEXT_PUBLIC_AUTH_URL)return ea.env.NEXT_PUBLIC_AUTH_URL;if("undefined"==typeof window){if(ea.env.NEXTAUTH_URL)try{return ea.env.NEXTAUTH_URL}catch{}if(ea.env.VERCEL_URL)try{let t=ea.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${ea.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",o=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],a={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:l,onError:u,onRequest:d,onResponse:R,...T}=e?.fetchOptions||{},w=(r={baseURL:i,...n?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:i,parseDates:o=!0}=t;if("string"!=typeof e)return e;let s=e.trim(),a=s.toLowerCase();if(a.length<=9&&a in E)return E[a];if(!h.test(s)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(p).some(([e,t])=>{let r=t.test(s);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(s,(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(o&&"string"==typeof t){let e=function(e){let t=g.exec(e);if(!t)return null;let[,r,n,i,o,s,a,l,u,c,d]=t,f=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(i,10),parseInt(o,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 i?i(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...T,plugins:[a,...T.plugins||[],...e?.disableDefaultFetchPlugins?[]:[y],...o]},async function(e,t){let n,i=K(G(G({},r),t),{headers:et(null==r?void 0:r.headers,null==t?void 0:t.headers),plugins:[...(null==r?void 0:r.plugins)||[],(n=r||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,i,o,s;let a=(null==(i=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:i.schema)||n.schema;if(a){let r=e;(null==(o=a.config)?void 0:o.prefix)&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,""),a.config.baseURL&&(e=e.replace(a.config.prefix,a.config.baseURL))),(null==(s=a.config)?void 0:s.baseURL)&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,"")),r.startsWith("/")&&"@"===r.charAt(1)&&(r=r.substring(1));let n=a.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
2h((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 i=await ei(n.headers,e),o={};for(let[e,t]of Object.entries(i))o[e.toLowerCase()]=t;r=o}let i=K(G({},t),{method:n.method,output:n.output,headers:r});return(null==t?void 0:t.disableValidation)||(i=K(G({},i),{body:n.input?await ei(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await ei(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await ei(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:i}}}return{url:e,options:t}}}),...(null==t?void 0:t.plugins)||[]]});if(null==r?void 0:r.catchAllError)try{return await es(e,i)}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 es(e,i)}),{$sessionSignal:v,session:O,broadcastSessionUpdate:_}=function(e,t){let r,n=(0,N.eU)(!1),i=e=>a(e),o=(0,N.eU)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});(0,b.K)(o,D);let s=e=>{if(r!==e)return;let t=o.get();r=void 0,(t.isPending||t.isRefetching)&&o.set({...t,isPending:!1,isRefetching:!1,refetch:i})},a=async t=>{r?.abort();let n=new AbortController;r=n;let a=o.get();o.set({...a,isPending:null===a.data,isRefetching:!0,error:null,refetch:i});try{var l;let r=await e("/get-session",{method:"GET",query:t?.query,signal:n.signal});if(n.signal.aborted)return void s(n);let{data:a,error:u}=P(r);if(a?.needsRefresh)try{let t=await e("/get-session",{method:"POST",signal:n.signal});if(n.signal.aborted)return void s(n);({data:a,error:u}=P(t))}catch{if(n.signal.aborted)return void s(n)}if(u){let e=o.get(),t=u?.status===401;o.set({data:t?null:e.data,error:u,isPending:!1,isRefetching:!1,refetch:i});return}let c=(l=a)&&(null!==l.session||null!==l.user)?l:null,d=o.get(),f=null!=d.data&&null!=c&&(0,b.r)(d.data,c)?d.data:c;o.set({data:f,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(t){if(n.signal.aborted)return void s(n);let e=o.get();o.set({data:e.data,error:t,isPending:!1,isRefetching:!1,refetch:i})}},l=()=>{};return(0,L.Rc)(o,()=>{let e;"undefined"!=typeof window&&(e=setTimeout(()=>{a()},0));let i=function(e){let{fetchSession:t,shouldPollSession:r=()=>!0,sessionSignal:n,options:i={}}=e,o=i.sessionOptions?.refetchInterval??0,s=i.sessionOptions?.refetchOnWindowFocus??!0,a=i.sessionOptions?.refetchWhenOffline??!1,l={isInitialized:!1,lastSessionRequest:0},u=e=>{if(a||I().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=U(),t();return}if(e?.event==="visibilitychange"){if(U()-l.lastSessionRequest<5)return;l.lastSessionRequest=U(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,o&&o>0&&(l.pollInterval=setInterval(()=>{r()&&u({event:"poll"})},1e3*o)),l.unsubscribeBroadcast=m().subscribe(()=>{u({event:"storage"})}),s&&(l.unsubscribeFocus=A().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=I().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=n.listen(()=>{t()}),l.cleanupBroadcastSetup=m().setup(),l.cleanupFocusSetup=A().setup(),l.cleanupOnlineSetup=I().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=>{m().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:a,shouldPollSession:()=>null!=o.get().data,sessionSignal:n,options:t});return i.init(),l=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&s(t),i.cleanup()}}),{session:o,$sessionSignal:n,broadcastSessionUpdate:e=>l(e)}}(w,e),S=e?.plugins||[],C={},k={$sessionSignal:v,session:O}
2,j={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},B=[{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?_("signout"):("/update-user"===e||"/update-session"===e)&&_("updateUser")}}];for(let e of S)e.getAtoms&&Object.assign(k,e.getAtoms?.(w)),e.pathMethods&&Object.assign(j,e.pathMethods),e.atomListeners&&B.push(...e.atomListeners);let H={notify:e=>{k[e].set(!k[e].get())},listen:(e,t)=>{k[e].subscribe(t)},atoms:k};for(let t of S)t.getActions&&(C=x(t.getActions?.(w,H,e)??{},C));return{get baseURL(){return i},pluginsActions:C,pluginsAtoms:k,pluginPathMethods:j,atomListeners:B,$fetch:w,$store:H}})(e),u={};for(let[e,t]of Object.entries(i))u[`use${e.charAt(0).toUpperCase()+e.slice(1)}`]=t;return t={...n,...u,$fetch:o,$store:l},function e(n=[]){return new Proxy(function(){},{get(r,i){var o;if("string"!=typeof i||"then"===i||"catch"===i||"finally"===i)return;let s=[...n,i],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(o=a)&&null!==o&&"get"in o&&"function"==typeof o.get&&"lc"in o&&"number"==typeof o.lc?a:e(s)},apply:async(e,t,s)=>{let l="/"+n.map(ec).join("/"),u=s[0]||{},c=s[1]||{},{query:d,fetchOptions:f,...p}=u,h={...c,...f},E=function(e,t,r){let n=t[e],{fetchOptions:i,query:o,...s}=r||{};return n||(i?.method?i.method:s&&Object.keys(s).length>0?"POST":"GET")}(l,r,u);return await o(l,{...h,body:"GET"===E?void 0:{...p,...h?.body||{}},query:d||h?.query,method:E,async onSuccess(e){if(await h?.onSuccess?.(e),!a||h.disableSignal)return;let t=a.filter(e=>e.matcher(l));if(!t.length)return;let r=new Set;for(let e of t){let t=i[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)}}})}})}()}},55742:(e,t,r)=>{r.d(t,{K:()=>o,r:()=>function e(t,r){if(t===r)return!0;if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if(i(t)&&i(r)){let n=Object.keys(t),i=Object.keys(r);if(n.length!==i.length)return!1;for(let i of n)if(!(i in r)||!e(t[i],r[i]))return!1;return!0}return!1}});var n=r(15006);function i(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function o(e,t){return(0,n.OS)(e,({newValue:r,abort:n})=>{t(e.value,r)&&n()})}},93317:(e,t,r)=>{r.d(t,{eU:()=>s});let n=[],i=0,o=0,s=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=i+4;t<n.length;)n[t]===e?n.splice(t,4):t+=4;let o=t.indexOf(e);~o&&(t.splice(o,1),--r.lc||r.off())}),notify(e,s){o++;let a=!n.length;for(let i of t)n.push(i,r.value,e,s);if(a){for(i=0;i<n.length;i+=4)n[i](n[i+1],n[i+2],n[i+3]);n.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}}}]);
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.