1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2525],{10274:(e,t,r)=>{r.d(t,{eU:()=>s});let n=[],o=0,i=0,s=e=>{let t=[],r={get:()=>(r.lc||r.listen(()=>{})(),r.value),lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=o+4;t<n.length;)n[t]===e?n.splice(t,4):t+=4;let i=t.indexOf(e);~i&&(t.splice(i,1),--r.lc||r.off())}),notify(e,s){i++;let l=!n.length;for(let o of t)n.push(o,r.value,e,s);if(l){for(o=0;o<n.length;o+=4)n[o](n[o+1],n[o+2],n[o+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}},11712:(e,t,r)=>{r.d(t,{px:()=>d,L1:()=>p,tT:()=>f}),r(23129),r(42585);var n=r(38386);function o(e){return{newRole:e=>{var t;return{authorize(e,r="AND"){let o=!1;for(let[i,s]of Object.entries(e)){let e=t[i];if(!e)return{success:!1,error:`You are not allowed to access resource: ${i}`};if(Array.isArray(s))o=s.every(t=>e.includes(t));else if("object"==typeof s)o="OR"===s.connector?s.actions.some(t=>e.includes(t)):s.actions.every(t=>e.includes(t));else throw new n.$("Invalid access control request");if(o&&"OR"===r)return{success:o};if(!o&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${i}"`}}return o?{success:o}:{success:!1,error:"Not authorized"}},statements:t=e}},statements:e}}r(23990);let i=o({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]});i.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),i.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),i.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]});class s{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})}}new s;let l=o({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),a=l.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),u=l.newRole({user:[],session:[]}),c={admin:a,user:u},f=()=>({id:"magic-link",$InferServerPlugin:{}}),d=e=>{let t={admin:a,user:u,...e?.roles};return{id:"admin-client",$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:r=>(e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions&&!e.permission)return!1;let t=(e.role||e.options?.defaultRole||"user").split(","),r=e.options?.roles||c;for(let n of t){let t=r[n],o=t?.authorize(e.permission??e.permissions);if(o?.success)return!0}return!1})({role:r.role,options:{ac:e?.ac,roles:t},permissions:r.permissions??r.permission})}}),pathMethods:{"/admin/list-users":"GET","/admin/stop-impersonating":"POST"}}},p=()=>h(),h=()=>({id:"infer-server-plugin",$InferServerPlugin:{}})},23129:(e,t,r)=>{r.d(t,{Hy:()=>_});var n=Object.defineProperty,o=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,u=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))l.call(t,r)&&u(e,r,t[r]);if(s)for(var r of s(t))a.call(t,r)&&u(e,r,t[r]);return e},f=(e,t)=>o(e,i(t)),d=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r}},p=async(e,t)=>{var r,n,o,i,s,l;let a=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:a,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));a=n.options||a,e=n.url}u.onRequest.push(null==(n=c.hooks)?void 0:n.onRequest),u.onResponse.push(null==(o=c.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(i=c.hooks)?void 0:i.onSuccess),u.onError.push(null==(s=c.hooks)?void 0:s.onError),u.onRetry.push(null==(l=c.hooks)?void 0:l.onRetry)}return{url:e,options:a,hooks:u}},h=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}},v=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)}},m=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;
1if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let n=r(e.auth.username),o=r(e.auth.password);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let n=r(e.auth.value);if(!n)return t;t.authorization=`${r(e.auth.prefix)} ${n}`}}return t},y=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function g(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 b(e){try{return JSON.parse(e)}catch(t){return e}}function E(e){return"function"==typeof e}async function w(e){let t=new Headers(null==e?void 0:e.headers);for(let[r,n]of Object.entries(await m(e)||{}))t.set(r,n);if(!t.has("content-type")){let r=g(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var R=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function T(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new R(r.issues);return r.value}var O=["get","post","put","patch","delete"],_=e=>async function(t,r){let n,o=f(c(c({},e),r),{plugins:[...(null==e?void 0:e.plugins)||[],(n=e||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,i,s;let l=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(l){let r=e;(null==(i=l.config)?void 0:i.prefix)&&r.startsWith(l.config.prefix)&&(r=r.replace(l.config.prefix,""),l.config.baseURL&&(e=e.replace(l.config.prefix,l.config.baseURL))),(null==(s=l.config)?void 0:s.baseURL)&&r.startsWith(l.config.baseURL)&&(r=r.replace(l.config.baseURL,""));let n=l.schema[r];if(n){let r=f(c({},t),{method:n.method,output:n.output});return(null==t?void 0:t.disableValidation)||(r=f(c({},r),{body:n.input?await T(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await T(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await T(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:r}}}return{url:e,options:t}}})]});if(null==e?void 0:e.catchAllError)try{return await A(t,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await A(t,o)},A=async(e,t)=>{var r,n,o,i,s,l,a,u;let{hooks:m,url:R,options:_}=await p(e,t),S=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&E(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&E(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(_),P=new AbortController,x=null!=(r=_.signal)?r:P.signal,I=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];O.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[s,l]=e.replace(i,"").split("?"),a=new URLSearchParams(l);for(let[e,t]of Object.entries(o||{}))null!=t&&a.set(e,String(t));if(n)if(Array.isArray(n))for(let[e,t]of s.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];s=s.replace(t,r)}else for(let[e,t]of Object.entries(n))s=s.replace(`:${e}`,String(t));(s=s.split("/").map(encodeURIComponent).join("/")).startsWith("/")&&(s=s.slice(1));let u=a.toString();return(u=u.length>0?`?${u}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${s}${u}`,i):`${i}${s}${u}`}(R,_),U=function(e){if(!(null==e?void 0:e.body))return null;let t=new Headers(null==e?void 0:e.headers);if(g(e.body)&&!t.has("content-type")){for(let[t,r]of Object.entries(null==e?void 0:e.body))r instanceof Date&&(e.body[t]=r.toISOString());return JSON.stringify(e.body)}return e.body}(_),j=await w(_),C=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 O.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(R,_),$=f(c({},_),{url:I,headers:j,body:U,method:C,signal:x});for(let e of m.onRequest)if(e){let t=await e($);t instanceof Object&&($=t)}("pipeTo"in $&&"function"==typeof $.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pi
1pe))&&!("duplex"in $)&&($.duplex="half");let{clearTimeout:L}=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)}}}(_,P),N=await S($.url,$);L();let M={response:N,request:$};for(let e of m.onResponse)if(e){let r=await e(f(c({},M),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?N.clone():N}));r instanceof Response?N=r:r instanceof Object&&(N=r.response)}if(N.ok){if("HEAD"===$.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 y.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(N),r={data:"",response:N,request:$};if("json"===e||"text"===e){let e=await N.text(),t=null!=(i=$.jsonParser)?i:b;r.data=await t(e)}else r.data=await N[e]();for(let e of((null==$?void 0:$.output)&&$.output&&!$.disableValidation&&(r.data=await T($.output,r.data)),m.onSuccess))e&&await e(f(c({},r),{response:(null==(s=null==t?void 0:t.hookOptions)?void 0:s.cloneResponse)?N.clone():N}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let k=null!=(l=null==t?void 0:t.jsonParser)?l:b,B=await N.text(),D=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(B),q=D?await k(B):null,H={response:N,responseText:B,request:$,error:f(c({},q),{status:N.status,statusText:N.statusText})};for(let e of m.onError)e&&await e(f(c({},H),{response:(null==(a=null==t?void 0:t.hookOptions)?void 0:a.cloneResponse)?N.clone():N}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new h({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new h(e);case"exponential":return new v(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,N)){for(let e of m.onRetry)e&&await e(M);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await A(e,f(c({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new d(N.status,N.statusText,D?q:B);return{data:null,error:f(c({},q),{status:N.status,statusText:N.statusText})}}},23990:(e,t,r)=>{r.d(t,{u:()=>s});var n=r(10274);let o=(e,t)=>((e,t,r,n)=>(e.events=e.events||{},e.events[15]||(e.events[15]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);n.splice(o,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}))(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}}),i="undefined"==typeof window,s=(e,t,r,s)=>{let l=(0,n.eU)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)}),a=e=>{let n="function"==typeof s?s({data:l.get().data,error:l.get().error,isPending:l.get().isPending}):s;r(t,{...n,query:{...n?.query,...e?.query},async onSuccess(e){l.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:l.value.refetch}),await n?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,o=t.retryAttempt||0;r&&o<r||(l.set({error:e.error,data:null,isPending:!1,isRefetching:!1,refetch:l.value.refetch}),await n?.onError?.(e))},async onRequest(e){let t=l.get();l.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:l.value.refetch}),await n?.onRequest?.(e)}}).catch(e=>{l.set({error:e,data:null,isPending:!1,isRefetching:!1,refetch:l.value.refetch})})};e=Array.isArray(e)?e:[e];let u=!1;for(let t of e)t.subscribe(()=>{i||(u?a():o(l,()=>{let e=setTimeout(()=>{u||(a(),u=!0)},0);return()=>{l.off(),t.off(),clearTimeout(e)}}))});return l}},27541:(e,t,r)=>{var n=r(43041);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},38386:(e,t,r)=>{r.d(t,{$:()=>n});
1class n extends Error{constructor(e,t){super(e),this.name="BetterAuthError",this.message=e,this.cause=t,this.stack=""}}},42585:(e,t,r)=>{r.d(t,{_K:()=>s});var n=r(77011);let o=Object.create(null),i=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),s=new Proxy(o,{get:(e,t)=>i()[t]??o[t],has:(e,t)=>t in i()||t in o,set:(e,t,r)=>(i(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=i(!0);return delete r[t],!0},ownKeys:()=>Object.keys(i(!0))});function l(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}void 0!==n&&n.env,Object.freeze({get BETTER_AUTH_SECRET(){return l("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return l("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return l("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return l("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return l("NODE_ENV","development")},get PACKAGE_VERSION(){return l("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return l("BETTER_AUTH_TELEMETRY_ENDPOINT","https://telemetry.better-auth.com/v1/track")}});let a={eterm:4,cons25:4,console:4,cygwin:4,dtterm:4,gnome:4,hurd:4,jfbterm:4,konsole:4,kterm:4,mlterm:4,mosh:24,putty:4,st:4,"rxvt-unicode-24bit":24,terminator:24,"xterm-kitty":24},u=new Map(Object.entries({APPVEYOR:8,BUILDKITE:8,CIRCLECI:24,DRONE:8,GITEA_ACTIONS:24,GITHUB_ACTIONS:24,GITLAB_CI:8,TRAVIS:8})),c=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/],f={reset:"\x1b[0m",bright:"\x1b[1m",dim:"\x1b[2m",fg:{black:"\x1b[30m",red:"\x1b[31m",green:"\x1b[32m",yellow:"\x1b[33m",blue:"\x1b[34m",magenta:"\x1b[35m",cyan:"\x1b[36m",white:"\x1b[37m"}},d=["info","success","warn","error","debug"],p={info:f.fg.blue,success:f.fg.green,warn:f.fg.yellow,error:f.fg.red,debug:f.fg.magenta};(e=>{let t=(void 0)??"error",r=e?.disableColors!==void 0?!e.disableColors:1!==function(){if(void 0!==l("FORCE_COLOR"))switch(l("FORCE_COLOR")){case"":case"1":case"true":return 4;case"2":return 8;case"3":return 24;default:return 1}if(void 0!==l("NODE_DISABLE_COLORS")&&""!==l("NODE_DISABLE_COLORS")||void 0!==l("NO_COLOR")&&""!==l("NO_COLOR")||"dumb"===l("TERM"))return 1;if(l("TMUX"))return 24;if("TF_BUILD"in s&&"AGENT_NAME"in s)return 4;if("CI"in s){for(let{0:e,1:t}of u)if(e in s)return t;return"codeship"===l("CI_NAME")?8:1}if("TEAMCITY_VERSION"in s)return null!==/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(l("TEAMCITY_VERSION"))?4:1;switch(l("TERM_PROGRAM")){case"iTerm.app":if(!l("TERM_PROGRAM_VERSION")||null!==/^[0-2]\./.exec(l("TERM_PROGRAM_VERSION")))return 8;return 24;case"HyperTerm":case"MacTerm":return 24;case"Apple_Terminal":return 8}if("truecolor"===l("COLORTERM")||"24bit"===l("COLORTERM"))return 24;if(l("TERM")){if(null!==/truecolor/.exec(l("TERM")))return 24;if(null!==/^xterm-256/.exec(l("TERM")))return 8;let e=l("TERM").toLowerCase();if(a[e])return a[e];if(c.some(t=>null!==t.exec(e)))return 4}return l("COLORTERM")?4:1}();return{...Object.fromEntries(d.map(n=>[n,(...[o,...i])=>((n,o,i=[])=>{if(!(d.indexOf(n)<=d.indexOf(t)))return;let s=((e,t,r)=>{let n=new Date().toISOString();return r?`${f.dim}${n}${f.reset} ${p[e]}${e.toUpperCase()}${f.reset} ${f.bright}[Better Auth]:${f.reset} ${t}`:`${n} ${e.toUpperCase()} [Better Auth]: ${t}`})(n,o,r);if(!e||"function"!=typeof e.log)return void("error"===n?console.error(s,...i):"warn"===n?console.warn(s,...i):console.log(s,...i));e.log("success"===n?"info":n,o,...i)})(n,o,i)])),get level(){return t}}})()},49161:(e,t,r)=>{r.d(t,{MB:()=>v});var n=r(23129),o=r(42585),i=r(38386);function s(e,t="/api/auth"){if(function(e){try{let t=new URL(e).pathname.replace(/\/+$/,"")||"/";return"/"!==t}catch(t){throw new i.$(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=e.replace(/\/+$/,"");return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}var l=r(10274),a=r(23990);let u={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*:/},c=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,f={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},d=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,p={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&"undefined"!=typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}};var h=r(7620);function v(e){var t,r;let{pluginPathMethods:v,pluginsActions:m,pluginsAtoms:y,$fetch:g,$store:b,atomListeners:E}=((e,t)=>{let r="credentials"in Request.prototype,h=function(e,t,r,n){if(e)return s(e,t);if(!1!==n){let e=o._K.BETTER_AUTH_URL||o._K.NEXT_PUBLIC_BETTER_AUTH_URL||o._K.PUBLIC_BETTER_AUTH_URL||o._K.NUXT_PUBLIC_BETTER_AUTH_URL||o._K.NUXT_PUBLIC_AUTH_URL||("/"!==o._K.BASE_URL?o._K.BASE_URL:void 0);if(e)return s(e,t)}let l=r?.headers.get("x-forwarded-host"),a=r?.headers.get("x-forwarded-proto");if(l&&a)return s(`${a}://${l}`,t);if(r){let e=function(e){try{return new URL(e).origin}catch(e){return null}}(r.url);if(!e)throw new i.$("Could not get origin from request. Please provide a valid base URL.");return s(e,t)}if("undefined"!=typeof window&&window.location)return s(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??"/api/auth",v=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],m={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:y,onError:g,onRequest:b,onResponse:E,...w}=e?.fetchOptions||{},R=(0,n.Hy)({baseURL:h,...r?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let s=e.trim();if(s.length>0&&'"'===s[0]&&s.endsWith('"')&&!s.slice(1,-1).includes('"'))return s.slice(1,-1);let l=s.toLowerCase();if(l.length<=9&&l in f)return f[l];
1if(!c.test(s)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(u).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(i&&"string"==typeof t){let e=function(e){let t=d.exec(e);if(!t)return null;let[,r,n,o,i,s,l,a,u,c,f]=t,p=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(i,10),parseInt(s,10),parseInt(l,10),a?parseInt(a.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(f,10))*("+"===u?-1:1);p.setUTCMinutes(p.getUTCMinutes()+e)}return p instanceof Date&&!isNaN(p.getTime())?p:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...w,plugins:[m,...w.plugins||[],...e?.disableDefaultFetchPlugins?[]:[p],...v]}),{$sessionSignal:T,session:O}=function(e){let t=(0,l.eU)(!1);return{session:(0,a.u)(t,"/get-session",e,{method:"GET"}),$sessionSignal:t}}(R),_=e?.plugins||[],A={},S={$sessionSignal:T,session:O},P={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},x=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||e.startsWith("/sign-in")||e.startsWith("/sign-up")||"/delete-user"===e||"/verify-email"===e}];for(let e of _)e.getAtoms&&Object.assign(S,e.getAtoms?.(R)),e.pathMethods&&Object.assign(P,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let I={notify:e=>{S[e].set(!S[e].get())},listen:(e,t)=>{S[e].subscribe(t)},atoms:S};for(let t of _)t.getActions&&Object.assign(A,t.getActions?.(R,I,e));return{get baseURL(){return h},pluginsActions:A,pluginsAtoms:S,pluginPathMethods:P,atomListeners:x,$fetch:R,$store:I}})(e),w={};for(let[e,t]of Object.entries(y)){w[`use${(r=e).charAt(0).toUpperCase()+r.slice(1)}`]=()=>(function(e,t={}){let r=(0,h.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,i=(0,h.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n).add(void 0),e.listen((e,r,n)=>{t.has(n)&&o(e,r,n)})}return e.listen(o)},o),s=()=>r.current;return(0,h.useSyncExternalStore)(i,s,s)})(t)}return t={...m,...w,$fetch:g,$store:b},function e(r=[]){return new Proxy(function(){},{get(n,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let s=[...r,o],l=t;for(let e of s)if(l&&"object"==typeof l&&e in l)l=l[e];else{l=void 0;break}return"function"==typeof l?l:"object"==typeof(i=l)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?l:e(s)},apply:async(e,t,n)=>{let o="/"+r.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join("/"),i=n[0]||{},s=n[1]||{},{query:l,fetchOptions:a,...u}=i,c={...s,...a},f=function(e,t,r){let n=t[e],{fetchOptions:o,query:i,...s}=r||{};return n||(o?.method?o.method:s&&Object.keys(s).length>0?"POST":"GET")}(o,v,i);return await g(o,{...c,body:"GET"===f?void 0:{...u,...c?.body||{}},query:l||c?.query,method:f,async onSuccess(e){if(await c?.onSuccess?.(e),!E)return;let t=E.filter(e=>e.matcher(o));if(t.length)for(let e of t){let t=y[e.signal];if(!t)return;let r=t.get();setTimeout(()=>{t.set(!r)},10)}}})}})}()}},88604:(e,t,r)=>{r.d(t,{w:()=>i});var n=r(77011),o=r(77011);function i(e){let t="object"==typeof e.client?e.client:{},r="object"==typeof e.server?e.server:{},i=e.shared,s=e.runtimeEnv?e.runtimeEnv:{...o.env,...e.experimental__runtimeEnv};return function(e){let t=e.runtimeEnvStrict??e.runtimeEnv??n.env;if(e.emptyStringAsUndefined)for(let[e,r]of Object.entries(t))""===r&&delete t[e];if(e.skipValidation)return t;let r="object"==typeof e.client?e.client:{},o="object"==typeof e.server?e.server:{},i="object"==typeof e.shared?e.shared:{},s=e.isServer??("undefined"==typeof window||"Deno"in window),l=function(e,t){let r={},n=[];for(let o in e){let i=e[o],s=t[o],l=i["~standard"].validate(s);if(l instanceof Promise)throw Error(`Validation must be synchronous, but ${o} returned a Promise.`);if(l.issues){n.push(...l.issues.map(e=>({...e,path:[o,...e.path??[]]})));continue}r[o]=l.value}return n.length?{issues:n}:{value:r}}(s?{...o,...i,...r}:{...r,...i},t),a=e.onValidationError??(e=>{throw console.error("â Invalid environment variables:",e),Error("Invalid environment variables")}
1),u=e.onInvalidAccess??(()=>{throw Error("â Attempted to access a server-side environment variable on the client")});if(l.issues)return a(l.issues);let c=(e.extends??[]).reduce((e,t)=>Object.assign(e,t),{});return new Proxy(Object.assign(l.value,c),{get(t,r){if("string"==typeof r&&"__esModule"!==r&&"$$typeof"!==r)return s||e.clientPrefix&&(r.startsWith(e.clientPrefix)||r in i)?Reflect.get(t,r):u(r)}})}({...e,shared:i,client:t,server:r,clientPrefix:"NEXT_PUBLIC_",runtimeEnv:s})}}}]);
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.