@abtnode/blocklet-services 1.16.34-beta-20241213-135509-c2832f80 → 1.16.34-beta-20241214-102147-410be539
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +3 -6
- package/api/libs/connect/session.js +3 -0
- package/api/libs/jwt.js +17 -2
- package/api/middlewares/proxy-to-daemon.js +19 -12
- package/api/routes/env.js +1 -0
- package/api/services/auth/connect/invite.js +2 -0
- package/api/services/auth/connect/issue-passport.js +2 -0
- package/api/services/auth/connect/receive-transfer-app-owner.js +1 -0
- package/api/services/auth/connect/verify-destroy.js +112 -0
- package/api/services/auth/connect/verify-elevated.js +96 -0
- package/api/services/auth/index.js +4 -0
- package/api/util/attach-shared-utils.js +1 -1
- package/dist/assets/{Add-DcTdY6TL.js → Add-B3HyHVtM.js} +1 -1
- package/dist/assets/{Alert-D-e8-MAP.js → Alert-BZsa7bfc.js} +1 -1
- package/dist/assets/{ArrowDropDown-BvKbPg9O.js → ArrowDropDown-CWmGDz8N.js} +1 -1
- package/dist/assets/{Autocomplete-BX46bk2_.js → Autocomplete-B_v4MmH9.js} +1 -1
- package/dist/assets/{Avatar-BoZ94vwc.js → Avatar-HEUcnEtX.js} +1 -1
- package/dist/assets/{ButtonGroup-CtoWRVeN.js → ButtonGroup-PQ_PkB6m.js} +1 -1
- package/dist/assets/{CSSTransition-DhDaGYf6.js → CSSTransition-TDy8w3WY.js} +1 -1
- package/dist/assets/{CheckCircle-DuplVjH9.js → CheckCircle-DOCEgyT0.js} +1 -1
- package/dist/assets/{ChevronLeft-CRxnDPnp.js → ChevronLeft-SFcH5vl6.js} +1 -1
- package/dist/assets/{ChevronRight-6ehYjoIB.js → ChevronRight-Dvxy4T9U.js} +1 -1
- package/dist/assets/{Clear-BkApEw3Y.js → Clear-Ch-uEC-w.js} +1 -1
- package/dist/assets/{Delete-LBSof570.js → Delete-CcyPbNyf.js} +1 -1
- package/dist/assets/{DeleteOutline-DoKDfJgl.js → DeleteOutline-B9ZfxIRA.js} +1 -1
- package/dist/assets/{DialogContentText-B73EoFbn.js → DialogContentText-DCnpPqHv.js} +1 -1
- package/dist/assets/{DialogTitle-B7_qt6er.js → DialogTitle-CX4cvOk0.js} +1 -1
- package/dist/assets/{Done-BdhX20sl.js → Done-CfZqxitA.js} +1 -1
- package/dist/assets/{Download-cZILKd7o.js → Download-BFWJCBB8.js} +1 -1
- package/dist/assets/{EditIcon-D9kgkBKD.js → EditIcon-DNaLymXS.js} +1 -1
- package/dist/assets/{Error-ClsC7NrR.js → Error-BdnfHrUX.js} +1 -1
- package/dist/assets/{ExpandMore-DrecSXMe.js → ExpandMore-DA8Sn2_n.js} +1 -1
- package/dist/assets/{FormControl-Ve2KegjN.js → FormControl-CM7jdcik.js} +1 -1
- package/dist/assets/{FormControlLabel-C10RDNgA.js → FormControlLabel-Cipo0pK9.js} +1 -1
- package/dist/assets/{FormGroup-C2DrHvar.js → FormGroup-DmfCMPMS.js} +1 -1
- package/dist/assets/{Google-qzzGwT5f.js → Google-BJuaWa9v.js} +1 -1
- package/dist/assets/{Grid-DZk6Z8OE.js → Grid-CoWPn88b.js} +1 -1
- package/dist/assets/{HelpOutline-epGv8mXi.js → HelpOutline-BLqCylfM.js} +1 -1
- package/dist/assets/{Hidden-DPr9AEQp.js → Hidden-BwfHTnYp.js} +1 -1
- package/dist/assets/{InfoOutlined-B8LkdcP3.js → InfoOutlined-CGB23H0o.js} +1 -1
- package/dist/assets/{InputAdornment-gT40mObj.js → InputAdornment-l4hLGyx4.js} +1 -1
- package/dist/assets/{LastPage-DrjUl7Ym.js → LastPage-BHrK-cLk.js} +1 -1
- package/dist/assets/{Launch-CyTNEiOE.js → Launch-DEmczOPJ.js} +1 -1
- package/dist/assets/{LaunchOutlined-ByFC01OF.js → LaunchOutlined-CAHo3VOk.js} +1 -1
- package/dist/assets/{Link-51uCMh9H.js → Link-B6ysFdMX.js} +1 -1
- package/dist/assets/{ListItemButton-DtweULpb.js → ListItemButton-B1OWxnBV.js} +1 -1
- package/dist/assets/{ListSubheader-DfLnu3fa.js → ListSubheader-pUobARf7.js} +1 -1
- package/dist/assets/{LoadingButton-jLzgx1P7.js → LoadingButton-DG2r6d7f.js} +1 -1
- package/dist/assets/{LockIcon-De6Ad6SH.js → LockIcon-BRQqJ557.js} +1 -1
- package/dist/assets/{Loop-tTR2yrlz.js → Loop-Cuw7KT5w.js} +1 -1
- package/dist/assets/{MarkEmailRead-B6ZiEWoQ.js → MarkEmailRead-C--1q4xK.js} +1 -1
- package/dist/assets/{Menu-BeKA5iSq.js → Menu-CkQpad2d.js} +1 -1
- package/dist/assets/{MoreHoriz-B1JvEOcC.js → MoreHoriz-BKTzsCTZ.js} +1 -1
- package/dist/assets/{MoreVert-GvhXcnsL.js → MoreVert-10_PTroK.js} +1 -1
- package/dist/assets/{OpenInNew-C7tW6zIz.js → OpenInNew-Bq4wVVSa.js} +1 -1
- package/dist/assets/{OutlinedInput-Do_G2JiI.js → OutlinedInput-CEhVWPRi.js} +1 -1
- package/dist/assets/{Pagination-CkastftC.js → Pagination-BEqA_-kn.js} +1 -1
- package/dist/assets/{PlayArrow-DDe0KUdi.js → PlayArrow-BIVbzBbT.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-BbZ4QGV2.js → QuestionMarkCircle-U5AYINmw.js} +1 -1
- package/dist/assets/{RadioGroup-CTXZALsL.js → RadioGroup-CdcEvXbb.js} +1 -1
- package/dist/assets/{Search-BctSuhZ0.js → Search-BAkyJLzf.js} +1 -1
- package/dist/assets/{Select-DYnsfpKN.js → Select-BtQONHC5.js} +1 -1
- package/dist/assets/{ServerLogo-BLAQXKZ3.js → ServerLogo-DgH3ECXb.js} +1 -1
- package/dist/assets/{Skeleton-CVZKKwKZ.js → Skeleton-CGO11W5Q.js} +1 -1
- package/dist/assets/{Stack-Cc1e8uS3.js → Stack-COUrUgv1.js} +1 -1
- package/dist/assets/{Stepper-DsIq58ia.js → Stepper-mqXb5jVu.js} +1 -1
- package/dist/assets/{TextField-CO9VOqaC.js → TextField-uoLan4-D.js} +1 -1
- package/dist/assets/{Toolbar-D_Z1ZGgn.js → Toolbar-C5iQWYfr.js} +1 -1
- package/dist/assets/{ViewColumn-DQ20ttLn.js → ViewColumn-go0xuyyo.js} +1 -1
- package/dist/assets/{ViewList-Bnq-Bz9v.js → ViewList-BM5p31ao.js} +1 -1
- package/dist/assets/{_createAggregator-dQcfls_H.js → _createAggregator-BSUdgXdA.js} +1 -1
- package/dist/assets/{access-control-BXwHzkCA.js → access-control-D5pU0ds5.js} +1 -1
- package/dist/assets/{actions-D67DGwR5.js → actions-DVGs71CV.js} +1 -1
- package/dist/assets/{add-component-core-Bfu_zvLX.js → add-component-core-BduE5Qc5.js} +1 -1
- package/dist/assets/add-resource-DrKVNKDf.js +1 -0
- package/dist/assets/{addon-yHbJNe3B.js → addon-DO7ZVcZQ.js} +1 -1
- package/dist/assets/{analytics-DecQzqwH.js → analytics-BlFdI6AL.js} +1 -1
- package/dist/assets/api-D7TuGL10.js +1 -0
- package/dist/assets/ar-vUARlc-K.js +1 -0
- package/dist/assets/{audit-logs-Blyvfwui.js → audit-logs-Bap9qCVc.js} +1 -1
- package/dist/assets/{base32-DTb-J1h_.js → base32-Bix9mNu5.js} +1 -1
- package/dist/assets/{branding-Cr7lzDNp.js → branding-CFILog-5.js} +2 -2
- package/dist/assets/{bundle-avatar-TCiQIGsc.js → bundle-avatar-CY31_Buy.js} +1 -1
- package/dist/assets/{button-B2WmAAQP.js → button-BOPbs6R8.js} +1 -1
- package/dist/assets/{click-to-copy-C-hq6Slv.js → click-to-copy-B-IagKFx.js} +1 -1
- package/dist/assets/{complete-CFh6Nef4.js → complete-Cfrn5deV.js} +1 -1
- package/dist/assets/{component-G-UDGzGu.js → component-DU2DN-Ae.js} +1 -1
- package/dist/assets/{config-R9luUUXo.js → config-NA3UDutD.js} +1 -1
- package/dist/assets/{config-CdE9iwiR.js → config-U-e-_0Po.js} +1 -1
- package/dist/assets/{config-navigation-DAx0e99X.js → config-navigation-DWYUEAmI.js} +3 -3
- package/dist/assets/{config-space-DGTpbWBc.js → config-space-D-wNk3O8.js} +1 -1
- package/dist/assets/{confirm-BC8TTdT0.js → confirm-DoFYzLCD.js} +1 -1
- package/dist/assets/{connect-Ca4Z5ZCG.js → connect-BPP1EQ9m.js} +1 -1
- package/dist/assets/{connect-DYbGPYA1.js → connect-COnC7LGD.js} +1 -1
- package/dist/assets/{connect-to-CK3sPRsk.js → connect-to-CRjtxtZD.js} +1 -1
- package/dist/assets/{content-layout-DPhqwbjU.js → content-layout-C6ss1seH.js} +1 -1
- package/dist/assets/{dashboard-DqNsUCmU.js → dashboard-B29PgJdK.js} +3 -3
- package/dist/assets/de-DBLZOTm4.js +1 -0
- package/dist/assets/{deprecate-BzwAgeY6.js → deprecate-Bfb8FxlF.js} +1 -1
- package/dist/assets/{did-address-_iA2JBVL.js → did-address-W2D5q_Ko.js} +1 -1
- package/dist/assets/{domain-CdS6WH7r.js → domain-8A-Bb5Vf.js} +1 -1
- package/dist/assets/{domain-list-DgnHKWqf.js → domain-list-BlN3UnU5.js} +1 -1
- package/dist/assets/{email-pILbo7GY.js → email-D0cGXehh.js} +3 -3
- package/dist/assets/emotion-cache.browser.esm-BJd0i6wh.js +1 -0
- package/dist/assets/es-Bi-IB68O.js +1 -0
- package/dist/assets/{exchange-passport-Bz0OFLm3.js → exchange-passport-Cs6bUD__.js} +1 -1
- package/dist/assets/{fallback-DNotPO94.js → fallback-bURgS5BO.js} +1 -1
- package/dist/assets/{form-text-input-BMDOwfx4.js → form-text-input-BnwSHGUa.js} +1 -1
- package/dist/assets/{format-error-DwZSxaHw.js → format-error-qE4eWtuQ.js} +1 -1
- package/dist/assets/fr-DXAbgUPh.js +1 -0
- package/dist/assets/{fuel-BLdY2pe6.js → fuel-DYICJXZO.js} +1 -1
- package/dist/assets/{fullpage-DizVq3Q0.js → fullpage-DW3LgEki.js} +1 -1
- package/dist/assets/{get-safe-url-BFPkD_-w.js → get-safe-url-Dhzrk6uX.js} +1 -1
- package/dist/assets/{get-safe-url-DZ-z9Y11.js → get-safe-url-S1qu_6Pw.js} +1 -1
- package/dist/assets/hi-Dz19or1H.js +1 -0
- package/dist/assets/{home-Tu1r9UUP.js → home-BGgkEeoN.js} +1 -1
- package/dist/assets/id-BadnMPq_.js +1 -0
- package/dist/assets/{iframe-CaVEoPzZ.js → iframe-B0Y5VZT4.js} +1 -1
- package/dist/assets/{index-CjBMqGWM.js → index-B-MTGmhc.js} +1 -1
- package/dist/assets/{index-BH89MPC8.js → index-B0-yJewg.js} +1 -1
- package/dist/assets/{index-DheUDLUu.js → index-BB9Y-7kV.js} +1 -1
- package/dist/assets/{index-DDG6nzV-.js → index-BHshGDF7.js} +1 -1
- package/dist/assets/index-BIkp0K96.js +1 -0
- package/dist/assets/{index-CNW7JpLY.js → index-BO68mfyE.js} +1 -1
- package/dist/assets/{index-DUDLGVrz.js → index-BbrXjipI.js} +3 -3
- package/dist/assets/{index-DblJTJQz.js → index-Bc-_Zi-W.js} +1 -1
- package/dist/assets/{index-BXvoL3Iu.js → index-BcaoZxjZ.js} +1 -1
- package/dist/assets/{index-Cyq88B7c.js → index-C895TQLf.js} +1 -1
- package/dist/assets/{index-BWn04_iI.js → index-CC_Na8qQ.js} +1 -1
- package/dist/assets/{index-DWDFxHgN.js → index-CFEPx64F.js} +1 -1
- package/dist/assets/{index-CzXHRu12.js → index-CoHkYVDV.js} +1 -1
- package/dist/assets/{index-BOpUgQ8H.js → index-Cou7Kk3U.js} +1 -1
- package/dist/assets/{index-BEJPw-Yp.js → index-Cr-DtddY.js} +4 -4
- package/dist/assets/{index-D3U2QoHe.js → index-CsT7LyYB.js} +1 -1
- package/dist/assets/{index-BuFsUoby.js → index-D6cqf8kl.js} +1 -1
- package/dist/assets/{index-BM80ek7x.js → index-D9YGgNqL.js} +16 -16
- package/dist/assets/{index-BjsbrYRH.js → index-DEbd0oB1.js} +1 -1
- package/dist/assets/{index-dEKXkm4C.js → index-DFFp-KRY.js} +20 -20
- package/dist/assets/{index-4W47mya0.js → index-DHZKtNfH.js} +1 -1
- package/dist/assets/{index-DPiBRCz4.js → index-DIA_1V2x.js} +1 -1
- package/dist/assets/{index-DLfBZi9C.js → index-DOeAD_2U.js} +1 -1
- package/dist/assets/{index-YElVd5eM.js → index-DZyED7ak.js} +1 -1
- package/dist/assets/{index-Bn2ctnS8.js → index-DnPEQyT1.js} +1 -1
- package/dist/assets/{index-CWzdBGm2.js → index-Dw86ejmG.js} +1 -1
- package/dist/assets/{index-pMGk7BEW.js → index-FARJ4CmG.js} +1 -1
- package/dist/assets/{index-lJoTfApr.js → index-JdqBLsAB.js} +3 -3
- package/dist/assets/{index-DEG_Pe1F.js → index-PVmgaFUO.js} +1 -1
- package/dist/assets/{index-BcBVFEsU.js → index-Tj_mFIuY.js} +1 -1
- package/dist/assets/{index-B3taNgzi.js → index-WfneHrey.js} +1 -1
- package/dist/assets/{index-Bj8u1Jq1.js → index-lNA9IIbJ.js} +49 -49
- package/dist/assets/{index-d-mPwPwc.js → index-xBWtFaIB.js} +1 -1
- package/dist/assets/{invitation-BFbVuQFx.js → invitation-Ck3CoF-t.js} +1 -1
- package/dist/assets/{invite-Bron7GEw.js → invite-7JOTBO2A.js} +1 -1
- package/dist/assets/{isEmail-5f9jXFqI.js → isEmail-D7Asw66k.js} +1 -1
- package/dist/assets/{issue-passport-BMTa-EpO.js → issue-passport-ChsyPFyk.js} +1 -1
- package/dist/assets/{item-BYnIVyyp.js → item-BdtfgvBs.js} +1 -1
- package/dist/assets/ja-CkktdjqD.js +1 -0
- package/dist/assets/{jss-plugin-props-sort.esm-CxRI79tr.js → jss-plugin-props-sort.esm-CF1jS-lO.js} +1 -1
- package/dist/assets/ko-BRLl3b0u.js +1 -0
- package/dist/assets/{launch-result-message-DXzliFie.js → launch-result-message-CwmmWOMW.js} +1 -1
- package/dist/assets/{layout-CAsilLGB.js → layout-Bd6DoZoy.js} +1 -1
- package/dist/assets/{list-header-YJQAbm9g.js → list-header-9IJv-iSy.js} +1 -1
- package/dist/assets/localization-oV3Kd_0i.js +1 -0
- package/dist/assets/{log-Bdo9FkyE.js → log-DaESFbKs.js} +1 -1
- package/dist/assets/{login-D8bQWYck.js → login-Dtc3ECZp.js} +1 -1
- package/dist/assets/{login-oauth-callback-DQ0fJI0M.js → login-oauth-callback-BJeHAJ7q.js} +1 -1
- package/dist/assets/{logo-uploader-cFGQ2Gvc.js → logo-uploader-BEVNghGE.js} +3 -3
- package/dist/assets/{lost-passport-Cut0hEBf.js → lost-passport-DwGf8Vlp.js} +3 -3
- package/dist/assets/{lottie-react.esm-BMrLVwC-.js → lottie-react.esm-HgyZYlNO.js} +1 -1
- package/dist/assets/{notifications-OcsJQIbe.js → notifications-VFqCsgh4.js} +1 -1
- package/dist/assets/{open-window-D7sglcpE.js → open-window-BBejx2wW.js} +1 -1
- package/dist/assets/{overview-DYkC_WUD.js → overview-Cons5CpM.js} +1 -1
- package/dist/assets/{page-header-Bs0D4BNJ.js → page-header-BdOgOkhG.js} +1 -1
- package/dist/assets/{permission-BXmIoXZx.js → permission-CJORGapO.js} +1 -1
- package/dist/assets/{preferences-C4gMbsXE.js → preferences-CRGFiW-F.js} +1 -1
- package/dist/assets/pt-CVEpS0WJ.js +1 -0
- package/dist/assets/publish-resource-BPdKmDbw.js +1 -0
- package/dist/assets/{raf-schd.esm-4I_ky4wN.js → raf-schd.esm-DO2B_266.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-0qjksHeu.js → react-beautiful-dnd.esm-B0qpoL0v.js} +1 -1
- package/dist/assets/refType-Cwb4Ewjt.js +1 -0
- package/dist/assets/{resource-dialog-D7wZSQZM.js → resource-dialog-CurFbneU.js} +1 -1
- package/dist/assets/ru-Kbn-Tcut.js +1 -0
- package/dist/assets/sdk-BogUA5D6.js +1 -0
- package/dist/assets/{selector-CbAq7CNk.js → selector-Du8tTgLg.js} +1 -1
- package/dist/assets/session-DWy9sT95.js +1 -0
- package/dist/assets/{setup-CfBWQVLM.js → setup-B69qnB1H.js} +3 -3
- package/dist/assets/{shorten-label-DwdHohLo.js → shorten-label-Ba3qRY3O.js} +1 -1
- package/dist/assets/{simple-select-DABb5zZb.js → simple-select-NSslFRey.js} +1 -1
- package/dist/assets/{slicedToArray-oTB17pto.js → slicedToArray-DnG70Erc.js} +1 -1
- package/dist/assets/{start-6oXQjfyP.js → start-DT8p2NnP.js} +1 -1
- package/dist/assets/{step-actions-6E9sNomZ.js → step-actions-CgCj26Nh.js} +1 -1
- package/dist/assets/{studio-rQhXFpEr.js → studio-gA9FVtOC.js} +1 -1
- package/dist/assets/{switch-control-BEdKOp6L.js → switch-control-BN9OkP3V.js} +1 -1
- package/dist/assets/th-TeCEZBAH.js +1 -0
- package/dist/assets/{toUpper-DUJEYm58.js → toUpper-D-4kyCa2.js} +1 -1
- package/dist/assets/{transfer-I7cX7406.js → transfer-C3U-vABy.js} +1 -1
- package/dist/assets/{trim-Dlp2Wnor.js → trim-CRA-BoWh.js} +1 -1
- package/dist/assets/{uniqBy-BSt4eeqO.js → uniqBy-CwChXxd0.js} +1 -1
- package/dist/assets/{unsubscribe-HqTE-lAn.js → unsubscribe-DWlDXPkd.js} +1 -1
- package/dist/assets/{url-join-D5NytcuV.js → url-join-D30P1Ce3.js} +1 -1
- package/dist/assets/{use-mobile-kPLzB4n2.js → use-mobile-BD_FZ6Ra.js} +1 -1
- package/dist/assets/{use-mobile-CPfu5RWb.js → use-mobile-BhHTlekD.js} +1 -1
- package/dist/assets/{useAsync-BYLVsyCe.js → useAsync-nyVjdCwh.js} +1 -1
- package/dist/assets/{useFormControl-Cb-boaYc.js → useFormControl-ByXcqYyU.js} +1 -1
- package/dist/assets/{useLocalStorage-DwpjAyRq.js → useLocalStorage-BcwZPfXB.js} +1 -1
- package/dist/assets/{useSetState-BZm8P2F-.js → useSetState-S0BEkJD4.js} +1 -1
- package/dist/assets/{useSlot-2GhS7jdI.js → useSlot-DcqlBn33.js} +1 -1
- package/dist/assets/{useSlotProps-Dxo3NBwX.js → useSlotProps-D-blxf7S.js} +1 -1
- package/dist/assets/{useThemeProps-CK1ghsXu.js → useThemeProps-DJJBFim4.js} +1 -1
- package/dist/assets/{user-center-De5_2TQv.js → user-center-DPbvIPzU.js} +1 -1
- package/dist/assets/{user-sessions-BIa10Xhc.js → user-sessions-B2B9euhY.js} +1 -1
- package/dist/assets/{util-CJcl9xCr.js → util-DWRxZQGf.js} +1 -1
- package/dist/assets/vi-DJT1ejL2.js +1 -0
- package/dist/assets/wrap-locale-I1B3o83L.js +1 -0
- package/dist/assets/zh-DAHbwHB9.js +2 -0
- package/dist/assets/zh-tw-BTKhoiaD.js +1 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +19 -19
- package/dist/assets/add-resource-Bopi2F5-.js +0 -1
- package/dist/assets/api-DH8IdxXg.js +0 -1
- package/dist/assets/ar-B3QGVHSJ.js +0 -1
- package/dist/assets/de-CuczgAA8.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-FU3nBxaV.js +0 -1
- package/dist/assets/es-D938HYco.js +0 -1
- package/dist/assets/fr-BUgkJkru.js +0 -1
- package/dist/assets/hi-CLGvJ0VO.js +0 -1
- package/dist/assets/id-CoJHfLJv.js +0 -1
- package/dist/assets/index-D7t6icMl.js +0 -1
- package/dist/assets/ja-BfQ6NQ1Q.js +0 -1
- package/dist/assets/ko-OirMS2DQ.js +0 -1
- package/dist/assets/localization-CoaLMiV4.js +0 -1
- package/dist/assets/pt-DFNHF52P.js +0 -1
- package/dist/assets/publish-resource-D-e2YEIQ.js +0 -1
- package/dist/assets/refType-B6FV0kei.js +0 -1
- package/dist/assets/ru-D1ipkx7j.js +0 -1
- package/dist/assets/sdk-DbJuRsBZ.js +0 -1
- package/dist/assets/session-uB27dTXO.js +0 -1
- package/dist/assets/th-Bq0BOWuO.js +0 -1
- package/dist/assets/vi-w34NOSIe.js +0 -1
- package/dist/assets/wrap-locale-CZRJioV-.js +0 -1
- package/dist/assets/zh-C8AwRuvb.js +0 -2
- package/dist/assets/zh-tw-BvZpzT6d.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{az as w4,j as n,aM as d1,cX as Ce,aQ as $,fG as S3,aP as w1,aK as G1,aL as X1,T as z,r as V,aO as A2,aR as V4,aS as Q1,aT as J1,d2 as y4,fH as g2,a2 as V1,a3 as y1,a5 as Y1,B as m,P as h,L as X,e as U2,u as n1,aV as H1,b1 as N1,bC as m2,a7 as C2,Q as x1,bM as pe,a as L1,aI as a1,V as H4,v as F,a4 as p1,bN as R4,ag as I1,c as g1,M as k4,bY as q2,cn as fe,cS as S4,c$ as z1,d0 as he,ap as M4,dc as I4,cW as r2,bG as C1,c8 as l2,ft as P4,ae as M3,fI as Z4,b as i1,n as p2,br as xe,en as ge,ao as z2,bs as me,cG as be,aZ as A1,aY as D4,c4 as Le,c6 as T4,c7 as _4,a9 as je,fJ as I3,fh as T1,bp as N4,aA as ve,l as B4,aH as E4,aw as O4,ax as y2}from"./index-dEKXkm4C.js";import{d as W2}from"./Add-DcTdY6TL.js";import{d as we,a as $4}from"./Delete-LBSof570.js";import{d as F4}from"./Error-ClsC7NrR.js";import{D as K2}from"./index-CNW7JpLY.js";import{T as Ve,b as A4}from"./index-DPiBRCz4.js";import{C as G2}from"./confirm-BC8TTdT0.js";import{u as b2}from"./session-uB27dTXO.js";import{W as P3}from"./did-address-_iA2JBVL.js";import{E as e2,D as Z3,C as D3,P as T3}from"./react-beautiful-dnd.esm-0qjksHeu.js";import{B as X2}from"./bundle-avatar-TCiQIGsc.js";import{S as j1}from"./shorten-label-DwdHohLo.js";import{A as ye}from"./Avatar-BoZ94vwc.js";import{d as U4}from"./Download-cZILKd7o.js";import{d as q4}from"./QuestionMarkCircle-BbZ4QGV2.js";import{b as z4,c as _3,T as W4}from"./index-YElVd5eM.js";import{_ as D1}from"./useSetState-BZm8P2F-.js";import{c as Q2}from"./index-D3U2QoHe.js";import{C as i2,L as K4}from"./MoreVert-GvhXcnsL.js";import{A as He}from"./Alert-D-e8-MAP.js";import{p as f2}from"./index-CWzdBGm2.js";import"./api-DH8IdxXg.js";import{i as G4}from"./index-CzXHRu12.js";import{d as X4}from"./ExpandMore-DrecSXMe.js";import{d as Q4}from"./ChevronRight-6ehYjoIB.js";import{d as J4}from"./OpenInNew-C7tW6zIz.js";import{u as Re}from"./useThemeProps-CK1ghsXu.js";import{F as I2}from"./FormControlLabel-C10RDNgA.js";import{u as Y4}from"./useSlotProps-Dxo3NBwX.js";import{d as N3}from"./DeleteOutline-DoKDfJgl.js";import{c as e5,A as ke,u as t5,S as o5,U as n5}from"./item-BYnIVyyp.js";import{d as r5}from"./ArrowDropDown-BvKbPg9O.js";import{f as _1}from"./format-error-DwZSxaHw.js";import{B as P2}from"./ButtonGroup-CtoWRVeN.js";import{d as s5}from"./Clear-BkApEw3Y.js";import{D as l5}from"./DialogTitle-B7_qt6er.js";import{O as i5}from"./OutlinedInput-Do_G2JiI.js";import{I as L2}from"./InputAdornment-gT40mObj.js";import{T as h1}from"./TextField-CO9VOqaC.js";import{S as M1}from"./Stack-Cc1e8uS3.js";import{C as c5}from"./click-to-copy-C-hq6Slv.js";import{d as a5}from"./Launch-CyTNEiOE.js";import{S as B3}from"./index-DEG_Pe1F.js";import{M as d5}from"./index-DLfBZi9C.js";import{p as u5}from"./purify.es-DutPtr9A.js";import{r as C5}from"./index-BH89MPC8.js";import{d as p5}from"./Done-BdhX20sl.js";import{c as Se,d as Me,b as f5,S as h5,a as x5}from"./Stepper-DsIq58ia.js";import{R as g5,a as E3}from"./RadioGroup-CTXZALsL.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-FU3nBxaV.js";import"./ViewColumn-DQ20ttLn.js";import"./FormControl-Ve2KegjN.js";import"./utils-iop7lDec.js";import"./useFormControl-Cb-boaYc.js";import"./FormGroup-C2DrHvar.js";import"./Grid-DZk6Z8OE.js";import"./Select-DYnsfpKN.js";import"./LastPage-DrjUl7Ym.js";import"./Toolbar-D_Z1ZGgn.js";import"./Search-BctSuhZ0.js";import"./index-Cyq88B7c.js";import"./DialogContentText-B73EoFbn.js";import"./Link-51uCMh9H.js";import"./raf-schd.esm-4I_ky4wN.js";import"./useSlot-2GhS7jdI.js";import"./get-safe-url-BFPkD_-w.js";import"./jss-plugin-props-sort.esm-CxRI79tr.js";const m5=w4(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),b5=["slots","slotProps"],L5=d1(Ce)(({theme:e})=>$({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":$({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":$({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:S3(e.palette.grey[200],.12)}:{backgroundColor:S3(e.palette.grey[600],.12)})})),j5=d1(m5)({width:24,height:16});function v5(e){const{slots:t={},slotProps:o={}}=e,r=w1(e,b5),s=e;return n.jsx("li",{children:n.jsx(L5,$({focusRipple:!0},r,{ownerState:s,children:n.jsx(j5,$({as:t.CollapsedIcon,ownerState:s},o.collapsedIcon))}))})}function w5(e){return X1("MuiBreadcrumbs",e)}const V5=G1("MuiBreadcrumbs",["root","ol","li","separator"]),y5=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],H5=e=>{const{classes:t}=e;return J1({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},w5,t)},R5=d1(z,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${V5.li}`]:t.li},t.root]})({}),k5=d1("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),S5=d1("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function M5(e,t,o,r){return e.reduce((s,i,c)=>(c<e.length-1?s=s.concat(i,n.jsx(S5,{"aria-hidden":!0,className:t,ownerState:r,children:o},`separator-${c}`)):s.push(i),s),[])}const Ie=V.forwardRef(function(t,o){const r=A2({props:t,name:"MuiBreadcrumbs"}),{children:s,className:i,component:c="nav",slots:a={},slotProps:d={},expandText:C="Show path",itemsAfterCollapse:f=1,itemsBeforeCollapse:x=1,maxItems:b=8,separator:u="/"}=r,p=w1(r,y5),[g,y]=V.useState(!1),j=$({},r,{component:c,expanded:g,expandText:C,itemsAfterCollapse:f,itemsBeforeCollapse:x,maxItems:b,separator:u}),L=H5(j),R=V4({elementType:a.CollapsedIcon,externalSlotProps:d.collapsedIcon,ownerState:j}),M=V.useRef(null),k=I=>{const D=()=>{y(!0);const T=M.current.querySelector("a[href],button,[tabindex]");T&&T.focus()};return x+f>=I.length?I:[...I.slice(0,x),n.jsx(v5,{"aria-label":C,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:D},"ellipsis"),...I.slice(I.length-f,I.length)]},H=V.Children.toArray(s).filter(I=>V.isValidElement(I)).map((I,D)=>n.jsx("li",{className:L.li,children:I},`child-${D}`));return n.jsx(R5,$({ref:o,component:c,color:"text.secondary",className:Q1(L.root,i),ownerState:j},p,{children:n.jsx(k5,{className:L.ol,ref:M,ownerState:j,children:M5(g||b&&H.length<=b?H:k(H),L.separator,u,j)})}))});function I5(e){return X1("MuiStepButton",e)}const O3=G1("MuiStepButton",["root","horizontal","vertical","touchRipple"]),P5=["children","className","icon","optional"],Z5=e=>{const{classes:t,orientation:o}=e;return J1({root:["root",o],touchRipple:["touchRipple"]},I5,t)},D5=d1(Ce,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${O3.touchRipple}`]:t.touchRipple},t.root,t[o.orientation]]}})(({ownerState:e})=>$({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${O3.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),T5=V.forwardRef(function(t,o){const r=A2({props:t,name:"MuiStepButton"}),{children:s,className:i,icon:c,optional:a}=r,d=w1(r,P5),{disabled:C,active:f}=V.useContext(Se),{orientation:x}=V.useContext(Me),b=$({},r,{orientation:x}),u=Z5(b),p={icon:c,optional:a},g=y4(s,["StepLabel"])?V.cloneElement(s,p):n.jsx(f5,$({},p,{children:s}));return n.jsx(D5,$({focusRipple:!0,disabled:C,TouchRippleProps:{className:u.touchRipple},className:Q1(u.root,i),ref:o,ownerState:b,"aria-current":f?"step":void 0},d,{children:g}))});function _5(e){return X1("MuiStepContent",e)}G1("MuiStepContent",["root","last","transition"]);const N5=["children","className","TransitionComponent","transitionDuration","TransitionProps"],B5=e=>{const{classes:t,last:o}=e;return J1({root:["root",o&&"last"],transition:["transition"]},_5,t)},E5=d1("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.last&&t.last]}})(({ownerState:e,theme:t})=>$({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),O5=d1(g2,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),$5=V.forwardRef(function(t,o){const r=A2({props:t,name:"MuiStepContent"}),{children:s,className:i,TransitionComponent:c=g2,transitionDuration:a="auto",TransitionProps:d}=r,C=w1(r,N5);V.useContext(Me);const{active:f,last:x,expanded:b}=V.useContext(Se),u=$({},r,{last:x}),p=B5(u);let g=a;return a==="auto"&&!c.muiSupportAuto&&(g=void 0),n.jsx(E5,$({className:Q1(p.root,i),ref:o,ownerState:u},C,{children:n.jsx(O5,$({as:c,in:f||b,className:p.transition,ownerState:u,timeout:g,unmountOnExit:!0},d,{children:s}))}))});var J2={},F5=y1;Object.defineProperty(J2,"__esModule",{value:!0});var Pe=J2.default=void 0,A5=F5(V1()),U5=n;Pe=J2.default=(0,A5.default)((0,U5.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Y2={},q5=y1;Object.defineProperty(Y2,"__esModule",{value:!0});var Ze=Y2.default=void 0,z5=q5(V1()),W5=n;Ze=Y2.default=(0,z5.default)((0,W5.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var e3={},K5=y1;Object.defineProperty(e3,"__esModule",{value:!0});var De=e3.default=void 0,G5=K5(V1()),X5=n;De=e3.default=(0,G5.default)((0,X5.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.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 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function t3({did:e,projectId:t,title:o,logo:r,describe:s}){const c=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${r}`,[a,d]=V.useState(!1),C=Y1(f=>f.breakpoints.down("md"));return n.jsxs(m,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[n.jsx(ye,{sx:{borderRadius:1},src:c}),n.jsxs(m,{children:[n.jsx(j1,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:C?"primary.main":""},children:o||"/"}),n.jsx(j1,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:C||a?"primary.main":"grey.700"},children:s||"/"})]})]})}t3.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function o3({initUrl:e}){const t=U2(),o=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:s}=n1(),{api:i}=H1(),{api:c}=b2(),[a,d]=V.useState(!0),{blocklet:C}=N1(),[f,x]=V.useState(null),[b,u]=V.useState(!1),p=Y1(P=>P.breakpoints.down("xl")),{componentDid:g=""}=m2(),[y,j]=V.useState(null),L=()=>{i.getProjects({input:{did:C.meta.did,componentDid:g,tenantScope:o}}).then(P=>{const _=(P==null?void 0:P.projects)||[];d(!1),j(_)}).catch(P=>{d(!1),F.error(P.message)})},R=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},M=P=>{x(P)},k=()=>{d(!1),u(!0)},H=()=>{u(!1),x(null)},I=P=>{F.error(P.message),u(!1),x(null)},D=P=>{if(!(P!=null&&P.deleted)){F.error("Delete project failed");return}L(),u(!1),x(null)};if(V.useEffect(()=>{L()},[]),!y&&a)return n.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:n.jsx(e2,{})});if(!y)return null;if(!y.length)return n.jsxs(m,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[n.jsx(m,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),n.jsx(m,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),n.jsx(C2,{onClick:R,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const T=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:P=>{const _=y[P];return n.jsx(x1,{to:`${_.id}`,children:n.jsx(t3,{did:C.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:P=>P?n.jsx(Ve,{type:"success",children:P}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:P=>P?n.jsx(P3,{size:14,compact:!0,responsive:!1,did:P}):null}},p||g?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:P=>P?n.jsx(P3,{onClick:()=>{t(`/.well-known/service/admin/members?did=${P}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:P}):null}},p||g?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:P=>{const _=(C.children||[]).find(U=>U.meta.did===P);return _?n.jsxs(m,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[n.jsx(X2,{size:14,blocklet:_,ancestors:[C]}),n.jsx(m,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},P):""}}},p||o?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:P=>n.jsx(m,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:n.jsx(j1,{children:P})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{customBodyRender:P=>n.jsx(pe,{value:Number(P),locale:s})}},{label:r("common.actions"),name:"actions",options:{customBodyRenderLite:P=>{const _=y[P];return n.jsxs(m,{display:"flex",children:[n.jsx(x1,{to:`${_.id}/new-release/${_.lastReleaseId}`,children:n.jsx(L1,{title:r("blocklet.publish.createRelease"),placement:"top",children:n.jsx(a1,{color:"primary","aria-label":"create",children:n.jsx(Pe,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&n.jsx(L1,{title:r("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:n.jsx(a1,{color:"secondary","aria-label":"create",children:n.jsx(x1,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}`,children:n.jsx(Ze,{sx:{fontSize:18}})})})}),n.jsx(L1,{title:r("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:n.jsx(a1,{color:"primary","aria-label":"delete",onClick:()=>M(_),children:n.jsx(we,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),S=b?n.jsx(H4,{open:!0,popup:!0,onClose:H,action:"check-has-project-id",locale:s,checkFn:c.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:D,onError:I,extraParams:{projectId:f.id,did:C.meta.did,name:f.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:f.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:f.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return n.jsxs(Q5,{children:[n.jsxs(m,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsxs(m,{display:"flex",flexDirection:"row",alignItems:"center",children:[n.jsx(m,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),n.jsx(L1,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:n.jsx(De,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),n.jsxs(C2,{onClick:R,variant:"contained",children:[n.jsx(W2,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),n.jsx(m,{mt:3}),n.jsx(K2,{className:"main-table",locale:s,data:y,columns:T,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),f&&n.jsx(G2,{title:`${r("common.delete")} ${f.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:k,onCancel:()=>x(null),children:n.jsx(m,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(P=>n.jsxs(m,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[n.jsx(F4,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),n.jsx(z,{component:"span",variant:"inherit",color:"text.secondary",children:P})]}))})}),S]})}o3.propTypes={initUrl:h.object};o3.defaultProps={initUrl:null};const Q5=p1(m)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-JdqBLsAB.js","assets/index-DFFp-KRY.js","assets/index-B4oT57Ax.css","assets/url-join-D30P1Ce3.js","assets/index-WfneHrey.js","assets/_createAggregator-BSUdgXdA.js","assets/index-Tj_mFIuY.js","assets/index-CsT7LyYB.js","assets/resource-dialog-CurFbneU.js","assets/fallback-bURgS5BO.js","assets/index-Cou7Kk3U.js","assets/Menu-CkQpad2d.js","assets/Toolbar-C5iQWYfr.js","assets/Hidden-BwfHTnYp.js","assets/index-xBWtFaIB.js","assets/MoreVert-10_PTroK.js","assets/FormControlLabel-Cipo0pK9.js","assets/useFormControl-ByXcqYyU.js","assets/Stack-COUrUgv1.js","assets/ListItemButton-B1OWxnBV.js","assets/selector-Du8tTgLg.js","assets/ExpandMore-DA8Sn2_n.js","assets/Avatar-HEUcnEtX.js","assets/useSlot-DcqlBn33.js","assets/index-Bc-_Zi-W.js","assets/OpenInNew-Bq4wVVSa.js","assets/index-CoHkYVDV.js","assets/Link-B6ysFdMX.js","assets/Skeleton-CGO11W5Q.js","assets/HelpOutline-BLqCylfM.js","assets/index-BB9Y-7kV.js","assets/ButtonGroup-PQ_PkB6m.js","assets/DialogContentText-DCnpPqHv.js","assets/TextField-uoLan4-D.js","assets/FormControl-CM7jdcik.js","assets/utils-iop7lDec.js","assets/Select-BtQONHC5.js","assets/OutlinedInput-CEhVWPRi.js","assets/use-mobile-BD_FZ6Ra.js","assets/index-DZyED7ak.js","assets/index-C895TQLf.js","assets/index-FARJ4CmG.js","assets/emotion-cache.browser.esm-BJd0i6wh.js","assets/purify.es-DutPtr9A.js","assets/index-PVmgaFUO.js","assets/index-BO68mfyE.js","assets/useThemeProps-DJJBFim4.js","assets/toPropertyKey-PLuKRk1e.js","assets/ViewColumn-go0xuyyo.js","assets/FormGroup-DmfCMPMS.js","assets/Grid-CoWPn88b.js","assets/Delete-CcyPbNyf.js","assets/LastPage-BHrK-cLk.js","assets/Clear-Ch-uEC-w.js","assets/Search-BAkyJLzf.js","assets/deprecate-Bfb8FxlF.js","assets/uniqBy-CwChXxd0.js","assets/toUpper-D-4kyCa2.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{az as w4,j as n,aM as d1,cX as Ce,aQ as $,fG as S3,aP as w1,aK as G1,aL as X1,T as z,r as V,aO as A2,aR as V4,aS as Q1,aT as J1,d2 as y4,fH as g2,a2 as V1,a3 as y1,a5 as Y1,B as m,P as h,L as X,e as U2,u as n1,aV as H1,b1 as N1,bC as m2,a7 as C2,Q as x1,bM as pe,a as L1,aI as a1,V as H4,v as F,a4 as p1,bN as R4,ag as I1,c as g1,M as k4,bY as q2,cn as fe,cS as S4,c$ as z1,d0 as he,ap as M4,dc as I4,cW as r2,bG as C1,c8 as l2,ft as P4,ae as M3,fI as Z4,b as i1,n as p2,br as xe,en as ge,ao as z2,bs as me,cG as be,aZ as A1,aY as D4,c4 as Le,c6 as T4,c7 as _4,a9 as je,fJ as I3,fh as T1,bp as N4,aA as ve,l as B4,aH as E4,aw as O4,ax as y2}from"./index-DFFp-KRY.js";import{d as W2}from"./Add-B3HyHVtM.js";import{d as we,a as $4}from"./Delete-CcyPbNyf.js";import{d as F4}from"./Error-BdnfHrUX.js";import{D as K2}from"./index-BO68mfyE.js";import{T as Ve,b as A4}from"./index-DIA_1V2x.js";import{C as G2}from"./confirm-DoFYzLCD.js";import{u as b2}from"./session-DWy9sT95.js";import{W as P3}from"./did-address-W2D5q_Ko.js";import{E as e2,D as Z3,C as D3,P as T3}from"./react-beautiful-dnd.esm-B0qpoL0v.js";import{B as X2}from"./bundle-avatar-CY31_Buy.js";import{S as j1}from"./shorten-label-Ba3qRY3O.js";import{A as ye}from"./Avatar-HEUcnEtX.js";import{d as U4}from"./Download-BFWJCBB8.js";import{d as q4}from"./QuestionMarkCircle-U5AYINmw.js";import{b as z4,c as _3,T as W4}from"./index-DZyED7ak.js";import{_ as D1}from"./useSetState-S0BEkJD4.js";import{c as Q2}from"./index-CsT7LyYB.js";import{C as i2,L as K4}from"./MoreVert-10_PTroK.js";import{A as He}from"./Alert-BZsa7bfc.js";import{p as f2}from"./index-Dw86ejmG.js";import"./api-D7TuGL10.js";import{i as G4}from"./index-CoHkYVDV.js";import{d as X4}from"./ExpandMore-DA8Sn2_n.js";import{d as Q4}from"./ChevronRight-Dvxy4T9U.js";import{d as J4}from"./OpenInNew-Bq4wVVSa.js";import{u as Re}from"./useThemeProps-DJJBFim4.js";import{F as I2}from"./FormControlLabel-Cipo0pK9.js";import{u as Y4}from"./useSlotProps-D-blxf7S.js";import{d as N3}from"./DeleteOutline-B9ZfxIRA.js";import{c as e5,A as ke,u as t5,S as o5,U as n5}from"./item-BdtfgvBs.js";import{d as r5}from"./ArrowDropDown-CWmGDz8N.js";import{f as _1}from"./format-error-qE4eWtuQ.js";import{B as P2}from"./ButtonGroup-PQ_PkB6m.js";import{d as s5}from"./Clear-Ch-uEC-w.js";import{D as l5}from"./DialogTitle-CX4cvOk0.js";import{O as i5}from"./OutlinedInput-CEhVWPRi.js";import{I as L2}from"./InputAdornment-l4hLGyx4.js";import{T as h1}from"./TextField-uoLan4-D.js";import{S as M1}from"./Stack-COUrUgv1.js";import{C as c5}from"./click-to-copy-B-IagKFx.js";import{d as a5}from"./Launch-DEmczOPJ.js";import{S as B3}from"./index-PVmgaFUO.js";import{M as d5}from"./index-DOeAD_2U.js";import{p as u5}from"./purify.es-DutPtr9A.js";import{r as C5}from"./index-B0-yJewg.js";import{d as p5}from"./Done-CfZqxitA.js";import{c as Se,d as Me,b as f5,S as h5,a as x5}from"./Stepper-mqXb5jVu.js";import{R as g5,a as E3}from"./RadioGroup-CdcEvXbb.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-BJd0i6wh.js";import"./ViewColumn-go0xuyyo.js";import"./FormControl-CM7jdcik.js";import"./utils-iop7lDec.js";import"./useFormControl-ByXcqYyU.js";import"./FormGroup-DmfCMPMS.js";import"./Grid-CoWPn88b.js";import"./Select-BtQONHC5.js";import"./LastPage-BHrK-cLk.js";import"./Toolbar-C5iQWYfr.js";import"./Search-BAkyJLzf.js";import"./index-C895TQLf.js";import"./DialogContentText-DCnpPqHv.js";import"./Link-B6ysFdMX.js";import"./raf-schd.esm-DO2B_266.js";import"./useSlot-DcqlBn33.js";import"./get-safe-url-Dhzrk6uX.js";import"./jss-plugin-props-sort.esm-CF1jS-lO.js";const m5=w4(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),b5=["slots","slotProps"],L5=d1(Ce)(({theme:e})=>$({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":$({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":$({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:S3(e.palette.grey[200],.12)}:{backgroundColor:S3(e.palette.grey[600],.12)})})),j5=d1(m5)({width:24,height:16});function v5(e){const{slots:t={},slotProps:o={}}=e,r=w1(e,b5),s=e;return n.jsx("li",{children:n.jsx(L5,$({focusRipple:!0},r,{ownerState:s,children:n.jsx(j5,$({as:t.CollapsedIcon,ownerState:s},o.collapsedIcon))}))})}function w5(e){return X1("MuiBreadcrumbs",e)}const V5=G1("MuiBreadcrumbs",["root","ol","li","separator"]),y5=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],H5=e=>{const{classes:t}=e;return J1({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},w5,t)},R5=d1(z,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${V5.li}`]:t.li},t.root]})({}),k5=d1("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),S5=d1("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function M5(e,t,o,r){return e.reduce((s,i,c)=>(c<e.length-1?s=s.concat(i,n.jsx(S5,{"aria-hidden":!0,className:t,ownerState:r,children:o},`separator-${c}`)):s.push(i),s),[])}const Ie=V.forwardRef(function(t,o){const r=A2({props:t,name:"MuiBreadcrumbs"}),{children:s,className:i,component:c="nav",slots:a={},slotProps:d={},expandText:C="Show path",itemsAfterCollapse:f=1,itemsBeforeCollapse:x=1,maxItems:b=8,separator:u="/"}=r,p=w1(r,y5),[g,y]=V.useState(!1),j=$({},r,{component:c,expanded:g,expandText:C,itemsAfterCollapse:f,itemsBeforeCollapse:x,maxItems:b,separator:u}),L=H5(j),R=V4({elementType:a.CollapsedIcon,externalSlotProps:d.collapsedIcon,ownerState:j}),M=V.useRef(null),k=I=>{const D=()=>{y(!0);const T=M.current.querySelector("a[href],button,[tabindex]");T&&T.focus()};return x+f>=I.length?I:[...I.slice(0,x),n.jsx(v5,{"aria-label":C,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:D},"ellipsis"),...I.slice(I.length-f,I.length)]},H=V.Children.toArray(s).filter(I=>V.isValidElement(I)).map((I,D)=>n.jsx("li",{className:L.li,children:I},`child-${D}`));return n.jsx(R5,$({ref:o,component:c,color:"text.secondary",className:Q1(L.root,i),ownerState:j},p,{children:n.jsx(k5,{className:L.ol,ref:M,ownerState:j,children:M5(g||b&&H.length<=b?H:k(H),L.separator,u,j)})}))});function I5(e){return X1("MuiStepButton",e)}const O3=G1("MuiStepButton",["root","horizontal","vertical","touchRipple"]),P5=["children","className","icon","optional"],Z5=e=>{const{classes:t,orientation:o}=e;return J1({root:["root",o],touchRipple:["touchRipple"]},I5,t)},D5=d1(Ce,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${O3.touchRipple}`]:t.touchRipple},t.root,t[o.orientation]]}})(({ownerState:e})=>$({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${O3.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),T5=V.forwardRef(function(t,o){const r=A2({props:t,name:"MuiStepButton"}),{children:s,className:i,icon:c,optional:a}=r,d=w1(r,P5),{disabled:C,active:f}=V.useContext(Se),{orientation:x}=V.useContext(Me),b=$({},r,{orientation:x}),u=Z5(b),p={icon:c,optional:a},g=y4(s,["StepLabel"])?V.cloneElement(s,p):n.jsx(f5,$({},p,{children:s}));return n.jsx(D5,$({focusRipple:!0,disabled:C,TouchRippleProps:{className:u.touchRipple},className:Q1(u.root,i),ref:o,ownerState:b,"aria-current":f?"step":void 0},d,{children:g}))});function _5(e){return X1("MuiStepContent",e)}G1("MuiStepContent",["root","last","transition"]);const N5=["children","className","TransitionComponent","transitionDuration","TransitionProps"],B5=e=>{const{classes:t,last:o}=e;return J1({root:["root",o&&"last"],transition:["transition"]},_5,t)},E5=d1("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.last&&t.last]}})(({ownerState:e,theme:t})=>$({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),O5=d1(g2,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),$5=V.forwardRef(function(t,o){const r=A2({props:t,name:"MuiStepContent"}),{children:s,className:i,TransitionComponent:c=g2,transitionDuration:a="auto",TransitionProps:d}=r,C=w1(r,N5);V.useContext(Me);const{active:f,last:x,expanded:b}=V.useContext(Se),u=$({},r,{last:x}),p=B5(u);let g=a;return a==="auto"&&!c.muiSupportAuto&&(g=void 0),n.jsx(E5,$({className:Q1(p.root,i),ref:o,ownerState:u},C,{children:n.jsx(O5,$({as:c,in:f||b,className:p.transition,ownerState:u,timeout:g,unmountOnExit:!0},d,{children:s}))}))});var J2={},F5=y1;Object.defineProperty(J2,"__esModule",{value:!0});var Pe=J2.default=void 0,A5=F5(V1()),U5=n;Pe=J2.default=(0,A5.default)((0,U5.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Y2={},q5=y1;Object.defineProperty(Y2,"__esModule",{value:!0});var Ze=Y2.default=void 0,z5=q5(V1()),W5=n;Ze=Y2.default=(0,z5.default)((0,W5.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var e3={},K5=y1;Object.defineProperty(e3,"__esModule",{value:!0});var De=e3.default=void 0,G5=K5(V1()),X5=n;De=e3.default=(0,G5.default)((0,X5.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.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 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function t3({did:e,projectId:t,title:o,logo:r,describe:s}){const c=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${r}`,[a,d]=V.useState(!1),C=Y1(f=>f.breakpoints.down("md"));return n.jsxs(m,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[n.jsx(ye,{sx:{borderRadius:1},src:c}),n.jsxs(m,{children:[n.jsx(j1,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:C?"primary.main":""},children:o||"/"}),n.jsx(j1,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:C||a?"primary.main":"grey.700"},children:s||"/"})]})]})}t3.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function o3({initUrl:e}){const t=U2(),o=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:r,locale:s}=n1(),{api:i}=H1(),{api:c}=b2(),[a,d]=V.useState(!0),{blocklet:C}=N1(),[f,x]=V.useState(null),[b,u]=V.useState(!1),p=Y1(P=>P.breakpoints.down("xl")),{componentDid:g=""}=m2(),[y,j]=V.useState(null),L=()=>{i.getProjects({input:{did:C.meta.did,componentDid:g,tenantScope:o}}).then(P=>{const _=(P==null?void 0:P.projects)||[];d(!1),j(_)}).catch(P=>{d(!1),F.error(P.message)})},R=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},M=P=>{x(P)},k=()=>{d(!1),u(!0)},H=()=>{u(!1),x(null)},I=P=>{F.error(P.message),u(!1),x(null)},D=P=>{if(!(P!=null&&P.deleted)){F.error("Delete project failed");return}L(),u(!1),x(null)};if(V.useEffect(()=>{L()},[]),!y&&a)return n.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:n.jsx(e2,{})});if(!y)return null;if(!y.length)return n.jsxs(m,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[n.jsx(m,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),n.jsx(m,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),n.jsx(C2,{onClick:R,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const T=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:P=>{const _=y[P];return n.jsx(x1,{to:`${_.id}`,children:n.jsx(t3,{did:C.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:P=>P?n.jsx(Ve,{type:"success",children:P}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:P=>P?n.jsx(P3,{size:14,compact:!0,responsive:!1,did:P}):null}},p||g?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:P=>P?n.jsx(P3,{onClick:()=>{t(`/.well-known/service/admin/members?did=${P}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:P}):null}},p||g?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:P=>{const _=(C.children||[]).find(U=>U.meta.did===P);return _?n.jsxs(m,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[n.jsx(X2,{size:14,blocklet:_,ancestors:[C]}),n.jsx(m,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},P):""}}},p||o?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:P=>n.jsx(m,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:n.jsx(j1,{children:P})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{customBodyRender:P=>n.jsx(pe,{value:Number(P),locale:s})}},{label:r("common.actions"),name:"actions",options:{customBodyRenderLite:P=>{const _=y[P];return n.jsxs(m,{display:"flex",children:[n.jsx(x1,{to:`${_.id}/new-release/${_.lastReleaseId}`,children:n.jsx(L1,{title:r("blocklet.publish.createRelease"),placement:"top",children:n.jsx(a1,{color:"primary","aria-label":"create",children:n.jsx(Pe,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&n.jsx(L1,{title:r("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:n.jsx(a1,{color:"secondary","aria-label":"create",children:n.jsx(x1,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}`,children:n.jsx(Ze,{sx:{fontSize:18}})})})}),n.jsx(L1,{title:r("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:n.jsx(a1,{color:"primary","aria-label":"delete",onClick:()=>M(_),children:n.jsx(we,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),S=b?n.jsx(H4,{open:!0,popup:!0,onClose:H,action:"check-has-project-id",locale:s,checkFn:c.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:D,onError:I,extraParams:{projectId:f.id,did:C.meta.did,name:f.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:f.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:f.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return n.jsxs(Q5,{children:[n.jsxs(m,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsxs(m,{display:"flex",flexDirection:"row",alignItems:"center",children:[n.jsx(m,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),n.jsx(L1,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:n.jsx(De,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),n.jsxs(C2,{onClick:R,variant:"contained",children:[n.jsx(W2,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]}),n.jsx(m,{mt:3}),n.jsx(K2,{className:"main-table",locale:s,data:y,columns:T,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),f&&n.jsx(G2,{title:`${r("common.delete")} ${f.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:k,onCancel:()=>x(null),children:n.jsx(m,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(P=>n.jsxs(m,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[n.jsx(F4,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),n.jsx(z,{component:"span",variant:"inherit",color:"text.secondary",children:P})]}))})}),S]})}o3.propTypes={initUrl:h.object};o3.defaultProps={initUrl:null};const Q5=p1(m)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{az as w4,j as n,aM as d1,cX as Ce,aQ as $,fG as S3,aP as w1,aK as G1,aL a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`;var p3={},a8=y1;Object.defineProperty(p3,"__esModule",{value:!0});var T2=p3.default=void 0,d8=a8(V1()),u8=n;T2=p3.default=(0,d8.default)((0,u8.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const W3="lastWantToConnectStoreId";function C8(e){var a,d;const[t,o]=V.useState(null),{session:r}=b2(),s=V.useCallback(C=>{o(C),localStorage.setItem(W3,C==null?void 0:C.id)},[o]),i=V.useMemo(()=>{var b,u,p,g;const C=localStorage.getItem(W3),f=C?(((b=e==null?void 0:e.settings)==null?void 0:b.storeList)||[]).find(y=>y.id===C):null;if(f)return f;let x=(((u=e==null?void 0:e.settings)==null?void 0:u.storeList)||[]).find(y=>{var j;return!(y.id!==X.BLOCKLET_STORE.id||y.scope&&y.scope!=="studio"&&y.scope!==((j=r==null?void 0:r.user)==null?void 0:j.did))});return x||(x=(g=(p=e==null?void 0:e.settings)==null?void 0:p.storeList)==null?void 0:g[0]),x},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(d=r==null?void 0:r.user)==null?void 0:d.did]);return[t||i||{},s]}const k2={};async function Ae(e,{interval:t=1e3,maxDuration:o=120*1e3,intervalFirst:r=4e3,timerKey:s=""}){k2[s]&&clearTimeout(k2[s]),await new Promise(a=>setTimeout(a,r));const i=Date.now(),c=async(a,d)=>{try{const C=await e();a(C)}catch(C){Date.now()-i>o?d(C):s?k2[s]=setTimeout(()=>c(a,d),t):setTimeout(()=>c(a,d),t)}};return new Promise(c)}function p8(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function f8(e,{did:t,projectId:o,messageId:r}){return Ae(async()=>{var i;const s=await e.getProject({input:{did:t,projectId:o,messageId:r}});if(!((i=s==null?void 0:s.project)!=null&&i.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid},{timerKey:"connect-studio"})}function h8(e,{did:t,projectId:o,storeId:r}){return Ae(async()=>{var c,a;const s=await e.getProject({input:{did:t,projectId:o,messageId:""}});if(!((a=(c=s==null?void 0:s.project)==null?void 0:c.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(d=>d.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const Ue=({fromBlocklet:e,nodeInfo:t,blocklet:o,userDid:r})=>{var c,a;const s=e?(c=o==null?void 0:o.meta)==null?void 0:c.did:t==null?void 0:t.did;let i=e?((a=o==null?void 0:o.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(i)||(i=[]),i=i.filter(d=>d.protected||!d.scope||d.scope==="studio"||d.scope===r),{teamDid:s,storeList:i}};function f3({blocklet:e,store:t={},onChangeStore:o,onClick:r,disabled:s,loading:i,componentDid:c}){var _,U,K;const{t:a}=n1(),{session:d}=b2(),{api:C,info:f,inService:x}=H1(),b=N1(),[u,p]=V.useState(!1),g=V.useRef(null),[y,j]=V.useState(!1),[L,R]=V.useState(null),M=G=>{o(G),p(!1)},k=()=>{p(!u)},H=G=>{g.current&&g.current.contains(G.target)||p(!1)},I=()=>{j(!0)},D=()=>{j(!1)},T=async()=>{var G;if(L)try{await C.deleteBlockletStore({input:{teamDid:e.meta.did,url:L.url,projectId:"",scope:L.scope||"studio"}}),await((G=b==null?void 0:b.actions)==null?void 0:G.refreshBlocklet())}catch(Z){F.error(`Remove Blocklet Store Error: ${_1(Z)}`)}finally{R(null)}},{storeList:S}=Ue({fromBlocklet:x,blocklet:e,nodeInfo:f,componentDid:c,userDid:(_=d==null?void 0:d.user)==null?void 0:_.did}),P=(U=e==null?void 0:e.meta)==null?void 0:U.did;return n.jsxs(n.Fragment,{children:[n.jsxs(P2,{disabled:s,ref:g,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[n.jsxs(i1,{onClick:r,children:[i&&n.jsx(p2,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),n.jsx(i1,{size:"small","aria-controls":u?"split-button-menu":void 0,"aria-expanded":u?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:k,children:n.jsx(r5,{})})]}),n.jsx(xe,{sx:{zIndex:10},open:u,anchorEl:g.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:G})=>n.jsx(ge,{...G,style:{transformOrigin:"center top"},children:n.jsx(z2,{children:n.jsx(me,{onClickAway:H,children:n.jsxs(be,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[S==null?void 0:S.map(Z=>{var E;return n.jsxs(A1,{selected:Z.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>M(Z),children:[n.jsxs(m,{children:[n.jsx(j1,{sx:{fontSize:"16px"},maxLength:24,children:Z.name}),n.jsx(j1,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:Z.url})]}),e5({store:Z,userDid:(E=d==null?void 0:d.user)==null?void 0:E.did})&&n.jsx(a1,{sx:{ml:1},onClick:B=>{B.preventDefault(),B.stopPropagation(),R(Z)},children:n.jsx(C1,{icon:"ic:outline-delete"})})]},Z.url)}),n.jsx(D4,{}),n.jsxs(A1,{onClick:I,children:[n.jsx(W2,{font:!0}),n.jsx(z,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),y&&n.jsx(ke,{hiddenChildren:!0,open:!0,onClose:D,teamDid:P,storeList:S,scope:"studio",onAdd:(K=b==null?void 0:b.actions)==null?void 0:K.refreshBlocklet}),L&&n.jsx(G2,{displayError:!0,title:`${a("common.delete")} ${L.name}`,description:a("blocklet.publish.deleteStoreTip",{name:L.name}),confirm:a("common.confirm"),onConfirm:T,onCancel:()=>R(null)})]})}f3.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};f3.defaultProps={store:null,blocklet:null};var v1=V;const U1=/^[a-z0-9]+(-[a-z0-9]+)*$/,j2=(e,t,o,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),d=s.pop(),C={provider:s.length>0?s[0]:r,prefix:d,name:a};return t&&!d2(C)?null:C}const i=s[0],c=i.split("-");if(c.length>1){const a={provider:r,prefix:c.shift(),name:c.join("-")};return t&&!d2(a)?null:a}if(o&&r===""){const a={provider:r,prefix:"",name:i};return t&&!d2(a,o)?null:a}return null},d2=(e,t)=>e?!!((e.provider===""||e.provider.match(U1))&&(t&&e.prefix===""||e.prefix.match(U1))&&e.name.match(U1)):!1,qe=Object.freeze({left:0,top:0,width:16,height:16}),h2=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),h3=Object.freeze({...qe,...h2}),_2=Object.freeze({...h3,body:"",hidden:!1});function x8(e,t){const o={};!e.hFlip!=!t.hFlip&&(o.hFlip=!0),!e.vFlip!=!t.vFlip&&(o.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(o.rotate=r),o}function K3(e,t){const o=x8(e,t);for(const r in _2)r in h2?r in e&&!(r in o)&&(o[r]=h2[r]):r in t?o[r]=t[r]:r in e&&(o[r]=e[r]);return o}function g8(e,t){const o=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function i(c){if(o[c])return s[c]=[];if(!(c in s)){s[c]=null;const a=r[c]&&r[c].parent,d=a&&i(a);d&&(s[c]=[a].concat(d))}return s[c]}return Object.keys(o).concat(Object.keys(r)).forEach(i),s}function m8(e,t,o){const r=e.icons,s=e.aliases||Object.create(null);let i={};function c(a){i=K3(r[a]||s[a],i)}return c(t),o.forEach(c),K3(e,i)}function ze(e,t){const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),o.push(s)});const r=g8(e);for(const s in r){const i=r[s];i&&(t(s,m8(e,s,i)),o.push(s))}return o}const b8={provider:"",aliases:{},not_found:{},...qe};function S2(e,t){for(const o in t)if(o in e&&typeof e[o]!=typeof t[o])return!1;return!0}function We(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!S2(e,b8))return null;const o=t.icons;for(const s in o){const i=o[s];if(!s.match(U1)||typeof i.body!="string"||!S2(i,_2))return null}const r=t.aliases||Object.create(null);for(const s in r){const i=r[s],c=i.parent;if(!s.match(U1)||typeof c!="string"||!o[c]&&!r[c]||!S2(i,_2))return null}return t}const G3=Object.create(null);function L8(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Z1(e,t){const o=G3[e]||(G3[e]=Object.create(null));return o[t]||(o[t]=L8(e,t))}function x3(e,t){return We(t)?ze(t,(o,r)=>{r?e.icons[o]=r:e.missing.add(o)}):[]}function j8(e,t,o){try{if(typeof o.body=="string")return e.icons[t]={...o},!0}catch{}return!1}let W1=!1;function Ke(e){return typeof e=="boolean"&&(W1=e),W1}function v8(e){const t=typeof e=="string"?j2(e,!0,W1):e;if(t){const o=Z1(t.provider,t.prefix),r=t.name;return o.icons[r]||(o.missing.has(r)?null:void 0)}}function w8(e,t){const o=j2(e,!0,W1);if(!o)return!1;const r=Z1(o.provider,o.prefix);return j8(r,o.name,t)}function V8(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),W1&&!t&&!e.prefix){let s=!1;return We(e)&&(e.prefix="",ze(e,(i,c)=>{c&&w8(i,c)&&(s=!0)})),s}const o=e.prefix;if(!d2({provider:t,prefix:o,name:"a"}))return!1;const r=Z1(t,o);return!!x3(r,e)}const Ge=Object.freeze({width:null,height:null}),Xe=Object.freeze({...Ge,...h2}),y8=/(-?[0-9.]*[0-9]+[0-9.]*)/g,H8=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function X3(e,t,o){if(t===1)return e;if(o=o||100,typeof e=="number")return Math.ceil(e*t*o)/o;if(typeof e!="string")return e;const r=e.split(y8);if(r===null||!r.length)return e;const s=[];let i=r.shift(),c=H8.test(i);for(;;){if(c){const a=parseFloat(i);isNaN(a)?s.push(i):s.push(Math.ceil(a*t*o)/o)}else s.push(i);if(i=r.shift(),i===void 0)return s.join("");c=!c}}const R8=e=>e==="unset"||e==="undefined"||e==="none";function k8(e,t){const o={...h3,...e},r={...Xe,...t},s={left:o.left,top:o.top,width:o.width,height:o.height};let i=o.body;[o,r].forEach(p=>{const g=[],y=p.hFlip,j=p.vFlip;let L=p.rotate;y?j?L+=2:(g.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),g.push("scale(-1 1)"),s.top=s.left=0):j&&(g.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),g.push("scale(1 -1)"),s.top=s.left=0);let R;switch(L<0&&(L-=Math.floor(L/4)*4),L=L%4,L){case 1:R=s.height/2+s.top,g.unshift("rotate(90 "+R.toString()+" "+R.toString()+")");break;case 2:g.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:R=s.width/2+s.left,g.unshift("rotate(-90 "+R.toString()+" "+R.toString()+")");break}L%2===1&&(s.left!==s.top&&(R=s.left,s.left=s.top,s.top=R),s.width!==s.height&&(R=s.width,s.width=s.height,s.height=R)),g.length&&(i='<g transform="'+g.join(" ")+'">'+i+"</g>")});const c=r.width,a=r.height,d=s.width,C=s.height;let f,x;c===null?(x=a===null?"1em":a==="auto"?C:a,f=X3(x,d/C)):(f=c==="auto"?d:c,x=a===null?X3(f,C/d):a==="auto"?C:a);const b={},u=(p,g)=>{R8(g)||(b[p]=g.toString())};return u("width",f),u("height",x),b.viewBox=s.left.toString()+" "+s.top.toString()+" "+d.toString()+" "+C.toString(),{attributes:b,body:i}}const S8=/\sid="(\S+)"/g,M8="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let I8=0;function P8(e,t=M8){const o=[];let r;for(;r=S8.exec(e);)o.push(r[1]);if(!o.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(i=>{const c=typeof t=="function"?t(i):t+(I8++).toString(),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+c+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const N2=Object.create(null);function Z8(e,t){N2[e]=t}function B2(e){return N2[e]||N2[""]}function g3(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const m3=Object.create(null),$1=["https://api.simplesvg.com","https://api.unisvg.com"],u2=[];for(;$1.length>0;)$1.length===1||Math.random()>.5?u2.push($1.shift()):u2.push($1.pop());m3[""]=g3({resources:["https://api.iconify.design"].concat(u2)});function D8(e,t){const o=g3(t);return o===null?!1:(m3[e]=o,!0)}function b3(e){return m3[e]}const T8=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Q3=T8();function _8(e,t){const o=b3(e);if(!o)return 0;let r;if(!o.maxURL)r=0;else{let s=0;o.resources.forEach(c=>{s=Math.max(s,c.length)});const i=t+".json?icons=";r=o.maxURL-s-o.path.length-i.length}return r}function N8(e){return e===404}const B8=(e,t,o)=>{const r=[],s=_8(e,t),i="icons";let c={type:i,provider:e,prefix:t,icons:[]},a=0;return o.forEach((d,C)=>{a+=d.length+1,a>=s&&C>0&&(r.push(c),c={type:i,provider:e,prefix:t,icons:[]},a=d.length),c.icons.push(d)}),r.push(c),r};function E8(e){if(typeof e=="string"){const t=b3(e);if(t)return t.path}return"/"}const O8=(e,t,o)=>{if(!Q3){o("abort",424);return}let r=E8(t.provider);switch(t.type){case"icons":{const i=t.prefix,a=t.icons.join(","),d=new URLSearchParams({icons:a});r+=i+".json?"+d.toString();break}case"custom":{const i=t.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:o("abort",400);return}let s=503;Q3(e+r).then(i=>{const c=i.status;if(c!==200){setTimeout(()=>{o(N8(c)?"abort":"next",c)});return}return s=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?o("abort",i):o("next",s)});return}setTimeout(()=>{o("success",i)})}).catch(()=>{o("next",s)})},$8={prepare:B8,send:O8};function F8(e){const t={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((s,i)=>s.provider!==i.provider?s.provider.localeCompare(i.provider):s.prefix!==i.prefix?s.prefix.localeCompare(i.prefix):s.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(s=>{if(r.name===s.name&&r.prefix===s.prefix&&r.provider===s.provider)return;r=s;const i=s.provider,c=s.prefix,a=s.name,d=o[i]||(o[i]=Object.create(null)),C=d[c]||(d[c]=Z1(i,c));let f;a in C.icons?f=t.loaded:c===""||C.missing.has(a)?f=t.missing:f=t.pending;const x={provider:i,prefix:c,name:a};f.push(x)}),t}function Qe(e,t){e.forEach(o=>{const r=o.loaderCallbacks;r&&(o.loaderCallbacks=r.filter(s=>s.id!==t))})}function A8(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let o=!1;const r=e.provider,s=e.prefix;t.forEach(i=>{const c=i.icons,a=c.pending.length;c.pending=c.pending.filter(d=>{if(d.prefix!==s)return!0;const C=d.name;if(e.icons[C])c.loaded.push({provider:r,prefix:s,name:C});else if(e.missing.has(C))c.missing.push({provider:r,prefix:s,name:C});else return o=!0,!0;return!1}),c.pending.length!==a&&(o||Qe([e],i.id),i.callback(c.loaded.slice(0),c.missing.slice(0),c.pending.slice(0),i.abort))})}))}let U8=0;function q8(e,t,o){const r=U8++,s=Qe.bind(null,o,r);if(!t.pending.length)return s;const i={id:r,icons:t,callback:e,abort:s};return o.forEach(c=>{(c.loaderCallbacks||(c.loaderCallbacks=[])).push(i)}),s}function z8(e,t=!0,o=!1){const r=[];return e.forEach(s=>{const i=typeof s=="string"?j2(s,t,o):s;i&&r.push(i)}),r}var W8={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function K8(e,t,o,r){const s=e.resources.length,i=e.random?Math.floor(Math.random()*s):e.index;let c;if(e.random){let H=e.resources.slice(0);for(c=[];H.length>1;){const I=Math.floor(Math.random()*H.length);c.push(H[I]),H=H.slice(0,I).concat(H.slice(I+1))}c=c.concat(H)}else c=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let d="pending",C=0,f,x=null,b=[],u=[];typeof r=="function"&&u.push(r);function p(){x&&(clearTimeout(x),x=null)}function g(){d==="pending"&&(d="aborted"),p(),b.forEach(H=>{H.status==="pending"&&(H.status="aborted")}),b=[]}function y(H,I){I&&(u=[]),typeof H=="function"&&u.push(H)}function j(){return{startTime:a,payload:t,status:d,queriesSent:C,queriesPending:b.length,subscribe:y,abort:g}}function L(){d="failed",u.forEach(H=>{H(void 0,f)})}function R(){b.forEach(H=>{H.status==="pending"&&(H.status="aborted")}),b=[]}function M(H,I,D){const T=I!=="success";switch(b=b.filter(S=>S!==H),d){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){f=D,L();return}if(T){f=D,b.length||(c.length?k():L());return}if(p(),R(),!e.random){const S=e.resources.indexOf(H.resource);S!==-1&&S!==e.index&&(e.index=S)}d="completed",u.forEach(S=>{S(D)})}function k(){if(d!=="pending")return;p();const H=c.shift();if(H===void 0){if(b.length){x=setTimeout(()=>{p(),d==="pending"&&(R(),L())},e.timeout);return}L();return}const I={status:"pending",resource:H,callback:(D,T)=>{M(I,D,T)}};b.push(I),C++,x=setTimeout(k,e.rotate),o(H,t,I.callback)}return setTimeout(k),j}function Je(e){const t={...W8,...e};let o=[];function r(){o=o.filter(a=>a().status==="pending")}function s(a,d,C){const f=K8(t,a,d,(x,b)=>{r(),C&&C(x,b)});return o.push(f),f}function i(a){return o.find(d=>a(d))||null}return{query:s,find:i,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function J3(){}const M2=Object.create(null);function G8(e){if(!M2[e]){const t=b3(e);if(!t)return;const o=Je(t),r={config:t,redundancy:o};M2[e]=r}return M2[e]}function X8(e,t,o){let r,s;if(typeof e=="string"){const i=B2(e);if(!i)return o(void 0,424),J3;s=i.send;const c=G8(e);c&&(r=c.redundancy)}else{const i=g3(e);if(i){r=Je(i);const c=e.resources?e.resources[0]:"",a=B2(c);a&&(s=a.send)}}return!r||!s?(o(void 0,424),J3):r.query(t,s,o)().abort}const Y3="iconify2",K1="iconify",Ye=K1+"-count",ee=K1+"-version",e4=36e5,Q8=168;function E2(e,t){try{return e.getItem(t)}catch{}}function L3(e,t,o){try{return e.setItem(t,o),!0}catch{}}function te(e,t){try{e.removeItem(t)}catch{}}function O2(e,t){return L3(e,Ye,t.toString())}function $2(e){return parseInt(E2(e,Ye))||0}const v2={local:!0,session:!0},t4={local:new Set,session:new Set};let j3=!1;function J8(e){j3=e}let s2=typeof window>"u"?{}:window;function o4(e){const t=e+"Storage";try{if(s2&&s2[t]&&typeof s2[t].length=="number")return s2[t]}catch{}v2[e]=!1}function n4(e,t){const o=o4(e);if(!o)return;const r=E2(o,ee);if(r!==Y3){if(r){const a=$2(o);for(let d=0;d<a;d++)te(o,K1+d.toString())}L3(o,ee,Y3),O2(o,0);return}const s=Math.floor(Date.now()/e4)-Q8,i=a=>{const d=K1+a.toString(),C=E2(o,d);if(typeof C=="string"){try{const f=JSON.parse(C);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>s&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&t(f,a))return!0}catch{}te(o,d)}};let c=$2(o);for(let a=c-1;a>=0;a--)i(a)||(a===c-1?(c--,O2(o,c)):t4[e].add(a))}function r4(){if(!j3){J8(!0);for(const e in v2)n4(e,t=>{const o=t.data,r=t.provider,s=o.prefix,i=Z1(r,s);if(!x3(i,o).length)return!1;const c=o.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,c):c,!0})}}function Y8(e,t){const o=e.lastModifiedCached;if(o&&o>=t)return o===t;if(e.lastModifiedCached=t,o)for(const r in v2)n4(r,s=>{const i=s.data;return s.provider!==e.provider||i.prefix!==e.prefix||i.lastModified===t});return!0}function e6(e,t){j3||r4();function o(r){let s;if(!v2[r]||!(s=o4(r)))return;const i=t4[r];let c;if(i.size)i.delete(c=Array.from(i).shift());else if(c=$2(s),!O2(s,c+1))return;const a={cached:Math.floor(Date.now()/e4),provider:e.provider,data:t};return L3(s,K1+c.toString(),JSON.stringify(a))}t.lastModified&&!Y8(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),o("local")||o("session"))}function oe(){}function t6(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,A8(e)}))}function o6(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:o,prefix:r}=e,s=e.iconsToLoad;delete e.iconsToLoad;let i;if(!s||!(i=B2(o)))return;i.prepare(o,r,s).forEach(a=>{X8(o,a,d=>{if(typeof d!="object")a.icons.forEach(C=>{e.missing.add(C)});else try{const C=x3(e,d);if(!C.length)return;const f=e.pendingIcons;f&&C.forEach(x=>{f.delete(x)}),e6(e,d)}catch(C){console.error(C)}t6(e)})})}))}const n6=(e,t)=>{const o=z8(e,!0,Ke()),r=F8(o);if(!r.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(r.loaded,r.missing,r.pending,oe)}),()=>{d=!1}}const s=Object.create(null),i=[];let c,a;return r.pending.forEach(d=>{const{provider:C,prefix:f}=d;if(f===a&&C===c)return;c=C,a=f,i.push(Z1(C,f));const x=s[C]||(s[C]=Object.create(null));x[f]||(x[f]=[])}),r.pending.forEach(d=>{const{provider:C,prefix:f,name:x}=d,b=Z1(C,f),u=b.pendingIcons||(b.pendingIcons=new Set);u.has(x)||(u.add(x),s[C][f].push(x))}),i.forEach(d=>{const{provider:C,prefix:f}=d;s[C][f].length&&o6(d,s[C][f])}),t?q8(t,r,i):oe};function r6(e,t){const o={...e};for(const r in t){const s=t[r],i=typeof s;r in Ge?(s===null||s&&(i==="string"||i==="number"))&&(o[r]=s):i===typeof o[r]&&(o[r]=r==="rotate"?s%4:s)}return o}const s6=/[\s,]+/;function l6(e,t){t.split(s6).forEach(o=>{switch(o.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function i6(e,t=0){const o=e.replace(/^-?[0-9.]*/,"");function r(s){for(;s<0;)s+=4;return s%4}if(o===""){const s=parseInt(e);return isNaN(s)?0:r(s)}else if(o!==e){let s=0;switch(o){case"%":s=25;break;case"deg":s=90}if(s){let i=parseFloat(e.slice(0,e.length-o.length));return isNaN(i)?0:(i=i/s,i%1===0?r(i):0)}}return t}function c6(e,t){let o=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)o+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+o+">"+e+"</svg>"}function a6(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function d6(e){return"data:image/svg+xml,"+a6(e)}function u6(e){return'url("'+d6(e)+'")'}let q1;function C6(){try{q1=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{q1=null}}function p6(e){return q1===void 0&&C6(),q1?q1.createHTML(e):e}const s4={...Xe,inline:!1},f6={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},h6={display:"inline-block"},F2={backgroundColor:"currentColor"},l4={backgroundColor:"transparent"},ne={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},re={WebkitMask:F2,mask:F2,background:l4};for(const e in re){const t=re[e];for(const o in ne)t[e+o]=ne[o]}const x6={...s4,inline:!0};function se(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const g6=(e,t,o,r)=>{const s=o?x6:s4,i=r6(s,t),c=t.mode||"svg",a={},d=t.style||{},C={...c==="svg"?f6:{},ref:r};for(let j in t){const L=t[j];if(L!==void 0)switch(j){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":i[j]=L===!0||L==="true"||L===1;break;case"flip":typeof L=="string"&&l6(i,L);break;case"color":a.color=L;break;case"rotate":typeof L=="string"?i[j]=i6(L):typeof L=="number"&&(i[j]=L);break;case"ariaHidden":case"aria-hidden":L!==!0&&L!=="true"&&delete C["aria-hidden"];break;default:s[j]===void 0&&(C[j]=L)}}const f=k8(e,i),x=f.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),c==="svg"){C.style={...a,...d},Object.assign(C,x);let j=0,L=t.id;return typeof L=="string"&&(L=L.replace(/-/g,"_")),C.dangerouslySetInnerHTML={__html:p6(P8(f.body,L?()=>L+"ID"+j++:"iconifyReact"))},v1.createElement("svg",C)}const{body:b,width:u,height:p}=e,g=c==="mask"||(c==="bg"?!1:b.indexOf("currentColor")!==-1),y=c6(b,{...x,width:u+"",height:p+""});return C.style={...a,"--svg":u6(y),width:se(x.width),height:se(x.height),...h6,...g?F2:l4,...d},v1.createElement("span",C)};Ke(!0);Z8("",$8);if(typeof document<"u"&&typeof window<"u"){r4();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,o="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!V8(r))&&console.error(o)}catch{console.error(o)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let o in t){const r="IconifyProviders["+o+"] is invalid.";try{const s=t[o];if(typeof s!="object"||!s||s.resources===void 0)continue;D8(o,s)||console.error(r)}catch{console.error(r)}}}}class i4 extends v1.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const o=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||o.icon===null)&&this._setData({data:r});return}let s;if(typeof r!="string"||(s=j2(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const i=v8(s);if(!i){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),i!==null&&(this._loading={name:r,abort:n6([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||o.icon===null){this._abortLoading(),this._icon=r;const c=["iconify"];s.prefix!==""&&c.push("iconify--"+s.prefix),s.provider!==""&&c.push("iconify--"+s.provider),this._setData({data:i,classes:c}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,o=this.state.icon;if(o===null)return t.children?t.children:v1.createElement("span",{});let r=t;return o.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+o.classes.join(" ")}),g6({...h3,...o.data},r,t._inline,t._ref)}}const m6=v1.forwardRef(function(t,o){const r={...t,_ref:o,_inline:!1};return v1.createElement(i4,r)});v1.forwardRef(function(t,o){const r={...t,_ref:o,_inline:!0};return v1.createElement(i4,r)});var b6=m6;const L6=e=>{const t=e.includes("youtube.com")||e.includes("youtu.be"),o=e.includes("vimeo.com");return t||o};function w2({url:e,style:t,controls:o,modestbranding:r}){var a;const{t:s}=n1(),i=e.includes("youtube.com")||e.includes("youtu.be"),c=e.includes("vimeo.com");if(i){const d=((a=e.split("v=")[1])==null?void 0:a.split("&")[0])||e.split("/").pop();return n.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(t==null?void 0:t.pointerEvents)||"auto"},children:n.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${o}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...t},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(c){const d=e.split("/").pop();return n.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:t.pointerEvents||"auto"},children:n.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...t},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return n.jsx(m,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:n.jsxs(m,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...t},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[n.jsx(b6,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),n.jsx(z,{variant:"body1",sx:{opacity:.5},children:s("studio.videoDialogNoSrc")})]})})}w2.propTypes={url:h.string.isRequired,style:h.object,controls:h.number,modestbranding:h.number};w2.defaultProps={style:{},controls:1,modestbranding:1};function c4({setParams:e,onClose:t,params:o}){const{t:r}=n1(),[s,i]=V.useState(""),c=s&&o.blockletVideos.includes(s),a=L6(s),d=()=>{e(C=>{const f=[...C.blockletVideos];return f.push(s),{...C,blockletVideos:f}}),t()};return n.jsxs(Le,{open:!0,fullWidth:!0,maxWidth:"sm",children:[n.jsx(l5,{children:r("studio.videoDialogTitle")}),n.jsxs(T4,{children:[n.jsx(i5,{fullWidth:!0,value:s,onChange:C=>i(C.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:s?n.jsx(L2,{position:"end",children:n.jsx(a1,{onClick:()=>i(""),children:n.jsx(s5,{})})}):null,error:c}),c&&n.jsx(z,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),n.jsx(w2,{url:s,style:{marginTop:"20px",borderRadius:"4px"}})]}),n.jsxs(_4,{children:[n.jsx(i1,{onClick:()=>t(),children:r("studio.cancel")}),n.jsx(i1,{disabled:!a||c,onClick:d,children:r("studio.confirm")})]})]})}c4.propTypes={onClose:h.func.isRequired,params:h.object.isRequired,setParams:h.func.isRequired};const le=V.lazy(()=>je(()=>import("./index-lJoTfApr.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58])).then(e=>({default:e.Uploader})));function a4({projectId:e,readOnly:t,loading:o,blocklet:r,params:s,setParams:i,paramsErrTip:c,setParamsErrTip:a,setLoading:d,initUrl:C,initLogoUrl:f,setInitLogoUrl:x,componentDid:b}){const{t:u}=n1(),{api:p}=H1(),g=U2(),y=V.useRef(null),j=V.useRef(null),[L,R]=C8(r),[M,k]=V.useState(!1),H=t5({messageType:"connect-store-message",onOpen:()=>d(!0),onClose:()=>d(!1)}),I=async Z=>{const E=setTimeout(()=>{d(!1)},2e4),B=await f8(p,Z);d(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},D=()=>{if(!s.blockletTitle){F.error(u("blocklet.publish.errorTip.noTitle"));return}if(!(L!=null&&L.url)){F.error(u("blocklet.publish.noStoreSelected"));return}const Z=p8();H(async(E,B)=>{var W,Q,t1;try{const J=await p.connectByStudio({input:{did:(W=r==null?void 0:r.meta)==null?void 0:W.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:L.url,storeId:L.id,storeName:L.name,type:((Q=s==null?void 0:s.blockletComponents)==null?void 0:Q.length)>0?"pack":"resource",componentDid:b,messageId:Z,tenantScope:(C==null?void 0:C.searchParams.get("tenantScope"))||""}});if(!(J!=null&&J.url)){F.error("failed to connect to store");return}B(J.url),I({did:(t1=r==null?void 0:r.meta)==null?void 0:t1.did,projectId:"",messageId:Z})}catch(J){const Y=_1(J);F.error(Y),d(!1)}})},T=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,S=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,P=s!=null&&s.blockletLogo?`${T}/${s.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,_=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(Z=>`${S}/${Z}`),U=()=>t?!1:!e||e===X.UNOWNED_DID?(F.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,K=Z=>{if(!Z.destination)return;const E=Array.from(s.blockletScreenshots),[B]=E.splice(Z.source.index,1);E.splice(Z.destination.index,0,B),i(W=>({...W,blockletScreenshots:E}))},G=Z=>{if(!Z.destination)return;const E=Array.from(s.blockletVideos),[B]=E.splice(Z.source.index,1);E.splice(Z.destination.index,0,B),i(W=>({...W,blockletVideos:E}))};return n.jsxs(j6,{children:[n.jsx(m,{display:"flex",className:"section",children:n.jsxs(m,{sx:{flex:1},children:[n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.title")}`,placeholder:`Blocklet ${u("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:s.blockletTitle||"",onChange:Z=>{a({blockletTitle:""}),i({blockletTitle:Z.target.value})},error:!!c.blockletTitle,helperText:c.blockletTitle||""}),n.jsx(h1,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&n.jsx(L2,{position:"end",children:n.jsx(f3,{blocklet:r,store:L,componentDid:b,onChangeStore:R,disabled:!s.blockletTitle||t||o,loading:o,onClick:D})})},error:!!c.projectId,helperText:c.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.description")}`,placeholder:`Blocklet ${u("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletDescription||"",onChange:Z=>{a({blockletDescription:""}),i({blockletDescription:Z.target.value})},error:!!c.blockletDescription,helperText:c.blockletDescription||"",sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.homepage")}`,placeholder:`Blocklet ${u("common.homepage")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletHomepage||"",onChange:Z=>{Z.target.value&&!/^(http|https):\/\//.test(Z.target.value)?a({blockletHomepage:u("blocklet.publish.errorTip.invalidUrl")}):a({blockletHomepage:""}),i({blockletHomepage:Z.target.value})},error:!!c.blockletHomepage,helperText:c.blockletHomepage||"",sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.community")}`,placeholder:`Blocklet ${u("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletCommunity||"",onChange:Z=>{Z.target.value&&!/^(http|https):\/\//.test(Z.target.value)?a({blockletCommunity:u("blocklet.publish.errorTip.invalidUrl")}):a({blockletCommunity:""}),i({blockletCommunity:Z.target.value})},error:!!c.blockletCommunity,helperText:c.blockletCommunity||"",sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.support")}`,placeholder:`Blocklet ${u("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletSupport||"",onChange:Z=>{Z.target.value&&!/^(http|https):\/\//.test(Z.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(Z.target.value)?a({blockletSupport:u("blocklet.publish.errorTip.invalidUrlOrEmail")}):a({blockletSupport:""}),i({blockletSupport:Z.target.value})},error:!!c.blockletSupport,helperText:c.blockletSupport||"",sx:{mt:3}})]})}),n.jsx(m,{display:"flex",mt:3,className:"section full-width",children:n.jsxs(m,{sx:{flex:1},children:[n.jsxs(m,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(M1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(z,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.logo")}),n.jsxs(M1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.type"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),n.jsx(m,{sx:{flex:1,cursor:t?"default":"pointer",display:"flex",alignItems:"flex-end"},children:n.jsx(ye,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:f||P,onClick:()=>{var Z;U()&&((Z=y.current)==null||Z.open())}})})]}),n.jsxs(m,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(M1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(z,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.screenshot")}),n.jsxs(M1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(m,{sx:{border:"none"},variant:"outlined",size:"small",children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.count"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!t&&n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.order"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u("studio.orderTip")})]})})]})]}),n.jsx(Z3,{onDragEnd:t?void 0:K,children:n.jsx(D3,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(Z,E)=>n.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:E.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:E.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:Z.innerRef,...Z.droppableProps,children:[_.map((B,W)=>n.jsx(T3,{draggableId:B,index:W,isDragDisabled:t,children:(Q,t1)=>n.jsxs(m,{ref:Q.innerRef,...Q.draggableProps,className:"screenshot",sx:{transform:t1.isDragging?"scale(1.05)":"none",boxShadow:t1.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[n.jsx("img",{alt:"screenshot",src:B}),!t&&n.jsx(a1,{...Q.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:n.jsx(T2,{})}),!t&&n.jsx(a1,{className:"action",onClick:()=>{i(J=>{const Y=[...J.blockletScreenshots];return Y.splice(W,1),{...J,blockletScreenshots:Y}})},children:n.jsx(N3,{})})]})},B)),Z.placeholder,_.length<5&&n.jsx(m,{sx:{width:240,height:135,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var B;U()&&((B=j.current)==null||B.open())},children:"+"})]})})})]}),n.jsxs(m,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(M1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(z,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("studio.video")}),n.jsxs(M1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.videoType"),":"," "]}),n.jsxs(m,{component:"span",sx:{color:"#007ec6"},children:[n.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",n.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.count"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!t&&n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.order"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u("studio.orderTip")})]})})]})]}),n.jsx(Z3,{onDragEnd:t?void 0:G,children:n.jsx(D3,{droppableId:"videos",direction:"horizontal",isDropDisabled:t,children:(Z,E)=>n.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:E.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:E.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:Z.innerRef,...Z.droppableProps,children:[s.blockletVideos.map((B,W)=>n.jsx(T3,{draggableId:B,index:W,isDragDisabled:t,children:(Q,t1)=>n.jsxs(m,{ref:Q.innerRef,...Q.draggableProps,className:"screenshot",sx:{transform:t1.isDragging?"scale(1.05)":"none",boxShadow:t1.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[n.jsx(w2,{url:B,style:{pointerEvents:t1.isDragging?"none":"auto"}}),!t&&n.jsx(a1,{...Q.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:n.jsx(T2,{})}),!t&&n.jsx(a1,{className:"action",onClick:()=>{i(J=>{const Y=[...J.blockletVideos];return Y.splice(W,1),{...J,blockletVideos:Y}})},children:n.jsx(N3,{})})]})},B)),Z.placeholder,s.blockletVideos.length<3&&n.jsx(m,{sx:{width:240,height:135,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{U()&&k(!0)},children:"+"})]})})})]})]})}),n.jsxs(V.Suspense,{fallback:n.jsx(e2,{}),children:[n.jsx(le,{ref:y,popup:!0,onUploadFinish:Z=>{var E;i({blockletLogo:Z.data.filename}),x(""),(E=y.current)==null||E.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:T,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","application/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),M&&n.jsx(c4,{onClose:()=>k(!1),params:s,setParams:i}),n.jsx(le,{ref:j,popup:!0,onUploadFinish:Z=>{var E;i(B=>{var Q;const W=B.blockletScreenshots||[];return W.push((Q=Z.data)==null?void 0:Q.filename),{...B,blockletScreenshots:W}}),(E=j.current)==null||E.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-_.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}a4.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const j6=p1.div`
|
|
136
|
+
`;var p3={},a8=y1;Object.defineProperty(p3,"__esModule",{value:!0});var T2=p3.default=void 0,d8=a8(V1()),u8=n;T2=p3.default=(0,d8.default)((0,u8.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const W3="lastWantToConnectStoreId";function C8(e){var a,d;const[t,o]=V.useState(null),{session:r}=b2(),s=V.useCallback(C=>{o(C),localStorage.setItem(W3,C==null?void 0:C.id)},[o]),i=V.useMemo(()=>{var b,u,p,g;const C=localStorage.getItem(W3),f=C?(((b=e==null?void 0:e.settings)==null?void 0:b.storeList)||[]).find(y=>y.id===C):null;if(f)return f;let x=(((u=e==null?void 0:e.settings)==null?void 0:u.storeList)||[]).find(y=>{var j;return!(y.id!==X.BLOCKLET_STORE.id||y.scope&&y.scope!=="studio"&&y.scope!==((j=r==null?void 0:r.user)==null?void 0:j.did))});return x||(x=(g=(p=e==null?void 0:e.settings)==null?void 0:p.storeList)==null?void 0:g[0]),x},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(d=r==null?void 0:r.user)==null?void 0:d.did]);return[t||i||{},s]}const k2={};async function Ae(e,{interval:t=1e3,maxDuration:o=120*1e3,intervalFirst:r=4e3,timerKey:s=""}){k2[s]&&clearTimeout(k2[s]),await new Promise(a=>setTimeout(a,r));const i=Date.now(),c=async(a,d)=>{try{const C=await e();a(C)}catch(C){Date.now()-i>o?d(C):s?k2[s]=setTimeout(()=>c(a,d),t):setTimeout(()=>c(a,d),t)}};return new Promise(c)}function p8(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function f8(e,{did:t,projectId:o,messageId:r}){return Ae(async()=>{var i;const s=await e.getProject({input:{did:t,projectId:o,messageId:r}});if(!((i=s==null?void 0:s.project)!=null&&i.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid},{timerKey:"connect-studio"})}function h8(e,{did:t,projectId:o,storeId:r}){return Ae(async()=>{var c,a;const s=await e.getProject({input:{did:t,projectId:o,messageId:""}});if(!((a=(c=s==null?void 0:s.project)==null?void 0:c.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(d=>d.storeId===r))throw new Error("Connected store not found")},{timerKey:`connect-store-${r}`})}const Ue=({fromBlocklet:e,nodeInfo:t,blocklet:o,userDid:r})=>{var c,a;const s=e?(c=o==null?void 0:o.meta)==null?void 0:c.did:t==null?void 0:t.did;let i=e?((a=o==null?void 0:o.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(i)||(i=[]),i=i.filter(d=>d.protected||!d.scope||d.scope==="studio"||d.scope===r),{teamDid:s,storeList:i}};function f3({blocklet:e,store:t={},onChangeStore:o,onClick:r,disabled:s,loading:i,componentDid:c}){var _,U,K;const{t:a}=n1(),{session:d}=b2(),{api:C,info:f,inService:x}=H1(),b=N1(),[u,p]=V.useState(!1),g=V.useRef(null),[y,j]=V.useState(!1),[L,R]=V.useState(null),M=G=>{o(G),p(!1)},k=()=>{p(!u)},H=G=>{g.current&&g.current.contains(G.target)||p(!1)},I=()=>{j(!0)},D=()=>{j(!1)},T=async()=>{var G;if(L)try{await C.deleteBlockletStore({input:{teamDid:e.meta.did,url:L.url,projectId:"",scope:L.scope||"studio"}}),await((G=b==null?void 0:b.actions)==null?void 0:G.refreshBlocklet())}catch(Z){F.error(`Remove Blocklet Store Error: ${_1(Z)}`)}finally{R(null)}},{storeList:S}=Ue({fromBlocklet:x,blocklet:e,nodeInfo:f,componentDid:c,userDid:(_=d==null?void 0:d.user)==null?void 0:_.did}),P=(U=e==null?void 0:e.meta)==null?void 0:U.did;return n.jsxs(n.Fragment,{children:[n.jsxs(P2,{disabled:s,ref:g,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[n.jsxs(i1,{onClick:r,children:[i&&n.jsx(p2,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),n.jsx(i1,{size:"small","aria-controls":u?"split-button-menu":void 0,"aria-expanded":u?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:k,children:n.jsx(r5,{})})]}),n.jsx(xe,{sx:{zIndex:10},open:u,anchorEl:g.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:G})=>n.jsx(ge,{...G,style:{transformOrigin:"center top"},children:n.jsx(z2,{children:n.jsx(me,{onClickAway:H,children:n.jsxs(be,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[S==null?void 0:S.map(Z=>{var E;return n.jsxs(A1,{selected:Z.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>M(Z),children:[n.jsxs(m,{children:[n.jsx(j1,{sx:{fontSize:"16px"},maxLength:24,children:Z.name}),n.jsx(j1,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:Z.url})]}),e5({store:Z,userDid:(E=d==null?void 0:d.user)==null?void 0:E.did})&&n.jsx(a1,{sx:{ml:1},onClick:B=>{B.preventDefault(),B.stopPropagation(),R(Z)},children:n.jsx(C1,{icon:"ic:outline-delete"})})]},Z.url)}),n.jsx(D4,{}),n.jsxs(A1,{onClick:I,children:[n.jsx(W2,{font:!0}),n.jsx(z,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),y&&n.jsx(ke,{hiddenChildren:!0,open:!0,onClose:D,teamDid:P,storeList:S,scope:"studio",onAdd:(K=b==null?void 0:b.actions)==null?void 0:K.refreshBlocklet}),L&&n.jsx(G2,{displayError:!0,title:`${a("common.delete")} ${L.name}`,description:a("blocklet.publish.deleteStoreTip",{name:L.name}),confirm:a("common.confirm"),onConfirm:T,onCancel:()=>R(null)})]})}f3.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};f3.defaultProps={store:null,blocklet:null};var v1=V;const U1=/^[a-z0-9]+(-[a-z0-9]+)*$/,j2=(e,t,o,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),d=s.pop(),C={provider:s.length>0?s[0]:r,prefix:d,name:a};return t&&!d2(C)?null:C}const i=s[0],c=i.split("-");if(c.length>1){const a={provider:r,prefix:c.shift(),name:c.join("-")};return t&&!d2(a)?null:a}if(o&&r===""){const a={provider:r,prefix:"",name:i};return t&&!d2(a,o)?null:a}return null},d2=(e,t)=>e?!!((e.provider===""||e.provider.match(U1))&&(t&&e.prefix===""||e.prefix.match(U1))&&e.name.match(U1)):!1,qe=Object.freeze({left:0,top:0,width:16,height:16}),h2=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),h3=Object.freeze({...qe,...h2}),_2=Object.freeze({...h3,body:"",hidden:!1});function x8(e,t){const o={};!e.hFlip!=!t.hFlip&&(o.hFlip=!0),!e.vFlip!=!t.vFlip&&(o.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(o.rotate=r),o}function K3(e,t){const o=x8(e,t);for(const r in _2)r in h2?r in e&&!(r in o)&&(o[r]=h2[r]):r in t?o[r]=t[r]:r in e&&(o[r]=e[r]);return o}function g8(e,t){const o=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function i(c){if(o[c])return s[c]=[];if(!(c in s)){s[c]=null;const a=r[c]&&r[c].parent,d=a&&i(a);d&&(s[c]=[a].concat(d))}return s[c]}return Object.keys(o).concat(Object.keys(r)).forEach(i),s}function m8(e,t,o){const r=e.icons,s=e.aliases||Object.create(null);let i={};function c(a){i=K3(r[a]||s[a],i)}return c(t),o.forEach(c),K3(e,i)}function ze(e,t){const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),o.push(s)});const r=g8(e);for(const s in r){const i=r[s];i&&(t(s,m8(e,s,i)),o.push(s))}return o}const b8={provider:"",aliases:{},not_found:{},...qe};function S2(e,t){for(const o in t)if(o in e&&typeof e[o]!=typeof t[o])return!1;return!0}function We(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!S2(e,b8))return null;const o=t.icons;for(const s in o){const i=o[s];if(!s.match(U1)||typeof i.body!="string"||!S2(i,_2))return null}const r=t.aliases||Object.create(null);for(const s in r){const i=r[s],c=i.parent;if(!s.match(U1)||typeof c!="string"||!o[c]&&!r[c]||!S2(i,_2))return null}return t}const G3=Object.create(null);function L8(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Z1(e,t){const o=G3[e]||(G3[e]=Object.create(null));return o[t]||(o[t]=L8(e,t))}function x3(e,t){return We(t)?ze(t,(o,r)=>{r?e.icons[o]=r:e.missing.add(o)}):[]}function j8(e,t,o){try{if(typeof o.body=="string")return e.icons[t]={...o},!0}catch{}return!1}let W1=!1;function Ke(e){return typeof e=="boolean"&&(W1=e),W1}function v8(e){const t=typeof e=="string"?j2(e,!0,W1):e;if(t){const o=Z1(t.provider,t.prefix),r=t.name;return o.icons[r]||(o.missing.has(r)?null:void 0)}}function w8(e,t){const o=j2(e,!0,W1);if(!o)return!1;const r=Z1(o.provider,o.prefix);return j8(r,o.name,t)}function V8(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),W1&&!t&&!e.prefix){let s=!1;return We(e)&&(e.prefix="",ze(e,(i,c)=>{c&&w8(i,c)&&(s=!0)})),s}const o=e.prefix;if(!d2({provider:t,prefix:o,name:"a"}))return!1;const r=Z1(t,o);return!!x3(r,e)}const Ge=Object.freeze({width:null,height:null}),Xe=Object.freeze({...Ge,...h2}),y8=/(-?[0-9.]*[0-9]+[0-9.]*)/g,H8=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function X3(e,t,o){if(t===1)return e;if(o=o||100,typeof e=="number")return Math.ceil(e*t*o)/o;if(typeof e!="string")return e;const r=e.split(y8);if(r===null||!r.length)return e;const s=[];let i=r.shift(),c=H8.test(i);for(;;){if(c){const a=parseFloat(i);isNaN(a)?s.push(i):s.push(Math.ceil(a*t*o)/o)}else s.push(i);if(i=r.shift(),i===void 0)return s.join("");c=!c}}const R8=e=>e==="unset"||e==="undefined"||e==="none";function k8(e,t){const o={...h3,...e},r={...Xe,...t},s={left:o.left,top:o.top,width:o.width,height:o.height};let i=o.body;[o,r].forEach(p=>{const g=[],y=p.hFlip,j=p.vFlip;let L=p.rotate;y?j?L+=2:(g.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),g.push("scale(-1 1)"),s.top=s.left=0):j&&(g.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),g.push("scale(1 -1)"),s.top=s.left=0);let R;switch(L<0&&(L-=Math.floor(L/4)*4),L=L%4,L){case 1:R=s.height/2+s.top,g.unshift("rotate(90 "+R.toString()+" "+R.toString()+")");break;case 2:g.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:R=s.width/2+s.left,g.unshift("rotate(-90 "+R.toString()+" "+R.toString()+")");break}L%2===1&&(s.left!==s.top&&(R=s.left,s.left=s.top,s.top=R),s.width!==s.height&&(R=s.width,s.width=s.height,s.height=R)),g.length&&(i='<g transform="'+g.join(" ")+'">'+i+"</g>")});const c=r.width,a=r.height,d=s.width,C=s.height;let f,x;c===null?(x=a===null?"1em":a==="auto"?C:a,f=X3(x,d/C)):(f=c==="auto"?d:c,x=a===null?X3(f,C/d):a==="auto"?C:a);const b={},u=(p,g)=>{R8(g)||(b[p]=g.toString())};return u("width",f),u("height",x),b.viewBox=s.left.toString()+" "+s.top.toString()+" "+d.toString()+" "+C.toString(),{attributes:b,body:i}}const S8=/\sid="(\S+)"/g,M8="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let I8=0;function P8(e,t=M8){const o=[];let r;for(;r=S8.exec(e);)o.push(r[1]);if(!o.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(i=>{const c=typeof t=="function"?t(i):t+(I8++).toString(),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+c+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const N2=Object.create(null);function Z8(e,t){N2[e]=t}function B2(e){return N2[e]||N2[""]}function g3(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const m3=Object.create(null),$1=["https://api.simplesvg.com","https://api.unisvg.com"],u2=[];for(;$1.length>0;)$1.length===1||Math.random()>.5?u2.push($1.shift()):u2.push($1.pop());m3[""]=g3({resources:["https://api.iconify.design"].concat(u2)});function D8(e,t){const o=g3(t);return o===null?!1:(m3[e]=o,!0)}function b3(e){return m3[e]}const T8=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Q3=T8();function _8(e,t){const o=b3(e);if(!o)return 0;let r;if(!o.maxURL)r=0;else{let s=0;o.resources.forEach(c=>{s=Math.max(s,c.length)});const i=t+".json?icons=";r=o.maxURL-s-o.path.length-i.length}return r}function N8(e){return e===404}const B8=(e,t,o)=>{const r=[],s=_8(e,t),i="icons";let c={type:i,provider:e,prefix:t,icons:[]},a=0;return o.forEach((d,C)=>{a+=d.length+1,a>=s&&C>0&&(r.push(c),c={type:i,provider:e,prefix:t,icons:[]},a=d.length),c.icons.push(d)}),r.push(c),r};function E8(e){if(typeof e=="string"){const t=b3(e);if(t)return t.path}return"/"}const O8=(e,t,o)=>{if(!Q3){o("abort",424);return}let r=E8(t.provider);switch(t.type){case"icons":{const i=t.prefix,a=t.icons.join(","),d=new URLSearchParams({icons:a});r+=i+".json?"+d.toString();break}case"custom":{const i=t.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:o("abort",400);return}let s=503;Q3(e+r).then(i=>{const c=i.status;if(c!==200){setTimeout(()=>{o(N8(c)?"abort":"next",c)});return}return s=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?o("abort",i):o("next",s)});return}setTimeout(()=>{o("success",i)})}).catch(()=>{o("next",s)})},$8={prepare:B8,send:O8};function F8(e){const t={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((s,i)=>s.provider!==i.provider?s.provider.localeCompare(i.provider):s.prefix!==i.prefix?s.prefix.localeCompare(i.prefix):s.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(s=>{if(r.name===s.name&&r.prefix===s.prefix&&r.provider===s.provider)return;r=s;const i=s.provider,c=s.prefix,a=s.name,d=o[i]||(o[i]=Object.create(null)),C=d[c]||(d[c]=Z1(i,c));let f;a in C.icons?f=t.loaded:c===""||C.missing.has(a)?f=t.missing:f=t.pending;const x={provider:i,prefix:c,name:a};f.push(x)}),t}function Qe(e,t){e.forEach(o=>{const r=o.loaderCallbacks;r&&(o.loaderCallbacks=r.filter(s=>s.id!==t))})}function A8(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let o=!1;const r=e.provider,s=e.prefix;t.forEach(i=>{const c=i.icons,a=c.pending.length;c.pending=c.pending.filter(d=>{if(d.prefix!==s)return!0;const C=d.name;if(e.icons[C])c.loaded.push({provider:r,prefix:s,name:C});else if(e.missing.has(C))c.missing.push({provider:r,prefix:s,name:C});else return o=!0,!0;return!1}),c.pending.length!==a&&(o||Qe([e],i.id),i.callback(c.loaded.slice(0),c.missing.slice(0),c.pending.slice(0),i.abort))})}))}let U8=0;function q8(e,t,o){const r=U8++,s=Qe.bind(null,o,r);if(!t.pending.length)return s;const i={id:r,icons:t,callback:e,abort:s};return o.forEach(c=>{(c.loaderCallbacks||(c.loaderCallbacks=[])).push(i)}),s}function z8(e,t=!0,o=!1){const r=[];return e.forEach(s=>{const i=typeof s=="string"?j2(s,t,o):s;i&&r.push(i)}),r}var W8={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function K8(e,t,o,r){const s=e.resources.length,i=e.random?Math.floor(Math.random()*s):e.index;let c;if(e.random){let H=e.resources.slice(0);for(c=[];H.length>1;){const I=Math.floor(Math.random()*H.length);c.push(H[I]),H=H.slice(0,I).concat(H.slice(I+1))}c=c.concat(H)}else c=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let d="pending",C=0,f,x=null,b=[],u=[];typeof r=="function"&&u.push(r);function p(){x&&(clearTimeout(x),x=null)}function g(){d==="pending"&&(d="aborted"),p(),b.forEach(H=>{H.status==="pending"&&(H.status="aborted")}),b=[]}function y(H,I){I&&(u=[]),typeof H=="function"&&u.push(H)}function j(){return{startTime:a,payload:t,status:d,queriesSent:C,queriesPending:b.length,subscribe:y,abort:g}}function L(){d="failed",u.forEach(H=>{H(void 0,f)})}function R(){b.forEach(H=>{H.status==="pending"&&(H.status="aborted")}),b=[]}function M(H,I,D){const T=I!=="success";switch(b=b.filter(S=>S!==H),d){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){f=D,L();return}if(T){f=D,b.length||(c.length?k():L());return}if(p(),R(),!e.random){const S=e.resources.indexOf(H.resource);S!==-1&&S!==e.index&&(e.index=S)}d="completed",u.forEach(S=>{S(D)})}function k(){if(d!=="pending")return;p();const H=c.shift();if(H===void 0){if(b.length){x=setTimeout(()=>{p(),d==="pending"&&(R(),L())},e.timeout);return}L();return}const I={status:"pending",resource:H,callback:(D,T)=>{M(I,D,T)}};b.push(I),C++,x=setTimeout(k,e.rotate),o(H,t,I.callback)}return setTimeout(k),j}function Je(e){const t={...W8,...e};let o=[];function r(){o=o.filter(a=>a().status==="pending")}function s(a,d,C){const f=K8(t,a,d,(x,b)=>{r(),C&&C(x,b)});return o.push(f),f}function i(a){return o.find(d=>a(d))||null}return{query:s,find:i,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function J3(){}const M2=Object.create(null);function G8(e){if(!M2[e]){const t=b3(e);if(!t)return;const o=Je(t),r={config:t,redundancy:o};M2[e]=r}return M2[e]}function X8(e,t,o){let r,s;if(typeof e=="string"){const i=B2(e);if(!i)return o(void 0,424),J3;s=i.send;const c=G8(e);c&&(r=c.redundancy)}else{const i=g3(e);if(i){r=Je(i);const c=e.resources?e.resources[0]:"",a=B2(c);a&&(s=a.send)}}return!r||!s?(o(void 0,424),J3):r.query(t,s,o)().abort}const Y3="iconify2",K1="iconify",Ye=K1+"-count",ee=K1+"-version",e4=36e5,Q8=168;function E2(e,t){try{return e.getItem(t)}catch{}}function L3(e,t,o){try{return e.setItem(t,o),!0}catch{}}function te(e,t){try{e.removeItem(t)}catch{}}function O2(e,t){return L3(e,Ye,t.toString())}function $2(e){return parseInt(E2(e,Ye))||0}const v2={local:!0,session:!0},t4={local:new Set,session:new Set};let j3=!1;function J8(e){j3=e}let s2=typeof window>"u"?{}:window;function o4(e){const t=e+"Storage";try{if(s2&&s2[t]&&typeof s2[t].length=="number")return s2[t]}catch{}v2[e]=!1}function n4(e,t){const o=o4(e);if(!o)return;const r=E2(o,ee);if(r!==Y3){if(r){const a=$2(o);for(let d=0;d<a;d++)te(o,K1+d.toString())}L3(o,ee,Y3),O2(o,0);return}const s=Math.floor(Date.now()/e4)-Q8,i=a=>{const d=K1+a.toString(),C=E2(o,d);if(typeof C=="string"){try{const f=JSON.parse(C);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>s&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&t(f,a))return!0}catch{}te(o,d)}};let c=$2(o);for(let a=c-1;a>=0;a--)i(a)||(a===c-1?(c--,O2(o,c)):t4[e].add(a))}function r4(){if(!j3){J8(!0);for(const e in v2)n4(e,t=>{const o=t.data,r=t.provider,s=o.prefix,i=Z1(r,s);if(!x3(i,o).length)return!1;const c=o.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,c):c,!0})}}function Y8(e,t){const o=e.lastModifiedCached;if(o&&o>=t)return o===t;if(e.lastModifiedCached=t,o)for(const r in v2)n4(r,s=>{const i=s.data;return s.provider!==e.provider||i.prefix!==e.prefix||i.lastModified===t});return!0}function e6(e,t){j3||r4();function o(r){let s;if(!v2[r]||!(s=o4(r)))return;const i=t4[r];let c;if(i.size)i.delete(c=Array.from(i).shift());else if(c=$2(s),!O2(s,c+1))return;const a={cached:Math.floor(Date.now()/e4),provider:e.provider,data:t};return L3(s,K1+c.toString(),JSON.stringify(a))}t.lastModified&&!Y8(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),o("local")||o("session"))}function oe(){}function t6(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,A8(e)}))}function o6(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:o,prefix:r}=e,s=e.iconsToLoad;delete e.iconsToLoad;let i;if(!s||!(i=B2(o)))return;i.prepare(o,r,s).forEach(a=>{X8(o,a,d=>{if(typeof d!="object")a.icons.forEach(C=>{e.missing.add(C)});else try{const C=x3(e,d);if(!C.length)return;const f=e.pendingIcons;f&&C.forEach(x=>{f.delete(x)}),e6(e,d)}catch(C){console.error(C)}t6(e)})})}))}const n6=(e,t)=>{const o=z8(e,!0,Ke()),r=F8(o);if(!r.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(r.loaded,r.missing,r.pending,oe)}),()=>{d=!1}}const s=Object.create(null),i=[];let c,a;return r.pending.forEach(d=>{const{provider:C,prefix:f}=d;if(f===a&&C===c)return;c=C,a=f,i.push(Z1(C,f));const x=s[C]||(s[C]=Object.create(null));x[f]||(x[f]=[])}),r.pending.forEach(d=>{const{provider:C,prefix:f,name:x}=d,b=Z1(C,f),u=b.pendingIcons||(b.pendingIcons=new Set);u.has(x)||(u.add(x),s[C][f].push(x))}),i.forEach(d=>{const{provider:C,prefix:f}=d;s[C][f].length&&o6(d,s[C][f])}),t?q8(t,r,i):oe};function r6(e,t){const o={...e};for(const r in t){const s=t[r],i=typeof s;r in Ge?(s===null||s&&(i==="string"||i==="number"))&&(o[r]=s):i===typeof o[r]&&(o[r]=r==="rotate"?s%4:s)}return o}const s6=/[\s,]+/;function l6(e,t){t.split(s6).forEach(o=>{switch(o.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function i6(e,t=0){const o=e.replace(/^-?[0-9.]*/,"");function r(s){for(;s<0;)s+=4;return s%4}if(o===""){const s=parseInt(e);return isNaN(s)?0:r(s)}else if(o!==e){let s=0;switch(o){case"%":s=25;break;case"deg":s=90}if(s){let i=parseFloat(e.slice(0,e.length-o.length));return isNaN(i)?0:(i=i/s,i%1===0?r(i):0)}}return t}function c6(e,t){let o=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)o+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+o+">"+e+"</svg>"}function a6(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function d6(e){return"data:image/svg+xml,"+a6(e)}function u6(e){return'url("'+d6(e)+'")'}let q1;function C6(){try{q1=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{q1=null}}function p6(e){return q1===void 0&&C6(),q1?q1.createHTML(e):e}const s4={...Xe,inline:!1},f6={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},h6={display:"inline-block"},F2={backgroundColor:"currentColor"},l4={backgroundColor:"transparent"},ne={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},re={WebkitMask:F2,mask:F2,background:l4};for(const e in re){const t=re[e];for(const o in ne)t[e+o]=ne[o]}const x6={...s4,inline:!0};function se(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const g6=(e,t,o,r)=>{const s=o?x6:s4,i=r6(s,t),c=t.mode||"svg",a={},d=t.style||{},C={...c==="svg"?f6:{},ref:r};for(let j in t){const L=t[j];if(L!==void 0)switch(j){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":i[j]=L===!0||L==="true"||L===1;break;case"flip":typeof L=="string"&&l6(i,L);break;case"color":a.color=L;break;case"rotate":typeof L=="string"?i[j]=i6(L):typeof L=="number"&&(i[j]=L);break;case"ariaHidden":case"aria-hidden":L!==!0&&L!=="true"&&delete C["aria-hidden"];break;default:s[j]===void 0&&(C[j]=L)}}const f=k8(e,i),x=f.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),c==="svg"){C.style={...a,...d},Object.assign(C,x);let j=0,L=t.id;return typeof L=="string"&&(L=L.replace(/-/g,"_")),C.dangerouslySetInnerHTML={__html:p6(P8(f.body,L?()=>L+"ID"+j++:"iconifyReact"))},v1.createElement("svg",C)}const{body:b,width:u,height:p}=e,g=c==="mask"||(c==="bg"?!1:b.indexOf("currentColor")!==-1),y=c6(b,{...x,width:u+"",height:p+""});return C.style={...a,"--svg":u6(y),width:se(x.width),height:se(x.height),...h6,...g?F2:l4,...d},v1.createElement("span",C)};Ke(!0);Z8("",$8);if(typeof document<"u"&&typeof window<"u"){r4();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,o="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!V8(r))&&console.error(o)}catch{console.error(o)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let o in t){const r="IconifyProviders["+o+"] is invalid.";try{const s=t[o];if(typeof s!="object"||!s||s.resources===void 0)continue;D8(o,s)||console.error(r)}catch{console.error(r)}}}}class i4 extends v1.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const o=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||o.icon===null)&&this._setData({data:r});return}let s;if(typeof r!="string"||(s=j2(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const i=v8(s);if(!i){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),i!==null&&(this._loading={name:r,abort:n6([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||o.icon===null){this._abortLoading(),this._icon=r;const c=["iconify"];s.prefix!==""&&c.push("iconify--"+s.prefix),s.provider!==""&&c.push("iconify--"+s.provider),this._setData({data:i,classes:c}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,o=this.state.icon;if(o===null)return t.children?t.children:v1.createElement("span",{});let r=t;return o.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+o.classes.join(" ")}),g6({...h3,...o.data},r,t._inline,t._ref)}}const m6=v1.forwardRef(function(t,o){const r={...t,_ref:o,_inline:!1};return v1.createElement(i4,r)});v1.forwardRef(function(t,o){const r={...t,_ref:o,_inline:!0};return v1.createElement(i4,r)});var b6=m6;const L6=e=>{const t=e.includes("youtube.com")||e.includes("youtu.be"),o=e.includes("vimeo.com");return t||o};function w2({url:e,style:t,controls:o,modestbranding:r}){var a;const{t:s}=n1(),i=e.includes("youtube.com")||e.includes("youtu.be"),c=e.includes("vimeo.com");if(i){const d=((a=e.split("v=")[1])==null?void 0:a.split("&")[0])||e.split("/").pop();return n.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(t==null?void 0:t.pointerEvents)||"auto"},children:n.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${o}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...t},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(c){const d=e.split("/").pop();return n.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:t.pointerEvents||"auto"},children:n.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...t},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return n.jsx(m,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:n.jsxs(m,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...t},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[n.jsx(b6,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),n.jsx(z,{variant:"body1",sx:{opacity:.5},children:s("studio.videoDialogNoSrc")})]})})}w2.propTypes={url:h.string.isRequired,style:h.object,controls:h.number,modestbranding:h.number};w2.defaultProps={style:{},controls:1,modestbranding:1};function c4({setParams:e,onClose:t,params:o}){const{t:r}=n1(),[s,i]=V.useState(""),c=s&&o.blockletVideos.includes(s),a=L6(s),d=()=>{e(C=>{const f=[...C.blockletVideos];return f.push(s),{...C,blockletVideos:f}}),t()};return n.jsxs(Le,{open:!0,fullWidth:!0,maxWidth:"sm",children:[n.jsx(l5,{children:r("studio.videoDialogTitle")}),n.jsxs(T4,{children:[n.jsx(i5,{fullWidth:!0,value:s,onChange:C=>i(C.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:s?n.jsx(L2,{position:"end",children:n.jsx(a1,{onClick:()=>i(""),children:n.jsx(s5,{})})}):null,error:c}),c&&n.jsx(z,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),n.jsx(w2,{url:s,style:{marginTop:"20px",borderRadius:"4px"}})]}),n.jsxs(_4,{children:[n.jsx(i1,{onClick:()=>t(),children:r("studio.cancel")}),n.jsx(i1,{disabled:!a||c,onClick:d,children:r("studio.confirm")})]})]})}c4.propTypes={onClose:h.func.isRequired,params:h.object.isRequired,setParams:h.func.isRequired};const le=V.lazy(()=>je(()=>import("./index-JdqBLsAB.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58])).then(e=>({default:e.Uploader})));function a4({projectId:e,readOnly:t,loading:o,blocklet:r,params:s,setParams:i,paramsErrTip:c,setParamsErrTip:a,setLoading:d,initUrl:C,initLogoUrl:f,setInitLogoUrl:x,componentDid:b}){const{t:u}=n1(),{api:p}=H1(),g=U2(),y=V.useRef(null),j=V.useRef(null),[L,R]=C8(r),[M,k]=V.useState(!1),H=t5({messageType:"connect-store-message",onOpen:()=>d(!0),onClose:()=>d(!1)}),I=async Z=>{const E=setTimeout(()=>{d(!1)},2e4),B=await f8(p,Z);d(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},D=()=>{if(!s.blockletTitle){F.error(u("blocklet.publish.errorTip.noTitle"));return}if(!(L!=null&&L.url)){F.error(u("blocklet.publish.noStoreSelected"));return}const Z=p8();H(async(E,B)=>{var W,Q,t1;try{const J=await p.connectByStudio({input:{did:(W=r==null?void 0:r.meta)==null?void 0:W.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:L.url,storeId:L.id,storeName:L.name,type:((Q=s==null?void 0:s.blockletComponents)==null?void 0:Q.length)>0?"pack":"resource",componentDid:b,messageId:Z,tenantScope:(C==null?void 0:C.searchParams.get("tenantScope"))||""}});if(!(J!=null&&J.url)){F.error("failed to connect to store");return}B(J.url),I({did:(t1=r==null?void 0:r.meta)==null?void 0:t1.did,projectId:"",messageId:Z})}catch(J){const Y=_1(J);F.error(Y),d(!1)}})},T=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/logo/upload`,S=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${e}/screenshot/upload`,P=s!=null&&s.blockletLogo?`${T}/${s.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,_=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(Z=>`${S}/${Z}`),U=()=>t?!1:!e||e===X.UNOWNED_DID?(F.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,K=Z=>{if(!Z.destination)return;const E=Array.from(s.blockletScreenshots),[B]=E.splice(Z.source.index,1);E.splice(Z.destination.index,0,B),i(W=>({...W,blockletScreenshots:E}))},G=Z=>{if(!Z.destination)return;const E=Array.from(s.blockletVideos),[B]=E.splice(Z.source.index,1);E.splice(Z.destination.index,0,B),i(W=>({...W,blockletVideos:E}))};return n.jsxs(j6,{children:[n.jsx(m,{display:"flex",className:"section",children:n.jsxs(m,{sx:{flex:1},children:[n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.title")}`,placeholder:`Blocklet ${u("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:s.blockletTitle||"",onChange:Z=>{a({blockletTitle:""}),i({blockletTitle:Z.target.value})},error:!!c.blockletTitle,helperText:c.blockletTitle||""}),n.jsx(h1,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&n.jsx(L2,{position:"end",children:n.jsx(f3,{blocklet:r,store:L,componentDid:b,onChangeStore:R,disabled:!s.blockletTitle||t||o,loading:o,onClick:D})})},error:!!c.projectId,helperText:c.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.description")}`,placeholder:`Blocklet ${u("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletDescription||"",onChange:Z=>{a({blockletDescription:""}),i({blockletDescription:Z.target.value})},error:!!c.blockletDescription,helperText:c.blockletDescription||"",sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.homepage")}`,placeholder:`Blocklet ${u("common.homepage")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletHomepage||"",onChange:Z=>{Z.target.value&&!/^(http|https):\/\//.test(Z.target.value)?a({blockletHomepage:u("blocklet.publish.errorTip.invalidUrl")}):a({blockletHomepage:""}),i({blockletHomepage:Z.target.value})},error:!!c.blockletHomepage,helperText:c.blockletHomepage||"",sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.community")}`,placeholder:`Blocklet ${u("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletCommunity||"",onChange:Z=>{Z.target.value&&!/^(http|https):\/\//.test(Z.target.value)?a({blockletCommunity:u("blocklet.publish.errorTip.invalidUrl")}):a({blockletCommunity:""}),i({blockletCommunity:Z.target.value})},error:!!c.blockletCommunity,helperText:c.blockletCommunity||"",sx:{mt:3}}),n.jsx(h1,{disabled:o||t,label:`Blocklet ${u("common.support")}`,placeholder:`Blocklet ${u("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletSupport||"",onChange:Z=>{Z.target.value&&!/^(http|https):\/\//.test(Z.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(Z.target.value)?a({blockletSupport:u("blocklet.publish.errorTip.invalidUrlOrEmail")}):a({blockletSupport:""}),i({blockletSupport:Z.target.value})},error:!!c.blockletSupport,helperText:c.blockletSupport||"",sx:{mt:3}})]})}),n.jsx(m,{display:"flex",mt:3,className:"section full-width",children:n.jsxs(m,{sx:{flex:1},children:[n.jsxs(m,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(M1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(z,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.logo")}),n.jsxs(M1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.type"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),n.jsx(m,{sx:{flex:1,cursor:t?"default":"pointer",display:"flex",alignItems:"flex-end"},children:n.jsx(ye,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:f||P,onClick:()=>{var Z;U()&&((Z=y.current)==null||Z.open())}})})]}),n.jsxs(m,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(M1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(z,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.screenshot")}),n.jsxs(M1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(m,{sx:{border:"none"},variant:"outlined",size:"small",children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.count"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!t&&n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.order"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u("studio.orderTip")})]})})]})]}),n.jsx(Z3,{onDragEnd:t?void 0:K,children:n.jsx(D3,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(Z,E)=>n.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:E.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:E.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:Z.innerRef,...Z.droppableProps,children:[_.map((B,W)=>n.jsx(T3,{draggableId:B,index:W,isDragDisabled:t,children:(Q,t1)=>n.jsxs(m,{ref:Q.innerRef,...Q.draggableProps,className:"screenshot",sx:{transform:t1.isDragging?"scale(1.05)":"none",boxShadow:t1.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[n.jsx("img",{alt:"screenshot",src:B}),!t&&n.jsx(a1,{...Q.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:n.jsx(T2,{})}),!t&&n.jsx(a1,{className:"action",onClick:()=>{i(J=>{const Y=[...J.blockletScreenshots];return Y.splice(W,1),{...J,blockletScreenshots:Y}})},children:n.jsx(N3,{})})]})},B)),Z.placeholder,_.length<5&&n.jsx(m,{sx:{width:240,height:135,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var B;U()&&((B=j.current)==null||B.open())},children:"+"})]})})})]}),n.jsxs(m,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(M1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(z,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("studio.video")}),n.jsxs(M1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.videoType"),":"," "]}),n.jsxs(m,{component:"span",sx:{color:"#007ec6"},children:[n.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",n.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.count"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!t&&n.jsx(m,{children:n.jsxs(m,{component:"span",children:[n.jsxs(m,{component:"span",sx:{color:"#555"},children:[u("studio.order"),":"," "]}),n.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u("studio.orderTip")})]})})]})]}),n.jsx(Z3,{onDragEnd:t?void 0:G,children:n.jsx(D3,{droppableId:"videos",direction:"horizontal",isDropDisabled:t,children:(Z,E)=>n.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:E.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:E.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:Z.innerRef,...Z.droppableProps,children:[s.blockletVideos.map((B,W)=>n.jsx(T3,{draggableId:B,index:W,isDragDisabled:t,children:(Q,t1)=>n.jsxs(m,{ref:Q.innerRef,...Q.draggableProps,className:"screenshot",sx:{transform:t1.isDragging?"scale(1.05)":"none",boxShadow:t1.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[n.jsx(w2,{url:B,style:{pointerEvents:t1.isDragging?"none":"auto"}}),!t&&n.jsx(a1,{...Q.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:n.jsx(T2,{})}),!t&&n.jsx(a1,{className:"action",onClick:()=>{i(J=>{const Y=[...J.blockletVideos];return Y.splice(W,1),{...J,blockletVideos:Y}})},children:n.jsx(N3,{})})]})},B)),Z.placeholder,s.blockletVideos.length<3&&n.jsx(m,{sx:{width:240,height:135,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{U()&&k(!0)},children:"+"})]})})})]})]})}),n.jsxs(V.Suspense,{fallback:n.jsx(e2,{}),children:[n.jsx(le,{ref:y,popup:!0,onUploadFinish:Z=>{var E;i({blockletLogo:Z.data.filename}),x(""),(E=y.current)==null||E.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:T,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","application/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),M&&n.jsx(c4,{onClose:()=>k(!1),params:s,setParams:i}),n.jsx(le,{ref:j,popup:!0,onUploadFinish:Z=>{var E;i(B=>{var Q;const W=B.blockletScreenshots||[];return W.push((Q=Z.data)==null?void 0:Q.filename),{...B,blockletScreenshots:W}}),(E=j.current)==null||E.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-_.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}a4.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const j6=p1.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -181,7 +181,7 @@ import{az as w4,j as n,aM as d1,cX as Ce,aQ as $,fG as S3,aP as w1,aK as G1,aL a
|
|
|
181
181
|
padding-bottom: 12px;
|
|
182
182
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
183
183
|
}
|
|
184
|
-
`;function h4({text:e}){return e?n.jsx(d5,{wrapperElement:{"data-color-mode":"light"},source:u5.sanitize(e),rehypePlugins:[[C5,{target:"_blank"}]]}):n.jsx(P1,{Icon:t2})}h4.propTypes={text:h.string.isRequired};function x4({params:e,setParams:t,paramsErrTip:o,loading:r,setParamsErrTip:s,readOnly:i}){var f;const{t:c}=n1(),[a,d]=V.useState(i?"preview":"write"),C=(x,b)=>{d(b)};return n.jsxs(m,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[n.jsxs(m,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[n.jsx(z,{variant:"h6",fontWeight:"bold",sx:{},children:c("common.introduction")}),n.jsxs(z4,{value:a,onChange:C,"aria-label":"wrapped label tabs example",children:[n.jsx(_3,{value:"write",label:"Write"}),n.jsx(_3,{value:"preview",label:"Preview"})]})]}),n.jsx(m,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:n.jsx(h1,{disabled:r||i,sx:{border:"none"},placeholder:`Blocklet ${c("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:i,endAdornment:n.jsxs(L2,{position:"end",children:[((f=e==null?void 0:e.blockletIntroduction)==null?void 0:f.length)||0," / ",I1.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:x=>{s({blockletIntroduction:""}),t({blockletIntroduction:x.target.value.slice(0,I1.PROJECT.MAX_INTRO_LENGTH)})},error:!!o.blockletIntroduction,helperText:o.blockletIntroduction||""})}),n.jsx(m,{display:a==="preview"?"block":"none",mt:3,children:n.jsx(h4,{text:e.blockletIntroduction||""})})]})}x4.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var V3={},I6=y1;Object.defineProperty(V3,"__esModule",{value:!0});var g4=V3.default=void 0,P6=I6(V1()),ce=n;g4=V3.default=(0,P6.default)([(0,ce.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,ce.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function y3({step:e,ok:t,active:o,error:r}){let s="grey.500",i=e+1;return t&&(i=n.jsx(p5,{sx:{fontSize:18,margin:0},color:"white"})),r||!t&&o>e?(s="error.main",i=n.jsx(g4,{sx:{fontSize:18,margin:0},color:"white"})):o>=e&&(s="primary.main"),n.jsx(m,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:i})}y3.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};y3.defaultProps={step:0,ok:!1,active:0,error:""};function m4({steps:e,activeStep:t,setActiveStep:o,hasSelectedResources:r,params:s,loading:i,paramsErrTip:c,viewMode:a,projectId:d}){const{t:C}=n1(),f=()=>{o(p=>p+1)},x=()=>{o(p=>p-1)},b=p=>p===0?(c==null?void 0:c.blockletTitle)||(c==null?void 0:c.projectId)||(c==null?void 0:c.blockletDescription)||(c==null?void 0:c.blockletHomepage)||(c==null?void 0:c.blockletSupport)||(c==null?void 0:c.blockletCommunity):p===2?c==null?void 0:c.blockletResource:p>=4?(c==null?void 0:c.blockletVersion)||(c==null?void 0:c.note):"",u=a||u4({hasSelectedResources:r,params:s,projectId:d,t:C})===null;return n.jsxs(m,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[n.jsx(h5,{activeStep:t,orientation:"vertical",children:e.map((p,g)=>{const y={},j=i||!S6({hasSelectedResources:r,params:s,projectId:d,step:g,t:C}),L=i?"":b(g);return L&&(y.optional=n.jsx(z,{variant:"caption",color:"error",children:L}),y.error=!0),n.jsxs(x5,{children:[n.jsx(T5,{icon:n.jsx(y3,{error:L,active:u?99:t,step:g,ok:j}),sx:{cursor:"pointer",color:L?"error.main":"inherit"},disabled:!1,onClick:()=>o(g),...y,children:n.jsx(z,{fontSize:"14px",fontWeight:"500",color:L||!j&&t>g?"error.main":"inherit",children:p.label})}),n.jsxs($5,{children:[n.jsx(z,{fontSize:12,children:p.description}),!u&&n.jsx(m,{sx:{mb:2},children:n.jsxs("div",{children:[g<e.length-1&&n.jsx(i1,{variant:"contained",onClick:f,sx:{mt:1,mr:1},disabled:L||!j,children:C("common.continue")}),g>0&&n.jsx(i1,{disabled:g===0,onClick:x,sx:{mt:1,mr:1},children:C("common.back")})]})})]})]},p.label)})}),t>=e.length-1&&n.jsx(z2,{square:!0,elevation:0,sx:{p:3},children:n.jsx(z,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}m4.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string,blockletHomepage:h.string,blockletSupport:h.string,blockletCommunity:h.string}).isRequired};const Z6=[".zip",".gz"],D6=1024*1024*100,T6=V.lazy(()=>je(()=>import("./index-lJoTfApr.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58])).then(e=>({default:e.Uploader})));function H3({app:e,projectId:t,readOnly:o,params:r,setParams:s,setParamsErrTip:i,error:c}){const{t:a}=n1(),d=V.useRef(null),C=()=>o?!1:!t||t===X.UNOWNED_DID?(F.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,f=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return n.jsxs(m,{sx:{mt:3},children:[n.jsx(z,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),n.jsxs(M1,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:o?"default":"pointer"},children:[!!r.uploadedResource&&n.jsx(z,{component:"a",href:`${f}/params.uploadedResource`,children:r.uploadedResource}),!o&&n.jsx(i1,{variant:"outlined",size:"small",onClick:()=>{var x;C()&&((x=d.current)==null||x.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),n.jsx(V.Suspense,{fallback:n.jsx(e2,{}),children:n.jsx(T6,{ref:d,popup:!0,onUploadFinish:x=>{var b;s({uploadedResource:x.data.filename}),i({blockletResource:""}),(b=d.current)==null||b.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:f,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:Z6,maxFileSize:D6,maxNumberOfFiles:1}}},"uploader-resource")}),!!c&&n.jsx(m,{color:"error.main",mt:1,fontSize:14,children:c})]})}H3.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};H3.defaultProps={};function x2({readOnly:e,params:t,setParams:o,paramsErrTip:r,setParamsErrTip:s,loading:i}){var a;const{t:c}=n1();return n.jsx(m,{display:"flex",mt:3,className:"section",children:n.jsxs(m,{sx:{flex:1},children:[n.jsx(h1,{required:!0,disabled:i||e,label:`Blocklet ${c("common.version")}`,placeholder:`Blocklet ${c("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:d=>{s({blockletVersion:""}),o({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),n.jsx(h1,{label:c("blocklet.publish.releaseNote"),autoComplete:"off",disabled:i||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:n.jsxs(L2,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",I1.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:d=>{s({note:""}),o({note:d.target.value.slice(0,I1.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}x2.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};x2.defaultProps={};function b4(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&b4(e[t]);return e}const _6=({tabs:e,blocklet:t,ancestors:o=[]})=>{const r=t.meta.did;e.push({label:n.jsxs(m,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[n.jsx(X2,{size:24,blocklet:t,ancestors:o}),n.jsx(m,{ml:"4px",className:"text",children:n.jsx(m,{children:t.meta.title})})]},r),value:r})},ae=(e,t)=>{const o=q2(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletVideos","blockletScreenshots","blockletResourceType","blockletSupport","blockletHomepage","blockletCommunity","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return o.blockletComponents?o.blockletComponents=o.blockletComponents.map(r=>({...r,included:!0})):o.blockletComponents=(t.children||[]).map(r=>({did:r.meta.did,included:!1,required:!1})),o.resourceFromSelect=!o.uploadedResource,o},N6={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},de={branding:0,introduction:1,resources:2,blocklets:3,version:4};function R3({initUrl:e,...t}){var k3;const{projectId:o,mode:r,releaseId:s,componentDid:i=""}=m2(),{t:c}=n1(),{blocklet:a}=N1(),[d,C]=D1({blockletScreenshots:[],blockletVideos:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",blockletResourceType:"",blockletSupport:"",blockletCommunity:"",blockletHomepage:"",resourceFromSelect:!0}),[f,x]=D1({}),[b,u]=V.useState(!1),[p,g]=D1(null),{api:y}=H1(),j=Y1(N=>N.breakpoints.down("md")),[L,R]=V.useState({}),[M,k]=V.useState(!1),H=V.useRef({}),[I,D]=D1({}),[T,S]=V.useState(""),[P,_]=D1({}),U=e==null?void 0:e.searchParams.get("dependentComponentsMode"),K=U==="readonly",G=V.useMemo(()=>{const N={};return Object.keys(P).forEach(O=>{const S1=P[O];S1&&S1.forEach(v4=>{N[v4]=!0})}),N},[P]),Z=V.useCallback(N=>{K&&C({blockletComponents:[]}),_(N)},[K,_,C]),E=V.useCallback((...N)=>{D(...N),x({blockletResource:""})},[]),B=s==="none"?(d==null?void 0:d.lastReleaseId)||"":s,[W,Q]=V.useState(r==="new-release"?4:0);V.useEffect(()=>{o&&x({projectId:""})},[o,x]);const t1=V.useMemo(()=>{var N;return(d==null?void 0:d.blockletResourceType)==="resource"?"resource":(N=d==null?void 0:d.blockletComponents)!=null&&N.some(O=>O.included)||Object.keys(G).length||d!=null&&d.uploadedResource?"pack":"resource"},[d==null?void 0:d.blockletComponents,d==null?void 0:d.uploadedResource,G,d==null?void 0:d.blockletResourceType]),J=[],Y=((a==null?void 0:a.children)||[]).filter(N=>{var O;return(O=N.meta.resource)==null?void 0:O.exportApi}).filter(N=>!i||N.meta.did===i);Y.forEach(N=>{_6({tabs:J,blocklet:N,t:c,ancestors:[a]})});const[l1,m1]=V.useState((k3=J[0])==null?void 0:k3.value),u1=!M&&(p==null?void 0:p.status)==="published",r1=u1,R1=B4(()=>{if(!e)return;S(e.searchParams.get("logo")),C(O=>{var S1;return{...O,blockletTitle:(O==null?void 0:O.blockletTitle)||e.searchParams.get("title"),blockletDescription:(O==null?void 0:O.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(O==null?void 0:O.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(S1=O==null?void 0:O.blockletComponents)!=null&&S1.length?O==null?void 0:O.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(O==null?void 0:O.note)||e.searchParams.get("note")||"No note"}});const N=e.searchParams.get("resources");try{const O=JSON.parse(N);R(O)}catch{}}),o1=async()=>{if(B)try{const N=await y.getRelease({input:{did:a.meta.did,projectId:o,releaseId:B}});if(u(!1),!N.release){F.error("Release not found");return}N.release=b4(N.release),r!=="view"&&(N.release.note=""),C(O=>ae({...O,...N.release,blockletVersion:r==="create"||r==="new-release"?T1.inc(N.release.blockletVersion,"patch"):N.release.blockletVersion},a)),g(N.release)}catch(N){u(!1),F.error(_1(N))}},e1=async()=>{if(o===X.UNOWNED_DID){C({blockletVersion:"1.0.0",blockletTitle:""});return}if(!o){F.error(c("blocklet.publish.errorTip.noDid"));return}try{const O=(await y.getProject({input:{did:a.meta.did,projectId:o}})).project||{};O.blockletVersion?(r==="create"||r==="new-release")&&T1.valid(O.blockletVersion)&&(O.blockletVersion=T1.inc(O.blockletVersion,"patch")):O.blockletVersion="1.0.0";const S1=ae(O,a);C(S1),O.lastReleaseId||R1()}catch(N){F.error(_1(N))}},c1=V.useCallback(async()=>{u(!0);try{if(r==="view"){if(!B){F.error("Empty release id");return}await e1(),await o1();return}await e1(),B&&(k(!0),await o1())}finally{u(!1)}},[r,B]),A=N=>{C({blockletComponents:N})},o2=N=>{C({blockletResourceType:N})};V.useEffect(()=>{c1()},[c1]),V.useEffect(()=>{o===X.UNOWNED_DID&&(r==="create"||r==="new-release")&&e&&R1()},[o,e,r,R1]);const E1=V.useMemo(()=>!!Object.keys(I).find(N=>!!I[N].length),[I]);if(!d&&b)return n.jsx(e2,{});if(!d)return null;const O1=Y.find(N=>N.meta.did===l1);if(Y.every(N=>N.status!=="running")&&(Y!=null&&Y.length))return n.jsx(P1,{children:c("blocklet.publish.allComponentsNotRunning")});const n2=N=>{m1(N)},q=e==null?void 0:e.searchParams.get("resourcesTitle"),s1=e==null?void 0:e.searchParams.get("componentsTitle"),f1=[{label:c("blocklet.publish.branding"),description:c("blocklet.publish.steps.branding")},{label:c("common.introduction"),description:c("blocklet.publish.steps.introduction")},{label:q||c("blocklet.publish.resourceTitle"),description:c("blocklet.publish.steps.resources")},{label:s1||c("common.components"),description:c("blocklet.publish.steps.blocklets")},{label:c("blocklet.publish.versionTitle"),description:c("blocklet.publish.steps.version")}],j4=f1[W]||f1[f1.length-1],k1=N6[W];return n.jsxs(B6,{...t,children:[n.jsx(f4,{blocklet:a,release:p,getData:c1,getRelease:o1,mode:r,params:d,setParams:C,setParamsErrTip:x,readOnly:r1,isPublished:u1,loading:b,setLoading:u,initLogoUrl:T,releaseId:B,projectId:o,projectType:t1,resourceComponents:Y,resourceComponentsMap:P,resourceRelateComponents:G,resourceItem:O1,saveSelectedEventsRef:H,hasSelectedResources:E1,releaseUsedLast:M,setReleaseUsedLast:k,setRelease:g,paramsErrTip:f}),n.jsxs(m,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[n.jsx(m,{pt:3}),n.jsxs(m,{sx:{gap:3},display:"flex",flexDirection:j?"column":"row",children:[!j&&n.jsx(m4,{steps:f1,loading:b,viewMode:r==="view",params:d,hasSelectedResources:E1||d.uploadedResource,paramsErrTip:f,activeStep:W,setActiveStep:Q,projectId:o,resourcesUrlTitle:q,componentsUrlTitle:s1}),n.jsxs(m,{flex:"1",maxWidth:"720px",children:[!j&&k1!=="introduction"&&n.jsxs(z,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[j4.label,k1==="branding"&&n.jsx(L1,{title:c("blocklet.publish.brandingHelp"),placement:"right",children:n.jsx(m,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:n.jsx(q4,{})})})]}),(j||k1==="branding")&&n.jsx(m,{flexDirection:"column",children:n.jsx(a4,{projectId:o,setParams:C,setParamsErrTip:x,params:d,componentDid:i,blocklet:a,initUrl:e,loading:b,setLoading:u,paramsErrTip:f,readOnly:r1,initLogoUrl:T,setInitLogoUrl:S})}),j&&n.jsx(m,{flexDirection:"column",children:n.jsx(x2,{loading:b,params:d,paramsErrTip:f,setParams:C,setParamsErrTip:x,readOnly:r1})}),(j||k1==="introduction")&&n.jsx(m,{display:"flex",flexDirection:"column",sx:{mt:j?5:0,width:"100%"},children:n.jsx(x4,{loading:b,readOnly:r1,params:d,setParams:C,paramsErrTip:f,setParamsErrTip:x})}),j&&n.jsx(z,{variant:"h6",fontWeight:"bold",mt:5,children:f1[de.resources].label}),n.jsx(m,{display:j||k1==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:n.jsx(m,{display:"flex",mt:3,className:"section full-width",children:n.jsxs(m,{sx:{flex:1},children:[n.jsxs(g5,{onChange:()=>C({resourceFromSelect:!d.resourceFromSelect}),children:[n.jsx(I2,{value:"select",disabled:r1,control:n.jsx(E3,{size:"small",checked:d.resourceFromSelect}),label:c("blocklet.publish.resourceSelect")}),n.jsx(I2,{value:"select",disabled:r1,control:n.jsx(E3,{size:"small",checked:!d.resourceFromSelect}),label:c("blocklet.publish.resourceUpload")})]}),d.resourceFromSelect&&n.jsxs(n.Fragment,{children:[!i&&n.jsx(W4,{tabs:J,current:l1,onChange:n2,sx:{ml:-2,mt:2,maxWidth:j?window.innerWidth-24:"100%"}}),n.jsx(C3,{loading:b,initialResources:L,saveSelectedEventsRef:H,selectedResourceIds:I,setSelectedResourceIds:E,setResourceComponentsMap:Z,error:f.blockletResource,app:a,readOnly:r1,component:O1,componentDid:i,initUrl:e,params:d,setParams:C,projectId:o===X.UNOWNED_DID?"":o,releaseUsedLast:M,release:{...p,id:B}})]}),!d.resourceFromSelect&&n.jsx(H3,{app:a,readOnly:r1,projectId:o===X.UNOWNED_DID?"":o,params:d,error:f.blockletResource,setParams:C,setParamsErrTip:x})]})})}),j&&n.jsx(z,{variant:"h6",fontWeight:"bold",mt:5,children:f1[de.blocklets].label}),(j||k1==="blocklets")&&n.jsx(m,{flexDirection:"column",children:n.jsx(m,{display:"flex",mt:3,className:"section full-width",children:n.jsx(m,{sx:{flex:1},children:n.jsx(s3,{projectType:t1,disabled:b||r1,app:a,value:(d==null?void 0:d.blockletComponents)||[],blockletResourceType:(d==null?void 0:d.blockletResourceType)||"",onChange:A,onChangeBlockletResourceType:o2,resourceRelateComponents:G,dependentComponentsMode:U})})})}),!j&&k1==="version"&&n.jsx(m,{flexDirection:"column",children:n.jsx(x2,{loading:b,params:d,paramsErrTip:f,setParams:C,setParamsErrTip:x,readOnly:r1})})]})]})]})]})}R3.propTypes={initUrl:h.object};R3.defaultProps={initUrl:null};const B6=p1.div`
|
|
184
|
+
`;function h4({text:e}){return e?n.jsx(d5,{wrapperElement:{"data-color-mode":"light"},source:u5.sanitize(e),rehypePlugins:[[C5,{target:"_blank"}]]}):n.jsx(P1,{Icon:t2})}h4.propTypes={text:h.string.isRequired};function x4({params:e,setParams:t,paramsErrTip:o,loading:r,setParamsErrTip:s,readOnly:i}){var f;const{t:c}=n1(),[a,d]=V.useState(i?"preview":"write"),C=(x,b)=>{d(b)};return n.jsxs(m,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[n.jsxs(m,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[n.jsx(z,{variant:"h6",fontWeight:"bold",sx:{},children:c("common.introduction")}),n.jsxs(z4,{value:a,onChange:C,"aria-label":"wrapped label tabs example",children:[n.jsx(_3,{value:"write",label:"Write"}),n.jsx(_3,{value:"preview",label:"Preview"})]})]}),n.jsx(m,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:n.jsx(h1,{disabled:r||i,sx:{border:"none"},placeholder:`Blocklet ${c("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:i,endAdornment:n.jsxs(L2,{position:"end",children:[((f=e==null?void 0:e.blockletIntroduction)==null?void 0:f.length)||0," / ",I1.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:x=>{s({blockletIntroduction:""}),t({blockletIntroduction:x.target.value.slice(0,I1.PROJECT.MAX_INTRO_LENGTH)})},error:!!o.blockletIntroduction,helperText:o.blockletIntroduction||""})}),n.jsx(m,{display:a==="preview"?"block":"none",mt:3,children:n.jsx(h4,{text:e.blockletIntroduction||""})})]})}x4.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var V3={},I6=y1;Object.defineProperty(V3,"__esModule",{value:!0});var g4=V3.default=void 0,P6=I6(V1()),ce=n;g4=V3.default=(0,P6.default)([(0,ce.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,ce.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function y3({step:e,ok:t,active:o,error:r}){let s="grey.500",i=e+1;return t&&(i=n.jsx(p5,{sx:{fontSize:18,margin:0},color:"white"})),r||!t&&o>e?(s="error.main",i=n.jsx(g4,{sx:{fontSize:18,margin:0},color:"white"})):o>=e&&(s="primary.main"),n.jsx(m,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:i})}y3.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};y3.defaultProps={step:0,ok:!1,active:0,error:""};function m4({steps:e,activeStep:t,setActiveStep:o,hasSelectedResources:r,params:s,loading:i,paramsErrTip:c,viewMode:a,projectId:d}){const{t:C}=n1(),f=()=>{o(p=>p+1)},x=()=>{o(p=>p-1)},b=p=>p===0?(c==null?void 0:c.blockletTitle)||(c==null?void 0:c.projectId)||(c==null?void 0:c.blockletDescription)||(c==null?void 0:c.blockletHomepage)||(c==null?void 0:c.blockletSupport)||(c==null?void 0:c.blockletCommunity):p===2?c==null?void 0:c.blockletResource:p>=4?(c==null?void 0:c.blockletVersion)||(c==null?void 0:c.note):"",u=a||u4({hasSelectedResources:r,params:s,projectId:d,t:C})===null;return n.jsxs(m,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[n.jsx(h5,{activeStep:t,orientation:"vertical",children:e.map((p,g)=>{const y={},j=i||!S6({hasSelectedResources:r,params:s,projectId:d,step:g,t:C}),L=i?"":b(g);return L&&(y.optional=n.jsx(z,{variant:"caption",color:"error",children:L}),y.error=!0),n.jsxs(x5,{children:[n.jsx(T5,{icon:n.jsx(y3,{error:L,active:u?99:t,step:g,ok:j}),sx:{cursor:"pointer",color:L?"error.main":"inherit"},disabled:!1,onClick:()=>o(g),...y,children:n.jsx(z,{fontSize:"14px",fontWeight:"500",color:L||!j&&t>g?"error.main":"inherit",children:p.label})}),n.jsxs($5,{children:[n.jsx(z,{fontSize:12,children:p.description}),!u&&n.jsx(m,{sx:{mb:2},children:n.jsxs("div",{children:[g<e.length-1&&n.jsx(i1,{variant:"contained",onClick:f,sx:{mt:1,mr:1},disabled:L||!j,children:C("common.continue")}),g>0&&n.jsx(i1,{disabled:g===0,onClick:x,sx:{mt:1,mr:1},children:C("common.back")})]})})]})]},p.label)})}),t>=e.length-1&&n.jsx(z2,{square:!0,elevation:0,sx:{p:3},children:n.jsx(z,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}m4.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string,blockletHomepage:h.string,blockletSupport:h.string,blockletCommunity:h.string}).isRequired};const Z6=[".zip",".gz"],D6=1024*1024*100,T6=V.lazy(()=>je(()=>import("./index-JdqBLsAB.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58])).then(e=>({default:e.Uploader})));function H3({app:e,projectId:t,readOnly:o,params:r,setParams:s,setParamsErrTip:i,error:c}){const{t:a}=n1(),d=V.useRef(null),C=()=>o?!1:!t||t===X.UNOWNED_DID?(F.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,f=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return n.jsxs(m,{sx:{mt:3},children:[n.jsx(z,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),n.jsxs(M1,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:o?"default":"pointer"},children:[!!r.uploadedResource&&n.jsx(z,{component:"a",href:`${f}/params.uploadedResource`,children:r.uploadedResource}),!o&&n.jsx(i1,{variant:"outlined",size:"small",onClick:()=>{var x;C()&&((x=d.current)==null||x.open())},children:r.uploadedResource?a("common.change"):a("common.upload")})]}),n.jsx(V.Suspense,{fallback:n.jsx(e2,{}),children:n.jsx(T6,{ref:d,popup:!0,onUploadFinish:x=>{var b;s({uploadedResource:x.data.filename}),i({blockletResource:""}),(b=d.current)==null||b.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:f,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:Z6,maxFileSize:D6,maxNumberOfFiles:1}}},"uploader-resource")}),!!c&&n.jsx(m,{color:"error.main",mt:1,fontSize:14,children:c})]})}H3.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};H3.defaultProps={};function x2({readOnly:e,params:t,setParams:o,paramsErrTip:r,setParamsErrTip:s,loading:i}){var a;const{t:c}=n1();return n.jsx(m,{display:"flex",mt:3,className:"section",children:n.jsxs(m,{sx:{flex:1},children:[n.jsx(h1,{required:!0,disabled:i||e,label:`Blocklet ${c("common.version")}`,placeholder:`Blocklet ${c("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:d=>{s({blockletVersion:""}),o({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||""}),n.jsx(h1,{label:c("blocklet.publish.releaseNote"),autoComplete:"off",disabled:i||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:n.jsxs(L2,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",I1.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:d=>{s({note:""}),o({note:d.target.value.slice(0,I1.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3}})]})})}x2.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};x2.defaultProps={};function b4(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&b4(e[t]);return e}const _6=({tabs:e,blocklet:t,ancestors:o=[]})=>{const r=t.meta.did;e.push({label:n.jsxs(m,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[n.jsx(X2,{size:24,blocklet:t,ancestors:o}),n.jsx(m,{ml:"4px",className:"text",children:n.jsx(m,{children:t.meta.title})})]},r),value:r})},ae=(e,t)=>{const o=q2(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletVideos","blockletScreenshots","blockletResourceType","blockletSupport","blockletHomepage","blockletCommunity","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return o.blockletComponents?o.blockletComponents=o.blockletComponents.map(r=>({...r,included:!0})):o.blockletComponents=(t.children||[]).map(r=>({did:r.meta.did,included:!1,required:!1})),o.resourceFromSelect=!o.uploadedResource,o},N6={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},de={branding:0,introduction:1,resources:2,blocklets:3,version:4};function R3({initUrl:e,...t}){var k3;const{projectId:o,mode:r,releaseId:s,componentDid:i=""}=m2(),{t:c}=n1(),{blocklet:a}=N1(),[d,C]=D1({blockletScreenshots:[],blockletVideos:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",blockletResourceType:"",blockletSupport:"",blockletCommunity:"",blockletHomepage:"",resourceFromSelect:!0}),[f,x]=D1({}),[b,u]=V.useState(!1),[p,g]=D1(null),{api:y}=H1(),j=Y1(N=>N.breakpoints.down("md")),[L,R]=V.useState({}),[M,k]=V.useState(!1),H=V.useRef({}),[I,D]=D1({}),[T,S]=V.useState(""),[P,_]=D1({}),U=e==null?void 0:e.searchParams.get("dependentComponentsMode"),K=U==="readonly",G=V.useMemo(()=>{const N={};return Object.keys(P).forEach(O=>{const S1=P[O];S1&&S1.forEach(v4=>{N[v4]=!0})}),N},[P]),Z=V.useCallback(N=>{K&&C({blockletComponents:[]}),_(N)},[K,_,C]),E=V.useCallback((...N)=>{D(...N),x({blockletResource:""})},[]),B=s==="none"?(d==null?void 0:d.lastReleaseId)||"":s,[W,Q]=V.useState(r==="new-release"?4:0);V.useEffect(()=>{o&&x({projectId:""})},[o,x]);const t1=V.useMemo(()=>{var N;return(d==null?void 0:d.blockletResourceType)==="resource"?"resource":(N=d==null?void 0:d.blockletComponents)!=null&&N.some(O=>O.included)||Object.keys(G).length||d!=null&&d.uploadedResource?"pack":"resource"},[d==null?void 0:d.blockletComponents,d==null?void 0:d.uploadedResource,G,d==null?void 0:d.blockletResourceType]),J=[],Y=((a==null?void 0:a.children)||[]).filter(N=>{var O;return(O=N.meta.resource)==null?void 0:O.exportApi}).filter(N=>!i||N.meta.did===i);Y.forEach(N=>{_6({tabs:J,blocklet:N,t:c,ancestors:[a]})});const[l1,m1]=V.useState((k3=J[0])==null?void 0:k3.value),u1=!M&&(p==null?void 0:p.status)==="published",r1=u1,R1=B4(()=>{if(!e)return;S(e.searchParams.get("logo")),C(O=>{var S1;return{...O,blockletTitle:(O==null?void 0:O.blockletTitle)||e.searchParams.get("title"),blockletDescription:(O==null?void 0:O.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(O==null?void 0:O.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(S1=O==null?void 0:O.blockletComponents)!=null&&S1.length?O==null?void 0:O.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(O==null?void 0:O.note)||e.searchParams.get("note")||"No note"}});const N=e.searchParams.get("resources");try{const O=JSON.parse(N);R(O)}catch{}}),o1=async()=>{if(B)try{const N=await y.getRelease({input:{did:a.meta.did,projectId:o,releaseId:B}});if(u(!1),!N.release){F.error("Release not found");return}N.release=b4(N.release),r!=="view"&&(N.release.note=""),C(O=>ae({...O,...N.release,blockletVersion:r==="create"||r==="new-release"?T1.inc(N.release.blockletVersion,"patch"):N.release.blockletVersion},a)),g(N.release)}catch(N){u(!1),F.error(_1(N))}},e1=async()=>{if(o===X.UNOWNED_DID){C({blockletVersion:"1.0.0",blockletTitle:""});return}if(!o){F.error(c("blocklet.publish.errorTip.noDid"));return}try{const O=(await y.getProject({input:{did:a.meta.did,projectId:o}})).project||{};O.blockletVersion?(r==="create"||r==="new-release")&&T1.valid(O.blockletVersion)&&(O.blockletVersion=T1.inc(O.blockletVersion,"patch")):O.blockletVersion="1.0.0";const S1=ae(O,a);C(S1),O.lastReleaseId||R1()}catch(N){F.error(_1(N))}},c1=V.useCallback(async()=>{u(!0);try{if(r==="view"){if(!B){F.error("Empty release id");return}await e1(),await o1();return}await e1(),B&&(k(!0),await o1())}finally{u(!1)}},[r,B]),A=N=>{C({blockletComponents:N})},o2=N=>{C({blockletResourceType:N})};V.useEffect(()=>{c1()},[c1]),V.useEffect(()=>{o===X.UNOWNED_DID&&(r==="create"||r==="new-release")&&e&&R1()},[o,e,r,R1]);const E1=V.useMemo(()=>!!Object.keys(I).find(N=>!!I[N].length),[I]);if(!d&&b)return n.jsx(e2,{});if(!d)return null;const O1=Y.find(N=>N.meta.did===l1);if(Y.every(N=>N.status!=="running")&&(Y!=null&&Y.length))return n.jsx(P1,{children:c("blocklet.publish.allComponentsNotRunning")});const n2=N=>{m1(N)},q=e==null?void 0:e.searchParams.get("resourcesTitle"),s1=e==null?void 0:e.searchParams.get("componentsTitle"),f1=[{label:c("blocklet.publish.branding"),description:c("blocklet.publish.steps.branding")},{label:c("common.introduction"),description:c("blocklet.publish.steps.introduction")},{label:q||c("blocklet.publish.resourceTitle"),description:c("blocklet.publish.steps.resources")},{label:s1||c("common.components"),description:c("blocklet.publish.steps.blocklets")},{label:c("blocklet.publish.versionTitle"),description:c("blocklet.publish.steps.version")}],j4=f1[W]||f1[f1.length-1],k1=N6[W];return n.jsxs(B6,{...t,children:[n.jsx(f4,{blocklet:a,release:p,getData:c1,getRelease:o1,mode:r,params:d,setParams:C,setParamsErrTip:x,readOnly:r1,isPublished:u1,loading:b,setLoading:u,initLogoUrl:T,releaseId:B,projectId:o,projectType:t1,resourceComponents:Y,resourceComponentsMap:P,resourceRelateComponents:G,resourceItem:O1,saveSelectedEventsRef:H,hasSelectedResources:E1,releaseUsedLast:M,setReleaseUsedLast:k,setRelease:g,paramsErrTip:f}),n.jsxs(m,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[n.jsx(m,{pt:3}),n.jsxs(m,{sx:{gap:3},display:"flex",flexDirection:j?"column":"row",children:[!j&&n.jsx(m4,{steps:f1,loading:b,viewMode:r==="view",params:d,hasSelectedResources:E1||d.uploadedResource,paramsErrTip:f,activeStep:W,setActiveStep:Q,projectId:o,resourcesUrlTitle:q,componentsUrlTitle:s1}),n.jsxs(m,{flex:"1",maxWidth:"720px",children:[!j&&k1!=="introduction"&&n.jsxs(z,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[j4.label,k1==="branding"&&n.jsx(L1,{title:c("blocklet.publish.brandingHelp"),placement:"right",children:n.jsx(m,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:n.jsx(q4,{})})})]}),(j||k1==="branding")&&n.jsx(m,{flexDirection:"column",children:n.jsx(a4,{projectId:o,setParams:C,setParamsErrTip:x,params:d,componentDid:i,blocklet:a,initUrl:e,loading:b,setLoading:u,paramsErrTip:f,readOnly:r1,initLogoUrl:T,setInitLogoUrl:S})}),j&&n.jsx(m,{flexDirection:"column",children:n.jsx(x2,{loading:b,params:d,paramsErrTip:f,setParams:C,setParamsErrTip:x,readOnly:r1})}),(j||k1==="introduction")&&n.jsx(m,{display:"flex",flexDirection:"column",sx:{mt:j?5:0,width:"100%"},children:n.jsx(x4,{loading:b,readOnly:r1,params:d,setParams:C,paramsErrTip:f,setParamsErrTip:x})}),j&&n.jsx(z,{variant:"h6",fontWeight:"bold",mt:5,children:f1[de.resources].label}),n.jsx(m,{display:j||k1==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:n.jsx(m,{display:"flex",mt:3,className:"section full-width",children:n.jsxs(m,{sx:{flex:1},children:[n.jsxs(g5,{onChange:()=>C({resourceFromSelect:!d.resourceFromSelect}),children:[n.jsx(I2,{value:"select",disabled:r1,control:n.jsx(E3,{size:"small",checked:d.resourceFromSelect}),label:c("blocklet.publish.resourceSelect")}),n.jsx(I2,{value:"select",disabled:r1,control:n.jsx(E3,{size:"small",checked:!d.resourceFromSelect}),label:c("blocklet.publish.resourceUpload")})]}),d.resourceFromSelect&&n.jsxs(n.Fragment,{children:[!i&&n.jsx(W4,{tabs:J,current:l1,onChange:n2,sx:{ml:-2,mt:2,maxWidth:j?window.innerWidth-24:"100%"}}),n.jsx(C3,{loading:b,initialResources:L,saveSelectedEventsRef:H,selectedResourceIds:I,setSelectedResourceIds:E,setResourceComponentsMap:Z,error:f.blockletResource,app:a,readOnly:r1,component:O1,componentDid:i,initUrl:e,params:d,setParams:C,projectId:o===X.UNOWNED_DID?"":o,releaseUsedLast:M,release:{...p,id:B}})]}),!d.resourceFromSelect&&n.jsx(H3,{app:a,readOnly:r1,projectId:o===X.UNOWNED_DID?"":o,params:d,error:f.blockletResource,setParams:C,setParamsErrTip:x})]})})}),j&&n.jsx(z,{variant:"h6",fontWeight:"bold",mt:5,children:f1[de.blocklets].label}),(j||k1==="blocklets")&&n.jsx(m,{flexDirection:"column",children:n.jsx(m,{display:"flex",mt:3,className:"section full-width",children:n.jsx(m,{sx:{flex:1},children:n.jsx(s3,{projectType:t1,disabled:b||r1,app:a,value:(d==null?void 0:d.blockletComponents)||[],blockletResourceType:(d==null?void 0:d.blockletResourceType)||"",onChange:A,onChangeBlockletResourceType:o2,resourceRelateComponents:G,dependentComponentsMode:U})})})}),!j&&k1==="version"&&n.jsx(m,{flexDirection:"column",children:n.jsx(x2,{loading:b,params:d,paramsErrTip:f,setParams:C,setParamsErrTip:x,readOnly:r1})})]})]})]})]})}R3.propTypes={initUrl:h.object};R3.defaultProps={initUrl:null};const B6=p1.div`
|
|
185
185
|
.section {
|
|
186
186
|
&.full-width {
|
|
187
187
|
max-width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as A,j as t,P as i,bc as Z,a4 as g,a5 as z,ai as U,cM as Y,n as S,cN as W,cJ as G,cO as V,cP as q,cQ as _,T as ee,C as te}from"./index-
|
|
1
|
+
import{r as A,j as t,P as i,bc as Z,a4 as g,a5 as z,ai as U,cM as Y,n as S,cN as W,cJ as G,cO as V,cP as q,cQ as _,T as ee,C as te}from"./index-DFFp-KRY.js";import{j as ie}from"./url-join-D30P1Ce3.js";import{S as j}from"./Skeleton-CGO11W5Q.js";import{H as ne}from"./Hidden-BwfHTnYp.js";const H=A.createContext(),{Provider:oe}=H,N=(e,o,a=window.location.pathname.replace(/\/$/,"/"))=>e?o?e===a:new RegExp(e).test(a):!1;function P({children:e,steps:o,mode:a}){const[h,m]=A.useState("");!h&&o.length&&m(o[0].key);const p=o.map(n=>n.children?[{key:n.key,hasChild:!0},n.children.map(c=>({parentKey:n.key,key:c.key}))]:{key:n.key}).flat(1/0),d=p.filter(n=>!n.hasChild),y=n=>{let c;const s=p.findIndex(l=>l.key===h?(c=l.parentKey,!0):!1);if(c===n)return"current";const f=p.findIndex(l=>l.key===n);if(f!==-1){if(f===s)return"current";if(f<s)return"before"}return"after"};function b(n){m(n)}function r(n){if(typeof n=="function"){const c=n(d.findIndex(s=>s.key===h));m(d[c].key)}else m(d[n].key)}const u=d.findIndex(n=>n.key===h);A.useEffect(()=>{if(a==="history"){let n="";o.some(c=>c.children&&c.children.length?c.children.some(s=>N(s.path,s.exact)?(n=s.key,!0):!1):N(c.path,c.exact)?(n=c.key,!0):!1),n&&m(n)}return()=>{}},[o,a]);const k={steps:o,totalStepsCount:d.length,getStepStatus:y,setActiveStepByKey:b,setActiveStepByIndex:r,activeStep:u,canBackToStep:n=>a==="memory"&&u!==0&&n<u};return t.jsx(oe,{value:k,children:e})}function D(){return A.useContext(H)}P.propTypes={children:i.any.isRequired,steps:i.array.isRequired,mode:i.string};P.defaultProps={mode:"history"};var se=Object.prototype.hasOwnProperty,ae=Object.prototype.toString;function re(e){if(e==null)return!0;if(typeof e=="boolean")return!1;if(typeof e=="number")return e===0;if(typeof e=="string"||typeof e=="function"||Array.isArray(e))return e.length===0;if(e instanceof Error)return e.message==="";if(e.toString==ae)switch(e.toString()){case"[object File]":case"[object Map]":case"[object Set]":return e.size===0;case"[object Object]":{for(var o in e)if(se.call(e,o))return!1;return!0}}return!1}var le=re;const ce=Z(le),pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAYAAADNkKWqAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1aSURBVHgB7d3ZjhxVEoDhxDKN902AUF/w/s/lCwthtXc3VsvyzETNJNOUe6kllzgnvk9KwVyMMNj5d2ZGRtUP//qPAaCgOwNAUQIIlCWAQFl3B5jJt2/fhvPz8+HDhw/DxcXF5n/fuXNnODk5GR4/fjzcv39/uHvXH0HW84MhCFOL0L1//35zxN9fJ+J379694cWLF0LIKgSQyewavqs8evRICFmcAHK0Y8K3LUL45MmTzZUhzE0AOdiU4dsWAYznhHHAXASQvX39+nUTvY8fP04evm1xS/z8+XMhZBYCyM5ikjuGb2ljCE2OmZIAcqsvX74Mb9682fx1bSbHTEkAuVam8F3F5JhjCSDfyR6+bSbHHEoA+Vtr4dtmcsy+BJDh06dPm3W1VsO3zeSYXQlgUeOeblzxxWstPTI55jYCWMycLy9nZXLMdQSwiIrhu4rJMZcJYOeE72omxwQB7FTG8MVnAWaLsMlxbQLYmSX3dHc1DiMePny4WaeLX9sa63Q3MTmuSQA7seae7nVuurqKUL99+zZtCE2OaxDAxmV8eXmcuO7yfG0M4V9//ZXqdRyT4xoEsFGth29bxG/8d8r2XqLJcb8EsDG9he8qsZmSNYQmx30RwEZUCN+2rCt6Jsf9EMDkMkYgroSePXu2+XrLJcS/u8kxcxDAhDLu6cY7fHGiP336dLVnYSbHTE0AE8n68nJEL474+wxMjpmKACYgfIcxOeZYArgi4ZuOyTGHEMAVCN98TI7ZhwAuKPuebsvh22ZyzC4EcAEZp5dVrkhMjrmJAM6o4svLWZkccxUBnIHw5WVyzGUCOCHha4vJMQI4AeFrm8lxXQJ4BHu6fTE5rkcAD5Dt1inDnm5PTI7rEMAdeXm5HpPj/gngLYQPk+N+CeA1hI+rmBz3RQC3CB+7MDnugwD+jz1dDmFy3LbyAbSnyxRMjttUNoBeXmYOJsdtKRdA4WMJJsdtKBNA4WMtJsd5dR9A4SMLk+N8ug2gPV2yMjnOo7sA2tOlFSbH6+sigF5epmUmx+tpOoDCR09MjpfXZACFj96ZHC+jqQAKH9WYHM+riQDa06U6k+N5pA6gPV34J5PjaaUMoJeX4WYmx9NIFUDhg/2YHB8nRQCFD45ncry/VQMofDA9k+PdrRJAe7owP5Pj2y0aQHu6sDyT4+vNHkAvL0MOJsffmzWAEb34Dy58kEfmyXFcEcaxlNkCGOGLIwPhg6tlnBzHc/jT09NFztVZApglfsIHu8k2mIxb4ojg3CYPYPwkefny5bAme7pwmEyT419++WX2SfHkATw7O9s8+1uDPV2YRobJ8RJXgZOPXGLCtDQvL8O04i4qrsDiTmqtyXFcjcYAdc67uMkDeHFxMSxF+GBeYwjXmhxHT+Y8v5t9QBY/FcQPlhEhfPDgQXePl5pdf4hL41evXpX8Kj9YUsZlhqk0v/8Vl+OvX7/ePKcQQphOxk9in1o3C7BCCNPI+ClNc+nuEwCEEA5TKXyjbj8CZTuEFb7lHg6R9fMDl9B9EcYQRvzGl6SFkOp6Hmzso0wJxjfb4+j1W+7hNsL3TyULEJf8cQghVVSY6B6i9JkvhPSu4mBjH874QQjpj/Dtxpl+yeUQZv0aP7hJ5YnuIQTwCmMIfdgCLTDYOFy6AP7+++9pvsEqforaNyarrOG7/Ensf/zxR+qr0XQB3P4csgwhtF1CJlknui1+BUXaW2AhhH/KOtiIczWiF+dDa19Bkf4ZoBBSXdbw9fCMvJkhyOUQjl/asvZX+dk3Zk5ZJ7o9DQebO1svDyQ+f/68eRaSJYT2jTlW5oluj6+HNXuWjs8d4sjy5c72jTlUCxPdHr9itouzM2ITR6Zvubddwi5MdNfV1VkphLTCRDeHLs9GISQrE91cuj4LxxBm+kNn37gmE92cSlyGxG/u6enp5g/fu3fvhvPz82Ft9o37Z6KbX6n7sPjN/u233/6e1to3Zg4muu0o+SDKdglzMNFtT+kn8ULIFEx022UUOQghhzHRbZ8AXmLfmF2Y6PbDmXQF+8ZsM9HtkzPoBvaNMdHtmzNnR7ZLajHRrcEZsych7JuJbi3OlAMJYV9MdGtyhhzJvnHbTHRrE8CJ2Dduh4kuIwGcmH3jvEx02SaAM7FdkoeJLtcRwJkJ4XpMdLmNAC5ECJdjosuuBHBh9o3nY6LLvgRwJfaNp2GiyzEEcGX2jQ9jossUBDAR2yW3M9FlSgKYkBB+z0SXOQhgYkJoosu8BLABFfeNTXRZggA2pPd9YxNdliaADept39hEl7UIYMNa3y4x0WVtAtiB1kJooksWAtiR7CGMuMTWi8EGWQhgh7LuG5+dnQ2ZCB8C2LGM+8YZmOgyEsACMu4bL81gg6sIYDEZt0vmJHzcRACL6j2EJrrsQgCL6y2EBhvsQwDZyLhvvA/h4xACyD9k3De+iYkuxxBArpRx33hksMFUBJAbZdouET6mJoDsZM0QmugyFwFkL0uG0GCDuQkgB5lz31j4WIoAcpTL+8bjh5oe6uTkZPj555+Fj8V4oMIkIoQ//fTTcIwIoPixJAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKCsdAH8+vXrALTv27dvmyOzu0MyL1++HB49ejS8ePFiuHs33S8PuEVE7/3795tDAA/w6dOnzSGE0I6Li4tN9D5//pw+fKPUZRFCyO/Lly/DmzdvNn9tTRNFEULIp+XwjZoqyRjCBw8eDM+ePRvu3bs3AMuJW9vz8/Ph3bt3m1ve1k0ewDt37sx+/x+/AXFEAOOKUAhhXi0NNvYxeQDj9nSpnwxx6f3q1avNP/P58+fD48ePB2A6a4fv5ORkmNPkAXz48OHil8bx7uDr16+Ht2/fCiFMIMNEN+IXd5RzmjyAT58+Xe2nhRDCcTINNqIlc5vlGWDE5+zsbFiLEMJ+sk10Y9C5xHk7yxQ4yh1XgBGgNV0OYfya4vbcKzTwX1knunHr++uvvw5LmK0GceX1448/bn6qrL3fG//8uCKNW/P4qRKHEFJV1olu3D3GhUoccz/7G81agXhxOY54dy9LCONqMA4vVVON8H1vkbM/WwiD7RKqyLqju2b4Roue9UIIy8m6qhbP+MZn8muFb7TK2S6EMJ+s4cu4ubXqWT6GMNNvmH1jWpR5RzfzymqKy5z4D3N6eroJ4MePHzfH2uwb04LMg43xImLudbZjpLrPi8jEEa/QxKQ2QwjtG5ORie40fvjXfwxJja+tZAjhSAivF48O/vzzz+FQ8ThkqRdgW2WiO63UARwJYRsEcD4muvNoIoAjIcxNAKdnojuvpgI4ihCOw5IsX6MZIay+byyA0zDRXU6TZ+rlq67xJ6R9Y1pnoru8ps/QCIx9Y1pnoruebs5M2yW0xkR3fd2dkUJIdia6eXR7Jgoh2Zjo5tP9GWjfmDWZ6OZW5hLEvjFLMtFtQ7l7MPvGzMlEty1Nvgg9Jdsl06n8IrSJbpvKB3AkhMerGEAT3bYJ4BYhPFylAJro9kEAr2HfeH+9B9BEtz9eRLuGfWNGJrr9cvbcwr5xXSa6/XPW7MF2SQ0munU4Ww4ghH0y0a3HWXIEIeyDiW5dzo4J2Dduj4kuQQAnZN84PxNdLhPAGdg3zsdEl6t4EXoBVbZLMr4IbaLLTQRwQb2HMFMATXTZhQCuoNcQZgigiS77EMAV9bZvvFYATXQ5lCHIiuwbH8dEl2MJYAL2jfdjostUBDAZ2yXXM9FlagKYlBD+n4kucxHA5CqH0ESXuQlgI1rYN56CiS5L8hpMoyKAEYmIRRZxJXjMFWr8/yOAJrosRQAbl/Gl6h4YbNQggJ0QwmkIXy0C2BkhPIyJbk0C2Ckh3I3BRm0C2LmM+8YZCB9BAIuI+MUGRWxSVA2hiS7bBLCgTC9VL8Fgg+sIYGG9h1D4uI0A0l0ITXTZlQDyt9ZDaLDBvgSQ72T9EILrCB+HEkCulXHf+LL4cIgnT54IHwcTQG6V6aVqgw2mJIDsbM0QCh9zEED2tmQIx2+piy9nEj6mJoAcbM4QGmywBAHkaFPuGwsfSxJAJnPMvrGJLmsQQGaxy0vVBhusTQCZVYTww4cPmy84iu/6iNDFqtr9+/eFj9UJIFCWH79AWQIIlCWAQFn/BizMxGSX68uEAAAAAElFTkSuQmCC",C={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},de=e=>C[e]?C[e]:C.en,he=e=>e==="zh"?"启动":"Launching",J=e=>(e==null?void 0:e.title)||(e==null?void 0:e.name)||"";function v({blockletMeta:e,subTitle:o,logoUrl:a,locale:h,navLogo:m,loading:p}){const d=z(k=>k.breakpoints.down("md")),y=d?18:48,b=A.useRef(null),[r,u]=A.useState("");return A.useEffect(()=>{b.current&&b.current.offsetHeight>34&&(r===""?u("middle"):r==="middle"&&u("small"))},[r]),t.jsxs(xe,{className:r==="small"?"center-mode":"",children:[d?t.jsx("div",{className:"app-icon",children:m}):t.jsxs("div",{className:"app-icon",children:[p&&t.jsx(me,{blockletSize:y,isMobile:d}),!p&&t.jsx(X,{blockletSize:y,logoUrl:a})]}),t.jsxs("div",{className:"header-title",children:[d&&o&&t.jsx("div",{className:"header-title-sub",children:o}),t.jsxs("div",{className:"app-name-content",children:[!d&&t.jsx("div",{className:"launching-context",children:o||he(h)}),t.jsx("div",{className:`header-title-name ${r==="middle"||r==="small"?"middle-size":""}`,ref:b,children:t.jsx(M,{logoUrl:a,isMobile:d,blockletMeta:e,blockletSize:y,loading:p})})]})]})]})}v.propTypes={blockletMeta:i.object,subTitle:i.any,logoUrl:i.string,locale:i.string,navLogo:i.any,loading:i.bool};v.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function me({blockletSize:e,isMobile:o}){return o?t.jsx(j,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):t.jsx(j,{variant:"rectangular",width:e,height:e})}function X({logoUrl:e,blockletSize:o}){return t.jsx(U,{width:o,height:o,src:e,alt:"blocklet icon",fallback:pe,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${e}`)}function M({isMobile:e,logoUrl:o,blockletMeta:a,blockletSize:h,loading:m}){const p=J(a);return m?t.jsx(j,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):ce(a)?t.jsx(j,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):e?t.jsxs(ue,{children:[t.jsx(X,{blockletSize:h,logoUrl:o}),t.jsx("span",{className:"ellipsis-title",children:J(a)})]}):t.jsx(fe,{target:"_blank",href:ie((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:p,children:p})}const ue=g.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|