@abtnode/blocklet-services 1.17.8-beta-20260104-120132-cb5b1914 → 1.17.8-beta-20260106-113136-b3c09e14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterDayjs-DyRP0A_7.js → AdapterDayjs-DafRMFLg.js} +1 -1
- package/dist/assets/Community-3AO97CCq.js +1 -0
- package/dist/assets/{Google-Bjq5o7qL.js → Google-DRu937I3.js} +1 -1
- package/dist/assets/Holiday-CqSw2e8m.js +1 -0
- package/dist/assets/Meeting-DKbNRI16.js +1 -0
- package/dist/assets/OffSick-BvEREz3_.js +1 -0
- package/dist/assets/WorkingRemotely-DNtYHcSB.js +1 -0
- package/dist/assets/{access-control-Cv1j0YWJ.js → access-control-cgo5Z15_.js} +1 -1
- package/dist/assets/{add-component-core-8nx00xJP.js → add-component-core-BfzNEcS5.js} +7 -7
- package/dist/assets/{add-resource-B3-VwSQg.js → add-resource-CYRgZ1ps.js} +1 -1
- package/dist/assets/addon-qN24wAb4.js +14 -0
- package/dist/assets/advanced-1Vu6rcXU.js +14 -0
- package/dist/assets/{aigne-Dehkd-7B.js → aigne-D6MrXXCU.js} +1 -1
- package/dist/assets/api-DwxIBXZs.js +1 -0
- package/dist/assets/{appearance-CkrEEbhp.js → appearance-DOQHBg9p.js} +1 -1
- package/dist/assets/arrow-down.svg-7ME6T1BL.js +1 -0
- package/dist/assets/{audit-logs-XPxQHo2y.js → audit-logs-ISyoqJFp.js} +2 -2
- package/dist/assets/{authorize-ByHCjaXS.js → authorize-B9RLEFal.js} +1 -1
- package/dist/assets/{base-chart-ChBZtUEG.js → base-chart-DhxjAyBU.js} +1 -1
- package/dist/assets/base32-_D4eWUeh.js +1 -0
- package/dist/assets/bind-account-CLIjYy96.js +1 -0
- package/dist/assets/{branding-CBzX3Xum.js → branding-C81Kt22j.js} +1 -1
- package/dist/assets/{branding-khY0G2TO.js → branding-iwUveEf5.js} +2 -2
- package/dist/assets/branding-myiZl37D.js +1 -0
- package/dist/assets/{bundle-avatar-Dtpi1uSw.js → bundle-avatar-Cc_6nw01.js} +1 -1
- package/dist/assets/button-D-lyR9BW.js +1 -0
- package/dist/assets/{click-to-copy-BEM1P78p.js → click-to-copy-CMo42VnK.js} +1 -1
- package/dist/assets/cloneDeep-BY8zW7hH.js +1 -0
- package/dist/assets/{complete-CuyAiV3B.js → complete-CJ_buCAS.js} +4 -4
- package/dist/assets/{component-nxxcEAFR.js → component-Dip3v1Iq.js} +3 -3
- package/dist/assets/config-44sI5I0w.js +53 -0
- package/dist/assets/{config-DOcJbRFr.js → config-D5KnWqfn.js} +1 -1
- package/dist/assets/{config-DweHAJPq.js → config-D8XZj8JI.js} +2 -2
- package/dist/assets/{config-navigation-BG6durqz.js → config-navigation-Ni0iczgA.js} +8 -8
- package/dist/assets/config-space-B6_f52sE.js +1 -0
- package/dist/assets/{confirm-BRnYfcDD.js → confirm-Lb1MrAdS.js} +1 -1
- package/dist/assets/connect-0OZVqJvc.js +1 -0
- package/dist/assets/connect-B9GQZEi7.js +5 -0
- package/dist/assets/connect-BV6BUhDJ.css +1 -0
- package/dist/assets/connect-JAX_oP3o.js +5 -0
- package/dist/assets/{connect-to-BEfFI4oa.js → connect-to-Djgj6TLg.js} +1 -1
- package/dist/assets/{create-passport-svg-BKhJ2ufW.js → create-passport-svg-5AYzBKFb.js} +1 -1
- package/dist/assets/createClass-DXYd7BIe.js +1 -0
- package/dist/assets/{dashboard-CDOqgUmx.js → dashboard-C0l2IWWH.js} +7 -7
- package/dist/assets/{delete-confirm-1vzcMsM2.js → delete-confirm-tbfLqDBI.js} +1 -1
- package/dist/assets/did-address-CsOJBoiY.js +1 -0
- package/dist/assets/{domain-D75xKDoP.js → domain-CnhOsdmM.js} +1 -1
- package/dist/assets/{domain-action-card-BgDPfYMr.js → domain-action-card-BsdHbhEi.js} +2 -2
- package/dist/assets/domains-DRP2VSvO.js +1 -0
- package/dist/assets/edit.svg-CTE5eATX.js +1 -0
- package/dist/assets/email-Dt_DGuhf.js +17 -0
- package/dist/assets/engine-BXGX_w-S.js +1 -0
- package/dist/assets/exchange-passport-DztKvBat.js +1 -0
- package/dist/assets/{form-BblKAylu.js → form-DoC8uBcB.js} +3 -3
- package/dist/assets/{form-text-input-C-JBHNfU.js → form-text-input-XjloVwBd.js} +2 -2
- package/dist/assets/{fuel-BPg61IpB.js → fuel-IaJHNPPW.js} +1 -1
- package/dist/assets/{gen-access-key-B-PvqBv6.js → gen-access-key-BJlDqEhI.js} +1 -1
- package/dist/assets/gen-simple-access-key-lyiUw0C-.js +1 -0
- package/dist/assets/get-safe-url-BiNPujaX.js +1 -0
- package/dist/assets/google-icon-vNOJy67F.js +1 -0
- package/dist/assets/{home-CT38dHBL.js → home-Bs_5YPbK.js} +1 -1
- package/dist/assets/{iframe-D119MMHU.js → iframe-Dqu4MSyW.js} +1 -1
- package/dist/assets/{index-BpWFE-ry.js → index-1HKgA-fz.js} +1 -1
- package/dist/assets/{index-CSCCjNba.js → index-B10SG1vs.js} +1 -1
- package/dist/assets/{index-sBtfsjBo.js → index-B4KKUWng.js} +2 -2
- package/dist/assets/{index-bCC4mzZc.js → index-B4YCnemd.js} +1 -1
- package/dist/assets/index-B6DWjLJS.js +281 -0
- package/dist/assets/{index-DSVwCr5p.js → index-B7_VUEoc.js} +2 -2
- package/dist/assets/index-B9LF8Bep.js +1 -0
- package/dist/assets/index-BDH_LtJL.js +1 -0
- package/dist/assets/{index-CGrk0HiP.js → index-BGhqVqit.js} +1 -1
- package/dist/assets/{index-DdojJXSn.js → index-BNhv-9xy.js} +3 -3
- package/dist/assets/{index-BNAs76qj.js → index-BSZtxRM0.js} +2 -2
- package/dist/assets/{index-BWCHnVga.js → index-BWDWEkUF.js} +1 -1
- package/dist/assets/{index-TzwTiNQ7.js → index-BWL6HE0j.js} +1 -1
- package/dist/assets/{index-E4Hos_Sx.js → index-B_SjLIbT.js} +7 -7
- package/dist/assets/{index-D1f4dwYF.js → index-BhhZ8IDZ.js} +13 -13
- package/dist/assets/{index-arhRQhsc.js → index-BkePHcyK.js} +9 -9
- package/dist/assets/{index-CfA9D2iF.js → index-BmXPp3DU.js} +1 -1
- package/dist/assets/{index-D1SIrheh.js → index-BsohFwTm.js} +1 -1
- package/dist/assets/index-CI_uwh_J.js +81 -0
- package/dist/assets/index-CQgzjKgB.js +1039 -0
- package/dist/assets/{index-8bzrOXqv.js → index-CRZM3CKo.js} +2 -2
- package/dist/assets/index-CbiyJRV7.js +1 -0
- package/dist/assets/{index-VaUGnCuU.js → index-Cp0b8q3A.js} +1 -1
- package/dist/assets/{index-BcIeEF3v.js → index-Cq6z7yeF.js} +4 -4
- package/dist/assets/index-DT5AXPVB.js +200 -0
- package/dist/assets/{index-DGbr3NAq.js → index-DctZHPFL.js} +1 -1
- package/dist/assets/{index-uODjznr3.js → index-Dfx19arA.js} +6 -6
- package/dist/assets/index-DhHvANH8.js +93 -0
- package/dist/assets/index-DrCTi6nm.css +1 -0
- package/dist/assets/{index-DoDx-vpV.js → index-G6Vk78zE.js} +3 -3
- package/dist/assets/{index-OTENuoZ0.js → index-TYwJnR0n.js} +23 -23
- package/dist/assets/{index-CIC0R_Qc.js → index-dbYkWwF4.js} +1 -1
- package/dist/assets/index-vP1T6V7V.js +120 -0
- package/dist/assets/info-outline-rounded-BIwvgXCK.js +1 -0
- package/dist/assets/invitation-CYFN9u5t.js +177 -0
- package/dist/assets/invitations-jY13RXbI.js +3 -0
- package/dist/assets/{invite-uHE_P5fP.js → invite-D72FvaiG.js} +1 -1
- package/dist/assets/{isURL-CRZ7iI7F.js → isURL-CJRImg0N.js} +2 -2
- package/dist/assets/issue-passport-BfqkJF3W.js +1 -0
- package/dist/assets/{item-BJSHAMwK.js → item-5ZWPft2s.js} +1 -1
- package/dist/assets/landing-page-DRtId3hN.js +1 -0
- package/dist/assets/{layout-D9M0eiNw.js → layout-Be1KH57_.js} +1 -1
- package/dist/assets/{list-DVUI92a2.js → list-CHI1rCEg.js} +3 -3
- package/dist/assets/list-CQtiNSih.js +2 -0
- package/dist/assets/localization-CKE-bHgd.js +1 -0
- package/dist/assets/lock.svg-CiT4rEpi.js +1 -0
- package/dist/assets/{log-DbdNMVuv.js → log-BfCFT05M.js} +1 -1
- package/dist/assets/logger-DU7baop2.js +1 -0
- package/dist/assets/login-BtsH3IvI.js +1 -0
- package/dist/assets/{login-oauth-callback-RLp-7ubu.js → login-oauth-callback-Ds4uYiRr.js} +1 -1
- package/dist/assets/{logo-uploader-BFMnNkRn.js → logo-uploader-lepUW_D7.js} +3 -3
- package/dist/assets/{lost-passport-CB5SFq30.js → lost-passport-BtN3h1ya.js} +2 -2
- package/dist/assets/omit-CCIQ0Qdi.js +1 -0
- package/dist/assets/{open-window-xMdq1GjU.js → open-window-CNt8gsrN.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DvKFY6t9.js → over-due-invoice-payment-7TbnqqKX.js} +1 -1
- package/dist/assets/{overview-DNVfcZQO.js → overview-Be3tncsL.js} +3 -3
- package/dist/assets/passport-CkJ4B4CG.js +1 -0
- package/dist/assets/passport-item-Bhbm8_m6.js +1 -0
- package/dist/assets/{permission-C0rLyhnq.js → permission-BHvrn0M5.js} +1 -1
- package/dist/assets/preferences-TFWtUYLy.js +1 -0
- package/dist/assets/profile-embed-B9f9hlSS.js +1 -0
- package/dist/assets/provider-icon-DQY2_LaP.js +1 -0
- package/dist/assets/publish-resource-CyvkVMG_.js +1 -0
- package/dist/assets/question-mark-circle.svg-GhTaklFN.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-BZjy3RlT.js → react-beautiful-dnd.esm-D0JKrMDl.js} +4 -4
- package/dist/assets/revoke.svg-DUoaRyPZ.js +1 -0
- package/dist/assets/runtime-npJC4gp_.js +1 -0
- package/dist/assets/{sanitize-yVk8VEIO.js → sanitize-C-shWbtD.js} +1 -1
- package/dist/assets/sdk-CoWDgSLO.js +1 -0
- package/dist/assets/security-nSKpCl8B.js +22 -0
- package/dist/assets/server-logo-notext.svg-BLAdvsmP.js +1 -0
- package/dist/assets/{session-5s-U-ruq.js → session-C2ZBRIpv.js} +1 -1
- package/dist/assets/{setup-DgF_JFoX.js → setup-krkSJpAg.js} +1 -1
- package/dist/assets/simple-select-i16Vwzvl.js +1 -0
- package/dist/assets/{spaces-BE9CZzeJ.js → spaces-BdZ_Rv3s.js} +1 -1
- package/dist/assets/start-y3zrboBQ.js +187 -0
- package/dist/assets/{starting-progress-MyalFKYG.js → starting-progress-DI-J-VlX.js} +2 -2
- package/dist/assets/status-B8pB_mTB.js +1 -0
- package/dist/assets/{step-actions-X2c_czAD.js → step-actions-B1ufIDaK.js} +1 -1
- package/dist/assets/{studio-BcQoXvqZ.js → studio-1jwq0HOw.js} +1 -1
- package/dist/assets/{switch-BjA8SIAh.js → switch-CetbUrYR.js} +1 -1
- package/dist/assets/{switch-control-D2RiXLWV.js → switch-control-_85hc9FG.js} +1 -1
- package/dist/assets/{table-tips-Dgzi4H1y.js → table-tips-CMt22HEy.js} +1 -1
- package/dist/assets/team-DDjNXwXE.js +146 -0
- package/dist/assets/{traffic-CvgJe_3z.js → traffic-mcbpWOFq.js} +1 -1
- package/dist/assets/transfer-C66c3bWd.js +16 -0
- package/dist/assets/unsubscribe-Cvz0OKhq.js +1 -0
- package/dist/assets/{use-app-logo-Cfo-T8ZY.js → use-app-logo-BuyF983S.js} +1 -1
- package/dist/assets/use-server-logo-Pbr_UuiI.js +1 -0
- package/dist/assets/{use-window-close-4WCUBrSc.js → use-window-close-B16QghYq.js} +1 -1
- package/dist/assets/{useAsync-DVl73fmG.js → useAsync-BVTh1KYj.js} +1 -1
- package/dist/assets/{useAsync-Dotoxibi.js → useAsync-ZGLJQow7.js} +1 -1
- package/dist/assets/{useAsyncRetry-r8dEPb-x.js → useAsyncRetry-BMmRgSGm.js} +1 -1
- package/dist/assets/{useLocalStorage-Cl1rEjxs.js → useLocalStorage-De-EuH_M.js} +1 -1
- package/dist/assets/user-center-DQSoqc_z.js +125 -0
- package/dist/assets/user-follower-TTyja_sV.js +32 -0
- package/dist/assets/{util-CDBgZOAd.js → util-DuMKfKo8.js} +1 -1
- package/dist/assets/{util-BNGEGQGN.js → util-Ff3hwYmy.js} +1 -1
- package/dist/assets/{vendor-arcblock-B1iA4v4a.js → vendor-arcblock-Cnwtqa7s.js} +19 -19
- package/dist/assets/{vendor-hooks-qxhUUbW5.js → vendor-hooks-BQWlJm53.js} +2 -2
- package/dist/assets/{vendor-utils-CxWN1dT3.js → vendor-utils-DCMKu06e.js} +3 -3
- package/dist/assets/{vendor-ux-jvAfFAl1.js → vendor-ux-B0gV9NvH.js} +92 -95
- package/dist/assets/{wait-connect-VFnD4S6k.js → wait-connect-CRZmfXOA.js} +1 -1
- package/dist/assets/{wizard-D6nEp8xR.js → wizard-B41kI39b.js} +1 -1
- package/dist/assets/{wizard-components-CQAhuCn-.js → wizard-components-Bn72hVOe.js} +2 -2
- package/dist/assets/wrap-locale-CF46rj6q.js +1 -0
- package/dist/assets/{zh-LGxmNDus.js → zh-BmX_fuoi.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +46 -46
- package/dist/assets/Community-CELsDteM.js +0 -1
- package/dist/assets/Holiday-DOCjSYjH.js +0 -1
- package/dist/assets/Meeting-BAXt_LiK.js +0 -1
- package/dist/assets/OffSick-BGEr8Nkc.js +0 -1
- package/dist/assets/WorkingRemotely-BcneAIXG.js +0 -1
- package/dist/assets/addon-DckWyYy3.js +0 -14
- package/dist/assets/advanced-BcLdGbJh.js +0 -14
- package/dist/assets/api-FQQlzPOP.js +0 -1
- package/dist/assets/arrow-down.svg-C4FUKwt4.js +0 -1
- package/dist/assets/base32-BPZDlXZz.js +0 -1
- package/dist/assets/bind-account-DtN3r3bu.js +0 -1
- package/dist/assets/branding-Aq4o2tjp.js +0 -1
- package/dist/assets/button-D6aVYj2n.js +0 -1
- package/dist/assets/cloneDeep-C2rlAYcK.js +0 -1
- package/dist/assets/config-n9Go4CIg.js +0 -53
- package/dist/assets/config-space-DNGDnW7P.js +0 -1
- package/dist/assets/connect-B84DSta0.js +0 -1
- package/dist/assets/connect-CmaOf6IU.js +0 -5
- package/dist/assets/createClass-DXSToV70.js +0 -1
- package/dist/assets/did-address-B3eXeL7H.js +0 -1
- package/dist/assets/domains-BmgTqdar.js +0 -1
- package/dist/assets/edit.svg-RRSklUg-.js +0 -1
- package/dist/assets/email-0rfuUid8.js +0 -17
- package/dist/assets/engine-D-_cbl3F.js +0 -1
- package/dist/assets/exchange-passport-DtpDKfXH.js +0 -1
- package/dist/assets/gen-simple-access-key-BRpJnjDR.js +0 -1
- package/dist/assets/get-safe-url-xl2OarvZ.js +0 -1
- package/dist/assets/index-BMtr5-CV.js +0 -1
- package/dist/assets/index-BODmBNkm.js +0 -200
- package/dist/assets/index-C6oxUE_X.js +0 -281
- package/dist/assets/index-DUo9jXH_.js +0 -81
- package/dist/assets/index-DcjD74XY.js +0 -1
- package/dist/assets/index-DrVXX4fX.css +0 -1
- package/dist/assets/index-NWCpUGtr.js +0 -1039
- package/dist/assets/index-TG3kf9io.js +0 -120
- package/dist/assets/index-tfYDa2i6.js +0 -93
- package/dist/assets/invitation-CVulfNR5.js +0 -177
- package/dist/assets/invitations-CuhR5Qhr.js +0 -3
- package/dist/assets/issue-passport-CgdZdVEa.js +0 -1
- package/dist/assets/landing-page-Bu1ZaLGu.js +0 -1
- package/dist/assets/list-BYNjj68R.js +0 -2
- package/dist/assets/localization-CZX-M3IK.js +0 -1
- package/dist/assets/lock.svg-BgybwZNe.js +0 -1
- package/dist/assets/logger-Biwe4SzB.js +0 -1
- package/dist/assets/login-DUYsZ42N.js +0 -1
- package/dist/assets/omit-spWLSLbo.js +0 -1
- package/dist/assets/passport-BNRZfcVH.js +0 -1
- package/dist/assets/passport-item-Bf_kXmId.js +0 -1
- package/dist/assets/preferences-XGJx_7ht.js +0 -1
- package/dist/assets/profile-embed-DROgyynT.js +0 -1
- package/dist/assets/publish-resource-C3tnQoPG.js +0 -1
- package/dist/assets/question-mark-circle.svg-CByEVDhb.js +0 -1
- package/dist/assets/revoke.svg-CNl4LAbv.js +0 -1
- package/dist/assets/runtime-DiEn6rZ9.js +0 -1
- package/dist/assets/sdk-C45BrgFy.js +0 -1
- package/dist/assets/security-Ch3TxRbd.js +0 -22
- package/dist/assets/server-logo-notext.svg-xZ-i1SpD.js +0 -1
- package/dist/assets/simple-select-EppOca29.js +0 -1
- package/dist/assets/start-D6EkscL8.js +0 -187
- package/dist/assets/status-vSa6pwrP.js +0 -1
- package/dist/assets/team-D9lFN8Pe.js +0 -146
- package/dist/assets/transfer-IRaap94c.js +0 -16
- package/dist/assets/unsubscribe-7WUPZn-b.js +0 -1
- package/dist/assets/use-server-logo-Cv1kAPgB.js +0 -1
- package/dist/assets/user-center-BoGQKLvn.js +0 -125
- package/dist/assets/user-follower-D8NzTP2C.js +0 -32
- package/dist/assets/wrap-locale-qgV7mOv6.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{B as qr}from"./vendor-utils-
|
|
2
|
-
`),I=oe(
|
|
3
|
-
`),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(
|
|
4
|
-
|
|
5
|
-
`)+"".concat(
|
|
6
|
-
`)}else if(U!=="strictEqualObject"){var X=ae.stderr&&ae.stderr.isTTY?ae.stderr.columns:80;if(k<X){for(;
|
|
7
|
-
`.concat(
|
|
8
|
-
`.concat(ee).concat(i):x=ee,
|
|
1
|
+
import{B as qr}from"./vendor-utils-DCMKu06e.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bI as Se,cZ as jr,i as xr,c_ as Nr,c$ as _r,d0 as Kr,h as Sr,d1 as Tr,d2 as ke,d3 as Ur,aP as Br,bF as Dr,d4 as Mr}from"./vendor-ux-B0gV9NvH.js";import{cH as Or,bu as Lr,by as Cr}from"./index-CQgzjKgB.js";import{r as Vr}from"./index-BDH_LtJL.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,Y,V){return typeof p=="string"?p:p(K,Y,V)}var B=function(K){b(V,K);var Y=L(V);function V(W,te,Z){var J;return s(this,V),J=Y.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 Y(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
|
+
`),I=oe(m).split(`
|
|
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
|
+
|
|
5
|
+
`)+"".concat(w[0]," !== ").concat(I[0],`
|
|
6
|
+
`)}else if(U!=="strictEqualObject"){var X=ae.stderr&&ae.stderr.isTTY?ae.stderr.columns:80;if(k<X){for(;w[0][D]===I[0][D];)D++;D>2&&(z=`
|
|
7
|
+
`.concat(Y(" ",D),"^"),D=0)}}}for(var ee=w[w.length-1],se=I[I.length-1];ee===se&&(D++<2?i=`
|
|
8
|
+
`.concat(ee).concat(i):x=ee,w.pop(),I.pop(),!(w.length===0||I.length===0));)ee=w[w.length-1],se=I[I.length-1];var ge=Math.max(w.length,I.length);if(ge===0){var le=R.split(`
|
|
9
9
|
`);if(le.length>30)for(le[26]="".concat(V,"...").concat(Z);le.length>27;)le.pop();return"".concat(J.notIdentical,`
|
|
10
10
|
|
|
11
11
|
`).concat(le.join(`
|
|
@@ -13,30 +13,30 @@ import{B as qr}from"./vendor-utils-CxWN1dT3.js";import{p as ae}from"./vendor-rea
|
|
|
13
13
|
`)}D>3&&(i=`
|
|
14
14
|
`.concat(V,"...").concat(Z).concat(i),c=!0),x!==""&&(i=`
|
|
15
15
|
`.concat(x).concat(i),x="");var ne=0,ve=J[U]+`
|
|
16
|
-
`.concat(W,"+ actual").concat(Z," ").concat(te,"- expected").concat(Z),Oe=" ".concat(V,"...").concat(Z," Lines skipped");for(D=0;D<ge;D++){var ie=D-a;if(
|
|
16
|
+
`.concat(W,"+ actual").concat(Z," ").concat(te,"- expected").concat(Z),Oe=" ".concat(V,"...").concat(Z," Lines skipped");for(D=0;D<ge;D++){var ie=D-a;if(w.length<D+1)ie>1&&D>2&&(ie>4?(C+=`
|
|
17
17
|
`.concat(V,"...").concat(Z),c=!0):ie>3&&(C+=`
|
|
18
18
|
`.concat(I[D-2]),ne++),C+=`
|
|
19
19
|
`.concat(I[D-1]),ne++),a=D,x+=`
|
|
20
20
|
`.concat(te,"-").concat(Z," ").concat(I[D]),ne++;else if(I.length<D+1)ie>1&&D>2&&(ie>4?(C+=`
|
|
21
21
|
`.concat(V,"...").concat(Z),c=!0):ie>3&&(C+=`
|
|
22
|
-
`.concat(
|
|
23
|
-
`.concat(
|
|
24
|
-
`.concat(W,"+").concat(Z," ").concat(
|
|
22
|
+
`.concat(w[D-2]),ne++),C+=`
|
|
23
|
+
`.concat(w[D-1]),ne++),a=D,C+=`
|
|
24
|
+
`.concat(W,"+").concat(Z," ").concat(w[D]),ne++;else{var pe=I[D],ue=w[D],t=ue!==pe&&(!K(ue,",")||ue.slice(0,-1)!==pe);t&&K(pe,",")&&pe.slice(0,-1)===ue&&(t=!1,ue+=","),t?(ie>1&&D>2&&(ie>4?(C+=`
|
|
25
25
|
`.concat(V,"...").concat(Z),c=!0):ie>3&&(C+=`
|
|
26
|
-
`.concat(
|
|
27
|
-
`.concat(
|
|
26
|
+
`.concat(w[D-2]),ne++),C+=`
|
|
27
|
+
`.concat(w[D-1]),ne++),a=D,C+=`
|
|
28
28
|
`.concat(W,"+").concat(Z," ").concat(ue),x+=`
|
|
29
29
|
`.concat(te,"-").concat(Z," ").concat(pe),ne+=2):(C+=x,x="",(ie===1||D===0)&&(C+=`
|
|
30
30
|
`.concat(ue),ne++))}if(ne>20&&D<ge-2)return"".concat(ve).concat(Oe,`
|
|
31
31
|
`).concat(C,`
|
|
32
32
|
`).concat(V,"...").concat(Z).concat(x,`
|
|
33
33
|
`)+"".concat(V,"...").concat(Z)}return"".concat(ve).concat(c?Oe:"",`
|
|
34
|
-
`).concat(C).concat(x).concat(i).concat(z)}var ce=function(v,
|
|
35
|
-
`);if(c==="notStrictEqual"&&u(
|
|
34
|
+
`).concat(C).concat(x).concat(i).concat(z)}var ce=function(v,m){n(x,v);var U=e(x);function x(C){var a;if(b(this,x),u(C)!=="object"||C===null)throw new B("options","Object",C);var i=C.message,c=C.operator,R=C.stackStartFn,w=C.actual,I=C.expected,D=Error.stackTraceLimit;if(Error.stackTraceLimit=0,i!=null)a=U.call(this,String(i));else if(ae.stderr&&ae.stderr.isTTY&&(ae.stderr&&ae.stderr.getColorDepth&&ae.stderr.getColorDepth()!==1?(V="\x1B[34m",W="\x1B[32m",Z="\x1B[39m",te="\x1B[31m"):(V="",W="",Z="",te="")),u(w)==="object"&&w!==null&&u(I)==="object"&&I!==null&&"stack"in w&&w instanceof Error&&"stack"in I&&I instanceof Error&&(w=de(w),I=de(I)),c==="deepStrictEqual"||c==="strictEqual")a=U.call(this,ye(w,I,c));else if(c==="notDeepStrictEqual"||c==="notStrictEqual"){var z=J[c],k=oe(w).split(`
|
|
35
|
+
`);if(c==="notStrictEqual"&&u(w)==="object"&&w!==null&&(z=J.notStrictEqualObject),k.length>30)for(k[26]="".concat(V,"...").concat(Z);k.length>27;)k.pop();k.length===1?a=U.call(this,"".concat(z," ").concat(k[0])):a=U.call(this,"".concat(z,`
|
|
36
36
|
|
|
37
37
|
`).concat(k.join(`
|
|
38
38
|
`),`
|
|
39
|
-
`))}else{var X=oe(
|
|
39
|
+
`))}else{var X=oe(w),ee="",se=J[c];c==="notDeepEqual"||c==="notEqual"?(X="".concat(J[c],`
|
|
40
40
|
|
|
41
41
|
`).concat(X),X.length>1024&&(X="".concat(X.slice(0,1021),"..."))):(ee="".concat(oe(I)),X.length>512&&(X="".concat(X.slice(0,509),"...")),ee.length>512&&(ee="".concat(ee.slice(0,509),"...")),c==="deepEqual"||c==="equal"?X="".concat(se,`
|
|
42
42
|
|
|
@@ -44,19 +44,19 @@ import{B as qr}from"./vendor-utils-CxWN1dT3.js";import{p as ae}from"./vendor-rea
|
|
|
44
44
|
|
|
45
45
|
should equal
|
|
46
46
|
|
|
47
|
-
`):ee=" ".concat(c," ").concat(ee)),a=U.call(this,"".concat(X).concat(ee))}return Error.stackTraceLimit=D,a.generatedMessage=!i,Object.defineProperty(d(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=
|
|
48
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(t,o){if(t){if(typeof t=="string")return b(t,o);var P=Object.prototype.toString.call(t).slice(8,-1);if(P==="Object"&&t.constructor&&(P=t.constructor.name),P==="Map"||P==="Set")return Array.from(t);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return b(t,o)}}function b(t,o){(o==null||o>t.length)&&(o=t.length);for(var P=0,T=new Array(o);P<o;P++)T[P]=t[P];return T}function _(t,o){var P=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(P!=null){var T,M,$,F,G=[],
|
|
47
|
+
`):ee=" ".concat(c," ").concat(ee)),a=U.call(this,"".concat(X).concat(ee))}return Error.stackTraceLimit=D,a.generatedMessage=!i,Object.defineProperty(d(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=w,a.expected=I,a.operator=c,Error.captureStackTrace&&Error.captureStackTrace(d(a),R),a.stack,a.name="AssertionError",r(a)}return L(x,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:m,value:function(a,i){return S(this,g(g({},i),{},{customInspect:!1,depth:0}))}}]),x}(y(Error),S.custom);return Ie=ce,Ie}var qe,er;function $r(){if(er)return qe;er=1;var h=Or(),g=jr()(),s=xr(),b=Nr(),_=s("Array.prototype.push"),L=s("Object.prototype.propertyIsEnumerable"),E=g?b.getOwnPropertySymbols:null;return qe=function(n,e){if(n==null)throw new TypeError("target must be an object");var r=b(n);if(arguments.length===1)return r;for(var d=1;d<arguments.length;++d){var y=b(arguments[d]),l=h(y),q=g&&(b.getOwnPropertySymbols||E);if(q)for(var O=q(y),A=0;A<O.length;++A){var j=O[A];L(y,j)&&_(l,j)}for(var u=0;u<l.length;++u){var p=l[u];if(L(y,p)){var S=y[p];r[p]=S}}}return r},qe}var je,rr;function Gr(){if(rr)return je;rr=1;var h=$r(),g=function(){if(!Object.assign)return!1;for(var b="abcdefghijklmnopqrst",_=b.split(""),L={},E=0;E<_.length;++E)L[_[E]]=_[E];var f=Object.assign({},L),n="";for(var e in f)n+=e;return b!==n},s=function(){if(!Object.assign||!Object.preventExtensions)return!1;var b=Object.preventExtensions({1:2});try{Object.assign(b,"xy")}catch{return b[1]==="y"}return!1};return je=function(){return!Object.assign||g()||s()?h:Object.assign},je}var xe,tr;function Pr(){if(tr)return xe;tr=1;var h=function(g){return g!==g};return xe=function(s,b){return s===0&&b===0?1/s===1/b:!!(s===b||h(s)&&h(b))},xe}var Ne,nr;function Xe(){if(nr)return Ne;nr=1;var h=Pr();return Ne=function(){return typeof Object.is=="function"?Object.is:h},Ne}var _e,ir;function Ae(){if(ir)return _e;ir=1;var h=Or(),g=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",s=Object.prototype.toString,b=Array.prototype.concat,_=_r(),L=function(e){return typeof e=="function"&&s.call(e)==="[object Function]"},E=Kr()(),f=function(e,r,d,y){if(r in e){if(y===!0){if(e[r]===d)return}else if(!L(y)||!y())return}E?_(e,r,d,!0):_(e,r,d)},n=function(e,r){var d=arguments.length>2?arguments[2]:{},y=h(r);g&&(y=b.call(y,Object.getOwnPropertySymbols(r)));for(var l=0;l<y.length;l+=1)f(e,y[l],r[y[l]],d[y[l]])};return n.supportsDescriptors=!!E,_e=n,_e}var Ke,or;function zr(){if(or)return Ke;or=1;var h=Xe(),g=Ae();return Ke=function(){var b=h();return g(Object,{is:b},{is:function(){return Object.is!==b}}),b},Ke}var Te,ar;function Hr(){if(ar)return Te;ar=1;var h=Ae(),g=Sr(),s=Pr(),b=Xe(),_=zr(),L=g(b(),Object);return h(L,{getPolyfill:b,implementation:s,shim:_}),Te=L,Te}var Ue,cr;function Rr(){return cr||(cr=1,Ue=function(g){return g!==g}),Ue}var Be,ur;function Ir(){if(ur)return Be;ur=1;var h=Rr();return Be=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:h},Be}var De,fr;function Yr(){if(fr)return De;fr=1;var h=Ae(),g=Ir();return De=function(){var b=g();return h(Number,{isNaN:b},{isNaN:function(){return Number.isNaN!==b}}),b},De}var Me,sr;function Zr(){if(sr)return Me;sr=1;var h=Sr(),g=Ae(),s=Rr(),b=Ir(),_=Yr(),L=h(b(),Number);return g(L,{getPolyfill:b,implementation:s,shim:_}),Me=L,Me}var Le,lr;function Wr(){if(lr)return Le;lr=1;function h(t,o){return L(t)||_(t,o)||s(t,o)||g()}function g(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(t,o){if(t){if(typeof t=="string")return b(t,o);var P=Object.prototype.toString.call(t).slice(8,-1);if(P==="Object"&&t.constructor&&(P=t.constructor.name),P==="Map"||P==="Set")return Array.from(t);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return b(t,o)}}function b(t,o){(o==null||o>t.length)&&(o=t.length);for(var P=0,T=new Array(o);P<o;P++)T[P]=t[P];return T}function _(t,o){var P=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(P!=null){var T,M,$,F,G=[],H=!0,Q=!1;try{if($=(P=P.call(t)).next,o!==0)for(;!(H=(T=$.call(P)).done)&&(G.push(T.value),G.length!==o);H=!0);}catch(re){Q=!0,M=re}finally{try{if(!H&&P.return!=null&&(F=P.return(),Object(F)!==F))return}finally{if(Q)throw M}}return G}}function L(t){if(Array.isArray(t))return t}function E(t){"@babel/helpers - typeof";return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},E(t)}var f=/a/g.flags!==void 0,n=function(o){var P=[];return o.forEach(function(T){return P.push(T)}),P},e=function(o){var P=[];return o.forEach(function(T,M){return P.push([M,T])}),P},r=Object.is?Object.is:Hr(),d=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},y=Number.isNaN?Number.isNaN:Zr();function l(t){return t.call.bind(t)}var q=l(Object.prototype.hasOwnProperty),O=l(Object.prototype.propertyIsEnumerable),A=l(Object.prototype.toString),j=Se().types,u=j.isAnyArrayBuffer,p=j.isArrayBufferView,S=j.isDate,N=j.isMap,B=j.isRegExp,K=j.isSet,Y=j.isNativeError,V=j.isBoxedPrimitive,W=j.isNumberObject,te=j.isStringObject,Z=j.isBooleanObject,J=j.isBigIntObject,he=j.isSymbolObject,de=j.isFloat32Array,oe=j.isFloat64Array;function ye(t){if(t.length===0||t.length>10)return!0;for(var o=0;o<t.length;o++){var P=t.charCodeAt(o);if(P<48||P>57)return!0}return t.length===10&&t>=Math.pow(2,32)}function ce(t){return Object.keys(t).filter(ye).concat(d(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}/*!
|
|
49
49
|
* The buffer module from node.js, for the browser.
|
|
50
50
|
*
|
|
51
51
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
52
52
|
* @license MIT
|
|
53
|
-
*/function v(t,o){if(t===o)return 0;for(var P=t.length,T=o.length,M=0,$=Math.min(P,T);M<$;++M)if(t[M]!==o[M]){P=t[M],T=o[M];break}return P<T?-1:T<P?1:0}var w=!0,U=!1,x=0,C=1,a=2,i=3;function c(t,o){return f?t.source===o.source&&t.flags===o.flags:RegExp.prototype.toString.call(t)===RegExp.prototype.toString.call(o)}function R(t,o){if(t.byteLength!==o.byteLength)return!1;for(var P=0;P<t.byteLength;P++)if(t[P]!==o[P])return!1;return!0}function m(t,o){return t.byteLength!==o.byteLength?!1:v(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(o.buffer,o.byteOffset,o.byteLength))===0}function I(t,o){return t.byteLength===o.byteLength&&v(new Uint8Array(t),new Uint8Array(o))===0}function D(t,o){return W(t)?W(o)&&r(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(o)):te(t)?te(o)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(o):Z(t)?Z(o)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(o):J(t)?J(o)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(o):he(o)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(o)}function z(t,o,P,T){if(t===o)return t!==0?!0:P?r(t,o):!0;if(P){if(E(t)!=="object")return typeof t=="number"&&y(t)&&y(o);if(E(o)!=="object"||t===null||o===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(o))return!1}else{if(t===null||E(t)!=="object")return o===null||E(o)!=="object"?t==o:!1;if(o===null||E(o)!=="object")return!1}var M=A(t),$=A(o);if(M!==$)return!1;if(Array.isArray(t)){if(t.length!==o.length)return!1;var F=ce(t),G=ce(o);return F.length!==G.length?!1:X(t,o,P,T,C,F)}if(M==="[object Object]"&&(!N(t)&&N(o)||!K(t)&&K(o)))return!1;if(S(t)){if(!S(o)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(o))return!1}else if(B(t)){if(!B(o)||!c(t,o))return!1}else if(H(t)||t instanceof Error){if(t.message!==o.message||t.name!==o.name)return!1}else if(p(t)){if(!P&&(de(t)||oe(t))){if(!R(t,o))return!1}else if(!m(t,o))return!1;var Y=ce(t),Q=ce(o);return Y.length!==Q.length?!1:X(t,o,P,T,x,Y)}else{if(K(t))return!K(o)||t.size!==o.size?!1:X(t,o,P,T,a);if(N(t))return!N(o)||t.size!==o.size?!1:X(t,o,P,T,i);if(u(t)){if(!I(t,o))return!1}else if(V(t)&&!D(t,o))return!1}return X(t,o,P,T,x)}function k(t,o){return o.filter(function(P){return O(t,P)})}function X(t,o,P,T,M,$){if(arguments.length===5){$=Object.keys(t);var F=Object.keys(o);if($.length!==F.length)return!1}for(var G=0;G<$.length;G++)if(!q(o,$[G]))return!1;if(P&&arguments.length===5){var Y=d(t);if(Y.length!==0){var Q=0;for(G=0;G<Y.length;G++){var re=Y[G];if(O(t,re)){if(!O(o,re))return!1;$.push(re),Q++}else if(O(o,re))return!1}var Ee=d(o);if(Y.length!==Ee.length&&k(o,Ee).length!==Q)return!1}else{var be=d(o);if(be.length!==0&&k(o,be).length!==0)return!1}}if($.length===0&&(M===x||M===C&&t.length===0||t.size===0))return!0;if(T===void 0)T={val1:new Map,val2:new Map,position:0};else{var we=T.val1.get(t);if(we!==void 0){var fe=T.val2.get(o);if(fe!==void 0)return we===fe}T.position++}T.val1.set(t,T.position),T.val2.set(o,T.position);var me=ie(t,o,P,$,T,M);return T.val1.delete(t),T.val2.delete(o),me}function ee(t,o,P,T){for(var M=n(t),$=0;$<M.length;$++){var F=M[$];if(z(o,F,P,T))return t.delete(F),!0}return!1}function se(t){switch(E(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(y(t))return!1}return!0}function ge(t,o,P){var T=se(P);return T??(o.has(T)&&!t.has(T))}function le(t,o,P,T,M){var $=se(P);if($!=null)return $;var F=o.get($);return F===void 0&&!o.has($)||!z(T,F,!1,M)?!1:!t.has($)&&z(T,F,!1,M)}function ne(t,o,P,T){for(var M=null,$=n(t),F=0;F<$.length;F++){var G=$[F];if(E(G)==="object"&&G!==null)M===null&&(M=new Set),M.add(G);else if(!o.has(G)){if(P||!ge(t,o,G))return!1;M===null&&(M=new Set),M.add(G)}}if(M!==null){for(var Y=n(o),Q=0;Q<Y.length;Q++){var re=Y[Q];if(E(re)==="object"&&re!==null){if(!ee(M,re,P,T))return!1}else if(!P&&!t.has(re)&&!ee(M,re,P,T))return!1}return M.size===0}return!0}function ve(t,o,P,T,M,$){for(var F=n(t),G=0;G<F.length;G++){var Y=F[G];if(z(P,Y,M,$)&&z(T,o.get(Y),M,$))return t.delete(Y),!0}return!1}function Oe(t,o,P,T){for(var M=null,$=e(t),F=0;F<$.length;F++){var G=h($[F],2),Y=G[0],Q=G[1];if(E(Y)==="object"&&Y!==null)M===null&&(M=new Set),M.add(Y);else{var re=o.get(Y);if(re===void 0&&!o.has(Y)||!z(Q,re,P,T)){if(P||!le(t,o,Y,Q,T))return!1;M===null&&(M=new Set),M.add(Y)}}}if(M!==null){for(var Ee=e(o),be=0;be<Ee.length;be++){var we=h(Ee[be],2),fe=we[0],me=we[1];if(E(fe)==="object"&&fe!==null){if(!ve(M,t,fe,me,P,T))return!1}else if(!P&&(!t.has(fe)||!z(t.get(fe),me,!1,T))&&!ve(M,t,fe,me,!1,T))return!1}return M.size===0}return!0}function ie(t,o,P,T,M,$){var F=0;if($===a){if(!ne(t,o,P,M))return!1}else if($===i){if(!Oe(t,o,P,M))return!1}else if($===C)for(;F<t.length;F++)if(q(t,F)){if(!q(o,F)||!z(t[F],o[F],P,M))return!1}else{if(q(o,F))return!1;for(var G=Object.keys(t);F<G.length;F++){var Y=G[F];if(!q(o,Y)||!z(t[Y],o[Y],P,M))return!1}return G.length===Object.keys(o).length}for(F=0;F<T.length;F++){var Q=T[F];if(!z(t[Q],o[Q],P,M))return!1}return!0}function pe(t,o){return z(t,o,U)}function ue(t,o){return z(t,o,w)}return Le={isDeepEqual:pe,isDeepStrictEqual:ue},Le}var pr;function We(){if(pr)return Pe.exports;pr=1;function h(a){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},h(a)}function g(a,i,c){return Object.defineProperty(a,"prototype",{writable:!1}),a}function s(a,i){if(!(a instanceof i))throw new TypeError("Cannot call a class as a function")}var b=Ar(),_=b.codes,L=_.ERR_AMBIGUOUS_ARGUMENT,E=_.ERR_INVALID_ARG_TYPE,f=_.ERR_INVALID_ARG_VALUE,n=_.ERR_INVALID_RETURN_VALUE,e=_.ERR_MISSING_ARGS,r=Fr(),d=Se(),y=d.inspect,l=Se().types,q=l.isPromise,O=l.isRegExp,A=Gr()(),j=Xe()(),u=Tr()("RegExp.prototype.test"),p,S;function N(){var a=Wr();p=a.isDeepEqual,S=a.isDeepStrictEqual}var B=!1,K=Pe.exports=Z,H={};function V(a){throw a.message instanceof Error?a.message:new r(a)}function W(a,i,c,R,m){var I=arguments.length,D;if(I===0)D="Failed";else if(I===1)c=a,a=void 0;else{if(B===!1){B=!0;var z=ae.emitWarning?ae.emitWarning:console.warn.bind(console);z("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}I===2&&(R="!=")}if(c instanceof Error)throw c;var k={actual:a,expected:i,operator:R===void 0?"fail":R,stackStartFn:m||W};c!==void 0&&(k.message=c);var X=new r(k);throw D&&(X.message=D,X.generatedMessage=!0),X}K.fail=W,K.AssertionError=r;function te(a,i,c,R){if(!c){var m=!1;if(i===0)m=!0,R="No value argument passed to `assert.ok()`";else if(R instanceof Error)throw R;var I=new r({actual:c,expected:!0,message:R,operator:"==",stackStartFn:a});throw I.generatedMessage=m,I}}function Z(){for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];te.apply(void 0,[Z,i.length].concat(i))}K.ok=Z,K.equal=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");i!=c&&V({actual:i,expected:c,message:R,operator:"==",stackStartFn:a})},K.notEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");i==c&&V({actual:i,expected:c,message:R,operator:"!=",stackStartFn:a})},K.deepEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),p(i,c)||V({actual:i,expected:c,message:R,operator:"deepEqual",stackStartFn:a})},K.notDeepEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),p(i,c)&&V({actual:i,expected:c,message:R,operator:"notDeepEqual",stackStartFn:a})},K.deepStrictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),S(i,c)||V({actual:i,expected:c,message:R,operator:"deepStrictEqual",stackStartFn:a})},K.notDeepStrictEqual=J;function J(a,i,c){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),S(a,i)&&V({actual:a,expected:i,message:c,operator:"notDeepStrictEqual",stackStartFn:J})}K.strictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");j(i,c)||V({actual:i,expected:c,message:R,operator:"strictEqual",stackStartFn:a})},K.notStrictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");j(i,c)&&V({actual:i,expected:c,message:R,operator:"notStrictEqual",stackStartFn:a})};var he=g(function a(i,c,R){var m=this;s(this,a),c.forEach(function(I){I in i&&(R!==void 0&&typeof R[I]=="string"&&O(i[I])&&u(i[I],R[I])?m[I]=R[I]:m[I]=i[I])})});function de(a,i,c,R,m,I){if(!(c in a)||!S(a[c],i[c])){if(!R){var D=new he(a,m),z=new he(i,m,a),k=new r({actual:D,expected:z,operator:"deepStrictEqual",stackStartFn:I});throw k.actual=a,k.expected=i,k.operator=I.name,k}V({actual:a,expected:i,message:R,operator:I.name,stackStartFn:I})}}function oe(a,i,c,R){if(typeof i!="function"){if(O(i))return u(i,a);if(arguments.length===2)throw new E("expected",["Function","RegExp"],i);if(h(a)!=="object"||a===null){var m=new r({actual:a,expected:i,message:c,operator:"deepStrictEqual",stackStartFn:R});throw m.operator=R.name,m}var I=Object.keys(i);if(i instanceof Error)I.push("name","message");else if(I.length===0)throw new f("error",i,"may not be an empty object");return p===void 0&&N(),I.forEach(function(D){typeof a[D]=="string"&&O(i[D])&&u(i[D],a[D])||de(a,i,D,c,I,R)}),!0}return i.prototype!==void 0&&a instanceof i?!0:Error.isPrototypeOf(i)?!1:i.call({},a)===!0}function ye(a){if(typeof a!="function")throw new E("fn","Function",a);try{a()}catch(i){return i}return H}function ce(a){return q(a)||a!==null&&h(a)==="object"&&typeof a.then=="function"&&typeof a.catch=="function"}function v(a){return Promise.resolve().then(function(){var i;if(typeof a=="function"){if(i=a(),!ce(i))throw new n("instance of Promise","promiseFn",i)}else if(ce(a))i=a;else throw new E("promiseFn",["Function","Promise"],a);return Promise.resolve().then(function(){return i}).then(function(){return H}).catch(function(c){return c})})}function w(a,i,c,R){if(typeof c=="string"){if(arguments.length===4)throw new E("error",["Object","Error","Function","RegExp"],c);if(h(i)==="object"&&i!==null){if(i.message===c)throw new L("error/message",'The error message "'.concat(i.message,'" is identical to the message.'))}else if(i===c)throw new L("error/message",'The error "'.concat(i,'" is identical to the message.'));R=c,c=void 0}else if(c!=null&&h(c)!=="object"&&typeof c!="function")throw new E("error",["Object","Error","Function","RegExp"],c);if(i===H){var m="";c&&c.name&&(m+=" (".concat(c.name,")")),m+=R?": ".concat(R):".";var I=a.name==="rejects"?"rejection":"exception";V({actual:void 0,expected:c,operator:a.name,message:"Missing expected ".concat(I).concat(m),stackStartFn:a})}if(c&&!oe(i,c,R,a))throw i}function U(a,i,c,R){if(i!==H){if(typeof c=="string"&&(R=c,c=void 0),!c||oe(i,c)){var m=R?": ".concat(R):".",I=a.name==="doesNotReject"?"rejection":"exception";V({actual:i,expected:c,operator:a.name,message:"Got unwanted ".concat(I).concat(m,`
|
|
54
|
-
`)+'Actual message: "'.concat(i&&i.message,'"'),stackStartFn:a})}throw i}}K.throws=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),
|
|
53
|
+
*/function v(t,o){if(t===o)return 0;for(var P=t.length,T=o.length,M=0,$=Math.min(P,T);M<$;++M)if(t[M]!==o[M]){P=t[M],T=o[M];break}return P<T?-1:T<P?1:0}var m=!0,U=!1,x=0,C=1,a=2,i=3;function c(t,o){return f?t.source===o.source&&t.flags===o.flags:RegExp.prototype.toString.call(t)===RegExp.prototype.toString.call(o)}function R(t,o){if(t.byteLength!==o.byteLength)return!1;for(var P=0;P<t.byteLength;P++)if(t[P]!==o[P])return!1;return!0}function w(t,o){return t.byteLength!==o.byteLength?!1:v(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(o.buffer,o.byteOffset,o.byteLength))===0}function I(t,o){return t.byteLength===o.byteLength&&v(new Uint8Array(t),new Uint8Array(o))===0}function D(t,o){return W(t)?W(o)&&r(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(o)):te(t)?te(o)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(o):Z(t)?Z(o)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(o):J(t)?J(o)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(o):he(o)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(o)}function z(t,o,P,T){if(t===o)return t!==0?!0:P?r(t,o):!0;if(P){if(E(t)!=="object")return typeof t=="number"&&y(t)&&y(o);if(E(o)!=="object"||t===null||o===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(o))return!1}else{if(t===null||E(t)!=="object")return o===null||E(o)!=="object"?t==o:!1;if(o===null||E(o)!=="object")return!1}var M=A(t),$=A(o);if(M!==$)return!1;if(Array.isArray(t)){if(t.length!==o.length)return!1;var F=ce(t),G=ce(o);return F.length!==G.length?!1:X(t,o,P,T,C,F)}if(M==="[object Object]"&&(!N(t)&&N(o)||!K(t)&&K(o)))return!1;if(S(t)){if(!S(o)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(o))return!1}else if(B(t)){if(!B(o)||!c(t,o))return!1}else if(Y(t)||t instanceof Error){if(t.message!==o.message||t.name!==o.name)return!1}else if(p(t)){if(!P&&(de(t)||oe(t))){if(!R(t,o))return!1}else if(!w(t,o))return!1;var H=ce(t),Q=ce(o);return H.length!==Q.length?!1:X(t,o,P,T,x,H)}else{if(K(t))return!K(o)||t.size!==o.size?!1:X(t,o,P,T,a);if(N(t))return!N(o)||t.size!==o.size?!1:X(t,o,P,T,i);if(u(t)){if(!I(t,o))return!1}else if(V(t)&&!D(t,o))return!1}return X(t,o,P,T,x)}function k(t,o){return o.filter(function(P){return O(t,P)})}function X(t,o,P,T,M,$){if(arguments.length===5){$=Object.keys(t);var F=Object.keys(o);if($.length!==F.length)return!1}for(var G=0;G<$.length;G++)if(!q(o,$[G]))return!1;if(P&&arguments.length===5){var H=d(t);if(H.length!==0){var Q=0;for(G=0;G<H.length;G++){var re=H[G];if(O(t,re)){if(!O(o,re))return!1;$.push(re),Q++}else if(O(o,re))return!1}var Ee=d(o);if(H.length!==Ee.length&&k(o,Ee).length!==Q)return!1}else{var be=d(o);if(be.length!==0&&k(o,be).length!==0)return!1}}if($.length===0&&(M===x||M===C&&t.length===0||t.size===0))return!0;if(T===void 0)T={val1:new Map,val2:new Map,position:0};else{var me=T.val1.get(t);if(me!==void 0){var fe=T.val2.get(o);if(fe!==void 0)return me===fe}T.position++}T.val1.set(t,T.position),T.val2.set(o,T.position);var we=ie(t,o,P,$,T,M);return T.val1.delete(t),T.val2.delete(o),we}function ee(t,o,P,T){for(var M=n(t),$=0;$<M.length;$++){var F=M[$];if(z(o,F,P,T))return t.delete(F),!0}return!1}function se(t){switch(E(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(y(t))return!1}return!0}function ge(t,o,P){var T=se(P);return T??(o.has(T)&&!t.has(T))}function le(t,o,P,T,M){var $=se(P);if($!=null)return $;var F=o.get($);return F===void 0&&!o.has($)||!z(T,F,!1,M)?!1:!t.has($)&&z(T,F,!1,M)}function ne(t,o,P,T){for(var M=null,$=n(t),F=0;F<$.length;F++){var G=$[F];if(E(G)==="object"&&G!==null)M===null&&(M=new Set),M.add(G);else if(!o.has(G)){if(P||!ge(t,o,G))return!1;M===null&&(M=new Set),M.add(G)}}if(M!==null){for(var H=n(o),Q=0;Q<H.length;Q++){var re=H[Q];if(E(re)==="object"&&re!==null){if(!ee(M,re,P,T))return!1}else if(!P&&!t.has(re)&&!ee(M,re,P,T))return!1}return M.size===0}return!0}function ve(t,o,P,T,M,$){for(var F=n(t),G=0;G<F.length;G++){var H=F[G];if(z(P,H,M,$)&&z(T,o.get(H),M,$))return t.delete(H),!0}return!1}function Oe(t,o,P,T){for(var M=null,$=e(t),F=0;F<$.length;F++){var G=h($[F],2),H=G[0],Q=G[1];if(E(H)==="object"&&H!==null)M===null&&(M=new Set),M.add(H);else{var re=o.get(H);if(re===void 0&&!o.has(H)||!z(Q,re,P,T)){if(P||!le(t,o,H,Q,T))return!1;M===null&&(M=new Set),M.add(H)}}}if(M!==null){for(var Ee=e(o),be=0;be<Ee.length;be++){var me=h(Ee[be],2),fe=me[0],we=me[1];if(E(fe)==="object"&&fe!==null){if(!ve(M,t,fe,we,P,T))return!1}else if(!P&&(!t.has(fe)||!z(t.get(fe),we,!1,T))&&!ve(M,t,fe,we,!1,T))return!1}return M.size===0}return!0}function ie(t,o,P,T,M,$){var F=0;if($===a){if(!ne(t,o,P,M))return!1}else if($===i){if(!Oe(t,o,P,M))return!1}else if($===C)for(;F<t.length;F++)if(q(t,F)){if(!q(o,F)||!z(t[F],o[F],P,M))return!1}else{if(q(o,F))return!1;for(var G=Object.keys(t);F<G.length;F++){var H=G[F];if(!q(o,H)||!z(t[H],o[H],P,M))return!1}return G.length===Object.keys(o).length}for(F=0;F<T.length;F++){var Q=T[F];if(!z(t[Q],o[Q],P,M))return!1}return!0}function pe(t,o){return z(t,o,U)}function ue(t,o){return z(t,o,m)}return Le={isDeepEqual:pe,isDeepStrictEqual:ue},Le}var pr;function We(){if(pr)return Pe.exports;pr=1;function h(a){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},h(a)}function g(a,i,c){return Object.defineProperty(a,"prototype",{writable:!1}),a}function s(a,i){if(!(a instanceof i))throw new TypeError("Cannot call a class as a function")}var b=Ar(),_=b.codes,L=_.ERR_AMBIGUOUS_ARGUMENT,E=_.ERR_INVALID_ARG_TYPE,f=_.ERR_INVALID_ARG_VALUE,n=_.ERR_INVALID_RETURN_VALUE,e=_.ERR_MISSING_ARGS,r=Fr(),d=Se(),y=d.inspect,l=Se().types,q=l.isPromise,O=l.isRegExp,A=Gr()(),j=Xe()(),u=Tr()("RegExp.prototype.test"),p,S;function N(){var a=Wr();p=a.isDeepEqual,S=a.isDeepStrictEqual}var B=!1,K=Pe.exports=Z,Y={};function V(a){throw a.message instanceof Error?a.message:new r(a)}function W(a,i,c,R,w){var I=arguments.length,D;if(I===0)D="Failed";else if(I===1)c=a,a=void 0;else{if(B===!1){B=!0;var z=ae.emitWarning?ae.emitWarning:console.warn.bind(console);z("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}I===2&&(R="!=")}if(c instanceof Error)throw c;var k={actual:a,expected:i,operator:R===void 0?"fail":R,stackStartFn:w||W};c!==void 0&&(k.message=c);var X=new r(k);throw D&&(X.message=D,X.generatedMessage=!0),X}K.fail=W,K.AssertionError=r;function te(a,i,c,R){if(!c){var w=!1;if(i===0)w=!0,R="No value argument passed to `assert.ok()`";else if(R instanceof Error)throw R;var I=new r({actual:c,expected:!0,message:R,operator:"==",stackStartFn:a});throw I.generatedMessage=w,I}}function Z(){for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];te.apply(void 0,[Z,i.length].concat(i))}K.ok=Z,K.equal=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");i!=c&&V({actual:i,expected:c,message:R,operator:"==",stackStartFn:a})},K.notEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");i==c&&V({actual:i,expected:c,message:R,operator:"!=",stackStartFn:a})},K.deepEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),p(i,c)||V({actual:i,expected:c,message:R,operator:"deepEqual",stackStartFn:a})},K.notDeepEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),p(i,c)&&V({actual:i,expected:c,message:R,operator:"notDeepEqual",stackStartFn:a})},K.deepStrictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),S(i,c)||V({actual:i,expected:c,message:R,operator:"deepStrictEqual",stackStartFn:a})},K.notDeepStrictEqual=J;function J(a,i,c){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),S(a,i)&&V({actual:a,expected:i,message:c,operator:"notDeepStrictEqual",stackStartFn:J})}K.strictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");j(i,c)||V({actual:i,expected:c,message:R,operator:"strictEqual",stackStartFn:a})},K.notStrictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");j(i,c)&&V({actual:i,expected:c,message:R,operator:"notStrictEqual",stackStartFn:a})};var he=g(function a(i,c,R){var w=this;s(this,a),c.forEach(function(I){I in i&&(R!==void 0&&typeof R[I]=="string"&&O(i[I])&&u(i[I],R[I])?w[I]=R[I]:w[I]=i[I])})});function de(a,i,c,R,w,I){if(!(c in a)||!S(a[c],i[c])){if(!R){var D=new he(a,w),z=new he(i,w,a),k=new r({actual:D,expected:z,operator:"deepStrictEqual",stackStartFn:I});throw k.actual=a,k.expected=i,k.operator=I.name,k}V({actual:a,expected:i,message:R,operator:I.name,stackStartFn:I})}}function oe(a,i,c,R){if(typeof i!="function"){if(O(i))return u(i,a);if(arguments.length===2)throw new E("expected",["Function","RegExp"],i);if(h(a)!=="object"||a===null){var w=new r({actual:a,expected:i,message:c,operator:"deepStrictEqual",stackStartFn:R});throw w.operator=R.name,w}var I=Object.keys(i);if(i instanceof Error)I.push("name","message");else if(I.length===0)throw new f("error",i,"may not be an empty object");return p===void 0&&N(),I.forEach(function(D){typeof a[D]=="string"&&O(i[D])&&u(i[D],a[D])||de(a,i,D,c,I,R)}),!0}return i.prototype!==void 0&&a instanceof i?!0:Error.isPrototypeOf(i)?!1:i.call({},a)===!0}function ye(a){if(typeof a!="function")throw new E("fn","Function",a);try{a()}catch(i){return i}return Y}function ce(a){return q(a)||a!==null&&h(a)==="object"&&typeof a.then=="function"&&typeof a.catch=="function"}function v(a){return Promise.resolve().then(function(){var i;if(typeof a=="function"){if(i=a(),!ce(i))throw new n("instance of Promise","promiseFn",i)}else if(ce(a))i=a;else throw new E("promiseFn",["Function","Promise"],a);return Promise.resolve().then(function(){return i}).then(function(){return Y}).catch(function(c){return c})})}function m(a,i,c,R){if(typeof c=="string"){if(arguments.length===4)throw new E("error",["Object","Error","Function","RegExp"],c);if(h(i)==="object"&&i!==null){if(i.message===c)throw new L("error/message",'The error message "'.concat(i.message,'" is identical to the message.'))}else if(i===c)throw new L("error/message",'The error "'.concat(i,'" is identical to the message.'));R=c,c=void 0}else if(c!=null&&h(c)!=="object"&&typeof c!="function")throw new E("error",["Object","Error","Function","RegExp"],c);if(i===Y){var w="";c&&c.name&&(w+=" (".concat(c.name,")")),w+=R?": ".concat(R):".";var I=a.name==="rejects"?"rejection":"exception";V({actual:void 0,expected:c,operator:a.name,message:"Missing expected ".concat(I).concat(w),stackStartFn:a})}if(c&&!oe(i,c,R,a))throw i}function U(a,i,c,R){if(i!==Y){if(typeof c=="string"&&(R=c,c=void 0),!c||oe(i,c)){var w=R?": ".concat(R):".",I=a.name==="doesNotReject"?"rejection":"exception";V({actual:i,expected:c,operator:a.name,message:"Got unwanted ".concat(I).concat(w,`
|
|
54
|
+
`)+'Actual message: "'.concat(i&&i.message,'"'),stackStartFn:a})}throw i}}K.throws=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];m.apply(void 0,[a,ye(i)].concat(R))},K.rejects=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];return v(i).then(function(I){return m.apply(void 0,[a,I].concat(R))})},K.doesNotThrow=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];U.apply(void 0,[a,ye(i)].concat(R))},K.doesNotReject=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];return v(i).then(function(I){return U.apply(void 0,[a,I].concat(R))})},K.ifError=function a(i){if(i!=null){var c="ifError got unwanted exception: ";h(i)==="object"&&typeof i.message=="string"?i.message.length===0&&i.constructor?c+=i.constructor.name:c+=i.message:c+=y(i);var R=new r({actual:i,expected:null,operator:"ifError",message:c,stackStartFn:a}),w=i.stack;if(typeof w=="string"){var I=w.split(`
|
|
55
55
|
`);I.shift();for(var D=R.stack.split(`
|
|
56
56
|
`),z=0;z<I.length;z++){var k=D.indexOf(I[z]);if(k!==-1){D=D.slice(0,k);break}}R.stack="".concat(D.join(`
|
|
57
57
|
`),`
|
|
58
58
|
`).concat(I.join(`
|
|
59
|
-
`))}throw R}};function x(a,i,c,R,
|
|
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:m,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,wr;function nt(){if(wr)return He;wr=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,mr;function ut(){if(mr)return Ze;mr=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};
|
|
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,Y=S-1;(B!==0||K<j)&&Y!==-1;Y--,K++)B+=256*N[Y]>>>0,N[Y]=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 Y=p-u;Y!==p&&S[Y]===0;)Y++;var V=h.allocUnsafe(j+(p-Y));V.fill(0,0,j);for(var W=j;Y!==p;)V[W++]=S[Y++];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 He,Er;function tt(){return Er||(Er=1,He=et()(rt())),He}var Ye,mr;function nt(){if(mr)return Ye;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,Ye=r,Ye}var Ze,wr;function ft(){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),Y=b(y),{pk:V=n.KeyType.ED25519}=Y;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,Y)}},Ze}export{ft as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DnR6WYuU.js";import{r as h}from"./vendor-react-CTtPmzVP.js";import{
|
|
1
|
+
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DnR6WYuU.js";import{r as h}from"./vendor-react-CTtPmzVP.js";import{b8 as S,F as p}from"./vendor-ux-B0gV9NvH.js";import{a as C}from"./page-header-CHAwrgX-.js";import{Y as g}from"./index-CQgzjKgB.js";import{o as b}from"./vendor-arcblock-Cnwtqa7s.js";import{u as k}from"./config-space-B6_f52sE.js";import{C as y,D as v,a as w}from"./connect-to-Djgj6TLg.js";import{S as c}from"./step-actions-B1ufIDaK.js";import{S as E}from"./layout-Be1KH57_.js";import"./vendor-utils-DCMKu06e.js";import"./vendor-hooks-BQWlJm53.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BdZ_Rv3s.js";import"./api-DwxIBXZs.js";import"./index-BNhv-9xy.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-1HKgA-fz.js";import"./index-DBs9Ljax.js";import"./use-mobile-D5clNlrm.js";import"./content-layout-DmSBGGVm.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{T as default};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak as N,T as Q,U as ke,y as Fe,bk as Ve,b$ as Re,bX as Te,a5 as Ie,Q as Ce,dH as Pe,aN as Ee,a6 as Ge,D as Qe,cD as ht,ad as Xe,e4 as gt,e5 as xt,at as ae,b4 as He,n as bt,J as yt,x as jt,bZ as St,M as qe,cB as vt}from"./vendor-mui-core-DnR6WYuU.js";import{e as ee,l as Ct,v as pe}from"./vendor-utils-DCMKu06e.js";import{W as q,b9 as Nt,V as Y,df as wt,m as Ye,$ as Ze,F as Ae,b2 as Je,bD as be,aZ as Rt,bb as Tt,bj as It,bt as Et}from"./vendor-ux-B0gV9NvH.js";import{Z as At,Q as H,c as E,C as Dt,a1 as Ue}from"./index-CQgzjKgB.js";import{a as X,g as De}from"./vendor-hooks-BQWlJm53.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-BWDWEkUF.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-CHI1rCEg.js";import{i as Pt,e as _t,N as Bt}from"./team-DDjNXwXE.js";import{W as zt}from"./did-address-CsOJBoiY.js";import{p as st}from"./util-DuMKfKo8.js";import{D as Wt,g as Mt}from"./traffic-mcbpWOFq.js";import{B as nt}from"./bundle-avatar-Cc_6nw01.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Cnwtqa7s.js";import"./server-logo-notext.svg-BLAdvsmP.js";import"./session-C2ZBRIpv.js";import"./isURL-CJRImg0N.js";import"./use-app-logo-BuyF983S.js";import"./base32-_D4eWUeh.js";import"./useAsyncRetry-BMmRgSGm.js";import"./useAsync-ZGLJQow7.js";import"./iframe-Dqu4MSyW.js";import"./index-Cp0b8q3A.js";import"./index-DBs9Ljax.js";import"./base-chart-DhxjAyBU.js";import"./index-BsohFwTm.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DafRMFLg.js";const at=x.createContext({}),{Provider:Kt,Consumer:Hs}=at;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=X(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},J=await n.getNotificationSendLog({input:se});return F(se),b(J.list),S(J.paging),J.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const Z={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Kt,{value:{notificationRecords:Z},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const qt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:qt[t],children:t})}const Ut=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=Ut(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Yt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=Y();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=it(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ve,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=Y(),m=it(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=Y(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Y();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const Jt=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Jt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ve,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Y(),l=Qe(),b=x.useMemo(()=>Ye(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,Z]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));U(o),Z(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},J=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Yt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Je,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:J,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
|
|
2
|
+
td.MuiTableCell-footer {
|
|
3
|
+
border: none !important;
|
|
4
|
+
}
|
|
5
|
+
.sent-status-cell {
|
|
6
|
+
.resend-btn {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
&:hover {
|
|
10
|
+
.resend-btn {
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,ss=ae.div`
|
|
16
|
+
padding: 8px 16px;
|
|
17
|
+
.check-title {
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
margin-bottom: 8px;
|
|
20
|
+
&::first-letter {
|
|
21
|
+
text-transform: uppercase;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.check-item {
|
|
25
|
+
svg {
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
}
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
}
|
|
30
|
+
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ns(t){const{wallet:s,push:n,email:r,webhook:i}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...i.total>0?[{name:"Webhook",value:e.jsx(de,{item:i,isWebhook:!0})}]:[]]}function as(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ke.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=Y(),r=s?t.success.length:t.success,i=t.total,l=r===i?"success":"failed";return e.jsx(N,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(i)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=E.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=Y(),{success:b,failed:m,pending:S}=s,h=Zt(t),y=n?b.length:b,v=n?m.length:m,P=n?S.length:S,F=async L=>{L.stopPropagation();const k=n?[...new Set([...b,...m].map($=>$))]:[];await r([t],[],!0,k)},w=y+v,U=w>0?y/w*100:0,M=w>0?v/w*100:0;return e.jsxs(is,{successRatio:U,failedRatio:M,children:[e.jsxs(Q,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(Q,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(v)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(P)," ",l("notification.sendStatus.pending")]})]}),v>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:F,children:l("notification.resend")})})]})]})}function Ke({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const i=X(()=>s==="simple"?ns(t):as(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(et,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(He,{container:!0,spacing:2,children:i.map(l=>e.jsx(He,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const is=ae(N)`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
padding: 16px;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
background: ${({successRatio:t,failedRatio:s,theme:n})=>t===0&&s===0?n.palette.grey[300]:`linear-gradient(to right, ${bt(n.palette.success.light,.4)} ${t}%, ${n.palette.grey[100]} ${t}%)`};
|
|
37
|
+
transition: 'background 0.5s ease';
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
.unsent-area {
|
|
40
|
+
width: 100%;
|
|
41
|
+
position: relative;
|
|
42
|
+
.resend-btn {
|
|
43
|
+
position: absolute;
|
|
44
|
+
right: 0;
|
|
45
|
+
bottom: 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;ut.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ut({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=Y(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=X(()=>b(t.componentDid)||n,[n,t.componentDid]),v=De({tab:r||"info"}),P=x.useCallback(async(p,g,T=!0,D=[])=>{if(!p.length||!t.id)return;const O=g.length>0?g:t?.receivers?.map(_=>_.receiver);if(!O.length)return;let z=[...p];if(z.includes(E.NOTIFICATION_SEND_CHANNEL.PUSH)&&!rt(n)&&(q.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.PUSH)),z.includes(E.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ot(n)&&(q.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!z.length)try{h(!0),await m({notificationId:t.id,receivers:O,channels:z,resendFailedOnly:T,...z.includes("webhook")&&D.length?{webhookUrls:D}:{}}),q.success("Message has been sent!")}catch(_){console.error("handleResend error",{error:_}),q.error(_.response?_.response.statusText:_.message)}finally{h(!1)}},[n,t.id,t?.receivers,m,i]),F=X(()=>Pt(t),[t]),w=X(()=>_t(t),[t]),U=X(()=>F?t?.actorInfo:[],[t]),M=X(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(Ot,{actors:U,teamDid:M,size:32,showName:!0}):e.jsx(Lt,{size:32,blocklet:y,showName:!0,hideDot:!0})},{name:i("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:i("notification.body"),value:F?e.jsx(kt,{notification:t,blocklet:n}):e.jsx(Bt,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(It,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(et,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const k={info:{label:i("common.basicInfo"),value:"info",component:L},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},$=Object.values(k).map(({label:p,value:g})=>({label:p,value:g})),V=k[v.tab]||k.info,Z=p=>{v.tab=p};return e.jsx(Rt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{v.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(rs,{children:[e.jsx(N,{className:"tabs",sx:{mx:3},children:e.jsx(Tt,{tabs:$,current:v.tab,onChange:Z,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[v.tab==="receivers"&&e.jsx(es,{notificationId:t.id,resending:S,handleResend:P}),v.tab==="statistics"&&e.jsx(Ke,{statistics:t.statistics,mode:"detail",resending:S,onResend:P}),v.tab==="info"&&e.jsx(V.component,{})]})]})})}const os=x.memo(ut),rs=ae.div`
|
|
49
|
+
& > .notification-row {
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tabs {
|
|
54
|
+
margin: 0;
|
|
55
|
+
}
|
|
56
|
+
.body {
|
|
57
|
+
margin-top: 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.channel-item {
|
|
61
|
+
display: flex;
|
|
62
|
+
padding: 4px;
|
|
63
|
+
justify-content: flex-start;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
> p {
|
|
67
|
+
font-size: 15px;
|
|
68
|
+
}
|
|
69
|
+
.resend-btn {
|
|
70
|
+
svg {
|
|
71
|
+
font-size: 16px;
|
|
72
|
+
}
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
&.disabled {
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
color: ${be.text.disabled};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;ve.propTypes={blocklet:d.object,label:d.string};const ls=ae.div`
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-items: flex-start;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
.name {
|
|
89
|
+
display: block;
|
|
90
|
+
max-width: 260px;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
}
|
|
95
|
+
`;function ve({blocklet:t=null,label:s=""}){return e.jsx(ls,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(nt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}pt.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function pt({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function cs(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ds({customTableButtons:t}){const{t:s,locale:n}=Y(),r=Qe(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Ye(r,lt()),[r]),[b,m]=x.useState(!1),{data:S,paging:h,blocklet:y,fetch:v,getComponent:P,componentDids:F,inService:w,teamDid:U}=_e(),M=x.useRef(null),[L,k]=x.useState(null),[$,V]=x.useState("info"),Z=`notification-records-${y.meta?.did}`,p=Et(Z),[g,T]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),D=X(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;F.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[F,y]),O=async f=>{try{m(!0),await v(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{O(g)},[g]),x.useEffect(()=>{const f=S.find(u=>u.id===L?.id);L&&f&&k({...f})},[S]);const z=(f,u,j,I)=>{f.stopPropagation();const A=j.filter(R=>R!==u);T(R=>({...R,[I]:A,page:1}))},_=({page:f,rowsPerPage:u,filterList:j})=>{const[I=[],,,,A=[]]=j;g.pageSize!==u?T(R=>({...R,pageSize:u,page:1})):g.page!==f+1?T(R=>({...R,page:f+1})):pe(g.dids,I)?pe(g.severities,A)||T(R=>({...R,severities:A,page:1})):T(R=>({...R,dids:I,page:1}))},ie=x.useCallback(()=>{k(null),V("info")},[]),se=x.useCallback(()=>{v(g)},[v,g]),J=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=D.find(A=>(A.did||A.meta?.did)===u);return e.jsx(ve,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(f,u,j)=>(f[j].splice(u,1),f)},filterOptions:{names:D,logic:(f,u)=>u.length?!u.includes(f):!1,display:(f,u,j,I)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[j],renderValue:A=>e.jsx(N,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:A.map(R=>{if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const re=D.find(ne=>(ne.did||ne.meta?.did)===R);return e.jsx(ve,{blocklet:re,label:re?.title||re?.meta?.title},R)})}),onChange:A=>{f[j]=A.target.value,u(f[j],j,I)},children:[e.jsx(qe,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(qe,{value:R,children:e.jsx(ve,{blocklet:A,label:A.title||A.meta?.title})},R)})]})]})},customBodyRenderLite:f=>{const u=S[f],j=P(u.componentDid);return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(nt,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Ft,{blocklet:y,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||y?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f],{receivers:j}=u;return e.jsx(vt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:I=>{I.stopPropagation(),k(u),V("receivers")},children:j.map(I=>{const{receiverUser:A}=I,R=st(A.avatar,U,w);return e.jsx(Ze,{alt:A.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(N,{onClick:j=>{j.stopPropagation(),k(u),V("statistics")},children:e.jsx(Ke,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const u=S[f];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:g.severities??[],customFilterListOptions:{render:f=>e.jsx(pt,{list:f,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),z(u,j,J[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:$e,fullWidth:!0,logic:je,display:(f,u,j,I)=>e.jsx(cs,{label:s("notification.severity"),filterList:f,onChange:u,index:j,column:I,filterValues:$e})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:u}=S[f];return e.jsx(tt,{value:u,locale:n,shouldUpdate:!0})}}}],oe=f=>{T(u=>({...u,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(N,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(us,{isBreakpointsDownSm:i,children:e.jsx(Xe,{theme:l,children:e.jsx(Je,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:J,data:S,durable:Z,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...p,onRowClick:(f,{dataIndex:u})=>{k(S[u])}},title:e.jsx(ze,{value:g.dateRange,onChange:oe}),customButtons:Ne,components:{TableFilterList:f=>e.jsx(We,{...f,itemComponent:u=>e.jsx(Me,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),L&&e.jsx(os,{refresh:se,onCancel:ie,notification:L,blocklet:y,tab:$})]})}const us=ae.div`
|
|
96
|
+
td.MuiTableCell-footer {
|
|
97
|
+
border: none !important;
|
|
98
|
+
}
|
|
99
|
+
.sent-status-cell {
|
|
100
|
+
.resend-btn {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
&:hover {
|
|
104
|
+
.resend-btn {
|
|
105
|
+
display: flex;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.custom-toobar-btns {
|
|
111
|
+
gap: 4px;
|
|
112
|
+
}
|
|
113
|
+
.custom-toobar-title-inner {
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: ${({isBreakpointsDownSm:t})=>t?"space-between":"flex-end"};
|
|
116
|
+
padding-right: ${({isBreakpointsDownSm:t})=>t?"0":"8px"};
|
|
117
|
+
flex-wrap: wrap;
|
|
118
|
+
gap: 8px;
|
|
119
|
+
}
|
|
120
|
+
`;ps.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};function ps({blocklet:t={},customTableButtons:s=[]}){return e.jsx(Ht,{blocklet:t,children:e.jsx(ds,{customTableButtons:s})})}export{ps as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as x,ak as Q,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{a6 as K,a7 as y,ax as _,G as V,al as X,az as Y,av as ee,ar as te,g as oe,an as ie}from"./vendor-ux-B0gV9NvH.js";import{a as i,B as ne,b as v,f as se,g as ae,e as re}from"./vendor-hooks-BQWlJm53.js";import{c as f,n as le}from"./vendor-utils-DCMKu06e.js";import{a3 as B}from"./index-CQgzjKgB.js";function ce({blocklet:d,action:l,sourceAppPid:n,connectState:c,enableSwitchApp:t}){const s=o.use(B),p=i(()=>t===!0?!0:!(t===!1||s?.session?.user&&!["login","invite","connect-to-did-space","connect-to-did-domain"].includes(l)),[l,s?.session?.user]),D=i(()=>{if(f(n)){const a=K(d),h=y(d);if(a&&h?.appPid)return h.appPid}return n},[n,d]);return{appInfoList:i(()=>_(d).filter(a=>p?!0:f(n)?f(c.sourceAppPid)?s?.session?.user?a.sourceAppPid===s.session.user.sourceAppPid:a.sourceAppPid===D:a.sourceAppPid===c.sourceAppPid:a.sourceAppPid===n),[p,n,c.sourceAppPid,D,s?.session?.user]),autoGenerateSourceAppPid:D,canSwitchApp:p}}const pe={en:{generateError:"Request new QR Code failed",checkError:"Status check failed!",scanned:"Use your wallet to continue operation...",mfaCode:"We sent you a verification request on your DID Wallet, enter the digits below to confirm.",refresh:"Refresh",open:"Open in DID Wallet",openDidConnect:"Open DID Connect",error:"We encountered some errors when processing the request",invalidSessionStatus:"Invalid session status",success:"Success",wait:"Wait a second",waiting:"Waiting for next workflow to complete...",failed:"Failed",oops:"Oops",forbidden:"Login user and wallet user mismatch, please logout, then login to retry",webWallet:"Auth with Web Wallet",cancel:"Cancel",close:"Close",retry:"Retry",retryForbidden:"Please start this workflow from the beginning",getWallet:"Don't have the DID Wallet? Get it now.",back:"Back",connect:"Use the following to connect",connecting:"Connecting to your",connectingSuffix:"Or use the following to connect",connected:"Connected to your",busyTitle:"Busy",busyDesc:"Busy processing another DID Connect request",loginWithBefore:"Login with ",loginWithAfter:"",bindOAuth:"Bind third party login",bind:"Bind ",loginOAuthFailed:"Login with third party failed",loginWithAnotherAccount:"Login with another account",quickLoginDescription:"The following accounts have been detected in the current unified login environment. Click the following accounts to log in quickly.",quickLogin:"Login {appName} with {masterAppName} account",sessionFrom:"Session founded from {appName} blocklet",loginWithThisAccount:"Click to login with this account",chooseAccount:"Choose an account",lostPassport:"Lost your passport?",lostPassportTips:"If you have lost your passport, you can click here to claim back.",download:"Download",downloadTips:"Click to download DID Wallet if you don't have one",scanWithWallet1:"Scan with your",scanWithWallet2:" ",openInWallet:"Open in DID Wallet",webExtension:"Web Wallet Extension",connectButton:"Connect",switch:"Switch",requestConnect:"Requesting Connection",continueInWallet:"Please continue in {method}",loginWithBelow:"Login using the following methods",otherAccount:"Other account",DIDWalletPreviewTitle:"DID Wallet",DIDWalletPreviewDescription:"Scan this QR Code with DID Wallet.",DIDWalletWebPreviewTitle:"DID Wallet (Extension)",DIDWalletWebPreviewDescription:"Unleash Web3 with top security & privacy via auto sub-accounts in DID wallet",githubPreviewTitle:"GitHub",githubPreviewDescription:"Sign in with GitHub - Faster, more reliable, and convenient. Log in with your GitHub account in one click, simple and efficient.",googlePreviewTitle:"Google",googlePreviewDescription:"Sign in with Google - Faster, safer, easier. Sign in with Google with a single tap.",applePreviewTitle:"Apple",applePreviewDescription:"Sign in with Apple - The fast, easy way to sign in to apps and websites.",passkeyPreviewTitle:"Passkey",passkeyPreviewDescription:"Sign in with Passkey - More secure and convenient authentication. No passwords to remember, easily access apps and websites.",didConnectTitle:"DID Connect",didConnectDescription:"Decentralized identities and apps, W3C DID-based, future-ready.",noAuthenticationProvider:"No authentication provider configured",lastUsed:"Last Used"},zh:{generateError:"二维码生成失败",checkError:"扫码状态检查失败",scanned:"请到您的钱包上继续操作……",mfaCode:"我们给你的 DID Wallet 发送了一个二次验证请求,请输入下面的数字完成验证",refresh:"刷新",open:"在 DID Wallet 中打开",openDidConnect:"打开 DID Connect",error:"服务器开小差了!",invalidSessionStatus:"无效的会话状态",success:"成功",failed:"失败",wait:"请稍候",waiting:"正在等待下个流程完成...",forbidden:"登录用户和扫码用户不匹配,为保障安全,请退出后重新登录",oops:"哎呀",webWallet:"使用 Web Wallet 验证",cancel:"取消",close:"关闭",retry:"重试",retryForbidden:"请关闭当前弹窗并重新开始当前流程",getWallet:"还没有 DID Wallet? 现在下载.",back:"返回",connect:"请选择以下方式之一连接",connecting:"正在自动连接您的",connectingSuffix:"或选择以下方式手动连接",connected:"已连接您的",busyTitle:"钱包繁忙",busyDesc:"正在处理其他请求",loginWithBefore:"使用",loginWithAfter:"登录",bindOAuth:"绑定第三方登录",bind:"绑定",loginOAuthFailed:"第三方登录失败",loginWithAnotherAccount:"使用其他账户登录",quickLoginDescription:"检测到当前统一登录环境中已存在下列账户,点击以下账户,进行快捷登录",quickLogin:"使用 {masterAppName} 账户登录 {appName}",sessionFrom:"发现自 {appName} 应用",loginWithThisAccount:"点击使用此账号登录",chooseAccount:"选择一个账号",lostPassport:"找回通行证",lostPassportTips:"如果您丢失了登录通行证,您可以点击这里来找回。",download:"下载",downloadTips:"如果您还没有 DID Wallet,点击下载",scanWithWallet1:"使用",scanWithWallet2:"扫码二维码",openInWallet:"使用 DID Wallet 打开",webExtension:"浏览器插件",connectButton:"连接",switch:"切换",requestConnect:"正在请求连接",continueInWallet:"请在 {method} 中继续完成您的操作",loginWithBelow:"使用以下方式进行登录",otherAccount:"其他账号",DIDWalletPreviewTitle:"DID Connect",DIDWalletPreviewDescription:"请使用 DID Wallet 扫描二维码",DIDWalletWebPreviewTitle:"DID Wallet (Extension)",DIDWalletWebPreviewDescription:"使用 DID Wallet 自动创建子账户,保障 Web3 安全与隐私",githubPreviewTitle:"GitHub",githubPreviewDescription:"使用 GitHub 账户登录 - 更快捷、更可靠、更便捷。使用您的 GitHub 账号一键登录,简单高效。",googlePreviewTitle:"Google",googlePreviewDescription:"使用 Google 账户登录 - 更快捷、更安全、更轻松。使用 Google 账号登录,一点即达。",applePreviewTitle:"Apple",applePreviewDescription:"使用 Apple 账户登录 - 登录 App 和网站的快速、简单方法。",passkeyPreviewTitle:"Passkey",passkeyPreviewDescription:"使用 Passkey 账户登录 - 更安全、更便捷的身份验证方式。无需记忆密码,轻松登录各类应用和网站",didConnectTitle:"DID Connect",didConnectDescription:"面向未来的基于 W3C DID 去中心化身份和应用",noAuthenticationProvider:"未配置任何身份验证提供者",lastUsed:"上次使用"}},O=o.createContext({isWalletWebview:!1,isMobile:!1,matchSmallScreen:!1,blocklet:null}),{Provider:ue,Consumer:be}=O;function de({children:d,blocklet:l,masterBlocklet:n=void 0,action:c,extraParams:t={},locale:s="en",testOnlyBorderColor:p=void 0,...D}){const a=ne(),[h,L]=o.useState([]),[G,E]=o.useState(!1),[P,R]=o.useState(""),F=i(()=>new Map(h.map(e=>[e.name,e])),[h]),N=v(e=>F.get(e)),M=se(P),U=v((e,w={})=>V(pe,e,s,"en",w)),m=o.use(B),r=ae({sourceAppPid:void 0,status:"created",autoActiveWebview:!0,deeplink:void 0,chooseMethod:"",retryConnect:le}),j=o.useRef({cancelCount:0}),g=X(),{appInfoList:I,autoGenerateSourceAppPid:A,canSwitchApp:S}=ce({blocklet:l,connectState:r,action:c,sourceAppPid:t?.sourceAppPid,enableSwitchApp:t?.forceSwitch||t?.enableSwitchApp}),H=i(()=>{try{return localStorage.getItem(Y)}catch{return""}},[]),T=o.useRef(null),k=re(T),C=i(()=>(k?.width||0)<500,[k?.width]),W=i(()=>{if(S)return{...t,sourceAppPid:f(r.sourceAppPid)?A:r.sourceAppPid};const e=y(l)?.appPid,w=y(globalThis.blocklet)?.appPid;return m?.session?.user&&(e===w||!e)?f(t?.sourceAppPid)?{...t,sourceAppPid:m.session.user?.sourceAppPid}:t:{...t,sourceAppPid:A}},[S,t,r.sourceAppPid,c,A,m?.session?.user]),z=i(()=>{const e=window?.navigator?.userAgent;return e.indexOf("Edge")>-1||e.indexOf("Edg")>-1?"edge":e.indexOf("Chrome")>-1?"chrome":"unknown"},[]);o.useEffect(()=>{r.sourceAppPid=W.sourceAppPid},[W.sourceAppPid]);const $=v(e=>{r.status=e||"created"}),b=globalThis.blocklet?ee(l):globalThis.env,q=i(()=>{if(p)return p;const e=b.appPid,w=te(e),J=w?void 0:oe(e);return w?ie(e):J.color},[b.appId,p]),Z=i(()=>({isWalletWebview:g.wallet||g.arcSphere,isMobile:g.mobile.any,matchSmallScreen:C,connectState:r,staticState:j,reactiveState:r,appInfoList:I,extraParams:W,blocklet:l,masterBlocklet:n,browserBrand:z,currentAppInfo:b,currentAppColor:q,t:U,locale:s,action:c,changeStatus:$,getPlugin:N,latestActivePlugin:M,plugins:h,setPlugins:L,selectedPlugin:P,setSelectedPlugin:R,forceUpdate:a,showWalletOptions:G,setShowWalletOptions:E,lastLoginMethod:H}),[g.wallet,g.arcSphere,g.mobile.any,C,JSON.stringify(r),JSON.stringify(I),JSON.stringify(W),l,n,s,P,a,b,q]);return x.jsx(ue,{value:Z,children:x.jsx(Q,{...D,ref:T,children:d})})}de.propTypes={children:u.any.isRequired,blocklet:u.object.isRequired,masterBlocklet:u.object,action:u.string.isRequired,extraParams:u.object,locale:u.string,testOnlyBorderColor:u.string};function Pe(){return o.use(O)}const me={width:24,height:24,body:'<path fill="currentColor" d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.713T12 11q-.425 0-.713.288T11 12v4q0 .425.288.713T12 17Zm0-8q.425 0 .713-.288T13 8q0-.425-.288-.713T12 7q-.425 0-.713.288T11 8q0 .425.288.713T12 9Zm0 13q-2.075 0-3.9-.788t-3.175-2.137q-1.35-1.35-2.137-3.175T2 12q0-2.075.788-3.9t2.137-3.175q1.35-1.35 3.175-2.137T12 2q2.075 0 3.9.788t3.175 2.137q1.35 1.35 2.138 3.175T22 12q0 2.075-.788 3.9t-2.137 3.175q-1.35 1.35-3.175 2.138T12 22Zm0-2q3.35 0 5.675-2.325T20 12q0-3.35-2.325-5.675T12 4Q8.65 4 6.325 6.325T4 12q0 3.35 2.325 5.675T12 20Zm0-8Z"/>'};export{me as d,pe as e,de as m,Pe as x};
|