@seams/wallet 0.26.0 → 0.28.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/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/publicApi/near.js +22 -11
- package/dist/esm/SeamsWeb/walletIframe/client/nearCommands.js +9 -10
- package/dist/esm/SeamsWeb/walletIframe/client/router.js +95 -38
- package/dist/esm/SeamsWeb/walletIframe/client/sessionCommands.js +16 -0
- package/dist/esm/SeamsWeb/walletIframe/host/surface-measurement-reporter.js +1 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +1 -1
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/mountAuthMenuSurface.js +28 -0
- package/dist/esm/SeamsWeb/walletIframe/host/walletMutationGuard.js +1 -0
- package/dist/esm/SeamsWeb/walletIframe/shared/exactSessionState.js +27 -4
- package/dist/esm/SeamsWeb/walletIframe/shared/messages.js +7 -1
- package/dist/esm/core/authMethods/plugins.js +8 -2
- package/dist/esm/core/rpcClients/near/NearClient.js +7 -0
- package/dist/esm/core/signingEngine/flows/signNear/signTransactions.js +3 -0
- package/dist/esm/core/signingEngine/nearTransactionSubmission.js +89 -0
- package/dist/esm/core/signingEngine/uiConfirm/ui/confirm-surface-resize.js +2 -2
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ReviewDisclosure.js +7 -1
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.js +123 -14
- package/dist/esm/core/ui/messages.js +17 -0
- package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonView.js +35 -22
- package/dist/esm/react/components/AccountMenuButton/AccountSettingsDialog.js +157 -0
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsModal.js +13 -1
- package/dist/esm/react/components/AccountMenuButton/ExternalWalletSettings.js +46 -0
- package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.js +14 -2
- package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/Web3AuthProfileButton.css +154 -5
- package/dist/esm/react/components/AccountMenuButton/icons/HoverArrowIcon.css +27 -3
- package/dist/esm/react/components/AccountMenuButton/icons/HoverArrowIcon.js +2 -2
- package/dist/esm/react/components/AccountMenuButton/index.js +7 -3
- package/dist/esm/react/components/ExternalNearWalletIcon.js +32 -0
- package/dist/esm/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.css +182 -0
- package/dist/esm/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.js +315 -0
- package/dist/esm/react/components/HostedSeamsAuthMenu/shell.js +13 -4
- package/dist/esm/react/components/externalWalletBrandImages.js +7 -0
- package/dist/esm/react/context/reactLoginStateBuilders.js +20 -0
- package/dist/esm/react/externalNear.js +2 -6
- package/dist/esm/react/index.js +2 -1
- package/dist/esm/react/styles/styles.css +364 -8
- package/dist/esm/react/styles.css +1 -0
- package/dist/esm/react/transactionReview/boundCalls.js +31 -26
- package/dist/esm/sdk/{ConfirmationDrawer-BmzikAr4.js → ConfirmationDrawer-MJoE0AAo.js} +1 -1
- package/dist/{public/sdk/NonceCoordinator-CcD2FqXh.js → esm/sdk/NonceCoordinator-3YhmDTS5.js} +1 -1
- package/dist/{public/sdk/SeamsWordmark-DqiC9-sd.js → esm/sdk/SeamsWordmark-DwvPx2UA.js} +1 -1
- package/dist/esm/sdk/{accountLifecycle-gm9X8nGm.js → accountLifecycle-6DHYWf0v.js} +1 -1
- package/dist/esm/sdk/{adapters-e7twFGov.js → adapters-C-g_hkkZ.js} +1 -1
- package/dist/esm/sdk/appearance-token-vars-01eH9pgA.js +1 -0
- package/dist/{public/sdk/clientSessionPersistenceState-YvVHKRoe.js → esm/sdk/clientSessionPersistenceState-BCkJAYSz.js} +1 -1
- package/dist/esm/sdk/{collectAuthenticationCredentialForChallengeB64u-DEtxiKND.js → collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js} +1 -1
- package/dist/esm/sdk/{commitQueue-CHJ7MHSI.js → commitQueue-CYruPlkm.js} +1 -1
- package/dist/esm/sdk/configBuilder-DpChXfDO.js +1 -0
- package/dist/esm/sdk/{configuration-DBEc3bsj.js → configuration-BAad7ngq.js} +1 -1
- package/dist/esm/sdk/confirm-ui-em0vkd2m.js +2 -0
- package/dist/esm/sdk/{device-linking-BsUTtSF7.js → device-linking-DiCNt3iA.js} +1 -1
- package/dist/esm/sdk/{deviceLinkApproval-DAZTjrud.js → deviceLinkApproval-x3WkiYrd.js} +1 -1
- package/dist/esm/sdk/{display-BYzolrBs.js → display-D0EPmU4w.js} +1 -1
- package/dist/{public/sdk/ecdsaCapabilityManifest-CXVq8Qzb.js → esm/sdk/ecdsaCapabilityManifest-DAJEVjlP.js} +1 -1
- package/dist/esm/sdk/{ecdsaDerivationClientWasm-CVahDxLy.js → ecdsaDerivationClientWasm-AYOJgTJm.js} +1 -1
- package/dist/{public/sdk/ecdsaDerivationExport-CkmSe0ao.js → esm/sdk/ecdsaDerivationExport-DJKOzDbS.js} +1 -1
- package/dist/esm/sdk/{ecdsaWalletRecords-zRvHKRTe.js → ecdsaWalletRecords-WLyq414E.js} +1 -1
- package/dist/esm/sdk/{emailOtpEcdsaDerivationIdentity-0DIuRNRi.js → emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js} +1 -1
- package/dist/esm/sdk/{enrichDisplayModelWithAbi-CLn37drs.js → enrichDisplayModelWithAbi-O6Mw4i2E.js} +1 -1
- package/dist/esm/sdk/errors-BJBDbwHk.js +1 -0
- package/dist/esm/sdk/{evmCryptoWasm-B_p82tx9.js → evmCryptoWasm-BUPb4hBH.js} +1 -1
- package/dist/esm/sdk/{export-viewer-host-3fosWJXJ.js → export-viewer-host-BSTfHhau.js} +1 -1
- package/dist/esm/sdk/{exportKeypairOperation-pKQW5J7m.js → exportKeypairOperation-CjST_NUK.js} +1 -1
- package/dist/esm/sdk/host-C51z-AxP.js +1 -0
- package/dist/{public/sdk/icons-DDRXJ2W1.js → esm/sdk/icons-BlMXolHv.js} +1 -1
- package/dist/esm/sdk/{indexedDB-CWFDCCbP.js → indexedDB-C4SDsyOG.js} +1 -1
- package/dist/esm/sdk/{intentDigest-B6EshTea.js → intentDigest-HvRsBQ1z.js} +1 -1
- package/dist/esm/sdk/{lanes-C2sAP08w.js → lanes-BU-fGqY4.js} +1 -1
- package/dist/esm/sdk/{localOnly-Jw9v9GU9.js → localOnly-Xs89Xajm.js} +1 -1
- package/dist/{public/sdk/mountExportPrivateKeySurface-B_052qyI.js → esm/sdk/mountExportPrivateKeySurface-CsUEKeum.js} +1 -1
- package/dist/esm/sdk/{mountRecoveryCodeBackupSurface-PutmFjf9.js → mountRecoveryCodeBackupSurface-kFLo5zLk.js} +1 -1
- package/dist/esm/sdk/{nearEd25519YaoMaterialActivation-C2QNLImD.js → nearEd25519YaoMaterialActivation-BfXmy3Jr.js} +1 -1
- package/dist/{public/sdk/nearEd25519YaoSigningPreparation-K6n4Sq8_.js → esm/sdk/nearEd25519YaoSigningPreparation-DHNk0F8e.js} +1 -1
- package/dist/esm/sdk/nearRpcResults-CeHdqaS4.js +1 -0
- package/dist/esm/sdk/{nonceLaneKeys-CZjeiii7.js → nonceLaneKeys-BF_UpvIy.js} +1 -1
- package/dist/esm/sdk/{normalization-DA6o5MsH.js → normalization-Df9fZWJC.js} +1 -1
- package/dist/{public/sdk/pendingWalletRecoveryCodeBackup-B-n7vmBS.js → esm/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js} +1 -1
- package/dist/esm/sdk/{presignaturePool-DjTaB0nx.js → presignaturePool-BbvqRWYw.js} +1 -1
- package/dist/esm/sdk/{recovery-entrypoint-9e3SXU3t.js → recovery-entrypoint-DJbMDC_m.js} +1 -1
- package/dist/esm/sdk/{registration-C988Nwzn.js → registration-Byl4l4yZ.js} +1 -1
- package/dist/esm/sdk/{registration-D4AijOa8.js → registration-C2fb9kRQ.js} +1 -1
- package/dist/esm/sdk/{registrationAccounts-DI_vcT7G.js → registrationAccounts-4r74gX1l.js} +1 -1
- package/dist/esm/sdk/registrationIntent-Do1tD1V7.js +1 -0
- package/dist/esm/sdk/{registrationSignerPlan-_8gsSjC0.js → registrationSignerPlan-DK2b3N_p.js} +1 -1
- package/dist/{public/sdk/requireStepUpAuth-DC9LSyRI.js → esm/sdk/requireStepUpAuth-COqCGb1i.js} +1 -1
- package/dist/esm/sdk/resealedEnvelopeResult-CLW00Vbw.js +1 -0
- package/dist/esm/sdk/{routerAbNormalSigning-Da-uxxle.js → routerAbNormalSigning-D-UZmCBS.js} +1 -1
- package/dist/esm/sdk/runtime-auth-ufbVur2p.js +1 -0
- package/dist/esm/sdk/{runtime-device-link-DtjR-htE.js → runtime-device-link-CagI2Q62.js} +1 -1
- package/dist/{public/sdk/runtime-ecdsa-tempo-BkUnzoX9.js → esm/sdk/runtime-ecdsa-tempo-Rctxr0yM.js} +1 -1
- package/dist/{public/sdk/runtime-email-otp-CaxfpqKI.js → esm/sdk/runtime-email-otp-BQtcG-LF.js} +1 -1
- package/dist/esm/sdk/{runtime-export-Du5ugbzi.js → runtime-export-wTeEaqlk.js} +1 -1
- package/dist/esm/sdk/runtime-near-59yU_3ud.js +1 -0
- package/dist/esm/sdk/runtime-preferences-B9qLHX8W.js +1 -0
- package/dist/esm/sdk/runtime-recovery-DNyzdMBj.js +1 -0
- package/dist/esm/sdk/{runtime-recovery-codes-DKjOU32G.js → runtime-recovery-codes-si1fGktB.js} +1 -1
- package/dist/esm/sdk/runtimeContext-ByeM6Z4Z.js +6 -0
- package/dist/{public/sdk/secp256k1--vF2pJgR.js → esm/sdk/secp256k1-CE7-q9Sn.js} +1 -1
- package/dist/esm/sdk/sessionObservationRevision-ihBwjS3y.js +1 -0
- package/dist/esm/sdk/{signEvmFamily-DeCQOBYN.js → signEvmFamily-BY5jlZEG.js} +1 -1
- package/dist/{public/sdk/signEvmFamilyWithUiConfirmForTempo-BIp-MeBV.js → esm/sdk/signEvmFamilyWithUiConfirmForTempo-CrMIAXUe.js} +1 -1
- package/dist/esm/sdk/{signEvmWithUiConfirm-BdLW7kqJ.js → signEvmWithUiConfirm-CGrLtMV6.js} +1 -1
- package/dist/esm/sdk/signNear-DMpJFkwF.js +1 -0
- package/dist/esm/sdk/{signatureUses-0z64Xpdj.js → signatureUses-kSrUHSSH.js} +1 -1
- package/dist/{public/sdk/signingFlow-C7fwkxPx.js → esm/sdk/signingFlow-BcetvUeS.js} +1 -1
- package/dist/{public/sdk/signingQueue-DvHGcaLc.js → esm/sdk/signingQueue-dMFOFOP5.js} +1 -1
- package/dist/esm/sdk/surface-measurement-reporter-DXsvq401.js +1 -0
- package/dist/esm/sdk/{thresholdEcdsa-CPVZNLEg.js → thresholdEcdsa-CqR1fFA-.js} +1 -1
- package/dist/esm/sdk/{trace-BQv7E-bO.js → trace--mRP2OQc.js} +1 -1
- package/dist/esm/sdk/{transaction-activity-olcDRay5.js → transaction-activity-DCzHGg3b.js} +1 -1
- package/dist/esm/sdk/{transactionReviewAdmission-DPxuDgkU.js → transactionReviewAdmission-Cf_qUZJt.js} +1 -1
- package/dist/esm/sdk/{transactionState-C8aYSDRA.js → transactionState-29T9xfvL.js} +1 -1
- package/dist/esm/sdk/tx-confirm-ui.js +181 -18
- package/dist/esm/sdk/{types-DOToeB6g.js → types-f7dyj5N6.js} +1 -1
- package/dist/esm/sdk/{unlockedEd25519ExportRootCapability-CFmunau5.js → unlockedEd25519ExportRootCapability-yzxQjIFd.js} +1 -1
- package/dist/esm/sdk/voiceid-host.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/{public/sdk/wallet-recovery-jyfGoejZ.js → esm/sdk/wallet-recovery-BZB2Vu3X.js} +1 -1
- package/dist/esm/sdk/wallet-ui.css +1 -1
- package/dist/esm/sdk/{walletAuthMethodRecord-Bi78B6Ab.js → walletAuthMethodRecord-DLBB5fez.js} +1 -1
- package/dist/{public/sdk/walletAuthority-DGdC9Glh.js → esm/sdk/walletAuthority-BTGAuOi8.js} +1 -1
- package/dist/esm/sdk/{walletCapabilityBindings-BRdFdh3l.js → walletCapabilityBindings-D5YYB7nN.js} +1 -1
- package/dist/esm/sdk/{walletCustodyEcdsaContinuity-DdLNQs1M.js → walletCustodyEcdsaContinuity-C31YQ9av.js} +1 -1
- package/dist/{public/sdk/walletOwnershipGeneration-z9NXOk-b.js → esm/sdk/walletOwnershipGeneration-CgjCtPrV.js} +1 -1
- package/dist/{public/sdk/walletRecoveryAdminProof-hytB9fXI.js → esm/sdk/walletRecoveryAdminProof-B4Ic07jY.js} +1 -1
- package/dist/{public/sdk/walletRecoveryCommit-sr8-RYvn.js → esm/sdk/walletRecoveryCommit-Cc2LAkCS.js} +1 -1
- package/dist/{public/sdk/walletSessionAuthorizationStore-BEJyERPZ.js → esm/sdk/walletSessionAuthorizationStore-B9Vwkshr.js} +1 -1
- package/dist/esm/sdk/warmSessionHydration-B-A5Tdx7.js +1 -0
- package/dist/esm/sdk/{webauthnP256-DVlYEUsG.js → webauthnP256-BsQQPurm.js} +1 -1
- package/dist/esm/shared-ts/src/auth/externalAuth.js +53 -0
- package/dist/esm/shared-ts/src/near/nearClient.js +1 -1
- package/dist/esm/shared-ts/src/utils/errors.js +50 -2
- package/dist/esm/shared-ts/src/utils/index.js +1 -1
- package/dist/esm/voiceid-host.js +1 -1
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/{ConfirmationDrawer-BmzikAr4.js → ConfirmationDrawer-MJoE0AAo.js} +1 -1
- package/dist/{esm/sdk/NonceCoordinator-CcD2FqXh.js → public/sdk/NonceCoordinator-3YhmDTS5.js} +1 -1
- package/dist/{esm/sdk/SeamsWordmark-DqiC9-sd.js → public/sdk/SeamsWordmark-DwvPx2UA.js} +1 -1
- package/dist/public/sdk/{accountLifecycle-gm9X8nGm.js → accountLifecycle-6DHYWf0v.js} +1 -1
- package/dist/public/sdk/{adapters-e7twFGov.js → adapters-C-g_hkkZ.js} +1 -1
- package/dist/public/sdk/appearance-token-vars-01eH9pgA.js +1 -0
- package/dist/{esm/sdk/clientSessionPersistenceState-YvVHKRoe.js → public/sdk/clientSessionPersistenceState-BCkJAYSz.js} +1 -1
- package/dist/public/sdk/{collectAuthenticationCredentialForChallengeB64u-DEtxiKND.js → collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js} +1 -1
- package/dist/public/sdk/{commitQueue-CHJ7MHSI.js → commitQueue-CYruPlkm.js} +1 -1
- package/dist/public/sdk/configBuilder-DpChXfDO.js +1 -0
- package/dist/public/sdk/{configuration-DBEc3bsj.js → configuration-BAad7ngq.js} +1 -1
- package/dist/public/sdk/confirm-ui-em0vkd2m.js +2 -0
- package/dist/public/sdk/{device-linking-BsUTtSF7.js → device-linking-DiCNt3iA.js} +1 -1
- package/dist/public/sdk/{deviceLinkApproval-DAZTjrud.js → deviceLinkApproval-x3WkiYrd.js} +1 -1
- package/dist/public/sdk/{display-BYzolrBs.js → display-D0EPmU4w.js} +1 -1
- package/dist/{esm/sdk/ecdsaCapabilityManifest-CXVq8Qzb.js → public/sdk/ecdsaCapabilityManifest-DAJEVjlP.js} +1 -1
- package/dist/public/sdk/{ecdsaDerivationClientWasm-CVahDxLy.js → ecdsaDerivationClientWasm-AYOJgTJm.js} +1 -1
- package/dist/{esm/sdk/ecdsaDerivationExport-CkmSe0ao.js → public/sdk/ecdsaDerivationExport-DJKOzDbS.js} +1 -1
- package/dist/public/sdk/{ecdsaWalletRecords-zRvHKRTe.js → ecdsaWalletRecords-WLyq414E.js} +1 -1
- package/dist/public/sdk/{emailOtpEcdsaDerivationIdentity-0DIuRNRi.js → emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js} +1 -1
- package/dist/public/sdk/{enrichDisplayModelWithAbi-CLn37drs.js → enrichDisplayModelWithAbi-O6Mw4i2E.js} +1 -1
- package/dist/public/sdk/errors-BJBDbwHk.js +1 -0
- package/dist/public/sdk/{evmCryptoWasm-B_p82tx9.js → evmCryptoWasm-BUPb4hBH.js} +1 -1
- package/dist/public/sdk/{export-viewer-host-3fosWJXJ.js → export-viewer-host-BSTfHhau.js} +1 -1
- package/dist/public/sdk/{exportKeypairOperation-pKQW5J7m.js → exportKeypairOperation-CjST_NUK.js} +1 -1
- package/dist/public/sdk/host-C51z-AxP.js +1 -0
- package/dist/{esm/sdk/icons-DDRXJ2W1.js → public/sdk/icons-BlMXolHv.js} +1 -1
- package/dist/public/sdk/{indexedDB-CWFDCCbP.js → indexedDB-C4SDsyOG.js} +1 -1
- package/dist/public/sdk/{intentDigest-B6EshTea.js → intentDigest-HvRsBQ1z.js} +1 -1
- package/dist/public/sdk/{lanes-C2sAP08w.js → lanes-BU-fGqY4.js} +1 -1
- package/dist/public/sdk/{localOnly-Jw9v9GU9.js → localOnly-Xs89Xajm.js} +1 -1
- package/dist/{esm/sdk/mountExportPrivateKeySurface-B_052qyI.js → public/sdk/mountExportPrivateKeySurface-CsUEKeum.js} +1 -1
- package/dist/public/sdk/{mountRecoveryCodeBackupSurface-PutmFjf9.js → mountRecoveryCodeBackupSurface-kFLo5zLk.js} +1 -1
- package/dist/public/sdk/{nearEd25519YaoMaterialActivation-C2QNLImD.js → nearEd25519YaoMaterialActivation-BfXmy3Jr.js} +1 -1
- package/dist/{esm/sdk/nearEd25519YaoSigningPreparation-K6n4Sq8_.js → public/sdk/nearEd25519YaoSigningPreparation-DHNk0F8e.js} +1 -1
- package/dist/public/sdk/nearRpcResults-CeHdqaS4.js +1 -0
- package/dist/public/sdk/{nonceLaneKeys-CZjeiii7.js → nonceLaneKeys-BF_UpvIy.js} +1 -1
- package/dist/public/sdk/{normalization-DA6o5MsH.js → normalization-Df9fZWJC.js} +1 -1
- package/dist/{esm/sdk/pendingWalletRecoveryCodeBackup-B-n7vmBS.js → public/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js} +1 -1
- package/dist/public/sdk/{presignaturePool-DjTaB0nx.js → presignaturePool-BbvqRWYw.js} +1 -1
- package/dist/public/sdk/{recovery-entrypoint-9e3SXU3t.js → recovery-entrypoint-DJbMDC_m.js} +1 -1
- package/dist/public/sdk/{registration-C988Nwzn.js → registration-Byl4l4yZ.js} +1 -1
- package/dist/public/sdk/{registration-D4AijOa8.js → registration-C2fb9kRQ.js} +1 -1
- package/dist/public/sdk/{registrationAccounts-DI_vcT7G.js → registrationAccounts-4r74gX1l.js} +1 -1
- package/dist/public/sdk/registrationIntent-Do1tD1V7.js +1 -0
- package/dist/public/sdk/{registrationSignerPlan-_8gsSjC0.js → registrationSignerPlan-DK2b3N_p.js} +1 -1
- package/dist/{esm/sdk/requireStepUpAuth-DC9LSyRI.js → public/sdk/requireStepUpAuth-COqCGb1i.js} +1 -1
- package/dist/public/sdk/resealedEnvelopeResult-CLW00Vbw.js +1 -0
- package/dist/public/sdk/{routerAbNormalSigning-Da-uxxle.js → routerAbNormalSigning-D-UZmCBS.js} +1 -1
- package/dist/public/sdk/runtime-auth-ufbVur2p.js +1 -0
- package/dist/public/sdk/{runtime-device-link-DtjR-htE.js → runtime-device-link-CagI2Q62.js} +1 -1
- package/dist/{esm/sdk/runtime-ecdsa-tempo-BkUnzoX9.js → public/sdk/runtime-ecdsa-tempo-Rctxr0yM.js} +1 -1
- package/dist/{esm/sdk/runtime-email-otp-CaxfpqKI.js → public/sdk/runtime-email-otp-BQtcG-LF.js} +1 -1
- package/dist/public/sdk/{runtime-export-Du5ugbzi.js → runtime-export-wTeEaqlk.js} +1 -1
- package/dist/public/sdk/runtime-near-59yU_3ud.js +1 -0
- package/dist/public/sdk/runtime-preferences-B9qLHX8W.js +1 -0
- package/dist/public/sdk/runtime-recovery-DNyzdMBj.js +1 -0
- package/dist/public/sdk/{runtime-recovery-codes-DKjOU32G.js → runtime-recovery-codes-si1fGktB.js} +1 -1
- package/dist/public/sdk/runtimeContext-ByeM6Z4Z.js +6 -0
- package/dist/{esm/sdk/secp256k1--vF2pJgR.js → public/sdk/secp256k1-CE7-q9Sn.js} +1 -1
- package/dist/public/sdk/sessionObservationRevision-ihBwjS3y.js +1 -0
- package/dist/public/sdk/{signEvmFamily-DeCQOBYN.js → signEvmFamily-BY5jlZEG.js} +1 -1
- package/dist/{esm/sdk/signEvmFamilyWithUiConfirmForTempo-BIp-MeBV.js → public/sdk/signEvmFamilyWithUiConfirmForTempo-CrMIAXUe.js} +1 -1
- package/dist/public/sdk/{signEvmWithUiConfirm-BdLW7kqJ.js → signEvmWithUiConfirm-CGrLtMV6.js} +1 -1
- package/dist/public/sdk/signNear-DMpJFkwF.js +1 -0
- package/dist/public/sdk/{signatureUses-0z64Xpdj.js → signatureUses-kSrUHSSH.js} +1 -1
- package/dist/{esm/sdk/signingFlow-C7fwkxPx.js → public/sdk/signingFlow-BcetvUeS.js} +1 -1
- package/dist/{esm/sdk/signingQueue-DvHGcaLc.js → public/sdk/signingQueue-dMFOFOP5.js} +1 -1
- package/dist/public/sdk/surface-measurement-reporter-DXsvq401.js +1 -0
- package/dist/public/sdk/{thresholdEcdsa-CPVZNLEg.js → thresholdEcdsa-CqR1fFA-.js} +1 -1
- package/dist/public/sdk/{trace-BQv7E-bO.js → trace--mRP2OQc.js} +1 -1
- package/dist/public/sdk/{transaction-activity-olcDRay5.js → transaction-activity-DCzHGg3b.js} +1 -1
- package/dist/public/sdk/{transactionReviewAdmission-DPxuDgkU.js → transactionReviewAdmission-Cf_qUZJt.js} +1 -1
- package/dist/public/sdk/{transactionState-C8aYSDRA.js → transactionState-29T9xfvL.js} +1 -1
- package/dist/public/sdk/tx-confirm-ui.js +181 -18
- package/dist/public/sdk/{types-DOToeB6g.js → types-f7dyj5N6.js} +1 -1
- package/dist/public/sdk/{unlockedEd25519ExportRootCapability-CFmunau5.js → unlockedEd25519ExportRootCapability-yzxQjIFd.js} +1 -1
- package/dist/public/sdk/voiceid-host.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/{esm/sdk/wallet-recovery-jyfGoejZ.js → public/sdk/wallet-recovery-BZB2Vu3X.js} +1 -1
- package/dist/public/sdk/wallet-ui.css +1 -1
- package/dist/public/sdk/{walletAuthMethodRecord-Bi78B6Ab.js → walletAuthMethodRecord-DLBB5fez.js} +1 -1
- package/dist/{esm/sdk/walletAuthority-DGdC9Glh.js → public/sdk/walletAuthority-BTGAuOi8.js} +1 -1
- package/dist/public/sdk/{walletCapabilityBindings-BRdFdh3l.js → walletCapabilityBindings-D5YYB7nN.js} +1 -1
- package/dist/public/sdk/{walletCustodyEcdsaContinuity-DdLNQs1M.js → walletCustodyEcdsaContinuity-C31YQ9av.js} +1 -1
- package/dist/{esm/sdk/walletOwnershipGeneration-z9NXOk-b.js → public/sdk/walletOwnershipGeneration-CgjCtPrV.js} +1 -1
- package/dist/{esm/sdk/walletRecoveryAdminProof-hytB9fXI.js → public/sdk/walletRecoveryAdminProof-B4Ic07jY.js} +1 -1
- package/dist/{esm/sdk/walletRecoveryCommit-sr8-RYvn.js → public/sdk/walletRecoveryCommit-Cc2LAkCS.js} +1 -1
- package/dist/{esm/sdk/walletSessionAuthorizationStore-BEJyERPZ.js → public/sdk/walletSessionAuthorizationStore-B9Vwkshr.js} +1 -1
- package/dist/public/sdk/warmSessionHydration-B-A5Tdx7.js +1 -0
- package/dist/public/sdk/{webauthnP256-DVlYEUsG.js → webauthnP256-BsQQPurm.js} +1 -1
- package/dist/public/wallet-assets.manifest.json +275 -251
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/shared-ts/src/auth/externalAuth.d.ts +84 -0
- package/dist/types/wallet/src/SeamsWeb/operations/devices/walletHostOwnerAuthority.d.ts +2 -1
- package/dist/types/wallet/src/SeamsWeb/publicApi/auth.d.ts +1 -1
- package/dist/types/wallet/src/SeamsWeb/publicApi/types.d.ts +11 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/router.d.ts +4 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/WalletHostRuntime.d.ts +4 -2
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/createSessionCommands.d.ts +5 -2
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/externalAuth.d.ts +29 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/requestRouter.d.ts +1 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/sessionObserver.d.ts +1 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/mountAuthMenuSurface.d.ts +1 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/messages.d.ts +5 -3
- package/dist/types/wallet/src/core/authMethods/hostPlugin.d.ts +1 -0
- package/dist/types/wallet/src/core/authMethods/plugins.d.ts +2 -0
- package/dist/types/wallet/src/core/rpcClients/near/NearClient.d.ts +13 -0
- package/dist/types/wallet/src/core/signingEngine/nearTransactionSubmission.d.ts +24 -0
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/transactionReviewAdmission.d.ts +2 -0
- package/dist/types/wallet/src/core/types/linkDevice.d.ts +4 -5
- package/dist/types/wallet/src/core/types/seams.d.ts +29 -9
- package/dist/types/wallet/src/core/ui/messages.d.ts +1 -1
- package/dist/types/wallet/src/index.d.ts +1 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonView.d.ts +2 -1
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountSettingsDialog.d.ts +10 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodsModal.d.ts +1 -2
- package/dist/types/wallet/src/react/components/AccountMenuButton/ExternalWalletSettings.d.ts +10 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/LinkedDevicesModal.d.ts +1 -2
- package/dist/types/wallet/src/react/components/AccountMenuButton/WalletSettingsLayout.d.ts +1 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/hooks/useProfileState.d.ts +2 -2
- package/dist/types/wallet/src/react/components/AccountMenuButton/icons/HoverArrowIcon.d.ts +2 -1
- package/dist/types/wallet/src/react/components/AccountMenuButton/types.d.ts +4 -3
- package/dist/types/wallet/src/react/components/ExternalNearWalletIcon.d.ts +5 -0
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.d.ts +31 -0
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/types.d.ts +4 -0
- package/dist/types/wallet/src/react/components/externalWalletBrandImages.d.ts +3 -0
- package/dist/types/wallet/src/react/components/theme/design-tokens.d.ts +2 -0
- package/dist/types/wallet/src/react/context/reactLoginStateBuilders.d.ts +1 -1
- package/dist/types/wallet/src/react/index.d.ts +2 -0
- package/dist/types/wallet/src/react/types.d.ts +13 -3
- package/dist/types/wallet/src/voiceid-host.d.ts +2 -2
- package/package.json +1 -1
- package/dist/esm/react/components/AccountMenuButton/AccountMenuModal.js +0 -66
- package/dist/esm/sdk/appearance-token-vars-EYbmnHsJ.js +0 -1
- package/dist/esm/sdk/configBuilder-CSwJrmcR.js +0 -1
- package/dist/esm/sdk/confirm-ui-BpqwuMSl.js +0 -2
- package/dist/esm/sdk/errors-DLUmUo9m.js +0 -1
- package/dist/esm/sdk/host-aTcpYE27.js +0 -1
- package/dist/esm/sdk/registrationIntent-BVPp0k0k.js +0 -1
- package/dist/esm/sdk/resealedEnvelopeResult-BKATJaqW.js +0 -1
- package/dist/esm/sdk/runtime-auth-C_Y8gL_n.js +0 -1
- package/dist/esm/sdk/runtime-near-fas7U0MC.js +0 -1
- package/dist/esm/sdk/runtime-preferences-7-f34-by.js +0 -1
- package/dist/esm/sdk/runtime-recovery-DmY0ZJpf.js +0 -1
- package/dist/esm/sdk/runtimeContext-DF8MdfXl.js +0 -6
- package/dist/esm/sdk/sessionObservationRevision-DKTqqbGf.js +0 -1
- package/dist/esm/sdk/signNear-DMzOU4dX.js +0 -1
- package/dist/esm/sdk/surface-measurement-reporter-DvzNDnHy.js +0 -1
- package/dist/esm/sdk/warmSessionHydration-EstsrMF8.js +0 -1
- package/dist/public/sdk/appearance-token-vars-EYbmnHsJ.js +0 -1
- package/dist/public/sdk/configBuilder-CSwJrmcR.js +0 -1
- package/dist/public/sdk/confirm-ui-BpqwuMSl.js +0 -2
- package/dist/public/sdk/errors-DLUmUo9m.js +0 -1
- package/dist/public/sdk/host-aTcpYE27.js +0 -1
- package/dist/public/sdk/registrationIntent-BVPp0k0k.js +0 -1
- package/dist/public/sdk/resealedEnvelopeResult-BKATJaqW.js +0 -1
- package/dist/public/sdk/runtime-auth-C_Y8gL_n.js +0 -1
- package/dist/public/sdk/runtime-near-fas7U0MC.js +0 -1
- package/dist/public/sdk/runtime-preferences-7-f34-by.js +0 -1
- package/dist/public/sdk/runtime-recovery-DmY0ZJpf.js +0 -1
- package/dist/public/sdk/runtimeContext-DF8MdfXl.js +0 -6
- package/dist/public/sdk/sessionObservationRevision-DKTqqbGf.js +0 -1
- package/dist/public/sdk/signNear-DMzOU4dX.js +0 -1
- package/dist/public/sdk/surface-measurement-reporter-DvzNDnHy.js +0 -1
- package/dist/public/sdk/warmSessionHydration-EstsrMF8.js +0 -1
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuModal.d.ts +0 -9
- /package/dist/esm/sdk/{accountIds-Dj_0GoY-.js → accountIds-CW2BP-d9.js} +0 -0
- /package/dist/esm/sdk/{actions-BIdcxldy.js → actions-DrtSTGus.js} +0 -0
- /package/dist/esm/sdk/{appearance-CAIe7Qed.js → appearance-DL7c6bML.js} +0 -0
- /package/dist/esm/sdk/{authenticatorOptions-2_XK8aXv.js → authenticatorOptions-WCDKYRux.js} +0 -0
- /package/dist/esm/sdk/{authorizationAdmission-BYwaSZYV.js → authorizationAdmission-28jo_IVJ.js} +0 -0
- /package/dist/esm/sdk/{browser-B1qU6ouJ.js → browser-CKS7Tq2r.js} +0 -0
- /package/dist/esm/sdk/{bytes-CA0mv-bG.js → bytes-DXo6uALR.js} +0 -0
- /package/dist/esm/sdk/{canonicalSignerErrorCode-BHDPNkvJ.js → canonicalSignerErrorCode-CX5PBpkt.js} +0 -0
- /package/dist/esm/sdk/{challengeDelivery-DWix1oso.js → challengeDelivery-Dj9HrjW9.js} +0 -0
- /package/dist/esm/sdk/{confirmTypes-DmEPoxys.js → confirmTypes-BvVtQs-M.js} +0 -0
- /package/dist/esm/sdk/{csp-stylesheet-CHtV6HyK.js → csp-stylesheet-DUSqfXvZ.js} +0 -0
- /package/dist/esm/sdk/{digestEncoding-n8Kr2kow.js → digestEncoding-CqNXPZY9.js} +0 -0
- /package/dist/esm/sdk/{ecdsaChainTarget-Lh24LLyA.js → ecdsaChainTarget-Bm5X4k-V.js} +0 -0
- /package/dist/esm/sdk/{executeWorkerOperation-XmBNaxrV.js → executeWorkerOperation-C9FOCCR7.js} +0 -0
- /package/dist/esm/sdk/{helpers-dZehRP4i.js → helpers-Dubwo5uK.js} +0 -0
- /package/dist/esm/sdk/{jsonRpc-YKL5n8VL.js → jsonRpc-BVDv1wfm.js} +0 -0
- /package/dist/esm/sdk/{keccak-BArcwgbj.js → keccak-mS0Mejjx.js} +0 -0
- /package/dist/esm/sdk/{keyMaterialEnvelope-BsdlckmN.js → keyMaterialEnvelope-Dm2ZEilb.js} +0 -0
- /package/dist/esm/sdk/{normalization-dgJxtZKK.js → normalization-B3i1-rPQ.js} +0 -0
- /package/dist/esm/sdk/{operationFingerprint-DgpQfpM-.js → operationFingerprint-Bas59T7L.js} +0 -0
- /package/dist/esm/sdk/{presignatures-CjcyX_-F.js → presignatures-BCeq56DG.js} +0 -0
- /package/dist/esm/sdk/{prfCache-Ck1mh5YB.js → prfCache-DEHaUPSW.js} +0 -0
- /package/dist/esm/sdk/{profileAccountProjection-dvLchPBo.js → profileAccountProjection-C5sNt-s2.js} +0 -0
- /package/dist/esm/sdk/{promptText-BIv8lx7_.js → promptText-bcKcsSka.js} +0 -0
- /package/dist/esm/sdk/{recoveryAuthorization-CMVdZ5OR.js → recoveryAuthorization-CQsjb8Tm.js} +0 -0
- /package/dist/esm/sdk/{registrationAuthMethodInput-Be4Td0Ef.js → registrationAuthMethodInput-BR1WVbK3.js} +0 -0
- /package/dist/esm/sdk/{sdkSentEvents-QPs69K3s.js → sdkSentEvents-DjOlKtdW.js} +0 -0
- /package/dist/esm/sdk/{shared-hkHoIS9i.js → shared-CkHhXgFB.js} +0 -0
- /package/dist/esm/sdk/{signer-worker-CmCKlJ__.js → signer-worker-BNodGJKY.js} +0 -0
- /package/dist/esm/sdk/{signerDomain-BLnlQPAV.js → signerDomain-BAsLT3XN.js} +0 -0
- /package/dist/esm/sdk/{signerSlot-DgLzb3Ee.js → signerSlot-D2RZnb27.js} +0 -0
- /package/dist/esm/sdk/{types-COS7UL3R.js → types-C4OErbBf.js} +0 -0
- /package/dist/esm/sdk/{walletCustodyOperation-CAnT3Ww-.js → walletCustodyOperation-DimzAbCB.js} +0 -0
- /package/dist/esm/sdk/{walletSessionAuthorizationProjection-CMl69JGe.js → walletSessionAuthorizationProjection-BzUH6gHV.js} +0 -0
- /package/dist/esm/sdk/{walletSessionAuthorizationStatus-C_q9eiOH.js → walletSessionAuthorizationStatus-DG7DPcgR.js} +0 -0
- /package/dist/esm/sdk/{walletSessionFailure-ZfdbUAG-.js → walletSessionFailure-CxsVtroW.js} +0 -0
- /package/dist/esm/sdk/{webauthnPromptCoordinator-DMETRUcN.js → webauthnPromptCoordinator-npsSRD51.js} +0 -0
- /package/dist/public/sdk/{accountIds-Dj_0GoY-.js → accountIds-CW2BP-d9.js} +0 -0
- /package/dist/public/sdk/{actions-BIdcxldy.js → actions-DrtSTGus.js} +0 -0
- /package/dist/public/sdk/{appearance-CAIe7Qed.js → appearance-DL7c6bML.js} +0 -0
- /package/dist/public/sdk/{authenticatorOptions-2_XK8aXv.js → authenticatorOptions-WCDKYRux.js} +0 -0
- /package/dist/public/sdk/{authorizationAdmission-BYwaSZYV.js → authorizationAdmission-28jo_IVJ.js} +0 -0
- /package/dist/public/sdk/{browser-B1qU6ouJ.js → browser-CKS7Tq2r.js} +0 -0
- /package/dist/public/sdk/{bytes-CA0mv-bG.js → bytes-DXo6uALR.js} +0 -0
- /package/dist/public/sdk/{canonicalSignerErrorCode-BHDPNkvJ.js → canonicalSignerErrorCode-CX5PBpkt.js} +0 -0
- /package/dist/public/sdk/{challengeDelivery-DWix1oso.js → challengeDelivery-Dj9HrjW9.js} +0 -0
- /package/dist/public/sdk/{confirmTypes-DmEPoxys.js → confirmTypes-BvVtQs-M.js} +0 -0
- /package/dist/public/sdk/{csp-stylesheet-CHtV6HyK.js → csp-stylesheet-DUSqfXvZ.js} +0 -0
- /package/dist/public/sdk/{digestEncoding-n8Kr2kow.js → digestEncoding-CqNXPZY9.js} +0 -0
- /package/dist/public/sdk/{ecdsaChainTarget-Lh24LLyA.js → ecdsaChainTarget-Bm5X4k-V.js} +0 -0
- /package/dist/public/sdk/{executeWorkerOperation-XmBNaxrV.js → executeWorkerOperation-C9FOCCR7.js} +0 -0
- /package/dist/public/sdk/{helpers-dZehRP4i.js → helpers-Dubwo5uK.js} +0 -0
- /package/dist/public/sdk/{jsonRpc-YKL5n8VL.js → jsonRpc-BVDv1wfm.js} +0 -0
- /package/dist/public/sdk/{keccak-BArcwgbj.js → keccak-mS0Mejjx.js} +0 -0
- /package/dist/public/sdk/{keyMaterialEnvelope-BsdlckmN.js → keyMaterialEnvelope-Dm2ZEilb.js} +0 -0
- /package/dist/public/sdk/{normalization-dgJxtZKK.js → normalization-B3i1-rPQ.js} +0 -0
- /package/dist/public/sdk/{operationFingerprint-DgpQfpM-.js → operationFingerprint-Bas59T7L.js} +0 -0
- /package/dist/public/sdk/{presignatures-CjcyX_-F.js → presignatures-BCeq56DG.js} +0 -0
- /package/dist/public/sdk/{prfCache-Ck1mh5YB.js → prfCache-DEHaUPSW.js} +0 -0
- /package/dist/public/sdk/{profileAccountProjection-dvLchPBo.js → profileAccountProjection-C5sNt-s2.js} +0 -0
- /package/dist/public/sdk/{promptText-BIv8lx7_.js → promptText-bcKcsSka.js} +0 -0
- /package/dist/public/sdk/{recoveryAuthorization-CMVdZ5OR.js → recoveryAuthorization-CQsjb8Tm.js} +0 -0
- /package/dist/public/sdk/{registrationAuthMethodInput-Be4Td0Ef.js → registrationAuthMethodInput-BR1WVbK3.js} +0 -0
- /package/dist/public/sdk/{sdkSentEvents-QPs69K3s.js → sdkSentEvents-DjOlKtdW.js} +0 -0
- /package/dist/public/sdk/{shared-hkHoIS9i.js → shared-CkHhXgFB.js} +0 -0
- /package/dist/public/sdk/{signer-worker-CmCKlJ__.js → signer-worker-BNodGJKY.js} +0 -0
- /package/dist/public/sdk/{signerDomain-BLnlQPAV.js → signerDomain-BAsLT3XN.js} +0 -0
- /package/dist/public/sdk/{signerSlot-DgLzb3Ee.js → signerSlot-D2RZnb27.js} +0 -0
- /package/dist/public/sdk/{types-COS7UL3R.js → types-C4OErbBf.js} +0 -0
- /package/dist/public/sdk/{walletCustodyOperation-CAnT3Ww-.js → walletCustodyOperation-DimzAbCB.js} +0 -0
- /package/dist/public/sdk/{walletSessionAuthorizationProjection-CMl69JGe.js → walletSessionAuthorizationProjection-BzUH6gHV.js} +0 -0
- /package/dist/public/sdk/{walletSessionAuthorizationStatus-C_q9eiOH.js → walletSessionAuthorizationStatus-DG7DPcgR.js} +0 -0
- /package/dist/public/sdk/{walletSessionFailure-ZfdbUAG-.js → walletSessionFailure-CxsVtroW.js} +0 -0
- /package/dist/public/sdk/{webauthnPromptCoordinator-DMETRUcN.js → webauthnPromptCoordinator-npsSRD51.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e,k as t}from"./domainIds-t1lp25yU.js";import{g as n}from"./digests-BIaE0DMd.js";import{r}from"./activeWalletSession-BJ4B-nJo.js";import{t as i}from"./walletIframeIdentity-CpgyEnKg.js";const a=`__SEAMS_WALLET_SDK_BASE__`,o=`SEAMS_WALLET_SDK_BASE_CHANGED`,s=`__SEAMS_WALLET_ASSET_VERSION__`;function c(){if(typeof window>`u`)return;let e=window[a];return typeof e==`string`&&e.length>0?e:void 0}function l(e){if(typeof window>`u`)return;let t=window;t[a]=e,window.dispatchEvent(new CustomEvent(o,{detail:e}))}function u(){if(typeof window>`u`)return;let e=window[s];return typeof e==`string`&&e.length>0?e:void 0}function d(e){if(typeof window>`u`)return;let t=e.trim();t&&(window[s]=t)}function f(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(o,t,{passive:!0}),()=>window.removeEventListener(o,t)}const p={login:{title:`Welcome back`,subtitle:``,passkeyCta:`Unlock with passkey`},register:{title:`Create a wallet`,subtitle:``,passkeyNameLabel:`Wallet name`,passkeyCta:`Create wallet with passkey`},common:{closeLabel:`Close`}};function m(e,t){return typeof e==`string`&&e.trim()||null}function h(e,t){let n=m(e,t);return n===null?null:n}function g(e){try{return i(e)}catch{return null}}function _(e,t){let n=new Set(t);return Object.keys(e).every(e=>n.has(e))}function v(e){return h(e,`authMenuSessionId`)}function y(e){return h(e,`externalAuthRequestId`)}function b(e){return n(e)?e:null}function x(e,t=new Set,n=!1){if(e===void 0)return n;if(e===null||typeof e==`string`||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>x(e,t,n));let r=b(e);return r!==null&&Object.values(r).every(e=>x(e,t,n))}function S(e,t){return m(e,`copy`)??t}function C(e,t){let n=b(e);return{title:S(n?.title,t.title),subtitle:S(n?.subtitle,t.subtitle),passkeyCta:S(n?.passkeyCta,t.passkeyCta)}}function w(e){let t=b(e),n=b(t?.register);return{login:C(t?.login,p.login),register:{...C(t?.register,p.register),passkeyNameLabel:S(n?.passkeyNameLabel,p.register.passkeyNameLabel)},common:{closeLabel:S(b(t?.common)?.closeLabel,p.common.closeLabel)}}}function T(e){return e===`google`?e:null}function E(e){return e===`login`||e===`register`?e:null}function D(e){return e===`implicit_wallet`||e===`sponsored_named_near_account`?e:null}function O(e){return e===`close_button`||e===`component_unmounted`||e===`connection_closed`?e:null}function k(e,t){if(e===void 0)return!0;let n=b(e);return n!==null&&_(n,t)}function A(e){let t=b(e);return!t||!_(t,[`login`,`register`,`common`])?!1:k(t.login,[`title`,`subtitle`,`passkeyCta`])&&k(t.register,[`title`,`subtitle`,`passkeyCta`,`passkeyNameLabel`])&&k(t.common,[`closeLabel`])}function j(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=T(n);if(!e)return null;t.push(e)}return t}function M(e){let n=b(e);if(!n||!x(n,new Set,!0)||n.kind!==`hosted_auth_menu_open_v1`||!_(n,[`kind`,`authMenuSessionId`,`initialMode`,`loginTarget`,`registrationAccountInput`,`showRegistrationInput`,`showProgress`,`copy`,`enabledExternalProviders`])||!A(n.copy))return null;let r=v(n.authMenuSessionId),i=E(n.initialMode),a=b(n.loginTarget),o=a?.kind===`wallet`||a?.kind===`wallet_sync`?t(a.walletId):null,s=a?.kind===`discoverable`&&_(a,[`kind`])?{kind:`discoverable`}:a?.kind===`wallet`&&_(a,[`kind`,`walletId`])&&o?.ok?{kind:`wallet`,walletId:o.value}:a?.kind===`wallet_sync`&&_(a,[`kind`,`walletId`])&&o?.ok?{kind:`wallet_sync`,walletId:o.value}:null,c=D(n.registrationAccountInput),l=j(n.enabledExternalProviders);return!r||!i||!s||!c||typeof n.showRegistrationInput!=`boolean`||typeof n.showProgress!=`boolean`||!l||!x(n.copy,new Set,!0)?null:{kind:`hosted_auth_menu_open_v1`,authMenuSessionId:r,initialMode:i,loginTarget:s,registrationAccountInput:c,showRegistrationInput:n.showRegistrationInput,showProgress:n.showProgress,copy:w(n.copy),enabledExternalProviders:l}}function N(e){let t=b(e);if(!t||!x(t)||t.kind!==`hosted_auth_menu_error_v1`||!_(t,[`kind`,`authMenuSessionId`,`mode`,`message`]))return null;let n=v(t.authMenuSessionId),r=E(t.mode),i=m(t.message,`message`);return n&&r&&i?{kind:t.kind,authMenuSessionId:n,mode:r,message:i}:null}function P(e){let t=b(e);if(!t||!x(t))return null;switch(t.kind){case`google_id_token`:{if(!_(t,[`kind`,`idToken`]))return null;let e=m(t.idToken,`idToken`);return e?{kind:t.kind,idToken:e}:null}case`cancelled`:return _(t,[`kind`,`reason`])&&t.reason===`user_cancelled`?{kind:t.kind,reason:t.reason}:null;case`failed`:{if(!_(t,[`kind`,`code`,`message`]))return null;let e=t.code===`provider_unavailable`||t.code===`provider_error`||t.code===`invalid_evidence`?t.code:null,n=m(t.message,`message`);return e&&n?{kind:t.kind,code:e,message:n}:null}default:return null}}function F(e){let t=b(e);if(!t||!x(t)||t.kind!==`hosted_auth_menu_external_auth_resolution_v1`||!_(t,[`kind`,`authMenuSessionId`,`externalAuthRequestId`,`requestId`,`evidence`]))return null;let n=v(t.authMenuSessionId),r=y(t.externalAuthRequestId),i=g(t.requestId),a=P(t.evidence);return!n||!r||!i||!a?null:{kind:t.kind,authMenuSessionId:n,externalAuthRequestId:r,requestId:i,evidence:a}}function I(e){let t=b(e);if(!t||!x(t)||t.kind!==`hosted_auth_menu_cancel_v1`||!_(t,[`kind`,`authMenuSessionId`,`requestId`,`reason`]))return null;let n=v(t.authMenuSessionId),r=g(t.requestId),i=O(t.reason);return n&&r&&i?{kind:t.kind,authMenuSessionId:n,requestId:r,reason:i}:null}const L=`17.0.0`,R=`WALLET_IFRAME_PROTOCOL_VERSION_MISMATCH`,z=[`home`,`exchangeCode`,`nonce`,`appOrigin`,`walletOrigin`,`relayUrl`];function B(e,t){if(typeof e!=`string`||e.length===0||e.length>512||e.trim()!==e||/[\s\u0000-\u001f\u007f]/.test(e))throw Error(`${t} must be a compact opaque identifier`);return e}function V(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw Error(`${t} must be a canonical HTTP origin`);let n;try{n=new URL(e)}catch{throw Error(`${t} must be a canonical HTTP origin`)}if(n.protocol!==`https:`&&n.protocol!==`http:`||n.origin!==e||n.pathname!==`/`||n.search!==``||n.hash!==``)throw Error(`${t} must be a canonical HTTP origin`);return n.origin}function H(e){if(!n(e))throw Error(`hosted-wallet redemption payload must be an exact object`);if(Object.keys(e).length!==z.length)throw Error(`hosted-wallet redemption payload fields are invalid`);for(let t of z)if(!Object.hasOwn(e,t))throw Error(`hosted-wallet redemption payload fields are invalid`);return{home:r(e.home),exchangeCode:B(e.exchangeCode,`exchangeCode`),nonce:B(e.nonce,`nonce`),appOrigin:V(e.appOrigin,`appOrigin`),walletOrigin:V(e.walletOrigin,`walletOrigin`),relayUrl:B(e.relayUrl,`relayUrl`)}}function U(t){if(!n(t)||!_(t,[`scanRequestId`,`action`])||typeof t.scanRequestId!=`string`||t.scanRequestId.length===0||!n(t.action))return null;let r=t.action;if(r.kind===`cancel`)return _(r,[`kind`])?{scanRequestId:t.scanRequestId,action:{kind:r.kind}}:null;if(r.kind!==`select`||!_(r,[`kind`,`baseWalletAuthMethodId`]))return null;let i=e(r.baseWalletAuthMethodId);return i.ok?{scanRequestId:t.scanRequestId,action:{kind:r.kind,baseWalletAuthMethodId:i.value}}:null}function W(e){if(!n(e)||!_(e,[`activationId`,`action`])||typeof e.activationId!=`string`||e.activationId.length===0||!n(e.action))return null;let t=e.action;switch(t.kind){case`create_passkey`:case`send_email_otp`:case`resend_email_otp`:return _(t,[`kind`])?{activationId:e.activationId,action:{kind:t.kind}}:null;case`submit_email_otp`:return _(t,[`kind`,`otpCode`])&&typeof t.otpCode==`string`&&/^\d{6}$/.test(t.otpCode)?{activationId:e.activationId,action:{kind:t.kind,otpCode:t.otpCode}}:null;default:return null}}function G(){return{appIdentity:{kind:`anonymous`},authentication:{kind:`signed_out`},capabilityProjection:{kind:`not_requested`},nonceDiagnostics:null}}let K=0;function q(){return K+=1,K}export{l as _,y as a,I as c,M as d,H as f,d as g,f as h,L as i,N as l,c as m,G as n,U as o,u as p,R as r,W as s,q as t,F as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-dVx5-UGu.js";import{C as t,H as n,V as r,i}from"./domainIds-t1lp25yU.js";import{S as a,c as o,g as s,h as c,m as l,r as u,s as d,t as f}from"./digests-BIaE0DMd.js";import{c as p,o as m,r as h}from"./participants-BXdREC5k.js";import{i as g,n as _,r as v,t as y}from"./base64-BmKR3UqU.js";import{n as b,r as ee}from"./secureRandomId-8LSc91aN.js";import{s as te}from"./walletDbName-Ca0rCq5r.js";import{i as x,t as S}from"./activeWalletSession-BJ4B-nJo.js";import{a as ne,s as re}from"./chains-B72I4PDH.js";import{o as C}from"./signingSessionSeal-BFOBKj-J.js";import{r as ie}from"./transactionReviewAdmission-DPxuDgkU.js";import{c as w,d as T,f as E,h as D,m as ae,p as O,s as k}from"./capabilityKinds-DVlGMspk.js";import{r as A}from"./canonicalPrimitives-Jd3i_Ngz.js";import{t as j}from"./errors-DLUmUo9m.js";import{n as M,r as N}from"./signer-worker-CmCKlJ__.js";import{n as P,t as oe}from"./signerDomain-BLnlQPAV.js";import{d as se,f as ce,g as le,h as ue,l as de,m as fe,p as pe,u as me}from"./registrationIntent-BVPp0k0k.js";import{a as he,c as F}from"./ecdsaChainTarget-Lh24LLyA.js";import{d as ge,i as _e,t as I,u as ve}from"./accountIds-Dj_0GoY-.js";import{ot as L,ut as ye}from"./digestEncoding-n8Kr2kow.js";import{t as be}from"./signerSlot-DgLzb3Ee.js";import{a as R,m as xe,o as z}from"./sdkSentEvents-QPs69K3s.js";import{t as Se}from"./jsonRpc-YKL5n8VL.js";import{T as Ce,i as we}from"./emailOtpEcdsaDerivationIdentity-0DIuRNRi.js";import{a as Te,c as B,i as V,n as Ee,o as De,r as H,s as Oe,t as ke}from"./types-DOToeB6g.js";import{p as Ae}from"./nonceLaneKeys-CZjeiii7.js";import{t as je}from"./walletSessionAuthorizationStatus-C_q9eiOH.js";import{t as U}from"./executeWorkerOperation-XmBNaxrV.js";import{a as Me,n as Ne,o as Pe,t as W}from"./actions-BIdcxldy.js";import{a as Fe,i as Ie,l as Le,u as Re}from"./helpers-dZehRP4i.js";import{i as ze,n as Be}from"./profileAccountProjection-dvLchPBo.js";import{s as Ve,t as He,y as Ue}from"./nearEd25519YaoMaterialActivation-C2QNLImD.js";import{D as We,T as Ge,j as Ke}from"./nearEd25519YaoSigningPreparation-K6n4Sq8_.js";import{n as qe}from"./lanes-C2sAP08w.js";import{n as Je,r as Ye,t as Xe}from"./operationFingerprint-DgpQfpM-.js";import{a as G,c as Ze,o as Qe,s as $e,t as et}from"./trace-BQv7E-bO.js";import{i as tt,n as nt,r as rt}from"./intentDigest-B6EshTea.js";import{t as it}from"./challengeDelivery-DWix1oso.js";import{n as at}from"./NonceCoordinator-CcD2FqXh.js";import{a as ot,i as st,o as ct,r as lt,t as ut}from"./authorizationAdmission-BYwaSZYV.js";import{i as dt}from"./walletSessionFailure-ZfdbUAG-.js";import{a as ft,d as pt,i as mt,l as ht,n as gt,p as _t,r as vt,s as yt,u as bt}from"./routerAbNormalSigning-Da-uxxle.js";import{i as xt,n as St}from"./clientSessionPersistenceState-YvVHKRoe.js";import{a as Ct,i as wt,r as Tt,t as Et}from"./types-COS7UL3R.js";import{C as Dt,b as Ot,c as kt,g as At,h as jt,l as Mt,n as Nt,o as Pt,s as Ft,t as It,u as Lt,x as Rt}from"./requireStepUpAuth-DC9LSyRI.js";import{a as zt,c as Bt,i as Vt,n as Ht,r as Ut,s as Wt,t as Gt}from"./transactionState-C8aYSDRA.js";const Kt=Symbol(`ClientSecretSource`),qt=Symbol(`EmailOtpWorkerSessionHandle`);function Jt(e,t){let n=String(e||``).trim();if(!n)throw Error(`[platform] ${t} is required`);return n}function Yt(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`[platform] ${t} must be an object`);return e}function Xt(e){return Zt({prfFirstB64u:e.prf.prfFirstB64u,rpId:e.rpId,credentialIdB64u:e.credentialIdB64u})}function Zt(e){return{kind:`webauthn_prf_first`,prfFirstB64u:Jt(e.prfFirstB64u,`prfFirstB64u`),rpId:e.rpId,credentialIdB64u:Jt(e.credentialIdB64u,`credentialIdB64u`),[Kt]:`webauthn_prf_first`}}function Qt(e){let t=Jt(e.sessionId,`sessionId`);switch(e.action){case`threshold_ecdsa_bootstrap`:return{kind:`email_otp_worker_session_handle_v1`,sessionId:t,walletId:e.walletId,keyHandle:Jt(e.keyHandle,`keyHandle`),authSubjectId:e.authSubjectId,action:`threshold_ecdsa_bootstrap`,operation:e.operation,chainTarget:e.chainTarget,[qt]:`email_otp_worker_session_handle`};case`threshold_ed25519_session`:return{kind:`email_otp_worker_session_handle_v1`,sessionId:t,walletId:e.walletId,rpId:e.rpId,authSubjectId:e.authSubjectId,action:`threshold_ed25519_session`,operation:e.operation,[qt]:`email_otp_worker_session_handle`};default:{let t=e;throw Error(`[platform] unsupported email OTP worker-issued handle action: ${String(t)}`)}}}function $t(e){let t=Yt(e,`email OTP worker-issued session handle`),n=Jt(String(t.kind||``),`email OTP worker-issued handle kind`);if(n!==`email_otp_worker_session_handle_v1`)throw Error(`[platform] unsupported email OTP worker-issued handle kind: ${n}`);let r=Jt(String(t.action||``),`email OTP worker-issued handle action`),i=Jt(String(t.operation||``),`email OTP worker-issued handle operation`);if(i!==`registration`&&i!==`wallet_unlock`&&i!==`sign`&&i!==`export`)throw Error(`[platform] unsupported email OTP worker-issued handle operation: ${i}`);let a=i,o={sessionId:Jt(String(t.sessionId||``),`email OTP worker-issued handle sessionId`),walletId:F(t.walletId),authSubjectId:we(t.authSubjectId),operation:a};if(r===`threshold_ecdsa_bootstrap`){if(`rpId`in t)throw Error(`[platform] email OTP ECDSA worker-issued handles cannot include rpId`);if(a===`registration`)throw Error(`[platform] registration Email OTP ECDSA worker-issued handles are retired`);let e=he(Yt(t.chainTarget,`email OTP worker-issued handle chainTarget`));if(`evmFamilySigningKeySlotId`in t)throw Error(`[platform] runtime Email OTP ECDSA handles cannot include evmFamilySigningKeySlotId`);return Qt({...o,action:r,operation:a,keyHandle:Jt(String(t.keyHandle||``),`email OTP worker-issued handle keyHandle`),chainTarget:e})}if(r===`threshold_ed25519_session`){if(`chainTarget`in t)throw Error(`[platform] email OTP Ed25519 worker-issued handles cannot include chainTarget`);if(`evmFamilySigningKeySlotId`in t||`keyHandle`in t)throw Error(`[platform] email OTP Ed25519 worker-issued handles cannot include ECDSA key identity`);return Qt({...o,action:r,rpId:Ce(t.rpId)})}throw Error(`[platform] unsupported email OTP worker-issued handle action: ${r}`)}function en(e){return e.action===`threshold_ecdsa_bootstrap`&&e.operation===`export`}function tn(e){let t=$t(e);if(!en(t))throw Error(`[platform] Email OTP ECDSA export requires an export worker handle`);return t}const nn=15e3;function rn(e){e.abort(`timeout`)}function an(e,t){let n=String(e??``).trim();if(!n)throw Error(`[threshold-ed25519] ${t} is required`);return n}function on(e){let t=an(Le(e.credential),`prfFirstB64u`);return{ok:!0,operation:`get_passkey`,requirePrfFirst:!0,credential:e.credential,credentialIdB64u:an(e.credential.rawId||e.credential.id,`credentialIdB64u`),rawIdB64u:String(e.credential.rawId||``).trim(),rpId:Ce(e.rpId),prf:{kind:`required`,prfFirstB64u:t}}}function sn(e){return{kind:`webauthn_prf_first_credential`,credential:e.credential,secretSource:Xt(on(e))}}function cn(e){return e.policySecretSource.secretSource.prfFirstB64u}function ln(e){if(typeof e!=`string`)return null;let t=Date.parse(e);return Number.isSafeInteger(t)&&t>Date.now()?t:null}function un(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0?e:null}async function dn(e){let i=n(r(e.relayerUrl));if(!i)return{ok:!1,code:`invalid_args`,message:`Missing relayerUrl for Wallet Session mint`};if(typeof fetch!=`function`)return{ok:!1,code:`unsupported`,message:`fetch is not available for Wallet Session mint`};let a=Re(e.auth.policySecretSource.credential),o=new AbortController,c=null;try{let n=`${i}${C}`,r=e.existingOperationCredential,l=String(e.publishableKey||``).trim()||void 0,u=r?.token||l,d=!r&&l&&String(e.projectEnvironmentId||``).trim()||void 0;c=setTimeout(rn,nn,o);let f=await fetch(n,{method:`POST`,headers:{"Content-Type":`application/json`,...u?{Authorization:`Bearer ${u}`}:{}},credentials:`omit`,signal:o.signal,body:JSON.stringify({sessionKind:e.sessionKind,relayerKeyId:e.relayerKeyId,sessionPolicy:e.sessionPolicy,...d?{projectEnvironmentId:d}:{},walletSessionTarget:{kind:`new_wallet_session`},...a?{webauthn_authentication:a}:{}})}),p;try{let e=await f.json();p=s(e)?e:{}}catch(e){if(o.signal.aborted)throw e;p={}}if(!f.ok)return Ve(p)||{ok:!1,code:typeof p.code==`string`?p.code:`http_error`,message:typeof p.message==`string`?p.message:`HTTP ${f.status}`};let m=Ve(p);if(m)return m;if(p.ok!==!0)return{ok:!1,code:typeof p.code==`string`?p.code:`invalid_response`,message:typeof p.message==`string`?p.message:`Wallet Session mint returned an unsuccessful response`};let h=t(p.thresholdSessionId);if(!h.ok)return{ok:!1,code:`invalid_response`,message:`Wallet Session mint returned an invalid thresholdSessionId`};let g=D(p.walletSessionId),_=ae(p.authorizationId),v=T(p.quotaId);if(!g.ok||!_.ok||!v.ok)return{ok:!1,code:`invalid_response`,message:`Wallet Session mint returned invalid authorization identity`};let y=ln(p.expiresAt),b=un(p.remainingUses),ee=te(p.runtimePolicyScope);if(!y||!b||!ee)return{ok:!1,code:`invalid_response`,message:`Wallet Session mint returned invalid lifecycle or policy data`};let S={ok:!0,thresholdSessionId:h.value,walletSessionId:g.value,authorizationId:_.value,quotaId:v.value,expiresAtMs:y,remainingUses:b,runtimePolicyScope:ee};if(p.sessionKind===`issued_exact_wallet_session`){let e;try{e=x(p.operationCredential)}catch(e){return{ok:!1,code:`invalid_response`,message:j(e)||`Wallet Session mint returned an invalid operation credential`}}return e.walletSessionId===g.value?{...S,sessionKind:p.sessionKind,operationCredential:e}:{ok:!1,code:`invalid_response`,message:`Wallet Session mint credential does not identify its session`}}return p.sessionKind!==`already_committed_exact_wallet_session`||p.operationCredential!==void 0?{ok:!1,code:`invalid_response`,message:`Wallet Session mint returned an invalid session branch`}:r?r.walletSessionId===g.value?{...S,sessionKind:p.sessionKind}:{ok:!1,code:`invalid_response`,message:`Reused Wallet Session mint returned another lifecycle identity`}:{ok:!1,code:`invalid_response`,message:`Reused Wallet Session mint requires the credential the caller already holds`}}catch(e){let t=j(e)||`Failed to mint threshold session`,n=o.signal.aborted;return{ok:!1,code:n?`timeout`:`network_error`,message:n?`Wallet Session mint timed out after ${nn}ms`:t}}finally{c!==null&&clearTimeout(c)}}function fn(e){switch(e.kind){case`passkey`:return{kind:`passkey`,authority:e.authority,webauthn_authentication:Re(e.credential)};case`email_otp`:return{kind:`email_otp`,authority_ref:e.authorityRef,provider_subject_id:an(e.providerSubjectId,`providerSubjectId`),challenge_id:an(e.challengeId,`challengeId`),otp_code:an(e.otpCode,`otpCode`)};default:throw Error(`[threshold-ed25519] unsupported operation step-up proof`)}}function pn(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`[threshold-ed25519] ${t} must be an object`);return e}function mn(e,t,n){let r=Object.keys(e).sort(),i=[...t].sort();if(r.length!==i.length)throw Error(`[threshold-ed25519] ${n} contains unexpected fields`);for(let e=0;e<r.length;e+=1)if(r[e]!==i[e])throw Error(`[threshold-ed25519] ${n} contains unexpected fields`)}function hn(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw Error(`[threshold-ed25519] ${t} must be a non-empty normalized string`);return e}function gn(e){switch(e.proof.kind){case`passkey`:if(e.materialRecovery.kind!==`not_requested`)throw Error(`[threshold-ed25519] passkey operation step-up cannot request material recovery`);return{kind:`not_requested`};case`email_otp`:switch(e.materialRecovery.kind){case`not_requested`:return{kind:`not_requested`};case`email_otp_factor_release_v1`:return{kind:`email_otp_factor_release_v1`,workerEphemeralPublicKey65B64u:hn(e.materialRecovery.workerEphemeralPublicKey65B64u,`workerEphemeralPublicKey65B64u`)};default:throw e.materialRecovery,Error(`[threshold-ed25519] unsupported material recovery request`)}default:throw e.proof,Error(`[threshold-ed25519] unsupported operation step-up proof`)}}function _n(e){let t=pn(e.value,`operation step-up material recovery`);switch(t.kind){case`not_requested`:if(mn(t,[`kind`],`operation step-up material recovery`),e.requested.kind!==`not_requested`)throw Error(`[threshold-ed25519] operation step-up material recovery response does not match the request`);return{kind:`not_requested`};case`email_otp_factor_release_v1`:if(mn(t,[`kind`,`challengeId`,`enrollmentId`,`enrollmentSealKeyVersion`,`serverEphemeralPublicKey65B64u`,`nonce12B64u`,`ciphertextB64u`],`operation step-up material recovery`),e.requested.kind!==`email_otp_factor_release_v1`)throw Error(`[threshold-ed25519] operation step-up material recovery response does not match the request`);return{kind:`email_otp_factor_release_v1`,challengeId:hn(t.challengeId,`materialRecovery.challengeId`),enrollmentId:hn(t.enrollmentId,`materialRecovery.enrollmentId`),enrollmentSealKeyVersion:hn(t.enrollmentSealKeyVersion,`materialRecovery.enrollmentSealKeyVersion`),serverEphemeralPublicKey65B64u:hn(t.serverEphemeralPublicKey65B64u,`materialRecovery.serverEphemeralPublicKey65B64u`),nonce12B64u:hn(t.nonce12B64u,`materialRecovery.nonce12B64u`),ciphertextB64u:hn(t.ciphertextB64u,`materialRecovery.ciphertextB64u`)};default:throw Error(`[threshold-ed25519] operation step-up material recovery kind is invalid`)}}function vn(e){let t=pn(e.body,`operation step-up response`);if(mn(t,[`ok`,`kind`,`authorization`,`expiresAtMs`,`materialRecovery`],`operation step-up response`),t.ok!==!0||t.kind!==`verified_step_up`)throw Error(`[threshold-ed25519] operation step-up response kind is invalid`);let n=pn(t.authorization,`operation step-up authorization`);if(mn(n,[`kind`,`evidence_set_digest`],`operation step-up authorization`),n.kind!==`operation_step_up`)throw Error(`[threshold-ed25519] operation step-up authorization marker is invalid`);let r=hn(n.evidence_set_digest,`operation step-up authorization.evidence_set_digest`);if(A(r),typeof t.expiresAtMs!=`number`||!Number.isSafeInteger(t.expiresAtMs)||t.expiresAtMs<=Date.now())throw Error(`[threshold-ed25519] operation step-up expiry is invalid`);return{kind:`verified_step_up`,authorization:{kind:`operation_step_up`,evidence_set_digest:r},expiresAtMs:t.expiresAtMs,materialRecovery:_n({value:t.materialRecovery,requested:e.requestedMaterialRecovery})}}async function yn(e){let t=n(r(e.relayerUrl));if(!t)throw Error(`[threshold-ed25519] operation step-up relayerUrl is required`);let i=gn(e),a=e.credential.kind===`wallet_session_opaque`?{token:e.credential.walletSessionToken,home:e.credential.home}:null,o=m({...a?{headers:p(a)}:{},body:{kind:`router_ab_ed25519_yao_operation_step_up_grant_v1`,normalSigningRequest:e.normalSigningRequest,displayDigest:e.displayDigest,proof:fn(e.proof),materialRecovery:i.kind===`email_otp_factor_release_v1`?{kind:i.kind,worker_ephemeral_public_key_65_b64u:i.workerEphemeralPublicKey65B64u}:i}}),s=await fetch(`${t}${C}`,{...o}),c=await s.json().catch(()=>({}));if(!s.ok){let e=c&&typeof c==`object`&&!Array.isArray(c)?c:{};throw Error(`[threshold-ed25519] operation step-up failed: ${String(e.message||`HTTP ${s.status}`)}`)}return vn({body:c,requestedMaterialRecovery:i})}function bn(e){let t=e.lane,n=e.readiness;if(t.curve!==n.curve)throw Error(`[SigningSession] planner lane and readiness curves do not match`);if(t.curve===`ecdsa`&&n.curve===`ecdsa`){let e=t.authorization,r=n.authorization,a=e.session,o=r.session;if(!i(t.materialActivation,n.materialActivation)||e.selectedAuthority.authorityId!==r.selectedAuthority.authorityId||e.selectedAuthMethod.kind!==r.selectedAuthMethod.kind||e.selectedAuthMethod.walletAuthMethodId!==r.selectedAuthMethod.walletAuthMethodId||a.walletId!==o.walletId||a.authorityId!==o.authorityId||a.authMethodId!==o.authMethodId||a.authorizationId!==o.authorizationId||a.quotaId!==o.quotaId||a.authorityDigestB64u!==o.authorityDigestB64u||a.authorityRevocationEpoch!==o.authorityRevocationEpoch||e.operationCredential.walletSessionId!==r.operationCredential.walletSessionId||e.operationCredential.token!==r.operationCredential.token)throw Error(`[SigningSession] planner ECDSA readiness authority does not match its lane`)}let r=Sn(e);if(r)return{kind:V.NotReady,lane:t,reason:r};let a=e.forceFreshAuth||e.sensitiveOperationPolicy===`require_fresh_same_method`||t.retention===`single_use`;if(n.status===`ready`&&!a){if(t.curve===`ed25519`&&n.curve===`ed25519`)return{kind:V.WarmSession,lane:t,keyRef:{kind:ke.Cached,curve:`ed25519`,thresholdSessionId:n.thresholdSessionId}};if(t.curve!==`ecdsa`||n.curve!==`ecdsa`)throw Error(`[SigningSession] planner lane and readiness curves do not match`);return{kind:V.WarmSession,lane:t,keyRef:{kind:ke.Cached,curve:`ecdsa`,materialActivation:n.materialActivation,authorization:n.authorization}}}if(n.status===`auth_unavailable`||n.status===`status_unavailable`||n.status===`status_unknown`)return{kind:V.NotReady,lane:t,reason:n.status};if(B(t.auth)===`email_otp`)return{kind:V.EmailOtpReauth,lane:t,challenge:{chainFamily:t.chainFamily,lane:t}};if(t.curve===`ed25519`&&n.curve===`ed25519`)return{kind:V.PasskeyReauth,lane:t,reconnect:{lane:t,curve:`ed25519`,thresholdSessionId:n.thresholdSessionId}};if(t.curve!==`ecdsa`||n.curve!==`ecdsa`)throw Error(`[SigningSession] planner lane and readiness curves do not match`);return{kind:V.PasskeyReauth,lane:t,reconnect:{lane:t,curve:`ecdsa`,materialActivation:n.materialActivation,authorization:n.authorization}}}function xn(e,t){return{event:`signing_planner_decision`,readinessStatus:e.readiness.status,forceFreshAuth:!!e.forceFreshAuth,...e.sensitiveOperationPolicy?{sensitiveOperationPolicy:e.sensitiveOperationPolicy}:{},plan:De(t),lane:Te(e.lane),...t.kind===V.NotReady?{reason:t.reason}:{}}}function Sn(e){return B(e.lane.auth)===`email_otp`&&(e.sensitiveOperationPolicy===`deny_email_otp`||e.sensitiveOperationPolicy===`require_passkey`)?`policy_blocked`:null}async function Cn(e,t){let n=I(e),r=await Be(t,ze(n)).catch(()=>null);if(!r?.profileId)throw Error(`No profile/account mapping for account ${n}`);let i=await t.getLastProfileState().catch(()=>null);if(!i?.profileId||i.profileId!==r.profileId)throw Error(`No last user session for account ${n}`);let a=be(i.activeSignerSlot,{min:1});if(a===null)throw Error(`Invalid last-user signerSlot for account ${n}`);return a}var K=function(e){return e.Query=`query`,e.Send=`send_tx`,e.Block=`block`,e}(K||{}),wn=class e{transaction;signature;borsh_bytes;nonceLease;serverDispatch;constructor(e){this.transaction=e.transaction,this.signature=e.signature,this.borsh_bytes=e.borsh_bytes,e.nonceLease&&(this.nonceLease=e.nonceLease),e.serverDispatch&&(this.serverDispatch=e.serverDispatch)}static fromPlain(t){return new e({transaction:t.transaction,signature:t.signature,borsh_bytes:t.borsh_bytes,...t.nonceLease?{nonceLease:t.nonceLease}:{},...t.serverDispatch?{serverDispatch:t.serverDispatch}:{}})}encode(){return new Uint8Array(this.borsh_bytes).buffer}base64Encode(){return _(this.encode())}};function Tn(e){if(!e)return null;if(Array.isArray(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e)){let t=e;return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}return e instanceof ArrayBuffer?e:null}function En(e){let t=e?.signedTransaction,n=t&&typeof t==`object`?t:e,r=n.base64Encode;if(l(r))return r.call(n);let i=n.encode;if(l(i))return _(i.call(n));let a=Tn(n.borsh_bytes);if(a)return _(a);let o=Tn(n.borshBytes);if(o)return _(o);throw Error(`Invalid signed transaction payload: cannot serialize to base64`)}var Dn=class e{rpcUrls;constructor(t){this.rpcUrls=e.normalizeRpcUrls(t)}static normalizeRpcUrls(e){let t=(Array.isArray(e)?e:e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)).map(e=>{try{return new URL(e).toString()}catch(t){let n=j(t)||`Invalid NEAR RPC URL: ${e}`;throw Error(n)}});if(!t.length)throw Error(`NEAR RPC URL cannot be empty`);return Array.from(new Set(t))}errorFromHttpStatus(e){return Error(`RPC request failed: ${e.status} ${e.statusText}`)}errorFromFailedCall(e,t){return t}sendWithRetry(e){return e()}buildRequestBody(e,t){return JSON.stringify({jsonrpc:`2.0`,id:ee(`near-rpc`,32,`NEAR JSON-RPC request IDs`),method:e,params:t})}async postOnce(e,t){let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:t});if(!n.ok)throw this.errorFromHttpStatus(n);let r=await n.text();if(!r?.trim())throw Error(`Empty response from RPC server`);let i=Se(JSON.parse(r));if(!i.ok)throw Error(`Invalid NEAR JSON-RPC response: ${i.error}`);return i.value}async requestWithFallback(e){let t;for(let[n,r]of this.rpcUrls.entries())try{let t=await this.postOnce(r,e);return n>0&&console.warn(`[NearClient] RPC succeeded via fallback: ${r}`),t}catch(e){t=e;let i=n<this.rpcUrls.length-1;if(console.warn(`[NearClient] RPC call to ${r} failed${i?`, trying next`:``}: ${j(e)||`RPC request failed`}`),!i)throw e instanceof Error?e:Error(String(e))}throw Error(j(t)||`RPC request failed`)}unwrapRpcResult(e,t){if(e.kind===`failure`)throw this.errorFromRpc(t,e.error);let n=e.result;if(typeof n==`object`&&n&&`error`in n){let e=Reflect.get(n,`error`),r=typeof e==`string`?e:JSON.stringify(e);throw this.errorFromWrappedResult(`${t} Error: ${r}`)}return e.result}async makeRpcCall(e,t,n,r){let i=this.buildRequestBody(e,t);try{let e=await this.requestWithFallback(i);return r(this.unwrapRpcResult(e,n))}catch(e){throw this.errorFromFailedCall(n,e)}}async query(e,t){return this.makeRpcCall(K.Query,e,`Query`,t)}async viewAccessKey(e,t,n){let r={request_type:`view_access_key`,finality:n?.finality||`final`,account_id:e,public_key:t};return this.makeRpcCall(K.Query,r,`View Access Key`,me)}async viewAccessKeyList(e,t){let n={request_type:`view_access_key_list`,finality:t?.finality||`final`,account_id:e};return this.makeRpcCall(K.Query,n,`View Access Key List`,de)}async viewAccount(e){let t={request_type:`view_account`,finality:`final`,account_id:e};return this.makeRpcCall(K.Query,t,`View Account`,se)}async viewCode(e,t){let n={request_type:`view_code`,finality:t?.finality||`final`,account_id:e};return y(await this.makeRpcCall(K.Query,n,`View Code`,pe))}async viewBlock(e){return this.makeRpcCall(K.Block,e,`View Block`,ce)}async sendTransaction(e,t=`EXECUTED_OPTIMISTIC`){let n={signed_tx_base64:En(e),wait_until:t};return this.sendWithRetry(async()=>{let e=await this.makeRpcCall(K.Send,n,`Send Transaction`,ue),t=e.status;if(t&&typeof t==`object`&&`Failure`in t)throw this.errorFromOutcome(`Send Transaction`,e,t.Failure);return e})}async txStatus(e,t){let n={tx_hash:e,sender_account_id:t};return this.makeRpcCall(`EXPERIMENTAL_tx_status`,n,`Tx Status`,ue)}async callFunction(e,t,n,r,i){let a={request_type:`call_function`,...i??{finality:`final`},account_id:e,method_name:t,args_base64:_(new TextEncoder().encode(JSON.stringify(n)).buffer)};return r(le((await this.makeRpcCall(K.Query,a,`View Function`,fe)).result))}async view(e){return this.callFunction(e.account,e.method,e.args,e.decodeResult)}async getAccessKeys({account:e,block_id:t}){let n={request_type:`view_access_key_list`,account_id:e,finality:`final`};t&&(n.block_id=t,delete n.finality);let r=await this.makeRpcCall(K.Query,n,`View Access Key List`,de),i=[],a=[];for(let e of r.keys)e.access_key.permission===`FullAccess`?i.push(e):e.access_key.permission&&typeof e.access_key.permission==`object`&&`FunctionCall`in e.access_key.permission&&a.push(e);return{fullAccessKeys:i,functionCallAccessKeys:a}}};function On(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function kn(e){if(!e)return;let t=Object.keys(e);return t.length?t[0]:void 0}var An=class e extends Error{code;type;kind;index;short;details;operation;constructor(e){super(e.message),this.name=e.name||`NearRpcError`,this.code=e.code,this.type=e.type||`Unknown`,this.kind=e.kind,this.index=e.index,this.short=e.short,this.details=e.details,this.operation=e.operation}static fromOutcome(t,n,r){let{message:i,type:a,kind:o,index:s,short:c}=Mn(t,r);return new e({message:i||`${t} failed`,short:c||o||`TxExecutionError`,type:a||`Failure`,kind:o,index:s,name:`TxExecutionFailure`,operation:t,details:{Failure:r,outcome:n}})}static fromRpcError(t,n){let r=n.data,{message:i,type:a,kind:o,index:s,short:c}=jn(t,r,n.message);return new e({message:i||n.message||`${t} RPC error`,short:c||o||`RPC error`,type:a||`RpcError`,kind:o,index:s,code:typeof n.code==`number`?n.code:void 0,name:n.name||`NearRpcError`,operation:t,details:r})}};function jn(e,t,n=``){let r=On(t)?t:void 0,i=On(r?.TxExecutionError)?r.TxExecutionError:void 0;if(!i){let i=typeof t==`string`&&t.trim()?t.trim():r?JSON.stringify(r):n.trim();return{message:`${e} RPC error${i?`: ${i}`:``}`}}return Nn(e,i)}function Mn(e,t){let n=On(t)?t:void 0;return n?Nn(e,n):{message:`${e} failed (Unknown Failure)`}}function Nn(e,t){if(On(t.InvalidTxError)){let n=t.InvalidTxError,r=kn(n)||`InvalidTxError`;On(n.ActionsValidation)&&(r=`ActionsValidation.${kn(n.ActionsValidation)}`);let i=r.startsWith(`ActionsValidation.`)?`InvalidTxError: ${r.split(`.`)[1]||`ActionsValidation`}`:`InvalidTxError: ${r}`;return{message:`${e} failed (InvalidTxError: ${r})`,type:`InvalidTxError`,kind:r,short:i}}if(On(t.ActionError)){let n=t.ActionError,r=typeof n.index==`number`?n.index:void 0,i=kn(On(n.kind)?n.kind:void 0)||`ActionError`,a=typeof r==`number`?` at action ${r}`:``,o=`ActionError: ${i}`;return{message:`${e} failed${a} (ActionError: ${i})`,type:`ActionError`,kind:i,index:r,short:o}}return{message:`${e} failed (TxExecutionError)`,type:`TxExecutionError`,kind:`TxExecutionError`,short:`TxExecutionError`}}var Pn=class e extends wn{static fromPlain(t){return new e({transaction:t.transaction,signature:t.signature,borsh_bytes:t.borsh_bytes,...t.nonceLease?{nonceLease:t.nonceLease}:{},...t.serverDispatch?{serverDispatch:t.serverDispatch}:{}})}static decode(){throw Error(`SignedTransaction.decode(): borsh deserialization not implemented`)}},Fn=class extends Dn{errorFromRpc(e,t){return An.fromRpcError(e,t)}errorFromWrappedResult(e){return new An({message:e,short:`RpcError`,type:`RpcError`})}errorFromOutcome(e,t,n){return An.fromOutcome(e,t,n)}errorFromHttpStatus(e){return e.status===429?Error(`RPC throttled; retry shortly`):super.errorFromHttpStatus(e)}async sendWithRetry(e){let t=null;for(let n=1;n<=5;n++)try{return await e()}catch(e){t=e;let r=j(e);if(!/server error|internal|temporar|timeout|throttl|too many requests|429|unavailable|bad gateway|gateway timeout/i.test(r||``)||n===5)throw e;let i=200*2**(n-1),a=Math.floor(Math.random()*150);await new Promise(e=>setTimeout(e,i+a))}throw t instanceof Error?t:Error(String(t))}};function In(e){try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t,2)}catch{return String(e)}}function q(e,t,n){let r=String(t??``).trim();if(r)return{label:e,value:r,...typeof n==`string`&&n.trim()?{copyValue:n}:{}}}function Ln(e){switch(e.action_type){case W.Transfer:case W.FunctionCall:return BigInt(e.deposit||`0`);case W.Stake:return BigInt(e.stake||`0`);default:return BigInt(0)}}function Rn(e){try{let t=JSON.parse(e)?.permission;if(t===`FullAccess`)return`FullAccess`;if(t&&typeof t==`object`){if(`FullAccess`in t)return`FullAccess`;if(`FunctionCall`in t)return`FunctionCall`}}catch{return`Unknown`}return`Unknown`}function zn(e){let{action:t,txIndex:n,actionIndex:r,receiverId:i}=e,a=`near.tx.${n}.action.${r}`;switch(t.action_type){case W.CreateAccount:return{id:a,kind:`near.action`,actionType:`createAccount`,label:`Action ${r+1}: CreateAccount`,fields:[q(`Receiver`,i)].filter(Boolean)};case W.Transfer:return{id:a,kind:`near.action`,actionType:`transfer`,label:`Action ${r+1}: Transfer`,fields:[q(`Receiver`,i),q(`Amount (yoctoNEAR)`,t.deposit)].filter(Boolean)};case W.FunctionCall:{let e=String(t.args||``),n=e?[{id:`${a}.args`,kind:`raw.fallback`,label:`Function Arguments`,raw:e}]:[];return{id:a,kind:`near.action`,actionType:`functionCall`,label:`Action ${r+1}: FunctionCall`,fields:[q(`Receiver`,i),q(`Method`,t.method_name),q(`Gas`,t.gas),q(`Deposit (yoctoNEAR)`,t.deposit)].filter(Boolean),...n.length?{children:n}:{}}}case W.Stake:return{id:a,kind:`near.action`,actionType:`stake`,label:`Action ${r+1}: Stake`,fields:[q(`Receiver`,i),q(`Stake (yoctoNEAR)`,t.stake),q(`Validator Key`,t.public_key,t.public_key)].filter(Boolean)};case W.AddKey:return{id:a,kind:`near.action`,actionType:`addKey`,label:`Action ${r+1}: AddKey`,fields:[q(`Receiver`,i),q(`Public Key`,t.public_key,t.public_key),q(`Permission`,Rn(t.access_key))].filter(Boolean)};case W.DeleteKey:return{id:a,kind:`near.action`,actionType:`deleteKey`,label:`Action ${r+1}: DeleteKey`,fields:[q(`Receiver`,i),q(`Public Key`,t.public_key,t.public_key)].filter(Boolean)};case W.DeployContract:return{id:a,kind:`near.action`,actionType:`deployContract`,label:`Action ${r+1}: DeployContract`,fields:[q(`Receiver`,i),q(`Code Bytes`,String(t.code?.length??0))].filter(Boolean)};case W.DeployGlobalContract:return{id:a,kind:`near.action`,actionType:`deployGlobalContract`,label:`Action ${r+1}: DeployGlobalContract`,fields:[q(`Receiver`,i),q(`Deploy Mode`,t.deploy_mode),q(`Code Bytes`,String(t.code?.length??0))].filter(Boolean)};case W.UseGlobalContract:return{id:a,kind:`near.action`,actionType:`useGlobalContract`,label:`Action ${r+1}: UseGlobalContract`,fields:[q(`Receiver`,i),q(`By Account`,t.account_id),q(`By Code Hash`,t.code_hash,t.code_hash)].filter(Boolean)};case W.DeleteAccount:return{id:a,kind:`near.action`,actionType:`deleteAccount`,label:`Action ${r+1}: DeleteAccount`,fields:[q(`Receiver`,i),q(`Beneficiary`,t.beneficiary_id)].filter(Boolean)};case W.SignedDelegate:return{id:a,kind:`near.action`,actionType:`signedDelegate`,label:`Action ${r+1}: SignedDelegate`,children:[{id:`${a}.delegate`,kind:`raw.fallback`,label:`Signed Delegate Payload`,raw:In(t)}]};default:return{id:a,kind:`raw.fallback`,label:`Action ${r+1}: Unsupported`,raw:In(t)}}}function Bn(e,t,n){let r=String(e.receiverId||``).trim()||`(unknown receiver)`,i=Array.isArray(e.actions)?e.actions:[],a=i.reduce((e,t)=>e+Ln(t),BigInt(0)),o=[q(`Receiver`,r),q(`Action Count`,String(i.length)),q(`Attached Value (yoctoNEAR)`,a>0?a.toString():void 0)].filter(Boolean);return{id:`near.tx.${t}`,kind:`generic.contractCall`,label:n>1?`Transaction ${t+1}`:`Transaction`,to:r,value:a>0?a.toString():void 0,fields:o,children:i.map((e,n)=>zn({action:e,txIndex:t,actionIndex:n,receiverId:r}))}}function Vn(e){let t=Array.isArray(e.txSigningRequests)?e.txSigningRequests:[],n=t.map((e,n)=>Bn(e,n,t.length)),r=t.reduce((e,t)=>e+(Array.isArray(t.actions)?t.actions.reduce((e,t)=>e+Ln(t),BigInt(0)):BigInt(0)),BigInt(0));return{chain:`near`,intentDigest:e.intentDigest,signerAccount:e.signerAccount,title:e.title||`NEAR Transaction`,subtitle:e.subtitle,operations:n,...r>0?{totals:{nativeValue:r.toString(),nativeSymbol:`yoctoNEAR`}}:{}}}function Hn(e){let t={id:`near.message`,kind:`near.message`,label:`Message signature`,fields:[q(`Signer`,e.signerAccount,e.signerAccount),q(`Recipient`,e.recipient,e.recipient),{label:`Message`,value:e.message,copyValue:e.message,renderAs:`file-content`,hideChevron:!0}].filter(Boolean)};return{chain:`near`,intentDigest:e.intentDigest,signerAccount:e.signerAccount,title:e.title||`NEP-413 message`,subtitle:e.subtitle,operations:[t]}}function Un(e){try{return Vn(e)}catch{return{chain:`near`,signerAccount:e.signerAccount,...e.title?{title:e.title}:{},...e.subtitle?{subtitle:e.subtitle}:{},operations:[]}}}async function Wn(e){let t=I(e.nearAccount.accountId),n=be(e.signerSlot,{min:1});if(n===null)throw Error(`Invalid signerSlot for ${e.operationLabel}: ${e.signerSlot}`);if(e.requestedSignerSlot!==void 0){let t=be(e.requestedSignerSlot,{min:1});if(t===null||t!==n)throw Error(`Requested signerSlot does not match the selected signing lane for ${e.operationLabel}`)}let r=await e.materialExecutor.resolveSigningKeyMaterial();if(r.nearAccountId!==t||r.signerSlot!==n)throw Error(`[SigningEngine] threshold key material does not match the selected lane`);return{thresholdKeyMaterial:r}}function Gn(e){let t=qn({nearAccountId:e.nearAccountId,tx:e.transaction,txIndex:0});return{txSigningRequest:t,confirmationTransaction:{receiverId:t.receiverId,actions:t.actions}}}function Kn(e){let t=e.delegate.actions.map(Me);t.forEach((e,t)=>{try{Pe(e)}catch(e){throw Error(`Delegate action ${t} validation failed: ${e instanceof Error?e.message:String(e)}`)}});let n={senderId:e.delegate.senderId||e.nearAccountId,receiverId:e.delegate.receiverId,actions:t,nonce:e.delegate.nonce,maxBlockHeight:e.delegate.maxBlockHeight};return{confirmationDelegate:n,workerDelegate:{...n,nonce:e.delegate.nonce.toString(),maxBlockHeight:e.delegate.maxBlockHeight.toString(),publicKey:e.signingPublicKey}}}function qn(e){let t=String(e.tx?.receiverId||``).trim();if(!t)throw Error(`[SigningEngine] transactions[${e.txIndex}].receiverId is required`);let n=Array.isArray(e.tx?.actions)?e.tx.actions:[];if(n.length===0)throw Error(`[SigningEngine] transactions[${e.txIndex}].actions must be non-empty`);for(let e=0;e<n.length;e++)Pe(n[e]);return{nearAccountId:e.nearAccountId,receiverId:t,actions:n}}async function Jn(e){return Qn({kind:`near:transactions_with_actions:planning`,payload:{purpose:`near_transaction`,...$n(e),transactions:er(e.transactions)}})}async function Yn(e){return Qn({kind:`near:transactions_with_actions`,payload:{purpose:`near_transaction`,...$n(e),transactions:er(e.transactions),unsignedTransactionBorshB64u:o(e.unsignedTransactionBorshB64u,`unsignedTransactionBorshB64u`),signingDigestB64u:o(e.signingDigestB64u,`signingDigestB64u`)}})}async function Xn(e){return Qn({kind:`near:nep413`,payload:{purpose:`nep413_message`,...$n(e),message:o(e.message,`message`),recipient:o(e.recipient,`recipient`),nonce:o(e.nonce,`nonce`),callbackUrl:e.callbackUrl}})}async function Zn(e){return Qn({kind:`near:delegate_action`,payload:{purpose:`delegate_action`,...$n(e),delegate:tr(e.delegate)}})}async function Qn(e){return`sha256:${g(await u(f({kind:o(e.kind,`kind`),payload:mr(e.payload)})))}`}function $n(e){return{nearAccountId:o(e.nearAccountId,`nearAccountId`),nearNetworkId:o(e.nearNetworkId,`nearNetworkId`),relayerKeyId:o(e.relayerKeyId,`relayerKeyId`),signerPublicKey:o(e.signerPublicKey,`signerPublicKey`)}}function er(e){if(!Array.isArray(e)||e.length<1)throw Error(`transactions must be a non-empty array`);return e.map((e,t)=>nr(e,`transactions[${t}]`))}function tr(e){return{senderId:o(e.senderId,`delegate.senderId`),receiverId:o(e.receiverId,`delegate.receiverId`),actions:rr(e.actions,`delegate.actions`),nonce:o(e.nonce,`delegate.nonce`),maxBlockHeight:o(e.maxBlockHeight,`delegate.maxBlockHeight`),publicKey:o(e.publicKey,`delegate.publicKey`)}}function nr(e,t){let n=a(e,t);return{nearAccountId:o(n.nearAccountId,`${t}.nearAccountId`),receiverId:o(n.receiverId,`${t}.receiverId`),actions:rr(n.actions,`${t}.actions`)}}function rr(e,t){if(!Array.isArray(e))throw Error(`${t} must be an array`);return e.map((e,n)=>ir(e,`${t}[${n}]`))}function ir(e,t){let n=a(e,t),r=o(n.action_type,`${t}.action_type`);switch(r){case`CreateAccount`:return{action_type:r};case`DeployContract`:return{action_type:r,code:lr(n.code,`${t}.code`)};case`FunctionCall`:return{action_type:r,method_name:o(n.method_name,`${t}.method_name`),args:o(n.args,`${t}.args`),gas:o(n.gas,`${t}.gas`),deposit:o(n.deposit,`${t}.deposit`)};case`Transfer`:return{action_type:r,deposit:o(n.deposit,`${t}.deposit`)};case`Stake`:return{action_type:r,stake:o(n.stake,`${t}.stake`),public_key:o(n.public_key,`${t}.public_key`)};case`AddKey`:return{action_type:r,public_key:o(n.public_key,`${t}.public_key`),access_key:o(n.access_key,`${t}.access_key`)};case`DeleteKey`:return{action_type:r,public_key:o(n.public_key,`${t}.public_key`)};case`DeleteAccount`:return{action_type:r,beneficiary_id:o(n.beneficiary_id,`${t}.beneficiary_id`)};case`SignedDelegate`:return{action_type:r,delegate_action:ar(n.delegate_action,`${t}.delegate_action`),signature:sr(n.signature,`${t}.signature`)};case`DeployGlobalContract`:return{action_type:r,code:lr(n.code,`${t}.code`),deploy_mode:fr(n.deploy_mode,`${t}.deploy_mode`)};case`UseGlobalContract`:return cr(n,t)}throw Error(`${t}.action_type is unsupported`)}function ar(e,t){let n=a(e,t);return{senderId:o(n.senderId,`${t}.senderId`),receiverId:o(n.receiverId,`${t}.receiverId`),actions:rr(n.actions,`${t}.actions`),nonce:dr(n.nonce,`${t}.nonce`),maxBlockHeight:dr(n.maxBlockHeight,`${t}.maxBlockHeight`),publicKey:or(n.publicKey,`${t}.publicKey`)}}function or(e,t){let n=a(e,t);return{keyType:ur(n.keyType,`${t}.keyType`),keyData:lr(n.keyData,`${t}.keyData`)}}function sr(e,t){let n=a(e,t);return{keyType:ur(n.keyType,`${t}.keyType`),signatureData:lr(n.signatureData,`${t}.signatureData`)}}function cr(e,t){let n=pr(e.account_id),r=pr(e.code_hash);if(n&&r)throw Error(`${t} requires exactly one of account_id or code_hash`);if(n)return{action_type:`UseGlobalContract`,account_id:n};if(r)return{action_type:`UseGlobalContract`,code_hash:r};throw Error(`${t} requires exactly one of account_id or code_hash`)}function lr(e,t){if(!Array.isArray(e))throw Error(`${t} must be an array`);return e.map((e,n)=>{if(typeof e!=`number`||!Number.isInteger(e)||e<0||e>255)throw Error(`${t}[${n}] must be a byte`);return e})}function ur(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e))throw Error(`${t} must be a safe integer`);return e}function dr(e,t){return typeof e==`bigint`||typeof e==`number`&&Number.isSafeInteger(e)?e:o(e,t)}function fr(e,t){let n=o(e,t);if(n===`CodeHash`||n===`AccountId`)return n;throw Error(`${t} is invalid`)}function pr(e){return String(e||``).trim()||null}function mr(e){if(typeof e==`bigint`)return e.toString(10);if(e instanceof Uint8Array)return{__bytesB64u:g(e)};if(ArrayBuffer.isView(e))return{__bytesB64u:g(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};if(e instanceof ArrayBuffer)return{__bytesB64u:g(new Uint8Array(e))};if(Array.isArray(e))return e.map(mr);if(!e||typeof e!=`object`)return e;let t={};for(let n of Object.keys(e).sort()){let r=mr(e[n]);r!==void 0&&(t[n]=r)}return t}async function hr(e){if(Tt(e.signingAuthPlan)&&!e.emailOtpEd25519StepUp)throw Error(`[SigningEngine][near] Email OTP step-up runner is unavailable`);if(wt(e.signingAuthPlan)&&!e.passkeyEd25519OperationStepUp)throw Error(`[SigningEngine][near] Passkey operation step-up runner is unavailable`);let t=null,n=await It({operation:{kind:`near_ed25519_step_up`,requiredSignatureUses:e.requiredSignatureUses},selectedLane:{authMethod:B(e.signingLaneAuth)},policy:br(e.signingAuthPlan),methods:{...e.emailOtpEd25519StepUp?{emailOtp:{method:`email_otp`,prepareChallenge:async()=>await e.emailOtpEd25519StepUp.prepare({operationFingerprintDigest:e.operationFingerprintDigest}),...e.emailOtpEd25519StepUp.resend?{resendChallenge:async()=>await e.emailOtpEd25519StepUp.resend({operationFingerprintDigest:e.operationFingerprintDigest})}:{},complete:_r}}:{},passkey:{method:`passkey`,prepare:async()=>{if(!e.passkeyEd25519OperationStepUp)throw Error(`[SigningEngine][near] Passkey operation step-up runner is unavailable`);return t=await e.passkeyEd25519OperationStepUp.prepare(),{}},complete:vr}}}),r=e.signingAuthPlan;if(n.method===`warm_session`){if(!xr(r))throw Error(`[SigningEngine][near] warm-session step-up requires a warm-session plan`);return{kind:`warm_session`,confirmationAuthPayload:{signingAuthPlan:r}}}if(n.method===`email_otp`){if(!Tt(r))throw Error(`[SigningEngine][near] Email OTP step-up requires an Email OTP plan`);return{kind:`email_otp`,confirmationAuthPayload:{signingAuthPlan:{kind:`emailOtpReauth`,method:`email_otp`,emailOtpPrompt:n.prompt}},emailOtpPrompt:n.prompt}}if(!wt(r))throw Error(`[SigningEngine][near] passkey step-up requires a passkey plan`);return{kind:`passkey`,confirmationAuthPayload:{signingAuthPlan:r},plannedPasskeyOperationStepUp:yr(t)}}function gr(e){switch(e.kind){case`voiceid`:throw Error(`Unlock with VoiceID again before signing.`);case`passkey`:return{kind:`passkeyReauth`,method:`passkey`};case`email_otp`:return{kind:`emailOtpReauth`,method:`email_otp`};default:throw Error(`[SigningEngine][near] unsupported material auth requirement`)}}async function _r(){}async function vr(){}function yr(e){if(!e)throw Error(`[SigningEngine][near] Passkey operation step-up plan is required`);return e}function br(e){if(Ct(e)){if(e.curve!==`ed25519`)throw Error(`[SigningEngine][near] warm-session step-up requires an Ed25519 auth plan`);return{kind:`reuse_warm_session`,authorization:{method:e.method,curve:`ed25519`,thresholdSessionId:e.thresholdSessionId,expiresAtMs:e.expiresAtMs,remainingUses:e.remainingUses}}}return{kind:`use_selected_lane`}}function xr(e){return Ct(e)&&e.curve===`ed25519`}function Sr(e,t,n){try{e?.(xe({...n,flowId:`signing:near:${String(t)}:${n.phase}`,accountId:String(t)}))}catch{}}function Cr(e,t){let n=Ft(e.signingAuthPlan);if(t.phase===`confirmation.complete`){if(n===`passkey`&&t.status===`succeeded`)return}else if(n!==`passkey`||t.phase!==`auth.passkey.prompt.started`&&t.phase!==`auth.passkey.prompt.succeeded`)return;let r=Pt(t,n);r&&Sr(e.onEvent,e.nearAccountId,{...r,authMethod:n})}function wr(e){return{kind:`warm_session`,signingAuthPlan:e,thresholdSessionId:e.thresholdSessionId,expiresAtMs:e.expiresAtMs,remainingUses:e.remainingUses}}function Tr(e){if(e.prepared.kind===`warm_session`)return wr(e.prepared.confirmationAuthPayload.signingAuthPlan);if(e.prepared.kind===`email_otp`)return{kind:`email_otp`,signingAuthPlan:e.prepared.confirmationAuthPayload.signingAuthPlan,challengeId:Dr(e.confirmation.emailOtpChallengeId,e.prepared.emailOtpPrompt.challengeId),otpCode:Er(e.confirmation.otpCode),...e.prepared.emailOtpPrompt.emailHint?{emailHint:e.prepared.emailOtpPrompt.emailHint}:{}};if(!e.confirmation.credential)throw Error(`[SigningEngine] missing WebAuthn credential for NEAR step-up authorization`);return{kind:`passkey`,signingAuthPlan:e.prepared.confirmationAuthPayload.signingAuthPlan,credential:Ie(e.confirmation.credential),plannedPasskeyOperationStepUp:e.prepared.plannedPasskeyOperationStepUp}}function Er(e){let t=String(e||``).trim();if(!/^\d{6}$/.test(t))throw Error(`[SigningEngine] missing Email OTP code for NEAR step-up authorization`);return t}function Dr(e,t){let n=String(e||t||``).trim();if(!n)throw Error(`[SigningEngine] missing Email OTP challenge id for NEAR step-up authorization`);return n}function Or(e){if(!e||!Array.isArray(e.actions)||e.actions.length===0)throw Error(`[SigningEngine][near] one NEAR transaction with actions is required`);return 1}function kr(e){throw Error(`[SigningEngine][near] exactly one NEAR transaction is supported per signing operation; received ${e.length}`)}const Ar=2e4;async function jr(e){return Rr(await U({ctx:e.workerCtx,kind:`nearSigner`,request:{type:M.ThresholdEd25519ComputeNep413SigningDigest,timeoutMs:Ar,payload:{message:e.message,recipient:e.recipient,nonce:e.nonce,callbackUrl:e.callbackUrl}}}))}async function Mr(e){return Rr(await U({ctx:e.workerCtx,kind:`nearSigner`,request:{type:M.ThresholdEd25519ComputeDelegateSigningDigest,timeoutMs:Ar,payload:{delegate:e.delegate}}}))}async function Nr(e){return zr(await U({ctx:e.workerCtx,kind:`nearSigner`,request:{type:M.ThresholdEd25519BuildDelegateSigningPayload,timeoutMs:Ar,payload:{delegate:e.delegate}}}))}async function Pr(e){return Br(await U({ctx:e.workerCtx,kind:`nearSigner`,request:{type:M.ThresholdEd25519FinalizeDelegateFromSignature,timeoutMs:Ar,payload:{delegate:e.delegate,signingDigestB64u:e.signingDigestB64u,signatureB64u:e.signatureB64u}}}))}async function Fr(e){let t=Vr(await U({ctx:e.workerCtx,kind:`nearSigner`,request:{type:M.ThresholdEd25519BuildNearTxUnsignedBorsh,timeoutMs:Ar,payload:{txSigningRequests:[e.txSigningRequest],transactionContext:e.transactionContext}}})),n=t[0];if(!n||t.length!==1)throw Error(`near signer worker returned invalid single-transaction unsigned payload`);return n}async function Ir(e){return Hr(await U({ctx:e.workerCtx,kind:`nearSigner`,request:{type:M.ThresholdEd25519FinalizeNearTxFromSignature,timeoutMs:Ar,payload:{unsignedTransactionBorshB64u:e.unsignedTransactionBorshB64u,signingDigestB64u:e.signingDigestB64u,signatureB64u:e.signatureB64u,expectedNearAccountId:e.expectedNearAccountId,expectedSignerPublicKey:e.expectedSignerPublicKey}}}))}async function Lr(e){return Ur(await U({ctx:e.workerCtx,kind:`nearSigner`,request:{type:M.ThresholdEd25519DecodeSignedNearTxBorsh,timeoutMs:Ar,payload:{signedTransactionBorshB64u:e.signedTransactionBorshB64u}}}))}function Rr(e){let t=e;if(!t?.signingDigestB64u)throw Error(`near signer worker returned invalid Ed25519 signing digest result`);return t}function zr(e){let t=e;if(!t?.canonicalDelegateBorshB64u||!t.signingDigestB64u)throw Error(`near signer worker returned invalid Ed25519 delegate signing payload`);return t}function Br(e){let t=e;if(!t?.delegateAction||!t.signature||!t.borshBytes)throw Error(`near signer worker returned invalid Ed25519 signed delegate result`);return t}function Vr(e){if(!Array.isArray(e))throw Error(`near signer worker returned invalid Ed25519 unsigned tx result`);return e.map(e=>{let t=e;if(!t?.unsignedTransactionBorshB64u||!t.signingDigestB64u)throw Error(`near signer worker returned invalid Ed25519 unsigned tx item`);return t})}function Hr(e){let t=e;if(!t?.signedTransactionBorshB64u||!t.transactionHash)throw Error(`near signer worker returned invalid Ed25519 finalized tx result`);return t}function Ur(e){let t=e;if(!t?.signedTransaction?.transaction||!t.signedTransaction.signature||!t.signedTransaction.borshBytes||!t.transactionHash)throw Error(`near signer worker returned invalid Ed25519 signed tx decode result`);return t}function Wr(e,t){return e.request_id===t.request_id&&e.account_id===t.account_id&&e.authorization.kind===t.authorization.kind&&(e.authorization.kind===`reusable_wallet_session`?t.authorization.kind===`reusable_wallet_session`&&e.authorization.wallet_session_id===t.authorization.wallet_session_id:t.authorization.kind===`operation_step_up`)&&e.material_activation.kind===t.material_activation.kind&&e.material_activation.activation_id===t.material_activation.activation_id&&e.material_activation.capability===t.material_activation.capability&&e.material_activation.material_owner===t.material_activation.material_owner&&e.material_activation.key_binding===t.material_activation.key_binding&&e.material_activation.lifecycle_binding===t.material_activation.lifecycle_binding&&e.material_activation.signing_worker===t.material_activation.signing_worker&&e.signing_worker_id===t.signing_worker_id}function Gr(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Kr(e){if(!Wr(e.request.scope,e.response.scope))throw Error(`Router A/B normal-signing prepare response scope mismatch`);if(e.request.expires_at_ms!==e.response.expires_at_ms)throw Error(`Router A/B normal-signing prepare response expiry mismatch`);if(e.response.signing_worker.server_id!==e.request.scope.signing_worker_id)throw Error(`Router A/B normal-signing prepare response SigningWorker mismatch`);if(!Gr(e.signingPayloadDigest.bytes,e.response.signing_payload_digest.bytes))throw Error(`Router A/B normal-signing prepare response payload digest mismatch`)}function qr(e){if(!Wr(e.request.scope,e.response.scope))throw Error(`Router A/B normal-signing response scope mismatch`);if(e.response.signing_worker.server_id!==e.request.scope.signing_worker_id)throw Error(`Router A/B normal-signing response SigningWorker mismatch`);if(!Gr(e.signingPayloadDigest.bytes,e.response.signing_payload_digest.bytes))throw Error(`Router A/B normal-signing response payload digest mismatch`);if(e.response.signature.bytes.length!==64)throw Error(`Router A/B normal-signing response signature must be 64 bytes`)}function J(e,t){let n=String(e||``).trim();if(!n)throw Error(`Router A/B Ed25519 normal-signing ready state is missing ${t}`);return n}function Y(e,t,n){if(e!==t)throw Error(`Router A/B Ed25519 normal-signing ready state ${n} mismatch`)}function Jr(e,t){let n=Math.floor(Number(e));if(!Number.isFinite(n)||n<=Date.now())throw Error(`Router A/B Ed25519 normal-signing ready state ${t} is expired`);return n}function Yr(e,t){let n=Math.floor(Number(e));if(!Number.isSafeInteger(n)||n<=0)throw Error(`Router A/B Ed25519 normal-signing ready state ${t} is exhausted`);return n}function Xr(e){let t=e.state,n=t.signingWalletSession,r=J(e.thresholdSessionId,`thresholdSessionId`),i=J(t.thresholdSessionId,`state.thresholdSessionId`),a=J(t.signingLane.thresholdSessionId,`state.signingLane.thresholdSessionId`);Y(i,r,`thresholdSessionId`),Y(a,r,`lane thresholdSessionId`);let o=J(t.walletSessionId,`state.walletSessionId`),s=J(t.quotaId,`state.quotaId`);Y(t.signingLane.walletSessionId,o,`lane walletSessionId`),Y(t.signingLane.quotaId,s,`lane quotaId`);let c=J(e.nearAccountId,`nearAccountId`);J(t.signingLane.identity.signer.account.wallet.walletId,`state.signingLane.identity.signer.account.wallet.walletId`),Y(J(e.thresholdKeyMaterial.nearAccountId,`thresholdKeyMaterial.nearAccountId`),c,`threshold key accountId`);let l=n.routerAbNormalSigning,u=J(n.auth.walletSessionToken,`Wallet Session bearer token`),d=J(t.signingRootId,`state.signingRootId`),f=J(t.signingRootVersion,`state.signingRootVersion`);Y(n.thresholdSessionId,r,`Wallet Session thresholdSessionId`),Y(n.walletSessionId,o,`Wallet Session walletSessionId`),Y(n.quotaId,s,`Wallet Session quotaId`),Y(n.signingRootId,d,`signingRootId`),Y(n.signingRootVersion,f,`signingRootVersion`),Y(t.routerAbNormalSigning.signingWorkerId,l.signingWorkerId,`signingWorkerId`),Jr(n.expiresAtMs,`expiresAtMs`);let p=Yr(n.remainingUses,`remainingUses`);if(t.remainingUses!==p)throw Error(`Router A/B Ed25519 normal-signing ready state remainingUses mismatch`);return{kind:`router_ab_ed25519_normal_signing_ready_state_v1`,relayerUrl:J(t.relayerUrl,`relayerUrl`),signingWorkerId:J(l.signingWorkerId,`signingWorkerId`),signerPublicKey:J(e.thresholdKeyMaterial.publicKey,`signerPublicKey`),credential:{kind:`wallet_session_opaque`,walletSessionToken:u,home:n.auth.credential.home}}}function Zr(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`operation step-up preparation ref must be an object`);let t=e;if(Object.keys(t).length!==3||t.kind!==`near_operation_step_up_prepared_v1`)throw Error(`operation step-up preparation ref is invalid`);let n=String(t.handle||``).trim();if(!n.startsWith(`near-operation-step-up:`)||/\s/.test(n))throw Error(`operation step-up preparation handle is invalid`);return{kind:`near_operation_step_up_prepared_v1`,handle:n,challengeB64u:A(t.challengeB64u)}}const Qr=new Map,$r=new Map;function ei(e,t){let n=String(e||``).trim();if(!n)throw Error(`[SigningEngine][near] ${t} is required`);return n}function ti(e){Qr.set(ei(e.requestId,`requestId`),e.build)}function ni(e){Qr.delete(String(e||``).trim())}const ri={async prepare(e){let t=ei(e.requestId,`requestId`),n=Qr.get(t);if(!n)throw Error(`[SigningEngine][near] operation step-up preparation is unavailable`);Qr.delete(t);let r=e.kind===`near_transaction`?await n({kind:`near_transaction`,transactionContext:e.transactionContext,operationId:ei(e.operationId,`operationId`),operationFingerprint:ei(e.operationFingerprint,`operationFingerprint`),displayDigest:ei(e.displayDigest,`displayDigest`)}):await n({kind:`near_signature_only`,displayDigest:ei(e.displayDigest,`displayDigest`)}),i=await Je(r.envelope),a=Zr({kind:`near_operation_step_up_prepared_v1`,handle:`near-operation-step-up:${b(24,`operation step-up handle`)}`,challengeB64u:i});return $r.set(a.handle,{requestId:t,operation:r.operation}),a},cancel(e){let t=String(e.requestId||``).trim();t&&Qr.delete(t),e.handle&&$r.delete(e.handle);for(let[e,n]of $r)n.requestId===t&&$r.delete(e)}};function ii(e){let t=ei(e.requestId,`requestId`),n=ei(Zr(e.ref).handle,`operation step-up handle`),r=$r.get(n);if($r.delete(n),!r||r.requestId!==t)throw Error(`[SigningEngine][near] prepared operation step-up is unavailable`);return r.operation}function ai(e){if(!i(e.expected,e.actual))throw Error(`[SigningEngine][near] operation assertion changed material activation`)}const oi=12e4;async function si(e){return await e.ctx.resolveOperationStepUpCredential({walletId:e.walletId,relayerUrl:e.relayerUrl,proof:e.proof})}function ci(e){if(e.prepared.prepare.request.scope.authorization.kind!==`operation_step_up`)throw Error(`[SigningEngine][near] operation step-up authorization scope is missing`);if(e.issuedAuthorization.kind!==`verified_step_up`)throw Error(`[SigningEngine][near] operation step-up authorization is invalid`)}function li(e){let t=e.thresholdKeyMaterial.participants.find(t=>t.role===e.role)?.id;if(!t)throw Error(`threshold-ed25519 signing requires ${e.role} participant id`);return t}function ui(e){return[...v(e)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function di(e){return ne(e.chains||_t.network.chains)}function fi(e){let t=globalThis.crypto;if(t&&typeof t.randomUUID==`function`)return`router-ab-normal-signing/${e}/${t.randomUUID()}`;if(t&&typeof t.getRandomValues==`function`){let n=new Uint8Array(16);return t.getRandomValues(n),`router-ab-normal-signing/${e}/${g(n)}`}throw Error(`secure randomness is unavailable for Router A/B normal-signing request id`)}function pi(e){if(!e.ok)throw Error(e.error.message);return e.value}function mi(e){let t=Math.floor(Number(e.walletSessionExpiresAtMs)),n=Math.floor(Number(e.requestedTtlMs));if(!Number.isFinite(t)||t<=Date.now())throw Error(`[SigningEngine][near] Router A/B Ed25519 Wallet Session is expired`);if(!Number.isFinite(n)||n<=0)throw Error(`[SigningEngine][near] Router A/B Ed25519 request TTL is invalid`);return Math.min(t,Date.now()+n)}function hi(e){let t=e.walletSessionState.routerAbNormalSigning;if(!t)return null;let n=String(e.walletId||``).trim();if(!n)throw Error(`[SigningEngine][near] Router A/B Ed25519 signing scope is missing wallet id`);let r=He(e.activeClient.metadata());return{request_id:fi(e.operationId),account_id:n,authorization:{kind:`reusable_wallet_session`,wallet_session_id:e.walletSessionState.walletSessionId},material_activation:{kind:`mpc_material_activation_ref`,activation_id:r.activationId,capability:r.capability,material_owner:r.materialOwner,key_binding:r.keyBinding,lifecycle_binding:r.lifecycleBinding,signing_worker:r.signingWorker},signing_worker_id:t.signingWorkerId}}function gi(e){let t=e.materialFacts.routerAbNormalSigning;if(!t)throw Error(`[SigningEngine][near] Router A/B Ed25519 signing scope is missing`);return{request_id:fi(e.operationId),account_id:String(e.walletId),authorization:{kind:`operation_step_up`},material_activation:{kind:`mpc_material_activation_ref`,activation_id:e.materialActivation.activationId,capability:e.materialActivation.capability,material_owner:e.materialActivation.materialOwner,key_binding:e.materialActivation.keyBinding,lifecycle_binding:e.materialActivation.lifecycleBinding,signing_worker:e.materialActivation.signingWorker},signing_worker_id:t.signingWorkerId}}function _i(e){return e.map(e=>{switch(e.action_type){case`CreateAccount`:return{action_type:W.CreateAccount};case`DeployContract`:return{action_type:W.DeployContract,code:[...e.code]};case`FunctionCall`:return{action_type:W.FunctionCall,method_name:e.method_name,args:e.args,gas:e.gas,deposit:e.deposit};case`Transfer`:return{action_type:W.Transfer,deposit:e.deposit};case`Stake`:return{action_type:W.Stake,stake:e.stake,public_key:e.public_key};case`AddKey`:return{action_type:W.AddKey,public_key:e.public_key,access_key:e.access_key};case`DeleteKey`:return{action_type:W.DeleteKey,public_key:e.public_key};case`DeleteAccount`:return{action_type:W.DeleteAccount,beneficiary_id:e.beneficiary_id};case`SignedDelegate`:{let t=_i(e.delegate_action.actions).map(Ne);return{action_type:W.SignedDelegate,delegate_action:{senderId:e.delegate_action.senderId,receiverId:e.delegate_action.receiverId,actions:t,nonce:e.delegate_action.nonce,maxBlockHeight:e.delegate_action.maxBlockHeight,publicKey:{keyType:e.delegate_action.publicKey.keyType,keyData:[...e.delegate_action.publicKey.keyData]}},signature:{keyType:e.signature.keyType,signatureData:[...e.signature.signatureData]}}}case`DeployGlobalContract`:return{action_type:W.DeployGlobalContract,code:[...e.code],deploy_mode:e.deploy_mode};case`UseGlobalContract`:return`account_id`in e?{action_type:W.UseGlobalContract,account_id:e.account_id}:{action_type:W.UseGlobalContract,code_hash:e.code_hash}}})}async function vi(e){return{signedDelegate:await Pr({delegate:e.delegate,signingDigestB64u:e.signingDigestB64u,signatureB64u:e.signatureB64u,workerCtx:e.ctx}),hash:ui(e.signingDigestB64u)}}function X(e,t,n){if(String(e)!==String(t))throw Error(`Router A/B Ed25519 active Client ${n} mismatch`)}function yi(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r+=1)n|=e[r]^t[r];return n===0}function bi(e,t){if(e.length!==32||e.some(e=>!Number.isInteger(e)||e<0||e>255))throw Error(`Router A/B normal-signing ${t} must contain 32 bytes`);return Uint8Array.from(e)}function xi(e){let t=_e(e);if(!t.startsWith(`ed25519:`))throw Error(`Router A/B Ed25519 signer public key must use ed25519`);let n=ve(t.slice(8));if(n.length!==32)throw Error(`Router A/B Ed25519 signer public key must decode to 32 bytes`);return n}function Si(e){let t=e.activeClient.metadata(),n=He(t),r=e.materialFacts.signer,i=li({thresholdKeyMaterial:e.thresholdKeyMaterial,role:`client`}),a=li({thresholdKeyMaterial:e.thresholdKeyMaterial,role:`relayer`});if(e.thresholdKeyMaterial.participants.length!==2)throw Error(`Router A/B Ed25519 active Client requires exactly two participants`);X(t.scope.account_id,e.prepare.request.scope.account_id,`scope account`),X(t.scope.threshold_session_id,e.materialFacts.thresholdSessionId,`threshold session`),X(t.scope.account_id,e.walletId,`scope wallet`),X(n.activationId,e.prepare.request.scope.material_activation.activation_id,`material activation`),X(n.capability,e.prepare.request.scope.material_activation.capability,`material capability`),X(n.materialOwner,e.prepare.request.scope.material_activation.material_owner,`material owner`),X(n.keyBinding,e.prepare.request.scope.material_activation.key_binding,`material key binding`),X(n.lifecycleBinding,e.prepare.request.scope.material_activation.lifecycle_binding,`material lifecycle`),X(n.signingWorker,e.prepare.request.scope.material_activation.signing_worker,`material SigningWorker`);let o=e.prepare.request.scope.authorization;if(o.kind!==e.authorization.kind)throw Error(`Router A/B Ed25519 authorization kind mismatch`);switch(e.authorization.kind){case`reusable_wallet_session`:if(o.kind!==`reusable_wallet_session`)throw Error(`Router A/B Ed25519 reusable authorization is missing`);X(o.wallet_session_id,e.authorization.walletSessionId,`authorization session`);break;case`operation_step_up`:if(o.kind!==`operation_step_up`)throw Error(`Router A/B Ed25519 operation step-up authorization is missing`);break;default:e.authorization}X(t.scope.signing_worker_id,e.prepare.request.scope.signing_worker_id,`scope SigningWorker`),X(t.scope.signing_worker_id,e.signingWorkerId,`prepare SigningWorker`),X(t.applicationBinding.wallet_id,e.walletId,`application wallet`),X(t.applicationBinding.wallet_id,r.account.wallet.walletId,`lane wallet`),X(t.applicationBinding.near_ed25519_signing_key_id,r.nearEd25519SigningKeyId,`signing key`),X(t.applicationBinding.signing_root_id,e.materialFacts.signingRootId,`signing root`),X(t.applicationBinding.key_creation_signer_slot,r.signerSlot,`signer slot`),X(t.applicationBinding.key_creation_signer_slot,e.thresholdKeyMaterial.signerSlot,`key-material signer slot`),X(t.participantIds[0],i,`Client participant`),X(t.participantIds[1],a,`SigningWorker participant`);let s=xi(e.thresholdKeyMaterial.publicKey);if(!yi(t.registeredPublicKey,s))throw Error(`Router A/B Ed25519 active Client registered public key mismatch`);if(!yi(t.signingWorkerVerifyingShare,e.signingWorkerVerifyingShare))throw Error(`Router A/B Ed25519 active Client SigningWorker verifying share mismatch`)}async function Ci(e){let t=e.prepare.request.intent.operation_id,n=performance.now(),r=`failed`;try{let n=await wi(e,t);return r=`succeeded`,n}finally{G(t,`signature_total`,n,r)}}async function wi(e,t){let n=v(e.signingDigestB64u);if(n.length!==32)throw Error(`Router A/B normal-signing ${e.signingPayloadLabel} must be 32 bytes`);let r=bi(e.prepare.admissionMaterial.admittedSigningDigest.bytes,`admitted digest`);if(!yi(n,r))throw Error(`Router A/B normal-signing admitted digest mismatch`);e.authorization===`reusable_wallet_session`&&Xr({state:e.walletSessionState,thresholdSessionId:e.thresholdSessionId,nearAccountId:e.nearAccountId,thresholdKeyMaterial:e.thresholdKeyMaterial});let i=e.authorization===`reusable_wallet_session`?{thresholdSessionId:e.walletSessionState.thresholdSessionId,signer:e.walletSessionState.signingLane.identity.signer,signingRootId:e.walletSessionState.signingRootId,signingRootVersion:e.walletSessionState.signingRootVersion,routerAbNormalSigning:e.walletSessionState.routerAbNormalSigning,runtimePolicyScope:e.walletSessionState.runtimePolicyScope,relayerUrl:e.walletSessionState.relayerUrl}:e.materialFacts,a=performance.now(),o=e.startedResponse?await e.startedResponse:await ht({relayServerUrl:i.relayerUrl,credential:e.credential,request:e.prepare.request});if(G(t,`prepare`,a),e.authorization===`reusable_wallet_session`){if(o.kind!==`reusable_wallet_session`)throw Error(`Ed25519 prepare returned the wrong authorization kind`);let t=await e.sessionCoordinator.resolveActiveAuthorizedRouterAbEd25519WalletSessionState({state:e.walletSessionState,nowMs:Date.now()}),n=o.sessionStatus;if(!t||n.walletSessionId!==t.walletSessionOperationCredential.walletSessionId||n.quotaId!==t.walletSessionAuthorization.quotaId||n.quotaLifecycle!==`active`||n.remainingUses<=0||n.expiresAtMs<=Date.now()||!S(n.authorization,t.walletSessionAuthorization))throw Error(`Wallet Session authority changed before Ed25519 client signing`);let r={relayerUrl:i.relayerUrl,operationCredential:t.walletSessionOperationCredential};await je.fromPrepare(r,n).read(r,{walletSessionId:n.walletSessionId,quotaId:n.quotaId})}else if(o.kind!==`operation_step_up`)throw Error(`Ed25519 step-up prepare returned a reusable Wallet Session`);let s=o.signing;Kr({request:e.prepare.request,signingPayloadDigest:e.prepare.admissionMaterial.signingPayloadDigest,response:s});let c=v(s.server_verifying_share_b64u);if(c.length!==32)throw Error(`Router A/B normal-signing SigningWorker verifying share must be 32 bytes`);Si({activeClient:e.activeClient,authorization:e.authorization===`reusable_wallet_session`?{kind:`reusable_wallet_session`,walletSessionId:e.walletSessionState.signingWalletSession.walletSessionId}:{kind:`operation_step_up`},materialFacts:i,thresholdKeyMaterial:e.thresholdKeyMaterial,walletId:e.walletId,prepare:e.prepare,signingWorkerId:s.signing_worker.server_id,signingWorkerVerifyingShare:c});let l=performance.now(),u=await e.activeClient.createSigningShare({admittedDigest:r,signingWorkerCommitments:s.server_commitments,signingWorkerVerifyingShare:c});if(G(t,`client_share`,l),u.clientVerifyingShare.length!==32)throw Error(`Router A/B normal-signing Client verifying share must be 32 bytes`);let d=performance.now(),f=await yt({relayServerUrl:i.relayerUrl,credential:e.credential,request:ft({scope:e.prepare.request.scope,expiresAtMs:e.prepare.request.expires_at_ms,prepareResponse:s,admissionMaterial:e.prepare.admissionMaterial,clientCommitments:u.clientCommitments,clientVerifyingShareB64u:g(u.clientVerifyingShare),clientSignatureShareB64u:u.clientSignatureShareB64u})});return G(t,`finalize`,d),qr({request:e.prepare.request,signingPayloadDigest:e.prepare.admissionMaterial.signingPayloadDigest,response:f}),{signatureB64u:bt(f.signature,`Router A/B normal-signing signature`),signerPublicKey:e.thresholdKeyMaterial.publicKey}}async function Ti(e){let t=di(e.ctx);return e.intent.kind===`nep413_message_v1`?await mt({scope:e.scope,expiresAtMs:e.expiresAtMs,operationId:e.operationId,operationFingerprint:e.operationFingerprint,displayDigestB64u:e.displayDigest,nearAccountId:e.nearAccountId,nearNetworkId:t,message:e.intent.message,recipient:e.intent.recipient,nonce:e.intent.nonce,callbackUrl:e.intent.callbackUrl,expectedSigningDigestB64u:e.signingDigestB64u}):await gt({scope:e.scope,expiresAtMs:e.expiresAtMs,operationId:e.operationId,operationFingerprint:e.operationFingerprint,displayDigestB64u:e.displayDigest,nearAccountId:e.nearAccountId,nearNetworkId:t,delegate:{senderId:e.intent.delegate.senderId,receiverId:e.intent.delegate.receiverId,publicKey:e.intent.delegate.publicKey,nonce:e.intent.delegate.nonce,maxBlockHeight:e.intent.delegate.maxBlockHeight,actionFingerprint:await pt(e.intent.delegate.actions),canonicalDelegateBorshB64u:(await Nr({delegate:{senderId:e.intent.delegate.senderId,receiverId:e.intent.delegate.receiverId,actions:_i(e.intent.delegate.actions),nonce:e.intent.delegate.nonce,maxBlockHeight:e.intent.delegate.maxBlockHeight,publicKey:e.intent.delegate.publicKey},workerCtx:e.ctx})).canonicalDelegateBorshB64u},expectedSigningDigestB64u:e.signingDigestB64u})}async function Ei(e){let t=gi({materialActivation:e.materialActivation,materialFacts:e.materialFacts,walletId:e.walletId,operationId:e.operationId}),n=await Ti({ctx:e.ctx,thresholdSessionId:e.thresholdSessionId,scope:t,expiresAtMs:Date.now()+oi,nearAccountId:e.nearAccountId,operationId:e.operationId,operationFingerprint:e.operationFingerprint,displayDigest:e.displayDigest,signingDigestB64u:e.signingDigestB64u,intent:e.intent}),r=Xe({tenantId:pi(O(e.materialFacts.runtimePolicyScope.orgId)),principalId:pi(E(String(e.walletId))),capabilityId:pi(k(e.materialActivation.capability)),operationId:pi(w(String(e.operationId))),operation:{capabilityKind:`near_ed25519_mpc_signing`,operationKind:e.intent.kind===`nep413_message_v1`?`near.sign_nep413_message`:`near.sign_delegate_action`},digests:{laneDigest:Ye(e.operationFingerprint),intentDigest:A(g(Uint8Array.from(n.admissionMaterial.intentDigest.bytes))),displayDigest:A(e.displayDigest)}});return{operation:{kind:`near_signature_only`,prepare:n,signingDigestB64u:e.signingDigestB64u,materialActivation:e.materialActivation},envelope:r}}function Di(e){if(e.auth.kind!==`email_otp`)throw Error(`[SigningEngine][near] Email OTP step-up requires an Email OTP auth binding`);let t=e.preparation.hydration.authority;if(!t||String(t.walletId)!==String(e.walletId))throw Error(`[SigningEngine][near] Email OTP material authority changed`);return{kind:`email_otp`,authorityRef:t,providerSubjectId:e.auth.providerSubjectId,challengeId:e.challengeId,otpCode:e.otpCode}}function Oi(e){switch(e.authorization.kind){case`passkey`:return{kind:`passkey`,authority:e.authorization.plannedPasskeyOperationStepUp.authority,credential:e.authorization.credential};case`email_otp`:return Di({preparation:e.preparation,auth:ki(e.auth),walletId:e.walletId,challengeId:e.authorization.challengeId,otpCode:e.authorization.otpCode});default:throw e.authorization,Error(`[SigningEngine][near] unsupported operation step-up authorization`)}}function ki(e){if(e.kind!==`email_otp`)throw Error(`[SigningEngine][near] Email OTP step-up requires an Email OTP auth binding`);return e}function Ai(e){if(!e)throw Error(`[SigningEngine][near] operation step-up proof is missing`);return e}function ji(e){return e.authorization.kind===`operation_step_up`}async function Mi(e){if(e.issuedAuthorization)return e.issuedAuthorization;switch(e.proof.kind){case`passkey`:return await yn({relayerUrl:e.relayerUrl,normalSigningRequest:e.normalSigningRequest,displayDigest:e.displayDigest,proof:e.proof,credential:e.credential,materialRecovery:{kind:`not_requested`}});case`email_otp`:return await yn({relayerUrl:e.relayerUrl,normalSigningRequest:e.normalSigningRequest,displayDigest:e.displayDigest,proof:e.proof,credential:e.credential,materialRecovery:{kind:`not_requested`}});default:throw e.proof,Error(`[SigningEngine][near] unsupported operation step-up proof`)}}async function Ni(e){if(ji(e)){let t=He(e.activeClient.metadata());if(ai({expected:e.authorization.prepared.materialActivation,actual:t}),e.authorization.prepared.signingDigestB64u!==e.signingDigestB64u)throw Error(`[SigningEngine][near] signature-only operation digest changed`);let n=e.authorization.prepared.prepare,r=await si({ctx:e.ctx,walletId:e.walletId,relayerUrl:e.materialFacts.relayerUrl,proof:e.authorization.proof}),i=await Mi({issuedAuthorization:e.authorization.issuedAuthorization,relayerUrl:e.materialFacts.relayerUrl,normalSigningRequest:n.request,displayDigest:e.displayDigest,proof:e.authorization.proof,credential:r});if(n.request.scope.authorization.kind!==`operation_step_up`||i.kind!==`verified_step_up`)throw Error(`[SigningEngine][near] issued operation step-up evidence changed identity`);return{kind:`router_ab_ed25519_signature_only_normal_signing_result_v1`,authorization:`operation_step_up`,issuedAuthorization:i,...await Ci({thresholdSessionId:e.thresholdSessionId,materialFacts:e.materialFacts,thresholdKeyMaterial:e.thresholdKeyMaterial,walletId:e.walletId,nearAccountId:e.nearAccountId,activeClient:e.activeClient,signingDigestB64u:e.signingDigestB64u,signingPayloadLabel:`signature-only payload digest`,prepare:n,credential:r,authorization:`operation_step_up`})}}let t=e.startedPrepare&&e.startedPrepare.displayDigest===e.displayDigest&&e.startedPrepare.signingDigestB64u===e.signingDigestB64u?e.startedPrepare:null;e.startedPrepare&&!t&&Ii(e.startedPrepare);let n=t?.prepare??await Pi(e);return n?{kind:`router_ab_ed25519_signature_only_normal_signing_result_v1`,authorization:`reusable_wallet_session`,...await Ci({thresholdSessionId:e.thresholdSessionId,walletSessionState:e.walletSessionState,sessionCoordinator:e.sessionCoordinator,thresholdKeyMaterial:e.thresholdKeyMaterial,walletId:e.walletId,nearAccountId:e.nearAccountId,activeClient:e.activeClient,signingDigestB64u:e.signingDigestB64u,signingPayloadLabel:`signature-only payload digest`,prepare:n,startedResponse:t?.response,credential:Xr({state:e.walletSessionState,thresholdSessionId:e.thresholdSessionId,nearAccountId:e.nearAccountId,thresholdKeyMaterial:e.thresholdKeyMaterial}).credential,authorization:e.authorization.kind})}:null}async function Pi(e){let t=hi({activeClient:e.activeClient,walletSessionState:e.walletSessionState,walletId:e.walletId,operationId:e.operationId});return t?await Ti({ctx:e.ctx,thresholdSessionId:e.thresholdSessionId,scope:t,expiresAtMs:mi({walletSessionExpiresAtMs:e.walletSessionState.signingWalletSession.expiresAtMs,requestedTtlMs:oi}),nearAccountId:e.nearAccountId,operationId:e.operationId,operationFingerprint:e.operationFingerprint,displayDigest:e.displayDigest,signingDigestB64u:e.signingDigestB64u,intent:e.intent}):null}async function Fi(e){let t=await Pi(e);if(!t)return null;let n=Xr({state:e.walletSessionState,thresholdSessionId:e.thresholdSessionId,nearAccountId:e.nearAccountId,thresholdKeyMaterial:e.thresholdKeyMaterial}),r=performance.now(),i=ht({relayServerUrl:e.walletSessionState.relayerUrl,credential:n.credential,request:t.request});return i.catch(()=>{}),G(String(e.operationId),`prepare_sent`,r),{prepare:t,displayDigest:e.displayDigest,signingDigestB64u:e.signingDigestB64u,response:i}}function Ii(e){e.response.catch(()=>{})}async function Li(e){let t=await Fr({txSigningRequest:e.txSigningRequest,transactionContext:e.transactionContext,workerCtx:e.ctx}),n=di(e.ctx),r=nr(e.txSigningRequest,`txSigningRequest`),i=await vt({scope:gi({materialActivation:e.materialActivation,materialFacts:e.materialFacts,walletId:e.walletId,operationId:e.operationId}),expiresAtMs:Date.now()+oi,operationId:e.operationId,operationFingerprint:e.operationFingerprint,displayDigestB64u:e.displayDigest,nearAccountId:e.nearAccountId,nearNetworkId:n,transactions:[{receiverId:r.receiverId,actionFingerprint:await pt(r.actions)}],unsignedTransactionBorshB64u:t.unsignedTransactionBorshB64u,expectedSigningDigestB64u:t.signingDigestB64u}),a=Xe({tenantId:pi(O(e.materialFacts.runtimePolicyScope.orgId)),principalId:pi(E(String(e.walletId))),capabilityId:pi(k(e.materialActivation.capability)),operationId:pi(w(String(e.operationId))),operation:{capabilityKind:`near_ed25519_mpc_signing`,operationKind:`near.sign_transaction`},digests:{laneDigest:Ye(e.operationFingerprint),intentDigest:A(g(Uint8Array.from(i.admissionMaterial.intentDigest.bytes))),displayDigest:A(e.displayDigest)}});return{operation:{kind:`near_transaction`,prepare:i,unsignedTransactionBorshB64u:t.unsignedTransactionBorshB64u,signingDigestB64u:t.signingDigestB64u,materialActivation:e.materialActivation},envelope:a}}function Ri(e){return e.authorization.kind===`operation_step_up`}function zi(e){return Ri(e)?e.materialFacts:{thresholdSessionId:e.walletSessionState.thresholdSessionId,signer:e.walletSessionState.signingLane.identity.signer,signingRootId:e.walletSessionState.signingRootId,signingRootVersion:e.walletSessionState.signingRootVersion,routerAbNormalSigning:e.walletSessionState.routerAbNormalSigning,runtimePolicyScope:e.walletSessionState.runtimePolicyScope,relayerUrl:e.walletSessionState.relayerUrl}}async function Bi(e,t){let n=di(e.ctx),r=nr(e.txSigningRequest,`txSigningRequest`);return{nearNetworkId:n,parsedTransaction:r,operationFingerprint:H.signingOperationFingerprint(await Yn({nearAccountId:e.nearAccountId,nearNetworkId:n,relayerKeyId:e.thresholdKeyMaterial.relayerKeyId,signerPublicKey:e.thresholdKeyMaterial.publicKey,transactions:[r],unsignedTransactionBorshB64u:t.unsignedTransactionBorshB64u,signingDigestB64u:t.signingDigestB64u}))}}async function Vi(e,t,n){let r=hi({activeClient:e.activeClient,walletSessionState:e.walletSessionState,walletId:e.walletId,operationId:e.operationId});if(!r)throw Error(`[SigningEngine][near] Router A/B Ed25519 signing scope is missing`);return await vt({scope:r,expiresAtMs:mi({walletSessionExpiresAtMs:e.walletSessionState.signingWalletSession.expiresAtMs,requestedTtlMs:oi}),operationId:e.operationId,operationFingerprint:n.operationFingerprint,displayDigestB64u:e.displayDigest,nearAccountId:e.nearAccountId,nearNetworkId:n.nearNetworkId,transactions:[{receiverId:n.parsedTransaction.receiverId,actionFingerprint:await pt(n.parsedTransaction.actions)}],unsignedTransactionBorshB64u:t.unsignedTransactionBorshB64u,expectedSigningDigestB64u:t.signingDigestB64u})}async function Hi(e){let t=await Fr({txSigningRequest:e.txSigningRequest,transactionContext:e.transactionContext,workerCtx:e.ctx}),n=await Vi(e,t,await Bi(e,t)),r=Xr({state:e.walletSessionState,thresholdSessionId:e.thresholdSessionId,nearAccountId:e.nearAccountId,thresholdKeyMaterial:e.thresholdKeyMaterial}),i=performance.now(),a=ht({relayServerUrl:e.walletSessionState.relayerUrl,credential:r.credential,request:n.request});return a.catch(()=>{}),G(String(e.operationId),`prepare_sent`,i),{prepare:n,displayDigest:e.displayDigest,signingDigestB64u:t.signingDigestB64u,response:a}}async function Ui(e){let t=zi(e);if(!t.routerAbNormalSigning)throw Error(`[SigningEngine][near] Router A/B Ed25519 normal-signing state is missing`);if(!e.transactionContext)throw Error(`[SigningEngine][near] Router A/B Ed25519 transaction signing is missing transaction context from confirmation`);let n=Ri(e),r=n?{unsignedTransactionBorshB64u:e.authorization.prepared.unsignedTransactionBorshB64u,signingDigestB64u:e.authorization.prepared.signingDigestB64u}:await Fr({txSigningRequest:e.txSigningRequest,transactionContext:e.transactionContext,workerCtx:e.ctx});if(v(r.signingDigestB64u).length!==32)throw Error(`Router A/B normal-signing NEAR payload digest must be 32 bytes`);let i=await Bi(e,r),a=null,o,s,c;if(n){o=e.authorization.prepared.prepare,s=await si({ctx:e.ctx,walletId:e.walletId,relayerUrl:t.relayerUrl,proof:e.authorization.proof});let n=await Mi({issuedAuthorization:e.authorization.issuedAuthorization,relayerUrl:t.relayerUrl,normalSigningRequest:o.request,displayDigest:e.authorization.displayDigest,proof:e.authorization.proof,credential:s});if(o.request.scope.authorization.kind!==`operation_step_up`||n.kind!==`verified_step_up`)throw Error(`[SigningEngine][near] issued operation step-up evidence changed identity`);c=n}else a=e.startedPrepare&&e.startedPrepare.displayDigest===e.displayDigest&&e.startedPrepare.signingDigestB64u===r.signingDigestB64u?e.startedPrepare:null,e.startedPrepare&&!a&&Ii(e.startedPrepare),o=a?a.prepare:await Vi(e,r,i),s=Xr({state:e.walletSessionState,thresholdSessionId:e.thresholdSessionId,nearAccountId:e.nearAccountId,thresholdKeyMaterial:e.thresholdKeyMaterial}).credential;e.ctx.beforeSigning?.();let l=Ri(e)?await Ci({thresholdSessionId:e.thresholdSessionId,materialFacts:t,thresholdKeyMaterial:e.thresholdKeyMaterial,walletId:e.walletId,nearAccountId:e.nearAccountId,activeClient:e.activeClient,signingDigestB64u:r.signingDigestB64u,signingPayloadLabel:`NEAR payload digest`,prepare:o,credential:s,authorization:`operation_step_up`}):await Ci({thresholdSessionId:e.thresholdSessionId,walletSessionState:e.walletSessionState,sessionCoordinator:e.sessionCoordinator,thresholdKeyMaterial:e.thresholdKeyMaterial,walletId:e.walletId,nearAccountId:e.nearAccountId,activeClient:e.activeClient,signingDigestB64u:r.signingDigestB64u,signingPayloadLabel:`NEAR payload digest`,prepare:o,credential:s,authorization:`reusable_wallet_session`,startedResponse:a?.response}),u=await Ir({unsignedTransactionBorshB64u:r.unsignedTransactionBorshB64u,signingDigestB64u:r.signingDigestB64u,signatureB64u:l.signatureB64u,expectedNearAccountId:e.nearAccountId,expectedSignerPublicKey:e.thresholdKeyMaterial.publicKey,workerCtx:e.ctx}),d=await Lr({signedTransactionBorshB64u:u.signedTransactionBorshB64u,workerCtx:e.ctx}),f=u.transactionHash||d.transactionHash,p={type:N.SignTransactionsWithActionsSuccess,payload:{free:()=>void 0,success:!0,transactionHashes:[f],signedTransactions:[d.signedTransaction],logs:[`NEAR transaction signed through Router A/B normal signing`],error:void 0}};if(n){if(!c)throw Error(`[SigningEngine][near] operation step-up authorization was not issued`);return{kind:`router_ab_ed25519_near_transaction_normal_signing_result_v1`,authorization:`operation_step_up`,issuedAuthorization:c,okResponse:p}}return{kind:`router_ab_ed25519_near_transaction_normal_signing_result_v1`,authorization:`reusable_wallet_session`,okResponse:p}}const Wi=1e3,Gi=[120,180,250,350,500,700,1e3,1e3,1500,1500,2e3],Ki=Symbol(`NearWalletSessionFundingAuthority`);function qi(e=Wi){return new Promise(t=>{setTimeout(t,e)})}function Ji(e){let t=String(e.walletSessionToken||``).trim();if(!t)throw Error(`[SigningEngine][near] authenticated Wallet Session token is required for funding`);return t}function Yi(e){return{kind:`near_ed25519_funding_session`,signer:e.signingLane.identity.signer,thresholdSessionId:e.thresholdSessionId,walletSessionToken:e.walletSessionAuth.walletSessionToken}}function Xi(e){switch(e.kind){case`warm_session`:return`warm_session`;case`passkey`:return`passkey_reauth`;case`email_otp`:return`email_otp_reauth`;default:return Qi(e)}}function Zi(e){switch(e){case`passkey`:return`passkey_reauth`;case`email_otp`:return`email_otp_reauth`;default:throw Error(`[SigningEngine][near] unsupported operation step-up funding method`)}}function Qi(e){throw Error(`Unsupported NEAR funding authorization: ${String(e)}`)}function $i(e){let t=String(e.fundingSession.signer.account.wallet.walletId),n=String(e.fundingSession.signer.account.nearAccountId),r=e.request.operation;if(String(e.request.subject.walletId)!==t||String(e.request.subject.nearAccountId)!==n||e.request.subject.nearPublicKeyStr!==e.nearPublicKeyStr)throw Error(`[SigningEngine][near] funding request subject does not match authenticated lane`);if(String(r.operationId)!==String(e.signingOperation.operationId)||String(r.operationFingerprint)!==String(e.signingOperation.operationFingerprint)||r.intent!==e.signingOperation.intent||r.accountId!==n)throw Error(`[SigningEngine][near] funding request operation does not match signing operation`);if(e.request.signatureUses!==e.signatureUses)throw Error(`[SigningEngine][near] funding request signature use count mismatch`);if(String(e.fundingSession.thresholdSessionId).trim().length===0)throw Error(`[SigningEngine][near] funding authority threshold session mismatch`)}function ea(e){return{kind:`near_wallet_session_funding_authority`,provenance:e.provenance,request:e.request,thresholdSessionId:e.fundingSession.thresholdSessionId,walletSessionToken:Ji(e.fundingSession),[Ki]:!0}}async function ta(e){let t=e.authority.request,n=at({chains:e.ctx.chains,walletId:String(t.subject.walletId),nearAccountId:String(t.subject.nearAccountId),nearPublicKeyStr:t.subject.nearPublicKeyStr}),r;for(let i=1;i<=12;i+=1)try{let r=await e.ctx.nonceCoordinator.reserveNearContext({lane:n,operation:t.operation,count:t.signatureUses,nearClient:e.ctx.nearClient});return{transactionContext:r.context,nonceLeases:r.leases.map(Ae),reservedLeases:r.leases}}catch(e){r=e,i<12&&await qi(Gi[i-1]??Wi)}throw r instanceof Error?r:Error(`Funded NEAR account access key did not become available`)}async function na(e){let t=e.authority.request,n=await Ue({relayerUrl:e.ctx.relayerUrl,walletId:String(t.subject.walletId),nearAccountId:String(t.subject.nearAccountId),nearPublicKeyStr:t.subject.nearPublicKeyStr,walletSessionToken:e.authority.walletSessionToken});if(!n.ok)throw Error(n.message||n.code||`Failed to fund implicit NEAR account`);return await ta(e)}async function ra(e){switch(e.confirmation.readiness.kind){case`context_ready`:return e.confirmation.readiness;case`funding_required`:{$i({request:e.confirmation.readiness.request,fundingSession:Yi(e.walletSessionState),nearPublicKeyStr:e.nearPublicKeyStr,signingOperation:e.signingOperation,signatureUses:e.signatureUses});let t=ea({request:e.confirmation.readiness.request,fundingSession:Yi(e.walletSessionState),provenance:Xi(e.authorization)}),n=await na({ctx:e.ctx,authority:t});return{kind:`context_ready`,transactionContext:n.transactionContext,nonceLeases:n.nonceLeases}}default:return ia(e.confirmation.readiness)}}function ia(e){throw Error(`Unsupported confirmed NEAR transaction readiness: ${String(e)}`)}async function aa(e){$i({request:e.request,fundingSession:e.fundingSession,nearPublicKeyStr:e.nearPublicKeyStr,signingOperation:e.signingOperation,signatureUses:e.signatureUses});let t=ea({request:e.request,fundingSession:e.fundingSession,provenance:Zi(e.method)}),n=await na({ctx:e.ctx,authority:t});return{readiness:{kind:`context_ready`,transactionContext:n.transactionContext,nonceLeases:n.nonceLeases},reservedNonceLeases:n.reservedLeases}}const oa=new Map;function sa(e){let t=String(e||``).trim();if(!t)throw Error(`[SigningEngine][near] requestId is required`);return t}function ca(e){oa.set(sa(e.requestId),e.fund)}function la(e){oa.delete(String(e||``).trim())}const ua={async fund(e){let t=sa(e.requestId),n=oa.get(t);if(!n)throw Error(`[SigningEngine][near] implicit-account funding is unavailable`);return oa.delete(t),await n(e.request)}};function da(e){switch(e.kind){case`passkey_live`:case`email_otp_live`:return e.material.facts;case`passkey_sealed`:case`email_otp_sealed`:return e.facts;default:throw Error(`[SigningEngine][near] unsupported operation material`)}}async function fa(e,t){switch(e.hydration.kind){case`use_live_runtime`:case`rehydrate_material_activation`:return await t.resolve(e);case`reauthorize_public_anchor`:throw Error(`[SigningEngine][near] material requires public-anchor reauthorization`);case`blocked`:throw Error(`[SigningEngine][near] material hydration is blocked: ${e.hydration.reason}`);default:throw e.hydration,Error(`[SigningEngine][near] unsupported Ed25519 Yao hydration plan`)}}async function pa(e){if(e.method===`passkey`&&e.preparation.hydration.kind===`rehydrate_material_activation`){let t=await e.executor.preparePasskeyOperationStepUp(e.preparation);return{kind:`passkey_sealed`,materialActivation:t.materialActivation,facts:t.facts,rehydrate:t.rehydrate}}if(e.method===`email_otp`){let t=await e.executor.prepareEmailOtpOperationStepUp(e.preparation);switch(t.kind){case`live`:return{kind:`email_otp_live`,materialActivation:t.materialActivation,material:t.material};case`sealed`:return{kind:`email_otp_sealed`,materialActivation:t.materialActivation,facts:t.facts,authorizeAndRehydrate:t.authorizeAndRehydrate};default:throw Error(`[SigningEngine][near] unsupported Email OTP operation material`)}}let t=await fa(e.preparation,e.executor);return{kind:`passkey_live`,materialActivation:He(t.activeClient.metadata()),material:t}}async function ma(e){ai({expected:e.expectedActivation,actual:e.material.materialActivation});let t,n=null;if(e.kind===`email_otp_live`||e.kind===`email_otp_sealed`)if(e.kind===`email_otp_live`)t=e.material.material;else{let r=await e.material.authorizeAndRehydrate({normalSigningRequest:e.normalSigningRequest,displayDigest:e.displayDigest,proof:e.proof});t=r.material,n=r.issuedAuthorization}else t=e.material.kind===`passkey_live`?e.material.material:await e.material.rehydrate(e.credential);try{return ai({expected:e.expectedActivation,actual:He(t.activeClient.metadata())}),{material:t,issuedAuthorization:n}}catch(n){throw(e.material.kind===`passkey_sealed`||e.material.kind===`email_otp_sealed`)&&t.activeClient.dispose(),n}}async function ha(e){let t=await fa(e.preparation,e.executor);return{thresholdSessionId:t.facts.thresholdSessionId,material:t,walletSessionState:await e.executor.resolveWalletSessionState()}}function ga(e){if(!e)throw Error(`[SigningEngine][near] confirmed operation step-up is missing preparation`);return e}function _a(e){if(!e)throw Error(`[SigningEngine][near] prepared operation step-up is missing`);if(e.kind!==`near_transaction`)throw Error(`[SigningEngine][near] prepared operation step-up is not a transaction`);return e}function va(e){if(!e)throw Error(`[SigningEngine][near] transaction operation material is unavailable`);return e}function ya(e){e.owned&&e.resolved?.material.activeClient.dispose()}function ba(e,t){throw ya(e),t}async function xa(e){return{material:await fa(e.preparation,e.executor),walletSessionState:await e.executor.resolveWalletSessionState()}}function Sa(e){if(!e)throw Error(`[SigningEngine][near] warm signing material was not prepared`);return e}async function Ca(e){let t=await e.warmMaterial,n=await e.sessionCoordinator.resolveActiveAuthorizedRouterAbEd25519WalletSessionState({state:t.walletSessionState,nowMs:Date.now()});if(!n)return null;let r=await rt([{receiverId:e.confirmationTransaction.receiverId,actions:e.confirmationTransaction.actions.map(tt)}]);return await Hi({ctx:e.ctx,thresholdSessionId:t.material.facts.thresholdSessionId,thresholdKeyMaterial:e.thresholdKeyMaterial,walletId:e.walletId,nearAccountId:e.nearAccountId,activeClient:t.material.activeClient,walletSessionState:n,operationId:e.operationId,displayDigest:r,txSigningRequest:e.txSigningRequest,transactionContext:e.readiness.transactionContext})}function wa(){return null}async function Ta(e){if(e.authorization.kind===`passkey`){if(e.material.kind!==`passkey_live`&&e.material.kind!==`passkey_sealed`)throw Error(`[SigningEngine][near] passkey transaction material changed factor`);return await ma({kind:`passkey`,material:e.material,expectedActivation:e.prepared.materialActivation,credential:e.authorization.credential})}if(e.material.kind!==`email_otp_live`&&e.material.kind!==`email_otp_sealed`)throw Error(`[SigningEngine][near] Email OTP transaction material changed factor`);if(e.proof.kind!==`email_otp`)throw Error(`[SigningEngine][near] Email OTP transaction proof is missing`);return e.material.kind===`email_otp_live`?await ma({kind:`email_otp_live`,material:e.material,expectedActivation:e.prepared.materialActivation}):await ma({kind:`email_otp_sealed`,material:e.material,expectedActivation:e.prepared.materialActivation,normalSigningRequest:e.prepared.prepare.request,displayDigest:e.displayDigest,proof:e.proof})}function Z(e,t,n){try{e?.(xe({...n,flowId:`signing:near:${String(t)}:${n.phase}`,accountId:String(t)}))}catch{}}async function Ea(e){let t=performance.now(),n=`failed`;try{if(!e.state)throw Error(`[SigningEngine][near] reusable Wallet Session state is unavailable`);let t=await e.coordinator.resolveActiveAuthorizedRouterAbEd25519WalletSessionState({state:e.state,nowMs:Date.now()});if(!t)throw Error(`[SigningEngine][near] reusable Wallet Session authorization is unavailable`);return n=`succeeded`,t}finally{G(e.operationId,`wallet_session_authorization`,t,n)}}async function Da(e){let t=await pa({method:e.method,preparation:e.preparation,executor:e.executor}),n=da(t);if(String(n.thresholdSessionId)!==e.expectedThresholdSessionId)throw Error(`[SigningEngine][near] prepared operation material changed threshold session`);return ti({requestId:e.requestId,build:async r=>{if(r.kind!==`near_transaction`)throw Error(`[SigningEngine][near] transaction step-up preparation kind changed`);if(r.operationId!==String(e.operation.operationId))throw Error(`[SigningEngine][near] operation step-up operation identity changed`);return await Li({...e.operation,thresholdSessionId:n.thresholdSessionId,materialFacts:n,materialActivation:t.materialActivation,transactionContext:r.transactionContext,displayDigest:r.displayDigest})}}),ca({requestId:e.requestId,fund:async t=>await aa({...e.funding,request:t,fundingSession:await e.executor.resolveFundingSession(),method:e.method})}),t}function Oa(e){ni(e),la(e)}function ka(e){if(!e.readiness){Oa(e.requestId);return}e.readiness.then(Oa.bind(void 0,e.requestId),Oa.bind(void 0,e.requestId))}function Aa(e){return e.selection.kind===`authorization_required`}async function ja(e){return Aa(e)?await Ma(e):await Na(e)}async function Ma(e){let{ctx:t,commandSubject:n,nearAccount:r,transaction:i,rpcCall:a,onEvent:o,confirmationConfigOverride:s,title:c,body:l,signerSlot:u,signingOperationState:d,signingSessionCoordinator:f,selection:p,yaoSigningPreparation:m,yaoMaterialExecutor:h,passkeyEd25519OperationStepUp:g,emailOtpEd25519StepUp:_}=e,v=d.operationId,y=p.candidate,b=I(r.accountId),ee=[];if(!t.touchConfirm)throw Error(`UiConfirm bridge not available for signing`);if(!f)throw Error(`[SigningEngine][near] production signing session coordinator is required`);let{thresholdKeyMaterial:te}=await Wn({materialExecutor:h,nearAccount:r,signerSlot:y.signerSlot,requestedSignerSlot:u,operationLabel:`signing`,warnings:ee}),x=La({nearAccountId:b,relayerUrl:t.relayerUrl,thresholdKeyMaterial:te}),S={nearRpcUrl:a.nearRpcUrl||re(_t.network.chains),nearAccountId:b},{txSigningRequest:C,confirmationTransaction:ie}=Gn({nearAccountId:String(b),transaction:i}),w=nr(C,`txSigningRequest`),T=H.signingOperationFingerprint(await Jn({nearAccountId:b,nearNetworkId:ne(t.chains||_t.network.chains),relayerKeyId:x.threshold.thresholdKeyMaterial.relayerKeyId,signerPublicKey:x.threshold.thresholdKeyMaterial.publicKey,transactions:[w]}));f.bindCallerProvidedOperationIdToFingerprint({operationId:v,operationFingerprint:T});let E=Ye(T),D={kind:`deferred_ed25519_material_identity`,signer:Ke({walletId:y.walletId,nearAccountId:y.nearAccountId,nearEd25519SigningKeyId:y.nearEd25519SigningKeyId,signerSlot:y.signerSlot}),materialActivation:y.materialActivation,thresholdSessionId:H.thresholdEd25519Session(y.thresholdSessionId)},ae={kind:V.OperationStepUp,lane:{identity:D,auth:y.auth,curve:`ed25519`,keyKind:`threshold_ed25519`,chainFamily:`near`,sessionOrigin:`per_operation`,storageSource:`sealed_restore`,retention:`single_use`,materialActivation:D.materialActivation,thresholdSessionId:D.thresholdSessionId}},O=gr(y.auth),k={operationId:v,operationFingerprint:T,intent:Ee.TransactionSign},A=await hr({signingAuthPlan:O,signingLaneAuth:y.auth,requiredSignatureUses:Or(i),operationFingerprintDigest:E,...g?{passkeyEd25519OperationStepUp:g}:{},..._?{emailOtpEd25519StepUp:_}:{}});if(A.kind===`warm_session`)throw Error(`[SigningEngine][near] deferred Ed25519 transaction cannot use warm session`);let j=Or(i),M=Da({requestId:String(v),expectedThresholdSessionId:String(D.thresholdSessionId),method:A.kind,preparation:m,executor:h,operation:{ctx:t,thresholdKeyMaterial:x.threshold.thresholdKeyMaterial,walletId:n.walletSession.walletId,nearAccountId:b,operationId:v,operationFingerprint:T,txSigningRequest:C},funding:{ctx:t,nearPublicKeyStr:x.signingNearPublicKeyStr,signingOperation:k,signatureUses:j}}),N;try{N=await Mt({signingSessionPlan:ae,signingOperation:k,signingOperationState:d,runtime:t.touchConfirm,request:{ctx:{touchConfirm:t.touchConfirm},sessionId:String(v),chain:`near`,kind:`transaction`,...jt({signingAuthPlan:A.confirmationAuthPayload.signingAuthPlan}),walletId:y.walletId,txSigningRequests:[ie],rpcCall:S,nearPublicKeyStr:x.signingNearPublicKeyStr,nearFundingRequest:{subject:{walletId:y.walletId,nearAccountId:b,nearPublicKeyStr:x.signingNearPublicKeyStr},operation:{...k,accountId:String(b)},signatureUses:j},confirmationConfigOverride:Nt({signingAuthPlan:A.confirmationAuthPayload.signingAuthPlan,override:s}),title:c,body:l,confirmationReadiness:{promise:M},onProgress:Cr.bind(void 0,{onEvent:o,nearAccountId:b,signingAuthPlan:A.confirmationAuthPayload.signingAuthPlan})}})}finally{ka({requestId:String(v),readiness:M})}let P=await M,oe=da(P),se=Tr({prepared:A,confirmation:N});if(se.kind===`warm_session`)throw Error(`[SigningEngine][near] deferred transaction requires operation step-up`);let ce=Oi({authorization:se,preparation:m,auth:y.auth,walletId:n.walletSession.walletId}),le=_a(ii({requestId:String(v),ref:ga(N.operationStepUpPreparation)})),ue=await Ta({material:P,prepared:le,displayDigest:N.intentDigest,authorization:se,proof:Ai(ce)});Z(o,b,{phase:z.STEP_07_AUTHENTICATION_COMPLETE,status:`succeeded`,interaction:{kind:`none`,overlay:`none`},authMethod:Ft(A.confirmationAuthPayload.signingAuthPlan)});try{if(await t.nonceCoordinator.recoverDurableLeases({walletId:String(y.walletId)}),N.readiness.kind!==`context_ready`)throw Error(`[SigningEngine][near] implicit-account funding requires transaction context`);let e=await Ui({ctx:t,thresholdSessionId:oe.thresholdSessionId,activeClient:ue.material.activeClient,materialFacts:oe,thresholdKeyMaterial:x.threshold.thresholdKeyMaterial,walletId:n.walletSession.walletId,nearAccountId:b,operationId:v,operationFingerprint:T,displayDigest:N.intentDigest,txSigningRequest:C,transactionContext:N.readiness.transactionContext,authorization:{kind:`operation_step_up`,prepared:le,displayDigest:N.intentDigest,proof:Ai(ce),issuedAuthorization:ue.issuedAuthorization}});if(!e||e.authorization!==`operation_step_up`)throw Error(`[SigningEngine][near] operation step-up transaction signing is unavailable`);ci({prepared:le,issuedAuthorization:e.issuedAuthorization});let r=Ia({okResponse:e.okResponse,nearAccountId:b,warnings:ee,nonceLeases:N.readiness.nonceLeases});return await Fa(t,N.readiness.nonceLeases),r}catch(e){throw ya({resolved:ue,owned:P.kind===`passkey_sealed`||P.kind===`email_otp_sealed`}),e}}async function Na({ctx:e,commandSubject:t,nearAccount:n,transaction:r,rpcCall:i,onEvent:a,confirmationConfigOverride:o,title:s,body:c,signerSlot:l,signingOperationState:u,signingSessionCoordinator:d,transactionOperation:f,ed25519SigningBoundary:p,passkeyEd25519OperationStepUp:m,emailOtpEd25519StepUp:h,yaoSigningPreparation:g,yaoMaterialExecutor:_}){let v=performance.now(),y=u.operationId,b=I(n.accountId),ee=e.relayerUrl,te=[],x=e.nonceCoordinator.recoverDurableLeases({walletId:String(t.walletSession.walletId)});x.catch(()=>{}),Z(a,b,{phase:z.STEP_02_REQUEST_PREPARED,status:`running`,message:`Loading threshold signing state`,interaction:{kind:`none`,overlay:`none`}});let{thresholdKeyMaterial:S}=await Wn({materialExecutor:_,nearAccount:n,signerSlot:p.signingLane.identity.signer.signerSlot,requestedSignerSlot:l,operationLabel:`signing`,warnings:te}),C=La({nearAccountId:b,relayerUrl:ee,thresholdKeyMaterial:S}),ie={nearRpcUrl:i.nearRpcUrl||re(_t.network.chains),nearAccountId:b},{txSigningRequest:w,confirmationTransaction:T}=Gn({nearAccountId:String(ie.nearAccountId),transaction:r}),E=nr(w,`txSigningRequest`),D=H.signingOperationFingerprint(await Jn({nearAccountId:b,nearNetworkId:ne(e.chains||_t.network.chains),relayerKeyId:C.threshold.thresholdKeyMaterial.relayerKeyId,signerPublicKey:C.threshold.thresholdKeyMaterial.publicKey,transactions:[E]})),ae=Ye(D);if(!e.touchConfirm)throw Error(`UiConfirm bridge not available for signing`);let O=e.touchConfirm;if(!d)throw Error(`[SigningEngine][near] production signing session coordinator is required`);d.bindCallerProvidedOperationIdToFingerprint({operationId:y,operationFingerprint:D});let k=Or(r),A={operationId:y,operationFingerprint:D,intent:Ee.TransactionSign},j=async e=>await Dt({signingSessionPlan:p.signingSessionPlan,signingOperation:A,commandKind:e.commandKind,execute:e.execute}),M=p.thresholdSessionId,N=String(M||``).trim(),P=p.signingAuthPlan,oe=p.signingLane;if(!f)throw Error(`[SigningEngine][near] threshold transaction signing requires prepared transaction operation`);if(Ct(P)&&P.thresholdSessionId!==M)throw Error(`[SigningEngine][near] warm-session auth plan must match prepared session identity`);let se={thresholdSessionId:Ct(P)?P.thresholdSessionId:M,lane:oe,signingAuthPlan:P,confirmationAuthPayload:{signingAuthPlan:P},warmSessionReady:Ct(P)},ce=oe,le=new Set,ue=e=>{le.has(e)||(le.add(e),Qe(`near`,et({event:`auth_side_effect_started`,lane:ce,sideEffect:e,phase:`confirmed`})))},de=e=>{e.phase===`auth.passkey.prompt.started`&&ue(`passkey_reauth`),Cr({onEvent:a,nearAccountId:b,signingAuthPlan:se.confirmationAuthPayload.signingAuthPlan},e)},fe=await hr({signingAuthPlan:P,signingLaneAuth:oe.auth,requiredSignatureUses:k,operationFingerprintDigest:ae,...m?{passkeyEd25519OperationStepUp:m}:{},...h?{emailOtpEd25519StepUp:h}:{}}),pe=fe.kind===`warm_session`?xa({preparation:g,executor:_}):null;pe?.catch(()=>{});let me=fe.confirmationAuthPayload;Ct(me.signingAuthPlan)&&Z(a,b,{phase:z.STEP_06_AUTH_WARM_SESSION_CLAIMED,status:`succeeded`,interaction:{kind:`none`,overlay:`none`},data:{thresholdSessionId:me.signingAuthPlan.thresholdSessionId,expiresAtMs:me.signingAuthPlan.expiresAtMs,remainingUses:me.signingAuthPlan.remainingUses}});let he=!Rt(u.current);he&&Z(a,b,{phase:z.STEP_05_CONFIRMATION_DISPLAYED,status:`waiting_for_user`,message:`Opening confirmation prompt`,interaction:{kind:`transaction_confirmation`,overlay:`show`}});let F=fe.kind===`warm_session`?null:Da({requestId:N,expectedThresholdSessionId:N,method:fe.kind,preparation:g,executor:_,operation:{ctx:e,thresholdKeyMaterial:C.threshold.thresholdKeyMaterial,walletId:t.walletSession.walletId,nearAccountId:b,operationId:A.operationId,operationFingerprint:D,txSigningRequest:w},funding:{ctx:e,nearPublicKeyStr:C.signingNearPublicKeyStr,signingOperation:A,signatureUses:k}});G(String(y),`pre_confirmation`,v);let ge=null,_e=n=>{ge||!pe||(ge=Ca({ctx:e,warmMaterial:pe,sessionCoordinator:d,thresholdKeyMaterial:C.threshold.thresholdKeyMaterial,walletId:t.walletSession.walletId,nearAccountId:b,operationId:A.operationId,txSigningRequest:w,confirmationTransaction:T,readiness:n}).catch(wa))},ve=performance.now(),L;try{L=await Mt({signingSessionPlan:p.signingSessionPlan,signingOperation:A,signingOperationState:u,runtime:O,request:{ctx:{touchConfirm:O},sessionId:N,chain:`near`,kind:`transaction`,...jt({signingAuthPlan:me.signingAuthPlan}),...pe?{onNearTransactionContextReady:_e}:{},walletId:String(oe.identity.signer.account.wallet.walletId),txSigningRequests:[T],rpcCall:ie,nearPublicKeyStr:C.signingNearPublicKeyStr,nearFundingRequest:{subject:{walletId:oe.identity.signer.account.wallet.walletId,nearAccountId:b,nearPublicKeyStr:C.signingNearPublicKeyStr},operation:{...A,accountId:String(b)},signatureUses:k},confirmationConfigOverride:Nt({signingAuthPlan:me.signingAuthPlan,override:o}),title:s,body:c,...F?{confirmationReadiness:{promise:F}}:{},onProgress:de}})}finally{ka({requestId:N,readiness:F})}let ye=performance.now();G(String(y),`confirmation`,ve);let be=F?await F:null;he&&Z(a,b,{phase:z.STEP_05_CONFIRMATION_APPROVED,status:`succeeded`,interaction:{kind:`transaction_confirmation`,overlay:`hide`}});let R=Tr({prepared:fe,confirmation:L}),xe=R.kind===`warm_session`?null:Oi({authorization:R,preparation:g,auth:f.lane.auth,walletId:t.walletSession.walletId}),Se=R.kind===`warm_session`?null:ii({requestId:N,ref:ga(L.operationStepUpPreparation)}),Ce=R.kind===`warm_session`?null:await Ta({material:va(be),prepared:_a(Se),displayDigest:L.intentDigest,authorization:R,proof:Ai(xe)}),we=be?.kind===`passkey_sealed`||be?.kind===`email_otp_sealed`,Te=performance.now();try{await x,G(String(A.operationId),`durable_lease_recovery_wait`,Te)}catch(e){throw G(String(A.operationId),`durable_lease_recovery_wait`,Te,`failed`),ya({resolved:Ce,owned:we}),e}let B=!1,{canonicalThresholdSessionId:V,activeClient:De,walletSessionState:Oe,operationMaterialFacts:ke,issuedAuthorization:Ae,transactionContext:je,nonceLeaseRefs:U}=await j({commandKind:At.PreparePayload,execute:async()=>{Z(a,b,{phase:z.STEP_08_SIGNER_PREPARE_STARTED,status:`running`,message:`Preparing NEAR signer`,interaction:{kind:`none`,overlay:`none`}});let t=performance.now(),n=R.kind===`warm_session`?{kind:`warm_session`,resolved:await Sa(pe)}:{kind:`operation_step_up`,resolved:Ce};G(String(A.operationId),`material_resolution_wait`,t);let r=(n.kind,n.resolved.material.facts.thresholdSessionId),i=(n.kind,n.resolved.material.activeClient),o=n.kind===`warm_session`?n.resolved.walletSessionState:null,s=performance.now(),c=n.kind===`warm_session`?await ra({confirmation:L,ctx:e,nearPublicKeyStr:C.signingNearPublicKeyStr,walletSessionState:o,authorization:R,signingOperation:A,signatureUses:k}):L.readiness.kind===`context_ready`?L.readiness:(()=>{throw Error(`[SigningEngine][near] operation step-up confirmation did not resolve a transaction context`)})();return G(String(A.operationId),`transaction_context`,s),Z(a,b,{phase:z.STEP_07_AUTHENTICATION_COMPLETE,status:`succeeded`,interaction:{kind:`none`,overlay:`none`},authMethod:se.warmSessionReady?`warm_session`:se.signingAuthPlan.method}),Z(a,b,{phase:z.STEP_08_SIGNER_PREPARE_SUCCEEDED,status:`succeeded`,message:`NEAR signer ready`,interaction:{kind:`none`,overlay:`none`},data:{signer:`threshold-ed25519`,thresholdSessionId:r,clientBaseSource:`yao_active_client`}}),{canonicalThresholdSessionId:r,activeClient:i,walletSessionState:o,operationMaterialFacts:n.kind===`operation_step_up`?n.resolved.material.facts:null,issuedAuthorization:n.kind===`operation_step_up`?n.resolved.issuedAuthorization:null,transactionContext:c.transactionContext,nonceLeaseRefs:c.nonceLeases}}}).catch(ba.bind(void 0,{resolved:Ce,owned:we})),Me=async t=>{B||!U.length||await Pa(e,U,`signing_failed`).catch(e=>{console.warn(`[SigningEngine][near][transaction] failed to release nonce leases`,{originalError:t instanceof Error?t.message:String(t||``),releaseError:e instanceof Error?e.message:String(e||``)})})},Ne=async n=>{Z(a,b,{phase:z.STEP_10_COMMIT_STARTED,status:`running`,interaction:{kind:`none`,overlay:`none`}});let r=R.kind===`warm_session`?await Ui({ctx:e,thresholdSessionId:V,activeClient:n,sessionCoordinator:d,walletSessionState:await Ea({state:Oe,coordinator:d,operationId:String(A.operationId)}),thresholdKeyMaterial:C.threshold.thresholdKeyMaterial,walletId:t.walletSession.walletId,nearAccountId:b,operationId:A.operationId,operationFingerprint:D,displayDigest:L.intentDigest,txSigningRequest:w,transactionContext:je,authorization:{kind:`reusable_wallet_session`},startedPrepare:ge?await ge:null}):await Ui({ctx:e,thresholdSessionId:V,activeClient:n,materialFacts:ke,thresholdKeyMaterial:C.threshold.thresholdKeyMaterial,walletId:t.walletSession.walletId,nearAccountId:b,operationId:A.operationId,operationFingerprint:D,displayDigest:L.intentDigest,txSigningRequest:w,transactionContext:je,authorization:{kind:`operation_step_up`,prepared:_a(Se),displayDigest:L.intentDigest,proof:R.kind===`passkey`?{kind:`passkey`,authority:R.plannedPasskeyOperationStepUp.authority,credential:R.credential}:{...Di({preparation:g,auth:f.lane.auth,walletId:t.walletSession.walletId,challengeId:R.challengeId,otpCode:R.otpCode})},issuedAuthorization:Ae}});if(r)return r.okResponse;throw Error(`[SigningEngine][near] Router A/B Ed25519 signing is unavailable`)};return await j({commandKind:At.Sign,execute:async()=>{try{let t=await Ne(De);B=!0;let n=performance.now();await Fa(e,U),G(String(A.operationId),`nonce_lease_commit`,n);let r=performance.now(),i=Ia({okResponse:t,nearAccountId:b,warnings:te,nonceLeases:U});return G(String(A.operationId),`transaction_assembly`,r),G(String(A.operationId),`confirmed_to_signed`,ye),Z(a,b,{phase:z.STEP_11_TRANSACTION_SIGNED,status:`succeeded`,interaction:{kind:`none`,overlay:`hide`}}),Z(a,b,{phase:z.STEP_15_COMPLETED,status:`succeeded`,interaction:{kind:`none`,overlay:`none`},data:{operation:`sign`}}),i}catch(e){let t=e instanceof Error?e:Error(String(e));throw await Me(t),ya({resolved:Ce,owned:we}),t}}})}async function Pa(e,t,n){t.length&&await Promise.all(t.map(t=>e.nonceCoordinator.release({leaseId:t.leaseId,operationId:t.operationId,operationFingerprint:t.operationFingerprint,reason:n})))}async function Fa(e,t){t.length&&await Promise.all(t.map(t=>e.nonceCoordinator.markSigned({leaseId:t.leaseId,operationId:t.operationId,operationFingerprint:t.operationFingerprint})))}function Ia(e){let t=e.okResponse.payload.signedTransactions||[];if(t.length!==1)throw Error(`Expected one signed transaction but received ${t.length}`);let n=t[0];if(!n||!n.transaction||!n.signature)throw Error(`Incomplete signed transaction data received`);let r=e.nonceLeases?.[0],i=n.serverDispatch;return{signedTransaction:new Pn({transaction:n.transaction,signature:n.signature,borsh_bytes:Array.from(n.borshBytes||[]),...r?{nonceLease:r}:{},...i?{serverDispatch:i}:{}}),nearAccountId:I(e.nearAccountId),logs:[...e.okResponse.payload.logs||[],...e.warnings],...r?{nonceLease:r}:{}}}function La(e){let t=e.thresholdKeyMaterial;if(!t)throw Error(`Missing threshold key material for ${e.nearAccountId}`);let n=String(t.publicKey||``).trim();if(!n)throw Error(`Missing threshold signing public key for ${e.nearAccountId}`);let r=String(e.relayerUrl||``).trim();if(!r)throw Error(`Missing relayerUrl (required for threshold-signer)`);let i=h(t.participants.map(e=>e.id));if(!i||i.length<2)throw Error(`Invalid threshold signing participantIds (expected >=2 participants, got [${(i||[]).join(`,`)}])`);return{signingNearPublicKeyStr:n,threshold:{relayerUrl:r,thresholdKeyMaterial:t}}}const Ra=e=>typeof e==`string`?e:_e(ge(e.keyData));function Q(e){return typeof e!=`number`||!Number.isFinite(e)||e<0?null:Math.round(e)}function za(e){if(e==null||!c(e))return;let t=e;if(t.kind!==`registration_confirmation_diagnostics_v1`)return;let n=Q(t.workerReadyMs),r=Q(t.workerRequestRoundTripMs),i=Q(t.workerResponseValidationMs),a=Q(t.requestSetupMs),o=Q(t.promptUserMs),s=Q(t.promptElementDefineMs),l=Q(t.promptMountMs),u=Q(t.promptHostFirstUpdateMs),d=Q(t.promptHostInteractiveMs),f=Q(t.promptConfirmEventMs),p=Q(t.promptDecisionWaitMs),m=Q(t.credentialCreateStartMs),h=Q(t.credentialCreateMs),g=Q(t.credentialSerializeMs),_=Q(t.duplicateRetryCount),v=Q(t.mainThreadTotalMs);if(!(n==null||r==null||i==null||a==null||o==null||s==null||l==null||u==null||d==null||f==null||p==null||m==null||h==null||g==null||_==null||v==null))return{kind:`registration_confirmation_diagnostics_v1`,workerReadyMs:n,workerRequestRoundTripMs:r,workerResponseValidationMs:i,requestSetupMs:a,promptUserMs:o,promptElementDefineMs:s,promptMountMs:l,promptHostFirstUpdateMs:u,promptHostInteractiveMs:d,promptConfirmEventMs:f,promptDecisionWaitMs:p,credentialCreateStartMs:m,credentialCreateMs:h,credentialSerializeMs:g,duplicateRetryCount:_,mainThreadTotalMs:v}}function Ba(e){if(e==null)return;if(!c(e))throw Error(`Invalid transactionContext: expected object`);let{nearPublicKeyStr:t,nextNonce:n,txBlockHeight:r,txBlockHash:i,accessKeyInfo:a}=e,o=d(t,`transactionContext.nearPublicKeyStr`),s=d(n,`transactionContext.nextNonce`),l=d(r,`transactionContext.txBlockHeight`),u=d(i,`transactionContext.txBlockHash`),f=a;if(f!=null&&!c(f))throw Error(`Invalid transactionContext.accessKeyInfo: expected object`);return f??={nonce:0},{nearPublicKeyStr:o,nextNonce:s,txBlockHeight:l,txBlockHash:u,accessKeyInfo:f}}function Va(e){if(e==null)return;let t=Fe(e);if(t.type!==`public-key`)throw Error(`Invalid credential.type: expected "public-key"`);let{id:n,rawId:r,response:i,authenticatorAttachment:a}=t;if(d(n,`credential.id`),d(r,`credential.rawId`),!c(i))throw Error(`Invalid credential.response: expected object`);let{clientDataJSON:o,attestationObject:s,transports:l}=i;if(d(o,`credential.response.clientDataJSON`),d(s,`credential.response.attestationObject`),!Array.isArray(l))throw Error(`Invalid credential.response.transports: expected string[]`);for(let e of l)if(typeof e!=`string`)throw Error(`Invalid credential.response.transports item: expected string`);if(a!=null&&typeof a!=`string`)throw Error(`Invalid credential.authenticatorAttachment: expected string | undefined`);return t}function Ha(e){if(!c(e))throw Error(`Invalid response payload: expected object`);let{confirmed:t,requestId:n,intentDigest:r,credential:i,transactionContext:a,registrationDiagnostics:o,error:s}=e,l=d(n,`requestId`),u=r==null?``:d(r,`intentDigest`),f=i==null?void 0:Va(i);if(!f)throw Error(`Missing registration credential`);let p=a==null?void 0:Ba(a),m=za(o),h=s==null?void 0:d(s,`error`);return{confirmed:!!t,requestId:l,intentDigest:u,credential:f,...p?{transactionContext:p}:{},...m?{registrationDiagnostics:m}:{},...h==null?{}:{error:h}}}function Ua(e){let t=e.selectedLane.identity.signer,n=F(e.commandSubject.walletSession.walletId),r=String(e.commandSubject.nearAccount.accountId);if(t.account.wallet.walletId!==n||String(t.account.nearAccountId)!==r)throw Error(`[SigningEngine][near] selected Ed25519 lane does not match command subject`);return{walletId:n,nearAccountId:r}}function Wa(e){let t=e.selectedLane.identity.signer,n={walletId:t.account.wallet.walletId,nearAccountId:t.account.nearAccountId,nearEd25519SigningKeyId:t.nearEd25519SigningKeyId,signerSlot:t.signerSlot,walletSessionId:e.selectedLane.walletSessionId,quotaId:e.selectedLane.quotaId,thresholdSessionId:e.selectedLane.thresholdSessionId};switch(e.selectedLane.auth.kind){case`voiceid`:return qe({...n,auth:e.selectedLane.auth,storageSource:`login`});case`passkey`:return qe({...n,auth:e.selectedLane.auth,storageSource:`login`});case`email_otp`:{let t=e.preparation.authorization.kind===`authorized`;return qe({...n,auth:e.selectedLane.auth,retention:t?`session`:`single_use`,sessionOrigin:t?`login`:`per_operation`})}default:throw e.selectedLane.auth,Error(`[SigningEngine][near] unsupported selected Ed25519 auth binding`)}}function Ga(e){let t=H.thresholdEd25519Session(e.selectedLane.thresholdSessionId);switch(e.preparation.authorization.kind){case`authorized`:{let n=e.preparation.authorization.authorization.status,r=n.remainingUses,i=n.expiresAtMs,a=i<=Date.now()?`expired`:r<e.requiredSignatureUses?`exhausted`:`ready`;return{readiness:a===`expired`?{status:`expired`,curve:`ed25519`,thresholdSessionId:t,expiresAtMs:i}:{status:a,curve:`ed25519`,thresholdSessionId:t,remainingUses:r,expiresAtMs:i},expiresAtMs:i,remainingUses:r,forceFreshAuth:a!==`ready`}}case`authorization_required`:return{readiness:{status:`missing_session`,curve:`ed25519`,thresholdSessionId:t},expiresAtMs:0,remainingUses:0,forceFreshAuth:!0};default:throw e.preparation.authorization,Error(`[SigningEngine][near] unsupported material authorization state`)}}function Ka(e){Ua(e);let t=Math.max(1,Math.floor(Number(e.requiredSignatureUses)||1)),n=Wa(e),r=Ga({selectedLane:e.selectedLane,preparation:e.preparation,requiredSignatureUses:t});return $e(`near`,n,{reason:`near_threshold_auth_plan`}),{thresholdSessionId:H.thresholdEd25519Session(e.selectedLane.thresholdSessionId),lane:n,coordinatorInput:{lane:n,readiness:r.readiness,expiresAtMs:r.expiresAtMs,remainingUses:r.remainingUses,forceFreshAuth:e.forceFreshAuth||r.forceFreshAuth}}}function qa(e){let{lane:t}=e.context,n=e.resolvedSigningSession,r=n.signingSessionPlan;if(r.kind===V.NotReady)throw Error(`[SigningEngine][near] signing session is not ready: ${r.reason}`);return{signingAuthPlan:Lt({plan:r,accountId:String(t.identity.signer.account.nearAccountId),intent:Ee.TransactionSign,curve:`ed25519`,expiresAtMs:n.expiresAtMs,remainingUses:n.remainingUses})}}function Ja(e,t){if(!t)throw Error(`[SigningEngine][near] ${e} operation step-up preparation is missing`);return t}function Ya(e,t){if(!t||t.kind!==`near_signature_only`)throw Error(`[SigningEngine][near] ${e} operation step-up preparation kind changed`);return t}function Xa(e,t){if(!t)throw Error(`[SigningEngine][near] ${e} operation step-up material is missing`);return t}function Za(e,t){if(!t)throw Error(`[SigningEngine][near] ${e} operation signing digest is missing`);return t}function Qa(e){if(!e)throw Error(`[SigningEngine][near] reusable Wallet Session authorization is unavailable`);return e}async function $a(e){if(e.authorization.kind===`passkey`){if(e.material.kind!==`passkey_live`&&e.material.kind!==`passkey_sealed`)throw Error(`[SigningEngine][near] passkey ${e.label} material changed factor`);return await ma({kind:`passkey`,material:e.material,expectedActivation:e.prepared.materialActivation,credential:e.authorization.credential})}if(e.material.kind!==`email_otp_live`&&e.material.kind!==`email_otp_sealed`)throw Error(`[SigningEngine][near] Email OTP ${e.label} material changed factor`);if(!e.emailOtpProof)throw Error(`[SigningEngine][near] Email OTP ${e.label} proof is missing`);return e.material.kind===`email_otp_live`?await ma({kind:`email_otp_live`,material:e.material,expectedActivation:e.prepared.materialActivation}):await ma({kind:`email_otp_sealed`,material:e.material,expectedActivation:e.prepared.materialActivation,normalSigningRequest:e.prepared.prepare.request,displayDigest:e.displayDigest,proof:e.emailOtpProof})}function eo(e){if(e.selection.kind===`authorized`){let t=Ka({requiredSignatureUses:1,commandSubject:e.commandSubject,forceFreshAuth:e.forceFreshAuth,selectedLane:e.selection.selectedLane,preparation:e.preparation}),n={signingSessionPlan:bn({lane:t.coordinatorInput.lane,readiness:t.coordinatorInput.readiness,forceFreshAuth:t.coordinatorInput.forceFreshAuth}),readiness:t.coordinatorInput.readiness,expiresAtMs:t.coordinatorInput.expiresAtMs||0,remainingUses:t.coordinatorInput.remainingUses||0};return{signingAuthPlan:qa({context:t,resolvedSigningSession:n}).signingAuthPlan,signingSessionPlan:n.signingSessionPlan}}let t=e.selection.candidate,n=gr(t.auth),r={kind:`deferred_ed25519_material_identity`,signer:Ke({walletId:t.walletId,nearAccountId:t.nearAccountId,nearEd25519SigningKeyId:t.nearEd25519SigningKeyId,signerSlot:t.signerSlot}),materialActivation:t.materialActivation,thresholdSessionId:H.thresholdEd25519Session(t.thresholdSessionId)};return{signingAuthPlan:n,signingSessionPlan:{kind:V.OperationStepUp,lane:{identity:r,auth:t.auth,curve:`ed25519`,keyKind:`threshold_ed25519`,chainFamily:`near`,sessionOrigin:`per_operation`,storageSource:`sealed_restore`,retention:`single_use`,materialActivation:r.materialActivation,thresholdSessionId:r.thresholdSessionId}}}}async function to(e,t){let n=await hr({signingAuthPlan:t.signingAuthPlan,signingLaneAuth:e.auth,requiredSignatureUses:1,operationFingerprintDigest:Ye(e.signingOperation.operationFingerprint),passkeyEd25519OperationStepUp:t.passkeyEd25519OperationStepUp,emailOtpEd25519StepUp:t.emailOtpEd25519StepUp});if(n.kind===`warm_session`)return{preparedStepUp:n,operationStepUp:null};let r=await pa({method:n.kind,preparation:e.preparation,executor:e.executor}),i=da(r),a=await e.computeSigningDigestB64u();return ti({requestId:String(e.signingOperation.operationId),build:async t=>{if(t.kind!==`near_signature_only`)throw Error(`[SigningEngine][near] ${e.label} operation step-up preparation kind changed`);return await Ei({ctx:e.ctx,thresholdSessionId:i.thresholdSessionId,materialFacts:i,walletId:e.walletId,nearAccountId:e.nearAccountId,materialActivation:r.materialActivation,operationId:e.signingOperation.operationId,operationFingerprint:e.signingOperation.operationFingerprint,displayDigest:t.displayDigest,signingDigestB64u:a,intent:e.intent})}}),{preparedStepUp:n,operationStepUp:{material:r,signingDigestB64u:a}}}async function no(e,t){let n=String(e.signingOperation.operationId);try{return await kt({signingSessionPlan:e.signingSessionPlan,signingOperation:e.signingOperation,runtime:t.touchConfirm,request:{ctx:{touchConfirm:t.touchConfirm},sessionId:n,chain:`near`,...t.request,...jt({signingAuthPlan:t.signingAuthPlan}),walletId:String(e.walletId),nearAccountId:e.nearAccountId,nearPublicKeyStr:t.nearPublicKeyStr,title:t.title,body:t.body,confirmationConfigOverride:Nt({signingAuthPlan:t.signingAuthPlan,override:t.confirmationConfigOverride}),onProgress:Cr.bind(void 0,{onEvent:t.onEvent,nearAccountId:e.nearAccountId,signingAuthPlan:t.signingAuthPlan})}})}finally{ni(n)}}function ro(e,t,n){let r=Tr({prepared:t.preparedStepUp,confirmation:n});if(r.kind===`warm_session`)return{kind:`warm_session`,displayDigest:n.intentDigest,stepUpAuthorization:r};let i=Oi({authorization:r,preparation:e.preparation,auth:e.auth,walletId:e.walletId}),a=Ya(e.label,ii({requestId:String(e.signingOperation.operationId),ref:Ja(e.label,n.operationStepUpPreparation)}));return{kind:`operation_step_up`,displayDigest:n.intentDigest,stepUpAuthorization:r,proof:i,prepared:a,...Xa(e.label,t.operationStepUp)}}async function io(e,t,n,r){if(t.preparedStepUp.kind!==`warm_session`)return null;let i=await ha({preparation:e.preparation,executor:e.executor}),a=Qa(await n.resolveActiveAuthorizedRouterAbEd25519WalletSessionState({state:i.walletSessionState,nowMs:Date.now()})),o=await Fi({ctx:e.ctx,thresholdSessionId:i.thresholdSessionId,activeClient:i.material.activeClient,walletSessionState:a,walletId:e.walletId,thresholdKeyMaterial:e.thresholdKeyMaterial,nearAccountId:e.nearAccountId,operationId:e.signingOperation.operationId,operationFingerprint:e.signingOperation.operationFingerprint,displayDigest:r,signingDigestB64u:await e.computeSigningDigestB64u(),intent:e.intent});return o?{resolved:i,started:o}:null}async function ao(e,t,n=null){if(t.kind===`warm_session`){let r=n?.resolved??await ha({preparation:e.preparation,executor:e.executor});return{kind:`warm_session`,thresholdSessionId:r.thresholdSessionId,displayDigest:t.displayDigest,resolved:r,startedPrepare:n?.started}}return n&&Ii(n.started),{kind:`operation_step_up`,thresholdSessionId:da(t.material).thresholdSessionId,displayDigest:t.displayDigest,resolved:await $a({label:e.label,material:t.material,prepared:t.prepared,displayDigest:t.displayDigest,authorization:t.stepUpAuthorization,emailOtpProof:t.proof.kind===`email_otp`?t.proof:null}),proof:t.proof,prepared:t.prepared,signingDigestB64u:t.signingDigestB64u}}async function oo(e,t,n){let r=t.kind===`warm_session`?await e.computeSigningDigestB64u():Za(e.label,t.signingDigestB64u),i=t.kind===`warm_session`?await Ni({ctx:e.ctx,thresholdSessionId:t.thresholdSessionId,activeClient:t.resolved.material.activeClient,sessionCoordinator:n,walletSessionState:Qa(await n.resolveActiveAuthorizedRouterAbEd25519WalletSessionState({state:t.resolved.walletSessionState,nowMs:Date.now()})),walletId:e.walletId,thresholdKeyMaterial:e.thresholdKeyMaterial,nearAccountId:e.nearAccountId,operationId:e.signingOperation.operationId,operationFingerprint:e.signingOperation.operationFingerprint,displayDigest:t.displayDigest,signingDigestB64u:r,intent:e.intent,authorization:{kind:`reusable_wallet_session`},startedPrepare:t.startedPrepare}):await Ni({ctx:e.ctx,thresholdSessionId:t.thresholdSessionId,activeClient:t.resolved.material.activeClient,materialFacts:t.resolved.material.facts,walletId:e.walletId,thresholdKeyMaterial:e.thresholdKeyMaterial,nearAccountId:e.nearAccountId,operationId:e.signingOperation.operationId,operationFingerprint:e.signingOperation.operationFingerprint,displayDigest:t.displayDigest,signingDigestB64u:r,intent:e.intent,authorization:{kind:`operation_step_up`,prepared:t.prepared,proof:t.proof,issuedAuthorization:t.resolved.issuedAuthorization}});if(!i)throw Error(`[SigningEngine][near] Router A/B Ed25519 ${e.label} signing is unavailable`);return t.kind===`operation_step_up`&&i.authorization===`operation_step_up`&&ci({prepared:t.prepared,issuedAuthorization:i.issuedAuthorization}),{signingDigestB64u:r,signatureB64u:i.signatureB64u,signerPublicKey:i.signerPublicKey}}async function so(e,t){return await Dt({signingSessionPlan:e.signingSessionPlan,signingOperation:e.signingOperation,commandKind:At.Sign,execute:async()=>{try{return await t()}catch(e){throw e instanceof Error?e:Error(String(e))}}})}function $(e,t,n){try{e?.(xe({...n,flowId:`signing:near:${String(t)}:${n.phase}`,accountId:String(t)}))}catch{}}function co(e){switch(e.kind){case`warm_session`:return`warm_session`;case`passkey`:return`passkey`;case`email_otp`:return`email_otp`;default:return lo(e)}}function lo(e){throw Error(`[SigningEngine][near] unsupported prepared step-up: ${String(e)}`)}async function uo({ctx:e,commandSubject:t,nearAccount:n,delegate:r,rpcCall:i,onEvent:a,confirmationConfigOverride:o,title:s,body:c,operationId:l,signerSlot:u,signingSessionCoordinator:d,forceFreshAuth:f,passkeyEd25519OperationStepUp:p,emailOtpEd25519StepUp:m,yaoSigningPreparation:h,yaoMaterialExecutor:g,selection:_}){let v=_.kind===`authorized`?_.selectedLane.auth:_.candidate.auth,y=_.kind===`authorized`?_.selectedLane.identity.signer.signerSlot:_.candidate.signerSlot,b=I(n.accountId),ee=e.relayerUrl,te={nearRpcUrl:i.nearRpcUrl||re(_t.network.chains),nearAccountId:b},x=[],S=e.touchConfirm;if(!S)throw Error(`UiConfirm bridge not available for delegate signing`);let{signingAuthPlan:C,signingSessionPlan:ie}=eo({selection:_,commandSubject:t,forceFreshAuth:f,preparation:h});$(a,b,{phase:z.STEP_02_REQUEST_PREPARED,status:`running`,message:`Loading threshold signing state`,interaction:{kind:`none`,overlay:`none`}});let{thresholdKeyMaterial:w}=await Wn({materialExecutor:g,nearAccount:n,signerSlot:y,requestedSignerSlot:u,operationLabel:`delegate signing`,warnings:x}),T=fo({nearAccountId:b,relayerUrl:ee,thresholdKeyMaterial:w,providedDelegatePublicKey:r.publicKey,warnings:x}),E=Kn({nearAccountId:b,delegate:r,signingPublicKey:T.delegatePublicKeyStr}),D={...E.workerDelegate,actions:E.workerDelegate.actions.map((e,t)=>ir(e,`delegate.actions[${t}]`))},ae={operationId:l,operationFingerprint:H.signingOperationFingerprint(await Zn({nearAccountId:b,nearNetworkId:ne(e.chains||_t.network.chains),relayerKeyId:T.threshold.thresholdKeyMaterial.relayerKeyId,signerPublicKey:T.delegatePublicKeyStr,delegate:D})),intent:Ee.TransactionSign},O={label:`delegate`,ctx:e,walletId:t.walletSession.walletId,nearAccountId:b,auth:v,signingSessionPlan:ie,signingOperation:ae,thresholdKeyMaterial:T.threshold.thresholdKeyMaterial,preparation:h,executor:g,intent:{kind:`near_delegate_action_v1`,delegate:D},computeSigningDigestB64u:async()=>(await Mr({delegate:E.workerDelegate,workerCtx:e})).signingDigestB64u},k=await to(O,{signingAuthPlan:C,passkeyEd25519OperationStepUp:p,emailOtpEd25519StepUp:m}),A=k.preparedStepUp.confirmationAuthPayload;Ct(A.signingAuthPlan)&&$(a,b,{phase:z.STEP_06_AUTH_WARM_SESSION_CLAIMED,status:`succeeded`,interaction:{kind:`none`,overlay:`none`},data:{thresholdSessionId:A.signingAuthPlan.thresholdSessionId,expiresAtMs:A.signingAuthPlan.expiresAtMs,remainingUses:A.signingAuthPlan.remainingUses}});let j=await io(O,k,d,await rt([{receiverId:E.confirmationDelegate.receiverId,actions:E.confirmationDelegate.actions.map(tt)}])),M=performance.now();$(a,b,{phase:z.STEP_05_CONFIRMATION_DISPLAYED,status:`waiting_for_user`,message:`Opening confirmation prompt`,interaction:{kind:`transaction_confirmation`,overlay:`show`}});let P=await no(O,{touchConfirm:S,signingAuthPlan:A.signingAuthPlan,nearPublicKeyStr:T.signingNearPublicKeyStr,onEvent:a,title:s,body:c,confirmationConfigOverride:o,request:{kind:`delegate`,delegate:E.confirmationDelegate,rpcCall:te}});G(String(l),`confirmation`,M),$(a,b,{phase:z.STEP_05_CONFIRMATION_APPROVED,status:`succeeded`,interaction:{kind:`transaction_confirmation`,overlay:`hide`}});let oe=ro(O,k,P),se=await Dt({signingSessionPlan:ie,signingOperation:ae,commandKind:At.PreparePayload,execute:async()=>{$(a,b,{phase:z.STEP_08_SIGNER_PREPARE_STARTED,status:`running`,message:`Preparing NEAR signer`,interaction:{kind:`none`,overlay:`none`}});let e=await ao(O,oe,j);return $(a,b,{phase:z.STEP_07_AUTHENTICATION_COMPLETE,status:`succeeded`,interaction:{kind:`none`,overlay:`none`},authMethod:co(k.preparedStepUp)}),$(a,b,{phase:z.STEP_08_SIGNER_PREPARE_SUCCEEDED,status:`succeeded`,message:`NEAR signer ready`,interaction:{kind:`none`,overlay:`none`},data:{signer:`threshold-ed25519`,thresholdSessionId:e.thresholdSessionId,clientBaseSource:`yao_active_client`}}),e}}),ce=await so(O,async()=>{$(a,b,{phase:z.STEP_10_COMMIT_STARTED,status:`running`,interaction:{kind:`none`,overlay:`none`}});let t=await oo(O,se,d),n=await vi({ctx:e,delegate:E.workerDelegate,signingDigestB64u:t.signingDigestB64u,signatureB64u:t.signatureB64u});return{type:N.SignDelegateActionSuccess,payload:{success:!0,hash:n.hash,signedDelegate:n.signedDelegate,logs:[`Delegate action signed through Router A/B normal signing`],error:void 0}}});return $(a,b,{phase:z.STEP_11_TRANSACTION_SIGNED,status:`succeeded`,interaction:{kind:`none`,overlay:`hide`}}),$(a,b,{phase:z.STEP_15_COMPLETED,status:`succeeded`,interaction:{kind:`none`,overlay:`none`},data:{operation:`sign_delegate`,hash:ce.payload.hash}}),{signedDelegate:ce.payload.signedDelegate,hash:ce.payload.hash,nearAccountId:I(b),logs:[...ce.payload.logs||[],...x]}}function fo(e){let t=_e(Ra(e.providedDelegatePublicKey)),n=e.thresholdKeyMaterial;if(!n)throw Error(`Missing threshold key material for ${e.nearAccountId}`);let r=_e(n.publicKey);if(!r)throw Error(`Missing threshold signing public key for ${e.nearAccountId}`);if(t&&t!==r&&e.warnings.push(`Delegate public key ${t} does not match threshold signer key; using ${r}`),!String(e.relayerUrl||``).trim())throw Error(`Missing relayerUrl (required for threshold-signer)`);let i=h(n.participants.map(e=>e.id));if(!i||i.length<2)throw Error(`Invalid threshold signing participantIds (expected >=2 participants, got [${(i||[]).join(`,`)}])`);return{signingNearPublicKeyStr:r,delegatePublicKeyStr:r,threshold:{thresholdKeyMaterial:n}}}async function po({ctx:e,commandSubject:t,nearAccount:n,signingSessionCoordinator:r,payload:i,forceFreshAuth:a,passkeyEd25519OperationStepUp:o,emailOtpEd25519StepUp:s,yaoSigningPreparation:c,yaoMaterialExecutor:l,selection:u,onEvent:d}){let f=u.kind===`authorized`?u.selectedLane.auth:u.candidate.auth,p=u.kind===`authorized`?u.selectedLane.identity.signer.signerSlot:u.candidate.signerSlot,m=i.operationId,h=performance.now(),g=e.relayerUrl,y=n.accountId,b=e.touchConfirm;if(!b)throw Error(`UiConfirm bridge not available for NEP-413 signing`);let{signingAuthPlan:ee,signingSessionPlan:te}=eo({selection:u,commandSubject:t,forceFreshAuth:a,preparation:c}),{thresholdKeyMaterial:x}=await Wn({materialExecutor:l,nearAccount:n,signerSlot:p,requestedSignerSlot:i.signerSlot,operationLabel:`NEP-413 signing`}),S=mo({nearAccountId:y,relayerUrl:g,thresholdKeyMaterial:x}),re={operationId:m,operationFingerprint:H.signingOperationFingerprint(await Xn({nearAccountId:y,nearNetworkId:ne(e.chains||_t.network.chains),relayerKeyId:S.threshold.thresholdKeyMaterial.relayerKeyId,signerPublicKey:S.threshold.thresholdKeyMaterial.publicKey,message:i.message,recipient:i.recipient,nonce:i.nonce,callbackUrl:i.callbackUrl})),intent:Ee.TransactionSign},C={label:`NEP-413`,ctx:e,walletId:t.walletSession.walletId,nearAccountId:y,auth:f,signingSessionPlan:te,signingOperation:re,thresholdKeyMaterial:S.threshold.thresholdKeyMaterial,preparation:c,executor:l,intent:{kind:`nep413_message_v1`,message:i.message,recipient:i.recipient,nonce:i.nonce,callbackUrl:i.callbackUrl},computeSigningDigestB64u:async()=>(await jr({message:i.message,recipient:i.recipient,nonce:i.nonce,callbackUrl:i.callbackUrl,workerCtx:e})).signingDigestB64u},ie=await to(C,{signingAuthPlan:ee,passkeyEd25519OperationStepUp:o,emailOtpEd25519StepUp:s}),w=await io(C,ie,r,await nt({nearAccountId:y,recipient:i.recipient,message:i.message}));G(String(m),`pre_confirmation`,h);let T=performance.now(),E=await no(C,{touchConfirm:b,signingAuthPlan:ie.preparedStepUp.confirmationAuthPayload.signingAuthPlan,nearPublicKeyStr:S.nearPublicKey,onEvent:d,title:i.title,body:i.body,confirmationConfigOverride:i.confirmationConfigOverride,request:{kind:`nep413`,message:i.message,recipient:i.recipient}});G(String(m),`confirmation`,T);let D=performance.now(),ae=ro(C,ie,E),O=await Dt({signingSessionPlan:te,signingOperation:re,commandKind:At.PreparePayload,execute:async()=>await ao(C,ae,w)}),k=await so(C,async()=>{let e=await oo(C,O,r);return{type:N.SignNep413MessageSuccess,payload:{accountId:y,publicKey:e.signerPublicKey,signature:_(v(e.signatureB64u)),state:i.state??void 0}}});return G(String(m),`confirmed_to_signed`,D),{success:!0,accountId:k.payload.accountId,publicKey:k.payload.publicKey,signature:k.payload.signature,state:k.payload.state}}function mo(e){let t=e.thresholdKeyMaterial;if(!t)throw Error(`Missing threshold key material for ${e.nearAccountId}`);let n=String(t.publicKey||``).trim();if(!n)throw Error(`Missing threshold signing public key for ${e.nearAccountId}`);if(!String(e.relayerUrl||``).trim())throw Error(`Missing relayerUrl (required for threshold-signer)`);let r=h(t.participants.map(e=>e.id));if(!r||r.length<2)throw Error(`Invalid threshold signing participantIds (expected >=2 participants, got [${(r||[]).join(`,`)}])`);return{nearPublicKey:n,threshold:{thresholdKeyMaterial:t}}}async function ho(e){if(e.chain!==`near`)throw Error(`[NearSigningFlow] invalid chain`);return e.kind===`transactionWithActions`?(go(e.payload),await ja(e.payload)):e.kind===`delegateAction`?(vo(e.payload),await uo(e.payload)):e.kind===`nep413`?(yo(e.payload),await po(e.payload)):e}function go(e){let t=String(e.nearAccount?.accountId||``).trim();if(!t)throw Error(`[NearSigningFlow] nearAccount is required`);if(String(e.rpcCall?.nearAccountId||``).trim()!==t)throw Error(`[NearSigningFlow] rpcCall.nearAccountId must match nearAccount.accountId`);let n=e.transactions;Array.isArray(n)&&kr(n),_o(e.transaction,0)}function _o(e,t){if(!String(e?.receiverId||``).trim())throw Error(`[NearSigningFlow] transactions[${t}].receiverId is required`);let n=Array.isArray(e?.actions)?e.actions:[];if(n.length===0)throw Error(`[NearSigningFlow] transactions[${t}].actions must be non-empty`);n.forEach(Pe)}function vo(e){let t=String(e.nearAccount?.accountId||``).trim();if(!t)throw Error(`[NearSigningFlow] nearAccount is required`);if(String(e.rpcCall?.nearAccountId||``).trim()!==t)throw Error(`[NearSigningFlow] rpcCall.nearAccountId must match nearAccount.accountId`);if(!String(e.delegate?.receiverId||``).trim())throw Error(`[NearSigningFlow] delegate.receiverId is required`);let n=Array.isArray(e.delegate?.actions)?e.delegate.actions:[];if(n.length===0)throw Error(`[NearSigningFlow] delegate.actions must be non-empty`);n.forEach(e=>Pe(Me(e)))}function yo(e){let t=String(e.nearAccount?.accountId||``).trim();if(!t)throw Error(`[NearSigningFlow] nearAccount is required for NEP-413`);if(String(e.payload?.accountId||``).trim()!==t)throw Error(`[NearSigningFlow] payload.accountId must match nearAccount.accountId`);if(!String(e.payload?.recipient||``).trim())throw Error(`[NearSigningFlow] recipient is required for NEP-413`);if(!String(e.payload?.message||``).trim())throw Error(`[NearSigningFlow] message is required for NEP-413`)}var bo=e({signDelegateAction:()=>cs,signNear:()=>wo});function xo(e){if(!(e instanceof ut))return;let t=e.authorizationDecision;if(!(!t||t.kind!==`step_up_required`||!(`request_id`in t.step_up)))return{kind:`step_up_required`,reason:t.reason,step_up:t.step_up}}function So(e){let t=xo(e),n=st(e);return t?ot(n??{kind:`exhausted`,source:`server_prepare`,detail:`Server requires owner operation step-up`}):n?.kind===`in_flight`?ot(n):null}async function Co(e){if(e.failure?.kind!==`expired`)return;let t=St({source:{kind:`ed25519`,laneIdentity:Ge(e.lane)},expiresAtMs:e.expiresAtMs,detectedAtMs:Date.now()});if((await e.coordinator.invalidateExpiredWalletSession({state:t,source:R.serverRejection})).kind===`unavailable`)throw Error(`[SigningEngine][near] expired Wallet Session cleanup failed`)}async function wo(e,t){let n=e.getSignerWorkerContext(),r=t.kind===`transactionWithActions`?ie(n.touchConfirm?.getContext().surfaceMeasurementBinding)??null:null;if(r&&r.assertPending(),e={...e,prepareNearEd25519YaoMaterialBoundary:To.bind(null,e.prepareNearEd25519YaoMaterialBoundary.bind(e),r),getSignerWorkerContext:r?fs.bind(null,n,r.beforeSigning):e.getSignerWorkerContext},t.kind===`transactionWithActions`)return await is(e,t.args);if(t.kind===`delegateAction`)return await cs(e,t.args);if(t.kind===`nep413`)return await ds(e,t.args);throw Error(`[SigningEngine] unsupported near signing intent: ${String(t.kind||``)}`)}function To(e,t,n){let r=B(n.materialIdentity?n.materialIdentity.auth:n.auth);if(r===`voiceid`&&!t)throw Error(`VoiceID requires a reviewed NEAR transfer.`);return t?.assertAuthMethodPolicy(r),e(n)}function Eo(){let e=b(32,`NEAR transaction signing operation IDs`);return H.signingOperation(`near-transaction-sign:${e}`)}function Do(e){return e.state===`missing`?{state:e.state,curve:e.curve,chain:e.chain}:{authMethod:B(e.auth),walletId:e.walletId,nearAccountId:e.nearAccountId,nearEd25519SigningKeyId:e.nearEd25519SigningKeyId,signerSlot:e.signerSlot,state:e.state,source:e.source||`unknown`,...e.authorizationState===`authorized`?{walletSessionId:e.authorization.operationCredential.walletSessionId,quotaId:e.authorization.session.quotaId}:{},thresholdSessionId:e.thresholdSessionId,remainingUses:e.remainingUses,expiresAtMs:e.expiresAtMs}}function Oo(e){let t=e?.candidates.ed25519.near||[];return{generation:e?.generation||0,candidateCount:t.length,candidates:t.map(Do)}}function ko(e,t,n){try{e?.(xe({...n,flowId:`signing:near:${String(t)}:${n.phase}`,accountId:String(t)}))}catch{}}function Ao(e){if(We(e.signingLane.identity)!==We(e.transactionLane.identity))throw Error(`[SigningEngine][near] prepared signing lane drifted from selected transaction lane`)}function jo(e,t){let n=e.identity.signer,r=t.identity.signer;return String(n.account.wallet.walletId)===String(r.account.wallet.walletId)&&String(n.account.nearAccountId)===String(r.account.nearAccountId)&&String(n.nearEd25519SigningKeyId)===String(r.nearEd25519SigningKeyId)&&n.signerSlot===r.signerSlot&&Oe(e.auth)===Oe(t.auth)}function Mo(e){let t=e.readiness.status;return t===`ready`?{status:`ready`,remainingUses:Math.max(0,Math.floor(Number(e.readiness.remainingUses)||0)),expiresAtMs:Math.max(0,Math.floor(Number(e.readiness.expiresAtMs)||0))}:t===`expired`||t===`exhausted`||t===`status_unknown`?t===`status_unknown`?{status:t,reason:`trusted wallet budget status is unavailable`}:{status:t}:t===`auth_unavailable`||t===`status_unavailable`?{status:t,reason:t}:{status:`status_unavailable`,reason:t}}function No(e){if(e.curve!==`ed25519`||e.keyKind!==`threshold_ed25519`)throw Error(`[SigningEngine][near] prepared signing lane is not Ed25519`);if(e.chainFamily!==`near`)throw Error(`[SigningEngine][near] prepared Ed25519 lane must target NEAR`);let t=String(e.thresholdSessionId||``).trim(),n=String(e.walletSessionId||``).trim(),r=String(e.quotaId||``).trim();if(!t||!n||!r)throw Error(`[SigningEngine][near] prepared Ed25519 lane is missing session identity`);return{...e,curve:`ed25519`,keyKind:`threshold_ed25519`,chainFamily:`near`,walletSessionId:H.walletSession(n),quotaId:H.walletSessionQuota(r),thresholdSessionId:H.thresholdEd25519Session(t)}}async function Po(e){let t=e.preparedOperation,n=t.lane;$e(`near`,n,{reason:`near_transaction_auth_planning`});let r=e.commandSubject.nearAccount.accountId,i={accountId:r,intent:Ee.TransactionSign,curve:`ed25519`},a=t.signingSessionPlan;if(a.kind===V.NotReady)throw console.warn(`[SigningEngine][near][ed25519] transaction auth planning not ready`,{nearAccountId:r,authMethod:B(n.auth),reason:a.reason,readiness:t.readiness.status,walletSessionId:n.walletSessionId,quotaId:n.quotaId,thresholdSessionId:n.thresholdSessionId,retention:n.retention,remainingUses:t.remainingUses,expiresAtMs:t.expiresAtMs}),a.reason===`policy_blocked`?Error(`[SigningEngine] NEAR operation requires passkey authentication after Email OTP login`):Error(`[SigningEngine][near] signing session is not ready: ${a.reason}`);return{signingAuthPlan:Lt({plan:a,accountId:i.accountId,intent:i.intent,curve:i.curve,expiresAtMs:t.expiresAtMs,remainingUses:t.remainingUses}),signingLane:n}}function Fo(e){let t=String(e.providedThresholdSessionId||``).trim(),n=String(e.identity.thresholdSessionId||``).trim();if(t&&t!==n)throw Error(`[SigningEngine][near] transaction thresholdSessionId must match prepared Ed25519 identity`);return n}function Io(e){switch(e.authorization.kind){case`authorized`:return!1;case`authorization_required`:return!0;default:throw e.authorization,Error(`[SigningEngine][near] unsupported material authorization state`)}}function Lo(e){if(e.authorization.kind!==`authorized`)throw Error(`[SigningEngine][near] reusable Wallet Session authorization is unavailable`);return e.authorization.authorization.status.expiresAtMs}async function Ro(e){let t={walletId:F(e.commandSubject.walletSession.walletId),nearAccountId:I(e.commandSubject.nearAccount.accountId)};return e.materialIdentity?await e.deps.prepareNearEd25519YaoMaterialBoundary({...t,materialIdentity:e.materialIdentity}):await e.deps.prepareNearEd25519YaoMaterialBoundary({...t,laneIdentity:e.selectedLane.identity,auth:e.selectedLane.auth})}function zo(e,t){return H.signingOperation(e.createSigningSessionId(`near-${t}-operation`))}function Bo(e){return{kind:`prepared_near_transaction_execution`,thresholdSessionId:e.thresholdSessionId,signingSessionPlan:e.preparedSigningSession.preparedOperation.signingSessionPlan,signingAuthPlan:e.preparedSigningSession.signingAuthPlan,signingLane:e.preparedSigningSession.signingLane,signingSessionCoordinator:e.signingSessionCoordinator,transactionOperation:e.preparedSigningSession.transactionOperation,passkeyEd25519OperationStepUp:e.passkeyEd25519OperationStepUp,emailOtpEd25519StepUp:e.emailOtpEd25519StepUp}}function Vo(e){return lt({walletId:String(e.walletId),curve:`ed25519`,walletSessionId:String(e.prepared.signingLane.walletSessionId),quotaId:String(e.prepared.signingLane.quotaId),projectionVersion:`server-owned`,authorityKey:Oe(e.prepared.signingLane.auth),targetKey:`near:${String(e.nearAccountId)}`})}function Ho(e){if(e.prepared.kind!==`authorized`)throw Error(`[SigningEngine][near] deferred Ed25519 material has no reusable session`);return lt({walletId:String(e.walletId),curve:`ed25519`,walletSessionId:String(e.prepared.selectedLane.walletSessionId),quotaId:String(e.prepared.selectedLane.quotaId),projectionVersion:`projection-unadmitted`,authorityKey:Oe(e.prepared.selectedLane.auth),targetKey:`near:${String(e.nearAccountId)}`})}function Uo(e){if(e.auth.kind!==`passkey`)return;let t=e.auth;return{prepare:async()=>{let n=e.signer,r=await Go({authorityRef:Wo(e.preparation),walletId:n.account.wallet.walletId,rpId:t.rpId,credentialIdB64u:t.credentialIdB64u});return{thresholdSessionId:e.thresholdSessionId,authority:r}}}}function Wo(e){switch(e.hydration.kind){case`use_live_runtime`:case`rehydrate_material_activation`:case`reauthorize_public_anchor`:return e.hydration.authority;case`blocked`:throw Error(`[SigningEngine][near] blocked Passkey material has no authority`);default:throw e.hydration,Error(`[SigningEngine][near] unsupported Passkey material authority`)}}async function Go(e){let t=L({walletId:e.walletId,factor:{kind:`passkey`,credentialIdB64u:e.credentialIdB64u},verifier:{kind:`webauthn`,rpId:e.rpId},bindingId:e.authorityRef.walletAuthMethodId});if(!t)throw Error(`[SigningEngine][near] exact Passkey step-up authority is invalid`);let n=await ye({authority:t});if(n.walletId!==e.authorityRef.walletId||n.walletAuthMethodId!==e.authorityRef.walletAuthMethodId||n.authorityDigest!==e.authorityRef.authorityDigest)throw Error(`[SigningEngine][near] exact Passkey step-up authority changed`);return t}function Ko(e){if(e.auth.kind!==P.emailOtp||typeof e.deps.requestEmailOtpEd25519SigningChallenge!=`function`||!e.preparation.hydration.materialActivation)return;if(String(e.signer.account.wallet.walletId)!==String(e.commandSubject.walletSession.walletId)||String(e.signer.account.nearAccountId)!==String(e.commandSubject.nearAccount.accountId))throw Error(`[SigningEngine][near] Email OTP step-up lane changed subject`);let t=async t=>{let n=await e.deps.requestEmailOtpEd25519SigningChallenge({walletSession:e.commandSubject.walletSession,operationFingerprintDigest:t.operationFingerprintDigest});return ko(e.onEvent,e.commandSubject.nearAccount.accountId,{phase:z.STEP_06_AUTH_EMAIL_OTP_INPUT_REQUIRED,status:`waiting_for_user`,interaction:{kind:`otp_input`,overlay:`show`},data:{emailHint:n.emailHint,demoOtpCode:it(n.delivery)}}),n};return{prepare:t,resend:t}}async function qo(e){let t=Wt({availableLanes:await ts({deps:e.deps,commandSubject:e.commandSubject,authMethod:null}),intent:Qo({commandSubject:e.commandSubject,signerSlot:e.signerSlot,authSelectionPolicy:{kind:`any`},operationUsesNeeded:1})});if(!t.ok)throw Error(`[SigningEngine][near] signature-only signing requires exact Ed25519 material`);if(t.kind===`authorization_required`){let n=t.candidate,r=Ke({walletId:n.walletId,nearAccountId:n.nearAccountId,nearEd25519SigningKeyId:n.nearEd25519SigningKeyId,signerSlot:n.signerSlot}),i={kind:`near_ed25519_material_identity`,signer:r,auth:n.auth,thresholdSessionId:H.thresholdEd25519Session(n.thresholdSessionId)},a=await Ro({deps:e.deps,commandSubject:e.commandSubject,materialIdentity:i});return{kind:`authorization_required`,candidate:n,materialIdentity:i,forceFreshAuth:!0,passkeyEd25519OperationStepUp:Uo({auth:n.auth,signer:r,thresholdSessionId:i.thresholdSessionId,preparation:a.preparation})||null,emailOtpEd25519StepUp:Ko({deps:e.deps,commandSubject:e.commandSubject,auth:n.auth,signer:r,preparation:a.preparation,onEvent:e.onEvent})||null,yaoSigningPreparation:a.preparation,yaoMaterialExecutor:a.executor}}let n=t.lane,r=await Ro({deps:e.deps,commandSubject:e.commandSubject,selectedLane:n});return{kind:`authorized`,selectedLane:n,forceFreshAuth:e.attempt.forceFreshAuth||Io(r.preparation),passkeyEd25519OperationStepUp:Uo({auth:n.auth,signer:n.identity.signer,thresholdSessionId:n.identity.thresholdSessionId,preparation:r.preparation})||null,emailOtpEd25519StepUp:Ko({deps:e.deps,commandSubject:e.commandSubject,auth:n.auth,signer:n.identity.signer,preparation:r.preparation,onEvent:e.onEvent})||null,yaoSigningPreparation:r.preparation,yaoMaterialExecutor:r.executor}}async function Jo(e){let t=xt({materialActivation:e.materialActivation});return await e.deps.withThresholdEd25519CommitQueue({queueKey:t,nearAccountId:e.nearAccountId,enabled:!0,task:e.task})}async function Yo(e){let t=e.availableLanes,n=Wt({availableLanes:t,intent:Qo({commandSubject:e.commandSubject,signerSlot:e.input.signerSlot,authSelectionPolicy:{kind:`any`},operationUsesNeeded:Or(e.input.transaction)})});if(!n.ok||n.kind!==`authorization_required`)return null;let r=n.candidate,i=Ke({walletId:r.walletId,nearAccountId:r.nearAccountId,nearEd25519SigningKeyId:r.nearEd25519SigningKeyId,signerSlot:r.signerSlot}),a={kind:`near_ed25519_material_identity`,signer:i,auth:r.auth,thresholdSessionId:H.thresholdEd25519Session(r.thresholdSessionId)},o=await Ro({deps:e.deps,commandSubject:e.commandSubject,materialIdentity:a});return{candidate:r,preparation:o.preparation,executor:o.executor,passkeyEd25519OperationStepUp:Uo({auth:r.auth,signer:i,thresholdSessionId:a.thresholdSessionId,preparation:o.preparation})||null,emailOtpEd25519StepUp:Ko({deps:e.deps,commandSubject:e.commandSubject,auth:r.auth,signer:i,preparation:o.preparation,onEvent:e.input.onEvent})||null}}function Xo(e){switch(e.hydration.kind){case`use_live_runtime`:case`rehydrate_material_activation`:return e.hydration.materialActivation;case`reauthorize_public_anchor`:throw Error(`[SigningEngine][near] retired public material cannot enter the material commit queue`);case`blocked`:throw Error(`[SigningEngine][near] blocked material cannot enter the material commit queue: ${e.hydration.reason}`)}throw e.hydration,Error(`[SigningEngine][near] unsupported material hydration plan`)}function Zo(e){let t=e.authSelectionPolicy||null;if(!t)return null;let n=Bt(zt(Vt(Qo({commandSubject:e.commandSubject,signerSlot:e.signerSlot,authSelectionPolicy:t,operationUsesNeeded:e.operationUsesNeeded})),{availableLanes:e.availableLanes}));if(n.tag===`LaneSelected`){if(n.lane.curve!==`ed25519`||n.availableLane.curve!==`ed25519`)throw Error(`[SigningEngine][near] Ed25519 selector returned a non-Ed25519 lane`);return n}if(n.failure.kind===`no_candidate`)return null;throw Error(`[SigningEngine][near] Ed25519 transaction lane selection failed: ${n.failure.kind}`)}function Qo(e){return{walletId:F(e.commandSubject.walletSession.walletId),curve:`ed25519`,chain:`near`,signerSelection:$o({nearAccountId:e.commandSubject.nearAccount.accountId,signerSlot:e.signerSlot}),authSelectionPolicy:e.authSelectionPolicy,operationUsesNeeded:e.operationUsesNeeded}}function $o(e){if(e.signerSlot===void 0)return{kind:`near_account`,nearAccountId:e.nearAccountId};let t=be(e.signerSlot);if(t===null)throw Error(`[SigningEngine][near] signerSlot must be a positive safe integer`);return{kind:`signer_slot`,nearAccountId:e.nearAccountId,signerSlot:t}}function es(e){return Zo({availableLanes:e.availableLanes,authSelectionPolicy:{kind:`any`},commandSubject:e.commandSubject,signerSlot:e.signerSlot,operationUsesNeeded:e.operationUsesNeeded})}async function ts(e){let t=e.commandSubject.nearAccount.accountId,n=e.commandSubject.walletSession.walletId;if(typeof e.deps.readAvailableSigningLanesForSigning!=`function`)throw Error(`[SigningEngine][near] transaction signing requires available signing lanes reader`);let r=await e.deps.resolveOwnerLaneScope(n);return await e.deps.readAvailableSigningLanesForSigning({walletId:n,curve:`ed25519`,ownerScope:r,...e.authMethod?{authMethod:e.authMethod}:{}}).catch(e=>(console.warn(`[SigningEngine][near] available signing lanes read failed`,{nearAccountId:t,error:e instanceof Error?e.message:String(e||`unknown error`)}),null))}async function ns(e){let t=e.commandSubject.nearAccount.accountId,n=Math.max(1,Math.floor(Number(e.operationUsesNeeded)||1)),r=e.selectedLane.lane,i=Ka({commandSubject:e.commandSubject,selectedLane:r,preparation:e.preparation,forceFreshAuth:e.forceFreshAuth,requiredSignatureUses:n}),a=i.lane;Ao({signingLane:a,transactionLane:e.selectedLane.lane});let o={readiness:i.coordinatorInput.readiness,expiresAtMs:i.coordinatorInput.expiresAtMs,remainingUses:i.coordinatorInput.remainingUses};r.auth.kind===`email_otp`&&o.readiness.status!==`ready`&&console.warn(`[SigningEngine][near][email-otp] Ed25519 pre-confirm readiness is not ready`,{nearAccountId:t,readiness:o.readiness.status,thresholdSessionId:r.thresholdSessionId,walletSessionId:r.walletSessionId,quotaId:r.quotaId,retention:a.retention,remainingUses:o.remainingUses,expiresAtMs:o.expiresAtMs,requiredSignatureUses:n}),Qe(`near`,et({event:`pre_confirm_readiness_checked`,lane:a,readinessStatus:o.readiness.status,phase:`pre_confirm`}));let s=Gt(e.selectedLane,Mo({readiness:o.readiness,expiresAtMs:o.expiresAtMs,remainingUses:o.remainingUses})),c=Ht(s),l=No(a),u={readiness:o.readiness,expiresAtMs:o.expiresAtMs,remainingUses:o.remainingUses};return{lane:a,transactionLane:e.selectedLane.lane,transactionIntent:e.selectedLane.intent,readiness:u,availableLanesGeneration:e.availableLanes?.generation||0,metadata:{transactionLane:e.selectedLane.lane,transactionOperation:c,transactionReadinessState:s,identity:l,availableLanesGeneration:e.availableLanes?.generation||0,readiness:u}}}async function rs(e){let t=e.commandSubject.nearAccount.accountId,n=Or(e.input.transaction),r=e.availableLanes,i=es({commandSubject:e.commandSubject,availableLanes:r,signerSlot:e.input.signerSlot,operationUsesNeeded:n});if(!i)throw console.warn(`[SigningEngine][near][ed25519] exact transaction lane selection failed ${JSON.stringify({nearAccountId:t,signerSlot:e.input.signerSlot??null,requiredSignatureUses:n,availableLanes:Oo(r)})}`),Error(`[SigningEngine][near] Ed25519 transaction signing requires an exact selected lane`);let a={kind:`account_class`,authMethod:B(i.lane.auth)},o=await Ro({deps:e.deps,commandSubject:e.commandSubject,selectedLane:i.lane});if(o.preparation.authorization.kind===`authorized`){let t=o.preparation.authorization.authorization;if(i.lane.walletSessionId!==t.operationCredential.walletSessionId||i.lane.quotaId!==t.session.quotaId){r=await ts({deps:e.deps,commandSubject:e.commandSubject,authMethod:B(i.lane.auth)});let a=es({commandSubject:e.commandSubject,availableLanes:r,signerSlot:e.input.signerSlot,operationUsesNeeded:n});if(!a||!jo(i.lane,a.lane)||a.lane.walletSessionId!==t.operationCredential.walletSessionId||a.lane.quotaId!==t.session.quotaId)throw Error(`[SigningEngine][near] material restoration changed the Wallet Session without an exact refreshed lane`);i=a}}let s=e.forceFreshAuth===!0||Io(o.preparation),c=await Ut({intent:Qo({commandSubject:e.commandSubject,signerSlot:e.input.signerSlot,authSelectionPolicy:a,operationUsesNeeded:n}),coordinator:e.signingSessionCoordinator,forceFreshAuth:s,sensitiveOperationPolicy:e.input.sensitivePolicy||oe.inheritSessionPolicy,onPlannerTrace:e=>Ze(`near`,e),lifecycleAdapter:{prepare:async()=>{let t=await ns({deps:e.deps,commandSubject:e.commandSubject,signingSessionCoordinator:e.signingSessionCoordinator,availableLanes:r,selectedLane:i,preparation:o.preparation,forceFreshAuth:s,operationUsesNeeded:n});return{...t,metadata:t.metadata}}}}),l=c.thresholdOperation,u=c.transactionOperation,d=l.lane,f=u.lane,p=l.metadata.identity,{signingAuthPlan:m}=await Po({commandSubject:e.commandSubject,preparedOperation:l});return{preparation:o.preparation,executor:o.executor,signingAuthPlan:m,signingLane:d,transactionLane:f,identity:p,thresholdSessionId:H.thresholdEd25519Session(Fo({providedThresholdSessionId:e.input.thresholdSessionId,identity:p})),availableLanesGeneration:l.availableLanesGeneration,preparedOperation:l,transactionOperation:u}}async function is(e,t){let n=performance.now();await e.touchConfirm.openTransactionPreparationModal({chain:`near`,walletLabel:String(t.commandSubject.nearAccount.accountId),txSigningRequests:[t.transaction],model:Un({txSigningRequests:[t.transaction],signerAccount:String(t.commandSubject.nearAccount.accountId),title:t.title,subtitle:t.body}),confirmationConfigOverride:t.confirmationConfigOverride});try{let r=Eo();return G(String(r),`preparation_modal`,n),await as(e,t,{signingOperationState:Ot({operationId:r})})}finally{e.touchConfirm.closeTransactionPreparationModal()}}async function as(e,t,n){let r=t.commandSubject.nearAccount,i=I(r.accountId),a={signerSlot:t.signerSlot,confirmationConfigOverride:t.confirmationConfigOverride,title:t.title,body:t.body,onEvent:t.onEvent},o=n.signingOperationState.operationId,s=n.signingSessionCoordinator||e.signingSessionCoordinator,c=performance.now(),l=await ts({deps:e,commandSubject:t.commandSubject,authMethod:null}),u=await Yo({deps:e,availableLanes:l,input:t,commandSubject:t.commandSubject,operationId:o});if(G(String(o),`authorization_probe`,c),u){let o=e.getSignerWorkerContext();return await Jo({deps:e,nearAccountId:i,materialActivation:Xo(u.preparation),task:async()=>await ho({chain:`near`,kind:`transactionWithActions`,payload:{ctx:o,commandSubject:t.commandSubject,nearAccount:r,transaction:t.transaction,rpcCall:t.rpcCall,signerSlot:a.signerSlot,confirmationConfigOverride:a.confirmationConfigOverride,title:a.title,body:a.body,onEvent:a.onEvent,signingOperationState:n.signingOperationState,signingSessionCoordinator:s,selection:{kind:`authorization_required`,candidate:u.candidate},passkeyEd25519OperationStepUp:u.passkeyEd25519OperationStepUp||void 0,emailOtpEd25519StepUp:u.emailOtpEd25519StepUp||void 0,sensitivePolicy:t.sensitivePolicy,yaoSigningPreparation:u.preparation,yaoMaterialExecutor:u.executor}})})}let d=performance.now(),f=await rs({deps:e,availableLanes:l,input:t,commandSubject:t.commandSubject,signingSessionCoordinator:s,operationId:o,forceFreshAuth:n.forceFreshAuth===!0});G(String(o),`lane_preparation`,d);let p=performance.now(),m=f.preparation.authorization,h=f.signingAuthPlan,g=f.signingLane,_=f.transactionLane,v=f.thresholdSessionId;Ao({signingLane:g,transactionLane:_});try{return await Jo({deps:e,nearAccountId:i,materialActivation:Xo(f.preparation),task:async()=>{let i=e.getSignerWorkerContext(),c=f,l=Uo({auth:_.auth,signer:_.identity.signer,thresholdSessionId:v,preparation:c.preparation}),u=Ko({deps:e,commandSubject:t.commandSubject,auth:_.auth,signer:_.identity.signer,preparation:c.preparation,onEvent:a.onEvent}),d=Bo({preparedSigningSession:f,thresholdSessionId:v,signingSessionCoordinator:s,passkeyEd25519OperationStepUp:l||null,emailOtpEd25519StepUp:u||null}),m={thresholdSessionId:d.thresholdSessionId,signingSessionPlan:d.signingSessionPlan,signingAuthPlan:d.signingAuthPlan,signingLane:d.signingLane},h={ctx:i,commandSubject:t.commandSubject,nearAccount:r,transaction:t.transaction,rpcCall:t.rpcCall,signerSlot:a.signerSlot,confirmationConfigOverride:a.confirmationConfigOverride,title:a.title,body:a.body,onEvent:a.onEvent,signingOperationState:n.signingOperationState,signingSessionCoordinator:d.signingSessionCoordinator,selection:{kind:`authorized`,selectedLane:_},transactionOperation:d.transactionOperation,ed25519SigningBoundary:m,yaoSigningPreparation:c.preparation,yaoMaterialExecutor:c.executor,...d.passkeyEd25519OperationStepUp?{passkeyEd25519OperationStepUp:d.passkeyEd25519OperationStepUp}:{},...d.emailOtpEd25519StepUp?{emailOtpEd25519StepUp:d.emailOtpEd25519StepUp}:{}};return G(String(o),`execution_setup`,p),await ho({chain:`near`,kind:`transactionWithActions`,payload:h})}})}catch(r){let o=h.kind===Et.PasskeyReauth||h.kind===Et.EmailOtpReauth,c=xo(r),l=So(r),u=dt(r),d=c?.kind===`step_up_required`;if(!n.retryingFreshAuth&&!o&&m.kind===`authorized`&&(d||l)){if(l?.kind===`wait_and_retry_admission`)return await ct(l.retryAfterMs),await as(e,t,{forceFreshAuth:!1,signingOperationState:n.signingOperationState,retryingFreshAuth:n.retryingFreshAuth,signingSessionCoordinator:s});if(await Co({failure:u,coordinator:s,lane:f.transactionLane,expiresAtMs:m.authorization.status.expiresAtMs}),_.auth.kind===`voiceid`)throw Error(`Unlock with VoiceID again to renew the NEAR Wallet Session.`);let r=_.auth.kind===`email_otp`,o=c?.kind===`step_up_required`?c.reason:void 0,d=l?l.reason===`stale_projection`?`wallet_signing_budget_stale_projection`:`wallet_signing_budget_exhausted`:o===`wallet_session_missing`?`threshold_session_missing`:`threshold_session_expired`;if(ko(a.onEvent,i,{phase:r?z.STEP_06_AUTH_EMAIL_OTP_CHALLENGE_STARTED:z.STEP_09_THRESHOLD_SESSION_RECONNECT_STARTED,status:`running`,message:r?`Signing session needs reauthorization; requesting Email OTP`:`Signing session needs reauthorization; requesting passkey`,interaction:{kind:`none`,overlay:`none`},data:{chain:`near`,reason:d}}),l?.kind===`request_fresh_step_up`){let r=Vo({walletId:t.commandSubject.walletSession.walletId,nearAccountId:i,prepared:f});return await s.runWalletSessionQuotaAdmissionRetry({queueKey:r,refresh:async()=>await as(e,t,{forceFreshAuth:!0,signingOperationState:n.signingOperationState,retryingFreshAuth:!0,signingSessionCoordinator:s}),retryAfterRefresh:async()=>await as(e,t,{forceFreshAuth:!1,signingOperationState:n.signingOperationState,retryingFreshAuth:n.retryingFreshAuth,signingSessionCoordinator:s})})}return await as(e,t,{forceFreshAuth:!0,signingOperationState:n.signingOperationState,retryingFreshAuth:!0,signingSessionCoordinator:s})}throw r}}async function os(e){return await ho({chain:`near`,kind:`delegateAction`,payload:{ctx:e.deps.getSignerWorkerContext(),commandSubject:e.input.commandSubject,nearAccount:e.input.commandSubject.nearAccount,delegate:e.input.delegate,rpcCall:e.normalizedRpcCall,signingSessionCoordinator:e.deps.signingSessionCoordinator,signerSlot:e.input.signerSlot,confirmationConfigOverride:e.input.confirmationConfigOverride,title:e.input.title,body:e.input.body,onEvent:e.input.onEvent,operationId:e.operationId,forceFreshAuth:e.prepared.forceFreshAuth,selection:e.prepared.kind===`authorized`?{kind:`authorized`,selectedLane:e.prepared.selectedLane}:{kind:`authorization_required`,candidate:e.prepared.candidate},passkeyEd25519OperationStepUp:e.prepared.passkeyEd25519OperationStepUp,emailOtpEd25519StepUp:e.prepared.emailOtpEd25519StepUp,yaoSigningPreparation:e.prepared.yaoSigningPreparation,yaoMaterialExecutor:e.prepared.yaoMaterialExecutor}})}async function ss(e){let t=I(e.input.commandSubject.nearAccount.accountId),n=await qo({deps:e.deps,commandSubject:e.input.commandSubject,signerSlot:e.input.signerSlot,operationId:e.operationId,onEvent:e.input.onEvent,attempt:e.attempt}),r={nearRpcUrl:e.input.rpcCall.nearRpcUrl||e.deps.nearRpcUrl,nearAccountId:t};try{return await Jo({deps:e.deps,nearAccountId:t,materialActivation:Xo(n.yaoSigningPreparation),task:os.bind(void 0,{deps:e.deps,input:e.input,operationId:e.operationId,prepared:n,normalizedRpcCall:r})})}catch(r){let i=xo(r),a=So(r);if(e.attempt.kind===`initial`&&a){if(a.kind===`wait_and_retry_admission`)return await ct(a.retryAfterMs),await ss(e);let r=Ho({walletId:e.input.commandSubject.walletSession.walletId,nearAccountId:t,prepared:n});return await e.deps.signingSessionCoordinator.runWalletSessionQuotaAdmissionRetry({queueKey:r,refresh:async()=>await ss({...e,attempt:{kind:`fresh_auth_retry`,forceFreshAuth:!0}}),retryAfterRefresh:async()=>await ss({...e,attempt:{kind:`initial`,forceFreshAuth:!1}})})}let o=dt(r);if(e.attempt.kind===`initial`&&!n.forceFreshAuth&&i)return await Co({failure:o,coordinator:e.deps.signingSessionCoordinator,lane:n.selectedLane,expiresAtMs:Lo(n.yaoSigningPreparation)}),await ss({deps:e.deps,input:e.input,operationId:e.operationId,attempt:{kind:`fresh_auth_retry`,forceFreshAuth:!0}});throw r}}async function cs(e,t){try{return await ss({deps:e,input:t,operationId:zo(e,`delegate`),attempt:{kind:`initial`,forceFreshAuth:!1}})}catch(e){throw console.error(`[SigningEngine][delegate] failed`,e),e}}async function ls(e){let t=e.input.commandSubject.nearAccount;return await ho({chain:`near`,kind:`nep413`,payload:{ctx:e.deps.getSignerWorkerContext(),commandSubject:e.input.commandSubject,nearAccount:t,signingSessionCoordinator:e.deps.signingSessionCoordinator,onEvent:e.input.onEvent,forceFreshAuth:e.prepared.forceFreshAuth,selection:e.prepared.kind===`authorized`?{kind:`authorized`,selectedLane:e.prepared.selectedLane}:{kind:`authorization_required`,candidate:e.prepared.candidate},passkeyEd25519OperationStepUp:e.prepared.passkeyEd25519OperationStepUp,emailOtpEd25519StepUp:e.prepared.emailOtpEd25519StepUp,yaoSigningPreparation:e.prepared.yaoSigningPreparation,yaoMaterialExecutor:e.prepared.yaoMaterialExecutor,payload:{message:e.input.message,recipient:e.input.recipient,nonce:e.input.nonce,callbackUrl:e.input.callbackUrl,state:e.input.state,accountId:t.accountId,signerSlot:e.input.signerSlot,title:e.input.title,body:e.input.body,confirmationConfigOverride:e.input.confirmationConfigOverride,operationId:e.operationId}}})}async function us(e){let t=I(e.input.commandSubject.nearAccount.accountId),n=await qo({deps:e.deps,commandSubject:e.input.commandSubject,signerSlot:e.input.signerSlot,operationId:e.operationId,onEvent:e.input.onEvent,attempt:e.attempt});try{return await Jo({deps:e.deps,nearAccountId:t,materialActivation:Xo(n.yaoSigningPreparation),task:ls.bind(void 0,{deps:e.deps,input:e.input,operationId:e.operationId,prepared:n})})}catch(t){let r=xo(t),i=dt(t);if(e.attempt.kind===`initial`&&!n.forceFreshAuth&&r!==void 0)return await Co({failure:i,coordinator:e.deps.signingSessionCoordinator,lane:n.selectedLane,expiresAtMs:Lo(n.yaoSigningPreparation)}),await us({deps:e.deps,input:e.input,operationId:e.operationId,attempt:{kind:`fresh_auth_retry`,forceFreshAuth:!0}});throw t}}async function ds(e,t){try{return await us({deps:e,input:t,operationId:zo(e,`nep413`),attempt:{kind:`initial`,forceFreshAuth:!1}})}catch(e){return console.error(`SigningEngine: NEP-413 signing error:`,e),{success:!1,error:e instanceof Error?e.message:String(e||`Unknown error`)}}}function fs(e,t){return{...e,beforeSigning:t}}export{$t as _,ri as a,Fn as c,xn as d,bn as f,tn as g,dn as h,ua as i,Pn as l,cn as m,bo as n,Vn as o,sn as p,Ha as r,Hn as s,wo as t,Cn as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){if(!Number.isFinite(e)||e<=0)return null;let t=Math.round(e);return t>0&&Number.isSafeInteger(t)?t:null}function t(t){let n=e(t.width),r=e(t.height);return n===null||r===null?null:{widthCssPx:n,heightCssPx:r}}function n(e,n){let r=n?.borderBoxSize[0];return t(r?{width:r.inlineSize,height:r.blockSize}:e.getBoundingClientRect())}function r(e,r){if(e.kind===`request_scroll_surface`){let n=e.element.getBoundingClientRect();return t({width:Math.max(e.element.scrollWidth,n.width),height:Math.max(e.element.scrollHeight,n.height)})}return n(e.element,r)}function i(e,t,n){switch(e.kind){case`request_surface`:case`request_scroll_surface`:return{kind:`measured_v1`,requestId:e.requestId,sequence:t,widthCssPx:n.widthCssPx,heightCssPx:n.heightCssPx};case`auth_menu_surface`:return{kind:`measured_auth_menu_v1`,requestId:e.requestId,authMenuSessionId:e.authMenuSessionId,sequence:t,widthCssPx:n.widthCssPx,heightCssPx:n.heightCssPx}}}let a=1;function o(){let e=a;return!Number.isSafeInteger(e)||e<=0?null:(a=e===2**53-1?1/0:e+1,e)}var s=class{observer;latestEntry=null;recentPostTimes=[];warnedAboutStreaming=!1;surfaceHasSettled=!1;animationFrame=null;lastSize=null;disconnected=!1;constructor(e){if(this.options=e,typeof ResizeObserver==`function`){this.observer=new ResizeObserver(this.onResize),this.observer.observe(e.element,{box:`border-box`}),e.kind===`request_scroll_surface`&&e.element.firstElementChild&&this.observer.observe(e.element.firstElementChild),this.reportLatestSize();return}this.observer=null,this.reportLatestSize()}disconnect(){this.disconnected||(this.disconnected=!0,this.observer?.disconnect(),this.animationFrame!==null&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(this.animationFrame),this.animationFrame=null,this.latestEntry=null)}onResize=e=>{this.disconnected||(this.latestEntry=e.at(-1)??null,this.scheduleReport())};scheduleReport(){this.disconnected||(this.animationFrame!==null&&typeof cancelAnimationFrame==`function`&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=null),this.reportLatestSize())}reportLatestSize(){if(this.disconnected)return;let e=r(this.options,this.latestEntry);if(this.latestEntry=null,!e||this.sameSize(e))return;this.lastSize=e;let t=o();if(t===null){this.disconnect();return}this.noteStreaming(),this.options.postMeasurement(i(this.options,t,e))}noteStreaming(){if(this.options.kind===`auth_menu_surface`||this.warnedAboutStreaming)return;let e=typeof performance==`object`?performance.now():Date.now(),t=this.recentPostTimes.at(-1);for(t!==void 0&&e-t>400&&(this.surfaceHasSettled=!0,this.recentPostTimes.length=0),this.recentPostTimes.push(e);this.recentPostTimes.length&&e-this.recentPostTimes[0]>150;)this.recentPostTimes.shift();this.surfaceHasSettled&&(this.recentPostTimes.length<4||(this.warnedAboutStreaming=!0,console.warn(`[SEAMS] ${this.options.kind} posted ${this.recentPostTimes.length} surface measurements in 150ms after it had settled. Content inside a measured surface must announce a height change once (announceSurfaceResize) instead of animating its own height; the host box cannot follow a moving target.`)))}sameSize(e){return this.lastSize?.widthCssPx===e.widthCssPx&&this.lastSize?.heightCssPx===e.heightCssPx}};function c(e){return new s(e)}export{c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./prfCache-Ck1mh5YB.js";function t(t){return{hydrateSigningSession:n=>e(t.getWarmSessionMaterialWriter(),n)}}export{t as createWarmSessionHydrationService};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,l as t,n,r,t as i}from"./csp-stylesheet-CHtV6HyK.js";var a,o,s,c,l=0,u=[],d=t,f=d.__b,p=d.__r,m=d.diffed,h=d.__c,g=d.unmount,_=d.__;function v(e,t){d.__h&&d.__h(o,e,l||t),l=0;var n=o.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function y(e){var t=o.context[e.__c],n=v(a++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(o)),t.props.value):e.__}function b(){for(var e;e=u.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(C),t.__h.some(w),t.__h=[]}catch(n){t.__h=[],d.__e(n,e.__v)}}}d.__b=function(e){o=null,f&&f(e)},d.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_&&_(e,t)},d.__r=function(e){p&&p(e),a=0;var t=(o=e.__c).__H;t&&(s===o?(t.__h=[],o.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(C),t.__h.some(w),t.__h=[],a=0)),s=o},d.diffed=function(e){m&&m(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(u.push(t)!==1&&c===d.requestAnimationFrame||((c=d.requestAnimationFrame)||S)(b)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),s=o=null},d.__c=function(e,t){t.some(function(e){try{e.__h.some(C),e.__h=e.__h.filter(function(e){return!e.__||w(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],d.__e(n,e.__v)}}),h&&h(e,t)},d.unmount=function(e){g&&g(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{C(e)}catch(e){t=e}}),n.__H=void 0,t&&d.__e(t,n.__v))};var x=typeof requestAnimationFrame==`function`;function S(e){var t,n=function(){clearTimeout(r),x&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);x&&(t=requestAnimationFrame(n))}function C(e){var t=o,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),o=t}function w(e){var t=o;e.__c=e.__(),o=t}const T=[[`Verify`,`確認`],[`block {value0}`,`ブロック {value0}`],[`active`,`有効`],[`provisioning`,`設定中`],[`suspended`,`一時停止中`],[`expired`,`期限切れ`],[`revoked`,`削除済み`],[`Today, 09:41`,`今日 09:41`],[`Wallet`,`ウォレット`],[`Passkey authentication`,`パスキー認証`],[`Complete the prompt on your device.`,`デバイスに表示された操作を完了してください。`],[`Google sign-in`,`Google ログイン`],[`Choose your Google account.`,`Google アカウントを選択してください。`],[`Creating passkey wallet…`,`パスキーでウォレットを作成中…`],[`Unlocking wallet…`,`ウォレットのロックを解除中…`],[`Wallet created`,`ウォレットを作成しました`],[`Your wallet is ready on this device.`,`このデバイスでウォレットを利用できます。`],[`You’re in`,`サインインしました`],[`Your wallet is unlocked.`,`ウォレットのロックを解除しました。`],[`Too many attempts. Wait a moment.`,`試行回数が多すぎます。しばらくお待ちください。`],[`Can’t reach Seams right now.`,`現在 Seams に接続できません。`],[`That took too long.`,`時間がかかりすぎたため、操作を終了しました。`],[`Something went wrong.`,`エラーが発生しました。`],[`That recovery code can’t be used. Check the code and try again.`,`このリカバリーコードは使用できません。コードを確認して、もう一度お試しください。`],[`That recovery code has already been used. Use another code.`,`このリカバリーコードは使用済みです。別のコードを使用してください。`],[`Enter a recovery code.`,`リカバリーコードを入力してください。`],[`Google sign-in was cancelled.`,`Google ログインがキャンセルされました。`],[`Google sign-in was cancelled`,`Google ログインがキャンセルされました`],[`Scan and link device`,`スキャンしてデバイスを連携`],[`Scan this code with your other device.`,`別のデバイスでこのコードをスキャンしてください。`],[`Recover wallet`,`ウォレットを復元`],[`Your Google account is ready to unlock your wallet.`,`Google アカウントでウォレットのロックを解除できます。`],[`Your wallet is ready. Unlock it with your passkey.`,`ウォレットの準備ができました。パスキーでロックを解除してください。`],[`Choose how you will sign in to this wallet from now on.`,`今後このウォレットで使用するログイン方法を選択してください。`],[`Enter a recovery code to recover your wallet.`,`リカバリーコードを入力してウォレットを復元してください。`],[`Create new passkey`,`新しいパスキーを作成`],[`Continue with Google`,`Google で続ける`],[`Verify email code`,`メールのコードを確認`],[`Unlock with Google`,`Google でロック解除`],[`Unlock with new passkey`,`新しいパスキーでロック解除`],[`Create a passkey`,`パスキーを作成`],[`Continue`,`続ける`],[`Recovery couldn’t be completed. Try again.`,`復元を完了できませんでした。もう一度お試しください。`],[`A passkey couldn’t be created. Try again.`,`パスキーを作成できませんでした。もう一度お試しください。`],[`Passkey preparation expired. Retry to continue.`,`パスキーの準備が期限切れになりました。もう一度お試しください。`],[`Waiting for Google login…`,`Google ログインを待機中…`],[`Starting Google sign-in`,`Google ログインを開始中`],[`Waiting for Google sign-in`,`Google ログインを待機中`],[`Checking recovery code…`,`リカバリーコードを確認中…`],[`Google sign-in is unavailable. Try again.`,`Google ログインを利用できません。もう一度お試しください。`],[`Verifying email code…`,`メールのコードを確認中…`],[`Creating new passkey…`,`新しいパスキーを作成中…`],[`Finishing recovery…`,`復元を完了中…`],[`Preparing to unlock…`,`ロック解除を準備中…`],[`Your wallet was recovered. Unlock it again to continue.`,`ウォレットを復元しました。再度ロックを解除して続けてください。`],[`Generating QR code...`,`QR コードを生成中…`],[`This linking request expired. Start again to link this device.`,`この連携リクエストは期限切れです。最初からやり直してください。`],[`Go back and unlock the new linked method to finish setup.`,`前の画面に戻り、新しく連携した方法でロックを解除して設定を完了してください。`],[`The other device cancelled this linking request. Go back to try again.`,`別のデバイスが連携をキャンセルしました。前の画面に戻ってもう一度お試しください。`],[`Create a passkey to finish linking this device`,`パスキーを作成してデバイスの連携を完了してください`],[`Waiting for device to scan`,`別のデバイスでのスキャンを待機中`],[`Follow the passkey prompt on your screen`,`画面に表示されたパスキーの操作を完了してください`],[`Sending a new email code`,`新しいメールのコードを送信中`],[`Enter the 6-digit code from your email.`,`メールに記載された6桁のコードを入力してください。`],[`Verifying your email code`,`メールのコードを確認中`],[`Generating another wallet name`,`別のウォレット名を生成中`],[`Creating your wallet`,`ウォレットを作成中`],[`Continue with your passkey`,`パスキーで続ける`],[`Accounts`,`アカウント`],[`View or add accounts`,`アカウントの表示・追加`],[`Add EVM account`,`EVM アカウントを追加`],[`Adding EVM account…`,`EVM アカウントを追加中…`],[`EVM account added.`,`EVM アカウントを追加しました。`],[`Account added. Open this wallet again to finish setup.`,`アカウントを追加しました。このウォレットを開き直して設定を完了してください。`],[`Enable this app’s EVM networks with your passkey.`,`パスキーでこのアプリの EVM ネットワークを有効にします。`],[`Add a passkey in Authentication methods first.`,`先に「認証方法」でパスキーを追加してください。`],[`The account could not be added. Try again.`,`アカウントを追加できませんでした。もう一度お試しください。`],[`View accounts on block explorers`,`ブロックエクスプローラーでアカウントを表示`],[`Export keys`,`鍵をエクスポート`],[`Export wallet signing keys`,`ウォレットの署名鍵をエクスポート`],[`Recovery codes`,`リカバリーコード`],[`Back up wallet recovery codes`,`ウォレットのリカバリーコードを保存`],[`Authentication methods`,`認証方法`],[`Add or remove ways to unlock this device`,`このデバイスのロック解除方法を追加・削除`],[`Scan QR to link a device`,`QR コードをスキャンしてデバイスを連携`],[`Linked devices`,`連携済みデバイス`],[`See devices using this wallet`,`このウォレットを使用するデバイスを表示`],[`Transaction settings`,`トランザクション設定`],[`Customize confirmation behavior`,`確認操作をカスタマイズ`],[`Logged out`,`ログアウト済み`],[`Settings`,`設定`],[`Back`,`戻る`],[`Unlock this wallet with a sibling authentication method first.`,`先に別の認証方法でこのウォレットのロックを解除してください。`],[`Unlock with the sibling authentication method before removing this one.`,`この認証方法を削除する前に、別の認証方法でロックを解除してください。`],[`In use now`,`現在使用中`],[`Finishing setup`,`設定を完了中`],[`Paused`,`一時停止中`],[`Expired`,`期限切れ`],[`Removed`,`削除済み`],[`Email code`,`メールのコード`],[`your email code`,`メールのコード`],[`another sign-in method`,`別のログイン方法`],[`this passkey`,`このパスキー`],[`Synced passkey`,`同期済みパスキー`],[`Passkey`,`パスキー`],[`Try again.`,`もう一度お試しください。`],[`Loading your devices timed out. Try again.`,`デバイスの読み込みが時間切れになりました。もう一度お試しください。`],[`Wallet identity is unavailable. Try again.`,`ウォレット情報を取得できません。もう一度お試しください。`],[`Device details`,`デバイスの詳細`],[`Status`,`状態`],[`Anything listed here can unlock this wallet.`,`ここに表示されるすべてのデバイスで、このウォレットのロックを解除できます。`],[`Checking your devices…`,`デバイスを確認中…`],[`Unable to load your devices:`,`デバイスを読み込めません:`],[`Try again`,`再試行`],[`Try Again`,`再試行`],[`No other devices are using this wallet.`,`このウォレットを使用する別のデバイスはありません。`],[`Remove`,`削除`],[`Keep it`,`削除しない`],[`Yes, remove`,`削除する`],[`Removing…`,`削除中…`],[`Review appearance`,`確認画面の表示`],[`Review before signing`,`署名前に確認`],[`Show the transaction details, then click Continue to sign.`,`トランザクションの詳細を表示し、「続ける」をクリックして署名します。`],[`Passkey authentication starts as soon as the details appear.`,`詳細が表示されると同時にパスキー認証を開始します。`],[`On phones, in Safari and for Email OTP sign-in, the wallet always waits for Continue.`,`スマートフォン、Safari、メールOTPでのサインインでは、常に「続ける」のクリックを待ちます。`],[`Choose where transaction details appear before signing.`,`署名前にトランザクションの詳細を表示する場所を選択してください。`],[`none`,`表示なし`],[`modal`,`モーダル`],[`drawer`,`ドロワー`],[`Modal`,`モーダル`],[`Review the transaction in a centered dialog.`,`画面中央のダイアログでトランザクションを確認します。`],[`Drawer`,`ドロワー`],[`Review the transaction in a slide-out panel.`,`スライド式パネルでトランザクションを確認します。`],[`Unable to refresh your wallet. Try again.`,`ウォレットを更新できません。もう一度お試しください。`],[`Key export is unavailable for this wallet.`,`このウォレットでは鍵をエクスポートできません。`],[`NEAR signer provisioning is still in progress. Try again shortly.`,`NEAR 署名機能を準備中です。しばらくしてからもう一度お試しください。`],[`Ed25519 export requires an active NEAR signer.`,`Ed25519 のエクスポートには有効な NEAR 署名機能が必要です。`],[`User`,`ユーザー`],[`Key export requires an unlocked wallet.`,`鍵をエクスポートするにはウォレットのロックを解除してください。`],[`Owner key export is not available on this device yet`,`このデバイスでは、まだ所有者の鍵をエクスポートできません`],[`Wallet region`,`ウォレットのリージョン`],[`Choose where your wallet runs`,`ウォレットを実行するリージョンを選択`],[`Loading transaction settings…`,`トランザクション設定を読み込み中…`],[`Your addresses across networks.`,`各ネットワークのアドレスです。`],[`Keep a recovery code somewhere safe. Use it to restore access to your wallet.`,`リカバリーコードを安全な場所に保管してください。ウォレットへのアクセスを復元する際に使用します。`],[`Only you should have this code. Anyone with it can start recovering your wallet.`,`このコードを他人に渡さないでください。コードを持つ人は、ウォレットの復元を開始できます。`],[`Opening recovery codes…`,`リカバリーコードを開いています…`],[`View recovery codes`,`リカバリーコードを表示`],[`Scan QR code`,`QR コードをスキャン`],[`Wallet settings`,`ウォレット設定`],[`Unlock your wallet to manage your accounts, security, and devices.`,`ウォレットのロックを解除すると、アカウント、セキュリティ、デバイスを管理できます。`],[`Now`,`現在`],[`Yesterday`,`昨日`],[`Email OTP`,`メールのワンタイムコード`],[`Passkey + Email OTP`,`パスキー + メールのワンタイムコード`],[`Touch ID · This device`,`Touch ID · このデバイス`],[`Export NEAR key`,`NEAR の鍵をエクスポート`],[`Export EVM keys`,`EVM の鍵をエクスポート`],[`Your wallet requires authentication before revealing this signing key.`,`この署名鍵を表示するには認証が必要です。`],[`Key type`,`鍵の種類`],[`Protection`,`保護`],[`Authentication required`,`認証が必要`],[`Active`,`有効`],[`Manage how your devices unlock your wallet.`,`デバイスでウォレットのロックを解除する方法を管理します。`],[`Link a device`,`デバイスを連携`],[`Last used`,`最終使用`],[`Open your wallet on the other device, then scan its pairing code.`,`別のデバイスでウォレットを開き、ペアリングコードをスキャンしてください。`],[`Position the QR code inside the frame.`,`QR コードを枠内に合わせてください。`],[`Your recovery codes`,`リカバリーコード`],[`Save these codes in your password manager or another secure place.`,`パスワードマネージャーなどの安全な場所にコードを保存してください。`],[`Keep your recovery codes somewhere safe. Use a code to restore access to your wallet.`,`リカバリーコードを安全な場所に保管してください。ウォレットへのアクセスを復元する際に使用します。`],[`Keep these codes private. Anyone with a code can start recovering your wallet.`,`コードを他人に渡さないでください。コードを持つ人は、ウォレットの復元を開始できます。`],[`Reveal with passkey`,`パスキーで表示`],[`View on explorer`,`エクスプローラーで表示`],[`This wallet`,`このウォレット`],[`Security & devices`,`セキュリティとデバイス`],[`Close wallet settings`,`ウォレット設定を閉じる`],[`Wallet account`,`ウォレットアカウント`],[`Secured by`,`セキュリティ提供:`],[`Copied all codes.`,`すべてのコードをコピーしました。`],[`Unable to copy. Download the codes instead.`,`コピーできません。コードをダウンロードしてください。`],[`Downloaded all codes.`,`すべてのコードをダウンロードしました。`],[`Unable to download. Copy the codes instead.`,`ダウンロードできません。コードをコピーしてください。`],[`Copy all`,`すべてコピー`],[`Download all`,`すべてダウンロード`],[`Cancel`,`キャンセル`],[`Create your passkey`,`パスキーを作成`],[`Use Touch ID or your device passkey to create credentials for this account.`,`Touch ID またはデバイスのパスキーで、このアカウントの認証情報を作成してください。`],[`Confirm Code`,`コードを確認`],[`Confirm`,`確認`],[`Register with Passkey`,`パスキーで登録`],[`Confirm with Passkey`,`パスキーで確認`],[`Enter email code to sign`,`メールのコードを入力して署名`],[`Review transaction`,`トランザクションを確認`],[`Unknown`,`不明`],[`The operation did not complete.`,`操作を完了できませんでした。`],[`The network reverted this transaction. Network fees may still apply.`,`ネットワークがこのトランザクションを取り消しました。ネットワーク手数料が発生する場合があります。`],[`The network could not execute this transaction. Network fees may still apply.`,`ネットワークがこのトランザクションを実行できませんでした。ネットワーク手数料が発生する場合があります。`],[`Submitted to the network. The response did not include a final execution outcome.`,`ネットワークに送信しました。応答には最終的な実行結果が含まれていません。`],[`The network response did not include an execution status.`,`ネットワークの応答には実行状態が含まれていません。`],[`The transaction did not complete as expected. Check its network status before retrying.`,`トランザクションが正常に完了しませんでした。再試行前にネットワークで状態を確認してください。`],[`Signing transaction`,`トランザクションに署名中`],[`Signature ready`,`署名の準備完了`],[`Broadcasting transaction`,`トランザクションを送信中`],[`Waiting for confirmation`,`承認を待機中`],[`Transaction complete`,`トランザクション完了`],[`Transaction failed`,`トランザクション失敗`],[`Transaction reverted`,`トランザクションが取り消されました`],[`Confirmation unavailable`,`承認状態を取得できません`],[`Preparing your signed transaction.`,`署名済みトランザクションを準備中です。`],[`Signature created, ready to broadcast.`,`署名を作成しました。送信する準備ができました。`],[`Signing message`,`メッセージに署名中`],[`Message signed`,`メッセージに署名しました`],[`Signature failed`,`署名に失敗しました`],[`Preparing your message signature.`,`メッセージへの署名を準備中です。`],[`Signed off-chain. Nothing was sent to the network.`,`オフチェーンで署名しました。ネットワークには何も送信していません。`],[`Submitting your signed transaction to the network.`,`署名済みトランザクションをネットワークに送信中です。`],[`Submitted to the network. Waiting for the receipt.`,`ネットワークに送信しました。レシートを待機中です。`],[`The network confirmed your transaction.`,`ネットワークがトランザクションを承認しました。`],[`Email OTP challenge is missing.`,`メール認証のリクエストが見つかりません。`],[`Sign Delegate Action`,`委任アクションに署名`],[`Demo email code:`,`デモ用メールコード:`],[`Recovery code accepted.`,`リカバリーコードを確認しました。`],[`Wallet recovered. Unlock it to continue.`,`ウォレットを復元しました。ロックを解除して続けてください。`],[`Back to recovery code`,`リカバリーコードに戻る`],[`Back to unlock wallet`,`ウォレットのロック解除に戻る`],[`Already have a wallet?`,`すでにウォレットをお持ちですか?`],[`Unlock wallet`,`ウォレットのロックを解除`],[`Don't have a wallet?`,`ウォレットをお持ちでないですか?`],[`Create a wallet`,`ウォレットを作成`],[`Create wallet with passkey`,`パスキーでウォレットを作成`],[`Unlock with passkey`,`パスキーでロック解除`],[`Saved wallets`,`保存済みウォレット`],[`Generate another name`,`別の名前を生成`],[`Other options`,`その他の方法`],[`Link this device`,`このデバイスを連携`],[`Scan a code with your other device`,`別のデバイスでコードをスキャン`],[`Use your recovery code`,`リカバリーコードを使用`],[`Recovery code`,`リカバリーコード`],[`You can paste the whole code.`,`コード全体を貼り付けできます。`],[`This adds a new sign-in method to your wallet.`,`ウォレットに新しいログイン方法を追加します。`],[`Continue with Google, then verify the code sent to your email.`,`Google で続けてから、メールに届いたコードを確認してください。`],[`Finishing recovery with Google…`,`Google での復元を完了中…`],[`Create a new passkey to finish recovering this wallet.`,`新しいパスキーを作成して、ウォレットの復元を完了してください。`],[`Retry finalization`,`完了処理を再試行`],[`Loading`,`読み込み中`],[`Linking expired`,`連携の有効期限切れ`],[`Linking cancelled`,`連携をキャンセルしました`],[`Return to unlock wallet`,`ウォレットのロック解除に戻る`],[`QR code to link this device`,`このデバイスを連携する QR コード`],[`Preparing a one-time code for your other device.`,`別のデバイス用のワンタイムコードを準備中です。`],[`Generating QR code`,`QR コードを生成中`],[`Match your other device`,`別のデバイスと同じ方法を選択`],[`Choose the unlock method for Device 2. Email code sends a one-time code to the address you enter.`,`2台目のデバイスのロック解除方法を選択してください。メールのコードを選ぶと、入力したアドレスにワンタイムコードを送信します。`],[`Wallet unlock method`,`ウォレットのロック解除方法`],[`Email address`,`メールアドレス`],[`Email verification code`,`メール認証コード`],[`Send a new code`,`新しいコードを送信`],[`Verifying`,`確認中`],[`Verify code`,`コードを確認`],[`Send another code`,`別のコードを送信`],[`Device linked`,`デバイスを連携しました`],[`Couldn't link device`,`デバイスを連携できませんでした`],[`Unable to open the wallet. Go back and try again.`,`ウォレットを開けません。前の画面に戻ってもう一度お試しください。`],[`Opening linked wallet`,`連携したウォレットを開いています`],[`Waiting for passkey`,`パスキーを待機中`],[`Create passkey`,`パスキーを作成`],[`Unlocking…`,`ロックを解除中…`],[`Sending…`,`送信中…`],[`Resend Code`,`コードを再送信`],[`Generating…`,`生成中…`],[`Creating...`,`作成中…`],[`Sending your code`,`コードを送信中`],[`Emailing a 6-digit code`,`6桁のコードをメールで送信中`],[`Sending a new code`,`新しいコードを送信中`],[`Emailing a fresh 6-digit code`,`新しい6桁のコードをメールで送信中`],[`Checking your code`,`コードを確認中`],[`Verifying the code you entered`,`入力したコードを確認中`],[`Verify your email`,`メールを確認`],[`Enter the 6-digit code we just sent.`,`送信した6桁のコードを入力してください。`],[`That code expired`,`コードの有効期限が切れました`],[`Email code unavailable`,`メールのコードを利用できません`],[`Email verified`,`メールを確認しました`],[`Finishing linking this device`,`デバイスの連携を完了中`],[`Choose the signing key to export. Your wallet will ask you to authenticate.`,`エクスポートする署名鍵を選択してください。ウォレットで認証が必要です。`],[`Keep exported keys private. Anyone with a signing key can control its accounts.`,`エクスポートした鍵を他人に渡さないでください。署名鍵を持つ人は、そのアカウントを操作できます。`],[`Back up your wallet recovery codes`,`ウォレットのリカバリーコードを保存`],[`Choose how you unlock this device`,`このデバイスのロック解除方法を選択`],[`Scan a QR code to link a device`,`QR コードをスキャンしてデバイスを連携`],[`Light mode`,`ライトモード`],[`Dark mode`,`ダークモード`],[`Unable to lock your wallet. Try again.`,`ウォレットをロックできません。もう一度お試しください。`],[`Unlocked on this device`,`このデバイスでロック解除済み`],[`All settings`,`すべての設定`],[`Locking…`,`ロック中…`],[`Lock wallet`,`ウォレットをロック`],[`Lock Wallet`,`ウォレットをロック`],[`This setting is unavailable for the current wallet or device.`,`このウォレットまたはデバイスでは、この設定を利用できません。`],[`Your wallet. Your control.`,`ウォレットの管理は、あなたの手に。`],[`I’ve saved these codes. They won’t be shown again.`,`コードを保存しました。この後は再表示できません。`],[`Done`,`完了`],[`Export NEAR Key`,`NEAR の鍵をエクスポート`],[`Ed25519 signing key`,`Ed25519 署名鍵`],[`Export EVM Keys`,`EVM の鍵をエクスポート`],[`ECDSA threshold key set`,`ECDSA しきい値署名の鍵セット`],[`Preparing export…`,`エクスポートを準備中…`],[`Export key`,`鍵をエクスポート`],[`United States`,`米国`],[`Western Europe`,`西ヨーロッパ`],[`Asia Pacific`,`アジア太平洋`],[`Oceania`,`オセアニア`],[`Your wallet is in the new region.`,`ウォレットは新しいリージョンにあります。`],[`The move needs service recovery. Your wallet data remains preserved. You can lock this wallet while recovery continues.`,`移動にはサービスの復旧が必要です。ウォレットのデータは保持されています。復旧中もウォレットをロックできます。`],[`The service will retry this stage. Closing or locking this wallet does not cancel the move.`,`サービスがこの段階を再試行します。ウォレットを閉じたりロックしたりしても、移動はキャンセルされません。`],[`Preparing your wallet`,`ウォレットを準備中`],[`Transferring wallet data`,`ウォレットのデータを転送中`],[`Checking the new region`,`新しいリージョンを確認中`],[`Activating the new region`,`新しいリージョンを有効化中`],[`The new region is active. Source cleanup continues.`,`新しいリージョンが有効です。移動元のクリーンアップを継続中です。`],[`Checking wallet placement…`,`ウォレットの配置を確認中…`],[`Unable to check wallet placement. Unlock this wallet or reconnect to try again.`,`ウォレットの配置を確認できません。ロックを解除するか、再接続してお試しください。`],[`Reconnecting to check progress. The previous request may have been accepted.`,`進行状況を確認するため再接続しています。前のリクエストは受け付けられた可能性があります。`],[`Unable to check wallet placement. Reconnect to try again.`,`ウォレットの配置を確認できません。再接続してお試しください。`],[`Reconnecting to check progress. Retry this same request to continue.`,`進行状況を確認するため再接続しています。同じリクエストを再試行してください。`],[`Reconnecting to check progress. Unlock this wallet if authentication expired.`,`進行状況を確認するため再接続しています。認証が期限切れの場合は、ウォレットのロックを解除してください。`],[`You can lock this wallet. An accepted move continues on the server.`,`このウォレットをロックできます。受け付けられた移動はサーバーで継続します。`],[`Check again`,`再確認`],[`Retry same move`,`同じ移動を再試行`],[`Your wallet is active in the new region. Another move must wait until cleanup completes.`,`ウォレットは新しいリージョンで有効です。次の移動はクリーンアップ完了後に実行できます。`],[`Signing and wallet changes are paused. Closing or locking this wallet does not cancel the move.`,`署名とウォレットの変更を一時停止しています。ウォレットを閉じたりロックしたりしても、移動はキャンセルされません。`],[`Current region:`,`現在のリージョン:`],[`Destination region`,`移動先リージョン`],[`Moving your wallet ends signing sessions on all devices. After the move, unlock your wallet again to sign.`,`ウォレットを移動すると、すべてのデバイスの署名セッションが終了します。移動後に署名するには、再度ロックを解除してください。`],[`Another move is available after`,`次の移動が可能になる日時:`],[`Move wallet`,`ウォレットを移動`],[`Passkey on this device`,`このデバイスのパスキー`],[`Email OTP on this device`,`このデバイスのメール認証`],[`Checking methods…`,`認証方法を確認中…`],[`Unavailable`,`利用不可`],[`Unlock to manage`,`ロックを解除して管理`],[`Unlock this wallet to manage authentication.`,`認証を管理するには、このウォレットのロックを解除してください。`],[`Enter the email address to verify.`,`確認するメールアドレスを入力してください。`],[`Adding a passkey…`,`パスキーを追加中…`],[`Adding Email OTP…`,`メール認証を追加中…`],[`Passkey added.`,`パスキーを追加しました。`],[`Email OTP added.`,`メール認証を追加しました。`],[`Checking authentication methods…`,`認証方法を確認中…`],[`Unable to load authentication methods:`,`認証方法を読み込めません:`],[`Active authentication methods`,`有効な認証方法`],[`Remove method`,`認証方法を削除`],[`Add another method before removing this one.`,`この方法を削除する前に、別の認証方法を追加してください。`],[`Add a method`,`認証方法を追加`],[`Adding…`,`追加中…`],[`Add passkey`,`パスキーを追加`],[`Use a passkey from this device to unlock the wallet.`,`このデバイスのパスキーでウォレットのロックを解除します。`],[`Add Email OTP`,`メール認証を追加`],[`Add`,`追加`],[`Use a one-time code from your email to unlock the wallet.`,`メールに届くワンタイムコードでウォレットのロックを解除します。`],[`Next, confirm with your passkey. Then enter the code that we email to this address.`,`次にパスキーで確認します。その後、このアドレスに届くコードを入力してください。`],[`Send code`,`コードを送信`],[`Sending code…`,`コードを送信中…`],[`Enter a valid email address.`,`有効なメールアドレスを入力してください。`],[`Codes go to the email address you verified.`,`確認済みのメールアドレスにコードを送信します。`],[`Transfer`,`送金`],[`Warnings`,`警告`],[`No operations`,`操作なし`],[`using args:`,`引数:`],[`by global contract identifier`,`グローバルコントラクト識別子を使用`],[`Stake`,`ステーキング`],[`Full Access`,`フルアクセス`],[`Function Call`,`関数呼び出し`],[`Transactions`,`トランザクション`],[`Transaction`,`トランザクション`],[`Resend code`,`コードを再送信`],[`Enter the 6-digit Email OTP code.`,`メールの6桁のワンタイムコードを入力してください。`],[`Could not send code.`,`コードを送信できませんでした。`],[`Code sent`,`コードを送信しました`],[`Creating passkey`,`パスキーを作成中`],[`Creating passkey...`,`パスキーを作成中…`],[`Loading website`,`ウェブサイトを読み込み中`],[`Loading chain details`,`チェーンの詳細を読み込み中`],[`Exported Keys`,`エクスポートした鍵`],[`Close exported keys`,`エクスポートした鍵を閉じる`],[`Near Account ID`,`NEAR アカウント ID`],[`Preparing private key…`,`秘密鍵を準備中…`],[`No keys available`,`利用可能な鍵がありません`],[`Warning: your private keys grant full control of your account and funds. Keep it in a secret place.`,`警告:秘密鍵を持つ人は、アカウントと資金を完全に操作できます。秘密鍵を他人に知られない場所に保管してください。`],[`Next Steps`,`次の手順`],[`Address`,`アドレス`],[`Public key copied`,`公開鍵をコピーしました`],[`Copy public key`,`公開鍵をコピー`],[`Public Key`,`公開鍵`],[`Private key copied`,`秘密鍵をコピーしました`],[`Copy private key`,`秘密鍵をコピー`],[`Private Key`,`秘密鍵`],[`Decrypting private key`,`秘密鍵を復号中`],[`Private key ready`,`秘密鍵の準備完了`],[`Data`,`データ`],[`Copied`,`コピーしました`],[`Copy`,`コピー`],[`Passkey registration details`,`パスキー登録の詳細`],[`Account`,`アカウント`],[`Website`,`ウェブサイト`],[`Open`,`開く`],[`Close transaction`,`トランザクションを閉じる`],[`Transaction receipt`,`トランザクションのレシート`],[`Minimize transaction`,`トランザクションを最小化`],[`To`,`宛先`],[`Estimated network fee`,`推定ネットワーク手数料`],[`Transaction progress`,`トランザクションの進行状況`],[`Signed`,`署名済み`],[`Signing`,`署名中`],[`Broadcast`,`送信済み`],[`Broadcasting`,`送信中`],[`Reverted`,`取り消し済み`],[`Confirmed`,`承認済み`],[`Confirming`,`承認中`],[`Receipt details`,`レシートの詳細`],[`From`,`送信元`],[`Continue in background`,`バックグラウンドで続ける`],[`View transaction`,`トランザクションを表示`],[`Wallet transaction`,`ウォレットのトランザクション`],[`Copy value`,`値をコピー`],[`Method:`,`メソッド:`],[`Raw data`,`未加工データ`],[`Network`,`ネットワーク`],[`Message details`,`メッセージの詳細`],[`Transaction details`,`トランザクションの詳細`],[`Signing account`,`署名アカウント`],[`Raw payload`,`未加工ペイロード`],[`Dismiss confirmation`,`確認画面を閉じる`],[`Close`,`閉じる`],[`Creating Account`,`アカウントを作成`],[`Deleting Account`,`アカウントを削除`],[`Adding Key`,`鍵を追加`],[`Deleting Key`,`鍵を削除`],[`Deploying WASM contract`,`WASM コントラクトをデプロイ`],[`Use global contract`,`グローバルコントラクトを使用`],[`Transaction to`,`トランザクションの宛先`],[`Calling`,`呼び出し`],[`Use global contract by hash`,`ハッシュでグローバルコントラクトを使用`],[`Backup needed`,`バックアップが必要`],[`Backed up`,`バックアップ済み`],[`No recovery set`,`リカバリーコード未設定`],[`Authorization required`,`認証が必要`],[`Could not load`,`読み込めませんでした`],[`Checking your codes…`,`コードを確認中…`],[`Status unavailable`,`状態を取得できません`],[`Seams wallet recovery codes`,`Seams ウォレットのリカバリーコード`],[`Save these codes somewhere private. Each code can be used once.`,`他人に知られない場所にコードを保存してください。各コードは1回のみ使用できます。`],[`Finish backup`,`バックアップを完了`],[`Back up later`,`後でバックアップ`],[`Could not load recovery-code status`,`リカバリーコードの状態を読み込めませんでした`],[`Recovery codes are no longer available on this device.`,`このデバイスでは、リカバリーコードを表示できなくなりました。`],[`Could not open recovery codes`,`リカバリーコードを開けませんでした`],[`Recovery codes downloaded.`,`リカバリーコードをダウンロードしました。`],[`Unable to download the codes. Copy them or try again.`,`コードをダウンロードできません。コピーするか、もう一度お試しください。`],[`Recovery codes copied.`,`リカバリーコードをコピーしました。`],[`Unable to copy the codes. Download them or try again.`,`コードをコピーできません。ダウンロードするか、もう一度お試しください。`],[`Close recovery codes`,`リカバリーコードを閉じる`],[`Wallet recovery codes`,`ウォレットのリカバリーコード`],[`View and save the recovery codes retained by this wallet after registration.`,`登録後にウォレットが保持するリカバリーコードを表示・保存します。`],[`Security`,`セキュリティ`],[`Opening recovery codes`,`リカバリーコードを開いています`],[`Loading recovery-code status…`,`リカバリーコードの状態を読み込み中…`],[`Retry status`,`状態を再取得`],[`Each code can recover your wallet once. Save them now, or back them up later from Recovery Codes.`,`各コードでウォレットを1回復元できます。今すぐ保存するか、後で「リカバリーコード」から保存してください。`],[`Each code can recover your wallet once. Keep them somewhere private.`,`各コードでウォレットを1回復元できます。他人に知られない場所に保管してください。`],[`Save your recovery codes`,`リカバリーコードを保存`],[`{value0} single-use codes`,`1回限りのコード:{value0}個`],[`Download codes`,`コードをダウンロード`],[`Copy codes`,`コードをコピー`],[`I saved these recovery codes somewhere safe.`,`リカバリーコードを安全な場所に保存しました。`],[`They won’t be shown again after you finish.`,`完了後は再表示できません。`],[`Back to review`,`確認画面に戻る`],[`NEAR account`,`NEAR アカウント`],[`needs funding`,`への入金が必要です`],[`Too many requests. Try again shortly.`,`リクエストが多すぎます。しばらくしてからもう一度お試しください。`],[`Device linking expired`,`デバイス連携の有効期限が切れました`],[`Device linking was cancelled`,`デバイス連携がキャンセルされました`],[`Unable to scan a QR code`,`QR コードをスキャンできません`],[`Choose an Email OTP method`,`メール認証の方法を選択`],[`Select the masked address to authorize this linked device.`,`一部を伏せたアドレスを選択して、連携するデバイスを認証してください。`],[`Available methods`,`利用可能な方法`],[`Authorizing`,`認証中`],[`Close scanner`,`スキャナーを閉じる`],[`Scan and link a device`,`スキャンしてデバイスを連携`],[`This linking request expired. Scan the QR code again to retry.`,`この連携リクエストは期限切れです。QR コードを再度スキャンしてください。`],[`Linking device`,`デバイスを連携中`],[`Continue linking on your other device.`,`別のデバイスで連携を続けてください。`],[`Cancel linking`,`連携をキャンセル`],[`Position the QR code within the frame`,`QR コードを枠内に合わせてください`],[`Device linking failed`,`デバイスの連携に失敗しました`],[`The address is normalized before the QR code is created.`,`QR コードの作成前に、アドレスの表記を統一します。`],[`Device 2 will create a new passkey for this wallet.`,`2台目のデバイスで、このウォレット用の新しいパスキーを作成します。`],[`Device Linking QR Code`,`デバイス連携用 QR コード`],[`Scan and Link Device`,`スキャンしてデバイスを連携`],[`Scan to backup your other device.`,`スキャンして別のデバイスをバックアップしてください。`],[`Confirm on this device to finish linking it to your wallet.`,`このデバイスで確認し、ウォレットとの連携を完了してください。`],[`Creating passkey…`,`パスキーを作成中…`],[`Enter the 6-digit email code.`,`メールの6桁のコードを入力してください。`],[`Confirm with an email code`,`メールのコードで確認`],[`Use the code sent to`,`コードの送信先:`],[`Sending your email code…`,`メールのコードを送信中…`],[`Sending a new email code…`,`新しいメールのコードを送信中…`],[`Email code accepted. Finishing device activation…`,`メールのコードを確認しました。デバイスの有効化を完了中…`],[`Checking code…`,`コードを確認中…`],[`Confirm code`,`コードを確認`],[`Trying again…`,`再試行中…`],[`Send code again`,`コードを再送信`],[`Choose another factor`,`別の認証方法を選択`],[`Welcome back`,`おかえりなさい`],[`Wallet name`,`ウォレット名`],[`Sign in`,`ログイン`],[`Use your passkey to continue.`,`パスキーで続けてください。`],[`Continue with passkey`,`パスキーで続ける`],[`Close authentication menu`,`認証メニューを閉じる`],[`Passkey name`,`パスキー名`],[`Use a passkey to create your wallet.`,`パスキーでウォレットを作成します。`],[`Restore access to your wallet.`,`ウォレットへのアクセスを復元します。`],[`Preparing a one-time code…`,`ワンタイムコードを準備中…`],[`Create a passkey on this device.`,`このデバイスでパスキーを作成してください。`],[`Creating your passkey…`,`パスキーを作成中…`],[`This code has expired.`,`コードの有効期限が切れました。`],[`Device linking was cancelled.`,`デバイス連携がキャンセルされました。`],[`Unable to link this device.`,`このデバイスを連携できません。`],[`Switch to light mode`,`ライトモードに切り替え`],[`Switch to dark mode`,`ダークモードに切り替え`],[`Copy recipient address {value}`,`送信先アドレス {value} をコピー`],[`Copy signing account address {value}`,`署名アカウントのアドレス {value} をコピー`],[`Copy contract address {value}`,`コントラクトアドレス {value} をコピー`],[`Use the code already sent to {value}.`,`{value} に送信済みのコードを使用してください。`],[`A 6-digit code was sent to {value}.`,`{value} に6桁のコードを送信しました。`],[`Loading...`,`読み込み中…`],[`Scanning...`,`スキャン中…`],[`with`,`金額:`],[`using`,`使用量:`],[`(recommended)`,`(推奨)`],[`. The destination is managed by your wallet and cannot be changed here.`,`。送信先はウォレットが管理しており、ここでは変更できません。`],[`? It will lose access right away.`,`を削除しますか?このデバイスは直ちにアクセスできなくなります。`],[`from this device? You will need the other active method to unlock it.`,`をこのデバイスから削除しますか?ロック解除には別の有効な認証方法が必要です。`],[`Enter all {value0} characters of the recovery code.`,`リカバリーコードを{value0}文字すべて入力してください。`],[`{value0} days ago`,`{value0}日前`],[`Device {value0}`,`デバイス {value0}`],[`Added {value0}`,`追加日:{value0}`],[`Last used {value0}`,`最終使用:{value0}`],[`your "{value0}" passkey`,`「{value0}」のパスキー`],[`You're signed in with {value0}. To remove it, sign in with {value1} first.`,`{value0}でログインしています。削除するには、先に{value1}でログインしてください。`],[`Device {value0}, {value1} (ID {value2})`,`デバイス {value0}、{value1}(ID {value2})`],[`Removing {value0}…`,`{value0}を削除中…`],[`{value0} can no longer use this wallet.`,`{value0}は、このウォレットを使用できなくなりました。`],[`Remove {value0}`,`{value0}を削除`],[`NEAR signer provisioning must be retried ({value0}).`,`NEAR 署名機能の準備を再試行してください({value0})。`],[`Recovery code {value0}`,`リカバリーコード {value0}`],[`Saved wallets. Selected wallet ID {value0}, email {value1}`,`保存済みウォレット。選択中のウォレット ID:{value0}、メール:{value1}`],[`Saved wallets. Selected {value0}`,`保存済みウォレット。選択中:{value0}`],[`Recovery codes don’t use {value0}.`,`リカバリーコードに{value0}は使用できません。`],[`WASM contract code size: {value0}`,`WASM コントラクトのコードサイズ:{value0}`],[`WASM global contract code size: {value0}`,`WASM グローバルコントラクトのコードサイズ:{value0}`],[`sending balance to: {value0}`,`残高の送信先:{value0}`],[`Calling {value0} using {value1}`,`{value0}を呼び出し、使用量:{value1}`],[`Resend in {value0}s`,`{value0}秒後に再送信`],[`Too many requests. Try again in {value0}s.`,`リクエストが多すぎます。{value0}秒後にもう一度お試しください。`],[`Copy {value0}`,`{value0}をコピー`],[`Copy NEAR account {value0}`,`NEAR アカウント {value0} をコピー`],[`Calling {value0} with {value1} using {value2}`,`{value0}を呼び出し、金額:{value1}、使用量:{value2}`],[`Transfer {value0}`,`{value0}を送金`],[`Staking {value0}`,`{value0}をステーキング`],[`Deploy global WASM contract (mode: {value0}, size {value1})`,`グローバル WASM コントラクトをデプロイ(モード:{value0}、サイズ:{value1})`],[`Use global contract by account {value0}`,`アカウント {value0} のグローバルコントラクトを使用`],[`Use global contract by hash {value0}`,`ハッシュ {value0} のグローバルコントラクトを使用`],[`Deploying WASM contract ({value0})`,`WASM コントラクトをデプロイ({value0})`],[`{value0} of {value1} codes left`,`コード残数:{value0}/{value1}`],[`Copy signer address {value0}`,`署名者のアドレス {value0} をコピー`],[`Show {value0}`,`{value0}を表示`],[`Camera {value0}...`,`カメラ {value0}…`],[`Remove {value0}? It will lose access right away.`,`{value0}を削除しますか?このデバイスは直ちにアクセスできなくなります。`],[`Remove {value0} from this device? You will need the other active method to unlock it.`,`このデバイスから{value0}を削除しますか?ロック解除には別の有効な認証方法が必要です。`],[`today`,`今日`],[`yesterday`,`昨日`],[`Message`,`メッセージ`],[`Signer`,`署名者`],[`Recipient`,`受信者`],[`Receiver`,`受信者`],[`Method`,`メソッド`],[`Value (wei)`,`金額(wei)`],[`Action Count`,`アクション数`],[`Amount (yoctoNEAR)`,`金額(yoctoNEAR)`],[`Beneficiary`,`残高の受取先`],[`By Account`,`アカウントで指定`],[`By Code Hash`,`コードハッシュで指定`],[`Code Bytes`,`コードサイズ(バイト)`],[`Deploy Mode`,`デプロイモード`],[`Deposit (yoctoNEAR)`,`付随する金額(yoctoNEAR)`],[`Gas`,`ガス`],[`Permission`,`権限`],[`Stake (yoctoNEAR)`,`ステーキング額(yoctoNEAR)`],[`Validator Key`,`バリデーターの鍵`],[`Valid After`,`有効期間の開始`],[`Valid Before`,`有効期間の終了`],[`EVM Transaction`,`EVM トランザクション`],[`NEAR Transaction`,`NEAR トランザクション`],[`Tempo Transaction`,`Tempo トランザクション`],[`Message signature`,`メッセージへの署名`],[`NEP-413 message`,`NEP-413 メッセージ`],[`Contract Call`,`コントラクト呼び出し`],[`Unsupported EVM Payload`,`未対応の EVM ペイロード`],[`Unsupported Tempo Payload`,`未対応の Tempo ペイロード`],[`Tempo Payload Missing Calls`,`Tempo ペイロードに呼び出しがありません`],[`Function Arguments`,`関数の引数`],[`Signed Delegate Payload`,`署名済み委任ペイロード`],[`Enter the 6-digit code sent to {value0}`,`{value0} に送信した6桁のコードを入力してください`],[`Transaction {value0}`,`トランザクション {value0}`],[`Transaction {value0}: to`,`トランザクション {value0} の宛先:`],[`Transaction to contract`,`コントラクトへのトランザクション`],[`Transaction {value0} to contract`,`コントラクトへのトランザクション {value0}`],[`Action {value0}: CreateAccount`,`アクション {value0}:アカウント作成`],[`Action {value0}: Transfer`,`アクション {value0}:送金`],[`Action {value0}: FunctionCall`,`アクション {value0}:関数呼び出し`],[`Action {value0}: Stake`,`アクション {value0}:ステーキング`],[`Action {value0}: AddKey`,`アクション {value0}:鍵の追加`],[`Action {value0}: DeleteKey`,`アクション {value0}:鍵の削除`],[`Action {value0}: DeployContract`,`アクション {value0}:コントラクトのデプロイ`],[`Action {value0}: DeployGlobalContract`,`アクション {value0}:グローバルコントラクトのデプロイ`],[`Action {value0}: UseGlobalContract`,`アクション {value0}:グローバルコントラクトの使用`],[`Action {value0}: DeleteAccount`,`アクション {value0}:アカウント削除`],[`Action {value0}: SignedDelegate`,`アクション {value0}:署名済み委任`],[`Action {value0}: Unsupported`,`アクション {value0}:未対応の操作`],[`mode: {value0}`,`モード:{value0}`],[`by account: {value0}`,`アカウント:{value0}`],[`by hash: {value0}`,`ハッシュ:{value0}`],[`validator: {value0}`,`バリデーター:{value0}`],[`key: {value0}`,`鍵:{value0}`],[`permissions: {value0}`,`権限:{value0}`],[`Your email`,`メールアドレス`],[`your email`,`メールアドレス`],[`Create your wallet`,`ウォレットを作成`],[`Continue with your Google account.`,`Google アカウントで続けてください。`],[`Create wallet`,`ウォレットを作成`],[`Check this recovery code and try again.`,`リカバリーコードを確認して、もう一度お試しください。`]];function E([e,t]){return[e,{en:e,ja:t}]}const D=new Map(T.map(E));function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function k([e,t]){let n=[],r=[],i=0;for(let t of e.matchAll(/\{(\w+)\}/g))r.push(O(e.slice(i,t.index)),`(.+?)`),n.push(t[1]),i=t.index+t[0].length;return r.push(O(e.slice(i))),{expression:RegExp(`^`+r.join(``)+`$`,`s`),parameters:n,japanese:t}}function A(e){return e[0].includes(`{`)}function j(e,t){return t[0].length-e[0].length}const M=T.filter(A).sort(j).map(k);function N(e,t,n={}){let r=D.get(t);if(!r)throw Error(`Unknown wallet message`);let i=r[e];for(let[e,t]of Object.entries(n))i=i.split(`{`+e+`}`).join(String(t));return i}function P(e,t){if(typeof t!=`string`||e===`en`)return t;let n=t.trim(),r=D.get(n);if(r)return r[e];let i=n.endsWith(`:`)?D.get(n.slice(0,-1)):void 0;if(i)return i[e]+`:`;for(let e of M){let t=e.expression.exec(n);if(!t)continue;let r=e.japanese;for(let[n,i]of e.parameters.entries())r=r.split(`{`+i+`}`).join(t[n+1]);return r}return t}const F=e(`en`);function I(){return y(F)}function L(e,t){return r(F.Provider,{value:e,children:t})}function R(e){let t=I();return e.message===void 0?P(t,e.copy):N(t,e.message,e.values)}const z=new WeakMap;function B(e){let t=z.get(e);return t||(t=i({doc:e,baseCss:``,dynamicStyleDataAttr:`data-seams-confirmation-dynamic`,nonce:n}),z.set(e,t)),t}function V(e){let t=e.trim();if(t)return/^[A-Za-z][A-Za-z0-9_-]*$/.test(t)?t:void 0}function H(e){let t=e.trim();if(!(!t||t.length>1024)&&!/[{};\n\r]/.test(t))return t}function U(e){let t={};for(let n of[`colors`,`shape`])for(let[r,i]of Object.entries(e?.theme[n]??{})){if(typeof i!=`string`)continue;let e=V(r);if(!e)continue;let a=H(i);a&&(t[`--seams-${n}-${e}`]=`${a} !important`)}return t}function W(e,t){return`:where(#${e}){${Object.entries(U(t)).map(([e,t])=>`${e}:${t};`).join(``)}}`}export{I as a,N as c,R as i,B as n,L as o,F as r,P as s,W as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./digests-BIaE0DMd.js";function t(t){if(!Array.isArray(t))throw Error(`authMethods must be an array of wallet auth method plugins.`);let n=[],r=new Set;for(let i of t){if(!e(i)||Object.keys(i).length!==1||i.kind!==`voiceid`||r.has(i.kind))throw Error(`Unsupported or duplicate wallet auth method plugin.`);r.add(i.kind),n.push({kind:`voiceid`})}return n}function n(e,t){for(let n of e)if(n.kind===t)return!0;return!1}function r(e){return typeof e==`string`&&e.trim().toLowerCase().split(/[-_]/,1)[0]===`ja`?`ja`:`en`}const i={targetDepth:{min:1,max:64},maxRefillInFlight:{min:1,max:8},refillAttemptTimeoutMs:{min:5e3,max:12e4}};export{n as i,r as n,t as r,i as t};
|