"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5602],{35198:(e,t,s)=>{s.d(t,{A:()=>n});let n=(0,s(13454).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},62796:(e,t,s)=>{s.d(t,{Jv:()=>q,CI:()=>G}),s(54568);var n=s(7620);class r extends Error{constructor(e,t){e instanceof Error?super(void 0,{cause:{err:e,...e.cause,...t}}):"string"==typeof e?(t instanceof Error&&(t={err:t,...t.cause}),super(e,t)):super(void 0,e),this.name=this.constructor.name,this.type=this.constructor.type??"AuthError",this.kind=this.constructor.kind??"error",Error.captureStackTrace?.(this,this.constructor);const s=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${s}`}}class a extends r{}a.kind="signIn";class o extends r{}o.type="AdapterError";class i extends r{}i.type="AccessDenied";class c extends r{}c.type="CallbackRouteError";class l extends r{}l.type="ErrorPageLoop";class d extends r{}d.type="EventError";class u extends r{}u.type="InvalidCallbackUrl";class h extends a{constructor(){super(...arguments),this.code="credentials"}}h.type="CredentialsSignin";class p extends r{}p.type="InvalidEndpoints";class y extends r{}y.type="InvalidCheck";class w extends r{}w.type="JWTSessionError";class g extends r{}g.type="MissingAdapter";class f extends r{}f.type="MissingAdapterMethods";class x extends r{}x.type="MissingAuthorize";class E extends r{}E.type="MissingSecret";class m extends a{}m.type="OAuthAccountNotLinked";class v extends a{}v.type="OAuthCallbackError";class U extends r{}U.type="OAuthProfileParseError";class k extends r{}k.type="SessionTokenError";class R extends a{}R.type="OAuthSignInError";class A extends a{}A.type="EmailSignInError";class b extends r{}b.type="SignOutError";class L extends r{}L.type="UnknownAction";class S extends r{}S.type="UnsupportedStrategy";class P extends r{}P.type="InvalidProvider";class T extends r{}T.type="UntrustedHost";class C extends r{}C.type="Verification";class $ extends a{}$.type="MissingCSRF";class _ extends r{}_.type="DuplicateConditionalUI";class N extends r{}N.type="MissingWebAuthnAutocomplete";class I extends r{}I.type="WebAuthnVerificationError";class M extends a{}M.type="AccountNotLinked";class X extends r{}X.type="ExperimentalFeatureNotEnabled";class H extends r{}async function O(e,t,s,n={}){let r=`${j(t)}/${e}`;try{let e={headers:{"Content-Type":"application/json",...n?.headers?.cookie?{cookie:n.headers.cookie}:{}}};n?.body&&(e.body=JSON.stringify(n.body),e.method="POST");let t=await fetch(r,e),s=await t.json();if(!t.ok)throw s;return s}catch(e){return s.error(new H(e.message,e)),null}}function j(e){return e.basePath}function V(e){let t=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let s=new URL(e||t),n=("/"===s.pathname?t.pathname:s.pathname).replace(/\/$/,""),r=`${s.origin}${n}`;return{origin:s.origin,host:s.host,path:n,base:r,toString:()=>r}}var W=s(63680);let J={baseUrl:V(W.env.NEXTAUTH_URL??W.env.VERCEL_URL).origin,basePath:V(W.env.NEXTAUTH_URL).path,baseUrlServer:V(W.env.NEXTAUTH_URL_INTERNAL??W.env.NEXTAUTH_URL??W.env.VERCEL_URL).origin,basePathServer:V(W.env.NEXTAUTH_URL_INTERNAL??W.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:()=>{}},z=null,B={debug:console.debug,error:console.error,warn:console.warn};async function D(){let e=await O("csrf",J,B);return e?.csrfToken??""}async function F(){return O("providers",J,B)}async function q(e,t,s){let{callbackUrl:n,...r}=t??{},{redirect:a=!0,redirectTo:o=n??window.location.href,...i}=r,c=j(J),l=await F();if(!l){let e=`${c}/error`;window.location.href=e;return}if(!e||!l[e]){let e=`${c}/signin?${new URLSearchParams({callbackUrl:o})}`;window.location.href=e;return}let d=l[e].type;if("webauthn"===d)throw TypeError(`Provider id "${e}" refers to a WebAuthn provider.
Please use \`import { signIn } from "next-auth/webauthn"\` instead.`);let u=`${c}/${"credentials"===d?"callback":"signin"}/${e}`,h=await D(),p=await fetch(`${u}?${new URLSearchParams(s)}`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...i,csrfToken:h,callbackUrl:o})}),y=await p.json();if(a){let e=y.url??o;window.location.href=e,e.includes("#")&&window.location.reload();return}let w=new URL(y.url).searchParams.get("error")??void 0,g=new URL(y.url).searchParams.get("code")??void 0;return p.ok&&await J._getSession({event:"storage"}),{error:w,code:g,status:p.status,ok:p.ok,url:w?null:y.url}}async function G(e){let{redirect:t=!0,redirectTo:s=e?.callbackUrl??window.location.href}=e??{},n=j(J),r=await D(),a=await fetch(`${n}/signout`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({csrfToken:r,callbackUrl:s})}),o=await a.json();if((null===z&&(z="u"<typeof BroadcastChannel?{postMessage:()=>{},addEventListener:()=>{},removeEventListener:()=>{},name:"next-auth",onmessage:null,onmessageerror:null,close:()=>{},dispatchEvent:()=>!1}:new BroadcastChannel("next-auth")),z).postMessage({event:"session",data:{trigger:"signout"}}),t){let e=o.url??s;window.location.href=e,e.includes("#")&&window.location.reload();return}return await J._getSession({event:"storage"}),o}n.createContext?.(void 0)},79748:(e,t,s)=>{var n=s(79796);s.o(n,"useParams")&&s.d(t,{useParams:function(){return n.useParams}}),s.o(n,"usePathname")&&s.d(t,{usePathname:function(){return n.usePathname}}),s.o(n,"useRouter")&&s.d(t,{useRouter:function(){return n.useRouter}}),s.o(n,"useSearchParams")&&s.d(t,{useSearchParams:function(){return n.useSearchParams}})}}]);