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ACA,MAAO,GAAAqF,EAAAvE,IAAA,EAACF,MAAAA,CAAI0E,MAAOrC,EAAgBpC,UAAWkC,EAAoBtB,wBAAsB,iBAAiBC,0BAAwB,+BAC7H,GAAA2D,EAAA1E,GAAA,EAACM,QAAAA,CAAO,GAAGyD,CAAK,CAAEY,MAAOb,EAAY5D,UAAWmC,EAAgBjB,SAAUX,GAAK6D,EAAa7D,EAAEY,MAAM,IACnGhC,GAAS,GAAAqF,EAAA1E,GAAA,EAACC,MAAAA,CAAIC,UAAU,sCAA8Bb,MAE7D,CAUA8C,EAAe1G,IAAI,CAAG,SAAgCrD,CAOrD,KAPqD,CACpDoD,MAAAA,CAAK,CACLmH,SAAAA,EAAWF,GAAKA,CAAM,CACtB,GAAGsB,EAIJ,CAPqD3L,EAQpD,MAAO,GAAAsM,EAAA1E,GAAA,EAACmC,EAAAA,CAAmB,GAAG4B,CAAK,CAAE1I,KAAK,OAAOG,MAAOA,MAAAA,EAAAA,KAAAA,EAAAA,EAAOoJ,WAAW,GAAG/P,KAAK,CAAC,IAAI,CAAC,EAAE,CAAE8N,SAAUF,IACpG,GAAI,CAACA,EACH,OAAOE,EAASjM,KAAAA,GAElB,IAAM4D,EAAI,IAAImB,KAAKgH,GACnB,GAAIoC,MAAMvK,EAAEwK,OAAO,IACjB,MAAM,MAAU,IAAMjP,MAAA,CAAF4M,EAAE,0BAExB,OAAOE,EAASrI,EAClB,GACF","sources":["webpack://_N_E/./src/lib/cognito/util.ts","webpack://_N_E/./src/lib/cognito/srp.ts","webpack://_N_E/./src/actions/authClientActions.ts","webpack://_N_E/./src/components/auth/Login.tsx","webpack://_N_E/./src/components/auth/Register.tsx","webpack://_N_E/./src/app/(v2)/LoginRegister.tsx","webpack://_N_E/./src/components/form/ValidatedInput.tsx"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You\n * may not use this file except in compliance with the License. A copy of\n * the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n */\nimport {\n type CognitoAccessTokenPayload,\n type CognitoIdTokenPayload,\n} from './jwt-model';\n\nexport function parseJwtPayload<\n T extends CognitoAccessTokenPayload | CognitoIdTokenPayload,\n>(jwt: string) {\n const parts = jwt.split('.');\n const payload = parts[1];\n if (!payload) {\n throw new Error('Invalid JWT');\n }\n return JSON.parse(\n new TextDecoder().decode(bufferFromBase64Url(payload)),\n ) as T;\n}\n\n/**\n * Schedule a callback once, like setTimeout, but count\n * time spent sleeping also as time spent. This way, if the browser tab\n * where this is happening is activated again after sleeping,\n * the callback is run immediately (more precise: within 1 second)\n */\nexport function setTimeoutWallClock(cb: () => T, ms: number) {\n const executeAt = Date.now() + ms;\n const i = setInterval(() => {\n if (Date.now() >= executeAt) {\n clearInterval(i);\n cb();\n }\n }, 1000);\n\n // unref the interval if we can, so that e.g. when running in Node.js\n // this interval would not block program exit:\n if (typeof i.unref === 'function') i.unref();\n\n return () => clearInterval(i);\n}\n\nexport function currentBrowserLocationWithoutFragmentIdentifier() {\n const current = new URL(location.href);\n current.hash = '';\n return current.href;\n}\n\nexport function removeFragmentIdentifierFromBrowserLocation() {\n history.pushState('', '', currentBrowserLocationWithoutFragmentIdentifier());\n}\n\nexport function timeAgo(now: Date, historicDate?: Date) {\n if (!historicDate) return;\n const ranges = {\n years: 3600 * 24 * 365,\n months: 3600 * 24 * 30,\n weeks: 3600 * 24 * 7,\n days: 3600 * 24,\n hours: 3600,\n minutes: 60,\n };\n const secondsElapsed = Math.max(\n (now.valueOf() - historicDate.valueOf()) / 1000,\n 0,\n );\n const [unit, range] = Object.entries(ranges).find(([, range]) => {\n return range < secondsElapsed;\n }) ?? ['seconds', 1];\n const delta = secondsElapsed / range;\n return unit === 'seconds' && delta < 10\n ? 'Just now'\n : new Intl.RelativeTimeFormat('en').format(\n -Math.floor(delta),\n unit as Intl.RelativeTimeFormatUnit,\n );\n}\n\n/**\n * Base64 implementations below as atob and btoa don't work with unicode\n * and aren't available in all JS environments to begin with, e.g. React Native\n */\n\nconst _bufferFromBase64 = function (characters: string, padChar = '') {\n const map = characters\n .split('')\n .reduce(\n (acc, char, index) => Object.assign(acc, { [char.charCodeAt(0)]: index }),\n {} as { [key: number]: number },\n );\n return function (base64: string) {\n const paddingLength = padChar\n ? base64.match(new RegExp(`^.+?(${padChar}?${padChar}?)$`))![1].length\n : 0;\n let first: number, second: number, third: number, fourth: number;\n return base64.match(/.{1,4}/g)!.reduce(\n (acc, chunk, index) => {\n first = map[chunk.charCodeAt(0)];\n second = map[chunk.charCodeAt(1)];\n third = map[chunk.charCodeAt(2)];\n fourth = map[chunk.charCodeAt(3)];\n acc[3 * index] = (first << 2) | (second >> 4);\n acc[3 * index + 1] = ((second & 0b1111) << 4) | (third >> 2);\n acc[3 * index + 2] = ((third & 0b11) << 6) | fourth;\n return acc;\n },\n new Uint8Array((base64.length * 3) / 4 - paddingLength),\n );\n };\n};\n\nexport const bufferFromBase64 = _bufferFromBase64(\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n '=',\n);\nexport const bufferFromBase64Url = _bufferFromBase64(\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n);\n\nconst _bufferToBase64 = function (characters: string, padChar = '') {\n const map = characters\n .split('')\n .reduce(\n (acc, char, index) => Object.assign(acc, { [index]: char }),\n {} as { [key: number]: string },\n );\n return function (base64: ArrayBuffer) {\n const result = [] as string[];\n for (const chunk of chunks(new Uint8Array(base64), 3)) {\n result.push(map[chunk[0] >> 2]);\n result.push(map[((chunk[0] & 0b11) << 4) | (chunk[1] >> 4)]);\n result.push(\n chunk[1] !== undefined\n ? map[((chunk[1] & 0b1111) << 2) | (chunk[2] >> 6)]\n : padChar,\n );\n result.push(chunk[2] !== undefined ? map[chunk[2] & 0b111111] : padChar);\n }\n return result.join('');\n };\n};\n\nexport const bufferToBase64 = _bufferToBase64(\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n '=',\n);\nexport const bufferToBase64Url = _bufferToBase64(\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n);\n\nfunction* chunks(arr: Uint8Array, n: number): Generator {\n for (let i = 0; i < arr.length; i += n) {\n yield arr.subarray(i, i + n);\n }\n}\n","/**\n * Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You\n * may not use this file except in compliance with the License. A copy of\n * the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n */\nimport { bufferFromBase64, bufferToBase64 } from './util';\n\nlet _CONSTANTS: { g: bigint; N: bigint; k: bigint } | undefined;\nasync function getConstants() {\n if (!_CONSTANTS) {\n const g = BigInt(2);\n const N = BigInt(\n '0x' +\n 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' +\n '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' +\n 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' +\n 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' +\n 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' +\n 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' +\n '83655D23DCA3AD961C62F356208552BB9ED529077096966D' +\n '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' +\n 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' +\n 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' +\n '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' +\n 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' +\n 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' +\n 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' +\n 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' +\n '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF',\n );\n const k = arrayBufferToBigInt(\n await crypto.subtle.digest(\n 'SHA-256',\n hexToArrayBuffer(`${padHex(N.toString(16))}${padHex(g.toString(16))}`),\n ),\n );\n _CONSTANTS = {\n g,\n N,\n k,\n };\n }\n return _CONSTANTS;\n}\n\n/**\n * modulo that works on negative bases too\n */\nfunction modulo(base: bigint, mod: bigint) {\n return ((base % mod) + mod) % mod;\n}\n\nfunction modPow(base: bigint, exp: bigint, mod: bigint) {\n // Calculate: (base ** exp) % mod\n let result = BigInt(1);\n let x = modulo(base, mod);\n while (exp > BigInt(0)) {\n if (modulo(exp, BigInt(2))) {\n result = modulo(result * x, mod);\n }\n exp = exp / BigInt(2);\n x = modulo(x * x, mod);\n }\n return result;\n}\n\nfunction padHex(hexStr: string) {\n hexStr = hexStr.length % 2 ? `0${hexStr}` : hexStr;\n hexStr = parseInt(hexStr.slice(0, 2), 16) >> 7 ? `00${hexStr}` : hexStr;\n return hexStr;\n}\n\nexport function generateSmallA() {\n const randomValues = new Uint8Array(128);\n crypto.getRandomValues(randomValues);\n return arrayBufferToBigInt(randomValues.buffer);\n}\n\nexport async function calculateLargeA(smallA: bigint) {\n const { g, N } = await getConstants();\n return modPow(g, smallA, N);\n}\n\nexport async function calculateSrpSignature({\n smallA,\n largeAHex,\n srpBHex,\n salt,\n userPoolId,\n username,\n password,\n secretBlock,\n}: {\n smallA: bigint;\n largeAHex: string;\n srpBHex: string;\n salt: string;\n userPoolId: string;\n username: string;\n password: string;\n secretBlock: string;\n}) {\n const aPlusBHex = padHex(largeAHex) + padHex(srpBHex);\n const u = await crypto.subtle.digest('SHA-256', hexToArrayBuffer(aPlusBHex));\n const [, userPoolName] = userPoolId.split('_');\n const usernamePasswordHash = await crypto.subtle.digest(\n 'SHA-256',\n new TextEncoder().encode(`${userPoolName}${username}:${password}`),\n );\n\n const x = await crypto.subtle.digest(\n 'SHA-256',\n await new Blob([\n hexToArrayBuffer(padHex(salt)),\n usernamePasswordHash,\n ]).arrayBuffer(),\n );\n\n const { g, N, k } = await getConstants();\n const gModPowXN = modPow(g, arrayBufferToBigInt(x), N);\n const int = BigInt(`0x${srpBHex}`) - k * gModPowXN;\n const s = modPow(\n int,\n smallA + arrayBufferToBigInt(u) * arrayBufferToBigInt(x),\n N,\n );\n const ikmHex = padHex(s.toString(16));\n const saltHkdfHex = padHex(arrayBufferToHex(u));\n const infoBits = new Uint8Array([\n ...'Caldera Derived Key'.split('').map((c) => c.charCodeAt(0)),\n 1,\n ]).buffer;\n const prkKey = await crypto.subtle.importKey(\n 'raw',\n hexToArrayBuffer(saltHkdfHex),\n {\n name: 'HMAC',\n hash: { name: 'SHA-256' },\n },\n false,\n ['sign'],\n );\n const prk = await crypto.subtle.sign(\n 'HMAC',\n prkKey,\n hexToArrayBuffer(ikmHex),\n );\n const hkdfKey = await crypto.subtle.importKey(\n 'raw',\n prk,\n {\n name: 'HMAC',\n hash: { name: 'SHA-256' },\n },\n false,\n ['sign'],\n );\n const hkdf = (await crypto.subtle.sign('HMAC', hkdfKey, infoBits)).slice(\n 0,\n 16,\n );\n\n const timestamp = formatDate(new Date());\n const parts = [\n userPoolName.split('').map((c) => c.charCodeAt(0)),\n username.split('').map((c) => c.charCodeAt(0)),\n ...bufferFromBase64(secretBlock),\n timestamp.split('').map((c) => c.charCodeAt(0)),\n ].flat();\n\n const msg = new Uint8Array(parts).buffer;\n\n const signatureKey = await crypto.subtle.importKey(\n 'raw',\n hkdf,\n {\n name: 'HMAC',\n hash: { name: 'SHA-256' },\n },\n false,\n ['sign'],\n );\n\n const signatureString = await crypto.subtle.sign('HMAC', signatureKey, msg);\n return {\n timestamp,\n passwordClaimSignature: bufferToBase64(signatureString),\n };\n}\n\nfunction hexToArrayBuffer(hexStr: string) {\n if (hexStr.length % 2 !== 0) {\n throw new Error('hex string should have even number of characters');\n }\n const octets = hexStr.match(/.{2}/gi)!.map((m) => parseInt(m, 16));\n return new Uint8Array(octets);\n}\n\nfunction arrayBufferToHex(arrBuf: ArrayBuffer) {\n return [...new Uint8Array(arrBuf)]\n .map((x) => x.toString(16).padStart(2, '0'))\n .join('');\n}\n\nfunction arrayBufferToBigInt(arrBuf: ArrayBuffer) {\n return BigInt(`0x${arrayBufferToHex(arrBuf)}`);\n}\n\nfunction formatDate(d: Date) {\n const parts = new Intl.DateTimeFormat('en-u-hc-h23', {\n weekday: 'short',\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n timeZone: 'UTC',\n timeZoneName: 'short',\n hour12: false,\n }).formatToParts(d);\n const p = (type: string) => parts.find((part) => part.type === type)?.value;\n return [\n p('weekday'),\n p('month'),\n p('day'),\n [p('hour'), p('minute'), p('second')].join(':'),\n p('timeZoneName'),\n p('year'),\n ].join(' ');\n}\n","'use client';\n\nimport { type ChallengeNameType } from '@aws-sdk/client-cognito-identity-provider';\n\nimport {\n confirmSignUp,\n initiateUserSrpAuth,\n respondToAuthChallenge,\n signUp,\n} from '@/actions/authActions';\nimport {\n calculateLargeA,\n calculateSrpSignature,\n generateSmallA,\n} from '@/lib/cognito/srp';\nimport { throwServerError } from '@/lib/errors/client';\nimport { type UserRegistrationData } from '@/lib/state/user';\n\nexport async function loginChallengeResponse({\n username,\n password,\n get,\n}: {\n username: string;\n password: string;\n get?: (type: 'mfa-code') => Promise;\n}) {\n const a = generateSmallA();\n const A = await calculateLargeA(a);\n\n const challenge = await initiateUserSrpAuth({ A, username });\n let challengeName: ChallengeNameType = challenge.ChallengeName;\n const {\n SALT: saltHex,\n SRP_B: srpBHex,\n SECRET_BLOCK: secretBlockB64,\n USER_ID_FOR_SRP: userIdForSrp,\n } = challenge.ChallengeParameters;\n\n const { passwordClaimSignature, timestamp } = await calculateSrpSignature({\n smallA: a,\n largeAHex: A.toString(16),\n srpBHex,\n salt: saltHex,\n username: userIdForSrp,\n userPoolId: process.env.NEXT_PUBLIC_AWS_COGNITO_USER_POOL_ID!,\n password,\n secretBlock: secretBlockB64,\n });\n\n let responseParameters: Record = {\n PASSWORD_CLAIM_SECRET_BLOCK: secretBlockB64,\n TIMESTAMP: timestamp,\n PASSWORD_CLAIM_SIGNATURE: passwordClaimSignature,\n };\n let authResult: Awaited>;\n for (;;) {\n authResult = await throwServerError(\n respondToAuthChallenge({\n session: challenge.Session,\n challengeName: challengeName,\n responses: {\n USERNAME: username,\n ...responseParameters,\n },\n }),\n );\n if ('signedIn' in authResult) {\n return authResult;\n }\n if (!authResult.ChallengeName) {\n throw new Error('No challenge name');\n }\n\n challengeName = authResult.ChallengeName;\n responseParameters = {};\n switch (challengeName) {\n case 'SMS_MFA':\n if (!get) {\n throw new Error(`Unsupported challenge: ${authResult.ChallengeName}`);\n }\n responseParameters.SMS_MFA_CODE = await get('mfa-code');\n\n // case 'NEW_PASSWORD_REQUIRED':\n // if (!get) {\n // throw new Error(`Unsupported challenge: ${authResult.ChallengeName}`);\n // }\n // responseParameters.NEW_PASSWORD = await get('new-password');\n\n default:\n throw new Error(`Unsupported challenge: ${authResult.ChallengeName}`);\n }\n }\n}\n\nexport async function signUpAndConfirm({\n email,\n name,\n password,\n get,\n ...rest\n}: {\n password: string;\n get: (type: 'email-code') => Promise;\n} & UserRegistrationData) {\n const result = await throwServerError(signUp({ email, name, password }));\n return await throwServerError(\n confirmSignUp({\n session: result.Session,\n email,\n name,\n ...rest,\n code: await get('email-code'),\n }),\n );\n}\n","'use client';\n\nimport { useContext, useEffect, useState } from 'react';\nimport { loginChallengeResponse } from '@/actions/authClientActions';\nimport { AuthContext } from '@/app/(v2)/(auth)/Auth';\nimport { callbackToPromise, useIsMounted } from '@/lib/client-utils';\nimport { callSafe } from '@/lib/errors/client';\nimport Spinner from '../common/Spinner';\nexport function Login({\n onLoggedIn\n}: {\n onLoggedIn?: () => void;\n}) {\n const auth = useContext(AuthContext);\n const isMounted = useIsMounted();\n const [pending, setPending] = useState(false);\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [getCode, setGetCode] = useState<(_: string) => void>();\n const [error, setError] = useState();\n const [showPassword, setShowPassword] = useState(false);\n\n // Clear form fields when component mounts or when auth state changes\n useEffect(() => {\n // Clear form fields\n setUsername('');\n setPassword('');\n setError(undefined);\n setShowPassword(false);\n }, [auth.user]); // Reset when auth.user changes (login/logout)\n\n const login = callSafe(async () => {\n if (!username || !password) {\n setError('Please enter both username and password');\n return;\n }\n await loginChallengeResponse({\n username,\n password,\n get: () => callbackToPromise(setGetCode)\n });\n\n // Clear form fields after successful login\n setUsername('');\n setPassword('');\n setError(undefined);\n onLoggedIn?.();\n auth.reload();\n }, isMounted, setError, setPending);\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n login();\n };\n if (getCode) {\n return
\n
\n

Verification

\n
\n \n {\n if (getCode && e.key === 'Enter') {\n getCode(e.currentTarget.value);\n }\n }} autoComplete=\"one-time-code\" />\n
\n
\n
;\n }\n if (pending) {\n return
\n \n
;\n }\n return
\n
\n {error &&
{error}
}\n\n
\n \n setUsername(e.target.value)} autoComplete=\"off\" />\n
\n\n
\n \n
\n setPassword(e.target.value)} autoComplete=\"new-password\" // prevents browser from saving this\n />\n \n
\n
\n
\n \n
\n
\n\n \n
;\n}","'use client';\n\nimport { useContext, useEffect, useState } from 'react';\nimport { signUpAndConfirm } from '@/actions/authClientActions';\nimport { AuthContext } from '@/app/(v2)/(auth)/Auth';\nimport { callbackToPromise, useIsMounted } from '@/lib/client-utils';\nimport { callSafe } from '@/lib/errors/client';\nimport Spinner from '../common/Spinner';\nimport { ValidatedInput } from '../form/ValidatedInput';\nexport function Register({\n onRegistered\n}: {\n onRegistered?: () => void;\n}) {\n const auth = useContext(AuthContext);\n const isMounted = useIsMounted();\n const [pending, setPending] = useState(false);\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [password2, setPassword2] = useState();\n const [dateOfBirth, setDateOfBirth] = useState();\n const [name, setName] = useState('');\n const [gender, setGender] = useState();\n const [getCode, setGetCode] = useState<(_: string) => void>();\n const [error, setError] = useState();\n const [showPassword, setShowPassword] = useState(false);\n\n // Clear form fields when component mounts or when auth state changes\n useEffect(() => {\n // Clear form fields\n setUsername('');\n setPassword('');\n setPassword2('');\n setName('');\n setError(undefined);\n setShowPassword(false);\n }, [auth.user]); // Reset when auth.user changes (signup/logout)\n\n const register = callSafe(async () => {\n if (!username || !password || password !== password2 || !name || !dateOfBirth) {\n setError('Please fill in all fields and ensure passwords match');\n return;\n }\n await signUpAndConfirm({\n email: username,\n password,\n name,\n dateOfBirth,\n gender,\n get: () => callbackToPromise(setGetCode)\n });\n\n // Clear form fields after successful registration\n setUsername('');\n setPassword('');\n setPassword2('');\n setName('');\n setError(undefined);\n onRegistered?.();\n auth.reload();\n }, isMounted, setError, setPending);\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n register();\n };\n if (getCode) {\n return
\n
\n

Verification

\n
\n \n {\n if (getCode && e.key === 'Enter') {\n getCode(e.currentTarget.value);\n }\n }} autoComplete=\"one-time-code\" />\n
\n
\n
;\n }\n if (pending) {\n return
\n \n
;\n }\n return
\n
\n {error &&
{error}
}\n\n
\n \n setName(e.target.value)} autoComplete=\"off\" />\n
\n\n
\n \n
\n {/* {!dateOfBirth && (\n
\n Enter your birthday\n
\n )} */}\n setDateOfBirth(v)} data-sentry-element=\"unknown\" data-sentry-source-file=\"Register.tsx\" />\n
\n
\n\n
\n \n setGender(e.target.value || undefined)} />\n
\n\n
\n \n setUsername(e.target.value)} autoComplete=\"off\" />\n
\n\n
\n \n
\n setPassword(e.target.value)} autoComplete=\"new-password\" // prevents browser from saving\n />\n \n
\n
\n\n
\n \n
\n {\n if (!v) return;\n if (v !== password) {\n throw new Error('Passwords do not match');\n }\n return v;\n }} onChange={v => setPassword2(v)} autoComplete=\"new-password\" // prevents browser from saving\n data-sentry-element=\"ValidatedInput\" data-sentry-source-file=\"Register.tsx\" />\n
\n
\n
\n \n
\n
\n
;\n}","'use client';\n\nimport { faClose } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useEffect, useState } from 'react';\nimport { Login } from '@/components/auth/Login';\nimport { Register } from '@/components/auth/Register';\nimport { Tabs } from '@/components/common/Tabs';\nexport function LoginRegister({\n onSuccess,\n initialMode = 'login',\n isPopup = false,\n onClose\n}: {\n onSuccess?: () => void;\n initialMode?: 'login' | 'register';\n isPopup?: boolean;\n onClose?: () => void;\n}) {\n // Determine initial tab based on initialMode\n const initialTab = initialMode === 'login' ? 'Login' : 'Sign up';\n\n // State to track selected tab\n const [currentTab, setCurrentTab] = useState(initialTab);\n\n // Force remount to clear the form for safety\n const [key, setKey] = useState(0);\n useEffect(() => {\n setKey(prevKey => prevKey + 1);\n }, [currentTab]);\n const handleTabChange = (tab: string) => {\n setCurrentTab(tab);\n };\n return
\n
\n {isPopup && onClose && }\n \n {{\n Login: ,\n 'Sign up': \n }}\n \n
\n
;\n}","'use client';\n\nimport { type CSSProperties, type InputHTMLAttributes, type ReactNode, useState } from 'react';\ntype ValidatedInputProps = Omit, 'style' | 'className' | 'onChange'> & {\n inputClassName?: string;\n containerClassName?: string;\n inputStyle?: CSSProperties;\n containerStyle?: CSSProperties;\n validate: (this: HTMLInputElement, value: string) => T | Promise;\n onChange: (this: HTMLInputElement, value: T | undefined) => void;\n};\nexport function ValidatedInput({\n validate,\n onChange,\n inputClassName = '',\n containerClassName = '',\n inputStyle,\n containerStyle,\n ...props\n}: ValidatedInputProps) {\n const [error, setError] = useState();\n const onOk = (el: HTMLInputElement, value: T) => {\n setError(undefined);\n onChange.call(el, value);\n };\n const onError = (el: HTMLInputElement, error: any) => {\n if (typeof error === 'object' && error instanceof Error) {\n setError(error.message);\n } else {\n setError(`${error}`);\n }\n onChange.call(el, undefined);\n };\n const handleChange = (el: HTMLInputElement) => {\n try {\n const r = validate.call(el, el.value);\n if (typeof r === 'object' && r instanceof Promise) {\n return r.then(v => onOk(el, v), e => onError(el, e));\n } else {\n onOk(el, r);\n }\n } catch (error) {\n onError(el, error);\n }\n };\n return
\n handleChange(e.target)} />\n {error &&
{error}
}\n
;\n}\ninterface ValidatedInput {\n Date(props: Omit, 'type' | 'validate' | 'value'> & {\n value?: Date;\n validate: (v: Date | undefined) => T;\n }): ReactNode;\n Date(props: Omit, 'type' | 'validate' | 'value'> & {\n value?: Date;\n }): ReactNode;\n}\nValidatedInput.Date = function ({\n value,\n validate = v => v as T,\n ...props\n}: Omit, 'type' | 'validate' | 'value'> & {\n value?: Date;\n validate?: (v: Date | undefined) => T;\n}) {\n return {...props} type=\"date\" value={value?.toISOString().split('T')[0]} validate={v => {\n if (!v) {\n return validate(undefined);\n }\n const d = new Date(v);\n if (isNaN(d.getDate())) {\n throw new Error(`'${v}' is not a valid date`);\n }\n return validate(d);\n }} />;\n};"],"names":["_CONSTANTS","_bufferFromBase64","characters","padChar","map","split","reduce","acc","char","index","Object","assign","charCodeAt","base64","first","second","third","fourth","paddingLength","match","RegExp","concat","length","chunk","Uint8Array","bufferFromBase64","_bufferToBase64","result","chunks","arr","n","i","subarray","push","undefined","join","bufferToBase64","getConstants","g","BigInt","N","k","arrayBufferToBigInt","crypto","subtle","digest","hexToArrayBuffer","padHex","toString","modPow","base","exp","mod","x","hexStr","parseInt","slice","calculateLargeA","smallA","calculateSrpSignature","param","largeAHex","srpBHex","salt","userPoolId","username","password","secretBlock","aPlusBHex","u","userPoolName","usernamePasswordHash","TextEncoder","encode","Blob","arrayBuffer","gModPowXN","ikmHex","s","saltHkdfHex","arrayBufferToHex","infoBits","c","buffer","prkKey","importKey","name","hash","prk","sign","hkdfKey","hkdf","timestamp","formatDate","d","parts","Intl","DateTimeFormat","weekday","year","month","day","hour","minute","timeZone","timeZoneName","hour12","formatToParts","p","type","find","part","value","Date","msg","flat","signatureKey","passwordClaimSignature","m","arrBuf","padStart","loginChallengeResponse","authResult","get","a","generateSmallA","randomValues","getRandomValues","A","challenge","initiateUserSrpAuth","challengeName","ChallengeName","SALT","saltHex","SRP_B","SECRET_BLOCK","secretBlockB64","USER_ID_FOR_SRP","userIdForSrp","ChallengeParameters","process","responseParameters","PASSWORD_CLAIM_SECRET_BLOCK","TIMESTAMP","PASSWORD_CLAIM_SIGNATURE","throwServerError","respondToAuthChallenge","session","Session","responses","USERNAME","SMS_MFA_CODE","signUpAndConfirm","email","rest","signUp","confirmSignUp","code","Login","onLoggedIn","auth","useContext","AuthContext","isMounted","useIsMounted","pending","setPending","useState","setUsername","setPassword","getCode","setGetCode","error","setError","showPassword","setShowPassword","useEffect","user","login","callSafe","callbackToPromise","reload","jsx_runtime","jsx","div","className","jsxs","h2","label","input","placeholder","onKeyUp","e","key","currentTarget","autoComplete","Spinner","data-sentry-component","data-sentry-source-file","form","onSubmit","preventDefault","htmlFor","onChange","target","button","onClick","href","Register","onRegistered","password2","setPassword2","dateOfBirth","setDateOfBirth","setName","gender","setGender","register","ValidatedInput","containerClassName","inputClassName","containerStyle","position","zIndex","v","data-sentry-element","validate","LoginRegister","onSuccess","initialMode","isPopup","onClose","initialTab","currentTab","setCurrentTab","setKey","prevKey","aria-label","FontAwesomeIcon","icon","faClose","Tabs","initial","onTabChange","tab","inputStyle","props","onOk","el","call","onError","Error","message","handleChange","r","Promise","then","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","style","toISOString","isNaN","getDate"],"sourceRoot":""}