@abtnode/webapp 1.16.45-beta-20250609-111118-0d252ebe → 1.16.45-beta-20250610-112229-2eb0face
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-BqwbfR-J.js → AdapterDayjs-DAz3KrnL.js} +1 -1
- package/dist/assets/{Add-CSGWebd7.js → Add-BvcTJL6g.js} +1 -1
- package/dist/assets/{ArrowDropDown-BCCxOUNE.js → ArrowDropDown-lSBhitmG.js} +1 -1
- package/dist/assets/{Autocomplete-BRFoT1-d.js → Autocomplete-DPEAys5B.js} +1 -1
- package/dist/assets/{Breadcrumbs-B-xYTnoc.js → Breadcrumbs-CCANSAXq.js} +1 -1
- package/dist/assets/{ButtonGroup-ClVwTb7r.js → ButtonGroup-8JIPxBFt.js} +1 -1
- package/dist/assets/{CSSTransition-DpoNbm4c.js → CSSTransition-CrBmaRu0.js} +1 -1
- package/dist/assets/{CallMerge-weq4zXp-.js → CallMerge-ChAxopdM.js} +1 -1
- package/dist/assets/{CardContent-CTAfwoUe.js → CardContent-BQOdBMgK.js} +1 -1
- package/dist/assets/{ChevronLeft-DQK-aqqz.js → ChevronLeft-CQivGJHk.js} +1 -1
- package/dist/assets/{ChevronRight-BtkdX9A9.js → ChevronRight-BlhG3yZY.js} +1 -1
- package/dist/assets/{Clear-D0I7uWhD.js → Clear-9k4hE_iq.js} +1 -1
- package/dist/assets/{Close-6CxneLlA.js → Close-aI0rARqu.js} +1 -1
- package/dist/assets/{Community-v2_SoLAO.js → Community-BX8y7YvB.js} +1 -1
- package/dist/assets/{Delete-P4B2dduO.js → Delete-EgRRDgvd.js} +1 -1
- package/dist/assets/{DeleteOutline-EQ9bHspP.js → DeleteOutline-Ja8iJJm1.js} +1 -1
- package/dist/assets/{Done-2EsU1aO2.js → Done-yL7tHkLt.js} +1 -1
- package/dist/assets/{Edit-frf3Fbx4.js → Edit-WOZnUVvS.js} +1 -1
- package/dist/assets/{ErrorOutline-a1DnwqoR.js → ErrorOutline-BjAyvxx4.js} +1 -1
- package/dist/assets/{HelpOutline-CBv7x3VM.js → HelpOutline-BmFBsSz3.js} +1 -1
- package/dist/assets/{Holiday-CM3JD4xm.js → Holiday-BwHFmcPg.js} +1 -1
- package/dist/assets/{Launch-B7fv6nTK.js → Launch-DHV3U2Y3.js} +1 -1
- package/dist/assets/{Link-CiUEO3cQ.js → Link-C4RjtlPw.js} +1 -1
- package/dist/assets/{ListItemButton-ByIRcZGW.js → ListItemButton-CS_u4xql.js} +1 -1
- package/dist/assets/{ListSubheader-Yn3XMnVm.js → ListSubheader-C-e_2m7m.js} +1 -1
- package/dist/assets/{LoadingButton-B3es9INs.js → LoadingButton-bxrmduDd.js} +1 -1
- package/dist/assets/{LockIcon-C1gL9Uz4.js → LockIcon--YdvMZNM.js} +1 -1
- package/dist/assets/{Meeting-BkxfSXYG.js → Meeting-CTX8DATf.js} +1 -1
- package/dist/assets/{MoreHoriz-3d6Yp_t-.js → MoreHoriz-DAgzjMkD.js} +1 -1
- package/dist/assets/{MoreVert-C_Ck3fn9.js → MoreVert-C7ADSe__.js} +1 -1
- package/dist/assets/{OffSick-Z9k6qoex.js → OffSick-Cw_Bo4pj.js} +1 -1
- package/dist/assets/{OpenInNew-D79h4Iot.js → OpenInNew-DloC4nwa.js} +1 -1
- package/dist/assets/{Public-BtS6bdiD.js → Public-DYzbOE-T.js} +1 -1
- package/dist/assets/{Refresh-C1kA8imS.js → Refresh-By8bfp9S.js} +1 -1
- package/dist/assets/{SchemaReference.es-Dfqhb0uS.js → SchemaReference.es-CbqYK7gW.js} +1 -1
- package/dist/assets/{Search-CUm1f8xo.js → Search-CjaYHOuY.js} +1 -1
- package/dist/assets/{Slider-B0hY7ZYB.js → Slider-14Xp1QE3.js} +1 -1
- package/dist/assets/{Stepper-CEe-v4P_.js → Stepper-Cz4oLc0v.js} +1 -1
- package/dist/assets/{Switch-D3iZUzda.js → Switch-lDUha6nF.js} +1 -1
- package/dist/assets/{TableRow-CQ8RBtid.js → TableRow-uM5dbbKH.js} +1 -1
- package/dist/assets/{TableSearch-Uk9kIt7i.js → TableSearch-CUrFzIWx.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BrZT8OFC.js → ToggleButtonGroup-ruLs9U48.js} +1 -1
- package/dist/assets/{Verified-DjfvSM3n.js → Verified-Cr6wy4Uq.js} +1 -1
- package/dist/assets/{VerifiedUser-CGB9pAg5.js → VerifiedUser-DQ1XdtS0.js} +1 -1
- package/dist/assets/{ViewColumn-CcQluqhl.js → ViewColumn-BncCRTIT.js} +1 -1
- package/dist/assets/{ViewList-CPkfx4gI.js → ViewList-Co_V4mfD.js} +1 -1
- package/dist/assets/{WorkingRemotely-BMx519Rn.js → WorkingRemotely-B4kcvx6l.js} +1 -1
- package/dist/assets/{_createAggregator-Dp2y-Mf_.js → _createAggregator-zWIYJPBX.js} +1 -1
- package/dist/assets/{actions-CvZtuIOm.js → actions-Cq51qPdo.js} +1 -1
- package/dist/assets/{actions-C8ldDfDc.js → actions-DAVGXMmF.js} +1 -1
- package/dist/assets/{agreement-4TUvZhY3.js → agreement-CfNMWvuB.js} +1 -1
- package/dist/assets/api-C6KC1P_U.js +1 -0
- package/dist/assets/{appearance-CztLZ35g.js → appearance-DJMviNOj.js} +1 -1
- package/dist/assets/ar-D9QEDjY-.js +7 -0
- package/dist/assets/{audit-logs-vnwtSLPp.js → audit-logs-aDT3tL_y.js} +1 -1
- package/dist/assets/{base-chart-tXWghrta.js → base-chart-DFps1bMz.js} +1 -1
- package/dist/assets/{blocklet-SKmr21o8.js → blocklet-C3B7_czn.js} +1 -1
- package/dist/assets/{brace-fold.es-C8hYDu8C.js → brace-fold.es-DdrA8572.js} +1 -1
- package/dist/assets/{chain-Cw3CxpIJ.js → chain-BgOjv6uW.js} +1 -1
- package/dist/assets/{click-to-copy-BBcwV5Sv.js → click-to-copy-CVJCV48Y.js} +1 -1
- package/dist/assets/cloneDeep-D8oICiE5.js +1 -0
- package/dist/assets/{closebrackets.es-n7j2YaKC.js → closebrackets.es-BAEECG-J.js} +1 -1
- package/dist/assets/{codemirror.es-q3z3D3fp.js → codemirror.es-CtyzpQd3.js} +1 -1
- package/dist/assets/{collapse-Cy01Qhtt.js → collapse-cvMh281U.js} +1 -1
- package/dist/assets/{comment.es-CZaW3Zjc.js → comment.es-CT1dSA50.js} +1 -1
- package/dist/assets/{config-navigation-B4iEyuxN.js → config-navigation-CJVBY_1Y.js} +3 -3
- package/dist/assets/{connect-to-BbdcjX_x.js → connect-to-B6vJIcaQ.js} +1 -1
- package/dist/assets/{de-Dv_ApqsF.js → de-BOa43YBF.js} +2 -2
- package/dist/assets/{delete-confirm-qy4uClf5.js → delete-confirm-BSpKG6TK.js} +1 -1
- package/dist/assets/{detail-C_SIxTEY.js → detail-BRQO1KYU.js} +3 -3
- package/dist/assets/{dialog.es-BEBI39yG.js → dialog.es-DXrJ9E3h.js} +1 -1
- package/dist/assets/{domains-Bql4UA4y.js → domains-Cd_E9K6j.js} +2 -2
- package/dist/assets/{download-DdDp7qNF.js → download-DD0NX-dO.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-CZUhgARx.js +1 -0
- package/dist/assets/es-A3ma-OJp.js +9 -0
- package/dist/assets/{foldgutter.es-XJVlfA9j.js → foldgutter.es-CS9dkaWG.js} +1 -1
- package/dist/assets/fr-I3xKp6I5.js +7 -0
- package/dist/assets/{get-safe-url-BHhOK-87.js → get-safe-url-DFKtG9HX.js} +1 -1
- package/dist/assets/{get-safe-url-ZQAisLez.js → get-safe-url-rD4VAeiO.js} +1 -1
- package/dist/assets/getValidReactChildren-DXpwHayT.js +1 -0
- package/dist/assets/{hi-Dqbq8i5Y.js → hi-DacRhM8A.js} +1 -1
- package/dist/assets/{hint.es-BXYnqh_9.js → hint.es-C7s_Cw87.js} +1 -1
- package/dist/assets/{hint.es2-mCmWTcSI.js → hint.es2-BG7IPyzR.js} +1 -1
- package/dist/assets/{id-Bxr8o3Uo.js → id-B7LQAHL7.js} +3 -3
- package/dist/assets/{iframe-CVde2I2R.js → iframe-DlTBif6K.js} +1 -1
- package/dist/assets/{index-BublfAf3.js → index--pEcZ_jy.js} +1 -1
- package/dist/assets/{index-DzK6OW-H.js → index-0tIu-1zK.js} +1 -1
- package/dist/assets/{index-B6gCUDLy.js → index-27HrDkC8.js} +1 -1
- package/dist/assets/{index-BDHvuJA-.js → index-B-pqbvXR.js} +5 -5
- package/dist/assets/{index-ooFvSbXR.js → index-B45EgQpP.js} +1 -1
- package/dist/assets/{index-ChSMfUDl.js → index-BDad1uXv.js} +10 -10
- package/dist/assets/{index-CFc2cpAq.js → index-BH6N9kiW.js} +1 -1
- package/dist/assets/{index-BUWOtFDP.js → index-BIheNxxs.js} +1 -1
- package/dist/assets/index-BK4_GEzF.js +41 -0
- package/dist/assets/{index-C562LNdR.js → index-BMRaOW3i.js} +9 -9
- package/dist/assets/{index-Dg-nEXIR.js → index-BTMNPpbj.js} +1 -1
- package/dist/assets/{index-DNFAdenj.js → index-Baygm6LA.js} +1 -1
- package/dist/assets/{index-CIeEDIRZ.js → index-Bde_-0lD.js} +1 -1
- package/dist/assets/{index-CCGiAGPb.js → index-BgzweKIj.js} +1 -1
- package/dist/assets/{index-DRvnuna9.js → index-Bi-MJ5VJ.js} +1 -1
- package/dist/assets/{index-DnLtwT4P.js → index-BjBCo6La.js} +1 -1
- package/dist/assets/{index-C_5on_zt.js → index-BjO4wh2H.js} +1 -1
- package/dist/assets/{index-CEr4LN-P.js → index-BpB-1Bg8.js} +1 -1
- package/dist/assets/{index-BkStkax6.js → index-BtMd2e0b.js} +2 -2
- package/dist/assets/{index-B37Lr7Hg.js → index-BzjQHdRE.js} +1 -1
- package/dist/assets/{index-wKRUqEyT.js → index-C9lGpvq5.js} +2 -2
- package/dist/assets/{index-DzcmC4If.js → index-CDuhEPSB.js} +3 -3
- package/dist/assets/{index-CZplOWEN.js → index-CEGwKYvA.js} +1 -1
- package/dist/assets/{index-DdAt9jDT.js → index-CRtRN11t.js} +1 -1
- package/dist/assets/{index-Ds-ruyy-.js → index-CUN_nqtm.js} +1 -1
- package/dist/assets/{index-DTnnZgV3.js → index-CeegzfSw.js} +1 -1
- package/dist/assets/{index-CViyZjZs.js → index-CqW8J3Hz.js} +1 -1
- package/dist/assets/{index-CPBAco4X.js → index-CvUqaFUa.js} +1 -1
- package/dist/assets/{index-DzWDWvao.js → index-D1JYJWP1.js} +1 -1
- package/dist/assets/{index-uw3m84Z2.js → index-D2RfS7-O.js} +1 -1
- package/dist/assets/{index-DTb1YjkO.js → index-D6xNQO9D.js} +186 -186
- package/dist/assets/{index-DM5TK3mI.js → index-DApYzB3T.js} +1 -1
- package/dist/assets/index-DH6yhpyX.js +1 -0
- package/dist/assets/{index-CyCivdc5.js → index-DKh1PYSe.js} +1 -1
- package/dist/assets/{index-DVT--CtL.js → index-D_h7IVNI.js} +3 -3
- package/dist/assets/{index-DsdaIM1E.js → index-DbByIiV7.js} +4 -4
- package/dist/assets/{index-B6YLm2gY.js → index-DdEhGphv.js} +1 -1
- package/dist/assets/{index-BKpBz5IS.js → index-DeXCywmG.js} +1 -1
- package/dist/assets/{index-BWpZKV7G.js → index-DlxuFr_2.js} +3 -3
- package/dist/assets/{index-BLrsx8oH.js → index-FAOrsHzs.js} +1 -1
- package/dist/assets/{index-BILcrV-b.js → index-a2DZ9msz.js} +1 -1
- package/dist/assets/{index-Cm6VrPFr.js → index-aJFga9DB.js} +1 -1
- package/dist/assets/{index-omP-_XYV.js → index-gWj5DPOC.js} +1 -1
- package/dist/assets/index-k2TA2gFi.js +236 -0
- package/dist/assets/{index-C-QDjEC-.js → index-oGDBSDmQ.js} +1 -1
- package/dist/assets/{index-BQOOINkR.js → index-qzXhzN00.js} +1 -1
- package/dist/assets/{index-D3OlVE0m.js → index-vg5CgSEg.js} +1 -1
- package/dist/assets/{index.esm-CB-7UGfI.js → index.esm-UxoaB6Mu.js} +1 -1
- package/dist/assets/{info-addon.es-DKtNhOCh.js → info-addon.es-CZJHTLgg.js} +1 -1
- package/dist/assets/{info.es-B7YFO8O9.js → info.es-D24qyler.js} +1 -1
- package/dist/assets/{install-from-url-B9F0r0Uk.js → install-from-url-74slzMXU.js} +1 -1
- package/dist/assets/{invitation-BAovnHWT.js → invitation-B-BBdPct.js} +1 -1
- package/dist/assets/is-path-prefix-equal-1KjO4UlG.js +1 -0
- package/dist/assets/item-CX8J2MJp.js +277 -0
- package/dist/assets/{ja-CJfcqkdo.js → ja-DRQ4Eecl.js} +3 -1
- package/dist/assets/{javascript.es-e4wfmIpw.js → javascript.es-B3XIQ5bF.js} +1 -1
- package/dist/assets/{jump-to-line.es-D1zAOCng.js → jump-to-line.es-BPFdS4sP.js} +1 -1
- package/dist/assets/{jump.es-CR1apnMt.js → jump.es-DgTQZ6E0.js} +1 -1
- package/dist/assets/{ko-BxAazRix.js → ko-CzL3UzwL.js} +3 -1
- package/dist/assets/{lint.es-po0cvpDF.js → lint.es-CwL2rPB4.js} +1 -1
- package/dist/assets/{lint.es2-CIRlGKEU.js → lint.es2-K3G7qF5X.js} +1 -1
- package/dist/assets/{lint.es3-CC5QXby4.js → lint.es3-CDpRIgr_.js} +1 -1
- package/dist/assets/{list-header-D5Klosqn.js → list-header-CXofX5mW.js} +1 -1
- package/dist/assets/{log-DvWjHRjx.js → log-Dq3hLTsh.js} +1 -1
- package/dist/assets/{lottie-react.esm-CzS4D97g.js → lottie-react.esm-BpS8UEol.js} +1 -1
- package/dist/assets/{matchbrackets.es-Bh__cUPA.js → matchbrackets.es-BPk0GVm3.js} +1 -1
- package/dist/assets/{memory-VuyFpRX6.js → memory-CkILGNBa.js} +1 -1
- package/dist/assets/{metric-sJIuzFdD.js → metric--mq9dzfr.js} +1 -1
- package/dist/assets/{mode.es-b4PvmWPj.js → mode.es-B948py4j.js} +1 -1
- package/dist/assets/{mode.es2-B8UlLCtX.js → mode.es2-DLBpn1Xq.js} +1 -1
- package/dist/assets/{mode.es3-CQ9X5NiW.js → mode.es3-R3sBu0Hd.js} +1 -1
- package/dist/assets/omit-Bvtj3rp4.js +1 -0
- package/dist/assets/{onlineParser.es-mNPHWPcl.js → onlineParser.es-BYKS9Ohl.js} +1 -1
- package/dist/assets/{overview-DptGQrLC.js → overview-BhyffKqV.js} +1 -1
- package/dist/assets/{permission-DtbkcHFU.js → permission-fFO3ZJsb.js} +1 -1
- package/dist/assets/{preference-BIxg48qT.js → preference-D_V_1qTZ.js} +3 -3
- package/dist/assets/{pt-FpFCyI6v.js → pt-CHKumXYv.js} +3 -3
- package/dist/assets/{raf-schd.esm-CyR0PsG3.js → raf-schd.esm-BoCSLgIS.js} +1 -1
- package/dist/assets/refType-DjUDB_a_.js +1 -0
- package/dist/assets/{resource-dialog-DSlsEDCi.js → resource-dialog-1Tb87EP-.js} +4 -4
- package/dist/assets/{ru-BuGIFp9h.js → ru-CvkEKhgU.js} +1 -1
- package/dist/assets/{runtime-BqyrQzUD.js → runtime-BYAbYCDO.js} +1 -1
- package/dist/assets/{schema-BD6PrmCO.js → schema-Vu9BjGDN.js} +1 -1
- package/dist/assets/sdk-Dt3mm4lK.js +1 -0
- package/dist/assets/{search.es-BjwGHA7G.js → search.es-ywYl9dIw.js} +1 -1
- package/dist/assets/{searchcursor.es-CbJCToER.js → searchcursor.es-D3BwbrKk.js} +1 -1
- package/dist/assets/{service-BV2uNns2.js → service-BdSy4Eq2.js} +1 -1
- package/dist/assets/{shorten-label-BOckTQ1X.js → shorten-label-CAYARumO.js} +1 -1
- package/dist/assets/{show-hint.es-q9IMwctI.js → show-hint.es-CGSGzLNs.js} +1 -1
- package/dist/assets/{simple-select-Dtd0a5G_.js → simple-select-C2mBEc0U.js} +1 -1
- package/dist/assets/{spaces-Bqb0c1IC.js → spaces-DeV_YpyK.js} +1 -1
- package/dist/assets/{status-CoaEXqC8.js → status-AY9VNZQw.js} +1 -1
- package/dist/assets/{status-DAsfcIss.js → status-CuBjattD.js} +1 -1
- package/dist/assets/{sublime.es-Di_Rzzft.js → sublime.es-DqRI1gij.js} +1 -1
- package/dist/assets/{switch-control-uwHD90eP.js → switch-control-D_7zaAA3.js} +1 -1
- package/dist/assets/{table-icons-CMF2B4vQ.js → table-icons-DAVi_zrs.js} +1 -1
- package/dist/assets/{team-DbBAK1Lw.js → team-BVeJhT_q.js} +1 -1
- package/dist/assets/{th-BafLD2wR.js → th-B2BUfjNJ.js} +1 -1
- package/dist/assets/{toLower-Bk4Y66nU.js → toLower-Ddm9p1Fv.js} +1 -1
- package/dist/assets/toUpper-Dd2NWyrY.js +1 -0
- package/dist/assets/{traffic-C8Jrp6CL.js → traffic-Bvn15N7O.js} +1 -1
- package/dist/assets/{url-evaluation-DQ262LSg.js → url-evaluation-D2mP9Xpx.js} +1 -1
- package/dist/assets/{url-join-IGglLOtK.js → url-join-DNscpbOT.js} +1 -1
- package/dist/assets/{use-mobile-BoYyduuc.js → use-mobile-BCP-_fa6.js} +1 -1
- package/dist/assets/{use-mobile-YvhVWxe8.js → use-mobile-DVHkFhK8.js} +1 -1
- package/dist/assets/{useAsync-DbB0tJq1.js → useAsync-DKByAgoA.js} +1 -1
- package/dist/assets/{useAsyncRetry-BLg3v7lI.js → useAsyncRetry-CXNieOXD.js} +1 -1
- package/dist/assets/{useLocalStorage-DQZ59j66.js → useLocalStorage-BvE_hswD.js} +1 -1
- package/dist/assets/{useThemeProps-CtXzBlYo.js → useThemeProps-Daih-0Xh.js} +1 -1
- package/dist/assets/{util-CUC0Xf5B.js → util-CCEJlwCp.js} +1 -1
- package/dist/assets/{vi-BMZxxaJ2.js → vi-BykmwIAT.js} +3 -3
- package/dist/assets/{wait-container-GoGxY2Kf.js → wait-container-DHAK3hjx.js} +1 -1
- package/dist/assets/{withStyles-_FcG1bkA.js → withStyles-Cj7JqeJd.js} +1 -1
- package/dist/assets/wrap-locale-DGIIYNPn.js +1 -0
- package/dist/assets/{zh-DusA4qAT.js → zh-CbCaOuAd.js} +3 -1
- package/dist/assets/{zh-tw-BO-QhSNP.js → zh-tw-C9JfiCVV.js} +3 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/api-gAVz4YtD.js +0 -1
- package/dist/assets/ar-0ZkmCCuq.js +0 -7
- package/dist/assets/cloneDeep-CP0xacDT.js +0 -1
- package/dist/assets/emotion-react.browser.esm--gIypTeg.js +0 -1
- package/dist/assets/es-D_uF0siv.js +0 -7
- package/dist/assets/fr-DVFSQfDp.js +0 -7
- package/dist/assets/getValidReactChildren-B-b9MOMT.js +0 -1
- package/dist/assets/index-Boprg64p.js +0 -236
- package/dist/assets/index-DrBxStif.js +0 -41
- package/dist/assets/index-s1CQJTjJ.js +0 -1
- package/dist/assets/is-path-prefix-equal-C80Jhu_q.js +0 -1
- package/dist/assets/item-CrnjScjy.js +0 -277
- package/dist/assets/omit-BEDWXxvr.js +0 -1
- package/dist/assets/refType-J5vgZzDX.js +0 -1
- package/dist/assets/sdk-gxKU3x6m.js +0 -1
- package/dist/assets/toUpper-FI4Si1KF.js +0 -1
- package/dist/assets/wrap-locale-B35eVgy7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bl as j,d8 as O}from"./index-
|
|
1
|
+
import{bl as j,d8 as O}from"./index-D6xNQO9D.js";function J(i,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const e in a)if(e!=="default"&&!(e in i)){const s=Object.getOwnPropertyDescriptor(a,e);s&&Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var d={default:O,call:function(i,t,r){var a="";typeof t=="function"&&(r=t,t={});var e={data:t===void 0?null:t};if(typeof r=="function"){var s="dscb"+window.dscb++;window[s]=r,e._dscbstub=s}return e=JSON.stringify(e),window._dsbridge?a=_dsbridge.call(i,e):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(a=prompt("_dsbridge="+i,e)),JSON.parse(a||"{}").data},register:function(i,t,r){var a=r?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){d.call("_dsb.dsinit")},0)),typeof t=="object"?a._obs[i]=t:a[i]=t},registerAsyn:function(i,t){this.register(i,t,!0)},hasNativeMethod:function(i,t){return this.call("_dsb.hasNativeMethod",{name:i,type:t||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};(function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:d,close:function(){d.call("_dsb.closePage")},_handleMessageFromNative:function(r){var a=JSON.parse(r.data),e={id:r.callbackId,complete:!0},s=this._dsf[r.method],o=this._dsaf[r.method],p=function(u,_){e.data=u.apply(_,a),d.call("_dsb.returnValue",e)},v=function(u,_){a.push(function(w,y){e.data=w,e.complete=y!==!1,d.call("_dsb.returnValue",e)}),u.apply(_,a)};if(s)p(s,this._dsf);else if(o)v(o,this._dsaf);else{var l=r.method.split(".");if(l.length<2)return;var b=l.pop(),g=l.join("."),c=this._dsf._obs,f=c[g]||{},n=f[b];if(n&&typeof n=="function"){p(n,f);return}if(c=this._dsaf._obs,f=c[g]||{},n=f[b],n&&typeof n=="function"){v(n,f);return}}}};for(var t in i)window[t]=i[t];d.register("_hasJavascriptMethod",function(r,a){var e=r.split(".");if(e.length<2)return!!(_dsf[e]||_dsaf[e]);var r=e.pop(),s=e.join("."),o=_dsf._obs[s]||_dsaf._obs[s];return o&&!!o[r]})}})();var h=d;const N=j(h),k=J({__proto__:null,default:N},[h]);export{k as i};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{am as ee,x as N,r as p,a as te,b as se,P as b,m as w,u as j,w as oe,ay as _,H as
|
|
1
|
+
import{am as ee,x as N,r as p,a as te,b as se,P as b,m as w,u as j,w as oe,ay as _,H as W,j as t,v as O,az as re,a2 as y,k as R,D as M,aA as ne,aB as ae,B as V,C as z,aC as le,y as K,X as H,aD as ie,aE as ce,K as E,aF as ue,A as de,aG as D,g as pe,aH as he,n as G,ab as fe,a6 as me,a8 as ge,a9 as xe,aI as be,aa as ke}from"./index-D6xNQO9D.js";import{_ as B}from"./useLocalStorage-BvE_hswD.js";import{c as ye,C as Se,A as we,W as je,a as ve,d as Pe,B as Re,S as Q,b as Ce,e as Be}from"./item-CX8J2MJp.js";import{g as T}from"./get-safe-url-DFKtG9HX.js";import{P as X}from"./permission-fFO3ZJsb.js";import{d as Le}from"./ArrowDropDown-lSBhitmG.js";import{B as De}from"./Breadcrumbs-CCANSAXq.js";import"./ChevronLeft-CQivGJHk.js";import"./ChevronRight-BlhG3yZY.js";import"./Search-CjaYHOuY.js";import"./index-gWj5DPOC.js";import"./blocklet-C3B7_czn.js";import"./Autocomplete-DPEAys5B.js";import"./ListSubheader-C-e_2m7m.js";import"./Verified-Cr6wy4Uq.js";import"./VerifiedUser-DQ1XdtS0.js";import"./Add-BvcTJL6g.js";import"./Launch-DHV3U2Y3.js";import"./Done-yL7tHkLt.js";import"./DeleteOutline-Ja8iJJm1.js";import"./delete-confirm-BSpKG6TK.js";import"./click-to-copy-CVJCV48Y.js";import"./MoreVert-C7ADSe__.js";import"./get-safe-url-rD4VAeiO.js";import"./ButtonGroup-8JIPxBFt.js";import"./getValidReactChildren-DXpwHayT.js";function Ee(e){const r=ee(),c=N(),[s,o]=B(`sid:blocklet:purchase:${e}`),[a,u]=p.useState(!1),[h,l]=p.useState(null),f=()=>{const{pathname:n,searchParams:d}=new URL(window.location.href),i=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";d.get("sid")&&(o(""),c(n.replace(i,"/"),{replace:!0}))},m=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(l(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(f,2e3)))}),p.useEffect(()=>{h&&h.id!==s&&o(h.id)},[h]),{hasCompleted:a,hasPurchased:m,session:h,setSession:l,doRedirect:f}}function U({meta:e,onCancel:r,handlePaySuccess:c,storeUrl:s}){const{t:o}=w(),{info:a}=j(),[u,h]=p.useState("both"),[l,f]=p.useState(1),m=oe(a),n=_(e,a,s),d=P=>{P!==u&&h(P)},i=()=>{u&&(f(2),u==="verify"&&(window.location.href=T(n)))},k=(P,L)=>{L!=="backdropClick"&&r()},v=()=>{c(n)},g=W.getDisplayName({meta:e});if(u==="purchase"&&l===2)return t.jsx(O,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:y(s,"/store")}).get,onSuccess:v,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:m,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:g}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:g})]})]})}});const x=M;return t.jsx(x,{title:o("store.purchase.title",{name:g}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:k,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(Se,{action:u,onNext:i,onSelect:d})})})}U.propTypes={...ye,storeUrl:b.string.isRequired,handlePaySuccess:b.func};U.defaultProps={handlePaySuccess:e=>{setTimeout(()=>{window.location.href=T(e,{allowDomains:null})},1e3)}};function I({meta:e,buttonText:r,storeUrl:c,isResource:s}){const{t:o}=w(),a=N(),{info:u}=j(),{api:h}=ne(),l=W.isFreeBlocklet(e)===!1,[f,m]=p.useState(!1),{hasPurchased:n}=Ee(e.did),[d,i]=p.useState(!1),[k]=B("instant-blocklet-install",!1),[v,g]=p.useState(!1),x=p.useMemo(()=>f?o(l?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[f,o,l]),P=p.useMemo(()=>s?o("blocklet.status.resource"):l?r.purchase:r.launch,[l,r,s]),L=S=>{S.preventDefault(),S.stopPropagation();try{if(m(!0),l){i(!0);return}if(k){g(!0);return}if(!l){const C=_(e,u,c);window.location.href=T(C)}}catch(C){K.error(H(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{m(!1)}},Y=()=>{m(!1),i(!1)},J=S=>{m(!1),g(!1),a(`/blocklets/${S.appDid}/components`)},Z=()=>{m(!1),g(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(we,{children:t.jsx(X,{permission:"mutate_blocklets",children:S=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(V,{onClick:L,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(x||!S),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:x?t.jsxs(t.Fragment,{children:[t.jsx(z,{size:16,style:{marginRight:3}}),x]}):P},e.did)})})}),(n||d)&&t.jsx(U,{method:"launch",meta:e,mode:"both",onCancel:Y,storeUrl:c}),v&&t.jsx(O,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:J,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(le(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}I.propTypes={isResource:b.bool,meta:b.object.isRequired,buttonText:b.shape({purchase:b.string.isRequired,launch:b.string.isRequired}).isRequired,storeUrl:b.string.isRequired};I.defaultProps={isResource:!1};const Te=(e,r,c)=>{const s=fe(r);return y(c,`/blocklets/${e.did}/?server-url=${s}`)},q=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return y(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function F({blocklet:e,endpoint:r,serverVersion:c}){var n,d;const{t:s}=w(),o=j();let a=y(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)a=y(u,ue(e.did,e.logo,e.version));else{let k=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");k&&(k=`/${k}`),a=y(k,`/blocklet/logo/${e.did}`)}try{const i=new URL(a);i.searchParams.set("v",e.version||+new Date),a=i.href}catch{}const h=(o==null?void 0:o.info.mode)!==de.NODE_MODES.SERVERLESS,l=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),f={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u};let m=null;return h&&(m=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(ve,{serverVersion:c,requirementVersion:(n=e.requirements)==null?void 0:n.server,size:"small",children:t.jsx(I,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...f})})})),t.jsx(pe,{href:Te(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:l,target:"_blank",children:t.jsx(Ie,{title:q({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:q({meta:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,icons:(d=e.docker)!=null&&d.image?[{key:"docker",icon:t.jsx(E,{display:"flex",color:"primary.main",children:t.jsx(he,{icon:Pe})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:m})})}F.propTypes={blocklet:b.object.isRequired,serverVersion:b.string,endpoint:b.string};F.defaultProps={endpoint:"",serverVersion:""};function A({storeUrl:e,handleSearchSelect:r,extraFilter:c,...s}){var n;const{locale:o}=w(),a=j(),[u,h]=p.useState({}),l=d=>{h(d)},f=e,m=(n=a==null?void 0:a.info)==null?void 0:n.version;return p.useEffect(()=>{h({})},[f]),t.jsx(ie,{FallbackComponent:ce,resetKeys:[f],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:d=>{const i={...d,endpoint:f};return t.jsx(F,{...i})},baseSearch:!0,endpoint:f,locale:o,onFilterChange:l,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:m})})})}A.propTypes={storeUrl:b.string.isRequired,handleSearchSelect:b.func,extraFilter:b.func};A.defaultProps={handleSearchSelect:null,extraFilter:void 0};const Ie=G(Re)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
5
|
-
`,Fe=me(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})),$=p.forwardRef(({onChange:e,onDelete:r},c)=>{const{info:s}=j(),{t:o}=w(),[a,u]=p.useState(!1),[h,l]=p.useState(!1),[f,m]=p.useState(-1),n=Fe(),[d,i]=B(Q),k=Math.max(s.blockletRegistryList.findIndex(g=>g.url===d),0),v=g=>{try{u(!0),m(g);const x=s.blockletRegistryList[g];i(x.url),e(x.url),l(!1)}catch(x){console.error(x),K.error(`${o("store.blockletRegistry.changeFailed")} ${H(x)}`)}finally{u(!1)}};return p.useImperativeHandle(c,()=>({setOpen:l})),t.jsxs(t.Fragment,{children:[t.jsx(
|
|
5
|
+
`,Fe=me(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})),$=p.forwardRef(({onChange:e,onDelete:r},c)=>{const{info:s}=j(),{t:o}=w(),[a,u]=p.useState(!1),[h,l]=p.useState(!1),[f,m]=p.useState(-1),n=Fe(),[d,i]=B(Q),k=Math.max(s.blockletRegistryList.findIndex(g=>g.url===d),0),v=g=>{try{u(!0),m(g);const x=s.blockletRegistryList[g];i(x.url),e(x.url),l(!1)}catch(x){console.error(x),K.error(`${o("store.blockletRegistry.changeFailed")} ${H(x)}`)}finally{u(!1)}};return p.useImperativeHandle(c,()=>({setOpen:l})),t.jsxs(t.Fragment,{children:[t.jsx(V,{classes:{text:n.buttonText},color:"secondary","data-cy":"store-toggle",onClick:()=>{l(!0)},endIcon:t.jsx(Le,{}),children:t.jsx(R,{color:"secondary",children:s.blockletRegistryList[k].name})}),t.jsx(M,{title:o("store.blockletRegistry.switchRegistry"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:h,onClose:()=>l(!1),children:t.jsxs(ge,{className:n.tabPanel,children:[s.blockletRegistryList.map((g,x)=>t.jsxs(xe,{button:!0,disabled:a,selected:k===x,"data-cy":"store-switch",onClick:()=>{if(!a){if(x===k){l(!1);return}v(x)}},children:[f===x&&a&&t.jsx(be,{className:n.iconRoot,children:t.jsx(z,{size:16})}),t.jsx(ke,{children:t.jsx(Ce,{teamDid:s.did,store:g,onDelete:()=>r(g.url)})})]},g.url)),t.jsx(X,{permission:"mutate_node",children:g=>t.jsx(Be,{disabled:a||!g,onAdd:e,teamDid:s.did,blockletRegistryList:s.blockletRegistryList})})]})})]})});$.propTypes={onChange:b.func,onDelete:b.func};$.defaultProps={onChange:()=>{},onDelete:()=>{}};const Ae=$;function ut(){const{t:e}=w(),{info:r}=j(),[c]=B(Q),{blockletRegistryList:s}=r,o=s.find(n=>c===n.url)||s[0],[a,u]=p.useState(o.url),h=r.routing.adminPath,l=y(window.location.origin,h),f=({detailUrl:n})=>{const d=new URL(n);d.searchParams.set("server-url",l);const i=document.createElement("a");i.setAttribute("target","_blank"),i.setAttribute("href",d.href),i.click()},m=p.useRef(null);return t.jsxs($e,{children:[t.jsxs(De,{separator:"›","aria-label":"breadcrumb",className:"page-breadcrumb",children:[t.jsx(R,{color:"textPrimary",children:e("common.store")}),t.jsx(Ae,{ref:m,onChange:n=>u(n),onDelete:n=>{var d;a===n&&u((d=r.blockletRegistryList[0])==null?void 0:d.url)}})]}),t.jsx(E,{className:"store-header",display:"flex",justifyContent:"space-between",p:0,m:0,children:t.jsx(R,{component:"h2",variant:"h4",color:"textPrimary",children:e("store.headerDescription")})}),t.jsx(A,{className:"blocklet-list",handleSearchSelect:f,storeUrl:a})]})}const $e=G.main`
|
|
6
6
|
.blocklet-list {
|
|
7
7
|
aside:hover {
|
|
8
8
|
height: calc(100vh - 235px);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie-react.esm-
|
|
2
|
-
import{c5 as H,r as h,cw as W,bW as _,j as e,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie-react.esm-BpS8UEol.js","./index-D6xNQO9D.js","./index-Cp6LwWOU.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c5 as H,r as h,cw as W,bW as _,j as e,hk as q,aT as E,fY as Y,K as l,G as b,k as S,t as J,aY as K,ep as B,n as k,dx as M,dy as X,a4 as Q,bB as L,al as Z,aU as ee,lm as te}from"./index-D6xNQO9D.js";import{R as re,a as ie}from"./url-evaluation-D2mP9Xpx.js";import{S as O}from"./Slider-14Xp1QE3.js";import{k as oe,g as ae}from"./index-DlxuFr_2.js";import{C as se}from"./Close-aI0rARqu.js";import"./url-join-DNscpbOT.js";import"./index-BpB-1Bg8.js";import"./_createAggregator-zWIYJPBX.js";import"./index-DdEhGphv.js";import"./resource-dialog-1Tb87EP-.js";import"./index-0tIu-1zK.js";import"./index-gWj5DPOC.js";import"./index-Bde_-0lD.js";import"./use-mobile-DVHkFhK8.js";import"./ListItemButton-CS_u4xql.js";import"./index-D2RfS7-O.js";import"./emotion-react.browser.esm-CZUhgARx.js";import"./index-BjO4wh2H.js";import"./Switch-lDUha6nF.js";import"./index-BH6N9kiW.js";import"./TableRow-uM5dbbKH.js";import"./useThemeProps-Daih-0Xh.js";import"./ViewColumn-BncCRTIT.js";import"./Search-CjaYHOuY.js";import"./Clear-9k4hE_iq.js";import"./Delete-EgRRDgvd.js";import"./MoreVert-C7ADSe__.js";import"./TableSearch-CUrFzIWx.js";import"./index-BtMd2e0b.js";import"./OpenInNew-DloC4nwa.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-BmFBsSz3.js";import"./index-BjBCo6La.js";import"./ButtonGroup-8JIPxBFt.js";import"./getValidReactChildren-DXpwHayT.js";import"./toUpper-Dd2NWyrY.js";function ne(t){var c=H(h.useState(t),2),s=c[0],i=c[1],n=W(s),m=h.useCallback(function(){return n.current},[]);return[s,i,m]}const le=_([e.jsx("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8m-2 13-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z",opacity:".3"},"0"),e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"},"1")],"CheckCircleTwoTone"),ce=_(e.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),de=_(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonUnchecked"),me=_(e.jsx("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"}),"TipsAndUpdates"),D=h.createContext({}),F=()=>h.useContext(D);function pe({children:t,restrictions:c,i18n:s,theme:i}){const[n,m]=ne({loading:!1}),p=a=>m(j=>({...j,loading:a})),f=h.useMemo(()=>({...n,onLoading:p,restrictions:c,i18n:s}),[n]);return e.jsx(q,{theme:i,children:e.jsx(D.Provider,{value:f,children:t})})}const ue=["1024x1024","1024x1792","1792x1024"],xe=["256x256","512x512","1024x1024"],he=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function fe({onSubmit:t}){const{loading:c,i18n:s}=F(),i=E({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),n=()=>{const a=JSON.parse(JSON.stringify(i));Object.values(i).every(y=>!!y)&&t(a)},{run:m}=Y(n,{wait:500}),p={width:"100%",pl:1,pr:1},f=i.model==="dall-e-2"?xe:ue;return e.jsxs(ge,{onSubmit:a=>a.preventDefault(),children:[e.jsx(l,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(b,{container:!0,gap:2.5,children:[e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:s("aiImagePrompt")}),e.jsx(J,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:s("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:i.prompt??"",onChange:a=>{a.stopPropagation(),i.prompt=a.target.value},inputProps:{maxLength:1e3}})]}),e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageModel")}`}),e.jsx(re,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:i.model,onChange:a=>{i.number=1,i.size="1024x1024",i.model=a.target.value},children:he.map(a=>e.jsx(K,{value:a.value,control:e.jsx(ie,{size:"small"}),label:a.label},a.label))})]}),e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageSize")}: ${i.size}`}),e.jsx(b,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(l,{flex:1,children:e.jsx(l,{...p,children:e.jsx(O,{size:"small",min:0,max:f.length-1,step:1,value:f.findIndex(a=>a==i.size),onChange:(a,j)=>{i.size=f[j]}})})})})]}),i.model==="dall-e-2"&&e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageNumber")}: ${i.number}`}),e.jsx(l,{...p,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:i.number,onChange:(a,j)=>{a.stopPropagation(),i.number=Number(j)}})})]})]})}),e.jsx(B,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:m,disabled:c,children:s(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const ge=k(l)`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
height: 100%;
|
|
@@ -93,7 +93,7 @@ import{c5 as H,r as h,cw as W,bW as _,j as e,hj as q,aT as E,fY as Y,K as l,G as
|
|
|
93
93
|
& path:last-child {
|
|
94
94
|
fill: white;
|
|
95
95
|
}
|
|
96
|
-
`,ve=h.lazy(()=>L(()=>import("./lottie-react.esm-
|
|
96
|
+
`,ve=h.lazy(()=>L(()=>import("./lottie-react.esm-BpS8UEol.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Player})));function T({src:t}){return e.jsx(ve,{src:t,loop:!0,autoplay:!0})}function ke({options:t,handleApi:c,onSelect:s,onFinish:i,onClose:n,isMobile:m}){const{loading:p,onLoading:f,restrictions:a,i18n:j}=F(),[d,y]=h.useState([]),[u,I]=h.useState(),P=Z(),z=a==null?void 0:a.maxNumberOfFiles,[x,R]=h.useState({}),g=E({}),A=Object.keys(g).filter(r=>g[r]),N={xs:6,sm:6};h.useEffect(()=>{u&&!x.error&&L(()=>import("./lottie-error-CMOXHtBH.js"),[],import.meta.url).then(r=>{R(o=>({...o,error:r.default}))}),t&&!d.length&&!x.loading&&L(()=>import("./lottie-loading-o-GBrhM9.js"),[],import.meta.url).then(r=>{R(o=>({...o,loading:r.default}))}),!t&&!x.welcome&&L(()=>import("./lottie-welcome-C9B95FIi.js"),[],import.meta.url).then(r=>{R(o=>({...o,welcome:r.default}))})},[u,t,d.length,x]),ee(async()=>{var r;if(t){I(void 0),f(!0);try{const o=await c({...t,responseFormat:"b64_json"});if(o.data){const w=(o.data||[]).map(C=>({src:`data:image/png;base64,${C.b64Json||C.b64_json}`,width:t.size?Number((t.size||"").split("x")[0]):1024,alt:t.prompt}));y(d?[...w,...d]:w)}else I(o)}catch(o){console.error("AIImage generate error: ",o),I(((r=o==null?void 0:o.response)==null?void 0:r.data)||o)}finally{f(!1),i()}}},[t==null?void 0:t.number,t==null?void 0:t.prompt,t==null?void 0:t.size]);const $=r=>{const o=Object.keys(g).filter(w=>g[w]);if(z?o.length<z:!0)g[r]?g[r]=!1:g[r]=!0;else{const w=o.pop();w!==r&&(g[w]=!1),g[r]=!g[r]}},U=r=>{if(d){const o=d.findIndex(v=>v.src===r);o>-1&&(g[r]=!1,d.splice(o,1),y([...d]))}},V=()=>{var o,v;const r={width:((o=document.querySelector(".photo-item img"))==null?void 0:o.offsetWidth)||0,height:((v=document.querySelector(".photo-item img"))==null?void 0:v.offsetHeight)||0};return e.jsx(e.Fragment,{children:Array.from({length:(t==null?void 0:t.number)||1}).map((w,C)=>h.createElement(b,{item:!0,...N,key:C},e.jsx(M,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...r}})))})},G=()=>u?e.jsxs(l,{width:300,height:300,m:"auto",children:[x.error&&e.jsx(T,{src:x.error},"error"),e.jsx(l,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:u==null?void 0:u.message})]}):d&&Array.isArray(d)&&d.length>0?e.jsxs(e.Fragment,{children:[e.jsx(l,{flexGrow:1,sx:{height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(Se,{sx:m?{p:0,border:"none !important"}:{p:2},children:e.jsxs(b,{spacing:2,container:!0,className:"photo-wrapper",children:[p&&e.jsx(V,{}),d.map((r,o)=>h.createElement(b,{item:!0,...N,key:r.src,className:"photo-item"},e.jsx(be,{...r,selected:g[r.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:g[r.src]?`2px solid ${P.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{$(r.src)},onDelete:()=>{U(r.src)}})))]})})}),e.jsxs(l,{sx:{mt:2,display:"flex",justifyContent:n?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[n&&typeof n=="function"&&e.jsx(B,{color:"primary",variant:"outlined",onClick:n,children:e.jsx(se,{})}),e.jsx(B,{color:"primary",variant:"contained",disabled:!A.length||p,onClick:()=>{const r=oe(d,"src");s(A.map(o=>r[o]))},children:A.length?j("aiImageSelectedUse"):j("aiImageSelectedTip")})]})]}):t?e.jsx(l,{width:220,height:220,m:"auto",children:x.loading&&e.jsx(T,{src:x.loading},"loading")}):e.jsx(l,{width:300,height:300,m:"auto",children:x.welcome&&e.jsx(T,{src:x.welcome},"welcome")});return e.jsx(Ie,{children:G()})}const Ie=k(l)`
|
|
97
97
|
min-height: 100%;
|
|
98
98
|
display: flex;
|
|
99
99
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,j as n,B as i,K as s,
|
|
1
|
+
import{P as e,j as n,B as i,K as s,i3 as r}from"./index-D6xNQO9D.js";function a({children:t=null,...o}){return n.jsxs(i,{color:"did",variant:"contained",...o,children:[n.jsx(s,{sx:{fontWeight:400},children:t||"Continue With"}),n.jsx(r,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}a.propTypes={children:e.any};export{a as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as f,j as s,C as d,x as w,aA as v,ct as C,cu as u,K as j,bz as I,af as P,A as S}from"./index-
|
|
1
|
+
import{u as f,j as s,C as d,x as w,aA as v,ct as C,cu as u,K as j,bz as I,af as P,A as S}from"./index-D6xNQO9D.js";import{I as R}from"./invitation-B-BBdPct.js";import{g as T}from"./get-safe-url-DFKtG9HX.js";import"./index-Bde_-0lD.js";import"./index-D2RfS7-O.js";import"./emotion-react.browser.esm-CZUhgARx.js";import"./index-CEGwKYvA.js";import"./sdk-Dt3mm4lK.js";import"./wrap-locale-DGIIYNPn.js";function k(n){const{searchParams:i}=new URL(window.location.href),g=w(),{api:a,session:r}=v(),{info:l}=f(),c=i.get("redirect"),p=i.get("id"),e=C(async()=>{if(!p)return null;const{data:t}=await a.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return t}),m=u(()=>{if(e.error)throw e.error;return e==null?void 0:e.data}),h=u(async(t,x=o=>o)=>{t&&(t.sessionToken&&P(x(t.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?g(o,{replace:!0}):window.location.href=T(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return e.loading?s.jsx(d,{}):s.jsx(j,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:s.jsx(R,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:t=>I(t,l),checkFn:a.get,onLoginSuccess:h,passportColor:"default",onLogin:r.login})})}function b(){return f().loading?s.jsx(d,{}):s.jsx(k,{})}export{b as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c0 as Ge,b$ as et,b8 as te,ce as ee,r as y,c1 as tt,b_ as ot,bY as Pe,j as e,c3 as st,c4 as nt,M as V,bq as M,ct as rt,y as B,X,bi as T,ge as Me,aU as Ue,b as _,lb as at,m as E,P as g,hD as it,w as ct,az as Ne,a2 as ge,an as lt,n as dt,k as C,e as ut,C as z,i as pt,al as mt,lc as J,h2 as G,ld as ft,K as j,aZ as W,aB as ye,A as R,g as ht,T as Q,du as gt,aP as je,aQ as be,Q as Y,aI as q,aa as H,a5 as xt,ep as St,b3 as yt,B as me,v as jt,G as Le,Y as We,bC as xe,z as bt}from"./index-DTb1YjkO.js";import{T as Ct}from"./index-DzK6OW-H.js";import{u as A}from"./blocklet-SKmr21o8.js";import{u as kt}from"./use-mobile-BoYyduuc.js";import{b as Dt,u as Bt,D as wt,c as fe,a as Tt}from"./index-BkStkax6.js";import"./index-DnLtwT4P.js";import"./index-BojVbZw0.js";import"./api-gAVz4YtD.js";import{c as $e,b as Et,u as It,C as Rt,D as vt,a as zt}from"./connect-to-BbdcjX_x.js";import{d as At,a as Pt,g as Lt,i as Ot,e as Se,f as _t,h as Mt,j as Ut}from"./spaces-Bqb0c1IC.js";import{I as Nt}from"./index-BLrsx8oH.js";import{R as Wt}from"./index-CyCivdc5.js";import{d as $t}from"./HelpOutline-CBv7x3VM.js";import{D as Kt}from"./index-CFc2cpAq.js";import{x as Ft}from"./index-BJHGOv7L.js";import{d as Yt}from"./MoreHoriz-3d6Yp_t-.js";import{f as qt}from"./actions-CvZtuIOm.js";import{d as Ht}from"./DeleteOutline-EQ9bHspP.js";import{g as Oe}from"./get-safe-url-BHhOK-87.js";import{S as Qt}from"./switch-control-uwHD90eP.js";import{L as _e}from"./list-header-D5Klosqn.js";import"./OpenInNew-D79h4Iot.js";import"./ButtonGroup-ClVwTb7r.js";import"./getValidReactChildren-B-b9MOMT.js";import"./TableRow-CQ8RBtid.js";import"./useThemeProps-CtXzBlYo.js";import"./emotion-react.browser.esm--gIypTeg.js";import"./ViewColumn-CcQluqhl.js";import"./Search-CUm1f8xo.js";import"./Clear-D0I7uWhD.js";import"./Delete-P4B2dduO.js";import"./index-omP-_XYV.js";import"./MoreVert-C_Ck3fn9.js";import"./TableSearch-Uk9kIt7i.js";import"./useLocalStorage-DQZ59j66.js";import"./url-evaluation-DQ262LSg.js";import"./permission-DtbkcHFU.js";import"./index-C_5on_zt.js";import"./Switch-D3iZUzda.js";function Vt(t){return Ge("MuiIcon",t)}et("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Xt=["baseClassName","className","color","component","fontSize"],Zt=t=>{const{color:s,fontSize:n,classes:o}=t,a={root:["root",s!=="inherit"&&`color${ee(s)}`,`fontSize${ee(n)}`]};return nt(a,Vt,o)},Jt=te("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${ee(n.color)}`],s[`fontSize${ee(n.fontSize)}`]]}})(({theme:t,ownerState:s})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:t.typography.pxToRem(20),medium:t.typography.pxToRem(24),large:t.typography.pxToRem(36)}[s.fontSize],color:{primary:(t.vars||t).palette.primary.main,secondary:(t.vars||t).palette.secondary.main,info:(t.vars||t).palette.info.main,success:(t.vars||t).palette.success.main,warning:(t.vars||t).palette.warning.main,action:(t.vars||t).palette.action.active,error:(t.vars||t).palette.error.main,disabled:(t.vars||t).palette.action.disabled,inherit:void 0}[s.color]})),Ce=y.forwardRef(function(s,n){const o=tt({props:s,name:"MuiIcon"}),{baseClassName:a="material-icons",className:r,color:i="inherit",component:l="span",fontSize:u="medium"}=o,c=ot(o,Xt),f=Pe({},o,{baseClassName:a,color:i,component:l,fontSize:u}),p=Zt(f);return e.jsx(Jt,Pe({as:l,className:st(a,"notranslate",p.root,r),ownerState:f,"aria-hidden":!0,ref:n},c))});Ce.muiName="Icon";async function Gt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const a=await Promise.all(n.map(async r=>{let{name:i}=r;const l=await At(r.endpoint);return!V(l)&&l!==i&&(i=l,o=!0),{...r,name:i}}));return o&&await Promise.all(a.filter(r=>r.did).map(r=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:r.did},spaceGateway:{...r}}}))),a}function eo({refresh:t}={}){var a;const{blocklet:s}=A(),n=(a=s==null?void 0:s.meta)==null?void 0:a.did,{api:o}=M();return rt(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){var i;(i=r==null?void 0:r.message)!=null&&i.includes("not logged")?console.warn(r):(console.error(r),B.error(X(r)))}})}function Ke({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var f;const{blocklet:o}=A(),[a,r]=y.useState([]),{api:i}=M(),[l,u]=y.useMemo(()=>n?[T(n).startOf("day").toISOString(),T(n).endOf("day").toISOString()]:[T().startOf("year").toISOString(),T().endOf("day").toISOString()],[n]),c=Me(async()=>{try{if(s(!0),!o){r([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:l,endTime:u}});r(p??[])}catch(p){console.error(p),B.error(X(p))}finally{s(!1)}},1e3);return Ue(async()=>{c()},[(f=o==null?void 0:o.meta)==null?void 0:f.did].concat(t)),{backups:a}}function to({appDid:t}){const{backups:s}=Ke(),[n,o]=y.useState({message:"",progress:0,completed:!1}),a=M(),{ws:{useSubscription:r}}=a;return r(_.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[t]),y.useEffect(()=>{var i;if(s!=null&&s.length&&at((i=s[0])==null?void 0:i.status)){const[l]=s;o(()=>({message:l.message,progress:l.progress,completed:l.progress>=100}))}},[s]),n}function oo({deps:t=[],setLoading:s=()=>{}}={}){var l;const{blocklet:n}=A(),[o,a]=y.useState([]),{api:r}=M(),i=y.useCallback(Me(async()=>{var u;if(!r||!((u=n==null?void 0:n.meta)!=null&&u.did)){a([]);return}try{s(!0);const c=T(),f=c.subtract(1,"year"),{summary:p}=await r.getBlockletBackupSummary({input:{did:n.meta.did,startTime:f.toISOString(),endTime:c.toISOString()}});a(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),B.error(X(c)),a([])}finally{s(!1)}},1e3),[]);return Ue(async()=>(await i(),()=>{i.cancel()}),[(l=n==null?void 0:n.meta)==null?void 0:l.did].concat(t)),{backupSummary:o}}const Fe=y.createContext({}),{Provider:so,Consumer:is}=Fe;function ke({children:t}){var K;const{t:s}=E(),{api:n}=M(),{blocklet:o}=A(),[a,r]=y.useState(null),[i,l]=y.useState(!1),{data:u,loading:c,mutate:f}=eo({refresh:i}),p=it(u),x=to({appDid:o==null?void 0:o.appDid}),h=y.useMemo(()=>Pt(o==null?void 0:o.environments),[o==null?void 0:o.environments]),[b,D]=y.useState(!1),[S,d]=y.useState(!1),{backups:se}=Ke({deps:[S,a],setLoading:D,backupDate:a}),[ne,re]=y.useState(!1),{backupSummary:ae}=oo({deps:[ne]}),[U,L]=y.useState(u==null?void 0:u.find(m=>m.endpoint===h)),I=(K=o==null?void 0:o.settings)==null?void 0:K.autoBackup,v=()=>{l(m=>!m)},ie=()=>{re(m=>!m)},ce=()=>{d(m=>!m)},$=async m=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:m}})},Z=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},le=async(m,N)=>{try{f(w=>{const O=[...w];return O.push({...m,loading:!0}),O}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:m}}),h!==N&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(m),v(),B.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(w){throw console.error(w),f(O=>[...O].filter(pe=>pe.did!==m.did)),w}},de=async m=>{m&&(m.endpoint===h&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await $({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),f(N=>{const w=[...N];return w.splice(w.indexOf(m),1),w}),L(m),v())},ue=async m=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:m.did},spaceGateway:m}}),h!==m.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===h;return e.jsx(so,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:le,deleteSpaceGateway:de,updateSpaceGateway:ue,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:$,abortBlockletBackup:Z,backupEndpoint:h,backupProgress:x,backups:se,backupSummary:ae,refreshBackupSummary:ie,refreshBackups:ce,setBackupDate:r,backupsLoading:b,autoBackup:I},children:t})}ke.propTypes={children:g.any.isRequired};ke.defaultProps={};function P(){return y.useContext(Fe)}function oe({...t}){const{blocklet:s}=A(),{info:n}=M(),{t:o}=E(),a=$e({blocklet:s}),r=ct(n),{spaceGateways:i,addSpaceGateway:l}=P(),u={checkFn:Ne.create({baseURL:ge(window.location.origin,lt())}).get,webWalletUrl:r,extraParams:{appPid:s.appPid,appDid:a.appDid,appName:a.appName,appDescription:a.appDescription,appUrl:a.appUrl,referrer:a.referrer,scopes:a.scopes,nodeDid:n.did}},c=async({endpoint:p,name:x,did:h})=>{const b=await Lt(p);if(!await Ot(b)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(d=>d.endpoint===p)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await l({name:x,did:h,url:b,endpoint:p},p)},f=async({spaceGateway:p})=>{try{await c(p)}catch(x){console.error(x),B.error(X(x))}};return e.jsx(Dt,{...t,connectScope:"app",options:u,onSuccess:f})}oe.propTypes={};oe.defaultProps={};function Ye({...t}){const{t:s}=y.useContext(ut),{blocklet:n,loadingDiskInfo:o,actions:a}=A();if(y.useEffect(()=>{a==null||a.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const r=(u,c,f)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?pt(c):"empty"})]}),i=n.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),l=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(no,{component:"div",...t,children:l.map(u=>e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return o?e.jsx(z,{}):e.jsx(C,{children:s("blocklet.diskInfo.empty")})}const no=dt(C)``;function De(){const{t}=E(),{setBackupDate:s,backupSummary:n}=P(),o=Bt({key:"lg"}),a=y.useRef(null),r=mt(),i=y.useCallback(c=>{s(c)},[s]),l=y.useMemo(()=>{const c=T().add(1,"day"),f=T().subtract(11,"month").startOf("month"),p=new Map(n.map(h=>[h.date,{date:h.date,successCount:h.successCount,errorCount:h.errorCount}])),x=[];for(let h=f.clone();T(h).isBefore(c);h=h.add(1,"day")){const b=h.format("YYYY-MM-DD");x.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return x},[n]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:d}=l[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${d}</div>`].join(`
|
|
1
|
+
import{c0 as Ge,b$ as et,b8 as te,ce as ee,r as y,c1 as tt,b_ as ot,bY as Pe,j as e,c3 as st,c4 as nt,M as V,bq as M,ct as rt,y as B,X,bi as T,gf as Me,aU as Ue,b as _,lc as at,m as E,P as g,hE as it,w as ct,az as Ne,a2 as ge,an as lt,n as dt,k as C,e as ut,C as z,i as pt,al as mt,ld as J,h3 as G,le as ft,K as j,aZ as W,aB as ye,A as R,g as ht,T as Q,du as gt,aP as je,aQ as be,Q as Y,aI as q,aa as H,a5 as xt,ep as St,b3 as yt,B as me,v as jt,G as Le,Y as We,bC as xe,z as bt}from"./index-D6xNQO9D.js";import{T as Ct}from"./index-0tIu-1zK.js";import{u as A}from"./blocklet-C3B7_czn.js";import{u as kt}from"./use-mobile-BCP-_fa6.js";import{b as Dt,u as Bt,D as wt,c as fe,a as Tt}from"./index-BtMd2e0b.js";import"./index-BjBCo6La.js";import"./index-BojVbZw0.js";import"./api-C6KC1P_U.js";import{c as $e,b as Et,u as It,C as Rt,D as vt,a as zt}from"./connect-to-B6vJIcaQ.js";import{d as At,a as Pt,g as Lt,i as Ot,e as Se,f as _t,h as Mt,j as Ut}from"./spaces-DeV_YpyK.js";import{I as Nt}from"./index-FAOrsHzs.js";import{R as Wt}from"./index-DKh1PYSe.js";import{d as $t}from"./HelpOutline-BmFBsSz3.js";import{D as Kt}from"./index-BH6N9kiW.js";import{x as Ft}from"./index-BJHGOv7L.js";import{d as Yt}from"./MoreHoriz-DAgzjMkD.js";import{f as qt}from"./actions-Cq51qPdo.js";import{d as Ht}from"./DeleteOutline-Ja8iJJm1.js";import{g as Oe}from"./get-safe-url-rD4VAeiO.js";import{S as Qt}from"./switch-control-D_7zaAA3.js";import{L as _e}from"./list-header-CXofX5mW.js";import"./OpenInNew-DloC4nwa.js";import"./ButtonGroup-8JIPxBFt.js";import"./getValidReactChildren-DXpwHayT.js";import"./TableRow-uM5dbbKH.js";import"./useThemeProps-Daih-0Xh.js";import"./emotion-react.browser.esm-CZUhgARx.js";import"./ViewColumn-BncCRTIT.js";import"./Search-CjaYHOuY.js";import"./Clear-9k4hE_iq.js";import"./Delete-EgRRDgvd.js";import"./index-gWj5DPOC.js";import"./MoreVert-C7ADSe__.js";import"./TableSearch-CUrFzIWx.js";import"./useLocalStorage-BvE_hswD.js";import"./url-evaluation-D2mP9Xpx.js";import"./permission-fFO3ZJsb.js";import"./index-BjO4wh2H.js";import"./Switch-lDUha6nF.js";function Vt(t){return Ge("MuiIcon",t)}et("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Xt=["baseClassName","className","color","component","fontSize"],Zt=t=>{const{color:s,fontSize:n,classes:o}=t,a={root:["root",s!=="inherit"&&`color${ee(s)}`,`fontSize${ee(n)}`]};return nt(a,Vt,o)},Jt=te("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${ee(n.color)}`],s[`fontSize${ee(n.fontSize)}`]]}})(({theme:t,ownerState:s})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:t.typography.pxToRem(20),medium:t.typography.pxToRem(24),large:t.typography.pxToRem(36)}[s.fontSize],color:{primary:(t.vars||t).palette.primary.main,secondary:(t.vars||t).palette.secondary.main,info:(t.vars||t).palette.info.main,success:(t.vars||t).palette.success.main,warning:(t.vars||t).palette.warning.main,action:(t.vars||t).palette.action.active,error:(t.vars||t).palette.error.main,disabled:(t.vars||t).palette.action.disabled,inherit:void 0}[s.color]})),Ce=y.forwardRef(function(s,n){const o=tt({props:s,name:"MuiIcon"}),{baseClassName:a="material-icons",className:r,color:i="inherit",component:l="span",fontSize:u="medium"}=o,c=ot(o,Xt),f=Pe({},o,{baseClassName:a,color:i,component:l,fontSize:u}),p=Zt(f);return e.jsx(Jt,Pe({as:l,className:st(a,"notranslate",p.root,r),ownerState:f,"aria-hidden":!0,ref:n},c))});Ce.muiName="Icon";async function Gt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const a=await Promise.all(n.map(async r=>{let{name:i}=r;const l=await At(r.endpoint);return!V(l)&&l!==i&&(i=l,o=!0),{...r,name:i}}));return o&&await Promise.all(a.filter(r=>r.did).map(r=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:r.did},spaceGateway:{...r}}}))),a}function eo({refresh:t}={}){var a;const{blocklet:s}=A(),n=(a=s==null?void 0:s.meta)==null?void 0:a.did,{api:o}=M();return rt(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){var i;(i=r==null?void 0:r.message)!=null&&i.includes("not logged")?console.warn(r):(console.error(r),B.error(X(r)))}})}function Ke({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var f;const{blocklet:o}=A(),[a,r]=y.useState([]),{api:i}=M(),[l,u]=y.useMemo(()=>n?[T(n).startOf("day").toISOString(),T(n).endOf("day").toISOString()]:[T().startOf("year").toISOString(),T().endOf("day").toISOString()],[n]),c=Me(async()=>{try{if(s(!0),!o){r([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:l,endTime:u}});r(p??[])}catch(p){console.error(p),B.error(X(p))}finally{s(!1)}},1e3);return Ue(async()=>{c()},[(f=o==null?void 0:o.meta)==null?void 0:f.did].concat(t)),{backups:a}}function to({appDid:t}){const{backups:s}=Ke(),[n,o]=y.useState({message:"",progress:0,completed:!1}),a=M(),{ws:{useSubscription:r}}=a;return r(_.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[t]),y.useEffect(()=>{var i;if(s!=null&&s.length&&at((i=s[0])==null?void 0:i.status)){const[l]=s;o(()=>({message:l.message,progress:l.progress,completed:l.progress>=100}))}},[s]),n}function oo({deps:t=[],setLoading:s=()=>{}}={}){var l;const{blocklet:n}=A(),[o,a]=y.useState([]),{api:r}=M(),i=y.useCallback(Me(async()=>{var u;if(!r||!((u=n==null?void 0:n.meta)!=null&&u.did)){a([]);return}try{s(!0);const c=T(),f=c.subtract(1,"year"),{summary:p}=await r.getBlockletBackupSummary({input:{did:n.meta.did,startTime:f.toISOString(),endTime:c.toISOString()}});a(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),B.error(X(c)),a([])}finally{s(!1)}},1e3),[]);return Ue(async()=>(await i(),()=>{i.cancel()}),[(l=n==null?void 0:n.meta)==null?void 0:l.did].concat(t)),{backupSummary:o}}const Fe=y.createContext({}),{Provider:so,Consumer:is}=Fe;function ke({children:t}){var K;const{t:s}=E(),{api:n}=M(),{blocklet:o}=A(),[a,r]=y.useState(null),[i,l]=y.useState(!1),{data:u,loading:c,mutate:f}=eo({refresh:i}),p=it(u),x=to({appDid:o==null?void 0:o.appDid}),h=y.useMemo(()=>Pt(o==null?void 0:o.environments),[o==null?void 0:o.environments]),[b,D]=y.useState(!1),[S,d]=y.useState(!1),{backups:se}=Ke({deps:[S,a],setLoading:D,backupDate:a}),[ne,re]=y.useState(!1),{backupSummary:ae}=oo({deps:[ne]}),[U,L]=y.useState(u==null?void 0:u.find(m=>m.endpoint===h)),I=(K=o==null?void 0:o.settings)==null?void 0:K.autoBackup,v=()=>{l(m=>!m)},ie=()=>{re(m=>!m)},ce=()=>{d(m=>!m)},$=async m=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:m}})},Z=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},le=async(m,N)=>{try{f(w=>{const O=[...w];return O.push({...m,loading:!0}),O}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:m}}),h!==N&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(m),v(),B.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(w){throw console.error(w),f(O=>[...O].filter(pe=>pe.did!==m.did)),w}},de=async m=>{m&&(m.endpoint===h&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await $({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),f(N=>{const w=[...N];return w.splice(w.indexOf(m),1),w}),L(m),v())},ue=async m=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:m.did},spaceGateway:m}}),h!==m.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===h;return e.jsx(so,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:le,deleteSpaceGateway:de,updateSpaceGateway:ue,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:$,abortBlockletBackup:Z,backupEndpoint:h,backupProgress:x,backups:se,backupSummary:ae,refreshBackupSummary:ie,refreshBackups:ce,setBackupDate:r,backupsLoading:b,autoBackup:I},children:t})}ke.propTypes={children:g.any.isRequired};ke.defaultProps={};function P(){return y.useContext(Fe)}function oe({...t}){const{blocklet:s}=A(),{info:n}=M(),{t:o}=E(),a=$e({blocklet:s}),r=ct(n),{spaceGateways:i,addSpaceGateway:l}=P(),u={checkFn:Ne.create({baseURL:ge(window.location.origin,lt())}).get,webWalletUrl:r,extraParams:{appPid:s.appPid,appDid:a.appDid,appName:a.appName,appDescription:a.appDescription,appUrl:a.appUrl,referrer:a.referrer,scopes:a.scopes,nodeDid:n.did}},c=async({endpoint:p,name:x,did:h})=>{const b=await Lt(p);if(!await Ot(b)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(d=>d.endpoint===p)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await l({name:x,did:h,url:b,endpoint:p},p)},f=async({spaceGateway:p})=>{try{await c(p)}catch(x){console.error(x),B.error(X(x))}};return e.jsx(Dt,{...t,connectScope:"app",options:u,onSuccess:f})}oe.propTypes={};oe.defaultProps={};function Ye({...t}){const{t:s}=y.useContext(ut),{blocklet:n,loadingDiskInfo:o,actions:a}=A();if(y.useEffect(()=>{a==null||a.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const r=(u,c,f)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?pt(c):"empty"})]}),i=n.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),l=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(no,{component:"div",...t,children:l.map(u=>e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return o?e.jsx(z,{}):e.jsx(C,{children:s("blocklet.diskInfo.empty")})}const no=dt(C)``;function De(){const{t}=E(),{setBackupDate:s,backupSummary:n}=P(),o=Bt({key:"lg"}),a=y.useRef(null),r=mt(),i=y.useCallback(c=>{s(c)},[s]),l=y.useMemo(()=>{const c=T().add(1,"day"),f=T().subtract(11,"month").startOf("month"),p=new Map(n.map(h=>[h.date,{date:h.date,successCount:h.successCount,errorCount:h.errorCount}])),x=[];for(let h=f.clone();T(h).isBefore(c);h=h.add(1,"day")){const b=h.format("YYYY-MM-DD");x.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return x},[n]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:d}=l[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${d}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:r.palette.background.paper,borderColor:r.palette.divider,textStyle:{color:r.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${r.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:J[600]},{min:-9,max:-6,color:J[500]},{min:-6,max:-3,color:J[400]},{min:-3,max:-1,color:J[300]},{min:0,max:0,color:r.palette.grey[200]},{min:1,max:3,color:G[300]},{min:3,max:6,color:G[400]},{min:6,max:9,color:G[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:G[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:r.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:r.palette.background.default,color:r.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:r.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:r.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[T().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),T().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:l.map(b=>[b.date,b.errorCount?-b.errorCount:b.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:r.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ft[200],color:"inherit"}}}}),[l,t,r]);return e.jsxs(e.Fragment,{children:[e.jsx(j,{ref:a,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(j,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Wt,{option:u,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&i(c.data[0])}}})})}),e.jsx(j,{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2,children:e.jsxs(W,{direction:o?"column":"row",spacing:o?2:1,width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center",children:[e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.failed")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.without")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.succeeded")})]})]})})]})}De.propTypes={};const ro=te(({className:t,...s})=>e.jsx(ye,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Be({status:t,message:s,createdAt:n}){const{t:o}=E(),a=t===R.BACKUPS.STATUS.PROGRESS&&T().diff(n,"hours")>=R.BACKUPS.TIMEOUT_HOURS,r=a&&o("common.timeoutError"),i=t===R.BACKUPS.STATUS.PROGRESS&&!a,l=t===R.BACKUPS.STATUS.SUCCEEDED&&!a;return i?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):l?e.jsx(Q,{type:"success",children:o("common.succeeded")}):e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(Q,{type:"error",children:o("common.failed")})," ",e.jsx(ye,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||r,children:e.jsx(Ce,{children:e.jsx($t,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Be.propTypes={status:g.string.isRequired,message:g.string,createdAt:g.string.isRequired};Be.defaultProps={message:""};function we({metadata:t}){const{t:s}=E();if(V(t))return e.jsx(Q,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,a=Ft(o,{iec:!0}),r=e.jsxs(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(C,{variant:"body2",children:[s("common.fileSize"),": ",a]})]});return e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(Q,{type:"success",children:s("common.succeeded")})," ",e.jsx(ro,{title:r,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(Ce,{children:e.jsx(gt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}we.propTypes={metadata:g.object};we.defaultProps={metadata:{}};function Te(){const{t,locale:s}=E(),{spaceGateways:n,backups:o,backupsLoading:a}=P(),r=y.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:l=>{var D;const{targetUrl:u,targetName:c,status:f,createdAt:p}=o[l],x=f===R.BACKUPS.STATUS.PROGRESS&&T().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,h=f===R.BACKUPS.STATUS.SUCCEEDED&&!x,b=c||((D=n.find(S=>u==null?void 0:u.includes(Se(S==null?void 0:S.endpoint))))==null?void 0:D.name)||"Unknown DID Space";return h?e.jsx(ht,{fontSize:"16px",href:u,target:"_blank",children:b}):e.jsx(C,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:l=>{const u=t(l===0?"common.auto":"common.manual");return e.jsx(Q,{children:u})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:l=>T(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:l=>V(l)?"":T(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:l=>{const u=(o==null?void 0:o[l])??{},{status:c,message:f,createdAt:p,metadata:x}=u,h=c===R.BACKUPS.STATUS.PROGRESS&&T().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,b=c===R.BACKUPS.STATUS.PROGRESS&&!h,D=c===R.BACKUPS.STATUS.SUCCEEDED&&!h;return b?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):D?e.jsx(we,{metadata:x}):e.jsx(Be,{status:c,message:f,createdAt:p})}}}],[o,n,t]),i=y.useMemo(()=>!(o!=null&&o.length),[o]);return e.jsx(e.Fragment,{children:i?e.jsx(j,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(Kt,{title:"",loading:a,data:o,columns:r,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Te.propTypes={};function qe(){const{t}=E();return e.jsxs(j,{children:[e.jsxs(j,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(j,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(wt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(oe,{})]}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(De,{})]})]}),e.jsx(Te,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ye,{})]})}qe.propTypes={};var Ee={},ao=be;Object.defineProperty(Ee,"__esModule",{value:!0});var He=Ee.default=void 0,io=ao(je()),co=e;He=Ee.default=(0,io.default)((0,co.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ie={},lo=be;Object.defineProperty(Ie,"__esModule",{value:!0});var Qe=Ie.default=void 0,uo=lo(je()),po=e;Qe=Ie.default=(0,uo.default)((0,po.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Re={},mo=be;Object.defineProperty(Re,"__esModule",{value:!0});var Ve=Re.default=void 0,fo=mo(je()),ho=e;Ve=Re.default=(0,fo.default)((0,ho.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function ve({spaceGateway:t,onConfirm:s,onCancel:n}){const{t:o}=E(),[a,r]=y.useState(!1),[i,l]=y.useState(!1),u=(p,x)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),r(x)},c=async p=>{try{p==null||p.stopPropagation(),l(!0),await(s==null?void 0:s(t)),r(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${X(x)}`)}finally{r(!1),l(!1)}},f=p=>{u(p,!1),n==null||n(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(Y,{color:"red",onClick:p=>u(p,!0),children:[e.jsx(q,{style:{minWidth:24,color:"red"},children:e.jsx(Ht,{fontSize:"small"})}),e.jsx(H,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(xt,{title:o("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:i}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:i}},onConfirm:c,onCancel:f,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}ve.propTypes={spaceGateway:g.shape({name:g.string.isRequired,url:g.string.isRequired,protected:g.bool}).isRequired,onConfirm:g.func,onCancel:g.func};ve.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function ze({spaceGateway:t,selected:s,onDelete:n,onConnect:o,enableSwitchToSpace:a,backupInProgress:r,...i}){const{abortBlockletBackup:l}=P(),[u,c]=y.useState(null),{t:f}=E(),[p,x]=y.useState(!1),h=(S,d)=>{S.stopPropagation(),S.preventDefault(),c(d&&S.currentTarget)},b=async S=>{try{x(!0),h(S,!1),await o(t)}catch(d){console.error(d),B.error(d.message)}finally{x(!1)}},D=async S=>{try{x(!0),h(S,!1),await l()}catch(d){console.error(d),B.error(d.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[p||t!=null&&t.loading?e.jsx(z,{sx:{ml:1},size:"24px"}):e.jsx(St,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>h(S,!0),...i,children:e.jsx(Yt,{})}),e.jsxs(yt,{id:"simple-menu",anchorEl:u,keepMounted:!0,open:!!u,onClose:S=>h(S,!1),children:[e.jsxs(Y,{onClick:S=>{h(S,!1),window.open(Oe(t.endpoint?_t(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(q,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(H,{children:f("common.open")})]}),e.jsxs(Y,{onClick:S=>{h(S,!1),window.open(Oe(Mt(t.endpoint),{allowDomains:null}))},children:[e.jsx(q,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.strategy.viewBackupFiles")})]}),!s&&a&&e.jsxs(Y,{onClick:b,children:[e.jsx(q,{style:{minWidth:24},children:e.jsx(Qe,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.connect.switchToSpace")})]}),r&&e.jsxs(Y,{onClick:D,children:[e.jsx(q,{style:{minWidth:24},children:e.jsx(qt,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.connect.abortBlockletBackup")})]}),!r&&e.jsx(ve,{spaceGateway:t,onConfirm:async()=>{c(null),await(n==null?void 0:n(t))},onCancel:()=>c(null)})]})]})}ze.propTypes={spaceGateway:g.shape({name:g.string.isRequired,url:g.string.isRequired,protected:g.bool,endpoint:g.string.isRequired,loading:g.bool}).isRequired,selected:g.bool.isRequired,enableSwitchToSpace:g.bool,onDelete:g.func,onConnect:g.func,backupInProgress:g.bool};ze.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const go=te(({className:t,...s})=>e.jsx(ye,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o,onDeleted:a,onBackedUp:r}){const{t:i,locale:l}=E(),{blocklet:u}=A(),{api:c,info:{did:f}}=M(),{appDid:p,appName:x,appDescription:h,scopes:b,appUrl:D,referrer:S}=$e({blocklet:u}),{backupProgress:d,updateSpaceGateway:se,deleteSpaceGateway:ne,refreshBackupSummary:re,refreshBackups:ae}=P(),[U,L]=y.useState(!1),[I,v]=y.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:i("storage.spaces.authorize.title",{appName:x},l),scan:i("storage.spaces.authorize.scan",{appName:x},l),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:i("storage.spaces.authorize.success")})},onClose:()=>{v(k=>({...k,open:!1}))}}),ie=n&&!U&&s===fe.DISCONNECTED,ce=n&&!U&&!t.loading&&s===fe.CONNECTED,$=n&&U&&s===fe.CONNECTED&&(d==null?void 0:d.progress)>=0,Z=async()=>{try{if(await Ut(t==null?void 0:t.endpoint)){await c.configBlocklet({input:{did:[u.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(i("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o==null||o(null,t);return}}catch(k){console.error(k),o==null||o(k,t);return}v(k=>({...k,open:!0,prefix:ge(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ne.create({baseURL:ge(t.url,"space")}).get,extraParams:{appDid:p,appName:x,appDescription:h,scopes:b,appUrl:D,referrer:S,nodeDid:f,spaceDid:t.did}}))},le=async(k,K)=>{const m=K(k.endpoint),N=Se(m),w=k.space?K(k.space):{};if(t.did&&N!==t.did){v(pe=>({...pe,open:!1}));const F=i("storage.spaces.gateway.switch.failedForMismatchSpace",{name:w!=null&&w.name?w.name:""});B.error(F),o==null||o(new Error(F),t);return}const O={...t,name:w.name??"DID Space",did:w.did??Se(m),endpoint:m};await se(O),v(F=>({...F,open:!1})),o==null||o(null,O)},de=async()=>{try{if(U)return;L(!0),await c.backupBlocklet({input:{appDid:u.appDid,to:"spaces"}})}catch(k){console.error(k),B.error(k.message),r==null||r(k,t)}finally{L(!0)}},ue=async()=>{try{await ne(t),B.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),a==null||a(null,t)}catch(k){console.error(k),a==null||a(k,t)}};return y.useEffect(()=>{d!=null&&d.completed?(n&&((d==null?void 0:d.progress)===100?(B.success(i("storage.spaces.backupSuccessfully")),r==null||r(null,t)):d.message&&(r==null||r(new Error(d==null?void 0:d.message),t)),d.progress=0,d.message=""),L(!1),setTimeout(()=>{re(),ae()},1e3)):d.progress&&L(!0)},[d]),e.jsxs(e.Fragment,{children:[e.jsxs(j,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ce&&e.jsx(me,{className:"action-btn",variant:"outlined",size:"small",onClick:de,children:i("storage.spaces.strategy.backupNow")}),ie&&e.jsx(me,{className:"action-btn",variant:"outlined",size:"small",onClick:Z,children:i("storage.spaces.disconnected.reconnectNow")}),$&&e.jsx(go,{title:(d==null?void 0:d.message)&&e.jsx(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:d.message})}),children:e.jsxs(me,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(z,{variant:"determinate",value:d==null?void 0:d.progress,size:14,sx:{mr:1}}),d==null?void 0:d.progress,"%"]})}),e.jsx(jt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:le,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:l},"get-endpoint")]}),e.jsx(ze,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:ue,onConnect:Z,enableSwitchToSpace:(d==null?void 0:d.completed)||V(d==null?void 0:d.message),backupInProgress:$})]})}Ae.propTypes={spaceGateway:g.shape({did:g.string.isRequired,name:g.string.isRequired,url:g.string.isRequired,endpoint:g.string.isRequired,protected:g.bool,loading:g.bool}).isRequired,spaceStatus:g.string.isRequired,selected:g.bool.isRequired,onConnected:g.func,onDeleted:g.func,onBackedUp:g.func};Ae.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Xe({...t}){const{t:s}=E();return e.jsxs(j,{...t,children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")})}),e.jsx(De,{}),e.jsx(Te,{})]})}Xe.propTypes={};function Ze({...t}){const{t:s}=E(),{autoBackup:n,updateAutoBackup:o}=P(),a=async()=>{try{const r=!(n!=null&&n.enabled);await o({enabled:r}),B.success(s(r?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(r){B.error(r.message)}};return e.jsx(Qt,{checked:!!(n!=null&&n.enabled),onChange:a,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Ze.propTypes={};function xo(){const{t}=E(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=P(),a=n&&!(s!=null&&s.length),r=({spaceGateway:i,spaceStatus:l,selected:u,refresh:c})=>e.jsx(Ae,{spaceGateway:i,spaceStatus:l,selected:u,onConnected:()=>c(),onBackedUp:f=>f&&c()});return e.jsxs(j,{display:"flex",flexDirection:"column",children:[e.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),e.jsx(Ze,{}),e.jsx(oe,{})]}),e.jsx(j,{mt:2,children:a?e.jsx(j,{display:"flex",justifyContent:"center",children:e.jsx(z,{})}):e.jsx(Le,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(i=>e.jsx(Le,{item:!0,xs:12,md:6,children:e.jsx(Tt,{endpoint:i.endpoint,selected:o(i),action:r},i.endpoint)},i.endpoint))})})}),e.jsx(Xe,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ye,{})]})}function So(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=P();return t?e.jsx(We,{relative:"parent",children:e.jsx(z,{})}):V(s)?e.jsx(qe,{}):e.jsx(xo,{})}function yo(){return e.jsx(ke,{children:e.jsx(So,{})})}function jo(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:a,storageEndpoint:r}=It(),i=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return a?e.jsx(We,{relative:"parent",children:e.jsx(z,{})}):e.jsxs(j,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(Rt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(vt,{}),e.jsx(j,{sx:i,children:e.jsx(zt,{onConnect:n,storageEndpoint:r})})]})}function bo(){const{t}=E();return e.jsxs(Et,{children:[e.jsxs(W,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(jo,{})]})}function Je({navOrientation:t,...s}){const{t:n,locale:o}=E(),{blocklet:a}=A(),r=kt({key:"md"}),[i,l]=bt(),u=i.get("tab")||"backup",c=r?"horizontal":t,f=xe(()=>{var d;const D=[{label:n("common.backup"),value:"backup"}],S=(d=a==null?void 0:a.capabilities)==null?void 0:d.didSpace;return(S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&D.push({label:n("common.storage"),value:"storage"}),D},[o,c]),x=xe(()=>({backup:e.jsx(yo,{}),storage:e.jsx(bo,{})}))[u],h=D=>{l(S=>(D==="backup"?S.delete("tab"):S.set("tab",D),S))};if(f.length<=1)return e.jsx(he,{children:x});const b=e.jsx(Ct,{tabs:f,current:u,orientation:c,onChange:h,sx:[{borderRight:1,height:"100%",borderColor:"divider"},c==="horizontal"&&{borderRight:0}]});if(c==="vertical")return e.jsx(j,{...s,children:e.jsxs(W,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(j,{sx:{flexShrink:0},children:e.jsx(_e,{left:b})}),e.jsx(j,{sx:{flexGrow:1,minWidth:0},children:e.jsx(he,{sx:{mt:1},children:x})})]})});if(c==="horizontal")return e.jsxs(j,{...s,children:[e.jsx(_e,{left:b}),e.jsx(he,{sx:{mt:2},children:x})]})}Je.propTypes={navOrientation:g.oneOf(["vertical","horizontal"])};Je.defaultProps={navOrientation:"vertical"};const he=te(j)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cq as x,r as o,e as g,cr as r,z as u,j as s,K as m,cs as d}from"./index-
|
|
1
|
+
import{cq as x,r as o,e as g,cr as r,z as u,j as s,K as m,cs as d}from"./index-D6xNQO9D.js";function P(){const a=x(),{blocklets:c,refresh:l}=a,{t:y}=o.useContext(g),p=r.generateKey(),[i]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(p)??{},t=i.get("entityId"),e=i.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:y("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:a,filterType:"entity",type:"server"})]})}export{P as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bW as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bl as getDefaultExportFromCjs,n as newStyled,E as useMediaQuery,dx as Skeleton,cS as Img,$ as default_1$1,aB as Tooltip,ep as Button,k as Typography,C as CircularProgress,b8 as styled,al as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fF as ThemeProvider$1,fG as HeaderAddons,fH as Hidden,Y as Center,aP as requireCreateSvgIcon,aQ as interopRequireDefaultExports,fI as Check,d8 as commonjsGlobal,cF as Buffer,bh as React,fj as noop,bB as __vitePreload,dq as styled$1}from"./index-
|
|
1
|
+
import{bW as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bl as getDefaultExportFromCjs,n as newStyled,E as useMediaQuery,dx as Skeleton,cS as Img,$ as default_1$1,aB as Tooltip,ep as Button,k as Typography,C as CircularProgress,b8 as styled,al as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fF as ThemeProvider$1,fG as HeaderAddons,fH as Hidden,Y as Center,aP as requireCreateSvgIcon,aQ as interopRequireDefaultExports,fI as Check,d8 as commonjsGlobal,cF as Buffer,bh as React,fj as noop,bB as __vitePreload,dq as styled$1}from"./index-D6xNQO9D.js";import{j as joinUrl}from"./url-join-DNscpbOT.js";import{C as CloseIcon}from"./Close-aI0rARqu.js";const PriorityHigh=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh"),StepContext=reactExports.createContext(),{Provider}=StepContext,matchPath=(i,s,a=window.location.pathname.replace(/\/$/,"/"))=>i?s?i===a:new RegExp(i).test(a):!1;function StepProvider({children:i,steps:s,mode:a}){const[o,u]=reactExports.useState("");!o&&s.length&&u(s[0].key);const P=s.map(T=>T.children?[{key:T.key,hasChild:!0},T.children.map(O=>({parentKey:T.key,key:O.key}))]:{key:T.key}).flat(1/0),S=P.filter(T=>!T.hasChild),C=T=>{let O;const D=P.findIndex(H=>H.key===o?(O=H.parentKey,!0):!1);if(O===T)return"current";const L=P.findIndex(H=>H.key===T);if(L!==-1){if(L===D)return"current";if(L<D)return"before"}return"after"};function E(T){u(T)}function _(T){if(typeof T=="function"){const O=T(S.findIndex(D=>D.key===o));u(S[O].key)}else u(S[T].key)}const I=S.findIndex(T=>T.key===o);reactExports.useEffect(()=>{if(a==="history"){let T="";s.some(O=>O.children&&O.children.length?O.children.some(D=>matchPath(D.path,D.exact)?(T=D.key,!0):!1):matchPath(O.path,O.exact)?(T=O.key,!0):!1),T&&u(T)}return()=>{}},[s,a]);const j={steps:s,totalStepsCount:S.length,getStepStatus:C,setActiveStepByKey:E,setActiveStepByIndex:_,activeStep:I,canBackToStep:T=>a==="memory"&&I!==0&&T<I};return jsxRuntimeExports.jsx(Provider,{value:j,children:i})}function useStepContext(){return reactExports.useContext(StepContext)}StepProvider.propTypes={children:PropTypes.any.isRequired,steps:PropTypes.array.isRequired,mode:PropTypes.string};StepProvider.defaultProps={mode:"history"};var has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;function isEmpty(i){if(i==null)return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(i.toString==toString)switch(i.toString()){case"[object File]":case"[object Map]":case"[object Set]":return i.size===0;case"[object Object]":{for(var s in i)if(has.call(i,s))return!1;return!0}}return!1}var lib=isEmpty;const isEmpty$1=getDefaultExportFromCjs(lib),defaultBlockletLogo=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,translations={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},getTranslations=i=>translations[i]?translations[i]:translations.en,getLaunchingText=i=>i==="zh"?"启动":"Launching",getBlockletDisplayName=i=>(i==null?void 0:i.title)||(i==null?void 0:i.name)||"";function AppHeader({blockletMeta:i,subTitle:s,logoUrl:a,locale:o,navLogo:u,loading:P}){const S=useMediaQuery(j=>j.breakpoints.down("md")),C=S?18:48,E=reactExports.useRef(null),[_,I]=reactExports.useState("");return reactExports.useEffect(()=>{E.current&&E.current.offsetHeight>34&&(_===""?I("middle"):_==="middle"&&I("small"))},[_]),jsxRuntimeExports.jsxs(Container$2,{className:_==="small"?"center-mode":"",children:[S?jsxRuntimeExports.jsx("div",{className:"app-icon",children:u}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[P&&jsxRuntimeExports.jsx(AppIconSkeleton,{blockletSize:C,isMobile:S}),!P&&jsxRuntimeExports.jsx(AppIcon,{blockletSize:C,logoUrl:a})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[S&&s&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:s}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!S&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:s||getLaunchingText(o)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${_==="middle"||_==="small"?"middle-size":""}`,ref:E,children:jsxRuntimeExports.jsx(AppTitle,{logoUrl:a,isMobile:S,blockletMeta:i,blockletSize:C,loading:P})})]})]})]})}AppHeader.propTypes={blockletMeta:PropTypes.object,subTitle:PropTypes.any,logoUrl:PropTypes.string,locale:PropTypes.string,navLogo:PropTypes.any,loading:PropTypes.bool};AppHeader.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function AppIconSkeleton({blockletSize:i,isMobile:s}){return s?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:i,height:i})}function AppIcon({logoUrl:i,blockletSize:s}){return jsxRuntimeExports.jsx(Img,{width:s,height:s,src:i,alt:"blocklet icon",fallback:defaultBlockletLogo,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${i}`)}function AppTitle({isMobile:i,logoUrl:s,blockletMeta:a,blockletSize:o,loading:u}){const P=getBlockletDisplayName(a);return u?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):isEmpty$1(a)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):i?jsxRuntimeExports.jsxs(MobileTitleStyle,{children:[jsxRuntimeExports.jsx(AppIcon,{blockletSize:o,logoUrl:s}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:getBlockletDisplayName(a)})]}):jsxRuntimeExports.jsx(AppLink,{className:"app-link",target:"_blank",href:joinUrl((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:P,children:P})}const MobileTitleStyle=newStyled.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,cE as j,K as v,x as P,r as l,e as S,aA as w,u as k,w as E,al as b,aT as K,dr as U,cu as u,bc as W,v as _,Y as R,C as L,ds as T,dt as D}from"./index-
|
|
1
|
+
import{j as e,cE as j,K as v,x as P,r as l,e as S,aA as w,u as k,w as E,al as b,aT as K,dr as U,cu as u,bc as W,v as _,Y as R,C as L,ds as T,dt as D}from"./index-D6xNQO9D.js";import{R as d}from"./index-Bde_-0lD.js";function a({children:r,...s}){var o,c;return e.jsx(j,{...s,did:((o=window==null?void 0:window.blocklet)==null?void 0:o.appPid)||((c=window==null?void 0:window.env)==null?void 0:c.appPid),children:e.jsx(v,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function A(){const r=P(),{t:s,locale:o}=l.useContext(S),{api:c}=w(),{info:p}=k(),f=E(p),x=b(),n=K({ready:!1,success:!1,error:null,invalidSession:!1}),i=U(),h=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=T(g);if(!D(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};l.useLayoutEffect(()=>h(),[]);const m=u(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=u(()=>{n.success=!0});if(n.invalidSession)return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(W,{style:{color:x.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(a,{children:e.jsx(_,{className:"connect",action:"gen-key-pair",checkFn:c.get,checkTimeout:10*60*1e3,extraParams:{sourceAppPid:i==null?void 0:i.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:f,onSuccess:C,onError:m,locale:o,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(R,{children:e.jsx(L,{})})}export{A as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as H,r as i,u as W,a as E,b as P,j as e,P as y,L as O,d as Q,_ as Y,e as F,f as X,W as R,g as J,T as j,h as K,i as k,k as h,G as g,n as q,p as Z,C as ee,l as L}from"./index-
|
|
1
|
+
import{c as H,r as i,u as W,a as E,b as P,j as e,P as y,L as O,d as Q,_ as Y,e as F,f as X,W as R,g as J,T as j,h as K,i as k,k as h,G as g,n as q,p as Z,C as ee,l as L}from"./index-D6xNQO9D.js";import{f as ne}from"./index-BojVbZw0.js";import{I as T}from"./index-FAOrsHzs.js";import{M as V}from"./metric--mq9dzfr.js";import{C as D}from"./click-to-copy-CVJCV48Y.js";import{w as se}from"./withStyles-Cj7JqeJd.js";var te=H(function(t,d,r){return t+(r?" ":"")+d.toLowerCase()});const B=i.createContext({}),{Provider:ae,Consumer:ge}=B;function re({children:t}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,a]=i.useState(!1),[n,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||a(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});a(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(a(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),E(P.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),E(P.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(S=>S.did!==m))}),E(P.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:n,refresh:f};return e.jsx(ae,{value:{users:b},children:t})}function oe(){const{users:t}=i.useContext(B);return t}const v={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},ie=(t,d)=>{const[r,u]=i.useState(0),l=n=>n>=v.oneDay?v.oneDay:n>=v.oneHour?v.oneHour:n>=v.oneMin?v.oneMin:v.oneSecond,[c,a]=i.useState(l(t/1e3));return i.useEffect(()=>{const n=setInterval(()=>{u(r+c);const p=l(t/1e3+r+c);c!==p&&a(p)},c*1e3);return()=>clearInterval(n)},[c,r]),i.useEffect(()=>{u(0),a(l(t/1e3))},[t]),d(t+r*1e3)};y.number.isRequired,y.func;const le=async t=>{const d=await t.getNodeEnv();return Object.assign({},d.info||{})};se(t=>({root:{height:20},colorPrimary:{backgroundColor:t.palette.grey[t.palette.mode==="light"?200:700]},bar:{backgroundColor:"#1a90ff"}}))(O);y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function ce(){const{info:t,api:d,loading:r}=W(),{data:u,externalData:l}=Q(),{users:c}=oe(),a=Y(()=>le(d)),{t:n,locale:p}=i.useContext(F),_=X(),f=ie(+new Date-t.startAt,o=>{const m={compact:!0,verbose:!0,locale:L(p)};return Z(o,m)});let b=null;if(r)b=e.jsx(ee,{});else{const o=[{name:n("dashboard.nodeDid"),value:e.jsx(R,{did:t.did,showQrcode:!0})}];t.nodeOwner&&o.push({name:n("dashboard.ownerDid"),value:e.jsx(R,{did:t.nodeOwner.did,showQrcode:!0})});let m=[];t.launcher&&(m=[{name:n("common.did"),value:e.jsx(R,{did:t.launcher.did,showQrcode:!0})},{name:n("common.type"),value:t.launcher.type},{name:n("launcher.provider"),value:t.launcher.provider},{name:n("launcher.adminUrl"),value:e.jsx(J,{target:"_blank",href:t.launcher.url,underline:"hover",children:t.launcher.url})}]);const x=(s,w)=>!s&&!w?"-":s==="-"?s:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(D,{children:s})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(D,{children:s})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(D,{children:w})]})]}),S=()=>{const s=[{name:`${n("common.internalIp")}`,value:x(a.value.ip.internalV4,a.value.ip.internalV6)},{name:`${n("common.externalIp")}`,value:x(a.value.ip.externalV4,a.value.ip.externalV6)}];return a.value.docker?[]:s},U=a.value?[{name:`${n("common.version")}`,value:t.version},...S(),{name:`${n("common.os")}`,value:a.value.os},a.value.docker?{name:`${n("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,a.value.gitpod?{name:`${n("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(K(a,"value.blockletEngines",null))&&a.value.blockletEngines.filter(s=>s.visible&&s.available).forEach(s=>{U.push({name:s.displayName,value:e.jsx(j,{type:"success",children:`${s.version}`||"N/A"})})});const G=c.length,$=c.filter(s=>s.approved).length;let I=G;$&&(I+=`<small><strong>${te(n("common.approved"))} ${$}</strong></small>`);let N=0,C=0;u&&(N=u.length,C=u.filter(s=>s.status==="running").length),Array.isArray(l)&&(N+=l.length,C+=l.filter(s=>s.status==="running").length);let M=N;C&&(M+=`<small>${n("common.running")} ${C}</small>`);const z=[{name:n("common.blocklets"),value:M},{name:n("common.members"),value:I},{name:n("common.uptime"),value:f},{name:n("common.created"),value:ne(new Date(t.createdAt).getTime(),L(p))}];let A=[];a.value&&a.value.disk&&(A=[{name:n("common.blockletsStorage"),value:k(a.value.disk.blocklets||0).toUpperCase()},{name:n("common.dataStorage"),value:k(a.value.disk.data||0).toUpperCase()},{name:n("common.logStorage"),value:k(a.value.disk.log||0).toUpperCase()},{name:n("common.cacheStorage"),value:k(a.value.disk.cache||0).toUpperCase()},{name:n("common.coreStorage"),value:k(a.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:n("common.overview")}),e.jsx(g,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:z.map(s=>e.jsx(g,{item:!0,xl:2,lg:3,md:4,sm:6,xs:6,children:e.jsx(V,{...s})},s.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:n("common.storage")}),e.jsx(g,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:A.map(s=>e.jsx(g,{item:!0,xl:2,lg:3,md:4,sm:6,xs:6,children:e.jsx(V,{...s})},s.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:n("common.meta")}),e.jsxs(g,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(g,{item:!0,lg:6,md:12,sm:12,xs:12,children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:n("common.dAddress")}),o.map(s=>e.jsx(T,{nameWidth:150,name:s.name,children:s.value},s.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:n("common.launcher")}),m.map(s=>e.jsx(T,{nameWidth:150,name:s.name,children:s.value},s.name))]})]},"address"),e.jsxs(g,{item:!0,lg:6,md:12,sm:12,xs:12,children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:n("common.env")}),U.map(s=>e.jsx(T,{valueComponent:"div",nameWidth:150,name:s.name,children:s.value},s.name))]},"environment")]})]})]})}return e.jsx(me,{children:b})}const me=q.main`
|
|
2
2
|
.page-header {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|