@seams/wallet 0.24.0 → 0.26.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.
Files changed (497) hide show
  1. package/dist/.build-inputs.sha256 +1 -1
  2. package/dist/esm/SeamsWeb/operations/tempo/executeEvmFamilyTransaction.js +1 -0
  3. package/dist/esm/SeamsWeb/walletIframe/client/evmFamilyCommands.js +1 -0
  4. package/dist/esm/SeamsWeb/walletIframe/client/overlay/overlay-styles.js +73 -39
  5. package/dist/esm/SeamsWeb/walletIframe/client/router.js +5 -1
  6. package/dist/esm/SeamsWeb/walletIframe/host/auth-menu/domain.js +1 -0
  7. package/dist/esm/core/indexedDB/seamsWalletDB/repositories.js +8 -1
  8. package/dist/esm/core/rpcClients/relayer/walletSessionAuthorizationStatus.js +7 -0
  9. package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonMock.js +5 -7
  10. package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonView.js +21 -5
  11. package/dist/esm/react/components/AccountMenuButton/AccountMenuModal.js +66 -0
  12. package/dist/esm/react/components/AccountMenuButton/AccountsSection.css +18 -11
  13. package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodRow.js +5 -11
  14. package/dist/esm/react/components/AccountMenuButton/ExportKeysSection.css +17 -15
  15. package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.css +156 -106
  16. package/dist/esm/react/components/AccountMenuButton/MenuItem.css +37 -29
  17. package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.css +53 -21
  18. package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.css +124 -82
  19. package/dist/esm/react/components/AccountMenuButton/UserAccountButton.css +45 -27
  20. package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.css +115 -93
  21. package/dist/esm/react/components/AccountMenuButton/Web3AuthProfileButton.css +179 -92
  22. package/dist/esm/react/components/AccountMenuButton/hooks/useProfileState.js +62 -49
  23. package/dist/esm/react/components/AccountMenuButton/icons/HoverArrowIcon.css +12 -12
  24. package/dist/esm/react/components/AccountMenuButton/icons/HoverArrowIcon.js +9 -1
  25. package/dist/esm/react/components/AccountMenuButton/icons/Icon.css +10 -0
  26. package/dist/esm/react/components/AccountMenuButton/icons/LogOutIcon2.js +15 -16
  27. package/dist/esm/react/components/AccountMenuButton/icons/SpinnerIcon.js +12 -18
  28. package/dist/esm/react/components/AccountMenuButton/icons/TouchIcon.css +3 -3
  29. package/dist/esm/react/components/AccountMenuButton/icons/TouchIcon.js +11 -5
  30. package/dist/esm/react/components/AccountMenuButton/icons/lucideIcon.js +20 -6
  31. package/dist/esm/react/components/AccountMenuButton/index.js +18 -42
  32. package/dist/esm/react/components/FingerprintIcon.js +13 -19
  33. package/dist/esm/react/components/HostedSeamsAuthMenu/SeamsAuthMenuMock.js +13 -2
  34. package/dist/esm/react/components/HostedSeamsAuthMenu/shell.js +7 -1
  35. package/dist/esm/react/components/QRCodeIcon.js +37 -43
  36. package/dist/esm/react/components/QRCodeScanner.css +65 -60
  37. package/dist/esm/react/components/ShowQRCode.css +145 -40
  38. package/dist/esm/react/components/ShowQRCode.js +27 -37
  39. package/dist/esm/react/components/theme/Theme.css +67 -0
  40. package/dist/esm/react/components/theme/ThemeProvider.js +6 -6
  41. package/dist/esm/react/externalEvm.js +11 -4
  42. package/dist/esm/react/externalNear.js +13 -4
  43. package/dist/esm/react/externalWalletPicker.css +117 -0
  44. package/dist/esm/react/index.js +1 -1
  45. package/dist/esm/react/styles/styles.css +1941 -550
  46. package/dist/esm/react/styles.css +6 -1
  47. package/dist/esm/react/transactionReview/TransactionReviewHost.js +3 -0
  48. package/dist/esm/sdk/{ConfirmationDrawer-CTaGM1AE.js → ConfirmationDrawer-BmzikAr4.js} +1 -1
  49. package/dist/esm/sdk/NonceCoordinator-CcD2FqXh.js +1 -0
  50. package/dist/{public/sdk/SeamsWordmark-CFpsGoLw.js → esm/sdk/SeamsWordmark-DqiC9-sd.js} +1 -1
  51. package/dist/esm/sdk/accountLifecycle-gm9X8nGm.js +1 -0
  52. package/dist/esm/sdk/actions-BIdcxldy.js +1 -0
  53. package/dist/esm/sdk/activeWalletSession-BJ4B-nJo.js +1 -0
  54. package/dist/esm/sdk/adapters-e7twFGov.js +1 -0
  55. package/dist/esm/sdk/appearance-CAIe7Qed.js +1 -0
  56. package/dist/{public/sdk/appearance-token-vars-CgYTfCKg.js → esm/sdk/appearance-token-vars-EYbmnHsJ.js} +1 -1
  57. package/dist/esm/sdk/canonicalPrimitives-Jd3i_Ngz.js +1 -0
  58. package/dist/esm/sdk/chains-B72I4PDH.js +1 -0
  59. package/dist/esm/sdk/challengeDelivery-DWix1oso.js +1 -0
  60. package/dist/esm/sdk/clientSessionPersistenceState-YvVHKRoe.js +1 -0
  61. package/dist/esm/sdk/{collectAuthenticationCredentialForChallengeB64u-kLIxmw3V.js → collectAuthenticationCredentialForChallengeB64u-DEtxiKND.js} +1 -1
  62. package/dist/esm/sdk/{commitQueue-Bs23Rs57.js → commitQueue-CHJ7MHSI.js} +1 -1
  63. package/dist/esm/sdk/configBuilder-CSwJrmcR.js +1 -0
  64. package/dist/esm/sdk/configuration-DBEc3bsj.js +1 -0
  65. package/dist/esm/sdk/confirm-ui-BpqwuMSl.js +2 -0
  66. package/dist/esm/sdk/confirmTypes-DmEPoxys.js +1 -0
  67. package/dist/esm/sdk/device-linking-BsUTtSF7.js +1 -0
  68. package/dist/esm/sdk/deviceLinkApproval-DAZTjrud.js +2 -0
  69. package/dist/esm/sdk/digestEncoding-n8Kr2kow.js +1 -0
  70. package/dist/esm/sdk/{chains-gV2K9gA4.js → digests-BIaE0DMd.js} +1 -1
  71. package/dist/esm/sdk/{display-BXjW58UF.js → display-BYzolrBs.js} +1 -1
  72. package/dist/esm/sdk/ecdsaCapabilityManifest-CXVq8Qzb.js +1 -0
  73. package/dist/esm/sdk/{ecdsaChainTarget-DbLthshF.js → ecdsaChainTarget-Lh24LLyA.js} +1 -1
  74. package/dist/esm/sdk/ecdsaDerivationClientWasm-CVahDxLy.js +1 -0
  75. package/dist/esm/sdk/ecdsaDerivationExport-CkmSe0ao.js +1 -0
  76. package/dist/esm/sdk/{ecdsaWalletRecords-BgcXXCZy.js → ecdsaWalletRecords-zRvHKRTe.js} +1 -1
  77. package/dist/esm/sdk/emailOtpEcdsaDerivationIdentity-0DIuRNRi.js +1 -0
  78. package/dist/esm/sdk/{enrichDisplayModelWithAbi-CudPUW0T.js → enrichDisplayModelWithAbi-CLn37drs.js} +1 -1
  79. package/dist/esm/sdk/errors-DLUmUo9m.js +1 -0
  80. package/dist/esm/sdk/{evmCryptoWasm-DacbCVNM.js → evmCryptoWasm-B_p82tx9.js} +1 -1
  81. package/dist/esm/sdk/{export-viewer-host-DsWOvc0t.js → export-viewer-host-3fosWJXJ.js} +1 -1
  82. package/dist/esm/sdk/exportKeypairOperation-pKQW5J7m.js +1 -0
  83. package/dist/esm/sdk/helpers-dZehRP4i.js +1 -0
  84. package/dist/esm/sdk/host-aTcpYE27.js +1 -0
  85. package/dist/esm/sdk/icons-DDRXJ2W1.js +1 -0
  86. package/dist/esm/sdk/indexedDB-CWFDCCbP.js +1 -0
  87. package/dist/esm/sdk/intentDigest-B6EshTea.js +1 -0
  88. package/dist/esm/sdk/keyMaterialEnvelope-BsdlckmN.js +1 -0
  89. package/dist/esm/sdk/{lanes-C7OvAK_L.js → lanes-C2sAP08w.js} +1 -1
  90. package/dist/esm/sdk/localOnly-Jw9v9GU9.js +1 -0
  91. package/dist/{public/sdk/mountExportPrivateKeySurface-CV1KrFWg.js → esm/sdk/mountExportPrivateKeySurface-B_052qyI.js} +1 -1
  92. package/dist/esm/sdk/{mountRecoveryCodeBackupSurface-CVXU1zzl.js → mountRecoveryCodeBackupSurface-PutmFjf9.js} +1 -1
  93. package/dist/esm/sdk/nearEd25519YaoMaterialActivation-C2QNLImD.js +1 -0
  94. package/dist/esm/sdk/nearEd25519YaoSigningPreparation-K6n4Sq8_.js +1 -0
  95. package/dist/esm/sdk/{nonceLaneKeys-BS4fek17.js → nonceLaneKeys-CZjeiii7.js} +1 -1
  96. package/dist/esm/sdk/{normalization-BN-2VWZf.js → normalization-DA6o5MsH.js} +1 -1
  97. package/dist/esm/sdk/operationFingerprint-DgpQfpM-.js +1 -0
  98. package/dist/esm/sdk/participants-BXdREC5k.js +1 -0
  99. package/dist/{public/sdk/pendingWalletRecoveryCodeBackup-lr1oISjL.js → esm/sdk/pendingWalletRecoveryCodeBackup-B-n7vmBS.js} +1 -1
  100. package/dist/esm/sdk/presignaturePool-DjTaB0nx.js +1 -0
  101. package/dist/{public/sdk/presignatures-B9GrGx0L.js → esm/sdk/presignatures-CjcyX_-F.js} +1 -1
  102. package/dist/esm/sdk/recovery-entrypoint-9e3SXU3t.js +1 -0
  103. package/dist/esm/sdk/recoveryAuthorization-CMVdZ5OR.js +1 -0
  104. package/dist/esm/sdk/registration-C988Nwzn.js +1 -0
  105. package/dist/esm/sdk/registration-D4AijOa8.js +1 -0
  106. package/dist/esm/sdk/{registrationAccounts-BHikxS5q.js → registrationAccounts-DI_vcT7G.js} +1 -1
  107. package/dist/esm/sdk/registrationIntent-BVPp0k0k.js +1 -0
  108. package/dist/esm/sdk/registrationSignerPlan-_8gsSjC0.js +1 -0
  109. package/dist/esm/sdk/requireStepUpAuth-DC9LSyRI.js +1 -0
  110. package/dist/esm/sdk/resealedEnvelopeResult-BKATJaqW.js +1 -0
  111. package/dist/esm/sdk/routerAbNormalSigning-Da-uxxle.js +1 -0
  112. package/dist/esm/sdk/runtime-auth-C_Y8gL_n.js +1 -0
  113. package/dist/esm/sdk/runtime-device-link-DtjR-htE.js +1 -0
  114. package/dist/esm/sdk/runtime-ecdsa-tempo-BkUnzoX9.js +1 -0
  115. package/dist/esm/sdk/runtime-email-otp-CaxfpqKI.js +1 -0
  116. package/dist/esm/sdk/runtime-export-Du5ugbzi.js +1 -0
  117. package/dist/esm/sdk/runtime-near-fas7U0MC.js +1 -0
  118. package/dist/esm/sdk/runtime-preferences-7-f34-by.js +1 -0
  119. package/dist/esm/sdk/runtime-recovery-DmY0ZJpf.js +1 -0
  120. package/dist/esm/sdk/runtime-recovery-codes-DKjOU32G.js +1 -0
  121. package/dist/esm/sdk/runtimeContext-DF8MdfXl.js +6 -0
  122. package/dist/esm/sdk/secp256k1--vF2pJgR.js +1 -0
  123. package/dist/esm/sdk/sessionObservationRevision-DKTqqbGf.js +1 -0
  124. package/dist/esm/sdk/signEvmFamily-DeCQOBYN.js +1 -0
  125. package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-BMfC2sc2.js → signEvmFamilyWithUiConfirmForTempo-BIp-MeBV.js} +1 -1
  126. package/dist/esm/sdk/{signEvmWithUiConfirm-BNkupz3z.js → signEvmWithUiConfirm-BdLW7kqJ.js} +1 -1
  127. package/dist/esm/sdk/signNear-DMzOU4dX.js +1 -0
  128. package/dist/esm/sdk/{signatureUses-DrqCoN12.js → signatureUses-0z64Xpdj.js} +1 -1
  129. package/dist/esm/sdk/signerSlot-DgLzb3Ee.js +1 -0
  130. package/dist/esm/sdk/{signingFlow-BVvteILM.js → signingFlow-C7fwkxPx.js} +2 -2
  131. package/dist/esm/sdk/signingQueue-DvHGcaLc.js +1 -0
  132. package/dist/esm/sdk/thresholdEcdsa-CPVZNLEg.js +1 -0
  133. package/dist/esm/sdk/{trace-CGNqO1FV.js → trace-BQv7E-bO.js} +1 -1
  134. package/dist/esm/sdk/{transaction-activity-DPq9RTh5.js → transaction-activity-olcDRay5.js} +1 -1
  135. package/dist/esm/sdk/transactionReview-CGIlI835.js +1 -0
  136. package/dist/esm/sdk/{transactionReviewAdmission--8tDis7M.js → transactionReviewAdmission-DPxuDgkU.js} +1 -1
  137. package/dist/{public/sdk/transactionState-BS1VLT7B.js → esm/sdk/transactionState-C8aYSDRA.js} +1 -1
  138. package/dist/esm/sdk/{types-DdzuHlAQ.js → types-DOToeB6g.js} +1 -1
  139. package/dist/esm/sdk/unlockedEd25519ExportRootCapability-CFmunau5.js +1 -0
  140. package/dist/esm/sdk/voiceid-host.js +1 -1
  141. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  142. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  143. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  144. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  145. package/dist/esm/sdk/wallet-recovery-jyfGoejZ.js +1 -0
  146. package/dist/esm/sdk/walletAuthMethodRecord-Bi78B6Ab.js +1 -0
  147. package/dist/esm/sdk/walletAuthority-DGdC9Glh.js +1 -0
  148. package/dist/esm/sdk/walletCapabilityBindings-BRdFdh3l.js +1 -0
  149. package/dist/esm/sdk/walletCustodyEcdsaContinuity-DdLNQs1M.js +1 -0
  150. package/dist/esm/sdk/walletCustodyOperation-CAnT3Ww-.js +1 -0
  151. package/dist/esm/sdk/walletDbName-Ca0rCq5r.js +1 -0
  152. package/dist/esm/sdk/walletOwnershipGeneration-z9NXOk-b.js +1 -0
  153. package/dist/esm/sdk/walletRecoveryAdminProof-hytB9fXI.js +1 -0
  154. package/dist/esm/sdk/walletRecoveryCommit-sr8-RYvn.js +1 -0
  155. package/dist/esm/sdk/walletRegistrationSetupPrewarm-CEvGKQSg.js +1 -0
  156. package/dist/esm/sdk/{walletSessionAuthorizationProjection-BJgnZaBc.js → walletSessionAuthorizationProjection-CMl69JGe.js} +1 -1
  157. package/dist/esm/sdk/walletSessionAuthorizationStatus-C_q9eiOH.js +1 -0
  158. package/dist/esm/sdk/{walletSessionAuthorizationStore-zkxcMdSp.js → walletSessionAuthorizationStore-BEJyERPZ.js} +1 -1
  159. package/dist/esm/sdk/warmSessionHydration-EstsrMF8.js +1 -0
  160. package/dist/{public/sdk/webauthnP256-BvTL8nq4.js → esm/sdk/webauthnP256-DVlYEUsG.js} +1 -1
  161. package/dist/esm/shared-ts/src/utils/errors.js +7 -2
  162. package/dist/public/headers.manifest.json +1 -1
  163. package/dist/public/sdk/{ConfirmationDrawer-CTaGM1AE.js → ConfirmationDrawer-BmzikAr4.js} +1 -1
  164. package/dist/public/sdk/NonceCoordinator-CcD2FqXh.js +1 -0
  165. package/dist/{esm/sdk/SeamsWordmark-CFpsGoLw.js → public/sdk/SeamsWordmark-DqiC9-sd.js} +1 -1
  166. package/dist/public/sdk/accountLifecycle-gm9X8nGm.js +1 -0
  167. package/dist/public/sdk/actions-BIdcxldy.js +1 -0
  168. package/dist/public/sdk/activeWalletSession-BJ4B-nJo.js +1 -0
  169. package/dist/public/sdk/adapters-e7twFGov.js +1 -0
  170. package/dist/public/sdk/appearance-CAIe7Qed.js +1 -0
  171. package/dist/{esm/sdk/appearance-token-vars-CgYTfCKg.js → public/sdk/appearance-token-vars-EYbmnHsJ.js} +1 -1
  172. package/dist/public/sdk/canonicalPrimitives-Jd3i_Ngz.js +1 -0
  173. package/dist/public/sdk/chains-B72I4PDH.js +1 -0
  174. package/dist/public/sdk/challengeDelivery-DWix1oso.js +1 -0
  175. package/dist/public/sdk/clientSessionPersistenceState-YvVHKRoe.js +1 -0
  176. package/dist/public/sdk/{collectAuthenticationCredentialForChallengeB64u-kLIxmw3V.js → collectAuthenticationCredentialForChallengeB64u-DEtxiKND.js} +1 -1
  177. package/dist/public/sdk/{commitQueue-Bs23Rs57.js → commitQueue-CHJ7MHSI.js} +1 -1
  178. package/dist/public/sdk/configBuilder-CSwJrmcR.js +1 -0
  179. package/dist/public/sdk/configuration-DBEc3bsj.js +1 -0
  180. package/dist/public/sdk/confirm-ui-BpqwuMSl.js +2 -0
  181. package/dist/public/sdk/confirmTypes-DmEPoxys.js +1 -0
  182. package/dist/public/sdk/device-linking-BsUTtSF7.js +1 -0
  183. package/dist/public/sdk/deviceLinkApproval-DAZTjrud.js +2 -0
  184. package/dist/public/sdk/digestEncoding-n8Kr2kow.js +1 -0
  185. package/dist/public/sdk/{chains-gV2K9gA4.js → digests-BIaE0DMd.js} +1 -1
  186. package/dist/public/sdk/{display-BXjW58UF.js → display-BYzolrBs.js} +1 -1
  187. package/dist/public/sdk/ecdsaCapabilityManifest-CXVq8Qzb.js +1 -0
  188. package/dist/public/sdk/{ecdsaChainTarget-DbLthshF.js → ecdsaChainTarget-Lh24LLyA.js} +1 -1
  189. package/dist/public/sdk/ecdsaDerivationClientWasm-CVahDxLy.js +1 -0
  190. package/dist/public/sdk/ecdsaDerivationExport-CkmSe0ao.js +1 -0
  191. package/dist/public/sdk/{ecdsaWalletRecords-BgcXXCZy.js → ecdsaWalletRecords-zRvHKRTe.js} +1 -1
  192. package/dist/public/sdk/emailOtpEcdsaDerivationIdentity-0DIuRNRi.js +1 -0
  193. package/dist/public/sdk/{enrichDisplayModelWithAbi-CudPUW0T.js → enrichDisplayModelWithAbi-CLn37drs.js} +1 -1
  194. package/dist/public/sdk/errors-DLUmUo9m.js +1 -0
  195. package/dist/public/sdk/{evmCryptoWasm-DacbCVNM.js → evmCryptoWasm-B_p82tx9.js} +1 -1
  196. package/dist/public/sdk/{export-viewer-host-DsWOvc0t.js → export-viewer-host-3fosWJXJ.js} +1 -1
  197. package/dist/public/sdk/exportKeypairOperation-pKQW5J7m.js +1 -0
  198. package/dist/public/sdk/helpers-dZehRP4i.js +1 -0
  199. package/dist/public/sdk/host-aTcpYE27.js +1 -0
  200. package/dist/public/sdk/icons-DDRXJ2W1.js +1 -0
  201. package/dist/public/sdk/indexedDB-CWFDCCbP.js +1 -0
  202. package/dist/public/sdk/intentDigest-B6EshTea.js +1 -0
  203. package/dist/public/sdk/keyMaterialEnvelope-BsdlckmN.js +1 -0
  204. package/dist/public/sdk/{lanes-C7OvAK_L.js → lanes-C2sAP08w.js} +1 -1
  205. package/dist/public/sdk/localOnly-Jw9v9GU9.js +1 -0
  206. package/dist/{esm/sdk/mountExportPrivateKeySurface-CV1KrFWg.js → public/sdk/mountExportPrivateKeySurface-B_052qyI.js} +1 -1
  207. package/dist/public/sdk/{mountRecoveryCodeBackupSurface-CVXU1zzl.js → mountRecoveryCodeBackupSurface-PutmFjf9.js} +1 -1
  208. package/dist/public/sdk/nearEd25519YaoMaterialActivation-C2QNLImD.js +1 -0
  209. package/dist/public/sdk/nearEd25519YaoSigningPreparation-K6n4Sq8_.js +1 -0
  210. package/dist/public/sdk/{nonceLaneKeys-BS4fek17.js → nonceLaneKeys-CZjeiii7.js} +1 -1
  211. package/dist/public/sdk/{normalization-BN-2VWZf.js → normalization-DA6o5MsH.js} +1 -1
  212. package/dist/public/sdk/operationFingerprint-DgpQfpM-.js +1 -0
  213. package/dist/public/sdk/participants-BXdREC5k.js +1 -0
  214. package/dist/{esm/sdk/pendingWalletRecoveryCodeBackup-lr1oISjL.js → public/sdk/pendingWalletRecoveryCodeBackup-B-n7vmBS.js} +1 -1
  215. package/dist/public/sdk/presignaturePool-DjTaB0nx.js +1 -0
  216. package/dist/{esm/sdk/presignatures-B9GrGx0L.js → public/sdk/presignatures-CjcyX_-F.js} +1 -1
  217. package/dist/public/sdk/recovery-entrypoint-9e3SXU3t.js +1 -0
  218. package/dist/public/sdk/recoveryAuthorization-CMVdZ5OR.js +1 -0
  219. package/dist/public/sdk/registration-C988Nwzn.js +1 -0
  220. package/dist/public/sdk/registration-D4AijOa8.js +1 -0
  221. package/dist/public/sdk/{registrationAccounts-BHikxS5q.js → registrationAccounts-DI_vcT7G.js} +1 -1
  222. package/dist/public/sdk/registrationIntent-BVPp0k0k.js +1 -0
  223. package/dist/public/sdk/registrationSignerPlan-_8gsSjC0.js +1 -0
  224. package/dist/public/sdk/requireStepUpAuth-DC9LSyRI.js +1 -0
  225. package/dist/public/sdk/resealedEnvelopeResult-BKATJaqW.js +1 -0
  226. package/dist/public/sdk/routerAbNormalSigning-Da-uxxle.js +1 -0
  227. package/dist/public/sdk/runtime-auth-C_Y8gL_n.js +1 -0
  228. package/dist/public/sdk/runtime-device-link-DtjR-htE.js +1 -0
  229. package/dist/public/sdk/runtime-ecdsa-tempo-BkUnzoX9.js +1 -0
  230. package/dist/public/sdk/runtime-email-otp-CaxfpqKI.js +1 -0
  231. package/dist/public/sdk/runtime-export-Du5ugbzi.js +1 -0
  232. package/dist/public/sdk/runtime-near-fas7U0MC.js +1 -0
  233. package/dist/public/sdk/runtime-preferences-7-f34-by.js +1 -0
  234. package/dist/public/sdk/runtime-recovery-DmY0ZJpf.js +1 -0
  235. package/dist/public/sdk/runtime-recovery-codes-DKjOU32G.js +1 -0
  236. package/dist/public/sdk/runtimeContext-DF8MdfXl.js +6 -0
  237. package/dist/public/sdk/secp256k1--vF2pJgR.js +1 -0
  238. package/dist/public/sdk/sessionObservationRevision-DKTqqbGf.js +1 -0
  239. package/dist/public/sdk/signEvmFamily-DeCQOBYN.js +1 -0
  240. package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-BMfC2sc2.js → signEvmFamilyWithUiConfirmForTempo-BIp-MeBV.js} +1 -1
  241. package/dist/public/sdk/{signEvmWithUiConfirm-BNkupz3z.js → signEvmWithUiConfirm-BdLW7kqJ.js} +1 -1
  242. package/dist/public/sdk/signNear-DMzOU4dX.js +1 -0
  243. package/dist/public/sdk/{signatureUses-DrqCoN12.js → signatureUses-0z64Xpdj.js} +1 -1
  244. package/dist/public/sdk/signerSlot-DgLzb3Ee.js +1 -0
  245. package/dist/public/sdk/{signingFlow-BVvteILM.js → signingFlow-C7fwkxPx.js} +2 -2
  246. package/dist/public/sdk/signingQueue-DvHGcaLc.js +1 -0
  247. package/dist/public/sdk/thresholdEcdsa-CPVZNLEg.js +1 -0
  248. package/dist/public/sdk/{trace-CGNqO1FV.js → trace-BQv7E-bO.js} +1 -1
  249. package/dist/public/sdk/{transaction-activity-DPq9RTh5.js → transaction-activity-olcDRay5.js} +1 -1
  250. package/dist/public/sdk/transactionReview-CGIlI835.js +1 -0
  251. package/dist/public/sdk/{transactionReviewAdmission--8tDis7M.js → transactionReviewAdmission-DPxuDgkU.js} +1 -1
  252. package/dist/{esm/sdk/transactionState-BS1VLT7B.js → public/sdk/transactionState-C8aYSDRA.js} +1 -1
  253. package/dist/public/sdk/{types-DdzuHlAQ.js → types-DOToeB6g.js} +1 -1
  254. package/dist/public/sdk/unlockedEd25519ExportRootCapability-CFmunau5.js +1 -0
  255. package/dist/public/sdk/voiceid-host.js +1 -1
  256. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  257. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  258. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  259. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  260. package/dist/public/sdk/wallet-recovery-jyfGoejZ.js +1 -0
  261. package/dist/public/sdk/walletAuthMethodRecord-Bi78B6Ab.js +1 -0
  262. package/dist/public/sdk/walletAuthority-DGdC9Glh.js +1 -0
  263. package/dist/public/sdk/walletCapabilityBindings-BRdFdh3l.js +1 -0
  264. package/dist/public/sdk/walletCustodyEcdsaContinuity-DdLNQs1M.js +1 -0
  265. package/dist/public/sdk/walletCustodyOperation-CAnT3Ww-.js +1 -0
  266. package/dist/public/sdk/walletDbName-Ca0rCq5r.js +1 -0
  267. package/dist/public/sdk/walletOwnershipGeneration-z9NXOk-b.js +1 -0
  268. package/dist/public/sdk/walletRecoveryAdminProof-hytB9fXI.js +1 -0
  269. package/dist/public/sdk/walletRecoveryCommit-sr8-RYvn.js +1 -0
  270. package/dist/public/sdk/walletRegistrationSetupPrewarm-CEvGKQSg.js +1 -0
  271. package/dist/public/sdk/{walletSessionAuthorizationProjection-BJgnZaBc.js → walletSessionAuthorizationProjection-CMl69JGe.js} +1 -1
  272. package/dist/public/sdk/walletSessionAuthorizationStatus-C_q9eiOH.js +1 -0
  273. package/dist/public/sdk/{walletSessionAuthorizationStore-zkxcMdSp.js → walletSessionAuthorizationStore-BEJyERPZ.js} +1 -1
  274. package/dist/public/sdk/warmSessionHydration-EstsrMF8.js +1 -0
  275. package/dist/{esm/sdk/webauthnP256-BvTL8nq4.js → public/sdk/webauthnP256-DVlYEUsG.js} +1 -1
  276. package/dist/public/wallet-assets.manifest.json +450 -258
  277. package/dist/public/wallet-service/index.html +4 -4
  278. package/dist/types/shared-ts/src/utils/errors.d.ts +1 -0
  279. package/dist/types/wallet/src/SeamsWeb/operations/authMethods/passkey/exactPasskeyAuthority.d.ts +24 -0
  280. package/dist/types/wallet/src/SeamsWeb/operations/devices/walletHostOwnerAuthority.d.ts +2 -0
  281. package/dist/types/wallet/src/SeamsWeb/publicApi/types.d.ts +3 -0
  282. package/dist/types/wallet/src/SeamsWeb/walletIframe/client/router.d.ts +2 -0
  283. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/WalletHostRuntime.d.ts +1 -0
  284. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/createDeviceDomain.d.ts +2 -1
  285. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/deviceLinkApproval.d.ts +27 -0
  286. package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/messages.d.ts +2 -1
  287. package/dist/types/wallet/src/core/authMethods/plugins.d.ts +4 -0
  288. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/recoveredEd25519Authority.d.ts +8 -0
  289. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/repositories.d.ts +1 -0
  290. package/dist/types/wallet/src/core/rpcClients/relayer/walletSessionAuthorizationStatus.d.ts +2 -0
  291. package/dist/types/wallet/src/core/signingEngine/session/persistence/walletSessionAuthorizationProjection.d.ts +1 -0
  292. package/dist/types/wallet/src/core/types/sdkSentEvents.d.ts +2 -0
  293. package/dist/types/wallet/src/index.d.ts +1 -1
  294. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonMock.d.ts +11 -2
  295. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonView.d.ts +2 -1
  296. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuModal.d.ts +9 -0
  297. package/dist/types/wallet/src/react/components/AccountMenuButton/hooks/useProfileState.d.ts +13 -5
  298. package/dist/types/wallet/src/react/components/AccountMenuButton/icons/lucideIcon.d.ts +1 -1
  299. package/dist/types/wallet/src/react/components/AccountMenuButton/types.d.ts +19 -3
  300. package/dist/types/wallet/src/react/components/ShowQRCode.d.ts +1 -1
  301. package/dist/types/wallet/src/react/externalNear.d.ts +3 -23
  302. package/dist/types/wallet/src/react/index.d.ts +1 -1
  303. package/dist/types/wallet/src/react/transactionReview/boundCalls.d.ts +7 -0
  304. package/package.json +1 -1
  305. package/dist/esm/react/externalNear.css +0 -90
  306. package/dist/esm/sdk/NonceCoordinator-Bti1HQPo.js +0 -1
  307. package/dist/esm/sdk/accountLifecycle-B98g9zN9.js +0 -1
  308. package/dist/esm/sdk/actions-GYsSR2Q2.js +0 -1
  309. package/dist/esm/sdk/activeWalletSession-H9JBdHyQ.js +0 -1
  310. package/dist/esm/sdk/adapters-D5MZ5NG5.js +0 -2
  311. package/dist/esm/sdk/appearance-DVFno9Tv.js +0 -1
  312. package/dist/esm/sdk/canonicalPrimitives-B6YMrI3W.js +0 -1
  313. package/dist/esm/sdk/challengeDelivery-FW9gYyr0.js +0 -1
  314. package/dist/esm/sdk/clientSessionPersistenceState-BPYK9PYV.js +0 -1
  315. package/dist/esm/sdk/configBuilder-DrxXNUpV.js +0 -1
  316. package/dist/esm/sdk/configuration-CAqANpTI.js +0 -1
  317. package/dist/esm/sdk/ecdsaCapabilityManifest--FjbES8k.js +0 -1
  318. package/dist/esm/sdk/ecdsaDerivationClientWasm-7Rp4TmYE.js +0 -1
  319. package/dist/esm/sdk/ecdsaDerivationExport-dInN7N6e.js +0 -1
  320. package/dist/esm/sdk/emailOtpEcdsaDerivationIdentity-CIh9IPai.js +0 -1
  321. package/dist/esm/sdk/errors-ADOZT8oV.js +0 -1
  322. package/dist/esm/sdk/exportKeypairOperation-BazJvSov.js +0 -1
  323. package/dist/esm/sdk/helpers-CXqXyyCU.js +0 -1
  324. package/dist/esm/sdk/host-C0Is56lU.js +0 -1
  325. package/dist/esm/sdk/icons-DyndJzSh.js +0 -1
  326. package/dist/esm/sdk/indexedDB-C1odKEC6.js +0 -1
  327. package/dist/esm/sdk/intentDigest-BMXki7yB.js +0 -1
  328. package/dist/esm/sdk/keyMaterialEnvelope-B-Q5KTJC.js +0 -1
  329. package/dist/esm/sdk/localOnly-BB3Rx3J6.js +0 -1
  330. package/dist/esm/sdk/nearEd25519YaoMaterialActivation-D9cdMKIZ.js +0 -1
  331. package/dist/esm/sdk/nearEd25519YaoSigningPreparation-D_Jvj7ht.js +0 -1
  332. package/dist/esm/sdk/operationFingerprint-Bn0lUYlm.js +0 -1
  333. package/dist/esm/sdk/presignaturePool-CultzkOG.js +0 -1
  334. package/dist/esm/sdk/recovery-entrypoint-QBvJBngm.js +0 -1
  335. package/dist/esm/sdk/recoveryAuthorization-DB-zxeHq.js +0 -1
  336. package/dist/esm/sdk/registration-CM5a7WYO.js +0 -1
  337. package/dist/esm/sdk/registration-Hv0xi7-L.js +0 -1
  338. package/dist/esm/sdk/registrationIntent-DTs2SR9E.js +0 -1
  339. package/dist/esm/sdk/registrationSignerPlan-CgbFVsAp.js +0 -1
  340. package/dist/esm/sdk/requireStepUpAuth-B7tC4MrA.js +0 -1
  341. package/dist/esm/sdk/resealedEnvelopeResult--iCVt_Bh.js +0 -1
  342. package/dist/esm/sdk/routerAbNormalSigning-Div3lZWV.js +0 -1
  343. package/dist/esm/sdk/runtime-auth-CVw1KoVD.js +0 -1
  344. package/dist/esm/sdk/runtime-device-link-Dp0YMZTQ.js +0 -1
  345. package/dist/esm/sdk/runtime-ecdsa-tempo-DEIjIgEO.js +0 -1
  346. package/dist/esm/sdk/runtime-email-otp-gsr_FsQn.js +0 -1
  347. package/dist/esm/sdk/runtime-export-upMPrZ4V.js +0 -1
  348. package/dist/esm/sdk/runtime-near-B64Hn3nc.js +0 -1
  349. package/dist/esm/sdk/runtime-preferences-CULdHkbg.js +0 -1
  350. package/dist/esm/sdk/runtime-recovery-D2saBaJy.js +0 -1
  351. package/dist/esm/sdk/runtime-recovery-codes-Bvc0IXMJ.js +0 -1
  352. package/dist/esm/sdk/runtimeContext-CNFJjcns.js +0 -6
  353. package/dist/esm/sdk/secp256k1-BGVlx50C.js +0 -1
  354. package/dist/esm/sdk/sessionObservationRevision-84ZzJ-fC.js +0 -1
  355. package/dist/esm/sdk/signEvmFamily-PjwUc5MT.js +0 -1
  356. package/dist/esm/sdk/signNear-r8VCOoTh.js +0 -1
  357. package/dist/esm/sdk/signerSlot-D4ZOuK7e.js +0 -1
  358. package/dist/esm/sdk/signingQueue-BJzOrwDq.js +0 -1
  359. package/dist/esm/sdk/thresholdEcdsa-tnY83qyG.js +0 -1
  360. package/dist/esm/sdk/transactionReview-DSGnpreN.js +0 -1
  361. package/dist/esm/sdk/unlockedEd25519ExportRootCapability-D43rvO9a.js +0 -1
  362. package/dist/esm/sdk/wallet-recovery-BjIQdOha.js +0 -1
  363. package/dist/esm/sdk/walletAuthMethodRecord-yIqCeE-o.js +0 -1
  364. package/dist/esm/sdk/walletCapabilityBindings-CUPk3mVH.js +0 -1
  365. package/dist/esm/sdk/walletCustodyEcdsaContinuity-DlOBCmwb.js +0 -1
  366. package/dist/esm/sdk/walletCustodyOperation-DzPcxEBS.js +0 -1
  367. package/dist/esm/sdk/walletDbName-DDJXrgA5.js +0 -1
  368. package/dist/esm/sdk/walletOwnershipGeneration-DI9ogcXF.js +0 -1
  369. package/dist/esm/sdk/walletRecoveryAdminProof-BJxmg3f7.js +0 -1
  370. package/dist/esm/sdk/walletRecoveryCommit-B7WsdR7y.js +0 -1
  371. package/dist/esm/sdk/walletRegistrationSetupPrewarm-CEJCj78c.js +0 -1
  372. package/dist/esm/sdk/walletSessionAuthorizationStatus-98G3Qji8.js +0 -1
  373. package/dist/esm/sdk/warmSessionHydration-DqZyfi1h.js +0 -1
  374. package/dist/public/sdk/NonceCoordinator-Bti1HQPo.js +0 -1
  375. package/dist/public/sdk/accountLifecycle-B98g9zN9.js +0 -1
  376. package/dist/public/sdk/actions-GYsSR2Q2.js +0 -1
  377. package/dist/public/sdk/activeWalletSession-H9JBdHyQ.js +0 -1
  378. package/dist/public/sdk/adapters-D5MZ5NG5.js +0 -2
  379. package/dist/public/sdk/appearance-DVFno9Tv.js +0 -1
  380. package/dist/public/sdk/canonicalPrimitives-B6YMrI3W.js +0 -1
  381. package/dist/public/sdk/challengeDelivery-FW9gYyr0.js +0 -1
  382. package/dist/public/sdk/clientSessionPersistenceState-BPYK9PYV.js +0 -1
  383. package/dist/public/sdk/configBuilder-DrxXNUpV.js +0 -1
  384. package/dist/public/sdk/configuration-CAqANpTI.js +0 -1
  385. package/dist/public/sdk/ecdsaCapabilityManifest--FjbES8k.js +0 -1
  386. package/dist/public/sdk/ecdsaDerivationClientWasm-7Rp4TmYE.js +0 -1
  387. package/dist/public/sdk/ecdsaDerivationExport-dInN7N6e.js +0 -1
  388. package/dist/public/sdk/emailOtpEcdsaDerivationIdentity-CIh9IPai.js +0 -1
  389. package/dist/public/sdk/errors-ADOZT8oV.js +0 -1
  390. package/dist/public/sdk/exportKeypairOperation-BazJvSov.js +0 -1
  391. package/dist/public/sdk/helpers-CXqXyyCU.js +0 -1
  392. package/dist/public/sdk/host-C0Is56lU.js +0 -1
  393. package/dist/public/sdk/icons-DyndJzSh.js +0 -1
  394. package/dist/public/sdk/indexedDB-C1odKEC6.js +0 -1
  395. package/dist/public/sdk/intentDigest-BMXki7yB.js +0 -1
  396. package/dist/public/sdk/keyMaterialEnvelope-B-Q5KTJC.js +0 -1
  397. package/dist/public/sdk/localOnly-BB3Rx3J6.js +0 -1
  398. package/dist/public/sdk/nearEd25519YaoMaterialActivation-D9cdMKIZ.js +0 -1
  399. package/dist/public/sdk/nearEd25519YaoSigningPreparation-D_Jvj7ht.js +0 -1
  400. package/dist/public/sdk/operationFingerprint-Bn0lUYlm.js +0 -1
  401. package/dist/public/sdk/presignaturePool-CultzkOG.js +0 -1
  402. package/dist/public/sdk/recovery-entrypoint-QBvJBngm.js +0 -1
  403. package/dist/public/sdk/recoveryAuthorization-DB-zxeHq.js +0 -1
  404. package/dist/public/sdk/registration-CM5a7WYO.js +0 -1
  405. package/dist/public/sdk/registration-Hv0xi7-L.js +0 -1
  406. package/dist/public/sdk/registrationIntent-DTs2SR9E.js +0 -1
  407. package/dist/public/sdk/registrationSignerPlan-CgbFVsAp.js +0 -1
  408. package/dist/public/sdk/requireStepUpAuth-B7tC4MrA.js +0 -1
  409. package/dist/public/sdk/resealedEnvelopeResult--iCVt_Bh.js +0 -1
  410. package/dist/public/sdk/routerAbNormalSigning-Div3lZWV.js +0 -1
  411. package/dist/public/sdk/runtime-auth-CVw1KoVD.js +0 -1
  412. package/dist/public/sdk/runtime-device-link-Dp0YMZTQ.js +0 -1
  413. package/dist/public/sdk/runtime-ecdsa-tempo-DEIjIgEO.js +0 -1
  414. package/dist/public/sdk/runtime-email-otp-gsr_FsQn.js +0 -1
  415. package/dist/public/sdk/runtime-export-upMPrZ4V.js +0 -1
  416. package/dist/public/sdk/runtime-near-B64Hn3nc.js +0 -1
  417. package/dist/public/sdk/runtime-preferences-CULdHkbg.js +0 -1
  418. package/dist/public/sdk/runtime-recovery-D2saBaJy.js +0 -1
  419. package/dist/public/sdk/runtime-recovery-codes-Bvc0IXMJ.js +0 -1
  420. package/dist/public/sdk/runtimeContext-CNFJjcns.js +0 -6
  421. package/dist/public/sdk/secp256k1-BGVlx50C.js +0 -1
  422. package/dist/public/sdk/sessionObservationRevision-84ZzJ-fC.js +0 -1
  423. package/dist/public/sdk/signEvmFamily-PjwUc5MT.js +0 -1
  424. package/dist/public/sdk/signNear-r8VCOoTh.js +0 -1
  425. package/dist/public/sdk/signerSlot-D4ZOuK7e.js +0 -1
  426. package/dist/public/sdk/signingQueue-BJzOrwDq.js +0 -1
  427. package/dist/public/sdk/thresholdEcdsa-tnY83qyG.js +0 -1
  428. package/dist/public/sdk/transactionReview-DSGnpreN.js +0 -1
  429. package/dist/public/sdk/unlockedEd25519ExportRootCapability-D43rvO9a.js +0 -1
  430. package/dist/public/sdk/wallet-recovery-BjIQdOha.js +0 -1
  431. package/dist/public/sdk/walletAuthMethodRecord-yIqCeE-o.js +0 -1
  432. package/dist/public/sdk/walletCapabilityBindings-CUPk3mVH.js +0 -1
  433. package/dist/public/sdk/walletCustodyEcdsaContinuity-DlOBCmwb.js +0 -1
  434. package/dist/public/sdk/walletCustodyOperation-DzPcxEBS.js +0 -1
  435. package/dist/public/sdk/walletDbName-DDJXrgA5.js +0 -1
  436. package/dist/public/sdk/walletOwnershipGeneration-DI9ogcXF.js +0 -1
  437. package/dist/public/sdk/walletRecoveryAdminProof-BJxmg3f7.js +0 -1
  438. package/dist/public/sdk/walletRecoveryCommit-B7WsdR7y.js +0 -1
  439. package/dist/public/sdk/walletRegistrationSetupPrewarm-CEJCj78c.js +0 -1
  440. package/dist/public/sdk/walletSessionAuthorizationStatus-98G3Qji8.js +0 -1
  441. package/dist/public/sdk/warmSessionHydration-DqZyfi1h.js +0 -1
  442. /package/dist/esm/sdk/{accountIds-D5NI31F2.js → accountIds-Dj_0GoY-.js} +0 -0
  443. /package/dist/esm/sdk/{authenticatorOptions-EF_Rps52.js → authenticatorOptions-2_XK8aXv.js} +0 -0
  444. /package/dist/esm/sdk/{authorizationAdmission-DbhNiY3X.js → authorizationAdmission-BYwaSZYV.js} +0 -0
  445. /package/dist/esm/sdk/{browser-B2RI00tM.js → browser-B1qU6ouJ.js} +0 -0
  446. /package/dist/esm/sdk/{bytes-DVe42j_r.js → bytes-CA0mv-bG.js} +0 -0
  447. /package/dist/esm/sdk/{canonicalSignerErrorCode-AwNMAn8S.js → canonicalSignerErrorCode-BHDPNkvJ.js} +0 -0
  448. /package/dist/esm/sdk/{capabilityKinds-BzrNeEyO.js → capabilityKinds-DVlGMspk.js} +0 -0
  449. /package/dist/esm/sdk/{configHelpers-BNqoU2cv.js → configHelpers-CXDY3bKC.js} +0 -0
  450. /package/dist/esm/sdk/{csp-stylesheet-DeuiM0Mo.js → csp-stylesheet-CHtV6HyK.js} +0 -0
  451. /package/dist/esm/sdk/{events-1dzC4Ocx.js → events-D6l0_ugy.js} +0 -0
  452. /package/dist/esm/sdk/{executeWorkerOperation-B-9JuL55.js → executeWorkerOperation-XmBNaxrV.js} +0 -0
  453. /package/dist/esm/sdk/{jsonRpc-CHutSlC9.js → jsonRpc-YKL5n8VL.js} +0 -0
  454. /package/dist/esm/sdk/{keccak-C9kCkZem.js → keccak-BArcwgbj.js} +0 -0
  455. /package/dist/esm/sdk/{normalization-DtruiNPw.js → normalization-dgJxtZKK.js} +0 -0
  456. /package/dist/esm/sdk/{prfCache-8Wm3etlV.js → prfCache-Ck1mh5YB.js} +0 -0
  457. /package/dist/esm/sdk/{profileAccountProjection-D01e10UY.js → profileAccountProjection-dvLchPBo.js} +0 -0
  458. /package/dist/esm/sdk/{promptText-Bz3YRl9D.js → promptText-BIv8lx7_.js} +0 -0
  459. /package/dist/esm/sdk/{registrationAuthMethodInput-BvbWl0y_.js → registrationAuthMethodInput-Be4Td0Ef.js} +0 -0
  460. /package/dist/esm/sdk/{sdkSentEvents-DUht3AOD.js → sdkSentEvents-QPs69K3s.js} +0 -0
  461. /package/dist/esm/sdk/{shared-DcHtE-D-.js → shared-hkHoIS9i.js} +0 -0
  462. /package/dist/esm/sdk/{signer-worker-DlK58rEA.js → signer-worker-CmCKlJ__.js} +0 -0
  463. /package/dist/esm/sdk/{signerDomain-D-EUTlLK.js → signerDomain-BLnlQPAV.js} +0 -0
  464. /package/dist/esm/sdk/{signingSessionSeal-DqbjG8c8.js → signingSessionSeal-BFOBKj-J.js} +0 -0
  465. /package/dist/esm/sdk/{surface-measurement-reporter-NUm_54LH.js → surface-measurement-reporter-DvzNDnHy.js} +0 -0
  466. /package/dist/esm/sdk/{types-fJKfUgTi.js → types-COS7UL3R.js} +0 -0
  467. /package/dist/esm/sdk/{walletIframeIdentity-Cz82I_Uh.js → walletIframeIdentity-CpgyEnKg.js} +0 -0
  468. /package/dist/esm/sdk/{walletSessionFailure-CLUIF3Eh.js → walletSessionFailure-ZfdbUAG-.js} +0 -0
  469. /package/dist/esm/sdk/{webauthnPromptCoordinator-CU9ag7vz.js → webauthnPromptCoordinator-DMETRUcN.js} +0 -0
  470. /package/dist/public/sdk/{accountIds-D5NI31F2.js → accountIds-Dj_0GoY-.js} +0 -0
  471. /package/dist/public/sdk/{authenticatorOptions-EF_Rps52.js → authenticatorOptions-2_XK8aXv.js} +0 -0
  472. /package/dist/public/sdk/{authorizationAdmission-DbhNiY3X.js → authorizationAdmission-BYwaSZYV.js} +0 -0
  473. /package/dist/public/sdk/{browser-B2RI00tM.js → browser-B1qU6ouJ.js} +0 -0
  474. /package/dist/public/sdk/{bytes-DVe42j_r.js → bytes-CA0mv-bG.js} +0 -0
  475. /package/dist/public/sdk/{canonicalSignerErrorCode-AwNMAn8S.js → canonicalSignerErrorCode-BHDPNkvJ.js} +0 -0
  476. /package/dist/public/sdk/{capabilityKinds-BzrNeEyO.js → capabilityKinds-DVlGMspk.js} +0 -0
  477. /package/dist/public/sdk/{configHelpers-BNqoU2cv.js → configHelpers-CXDY3bKC.js} +0 -0
  478. /package/dist/public/sdk/{csp-stylesheet-DeuiM0Mo.js → csp-stylesheet-CHtV6HyK.js} +0 -0
  479. /package/dist/public/sdk/{events-1dzC4Ocx.js → events-D6l0_ugy.js} +0 -0
  480. /package/dist/public/sdk/{executeWorkerOperation-B-9JuL55.js → executeWorkerOperation-XmBNaxrV.js} +0 -0
  481. /package/dist/public/sdk/{jsonRpc-CHutSlC9.js → jsonRpc-YKL5n8VL.js} +0 -0
  482. /package/dist/public/sdk/{keccak-C9kCkZem.js → keccak-BArcwgbj.js} +0 -0
  483. /package/dist/public/sdk/{normalization-DtruiNPw.js → normalization-dgJxtZKK.js} +0 -0
  484. /package/dist/public/sdk/{prfCache-8Wm3etlV.js → prfCache-Ck1mh5YB.js} +0 -0
  485. /package/dist/public/sdk/{profileAccountProjection-D01e10UY.js → profileAccountProjection-dvLchPBo.js} +0 -0
  486. /package/dist/public/sdk/{promptText-Bz3YRl9D.js → promptText-BIv8lx7_.js} +0 -0
  487. /package/dist/public/sdk/{registrationAuthMethodInput-BvbWl0y_.js → registrationAuthMethodInput-Be4Td0Ef.js} +0 -0
  488. /package/dist/public/sdk/{sdkSentEvents-DUht3AOD.js → sdkSentEvents-QPs69K3s.js} +0 -0
  489. /package/dist/public/sdk/{shared-DcHtE-D-.js → shared-hkHoIS9i.js} +0 -0
  490. /package/dist/public/sdk/{signer-worker-DlK58rEA.js → signer-worker-CmCKlJ__.js} +0 -0
  491. /package/dist/public/sdk/{signerDomain-D-EUTlLK.js → signerDomain-BLnlQPAV.js} +0 -0
  492. /package/dist/public/sdk/{signingSessionSeal-DqbjG8c8.js → signingSessionSeal-BFOBKj-J.js} +0 -0
  493. /package/dist/public/sdk/{surface-measurement-reporter-NUm_54LH.js → surface-measurement-reporter-DvzNDnHy.js} +0 -0
  494. /package/dist/public/sdk/{types-fJKfUgTi.js → types-COS7UL3R.js} +0 -0
  495. /package/dist/public/sdk/{walletIframeIdentity-Cz82I_Uh.js → walletIframeIdentity-CpgyEnKg.js} +0 -0
  496. /package/dist/public/sdk/{walletSessionFailure-CLUIF3Eh.js → walletSessionFailure-ZfdbUAG-.js} +0 -0
  497. /package/dist/public/sdk/{webauthnPromptCoordinator-CU9ag7vz.js → webauthnPromptCoordinator-DMETRUcN.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-dVx5-UGu.js";import{v as t}from"./digests-BIaE0DMd.js";import{i as n}from"./chains-B72I4PDH.js";import{r}from"./transactionReviewAdmission-DPxuDgkU.js";import{t as i}from"./surface-measurement-reporter-DvzNDnHy.js";import{a,i as o,o as s,r as c,s as l}from"./csp-stylesheet-CHtV6HyK.js";import{t as u}from"./SeamsWordmark-DqiC9-sd.js";import{a as d,i as f,r as p,t as m}from"./actions-BIdcxldy.js";import{i as h,r as g}from"./intentDigest-B6EshTea.js";import{t as _}from"./promptText-BIv8lx7_.js";import{a as v}from"./transaction-activity-olcDRay5.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,t as ee}from"./appearance-token-vars-EYbmnHsJ.js";import{i as E,n as te,r as ne,t as re}from"./ConfirmationDrawer-BmzikAr4.js";import{n as ie,t as ae}from"./appearance-CAIe7Qed.js";let oe=!1;function se(e=!0){oe=!!e}function ce(){return oe}function le(e){if(!e)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t,2)}catch{return String(e)}}function D(e){if(!e||e===`0`)return`0 NEAR`;try{let t=BigInt(e),n=BigInt(`1000000000000000000000000`),r=t/n,i=t%n;if(i===BigInt(0))return`${r.toString()} NEAR`;let a=i.toString().padStart(24,`0`).slice(0,5);return a=a.replace(/0+$/g,``),a.length===0?`${r.toString()} NEAR`:`${r.toString()}.${a} NEAR`}catch{return e}}function ue(e){if(!e)return``;try{return`${BigInt(e)/BigInt(`1000000000000`)} Tgas`}catch{return e}}function O(e,t={}){if(!e||typeof e!=`string`)return``;let{prefix:n=12,suffix:r=6}=t;return e.length<=n+r+3?e:`${e.slice(0,n)}...${e.slice(-r)}`}function k(e){return e?e instanceof Uint8Array?`${e.byteLength} bytes`:Array.isArray(e)||typeof e==`string`?`${e.length} bytes`:`unknown`:`0 bytes`}function de(e){if(!e)return;let t=String(e.decoded||``),n=String(e.raw||``);if(!(!t||!n)&&t!==n)return{decoded:t,raw:n,defaultMode:e.defaultMode===`raw`?`raw`:`decoded`}}function fe(e,t){if(!/Value \(wei\)$/i.test(e.trim()))return!1;let n=t.trim();if(!n)return!1;if(n===`0`||/^0x0+$/i.test(n))return!0;try{return BigInt(n)===0n}catch{return!1}}function pe(e,t){return!Array.isArray(t)||t.length===0?[]:t.flatMap((t,n)=>{let r=String(t.label||``).trim(),i=String(t.value||``),a=t.renderAs||`inline`;if(fe(r,i))return[];if(a===`file-content`){let a=de(t.contentVariants),o=a?.defaultMode===`raw`?a.raw:a?.decoded||i;return[{id:`${e}-field-${n}`,label:r?`${r}:`:``,fieldLabel:r?`${r}:`:void 0,type:`file`,open:!1,content:o,...a?{contentVariants:a}:{},copyValue:typeof t.copyValue==`string`?t.copyValue:void 0,hideLabel:!!t.hideLabel,hideChevron:typeof t.hideChevron==`boolean`?t.hideChevron:!0}]}return[{id:`${e}-field-${n}`,label:r?`${r}: ${i}`:i,fieldLabel:r?`${r}:`:void 0,type:`file`,open:!1,copyValue:typeof t.copyValue==`string`?t.copyValue:void 0}]})}const me=({operation:e,depth:t,path:n,renderChild:r})=>{let i=String(e.id||``).trim()||`op-${n}`,a=(()=>{let t=String(e.to||``).trim();return/^0x[0-9a-fA-F]{40}$/.test(t)?t:void 0})(),o=String(e.description||``).trim(),s=Array.isArray(e.children)?e.children.map((e,i)=>r(e,t+1,`${n}.${i}`)):[],c=pe(i,e.fields),l=o?[{id:`${i}-description`,label:o,type:`file`,open:!1}]:[];if(e.kind===`raw.fallback`){let t=String(e.raw||``).trim();t&&l.push({id:`${i}-raw`,label:`Raw payload`,type:`file`,open:!1,content:t})}let u=[...l,...c,...s];return u.length===0?{id:i,label:String(e.label||e.kind),type:`file`,open:!1,contractAddress:a}:{id:i,label:String(e.label||e.kind),type:`folder`,open:t<1,contractAddress:a,children:u}};function he(e){switch(e){case`near`:return`NEAR`;case`evm`:return`EVM`;case`tempo`:return`Tempo`;default:return`Unknown`}}function ge(e){return!Array.isArray(e)||e.length===0?[]:[{id:`warnings-root`,label:`Warnings`,type:`folder`,open:!0,children:e.map((e,t)=>({id:`warning-${t}`,label:`[${String(e.severity||`warning`).toUpperCase()}] ${String(e.message||``)}`,type:`file`,open:!1}))}]}function _e(e,t,n){return me({operation:e,depth:t,path:n,renderChild:(e,t,n)=>_e(e,t,n)})}function A(e){let t=Array.isArray(e.children)?e.children.map(e=>A(e)):void 0;return e.type===`folder`?{...e,hideChevron:!0,children:t}:t?{...e,children:t}:e}function ve(e,t){let n=Array.isArray(e.children)?e.children.map(e=>ve(e,t)):void 0;return{...e,chain:t,...n?{children:n}:{}}}function ye(e){let t=e.chain===`evm`||e.chain===`tempo`,n=(Array.isArray(e.operations)?e.operations:[]).map((e,t)=>_e(e,0,String(t))).map(t=>ve(t,e.chain)).map(e=>t?A(e):e),r=[...ge(e.warnings).map(t=>ve(t,e.chain)).map(e=>t?A(e):e),...n];r.length===0&&r.push({id:`no-operations`,label:`No operations`,type:`file`,open:!1});let i=he(e.chain);return{id:`display-root`,label:String(e.title||``).trim()||`${i} Transaction`,type:`folder`,open:!0,children:r}}function be(e,n){let r;switch(e.type){case`FunctionCall`:r=[{id:`a${n}-args`,label:`using args:`,type:`file`,open:!1,hideChevron:!0,hideLabel:!0,content:le(e.args)}];break;case`Transfer`:r=[];break;case`CreateAccount`:r=[];break;case`DeployContract`:{let t=k(e.code);r=[{id:`a${n}-code-size`,label:`WASM contract code size: ${t}`,type:`file`,open:!1}];break}case`DeployGlobalContract`:{let t=e.code,i=e.deployMode,a=k(t);r=[{id:`a${n}-deploy-mode`,label:`mode: ${String(i||``)}`,type:`file`,open:!1},{id:`a${n}-code-size`,label:`WASM global contract code size: ${a}`,type:`file`,open:!1}];break}case`UseGlobalContract`:{let t=e.accountId,i=e.codeHash,a;a=t?`by account: ${String(t)}`:i?`by hash: ${O(String(i),{prefix:10,suffix:6})}`:`by global contract identifier`,r=[{id:`a${n}-identifier`,label:a,type:`file`,open:!1}];break}case`Stake`:r=[{id:`a${n}-publicKey`,label:`validator: ${O(e.publicKey)}`,type:`file`,open:!0,copyValue:e.publicKey}];break;case`AddKey`:{let i=e.accessKey,a=``;try{a=(t(i)?JSON.parse(i):i).permission===`FullAccess`?`Full Access`:`Function Call`}catch{a=`Unknown`}r=[{id:`a${n}-publicKey`,label:`key: ${O(e.publicKey)}`,open:!1,type:`file`,copyValue:e.publicKey},{id:`a${n}-permissions`,label:`permissions: ${a}`,open:!1,type:`file`}];break}case`DeleteKey`:r=[{id:`a${n}-publicKey`,label:`key: ${O(e.publicKey)}`,open:!1,type:`file`,copyValue:e.publicKey}];break;case`DeleteAccount`:r=[{id:`a${n}-beneficiaryId`,label:`sending balance to: ${e.beneficiaryId}`,open:!1,type:`file`}];break;default:return xe(e)}return{id:`action-${n}`,label:``,type:`folder`,open:!1,hideChevron:!0,action:e,actionIndex:n,children:r}}function xe(e){throw Error(`Unsupported NEAR action: ${String(e)}`)}function Se(e,t,n){let r=e.actions.map((e,t)=>be(e,t));return{id:`tx-${t}`,label:``,type:`folder`,open:!0,hideChevron:!0,transaction:e,transactionIndex:t,totalTransactions:n,children:[...r]}}function Ce(e){let t=e.length,n=e.map((e,n)=>Se(e,n,t));return{id:`txs-root`,label:t>1?`Transactions`:`Transaction`,type:`folder`,open:!0,children:n}}function we(e){let t=e.abiDecodeHint;if(t&&Array.isArray(t.abi)&&t.abi.length>0){let e=String(t.dataHex||``).trim();if(e&&e!==`0x`)return!0}return(Array.isArray(e.children)?e.children:[]).some(we)}function Te(e){return(Array.isArray(e.operations)?e.operations:[]).some(we)}function j(e){let t=Array.isArray(e.txSigningRequests)?e.txSigningRequests:[];if(t.length>0)return Ce(p(t));let n=e.model;if(!n)return null;let r=Array.isArray(n.operations)?n.operations:[],i=Array.isArray(n.warnings)?n.warnings:[];return r.length>0||i.length>0?ye(n):null}const Ee=/^NEAR account ([^\s]+) needs funding before signing\.$/;function De(e){let t=String(e||``).trim();return t.length<=8?t:`${t.slice(0,4)}...${t.slice(-4)}`}function Oe(e){let t=String(e||``).trim();return t?`NEAR account ${t} needs funding before signing.`:`NEAR account needs funding before signing.`}function ke(e){let t=String(e||``).trim(),n=Ee.exec(t);if(!n)return null;let r=String(n[1]||``).trim();return r?{accountId:r,shortAccountId:De(r)}:null}function Ae(e){return String(e||``).trim()===`Topping up account...`}function je(e){let t=De(e);return t?`Funding NEAR account ${t}...`:`Funding NEAR account...`}function Me(e){let t=String(e||``).trim();return t.startsWith(`Funding NEAR account`)&&t.endsWith(`...`)}function Ne(e){return Ae(e)||Me(e)}function Pe(e){let t=e.trim();if(!t)return{kind:`empty`};if(Ne(t))return{kind:`status`,text:t};let n=ke(t);return n?{kind:`funding`,accountId:n.accountId,shortAccountId:n.shortAccountId}:{kind:`text`,text:t}}function Fe(e){let t=e.presentation,n=t.errorMessage??``,r=t.cancelText??`Cancel`,i=t.securityContext?.passkeyRegistration;if(i?.kind===`passkey_registration_confirm_display_v1`)return{ok:!0,model:{appearance:e.appearance,content:{kind:`registration`,registration:{display:i,heading:t.title?.trim()||`Create your passkey`,body:t.body?.trim()||`Use Touch ID or your device passkey to create credentials for this account.`,cancelText:r,errorMessage:n,decision:t.loading?{kind:`creating`}:{kind:`ready`,onConfirm:e.callbacks.confirm},onCancel:e.callbacks.cancel}}}};let a;switch(t.signingAuthMode){case`emailOtp`:{let r=t.emailOtpPrompt,i=r?.challengeId.trim();if(!r||!i)return{ok:!1,error:`missing_email_challenge`};a={kind:`email`,email:{prompt:{challengeId:i,title:r.title,body:r.body,helperText:r.helperText,emailHint:r.emailHint,resendDebounceMs:r.resendDebounceMs,onResend:r.onResend},verification:Ie(t.loading===!0,n),onSubmit:e.callbacks.submitEmail}};break}case`warmSession`:a={kind:`session`};break;case`webauthn`:case void 0:a={kind:`passkey`};break;default:return M(t.signingAuthMode)}let o=Pe(t.body??``);return{ok:!0,model:{appearance:e.appearance,content:{kind:`transaction`,capture:t.authMethodCapture??null,review:{model:t.model??null,tree:e.tree},header:{heading:Le(t),website:Re(t.securityContext?.rpId?.trim()??``),chainDetails:ze(t,t.loading===!0||o.kind===`status`),errorMessage:n},body:o,prompt:a,transaction:{tree:e.tree,theme:e.appearance.theme.mode,explorers:{near:t.nearExplorerUrl||`https://testnet.nearblocks.io`,tempo:t.tempoExplorerUrl,evm:t.evmExplorerUrl},decision:t.loading||t.preparing?{kind:`preparing`}:{kind:`ready`,onConfirm:e.callbacks.confirm},confirmText:t.signingAuthMode===`emailOtp`?`Confirm Code`:t.confirmText??`Confirm`,cancelText:r,errorMessage:n,onCancel:e.callbacks.cancel,onBack:t.onBack,authMethodApprovalMessage:t.authMethodApprovalMessage}}}}}function Ie(e,t){return e?{kind:`pending`}:t?{kind:`rejected`,message:t}:{kind:`ready`}}function Le(e){let t=(e.model?.operations.length??0)===0?`Register with Passkey`:`Confirm with Passkey`;switch(e.signingAuthMode){case`emailOtp`:return e.emailOtpPrompt?.title?.trim()||`Enter email code to sign`;case`warmSession`:return`Review transaction`;case`webauthn`:return t;case void 0:return e.title?.trim()||t;default:return M(e.signingAuthMode)}}function Re(e){return e?{kind:`ready`,text:e}:{kind:`loading`}}function ze(e,t){let n=e.model;if(n?.chainId)return{kind:`ready`,text:`${Be(n.chain)} | ChainID: ${n.chainId}`};let r=String(e.securityContext?.blockHeight||``).trim();return r?{kind:`ready`,text:`block ${r}`}:t?{kind:`loading`}:{kind:`ready`,text:`block`}}function Be(e){switch(e){case`near`:return`NEAR`;case`evm`:return`EVM`;case`tempo`:return`Tempo`;case`unknown`:return`Unknown`;default:return M(e)}}function M(e){throw Error(`Unexpected confirmation presentation: ${String(e)}`)}const N=`seams-surface-resize-begin`;function Ve(e,t){return e.dispatchEvent(new CustomEvent(N,{bubbles:!0,composed:!0,detail:t}))}function He(e,t,n){let r=t;return e.addEventListener(N,r,n),()=>e.removeEventListener(N,r,n)}const Ue=`data-seams-confirm-surface`,P=`seams-confirm-surface-pinned`,F=`seams-confirm-surface-pinned-root`,I=`seams-surface-height-driven`,We=`--seams-surface-height-driven-target`;function Ge(e,t){let{fromCssPx:n,toCssPx:r}=t;if(!Number.isFinite(n)||!Number.isFinite(r))return!1;let i=r-n;if(Math.abs(i)<1)return!1;let a=Math.min(n,r),o=Math.max(n,r),s=null,c=!1,l=null,u=e=>{if(c)return;let r=n+(Number.isFinite(e)?Math.min(Math.max(e,0),1):0)*i;t.setHeightCssPx(Math.min(Math.max(r,a),o))},d=()=>{c||(c=!0,l!==null&&window.clearTimeout(l),t.finish())},f=()=>s||c?null:(t.onClaimed?.(),u(0),l=window.setTimeout(()=>{u(1),d()},1500),s={setProgress:u,finish:d},s);return Ve(e,{...t.reason?{reason:t.reason}:{},deltaCssPx:i,claim:f}),s!==null}function Ke(e){let t=null,n=null,r=()=>{let e=n;n=null,e&&e.classList.remove(I)};return{capture(){let n=e.element();t=n?n.getBoundingClientRect().height:null},commit(){let i=t;t=null;let a=e.element();!a||i===null||document.documentElement.classList.contains(F)||a.parentElement?.closest(`.${I}`)||(n=a,a.classList.add(I),e.setHeightCssPx(i),Promise.resolve(e.settled?.()).then(()=>new Promise(e=>requestAnimationFrame(()=>e()))).then(()=>{if(n!==a)return;if(document.documentElement.classList.contains(F)){r();return}a.classList.remove(I);let t=a.getBoundingClientRect().height;a.classList.add(I),!L({...e.reason?{reason:e.reason}:{},element:a,fromCssPx:i,toCssPx:t,setHeightCssPx:t=>e.setHeightCssPx(t),onSettled:()=>{n=null}})&&(r(),qe(a,i,t))}))},dispose:r}}function qe(e,t,n){Math.abs(n-t)<1||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||e.animate([{height:`${t}px`},{height:`${n}px`}],{duration:200,easing:`cubic-bezier(0.32, 0.72, 0, 1)`})}function L(e){let{element:t,fromCssPx:n,toCssPx:r}=e;if(!Number.isFinite(n)||!Number.isFinite(r)||Math.abs(r-n)<1)return!1;let i=e.drivenClasses??[I],a=i.filter(e=>!t.classList.contains(e));t.classList.add(...a),e.setHeightCssPx(n);let o=Ge(t,{...e.reason?{reason:e.reason}:{},fromCssPx:n,toCssPx:r,setHeightCssPx:e.setHeightCssPx,finish:()=>{t.classList.remove(...i),e.onSettled?.()}});return o||t.classList.remove(...a),o}let Je=null;const Ye={blipFrames:0,trace(e=2e3){return new Promise(t=>{let n=[],r=performance.now(),i=()=>{let a=Je,o=a?.classList.contains(P)?`*`:``;n.push(`${Math.round(performance.now()-r)}: box=${document.documentElement.clientHeight} content=${a?Math.round(a.getBoundingClientRect().height):`-`}${o}`),performance.now()-r<e?requestAnimationFrame(i):t(n)};requestAnimationFrame(i)})}};function Xe(e){Je=e;try{window.__seamsSurfaceMotion=Ye}catch{}}function Ze(){let e=document.documentElement?.clientHeight??0;return e>0?e:window.innerHeight}function Qe(e,t,n){return Math.min(Math.max(e,t),n)}function $e(e){return e.getAttribute(Ue)===`wallet-iframe`}function et(e){if(typeof CSSStyleSheet!=`function`||!(`adoptedStyleSheets`in document))return null;let t=null,n=()=>{e.classList.remove(P),document.documentElement.classList.remove(F)};return{set(n){try{t||=new CSSStyleSheet,t.replaceSync(`.${P}{height:${Math.max(0,Math.round(n))}px}.${F}{overflow:hidden}`),document.adoptedStyleSheets.includes(t)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,t])}catch{return!1}return e.classList.add(P),document.documentElement.classList.add(F),!0},release:n,dispose(){if(n(),!t)return;let e=t;t=null;try{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==e)}catch{}}}}function tt(e,t={}){let n=t.viewportHeightCssPx??Ze,r=et(e);Xe(e);let i=null,a=()=>{let e=i;e&&(i=null,e.frame!==null&&cancelAnimationFrame(e.frame),e.driver.setProgress(1),e.driver.finish(),r?.release())},o=()=>{let e=i;if(!e)return;e.frame=null;let t=n();t===e.lastViewportPx?e.framesSinceChange+=1:(e.lastViewportPx=t,e.framesSinceChange=0,e.moved=!0);let r=Qe((t-e.originHostPx)/e.deltaCssPx,0,1);if(r>=1){if(e.framesAtTarget+=1,e.sawIntermediate||e.framesAtTarget>=3){a();return}e.frame=requestAnimationFrame(o);return}e.framesAtTarget>0&&(Ye.blipFrames+=1),e.framesAtTarget=0,r>0&&(e.sawIntermediate=!0),e.driver.setProgress(r);let s=e.moved?8:20;if(e.framesSinceChange>=s){a();return}e.frame=requestAnimationFrame(o)},s=He(e,t=>{let s=t.detail;if(!r||!s||!$e(e))return;let c=s.deltaCssPx;if(!Number.isFinite(c)||Math.abs(c)<1)return;a();let l=n(),u=e.getBoundingClientRect().height;if(!(l>0)||!(u>0)||Math.abs(l-u)>1)return;let d=Math.round(u),f=d+c;if(!(f>0)||!r.set(f))return;let p=s.claim();if(!p){r.release();return}i={driver:p,originHostPx:d,deltaCssPx:c,lastViewportPx:l,framesSinceChange:0,moved:!1,sawIntermediate:!1,framesAtTarget:0,frame:null},i.frame=requestAnimationFrame(o)});return{dispose(){s(),a(),r?.dispose()}}}function nt(e){let t=e.size??`100%`,n=e.strokeWidth??2;return c(`svg`,{class:`padlock-icon seams-padlock-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,"stroke-linejoin":`round`,width:t,height:t,"aria-hidden":`true`,focusable:`false`,children:[c(`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}),c(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}let rt=0;var it=class extends o{id=`seams-halo-${++rt}`;element=a();motion=null;frame=null;startedAt=null;angle=null;componentDidMount(){this.motion=this.element.current.ownerDocument.defaultView.matchMedia(`(prefers-reduced-motion: no-preference)`),this.motion.addEventListener(`change`,this.updateAnimation),this.syncDynamicStyles(),this.updateAnimation()}componentDidUpdate(e){e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),e.innerPadding!==this.props.innerPadding&&this.syncDynamicStyles(),(e.animated!==this.props.animated||e.durationMs!==this.props.durationMs||e.styles!==this.props.styles)&&this.updateAnimation()}componentWillUnmount(){this.cancelFrame(),this.motion?.removeEventListener(`change`,this.updateAnimation),this.motion=null,this.props.styles.deleteDynamicRule(this.id)}cancelFrame(){let e=this.element.current?.ownerDocument.defaultView;this.frame!==null&&e?.cancelAnimationFrame(this.frame),this.frame=null,this.startedAt=null}updateAnimation=()=>{this.cancelFrame(),this.angle=null,this.syncDynamicStyles(),this.props.animated&&this.motion?.matches&&(this.frame=this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick))};tick=e=>{if(!this.element.current||!this.props.animated||!this.motion?.matches)return;this.startedAt??=e;let t=this.props.durationMs,n=t&&Number.isFinite(t)&&t>0?t:1150;this.angle=`${(e-this.startedAt)%n/n*360}deg`,this.syncDynamicStyles(),this.frame=this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick)};syncDynamicStyles(){let e={};if(this.props.innerPadding&&(e[`--inner-padding`]=this.props.innerPadding),this.angle&&(e[`--halo-angle`]=this.angle),Object.keys(e).length===0){this.props.styles.deleteDynamicRule(this.id);return}this.props.styles.setDynamicDeclarations(this.id,`#${this.id}`,e)}render(){return c(`div`,{id:this.id,ref:this.element,class:`seams-halo-border`,children:c(`div`,{class:`halo-root${this.props.animated?` animated`:``}`,children:c(`div`,{class:`halo-inner`,children:c(`div`,{class:`halo-outer`,children:[this.props.animated&&c(`div`,{class:`halo-ring`,"aria-hidden":`true`}),c(`div`,{class:`halo-content`,children:this.props.children})]})})})})}};function at(e){return c(`div`,{class:`seams-passkey-halo-loading`,"aria-hidden":`true`,children:c(`div`,{class:`seams-passkey-loading-root`,children:c(it,{animated:e.animated,innerPadding:e.innerPadding,styles:e.styles,children:c(`div`,{class:`seams-passkey-loading-touch-icon-container`,children:c(`svg`,{class:`seams-passkey-loading-touch-icon`,"data-icon":e.icon,width:e.size??36,height:e.size??36,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,focusable:`false`,children:e.icon===`mail`?c(ot,{}):c(st,{})})})})})})}function ot(){return c(l,{children:[c(`path`,{d:`M4.5 6.5H19.5C20.0523 6.5 20.5 6.94772 20.5 7.5V16.5C20.5 17.0523 20.0523 17.5 19.5 17.5H4.5C3.94772 17.5 3.5 17.0523 3.5 16.5V7.5C3.5 6.94772 3.94772 6.5 4.5 6.5Z`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`}),c(`path`,{d:`M4.25 7.25L12 12.75L19.75 7.25`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`})]})}function st(){return c(`path`,{d:`M6.40519 19.0481C6.58912 18.6051 6.75832 18.1545 6.91219 17.6969M14.3433 20.6926C14.6095 19.9418 14.8456 19.1768 15.0502 18.399C15.2359 17.6934 15.3956 16.9772 15.5283 16.2516M19.4477 17.0583C19.8121 15.0944 20.0026 13.0694 20.0026 11C20.0026 6.58172 16.4209 3 12.0026 3C10.7472 3 9.55932 3.28918 8.50195 3.80456M3.52344 15.0245C3.83663 13.7343 4.00262 12.3865 4.00262 11C4.00262 9.25969 4.55832 7.64917 5.50195 6.33621M12.003 11C12.003 13.7604 11.5557 16.4163 10.7295 18.8992C10.5169 19.5381 10.2792 20.1655 10.0176 20.7803M7.71227 14.5C7.90323 13.3618 8.00262 12.1925 8.00262 11C8.00262 8.79086 9.79348 7 12.0026 7C14.2118 7 16.0026 8.79086 16.0026 11C16.0026 11.6166 15.9834 12.2287 15.9455 12.8357`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`,pathLength:`1`})}function ct(e){return c(l,{children:[c(`span`,{class:`loading-ellipsis`,"aria-hidden":`true`,children:[c(`span`,{class:`loading-ellipsis__dot`,children:`.`}),c(`span`,{class:`loading-ellipsis__dot`,children:`.`}),c(`span`,{class:`loading-ellipsis__dot`,children:`.`})]}),c(`span`,{class:`sr-only`,children:c(x,{copy:e.label})})]})}function lt(e,t){return`${e.trim().replace(/\/$/,``)}/address/${encodeURIComponent(t)}`}function ut(e){return c(`a`,{class:`highlight-receiver-id`,href:lt(e.base,e.address),target:`_blank`,rel:`noopener noreferrer`,children:e.children})}function dt(e){let t=e.trim();return/^0x[0-9a-fA-F]{40}$/.test(t)?`${t.slice(0,8)}...${t.slice(-4)}`:t}function ft(e){let t=e.label.trim().match(/^(Transaction(?:\s+\d+)?\s+to contract)\b/i);return t?`${t[1]} `:void 0}function pt(e){throw Error(`Unsupported transaction action: ${String(e)}`)}function R(e){let t=e.action;if(t)switch(t.type){case m.FunctionCall:return`Calling ${t.methodName} with ${D(t.deposit)} using ${ue(t.gas)}`;case m.Transfer:return`Transfer ${D(t.amount)}`;case m.CreateAccount:return`Creating Account`;case m.DeleteAccount:return`Deleting Account`;case m.Stake:return`Staking ${D(t.stake)}`;case m.AddKey:return`Adding Key`;case m.DeleteKey:return`Deleting Key`;case m.DeployContract:return`Deploying WASM contract`;case m.DeployGlobalContract:return`Deploy global WASM contract (mode: ${t.deployMode}, size ${k(t.code)})`;case m.UseGlobalContract:return t.accountId?`Use global contract by account ${t.accountId}`:t.codeHash?`Use global contract by hash ${t.codeHash}`:`Use global contract`;default:return pt(t)}if(e.transaction)return((e.totalTransactions??1)>1?`Transaction ${(e.transactionIndex??0)+1}: to `:`Transaction to `)+e.transaction.receiverId;let n=ft(e);return e.contractAddress?.trim()&&n?n+dt(e.contractAddress):e.label}function mt({node:e,explorers:t}){let n=e.action;if(n)switch(n.type){case m.FunctionCall:{let e=ue(n.gas),t=D(n.deposit);return c(l,{children:[c(x,{message:`Calling`}),` `,c(`span`,{class:`highlight-method-name`,children:n.methodName}),t!==`0 NEAR`&&c(l,{children:[` `,c(x,{message:`with`}),` `,c(`span`,{class:`highlight-method-name`,children:t})]}),e&&c(l,{children:[` `,c(x,{message:`using`}),` `,c(`span`,{class:`highlight-method-name`,children:e})]})]})}case m.Transfer:return c(l,{children:[c(x,{message:`Transfer`}),` `,c(`span`,{class:`highlight-amount`,children:D(n.amount)})]});case m.CreateAccount:return c(x,{message:`Creating Account`});case m.DeleteAccount:return c(x,{message:`Deleting Account`});case m.Stake:return c(x,{message:`Staking {value0}`,values:{value0:D(n.stake)}});case m.AddKey:return c(x,{message:`Adding Key`});case m.DeleteKey:return c(x,{message:`Deleting Key`});case m.DeployContract:return c(x,{message:`Deploying WASM contract ({value0})`,values:{value0:k(n.code)}});case m.DeployGlobalContract:return c(x,{copy:R(e)});case m.UseGlobalContract:return n.accountId?c(l,{children:[c(x,{message:`Use global contract`}),` `,c(ut,{base:t.near,address:n.accountId,children:n.accountId})]}):n.codeHash?c(l,{children:[c(x,{message:`Use global contract by hash`}),` `,c(`span`,{class:`highlight-method-name`,children:O(n.codeHash,{prefix:10,suffix:6})})]}):c(x,{message:`Use global contract`});default:return pt(n)}if(e.transaction)return c(l,{children:[c(x,{copy:(e.totalTransactions??1)>1?`Transaction ${(e.transactionIndex??0)+1}: to `:`Transaction to `}),c(ut,{base:t.near,address:e.transaction.receiverId,children:e.transaction.receiverId})]});let r=ft(e),i=e.contractAddress?.trim();if(i&&r){let n=e.chain&&e.chain!==`unknown`?t[e.chain]:void 0;return c(l,{children:[c(x,{copy:r}),n?c(ut,{base:n,address:i,children:dt(i)}):c(`span`,{class:`highlight-receiver-id`,children:dt(i)})]})}let a=e.label.trim();if(a.toLowerCase().startsWith(`calling `)){let e=a.slice(8).trim(),t=e.toLowerCase().indexOf(` using `);if(t<0&&e)return c(l,{children:[c(x,{message:`Calling`}),` `,c(`span`,{class:`highlight-method-name`,children:e})]});let n=e.slice(0,t).trim(),r=e.slice(t+7).trim();if(t>=0&&n)return c(l,{children:[c(x,{message:`Calling`}),` `,c(`span`,{class:`highlight-method-name`,children:n}),r&&c(l,{children:[c(x,{message:`using`}),` `,r]})]})}return e.fieldLabel?c(l,{children:[c(x,{copy:e.fieldLabel}),e.label.slice(e.fieldLabel.length)]}):c(x,{copy:e.label})}const z=[`anim-h`,`anim-h-active`,`anim-h-driven`],ht=[...z,`anim-h-hold`];let gt=0;function _t(){return c(`svg`,{class:`chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:c(`path`,{fill:`currentColor`,d:`M6 3l5 5-5 5z`})})}function vt(e){return!!e.contentVariants?.decoded&&!!e.contentVariants.raw&&e.contentVariants.decoded!==e.contentVariants.raw}function yt(e,t,n){return c(xt,{node:n,depth:t,styles:e.styles,explorers:e.explorers,onToggle:e.onToggle,onCopy:e.onCopy},n.id)}function bt(e){if(!e.node.children?.length)return null;let t=c(`div`,{class:`tooltip-tree-root`,children:c(`div`,{class:`tooltip-tree-children`,children:e.node.children.map(yt.bind(null,e,1))})});return c(`div`,{class:`seams-tx-tree`,"data-theme":e.theme,children:e.showShadow?c(`div`,{class:`tooltip-border-outer`,children:t}):t})}var xt=class extends o{static contextType=w;state={mode:this.props.node.contentVariants?.defaultMode===`raw`?`raw`:`decoded`,copied:!1};id=`seams-tree-node-${++gt}`;details=a();shell=a();disposed=!1;copiedTimer=null;frame=null;motionTimer=null;motion=null;modeHeight=null;componentDidUpdate(e){if(e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),this.modeHeight!==null&&this.shell.current){let e=this.shell.current,t=this.modeHeight;this.modeHeight=null,e.classList.remove(...z);let n=e.getBoundingClientRect().height;e.classList.add(...z),L({reason:`${this.props.node.id}:file-content-mode`,element:e,drivenClasses:z,fromCssPx:t,toCssPx:n,setHeightCssPx:this.setHeight,onSettled:this.releaseHeight})||(e.classList.remove(...z),this.releaseHeight())}}componentWillUnmount(){this.disposed=!0,this.copiedTimer!==null&&clearTimeout(this.copiedTimer),this.motionTimer!==null&&clearTimeout(this.motionTimer),this.frame!==null&&this.details.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame),this.motion?.body.removeEventListener(`transitionend`,this.onTransitionEnd),this.motion=null,this.releaseHeight()}setHeight=e=>{this.disposed||this.props.styles.setDynamicDeclarations(this.id,`#${this.id}`,{"--seams-tree__anim-target":`${e}px`})};releaseHeight=()=>{this.props.styles.deleteDynamicRule(this.id)};clearCopied=()=>{this.copiedTimer=null,this.disposed||this.setState({copied:!1})};copy=async e=>{e.preventDefault(),e.stopPropagation();let t=this.props.node.copyValue;if(!t)return;let n=e.currentTarget.closest(`.seams-tx-tree`);if(n)try{if(!await E(n,t)||this.disposed)return;this.copiedTimer!==null&&clearTimeout(this.copiedTimer),this.setState({copied:!0}),this.copiedTimer=setTimeout(this.clearCopied,2e3),this.props.onCopy?.(t)}catch{}};toggleMode=e=>{e.preventDefault(),e.stopPropagation(),vt(this.props.node)&&(this.shell.current&&(this.modeHeight=this.shell.current.getBoundingClientRect().height,this.setHeight(this.modeHeight),this.shell.current.classList.add(...z)),this.setState({mode:this.state.mode===`decoded`?`raw`:`decoded`}))};toggle=e=>{if(e.target.closest(`a, button`)){e.stopPropagation();return}e.preventDefault(),e.stopPropagation();let t=this.details.current;if(!t||this.motion)return;let n=t.querySelector(`:scope > .folder-children`),r=!t.open,i=t.ownerDocument.defaultView.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!n||i){t.open=r,this.props.onToggle?.(this.props.node.id,r);return}this.motion={body:n,open:r};let a=r?0:n.getBoundingClientRect().height;this.setHeight(a),n.classList.add(`anim-h`,`anim-h-active`,`anim-h-hold`),t.open=!0,n.offsetHeight,this.frame=t.ownerDocument.defaultView.requestAnimationFrame(this.startMotion)};startMotion=()=>{if(this.frame=null,!this.motion||this.disposed)return;let{body:e,open:t}=this.motion,n=e.getBoundingClientRect().height,r=t?e.scrollHeight:0;L({reason:this.props.node.id,element:e,drivenClasses:z,fromCssPx:n,toCssPx:r,setHeightCssPx:this.setHeight,onSettled:this.finishMotion})||(e.addEventListener(`transitionend`,this.onTransitionEnd),e.classList.remove(`anim-h-hold`),this.setHeight(r),this.motionTimer=setTimeout(this.finishMotion,t?200:250))};onTransitionEnd=e=>{e.target===this.motion?.body&&e.propertyName===`height`&&this.finishMotion()};finishMotion=()=>{if(this.disposed||!this.motion)return;let{body:e,open:t}=this.motion;this.motion=null,this.motionTimer!==null&&clearTimeout(this.motionTimer),this.motionTimer=null,e.removeEventListener(`transitionend`,this.onTransitionEnd),e.classList.remove(...ht),this.details.current&&(this.details.current.open=t),this.releaseHeight(),this.props.onToggle?.(this.props.node.id,t)};label(e){let t=this.props.node;return c(`span`,{class:`label${t.type===`file`?` label-action-node`:``}`,hidden:t.hideLabel,children:[e&&!t.hideChevron&&c(_t,{}),c(`span`,{class:`label-text`,title:T(this.context,R(t)),children:c(mt,{node:t,explorers:this.props.explorers})}),t.type===`file`&&t.copyValue&&c(`button`,{type:`button`,class:`copy-badge`,"data-copied":String(this.state.copied),onClick:this.copy,title:T(this.context,this.state.copied?`Copied`:`Copy`),children:this.state.copied?`copied`:`copy`})]})}render(){let{node:e,depth:t}=this.props,n=`row summary-row depth-${Math.max(0,t-1)}`;if(e.type===`file`&&!e.content)return c(`div`,{id:this.id,class:`row file-row depth-${Math.max(0,t-1)}`,"data-no-elbow":String(!!e.hideLabel),children:[c(`span`,{class:`indent`}),this.label(!1)]});let r=vt(e),i=r&&e.contentVariants?e.contentVariants[this.state.mode]:e.content,a=this.state.mode===`decoded`?`bytes`:`decoded`;return c(`details`,{id:this.id,ref:this.details,class:`tree-node ${e.type}`,open:!!e.open,"data-node-id":e.id,children:[c(`summary`,{class:n,"data-no-elbow":String(!!e.hideLabel),onClick:this.toggle,children:[c(`span`,{class:`indent`}),this.label(!0),e.type===`file`&&c(`div`,{ref:this.shell,class:`file-content-shell${r?` has-mode-toggle`:``}`,children:[r&&c(`button`,{type:`button`,class:`file-content-mode-toggle`,title:T(this.context,`Show ${a}`),"aria-label":T(this.context,`Show ${a}`),onClick:this.toggleMode,children:c(x,{copy:a})}),c(`div`,{class:`file-content`,children:i})]})]}),e.type===`folder`&&!!e.children?.length&&c(`div`,{class:`folder-children`,children:e.children.map(yt.bind(null,this.props,t+1))})]})}};let St=0;function B(e){e.stopPropagation()}var Ct=class extends o{static contextType=w;state={armed:!1};id=`seams-confirm-content-${++St}`;root=a();reflow;frame=null;capturedBeforeUpdate=!1;reflowEnabled=!0;constructor(e){super(e),this.reflow=Ke({reason:`tx-body`,element:this.getReflowElement,setHeightCssPx:this.setHeight})}getReflowElement=()=>{let e=this.root.current;return e?.closest(`.modal-container-root, .seams-confirmation-drawer`)??e};setHeight=e=>{let t=this.getReflowElement(),n=t?.id?`#${t.id}`:`#${this.id}`;this.props.styles.setDynamicDeclarations(this.id,n,{[We]:`${e}px`})};componentDidMount(){this.reflowEnabled=this.getReflowElement()===this.root.current,this.frame=this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.afterFirstPaint)}afterFirstPaint=()=>{this.frame=this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.arm)};arm=()=>{this.frame=null,this.setState({armed:!0})};componentWillReceiveProps(){this.reflowEnabled&&(this.reflow.capture(),this.capturedBeforeUpdate=!0)}componentWillUpdate(){this.reflowEnabled&&(this.capturedBeforeUpdate||this.reflow.capture())}componentDidUpdate(e){this.reflowEnabled&&(this.capturedBeforeUpdate=!1,e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),this.reflow.commit())}componentWillUnmount(){this.frame!==null&&this.root.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame),this.frame=null,this.reflow.dispose(),this.props.styles.deleteDynamicRule(this.id)}confirm=()=>{this.state.armed&&this.props.decision.kind===`ready`&&this.props.decision.onConfirm()};cancel=()=>{this.props.onCancel()};render(){let e=this.props.decision.kind===`preparing`;return c(`div`,{class:`seams-tx-confirm-content`,onPointerDown:B,onMouseDown:B,onTouchStart:B,children:c(`div`,{id:this.id,ref:this.root,class:`txc-root`,children:[this.props.errorMessage&&c(`div`,{class:`error`,role:`alert`,children:c(x,{copy:this.props.errorMessage})}),this.props.tree&&c(`div`,{class:`tooltip-width`,children:c(bt,{node:this.props.tree,theme:this.props.theme,explorers:this.props.explorers,styles:this.props.styles,showShadow:!1,onToggle:this.props.onTreeToggle,onCopy:this.props.onCopy})}),this.props.authMethodApprovalMessage&&c(`p`,{class:`seams-voiceid-instructions`,"data-seams-voice-id":`required`,role:`status`,children:this.props.authMethodApprovalMessage}),c(`div`,{class:`actions`,children:[!this.props.cancelInHeader&&c(`button`,{type:`button`,class:`cancel`,onClick:this.cancel,children:c(x,{copy:this.props.cancelText})}),c(`button`,{type:this.props.decision.kind===`form`?`submit`:`button`,form:this.props.decision.kind===`form`?this.props.decision.formId:void 0,class:`confirm${e?` loading`:``}`,onClick:this.confirm,disabled:e||!this.state.armed,children:e?c(l,{children:[c(`span`,{class:`loading-indicator`,role:`progressbar`,"aria-label":b(this.context,`Loading`)}),c(`span`,{children:c(x,{message:`Loading...`})})]}):c(l,{children:[this.props.confirmIcon,c(x,{copy:this.props.confirmText})]})})]})]})})}};function wt(e){throw Error(`Unexpected confirmation body: ${String(e)}`)}var Tt=class extends o{static contextType=w;copy=()=>{this.props.model.kind===`funding`&&this.props.onCopyAccount(this.props.model.accountId)};render(){let e=this.props.model;switch(e.kind){case`empty`:return null;case`text`:return c(`div`,{class:`confirmation-body`,children:c(x,{copy:e.text})});case`status`:return c(`div`,{class:`confirmation-body confirmation-body--status`,children:c(x,{copy:e.text})});case`funding`:return c(`div`,{class:`confirmation-body confirmation-body--funding`,children:[c(x,{message:`NEAR account`}),c(`button`,{type:`button`,class:`confirmation-body__copy-target`,title:T(this.context,`Copy ${e.accountId}`),"aria-label":T(this.context,`Copy NEAR account ${e.accountId}`),onClick:this.copy,children:e.shortAccountId}),c(x,{message:`needs funding`})]});default:return wt(e)}}};function Et(e){let t=y();return c(`div`,{class:`passkey-registration-confirm__identity`,"aria-label":b(t,`Passkey registration details`),children:[c(`div`,{class:`passkey-registration-confirm__row`,children:[c(`span`,{class:`passkey-registration-confirm__label`,children:c(x,{message:`Account`})}),c(`span`,{class:`passkey-registration-confirm__value`,title:T(t,e.display.intendedUserName),children:e.display.intendedUserName})]}),c(`div`,{class:`passkey-registration-confirm__row`,children:[c(`span`,{class:`passkey-registration-confirm__label`,children:c(x,{message:`Website`})}),c(`span`,{class:`passkey-registration-confirm__value`,title:T(t,e.display.rpId),children:e.display.rpId})]})]})}var Dt=class extends o{static contextType=w;confirm=()=>{this.props.decision.kind===`ready`&&this.props.decision.onConfirm()};cancel=()=>{this.props.onCancel()};render(){let e=this.props.decision.kind===`creating`;return c(`div`,{ref:this.props.root,class:`passkey-registration-confirm`,children:[c(`div`,{class:`hero passkey-registration-confirm__hero`,children:[c(at,{animated:!this.props.errorMessage,icon:`fingerprint`,size:44,styles:this.props.styles}),c(`div`,{class:`hero-container passkey-registration-confirm__hero-copy`,children:[c(`h2`,{class:`hero-heading`,children:c(x,{copy:this.props.heading})}),c(`p`,{class:`passkey-registration-confirm__body`,children:c(x,{copy:this.props.body})})]})]}),this.props.errorMessage&&c(`div`,{class:`error-banner`,children:c(x,{copy:this.props.errorMessage})}),c(Et,{display:this.props.display}),c(`div`,{class:`passkey-registration-confirm__actions`,children:[c(`button`,{type:`button`,class:`btn btn-cancel`,onClick:this.cancel,children:c(x,{copy:this.props.cancelText})}),c(`button`,{type:`button`,class:`btn btn-confirm`,disabled:e,onClick:this.confirm,children:e?c(l,{children:[c(`span`,{class:`loading-indicator passkey-registration-confirm__spinner`,role:`progressbar`,"aria-label":b(this.context,`Creating passkey`)}),c(`span`,{class:`passkey-registration-confirm__busy-label`,children:c(x,{message:`Creating passkey...`})})]}):c(x,{message:`Create passkey`})})]})]})}};let Ot=0;var kt=class extends o{id=`seams-email-code-${++Ot}`;input=e=>{this.props.state.kind===`editing`&&this.props.state.onInput(e.currentTarget.value)};resend=()=>{this.props.resend?.kind===`available`&&this.props.resend.onResend()};renderDigit=e=>{let t=this.props.code[e]||``;return c(`span`,{class:`email-otp-confirm__slot${t?` is-filled`:``}`,children:t},e)};render(){let e=this.props.state.kind!==`editing`,t=`${this.id}-helper`,n=`${this.id}-error`;return c(`div`,{class:`email-otp-confirm`,children:[c(`label`,{class:`email-otp-confirm__label`,for:this.id,children:c(x,{message:`Email code`})}),c(`div`,{class:`email-otp-confirm__code-field`,"data-disabled":e?`true`:`false`,children:[c(`input`,{id:this.id,name:`email-code`,type:`text`,class:`email-otp-confirm__input`,inputMode:`numeric`,autoComplete:`one-time-code`,"data-email-otp-challenge-id":this.props.challengeId,pattern:`[0-9]*`,maxLength:6,spellcheck:!1,value:this.props.code,disabled:e,onInput:this.input,"aria-invalid":this.props.errorMessage?`true`:void 0,"aria-describedby":this.props.errorMessage?`${t} ${n}`:t}),c(`div`,{class:`email-otp-confirm__slots${e?` is-submitting`:``}`,"aria-hidden":`true`,children:[0,1,2,3,4,5].map(this.renderDigit)})]}),c(`div`,{id:t,class:`email-otp-confirm__helper`,children:c(x,{copy:this.props.helperText})}),this.props.errorMessage&&c(`div`,{id:n,class:`email-otp-confirm__error`,children:c(x,{copy:this.props.errorMessage})}),this.props.resend&&c(`button`,{type:`button`,class:`email-otp-confirm__resend`,disabled:this.props.resend.kind===`unavailable`,onClick:this.resend,children:c(x,{copy:this.props.resend.label})})]})}},At=class{codeState={kind:`editing`,code:``};resendState={kind:`available`,label:`Resend code`};error=``;countdown=null;options;constructor(e){this.options=e}input=e=>{if(this.codeState.kind!==`editing`)return;let t=e.replace(/\D/g,``).slice(0,6);this.error=``,this.codeState={kind:`editing`,code:t},t.length===6?this.confirm():this.publish()};confirm(){if(this.codeState.kind!==`editing`)return`ignored`;let e=this.codeState.code;return e.length===6?(this.error=``,this.codeState={kind:`fading`,code:e,timer:setTimeout(this.submit,150)},this.publish(),`accepted`):(this.error=`Enter the 6-digit Email OTP code.`,this.publish(),`invalid`)}submit=()=>{if(this.codeState.kind!==`fading`)return;let e=this.codeState.code;this.codeState={kind:`submitting`,code:e},this.publish(),this.isDisposed()||this.options.onSubmit(e)};retry(e){this.codeState.kind!==`disposed`&&(this.cancelFade(),this.codeState={kind:`editing`,code:this.codeState.code},this.error=e,this.publish())}setVerification(e){if(this.codeState.kind!==`disposed`)switch(e.kind){case`ready`:this.codeState.kind===`submitting`&&this.retry(``);return;case`pending`:this.cancelFade(),this.codeState={kind:`submitting`,code:this.codeState.code},this.publish();return;case`rejected`:this.retry(e.message);return}}resend=async()=>{if(this.codeState.kind!==`editing`||this.resendState.kind!==`available`)return;let e=this.options.resend;if(!e)return;let t=Date.now()+e.cooldownMs,n={kind:`sending`,until:t};if(this.resendState=n,this.error=``,this.publish(),this.isDisposed())return;let r;try{r=await e.send()}catch{r={kind:`failed`,message:`Could not send code.`}}if(this.isDisposed()||this.resendState!==n)return;let i=r.kind===`sent`?`Code sent`:`Resend code`;r.kind===`failed`&&(this.error=r.message),Date.now()>=t?this.resendState={kind:`available`,label:i}:(this.resendState={kind:`cooldown`,until:t,label:i},this.countdown=setInterval(this.tick,250)),this.publish()};tick=()=>{this.resendState.kind===`cooldown`&&(Date.now()>=this.resendState.until&&(this.resendState={kind:`available`,label:this.resendState.label},this.clearCountdown()),this.publish())};isDisposed(){return this.codeState.kind===`disposed`}publish(){this.codeState.kind!==`disposed`&&this.options.onChange({code:this.codeState.code,phase:this.codeState.kind,error:this.error,resend:this.options.resend?this.resendSnapshot():null})}resendSnapshot(){switch(this.resendState.kind){case`available`:return{available:this.codeState.kind===`editing`,label:this.resendState.label};case`sending`:return{available:!1,label:`Sending...`};case`cooldown`:return{available:!1,label:`Resend in ${Math.max(1,Math.ceil((this.resendState.until-Date.now())/1e3))}s`}}}cancelFade(){this.codeState.kind===`fading`&&clearTimeout(this.codeState.timer)}clearCountdown(){this.countdown!==null&&clearInterval(this.countdown),this.countdown=null}dispose(){this.cancelFade(),this.clearCountdown(),this.codeState={kind:`disposed`},this.error=``}};function jt(e){return c(Mt,{...e},e.prompt.challengeId)}var Mt=class extends o{static contextType=w;session;form=a();lifetime;constructor(e){super(e),this.lifetime={kind:`active`,challengeId:e.prompt.challengeId,emailHint:e.prompt.emailHint?.trim()||``},this.state={code:``,phase:`editing`,error:``,resend:e.prompt.onResend?{available:!0,label:`Resend code`}:null},this.session=new At({onSubmit:this.submit,onChange:this.change,resend:e.prompt.onResend?{send:this.send,cooldownMs:Math.max(1e3,Math.floor(Number(e.prompt.resendDebounceMs)||1e4))}:null})}submit=e=>{this.lifetime.kind===`active`&&this.props.onSubmit(e,this.lifetime.challengeId)};send=async()=>{let e=this.props.prompt.onResend;if(!e)return{kind:`failed`,message:`Could not send code.`};try{let t=await e();if(this.lifetime.kind===`disposed`)return{kind:`sent`};let n=String(t?.challengeId||``).trim(),r=String(t?.emailHint||``).trim();return n&&(this.lifetime={kind:`active`,challengeId:n,emailHint:r||this.lifetime.emailHint}),{kind:`sent`}}catch(e){return{kind:`failed`,message:Pt(e)}}};change=e=>{this.setState(e)};confirm=e=>{e.preventDefault(),e.stopPropagation(),this.session.confirm()===`invalid`&&this.setState({},this.focusCode)};focusCode=()=>{this.form.current?.querySelector(`input`)?.focus({preventScroll:!0})};componentDidMount(){this.session.setVerification(this.props.verification)}componentDidUpdate(e){Nt(e.verification,this.props.verification)&&this.session.setVerification(this.props.verification)}componentWillUnmount(){this.lifetime={kind:`disposed`},this.session.dispose()}inputState(){switch(this.state.phase){case`editing`:return{kind:`editing`,onInput:this.session.input};case`fading`:return{kind:`fading`};case`submitting`:return{kind:`submitting`}}}resendAction(){let e=this.state.resend;return e?e.available?{kind:`available`,label:e.label,onResend:this.session.resend}:{kind:`unavailable`,label:e.label}:null}render(){return c(`form`,{ref:this.form,id:this.props.formId,onSubmit:this.confirm,noValidate:!0,children:c(kt,{challengeId:this.lifetime.kind===`active`?this.lifetime.challengeId:``,code:this.state.code,helperText:this.props.prompt.helperText?.trim()||_(this.lifetime.kind===`active`?this.lifetime.emailHint:``),errorMessage:T(this.context,this.state.error||void 0),state:this.inputState(),resend:this.resendAction()})})}};function Nt(e,t){return e.kind===t.kind?e.kind===`rejected`&&t.kind===`rejected`&&e.message!==t.message:!0}function Pt(e){if(e&&typeof e==`object`&&`code`in e&&e.code===`rate_limited`){let t=`retryAfterMs`in e?Number(e.retryAfterMs):NaN;return Number.isFinite(t)&&t>0?`Too many requests. Try again in ${Math.max(1,Math.ceil(t/1e3))}s.`:`Too many requests. Try again shortly.`}return e instanceof Error&&e.message?e.message:`Could not send code.`}let Ft=0;var V=class extends o{root=a();id=`seams-review-disclosure-${++Ft}`;componentDidMount(){this.root.current&&(this.root.current.open=this.props.initiallyOpen??!1)}motion=null;componentWillUnmount(){this.clearMotion(),this.root.current&&S(this.root.current.ownerDocument).deleteDynamicRule(this.id)}clearMotion(){this.motion&&(this.motion.kind===`local`&&(this.motion.size.onfinish=null,this.motion.size.cancel(),this.motion.fade.cancel()),this.motion=null,this.root.current?.removeAttribute(`data-resizing`))}setHeight=e=>{let t=this.root.current;t&&S(t.ownerDocument).setDynamicDeclarations(this.id,`#${this.id}`,{"--seams-review-disclosure-height":`${e}px`})};finish=()=>{let e=this.motion?.kind===`local`;if(this.root.current&&this.motion&&(this.root.current.open=this.motion.opening,this.root.current.removeAttribute(`data-closing`)),this.clearMotion(),e){let e=this.root.current?.closest(`.seams-confirmation-surface`),t=e?.ownerDocument.activeElement;if(t instanceof HTMLElement&&t.tabIndex>=0&&e?.contains(t)){let e=t.getBoundingClientRect(),n=t.ownerDocument.documentElement.clientHeight;(e.top<0||e.bottom>n)&&t.scrollIntoView({block:`center`,inline:`nearest`})}}};toggle=e=>{let t=this.root.current;if(!t||(e.preventDefault(),this.motion?.kind===`hosted`))return;let n=this.motion?!this.motion.opening:!t.open,r=t.lastElementChild;if(!(r instanceof HTMLElement))return;let i=t.open?r.getBoundingClientRect().height:0;if(this.clearMotion(),t.toggleAttribute(`data-closing`,!n),window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||!t.animate){t.open=n,t.removeAttribute(`data-closing`);return}t.open=!0,t.setAttribute(`data-resizing`,``);let a=n?r.scrollHeight:0;if(this.motion={kind:`hosted`,opening:n},L({element:r,reason:`review-details`,fromCssPx:i,toCssPx:a,drivenClasses:[`seams-review-disclosure-driven`],setHeightCssPx:this.setHeight,onSettled:this.finish}))return;let o=r.animate([{height:`${i}px`,overflow:`hidden`},{height:`${a}px`,overflow:`hidden`}],{duration:n?220:180,easing:`cubic-bezier(.2,0,0,1)`,fill:`both`});this.motion={kind:`local`,opening:n,size:o,fade:r.animate(n?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],{duration:n?180:100,easing:`ease-out`,fill:`both`})},o.onfinish=this.finish};render(){return c(`details`,{ref:this.root,class:`seams-review-${this.props.kind??`technical`}`,children:[c(`summary`,{onClick:this.toggle,children:[c(x,{copy:this.props.label}),c(`svg`,{class:`seams-review-caret`,viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:c(`path`,{d:`m5 7.5 5 5 5-5`})})]}),c(`div`,{id:this.id,children:this.props.children})]})}};function H({kind:e}){let t={back:`m15 6-6 6 6 6`,close:`M6 6l12 12M6 18L18 6`,minimize:`M5 12h14`,check:`m5 12 4 4L19 6`,arrow:`M7 17 17 7M7 7h10v10`,copy:`M8 8h12v12H8ZM4 16V4h12`,loader:`M12 3a9 9 0 1 1-9 9`,alert:`M12 8v5m0 3v.1M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0`,fingerprint:`M6.405 19.048c.184-.443.353-.894.507-1.351M14.343 20.693c.266-.751.502-1.516.707-2.294.186-.706.346-1.422.478-2.147M19.448 17.058c.364-1.964.555-3.989.555-6.058 0-4.418-3.582-8-8-8-1.255 0-2.443.289-3.501.805M3.523 15.025c.314-1.29.48-2.638.48-4.025 0-1.74.556-3.351 1.499-4.664M12.003 11c0 2.76-.447 5.416-1.273 7.899-.213.639-.451 1.266-.712 1.881M7.712 14.5c.191-1.138.291-2.308.291-3.5 0-2.209 1.791-4 4-4s4 1.791 4 4c0 .617-.02 1.229-.058 1.836`};return c(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:c(`path`,{d:t[e]})})}function U(e){return e?e.chain===`evm`&&e.chainId===5042?`Arc`:e.chain===`evm`&&e.chainId===5042002?`Arc Testnet`:e.chain===`evm`&&e.chainId===8453?`Base`:e.chain===`evm`&&e.chainId===84532?`Base Sepolia`:e.chain===`evm`&&e.chainId===1?`Ethereum`:e.chain===`evm`&&e.chainId===11155111?`Ethereum Sepolia`:`${e.chain.toUpperCase()}${e.chainId?` · ${e.chainId}`:``}`:`Wallet transaction`}function It(e){if(e?.operations.length!==1)return null;let t=e.operations[0];return t.kind===`generic.contractCall`||t.kind===`tempo.eip2718`?t.to??null:null}function Lt({value:e,class:t}){let n=y();return c(`bdi`,{class:`seams-review-middle ${t}`,dir:`ltr`,title:T(n,e),children:[c(`span`,{children:e.slice(0,-8)}),c(`span`,{children:e.slice(-8)})]})}function Rt({symbol:e}){return e===`NEAR`?c(`svg`,{class:`seams-review-token`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[c(`circle`,{cx:`24`,cy:`24`,r:`24`,fill:`#000`}),c(`svg`,{x:`9`,y:`9`,width:`30`,height:`30`,viewBox:`108 108 351 351`,children:c(`path`,{d:`m421.61,108c-13,0-25.07,6.74-31.88,17.82l-73.37,108.93c-2.39,3.59-1.42,8.43,2.17,10.82,2.91,1.94,6.76,1.7,9.41-.58l72.22-62.64c1.2-1.08,3.05-.97,4.13.23.49.55.75,1.26.75,1.99v196.12c0,1.62-1.31,2.92-2.93,2.92-.87,0-1.69-.38-2.24-1.05L181.56,121.24c-7.11-8.39-17.55-13.23-28.54-13.24h-7.63c-20.65,0-37.39,16.74-37.39,37.39v276.22c0,20.65,16.74,37.39,37.39,37.39,13,0,25.07-6.74,31.88-17.82l73.37-108.93c2.39-3.59,1.42-8.43-2.17-10.82-2.91-1.94-6.76-1.7-9.41.58l-72.22,62.64c-1.2,1.08-3.05.97-4.13-.23-.49-.55-.75-1.26-.74-1.99v-196.17c0-1.62,1.31-2.92,2.93-2.92.86,0,1.69.38,2.24,1.05l218.28,261.37c7.11,8.39,17.55,13.23,28.54,13.24h7.63c20.65.01,37.4-16.72,37.42-37.37V145.39c0-20.65-16.74-37.39-37.39-37.39Z`,fill:`#fff`})})]}):e===`ETH`?c(`svg`,{class:`seams-review-token`,viewBox:`0 0 42 42`,"aria-hidden":`true`,children:[c(`circle`,{cx:`21`,cy:`21`,r:`21`,fill:`#eef0fb`}),c(`path`,{d:`m21 6-9 15 9 5 9-5Z`,fill:`#627eea`}),c(`path`,{d:`m21 6 9 15-9 5Z`,fill:`#465da9`}),c(`path`,{d:`m12 23 9 13 9-13-9 5Z`,fill:`#627eea`})]}):e===`USDC`?c(`svg`,{class:`seams-review-token`,viewBox:`0 0 96 96`,fill:`none`,"aria-hidden":`true`,children:[c(`path`,{d:`M48 95C73.9574 95 95 73.9574 95 48C95 22.0426 73.9574 1 48 1C22.0426 1 1 22.0426 1 48C1 73.9574 22.0426 95 48 95Z`,fill:`#0B53BF`}),c(`path`,{d:`M56.4609 13.7778V19.8291C68.5341 23.4716 77.3759 34.6928 77.3759 47.9997C77.3759 61.3066 68.5341 72.5278 56.4609 76.1703V82.2216C71.8534 78.4616 83.2509 64.5672 83.2509 47.9997C83.2509 31.4322 71.8534 17.5378 56.4609 13.7778Z`,fill:`white`}),c(`path`,{d:`M18.625 47.9997C18.625 34.6928 27.4669 23.4716 39.54 19.8291V13.7778C24.1475 17.5378 12.75 31.4322 12.75 47.9997C12.75 64.5672 24.1475 78.4616 39.54 82.2216V76.1703C27.4669 72.5572 18.625 61.3066 18.625 47.9997Z`,fill:`white`}),c(`path`,{d:`M60.6319 54.5506C60.6319 42.5362 41.8025 47.4713 41.8025 40.8325C41.8025 38.4531 43.7119 36.9256 47.3544 36.9256C51.7019 36.9256 53.2 39.0406 53.67 41.89H59.6625C59.1279 36.5426 56.0588 33.1662 50.9382 32.1604V27.4375H45.0632V31.9918C39.4534 32.7062 35.9275 35.973 35.9275 40.8325C35.9275 52.9056 54.7863 48.3819 54.7863 54.9031C54.7863 57.3706 52.4069 59.0156 48.3825 59.0156C43.1244 59.0156 41.3913 56.695 40.745 53.4931H34.8994C35.2781 59.3502 38.8897 63.0159 45.0632 63.9307V68.5625H50.9382V63.9923C56.9633 63.2139 60.6319 59.7089 60.6319 54.5506Z`,fill:`white`})]}):c(`span`,{class:`seams-review-token seams-review-token-fallback`,"aria-hidden":`true`,children:e.slice(0,1)})}function zt({model:e,compact:t=!1}){let n=Vt(e);return n?c(`div`,{class:`seams-review-amount${t?` seams-review-amount--compact`:``}`,children:[c(Rt,{symbol:n.symbol}),c(`div`,{children:[c(`span`,{children:n.value}),` `,c(`small`,{children:n.symbol})]})]}):null}function W(){return c(`div`,{class:`seams-receipt-footer`,children:[c(`span`,{children:c(x,{message:`Secured by`})}),` `,c(u,{})]})}function Bt(e,t){if(!/^\d+$/.test(e))return e;let n=e.padStart(t+1,`0`),r=n.slice(-t).replace(/0+$/,``);return`${n.slice(0,-t)}${r?`.${r}`:``}`}function Vt(e){let t=e?.totals;return t?.nativeValue?t.nativeSymbol===`yoctoNEAR`?{value:Bt(t.nativeValue,24),symbol:`NEAR`}:e?.chain===`evm`&&(e.chainId===5042||e.chainId===5042002)&&t.nativeSymbol===`wei`?{value:Bt(t.nativeValue,18),symbol:`USDC`}:{value:t.nativeValue,symbol:t.nativeSymbol??``}:null}var G=class extends o{static contextType=w;state={copied:!1};lifetime=new AbortController;timer=null;resetCopied=()=>{this.setState({copied:!1})};componentWillUnmount(){this.lifetime.abort(),this.timer!==null&&clearTimeout(this.timer)}componentDidUpdate(e){e.value!==this.props.value&&(this.lifetime.abort(),this.lifetime=new AbortController,this.timer!==null&&clearTimeout(this.timer),this.resetCopied())}copy=async e=>{let t=e.currentTarget;if(!(t instanceof HTMLElement))return;let n=this.lifetime.signal;try{if(!await E(t,this.props.value,n)||n.aborted)return;this.setState({copied:!0}),this.timer!==null&&clearTimeout(this.timer),this.timer=setTimeout(this.resetCopied,3e3)}catch{n.aborted||this.setState({copied:!1})}};render(){return c(`button`,{type:`button`,class:`seams-review-copy${this.props.address?` seams-review-copy-address`:``}${this.state.copied?` copied`:``}`,onClick:this.copy,"aria-label":T(this.context,this.state.copied?`Copied`:this.props.label??`Copy value`),children:[this.props.address&&c(`bdi`,{class:`seams-review-full-address`,dir:`ltr`,children:this.props.value}),c(ne,{})]})}};function Ht({node:e}){let t=y();if(e.action||e.transaction)return c(l,{children:c(x,{copy:R(e)})});let n=ft(e);if(n&&e.contractAddress){let r=e.contractAddress;return c(`span`,{class:`seams-review-contract`,children:[c(x,{copy:n.trim()}),c(`span`,{class:`seams-review-contract-value`,children:[c(Lt,{value:r,class:`seams-review-contract-address`}),c(G,{value:r,label:T(t,`Copy contract address ${r}`)})]})]})}if(e.fieldLabel){let t=e.label.slice(e.fieldLabel.length);return c(l,{children:[c(x,{copy:e.fieldLabel}),e.fieldLabel===`Method:`?c(`span`,{class:`seams-review-function`,children:t}):t]})}let r=/^(Call(?:ing)? )([^\s]+)(.*)$/.exec(e.label);return r?c(l,{children:[c(x,{copy:r[1]}),c(`span`,{class:`seams-review-function`,children:r[2]}),r[3]]}):c(l,{children:c(x,{copy:e.label})})}function Ut({node:e}){let t=y(),n=e.contentVariants?.decoded??e.content,r=!!(e.contentVariants||n?.includes(`
2
+ `));return c(`div`,{class:`seams-review-detail`,children:[c(`div`,{class:n?`seams-review-detail-row${r?` seams-review-detail-row--block`:``}`:`seams-review-detail-label`,children:[c(`span`,{children:c(Ht,{node:e})}),n&&c(`pre`,{children:n}),e.copyValue&&c(G,{value:e.copyValue})]}),e.contentVariants&&c(V,{label:b(t,`Raw data`),kind:`raw`,children:c(`pre`,{children:e.contentVariants.raw})}),!!e.children?.length&&c(`div`,{class:`seams-review-detail-children`,children:e.children?.map(e=>c(Ut,{node:e},e.id))})]})}function Wt({data:e,details:t=!0}){let n=y(),r=e.model,i=r?.operations[0],a=It(r);return c(`div`,{class:`seams-transaction-review`,children:[c(zt,{model:r}),r?.warnings?.map(e=>c(`div`,{class:`seams-review-warning`,role:`alert`,children:c(x,{copy:e.message})},e.code)),c(`dl`,{class:`seams-review-fields`,children:[a&&c(`div`,{children:[c(`dt`,{children:c(x,{message:`To`})}),c(`dd`,{class:`seams-review-recipient`,children:c(G,{value:a,address:!0,label:T(n,`Copy recipient address ${a}`)})})]}),r&&c(`div`,{children:[c(`dt`,{children:c(x,{message:`Network`})}),c(`dd`,{children:[c(`span`,{class:`seams-review-network-dot`}),U(r)]})]}),r?.totals?.estimatedFee&&c(`div`,{children:[c(`dt`,{children:c(x,{message:`Estimated network fee`})}),c(`dd`,{children:[r.totals.estimatedFee,` `,r.totals.feeSymbol]})]})]}),t&&e.tree&&c(V,{initiallyOpen:e.detailsInitiallyOpen,label:T(n,i?.kind===`near.message`?`Message details`:`Transaction details`),children:c(Ut,{node:e.tree})}),r?.signerAccount&&c(`div`,{class:`seams-review-account`,children:[c(`span`,{class:`seams-review-avatar`,"aria-hidden":`true`,children:`S`}),c(`div`,{children:[c(x,{message:`Signing account`}),c(`small`,{children:c(G,{value:r.signerAccount,address:!0,label:T(n,`Copy signing account address ${r.signerAccount}`)})})]})]})]})}let Gt=0;var Kt=class extends o{static contextType=w;root=a();otpFormId=`seams-confirmation-email-${++Gt}`;reflowId=`seams-confirmation-content-surface-${Gt}`;getReflowElement=()=>this.root.current?.closest(`.modal-container-root, .seams-confirmation-drawer`)??null;setHeight=e=>{let t=this.getReflowElement();t?.id&&this.props.styles.setDynamicDeclarations(this.reflowId,`#${t.id}`,{[We]:`${e}px`})};reflow=Ke({reason:`confirm-body`,element:this.getReflowElement,setHeightCssPx:this.setHeight});copyAccount=e=>{let t=this.root.current;t&&E(t,e).catch(qt)};componentWillReceiveProps(){this.reflow.capture()}componentDidUpdate(e){e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.reflowId),this.reflow.commit()}componentWillUnmount(){this.reflow.dispose(),this.props.styles.deleteDynamicRule(this.reflowId)}render(){let e=this.props.model;switch(e.kind){case`registration`:return c(Dt,{...e.registration,root:this.root,styles:this.props.styles});case`transaction`:return this.renderTransaction(e);default:return Jt(e)}}renderTransaction(e){let t=this.props.variant===`drawer`?`seams-confirmation-content seams-confirmation-content--drawer`:`seams-confirmation-content`,n=e.prompt.kind===`email`&&e.transaction.decision.kind===`ready`?{kind:`form`,formId:this.otpFormId}:e.transaction.decision;return e.capture?c(`div`,{ref:this.root,class:t,children:c(`div`,{class:`seams-review-content seams-review-content--capture`,children:[this.props.variant!==`drawer`&&this.renderToolbar(e,n),c(Yt,{element:e.capture}),c(W,{})]})}):c(`div`,{ref:this.root,class:t,children:c(`div`,{class:`seams-review-content`,children:[this.props.variant!==`drawer`&&this.renderToolbar(e,n),e.review.model&&c(`div`,{class:`seams-review-eyebrow`,children:e.review.model.operations.length===1?c(x,{copy:e.review.model.operations[0].label.replace(/\s+using\s+[\d,.]+\s+gas$/i,``)}):c(x,{message:`Transaction`})}),c(`h2`,{class:`seams-review-title`,children:c(x,{copy:e.header.heading})}),c(Wt,{data:e.review}),c(`div`,{class:`seams-review-context`,children:[c(Tt,{model:e.body,onCopyAccount:this.copyAccount}),e.prompt.kind===`email`&&c(jt,{...e.prompt.email,formId:this.otpFormId})]}),c(Ct,{...e.transaction,tree:null,styles:this.props.styles,decision:n,cancelInHeader:!0,confirmIcon:e.prompt.kind===`passkey`?c(H,{kind:`fingerprint`}):void 0}),c(W,{})]})})}renderToolbar(e,t){return c(`div`,{class:`seams-review-toolbar`,children:[c(`div`,{class:`seams-review-origin`,children:[e.transaction.onBack&&c(`button`,{type:`button`,"aria-label":b(this.context,`Back to review`),title:b(this.context,`Back to review`),disabled:t.kind===`preparing`,onClick:e.transaction.onBack,children:c(H,{kind:`back`})}),c(nt,{}),e.header.website.kind===`ready`?e.header.website.text:c(ct,{label:b(this.context,`Loading website`)})]}),c(`button`,{type:`button`,"aria-label":T(this.context,e.transaction.cancelText),onClick:e.transaction.onCancel,children:c(H,{kind:`close`})})]})}};function qt(){}function Jt(e){throw Error(`Unexpected confirmation content: ${String(e)}`)}var Yt=class extends o{container=a();componentDidMount(){this.container.current?.append(this.props.element),this.props.element.querySelector(`button`)?.focus()}componentDidUpdate(e){e.element!==this.props.element&&this.container.current?.replaceChildren(this.props.element)}componentWillUnmount(){this.props.element.remove()}render(){return c(`div`,{ref:this.container,class:`seams-auth-method-capture`})}};function K(e){let{kind:t}=e.state;return t===`signing`||t===`broadcasting`||t===`submitted`}function Xt(e){return e.state.kind===`confirmed`||e.state.kind===`signed`}function Zt(e){if(e.subject===`message`)return e.state.kind===`signed`?3:0;let{state:t}=e;switch(t.kind){case`signing`:return 0;case`signed`:case`broadcasting`:return 1;case`submitted`:case`reverted`:return 2;case`confirmed`:return 3;case`failed`:case`unknown`:return t.hash?2:0;default:return q(t)}}function Qt(e){return e.subject===`message`?`Message signature`:`Transaction receipt`}function $t(e){if(e.subject===`message`)return tn(e.state);let{state:t}=e;switch(t.kind){case`signing`:return`Signing transaction`;case`signed`:return`Signature ready`;case`broadcasting`:return`Broadcasting transaction`;case`submitted`:return`Waiting for confirmation`;case`confirmed`:return`Transaction complete`;case`failed`:return`Transaction failed`;case`reverted`:return`Transaction reverted`;case`unknown`:return`Confirmation unavailable`;default:return q(t)}}function en(e){if(e.subject===`message`)return nn(e.state);let{state:t}=e;switch(t.kind){case`signing`:return`Preparing your signed transaction.`;case`signed`:return`Signature created, ready to broadcast.`;case`broadcasting`:return`Submitting your signed transaction to the network.`;case`submitted`:return`Submitted to the network. Waiting for the receipt.`;case`confirmed`:return`The network confirmed your transaction.`;case`failed`:case`reverted`:case`unknown`:return t.message;default:return q(t)}}function tn(e){switch(e.kind){case`signing`:return`Signing message`;case`signed`:return`Message signed`;case`failed`:return`Signature failed`;default:return q(e)}}function nn(e){switch(e.kind){case`signing`:return`Preparing your message signature.`;case`signed`:return`Signed off-chain. Nothing was sent to the network.`;case`failed`:return e.message;default:return q(e)}}function q(e){throw Error(`Unexpected transaction receipt state: ${String(e)}`)}const rn=`cubic-bezier(0.22, 1, 0.36, 1)`;let an=0;var on=class extends o{static contextType=w;explorerRow=a();explorerRowId=`seams-receipt-explorer-row-${++an}`;minimize=()=>{this.props.receipt.onView(`toast`)};expand=()=>{this.props.receipt.onView(`expanded`)};close=()=>{K(this.props.receipt)?this.minimize():this.props.receipt.onDismiss()};componentDidUpdate(e){let{receipt:t}=this.props;t.view===`expanded`&&e.receipt.view===`expanded`&&t.subject===`transaction`&&t.state.kind===`confirmed`&&e.receipt.state.kind!==`confirmed`&&this.revealExplorerLink()}componentWillUnmount(){this.releaseExplorerRow()}setExplorerRowHeight=e=>{let t=this.explorerRow.current;t&&S(t.ownerDocument).setDynamicDeclarations(this.explorerRowId,`#${this.explorerRowId}`,{"--seams-receipt-explorer-height":`${e}px`})};releaseExplorerRow=()=>{let e=this.explorerRow.current;e&&(delete e.dataset.opening,S(e.ownerDocument).deleteDynamicRule(this.explorerRowId))};revealExplorerLink(){let e=this.explorerRow.current,t=e?.firstElementChild;if(!e||!t||e.ownerDocument.defaultView?.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let n=e.getBoundingClientRect().height;e.dataset.opening=``;let r=()=>{this.releaseExplorerRow(),t.animate([{opacity:0,filter:`blur(4px)`,transform:`translateY(6px)`},{opacity:1,filter:`blur(0)`,transform:`translateY(0)`}],{duration:240,easing:rn})};if(!L({reason:`receipt-explorer`,element:e,fromCssPx:0,toCssPx:n,drivenClasses:[`seams-receipt-explorer-driven`],setHeightCssPx:this.setExplorerRowHeight,onSettled:r})){let t=e.animate([{height:`0px`},{height:`${n}px`}],{duration:240,easing:rn});t.onfinish=r,t.oncancel=this.releaseExplorerRow}}render(){let{receipt:e,data:t}=this.props,n=$t(e),r=Xt(e),i=K(e),a=Zt(e),o=It(t.model),s=e.subject===`transaction`?e.state:null,u=s?.kind===`confirmed`&&s.hash?sn(t.model,this.props.explorers,s.hash):null;return e.view===`toast`?c(`div`,{class:`seams-transaction-toast`,"data-completed-stages":a,"data-stage":e.state.kind,"data-pending":i,children:[c(`div`,{class:`seams-toast-progress`,"aria-hidden":`true`,children:c(`span`,{class:`seams-toast-progress-fill`,children:i&&c(`span`,{class:`seams-toast-progress-active`})})}),c(`span`,{class:`seams-receipt-symbol`,"data-pending":i,children:c(H,{kind:i?`loader`:r?`check`:`alert`})}),c(`div`,{class:`seams-transaction-toast-text`,children:[c(`strong`,{role:`status`,children:c(x,{copy:n})}),c(`span`,{children:U(t.model)})]}),c(`button`,{type:`button`,class:`seams-receipt-open`,onClick:this.expand,children:[c(x,{message:`Open`}),` `,c(H,{kind:`arrow`})]}),!i&&c(`button`,{type:`button`,class:`seams-receipt-dismiss`,"aria-label":b(this.context,`Close transaction`),onClick:e.onDismiss,children:c(H,{kind:`close`})})]}):c(`div`,{class:`seams-transaction-receipt`,children:[c(`div`,{class:`seams-review-toolbar`,children:[c(`span`,{children:c(x,{copy:Qt(e)})}),c(`button`,{type:`button`,"aria-label":b(this.context,`Minimize transaction`),onClick:this.minimize,children:c(H,{kind:`minimize`})})]}),c(`div`,{class:`seams-receipt-heading`,children:[c(`span`,{class:`seams-receipt-symbol`,"data-pending":i,children:c(H,{kind:i?`loader`:r?`check`:`alert`})}),c(`div`,{children:[c(`h2`,{role:`status`,children:c(x,{copy:n})}),c(`p`,{children:c(x,{copy:en(e)})})]})]}),c(zt,{model:t.model,compact:!0}),c(`div`,{class:`seams-receipt-destination`,children:[o&&c(l,{children:[c(x,{message:`To`}),` `,c(G,{value:o,address:!0,label:T(this.context,`Copy recipient address ${o}`)})]}),!o&&U(t.model)]}),t.model?.totals?.estimatedFee&&c(`dl`,{class:`seams-review-fields`,children:c(`div`,{children:[c(`dt`,{children:c(x,{message:`Estimated network fee`})}),c(`dd`,{children:[t.model.totals.estimatedFee,` `,t.model.totals.feeSymbol]})]})}),s?c(ln,{state:s}):e.subject===`message`&&c(un,{state:e.state}),c(V,{label:b(this.context,`Receipt details`),children:c(`dl`,{class:`seams-review-fields`,children:[s&&t.model?.signerAccount&&c(`div`,{children:[c(`dt`,{children:c(x,{message:`From`})}),c(`dd`,{class:`seams-review-recipient`,children:c(G,{value:t.model.signerAccount,address:!0,label:T(this.context,`Copy signer address ${t.model.signerAccount}`)})})]}),o&&c(`div`,{children:[c(`dt`,{children:[c(x,{message:`To`}),` `]}),c(`dd`,{class:`seams-review-recipient`,children:c(G,{value:o,address:!0,label:T(this.context,`Copy recipient address ${o}`)})})]}),s?.hash&&c(`div`,{children:[c(`dt`,{children:c(x,{message:`Transaction`})}),c(`dd`,{children:[c(Lt,{value:s.hash,class:`seams-review-hash`}),c(G,{value:s.hash})]})]}),e.subject===`message`&&c(dn,{model:t.model}),c(`div`,{children:[c(`dt`,{children:c(x,{message:`Status`})}),c(`dd`,{children:c(x,{copy:n})})]})]})}),c(`button`,{type:`button`,class:`seams-receipt-primary`,onClick:this.close,children:i?c(x,{message:`Continue in background`}):c(x,{message:`Done`})}),u&&c(`div`,{id:this.explorerRowId,class:`seams-receipt-explorer-row`,ref:this.explorerRow,children:c(`a`,{class:`seams-receipt-explorer`,href:u,target:`_blank`,rel:`noopener noreferrer`,children:[c(x,{message:`View transaction`}),` `,c(H,{kind:`arrow`})]})}),c(W,{})]})}};function sn(e,t,n){if(!e)return null;let r;switch(e.chain){case`near`:r=t.near;break;case`evm`:r=t.evm;break;case`tempo`:r=t.tempo;break;case`unknown`:return null;default:return cn(e.chain)}if(!r)return null;let i=e.chain===`near`?`txns`:`tx`;return`${r.trim().replace(/\/$/,``)}/${i}/${encodeURIComponent(n)}`}function cn(e){throw Error(`Unexpected display chain: ${String(e)}`)}function ln({state:e}){let t=y(),n=Zt({subject:`transaction`,state:e});return c(`div`,{class:`seams-receipt-steps`,"aria-label":b(t,`Transaction progress`),children:[c(J,{stage:`signing`,label:b(t,`Signed`),activeLabel:`Signing`,complete:n>=1,active:e.kind===`signing`}),c(J,{stage:`broadcast`,label:b(t,`Broadcast`),activeLabel:`Broadcasting`,complete:n>=2,active:e.kind===`broadcasting`}),c(J,{stage:`confirming`,label:T(t,e.kind===`reverted`?`Reverted`:`Confirmed`),activeLabel:`Confirming`,complete:n===3,active:e.kind===`submitted`})]})}function un({state:e}){let t=y(),n=e.kind===`signed`,r=e.kind===`signing`;return c(`div`,{class:`seams-receipt-steps`,"aria-label":b(t,`Transaction progress`),children:[c(J,{stage:`signing`,label:b(t,`Signed`),activeLabel:`Signing`,complete:n,active:r}),c(J,{stage:`signed`,label:``,activeLabel:``,complete:n,active:!1}),c(J,{stage:`signed`,label:``,activeLabel:``,complete:n,active:!1})]})}function dn({model:e}){let t=y(),n=e?.operations.length===1?e.operations[0]:null;return n?.kind===`near.message`?c(l,{children:n.fields?.map(e=>c(`div`,{children:[c(`dt`,{children:c(x,{copy:e.label})}),e.renderAs===`file-content`?c(`dd`,{children:[c(`span`,{class:`seams-receipt-message`,children:e.value}),c(G,{value:e.copyValue??e.value})]}):c(`dd`,{class:`seams-review-recipient`,children:c(G,{value:e.copyValue??e.value,address:!0,label:T(t,`Copy ${e.label.toLowerCase()} address ${e.value}`)})})]},e.label))}):null}function J(e){let t=e.complete?`complete`:e.active?`active`:`waiting`;return c(`span`,{class:`seams-receipt-step`,"data-stage":e.stage,"data-state":t,"aria-current":e.active?`step`:void 0,children:[c(`span`,{class:`seams-receipt-track`,"aria-hidden":`true`}),c(x,{copy:e.active?e.activeLabel:e.label})]})}const fn=`cubic-bezier(0.22, 1, 0.36, 1)`,pn=[`.seams-receipt-symbol`,`[role="status"]`,`.seams-review-amount`,`.seams-receipt-footer`];function mn(e){let t=[];for(let n of pn){let r=e.querySelector(n);r&&t.push({selector:n,text:r.textContent,bounds:r.getBoundingClientRect(),fontSize:getComputedStyle(r).fontSize})}return t}function hn(e){let t=e.querySelector(`[data-seams-progress-line]`);if(!t)return[];let n=getComputedStyle(t).color,r=Array.from(t.querySelectorAll(`[data-seams-progress-segment]`));if(r.length===3&&r.every(_n))return r.map(e=>({bounds:e.getBoundingClientRect(),opacity:e.getAttribute(`opacity`)??`1`,color:n})).sort((e,t)=>e.bounds.left-t.bounds.left);let i=t.getBoundingClientRect(),a=i.width/3;return[0,1,2].map(e=>({bounds:new DOMRect(i.left+e*a,i.top+i.height/2,a,0),opacity:`0.55`,color:n}))}function gn(){}function _n(e){return e.getAttribute(`opacity`)!==`0`}let vn=0;var yn=class{element;styles;presentation;state;receipt=null;receiptMotion=[];receiptShell=null;receiptGhost=null;receiptSegments=[];clearReceiptMotion=()=>{for(let e of this.receiptMotion)e.cancel();this.receiptMotion=[],this.receiptShell?.remove(),this.receiptShell=null,this.receiptGhost?.remove(),this.receiptGhost=null;for(let e of this.receiptSegments)e.remove();this.receiptSegments=[],this.element.removeAttribute(`data-receipt-segments`),this.element.removeAttribute(`data-receipt-morphing`)};constructor(e){let t=e.parent.ownerDocument;this.styles=S(t),this.presentation={variant:e.presentation.variant,context:e.presentation.context},this.state={kind:`mounted`,model:e.model,onClosed:e.onClosed},this.element=t.createElement(`div`),this.element.id=`seams-confirmation-surface-${++vn}`,this.element.className=`seams-wallet-ui seams-confirmation-surface`,this.element.dataset.seamsConfirmSurface=e.presentation.context,this.element.dataset.seamsConfirmVariant=e.presentation.variant,this.element.addEventListener(`cancel`,this.cancel),e.parent.appendChild(this.element);try{this.update(e.model)}catch(e){throw this.remove(),e}}update(e){this.state.kind===`mounted`&&(this.state.model=e,this.element.dataset.confirmationKind=e.content.kind,this.element.dataset.seamsConfirmReady=String(e.content.kind===`transaction`&&e.content.transaction.decision.kind===`ready`),this.element.lang=e.appearance.locale??`en`,this.element.dataset.theme=e.appearance.theme.mode,this.styles.setDynamicRule(this.element.id,ee(this.element.id,e.appearance)),this.renderSurface())}close(){this.state.kind===`mounted`&&(this.state={kind:`closing`,model:this.state.model,onClosed:this.state.onClosed},this.presentation.variant===`modal`?this.dispose():this.renderSurface())}showReceipt(e){if(this.state.kind!==`mounted`||this.state.model.content.kind!==`transaction`)return;let t=this.receipt?.view!==e.view,n=this.receiptShell??this.element.querySelector(`.modal-container-root`),r=n?.getBoundingClientRect(),i=t?mn(this.element):[],a=t?this.liveCapture():null,o=n?getComputedStyle(n).borderRadius:`26px`;t&&this.clearReceiptMotion(),this.receipt=e,this.element.dataset.receiptView=e.view,this.element.dataset.seamsConfirmSurface=`wallet-iframe`,this.element.dataset.seamsConfirmVariant=`modal`,this.renderSurface();let s=this.element.querySelector(`.modal-container-root`);if(t&&r&&s&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){let t=s.getBoundingClientRect(),n=this.element.ownerDocument.createElement(`div`);n.className=`seams-receipt-morph-shell`,n.setAttribute(`aria-hidden`,`true`),this.element.appendChild(n),this.receiptShell=n,this.element.setAttribute(`data-receipt-morphing`,``),this.receiptMotion=[n.animate([{left:`${r.left}px`,top:`${r.top}px`,width:`${r.width}px`,height:`${r.height}px`,borderRadius:o},{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,borderRadius:getComputedStyle(s).borderRadius}],{duration:640,easing:fn,fill:`both`})];let c=a?this.handOverCapture(a,s):!1,l=new Set;for(let e of i){let t=s.querySelector(e.selector);if(!t||t.textContent!==e.text)continue;let n=t.getBoundingClientRect();l.add(t);let r=parseFloat(e.fontSize)/parseFloat(getComputedStyle(t).fontSize);this.receiptMotion.push(t.animate([{transform:`translate(${e.bounds.left-n.left}px, ${e.bounds.top-n.top}px) scale(${r})`,transformOrigin:`top left`},{transform:`translate(0, 0) scale(1)`,transformOrigin:`top left`}],{duration:640,easing:fn}))}let u=s.querySelectorAll(`.seams-transaction-receipt > :not(.seams-receipt-heading), .seams-receipt-heading > .seams-receipt-symbol, .seams-receipt-heading h2, .seams-receipt-heading p, .seams-transaction-toast > :not(.seams-transaction-toast-text, .seams-toast-progress), .seams-transaction-toast-text > *`),d=0;for(let t of u){if(l.has(t))continue;let n=a!==null&&t.matches(`.seams-review-toolbar`);this.receiptMotion.push(t.animate(n?[{opacity:0},{opacity:1}]:[{opacity:0,transform:`translateY(8px)`},{opacity:1,transform:`translateY(0)`}],a?{duration:360,delay:n?0:c&&t.matches(`.seams-receipt-steps`)?560:200+Math.min(d,6)*40,fill:`backwards`,easing:`cubic-bezier(0.2, 0, 0, 1)`}:{duration:120,delay:e.view===`toast`?240:180+Math.min(d,4)*15,fill:`backwards`,easing:`ease-out`})),n||(d+=1)}let f=this.receiptMotion;Promise.all(f.map(e=>e.finished)).then(()=>{this.receiptMotion===f&&this.clearReceiptMotion()},gn)}}liveCapture(){if(this.state.kind!==`mounted`||this.state.model.content.kind!==`transaction`)return null;let e=this.state.model.content.capture;return e?.isConnected?{element:e,bounds:e.getBoundingClientRect(),segments:hn(e)}:null}handOverCapture(e,t){let n=this.element.ownerDocument.createElement(`div`);n.className=`seams-receipt-capture-ghost`,n.setAttribute(`aria-hidden`,`true`),n.append(e.element),this.element.appendChild(n),this.receiptGhost=n;let r={left:`${e.bounds.left}px`,top:`${e.bounds.top}px`,width:`${e.bounds.width}px`,height:`${e.bounds.height}px`};this.receiptMotion.push(n.animate([{...r,opacity:1},{...r,opacity:0}],{duration:160,easing:`ease-out`,fill:`both`}));let i=t.querySelectorAll(`.seams-receipt-track`);if(e.segments.length===0||i.length!==e.segments.length)return!1;this.element.setAttribute(`data-receipt-segments`,``);for(let[t,n]of i.entries()){let r=e.segments[t],i=n.getBoundingClientRect(),a=n.closest(`.seams-receipt-step`)?.dataset.state===`complete`,o=this.element.ownerDocument.createElement(`div`);o.className=`seams-receipt-segment`,o.setAttribute(`aria-hidden`,`true`),this.element.appendChild(o),this.receiptSegments.push(o),this.receiptMotion.push(o.animate([{left:`${r.bounds.left}px`,top:`${r.bounds.top+r.bounds.height/2-.5}px`,width:`${r.bounds.width}px`,height:`1px`,borderRadius:`1px`,opacity:r.opacity,backgroundColor:r.color},{left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`,borderRadius:getComputedStyle(n).borderRadius,opacity:1,backgroundColor:getComputedStyle(n,a?`::after`:null).backgroundColor}],{duration:800,delay:120,easing:`cubic-bezier(0.65, 0, 0.35, 1)`,fill:`both`}))}return!0}dispose=()=>{if(this.state.kind===`disposed`)return;let e=this.state.onClosed;this.remove(),e()};remove(){this.clearReceiptMotion(),this.state={kind:`disposed`},this.element.removeEventListener(`cancel`,this.cancel),s(null,this.element),this.styles.deleteDynamicRule(this.element.id),this.element.remove()}cancel=()=>{if(this.state.kind!==`mounted`)return;if(this.receipt){K(this.receipt)?this.receipt.onView(`toast`):this.receipt.onDismiss();return}let e=this.state.model.content;e.kind===`registration`?e.registration.onCancel():e.transaction.onCancel()};confirm=()=>{if(this.state.kind!==`mounted`)return;let e=this.state.model.content,t=e.kind===`registration`?e.registration.decision:e.transaction.decision;t.kind===`ready`&&t.onConfirm()};submitOtp=(e,t)=>{if(this.state.kind!==`mounted`)return;let n=this.state.model.content;n.kind===`transaction`&&n.prompt.kind===`email`&&n.prompt.email.onSubmit(e,t)};renderSurface(){let e=this.state;if(e.kind===`disposed`)return;let t=e.model.content,n=this.contentModel(t,e.kind===`closing`),r=this.receipt&&t.kind===`transaction`?c(on,{receipt:this.receipt,data:t.review,explorers:t.transaction.explorers}):c(Kt,{model:n,styles:this.styles,variant:this.presentation.variant}),i=t.kind===`registration`?t.registration.heading:t.header.heading;if(this.receipt||this.presentation.variant===`modal`){s(C(e.model.appearance.locale??`en`,c(te,{context:this.receipt?`wallet-iframe`:this.presentation.context,label:i,onCancel:this.cancel,children:r})),this.element);return}let a=t.kind===`registration`?t.registration.decision:t.transaction.decision;s(C(e.model.appearance.locale??`en`,c(re,{context:this.presentation.context,label:i,origin:t.kind===`transaction`&&t.header.website.kind===`ready`?c(l,{children:[c(nt,{}),t.header.website.text]}):void 0,errorMessage:t.kind===`registration`?t.registration.errorMessage:t.transaction.errorMessage,styles:this.styles,state:e.kind===`closing`?{kind:`closing`,onClosed:this.dispose}:{kind:`open`,interaction:a.kind===`ready`?`ready`:`busy`},onCancel:this.cancel,children:r})),this.element)}contentModel(e,t){switch(e.kind){case`registration`:return{kind:`registration`,registration:{...e.registration,decision:!t&&e.registration.decision.kind===`ready`?{kind:`ready`,onConfirm:this.confirm}:{kind:`creating`},onCancel:this.cancel}};case`transaction`:return{kind:`transaction`,capture:e.capture,header:e.header,body:e.body,review:e.review,prompt:e.prompt.kind===`email`?{kind:`email`,email:{prompt:e.prompt.email.prompt,verification:t?{kind:`pending`}:e.prompt.email.verification,onSubmit:this.submitOtp}}:e.prompt,transaction:{...e.transaction,decision:!t&&e.transaction.decision.kind===`ready`?{kind:`ready`,onConfirm:this.confirm}:{kind:`preparing`},onCancel:this.cancel}};default:return bn(e)}}};function bn(e){throw Error(`Unexpected confirmation content: ${String(e)}`)}function xn(e){return new yn(e)}var Sn=class{element;surface;callbacks;appearance;presentation;tree;currentModel;constructor(e){this.callbacks=e.callbacks,this.appearance=e.appearance,this.presentation=e.presentation,this.tree=e.tree,this.currentModel=this.normalize(),this.surface=xn({parent:e.parent,presentation:{variant:e.variant,context:e.context},model:this.currentModel,onClosed:e.onClosed}),this.element=this.surface.element}update(e){this.presentation=Cn(this.presentation,e),e.appearance&&(this.appearance=e.appearance),Object.hasOwn(e,`model`)&&(this.tree=j({model:e.model})),this.currentModel=this.normalize(),this.surface.update(this.currentModel)}setTree(e){this.tree=e,this.currentModel=this.normalize(),this.surface.update(this.currentModel)}close(){this.surface.close()}showReceipt(e){this.surface.showReceipt(e)}dispose(){this.surface.dispose()}normalize(){let e=Fe({presentation:this.presentation,appearance:this.appearance,tree:this.tree,callbacks:this.callbacks});if(!e.ok)throw Error(`Cannot render confirmation surface: ${e.error}`);return e.model}};function Cn(e,t){return{model:Object.hasOwn(t,`model`)?t.model:e.model,securityContext:Object.hasOwn(t,`securityContext`)?t.securityContext:e.securityContext,loading:Object.hasOwn(t,`loading`)?t.loading:e.loading,preparing:Object.hasOwn(t,`preparing`)?t.preparing:e.preparing,title:Object.hasOwn(t,`title`)?t.title:e.title,body:Object.hasOwn(t,`body`)?t.body:e.body,authMethodCapture:Object.hasOwn(t,`authMethodCapture`)?t.authMethodCapture:e.authMethodCapture,authMethodApprovalMessage:Object.hasOwn(t,`authMethodApprovalMessage`)?t.authMethodApprovalMessage:e.authMethodApprovalMessage,errorMessage:Object.hasOwn(t,`errorMessage`)?t.errorMessage:e.errorMessage,confirmText:Object.hasOwn(t,`confirmText`)?t.confirmText:e.confirmText,cancelText:Object.hasOwn(t,`cancelText`)?t.cancelText:e.cancelText,onBack:Object.hasOwn(t,`onBack`)?t.onBack:e.onBack,signingAuthMode:Object.hasOwn(t,`signingAuthMode`)?t.signingAuthMode:e.signingAuthMode,emailOtpPrompt:Object.hasOwn(t,`emailOtpPrompt`)?t.emailOtpPrompt:e.emailOtpPrompt,nearExplorerUrl:Object.hasOwn(t,`nearExplorerUrl`)?t.nearExplorerUrl:e.nearExplorerUrl,tempoExplorerUrl:Object.hasOwn(t,`tempoExplorerUrl`)?t.tempoExplorerUrl:e.tempoExplorerUrl,evmExplorerUrl:Object.hasOwn(t,`evmExplorerUrl`)?t.evmExplorerUrl:e.evmExplorerUrl}}function wn(e){return new Sn(e)}var Tn=e({awaitConfirmUIDecision:()=>er,mountConfirmUI:()=>Yn,prepareConfirmUISurface:()=>$n});const Y=`seams-confirm-portal`;function En(e){return Math.max(0,Math.round(performance.now()-e))}const Dn=new WeakMap,On=new WeakMap,kn=new WeakMap,X=new WeakMap,An=new WeakMap,Z=new WeakMap;function jn(e){try{if(!ce()||typeof window>`u`||window.parent===window)return;window.parent?.postMessage({type:e},`*`)}catch{}}function Q(e){return e===`drawer`?`drawer`:`modal`}function Mn(e){return(e||[]).map(e=>({receiverId:e.receiverId,actions:(e.actions||[]).map(e=>f(e)?e:d(e)).map(e=>h(e))}))}async function Nn(e,t){if(!(!((t?.length||0)>0)||!e))try{return await g(Mn(t))===e?void 0:`INTENT_DIGEST_MISMATCH`}catch{return`UI_DIGEST_VALIDATION_FAILED`}}function Pn(e){e.childElementCount>0?e.classList.add(`seams-portal--visible`):e.classList.remove(`seams-portal--visible`)}function Fn(){let e=[];for(let t of document.querySelectorAll(`.seams-confirmation-surface`))t.parentElement?.closest(`.seams-confirmation-surface`)||e.push(t);return e}function In(){for(let e of Fn())An.get(e)?.callbacks.cancel(),X.get(e)?.dispose(),Z.delete(e),$(e),e.remove();let e=document.getElementById(Y);e&&Pn(e)}function Ln(){let e=document.getElementById(Y);if(!e){e=document.createElement(`div`),e.id=Y,e.classList.add(`seams-portal`);let t=document.body??document.documentElement;t&&t.appendChild(e)}return e}function Rn(e){X.delete(e),Z.delete(e),$(e),e.remove();let t=document.getElementById(Y);t&&Pn(t)}function zn(){(document.getElementById(Y)?.childElementCount??0)>0||jn(`WALLET_UI_CLOSED`)}function Bn(e,t){let r=t?.chain;if(r!==`near`&&r!==`tempo`&&r!==`evm`)return{};let i=n({chains:e.chains,family:r,chainId:t?.chainId});return i?r===`near`?{nearExplorerUrl:i}:r===`tempo`?{tempoExplorerUrl:i}:{evmExplorerUrl:i}:{}}function Vn(e,t){t&&(e.update(t),Object.hasOwn(t,`model`)&&Hn(e.element,e,t.model))}function Hn(e,t,n){let r=(Z.get(e)??0)+1;Z.set(e,r),!(!n||!Te(n))&&import(`./enrichDisplayModelWithAbi-CLn37drs.js`).then(i=>{if(Z.get(e)!==r||!e.isConnected||X.get(e)!==t)return;let a=i.enrichDisplayModelWithAbi(n);Z.get(e)===r&&t.setTree(j({model:a}))}).catch(e=>{console.warn(`[ConfirmUI] failed to lazy-load ABI display enrichment`,e)})}function $(e){Dn.get(e)?.disconnect(),Dn.delete(e),On.get(e)?.dispose(),On.delete(e),kn.delete(e)}function Un(e,t){switch(e.kind){case`disabled`:return null;case`wallet_iframe`:return i({kind:`request_surface`,element:t,requestId:e.requestId,postMeasurement:e.postMeasurement});default:{let t=e;throw Error(`Unhandled confirmation measurement binding: ${String(t)}`)}}}function Wn(e,t,n){e.setAttribute(Ue,nr(n,t)),e.setAttribute(`data-seams-confirm-variant`,t),e.toggleAttribute(`data-seams-review-frame`,!!r(n))}function Gn(e,t,n){if(r(n)?.attach(e),Wn(e,t,n),ie(kn.get(e),n))return;$(e),kn.set(e,n);let i=Un(n,e);i&&(Dn.set(e,i),On.set(e,tt(e)))}function Kn(e,t){t.kind===`review_available`&&e.returnToReview()}var qn=class{view=null;navigation={kind:`review_available`};queuedDecisions=[];decisionWaiters=[];phase=`pending`;cancelListeners=new Set;onBack;callbacks={confirm:this.confirm.bind(this),cancel:this.cancel.bind(this),submitEmail:this.submitEmail.bind(this)};constructor(e){this.admission=e,this.onBack=e?this.back.bind(this):void 0}attachView(e){this.view=e}publishDecision(e){if(this.phase===`published`)return;this.phase=`published`,this.navigation.kind=`decision_published`;let t=this.decisionWaiters.shift();if(t){t(e);return}this.queuedDecisions.push(e)}back(){this.phase===`checking`?this.cancel(`Voice approval was cancelled.`):this.admission&&Kn(this.admission,this.navigation)}cancel(e){if(this.phase!==`published`){this.publishDecision({kind:`cancelled`,error:e??null}),this.admission?.cancel(Error(e??`Wallet approval was cancelled.`));for(let t of this.cancelListeners)t({...e?{error:e}:{}})}}confirm(){this.approve({kind:`confirmed`,emailOtp:{kind:`absent`}})}submitEmail(e,t){let n=e.trim(),r=t.trim();if(!n||!r){this.cancel(`Email OTP challenge is missing.`);return}this.approve({kind:`confirmed`,emailOtp:{kind:`provided`,code:n,challengeId:r}})}async approve(e){if(!(this.phase!==`pending`||this.admission&&!this.admission.allowInteraction())){this.phase=`checking`;try{this.admission?.authMethodApprovalMessages&&this.view?.update({preparing:!0,authMethodCapture:this.admission.authMethodApprovalSurface});let t=await this.admission?.approveAuthMethod();if(t?.kind===`retry`){this.phase=`pending`,this.view?.update({preparing:!1,authMethodCapture:null,authMethodApprovalMessage:t.message});return}this.admission?.authMethodApprovalMessages&&this.view?.update({preparing:!1,authMethodApprovalMessage:this.admission.authMethodApprovalMessages.approved}),this.publishDecision(e)}catch(e){this.cancel(e instanceof Error?e.message:`Authentication method approval failed.`)}}}async takeDecision(){return this.queuedDecisions.shift()||(this.phase===`published`&&(this.phase=`pending`),await new Promise(this.waitForDecision))}waitForDecision=e=>{this.decisionWaiters.push(e)}};function Jn(e,t,n){let r=!1;return{element:e.element,close:i=>{r||(r=!0,i||t.callbacks.cancel(),t.cancelListeners.clear(),!(i&&n.kind===`wallet_iframe`&&v(n.requestId,e))&&($(e.element),e.close()))},update:t=>Vn(e,t),onCancel:e=>(t.cancelListeners.add(e),()=>t.cancelListeners.delete(e)),takeDecision:()=>t.takeDecision()}}async function Yn({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,uiMode:c,signingAuthMode:l,emailOtpPrompt:u}){return tr({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,variant:Q(c),signingAuthMode:l,emailOtpPrompt:u})}function Xn(e){let t=e.surface.handle,n=t.element;if(!n.isConnected)throw Error(`Cannot reuse a detached confirmation surface`);let r=X.get(n);if(!r)throw Error(`Cannot reuse an unmanaged confirmation surface`);Gn(n,e.variant,e.ctx.surfaceMeasurementBinding);let i=ae({getAppearance:e.ctx.getAppearance,requestedAppearance:e.appearance,requestedMode:e.theme}),a=Bn(e.ctx,e.model);return r.update({model:e.model,securityContext:e.securityContext,loading:e.loading??!1,appearance:i,title:e.summary.title??``,body:e.summary.body??``,signingAuthMode:e.signingAuthMode,emailOtpPrompt:e.emailOtpPrompt,errorMessage:``,...a}),r.setTree(j({txSigningRequests:e.txSigningRequests,model:e.model})),Hn(n,r,e.model),{handle:t,reused:!0}}function Zn(e){throw Error(`Unhandled confirmation surface: ${JSON.stringify(e)}`)}function Qn(e){switch(e.surface.kind){case`mount_new`:return{handle:tr({ctx:e.ctx,summary:e.summary,txSigningRequests:e.txSigningRequests,model:e.model,securityContext:e.securityContext,loading:e.loading,theme:e.theme,appearance:e.appearance,variant:e.variant,signingAuthMode:e.signingAuthMode,emailOtpPrompt:e.emailOtpPrompt}),reused:!1};case`reuse_mounted`:return Xn({...e,surface:e.surface});case`preparation_cancelled`:throw Error(`A cancelled preparation surface cannot be mounted`);default:return Zn(e.surface)}}async function $n(e){return Qn({ctx:e.ctx,summary:e.summary,txSigningRequests:e.txSigningRequests,model:e.model,securityContext:e.securityContext,loading:e.loading,theme:e.theme,appearance:e.appearance,variant:Q(e.uiMode),signingAuthMode:e.signingAuthMode,emailOtpPrompt:e.emailOtpPrompt,surface:e.surface}).handle}async function er({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,uiMode:c,onMounted:l,signingAuthMode:u,emailOtpPrompt:d,surface:f}){let p=Q(c);return new Promise(c=>{let m=performance.now(),{handle:h,reused:g}=Qn({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,variant:p,signingAuthMode:u,emailOtpPrompt:d,surface:f}),_=En(m),v=performance.now(),y=0,b=g?_:0,x=0,S=e=>e>0?e:En(v);Promise.resolve().then(()=>{y=S(y),g||(b=S(b))});try{l?.(h)}catch{}let C=e=>{let t={kind:`confirm_ui_prompt_diagnostics_v1`,elementDefineMs:0,mountMs:_,hostFirstUpdateMs:y,hostInteractiveMs:b,confirmEventMs:x,decisionWaitMs:En(v)};T(),c({...e,handle:h,diagnostics:t})},w=async e=>{if(x=S(x),e.kind===`cancelled`){let t=e.error||void 0;h.update({...t?{errorMessage:t}:{},loading:!1}),C({confirmed:!1,error:t});return}let i,a=await Nn(String(r?.intentDigest||t?.intentDigest||``).trim(),n);if(a&&(i=a),i){h.update({errorMessage:i,loading:!1}),C({confirmed:!1,error:i});return}C({confirmed:!0,...e.emailOtp.kind===`provided`?{otpCode:e.emailOtp.code,emailOtpChallengeId:e.emailOtp.challengeId}:{}})},T=()=>{y=Math.max(y,0)};(async()=>{let e=await h.takeDecision();u===`emailOtp`&&e.kind===`confirmed`&&e.emailOtp.kind===`absent`&&(h.update({loading:!1}),e=await h.takeDecision()),await w(e)})()})}function tr({ctx:e,summary:t,txSigningRequests:n,model:i,securityContext:a,loading:o,theme:s,appearance:c,variant:l,signingAuthMode:u,emailOtpPrompt:d}){r(e.surfaceMeasurementBinding)?.assertPending(),In();let f=ae({getAppearance:e.getAppearance,requestedAppearance:c,requestedMode:s}),p=Ln(),m=Bn(e,i),h=new qn(r(e.surfaceMeasurementBinding)),g;return g=wn({parent:p,variant:l,context:nr(e.surfaceMeasurementBinding,l),appearance:f,presentation:{onBack:h.onBack,model:i,securityContext:a,loading:o,title:t?.title??(t?.delegate?`Sign Delegate Action`:void 0),body:t?.body,confirmText:r(e.surfaceMeasurementBinding)?.authMethodApprovalMessages?.confirm,signingAuthMode:u,emailOtpPrompt:d,nearExplorerUrl:e.nearExplorerUrl??m.nearExplorerUrl,tempoExplorerUrl:e.tempoExplorerUrl??m.tempoExplorerUrl,evmExplorerUrl:e.evmExplorerUrl??m.evmExplorerUrl},tree:j({txSigningRequests:n,model:i}),callbacks:h.callbacks,onClosed:()=>{Rn(g.element),zn()}}),h.attachView(g),X.set(g.element,g),An.set(g.element,h),Pn(p),Gn(g.element,l,e.surfaceMeasurementBinding),Hn(g.element,g,i),p.classList.remove(`seams-portal--visible`),requestAnimationFrame(()=>{p.classList.add(`seams-portal--visible`)}),jn(`WALLET_UI_OPENED`),Jn(g,h,e.surfaceMeasurementBinding)}function nr(e,t){let n=e.kind===`wallet_iframe`?e.hostSurfaceVariant??t:t;return e.kind===`wallet_iframe`&&n===`modal`?`wallet-iframe`:`standalone`}export{nt as a,ce as c,$n as i,se as l,Tn as n,Oe as o,Yn as r,je as s,er as t};
@@ -0,0 +1 @@
1
+ let e=function(e){return e.SIGN_TRANSACTION=`signTransaction`,e.REGISTER_ACCOUNT=`registerAccount`,e.LINK_DEVICE=`linkDevice`,e.AUTHORIZE_KEY_EXPORT=`authorizeKeyExport`,e.SIGN_NEP413_MESSAGE=`signNep413Message`,e.SHOW_SECURE_PRIVATE_KEY_UI=`showSecurePrivateKeyUi`,e.SIGN_INTENT_DIGEST=`signIntentDigest`,e}({}),t=function(e){return e.PROMPT_USER_CONFIRM_IN_JS_MAIN_THREAD=`PROMPT_USER_CONFIRM_IN_JS_MAIN_THREAD`,e.USER_PASSKEY_CONFIRM_RESPONSE=`USER_PASSKEY_CONFIRM_RESPONSE`,e.USER_PASSKEY_CONFIRM_PROGRESS=`USER_PASSKEY_CONFIRM_PROGRESS`,e}({});export{e as n,t};
@@ -0,0 +1 @@
1
+ import{A as e,E as t,N as n,O as r,d as i,f as a,g as o,i as s,k as c,u as l}from"./domainIds-t1lp25yU.js";import{S as u,t as ee,y as te}from"./digests-BIaE0DMd.js";import{i as d,r as f}from"./base64-BmKR3UqU.js";import{C as p,D as ne,E as m,H as h,J as g,K as _,O as re,P as v,R as ie,S as y,T as ae,U as oe,W as b,_ as x,b as S,c as C,d as w,f as se,g as T,h as E,k as ce,l as D,m as O,n as le,o as ue,p as k,q as A,s as de,u as j,v as fe,w as pe,x as M,y as N}from"./activeWalletSession-BJ4B-nJo.js";import{d as me,f as he,h as ge,m as _e,p as ve}from"./capabilityKinds-DVlGMspk.js";import{a as ye,o as P,r as F}from"./canonicalPrimitives-Jd3i_Ngz.js";import{$ as be,F as xe,I as Se,L as Ce,P as we,V as Te,_ as Ee,d as De,f as Oe,g as ke,x as Ae,y as je}from"./walletAuthority-DGdC9Glh.js";import{It as Me,Nt as Ne,a as I,i as Pe,n as L,o as Fe,r as Ie,s as R,t as z}from"./digestEncoding-n8Kr2kow.js";import{r as Le}from"./walletAuthMethodRecord-Bi78B6Ab.js";function Re(e){throw Error(`[LinkSessionStateV1] unsupported state: ${String(e)}`)}const ze=`x25519-hkdf-sha256-chacha20poly1305-v1`,Be=/^[A-Za-z0-9_-]+$/,Ve=[`kind`,`linkSessionId`,`walletId`,`walletKeyId`,`enrollmentId`,`deviceId`,`transferAlg`,`applicationBindingDigestB64u`,`registeredPublicKeyB64u`,`targetFactor`,`revocationEpoch`,`recipientPublicKeyB64u`,`registeredAtMs`],He=[`kind`,`linkSessionId`,`walletId`,`walletKeyId`,`enrollmentId`,`deviceId`,`transferAlg`,`applicationBindingDigestB64u`,`registeredPublicKeyB64u`,`targetFactor`,`revocationEpoch`,`recipientPublicKeyB64u`,`ephemeralPublicKeyB64u`,`nonceB64u`,`sealedExportRootB64u`,`bindingDigestB64u`,`ciphertextDigestB64u`,`sealedAtMs`];function Ue(e,t=`recipientPublicKeyB64u`){if(typeof e!=`string`||!Be.test(e))throw Error(`${t} must be unpadded base64url`);let n;try{n=f(e)}catch{throw Error(`${t} must be valid base64url`)}if(d(n)!==e)throw Error(`${t} must be canonical base64url`);if(n.length!==32)throw Error(`${t} must decode to a 32-byte X25519 public key`);return e}function We(e){return{linkSessionId:e.linkSessionId,walletId:e.walletId,walletKeyId:e.walletKeyId,targetFactor:e.targetFactor,enrollmentId:e.enrollmentId,deviceId:e.deviceId,revocationEpoch:e.revocationEpoch,applicationBindingDigestB64u:e.applicationBindingDigestB64u,registeredPublicKeyB64u:e.registeredPublicKeyB64u,recipientPublicKeyB64u:e.recipientPublicKeyB64u}}function Ge(e){return JSON.stringify({linkSessionId:String(e.linkSessionId),walletId:String(e.walletId),walletKeyId:String(e.walletKeyId),targetFactor:e.targetFactor,enrollmentId:String(e.enrollmentId),deviceId:String(e.deviceId),revocationEpoch:e.revocationEpoch,applicationBindingDigestB64u:String(e.applicationBindingDigestB64u),registeredPublicKeyB64u:String(e.registeredPublicKeyB64u),recipientPublicKeyB64u:String(e.recipientPublicKeyB64u)})}function Ke(t){let n=Ye(t,Ve,`LinkedDeviceEd25519ExportRootRecipientV1`);if(n.kind!==`linked_device_ed25519_export_root_recipient_v1`)throw Error(`LinkedDeviceEd25519ExportRootRecipientV1.kind is invalid`);return Xe(n.transferAlg,`LinkedDeviceEd25519ExportRootRecipientV1.transferAlg`),{kind:`linked_device_ed25519_export_root_recipient_v1`,linkSessionId:v(l(n.linkSessionId),`LinkedDeviceEd25519ExportRootRecipientV1.linkSessionId`),walletId:v(c(n.walletId),`walletId`),walletKeyId:v(e(n.walletKeyId),`walletKeyId`),enrollmentId:v(i(n.enrollmentId),`enrollmentId`),deviceId:v(a(n.deviceId),`deviceId`),transferAlg:ze,applicationBindingDigestB64u:m(n.applicationBindingDigestB64u,`applicationBindingDigestB64u`),registeredPublicKeyB64u:ne(n.registeredPublicKeyB64u,`registeredPublicKeyB64u`),targetFactor:Je(n.targetFactor),revocationEpoch:Ze(n.revocationEpoch,`revocationEpoch`),recipientPublicKeyB64u:Ue(n.recipientPublicKeyB64u,`recipientPublicKeyB64u`),registeredAtMs:Qe(n.registeredAtMs,`registeredAtMs`)}}function qe(t){let n=Ye(t,He,`LinkedDeviceEd25519ExportRootPackageV1`);if(n.kind!==`linked_device_ed25519_export_root_package_v1`)throw Error(`LinkedDeviceEd25519ExportRootPackageV1.kind is invalid`);Xe(n.transferAlg,`LinkedDeviceEd25519ExportRootPackageV1.transferAlg`);let r=Ue(n.recipientPublicKeyB64u,`recipientPublicKeyB64u`),o=Ue(n.ephemeralPublicKeyB64u,`ephemeralPublicKeyB64u`);if(r===o)throw Error(`ephemeralPublicKeyB64u repeats the recipient key`);return{kind:`linked_device_ed25519_export_root_package_v1`,linkSessionId:v(l(n.linkSessionId),`linkSessionId`),walletId:v(c(n.walletId),`walletId`),walletKeyId:v(e(n.walletKeyId),`walletKeyId`),enrollmentId:v(i(n.enrollmentId),`enrollmentId`),deviceId:v(a(n.deviceId),`deviceId`),transferAlg:ze,applicationBindingDigestB64u:m(n.applicationBindingDigestB64u,`applicationBindingDigestB64u`),registeredPublicKeyB64u:ne(n.registeredPublicKeyB64u,`registeredPublicKeyB64u`),targetFactor:Je(n.targetFactor),revocationEpoch:Ze(n.revocationEpoch,`revocationEpoch`),recipientPublicKeyB64u:r,ephemeralPublicKeyB64u:o,nonceB64u:ce(n.nonceB64u,`nonceB64u`),sealedExportRootB64u:re(n.sealedExportRootB64u,`sealedExportRootB64u`),bindingDigestB64u:m(n.bindingDigestB64u,`bindingDigestB64u`),ciphertextDigestB64u:m(n.ciphertextDigestB64u,`ciphertextDigestB64u`),sealedAtMs:Qe(n.sealedAtMs,`sealedAtMs`)}}function Je(e){switch(Ye(e,[`kind`],`targetFactor`).kind){case`passkey_prf`:return{kind:`passkey_prf`};case`email_otp`:return{kind:`email_otp`};default:throw Error(`targetFactor.kind is unsupported`)}}function Ye(e,t,n){let r=u(e,n);g(r,t,n);for(let e of t)if(r[e]===void 0)throw Error(`${n}.${e} is required`);return r}function Xe(e,t){if(e!==`x25519-hkdf-sha256-chacha20poly1305-v1`)throw Error(`${t} must be ${ze}`)}function Ze(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`);return e}function Qe(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw Error(`${t} must be a positive unix-millisecond timestamp`);return e}function B(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`${t} must be an object`);return e}function V(e,t){if(typeof e!=`string`)throw Error(`${t} must be a string`);let n=e.trim();if(!n)throw Error(`${t} must not be empty`);if(n!==e)throw Error(`${t} must not be padded with whitespace`);return n}function $e(e,t){let r=n(V(e,t));if(!r.ok)throw Error(`${t} is invalid: ${r.error.message}`);return r.value}function H(e,t,n){if(e!==t)throw Error(`${n} must be ${String(t)}`);return t}function et(e){let t=`WalletAddAuthMethodRegistrationOptions`,n=B(e,t);H(n.kind,`webauthn_add_auth_method_registration_v1`,`${t}.kind`);let r=B(n.user,`${t}.user`),i=B(n.authenticatorSelection,`${t}.authenticatorSelection`),a=B(B(B(n.extensions,`${t}.extensions`).prf,`${t}.extensions.prf`).eval,`${t}.extensions.prf.eval`);if(!Array.isArray(n.pubKeyCredParams)||n.pubKeyCredParams.length!==2)throw Error(`${t}.pubKeyCredParams must list exactly two algorithms`);let[o,s]=n.pubKeyCredParams;if(H(B(o,`${t}.pubKeyCredParams[0]`).type,`public-key`,`${t}.pubKeyCredParams[0].type`),H(B(o,`${t}.pubKeyCredParams[0]`).alg,-7,`${t}.pubKeyCredParams[0].alg`),H(B(s,`${t}.pubKeyCredParams[1]`).type,`public-key`,`${t}.pubKeyCredParams[1].type`),H(B(s,`${t}.pubKeyCredParams[1]`).alg,-257,`${t}.pubKeyCredParams[1].alg`),!Array.isArray(n.excludeCredentials))throw Error(`${t}.excludeCredentials must be an array`);let c=n.excludeCredentials.map((e,n)=>{let r=B(e,`${t}.excludeCredentials[${n}]`);return{type:H(r.type,`public-key`,`${t}.excludeCredentials[${n}].type`),id:V(r.id,`${t}.excludeCredentials[${n}].id`)}}),l=n.timeoutMs;if(typeof l!=`number`||!Number.isSafeInteger(l)||l<=0)throw Error(`${t}.timeoutMs must be a positive safe integer`);return{kind:`webauthn_add_auth_method_registration_v1`,challengeId:V(n.challengeId,`${t}.challengeId`),challengeB64u:V(n.challengeB64u,`${t}.challengeB64u`),rpId:$e(n.rpId,`${t}.rpId`),user:{idB64u:V(r.idB64u,`${t}.user.idB64u`),name:V(r.name,`${t}.user.name`),displayName:V(r.displayName,`${t}.user.displayName`)},pubKeyCredParams:[{type:`public-key`,alg:-7},{type:`public-key`,alg:-257}],authenticatorSelection:{residentKey:H(i.residentKey,`required`,`${t}.authenticatorSelection.residentKey`),userVerification:H(i.userVerification,`preferred`,`${t}.authenticatorSelection.userVerification`)},timeoutMs:l,attestation:H(n.attestation,`none`,`${t}.attestation`),extensions:{prf:{eval:{firstB64u:V(a.firstB64u,`${t}.extensions.prf.eval.firstB64u`),secondB64u:V(a.secondB64u,`${t}.extensions.prf.eval.secondB64u`)}}},excludeCredentials:c}}function tt(e){let t=ut(e);if(t.kind!==`committed_authority_packages_v1`)throw Error(`CommittedAuthorityPackagesV1.kind is invalid`);let n=De(t.authority);if(!n.ok||n.value.state!==`pending_local_install`)throw Error(`CommittedAuthorityPackagesV1.authority is not pending`);let r=Le(t.authMethod);if(!r||r.status!==`pending_local_install`||r.kind===`voiceid`)throw Error(`CommittedAuthorityPackagesV1.authMethod is not pending`);if(r.walletId!==n.value.walletId||r.walletAuthorityId!==n.value.authorityId)throw Error(`CommittedAuthorityPackagesV1 authority and auth method identities differ`);let i=rt(t.signerPackages);nt(i,n.value.signerActivations);let a=t.ed25519ExportRootPackage===null?null:qe(t.ed25519ExportRootPackage);if(a&&(a.walletId!==n.value.walletId||a.revocationEpoch!==n.value.revocationEpoch||n.value.provenance.kind!==`device_link`||a.enrollmentId!==n.value.provenance.enrollmentId||a.linkSessionId!==n.value.provenance.linkSessionId||String(a.deviceId)!==String(n.value.principal.deviceId)))throw Error(`CommittedAuthorityPackagesV1 export root identity does not match authority`);return{kind:`committed_authority_packages_v1`,authority:n.value,authMethod:r,signerPackages:i,ed25519ExportRootPackage:a,packageSetDigestB64u:it(t.packageSetDigestB64u)}}function nt(e,t){if(e.keyFamilies.length!==t.keyFamilies.length)throw Error(`CommittedAuthorityPackagesV1 signer families do not match authority`);for(let n=0;n<e.keyFamilies.length;n+=1)if(e.keyFamilies[n]!==t.keyFamilies[n])throw Error(`CommittedAuthorityPackagesV1 signer family order does not match authority`);if(e.keyFamilies.length===1&&e.keyFamilies[0]===`ed25519`){if(!t.ed25519||!e.ed25519)throw Error(`CommittedAuthorityPackagesV1 Ed25519 activation is missing`);if(!s(e.ed25519.materialActivation,t.ed25519.materialActivation))throw Error(`CommittedAuthorityPackagesV1 Ed25519 activation does not match authority`);return}if(e.keyFamilies.length===1&&e.keyFamilies[0]===`ecdsa_secp256k1`){if(!t.ecdsa||!e.ecdsa)throw Error(`CommittedAuthorityPackagesV1 ECDSA activation is missing`);if(!s(e.ecdsa.materialActivation,t.ecdsa.materialActivation))throw Error(`CommittedAuthorityPackagesV1 ECDSA activation does not match authority`);return}if(!t.ed25519||!t.ecdsa||!e.ed25519||!e.ecdsa)throw Error(`CommittedAuthorityPackagesV1 combined activations are incomplete`);if(!s(e.ed25519.materialActivation,t.ed25519.materialActivation)||!s(e.ecdsa.materialActivation,t.ecdsa.materialActivation))throw Error(`CommittedAuthorityPackagesV1 activation references do not match authority`)}function rt(e){let t=dt(e);if(t.kind!==`committed_signer_package_set_v1`)throw Error(`CommittedSignerPackageSetV1.kind is invalid`);let n=lt(t.keyFamilies);if(n.length===1&&n[0]===`ed25519`){if(!(`ed25519`in t))throw Error(`CommittedSignerPackageSetV1 fields are invalid`);return{kind:`committed_signer_package_set_v1`,keyFamilies:n,ed25519:at(t.ed25519)}}if(n.length===1&&n[0]===`ecdsa_secp256k1`){if(!(`ecdsa`in t))throw Error(`CommittedSignerPackageSetV1 fields are invalid`);return{kind:`committed_signer_package_set_v1`,keyFamilies:n,ecdsa:ot(t.ecdsa)}}if(!(`ed25519`in t)||!(`ecdsa`in t))throw Error(`CommittedSignerPackageSetV1 fields are invalid`);let r=at(t.ed25519),i=ot(t.ecdsa);if(r.materialActivation.activationId===i.materialActivation.activationId)throw Error(`CommittedSignerPackageSetV1 activation references must be distinct`);return{kind:`committed_signer_package_set_v1`,keyFamilies:n,ed25519:r,ecdsa:i}}function it(e){return F(e)}function at(e){let t=ft(e);if(t.kind!==`committed_ed25519_signer_package_v1`)throw Error(`CommittedEd25519SignerPackageV1.kind is invalid`);let n=ct(t.materialActivation,`materialActivation`),r=Se(t.targetBinding),i=xe(t.applicationBinding),a=we(t.activationReceipt);if(!s(n,Ne(a.material_activation)))throw Error(`CommittedEd25519SignerPackageV1 activation receipt does not match material`);if(!s(n,Ne(r.material_activation)))throw Error(`CommittedEd25519SignerPackageV1 target binding does not match material`);let o=st(t.deriver_a_client_package,`deriver_a_client_package`,`deriver_a`),c=st(t.deriver_b_client_package,`deriver_b_client_package`,`deriver_b`);if(!be(a.transcript,o.transcript)||!be(a.transcript,c.transcript))throw Error(`CommittedEd25519SignerPackageV1 receipt transcript does not match packages`);return{kind:`committed_ed25519_signer_package_v1`,materialActivation:n,targetBinding:r,applicationBinding:i,participantIds:Te(t.participantIds),activationReceipt:a,deriver_a_client_package:o,deriver_b_client_package:c}}function ot(e){let t=pt(e);if(t.kind!==`committed_ecdsa_signer_package_v1`)throw Error(`CommittedEcdsaSignerPackageV1.kind is invalid`);let n=ct(t.materialActivation,`materialActivation`),r=Ee(t.activationReceipt),i=r.binding.target.activation;if(!s(n,i))throw Error(`CommittedEcdsaSignerPackageV1 receipt activation does not match material`);let a=ke(t.encryptedTargetClientShare,`encryptedTargetClientShare`);if(a.recipientPublicKeyB64u!==r.binding.target.clientRecipientPublicKeyB64u)throw Error(`CommittedEcdsaSignerPackageV1 client share recipient does not match receipt`);return{kind:`committed_ecdsa_signer_package_v1`,materialActivation:n,encryptedTargetClientShare:a,activationReceipt:r}}function st(e,t,n){let r=Ce(e);if(!r.ok)throw Error(`${t} ${r.message}`);if(r.value.kind!==`activation_client`||r.value.deriver!==n)throw Error(`${t} must be an activation_client for ${n}`);return{kind:`activation_client`,deriver:n,session:r.value.session,transcript:r.value.transcript,encapsulated_key:r.value.encapsulated_key,ciphertext:r.value.ciphertext}}function ct(e,t){let n=o(e);if(!n.ok)throw Error(`${t} ${n.error.message}`);return n.value}function lt(e){if(!Array.isArray(e))throw Error(`CommittedSignerPackageSetV1.keyFamilies must be an array`);if(e.length===1&&e[0]===`ed25519`)return[`ed25519`];if(e.length===1&&e[0]===`ecdsa_secp256k1`)return[`ecdsa_secp256k1`];if(e.length===2&&e[0]===`ed25519`&&e[1]===`ecdsa_secp256k1`)return[`ed25519`,`ecdsa_secp256k1`];throw Error(`CommittedSignerPackageSetV1.keyFamilies must use canonical family order`)}function ut(e){let t=mt(e);if(t===null)throw Error(`CommittedAuthorityPackagesV1 must be an object`);return U(t,[`kind`,`authority`,`authMethod`,`signerPackages`,`ed25519ExportRootPackage`,`packageSetDigestB64u`],`CommittedAuthorityPackagesV1`),{kind:Reflect.get(t,`kind`),authority:Reflect.get(t,`authority`),authMethod:Reflect.get(t,`authMethod`),signerPackages:Reflect.get(t,`signerPackages`),ed25519ExportRootPackage:Reflect.get(t,`ed25519ExportRootPackage`),packageSetDigestB64u:Reflect.get(t,`packageSetDigestB64u`)}}function dt(e){let t=mt(e);if(t===null)throw Error(`CommittedSignerPackageSetV1 must be an object`);let n=Object.keys(t),r=n.includes(`ed25519`),i=n.includes(`ecdsa`);return r&&i?(U(t,[`kind`,`keyFamilies`,`ed25519`,`ecdsa`],`CommittedSignerPackageSetV1`),{kind:Reflect.get(t,`kind`),keyFamilies:Reflect.get(t,`keyFamilies`),ed25519:Reflect.get(t,`ed25519`),ecdsa:Reflect.get(t,`ecdsa`)}):r?(U(t,[`kind`,`keyFamilies`,`ed25519`],`CommittedSignerPackageSetV1`),{kind:Reflect.get(t,`kind`),keyFamilies:Reflect.get(t,`keyFamilies`),ed25519:Reflect.get(t,`ed25519`)}):i?(U(t,[`kind`,`keyFamilies`,`ecdsa`],`CommittedSignerPackageSetV1`),{kind:Reflect.get(t,`kind`),keyFamilies:Reflect.get(t,`keyFamilies`),ecdsa:Reflect.get(t,`ecdsa`)}):(U(t,[`kind`,`keyFamilies`],`CommittedSignerPackageSetV1`),{kind:Reflect.get(t,`kind`),keyFamilies:Reflect.get(t,`keyFamilies`)})}function ft(e){let t=mt(e);if(t===null)throw Error(`CommittedEd25519SignerPackageV1 must be an object`);return U(t,[`kind`,`materialActivation`,`targetBinding`,`applicationBinding`,`participantIds`,`activationReceipt`,`deriver_a_client_package`,`deriver_b_client_package`],`CommittedEd25519SignerPackageV1`),{kind:Reflect.get(t,`kind`),materialActivation:Reflect.get(t,`materialActivation`),targetBinding:Reflect.get(t,`targetBinding`),applicationBinding:Reflect.get(t,`applicationBinding`),participantIds:Reflect.get(t,`participantIds`),activationReceipt:Reflect.get(t,`activationReceipt`),deriver_a_client_package:Reflect.get(t,`deriver_a_client_package`),deriver_b_client_package:Reflect.get(t,`deriver_b_client_package`)}}function pt(e){let t=mt(e);if(t===null)throw Error(`CommittedEcdsaSignerPackageV1 must be an object`);return U(t,[`kind`,`materialActivation`,`encryptedTargetClientShare`,`activationReceipt`],`CommittedEcdsaSignerPackageV1`),{kind:Reflect.get(t,`kind`),materialActivation:Reflect.get(t,`materialActivation`),encryptedTargetClientShare:Reflect.get(t,`encryptedTargetClientShare`),activationReceipt:Reflect.get(t,`activationReceipt`)}}function mt(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function U(e,t,n){let r=new Set(t),i=Object.keys(e);if(i.length!==t.length)throw Error(`${n} contains unexpected fields`);for(let e of i)if(!r.has(e))throw Error(`${n} contains unexpected fields`);for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r))throw Error(`${n}.${r} is required`)}const ht=[`version`,`purpose`,`linkSessionId`,`linkPublicKeyB64u`,`devicePublicKeyB64u`,`requestedPermission`,`targetFactor`,`issuedAtMs`,`expiresAtMs`];function gt(...e){return(t,n)=>{if(!e.includes(t))throw Error(`${n} is unsupported`);return t}}function _t(e,t){if(typeof e!=`string`||!/^[0-9a-f]{64}$/.test(e))throw Error(`${t} must be 32 canonical lowercase hex bytes`);return e}function W(e,t){if(typeof e!=`string`||e.length===0||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`${t} must be canonical unpadded base64url`);try{let t=f(e);if(t.length!==32||d(t)!==e)throw Error(`non-canonical`)}catch{throw Error(`${t} must be a canonical 32-byte unpadded base64url key`)}return e}function G(e,t){if(typeof e!=`string`||e.length===0||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`${t} must be canonical unpadded base64url`);try{let t=f(e);if(t.length===0||d(t)!==e)throw Error(`non-canonical`)}catch{throw Error(`${t} must be canonical unpadded base64url`)}return e}function vt(e,t,n){let r=G(e,n),i=f(r);try{if(i.length!==t)throw Error(`${n} must encode ${t} bytes`);return r}finally{i.fill(0)}}const K=BigInt(`0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff`),yt=K-3n,bt=BigInt(`0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b`);function xt(e){let t=0n;for(let n of e)t=t<<8n|BigInt(n);return t}function St(e){let t=xt(e.subarray(1,33)),n=xt(e.subarray(33,65));return t>=K||n>=K?!1:n*n%K===(t*t*t%K+yt*t%K+bt)%K}function q(e,t){let n=vt(e,65,t),r=f(n);try{if(r[0]!==4)throw Error(`${t} must be an uncompressed SEC1 P-256 point`);if(!St(r))throw Error(`${t} must be an on-curve P-256 point`);return n}finally{r.fill(0)}}function Ct(e){return W(e,`LinkDevicePublicKeyB64u`)}function wt(e,t){return de(G(e,t),t)}function Tt(e,t){if(e!==`ed25519`&&e!==`ecdsa_secp256k1`)throw Error(`${t} must identify a supported key family`);return e}function J(e,t,n){if(t<=e)throw Error(`${n}.expiresAtMs must be after issuedAtMs`)}function Et(e){return{kind:e.kind,permissions:[...ie(e)]}}function Dt(e){let t={version:e.version,purpose:e.purpose,linkSessionId:e.linkSessionId,linkPublicKeyB64u:e.linkPublicKeyB64u,devicePublicKeyB64u:e.devicePublicKeyB64u,requestedPermission:Et(e.requestedPermission),targetFactor:e.targetFactor,issuedAtMs:e.issuedAtMs,expiresAtMs:e.expiresAtMs};return e.targetFactor.kind===`email_otp`?{...t,targetEmail:e.targetEmail}:t}function Y(e,t){switch(A(e,[`kind`],t).kind){case`passkey_prf`:return{kind:`passkey_prf`};case`email_otp`:return{kind:`email_otp`};default:throw Error(`${t}.kind is unsupported`)}}function Ot(){return b({kind:h(`passkey_prf`)})}function kt(){return b({kind:h(`email_otp`)})}function At(){return b({kind:h(`existing_enrollment`)})}function jt(){return b({kind:h(`new_enrollment`)})}function Mt(){return _(`kind`,[At(),jt()])}function Nt(e,t){return Mt()(e,t)}function Pt(){return b({enrollmentSealKeyVersion:O,clientUnlockPublicKeyB64u:O,unlockKeyVersion:O,serverSealedFactorCiphertextB64u:O})}function Ft(e,t){let n=u(e,t);if(n.kind===`passkey_prf`)return A(n,[`kind`],t),{kind:`passkey_prf`};if(n.kind===`email_otp`){let e=Nt(n.enrollment,`${t}.enrollment`),r=T(n.targetEmail,`${t}.targetEmail`);return e.kind===`existing_enrollment`?{kind:`email_otp`,targetEmail:r,enrollment:e,baseWalletAuthMethodId:S(A(n,[`kind`,`targetEmail`,`enrollment`,`baseWalletAuthMethodId`],t).baseWalletAuthMethodId,`${t}.baseWalletAuthMethodId`)}:(A(n,[`kind`,`targetEmail`,`enrollment`],t),{kind:`email_otp`,targetEmail:r,enrollment:e})}throw Error(`${t}.kind is unsupported`)}function It(e){if(e.version!==`v5`)throw Error(`QrLinkedDeviceSessionPayloadV5.version is invalid`);if(e.purpose!==`linked_device_lane_creation`)throw Error(`QrLinkedDeviceSessionPayloadV5.purpose is invalid`);let t=x(e.issuedAtMs,`QrLinkedDeviceSessionPayloadV5.issuedAtMs`),n=x(e.expiresAtMs,`QrLinkedDeviceSessionPayloadV5.expiresAtMs`);J(t,n,`QrLinkedDeviceSessionPayloadV5`);let r={version:`v5`,purpose:`linked_device_lane_creation`,linkSessionId:N(e.linkSessionId,`QrLinkedDeviceSessionPayloadV5.linkSessionId`),linkPublicKeyB64u:W(e.linkPublicKeyB64u,`QrLinkedDeviceSessionPayloadV5.linkPublicKeyB64u`),devicePublicKeyB64u:W(e.devicePublicKeyB64u,`QrLinkedDeviceSessionPayloadV5.devicePublicKeyB64u`),requestedPermission:k(e.requestedPermission,`QrLinkedDeviceSessionPayloadV5.requestedPermission`),targetFactor:Y(e.targetFactor,`QrLinkedDeviceSessionPayloadV5.targetFactor`),issuedAtMs:t,expiresAtMs:n};return r.targetFactor.kind===`email_otp`?{...r,targetFactor:{kind:`email_otp`},targetEmail:T(e.targetEmail,`QrLinkedDeviceSessionPayloadV5.targetEmail`)}:{...r,targetFactor:{kind:`passkey_prf`}}}function Lt(e){let t=u(e,`QrLinkedDeviceSessionPayloadV5`);return It(A(t,Y(t.targetFactor,`QrLinkedDeviceSessionPayloadV5.targetFactor`).kind===`email_otp`?[...ht,`targetEmail`]:ht,`QrLinkedDeviceSessionPayloadV5`))}function Rt(e){let t=It(Dt(e)),n={v:5,s:t.linkSessionId,l:t.linkPublicKeyB64u,d:t.devicePublicKeyB64u,a:Et(t.requestedPermission),f:t.targetFactor.kind===`passkey_prf`?`p`:`e`,i:t.issuedAtMs,e:t.expiresAtMs};return t.targetFactor.kind===`email_otp`?JSON.stringify({...n,t:t.targetEmail}):JSON.stringify(n)}function zt(){return b({payload:Lt,requestedAtMs:x})}function Bt(e){return zt()(e,`LinkedDeviceOwnerAuthorizationRequestV1`)}function Vt(){let e=e=>b({state:h(e),deviceId:ue});return[b({state:h(`displaying_qr`)}),e(`claimed`),e(`awaiting_target_factor`),e(`awaiting_source_contribution`),e(`provisioning`),b({state:h(`authority_pending_local_install`),deviceId:ue,authorityId:M,packageSetDigestB64u:C}),b({state:h(`active`),deviceId:ue,authorityId:M,activatedAtMs:x}),b({state:h(`failed_before_commit`),error:Ut}),b({state:h(`cancelled`),cancelledAtMs:x}),b({state:h(`expired`),expiredAtMs:x})]}function Ht(e){let t=u(e,`LinkSessionStateV1`).state;if(typeof t!=`string`)throw Error(`LinkSessionStateV1.state is invalid`);let n=Vt().find(e=>e.shape.state.literals.includes(t));if(!n)throw Error(`LinkSessionStateV1.state ${t} is unsupported`);return n(e,`LinkSessionStateV1.${t}`)}function Ut(e){let t=A(e,[`kind`,`reason`],`LinkPrecommitFailureV1`);if(t.kind!==`invalid_input`&&t.kind!==`unauthorized_source`&&t.kind!==`revoked_source`&&t.kind!==`permission_attenuation_failed`&&t.kind!==`target_factor_failed`&&t.kind!==`expired_session`&&t.kind!==`cancelled_session`&&t.kind!==`claim_conflict`&&t.kind!==`package_preparation_failed`)throw Error(`LinkPrecommitFailureV1.kind is invalid`);return{kind:t.kind,reason:O(t.reason,`LinkPrecommitFailureV1.reason`)}}function Wt(){return b({kind:h(`linked_device_session_projection_v1`),linkSessionId:N,qrPayload:Lt,revision:E,createdAtMs:x,updatedAtMs:x,state:Ht})}function Gt(e){return Wt()(e,`LinkSessionProjectionV1`)}function Kt(){return b({kind:h(`linked_device_session_event_v1`),linkSessionId:N,state:Ht,emittedAtMs:x})}function qt(e){return Kt()(e,`LinkSessionTransportEventV1`)}function Jt(){return _(`outcome`,[b({outcome:h(`pending`),state:Xt}),b({outcome:h(`replayed`),replay:b({state:()=>`pending`,session:Xt})})])}function Yt(e){return Jt()(e,`LinkedDeviceApprovalResultV1`)}function Xt(e){let t=Ht(e);switch(t.state){case`awaiting_target_factor`:case`awaiting_source_contribution`:case`provisioning`:case`authority_pending_local_install`:return t;default:throw Error(`LinkedDeviceApprovalResultV1 state is not pending`)}}function Zt(){return b({kind:h(`linked_device_session_claim_v1`),linkSessionId:N,walletId:y,enrollmentId:D,deviceId:w,devicePublicKeyB64u:W,targetFactor:Y,sessionRevision:x,claimedAtMs:x,claimExpiresAtMs:x},(e,t)=>J(e.claimedAtMs,e.claimExpiresAtMs,t))}function Qt(e){return Zt()(e,`LinkedDeviceSessionClaimV1`)}function $t(){return b({kind:h(`wallet_session`),walletSessionId:ae,authorizationId:pe})}function en(e,t=`ownerAuthorization`){if(u(e,t).kind!==`wallet_session`)throw Error(`${t}.kind is unsupported`);return $t()(e,t)}function tn(){return{kind:h(`linked_device_approval_v1`),linkSessionId:N,walletId:y,enrollmentId:D,deviceId:w,linkPublicKeyB64u:W,devicePublicKeyB64u:W,permission:k,targetFactor:Ft,ownerAuthorization:en,approvedAtMs:x,expiresAtMs:x}}function nn(e,t){J(e.approvedAtMs,e.expiresAtMs,t)}function rn(){return b(tn(),nn)}function an(){return b({...tn(),sourceContribution:Ae},nn)}function on(e){let t=u(e,`LinkedDeviceApprovalV1`);return(t.sourceContribution===void 0?rn():an())(t,`LinkedDeviceApprovalV1`)}function sn(){return b({kind:h(`linked_device_approval_delivery_v1`),approval:on})}function cn(e){return sn()(e,`LinkedDeviceApprovalDeliveryV1`)}function ln(){return{kind:h(`linked_device_target_preparation_v1`),linkSessionId:N,walletId:y,enrollmentId:D,deviceId:w,deliveryRecipientPublicKey65B64u:q,walletAuthMethodId:S,ed25519ExportRoot:oe(Cn()),ordinarySignerMaterialRecipientRequirements:En,issuedAtMs:x,expiresAtMs:x}}function un(e,t){if(e.expiresAtMs<=e.issuedAtMs)throw Error(`${t}.expiresAtMs must follow issuedAtMs`)}function dn(){return b({...ln(),targetFactor:Ot(),passkeyCreationOptions:Sn,passkeyConfigurationDigestB64u:C},(e,t)=>{if(un(e,t),e.passkeyCreationOptions.walletAuthMethodId!==e.walletAuthMethodId)throw Error(`${t}.passkeyCreationOptions.walletAuthMethodId must match the preparation`)})}function fn(){return b({...ln(),targetFactor:kt(),targetEmail:T,enrollment:At(),baseWalletAuthMethodId:S},un)}function pn(){return b({...ln(),targetFactor:kt(),targetEmail:T,enrollment:jt()},un)}function mn(e){let t=`LinkedDeviceTargetPreparationV1`,n=u(e,t);return Y(n.targetFactor,`${t}.targetFactor`).kind===`passkey_prf`?dn()(n,t):(Nt(n.enrollment,`${t}.enrollment`).kind===`new_enrollment`?pn():fn())(n,t)}function hn(){return b({kind:h(`linked_device_target_preparation_request_v1`),linkSessionId:N,deliveryRecipientPublicKey65B64u:q})}function gn(e){return hn()(e,`LinkedDeviceTargetPreparationRequestV1`)}function _n(){return b({baseWalletAuthMethodId:S,maskedEmailHint:(e,t)=>{if(typeof e!=`string`||e.length===0)throw Error(`${t} is invalid`);return e}})}function vn(){let e=_n(),t=t=>e(t,`LinkedDeviceEmailOtpBaseFactorChoiceV1`);return{selected:b({kind:h(`selected`),choice:t}),selection_required:b({kind:h(`selection_required`),choices:(e,n)=>{if(!Array.isArray(e)||e.length===0)throw Error(`${n} must not be empty`);let r=e.map(t);return[r[0],...r.slice(1)]}}),unavailable:b({kind:h(`unavailable`),reason:gt(`no_active_email_otp_base_factor`)})}}function yn(e){let t=`LinkedDeviceEmailOtpBaseFactorResolutionV1`,n=u(e,t),r=vn();switch(n.kind){case`selected`:case`selection_required`:case`unavailable`:return r[n.kind](n,t);default:throw Error(`${t}.kind is unsupported`)}}function bn(){return b({revision:x,resolution:yn})}function xn(e){return bn()(e,`LinkedDeviceEmailOtpBaseFactorResolutionResultV1`)}function Sn(e,t){let n=A(e,[`kind`,`walletAuthMethodId`,`challengeId`,`challengeB64u`,`rpId`,`user`,`pubKeyCredParams`,`authenticatorSelection`,`timeoutMs`,`attestation`,`extensions`,`excludeCredentials`],t),r=S(n.walletAuthMethodId,`${t}.walletAuthMethodId`);if(A(n.user,[`idB64u`,`name`,`displayName`],`${t}.user`),A(n.authenticatorSelection,[`residentKey`,`userVerification`],`${t}.authenticatorSelection`),A(A(A(n.extensions,[`prf`],`${t}.extensions`).prf,[`eval`],`${t}.extensions.prf`).eval,[`firstB64u`,`secondB64u`],`${t}.extensions.prf.eval`),!Array.isArray(n.pubKeyCredParams))throw Error(`${t}.pubKeyCredParams must be an array`);if(n.pubKeyCredParams.forEach((e,n)=>{A(e,[`type`,`alg`],`${t}.pubKeyCredParams[${n}]`)}),!Array.isArray(n.excludeCredentials))throw Error(`${t}.excludeCredentials must be an array`);n.excludeCredentials.forEach((e,n)=>{A(e,[`type`,`id`],`${t}.excludeCredentials[${n}]`)});let i=et(n);return{kind:i.kind,walletAuthMethodId:r,challengeId:i.challengeId,challengeB64u:i.challengeB64u,rpId:i.rpId,user:i.user,pubKeyCredParams:i.pubKeyCredParams,authenticatorSelection:i.authenticatorSelection,timeoutMs:i.timeoutMs,attestation:i.attestation,extensions:i.extensions,excludeCredentials:i.excludeCredentials}}function Cn(){return b({kind:h(`linked_device_ed25519_export_root_preparation_v1`),walletKeyId:p,applicationBindingDigestB64u:C,registeredPublicKeyB64u:ne,revocationEpoch:E})}function wn(e,t,n){if(!Array.isArray(e)||e.length===0||e.length>2)throw Error(`${n} must contain one or two entries`);let r=e.map((e,r)=>t(e,`${n}[${r}]`));if(new Set(r.map(e=>e.keyFamily)).size!==r.length)throw Error(`${n} repeats a key family`);if(new Set(r.map(e=>String(e.walletKeyId))).size!==r.length)throw Error(`${n} repeats a wallet key`);if(r.length===2&&(r[0]?.keyFamily!==`ed25519`||r[1]?.keyFamily!==`ecdsa_secp256k1`))throw Error(`${n} must be ordered Ed25519 then ECDSA`);return r}function Tn(){return b({kind:h(`ordinary_signer_material_recipient_requirement_v1`),keyFamily:Tt,walletKeyId:p})}function En(e){let t=wn(e,Tn(),`LinkedDeviceTargetPreparationV1.ordinarySignerMaterialRecipientRequirements`),n=t[0];if(!n)throw Error(`ordinary signer material recipient requirements are empty`);return[n,...t.slice(1)]}const Dn=h(`ble`,`cable`,`hybrid`,`internal`,`nfc`,`smart-card`,`usb`);function On(e,t){let n=te(e,t).map((e,n)=>Dn(e,`${t}[${n}]`));if(new Set(n).size!==n.length)throw Error(`${t} contains duplicates`);return n}function kn(){return b({kind:h(`linked_device_webauthn_registration_v1`),credentialIdB64u:wt,authenticatorAttachment:oe(h(`platform`,`cross-platform`)),clientDataJsonB64u:G,attestationObjectB64u:G,transports:On})}function An(){let e=e=>(t,n)=>{if(t!==e)throw Error(`${n} does not match its kind`);return e};return _(`kind`,[b({kind:h(`ordinary_ed25519_signer_material_recipient_request_v1`),keyFamily:e(`ed25519`),walletKeyId:p,recipientPublicKeyB64u:(e,t)=>vt(e,32,t)}),b({kind:h(`ordinary_ecdsa_signer_material_recipient_request_v1`),keyFamily:e(`ecdsa_secp256k1`),walletKeyId:p,clientEphemeralPublicKey:Me})])}function X(e){let t=wn(e,An(),`LinkedDeviceTargetCredentialRegistrationV1.ordinarySignerMaterialRecipientRequests`),n=t[0];if(!n)throw Error(`ordinary signer material recipient requests are empty`);return[n,...t.slice(1)]}function jn(){return{kind:h(`linked_device_target_credential_registration_v1`),linkSessionId:N,walletId:y,enrollmentId:D,deviceId:w,walletAuthMethodId:S}}function Mn(){return b({...jn(),targetFactor:Ot(),targetPreparationDigestB64u:C,ordinarySignerMaterialRecipientRequests:X,webauthnRegistration:kn(),registeredAtMs:x})}function Nn(){return b({...jn(),targetFactor:kt(),targetEmail:T,targetPreparationDigestB64u:C,ordinarySignerMaterialRecipientRequests:X,emailOtpVerificationGrant:Z,registeredAtMs:x})}function Pn(){return b({...jn(),targetFactor:kt(),targetEmail:T,targetPreparationDigestB64u:C,ordinarySignerMaterialRecipientRequests:X,emailOtpVerificationGrant:Z,emailOtpEnrollment:Pt(),registeredAtMs:x})}function Fn(e){let t=`LinkedDeviceTargetCredentialRegistrationV1`,n=u(e,t);return Y(n.targetFactor,`${t}.targetFactor`).kind===`passkey_prf`?Mn()(n,t):(Z(n.emailOtpVerificationGrant).enrollment.kind===`new_enrollment`?Pn():Nn())(n,t)}function In(){return b({kind:h(`linked_device_target_credential_registration_result_v1`),outcome:h(`applied`,`replayed`),linkSessionId:N,walletId:y,enrollmentId:D,deviceId:w,walletAuthMethodId:S,targetPreparationDigestB64u:C,targetFactor:Hn,ordinarySignerMaterialPreparations:je,ordinarySignerMaterialRecipientRequests:X,keyManifestDigestB64u:C},(e,t)=>{let{authMethod:n}=e.targetFactor;if(n.walletAuthMethodId!==e.walletAuthMethodId||n.walletId!==e.walletId)throw Error(`${t} target identity differs`)})}function Ln(e){return In()(e,`LinkedDeviceTargetCredentialRegistrationResultV1`)}function Rn(e,t){if(e.verifiedAtMs<e.authMethod.createdAtMs)throw Error(`${t}.verifiedAtMs precedes authMethod.createdAtMs`)}function zn(){return b({kind:h(`verified_passkey_target_v1`),authMethod:Wn,verificationDigestB64u:C,verifiedAtMs:x},Rn)}function Bn(){return b({kind:h(`verified_email_otp_target_v1`),authMethod:Kn,targetEmail:T,enrollment:At(),baseWalletAuthMethodId:S,providerUserId:O,verificationDigestB64u:C,verifiedAtMs:x},Rn)}function Vn(){return b({kind:h(`verified_email_otp_target_v1`),authMethod:Kn,targetEmail:T,enrollment:jt(),providerUserId:O,verificationDigestB64u:C,verifiedAtMs:x},Rn)}function Hn(e,t){let n=u(e,t);if(n.kind===`verified_passkey_target_v1`)return zn()(n,t);if(n.kind!==`verified_email_otp_target_v1`)throw Error(`${t}.kind is invalid`);return(Nt(n.enrollment,`${t}.enrollment`).kind===`existing_enrollment`?Bn():Vn())(n,t)}function Un(){return b({walletAuthMethodId:S,walletId:y,createdAtMs:x,kind:h(`passkey`),rpId:fe,credentialIdB64u:de,credentialPublicKeyB64u:G,counter:E})}function Wn(e,t){return Un()(e,t)}function Gn(){return b({walletAuthMethodId:S,walletId:y,createdAtMs:x,kind:h(`email_otp`),emailHashHex:_t,registrationAuthorityId:O})}function Kn(e,t){return Gn()(e,t)}function qn(e){return{kind:h(`linked_device_email_otp_verification_grant_v1`),grantId:O,grantToken:O,challengeId:O,linkSessionId:N,walletId:y,enrollmentId:D,deviceId:w,targetPreparationDigestB64u:C,targetEmail:T,enrollment:e,emailHashHex:_t,registrationAuthorityId:O,providerUserId:O,authorityDigestB64u:C,issuedAtMs:x,expiresAtMs:x}}function Jn(e,t){J(e.issuedAtMs,e.expiresAtMs,t)}function Yn(){return b({...qn(At()),baseWalletAuthMethodId:S},Jn)}function Xn(){return b(qn(jt()),Jn)}function Z(e){let t=`LinkedDeviceEmailOtpVerificationGrantV1`,n=u(e,t);return(Nt(n.enrollment,`${t}.enrollment`).kind===`new_enrollment`?Xn():Yn())(n,t)}function Zn(){return b({kind:h(`email_otp_factor_release_v1`),challengeId:O,enrollmentId:O,enrollmentSealKeyVersion:O,serverEphemeralPublicKey65B64u:q,nonce12B64u:(e,t)=>vt(e,12,t),ciphertextB64u:G})}function Qn(e){return Zn()(e,`LinkedDeviceEmailOtpFactorReleaseEnvelopeV1`)}function $n(){return b({kind:h(`linked_device_email_otp_challenge_start_request_v1`),linkSessionId:N,workerEphemeralPublicKey65B64u:q})}function er(e){return $n()(e,`LinkedDeviceEmailOtpChallengeStartRequestV1`)}function tr(){return b({kind:h(`linked_device_email_otp_challenge_resend_request_v1`),linkSessionId:N,challengeId:O})}function nr(e){return tr()(e,`LinkedDeviceEmailOtpChallengeResendRequestV1`)}function rr(){return b({kind:h(`linked_device_email_otp_challenge_verify_request_v1`),linkSessionId:N,challengeId:O,otpCode:(e,t)=>{if(typeof e!=`string`||!/^[0-9]{6,10}$/.test(e))throw Error(`${t} is invalid`);return e}})}function ir(e){return rr()(e,`LinkedDeviceEmailOtpChallengeVerifyRequestV1`)}function ar(){return b({kind:h(`linked_device_email_otp_challenge_result_v1`),challengeId:O,maskedEmailHint:O,expiresAtMs:x,resendAvailableAtMs:x})}function or(e){return ar()(e,`LinkedDeviceEmailOtpChallengeResultV1`)}function sr(e){let t=A(e,[`kind`,`verificationGrant`,`factorRelease`],`LinkedDeviceEmailOtpVerificationResultV1`);if(t.kind!==`linked_device_email_otp_verification_result_v1`)throw Error(`LinkedDeviceEmailOtpVerificationResultV1.kind is invalid`);let n=Z(t.verificationGrant);if(cr(n)){if(t.factorRelease!==null)throw Error(`new linked-device Email OTP enrollment cannot carry a factor release`);return{kind:`linked_device_email_otp_verification_result_v1`,verificationGrant:n,factorRelease:null}}let r=Qn(t.factorRelease);if(r.challengeId!==n.challengeId)throw Error(`LinkedDeviceEmailOtpVerificationResultV1 challenge binding changed`);return{kind:`linked_device_email_otp_verification_result_v1`,verificationGrant:n,factorRelease:r}}function cr(e){return e.enrollment.kind===`new_enrollment`}function lr(e){let t=x(e.issuedAtMs,`QrLinkedDeviceSessionPayloadV5.issuedAtMs`),n=x(e.expiresAtMs,`QrLinkedDeviceSessionPayloadV5.expiresAtMs`);J(t,n,`QrLinkedDeviceSessionPayloadV5`);let r=Y(e.targetFactor,`QrLinkedDeviceSessionPayloadV5.targetFactor`);if(r.kind===`passkey_prf`)return{version:`v5`,purpose:`linked_device_lane_creation`,linkSessionId:e.linkSessionId,linkPublicKeyB64u:e.linkPublicKeyB64u,devicePublicKeyB64u:e.devicePublicKeyB64u,requestedPermission:k(Et(e.requestedPermission),`QrLinkedDeviceSessionPayloadV5.requestedPermission`),targetFactor:r,issuedAtMs:t,expiresAtMs:n};if(e.targetEmail===void 0)throw Error(`QrLinkedDeviceSessionPayloadV5.targetEmail is required for Email OTP`);return{version:`v5`,purpose:`linked_device_lane_creation`,linkSessionId:e.linkSessionId,linkPublicKeyB64u:e.linkPublicKeyB64u,devicePublicKeyB64u:e.devicePublicKeyB64u,requestedPermission:k(Et(e.requestedPermission),`QrLinkedDeviceSessionPayloadV5.requestedPermission`),targetFactor:r,targetEmail:T(e.targetEmail,`QrLinkedDeviceSessionPayloadV5.targetEmail`),issuedAtMs:t,expiresAtMs:n}}function ur(e){return{kind:`linked_device_session_claim_request_v1`,payload:e}}function dr(e,t,n){let r=x(e,`${n}.approvedAtMs`),i=x(t,`${n}.expiresAtMs`);return J(r,i,n),{approvedAtMs:r,expiresAtMs:i}}function fr(e){let t=dr(e.approvedAtMs,e.expiresAtMs,`LinkedDeviceApprovalV1`);return on({kind:`linked_device_approval_v1`,...e,...t})}function pr(e){return Fn({kind:`linked_device_target_credential_registration_v1`,...e})}function mr(e){return{kind:`linked_device_session_cancel_unclaimed_request_v1`,linkSessionId:e.linkSessionId,reason:`user_cancelled`,requestedAtMs:x(e.requestedAtMs,`LinkedDeviceSessionCancelUnclaimedRequestV1.requestedAtMs`)}}function hr(e){return{kind:`linked_device_session_cancel_claimed_request_v1`,...e,requestedAtMs:x(e.requestedAtMs,`LinkedDeviceSessionCancelClaimedRequestV1.requestedAtMs`)}}const gr=[`chrome`,`safari`,`firefox`,`edge`,`other`],_r=[`macos`,`ios`,`windows`,`android`,`linux`,`other`];function vr(e){return typeof e==`string`&&gr.some(t=>t===e)}function yr(e){return typeof e==`string`&&_r.some(t=>t===e)}function br(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=typeof t.label==`string`?t.label.trim():``;if(!n||!vr(t.browser)||!yr(t.os)||typeof t.synced!=`boolean`||!Array.isArray(t.transports))return null;let r=t.transports.map(e=>typeof e==`string`?e.trim():``).filter(e=>e.length>0),i=typeof t.provider==`string`?t.provider.trim():``,a=typeof t.providerLabel==`string`?t.providerLabel.trim():``;return{label:n,browser:t.browser,os:t.os,synced:t.synced,transports:r,...i?{provider:i}:{},...a?{providerLabel:a}:{}}}function xr(e){return(t,n)=>{if(!Array.isArray(t))throw Error(`${n} is invalid`);return t.map((t,r)=>e(t,`${n}[${r}]`))}}function Sr(e,t){let n=S(e,t);if(n.startsWith(`wallet-authority:`)||n.startsWith(`authority:`))throw Error(`${t} must identify a WalletAuthMethodId`);return n}function Cr(e,t){let n=E(e,t);if(n<1)throw Error(`${t} must be a positive safe integer`);return n}function wr(e,t){let n=br(e);if(!n)throw Error(`${t} is invalid`);return n}function Tr(){return _(`kind`,[b({kind:h(`passkey`),walletAuthMethodId:S,credentialIdB64u:de,device:wr}),b({kind:h(`email_otp`),walletAuthMethodId:S}),b({kind:h(`voiceid`),walletAuthMethodId:S,deviceKeyId:C})])}function Er(e,t){return Tr()(e,t)}function Dr(){return b({deviceId:w,enrollmentId:D,walletId:y,credential:Er,permission:k,keyManifestDigestB64u:C,coveredWalletKeys:xr(p),state:h(`provisioning`,`active`,`suspended`,`expired`,`revoked`),createdAtMs:x,lastActivityAtMs:x,revocationEpoch:E})}function Or(e){return Dr()(e,`LinkedDeviceSummaryV1`)}function kr(){return b({kind:h(`linked_device_list_request_v1`),walletId:y,limit:Cr,cursor:se})}function Ar(e){return kr()(e,`LinkedDeviceListRequestV1`)}function jr(){return b({walletId:y,walletAuthorityId:M,credential:Er,createdAtMs:x,lastActivityAtMs:x})}function Mr(){let e=jr();return b({devices:xr(Or),ownerDevices:xr(t=>e(t,`OwnerDeviceSummaryV1`)),nextCursor:se})}function Nr(e){return Mr()(e,`LinkedDeviceListResultV1`)}function Pr(){return b({kind:h(`linked_device_revoke_request_v1`),walletId:y,walletAuthMethodId:Sr,requestedAtMs:x})}function Fr(e){return Pr()(e,`LinkedDeviceRevokeRequestV1`)}function Ir(){return b({kind:h(`not_found`,`conflict`,`unauthorized`)})}function Lr(){return b({kind:h(`revoked`),walletAuthMethodId:Sr,authorityId:M,revocationEpoch:E})}function Rr(e){let t=u(e,`LinkedDeviceRevokeResultV1`);return(t.kind===`not_found`||t.kind===`conflict`||t.kind===`unauthorized`?Ir():Lr())(t,`LinkedDeviceRevokeResultV1`)}function zr(e){return ee({domain:`seams/linked-device/wallet-session-credential-delivery-aad/v1`,aad:e})}function Br(e){let t=qr(e,[`kind`,`namespace`,`orgId`,`projectId`,`envId`,`tenantId`,`principalId`],`LinkedDeviceWalletSessionCredentialDeliveryBindingV1`);if(t.kind!==`linked_device_wallet_session_credential_delivery_binding_v1`)throw Error(`LinkedDeviceWalletSessionCredentialDeliveryBindingV1.kind is invalid`);return{kind:`linked_device_wallet_session_credential_delivery_binding_v1`,namespace:Q(t.namespace,`namespace`),orgId:Q(t.orgId,`orgId`),projectId:Q(t.projectId,`projectId`),envId:Q(t.envId,`envId`),tenantId:$(ve(t.tenantId)),principalId:$(he(t.principalId))}}async function Vr(e){return P(zr(e))}async function Hr(e){return P(ee({domain:`seams/linked-device/wallet-session-credential-delivery-envelope/v1`,envelope:e}))}async function Ur(e){if(await Vr(e.aad)!==e.aadDigestB64u)throw Error(`linked-device Wallet Session credential delivery AAD digest is invalid`);if(await Hr(e.envelope)!==e.envelopeDigestB64u)throw Error(`linked-device Wallet Session credential delivery envelope digest is invalid`);if(await P(ee({domain:`seams/linked-device/delivery-recipient/v1`,recipientPublicKey65B64u:e.aad.recipientPublicKey65B64u}))!==e.recipientBindingDigestB64u)throw Error(`linked-device Wallet Session credential delivery recipient binding is invalid`)}function Wr(e){let t=qr(e,[`kind`,`aad`,`aadDigestB64u`,`recipientBindingDigestB64u`,`envelope`,`envelopeDigestB64u`,`installationReceiptDigestB64u`],`LinkedDeviceWalletSessionCredentialDeliveryV1`);if(t.kind!==`linked_device_wallet_session_credential_delivery_v1`)throw Error(`LinkedDeviceWalletSessionCredentialDeliveryV1.kind is invalid`);return{kind:`linked_device_wallet_session_credential_delivery_v1`,aad:Gr(t.aad),aadDigestB64u:F(t.aadDigestB64u),recipientBindingDigestB64u:F(t.recipientBindingDigestB64u),envelope:Kr(t.envelope),envelopeDigestB64u:F(t.envelopeDigestB64u),installationReceiptDigestB64u:F(t.installationReceiptDigestB64u)}}function Gr(e){let n=qr(e,[`kind`,`namespace`,`orgId`,`projectId`,`envId`,`tenantId`,`principalId`,`linkSessionId`,`walletId`,`authorityId`,`walletAuthMethodId`,`authorizationId`,`walletSessionId`,`quotaId`,`credentialDigestB64u`,`recipientPublicKey65B64u`,`issuedAtMs`,`expiresAtMs`],`LinkedDeviceWalletSessionCredentialDeliveryAadV1`);if(n.kind!==`linked_device_wallet_session_credential_delivery_aad_v1`)throw Error(`LinkedDeviceWalletSessionCredentialDeliveryAadV1.kind is invalid`);let i=Jr(n.issuedAtMs,`issuedAtMs`),a=Jr(n.expiresAtMs,`expiresAtMs`);if(a<=i)throw Error(`expiresAtMs must be after issuedAtMs`);return{kind:`linked_device_wallet_session_credential_delivery_aad_v1`,namespace:Q(n.namespace,`namespace`),orgId:Q(n.orgId,`orgId`),projectId:Q(n.projectId,`projectId`),envId:Q(n.envId,`envId`),tenantId:$(ve(n.tenantId)),principalId:$(he(n.principalId)),linkSessionId:$(l(n.linkSessionId)),walletId:$(c(n.walletId)),authorityId:$(r(n.authorityId)),walletAuthMethodId:$(t(n.walletAuthMethodId)),authorizationId:$(_e(n.authorizationId)),walletSessionId:$(ge(n.walletSessionId)),quotaId:$(me(n.quotaId)),credentialDigestB64u:F(n.credentialDigestB64u),recipientPublicKey65B64u:Xr(n.recipientPublicKey65B64u,65),issuedAtMs:i,expiresAtMs:a}}function Kr(e){let t=qr(e,[`kind`,`algorithm`,`serverEphemeralPublicKey65B64u`,`nonce12B64u`,`ciphertextB64u`],`LinkedDeviceWalletSessionCredentialEnvelopeV1`);if(t.kind!==`linked_device_wallet_session_credential_envelope_v1`||t.algorithm!==`p256-ecdh-aes256gcm-v1`)throw Error(`LinkedDeviceWalletSessionCredentialEnvelopeV1 identity is invalid`);return{kind:`linked_device_wallet_session_credential_envelope_v1`,algorithm:`p256-ecdh-aes256gcm-v1`,serverEphemeralPublicKey65B64u:Xr(t.serverEphemeralPublicKey65B64u,65),nonce12B64u:Xr(t.nonce12B64u,12),ciphertextB64u:Yr(t.ciphertextB64u)}}function qr(e,t,n){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`${n} must be an object`);let r=e,i=new Set(t);for(let e of Object.keys(r))if(!i.has(e))throw Error(`${n}.${e} is not supported`);for(let e of t)if(!(e in r))throw Error(`${n}.${e} is required`);return r}function Q(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw Error(`${t} is required`);return e}function Jr(e,t){if(!Number.isSafeInteger(e)||Number(e)<=0)throw Error(`${t} is invalid`);return Number(e)}function Yr(e){let t=Q(e,`base64url`);if(d(f(t))!==t)throw Error(`base64url is not canonical`);return t}function Xr(e,t){let n=Yr(e),r=f(n);if(r.length!==t)throw Error(`base64url must contain ${t} bytes`);if(t===65&&r[0]!==4)throw Error(`P-256 public key is invalid`);return n}function $(e){if(!e.ok)throw Error(e.error.message);return e.value}function Zr(e,t){let n=Oe(e);if(!n.ok)throw Error(`${t} ${n.error}`);return n.value}function Qr(){return b({kind:h(`local_authority_installation_receipt_v1`),authorityId:j(M),walletId:j(y),authMethodId:j(S),deviceId:j(ue),packageSetDigestB64u:j(C),installedActivationRefs:Zr,installedRecordSetDigestB64u:j(C),targetFactorVerificationDigestB64u:j(C),installedAtMs:j(x)})}function $r(e){return Qr()(e,`LocalAuthorityInstallationReceiptV1`)}function ei(){return b({kind:h(`local_authority_activation_final_ack_v1`),linkSessionId:j(N),authorityId:j(M),packageSetDigestB64u:j(C),authorizationId:j(pe),walletSessionId:j(ae),credentialDigestB64u:j(C),installationReceiptDigestB64u:j(C),acknowledgedAtMs:j(x)})}function ti(e){return ei()(e,`LocalAuthorityActivationFinalAckV1`)}function ni(e){let t=u(e,`ActivateInstalledAuthorityResultV1`);switch(t.kind){case`active`:{g(t,[`kind`,`authority`,`authMethod`,`walletSession`,`deliveryBinding`,`sealedDelivery`],`ActivateInstalledAuthorityResultV1`);let e=De(t.authority);if(!e.ok||e.value.state!==`active`)throw Error(`ActivateInstalledAuthorityResultV1.authority must be active`);let n=Le(t.authMethod);if(!n||n.status!==`active`)throw Error(`ActivateInstalledAuthorityResultV1.authMethod must be active`);let r=le(t.walletSession),i=Br(t.deliveryBinding),a=Wr(t.sealedDelivery);if(e.value.walletId!==n.walletId||e.value.authorityId!==n.walletAuthorityId||r.walletId!==e.value.walletId||r.authorityId!==e.value.authorityId||r.authMethodId!==n.walletAuthMethodId||r.authorityDigestB64u!==e.value.authorityDigestB64u||r.authorityRevocationEpoch!==e.value.revocationEpoch||i.namespace!==a.aad.namespace||i.orgId!==a.aad.orgId||i.projectId!==a.aad.projectId||i.envId!==a.aad.envId||i.tenantId!==a.aad.tenantId||i.principalId!==a.aad.principalId||a.aad.walletId!==r.walletId||a.aad.authorityId!==r.authorityId||a.aad.walletAuthMethodId!==r.authMethodId||a.aad.authorizationId!==r.authorizationId||a.aad.quotaId!==r.quotaId||a.aad.issuedAtMs!==r.issuedAtMs||a.aad.expiresAtMs!==r.expiresAtMs)throw Error(`ActivateInstalledAuthorityResultV1 identities do not match`);return{kind:`active`,authority:e.value,authMethod:n,walletSession:r,deliveryBinding:i,sealedDelivery:a}}case`pending_local_install`:return g(t,[`kind`,`authorityId`,`reason`],`ActivateInstalledAuthorityResultV1`),{kind:`pending_local_install`,authorityId:M(t.authorityId,`authorityId`),reason:ri()(t.reason,`ActivationRetryReasonV1`)};case`integrity_error`:return g(t,[`kind`,`reason`],`ActivateInstalledAuthorityResultV1`),{kind:`integrity_error`,reason:ii(t.reason)};default:throw Error(`ActivateInstalledAuthorityResultV1.kind is invalid`)}}function ri(){return _(`kind`,[b({kind:h(`installation_receipt_not_found`)}),b({kind:h(`server_worker_activation_pending`)}),b({kind:h(`wallet_session_issuance_pending`)})])}function ii(e){let t=u(e,`LinkIntegrityFailureV1`);switch(t.kind){case`authority_id_mismatch`:return g(t,[`kind`,`expectedAuthorityId`,`actualAuthorityId`],`LinkIntegrityFailureV1`),{kind:`authority_id_mismatch`,expectedAuthorityId:M(t.expectedAuthorityId,`expectedAuthorityId`),actualAuthorityId:M(t.actualAuthorityId,`actualAuthorityId`)};case`package_set_digest_mismatch`:return g(t,[`kind`,`expectedPackageSetDigestB64u`,`actualPackageSetDigestB64u`],`LinkIntegrityFailureV1`),{kind:`package_set_digest_mismatch`,expectedPackageSetDigestB64u:C(t.expectedPackageSetDigestB64u,`expectedPackageSetDigestB64u`),actualPackageSetDigestB64u:C(t.actualPackageSetDigestB64u,`actualPackageSetDigestB64u`)};case`installation_receipt_mismatch`:if(g(t,[`kind`,`field`],`LinkIntegrityFailureV1`),t.field!==`walletId`&&t.field!==`authMethodId`&&t.field!==`deviceId`&&t.field!==`targetFactorVerificationDigestB64u`&&t.field!==`installedActivationRefs`)throw Error(`LinkIntegrityFailureV1.field is invalid`);return{kind:`installation_receipt_mismatch`,field:t.field};default:throw Error(`LinkIntegrityFailureV1.kind is invalid`)}}new TextEncoder;async function ai(e){return P(e.token)}function oi(e){return ee({domain:`seams/linked-device/local-authority-installation-receipt/v1`,receipt:e})}async function si(e){return P(oi(e))}function ci(e,t){if(e===void 0)throw Error(`${t} is required`);return e}function li(e){return I(e.kind,`targetFactor.kind`)}function ui(e){let t=e.pubKeyCredParams.map(e=>z([I(e.type,`passkeyCreationOptions.pubKeyCredParams.type`),I(String(e.alg),`passkeyCreationOptions.pubKeyCredParams.alg`)])),n=e.excludeCredentials.map(e=>z([I(e.type,`passkeyCreationOptions.excludeCredentials.type`),I(e.id,`passkeyCreationOptions.excludeCredentials.id`)]));return z([I(e.kind,`passkeyCreationOptions.kind`),I(e.walletAuthMethodId,`passkeyCreationOptions.walletAuthMethodId`),I(e.challengeId,`passkeyCreationOptions.challengeId`),I(e.challengeB64u,`passkeyCreationOptions.challengeB64u`),I(e.rpId,`passkeyCreationOptions.rpId`),I(e.user.idB64u,`passkeyCreationOptions.user.idB64u`),I(e.user.name,`passkeyCreationOptions.user.name`),I(e.user.displayName,`passkeyCreationOptions.user.displayName`),Fe(t.length,`passkeyCreationOptions.pubKeyCredParams`),...t.map(e=>L(e,`passkeyCreationOptions.pubKeyCredParams.item`)),I(e.authenticatorSelection.residentKey,`passkeyCreationOptions.authenticatorSelection.residentKey`),I(e.authenticatorSelection.userVerification,`passkeyCreationOptions.authenticatorSelection.userVerification`),R(e.timeoutMs,`passkeyCreationOptions.timeoutMs`),I(e.attestation,`passkeyCreationOptions.attestation`),I(e.extensions.prf.eval.firstB64u,`passkeyCreationOptions.extensions.prf.eval.firstB64u`),I(e.extensions.prf.eval.secondB64u,`passkeyCreationOptions.extensions.prf.eval.secondB64u`),Fe(n.length,`passkeyCreationOptions.excludeCredentials`),...n.map(e=>L(e,`passkeyCreationOptions.excludeCredentials.item`))])}function di(e){return z([I(e.kind,`recipientRequirement.kind`),I(e.keyFamily,`recipientRequirement.keyFamily`),I(e.walletKeyId,`recipientRequirement.walletKeyId`)])}function fi(e){return e===null?I(`none`,`ed25519ExportRoot.kind`):z([I(e.kind,`ed25519ExportRoot.kind`),I(e.walletKeyId,`ed25519ExportRoot.walletKeyId`),Ie(e.applicationBindingDigestB64u,`ed25519ExportRoot.applicationBindingDigestB64u`),Pe(e.registeredPublicKeyB64u,`ed25519ExportRoot.registeredPublicKeyB64u`),R(e.revocationEpoch,`ed25519ExportRoot.revocationEpoch`)])}function pi(e){let t=e.ordinarySignerMaterialRecipientRequirements.map(di),n=hi(e)?e:void 0,r=n?.passkeyCreationOptions;if(e.targetFactor.kind===`passkey_prf`&&!r)throw Error(`passkey target preparation is missing creation options`);return z([I(`seams/linked-device/target-preparation/v1`,`domain`),I(e.kind,`kind`),I(e.linkSessionId,`linkSessionId`),I(e.walletId,`walletId`),I(e.enrollmentId,`enrollmentId`),I(e.deviceId,`deviceId`),L(Pe(e.deliveryRecipientPublicKey65B64u,`deliveryRecipientPublicKey65B64u`),`deliveryRecipientPublicKey65B64u`),I(e.walletAuthMethodId,`walletAuthMethodId`),L(fi(e.ed25519ExportRoot),`ed25519ExportRoot`),L(li(e.targetFactor),`targetFactor`),...r?[L(ui(r),`passkeyCreationOptions`),Ie(n.passkeyConfigurationDigestB64u,`passkeyConfigurationDigestB64u`)]:[],...mi(e),Fe(t.length,`ordinarySignerMaterialRecipientRequirements`),...t.map(e=>L(e,`ordinarySignerMaterialRecipientRequirements.item`)),R(e.issuedAtMs,`issuedAtMs`),R(e.expiresAtMs,`expiresAtMs`)])}function mi(e){return hi(e)?[]:[I(e.targetEmail,`targetEmail`),I(e.enrollment.kind,`enrollment.kind`),...e.enrollment.kind===`existing_enrollment`?[I(ci(e.baseWalletAuthMethodId,`baseWalletAuthMethodId`),`baseWalletAuthMethodId`)]:[]]}function hi(e){return e.targetFactor.kind===`passkey_prf`}async function gi(e){return ye(pi(e))}const _i=`x-seams-linked-device-proof-v1`,vi=6e4,yi=6e4;async function bi(e){return ye(xi(e,32,`devicePublicKeyB64u`))}function xi(e,t,n){if(typeof e!=`string`||e.length===0||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`${n} is invalid`);let r;try{r=f(e)}catch{throw Error(`${n} is invalid`)}if(r.length!==t||d(r)!==e)throw Error(`${n} is invalid`);return r}export{Ge as $,xn as A,Qt as B,pr as C,qt as D,Gt as E,Qn as F,Rt as G,gn as H,Z as I,ze as J,tt as K,sr as L,or as M,er as N,cn as O,ir as P,Ke as Q,Bt as R,ur as S,Ct as T,mn as U,Ln as V,Lt as W,qe as X,We as Y,Ue as Z,Rr as _,gi as a,hr as b,ni as c,Ur as d,Re as et,Br as f,Fr as g,Nr as h,bi as i,nr as j,Yt as k,ti as l,Ar as m,_i as n,si as o,Wr as p,et as q,vi as r,ai as s,yi as t,$r as u,br as v,lr as w,mr as x,fr as y,en as z};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-dVx5-UGu.js";import{o as t}from"./canonicalPrimitives-Jd3i_Ngz.js";import{G as n,W as r}from"./device-linking-BsUTtSF7.js";var i=e({approveDeviceLinkWithConsent:()=>d,cancelDeviceLinkApproval:()=>f,confirmDeviceLinkApproval:()=>u});const a=`Device linking was cancelled`;let o=null;function s(e){switch(e){case`sign`:return`Sign transactions`;case`export_keys`:return`Export signing keys`;case`link_devices`:return`Link other devices`;case`revoke_devices`:return`Remove devices`;default:throw Error(`Unsupported device permission`)}}var c=class{surface=null;state=`pending`;snapshot;constructor(e,t,r,i){this.requestId=e,this.target=t,this.appearance=r,this.measurement=i,Object.freeze(t.targetFactor),Object.freeze(t.requestedPermission),Object.freeze(t),this.snapshot=n(t)}cancel(){this.state=`cancelled`,this.surface?.close(!1)}assertCurrent(){if(o!==this||this.state===`cancelled`||this.target.expiresAtMs<=Date.now())throw this.cancel(),Error(a)}async confirm(e){if(this.assertCurrent(),this.state!==`pending`)throw Error(`Device approval was already requested`);this.state=`showing`;let n=setTimeout(this.cancel.bind(this),Math.max(0,this.target.expiresAtMs-Date.now()));try{let n=await t(this.snapshot),{mountConfirmUI:r}=await import(`./confirm-ui-BpqwuMSl.js`).then(e=>e.n);this.assertCurrent();let i=this.target.targetFactor.kind===`passkey_prf`?`Passkey`:`Email code: ${this.target.targetEmail}`;this.surface=await r({ctx:{surfaceMeasurementBinding:this.measurement},summary:{title:`Link a device?`,body:[`Wallet: ${String(e).slice(0,12)}…`,`Device request: ${n.slice(0,16)}`,`Sign-in method: ${i}`,``,`This device will be able to:`,...this.target.requestedPermission.permissions.map(l)].join(`
2
+ `)},securityContext:{rpId:window.location.hostname},appearance:this.appearance,uiMode:`modal`}),this.surface.element.dataset.seamsDeviceLinkApproval=n,this.surface.element.dataset.seamsDeviceLinkWallet=e,this.surface.update({confirmText:`Link device`,cancelText:`Cancel`}),this.assertCurrent();let o=await this.surface.takeDecision();if(this.assertCurrent(),o.kind!==`confirmed`)throw this.cancel(),Error(a);this.state=`approved`}finally{clearTimeout(n),this.surface?.close(!1),this.surface=null}}};function l(e){return`• ${s(e)}`}const u=async e=>{let t=o;if(!t||n(e.payload)!==t.snapshot)throw Error(`Device linking requires its exact Wallet-origin approval`);return await t.confirm(e.walletId),{assertCurrent:t.assertCurrent.bind(t)}};async function d(e,t,n){if(o)throw Error(`Another device-link request is active`);let i=e.readMeasurementBinding();if(i.kind!==`wallet_iframe`)throw Error(`Device approval requires the Wallet origin`);let a=r(t),s=new c(i.requestId,a,e.readAppearance(),i);o=s;try{return await e.execute(a,n)}finally{s.cancel(),o===s&&(o=null)}}function f(e){(e.kind===`all`||o?.requestId===e.requestId)&&o?.cancel()}export{i,f as n,u as r,d as t};
@@ -0,0 +1 @@
1
+ import{A as e,D as t,E as n,M as r,N as i,S as a,b as o,c as s,g as c,k as l,o as u}from"./domainIds-t1lp25yU.js";import{S as d,c as ee,r as f,t as p}from"./digests-BIaE0DMd.js";import{i as m,r as h}from"./base64-BmKR3UqU.js";import{J as g,X as te,i as ne,n as re}from"./activeWalletSession-BJ4B-nJo.js";import{d as ie,g as ae,h as oe,m as se,n as ce,u as le}from"./capabilityKinds-DVlGMspk.js";import{n as ue,r as de}from"./canonicalPrimitives-Jd3i_Ngz.js";function fe(e,t){let n=ee(e,t);if(!/^x25519:[0-9a-f]{64}$/.test(n))throw Error(`${t} must use x25519:<64 lowercase hex chars> encoding`);return n}function pe(e,t,n){let r=Object.keys(e).sort(),i=[...t].sort();if(r.length!==i.length||r.some((e,t)=>e!==i[t]))throw Error(`${n} has invalid fields`)}function _(e,t){if(typeof e!=`string`||e.trim()!==e||!e)throw Error(`${t} is required`);if(!/^[\x20-\x7e]+$/.test(e))throw Error(`${t} must be printable ASCII`);return e}function v(e){let t=d(e,`authorization`);switch(t.kind){case`reusable_wallet_session`:return pe(t,[`kind`,`wallet_session_id`],`authorization`),{kind:`reusable_wallet_session`,wallet_session_id:_(t.wallet_session_id,`authorization.wallet_session_id`)};case`operation_step_up`:return pe(t,[`kind`],`authorization`),{kind:`operation_step_up`};default:throw Error(`authorization.kind is not supported`)}}function y(e){let t=d(e,`material_activation`);if(pe(t,[`kind`,`activation_id`,`capability`,`material_owner`,`key_binding`,`lifecycle_binding`,`signing_worker`],`material_activation`),t.kind!==`mpc_material_activation_ref`)throw Error(`material_activation.kind is not supported`);return{kind:`mpc_material_activation_ref`,activation_id:_(t.activation_id,`material_activation.activation_id`),capability:_(t.capability,`material_activation.capability`),material_owner:_(t.material_owner,`material_activation.material_owner`),key_binding:_(t.key_binding,`material_activation.key_binding`),lifecycle_binding:_(t.lifecycle_binding,`material_activation.lifecycle_binding`),signing_worker:_(t.signing_worker,`material_activation.signing_worker`)}}function me(e){return y({kind:e.kind,activation_id:e.activationId,capability:e.capability,material_owner:e.materialOwner,key_binding:e.keyBinding,lifecycle_binding:e.lifecycleBinding,signing_worker:e.signingWorker})}function he(e){let t=y(e),n=c({kind:t.kind,activationId:t.activation_id,capability:t.capability,materialOwner:t.material_owner,keyBinding:t.key_binding,lifecycleBinding:t.lifecycle_binding,signingWorker:t.signing_worker});if(!n.ok)throw Error(`material_activation is invalid: ${n.error.message}`);return n.value}function ge(e){return new TextEncoder().encode(e)}function b(e,t){let n=ge(t),r=n.length>>>0;e.push(r>>>24&255,r>>>16&255,r>>>8&255,r&255),e.push(...n)}function _e(e){let t=v(e),n=[];switch(b(n,t.kind),t.kind){case`reusable_wallet_session`:b(n,t.wallet_session_id);break;case`operation_step_up`:break}return new Uint8Array(n)}function x(e){let t=y(e),n=[];return b(n,t.kind),b(n,t.activation_id),b(n,t.capability),b(n,t.material_owner),b(n,t.key_binding),b(n,t.lifecycle_binding),b(n,t.signing_worker),new Uint8Array(n)}function S(e,t){return e.kind===t.kind&&e.activation_id===t.activation_id&&e.capability===t.capability&&e.material_owner===t.material_owner&&e.key_binding===t.key_binding&&e.lifecycle_binding===t.lifecycle_binding&&e.signing_worker===t.signing_worker}function ve(e,t){if(typeof e!=`string`)throw Error(`EVM-family signing key slot id requires ${t}`);let n=e.trim();if(!n)throw Error(`EVM-family signing key slot id requires ${t}`);return n}function C(e){return encodeURIComponent(ve(e,`non-empty components`))}function ye(e){let t=e.split(`:`);return t.length===5&&t[0]===`wallet-key`&&t[1]===`evm-family`&&t.slice(2).every(e=>e.length>0)}function be(t){let n=e(t);return n.ok?ye(String(n.value))?{ok:!0,value:String(n.value)}:{ok:!1,error:{code:`invalid`,message:`EVM-family signing key slot id must be wallet-key:evm-family:<walletId>:<signingRootId>:<signingRootVersion>`}}:n}function xe(e,t=`evmFamilySigningKeySlotId`){let n=be(e);if(n.ok)return n.value;throw n.error.code===`missing`?Error(`${t} is required`):Error(`${t} must be an EVM-family signing key slot id`)}function Se(e){return xe([`wallet-key`,`evm-family`,C(e.walletId),C(e.signingRootId),C(e.signingRootVersion)].join(`:`))}function Ce(e){let t=e.trim(),n=h(t);if(n.length!==33||m(n)!==t)throw Error(`ECDSA client root public key must be canonical base64url for 33 bytes`);return t}function w(e,t){let n=String(e??``).trim();if(!n)throw Error(`${t} is required`);return n}function we(e){return w(e,`ecdsaThresholdKeyId`)}function Te(e){return w(e,`signingRootId`)}function Ee(e){return w(e,`signingRootVersion`)}async function De(e){let t=Se(e);return`ederivation-relayer-${m(await f(p({version:`threshold_ecdsa_derivation_relayer_key_id_v1`,schemeId:`threshold-secp256k1-ecdsa-2p-v1`,walletId:e.walletId,evmFamilySigningKeySlotId:t})))}`}function T(e,t){if(typeof e!=`string`||e.trim()!==e||e.length===0)throw Error(`${t} must be a non-empty canonical string`);return e}function E(e,t,n){if(typeof e!=`string`||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`${t} must be unpadded base64url`);let r;try{r=h(e)}catch{throw Error(`${t} must be valid base64url`)}if(r.length===0||n!==null&&r.length!==n||m(r)!==e)throw Error(`${t} has an invalid canonical byte length`);return e}function Oe(e){return T(e,`ECDSA signer id`)}function ke(e){return T(e,`ECDSA server generation`)}function Ae(e){return T(e,`ECDSA manifest id`)}function je(e){if(!Number.isSafeInteger(e)||Number(e)<1)throw Error(`ECDSA manifest revision must be a positive safe integer`);return e}function Me(e){return E(e,`ECDSA ciphertext digest`,32)}function Ne(e){return E(e,`ECDSA pending ciphertext digest`,32)}function Pe(e){return E(e,`ECDSA activation digest`,32)}function Fe(e){return T(e,`ECDSA lifecycle id`)}function Ie(e){return T(e,`ECDSA material sealing key id`)}function Le(e){return E(e,`ECDSA AES-GCM IV`,12)}function Re(e){return E(e,`ECDSA ciphertext`,null)}function ze(e){if(typeof e!=`string`||e.trim()!==e)throw Error(`ECDSA server activation request must be canonical JSON`);let t;try{t=JSON.parse(e)}catch{throw Error(`ECDSA server activation request must be canonical JSON`)}if(typeof t!=`object`||!t||Array.isArray(t)||p(t)!==e)throw Error(`ECDSA server activation request must be a canonical JSON object`);return e}function Be(e){return{walletId:e.walletId,bindingId:e.walletAuthMethodId,factor:{kind:`voiceid`,deviceKeyId:e.deviceKeyId},verifier:{kind:`device_signature`}}}function D(e){return e.factor.kind===`voiceid`}function O(e){return e.factor.kind===`passkey`}function k(e){return e.factor.kind===`email_otp`}function Ve(e,t){return e.walletId!==t.walletId||e.bindingId!==t.bindingId?!1:O(e)?O(t)?e.factor.credentialIdB64u===t.factor.credentialIdB64u&&e.verifier.rpId===t.verifier.rpId:!1:k(e)?k(t)?e.factor.provider===t.factor.provider&&e.factor.providerUserId===t.factor.providerUserId&&e.verifier.emailHashHex===t.verifier.emailHashHex:!1:D(e)?D(t)&&e.factor.deviceKeyId===t.factor.deviceKeyId:!1}function He(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let r=e,i=Object.keys(r);if(i.length!==4||!i.every(e=>[`kind`,`walletId`,`authorityDigest`,`walletAuthMethodId`].includes(e))||r.kind!==`wallet_auth_authority_ref`)return null;let a=l(r.walletId),o=t(r.authorityDigest),s=n(r.walletAuthMethodId);return!a.ok||!o.ok||!s.ok?null:{kind:`wallet_auth_authority_ref`,walletId:a.value,authorityDigest:o.value,walletAuthMethodId:s.value}}function Ue(e){let t=String(e||``).trim().toLowerCase();return t===`google`||t===`email`?t:null}function A(e,t){if(e.ok)return e.value;throw Error(t)}function We(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ge(e,t){for(let n of t)if(We(e,n))return!0;return!1}function Ke(e){let t=A(l(e.walletId),`Passkey wallet auth authority requires walletId`),a=A(i(e.rpId),`Passkey wallet auth authority requires rpId`),o=A(r(e.credentialIdB64u),`Passkey wallet auth authority requires credentialIdB64u`),s=A(n(`passkey:${a}:${o}`),`Passkey wallet auth authority requires bindingId`);return{walletId:t,factor:{kind:`passkey`,credentialIdB64u:o},verifier:{kind:`webauthn`,rpId:a},bindingId:s}}function qe(e){let t=Ue(e.provider);if(!t)throw Error(`Email OTP factor identity requires provider`);return{kind:`email_otp`,provider:t,providerUserId:A(s(e.providerUserId),`Email OTP factor identity requires providerUserId`)}}function Je(e){let t=A(l(e.walletId),`Email OTP wallet auth authority requires walletId`),r=qe(e),i=String(e.emailHashHex||``).trim();if(!i)throw Error(`Email OTP wallet auth authority requires emailHashHex`);let a=A(n(`email_otp:${t}:${i}`),`Email OTP wallet auth authority requires bindingId`);return{walletId:t,factor:r,verifier:{kind:`email_otp_wallet_auth_method`,emailHashHex:i},bindingId:a}}function Ye(e){return e.factor.provider}function Xe(e){return e.factor.providerUserId}function Ze(e){return e.verifier.emailHashHex}function Qe(e){let t=e.factor;if(!t||typeof t!=`object`||Array.isArray(t))return null;let a=e.verifier;if(!a||typeof a!=`object`||Array.isArray(a))return null;let o=t,s=a,c=String(o.kind||``).trim().toLowerCase(),u=String(s.kind||``).trim().toLowerCase();if(c!==`passkey`||u!==`webauthn`)return null;try{if(Ge(e,[`kind`,`rpId`,`credentialIdB64u`,`provider`,`providerUserId`]))return null;let t=l(e.walletId),a=i(s.rpId),c=r(o.credentialIdB64u),u=n(e.bindingId);return!t.ok||!a.ok||!c.ok||!u.ok?null:{walletId:t.value,factor:{kind:`passkey`,credentialIdB64u:c.value},verifier:{kind:`webauthn`,rpId:a.value},bindingId:u.value}}catch{return null}}function $e(e){let t=e.factor;if(!t||typeof t!=`object`||Array.isArray(t))return null;let r=e.verifier;if(!r||typeof r!=`object`||Array.isArray(r))return null;let i=t,a=r,o=String(i.kind||``).trim().toLowerCase(),c=String(a.kind||``).trim().toLowerCase();if(o!==`email_otp`||c!==`email_otp_wallet_auth_method`)return null;try{if(Ge(e,[`kind`,`rpId`,`credentialIdB64u`,`provider`,`providerUserId`]))return null;let t=l(e.walletId),r=Ue(i.provider),o=s(i.providerUserId),c=String(a.emailHashHex||``).trim(),u=n(e.bindingId);return!t.ok||!r||!o.ok||!c||!u.ok?null:{walletId:t.value,factor:{kind:`email_otp`,provider:r,providerUserId:o.value},verifier:{kind:`email_otp_wallet_auth_method`,emailHashHex:c},bindingId:u.value}}catch{return null}}function et(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;return Qe(t)||$e(t)||tt(t)}function tt(e){try{let t=d(e,`device authority`);g(t,[`walletId`,`bindingId`,`factor`,`verifier`],`device authority`);let r=d(t.factor,`device factor`),i=d(t.verifier,`device verifier`);if(g(r,[`kind`,`deviceKeyId`],`device factor`),g(i,[`kind`],`device verifier`),r.kind!==`voiceid`||i.kind!==`device_signature`)return null;let a=l(t.walletId),o=n(t.bindingId);return!a.ok||!o.ok?null:Be({walletId:a.value,walletAuthMethodId:o.value,deviceKeyId:de(r.deviceKeyId)})}catch{return null}}function nt(e){return!e||typeof e!=`object`||Array.isArray(e)?null:$e(e)}function rt(e){return!e||typeof e!=`object`||Array.isArray(e)?null:Qe(e)}function it(e){return`seams:wallet-authority-binding:v1|${p(e.authority)}`}async function at(e){return A(t(m(await f(it(e)))),`Wallet authority binding digest must be non-empty`)}async function ot(e){return{kind:`wallet_auth_authority_ref`,walletId:e.authority.walletId,authorityDigest:await at({authority:e.authority}),walletAuthMethodId:e.authority.bindingId}}const st=5*6e4,ct=`/router-ab/ecdsa-derivation/export`,lt=`/router-ab/ecdsa-derivation/presignature-pool/fill/init`,ut=`/router-ab/ecdsa-derivation/presignature-pool/fill/step`,dt=`/router-ab/ecdsa-derivation/session/activate`,ft=`/router-ab/ecdsa-derivation/operation-step-up`,pt=[1,2];function mt(e,t){if(e===`reusable_wallet_session`||e===`verified_step_up`)return e;throw Error(`${t} must be reusable_wallet_session or verified_step_up`)}function ht(e){let t=d(e,`operationStepUpAuthorizationResponse.export_topology`);j(t,`operationStepUpAuthorizationResponse.export_topology`,[`signer_set`,`deriver_recipient_keys`,`router_id`]);let n=kt(t.signer_set,`operationStepUpAuthorizationResponse.export_topology.signer_set`),r=Mt(t.deriver_recipient_keys,`operationStepUpAuthorizationResponse.export_topology.deriver_recipient_keys`);if(r.deriver_a.key_epoch!==n.signer_a.key_epoch||r.deriver_b.key_epoch!==n.signer_b.key_epoch)throw Error(`operationStepUpAuthorizationResponse.export_topology recipient key epochs do not match signer_set`);return{signer_set:n,deriver_recipient_keys:r,router_id:M(t.router_id,`operationStepUpAuthorizationResponse.export_topology.router_id`)}}function gt(e){let t=d(e,`operationStepUpAuthorizationResponse`),n=zn(t.operation_kind);if(j(t,`operationStepUpAuthorizationResponse`,[`ok`,`kind`,`authorization`,`expires_at_ms`,`operation_kind`,...n===`evm.export_key`?[`export_topology`]:[]]),t.ok!==!0||t.kind!==`verified_step_up`)throw Error(`operationStepUpAuthorizationResponse is invalid`);let r=d(t.authorization,`operationStepUpAuthorizationResponse.authorization`);if(j(r,`operationStepUpAuthorizationResponse.authorization`,[`kind`,`evidence_set_digest`,`unseal`]),r.kind!==`operation_step_up`)throw Error(`operationStepUpAuthorizationResponse.authorization.kind is invalid`);let i=F(t.expires_at_ms,`operationStepUpAuthorizationResponse.expires_at_ms`);if(i<=Date.now())throw Error(`operationStepUpAuthorizationResponse.expires_at_ms is expired`);let a=d(r.unseal,`operationStepUpAuthorizationResponse.authorization.unseal`),o=M(a.kind,`operationStepUpAuthorizationResponse.authorization.unseal.kind`),s;switch(o){case`not_requested`:j(a,`operationStepUpAuthorizationResponse.authorization.unseal`,[`kind`]),s={kind:`not_requested`};break;case`email_otp_grant`:j(a,`operationStepUpAuthorizationResponse.authorization.unseal`,[`kind`,`grant`,`challenge_id`]),s={kind:`email_otp_grant`,grant:M(a.grant,`operationStepUpAuthorizationResponse.authorization.unseal.grant`),challenge_id:M(a.challenge_id,`operationStepUpAuthorizationResponse.authorization.unseal.challenge_id`)};break;default:throw Error(`operationStepUpAuthorizationResponse.authorization.unseal.kind is invalid`)}let c={ok:!0,kind:`verified_step_up`,authorization:{kind:`operation_step_up`,evidence_set_digest:de(r.evidence_set_digest),unseal:s},expires_at_ms:i};return n===`evm.sign_transaction`?{...c,operation_kind:`evm.sign_transaction`}:{...c,operation_kind:`evm.export_key`,export_topology:ht(t.export_topology)}}async function _t(e){return m(await f(p({domain:`router-ab-ecdsa-operation-step-up/challenge/v1`,operation:Rn(e)})))}function j(e,t,n){let r=new Set(n);for(let n of Object.keys(e))if(!r.has(n))throw Error(`${t}.${n} is not a supported field`)}function M(e,t){if(typeof e!=`string`)throw Error(`${t} must be a string`);let n=e.trim();if(!n)throw Error(`${t} is required`);if(!/^[\x20-\x7e]+$/.test(n))throw Error(`${t} must be printable ASCII`);return n}function N(e,t){let n=o(M(e,t));if(!n.ok)throw Error(`${t} is invalid`);return n.value}function P(e,t){let n=a(M(e,t));if(!n.ok)throw Error(`${t} is invalid`);return n.value}function vt(e,t){let n=le(e);if(!n.ok)throw Error(`${t} is invalid`);return n.value}function yt(e,t){let n=se(e);if(!n.ok)throw Error(`${t} is invalid`);return n.value}function bt(e,t){let n=oe(e);if(!n.ok)throw Error(`${t} is invalid`);return n.value}function xt(e,t){let n=ie(e);if(!n.ok)throw Error(`${t} is invalid`);return n.value}function F(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw Error(`${t} must be a positive safe integer`);return e}function I(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw Error(`${t} must be a positive safe-integer counter`);return e}function L(e,t){if(typeof e!=`number`||!Number.isFinite(e))throw Error(`${t} must be a finite number`);let n=Math.floor(e);if(n!==e||n<0||n>4294967295)throw Error(`${t} must be a u32 integer`);return n}function St(e,t){if(typeof e!=`number`||!Number.isFinite(e))throw Error(`${t} must be a finite number`);let n=Math.floor(e);if(n!==e||n<0||n>255)throw Error(`${t} must be a byte`);return n}function R(e,t,n){let r=M(e,t);if(!/^[A-Za-z0-9_-]+$/.test(r))throw Error(`${t} must be unpadded base64url`);let i;try{i=h(r)}catch{throw Error(`${t} must be valid base64url`)}if(i.length!==n)throw Error(`${t} must decode to ${n} bytes`);return r}function z(e,t){let n=R(e,t,33),r=h(n);if(r[0]!==2&&r[0]!==3)throw Error(`${t} must be a compressed secp256k1 public key`);return n}function Ct(e,t){let n=M(e,t);if(!/^[A-Za-z0-9_-]+$/.test(n))throw Error(`${t} must be unpadded base64url`);let r;try{r=h(n)}catch{throw Error(`${t} must be valid base64url`)}if(r.length===0)throw Error(`${t} must decode to non-empty bytes`);return n}function wt(e,t){let n=M(e,t);if(!/^x25519:[0-9a-f]{64}$/.test(n))throw Error(`${t} must use x25519:<64 lowercase hex chars> encoding`);return n}function B(e,t,n){if(!(e instanceof Uint8Array))throw Error(`${t} must be a Uint8Array`);if(e.length!==n)throw Error(`${t} must contain ${n} bytes`);return e}function Tt(e,t){let n=M(e,t);if(n!==`ecdsa_secp256k1_recoverable_v1`)throw Error(`${t} must be ecdsa_secp256k1_recoverable_v1`);return n}function V(e,t){let n=d(e,t);if(j(n,t,[`bytes`]),!Array.isArray(n.bytes))throw Error(`${t}.bytes must be an array`);if(n.bytes.length!==32)throw Error(`${t}.bytes must contain 32 bytes`);return{bytes:n.bytes.map((e,n)=>St(e,`${t}.bytes[${n}]`))}}function H(e){let t=d(e,`scope.context`);j(t,`scope.context`,[`application_binding_digest_b64u`]);let n=h(M(t.application_binding_digest_b64u,`scope.context.application_binding_digest_b64u`));if(n.length!==32)throw Error(`scope.context.application_binding_digest_b64u must decode to 32 bytes`);return{application_binding_digest_b64u:m(n)}}function U(e){let t=d(e,`scope.public_identity`);return j(t,`scope.public_identity`,[`context_binding_b64u`,`derivation_client_share_public_key33_b64u`,`server_public_key33_b64u`,`threshold_public_key33_b64u`,`ethereum_address20_b64u`,`client_share_retry_counter`,`server_share_retry_counter`]),{context_binding_b64u:R(t.context_binding_b64u,`scope.public_identity.context_binding_b64u`,32),derivation_client_share_public_key33_b64u:z(t.derivation_client_share_public_key33_b64u,`scope.public_identity.derivation_client_share_public_key33_b64u`),server_public_key33_b64u:z(t.server_public_key33_b64u,`scope.public_identity.server_public_key33_b64u`),threshold_public_key33_b64u:z(t.threshold_public_key33_b64u,`scope.public_identity.threshold_public_key33_b64u`),ethereum_address20_b64u:R(t.ethereum_address20_b64u,`scope.public_identity.ethereum_address20_b64u`,20),client_share_retry_counter:L(t.client_share_retry_counter,`scope.public_identity.client_share_retry_counter`),server_share_retry_counter:L(t.server_share_retry_counter,`scope.public_identity.server_share_retry_counter`)}}function Et(e){return Dt(e,`scope.signing_worker`)}function Dt(e,t){let n=d(e,t);return j(n,t,[`server_id`,`key_epoch`,`recipient_encryption_key`]),{server_id:M(n.server_id,`${t}.server_id`),key_epoch:M(n.key_epoch,`${t}.key_epoch`),recipient_encryption_key:fe(n.recipient_encryption_key,`${t}.recipient_encryption_key`)}}function Ot(e,t,n){let r=d(e,t);if(j(r,t,[`role`,`signer_id`,`key_epoch`]),M(r.role,`${t}.role`)!==n)throw Error(`${t}.role must be ${n}`);return{role:n,signer_id:M(r.signer_id,`${t}.signer_id`),key_epoch:M(r.key_epoch,`${t}.key_epoch`)}}function kt(e,t){let n=d(e,t);j(n,t,[`signer_set_id`,`policy`,`signer_a`,`signer_b`,`selected_server`]);let r=M(n.policy,`${t}.policy`);if(r!==`all_2`)throw Error(`${t}.policy must be all_2`);let i=Ot(n.signer_a,`${t}.signer_a`,`signer_a`),a=Ot(n.signer_b,`${t}.signer_b`,`signer_b`);if(i.signer_id===a.signer_id)throw Error(`${t} requires distinct signer ids`);return{signer_set_id:M(n.signer_set_id,`${t}.signer_set_id`),policy:r,signer_a:i,signer_b:a,selected_server:Dt(n.selected_server,`${t}.selected_server`)}}function At(e){let t=`registration.lifecycle`,n=d(e,t);if(j(n,t,[`lifecycle_id`,`work_kind`,`primitive_request_kind`,`root_share_epoch`,`account_id`,`session_id`,`signer_set_id`,`selected_server_id`]),n.work_kind!==`registration_prepare`)throw Error(`${t}.work_kind must be registration_prepare`);if(n.primitive_request_kind!==`registration`)throw Error(`${t}.primitive_request_kind must be registration`);return{lifecycle_id:M(n.lifecycle_id,`${t}.lifecycle_id`),work_kind:`registration_prepare`,primitive_request_kind:`registration`,root_share_epoch:N(n.root_share_epoch,`${t}.root_share_epoch`),account_id:M(n.account_id,`${t}.account_id`),session_id:M(n.session_id,`${t}.session_id`),signer_set_id:M(n.signer_set_id,`${t}.signer_set_id`),selected_server_id:M(n.selected_server_id,`${t}.selected_server_id`)}}function jt(e,t,n){let r=d(e,t);if(j(r,t,[`role`,`key_epoch`,`public_key`]),r.role!==n)throw Error(`${t}.role must be ${n}`);return{role:n,key_epoch:M(r.key_epoch,`${t}.key_epoch`),public_key:fe(r.public_key,`${t}.public_key`)}}function Mt(e,t=`registration.deriver_recipient_keys`){let n=d(e,t);return j(n,t,[`deriver_a`,`deriver_b`]),{deriver_a:jt(n.deriver_a,`${t}.deriver_a`,`signer_a`),deriver_b:jt(n.deriver_b,`${t}.deriver_b`,`signer_b`)}}function Nt(e){let t=`registration`,n=d(e,t);if(j(n,t,[`registration_purpose`,`context`,`lifecycle`,`signer_set`,`router_id`,`client_id`,`replay_nonce`,`expires_at_ms`,`deriver_recipient_keys`]),n.registration_purpose!==`wallet_registration`&&n.registration_purpose!==`wallet_add_signer`)throw Error(`${t}.registration_purpose is invalid`);let r=At(n.lifecycle),i=kt(n.signer_set,`${t}.signer_set`);if(r.signer_set_id!==i.signer_set_id)throw Error(`${t}.lifecycle signer set does not match signer_set`);if(r.selected_server_id!==i.selected_server.server_id)throw Error(`${t}.lifecycle selected server does not match signer_set`);let a=Mt(n.deriver_recipient_keys);if(a.deriver_a.key_epoch!==i.signer_a.key_epoch)throw Error(`${t}.deriver_a recipient key epoch does not match signer_set`);if(a.deriver_b.key_epoch!==i.signer_b.key_epoch)throw Error(`${t}.deriver_b recipient key epoch does not match signer_set`);return{registration_purpose:n.registration_purpose,context:H(n.context),lifecycle:r,signer_set:i,router_id:M(n.router_id,`${t}.router_id`),client_id:M(n.client_id,`${t}.client_id`),replay_nonce:M(n.replay_nonce,`${t}.replay_nonce`),expires_at_ms:F(n.expires_at_ms,`${t}.expires_at_ms`),deriver_recipient_keys:a}}function Pt(e,t){let n=d(e,t);if(j(n,t,[`kind`,`transcriptDigestB64u`,`payloadB64u`]),n.kind!==`recipient_proof_bundle`)throw Error(`${t}.kind must be recipient_proof_bundle`);return{kind:`recipient_proof_bundle`,transcriptDigestB64u:R(n.transcriptDigestB64u,`${t}.transcriptDigestB64u`,32),payloadB64u:Ct(n.payloadB64u,`${t}.payloadB64u`)}}function Ft(e){let t=`registrationForwarded`,n=d(e,t);if(j(n,t,[`result`,`response`]),n.result!==`forwarded`)throw Error(`${t}.result must be forwarded`);return{result:`forwarded`,response:Vt(n.response,`${t}.response`)}}function It(e){return Lt(e,Rt)}function Lt(e,t){let n=`explicitExportForwarded`,r=d(e,n);if(j(r,n,[`result`,`response`,`signing_worker_export`]),r.result!==`forwarded`)throw Error(`${n}.result must be forwarded`);return{result:`forwarded`,response:Vt(r.response,`${n}.response`),signing_worker_export:t(r.signing_worker_export)}}function Rt(e){return Bt(e,y)}function zt(e,t,n){let r=d(e,n);j(r,n,[`wallet_id`,`key_handle`,`ecdsa_threshold_key_id`,`signing_root_id`,`signing_root_version`,`activation_epoch`,`signing_worker_id`,`context_binding_b64u`,`threshold_public_key33_b64u`,`export_request_digest_b64u`,`export_authorization_digest_b64u`,`export_nonce`,`authorization_kind`,`authorization_id`,`material_activation`,`lifecycle_id`,`recipient_identity`,`recipient_public_key`,`expires_at_ms`]);let i=t(r.material_activation);if(i.material_owner!==r.wallet_id||i.signing_worker!==r.signing_worker_id)throw Error(`${n}.material_activation is not bound to wallet and worker`);return{wallet_id:M(r.wallet_id,`${n}.wallet_id`),key_handle:M(r.key_handle,`${n}.key_handle`),ecdsa_threshold_key_id:M(r.ecdsa_threshold_key_id,`${n}.ecdsa_threshold_key_id`),signing_root_id:M(r.signing_root_id,`${n}.signing_root_id`),signing_root_version:M(r.signing_root_version,`${n}.signing_root_version`),activation_epoch:N(r.activation_epoch,`${n}.activation_epoch`),signing_worker_id:M(r.signing_worker_id,`${n}.signing_worker_id`),context_binding_b64u:R(r.context_binding_b64u,`${n}.context_binding_b64u`,32),threshold_public_key33_b64u:z(r.threshold_public_key33_b64u,`${n}.threshold_public_key33_b64u`),export_request_digest_b64u:R(r.export_request_digest_b64u,`${n}.export_request_digest_b64u`,32),export_authorization_digest_b64u:R(r.export_authorization_digest_b64u,`${n}.export_authorization_digest_b64u`,32),export_nonce:M(r.export_nonce,`${n}.export_nonce`),authorization_kind:mt(r.authorization_kind,`${n}.authorization_kind`),authorization_id:M(r.authorization_id,`${n}.authorization_id`),material_activation:i,lifecycle_id:M(r.lifecycle_id,`${n}.lifecycle_id`),recipient_identity:M(r.recipient_identity,`${n}.recipient_identity`),recipient_public_key:wt(r.recipient_public_key,`${n}.recipient_public_key`),expires_at_ms:F(r.expires_at_ms,`${n}.expires_at_ms`)}}function Bt(e,t){let n=`signingWorkerExportShare`,r=d(e,n);if(j(r,n,[`version`,`algorithm`,`binding`,`ciphertext_and_tag`]),r.version!==`router-ab-ecdsa-derivation/signing-worker-export-share-envelope/v1`)throw Error(`${n}.version is invalid`);if(r.algorithm!==`hpke_x25519_hkdf_sha256_aes256gcm_v1`)throw Error(`${n}.algorithm is invalid`);if(!Array.isArray(r.ciphertext_and_tag)||r.ciphertext_and_tag.length<=48)throw Error(`${n}.ciphertext_and_tag is invalid`);return{version:`router-ab-ecdsa-derivation/signing-worker-export-share-envelope/v1`,algorithm:`hpke_x25519_hkdf_sha256_aes256gcm_v1`,binding:zt(r.binding,t,`${n}.binding`),ciphertext_and_tag:r.ciphertext_and_tag.map((e,t)=>St(e,`${n}.ciphertext_and_tag[${t}]`))}}function Vt(e,t){let n=d(e,t);j(n,t,[`bundles`]);let r=`${t}.bundles`,i=d(n.bundles,r);return j(i,r,[`signerA`,`signerB`]),{bundles:{signerA:Pt(i.signerA,`${r}.signerA`),signerB:Pt(i.signerB,`${r}.signerB`)}}}function Ht(e){let t=`registrationActivation.publicFacts`,n=d(e,t);if(j(n,t,[`registrationRequestDigestB64u`,`proofTranscriptDigestB64u`,`contextBinding32B64u`,`derivationClientSharePublicKey33B64u`,`clientShareRetryCounter`,`participantId`]),n.participantId!==1)throw Error(`${t}.participantId must be 1`);return{registrationRequestDigestB64u:R(n.registrationRequestDigestB64u,`${t}.registrationRequestDigestB64u`,32),proofTranscriptDigestB64u:R(n.proofTranscriptDigestB64u,`${t}.proofTranscriptDigestB64u`,32),contextBinding32B64u:R(n.contextBinding32B64u,`${t}.contextBinding32B64u`,32),derivationClientSharePublicKey33B64u:z(n.derivationClientSharePublicKey33B64u,`${t}.derivationClientSharePublicKey33B64u`),clientShareRetryCounter:L(n.clientShareRetryCounter,`${t}.clientShareRetryCounter`),participantId:1}}function Ut(e){let t=`registrationActivationReceipt`,n=d(e,t);j(n,t,[`activation_correlation_id`,`activation_request_digest`,`server_generation`,`ecdsa_activation`,`lifecycle_id`,`transcript_digest`]);let r=`${t}.ecdsa_activation`,i=d(n.ecdsa_activation,r);j(i,r,[`context`,`public_identity`,`signing_worker`,`material_activation`,`activation_epoch`,`activation_digest_b64u`,`activated_at_ms`]);let a=Dt(i.signing_worker,`${r}.signing_worker`),o=y(i.material_activation);if(o.signing_worker!==a.server_id)throw Error(`${r}.material_activation.signing_worker does not match signing_worker`);let s=R(i.activation_digest_b64u,`${r}.activation_digest_b64u`,32),c=V(n.transcript_digest,`${t}.transcript_digest`);return{activation_correlation_id:ue(n.activation_correlation_id),activation_request_digest:V(n.activation_request_digest,`${t}.activation_request_digest`),server_generation:ke(n.server_generation),ecdsa_activation:{context:H(i.context),public_identity:U(i.public_identity),signing_worker:a,material_activation:o,activation_epoch:N(i.activation_epoch,`${r}.activation_epoch`),activation_digest_b64u:s,activated_at_ms:F(i.activated_at_ms,`${r}.activated_at_ms`)},lifecycle_id:M(n.lifecycle_id,`${t}.lifecycle_id`),transcript_digest:c}}function Wt(e){return Ut(e)}function W(e,t){return e.server_id===t.server_id&&e.key_epoch===t.key_epoch&&e.recipient_encryption_key===t.recipient_encryption_key}function Gt(e,t){return e.registrationRequestDigestB64u===t.registrationRequestDigestB64u&&e.proofTranscriptDigestB64u===t.proofTranscriptDigestB64u&&e.contextBinding32B64u===t.contextBinding32B64u&&e.derivationClientSharePublicKey33B64u===t.derivationClientSharePublicKey33B64u&&e.clientShareRetryCounter===t.clientShareRetryCounter&&e.participantId===t.participantId}function Kt(e,t){return e.signer_set_id===t.signer_set_id&&e.policy===t.policy&&e.signer_a.role===t.signer_a.role&&e.signer_a.signer_id===t.signer_a.signer_id&&e.signer_a.key_epoch===t.signer_a.key_epoch&&e.signer_b.role===t.signer_b.role&&e.signer_b.signer_id===t.signer_b.signer_id&&e.signer_b.key_epoch===t.signer_b.key_epoch&&W(e.selected_server,t.selected_server)}function G(e){let t=`ecdsaPublicCapability`,n=d(e,t);if(j(n,t,[`kind`,`context`,`public_identity`,`material_activation`,`signer_set`,`deriver_recipient_keys`,`router_id`,`client_id`,`activation_epoch`,`registration_request_digest_b64u`,`proof_transcript_digest_b64u`]),n.kind!==`router_ab_ecdsa_derivation_public_capability_v1`)throw Error(`${t}.kind is invalid`);let r=kt(n.signer_set,`${t}.signer_set`),i=Mt(n.deriver_recipient_keys,`${t}.deriver_recipient_keys`);if(i.deriver_a.key_epoch!==r.signer_a.key_epoch||i.deriver_b.key_epoch!==r.signer_b.key_epoch)throw Error(`${t} Deriver recipient key epochs do not match signer_set`);return{kind:`router_ab_ecdsa_derivation_public_capability_v1`,context:H(n.context),public_identity:U(n.public_identity),material_activation:y(n.material_activation),signer_set:r,deriver_recipient_keys:i,router_id:M(n.router_id,`${t}.router_id`),client_id:M(n.client_id,`${t}.client_id`),activation_epoch:N(n.activation_epoch,`${t}.activation_epoch`),registration_request_digest_b64u:R(n.registration_request_digest_b64u,`${t}.registration_request_digest_b64u`,32),proof_transcript_digest_b64u:R(n.proof_transcript_digest_b64u,`${t}.proof_transcript_digest_b64u`,32)}}function qt(e){let t=`postRegistrationSessionActivation.session_policy`,n=d(e,t);return j(n,t,[`threshold_session_id`,`wallet_session_mint_id`,`ttl_ms`,`remaining_uses`,`runtime_policy_scope`]),{threshold_session_id:P(n.threshold_session_id,`${t}.threshold_session_id`),wallet_session_mint_id:Yt(n.wallet_session_mint_id,`${t}.wallet_session_mint_id`),ttl_ms:I(n.ttl_ms,`${t}.ttl_ms`),remaining_uses:I(n.remaining_uses,`${t}.remaining_uses`),runtime_policy_scope:te(n.runtime_policy_scope)}}function Jt(e){let t=`postRegistrationSessionActivationPolicy`,n=d(e,t);if(j(n,t,[`kind`,`key_handle`,`session_policy`]),n.kind!==`router_ab_ecdsa_post_registration_session_activation_policy_v1`)throw Error(`${t}.kind is invalid`);return{kind:`router_ab_ecdsa_post_registration_session_activation_policy_v1`,key_handle:M(n.key_handle,`${t}.key_handle`),session_policy:qt(n.session_policy)}}function Yt(e,t){let n=ae(e);if(!n.ok)throw Error(`${t} is invalid`);return n.value}function K(e,t){return e.context_binding_b64u===t.context_binding_b64u&&e.derivation_client_share_public_key33_b64u===t.derivation_client_share_public_key33_b64u&&e.server_public_key33_b64u===t.server_public_key33_b64u&&e.threshold_public_key33_b64u===t.threshold_public_key33_b64u&&e.ethereum_address20_b64u===t.ethereum_address20_b64u&&e.client_share_retry_counter===t.client_share_retry_counter&&e.server_share_retry_counter===t.server_share_retry_counter}function Xt(e,t){for(let n of e.capabilitySubjects)if(!(n.kind!==`sign`||n.keyFamily!==`ecdsa_secp256k1`))return S(t.material_activation,me(n.materialActivation));return!1}function Zt(e){let t=`postRegistrationSessionActivation`,n=d(e,t);if(j(n,t,[`kind`,`public_capability`,`session_policy`]),n.kind!==`router_ab_ecdsa_post_registration_session_activation_v1`)throw Error(`${t}.kind is invalid`);return{kind:`router_ab_ecdsa_post_registration_session_activation_v1`,public_capability:G(n.public_capability),session_policy:qt(n.session_policy)}}function Qt(e){let t=`postRegistrationSessionActivated`,n=d(e,t);if(j(n,t,[`kind`,`public_capability`,`session`,`normal_signing`]),n.kind!==`router_ab_ecdsa_post_registration_session_activated_v1`)throw Error(`${t}.kind is invalid`);let r=G(n.public_capability),i=d(n.session,`${t}.session`);j(i,`${t}.session`,[`authorization_session_id`,`authorization_id`,`threshold_session_id`,`wallet_session_id`,`quota_id`,`expires_at_ms`,`remaining_uses`,`wallet_session`,`operation_credential`]);let a=jn(n.normal_signing),o=yt(i.authorization_id,`${t}.session.authorization_id`),s=bt(i.wallet_session_id,`${t}.session.wallet_session_id`),c=F(i.expires_at_ms,`${t}.session.expires_at_ms`),l=re(i.wallet_session),u=ne(i.operation_credential);if(!K(r.public_identity,a.scope.public_identity)||r.context.application_binding_digest_b64u!==a.scope.context.application_binding_digest_b64u||a.scope.activation_epoch!==r.activation_epoch||!W(a.scope.signing_worker,r.signer_set.selected_server)||l.authorizationId!==o||l.walletId!==r.client_id||l.expiresAtMs!==c||!Xt(l,r)||u.walletSessionId!==s)throw Error(`${t} exact Wallet Session does not match the activated capability`);return{kind:`router_ab_ecdsa_post_registration_session_activated_v1`,public_capability:r,session:{authorization_session_id:vt(i.authorization_session_id,`${t}.session.authorization_session_id`),authorization_id:o,threshold_session_id:P(i.threshold_session_id,`${t}.session.threshold_session_id`),wallet_session_id:s,quota_id:xt(i.quota_id,`${t}.session.quota_id`),expires_at_ms:c,remaining_uses:I(i.remaining_uses,`${t}.session.remaining_uses`),wallet_session:l,operation_credential:u},normal_signing:a}}function $t(e){let t=`credentialFreeSessionActivated`,n=d(e,t);if(j(n,t,[`kind`,`public_capability`,`session`,`normal_signing`]),n.kind!==`router_ab_ecdsa_credential_free_session_activated_v1`)throw Error(`${t}.kind is invalid`);let r=G(n.public_capability),i=d(n.session,`${t}.session`);j(i,`${t}.session`,[`authorization_session_id`,`authorization_id`,`threshold_session_id`,`wallet_session_id`,`quota_id`,`expires_at_ms`,`remaining_uses`]);let a=jn(n.normal_signing);if(!K(r.public_identity,a.scope.public_identity)||r.context.application_binding_digest_b64u!==a.scope.context.application_binding_digest_b64u||a.scope.activation_epoch!==r.activation_epoch||!W(a.scope.signing_worker,r.signer_set.selected_server))throw Error(`${t} normal-signing state does not match public capability`);return{kind:`router_ab_ecdsa_credential_free_session_activated_v1`,public_capability:r,session:{authorization_session_id:vt(i.authorization_session_id,`${t}.session.authorization_session_id`),authorization_id:yt(i.authorization_id,`${t}.session.authorization_id`),threshold_session_id:P(i.threshold_session_id,`${t}.session.threshold_session_id`),wallet_session_id:bt(i.wallet_session_id,`${t}.session.wallet_session_id`),quota_id:xt(i.quota_id,`${t}.session.quota_id`),expires_at_ms:F(i.expires_at_ms,`${t}.session.expires_at_ms`),remaining_uses:I(i.remaining_uses,`${t}.session.remaining_uses`)},normal_signing:a}}function en(e,t=`signing_digest_b64u`){return{bytes:Array.from(h(R(e,t,32)))}}function q(e,t){return e.bytes.length===32&&t.bytes.length===32&&e.bytes.every((e,n)=>e===t.bytes[n])}function tn(e,t){return e.bytes.length===t.bytes.length&&e.bytes.every((e,n)=>e===t.bytes[n])}function nn(e,t){return e.deriver_a.role===t.deriver_a.role&&e.deriver_a.key_epoch===t.deriver_a.key_epoch&&e.deriver_a.public_key===t.deriver_a.public_key&&e.deriver_b.role===t.deriver_b.role&&e.deriver_b.key_epoch===t.deriver_b.key_epoch&&e.deriver_b.public_key===t.deriver_b.public_key}function rn(e,t){let n=e.ecdsa_activation,r=t.ecdsa_activation;return e.activation_correlation_id===t.activation_correlation_id&&tn(e.activation_request_digest,t.activation_request_digest)&&e.server_generation===t.server_generation&&e.lifecycle_id===t.lifecycle_id&&tn(e.transcript_digest,t.transcript_digest)&&n.context.application_binding_digest_b64u===r.context.application_binding_digest_b64u&&K(n.public_identity,r.public_identity)&&W(n.signing_worker,r.signing_worker)&&S(n.material_activation,r.material_activation)&&n.activation_epoch===r.activation_epoch&&n.activation_digest_b64u===r.activation_digest_b64u&&n.activated_at_ms===r.activated_at_ms}function an(e,t){let n=e.scope,r=t.scope;return e.kind===t.kind&&n.wallet_id===r.wallet_id&&n.ecdsa_threshold_key_id===r.ecdsa_threshold_key_id&&n.signing_root_id===r.signing_root_id&&n.signing_root_version===r.signing_root_version&&n.context.application_binding_digest_b64u===r.context.application_binding_digest_b64u&&K(n.public_identity,r.public_identity)&&S(n.material_activation,r.material_activation)&&W(n.signing_worker,r.signing_worker)&&n.activation_epoch===r.activation_epoch}function on(e,t){return e.kind===t.kind&&e.context.application_binding_digest_b64u===t.context.application_binding_digest_b64u&&K(e.public_identity,t.public_identity)&&S(e.material_activation,t.material_activation)&&Kt(e.signer_set,t.signer_set)&&nn(e.deriver_recipient_keys,t.deriver_recipient_keys)&&e.router_id===t.router_id&&e.client_id===t.client_id&&e.activation_epoch===t.activation_epoch&&e.registration_request_digest_b64u===t.registration_request_digest_b64u&&e.proof_transcript_digest_b64u===t.proof_transcript_digest_b64u}function J(e){return new TextEncoder().encode(M(e,`canonical string`))}function sn(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Y(e,t){for(let n of t)e.push(n)}function cn(e,t){Y(e,h(t.lane_digest_b64u)),Y(e,h(t.intent_digest_b64u)),Y(e,h(t.display_digest_b64u))}function ln(e,t){if(!Number.isInteger(t)||t<0||t>65535)throw Error(`canonical u16 must be an integer between 0 and 65535`);e.push(t>>>8&255,t&255)}function un(e,t){if(!Number.isInteger(t)||t<0||t>4294967295)throw Error(`canonical u32 must be an integer between 0 and 4294967295`);e.push(t>>>24&255,t>>>16&255,t>>>8&255,t&255)}function dn(e,t){if(!Number.isSafeInteger(t)||t<0)throw Error(`canonical u64 must be a non-negative safe integer`);let n=BigInt(t);for(let t=56;t>=0;t-=8)e.push(Number(n>>BigInt(t)&255n))}function X(e,t){un(e,t.length),Y(e,t)}function fn(e,t){let n=J(t);ln(e,n.length),Y(e,n)}function pn(e,t){X(e,J(t.server_id)),X(e,J(t.key_epoch)),X(e,J(t.recipient_encryption_key))}async function mn(e){let t=globalThis.crypto?.subtle;if(!t)throw Error(`crypto.subtle is required for Router A/B ECDSA derivation request digest binding`);let n=new ArrayBuffer(e.byteLength);return new Uint8Array(n).set(e),new Uint8Array(await t.digest(`SHA-256`,n))}async function hn(e){let t=B(e,`clientRerandomizationContribution32`,32);return await mn(sn([J(`router-ab-ecdsa-derivation/client-rerandomization-commitment/v1`),t]))}function gn(e){let t=H(e),n=[];Y(n,J(`router-ab-ecdsa-derivation/context/v1`)),fn(n,`router-ab-ecdsa-derivation-v1`),fn(n,`secp256k1`),Y(n,h(t.application_binding_digest_b64u)),n.push(pt.length);for(let e of pt)ln(n,e);return new Uint8Array(n)}function _n(e){let t=[];return Y(t,J(`router-ab-ecdsa-derivation/role-local/context-binding/v1`)),t.push(1),t.push(1),ln(t,e.length),Y(t,e),new Uint8Array(t)}async function vn(e){return wn(_n(gn(e)))}function yn(e){let t=U(e),n=[];return X(n,J(`router-ab-ecdsa-derivation/public-identity/v1`)),X(n,J(t.context_binding_b64u)),X(n,J(t.derivation_client_share_public_key33_b64u)),X(n,J(t.server_public_key33_b64u)),X(n,J(t.threshold_public_key33_b64u)),X(n,J(t.ethereum_address20_b64u)),un(n,t.client_share_retry_counter),un(n,t.server_share_retry_counter),new Uint8Array(n)}function bn(e){let t=Z(e),n=[];return X(n,J(`router-ab-ecdsa-derivation/normal-signing-scope/v1`)),X(n,J(t.wallet_id)),X(n,J(t.ecdsa_threshold_key_id)),X(n,J(t.signing_root_id)),X(n,J(t.signing_root_version)),X(n,gn(t.context)),X(n,yn(t.public_identity)),n.push(...x(t.material_activation)),pn(n,t.signing_worker),X(n,J(t.activation_epoch)),new Uint8Array(n)}function xn(e){return bn(e)}function Sn(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Cn(e,t){try{return Sn(xn(e),xn(t))}catch{return!1}}async function wn(e){return{bytes:Array.from(await mn(e))}}async function Tn(e){let t=Z(e),n=await vn(t.context);if(!q(en(t.public_identity.context_binding_b64u,`scope.public_identity.context_binding_b64u`),n))throw Error(`scope.public_identity.context_binding_b64u does not match scope.context`);return t}function En(e){let t=Q(e),n=[];return X(n,J(`router-ab-ecdsa-derivation/normal-signing-request/v1`)),X(n,bn(t.scope)),X(n,J(t.request_id)),X(n,J(t.operation_id)),cn(n,t.operation_digests),n.push(..._e(t.authorization)),n.push(...x(t.material_activation)),X(n,J(t.client_presignature_id)),dn(n,t.expires_at_ms),Y(n,h(t.signing_digest_b64u)),X(n,h(t.client_rerandomization_commitment32_b64u)),new Uint8Array(n)}async function Dn(e){let t=Q(e);return await Tn(t.scope),wn(En(t))}function On(e){let t=$(e),n=[];return X(n,J(`router-ab-ecdsa-derivation/normal-signing-finalize-request/v1`)),X(n,bn(t.scope)),X(n,J(t.request_id)),X(n,J(t.operation_id)),cn(n,t.operation_digests),n.push(..._e(t.authorization)),n.push(...x(t.material_activation)),dn(n,t.expires_at_ms),Y(n,h(t.signing_digest_b64u)),X(n,J(t.server_presignature_id)),X(n,h(t.client_signature_share32_b64u)),X(n,h(t.client_rerandomization_contribution32_b64u)),new Uint8Array(n)}async function kn(e){let t=$(e);return await Tn(t.scope),wn(On(t))}function Z(e){let t=d(e,`scope`);return j(t,`scope`,[`wallet_id`,`ecdsa_threshold_key_id`,`signing_root_id`,`signing_root_version`,`context`,`public_identity`,`material_activation`,`signing_worker`,`activation_epoch`]),{wallet_id:M(t.wallet_id,`scope.wallet_id`),ecdsa_threshold_key_id:M(t.ecdsa_threshold_key_id,`scope.ecdsa_threshold_key_id`),signing_root_id:M(t.signing_root_id,`scope.signing_root_id`),signing_root_version:M(t.signing_root_version,`scope.signing_root_version`),context:H(t.context),public_identity:U(t.public_identity),material_activation:y(t.material_activation),signing_worker:Et(t.signing_worker),activation_epoch:N(t.activation_epoch,`scope.activation_epoch`)}}function An(e){if(e==null)return null;let t=d(e,`routerAbEcdsaDerivationNormalSigning`);if(j(t,`routerAbEcdsaDerivationNormalSigning`,[`kind`,`scope`]),M(t.kind,`routerAbEcdsaDerivationNormalSigning.kind`)!==`router_ab_ecdsa_derivation_normal_signing_v1`)throw Error(`routerAbEcdsaDerivationNormalSigning.kind is not supported`);return{kind:`router_ab_ecdsa_derivation_normal_signing_v1`,scope:Z(t.scope)}}function jn(e){let t=An(e);if(!t)throw Error(`Router A/B ECDSA derivation normal-signing state is required`);return t}function Mn(e){let t=u([M(e.ecdsaThresholdKeyId,`ecdsaThresholdKeyId`),M(e.signingRootId,`signingRootId`),M(e.signingRootVersion,`signingRootVersion`),N(e.activationEpoch,`activationEpoch`)].join(`:`));if(!t.ok)throw Error(`activeStateId ${t.error.message}`);return t.value}function Nn(e){return Mn({ecdsaThresholdKeyId:e.scope.ecdsa_threshold_key_id,signingRootId:e.scope.signing_root_id,signingRootVersion:e.scope.signing_root_version,activationEpoch:e.scope.activation_epoch})}function Pn(e,t){let n=d(e,t);return j(n,t,[`lane_digest_b64u`,`intent_digest_b64u`,`display_digest_b64u`]),{lane_digest_b64u:R(n.lane_digest_b64u,`${t}.lane_digest_b64u`,32),intent_digest_b64u:R(n.intent_digest_b64u,`${t}.intent_digest_b64u`,32),display_digest_b64u:R(n.display_digest_b64u,`${t}.display_digest_b64u`,32)}}function Fn(e){return Q({scope:e.scope,request_id:e.requestId,operation_id:e.operationId,operation_digests:e.operationDigests,authorization:e.authorization,material_activation:e.materialActivation,client_presignature_id:e.clientPresignatureId,expires_at_ms:e.expiresAtMs,signing_digest_b64u:m(B(e.signingDigest32,`signingDigest32`,32)),client_rerandomization_commitment32_b64u:m(B(e.clientRerandomizationCommitment32,`clientRerandomizationCommitment32`,32))})}function Q(e){let t=d(e,`ecdsaSigningRequest`);j(t,`ecdsaSigningRequest`,[`scope`,`request_id`,`operation_id`,`operation_digests`,`authorization`,`material_activation`,`client_presignature_id`,`expires_at_ms`,`signing_digest_b64u`,`client_rerandomization_commitment32_b64u`]);let n={scope:Z(t.scope),request_id:M(t.request_id,`ecdsaSigningRequest.request_id`),operation_id:M(t.operation_id,`ecdsaSigningRequest.operation_id`),operation_digests:Pn(t.operation_digests,`ecdsaSigningRequest.operation_digests`),authorization:v(t.authorization),material_activation:y(t.material_activation),client_presignature_id:M(t.client_presignature_id,`ecdsaSigningRequest.client_presignature_id`),expires_at_ms:F(t.expires_at_ms,`ecdsaSigningRequest.expires_at_ms`),signing_digest_b64u:R(t.signing_digest_b64u,`ecdsaSigningRequest.signing_digest_b64u`,32),client_rerandomization_commitment32_b64u:R(t.client_rerandomization_commitment32_b64u,`ecdsaSigningRequest.client_rerandomization_commitment32_b64u`,32)};if(n.operation_digests.intent_digest_b64u!==n.signing_digest_b64u)throw Error(`ecdsaSigningRequest intent digest must equal the admitted signing digest`);return n}function In(e){let t=d(e,`webauthn_authentication`);j(t,`webauthn_authentication`,[`id`,`rawId`,`type`,`authenticatorAttachment`,`response`,`clientExtensionResults`]);let n=d(t.response,`webauthn_authentication.response`);if(j(n,`webauthn_authentication.response`,[`clientDataJSON`,`authenticatorData`,`signature`,`userHandle`]),t.clientExtensionResults!==null)throw Error(`webauthn_authentication.clientExtensionResults must be redacted`);let r=t.authenticatorAttachment===null?null:M(t.authenticatorAttachment,`webauthn_authentication.authenticatorAttachment`),i=n.userHandle===null?null:M(n.userHandle,`webauthn_authentication.response.userHandle`);return{id:M(t.id,`webauthn_authentication.id`),rawId:M(t.rawId,`webauthn_authentication.rawId`),type:M(t.type,`webauthn_authentication.type`),authenticatorAttachment:r,response:{clientDataJSON:M(n.clientDataJSON,`webauthn_authentication.response.clientDataJSON`),authenticatorData:M(n.authenticatorData,`webauthn_authentication.response.authenticatorData`),signature:M(n.signature,`webauthn_authentication.response.signature`),userHandle:i},clientExtensionResults:null}}function Ln(e){let t=d(e,`operationStepUpAuthorizationRequest`);if(j(t,`operationStepUpAuthorizationRequest`,[`kind`,`operation`,`proof`]),t.kind!==`router_ab_ecdsa_operation_step_up_v1`)throw Error(`operationStepUpAuthorizationRequest.kind must be router_ab_ecdsa_operation_step_up_v1`);let n=Rn(t.operation),r=d(t.proof,`operationStepUpAuthorizationRequest.proof`),i=et(r.authority),a;switch(r.kind){case`passkey`:if(j(r,`operationStepUpAuthorizationRequest.proof`,[`kind`,`authority`,`webauthn_authentication`]),!i||!O(i))throw Error(`operationStepUpAuthorizationRequest.proof requires an exact passkey authority`);a={kind:`passkey`,authority:i,webauthn_authentication:In(r.webauthn_authentication)};break;case`email_otp`:if(j(r,`operationStepUpAuthorizationRequest.proof`,[`kind`,`authority`,`challenge_id`,`otp_code`]),!i||!k(i))throw Error(`operationStepUpAuthorizationRequest.proof requires an exact Email OTP authority`);a={kind:`email_otp`,authority:i,challenge_id:M(r.challenge_id,`operationStepUpAuthorizationRequest.proof.challenge_id`),otp_code:M(r.otp_code,`operationStepUpAuthorizationRequest.proof.otp_code`)};break;default:throw Error(`operationStepUpAuthorizationRequest.proof.kind is invalid`)}return{kind:`router_ab_ecdsa_operation_step_up_v1`,operation:n,proof:a}}function Rn(e){let t=d(e,`ecdsaOperationStepUpPreparation`);if(j(t,`operationStepUpGrantRequest.operation`,[`wallet_id`,`operation_kind`,`operation_id`,`operation_digests`,`material_activation`,`normal_signing_scope`,`signing_worker_id`,`key_handle`,`relayer_key_id`,`participant_ids`,`expires_at_ms`]),!Array.isArray(t.participant_ids)||t.participant_ids.length!==2||!t.participant_ids.every(e=>Number.isSafeInteger(e)&&e>0))throw Error(`operationStepUpGrantRequest.operation.participant_ids must contain two positive integers`);return{wallet_id:M(t.wallet_id,`operationStepUpGrantRequest.operation.wallet_id`),operation_kind:zn(t.operation_kind),operation_id:M(t.operation_id,`operationStepUpGrantRequest.operation.operation_id`),operation_digests:Pn(t.operation_digests,`operationStepUpGrantRequest.operation.operation_digests`),material_activation:y(t.material_activation),normal_signing_scope:Z(t.normal_signing_scope),signing_worker_id:M(t.signing_worker_id,`operationStepUpGrantRequest.operation.signing_worker_id`),key_handle:M(t.key_handle,`operationStepUpGrantRequest.operation.key_handle`),relayer_key_id:M(t.relayer_key_id,`operationStepUpGrantRequest.operation.relayer_key_id`),participant_ids:[Number(t.participant_ids[0]),Number(t.participant_ids[1])],expires_at_ms:F(t.expires_at_ms,`operationStepUpGrantRequest.operation.expires_at_ms`)}}function zn(e){switch(e){case ce.signTransaction:case ce.exportKey:return e;default:throw Error(`operationStepUpGrantRequest.operation.operation_kind must be evm.sign_transaction or evm.export_key`)}}function Bn(e){return $({scope:e.scope,request_id:e.requestId,operation_id:e.operationId,operation_digests:e.operationDigests,authorization:e.authorization,material_activation:e.materialActivation,expires_at_ms:e.expiresAtMs,signing_digest_b64u:m(B(e.signingDigest32,`signingDigest32`,32)),server_presignature_id:e.serverPresignatureId,client_signature_share32_b64u:m(B(e.clientSignatureShare32,`clientSignatureShare32`,32)),client_rerandomization_contribution32_b64u:m(B(e.clientRerandomizationContribution32,`clientRerandomizationContribution32`,32))})}function $(e){let t=d(e,`ecdsaFinalizeCoreRequest`);return j(t,`ecdsaFinalizeCoreRequest`,[`scope`,`request_id`,`operation_id`,`operation_digests`,`authorization`,`material_activation`,`expires_at_ms`,`signing_digest_b64u`,`server_presignature_id`,`client_signature_share32_b64u`,`client_rerandomization_contribution32_b64u`]),Vn(t)}function Vn(e){let t={scope:Z(e.scope),request_id:M(e.request_id,`ecdsaFinalizeRequest.request_id`),operation_id:M(e.operation_id,`ecdsaFinalizeRequest.operation_id`),operation_digests:Pn(e.operation_digests,`ecdsaFinalizeRequest.operation_digests`),authorization:v(e.authorization),material_activation:y(e.material_activation),expires_at_ms:F(e.expires_at_ms,`ecdsaFinalizeRequest.expires_at_ms`),signing_digest_b64u:R(e.signing_digest_b64u,`ecdsaFinalizeRequest.signing_digest_b64u`,32),server_presignature_id:M(e.server_presignature_id,`ecdsaFinalizeRequest.server_presignature_id`),client_signature_share32_b64u:R(e.client_signature_share32_b64u,`ecdsaFinalizeRequest.client_signature_share32_b64u`,32),client_rerandomization_contribution32_b64u:R(e.client_rerandomization_contribution32_b64u,`ecdsaFinalizeRequest.client_rerandomization_contribution32_b64u`,32)};if(t.operation_digests.intent_digest_b64u!==t.signing_digest_b64u)throw Error(`ecdsaFinalizeRequest intent digest must equal the admitted signing digest`);return t}function Hn(e){let t=d(e,`ecdsaPrepareResponse`);return j(t,`ecdsaPrepareResponse`,[`scope`,`request_id`,`request_digest`,`signing_digest`,`server_presignature_id`,`server_big_r33_b64u`,`signing_worker_rerandomization_contribution32_b64u`,`signature_scheme`,`prepared_at_ms`,`expires_at_ms`]),{scope:Z(t.scope),request_id:M(t.request_id,`ecdsaPrepareResponse.request_id`),request_digest:V(t.request_digest,`ecdsaPrepareResponse.request_digest`),signing_digest:V(t.signing_digest,`ecdsaPrepareResponse.signing_digest`),server_presignature_id:M(t.server_presignature_id,`ecdsaPrepareResponse.server_presignature_id`),server_big_r33_b64u:R(t.server_big_r33_b64u,`ecdsaPrepareResponse.server_big_r33_b64u`,33),signing_worker_rerandomization_contribution32_b64u:R(t.signing_worker_rerandomization_contribution32_b64u,`ecdsaPrepareResponse.signing_worker_rerandomization_contribution32_b64u`,32),signature_scheme:Tt(t.signature_scheme,`ecdsaPrepareResponse.signature_scheme`),prepared_at_ms:F(t.prepared_at_ms,`ecdsaPrepareResponse.prepared_at_ms`),expires_at_ms:F(t.expires_at_ms,`ecdsaPrepareResponse.expires_at_ms`)}}async function Un(e,t){let n=Q(e),r=Hn(t);if(!Cn(r.scope,n.scope))throw Error(`ecdsaPrepareResponse.scope does not match request`);if(r.request_id!==n.request_id)throw Error(`ecdsaPrepareResponse.request_id does not match request`);if(r.server_presignature_id!==n.client_presignature_id)throw Error(`ecdsaPrepareResponse.server_presignature_id does not match request`);if(!q(r.signing_digest,en(n.signing_digest_b64u)))throw Error(`ecdsaPrepareResponse.signing_digest does not match request`);if(r.expires_at_ms!==n.expires_at_ms)throw Error(`ecdsaPrepareResponse.expires_at_ms does not match request`);if(!q(r.request_digest,await Dn(n)))throw Error(`ecdsaPrepareResponse.request_digest does not match request`);return r}function Wn(e){let t=d(e,`ecdsaSigningResponse`);return j(t,`ecdsaSigningResponse`,[`scope`,`request_id`,`request_digest`,`signing_digest`,`signature_scheme`,`signature65_b64u`]),{scope:Z(t.scope),request_id:M(t.request_id,`ecdsaSigningResponse.request_id`),request_digest:V(t.request_digest,`ecdsaSigningResponse.request_digest`),signing_digest:V(t.signing_digest,`ecdsaSigningResponse.signing_digest`),signature_scheme:Tt(t.signature_scheme,`ecdsaSigningResponse.signature_scheme`),signature65_b64u:R(t.signature65_b64u,`ecdsaSigningResponse.signature65_b64u`,65)}}async function Gn(e,t){let n=$(e),r=Wn(t);if(!Cn(r.scope,n.scope))throw Error(`ecdsaSigningResponse.scope does not match request`);if(r.request_id!==n.request_id)throw Error(`ecdsaSigningResponse.request_id does not match request`);if(!q(r.signing_digest,en(n.signing_digest_b64u)))throw Error(`ecdsaSigningResponse.signing_digest does not match request`);if(!q(r.request_digest,await kn(n)))throw Error(`ecdsaSigningResponse.request_digest does not match request`);return r}const Kn=new TextEncoder;function qn(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Jn(e,t){if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw Error(`${t} must be a non-negative u32`);return Uint8Array.from([e>>>24&255,e>>>16&255,e>>>8&255,e&255])}function Yn(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`);let n=BigInt(e),r=new Uint8Array(8);for(let e=7;e>=0;--e)r[e]=Number(n&255n),n>>=8n;return r}function Xn(e,t){return qn([Jn(e.length,`${t}.length`),e])}function Zn(e,t){if(typeof e!=`string`)throw Error(`${t} must be a string`);return Xn(Kn.encode(e),t)}function Qn(e,t){try{let t=h(de(e));if(t.length!==32)throw Error(`must decode to 32 bytes`);return t}catch(e){throw Error(`${t} ${e instanceof Error?e.message:`is invalid`}`)}}function $n(e,t){try{let t=h(e);if(t.length===0||m(t)!==e)throw Error(`must be canonical base64url`);return t}catch(e){throw Error(`${t} ${e instanceof Error?e.message:`is invalid`}`)}}export{Ze as $,Ut as A,x as At,hn as B,It as C,De as Ct,Jt as D,we as Dt,Rn as E,Ee as Et,jn as F,S as Ft,on as G,Kt as H,Nn as I,fe as It,Gt as J,K,kn as L,Nt as M,v as Mt,Ft as N,he as Nt,Zt as O,Se as Ot,Ht as P,me as Pt,Be as Q,Dn as R,G as S,Oe as St,gt as T,Te as Tt,Cn as U,nn as V,an as W,Je as X,W as Y,Ke as Z,$t as _,Le as _t,Zn as a,nt as at,Z as b,Ne as bt,ct as c,He as ct,ut as d,ze as dt,Ye as et,dt as f,Pe as ft,_t as g,Me as gt,Fn as h,Re as ht,$n as i,D as it,Wt as j,y as jt,Qt as k,xe as kt,ft as l,Ve as lt,Bn as m,je as mt,Xn as n,k as nt,Jn as o,rt as ot,st as p,Ae as pt,rn as q,Qn as r,O as rt,Yn as s,et as st,qn as t,Xe as tt,lt as u,ot as ut,Un as v,Fe as vt,Ln as w,Ce as wt,An as x,ke as xt,Gn as y,Ie as yt,xn as z};
@@ -1 +1 @@
1
- import{B as e,V as t}from"./domainIds-t1lp25yU.js";function n(t,n,r=`is required`){let i=e(t);if(!i)throw Error(`${n} ${r}`);return i}function r(t){return e(t)||void 0}function i(e,t){return n(e,t,`must be a non-empty string`)}function a(e,t,n=`is invalid`){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw Error(`${t} ${n}`);return e}function o(e,t){let n=String(e||``).trim();if(!n)throw Error(`${t} is required`);return n}function s(e,n){let r=t(e);if(!r)throw Error(`${n} is required`);return r}function c(e){return typeof e==`object`&&!!e}function l(e){return c(e)&&!Array.isArray(e)}function u(e){return typeof e==`string`}function d(e){return typeof e==`number`&&Number.isFinite(e)}function f(e){return typeof e==`function`}function p(e){return typeof e==`boolean`}function m(e){return Array.isArray(e)}function h(e){return l(e)?e:null}function g(e){return c(e)?e:null}function _(e,t){if(!l(e))throw Error(`${t} must be an object`);return e}function v(e,t){return Object.fromEntries(Object.entries(_(e,t)))}function y(e,t){if(!Array.isArray(e))throw Error(`${t} must be an array`);return e}function b(e,t=`value`){if(typeof e!=`string`)throw Error(`Invalid ${t}: expected string`);return e}function x(e){if(!c(e))return!1;let t=`transaction`in e,n=`signature`in e,r=e,i=Array.isArray(r.borsh_bytes)||r.borshBytes instanceof Uint8Array,a=typeof e.base64Encode==`function`;return t&&n&&i&&!a}function S(e){let t=Array.isArray(e.borsh_bytes)?e.borsh_bytes:void 0;if(t)return t;let n=e.borshBytes instanceof Uint8Array?e.borshBytes:void 0;return Array.from(n||new Uint8Array)}function C(e){if(Array.isArray(e))return e.map(C);if(typeof e==`object`&&e){let t=e,n=Object.keys(t).sort(),r={};for(let e of n)r[e]=C(t[e]);return r}return e}function w(e){return JSON.stringify(C(e))}async function T(e){return await E(new TextEncoder().encode(e))}async function E(e){let t=e.slice(),n=await crypto.subtle.digest(`SHA-256`,t);return new Uint8Array(n)}function D(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function O(e){return D(await T(e))}const k=new Set([`near-mainnet`,`near-testnet`,`tempo-mainnet`,`tempo-testnet`,`arc-mainnet`,`arc-testnet`,`ethereum-mainnet`,`ethereum-sepolia`]);function A(e){return typeof e==`string`&&k.has(e)}function j(e){return A(e)?e.startsWith(`near-`):!1}function M(e){return A(e)?e.startsWith(`tempo-`):!1}function N(e){return j(e)?`near`:M(e)?`tempo`:`evm`}function P(e){return e===`near-mainnet`?`mainnet`:`testnet`}function F(e,t){if(Array.isArray(e))return e.find(e=>N(e.network)===t)}function I(e,t){let n=F(e,t);if(!n)throw Error(`[configPresets] Missing required config: chains (no ${t} network entry)`);return n}function L(e){let n=I(e,`near`),r=t(n.rpcUrl);if(!r)throw Error(`[configPresets] Missing required config: chains.${n.network}.rpcUrl`);return r}function R(e){return P(I(e,`near`).network)}function z(e,n){let r=F(e,n);if(r)return t(r.explorerUrl)||void 0}function B(e){if(typeof e==`bigint`)return e>=0n?e.toString():void 0;if(typeof e==`number`)return!Number.isSafeInteger(e)||e<0?void 0:String(e)}function V(e){let n=e.chains;if(!Array.isArray(n)||n.length===0)return;let r=B(e.chainId);if(r)for(let i of n){if(N(i.network)!==e.family)continue;let n=B(i.chainId);if(!n||n!==r)continue;let a=t(i.explorerUrl);if(a)return a}return z(n,e.family)}export{v as A,l as C,a as D,y as E,r as M,i as O,c as S,u as T,S as _,R as a,d as b,w as c,O as d,h as f,s as g,o as h,V as i,n as j,_ as k,E as l,b as m,j as n,z as o,g as p,A as r,L as s,N as t,T as u,m as v,x as w,f as x,p as y};
1
+ import{B as e,V as t}from"./domainIds-t1lp25yU.js";function n(t,n,r=`is required`){let i=e(t);if(!i)throw Error(`${n} ${r}`);return i}function r(t){return e(t)||void 0}function i(e,t){return n(e,t,`must be a non-empty string`)}function a(e,t,n=`is invalid`){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw Error(`${t} ${n}`);return e}function o(e,t){let n=String(e||``).trim();if(!n)throw Error(`${t} is required`);return n}function s(e,n){let r=t(e);if(!r)throw Error(`${n} is required`);return r}function c(e){return typeof e==`object`&&!!e}function l(e){return c(e)&&!Array.isArray(e)}function u(e){return typeof e==`string`}function d(e){return typeof e==`number`&&Number.isFinite(e)}function f(e){return typeof e==`function`}function p(e){return typeof e==`boolean`}function m(e){return Array.isArray(e)}function h(e){return l(e)?e:null}function g(e){return c(e)?e:null}function _(e,t){if(!l(e))throw Error(`${t} must be an object`);return e}function v(e,t){return Object.fromEntries(Object.entries(_(e,t)))}function y(e,t){if(!Array.isArray(e))throw Error(`${t} must be an array`);return e}function b(e,t=`value`){if(typeof e!=`string`)throw Error(`Invalid ${t}: expected string`);return e}function x(e){if(!c(e))return!1;let t=`transaction`in e,n=`signature`in e,r=e,i=Array.isArray(r.borsh_bytes)||r.borshBytes instanceof Uint8Array,a=typeof e.base64Encode==`function`;return t&&n&&i&&!a}function S(e){let t=Array.isArray(e.borsh_bytes)?e.borsh_bytes:void 0;if(t)return t;let n=e.borshBytes instanceof Uint8Array?e.borshBytes:void 0;return Array.from(n||new Uint8Array)}function C(e){if(Array.isArray(e))return e.map(C);if(typeof e==`object`&&e){let t=e,n=Object.keys(t).sort(),r={};for(let e of n)r[e]=C(t[e]);return r}return e}function w(e){return JSON.stringify(C(e))}async function T(e){return await E(new TextEncoder().encode(e))}async function E(e){let t=e.slice(),n=await crypto.subtle.digest(`SHA-256`,t);return new Uint8Array(n)}function D(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function O(e){return D(await T(e))}export{v as C,_ as S,r as T,x as _,h as a,a as b,o as c,m as d,p as f,l as g,c as h,O as i,s as l,f as m,E as n,g as o,d as p,T as r,b as s,w as t,S as u,u as v,n as w,i as x,y};
@@ -1 +1 @@
1
- import{n as e}from"./normalization-DtruiNPw.js";import{_ as t,g as n,h as r,m as i}from"./signingFlow-BVvteILM.js";function a(e){try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t,2)}catch{return String(e)}}function o(e,t,n){let r=String(t??``).trim();if(r)return{label:e,value:r,...typeof n==`string`&&n.trim()?{copyValue:n}:{}}}function s(t){let n=e(t.input);if(n!==`0x`&&!(!Array.isArray(t.abi)||t.abi.length===0))return{dataHex:n,abi:t.abi}}function c(a){let{rootId:c,call:l,tx:u}=a,d=String(l.to||``).trim(),f=e(String(l.input||`0x`));if(f===`0x`)return;let p=t(f),m=n(p,d)||`contract function`,h=i(u.gasLimit),g=o(`Data`,r(f),f);g&&(g.renderAs=`file-content`,g.hideLabel=!0,g.hideChevron=!0);let _=[g,o(`Value (wei)`,l.value.toString()),o(`Valid Before`,u.validBefore==null?void 0:u.validBefore.toString()),o(`Valid After`,u.validAfter==null?void 0:u.validAfter.toString())].filter(Boolean),v={id:`${c}.call`,kind:`generic.contractCall`,label:`Calling ${m} using ${h} gas`,to:d,value:l.value.toString(),selector:p,fields:_},y=s({input:f,abi:l.abi});return y&&(v.abiDecodeHint=y),v}function l(n){let{call:r,callIndex:i,callCount:a,tx:o}=n,s=`tempo.tx.${i}`,l=String(r.to||``).trim(),u=a>1?`Transaction ${i+1} to contract`:`Transaction to contract`,d=c({rootId:s,call:r,tx:o});return{id:s,kind:`tempo.eip2718`,label:u,txTypeHex:`0x76`,txTypeName:`TempoTransaction`,to:l,selector:t(e(String(r.input||`0x`))),...d?{children:[d]}:{}}}function u(e){if(e.kind!==`tempoTransaction`)return[{id:`tempo.raw`,kind:`raw.fallback`,label:`Unsupported Tempo Payload`,raw:a(e)}];let t=Array.isArray(e.tx.calls)?e.tx.calls:[];return t.length?t.map((n,r)=>l({call:n,callIndex:r,callCount:t.length,tx:e.tx})):[{id:`tempo.raw`,kind:`raw.fallback`,label:`Tempo Payload Missing Calls`,raw:a(e)}]}function d(e){let t=u(e.request),n=BigInt(0);if(e.request.kind===`tempoTransaction`)for(let t of e.request.tx.calls||[])n+=BigInt(t.value||0);return{chain:`tempo`,chainId:e.request.kind===`tempoTransaction`?e.request.tx.chainId:void 0,intentDigest:e.intentDigest,signerAccount:e.signerAccount,title:e.title||`Tempo Transaction`,subtitle:e.subtitle,operations:t,...n>0n?{totals:{nativeValue:n.toString(),nativeSymbol:`wei`}}:{}}}export{d as t};
1
+ import{n as e}from"./normalization-dgJxtZKK.js";import{_ as t,g as n,h as r,m as i}from"./signingFlow-C7fwkxPx.js";function a(e){try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t,2)}catch{return String(e)}}function o(e,t,n){let r=String(t??``).trim();if(r)return{label:e,value:r,...typeof n==`string`&&n.trim()?{copyValue:n}:{}}}function s(t){let n=e(t.input);if(n!==`0x`&&!(!Array.isArray(t.abi)||t.abi.length===0))return{dataHex:n,abi:t.abi}}function c(a){let{rootId:c,call:l,tx:u}=a,d=String(l.to||``).trim(),f=e(String(l.input||`0x`));if(f===`0x`)return;let p=t(f),m=n(p,d)||`contract function`,h=i(u.gasLimit),g=o(`Data`,r(f),f);g&&(g.renderAs=`file-content`,g.hideLabel=!0,g.hideChevron=!0);let _=[g,o(`Value (wei)`,l.value.toString()),o(`Valid Before`,u.validBefore==null?void 0:u.validBefore.toString()),o(`Valid After`,u.validAfter==null?void 0:u.validAfter.toString())].filter(Boolean),v={id:`${c}.call`,kind:`generic.contractCall`,label:`Calling ${m} using ${h} gas`,to:d,value:l.value.toString(),selector:p,fields:_},y=s({input:f,abi:l.abi});return y&&(v.abiDecodeHint=y),v}function l(n){let{call:r,callIndex:i,callCount:a,tx:o}=n,s=`tempo.tx.${i}`,l=String(r.to||``).trim(),u=a>1?`Transaction ${i+1} to contract`:`Transaction to contract`,d=c({rootId:s,call:r,tx:o});return{id:s,kind:`tempo.eip2718`,label:u,txTypeHex:`0x76`,txTypeName:`TempoTransaction`,to:l,selector:t(e(String(r.input||`0x`))),...d?{children:[d]}:{}}}function u(e){if(e.kind!==`tempoTransaction`)return[{id:`tempo.raw`,kind:`raw.fallback`,label:`Unsupported Tempo Payload`,raw:a(e)}];let t=Array.isArray(e.tx.calls)?e.tx.calls:[];return t.length?t.map((n,r)=>l({call:n,callIndex:r,callCount:t.length,tx:e.tx})):[{id:`tempo.raw`,kind:`raw.fallback`,label:`Tempo Payload Missing Calls`,raw:a(e)}]}function d(e){let t=u(e.request),n=BigInt(0);if(e.request.kind===`tempoTransaction`)for(let t of e.request.tx.calls||[])n+=BigInt(t.value||0);return{chain:`tempo`,chainId:e.request.kind===`tempoTransaction`?e.request.tx.chainId:void 0,intentDigest:e.intentDigest,signerAccount:e.signerAccount,title:e.title||`Tempo Transaction`,subtitle:e.subtitle,operations:t,...n>0n?{totals:{nativeValue:n.toString(),nativeSymbol:`wei`}}:{}}}export{d as t};