@tatchi-xyz/sdk 0.19.0 → 0.21.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/cjs/core/EmailRecovery/index.js +25 -0
- package/dist/cjs/core/EmailRecovery/index.js.map +1 -1
- package/dist/cjs/core/TatchiPasskey/emailRecovery.js +135 -77
- package/dist/cjs/core/TatchiPasskey/emailRecovery.js.map +1 -1
- package/dist/cjs/core/TatchiPasskey/index.js +2 -1
- package/dist/cjs/core/TatchiPasskey/index.js.map +1 -1
- package/dist/cjs/core/TatchiPasskey/linkDevice.js +2 -1
- package/dist/cjs/core/TatchiPasskey/linkDevice.js.map +1 -1
- package/dist/cjs/core/TatchiPasskey/scanDevice.js +5 -3
- package/dist/cjs/core/TatchiPasskey/scanDevice.js.map +1 -1
- package/dist/cjs/core/WalletIframe/client/router.js +1 -1
- package/dist/cjs/core/WalletIframe/client/router.js.map +1 -1
- package/dist/cjs/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js +3 -4
- package/dist/cjs/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js.map +1 -1
- package/dist/cjs/core/defaultConfigs.js +3 -7
- package/dist/cjs/core/defaultConfigs.js.map +1 -1
- package/dist/cjs/core/nearCrypto.js +29 -5
- package/dist/cjs/core/nearCrypto.js.map +1 -1
- package/dist/cjs/core/rpcCalls.js +56 -26
- package/dist/cjs/core/rpcCalls.js.map +1 -1
- package/dist/cjs/core/types/emailRecovery.js +33 -0
- package/dist/cjs/core/types/emailRecovery.js.map +1 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/components/AccountMenuButton/{LinkedDevicesModal-CSSowiHP.css → LinkedDevicesModal-BRtht0XI.css} +1 -1
- package/dist/{esm/react/components/AccountMenuButton/LinkedDevicesModal-CSSowiHP.css.map → cjs/react/components/AccountMenuButton/LinkedDevicesModal-BRtht0XI.css.map} +1 -1
- package/dist/cjs/react/components/AccountMenuButton/{ProfileDropdown-CEPMZ1gY.css → ProfileDropdown-BG_6hcim.css} +1 -1
- package/dist/{esm/react/components/AccountMenuButton/ProfileDropdown-CEPMZ1gY.css.map → cjs/react/components/AccountMenuButton/ProfileDropdown-BG_6hcim.css.map} +1 -1
- package/dist/cjs/react/components/AccountMenuButton/{Web3AuthProfileButton-DopOg7Xc.css → Web3AuthProfileButton-k8_FAYFq.css} +1 -1
- package/dist/cjs/react/components/AccountMenuButton/{Web3AuthProfileButton-DopOg7Xc.css.map → Web3AuthProfileButton-k8_FAYFq.css.map} +1 -1
- package/dist/cjs/react/components/AccountMenuButton/icons/{TouchIcon-BQWentvJ.css → TouchIcon-C-RcGfr5.css} +1 -1
- package/dist/cjs/react/components/AccountMenuButton/icons/{TouchIcon-BQWentvJ.css.map → TouchIcon-C-RcGfr5.css.map} +1 -1
- package/dist/cjs/react/components/PasskeyAuthMenu/{PasskeyAuthMenu-DwrzWMYx.css → PasskeyAuthMenu-DKMiLeT9.css} +59 -4
- package/dist/cjs/react/components/PasskeyAuthMenu/{PasskeyAuthMenu-DwrzWMYx.css.map → PasskeyAuthMenu-DKMiLeT9.css.map} +1 -1
- package/dist/cjs/react/components/PasskeyAuthMenu/adapters/tatchi.js +1 -0
- package/dist/cjs/react/components/PasskeyAuthMenu/adapters/tatchi.js.map +1 -1
- package/dist/cjs/react/components/PasskeyAuthMenu/client.js +30 -8
- package/dist/cjs/react/components/PasskeyAuthMenu/client.js.map +1 -1
- package/dist/cjs/react/components/PasskeyAuthMenu/controller/useSDKEvents.js +22 -0
- package/dist/cjs/react/components/PasskeyAuthMenu/controller/useSDKEvents.js.map +1 -0
- package/dist/cjs/react/components/PasskeyAuthMenu/ui/ContentSwitcher.js +17 -4
- package/dist/cjs/react/components/PasskeyAuthMenu/ui/ContentSwitcher.js.map +1 -1
- package/dist/cjs/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.js +354 -154
- package/dist/cjs/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.js.map +1 -1
- package/dist/cjs/react/components/{ShowQRCode-CCN4h6Uv.css → ShowQRCode-CB0UCQ_h.css} +1 -1
- package/dist/cjs/react/components/{ShowQRCode-CCN4h6Uv.css.map → ShowQRCode-CB0UCQ_h.css.map} +1 -1
- package/dist/cjs/react/context/useSDKFlowRuntime.js +183 -0
- package/dist/cjs/react/context/useSDKFlowRuntime.js.map +1 -0
- package/dist/cjs/react/context/useTatchiContextValue.js +24 -15
- package/dist/cjs/react/context/useTatchiContextValue.js.map +1 -1
- package/dist/cjs/react/context/useTatchiWithSdkFlow.js +96 -0
- package/dist/cjs/react/context/useTatchiWithSdkFlow.js.map +1 -0
- package/dist/cjs/react/sdk/src/core/EmailRecovery/index.js +26 -0
- package/dist/cjs/react/sdk/src/core/EmailRecovery/index.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/emailRecovery.js +135 -77
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/emailRecovery.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/index.js +2 -1
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/index.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/linkDevice.js +2 -1
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/linkDevice.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/scanDevice.js +5 -3
- package/dist/cjs/react/sdk/src/core/TatchiPasskey/scanDevice.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/WalletIframe/client/router.js +1 -1
- package/dist/cjs/react/sdk/src/core/WalletIframe/client/router.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js +3 -4
- package/dist/cjs/react/sdk/src/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/defaultConfigs.js +3 -7
- package/dist/cjs/react/sdk/src/core/defaultConfigs.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/nearCrypto.js +29 -5
- package/dist/cjs/react/sdk/src/core/nearCrypto.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/rpcCalls.js +56 -26
- package/dist/cjs/react/sdk/src/core/rpcCalls.js.map +1 -1
- package/dist/cjs/react/sdk/src/core/types/emailRecovery.js +33 -0
- package/dist/cjs/react/sdk/src/core/types/emailRecovery.js.map +1 -0
- package/dist/cjs/server/email-recovery/emailParsers.js +2 -1
- package/dist/cjs/server/email-recovery/emailParsers.js.map +1 -1
- package/dist/cjs/server/email-recovery/index.js +6 -6
- package/dist/cjs/server/email-recovery/index.js.map +1 -1
- package/dist/cjs/server/email-recovery/rpcCalls.js +22 -3
- package/dist/cjs/server/email-recovery/rpcCalls.js.map +1 -1
- package/dist/cjs/server/router/cloudflare.js +8 -3
- package/dist/cjs/server/router/cloudflare.js.map +1 -1
- package/dist/cjs/server/router/express.js.map +1 -1
- package/dist/cjs/server/sdk/src/core/defaultConfigs.js +2 -4
- package/dist/cjs/server/sdk/src/core/defaultConfigs.js.map +1 -1
- package/dist/cjs/server/sdk/src/core/nearCrypto.js +26 -7
- package/dist/cjs/server/sdk/src/core/nearCrypto.js.map +1 -1
- package/dist/esm/core/EmailRecovery/index.js +25 -1
- package/dist/esm/core/EmailRecovery/index.js.map +1 -1
- package/dist/esm/core/TatchiPasskey/emailRecovery.js +136 -78
- package/dist/esm/core/TatchiPasskey/emailRecovery.js.map +1 -1
- package/dist/esm/core/TatchiPasskey/index.js +2 -1
- package/dist/esm/core/TatchiPasskey/index.js.map +1 -1
- package/dist/esm/core/TatchiPasskey/linkDevice.js +2 -1
- package/dist/esm/core/TatchiPasskey/linkDevice.js.map +1 -1
- package/dist/esm/core/TatchiPasskey/scanDevice.js +5 -3
- package/dist/esm/core/TatchiPasskey/scanDevice.js.map +1 -1
- package/dist/esm/core/WalletIframe/client/router.js +1 -1
- package/dist/esm/core/WalletIframe/client/router.js.map +1 -1
- package/dist/esm/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js +2 -3
- package/dist/esm/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js.map +1 -1
- package/dist/esm/core/defaultConfigs.js +3 -7
- package/dist/esm/core/defaultConfigs.js.map +1 -1
- package/dist/esm/core/nearCrypto.js +24 -6
- package/dist/esm/core/nearCrypto.js.map +1 -1
- package/dist/esm/core/rpcCalls.js +56 -26
- package/dist/esm/core/rpcCalls.js.map +1 -1
- package/dist/esm/core/types/emailRecovery.js +26 -0
- package/dist/esm/core/types/emailRecovery.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react/components/AccountMenuButton/{LinkedDevicesModal-CSSowiHP.css → LinkedDevicesModal-BRtht0XI.css} +1 -1
- package/dist/{cjs/react/components/AccountMenuButton/LinkedDevicesModal-CSSowiHP.css.map → esm/react/components/AccountMenuButton/LinkedDevicesModal-BRtht0XI.css.map} +1 -1
- package/dist/esm/react/components/AccountMenuButton/{ProfileDropdown-CEPMZ1gY.css → ProfileDropdown-BG_6hcim.css} +1 -1
- package/dist/{cjs/react/components/AccountMenuButton/ProfileDropdown-CEPMZ1gY.css.map → esm/react/components/AccountMenuButton/ProfileDropdown-BG_6hcim.css.map} +1 -1
- package/dist/esm/react/components/AccountMenuButton/{Web3AuthProfileButton-DopOg7Xc.css → Web3AuthProfileButton-k8_FAYFq.css} +1 -1
- package/dist/esm/react/components/AccountMenuButton/{Web3AuthProfileButton-DopOg7Xc.css.map → Web3AuthProfileButton-k8_FAYFq.css.map} +1 -1
- package/dist/esm/react/components/AccountMenuButton/icons/{TouchIcon-BQWentvJ.css → TouchIcon-C-RcGfr5.css} +1 -1
- package/dist/esm/react/components/AccountMenuButton/icons/{TouchIcon-BQWentvJ.css.map → TouchIcon-C-RcGfr5.css.map} +1 -1
- package/dist/esm/react/components/PasskeyAuthMenu/{PasskeyAuthMenu-DwrzWMYx.css → PasskeyAuthMenu-DKMiLeT9.css} +59 -4
- package/dist/esm/react/components/PasskeyAuthMenu/{PasskeyAuthMenu-DwrzWMYx.css.map → PasskeyAuthMenu-DKMiLeT9.css.map} +1 -1
- package/dist/esm/react/components/PasskeyAuthMenu/adapters/tatchi.js +1 -0
- package/dist/esm/react/components/PasskeyAuthMenu/adapters/tatchi.js.map +1 -1
- package/dist/esm/react/components/PasskeyAuthMenu/client.js +30 -8
- package/dist/esm/react/components/PasskeyAuthMenu/client.js.map +1 -1
- package/dist/esm/react/components/PasskeyAuthMenu/controller/useSDKEvents.js +20 -0
- package/dist/esm/react/components/PasskeyAuthMenu/controller/useSDKEvents.js.map +1 -0
- package/dist/esm/react/components/PasskeyAuthMenu/ui/ContentSwitcher.js +17 -4
- package/dist/esm/react/components/PasskeyAuthMenu/ui/ContentSwitcher.js.map +1 -1
- package/dist/esm/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.js +354 -154
- package/dist/esm/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.js.map +1 -1
- package/dist/esm/react/components/{ShowQRCode-CCN4h6Uv.css → ShowQRCode-CB0UCQ_h.css} +1 -1
- package/dist/esm/react/components/{ShowQRCode-CCN4h6Uv.css.map → ShowQRCode-CB0UCQ_h.css.map} +1 -1
- package/dist/esm/react/context/useSDKFlowRuntime.js +181 -0
- package/dist/esm/react/context/useSDKFlowRuntime.js.map +1 -0
- package/dist/esm/react/context/useTatchiContextValue.js +25 -16
- package/dist/esm/react/context/useTatchiContextValue.js.map +1 -1
- package/dist/esm/react/context/useTatchiWithSdkFlow.js +94 -0
- package/dist/esm/react/context/useTatchiWithSdkFlow.js.map +1 -0
- package/dist/esm/react/sdk/src/core/EmailRecovery/index.js +25 -1
- package/dist/esm/react/sdk/src/core/EmailRecovery/index.js.map +1 -1
- package/dist/esm/react/sdk/src/core/TatchiPasskey/emailRecovery.js +136 -78
- package/dist/esm/react/sdk/src/core/TatchiPasskey/emailRecovery.js.map +1 -1
- package/dist/esm/react/sdk/src/core/TatchiPasskey/index.js +2 -1
- package/dist/esm/react/sdk/src/core/TatchiPasskey/index.js.map +1 -1
- package/dist/esm/react/sdk/src/core/TatchiPasskey/linkDevice.js +2 -1
- package/dist/esm/react/sdk/src/core/TatchiPasskey/linkDevice.js.map +1 -1
- package/dist/esm/react/sdk/src/core/TatchiPasskey/scanDevice.js +5 -3
- package/dist/esm/react/sdk/src/core/TatchiPasskey/scanDevice.js.map +1 -1
- package/dist/esm/react/sdk/src/core/WalletIframe/client/router.js +1 -1
- package/dist/esm/react/sdk/src/core/WalletIframe/client/router.js.map +1 -1
- package/dist/esm/react/sdk/src/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js +2 -3
- package/dist/esm/react/sdk/src/core/WebAuthnManager/SignerWorkerManager/handlers/validation.js.map +1 -1
- package/dist/esm/react/sdk/src/core/defaultConfigs.js +3 -7
- package/dist/esm/react/sdk/src/core/defaultConfigs.js.map +1 -1
- package/dist/esm/react/sdk/src/core/nearCrypto.js +24 -6
- package/dist/esm/react/sdk/src/core/nearCrypto.js.map +1 -1
- package/dist/esm/react/sdk/src/core/rpcCalls.js +56 -26
- package/dist/esm/react/sdk/src/core/rpcCalls.js.map +1 -1
- package/dist/esm/react/sdk/src/core/types/emailRecovery.js +26 -0
- package/dist/esm/react/sdk/src/core/types/emailRecovery.js.map +1 -0
- package/dist/esm/react/styles/styles.css +58 -3
- package/dist/esm/sdk/{defaultConfigs-DpslkAQd.js → defaultConfigs-CfQDV-ya.js} +3 -7
- package/dist/esm/sdk/{getDeviceNumber-fXizNGQl.js → getDeviceNumber-BpernPnM.js} +4 -8
- package/dist/esm/sdk/getDeviceNumber-BpernPnM.js.map +1 -0
- package/dist/esm/sdk/offline-export-app.js +23 -6
- package/dist/esm/sdk/offline-export-app.js.map +1 -1
- package/dist/esm/sdk/{router-DuGYOd3G.js → router-BWtacLJg.js} +1 -1
- package/dist/esm/sdk/{rpcCalls-BQrJMTdg.js → rpcCalls-CYGJSCgm.js} +3 -3
- package/dist/esm/sdk/{rpcCalls-YVeUVMk2.js → rpcCalls-DZZSa-sk.js} +57 -27
- package/dist/esm/sdk/{transactions-bqaAwL4k.js → transactions-Cn9xTWlK.js} +2 -2
- package/dist/esm/sdk/{transactions-bqaAwL4k.js.map → transactions-Cn9xTWlK.js.map} +1 -1
- package/dist/esm/sdk/{transactions-BalIhtJ9.js → transactions-DfdwDQCn.js} +1 -1
- package/dist/esm/sdk/wallet-iframe-host.js +660 -590
- package/dist/esm/server/email-recovery/emailParsers.js +3 -1
- package/dist/esm/server/email-recovery/emailParsers.js.map +1 -1
- package/dist/esm/server/email-recovery/index.js +6 -6
- package/dist/esm/server/email-recovery/index.js.map +1 -1
- package/dist/esm/server/email-recovery/rpcCalls.js +22 -3
- package/dist/esm/server/email-recovery/rpcCalls.js.map +1 -1
- package/dist/esm/server/router/cloudflare.js +8 -3
- package/dist/esm/server/router/cloudflare.js.map +1 -1
- package/dist/esm/server/router/express.js.map +1 -1
- package/dist/esm/server/sdk/src/core/defaultConfigs.js +2 -4
- package/dist/esm/server/sdk/src/core/defaultConfigs.js.map +1 -1
- package/dist/esm/server/sdk/src/core/nearCrypto.js +26 -8
- package/dist/esm/server/sdk/src/core/nearCrypto.js.map +1 -1
- package/dist/esm/wasm_vrf_worker/pkg/wasm_vrf_worker_bg.wasm +0 -0
- package/dist/types/src/core/EmailRecovery/index.d.ts +8 -0
- package/dist/types/src/core/EmailRecovery/index.d.ts.map +1 -1
- package/dist/types/src/core/TatchiPasskey/emailRecovery.d.ts +8 -5
- package/dist/types/src/core/TatchiPasskey/emailRecovery.d.ts.map +1 -1
- package/dist/types/src/core/TatchiPasskey/index.d.ts +1 -1
- package/dist/types/src/core/TatchiPasskey/index.d.ts.map +1 -1
- package/dist/types/src/core/TatchiPasskey/scanDevice.d.ts.map +1 -1
- package/dist/types/src/core/WalletIframe/TatchiPasskeyIframe.d.ts +1 -1
- package/dist/types/src/core/WalletIframe/TatchiPasskeyIframe.d.ts.map +1 -1
- package/dist/types/src/core/WalletIframe/client/router.d.ts +1 -1
- package/dist/types/src/core/WalletIframe/client/router.d.ts.map +1 -1
- package/dist/types/src/core/WalletIframe/shared/messages.d.ts +1 -1
- package/dist/types/src/core/WalletIframe/shared/messages.d.ts.map +1 -1
- package/dist/types/src/core/WebAuthnManager/SignerWorkerManager/handlers/validation.d.ts +2 -1
- package/dist/types/src/core/WebAuthnManager/SignerWorkerManager/handlers/validation.d.ts.map +1 -1
- package/dist/types/src/core/defaultConfigs.d.ts.map +1 -1
- package/dist/types/src/core/nearCrypto.d.ts +14 -0
- package/dist/types/src/core/nearCrypto.d.ts.map +1 -1
- package/dist/types/src/core/rpcCalls.d.ts +11 -8
- package/dist/types/src/core/rpcCalls.d.ts.map +1 -1
- package/dist/types/src/core/types/emailRecovery.d.ts +10 -0
- package/dist/types/src/core/types/emailRecovery.d.ts.map +1 -0
- package/dist/types/src/core/types/index.d.ts +1 -0
- package/dist/types/src/core/types/index.d.ts.map +1 -1
- package/dist/types/src/core/types/tatchi.d.ts +0 -4
- package/dist/types/src/core/types/tatchi.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/react/components/PasskeyAuthMenu/adapters/tatchi.d.ts +2 -0
- package/dist/types/src/react/components/PasskeyAuthMenu/adapters/tatchi.d.ts.map +1 -1
- package/dist/types/src/react/components/PasskeyAuthMenu/client.d.ts.map +1 -1
- package/dist/types/src/react/components/PasskeyAuthMenu/controller/useSDKEvents.d.ts +10 -0
- package/dist/types/src/react/components/PasskeyAuthMenu/controller/useSDKEvents.d.ts.map +1 -0
- package/dist/types/src/react/components/PasskeyAuthMenu/types.d.ts +8 -3
- package/dist/types/src/react/components/PasskeyAuthMenu/types.d.ts.map +1 -1
- package/dist/types/src/react/components/PasskeyAuthMenu/ui/ContentSwitcher.d.ts +2 -0
- package/dist/types/src/react/components/PasskeyAuthMenu/ui/ContentSwitcher.d.ts.map +1 -1
- package/dist/types/src/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.d.ts +1 -1
- package/dist/types/src/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.d.ts.map +1 -1
- package/dist/types/src/react/context/useSDKFlowRuntime.d.ts +10 -0
- package/dist/types/src/react/context/useSDKFlowRuntime.d.ts.map +1 -0
- package/dist/types/src/react/context/useTatchiContextValue.d.ts.map +1 -1
- package/dist/types/src/react/context/useTatchiWithSdkFlow.d.ts +9 -0
- package/dist/types/src/react/context/useTatchiWithSdkFlow.d.ts.map +1 -0
- package/dist/types/src/react/types.d.ts +31 -0
- package/dist/types/src/react/types.d.ts.map +1 -1
- package/dist/types/src/server/email-recovery/emailParsers.d.ts.map +1 -1
- package/dist/types/src/server/email-recovery/index.d.ts +5 -6
- package/dist/types/src/server/email-recovery/index.d.ts.map +1 -1
- package/dist/types/src/server/email-recovery/rpcCalls.d.ts +1 -0
- package/dist/types/src/server/email-recovery/rpcCalls.d.ts.map +1 -1
- package/dist/types/src/server/router/cloudflare-adaptor.d.ts.map +1 -1
- package/dist/workers/wasm_vrf_worker_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/esm/sdk/getDeviceNumber-fXizNGQl.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailRecoverySlide.js","names":["EmailRecoverySlide: React.FC<EmailRecoverySlideProps>","React","IndexedDBManager","toAccountId","localEmails: string[]","info: EmailRecoveryAccountInfo | null","err: any"],"sources":["../../../../../../src/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { EmailRecoverySSEEvent } from '@/core/types/sdkSentEvents';\nimport type { TatchiPasskey } from '@/core/TatchiPasskey';\nimport { IndexedDBManager } from '@/core/IndexedDBManager';\nimport { toAccountId } from '@/core/types/accountIds';\n\nexport interface EmailRecoverySlideProps {\n tatchiPasskey: TatchiPasskey;\n accountId: string;\n refreshLoginState?: (nearAccountId?: string) => Promise<void>;\n emailRecoveryOptions?: {\n onEvent?: (event: EmailRecoverySSEEvent) => void;\n onError?: (error: Error) => void;\n };\n}\n\ntype EmailRecoveryPolicy = {\n minRequiredEmails?: number;\n maxAgeMs?: number;\n};\n\ntype EmailRecoveryAccountInfo = {\n emailsCount: number;\n};\n\ntype MailtoUiState = 'ready' | 'opening';\n\nexport const EmailRecoverySlide: React.FC<EmailRecoverySlideProps> = ({ tatchiPasskey, accountId, refreshLoginState, emailRecoveryOptions }) => {\n const mountedRef = React.useRef(true);\n const mailtoAttemptTimerRef = React.useRef<number | null>(null);\n const cancelRequestedRef = React.useRef(false);\n React.useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n mailtoAttemptTimerRef.current = null;\n }\n };\n }, []);\n\n const [isBusy, setIsBusy] = React.useState(false);\n const [accountIdInput, setAccountIdInput] = React.useState('');\n const [recoveryEmailInput, setRecoveryEmailInput] = React.useState('');\n const [pendingMailtoUrl, setPendingMailtoUrl] = React.useState<string | null>(null);\n const [mailtoUiState, setMailtoUiState] = React.useState<MailtoUiState>('ready');\n const [statusText, setStatusText] = React.useState<string | null>(null);\n const [pollingElapsedMs, setPollingElapsedMs] = React.useState<number | null>(null);\n const [errorText, setErrorText] = React.useState<string | null>(null);\n const [accountInfo, setAccountInfo] = React.useState<EmailRecoveryAccountInfo | null>(null);\n const [accountInfoLoading, setAccountInfoLoading] = React.useState(false);\n const [accountInfoError, setAccountInfoError] = React.useState<string | null>(null);\n const [localRecoveryEmails, setLocalRecoveryEmails] = React.useState<string[]>([]);\n const [explorerToast, setExplorerToast] = React.useState<{ url: string; accountId?: string; transactionHash?: string } | null>(null);\n\n const lastPrefilledAccountIdRef = React.useRef<string>('');\n const lastPrefilledRecoveryEmailRef = React.useRef<string>('');\n\n React.useEffect(() => {\n const next = (accountId || '').trim();\n if (!next) return;\n if (accountIdInput.trim() === '' || accountIdInput === lastPrefilledAccountIdRef.current) {\n lastPrefilledAccountIdRef.current = next;\n setAccountIdInput(next);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [accountId]);\n\n React.useEffect(() => {\n setPendingMailtoUrl(null);\n setMailtoUiState('ready');\n cancelRequestedRef.current = false;\n setStatusText(null);\n setPollingElapsedMs(null);\n setErrorText(null);\n setAccountInfo(null);\n setAccountInfoError(null);\n setLocalRecoveryEmails([]);\n setExplorerToast(null);\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n mailtoAttemptTimerRef.current = null;\n }\n }, [accountId]);\n\n const safeSet = <T,>(setter: React.Dispatch<React.SetStateAction<T>>) => {\n return (value: React.SetStateAction<T>) => {\n if (!mountedRef.current) return;\n setter(value);\n };\n };\n\n const safeSetPendingMailtoUrl = React.useMemo(() => safeSet(setPendingMailtoUrl), []);\n const safeSetStatusText = React.useMemo(() => safeSet(setStatusText), []);\n const safeSetPollingElapsedMs = React.useMemo(() => safeSet(setPollingElapsedMs), []);\n const safeSetErrorText = React.useMemo(() => safeSet(setErrorText), []);\n const safeSetIsBusy = React.useMemo(() => safeSet(setIsBusy), []);\n const safeSetAccountInfo = React.useMemo(() => safeSet(setAccountInfo), []);\n const safeSetAccountInfoLoading = React.useMemo(() => safeSet(setAccountInfoLoading), []);\n const safeSetAccountInfoError = React.useMemo(() => safeSet(setAccountInfoError), []);\n const safeSetLocalRecoveryEmails = React.useMemo(() => safeSet(setLocalRecoveryEmails), []);\n const safeSetExplorerToast = React.useMemo(() => safeSet(setExplorerToast), []);\n const safeSetMailtoUiState = React.useMemo(() => safeSet(setMailtoUiState), []);\n\n const onEvent = React.useCallback(\n (ev: EmailRecoverySSEEvent) => {\n if (cancelRequestedRef.current) return;\n safeSetStatusText(ev?.message || null);\n emailRecoveryOptions?.onEvent?.(ev);\n\n const data = (ev as any)?.data || {};\n const rawTxHash = data?.transactionHash ?? data?.transaction_hash;\n const txHash = typeof rawTxHash === 'string' ? rawTxHash.trim() : '';\n if (txHash) {\n const base = String(tatchiPasskey.configs?.nearExplorerUrl || 'https://testnet.nearblocks.io').replace(/\\/$/, '');\n const url = base.includes('nearblocks.io')\n ? `${base}/txns/${txHash}`\n : `${base}/transactions/${txHash}`;\n safeSetExplorerToast({ url, transactionHash: txHash });\n }\n const elapsedRaw = data?.elapsedMs ?? data?.elapsed_ms;\n if (elapsedRaw == null) safeSetPollingElapsedMs(null);\n const elapsed = elapsedRaw == null ? Number.NaN : Number(elapsedRaw);\n if (!Number.isNaN(elapsed)) safeSetPollingElapsedMs(elapsed);\n\n if (ev?.phase === 'email-recovery-error' || (ev as any)?.status === 'error') {\n const raw = (ev as any)?.error || ev?.message || 'Email recovery failed';\n safeSetErrorText(String(raw));\n }\n },\n [emailRecoveryOptions, safeSetErrorText, safeSetExplorerToast, safeSetPollingElapsedMs, safeSetStatusText, tatchiPasskey],\n );\n\n const showExplorerToast = React.useCallback(\n (rawAccountId: string) => {\n const normalized = (rawAccountId || '').trim();\n if (!normalized) return;\n const base = String(tatchiPasskey.configs?.nearExplorerUrl || 'https://testnet.nearblocks.io').replace(/\\/$/, '');\n const url = base.includes('nearblocks.io')\n ? `${base}/address/${normalized}`\n : `${base}/accounts/${normalized}`;\n\n safeSetExplorerToast({ url, accountId: normalized });\n },\n [safeSetExplorerToast, tatchiPasskey],\n );\n\n const launchMailto = React.useCallback((rawMailtoUrl: string) => {\n const url = String(rawMailtoUrl || '').trim();\n if (!url) return;\n\n if (typeof window !== 'undefined') {\n try {\n window.location.href = url;\n } catch {}\n }\n }, []);\n\n const attemptOpenMailtoFromUserGesture = React.useCallback(\n (rawMailtoUrl: string) => {\n const url = String(rawMailtoUrl || '').trim();\n if (!url) return;\n\n safeSetMailtoUiState('opening');\n\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n }\n\n // If the browser never blurs/hides (i.e. mailto blocked or cancelled), re-enable so users can retry.\n mailtoAttemptTimerRef.current = window.setTimeout(() => {\n safeSetMailtoUiState(prev => (prev === 'opening' ? 'ready' : prev));\n mailtoAttemptTimerRef.current = null;\n }, 2_000);\n\n launchMailto(url);\n },\n [launchMailto, safeSetMailtoUiState],\n );\n\n const attemptOpenMailtoAuto = React.useCallback(\n (rawMailtoUrl: string) => {\n const url = String(rawMailtoUrl || '').trim();\n if (!url) return;\n // Best-effort only: do not change `mailtoUiState` so users can immediately click the CTA.\n launchMailto(url);\n },\n [launchMailto],\n );\n\n React.useEffect(() => {\n if (mailtoUiState !== 'opening') return;\n if (typeof window === 'undefined' || typeof document === 'undefined') return;\n\n // Heuristic signals that the mail client likely opened. Treat as a hint only:\n // re-enable immediately so the CTA remains retryable even if this is a false-positive.\n const markMaybeOpened = () => {\n safeSetMailtoUiState('ready');\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n mailtoAttemptTimerRef.current = null;\n }\n };\n\n const onVisibilityChange = () => {\n if (document.visibilityState === 'hidden') markMaybeOpened();\n };\n\n window.addEventListener('blur', markMaybeOpened);\n window.addEventListener('pagehide', markMaybeOpened);\n document.addEventListener('visibilitychange', onVisibilityChange);\n\n return () => {\n window.removeEventListener('blur', markMaybeOpened);\n window.removeEventListener('pagehide', markMaybeOpened);\n document.removeEventListener('visibilitychange', onVisibilityChange);\n };\n }, [mailtoUiState, safeSetMailtoUiState]);\n\n const fetchLocalRecoveryEmailsFromIndexedDB = React.useCallback(\n async (rawAccountId: string): Promise<string[]> => {\n const normalized = (rawAccountId || '').trim();\n if (!normalized) {\n console.log('[EmailRecoverySlide] fetchLocalRecoveryEmails: empty accountId');\n return [];\n }\n\n try {\n console.log('[EmailRecoverySlide] fetchLocalRecoveryEmails: loading from IndexedDB', { accountId: normalized });\n const records = await IndexedDBManager.getRecoveryEmails(toAccountId(normalized));\n console.log('[EmailRecoverySlide] fetchLocalRecoveryEmails: raw IndexedDB records', {\n accountId: normalized,\n count: Array.isArray(records) ? records.length : 0,\n records,\n });\n if (!Array.isArray(records) || records.length === 0) return [];\n\n const sorted = [...records].sort((a, b) => (b?.addedAt || 0) - (a?.addedAt || 0));\n const emails = sorted\n .map(r => String(r?.email || '').trim().toLowerCase())\n .filter(e => !!e && e.includes('@'));\n\n const uniq = Array.from(new Set(emails));\n console.log('[EmailRecoverySlide] fetchLocalRecoveryEmails: parsed emails', {\n accountId: normalized,\n emails: uniq,\n });\n return uniq;\n } catch (err) {\n // best-effort; treat as no saved emails (e.g., IndexedDB unavailable)\n console.log('[EmailRecoverySlide] fetchLocalRecoveryEmails: failed to read IndexedDB', {\n accountId: normalized,\n error: err instanceof Error ? err.message : String(err),\n });\n return [];\n }\n },\n [],\n );\n\n const deriveEmailsFromRecoveryRecords = React.useCallback((records: unknown): string[] => {\n if (!Array.isArray(records) || records.length === 0) return [];\n const emails = records\n .map((r: any) => String(r?.email || '').trim().toLowerCase())\n .filter((e: string) => !!e && e.includes('@'));\n return Array.from(new Set(emails));\n }, []);\n\n React.useEffect(() => {\n const normalized = (accountIdInput || '').trim();\n if (!normalized) {\n setAccountInfo(null);\n setAccountInfoError(null);\n setAccountInfoLoading(false);\n safeSetLocalRecoveryEmails([]);\n return;\n }\n\n let cancelled = false;\n // Show loading state immediately (don't wait for debounce).\n safeSetAccountInfoLoading(true);\n safeSetAccountInfoError(null);\n const handle = window.setTimeout(() => {\n void (async () => {\n try {\n const isWalletIframeMode = !!tatchiPasskey.configs?.iframeWallet?.walletOrigin;\n\n // Legacy mode: suggest recovery emails from local IndexedDB mapping (best-effort).\n let localEmails: string[] = [];\n if (!isWalletIframeMode) {\n localEmails = await fetchLocalRecoveryEmailsFromIndexedDB(normalized);\n if (!cancelled) {\n console.log('[EmailRecoverySlide] local saved emails (IndexedDB)', { accountId: normalized, localEmails });\n }\n }\n\n const records = await tatchiPasskey.getRecoveryEmails(normalized);\n const resolvedEmails = isWalletIframeMode\n ? deriveEmailsFromRecoveryRecords(records)\n : localEmails;\n\n if (!cancelled) {\n safeSetLocalRecoveryEmails(resolvedEmails);\n console.log('[EmailRecoverySlide] recovery email suggestions (state)', { accountId: normalized, emails: resolvedEmails });\n\n if (\n resolvedEmails.length === 1 &&\n (recoveryEmailInput.trim() === '' || recoveryEmailInput === lastPrefilledRecoveryEmailRef.current)\n ) {\n lastPrefilledRecoveryEmailRef.current = resolvedEmails[0];\n setRecoveryEmailInput(resolvedEmails[0]);\n }\n }\n\n const info: EmailRecoveryAccountInfo | null = records\n ? { emailsCount: Array.isArray(records) ? records.length : 0 }\n : null;\n if (cancelled) return;\n safeSetAccountInfo(info);\n } catch (err: any) {\n if (cancelled) return;\n safeSetAccountInfo(null);\n safeSetAccountInfoError(err?.message || 'Failed to load email recovery settings for this account');\n } finally {\n if (!cancelled) safeSetAccountInfoLoading(false);\n }\n })();\n }, 350);\n\n return () => {\n cancelled = true;\n window.clearTimeout(handle);\n };\n }, [\n accountIdInput,\n deriveEmailsFromRecoveryRecords,\n fetchLocalRecoveryEmailsFromIndexedDB,\n recoveryEmailInput,\n safeSetAccountInfo,\n safeSetAccountInfoError,\n safeSetAccountInfoLoading,\n safeSetLocalRecoveryEmails,\n tatchiPasskey,\n ]);\n\n const handleStart = React.useCallback(async () => {\n const normalizedAccountId = (accountIdInput || '').trim();\n if (!normalizedAccountId) {\n safeSetErrorText('Enter an account ID.');\n return;\n }\n\n const emailCandidate = (recoveryEmailInput || '').trim().toLowerCase();\n if (!emailCandidate) {\n safeSetErrorText('Enter the recovery email to send from.');\n return;\n }\n\n safeSetIsBusy(true);\n cancelRequestedRef.current = false;\n safeSetErrorText(null);\n safeSetStatusText(null);\n safeSetPollingElapsedMs(null);\n safeSetPendingMailtoUrl(null);\n safeSetMailtoUiState('ready');\n\n let didForwardError = false;\n try {\n const result = await tatchiPasskey.startEmailRecovery({\n accountId: normalizedAccountId,\n recoveryEmail: emailCandidate,\n options: {\n onEvent,\n onError: (err: Error) => {\n if (cancelRequestedRef.current) return;\n safeSetErrorText(err?.message || 'Failed to start email recovery');\n didForwardError = true;\n emailRecoveryOptions?.onError?.(err);\n },\n afterCall: async () => {},\n } as any,\n });\n\n safeSetPendingMailtoUrl(result.mailtoUrl);\n safeSetStatusText('Recovery email draft ready. If it didn’t open automatically, click “Open recovery email draft”. Waiting for verification…');\n\n // Best-effort open. If blocked/cancelled, the CTA remains immediately clickable for a user-gesture retry.\n attemptOpenMailtoAuto(result.mailtoUrl);\n\n // Start polling immediately after attempting to open the email prompt.\n const finalizePromise = tatchiPasskey.finalizeEmailRecovery({\n accountId: normalizedAccountId,\n nearPublicKey: result.nearPublicKey,\n options: {\n onEvent,\n onError: (err: Error) => {\n if (cancelRequestedRef.current) return;\n safeSetErrorText(err?.message || 'Failed to finalize email recovery');\n didForwardError = true;\n emailRecoveryOptions?.onError?.(err);\n },\n afterCall: async () => {},\n } as any,\n });\n\n showExplorerToast(normalizedAccountId);\n\n await finalizePromise;\n\n // Best-effort auto-login: the core flow attempts it, but if it couldn't (e.g. missing Shamir\n // auto-unlock and user cancelled TouchID), try once more here.\n let loginOk = false;\n const session = await tatchiPasskey.getLoginSession(normalizedAccountId).catch(() => null);\n if (session?.login?.isLoggedIn) {\n loginOk = true;\n } else {\n safeSetStatusText('Email recovery completed. Logging you in…');\n loginOk = await tatchiPasskey.loginAndCreateSession(normalizedAccountId)\n .then(() => true)\n .catch(() => false);\n }\n\n if (refreshLoginState) {\n await refreshLoginState(normalizedAccountId).catch(() => {});\n }\n\n safeSetStatusText(loginOk ? 'Email recovery completed on this device.' : 'Email recovery completed. Please log in on this device.');\n safeSetPendingMailtoUrl(null);\n safeSetMailtoUiState('ready');\n safeSetPollingElapsedMs(null);\n } catch (err: any) {\n if (cancelRequestedRef.current) {\n safeSetErrorText('Email recovery cancelled. Please try again.');\n safeSetStatusText(null);\n safeSetPollingElapsedMs(null);\n safeSetPendingMailtoUrl(null);\n safeSetMailtoUiState('ready');\n return;\n }\n safeSetErrorText(err?.message || 'Failed to start email recovery');\n if (!didForwardError && err instanceof Error) {\n emailRecoveryOptions?.onError?.(err);\n }\n } finally {\n safeSetIsBusy(false);\n }\n }, [\n accountIdInput,\n emailRecoveryOptions,\n recoveryEmailInput,\n onEvent,\n refreshLoginState,\n showExplorerToast,\n safeSetErrorText,\n safeSetIsBusy,\n safeSetPendingMailtoUrl,\n safeSetPollingElapsedMs,\n safeSetStatusText,\n safeSetMailtoUiState,\n attemptOpenMailtoAuto,\n tatchiPasskey,\n ]);\n\n const summaryLine = accountInfoLoading\n ? 'Checking if account has recovery emails configured...'\n : accountInfo && !accountInfoError\n ? `Recovery emails configured: ${accountInfo.emailsCount}`\n : '\\u00A0';\n\n const noRecoveryEmailsConfigured =\n !accountInfoLoading && !accountInfoError && !!accountInfo && accountInfo.emailsCount === 0;\n\n return (\n <div className=\"w3a-email-recovery-slide\">\n <div className=\"w3a-email-recovery-title\">Recover Account with Email</div>\n <div className=\"w3a-email-recovery-help\">\n Send a special recovery email from your recovery email address.\n Your account will be recovered with a new key once the email is verified.\n </div>\n\n <div className=\"w3a-email-recovery-field\">\n <div className=\"w3a-input-pill w3a-email-recovery-input-pill\">\n <div className=\"w3a-input-wrap\">\n <input\n type=\"text\"\n value={accountIdInput}\n onChange={(e) => setAccountIdInput(e.target.value)}\n placeholder=\"NEAR account ID (e.g. alice.testnet)\"\n className=\"w3a-input\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n inputMode=\"text\"\n disabled={isBusy}\n />\n </div>\n </div>\n </div>\n\n <div className=\"w3a-email-recovery-summary\" aria-live=\"polite\">\n <div>{summaryLine}</div>\n </div>\n\n <div className=\"w3a-email-recovery-field\">\n <div className=\"w3a-input-pill w3a-email-recovery-input-pill\">\n <div className=\"w3a-input-wrap\">\n <input\n type=\"email\"\n value={recoveryEmailInput}\n onChange={(e) => setRecoveryEmailInput(e.target.value)}\n placeholder=\"Recovery email to send from\"\n className=\"w3a-input\"\n list={localRecoveryEmails.length > 0 ? 'w3a-email-recovery-saved-emails' : undefined}\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n inputMode=\"email\"\n disabled={isBusy || noRecoveryEmailsConfigured}\n />\n </div>\n </div>\n </div>\n\n {localRecoveryEmails.length > 0 && (\n <div className=\"w3a-email-recovery-summary\" aria-live=\"polite\">\n <div>Saved on this device:</div>\n <div className=\"w3a-email-recovery-saved-emails\">\n {localRecoveryEmails.map((email) => (\n <button\n key={email}\n type=\"button\"\n className=\"w3a-email-recovery-email-chip\"\n onClick={() => setRecoveryEmailInput(email)}\n disabled={isBusy}\n >\n {email}\n </button>\n ))}\n </div>\n </div>\n )}\n\n {localRecoveryEmails.length > 0 && (\n <datalist id=\"w3a-email-recovery-saved-emails\">\n {localRecoveryEmails.map((email) => (\n <option key={email} value={email} />\n ))}\n </datalist>\n )}\n\n <div className=\"w3a-email-recovery-actions\">\n {(!pendingMailtoUrl || !isBusy) && (\n <button\n onClick={handleStart}\n className=\"w3a-link-device-btn w3a-link-device-btn-primary\"\n disabled={isBusy || noRecoveryEmailsConfigured}\n >\n {noRecoveryEmailsConfigured ? 'No recovery emails configured' : (isBusy ? 'Working…' : 'Start Email Recovery')}\n </button>\n )}\n\n {pendingMailtoUrl && (\n <button\n type=\"button\"\n onClick={() => attemptOpenMailtoFromUserGesture(pendingMailtoUrl)}\n className=\"w3a-link-device-btn w3a-link-device-btn-primary\"\n disabled={mailtoUiState === 'opening'}\n aria-busy={mailtoUiState === 'opening'}\n >\n {mailtoUiState === 'opening' && <span className=\"w3a-spinner\" aria-hidden=\"true\" />}\n {mailtoUiState === 'opening' ? 'Opening email…' : 'Open recovery email draft'}\n </button>\n )}\n </div>\n\n {(errorText || statusText || explorerToast) && (\n <div className={`w3a-email-recovery-status${errorText ? ' is-error' : ''}`}>\n {errorText ? errorText : statusText}\n {pollingElapsedMs != null && !Number.isNaN(pollingElapsedMs) && pollingElapsedMs > 0 && (\n <span className=\"w3a-email-recovery-elapsed\">\n (~{Math.round(pollingElapsedMs / 1000)}s).\n </span>\n )}\n {explorerToast && (\n <>\n <br />\n <a className=\"w3a-email-recovery-link\" href={explorerTo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sBAAsB,EAAE,OAAO;OAChD,aAAY;OACZ,WAAU;OACV,MAAM,oBAAoB,SAAS,IAAI,oCAAoC;OAC3E,gBAAe;OACf,aAAY;OACZ,YAAY;OACZ,WAAU;OACV,UAAU,UAAU;;;;;GAM3B,oBAAoB,SAAS,KAC5B,4CAAC;IAAI,WAAU;IAA6B,aAAU;eACpD,2CAAC,mBAAI,4BACL,2CAAC;KAAI,WAAU;eACZ,oBAAoB,KAAK,UACxB,2CAAC;MAEC,MAAK;MACL,WAAU;MACV,eAAe,sBAAsB;MACrC,UAAU;gBAET;QANI;;;GAad,oBAAoB,SAAS,KAC5B,2CAAC;IAAS,IAAG;cACV,oBAAoB,KAAK,UACxB,2CAAC,YAAmB,OAAO,SAAd;;GAKnB,4CAAC;IAAI,WAAU;gBACX,CAAC,oBAAoB,CAAC,WACtB,2CAAC;KACC,SAAS;KACT,WAAU;KACV,UAAU,UAAU;eAEnB,6BAA6B,kCAAmC,SAAS,aAAa;QAI1F,oBACC,4CAAC;KACC,MAAK;KACL,eAAe,iCAAiC;KAChD,WAAU;KACV,UAAU,kBAAkB;KAC5B,aAAW,kBAAkB;gBAE5B,kBAAkB,aAAa,2CAAC;MAAK,WAAU;MAAc,eAAY;SACzE,kBAAkB,YAAY,mBAAmB;;;IAKtD,aAAa,cAAc,kBAC3B,4CAAC;IAAI,WAAW,4BAA4B,YAAY,cAAc;;KACnE,YAAY,YAAY;KACxB,oBAAoB,QAAQ,CAAC,OAAO,MAAM,qBAAqB,mBAAmB,KACjF,4CAAC;MAAK,WAAU;;OAA6B;OACxC,KAAK,MAAM,mBAAmB;OAAM;;;KAG1C,iBACC,qFACE,2CAAC,WACD,2CAAC;MAAE,WAAU;MAA0B,MAAM,cAAc;MAAK,QAAO;MAAS,KAAI;gBAAsB"}
|
|
1
|
+
{"version":3,"file":"EmailRecoverySlide.js","names":["canonicalizeEmail","bytesToHex","EmailRecoveryErrorCode","EmailRecoverySlide: React.FC<EmailRecoverySlideProps>","React","EmailRecoveryPhase","EmailRecoveryStatus","info: EmailRecoveryAccountInfo | null","err: unknown","summaryLine: React.ReactNode"],"sources":["../../../../../../src/react/components/PasskeyAuthMenu/ui/EmailRecoverySlide.tsx"],"sourcesContent":["import React from 'react';\n\nimport {\n EmailRecoveryPhase,\n EmailRecoveryStatus,\n type EmailRecoverySSEEvent,\n} from '@/core/types/sdkSentEvents';\nimport type { TatchiPasskey } from '@/core/TatchiPasskey';\nimport { EmailRecoveryErrorCode } from '@/core/types/emailRecovery';\nimport type { EmailRecoveryFlowOptions } from '@/core/TatchiPasskey/emailRecovery';\nimport { bytesToHex, canonicalizeEmail } from '@/core/EmailRecovery';\n\nexport interface EmailRecoverySlideProps {\n tatchiPasskey: TatchiPasskey;\n accountId: string;\n refreshLoginState?: (nearAccountId?: string) => Promise<void>;\n emailRecoveryOptions?: {\n onEvent?: (event: EmailRecoverySSEEvent) => void;\n onError?: (error: Error) => void;\n };\n}\n\ntype EmailRecoveryAccountInfo = {\n emailsCount: number;\n};\n\ntype MailtoUiState = 'ready' | 'opening';\n\ntype RecoveryEmailRecord = Awaited<ReturnType<TatchiPasskey['getRecoveryEmails']>>[number];\n\ntype RecoveryEmailMatchStatus = 'empty' | 'checking' | 'match' | 'mismatch' | 'invalid';\n\nasync function hashRecoveryEmailForAccountHex(args: { recoveryEmail: string; accountId: string }): Promise<string | null> {\n const salt = String(args.accountId || '').trim().toLowerCase();\n if (!salt) return null;\n\n const canonical = canonicalizeEmail(String(args.recoveryEmail || ''));\n if (!canonical || !canonical.includes('@')) return null;\n\n if (typeof crypto === 'undefined' || !crypto.subtle) return null;\n\n const input = `${canonical}|${salt}`;\n const bytes = new TextEncoder().encode(input);\n const digest = await crypto.subtle.digest('SHA-256', bytes);\n return bytesToHex(new Uint8Array(digest));\n}\n\nfunction getEmailRecoveryErrorCode(err: unknown): EmailRecoveryErrorCode | null {\n const code = (err as { code?: unknown } | null)?.code;\n if (typeof code !== 'string') return null;\n return Object.values(EmailRecoveryErrorCode).includes(code as EmailRecoveryErrorCode)\n ? (code as EmailRecoveryErrorCode)\n : null;\n}\n\nfunction getEmailRecoveryUiError(err: unknown): { message: string; canRestart: boolean } {\n const fallback = err instanceof Error ? err.message : String(err || '');\n const normalizedFallback = fallback.trim().toLowerCase();\n if (normalizedFallback.includes('recovery email is required')) {\n return {\n message:\n fallback ||\n 'Recovery email is required for email-based account recovery. Make sure you send the email from your configured recovery email address.',\n canRestart: true,\n };\n }\n const code = getEmailRecoveryErrorCode(err);\n switch (code) {\n case EmailRecoveryErrorCode.VRF_CHALLENGE_EXPIRED:\n return {\n message: fallback || 'Timed out finalizing registration (VRF challenge expired). Please restart email recovery and try again.',\n canRestart: true,\n };\n case EmailRecoveryErrorCode.REGISTRATION_NOT_VERIFIED:\n return {\n message: fallback || 'Registration did not verify on-chain. Please restart email recovery and try again.',\n canRestart: true,\n };\n default:\n return { message: fallback || 'Email recovery failed', canRestart: false };\n }\n}\n\nfunction getEmailRecoveryErrorTxHash(err: unknown): string | null {\n const carrier = (err as { context?: unknown; details?: unknown } | null);\n const ctx = carrier?.context && typeof carrier.context === 'object' ? carrier.context : null;\n const details = carrier?.details && typeof carrier.details === 'object' ? carrier.details : null;\n const source = ctx ?? details;\n if (!source) return null;\n const txHash = (source as { transactionHash?: unknown }).transactionHash;\n return typeof txHash === 'string' && txHash.trim().length > 0 ? txHash.trim() : null;\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n if (!value || typeof value !== 'object') return null;\n return value as Record<string, unknown>;\n}\n\nexport const EmailRecoverySlide: React.FC<EmailRecoverySlideProps> = ({ tatchiPasskey, accountId, refreshLoginState, emailRecoveryOptions }) => {\n const mountedRef = React.useRef(true);\n const mailtoAttemptTimerRef = React.useRef<number | null>(null);\n const cancelRequestedRef = React.useRef(false);\n React.useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n mailtoAttemptTimerRef.current = null;\n }\n };\n }, []);\n\n const [isBusy, setIsBusy] = React.useState(false);\n const [accountIdInput, setAccountIdInput] = React.useState('');\n const [pendingMailtoUrl, setPendingMailtoUrl] = React.useState<string | null>(null);\n const [pendingNearPublicKey, setPendingNearPublicKey] = React.useState<string | null>(null);\n const [mailtoUiState, setMailtoUiState] = React.useState<MailtoUiState>('ready');\n const [statusText, setStatusText] = React.useState<string | null>(null);\n const [pollingElapsedMs, setPollingElapsedMs] = React.useState<number | null>(null);\n const [errorText, setErrorText] = React.useState<string | null>(null);\n const [canRestart, setCanRestart] = React.useState(false);\n const [accountInfo, setAccountInfo] = React.useState<EmailRecoveryAccountInfo | null>(null);\n const [accountInfoLoading, setAccountInfoLoading] = React.useState(false);\n const [accountInfoError, setAccountInfoError] = React.useState<string | null>(null);\n const [localRecoveryEmails, setLocalRecoveryEmails] = React.useState<string[]>([]);\n const [recoveryEmailRecords, setRecoveryEmailRecords] = React.useState<RecoveryEmailRecord[]>([]);\n const [recoveryEmailInput, setRecoveryEmailInput] = React.useState('');\n const [recoveryEmailMatchStatus, setRecoveryEmailMatchStatus] = React.useState<RecoveryEmailMatchStatus>('empty');\n const [explorerToast, setExplorerToast] = React.useState<{ url: string; accountId?: string; transactionHash?: string } | null>(null);\n\n const lastPrefilledAccountIdRef = React.useRef<string>('');\n\n React.useEffect(() => {\n const next = (accountId || '').trim();\n if (!next) return;\n if (accountIdInput.trim() === '' || accountIdInput === lastPrefilledAccountIdRef.current) {\n lastPrefilledAccountIdRef.current = next;\n setAccountIdInput(next);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [accountId]);\n\n React.useEffect(() => {\n setPendingMailtoUrl(null);\n setPendingNearPublicKey(null);\n setMailtoUiState('ready');\n cancelRequestedRef.current = false;\n setStatusText(null);\n setPollingElapsedMs(null);\n setErrorText(null);\n setCanRestart(false);\n setAccountInfo(null);\n setAccountInfoError(null);\n setLocalRecoveryEmails([]);\n setRecoveryEmailRecords([]);\n setRecoveryEmailInput('');\n setRecoveryEmailMatchStatus('empty');\n setExplorerToast(null);\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n mailtoAttemptTimerRef.current = null;\n }\n }, [accountId]);\n\n const safeSet = <T,>(setter: React.Dispatch<React.SetStateAction<T>>) => {\n return (value: React.SetStateAction<T>) => {\n if (!mountedRef.current) return;\n setter(value);\n };\n };\n\n const safeSetPendingMailtoUrl = React.useMemo(() => safeSet(setPendingMailtoUrl), []);\n const safeSetPendingNearPublicKey = React.useMemo(() => safeSet(setPendingNearPublicKey), []);\n const safeSetStatusText = React.useMemo(() => safeSet(setStatusText), []);\n const safeSetPollingElapsedMs = React.useMemo(() => safeSet(setPollingElapsedMs), []);\n const safeSetErrorText = React.useMemo(() => safeSet(setErrorText), []);\n const safeSetIsBusy = React.useMemo(() => safeSet(setIsBusy), []);\n const safeSetCanRestart = React.useMemo(() => safeSet(setCanRestart), []);\n const safeSetAccountInfo = React.useMemo(() => safeSet(setAccountInfo), []);\n const safeSetAccountInfoLoading = React.useMemo(() => safeSet(setAccountInfoLoading), []);\n const safeSetAccountInfoError = React.useMemo(() => safeSet(setAccountInfoError), []);\n const safeSetLocalRecoveryEmails = React.useMemo(() => safeSet(setLocalRecoveryEmails), []);\n const safeSetRecoveryEmailRecords = React.useMemo(() => safeSet(setRecoveryEmailRecords), []);\n const safeSetRecoveryEmailMatchStatus = React.useMemo(() => safeSet(setRecoveryEmailMatchStatus), []);\n const safeSetExplorerToast = React.useMemo(() => safeSet(setExplorerToast), []);\n const safeSetMailtoUiState = React.useMemo(() => safeSet(setMailtoUiState), []);\n\n const onEvent = React.useCallback(\n (ev: EmailRecoverySSEEvent) => {\n if (cancelRequestedRef.current) return;\n safeSetStatusText(ev?.message || null);\n emailRecoveryOptions?.onEvent?.(ev);\n\n const data = 'data' in ev ? asRecord(ev.data) : null;\n const rawTxHash = data?.['transactionHash'] ?? data?.['transaction_hash'];\n const txHash = typeof rawTxHash === 'string' ? rawTxHash.trim() : '';\n if (txHash) {\n const base = String(tatchiPasskey.configs?.nearExplorerUrl || 'https://testnet.nearblocks.io').replace(/\\/$/, '');\n const url = base.includes('nearblocks.io')\n ? `${base}/txns/${txHash}`\n : `${base}/transactions/${txHash}`;\n safeSetExplorerToast({ url, transactionHash: txHash });\n }\n const elapsedRaw = data?.['elapsedMs'] ?? data?.['elapsed_ms'];\n if (elapsedRaw == null) safeSetPollingElapsedMs(null);\n const elapsed = elapsedRaw == null ? Number.NaN : Number(elapsedRaw);\n if (!Number.isNaN(elapsed)) safeSetPollingElapsedMs(elapsed);\n\n if (ev.phase === EmailRecoveryPhase.ERROR || ev.status === EmailRecoveryStatus.ERROR) {\n const raw = 'error' in ev ? ev.error : ev.message;\n safeSetErrorText(raw || 'Email recovery failed');\n safeSetCanRestart(false);\n }\n },\n [emailRecoveryOptions, safeSetCanRestart, safeSetErrorText, safeSetExplorerToast, safeSetPollingElapsedMs, safeSetStatusText, tatchiPasskey],\n );\n\n const showExplorerToast = React.useCallback(\n (rawAccountId: string) => {\n const normalized = (rawAccountId || '').trim();\n if (!normalized) return;\n const base = String(tatchiPasskey.configs?.nearExplorerUrl || 'https://testnet.nearblocks.io').replace(/\\/$/, '');\n const url = base.includes('nearblocks.io')\n ? `${base}/address/${normalized}`\n : `${base}/accounts/${normalized}`;\n\n safeSetExplorerToast({ url, accountId: normalized });\n },\n [safeSetExplorerToast, tatchiPasskey],\n );\n\n const showExplorerTxToast = React.useCallback(\n (txHash: string) => {\n const normalized = (txHash || '').trim();\n if (!normalized) return;\n const base = String(tatchiPasskey.configs?.nearExplorerUrl || 'https://testnet.nearblocks.io').replace(/\\/$/, '');\n const url = base.includes('nearblocks.io')\n ? `${base}/txns/${normalized}`\n : `${base}/transactions/${normalized}`;\n safeSetExplorerToast({ url, transactionHash: normalized });\n },\n [safeSetExplorerToast, tatchiPasskey],\n );\n\n const launchMailto = React.useCallback((rawMailtoUrl: string) => {\n const url = String(rawMailtoUrl || '').trim();\n if (!url) return;\n\n if (typeof window !== 'undefined') {\n try {\n window.location.href = url;\n } catch {}\n }\n }, []);\n\n const attemptOpenMailtoFromUserGesture = React.useCallback(\n (rawMailtoUrl: string) => {\n const url = String(rawMailtoUrl || '').trim();\n if (!url) return;\n\n safeSetMailtoUiState('opening');\n\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n }\n\n // If the browser never blurs/hides (i.e. mailto blocked or cancelled), re-enable so users can retry.\n mailtoAttemptTimerRef.current = window.setTimeout(() => {\n safeSetMailtoUiState(prev => (prev === 'opening' ? 'ready' : prev));\n mailtoAttemptTimerRef.current = null;\n }, 2_000);\n\n launchMailto(url);\n },\n [launchMailto, safeSetMailtoUiState],\n );\n\n const attemptOpenMailtoAuto = React.useCallback(\n (rawMailtoUrl: string) => {\n const url = String(rawMailtoUrl || '').trim();\n if (!url) return;\n // Best-effort only: do not change `mailtoUiState` so users can immediately click the CTA.\n launchMailto(url);\n },\n [launchMailto],\n );\n\n React.useEffect(() => {\n if (mailtoUiState !== 'opening') return;\n if (typeof window === 'undefined' || typeof document === 'undefined') return;\n\n // Heuristic signals that the mail client likely opened. Treat as a hint only:\n // re-enable immediately so the CTA remains retryable even if this is a false-positive.\n const markMaybeOpened = () => {\n safeSetMailtoUiState('ready');\n if (mailtoAttemptTimerRef.current != null) {\n window.clearTimeout(mailtoAttemptTimerRef.current);\n mailtoAttemptTimerRef.current = null;\n }\n };\n\n const onVisibilityChange = () => {\n if (document.visibilityState === 'hidden') markMaybeOpened();\n };\n\n window.addEventListener('blur', markMaybeOpened);\n window.addEventListener('pagehide', markMaybeOpened);\n document.addEventListener('visibilitychange', onVisibilityChange);\n\n return () => {\n window.removeEventListener('blur', markMaybeOpened);\n window.removeEventListener('pagehide', markMaybeOpened);\n document.removeEventListener('visibilitychange', onVisibilityChange);\n };\n }, [mailtoUiState, safeSetMailtoUiState]);\n\n const deriveEmailsFromRecoveryRecords = React.useCallback((records: RecoveryEmailRecord[]): string[] => {\n if (records.length === 0) return [];\n const emails = records\n .map((r) => r.email.trim().toLowerCase())\n .filter((e) => e.length > 0 && e.includes('@'));\n return Array.from(new Set(emails));\n }, []);\n\n React.useEffect(() => {\n const normalized = (accountIdInput || '').trim();\n if (!normalized) {\n setAccountInfo(null);\n setAccountInfoError(null);\n setAccountInfoLoading(false);\n safeSetLocalRecoveryEmails([]);\n return;\n }\n\n let cancelled = false;\n // Show loading state immediately (don't wait for debounce).\n safeSetAccountInfoLoading(true);\n safeSetAccountInfoError(null);\n const handle = window.setTimeout(() => {\n void (async () => {\n try {\n const records = await tatchiPasskey.getRecoveryEmails(normalized);\n const resolvedEmails = deriveEmailsFromRecoveryRecords(records);\n\n if (!cancelled) {\n safeSetLocalRecoveryEmails(resolvedEmails);\n safeSetRecoveryEmailRecords(records);\n }\n\n const info: EmailRecoveryAccountInfo | null = records\n ? { emailsCount: Array.isArray(records) ? records.length : 0 }\n : null;\n if (cancelled) return;\n safeSetAccountInfo(info);\n } catch (err: unknown) {\n if (cancelled) return;\n safeSetAccountInfo(null);\n const msg = err instanceof Error ? err.message : '';\n safeSetAccountInfoError(msg || 'Failed to load email recovery settings for this account');\n safeSetLocalRecoveryEmails([]);\n safeSetRecoveryEmailRecords([]);\n } finally {\n if (!cancelled) safeSetAccountInfoLoading(false);\n }\n })();\n }, 350);\n\n return () => {\n cancelled = true;\n window.clearTimeout(handle);\n };\n }, [\n accountIdInput,\n deriveEmailsFromRecoveryRecords,\n safeSetAccountInfo,\n safeSetAccountInfoError,\n safeSetAccountInfoLoading,\n safeSetLocalRecoveryEmails,\n safeSetRecoveryEmailRecords,\n tatchiPasskey,\n ]);\n\n const recoveryEmailConfirmationRequired =\n !accountInfoLoading &&\n !accountInfoError &&\n !!accountInfo &&\n accountInfo.emailsCount > 0 &&\n localRecoveryEmails.length === 0;\n\n React.useEffect(() => {\n const normalizedAccountId = (accountIdInput || '').trim();\n const rawEmail = (recoveryEmailInput || '').trim();\n\n if (!rawEmail || !normalizedAccountId) {\n safeSetRecoveryEmailMatchStatus('empty');\n return;\n }\n\n if (!Array.isArray(recoveryEmailRecords) || recoveryEmailRecords.length === 0) {\n safeSetRecoveryEmailMatchStatus('checking');\n return;\n }\n\n let cancelled = false;\n safeSetRecoveryEmailMatchStatus('checking');\n\n const handle = window.setTimeout(() => {\n void (async () => {\n try {\n const hashHex = await hashRecoveryEmailForAccountHex({\n recoveryEmail: rawEmail,\n accountId: normalizedAccountId,\n });\n if (cancelled) return;\n if (!hashHex) {\n safeSetRecoveryEmailMatchStatus('invalid');\n return;\n }\n\n const normalizedHashHex = hashHex.toLowerCase();\n const matches = recoveryEmailRecords.some((rec) => String(rec.hashHex || '').toLowerCase() === normalizedHashHex);\n safeSetRecoveryEmailMatchStatus(matches ? 'match' : 'mismatch');\n } catch {\n if (!cancelled) safeSetRecoveryEmailMatchStatus('invalid');\n }\n })();\n }, 250);\n\n return () => {\n cancelled = true;\n window.clearTimeout(handle);\n };\n }, [\n accountIdInput,\n recoveryEmailInput,\n recoveryEmailRecords,\n safeSetRecoveryEmailMatchStatus,\n ]);\n\n const handleStart = React.useCallback(async () => {\n const normalizedAccountId = (accountIdInput || '').trim();\n if (!normalizedAccountId) {\n safeSetErrorText('Enter an account ID.');\n return;\n }\n\n if (accountInfoLoading) {\n safeSetErrorText('Checking recovery email settings…');\n return;\n }\n\n if (accountInfoError) {\n safeSetErrorText(accountInfoError);\n return;\n }\n\n if (!accountInfo) {\n safeSetErrorText('Failed to load email recovery settings for this account.');\n return;\n }\n\n if (accountInfo.emailsCount === 0) {\n safeSetErrorText('No recovery emails are configured for this account.');\n return;\n }\n\n const recoveryEmail = recoveryEmailInput.trim();\n if (recoveryEmailConfirmationRequired) {\n if (!recoveryEmail) {\n safeSetErrorText('Enter the recovery email address you will send from.');\n return;\n }\n\n const hashHex = await hashRecoveryEmailForAccountHex({\n recoveryEmail,\n accountId: normalizedAccountId,\n }).catch(() => null);\n\n if (!hashHex) {\n safeSetErrorText('Enter a valid recovery email address.');\n return;\n }\n\n const normalizedHashHex = hashHex.toLowerCase();\n const matches = recoveryEmailRecords.some((rec) => String(rec.hashHex || '').toLowerCase() === normalizedHashHex);\n if (!matches) {\n safeSetErrorText('That email is not configured for recovery on this account. Please use your configured recovery email address.');\n return;\n }\n }\n\n safeSetIsBusy(true);\n cancelRequestedRef.current = false;\n safeSetErrorText(null);\n safeSetCanRestart(false);\n safeSetStatusText(null);\n safeSetPollingElapsedMs(null);\n safeSetPendingMailtoUrl(null);\n safeSetPendingNearPublicKey(null);\n safeSetMailtoUiState('ready');\n\n let didForwardError = false;\n try {\n const result = await tatchiPasskey.startEmailRecovery({\n accountId: normalizedAccountId,\n ...(recoveryEmail ? { recoveryEmail } : {}),\n options: {\n onEvent,\n onError: (err: Error) => {\n if (cancelRequestedRef.current) return;\n safeSetErrorText(err?.message || 'Failed to start email recovery');\n didForwardError = true;\n emailRecoveryOptions?.onError?.(err);\n },\n } satisfies EmailRecoveryFlowOptions,\n });\n\n safeSetPendingMailtoUrl(result.mailtoUrl);\n safeSetPendingNearPublicKey(result.nearPublicKey);\n safeSetStatusText('Recovery email draft ready. If it didn’t open automatically, click “Open recovery email draft”. Waiting for verification…');\n\n // Best-effort open. If blocked/cancelled, the CTA remains immediately clickable for a user-gesture retry.\n attemptOpenMailtoAuto(result.mailtoUrl);\n\n // Start polling immediately after attempting to open the email prompt.\n const finalizePromise = tatchiPasskey.finalizeEmailRecovery({\n accountId: normalizedAccountId,\n nearPublicKey: result.nearPublicKey,\n options: {\n onEvent,\n onError: (err: Error) => {\n if (cancelRequestedRef.current) return;\n const uiError = getEmailRecoveryUiError(err);\n safeSetErrorText(uiError.message || 'Failed to finalize email recovery');\n safeSetCanRestart(uiError.canRestart);\n const txHash = getEmailRecoveryErrorTxHash(err);\n if (txHash) showExplorerTxToast(txHash);\n didForwardError = true;\n emailRecoveryOptions?.onError?.(err);\n },\n } satisfies EmailRecoveryFlowOptions,\n });\n\n showExplorerToast(normalizedAccountId);\n\n await finalizePromise;\n\n // Best-effort auto-login: the core flow attempts it, but if it couldn't (e.g. missing Shamir\n // auto-unlock and user cancelled TouchID), try once more here.\n let loginOk = false;\n const session = await tatchiPasskey.getLoginSession(normalizedAccountId).catch(() => null);\n if (session?.login?.isLoggedIn) {\n loginOk = true;\n } else {\n safeSetStatusText('Email recovery completed. Logging you in…');\n loginOk = await tatchiPasskey.loginAndCreateSession(normalizedAccountId)\n .then(() => true)\n .catch(() => false);\n }\n\n if (refreshLoginState) {\n await refreshLoginState(normalizedAccountId).catch(() => {});\n }\n\n safeSetStatusText(loginOk ? 'Email recovery completed on this device.' : 'Email recovery completed. Please log in on this device.');\n safeSetPendingMailtoUrl(null);\n safeSetMailtoUiState('ready');\n safeSetPollingElapsedMs(null);\n } catch (err: unknown) {\n if (cancelRequestedRef.current) {\n safeSetErrorText('Email recovery cancelled. Please try again.');\n safeSetStatusText(null);\n safeSetPollingElapsedMs(null);\n safeSetPendingMailtoUrl(null);\n safeSetPendingNearPublicKey(null);\n safeSetMailtoUiState('ready');\n safeSetCanRestart(false);\n return;\n }\n const uiError = getEmailRecoveryUiError(err);\n safeSetErrorText(uiError.message || 'Failed to start email recovery');\n safeSetCanRestart(uiError.canRestart);\n const txHash = getEmailRecoveryErrorTxHash(err);\n if (txHash) showExplorerTxToast(txHash);\n if (!didForwardError && err instanceof Error) {\n emailRecoveryOptions?.onError?.(err);\n }\n } finally {\n safeSetIsBusy(false);\n }\n }, [\n accountIdInput,\n emailRecoveryOptions,\n onEvent,\n refreshLoginState,\n accountInfo,\n accountInfoError,\n accountInfoLoading,\n recoveryEmailConfirmationRequired,\n recoveryEmailInput,\n recoveryEmailRecords,\n showExplorerToast,\n safeSetErrorText,\n safeSetIsBusy,\n safeSetPendingMailtoUrl,\n safeSetPollingElapsedMs,\n safeSetStatusText,\n safeSetMailtoUiState,\n attemptOpenMailtoAuto,\n showExplorerTxToast,\n tatchiPasskey,\n ]);\n\n const handleRestart = React.useCallback(async () => {\n const normalizedAccountId = (accountIdInput || '').trim();\n if (!normalizedAccountId) return;\n\n safeSetIsBusy(true);\n try {\n cancelRequestedRef.current = true;\n await tatchiPasskey.cancelEmailRecovery({\n accountId: normalizedAccountId,\n nearPublicKey: pendingNearPublicKey || undefined,\n }).catch(() => {});\n safeSetErrorText(null);\n safeSetStatusText(null);\n safeSetPollingElapsedMs(null);\n safeSetPendingMailtoUrl(null);\n safeSetPendingNearPublicKey(null);\n safeSetMailtoUiState('ready');\n safeSetCanRestart(false);\n } finally {\n cancelRequestedRef.current = false;\n safeSetIsBusy(false);\n }\n }, [\n accountIdInput,\n pendingNearPublicKey,\n safeSetCanRestart,\n safeSetErrorText,\n safeSetIsBusy,\n safeSetMailtoUiState,\n safeSetPendingMailtoUrl,\n safeSetPendingNearPublicKey,\n safeSetPollingElapsedMs,\n safeSetStatusText,\n tatchiPasskey,\n ]);\n\n const summaryLine: React.ReactNode = accountInfoLoading\n ? (\n <>\n Checking if account has recovery emails configured\n <span className=\"w3a-ellipsis\" aria-hidden=\"true\">\n <span className=\"w3a-ellipsis-dot\">.</span>\n <span className=\"w3a-ellipsis-dot\">.</span>\n <span className=\"w3a-ellipsis-dot\">.</span>\n </span>\n </>\n )\n : accountInfo && !accountInfoError\n ? `Recovery emails configured: ${accountInfo.emailsCount}`\n : '\\u00A0';\n\n const noRecoveryEmailsConfigured =\n !accountInfoLoading && !accountInfoError && !!accountInfo && accountInfo.emailsCount === 0;\n\n const disableStartForRecoveryEmailMismatch =\n recoveryEmailConfirmationRequired &&\n (recoveryEmailMatchStatus === 'empty' || recoveryEmailMatchStatus === 'checking' || recoveryEmailMatchStatus === 'invalid' || recoveryEmailMatchStatus === 'mismatch');\n\n const startDisabled = isBusy || accountInfoLoading || !!accountInfoError || !accountInfo || noRecoveryEmailsConfigured || disableStartForRecoveryEmailMismatch;\n\n return (\n <div className=\"w3a-email-recovery-slide\">\n <div className=\"w3a-email-recovery-title\">Recover Account with Email</div>\n <div className=\"w3a-email-recovery-help\">\n Send a special email to recover your account.\n This email must be sent from the designated email recovery address.\n </div>\n\n <div>\n <div className=\"w3a-input-pill w3a-email-recovery-input-pill\">\n <div className=\"w3a-input-wrap\">\n <input\n type=\"text\"\n value={accountIdInput}\n onChange={(e) => setAccountIdInput(e.target.value)}\n placeholder=\"NEAR account ID (e.g. alice.testnet)\"\n className=\"w3a-input\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n inputMode=\"text\"\n disabled={isBusy}\n />\n </div>\n </div>\n </div>\n\n <div className=\"w3a-email-recovery-summary\" aria-live=\"polite\">\n <div>{summaryLine}</div>\n {!!accountInfoError && (\n <div className=\"w3a-email-recovery-warning\">{accountInfoError}</div>\n )}\n {localRecoveryEmails.length > 0 && (\n <div className=\"w3a-email-recovery-saved-emails\" role=\"list\" aria-label=\"Recovery emails\">\n {localRecoveryEmails.map((email) => (\n <span key={email} className=\"w3a-email-recovery-email-chip w3a-email-recovery-email-chip-static\" role=\"listitem\">\n {email}\n </span>\n ))}\n </div>\n )}\n {recoveryEmailConfirmationRequired && (\n <>\n <div className=\"w3a-email-recovery-warning\">\n This device can’t display your configured recovery email address. Enter the email you will send from to confirm it matches what’s configured for this account.\n </div>\n <div className=\"w3a-input-pill w3a-email-recovery-input-pill\">\n <div className=\"w3a-input-wrap\">\n <input\n type=\"email\"\n value={recoveryEmailInput}\n onChange={(e) => setRecoveryEmailInput(e.target.value)}\n placeholder=\"Recovery email address (sender)\"\n className=\"w3a-input\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n inputMode=\"email\"\n disabled={isBusy}\n />\n </div>\n </div>\n {recoveryEmailMatchStatus === 'checking' && (\n <div>Checking recovery email…</div>\n )}\n {recoveryEmailMatchStatus === 'invalid' && (\n <div className=\"w3a-email-recovery-warning\">Enter a valid email address.</div>\n )}\n {recoveryEmailMatchStatus === 'mismatch' && (\n <div className=\"w3a-email-recovery-warning\">That email is not configured for recovery on this account.</div>\n )}\n {recoveryEmailMatchStatus === 'match' && (\n <div>Recovery email verified for this account.</div>\n )}\n </>\n )}\n {!!accountIdInput.trim() && !noRecoveryEmailsConfigured && (\n <div className=\"w3a-email-recovery-from-warning\">\n {recoveryEmailInput.trim()\n ? `Check that you are sending the recovery email from ${recoveryEmailInput.trim()}.`\n : 'Check that you are sending the recovery email from your designated recovery email.'}\n </div>\n )}\n </div>\n\n <div className=\"w3a-email-recovery-actions\">\n {(!pendingMailtoUrl || !isBusy) && (\n <button\n onClick={handleStart}\n className=\"w3a-link-device-btn w3a-link-device-btn-primary\"\n disabled={startDisabled}\n >\n {accountInfoLoading\n ? 'Checking recovery emails…'\n : noRecoveryEmailsConfigured\n ? 'No recovery emails configured'\n : disableStartForRecoveryEmailMismatch\n ? 'Confirm recovery email'\n : (isBusy ? 'Working…' : 'Start Email Recovery')}\n </button>\n )}\n\n {pendingMailtoUrl && (\n <button\n type=\"button\"\n onClick={() => attemptOpenMailtoFromUserGesture(pendingMailtoUrl)}\n className=\"w3a-link-device-btn w3a-link-device-btn-primary\"\n disabled={mailtoUiState === 'opening'}\n aria-busy={mailtoUiState === 'opening'}\n >\n {mailtoUiState === 'opening' && <span className=\"w3a-spinner\" aria-hidden=\"true\" />}\n {mailtoUiState === 'opening' ? 'Opening email…' : 'Open recovery email draft'}\n </button>\n )}\n\n {errorText && canRestart && (\n <button\n type=\"button\"\n onClick={handleRestart}\n className=\"w3a-link-device-btn\"\n disabled={isBusy}\n >\n Restart email recovery\n </button>\n )}\n </div>\n\n {(errorText || statusText || explorerToast) && (\n <div className={`w3a-email-recovery-status${errorText ? ' is-error' : ''}`}>\n {errorText ? errorText : statusText}\n {pollingElapsedMs != null && !Number.isNaN(pollingElapsedMs) && pollingElapsedMs > 0 && (\n <span className=\"w3a-email-recovery-elapsed\">\n (~{Math.round(pollingElapsedMs / 1000)}s).\n </span>\n )}\n {explorerToast && (\n <>\n <br/>\n <a className=\"w3a-email-recovery-link\" href={explorerToast.url} target=\"_blank\"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AAU;iBAA6B;;MAE7C,6BAA6B,cAC5B,2CAAC;OAAI,WAAU;iBAA6B;;MAE7C,6BAA6B,WAC5B,2CAAC,mBAAI;;KAIV,CAAC,CAAC,eAAe,UAAU,CAAC,8BAC3B,2CAAC;MAAI,WAAU;gBACZ,mBAAmB,SAChB,sDAAsD,mBAAmB,OAAO,KAChF;;;;GAKV,4CAAC;IAAI,WAAU;;MACX,CAAC,oBAAoB,CAAC,WACtB,2CAAC;MACC,SAAS;MACT,WAAU;MACV,UAAU;gBAET,qBACG,8BACA,6BACE,kCACA,uCACE,2BACC,SAAS,aAAa;;KAIlC,oBACC,4CAAC;MACC,MAAK;MACL,eAAe,iCAAiC;MAChD,WAAU;MACV,UAAU,kBAAkB;MAC5B,aAAW,kBAAkB;iBAE5B,kBAAkB,aAAa,2CAAC;OAAK,WAAU;OAAc,eAAY;UACzE,kBAAkB,YAAY,mBAAmB;;KAIrD,aAAa,cACZ,2CAAC;MACC,MAAK;MACL,SAAS;MACT,WAAU;MACV,UAAU;gBACX;;;;IAMH,aAAa,cAAc,kBAC3B,4CAAC;IAAI,WAAW,4BAA4B,YAAY,cAAc;;KACnE,YAAY,YAAY;KACxB,oBAAoB,QAAQ,CAAC,OAAO,MAAM,qBAAqB,mBAAmB,KACjF,4CAAC;MAAK,WAAU;;OAA6B;OACxC,KAAK,MAAM,mBAAmB;OAAM;;;KAG1C,iBACC,qFACE,2CAAC,WACD,2CAAC;MAAE,WAAU;MAA0B,MAAM,cAAc;MAAK,QAAO;MAAS,KAAI;gBAAsB"}
|
package/dist/cjs/react/components/{ShowQRCode-CCN4h6Uv.css.map → ShowQRCode-CB0UCQ_h.css.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowQRCode-
|
|
1
|
+
{"version":3,"file":"ShowQRCode-CB0UCQ_h.css","names":[],"sources":["../../../../src/react/components/ShowQRCode.css"],"sourcesContent":[".qr-code-container {\n padding-top: 1rem;\n}\n\n/* Modal Header */\n.qr-header {\n position: relative;\n display: grid;\n place-content: center;\n padding: 0rem;\n}\n\n.qr-title {\n font-size: 1.5rem;\n font-weight: 700;\n color: var(--w3a-colors-textPrimary, #1e293b);\n padding-top: 0rem;\n margin: 0;\n}\n\n.qr-body {\n padding: 0rem;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.qr-code-section {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n/* QR Code Display */\n.qr-code-display {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0rem;\n padding: 1rem;\n border-radius: 1.5rem;\n width: 100%;\n max-width: 300px;\n}\n\n.qr-instruction, .qr-status {\n margin: 0;\n font-size: 1rem;\n font-weight: 500;\n line-height: 1.5;\n color: var(--w3a-colors-textSecondary, #1e293b);\n text-align: center;\n}\n\n.qr-status {\n margin-bottom: 0.5rem;\n}\n\n.animated-ellipsis {\n display: inline-block;\n width: 1.2em;\n text-align: left;\n}\n\n.animated-ellipsis::after {\n content: \"...\";\n animation: ellipsis 1.5s infinite;\n}\n\n@keyframes ellipsis {\n 0% { content: \"...\"; }\n 25% { content: \"\"; }\n 50% { content: \".\"; }\n 75% { content: \"..\"; }\n 100% { content: \"...\"; }\n}\n\n.qr-code-image {\n max-width: 200px;\n height: auto;\n border-radius: var(--w3a-border-radius-md, 0.5rem);\n}\n\n.qr-loading {\n text-align: center;\n padding: 2rem;\n color: var(--w3a-colors-textSecondary, #64748b);\n}\n\n/* Responsive Design */\n@media (max-width: 768px) {\n .qr-modal-content {\n margin: 1rem;\n max-width: calc(100vw - 2rem);\n }\n\n @supports (width: 1dvw) {\n .qr-modal-content { max-width: calc(100dvw - 2rem); }\n }\n\n .qr-code-image {\n max-width: 200px;\n }\n\n .qr-code-display {\n padding: 1rem;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
|
|
5
|
+
//#region src/react/context/useSDKFlowRuntime.ts
|
|
6
|
+
const MAX_EVENT_LINES = 6;
|
|
7
|
+
const createDeferred = () => {
|
|
8
|
+
let resolve;
|
|
9
|
+
let reject;
|
|
10
|
+
const promise = new Promise((res, rej) => {
|
|
11
|
+
resolve = res;
|
|
12
|
+
reject = rej;
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
promise,
|
|
16
|
+
resolve,
|
|
17
|
+
reject,
|
|
18
|
+
settled: false
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const withTimeout = async (promise, timeoutMs) => {
|
|
22
|
+
if (timeoutMs <= 0) return await promise;
|
|
23
|
+
return await new Promise((resolve, reject) => {
|
|
24
|
+
const timeoutId = setTimeout(() => reject(/* @__PURE__ */ new Error("Operation timed out")), timeoutMs);
|
|
25
|
+
promise.then((value) => {
|
|
26
|
+
clearTimeout(timeoutId);
|
|
27
|
+
resolve(value);
|
|
28
|
+
}, (error) => {
|
|
29
|
+
clearTimeout(timeoutId);
|
|
30
|
+
reject(error);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
function useSDKFlowRuntime() {
|
|
35
|
+
const sdkFlowSeqRef = (0, react.useRef)(0);
|
|
36
|
+
const sdkFlowStartWaitersRef = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
37
|
+
const sdkFlowCompletionDeferredsRef = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
38
|
+
const [sdkFlowState, setSdkFlowState] = (0, react.useState)({
|
|
39
|
+
seq: 0,
|
|
40
|
+
kind: null,
|
|
41
|
+
status: "idle",
|
|
42
|
+
eventsText: ""
|
|
43
|
+
});
|
|
44
|
+
const sdkFlowRef = (0, react.useRef)(sdkFlowState);
|
|
45
|
+
(0, react.useEffect)(() => {
|
|
46
|
+
sdkFlowRef.current = sdkFlowState;
|
|
47
|
+
sdkFlowSeqRef.current = sdkFlowState.seq;
|
|
48
|
+
}, [sdkFlowState]);
|
|
49
|
+
const beginSdkFlow = (0, react.useCallback)((kind, accountId) => {
|
|
50
|
+
const prev = sdkFlowRef.current;
|
|
51
|
+
const prevDeferred = sdkFlowCompletionDeferredsRef.current.get(prev.seq);
|
|
52
|
+
if (prevDeferred && !prevDeferred.settled && prev.status === "in-progress") {
|
|
53
|
+
prevDeferred.settled = true;
|
|
54
|
+
prevDeferred.reject(/* @__PURE__ */ new Error("SDK flow superseded"));
|
|
55
|
+
sdkFlowCompletionDeferredsRef.current.delete(prev.seq);
|
|
56
|
+
}
|
|
57
|
+
const seq = sdkFlowSeqRef.current += 1;
|
|
58
|
+
const next = {
|
|
59
|
+
seq,
|
|
60
|
+
kind,
|
|
61
|
+
status: "in-progress",
|
|
62
|
+
eventsText: "",
|
|
63
|
+
...accountId ? { accountId } : {}
|
|
64
|
+
};
|
|
65
|
+
sdkFlowRef.current = next;
|
|
66
|
+
setSdkFlowState(next);
|
|
67
|
+
sdkFlowCompletionDeferredsRef.current.set(seq, createDeferred());
|
|
68
|
+
const waiters = sdkFlowStartWaitersRef.current;
|
|
69
|
+
for (const waiter of Array.from(waiters)) {
|
|
70
|
+
if (waiter.kind !== kind) continue;
|
|
71
|
+
if (seq <= waiter.seqAfter) continue;
|
|
72
|
+
clearTimeout(waiter.timeoutId);
|
|
73
|
+
waiters.delete(waiter);
|
|
74
|
+
waiter.resolve(seq);
|
|
75
|
+
}
|
|
76
|
+
return seq;
|
|
77
|
+
}, []);
|
|
78
|
+
const appendSdkEventMessage = (0, react.useCallback)((seq, message) => {
|
|
79
|
+
const trimmed = message.trim();
|
|
80
|
+
if (!trimmed) return;
|
|
81
|
+
setSdkFlowState((prev) => {
|
|
82
|
+
if (prev.seq !== seq || prev.status !== "in-progress") return prev;
|
|
83
|
+
const lines = prev.eventsText ? prev.eventsText.split("\n") : [];
|
|
84
|
+
const last = lines[lines.length - 1];
|
|
85
|
+
if (last === trimmed) return prev;
|
|
86
|
+
const nextLines = [...lines, trimmed].slice(-MAX_EVENT_LINES);
|
|
87
|
+
const next = {
|
|
88
|
+
...prev,
|
|
89
|
+
eventsText: nextLines.join("\n")
|
|
90
|
+
};
|
|
91
|
+
sdkFlowRef.current = next;
|
|
92
|
+
return next;
|
|
93
|
+
});
|
|
94
|
+
}, []);
|
|
95
|
+
const endSdkFlow = (0, react.useCallback)((kind, seq, status, error) => {
|
|
96
|
+
const current = sdkFlowRef.current;
|
|
97
|
+
const snapshot = current.seq === seq && current.kind === kind ? {
|
|
98
|
+
...current,
|
|
99
|
+
status,
|
|
100
|
+
...error ? { error } : {}
|
|
101
|
+
} : {
|
|
102
|
+
seq,
|
|
103
|
+
kind,
|
|
104
|
+
status,
|
|
105
|
+
eventsText: "",
|
|
106
|
+
...error ? { error } : {}
|
|
107
|
+
};
|
|
108
|
+
if (current.seq === seq && current.kind === kind) {
|
|
109
|
+
sdkFlowRef.current = snapshot;
|
|
110
|
+
setSdkFlowState(snapshot);
|
|
111
|
+
}
|
|
112
|
+
const deferred = sdkFlowCompletionDeferredsRef.current.get(seq);
|
|
113
|
+
if (deferred && !deferred.settled) {
|
|
114
|
+
deferred.settled = true;
|
|
115
|
+
sdkFlowCompletionDeferredsRef.current.delete(seq);
|
|
116
|
+
if (status === "error") deferred.reject(new Error(error || "Operation failed"));
|
|
117
|
+
else deferred.resolve(snapshot);
|
|
118
|
+
}
|
|
119
|
+
}, []);
|
|
120
|
+
const awaitNextStart = (0, react.useCallback)(async (kind, seqAfter, timeoutMs) => {
|
|
121
|
+
const current = sdkFlowRef.current;
|
|
122
|
+
if (current.kind === kind && current.seq > seqAfter) return current.seq;
|
|
123
|
+
return await new Promise((resolve) => {
|
|
124
|
+
const waiter = {
|
|
125
|
+
kind,
|
|
126
|
+
seqAfter,
|
|
127
|
+
resolve: (seq) => resolve(seq),
|
|
128
|
+
timeoutId: setTimeout(() => {
|
|
129
|
+
sdkFlowStartWaitersRef.current.delete(waiter);
|
|
130
|
+
resolve(null);
|
|
131
|
+
}, timeoutMs)
|
|
132
|
+
};
|
|
133
|
+
sdkFlowStartWaitersRef.current.add(waiter);
|
|
134
|
+
});
|
|
135
|
+
}, []);
|
|
136
|
+
const awaitCompletion = (0, react.useCallback)(async (seq, timeoutMs) => {
|
|
137
|
+
const current = sdkFlowRef.current;
|
|
138
|
+
if (current.seq === seq && current.status !== "in-progress") {
|
|
139
|
+
if (current.status === "error") throw new Error(current.error || "Operation failed");
|
|
140
|
+
return current;
|
|
141
|
+
}
|
|
142
|
+
const deferred = sdkFlowCompletionDeferredsRef.current.get(seq);
|
|
143
|
+
if (!deferred) throw new Error("Unknown SDK flow sequence");
|
|
144
|
+
return await withTimeout(deferred.promise, timeoutMs);
|
|
145
|
+
}, []);
|
|
146
|
+
const awaitNextCompletion = (0, react.useCallback)(async (kind, seqAfter, startTimeoutMs, completionTimeoutMs) => {
|
|
147
|
+
const seq = await awaitNextStart(kind, seqAfter, startTimeoutMs);
|
|
148
|
+
if (seq == null) return;
|
|
149
|
+
await awaitCompletion(seq, completionTimeoutMs);
|
|
150
|
+
}, [awaitCompletion, awaitNextStart]);
|
|
151
|
+
const sdkFlow = (0, react.useMemo)(() => ({
|
|
152
|
+
...sdkFlowState,
|
|
153
|
+
awaitCompletion,
|
|
154
|
+
awaitNextStart,
|
|
155
|
+
awaitNextCompletion
|
|
156
|
+
}), [
|
|
157
|
+
awaitCompletion,
|
|
158
|
+
awaitNextCompletion,
|
|
159
|
+
awaitNextStart,
|
|
160
|
+
sdkFlowState
|
|
161
|
+
]);
|
|
162
|
+
(0, react.useEffect)(() => {
|
|
163
|
+
return () => {
|
|
164
|
+
for (const waiter of sdkFlowStartWaitersRef.current) clearTimeout(waiter.timeoutId);
|
|
165
|
+
sdkFlowStartWaitersRef.current.clear();
|
|
166
|
+
for (const deferred of sdkFlowCompletionDeferredsRef.current.values()) if (!deferred.settled) {
|
|
167
|
+
deferred.settled = true;
|
|
168
|
+
deferred.reject(/* @__PURE__ */ new Error("SDK flow canceled"));
|
|
169
|
+
}
|
|
170
|
+
sdkFlowCompletionDeferredsRef.current.clear();
|
|
171
|
+
};
|
|
172
|
+
}, []);
|
|
173
|
+
return {
|
|
174
|
+
sdkFlow,
|
|
175
|
+
beginSdkFlow,
|
|
176
|
+
appendSdkEventMessage,
|
|
177
|
+
endSdkFlow
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
//#endregion
|
|
182
|
+
exports.useSDKFlowRuntime = useSDKFlowRuntime;
|
|
183
|
+
//# sourceMappingURL=useSDKFlowRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSDKFlowRuntime.js","names":["resolve!: (value: T) => void","reject!: (error: Error) => void","next: SDKFlowState","snapshot: SDKFlowState","awaitNextStart: SDKFlowRuntime['awaitNextStart']","waiter: StartWaiter","awaitCompletion: SDKFlowRuntime['awaitCompletion']","awaitNextCompletion: SDKFlowRuntime['awaitNextCompletion']","sdkFlow: SDKFlowRuntime"],"sources":["../../../../src/react/context/useSDKFlowRuntime.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { SDKFlowRuntime, SDKFlowState } from '../types';\n\ntype FlowKind = Exclude<SDKFlowState['kind'], null>;\n\nconst MAX_EVENT_LINES = 6;\n\ntype Deferred<T> = {\n promise: Promise<T>;\n resolve: (value: T) => void;\n reject: (error: Error) => void;\n settled: boolean;\n};\n\ntype StartWaiter = {\n kind: FlowKind;\n seqAfter: number;\n resolve: (seq: number) => void;\n timeoutId: ReturnType<typeof setTimeout>;\n};\n\nconst createDeferred = <T,>(): Deferred<T> => {\n let resolve!: (value: T) => void;\n let reject!: (error: Error) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject, settled: false };\n};\n\nconst withTimeout = async <T,>(promise: Promise<T>, timeoutMs: number): Promise<T> => {\n if (timeoutMs <= 0) return await promise;\n return await new Promise<T>((resolve, reject) => {\n const timeoutId = setTimeout(() => reject(new Error('Operation timed out')), timeoutMs);\n promise.then(\n (value) => {\n clearTimeout(timeoutId);\n resolve(value);\n },\n (error) => {\n clearTimeout(timeoutId);\n reject(error);\n },\n );\n });\n};\n\nexport function useSDKFlowRuntime(): {\n sdkFlow: SDKFlowRuntime;\n beginSdkFlow: (kind: FlowKind, accountId?: string) => number;\n appendSdkEventMessage: (seq: number, message: string) => void;\n endSdkFlow: (kind: FlowKind, seq: number, status: 'success' | 'error', error?: string) => void;\n} {\n const sdkFlowSeqRef = useRef(0);\n const sdkFlowStartWaitersRef = useRef<Set<StartWaiter>>(new Set());\n const sdkFlowCompletionDeferredsRef = useRef<Map<number, Deferred<SDKFlowState>>>(new Map());\n\n const [sdkFlowState, setSdkFlowState] = useState<SDKFlowState>({\n seq: 0,\n kind: null,\n status: 'idle',\n eventsText: '',\n });\n\n const sdkFlowRef = useRef<SDKFlowState>(sdkFlowState);\n useEffect(() => {\n sdkFlowRef.current = sdkFlowState;\n sdkFlowSeqRef.current = sdkFlowState.seq;\n }, [sdkFlowState]);\n\n const beginSdkFlow = useCallback((kind: FlowKind, accountId?: string): number => {\n const prev = sdkFlowRef.current;\n const prevDeferred = sdkFlowCompletionDeferredsRef.current.get(prev.seq);\n if (prevDeferred && !prevDeferred.settled && prev.status === 'in-progress') {\n prevDeferred.settled = true;\n prevDeferred.reject(new Error('SDK flow superseded'));\n sdkFlowCompletionDeferredsRef.current.delete(prev.seq);\n }\n\n const seq = (sdkFlowSeqRef.current += 1);\n const next: SDKFlowState = {\n seq,\n kind,\n status: 'in-progress',\n eventsText: '',\n ...(accountId ? { accountId } : {}),\n };\n\n sdkFlowRef.current = next;\n setSdkFlowState(next);\n\n sdkFlowCompletionDeferredsRef.current.set(seq, createDeferred<SDKFlowState>());\n\n const waiters = sdkFlowStartWaitersRef.current;\n for (const waiter of Array.from(waiters)) {\n if (waiter.kind !== kind) continue;\n if (seq <= waiter.seqAfter) continue;\n clearTimeout(waiter.timeoutId);\n waiters.delete(waiter);\n waiter.resolve(seq);\n }\n\n return seq;\n }, []);\n\n const appendSdkEventMessage = useCallback((seq: number, message: string) => {\n const trimmed = message.trim();\n if (!trimmed) return;\n\n setSdkFlowState((prev) => {\n if (prev.seq !== seq || prev.status !== 'in-progress') return prev;\n const lines = prev.eventsText ? prev.eventsText.split('\\n') : [];\n const last = lines[lines.length - 1];\n if (last === trimmed) return prev;\n const nextLines = [...lines, trimmed].slice(-MAX_EVENT_LINES);\n const next = { ...prev, eventsText: nextLines.join('\\n') };\n sdkFlowRef.current = next;\n return next;\n });\n }, []);\n\n const endSdkFlow = useCallback((kind: FlowKind, seq: number, status: 'success' | 'error', error?: string) => {\n const current = sdkFlowRef.current;\n const snapshot: SDKFlowState =\n current.seq === seq && current.kind === kind\n ? { ...current, status, ...(error ? { error } : {}) }\n : { seq, kind, status, eventsText: '', ...(error ? { error } : {}) };\n\n if (current.seq === seq && current.kind === kind) {\n sdkFlowRef.current = snapshot;\n setSdkFlowState(snapshot);\n }\n\n const deferred = sdkFlowCompletionDeferredsRef.current.get(seq);\n if (deferred && !deferred.settled) {\n deferred.settled = true;\n sdkFlowCompletionDeferredsRef.current.delete(seq);\n if (status === 'error') {\n deferred.reject(new Error(error || 'Operation failed'));\n } else {\n deferred.resolve(snapshot);\n }\n }\n }, []);\n\n const awaitNextStart: SDKFlowRuntime['awaitNextStart'] = useCallback(async (kind, seqAfter, timeoutMs) => {\n const current = sdkFlowRef.current;\n if (current.kind === kind && current.seq > seqAfter) return current.seq;\n\n return await new Promise<number | null>((resolve) => {\n const waiter: StartWaiter = {\n kind,\n seqAfter,\n resolve: (seq) => resolve(seq),\n timeoutId: setTimeout(() => {\n sdkFlowStartWaitersRef.current.delete(waiter);\n resolve(null);\n }, timeoutMs),\n };\n sdkFlowStartWaitersRef.current.add(waiter);\n });\n }, []);\n\n const awaitCompletion: SDKFlowRuntime['awaitCompletion'] = useCallback(async (seq, timeoutMs) => {\n const current = sdkFlowRef.current;\n if (current.seq === seq && current.status !== 'in-progress') {\n if (current.status === 'error') throw new Error(current.error || 'Operation failed');\n return current;\n }\n\n const deferred = sdkFlowCompletionDeferredsRef.current.get(seq);\n if (!deferred) throw new Error('Unknown SDK flow sequence');\n return await withTimeout(deferred.promise, timeoutMs);\n }, []);\n\n const awaitNextCompletion: SDKFlowRuntime['awaitNextCompletion'] = useCallback(\n async (kind, seqAfter, startTimeoutMs, completionTimeoutMs) => {\n const seq = await awaitNextStart(kind, seqAfter, startTimeoutMs);\n if (seq == null) return;\n await awaitCompletion(seq, completionTimeoutMs);\n },\n [awaitCompletion, awaitNextStart],\n );\n\n const sdkFlow: SDKFlowRuntime = useMemo(\n () => ({\n ...sdkFlowState,\n awaitCompletion,\n awaitNextStart,\n awaitNextCompletion,\n }),\n [awaitCompletion, awaitNextCompletion, awaitNextStart, sdkFlowState],\n );\n\n useEffect(() => {\n return () => {\n for (const waiter of sdkFlowStartWaitersRef.current) {\n clearTimeout(waiter.timeoutId);\n }\n sdkFlowStartWaitersRef.current.clear();\n for (const deferred of sdkFlowCompletionDeferredsRef.current.values()) {\n if (!deferred.settled) {\n deferred.settled = true;\n deferred.reject(new Error('SDK flow canceled'));\n }\n }\n sdkFlowCompletionDeferredsRef.current.clear();\n };\n }, []);\n\n return {\n sdkFlow,\n beginSdkFlow,\n appendSdkEventMessage,\n endSdkFlow,\n };\n}\n\nexport default useSDKFlowRuntime;\n"],"mappings":";;;;;AAKA,MAAM,kBAAkB;AAgBxB,MAAM,uBAAwC;CAC5C,IAAIA;CACJ,IAAIC;CACJ,MAAM,UAAU,IAAI,SAAY,KAAK,QAAQ;AAC3C,YAAU;AACV,WAAS;;AAEX,QAAO;EAAE;EAAS;EAAS;EAAQ,SAAS;;;AAG9C,MAAM,cAAc,OAAW,SAAqB,cAAkC;AACpF,KAAI,aAAa,EAAG,QAAO,MAAM;AACjC,QAAO,MAAM,IAAI,SAAY,SAAS,WAAW;EAC/C,MAAM,YAAY,iBAAiB,uBAAO,IAAI,MAAM,yBAAyB;AAC7E,UAAQ,MACL,UAAU;AACT,gBAAa;AACb,WAAQ;MAET,UAAU;AACT,gBAAa;AACb,UAAO;;;;AAMf,SAAgB,oBAKd;CACA,MAAM,kCAAuB;CAC7B,MAAM,2DAAkD,IAAI;CAC5D,MAAM,kEAA4E,IAAI;CAEtF,MAAM,CAAC,cAAc,uCAA0C;EAC7D,KAAK;EACL,MAAM;EACN,QAAQ;EACR,YAAY;;CAGd,MAAM,+BAAkC;AACxC,4BAAgB;AACd,aAAW,UAAU;AACrB,gBAAc,UAAU,aAAa;IACpC,CAAC;CAEJ,MAAM,uCAA4B,MAAgB,cAA+B;EAC/E,MAAM,OAAO,WAAW;EACxB,MAAM,eAAe,8BAA8B,QAAQ,IAAI,KAAK;AACpE,MAAI,gBAAgB,CAAC,aAAa,WAAW,KAAK,WAAW,eAAe;AAC1E,gBAAa,UAAU;AACvB,gBAAa,uBAAO,IAAI,MAAM;AAC9B,iCAA8B,QAAQ,OAAO,KAAK;;EAGpD,MAAM,MAAO,cAAc,WAAW;EACtC,MAAMC,OAAqB;GACzB;GACA;GACA,QAAQ;GACR,YAAY;GACZ,GAAI,YAAY,EAAE,c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|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
2
|
const require_sdkSentEvents = require('../sdk/src/core/types/sdkSentEvents.js');
|
|
3
|
+
const require_useSDKFlowRuntime = require('./useSDKFlowRuntime.js');
|
|
4
|
+
const require_useTatchiWithSdkFlow = require('./useTatchiWithSdkFlow.js');
|
|
3
5
|
let react = require("react");
|
|
4
6
|
react = require_rolldown_runtime.__toESM(react);
|
|
5
7
|
|
|
@@ -7,6 +9,13 @@ react = require_rolldown_runtime.__toESM(react);
|
|
|
7
9
|
require_sdkSentEvents.init_sdkSentEvents();
|
|
8
10
|
function useTatchiContextValue(args) {
|
|
9
11
|
const { tatchi, loginState, setLoginState, walletIframeConnected, refreshLoginState, accountInputState, setInputUsername, refreshAccountData } = args;
|
|
12
|
+
const { sdkFlow, beginSdkFlow, appendSdkEventMessage, endSdkFlow } = require_useSDKFlowRuntime.useSDKFlowRuntime();
|
|
13
|
+
const tatchiWithSdkFlow = require_useTatchiWithSdkFlow.useTatchiWithSdkFlow({
|
|
14
|
+
tatchi,
|
|
15
|
+
beginSdkFlow,
|
|
16
|
+
appendSdkEventMessage,
|
|
17
|
+
endSdkFlow
|
|
18
|
+
});
|
|
10
19
|
const logout = (0, react.useCallback)(() => {
|
|
11
20
|
try {
|
|
12
21
|
tatchi.logoutAndClearSession().catch((error) => {
|
|
@@ -23,10 +32,10 @@ function useTatchiContextValue(args) {
|
|
|
23
32
|
}));
|
|
24
33
|
}, [setLoginState, tatchi]);
|
|
25
34
|
const loginAndCreateSession = (0, react.useCallback)(async (nearAccountId, options) => {
|
|
26
|
-
return
|
|
35
|
+
return tatchiWithSdkFlow.loginAndCreateSession(nearAccountId, {
|
|
27
36
|
...options,
|
|
28
37
|
onEvent: async (event) => {
|
|
29
|
-
if (event.phase ===
|
|
38
|
+
if (event.phase === require_sdkSentEvents.LoginPhase.STEP_4_LOGIN_COMPLETE && event.status === require_sdkSentEvents.LoginStatus.SUCCESS) {
|
|
30
39
|
const { login } = await tatchi.getLoginSession(nearAccountId);
|
|
31
40
|
const isVRFLoggedIn = login.vrfActive;
|
|
32
41
|
setLoginState((prevState) => ({
|
|
@@ -36,27 +45,25 @@ function useTatchiContextValue(args) {
|
|
|
36
45
|
nearPublicKey: event.clientNearPublicKey || null
|
|
37
46
|
}));
|
|
38
47
|
}
|
|
39
|
-
options?.onEvent?.(event);
|
|
48
|
+
return options?.onEvent?.(event);
|
|
40
49
|
},
|
|
41
50
|
onError: (error) => {
|
|
42
51
|
logout();
|
|
43
|
-
options?.onError?.(error);
|
|
52
|
+
return options?.onError?.(error);
|
|
44
53
|
}
|
|
45
54
|
});
|
|
46
55
|
}, [
|
|
47
56
|
logout,
|
|
48
57
|
setLoginState,
|
|
49
|
-
tatchi
|
|
58
|
+
tatchi,
|
|
59
|
+
tatchiWithSdkFlow
|
|
50
60
|
]);
|
|
51
61
|
const registerPasskey = (0, react.useCallback)(async (nearAccountId, options) => {
|
|
52
|
-
const result = await
|
|
62
|
+
const result = await tatchiWithSdkFlow.registerPasskey(nearAccountId, {
|
|
53
63
|
...options,
|
|
54
|
-
onEvent: async (event) => {
|
|
55
|
-
options?.onEvent?.(event);
|
|
56
|
-
},
|
|
57
64
|
onError: (error) => {
|
|
58
65
|
logout();
|
|
59
|
-
options?.onError?.(error);
|
|
66
|
+
return options?.onError?.(error);
|
|
60
67
|
}
|
|
61
68
|
});
|
|
62
69
|
if (result?.success) await refreshLoginState(nearAccountId);
|
|
@@ -64,11 +71,11 @@ function useTatchiContextValue(args) {
|
|
|
64
71
|
}, [
|
|
65
72
|
logout,
|
|
66
73
|
refreshLoginState,
|
|
67
|
-
|
|
74
|
+
tatchiWithSdkFlow
|
|
68
75
|
]);
|
|
69
76
|
const recoverAccount = (0, react.useCallback)((args$1) => {
|
|
70
|
-
return
|
|
71
|
-
}, [
|
|
77
|
+
return tatchiWithSdkFlow.recoverAccountFlow(args$1);
|
|
78
|
+
}, [tatchiWithSdkFlow]);
|
|
72
79
|
const startDevice2LinkingFlow = (0, react.useCallback)(async (args$1) => {
|
|
73
80
|
const base = args$1 ?? {};
|
|
74
81
|
const options = base.options;
|
|
@@ -114,7 +121,8 @@ function useTatchiContextValue(args) {
|
|
|
114
121
|
return tatchi.viewAccessKeyList(accountId);
|
|
115
122
|
}, [tatchi]);
|
|
116
123
|
return (0, react.useMemo)(() => ({
|
|
117
|
-
tatchi,
|
|
124
|
+
tatchi: tatchiWithSdkFlow,
|
|
125
|
+
sdkFlow,
|
|
118
126
|
registerPasskey,
|
|
119
127
|
loginAndCreateSession,
|
|
120
128
|
logout,
|
|
@@ -137,7 +145,8 @@ function useTatchiContextValue(args) {
|
|
|
137
145
|
getConfirmationConfig,
|
|
138
146
|
viewAccessKeyList
|
|
139
147
|
}), [
|
|
140
|
-
|
|
148
|
+
tatchiWithSdkFlow,
|
|
149
|
+
sdkFlow,
|
|
141
150
|
registerPasskey,
|
|
142
151
|
loginAndCreateSession,
|
|
143
152
|
logout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTatchiContextValue.js","names":["logout: TatchiContextType['logout']","loginAndCreateSession: TatchiContextType['loginAndCreateSession']","registerPasskey: TatchiContextType['registerPasskey']","result: RegistrationResult","recoverAccount: TatchiContextType['recoverAccount']","args","startDevice2LinkingFlow: TatchiContextType['startDevice2LinkingFlow']","DeviceLinkingPhase","stopDevice2LinkingFlow: TatchiContextType['stopDevice2LinkingFlow']","executeAction: TatchiContextType['executeAction']","signNEP413Message: TatchiContextType['signNEP413Message']","signDelegateAction: TatchiContextType['signDelegateAction']","getLoginSession: TatchiContextType['getLoginSession']","setConfirmBehavior: TatchiContextType['setConfirmBehavior']","setConfirmationConfig: TatchiContextType['setConfirmationConfig']","setUserTheme: TatchiContextType['setUserTheme']","getConfirmationConfig: TatchiContextType['getConfirmationConfig']","viewAccessKeyList: TatchiContextType['viewAccessKeyList']"],"sources":["../../../../src/react/context/useTatchiContextValue.ts"],"sourcesContent":["import { useCallback, useMemo } from 'react';\nimport type { Dispatch, SetStateAction } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"useTatchiContextValue.js","names":["useSDKFlowRuntime","useTatchiWithSdkFlow","logout: TatchiContextType['logout']","loginAndCreateSession: TatchiContextType['loginAndCreateSession']","LoginPhase","LoginStatus","registerPasskey: TatchiContextType['registerPasskey']","result: RegistrationResult","recoverAccount: TatchiContextType['recoverAccount']","args","startDevice2LinkingFlow: TatchiContextType['startDevice2LinkingFlow']","DeviceLinkingPhase","stopDevice2LinkingFlow: TatchiContextType['stopDevice2LinkingFlow']","executeAction: TatchiContextType['executeAction']","signNEP413Message: TatchiContextType['signNEP413Message']","signDelegateAction: TatchiContextType['signDelegateAction']","getLoginSession: TatchiContextType['getLoginSession']","setConfirmBehavior: TatchiContextType['setConfirmBehavior']","setConfirmationConfig: TatchiContextType['setConfirmationConfig']","setUserTheme: TatchiContextType['setUserTheme']","getConfirmationConfig: TatchiContextType['getConfirmationConfig']","viewAccessKeyList: TatchiContextType['viewAccessKeyList']"],"sources":["../../../../src/react/context/useTatchiContextValue.ts"],"sourcesContent":["import { useCallback, useMemo } from 'react';\nimport type { Dispatch, SetStateAction } from 'react';\nimport {\n DeviceLinkingPhase,\n LoginPhase,\n LoginStatus,\n} from '@/core/types/sdkSentEvents';\nimport type {\n AccountInputState,\n DeviceLinkingSSEEvent,\n LoginState,\n RegistrationResult,\n TatchiContextType,\n} from '../types';\nimport { useSDKFlowRuntime } from './useSDKFlowRuntime';\nimport { useTatchiWithSdkFlow } from './useTatchiWithSdkFlow';\n\nexport function useTatchiContextValue(args: {\n tatchi: TatchiContextType['tatchi'];\n loginState: LoginState;\n setLoginState: Dispatch<SetStateAction<LoginState>>;\n walletIframeConnected: boolean;\n refreshLoginState: TatchiContextType['refreshLoginState'];\n accountInputState: AccountInputState;\n setInputUsername: TatchiContextType['setInputUsername'];\n refreshAccountData: TatchiContextType['refreshAccountData'];\n}): TatchiContextType {\n const {\n tatchi,\n loginState,\n setLoginState,\n walletIframeConnected,\n refreshLoginState,\n accountInputState,\n setInputUsername,\n refreshAccountData,\n } = args;\n\n const { sdkFlow, beginSdkFlow, appendSdkEventMessage, endSdkFlow } = useSDKFlowRuntime();\n const tatchiWithSdkFlow = useTatchiWithSdkFlow({ tatchi, beginSdkFlow, appendSdkEventMessage, endSdkFlow });\n\n const logout: TatchiContextType['logout'] = useCallback(() => {\n try {\n void tatchi.logoutAndClearSession().catch((error) => {\n console.warn('VRF logout warning:', error);\n });\n } catch (error) {\n console.warn('VRF logout warning:', error);\n }\n\n setLoginState(prevState => ({\n ...prevState,\n isLoggedIn: false,\n nearAccountId: null,\n nearPublicKey: null,\n }));\n }, [setLoginState, tatchi]);\n\n const loginAndCreateSession: TatchiContextType['loginAndCreateSession'] = useCallback(async (nearAccountId, options) => {\n return tatchiWithSdkFlow.loginAndCreateSession(nearAccountId, {\n ...options,\n onEvent: async (event) => {\n if (event.phase === LoginPhase.STEP_4_LOGIN_COMPLETE && event.status === LoginStatus.SUCCESS) {\n const { login } = await tatchi.getLoginSession(nearAccountId);\n const isVRFLoggedIn = login.vrfActive;\n setLoginState(prevState => ({\n ...prevState,\n isLoggedIn: isVRFLoggedIn,\n nearAccountId: event.nearAccountId || null,\n nearPublicKey: event.clientNearPublicKey || null,\n }));\n }\n return options?.onEvent?.(event);\n },\n onError: (error) => {\n logout();\n return options?.onError?.(error);\n }\n });\n }, [logout, setLoginState, tatchi, tatchiWithSdkFlow]);\n\n const registerPasskey: TatchiContextType['registerPasskey'] = useCallback(async (nearAccountId, options) => {\n const result: RegistrationResult = await tatchiWithSdkFlow.registerPasskey(nearAccountId, {\n ...options,\n onError: (error) => {\n logout();\n return options?.onError?.(error);\n }\n });\n\n if (result?.success) {\n await refreshLoginState(nearAccountId);\n }\n return result;\n }, [logout, refreshLoginState, tatchiWithSdkFlow]);\n\n const recoverAccount: TatchiContextType['recoverAccount'] = useCallback((args) => {\n return tatchiWithSdkFlow.recoverAccountFlow(args);\n }, [tatchiWithSdkFlow]);\n\n const startDevice2LinkingFlow: TatchiContextType['startDevice2LinkingFlow'] = useCallback(async (args) => {\n const base = args ?? {};\n const options = base.options;\n return tatchi.startDevice2LinkingFlow({\n ...base,\n options: {\n ...(options || {}),\n onEvent: (event: DeviceLinkingSSEEvent) => {\n options?.onEvent?.(event);\n if (event.phase === DeviceLinkingPhase.STEP_7_LINKING_COMPLETE && event.status === 'success') {\n void refreshLoginState();\n }\n }\n }\n });\n }, [refreshLoginState, tatchi]);\n\n const stopDevice2LinkingFlow: TatchiContextType['stopDevice2LinkingFlow'] = useCallback(() => {\n return tatchi.stopDevice2LinkingFlow();\n }, [tatchi]);\n\n const executeAction: TatchiContextType['executeAction'] = useCallback((args) => {\n return tatchi.executeAction(args);\n }, [tatchi]);\n\n const signNEP413Message: TatchiContextType['signNEP413Message'] = useCallback((args) => {\n return tatchi.signNEP413Message(args);\n }, [tatchi]);\n\n const signDelegateAction: TatchiContextType['signDelegateAction'] = useCallback((args) => {\n return tatchi.signDelegateAction(args);\n }, [tatchi]);\n\n const getLoginSession: TatchiContextType['getLoginSession'] = useCallback((nearAccountId?: string) => {\n return tatchi.getLoginSession(nearAccountId);\n }, [tatchi]);\n\n const setConfirmBehavior: TatchiContextType['setConfirmBehavior'] = useCallback((behavior) => {\n tatchi.setConfirmBehavior(behavior);\n }, [tatchi]);\n\n const setConfirmationConfig: TatchiContextType['setConfirmationConfig'] = useCallback((config) => {\n tatchi.setConfirmationConfig(config);\n }, [tatchi]);\n\n const setUserTheme: TatchiContextType['setUserTheme'] = useCallback((theme) => {\n tatchi.setUserTheme(theme);\n }, [tatchi]);\n\n const getConfirmationConfig: TatchiContextType['getConfirmationConfig'] = useCallback(() => {\n return tatchi.getConfirmationConfig();\n }, [tatchi]);\n\n const viewAccessKeyList: TatchiContextType['viewAccessKeyList'] = useCallback((accountId: string) => {\n return tatchi.viewAccessKeyList(accountId);\n }, [tatchi]);\n\n return useMemo(() => ({\n tatchi: tatchiWithSdkFlow,\n sdkFlow,\n registerPasskey,\n loginAndCreateSession,\n logout,\n executeAction,\n signNEP413Message,\n signDelegateAction,\n recoverAccount,\n startDevice2LinkingFlow,\n stopDevice2LinkingFlow,\n getLoginSession,\n refreshLoginState,\n loginState,\n walletIframeConnected,\n accountInputState,\n setInputUsername,\n refreshAccountData,\n setConfirmBehavior,\n setConfirmationConfig,\n setUserTheme,\n getConfirmationConfig,\n viewAccessKeyList,\n }), [\n tatchiWithSdkFlow,\n sdkFlow,\n registerPasskey,\n loginAndCreateSession,\n logout,\n executeAction,\n signNEP413Message,\n signDelegateAction,\n recoverAccount,\n startDevice2LinkingFlow,\n stopDevice2LinkingFlow,\n getLoginSession,\n refreshLoginState,\n loginState,\n walletIframeConnected,\n accountInputState,\n setInputUsername,\n refreshAccountData,\n setConfirmBehavior,\n setConfirmationConfig,\n setUserTheme,\n getConfirmationConfig,\n viewAccessKeyList,\n ]);\n}\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,sBAAsB,MAShB;CACpB,MAAM,EACJ,QACA,YACA,eACA,uBACA,mBACA,mBACA,kBACA,uBACE;CAEJ,MAAM,EAAE,SAAS,cAAc,uBAAuB,eAAeA;CACrE,MAAM,oBAAoBC,kDAAqB;EAAE;EAAQ;EAAc;EAAuB;;CAE9F,MAAMC,sCAAwD;AAC5D,MAAI;AACF,GAAK,OAAO,wBAAwB,OAAO,UAAU;AACnD,YAAQ,KAAK,uBAAuB;;WAE/B,OAAO;AACd,WAAQ,KAAK,uBAAuB;;AAGtC,iBAAc,eAAc;GAC1B,GAAG;GACH,YAAY;GACZ,eAAe;GACf,eAAe;;IAEhB,CAAC,eAAe;CAEnB,MAAMC,+CAAgF,OAAO,eAAe,YAAY;AACtH,SAAO,kBAAkB,sBAAsB,eAAe;GAC5D,GAAG;GACH,SAAS,OAAO,UAAU;AACxB,QAAI,MAAM,UAAUC,iCAAW,yBAAyB,MAAM,WAAWC,kCAAY,SAAS;KAC5F,MAAM,EA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