module.exports=[18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},18402,a=>{"use strict";var b=a.i(87924),c=a.i(72131);class d extends Error{constructor(a,b){a instanceof Error?super(void 0,{cause:{err:a,...a.cause,...b}}):"string"==typeof a?(b instanceof Error&&(b={err:b,...b.cause}),super(a,b)):super(void 0,a),this.name=this.constructor.name,this.type=this.constructor.type??"AuthError",this.kind=this.constructor.kind??"error",Error.captureStackTrace?.(this,this.constructor);const c=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${c}`}}class e extends d{}class f extends d{}async function g(a,b,c,d={}){let f=`${h(b)}/${a}`;try{let a={headers:{"Content-Type":"application/json",...d?.headers?.cookie?{cookie:d.headers.cookie}:{}}};d?.body&&(a.body=JSON.stringify(d.body),a.method="POST");let b=await fetch(f,a),c=await b.json();if(!b.ok)throw c;return c}catch(a){return c.error(new e(a.message,a)),null}}function h(a){return`${a.baseUrlServer}${a.basePathServer}`}function i(){return Math.floor(Date.now()/1e3)}function j(a){let b=new URL("http://localhost:3000/api/auth");a&&!a.startsWith("http")&&(a=`https://${a}`);let c=new URL(a||b),d=("/"===c.pathname?b.pathname:c.pathname).replace(/\/$/,""),e=`${c.origin}${d}`;return{origin:c.origin,host:c.host,path:d,base:e,toString:()=>e}}let k={baseUrl:j(process.env.NEXTAUTH_URL??process.env.VERCEL_URL).origin,basePath:j(process.env.NEXTAUTH_URL).path,baseUrlServer:j(process.env.NEXTAUTH_URL_INTERNAL??process.env.NEXTAUTH_URL??process.env.VERCEL_URL).origin,basePathServer:j(process.env.NEXTAUTH_URL_INTERNAL??process.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:()=>{}},l=null;function m(){return"undefined"==typeof BroadcastChannel?{postMessage:()=>{},addEventListener:()=>{},removeEventListener:()=>{},name:"next-auth",onmessage:null,onmessageerror:null,close:()=>{},dispatchEvent:()=>!1}:new BroadcastChannel("next-auth")}function n(){return null===l&&(l=m()),l}let o={debug:console.debug,error:console.error,warn:console.warn},p=c.createContext?.(void 0);async function q(a){let b=await g("session",k,o,a);return(a?.broadcast??!0)&&m().postMessage({event:"session",data:{trigger:"getSession"}}),b}async function r(){let a=await g("csrf",k,o);return a?.csrfToken??""}async function s(){return g("providers",k,o)}async function t(a,b,c){let{callbackUrl:d,...e}=b??{},{redirect:f=!0,redirectTo:g=d??window.location.href,...i}=e,j=h(k),l=await s();if(!l){let a=`${j}/error`;window.location.href=a;return}if(!a||!l[a]){let a=`${j}/signin?${new URLSearchParams({callbackUrl:g})}`;window.location.href=a;return}let m=l[a].type;if("webauthn"===m)throw TypeError(`Provider id "${a}" refers to a WebAuthn provider.
Please use \`import { signIn } from "next-auth/webauthn"\` instead.`);let n=`${j}/${"credentials"===m?"callback":"signin"}/${a}`,o=await r(),p=await fetch(`${n}?${new URLSearchParams(c)}`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...i,csrfToken:o,callbackUrl:g})}),q=await p.json();if(f){let a=q.url??g;window.location.href=a,a.includes("#")&&window.location.reload();return}let t=new URL(q.url).searchParams.get("error")??void 0,u=new URL(q.url).searchParams.get("code")??void 0;return p.ok&&await k._getSession({event:"storage"}),{error:t,code:u,status:p.status,ok:p.ok,url:t?null:q.url}}async function u(a){let{redirect:b=!0,redirectTo:c=a?.callbackUrl??window.location.href}=a??{},d=h(k),e=await r(),f=await fetch(`${d}/signout`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({csrfToken:e,callbackUrl:c})}),g=await f.json();if(n().postMessage({event:"session",data:{trigger:"signout"}}),b){let a=g.url??c;window.location.href=a,a.includes("#")&&window.location.reload();return}return await k._getSession({event:"storage"}),g}function v(a){if(!p)throw Error("React Context is unavailable in Server Components");let{children:d,basePath:e,refetchInterval:h,refetchWhenOffline:j}=a;e&&(k.basePath=e);let l=void 0!==a.session;k._lastSync=l?i():0;let[m,s]=c.useState(()=>(l&&(k._session=a.session),a.session)),[t,u]=c.useState(!l);c.useEffect(()=>(k._getSession=async({event:a}={})=>{try{let b="storage"===a;if(b||void 0===k._session){k._lastSync=i(),k._session=await q({broadcast:!b}),s(k._session);return}if(!a||null===k._session||i()<k._lastSync)return;k._lastSync=i(),k._session=await q(),s(k._session)}catch(a){o.error(new f(a.message,a))}finally{u(!1)}},k._getSession(),()=>{k._lastSync=0,k._session=void 0,k._getSession=()=>{}}),[]),c.useEffect(()=>{let a=()=>k._getSession({event:"storage"});return n().addEventListener("message",a),()=>n().removeEventListener("message",a)},[]),c.useEffect(()=>{let{refetchOnWindowFocus:b=!0}=a,c=()=>{b&&"visible"===document.visibilityState&&k._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",c,!1),()=>document.removeEventListener("visibilitychange",c,!1)},[a.refetchOnWindowFocus]);let v=function(){let[a,b]=c.useState("undefined"!=typeof navigator&&navigator.onLine),d=()=>b(!0),e=()=>b(!1);return c.useEffect(()=>(window.addEventListener("online",d),window.addEventListener("offline",e),()=>{window.removeEventListener("online",d),window.removeEventListener("offline",e)}),[]),a}(),w=!1!==j||v;c.useEffect(()=>{if(h&&w){let a=setInterval(()=>{k._session&&k._getSession({event:"poll"})},1e3*h);return()=>clearInterval(a)}},[h,w]);let x=c.useMemo(()=>({data:m,status:t?"loading":m?"authenticated":"unauthenticated",async update(a){if(t)return;u(!0);let b=await g("session",k,o,void 0===a?void 0:{body:{csrfToken:await r(),data:a}});return u(!1),b&&(s(b),n().postMessage({event:"session",data:{trigger:"getSession"}})),b}}),[m,t]);return(0,b.jsx)(p.Provider,{value:x,children:d})}a.s(["SessionProvider",()=>v,"signIn",()=>t,"signOut",()=>u],18402)},18175,a=>{"use strict";var b=a.i(87924),c=a.i(18402);function d({children:a}){return(0,b.jsx)(c.SessionProvider,{children:a})}a.s(["Providers",()=>d])}];

//# sourceMappingURL=%5Broot-of-the-server%5D__20283be7._.js.map