1import{a as ot,c as b,j as C,r as $t}from"./jsx-runtime-14KtCSxy.js";import{a as Ge}from"./ButtonLink-Bg8SqcGh.js";import{I as Bt}from"./Input-H4E6Dyqy.js";import{c as Ht}from"./clsx.m-DA9ukLFQ.js";import{w as z,x as V,y as Gt,z as Kt,A as ct,B as Ue,C as Wt,D as ee,E as Vt,G as W,H as Xt,I as Pe,J as Jt,K as Yt,O as Zt,P as Ke,Q as We,T as Qt,U as lt,V as qt,W as er,X as tr,Y as rr,Z as nr,$ as ar,a as ir,u as sr,L as me,F as or}from"./components-C2BWCaPK.js";import{m as cr,U as Le,i as re,x as ut,E as lr,Q as ur,s as fr,S as hr,u as dr}from"./index-BfOmNH0v.js";import{c as mr}from"./_commonjs-dynamic-modules-DA79aZ09.js";import{a as q,z as Ve}from"./index-B5ygDT9-.js";import{u as ft}from"./useTranslation-CF0HNLUl.js";import{a as pr}from"./Logo-CWgQ9grt.js";import{C as gr}from"./CheckCircleIcon-OBN0doJ2.js";import"./bundle-mjs-BtiZuLA3.js";import"./ArrowLeftIcon-BvpnTDjW.js";import"./ArrowRightIcon--tgZy0dO.js";import"./es-ceVWLxS5.js";import"./context-DFNnvB2G.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;
1n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="42e03805-16dc-4415-9061-590d92ac3c7f",t._sentryDebugIdIdentifier="sentry-dbid-42e03805-16dc-4415-9061-590d92ac3c7f")}catch{}})();/*! 2 * cookie 3 * Copyright(c) 2012-2014 Roman Shtylman 4 * Copyright(c) 2015 Douglas Christopher Wilson 5 * MIT Licensed 6 */var yr=_r,vr=br,wr=Object.prototype.toString,Z=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function _r(t,n){if(typeof t!="string")throw new TypeError("argument str must be a string");for(var e={},r=n||{},a=r.decode||Sr,i=0;i<t.length;){var s=t.indexOf("=",i);if(s===-1)break;var o=t.indexOf(";",i);if(o===-1)o=t.length;else if(o<s){i=t.lastIndexOf(";",s-1)+1;continue}var l=t.slice(i,s).trim();if(e[l]===void 0){var f=t.slice(s+1,o).trim();f.charCodeAt(0)===34&&(f=f.slice(1,-1)),e[l]=xr(f,a)}i=o+1}return e}function br(t,n,e){var r=e||{},a=r.encode||Cr;if(typeof a!="function")throw new TypeError("option encode is invalid");if(!Z.test(t))throw new TypeError("argument name is invalid");var i=a(n);if(i&&!Z.test(i))throw new TypeError("argument val is invalid");var s=t+"="+i;if(r.maxAge!=null){var o=r.maxAge-0;if(isNaN(o)||!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(o)}if(r.domain){if(!Z.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!Z.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var l=r.expires;if(!Rr(l)||isNaN(l.valueOf()))throw new TypeError("option expires is invali
6d");s+="; Expires="+l.toUTCString()}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.partitioned&&(s+="; Partitioned"),r.priority){var f=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(f){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var c=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function Sr(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function Cr(t){return encodeURIComponent(t)}function Rr(t){return wr.call(t)==="[object Date]"||t instanceof Date}function xr(t,n){try{return n(t)}catch{return t}}/** 7 * @remix-run/server-runtime v2.11.0 8 * 9 * Copyright (c) Remix Software Inc. 10 * 11 * This source code is licensed under the MIT license found in the 12 * LICENSE.md file in the root directory of this source tree. 13 * 14 * @license MIT 15 */const Xe={};function ht(t,n){!t&&!Xe[n]&&(Xe[n]=!0,console.warn(n))}/** 16 * @remix-run/server-runtime v2.11.0 17 * 18 * Copyright (c) Remix Software Inc. 19 * 20 * This source code is licensed under the MIT license found in the 21 * LICENSE.md file in the root directory of this source tree. 22 * 23 * @license MIT 24 */const kr=({sign:t,unsign:n})=>(e,r={})=>{let{secrets:a=[],...i}={path:"/",sameSite:"lax",...r};return Pr(e,i.expires),{get name(){return e},get isSigned(){return a.length>0},get expires(){return typeof i.maxAge<"u"?new Date(Date.now()+i.maxAge*1e3):i.expires},async parse(s,o){if(!s)return null;let l=yr(s,{...i,...o});return e in l?l[e]===""?"":await Lr(n,l[e],a):null},async serialize(s,o){return vr(e,s===""?"":await Ur(t,s,a),{...i,...o})}}},Fe=t=>t!=null&&typeof t.name=="string"&&typeof t.isSigned=="boolean"&&typeof t.parse=="function"&&typeof t.serialize=="function";async function Ur(t,n,e){let r=Er(n);return e.length>0&&(r=await t(r,e[0])),r}async function Lr(t,n,e){if(e.length>0){for(let r of e){let a=await t(n,r);if(a!==!1)return Je(a)}return null}return Je(n)}function Er(t){return btoa(Or(encodeURIComponent(JSON.stringify(t))))}function Je(t){try{return JSON.parse(decodeURIComponent(Ar(atob(t))))}catch{return{}}}function Ar(t){let n=t.toString(),e="",r=0,a,i;for(;r<n.length;)a=n.charAt(r++),/[\w*+\-./@]/.exec(a)?e+=a:(i=a.charCodeAt(0),i<256?e+="%"+Ye(i,2):e+="%u"+Ye(i,4).toUpperCase());return e}function Ye(t,n){let e=t.toString(16);for(;e.length<n;)e="0"+e;return e}function Or(t){let n=t.toString(),e="",r=0,a,i;for(;r<n.length;){if(a=n.charAt(r++),a==="%"){if(n.charAt(r)==="u"){if(i=n.slice(r+1,r+5),/^[\da-f]{4}$/i.exec(i)){e+=String.fromCharCode(parseInt(i,16)),r+=5;continue}}else if(i=n.slice(r,r+2),/^[\da-f]{2}$/i.exec(i)){e+=String.fromCharCode(parseInt(i,16)),r+=2;continue}}e+=a}return e}function Pr(t,n){ht(!n,`The "${t}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`)}function ne(t){const n=unescape(encodeURIComponent(t));return Uint8Array.from(n,(e,r)=>n.charCodeAt(r))}function Fr(t){const n=String.fromCharCode.apply(null,t);return decodeURIComponent(escape(n))}function te(...t){const n=new Uint8Array(t.reduce((r,a)=>r+a.length,0));let e=0;for(const r of t)n.set(r,e),e+=r.length;return n}function jr(t,n){if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==n[e])return!1;return!0}function Ze(t){return t instanceof Uint8Array?n=>t[n]:t}function pe(t,n,e,r,a){const i=Ze(t),s=Ze(e);for(let o=0;o<a;++o)if(i(n+o)!==s(r+o))return!1;return!0}function Tr(t){const n=new Array(256).fill(t.length);if(t.length>1)for(let e=0;e<t.length-1;e++)n[t[e]]=t.length-1-e;return n}const D=Symbol("Match");class je{constructor(n){this._lookbehind=new Uint8Array,typeof n=="string"?this._needle=n=ne(n):this._needle=n,this._lastChar=n[n.length-1],this._occ=Tr(n)}feed(n){let e=0,r;const a=[];for(;e!==n.length;)[e,...r]=this._feed(n,e),a.push(...r);return a}end(){const n=this._lookbehind;return this._lookbehind=new Uint8Array,n}_feed(n,e){const r=[];let a=-this._lookbehind.length;if(a<0){for(;a<0&&a<=n.length-this._needle.length;){const i=this._charAt(n,a+this._needle.length-1);if(i===this._lastChar&&this._memcmp(n,a,this._needle.length-1))return a>-this._lookbehind.length&&r.push(this._lookbehind.slice(0,this._lookbehind.length+a)),r.push(D),this._lookbehind=new Uint8Array,[a+this._needle.length,...r];a+=this._occ[i]}
24if(a<0)for(;a<0&&!this._memcmp(n,a,n.length-a);)a++;if(a>=0)r.push(this._lookbehind),this._lookbehind=new Uint8Array;else{const i=this._lookbehind.length+a;return i>0&&(r.push(this._lookbehind.slice(0,i)),this._lookbehind=this._lookbehind.slice(i)),this._lookbehind=Uint8Array.from(new Array(this._lookbehind.length+n.length),(s,o)=>this._charAt(n,o-this._lookbehind.length)),[n.length,...r]}}for(a+=e;a<=n.length-this._needle.length;){const i=n[a+this._needle.length-1];if(i===this._lastChar&&n[a]===this._needle[0]&&pe(this._needle,0,n,a,this._needle.length-1))return a>e&&r.push(n.slice(e,a)),r.push(D),[a+this._needle.length,...r];a+=this._occ[i]}if(a<n.length){for(;a<n.length&&(n[a]!==this._needle[0]||!pe(n,a,this._needle,0,n.length-a));)++a;a<n.length&&(this._lookbehind=n.slice(a))}return a>0&&r.push(n.slice(e,a<n.length?a:n.length)),[n.length,...r]}_charAt(n,e){return e<0?this._lookbehind[this._lookbehind.length+e]:n[e]}_memcmp(n,e,r){return pe(this._charAt.bind(this,n),e,this._needle,0,r)}}class Dr{constructor(n,e){this._readableStream=e,this._search=new je(n)}async*[Symbol.asyncIterator](){const n=this._readableStream.getReader();try{for(;;){const r=await n.read();if(r.done)break;yield*this._search.feed(r.value)}const e=this._search.end();e.length&&(yield e)}finally{n.releaseLock()}}}const Mr=Function.prototype.apply.bind(te,void 0),dt=ne("--"),K=ne(`\r 25`);function zr(t){const n=t.split(";").map(r=>r.trim());if(n.shift()!=="form-data")throw new Error('malformed content-disposition header: missing "form-data" in `'+JSON.stringify(n)+"`");const e={};for(const r of n){const a=r.split("=",2);if(a.length!==2)throw new Error("malformed content-disposition header: key-value pair not found - "+r+" in `"+t+"`");const[i,s]=a;if(s[0]==='"'&&s[s.length-1]==='"')e[i]=s.slice(1,-1).replace(/\\"/g,'"');else if(s[0]!=='"'&&s[s.length-1]!=='"')e[i]=s;else if(s[0]==='"'&&s[s.length-1]!=='"'||s[0]!=='"'&&s[s.length-1]==='"')throw new Error("malformed content-disposition header: mismatched quotations in `"+t+"`")}if(!e.name)throw new Error("malformed content-disposition header: missing field name in `"+t+"`");return e}function Ir(t){const n=[];let e=!1,r;for(;typeof(r=t.shift())<"u";){const a=r.indexOf(":");if(a===-1)throw new Error("malformed multipart-form header: missing colon");const i=r.slice(0,a).trim().toLowerCase(),s=r.slice(a+1).trim();switch(i){case"content-disposition":e=!0,n.push(...Object.entries(zr(s)));break;case"content-type":n.push(["contentType",s])}}if(!e)throw new Error("malformed multipart-form header: missing content-disposition");return Object.fromEntries(n)}async function Nr(t,n){let e=!0,r=!1;const a=[[]],i=new je(K);for(;;){const s=await t.next();if(s.done)throw new Error("malformed multipart-form data: unexpected end of stream");if(e&&s.value!==D&&jr(s.value.slice(0,2),dt))return[void 0,new Uint8Array];let o;if(s.value!==D)o=s.value;else if(!r)o=n;else throw new Error("malformed multipart-form data: unexpected boundary");if(!o.length)continue;e&&(e=!1);const l=i.feed(o);for(const[f,c]of l.entries()){const d=c===D;if(!(!d&&!c.length)){if(r&&d)return l.push(i.end()),[a.filter(u=>u.length).map(Mr).map(Fr),te(...l.slice(f+1).map(u=>u===D?K:u))];(r=d)?a.push([]):a[a.length-1].push(c)}}}}async function*$r(t,n){const e=te(dt,ne(n)),r=new Dr(e,t)[Symbol.asyncIterator]();for(;;){const i=await r.next();if(i.done)return;if(i.value===D)break}const a=new je(K);for(;;){let f=function(m){const v=[];for(const g of a.feed(m))l&&v.push(K),(l=g===D)||v.push(g);return te(...v)};const[i,s]=await Nr(r,e);if(!i)return;async function o(){const m=await r.next();if(m.done)throw new Error("malformed multipart-form data: unexpected end of stream");return m}let l=!1,c=!1;async function d(){const m=await o();let v;if(m.value!==D)v=m.value;else if(!l)v=K;else return c=!0,{value:a.end()};return{value:f(v)}}const u=[{value:f(s)}];for(yield{...Ir(i),data:{[Symbol.asyncIterator](){return this},async next(){for(;;){const m=u.shift();if(!m)break;if(m.value.length>0)return m}for(;;){if(c)return{done:c,value:void 0};const m=await d();if(m.value.length>0)return m}}}};!c;)u.push(await d())}}/** 26 * @remix-run/server-runtime v2.11.0 27 * 28 * Copyright (c) Remix Software Inc. 29 * 30 * This source code is licensed under the MIT license found in the 31 * LICENSE.md file in the root directory of this source tree. 32 * 33 * @license MIT 34 */function Br(...t){return async n=>{for(let e of t){let r=await e(n);if(typeof r<"u"&&r!==null)return r}}}async function Hr(t,n){let e=t.headers.get("Content-Type")||"",[r,a]=e.split(/\s*;\s*boundary=/);if(!t.body||!a||r!=="multipart/form-data")throw new TypeError("Could not parse content as FormData.");let i=new FormData,s=$r(t.body,a);for await(let o of s){if(o.done)break;typeof o.filename=="string"&&(o.filename=o.filename.split(/[/\\]/).pop());let l=await n(o);typeof l<"u"&&l!==null&&i.append(o.name,l)}return i}/** 35 * @remix-run/server-runtime v2.11.0 36 * 37 * Copyright (c) Remix Software Inc. 38 * 39 * This source code is licensed under the MIT license found in the 40 * LICENSE.md file in the root directory of this source tree. 41 * 42 * @license MIT 43 */function Gr(t){return Object.keys(t).reduce((n,e)=>(n[e]=t[e].module,n),{})}/** 44 * @remix-run/server-runtime v2.11.0 45 * 46 * Copyright (c) Remix Software Inc. 47 * 48 * This source code is licensed under the MIT license found in the 49 * LICENSE.md file in the root directory of this source tree. 50 * 51 * @license MIT 52 */function Qe(t,n){if(t===!1||t===null||typeof t>"u")throw console.error("The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new"),new Error(n)}/** 53 * @remix-run/server-runtime v2.11.0 54 * 55 * Copyright (c) Remix Software Inc. 56 * 57 * This source code is licensed under the MIT license found in the 58 * LICENSE.md file in the root directory of this source tree. 59 * 60 * @license MIT 61 */function Ee(t,n,e){let r=cr(t,n,e);return r?r.map(a=>({params:a.params,pathname:a.pathname,route:a.route})):null}/** 62 * @remix-run/server-runtime v2.11.0 63 * 64 * Copyright (c) Remix Software Inc. 65 * 66 * This source code is licensed under the MIT license found in the 67 * LICENSE.md file in the root directory of this source tree. 68 * 69 * @license MIT 70 */async function Kr({loadContext:t,action:n,params:e,request:r,routeId:a,singleFetch:i}){let s=await n({request:pt(mt(r)),context:t,params:e});if(s===void 0)throw new Error(`You defined an action for route "${a}" but didn't return anything from your \`action\` function. Please return a value or \`null\`.`);return i||z(s)?s:V(s)}async function Wr({loadContext:t,loader:n,params:e,request:r,routeId:a,singleFetch:i}){let s=await n({request:pt(mt(r)),context:t,params:e});if(s===void 0)throw new Error(`You defined a loader for route "${a}" but didn't return anything from your \`loader\` function. Please return a value or \`null\`.`);return Gt(s)?s.init&&Kt(s.init.status||200)?ct(new Headers(s.init.headers).get("Location"),s.init):s:i||z(s)?s:V(s)}function mt(t){let n=new URL(t.url),e=n.searchParams.getAll("index");n.searchParams.delete("index");let r=[];for(let i of e)i&&r.push(i);for(let i of r)n.searchParams.append("index",i);let a={method:t.method,body:t.body,headers:t.headers,signal:t.signal};
70return a.body&&(a.duplex="half"),new Request(n.href,a)}function pt(t){let n=new URL(t.url);n.searchParams.delete("_data");let e={method:t.method,body:t.body,headers:t.headers,signal:t.signal};return e.body&&(e.duplex="half"),new Request(n.href,e)}/** 71 * @remix-run/server-runtime v2.11.0 72 * 73 * Copyright (c) Remix Software Inc. 74 * 75 * This source code is licensed under the MIT license found in the 76 * LICENSE.md file in the root directory of this source tree. 77 * 78 * @license MIT 79 */function gt(t){let n={};return Object.values(t).forEach(e=>{let r=e.parentId||"";n[r]||(n[r]=[]),n[r].push(e)}),n}function yt(t,n="",e=gt(t)){return(e[n]||[]).map(r=>({...r,children:yt(t,r.id,e)}))}function vt(t,n,e="",r=gt(t)){return(r[e]||[]).map(a=>{let i={hasErrorBoundary:a.id==="root"||a.module.ErrorBoundary!=null,id:a.id,path:a.path,loader:a.module.loader?(s,o)=>Wr({request:s.request,params:s.params,loadContext:s.context,loader:a.module.loader,routeId:a.id,singleFetch:n.unstable_singleFetch===!0}):void 0,action:a.module.action?(s,o)=>Kr({request:s.request,params:s.params,loadContext:s.context,action:a.module.action,routeId:a.id,singleFetch:n.unstable_singleFetch===!0}):void 0,handle:a.module.handle};return a.index?{index:!0,...i}:{caseSensitive:a.caseSensitive,children:vt(t,n,a.id,r),...i}})}/** 80 * @remix-run/server-runtime v2.11.0 81 * 82 * Copyright (c) Remix Software Inc. 83 * 84 * This source code is licensed under the MIT license found in the 85 * LICENSE.md file in the root directory of this source tree. 86 * 87 * @license MIT 88 */const Vr={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Xr=/[&><\u2028\u2029]/g;function Jr(t){return t.replace(Xr,n=>Vr[n])}/** 89 * @remix-run/server-runtime v2.11.0 90 * 91 * Copyright (c) Remix Software Inc. 92 * 93 * This source code is licensed under the MIT license found in the 94 * LICENSE.md file in the root directory of this source tree. 95 * 96 * @license MIT 97 */function qe(t){return Jr(JSON.stringify(t))}var Yr={};/** 98 * @remix-run/server-runtime v2.11.0 99 * 100 * Copyright (c) Remix Software Inc. 101 * 102 * This source code is licensed under the MIT license found in the 103 * LICENSE.md file in the root directory of this source tree. 104 * 105 * @license MIT 106 */async function Zr(t,n){if(n??(n=Yr.REMIX_DEV_ORIGIN),!n)throw Error("Dev server origin not set");let e=new URL(n);e.pathname="ping";let r=await fetch(e.href,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({buildHash:t.assets.version})}).catch(a=>{throw console.error(`Could not reach Remix dev server at ${e}`),a});if(!r.ok)throw console.error(`Could not reach Remix dev server at ${e} (${r.status})`),Error(await r.text())}function Qr(t){console.log(`[REMIX DEV] ${t.assets.version} ready`)}const wt="__remix_devServerHooks";function qr(t){globalThis[wt]=t}function et(){return globalThis[wt]}/** 107 * @remix-run/server-runtime v2.11.0 108 * 109 * Copyright (c) Remix Software Inc. 110 * 111 * This source code is licensed under the MIT license found in the 112 * LICENSE.md file in the root directory of this source tree. 113 * 114 * @license MIT 115 */function en(t,n){return`â ï¸ REMIX FUTURE CHANGE: Resource routes will no longer be able to return raw JavaScript objects in v3 when Single Fetch becomes the default. You can prepare for this change at your convenience by wrapping the data returned from your \`${t}\` function in the \`${n}\` route with \`json()\`. For instructions on making this change see https://remix.run/docs/en/v2.9.2/guides/single-fetch#resource-routes`}/** 116 * @remix-run/server-runtime v2.11.0 117 * 118 * Copyright (c) Remix Software Inc. 119 * 120 * This source code is licensed under the MIT license found in the 121 * LICENSE.md file in the root directory of this source tree. 122 * 123 * @license MIT 124 */function tt(t,n){var e,r;let a=yt(t.routes),i=vt(t.routes,t.future),s=Qt(n)?n:W.Production,o=hr(i,{basename:t.basename,future:{v7_relativeSplatPath:((e=t.future)===null||e===void 0?void 0:e.v3_relativeSplatPath)===!0,v7_throwAbortReason:((r=t.future)===null||r===void 0?void 0:r.v3_throwAbortReason)===!0}}),l=t.entry.module.handleError||((f,{request:c})=>{s!==W.Test&&!c.signal.aborted&&console.error(re(f)&&f.error?f.error:f)});return{routes:a,dataRoutes:i,serverMode:s,staticHandler:o,errorHandler:l}}const tn=(t,n)=>{let e,r,a,i,s;return async function(l,f={}){if(e=typeof t=="function"?await t():t,n??(n=e.mode),typeof t=="function"){let h=tt(e,n);r=h.routes,a=h.serverMode,i=h.staticHandler,s=h.errorHandler}else if(!r||!a||!i||!s){let h=tt(e,n);r=h.routes,a=h.serverMode,i=h.staticHandler,s=h.errorHandler}let c=new URL(l.url),d={},u=h=>{if(n===W.Development){var p,w;(p=et())===null||p===void 0||(w=p.processRequestError)===null||w===void 0||w.call(p,h)}s(h,{context:f,params:d,request:l})},m=`${e.basename??"/"}/__manifest`.replace(/\/+/g,"/");if(c.pathname===m)try{return await rn(e,r,c)}catch(h){return u(h),new Response("Unknown Server Error",{status:500})}let v=Ee(r,c.pathname,e.basename);v&&v.length>0&&Object.assign(d,v[0].params);let g;if(c.searchParams.has("_data")){e.future.unstable_singleFetch&&u(new Error("Warning: Single fetch-enabled apps should not be making ?_data requests, this is likely to break in the future"));let h=c.searchParams.get("_data");g=await nn(a,e,i,h,l,f,u),e.entry.module.handleDataRequest&&(g=await e.entry.module.handleDataRequest(g,{context:f,params:d,request:l}),Ue(g)&&(g=St(g,e.basename)))}else if(e.future.unstable_singleFetch&&c.pathname.endsWith(".data")){let h=new URL(l.url);h.pathname=h.pathname.replace(/\.data$/,"").replace(/^\/_root$/,"/");let p=Ee(r,h.pathname,e.basename);if(g=await an(a,e,i,l,h,f,u),e.entry.module.handleDataRequest&&(g=await e.entry.module.handleDataRequest(g,{context:f,params:p?p[0].params:{},request:l}),Ue(g))){let w=Wt(g.status,g.headers);l.method==="GET"&&(w={[lt]:w});let S=new Headers(g.headers);return S.set("Content-Type","text/x-turbo"),new Response(ee(w,l.signal,e.entry.module.streamTimeout,a),{status:Vt,headers:S})}}else if(v&&v[v.length-1].route.module.default==null&&v[v.length-1].route.module.ErrorBoundary==null)g=await on(a,e,i,v.slice(-1)[0].route.id,l,f,u);else{var y,_;let h=n===W.Development?await((y=et())===null||y===void 0||(_=y.getCriticalCss)===null||_===void 0?void 0:_.call(y,e,c.pathname)):void 0;g=await sn(a,e,i,l,f,u,h)}return l.method==="HEAD"?new Response(null,{headers:g.headers,status:g.status,statusText:g.statusText}):g}};async function rn(t,n,e){let r={patches:{},notFoundPaths:[]};if(e.searchParams.has("p")){for(let a of e.searchParams.getAll("p")){let i=Ee(n,a,t.basename);if(i)for(let s of i){let o=s.route.id;r.patches[o]=t.assets.routes[o]}else r.notFoundPaths.push(a)}return V(r,{headers:{"Cache-Control":"public, max-age=31536000, immutable"}})}return new Response("Invalid Request",{status:400})}async function nn(t,n,e,r,a,i,s){try{let o=await e.queryRoute(a,{routeId:r,requestContext:i});if(Ue(o))return St(o,n.basename);if(Le in o){let l=o[Le],f=Xt(l,a.signal,t),c=l.init||{},d=new Headers(c.headers);return d.set("Content-Type","text/remix-deferred"),d.set("X-Remix-Response","yes"),c.headers=d,new Response(f,c)}return o=Ae(o,"X-Remix-Response","yes"),o}catch(o){if(z(o))return Ae(o,"X-Remix-Catch","yes");if(re(o))return s(o),_t(o,t);let l=o instanceof Error||o instanceof DOMException?o:new Error("Unexpected Server Error");return s(l),ut(Pe(l,t),{status:500,headers:{"X-Remix-Error":"yes"}})}}async function an(t,n,e,r,a,i,s){let{result:o,headers:l,status:f}=r.method!=="GET"?await Jt(n,t,e,r,a,i,s):await Yt(n,t,e,r,a,i,s),c=new Headers(l);return c.set("X-Remix-Response","yes"),c.set("Content-Type","text/x-turbo"),new Response(ee(o,r.signal,n.entry.module.streamTimeout,t),{status:f||200,headers:c})}async function sn(t,n,e,r,a,i,s){let o;try{o=await e.query(r,{requestContext:a})}catch(u){return i(u),new Response(null,{status:500})}if(z(o))return o;let l=Zt(n,o);
124o.errors&&(Object.values(o.errors).forEach(u=>{(!re(u)||u.error)&&i(u)}),o.errors=Ke(o.errors,t));let f={loaderData:o.loaderData,actionData:o.actionData,errors:We(o.errors,t)},c={manifest:n.assets,routeModules:Gr(n.routes),staticHandlerContext:o,criticalCss:s,serverHandoffString:qe({ssrMatches:o.matches.map(u=>u.route.id),basename:n.basename,criticalCss:s,future:n.future,isSpaMode:n.isSpaMode,...n.future.unstable_singleFetch?null:{state:f}}),...n.future.unstable_singleFetch?{serverHandoffStream:ee(f,r.signal,n.entry.module.streamTimeout,t),renderMeta:{}}:null,future:n.future,isSpaMode:n.isSpaMode,serializeError:u=>Pe(u,t)},d=n.entry.module.default;try{return await d(r,o.statusCode,l,c,a)}catch(u){i(u);let m=u;if(z(u))try{let g=await cn(u);m=new lr(u.status,u.statusText,g)}catch{}o=ur(e.dataRoutes,o,m),o.errors&&(o.errors=Ke(o.errors,t));let v={loaderData:o.loaderData,actionData:o.actionData,errors:We(o.errors,t)};c={...c,staticHandlerContext:o,serverHandoffString:qe({ssrMatches:o.matches.map(g=>g.route.id),basename:n.basename,future:n.future,isSpaMode:n.isSpaMode,...n.future.unstable_singleFetch?null:{state:v}}),...n.future.unstable_singleFetch?{serverHandoffStream:ee(v,r.signal,n.entry.module.streamTimeout,t),renderMeta:{}}:null};try{return await d(r,o.statusCode,l,c,a)}catch(g){return i(g),bt(g,t)}}}async function on(t,n,e,r,a,i,s){try{let o=await e.queryRoute(a,{routeId:r,requestContext:i});return typeof o=="object"&&o!==null&&Qe(!(Le in o),`You cannot return a \`defer()\` response from a Resource Route. Did you forget to export a default UI component from the "${r}" route?`),n.future.unstable_singleFetch&&!z(o)&&(console.warn(en(a.method==="GET"?"loader":"action",r)),o=V(o)),Qe(z(o),"Expected a Response to be returned from queryRoute"),o}catch(o){return z(o)?Ae(o,"X-Remix-Catch","yes"):re(o)?(o&&s(o),_t(o,t)):(s(o),bt(o,t))}}function _t(t,n){return ut(Pe(t.error||new Error("Unexpected Server Error"),n),{status:t.status,statusText:t.statusText,headers:{"X-Remix-Error":"yes"}})}function bt(t,n){let e="Unexpected Server Error";return n!==W.Production&&(e+=` 125 126${String(t)}`),new Response(e,{status:500,headers:{"Content-Type":"text/plain"}})}function cn(t){let n=t.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?t.body==null?null:t.json():t.text()}function St(t,n){let e=new Headers(t.headers),r=e.get("Location");return e.set("X-Remix-Redirect",n&&fr(r,n)||r),e.set("X-Remix-Status",String(t.status)),e.delete("Location"),t.headers.get("Set-Cookie")!==null&&e.set("X-Remix-Revalidate","yes"),new Response(null,{status:204,headers:e})}function Ae(t,n,e){let r=new Headers(t.headers);return r.set(n,e),new Response(t.body,{status:t.status,statusText:t.statusText,headers:r,duplex:t.body?"half":void 0})}/** 127 * @remix-run/server-runtime v2.11.0 128 * 129 * Copyright (c) Remix Software Inc. 130 * 131 * This source code is licensed under the MIT license found in the 132 * LICENSE.md file in the root directory of this source tree. 133 * 134 * @license MIT 135 */function ge(t){return`__flash_${t}__`}const Te=(t={},n="")=>{let e=new Map(Object.entries(t));return{get id(){return n},get data(){return Object.fromEntries(e)},has(r){return e.has(r)||e.has(ge(r))},get(r){if(e.has(r))return e.get(r);let a=ge(r);if(e.has(a)){let i=e.get(a);return e.delete(a),i}},set(r,a){e.set(r,a)},flash(r,a){e.set(ge(r),a)},unset(r){e.delete(r)}}},ln=t=>t!=null&&typeof t.id=="string"&&typeof t.data<"u"&&typeof t.has=="function"&&typeof t.get=="function"&&typeof t.set=="function"&&typeof t.flash=="function"&&typeof t.unset=="function",un=t=>({cookie:n,createData:e,readData:r,updateData:a,deleteData:i})=>{let s=Fe(n)?n:t((n==null?void 0:n.name)||"__session",n);return Ct(s),{async getSession(o,l){let f=o&&await s.parse(o,l),c=f&&await r(f);return Te(c||{},f||"")},async commitSession(o,l){let{id:f,data:c}=o,d=(l==null?void 0:l.maxAge)!=null?new Date(Date.now()+l.maxAge*1e3):(l==null?void 0:l.expires)!=null?l.expires:s.expires;return f?await a(f,c,d):f=await e(c,d),s.serialize(f,l)},async destroySession(o,l){return await i(o.id),s.serialize("",{...l,maxAge:void 0,expires:new Date(0)})}}};function Ct(t){ht(t.isSigned,`The "${t.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://remix.run/utils/cookie
135s#signing-cookies for more information.`)}/** 136 * @remix-run/server-runtime v2.11.0 137 * 138 * Copyright (c) Remix Software Inc. 139 * 140 * This source code is licensed under the MIT license found in the 141 * LICENSE.md file in the root directory of this source tree. 142 * 143 * @license MIT 144 */const fn=t=>({cookie:n}={})=>{let e=Fe(n)?n:t((n==null?void 0:n.name)||"__session",n);return Ct(e),{async getSession(r,a){return Te(r&&await e.parse(r,a)||{})},async commitSession(r,a){let i=await e.serialize(r.data,a);if(i.length>4096)throw new Error("Cookie length will exceed browser maximum. Length: "+i.length);return i},async destroySession(r,a){return e.serialize("",{...a,maxAge:void 0,expires:new Date(0)})}}};/** 145 * @remix-run/server-runtime v2.11.0 146 * 147 * Copyright (c) Remix Software Inc. 148 * 149 * This source code is licensed under the MIT license found in the 150 * LICENSE.md file in the root directory of this source tree. 151 * 152 * @license MIT 153 */const hn=t=>({cookie:n}={})=>{let e=new Map;return t({cookie:n,async createData(r,a){let i=Math.random().toString(36).substring(2,10);return e.set(i,{data:r,expires:a}),i},async readData(r){if(e.has(r)){let{data:a,expires:i}=e.get(r);if(!i||i>new Date)return a;i&&e.delete(r)}return null},async updateData(r,a,i){e.set(r,{data:a,expires:i})},async deleteData(r){e.delete(r)}})};/** 154 * @remix-run/server-runtime v2.11.0 155 * 156 * Copyright (c) Remix Software Inc. 157 * 158 * This source code is licensed under the MIT license found in the 159 * LICENSE.md file in the root directory of this source tree. 160 * 161 * @license MIT 162 */class Rt extends Error{constructor(n,e){super(`Field "${n}" exceeded upload size of ${e} bytes.`),this.field=n,this.maxBytes=e}}/** 163 * @remix-run/server-runtime v2.11.0 164 * 165 * Copyright (c) Remix Software Inc. 166 * 167 * This source code is licensed under the MIT license found in the 168 * LICENSE.md file in the root directory of this source tree. 169 * 170 * @license MIT 171 */function dn({filter:t,maxPartSize:n=3e6}={}){return async({filename:e,contentType:r,name:a,data:i})=>{if(t&&!await t({filename:e,contentType:r,name:a}))return;let s=0,o=[];for await(let l of i){if(s+=l.byteLength,s>n)throw new Rt(a,n);o.push(l)}return typeof e=="string"?new File(o,e,{type:r}):await new Blob(o,{type:r}).text()}}/** 172 * @remix-run/server-runtime v2.11.0 173 * 174 * Copyright (c) Remix Software Inc. 175 * 176 * This source code is licensed under the MIT license found in the 177 * LICENSE.md file in the root directory of this source tree. 178 * 179 * @license MIT 180 */const mn=Object.freeze(Object.defineProperty({__proto__:null,MaxPartSizeExceededError:Rt,UNSAFE_SingleFetchRedirectSymbol:lt,broadcastDevReady:Zr,createCookieFactory:kr,createCookieSessionStorageFactory:fn,createMemorySessionStorageFactory:hn,createRequestHandler:tn,createSession:Te,createSessionStorageFactory:un,defer:qt,isCookie:Fe,isSession:ln,json:V,logDevReady:Qr,redirect:ct,redirectDocument:er,replace:tr,unstable_composeUploadHandlers:Br,unstable_createMemoryUploadHandler:dn,unstable_data:rr,unstable_defineAction:nr,unstable_defineLoader:ar,unstable_parseMultipartFormData:Hr,unstable_setDevServerHooks:qr},Symbol.toStringTag,{value:"Module"}));var xt={},De={},ae={};const B=ot(mn);var Oe={exports:{}},ye,rt;function pn(){if(rt)return ye;rt=1;var t=1e3,n=t*60,e=n*60,r=e*24,a=r*7,i=r*365.25;ye=function(c,d){d=d||{};var u=typeof c;if(u==="string"&&c.length>0)return s(c);if(u==="number"&&isFinite(c))return d.long?l(c):o(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function s(c){if(c=String(c),!(c.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(d){var u=parseFloat(d[1]),m=(d[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return u*i;case"weeks":case"week":case"w":return u*a;case"days":case"day":case"d":return u*r;case"hours":case"hour":case"hrs":case"hr":case"h":return u*e;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}}}function o(c){var d=Math.abs(c);return d>=r?Math.round(c/r)+"d":d>=e?Math.round(c/e)+"h":d>=n?Math.round(c/n)+"m":d>=t?Math.round(c/t)+"s":c+"ms"}function l(c){var d=Math.abs(c);return d>=r?f(c,d,r,"day"):d>=e?f(c,d,e,"hour"):d>=n?f(c,d,n,"minute"):d>=t?f(c,d,t,"second"):c+" ms"}function f(c,d,u,m){var v=d>=u*1.5;return Math.round(c/u)+" "+m+(v?"s":"")}return ye}function gn(t){e.debug=e,e.default=e,e.coerce=l,e.disable=i,e.enable=a,e.enabled=s,e.humanize=pn(),e.destroy=f,Object.keys(t).forEach(c=>{e[c]=t[c]}),e.names=[],e.skips=[],e.formatters={};function n(c){let d=0;for(let u=0;u<c.length;u++)d=(d<<5)-d+c.charCodeAt(u),d|=0;return e.colors[Math.abs(d)%e.colors.length]}e.selectColor=n;function e(c){let d,u=null,m,v;function g(...y){if(!g.enabled)return;const _=g,h=Number(new Date),p=h-(d||h);_.diff=p,_.prev=d,_.curr=h,d=h,y[0]=e.coerce(y[0]),typeof y[0]!="str
180ing"&&y.unshift("%O");let w=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(R,x)=>{if(R==="%%")return"%";w++;const P=e.formatters[x];if(typeof P=="function"){const k=y[w];R=P.call(_,k),y.splice(w,1),w--}return R}),e.formatArgs.call(_,y),(_.log||e.log).apply(_,y)}return g.namespace=c,g.useColors=e.useColors(),g.color=e.selectColor(c),g.extend=r,g.destroy=e.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>u!==null?u:(m!==e.namespaces&&(m=e.namespaces,v=e.enabled(c)),v),set:y=>{u=y}}),typeof e.init=="function"&&e.init(g),g}function r(c,d){const u=e(this.namespace+(typeof d>"u"?":":d)+c);return u.log=this.log,u}function a(c){e.save(c),e.namespaces=c,e.names=[],e.skips=[];let d;const u=(typeof c=="string"?c:"").split(/[\s,]+/),m=u.length;for(d=0;d<m;d++)u[d]&&(c=u[d].replace(/\*/g,".*?"),c[0]==="-"?e.skips.push(new RegExp("^"+c.slice(1)+"$")):e.names.push(new RegExp("^"+c+"$")))}function i(){const c=[...e.names.map(o),...e.skips.map(o).map(d=>"-"+d)].join(",");return e.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let d,u;for(d=0,u=e.skips.length;d<u;d++)if(e.skips[d].test(c))return!1;for(d=0,u=e.names.length;d<u;d++)if(e.names[d].test(c))return!0;return!1}function o(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function l(c){return c instanceof Error?c.stack||c.message:c}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}var yn=gn;(function(t,n){var e={};n.formatArgs=a,n.save=i,n.load=s,n.useColors=r,n.storage=o(),n.destroy=(()=>{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;f.splice(1,0,c,"color: inherit");let d=0,u=0;f[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(d++,m==="%c"&&(u=d))}),f.splice(u,0,c)}n.log=console.debug||console.log||(()=>{});function i(f){try{f?n.storage.setItem("debug",f):n.storage.removeItem("debug")}catch{}}function s(){let f;try{f=n.storage.getItem("debug")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=e.DEBUG),f}function o(){try{return localStorage}catch{}}t.exports=yn(n);const{formatters:l}=t.exports;l.j=function(f){try{return JSON.stringify(f)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(Oe,Oe.exports);var Me=Oe.exports,X={},ie={};
180Object.defineProperty(ie,"__esModule",{value:!0});ie.Authenticator=void 0;const H=B;class vn{constructor(n,e={}){var r;this.sessionStorage=n,this.strategies=new Map,this.sessionKey=e.sessionKey||"user",this.sessionErrorKey=e.sessionErrorKey||"auth:error",this.sessionStrategyKey=e.sessionStrategyKey||"strategy",this.throwOnError=(r=e.throwOnError)!==null&&r!==void 0?r:!1}use(n,e){return this.strategies.set(e??n.name,n),this}unuse(n){return this.strategies.delete(n),this}authenticate(n,e,r={}){const a=this.strategies.get(n);if(!a)throw new Error(`Strategy ${n} not found.`);return a.authenticate(new Request(e.url,e),this.sessionStorage,{throwOnError:this.throwOnError,...r,name:n,sessionKey:this.sessionKey,sessionErrorKey:this.sessionErrorKey,sessionStrategyKey:this.sessionStrategyKey})}async isAuthenticated(n,e={}){var r;let i=(r=((0,H.isSession)(n)?n:await this.sessionStorage.getSession(n.headers.get("Cookie"))).get(this.sessionKey))!==null&&r!==void 0?r:null;if(i){if(e.successRedirect)throw(0,H.redirect)(e.successRedirect,{headers:e.headers});return i}if(e.failureRedirect)throw(0,H.redirect)(e.failureRedirect,{headers:e.headers});return null}async logout(n,e){let r=(0,H.isSession)(n)?n:await this.sessionStorage.getSession(n.headers.get("Cookie"));throw(0,H.redirect)(e.redirectTo,{headers:{"Set-Cookie":await this.sessionStorage.destroySession(r)}})}}ie.Authenticator=vn;var se={};Object.defineProperty(se,"__esModule",{value:!0});se.Authorizer=void 0;const G=B;class wn{constructor(n,e=[]){this.authenticator=n,this.rules=e}async authorize(n,{failureRedirect:e,raise:r="response",rules:a=[]}={}){let i=await this.authenticator.isAuthenticated(n.request);if(!i)throw r==="response"?(0,G.json)({message:"Not authenticated."},{status:401}):r==="redirect"?(0,G.redirect)(e):new Error("Not authenticated.");for(let s of[...this.rules,...a])if(!await s({user:i,...n}))throw r==="redirect"?(0,G.redirect)(e):r==="response"?s.name?(0,G.json)({message:`Forbidden by policy ${s.name}`},{status:403}):(0,G.json)({message:"Forbidden"},{status:403}):s.name?new Error(`Forbidden by policy ${s.name}`):new Error("Forbidden.");return i}}se.Authorizer=wn;var J={};Object.defineProperty(J,"__esModule",{value:!0});J.AuthorizationError=void 0;class _n extends Error{constructor(n,e){super(n),this.cause=e}}J.AuthorizationError=_n;var oe={};Object.defineProperty(oe,"__esModule",{value:!0});oe.Strategy=void 0;const ve=B,bn=J;class Sn{constructor(n){this.verify=n}async failure(n,e,r,a,i){if(!a.failureRedirect)throw a.throwOnError?new bn.AuthorizationError(n,i):(0,ve.json)({message:n},401);let s=await r.getSession(e.headers.get("Cookie"));throw s.flash(a.sessionErrorKey,{message:n}),(0,ve.redirect)(a.failureRedirect,{headers:{"Set-Cookie":await r.commitSession(s)}})}async success(n,e,r,a){var i;if(!a.successRedirect)return n;let s=await r.getSession(e.headers.get("Cookie"));throw s.set(a.sessionKey,n),s.set(a.sessionStrategyKey,(i=a.name)!==null&&i!==void 0?i:this.name),(0,ve.redirect)(a.successRedirect,{headers:{"Set-Cookie":await r.commitSession(s)}})}}oe.Strategy=Sn;(function(t){var n=b&&b.__createBinding||(Object.create?function(r,a,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(a,i);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(r,s,o)}:function(r,a,i,s){s===void 0&&(s=i),r[s]=a[i]}),e=b&&b.__exportStar||function(r,a){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&n(a,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(ie,t),e(se,t),e(J,t),e(oe,t)})(X);var Q,Cn=new Uint8Array(16);function kt(){if(!Q&&(Q=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Q))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Q(Cn)}const Rn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ce(t){return typeof t=="string"&&Rn.test(t)}var U=[];for(var we=0;we<256;++we)U.push((we+256).toString(16).substr(1));function le(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(U[t[n+0]]+U[t[n+1]]+U[t[n+2]]+U[t[
vendor: 4,633 bytes, line 180
180n+3]]+"-"+U[t[n+4]]+U[t[n+5]]+"-"+U[t[n+6]]+U[t[n+7]]+"-"+U[t[n+8]]+U[t[n+9]]+"-"+U[t[n+10]]+U[t[n+11]]+U[t[n+12]]+U[t[n+13]]+U[t[n+14]]+U[t[n+15]]).toLowerCase();if(!ce(e))throw TypeError("Stringified UUID is invalid");return e}var nt,_e,be=0,Se=0;function xn(t,n,e){var r=n&&e||0,a=n||new Array(16);t=t||{};var i=t.node||nt,s=t.clockseq!==void 0?t.clockseq:_e;if(i==null||s==null){var o=t.random||(t.rng||kt)();i==null&&(i=nt=[o[0]|1,o[1],o[2],o[3],o[4],o[5]]),s==null&&(s=_e=(o[6]<<8|o[7])&16383)}var l=t.msecs!==void 0?t.msecs:Date.now(),f=t.nsecs!==void 0?t.nsecs:Se+1,c=l-be+(f-Se)/1e4;if(c<0&&t.clockseq===void 0&&(s=s+1&16383),(c<0||l>be)&&t.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");be=l,Se=f,_e=s,l+=122192928e5;var d=((l&268435455)*1e4+f)%4294967296;a[r++]=d>>>24&255,a[r++]=d>>>16&255,a[r++]=d>>>8&255,a[r++]=d&255;var u=l/4294967296*1e4&268435455;a[r++]=u>>>8&255,a[r++]=u&255,a[r++]=u>>>24&15|16,a[r++]=u>>>16&255,a[r++]=s>>>8|128,a[r++]=s&255;for(var m=0;m<6;++m)a[r+m]=i[m];return n||le(a)}function Ut(t){if(!ce(t))throw TypeError("Invalid UUID");var n,e=new Uint8Array(16);return e[0]=(n=parseInt(t.slice(0,8),16))>>>24,e[1]=n>>>16&255,e[2]=n>>>8&255,e[3]=n&255,e[4]=(n=parseInt(t.slice(9,13),16))>>>8,e[5]=n&255,e[6]=(n=parseInt(t.slice(14,18),16))>>>8,e[7]=n&255,e[8]=(n=parseInt(t.slice(19,23),16))>>>8,e[9]=n&255,e[10]=(n=parseInt(t.slice(24,36),16))/1099511627776&255,e[11]=n/4294967296&255,e[12]=n>>>24&255,e[13]=n>>>16&255,e[14]=n>>>8&255,e[15]=n&255,e}function kn(t){t=unescape(encodeURIComponent(t));for(var n=[],e=0;e<t.length;++e)n.push(t.charCodeAt(e));return n}var Un="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ln="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Lt(t,n,e){function r(a,i,s,o){if(typeof a=="string"&&(a=kn(a)),typeof i=="string"&&(i=Ut(i)),i.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+a.length);if(l.set(i),l.set(a,i.length),l=e(l),l[6]=l[6]&15|n,l[8]=l[8]&63|128,s){o=o||0;for(var f=0;f<16;++f)s[o+f]=l[f];return s}return le(l)}try{r.name=t}catch{}return r.DNS=Un,r.URL=Ln,r}function En(t){if(typeof t=="string"){var n=unescape(encodeURIComponent(t));t=new Uint8Array(n.length);for(var e=0;e<n.length;++e)t[e]=n.charCodeAt(e)}return An(On(Pn(t),t.length*8))}function An(t){for(var n=[],e=t.length*32,r="0123456789abcdef",a=0;a<e;a+=8){var i=t[a>>5]>>>a%32&255,s=parseInt(r.charAt(i>>>4&15)+r.charAt(i&15),16);n.push(s)}return n}function Et(t){return(t+64>>>9<<4)+14+1}function On(t,n){t[n>>5]|=128<<n%32,t[Et(n)-1]=n;for(var e=1732584193,r=-271733879,a=-1732584194,i=271733878,s=0;s<t.length;s+=16){var o=e,l=r,f=a,c=i;e=L(e,r,a,i,t[s],7,-680876936),i=L(i,e,r,a,t[s+1],12,-389564586),a=L(a,i,e,r,t[s+2],17,606105819),r=L(r,a,i,e,t[s+3],22,-1044525330),e=L(e,r,a,i,t[s+4],7,-176418897),i=L(i,e,r,a,t[s+5],12,1200080426),a=L(a,i,e,r,t[s+6],17,-1473231341),r=L(r,a,i,e,t[s+7],22,-45705983),e=L(e,r,a,i,t[s+8],7,1770035416),i=L(i,e,r,a,t[s+9],12,-1958414417),a=L(a,i,e,r,t[s+10],17,-42063),r=L(r,a,i,e,t[s+11],22,-1990404162),e=L(e,r,a,i,t[s+12],7,1804603682),i=L(i,e,r,a,t[s+13],12,-40341101),a=L(a,i,e,r,t[s+14],17,-1502002290),r=L(r,a,i,e,t[s+15],22,1236535329),e=E(e,r,a,i,t[s+1],5,-165796510),i=E(i,e,r,a,t[s+6],9,-1069501632),a=E(a,i,e,r,t[s+11],14,643717713),r=E(r,a,i,e,t[s],20,-373897302),e=E(e,r,a,i,t[s+5],5,-701558691),i=E(i,e,r,a,t[s+10],9,38016083),a=E(a,i,e,r,t[s+15],14,-660478335),r=E(r,a,i,e,t[s+4],20,-405537848),e=E(e,r,a,i,t[s+9],5,568446438),i=E(i,e,r,a,t[s+14],9,-1019803690),a=E(a,i,e,r,t[s+3],14,-187363961),r=E(r,a,i,e,t[s+8],20,1163531501),e=E(e,r,a,i,t[s+13],5,-1444681467),i=E(i,e,r,a,t[s+2],9,-51403784),a=E(a,i,e,r,t[s+7],14,1735328473),r=E(r,a,i,e,t[s+12],20,-1926607734),e=A(e,r,a,i,t[s+5],4,-378558),i=A(i,e,r,a,t[s+8],11,-2022574463),a=A(a,i,e,r,t[s+11],16,1839030562),r=A(r,a,i,e,t[s+14],23,-35309556),e=A(e,r,a,i,t[s+1],4,-1530992060),i=A(i,e,r,a,t[s+4],11,1272893353),a=A(a,i,e,r,t[s+7],16,-155497632),r=A(r,a,i,e,t[s+10],23,-1094730640),e=A(e,r,a,i,t[s+13],4,681279174),i=A(i,e,r,a,t[s],11,-358537222),a=A(a,i,e,r,t[s+3],16,-722521979),r=A(r,a,i,e,t[s+6],23,76029189),e=A(e,r,a,i,t[s+9],4,-640364487),i=A(i,e,r,a,t[s+12],11,-421815835),a=A(a,i,e,r,t[s+15],16,530742520),r=A(r,a,i,e,t[s+2],23,-995338651),e=O(e,r,a,i,t[s],6,-198630844),i=O(i,e,r,a,t[s+7],10,1126891415),a=O(a,i,e,r,t[s+14],15,-1416354905),r=O(r,a,i,e,t[s+5],21,-57434055),e=O(e,r,a,i,t[s+12],6,1700485571),i=O(i,e,r,a,t[s+3],10,-1894986606),a=O(a,i,e,r,t[s+10],15,-1051523),r=O(r,a,i,e,t[s+1],21,-2054922799),e=O(e,r,a,i,t[s+8],6,1873313359),i=O(i,e,r,a,t[s+1
1805],10,-30611744),a=O(a,i,e,r,t[s+6],15,-1560198380),r=O(r,a,i,e,t[s+13],21,1309151649),e=O(e,r,a,i,t[s+4],6,-145523070),i=O(i,e,r,a,t[s+11],10,-1120210379),a=O(a,i,e,r,t[s+2],15,718787259),r=O(r,a,i,e,t[s+9],21,-343485551),e=M(e,o),r=M(r,l),a=M(a,f),i=M(i,c)}return[e,r,a,i]}function Pn(t){if(t.length===0)return[];for(var n=t.length*8,e=new Uint32Array(Et(n)),r=0;r<n;r+=8)e[r>>5]|=(t[r/8]&255)<<r%32;return e}function M(t,n){var e=(t&65535)+(n&65535),r=(t>>16)+(n>>16)+(e>>16);return r<<16|e&65535}function Fn(t,n){return t<<n|t>>>32-n}function ue(t,n,e,r,a,i){return M(Fn(M(M(n,t),M(r,i)),a),e)}function L(t,n,e,r,a,i,s){return ue(n&e|~n&r,t,n,a,i,s)}function E(t,n,e,r,a,i,s){return ue(n&r|e&~r,t,n,a,i,s)}function A(t,n,e,r,a,i,s){return ue(n^e^r,t,n,a,i,s)}function O(t,n,e,r,a,i,s){return ue(e^(n|~r),t,n,a,i,s)}var jn=Lt("v3",48,En);const Tn=jn;function Dn(t,n,e){t=t||{};var r=t.random||(t.rng||kt)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,n){e=e||0;for(var a=0;a<16;++a)n[e+a]=r[a];return n}return le(r)}function Mn(t,n,e,r){switch(t){case 0:return n&e^~n&r;case 1:return n^e^r;case 2:return n&e^n&r^e&r;case 3:return n^e^r}}function Ce(t,n){return t<<n|t>>>32-n}function zn(t){var n=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=[];for(var a=0;a<r.length;++a)t.push(r.charCodeAt(a))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var i=t.length/4+2,s=Math.ceil(i/16),o=new Array(s),l=0;l<s;++l){for(var f=new Uint32Array(16),c=0;c<16;++c)f[c]=t[l*64+c*4]<<24|t[l*64+c*4+1]<<16|t[l*64+c*4+2]<<8|t[l*64+c*4+3];o[l]=f}o[s-1][14]=(t.length-1)*8/Math.pow(2,32),o[s-1][14]=Math.floor(o[s-1][14]),o[s-1][15]=(t.length-1)*8&4294967295;for(var d=0;d<s;++d){for(var u=new Uint32Array(80),m=0;m<16;++m)u[m]=o[d][m];for(var v=16;v<80;++v)u[v]=Ce(u[v-3]^u[v-8]^u[v-14]^u[v-16],1);for(var g=e[0],y=e[1],_=e[2],h=e[3],p=e[4],w=0;w<80;++w){var S=Math.floor(w/20),R=Ce(g,5)+Mn(S,y,_,h)+p+n[S]+u[w]>>>0;p=h,h=_,_=Ce(y,30)>>>0,y=g,g=R}e[0]=e[0]+g>>>0,e[1]=e[1]+y>>>0,e[2]=e[2]+_>>>0,e[3]=e[3]+h>>>0,e[4]=e[4]+p>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,e[0]&255,e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,e[1]&255,e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,e[2]&255,e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,e[3]&255,e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,e[4]&255]}var In=Lt("v5",80,zn);const Nn=In,$n="00000000-0000-0000-0000-000000000000";function Bn(t){if(!ce(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const Hn=Object.freeze(Object.defineProperty({__proto__:null,NIL:$n,parse:Ut,stringify:le,v1:xn,v3:Tn,v4:Dn,v5:Nn,validate:ce,version:Bn},Symbol.toStringTag,{value:"Module"})),ze=ot(Hn);var Gn=b&&b.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ae,"__esModule",{value:!0});ae.OAuth2Strategy=void 0;const Kn=B,Wn=Gn(Me),Vn=X,Xn=ze;let j=(0,Wn.default)("OAuth2Strategy"),Jn=class extends Vn.Strategy{constructor(n,e){var r,a;super(e),this.name="oauth2",this.sessionStateKey="oauth2:state",this.authorizationURL=n.authorizationURL,this.tokenURL=n.tokenURL,this.clientID=n.clientID,this.clientSecret=n.clientSecret,this.callbackURL=n.callbackURL,this.responseType=(r=n.responseType)!==null&&r!==void 0?r:"code",this.useBasicAuthenticationHeader=(a=n.useBasicAuthenticationHeader)!==null&&a!==void 0?a:!1}async authenticate(n,e,r){var a;j("Request URL",n.url);let i=new URL(n.url),s=await e.getSession(n.headers.get("Cookie")),o=(a=s.get(r.sessionKey))!==null&&a!==void 0?a:null;if(o)return j("User is authenticated"),this.success(o,n,e,r);let l=this.getCallbackURL(i);if(j("Callback URL",l),i.pathname!==l.pathname){j("Redirecting to callback URL");let u=this.generateState();throw j("State",u),s.set(this.sessionStateKey,u),(0,Kn.redirect)(this.getAuthorizationURL(n,u).toString(),{headers:{"Set-Cookie":await e.commitSession(s)}})}let f=i.searchParams.get("state");if(j("State from URL",f),!f)return await this.failure("Missing state on URL.",n,e,r,new Error("Missing state on URL."));let c=s.get(this.sessionStateKey);if(j("State from session",c),!c)return await this.failure("Missing state on session.",n,e,r,new Error("Missing state on session."));if(c===f)j("State is valid"),s.unset(this.sessionStateKey);else return await this.failure("State doesn't match.",n,e,r,new Error("State doesn't match."));let d=i.searchParams.get("code");if(!d)return await this.failure("Missing code.",n,e,r,new Error("Missing code."));try{let u=new URLSearchParams(this.tokenParams());u.set("grant_type","authorization_code"),u.set("redirect_uri",l.toString());let{accessToken:m,refreshToken:v,extraParams:g}=await this.fetchAccessToken(d,u),y=await this.userProfile(m,g);o=await this.verify({accessToken:m,refreshToken:v,extraParams:g,profile:y,context:r.context})}catch(u){return j("Failed to verify user",u),u instanceof Error?await this.failure(u.message,n,e,r,u):typeof u=="string"?await this.failure(u,n,e,r,new Error(u)):await this.failure("Unknown error",n,e,r,new Error(JSON.stringify(u,null,2)))}return j("User authenticated"),await this.success(o,n,e,r)}async userProfile(n,e){return{provider:"oauth2"}}authorizationParams(n){return new URLSearchParams(n)}tokenParams(){return new URLSearchParams}async getAccessToken(n){let{access_token:e,refresh_token:r,...a}=await n.json();return{accessToken:e,refreshToken:r,extraParams:a}}getCallbackURL(n){return this.callbackURL.startsWith("http:")||this.callbackURL.startsWith("https:")?new URL(this.callbackURL):this.callbackURL.startsWith("/")?new URL(this.callbackURL,n):new URL(`${n.protocol}//${this.callbackURL}`)}getAuthorizationURL(n,e){let r=new URLSearchParams(this.authorizationParams(new URL(n.url).searchParams));r.set("response_type",this.responseType),r.set("client_id",this.clientID),r.set("redirect_uri",this.getCallbackURL(new URL(n.url)).toString()),r.set("state",e);let a=new URL(this.authorizationURL);return a.search=r.toString(),a}generateState(){return(0,Xn.v4)()}async fetchAccessToken(n,e){let r={"Content-Type":"application/x-www-form-urlencoded"};if(this.useBasicAuthenticationHeader){const i=Buffer.from(`${this.clientID}:${this.clientSecret}`).toString("base64");r={...r,Authorization:`Basic ${i}`}}else e.set("client_id",this.clientID),e.set("client_secret",this.clientSecret);e.get("grant_type")==="refresh_token"?e.set("refresh_token",n):e.set("code",n);let a=await fetch(this.tokenURL,{method:"POST",headers:r,body:e});if(!a.ok)throw await a.text();return await this.getAccessToken(a.clone())}};ae.OAuth2Strategy=Jn;
180(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscordStrategy=t.DiscordStrategyDefaultName=void 0;const n=ae,e="https://discord.com/api/v10";t.DiscordStrategyDefaultName="discord";class r extends n.OAuth2Strategy{constructor({clientID:i,clientSecret:s,callbackURL:o,scope:l,prompt:f},c){super({clientID:i,clientSecret:s,callbackURL:o,authorizationURL:`${e}/oauth2/authorize`,tokenURL:`${e}/oauth2/token`},c),this.name=t.DiscordStrategyDefaultName,this.userInfoURL=`${e}/users/@me`,this.scope=l||["identify","email"],this.prompt=f}authorizationParams(){const i=new URLSearchParams({scope:this.scope.join(" ")});return this.prompt&&i.set("prompt",this.prompt),i}async userProfile(i){const o=await(await fetch(this.userInfoURL,{headers:{Authorization:`Bearer ${i}`}})).json();return{provider:t.DiscordStrategyDefaultName,id:o.id,displayName:o.username,emails:o.email?[{value:o.email}]:void 0,photos:o.avatar?[{value:o.avatar}]:void 0,__json:o}}async getAccessToken(i){const{access_token:s,refresh_token:o,scope:l,...f}=await i.json();return{accessToken:s,refreshToken:o,extraParams:{...f,scope:l.split(" ")}}}}t.DiscordStrategy=r})(De);var Ie={},I={},Yn=b&&b.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(I,"__esModule",{value:!0});I.OAuth2Strategy=void 0;const Zn=B,Qn=Yn(Me),qn=X,ea=ze;let T=(0,Qn.default)("OAuth2Strategy");class ta extends qn.Strategy{constructor(n,e){var r,a;super(e),this.name="oauth2",this.sessionStateKey="oauth2:state",this.authorizationURL=n.authorizationURL,this.tokenURL=n.tokenURL,this.clientID=n.clientID,this.clientSecret=n.clientSecret,this.callbackURL=n.callbackURL,this.scope=n.scope,this.responseType=(r=n.responseType)!==null&&r!==void 0?r:"code",this.useBasicAuthenticationHeader=(a=n.useBasicAuthenticationHeader)!==null&&a!==void 0?a:!1}async authenticate(n,e,r){var a;T("Request URL",n.url);let i=new URL(n.url),s=await e.getSession(n.headers.get("Cookie")),o=(a=s.get(r.sessionKey))!==null&&a!==void 0?a:null;if(o)return T("User is authenticated"),this.success(o,n,e,r);let l=this.getCallbackURL(n);if(T("Callback URL",l),i.pathname!==l.pathname){T("Redirecting to callback URL");let u=this.generateState();throw T("State",u),s.set(this.sessionStateKey,u),(0,Zn.redirect)(this.getAuthorizationURL(n,u).toString(),{headers:{"Set-Cookie":await e.commitSession(s)}})}let f=i.searchParams.get("state");if(T("State from URL",f),!f)return await this.failure("Missing state on URL.",n,e,r,new Error("Missing state on URL."));let c=s.get(this.sessionStateKey);if(T("State from session",c),!c)return await this.failure("Missing state on session.",n,e,r,new Error("Missing state on session."));if(c===f)T("State is valid"),s.unset(this.sessionStateKey);else return await this.failure("State doesn't match.",n,e,r,new Error("State doesn't match."));let d=i.searchParams.get("code");if(!d)return await this.failure("Missing code.",n,e,r,new Error("Missing code."));try{let u=new URLSearchParams(this.tokenParams());u.set("grant_type","authorization_code"),u.set("redirect_uri",l.toString());let{accessToken:m,refreshToken:v,extraParams:g}=await this.fetchAccessToken(d,u),y=await this.userProfile(m,g);o=await this.verify({accessToken:m,refreshToken:v,extraParams:g,profile:y,context:r.context,request:n})}catch(u){if(T("Failed to verify user",u),u instanceof Response)throw u;return u instanceof Error?await this.failure(u.message,n,e,r,u):typeof u=="string"?await this.failure(u,n,e,r,new Error(u)):await this.failure("Unknown error",n,e,r,new Error(JSON.stringify(u,null,2)))}return T("User authenticated"),await this.success(o,n,e,r)}async userProfile(n,e){return{provider:"oauth2"}}authorizationParams(n){return new URLSearchParams(n)}tokenParams(){return new URLSearchParams}async getAccessToken(n){let{access_token:e,refresh_token:r,...a}=await n.json();return{accessToken:e,refreshToken:r,extraParams:a}}getCallbackURL(n){var e,r;if(this.callbackURL.startsWith("http:")||this.callbackURL.startsWith("https:"))return new URL(this.callbackURL);let a=(r=(e=n.headers.get("X-Forwarded-Host"))!==null&&e!==void 0?e:n.headers.get("host"))!==null&&r!==void 0?r:new URL(n.url).host,i=a.includes("localhost")?"http":"https";return this.callbackURL.startsWith("/")?new URL(this.callbackURL,`${i}://${a}`):new URL(`${i}//${this.callbackURL}`)}getAuthorizationURL(n,e){let r=new URLSearchParams(this.authorizationParams(new URL(n.url).searchParams));r.set("response_type",this.responseType),r.set("client_id",this.clientID),r.set("redirect_uri",this.getCallbackURL(n).toString()),r.set("state",e),!r.has("scope")&&this.scope&&r.set("scope",this.scope);let a=new URL(this.authorizationURL);return a.search=r.toString(),a}generateState(){return(0,ea.v4)()}async fetchAccessToken(n,e){let r={"Content-Type":"application/x-www-form-urlencoded"};if(this.useBasicAuthenticationHeader){const i=Buffer.from(`${this.clientID}:${this.clientSecret}`).toString("base64");r={...r,Authorization:`Basic ${i}`}}else e.set("client_id",this.clientID),e.set("client_secret",this.clientSecret);e.get("grant_type")==="refresh_token"?e.set("refresh_token",n):e.set("code",n);let a=await fetch(this.tokenURL,{method:"POST",headers:r,body:e});if(!a.ok)throw await a.text();return await this.getAccessToken(a.clone())}}I.OAuth2Strategy=ta;
180(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GitHubStrategy=t.GitHubStrategyScopeSeperator=t.GitHubStrategyDefaultScope=t.GitHubStrategyDefaultName=void 0;const n=X,e=I;t.GitHubStrategyDefaultName="github",t.GitHubStrategyDefaultScope="user:email",t.GitHubStrategyScopeSeperator=" ";class r extends e.OAuth2Strategy{constructor({clientID:s,clientSecret:o,callbackURL:l,scope:f,allowSignup:c,userAgent:d},u){super({clientID:s,clientSecret:o,callbackURL:l,authorizationURL:"https://github.com/login/oauth/authorize",tokenURL:"https://github.com/login/oauth/access_token"},u),this.name=t.GitHubStrategyDefaultName,this.userInfoURL="https://api.github.com/user",this.userEmailsURL="https://api.github.com/user/emails",this.scope=this.getScope(f),this.allowSignup=c??!0,this.userAgent=d??"Remix Auth"}getScope(s){if(s){if(typeof s=="string")return s.split(t.GitHubStrategyScopeSeperator)}else return[t.GitHubStrategyDefaultScope];return s}authorizationParams(){return new URLSearchParams({scope:this.scope.join(t.GitHubStrategyScopeSeperator),allow_signup:String(this.allowSignup)})}async userEmails(s){return(await(await fetch(this.userEmailsURL,{headers:{Accept:"application/vnd.github.v3+json",Authorization:`token ${s}`,"User-Agent":this.userAgent}})).json()).map(({email:c})=>({value:c}))}async userProfile(s){let l=await(await fetch(this.userInfoURL,{headers:{Accept:"application/vnd.github.v3+json",Authorization:`token ${s}`,"User-Agent":this.userAgent}})).json(),f=[{value:l.email}];return this.scope.includes(t.GitHubStrategyDefaultScope)&&(f=await this.userEmails(s)),{provider:"github",displayName:l.login,id:l.id.toString(),name:{familyName:l.name,givenName:l.name,middleName:l.name},emails:f,photos:[{value:l.avatar_url}],_json:l}}async getAccessToken(s){var o;let l=new URLSearchParams(await s.text()),f=l.get("access_token");if(!f)throw new n.AuthorizationError("Missing access token.");let c=l.get("token_type");if(!c)throw new n.AuthorizationError("Missing token type.");let d=(o=l.get("refresh_token"))!==null&&o!==void 0?o:"",u=a(l.get("expires_in")),m=a(l.get("refresh_token_expires_in"));return{accessToken:f,refreshToken:d,extraParams:{tokenType:c,accessTokenExpiresIn:u,refreshTokenExpiresIn:m}}}}t.GitHubStrategy=r;function a(i){if(!i)return null;try{return Number.parseInt(i,10)}catch{return null}}})(Ie);var Ne={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleStrategy=t.GoogleStrategyScopeSeperator=t.GoogleStrategyDefaultName=t.GoogleStrategyDefaultScopes=void 0;const n=I;t.GoogleStrategyDefaultScopes=["openid","profile","email"],t.GoogleStrategyDefaultName="google",t.GoogleStrategyScopeSeperator=" ";class e extends n.OAuth2Strategy{constructor({clientID:a,clientSecret:i,callbackURL:s,scope:o,accessType:l,includeGrantedScopes:f,prompt:c,hd:d,loginHint:u},m){super({clientID:a,clientSecret:i,callbackURL:s,authorizationURL:"https://accounts.google.com/o/oauth2/v2/auth",tokenURL:"https://oauth2.googleapis.com/token"},m),this.name=t.GoogleStrategyDefaultName,this.userInfoURL="https://www.googleapis.com/oauth2/v3/userinfo",this.scope=this.getScope(o),this.accessType=l??"online",this.includeGrantedScopes=f??!1,this.prompt=c,this.hd=d,this.loginHint=u}authorizationParams(){const a=new URLSearchParams({scope:this.scope.join(t.GoogleStrategyScopeSeperator),access_type:this.accessType,include_granted_scopes:String(this.includeGrantedScopes)});return this.prompt&&a.set("prompt",this.prompt),this.hd&&a.set("hd",this.hd),this.loginHint&&a.set("login_hint",this.loginHint),a}async userProfile(a){const s=await(await fetch(this.userInfoURL,{headers:{Authorization:`Bearer ${a}`}})).json();return{provider:"google",id:s.sub,displayName:s.name,name:{familyName:s.family_name,givenName:s.given_name},emails:[{value:s.email}],photos:[{value:s.picture}],_json:s}}getScope(a){if(a){if(typeof a=="string")return a.split(t.GoogleStrategyScopeSeperator)}else return t.GoogleStrategyDefaultScopes;return a}}t.GoogleStrategy=e})(Ne);var $e={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MicrosoftStrategy=t.MicrosoftStrategyScopeSeperator=t.MicrosoftStrategyDefaultName=t.MicrosoftStrategyDefaultScopes=void 0;const n=I;t.MicrosoftStrategyDefaultScopes=["openid","profile","email"],t.MicrosoftStrategyDefaultName="microsoft",t.MicrosoftStrategyScopeSeperator=" ";class e extends n.OAuth2Strategy{constructor({clientId:a,clientSecret:i,redirectUri:s,scope:o,prompt:l,tenantId:f="common"},c){super({clientID:a,clientSecret:i,callbackURL:s,authorizationURL:`https://login.microsoftonline.com/${f}/oauth2/v2.0/authorize`,tokenURL:`https://login.microsoftonline.com/${f}/oauth2/v2.0/token`},c),this.name=t.MicrosoftStrategyDefaultName,this.userInfoURL="https://graph.microsoft.com/oidc/userinfo",this.scope=this.getScope(o),this.prompt=l??"none"}
vendor: 7,222 bytes, line 180
180getScope(a){if(a){if(typeof a=="string")return a}else return t.MicrosoftStrategyDefaultScopes.join(t.MicrosoftStrategyScopeSeperator);return a.join(t.MicrosoftStrategyScopeSeperator)}authorizationParams(){return new URLSearchParams({scope:this.scope,prompt:this.prompt})}async userProfile(a){const s=await(await fetch(this.userInfoURL,{headers:{Authorization:`Bearer ${a}`}})).json();return{provider:t.MicrosoftStrategyDefaultName,displayName:s.name,id:s.sub,name:{familyName:s.family_name,givenName:s.given_name},emails:[{value:s.email}],_json:s}}}t.MicrosoftStrategy=e})($e);var Be={},At={exports:{}},Re={exports:{}},at;function fe(){return at||(at=1,function(t,n){(function(e,r){t.exports=r()})(b,function(){var e=e||function(r,a){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof b<"u"&&b.crypto&&(i=b.crypto),!i&&typeof mr=="function")try{i=require("crypto")}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function h(){}return function(p){var w;return h.prototype=p,w=new h,h.prototype=null,w}}(),l={},f=l.lib={},c=f.Base=function(){return{extend:function(h){var p=o(this);return h&&p.mixIn(h),(!p.hasOwnProperty("init")||this.init===p.init)&&(p.init=function(){p.$super.init.apply(this,arguments)}),p.init.prototype=p,p.$super=this,p},create:function(){var h=this.extend();return h.init.apply(h,arguments),h},init:function(){},mixIn:function(h){for(var p in h)h.hasOwnProperty(p)&&(this[p]=h[p]);h.hasOwnProperty("toString")&&(this.toString=h.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=f.WordArray=c.extend({init:function(h,p){h=this.words=h||[],p!=a?this.sigBytes=p:this.sigBytes=h.length*4},toString:function(h){return(h||m).stringify(this)},concat:function(h){var p=this.words,w=h.words,S=this.sigBytes,R=h.sigBytes;if(this.clamp(),S%4)for(var x=0;x<R;x++){var P=w[x>>>2]>>>24-x%4*8&255;p[S+x>>>2]|=P<<24-(S+x)%4*8}else for(var k=0;k<R;k+=4)p[S+k>>>2]=w[k>>>2];return this.sigBytes+=R,this},clamp:function(){var h=this.words,p=this.sigBytes;h[p>>>2]&=4294967295<<32-p%4*8,h.length=r.ceil(p/4)},clone:function(){var h=c.clone.call(this);return h.words=this.words.slice(0),h},random:function(h){for(var p=[],w=0;w<h;w+=4)p.push(s());return new d.init(p,h)}}),u=l.enc={},m=u.Hex={stringify:function(h){for(var p=h.words,w=h.sigBytes,S=[],R=0;R<w;R++){var x=p[R>>>2]>>>24-R%4*8&255;S.push((x>>>4).toString(16)),S.push((x&15).toString(16))}return S.join("")},parse:function(h){for(var p=h.length,w=[],S=0;S<p;S+=2)w[S>>>3]|=parseInt(h.substr(S,2),16)<<24-S%8*4;return new d.init(w,p/2)}},v=u.Latin1={stringify:function(h){for(var p=h.words,w=h.sigBytes,S=[],R=0;R<w;R++){var x=p[R>>>2]>>>24-R%4*8&255;S.push(String.fromCharCode(x))}return S.join("")},parse:function(h){for(var p=h.length,w=[],S=0;S<p;S++)w[S>>>2]|=(h.charCodeAt(S)&255)<<24-S%4*8;return new d.init(w,p)}},g=u.Utf8={stringify:function(h){try{return decodeURIComponent(escape(v.stringify(h)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(h){return v.parse(unescape(encodeURIComponent(h)))}},y=f.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(h){typeof h=="string"&&(h=g.parse(h)),this._data.concat(h),this._nDataBytes+=h.sigBytes},_process:function(h){var p,w=this._data,S=w.words,R=w.sigBytes,x=this.blockSize,P=x*4,k=R/P;h?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var F=k*x,N=r.min(F*4,R);if(F){for(var $=0;$<F;$+=x)this._doProcessBlock(S,$);p=S.splice(0,F),w.sigBytes-=N}return new d.init(p,N)},clone:function(){var h=c.clone.call(this);return h._data=this._data.clone(),h},_minBufferSize:0});f.Hasher=y.extend({cfg:c.extend(),init:function(h){this.cfg=this.cfg.extend(h),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(h){return this._append(h),this._process(),this},finalize:function(h){h&&this._append(h);var p=this._doFinalize();return p},blockSize:16,_createHelper:function(h){return function(p,w){return new h.init(w).finalize(p)}},_createHmacHelper:function(h){return function(p,w){return new _.HMAC.init(h,w).finalize(p)}}});var _=l.algo={};return l}(Math);return e})}(Re)),Re.exports}var xe={exports:{}},it;function ra(){return it||(it=1,function(t,n){(function(e,r){t.exports=r(fe())})(b,function(e){return function(){var r=e,a=r.lib,i=a.WordArray,s=a.Hasher,o=r.algo,l=[],f=o.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,d){for(var u=this._hash.words,m=u[0],v=u[1],g=u[2],y=u[3],_=u[4],h=0;h<80;h++){if(h<16)l[h]=c[d+h]|0;else{var p=l[h-3]^l[h-8]^l[h-14]^l[h-16];l[h]=p<<1|p>>>31}var w=(m<<5|m>>>27)+_+l[h];h<20?w+=(v&g|~v&y)+1518500249:h<40?w+=(v^g^y)+1859775393:h<60?w+=(v&g|v&y|g&y)-1894007588:w+=(v^g^y)-899497514,_=y,y=g,g=v<<30|v>>>2,v=m,m=w}u[0]=u[0]+m|0,u[1]=u[1]+v|0,u[2]=u[2]+g|0,u[3]=u[3]+y|0,u[4]=u[4]+_|0},_doFinalize:function(){var c=this._data,d=c.words,u=this._nDataBytes*8,m=c.sigBytes*8;return d[m>>>5]|=128<<24-m%32,d[(m+64>>>9<<4)+14]=Math.floor(u/4294967296),d[(m+64>>>9<<4)+15]=u,c.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var c=s.clone.call(this);return c._hash=this._hash.clone(),c}});r.SHA1=s._createHelper(f),r.HmacSHA1=s._createHmacHelper(f)}(),e.SHA1})}(xe)),xe.exports}var ke={exports:{}},st;function na(){return st||(st=1,function(t,n){(function(e,r){t.exports=r(fe())})(b,function(e){(function(){var r=e,a=r.lib,i=a.Base,s=r.enc,o=s.Utf8,l=r.algo;l.HMAC=i.extend({init:function(f,c){f=this._hasher=new f.init,typeof c=="string"&&(c=o.parse(c));var d=f.blockSize,u=d*4;c.sigBytes>u&&(c=f.finalize(c)),c.clamp();for(var m=this._oKey=c.clone(),v=this._iKey=c.clone(),g=m.words,y=v.words,_=0;_<d;_++)g[_]^=1549556828,y[_]^=909522486;m.sigBytes=v.sigBytes=u,this.reset()},reset:function(){var f=this._hasher;f.reset(),f.update(this._iKey)},update:function(f){return this._hasher.update(f),this},finalize:function(f){var c=this._hasher,d=c.finalize(f);c.reset();var u=c.finalize(this._oKey.clone().concat(d));return u}})})()})}(ke)),ke.exports}(function(t,n){(function(e,r,a){t.exports=r(fe(),ra(),na())})(b,function(e){return e.HmacSHA1})})(At);var aa=At.exports,Ot={exports:{}};(function(t,n){(function(e,r){t.exports=r(fe())})(b,function(e){return function(){var r=e,a=r.lib,i=a.WordArray,s=r.enc;s.Base64={stringify:function(l){var f=l.words,c=l.sigBytes,d=this._map;l.clamp();for(var u=[],m=0;m<c;m+=3)for(var v=f[m>>>2]>>>24-m%4*8&255,g=f[m+1>>>2]>>>24-(m+1)%4*8&255,y=f[m+2>>>2]>>>24-(m+2)%4*8&255,_=v<<16|g<<8|y,h=0;h<4&&m+h*.75<c;h++)u.push(d.charAt(_>>>6*(3-h)&63));var p=d.charAt(64);if(p)for(;u.length%4;)u.push(p);return u.join("")},parse:function(l){var f=l.length,c=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var u=0;u<c.length;
180u++)d[c.charCodeAt(u)]=u}var m=c.charAt(64);if(m){var v=l.indexOf(m);v!==-1&&(f=v)}return o(l,f,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(l,f,c){for(var d=[],u=0,m=0;m<f;m++)if(m%4){var v=c[l.charCodeAt(m-1)]<<m%4*2,g=c[l.charCodeAt(m)]>>>6-m%4*2,y=v|g;d[u>>>2]|=y<<24-u%4*8,u++}return i.create(d,u)}}(),e.enc.Base64})})(Ot);var ia=Ot.exports,he={};Object.defineProperty(he,"__esModule",{value:!0});he.fixedEncodeURIComponent=void 0;function sa(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16).toUpperCase()})}he.fixedEncodeURIComponent=sa;(function(t){var n=b&&b.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.TwitterStrategy=t.TwitterStrategyDefaultName=void 0;const e=B,r=n(Me),a=X,i=ze,s=n(aa),o=n(ia),l=he;let f=(0,r.default)("TwitterStrategy");const c="https://api.twitter.com/oauth/request_token",d="https://api.twitter.com/oauth/authorize",u="https://api.twitter.com/oauth/access_token",m="https://api.twitter.com/1.1/account/verify_credentials.json";t.TwitterStrategyDefaultName="twitter";class v extends a.Strategy{constructor(y,_){super(_),this.name=t.TwitterStrategyDefaultName,this.clientID=y.clientID,this.clientSecret=y.clientSecret,this.callbackURL=y.callbackURL,this.includeEmail=y.includeEmail||!1}async authenticate(y,_,h){var p;f("Request URL",y.url);let w=new URL(y.url),S=await _.getSession(y.headers.get("Cookie")),R=(p=S.get(h.sessionKey))!==null&&p!==void 0?p:null;if(R)return f("User is authenticated"),this.success(R,y,_,h);let x=this.getCallbackURL(w);if(f("Callback URL",x),w.pathname!==x.pathname){f("Requesting request token");const{requestToken:Y,callbackConfirmed:de}=await this.fetchRequestToken(x);throw de?(0,e.redirect)(v.getAuthorizationURL(Y).toString(),{headers:{"Set-Cookie":await _.commitSession(S)}}):(0,e.json)({message:"Callback not confirmed"},{status:401})}if(w.searchParams.get("denied"))return await this.failure("Please authorize the app",y,_,h);const k=w.searchParams.get("oauth_token");if(!k)throw(0,e.json)({message:"Missing oauth token from auth response."},{status:400});const F=w.searchParams.get("oauth_verifier");if(!F)throw(0,e.json)({message:"Missing oauth verifier from auth response."},{status:400});let N=new URLSearchParams;N.set("oauth_token",k),N.set("oauth_verifier",F);let{accessToken:$,accessTokenSecret:He}=await this.fetchAccessToken(N),Nt=await this.userProfile($,He,this.includeEmail);try{R=await this.verify({accessToken:$,accessTokenSecret:He,profile:Nt,context:h.context})}catch(Y){f("Failed to verify user",Y);let de=Y.message;return await this.failure(de,y,_,h)}return f("User authenticated"),await this.success(R,y,_,h)}getCallbackURL(y){return this.callbackURL.startsWith("http:")||this.callbackURL.startsWith("https:")?new URL(this.callbackURL):this.callbackURL.startsWith("/")?new URL(this.callbackURL,y):new URL(`${y.protocol}//${this.callbackURL}`)}static generateNonce(){return(0,i.v4)()}static generateTimestamp(){return`${Math.floor(Date.now()/1e3)}`}async fetchRequestToken(y){const _=this.signRequest({oauth_callback:y.toString()},"GET",c),h=new URL(c);h.search=new URLSearchParams(_).toString();let p=await fetch(h.toString(),{method:"GET"});if(!p.ok){let R=await p.text();throw new Response(R,{status:401})}const w=await p.text(),S={};for(const R of w.split("&")){const[x,P]=R.split("=");S[x]=P}return{requestToken:S.oauth_token,requestTokenSecret:S.oauth_token_secret,callbackConfirmed:S.oauth_callback_confirmed==="true"}}signRequest(y,_,h,p){const w={...y,oauth_consumer_key:this.clientID,oauth_nonce:v.generateNonce(),oauth_timestamp:v.generateTimestamp(),oauth_version:"1.0",oauth_signature_method:"HMAC-SHA1"},S=Object.entries(w).sort(([k],[F])=>k.localeCompare(F)).map(([k,F])=>`${(0,l.fixedEncodeURIComponent)(k)}=${(0,l.fixedEncodeURIComponent)(F)}`).join("&"),R=`${_}&${(0,l.fixedEncodeURIComponent)(h)}&${(0,l.fixedEncodeURIComponent)(S)}`,x=`${this.clientSecret}&${p||""}`,P=o.default.stringify((0,s.default)(R,x));return{...w,oauth_signature:P,oauth_signature_method:"HMAC-SHA1"}}static getAuthorizationURL(y){let _=new URLSearchParams;_.set("oauth_token",y);let h=new URL(d);return h.search=_.toString(),h}async fetchAccessToken(y){y.set("oauth_consumer_key",this.clientID);let _=await fetch(u,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:y});if(!_.ok){let h=await _.text();throw f("error! "+h),new Response(h,{status:401})}return await this.getAccessToken(_.clone())}async getAccessToken(y){const _=await y.text(),h={};for(const S of _.split("&")){const[R,x]=S.split("=");h[R]=x}const p=h.oauth_token,w=h.oauth_token_secret;return{accessToken:p,accessTokenSecret:w}}async userProfile(y,_,h){const p=this.signRequest({oauth_token:y,include_email:h?"true":"false"},"GET",m,_),w=new URL(m);return w.search=new URLSearchParams(p).toString(),await(await fetch(w.toString())).json()}}t.TwitterStrategy=v})(Be);var Pt={};(function(t){var n=b&&b.__createBinding||(Object.create?function(r,a,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(a,i);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(r,s,o)}:function(r,a,i,s){s===void 0&&(s=i),r[s]=a[i]}),e=b&&b.__exportStar||function(r,a){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&n(a,r,i)};
180Object.defineProperty(t,"__esModule",{value:!0}),e(De,t)})(Pt);var Ft={};(function(t){var n=b&&b.__createBinding||(Object.create?function(r,a,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(a,i);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(r,s,o)}:function(r,a,i,s){s===void 0&&(s=i),r[s]=a[i]}),e=b&&b.__exportStar||function(r,a){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&n(a,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(Ne,t)})(Ft);var jt={};(function(t){var n=b&&b.__createBinding||(Object.create?function(r,a,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(a,i);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(r,s,o)}:function(r,a,i,s){s===void 0&&(s=i),r[s]=a[i]}),e=b&&b.__exportStar||function(r,a){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&n(a,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(Ie,t)})(jt);var Tt={},Dt={},Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});(function(t){var n=b&&b.__createBinding||(Object.create?function(i,s,o,l){l===void 0&&(l=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,l,f)}:function(i,s,o,l){l===void 0&&(l=o),i[l]=s[o]}),e=b&&b.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&n(s,i,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.FacebookStrategy=t.FacebookStrategyScopeSeperator=t.FacebookStrategyDefaultScopes=t.FacebookStrategyName=t.baseProfileFields=void 0;const r=I;e(Mt,t),t.baseProfileFields=["id","email","name","first_name","middle_name","last_name","picture"],t.FacebookStrategyName="facebook",t.FacebookStrategyDefaultScopes=["public_profile","email"],t.FacebookStrategyScopeSeperator=",";class a extends r.OAuth2Strategy{constructor({clientID:s,clientSecret:o,callbackURL:l,scope:f,extraProfileFields:c},d){super({clientID:s,clientSecret:o,callbackURL:l,authorizationURL:"https://facebook.com/v14.0/dialog/oauth",tokenURL:"https://graph.facebook.com/v14.0/oauth/access_token"},d),this.name=t.FacebookStrategyName,this.userInfoURL="https://graph.facebook.com/me",this.scope=this.getScope(f),this.profileFields=[...new Set([...t.baseProfileFields,...c||[]])]}getScope(s){if(s){if(typeof s=="string")return s.split(t.FacebookStrategyScopeSeperator)}else return t.FacebookStrategyDefaultScopes;return s}authorizationParams(){return new URLSearchParams({scope:this.scope.join(t.FacebookStrategyScopeSeperator)})}async userProfile(s){const o=`?fields=${this.profileFields.join(",")}`,l=`${this.userInfoURL}${o}`,c=await(await fetch(l,{headers:{Authorization:`Bearer ${s}`}})).json();return{provider:"facebook",id:c.id,displayName:c.name,name:{familyName:c.last_name,givenName:c.first_name},emails:[{value:c.email}],photos:[{value:c.picture.data.url}],_json:c}}}t.FacebookStrategy=a})(Dt);(function(t){var n=b&&b.__createBinding||(Object.create?function(r,a,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(a,i);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(r,s,o)}:function(r,a,i,s){s===void 0&&(s=i),r[s]=a[i]}),e=b&&b.__exportStar||function(r,a){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&n(a,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(Dt,t)})(Tt);var zt={};(function(t){var n=b&&b.__createBinding||(Object.create?function(r,a,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(a,i);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(r,s,o)}:function(r,a,i,s){s===void 0&&(s=i),r[s]=a[i]}),e=b&&b.__exportStar||function(r,a){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&n(a,r,i)};
180Object.defineProperty(t,"__esModule",{value:!0}),e($e,t)})(zt);var It={};(function(t){var n=b&&b.__createBinding||(Object.create?function(r,a,i,s){s===void 0&&(s=i);var o=Object.getOwnPropertyDescriptor(a,i);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(r,s,o)}:function(r,a,i,s){s===void 0&&(s=i),r[s]=a[i]}),e=b&&b.__exportStar||function(r,a){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&n(a,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(Be,t)})(It);(function(t){var n=b&&b.__createBinding||(Object.create?function(l,f,c,d){d===void 0&&(d=c);var u=Object.getOwnPropertyDescriptor(f,c);(!u||("get"in u?!f.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return f[c]}}),Object.defineProperty(l,d,u)}:function(l,f,c,d){d===void 0&&(d=c),l[d]=f[c]}),e=b&&b.__exportStar||function(l,f){for(var c in l)c!=="default"&&!Object.prototype.hasOwnProperty.call(f,c)&&n(f,l,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.SocialsProvider=void 0;const r=De,a=Ie,i=Ne,s=$e,o=Be;e(Pt,t),e(Ft,t),e(jt,t),e(Tt,t),e(zt,t),e(It,t),t.SocialsProvider={DISCORD:r.DiscordStrategyDefaultName,FACEBOOK:"facebook",GITHUB:a.GitHubStrategyDefaultName,GOOGLE:i.GoogleStrategyDefaultName,MICROSOFT:s.MicrosoftStrategyDefaultName,TWITTER:o.TwitterStrategyDefaultName}})(xt);function oa(){const t=ir(),{t:n}=ft();return C.jsxs("button",{onClick:async()=>{await q("Login",{method:"google"}),setTimeout(()=>{t.submit(null,{method:"post",action:`/auth/${xt.SocialsProvider.GOOGLE}`})},1500)},className:Ht(" flex w-full items-center justify-center gap-2 rounded-xl bg-stone-50 px-4 py-3 text-center font-semibold text-stone-700 transition hover:bg-stone-100 hover:text-stone-800 focus:outline-none"),children:[C.jsx(ca,{className:"h-5 w-5"})," ",n("login.login_with_google")]})}function ca(t){return C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",...t,children:[C.jsx("defs",{children:C.jsx("path",{id:"a",d:"M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z"})}),C.jsx("clipPath",{id:"b",children:C.jsx("use",{xlinkHref:"#a",overflow:"visible"})}),C.jsx("path",{clipPath:"url(#b)",fill:"#fabc05",d:"M0 37V11l17 13z"}),C.jsx("path",{clipPath:"url(#b)",fill:"#ea4335",d:"M0 11l17 13 7-6.1L48 14V0H0z"}),C.jsx("path",{clipPath:"url(#b)",fill:"#34a953",d:"M0 37l30-23 7.9 1L48 0v48H0z"}),C.jsx("path",{clipPath:"url(#b)",fill:"#4285f4",d:"M48 48L17 24l-4-3 35-10z"})]})}function ka(){const[t,n]=$t.useState(!1),{magicLinkSent:e,magicLinkEmail:r}=sr(),{t:a}=ft(),i=dr(),s=i.state==="submitting"||i.state==="loading";return C.jsx("div",{className:"h-screen bg-accent-100 pb-12 supports-[height:100cqh]:h-[100cqh] supports-[height:100svh]:h-[100svh]",children:C.jsxs("section",{className:"relative h-full",children:[C.jsx("div",{className:"relative flex h-full w-full flex-col items-center justify-center px-4 text-center",children:C.jsxs("div",{className:"w-full max-w-[500px] rounded-2xl border-stone-200 bg-white px-6 py-12 shadow-2xl sm:px-8",children:[C.jsx(me,{to:"/",prefetch:"render",children:C.jsx(pr,{className:"mx-auto h-6 w-auto text-blue-accent"})}),C.jsx("div",{className:"mb-2 mt-6 text-2xl font-bold text-stone-900",children:a("login.title")}),!t&&C.jsx("div",{className:"mt-8 w-full items-center",children:C.jsx(oa,{})}),C.jsx("div",{className:"mt-3 w-full",children:t?C.jsx(or,{method:"post",className:"mx-auto mb-4 mt-6 max-w-xs",children:e?C.jsxs("div",{children:[C.jsxs("span",{className:"",children:[C.jsx(gr,{className:"mr-1 inline-flex aspect-1 w-5 text-green-500","aria-hidden":"true"}),a("login.succesfully_sent_link")," ",r?C.jsxs(C.Fragment,{children:[a("vocab.to")," ",C.jsx("strong",{children:r})]}):""]}),C.jsx(Ge,{size:"xs",variant:"custom",className:"mt-6 font-extralight",type:"submit",formAction:"?/clear-email-link",children:a("login.wrong_email")})]}):C.jsxs("div",{className:"",children:[C.jsxs("div",{className:"mb-4 mt-2 space-y-1 text-left",children:[C.jsx("div",{className:"ml-1 text-sm font-medium",children:a("login.email")}),C.jsx(Bt,{name:"email",type:"email",id:"email",required:!0,placeholder:a("login.email_placeholder")})]}),C.jsx(Ge,{formAction:"?/submit-email-link",onClick:()=>{q("Login",{method:"email-link"}),q("Button Clicked",{button_label:"Email a login link",context:"Login Page, Email Login Link"})},disabled:s,loading:s,className:"w-full",type:"submit",children:a("login.email_a_link")})]})}):C.jsx("button",{onClick:()=>{n(!0),q("Button Clicked",{button_label:"Login with Email",context:"Login Page, Email Login"})},className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl bg-stone-50 px-4 py-3 text-center font-semibold text-stone-700 transition hover:bg-stone-100 hover:text-stone-800 focus:outline-none",children:a("login.login_with_email")})}),C.jsxs("p",{className:"mt-6 px-12 text-center text-[10px] text-stone-600",children:[a("login.terms_accept")," ",C.jsx("a",{href:"/terms-and-conditions",className:"underline",children:a("landing.footer.terms")})," ",a("vocab.and")," ",C.jsx("a",{href:"/privacy",className:"underline",children:a("landing.footer.privacy")}),"."]})]})}),C.jsxs("div",{className:"flex w-full justify-center gap-4 text-sm",children:[C.jsx(me,{className:"hover:underline",to:"/terms-and-conditions",onClick:Ve("Button Clicked",{button_label:"Terms and Conditions",context:"Landing, Footer Link"}),children:a("landing.footer.terms")}),C.jsx(me,{className:"hover:underline",to:"/privacy",onClick:Ve("Button Clicked",{button_label:"Privacy Policy",context:"Landing, Footer Link"}),children:a("landing.footer.privacy")})]})]})})}export{ka as default}; 181//# sourceMappingURL=login-Cj5-Rw03.js.map
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.