@abtnode/blocklet-services 1.16.54-beta-20251016-050817-2fc632b8 → 1.16.54-beta-20251021-070951-25e3083c

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 (263) hide show
  1. package/api/cache.js +1 -1
  2. package/api/emails/_components/asset.js +7 -2
  3. package/api/emails/_components/attachments.js +1 -1
  4. package/api/index.js +2 -0
  5. package/api/libs/connect/v1.js +2 -2
  6. package/api/libs/connect/v2.js +1 -1
  7. package/api/libs/email.js +1 -1
  8. package/api/libs/push-kit/index.js +2 -2
  9. package/api/middlewares/check-federated.js +4 -4
  10. package/api/middlewares/verify-sig.js +3 -2
  11. package/api/routes/blocklet.js +1 -1
  12. package/api/routes/federated.js +1 -1
  13. package/api/routes/mcp.js +1 -1
  14. package/api/routes/sign.js +388 -0
  15. package/api/routes/user.js +1 -1
  16. package/api/services/auth/connect/receive-transfer-app-owner.js +2 -2
  17. package/api/services/auth/session.js +2 -2
  18. package/api/services/notification/blocklet-events-notifier.js +1 -1
  19. package/api/services/notification/queue.js +2 -1
  20. package/api/socket/channel/component.js +1 -1
  21. package/api/socket/channel/did.js +1 -1
  22. package/api/socket/util.js +4 -2
  23. package/api/util/federated.js +1 -1
  24. package/api/util/index.js +1 -1
  25. package/dist/assets/{AdapterDayjs-DyE9ImrK.js → AdapterDayjs-_MgvkJfN.js} +1 -1
  26. package/dist/assets/{Google-ZJmTt04Y.js → Google-BqikEiR8.js} +1 -1
  27. package/dist/assets/{access-control-C5AwSG3T.js → access-control-BoqKXv8e.js} +1 -1
  28. package/dist/assets/{actions-C4-lIUPY.js → actions-DqoNrBDK.js} +1 -1
  29. package/dist/assets/add-component-core-sYAwjN9z.js +768 -0
  30. package/dist/assets/{add-resource-Brh4F6D2.js → add-resource-hzPcoJ0T.js} +1 -1
  31. package/dist/assets/{addon-DMW6BcQH.js → addon-CS6YZSHC.js} +2 -2
  32. package/dist/assets/{advanced-ykwSXzlQ.js → advanced-J_6wIjW2.js} +2 -2
  33. package/dist/assets/{aigne-DmDL-WLj.js → aigne-CxLs420v.js} +1 -1
  34. package/dist/assets/api-Btn0Tp3W.js +1 -0
  35. package/dist/assets/{appearance-CwaUUdyp.js → appearance-Bwlo2rIk.js} +1 -1
  36. package/dist/assets/{ar-Ge3t6oI2.js → ar-BQm9lQ4M.js} +1 -1
  37. package/dist/assets/{arrow-down.svg-D3B8bxxx.js → arrow-down.svg-D6V-7qfa.js} +1 -1
  38. package/dist/assets/audit-logs-drM5It_9.js +35 -0
  39. package/dist/assets/{authorize-CmneXxos.js → authorize-C2nAxV7L.js} +1 -1
  40. package/dist/assets/{base-chart-C_jLgGFD.js → base-chart-C-Raz4Q-.js} +1 -1
  41. package/dist/assets/{base32-Cg02gOuu.js → base32-ka8Vb9QP.js} +1 -1
  42. package/dist/assets/bind-account-BKkm4lat.js +1 -0
  43. package/dist/assets/{branding-B_eCdYJK.js → branding-BMzG8nKx.js} +5 -5
  44. package/dist/assets/branding-LL49PkTZ.js +1 -0
  45. package/dist/assets/{branding-DETOdgiW.js → branding-ZGJRfDDo.js} +1 -1
  46. package/dist/assets/{bundle-avatar-BFaxogKz.js → bundle-avatar-DLTX9h1v.js} +1 -1
  47. package/dist/assets/button-9InonP1B.js +1 -0
  48. package/dist/assets/click-to-copy-C1mF6WNf.js +1 -0
  49. package/dist/assets/{cloneDeep-gpb_g13N.js → cloneDeep-C6qewg0C.js} +1 -1
  50. package/dist/assets/{collapse-D7GlSZQp.js → collapse-BMy0GGFk.js} +1 -1
  51. package/dist/assets/{complete-Bqi3d0V1.js → complete-D-B5H4ek.js} +2 -2
  52. package/dist/assets/{component-CSPqPsOF.js → component-BRcD0ov6.js} +4 -4
  53. package/dist/assets/{config-BHZS65kz.js → config-BBtGnVxO.js} +1 -1
  54. package/dist/assets/{config-BWSyA18z.js → config-Cbg3z3uP.js} +4 -4
  55. package/dist/assets/{config-CPdtVTio.js → config-D_zbuwUO.js} +1 -1
  56. package/dist/assets/{config-navigation-BFsrGucq.js → config-navigation-C1GAik0L.js} +3 -3
  57. package/dist/assets/{config-space-CSl6D7xo.js → config-space-DAd9qYRh.js} +1 -1
  58. package/dist/assets/confirm-G3RZHlkC.js +7 -0
  59. package/dist/assets/{connect-BVXqic92.js → connect-BKAyVkDD.js} +1 -1
  60. package/dist/assets/{connect-FvriLilq.js → connect-BsaKZiRP.js} +1 -1
  61. package/dist/assets/connect-to-CEyhDVUe.js +1 -0
  62. package/dist/assets/{content-layout-W7JDm8iO.js → content-layout-oyz1EqNZ.js} +1 -1
  63. package/dist/assets/{create-passport-svg-BsR3hKFq.js → create-passport-svg-_Jak4aT3.js} +1 -1
  64. package/dist/assets/createClass-SqayuDE6.js +1 -0
  65. package/dist/assets/{dashboard-DyYLnek8.js → dashboard-DmRLgkA_.js} +2 -2
  66. package/dist/assets/{de-CbARTvf4.js → de-D0uPENSq.js} +1 -1
  67. package/dist/assets/{delete-confirm-DpKJ9gtf.js → delete-confirm-DfQxKTw0.js} +1 -1
  68. package/dist/assets/{did-address-BQL5Zxlr.js → did-address-CZak4Nzl.js} +1 -1
  69. package/dist/assets/domain-BAM622YE.js +9 -0
  70. package/dist/assets/{domain-action-card-CRdL2PFv.js → domain-action-card-CQGZ0jGR.js} +2 -2
  71. package/dist/assets/domains-CO0Aw1Yc.js +1 -0
  72. package/dist/assets/{email-OlQWpbtF.js → email-Dl8yxP6V.js} +1 -1
  73. package/dist/assets/{empty-spinner-sNq-0DF5.js → empty-spinner-DYOzicuy.js} +1 -1
  74. package/dist/assets/engine-9k0o50qZ.js +1 -0
  75. package/dist/assets/{es-CaCbzATO.js → es-Dh4_UfCu.js} +1 -1
  76. package/dist/assets/{exchange-passport-DK4-g9my.js → exchange-passport-D8yfPLJz.js} +1 -1
  77. package/dist/assets/{form-C5dLovtO.js → form-CNqHi73v.js} +3 -3
  78. package/dist/assets/{form-text-input-AIMlcRaM.js → form-text-input-BAs2p7bF.js} +1 -1
  79. package/dist/assets/{form-wrapper-DINLdpTN.js → form-wrapper-C8oo_Fdy.js} +1 -1
  80. package/dist/assets/{fr-B3yjKUFH.js → fr-CzZWQkiT.js} +1 -1
  81. package/dist/assets/{fuel-DkqmEB8D.js → fuel-CplPFp5J.js} +1 -1
  82. package/dist/assets/{gen-access-key-BnCg2Wu1.js → gen-access-key-BOCSj0Mk.js} +1 -1
  83. package/dist/assets/{gen-simple-access-key-zOQbFtZ8.js → gen-simple-access-key-BtXjt6B3.js} +1 -1
  84. package/dist/assets/get-safe-url-BFcRpP-P.js +1 -0
  85. package/dist/assets/{hi-q4mhHiIl.js → hi-Do9VCuRi.js} +1 -1
  86. package/dist/assets/{home-DTXdAvXT.js → home-C4yo5X5x.js} +1 -1
  87. package/dist/assets/{id-DTf7aVH8.js → id-Dhhrveu9.js} +1 -1
  88. package/dist/assets/{iframe-DAoobOBi.js → iframe-BnDsbRZG.js} +1 -1
  89. package/dist/assets/index-B-TqDd4N.js +6 -0
  90. package/dist/assets/{index-IGBGBXd_.js → index-B-Z_6Rom.js} +1 -1
  91. package/dist/assets/index-B4cuO9Xn.js +1 -0
  92. package/dist/assets/index-BF2QIyXe.js +1 -0
  93. package/dist/assets/{index-ve-p7nSZ.js → index-BXeml37I.js} +5 -5
  94. package/dist/assets/index-Bg7omuZF.js +120 -0
  95. package/dist/assets/index-BkN8Xhir.js +4 -0
  96. package/dist/assets/{index-DNGdj2R4.js → index-BnLQoeO-.js} +8 -8
  97. package/dist/assets/{index-DHQkab_n.js → index-Bq0J1vuR.js} +4 -4
  98. package/dist/assets/{index-DFceGCP0.js → index-C1Dar18k.js} +1 -1
  99. package/dist/assets/{index-D1thq8eN.js → index-C2BTIEUf.js} +6 -6
  100. package/dist/assets/index-C4jOkJlz.js +7 -0
  101. package/dist/assets/{index-D6Y3sCzN.js → index-C80zMKsC.js} +2 -2
  102. package/dist/assets/{index-Cs_I9KFa.js → index-CBUhK5iP.js} +7 -7
  103. package/dist/assets/index-CJ-XSW_L.js +281 -0
  104. package/dist/assets/{index-BJrVQ6ch.js → index-CVsqBtJa.js} +8 -8
  105. package/dist/assets/{index-C80JxCSn.js → index-CZin5K15.js} +1 -1
  106. package/dist/assets/{index-B6a6aopU.js → index-CjkeMMBV.js} +10 -10
  107. package/dist/assets/{index-D_vhPpT2.js → index-ClNZcPUD.js} +1 -1
  108. package/dist/assets/{index-Cr5RxnHu.js → index-CusWQN3w.js} +2 -2
  109. package/dist/assets/{index-iOD1kOar.js → index-D1efASvL.js} +4 -4
  110. package/dist/assets/{index-VySXxf4w.js → index-D5TNmV3K.js} +1 -1
  111. package/dist/assets/index-DBAtORvP.js +1 -0
  112. package/dist/assets/index-DGdrBC5v.js +55 -0
  113. package/dist/assets/index-DOKjY-HO.js +124 -0
  114. package/dist/assets/{index-rQAVknkX.js → index-DPyXKBMU.js} +1 -1
  115. package/dist/assets/{index-BdHbrnpK.js → index-DdsyasUE.js} +2 -2
  116. package/dist/assets/{index-DX3L95vz.js → index-De-Vgsb6.js} +1 -1
  117. package/dist/assets/{index-DlRa8Zeh.js → index-DsXcQxrF.js} +1 -1
  118. package/dist/assets/index-FASRIZyi.js +1039 -0
  119. package/dist/assets/{index-Cd_Gml9C.js → index-KLDWx9Xh.js} +1 -1
  120. package/dist/assets/{index-KpZGUssm.js → index-NomqB6Iy.js} +1 -1
  121. package/dist/assets/{index-DeVDiUjo.js → index-SEBP2NIP.js} +1 -1
  122. package/dist/assets/index-XxymBn5U.js +29 -0
  123. package/dist/assets/{invitation-P1aXUnIO.js → invitation-BUnl3HPw.js} +2 -2
  124. package/dist/assets/{invitations-dPkgiFPr.js → invitations-C4hW9Ss3.js} +1 -1
  125. package/dist/assets/{invite-Bz99qCDF.js → invite-C3ahxxD9.js} +1 -1
  126. package/dist/assets/{isURL-DYsELTMk.js → isURL-2pkMgw7e.js} +2 -2
  127. package/dist/assets/{issue-passport-DPyxNFLD.js → issue-passport-Ciq2eM7I.js} +1 -1
  128. package/dist/assets/{item-B1UaStjk.js → item-O0rUCXMz.js} +1 -1
  129. package/dist/assets/{ja-Csh_XwzF.js → ja-B70UYq5X.js} +1 -1
  130. package/dist/assets/{ko-xiNTwgO9.js → ko-C7TZwmXC.js} +1 -1
  131. package/dist/assets/{landing-page-CkVnGimh.js → landing-page-CG20_HOe.js} +1 -1
  132. package/dist/assets/{launch-result-message-Dt-T7zmz.js → launch-result-message-DWeUg9rM.js} +1 -1
  133. package/dist/assets/{layout-fFNOz6Xe.js → layout-1o45g_uH.js} +1 -1
  134. package/dist/assets/list-C71-rjVf.js +2 -0
  135. package/dist/assets/list-DINgkvuD.js +103 -0
  136. package/dist/assets/{list-header-CjohGZ9B.js → list-header-BE2kzda_.js} +1 -1
  137. package/dist/assets/localization-DYkMU0eo.js +1 -0
  138. package/dist/assets/{log-lPrpnnPZ.js → log-DqmR8QgI.js} +1 -1
  139. package/dist/assets/logger-oH4RP6-F.js +1 -0
  140. package/dist/assets/login-BI9XDtGo.js +1 -0
  141. package/dist/assets/{login-oauth-callback-DebmT1Db.js → login-oauth-callback-DtnKE3JA.js} +1 -1
  142. package/dist/assets/{logo-uploader-3OpHGD1n.js → logo-uploader-B4ZyAHbx.js} +1 -1
  143. package/dist/assets/{lost-passport-xCmWuuxC.js → lost-passport-Bjk0xMLc.js} +3 -3
  144. package/dist/assets/{observability-B458LeIE.js → observability-Zow0Sv-X.js} +1 -1
  145. package/dist/assets/{omit-DdfLLBNW.js → omit-hhiOJGRf.js} +1 -1
  146. package/dist/assets/{open-window-CzYfI7l7.js → open-window-Dtxc-Syt.js} +1 -1
  147. package/dist/assets/{over-due-invoice-payment-C5fynimj.js → over-due-invoice-payment-Bk50hmsa.js} +1 -1
  148. package/dist/assets/{overview-BFzvEbcq.js → overview-CknecGQX.js} +2 -2
  149. package/dist/assets/{page-header-gosgJ3fX.js → page-header-DCvzRay5.js} +1 -1
  150. package/dist/assets/passport-C1l7yRXa.js +1 -0
  151. package/dist/assets/passport-item-Dysdq_0a.js +1 -0
  152. package/dist/assets/{permission-UeJPGiMm.js → permission-YVbPVhS_.js} +1 -1
  153. package/dist/assets/{playground-_1Dj8J_h.js → playground-CAOOFQT1.js} +1 -1
  154. package/dist/assets/preferences-BnD1O3qZ.js +1 -0
  155. package/dist/assets/profile-embed-C-sTb3pJ.js +1 -0
  156. package/dist/assets/{pt-BvcG4R7B.js → pt-DObJ_ADK.js} +1 -1
  157. package/dist/assets/publish-resource-DyVr3uUG.js +1 -0
  158. package/dist/assets/{react-beautiful-dnd.esm-CIwtis6a.js → react-beautiful-dnd.esm-sCK871VJ.js} +1 -1
  159. package/dist/assets/{react-stripe.esm-omsK4b05.js → react-stripe.esm-Dc9snvfb.js} +1 -1
  160. package/dist/assets/{required-BPzIdi1N.js → required-BGaDOGrj.js} +1 -1
  161. package/dist/assets/revoke.svg-CmffMlcP.js +1 -0
  162. package/dist/assets/{ru-DzUPRLmr.js → ru-nYDmEUmY.js} +1 -1
  163. package/dist/assets/runtime-CRB33yxr.js +1 -0
  164. package/dist/assets/{sanitize-CEXE1rEu.js → sanitize-BEqBHa8a.js} +1 -1
  165. package/dist/assets/sdk-Cl2zdl3A.js +1 -0
  166. package/dist/assets/{section-DOw43pby.js → section-C75bzkkL.js} +1 -1
  167. package/dist/assets/security-cMS5Z8Ta.js +22 -0
  168. package/dist/assets/{session-Dnp_ufkx.js → session-Chl38-LD.js} +1 -1
  169. package/dist/assets/{setup-DpBiTcjv.js → setup-C01-2uXI.js} +1 -1
  170. package/dist/assets/{shorten-label-C-X_7vr2.js → shorten-label-RqvHqcC3.js} +1 -1
  171. package/dist/assets/simple-select-DN_9r-L2.js +1 -0
  172. package/dist/assets/{spaces-Bu7-7u79.js → spaces-BH2l_OkZ.js} +1 -1
  173. package/dist/assets/{start-B1qawsPb.js → start-BFh5jV0q.js} +1 -1
  174. package/dist/assets/{starting-progress-BfM3wNuj.js → starting-progress-bX2MhHI_.js} +1 -1
  175. package/dist/assets/status-Cchdz2Py.js +1 -0
  176. package/dist/assets/{step-actions-BzwezgI2.js → step-actions-CcUwY5bt.js} +1 -1
  177. package/dist/assets/{studio-Bk9PCaeS.js → studio-C0FYSJNq.js} +1 -1
  178. package/dist/assets/{switch-control-CRxlGq2g.js → switch-control-Bn_HYEC5.js} +1 -1
  179. package/dist/assets/{table-tips-BMq3WO_p.js → table-tips-Crqym4Bn.js} +1 -1
  180. package/dist/assets/team-Bje0MaMX.js +146 -0
  181. package/dist/assets/{th-BmW1qKpZ.js → th-DMcUw_9_.js} +1 -1
  182. package/dist/assets/traffic-CeSX-kN3.js +1 -0
  183. package/dist/assets/{transfer-CUe_bnhh.js → transfer-Ja2mKjqd.js} +2 -2
  184. package/dist/assets/ua-parser-DP5omx3I.js +1 -0
  185. package/dist/assets/{unsubscribe-5Z1xcJ3T.js → unsubscribe-Dmbg53P8.js} +1 -1
  186. package/dist/assets/{use-app-logo-0uziDh86.js → use-app-logo-DhmCQsWv.js} +1 -1
  187. package/dist/assets/{use-mobile-DLnLSQQq.js → use-mobile-DCNBsOlH.js} +1 -1
  188. package/dist/assets/{use-mobile-Db5FIl07.js → use-mobile-maRlSUwU.js} +1 -1
  189. package/dist/assets/{use-server-logo-CFlVReBS.js → use-server-logo-n_aaKVoZ.js} +1 -1
  190. package/dist/assets/{use-window-close-CrHmRyVV.js → use-window-close-CYqH6r-n.js} +1 -1
  191. package/dist/assets/{useAsync-BKYfrNw7.js → useAsync-BcVLpt2E.js} +1 -1
  192. package/dist/assets/{useAsync-1_z8P8M4.js → useAsync-cZ_FPf9k.js} +1 -1
  193. package/dist/assets/{useAsyncRetry-Dyo5t1bq.js → useAsyncRetry-DwwEjrjs.js} +1 -1
  194. package/dist/assets/{useLocalStorage-Be_1V0gr.js → useLocalStorage-BIH12-5o.js} +1 -1
  195. package/dist/assets/user-center-_0Nuo2NC.js +126 -0
  196. package/dist/assets/user-follower-rI_4OXB_.js +32 -0
  197. package/dist/assets/{util-DXaZWduO.js → util-CVi4JaWM.js} +1 -1
  198. package/dist/assets/{util-CQfGbjyT.js → util-LPNcvj77.js} +1 -1
  199. package/dist/assets/{vendor-arcblock-DGOH9a3F.js → vendor-arcblock-DVRwGBYP.js} +114 -115
  200. package/dist/assets/{vendor-hooks-DmThWyyG.js → vendor-hooks-CjESGRlR.js} +2 -2
  201. package/dist/assets/{vendor-mui-core-BFPsXaTR.js → vendor-mui-core-CnXrAOs3.js} +1 -1
  202. package/dist/assets/{vendor-mui-x-C6iZOJbV.js → vendor-mui-x-bJ5idfMH.js} +1 -1
  203. package/dist/assets/vendor-utils-cJEl_UEd.js +213 -0
  204. package/dist/assets/{vendor-ux-CE4sOH7O.js → vendor-ux-DtnxszG_.js} +126 -133
  205. package/dist/assets/{vi-BPU54RQW.js → vi-B73oWQBC.js} +1 -1
  206. package/dist/assets/{wait-connect-Rle27g9O.js → wait-connect-DDuMthnp.js} +1 -1
  207. package/dist/assets/{wizard-CewJTR0V.js → wizard-Boblk5Le.js} +1 -1
  208. package/dist/assets/{wizard-components-B4yvBYZF.js → wizard-components-DxHb4Zui.js} +1 -1
  209. package/dist/assets/wrap-locale-DTDVuPVv.js +1 -0
  210. package/dist/assets/{zh-Bg-a-bz5.js → zh-CeqvJ1eC.js} +1 -1
  211. package/dist/assets/{zh-WrFfMVyM.js → zh-DCABA61W.js} +1 -1
  212. package/dist/assets/{zh-tw-DjWFpq-W.js → zh-tw-M_0Y4wmR.js} +1 -1
  213. package/dist/index.html +1 -1
  214. package/dist/service-worker.js +1 -1
  215. package/package.json +49 -48
  216. package/dist/assets/add-component-core-CrZWbFmf.js +0 -768
  217. package/dist/assets/api-txzyyizM.js +0 -1
  218. package/dist/assets/audit-logs-eJR1v94e.js +0 -35
  219. package/dist/assets/bind-account-B_UMGXib.js +0 -1
  220. package/dist/assets/branding-CHRz3wuZ.js +0 -1
  221. package/dist/assets/button-CaqBEwnu.js +0 -1
  222. package/dist/assets/click-to-copy-CK42VmRr.js +0 -1
  223. package/dist/assets/confirm-CEAKWDZJ.js +0 -7
  224. package/dist/assets/connect-to-dZwJX0bt.js +0 -1
  225. package/dist/assets/createClass-B4I2IV47.js +0 -1
  226. package/dist/assets/domain-Bq75ZuOm.js +0 -9
  227. package/dist/assets/domains-BiIZZN7p.js +0 -1
  228. package/dist/assets/engine-B1U2TY7M.js +0 -1
  229. package/dist/assets/get-safe-url-3Xj-tgXY.js +0 -1
  230. package/dist/assets/index-3yzleS_1.js +0 -1041
  231. package/dist/assets/index-BcGECSaf.js +0 -1
  232. package/dist/assets/index-Bgt2qHLn.js +0 -30
  233. package/dist/assets/index-CDCcuLh3.js +0 -7
  234. package/dist/assets/index-CZp06HHE.js +0 -281
  235. package/dist/assets/index-D9QTZSnh.js +0 -1
  236. package/dist/assets/index-DJj8GmQS.js +0 -6
  237. package/dist/assets/index-D_HqsEfj.js +0 -4
  238. package/dist/assets/index-D_s4QOu7.js +0 -1
  239. package/dist/assets/index-Dfmjh5-5.js +0 -124
  240. package/dist/assets/index-LeqLm9hN.js +0 -55
  241. package/dist/assets/index-RD-gFG7U.js +0 -113
  242. package/dist/assets/list-C-9EwvIL.js +0 -2
  243. package/dist/assets/list-CX2Q1hbc.js +0 -103
  244. package/dist/assets/localization-DQioZq4I.js +0 -1
  245. package/dist/assets/logger-DkBs7Soy.js +0 -1
  246. package/dist/assets/login-63olb_gZ.js +0 -1
  247. package/dist/assets/passport-BLmrTDdo.js +0 -1
  248. package/dist/assets/passport-item-CBB6usyJ.js +0 -1
  249. package/dist/assets/preferences-Da8NATLw.js +0 -1
  250. package/dist/assets/profile-embed-9LLnCulK.js +0 -1
  251. package/dist/assets/publish-resource-Chyv1Trw.js +0 -1
  252. package/dist/assets/runtime-iwxdTEke.js +0 -1
  253. package/dist/assets/sdk-D4xzRwM9.js +0 -1
  254. package/dist/assets/security-D4Sx6wQO.js +0 -22
  255. package/dist/assets/simple-select-Bg4XC1E_.js +0 -1
  256. package/dist/assets/status-LEG00uGL.js +0 -1
  257. package/dist/assets/team-DmYSbFMF.js +0 -146
  258. package/dist/assets/traffic-CzxoP9Vj.js +0 -1
  259. package/dist/assets/user-center-u6FpYGow.js +0 -126
  260. package/dist/assets/user-follower-CyGK-1so.js +0 -32
  261. package/dist/assets/user-sessions-4qrRIOb8.js +0 -1
  262. package/dist/assets/vendor-utils-OrZFrHBP.js +0 -213
  263. package/dist/assets/wrap-locale-qW2Nj5Kt.js +0 -1
@@ -0,0 +1,124 @@
1
+ import{j as e,y as ht,bc as ye,M as ne,ak as h,Q as G,W as p,J as ve,c1 as xt,I as D,aN as gt,T as E,aj as mt,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,ci as bt,bh as yt,U as Me,cR as vt,cS as wt,at as Z,cT as jt,a6 as Y,n as oe,D as Ct,cU as kt,ar as Ae,b1 as we,cV as St,aX as Pt,a$ as It,cW as Tt}from"./vendor-mui-core-CnXrAOs3.js";import{r as y,a as Rt,u as Mt,j as At}from"./vendor-react-Dvs43sk9.js";import{t as _e,Z as Et,a4 as zt,R as Ee,D as Lt,C as se,n as H,A as Wt}from"./vendor-utils-cJEl_UEd.js";import{a as Dt,F as Bt,bf as Ot,c as je,Y as $t,bg as Nt,av as qe,W as le,bc as Ut,bh as Ft,a8 as _t,a9 as qt,bi as Ht}from"./index-FASRIZyi.js";import{a as T,h as Gt,k as ce,g as Q,b as A,j as Kt}from"./vendor-hooks-CjESGRlR.js";import{l as He}from"./arrow-down.svg-D6V-7qfa.js";import{p as Ce,U as L,V as W,at as Yt,j as Ge,au as Vt,H as $,av as Zt,aw as Qt,ax as ze,e as Jt,n as Ke,c as ke,ay as Xt,az as P,D as er,C as tr,$ as rr,aA as nr,aB as or,o as Ye}from"./vendor-ux-DtnxszG_.js";import{N as sr}from"./list-DINgkvuD.js";import{d as ir}from"./search-4YYphs0l.js";import{B as Le}from"./bundle-avatar-DLTX9h1v.js";import{h as We,T as ar}from"./team-Bje0MaMX.js";import{b as lr,d as cr,a as dr,c as ur,e as pr,f as fr,h as hr,O as xr}from"./user-center-_0Nuo2NC.js";import{T as De,O as gr}from"./index-B-TqDd4N.js";import{c as mr}from"./passport-C1l7yRXa.js";import{N as Ve,U as Ze}from"./index-BXeml37I.js";import{u as de}from"./use-mobile-DCNBsOlH.js";import br from"./index-ClNZcPUD.js";import{U as yr,a as vr}from"./user-follower-rI_4OXB_.js";import{f as V}from"./index-DBs9Ljax.js";import{u as me}from"./index-DsXcQxrF.js";import wr from"./index-C2BTIEUf.js";import{o as jr}from"./vendor-arcblock-DVRwGBYP.js";import{c as Cr,b as ie,a as kr,S as Sr}from"./index-XxymBn5U.js";import"./index-KLDWx9Xh.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-SEBP2NIP.js";import"./util-LPNcvj77.js";import"./base32-ka8Vb9QP.js";import"./session-Chl38-LD.js";import"./isURL-2pkMgw7e.js";import"./use-app-logo-DhmCQsWv.js";import"./index-D1efASvL.js";import"./revoke.svg-CmffMlcP.js";import"./use-mobile-maRlSUwU.js";import"./actions-DqoNrBDK.js";import"./index-B-Z_6Rom.js";import"./form-text-input-BAs2p7bF.js";import"./required-BGaDOGrj.js";import"./form-wrapper-C8oo_Fdy.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-Bq0J1vuR.js";import"./permission-YVbPVhS_.js";import"./confirm-G3RZHlkC.js";import"./click-to-copy-C1mF6WNf.js";import"./invitations-C4hW9Ss3.js";import"./create-passport-svg-_Jak4aT3.js";import"./api-Btn0Tp3W.js";import"./table-tips-Crqym4Bn.js";import"./ua-parser-DP5omx3I.js";import"./sdk-Cl2zdl3A.js";import"./passport-item-Dysdq_0a.js";import"./did-address-CZak4Nzl.js";import"./index-CZin5K15.js";import"./vendor-mui-x-bJ5idfMH.js";import"./AdapterDayjs-_MgvkJfN.js";import"./delete-confirm-DfQxKTw0.js";import"./index-DRYJ0xIl.js";function Pr(){let t=new Map;function i({root:s,rootMargin:n,threshold:o}){let u=t.get(s);u||(u=new Map,t.set(s,u));let a=JSON.stringify({rootMargin:n,threshold:o}),d=u.get(a);if(!d){let r=new Map;d={observer:new IntersectionObserver(f=>{f.forEach(g=>{r.get(g.target)?.(g)})},{root:s,rootMargin:n,threshold:o}),entryCallbacks:r},u.set(a,d)}return{observe:(r,f)=>{d.entryCallbacks.set(r,f),d.observer.observe(r)},unobserve:r=>{d.entryCallbacks.delete(r),d.observer.unobserve(r)}}}return{getObserver:i}}var Ir="0px",Tr=[0],Rr=Pr();function Mr(t){let i=t?.rootMargin??Ir,s=t?.threshold??Tr,n=y.useRef(null),o=y.useRef(null),u=y.useRef(null),[a,d]=y.useState(),r=y.useCallback(()=>{let j=n.current;if(!j){d(void 0);return}let v=Rr.getObserver({root:o.current,rootMargin:i,threshold:s});v.observe(j,l=>{d(l)}),u.current=v},[i,s]),f=y.useCallback(()=>{let j=u.current,v=n.current;v&&j?.unobserve(v),u.current=null},[]),g=y.useCallback(j=>{f(),n.current=j,r()},[r,f]),x=y.useCallback(j=>{f(),o.current=j,r()},[r,f]);return[g,{entry:a,rootRef:x}]}var Ar=Mr;function Er(t){let[i,s]=Ar(t),n=!!s.entry?.isIntersecting,[o,u]=y.useState(n);return n&&!o&&u(!0),[i,{...s,isVisible:n,wasEverVisible:o}]}var zr=Er,Lr=100;function Wr({loading:t,hasNextPage:i,onLoadMore:s,rootMargin:n,disabled:o,delayInMs:u=Lr}){let a=y.useRef(s),[d,{rootRef:r,isVisible:f}]=zr({rootMargin:n});y.useEffect(()=>{a.current=s},[s]);let g=!o&&!t&&f&&i;return y.useEffect(()=>{if(g){let x=setTimeout(()=>{a.current()},u);return()=>{clearTimeout(x)}}},[g,u]),[d,{rootRef:r}]}var Dr=Wr;const ge={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:p.oneOf(["info","success","warning","error",""]).isRequired,size:p.number};function ae({severity:t,size:i=8}){return ge[t]?e.jsx(h,{component:"span",sx:{display:"inline-block",width:i,height:i,borderRadius:"50%",backgroundColor:ge[t]||ge.info}}):null}Qe.propTypes={theme:p.string,type:p.oneOf(["button","line","select"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function Qe({theme:t="dark",type:i="button",onSelectType:s,extra:n=void 0,currentTab:o="",loading:u=!1,...a}){const{t:d}=y.useContext(Ce),r=[{label:d("notification.allSeverity"),value:""},{label:d("notification.severityType.info"),value:"info"},{label:d("notification.severityType.success"),value:"success"},{label:d("notification.severityType.warning"),value:"warning"},{label:d("notification.severityType.error"),value:"error"}],f=m=>{(m!==o||!u)&&s(m)},g=y.useMemo(()=>{const m={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:i==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return i==="line"?Object.assign(m,{}):m},[i,t]),x=(m,C,I)=>e.jsx(G,{disabled:u,onClick:()=>f(m.value),className:`profile-button ${C?"active":""}`,...a,children:m.label},m.value||I),j=(m,C,I)=>e.jsx(G,{variant:"text",disabled:u,onClick:()=>f(m.value),className:`profile-line-button ${C?"active":""}`,...a,children:m.label},m.value||I),v=()=>r?.map((m,C)=>{const I=o===m?.value;return i==="line"?e.jsx(y.Fragment,{children:j(m,I,C)},m.value||C):e.jsx(y.Fragment,{children:x(m,I,C)},m.value||C)}),l=m=>{const{value:C}=m.target;f(C==="all"?"":C)};return i==="select"?e.jsx(ht,{sx:{maxWidth:300},children:e.jsx(ye,{value:o||"all",onChange:l,size:"small",label:"Severity",IconComponent:m=>e.jsx(He,{...m,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((m,C)=>e.jsx(ne,{value:m.value||"all",children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:m.value}),m.label]})},m.value||C))})}):e.jsxs(h,{className:"severity-tabs",sx:g,children:[e.jsx(h,{sx:{...i==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}Je.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function Je({loading:t,paging:i,onChange:s}){const{t:n}=y.useContext(Ce),o=ve(r=>r.breakpoints.down("md"));if(i.pageCount<=0||o)return null;const u=(r,f)=>{s({page:f+1})},a=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},d=i.page-1<=0?0:i.page-1;return e.jsx(h,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(xt,{component:"div",disabled:t,count:i.total,page:d,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:g})=>`${r}–${f} / ${g!==-1?g:`${n()}more than ${f}`}`,rowsPerPage:i.pageSize,onPageChange:u,onRowsPerPageChange:a})})}const Br=y.memo(Je),Or={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Be=6,Oe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},$r={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},$e=()=>({...$r,width:"calc(50% - 8px)"});Xe.propTypes={loading:p.bool,type:p.oneOf(["server","service"]),onFilterChange:p.func,blockletMap:p.object,filterType:p.oneOf(["component","entity"]),selectedId:p.array,severity:p.array,enableMarkAllAsRead:p.bool,unReadCount:p.number,onReadFilterChange:p.func,currentReadFilter:p.string};function Xe({onFilterChange:t=()=>{},loading:i=!1,type:s="service",blockletMap:n={},filterType:o="component",selectedId:u=[],severity:a=[],enableMarkAllAsRead:d=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:g="all"}){const{t:x}=y.useContext(Ce),[j,v]=y.useState(null),l=!!j,[m,C]=y.useState(u),[I,k]=y.useState(a),[b,R]=y.useState(!1),[M,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{C(u),k(a)},[u,a]);const U=[{label:x("notification.filterType.all"),value:"all"},{label:x("notification.filterType.unread"),value:"unread"}],J=c=>{(c!==g||!i)&&f(c)},K=[{label:x("notification.severityType.info"),value:"info"},{label:x("notification.severityType.success"),value:"success"},{label:x("notification.severityType.warning"),value:"warning"},{label:x("notification.severityType.error"),value:"error"}],X=c=>{v(c.currentTarget),_(""),R(!1)},pe=()=>{v(null)},ee=c=>{const w=m.includes(c)?m.filter(S=>S!==c):[...m,c];C(w),t({id:w,severity:I})},te=c=>{const w=I.includes(c)?I.filter(S=>S!==c):[...I,c];k(w),t({severity:w,id:m})},fe=c=>{_(c.target.value)},he=()=>{R(!b)},q=Rt.useMemo(()=>{if(!n.size)return[];const c=[];return o==="component"&&c.push({label:x("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const S=w.did||w.meta?.did,z=w.title||w.meta?.title||"",O=w.appPid||w.appDid;(o==="component"&&O!==S||o==="entity"&&O===S)&&c.push({label:z,id:S,blocklet:w,ancestors:w.ancestors})}),c},[n,o,x]);y.useEffect(()=>{if(M.trim()==="")N(q);else{const c=M.toLowerCase(),w=q.filter(S=>S.label.toLowerCase().includes(c));N(w)}},[M,q]);const xe=M.trim()!==""||b?B:B.slice(0,Be);return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:d?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[d&&e.jsx(h,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:i,onClick:()=>J(c.value),className:`profile-button ${g===c.value?"active":""}`,sx:{...s==="service"&&g===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:g===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&r>0&&` (${r})`]},c.value))}),e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(D,{size:"small",onClick:X,disabled:i,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(L,{icon:Or,hFlip:!0})}),e.jsx(gt,{open:l,anchorEl:j,onClose:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:x("notification.severity")}),e.jsx(h,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(m.length>0||I.length>0)&&e.jsx(G,{size:"small",onClick:()=>{C([]),k([]),t({severity:[],id:[]})},startIcon:e.jsx(mt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:x("notification.clear")})})]}),e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:$e(I.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Oe},control:e.jsx(Re,{checked:I.includes(c.value),onChange:()=>te(c.value),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(h,{sx:{mb:2},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:x("notification.from")}),e.jsx(h,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:M,onChange:fe,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(L,{icon:ir})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:$e(m.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Oe},control:e.jsx(Re,{checked:m.includes(c.id),onChange:()=>ee(c.id),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(Le,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(E,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&M.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:b?e.jsx(bt,{}):e.jsx(yt,{})})]})]})})]})]}),m.length>0||I.length>0?e.jsxs(h,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[I.map(c=>{const w=K.find(S=>S.value===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>te(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),m.map(c=>{const w=q.find(S=>S.id===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Le,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const Nr=Z(jt)`
2
+ position: fixed;
3
+ bottom: 20px;
4
+ right: 20px;
5
+ z-index: 1000;
6
+ @media (max-width: 600px) {
7
+ bottom: 16px;
8
+ right: 16px;
9
+ transform: scale(0.9);
10
+ }
11
+ `;function Ur(){const[t,i]=y.useState(!1);y.useEffect(()=>{const n=_e(()=>{i(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(vt,{in:t,children:e.jsx(Nr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(wt,{})})})}const Fr=Z.div`
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: ${t=>t.inDialog?0:"24px"};
15
+ .MuiContainer-root {
16
+ padding-right: 0;
17
+ }
18
+
19
+ .profile-button.MuiButtonBase-root {
20
+ border-radius: 9999px;
21
+ margin-right: 2px;
22
+ padding: 5px 12px;
23
+ line-height: 22px;
24
+ font-size: 13px;
25
+ border: 1px solid transparent;
26
+ background-color: ${({theme:t})=>t.palette.background.default};
27
+ color: ${({theme:t})=>t.palette.text.primary};
28
+ font-weight: 400;
29
+ border: 1px solid ${({theme:t})=>t.palette.divider} !important;
30
+ }
31
+ .profile-button.active.MuiButtonBase-root,
32
+ .profile-button.active.MuiButtonBase-root:hover {
33
+ color: ${({theme:t})=>t.palette.primary.main};
34
+ font-weight: 600;
35
+ background-color: ${({theme:t})=>oe(t.palette.primary.main,.1)};
36
+ border: 1px solid ${({theme:t})=>oe(t.palette.primary.main,.24)} !important;
37
+ }
38
+
39
+ .profile-button.MuiButtonBase-root:hover {
40
+ background-color: rgba(0, 0, 0, 0.04);
41
+ }
42
+
43
+ .profile-line-button.MuiButtonBase-root {
44
+ margin-right: 2px;
45
+ color: ${({theme:t})=>t.palette.text.secondary};
46
+ padding: 5px 12px;
47
+ line-height: 22px;
48
+ font-size: 13px;
49
+ border: none !important;
50
+ border-radius: 0;
51
+ }
52
+
53
+ .profile-line-button.active.MuiButtonBase-root {
54
+ color: ${({theme:t})=>t.palette.text.primary};
55
+ border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
56
+ }
57
+
58
+ .profile-button.MuiButtonBase-root:last-of-type,
59
+ .profile-line-button.MuiButtonBase-root {
60
+ margin-right: 0;
61
+ }
62
+
63
+ .profile-line-button.MuiButtonBase-root:hover {
64
+ color: ${({theme:t})=>t.palette.text.primary};
65
+ background-color: unset;
66
+ }
67
+
68
+ * {
69
+ scrollbar-width: none; /* Firefox */
70
+ -ms-overflow-style: none; /* IE and Edge */
71
+ }
72
+
73
+ *::-webkit-scrollbar {
74
+ display: none; /* Chrome, Safari and Opera */
75
+ }
76
+ `;et.propTypes={blocklets:p.array,context:p.object,pagination:p.bool,inDialog:p.bool,filterType:p.oneOf(["component","entity"]),toViewAll:p.func,type:p.oneOf(["server","service"])};function et({blocklets:t=[],context:i,pagination:s=!0,inDialog:n=!1,filterType:o="component",toViewAll:u=()=>{},type:a="service"}){const{data:d,paging:r,refresh:f,loading:g,params:x,onReadNotification:j,componentDids:v,filterUnReadCount:l,initial:m}=i,C=c=>{f({...x,severity:c&&typeof c=="string"?[c]:c||[],paging:{...x.paging,page:1}})},[I]=Mt(),k=T(()=>I.get("id"),[I]),b=ve(c=>c.breakpoints.down("md")),[R,M]=y.useState(0),[_,B]=y.useState(!1),N=y.useMemo(()=>x.read===!1?"unread":"all",[x.read]),U=T(()=>_e(c=>{if(g)return;const w=d.length,S=d.filter(O=>!We(O)).length;let z={...x,append:!0,paging:{...x.paging,...c,currentPage:(r.currentPage||0)+1}};N==="unread"&&S<w&&c.page>x.paging.page&&(z={...x,append:!0,paging:{...x.paging,...c,page:x.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(z)},500),[d,x,N,r,g,f]);Gt(()=>{m&&typeof m=="function"&&m()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&M(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const c=document.getElementById(k);c&&c.scrollIntoView({behavior:"smooth",block:"center"}),B(!0)},100),setTimeout(()=>{B(!1)},3e3)},[k]);const J=T(()=>d?.length>0&&d.length<R,[d,R]),K=y.useCallback(c=>{const{blocklet:w={}}=window,S=[w?.did,...(w?.ancestors||[]).map(z=>z)];return v?.includes(c)||S.findIndex(z=>z===c)>-1},[v]),X=y.useMemo(()=>{const c=new Map;return t.length&&t.forEach(w=>{const S=w?.did||w.meta?.did;S&&!c.has(S)&&(w.ancestors=[],c.set(S,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(z=>{c.has(z)||c.set(z,w)})),w?.children?.length>0&&w.children.forEach(z=>{const O=z?.did||z.meta?.did;O&&!c.has(O)&&K(O)&&(z.ancestors=[w],c.set(O,z))})}),c},[t,K]),pe=y.useCallback(()=>{g||U({page:r.page+1})},[r.page,g,U]),[ee]=Dr({loading:g,hasNextPage:J,onLoadMore:pe}),te=c=>{!c||We(c)||j(c.id).then(()=>{n&&u()})},fe=({severity:c,id:w})=>{if(g)return;let S={};o==="component"?S={entityId:[],componentDid:w}:o==="entity"&&(S={componentDid:[],entityId:w}),f({...x,severity:c,...S,paging:{...x.paging,page:1}})},he=c=>{if(g)return;let w={...x,paging:{...x.paging,page:1}};c==="unread"?(w.read=!1,w.paging.currentPage=1):w=Et(w,"read"),f(w)},q=T(()=>o==="component"?Array.isArray(x.componentDid)?x.componentDid:[]:o==="entity"?Array.isArray(x.entityId)?x.entityId:[]:[],[x,o]),xe=T(()=>(Array.isArray(x.severity)?x.severity:[])[0]||"",[x.severity]);return e.jsxs(Fr,{inDialog:!!n,children:[n?e.jsx(Qe,{currentTab:xe,type:"line",theme:"light",onSelectType:C}):e.jsx(Xe,{loading:g,blockletMap:X,unReadCount:l,filterType:o,type:a,selectedId:q,onFilterChange:fe,severity:x.severity,onReadFilterChange:he,currentReadFilter:N}),!b&&g?e.jsx(h,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):e.jsx(sr,{data:d,blockletMap:X,onReadNotification:te,onReadBatch:j,inDialog:n,highlightId:k,highlight:!n&&_,type:a}),s&&!b?e.jsx(Br,{loading:g,paging:r,onChange:U}):null,s&&b&&(g||J)?e.jsx(h,{ref:ee,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):null,!n&&b?e.jsx(Ur,{}):null]})}const _r=y.memo(et),F=new Ot;function ue(t){const{userDid:i=""}={},{session:s}=Dt(),n=T(()=>{if(i)return i;const r=window.location.href,f=zt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:s?.user?.did},[s?.user?.did,i]),o=T(()=>s.user,[s]),u=T(()=>o?n===o?.did:!1,[n,o?.did]),a=ce(async()=>{if(await Bt(()=>s?.initialized),u)return s.user;if(n)return F.user.getUserPublicInfo({did:n})},{refreshDeps:[n,u,s?.initialized,o]}),d=T(()=>o.passports?.some(r=>r.role===je.ROLES.OWNER),[o]);return{currentDid:n,session:s,isMyself:u,user:o,viewUser:a.data,isOwner:d}}function tt({user:t,...i}){const{t:s}=W(),n=Ct(),o=T(()=>{const d=(t?.passports||[]).map(r=>({...r,revoked:r.status===Yt.REVOKED}));return d.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),Ee(d.filter(r=>!r.display),"role").concat(Ee(d.filter(r=>r.display),"display.content"))},[t?.passports]),u=T(()=>o?.find(d=>d.name===t.role),[o,t?.role]),a=n.palette.primary.main;return o.length===0?e.jsx(h,{children:e.jsx(Ge,{children:s("userCenter.noPassport")})}):e.jsx(h,{...i,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...i.sx},children:o.map(d=>e.jsx(lr,{passport:d,user:t,color:window.blocklet.passportColor,createPassportSvg:mr,title:u&&u.role===d.role?s("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:u&&u.role===d.role?`0px 2px 4px 0px ${a}, 0px 1px 2px -1px ${a}, 0px 0px 0px 1px ${a} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},d.id))})}tt.propTypes={user:p.object.isRequired};function qr({visible:t,onClose:i,nft:s}){return!t||!s?null:e.jsx(Hr,{children:e.jsx(kt,{open:t,onClose:i,children:e.jsx(Gr,{onClick:i,children:e.jsx(Ve,{data:Ze(s),address:s.address,inset:!0})})})})}const Hr=Z.div`
77
+ position: relative;
78
+ width: 100%;
79
+ height: 100%;
80
+ cursor: pointer;
81
+
82
+ &:hover {
83
+ .mask {
84
+ opacity: 1;
85
+ }
86
+ }
87
+
88
+ .mask {
89
+ position: absolute;
90
+ top: 0;
91
+ left: 0;
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ width: 100%;
96
+ height: 100%;
97
+ background: rgba(0, 0, 0, 0.6);
98
+ opacity: 0;
99
+ transition: opacity 0.2s;
100
+ }
101
+ `,Gr=Z.div`
102
+ display: flex;
103
+ justify-content: center;
104
+ align-items: center;
105
+ height: 100vh;
106
+ width: 100vw;
107
+
108
+ img,
109
+ object {
110
+ max-width: 90vw;
111
+ max-height: 75vh;
112
+ }
113
+
114
+ .nft-display--inset {
115
+ > .MuiBox-root,
116
+ .nft-display__loading {
117
+ width: 75vmin;
118
+ height: 75vmin;
119
+ }
120
+ }
121
+ `,Kr=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:oe(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:oe(t.palette.background.paper,1)}}}),Yr={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ne="https://main.abtnetwork.io/explorer";function rt({user:t}){const{t:i}=W(),s=de(),[n,o]=y.useState({visible:!1,nft:null}),[u,a]=y.useState({anchorEl:null,props:null}),d=k=>{const b=se(Ne,"assets",k);window.open(b,"_blank")},r=(k,b)=>{let R="";typeof b.data?.value=="string"?R=JSON.parse(b.data?.value)?.domain:R=b.data?.value?.domain,a({anchorEl:k,props:{title:R?`Hey, I just won an NFT at the ${R} event!`:"Hey, I just won an NFT!",url:se(Ne,"assets",b.address)}})},f=k=>{o({visible:!0,nft:k})},g=Q({page:1,size:20}),x=ce(async(k=g)=>(await Lt.get(`${je.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...k}})).data,{ready:t?.did&&g,defaultParams:[g],refreshDeps:[t?.did,g]}),{loading:j,data:v}=x,l=v?.page??{cursor:0,next:!1,total:0},m=(k,b)=>{g.page=b,x.run(g)},C=A(k=>[e.jsx(D,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),d(k.address)},children:e.jsx(L,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),f(k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:eye",fontSize:18})},"view")]),I=T(()=>{if(j){const k=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Ae,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ae,{width:"20%"}),e.jsx(h,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:k})]})}return e.jsxs(e.Fragment,{children:[e.jsx(E,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:i("userCenter.common.nft")}),v?.assets?.length===0&&!j&&e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Ge,{children:i("userCenter.common.noNFT")})}),e.jsx(h,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(k=>e.jsxs(h,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(Ve,{data:Ze(k),address:k.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(h,{className:"footer-mask",sx:Yr,children:C(k)}):e.jsx(h,{className:"mask",sx:Kr,children:e.jsx(we,{direction:"row",spacing:1,children:C(k)})})]},k.address))}),l.next||g.page>1?e.jsx(St,{sx:{display:"flex",justifyContent:"center",mt:2},page:g.page,onChange:m,count:Math.ceil(l.total/g.size),size:"small"}):null,e.jsx(qr,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{o({visible:!1,nft:null})}}),e.jsx(Vt,{anchorEl:u.anchorEl,onClose:()=>{a({anchorEl:null,props:null})},sharedProps:u.props||{title:"",url:""}})]})},[j,l,g.page,g.size,m,u,n]);return e.jsx(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:I})}rt.propTypes={user:p.object.isRequired};function Vr(){const{t}=W(),{user:i,isMyself:s,viewUser:n}=ue();return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(tt,{user:i})]}):null,e.jsx(rt,{user:s?i:n})]})}const Zr=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function nt({user:t,onSave:i}){const{t:s,changeLocale:n}=W(),o=Q({locale:t.locale,loading:!1}),u=A(async a=>{try{const{value:d}=a.target;o.loading=!0,await F.user.saveProfile({locale:d}),await i("profile"),n(d),o.locale=d}catch(d){$.error(V(d))}finally{o.loading=!1}});return e.jsxs(h,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(h,{children:s("userCenter.commonSetting.locale")}),e.jsx(h,{children:e.jsx(ye,{value:o.locale,onChange:u,size:"small",IconComponent:a=>e.jsx(He,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||Zr).map(a=>e.jsx(ne,{value:a.code,children:a.name},a.code))})})]})}nt.propTypes={user:p.shape({locale:p.string}).isRequired,onSave:p.func.isRequired};function be({onTest:t=H,onDelete:i=H,onSave:s=H,onCancel:n=H,type:o="slack",url:u="",edit:a=!1}){const{t:d}=W(),r=Q({type:o||"slack",url:u||"",edit:a??!1,error:"",loading:!1}),f=A(()=>r.url?$t(r.url)?(r.error="",!0):(r.error=d("common.invalid"),!1):(r.error=d("common.required"),!1)),g=A(()=>{r.edit=!1,r.url=u||"",r.type=o||"slack",r.error="",r.loading=!1,n()}),x=A(async l=>{r.loading=!0,await t(l),r.loading=!1}),j=A(l=>()=>{f()&&l({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(E,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Y,{size:16}):e.jsx(D,{size:"small",onClick:j(x),sx:{mr:-1},children:e.jsx(L,{icon:cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(h,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(ye,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:l=>{r.type=l.target.value},children:[e.jsx(ne,{value:"api",children:d("userCenter.webhook.url")}),e.jsx(ne,{value:"slack",children:d("userCenter.webhook.slack")})]}),e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ue,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:l=>{r.url=l.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Fe,{position:"end",children:v})}}}),e.jsx(h,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(D,{color:"success",onClick:j((...l)=>{s(...l),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Zt})}),e.jsx(D,{color:"error",onClick:g,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Qt})})]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:dr})}),e.jsx(D,{color:"error",onClick:()=>{i({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:ur})})]})})]})]})}be.propTypes={onTest:p.func,onDelete:p.func,onSave:p.func,onCancel:p.func,type:p.oneOf(["api","slack"]),url:p.string,edit:p.bool};function re({title:t=void 0,description:i=void 0,value:s,onChange:n,isMobile:o}){const u=A(a=>{a.stopPropagation()});return e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(me,{checked:s,size:"small",onChange:n}),e.jsxs(E,{component:"div",onClick:u,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:o?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:o?"normal":"nowrap"},children:[t,i]})]})}re.propTypes={title:p.string,description:p.node,value:p.bool.isRequired,onChange:p.func.isRequired,isMobile:p.bool.isRequired};function ot({user:t,isMobile:i}){const{t:s}=W(),n=Q({showAdd:!1}),o=ce(async()=>await F.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),u=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...o?.data?.notifications||{}}),[o?.data?.notifications]),a=T(()=>o?.data?.webhooks||[],[o?.data?.webhooks]),d=A(async v=>{try{await F.user.saveUserNotificationConfig(v),$.success(s("userCenter.saveSuccess")),o.run()}catch(l){$.error(V(l))}}),r=A(async(v,l)=>{await d({notifications:{[v]:l}})}),f=async v=>{try{await F.user.testNotificationWebhook(v),$.success(s("userCenter.webhookTested"))}catch(l){$.error(V(l))}},g=A(async v=>{await d({webhooks:a.filter((l,m)=>m!==v)})}),x=A(async(v,l)=>{await d({webhooks:a.map((m,C)=>C===v?l:m)})}),j=A(async v=>{await d({webhooks:[...a,v]}),n.showAdd=!1});return o.error?e.jsx(Pt,{severity:"error",children:o.error.message}):o.loading||!o.data?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Y,{})}):e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(re,{value:u.wallet,isMobile:i,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:ze(t)&&e.jsx(Jt,{did:ze(t),showQrcode:!1,showAvatar:!i,copyable:!0,compact:!0,responsive:!0,startChars:i?2:6})}),e.jsx(re,{value:u.email,isMobile:i,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(E,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(re,{isMobile:i,value:u.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(we,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,l)=>e.jsx(be,{onTest:f,onDelete:()=>g(l),onSave:(...m)=>x(l,...m),type:v.type,url:v.url,edit:!1},`${l}_${v.url}`)),n.showAdd&&e.jsx(be,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>j(...v),edit:!0},"add"),e.jsx(Ke,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(L,{icon:pr}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ot.propTypes={user:p.object.isRequired,isMobile:p.bool.isRequired};function st({item:t}){const i=ke(),{blocklet:s}=Nt(),{confirmApi:n,confirmHolder:o}=qe(),u=Q({loading:!1}),{t:a}=W(),{session:d}=y.use(le),{bindOAuth:r,unbindOAuth:f,setBaseUrl:g,baseUrl:x}=d.useOAuth(),{disconnectPasskey:j,setTargetAppPid:v}=d.usePasskey(),l=T(()=>Xt[t?.provider]||"unknown",[t?.provider]),m=A(b=>b?._bind?b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===P.PASSKEY&&i.arcSphere?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&i.arcSphere?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),C=A(async()=>{if(t?.provider===P.PASSKEY){await new Promise((b,R)=>{n.open({title:a("userCenter.thirdPartyLogin.disconnectPasskey",{name:l}),content:a("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){j({session:d,connectedAccount:t}).then(b).catch(R),M()},onCancel:b})});return}try{u.loading=!0,await new Promise((b,R)=>{if(t?._bind)n.open({title:a("userCenter.thirdPartyLogin.confirmUnbind",{name:l}),content:a("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){f({session:d,connectedAccount:{...Wt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(R),M()},onCancel:b});else if(t.provider===P.WALLET)n.open({title:a("userCenter.thirdPartyLogin.confirmBindWallet",{name:l}),content:a("userCenter.thirdPartyLogin.confirmBindWalletDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"primary"},cancelButtonText:a("common.cancel"),onConfirm:M=>{d.bindWallet({onSuccess:b,onCancel:R}),M()},onCancel:b});else{const M=x,_=window?.blocklet;let B="/";const N=er(_),U=tr(_);N&&U?.appPid&&d?.user?.sourceAppPid&&(B=U.appUrl),g(B),v(s?.appPid),r({session:d,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(R).finally(()=>{g(M),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{u.loading=!1}}),I=A(b=>b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):b?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),k=A(b=>b.provider===P.WALLET&&b.did||b.provider===P.PASSKEY&&(i.arcSphere||i.wallet)?!0:!!t._mainProvider,[i.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(Ut,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(h,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:l}),t.userInfo?.email||t.did?e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(h,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(De,{title:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rr,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(h,{children:[e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(h,{component:L,icon:Ft,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(De,{title:m(t),placement:"auto",children:e.jsx(h,{children:e.jsx(Ke,{variant:"outlined",size:"small",sx:b=>{const R=b.palette.error.main,M=b.palette.primary.main;return{color:t?._bind?R:M,borderColor:t?._bind?R:M,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?R:M,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:u.loading?null:e.jsx(L,{icon:fr}),onClick:C,disabled:k(t),loading:u.loading,children:I(t)})})}),o]})}st.propTypes={item:p.shape({provider:p.string,did:p.string,pk:p.string,userInfo:p.object,id:p.string,_bind:p.bool,_rawProvider:p.string,_mainProvider:p.bool}).isRequired};function it({user:t}){const{session:i}=y.use(le),[s,n]=y.useState({}),{getOAuthConfigs:o}=i.useOAuth(),u=ke();Kt(async()=>{const r=await o({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const a=T(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:P.WALLET,order:-1},...r,{provider:P.PASSKEY,order:1/0}]},[s]),d=T(()=>{const r=nr(t);let f=!1,g="",x=or(t);const j=r.find(l=>l.provider===P.AUTH0);return j&&(j.id.startsWith("google-oauth2|")&&(r.some(l=>l.provider==="google")||(f=!0,g=P.GOOGLE,x===P.AUTH0&&(x=P.GOOGLE))),j.id.startsWith("appleid|")&&(r.some(l=>l.provider===P.APPLE)||(f=!0,g=P.APPLE,x===P.AUTH0&&(x=P.APPLE))),j.id.startsWith("github|")&&(r.some(l=>l.provider===P.GITHUB)||(f=!0,g=P.GITHUB,x===P.AUTH0&&(x=P.GITHUB)))),a.map(l=>{if(l.provider===P.AUTH0&&f)return null;const m=f&&l.provider===g?r.find(C=>C.provider===P.AUTH0):r.find(C=>C.provider===l.provider);return m?{...l,provider:l.provider,did:m.did,pk:m.pk,userInfo:m.userInfo,_bind:!0,_rawProvider:m.provider,_mainProvider:l.provider===x}:{...l,provider:l.provider,_rawProvider:l.provider,_mainProvider:l.provider===x}}).filter(l=>!(!l||l.provider===P.PASSKEY&&!l.did)).sort((l,m)=>l._mainProvider?-1:l?.order!==void 0&&m?.order!==void 0?l.order-m.order:l?.order!==void 0?-1:1)},[t?.connectedAccounts,a]);return e.jsxs(h,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[d.map(r=>e.jsx(st,{item:r},r?.provider)),u.wallet||u.arcSphere?null:e.jsx(_t,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:H,onError:H,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}it.propTypes={user:p.object.isRequired};function at({configList:t,onSave:i}){const[s,n]=y.useState(t),{t:o}=W(),u=A(async(a,d)=>{try{const r=await F.user.saveUserPrivacyConfig({[a]:typeof d=="string"?d:!d});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),$.success(o("userCenter.saveSuccess")),i("privacy")}catch(r){$.error(V(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(a=>{if(a.isPrivate)return null;const d=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(h,{children:[e.jsx(me,{checked:d,labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("userCenter.toPublic",{name:a.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;a.followersOnly?u(a.key,f?"all":"private"):u(a.key,f)}},a.key),a.followersOnly&&d&&e.jsx(h,{sx:{pl:3,pt:1},children:e.jsx(me,{checked:a.value==="follower-only",labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;u(a.key,f?"follower-only":"all")}})})]})})})}at.propTypes={configList:p.arrayOf(p.shape({key:p.string.isRequired,name:p.string.isRequired,value:p.bool.isRequired,isPrivate:p.bool})).isRequired,onSave:p.func.isRequired};function lt({onDestroySelf:t=void 0}){const{confirmHolder:i}=qe(),{t:s}=W(),{session:n}=y.use(le),o=A(async()=>{if(!t||typeof t!="function")return;const u=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await u(),n.logout()}catch(a){$.error(a?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(h,{children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(h,{children:[e.jsx(E,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(E,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(G,{variant:"contained",color:"error",size:"small",onClick:o,children:s("userCenter.dangerZone.delete")})]})}),i]})}lt.propTypes={onDestroySelf:p.func};function Qr(){const t=de({key:"md"}),i=ve(o=>o.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>Ye({},t?s:{}),[t]);return e.jsx(h,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":i?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:o=>`${o.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(wr,{isSelf:!0,columnSx:n})})}function ct({onDestroySelf:t=void 0,userCenterTabs:i=[]}){const{t:s}=W(),{user:n,session:o,isMyself:u,isOwner:a}=ue(),r=ke().arcSphere,f=de({key:"md"}),g=ce(async()=>n&&u?await F.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,u],loadingDelay:300}),x=T(()=>i.map(l=>({key:l.value,name:l.label,value:l.protected,isPrivate:l.isPrivate,followersOnly:l.followersOnly})),[i]),j=A(async l=>l==="privacy"?(await g.runAsync(),g.data):(l==="profile"&&await o.refresh(),null));y.useEffect(()=>{const l=window.location.hash.slice(1);l&&document.getElementById(l)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(nt,{user:n,onSave:j})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ot,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(it,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(Qr,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(br,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(at,{configList:x,onSave:j})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yr,{user:n,showUser:!1,getUserSessions:l=>F.userSession.getMyLoginSessions({},l)})},!a&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(lt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,x,f,a,t]);return u?e.jsx(h,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(l=>l?e.jsxs(h,{id:l.value,sx:Ye({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},l.sx),children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600},children:l.label}),e.jsx(h,{sx:{mt:2.5},children:l.content})]},l.value):null)}):null}ct.propTypes={onDestroySelf:p.func,userCenterTabs:p.array};const dt=y.createContext({}),{Provider:Jr,Consumer:ho}=dt;function ut({children:t}){const[i]=y.useState(!1),{session:s}=y.use(le),{user:n}=s,[o,u]=y.useState(),a=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{u(n?.didSpace)},[n?.didSpace]);const d=async()=>{u(void 0)},r=x=>{},f=async x=>{u(x),await r(x.endpoint)},g=!!(a&&o);return e.jsx(Jr,{value:{loading:i,spaceGateway:o,session:s,deleteSpaceGateway:d,updateSpaceGateway:f,storageEndpoint:a,settingStorageEndpoint:r,hasStorageEndpoint:g},children:t})}function Se(){return y.use(dt)}ut.propTypes={children:p.node.isRequired};function Xr(t){const i=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return se(i,"space",n)}function pt({session:t,spaceGateway:i,spaceStatus:s,refresh:n}){return e.jsxs(we,{direction:"row",spacing:1,children:[s===Cr.DISCONNECTED&&e.jsx(ie,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:o=>{console.error(o),$.error(V(o))}}),e.jsx(D,{size:"small",LinkComponent:It,href:Xr(i.endpoint),target:"_blank",children:e.jsx(Tt,{})})]})}pt.propTypes={session:p.object.isRequired,spaceGateway:p.object.isRequired,spaceStatus:p.string.isRequired,refresh:p.func.isRequired};function ft({spaceGateway:t=void 0}){const{t:i}=W(),{updateSpaceGateway:s,session:n}=Se(),o=de(),u=({spaceGateway:a})=>s(a);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:i("userCenter.storage.spaces.connected.title")}),!o&&e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})]}),e.jsx(h,{children:t&&e.jsx(kr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:a=>e.jsx(pt,{session:n,...a})},t.endpoint)}),o&&e.jsx(h,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})})]})}ft.propTypes={spaceGateway:p.object};function en(){const{t}=W(),{updateSpaceGateway:i,session:s}=Se(),n=({spaceGateway:o})=>i(o);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Sr,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(h,{children:e.jsx(ie,{session:s,onSuccess:n})})]})}function tn(){const{spaceGateway:t,hasStorageEndpoint:i,loading:s}=Se(),{isMyself:n}=ue();return n?s?e.jsx(jr,{relative:"parent",children:e.jsx(Y,{})}):e.jsx(nn,{children:e.jsx(h,{sx:{maxWidth:"720px"},children:i?e.jsx(ft,{spaceGateway:t}):e.jsx(en,{})})}):null}function rn(){return e.jsx(ut,{children:e.jsx(tn,{})})}const nn=Z(h)`
122
+ height: 100%;
123
+ overflow-y: auto;
124
+ `;function on(){const{user:t,isMyself:i,viewUser:s}=ue(),{followed:n}=hr();return e.jsx(h,{children:e.jsx(vr,{teamDid:window?.blocklet?.did||"",user:i?t:s,showInvitees:i,followed:n})})}function sn({tab:t=""}){const{api:i}=qt(),s=y.useRef(null),n=At(),o=t||n.tab,a=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),d=Ht(),r=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(g=>({...g,meta:{...g,did:g.did,name:g.name||g.title||"",logo:"logo.png"}}))})),f=async g=>{const{input:x,sessionId:j}=g;try{await i.destroySelf({input:{...x,sessionId:j}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(ar,{mode:"user-center",children:e.jsxs(xr,{ref:s,embed:a==="1",currentTab:o?se(je.WELLKNOWN_SERVICE_PATH_PREFIX,"user",o):"",disableAutoRedirect:o==="settings",children:[o==="notifications"?e.jsx(_r,{blocklets:[r],context:d}):null,o==="nfts"?e.jsx(Vr,{}):null,o==="settings"?e.jsx(ct,{onDestroySelf:f}):null,o==="did-spaces"?e.jsx(rn,{}):null,o==="user-followers"?e.jsx(on,{}):null,o==="orgs"?e.jsx(gr,{id:n.id||""}):null]})})}sn.propTypes={tab:p.string};export{sn as default};
@@ -1 +1 @@
1
- import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BFPsXaTR.js";import{V as f}from"./vendor-ux-CE4sOH7O.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-3yzleS_1.js";import"./vendor-utils-OrZFrHBP.js";import"./vendor-hooks-DmThWyyG.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DGOH9a3F.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j=""+window.__toCdnUrl("assets/doc-board-bg-DWZHV9Ng.png");function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function I(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{I as default};
1
+ import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-CnXrAOs3.js";import{V as f}from"./vendor-ux-DtnxszG_.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-FASRIZyi.js";import"./vendor-utils-cJEl_UEd.js";import"./vendor-hooks-CjESGRlR.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DVRwGBYP.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j=""+window.__toCdnUrl("assets/doc-board-bg-DWZHV9Ng.png");function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function I(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{I as default};
@@ -1,4 +1,4 @@
1
- import{B as qr}from"./vendor-utils-OrZFrHBP.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{am as Se,an as jr,ao as xr,ap as Nr,aq as _r,ar as Kr,as as Sr,at as Tr,au as ke,av as Ur,f as Br,aw as Dr,ax as Mr,r as Lr}from"./vendor-ux-CE4sOH7O.js";import{bi as Or,be as Cr,az as Vr}from"./index-3yzleS_1.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
1
+ import{B as qr}from"./vendor-utils-cJEl_UEd.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ag as Se,ah as jr,ai as xr,aj as Nr,ak as _r,al as Kr,am as Sr,an as Tr,ao as ke,ap as Ur,aq as Br,ar as Dr,as as Mr,a6 as Lr,r as Cr}from"./vendor-ux-DtnxszG_.js";import{be as Or,aB as Vr}from"./index-FASRIZyi.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
2
2
  `),I=oe(m).split(`
3
3
  `),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
4
4
 
@@ -59,4 +59,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
59
59
  `))}throw R}};function x(a,i,c,R,w){if(!O(i))throw new E("regexp","RegExp",i);var I=w==="match";if(typeof a!="string"||u(i,a)!==I){if(c instanceof Error)throw c;var D=!c;c=c||(typeof a!="string"?'The "string" argument must be of type string. Received type '+"".concat(h(a)," (").concat(y(a),")"):(I?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(y(i),`. Input:
60
60
 
61
61
  `).concat(y(a),`
62
- `));var z=new r({actual:a,expected:i,message:c,operator:w,stackStartFn:R});throw z.generatedMessage=D,z}}K.match=function a(i,c,R){x(i,c,R,a,"match")},K.doesNotMatch=function a(i,c,R){x(i,c,R,a,"doesNotMatch")};function C(){for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];te.apply(void 0,[C,i.length].concat(i))}return K.strict=A(C,K,{equal:K.strictEqual,deepEqual:K.deepStrictEqual,notEqual:K.notStrictEqual,notDeepEqual:K.notDeepStrictEqual}),K.strict.strict=K.strict,Pe.exports}var Ce,hr;function kr(){if(hr)return Ce;hr=1;var h=ke().Buffer;function g(s){if(s.length>=255)throw new TypeError("Alphabet too long");for(var b=new Uint8Array(256),_=0;_<b.length;_++)b[_]=255;for(var L=0;L<s.length;L++){var E=s.charAt(L),f=E.charCodeAt(0);if(b[f]!==255)throw new TypeError(E+" is ambiguous");b[f]=L}var n=s.length,e=s.charAt(0),r=Math.log(n)/Math.log(256),d=Math.log(256)/Math.log(n);function y(O){if((Array.isArray(O)||O instanceof Uint8Array)&&(O=h.from(O)),!h.isBuffer(O))throw new TypeError("Expected Buffer");if(O.length===0)return"";for(var A=0,j=0,u=0,p=O.length;u!==p&&O[u]===0;)u++,A++;for(var S=(p-u)*d+1>>>0,N=new Uint8Array(S);u!==p;){for(var B=O[u],K=0,H=S-1;(B!==0||K<j)&&H!==-1;H--,K++)B+=256*N[H]>>>0,N[H]=B%n>>>0,B=B/n>>>0;if(B!==0)throw new Error("Non-zero carry");j=K,u++}for(var V=S-j;V!==S&&N[V]===0;)V++;for(var W=e.repeat(A);V<S;++V)W+=s.charAt(N[V]);return W}function l(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return h.alloc(0);for(var A=0,j=0,u=0;O[A]===e;)j++,A++;for(var p=(O.length-A)*r+1>>>0,S=new Uint8Array(p);A<O.length;){var N=b[O.charCodeAt(A)];if(N===255)return;for(var B=0,K=p-1;(N!==0||B<u)&&K!==-1;K--,B++)N+=n*S[K]>>>0,S[K]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");u=B,A++}for(var H=p-u;H!==p&&S[H]===0;)H++;var V=h.allocUnsafe(j+(p-H));V.fill(0,0,j);for(var W=j;H!==p;)V[W++]=S[H++];return V}function q(O){var A=l(O);if(A)return A;throw new Error("Non-base"+n+" character")}return{encode:y,decodeUnsafe:l,decode:q}}return Ce=g,Ce}var Ve,dr;function Xr(){if(dr)return Ve;dr=1;var h=kr(),g="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return Ve=h(g),Ve}var Fe,yr;function Jr(){if(yr)return Fe;yr=1;var h=Xr(),g=ke().Buffer;return Fe=function(s){function b(f){var n=s(f);return h.encode(g.concat([f,n],f.length+4))}function _(f){var n=f.slice(0,-4),e=f.slice(-4),r=s(n);if(!(e[0]^r[0]|e[1]^r[1]|e[2]^r[2]|e[3]^r[3]))return n}function L(f){var n=h.decodeUnsafe(f);if(n)return _(n)}function E(f){var n=h.decode(f),e=_(n);if(!e)throw new Error("Invalid checksum");return e}return{encode:b,decode:E,decodeUnsafe:L}},Fe}var $e,br;function Qr(){if(br)return $e;br=1;var h=Ur(),g=Jr();function s(b){var _=h("sha256").update(b).digest();return h("sha256").update(_).digest()}return $e=g(s),$e}var Ge,gr;function et(){if(gr)return Ge;gr=1;const h={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function g(E,f){if(!E)throw new Error(f)}function s(E,f,n){if(g(f instanceof Uint8Array,`Expected ${E} to be an Uint8Array`),n!==void 0)if(Array.isArray(n)){const e=n.join(", "),r=`Expected ${E} to be an Uint8Array with length [${e}]`;g(n.includes(f.length),r)}else{const e=`Expected ${E} to be an Uint8Array with length ${n}`;g(f.length===n,e)}}function b(E){g(L(E)==="Boolean","Expected compressed to be a Boolean")}function _(E=n=>new Uint8Array(n),f){return typeof E=="function"&&(E=E(f)),s("output",E,f),E}function L(E){return Object.prototype.toString.call(E).slice(8,-1)}return Ge=E=>({contextRandomize(f){switch(g(f===null||f instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),f!==null&&s("seed",f,32),E.contextRandomize(f)){case 1:throw new Error(h.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(f){return s("private key",f,32),E.privateKeyVerify(f)===0},privateKeyNegate(f){switch(s("private key",f,32),E.privateKeyNegate(f)){case 0:return f;case 1:throw new Error(h.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(f,n){switch(s("private key",f,32),s("tweak",n,32),E.privateKeyTweakAdd(f,n)){case 0:return f;case 1:throw new Error(h.TWEAK_ADD)}},privateKeyTweakMul(f,n){switch(s("private key",f,32),s("tweak",n,32),E.privateKeyTweakMul(f,n)){case 0:return f;case 1:throw new Error(h.TWEAK_MUL)}},publicKeyVerify(f){return s("public key",f,[33,65]),E.publicKeyVerify(f)===0},publicKeyCreate(f,n=!0,e){switch(s("private key",f,32),b(n),e=_(e,n?33:65),E.publicKeyCreate(e,f)){case 0:return e;case 1:throw new Error(h.SECKEY_INVALID);case 2:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyConvert(f,n=!0,e){switch(s("public key",f,[33,65]),b(n),e=_(e,n?33:65),E.publicKeyConvert(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyNegate(f,n=!0,e){switch(s("public key",f,[33,65]),b(n),e=_(e,n?33:65),E.publicKeyNegate(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE);case 3:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyCombine(f,n=!0,e){g(Array.isArray(f),"Expected public keys to be an Array"),g(f.length>0,"Expected public keys array will have more than zero items");for(const r of f)s("public key",r,[33,65]);switch(b(n),e=_(e,n?33:65),E.publicKeyCombine(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.PUBKEY_COMBINE);case 3:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(f,n,e=!0,r){switch(s("public key",f,[33,65]),s("tweak",n,32),b(e),r=_(r,e?33:65),E.publicKeyTweakAdd(r,f,n)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.TWEAK_ADD)}},publicKeyTweakMul(f,n,e=!0,r){switch(s("public key",f,[33,65]),s("tweak",n,32),b(e),r=_(r,e?33:65),E.publicKeyTweakMul(r,f,n)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.TWEAK_MUL)}},signatureNormalize(f){switch(s("signature",f,64),E.signatureNormalize(f)){case 0:return f;case 1:throw new Error(h.SIG_PARSE)}},signatureExport(f,n){s("signature",f,64),n=_(n,72);const e={output:n,outputlen:72};switch(E.signatureExport(e,f)){case 0:return n.slice(0,e.outputlen);case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},signatureImport(f,n){switch(s("signature",f),n=_(n,64),E.signatureImport(n,f)){case 0:return n;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},ecdsaSign(f,n,e={},r){s("message",f,32),s("private key",n,32),g(L(e)==="Object","Expected options to be an Object"),e.data!==void 0&&s("options.data",e.data),e.noncefn!==void 0&&g(L(e.noncefn)==="Function","Expected options.noncefn to be a Function"),r=_(r,64);const d={signature:r,recid:null};switch(E.ecdsaSign(d,f,n,e.data,e.noncefn)){case 0:return d;case 1:throw new Error(h.SIGN);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},ecdsaVerify(f,n,e){switch(s("signature",f,64),s("message",n,32),s("public key",e,[33,65]),E.ecdsaVerify(f,n,e)){case 0:return!0;case 3:return!1;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.PUBKEY_PARSE)}},ecdsaRecover(f,n,e,r=!0,d){switch(s("signature",f,64),g(L(n)==="Number"&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),s("message",e,32),b(r),d=_(d,r?33:65),E.ecdsaRecover(d,f,n,e)){case 0:return d;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.RECOVER);case 3:throw new Error(h.IMPOSSIBLE_CASE)}},ecdh(f,n,e={},r){switch(s("public key",f,[33,65]),s("private key",n,32),g(L(e)==="Object","Expected options to be an Object"),e.data!==void 0&&s("options.data",e.data),e.hashfn!==void 0?(g(L(e.hashfn)==="Function","Expected options.hashfn to be a Function"),e.xbuf!==void 0&&s("options.xbuf",e.xbuf,32),e.ybuf!==void 0&&s("options.ybuf",e.ybuf,32),s("output",r)):r=_(r,32),E.ecdh(r,f,n,e.data,e.hashfn,e.xbuf,e.ybuf)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.ECDH)}}}),Ge}var ze,vr;function rt(){if(vr)return ze;vr=1;const h=Br().ec,g=new h("secp256k1"),s=g.curve,b=s.n.constructor;function _(n,e){let r=new b(e);if(r.cmp(s.p)>=0)return null;r=r.toRed(s.red);let d=r.redSqr().redIMul(r).redIAdd(s.b).redSqrt();return n===3!==d.isOdd()&&(d=d.redNeg()),g.keyPair({pub:{x:r,y:d}})}function L(n,e,r){let d=new b(e),y=new b(r);if(d.cmp(s.p)>=0||y.cmp(s.p)>=0||(d=d.toRed(s.red),y=y.toRed(s.red),(n===6||n===7)&&y.isOdd()!==(n===7)))return null;const l=d.redSqr().redIMul(d);return y.redSqr().redISub(l.redIAdd(s.b)).isZero()?g.keyPair({pub:{x:d,y}}):null}function E(n){const e=n[0];switch(e){case 2:case 3:return n.length!==33?null:_(e,n.subarray(1,33));case 4:case 6:case 7:return n.length!==65?null:L(e,n.subarray(1,33),n.subarray(33,65));default:return null}}function f(n,e){const r=e.encode(null,n.length===33);for(let d=0;d<n.length;++d)n[d]=r[d]}return ze={contextRandomize(){return 0},privateKeyVerify(n){const e=new b(n);return e.cmp(s.n)<0&&!e.isZero()?0:1},privateKeyNegate(n){const e=new b(n),r=s.n.sub(e).umod(s.n).toArrayLike(Uint8Array,"be",32);return n.set(r),0},privateKeyTweakAdd(n,e){const r=new b(e);if(r.cmp(s.n)>=0||(r.iadd(new b(n)),r.cmp(s.n)>=0&&r.isub(s.n),r.isZero()))return 1;const d=r.toArrayLike(Uint8Array,"be",32);return n.set(d),0},privateKeyTweakMul(n,e){let r=new b(e);if(r.cmp(s.n)>=0||r.isZero())return 1;r.imul(new b(n)),r.cmp(s.n)>=0&&(r=r.umod(s.n));const d=r.toArrayLike(Uint8Array,"be",32);return n.set(d),0},publicKeyVerify(n){return E(n)===null?1:0},publicKeyCreate(n,e){const r=new b(e);if(r.cmp(s.n)>=0||r.isZero())return 1;const d=g.keyFromPrivate(e).getPublic();return f(n,d),0},publicKeyConvert(n,e){const r=E(e);if(r===null)return 1;const d=r.getPublic();return f(n,d),0},publicKeyNegate(n,e){const r=E(e);if(r===null)return 1;const d=r.getPublic();return d.y=d.y.redNeg(),f(n,d),0},publicKeyCombine(n,e){const r=new Array(e.length);for(let y=0;y<e.length;++y)if(r[y]=E(e[y]),r[y]===null)return 1;let d=r[0].getPublic();for(let y=1;y<r.length;++y)d=d.add(r[y].pub);return d.isInfinity()?2:(f(n,d),0)},publicKeyTweakAdd(n,e,r){const d=E(e);if(d===null)return 1;if(r=new b(r),r.cmp(s.n)>=0)return 2;const y=d.getPublic().add(s.g.mul(r));return y.isInfinity()?2:(f(n,y),0)},publicKeyTweakMul(n,e,r){const d=E(e);if(d===null)return 1;if(r=new b(r),r.cmp(s.n)>=0||r.isZero())return 2;const y=d.getPublic().mul(r);return f(n,y),0},signatureNormalize(n){const e=new b(n.subarray(0,32)),r=new b(n.subarray(32,64));return e.cmp(s.n)>=0||r.cmp(s.n)>=0?1:(r.cmp(g.nh)===1&&n.set(s.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(n,e){const r=e.subarray(0,32),d=e.subarray(32,64);if(new b(r).cmp(s.n)>=0||new b(d).cmp(s.n)>=0)return 1;const{output:y}=n;let l=y.subarray(4,37);l[0]=0,l.set(r,1);let q=33,O=0;for(;q>1&&l[O]===0&&!(l[O+1]&128);--q,++O);if(l=l.subarray(O),l[0]&128||q>1&&l[0]===0&&!(l[1]&128))return 1;let A=y.subarray(39,72);A[0]=0,A.set(d,1);let j=33,u=0;for(;j>1&&A[u]===0&&!(A[u+1]&128);--j,++u);return A=A.subarray(u),A[0]&128||j>1&&A[0]===0&&!(A[1]&128)?1:(n.outputlen=6+q+j,y[0]=48,y[1]=n.outputlen-2,y[2]=2,y[3]=l.length,y.set(l,4),y[4+q]=2,y[5+q]=A.length,y.set(A,6+q),0)},signatureImport(n,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;const r=e[3];if(r===0||5+r>=e.length||e[4+r]!==2)return 1;const d=e[5+r];if(d===0||6+r+d!==e.length||e[4]&128||r>1&&e[4]===0&&!(e[5]&128)||e[r+6]&128||d>1&&e[r+6]===0&&!(e[r+7]&128))return 1;let y=e.subarray(4,4+r);if(y.length===33&&y[0]===0&&(y=y.subarray(1)),y.length>32)return 1;let l=e.subarray(6+r);if(l.length===33&&l[0]===0&&(l=l.slice(1)),l.length>32)throw new Error("S length is too long");let q=new b(y);q.cmp(s.n)>=0&&(q=new b(0));let O=new b(e.subarray(6+r));return O.cmp(s.n)>=0&&(O=new b(0)),n.set(q.toArrayLike(Uint8Array,"be",32),0),n.set(O.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(n,e,r,d,y){if(y){const O=y;y=A=>{const j=O(e,r,null,d,A);if(!(j instanceof Uint8Array&&j.length===32))throw new Error("This is the way");return new b(j)}}const l=new b(r);if(l.cmp(s.n)>=0||l.isZero())return 1;let q;try{q=g.sign(e,r,{canonical:!0,k:y,pers:d})}catch{return 1}return n.signature.set(q.r.toArrayLike(Uint8Array,"be",32),0),n.signature.set(q.s.toArrayLike(Uint8Array,"be",32),32),n.recid=q.recoveryParam,0},ecdsaVerify(n,e,r){const d={r:n.subarray(0,32),s:n.subarray(32,64)},y=new b(d.r),l=new b(d.s);if(y.cmp(s.n)>=0||l.cmp(s.n)>=0)return 1;if(l.cmp(g.nh)===1||y.isZero()||l.isZero())return 3;const q=E(r);if(q===null)return 2;const O=q.getPublic();return g.verify(e,d,O)?0:3},ecdsaRecover(n,e,r,d){const y={r:e.slice(0,32),s:e.slice(32,64)},l=new b(y.r),q=new b(y.s);if(l.cmp(s.n)>=0||q.cmp(s.n)>=0)return 1;if(l.isZero()||q.isZero())return 2;let O;try{O=g.recoverPubKey(d,y,r)}catch{return 2}return f(n,O),0},ecdh(n,e,r,d,y,l,q){const O=E(e);if(O===null)return 1;const A=new b(r);if(A.cmp(s.n)>=0||A.isZero())return 2;const j=O.getPublic().mul(A);if(y===void 0){const u=j.encode(null,!0),p=g.hash().update(u).digest();for(let S=0;S<32;++S)n[S]=p[S]}else{l||(l=new Uint8Array(32));const u=j.getX().toArray("be",32);for(let B=0;B<32;++B)l[B]=u[B];q||(q=new Uint8Array(32));const p=j.getY().toArray("be",32);for(let B=0;B<32;++B)q[B]=p[B];const S=y(l,q,d);if(!(S instanceof Uint8Array&&S.length===n.length))return 2;n.set(S)}return 0}},ze}var Ye,Er;function tt(){return Er||(Er=1,Ye=et()(rt())),Ye}var He,mr;function nt(){if(mr)return He;mr=1;var h=We(),g=ke().Buffer,s=Dr(),b=Mr(),_=Qr(),L=tt(),E=g.from("Bitcoin seed","utf8"),f=2147483648,n=78,e={private:76066276,public:76067358};function r(l){this.versions=l||e,this.depth=0,this.index=0,this._privateKey=null,this._publicKey=null,this.chainCode=null,this._fingerprint=0,this.parentFingerprint=0}Object.defineProperty(r.prototype,"fingerprint",{get:function(){return this._fingerprint}}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this._identifier}}),Object.defineProperty(r.prototype,"pubKeyHash",{get:function(){return this.identifier}}),Object.defineProperty(r.prototype,"privateKey",{get:function(){return this._privateKey},set:function(l){l=Uint8Array.from(l),h.equal(l.length,32,"Private key must be 32 bytes."),h(L.privateKeyVerify(l)===!0,"Invalid private key"),this._privateKey=g.from(l),this._publicKey=g.from(L.publicKeyCreate(l,!0)),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0)}}),Object.defineProperty(r.prototype,"publicKey",{get:function(){return this._publicKey},set:function(l){h(l.length===33||l.length===65,"Public key must be 33 or 65 bytes."),h(L.publicKeyVerify(l)===!0,"Invalid public key"),this._publicKey=g.from(L.publicKeyConvert(l,!0)),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0),this._privateKey=null}}),Object.defineProperty(r.prototype,"privateExtendedKey",{get:function(){return this._privateKey?_.encode(d(this,this.versions.private,g.concat([g.alloc(1,0),this.privateKey]))):null}}),Object.defineProperty(r.prototype,"publicExtendedKey",{get:function(){return _.encode(d(this,this.versions.public,this.publicKey))}}),r.prototype.derive=function(l){if(l==="m"||l==="M"||l==="m'"||l==="M'")return this;var q=l.split("/"),O=this;return q.forEach(function(A,j){if(j===0){h(/^[mM]{1}/.test(A),'Path must start with "m" or "M"');return}var u=A.length>1&&A[A.length-1]==="'",p=parseInt(A,10);h(p<f,"Invalid index"),u&&(p+=f),O=O.deriveChild(p)}),O},r.prototype.deriveChild=function(l){var q=l>=f,O=g.allocUnsafe(4);O.writeUInt32BE(l,0);var A;if(q){h(this.privateKey,"Could not derive hardened child key");var j=g.from(this.privateKey),u=g.alloc(1,0);j=g.concat([u,j]),A=g.concat([j,O])}else A=g.concat([this.publicKey,O]);var p=s.createHmac("sha512",this.chainCode).update(A).digest(),S=p.slice(0,32),N=p.slice(32),B=new r(this.versions);if(this.privateKey)try{B.privateKey=g.from(L.privateKeyTweakAdd(g.from(this.privateKey),S))}catch{return this.deriveChild(l+1)}else try{B.publicKey=g.from(L.publicKeyTweakAdd(g.from(this.publicKey),S,!0))}catch{return this.deriveChild(l+1)}return B.chainCode=N,B.depth=this.depth+1,B.parentFingerprint=this.fingerprint,B.index=l,B},r.prototype.sign=function(l){return g.from(L.ecdsaSign(l,this.privateKey).signature)},r.prototype.verify=function(l,q){return L.ecdsaVerify(Uint8Array.from(q),Uint8Array.from(l),Uint8Array.from(this.publicKey))},r.prototype.wipePrivateData=function(){return this._privateKey&&s.randomBytes(this._privateKey.length).copy(this._privateKey),this._privateKey=null,this},r.prototype.toJSON=function(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}},r.fromMasterSeed=function(l,q){var O=s.createHmac("sha512",E).update(l).digest(),A=O.slice(0,32),j=O.slice(32),u=new r(q);return u.chainCode=j,u.privateKey=A,u},r.fromExtendedKey=function(l,q){q=q||e;var O=new r(q),A=_.decode(l),j=A.readUInt32BE(0);h(j===q.private||j===q.public,"Version mismatch: does not match private or public"),O.depth=A.readUInt8(4),O.parentFingerprint=A.readUInt32BE(5),O.index=A.readUInt32BE(9),O.chainCode=A.slice(13,45);var u=A.slice(45);return u.readUInt8(0)===0?(h(j===q.private,"Version mismatch: version does not match private"),O.privateKey=g.from(u.slice(1))):(h(j===q.public,"Version mismatch: version does not match public"),O.publicKey=g.from(u)),O},r.fromJSON=function(l){return r.fromExtendedKey(l.xpriv)};function d(l,q,O){var A=g.allocUnsafe(n);A.writeUInt32BE(q,0),A.writeUInt8(l.depth,4);var j=l.depth?l.parentFingerprint:0;return A.writeUInt32BE(j,5),A.writeUInt32BE(l.index,9),l.chainCode.copy(A,13),O.copy(A,45),A}function y(l){var q=s.createHash("sha256").update(l).digest();return new b().update(q).digest()}return r.HARDENED_OFFSET=f,He=r,He}var Ze,wr;function ut(){if(wr)return Ze;wr=1;const h=nt(),g=Cr(),{fromSecretKey:s,WalletType:b}=Vr(),{isHexStrict:_,toHex:L,toBuffer:E,stripHexPrefix:f}=Lr(),{types:n}=g;return Ze={fromAppDid:(r,d,y={role:n.RoleType.ROLE_ACCOUNT},l=0)=>{if(!d)throw new Error("Cannot get user wallet with empty root sk");const q=g.Hasher.SHA3.hash256(E(r)),O=f(q).slice(0,16),A=O.slice(0,8),j=O.slice(8,16),u=parseInt(+`0x${A}`,10)&2147483647,p=parseInt(+`0x${j}`,10)&2147483647,S=f(_(d)?d:L(d)),N=h.fromMasterSeed(qr.from(S,"hex")),B=`m/44'/260'/${u}'/${p}'/${l}`,K=N.derive(B),H=b(y),{pk:V=n.KeyType.ED25519}=H;let W;return V===n.KeyType.ED25519?W=g.Signer.Ed25519.genKeyPair("hex",K.privateKey).secretKey:W=L(K.privateKey),V===n.KeyType.ETHEREUM&&(W=W.slice(0,66)),s(W,H)}},Ze}export{ut as r};
62
+ `));var z=new r({actual:a,expected:i,message:c,operator:w,stackStartFn:R});throw z.generatedMessage=D,z}}K.match=function a(i,c,R){x(i,c,R,a,"match")},K.doesNotMatch=function a(i,c,R){x(i,c,R,a,"doesNotMatch")};function C(){for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];te.apply(void 0,[C,i.length].concat(i))}return K.strict=A(C,K,{equal:K.strictEqual,deepEqual:K.deepStrictEqual,notEqual:K.notStrictEqual,notDeepEqual:K.notDeepStrictEqual}),K.strict.strict=K.strict,Pe.exports}var Ce,hr;function kr(){if(hr)return Ce;hr=1;var h=ke().Buffer;function g(s){if(s.length>=255)throw new TypeError("Alphabet too long");for(var b=new Uint8Array(256),_=0;_<b.length;_++)b[_]=255;for(var L=0;L<s.length;L++){var E=s.charAt(L),f=E.charCodeAt(0);if(b[f]!==255)throw new TypeError(E+" is ambiguous");b[f]=L}var n=s.length,e=s.charAt(0),r=Math.log(n)/Math.log(256),d=Math.log(256)/Math.log(n);function y(O){if((Array.isArray(O)||O instanceof Uint8Array)&&(O=h.from(O)),!h.isBuffer(O))throw new TypeError("Expected Buffer");if(O.length===0)return"";for(var A=0,j=0,u=0,p=O.length;u!==p&&O[u]===0;)u++,A++;for(var S=(p-u)*d+1>>>0,N=new Uint8Array(S);u!==p;){for(var B=O[u],K=0,H=S-1;(B!==0||K<j)&&H!==-1;H--,K++)B+=256*N[H]>>>0,N[H]=B%n>>>0,B=B/n>>>0;if(B!==0)throw new Error("Non-zero carry");j=K,u++}for(var V=S-j;V!==S&&N[V]===0;)V++;for(var W=e.repeat(A);V<S;++V)W+=s.charAt(N[V]);return W}function l(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return h.alloc(0);for(var A=0,j=0,u=0;O[A]===e;)j++,A++;for(var p=(O.length-A)*r+1>>>0,S=new Uint8Array(p);A<O.length;){var N=b[O.charCodeAt(A)];if(N===255)return;for(var B=0,K=p-1;(N!==0||B<u)&&K!==-1;K--,B++)N+=n*S[K]>>>0,S[K]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");u=B,A++}for(var H=p-u;H!==p&&S[H]===0;)H++;var V=h.allocUnsafe(j+(p-H));V.fill(0,0,j);for(var W=j;H!==p;)V[W++]=S[H++];return V}function q(O){var A=l(O);if(A)return A;throw new Error("Non-base"+n+" character")}return{encode:y,decodeUnsafe:l,decode:q}}return Ce=g,Ce}var Ve,dr;function Xr(){if(dr)return Ve;dr=1;var h=kr(),g="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return Ve=h(g),Ve}var Fe,yr;function Jr(){if(yr)return Fe;yr=1;var h=Xr(),g=ke().Buffer;return Fe=function(s){function b(f){var n=s(f);return h.encode(g.concat([f,n],f.length+4))}function _(f){var n=f.slice(0,-4),e=f.slice(-4),r=s(n);if(!(e[0]^r[0]|e[1]^r[1]|e[2]^r[2]|e[3]^r[3]))return n}function L(f){var n=h.decodeUnsafe(f);if(n)return _(n)}function E(f){var n=h.decode(f),e=_(n);if(!e)throw new Error("Invalid checksum");return e}return{encode:b,decode:E,decodeUnsafe:L}},Fe}var $e,br;function Qr(){if(br)return $e;br=1;var h=Ur(),g=Jr();function s(b){var _=h("sha256").update(b).digest();return h("sha256").update(_).digest()}return $e=g(s),$e}var Ge,gr;function et(){if(gr)return Ge;gr=1;const h={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function g(E,f){if(!E)throw new Error(f)}function s(E,f,n){if(g(f instanceof Uint8Array,`Expected ${E} to be an Uint8Array`),n!==void 0)if(Array.isArray(n)){const e=n.join(", "),r=`Expected ${E} to be an Uint8Array with length [${e}]`;g(n.includes(f.length),r)}else{const e=`Expected ${E} to be an Uint8Array with length ${n}`;g(f.length===n,e)}}function b(E){g(L(E)==="Boolean","Expected compressed to be a Boolean")}function _(E=n=>new Uint8Array(n),f){return typeof E=="function"&&(E=E(f)),s("output",E,f),E}function L(E){return Object.prototype.toString.call(E).slice(8,-1)}return Ge=E=>({contextRandomize(f){switch(g(f===null||f instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),f!==null&&s("seed",f,32),E.contextRandomize(f)){case 1:throw new Error(h.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(f){return s("private key",f,32),E.privateKeyVerify(f)===0},privateKeyNegate(f){switch(s("private key",f,32),E.privateKeyNegate(f)){case 0:return f;case 1:throw new Error(h.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(f,n){switch(s("private key",f,32),s("tweak",n,32),E.privateKeyTweakAdd(f,n)){case 0:return f;case 1:throw new Error(h.TWEAK_ADD)}},privateKeyTweakMul(f,n){switch(s("private key",f,32),s("tweak",n,32),E.privateKeyTweakMul(f,n)){case 0:return f;case 1:throw new Error(h.TWEAK_MUL)}},publicKeyVerify(f){return s("public key",f,[33,65]),E.publicKeyVerify(f)===0},publicKeyCreate(f,n=!0,e){switch(s("private key",f,32),b(n),e=_(e,n?33:65),E.publicKeyCreate(e,f)){case 0:return e;case 1:throw new Error(h.SECKEY_INVALID);case 2:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyConvert(f,n=!0,e){switch(s("public key",f,[33,65]),b(n),e=_(e,n?33:65),E.publicKeyConvert(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyNegate(f,n=!0,e){switch(s("public key",f,[33,65]),b(n),e=_(e,n?33:65),E.publicKeyNegate(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE);case 3:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyCombine(f,n=!0,e){g(Array.isArray(f),"Expected public keys to be an Array"),g(f.length>0,"Expected public keys array will have more than zero items");for(const r of f)s("public key",r,[33,65]);switch(b(n),e=_(e,n?33:65),E.publicKeyCombine(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.PUBKEY_COMBINE);case 3:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(f,n,e=!0,r){switch(s("public key",f,[33,65]),s("tweak",n,32),b(e),r=_(r,e?33:65),E.publicKeyTweakAdd(r,f,n)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.TWEAK_ADD)}},publicKeyTweakMul(f,n,e=!0,r){switch(s("public key",f,[33,65]),s("tweak",n,32),b(e),r=_(r,e?33:65),E.publicKeyTweakMul(r,f,n)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.TWEAK_MUL)}},signatureNormalize(f){switch(s("signature",f,64),E.signatureNormalize(f)){case 0:return f;case 1:throw new Error(h.SIG_PARSE)}},signatureExport(f,n){s("signature",f,64),n=_(n,72);const e={output:n,outputlen:72};switch(E.signatureExport(e,f)){case 0:return n.slice(0,e.outputlen);case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},signatureImport(f,n){switch(s("signature",f),n=_(n,64),E.signatureImport(n,f)){case 0:return n;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},ecdsaSign(f,n,e={},r){s("message",f,32),s("private key",n,32),g(L(e)==="Object","Expected options to be an Object"),e.data!==void 0&&s("options.data",e.data),e.noncefn!==void 0&&g(L(e.noncefn)==="Function","Expected options.noncefn to be a Function"),r=_(r,64);const d={signature:r,recid:null};switch(E.ecdsaSign(d,f,n,e.data,e.noncefn)){case 0:return d;case 1:throw new Error(h.SIGN);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},ecdsaVerify(f,n,e){switch(s("signature",f,64),s("message",n,32),s("public key",e,[33,65]),E.ecdsaVerify(f,n,e)){case 0:return!0;case 3:return!1;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.PUBKEY_PARSE)}},ecdsaRecover(f,n,e,r=!0,d){switch(s("signature",f,64),g(L(n)==="Number"&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),s("message",e,32),b(r),d=_(d,r?33:65),E.ecdsaRecover(d,f,n,e)){case 0:return d;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.RECOVER);case 3:throw new Error(h.IMPOSSIBLE_CASE)}},ecdh(f,n,e={},r){switch(s("public key",f,[33,65]),s("private key",n,32),g(L(e)==="Object","Expected options to be an Object"),e.data!==void 0&&s("options.data",e.data),e.hashfn!==void 0?(g(L(e.hashfn)==="Function","Expected options.hashfn to be a Function"),e.xbuf!==void 0&&s("options.xbuf",e.xbuf,32),e.ybuf!==void 0&&s("options.ybuf",e.ybuf,32),s("output",r)):r=_(r,32),E.ecdh(r,f,n,e.data,e.hashfn,e.xbuf,e.ybuf)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.ECDH)}}}),Ge}var ze,vr;function rt(){if(vr)return ze;vr=1;const h=Br().ec,g=new h("secp256k1"),s=g.curve,b=s.n.constructor;function _(n,e){let r=new b(e);if(r.cmp(s.p)>=0)return null;r=r.toRed(s.red);let d=r.redSqr().redIMul(r).redIAdd(s.b).redSqrt();return n===3!==d.isOdd()&&(d=d.redNeg()),g.keyPair({pub:{x:r,y:d}})}function L(n,e,r){let d=new b(e),y=new b(r);if(d.cmp(s.p)>=0||y.cmp(s.p)>=0||(d=d.toRed(s.red),y=y.toRed(s.red),(n===6||n===7)&&y.isOdd()!==(n===7)))return null;const l=d.redSqr().redIMul(d);return y.redSqr().redISub(l.redIAdd(s.b)).isZero()?g.keyPair({pub:{x:d,y}}):null}function E(n){const e=n[0];switch(e){case 2:case 3:return n.length!==33?null:_(e,n.subarray(1,33));case 4:case 6:case 7:return n.length!==65?null:L(e,n.subarray(1,33),n.subarray(33,65));default:return null}}function f(n,e){const r=e.encode(null,n.length===33);for(let d=0;d<n.length;++d)n[d]=r[d]}return ze={contextRandomize(){return 0},privateKeyVerify(n){const e=new b(n);return e.cmp(s.n)<0&&!e.isZero()?0:1},privateKeyNegate(n){const e=new b(n),r=s.n.sub(e).umod(s.n).toArrayLike(Uint8Array,"be",32);return n.set(r),0},privateKeyTweakAdd(n,e){const r=new b(e);if(r.cmp(s.n)>=0||(r.iadd(new b(n)),r.cmp(s.n)>=0&&r.isub(s.n),r.isZero()))return 1;const d=r.toArrayLike(Uint8Array,"be",32);return n.set(d),0},privateKeyTweakMul(n,e){let r=new b(e);if(r.cmp(s.n)>=0||r.isZero())return 1;r.imul(new b(n)),r.cmp(s.n)>=0&&(r=r.umod(s.n));const d=r.toArrayLike(Uint8Array,"be",32);return n.set(d),0},publicKeyVerify(n){return E(n)===null?1:0},publicKeyCreate(n,e){const r=new b(e);if(r.cmp(s.n)>=0||r.isZero())return 1;const d=g.keyFromPrivate(e).getPublic();return f(n,d),0},publicKeyConvert(n,e){const r=E(e);if(r===null)return 1;const d=r.getPublic();return f(n,d),0},publicKeyNegate(n,e){const r=E(e);if(r===null)return 1;const d=r.getPublic();return d.y=d.y.redNeg(),f(n,d),0},publicKeyCombine(n,e){const r=new Array(e.length);for(let y=0;y<e.length;++y)if(r[y]=E(e[y]),r[y]===null)return 1;let d=r[0].getPublic();for(let y=1;y<r.length;++y)d=d.add(r[y].pub);return d.isInfinity()?2:(f(n,d),0)},publicKeyTweakAdd(n,e,r){const d=E(e);if(d===null)return 1;if(r=new b(r),r.cmp(s.n)>=0)return 2;const y=d.getPublic().add(s.g.mul(r));return y.isInfinity()?2:(f(n,y),0)},publicKeyTweakMul(n,e,r){const d=E(e);if(d===null)return 1;if(r=new b(r),r.cmp(s.n)>=0||r.isZero())return 2;const y=d.getPublic().mul(r);return f(n,y),0},signatureNormalize(n){const e=new b(n.subarray(0,32)),r=new b(n.subarray(32,64));return e.cmp(s.n)>=0||r.cmp(s.n)>=0?1:(r.cmp(g.nh)===1&&n.set(s.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(n,e){const r=e.subarray(0,32),d=e.subarray(32,64);if(new b(r).cmp(s.n)>=0||new b(d).cmp(s.n)>=0)return 1;const{output:y}=n;let l=y.subarray(4,37);l[0]=0,l.set(r,1);let q=33,O=0;for(;q>1&&l[O]===0&&!(l[O+1]&128);--q,++O);if(l=l.subarray(O),l[0]&128||q>1&&l[0]===0&&!(l[1]&128))return 1;let A=y.subarray(39,72);A[0]=0,A.set(d,1);let j=33,u=0;for(;j>1&&A[u]===0&&!(A[u+1]&128);--j,++u);return A=A.subarray(u),A[0]&128||j>1&&A[0]===0&&!(A[1]&128)?1:(n.outputlen=6+q+j,y[0]=48,y[1]=n.outputlen-2,y[2]=2,y[3]=l.length,y.set(l,4),y[4+q]=2,y[5+q]=A.length,y.set(A,6+q),0)},signatureImport(n,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;const r=e[3];if(r===0||5+r>=e.length||e[4+r]!==2)return 1;const d=e[5+r];if(d===0||6+r+d!==e.length||e[4]&128||r>1&&e[4]===0&&!(e[5]&128)||e[r+6]&128||d>1&&e[r+6]===0&&!(e[r+7]&128))return 1;let y=e.subarray(4,4+r);if(y.length===33&&y[0]===0&&(y=y.subarray(1)),y.length>32)return 1;let l=e.subarray(6+r);if(l.length===33&&l[0]===0&&(l=l.slice(1)),l.length>32)throw new Error("S length is too long");let q=new b(y);q.cmp(s.n)>=0&&(q=new b(0));let O=new b(e.subarray(6+r));return O.cmp(s.n)>=0&&(O=new b(0)),n.set(q.toArrayLike(Uint8Array,"be",32),0),n.set(O.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(n,e,r,d,y){if(y){const O=y;y=A=>{const j=O(e,r,null,d,A);if(!(j instanceof Uint8Array&&j.length===32))throw new Error("This is the way");return new b(j)}}const l=new b(r);if(l.cmp(s.n)>=0||l.isZero())return 1;let q;try{q=g.sign(e,r,{canonical:!0,k:y,pers:d})}catch{return 1}return n.signature.set(q.r.toArrayLike(Uint8Array,"be",32),0),n.signature.set(q.s.toArrayLike(Uint8Array,"be",32),32),n.recid=q.recoveryParam,0},ecdsaVerify(n,e,r){const d={r:n.subarray(0,32),s:n.subarray(32,64)},y=new b(d.r),l=new b(d.s);if(y.cmp(s.n)>=0||l.cmp(s.n)>=0)return 1;if(l.cmp(g.nh)===1||y.isZero()||l.isZero())return 3;const q=E(r);if(q===null)return 2;const O=q.getPublic();return g.verify(e,d,O)?0:3},ecdsaRecover(n,e,r,d){const y={r:e.slice(0,32),s:e.slice(32,64)},l=new b(y.r),q=new b(y.s);if(l.cmp(s.n)>=0||q.cmp(s.n)>=0)return 1;if(l.isZero()||q.isZero())return 2;let O;try{O=g.recoverPubKey(d,y,r)}catch{return 2}return f(n,O),0},ecdh(n,e,r,d,y,l,q){const O=E(e);if(O===null)return 1;const A=new b(r);if(A.cmp(s.n)>=0||A.isZero())return 2;const j=O.getPublic().mul(A);if(y===void 0){const u=j.encode(null,!0),p=g.hash().update(u).digest();for(let S=0;S<32;++S)n[S]=p[S]}else{l||(l=new Uint8Array(32));const u=j.getX().toArray("be",32);for(let B=0;B<32;++B)l[B]=u[B];q||(q=new Uint8Array(32));const p=j.getY().toArray("be",32);for(let B=0;B<32;++B)q[B]=p[B];const S=y(l,q,d);if(!(S instanceof Uint8Array&&S.length===n.length))return 2;n.set(S)}return 0}},ze}var Ye,Er;function tt(){return Er||(Er=1,Ye=et()(rt())),Ye}var He,mr;function nt(){if(mr)return He;mr=1;var h=We(),g=ke().Buffer,s=Dr(),b=Mr(),_=Qr(),L=tt(),E=g.from("Bitcoin seed","utf8"),f=2147483648,n=78,e={private:76066276,public:76067358};function r(l){this.versions=l||e,this.depth=0,this.index=0,this._privateKey=null,this._publicKey=null,this.chainCode=null,this._fingerprint=0,this.parentFingerprint=0}Object.defineProperty(r.prototype,"fingerprint",{get:function(){return this._fingerprint}}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this._identifier}}),Object.defineProperty(r.prototype,"pubKeyHash",{get:function(){return this.identifier}}),Object.defineProperty(r.prototype,"privateKey",{get:function(){return this._privateKey},set:function(l){l=Uint8Array.from(l),h.equal(l.length,32,"Private key must be 32 bytes."),h(L.privateKeyVerify(l)===!0,"Invalid private key"),this._privateKey=g.from(l),this._publicKey=g.from(L.publicKeyCreate(l,!0)),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0)}}),Object.defineProperty(r.prototype,"publicKey",{get:function(){return this._publicKey},set:function(l){h(l.length===33||l.length===65,"Public key must be 33 or 65 bytes."),h(L.publicKeyVerify(l)===!0,"Invalid public key"),this._publicKey=g.from(L.publicKeyConvert(l,!0)),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0),this._privateKey=null}}),Object.defineProperty(r.prototype,"privateExtendedKey",{get:function(){return this._privateKey?_.encode(d(this,this.versions.private,g.concat([g.alloc(1,0),this.privateKey]))):null}}),Object.defineProperty(r.prototype,"publicExtendedKey",{get:function(){return _.encode(d(this,this.versions.public,this.publicKey))}}),r.prototype.derive=function(l){if(l==="m"||l==="M"||l==="m'"||l==="M'")return this;var q=l.split("/"),O=this;return q.forEach(function(A,j){if(j===0){h(/^[mM]{1}/.test(A),'Path must start with "m" or "M"');return}var u=A.length>1&&A[A.length-1]==="'",p=parseInt(A,10);h(p<f,"Invalid index"),u&&(p+=f),O=O.deriveChild(p)}),O},r.prototype.deriveChild=function(l){var q=l>=f,O=g.allocUnsafe(4);O.writeUInt32BE(l,0);var A;if(q){h(this.privateKey,"Could not derive hardened child key");var j=g.from(this.privateKey),u=g.alloc(1,0);j=g.concat([u,j]),A=g.concat([j,O])}else A=g.concat([this.publicKey,O]);var p=s.createHmac("sha512",this.chainCode).update(A).digest(),S=p.slice(0,32),N=p.slice(32),B=new r(this.versions);if(this.privateKey)try{B.privateKey=g.from(L.privateKeyTweakAdd(g.from(this.privateKey),S))}catch{return this.deriveChild(l+1)}else try{B.publicKey=g.from(L.publicKeyTweakAdd(g.from(this.publicKey),S,!0))}catch{return this.deriveChild(l+1)}return B.chainCode=N,B.depth=this.depth+1,B.parentFingerprint=this.fingerprint,B.index=l,B},r.prototype.sign=function(l){return g.from(L.ecdsaSign(l,this.privateKey).signature)},r.prototype.verify=function(l,q){return L.ecdsaVerify(Uint8Array.from(q),Uint8Array.from(l),Uint8Array.from(this.publicKey))},r.prototype.wipePrivateData=function(){return this._privateKey&&s.randomBytes(this._privateKey.length).copy(this._privateKey),this._privateKey=null,this},r.prototype.toJSON=function(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}},r.fromMasterSeed=function(l,q){var O=s.createHmac("sha512",E).update(l).digest(),A=O.slice(0,32),j=O.slice(32),u=new r(q);return u.chainCode=j,u.privateKey=A,u},r.fromExtendedKey=function(l,q){q=q||e;var O=new r(q),A=_.decode(l),j=A.readUInt32BE(0);h(j===q.private||j===q.public,"Version mismatch: does not match private or public"),O.depth=A.readUInt8(4),O.parentFingerprint=A.readUInt32BE(5),O.index=A.readUInt32BE(9),O.chainCode=A.slice(13,45);var u=A.slice(45);return u.readUInt8(0)===0?(h(j===q.private,"Version mismatch: version does not match private"),O.privateKey=g.from(u.slice(1))):(h(j===q.public,"Version mismatch: version does not match public"),O.publicKey=g.from(u)),O},r.fromJSON=function(l){return r.fromExtendedKey(l.xpriv)};function d(l,q,O){var A=g.allocUnsafe(n);A.writeUInt32BE(q,0),A.writeUInt8(l.depth,4);var j=l.depth?l.parentFingerprint:0;return A.writeUInt32BE(j,5),A.writeUInt32BE(l.index,9),l.chainCode.copy(A,13),O.copy(A,45),A}function y(l){var q=s.createHash("sha256").update(l).digest();return new b().update(q).digest()}return r.HARDENED_OFFSET=f,He=r,He}var Ze,wr;function ut(){if(wr)return Ze;wr=1;const h=nt(),g=Lr(),{fromSecretKey:s,WalletType:b}=Vr(),{isHexStrict:_,toHex:L,toBuffer:E,stripHexPrefix:f}=Cr(),{types:n}=g;return Ze={fromAppDid:(r,d,y={role:n.RoleType.ROLE_ACCOUNT},l=0)=>{if(!d)throw new Error("Cannot get user wallet with empty root sk");const q=g.Hasher.SHA3.hash256(E(r)),O=f(q).slice(0,16),A=O.slice(0,8),j=O.slice(8,16),u=parseInt(+`0x${A}`,10)&2147483647,p=parseInt(+`0x${j}`,10)&2147483647,S=f(_(d)?d:L(d)),N=h.fromMasterSeed(qr.from(S,"hex")),B=`m/44'/260'/${u}'/${p}'/${l}`,K=N.derive(B),H=b(y),{pk:V=n.KeyType.ED25519}=H;let W;return V===n.KeyType.ED25519?W=g.Signer.Ed25519.genKeyPair("hex",K.privateKey).secretKey:W=L(K.privateKey),V===n.KeyType.ETHEREUM&&(W=W.slice(0,66)),s(W,H)}},Ze}export{ut as r};