1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8174],{25566:function(e){var t,n,s,r=e.exports={};function o(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var c=[],l=!1,u=-1;function d(){l&&s&&(l=!1,s.length?c=s.concat(c):u=-1,c.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(s=c,c=[];++u<t;)s&&s[u].run();u=-1,t=c.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||l||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw Error("process.chdir is not supported")},r.umask=function(){return 0}},98174:function(e,t,n){"use strict";n.d(t,{eA:function(){return ei},Gg:function(){return er},kP:function(){return es}});var s,r,o,i,a,c=n(57437),l=n(2265),u=n.t(l,2);class d 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);let n=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${n}`}}class h extends d{}h.kind="signIn";class f extends d{}f.type="AdapterError";class p extends d{}p.type="AccessDenied";class v extends d{}v.type="CallbackRouteError";class y extends d{}y.type="ErrorPageLoop";class g extends d{}g.type="EventError";class E extends d{}E.type="InvalidCallbackUrl";class m extends h{constructor(){super(...arguments),this.code="credentials"}}m.type="CredentialsSignin";class w extends d{}w.type="InvalidEndpoints";class x extends d{}x.type="InvalidCheck";class S extends d{}S.type="JWTSessionError";class b extends d{}b.type="MissingAdapter";class T extends d{}T.type="MissingAdapterMethods";class _ extends d{}_.type="MissingAuthorize";class L extends d{}L.type="MissingSecret";class A extends h{}A.type="OAuthAccountNotLinked";class k extends h{}k.type="OAuthCallbackError";class U extends d{}U.type="OAuthProfileParseError";class C extends d{}C.type="SessionTokenError";class R extends h{}R.type="OAuthSignInError";class N extends h{}N.type="EmailSignInError";class P extends d{}P.type="SignOutError";class I extends d{}I.type="UnknownAction";class M extends d{}M.type="UnsupportedStrategy";class O extends d{}O.type="InvalidProvider";class H extends d{}H.type="UntrustedHost";class X extends d{}X.type="Verification";class W extends h{}W.type="MissingCSRF";class j extends d{}j.type="DuplicateConditionalUI";class V extends d{}V.type="MissingWebAuthnAutocomplete";class $ extends d{}$.type="WebAuthnVerificationError";class D extends h{}D.type="AccountNotLinked";class F extends d{}F.type="ExperimentalFeatureNotEnabled";class B extends d{}class J extends d{}async function q(e,t,n){var s;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o="".concat("undefined"==typeof window?"".concat(t.baseUrlServer).concat(t.basePathServer):t.basePath,"/").concat(e);try{let e={headers:{"Content-Type":"application/json",...(null==r?void 0:null===(s=r.headers)||void 0===s?void 0:s.cookie)?{cookie:r.headers.cookie}:{}}};(null==r?void 0:r.body)&&(e.body=JSON.stringify(r.body),e.method="POST");let t=await fetch(o,e),n=await t.json();if(!t.ok)throw n;return n}catch(e){return n.error(new B(e.message,e)),null}}function z(){return Math.floor(Date.now()/1e3)}function G(e){let t=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e="https://".concat(e));let n=new URL(e||t),s=("/"===n.pathname?t.pathname:n.pathname).replace(/\/$/,""),r="".concat(n.origin).concat(s);return{origin:n.origin,host:n.host,path:s,base:r,toString:()=>r}}var K=n(25566);
1let Q={baseUrl:G(null!==(r=K.env.NEXTAUTH_URL)&&void 0!==r?r:K.env.VERCEL_URL).origin,basePath:G(K.env.NEXTAUTH_URL).path,baseUrlServer:G(null!==(i=null!==(o=K.env.NEXTAUTH_URL_INTERNAL)&&void 0!==o?o:K.env.NEXTAUTH_URL)&&void 0!==i?i:K.env.VERCEL_URL).origin,basePathServer:G(null!==(a=K.env.NEXTAUTH_URL_INTERNAL)&&void 0!==a?a:K.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:()=>{}},Y=null;function Z(){return new BroadcastChannel("next-auth")}function ee(){return"undefined"==typeof BroadcastChannel?{postMessage:()=>{},addEventListener:()=>{},removeEventListener:()=>{}}:(null===Y&&(Y=Z()),Y)}let et={debug:console.debug,error:console.error,warn:console.warn},en=null===(s=l.createContext)||void 0===s?void 0:s.call(u,void 0);function es(e){if(!en)throw Error("React Context is unavailable in Server Components");let t=l.useContext(en),{required:n,onUnauthenticated:s}=null!=e?e:{},r=n&&"unauthenticated"===t.status;return(l.useEffect(()=>{if(r){let e="".concat(Q.basePath,"/signin?").concat(new URLSearchParams({error:"SessionRequired",callbackUrl:window.location.href}));s?s():window.location.href=e}},[r,s]),r)?{data:t.data,update:t.update,status:"loading"}:t}async function er(e){var t;let n=await q("session",Q,et,e);return(null===(t=null==e?void 0:e.broadcast)||void 0===t||t)&&Z().postMessage({event:"session",data:{trigger:"getSession"}}),n}async function eo(){var e;let t=await q("csrf",Q,et);return null!==(e=null==t?void 0:t.csrfToken)&&void 0!==e?e:""}function ei(e){if(!en)throw Error("React Context is unavailable in Server Components");let{children:t,basePath:n,refetchInterval:s,refetchWhenOffline:r}=e;n&&(Q.basePath=n);let o=void 0!==e.session;Q._lastSync=o?z():0;let[i,a]=l.useState(()=>(o&&(Q._session=e.session),e.session)),[u,d]=l.useState(!o);l.useEffect(()=>(Q._getSession=async function(){let{event:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t="storage"===e;if(t||void 0===Q._session){Q._lastSync=z(),Q._session=await er({broadcast:!t}),a(Q._session);return}if(!e||null===Q._session||z()<Q._lastSync)return;Q._lastSync=z(),Q._session=await er(),a(Q._session)}catch(e){et.error(new J(e.message,e))}finally{d(!1)}},Q._getSession(),()=>{Q._lastSync=0,Q._session=void 0,Q._getSession=()=>{}}),[]),l.useEffect(()=>{let e=()=>Q._getSession({event:"storage"});return ee().addEventListener("message",e),()=>ee().removeEventListener("message",e)},[]),l.useEffect(()=>{let{refetchOnWindowFocus:t=!0}=e,n=()=>{t&&"visible"===document.visibilityState&&Q._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",n,!1),()=>document.removeEventListener("visibilitychange",n,!1)},[e.refetchOnWindowFocus]);let h=function(){let[e,t]=l.useState("undefined"!=typeof navigator&&navigator.onLine),n=()=>t(!0),s=()=>t(!1);return l.useEffect(()=>(window.addEventListener("online",n),window.addEventListener("offline",s),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}),[]),e}(),f=!1!==r||h;l.useEffect(()=>{if(s&&f){let e=setInterval(()=>{Q._session&&Q._getSession({event:"poll"})},1e3*s);return()=>clearInterval(e)}},[s,f]);let p=l.useMemo(()=>({data:i,status:u?"loading":i?"authenticated":"unauthenticated",async update(e){if(u)return;d(!0);let t=await q("session",Q,et,void 0===e?void 0:{body:{csrfToken:await eo(),data:e}});return d(!1),t&&(a(t),ee().postMessage({event:"session",data:{trigger:"getSession"}})),t}}),[i,u]);return(0,c.jsx)(en.Provider,{value:p,children: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.