@tinyrack/issuary-server 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/oauth-client.entity.d.ts +0 -18
- package/dist/entities/oauth-client.entity.d.ts.map +1 -1
- package/dist/entities/oauth-code.entity.d.ts +0 -18
- package/dist/entities/oauth-code.entity.d.ts.map +1 -1
- package/dist/entities/oauth-device-code.entity.d.ts +0 -18
- package/dist/entities/oauth-device-code.entity.d.ts.map +1 -1
- package/dist/entities/revoked-token.entity.d.ts +0 -18
- package/dist/entities/revoked-token.entity.d.ts.map +1 -1
- package/dist/entities/terms-content.entity.d.ts +0 -9
- package/dist/entities/terms-content.entity.d.ts.map +1 -1
- package/dist/entities/terms.entity.d.ts +0 -9
- package/dist/entities/terms.entity.d.ts.map +1 -1
- package/dist/entities/user-consent.entity.d.ts +0 -18
- package/dist/entities/user-consent.entity.d.ts.map +1 -1
- package/dist/entities/user-terms-consent.entity.d.ts +0 -9
- package/dist/entities/user-terms-consent.entity.d.ts.map +1 -1
- package/dist/entities/user-totp-recovery-code.entity.d.ts +0 -9
- package/dist/entities/user-totp-recovery-code.entity.d.ts.map +1 -1
- package/dist/entities/user-totp.entity.d.ts +0 -9
- package/dist/entities/user-totp.entity.d.ts.map +1 -1
- package/dist/entities/user.entity.d.ts +0 -9
- package/dist/entities/user.entity.d.ts.map +1 -1
- package/dist/entities/user.entity.js +0 -4
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entrypoints/app.d.ts +0 -59
- package/dist/entrypoints/app.d.ts.map +1 -1
- package/dist/entrypoints/database/postgres/compiled-functions.d.ts +20 -23
- package/dist/entrypoints/database/postgres/compiled-functions.d.ts.map +1 -1
- package/dist/entrypoints/database/postgres/compiled-functions.js +104 -134
- package/dist/entrypoints/database/postgres/compiled-functions.js.map +1 -1
- package/dist/entrypoints/database/sqlite/compiled-functions.d.ts +20 -23
- package/dist/entrypoints/database/sqlite/compiled-functions.d.ts.map +1 -1
- package/dist/entrypoints/database/sqlite/compiled-functions.js +104 -134
- package/dist/entrypoints/database/sqlite/compiled-functions.js.map +1 -1
- package/dist/lib/config/branding.d.ts +0 -4
- package/dist/lib/config/branding.d.ts.map +1 -1
- package/dist/lib/config/branding.js +0 -14
- package/dist/lib/config/branding.js.map +1 -1
- package/dist/lib/config/resolved.d.ts +0 -3
- package/dist/lib/config/resolved.d.ts.map +1 -1
- package/dist/lib/config/security.d.ts +0 -2
- package/dist/lib/config/security.d.ts.map +1 -1
- package/dist/lib/config/security.js +0 -5
- package/dist/lib/config/security.js.map +1 -1
- package/dist/middleware/auth.d.ts +0 -8
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js +0 -64
- package/dist/middleware/auth.js.map +1 -1
- package/dist/middleware/session.d.ts +0 -9
- package/dist/middleware/session.d.ts.map +1 -1
- package/dist/middleware/session.js +0 -18
- package/dist/middleware/session.js.map +1 -1
- package/dist/migrations/postgres/Migration20260825140000_drop_password_reset_required.d.ts +6 -0
- package/dist/migrations/postgres/Migration20260825140000_drop_password_reset_required.d.ts.map +1 -0
- package/dist/migrations/postgres/Migration20260825140000_drop_password_reset_required.js +19 -0
- package/dist/migrations/postgres/Migration20260825140000_drop_password_reset_required.js.map +1 -0
- package/dist/migrations/postgres/index.d.ts.map +1 -1
- package/dist/migrations/postgres/index.js +2 -0
- package/dist/migrations/postgres/index.js.map +1 -1
- package/dist/migrations/sqlite/Migration20260825140000_drop_password_reset_required.d.ts +6 -0
- package/dist/migrations/sqlite/Migration20260825140000_drop_password_reset_required.d.ts.map +1 -0
- package/dist/migrations/sqlite/Migration20260825140000_drop_password_reset_required.js +19 -0
- package/dist/migrations/sqlite/Migration20260825140000_drop_password_reset_required.js.map +1 -0
- package/dist/migrations/sqlite/index.d.ts.map +1 -1
- package/dist/migrations/sqlite/index.js +2 -0
- package/dist/migrations/sqlite/index.js.map +1 -1
- package/dist/repositories/oauth-code.repository.d.ts +2 -2
- package/dist/repositories/oauth-code.repository.d.ts.map +1 -1
- package/dist/repositories/oauth-code.repository.js +3 -7
- package/dist/repositories/oauth-code.repository.js.map +1 -1
- package/dist/repositories/oauth-device-code.repository.d.ts +4 -4
- package/dist/repositories/oauth-device-code.repository.d.ts.map +1 -1
- package/dist/repositories/oauth-device-code.repository.js +6 -18
- package/dist/repositories/oauth-device-code.repository.js.map +1 -1
- package/dist/repositories/user-totp-recovery-code.repository.d.ts +1 -7
- package/dist/repositories/user-totp-recovery-code.repository.d.ts.map +1 -1
- package/dist/repositories/user-totp-recovery-code.repository.js +1 -2
- package/dist/repositories/user-totp-recovery-code.repository.js.map +1 -1
- package/dist/repositories/user-totp.repository.d.ts +0 -9
- package/dist/repositories/user-totp.repository.d.ts.map +1 -1
- package/dist/routes/api/auth/index.d.ts +0 -52
- package/dist/routes/api/auth/index.d.ts.map +1 -1
- package/dist/routes/api/auth/index.js +0 -2
- package/dist/routes/api/auth/index.js.map +1 -1
- package/dist/routes/api/auth/passkey/verify/post.d.ts +0 -37
- package/dist/routes/api/auth/passkey/verify/post.d.ts.map +1 -1
- package/dist/routes/api/auth/passkey/verify/post.js +2 -8
- package/dist/routes/api/auth/passkey/verify/post.js.map +1 -1
- package/dist/routes/api/config/get.d.ts +0 -4
- package/dist/routes/api/config/get.d.ts.map +1 -1
- package/dist/routes/api/config/get.js +0 -2
- package/dist/routes/api/config/get.js.map +1 -1
- package/dist/routes/api/config/index.d.ts +0 -4
- package/dist/routes/api/config/index.d.ts.map +1 -1
- package/dist/routes/api/index.d.ts +0 -56
- package/dist/routes/api/index.d.ts.map +1 -1
- package/dist/routes/index.d.ts +0 -56
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/oauth/device/get-post.js +5 -5
- package/dist/routes/oauth/device/get-post.js.map +1 -1
- package/dist/schemas/error.d.ts +0 -25
- package/dist/schemas/error.d.ts.map +1 -1
- package/dist/schemas/error.js +0 -1
- package/dist/schemas/error.js.map +1 -1
- package/dist/schemas/response.d.ts +0 -24
- package/dist/schemas/response.d.ts.map +1 -1
- package/dist/schemas/response.js +0 -13
- package/dist/schemas/response.js.map +1 -1
- package/dist/seeders/config.seeder.js +0 -1
- package/dist/seeders/config.seeder.js.map +1 -1
- package/dist/services/container.d.ts +0 -3
- package/dist/services/container.d.ts.map +1 -1
- package/dist/services/container.js +0 -15
- package/dist/services/container.js.map +1 -1
- package/dist/services/oauth-client.service.d.ts +0 -1
- package/dist/services/oauth-client.service.d.ts.map +1 -1
- package/dist/services/oauth-client.service.js +2 -17
- package/dist/services/oauth-client.service.js.map +1 -1
- package/dist/services/oauth-connect.service.d.ts.map +1 -1
- package/dist/services/oauth-connect.service.js +0 -4
- package/dist/services/oauth-connect.service.js.map +1 -1
- package/dist/services/oauth-token.service.d.ts.map +1 -1
- package/dist/services/oauth-token.service.js +4 -4
- package/dist/services/oauth-token.service.js.map +1 -1
- package/dist/services/password-auth.service.d.ts.map +1 -1
- package/dist/services/password-auth.service.js +3 -12
- package/dist/services/password-auth.service.js.map +1 -1
- package/dist/services/security.service.d.ts +0 -8
- package/dist/services/security.service.d.ts.map +1 -1
- package/dist/services/security.service.js +21 -82
- package/dist/services/security.service.js.map +1 -1
- package/dist/services/totp.service.js +2 -2
- package/dist/services/totp.service.js.map +1 -1
- package/package.json +2 -1
- package/public/assets/2fa-6btYq1AL.js +2 -0
- package/public/assets/{2fa-C37MUkye.js.map → 2fa-6btYq1AL.js.map} +1 -1
- package/public/assets/2fa-D3ieXkuh.js +2 -0
- package/public/assets/{2fa-kiqzGSz2.js.map → 2fa-D3ieXkuh.js.map} +1 -1
- package/public/assets/2fa-Dxh4Kxy-.js +2 -0
- package/public/assets/{2fa-BgveHSB_.js.map → 2fa-Dxh4Kxy-.js.map} +1 -1
- package/public/assets/2fa-UcpXAI9J.js +2 -0
- package/public/assets/{2fa-UL_cNRnQ.js.map → 2fa-UcpXAI9J.js.map} +1 -1
- package/public/assets/{DialogHandle-Zvz8SgS0.js → DialogHandle-tiMUnjZQ.js} +2 -2
- package/public/assets/{DialogHandle-Zvz8SgS0.js.map → DialogHandle-tiMUnjZQ.js.map} +1 -1
- package/public/assets/admin-B8RQbf4_.js +2 -0
- package/public/assets/admin-B8RQbf4_.js.map +1 -0
- package/public/assets/admin-users-Dz1QNdy3.js +2 -0
- package/public/assets/{admin-users-CwTJdiih.js.map → admin-users-Dz1QNdy3.js.map} +1 -1
- package/public/assets/alert-leqyvHOp.js.map +1 -1
- package/public/assets/{auth-choice-row-BlSsUI7d.js → auth-choice-row-DWzfcZQY.js} +2 -2
- package/public/assets/{auth-choice-row-BlSsUI7d.js.map → auth-choice-row-DWzfcZQY.js.map} +1 -1
- package/public/assets/{auth-field-HwxENJnB.js → auth-field-DsLGh1U-.js} +2 -2
- package/public/assets/{auth-field-HwxENJnB.js.map → auth-field-DsLGh1U-.js.map} +1 -1
- package/public/assets/auth-layout-DGTylGtX.js +2 -0
- package/public/assets/auth-layout-DGTylGtX.js.map +1 -0
- package/public/assets/{auth-page-header-CIs08f5Y.js → auth-page-header-COvqWINf.js} +2 -2
- package/public/assets/auth-page-header-COvqWINf.js.map +1 -0
- package/public/assets/authorization-context-banner-DVx1TsPY.js +2 -0
- package/public/assets/authorization-context-banner-DVx1TsPY.js.map +1 -0
- package/public/assets/{avatar-CttWiIv3.js → avatar-BCLugfaZ.js} +2 -2
- package/public/assets/{avatar-CttWiIv3.js.map → avatar-BCLugfaZ.js.map} +1 -1
- package/public/assets/badge-CsOfUji0.js.map +1 -1
- package/public/assets/{checkbox-CJrRV8S1.js → checkbox-CFVDS3zJ.js} +2 -2
- package/public/assets/{checkbox-CJrRV8S1.js.map → checkbox-CFVDS3zJ.js.map} +1 -1
- package/public/assets/config-DTQCUlfZ.js +2 -0
- package/public/assets/config-DTQCUlfZ.js.map +1 -0
- package/public/assets/{consent-BIhxtXHx.js → consent-CKOohdYI.js} +2 -2
- package/public/assets/{consent-BIhxtXHx.js.map → consent-CKOohdYI.js.map} +1 -1
- package/public/assets/{consent-DRmENn26.js → consent-ChiWc7Ql.js} +2 -2
- package/public/assets/{consent-DRmENn26.js.map → consent-ChiWc7Ql.js.map} +1 -1
- package/public/assets/createLucideIcon-BPpAIXR_.js.map +1 -1
- package/public/assets/{email-CVRDeJ78.js → email-Crjg1dcr.js} +2 -2
- package/public/assets/{email-CVRDeJ78.js.map → email-Crjg1dcr.js.map} +1 -1
- package/public/assets/email-UcpXAI9J.js +2 -0
- package/public/assets/{email-UL_cNRnQ.js.map → email-UcpXAI9J.js.map} +1 -1
- package/public/assets/error-VfMv226c.js +2 -0
- package/public/assets/{error-2VPY5w8V.js.map → error-VfMv226c.js.map} +1 -1
- package/public/assets/{field-DDt6F9TZ.js → field-89zKYDVL.js} +2 -2
- package/public/assets/{field-DDt6F9TZ.js.map → field-89zKYDVL.js.map} +1 -1
- package/public/assets/forgot-Dr88fVMq.js +2 -0
- package/public/assets/{forgot-DzDcduho.js.map → forgot-Dr88fVMq.js.map} +1 -1
- package/public/assets/forgot-UcpXAI9J.js +2 -0
- package/public/assets/{forgot-UL_cNRnQ.js.map → forgot-UcpXAI9J.js.map} +1 -1
- package/public/assets/{index-DZyHRhbQ.css → index-CDD8owGK.css} +1 -1
- package/public/assets/index-CZ0rWM7l.js +11 -0
- package/public/assets/index-CZ0rWM7l.js.map +1 -0
- package/public/assets/{initial-avatar-CZzHAPm3.js → initial-avatar-ocwNWL38.js} +2 -2
- package/public/assets/{initial-avatar-CZzHAPm3.js.map → initial-avatar-ocwNWL38.js.map} +1 -1
- package/public/assets/{input-CNRpSR08.js → input-GPigtjgi.js} +2 -2
- package/public/assets/{input-CNRpSR08.js.map → input-GPigtjgi.js.map} +1 -1
- package/public/assets/{labeled-separator-fnKySKv2.js → labeled-separator-CV7nb0XW.js} +2 -2
- package/public/assets/{labeled-separator-fnKySKv2.js.map → labeled-separator-CV7nb0XW.js.map} +1 -1
- package/public/assets/link-C-WdTj3F.js.map +1 -1
- package/public/assets/login-CQeTLmIu.js +2 -0
- package/public/assets/login-CQeTLmIu.js.map +1 -0
- package/public/assets/login-UcpXAI9J.js +2 -0
- package/public/assets/login-UcpXAI9J.js.map +1 -0
- package/public/assets/{logout-CHdmF_16.js → logout-B5T52P8u.js} +2 -2
- package/public/assets/{logout-CHdmF_16.js.map → logout-B5T52P8u.js.map} +1 -1
- package/public/assets/{modal-sCM_zT82.js → modal-BV3gpI-p.js} +2 -2
- package/public/assets/{modal-sCM_zT82.js.map → modal-BV3gpI-p.js.map} +1 -1
- package/public/assets/{mutationOptions-CrswitPs.js → mutationOptions-DyYFUbyn.js} +2 -2
- package/public/assets/{mutationOptions-CrswitPs.js.map → mutationOptions-DyYFUbyn.js.map} +1 -1
- package/public/assets/passkey-Bf7n49Z7.js +2 -0
- package/public/assets/{passkey-CEx1VZ5R.js.map → passkey-Bf7n49Z7.js.map} +1 -1
- package/public/assets/passkey-CT3G7pCL.js +2 -0
- package/public/assets/{passkey-CU8x9J2w.js.map → passkey-CT3G7pCL.js.map} +1 -1
- package/public/assets/passkey-J1qnYp9A.js +2 -0
- package/public/assets/{passkey-B2Blw47e.js.map → passkey-J1qnYp9A.js.map} +1 -1
- package/public/assets/passkey-UcpXAI9J.js +2 -0
- package/public/assets/{passkey-UL_cNRnQ.js.map → passkey-UcpXAI9J.js.map} +1 -1
- package/public/assets/password-BKI5GTRs.js +2 -0
- package/public/assets/password-BKI5GTRs.js.map +1 -0
- package/public/assets/password-UcpXAI9J.js +2 -0
- package/public/assets/password-UcpXAI9J.js.map +1 -0
- package/public/assets/password-reset-sU5KkBKi.js +2 -0
- package/public/assets/{password-reset-CIacHnvA.js.map → password-reset-sU5KkBKi.js.map} +1 -1
- package/public/assets/{password-strength-C0Zkrrct.js → password-strength-DTWF07Px.js} +2 -2
- package/public/assets/{password-strength-C0Zkrrct.js.map → password-strength-DTWF07Px.js.map} +1 -1
- package/public/assets/{pin-input-BlD4tPZJ.js → pin-input-BGOLfkwL.js} +2 -2
- package/public/assets/{pin-input-BlD4tPZJ.js.map → pin-input-BGOLfkwL.js.map} +1 -1
- package/public/assets/{profile-D43Yq-6S.js → profile-DSTMtoUf.js} +2 -2
- package/public/assets/{profile-D43Yq-6S.js.map → profile-DSTMtoUf.js.map} +1 -1
- package/public/assets/profile-RpDmbWNA.js +2 -0
- package/public/assets/profile-RpDmbWNA.js.map +1 -0
- package/public/assets/provider-logos-u1YURWQr.js.map +1 -1
- package/public/assets/recovery-DbgpqG6f.js +2 -0
- package/public/assets/{recovery-CLExnfYX.js.map → recovery-DbgpqG6f.js.map} +1 -1
- package/public/assets/register-B2Lixapy.js +2 -0
- package/public/assets/{register-CZUyWXRO.js.map → register-B2Lixapy.js.map} +1 -1
- package/public/assets/register-UcpXAI9J.js +2 -0
- package/public/assets/{register-UL_cNRnQ.js.map → register-UcpXAI9J.js.map} +1 -1
- package/public/assets/reset-C-Qjl2Qy.js +2 -0
- package/public/assets/reset-C-Qjl2Qy.js.map +1 -0
- package/public/assets/reset-UcpXAI9J.js +2 -0
- package/public/assets/{reset-UL_cNRnQ.js.map → reset-UcpXAI9J.js.map} +1 -1
- package/public/assets/{select-CWdSzsVo.js → select-BKx4bF4A.js} +2 -2
- package/public/assets/{select-CWdSzsVo.js.map → select-BKx4bF4A.js.map} +1 -1
- package/public/assets/select-UcpXAI9J.js +2 -0
- package/public/assets/{select-UL_cNRnQ.js.map → select-UcpXAI9J.js.map} +1 -1
- package/public/assets/{separator-BWGym8uM.js → separator-B0Bvh1he.js} +2 -2
- package/public/assets/{separator-BWGym8uM.js.map → separator-B0Bvh1he.js.map} +1 -1
- package/public/assets/shell-header-bar-CgyNXbPS.js +2 -0
- package/public/assets/shell-header-bar-CgyNXbPS.js.map +1 -0
- package/public/assets/{terms-D43Yq-6S.js → terms-DSTMtoUf.js} +2 -2
- package/public/assets/{terms-D43Yq-6S.js.map → terms-DSTMtoUf.js.map} +1 -1
- package/public/assets/{terms-COVFmzyl.js → terms-Vgpg5IZK.js} +2 -2
- package/public/assets/{terms-COVFmzyl.js.map → terms-Vgpg5IZK.js.map} +1 -1
- package/public/assets/{terms-checkbox-list-Cw0zB-lO.js → terms-checkbox-list-DqbXU4qw.js} +2 -2
- package/public/assets/{terms-checkbox-list-Cw0zB-lO.js.map → terms-checkbox-list-DqbXU4qw.js.map} +1 -1
- package/public/assets/{totp-BfCm6IWl.js → totp-BNZ904Zm.js} +2 -2
- package/public/assets/{totp-BfCm6IWl.js.map → totp-BNZ904Zm.js.map} +1 -1
- package/public/assets/totp-Cjns-PoB.js +2 -0
- package/public/assets/{totp-BFJEXxk0.js.map → totp-Cjns-PoB.js.map} +1 -1
- package/public/assets/totp-g0-s50HZ.js +2 -0
- package/public/assets/{totp-MINhsVxT.js.map → totp-g0-s50HZ.js.map} +1 -1
- package/public/assets/use-totp-setup-CtTaklH-.js +3 -0
- package/public/assets/{use-totp-setup-C7Zk_2IY.js.map → use-totp-setup-CtTaklH-.js.map} +1 -1
- package/public/assets/{useAriaLabelledBy-CiOCg6X5.js → useAriaLabelledBy-7uIPXK-0.js} +2 -2
- package/public/assets/{useAriaLabelledBy-CiOCg6X5.js.map → useAriaLabelledBy-7uIPXK-0.js.map} +1 -1
- package/public/assets/{useMutation-ZLFeJg75.js → useMutation-BWZ0G4Td.js} +2 -2
- package/public/assets/{useMutation-ZLFeJg75.js.map → useMutation-BWZ0G4Td.js.map} +1 -1
- package/public/assets/useQuery-pOdkMV4B.js +2 -0
- package/public/assets/{useQuery-BvMz34BW.js.map → useQuery-pOdkMV4B.js.map} +1 -1
- package/public/assets/users-B1hvVo3B.js +2 -0
- package/public/assets/users-B1hvVo3B.js.map +1 -0
- package/public/index.html +4 -5
- package/dist/routes/api/auth/password/reset-required/post.d.ts +0 -18
- package/dist/routes/api/auth/password/reset-required/post.d.ts.map +0 -1
- package/dist/routes/api/auth/password/reset-required/post.js +0 -39
- package/dist/routes/api/auth/password/reset-required/post.js.map +0 -1
- package/dist/services/legacy-credential-retirement.service.d.ts +0 -20
- package/dist/services/legacy-credential-retirement.service.d.ts.map +0 -1
- package/dist/services/legacy-credential-retirement.service.js +0 -90
- package/dist/services/legacy-credential-retirement.service.js.map +0 -1
- package/public/assets/2fa-BgveHSB_.js +0 -2
- package/public/assets/2fa-C37MUkye.js +0 -2
- package/public/assets/2fa-UL_cNRnQ.js +0 -2
- package/public/assets/2fa-kiqzGSz2.js +0 -2
- package/public/assets/admin-DbDuu6AI.js +0 -2
- package/public/assets/admin-DbDuu6AI.js.map +0 -1
- package/public/assets/admin-users-CwTJdiih.js +0 -2
- package/public/assets/auth-layout-CoeqNhTT.js +0 -2
- package/public/assets/auth-layout-CoeqNhTT.js.map +0 -1
- package/public/assets/auth-page-header-CIs08f5Y.js.map +0 -1
- package/public/assets/authorization-context-banner-BbtQmMYH.js +0 -2
- package/public/assets/authorization-context-banner-BbtQmMYH.js.map +0 -1
- package/public/assets/config-v3-oy_ef.js +0 -2
- package/public/assets/config-v3-oy_ef.js.map +0 -1
- package/public/assets/email-UL_cNRnQ.js +0 -2
- package/public/assets/error-2VPY5w8V.js +0 -2
- package/public/assets/forgot-DzDcduho.js +0 -2
- package/public/assets/forgot-UL_cNRnQ.js +0 -2
- package/public/assets/index-gliHKncz.js +0 -11
- package/public/assets/index-gliHKncz.js.map +0 -1
- package/public/assets/link-BN90emXr.js +0 -2
- package/public/assets/link-BN90emXr.js.map +0 -1
- package/public/assets/lock-keyhole-Cz72xkCn.js +0 -2
- package/public/assets/lock-keyhole-Cz72xkCn.js.map +0 -1
- package/public/assets/login-C6m2qSUt.js +0 -2
- package/public/assets/login-C6m2qSUt.js.map +0 -1
- package/public/assets/login-UL_cNRnQ.js +0 -2
- package/public/assets/login-UL_cNRnQ.js.map +0 -1
- package/public/assets/passkey-B2Blw47e.js +0 -2
- package/public/assets/passkey-CEx1VZ5R.js +0 -2
- package/public/assets/passkey-CU8x9J2w.js +0 -2
- package/public/assets/passkey-UL_cNRnQ.js +0 -2
- package/public/assets/password-BhU_a0cR.js +0 -2
- package/public/assets/password-BhU_a0cR.js.map +0 -1
- package/public/assets/password-UL_cNRnQ.js +0 -2
- package/public/assets/password-UL_cNRnQ.js.map +0 -1
- package/public/assets/password-reset-CIacHnvA.js +0 -2
- package/public/assets/profile-D1cEjfs8.js +0 -2
- package/public/assets/profile-D1cEjfs8.js.map +0 -1
- package/public/assets/recovery-CLExnfYX.js +0 -2
- package/public/assets/register-CZUyWXRO.js +0 -2
- package/public/assets/register-UL_cNRnQ.js +0 -2
- package/public/assets/reset-N3RQTYEB.js +0 -2
- package/public/assets/reset-N3RQTYEB.js.map +0 -1
- package/public/assets/reset-UL_cNRnQ.js +0 -2
- package/public/assets/reset-required-Cv5edDS6.js +0 -2
- package/public/assets/reset-required-Cv5edDS6.js.map +0 -1
- package/public/assets/reset-required-UL_cNRnQ.js +0 -2
- package/public/assets/reset-required-UL_cNRnQ.js.map +0 -1
- package/public/assets/select-UL_cNRnQ.js +0 -2
- package/public/assets/shell-header-bar-C9AB5lT-.js +0 -2
- package/public/assets/shell-header-bar-C9AB5lT-.js.map +0 -1
- package/public/assets/totp-BFJEXxk0.js +0 -2
- package/public/assets/totp-MINhsVxT.js +0 -2
- package/public/assets/use-totp-setup-C7Zk_2IY.js +0 -3
- package/public/assets/useQuery-BvMz34BW.js +0 -2
- package/public/assets/users-COM7u3A-.js +0 -2
- package/public/assets/users-COM7u3A-.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{J as e,Z as t,q as n}from"./createLucideIcon-BPpAIXR_.js";import{Dn as r,Gn as i,In as a,Kn as o,Pn as s,Rn as c,Sn as l,Tn as u,Vn as d,kn as f}from"./config-v3-oy_ef.js";function p(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var m=4,h=5;function g(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function _(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=g(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function v(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=_(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=x(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=x(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=S(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=S(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=S(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=x(n.fullPath??n.from);e.kind=h,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=x(n.fullPath??n.from);e.kind=m,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)v(e,t,r,s,i,a,o)}function y(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function b(e){if(e.pathless)for(let t of e.pathless)b(t);if(e.static)for(let t of e.static.values())b(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())b(t);if(e.dynamic?.length){e.dynamic.sort(y);for(let t of e.dynamic)b(t)}if(e.optional?.length){e.optional.sort(y);for(let t of e.optional)b(t)}if(e.wildcard?.length){e.wildcard.sort(y);for(let t of e.wildcard)b(t)}}function x(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function S(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function C(e,t){let n=x(`/`),r=new Uint16Array(6);for(let t of e)v(!1,r,t,1,n,0);b(n),t.masksTree=n,t.flatCache=p(1e3)}function w(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=k(e,t.masksTree);return t.flatCache.set(e,r),r}function T(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=x(`/`),v(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),k(r,o,n)}function E(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=k(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=j(a.route)),t.matchCache.set(r,a),a}function D(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function O(e,t=!1,n){let r=x(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return v(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&f(),a[e.id]=e,s!==0&&e.path){let t=D(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),b(r),{processedTree:{segmentTree:r,singleCache:p(1e3),matchCache:p(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function k(e,t,n=!1){let r=e.split(`/`),i=N(e,r,t,n);if(!i)return null;let[a]=A(e,r,i);return{route:i.node.route,rawParams:a}}function A(e,t,n){let r=M(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===m)break;if(u.kind===h){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function j(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function M(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function N(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!d(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:h,optionals:g}=n,{extract:_,rawParams:v}=n;if(i.kind===2&&i.route&&!F(l,n))continue;if(i.parse){if(!te(e,t,n))continue;v=n.rawParams,_=n.extract}r&&i.route&&i.kind!==m&&F(c,n)&&(c=n);let y=u===o;if(y&&(i.route&&(!a||i.kind===m||i.kind===2)&&F(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let b=y?void 0:t[u],x;if(y&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:h,optionals:g,extract:_,rawParams:v},r=!0;if(i.index.parse&&(te(e,t,n)||(r=!1)),r){if(!h&&!g&&!d&&ee(p,o))return n;F(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(y||!(n.caseSensitive?b:x??=b.toLowerCase()).startsWith(r)))){if(a){if(y)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:h,optionals:g,extract:_,rawParams:v})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:h,optionals:g,extract:_,rawParams:v})}if(!y)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?b:x??=b.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:h,optionals:g+P(o,u),extract:_,rawParams:v})}}if(!y&&i.dynamic&&b)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?b:x??=b.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:h+P(o,u),optionals:g,extract:_,rawParams:v})}if(!y&&i.staticInsensitive){let e=i.staticInsensitive.get(x??=b.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+P(o,u),dynamics:h,optionals:g,extract:_,rawParams:v})}if(!y&&i.static){let e=i.static.get(b);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+P(o,u),dynamics:h,optionals:g,extract:_,rawParams:v})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:h,optionals:g,extract:_,rawParams:v})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function P(e,t){return 2**(e-t-1)}function ee(e,t){return e===2**(t-1)-1}function te(e,t,n){let r,i;try{[r,i]=A(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function F(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===m)>(e.node.kind===m)||t.node.kind===m==(e.node.kind===m)&&t.depth>e.depth))):!0}function ne(e){return I(e.filter(e=>e!==void 0).join(`/`))}function I(e){return e.replace(/\/{2,}/g,`/`)}function re(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function ie(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function ae(e){return ie(re(e))}function L(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function oe(e,t,n){return L(e,n)===L(t,n)}function se({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&d(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(d(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=I(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function R(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function z(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>V(e,n)).join(`/`):V(r,n):r}function B({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=_(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=z(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=z(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=z(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function V(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var ce=`Error preloading route! ☝️`,H=t(e(),1),U=n();function W({children:e,fallback:t=null}){return le()?(0,U.jsx)(H.Fragment,{children:e}):(0,U.jsx)(H.Fragment,{children:t})}function le(){return H.useSyncExternalStore(G,()=>!0,()=>!1)}function G(){return()=>{}}var ue=t(l(),1);function K(e,t){let n=r(),l=i(t),{activeProps:d,inactiveProps:f,activeOptions:p,to:m,preload:h,preloadDelay:g,preloadIntentProximity:_,hashScrollIntoView:v,replace:y,startTransition:b,resetScroll:x,viewTransition:S,children:C,target:w,disabled:T,style:E,className:D,onClick:O,onBlur:k,onFocus:A,onMouseEnter:j,onMouseLeave:M,onTouchStart:N,ignoreBlocker:P,params:ee,search:te,hash:F,state:ne,mask:I,reloadDocument:re,unsafeRelative:ie,from:ae,_fromLocation:se,...R}=e,z=le(),B=H.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),V=u(n.stores.location,e=>e,(e,t)=>e.href===t.href),U=H.useMemo(()=>{let e={_fromLocation:V,...B};return n.buildLocation(e)},[n,V,B]),W=U.maskedLocation?U.maskedLocation.publicHref:U.publicHref,G=U.maskedLocation?U.maskedLocation.external:U.external,K=H.useMemo(()=>_e(W,G,n.history,T),[T,G,W,n.history]),Y=H.useMemo(()=>{if(K?.external)return c(K.href,n.protocolAllowlist)?void 0:K.href;if(!ve(m)&&!(typeof m!=`string`||m.indexOf(`:`)===-1))try{return new URL(m),c(m,n.protocolAllowlist)?void 0:m}catch{}},[m,K,n.protocolAllowlist]),be=H.useMemo(()=>{if(Y)return!1;if(p?.exact){if(!oe(V.pathname,U.pathname,n.basepath))return!1}else{let e=L(V.pathname,n.basepath),t=L(U.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(p?.includeSearch??!0)&&!s(V.search,U.search,{partial:!p?.exact,ignoreUndefined:!p?.explicitUndefined})?!1:p?.includeHash?z&&V.hash===U.hash:!0},[p?.exact,p?.explicitUndefined,p?.includeHash,p?.includeSearch,V,Y,z,U.hash,U.pathname,U.search,n.basepath]),X=be?a(d,{})??fe:de,Z=be?de:a(f,{})??de,xe=[D,X.className,Z.className].filter(Boolean).join(` `),Se=(E||X.style||Z.style)&&{...E,...X.style,...Z.style},[Ce,we]=H.useState(!1),Te=H.useRef(!1),Q=e.reloadDocument||Y?!1:h??n.options.defaultPreload,Ee=g??n.options.defaultPreloadDelay??0,$=H.useCallback(()=>{n.preloadRoute({...B,_builtLocation:U}).catch(e=>{console.warn(e),console.warn(ce)})},[n,B,U]);o(l,H.useCallback(e=>{e?.isIntersecting&&$()},[$]),ge,{disabled:!!T||Q!==`viewport`}),H.useEffect(()=>{Te.current||!T&&Q===`render`&&($(),Te.current=!0)},[T,$,Q]);let De=e=>{let t=e.currentTarget.getAttribute(`target`),r=w===void 0?t:w;if(!T&&!ye(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,ue.flushSync)(()=>{we(!0)});let t=n.subscribe(`onResolved`,()=>{t(),we(!1)});n.navigate({...B,replace:y,resetScroll:x,hashScrollIntoView:v,startTransition:b,viewTransition:S,ignoreBlocker:P})}};if(Y)return{...R,ref:l,href:Y,...C&&{children:C},...w&&{target:w},...T&&{disabled:T},...E&&{style:E},...D&&{className:D},...O&&{onClick:O},...k&&{onBlur:k},...A&&{onFocus:A},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...N&&{onTouchStart:N}};let Oe=e=>{if(T||Q!==`intent`)return;if(!Ee){$();return}let t=e.currentTarget;if(q.has(t))return;let n=setTimeout(()=>{q.delete(t),$()},Ee);q.set(t,n)},ke=e=>{T||Q!==`intent`||$()},Ae=e=>{if(T||!Q||!Ee)return;let t=e.currentTarget,n=q.get(t);n&&(clearTimeout(n),q.delete(t))};return{...R,...X,...Z,href:K?.href,ref:l,onClick:J([O,De]),onBlur:J([k,Ae]),onFocus:J([A,Oe]),onMouseEnter:J([j,Oe]),onMouseLeave:J([M,Ae]),onTouchStart:J([N,ke]),disabled:!!T,target:w,...Se&&{style:Se},...xe&&{className:xe},...T&&pe,...be&&me,...z&&Ce&&he}}var de={},fe={className:`active`},pe={role:`link`,"aria-disabled":!0},me={"data-status":`active`,"aria-current":`page`},he={"data-transitioning":`transitioning`},q=new WeakMap,ge={rootMargin:`100px`},J=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function _e(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function ve(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Y=H.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=K(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return H.createElement(`a`,t,o)}return H.createElement(n,a,o)});function ye(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}export{p as _,B as a,ae as c,j as d,w as f,O as g,C as h,R as i,re as l,T as m,W as n,ne as o,E as p,I as r,se as s,Y as t,ie as u};
|
|
2
|
-
//# sourceMappingURL=link-BN90emXr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-BN90emXr.js","names":["trimPathRight"],"sources":["../../../../node_modules/.pnpm/@tanstack+router-core@1.171.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.14/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.14/node_modules/@tanstack/router-core/dist/esm/path.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.14/node_modules/@tanstack/router-core/dist/esm/link.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/ClientOnly.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/link.js"],"sourcesContent":["//#region src/lru-cache.ts\nfunction createLRUCache(max) {\n\tconst cache = /* @__PURE__ */ new Map();\n\tlet oldest;\n\tlet newest;\n\tconst touch = (entry) => {\n\t\tif (!entry.next) return;\n\t\tif (!entry.prev) {\n\t\t\tentry.next.prev = void 0;\n\t\t\toldest = entry.next;\n\t\t\tentry.next = void 0;\n\t\t\tif (newest) {\n\t\t\t\tentry.prev = newest;\n\t\t\t\tnewest.next = entry;\n\t\t\t}\n\t\t} else {\n\t\t\tentry.prev.next = entry.next;\n\t\t\tentry.next.prev = entry.prev;\n\t\t\tentry.next = void 0;\n\t\t\tif (newest) {\n\t\t\t\tnewest.next = entry;\n\t\t\t\tentry.prev = newest;\n\t\t\t}\n\t\t}\n\t\tnewest = entry;\n\t};\n\treturn {\n\t\tget(key) {\n\t\t\tconst entry = cache.get(key);\n\t\t\tif (!entry) return void 0;\n\t\t\ttouch(entry);\n\t\t\treturn entry.value;\n\t\t},\n\t\tset(key, value) {\n\t\t\tif (cache.size >= max && oldest) {\n\t\t\t\tconst toDelete = oldest;\n\t\t\t\tcache.delete(toDelete.key);\n\t\t\t\tif (toDelete.next) {\n\t\t\t\t\toldest = toDelete.next;\n\t\t\t\t\ttoDelete.next.prev = void 0;\n\t\t\t\t}\n\t\t\t\tif (toDelete === newest) newest = void 0;\n\t\t\t}\n\t\t\tconst existing = cache.get(key);\n\t\t\tif (existing) {\n\t\t\t\texisting.value = value;\n\t\t\t\ttouch(existing);\n\t\t\t} else {\n\t\t\t\tconst entry = {\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue,\n\t\t\t\t\tprev: newest\n\t\t\t\t};\n\t\t\t\tif (newest) newest.next = entry;\n\t\t\t\tnewest = entry;\n\t\t\t\tif (!oldest) oldest = entry;\n\t\t\t\tcache.set(key, entry);\n\t\t\t}\n\t\t},\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t\toldest = void 0;\n\t\t\tnewest = void 0;\n\t\t}\n\t};\n}\n//#endregion\nexport { createLRUCache };\n\n//# sourceMappingURL=lru-cache.js.map","import { last } from \"./utils.js\";\nimport { invariant } from \"./invariant.js\";\nimport { createLRUCache } from \"./lru-cache.js\";\nconst SEGMENT_TYPE_INDEX = 4;\nconst SEGMENT_TYPE_PATHLESS = 5;\nfunction getOpenAndCloseBraces(part) {\n\tconst openBrace = part.indexOf(\"{\");\n\tif (openBrace === -1) return null;\n\tconst closeBrace = part.indexOf(\"}\", openBrace);\n\tif (closeBrace === -1) return null;\n\tif (openBrace + 1 >= part.length) return null;\n\treturn [openBrace, closeBrace];\n}\n/**\n* Populates the `output` array with the parsed representation of the given `segment` string.\n*\n* Usage:\n* ```ts\n* let output\n* let cursor = 0\n* while (cursor < path.length) {\n* output = parseSegment(path, cursor, output)\n* const end = output[5]\n* cursor = end + 1\n* ```\n*\n* `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed\n* or initialized, it will be done automatically.\n*/\nfunction parseSegment(path, start, output = new Uint16Array(6)) {\n\tconst next = path.indexOf(\"/\", start);\n\tconst end = next === -1 ? path.length : next;\n\tconst part = path.substring(start, end);\n\tif (!part || !part.includes(\"$\")) {\n\t\toutput[0] = 0;\n\t\toutput[1] = start;\n\t\toutput[2] = start;\n\t\toutput[3] = end;\n\t\toutput[4] = end;\n\t\toutput[5] = end;\n\t\treturn output;\n\t}\n\tif (part === \"$\") {\n\t\tconst total = path.length;\n\t\toutput[0] = 2;\n\t\toutput[1] = start;\n\t\toutput[2] = start;\n\t\toutput[3] = total;\n\t\toutput[4] = total;\n\t\toutput[5] = total;\n\t\treturn output;\n\t}\n\tif (part.charCodeAt(0) === 36) {\n\t\toutput[0] = 1;\n\t\toutput[1] = start;\n\t\toutput[2] = start + 1;\n\t\toutput[3] = end;\n\t\toutput[4] = end;\n\t\toutput[5] = end;\n\t\treturn output;\n\t}\n\tconst braces = getOpenAndCloseBraces(part);\n\tif (braces) {\n\t\tconst [openBrace, closeBrace] = braces;\n\t\tconst firstChar = part.charCodeAt(openBrace + 1);\n\t\tif (firstChar === 45) {\n\t\t\tif (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) {\n\t\t\t\tconst paramStart = openBrace + 3;\n\t\t\t\tconst paramEnd = closeBrace;\n\t\t\t\tif (paramStart < paramEnd) {\n\t\t\t\t\toutput[0] = 3;\n\t\t\t\t\toutput[1] = start + openBrace;\n\t\t\t\t\toutput[2] = start + paramStart;\n\t\t\t\t\toutput[3] = start + paramEnd;\n\t\t\t\t\toutput[4] = start + closeBrace + 1;\n\t\t\t\t\toutput[5] = end;\n\t\t\t\t\treturn output;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (firstChar === 36) {\n\t\t\tconst dollarPos = openBrace + 1;\n\t\t\tconst afterDollar = openBrace + 2;\n\t\t\tif (afterDollar === closeBrace) {\n\t\t\t\toutput[0] = 2;\n\t\t\t\toutput[1] = start + openBrace;\n\t\t\t\toutput[2] = start + dollarPos;\n\t\t\t\toutput[3] = start + afterDollar;\n\t\t\t\toutput[4] = start + closeBrace + 1;\n\t\t\t\toutput[5] = path.length;\n\t\t\t\treturn output;\n\t\t\t}\n\t\t\toutput[0] = 1;\n\t\t\toutput[1] = start + openBrace;\n\t\t\toutput[2] = start + afterDollar;\n\t\t\toutput[3] = start + closeBrace;\n\t\t\toutput[4] = start + closeBrace + 1;\n\t\t\toutput[5] = end;\n\t\t\treturn output;\n\t\t}\n\t}\n\toutput[0] = 0;\n\toutput[1] = start;\n\toutput[2] = start;\n\toutput[3] = end;\n\toutput[4] = end;\n\toutput[5] = end;\n\treturn output;\n}\n/**\n* Recursively parses the segments of the given route tree and populates a segment trie.\n*\n* @param data A reusable Uint16Array for parsing segments. (non important, we're just avoiding allocations)\n* @param route The current route to parse.\n* @param start The starting index for parsing within the route's full path.\n* @param node The current segment node in the trie to populate.\n* @param onRoute Callback invoked for each route processed.\n*/\nfunction parseSegments(defaultCaseSensitive, data, route, start, node, depth, onRoute) {\n\tonRoute?.(route);\n\tlet cursor = start;\n\t{\n\t\tconst path = route.fullPath ?? route.from;\n\t\tconst length = path.length;\n\t\tconst caseSensitive = route.options?.caseSensitive ?? defaultCaseSensitive;\n\t\tconst parseParams = route.options?.params?.parse ?? route.options?.parseParams;\n\t\twhile (cursor < length) {\n\t\t\tconst segment = parseSegment(path, cursor, data);\n\t\t\tlet nextNode;\n\t\t\tconst start = cursor;\n\t\t\tconst end = segment[5];\n\t\t\tcursor = end + 1;\n\t\t\tdepth++;\n\t\t\tswitch (segment[0]) {\n\t\t\t\tcase 0: {\n\t\t\t\t\tconst value = path.substring(segment[2], segment[3]);\n\t\t\t\t\tif (caseSensitive) {\n\t\t\t\t\t\tconst existingNode = node.static?.get(value);\n\t\t\t\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnode.static ??= /* @__PURE__ */ new Map();\n\t\t\t\t\t\t\tconst next = createStaticNode(route.fullPath ?? route.from);\n\t\t\t\t\t\t\tnext.parent = node;\n\t\t\t\t\t\t\tnext.depth = depth;\n\t\t\t\t\t\t\tnextNode = next;\n\t\t\t\t\t\t\tnode.static.set(value, next);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst name = value.toLowerCase();\n\t\t\t\t\t\tconst existingNode = node.staticInsensitive?.get(name);\n\t\t\t\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnode.staticInsensitive ??= /* @__PURE__ */ new Map();\n\t\t\t\t\t\t\tconst next = createStaticNode(route.fullPath ?? route.from);\n\t\t\t\t\t\t\tnext.parent = node;\n\t\t\t\t\t\t\tnext.depth = depth;\n\t\t\t\t\t\t\tnextNode = next;\n\t\t\t\t\t\t\tnode.staticInsensitive.set(name, next);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1: {\n\t\t\t\t\tconst prefix_raw = path.substring(start, segment[1]);\n\t\t\t\t\tconst suffix_raw = path.substring(segment[4], end);\n\t\t\t\t\tconst actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);\n\t\t\t\t\tconst prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();\n\t\t\t\t\tconst suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();\n\t\t\t\t\tconst existingNode = !parseParams && node.dynamic?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);\n\t\t\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst next = createDynamicNode(1, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);\n\t\t\t\t\t\tnextNode = next;\n\t\t\t\t\t\tnext.depth = depth;\n\t\t\t\t\t\tnext.parent = node;\n\t\t\t\t\t\tnode.dynamic ??= [];\n\t\t\t\t\t\tnode.dynamic.push(next);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3: {\n\t\t\t\t\tconst prefix_raw = path.substring(start, segment[1]);\n\t\t\t\t\tconst suffix_raw = path.substring(segment[4], end);\n\t\t\t\t\tconst actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);\n\t\t\t\t\tconst prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();\n\t\t\t\t\tconst suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();\n\t\t\t\t\tconst existingNode = !parseParams && node.optional?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);\n\t\t\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst next = createDynamicNode(3, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);\n\t\t\t\t\t\tnextNode = next;\n\t\t\t\t\t\tnext.parent = node;\n\t\t\t\t\t\tnext.depth = depth;\n\t\t\t\t\t\tnode.optional ??= [];\n\t\t\t\t\t\tnode.optional.push(next);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2: {\n\t\t\t\t\tconst prefix_raw = path.substring(start, segment[1]);\n\t\t\t\t\tconst suffix_raw = path.substring(segment[4], end);\n\t\t\t\t\tconst actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);\n\t\t\t\t\tconst prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();\n\t\t\t\t\tconst suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();\n\t\t\t\t\tconst next = createDynamicNode(2, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);\n\t\t\t\t\tnextNode = next;\n\t\t\t\t\tnext.parent = node;\n\t\t\t\t\tnext.depth = depth;\n\t\t\t\t\tnode.wildcard ??= [];\n\t\t\t\t\tnode.wildcard.push(next);\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode = nextNode;\n\t\t}\n\t\tif (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf(\"/\") + 1) === 95) {\n\t\t\tconst pathlessNode = createStaticNode(route.fullPath ?? route.from);\n\t\t\tpathlessNode.kind = SEGMENT_TYPE_PATHLESS;\n\t\t\tpathlessNode.parent = node;\n\t\t\tdepth++;\n\t\t\tpathlessNode.depth = depth;\n\t\t\tnode.pathless ??= [];\n\t\t\tnode.pathless.push(pathlessNode);\n\t\t\tnode = pathlessNode;\n\t\t}\n\t\tconst isLeaf = (route.path || !route.children) && !route.isRoot;\n\t\tif (isLeaf && path.endsWith(\"/\")) {\n\t\t\tconst indexNode = createStaticNode(route.fullPath ?? route.from);\n\t\t\tindexNode.kind = SEGMENT_TYPE_INDEX;\n\t\t\tindexNode.parent = node;\n\t\t\tdepth++;\n\t\t\tindexNode.depth = depth;\n\t\t\tnode.index = indexNode;\n\t\t\tnode = indexNode;\n\t\t}\n\t\tnode.parse = parseParams ?? null;\n\t\tnode.priority = route.options?.params?.priority ?? 0;\n\t\tif (isLeaf && !node.route) {\n\t\t\tnode.route = route;\n\t\t\tnode.fullPath = route.fullPath ?? route.from;\n\t\t}\n\t}\n\tif (route.children) for (const child of route.children) parseSegments(defaultCaseSensitive, data, child, cursor, node, depth, onRoute);\n}\nfunction sortDynamic(a, b) {\n\tif (a.parse && !b.parse) return -1;\n\tif (!a.parse && b.parse) return 1;\n\tif (a.parse && b.parse && (a.priority || b.priority)) return b.priority - a.priority;\n\tif (a.prefix && b.prefix && a.prefix !== b.prefix) {\n\t\tif (a.prefix.startsWith(b.prefix)) return -1;\n\t\tif (b.prefix.startsWith(a.prefix)) return 1;\n\t}\n\tif (a.suffix && b.suffix && a.suffix !== b.suffix) {\n\t\tif (a.suffix.endsWith(b.suffix)) return -1;\n\t\tif (b.suffix.endsWith(a.suffix)) return 1;\n\t}\n\tif (a.prefix && !b.prefix) return -1;\n\tif (!a.prefix && b.prefix) return 1;\n\tif (a.suffix && !b.suffix) return -1;\n\tif (!a.suffix && b.suffix) return 1;\n\tif (a.caseSensitive && !b.caseSensitive) return -1;\n\tif (!a.caseSensitive && b.caseSensitive) return 1;\n\treturn 0;\n}\nfunction sortTreeNodes(node) {\n\tif (node.pathless) for (const child of node.pathless) sortTreeNodes(child);\n\tif (node.static) for (const child of node.static.values()) sortTreeNodes(child);\n\tif (node.staticInsensitive) for (const child of node.staticInsensitive.values()) sortTreeNodes(child);\n\tif (node.dynamic?.length) {\n\t\tnode.dynamic.sort(sortDynamic);\n\t\tfor (const child of node.dynamic) sortTreeNodes(child);\n\t}\n\tif (node.optional?.length) {\n\t\tnode.optional.sort(sortDynamic);\n\t\tfor (const child of node.optional) sortTreeNodes(child);\n\t}\n\tif (node.wildcard?.length) {\n\t\tnode.wildcard.sort(sortDynamic);\n\t\tfor (const child of node.wildcard) sortTreeNodes(child);\n\t}\n}\nfunction createStaticNode(fullPath) {\n\treturn {\n\t\tkind: 0,\n\t\tdepth: 0,\n\t\tpathless: null,\n\t\tindex: null,\n\t\tstatic: null,\n\t\tstaticInsensitive: null,\n\t\tdynamic: null,\n\t\toptional: null,\n\t\twildcard: null,\n\t\troute: null,\n\t\tfullPath,\n\t\tparent: null,\n\t\tparse: null,\n\t\tpriority: 0\n\t};\n}\n/**\n* Keys must be declared in the same order as in `SegmentNode` type,\n* to ensure they are represented as the same object class in the engine.\n*/\nfunction createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) {\n\treturn {\n\t\tkind,\n\t\tdepth: 0,\n\t\tpathless: null,\n\t\tindex: null,\n\t\tstatic: null,\n\t\tstaticInsensitive: null,\n\t\tdynamic: null,\n\t\toptional: null,\n\t\twildcard: null,\n\t\troute: null,\n\t\tfullPath,\n\t\tparent: null,\n\t\tparse: null,\n\t\tpriority: 0,\n\t\tcaseSensitive,\n\t\tprefix,\n\t\tsuffix\n\t};\n}\nfunction processRouteMasks(routeList, processedTree) {\n\tconst segmentTree = createStaticNode(\"/\");\n\tconst data = new Uint16Array(6);\n\tfor (const route of routeList) parseSegments(false, data, route, 1, segmentTree, 0);\n\tsortTreeNodes(segmentTree);\n\tprocessedTree.masksTree = segmentTree;\n\tprocessedTree.flatCache = createLRUCache(1e3);\n}\n/**\n* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.\n*/\nfunction findFlatMatch(path, processedTree) {\n\tpath ||= \"/\";\n\tconst cached = processedTree.flatCache.get(path);\n\tif (cached) return cached;\n\tconst result = findMatch(path, processedTree.masksTree);\n\tprocessedTree.flatCache.set(path, result);\n\treturn result;\n}\n/**\n* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree\n*/\nfunction findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {\n\tfrom ||= \"/\";\n\tpath ||= \"/\";\n\tconst key = caseSensitive ? `case\\0${from}` : from;\n\tlet tree = processedTree.singleCache.get(key);\n\tif (!tree) {\n\t\ttree = createStaticNode(\"/\");\n\t\tparseSegments(caseSensitive, new Uint16Array(6), { from }, 1, tree, 0);\n\t\tprocessedTree.singleCache.set(key, tree);\n\t}\n\treturn findMatch(path, tree, fuzzy);\n}\nfunction findRouteMatch(path, processedTree, fuzzy = false) {\n\tconst key = fuzzy ? path : `nofuzz\\0${path}`;\n\tconst cached = processedTree.matchCache.get(key);\n\tif (cached !== void 0) return cached;\n\tpath ||= \"/\";\n\tlet result;\n\ttry {\n\t\tresult = findMatch(path, processedTree.segmentTree, fuzzy);\n\t} catch (err) {\n\t\tif (err instanceof URIError) result = null;\n\t\telse throw err;\n\t}\n\tif (result) result.branch = buildRouteBranch(result.route);\n\tprocessedTree.matchCache.set(key, result);\n\treturn result;\n}\n/** Trim trailing slashes (except preserving root '/'). */\nfunction trimPathRight(path) {\n\treturn path === \"/\" ? path : path.replace(/\\/{1,}$/, \"\");\n}\n/**\n* Processes a route tree into a segment trie for efficient path matching.\n* Also builds lookup maps for routes by ID and by trimmed full path.\n*/\nfunction processRouteTree(routeTree, caseSensitive = false, initRoute) {\n\tconst segmentTree = createStaticNode(routeTree.fullPath);\n\tconst data = new Uint16Array(6);\n\tconst routesById = {};\n\tconst routesByPath = {};\n\tlet index = 0;\n\tparseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, (route) => {\n\t\tinitRoute?.(route, index);\n\t\tif (route.id in routesById) {\n\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Duplicate routes found with id: ${String(route.id)}`);\n\t\t\tinvariant();\n\t\t}\n\t\troutesById[route.id] = route;\n\t\tif (index !== 0 && route.path) {\n\t\t\tconst trimmedFullPath = trimPathRight(route.fullPath);\n\t\t\tif (!routesByPath[trimmedFullPath] || route.fullPath.endsWith(\"/\")) routesByPath[trimmedFullPath] = route;\n\t\t}\n\t\tindex++;\n\t});\n\tsortTreeNodes(segmentTree);\n\treturn {\n\t\tprocessedTree: {\n\t\t\tsegmentTree,\n\t\t\tsingleCache: createLRUCache(1e3),\n\t\t\tmatchCache: createLRUCache(1e3),\n\t\t\tflatCache: null,\n\t\t\tmasksTree: null\n\t\t},\n\t\troutesById,\n\t\troutesByPath\n\t};\n}\nfunction findMatch(path, segmentTree, fuzzy = false) {\n\tconst parts = path.split(\"/\");\n\tconst leaf = getNodeMatch(path, parts, segmentTree, fuzzy);\n\tif (!leaf) return null;\n\tconst [rawParams] = extractParams(path, parts, leaf);\n\treturn {\n\t\troute: leaf.node.route,\n\t\trawParams\n\t};\n}\n/**\n* This function is \"resumable\":\n* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call\n* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off\n*\n* Inputs are *not* mutated.\n*/\nfunction extractParams(path, parts, leaf) {\n\tconst list = buildBranch(leaf.node);\n\tlet nodeParts = null;\n\tconst rawParams = Object.create(null);\n\t/** which segment of the path we're currently processing */\n\tlet partIndex = leaf.extract?.part ?? 0;\n\t/** which node of the route tree branch we're currently processing */\n\tlet nodeIndex = leaf.extract?.node ?? 0;\n\t/** index of the 1st character of the segment we're processing in the path string */\n\tlet pathIndex = leaf.extract?.path ?? 0;\n\t/** which fullPath segment we're currently processing */\n\tlet segmentCount = leaf.extract?.segment ?? 0;\n\tfor (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) {\n\t\tconst node = list[nodeIndex];\n\t\tif (node.kind === SEGMENT_TYPE_INDEX) break;\n\t\tif (node.kind === SEGMENT_TYPE_PATHLESS) {\n\t\t\tsegmentCount--;\n\t\t\tpartIndex--;\n\t\t\tpathIndex--;\n\t\t\tcontinue;\n\t\t}\n\t\tconst part = parts[partIndex];\n\t\tconst currentPathIndex = pathIndex;\n\t\tif (part) pathIndex += part.length;\n\t\tif (node.kind === 1) {\n\t\t\tnodeParts ??= leaf.node.fullPath.split(\"/\");\n\t\t\tconst nodePart = nodeParts[segmentCount];\n\t\t\tconst preLength = node.prefix?.length ?? 0;\n\t\t\tif (nodePart.charCodeAt(preLength) === 123) {\n\t\t\t\tconst sufLength = node.suffix?.length ?? 0;\n\t\t\t\tconst name = nodePart.substring(preLength + 2, nodePart.length - sufLength - 1);\n\t\t\t\tconst value = part.substring(preLength, part.length - sufLength);\n\t\t\t\trawParams[name] = decodeURIComponent(value);\n\t\t\t} else {\n\t\t\t\tconst name = nodePart.substring(1);\n\t\t\t\trawParams[name] = decodeURIComponent(part);\n\t\t\t}\n\t\t} else if (node.kind === 3) {\n\t\t\tif (leaf.skipped & 1 << nodeIndex) {\n\t\t\t\tpartIndex--;\n\t\t\t\tpathIndex = currentPathIndex - 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnodeParts ??= leaf.node.fullPath.split(\"/\");\n\t\t\tconst nodePart = nodeParts[segmentCount];\n\t\t\tconst preLength = node.prefix?.length ?? 0;\n\t\t\tconst sufLength = node.suffix?.length ?? 0;\n\t\t\tconst name = nodePart.substring(preLength + 3, nodePart.length - sufLength - 1);\n\t\t\tconst value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part;\n\t\t\tif (value) rawParams[name] = decodeURIComponent(value);\n\t\t} else if (node.kind === 2) {\n\t\t\tconst n = node;\n\t\t\tconst value = path.substring(currentPathIndex + (n.prefix?.length ?? 0), path.length - (n.suffix?.length ?? 0));\n\t\t\tconst splat = decodeURIComponent(value);\n\t\t\trawParams[\"*\"] = splat;\n\t\t\trawParams._splat = splat;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);\n\treturn [rawParams, {\n\t\tpart: partIndex,\n\t\tnode: nodeIndex,\n\t\tpath: pathIndex,\n\t\tsegment: segmentCount\n\t}];\n}\nfunction buildRouteBranch(route) {\n\tconst list = [route];\n\twhile (route.parentRoute) {\n\t\troute = route.parentRoute;\n\t\tlist.push(route);\n\t}\n\tlist.reverse();\n\treturn list;\n}\nfunction buildBranch(node) {\n\tconst list = Array(node.depth + 1);\n\tdo {\n\t\tlist[node.depth] = node;\n\t\tnode = node.parent;\n\t} while (node);\n\treturn list;\n}\nfunction getNodeMatch(path, parts, segmentTree, fuzzy) {\n\tif (path === \"/\" && segmentTree.index) return {\n\t\tnode: segmentTree.index,\n\t\tskipped: 0\n\t};\n\tconst trailingSlash = !last(parts);\n\tconst pathIsIndex = trailingSlash && path !== \"/\";\n\tconst partsLength = parts.length - (trailingSlash ? 1 : 0);\n\tconst stack = [{\n\t\tnode: segmentTree,\n\t\tindex: 1,\n\t\tskipped: 0,\n\t\tdepth: 1,\n\t\tstatics: 0,\n\t\tdynamics: 0,\n\t\toptionals: 0\n\t}];\n\tlet bestFuzzy = null;\n\tlet bestMatch = null;\n\twhile (stack.length) {\n\t\tconst frame = stack.pop();\n\t\tconst { node, index, skipped, depth, statics, dynamics, optionals } = frame;\n\t\tlet { extract, rawParams } = frame;\n\t\tif (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;\n\t\tif (node.parse) {\n\t\t\tif (!validateParseParams(path, parts, frame)) continue;\n\t\t\trawParams = frame.rawParams;\n\t\t\textract = frame.extract;\n\t\t}\n\t\tif (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;\n\t\tconst isBeyondPath = index === partsLength;\n\t\tif (isBeyondPath) {\n\t\t\tif (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;\n\t\t\tif (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;\n\t\t}\n\t\tconst part = isBeyondPath ? void 0 : parts[index];\n\t\tlet lowerPart;\n\t\tif (isBeyondPath && node.index) {\n\t\t\tconst indexFrame = {\n\t\t\t\tnode: node.index,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tdepth: depth + 1,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t};\n\t\t\tlet indexValid = true;\n\t\t\tif (node.index.parse) {\n\t\t\t\tif (!validateParseParams(path, parts, indexFrame)) indexValid = false;\n\t\t\t}\n\t\t\tif (indexValid) {\n\t\t\t\tif (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;\n\t\t\t\tif (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;\n\t\t\t}\n\t\t}\n\t\tif (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.wildcard[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tif (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;\n\t\t\t}\n\t\t\tif (suffix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tconst end = parts.slice(index).join(\"/\").slice(-suffix.length);\n\t\t\t\tif ((segment.caseSensitive ? end : end.toLowerCase()) !== suffix) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: partsLength,\n\t\t\t\tskipped,\n\t\t\t\tdepth: depth + 1,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.optional) {\n\t\t\tconst nextSkipped = skipped | 1 << depth;\n\t\t\tconst nextDepth = depth + 1;\n\t\t\tfor (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex,\n\t\t\t\t\tskipped: nextSkipped,\n\t\t\t\t\tdepth: nextDepth,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals,\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tconst { prefix, suffix } = segment;\n\t\t\t\tif (prefix || suffix) {\n\t\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\t\tif (suffix && !casePart.endsWith(suffix)) continue;\n\t\t\t\t}\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex: index + 1,\n\t\t\t\t\tskipped,\n\t\t\t\t\tdepth: nextDepth,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals: optionals + segmentScore(partsLength, index),\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.dynamic[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix || suffix) {\n\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\tif (suffix && !casePart.endsWith(suffix)) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tdepth: depth + 1,\n\t\t\t\tstatics,\n\t\t\t\tdynamics: dynamics + segmentScore(partsLength, index),\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.staticInsensitive) {\n\t\t\tconst match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tdepth: depth + 1,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.static) {\n\t\t\tconst match = node.static.get(part);\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tdepth: depth + 1,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.pathless) {\n\t\t\tconst nextDepth = depth + 1;\n\t\t\tfor (let i = node.pathless.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.pathless[i];\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex,\n\t\t\t\t\tskipped,\n\t\t\t\t\tdepth: nextDepth,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals,\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\tif (bestMatch) return bestMatch;\n\tif (fuzzy && bestFuzzy) {\n\t\tlet sliceIndex = bestFuzzy.index;\n\t\tfor (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;\n\t\tconst splat = sliceIndex === path.length ? \"/\" : path.slice(sliceIndex);\n\t\tbestFuzzy.rawParams ??= Object.create(null);\n\t\tbestFuzzy.rawParams[\"**\"] = decodeURIComponent(splat);\n\t\treturn bestFuzzy;\n\t}\n\treturn null;\n}\nfunction segmentScore(partsLength, index) {\n\treturn 2 ** (partsLength - index - 1);\n}\nfunction isPerfectStaticMatch(statics, partsLength) {\n\treturn statics === 2 ** (partsLength - 1) - 1;\n}\nfunction validateParseParams(path, parts, frame) {\n\tlet rawParams;\n\tlet state;\n\ttry {\n\t\t[rawParams, state] = extractParams(path, parts, frame);\n\t} catch {\n\t\treturn null;\n\t}\n\tframe.rawParams = rawParams;\n\tframe.extract = state;\n\tif (!frame.node.parse) return true;\n\ttry {\n\t\tif (frame.node.parse(rawParams) === false) return null;\n\t} catch {}\n\treturn true;\n}\nfunction isFrameMoreSpecific(prev, next) {\n\tif (!prev) return true;\n\treturn next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.depth > prev.depth)));\n}\n//#endregion\nexport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegment, processRouteMasks, processRouteTree };\n\n//# sourceMappingURL=new-process-route-tree.js.map","import { last } from \"./utils.js\";\nimport { parseSegment } from \"./new-process-route-tree.js\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\n//#region src/path.ts\n/** Join path segments, cleaning duplicate slashes between parts. */\nfunction joinPaths(paths) {\n\treturn cleanPath(paths.filter((val) => {\n\t\treturn val !== void 0;\n\t}).join(\"/\"));\n}\n/** Remove repeated slashes from a path string. */\nfunction cleanPath(path) {\n\treturn path.replace(/\\/{2,}/g, \"/\");\n}\n/** Trim leading slashes (except preserving root '/'). */\nfunction trimPathLeft(path) {\n\treturn path === \"/\" ? path : path.replace(/^\\/{1,}/, \"\");\n}\n/** Trim trailing slashes (except preserving root '/'). */\nfunction trimPathRight(path) {\n\tconst len = path.length;\n\treturn len > 1 && path[len - 1] === \"/\" ? path.replace(/\\/{1,}$/, \"\") : path;\n}\n/** Trim both leading and trailing slashes. */\nfunction trimPath(path) {\n\treturn trimPathRight(trimPathLeft(path));\n}\n/** Remove a trailing slash from value when appropriate for comparisons. */\nfunction removeTrailingSlash(value, basepath) {\n\tif (value?.endsWith(\"/\") && value !== \"/\" && value !== `${basepath}/`) return value.slice(0, -1);\n\treturn value;\n}\n/**\n* Compare two pathnames for exact equality after normalizing trailing slashes\n* relative to the provided `basepath`.\n*/\nfunction exactPathTest(pathName1, pathName2, basepath) {\n\treturn removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);\n}\n/**\n* Resolve a destination path against a base, honoring trailing-slash policy\n* and supporting relative segments (`.`/`..`) and absolute `to` values.\n*/\nfunction resolvePath({ base, to, trailingSlash = \"never\", cache }) {\n\tconst isAbsolute = to.startsWith(\"/\");\n\tconst isBase = !isAbsolute && to === \".\";\n\tlet key;\n\tif (cache) {\n\t\tkey = isAbsolute ? to : isBase ? base : base + \"\\0\" + to;\n\t\tconst cached = cache.get(key);\n\t\tif (cached) return cached;\n\t}\n\tlet baseSegments;\n\tif (isBase) baseSegments = base.split(\"/\");\n\telse if (isAbsolute) baseSegments = to.split(\"/\");\n\telse {\n\t\tbaseSegments = base.split(\"/\");\n\t\twhile (baseSegments.length > 1 && last(baseSegments) === \"\") baseSegments.pop();\n\t\tconst toSegments = to.split(\"/\");\n\t\tfor (let index = 0, length = toSegments.length; index < length; index++) {\n\t\t\tconst value = toSegments[index];\n\t\t\tif (value === \"\") {\n\t\t\t\tif (!index) baseSegments = [value];\n\t\t\t\telse if (index === length - 1) baseSegments.push(value);\n\t\t\t} else if (value === \"..\") baseSegments.pop();\n\t\t\telse if (value === \".\") {} else baseSegments.push(value);\n\t\t}\n\t}\n\tif (baseSegments.length > 1) {\n\t\tif (last(baseSegments) === \"\") {\n\t\t\tif (trailingSlash === \"never\") baseSegments.pop();\n\t\t} else if (trailingSlash === \"always\") baseSegments.push(\"\");\n\t}\n\tconst result = cleanPath(baseSegments.join(\"/\")) || \"/\";\n\tif (key && cache) cache.set(key, result);\n\treturn result;\n}\n/**\n* Create a pre-compiled decode config from allowed characters.\n* This should be called once at router initialization.\n*/\nfunction compileDecodeCharMap(pathParamsAllowedCharacters) {\n\tconst charMap = new Map(pathParamsAllowedCharacters.map((char) => [encodeURIComponent(char), char]));\n\tconst pattern = Array.from(charMap.keys()).map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\");\n\tconst regex = new RegExp(pattern, \"g\");\n\treturn (encoded) => encoded.replace(regex, (match) => charMap.get(match) ?? match);\n}\nfunction encodeParam(key, params, decoder) {\n\tconst value = params[key];\n\tif (typeof value !== \"string\") return value;\n\tif (key === \"_splat\") {\n\t\tif (/^[a-zA-Z0-9\\-._~!/]*$/.test(value)) return value;\n\t\treturn value.split(\"/\").map((segment) => encodePathParam(segment, decoder)).join(\"/\");\n\t} else return encodePathParam(value, decoder);\n}\n/**\n* Interpolate params and wildcards into a route path template.\n*\n* - Encodes params safely (configurable allowed characters)\n* - Supports `{-$optional}` segments, `{prefix{$id}suffix}` and `{$}` wildcards\n*/\nfunction interpolatePath({ path, params, decoder, ...rest }) {\n\tlet isMissingParams = false;\n\tconst usedParams = Object.create(null);\n\tif (!path || path === \"/\") return {\n\t\tinterpolatedPath: \"/\",\n\t\tusedParams,\n\t\tisMissingParams\n\t};\n\tif (!path.includes(\"$\")) return {\n\t\tinterpolatedPath: path,\n\t\tusedParams,\n\t\tisMissingParams\n\t};\n\tif (isServer ?? rest.server) {\n\t\tif (path.indexOf(\"{\") === -1) {\n\t\t\tconst length = path.length;\n\t\t\tlet cursor = 0;\n\t\t\tlet joined = \"\";\n\t\t\twhile (cursor < length) {\n\t\t\t\twhile (cursor < length && path.charCodeAt(cursor) === 47) cursor++;\n\t\t\t\tif (cursor >= length) break;\n\t\t\t\tconst start = cursor;\n\t\t\t\tlet end = path.indexOf(\"/\", cursor);\n\t\t\t\tif (end === -1) end = length;\n\t\t\t\tcursor = end;\n\t\t\t\tconst part = path.substring(start, end);\n\t\t\t\tif (!part) continue;\n\t\t\t\tif (part.charCodeAt(0) === 36) if (part.length === 1) {\n\t\t\t\t\tconst splat = params._splat;\n\t\t\t\t\tusedParams._splat = splat;\n\t\t\t\t\tusedParams[\"*\"] = splat;\n\t\t\t\t\tif (!splat) {\n\t\t\t\t\t\tisMissingParams = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst value = encodeParam(\"_splat\", params, decoder);\n\t\t\t\t\tjoined += \"/\" + value;\n\t\t\t\t} else {\n\t\t\t\t\tconst key = part.substring(1);\n\t\t\t\t\tif (!isMissingParams && !(key in params)) isMissingParams = true;\n\t\t\t\t\tusedParams[key] = params[key];\n\t\t\t\t\tconst value = encodeParam(key, params, decoder) ?? \"undefined\";\n\t\t\t\t\tjoined += \"/\" + value;\n\t\t\t\t}\n\t\t\t\telse joined += \"/\" + part;\n\t\t\t}\n\t\t\tif (path.endsWith(\"/\")) joined += \"/\";\n\t\t\treturn {\n\t\t\t\tusedParams,\n\t\t\t\tinterpolatedPath: joined || \"/\",\n\t\t\t\tisMissingParams\n\t\t\t};\n\t\t}\n\t}\n\tconst length = path.length;\n\tlet cursor = 0;\n\tlet segment;\n\tlet joined = \"\";\n\twhile (cursor < length) {\n\t\tconst start = cursor;\n\t\tsegment = parseSegment(path, start, segment);\n\t\tconst end = segment[5];\n\t\tcursor = end + 1;\n\t\tif (start === end) continue;\n\t\tconst kind = segment[0];\n\t\tif (kind === 0) {\n\t\t\tjoined += \"/\" + path.substring(start, end);\n\t\t\tcontinue;\n\t\t}\n\t\tif (kind === 2) {\n\t\t\tconst splat = params._splat;\n\t\t\tusedParams._splat = splat;\n\t\t\tusedParams[\"*\"] = splat;\n\t\t\tconst prefix = path.substring(start, segment[1]);\n\t\t\tconst suffix = path.substring(segment[4], end);\n\t\t\tif (!splat) {\n\t\t\t\tisMissingParams = true;\n\t\t\t\tif (prefix || suffix) joined += \"/\" + prefix + suffix;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = encodeParam(\"_splat\", params, decoder);\n\t\t\tjoined += \"/\" + prefix + value + suffix;\n\t\t\tcontinue;\n\t\t}\n\t\tif (kind === 1) {\n\t\t\tconst key = path.substring(segment[2], segment[3]);\n\t\t\tif (!isMissingParams && !(key in params)) isMissingParams = true;\n\t\t\tusedParams[key] = params[key];\n\t\t\tconst prefix = path.substring(start, segment[1]);\n\t\t\tconst suffix = path.substring(segment[4], end);\n\t\t\tconst value = encodeParam(key, params, decoder) ?? \"undefined\";\n\t\t\tjoined += \"/\" + prefix + value + suffix;\n\t\t\tcontinue;\n\t\t}\n\t\tif (kind === 3) {\n\t\t\tconst key = path.substring(segment[2], segment[3]);\n\t\t\tconst valueRaw = params[key];\n\t\t\tif (valueRaw == null) continue;\n\t\t\tusedParams[key] = valueRaw;\n\t\t\tconst prefix = path.substring(start, segment[1]);\n\t\t\tconst suffix = path.substring(segment[4], end);\n\t\t\tconst value = encodeParam(key, params, decoder) ?? \"\";\n\t\t\tjoined += \"/\" + prefix + value + suffix;\n\t\t\tcontinue;\n\t\t}\n\t}\n\tif (path.endsWith(\"/\")) joined += \"/\";\n\treturn {\n\t\tusedParams,\n\t\tinterpolatedPath: joined || \"/\",\n\t\tisMissingParams\n\t};\n}\nfunction encodePathParam(value, decoder) {\n\tconst encoded = encodeURIComponent(value);\n\treturn decoder?.(encoded) ?? encoded;\n}\n//#endregion\nexport { cleanPath, compileDecodeCharMap, exactPathTest, interpolatePath, joinPaths, removeTrailingSlash, resolvePath, trimPath, trimPathLeft, trimPathRight };\n\n//# sourceMappingURL=path.js.map","//#region src/link.ts\nconst preloadWarning = \"Error preloading route! ☝️\";\n//#endregion\nexport { preloadWarning };\n\n//# sourceMappingURL=link.js.map","\"use client\";\nimport React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/ClientOnly.tsx\n/**\n* Render the children only after the JS has loaded client-side. Use an optional\n* fallback component if the JS is not yet loaded.\n*\n* @example\n* Render a Chart component if JS loads, renders a simple FakeChart\n* component server-side or if there is no JS. The FakeChart can have only the\n* UI without the behavior or be a loading spinner or skeleton.\n*\n* ```tsx\n* return (\n* <ClientOnly fallback={<FakeChart />}>\n* <Chart />\n* </ClientOnly>\n* )\n* ```\n*/\nfunction ClientOnly({ children, fallback = null }) {\n\treturn useHydrated() ? /* @__PURE__ */ jsx(React.Fragment, { children }) : /* @__PURE__ */ jsx(React.Fragment, { children: fallback });\n}\n/**\n* Return a boolean indicating if the JS has been hydrated already.\n* When doing Server-Side Rendering, the result will always be false.\n* When doing Client-Side Rendering, the result will always be false on the\n* first render and true from then on. Even if a new component renders it will\n* always start with true.\n*\n* @example\n* ```tsx\n* // Disable a button that needs JS to work.\n* let hydrated = useHydrated()\n* return (\n* <button type=\"button\" disabled={!hydrated} onClick={doSomethingCustom}>\n* Click me\n* </button>\n* )\n* ```\n* @returns True if the JS has been hydrated already, false otherwise.\n*/\nfunction useHydrated() {\n\treturn React.useSyncExternalStore(subscribe, () => true, () => false);\n}\nfunction subscribe() {\n\treturn () => {};\n}\n//#endregion\nexport { ClientOnly, useHydrated };\n\n//# sourceMappingURL=ClientOnly.js.map","\"use client\";\nimport { useForwardedRef, useIntersectionObserver } from \"./utils.js\";\nimport { useHydrated } from \"./ClientOnly.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { deepEqual, exactPathTest, functionalUpdate, hasKeys, isDangerousProtocol, preloadWarning, removeTrailingSlash } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useStore } from \"@tanstack/react-store\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { flushSync } from \"react-dom\";\n//#region src/link.tsx\n/**\n* Build anchor-like props for declarative navigation and preloading.\n*\n* Returns stable `href`, event handlers and accessibility props derived from\n* router options and active state. Used internally by `Link` and custom links.\n*\n* Options cover `to`, `params`, `search`, `hash`, `state`, `preload`,\n* `activeProps`, `inactiveProps`, and more.\n*\n* @returns React anchor props suitable for `<a>` or custom components.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook\n*/\nfunction useLinkProps(options, forwardedRef) {\n\tconst router = useRouter();\n\tconst innerRef = useForwardedRef(forwardedRef);\n\tconst _isServer = isServer ?? router.isServer;\n\tconst { activeProps, inactiveProps, activeOptions, to, preload: userPreload, preloadDelay: userPreloadDelay, preloadIntentProximity: _preloadIntentProximity, hashScrollIntoView, replace, startTransition, resetScroll, viewTransition, children, target, disabled, style, className, onClick, onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart, ignoreBlocker, params: _params, search: _search, hash: _hash, state: _state, mask: _mask, reloadDocument: _reloadDocument, unsafeRelative: _unsafeRelative, from: _from, _fromLocation, ...propsSafeToSpread } = options;\n\tif (_isServer) {\n\t\tconst safeInternal = isSafeInternal(to);\n\t\tif (typeof to === \"string\" && !safeInternal && to.indexOf(\":\") > -1) try {\n\t\t\tnew URL(to);\n\t\t\tif (isDangerousProtocol(to, router.protocolAllowlist)) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\t\t\treturn {\n\t\t\t\t\t...propsSafeToSpread,\n\t\t\t\t\tref: innerRef,\n\t\t\t\t\thref: void 0,\n\t\t\t\t\t...children && { children },\n\t\t\t\t\t...target && { target },\n\t\t\t\t\t...disabled && { disabled },\n\t\t\t\t\t...style && { style },\n\t\t\t\t\t...className && { className }\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...propsSafeToSpread,\n\t\t\t\tref: innerRef,\n\t\t\t\thref: to,\n\t\t\t\t...children && { children },\n\t\t\t\t...target && { target },\n\t\t\t\t...disabled && { disabled },\n\t\t\t\t...style && { style },\n\t\t\t\t...className && { className }\n\t\t\t};\n\t\t} catch {}\n\t\tconst next = router.buildLocation({\n\t\t\t...options,\n\t\t\tfrom: options.from\n\t\t});\n\t\tconst hrefOption = getHrefOption(next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref, next.maskedLocation ? next.maskedLocation.external : next.external, router.history, disabled);\n\t\tconst externalLink = (() => {\n\t\t\tif (hrefOption?.external) {\n\t\t\t\tif (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${hrefOption.href}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn hrefOption.href;\n\t\t\t}\n\t\t\tif (safeInternal) return void 0;\n\t\t\tif (typeof to === \"string\" && to.indexOf(\":\") > -1) try {\n\t\t\t\tnew URL(to);\n\t\t\t\tif (isDangerousProtocol(to, router.protocolAllowlist)) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn to;\n\t\t\t} catch {}\n\t\t})();\n\t\tconst isActive = (() => {\n\t\t\tif (externalLink) return false;\n\t\t\tconst currentLocation = router.stores.location.get();\n\t\t\tconst exact = activeOptions?.exact ?? false;\n\t\t\tif (exact) {\n\t\t\t\tif (!exactPathTest(currentLocation.pathname, next.pathname, router.basepath)) return false;\n\t\t\t} else {\n\t\t\t\tconst currentPathSplit = removeTrailingSlash(currentLocation.pathname, router.basepath);\n\t\t\t\tconst nextPathSplit = removeTrailingSlash(next.pathname, router.basepath);\n\t\t\t\tif (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === \"/\"))) return false;\n\t\t\t}\n\t\t\tif (activeOptions?.includeSearch ?? true) {\n\t\t\t\tif (currentLocation.search !== next.search) {\n\t\t\t\t\tconst currentSearchEmpty = !currentLocation.search || typeof currentLocation.search === \"object\" && !hasKeys(currentLocation.search);\n\t\t\t\t\tconst nextSearchEmpty = !next.search || typeof next.search === \"object\" && !hasKeys(next.search);\n\t\t\t\t\tif (!(currentSearchEmpty && nextSearchEmpty)) {\n\t\t\t\t\t\tif (!deepEqual(currentLocation.search, next.search, {\n\t\t\t\t\t\t\tpartial: !exact,\n\t\t\t\t\t\t\tignoreUndefined: !activeOptions?.explicitUndefined\n\t\t\t\t\t\t})) return false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (activeOptions?.includeHash) return false;\n\t\t\treturn true;\n\t\t})();\n\t\tif (externalLink) return {\n\t\t\t...propsSafeToSpread,\n\t\t\tref: innerRef,\n\t\t\thref: externalLink,\n\t\t\t...children && { children },\n\t\t\t...target && { target },\n\t\t\t...disabled && { disabled },\n\t\t\t...style && { style },\n\t\t\t...className && { className }\n\t\t};\n\t\tconst resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;\n\t\tconst resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;\n\t\tconst resolvedStyle = (() => {\n\t\t\tconst baseStyle = style;\n\t\t\tconst activeStyle = resolvedActiveProps.style;\n\t\t\tconst inactiveStyle = resolvedInactiveProps.style;\n\t\t\tif (!baseStyle && !activeStyle && !inactiveStyle) return;\n\t\t\tif (baseStyle && !activeStyle && !inactiveStyle) return baseStyle;\n\t\t\tif (!baseStyle && activeStyle && !inactiveStyle) return activeStyle;\n\t\t\tif (!baseStyle && !activeStyle && inactiveStyle) return inactiveStyle;\n\t\t\treturn {\n\t\t\t\t...baseStyle,\n\t\t\t\t...activeStyle,\n\t\t\t\t...inactiveStyle\n\t\t\t};\n\t\t})();\n\t\tconst resolvedClassName = (() => {\n\t\t\tconst baseClassName = className;\n\t\t\tconst activeClassName = resolvedActiveProps.className;\n\t\t\tconst inactiveClassName = resolvedInactiveProps.className;\n\t\t\tif (!baseClassName && !activeClassName && !inactiveClassName) return \"\";\n\t\t\tlet out = \"\";\n\t\t\tif (baseClassName) out = baseClassName;\n\t\t\tif (activeClassName) out = out ? `${out} ${activeClassName}` : activeClassName;\n\t\t\tif (inactiveClassName) out = out ? `${out} ${inactiveClassName}` : inactiveClassName;\n\t\t\treturn out;\n\t\t})();\n\t\treturn {\n\t\t\t...propsSafeToSpread,\n\t\t\t...resolvedActiveProps,\n\t\t\t...resolvedInactiveProps,\n\t\t\thref: hrefOption?.href,\n\t\t\tref: innerRef,\n\t\t\tdisabled: !!disabled,\n\t\t\ttarget,\n\t\t\t...resolvedStyle && { style: resolvedStyle },\n\t\t\t...resolvedClassName && { className: resolvedClassName },\n\t\t\t...disabled && STATIC_DISABLED_PROPS,\n\t\t\t...isActive && STATIC_ACTIVE_PROPS\n\t\t};\n\t}\n\tconst isHydrated = useHydrated();\n\tconst _options = React$1.useMemo(() => options, [\n\t\trouter,\n\t\toptions.from,\n\t\toptions._fromLocation,\n\t\toptions.hash,\n\t\toptions.to,\n\t\toptions.search,\n\t\toptions.params,\n\t\toptions.state,\n\t\toptions.mask,\n\t\toptions.unsafeRelative\n\t]);\n\tconst currentLocation = useStore(router.stores.location, (l) => l, (prev, next) => prev.href === next.href);\n\tconst next = React$1.useMemo(() => {\n\t\tconst opts = {\n\t\t\t_fromLocation: currentLocation,\n\t\t\t..._options\n\t\t};\n\t\treturn router.buildLocation(opts);\n\t}, [\n\t\trouter,\n\t\tcurrentLocation,\n\t\t_options\n\t]);\n\tconst hrefOptionPublicHref = next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref;\n\tconst hrefOptionExternal = next.maskedLocation ? next.maskedLocation.external : next.external;\n\tconst hrefOption = React$1.useMemo(() => getHrefOption(hrefOptionPublicHref, hrefOptionExternal, router.history, disabled), [\n\t\tdisabled,\n\t\threfOptionExternal,\n\t\threfOptionPublicHref,\n\t\trouter.history\n\t]);\n\tconst externalLink = React$1.useMemo(() => {\n\t\tif (hrefOption?.external) {\n\t\t\tif (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${hrefOption.href}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn hrefOption.href;\n\t\t}\n\t\tif (isSafeInternal(to)) return void 0;\n\t\tif (typeof to !== \"string\" || to.indexOf(\":\") === -1) return void 0;\n\t\ttry {\n\t\t\tnew URL(to);\n\t\t\tif (isDangerousProtocol(to, router.protocolAllowlist)) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn to;\n\t\t} catch {}\n\t}, [\n\t\tto,\n\t\threfOption,\n\t\trouter.protocolAllowlist\n\t]);\n\tconst isActive = React$1.useMemo(() => {\n\t\tif (externalLink) return false;\n\t\tif (activeOptions?.exact) {\n\t\t\tif (!exactPathTest(currentLocation.pathname, next.pathname, router.basepath)) return false;\n\t\t} else {\n\t\t\tconst currentPathSplit = removeTrailingSlash(currentLocation.pathname, router.basepath);\n\t\t\tconst nextPathSplit = removeTrailingSlash(next.pathname, router.basepath);\n\t\t\tif (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === \"/\"))) return false;\n\t\t}\n\t\tif (activeOptions?.includeSearch ?? true) {\n\t\t\tif (!deepEqual(currentLocation.search, next.search, {\n\t\t\t\tpartial: !activeOptions?.exact,\n\t\t\t\tignoreUndefined: !activeOptions?.explicitUndefined\n\t\t\t})) return false;\n\t\t}\n\t\tif (activeOptions?.includeHash) return isHydrated && currentLocation.hash === next.hash;\n\t\treturn true;\n\t}, [\n\t\tactiveOptions?.exact,\n\t\tactiveOptions?.explicitUndefined,\n\t\tactiveOptions?.includeHash,\n\t\tactiveOptions?.includeSearch,\n\t\tcurrentLocation,\n\t\texternalLink,\n\t\tisHydrated,\n\t\tnext.hash,\n\t\tnext.pathname,\n\t\tnext.search,\n\t\trouter.basepath\n\t]);\n\tconst resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;\n\tconst resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;\n\tconst resolvedClassName = [\n\t\tclassName,\n\t\tresolvedActiveProps.className,\n\t\tresolvedInactiveProps.className\n\t].filter(Boolean).join(\" \");\n\tconst resolvedStyle = (style || resolvedActiveProps.style || resolvedInactiveProps.style) && {\n\t\t...style,\n\t\t...resolvedActiveProps.style,\n\t\t...resolvedInactiveProps.style\n\t};\n\tconst [isTransitioning, setIsTransitioning] = React$1.useState(false);\n\tconst hasRenderFetched = React$1.useRef(false);\n\tconst preload = options.reloadDocument || externalLink ? false : userPreload ?? router.options.defaultPreload;\n\tconst preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0;\n\tconst doPreload = React$1.useCallback(() => {\n\t\trouter.preloadRoute({\n\t\t\t..._options,\n\t\t\t_builtLocation: next\n\t\t}).catch((err) => {\n\t\t\tconsole.warn(err);\n\t\t\tconsole.warn(preloadWarning);\n\t\t});\n\t}, [\n\t\trouter,\n\t\t_options,\n\t\tnext\n\t]);\n\tuseIntersectionObserver(innerRef, React$1.useCallback((entry) => {\n\t\tif (entry?.isIntersecting) doPreload();\n\t}, [doPreload]), intersectionObserverOptions, { disabled: !!disabled || !(preload === \"viewport\") });\n\tReact$1.useEffect(() => {\n\t\tif (hasRenderFetched.current) return;\n\t\tif (!disabled && preload === \"render\") {\n\t\t\tdoPreload();\n\t\t\thasRenderFetched.current = true;\n\t\t}\n\t}, [\n\t\tdisabled,\n\t\tdoPreload,\n\t\tpreload\n\t]);\n\tconst handleClick = (e) => {\n\t\tconst elementTarget = e.currentTarget.getAttribute(\"target\");\n\t\tconst effectiveTarget = target !== void 0 ? target : elementTarget;\n\t\tif (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === \"_self\") && e.button === 0) {\n\t\t\te.preventDefault();\n\t\t\tflushSync(() => {\n\t\t\t\tsetIsTransitioning(true);\n\t\t\t});\n\t\t\tconst unsub = router.subscribe(\"onResolved\", () => {\n\t\t\t\tunsub();\n\t\t\t\tsetIsTransitioning(false);\n\t\t\t});\n\t\t\trouter.navigate({\n\t\t\t\t..._options,\n\t\t\t\treplace,\n\t\t\t\tresetScroll,\n\t\t\t\thashScrollIntoView,\n\t\t\t\tstartTransition,\n\t\t\t\tviewTransition,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t}\n\t};\n\tif (externalLink) return {\n\t\t...propsSafeToSpread,\n\t\tref: innerRef,\n\t\thref: externalLink,\n\t\t...children && { children },\n\t\t...target && { target },\n\t\t...disabled && { disabled },\n\t\t...style && { style },\n\t\t...className && { className },\n\t\t...onClick && { onClick },\n\t\t...onBlur && { onBlur },\n\t\t...onFocus && { onFocus },\n\t\t...onMouseEnter && { onMouseEnter },\n\t\t...onMouseLeave && { onMouseLeave },\n\t\t...onTouchStart && { onTouchStart }\n\t};\n\tconst enqueueIntentPreload = (e) => {\n\t\tif (disabled || preload !== \"intent\") return;\n\t\tif (!preloadDelay) {\n\t\t\tdoPreload();\n\t\t\treturn;\n\t\t}\n\t\tconst eventTarget = e.currentTarget;\n\t\tif (timeoutMap.has(eventTarget)) return;\n\t\tconst id = setTimeout(() => {\n\t\t\ttimeoutMap.delete(eventTarget);\n\t\t\tdoPreload();\n\t\t}, preloadDelay);\n\t\ttimeoutMap.set(eventTarget, id);\n\t};\n\tconst handleTouchStart = (_) => {\n\t\tif (disabled || preload !== \"intent\") return;\n\t\tdoPreload();\n\t};\n\tconst handleLeave = (e) => {\n\t\tif (disabled || !preload || !preloadDelay) return;\n\t\tconst eventTarget = e.currentTarget;\n\t\tconst id = timeoutMap.get(eventTarget);\n\t\tif (id) {\n\t\t\tclearTimeout(id);\n\t\t\ttimeoutMap.delete(eventTarget);\n\t\t}\n\t};\n\treturn {\n\t\t...propsSafeToSpread,\n\t\t...resolvedActiveProps,\n\t\t...resolvedInactiveProps,\n\t\thref: hrefOption?.href,\n\t\tref: innerRef,\n\t\tonClick: composeHandlers([onClick, handleClick]),\n\t\tonBlur: composeHandlers([onBlur, handleLeave]),\n\t\tonFocus: composeHandlers([onFocus, enqueueIntentPreload]),\n\t\tonMouseEnter: composeHandlers([onMouseEnter, enqueueIntentPreload]),\n\t\tonMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n\t\tonTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n\t\tdisabled: !!disabled,\n\t\ttarget,\n\t\t...resolvedStyle && { style: resolvedStyle },\n\t\t...resolvedClassName && { className: resolvedClassName },\n\t\t...disabled && STATIC_DISABLED_PROPS,\n\t\t...isActive && STATIC_ACTIVE_PROPS,\n\t\t...isHydrated && isTransitioning && STATIC_TRANSITIONING_PROPS\n\t};\n}\nvar STATIC_EMPTY_OBJECT = {};\nvar STATIC_ACTIVE_OBJECT = { className: \"active\" };\nvar STATIC_DISABLED_PROPS = {\n\trole: \"link\",\n\t\"aria-disabled\": true\n};\nvar STATIC_ACTIVE_PROPS = {\n\t\"data-status\": \"active\",\n\t\"aria-current\": \"page\"\n};\nvar STATIC_TRANSITIONING_PROPS = { \"data-transitioning\": \"transitioning\" };\nvar timeoutMap = /* @__PURE__ */ new WeakMap();\nvar intersectionObserverOptions = { rootMargin: \"100px\" };\nvar composeHandlers = (handlers) => (e) => {\n\tfor (const handler of handlers) {\n\t\tif (!handler) continue;\n\t\tif (e.defaultPrevented) return;\n\t\thandler(e);\n\t}\n};\nfunction getHrefOption(publicHref, external, history, disabled) {\n\tif (disabled) return void 0;\n\tif (external) return {\n\t\thref: publicHref,\n\t\texternal: true\n\t};\n\treturn {\n\t\thref: history.createHref(publicHref) || \"/\",\n\t\texternal: false\n\t};\n}\nfunction isSafeInternal(to) {\n\tif (typeof to !== \"string\") return false;\n\tconst zero = to.charCodeAt(0);\n\tif (zero === 47) return to.charCodeAt(1) !== 47;\n\treturn zero === 46;\n}\n/**\n* Creates a typed Link-like component that preserves TanStack Router's\n* navigation semantics and type-safety while delegating rendering to the\n* provided host component.\n*\n* Useful for integrating design system anchors/buttons while keeping\n* router-aware props (eg. `to`, `params`, `search`, `preload`).\n*\n* @param Comp The host component to render (eg. a design-system Link/Button)\n* @returns A router-aware component with the same API as `Link`.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link\n*/\nfunction createLink(Comp) {\n\treturn React$1.forwardRef(function CreatedLink(props, ref) {\n\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t...props,\n\t\t\t_asChild: Comp,\n\t\t\tref\n\t\t});\n\t});\n}\n/**\n* A strongly-typed anchor component for declarative navigation.\n* Handles path, search, hash and state updates with optional route preloading\n* and active-state styling.\n*\n* Props:\n* - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)\n* - `preloadDelay`: Delay in ms before preloading on hover\n* - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive\n* - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation\n* - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation\n* - `ignoreBlocker`: Bypass registered blockers\n*\n* @returns An anchor-like element that navigates without full page reloads.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent\n*/\nvar Link = React$1.forwardRef((props, ref) => {\n\tconst { _asChild, ...rest } = props;\n\tconst { type: _type, ...linkProps } = useLinkProps(rest, ref);\n\tconst children = typeof rest.children === \"function\" ? rest.children({ isActive: linkProps[\"data-status\"] === \"active\" }) : rest.children;\n\tif (!_asChild) {\n\t\tconst { disabled: _, ...rest } = linkProps;\n\t\treturn React$1.createElement(\"a\", rest, children);\n\t}\n\treturn React$1.createElement(_asChild, linkProps, children);\n});\nfunction isCtrlEvent(e) {\n\treturn !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);\n}\n/**\n* Validate and reuse navigation options for `Link`, `navigate` or `redirect`.\n* Accepts a literal options object and returns it typed for later spreading.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\nvar linkOptions = (options) => {\n\treturn options;\n};\n/**\n* Type-check a literal object for use with `Link`, `navigate` or `redirect`.\n* Use to validate and reuse navigation options across your app.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\n//#endregion\nexport { Link, createLink, linkOptions, useLinkProps };\n\n//# sourceMappingURL=link.js.map"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":"mLACA,SAAS,EAAe,EAAK,CAC5B,IAAM,EAAwB,IAAI,IAC9B,EACA,EACE,EAAS,GAAU,CACnB,EAAM,OACN,EAAM,MASV,EAAM,KAAK,KAAO,EAAM,KACxB,EAAM,KAAK,KAAO,EAAM,KACxB,EAAM,KAAO,IAAK,GACd,IACH,EAAO,KAAO,EACd,EAAM,KAAO,KAbd,EAAM,KAAK,KAAO,IAAK,GACvB,EAAS,EAAM,KACf,EAAM,KAAO,IAAK,GACd,IACH,EAAM,KAAO,EACb,EAAO,KAAO,IAWhB,EAAS,EACV,EACA,MAAO,CACN,IAAI,EAAK,CACR,IAAM,EAAQ,EAAM,IAAI,CAAG,EACtB,KAEL,OADA,EAAM,CAAK,EACJ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ACD,SAAS,GAAY,EAAG,CACvB,MAAO,CAAC,EAAE,EAAE,SAAW,EAAE,QAAU,EAAE,SAAW,EAAE,SACnD"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-BPpAIXR_.js";var t=e(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]);export{t};
|
|
2
|
-
//# sourceMappingURL=lock-keyhole-Cz72xkCn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lock-keyhole-Cz72xkCn.js","names":[],"sources":["../../../../node_modules/.pnpm/lucide-react@1.25.0_react@19.2.7/node_modules/lucide-react/dist/esm/icons/lock-keyhole.mjs"],"sourcesContent":["/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"16\", r: \"1\", key: \"1au0dj\" }],\n [\"rect\", { x: \"3\", y: \"10\", width: \"18\", height: \"12\", rx: \"2\", key: \"6s8ecr\" }],\n [\"path\", { d: \"M7 10V7a5 5 0 0 1 10 0v3\", key: \"1pqi11\" }]\n];\nconst LockKeyhole = createLucideIcon(\"lock-keyhole\", __iconNode);\n\nexport { __iconNode, LockKeyhole as default };\n//# sourceMappingURL=lock-keyhole.mjs.map\n"],"x_google_ignoreList":[0],"mappings":"mDAcA,IAAM,EAAc,EAAiB,eAAgB,CAJnD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,QAAS,CAAC,EACxD,CAAC,OAAQ,CAAE,EAAG,IAAK,EAAG,KAAM,MAAO,KAAM,OAAQ,KAAM,GAAI,IAAK,IAAK,QAAS,CAAC,EAC/E,CAAC,OAAQ,CAAE,EAAG,2BAA4B,IAAK,QAAS,CAAC,CAEN,CAAU"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{J as e,Z as t,i as n,n as r,q as i,s as a}from"./createLucideIcon-BPpAIXR_.js";import{Dn as o,sr as s,t as c}from"./config-v3-oy_ef.js";import{t as l}from"./useMutation-ZLFeJg75.js";import{tt as u}from"./shell-header-bar-C9AB5lT-.js";import{t as d}from"./fingerprint-pattern-DP62Vk8x.js";import{t as f}from"./authorization-context-banner-BbtQmMYH.js";import{a as p,n as m,r as h,t as g}from"./provider-logos-u1YURWQr.js";import{t as _}from"./mail-D0B_1Dzd.js";import{F as v,N as y,R as b,S as x,b as S,j as C,z as w}from"./index-gliHKncz.js";import{t as T}from"./auth-page-header-CIs08f5Y.js";import{t as E}from"./alert-leqyvHOp.js";import{t as D}from"./auth-layout-CoeqNhTT.js";import{t as O}from"./promise-OpBtq8tG.js";import{t as k}from"./passkey-error-ZqqPQUta.js";import{t as A}from"./passkey-B2Blw47e.js";var j=t(e()),M=i(),N={google:(0,M.jsx)(h,{className:`size-tinyrack-xl`}),github:(0,M.jsx)(m,{className:`size-tinyrack-xl`}),apple:(0,M.jsx)(g,{className:`size-tinyrack-xl`})};function P({icon:e,label:t,providerType:n,render:i,onClick:o,isLoading:s,disabled:c}){let l;l=n&&n!==`generic_oauth`?N[n]:typeof e==`string`?(0,M.jsx)(`img`,{alt:``,className:`size-tinyrack-xl`,src:e}):e||(0,M.jsx)(p,{"aria-hidden":!0,className:`size-tinyrack-xl`});let u=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`flex size-tinyrack-xl shrink-0 items-center justify-center`,children:l}),(0,M.jsx)(r,{truncate:!0,variant:`body`,children:t})]}),d=`w-full justify-start gap-tinyrack-md transition-colors duration-tinyrack-fast ease-tinyrack-standard`;return i?(0,M.jsx)(w,{appearance:`outline`,className:`cursor-pointer ${d}`,intent:`neutral`,render:i,uiSize:`lg`,children:u}):(0,M.jsx)(a,{appearance:`outline`,className:d,disabled:c,intent:`neutral`,loading:s,onClick:o,type:`button`,uiSize:`lg`,children:u})}var F={access_denied:`oauth.error.accessDenied`,temporarily_unavailable:`oauth.error.temporarilyUnavailable`,server_error:`oauth.error.serverError`,registration_email_not_allowed:`oauth.error.registrationEmailNotAllowed`};function I(){let{t:e,i18n:t}=n(),r=o(),i=s(),a=S.useSearch(),p=a.lang??t.language,{data:m}=u(c),h=m.registration.signup_notice?.[p]??m.registration.signup_notice?.[m.i18n.fallback_language],g=m.identity_providers,w=a.oauth_error,N=w?e(F[w]??`oauth.error.failed`):void 0,I=m.auth.password.enabled,L=m.auth.passkey.enabled,[R,z]=(0,j.useState)(null),B=async e=>{if(e.password_reset_required){await r.navigate({to:`/password/reset-required`});return}e.user&&(i.setQueryData(x.queryKey,e),await O(),v(a)?window.location.href=C(a):r.navigate({to:`/profile`})),i.invalidateQueries({queryKey:x.queryKey})},V=l({...A,onSuccess:e=>{z(null),B(e)},onError:t=>{if(k(t)===`unsupported`){z(e(`login.passkey.error.unsupported`));return}z(e(`login.passkey.error.failed`))},onSettled:()=>{i.invalidateQueries({queryKey:x.queryKey})}}),H=e=>{let t=`/api/oauth/${e}/authorize?mode=login`;if(v(a)){let e=new URL(C(a)),n=`${e.pathname}${e.search}${e.hash}`;t+=`&return_url=${encodeURIComponent(n)}`}return t};return(0,M.jsxs)(D,{children:[(0,M.jsx)(T,{subtitle:e(`login.selectMethod.subtitle`)||void 0,title:e(`login.title`)}),(0,M.jsx)(f,{search:a}),N&&(0,M.jsx)(E,{icon:b,type:`error`,children:N}),R&&(0,M.jsx)(E,{icon:b,type:`error`,children:R}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-tinyrack-sm`,children:[g.map(e=>(0,M.jsx)(P,{icon:e.icon_url,label:e.display_name,providerType:e.type,render:(0,M.jsx)(`a`,{href:H(e.id)})},e.id)),I&&(0,M.jsx)(P,{icon:(0,M.jsx)(_,{"aria-hidden":!0,className:`size-tinyrack-xl`}),label:e(`login.method.password`),render:(0,M.jsx)(`a`,{href:(()=>{let e=new URLSearchParams;for(let[t,n]of Object.entries(y(a)))if(n!==void 0){let r=String(n);e.set(t,t===`account_selected`?decodeURIComponent(r).replaceAll(`"`,``):r)}let t=e.toString();return t?`/login/password?${t}`:`/login/password`})()})}),L&&(0,M.jsx)(P,{disabled:V.isPending,icon:(0,M.jsx)(d,{"aria-hidden":!0,className:`size-tinyrack-xl`}),isLoading:V.isPending,label:e(`login.method.passkey`),onClick:()=>{z(null),V.mutate()}})]}),h&&(0,M.jsx)(`div`,{className:`prose prose-sm text-center text-tinyrack-text-muted text-tinyrack-xs! **:text-tinyrack-xs!`,dangerouslySetInnerHTML:{__html:h}})]})}export{I as component};
|
|
2
|
-
//# sourceMappingURL=login-C6m2qSUt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-C6m2qSUt.js","names":["useMutation","useQueryClient","useSuspenseQuery","useRouter","CircleAlertIcon","FingerprintIcon","MailIcon","useState","useTranslation","AuthMethodTile","AuthPageHeader","AuthorizationContextBanner","Alert","AuthLayout","buildAuthenticatedAuthorizeUrl","extractOAuthParams","isOAuthFlow","classifyPasskeyError","tick","appConfigQueryOptions","authenticateWithPasskeyMutationOptions","getSessionQueryOptions","OAUTH_ERROR_I18N_MAP","Record","access_denied","temporarily_unavailable","server_error","registration_email_not_allowed","Route","Login","t","i18n","router","queryClient","search","useSearch","lang","language","data","configData","implicitNotice","registration","signup_notice","fallback_language","oauthProviders","identity_providers","oauthError","oauth_error","oauthErrorMessage","undefined","isPasswordAuthEnabled","auth","password","enabled","isPasskeyEnabled","passkey","passkeyError","setPasskeyError","handlePasskeySuccess","PasskeyAuthenticationResponse","password_reset_required","navigate","to","user","setQueryData","queryKey","window","location","href","invalidateQueries","passkeyLoginMutation","onSuccess","onError","error","reason","onSettled","buildOAuthUrl","providerId","oauthUrl","authUrl","URL","returnUrl","pathname","hash","encodeURIComponent","buildPasswordLoginHref","params","URLSearchParams","key","value","Object","entries","stringValue","String","set","decodeURIComponent","replaceAll","query","toString","map","provider","icon_url","id","display_name","type","isPending","mutate","__html","component"],"sources":["../../../frontend/src/components/auth/auth-method-tile.tsx","../../../frontend/src/routes/login/index.tsx?tsr-split=component"],"sourcesContent":["import { TRButton } from '@tinyrack/ui/components/button';\nimport { TRLinkButton } from '@tinyrack/ui/components/link-button';\nimport { TRText } from '@tinyrack/ui/components/text';\nimport { LinkIcon } from 'lucide-react';\nimport type { ReactElement, ReactNode } from 'react';\nimport {\n AppleLogo,\n GithubLogo,\n GoogleLogo,\n} from '#frontend/components/auth/provider-logos.tsx';\nimport type { OAuthProviderType } from '#frontend/queries/config.ts';\n\ntype AuthMethodTileBaseProps = {\n /** A provider icon URL, or a ready-made element. */\n icon?: string | ReactNode;\n label: string;\n providerType?: OAuthProviderType;\n};\n\ntype AuthMethodTileProps = AuthMethodTileBaseProps &\n (\n | {\n /** Navigating method (OAuth, or the email form). Must be a real anchor. */\n render: ReactElement;\n onClick?: never;\n isLoading?: never;\n disabled?: never;\n }\n | {\n render?: never;\n /** In-page method (passkey), which runs a ceremony instead of navigating. */\n onClick: () => void;\n isLoading?: boolean;\n disabled?: boolean;\n }\n );\n\nconst PROVIDER_LOGOS: Record<\n Exclude<OAuthProviderType, 'generic_oauth'>,\n ReactNode\n> = {\n google: <GoogleLogo className=\"size-tinyrack-xl\" />,\n github: <GithubLogo className=\"size-tinyrack-xl\" />,\n apple: <AppleLogo className=\"size-tinyrack-xl\" />,\n};\n\n/**\n * One sign-in method on the method chooser.\n *\n * Full-width rows at every breakpoint. The previous three-across grid gave\n * each tile a third of the card, so provider names wrapped onto two lines and\n * the icons and labels never lined up between tiles.\n */\nexport function AuthMethodTile({\n icon,\n label,\n providerType,\n render,\n onClick,\n isLoading,\n disabled,\n}: AuthMethodTileProps) {\n let leading: ReactNode;\n if (providerType && providerType !== 'generic_oauth') {\n leading = PROVIDER_LOGOS[providerType];\n } else if (typeof icon === 'string') {\n leading = <img alt=\"\" className=\"size-tinyrack-xl\" src={icon} />;\n } else if (icon) {\n leading = icon;\n } else {\n leading = <LinkIcon aria-hidden className=\"size-tinyrack-xl\" />;\n }\n\n const content = (\n <>\n <span className=\"flex size-tinyrack-xl shrink-0 items-center justify-center\">\n {leading}\n </span>\n <TRText truncate variant=\"body\">\n {label}\n </TRText>\n </>\n );\n\n const className =\n 'w-full justify-start gap-tinyrack-md transition-colors duration-tinyrack-fast ease-tinyrack-standard';\n\n if (render) {\n return (\n <TRLinkButton\n appearance=\"outline\"\n className={`cursor-pointer ${className}`}\n intent=\"neutral\"\n render={render}\n uiSize=\"lg\"\n >\n {content}\n </TRLinkButton>\n );\n }\n\n return (\n <TRButton\n appearance=\"outline\"\n className={className}\n disabled={disabled}\n intent=\"neutral\"\n loading={isLoading}\n onClick={onClick}\n type=\"button\"\n uiSize=\"lg\"\n >\n {content}\n </TRButton>\n );\n}\n","import {\n useMutation,\n useQueryClient,\n useSuspenseQuery,\n} from '@tanstack/react-query';\nimport { createFileRoute, redirect, useRouter } from '@tanstack/react-router';\nimport { CircleAlertIcon, FingerprintIcon, MailIcon } from 'lucide-react';\nimport { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { z } from 'zod';\nimport { AuthMethodTile } from '#frontend/components/auth/auth-method-tile.tsx';\nimport { AuthPageHeader } from '#frontend/components/auth/auth-page-header.tsx';\nimport { AuthorizationContextBanner } from '#frontend/components/auth/authorization-context-banner.tsx';\nimport { Alert } from '#frontend/components/ui/alert.tsx';\nimport { RouteErrorFallback } from '#frontend/components/ui/route-error-fallback.tsx';\nimport { AuthLayout } from '#frontend/features/layout/auth-layout.tsx';\nimport {\n buildAuthenticatedAuthorizeUrl,\n extractOAuthParams,\n hasAuthorizationContext,\n isOAuthFlow,\n OAuthSearchSchema,\n} from '#frontend/libs/oauth-search.ts';\nimport { classifyPasskeyError } from '#frontend/libs/passkey-error.ts';\nimport { tick } from '#frontend/libs/promise.ts';\nimport { getAuthorizationContextQueryOptions } from '#frontend/queries/authorization-context.ts';\nimport {\n type AppConfigs,\n appConfigQueryOptions,\n} from '#frontend/queries/config.ts';\nimport {\n authenticateWithPasskeyMutationOptions,\n type PasskeyAuthenticationResponse,\n} from '#frontend/queries/passkey.ts';\nimport { getSessionQueryOptions } from '#frontend/queries/session.ts';\n\nconst SearchSchema = OAuthSearchSchema.extend({\n oauth_error: z.string().optional(),\n oauth_error_description: z.string().optional(),\n});\n\nconst OAUTH_ERROR_I18N_MAP: Record<string, string> = {\n access_denied: 'oauth.error.accessDenied',\n temporarily_unavailable: 'oauth.error.temporarilyUnavailable',\n server_error: 'oauth.error.serverError',\n registration_email_not_allowed: 'oauth.error.registrationEmailNotAllowed',\n};\n\nexport const Route = createFileRoute('/login/')({\n component: Login,\n errorComponent: RouteErrorFallback,\n validateSearch: SearchSchema,\n loaderDeps: ({ search }) => ({\n search,\n }),\n loader: async ({ context, deps }) => {\n const config = await context.queryClient.ensureQueryData(\n appConfigQueryOptions,\n );\n\n if (shouldRedirectToPassword(config, deps.search)) {\n throw redirect({\n to: '/login/password',\n search: extractOAuthParams(deps.search),\n replace: true,\n });\n }\n\n if (hasAuthorizationContext(deps.search)) {\n await context.queryClient.ensureQueryData(\n getAuthorizationContextQueryOptions(deps.search),\n );\n }\n },\n});\n\nfunction shouldRedirectToPassword(\n config: AppConfigs,\n search: z.infer<typeof SearchSchema>,\n): boolean {\n if (search.oauth_error) {\n return false;\n }\n\n return (\n config.auth.password.enabled &&\n !config.auth.passkey.enabled &&\n config.identity_providers.length === 0\n );\n}\n\nfunction Login() {\n const { t, i18n } = useTranslation();\n const router = useRouter();\n const queryClient = useQueryClient();\n const search = Route.useSearch();\n\n const lang = search.lang ?? i18n.language;\n const { data: configData } = useSuspenseQuery(appConfigQueryOptions);\n\n // Get implicit notice from config for OAuth signup\n const implicitNotice =\n configData.registration.signup_notice?.[lang] ??\n configData.registration.signup_notice?.[configData.i18n.fallback_language];\n const oauthProviders = configData.identity_providers;\n\n const oauthError = search.oauth_error;\n const oauthErrorMessage = oauthError\n ? t(OAUTH_ERROR_I18N_MAP[oauthError] ?? 'oauth.error.failed')\n : undefined;\n\n const isPasswordAuthEnabled = configData.auth.password.enabled;\n const isPasskeyEnabled = configData.auth.passkey.enabled;\n const [passkeyError, setPasskeyError] = useState<string | null>(null);\n\n const handlePasskeySuccess = async (data: PasskeyAuthenticationResponse) => {\n if (data.password_reset_required) {\n await router.navigate({ to: '/password/reset-required' });\n return;\n }\n if (data.user) {\n queryClient.setQueryData(getSessionQueryOptions.queryKey, data);\n await tick();\n\n if (isOAuthFlow(search)) {\n window.location.href = buildAuthenticatedAuthorizeUrl(search);\n } else {\n router.navigate({ to: '/profile' });\n }\n }\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n };\n\n const passkeyLoginMutation = useMutation({\n ...authenticateWithPasskeyMutationOptions,\n onSuccess: (data) => {\n setPasskeyError(null);\n handlePasskeySuccess(data);\n },\n onError: (error) => {\n const reason = classifyPasskeyError(error);\n if (reason === 'unsupported') {\n setPasskeyError(t('login.passkey.error.unsupported'));\n return;\n }\n\n setPasskeyError(t('login.passkey.error.failed'));\n },\n onSettled: () => {\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n });\n\n const buildOAuthUrl = (providerId: string) => {\n let oauthUrl = `/api/oauth/${providerId}/authorize?mode=login`;\n\n if (isOAuthFlow(search)) {\n const authUrl = new URL(buildAuthenticatedAuthorizeUrl(search));\n const returnUrl = `${authUrl.pathname}${authUrl.search}${authUrl.hash}`;\n oauthUrl += `&return_url=${encodeURIComponent(returnUrl)}`;\n }\n\n return oauthUrl;\n };\n\n const buildPasswordLoginHref = () => {\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(extractOAuthParams(search))) {\n if (value !== undefined) {\n const stringValue = String(value);\n params.set(\n key,\n key === 'account_selected'\n ? decodeURIComponent(stringValue).replaceAll('\"', '')\n : stringValue,\n );\n }\n }\n const query = params.toString();\n return query ? `/login/password?${query}` : '/login/password';\n };\n\n return (\n <AuthLayout>\n {/*\n Branding title and subtitle are rendered once, by the brand panel in\n the layout. Repeating them here would give the page two copies of the\n product name and two heading nodes with the same text.\n */}\n <AuthPageHeader\n subtitle={t('login.selectMethod.subtitle') || undefined}\n title={t('login.title')}\n />\n\n <AuthorizationContextBanner search={search} />\n\n {oauthErrorMessage && (\n <Alert icon={CircleAlertIcon} type=\"error\">\n {oauthErrorMessage}\n </Alert>\n )}\n\n {passkeyError && (\n <Alert icon={CircleAlertIcon} type=\"error\">\n {passkeyError}\n </Alert>\n )}\n\n <div className=\"flex flex-col gap-tinyrack-sm\">\n {oauthProviders.map((provider) => (\n <AuthMethodTile\n icon={provider.icon_url}\n key={provider.id}\n label={provider.display_name}\n providerType={provider.type}\n // Leaves the SPA for the provider, so a plain anchor rather than a\n // router link. No children here — the tile supplies them, and an\n // element passed to `render` would override them.\n render={<a href={buildOAuthUrl(provider.id)} />}\n />\n ))}\n\n {isPasswordAuthEnabled && (\n <AuthMethodTile\n icon={<MailIcon aria-hidden className=\"size-tinyrack-xl\" />}\n label={t('login.method.password')}\n render={<a href={buildPasswordLoginHref()} />}\n />\n )}\n\n {isPasskeyEnabled && (\n <AuthMethodTile\n disabled={passkeyLoginMutation.isPending}\n icon={<FingerprintIcon aria-hidden className=\"size-tinyrack-xl\" />}\n isLoading={passkeyLoginMutation.isPending}\n label={t('login.method.passkey')}\n onClick={() => {\n setPasskeyError(null);\n passkeyLoginMutation.mutate();\n }}\n />\n )}\n </div>\n\n {implicitNotice && (\n <div\n className=\"prose prose-sm text-center text-tinyrack-text-muted text-tinyrack-xs! **:text-tinyrack-xs!\"\n dangerouslySetInnerHTML={{ __html: implicitNotice }}\n />\n )}\n </AuthLayout>\n );\n}\n"],"mappings":"q0BAqCA,EAAA,wJAOA,EASA,SAAA,EAAA,CAAA,OAAA,QAAA,eAAA,SAAA,UAAA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AM,EAAA,EAAA,IAAA,CAAC,EAAD,CAAU,cAAA,GAAY,UAAU,kBAAkB,CAAA,EACxD,MAAOpB,EAAE,uBAAuB,EAChC,QAAQ,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UA7DgB,CACnC,IAAMwD,EAAS,IAAIC,gBACnB,IAAK,GAAM,CAACC,EAAKC,KAAUC,OAAOC,QAAQ5E,EAAmBmB,CAAM,CAAC,EAClE,GAAIuD,IAAUxC,IAAAA,GAAW,CACvB,IAAM2C,EAAcC,OAAOJ,CAAK,EAChCH,EAAOQ,IACLN,EACAA,IAAQ,mBACJO,mBAAmBH,CAAW,CAAC,CAACI,WAAW,IAAK,EAAE,EAClDJ,CACN,CACF,CAEF,IAAMK,EAAQX,EAAOY,SAAS,EAC9B,OAAOD,EAAQ,mBAAmBA,IAAU,iBAC9C,EA8C2BZ,CAAuB,CAAE,CAAA,CAAI,CAAA,EAIjD/B,IACC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,SAAUgB,EAAqBmC,UAC/B,MAAM,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,cAAA,GAAY,UAAU,kBAAkB,CAAA,EAC/D,UAAWnC,EAAqBmC,UAChC,MAAO3E,EAAE,sBAAsB,EAC/B,YAAe,CACb2B,EAAgB,IAAI,EACpBa,EAAqBoC,OAAO,CAC9B,CAAE,CAAA,CAGH,IAEJlE,IACC,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,UAAU,6FACV,wBAAyB,CAAEmE,OAAQnE,CAAe,CAAE,CAAA,CAG9C,CAAA,CAAA,CAEhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-UL_cNRnQ.js","names":["RouteErrorFallback","SplitErrorComponent","errorComponent"],"sources":["../../../frontend/src/routes/login/index.tsx?tsr-split=errorComponent"],"sourcesContent":["import {\n useMutation,\n useQueryClient,\n useSuspenseQuery,\n} from '@tanstack/react-query';\nimport { createFileRoute, redirect, useRouter } from '@tanstack/react-router';\nimport { CircleAlertIcon, FingerprintIcon, MailIcon } from 'lucide-react';\nimport { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { z } from 'zod';\nimport { AuthMethodTile } from '#frontend/components/auth/auth-method-tile.tsx';\nimport { AuthPageHeader } from '#frontend/components/auth/auth-page-header.tsx';\nimport { AuthorizationContextBanner } from '#frontend/components/auth/authorization-context-banner.tsx';\nimport { Alert } from '#frontend/components/ui/alert.tsx';\nimport { RouteErrorFallback } from '#frontend/components/ui/route-error-fallback.tsx';\nimport { AuthLayout } from '#frontend/features/layout/auth-layout.tsx';\nimport {\n buildAuthenticatedAuthorizeUrl,\n extractOAuthParams,\n hasAuthorizationContext,\n isOAuthFlow,\n OAuthSearchSchema,\n} from '#frontend/libs/oauth-search.ts';\nimport { classifyPasskeyError } from '#frontend/libs/passkey-error.ts';\nimport { tick } from '#frontend/libs/promise.ts';\nimport { getAuthorizationContextQueryOptions } from '#frontend/queries/authorization-context.ts';\nimport {\n type AppConfigs,\n appConfigQueryOptions,\n} from '#frontend/queries/config.ts';\nimport {\n authenticateWithPasskeyMutationOptions,\n type PasskeyAuthenticationResponse,\n} from '#frontend/queries/passkey.ts';\nimport { getSessionQueryOptions } from '#frontend/queries/session.ts';\n\nconst SearchSchema = OAuthSearchSchema.extend({\n oauth_error: z.string().optional(),\n oauth_error_description: z.string().optional(),\n});\n\nconst OAUTH_ERROR_I18N_MAP: Record<string, string> = {\n access_denied: 'oauth.error.accessDenied',\n temporarily_unavailable: 'oauth.error.temporarilyUnavailable',\n server_error: 'oauth.error.serverError',\n registration_email_not_allowed: 'oauth.error.registrationEmailNotAllowed',\n};\n\nexport const Route = createFileRoute('/login/')({\n component: Login,\n errorComponent: RouteErrorFallback,\n validateSearch: SearchSchema,\n loaderDeps: ({ search }) => ({\n search,\n }),\n loader: async ({ context, deps }) => {\n const config = await context.queryClient.ensureQueryData(\n appConfigQueryOptions,\n );\n\n if (shouldRedirectToPassword(config, deps.search)) {\n throw redirect({\n to: '/login/password',\n search: extractOAuthParams(deps.search),\n replace: true,\n });\n }\n\n if (hasAuthorizationContext(deps.search)) {\n await context.queryClient.ensureQueryData(\n getAuthorizationContextQueryOptions(deps.search),\n );\n }\n },\n});\n\nfunction shouldRedirectToPassword(\n config: AppConfigs,\n search: z.infer<typeof SearchSchema>,\n): boolean {\n if (search.oauth_error) {\n return false;\n }\n\n return (\n config.auth.password.enabled &&\n !config.auth.passkey.enabled &&\n config.identity_providers.length === 0\n );\n}\n\nfunction Login() {\n const { t, i18n } = useTranslation();\n const router = useRouter();\n const queryClient = useQueryClient();\n const search = Route.useSearch();\n\n const lang = search.lang ?? i18n.language;\n const { data: configData } = useSuspenseQuery(appConfigQueryOptions);\n\n // Get implicit notice from config for OAuth signup\n const implicitNotice =\n configData.registration.signup_notice?.[lang] ??\n configData.registration.signup_notice?.[configData.i18n.fallback_language];\n const oauthProviders = configData.identity_providers;\n\n const oauthError = search.oauth_error;\n const oauthErrorMessage = oauthError\n ? t(OAUTH_ERROR_I18N_MAP[oauthError] ?? 'oauth.error.failed')\n : undefined;\n\n const isPasswordAuthEnabled = configData.auth.password.enabled;\n const isPasskeyEnabled = configData.auth.passkey.enabled;\n const [passkeyError, setPasskeyError] = useState<string | null>(null);\n\n const handlePasskeySuccess = async (data: PasskeyAuthenticationResponse) => {\n if (data.password_reset_required) {\n await router.navigate({ to: '/password/reset-required' });\n return;\n }\n if (data.user) {\n queryClient.setQueryData(getSessionQueryOptions.queryKey, data);\n await tick();\n\n if (isOAuthFlow(search)) {\n window.location.href = buildAuthenticatedAuthorizeUrl(search);\n } else {\n router.navigate({ to: '/profile' });\n }\n }\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n };\n\n const passkeyLoginMutation = useMutation({\n ...authenticateWithPasskeyMutationOptions,\n onSuccess: (data) => {\n setPasskeyError(null);\n handlePasskeySuccess(data);\n },\n onError: (error) => {\n const reason = classifyPasskeyError(error);\n if (reason === 'unsupported') {\n setPasskeyError(t('login.passkey.error.unsupported'));\n return;\n }\n\n setPasskeyError(t('login.passkey.error.failed'));\n },\n onSettled: () => {\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n });\n\n const buildOAuthUrl = (providerId: string) => {\n let oauthUrl = `/api/oauth/${providerId}/authorize?mode=login`;\n\n if (isOAuthFlow(search)) {\n const authUrl = new URL(buildAuthenticatedAuthorizeUrl(search));\n const returnUrl = `${authUrl.pathname}${authUrl.search}${authUrl.hash}`;\n oauthUrl += `&return_url=${encodeURIComponent(returnUrl)}`;\n }\n\n return oauthUrl;\n };\n\n const buildPasswordLoginHref = () => {\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(extractOAuthParams(search))) {\n if (value !== undefined) {\n const stringValue = String(value);\n params.set(\n key,\n key === 'account_selected'\n ? decodeURIComponent(stringValue).replaceAll('\"', '')\n : stringValue,\n );\n }\n }\n const query = params.toString();\n return query ? `/login/password?${query}` : '/login/password';\n };\n\n return (\n <AuthLayout>\n {/*\n Branding title and subtitle are rendered once, by the brand panel in\n the layout. Repeating them here would give the page two copies of the\n product name and two heading nodes with the same text.\n */}\n <AuthPageHeader\n subtitle={t('login.selectMethod.subtitle') || undefined}\n title={t('login.title')}\n />\n\n <AuthorizationContextBanner search={search} />\n\n {oauthErrorMessage && (\n <Alert icon={CircleAlertIcon} type=\"error\">\n {oauthErrorMessage}\n </Alert>\n )}\n\n {passkeyError && (\n <Alert icon={CircleAlertIcon} type=\"error\">\n {passkeyError}\n </Alert>\n )}\n\n <div className=\"flex flex-col gap-tinyrack-sm\">\n {oauthProviders.map((provider) => (\n <AuthMethodTile\n icon={provider.icon_url}\n key={provider.id}\n label={provider.display_name}\n providerType={provider.type}\n // Leaves the SPA for the provider, so a plain anchor rather than a\n // router link. No children here — the tile supplies them, and an\n // element passed to `render` would override them.\n render={<a href={buildOAuthUrl(provider.id)} />}\n />\n ))}\n\n {isPasswordAuthEnabled && (\n <AuthMethodTile\n icon={<MailIcon aria-hidden className=\"size-tinyrack-xl\" />}\n label={t('login.method.password')}\n render={<a href={buildPasswordLoginHref()} />}\n />\n )}\n\n {isPasskeyEnabled && (\n <AuthMethodTile\n disabled={passkeyLoginMutation.isPending}\n icon={<FingerprintIcon aria-hidden className=\"size-tinyrack-xl\" />}\n isLoading={passkeyLoginMutation.isPending}\n label={t('login.method.passkey')}\n onClick={() => {\n setPasskeyError(null);\n passkeyLoginMutation.mutate();\n }}\n />\n )}\n </div>\n\n {implicitNotice && (\n <div\n className=\"prose prose-sm text-center text-tinyrack-text-muted text-tinyrack-xs! **:text-tinyrack-xs!\"\n dangerouslySetInnerHTML={{ __html: implicitNotice }}\n />\n )}\n </AuthLayout>\n );\n}\n"],"mappings":"wCAcsF,IAAAC,EAA7ED"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Yn as e,i as t,n,r}from"./config-v3-oy_ef.js";import{t as i}from"./mutationOptions-CrswitPs.js";function a(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function o(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function s(){return c.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var c={stubThis:e=>e};function l(e){let{id:t}=e;return{...e,id:o(t),transports:e.transports}}function u(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var d=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function f({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new d({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new d({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new d({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new d({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new d({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new d({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new d({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new d({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!u(t))return new d({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new d({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new d({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new d({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var p=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},m=[`cross-platform`,`platform`];function h(e){if(e&&!(m.indexOf(e)<0))return e}async function g(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!s())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:o(t.challenge),user:{...t.user,id:o(t.user.id)},excludeCredentials:t.excludeCredentials?.map(l)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=p.createNewAbortSignal();let c;try{c=await navigator.credentials.create(i)}catch(e){throw f({error:e,options:i})}if(!c)throw Error(`Registration was not completed`);let{id:u,rawId:d,response:m,type:g}=c,v;typeof m.getTransports==`function`&&(v=m.getTransports());let y;if(typeof m.getPublicKeyAlgorithm==`function`)try{y=m.getPublicKeyAlgorithm()}catch(e){_(`getPublicKeyAlgorithm()`,e)}let b;if(typeof m.getPublicKey==`function`)try{let e=m.getPublicKey();e!==null&&(b=a(e))}catch(e){_(`getPublicKey()`,e)}let x;if(typeof m.getAuthenticatorData==`function`)try{x=a(m.getAuthenticatorData())}catch(e){_(`getAuthenticatorData()`,e)}return{id:u,rawId:a(d),response:{attestationObject:a(m.attestationObject),clientDataJSON:a(m.clientDataJSON),transports:v,publicKeyAlgorithm:y,publicKey:b,authenticatorData:x},type:g,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:h(c.authenticatorAttachment)}}function _(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function v(){if(!s())return y.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?y.stubThis(new Promise(e=>e(!1))):y.stubThis(e.isConditionalMediationAvailable())}var y={stubThis:e=>e};function b({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new d({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new d({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!u(t))return new d({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new d({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new d({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function x(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!s())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(l));let c={...t,challenge:o(t.challenge),allowCredentials:i},u={};if(n){if(!await v())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');u.mediation=`conditional`,c.allowCredentials=[]}u.publicKey=c,u.signal=p.createNewAbortSignal();let d;try{d=await navigator.credentials.get(u)}catch(e){throw b({error:e,options:u})}if(!d)throw Error(`Authentication was not completed`);let{id:f,rawId:m,response:g,type:_}=d,y;return g.userHandle&&(y=a(g.userHandle)),{id:f,rawId:a(m),response:{authenticatorData:a(g.authenticatorData),clientDataJSON:a(g.clientDataJSON),signature:a(g.signature),userHandle:y},type:_,clientExtensionResults:d.getClientExtensionResults(),authenticatorAttachment:h(d.authenticatorAttachment)}}var S=e({queryKey:n.passkeys(),queryFn:async()=>t(await r.api.user.passkeys.$get())}),C=i({mutationFn:async e=>{let{options:n}=await t(await r.api.user.passkeys.register.options.$post()),i=await g({optionsJSON:n});return t(await r.api.user.passkeys.register.verify.$post({json:{response:i,name:e.name}}))}}),w=i({mutationFn:async e=>t(await r.api.user.passkeys[`:id`].$delete({param:{id:e.id}}))}),T=i({mutationFn:async e=>t(await r.api.user.passkeys[`:id`].$patch({param:{id:e.id},json:{name:e.name}}))}),E=i({mutationFn:async()=>{let{options:e}=await t(await r.api.auth.passkey.options.$post()),n=await x({optionsJSON:e});return t(await r.api.auth.passkey.verify.$post({json:{response:{...n,clientExtensionResults:{...n.clientExtensionResults}}}}))}}),D=async(e,n)=>{try{let{options:i}=await t(await r.api.auth.passkey.options.$post({},{init:{signal:n}})),a=await x({optionsJSON:i,useBrowserAutofill:!0});e(await t(await r.api.auth.passkey.verify.$post({json:{response:{...a,clientExtensionResults:{...a.clientExtensionResults}}}},{init:{signal:n}})))}catch(e){e instanceof Error&&e.name}};export{T as a,C as i,w as n,D as o,S as r,E as t};
|
|
2
|
-
//# sourceMappingURL=passkey-B2Blw47e.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{J as e,U as t,Z as n,i as r,q as i,s as a}from"./createLucideIcon-BPpAIXR_.js";import{Dn as o,Yn as s,i as c,n as l,r as u,sr as d}from"./config-v3-oy_ef.js";import{t as f}from"./useMutation-ZLFeJg75.js";import{t as p}from"./useQuery-BvMz34BW.js";import{t as m}from"./link-BN90emXr.js";import{t as h}from"./fingerprint-pattern-DP62Vk8x.js";import{F as g,N as _,R as v,S as y,j as b,m as x,z as S}from"./index-gliHKncz.js";import{t as C}from"./auth-page-header-CIs08f5Y.js";import{t as w}from"./alert-leqyvHOp.js";import{t as T}from"./auth-layout-CoeqNhTT.js";import{t as E}from"./promise-OpBtq8tG.js";import{n as D,t as O}from"./auth-footer-Cz5ivsDc.js";import{t as k}from"./passkey-error-ZqqPQUta.js";import{t as A}from"./passkey-B2Blw47e.js";var j=n(e()),M=s({queryKey:l.pendingSecondFactorMethods(),queryFn:async()=>c(await u.api.auth[`2fa`].methods.$get()),retry:!1}),N=i();function P(){let{t:e}=r(),n=o(),i=d(),s=x.useSearch(),[c,l]=(0,j.useState)(null),u=(0,j.useRef)(!1),P=p({...M,enabled:c!==null}).data?.methods.includes(`totp`)??!1,F=t=>{switch(t){case`unsupported`:return e(`verifyPasskey.error.unsupported`);case`not_allowed`:return e(`verifyPasskey.error.notAllowed`);case`expired`:return e(`verifyPasskey.error.expired`);case`user_mismatch`:return e(`verifyPasskey.error.userMismatch`);case`verification_failed`:return e(`verifyPasskey.error.failed`)}},I=f({...A,onSuccess:async e=>{e.user&&(i.setQueryData(y.queryKey,{user:e.user}),await E(),g(s)?window.location.href=b(s):n.navigate({to:`/profile`}))},onError:async e=>{let t=k(e);l({message:F(t),reason:t})},onSettled:()=>{i.invalidateQueries({queryKey:y.queryKey})}});return(0,j.useEffect)(()=>{u.current||(u.current=!0,I.mutate())},[I]),(0,N.jsxs)(T,{children:[(0,N.jsx)(C,{align:`center`,subtitle:e(`verifyPasskey.subtitle`),title:e(`verifyPasskey.title`)}),(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-lg`,children:[(0,N.jsx)(`div`,{className:`flex size-tinyrack-3xl items-center justify-center rounded-tinyrack-full bg-tinyrack-surface-muted`,children:(0,N.jsx)(h,{"aria-hidden":!0,className:`size-tinyrack-2xl text-tinyrack-text-muted`})}),I.isPending&&(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-sm`,children:[(0,N.jsx)(t,{uiSize:`md`}),(0,N.jsx)(`p`,{className:`text-center text-tinyrack-sm text-tinyrack-text-muted`,children:e(`verifyPasskey.waiting`)})]}),c&&(0,N.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-tinyrack-md`,children:[(0,N.jsx)(w,{className:`w-full`,icon:v,type:`error`,children:c.message}),P&&(0,N.jsx)(S,{className:`w-full`,intent:`primary`,render:(0,N.jsx)(m,{search:_(s),to:`/verify/totp`}),uiSize:`lg`,children:e(`verifyPasskey.useTotp`)}),(0,N.jsx)(a,{appearance:P?`outline`:`solid`,className:`w-full`,intent:P?`neutral`:`primary`,onClick:()=>{l(null),I.mutate()},type:`button`,uiSize:`lg`,children:e(`verifyPasskey.retry`)})]})]}),(0,N.jsx)(O,{children:(0,N.jsx)(D,{link:(0,N.jsx)(m,{search:s,to:`/login`,children:e(`verifyPasskey.backToLogin`)})})})]})}export{P as component};
|
|
2
|
-
//# sourceMappingURL=passkey-CEx1VZ5R.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{J as e,Z as t,i as n,n as r,q as i,s as a,t as o}from"./createLucideIcon-BPpAIXR_.js";import{Dn as s,sr as c,t as l}from"./config-v3-oy_ef.js";import{t as u}from"./useMutation-ZLFeJg75.js";import{tt as d}from"./shell-header-bar-C9AB5lT-.js";import{t as f}from"./link-BN90emXr.js";import{t as p}from"./auth-field-HwxENJnB.js";import{t as m}from"./fingerprint-pattern-DP62Vk8x.js";import{t as h}from"./shield-check-D_p8H0ni.js";import{c as g,o as _}from"./zod-C87S6Tec.js";import{F as v,N as y,R as b,S as x,j as S,u as C,z as w}from"./index-gliHKncz.js";import{t as T}from"./auth-page-header-CIs08f5Y.js";import{t as E}from"./alert-leqyvHOp.js";import{t as D}from"./auth-layout-CoeqNhTT.js";import{t as O}from"./promise-OpBtq8tG.js";import{n as k,t as A}from"./auth-footer-Cz5ivsDc.js";import{t as j}from"./passkey-error-ZqqPQUta.js";import{i as M}from"./passkey-B2Blw47e.js";import{r as N,t as P}from"./standard-schema-e8gtSzGE.js";var F=o(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),I=t(e()),L=i();function R(){let{t:e}=n(),t=s(),i=c(),o=C.useSearch(),{data:R}=d(l),[z,B]=(0,I.useState)(o.passkey_name?`registering`:`form`),[V,H]=(0,I.useState)(``),U=(0,I.useRef)(!1),W=R.auth.password.enabled&&R.auth.password.two_factor.enrollment_required&&R.auth.password.totp.enabled,{register:G,handleSubmit:K,formState:{errors:q}}=N({defaultValues:{name:``},resolver:P((0,I.useMemo)(()=>_({name:g().max(100,e(`validation.passkey.name.max`))}),[e]))}),J=u({...M,onSuccess:async e=>{e.second_factor_setup_completed&&e.user?(i.setQueryData(x.queryKey,{user:e.user}),await O(),v(o)?window.location.href=S(o):t.navigate({to:`/profile`})):(i.invalidateQueries({queryKey:x.queryKey}),t.navigate({to:`/profile`}))},onError:t=>{switch(B(`error`),j(t)){case`unsupported`:H(e(`setupPasskey.error.unsupported`));return;case`not_allowed`:H(e(`setupPasskey.error.notAllowed`));return;case`expired`:H(e(`setupPasskey.error.expired`));return;case`user_mismatch`:case`verification_failed`:H(e(`setupPasskey.error.failed`));return}},onSettled:()=>{i.invalidateQueries({queryKey:x.queryKey})}});return(0,I.useEffect)(()=>{o.passkey_name&&!U.current&&(U.current=!0,J.mutate({name:o.passkey_name}))},[J,o.passkey_name]),z===`registering`?(0,L.jsxs)(D,{children:[(0,L.jsx)(T,{subtitle:e(`setupPasskey.subtitle`),title:e(`setupPasskey.title`)}),(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-lg py-tinyrack-xl`,children:[(0,L.jsx)(m,{"aria-hidden":!0,className:`size-tinyrack-3xl animate-pulse text-tinyrack-primary`}),(0,L.jsx)(r,{align:`center`,as:`p`,color:`muted`,variant:`body`,children:e(`setupPasskey.waiting`)})]})]}):z===`error`?(0,L.jsxs)(D,{children:[(0,L.jsx)(T,{subtitle:e(`setupPasskey.subtitle`),title:e(`setupPasskey.title`)}),(0,L.jsx)(E,{icon:b,type:`error`,children:V}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-tinyrack-sm`,children:[W&&(0,L.jsxs)(w,{className:`w-full gap-tinyrack-sm`,intent:`primary`,render:(0,L.jsx)(f,{search:y(o),to:`/setup/totp`}),uiSize:`lg`,children:[(0,L.jsx)(h,{"aria-hidden":!0,className:`size-tinyrack-xl`}),e(`setupPasskey.useTotp`)]}),(0,L.jsx)(a,{appearance:W?`outline`:`solid`,className:`w-full`,intent:W?`neutral`:`primary`,onClick:()=>{o.passkey_name?(B(`registering`),H(``),J.mutate({name:o.passkey_name})):B(`form`)},type:`button`,uiSize:`lg`,children:e(`setupPasskey.retry`)})]}),(0,L.jsx)(A,{children:(0,L.jsx)(k,{link:(0,L.jsx)(f,{search:y(o),to:`/login`,children:e(`setupPasskey.backToLogin`)})})})]}):(0,L.jsxs)(D,{children:[(0,L.jsx)(T,{subtitle:e(`setupPasskey.subtitle`),title:e(`setupPasskey.title`)}),(0,L.jsx)(E,{icon:h,type:`info`,children:e(`setupPasskey.required`)}),(0,L.jsx)(r,{align:`center`,as:`p`,color:`muted`,variant:`bodySm`,children:e(`setupPasskey.description`)}),(0,L.jsxs)(`form`,{className:`flex flex-col gap-tinyrack-lg`,onSubmit:K(e=>{B(`registering`),H(``),J.mutate({name:e.name||void 0})}),children:[(0,L.jsx)(p,{error:q.name,hint:e(`setupPasskey.name.hint`),icon:F,id:`passkey-name`,label:e(`setupPasskey.name.label`),placeholder:e(`setupPasskey.name.placeholder`),...G(`name`),type:`text`}),(0,L.jsx)(a,{className:`w-full`,intent:`primary`,loading:J.isPending,loadingLabel:e(`setupPasskey.registering`),type:`submit`,uiSize:`lg`,children:e(`setupPasskey.continue`)})]}),(0,L.jsx)(A,{children:(0,L.jsx)(k,{link:(0,L.jsx)(f,{search:y(o),to:`/login`,children:e(`setupPasskey.backToLogin`)})})})]})}export{R as component};
|
|
2
|
-
//# sourceMappingURL=passkey-CU8x9J2w.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{J as e,Z as t,i as n,q as r,s as i}from"./createLucideIcon-BPpAIXR_.js";import{Dn as a,i as o,r as s,sr as c,t as l}from"./config-v3-oy_ef.js";import{t as u}from"./mutationOptions-CrswitPs.js";import{t as d}from"./useMutation-ZLFeJg75.js";import{tt as f}from"./shell-header-bar-C9AB5lT-.js";import{t as p}from"./link-BN90emXr.js";import{t as m}from"./auth-field-HwxENJnB.js";import{t as h}from"./authorization-context-banner-BbtQmMYH.js";import{t as g}from"./lock-7NRyvXBS.js";import{t as _}from"./mail-D0B_1Dzd.js";import{c as v,i as y,o as b}from"./zod-C87S6Tec.js";import{F as x,N as S,S as C,j as w,s as T}from"./index-gliHKncz.js";import{t as E}from"./auth-page-header-CIs08f5Y.js";import{t as D}from"./auth-layout-CoeqNhTT.js";import{t as O}from"./promise-OpBtq8tG.js";import{t as k}from"./link-C-WdTj3F.js";import{n as A,t as j}from"./auth-footer-Cz5ivsDc.js";import{o as M}from"./passkey-B2Blw47e.js";import{r as N,t as P}from"./standard-schema-e8gtSzGE.js";var F=t(e()),I=u({mutationFn:async e=>o(await s.api.auth.login.$post({json:e}))}),L=r();function R(){let{t:e,i18n:t}=n(),r=a(),o=c(),s=T.useSearch(),u=s.account_selection_state&&s.prompt?.split(` `).includes(`login`)?{...s,account_selected:1}:s,R=s.lang??t.language,{data:z}=f(l),B=z.registration.signup_notice?.[R]??z.registration.signup_notice?.[z.i18n.fallback_language],V=z.auth.password.enabled,H=z.auth.passkey.enabled,U=z.identity_providers.length+ +!!V+ +!!H>1,W=(0,F.useMemo)(()=>b({email:v().min(1,e(`validation.email.required`)).pipe(y(e(`validation.email.invalid`))),password:v().min(1,e(`validation.password.required`))}),[e]),G=d({...I,onSuccess:async(e,t)=>{let n=e.user;if(n.email_verification_required&&!n.email_verified){r.navigate({to:`/verify/email`,search:{email:t.email,...S(s)}});return}o.setQueryData(C.queryKey,{user:n}),await O();let i=[];if(z.auth.password.totp.enabled&&n.totp_registered&&i.push(`totp`),z.auth.passkey.enabled&&n.passkey_count>0&&i.push(`passkey`),n.second_factor_required&&i.length===0){if(z.available_2fa_setup_methods.length>1)return r.navigate({to:`/setup/2fa`,search:S(s)});if(z.available_2fa_setup_methods.length===1)return z.available_2fa_setup_methods[0]===`totp`?r.navigate({to:`/setup/totp`,search:S(s)}):r.navigate({to:`/setup/passkey`,search:{...S(s),passkey_name:`default`}})}if(i.length>1)return r.navigate({to:`/verify/2fa`,search:S(s)});if(i.length===1)return i[0]===`totp`?r.navigate({to:`/verify/totp`,search:S(s)}):r.navigate({to:`/verify/passkey`,search:S(s)});if(x(s))window.location.href=w(u);else return r.navigate({to:`/profile`})},onError:t=>{Y(`email`,{type:`manual`,message:e(`login.error.failed`)})},onSettled:()=>{o.invalidateQueries({queryKey:C.queryKey})}}),K=(0,F.useCallback)(async e=>{if(e.password_reset_required){await r.navigate({to:`/password/reset-required`});return}e.user&&(o.setQueryData(C.queryKey,e),await O(),x(s)?window.location.href=w(u):r.navigate({to:`/profile`})),o.invalidateQueries({queryKey:C.queryKey})},[o,r,s,u]),q=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(!(!H||!V))return q.current=new AbortController,M(K,q.current.signal),()=>{q.current?.abort()}},[H,V,K]);let{register:J,setError:Y,handleSubmit:X,formState:{errors:Z}}=N({defaultValues:{email:``,password:``},resolver:P(W)});return(0,L.jsxs)(D,{children:[(0,L.jsx)(E,{subtitle:e(`login.selectMethod.subtitle`)||void 0,title:e(`login.title`)}),(0,L.jsx)(h,{search:s}),V&&(0,L.jsxs)(`form`,{className:`flex flex-col gap-tinyrack-lg`,onSubmit:X(async e=>{G.mutate(e)}),children:[(0,L.jsx)(m,{autoComplete:`username webauthn`,error:Z.email,icon:_,label:e(`login.email.label`),placeholder:e(`login.email.placeholder`),...J(`email`),type:`email`}),(0,L.jsx)(m,{autoComplete:`current-password`,error:Z.password,icon:g,label:e(`login.password.label`),labelAction:z.email.enabled?(0,L.jsx)(k,{className:`text-tinyrack-xs`,render:(0,L.jsx)(p,{to:`/password/forgot`}),children:e(`login.link.forgotPassword`)}):void 0,placeholder:e(`login.password.placeholder`),...J(`password`),type:`password`}),(0,L.jsx)(i,{className:`w-full`,intent:`primary`,loading:G.isPending,loadingLabel:e(`login.submitting`),type:`submit`,uiSize:`lg`,children:e(`login.submit`)})]}),B&&(0,L.jsx)(`div`,{className:`prose prose-sm text-center text-tinyrack-text-muted text-tinyrack-xs! **:text-tinyrack-xs!`,dangerouslySetInnerHTML:{__html:B}}),(z.registration.public_registration||U)&&(0,L.jsxs)(j,{children:[z.registration.public_registration&&(0,L.jsx)(A,{link:(0,L.jsx)(p,{search:S(s),to:`/register`,children:e(`login.link.register`)}),text:e(`login.footer.noAccount`)}),U&&(0,L.jsx)(A,{link:(0,L.jsx)(p,{search:S(s),to:`/login`,children:e(`login.password.backToMethods`)})})]})]})}export{R as component};
|
|
2
|
-
//# sourceMappingURL=password-BhU_a0cR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"password-BhU_a0cR.js","names":["standardSchemaResolver","useMutation","useQueryClient","useSuspenseQuery","Link","useRouter","TRButton","TRLink","LockIcon","MailIcon","useCallback","useEffect","useMemo","useRef","useForm","useTranslation","z","AuthField","AuthFooter","AuthFooterLink","AuthPageHeader","AuthorizationContextBanner","AuthLayout","buildAuthenticatedAuthorizeUrl","extractOAuthParams","isOAuthFlow","tick","appConfigQueryOptions","loginMutationOptions","startConditionalPasskeyAuth","getSessionQueryOptions","Route","LoginPassword","t","i18n","router","queryClient","search","useSearch","authorizeSearch","OAuthSearch","account_selection_state","prompt","split","includes","account_selected","lang","language","data","configData","implicitNotice","registration","signup_notice","fallback_language","isPasswordAuthEnabled","auth","password","enabled","isPasskeyEnabled","passkey","hasMultipleLoginMethods","identity_providers","length","loginSchema","object","email","string","min","pipe","loginMutation","onSuccess","params","user","email_verification_required","email_verified","navigate","to","setQueryData","queryKey","registered_2fa_methods","SecondFactorMethod","totp","totp_registered","push","passkey_count","second_factor_required","available_2fa_setup_methods","method","passkey_name","window","location","href","onError","_error","setError","type","message","onSettled","invalidateQueries","handlePasskeySuccess","PasskeyAuthenticationResponse","password_reset_required","abortControllerRef","AbortController","current","signal","abort","register","handleSubmit","formState","errors","defaultValues","resolver","onSubmit","values","infer","mutate","undefined","isPending","__html","public_registration","component"],"sources":["../../../frontend/src/queries/login.ts","../../../frontend/src/routes/login/password/index.tsx?tsr-split=component"],"sourcesContent":["import { mutationOptions } from '@tanstack/react-query';\nimport type { InferRequestType, InferResponseType } from 'hono/client';\nimport { client, jsonOk } from '#frontend/libs/api.ts';\n\nexport type LoginParams = InferRequestType<\n (typeof client.api.auth.login)['$post']\n>['json'];\n\nexport type LoginResponse = InferResponseType<\n (typeof client.api.auth.login)['$post'],\n 200\n>;\n\nexport const loginMutationOptions = mutationOptions({\n mutationFn: async (values: LoginParams) => {\n const res = await client.api.auth.login.$post({\n json: values,\n });\n return jsonOk(res);\n },\n});\n","import { standardSchemaResolver } from '@hookform/resolvers/standard-schema';\nimport {\n useMutation,\n useQueryClient,\n useSuspenseQuery,\n} from '@tanstack/react-query';\nimport { createFileRoute, Link, useRouter } from '@tanstack/react-router';\nimport { TRButton } from '@tinyrack/ui/components/button';\nimport { TRLink } from '@tinyrack/ui/components/link';\nimport { LockIcon, MailIcon } from 'lucide-react';\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { z } from 'zod';\nimport { AuthField } from '#frontend/components/auth/auth-field.tsx';\nimport {\n AuthFooter,\n AuthFooterLink,\n} from '#frontend/components/auth/auth-footer.tsx';\nimport { AuthPageHeader } from '#frontend/components/auth/auth-page-header.tsx';\nimport { AuthorizationContextBanner } from '#frontend/components/auth/authorization-context-banner.tsx';\nimport { RouteErrorFallback } from '#frontend/components/ui/route-error-fallback.tsx';\nimport { AuthLayout } from '#frontend/features/layout/auth-layout.tsx';\nimport {\n buildAuthenticatedAuthorizeUrl,\n extractOAuthParams,\n hasAuthorizationContext,\n isOAuthFlow,\n type OAuthSearch,\n OAuthSearchSchema,\n type SecondFactorMethod,\n} from '#frontend/libs/oauth-search.ts';\nimport { tick } from '#frontend/libs/promise.ts';\nimport { getAuthorizationContextQueryOptions } from '#frontend/queries/authorization-context.ts';\nimport { appConfigQueryOptions } from '#frontend/queries/config.ts';\nimport { loginMutationOptions } from '#frontend/queries/login.ts';\nimport {\n type PasskeyAuthenticationResponse,\n startConditionalPasskeyAuth,\n} from '#frontend/queries/passkey.ts';\nimport { getSessionQueryOptions } from '#frontend/queries/session.ts';\n\nconst SearchSchema = OAuthSearchSchema;\n\nexport const Route = createFileRoute('/login/password/')({\n component: LoginPassword,\n errorComponent: RouteErrorFallback,\n validateSearch: SearchSchema,\n loaderDeps: ({ search }) => ({\n search,\n }),\n loader: async ({ context, deps }) => {\n await context.queryClient.ensureQueryData(appConfigQueryOptions);\n if (hasAuthorizationContext(deps.search)) {\n await context.queryClient.ensureQueryData(\n getAuthorizationContextQueryOptions(deps.search),\n );\n }\n },\n});\n\nfunction LoginPassword() {\n const { t, i18n } = useTranslation();\n const router = useRouter();\n const queryClient = useQueryClient();\n const search = Route.useSearch();\n const authorizeSearch: OAuthSearch =\n search.account_selection_state &&\n search.prompt?.split(' ').includes('login')\n ? { ...search, account_selected: 1 }\n : search;\n const lang = search.lang ?? i18n.language;\n\n const { data: configData } = useSuspenseQuery(appConfigQueryOptions);\n\n const implicitNotice =\n configData.registration.signup_notice?.[lang] ??\n configData.registration.signup_notice?.[configData.i18n.fallback_language];\n const isPasswordAuthEnabled = configData.auth.password.enabled;\n const isPasskeyEnabled = configData.auth.passkey.enabled;\n const hasMultipleLoginMethods =\n configData.identity_providers.length +\n (isPasswordAuthEnabled ? 1 : 0) +\n (isPasskeyEnabled ? 1 : 0) >\n 1;\n\n const loginSchema = useMemo(\n () =>\n z.object({\n email: z\n .string()\n .min(1, t('validation.email.required'))\n .pipe(z.email(t('validation.email.invalid'))),\n password: z.string().min(1, t('validation.password.required')),\n }),\n [t],\n );\n\n const loginMutation = useMutation({\n ...loginMutationOptions,\n onSuccess: async (data, params) => {\n const user = data.user;\n\n if (user.email_verification_required && !user.email_verified) {\n router.navigate({\n to: '/verify/email',\n search: {\n email: params.email,\n ...extractOAuthParams(search),\n },\n });\n return;\n }\n\n queryClient.setQueryData(getSessionQueryOptions.queryKey, {\n user: user,\n });\n await tick();\n\n const registered_2fa_methods: SecondFactorMethod[] = [];\n if (configData.auth.password.totp.enabled && user.totp_registered) {\n registered_2fa_methods.push('totp');\n }\n if (configData.auth.passkey.enabled && user.passkey_count > 0) {\n registered_2fa_methods.push('passkey');\n }\n\n if (user.second_factor_required && registered_2fa_methods.length === 0) {\n if (configData.available_2fa_setup_methods.length > 1) {\n return router.navigate({\n to: '/setup/2fa',\n search: extractOAuthParams(search),\n });\n } else if (configData.available_2fa_setup_methods.length === 1) {\n const method = configData.available_2fa_setup_methods[0];\n if (method === 'totp') {\n return router.navigate({\n to: '/setup/totp',\n search: extractOAuthParams(search),\n });\n } else {\n return router.navigate({\n to: '/setup/passkey',\n search: {\n ...extractOAuthParams(search),\n passkey_name: 'default',\n },\n });\n }\n }\n }\n\n if (registered_2fa_methods.length > 1) {\n return router.navigate({\n to: '/verify/2fa',\n search: extractOAuthParams(search),\n });\n } else if (registered_2fa_methods.length === 1) {\n const method = registered_2fa_methods[0];\n if (method === 'totp') {\n return router.navigate({\n to: '/verify/totp',\n search: extractOAuthParams(search),\n });\n } else {\n return router.navigate({\n to: '/verify/passkey',\n search: extractOAuthParams(search),\n });\n }\n } else {\n if (isOAuthFlow(search)) {\n window.location.href =\n buildAuthenticatedAuthorizeUrl(authorizeSearch);\n } else {\n return router.navigate({ to: '/profile' });\n }\n }\n },\n onError: (_error) => {\n setError('email', {\n type: 'manual',\n message: t('login.error.failed'),\n });\n },\n onSettled: () => {\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n });\n\n const handlePasskeySuccess = useCallback(\n async (data: PasskeyAuthenticationResponse) => {\n if (data.password_reset_required) {\n await router.navigate({ to: '/password/reset-required' });\n return;\n }\n if (data.user) {\n queryClient.setQueryData(getSessionQueryOptions.queryKey, data);\n await tick();\n\n if (isOAuthFlow(search)) {\n window.location.href =\n buildAuthenticatedAuthorizeUrl(authorizeSearch);\n } else {\n router.navigate({ to: '/profile' });\n }\n }\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n [queryClient, router, search, authorizeSearch],\n );\n\n // Conditional UI: Start passkey autofill on page load\n const abortControllerRef = useRef<AbortController | null>(null);\n\n useEffect(() => {\n if (!isPasskeyEnabled || !isPasswordAuthEnabled) {\n return;\n }\n\n abortControllerRef.current = new AbortController();\n startConditionalPasskeyAuth(\n handlePasskeySuccess,\n abortControllerRef.current.signal,\n );\n\n return () => {\n abortControllerRef.current?.abort();\n };\n }, [isPasskeyEnabled, isPasswordAuthEnabled, handlePasskeySuccess]);\n\n const {\n register,\n setError,\n handleSubmit,\n formState: { errors },\n } = useForm({\n defaultValues: {\n email: '',\n password: '',\n },\n resolver: standardSchemaResolver(loginSchema),\n });\n\n const onSubmit = async (values: z.infer<typeof loginSchema>) => {\n loginMutation.mutate(values);\n };\n\n return (\n <AuthLayout>\n {/* Branding lives in the layout's brand panel — see /login. */}\n <AuthPageHeader\n subtitle={t('login.selectMethod.subtitle') || undefined}\n title={t('login.title')}\n />\n\n <AuthorizationContextBanner search={search} />\n\n {isPasswordAuthEnabled && (\n <form\n className=\"flex flex-col gap-tinyrack-lg\"\n onSubmit={handleSubmit(onSubmit)}\n >\n <AuthField\n autoComplete=\"username webauthn\"\n error={errors.email}\n icon={MailIcon}\n label={t('login.email.label')}\n placeholder={t('login.email.placeholder')}\n {...register('email')}\n type=\"email\"\n />\n\n <AuthField\n autoComplete=\"current-password\"\n error={errors.password}\n icon={LockIcon}\n label={t('login.password.label')}\n /*\n * On the label row rather than under the field: it belongs to the\n * password, and putting it between the field and the submit button\n * separated the two things the user is actually trying to do.\n */\n labelAction={\n configData.email.enabled ? (\n <TRLink\n className=\"text-tinyrack-xs\"\n render={<Link to=\"/password/forgot\" />}\n >\n {t('login.link.forgotPassword')}\n </TRLink>\n ) : undefined\n }\n placeholder={t('login.password.placeholder')}\n {...register('password')}\n type=\"password\"\n />\n\n <TRButton\n className=\"w-full\"\n intent=\"primary\"\n loading={loginMutation.isPending}\n loadingLabel={t('login.submitting')}\n type=\"submit\"\n uiSize=\"lg\"\n >\n {t('login.submit')}\n </TRButton>\n </form>\n )}\n\n {implicitNotice && (\n <div\n className=\"prose prose-sm text-center text-tinyrack-text-muted text-tinyrack-xs! **:text-tinyrack-xs!\"\n dangerouslySetInnerHTML={{ __html: implicitNotice }}\n />\n )}\n\n {(configData.registration.public_registration ||\n hasMultipleLoginMethods) && (\n <AuthFooter>\n {configData.registration.public_registration && (\n <AuthFooterLink\n link={\n <Link search={extractOAuthParams(search)} to=\"/register\">\n {t('login.link.register')}\n </Link>\n }\n text={t('login.footer.noAccount')}\n />\n )}\n {hasMultipleLoginMethods && (\n <AuthFooterLink\n link={\n <Link search={extractOAuthParams(search)} to=\"/login\">\n {t('login.password.backToMethods')}\n </Link>\n }\n />\n )}\n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1CJ,EAAE,qBAAqB,CACpB,CAAA,EAER,KAAMA,EAAE,wBAAwB,CAAE,CAAA,EAGrC2B,IACC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,MACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAM,OAAQpC,EAAmBa,CAAM,EAAG,GAAG,kBAC1CJ,EAAE,8BAA8B,CAC7B,CAAA,CACP,CAAA,CAGK,CAAA,CAAA,CAEJ,CAAA,CAAA,CAEhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"password-UL_cNRnQ.js","names":["RouteErrorFallback","SplitErrorComponent","errorComponent"],"sources":["../../../frontend/src/routes/login/password/index.tsx?tsr-split=errorComponent"],"sourcesContent":["import { standardSchemaResolver } from '@hookform/resolvers/standard-schema';\nimport {\n useMutation,\n useQueryClient,\n useSuspenseQuery,\n} from '@tanstack/react-query';\nimport { createFileRoute, Link, useRouter } from '@tanstack/react-router';\nimport { TRButton } from '@tinyrack/ui/components/button';\nimport { TRLink } from '@tinyrack/ui/components/link';\nimport { LockIcon, MailIcon } from 'lucide-react';\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { z } from 'zod';\nimport { AuthField } from '#frontend/components/auth/auth-field.tsx';\nimport {\n AuthFooter,\n AuthFooterLink,\n} from '#frontend/components/auth/auth-footer.tsx';\nimport { AuthPageHeader } from '#frontend/components/auth/auth-page-header.tsx';\nimport { AuthorizationContextBanner } from '#frontend/components/auth/authorization-context-banner.tsx';\nimport { RouteErrorFallback } from '#frontend/components/ui/route-error-fallback.tsx';\nimport { AuthLayout } from '#frontend/features/layout/auth-layout.tsx';\nimport {\n buildAuthenticatedAuthorizeUrl,\n extractOAuthParams,\n hasAuthorizationContext,\n isOAuthFlow,\n type OAuthSearch,\n OAuthSearchSchema,\n type SecondFactorMethod,\n} from '#frontend/libs/oauth-search.ts';\nimport { tick } from '#frontend/libs/promise.ts';\nimport { getAuthorizationContextQueryOptions } from '#frontend/queries/authorization-context.ts';\nimport { appConfigQueryOptions } from '#frontend/queries/config.ts';\nimport { loginMutationOptions } from '#frontend/queries/login.ts';\nimport {\n type PasskeyAuthenticationResponse,\n startConditionalPasskeyAuth,\n} from '#frontend/queries/passkey.ts';\nimport { getSessionQueryOptions } from '#frontend/queries/session.ts';\n\nconst SearchSchema = OAuthSearchSchema;\n\nexport const Route = createFileRoute('/login/password/')({\n component: LoginPassword,\n errorComponent: RouteErrorFallback,\n validateSearch: SearchSchema,\n loaderDeps: ({ search }) => ({\n search,\n }),\n loader: async ({ context, deps }) => {\n await context.queryClient.ensureQueryData(appConfigQueryOptions);\n if (hasAuthorizationContext(deps.search)) {\n await context.queryClient.ensureQueryData(\n getAuthorizationContextQueryOptions(deps.search),\n );\n }\n },\n});\n\nfunction LoginPassword() {\n const { t, i18n } = useTranslation();\n const router = useRouter();\n const queryClient = useQueryClient();\n const search = Route.useSearch();\n const authorizeSearch: OAuthSearch =\n search.account_selection_state &&\n search.prompt?.split(' ').includes('login')\n ? { ...search, account_selected: 1 }\n : search;\n const lang = search.lang ?? i18n.language;\n\n const { data: configData } = useSuspenseQuery(appConfigQueryOptions);\n\n const implicitNotice =\n configData.registration.signup_notice?.[lang] ??\n configData.registration.signup_notice?.[configData.i18n.fallback_language];\n const isPasswordAuthEnabled = configData.auth.password.enabled;\n const isPasskeyEnabled = configData.auth.passkey.enabled;\n const hasMultipleLoginMethods =\n configData.identity_providers.length +\n (isPasswordAuthEnabled ? 1 : 0) +\n (isPasskeyEnabled ? 1 : 0) >\n 1;\n\n const loginSchema = useMemo(\n () =>\n z.object({\n email: z\n .string()\n .min(1, t('validation.email.required'))\n .pipe(z.email(t('validation.email.invalid'))),\n password: z.string().min(1, t('validation.password.required')),\n }),\n [t],\n );\n\n const loginMutation = useMutation({\n ...loginMutationOptions,\n onSuccess: async (data, params) => {\n const user = data.user;\n\n if (user.email_verification_required && !user.email_verified) {\n router.navigate({\n to: '/verify/email',\n search: {\n email: params.email,\n ...extractOAuthParams(search),\n },\n });\n return;\n }\n\n queryClient.setQueryData(getSessionQueryOptions.queryKey, {\n user: user,\n });\n await tick();\n\n const registered_2fa_methods: SecondFactorMethod[] = [];\n if (configData.auth.password.totp.enabled && user.totp_registered) {\n registered_2fa_methods.push('totp');\n }\n if (configData.auth.passkey.enabled && user.passkey_count > 0) {\n registered_2fa_methods.push('passkey');\n }\n\n if (user.second_factor_required && registered_2fa_methods.length === 0) {\n if (configData.available_2fa_setup_methods.length > 1) {\n return router.navigate({\n to: '/setup/2fa',\n search: extractOAuthParams(search),\n });\n } else if (configData.available_2fa_setup_methods.length === 1) {\n const method = configData.available_2fa_setup_methods[0];\n if (method === 'totp') {\n return router.navigate({\n to: '/setup/totp',\n search: extractOAuthParams(search),\n });\n } else {\n return router.navigate({\n to: '/setup/passkey',\n search: {\n ...extractOAuthParams(search),\n passkey_name: 'default',\n },\n });\n }\n }\n }\n\n if (registered_2fa_methods.length > 1) {\n return router.navigate({\n to: '/verify/2fa',\n search: extractOAuthParams(search),\n });\n } else if (registered_2fa_methods.length === 1) {\n const method = registered_2fa_methods[0];\n if (method === 'totp') {\n return router.navigate({\n to: '/verify/totp',\n search: extractOAuthParams(search),\n });\n } else {\n return router.navigate({\n to: '/verify/passkey',\n search: extractOAuthParams(search),\n });\n }\n } else {\n if (isOAuthFlow(search)) {\n window.location.href =\n buildAuthenticatedAuthorizeUrl(authorizeSearch);\n } else {\n return router.navigate({ to: '/profile' });\n }\n }\n },\n onError: (_error) => {\n setError('email', {\n type: 'manual',\n message: t('login.error.failed'),\n });\n },\n onSettled: () => {\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n });\n\n const handlePasskeySuccess = useCallback(\n async (data: PasskeyAuthenticationResponse) => {\n if (data.password_reset_required) {\n await router.navigate({ to: '/password/reset-required' });\n return;\n }\n if (data.user) {\n queryClient.setQueryData(getSessionQueryOptions.queryKey, data);\n await tick();\n\n if (isOAuthFlow(search)) {\n window.location.href =\n buildAuthenticatedAuthorizeUrl(authorizeSearch);\n } else {\n router.navigate({ to: '/profile' });\n }\n }\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n [queryClient, router, search, authorizeSearch],\n );\n\n // Conditional UI: Start passkey autofill on page load\n const abortControllerRef = useRef<AbortController | null>(null);\n\n useEffect(() => {\n if (!isPasskeyEnabled || !isPasswordAuthEnabled) {\n return;\n }\n\n abortControllerRef.current = new AbortController();\n startConditionalPasskeyAuth(\n handlePasskeySuccess,\n abortControllerRef.current.signal,\n );\n\n return () => {\n abortControllerRef.current?.abort();\n };\n }, [isPasskeyEnabled, isPasswordAuthEnabled, handlePasskeySuccess]);\n\n const {\n register,\n setError,\n handleSubmit,\n formState: { errors },\n } = useForm({\n defaultValues: {\n email: '',\n password: '',\n },\n resolver: standardSchemaResolver(loginSchema),\n });\n\n const onSubmit = async (values: z.infer<typeof loginSchema>) => {\n loginMutation.mutate(values);\n };\n\n return (\n <AuthLayout>\n {/* Branding lives in the layout's brand panel — see /login. */}\n <AuthPageHeader\n subtitle={t('login.selectMethod.subtitle') || undefined}\n title={t('login.title')}\n />\n\n <AuthorizationContextBanner search={search} />\n\n {isPasswordAuthEnabled && (\n <form\n className=\"flex flex-col gap-tinyrack-lg\"\n onSubmit={handleSubmit(onSubmit)}\n >\n <AuthField\n autoComplete=\"username webauthn\"\n error={errors.email}\n icon={MailIcon}\n label={t('login.email.label')}\n placeholder={t('login.email.placeholder')}\n {...register('email')}\n type=\"email\"\n />\n\n <AuthField\n autoComplete=\"current-password\"\n error={errors.password}\n icon={LockIcon}\n label={t('login.password.label')}\n /*\n * On the label row rather than under the field: it belongs to the\n * password, and putting it between the field and the submit button\n * separated the two things the user is actually trying to do.\n */\n labelAction={\n configData.email.enabled ? (\n <TRLink\n className=\"text-tinyrack-xs\"\n render={<Link to=\"/password/forgot\" />}\n >\n {t('login.link.forgotPassword')}\n </TRLink>\n ) : undefined\n }\n placeholder={t('login.password.placeholder')}\n {...register('password')}\n type=\"password\"\n />\n\n <TRButton\n className=\"w-full\"\n intent=\"primary\"\n loading={loginMutation.isPending}\n loadingLabel={t('login.submitting')}\n type=\"submit\"\n uiSize=\"lg\"\n >\n {t('login.submit')}\n </TRButton>\n </form>\n )}\n\n {implicitNotice && (\n <div\n className=\"prose prose-sm text-center text-tinyrack-text-muted text-tinyrack-xs! **:text-tinyrack-xs!\"\n dangerouslySetInnerHTML={{ __html: implicitNotice }}\n />\n )}\n\n {(configData.registration.public_registration ||\n hasMultipleLoginMethods) && (\n <AuthFooter>\n {configData.registration.public_registration && (\n <AuthFooterLink\n link={\n <Link search={extractOAuthParams(search)} to=\"/register\">\n {t('login.link.register')}\n </Link>\n }\n text={t('login.footer.noAccount')}\n />\n )}\n {hasMultipleLoginMethods && (\n <AuthFooterLink\n link={\n <Link search={extractOAuthParams(search)} to=\"/login\">\n {t('login.password.backToMethods')}\n </Link>\n }\n />\n )}\n </AuthFooter>\n )}\n </AuthLayout>\n );\n}\n"],"mappings":"wCAqBsF,IAAAC,EAA7ED"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./config-v3-oy_ef.js";import{t as n}from"./mutationOptions-CrswitPs.js";var r=n({mutationFn:async n=>e(await t.api.auth.password.forgot.$post({json:n,header:{}}))}),i=n({mutationFn:async n=>e(await t.api.auth.password.reset.$post({json:n}))}),a=n({mutationFn:async n=>e(await t.api.auth.password[`reset-required`].$post({json:n}))});export{i as n,a as r,r as t};
|
|
2
|
-
//# sourceMappingURL=password-reset-CIacHnvA.js.map
|