@abtnode/blocklet-services 1.17.5 → 1.17.6-beta-20251216-223535-283b9ffe
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/api/emails/_components/compose.js +1 -1
- package/api/libs/connect/session.js +7 -10
- package/api/routes/blocklet.js +2 -0
- package/api/routes/federated.js +2 -2
- package/api/services/auth/session.js +9 -6
- package/dist/assets/AdapterDayjs-DqOr9LFk.js +3 -0
- package/dist/assets/{Community-C7CFokDQ.js → Community-CELsDteM.js} +1 -1
- package/dist/assets/{Google-qCiUM9VP.js → Google-CQ1n6aSx.js} +1 -1
- package/dist/assets/{Holiday-DyVifdc-.js → Holiday-DOCjSYjH.js} +1 -1
- package/dist/assets/{Meeting-DbtUCCZq.js → Meeting-BAXt_LiK.js} +1 -1
- package/dist/assets/{OffSick-BtITykO3.js → OffSick-BGEr8Nkc.js} +1 -1
- package/dist/assets/{WorkingRemotely-mKvokr6L.js → WorkingRemotely-BcneAIXG.js} +1 -1
- package/dist/assets/{access-control-C6MQq9M9.js → access-control-LXesuJ2_.js} +2 -2
- package/dist/assets/actions-Dfiiwkit.js +1 -0
- package/dist/assets/{add-component-core-CFL73x1V.js → add-component-core-L7bwC_64.js} +1 -1
- package/dist/assets/add-resource-DeMXdPX_.js +1 -0
- package/dist/assets/addon-kaBWGHOu.js +14 -0
- package/dist/assets/{advanced-Djs25PXG.js → advanced-DOrtiTqV.js} +1 -1
- package/dist/assets/{aigne-WBAWm6yx.js → aigne-BuWtyQrV.js} +1 -1
- package/dist/assets/api-2a4FTO9k.js +1 -0
- package/dist/assets/appearance-DUs_om38.js +1 -0
- package/dist/assets/arrow-down.svg-C4FUKwt4.js +1 -0
- package/dist/assets/{audit-logs-CXjhDj8M.js → audit-logs-DUV4-vTj.js} +3 -3
- package/dist/assets/authorize-DC7FpxvU.js +1 -0
- package/dist/assets/{base-chart-BXspUQ5X.js → base-chart-CRe-9w5H.js} +1 -1
- package/dist/assets/{base32-E_M8YiDy.js → base32-BqL5pnrU.js} +1 -1
- package/dist/assets/{bind-account-N3cioth0.js → bind-account-DpXvkxLj.js} +1 -1
- package/dist/assets/{branding-B6_O9dwM.js → branding-BWncfl5y.js} +1 -1
- package/dist/assets/{branding-BN5xzu2K.js → branding-Btcz8N1M.js} +5 -5
- package/dist/assets/branding-DMOcia4y.js +1 -0
- package/dist/assets/bundle-avatar-BSv_e0lp.js +1 -0
- package/dist/assets/button-C2uxCAba.js +1 -0
- package/dist/assets/click-to-copy-03_3P1nz.js +1 -0
- package/dist/assets/cloneDeep-DqDclz1x.js +1 -0
- package/dist/assets/{collapse-DRXViE1U.js → collapse-B7gUzFaX.js} +1 -1
- package/dist/assets/{complete-DERkCyic.js → complete-AlcncYrN.js} +3 -3
- package/dist/assets/{component-BFEXoFyD.js → component-Bsd478Wd.js} +2 -2
- package/dist/assets/config-B8HbrPnF.js +53 -0
- package/dist/assets/{config-mfnTXE1f.js → config-BBXBmv_e.js} +2 -2
- package/dist/assets/{config-DBQhYXkx.js → config-CvvSF8W2.js} +1 -1
- package/dist/assets/{config-navigation-CL9YkEzl.js → config-navigation-BAqSkXxH.js} +8 -8
- package/dist/assets/config-space-DnDf6PO2.js +1 -0
- package/dist/assets/confirm-Dul9DyCY.js +7 -0
- package/dist/assets/{connect-DMt_37_e.js → connect-BRfx3zbS.js} +1 -1
- package/dist/assets/{connect-DXN8mBKc.js → connect-C1kqlbsb.js} +1 -1
- package/dist/assets/connect-to-DNZM_E4B.js +1 -0
- package/dist/assets/{content-layout-B5NObRcH.js → content-layout-DmSBGGVm.js} +1 -1
- package/dist/assets/{create-passport-svg-BwqsyTOz.js → create-passport-svg-Cs4mVLsE.js} +1 -1
- package/dist/assets/createClass-BRKh_6kd.js +1 -0
- package/dist/assets/{dashboard-DHhNID_3.js → dashboard-DHNx2Vjq.js} +8 -8
- package/dist/assets/{delete-confirm-DSQSBte5.js → delete-confirm-BT4RGlre.js} +1 -1
- package/dist/assets/{did-address-Qmm0nyiR.js → did-address-DpdRECuJ.js} +1 -1
- package/dist/assets/domain-Bc5sJ6GV.js +9 -0
- package/dist/assets/{domain-action-card-D9HXIIpd.js → domain-action-card-DaWxksqg.js} +2 -2
- package/dist/assets/domains-CGPUezw9.js +1 -0
- package/dist/assets/{edit.svg-Dz9cVo7r.js → edit.svg-RRSklUg-.js} +1 -1
- package/dist/assets/{email-DDHqRiNE.js → email-DsXuaICi.js} +2 -2
- package/dist/assets/{empty-spinner-0EAHJWBW.js → empty-spinner-BYDonf35.js} +1 -1
- package/dist/assets/engine-BaNtB6sW.js +1 -0
- package/dist/assets/exchange-passport-DDScDnbP.js +1 -0
- package/dist/assets/{form-C-ZRaynb.js → form-CmTyQIow.js} +3 -3
- package/dist/assets/form-text-input-CsXLsIFW.js +11 -0
- package/dist/assets/{form-wrapper-dz0PgYyA.js → form-wrapper-PT5ZzMQy.js} +1 -1
- package/dist/assets/fuel-BJDVWtLE.js +32 -0
- package/dist/assets/gen-access-key-Ftv91l1v.js +1 -0
- package/dist/assets/gen-simple-access-key-CWrV9bpF.js +1 -0
- package/dist/assets/get-safe-url-CqIO9371.js +1 -0
- package/dist/assets/{home-D8RPk4rl.js → home-CxNed9GY.js} +1 -1
- package/dist/assets/{iframe-DbxlfoSv.js → iframe-dmFx9kP7.js} +1 -1
- package/dist/assets/index-A-uhNQXl.js +1 -0
- package/dist/assets/{index-Dnont80V.js → index-B0Q9wWG1.js} +2 -2
- package/dist/assets/index-B4sVJOOj.js +1 -0
- package/dist/assets/{index-BIFlvVef.js → index-B6IM_Z38.js} +6 -6
- package/dist/assets/index-BKE6R9dc.js +1 -0
- package/dist/assets/index-BNiqMLPn.js +55 -0
- package/dist/assets/{index-B6QOO2yw.js → index-BWxvQ-Ka.js} +7 -7
- package/dist/assets/index-Bh8glecC.js +29 -0
- package/dist/assets/index-C0FXkPiP.js +62 -0
- package/dist/assets/{index-CmT6o_W4.js → index-C6LgIqoY.js} +5 -5
- package/dist/assets/{index-Bs5xamxm.js → index-CIJYNIAS.js} +2 -2
- package/dist/assets/{index-CIvZ7HIX.js → index-CRAuhYSg.js} +1 -1
- package/dist/assets/{index-BajjN1HU.js → index-CbTMv_sq.js} +6 -6
- package/dist/assets/{index-C0q1NhNR.js → index-CeGNmiXz.js} +1 -1
- package/dist/assets/{index-BjLM8Gon.js → index-CiQKtWIW.js} +1 -1
- package/dist/assets/index-CiYSV3ew.js +6 -0
- package/dist/assets/{index-BOiRUuPB.js → index-Ck7gs4Oo.js} +1 -1
- package/dist/assets/{index-CiQvt8QY.js → index-CmDzr29Q.js} +2 -2
- package/dist/assets/index-CqsKmRBp.js +1 -0
- package/dist/assets/index-CueIV4dA.js +11 -0
- package/dist/assets/{index-BXtrOI0G.js → index-D4Ik9OgC.js} +2 -2
- package/dist/assets/index-DGg3AL9l.js +1039 -0
- package/dist/assets/{index-CJBVOMty.js → index-DQFDP0zB.js} +4 -4
- package/dist/assets/{index-CAtE4xM9.js → index-DTKew0E_.js} +8 -8
- package/dist/assets/index-DVoa7OYS.js +1 -0
- package/dist/assets/{index-DK4Rvfj9.js → index-DZnXlBSX.js} +1 -1
- package/dist/assets/{index-bb4s-8hu.js → index-DjCd3BVH.js} +6 -6
- package/dist/assets/{index-BRGQOPmE.js → index-DriYV-w5.js} +1 -1
- package/dist/assets/{index-Ccjxs0wr.js → index-DzDWMabe.js} +14 -14
- package/dist/assets/index-NpB7Thbw.js +120 -0
- package/dist/assets/index-W43xyvqt.js +7 -0
- package/dist/assets/index-XVoTh0rZ.js +102 -0
- package/dist/assets/{index-BsA1v5Kx.js → index-_tncRnTu.js} +1 -1
- package/dist/assets/index-cWpptG8N.js +1 -0
- package/dist/assets/{index-CMec_woq.js → index-m1ZQT0sU.js} +1 -1
- package/dist/assets/{index.esm-DTmS4tth.js → index.esm-Co8ZxFyk.js} +1 -1
- package/dist/assets/{invitation-Cjg3Rgxl.js → invitation-DaAeUQvL.js} +6 -6
- package/dist/assets/invitations-DY6AII7i.js +3 -0
- package/dist/assets/invite-BfQp8T_i.js +1 -0
- package/dist/assets/{isURL-wZZwzwyC.js → isURL-HdHdFI5D.js} +2 -2
- package/dist/assets/issue-passport-BKAe--H8.js +1 -0
- package/dist/assets/{item-Bpf_gGYt.js → item-D8-oGTEp.js} +1 -1
- package/dist/assets/landing-page-DQd97swG.js +1 -0
- package/dist/assets/{launch-result-message-BTBdTioQ.js → launch-result-message-MNpx7ysR.js} +1 -1
- package/dist/assets/{layout-CZo9vMzc.js → layout-PDwTMZS3.js} +1 -1
- package/dist/assets/list-B9c3yQuf.js +2 -0
- package/dist/assets/list-DYFxkX2y.js +103 -0
- package/dist/assets/{list-header-BQo9L_6R.js → list-header-Cl3jykCe.js} +1 -1
- package/dist/assets/localization-XbNv70VN.js +1 -0
- package/dist/assets/{lock.svg-BPCZ0CT3.js → lock.svg-BgybwZNe.js} +1 -1
- package/dist/assets/{log-KsUeQx46.js → log-ClrACcuw.js} +1 -1
- package/dist/assets/logger-D3ELa8t7.js +1 -0
- package/dist/assets/login-C3CgZVaH.js +1 -0
- package/dist/assets/login-oauth-callback-DVq62YiP.js +1 -0
- package/dist/assets/logo-uploader-CPZeytzo.js +30 -0
- package/dist/assets/{lost-passport-DWR3ith-.js → lost-passport-rqbtayK0.js} +3 -3
- package/dist/assets/{lottie-react.esm-CD0xFBYg.js → lottie-react.esm-E4oo1jhL.js} +1 -1
- package/dist/assets/omit-5AwbF-Ja.js +1 -0
- package/dist/assets/{open-window-Ct_MP3Sx.js → open-window-B20A6mUS.js} +1 -1
- package/dist/assets/over-due-invoice-payment-Dpy6U-OB.js +1 -0
- package/dist/assets/{overview-5u7B_D_6.js → overview-DSMOnuTp.js} +2 -2
- package/dist/assets/{page-header-Cgwo2np-.js → page-header-CHAwrgX-.js} +1 -1
- package/dist/assets/passport-BeTGnBZp.js +1 -0
- package/dist/assets/passport-item-6fDG-tjs.js +1 -0
- package/dist/assets/{permission-BYxNrlaa.js → permission-CjBTXkmT.js} +1 -1
- package/dist/assets/preferences-YojWKSr3.js +1 -0
- package/dist/assets/profile-embed-CRKFFFmF.js +1 -0
- package/dist/assets/publish-resource-CXd42xoH.js +1 -0
- package/dist/assets/{question-mark-circle.svg-DK9nTUDZ.js → question-mark-circle.svg-CByEVDhb.js} +1 -1
- package/dist/assets/{raf-schd.esm-JNUhxcps.js → raf-schd.esm-XXBRsnmf.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Cvsu51oI.js → react-beautiful-dnd.esm-By1RE6ef.js} +1 -1
- package/dist/assets/{react-stripe.esm-Dqbe1A8R.js → react-stripe.esm-CVZErl8X.js} +1 -1
- package/dist/assets/{required-B0Gua-D1.js → required-BQln5OcV.js} +1 -1
- package/dist/assets/{revoke.svg-CuiCGfVW.js → revoke.svg-CNl4LAbv.js} +1 -1
- package/dist/assets/runtime-Ydt2KUZV.js +1 -0
- package/dist/assets/{sanitize-D6Abg5_T.js → sanitize-BOo6OPJZ.js} +1 -1
- package/dist/assets/sdk-BZuN1V4h.js +1 -0
- package/dist/assets/{section-BkMzBpvM.js → section-jXB9AxBb.js} +1 -1
- package/dist/assets/security-C6x1zjWI.js +22 -0
- package/dist/assets/{server-logo-notext.svg-DHxZ1bRk.js → server-logo-notext.svg-xZ-i1SpD.js} +1 -1
- package/dist/assets/session-Bavobyzn.js +1 -0
- package/dist/assets/setup-x3XlLP1U.js +24 -0
- package/dist/assets/{shorten-label-DhOty_4j.js → shorten-label-C4py9TLA.js} +1 -1
- package/dist/assets/{simple-select-D0q2J-Br.js → simple-select-DbXWLzPn.js} +1 -1
- package/dist/assets/{spaces-DM95DgFM.js → spaces-DKfk45f5.js} +1 -1
- package/dist/assets/{start-sucUqu8u.js → start-WYmvvJ-x.js} +5 -5
- package/dist/assets/{starting-progress-aMYWzin8.js → starting-progress-DbdtjHCx.js} +2 -2
- package/dist/assets/status-B7-tZFw7.js +1 -0
- package/dist/assets/{step-actions-nHHLzUFh.js → step-actions-BGJwIEbT.js} +1 -1
- package/dist/assets/studio-D7UNnkpz.js +6 -0
- package/dist/assets/{switch-control-BAyRLHvJ.js → switch-control-BDwQ53GS.js} +1 -1
- package/dist/assets/switch-wqsJ2qIA.js +1 -0
- package/dist/assets/{table-tips-BA9A3QDk.js → table-tips-BEPJMiqj.js} +1 -1
- package/dist/assets/team-D2fBm-il.js +146 -0
- package/dist/assets/traffic-BxfS8jav.js +1 -0
- package/dist/assets/transfer-C8A72tJr.js +16 -0
- package/dist/assets/unsubscribe-DOgxD7dQ.js +1 -0
- package/dist/assets/use-app-logo-BwsHVK-l.js +1 -0
- package/dist/assets/{use-mobile-Dwc30NoL.js → use-mobile-BINJTzMb.js} +1 -1
- package/dist/assets/{use-mobile-Vtj5nBdp.js → use-mobile-D5clNlrm.js} +1 -1
- package/dist/assets/{use-server-logo-BfNy3Xkj.js → use-server-logo-Cv1kAPgB.js} +1 -1
- package/dist/assets/use-window-close-edYntLdV.js +1 -0
- package/dist/assets/{useAsync-DNDhrs-2.js → useAsync-BSd-eaZO.js} +1 -1
- package/dist/assets/useAsync-DOpjtrvS.js +1 -0
- package/dist/assets/{useAsyncRetry-CSW1hopB.js → useAsyncRetry-v1aVMcV-.js} +1 -1
- package/dist/assets/useLocalStorage-8LihN_xG.js +1 -0
- package/dist/assets/{useSetState-cWrp7qoX.js → useSetState-L-f8mSga.js} +1 -1
- package/dist/assets/user-center-9ue_tdF_.js +125 -0
- package/dist/assets/user-follower-DXIC4btc.js +32 -0
- package/dist/assets/{util-BxX0TJKJ.js → util-CqIowTns.js} +1 -1
- package/dist/assets/{util-DSnAozzs.js → util-pUhbKKIP.js} +1 -1
- package/dist/assets/{vendor-arcblock-D4Rvz_D3.js → vendor-arcblock-DRfhQ9Yl.js} +1 -1
- package/dist/assets/{vendor-hooks-U4TTuKG0.js → vendor-hooks-DpqqC65c.js} +2 -2
- package/dist/assets/{vendor-mui-core-B5XNUjey.js → vendor-mui-core-DnR6WYuU.js} +2 -2
- package/dist/assets/{vendor-mui-x-DtPl0qBm.js → vendor-mui-x-CQc01l4r.js} +1 -1
- package/dist/assets/{vendor-react-CUXIiAnY.js → vendor-react-CTtPmzVP.js} +1 -1
- package/dist/assets/vendor-utils-BqKQizRf.js +213 -0
- package/dist/assets/{vendor-ux-BX9dSNUy.js → vendor-ux-KtPBvlG0.js} +7 -7
- package/dist/assets/{wait-connect-CCXiMHZY.js → wait-connect-BwtwczC4.js} +1 -1
- package/dist/assets/{wizard-TEBzHS-w.js → wizard-LT-uDnMP.js} +2 -2
- package/dist/assets/wizard-components-BmdyIe7R.js +52 -0
- package/dist/assets/wrap-locale-C-cgVToU.js +1 -0
- package/dist/assets/{zh-Dr9buZnV.js → zh-CSl2KD_S.js} +1 -1
- package/dist/assets/zh-DZyuEbhr.js +1 -0
- package/dist/assets/{zh-tw-CeXBj2i0.js → zh-tw-BiloxWNq.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +25 -2
- package/package.json +51 -51
- package/dist/assets/AdapterDayjs-p1MGZm94.js +0 -3
- package/dist/assets/actions-CiAs-6JM.js +0 -1
- package/dist/assets/add-resource-DVpeKvW6.js +0 -1
- package/dist/assets/addon-B5NG3IsS.js +0 -14
- package/dist/assets/api-Cjc501Es.js +0 -1
- package/dist/assets/appearance-CVS4AfPI.js +0 -1
- package/dist/assets/arrow-down.svg-Dhs0HydJ.js +0 -1
- package/dist/assets/authorize-uzVAAuOd.js +0 -1
- package/dist/assets/branding-BFn6p_xP.js +0 -1
- package/dist/assets/bundle-avatar-CfVy3gda.js +0 -1
- package/dist/assets/button-4KPacREM.js +0 -1
- package/dist/assets/click-to-copy-DXHOGoUP.js +0 -1
- package/dist/assets/cloneDeep-DjDct56M.js +0 -1
- package/dist/assets/config-CwbUhIlW.js +0 -57
- package/dist/assets/config-space-3dNLmLWy.js +0 -1
- package/dist/assets/confirm-BIsS5xyi.js +0 -7
- package/dist/assets/connect-to-D3C0j8V8.js +0 -1
- package/dist/assets/createClass-CkCf2FLT.js +0 -1
- package/dist/assets/domain-DcU9P4mp.js +0 -9
- package/dist/assets/domains-DVkGbWo7.js +0 -1
- package/dist/assets/engine-Cx3nUUOw.js +0 -1
- package/dist/assets/exchange-passport-Bxh8blMK.js +0 -1
- package/dist/assets/form-text-input-CbjI2VZQ.js +0 -11
- package/dist/assets/fuel-BdIacIqD.js +0 -32
- package/dist/assets/gen-access-key-DdjBRI5O.js +0 -1
- package/dist/assets/gen-simple-access-key-CBGi0io0.js +0 -1
- package/dist/assets/get-safe-url-pZvXlaJu.js +0 -1
- package/dist/assets/index-5B_H2zYd.js +0 -1
- package/dist/assets/index-6M8OhYM1.js +0 -1
- package/dist/assets/index-BRky7Qm3.js +0 -7
- package/dist/assets/index-BfyoUnq5.js +0 -63
- package/dist/assets/index-CUIcSX4q.js +0 -102
- package/dist/assets/index-CtuxXUm_.js +0 -1
- package/dist/assets/index-DCPJbOWh.js +0 -55
- package/dist/assets/index-DD9ceQKr.js +0 -1
- package/dist/assets/index-DHn4LCaq.js +0 -29
- package/dist/assets/index-Dijoh4El.js +0 -1041
- package/dist/assets/index-Dn_bIjgF.js +0 -6
- package/dist/assets/index-G1If4Shq.js +0 -120
- package/dist/assets/index-RxqUBm3A.js +0 -11
- package/dist/assets/index-SH0LXIEm.js +0 -1
- package/dist/assets/index-mgpYakv8.js +0 -1
- package/dist/assets/invitations-xEsO2f9m.js +0 -3
- package/dist/assets/invite-ChOQtk0E.js +0 -1
- package/dist/assets/issue-passport-CUGjhBZr.js +0 -1
- package/dist/assets/landing-page-zT1Tduxx.js +0 -1
- package/dist/assets/list-Cj5o6_aJ.js +0 -103
- package/dist/assets/list-dBF9Lx52.js +0 -2
- package/dist/assets/localization-BhQNA1fu.js +0 -1
- package/dist/assets/logger-CWdgyrlX.js +0 -1
- package/dist/assets/login-BRtDYFyr.js +0 -1
- package/dist/assets/login-oauth-callback-BVOT5KIP.js +0 -1
- package/dist/assets/logo-uploader-CMuaTg_2.js +0 -30
- package/dist/assets/omit-DZEUV_m7.js +0 -1
- package/dist/assets/over-due-invoice-payment-EIjXZOAF.js +0 -1
- package/dist/assets/passport-BcfDxGFq.js +0 -1
- package/dist/assets/passport-item-BnRaEMVZ.js +0 -1
- package/dist/assets/preferences-BgyNzrci.js +0 -1
- package/dist/assets/profile-embed-C3hI8xed.js +0 -1
- package/dist/assets/publish-resource-CreTipUc.js +0 -1
- package/dist/assets/runtime-BwoZhRe2.js +0 -1
- package/dist/assets/sdk-Do4pV1s0.js +0 -1
- package/dist/assets/security-DCG1tmZe.js +0 -22
- package/dist/assets/session-DUT2afHJ.js +0 -1
- package/dist/assets/setup-ephJCw43.js +0 -24
- package/dist/assets/status-BFw6nCWi.js +0 -1
- package/dist/assets/studio-BKkw9WY-.js +0 -6
- package/dist/assets/switch-C5K07M96.js +0 -1
- package/dist/assets/team-HgvOpVEJ.js +0 -146
- package/dist/assets/traffic-BvA-dAE6.js +0 -1
- package/dist/assets/transfer-CiITg5ql.js +0 -16
- package/dist/assets/unsubscribe-2BjO5Axx.js +0 -1
- package/dist/assets/use-app-logo-D9eQSUYq.js +0 -1
- package/dist/assets/use-window-close-DLSxYDw-.js +0 -1
- package/dist/assets/useAsync-Dy8z2Lh_.js +0 -1
- package/dist/assets/useLocalStorage-oIIa9C3F.js +0 -1
- package/dist/assets/user-center-BODNsVgb.js +0 -126
- package/dist/assets/user-follower-ODH9p68y.js +0 -32
- package/dist/assets/vendor-utils-CFxoplqC.js +0 -213
- package/dist/assets/wizard-components-MqkmgXy5.js +0 -52
- package/dist/assets/wrap-locale-Dk2yVg3Y.js +0 -1
- package/dist/assets/zh-C6-KWz-k.js +0 -1
|
@@ -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 Ue,cB as vt}from"./vendor-mui-core-DnR6WYuU.js";import{e as ee,F as Ct,aC as pe}from"./vendor-utils-BqKQizRf.js";import{H as U,aV as Nt,V as Y,cM as wt,m as Ye,$ as Je,w as Ae,aO as Ze,bh as be,aJ as Rt,aU as Tt,b0 as It,b7 as Et}from"./vendor-ux-KtPBvlG0.js";import{Z as At,Q as H,c as E,C as Dt,a1 as qe}from"./index-DGg3AL9l.js";import{a as X,g as De}from"./vendor-hooks-DpqqC65c.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-CiQKtWIW.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-DYFxkX2y.js";import{i as Pt,e as _t,N as Bt}from"./team-D2fBm-il.js";import{W as zt}from"./did-address-DpdRECuJ.js";import{p as st}from"./util-pUhbKKIP.js";import{D as Wt,g as Mt}from"./traffic-BxfS8jav.js";import{B as nt}from"./bundle-avatar-BSv_e0lp.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-Bavobyzn.js";import"./isURL-HdHdFI5D.js";import"./use-app-logo-BwsHVK-l.js";import"./base32-BqL5pnrU.js";import"./useAsyncRetry-v1aVMcV-.js";import"./useAsync-BSd-eaZO.js";import"./iframe-dmFx9kP7.js";import"./index-B4sVJOOj.js";import"./index-DBs9Ljax.js";import"./base-chart-CRe-9w5H.js";import"./index-DZnXlBSX.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DqOr9LFk.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]),q=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},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return U.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 U.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&q(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||q(P)},[w,P]);const J={fetch:q,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:J},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 Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:Ut[t],children:t})}const qt=(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=qt(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},Jt=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){U.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){U.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:[qe(t[0],n)," - ",qe(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 Zt=[{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(Zt),[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,q]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=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)}}));q(o),J(a.paging),F(!1)}catch(a){U.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},Z=({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){U.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Yt(o,c)>=4){U.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){U.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(Je,{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(Ze,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,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=Jt(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,q=w>0?y/w*100:0,M=w>0?v/w*100:0;return e.jsxs(is,{successRatio:q,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)&&(U.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)&&(U.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}:{}}),U.success("Message has been sent!")}catch(_){console.error("handleResend error",{error:_}),U.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]),q=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:q,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,J=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:J,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:q}=_e(),M=x.useRef(null),[L,k]=x.useState(null),[$,V]=x.useState("info"),J=`notification-records-${y.meta?.did}`,p=Et(J),[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]),Z=[{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(Ue,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(Ue,{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,q,w);return e.jsx(Je,{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,Z[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(Ze,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:Z,data:S,durable:J,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,7 @@
|
|
|
1
|
+
import{V as B,H as q,z as F,b9 as K,aN as Ce,aO as Se,b7 as Te}from"./vendor-ux-KtPBvlG0.js";import{v as Ie,q as ae,o as Re}from"./vendor-hooks-DpqqC65c.js";import{r as v,a as ce}from"./vendor-react-CTtPmzVP.js";import{D as We,J as de,j as e,Y as ze,b5 as De,$ as Oe,ak as d,z as se,T as C,a6 as U,aZ as te,R as Ae,Q as N,bX as ie,am as P,bl as _,a5 as J,V as Z,S as G,b2 as $e,U as L,I as M,c0 as Pe,b0 as qe,a7 as Le,F as Be,W as t,b6 as W,a3 as pe,b4 as ee,c9 as Me,aO as Ne,aP as Fe,dQ as He,dR as Ue,dS as _e,s as oe,aU as Ve,aj as Ye,cv as Ke,cu as Je,bi as Qe}from"./vendor-mui-core-DnR6WYuU.js";import{Z as V,c as ue,Q as Xe,Y as Ze,cn as Q,ba as xe,bb as he,bc as me}from"./index-DGg3AL9l.js";import{S as Ge}from"./switch-wqsJ2qIA.js";import{b as Y}from"./team-D2fBm-il.js";import{u as et}from"./use-mobile-BINJTzMb.js";import{u as tt,C as X}from"./index.esm-Co8ZxFyk.js";import{C as ge,a as be,J as ot}from"./vendor-utils-BqKQizRf.js";import{C as nt}from"./confirm-Dul9DyCY.js";import{A as st}from"./actions-Dfiiwkit.js";import{T as re}from"./table-tips-BEPJMiqj.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./session-Bavobyzn.js";import"./isURL-HdHdFI5D.js";import"./use-app-logo-BwsHVK-l.js";import"./index-DBs9Ljax.js";const it=s=>{const[p,c]=v.useState(null),[f,r]=v.useState(!0),[w,u]=v.useState(null),j=window.blocklet?.appUrl,a=v.useMemo(()=>{const g={};return p&&(p.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),p.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[p]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(ge(j,ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),u(null)}catch(g){u(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return v.useEffect(()=>{b()},[j]),{openEvent:p,setOpenEvent:c,eventsBySource:a,loading:f,error:w,loadData:b}};function fe({eventsBySource:s,selectedEvents:p,setSelectedEvents:c,error:f=null}){const{t:r}=B(),[w,u]=v.useState({}),j=v.useMemo(()=>{const n={};return Object.entries(s).forEach(([l,{events:m}])=>{const k=m.filter(S=>p[`${S.type}-${S.source}`]).length;n[l]=k}),n},[s,p]),a=v.useMemo(()=>Object.values(j).reduce((n,l)=>n+l,0),[j]),b=v.useMemo(()=>Object.values(s).reduce((n,{events:l})=>n+l.length,0),[s]),g=(n,l)=>{l.stopPropagation(),u({...w,[n]:!w[n]})},y=n=>{const l=`${n.type}-${n.source}`;c(m=>({...m,[l]:!m[l]}))},z=(n,l)=>{const m={};n.forEach(k=>{const S=`${k.type}-${k.source}`;m[S]=!l}),c(k=>({...k,...m}))},I=n=>{const l={};Object.values(s).forEach(({events:m})=>{m.forEach(k=>{const S=`${k.type}-${k.source}`;l[S]=n.target.checked})}),c(l)};return e.jsxs(d,{sx:{width:"100%"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ie,{control:e.jsx(J,{onChange:I,checked:a>0&&a===b}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),a>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:a})})]}),e.jsx(d,{className:"webhook-event-selector",sx:{maxHeight:"50vh",overflowY:"auto",overflowX:"hidden"},children:e.jsx(Z,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:.5},children:Object.entries(s).map(([n,{source:l,events:m,count:k}],S)=>{const D=j[n]>0,R=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ce.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:i})=>S<Object.keys(s).length-1?`1px solid ${i.divider}`:"none",px:0,py:1,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(d,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:i=>{i.target.closest(".MuiFormControlLabel-root")||g(n,i)},children:[e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ie,{control:e.jsx(J,{checked:R,indeterminate:D&&!R,onChange:i=>{i.stopPropagation(),z(m,R)}}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.logo&&e.jsx($e,{src:l.logo,sx:{width:24,height:24}}),e.jsx(d,{children:l.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:i=>`${i.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:k})}),m.length>0&&e.jsx(M,{size:"small",edge:"end",children:O?e.jsx(Pe,{}):e.jsx(qe,{})})]})]})}),m.length>0&&e.jsx(Le,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(Z,{disablePadding:!0,sx:{p:0,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(i=>{const h=`${i.type}-${i.source}`,o=!!p[h];return e.jsx(G,{dense:!0,sx:{py:.75,px:1},onClick:()=>y(i),children:e.jsxs(d,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:o,sx:{flexShrink:0}}),e.jsxs(d,{sx:{flex:1,minWidth:0},children:[e.jsx(C,{variant:"body1",className:"webhook-event-type",sx:{cursor:"pointer",color:"text.primary",wordBreak:"break-word",overflowWrap:"break-word"},children:i.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer",wordBreak:"break-word",overflowWrap:"break-word"},children:i.description})]})]})},h)})})})]},n)})})}),f&&e.jsx(Be,{error:!0,sx:{mt:1},children:f})]})}fe.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function je({id:s=null,url:p="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:u}=B(),[j,a]=v.useState({}),{teamDid:b}=Y(),{api:g}=V(),{loading:y,error:z,eventsBySource:I}=it(),n=We(),{control:l,handleSubmit:m,formState:{errors:k},reset:S,setValue:D,trigger:R}=tt({defaultValues:{url:"",description:""}}),O=de(n.breakpoints.down("md"));v.useEffect(()=>{const o=Object.values(j).some(x=>x);D("selectedEvents",o?"valid":""),R("selectedEvents")},[j,D,R]);const i=()=>{a({}),S(),w()},h=async o=>{const x=Object.keys(j).filter(T=>j[T]),E={url:o.url,description:o.description,enabledEvents:x.map(T=>{const[A,ne]=T.split("-");return!A||!ne?null:{type:A,source:ne}}).filter(Boolean)};try{if(s){const T=await g.updateWebhookEndpoint({input:{teamDid:b,id:s,data:E}});q.success(`${u("webhookEndpoint.updateWebhook")} ${u("webhookEndpoint.success")}`),r(T)}else{const T=await g.createWebhookEndpoint({input:{teamDid:b,input:E}});q.success(`${u("webhookEndpoint.createWebhook")} ${u("webhookEndpoint.success")}`),r(T)}}catch(T){q.error(T?.message)}i()};return v.useEffect(()=>{S({url:p,description:c}),a(f.reduce((o,x)=>(o[`${x.type}-${x.source}`]=!0,o),{}))},[S,a,p,c,f]),e.jsx(ze,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,fullScreen:O,children:e.jsxs("form",{onSubmit:m(h),children:[e.jsx(De,{children:u(s?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Oe,{children:e.jsxs(d,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:l,rules:{required:u("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:u("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:u("webhookEndpoint.url.label"),fullWidth:!0,error:!!k.url,helperText:k.url?.message})}),e.jsx(X,{name:"description",control:l,rules:{required:u("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:u("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!k.description,helperText:k.description?.message})}),e.jsx(X,{name:"selectedEvents",control:l,rules:{required:u("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&I&&Object.keys(I).length>0&&e.jsx(fe,{eventsBySource:I,selectedEvents:j,setSelectedEvents:a,error:k.selectedEvents?.message}),!y&&(!I||Object.keys(I).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:u("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),z&&e.jsx(te,{severity:"error",children:u("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(Ae,{sx:{p:"8px 24px 24px"},children:[e.jsx(N,{onClick:i,children:u("common.cancel")}),e.jsx(N,{type:"submit",variant:"contained",color:"primary",children:u(s?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}je.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function rt(s){switch(s){case"enabled":return"success";case"disabled":default:return"default"}}const lt=(s="en")=>s==="tw"?"zh":s;function H(s,p="YYYY-MM-DD HH:mm:ss",c="en"){return s?Xe(s).locale(lt(c)).format(p):"-"}function at(s){return typeof s=="number"?!1:be(s)}function ct(s){return s>=200&&s<300}function $({value:s,label:p,tip:c="",divider:f=!1}){const r=at(s);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[p,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":s})]}),f&&e.jsx(pe,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function ye({title:s,children:p=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(W,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:s}),p]})}ye.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const dt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},pt=s=>{const p={};return s.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();p[f]||(p[f]=[]),p[f]?.push(c)}),p};function we({eventId:s="",webhookEndpointId:p="",event:c=null}){const{api:f,ws:{useSubscription:r}}=V(),{t:w}=B(),{teamDid:u}=Y(),{blocklet:j}=Ze(),{data:a,loadMore:b,loadingMore:g,loading:y,mutate:z}=Ie(o=>{const E=o?Math.ceil(o.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:u,input:{eventId:s,webhookId:p},paging:{page:E,pageSize:15}}})},{reloadDeps:[s,p]}),I=a?.list||[],[n,l]=v.useState(null),[m,k]=v.useState(!1),S=pt(I);if(v.useEffect(()=>{!n&&a?.list.length&&l(a.list[0])},[a?.list.length,n]),r(ue.EVENTS.WEBHOOK_ATTEMPT,o=>{z(x=>{if(x.list.find(T=>T.id===o.id)){const T=x.list.map(A=>A.id===o.id?{...A,...o}:A);return{...x,list:T}}return o.endpoint=x.list[0]?.endpoint,o.event=x.list[0]?.event,{...x,list:[o,...x.list]}})},[]),y)return e.jsx(U,{});const D=a&&a.list.length<a.paging.total,R=async()=>{n&&(k(!0),await f.retryWebhookAttempt({input:{teamDid:u,eventId:n.event.id,webhookId:p,attemptId:n.id}}).finally(()=>{setTimeout(()=>{k(!1)},1e3)}))},O=o=>{if(o.responseBody&&o.responseBody?.sessionId&&o.responseBody?.projectId&&o.responseBody?.agentId){const x=j?.site?.domainAliases[0]?.value,E=(j.children||[]).find(A=>A?.meta?.name==="ai-studio"),T=ot(ge(`https://${x}`,E?.mountPoint||"","projects",o.responseBody.projectId,"logs/main"),{sessionId:o.responseBody.sessionId,agentId:o.responseBody.agentId});return e.jsx(M,{sx:{fontSize:20},onClick:()=>window.open(T,"_blank"),children:e.jsx(d,{component:F,icon:Q})})}return null},i=o=>o.status==="pending"?e.jsx(He,{color:"warning"}):ct(o.responseStatus)?e.jsx(Ue,{color:"success"}):e.jsx(_e,{color:"error"}),h=n?.triggeredFrom&&(a?.list||[]).find(o=>o.id===n.triggeredFrom);return e.jsxs(ut,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:be(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([o,x])=>e.jsxs(ce.Fragment,{children:[e.jsx(Me,{sx:{p:0},children:o}),x.map(E=>e.jsxs(G,{sx:{cursor:"pointer",px:1},onClick:()=>l(E),selected:n&&n?.id===E?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:H(E.createdAt,"HH:mm:ss")}),children:[e.jsx(Ne,{sx:{minWidth:0,mr:1.5},children:i(E)}),e.jsx(Fe,{primary:e.jsx(C,{sx:{color:"text.primary"},children:E.event.type})})]},E.id))]},o))}),D&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(N,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:o=>o.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(W,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(d,{children:O(n)})]}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[h&&e.jsx(P,{placement:"left",title:e.jsxs(W,{onClick:()=>l(h),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(xe,{showDid:!0,did:n.triggeredBy,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(pe,{}),e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(M,{onClick:()=>l(h),children:e.jsx(d,{component:F,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(M,{onClick:()=>l(h),children:e.jsx(d,{component:F,icon:Q,sx:{fontSize:16}})})}),e.jsxs(N,{variant:"outlined",color:"primary",size:"small",onClick:R,disabled:m,children:[e.jsx(d,{component:F,icon:dt,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(d,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(K,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),a?.list.length===0&&c&&e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}we.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const ut=oe(ee)`
|
|
2
|
+
@keyframes spin {
|
|
3
|
+
to {
|
|
4
|
+
transform: rotate(360deg);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
`;function ke({id:s,onClose:p}){const{t:c}=B(),{api:f}=V(),{teamDid:r}=Y(),{loading:w,error:u,data:j}=ae(()=>f.getWebhookEndpoint({input:{teamDid:r,id:s}})),a=j?.data;return u?e.jsx(te,{severity:"error",children:u.message}):w||!a?e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1},children:e.jsx(U,{})}):e.jsxs(xt,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(d,{children:[e.jsxs(W,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:[e.jsx(W,{sx:{flex:1,width:0},children:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h5",sx:{fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.description}),e.jsx(P,{title:a.url,children:e.jsx(_,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(W,{direction:"row",sx:{alignItems:"center"},children:e.jsx(M,{edge:"end",color:"inherit",onClick:p,children:e.jsx(Ye,{})})})]}),e.jsx(d,{sx:{mt:2},children:e.jsxs(W,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},sx:{justifyContent:"flex-start",flexWrap:"wrap",pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx($,{label:c("common.status"),value:e.jsx(L,{size:"small",variant:"filled",label:a.status,color:rt(a.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.listen"),value:e.jsx(P,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:a.enabledEvents.map(b=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:b?.type},b))}),children:e.jsx(L,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:a.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.version"),value:a.apiVersion,divider:!0}),e.jsx($,{label:c("common.createdAt"),value:H(a.createdAt),divider:!0}),e.jsx($,{label:c("common.updatedAt"),value:H(a.updatedAt),divider:!0}),e.jsx($,{label:c("common.createdBy"),value:e.jsx(P,{arrow:!0,title:a.createUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.createUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("common.updatedBy"),value:e.jsx(P,{arrow:!0,title:a.updateUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.updateUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(W,{className:"section",sx:{flex:1,height:0,overflow:"hidden"},children:[e.jsx(ye,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(W,{sx:{height:0,flex:1,overflow:"hidden"},children:e.jsx(we,{webhookEndpointId:a.id})})]})]})}ke.propTypes={id:t.string.isRequired,onClose:t.func.isRequired};const xt=oe(W)``;function Ee({open:s,onClose:p,id:c}){return e.jsx(Ve,{anchor:"right",open:s,onClose:p,slotProps:{paper:{sx:{width:"90vw",maxWidth:"1200px"}}},children:e.jsx(d,{sx:{height:"100vh",p:3},children:e.jsx(ke,{id:c,onClose:p})})})}Ee.propTypes={open:t.bool.isRequired,onClose:t.func.isRequired,id:t.string.isRequired};function le(){return null}function ve({options:s={},columns:p=[],toolbar:c=!0,footer:f=!0,hasRowLink:r=!1,emptyNodeText:w="",durable:u="",durableKeys:j=[],data:a=[],loading:b=!1,...g}){const{locale:y}=B(),z=de(l=>l.breakpoints.down("md")),I={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:z?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},n={};return c||(n.TableToolbar=le),f||(n.TableFooter=le),e.jsx(ht,{locale:y,options:{...I,...s},columns:(p||[]).map(l=>(l.options=l.options||{},l.options.filter=l.options.filter||!1,l.options.sort=l.options.sort||!1,l)),emptyNode:e.jsx(Ce,{children:w}),...g,durable:u,durableKeys:j,data:a,loading:b,components:n,hasRowLink:r,isMobile:z})}ve.propTypes={options:t.object,columns:t.array,toolbar:t.bool,footer:t.bool,hasRowLink:t.bool,emptyNodeText:t.node,durable:t.string,durableKeys:t.array,data:t.array,loading:t.bool,onChange:t.func,title:t.node,components:t.object};const ht=oe(Se)``,mt=v.memo(ve);function $t(){const{teamDid:s}=Y(),p=et(),c=`webhook-endpoints-${s}`,f=Te(c),{t:r,locale:w}=B(),{api:u}=V(),[j,a]=v.useState(""),[b,g]=v.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[y,z]=Re(c,{defaultValue:{pageSize:f.rowsPerPage||20,page:f.page?f.page+1:1}}),{loading:I,error:n,data:l,refresh:m}=ae(()=>u.getWebhookEndpoints({input:{teamDid:s,paging:{page:y.page,pageSize:y.pageSize}}}));v.useEffect(()=>{m()},[y,m]);const k=v.useCallback(async(i,h)=>{try{await u.updateWebhookEndpoint({input:{teamDid:s,id:i.id,data:{status:h?"disabled":"enabled"}}}),m(),q.success(`${r(h?"webhookEndpoint.disable":"webhookEndpoint.enable")}${r("webhookEndpoint.success")}`)}catch(o){q.error(o?.message)}},[u,s,m,r]),S=v.useCallback(async i=>{try{await u.deleteWebhookEndpoint({input:{teamDid:s,id:i}}),m(),g(h=>({...h,deleteConfirm:null})),q.success(`${r("common.delete")}${r("webhookEndpoint.success")}`)}catch(h){q.error(h?.message)}},[u,s,m,r]),D=(i,h)=>{let o=i.page+1;const x=i.searchText||"";if(x!==j){a(x);return}if(h==="changePage"||h==="changeRowsPerPage"){h!=="changePage"&&(o=1);const E={page:o,pageSize:i.rowsPerPage};a(""),z(E)}};if(n)return e.jsx(te,{severity:"error",children:n.message});const R=(l?.list||[]).filter(i=>{if(!j)return!0;const h=j.toLowerCase();return i.description.toLowerCase().includes(h)||i.url.toLowerCase().includes(h)}),O=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(C,{variant:"body2",children:o.description}),e.jsx(d,{sx:{display:"flex"},onClick:x=>{x.stopPropagation()},children:e.jsx(P,{title:o.url,children:e.jsx(_,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(d,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:o.enabledEvents.map(x=>e.jsx(L,{size:"small",variant:"filled",label:x.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${o.source}-${x.type}`))})}}},{label:r("common.status"),name:"status",options:{customBodyRenderLite:(i,h)=>{const o=R[h],x=o?.status==="enabled";return e.jsx(d,{onClick:E=>E.stopPropagation(),children:e.jsx(Ge,{checked:x,onChange:()=>k(o,x)},`status-${o.status}`)})}}},{label:r("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>H(i)}},{label:r("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:i=>i?e.jsx(xe,{showDid:!0,did:i?.did,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0}}):"-"}},{label:r("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(st,{actions:[{icon:e.jsx(Ke,{}),text:r("common.edit"),onClick:x=>{x.stopPropagation(),g(E=>({...E,createEdit:{open:!0,id:o.id,url:o.url,description:o.description,enabledEvents:o.enabledEvents}}))}},{icon:e.jsx(Je,{}),text:r("common.delete"),onClick:x=>{x.stopPropagation(),g(E=>({...E,deleteConfirm:{title:r("webhookEndpoint.deleteWebhook.title"),description:r("webhookEndpoint.deleteWebhook.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:()=>S(o.id),onCancel:()=>g(T=>({...T,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(d,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[p?e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}):null,e.jsx(mt,{durable:c,durableKeys:["page","rowsPerPage"],data:R,columns:O,options:{count:l?.count||0,page:y.page-1,rowsPerPage:y.pageSize,viewColumns:!1,onRowClick:(i,{dataIndex:h})=>{const o=l.list[h];g(x=>({...x,webhookDetail:{open:!0,id:o.id}}))}},loading:I||!l,onChange:D,emptyNodeText:e.jsx(W,{sx:{gap:1},children:r("webhookEndpoint.noWebhooksAdded")}),title:p?null:e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}),customButtons:[e.jsxs(N,{edge:"end",variant:"contained",color:"primary",onClick:()=>g(i=>({...i,createEdit:{...i.createEdit,open:!0}})),className:"rule-action",children:[I?e.jsx(U,{size:16}):e.jsx(Qe,{style:{fontSize:16}}),r("common.create")]},"add")]}),b.webhookDetail.open&&e.jsx(Ee,{open:!0,onClose:()=>g(i=>({...i,webhookDetail:{open:!1,id:null}})),id:b.webhookDetail.id}),b.createEdit.open&&e.jsx(je,{onSubmit:m,...b.createEdit,onClose:()=>g(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),b.deleteConfirm&&e.jsx(nt,{title:b.deleteConfirm.title,description:b.deleteConfirm.description,confirm:b.deleteConfirm.confirm,cancel:b.deleteConfirm.cancel,params:b.deleteConfirm.params,onConfirm:b.deleteConfirm.onConfirm,onCancel:b.deleteConfirm.onCancel})]})}export{$t as default};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import{j as U,ax as rr,ak as en,f as ar}from"./vendor-mui-core-DnR6WYuU.js";import{g as bi,d as sr,h as or,f as un,r as P}from"./vendor-react-CTtPmzVP.js";import{D as wi,ad as lr,e as fr,n as cr,P as yi}from"./vendor-utils-BqKQizRf.js";import{aK as dr,bg as ur}from"./index-DGg3AL9l.js";import{l as Ie,b5 as hr,b6 as _r}from"./vendor-ux-KtPBvlG0.js";import{l as pr}from"./vendor-hooks-DpqqC65c.js";/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const gr=4,hn=0,_n=1,br=2;function Re(e){let n=e.length;for(;--n>=0;)e[n]=0}const wr=0,xi=1,yr=2,xr=3,mr=258,tn=29,We=256,je=We+1+tn,Se=30,nn=19,mi=2*je+1,be=15,yt=16,Er=7,rn=256,Ei=16,vi=17,Ni=18,Xt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ct=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),vr=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ki=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nr=512,le=new Array((je+2)*2);Re(le);const Be=new Array(Se*2);Re(Be);const He=new Array(Nr);Re(He);const Ve=new Array(mr-xr+1);Re(Ve);const an=new Array(tn);Re(an);const dt=new Array(Se);Re(dt);function xt(e,n,t,i,l){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=l,this.has_stree=e&&e.length}let Ti,Ai,Si;function mt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const Oi=e=>e<256?He[e]:He[256+(e>>>7)],Xe=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},K=(e,n,t)=>{e.bi_valid>yt-t?(e.bi_buf|=n<<e.bi_valid&65535,Xe(e,e.bi_buf),e.bi_buf=n>>yt-e.bi_valid,e.bi_valid+=t-yt):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=t)},ne=(e,n,t)=>{K(e,t[n*2],t[n*2+1])},Fi=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},kr=e=>{e.bi_valid===16?(Xe(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Tr=(e,n)=>{const t=n.dyn_tree,i=n.max_code,l=n.stat_desc.static_tree,a=n.stat_desc.has_stree,f=n.stat_desc.extra_bits,s=n.stat_desc.extra_base,c=n.stat_desc.max_length;let r,o,E,_,h,v,T=0;for(_=0;_<=be;_++)e.bl_count[_]=0;for(t[e.heap[e.heap_max]*2+1]=0,r=e.heap_max+1;r<mi;r++)o=e.heap[r],_=t[t[o*2+1]*2+1]+1,_>c&&(_=c,T++),t[o*2+1]=_,!(o>i)&&(e.bl_count[_]++,h=0,o>=s&&(h=f[o-s]),v=t[o*2],e.opt_len+=v*(_+h),a&&(e.static_len+=v*(l[o*2+1]+h)));if(T!==0){do{for(_=c-1;e.bl_count[_]===0;)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[c]--,T-=2}while(T>0);for(_=c;_!==0;_--)for(o=e.bl_count[_];o!==0;)E=e.heap[--r],!(E>i)&&(t[E*2+1]!==_&&(e.opt_len+=(_-t[E*2+1])*t[E*2],t[E*2+1]=_),o--)}},Ii=(e,n,t)=>{const i=new Array(be+1);let l=0,a,f;for(a=1;a<=be;a++)l=l+t[a-1]<<1,i[a]=l;for(f=0;f<=n;f++){let s=e[f*2+1];s!==0&&(e[f*2]=Fi(i[s]++,s))}},Ar=()=>{let e,n,t,i,l;const a=new Array(be+1);for(t=0,i=0;i<tn-1;i++)for(an[i]=t,e=0;e<1<<Xt[i];e++)Ve[t++]=i;for(Ve[t-1]=i,l=0,i=0;i<16;i++)for(dt[i]=l,e=0;e<1<<ct[i];e++)He[l++]=i;for(l>>=7;i<Se;i++)for(dt[i]=l<<7,e=0;e<1<<ct[i]-7;e++)He[256+l++]=i;for(n=0;n<=be;n++)a[n]=0;for(e=0;e<=143;)le[e*2+1]=8,e++,a[8]++;for(;e<=255;)le[e*2+1]=9,e++,a[9]++;for(;e<=279;)le[e*2+1]=7,e++,a[7]++;for(;e<=287;)le[e*2+1]=8,e++,a[8]++;for(Ii(le,je+1,a),e=0;e<Se;e++)Be[e*2+1]=5,Be[e*2]=Fi(e,5);Ti=new xt(le,Xt,We+1,je,be),Ai=new xt(Be,ct,0,Se,be),Si=new xt(new Array(0),vr,0,nn,Er)},Ri=e=>{let n;for(n=0;n<je;n++)e.dyn_ltree[n*2]=0;for(n=0;n<Se;n++)e.dyn_dtree[n*2]=0;for(n=0;n<nn;n++)e.bl_tree[n*2]=0;e.dyn_ltree[rn*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},zi=e=>{e.bi_valid>8?Xe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},pn=(e,n,t,i)=>{const l=n*2,a=t*2;return e[l]<e[a]||e[l]===e[a]&&i[n]<=i[t]},Et=(e,n,t)=>{const i=e.heap[t];let l=t<<1;for(;l<=e.heap_len&&(l<e.heap_len&&pn(n,e.heap[l+1],e.heap[l],e.depth)&&l++,!pn(n,i,e.heap[l],e.depth));)e.heap[t]=e.heap[l],t=l,l<<=1;e.heap[t]=i},gn=(e,n,t)=>{let i,l,a=0,f,s;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+a++]&255,i+=(e.pending_buf[e.sym_buf+a++]&255)<<8,l=e.pending_buf[e.sym_buf+a++],i===0?ne(e,l,n):(f=Ve[l],ne(e,f+We+1,n),s=Xt[f],s!==0&&(l-=an[f],K(e,l,s)),i--,f=Oi(i),ne(e,f,t),s=ct[f],s!==0&&(i-=dt[f],K(e,i,s)));while(a<e.sym_next);ne(e,rn,n)},qt=(e,n)=>{const t=n.dyn_tree,i=n.stat_desc.static_tree,l=n.stat_desc.has_stree,a=n.stat_desc.elems;let f,s,c=-1,r;for(e.heap_len=0,e.heap_max=mi,f=0;f<a;f++)t[f*2]!==0?(e.heap[++e.heap_len]=c=f,e.depth[f]=0):t[f*2+1]=0;for(;e.heap_len<2;)r=e.heap[++e.heap_len]=c<2?++c:0,t[r*2]=1,e.depth[r]=0,e.opt_len--,l&&(e.static_len-=i[r*2+1]);for(n.max_code=c,f=e.heap_len>>1;f>=1;f--)Et(e,t,f);r=a;do f=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Et(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=f,e.heap[--e.heap_max]=s,t[r*2]=t[f*2]+t[s*2],e.depth[r]=(e.depth[f]>=e.depth[s]?e.depth[f]:e.depth[s])+1,t[f*2+1]=t[s*2+1]=r,e.heap[1]=r++,Et(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Tr(e,n),Ii(t,c,e.bl_count)},bn=(e,n,t)=>{let i,l=-1,a,f=n[0*2+1],s=0,c=7,r=4;for(f===0&&(c=138,r=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)a=f,f=n[(i+1)*2+1],!(++s<c&&a===f)&&(s<r?e.bl_tree[a*2]+=s:a!==0?(a!==l&&e.bl_tree[a*2]++,e.bl_tree[Ei*2]++):s<=10?e.bl_tree[vi*2]++:e.bl_tree[Ni*2]++,s=0,l=a,f===0?(c=138,r=3):a===f?(c=6,r=3):(c=7,r=4))},wn=(e,n,t)=>{let i,l=-1,a,f=n[0*2+1],s=0,c=7,r=4;for(f===0&&(c=138,r=3),i=0;i<=t;i++)if(a=f,f=n[(i+1)*2+1],!(++s<c&&a===f)){if(s<r)do ne(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==l&&(ne(e,a,e.bl_tree),s--),ne(e,Ei,e.bl_tree),K(e,s-3,2)):s<=10?(ne(e,vi,e.bl_tree),K(e,s-3,3)):(ne(e,Ni,e.bl_tree),K(e,s-11,7));s=0,l=a,f===0?(c=138,r=3):a===f?(c=6,r=3):(c=7,r=4)}},Sr=e=>{let n;for(bn(e,e.dyn_ltree,e.l_desc.max_code),bn(e,e.dyn_dtree,e.d_desc.max_code),qt(e,e.bl_desc),n=nn-1;n>=3&&e.bl_tree[ki[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},Or=(e,n,t,i)=>{let l;for(K(e,n-257,5),K(e,t-1,5),K(e,i-4,4),l=0;l<i;l++)K(e,e.bl_tree[ki[l]*2+1],3);wn(e,e.dyn_ltree,n-1),wn(e,e.dyn_dtree,t-1)},Fr=e=>{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return hn;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return _n;for(t=32;t<We;t++)if(e.dyn_ltree[t*2]!==0)return _n;return hn};let yn=!1;const Ir=e=>{yn||(Ar(),yn=!0),e.l_desc=new mt(e.dyn_ltree,Ti),e.d_desc=new mt(e.dyn_dtree,Ai),e.bl_desc=new mt(e.bl_tree,Si),e.bi_buf=0,e.bi_valid=0,Ri(e)},Ci=(e,n,t,i)=>{K(e,(wr<<1)+(i?1:0),3),zi(e),Xe(e,t),Xe(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},Rr=e=>{K(e,xi<<1,3),ne(e,rn,le),kr(e)},zr=(e,n,t,i)=>{let l,a,f=0;e.level>0?(e.strm.data_type===br&&(e.strm.data_type=Fr(e)),qt(e,e.l_desc),qt(e,e.d_desc),f=Sr(e),l=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=l&&(l=a)):l=a=t+5,t+4<=l&&n!==-1?Ci(e,n,t,i):e.strategy===gr||a===l?(K(e,(xi<<1)+(i?1:0),3),gn(e,le,Be)):(K(e,(yr<<1)+(i?1:0),3),Or(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1),gn(e,e.dyn_ltree,e.dyn_dtree)),Ri(e),i&&zi(e)},Cr=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(Ve[t]+We+1)*2]++,e.dyn_dtree[Oi(n)*2]++),e.sym_next===e.sym_end);var Pr=Ir,Lr=Ci,$r=zr,Zr=Cr,Br=Rr,Ur={_tr_init:Pr,_tr_stored_block:Lr,_tr_flush_block:$r,_tr_tally:Zr,_tr_align:Br};const Mr=(e,n,t,i)=>{let l=e&65535|0,a=e>>>16&65535|0,f=0;for(;t!==0;){f=t>2e3?2e3:t,t-=f;do l=l+n[i++]|0,a=a+l|0;while(--f);l%=65521,a%=65521}return l|a<<16|0};var qe=Mr;const jr=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},Hr=new Uint32Array(jr()),Vr=(e,n,t,i)=>{const l=Hr,a=i+t;e^=-1;for(let f=i;f<a;f++)e=e>>>8^l[(e^n[f])&255];return e^-1};var H=Vr,xe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Je={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Xr,_tr_stored_block:Gt,_tr_flush_block:qr,_tr_tally:_e,_tr_align:Gr}=Ur,{Z_NO_FLUSH:pe,Z_PARTIAL_FLUSH:Kr,Z_FULL_FLUSH:Yr,Z_FINISH:Q,Z_BLOCK:xn,Z_OK:V,Z_STREAM_END:mn,Z_STREAM_ERROR:ie,Z_DATA_ERROR:Wr,Z_BUF_ERROR:vt,Z_DEFAULT_COMPRESSION:Jr,Z_FILTERED:Qr,Z_HUFFMAN_ONLY:nt,Z_RLE:Dr,Z_FIXED:ea,Z_DEFAULT_STRATEGY:ta,Z_UNKNOWN:na,Z_DEFLATED:_t}=Je,ia=9,ra=15,aa=8,sa=29,oa=256,Kt=oa+1+sa,la=30,fa=19,ca=2*Kt+1,da=15,L=3,he=258,re=he+L+1,ua=32,Oe=42,sn=57,Yt=69,Wt=73,Jt=91,Qt=103,we=113,$e=666,X=1,ze=2,me=3,Ce=4,ha=3,ye=(e,n)=>(e.msg=xe[n],n),En=e=>e*2-(e>4?9:0),ue=e=>{let n=e.length;for(;--n>=0;)e[n]=0},_a=e=>{let n,t,i,l=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=l?t-l:0;while(--n);n=l,i=n;do t=e.prev[--i],e.prev[i]=t>=l?t-l:0;while(--n)};let pa=(e,n,t)=>(n<<e.hash_shift^t)&e.hash_mask,ge=pa;const W=e=>{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},J=(e,n)=>{qr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,W(e.strm)},B=(e,n)=>{e.pending_buf[e.pending++]=n},Pe=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},Dt=(e,n,t,i)=>{let l=e.avail_in;return l>i&&(l=i),l===0?0:(e.avail_in-=l,n.set(e.input.subarray(e.next_in,e.next_in+l),t),e.state.wrap===1?e.adler=qe(e.adler,n,l,t):e.state.wrap===2&&(e.adler=H(e.adler,n,l,t)),e.next_in+=l,e.total_in+=l,l)},Pi=(e,n)=>{let t=e.max_chain_length,i=e.strstart,l,a,f=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-re?e.strstart-(e.w_size-re):0,r=e.window,o=e.w_mask,E=e.prev,_=e.strstart+he;let h=r[i+f-1],v=r[i+f];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(l=n,!(r[l+f]!==v||r[l+f-1]!==h||r[l]!==r[i]||r[++l]!==r[i+1])){i+=2,l++;do;while(r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&i<_);if(a=he-(_-i),i=_-he,a>f){if(e.match_start=n,f=a,a>=s)break;h=r[i+f-1],v=r[i+f]}}while((n=E[n&o])>c&&--t!==0);return f<=e.lookahead?f:e.lookahead},Fe=e=>{const n=e.w_size;let t,i,l;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-re)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),_a(e),i+=n),e.strm.avail_in===0)break;if(t=Dt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=L)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=ge(e,e.ins_h,e.window[l+1]);e.insert&&(e.ins_h=ge(e,e.ins_h,e.window[l+L-1]),e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<L)););}while(e.lookahead<re&&e.strm.avail_in!==0)},Li=(e,n)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,l,a,f=0,s=e.strm.avail_in;do{if(i=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,l=e.strstart-e.block_start,i>l+e.strm.avail_in&&(i=l+e.strm.avail_in),i>a&&(i=a),i<t&&(i===0&&n!==Q||n===pe||i!==l+e.strm.avail_in)))break;f=n===Q&&i===l+e.strm.avail_in?1:0,Gt(e,0,0,f),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,W(e.strm),l&&(l>i&&(l=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+l),e.strm.next_out),e.strm.next_out+=l,e.strm.avail_out-=l,e.strm.total_out+=l,e.block_start+=l,i-=l),i&&(Dt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(f===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),f?Ce:n!==pe&&n!==Q&&e.strm.avail_in===0&&e.strstart===e.block_start?ze:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Dt(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,l=e.strstart-e.block_start,(l>=t||(l||n===Q)&&n!==pe&&e.strm.avail_in===0&&l<=a)&&(i=l>a?a:l,f=n===Q&&e.strm.avail_in===0&&i===l?1:0,Gt(e,e.block_start,i,f),e.block_start+=i,W(e.strm)),f?me:X)},Nt=(e,n)=>{let t,i;for(;;){if(e.lookahead<re){if(Fe(e),e.lookahead<re&&n===pe)return X;if(e.lookahead===0)break}if(t=0,e.lookahead>=L&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+L-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-re&&(e.match_length=Pi(e,t)),e.match_length>=L)if(i=_e(e,e.strstart-e.match_start,e.match_length-L),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=L){e.match_length--;do e.strstart++,e.ins_h=ge(e,e.ins_h,e.window[e.strstart+L-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ge(e,e.ins_h,e.window[e.strstart+1]);else i=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=e.strstart<L-1?e.strstart:L-1,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},Te=(e,n)=>{let t,i,l;for(;;){if(e.lookahead<re){if(Fe(e),e.lookahead<re&&n===pe)return X;if(e.lookahead===0)break}if(t=0,e.lookahead>=L&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+L-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=L-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-re&&(e.match_length=Pi(e,t),e.match_length<=5&&(e.strategy===Qr||e.match_length===L&&e.strstart-e.match_start>4096)&&(e.match_length=L-1)),e.prev_length>=L&&e.match_length<=e.prev_length){l=e.strstart+e.lookahead-L,i=_e(e,e.strstart-1-e.prev_match,e.prev_length-L),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=l&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+L-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=L-1,e.strstart++,i&&(J(e,!1),e.strm.avail_out===0))return X}else if(e.match_available){if(i=_e(e,0,e.window[e.strstart-1]),i&&J(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return X}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=_e(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<L-1?e.strstart:L-1,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},ga=(e,n)=>{let t,i,l,a;const f=e.window;for(;;){if(e.lookahead<=he){if(Fe(e),e.lookahead<=he&&n===pe)return X;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=L&&e.strstart>0&&(l=e.strstart-1,i=f[l],i===f[++l]&&i===f[++l]&&i===f[++l])){a=e.strstart+he;do;while(i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&l<a);e.match_length=he-(a-l),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=L?(t=_e(e,1,e.match_length-L),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=0,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},ba=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(Fe(e),e.lookahead===0)){if(n===pe)return X;break}if(e.match_length=0,t=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=0,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze};function te(e,n,t,i,l){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=l}const Ze=[new te(0,0,0,0,Li),new te(4,4,8,4,Nt),new te(4,5,16,8,Nt),new te(4,6,32,32,Nt),new te(4,4,16,16,Te),new te(8,16,32,32,Te),new te(8,16,128,128,Te),new te(8,32,128,256,Te),new te(32,128,258,1024,Te),new te(32,258,258,4096,Te)],wa=e=>{e.window_size=2*e.w_size,ue(e.head),e.max_lazy_match=Ze[e.level].max_lazy,e.good_match=Ze[e.level].good_length,e.nice_match=Ze[e.level].nice_length,e.max_chain_length=Ze[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=L-1,e.match_available=0,e.ins_h=0};function ya(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ca*2),this.dyn_dtree=new Uint16Array((2*la+1)*2),this.bl_tree=new Uint16Array((2*fa+1)*2),ue(this.dyn_ltree),ue(this.dyn_dtree),ue(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(da+1),this.heap=new Uint16Array(2*Kt+1),ue(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Kt+1),ue(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Qe=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==Oe&&n.status!==sn&&n.status!==Yt&&n.status!==Wt&&n.status!==Jt&&n.status!==Qt&&n.status!==we&&n.status!==$e?1:0},$i=e=>{if(Qe(e))return ye(e,ie);e.total_in=e.total_out=0,e.data_type=na;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?sn:n.wrap?Oe:we,e.adler=n.wrap===2?0:1,n.last_flush=-2,Xr(n),V},Zi=e=>{const n=$i(e);return n===V&&wa(e.state),n},xa=(e,n)=>Qe(e)||e.state.wrap!==2?ie:(e.state.gzhead=n,V),Bi=(e,n,t,i,l,a)=>{if(!e)return ie;let f=1;if(n===Jr&&(n=6),i<0?(f=0,i=-i):i>15&&(f=2,i-=16),l<1||l>ia||t!==_t||i<8||i>15||n<0||n>9||a<0||a>ea||i===8&&f!==1)return ye(e,ie);i===8&&(i=9);const s=new ya;return e.state=s,s.strm=e,s.status=Oe,s.wrap=f,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=l+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+L-1)/L),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<l+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=n,s.strategy=a,s.method=t,Zi(e)},ma=(e,n)=>Bi(e,n,_t,ra,aa,ta),Ea=(e,n)=>{if(Qe(e)||n>xn||n<0)return e?ye(e,ie):ie;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===$e&&n!==Q)return ye(e,e.avail_out===0?vt:ie);const i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(W(e),e.avail_out===0)return t.last_flush=-1,V}else if(e.avail_in===0&&En(n)<=En(i)&&n!==Q)return ye(e,vt);if(t.status===$e&&e.avail_in!==0)return ye(e,vt);if(t.status===Oe&&t.wrap===0&&(t.status=we),t.status===Oe){let l=_t+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=nt||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,l|=a<<6,t.strstart!==0&&(l|=ua),l+=31-l%31,Pe(t,l),t.strstart!==0&&(Pe(t,e.adler>>>16),Pe(t,e.adler&65535)),e.adler=1,t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(t.status===sn){if(e.adler=0,B(t,31),B(t,139),B(t,8),t.gzhead)B(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),B(t,t.gzhead.time&255),B(t,t.gzhead.time>>8&255),B(t,t.gzhead.time>>16&255),B(t,t.gzhead.time>>24&255),B(t,t.level===9?2:t.strategy>=nt||t.level<2?4:0),B(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(B(t,t.gzhead.extra.length&255),B(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=H(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Yt;else if(B(t,0),B(t,0),B(t,0),B(t,0),B(t,0),B(t,t.level===9?2:t.strategy>=nt||t.level<2?4:0),B(t,ha),t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(t.status===Yt){if(t.gzhead.extra){let l=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex+=s,W(e),t.pending!==0)return t.last_flush=-1,V;l=0,a-=s}let f=new Uint8Array(t.gzhead.extra);t.pending_buf.set(f.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex=0}t.status=Wt}if(t.status===Wt){if(t.gzhead.name){let l=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),W(e),t.pending!==0)return t.last_flush=-1,V;l=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,B(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex=0}t.status=Jt}if(t.status===Jt){if(t.gzhead.comment){let l=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),W(e),t.pending!==0)return t.last_flush=-1,V;l=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,B(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l))}t.status=Qt}if(t.status===Qt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(W(e),t.pending!==0))return t.last_flush=-1,V;B(t,e.adler&255),B(t,e.adler>>8&255),e.adler=0}if(t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(e.avail_in!==0||t.lookahead!==0||n!==pe&&t.status!==$e){let l=t.level===0?Li(t,n):t.strategy===nt?ba(t,n):t.strategy===Dr?ga(t,n):Ze[t.level].func(t,n);if((l===me||l===Ce)&&(t.status=$e),l===X||l===me)return e.avail_out===0&&(t.last_flush=-1),V;if(l===ze&&(n===Kr?Gr(t):n!==xn&&(Gt(t,0,0,!1),n===Yr&&(ue(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),W(e),e.avail_out===0))return t.last_flush=-1,V}return n!==Q?V:t.wrap<=0?mn:(t.wrap===2?(B(t,e.adler&255),B(t,e.adler>>8&255),B(t,e.adler>>16&255),B(t,e.adler>>24&255),B(t,e.total_in&255),B(t,e.total_in>>8&255),B(t,e.total_in>>16&255),B(t,e.total_in>>24&255)):(Pe(t,e.adler>>>16),Pe(t,e.adler&65535)),W(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?V:mn)},va=e=>{if(Qe(e))return ie;const n=e.state.status;return e.state=null,n===we?ye(e,Wr):V},Na=(e,n)=>{let t=n.length;if(Qe(e))return ie;const i=e.state,l=i.wrap;if(l===2||l===1&&i.status!==Oe||i.lookahead)return ie;if(l===1&&(e.adler=qe(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){l===0&&(ue(i.head),i.strstart=0,i.block_start=0,i.insert=0);let c=new Uint8Array(i.w_size);c.set(n.subarray(t-i.w_size,t),0),n=c,t=i.w_size}const a=e.avail_in,f=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,Fe(i);i.lookahead>=L;){let c=i.strstart,r=i.lookahead-(L-1);do i.ins_h=ge(i,i.ins_h,i.window[c+L-1]),i.prev[c&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=c,c++;while(--r);i.strstart=c,i.lookahead=L-1,Fe(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=L-1,i.match_available=0,e.next_in=f,e.input=s,e.avail_in=a,i.wrap=l,V};var ka=ma,Ta=Bi,Aa=Zi,Sa=$i,Oa=xa,Fa=Ea,Ia=va,Ra=Na,za="pako deflate (from Nodeca project)",Ue={deflateInit:ka,deflateInit2:Ta,deflateReset:Aa,deflateResetKeep:Sa,deflateSetHeader:Oa,deflate:Fa,deflateEnd:Ia,deflateSetDictionary:Ra,deflateInfo:za};const Ca=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var Pa=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)Ca(t,i)&&(e[i]=t[i])}}return e},La=e=>{let n=0;for(let i=0,l=e.length;i<l;i++)n+=e[i].length;const t=new Uint8Array(n);for(let i=0,l=0,a=e.length;i<a;i++){let f=e[i];t.set(f,l),l+=f.length}return t},pt={assign:Pa,flattenChunks:La};let Ui=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ui=!1}const Ge=new Uint8Array(256);for(let e=0;e<256;e++)Ge[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ge[254]=Ge[254]=1;var $a=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,l,a,f=e.length,s=0;for(l=0;l<f;l++)t=e.charCodeAt(l),(t&64512)===55296&&l+1<f&&(i=e.charCodeAt(l+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),l++)),s+=t<128?1:t<2048?2:t<65536?3:4;for(n=new Uint8Array(s),a=0,l=0;a<s;l++)t=e.charCodeAt(l),(t&64512)===55296&&l+1<f&&(i=e.charCodeAt(l+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),l++)),t<128?n[a++]=t:t<2048?(n[a++]=192|t>>>6,n[a++]=128|t&63):t<65536?(n[a++]=224|t>>>12,n[a++]=128|t>>>6&63,n[a++]=128|t&63):(n[a++]=240|t>>>18,n[a++]=128|t>>>12&63,n[a++]=128|t>>>6&63,n[a++]=128|t&63);return n};const Za=(e,n)=>{if(n<65534&&e.subarray&&Ui)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i<n;i++)t+=String.fromCharCode(e[i]);return t};var Ba=(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,l;const a=new Array(t*2);for(l=0,i=0;i<t;){let f=e[i++];if(f<128){a[l++]=f;continue}let s=Ge[f];if(s>4){a[l++]=65533,i+=s-1;continue}for(f&=s===2?31:s===3?15:7;s>1&&i<t;)f=f<<6|e[i++]&63,s--;if(s>1){a[l++]=65533;continue}f<65536?a[l++]=f:(f-=65536,a[l++]=55296|f>>10&1023,a[l++]=56320|f&1023)}return Za(a,l)},Ua=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+Ge[e[t]]>n?t:n},Ke={string2buf:$a,buf2string:Ba,utf8border:Ua};function Ma(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Mi=Ma;const ji=Object.prototype.toString,{Z_NO_FLUSH:ja,Z_SYNC_FLUSH:Ha,Z_FULL_FLUSH:Va,Z_FINISH:Xa,Z_OK:ut,Z_STREAM_END:qa,Z_DEFAULT_COMPRESSION:Ga,Z_DEFAULT_STRATEGY:Ka,Z_DEFLATED:Ya}=Je;function De(e){this.options=pt.assign({level:Ga,method:Ya,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ka},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mi,this.strm.avail_out=0;let t=Ue.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==ut)throw new Error(xe[t]);if(n.header&&Ue.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Ke.string2buf(n.dictionary):ji.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=Ue.deflateSetDictionary(this.strm,i),t!==ut)throw new Error(xe[t]);this._dict_set=!0}}De.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let l,a;if(this.ended)return!1;for(n===~~n?a=n:a=n===!0?Xa:ja,typeof e=="string"?t.input=Ke.string2buf(e):ji.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===Ha||a===Va)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(l=Ue.deflate(t,a),l===qa)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),l=Ue.deflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===ut;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};De.prototype.onData=function(e){this.chunks.push(e)};De.prototype.onEnd=function(e){e===ut&&(this.result=pt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function on(e,n){const t=new De(n);if(t.push(e,!0),t.err)throw t.msg||xe[t.err];return t.result}function Wa(e,n){return n=n||{},n.raw=!0,on(e,n)}function Ja(e,n){return n=n||{},n.gzip=!0,on(e,n)}var Qa=De,Da=on,es=Wa,ts=Ja,ns={Deflate:Qa,deflate:Da,deflateRaw:es,gzip:ts};const it=16209,is=16191;var rs=function(n,t){let i,l,a,f,s,c,r,o,E,_,h,v,T,I,d,g,N,k,u,p,b,A,y,m;const O=n.state;i=n.next_in,y=n.input,l=i+(n.avail_in-5),a=n.next_out,m=n.output,f=a-(t-n.avail_out),s=a+(n.avail_out-257),c=O.dmax,r=O.wsize,o=O.whave,E=O.wnext,_=O.window,h=O.hold,v=O.bits,T=O.lencode,I=O.distcode,d=(1<<O.lenbits)-1,g=(1<<O.distbits)-1;e:do{v<15&&(h+=y[i++]<<v,v+=8,h+=y[i++]<<v,v+=8),N=T[h&d];t:for(;;){if(k=N>>>24,h>>>=k,v-=k,k=N>>>16&255,k===0)m[a++]=N&65535;else if(k&16){u=N&65535,k&=15,k&&(v<k&&(h+=y[i++]<<v,v+=8),u+=h&(1<<k)-1,h>>>=k,v-=k),v<15&&(h+=y[i++]<<v,v+=8,h+=y[i++]<<v,v+=8),N=I[h&g];n:for(;;){if(k=N>>>24,h>>>=k,v-=k,k=N>>>16&255,k&16){if(p=N&65535,k&=15,v<k&&(h+=y[i++]<<v,v+=8,v<k&&(h+=y[i++]<<v,v+=8)),p+=h&(1<<k)-1,p>c){n.msg="invalid distance too far back",O.mode=it;break e}if(h>>>=k,v-=k,k=a-f,p>k){if(k=p-k,k>o&&O.sane){n.msg="invalid distance too far back",O.mode=it;break e}if(b=0,A=_,E===0){if(b+=r-k,k<u){u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}}else if(E<k){if(b+=r+E-k,k-=E,k<u){u-=k;do m[a++]=_[b++];while(--k);if(b=0,E<u){k=E,u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}}}else if(b+=E-k,k<u){u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}for(;u>2;)m[a++]=A[b++],m[a++]=A[b++],m[a++]=A[b++],u-=3;u&&(m[a++]=A[b++],u>1&&(m[a++]=A[b++]))}else{b=a-p;do m[a++]=m[b++],m[a++]=m[b++],m[a++]=m[b++],u-=3;while(u>2);u&&(m[a++]=m[b++],u>1&&(m[a++]=m[b++]))}}else if((k&64)===0){N=I[(N&65535)+(h&(1<<k)-1)];continue n}else{n.msg="invalid distance code",O.mode=it;break e}break}}else if((k&64)===0){N=T[(N&65535)+(h&(1<<k)-1)];continue t}else if(k&32){O.mode=is;break e}else{n.msg="invalid literal/length code",O.mode=it;break e}break}}while(i<l&&a<s);u=v>>3,i-=u,v-=u<<3,h&=(1<<v)-1,n.next_in=i,n.next_out=a,n.avail_in=i<l?5+(l-i):5-(i-l),n.avail_out=a<s?257+(s-a):257-(a-s),O.hold=h,O.bits=v};const Ae=15,vn=852,Nn=592,kn=0,kt=1,Tn=2,as=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ss=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),os=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ls=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),fs=(e,n,t,i,l,a,f,s)=>{const c=s.bits;let r=0,o=0,E=0,_=0,h=0,v=0,T=0,I=0,d=0,g=0,N,k,u,p,b,A=null,y;const m=new Uint16Array(Ae+1),O=new Uint16Array(Ae+1);let w=null,x,S,F;for(r=0;r<=Ae;r++)m[r]=0;for(o=0;o<i;o++)m[n[t+o]]++;for(h=c,_=Ae;_>=1&&m[_]===0;_--);if(h>_&&(h=_),_===0)return l[a++]=1<<24|64<<16|0,l[a++]=1<<24|64<<16|0,s.bits=1,0;for(E=1;E<_&&m[E]===0;E++);for(h<E&&(h=E),I=1,r=1;r<=Ae;r++)if(I<<=1,I-=m[r],I<0)return-1;if(I>0&&(e===kn||_!==1))return-1;for(O[1]=0,r=1;r<Ae;r++)O[r+1]=O[r]+m[r];for(o=0;o<i;o++)n[t+o]!==0&&(f[O[n[t+o]]++]=o);if(e===kn?(A=w=f,y=20):e===kt?(A=as,w=ss,y=257):(A=os,w=ls,y=0),g=0,o=0,r=E,b=a,v=h,T=0,u=-1,d=1<<h,p=d-1,e===kt&&d>vn||e===Tn&&d>Nn)return 1;for(;;){x=r-T,f[o]+1<y?(S=0,F=f[o]):f[o]>=y?(S=w[f[o]-y],F=A[f[o]-y]):(S=96,F=0),N=1<<r-T,k=1<<v,E=k;do k-=N,l[b+(g>>T)+k]=x<<24|S<<16|F|0;while(k!==0);for(N=1<<r-1;g&N;)N>>=1;if(N!==0?(g&=N-1,g+=N):g=0,o++,--m[r]===0){if(r===_)break;r=n[t+f[o]]}if(r>h&&(g&p)!==u){for(T===0&&(T=h),b+=E,v=r-T,I=1<<v;v+T<_&&(I-=m[v+T],!(I<=0));)v++,I<<=1;if(d+=1<<v,e===kt&&d>vn||e===Tn&&d>Nn)return 1;u=g&p,l[u]=h<<24|v<<16|b-a|0}}return g!==0&&(l[b+g]=r-T<<24|64<<16|0),s.bits=h,0};var Me=fs;const cs=0,Hi=1,Vi=2,{Z_FINISH:An,Z_BLOCK:ds,Z_TREES:rt,Z_OK:Ee,Z_STREAM_END:us,Z_NEED_DICT:hs,Z_STREAM_ERROR:D,Z_DATA_ERROR:Xi,Z_MEM_ERROR:qi,Z_BUF_ERROR:_s,Z_DEFLATED:Sn}=Je,gt=16180,On=16181,Fn=16182,In=16183,Rn=16184,zn=16185,Cn=16186,Pn=16187,Ln=16188,$n=16189,ht=16190,oe=16191,Tt=16192,Zn=16193,At=16194,Bn=16195,Un=16196,Mn=16197,jn=16198,at=16199,st=16200,Hn=16201,Vn=16202,Xn=16203,qn=16204,Gn=16205,St=16206,Kn=16207,Yn=16208,j=16209,Gi=16210,Ki=16211,ps=852,gs=592,bs=15,ws=bs,Wn=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ys(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ve=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.mode<gt||n.mode>Ki?1:0},Yi=e=>{if(ve(e))return D;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=gt,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(ps),n.distcode=n.distdyn=new Int32Array(gs),n.sane=1,n.back=-1,Ee},Wi=e=>{if(ve(e))return D;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,Yi(e)},Ji=(e,n)=>{let t;if(ve(e))return D;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?D:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,Wi(e))},Qi=(e,n)=>{if(!e)return D;const t=new ys;e.state=t,t.strm=e,t.window=null,t.mode=gt;const i=Ji(e,n);return i!==Ee&&(e.state=null),i},xs=e=>Qi(e,ws);let Jn=!0,Ot,Ft;const ms=e=>{if(Jn){Ot=new Int32Array(512),Ft=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Me(Hi,e.lens,0,288,Ot,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Me(Vi,e.lens,0,32,Ft,0,e.work,{bits:5}),Jn=!1}e.lencode=Ot,e.lenbits=9,e.distcode=Ft,e.distbits=5},Di=(e,n,t,i)=>{let l;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(n.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(l=a.wsize-a.wnext,l>i&&(l=i),a.window.set(n.subarray(t-i,t-i+l),a.wnext),i-=l,i?(a.window.set(n.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=l,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=l))),0},Es=(e,n)=>{let t,i,l,a,f,s,c,r,o,E,_,h,v,T,I=0,d,g,N,k,u,p,b,A;const y=new Uint8Array(4);let m,O;const w=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ve(e)||!e.output||!e.input&&e.avail_in!==0)return D;t=e.state,t.mode===oe&&(t.mode=Tt),f=e.next_out,l=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,o=t.bits,E=s,_=c,A=Ee;e:for(;;)switch(t.mode){case gt:if(t.wrap===0){t.mode=Tt;break}for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&2&&r===35615){t.wbits===0&&(t.wbits=15),t.check=0,y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0),r=0,o=0,t.mode=On;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((r&255)<<8)+(r>>8))%31){e.msg="incorrect header check",t.mode=j;break}if((r&15)!==Sn){e.msg="unknown compression method",t.mode=j;break}if(r>>>=4,o-=4,b=(r&15)+8,t.wbits===0&&(t.wbits=b),b>15||b>t.wbits){e.msg="invalid window size",t.mode=j;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=r&512?$n:oe,r=0,o=0;break;case On:for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.flags=r,(t.flags&255)!==Sn){e.msg="unknown compression method",t.mode=j;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=j;break}t.head&&(t.head.text=r>>8&1),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0,t.mode=Fn;case Fn:for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.head&&(t.head.time=r),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,y[2]=r>>>16&255,y[3]=r>>>24&255,t.check=H(t.check,y,4,0)),r=0,o=0,t.mode=In;case In:for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.head&&(t.head.xflags=r&255,t.head.os=r>>8),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0,t.mode=Rn;case Rn:if(t.flags&1024){for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.length=r,t.head&&(t.head.extra_len=r),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0}else t.head&&(t.head.extra=null);t.mode=zn;case zn:if(t.flags&1024&&(h=t.length,h>s&&(h=s),h&&(t.head&&(b=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+h),b)),t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,t.length-=h),t.length))break e;t.length=0,t.mode=Cn;case Cn:if(t.flags&2048){if(s===0)break e;h=0;do b=i[a+h++],t.head&&b&&t.length<65536&&(t.head.name+=String.fromCharCode(b));while(b&&h<s);if(t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,b)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Pn;case Pn:if(t.flags&4096){if(s===0)break e;h=0;do b=i[a+h++],t.head&&b&&t.length<65536&&(t.head.comment+=String.fromCharCode(b));while(b&&h<s);if(t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,b)break e}else t.head&&(t.head.comment=null);t.mode=Ln;case Ln:if(t.flags&512){for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&4&&r!==(t.check&65535)){e.msg="header crc mismatch",t.mode=j;break}r=0,o=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=oe;break;case $n:for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}e.adler=t.check=Wn(r),r=0,o=0,t.mode=ht;case ht:if(t.havedict===0)return e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,hs;e.adler=t.check=1,t.mode=oe;case oe:if(n===ds||n===rt)break e;case Tt:if(t.last){r>>>=o&7,o-=o&7,t.mode=St;break}for(;o<3;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}switch(t.last=r&1,r>>>=1,o-=1,r&3){case 0:t.mode=Zn;break;case 1:if(ms(t),t.mode=at,n===rt){r>>>=2,o-=2;break e}break;case 2:t.mode=Un;break;case 3:e.msg="invalid block type",t.mode=j}r>>>=2,o-=2;break;case Zn:for(r>>>=o&7,o-=o&7;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if((r&65535)!==(r>>>16^65535)){e.msg="invalid stored block lengths",t.mode=j;break}if(t.length=r&65535,r=0,o=0,t.mode=At,n===rt)break e;case At:t.mode=Bn;case Bn:if(h=t.length,h){if(h>s&&(h=s),h>c&&(h=c),h===0)break e;l.set(i.subarray(a,a+h),f),s-=h,a+=h,c-=h,f+=h,t.length-=h;break}t.mode=oe;break;case Un:for(;o<14;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.nlen=(r&31)+257,r>>>=5,o-=5,t.ndist=(r&31)+1,r>>>=5,o-=5,t.ncode=(r&15)+4,r>>>=4,o-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=j;break}t.have=0,t.mode=Mn;case Mn:for(;t.have<t.ncode;){for(;o<3;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.lens[w[t.have++]]=r&7,r>>>=3,o-=3}for(;t.have<19;)t.lens[w[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,m={bits:t.lenbits},A=Me(cs,t.lens,0,19,t.lencode,0,t.work,m),t.lenbits=m.bits,A){e.msg="invalid code lengths set",t.mode=j;break}t.have=0,t.mode=jn;case jn:for(;t.have<t.nlen+t.ndist;){for(;I=t.lencode[r&(1<<t.lenbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(N<16)r>>>=d,o-=d,t.lens[t.have++]=N;else{if(N===16){for(O=d+2;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(r>>>=d,o-=d,t.have===0){e.msg="invalid bit length repeat",t.mode=j;break}b=t.lens[t.have-1],h=3+(r&3),r>>>=2,o-=2}else if(N===17){for(O=d+3;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=d,o-=d,b=0,h=3+(r&7),r>>>=3,o-=3}else{for(O=d+7;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=d,o-=d,b=0,h=11+(r&127),r>>>=7,o-=7}if(t.have+h>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=j;break}for(;h--;)t.lens[t.have++]=b}}if(t.mode===j)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=j;break}if(t.lenbits=9,m={bits:t.lenbits},A=Me(Hi,t.lens,0,t.nlen,t.lencode,0,t.work,m),t.lenbits=m.bits,A){e.msg="invalid literal/lengths set",t.mode=j;break}if(t.distbits=6,t.distcode=t.distdyn,m={bits:t.distbits},A=Me(Vi,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,m),t.distbits=m.bits,A){e.msg="invalid distances set",t.mode=j;break}if(t.mode=at,n===rt)break e;case at:t.mode=st;case st:if(s>=6&&c>=258){e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,rs(e,_),f=e.next_out,l=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,o=t.bits,t.mode===oe&&(t.back=-1);break}for(t.back=0;I=t.lencode[r&(1<<t.lenbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(g&&(g&240)===0){for(k=d,u=g,p=N;I=t.lencode[p+((r&(1<<k+u)-1)>>k)],d=I>>>24,g=I>>>16&255,N=I&65535,!(k+d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=k,o-=k,t.back+=k}if(r>>>=d,o-=d,t.back+=d,t.length=N,g===0){t.mode=Gn;break}if(g&32){t.back=-1,t.mode=oe;break}if(g&64){e.msg="invalid literal/length code",t.mode=j;break}t.extra=g&15,t.mode=Hn;case Hn:if(t.extra){for(O=t.extra;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.length+=r&(1<<t.extra)-1,r>>>=t.extra,o-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Vn;case Vn:for(;I=t.distcode[r&(1<<t.distbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if((g&240)===0){for(k=d,u=g,p=N;I=t.distcode[p+((r&(1<<k+u)-1)>>k)],d=I>>>24,g=I>>>16&255,N=I&65535,!(k+d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=k,o-=k,t.back+=k}if(r>>>=d,o-=d,t.back+=d,g&64){e.msg="invalid distance code",t.mode=j;break}t.offset=N,t.extra=g&15,t.mode=Xn;case Xn:if(t.extra){for(O=t.extra;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.offset+=r&(1<<t.extra)-1,r>>>=t.extra,o-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=j;break}t.mode=qn;case qn:if(c===0)break e;if(h=_-c,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=j;break}h>t.wnext?(h-=t.wnext,v=t.wsize-h):v=t.wnext-h,h>t.length&&(h=t.length),T=t.window}else T=l,v=f-t.offset,h=t.length;h>c&&(h=c),c-=h,t.length-=h;do l[f++]=T[v++];while(--h);t.length===0&&(t.mode=st);break;case Gn:if(c===0)break e;l[f++]=t.length,c--,t.mode=st;break;case St:if(t.wrap){for(;o<32;){if(s===0)break e;s--,r|=i[a++]<<o,o+=8}if(_-=c,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?H(t.check,l,_,f-_):qe(t.check,l,_,f-_)),_=c,t.wrap&4&&(t.flags?r:Wn(r))!==t.check){e.msg="incorrect data check",t.mode=j;break}r=0,o=0}t.mode=Kn;case Kn:if(t.wrap&&t.flags){for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&4&&r!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=j;break}r=0,o=0}t.mode=Yn;case Yn:A=us;break e;case j:A=Xi;break e;case Gi:return qi;case Ki:default:return D}return e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,(t.wsize||_!==e.avail_out&&t.mode<j&&(t.mode<St||n!==An))&&Di(e,e.output,e.next_out,_-e.avail_out),E-=e.avail_in,_-=e.avail_out,e.total_in+=E,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?H(t.check,l,_,e.next_out-_):qe(t.check,l,_,e.next_out-_)),e.data_type=t.bits+(t.last?64:0)+(t.mode===oe?128:0)+(t.mode===at||t.mode===At?256:0),(E===0&&_===0||n===An)&&A===Ee&&(A=_s),A},vs=e=>{if(ve(e))return D;let n=e.state;return n.window&&(n.window=null),e.state=null,Ee},Ns=(e,n)=>{if(ve(e))return D;const t=e.state;return(t.wrap&2)===0?D:(t.head=n,n.done=!1,Ee)},ks=(e,n)=>{const t=n.length;let i,l,a;return ve(e)||(i=e.state,i.wrap!==0&&i.mode!==ht)?D:i.mode===ht&&(l=1,l=qe(l,n,t,0),l!==i.check)?Xi:(a=Di(e,n,t,t),a?(i.mode=Gi,qi):(i.havedict=1,Ee))};var Ts=Wi,As=Ji,Ss=Yi,Os=xs,Fs=Qi,Is=Es,Rs=vs,zs=Ns,Cs=ks,Ps="pako inflate (from Nodeca project)",fe={inflateReset:Ts,inflateReset2:As,inflateResetKeep:Ss,inflateInit:Os,inflateInit2:Fs,inflate:Is,inflateEnd:Rs,inflateGetHeader:zs,inflateSetDictionary:Cs,inflateInfo:Ps};function Ls(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var $s=Ls;const er=Object.prototype.toString,{Z_NO_FLUSH:Zs,Z_FINISH:Bs,Z_OK:Ye,Z_STREAM_END:It,Z_NEED_DICT:Rt,Z_STREAM_ERROR:Us,Z_DATA_ERROR:Qn,Z_MEM_ERROR:Ms}=Je;function et(e){this.options=pt.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mi,this.strm.avail_out=0;let t=fe.inflateInit2(this.strm,n.windowBits);if(t!==Ye)throw new Error(xe[t]);if(this.header=new $s,fe.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Ke.string2buf(n.dictionary):er.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=fe.inflateSetDictionary(this.strm,n.dictionary),t!==Ye)))throw new Error(xe[t])}et.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,l=this.options.dictionary;let a,f,s;if(this.ended)return!1;for(n===~~n?f=n:f=n===!0?Bs:Zs,er.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=fe.inflate(t,f),a===Rt&&l&&(a=fe.inflateSetDictionary(t,l),a===Ye?a=fe.inflate(t,f):a===Qn&&(a=Rt));t.avail_in>0&&a===It&&t.state.wrap>0&&e[t.next_in]!==0;)fe.inflateReset(t),a=fe.inflate(t,f);switch(a){case Us:case Qn:case Rt:case Ms:return this.onEnd(a),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||a===It))if(this.options.to==="string"){let c=Ke.utf8border(t.output,t.next_out),r=t.next_out-c,o=Ke.buf2string(t.output,c);t.next_out=r,t.avail_out=i-r,r&&t.output.set(t.output.subarray(c,c+r),0),this.onData(o)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ye&&s===0)){if(a===It)return a=fe.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};et.prototype.onData=function(e){this.chunks.push(e)};et.prototype.onEnd=function(e){e===Ye&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=pt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ln(e,n){const t=new et(n);if(t.push(e),t.err)throw t.msg||xe[t.err];return t.result}function js(e,n){return n=n||{},n.raw=!0,ln(e,n)}var Hs=et,Vs=ln,Xs=js,qs=ln,Gs={Inflate:Hs,inflate:Vs,inflateRaw:Xs,ungzip:qs};const{Deflate:Ks,deflate:Ys,deflateRaw:Ws,gzip:Js}=ns,{Inflate:Qs,inflate:Ds,inflateRaw:eo,ungzip:to}=Gs;var no=Ks,io=Ys,ro=Ws,ao=Js,so=Qs,oo=Ds,lo=eo,fo=to,co=Je,uo={Deflate:no,deflate:io,deflateRaw:ro,gzip:ao,Inflate:so,inflate:oo,inflateRaw:lo,ungzip:fo,constants:co},ot={exports:{}},zt={},Ct={},Dn;function fn(){return Dn||(Dn=1,function(e){const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",i="["+n+"]["+t+"]*",l=new RegExp("^"+i+"$"),a=function(s,c){const r=[];let o=c.exec(s);for(;o;){const E=[];E.startIndex=c.lastIndex-o[0].length;const _=o.length;for(let h=0;h<_;h++)E.push(o[h]);r.push(E),o=c.exec(s)}return r},f=function(s){const c=l.exec(s);return!(c===null||typeof c>"u")};e.isExist=function(s){return typeof s<"u"},e.isEmptyObject=function(s){return Object.keys(s).length===0},e.merge=function(s,c,r){if(c){const o=Object.keys(c),E=o.length;for(let _=0;_<E;_++)r==="strict"?s[o[_]]=[c[o[_]]]:s[o[_]]=c[o[_]]}},e.getValue=function(s){return e.isExist(s)?s:""},e.isName=f,e.getAllMatches=a,e.nameRegexp=i}(Ct)),Ct}var ei;function tr(){if(ei)return zt;ei=1;const e=fn(),n={allowBooleanAttributes:!1,unpairedTags:[]};zt.validate=function(d,g){g=Object.assign({},n,g);const N=[];let k=!1,u=!1;d[0]==="\uFEFF"&&(d=d.substr(1));for(let p=0;p<d.length;p++)if(d[p]==="<"&&d[p+1]==="?"){if(p+=2,p=i(d,p),p.err)return p}else if(d[p]==="<"){let b=p;if(p++,d[p]==="!"){p=l(d,p);continue}else{let A=!1;d[p]==="/"&&(A=!0,p++);let y="";for(;p<d.length&&d[p]!==">"&&d[p]!==" "&&d[p]!==" "&&d[p]!==`
|
|
2
|
+
`&&d[p]!=="\r";p++)y+=d[p];if(y=y.trim(),y[y.length-1]==="/"&&(y=y.substring(0,y.length-1),p--),!v(y)){let w;return y.trim().length===0?w="Invalid space after '<'.":w="Tag '"+y+"' is an invalid name.",_("InvalidTag",w,T(d,p))}const m=s(d,p);if(m===!1)return _("InvalidAttr","Attributes for '"+y+"' have open quote.",T(d,p));let O=m.value;if(p=m.index,O[O.length-1]==="/"){const w=p-O.length;O=O.substring(0,O.length-1);const x=r(O,g);if(x===!0)k=!0;else return _(x.err.code,x.err.msg,T(d,w+x.err.line))}else if(A)if(m.tagClosed){if(O.trim().length>0)return _("InvalidTag","Closing tag '"+y+"' can't have attributes or invalid starting.",T(d,b));if(N.length===0)return _("InvalidTag","Closing tag '"+y+"' has not been opened.",T(d,b));{const w=N.pop();if(y!==w.tagName){let x=T(d,w.tagStartPos);return _("InvalidTag","Expected closing tag '"+w.tagName+"' (opened in line "+x.line+", col "+x.col+") instead of closing tag '"+y+"'.",T(d,b))}N.length==0&&(u=!0)}}else return _("InvalidTag","Closing tag '"+y+"' doesn't have proper closing.",T(d,p));else{const w=r(O,g);if(w!==!0)return _(w.err.code,w.err.msg,T(d,p-O.length+w.err.line));if(u===!0)return _("InvalidXml","Multiple possible root nodes found.",T(d,p));g.unpairedTags.indexOf(y)!==-1||N.push({tagName:y,tagStartPos:b}),k=!0}for(p++;p<d.length;p++)if(d[p]==="<")if(d[p+1]==="!"){p++,p=l(d,p);continue}else if(d[p+1]==="?"){if(p=i(d,++p),p.err)return p}else break;else if(d[p]==="&"){const w=E(d,p);if(w==-1)return _("InvalidChar","char '&' is not expected.",T(d,p));p=w}else if(u===!0&&!t(d[p]))return _("InvalidXml","Extra text at the end",T(d,p));d[p]==="<"&&p--}}else{if(t(d[p]))continue;return _("InvalidChar","char '"+d[p]+"' is not expected.",T(d,p))}if(k){if(N.length==1)return _("InvalidTag","Unclosed tag '"+N[0].tagName+"'.",T(d,N[0].tagStartPos));if(N.length>0)return _("InvalidXml","Invalid '"+JSON.stringify(N.map(p=>p.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return _("InvalidXml","Start tag expected.",1);return!0};function t(d){return d===" "||d===" "||d===`
|
|
3
|
+
`||d==="\r"}function i(d,g){const N=g;for(;g<d.length;g++)if(d[g]=="?"||d[g]==" "){const k=d.substr(N,g-N);if(g>5&&k==="xml")return _("InvalidXml","XML declaration allowed only at the start of the document.",T(d,g));if(d[g]=="?"&&d[g+1]==">"){g++;break}else continue}return g}function l(d,g){if(d.length>g+5&&d[g+1]==="-"&&d[g+2]==="-"){for(g+=3;g<d.length;g++)if(d[g]==="-"&&d[g+1]==="-"&&d[g+2]===">"){g+=2;break}}else if(d.length>g+8&&d[g+1]==="D"&&d[g+2]==="O"&&d[g+3]==="C"&&d[g+4]==="T"&&d[g+5]==="Y"&&d[g+6]==="P"&&d[g+7]==="E"){let N=1;for(g+=8;g<d.length;g++)if(d[g]==="<")N++;else if(d[g]===">"&&(N--,N===0))break}else if(d.length>g+9&&d[g+1]==="["&&d[g+2]==="C"&&d[g+3]==="D"&&d[g+4]==="A"&&d[g+5]==="T"&&d[g+6]==="A"&&d[g+7]==="["){for(g+=8;g<d.length;g++)if(d[g]==="]"&&d[g+1]==="]"&&d[g+2]===">"){g+=2;break}}return g}const a='"',f="'";function s(d,g){let N="",k="",u=!1;for(;g<d.length;g++){if(d[g]===a||d[g]===f)k===""?k=d[g]:k!==d[g]||(k="");else if(d[g]===">"&&k===""){u=!0;break}N+=d[g]}return k!==""?!1:{value:N,index:g,tagClosed:u}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function r(d,g){const N=e.getAllMatches(d,c),k={};for(let u=0;u<N.length;u++){if(N[u][1].length===0)return _("InvalidAttr","Attribute '"+N[u][2]+"' has no space in starting.",I(N[u]));if(N[u][3]!==void 0&&N[u][4]===void 0)return _("InvalidAttr","Attribute '"+N[u][2]+"' is without value.",I(N[u]));if(N[u][3]===void 0&&!g.allowBooleanAttributes)return _("InvalidAttr","boolean attribute '"+N[u][2]+"' is not allowed.",I(N[u]));const p=N[u][2];if(!h(p))return _("InvalidAttr","Attribute '"+p+"' is an invalid name.",I(N[u]));if(!k.hasOwnProperty(p))k[p]=1;else return _("InvalidAttr","Attribute '"+p+"' is repeated.",I(N[u]))}return!0}function o(d,g){let N=/\d/;for(d[g]==="x"&&(g++,N=/[\da-fA-F]/);g<d.length;g++){if(d[g]===";")return g;if(!d[g].match(N))break}return-1}function E(d,g){if(g++,d[g]===";")return-1;if(d[g]==="#")return g++,o(d,g);let N=0;for(;g<d.length;g++,N++)if(!(d[g].match(/\w/)&&N<20)){if(d[g]===";")break;return-1}return g}function _(d,g,N){return{err:{code:d,msg:g,line:N.line||N,col:N.col}}}function h(d){return e.isName(d)}function v(d){return e.isName(d)}function T(d,g){const N=d.substring(0,g).split(/\r?\n/);return{line:N.length,col:N[N.length-1].length+1}}function I(d){return d.startIndex+d[1].length}return zt}var lt={},ti;function ho(){if(ti)return lt;ti=1;const e={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,i){return i},attributeValueProcessor:function(t,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,i,l){return t}},n=function(t){return Object.assign({},e,t)};return lt.buildOptions=n,lt.defaultOptions=e,lt}var Pt,ni;function _o(){if(ni)return Pt;ni=1;class e{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,i){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:i})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}return Pt=e,Pt}var Lt,ii;function po(){if(ii)return Lt;ii=1;const e=fn();function n(r,o){const E={};if(r[o+3]==="O"&&r[o+4]==="C"&&r[o+5]==="T"&&r[o+6]==="Y"&&r[o+7]==="P"&&r[o+8]==="E"){o=o+9;let _=1,h=!1,v=!1,T="";for(;o<r.length;o++)if(r[o]==="<"&&!v){if(h&&l(r,o))o+=7,[entityName,val,o]=t(r,o+1),val.indexOf("&")===-1&&(E[c(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(h&&a(r,o))o+=8;else if(h&&f(r,o))o+=8;else if(h&&s(r,o))o+=9;else if(i)v=!0;else throw new Error("Invalid DOCTYPE");_++,T=""}else if(r[o]===">"){if(v?r[o-1]==="-"&&r[o-2]==="-"&&(v=!1,_--):_--,_===0)break}else r[o]==="["?h=!0:T+=r[o];if(_!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:E,i:o}}function t(r,o){let E="";for(;o<r.length&&r[o]!=="'"&&r[o]!=='"';o++)E+=r[o];if(E=E.trim(),E.indexOf(" ")!==-1)throw new Error("External entites are not supported");const _=r[o++];let h="";for(;o<r.length&&r[o]!==_;o++)h+=r[o];return[E,h,o]}function i(r,o){return r[o+1]==="!"&&r[o+2]==="-"&&r[o+3]==="-"}function l(r,o){return r[o+1]==="!"&&r[o+2]==="E"&&r[o+3]==="N"&&r[o+4]==="T"&&r[o+5]==="I"&&r[o+6]==="T"&&r[o+7]==="Y"}function a(r,o){return r[o+1]==="!"&&r[o+2]==="E"&&r[o+3]==="L"&&r[o+4]==="E"&&r[o+5]==="M"&&r[o+6]==="E"&&r[o+7]==="N"&&r[o+8]==="T"}function f(r,o){return r[o+1]==="!"&&r[o+2]==="A"&&r[o+3]==="T"&&r[o+4]==="T"&&r[o+5]==="L"&&r[o+6]==="I"&&r[o+7]==="S"&&r[o+8]==="T"}function s(r,o){return r[o+1]==="!"&&r[o+2]==="N"&&r[o+3]==="O"&&r[o+4]==="T"&&r[o+5]==="A"&&r[o+6]==="T"&&r[o+7]==="I"&&r[o+8]==="O"&&r[o+9]==="N"}function c(r){if(e.isName(r))return r;throw new Error(`Invalid entity name ${r}`)}return Lt=n,Lt}var $t,ri;function go(){if(ri)return $t;ri=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const t={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function i(a,f={}){if(f=Object.assign({},t,f),!a||typeof a!="string")return a;let s=a.trim();if(f.skipLike!==void 0&&f.skipLike.test(s))return a;if(f.hex&&e.test(s))return Number.parseInt(s,16);{const c=n.exec(s);if(c){const r=c[1],o=c[2];let E=l(c[3]);const _=c[4]||c[6];if(!f.leadingZeros&&o.length>0&&r&&s[2]!==".")return a;if(!f.leadingZeros&&o.length>0&&!r&&s[1]!==".")return a;{const h=Number(s),v=""+h;return v.search(/[eE]/)!==-1||_?f.eNotation?h:a:s.indexOf(".")!==-1?v==="0"&&E===""||v===E||r&&v==="-"+E?h:a:o?E===v||r+E===v?h:a:s===v||s===r+v?h:a}}else return a}}function l(a){return a&&a.indexOf(".")!==-1&&(a=a.replace(/0+$/,""),a==="."?a="0":a[0]==="."?a="0"+a:a[a.length-1]==="."&&(a=a.substr(0,a.length-1))),a}return $t=i,$t}var Zt,ai;function nr(){if(ai)return Zt;ai=1;function e(n){return typeof n=="function"?n:Array.isArray(n)?t=>{for(const i of n)if(typeof i=="string"&&t===i||i instanceof RegExp&&i.test(t))return!0}:()=>!1}return Zt=e,Zt}var Bt,si;function bo(){if(si)return Bt;si=1;const e=fn(),n=_o(),t=po(),i=go(),l=nr();class a{constructor(p){this.options=p,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(b,A)=>String.fromCharCode(Number.parseInt(A,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(b,A)=>String.fromCharCode(Number.parseInt(A,16))}},this.addExternalEntities=f,this.parseXml=E,this.parseTextData=s,this.resolveNameSpace=c,this.buildAttributesMap=o,this.isItStopNode=T,this.replaceEntitiesValue=h,this.readStopNodeData=N,this.saveTextToParentTag=v,this.addChild=_,this.ignoreAttributesFn=l(this.options.ignoreAttributes)}}function f(u){const p=Object.keys(u);for(let b=0;b<p.length;b++){const A=p[b];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:u[A]}}}function s(u,p,b,A,y,m,O){if(u!==void 0&&(this.options.trimValues&&!A&&(u=u.trim()),u.length>0)){O||(u=this.replaceEntitiesValue(u));const w=this.options.tagValueProcessor(p,u,b,y,m);return w==null?u:typeof w!=typeof u||w!==u?w:this.options.trimValues?k(u,this.options.parseTagValue,this.options.numberParseOptions):u.trim()===u?k(u,this.options.parseTagValue,this.options.numberParseOptions):u}}function c(u){if(this.options.removeNSPrefix){const p=u.split(":"),b=u.charAt(0)==="/"?"/":"";if(p[0]==="xmlns")return"";p.length===2&&(u=b+p[1])}return u}const r=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function o(u,p,b){if(this.options.ignoreAttributes!==!0&&typeof u=="string"){const A=e.getAllMatches(u,r),y=A.length,m={};for(let O=0;O<y;O++){const w=this.resolveNameSpace(A[O][1]);if(this.ignoreAttributesFn(w,p))continue;let x=A[O][4],S=this.options.attributeNamePrefix+w;if(w.length)if(this.options.transformAttributeName&&(S=this.options.transformAttributeName(S)),S==="__proto__"&&(S="#__proto__"),x!==void 0){this.options.trimValues&&(x=x.trim()),x=this.replaceEntitiesValue(x);const F=this.options.attributeValueProcessor(w,x,p);F==null?m[S]=x:typeof F!=typeof x||F!==x?m[S]=F:m[S]=k(x,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(m[S]=!0)}if(!Object.keys(m).length)return;if(this.options.attributesGroupName){const O={};return O[this.options.attributesGroupName]=m,O}return m}}const E=function(u){u=u.replace(/\r\n?/g,`
|
|
4
|
+
`);const p=new n("!xml");let b=p,A="",y="";for(let m=0;m<u.length;m++)if(u[m]==="<")if(u[m+1]==="/"){const w=d(u,">",m,"Closing Tag is not closed.");let x=u.substring(m+2,w).trim();if(this.options.removeNSPrefix){const R=x.indexOf(":");R!==-1&&(x=x.substr(R+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),b&&(A=this.saveTextToParentTag(A,b,y));const S=y.substring(y.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let F=0;S&&this.options.unpairedTags.indexOf(S)!==-1?(F=y.lastIndexOf(".",y.lastIndexOf(".")-1),this.tagsNodeStack.pop()):F=y.lastIndexOf("."),y=y.substring(0,F),b=this.tagsNodeStack.pop(),A="",m=w}else if(u[m+1]==="?"){let w=g(u,m,!1,"?>");if(!w)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,b,y),!(this.options.ignoreDeclaration&&w.tagName==="?xml"||this.options.ignorePiTags)){const x=new n(w.tagName);x.add(this.options.textNodeName,""),w.tagName!==w.tagExp&&w.attrExpPresent&&(x[":@"]=this.buildAttributesMap(w.tagExp,y,w.tagName)),this.addChild(b,x,y)}m=w.closeIndex+1}else if(u.substr(m+1,3)==="!--"){const w=d(u,"-->",m+4,"Comment is not closed.");if(this.options.commentPropName){const x=u.substring(m+4,w-2);A=this.saveTextToParentTag(A,b,y),b.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}m=w}else if(u.substr(m+1,2)==="!D"){const w=t(u,m);this.docTypeEntities=w.entities,m=w.i}else if(u.substr(m+1,2)==="!["){const w=d(u,"]]>",m,"CDATA is not closed.")-2,x=u.substring(m+9,w);A=this.saveTextToParentTag(A,b,y);let S=this.parseTextData(x,b.tagname,y,!0,!1,!0,!0);S==null&&(S=""),this.options.cdataPropName?b.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):b.add(this.options.textNodeName,S),m=w+2}else{let w=g(u,m,this.options.removeNSPrefix),x=w.tagName;const S=w.rawTagName;let F=w.tagExp,R=w.attrExpPresent,C=w.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),b&&A&&b.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,b,y,!1));const Z=b;if(Z&&this.options.unpairedTags.indexOf(Z.tagname)!==-1&&(b=this.tagsNodeStack.pop(),y=y.substring(0,y.lastIndexOf("."))),x!==p.tagname&&(y+=y?"."+x:x),this.isItStopNode(this.options.stopNodes,y,x)){let M="";if(F.length>0&&F.lastIndexOf("/")===F.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),y=y.substr(0,y.length-1),F=x):F=F.substr(0,F.length-1),m=w.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)m=w.closeIndex;else{const ee=this.readStopNodeData(u,S,C+1);if(!ee)throw new Error(`Unexpected end of ${S}`);m=ee.i,M=ee.tagContent}const q=new n(x);x!==F&&R&&(q[":@"]=this.buildAttributesMap(F,y,x)),M&&(M=this.parseTextData(M,x,y,!0,R,!0,!0)),y=y.substr(0,y.lastIndexOf(".")),q.add(this.options.textNodeName,M),this.addChild(b,q,y)}else{if(F.length>0&&F.lastIndexOf("/")===F.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),y=y.substr(0,y.length-1),F=x):F=F.substr(0,F.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const M=new n(x);x!==F&&R&&(M[":@"]=this.buildAttributesMap(F,y,x)),this.addChild(b,M,y),y=y.substr(0,y.lastIndexOf("."))}else{const M=new n(x);this.tagsNodeStack.push(b),x!==F&&R&&(M[":@"]=this.buildAttributesMap(F,y,x)),this.addChild(b,M,y),b=M}A="",m=C}}else A+=u[m];return p.child};function _(u,p,b){const A=this.options.updateTag(p.tagname,b,p[":@"]);A===!1||(typeof A=="string"&&(p.tagname=A),u.addChild(p))}const h=function(u){if(this.options.processEntities){for(let p in this.docTypeEntities){const b=this.docTypeEntities[p];u=u.replace(b.regx,b.val)}for(let p in this.lastEntities){const b=this.lastEntities[p];u=u.replace(b.regex,b.val)}if(this.options.htmlEntities)for(let p in this.htmlEntities){const b=this.htmlEntities[p];u=u.replace(b.regex,b.val)}u=u.replace(this.ampEntity.regex,this.ampEntity.val)}return u};function v(u,p,b,A){return u&&(A===void 0&&(A=Object.keys(p.child).length===0),u=this.parseTextData(u,p.tagname,b,!1,p[":@"]?Object.keys(p[":@"]).length!==0:!1,A),u!==void 0&&u!==""&&p.add(this.options.textNodeName,u),u=""),u}function T(u,p,b){const A="*."+b;for(const y in u){const m=u[y];if(A===m||p===m)return!0}return!1}function I(u,p,b=">"){let A,y="";for(let m=p;m<u.length;m++){let O=u[m];if(A)O===A&&(A="");else if(O==='"'||O==="'")A=O;else if(O===b[0])if(b[1]){if(u[m+1]===b[1])return{data:y,index:m}}else return{data:y,index:m};else O===" "&&(O=" ");y+=O}}function d(u,p,b,A){const y=u.indexOf(p,b);if(y===-1)throw new Error(A);return y+p.length-1}function g(u,p,b,A=">"){const y=I(u,p+1,A);if(!y)return;let m=y.data;const O=y.index,w=m.search(/\s/);let x=m,S=!0;w!==-1&&(x=m.substring(0,w),m=m.substring(w+1).trimStart());const F=x;if(b){const R=x.indexOf(":");R!==-1&&(x=x.substr(R+1),S=x!==y.data.substr(R+1))}return{tagName:x,tagExp:m,closeIndex:O,attrExpPresent:S,rawTagName:F}}function N(u,p,b){const A=b;let y=1;for(;b<u.length;b++)if(u[b]==="<")if(u[b+1]==="/"){const m=d(u,">",b,`${p} is not closed`);if(u.substring(b+2,m).trim()===p&&(y--,y===0))return{tagContent:u.substring(A,b),i:m};b=m}else if(u[b+1]==="?")b=d(u,"?>",b+1,"StopNode is not closed.");else if(u.substr(b+1,3)==="!--")b=d(u,"-->",b+3,"StopNode is not closed.");else if(u.substr(b+1,2)==="![")b=d(u,"]]>",b,"StopNode is not closed.")-2;else{const m=g(u,b,">");m&&((m&&m.tagName)===p&&m.tagExp[m.tagExp.length-1]!=="/"&&y++,b=m.closeIndex)}}function k(u,p,b){if(p&&typeof u=="string"){const A=u.trim();return A==="true"?!0:A==="false"?!1:i(u,b)}else return e.isExist(u)?u:""}return Bt=a,Bt}var Ut={},oi;function wo(){if(oi)return Ut;oi=1;function e(a,f){return n(a,f)}function n(a,f,s){let c;const r={};for(let o=0;o<a.length;o++){const E=a[o],_=t(E);let h="";if(s===void 0?h=_:h=s+"."+_,_===f.textNodeName)c===void 0?c=E[_]:c+=""+E[_];else{if(_===void 0)continue;if(E[_]){let v=n(E[_],f,h);const T=l(v,f);E[":@"]?i(v,E[":@"],h,f):Object.keys(v).length===1&&v[f.textNodeName]!==void 0&&!f.alwaysCreateTextNode?v=v[f.textNodeName]:Object.keys(v).length===0&&(f.alwaysCreateTextNode?v[f.textNodeName]="":v=""),r[_]!==void 0&&r.hasOwnProperty(_)?(Array.isArray(r[_])||(r[_]=[r[_]]),r[_].push(v)):f.isArray(_,h,T)?r[_]=[v]:r[_]=v}}}return typeof c=="string"?c.length>0&&(r[f.textNodeName]=c):c!==void 0&&(r[f.textNodeName]=c),r}function t(a){const f=Object.keys(a);for(let s=0;s<f.length;s++){const c=f[s];if(c!==":@")return c}}function i(a,f,s,c){if(f){const r=Object.keys(f),o=r.length;for(let E=0;E<o;E++){const _=r[E];c.isArray(_,s+"."+_,!0,!0)?a[_]=[f[_]]:a[_]=f[_]}}}function l(a,f){const{textNodeName:s}=f,c=Object.keys(a).length;return!!(c===0||c===1&&(a[s]||typeof a[s]=="boolean"||a[s]===0))}return Ut.prettify=e,Ut}var Mt,li;function yo(){if(li)return Mt;li=1;const{buildOptions:e}=ho(),n=bo(),{prettify:t}=wo(),i=tr();class l{constructor(f){this.externalEntities={},this.options=e(f)}parse(f,s){if(typeof f!="string")if(f.toString)f=f.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(s){s===!0&&(s={});const o=i.validate(f,s);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}const c=new n(this.options);c.addExternalEntities(this.externalEntities);const r=c.parseXml(f);return this.options.preserveOrder||r===void 0?r:t(r,this.options)}addEntity(f,s){if(s.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(f.indexOf("&")!==-1||f.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(s==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[f]=s}}return Mt=l,Mt}var jt,fi;function xo(){if(fi)return jt;fi=1;const e=`
|
|
5
|
+
`;function n(s,c){let r="";return c.format&&c.indentBy.length>0&&(r=e),t(s,c,"",r)}function t(s,c,r,o){let E="",_=!1;for(let h=0;h<s.length;h++){const v=s[h],T=i(v);if(T===void 0)continue;let I="";if(r.length===0?I=T:I=`${r}.${T}`,T===c.textNodeName){let u=v[T];a(I,c)||(u=c.tagValueProcessor(T,u),u=f(u,c)),_&&(E+=o),E+=u,_=!1;continue}else if(T===c.cdataPropName){_&&(E+=o),E+=`<![CDATA[${v[T][0][c.textNodeName]}]]>`,_=!1;continue}else if(T===c.commentPropName){E+=o+`<!--${v[T][0][c.textNodeName]}-->`,_=!0;continue}else if(T[0]==="?"){const u=l(v[":@"],c),p=T==="?xml"?"":o;let b=v[T][0][c.textNodeName];b=b.length!==0?" "+b:"",E+=p+`<${T}${b}${u}?>`,_=!0;continue}let d=o;d!==""&&(d+=c.indentBy);const g=l(v[":@"],c),N=o+`<${T}${g}`,k=t(v[T],c,I,d);c.unpairedTags.indexOf(T)!==-1?c.suppressUnpairedNode?E+=N+">":E+=N+"/>":(!k||k.length===0)&&c.suppressEmptyNode?E+=N+"/>":k&&k.endsWith(">")?E+=N+`>${k}${o}</${T}>`:(E+=N+">",k&&o!==""&&(k.includes("/>")||k.includes("</"))?E+=o+c.indentBy+k+o:E+=k,E+=`</${T}>`),_=!0}return E}function i(s){const c=Object.keys(s);for(let r=0;r<c.length;r++){const o=c[r];if(s.hasOwnProperty(o)&&o!==":@")return o}}function l(s,c){let r="";if(s&&!c.ignoreAttributes)for(let o in s){if(!s.hasOwnProperty(o))continue;let E=c.attributeValueProcessor(o,s[o]);E=f(E,c),E===!0&&c.suppressBooleanAttributes?r+=` ${o.substr(c.attributeNamePrefix.length)}`:r+=` ${o.substr(c.attributeNamePrefix.length)}="${E}"`}return r}function a(s,c){s=s.substr(0,s.length-c.textNodeName.length-1);let r=s.substr(s.lastIndexOf(".")+1);for(let o in c.stopNodes)if(c.stopNodes[o]===s||c.stopNodes[o]==="*."+r)return!0;return!1}function f(s,c){if(s&&s.length>0&&c.processEntities)for(let r=0;r<c.entities.length;r++){const o=c.entities[r];s=s.replace(o.regex,o.val)}return s}return jt=n,jt}var Ht,ci;function mo(){if(ci)return Ht;ci=1;const e=xo(),n=nr(),t={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(s,c){return c},attributeValueProcessor:function(s,c){return c},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function i(s){this.options=Object.assign({},t,s),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=n(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=f),this.processTextOrObjNode=l,this.options.format?(this.indentate=a,this.tagEndChar=`>
|
|
6
|
+
`,this.newLine=`
|
|
7
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}i.prototype.build=function(s){return this.options.preserveOrder?e(s,this.options):(Array.isArray(s)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(s={[this.options.arrayNodeName]:s}),this.j2x(s,0,[]).val)},i.prototype.j2x=function(s,c,r){let o="",E="";const _=r.join(".");for(let h in s)if(Object.prototype.hasOwnProperty.call(s,h))if(typeof s[h]>"u")this.isAttribute(h)&&(E+="");else if(s[h]===null)this.isAttribute(h)?E+="":h[0]==="?"?E+=this.indentate(c)+"<"+h+"?"+this.tagEndChar:E+=this.indentate(c)+"<"+h+"/"+this.tagEndChar;else if(s[h]instanceof Date)E+=this.buildTextValNode(s[h],h,"",c);else if(typeof s[h]!="object"){const v=this.isAttribute(h);if(v&&!this.ignoreAttributesFn(v,_))o+=this.buildAttrPairStr(v,""+s[h]);else if(!v)if(h===this.options.textNodeName){let T=this.options.tagValueProcessor(h,""+s[h]);E+=this.replaceEntitiesValue(T)}else E+=this.buildTextValNode(s[h],h,"",c)}else if(Array.isArray(s[h])){const v=s[h].length;let T="",I="";for(let d=0;d<v;d++){const g=s[h][d];if(!(typeof g>"u"))if(g===null)h[0]==="?"?E+=this.indentate(c)+"<"+h+"?"+this.tagEndChar:E+=this.indentate(c)+"<"+h+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const N=this.j2x(g,c+1,r.concat(h));T+=N.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(I+=N.attrStr)}else T+=this.processTextOrObjNode(g,h,c,r);else if(this.options.oneListGroup){let N=this.options.tagValueProcessor(h,g);N=this.replaceEntitiesValue(N),T+=N}else T+=this.buildTextValNode(g,h,"",c)}this.options.oneListGroup&&(T=this.buildObjectNode(T,h,I,c)),E+=T}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const v=Object.keys(s[h]),T=v.length;for(let I=0;I<T;I++)o+=this.buildAttrPairStr(v[I],""+s[h][v[I]])}else E+=this.processTextOrObjNode(s[h],h,c,r);return{attrStr:o,val:E}},i.prototype.buildAttrPairStr=function(s,c){return c=this.options.attributeValueProcessor(s,""+c),c=this.replaceEntitiesValue(c),this.options.suppressBooleanAttributes&&c==="true"?" "+s:" "+s+'="'+c+'"'};function l(s,c,r,o){const E=this.j2x(s,r+1,o.concat(c));return s[this.options.textNodeName]!==void 0&&Object.keys(s).length===1?this.buildTextValNode(s[this.options.textNodeName],c,E.attrStr,r):this.buildObjectNode(E.val,c,E.attrStr,r)}i.prototype.buildObjectNode=function(s,c,r,o){if(s==="")return c[0]==="?"?this.indentate(o)+"<"+c+r+"?"+this.tagEndChar:this.indentate(o)+"<"+c+r+this.closeTag(c)+this.tagEndChar;{let E="</"+c+this.tagEndChar,_="";return c[0]==="?"&&(_="?",E=""),(r||r==="")&&s.indexOf("<")===-1?this.indentate(o)+"<"+c+r+_+">"+s+E:this.options.commentPropName!==!1&&c===this.options.commentPropName&&_.length===0?this.indentate(o)+`<!--${s}-->`+this.newLine:this.indentate(o)+"<"+c+r+_+this.tagEndChar+s+this.indentate(o)+E}},i.prototype.closeTag=function(s){let c="";return this.options.unpairedTags.indexOf(s)!==-1?this.options.suppressUnpairedNode||(c="/"):this.options.suppressEmptyNode?c="/":c=`></${s}`,c},i.prototype.buildTextValNode=function(s,c,r,o){if(this.options.cdataPropName!==!1&&c===this.options.cdataPropName)return this.indentate(o)+`<![CDATA[${s}]]>`+this.newLine;if(this.options.commentPropName!==!1&&c===this.options.commentPropName)return this.indentate(o)+`<!--${s}-->`+this.newLine;if(c[0]==="?")return this.indentate(o)+"<"+c+r+"?"+this.tagEndChar;{let E=this.options.tagValueProcessor(c,s);return E=this.replaceEntitiesValue(E),E===""?this.indentate(o)+"<"+c+r+this.closeTag(c)+this.tagEndChar:this.indentate(o)+"<"+c+r+">"+E+"</"+c+this.tagEndChar}},i.prototype.replaceEntitiesValue=function(s){if(s&&s.length>0&&this.options.processEntities)for(let c=0;c<this.options.entities.length;c++){const r=this.options.entities[c];s=s.replace(r.regex,r.val)}return s};function a(s){return this.options.indentBy.repeat(s)}function f(s){return s.startsWith(this.options.attributeNamePrefix)&&s!==this.options.textNodeName?s.substr(this.attrPrefixLen):!1}return Ht=i,Ht}var Vt,di;function Eo(){if(di)return Vt;di=1;const e=tr(),n=yo(),t=mo();return Vt={XMLParser:n,XMLValidator:e,XMLBuilder:t},Vt}var ui;function vo(){if(ui)return ot.exports;ui=1;const{XMLParser:e,XMLValidator:n}=Eo(),t=i=>{if(i==null||(i=i.toString().trim(),i.length===0)||n.validate(i)!==!0)return!1;let l;const a=new e;try{l=a.parse(i)}catch{return!1}return!(!l||!("svg"in l))};return ot.exports=t,ot.exports.default=t,ot.exports}var No=vo();const hi=bi(No);function ko({aspect:e,children:n,...t}){return U.jsx(To,{aspect:e,...t,children:U.jsx("span",{className:"aspect-ratio-container__inner",children:n})})}const To=Ie("span")`
|
|
8
|
+
display: block;
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 0;
|
|
12
|
+
padding-bottom: ${({aspect:e})=>1/e*100}%;
|
|
13
|
+
|
|
14
|
+
.aspect-ratio-container__inner {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
}
|
|
21
|
+
`;var ft={},_i;function Ao(){if(_i)return ft;_i=1,Object.defineProperty(ft,"__esModule",{value:!0});var e=sr(),n=hr,t=_r,i=or(),l=rr();function a(w){return w&&typeof w=="object"&&"default"in w?w:{default:w}}var f=a(e),s=a(t),c=a(l),r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof un<"u"?un:typeof self<"u"?self:{};function o(w,x){return w(x={exports:{}},x.exports),x.exports}var E=o(function(w){(function(x){var S=function(z,$,Y){if(!q($)||tt($)||bt($)||ce($)||M($))return $;var G,se=0,de=0;if(ee($))for(G=[],de=$.length;se<de;se++)G.push(S(z,$[se],Y));else for(var ke in G={},$)Object.prototype.hasOwnProperty.call($,ke)&&(G[z(ke,Y)]=S(z,$[ke],Y));return G},F=function(z){return wt(z)?z:(z=z.replace(/[\-_\s]+(.)?/g,function($,Y){return Y?Y.toUpperCase():""})).substr(0,1).toLowerCase()+z.substr(1)},R=function(z){var $=F(z);return $.substr(0,1).toUpperCase()+$.substr(1)},C=function(z,$){return function(Y,G){var se=(G=G||{}).separator||"_",de=G.split||/(?=[A-Z])/;return Y.split(de).join(se)}(z,$).toLowerCase()},Z=Object.prototype.toString,M=function(z){return typeof z=="function"},q=function(z){return z===Object(z)},ee=function(z){return Z.call(z)=="[object Array]"},tt=function(z){return Z.call(z)=="[object Date]"},bt=function(z){return Z.call(z)=="[object RegExp]"},ce=function(z){return Z.call(z)=="[object Boolean]"},wt=function(z){return(z-=0)==z},Ne=function(z,$){var Y=$&&"process"in $?$.process:$;return typeof Y!="function"?z:function(G,se){return Y(G,z,se)}},ae={camelize:F,decamelize:C,pascalize:R,depascalize:C,camelizeKeys:function(z,$){return S(Ne(F,$),z)},decamelizeKeys:function(z,$){return S(Ne(C,$),z,$)},pascalizeKeys:function(z,$){return S(Ne(R,$),z)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};w.exports?w.exports=ae:x.humps=ae})(r)}).decamelize,_=o(function(w){function x(){return w.exports=x=Object.assign||function(S){for(var F=1;F<arguments.length;F++){var R=arguments[F];for(var C in R)Object.prototype.hasOwnProperty.call(R,C)&&(S[C]=R[C])}return S},x.apply(this,arguments)}w.exports=x}),h=function(w){if(Array.isArray(w))return w},v=function(w,x){if(typeof Symbol<"u"&&Symbol.iterator in Object(w)){var S=[],F=!0,R=!1,C=void 0;try{for(var Z,M=w[Symbol.iterator]();!(F=(Z=M.next()).done)&&(S.push(Z.value),!x||S.length!==x);F=!0);}catch(q){R=!0,C=q}finally{try{F||M.return==null||M.return()}finally{if(R)throw C}}return S}},T=function(w,x){(x==null||x>w.length)&&(x=w.length);for(var S=0,F=new Array(x);S<x;S++)F[S]=w[S];return F},I=function(w,x){if(w){if(typeof w=="string")return T(w,x);var S=Object.prototype.toString.call(w).slice(8,-1);return S==="Object"&&w.constructor&&(S=w.constructor.name),S==="Map"||S==="Set"?Array.from(w):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?T(w,x):void 0}},d=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
22
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},g=function(w,x){return h(w)||v(w,x)||I(w,x)||d()},N=function(w,x){if(w==null)return{};var S,F,R={},C=Object.keys(w);for(F=0;F<C.length;F++)S=C[F],x.indexOf(S)>=0||(R[S]=w[S]);return R},k=function(w,x){if(w==null)return{};var S,F,R=N(w,x);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(w);for(F=0;F<C.length;F++)S=C[F],x.indexOf(S)>=0||Object.prototype.propertyIsEnumerable.call(w,S)&&(R[S]=w[S])}return R},u=e.createContext(null);function p(w){var x=w.root,S=w.children;return i.createPortal(S,x)}function b(w){var x=e.forwardRef(function(S,F){var R,C,Z=S.mode,M=S.delegatesFocus,q=S.styleSheets,ee=S.ssr,tt=S.children,bt=k(S,["mode","delegatesFocus","styleSheets","ssr","children"]),ce=(R=F,C=e.useRef(R&&R.current),e.useEffect(function(){R&&(R.current=C.current)},[R]),C),wt=e.useState(null),Ne=g(wt,2),ae=Ne[0],z=Ne[1],$="node_".concat(Z).concat(M);return e.useLayoutEffect(function(){if(ce.current)try{if(typeof F=="function"&&F(ce.current),ee){var Y=ce.current.shadowRoot;return void z(Y)}var G=ce.current.attachShadow({mode:Z,delegatesFocus:M});q.length>0&&(G.adoptedStyleSheets=q),z(G)}catch(se){(function(de){var ke=de.error,dn=de.styleSheets,ir=de.root;switch(ke.name){case"NotSupportedError":dn.length>0&&(ir.adoptedStyleSheets=dn);break;default:throw ke}})({error:se,styleSheets:q,root:ae})}},[F,ce,q]),f.default.createElement(f.default.Fragment,null,f.default.createElement(w.tag,_({key:$,ref:ce},bt),(ae||ee)&&f.default.createElement(u.Provider,{value:ae},ee?f.default.createElement("template",{shadowroot:"open"},w.render({root:ae,ssr:ee,children:tt})):f.default.createElement(p,{root:ae},w.render({root:ae,ssr:ee,children:tt})))))});return x.propTypes={mode:c.default.oneOf(["open","closed"]),delegatesFocus:c.default.bool,styleSheets:c.default.arrayOf(c.default.instanceOf(globalThis.CSSStyleSheet)),ssr:c.default.bool,children:c.default.node},x.defaultProps={mode:"open",delegatesFocus:!1,styleSheets:[],ssr:!1,children:null},x}p.propTypes={root:c.default.object.isRequired,children:c.default.node},p.defaultProps={children:null};var A=new Map;function y(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"core",S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(F){return F.children};return new Proxy(w,{get:function(F,R){var C=E(R,{separator:"-"}),Z="".concat(x,"-").concat(C);return A.has(Z)||A.set(Z,b({tag:C,render:S})),A.get(Z)}})}y();var m=new WeakMap,O=y({},"emotion",function(w){var x=w.root,S=w.children,F=m.get(x)||function(){var R=s.default({container:x,key:"react-shadow"});return m.set(x,R),R}();return f.default.createElement(n.CacheProvider,{value:F},f.default.createElement(f.default.Fragment,null,S))});return ft.default=O,ft}var So=Ao();const Oo=bi(So);function cn({svg:e,...n}){return U.jsx(Fo,{...n,children:U.jsx(Io,{dangerouslySetInnerHTML:{__html:e}})})}const Fo=Ie(Oo.span)`
|
|
23
|
+
display: block;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
`,Io=Ie("div")`
|
|
27
|
+
&,
|
|
28
|
+
& > svg {
|
|
29
|
+
height: 100%;
|
|
30
|
+
width: 100%;
|
|
31
|
+
min-width: 100%;
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
}
|
|
34
|
+
`,Ro=e=>{const n=new Blob([e],{type:"image/svg+xml"});return URL.createObjectURL(n)};function zo({svg:e,alt:n="",fallback:t=!0,...i}){if(t&&e.indexOf("</foreignObject>")>-1)return U.jsx(cn,{svg:e});const l=Ro(e);return U.jsx("img",{src:l,onLoad:()=>URL.revokeObjectURL(l),alt:n,...i})}function Co(){return U.jsx(Po,{className:"nft-display__loading",children:"Loading..."})}const Po=Ie("span")`
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
position: absolute;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
color: #ccc;
|
|
42
|
+
background-color: #eee;
|
|
43
|
+
`,Lo=e=>P.createElement("svg",{width:300,height:300,viewBox:"0 0 300 300",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("g",{clipPath:"url(#clip0_317_299)"},P.createElement("rect",{x:60,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}}),P.createElement("rect",{x:180,width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}}),P.createElement("rect",{x:120,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{x:240,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{y:60,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{x:60,y:60,width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}}),P.createElement("rect",{x:120,y:60,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{x:240,y:59.9999,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{x:180,y:59.9999,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{y:120,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{y:180,width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}}),P.createElement("rect",{y:240,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{x:60,y:120,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{x:60,y:180,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{x:60,y:240,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{x:120,y:120,width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}}),P.createElement("rect",{x:180,y:180,width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}}),P.createElement("rect",{x:120,y:240,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{x:240,y:120,width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}}),P.createElement("rect",{x:120,y:180,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{x:180,y:240,width:60,height:60,fill:"#E5E7EB",style:{fill:"#E5E7EB",fill:"color(display-p3 0.8980 0.9059 0.9216)",fillOpacity:1}}),P.createElement("rect",{x:180,y:120,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{x:240,y:180,width:60,height:60,fill:"#F3F4F6",style:{fill:"#F3F4F6",fill:"color(display-p3 0.9529 0.9569 0.9647)",fillOpacity:1}}),P.createElement("rect",{x:240,y:240,width:60,height:60,fill:"#F9FAFB",style:{fill:"#F9FAFB",fill:"color(display-p3 0.9765 0.9804 0.9843)",fillOpacity:1}})),P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_317_299"},P.createElement("rect",{width:300,height:300,fill:"white",style:{fill:"white",fillOpacity:1}}))));function pi({children:e="Non-publicly accessible NFT"}={}){return U.jsxs($o,{children:[U.jsx(Lo,{className:"nft-display-broken-background"}),e&&U.jsx(en,{className:"nft-display-broken-content",children:e})]})}const $o=Ie(en)`
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
position: relative;
|
|
47
|
+
|
|
48
|
+
.nft-display-broken-background {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.nft-display-broken-content {
|
|
54
|
+
display: flex;
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
align-items: center;
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 0;
|
|
61
|
+
left: 0;
|
|
62
|
+
right: 0;
|
|
63
|
+
bottom: 0;
|
|
64
|
+
margin: auto;
|
|
65
|
+
mix-blend-mode: plus-darker;
|
|
66
|
+
font-size: 13px;
|
|
67
|
+
color: #9aa3b0;
|
|
68
|
+
text-align: center;
|
|
69
|
+
text-shadow:
|
|
70
|
+
0 0 2px #fff,
|
|
71
|
+
0 0 2px #fff,
|
|
72
|
+
0 0 2px #fff;
|
|
73
|
+
user-select: none;
|
|
74
|
+
}
|
|
75
|
+
`,Le=new Map,Zo=10*60*1e3,Bo=e=>{const{url:n,method:t}=e,i=JSON.stringify({url:n,method:t});if(Le.has(i)){const l=Le.get(i);if(Date.now()-l.timestamp<Zo)return l.error?Promise.reject(l.error):Promise.resolve({headers:l.headers});Le.delete(i)}return lr(e).then(l=>(Le.set(i,{headers:l.headers,timestamp:Date.now()}),l)).catch(l=>{throw Le.set(i,{error:l,timestamp:Date.now()}),l})},Uo=wi.create({adapter:Bo,timeout:5e3});function Mo({src:e,onLoad:n=void 0}){const[t,i]=P.useState("");return pr(async()=>{const l=await wi.get(e),a=dr.sanitize(l.data);i(a),n?.()},[]),U.jsx(cn,{svg:t})}function Qo(e){return e?.display||e?.data?.value}function jo(e){if(typeof e!="string")throw new Error("fromBase64 requires input to be a string");return yi.from(ur.unescape(e),"base64")}const gi=e=>({img:zo,svg:cn})[e];function Ho({data:e,address:n,inset:t,aspect:i,component:l="span",className:a="",renderError:f,renderLoading:s,preferredSvgEmbedder:c="img",checkSvg:r=!1,minimumLoadingTime:o=0,onCompleted:E=cr,imageFilter:_=null,...h}){const v=I=>U.jsx(Vo,{component:l,...h,className:ar(a,{"nft-display--inset":t}),children:I}),T=P.useRef({});try{typeof e=="string"?T.current=JSON.parse(e):T.current=e;const{vcId:I}=T.current,d=T.current.credentialSubject?fr(T.current,"credentialSubject.display"):T.current,{content:g,type:N}=d,k=N==="url",[u,p]=P.useState({loading:k,error:!1,loadingUrlType:!0,urlType:null}),[b,A]=P.useState(o<=0),y=({useImageFilter:R=!1,t:C}={})=>{const Z=new URL(g);return window.location.protocol==="https:"&&Z.protocol==="http:"&&(Z.protocol="https:"),Z.searchParams.has("assetId")||Z.searchParams.append("assetId",n),!Z.searchParams.has("vcId")&&I&&Z.searchParams.append("vcId",I),R&&_&&Object.entries(_).forEach(([M,q])=>{Z.searchParams.append(M,q)}),C&&Z.searchParams.append("t",C),Z.href},m=async()=>{try{const R=(await Uo({url:y({useImageFilter:!1,t:"nftdisplay"}),method:"HEAD"}))?.headers?.get("Content-Type");p({...u,loadingUrlType:!1,urlType:R})}catch(R){if(console.error("Failed to fetch url content type",R),R?.message?.includes("timeout")){p({...u,loadingUrlType:!1,loading:!1,error:!0});return}p({...u,loadingUrlType:!1,urlType:null})}};if(P.useEffect(()=>{let R;return o>0&&(R=setTimeout(()=>A(!0),o)),N==="url"&&m(),()=>clearTimeout(R)},[]),P.useEffect(()=>{(!u.loading&&b||u.error)&&E()},[u,b]),u.error)throw new Error("Failed to render NFT Display.");const O=()=>{u.loading&&p({...u,loading:!1})},w=()=>{p({...u,error:!0,loading:!1})},x=()=>{const R=y({useImageFilter:!0});return U.jsx("img",{src:R,onError:w,onLoad:O,alt:"NFT Display",style:{width:"auto",height:"auto"}})},S=()=>{const R=u.urlType||"image/svg+xml",C=y(),Z=new URL(C).pathname.toLowerCase();return[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".tiff",".tif",".ico",".jfif",".pjpeg",".pjp",".avif"].some(M=>Z.endsWith(M))?x():R.includes("text/html;")?U.jsx(pi,{}):U.jsx("object",{type:R,data:C,onErrorCapture:w,onLoad:O,style:{width:"100%",height:"100%",pointerEvents:"none"}},C)},F=()=>{if(g)switch(N){case"url":return u.loadingUrlType?null:u.urlType?.startsWith("image/svg+xml")?U.jsx(Mo,{src:y(),onLoad:O}):u.urlType?.startsWith("image")?x():S();case"uri":return U.jsx("img",{src:g,onError:()=>p({...u,error:!0}),onLoad:()=>p({...u,loading:!1}),alt:"NFT Display"});case"svg_gzipped":{const R=uo.ungzip(jo(g),{}),C=yi.from(R).toString("utf8");if(r&&!hi(C))throw new Error("Invalid SVG of type svg_gzipped");const Z=gi(c);return U.jsx(Z,{svg:C})}case"svg":{if(r&&!hi(g))throw new Error("Invalid SVG of type svg");const R=gi(c);return U.jsx(R,{svg:g})}case"html":break;default:}throw new Error(`unsupported display protocol: ${d.type}`)};return v(U.jsxs(U.Fragment,{children:[(u.loading||!b)&&(s?s():U.jsx(Co,{})),F()]}))}catch(I){return console.error(I?.message,{nftId:n,vcId:T?.current?.vcId}),v(f?f():U.jsx(pi,{}))}}const Vo=Ie(en)`
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
position: relative;
|
|
80
|
+
/* 默认尺寸 */
|
|
81
|
+
width: 150px;
|
|
82
|
+
height: 150px;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
|
|
85
|
+
&,
|
|
86
|
+
img,
|
|
87
|
+
object {
|
|
88
|
+
max-width: 100%;
|
|
89
|
+
max-height: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
img,
|
|
93
|
+
object {
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.nft-display--inset {
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 100%;
|
|
101
|
+
}
|
|
102
|
+
`;function Xo(e){return function({aspect:n=void 0,inset:t=!1,...i}){return n&&n>0&&!t?U.jsx(ko,{aspect:n,children:U.jsx(e,{inset:!0,...i})}):U.jsx(e,{inset:t,...i})}}const Do=Xo(Ho);export{Do as N,Qo as U};
|