1import{X as e,c as t,q as n}from"./useStore-Bnp9X9K7.js";import{$g as r,$h as i,Ag as a,Ah as o,Bg as s,Bh as c,Cg as l,Dg as u,Dh as d,Eg as f,Eh as p,Fg as m,Fh as h,Gg as g,Gh as _,Hg as v,Hh as y,Ig as b,Ih as x,Jg as S,Jh as ee,Kg as te,Kh as ne,Lg as re,Lh as ie,Mg as ae,Mh as oe,Ng as se,Nh as ce,Og as le,Oh as ue,Pg as de,Ph as fe,Qg as pe,Qh as me,Rg as he,Rh as ge,Sg as _e,Tg as ve,Th as ye,Ug as be,Uh as xe,Vg as Se,Vh as Ce,Wg as we,Wh as Te,Xg as Ee,Xh as De,Yg as Oe,Yh as ke,Zg as Ae,Zh as je,__ as Me,_g as Ne,a_ as Pe,ag as Fe,b_ as Ie,bg as Le,c_ as Re,cg as ze,d_ as Be,dg as Ve,e_ as He,eg as Ue,f_ as We,fg as Ge,g_ as Ke,gg as qe,h_ as Je,hg as Ye,i_ as Xe,ig as Ze,jg as Qe,jh as $e,kg as et,kh as tt,l_ as nt,lg as rt,m_ as it,mg as at,n_ as ot,ng as st,o_ as ct,og as lt,p_ as ut,pg as dt,qg as ft,qh as pt,r_ as mt,rg as ht,s_ as gt,sg as _t,t_ as vt,tg as yt,u_ as bt,ug as xt,v_ as St,vg as Ct,wg as wt,x_ as Tt,xg as Et,y_ as Dt,yg as Ot,zg as kt,zh as At}from"./button-BEP8s8km.js";var jt={get brandHome(){return Tt()},get loading(){return Je()},get email(){return it()},get emailPlaceholder(){return ut()},get password(){return We()},get newPassword(){return Be()},get confirmPassword(){return bt()},get name(){return nt()},providers:{get email(){return Re()},get google(){return gt()}},get or(){return ct()}
1,signIn:{get title(){return Pe()},get submit(){return Xe()},get submitting(){return mt()},get forgot(){return ot()},get noAccount(){return vt()},get switch(){return He()},get failed(){return r()},get passwordHelp(){return pe()},get createPassword(){return Ae()}},signUp:{get title(){return Ee()},get description(){return Oe()},get submit(){return S()},get submitting(){return ft()},get hasAccount(){return te()},get switch(){return g()},get passwordHint(){return we()},get mismatch(){return be()},get failed(){return v()}},verify:{get title(){return Se()},get description(){return s()},get resend(){return kt()},get resending(){return he()},cooldown:e=>re({seconds:e}),get continue(){return b()},get back(){return m()},get sent(){return de()},get pending(){return se()},get missing(){return ae()},get failed(){return Qe()}},forgot:{get title(){return a()},get description(){return et()},get submit(){return le()},get submitting(){return u()},get sentTitle(){return f()},get sent(){return ve()},get back(){return wt()},get failed(){return l()}},reset:{get title(){return _e()},get description(){return Et()},get submit(){return Le()},get submitting(){return Ot()},get success(){return Ct()},get invalid(){return Ne()},get failed(){return qe()},get requestNew(){return Ye()},get back(){return at()}},changePassword:{get sectionTitle(){return dt()},get jump(){return Ge()},get description(){return Ve()},get currentPassword(){return xt()},get passwordHint(){return rt()},get submit(){return ze()},get submitting(){return _t()},get success(){return lt()},get mismatch(){return Fe()},get samePassword(){return Ze()},get invalidCurrent(){return ht()},get failed(){return st()},get forgot(){return yt()},get googleTitle(){return Ue()},get googleDescription(){return i()},get googleStatus(){return me()},get createTitle(){return je()},get createDescription(){return De()},get createStatus(){return ke()},setupEmail:e=>ee({email:e}),get setupSubmit(){return pt()},get setupSubmitting(){return ne()},get setupSentButton(){return _()},get setupSent(){return Te()},get setupFailed(){return xe()}},profileName:{get edit(){return y()},get label(){return Ce()},get hint(){return c()},get save(){return At()},get saving(){return ge()},get cancel(){return ie()},get success(){return x()},get required(){return h()},get tooLong(){return fe()},get unsafe(){return ce()},get failed(){return oe()}},account:{get menu(){return $e()},get profile(){return o()},get signOut(){return tt()},get signIn(){return ue()}},legacyEmail:{get sending(){return d()},get sendFailed(){return p()},get invalidEmail(){return ye()}},meta:{get signInDescription(){return Ie()},get signUpDescription(){return Dt()},get verifyDescription(){return St()},get forgotDescription(){return Me()},get resetDescription(){return Ke()}}};function Mt(e,t){return{meta:[{title:e},{name:`description`,content:t},{name:`robots`,content:`noindex,nofollow`}]}}var C=Object.create(null),w=e=>({}),T=new Proxy(C,{get(e,t){return w()[t]??C[t]},has(e,t){return t in w()||t in C},set(e,t,n){let r=w(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=w(!0);return delete n[t],!0},ownKeys(){let e=w(!0);return Object.keys(e)}});T.NODE_ENV;function E(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return E(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return E(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return E(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return E(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return E(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return E(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return E(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function Nt(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function Pt(e){let t=e.split(` 2 at `);return t.length<=1?e:(t.splice(1,1),t.join(` 3 at `))}function Ft(e,t){class n extends e{#e;constructor(...e){if(Nt()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Pt(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t}
3,enumerable:!1,configurable:!0}),n}var It={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};Ft(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:It[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var D=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Lt=47;function O(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Lt;)t--;return t===e.length?e:e.slice(0,t)}function Rt(e){try{return(O(new URL(e).pathname)||`/`)!==`/`}catch{throw new D(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function zt(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new D(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof D?t:new D(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function k(e,t=`/api/auth`){if(zt(e),Rt(e))return e;let n=O(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function A(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Bt(e,t,n,r,i){if(e)return k(e,t);if(r!==!1){let e=T.BETTER_AUTH_URL||T.NEXT_PUBLIC_BETTER_AUTH_URL||T.PUBLIC_BETTER_AUTH_URL||T.NUXT_PUBLIC_BETTER_AUTH_URL||T.NUXT_PUBLIC_AUTH_URL||(T.BASE_URL===`/`?void 0:T.BASE_URL);if(e)return k(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&A(o,`proto`)&&A(a,`host`))try{return k(`${o}://${a}`,t)}catch{}if(n){let e=Vt(n.url);if(!e)throw new D(`Could not get origin from request. Please provide a valid base URL.`);return k(e,t)}if(typeof window<`u`&&window.location)return k(window.location.origin,t)}function Vt(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Ht={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*:/},Ut=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,j={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},Wt=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Gt(e){return e instanceof Date&&!isNaN(e.getTime())}function Kt(e){let t=Wt.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return Gt(f)?f:null}function qt(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in j)return j[s];if(!Ut.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(Ht).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Kt(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function Jt(e,t={strict:!0}){return qt(e,t)}var Yt=[`javascript:`,`data:`,`vbscript:`];function Xt(e){let t;try{t=new URL(e)}catch{return!0}return!Yt.includes(t.protocol)}var Zt={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Xt(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},M=[],N=0,P=null,F=4,Qt=globalThis.nanostoresGlobal||={epoch:0},$t=()=>{let e;for(N=0;N<M.length;N+=F)try{M[N](M[N+1].value,M[N+2],M[N+3])}catch(t){e=t}if(M.length=0,e)throw e},en=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=N+F;
3t<M.length;)M[t]===e?M.splice(t,F):t+=F;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){Qt.epoch++;let i=!M.length&&!P;for(let i of t)P?.has(i)||(P?.add(i),M.push(i,n,e,P?void 0:r));i&&$t()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},tn=2,nn=5,I=6,L=10,rn=(e,t,n,r)=>(e.events=e.events||{},e.events[n+L]||(e.events[n+L]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+L](),delete e.events[n+L])}),an=(e,t)=>rn(e,t,tn,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),on=1e3,sn=(e,t)=>rn(e,n=>{let r=t(n);r&&e.events[I].push(r)},nn,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[I]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[I])t();e.events[I]=[]}},on)},()=>{e.listen=n,e.off=r}});function cn(e,t){let n=un(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var ln=/(.*)\[(\d+)\]/;function un(e){return e.split(`.`).flatMap(e=>dn(e))}function dn(e){if(ln.test(e)){let[,t,n]=e.match(ln);return[...dn(t),n]}return[e]}function fn(e,t,n){let r=new Set(t);return e.listen((e,i,a)=>{(a===void 0?t.some(t=>i===void 0||e[t]!==i[t]||cn(e,t)!==cn(i,t)):r.has(a)||r.has(a.split(/\.|\[/)[0]))&&n(e,i,a)})}function pn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function R(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!R(e[n],t[n]))return!1;return!0}if(pn(e)&&pn(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!R(e[r],t[r]))return!1;return!0}return!1}function mn(e,t){return an(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var z=Symbol.for(`better-auth:broadcast-channel`),hn=()=>Math.floor(Date.now()/1e3),gn=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(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:hn()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)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 B(e=`better-auth.message`){return globalThis[z]||(globalThis[z]=new gn(e)),globalThis[z]}var V=Symbol.for(`better-auth:focus-manager`),_n=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(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function vn(){return globalThis[V]||(globalThis[V]=new _n),globalThis[V]}var H=Symbol.for(`better-auth:online-manager`),yn=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)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[H]||(globalThis[H]=new yn),globalThis[H]}var W=()=>Math.floor(Date.now()/1e3),bn=5;function xn(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||U().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=W(),t();return}if(e?.event===`visibilitychange`){if(W()-c.lastSessionRequest<bn)return;c.lastSessionRequest=W(),t();return}t()}},d=e=>{B().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=B().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=vn().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=U().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=B().setup(),c.cleanupFocusSetup=vn().setup(),c.cleanupOnlineSetup=U().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Sn=()=>typeof window>`u`,Cn=on;function wn(e,t){if(typeof window>`u`)return;let n=e.get();n.data!==null||t===null||e.set({...n,data:t,error:null,isPending:!1})}function Tn(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function En(e){return!e||e.session===null&&e.user===null?null:e}function Dn(e,t){return R(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function On(e,t){let n=en(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=en({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});mn(s,Dn);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=Tn(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=Tn(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=En(i),u=s.value,d=u.data!=null&&l!=null&&R(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+Cn,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return sn(s,()=>{let e;Sn()||(e=setTimeout(()=>{d()},0));let r=xn({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function G(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function K(e,t,n=`.`,r){if(!G(t))return K(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:G(a)&&G(i[t])?i[t]=K(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function kn(e){return(...t)=>t.reduce((t,n)=>K(t,n,``,e),{})}var An=kn(),jn=Object.defineProperty,Mn=Object.defineProperties,Nn=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,Fn=Object.prototype.hasOwnProperty,In=Object.prototype.propertyIsEnumerable,Ln=(e,t,n)=>t in e?jn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>
3{for(var n in t||={})Fn.call(t,n)&&Ln(e,n,t[n]);if(Pn)for(var n of Pn(t))In.call(t,n)&&Ln(e,n,t[n]);return e},J=(e,t)=>Mn(e,Nn(t)),Rn=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},zn=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Bn=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}},Vn=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)}};function Hn(e){if(typeof e==`number`)return new Bn({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Bn(e);case`exponential`:return new Vn(e);default:throw Error(`Invalid retry strategy`)}}var Un=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},Wn=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Gn(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return Wn.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function Kn(e){try{return JSON.parse(e),!0}catch{return!1}}function qn(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function Jn(e){try{return JSON.parse(e)}catch{return e}}function Yn(e){return typeof e==`function`}function Xn(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&Yn(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&Yn(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function Zn(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}return t}async function Qn(e){let t=new Headers(Zn(e?.headers,await Un(e)));if(!t.has(`content-type`)){let n=$n(e?.body);n&&t.set(`content-type`,n)}return t}function $n(e){return qn(e)?`application/json`:null}function er(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function tr(e,t){let{body:n}=e;return n?!qn(n)||typeof n==`string`?n:er(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function nr(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return ar.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function rr(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var ir=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function Y(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new ir(n.issues);return n.value}var ar=[`get`,`post`,`put`,`patch`,`delete`],or=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>
3e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await Y(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=J(q({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=J(q({},r),{body:i.input?await Y(i.input,n?.body):n?.body,params:i.params?await Y(i.params,n?.params):n?.params,query:i.query?await Y(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),sr=e=>{async function t(t,n){let r=J(q(q({},e),n),{headers:Zn(e?.headers,n?.headers),plugins:[...e?.plugins||[],or(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await X(t,r)}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 X(t,r)}return t},cr=e=>e===`.`||e===`..`;function lr(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(cr(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function ur(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];ar.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t));o=o.split(`/`).map(e=>lr(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var X=async(e,t)=>{let{hooks:n,url:r,options:i}=await zn(e,t),a=Xn(i),o=new AbortController,s=i.signal??o.signal,c=ur(r,i),l=await Qn(i),u=tr(i,l),d=nr(r,i),f=J(q({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=rr(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(J(q({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=Gn(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??Jn)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await Y(f.output,r.data));for(let e of n.onSuccess)e&&await e(J(q({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??Jn,_=await m.text(),v=Kn(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:J(q({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(J(q({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=Hn(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await X(e,J(q({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new Rn(m.status,m.statusText,v?y:_);return{data:null,error:J(q({},y),{status:m.status,statusText:m.statusText})}},dr=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},fr=(e,t)=>{let n=`credentials`in Request.prototype,r=Bt(e?.baseURL,e?.basePath,void 0,t)??dr(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],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:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=sr({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?Jt(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Zt],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=On(d,e),h=!1,g=e=>{h||e===null||(h=!0,wn(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p}
3,b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher(e){return 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`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=An(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$fetch:d,$store:S}};function pr(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function mr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var hr=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,gr=/['\u2019]/g;function _r(e){return e.replace(gr,``).match(hr)??[]}function vr(e){return _r(e).map(e=>e.toLowerCase()).join(`-`)}function yr(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function br(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||pr(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(vr).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=yr(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}var Z=e(n(),1);function xr(e,t={}){let n=(0,Z.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,Z.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};
3return i(e.value),r?.length?fn(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,Z.useSyncExternalStore)(a,o,o)}function Sr(e){return`use${mr(e)}`}function Cr(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=fr(e),c={};for(let[e,t]of Object.entries(r))c[Sr(e)]=()=>xr(t);return br({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var Q=Cr(),{signIn:wr,signUp:Tr,signOut:Er,useSession:Dr,requestPasswordReset:Or,resetPassword:kr,sendVerificationEmail:Ar}=Q,$=t();function jr(){return(0,$.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,className:`size-5`,children:[(0,$.jsx)(`path`,{fill:`#4285F4`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09Z`}),(0,$.jsx)(`path`,{fill:`#34A853`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z`}),(0,$.jsx)(`path`,{fill:`#FBBC05`,d:`M5.84 14.09A6.3 6.3 0 0 1 5.49 12c0-.73.13-1.43.35-2.09V7.07H2.18A11 11 0 0 0 1 12c0 1.78.43 3.45 1.18 4.93l3.66-2.84Z`}),(0,$.jsx)(`path`,{fill:`#EA4335`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15A10.98 10.98 0 0 0 2.18 7.07l3.66 2.84A6.53 6.53 0 0 1 12 5.38Z`})]})}export{Mt as a,jt as i,Q as n,Dr as r,jr as t};
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.