@abtnode/blocklet-services 1.16.37-beta-20250104-120451-e4049aeb → 1.16.37-beta-20250107-235521-f1778ec0
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/LICENSE +1 -1
- package/api/index.js +1 -0
- package/api/libs/auth/utils.js +33 -31
- package/api/libs/connect/session.js +3 -2
- package/api/routes/blocklet.js +1 -1
- package/api/routes/oauth.js +22 -112
- package/api/routes/user.js +11 -26
- package/api/services/auth/connect/receive-transfer-app-owner.js +1 -2
- package/api/services/auth/connect/setup.js +7 -2
- package/api/services/auth/connect/verify-destroy.js +3 -16
- package/api/services/auth/index.js +4 -0
- package/api/services/auth/passkey.js +31 -0
- package/api/services/auth/passport.js +2 -2
- package/api/services/notification/index.js +10 -9
- package/api/socket/channel/did.js +3 -0
- package/api/socket/util.js +3 -1
- package/api/util/attach-shared-utils.js +5 -4
- package/api/util/index.js +5 -25
- package/dist/assets/Add-XINWD-cR.js +1 -0
- package/dist/assets/ArrowDropDown-BPjEGMbu.js +1 -0
- package/dist/assets/CheckCircle-B4plT5R4.js +1 -0
- package/dist/assets/ChevronLeft-B9PQ366h.js +1 -0
- package/dist/assets/ChevronRight-D6hU6q5w.js +1 -0
- package/dist/assets/DeleteOutline-CW6vHyu2.js +1 -0
- package/dist/assets/Done-CbA_lc17.js +1 -0
- package/dist/assets/Download-D114STME.js +1 -0
- package/dist/assets/EditIcon-DDucSncy.js +1 -0
- package/dist/assets/Error-CspIR8wP.js +1 -0
- package/dist/assets/{Google-BAgnJN1d.js → Google-Bzqa7SGD.js} +3 -3
- package/dist/assets/InfoOutlined-CQX14YIV.js +1 -0
- package/dist/assets/Launch-C1MUjdbY.js +1 -0
- package/dist/assets/LaunchOutlined-CeuwA75K.js +1 -0
- package/dist/assets/LockIcon-BIlUQ2kd.js +1 -0
- package/dist/assets/Loop-CRiiMs26.js +1 -0
- package/dist/assets/MoreHoriz-CyRd8YYN.js +1 -0
- package/dist/assets/PlayArrow-CpIW2rO1.js +1 -0
- package/dist/assets/QuestionMarkCircle-2fDrHopp.js +1 -0
- package/dist/assets/ServerLogo-DsurTeGQ.js +1 -0
- package/dist/assets/ViewList-VFshTvAg.js +1 -0
- package/dist/assets/_createAggregator-sgAa2ai2.js +1 -0
- package/dist/assets/abtwallet-o1JAGJkW.png +0 -0
- package/dist/assets/access-control-CaDZstFX.js +13 -0
- package/dist/assets/actions-BQfRapcY.js +1 -0
- package/dist/assets/add-component-core-B6O0kJAO.js +716 -0
- package/dist/assets/add-resource-DVAwgArl.js +1 -0
- package/dist/assets/addon-B934EFnq.js +31 -0
- package/dist/assets/analytics-DxPeznyU.js +47 -0
- package/dist/assets/android-Xe96zWxX.png +0 -0
- package/dist/assets/api-C7qcY4XU.js +1 -0
- package/dist/assets/audit-logs-Cw_LCWlO.js +58 -0
- package/dist/assets/base32-CdGlYCm2.js +1 -0
- package/dist/assets/branding-CVf-84lW.js +40 -0
- package/dist/assets/bundle-avatar-CZnIDw9E.js +1 -0
- package/dist/assets/button-DSj-WxvW.js +1 -0
- package/dist/assets/click-to-copy-DPKm1p6d.js +1 -0
- package/dist/assets/complete-Bf8ALY2S.js +45 -0
- package/dist/assets/{component-ChbClWUp.js → component-ChxoGFx9.js} +89 -89
- package/dist/assets/config-BUjuVbbC.js +1 -0
- package/dist/assets/config-D3mUi5yh.js +32 -0
- package/dist/assets/{config-navigation-CWPZjlHO.js → config-navigation-Bjlh79gM.js} +6 -6
- package/dist/assets/config-space-B_9C2jTG.js +1 -0
- package/dist/assets/confirm-CVFWPron.js +7 -0
- package/dist/assets/connect-Bw02nhZ6.js +5 -0
- package/dist/assets/connect-to-DL42-aQK.js +1 -0
- package/dist/assets/connect-whKFDq3K.js +1 -0
- package/dist/assets/{content-layout-B3qFdI6N.js → content-layout-C8ThavEP.js} +1 -1
- package/dist/assets/dashboard-Dff3slpj.js +86 -0
- package/dist/assets/did-address-DqD0tKOY.js +1 -0
- package/dist/assets/domain-CI3XUHBW.js +9 -0
- package/dist/assets/domain-list-jO4zHESZ.js +15 -0
- package/dist/assets/email-DZG9lqBd.js +18 -0
- package/dist/assets/exchange-passport-BMjrpZst.js +1 -0
- package/dist/assets/form-text-input-ClGC4JKP.js +11 -0
- package/dist/assets/{format-error-CpEoP1rb.js → format-error-C0Ke3VXF.js} +2 -2
- package/dist/assets/fuel-2t6oVtfW.js +32 -0
- package/dist/assets/fullpage-BiUo6gQd.js +1 -0
- package/dist/assets/get-safe-url-BtfNFuK0.js +1 -0
- package/dist/assets/get-safe-url-CV9wUymi.js +1 -0
- package/dist/assets/home-BpXMOH1X.js +1 -0
- package/dist/assets/iframe-03f6PMsP.js +1 -0
- package/dist/assets/index-1yj7N3BD.js +243 -0
- package/dist/assets/{index-CqfW2FZt.js → index-7gknQYQQ.js} +2 -2
- package/dist/assets/index-BRPzwIuP.js +1 -0
- package/dist/assets/index-BgE0mEyw.js +221 -0
- package/dist/assets/index-BqtzbaK6.js +5 -0
- package/dist/assets/index-BvpWi6M_.js +1 -0
- package/dist/assets/index-C89HTHWf.js +144 -0
- package/dist/assets/{index-D8zCBBsy.js → index-CEyrfuix.js} +1 -1
- package/dist/assets/index-CTEk7-E8.js +4 -0
- package/dist/assets/index-CcsFwEG1.js +1 -0
- package/dist/assets/index-ChdU5l0G.js +104 -0
- package/dist/assets/index-Cp3ZCh7o.js +1 -0
- package/dist/assets/index-D3rhPCZn.js +291 -0
- package/dist/assets/index-DOWnRwIi.js +134 -0
- package/dist/assets/{index-Cbi6kl34.js → index-DPyw3Xwp.js} +2 -2
- package/dist/assets/index-DQR2LIPC.js +11 -0
- package/dist/assets/index-DVYdq7IA.js +1 -0
- package/dist/assets/{index-Gze7IkP6.js → index-DoZ2YM4T.js} +1 -1
- package/dist/assets/index-XlyOkzy1.js +1 -0
- package/dist/assets/{index-CH1qAD3K.js → index-kGLQpRJK.js} +22 -22
- package/dist/assets/index-qpaXqEVJ.js +5 -0
- package/dist/assets/invitation-C8ZNSJG7.js +176 -0
- package/dist/assets/invite-wHYq3NmE.js +5 -0
- package/dist/assets/ios-CBDmY-ic.png +0 -0
- package/dist/assets/isEmail-BWNRBSAy.js +1 -0
- package/dist/assets/issue-passport-CIaz_hk6.js +1 -0
- package/dist/assets/item-wwVikGMU.js +1 -0
- package/dist/assets/{launch-result-message-BelGEFPb.js → launch-result-message-BEuCq9h1.js} +2 -2
- package/dist/assets/layout-DBXEc_NJ.js +29 -0
- package/dist/assets/list-header-BA3DiTcf.js +57 -0
- package/dist/assets/localization-DHa_wuSk.js +1 -0
- package/dist/assets/{log-C-mcb3Rv.js → log-Dc1jxENK.js} +9 -9
- package/dist/assets/login-BSMkjZ2F.js +1 -0
- package/dist/assets/login-oauth-callback-nhEQq-XX.js +1 -0
- package/dist/assets/logo-uploader-yBugHtcG.js +133 -0
- package/dist/assets/lost-passport-DAsg20NY.js +168 -0
- package/dist/assets/{lottie-react.esm-BpyUyTL6.js → lottie-react.esm-CHpXrEmm.js} +1 -1
- package/dist/assets/open-window-CVrMznBr.js +1 -0
- package/dist/assets/overview-Dc2oVKWy.js +12 -0
- package/dist/assets/{page-header-cgpPCMon.js → page-header-Htib6ejn.js} +1 -1
- package/dist/assets/permission-Bz0PVI3J.js +1 -0
- package/dist/assets/preferences-BVtsOmzg.js +1 -0
- package/dist/assets/publish-resource-6mtBRA7-.js +1 -0
- package/dist/assets/raf-schd.esm-Cxhj8umC.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-C5fDIc0r.js → react-beautiful-dnd.esm-BPPmOpgZ.js} +4 -4
- package/dist/assets/relative-time-D13g3uDZ.js +1 -0
- package/dist/assets/sdk-BU36VFtK.js +1 -0
- package/dist/assets/session-6sDuFWud.js +1 -0
- package/dist/assets/setup-B2Eq0dKO.js +19 -0
- package/dist/assets/shorten-label-CKNjZbhF.js +1 -0
- package/dist/assets/simple-select-BMYrmYam.js +1 -0
- package/dist/assets/slicedToArray-BPEJIbVV.js +2 -0
- package/dist/assets/start-DcyUXnHe.js +187 -0
- package/dist/assets/step-actions-BdC024Vn.js +31 -0
- package/dist/assets/studio-BSlFbK1F.js +6 -0
- package/dist/assets/switch-control-DOeNAipI.js +13 -0
- package/dist/assets/toUpper-CPtwa1LG.js +1 -0
- package/dist/assets/transfer-l-kgY192.js +16 -0
- package/dist/assets/unsubscribe-Bn1ZPibc.js +1 -0
- package/dist/assets/use-mobile-DOkke39c.js +1 -0
- package/dist/assets/useAsync-Barwm_ml.js +1 -0
- package/dist/assets/useAsyncRetry-Ct0h3JKq.js +7 -0
- package/dist/assets/useLocalStorage-Bkgi6BS3.js +1 -0
- package/dist/assets/useSetState-Crt4S51m.js +1 -0
- package/dist/assets/user-center-tko9eOwU.js +202 -0
- package/dist/assets/util-Cd3QOWLR.js +1 -0
- package/dist/assets/{index-B4oT57Ax.css → vendor-arcblock-DhgPdlEj.css} +1 -1
- package/dist/assets/vendor-arcblock-oreSqNjg.js +3503 -0
- package/dist/assets/vendor-hooks-DHHsWSqV.js +7 -0
- package/dist/assets/vendor-mui-core-COxJgW9_.js +267 -0
- package/dist/assets/vendor-mui-x-Be0GxtOJ.js +6 -0
- package/dist/assets/vendor-react-D-afvo_7.js +61 -0
- package/dist/assets/vendor-utils-CV7RLr7b.js +11 -0
- package/dist/assets/wrap-locale-Dajt8i2A.js +1 -0
- package/dist/index.html +7 -2
- package/dist/service-worker.js +1 -1
- package/package.json +39 -39
- package/dist/assets/Add-B3vUgBj_.js +0 -1
- package/dist/assets/Alert-BeI3TGsH.js +0 -1
- package/dist/assets/ArrowDropDown-BDen6kv8.js +0 -1
- package/dist/assets/Autocomplete-B9XdXNLV.js +0 -1
- package/dist/assets/Avatar-VP6VjO6F.js +0 -1
- package/dist/assets/ButtonGroup-BQ3t8F0M.js +0 -1
- package/dist/assets/CSSTransition-CAyI_Voi.js +0 -1
- package/dist/assets/CheckCircle-C2NNCmBl.js +0 -1
- package/dist/assets/ChevronLeft-CnYlL3td.js +0 -1
- package/dist/assets/ChevronRight-CW0I-au3.js +0 -1
- package/dist/assets/Clear-CJ32w-ta.js +0 -1
- package/dist/assets/CloseOutlined-sL5HP2JB.js +0 -1
- package/dist/assets/Delete-Cw0XHQbI.js +0 -1
- package/dist/assets/DeleteOutline-CNDiVs89.js +0 -1
- package/dist/assets/DialogContentText-CEsqdDWz.js +0 -1
- package/dist/assets/Done-B1Id3HZ7.js +0 -1
- package/dist/assets/Download-5eyWxKFR.js +0 -1
- package/dist/assets/EditIcon-CyjMgREV.js +0 -1
- package/dist/assets/Error-CUxzkNdG.js +0 -1
- package/dist/assets/ExpandMore-CLLcIz7v.js +0 -1
- package/dist/assets/FormControl-BXjjQ2Cl.js +0 -1
- package/dist/assets/FormControlLabel-CRQiOFgY.js +0 -1
- package/dist/assets/FormGroup-CPYnhZEp.js +0 -1
- package/dist/assets/Grid-vQ4in7aJ.js +0 -1
- package/dist/assets/HelpOutline-CMsKsWc3.js +0 -1
- package/dist/assets/Hidden-ideB0Yow.js +0 -1
- package/dist/assets/InfoOutlined-5WyW673W.js +0 -1
- package/dist/assets/InputAdornment-BYO2j_v5.js +0 -1
- package/dist/assets/LastPage-CzXhZxbb.js +0 -1
- package/dist/assets/Launch-DYv1e-sP.js +0 -1
- package/dist/assets/LaunchOutlined-BxjL--pT.js +0 -1
- package/dist/assets/Link-BePn_RNM.js +0 -1
- package/dist/assets/ListItemButton-DFfqWy-t.js +0 -1
- package/dist/assets/ListSubheader-XVI0gGYq.js +0 -1
- package/dist/assets/LoadingButton-iTGCDYUz.js +0 -1
- package/dist/assets/LockIcon-Cj6s3Czr.js +0 -1
- package/dist/assets/Loop-JyIa8s4d.js +0 -1
- package/dist/assets/Menu-C6kynm4m.js +0 -1
- package/dist/assets/MoreHoriz-Cj6hh2tu.js +0 -1
- package/dist/assets/MoreVert-m5BY_p4K.js +0 -1
- package/dist/assets/OpenInNew-CIsQ-VD4.js +0 -1
- package/dist/assets/OutlinedInput-B93_cuhJ.js +0 -2
- package/dist/assets/PlayArrow-CSCQWAOp.js +0 -1
- package/dist/assets/QuestionMarkCircle-Bgaj2WkC.js +0 -1
- package/dist/assets/RadioGroup-DPurewE-.js +0 -1
- package/dist/assets/Search-Cy_vXJXs.js +0 -1
- package/dist/assets/Select-BoIViWSN.js +0 -1
- package/dist/assets/ServerLogo-C2FfSxkG.js +0 -1
- package/dist/assets/Stepper-CDMW7dY4.js +0 -1
- package/dist/assets/TextField-apRN2NFH.js +0 -1
- package/dist/assets/Toolbar-B0MDD2MX.js +0 -1
- package/dist/assets/ViewColumn-DLbcQUHz.js +0 -1
- package/dist/assets/ViewList-CYnd76EG.js +0 -1
- package/dist/assets/_createAggregator-jZ136RIi.js +0 -1
- package/dist/assets/access-control-D_3Sf3DH.js +0 -13
- package/dist/assets/actions-BEfqQHvh.js +0 -1
- package/dist/assets/add-component-core-8-K3kI62.js +0 -804
- package/dist/assets/add-resource-BJc9d35J.js +0 -1
- package/dist/assets/addon-C2s3597J.js +0 -31
- package/dist/assets/analytics-__YzXiEy.js +0 -52
- package/dist/assets/api-Du2npubO.js +0 -1
- package/dist/assets/audit-logs-DCsbxX3x.js +0 -59
- package/dist/assets/base32-CSHbjBse.js +0 -1
- package/dist/assets/branding-D8ZABeVU.js +0 -40
- package/dist/assets/bundle-avatar-DjGcv6Sg.js +0 -1
- package/dist/assets/button-BpodnaUj.js +0 -1
- package/dist/assets/click-to-copy-Ct4_CI1M.js +0 -1
- package/dist/assets/complete-CKV6Ebun.js +0 -45
- package/dist/assets/config-BnBRy_w4.js +0 -1
- package/dist/assets/config-C7arZYXl.js +0 -32
- package/dist/assets/config-space-D4B-Fcx4.js +0 -1
- package/dist/assets/confirm-CyScKRsz.js +0 -7
- package/dist/assets/connect-D50yPXAE.js +0 -5
- package/dist/assets/connect-DZgc6pEB.js +0 -1
- package/dist/assets/connect-to-Byo-gZWq.js +0 -29
- package/dist/assets/dashboard-lB4ZPVoV.js +0 -122
- package/dist/assets/deprecate-cv6v3EXd.js +0 -1
- package/dist/assets/did-address-pHUGf5mt.js +0 -1
- package/dist/assets/domain-UlRrTp1n.js +0 -9
- package/dist/assets/domain-list-CKs3EKNU.js +0 -15
- package/dist/assets/email-PtOk65dC.js +0 -18
- package/dist/assets/emotion-cache.browser.esm-DuQlBwjm.js +0 -1
- package/dist/assets/exchange-passport-DdO1PoJN.js +0 -1
- package/dist/assets/fallback-BMr0sE-j.js +0 -1
- package/dist/assets/form-text-input-C5wKQFKL.js +0 -11
- package/dist/assets/fuel-DkDXKRe9.js +0 -32
- package/dist/assets/fullpage-cRbvfPCn.js +0 -1
- package/dist/assets/get-safe-url-6c6RI8XT.js +0 -1
- package/dist/assets/get-safe-url-CwEZKvfc.js +0 -1
- package/dist/assets/home-D29pIqLK.js +0 -1
- package/dist/assets/iframe-BFiRQ7tw.js +0 -1
- package/dist/assets/index-72Zql8CQ.js +0 -5
- package/dist/assets/index-B27mVEab.js +0 -102
- package/dist/assets/index-B3dU1BRu.js +0 -1
- package/dist/assets/index-B5C90-kX.js +0 -1
- package/dist/assets/index-B6PbP50h.js +0 -1
- package/dist/assets/index-BUN78vRQ.js +0 -1
- package/dist/assets/index-BXoHPu8T.js +0 -5
- package/dist/assets/index-BcaFN_aP.js +0 -1
- package/dist/assets/index-Bgv4pLgc.js +0 -243
- package/dist/assets/index-BhxTb2Rs.js +0 -1
- package/dist/assets/index-Bo3ifRfa.js +0 -1
- package/dist/assets/index-BqLf0w23.js +0 -221
- package/dist/assets/index-C0UJXtze.js +0 -4
- package/dist/assets/index-C3YL4xGi.js +0 -1
- package/dist/assets/index-CMbz2eu6.js +0 -11
- package/dist/assets/index-CUdjeFH3.js +0 -1413
- package/dist/assets/index-C_mXaY4E.js +0 -1
- package/dist/assets/index-Cg_T1V-P.js +0 -544
- package/dist/assets/index-ChhcKroJ.js +0 -12
- package/dist/assets/index-CqnrpD4d.js +0 -134
- package/dist/assets/index-CtQolg_s.js +0 -1
- package/dist/assets/index-DSX7jfl3.js +0 -1
- package/dist/assets/index-DgoHglX6.js +0 -1
- package/dist/assets/index-Dim9am4F.js +0 -291
- package/dist/assets/index-DvwEbnCV.js +0 -13
- package/dist/assets/index-I-TxeVFM.js +0 -340
- package/dist/assets/index-ZSNG3xSj.js +0 -11
- package/dist/assets/index-foZCwT8M.css +0 -1
- package/dist/assets/index-q27UQsWn.js +0 -16
- package/dist/assets/index-q2_9XHCb.js +0 -721
- package/dist/assets/index-xuTvwkle.js +0 -316
- package/dist/assets/invitation-CI9oI0ML.js +0 -176
- package/dist/assets/invite-BD1LrTA8.js +0 -5
- package/dist/assets/isEmail-BCMyh8vZ.js +0 -1
- package/dist/assets/issue-passport-Bd-T51oN.js +0 -1
- package/dist/assets/item-CvCwtq6F.js +0 -1
- package/dist/assets/jss-plugin-props-sort.esm-KqvaA55X.js +0 -14
- package/dist/assets/layout-CqjS3RFh.js +0 -29
- package/dist/assets/list-header-DVNuHNDo.js +0 -57
- package/dist/assets/localization-Dutgz4tx.js +0 -1
- package/dist/assets/login-8AhFtIOc.js +0 -1
- package/dist/assets/login-oauth-callback-CsFM0yAZ.js +0 -1
- package/dist/assets/logo-uploader-DabQD2dA.js +0 -133
- package/dist/assets/lost-passport-CxN1g858.js +0 -168
- package/dist/assets/open-window-Banfzs4p.js +0 -1
- package/dist/assets/overview-DcAEoK9V.js +0 -12
- package/dist/assets/permission-WZrPwf2m.js +0 -1
- package/dist/assets/preferences-Ca7-Ov6u.js +0 -1
- package/dist/assets/publish-resource-DZ4bcjeq.js +0 -1
- package/dist/assets/purify.es-DutPtr9A.js +0 -2
- package/dist/assets/raf-schd.esm-CAeD1GPF.js +0 -1
- package/dist/assets/refType-Cd6nIb--.js +0 -1
- package/dist/assets/relative-time-DDo7Crj5.js +0 -1
- package/dist/assets/resource-dialog-CrGsGXEE.js +0 -299
- package/dist/assets/sdk-BTNAvCf8.js +0 -1
- package/dist/assets/selector-Br9-dR9y.js +0 -48
- package/dist/assets/session-BB2DljXy.js +0 -1
- package/dist/assets/setup-Cv1zGHfT.js +0 -19
- package/dist/assets/shorten-label-DT9X1B8w.js +0 -1
- package/dist/assets/simple-select-BAxNgpxE.js +0 -1
- package/dist/assets/slicedToArray-DyRQzefY.js +0 -2
- package/dist/assets/start-C7dSefgZ.js +0 -187
- package/dist/assets/step-actions-oy5A5R40.js +0 -31
- package/dist/assets/studio-Boj6f6bS.js +0 -6
- package/dist/assets/switch-control-ChW_GuaN.js +0 -13
- package/dist/assets/toPropertyKey-PLuKRk1e.js +0 -1
- package/dist/assets/toUpper-DXbBjpP8.js +0 -1
- package/dist/assets/transfer-CwhoFyG0.js +0 -16
- package/dist/assets/trim-D79XRDvY.js +0 -1
- package/dist/assets/uniqBy-BBGY8CA1.js +0 -1
- package/dist/assets/unsubscribe-BlsNq4VD.js +0 -1
- package/dist/assets/url-join-DILCgsel.js +0 -1
- package/dist/assets/use-mobile-B3qubz56.js +0 -1
- package/dist/assets/use-mobile-D8jiOBBW.js +0 -1
- package/dist/assets/useAsync-CwWuQ31n.js +0 -1
- package/dist/assets/useAsyncRetry-o3huFKOY.js +0 -7
- package/dist/assets/useFormControl-Bm0BZQS7.js +0 -1
- package/dist/assets/useLocalStorage-DdNsoUmT.js +0 -1
- package/dist/assets/useSetState-DuK5mvRn.js +0 -1
- package/dist/assets/useSlot-RdBOCJrx.js +0 -1
- package/dist/assets/useThemeProps-Bmm6xEda.js +0 -1
- package/dist/assets/user-center-6IaKm8kc.js +0 -201
- package/dist/assets/util-CZ4Gnuni.js +0 -1
- package/dist/assets/utils-DoM3o7-Q.js +0 -1
- package/dist/assets/visuallyHidden-Dan1xhjv.js +0 -1
- package/dist/assets/wrap-locale-DKHVNdE9.js +0 -1
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CH1qAD3K.js","assets/index-CUdjeFH3.js","assets/index-B4oT57Ax.css","assets/url-join-DILCgsel.js","assets/index-C3YL4xGi.js","assets/_createAggregator-jZ136RIi.js","assets/index-B6PbP50h.js","assets/index-Gze7IkP6.js","assets/resource-dialog-CrGsGXEE.js","assets/index-BUN78vRQ.js","assets/index-ChhcKroJ.js","assets/fallback-BMr0sE-j.js","assets/Alert-BeI3TGsH.js","assets/useSlot-RdBOCJrx.js","assets/ExpandMore-CLLcIz7v.js","assets/index-ZSNG3xSj.js","assets/index-q2_9XHCb.js","assets/Menu-C6kynm4m.js","assets/Toolbar-B0MDD2MX.js","assets/Hidden-ideB0Yow.js","assets/MoreVert-m5BY_p4K.js","assets/ListItemButton-DFfqWy-t.js","assets/selector-Br9-dR9y.js","assets/Avatar-VP6VjO6F.js","assets/index-B27mVEab.js","assets/emotion-cache.browser.esm-DuQlBwjm.js","assets/purify.es-DutPtr9A.js","assets/uniqBy-BBGY8CA1.js","assets/index-B3dU1BRu.js","assets/FormControlLabel-CRQiOFgY.js","assets/useFormControl-Bm0BZQS7.js","assets/index-BcaFN_aP.js","assets/Select-BoIViWSN.js","assets/utils-DoM3o7-Q.js","assets/OutlinedInput-B93_cuhJ.js","assets/TextField-apRN2NFH.js","assets/FormControl-BXjjQ2Cl.js","assets/InputAdornment-BYO2j_v5.js","assets/OpenInNew-CIsQ-VD4.js","assets/CloseOutlined-sL5HP2JB.js","assets/Link-BePn_RNM.js","assets/index-q27UQsWn.js","assets/ButtonGroup-BQ3t8F0M.js","assets/HelpOutline-CMsKsWc3.js","assets/DialogContentText-CEsqdDWz.js","assets/use-mobile-D8jiOBBW.js","assets/index-I-TxeVFM.js","assets/useThemeProps-Bmm6xEda.js","assets/toPropertyKey-PLuKRk1e.js","assets/Search-Cy_vXJXs.js","assets/ViewColumn-DLbcQUHz.js","assets/FormGroup-CPYnhZEp.js","assets/Grid-vQ4in7aJ.js","assets/Delete-Cw0XHQbI.js","assets/LastPage-CzXhZxbb.js","assets/Clear-CJ32w-ta.js","assets/deprecate-cv6v3EXd.js","assets/toUpper-DXbBjpP8.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{az as Ss,j as n,bo as le,cD as dn,bp as B,fN as Io,br as je,bn as He,bm as Ke,T as V,r as k,bq as At,cH as un,bs as Ge,bu as Xe,cR as Cs,fO as ft,a2 as ke,a3 as Se,a5 as Je,B as g,P as h,L as K,e as Bt,u as ee,aK as Ce,aQ as $e,bk as ht,a7 as ct,Q as pe,dj as pn,a as ge,aI as ie,V as Rs,v as A,bw as vs,dk as ws,ag as Te,c as fe,a4 as he,M as Is,dD as Ft,c1 as fn,cC as Ts,cI as Ve,cJ as hn,ap as Ps,d0 as Ns,e2 as et,cm as ae,bP as ot,fA as Ds,ae as To,fP as _s,b as se,n as at,cs as mn,ev as bn,ao as zt,cn as gn,co as xn,aO as Be,aN as Es,bK as yn,bM as $s,bN as Ls,bO as Ms,bJ as Ie,a9 as jn,fQ as Po,dr as _e,cL as Os,aA as kn,l as qs,aH as As,aw as Bs,ax as kt}from"./index-CUdjeFH3.js";import{d as Vt}from"./Add-B3vUgBj_.js";import{d as Sn,a as Fs}from"./Delete-Cw0XHQbI.js";import{d as zs}from"./Error-CUxzkNdG.js";import{D as Wt}from"./index-I-TxeVFM.js";import{T as Cn,b as Vs}from"./index-DvwEbnCV.js";import{C as Ut}from"./confirm-CyScKRsz.js";import{u as mt}from"./session-BB2DljXy.js";import{W as No}from"./did-address-pHUGf5mt.js";import{E as Qe,D as Do,C as _o,P as Eo}from"./react-beautiful-dnd.esm-C5fDIc0r.js";import{B as Ht}from"./bundle-avatar-DjGcv6Sg.js";import{S as xe}from"./shorten-label-DT9X1B8w.js";import{A as Rn}from"./Avatar-VP6VjO6F.js";import{d as Ws}from"./Download-5eyWxKFR.js";import{d as Us}from"./QuestionMarkCircle-Bgaj2WkC.js";import{b as Hs,c as $o,T as Ks}from"./index-BUN78vRQ.js";import{_ as De}from"./useSetState-DuK5mvRn.js";import{c as Kt}from"./index-Gze7IkP6.js";import{E as Gt}from"./index-BhxTb2Rs.js";import{C as nt}from"./Search-Cy_vXJXs.js";import{A as vn}from"./Alert-BeI3TGsH.js";import{p as dt}from"./index-BXoHPu8T.js";import"./api-Du2npubO.js";import{i as Gs}from"./index-BcaFN_aP.js";import{d as Xs}from"./ExpandMore-CLLcIz7v.js";import{d as Js}from"./ChevronRight-CW0I-au3.js";import{d as Qs}from"./OpenInNew-CIsQ-VD4.js";import{u as wn}from"./useThemeProps-Bmm6xEda.js";import{F as It}from"./FormControlLabel-CRQiOFgY.js";import{d as Lo}from"./DeleteOutline-CNDiVs89.js";import{c as Ys,A as In,u as Zs,S as er,U as tr}from"./item-CvCwtq6F.js";import{d as or}from"./ArrowDropDown-BDen6kv8.js";import{f as Ee}from"./format-error-CpEoP1rb.js";import{B as Tt}from"./ButtonGroup-BQ3t8F0M.js";import{d as nr}from"./Clear-CJ32w-ta.js";import{O as sr}from"./OutlinedInput-B93_cuhJ.js";import{I as bt}from"./InputAdornment-BYO2j_v5.js";import{T as de}from"./TextField-apRN2NFH.js";import{C as rr}from"./click-to-copy-Ct4_CI1M.js";import{d as ir}from"./Launch-DYv1e-sP.js";import{L as lr}from"./MoreVert-m5BY_p4K.js";import{S as Mo}from"./index-B3dU1BRu.js";import{M as cr}from"./index-CqfW2FZt.js";import{p as ar}from"./purify.es-DutPtr9A.js";import{r as dr}from"./index-D8zCBBsy.js";import{d as ur}from"./Done-B1Id3HZ7.js";import{c as Tn,d as Pn,b as pr,S as fr,a as hr}from"./Stepper-CDMW7dY4.js";import{R as mr,a as Oo}from"./RadioGroup-DPurewE-.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-DuQlBwjm.js";import"./ViewColumn-DLbcQUHz.js";import"./FormControl-BXjjQ2Cl.js";import"./utils-DoM3o7-Q.js";import"./useFormControl-Bm0BZQS7.js";import"./FormGroup-CPYnhZEp.js";import"./Grid-vQ4in7aJ.js";import"./Select-BoIViWSN.js";import"./LastPage-CzXhZxbb.js";import"./Toolbar-B0MDD2MX.js";import"./index-ChhcKroJ.js";import"./DialogContentText-CEsqdDWz.js";import"./Link-BePn_RNM.js";import"./raf-schd.esm-CAeD1GPF.js";import"./useSlot-RdBOCJrx.js";import"./get-safe-url-CwEZKvfc.js";import"./jss-plugin-props-sort.esm-KqvaA55X.js";const br=Ss(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"),gr=["slots","slotProps"],xr=le(dn)(({theme:e})=>B({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":B({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":B({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:Io(e.palette.grey[200],.12)}:{backgroundColor:Io(e.palette.grey[600],.12)})})),yr=le(br)({width:24,height:16});function jr(e){const{slots:t={},slotProps:o={}}=e,s=je(e,gr),r=e;return n.jsx("li",{children:n.jsx(xr,B({focusRipple:!0},s,{ownerState:r,children:n.jsx(yr,B({as:t.CollapsedIcon,ownerState:r},o.collapsedIcon))}))})}function kr(e){return Ke("MuiBreadcrumbs",e)}const Sr=He("MuiBreadcrumbs",["root","ol","li","separator"]),Cr=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],Rr=e=>{const{classes:t}=e;return Xe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},kr,t)},vr=le(V,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${Sr.li}`]:t.li},t.root]})({}),wr=le("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),Ir=le("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function Tr(e,t,o,s){return e.reduce((r,i,l)=>(l<e.length-1?r=r.concat(i,n.jsx(Ir,{"aria-hidden":!0,className:t,ownerState:s,children:o},`separator-${l}`)):r.push(i),r),[])}const Nn=k.forwardRef(function(t,o){const s=At({props:t,name:"MuiBreadcrumbs"}),{children:r,className:i,component:l="nav",slots:c={},slotProps:a={},expandText:u="Show path",itemsAfterCollapse:f=1,itemsBeforeCollapse:m=1,maxItems:x=8,separator:d="/"}=s,p=je(s,Cr),[b,S]=k.useState(!1),j=B({},s,{component:l,expanded:b,expandText:u,itemsAfterCollapse:f,itemsBeforeCollapse:m,maxItems:x,separator:d}),y=Rr(j),R=un({elementType:c.CollapsedIcon,externalSlotProps:a.collapsedIcon,ownerState:j}),T=k.useRef(null),v=P=>{const _=()=>{S(!0);const E=T.current.querySelector("a[href],button,[tabindex]");E&&E.focus()};return m+f>=P.length?P:[...P.slice(0,m),n.jsx(jr,{"aria-label":u,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:_},"ellipsis"),...P.slice(P.length-f,P.length)]},C=k.Children.toArray(r).filter(P=>k.isValidElement(P)).map((P,_)=>n.jsx("li",{className:y.li,children:P},`child-${_}`));return n.jsx(vr,B({ref:o,component:l,color:"text.secondary",className:Ge(y.root,i),ownerState:j},p,{children:n.jsx(wr,{className:y.ol,ref:T,ownerState:j,children:Tr(b||x&&C.length<=x?C:v(C),y.separator,d,j)})}))});function Pr(e){return Ke("MuiStepButton",e)}const qo=He("MuiStepButton",["root","horizontal","vertical","touchRipple"]),Nr=["children","className","icon","optional"],Dr=e=>{const{classes:t,orientation:o}=e;return Xe({root:["root",o],touchRipple:["touchRipple"]},Pr,t)},_r=le(dn,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${qo.touchRipple}`]:t.touchRipple},t.root,t[o.orientation]]}})(({ownerState:e})=>B({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${qo.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),Er=k.forwardRef(function(t,o){const s=At({props:t,name:"MuiStepButton"}),{children:r,className:i,icon:l,optional:c}=s,a=je(s,Nr),{disabled:u,active:f}=k.useContext(Tn),{orientation:m}=k.useContext(Pn),x=B({},s,{orientation:m}),d=Dr(x),p={icon:l,optional:c},b=Cs(r,["StepLabel"])?k.cloneElement(r,p):n.jsx(pr,B({},p,{children:r}));return n.jsx(_r,B({focusRipple:!0,disabled:u,TouchRippleProps:{className:d.touchRipple},className:Ge(d.root,i),ref:o,ownerState:x,"aria-current":f?"step":void 0},a,{children:b}))});function $r(e){return Ke("MuiStepContent",e)}He("MuiStepContent",["root","last","transition"]);const Lr=["children","className","TransitionComponent","transitionDuration","TransitionProps"],Mr=e=>{const{classes:t,last:o}=e;return Xe({root:["root",o&&"last"],transition:["transition"]},$r,t)},Or=le("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.last&&t.last]}})(({ownerState:e,theme:t})=>B({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"})),qr=le(ft,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),Ar=k.forwardRef(function(t,o){const s=At({props:t,name:"MuiStepContent"}),{children:r,className:i,TransitionComponent:l=ft,transitionDuration:c="auto",TransitionProps:a}=s,u=je(s,Lr);k.useContext(Pn);const{active:f,last:m,expanded:x}=k.useContext(Tn),d=B({},s,{last:m}),p=Mr(d);let b=c;return c==="auto"&&!l.muiSupportAuto&&(b=void 0),n.jsx(Or,B({className:Ge(p.root,i),ref:o,ownerState:d},u,{children:n.jsx(qr,B({as:l,in:f||x,className:p.transition,ownerState:d,timeout:b,unmountOnExit:!0},a,{children:r}))}))});var Xt={},Br=Se;Object.defineProperty(Xt,"__esModule",{value:!0});var Dn=Xt.default=void 0,Fr=Br(ke()),zr=n;Dn=Xt.default=(0,Fr.default)((0,zr.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 Jt={},Vr=Se;Object.defineProperty(Jt,"__esModule",{value:!0});var _n=Jt.default=void 0,Wr=Vr(ke()),Ur=n;_n=Jt.default=(0,Wr.default)((0,Ur.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 Qt={},Hr=Se;Object.defineProperty(Qt,"__esModule",{value:!0});var En=Qt.default=void 0,Kr=Hr(ke()),Gr=n;En=Qt.default=(0,Kr.default)((0,Gr.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 Yt({did:e,projectId:t,title:o,logo:s,describe:r}){const l=`${`${K.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[c,a]=k.useState(!1),u=Je(f=>f.breakpoints.down("md"));return n.jsxs(g,{sx:{display:"flex",flexDirection:"row",color:c?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[n.jsx(Rn,{sx:{borderRadius:1},src:l}),n.jsxs(g,{children:[n.jsx(xe,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:u?"primary.main":""},children:o||"/"}),n.jsx(xe,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:u||c?"primary.main":"grey.700"},children:r||"/"})]})]})}Yt.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function Zt({initUrl:e}){const t=Bt(),o=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=ee(),{api:i}=Ce(),{api:l}=mt(),[c,a]=k.useState(!0),{blocklet:u}=$e(),[f,m]=k.useState(null),[x,d]=k.useState(!1),p=Je(N=>N.breakpoints.down("xl")),{componentDid:b=""}=ht(),[S,j]=k.useState(null),y=()=>{i.getProjects({input:{did:u.meta.did,componentDid:b,tenantScope:o}}).then(N=>{const D=(N==null?void 0:N.projects)||[];a(!1),j(D)}).catch(N=>{a(!1),A.error(N.message)})},R=()=>{t(`${K.UNOWNED_DID}/create/none`,{replace:!0})},T=N=>{m(N)},v=()=>{a(!1),d(!0)},C=()=>{d(!1),m(null)},P=N=>{A.error(N.message),d(!1),m(null)},_=N=>{if(!(N!=null&&N.deleted)){A.error("Delete project failed");return}y(),d(!1),m(null)},E=(N,D,U)=>{let W=N==null?void 0:N.trim();return W?(W=vs.toAddress(W).toLocaleLowerCase(),U.some((I,M)=>{const $=D[M];return $&&I.searchable&&I.display!=="excluded"&&I.display!=="false"&&$.toLocaleLowerCase().includes(W)})):!0};if(k.useEffect(()=>{y()},[]),!S&&c)return n.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:n.jsx(Qe,{})});if(!S)return null;if(!S.length)return n.jsxs(g,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[n.jsx(g,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),n.jsx(g,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),n.jsx(ct,{onClick:R,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const w=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:N=>{const D=S[N];return n.jsx(pe,{to:`${D.id}`,children:n.jsx(Yt,{did:u.meta.did,projectId:D.id,logo:D.blockletLogo,title:D.blockletTitle,describe:D.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:N=>N?n.jsx(Cn,{type:"success",children:N}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:N=>N?n.jsx(No,{size:14,compact:!0,responsive:!1,did:N}):null}},p||b?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:N=>N?n.jsx(No,{onClick:()=>{t(`/.well-known/service/admin/members?did=${N}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:N}):null}},p||b?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:N=>{const D=(u.children||[]).find(U=>U.meta.did===N);return D?n.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[n.jsx(Ht,{size:14,blocklet:D,ancestors:[u]}),n.jsx(g,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:D.meta.title})]},N):""}}},p||o?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:N=>n.jsx(g,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:n.jsx(xe,{children:N})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:N=>n.jsx(pn,{value:Number(N),locale:r})}},{label:s("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:N=>{const D=S[N];return n.jsxs(g,{display:"flex",children:[n.jsx(pe,{to:`${D.id}/new-release/${D.lastReleaseId}`,children:n.jsx(ge,{title:s("blocklet.publish.createRelease"),placement:"top",children:n.jsx(ie,{color:"primary","aria-label":"create",children:n.jsx(Dn,{style:{fontSize:18}})})})}),!!D.lastReleaseId&&n.jsx(ge,{title:s("blocklet.publish.viewLastRelease",{name:D.blockletTitle}),placement:"top",children:n.jsx(ie,{color:"secondary","aria-label":"create",children:n.jsx(pe,{style:{display:"flex"},to:`${D.id}/view/${D.lastReleaseId}`,children:n.jsx(_n,{sx:{fontSize:18}})})})}),n.jsx(ge,{title:s("blocklet.publish.delete",{name:D.blockletTitle}),placement:"top",children:n.jsx(ie,{color:"primary","aria-label":"delete",onClick:()=>T(D),children:n.jsx(Sn,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),F=x?n.jsx(Rs,{open:!0,popup:!0,onClose:C,action:"check-has-project-id",locale:r,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:_,onError:P,extraParams:{projectId:f.id,did:u.meta.did,name:f.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:f.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:f.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return n.jsxs(g,{children:[n.jsxs(g,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsxs(g,{display:"flex",flexDirection:"row",alignItems:"center",children:[n.jsx(g,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),n.jsx(ge,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:n.jsx(En,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),n.jsxs(ct,{onClick:R,variant:"contained",children:[n.jsx(Vt,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),n.jsx(Wt,{className:"main-table",locale:r,data:S,columns:w,options:{sort:!1,download:!1,filter:!1,print:!1,search:!0,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100],searchPlaceholder:s("blocklet.list.searchPlaceholder"),searchDebounceTime:400,customSearch:E}}),f&&n.jsx(Ut,{title:`${s("common.delete")} ${f.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:v,onCancel:()=>m(null),children:n.jsx(g,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(N=>n.jsxs(g,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[n.jsx(zs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),n.jsx(V,{component:"span",variant:"inherit",color:"text.secondary",children:N})]}))})}),F]})}Zt.propTypes={initUrl:h.object};Zt.defaultProps={initUrl:null};var eo={},Xr=Se;Object.defineProperty(eo,"__esModule",{value:!0});var $n=eo.default=void 0,Jr=Xr(ke()),Ao=n;$n=eo.default=(0,Jr.default)([(0,Ao.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,Ao.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");function Qr(){var v;const{t:e,locale:t}=ee(),{projectId:o}=ht(),{api:s}=Ce(),[r,i]=k.useState(!0),{blocklet:l}=$e(),c=Je(C=>C.breakpoints.down("md")),[a,u]=k.useState(null),[f,m]=k.useState(null),[x,d]=k.useState(null),p=(v=window.env)==null?void 0:v.serverEndpoint,b=()=>{s.getReleases({input:{did:l.meta.did,projectId:o}}).then(C=>{const P=(C==null?void 0:C.releases)||[];i(!1),u(P)}).catch(C=>{i(!1),A.error(C.message)})},S=()=>{s.doBatchQuery({getProject:{input:{did:l.meta.did,projectId:o}},getReleases:{input:{did:l.meta.did,projectId:o}}}).then(C=>{m(C.getProject.project||{}),u(C.getReleases.releases||[]),i(!1)}).catch(C=>{i(!1),A.error(C.message)})};k.useEffect(()=>{S()},[]);const j=()=>{i(!1);const C=x.id;s.deleteRelease({input:{did:l.meta.did,projectId:o,releaseId:C}}).then(()=>{i(!1),b(),A.success(e("common.removeSuccess")),d(null)}).catch(P=>{i(!1),A.error(P.message)})},y=C=>{d(C)};if(!a&&r)return n.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:n.jsx(Qe,{})});if(!a)return null;const R=n.jsxs(Nn,{className:"breadcrumbs","aria-label":"breadcrumb",children:[n.jsx(pe,{to:"..",children:e("common.blockletStudio")}),n.jsx(V,{color:"text.primary",children:n.jsx(xe,{maxLength:c?6:30,children:f.blockletTitle})})]});if(!a.length)return n.jsxs(n.Fragment,{children:[R,n.jsxs(g,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[n.jsx(g,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),n.jsx(g,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),n.jsx(pe,{to:"create/none",children:n.jsx(ct,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const T=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:C=>{const P=a[C];return n.jsx(pe,{to:`view/${P.id}`,children:n.jsx(Yt,{did:l.meta.did,projectId:f.id,logo:P.blockletLogo,title:P.blockletVersion,describe:P.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:C=>{const P=a[C];return n.jsx(V,{className:"note",children:P.note||""})}}},{label:e("common.status"),name:"status",options:{customBodyRender:C=>n.jsx(Cn,{type:C==="published"?"success":"warning",children:C==="published"?"Released":ws(C)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:C=>{const P=a[C];return P.status!==Te.PROJECT.RELEASE_STATUS.published?"":n.jsx(pn,{value:Number(P.updatedAt),locale:t})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:C=>{var N;const P=a[C];let _="",E="";const w=P.status==="published";if(w){const D=fe(p,`/api/project/${l.meta.did}/${f.id}/${f.lastReleaseId}/release/blocklet.json`),U=new URL(p);U.pathname=fe(U.pathname,"/launch-blocklet/agreement"),U.searchParams.set("blocklet_meta_url",D),_=U.href,E=fe(`${K.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${l.meta.did}/${f.id}/${f.lastReleaseId}/download/${(f.lastReleaseFiles||[])[0]}`)}const F=(N=f.blockletComponents)!=null&&N.some(D=>D.included)||P.uploadedResource?"pack":"resource";return n.jsxs(g,{display:"flex",alignItems:"center",children:[w&&F==="pack"&&n.jsx(ge,{title:e("blocklet.publish.install",{name:f.blockletTitle}),placement:"top",children:n.jsx(ie,{color:"secondary","aria-label":"create",children:n.jsx("a",{style:{display:"flex"},href:_,target:"_blank",rel:"noreferrer",children:n.jsx($n,{sx:{fontSize:18}})})})}),w&&n.jsx(ge,{title:e("blocklet.publish.download",{name:f.blockletTitle}),placement:"top",children:n.jsx(ie,{color:"primary","aria-label":"download",children:n.jsx("a",{style:{display:"flex"},href:E,children:n.jsx(Ws,{sx:{fontSize:18}})})})}),n.jsx(ge,{title:e("blocklet.publish.delete",{name:f.blockletTitle}),placement:"top",children:n.jsx(ie,{color:"primary","aria-label":"delete",onClick:()=>y(P),children:n.jsx(Sn,{sx:{fontSize:18}})})})]})}}}];return n.jsxs(Yr,{children:[n.jsxs(g,{className:"header",children:[R,n.jsx(pe,{to:"new-release/none",children:n.jsxs(ct,{variant:"contained",children:[n.jsx(Vt,{style:{fontSize:"1.3em",marginRight:4}}),e("blocklet.publish.createRelease")]})})]}),n.jsx(Wt,{className:"main-table",verticalKeyWidth:100,locale:t,data:a,columns:T,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&n.jsx(Ut,{title:e(`${e("common.delete")} ${x.blockletVersion}`),description:e("blocklet.publish.deleteReleaseTip"),confirm:e("common.confirm"),onConfirm:j,onCancel:()=>d(null)})]})}const Yr=he(g)`
|
|
3
|
-
.header {
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
}
|
|
8
|
-
.main-table {
|
|
9
|
-
margin-top: 24px;
|
|
10
|
-
}
|
|
11
|
-
.main-table > div:first-child {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|
|
14
|
-
.note {
|
|
15
|
-
word-break: break-all;
|
|
16
|
-
white-space: pre-line;
|
|
17
|
-
}
|
|
18
|
-
`;var to={},Zr=Se;Object.defineProperty(to,"__esModule",{value:!0});var Ln=to.default=void 0,ei=Zr(ke()),ti=n;Ln=to.default=(0,ei.default)((0,ti.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"DoDisturbAlt");function Pe({children:e,Icon:t}){return n.jsxs(Is,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:"10px",margin:"10px 0px"},children:[n.jsx(g,{sx:{opacity:.3,fontSize:32},children:n.jsx(t,{})}),n.jsx(g,{sx:{mb:2,opacity:.7,fontSize:"small",color:"action"},children:e})]})}Pe.propTypes={children:h.node.isRequired,Icon:h.elementType};Pe.defaultProps={Icon:Ln};function oo({value:e,app:t,onChange:o,onChangeBlockletResourceType:s,disabled:r,resourceRelateComponents:i,projectType:l,dependentComponentsMode:c,blockletResourceType:a}){const{t:u,locale:f}=ee(),m=c==="readonly",x=k.useMemo(()=>{const R=e.reduce((T,v)=>(T[v.did]=v.included,T),{});return(t.children||[]).filter(T=>m?i[T.meta.did]||R[T.meta.did]:!0)},[t.children,e,i,m]),d=k.useMemo(()=>x.map(R=>e.find(v=>v.did===R.meta.did)||{did:R.meta.did}),[x,e]),p=d.reduce((R,T)=>(R[T.did]=Ft(T,["required","included"]),R),{}),b=R=>{const T=d.map(v=>{if(v.did===R){const C=!v.included;return{...v,included:C,required:C}}return v});o(T)},S=R=>{const T=d.map(v=>v.did===R?{...v,required:!v.required}:v);o(T)},j=R=>{s(R.target.checked?"resource":"")},y=[{label:u("common.name"),name:"meta.title",width:200,options:{customBodyRenderLite:R=>{var C;const T=x[R],v=(C=p[T.meta.did])==null?void 0:C.included;return n.jsxs(g,{display:"flex",alignItems:"center",children:[n.jsx(Ht,{size:24,blocklet:T,ancestors:[t]}),n.jsx(g,{ml:"4px",className:Kt("text",{excluded:!v}),children:n.jsx(g,{children:T.meta.title})})]})}}},{label:u("blocklet.publish.componentIncluded"),width:100,options:{customBodyRenderLite:R=>{var P;const T=x[R],v=i[T.meta.did],C=!!((P=p[T.meta.did])!=null&&P.included);return n.jsx(nt,{size:"small",checked:v||C,onClick:()=>b(T.meta.did),disabled:m||v||r})}}},{label:u("blocklet.publish.componentForceRequired"),width:100,options:{customBodyRenderLite:R=>{var _,E;const T=x[R],v=i[T.meta.did],C=!!((_=p[T.meta.did])!=null&&_.included),P=!!((E=p[T.meta.did])!=null&&E.required);return n.jsx(nt,{size:"small",checked:v||P&&C,onClick:()=>S(T.meta.did),disabled:m||v||r||!C})}}}];return n.jsx(oi,{children:x!=null&&x.length?n.jsxs(n.Fragment,{children:[n.jsxs(vn,{severity:"info",style:{width:"100%"},children:[n.jsx(g,{display:"flex",alignItems:"center",rel:"noreferrer",ml:"13px",children:u(l==="pack"?"blocklet.publish.packTip":"blocklet.publish.resourceTip")}),n.jsxs(g,{component:"label",style:{cursor:"pointer"},children:[n.jsx(nt,{size:"small",style:{marginLeft:"0px"},disabled:r,checked:a==="resource",onChange:j}),u("blocklet.publish.forceResourceBlocklet")]})]}),n.jsx(Wt,{className:"main-table",verticalKeyWidth:100,locale:f,data:x,columns:y,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1,rowsPerPage:50}})]}):n.jsx(Pe,{Icon:Gt,children:u("blocklet.publish.blockletEmptyTip")})})}oo.propTypes={app:h.object.isRequired,value:h.arrayOf(h.shape({did:h.string.isRequired,required:h.bool,included:h.bool})),onChange:h.func,onChangeBlockletResourceType:h.func,disabled:h.bool,dependentComponentsMode:h.string,resourceRelateComponents:h.object,blockletResourceType:h.string,projectType:h.string.isRequired};oo.defaultProps={value:[],onChange:()=>{},onChangeBlockletResourceType:()=>{},disabled:!1,dependentComponentsMode:"auto",blockletResourceType:"",resourceRelateComponents:{}};const oi=he(g)`
|
|
19
|
-
.main-table {
|
|
20
|
-
.text.excluded {
|
|
21
|
-
color: #999;
|
|
22
|
-
}
|
|
23
|
-
width: 400px;
|
|
24
|
-
${({theme:e})=>e.breakpoints.down("md")} {
|
|
25
|
-
width: 100%;
|
|
26
|
-
}
|
|
27
|
-
> div:first-child {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
.MuiTableCell-head {
|
|
31
|
-
padding-top: 0;
|
|
32
|
-
padding-bottom: 0;
|
|
33
|
-
}
|
|
34
|
-
.MuiTableCell-body {
|
|
35
|
-
padding-top: 6px;
|
|
36
|
-
padding-bottom: 6px;
|
|
37
|
-
}
|
|
38
|
-
.datatable-footer {
|
|
39
|
-
display: none;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
`;function ni(e,t){const o=new Set(t||[]),s=[];function r(i){o.has(i==null?void 0:i.id)&&s.push(i==null?void 0:i.id),i!=null&&i.children&&i.children.forEach(r)}return(e||[]).forEach(r),s}function si(e){return Ke("MuiTreeView",e)}He("MuiTreeView",["root"]);const Mn={instance:null,multiSelect:!1,disabledItemsFocusable:!1,treeId:void 0,icons:{defaultCollapseIcon:null,defaultExpandIcon:null,defaultParentIcon:null,defaultEndIcon:null}},On=k.createContext(Mn),ri=(e,t)=>{const o=k.useRef({}),[s,r]=k.useState(()=>{const l={};return e.forEach(c=>{c.models&&Object.entries(c.models).forEach(([a,u])=>{o.current[a]={controlledProp:u.controlledProp,defaultProp:u.defaultProp,isControlled:t[u.controlledProp]!==void 0},l[a]=t[u.defaultProp]})}),l});return Object.fromEntries(Object.entries(o.current).map(([l,c])=>{const a=c.isControlled?t[c.controlledProp]:s[l];return[l,{value:a,setValue:u=>{c.isControlled||r(f=>B({},f,{[l]:u}))}}]}))};class ii{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,o,s={}){let r=this.events[t];r||(r={highPriority:new Map,regular:new Map},this.events[t]=r),s.isFirst?r.highPriority.set(o,!0):r.regular.set(o,!0)}removeListener(t,o){this.events[t]&&(this.events[t].regular.delete(o),this.events[t].highPriority.delete(o))}removeAllListeners(){this.events={}}emit(t,...o){const s=this.events[t];if(!s)return;const r=Array.from(s.highPriority.keys()),i=Array.from(s.regular.keys());for(let l=r.length-1;l>=0;l-=1){const c=r[l];s.highPriority.has(c)&&c.apply(this,o)}for(let l=0;l<i.length;l+=1){const c=i[l];s.regular.has(c)&&c.apply(this,o)}}once(t,o){const s=this;this.on(t,function r(...i){s.removeListener(t,r),o.apply(s,i)})}}const St=(e,t)=>{const o=e.getNode(t),s=e.getNavigableChildrenIds(o.parentId),r=s.indexOf(t);if(r===0)return o.parentId;let i=s[r-1];for(;e.isNodeExpanded(i)&&e.getNavigableChildrenIds(i).length>0;)i=e.getNavigableChildrenIds(i).pop();return i},Ae=(e,t)=>{if(e.isNodeExpanded(t)&&e.getNavigableChildrenIds(t).length>0)return e.getNavigableChildrenIds(t)[0];let o=e.getNode(t);for(;o!=null;){const s=e.getNavigableChildrenIds(o.parentId),r=s[s.indexOf(o.id)+1];if(r)return r;o=e.getNode(o.parentId)}return null},Pt=e=>{let t=e.getNavigableChildrenIds(null).pop();for(;e.isNodeExpanded(t);)t=e.getNavigableChildrenIds(t).pop();return t},Nt=e=>e.getNavigableChildrenIds(null)[0],Le=(e,t)=>{Object.assign(e,t)},li=e=>e.isPropagationStopped!==void 0,ci=({instance:e})=>{const[t]=k.useState(()=>new ii),o=k.useCallback((...r)=>{const[i,l,c={}]=r;c.defaultMuiPrevented=!1,!(li(c)&&c.isPropagationStopped())&&t.emit(i,l,c)},[t]),s=k.useCallback((r,i)=>(t.on(r,i),()=>{t.removeListener(r,i)}),[t]);Le(e,{$$publishEvent:o,$$subscribeEvent:s})},ai=[ci],di=e=>{const t=[...ai,...e.plugins],o=t.reduce((p,b)=>b.getDefaultizedParams?b.getDefaultizedParams(p):p,e),s=ri(t,o),i=k.useRef({}).current,l=k.useRef(null),c=fn(l,e.rootRef),[a,u]=k.useState(()=>{const p={};return t.forEach(b=>{b.getInitialState&&Object.assign(p,b.getInitialState(o))}),p}),f=[];let m=Mn;const x=p=>{const b=p({instance:i,params:o,state:a,setState:u,rootRef:l,models:s})||{};b.getRootProps&&f.push(b.getRootProps),b.contextValue&&(m=b.contextValue)};return t.forEach(x),{getRootProps:(p={})=>{const b=B({role:"tree",tabIndex:0},p,{ref:c});return f.forEach(S=>{Object.assign(b,S(p))}),b},rootRef:c,contextValue:m}},ui=["element"];function pi(e,t){for(let o=0;o<e.length;o+=1)if(t(e[o]))return o;return-1}function fi(e,t){let o=0,s=e.length-1;for(;o<=s;){const r=Math.floor((o+s)/2);if(e[r].element===t)return r;e[r].element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?s=r-1:o=r+1}return o}const qn=k.createContext({});function hi(e){const t=k.useRef(null);return k.useEffect(()=>{t.current=e},[e]),t.current}const Bo=()=>{};function mi(e){const[,t]=k.useState(),{registerDescendant:o=Bo,unregisterDescendant:s=Bo,descendants:r=[],parentId:i=null}=k.useContext(qn),l=pi(r,u=>u.element===e.element),c=hi(r),a=r.some((u,f)=>c&&c[f]&&c[f].element!==u.element);return Ts(()=>{if(e.element)return o(B({},e,{index:l})),()=>{s(e.element)};t({})},[o,s,l,a,e]),{parentId:i,index:l}}function An(e){const{children:t,id:o}=e,[s,r]=k.useState([]),i=k.useCallback(a=>{let{element:u}=a,f=je(a,ui);r(m=>{if(m.length===0)return[B({},f,{element:u,index:0})];const x=fi(m,u);let d;if(m[x]&&m[x].element===u)d=m;else{const p=B({},f,{element:u,index:x});d=m.slice(),d.splice(x,0,p)}return d.forEach((p,b)=>{p.index=b}),d})},[]),l=k.useCallback(a=>{r(u=>u.filter(f=>a!==f.element))},[]),c=k.useMemo(()=>({descendants:s,registerDescendant:i,unregisterDescendant:l,parentId:o}),[s,i,l,o]);return n.jsx(qn.Provider,{value:c,children:t})}function bi(e){const{value:t,children:o}=e;return n.jsx(On.Provider,{value:t,children:n.jsx(An,{children:o})})}const gi=(e,t,o)=>{e.$$publishEvent(t,o)},xi=({instance:e,params:t})=>{const o=k.useRef({}),s=k.useCallback(u=>o.current[u],[]),r=k.useCallback(u=>{o.current[u.id]=u},[]),i=k.useCallback(u=>{const f=B({},o.current);delete f[u],o.current=f,gi(e,"removeNode",{id:u})},[e]),l=k.useCallback(u=>{if(u==null)return!1;let f=e.getNode(u);if(!f)return!1;if(f.disabled)return!0;for(;f.parentId!=null;)if(f=e.getNode(f.parentId),f.disabled)return!0;return!1},[e]),c=Ve(u=>Object.values(o.current).filter(f=>f.parentId===u).sort((f,m)=>f.index-m.index).map(f=>f.id));Le(e,{getNode:s,updateNode:r,removeNode:i,getChildrenIds:c,getNavigableChildrenIds:u=>{let f=e.getChildrenIds(u);return t.disabledItemsFocusable||(f=f.filter(m=>!e.isNodeDisabled(m))),f},isNodeDisabled:l})},no=({instance:e,params:t,models:o})=>{const s=k.useCallback(c=>Array.isArray(o.expanded.value)?o.expanded.value.indexOf(c)!==-1:!1,[o.expanded.value]),r=k.useCallback(c=>{var a;return!!((a=e.getNode(c))!=null&&a.expandable)},[e]),i=Ve((c,a)=>{if(a==null)return;let u;o.expanded.value.indexOf(a)!==-1?u=o.expanded.value.filter(f=>f!==a):u=[a].concat(o.expanded.value),t.onNodeToggle&&t.onNodeToggle(c,u),o.expanded.setValue(u)});Le(e,{isNodeExpanded:s,isNodeExpandable:r,toggleNodeExpansion:i,expandAllSiblings:(c,a)=>{const u=e.getNode(a),m=e.getChildrenIds(u.parentId).filter(d=>e.isNodeExpandable(d)&&!e.isNodeExpanded(d)),x=o.expanded.value.concat(m);m.length>0&&(o.expanded.setValue(x),t.onNodeToggle&&t.onNodeToggle(c,x))}})};no.models={expanded:{controlledProp:"expanded",defaultProp:"defaultExpanded"}};const yi=[];no.getDefaultizedParams=e=>{var t;return B({},e,{defaultExpanded:(t=e.defaultExpanded)!=null?t:yi})};const ji=(e,t,o)=>{if(t===o)return[t,o];const s=e.getNode(t),r=e.getNode(o);if(s.parentId===r.id||r.parentId===s.id)return r.parentId===s.id?[s.id,r.id]:[r.id,s.id];const i=[s.id],l=[r.id];let c=s.parentId,a=r.parentId,u=l.indexOf(c)!==-1,f=i.indexOf(a)!==-1,m=!0,x=!0;for(;!f&&!u;)m&&(i.push(c),u=l.indexOf(c)!==-1,m=c!==null,!u&&m&&(c=e.getNode(c).parentId)),x&&!u&&(l.push(a),f=i.indexOf(a)!==-1,x=a!==null,!f&&x&&(a=e.getNode(a).parentId));const d=u?c:a,p=e.getChildrenIds(d),b=i[i.indexOf(d)-1],S=l[l.indexOf(d)-1];return p.indexOf(b)<p.indexOf(S)?[t,o]:[o,t]},so=({instance:e,params:t,models:o})=>{const s=k.useRef(null),r=k.useRef(!1),i=k.useRef([]),l=p=>Array.isArray(o.selected.value)?o.selected.value.indexOf(p)!==-1:o.selected.value===p,c=(p,b,S=!1)=>{if(!t.disableSelection){if(S){if(Array.isArray(o.selected.value)){let j;o.selected.value.indexOf(b)!==-1?j=o.selected.value.filter(y=>y!==b):j=[b].concat(o.selected.value),t.onNodeSelect&&t.onNodeSelect(p,j),o.selected.setValue(j)}}else{const j=t.multiSelect?[b]:b;t.onNodeSelect&&t.onNodeSelect(p,j),o.selected.setValue(j)}s.current=b,r.current=!1,i.current=[]}},a=(p,b)=>{const[S,j]=ji(e,p,b),y=[S];let R=S;for(;R!==j;)R=Ae(e,R),y.push(R);return y},u=(p,b)=>{let S=o.selected.value.slice();const{start:j,next:y,current:R}=b;!y||!R||(i.current.indexOf(R)===-1&&(i.current=[]),r.current?i.current.indexOf(y)!==-1?(S=S.filter(T=>T===j||T!==R),i.current=i.current.filter(T=>T===j||T!==R)):(S.push(y),i.current.push(y)):(S.push(y),i.current.push(R,y)),t.onNodeSelect&&t.onNodeSelect(p,S),o.selected.setValue(S))},f=(p,b)=>{let S=o.selected.value.slice();const{start:j,end:y}=b;r.current&&(S=S.filter(v=>i.current.indexOf(v)===-1));let R=a(j,y);R=R.filter(v=>!e.isNodeDisabled(v)),i.current=R;let T=S.concat(R);T=T.filter((v,C)=>T.indexOf(v)===C),t.onNodeSelect&&t.onNodeSelect(p,T),o.selected.setValue(T)};return Le(e,{isNodeSelected:l,selectNode:c,selectRange:(p,b,S=!1)=>{if(t.disableSelection)return;const{start:j=s.current,end:y,current:R}=b;S?u(p,{start:j,next:y,current:R}):j!=null&&y!=null&&f(p,{start:j,end:y}),r.current=!0},rangeSelectToLast:(p,b)=>{s.current||(s.current=b);const S=r.current?s.current:b;e.selectRange(p,{start:S,end:Pt(e)})},rangeSelectToFirst:(p,b)=>{s.current||(s.current=b);const S=r.current?s.current:b;e.selectRange(p,{start:S,end:Nt(e)})}}),{getRootProps:()=>({"aria-multiselectable":t.multiSelect})}};so.models={selected:{controlledProp:"selected",defaultProp:"defaultSelected"}};const ki=[];so.getDefaultizedParams=e=>{var t,o,s;return B({},e,{disableSelection:(t=e.disableSelection)!=null?t:!1,multiSelect:(o=e.multiSelect)!=null?o:!1,defaultSelected:(s=e.defaultSelected)!=null?s:e.multiSelect?ki:null})};const Fo=1e3;class Si{constructor(t=Fo){this.timeouts=new Map,this.cleanupTimeout=Fo,this.cleanupTimeout=t}register(t,o,s){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{typeof o=="function"&&o(),this.timeouts.delete(s.cleanupToken)},this.cleanupTimeout);this.timeouts.set(s.cleanupToken,r)}unregister(t){const o=this.timeouts.get(t.cleanupToken);o&&(this.timeouts.delete(t.cleanupToken),clearTimeout(o))}reset(){this.timeouts&&(this.timeouts.forEach((t,o)=>{this.unregister({cleanupToken:o})}),this.timeouts=void 0)}}class Ci{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,o,s){this.registry.register(t,o,s)}unregister(t){this.registry.unregister(t)}reset(){}}class Ri{}function vi(e){let t=0;return function(s,r,i){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new Ci:new Si);const[l]=k.useState(new Ri),c=k.useRef(null),a=k.useRef();a.current=i;const u=k.useRef(null);if(!c.current&&a.current){const f=(m,x)=>{if(!x.defaultMuiPrevented){var d;(d=a.current)==null||d.call(a,m,x)}};c.current=s.$$subscribeEvent(r,f),t+=1,u.current={cleanupToken:t},e.registry.register(l,()=>{var m;(m=c.current)==null||m.call(c),c.current=null,u.current=null},u.current)}else!a.current&&c.current&&(c.current(),c.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));k.useEffect(()=>{if(!c.current&&a.current){const f=(m,x)=>{if(!x.defaultMuiPrevented){var d;(d=a.current)==null||d.call(a,m,x)}};c.current=s.$$subscribeEvent(r,f)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{var f;(f=c.current)==null||f.call(c),c.current=null}},[s,r])}}const wi={registry:null},Ii=vi(wi),ro=({instance:e,params:t,state:o,setState:s,models:r,rootRef:i})=>{const l=Ve(d=>{const p=typeof d=="function"?d(o.focusedNodeId):d;s(b=>B({},b,{focusedNodeId:p}))}),c=k.useCallback(d=>o.focusedNodeId===d,[o.focusedNodeId]),a=Ve((d,p)=>{p&&(l(p),t.onNodeFocus&&t.onNodeFocus(d,p))});Le(e,{isNodeFocused:c,focusNode:a}),Ii(e,"removeNode",({id:d})=>{l(p=>p===d&&i.current===hn(i.current).activeElement?e.getChildrenIds(null)[0]:p)});const u=d=>p=>{var b;if((b=d.onFocus)==null||b.call(d,p),p.target===p.currentTarget){const S=y=>{const R=e.getNode(y);return R&&(R.parentId==null||e.isNodeExpanded(R.parentId))};let j;Array.isArray(r.selected.value)?j=r.selected.value.find(S):r.selected.value!=null&&S(r.selected.value)&&(j=r.selected.value),j==null&&(j=e.getNavigableChildrenIds(null)[0]),e.focusNode(p,j)}},f=d=>p=>{var b;(b=d.onBlur)==null||b.call(d,p),l(null)},m=e.getNode(o.focusedNodeId),x=m?m.idAttribute:null;return{getRootProps:d=>({onFocus:u(d),onBlur:f(d),"aria-activedescendant":x??void 0})}};ro.getInitialState=()=>({focusedNodeId:null});ro.getDefaultizedParams=e=>{var t;return B({},e,{disabledItemsFocusable:(t=e.disabledItemsFocusable)!=null?t:!1})};function Ti(e){return e&&e.length===1&&e.match(/\S/)}function zo(e,t,o){for(let s=t;s<e.length;s+=1)if(o===e[s])return s;return-1}const Pi=({instance:e,params:t,state:o})=>{const r=Ps().direction==="rtl",i=k.useRef({}),l=Ve((d,p)=>(i.current[d]=p,()=>{const b=B({},i.current);delete b[d],i.current=b}));Le(e,{mapFirstChar:l});const c=d=>(o.focusedNodeId!=null&&e.isNodeExpandable(o.focusedNodeId)&&(e.isNodeExpanded(o.focusedNodeId)?e.focusNode(d,Ae(e,o.focusedNodeId)):e.isNodeDisabled(o.focusedNodeId)||e.toggleNodeExpansion(d,o.focusedNodeId)),!0),a=d=>{if(o.focusedNodeId==null)return!1;if(e.isNodeExpanded(o.focusedNodeId)&&!e.isNodeDisabled(o.focusedNodeId))return e.toggleNodeExpansion(d,o.focusedNodeId),!0;const p=e.getNode(o.focusedNodeId).parentId;return p?(e.focusNode(d,p),!0):!1},u=(d,p,b)=>{let S,j;const y=b.toLowerCase(),R=[],T=[];Object.keys(i.current).forEach(v=>{const C=e.getNode(v),P=C.parentId?e.isNodeExpanded(C.parentId):!0,_=t.disabledItemsFocusable?!1:e.isNodeDisabled(v);P&&!_&&(R.push(v),T.push(i.current[v]))}),S=R.indexOf(p)+1,S>=R.length&&(S=0),j=zo(T,S,y),j===-1&&(j=zo(T,0,y)),j>-1&&e.focusNode(d,R[j])},f=(d,p)=>{e.isNodeDisabled(Ae(e,p))||e.selectRange(d,{end:Ae(e,p),current:p},!0)},m=(d,p)=>{e.isNodeDisabled(St(e,p))||e.selectRange(d,{end:St(e,p),current:p},!0)},x=d=>p=>{var b;(b=d.onKeyDown)==null||b.call(d,p);let S=!1;const j=p.key;if(p.altKey||p.currentTarget!==p.target||o.focusedNodeId==null)return;const y=p.ctrlKey||p.metaKey;switch(j){case" ":!t.disableSelection&&!e.isNodeDisabled(o.focusedNodeId)&&(S=!0,t.multiSelect&&p.shiftKey?e.selectRange(p,{end:o.focusedNodeId}):t.multiSelect?e.selectNode(p,o.focusedNodeId,!0):e.selectNode(p,o.focusedNodeId)),p.stopPropagation();break;case"Enter":e.isNodeDisabled(o.focusedNodeId)||(e.isNodeExpandable(o.focusedNodeId)?(e.toggleNodeExpansion(p,o.focusedNodeId),S=!0):t.disableSelection||(S=!0,t.multiSelect?e.selectNode(p,o.focusedNodeId,!0):e.selectNode(p,o.focusedNodeId))),p.stopPropagation();break;case"ArrowDown":t.multiSelect&&p.shiftKey&&!t.disableSelection&&f(p,o.focusedNodeId),e.focusNode(p,Ae(e,o.focusedNodeId)),S=!0;break;case"ArrowUp":t.multiSelect&&p.shiftKey&&!t.disableSelection&&m(p,o.focusedNodeId),e.focusNode(p,St(e,o.focusedNodeId)),S=!0;break;case"ArrowRight":r?S=a(p):S=c(p);break;case"ArrowLeft":r?S=c(p):S=a(p);break;case"Home":t.multiSelect&&y&&p.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(o.focusedNodeId)&&e.rangeSelectToFirst(p,o.focusedNodeId),e.focusNode(p,Nt(e)),S=!0;break;case"End":t.multiSelect&&y&&p.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(o.focusedNodeId)&&e.rangeSelectToLast(p,o.focusedNodeId),e.focusNode(p,Pt(e)),S=!0;break;default:j==="*"?(e.expandAllSiblings(p,o.focusedNodeId),S=!0):t.multiSelect&&y&&j.toLowerCase()==="a"&&!t.disableSelection?(e.selectRange(p,{start:Nt(e),end:Pt(e)}),S=!0):!y&&!p.shiftKey&&Ti(j)&&(u(p,o.focusedNodeId,j),S=!0)}S&&(p.preventDefault(),p.stopPropagation())};return{getRootProps:d=>({onKeyDown:x(d)})}},Ni=({instance:e,params:t})=>{const o=Ns(t.id);return{getRootProps:()=>({id:o}),contextValue:{treeId:o,instance:e,multiSelect:t.multiSelect,disabledItemsFocusable:t.disabledItemsFocusable,icons:{defaultCollapseIcon:t.defaultCollapseIcon,defaultEndIcon:t.defaultEndIcon,defaultExpandIcon:t.defaultExpandIcon,defaultParentIcon:t.defaultParentIcon}}}},Di=[xi,no,so,ro,Pi,Ni],_i=["disabledItemsFocusable","expanded","defaultExpanded","onNodeToggle","onNodeFocus","disableSelection","defaultSelected","selected","multiSelect","onNodeSelect","id","defaultCollapseIcon","defaultEndIcon","defaultExpandIcon","defaultParentIcon","children"],Ei=e=>{const{classes:t}=e;return Xe({root:["root"]},si,t)},Vo=le("ul",{name:"MuiTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0}),$i=k.forwardRef(function(t,o){const s=wn({props:t,name:"MuiTreeView"}),r=s,i=s,{disabledItemsFocusable:l,expanded:c,defaultExpanded:a,onNodeToggle:u,onNodeFocus:f,disableSelection:m,defaultSelected:x,selected:d,multiSelect:p,onNodeSelect:b,id:S,defaultCollapseIcon:j,defaultEndIcon:y,defaultExpandIcon:R,defaultParentIcon:T,children:v}=i,C=je(i,_i),{getRootProps:P,contextValue:_}=di({disabledItemsFocusable:l,expanded:c,defaultExpanded:a,onNodeToggle:u,onNodeFocus:f,disableSelection:m,defaultSelected:x,selected:d,multiSelect:p,onNodeSelect:b,id:S,defaultCollapseIcon:j,defaultEndIcon:y,defaultExpandIcon:R,defaultParentIcon:T,plugins:Di,rootRef:o}),E=Ei(s),w=un({elementType:Vo,externalSlotProps:{},externalForwardedProps:C,className:E.root,getSlotProps:P,ownerState:r});return n.jsx(bi,{value:_,children:n.jsx(Vo,B({},w,{children:v}))})}),Bn=()=>k.useContext(On);function Li(e){const{instance:t,multiSelect:o}=Bn(),s=t?t.isNodeExpandable(e):!1,r=t?t.isNodeExpanded(e):!1,i=t?t.isNodeFocused(e):!1,l=t?t.isNodeSelected(e):!1,c=t?t.isNodeDisabled(e):!1;return{disabled:c,expanded:r,selected:l,focused:i,handleExpansion:m=>{if(t&&!c){i||t.focusNode(m,e);const x=o&&(m.shiftKey||m.ctrlKey||m.metaKey);s&&!(x&&t.isNodeExpanded(e))&&t.toggleNodeExpansion(m,e)}},handleSelection:m=>{t&&!c&&(i||t.focusNode(m,e),o&&(m.shiftKey||m.ctrlKey||m.metaKey)?m.shiftKey?t.selectRange(m,{end:e}):t.selectNode(m,e,!0):t.selectNode(m,e))},preventSelection:m=>{(m.shiftKey||m.ctrlKey||m.metaKey||c)&&m.preventDefault()}}}const Mi=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"],Fn=k.forwardRef(function(t,o){const{classes:s,className:r,displayIcon:i,expansionIcon:l,icon:c,label:a,nodeId:u,onClick:f,onMouseDown:m}=t,x=je(t,Mi),{disabled:d,expanded:p,selected:b,focused:S,handleExpansion:j,handleSelection:y,preventSelection:R}=Li(u),T=c||l||i,v=P=>{R(P),m&&m(P)},C=P=>{j(P),y(P),f&&f(P)};return n.jsxs("div",B({},x,{className:Ge(r,s.root,p&&s.expanded,b&&s.selected,S&&s.focused,d&&s.disabled),onClick:C,onMouseDown:v,ref:o,children:[n.jsx("div",{className:s.iconContainer,children:T}),n.jsx("div",{className:s.label,children:a})]}))});function Oi(e){return Ke("MuiTreeItem",e)}const be=He("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]),qi=["children","className","collapseIcon","ContentComponent","ContentProps","endIcon","expandIcon","disabled","icon","id","label","nodeId","onClick","onMouseDown","TransitionComponent","TransitionProps"],Ai=e=>{const{classes:t}=e;return Xe({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],group:["group"]},Oi,t)},Bi=le("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Fi=le(Fn,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${be.iconContainer}`]:t.iconContainer},t.label&&{[`& .${be.label}`]:t.label}]})(({theme:e})=>({padding:"0 8px",width:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${be.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${be.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${be.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:et(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:et(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:et(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${be.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:et(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${be.iconContainer}`]:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${be.label}`]:B({paddingLeft:4,width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1)})),zi=le(ft,{name:"MuiTreeItem",slot:"Group",overridesResolver:(e,t)=>t.group})({margin:0,padding:0,marginLeft:17}),Vi=k.forwardRef(function(t,o){const s=wn({props:t,name:"MuiTreeItem"}),{children:r,className:i,collapseIcon:l,ContentComponent:c=Fn,ContentProps:a,endIcon:u,expandIcon:f,disabled:m,icon:x,id:d,label:p,nodeId:b,onClick:S,onMouseDown:j,TransitionComponent:y=ft,TransitionProps:R}=s,T=je(s,qi),{icons:v,multiSelect:C,disabledItemsFocusable:P,treeId:_,instance:E}=Bn();let w;d!=null?w=d:_&&b&&(w=`${_}-${b}`);const[F,N]=k.useState(null),D=k.useRef(null),U=fn(N,o),W=k.useMemo(()=>({element:F,id:b}),[b,F]),{index:I,parentId:M}=mi(W),$=!!(Array.isArray(r)?r.length:r),H=E?E.isNodeExpanded(b):!1,G=E?E.isNodeFocused(b):!1,Y=E?E.isNodeSelected(b):!1,X=E?E.isNodeDisabled(b):!1,J=B({},s,{expanded:H,focused:G,selected:Y,disabled:X}),ne=Ai(J);let me,ce;$&&(H?ce=l||v.defaultCollapseIcon:ce=f||v.defaultExpandIcon),$?me=v.defaultParentIcon:me=u||v.defaultEndIcon,k.useEffect(()=>{if(E&&I!==-1)return E.updateNode({id:b,idAttribute:w,index:I,parentId:M,expandable:$,disabled:m}),()=>E.removeNode(b)},[E,M,I,b,$,m,w]),k.useEffect(()=>{if(E&&p){var Z,Q;return E.mapFirstChar(b,((Z=(Q=D.current)==null?void 0:Q.textContent)!=null?Z:"").substring(0,1).toLowerCase())}},[E,b,p]);let te;C?te=Y:Y&&(te=!0);function Re(Z){if(Z.target===Z.currentTarget){let re;typeof Z.target.getRootNode=="function"?re=Z.target.getRootNode():re=hn(Z.target),re.getElementById(_).focus({preventScroll:!0})}const Q=!P&&X;E&&!G&&Z.currentTarget===Z.target&&!Q&&E.focusNode(Z,b)}return n.jsxs(Bi,B({className:Ge(ne.root,i),role:"treeitem","aria-expanded":$?H:void 0,"aria-selected":te,"aria-disabled":X||void 0,id:w,tabIndex:-1},T,{ownerState:J,onFocus:Re,ref:U,children:[n.jsx(Fi,B({as:c,ref:D,classes:{root:ne.content,expanded:ne.expanded,selected:ne.selected,focused:ne.focused,disabled:ne.disabled,iconContainer:ne.iconContainer,label:ne.label},label:p,nodeId:b,onClick:S,onMouseDown:j,icon:x,expansionIcon:ce,displayIcon:me,ownerState:J},a)),r&&n.jsx(An,{id:b,children:n.jsx(zi,B({as:y,unmountOnExit:!0,className:ne.group,in:H,component:"ul",role:"group"},R,{children:r}))})]}))});function io({data:e,...t}){return!e||!e.length?null:n.jsx(Wi,{...t,children:e.map(o=>n.jsx("a",{href:o.url,target:"_blank",rel:"noreferrer",children:n.jsx("img",{src:o.url,alt:o.alt||""})},o.url))})}io.propTypes={data:h.arrayOf(h.shape({url:h.string,alt:h.string}))};io.defaultProps={data:[]};const Wi=he(g)`
|
|
43
|
-
display: flex;
|
|
44
|
-
justify-content: flex-start;
|
|
45
|
-
flex-wrap: wrap;
|
|
46
|
-
margin-bottom: -12px;
|
|
47
|
-
a {
|
|
48
|
-
display: flex;
|
|
49
|
-
}
|
|
50
|
-
img {
|
|
51
|
-
height: 128px;
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
margin-right: 12px;
|
|
54
|
-
margin-bottom: 12px;
|
|
55
|
-
}
|
|
56
|
-
`,Ct=(e,t)=>{const o=[...e];for(;o.length>0;){const s=o.shift();if(s.id===t)return s;s.children&&o.push(...s.children)}return[]};function lo({icon:e}){return e?Gs(e)?n.jsx("img",{className:"resource-icon",src:e,alt:"icon"}):n.jsx(ae,{className:"resource-icon",icon:e}):null}lo.propTypes={icon:h.string};lo.defaultProps={icon:""};function co({disabled:e,data:t,onChange:o,value:s}){const r=s;function i(d,p=[]){return p.push(d.id),d.children&&d.children.forEach(b=>i(b,p)),p}const l=d=>i(Ct(t,d)),c=(d,p=[])=>{const b=Ct(t,d);return b.parent?(p.push(b.parent),c(b.parent,p)):p};function a(d,p){const b=l(d.id),S=b.indexOf(d.id);return b.splice(S,1),b.every(j=>r.concat(p).includes(j))}const u=(d,p)=>{d.stopPropagation();const b=l(p),S=c(p);if(r.includes(p)){const j=r.filter(y=>!b.concat(S).includes(y));o(j)}else{const j=b;for(let y=0;y<S.length;++y)a(Ct(t,S[y]),j)&&j.push(S[y]);o([...r].concat(j))}},f=d=>{d.stopPropagation()},m=t.some(d=>{var p;return((p=d.children)==null?void 0:p.length)>0}),x=d=>{var y;const p=r.indexOf(d.id)!==-1,b=Array.isArray(d.children),S=l(d.id),j=b&&!p&&r.some(R=>S.includes(R));return n.jsx(Vi,{nodeId:d.id,label:n.jsx(It,{onClick:f,control:n.jsx(nt,{size:"small",checked:p,indeterminate:j,tabIndex:-1,disableRipple:!0,onClick:R=>u(R,d.id),disabled:d.disabled||e}),label:n.jsxs(g,{className:"content",children:[n.jsxs(g,{display:"flex",alignItems:"center",children:[d.icon&&n.jsx(lo,{icon:d.icon}),n.jsx(g,{className:"name",children:d.name}),d.url&&n.jsx("a",{href:d.url,target:"_blank",rel:"noreferrer",className:"link",children:n.jsx(Qs,{className:"link-icon"})})]}),!!d.description&&n.jsx(g,{className:"description",children:d.description}),!!((y=d.images)!=null&&y.length)&&n.jsx(io,{className:"images",data:d.images})]})}),children:b?d.children.map(x):null},d.id)};return n.jsx(Ui,{className:Kt(!m&&"no-children"),multiSelect:!0,defaultCollapseIcon:n.jsx(Xs,{}),defaultExpandIcon:n.jsx(Js,{}),selected:r,children:t.map(d=>x(d))})}co.propTypes={data:h.array,value:h.array,onChange:h.func,disabled:h.bool};co.defaultProps={data:[],value:[],onChange:()=>{},disabled:!1};const Ui=he($i)`
|
|
57
|
-
&.no-children {
|
|
58
|
-
.MuiTreeItem-content {
|
|
59
|
-
padding: 0;
|
|
60
|
-
.MuiTreeItem-iconContainer {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|
|
63
|
-
.MuiTreeItem-label {
|
|
64
|
-
padding-left: 0;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
.MuiTreeItem-content {
|
|
69
|
-
align-items: flex-start;
|
|
70
|
-
.MuiTreeItem-iconContainer {
|
|
71
|
-
transform: translateY(10px);
|
|
72
|
-
}
|
|
73
|
-
&.Mui-selected {
|
|
74
|
-
background-color: transparent;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
.MuiTreeItem-label {
|
|
78
|
-
cursor: default;
|
|
79
|
-
}
|
|
80
|
-
.MuiFormControlLabel-root {
|
|
81
|
-
align-items: flex-start;
|
|
82
|
-
}
|
|
83
|
-
.content {
|
|
84
|
-
padding-top: 6px;
|
|
85
|
-
}
|
|
86
|
-
.name {
|
|
87
|
-
font-size: 16px;
|
|
88
|
-
font-weight: 700;
|
|
89
|
-
}
|
|
90
|
-
.resource-icon {
|
|
91
|
-
margin-right: 2px;
|
|
92
|
-
font-size: 16px;
|
|
93
|
-
}
|
|
94
|
-
img.resource-icon {
|
|
95
|
-
width: 1rem;
|
|
96
|
-
height: 1rem;
|
|
97
|
-
}
|
|
98
|
-
.link {
|
|
99
|
-
margin-left: 8px;
|
|
100
|
-
font-size: 16px;
|
|
101
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
102
|
-
display: flex;
|
|
103
|
-
}
|
|
104
|
-
.link-icon {
|
|
105
|
-
font-size: inherit;
|
|
106
|
-
}
|
|
107
|
-
.description {
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
color: ${({theme:e})=>e.palette.text.secondary};
|
|
110
|
-
}
|
|
111
|
-
`,st=(e,t)=>(e.forEach(o=>{t&&(o.parent=t),(o.children||[]).forEach(s=>{s.parent=o.id,st(s.children||[],s.id)})}),e),rt=(e,t,o,s,r)=>{const{exportApi:i="/"}=(e==null?void 0:e.meta.resource)||{},l=new URL(fe("http://127.0.0.1",e==null?void 0:e.mountPoint,i||"/").replace(/\/+/g,"/"));return l.searchParams.set("projectId",t),l.searchParams.set("releaseId",o),l.searchParams.set("local",s),r&&l.searchParams.set("resourcesParams",r.searchParams.get("resourcesParams")),`${l.pathname}${l.search}`},Hi=async({api:e,appDid:t,component:o,projectId:s,releaseId:r,locale:i,initUrl:l,resources:c})=>{let a;if(l&&l.searchParams.get("resourcesParams"))try{a=JSON.parse(l.searchParams.get("resourcesParams"))}catch(u){A.error(u.message);return}await ot.post(rt(o,s,r,i,l),{resources:c,projectId:s,releaseId:r,locale:i,...a?{resourcesParams:a}:{}},{headers:{"x-csrf-token":_s()}}),await e.updateSelectedResources({input:{did:t,projectId:s,releaseId:r,componentDid:o.meta.did,resources:c}})},Ki=(e,t)=>{if(!e)return{};const o=t.reduce((r,i)=>(r[i]=!0,r),{}),s=(r,i)=>(r.forEach(l=>{var c;o[l.id]&&((c=l.dependentComponents)!=null&&c.length)&&l.dependentComponents.forEach(a=>{i[a]=!0}),l.children&&s(l.children,i)}),i);return s(e,{})};function ao({app:e,component:t,projectId:o,release:s,loading:r,error:i,saveSelectedEventsRef:l,readOnly:c,componentDid:a,initialResources:u={},setResourceComponentsMap:f,selectedResourceIds:m,setSelectedResourceIds:x,initUrl:d}){var E;const{t:p,locale:b}=ee(),{api:S}=Ce(),[j,y]=De({}),R=k.useRef({}),T=k.useRef(!1),v=s.id;R.current.projectId=o,R.current.releaseId=v;const C=(w,F,N)=>{if(!F)return;const D=Ki(F,N);f==null||f({[w]:Object.keys(D)})},P=w=>{l.current[t.meta.did]={resources:w,component:t},x({[t.meta.did]:w}),C(t.meta.did,j[t.meta.did],w)};k.useEffect(()=>{j[t==null?void 0:t.meta.did]||ot.get(rt(t,o,v,b,d)).then(w=>{var N;const F=st(((N=w.data)==null?void 0:N.resources)||[]);y({[t==null?void 0:t.meta.did]:F})}).catch(w=>{A.error(w.message)})},[t,o,s,b,d,y,j,v]),k.useEffect(()=>{v&&o&&!T.current&&dt(e.children.map(w=>async()=>{var F,N,D;if(!(a&&a!==w.meta.did)&&!(!(w!=null&&w.mountPoint)||!Ds.hasStartEngine(w==null?void 0:w.meta)||!((N=(F=w==null?void 0:w.meta)==null?void 0:F.resource)!=null&&N.exportApi)))try{const U=await ot.get(rt(w,o,v,b,d)),W=st(((D=U==null?void 0:U.data)==null?void 0:D.resources)||[]);y({[w==null?void 0:w.meta.did]:W});const I=await S.getSelectedResources({input:{did:e.meta.did,projectId:o,releaseId:v,componentDid:w.meta.did}}),M=(I==null?void 0:I.resources)||[];M!=null&&M.length&&(x({[w.meta.did]:ni(W,M)}),C(w.meta.did,W,M),c||(l.current[w==null?void 0:w.meta.did]={resources:M,component:w}))}catch(U){A.error(U.message)}}),{concurrency:2}).then(()=>{T.current=!0})},[v,o,c,b,d,y]),k.useEffect(()=>{u&&Object.keys(u).length&&dt(e.children.map(async w=>{var N;const F=u[w.meta.did];if(F!=null&&F.length){const D=await ot.get(rt(w,o,v,b,d)),U=st(((N=D==null?void 0:D.data)==null?void 0:N.resources)||[]);x({[w.meta.did]:F}),C(w.meta.did,U,F),c||(l.current[w==null?void 0:w.meta.did]={resources:F,component:w})}}))},[e,u,c]);let _=null;return(!t||!((E=j[t.meta.did])!=null&&E.length))&&(_=n.jsx(Pe,{Icon:Gt,children:p("blocklet.publish.resourceEmptyTip",{name:To.getDisplayName(t)})})),(t==null?void 0:t.status)!=="running"&&(_=n.jsx(Pe,{children:p("blocklet.publish.componentNotRunning",{name:To.getDisplayName(t)})})),n.jsxs(n.Fragment,{children:[n.jsx(Gi,{className:Kt(i&&"error"),children:n.jsx(g,{pb:2,width:"100%",children:_||n.jsx(co,{data:j[t.meta.did]||[],value:m[t.meta.did]||[],onChange:P,disabled:r||c})})}),!!i&&n.jsx(g,{color:"error.main",mt:1,fontSize:14,children:i})]})}ao.propTypes={component:h.object.isRequired,app:h.object.isRequired,projectId:h.string.isRequired,error:h.string,saveSelectedEventsRef:h.object.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired,release:h.shape({id:h.string.isRequired,status:h.string}),initialResources:h.object,initUrl:h.object,setResourceComponentsMap:h.func,componentDid:h.string,selectedResourceIds:h.array.isRequired,setSelectedResourceIds:h.func.isRequired};ao.defaultProps={error:"",release:{id:""},initUrl:null,initialResources:{},setResourceComponentsMap:()=>{},componentDid:""};const Gi=he(g)`
|
|
112
|
-
border: 1px solid #ccc;
|
|
113
|
-
max-height: 600px;
|
|
114
|
-
width: 100%;
|
|
115
|
-
&.error {
|
|
116
|
-
border-color: ${e=>e.theme.palette.error.main};
|
|
117
|
-
}
|
|
118
|
-
border-radius: 4px;
|
|
119
|
-
padding: 16px;
|
|
120
|
-
padding-bottom: 0px;
|
|
121
|
-
overflow-y: auto;
|
|
122
|
-
.footer {
|
|
123
|
-
border-top: 1px solid #ddd;
|
|
124
|
-
display: flex;
|
|
125
|
-
padding: 12px 0;
|
|
126
|
-
margin-top: 12px;
|
|
127
|
-
position: sticky;
|
|
128
|
-
bottom: 0;
|
|
129
|
-
background: #fff;
|
|
130
|
-
z-index: 10;
|
|
131
|
-
}
|
|
132
|
-
`;var uo={},Xi=Se;Object.defineProperty(uo,"__esModule",{value:!0});var Dt=uo.default=void 0,Ji=Xi(ke()),Qi=n;Dt=uo.default=(0,Ji.default)((0,Qi.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 Wo="lastWantToConnectStoreId";function Yi(e){var c,a;const[t,o]=k.useState(null),{session:s}=mt(),r=k.useCallback(u=>{o(u),localStorage.setItem(Wo,u==null?void 0:u.id)},[o]),i=k.useMemo(()=>{var x,d,p,b;const u=localStorage.getItem(Wo),f=u?(((x=e==null?void 0:e.settings)==null?void 0:x.storeList)||[]).find(S=>S.id===u):null;if(f)return f;let m=(((d=e==null?void 0:e.settings)==null?void 0:d.storeList)||[]).find(S=>{var j;return!(S.id!==K.BLOCKLET_STORE.id||S.scope&&S.scope!=="studio"&&S.scope!==((j=s==null?void 0:s.user)==null?void 0:j.did))});return m||(m=(b=(p=e==null?void 0:e.settings)==null?void 0:p.storeList)==null?void 0:b[0]),m},[(c=e==null?void 0:e.settings)==null?void 0:c.storeList,(a=s==null?void 0:s.user)==null?void 0:a.did]);return[t||i||{},r]}const Rt={};async function zn(e,{interval:t=1e3,maxDuration:o=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){Rt[r]&&clearTimeout(Rt[r]),await new Promise(c=>setTimeout(c,s));const i=Date.now(),l=async(c,a)=>{try{const u=await e();c(u)}catch(u){Date.now()-i>o?a(u):r?Rt[r]=setTimeout(()=>l(c,a),t):setTimeout(()=>l(c,a),t)}};return new Promise(l)}function Zi(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function el(e,{did:t,projectId:o,messageId:s}){return zn(async()=>{var i;const r=await e.getProject({input:{did:t,projectId:o,messageId:s}});if(!((i=r==null?void 0:r.project)!=null&&i.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function tl(e,{did:t,projectId:o,storeId:s}){return zn(async()=>{var l,c;const r=await e.getProject({input:{did:t,projectId:o,messageId:""}});if(!((c=(l=r==null?void 0:r.project)==null?void 0:l.connectedStores)!=null&&c.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(a=>a.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const Vn=({fromBlocklet:e,nodeInfo:t,blocklet:o,userDid:s})=>{var l,c;const r=e?(l=o==null?void 0:o.meta)==null?void 0:l.did:t==null?void 0:t.did;let i=e?((c=o==null?void 0:o.settings)==null?void 0:c.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(i)||(i=[]),i=i.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===s),{teamDid:r,storeList:i}};function po({blocklet:e,store:t={},onChangeStore:o,onClick:s,disabled:r,loading:i,componentDid:l}){var N,D,U;const{t:c}=ee(),{session:a}=mt(),{api:u,info:f,inService:m}=Ce(),x=$e(),[d,p]=k.useState(!1),b=k.useRef(null),[S,j]=k.useState(!1),[y,R]=k.useState(null),T=W=>{o(W),p(!1)},v=()=>{p(!d)},C=W=>{b.current&&b.current.contains(W.target)||p(!1)},P=()=>{j(!0)},_=()=>{j(!1)},E=async()=>{var W;if(y)try{await u.deleteBlockletStore({input:{teamDid:e.meta.did,url:y.url,projectId:"",scope:y.scope||"studio"}}),await((W=x==null?void 0:x.actions)==null?void 0:W.refreshBlocklet())}catch(I){A.error(`Remove Blocklet Store Error: ${Ee(I)}`)}finally{R(null)}},{storeList:w}=Vn({fromBlocklet:m,blocklet:e,nodeInfo:f,componentDid:l,userDid:(N=a==null?void 0:a.user)==null?void 0:N.did}),F=(D=e==null?void 0:e.meta)==null?void 0:D.did;return n.jsxs(n.Fragment,{children:[n.jsxs(Tt,{disabled:r,ref:b,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[n.jsxs(se,{onClick:s,children:[i&&n.jsx(at,{size:14,sx:{mr:.5}}),`${c("common.connect")} ${t.name||""}`]}),n.jsx(se,{size:"small","aria-controls":d?"split-button-menu":void 0,"aria-expanded":d?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:v,children:n.jsx(or,{})})]}),n.jsx(mn,{sx:{zIndex:10},open:d,anchorEl:b.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:W})=>n.jsx(bn,{...W,style:{transformOrigin:"center top"},children:n.jsx(zt,{children:n.jsx(gn,{onClickAway:C,children:n.jsxs(xn,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[w==null?void 0:w.map(I=>{var M;return n.jsxs(Be,{selected:I.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>T(I),children:[n.jsxs(g,{children:[n.jsx(xe,{sx:{fontSize:"16px"},maxLength:24,children:I.name}),n.jsx(xe,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:I.url})]}),Ys({store:I,userDid:(M=a==null?void 0:a.user)==null?void 0:M.did})&&n.jsx(ie,{sx:{ml:1},onClick:$=>{$.preventDefault(),$.stopPropagation(),R(I)},children:n.jsx(ae,{icon:"ic:outline-delete"})})]},I.url)}),n.jsx(Es,{}),n.jsxs(Be,{onClick:P,children:[n.jsx(Vt,{font:!0}),n.jsx(V,{variant:"inherit",children:c("store.blockletRegistry.addRegistry")})]})]})})})})}),S&&n.jsx(In,{hiddenChildren:!0,open:!0,onClose:_,teamDid:F,storeList:w,scope:"studio",onAdd:(U=x==null?void 0:x.actions)==null?void 0:U.refreshBlocklet}),y&&n.jsx(Ut,{displayError:!0,title:`${c("common.delete")} ${y.name}`,description:c("blocklet.publish.deleteStoreTip",{name:y.name}),confirm:c("common.confirm"),onConfirm:E,onCancel:()=>R(null)})]})}po.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};po.defaultProps={store:null,blocklet:null};var ye=k;const Fe=/^[a-z0-9]+(-[a-z0-9]+)*$/,gt=(e,t,o,s="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;s=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const c=r.pop(),a=r.pop(),u={provider:r.length>0?r[0]:s,prefix:a,name:c};return t&&!it(u)?null:u}const i=r[0],l=i.split("-");if(l.length>1){const c={provider:s,prefix:l.shift(),name:l.join("-")};return t&&!it(c)?null:c}if(o&&s===""){const c={provider:s,prefix:"",name:i};return t&&!it(c,o)?null:c}return null},it=(e,t)=>e?!!((e.provider===""||e.provider.match(Fe))&&(t&&e.prefix===""||e.prefix.match(Fe))&&e.name.match(Fe)):!1,Wn=Object.freeze({left:0,top:0,width:16,height:16}),ut=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),fo=Object.freeze({...Wn,...ut}),_t=Object.freeze({...fo,body:"",hidden:!1});function ol(e,t){const o={};!e.hFlip!=!t.hFlip&&(o.hFlip=!0),!e.vFlip!=!t.vFlip&&(o.vFlip=!0);const s=((e.rotate||0)+(t.rotate||0))%4;return s&&(o.rotate=s),o}function Uo(e,t){const o=ol(e,t);for(const s in _t)s in ut?s in e&&!(s in o)&&(o[s]=ut[s]):s in t?o[s]=t[s]:s in e&&(o[s]=e[s]);return o}function nl(e,t){const o=e.icons,s=e.aliases||Object.create(null),r=Object.create(null);function i(l){if(o[l])return r[l]=[];if(!(l in r)){r[l]=null;const c=s[l]&&s[l].parent,a=c&&i(c);a&&(r[l]=[c].concat(a))}return r[l]}return Object.keys(o).concat(Object.keys(s)).forEach(i),r}function sl(e,t,o){const s=e.icons,r=e.aliases||Object.create(null);let i={};function l(c){i=Uo(s[c]||r[c],i)}return l(t),o.forEach(l),Uo(e,i)}function Un(e,t){const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),o.push(r)});const s=nl(e);for(const r in s){const i=s[r];i&&(t(r,sl(e,r,i)),o.push(r))}return o}const rl={provider:"",aliases:{},not_found:{},...Wn};function vt(e,t){for(const o in t)if(o in e&&typeof e[o]!=typeof t[o])return!1;return!0}function Hn(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!vt(e,rl))return null;const o=t.icons;for(const r in o){const i=o[r];if(!r.match(Fe)||typeof i.body!="string"||!vt(i,_t))return null}const s=t.aliases||Object.create(null);for(const r in s){const i=s[r],l=i.parent;if(!r.match(Fe)||typeof l!="string"||!o[l]&&!s[l]||!vt(i,_t))return null}return t}const Ho=Object.create(null);function il(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ne(e,t){const o=Ho[e]||(Ho[e]=Object.create(null));return o[t]||(o[t]=il(e,t))}function ho(e,t){return Hn(t)?Un(t,(o,s)=>{s?e.icons[o]=s:e.missing.add(o)}):[]}function ll(e,t,o){try{if(typeof o.body=="string")return e.icons[t]={...o},!0}catch{}return!1}let We=!1;function Kn(e){return typeof e=="boolean"&&(We=e),We}function cl(e){const t=typeof e=="string"?gt(e,!0,We):e;if(t){const o=Ne(t.provider,t.prefix),s=t.name;return o.icons[s]||(o.missing.has(s)?null:void 0)}}function al(e,t){const o=gt(e,!0,We);if(!o)return!1;const s=Ne(o.provider,o.prefix);return ll(s,o.name,t)}function dl(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),We&&!t&&!e.prefix){let r=!1;return Hn(e)&&(e.prefix="",Un(e,(i,l)=>{l&&al(i,l)&&(r=!0)})),r}const o=e.prefix;if(!it({provider:t,prefix:o,name:"a"}))return!1;const s=Ne(t,o);return!!ho(s,e)}const Gn=Object.freeze({width:null,height:null}),Xn=Object.freeze({...Gn,...ut}),ul=/(-?[0-9.]*[0-9]+[0-9.]*)/g,pl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ko(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 s=e.split(ul);if(s===null||!s.length)return e;const r=[];let i=s.shift(),l=pl.test(i);for(;;){if(l){const c=parseFloat(i);isNaN(c)?r.push(i):r.push(Math.ceil(c*t*o)/o)}else r.push(i);if(i=s.shift(),i===void 0)return r.join("");l=!l}}const fl=e=>e==="unset"||e==="undefined"||e==="none";function hl(e,t){const o={...fo,...e},s={...Xn,...t},r={left:o.left,top:o.top,width:o.width,height:o.height};let i=o.body;[o,s].forEach(p=>{const b=[],S=p.hFlip,j=p.vFlip;let y=p.rotate;S?j?y+=2:(b.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),b.push("scale(-1 1)"),r.top=r.left=0):j&&(b.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),b.push("scale(1 -1)"),r.top=r.left=0);let R;switch(y<0&&(y-=Math.floor(y/4)*4),y=y%4,y){case 1:R=r.height/2+r.top,b.unshift("rotate(90 "+R.toString()+" "+R.toString()+")");break;case 2:b.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:R=r.width/2+r.left,b.unshift("rotate(-90 "+R.toString()+" "+R.toString()+")");break}y%2===1&&(r.left!==r.top&&(R=r.left,r.left=r.top,r.top=R),r.width!==r.height&&(R=r.width,r.width=r.height,r.height=R)),b.length&&(i='<g transform="'+b.join(" ")+'">'+i+"</g>")});const l=s.width,c=s.height,a=r.width,u=r.height;let f,m;l===null?(m=c===null?"1em":c==="auto"?u:c,f=Ko(m,a/u)):(f=l==="auto"?a:l,m=c===null?Ko(f,u/a):c==="auto"?u:c);const x={},d=(p,b)=>{fl(b)||(x[p]=b.toString())};return d("width",f),d("height",m),x.viewBox=r.left.toString()+" "+r.top.toString()+" "+a.toString()+" "+u.toString(),{attributes:x,body:i}}const ml=/\sid="(\S+)"/g,bl="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let gl=0;function xl(e,t=bl){const o=[];let s;for(;s=ml.exec(e);)o.push(s[1]);if(!o.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(i=>{const l=typeof t=="function"?t(i):t+(gl++).toString(),c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+l+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const Et=Object.create(null);function yl(e,t){Et[e]=t}function $t(e){return Et[e]||Et[""]}function mo(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 bo=Object.create(null),qe=["https://api.simplesvg.com","https://api.unisvg.com"],lt=[];for(;qe.length>0;)qe.length===1||Math.random()>.5?lt.push(qe.shift()):lt.push(qe.pop());bo[""]=mo({resources:["https://api.iconify.design"].concat(lt)});function jl(e,t){const o=mo(t);return o===null?!1:(bo[e]=o,!0)}function go(e){return bo[e]}const kl=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Go=kl();function Sl(e,t){const o=go(e);if(!o)return 0;let s;if(!o.maxURL)s=0;else{let r=0;o.resources.forEach(l=>{r=Math.max(r,l.length)});const i=t+".json?icons=";s=o.maxURL-r-o.path.length-i.length}return s}function Cl(e){return e===404}const Rl=(e,t,o)=>{const s=[],r=Sl(e,t),i="icons";let l={type:i,provider:e,prefix:t,icons:[]},c=0;return o.forEach((a,u)=>{c+=a.length+1,c>=r&&u>0&&(s.push(l),l={type:i,provider:e,prefix:t,icons:[]},c=a.length),l.icons.push(a)}),s.push(l),s};function vl(e){if(typeof e=="string"){const t=go(e);if(t)return t.path}return"/"}const wl=(e,t,o)=>{if(!Go){o("abort",424);return}let s=vl(t.provider);switch(t.type){case"icons":{const i=t.prefix,c=t.icons.join(","),a=new URLSearchParams({icons:c});s+=i+".json?"+a.toString();break}case"custom":{const i=t.uri;s+=i.slice(0,1)==="/"?i.slice(1):i;break}default:o("abort",400);return}let r=503;Go(e+s).then(i=>{const l=i.status;if(l!==200){setTimeout(()=>{o(Cl(l)?"abort":"next",l)});return}return r=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?o("abort",i):o("next",r)});return}setTimeout(()=>{o("success",i)})}).catch(()=>{o("next",r)})},Il={prepare:Rl,send:wl};function Tl(e){const t={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((r,i)=>r.provider!==i.provider?r.provider.localeCompare(i.provider):r.prefix!==i.prefix?r.prefix.localeCompare(i.prefix):r.name.localeCompare(i.name));let s={provider:"",prefix:"",name:""};return e.forEach(r=>{if(s.name===r.name&&s.prefix===r.prefix&&s.provider===r.provider)return;s=r;const i=r.provider,l=r.prefix,c=r.name,a=o[i]||(o[i]=Object.create(null)),u=a[l]||(a[l]=Ne(i,l));let f;c in u.icons?f=t.loaded:l===""||u.missing.has(c)?f=t.missing:f=t.pending;const m={provider:i,prefix:l,name:c};f.push(m)}),t}function Jn(e,t){e.forEach(o=>{const s=o.loaderCallbacks;s&&(o.loaderCallbacks=s.filter(r=>r.id!==t))})}function Pl(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 s=e.provider,r=e.prefix;t.forEach(i=>{const l=i.icons,c=l.pending.length;l.pending=l.pending.filter(a=>{if(a.prefix!==r)return!0;const u=a.name;if(e.icons[u])l.loaded.push({provider:s,prefix:r,name:u});else if(e.missing.has(u))l.missing.push({provider:s,prefix:r,name:u});else return o=!0,!0;return!1}),l.pending.length!==c&&(o||Jn([e],i.id),i.callback(l.loaded.slice(0),l.missing.slice(0),l.pending.slice(0),i.abort))})}))}let Nl=0;function Dl(e,t,o){const s=Nl++,r=Jn.bind(null,o,s);if(!t.pending.length)return r;const i={id:s,icons:t,callback:e,abort:r};return o.forEach(l=>{(l.loaderCallbacks||(l.loaderCallbacks=[])).push(i)}),r}function _l(e,t=!0,o=!1){const s=[];return e.forEach(r=>{const i=typeof r=="string"?gt(r,t,o):r;i&&s.push(i)}),s}var El={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function $l(e,t,o,s){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let l;if(e.random){let C=e.resources.slice(0);for(l=[];C.length>1;){const P=Math.floor(Math.random()*C.length);l.push(C[P]),C=C.slice(0,P).concat(C.slice(P+1))}l=l.concat(C)}else l=e.resources.slice(i).concat(e.resources.slice(0,i));const c=Date.now();let a="pending",u=0,f,m=null,x=[],d=[];typeof s=="function"&&d.push(s);function p(){m&&(clearTimeout(m),m=null)}function b(){a==="pending"&&(a="aborted"),p(),x.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),x=[]}function S(C,P){P&&(d=[]),typeof C=="function"&&d.push(C)}function j(){return{startTime:c,payload:t,status:a,queriesSent:u,queriesPending:x.length,subscribe:S,abort:b}}function y(){a="failed",d.forEach(C=>{C(void 0,f)})}function R(){x.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),x=[]}function T(C,P,_){const E=P!=="success";switch(x=x.filter(w=>w!==C),a){case"pending":break;case"failed":if(E||!e.dataAfterTimeout)return;break;default:return}if(P==="abort"){f=_,y();return}if(E){f=_,x.length||(l.length?v():y());return}if(p(),R(),!e.random){const w=e.resources.indexOf(C.resource);w!==-1&&w!==e.index&&(e.index=w)}a="completed",d.forEach(w=>{w(_)})}function v(){if(a!=="pending")return;p();const C=l.shift();if(C===void 0){if(x.length){m=setTimeout(()=>{p(),a==="pending"&&(R(),y())},e.timeout);return}y();return}const P={status:"pending",resource:C,callback:(_,E)=>{T(P,_,E)}};x.push(P),u++,m=setTimeout(v,e.rotate),o(C,t,P.callback)}return setTimeout(v),j}function Qn(e){const t={...El,...e};let o=[];function s(){o=o.filter(c=>c().status==="pending")}function r(c,a,u){const f=$l(t,c,a,(m,x)=>{s(),u&&u(m,x)});return o.push(f),f}function i(c){return o.find(a=>c(a))||null}return{query:r,find:i,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:s}}function Xo(){}const wt=Object.create(null);function Ll(e){if(!wt[e]){const t=go(e);if(!t)return;const o=Qn(t),s={config:t,redundancy:o};wt[e]=s}return wt[e]}function Ml(e,t,o){let s,r;if(typeof e=="string"){const i=$t(e);if(!i)return o(void 0,424),Xo;r=i.send;const l=Ll(e);l&&(s=l.redundancy)}else{const i=mo(e);if(i){s=Qn(i);const l=e.resources?e.resources[0]:"",c=$t(l);c&&(r=c.send)}}return!s||!r?(o(void 0,424),Xo):s.query(t,r,o)().abort}const Jo="iconify2",Ue="iconify",Yn=Ue+"-count",Qo=Ue+"-version",Zn=36e5,Ol=168;function Lt(e,t){try{return e.getItem(t)}catch{}}function xo(e,t,o){try{return e.setItem(t,o),!0}catch{}}function Yo(e,t){try{e.removeItem(t)}catch{}}function Mt(e,t){return xo(e,Yn,t.toString())}function Ot(e){return parseInt(Lt(e,Yn))||0}const xt={local:!0,session:!0},es={local:new Set,session:new Set};let yo=!1;function ql(e){yo=e}let tt=typeof window>"u"?{}:window;function ts(e){const t=e+"Storage";try{if(tt&&tt[t]&&typeof tt[t].length=="number")return tt[t]}catch{}xt[e]=!1}function os(e,t){const o=ts(e);if(!o)return;const s=Lt(o,Qo);if(s!==Jo){if(s){const c=Ot(o);for(let a=0;a<c;a++)Yo(o,Ue+a.toString())}xo(o,Qo,Jo),Mt(o,0);return}const r=Math.floor(Date.now()/Zn)-Ol,i=c=>{const a=Ue+c.toString(),u=Lt(o,a);if(typeof u=="string"){try{const f=JSON.parse(u);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>r&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&t(f,c))return!0}catch{}Yo(o,a)}};let l=Ot(o);for(let c=l-1;c>=0;c--)i(c)||(c===l-1?(l--,Mt(o,l)):es[e].add(c))}function ns(){if(!yo){ql(!0);for(const e in xt)os(e,t=>{const o=t.data,s=t.provider,r=o.prefix,i=Ne(s,r);if(!ho(i,o).length)return!1;const l=o.lastModified||-1;return i.lastModifiedCached=i.lastModifiedCached?Math.min(i.lastModifiedCached,l):l,!0})}}function Al(e,t){const o=e.lastModifiedCached;if(o&&o>=t)return o===t;if(e.lastModifiedCached=t,o)for(const s in xt)os(s,r=>{const i=r.data;return r.provider!==e.provider||i.prefix!==e.prefix||i.lastModified===t});return!0}function Bl(e,t){yo||ns();function o(s){let r;if(!xt[s]||!(r=ts(s)))return;const i=es[s];let l;if(i.size)i.delete(l=Array.from(i).shift());else if(l=Ot(r),!Mt(r,l+1))return;const c={cached:Math.floor(Date.now()/Zn),provider:e.provider,data:t};return xo(r,Ue+l.toString(),JSON.stringify(c))}t.lastModified&&!Al(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),o("local")||o("session"))}function Zo(){}function Fl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Pl(e)}))}function zl(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:s}=e,r=e.iconsToLoad;delete e.iconsToLoad;let i;if(!r||!(i=$t(o)))return;i.prepare(o,s,r).forEach(c=>{Ml(o,c,a=>{if(typeof a!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=ho(e,a);if(!u.length)return;const f=e.pendingIcons;f&&u.forEach(m=>{f.delete(m)}),Bl(e,a)}catch(u){console.error(u)}Fl(e)})})}))}const Vl=(e,t)=>{const o=_l(e,!0,Kn()),s=Tl(o);if(!s.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(s.loaded,s.missing,s.pending,Zo)}),()=>{a=!1}}const r=Object.create(null),i=[];let l,c;return s.pending.forEach(a=>{const{provider:u,prefix:f}=a;if(f===c&&u===l)return;l=u,c=f,i.push(Ne(u,f));const m=r[u]||(r[u]=Object.create(null));m[f]||(m[f]=[])}),s.pending.forEach(a=>{const{provider:u,prefix:f,name:m}=a,x=Ne(u,f),d=x.pendingIcons||(x.pendingIcons=new Set);d.has(m)||(d.add(m),r[u][f].push(m))}),i.forEach(a=>{const{provider:u,prefix:f}=a;r[u][f].length&&zl(a,r[u][f])}),t?Dl(t,s,i):Zo};function Wl(e,t){const o={...e};for(const s in t){const r=t[s],i=typeof r;s in Gn?(r===null||r&&(i==="string"||i==="number"))&&(o[s]=r):i===typeof o[s]&&(o[s]=s==="rotate"?r%4:r)}return o}const Ul=/[\s,]+/;function Hl(e,t){t.split(Ul).forEach(o=>{switch(o.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Kl(e,t=0){const o=e.replace(/^-?[0-9.]*/,"");function s(r){for(;r<0;)r+=4;return r%4}if(o===""){const r=parseInt(e);return isNaN(r)?0:s(r)}else if(o!==e){let r=0;switch(o){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(e.slice(0,e.length-o.length));return isNaN(i)?0:(i=i/r,i%1===0?s(i):0)}}return t}function Gl(e,t){let o=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const s in t)o+=" "+s+'="'+t[s]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+o+">"+e+"</svg>"}function Xl(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Jl(e){return"data:image/svg+xml,"+Xl(e)}function Ql(e){return'url("'+Jl(e)+'")'}let ze;function Yl(){try{ze=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ze=null}}function Zl(e){return ze===void 0&&Yl(),ze?ze.createHTML(e):e}const ss={...Xn,inline:!1},ec={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},tc={display:"inline-block"},qt={backgroundColor:"currentColor"},rs={backgroundColor:"transparent"},en={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},tn={WebkitMask:qt,mask:qt,background:rs};for(const e in tn){const t=tn[e];for(const o in en)t[e+o]=en[o]}const oc={...ss,inline:!0};function on(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const nc=(e,t,o,s)=>{const r=o?oc:ss,i=Wl(r,t),l=t.mode||"svg",c={},a=t.style||{},u={...l==="svg"?ec:{},ref:s};for(let j in t){const y=t[j];if(y!==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]=y===!0||y==="true"||y===1;break;case"flip":typeof y=="string"&&Hl(i,y);break;case"color":c.color=y;break;case"rotate":typeof y=="string"?i[j]=Kl(y):typeof y=="number"&&(i[j]=y);break;case"ariaHidden":case"aria-hidden":y!==!0&&y!=="true"&&delete u["aria-hidden"];break;default:r[j]===void 0&&(u[j]=y)}}const f=hl(e,i),m=f.attributes;if(i.inline&&(c.verticalAlign="-0.125em"),l==="svg"){u.style={...c,...a},Object.assign(u,m);let j=0,y=t.id;return typeof y=="string"&&(y=y.replace(/-/g,"_")),u.dangerouslySetInnerHTML={__html:Zl(xl(f.body,y?()=>y+"ID"+j++:"iconifyReact"))},ye.createElement("svg",u)}const{body:x,width:d,height:p}=e,b=l==="mask"||(l==="bg"?!1:x.indexOf("currentColor")!==-1),S=Gl(x,{...m,width:d+"",height:p+""});return u.style={...c,"--svg":Ql(S),width:on(m.width),height:on(m.height),...tc,...b?qt:rs,...a},ye.createElement("span",u)};Kn(!0);yl("",Il);if(typeof document<"u"&&typeof window<"u"){ns();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(s=>{try{(typeof s!="object"||s===null||s instanceof Array||typeof s.icons!="object"||typeof s.prefix!="string"||!dl(s))&&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 s="IconifyProviders["+o+"] is invalid.";try{const r=t[o];if(typeof r!="object"||!r||r.resources===void 0)continue;jl(o,r)||console.error(s)}catch{console.error(s)}}}}class is extends ye.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,s=this.props.icon;if(typeof s=="object"&&s!==null&&typeof s.body=="string"){this._icon="",this._abortLoading(),(t||o.icon===null)&&this._setData({data:s});return}let r;if(typeof s!="string"||(r=gt(s,!1,!0))===null){this._abortLoading(),this._setData(null);return}const i=cl(r);if(!i){(!this._loading||this._loading.name!==s)&&(this._abortLoading(),this._icon="",this._setData(null),i!==null&&(this._loading={name:s,abort:Vl([r],this._checkIcon.bind(this,!1))}));return}if(this._icon!==s||o.icon===null){this._abortLoading(),this._icon=s;const l=["iconify"];r.prefix!==""&&l.push("iconify--"+r.prefix),r.provider!==""&&l.push("iconify--"+r.provider),this._setData({data:i,classes:l}),this.props.onLoad&&this.props.onLoad(s)}}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:ye.createElement("span",{});let s=t;return o.classes&&(s={...t,className:(typeof t.className=="string"?t.className+" ":"")+o.classes.join(" ")}),nc({...fo,...o.data},s,t._inline,t._ref)}}const sc=ye.forwardRef(function(t,o){const s={...t,_ref:o,_inline:!1};return ye.createElement(is,s)});ye.forwardRef(function(t,o){const s={...t,_ref:o,_inline:!0};return ye.createElement(is,s)});var rc=sc;const ic=e=>{const t=e.includes("youtube.com")||e.includes("youtu.be"),o=e.includes("vimeo.com");return t||o};function yt({url:e,style:t,controls:o,modestbranding:s}){var c;const{t:r}=ee(),i=e.includes("youtube.com")||e.includes("youtu.be"),l=e.includes("vimeo.com");if(i){const a=((c=e.split("v=")[1])==null?void 0:c.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/${a}?modestbranding=${s}&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(l){const a=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/${a}`,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(g,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:n.jsxs(g,{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(rc,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),n.jsx(V,{variant:"body1",sx:{opacity:.5},children:r("studio.videoDialogNoSrc")})]})})}yt.propTypes={url:h.string.isRequired,style:h.object,controls:h.number,modestbranding:h.number};yt.defaultProps={style:{},controls:1,modestbranding:1};function ls({setParams:e,onClose:t,params:o}){const{t:s}=ee(),[r,i]=k.useState(""),l=r&&o.blockletVideos.includes(r),c=ic(r),a=()=>{e(u=>{const f=[...u.blockletVideos];return f.push(r),{...u,blockletVideos:f}}),t()};return n.jsxs(yn,{open:!0,fullWidth:!0,maxWidth:"sm",children:[n.jsx($s,{children:s("studio.videoDialogTitle")}),n.jsxs(Ls,{children:[n.jsx(sr,{fullWidth:!0,value:r,onChange:u=>i(u.target.value),placeholder:s("studio.videoInputLabel"),endAdornment:r?n.jsx(bt,{position:"end",children:n.jsx(ie,{onClick:()=>i(""),children:n.jsx(nr,{})})}):null,error:l}),l&&n.jsx(V,{variant:"body2",color:"error",children:s("studio.duplicateVideo")}),n.jsx(yt,{url:r,style:{marginTop:"20px",borderRadius:"4px"}})]}),n.jsxs(Ms,{children:[n.jsx(se,{onClick:()=>t(),children:s("studio.cancel")}),n.jsx(se,{disabled:!c||l,onClick:a,children:s("studio.confirm")})]})]})}ls.propTypes={onClose:h.func.isRequired,params:h.object.isRequired,setParams:h.func.isRequired};const nn=k.lazy(()=>jn(()=>import("./index-CH1qAD3K.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 cs({projectId:e,readOnly:t,loading:o,blocklet:s,params:r,setParams:i,paramsErrTip:l,setParamsErrTip:c,setLoading:a,initUrl:u,initLogoUrl:f,setInitLogoUrl:m,componentDid:x}){const{t:d}=ee(),{api:p}=Ce(),b=Bt(),S=k.useRef(null),j=k.useRef(null),[y,R]=Yi(s),[T,v]=k.useState(!1),C=Zs({messageType:"connect-store-message",onOpen:()=>a(!0),onClose:()=>a(!1)}),P=async I=>{const M=setTimeout(()=>{a(!1)},2e4),$=await el(p,I);a(!1),clearTimeout(M),window.parent.postMessage({event:"studioDialog.connected",componentDid:x},"*"),b(window.location.pathname.replace(`${K.UNOWNED_DID}/create`,`${$}/create`),{replace:!0})},_=()=>{if(!r.blockletTitle){A.error(d("blocklet.publish.errorTip.noTitle"));return}if(!(y!=null&&y.url)){A.error(d("blocklet.publish.noStoreSelected"));return}const I=Zi();C(async(M,$)=>{var H,G,Y;try{const X=await p.connectByStudio({input:{did:(H=s==null?void 0:s.meta)==null?void 0:H.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:y.url,storeId:y.id,storeName:y.name,type:((G=r==null?void 0:r.blockletComponents)==null?void 0:G.length)>0?"pack":"resource",componentDid:x,messageId:I,tenantScope:(u==null?void 0:u.searchParams.get("tenantScope"))||""}});if(!(X!=null&&X.url)){A.error("failed to connect to store");return}$(X.url),P({did:(Y=s==null?void 0:s.meta)==null?void 0:Y.did,projectId:"",messageId:I})}catch(X){const J=Ee(X);A.error(J),a(!1)}})},E=`${K.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,w=`${K.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,F=r!=null&&r.blockletLogo?`${E}/${r.blockletLogo}`:`${K.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,N=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(I=>`${w}/${I}`),D=()=>t?!1:!e||e===K.UNOWNED_DID?(A.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=I=>{if(!I.destination)return;const M=Array.from(r.blockletScreenshots),[$]=M.splice(I.source.index,1);M.splice(I.destination.index,0,$),i(H=>({...H,blockletScreenshots:M}))},W=I=>{if(!I.destination)return;const M=Array.from(r.blockletVideos),[$]=M.splice(I.source.index,1);M.splice(I.destination.index,0,$),i(H=>({...H,blockletVideos:M}))};return n.jsxs(lc,{children:[n.jsx(g,{display:"flex",className:"section",children:n.jsxs(g,{sx:{flex:1},children:[n.jsx(de,{disabled:o||t,label:`Blocklet ${d("common.title")}`,placeholder:`Blocklet ${d("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:I=>{c({blockletTitle:""}),i({blockletTitle:I.target.value})},error:!!l.blockletTitle,helperText:l.blockletTitle||""}),n.jsx(de,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===K.UNOWNED_DID&&n.jsx(bt,{position:"end",children:n.jsx(po,{blocklet:s,store:y,componentDid:x,onChangeStore:R,disabled:!r.blockletTitle||t||o,loading:o,onClick:_})})},error:!!l.projectId,helperText:l.projectId||"",value:e===K.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),n.jsx(de,{disabled:o||t,label:`Blocklet ${d("common.description")}`,placeholder:`Blocklet ${d("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:I=>{c({blockletDescription:""}),i({blockletDescription:I.target.value})},error:!!l.blockletDescription,helperText:l.blockletDescription||"",sx:{mt:3}}),n.jsx(de,{disabled:o||t,label:`Blocklet ${d("common.homepageTip")}`,placeholder:`Blocklet ${d("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletHomepage||"",onChange:I=>{I.target.value&&!/^(http|https):\/\//.test(I.target.value)?c({blockletHomepage:d("blocklet.publish.errorTip.invalidUrl")}):c({blockletHomepage:""}),i({blockletHomepage:I.target.value})},error:!!l.blockletHomepage,helperText:l.blockletHomepage||"",sx:{mt:3}}),n.jsx(de,{disabled:o||t,label:`Blocklet ${d("common.community")}`,placeholder:`Blocklet ${d("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletCommunity||"",onChange:I=>{I.target.value&&!/^(http|https):\/\//.test(I.target.value)?c({blockletCommunity:d("blocklet.publish.errorTip.invalidUrl")}):c({blockletCommunity:""}),i({blockletCommunity:I.target.value})},error:!!l.blockletCommunity,helperText:l.blockletCommunity||"",sx:{mt:3}}),n.jsx(de,{disabled:o||t,label:`Blocklet ${d("common.support")}`,placeholder:`Blocklet ${d("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletSupport||"",onChange:I=>{I.target.value&&!/^(http|https):\/\//.test(I.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(I.target.value)?c({blockletSupport:d("blocklet.publish.errorTip.invalidUrlOrEmail")}):c({blockletSupport:""}),i({blockletSupport:I.target.value})},error:!!l.blockletSupport,helperText:l.blockletSupport||"",sx:{mt:3}}),n.jsx(de,{disabled:o||t,label:`Blocklet ${d("common.repository")}`,placeholder:`Blocklet ${d("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletRepository||"",onChange:I=>{I.target.value&&!/^(git|https|svn)/.test(I.target.value)?c({blockletRepository:d("blocklet.publish.errorTip.invalidUrl")}):c({blockletRepository:""}),i({blockletRepository:I.target.value})},error:!!l.blockletRepository,helperText:l.blockletRepository||"",sx:{mt:3}})]})}),n.jsx(g,{display:"flex",mt:3,className:"section full-width",children:n.jsxs(g,{sx:{flex:1},children:[n.jsxs(g,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(Ie,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(V,{variant:"subtitle1",sx:{fontWeight:"bold"},children:d("common.logo")}),n.jsxs(Ie,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.type"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.ratio"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.size"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),n.jsx(g,{sx:{flex:1,cursor:t?"default":"pointer",display:"flex",alignItems:"flex-end"},children:n.jsx(Rn,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:f||F,onClick:()=>{var I;D()&&((I=S.current)==null||I.open())}})})]}),n.jsxs(g,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(Ie,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(V,{variant:"subtitle1",sx:{fontWeight:"bold"},children:d("common.screenshot")}),n.jsxs(Ie,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(g,{sx:{border:"none"},variant:"outlined",size:"small",children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.ratio"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.count"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.size"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!t&&n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.order"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:d("studio.orderTip")})]})})]})]}),n.jsx(Do,{onDragEnd:t?void 0:U,children:n.jsx(_o,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(I,M)=>n.jsxs(g,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:M.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:M.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:I.innerRef,...I.droppableProps,children:[N.map(($,H)=>n.jsx(Eo,{draggableId:$,index:H,isDragDisabled:t,children:(G,Y)=>n.jsxs(g,{ref:G.innerRef,...G.draggableProps,className:"screenshot",sx:{transform:Y.isDragging?"scale(1.05)":"none",boxShadow:Y.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:$}),!t&&n.jsx(ie,{...G.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:n.jsx(Dt,{})}),!t&&n.jsx(ie,{className:"action",onClick:()=>{i(X=>{const J=[...X.blockletScreenshots];return J.splice(H,1),{...X,blockletScreenshots:J}})},children:n.jsx(Lo,{})})]})},$)),I.placeholder,N.length<5&&n.jsx(g,{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 $;D()&&(($=j.current)==null||$.open())},children:"+"})]})})})]}),n.jsxs(g,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[n.jsxs(Ie,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[n.jsx(V,{variant:"subtitle1",sx:{fontWeight:"bold"},children:d("studio.video")}),n.jsxs(Ie,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.videoType"),":"," "]}),n.jsxs(g,{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(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.count"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!t&&n.jsx(g,{children:n.jsxs(g,{component:"span",children:[n.jsxs(g,{component:"span",sx:{color:"#555"},children:[d("studio.order"),":"," "]}),n.jsx(g,{component:"span",sx:{color:"#007ec6"},children:d("studio.orderTip")})]})})]})]}),n.jsx(Do,{onDragEnd:t?void 0:W,children:n.jsx(_o,{droppableId:"videos",direction:"horizontal",isDropDisabled:t,children:(I,M)=>n.jsxs(g,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:M.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:M.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:I.innerRef,...I.droppableProps,children:[r.blockletVideos.map(($,H)=>n.jsx(Eo,{draggableId:$,index:H,isDragDisabled:t,children:(G,Y)=>n.jsxs(g,{ref:G.innerRef,...G.draggableProps,className:"screenshot",sx:{transform:Y.isDragging?"scale(1.05)":"none",boxShadow:Y.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[n.jsx(yt,{url:$,style:{pointerEvents:Y.isDragging?"none":"auto"}}),!t&&n.jsx(ie,{...G.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:n.jsx(Dt,{})}),!t&&n.jsx(ie,{className:"action",onClick:()=>{i(X=>{const J=[...X.blockletVideos];return J.splice(H,1),{...X,blockletVideos:J}})},children:n.jsx(Lo,{})})]})},$)),I.placeholder,r.blockletVideos.length<3&&n.jsx(g,{sx:{width:240,height:135,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{D()&&v(!0)},children:"+"})]})})})]})]})}),n.jsxs(k.Suspense,{fallback:n.jsx(Qe,{}),children:[n.jsx(nn,{ref:S,popup:!0,onUploadFinish:I=>{var M;i({blockletLogo:I.data.filename}),m(""),(M=S.current)==null||M.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:E,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"),T&&n.jsx(ls,{onClose:()=>v(!1),params:r,setParams:i}),n.jsx(nn,{ref:j,popup:!0,onUploadFinish:I=>{var M;i($=>{var G;const H=$.blockletScreenshots||[];return H.push((G=I.data)==null?void 0:G.filename),{...$,blockletScreenshots:H}}),(M=j.current)==null||M.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-N.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")]})]})}cs.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 lc=he.div`
|
|
133
|
-
margin-top: 24px;
|
|
134
|
-
.screenshot {
|
|
135
|
-
margin-bottom: 16px;
|
|
136
|
-
max-width: 240px;
|
|
137
|
-
max-height: 135px;
|
|
138
|
-
width: 240px;
|
|
139
|
-
height: 135px;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
display: flex;
|
|
142
|
-
align-items: center;
|
|
143
|
-
justify-content: center;
|
|
144
|
-
background-color: #eee;
|
|
145
|
-
margin-right: 16px;
|
|
146
|
-
position: relative;
|
|
147
|
-
.action {
|
|
148
|
-
visibility: hidden;
|
|
149
|
-
position: absolute;
|
|
150
|
-
width: 42px;
|
|
151
|
-
height: 42px;
|
|
152
|
-
right: 6px;
|
|
153
|
-
top: 6px;
|
|
154
|
-
border-radius: 4px;
|
|
155
|
-
background-color: rgba(0, 0, 0, 1);
|
|
156
|
-
color: rgba(255, 255, 255, 1);
|
|
157
|
-
}
|
|
158
|
-
&:hover .action {
|
|
159
|
-
visibility: visible;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
.screenshot img {
|
|
163
|
-
width: 100%; /* 图像宽度填充容器 */
|
|
164
|
-
height: auto; /* 图像高度自适应 */
|
|
165
|
-
}
|
|
166
|
-
`;var jo={},cc=Se;Object.defineProperty(jo,"__esModule",{value:!0});var as=jo.default=void 0,ac=cc(ke()),dc=n;as=jo.default=(0,ac.default)((0,dc.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");const uc=(e,t,o,s)=>{const r=e?[...e]:[],i=((t==null?void 0:t.children)||[]).reduce((l,c)=>(l[c.meta.did]=!0,l),{});return Object.keys(o).forEach(l=>{if(!i[l])return;let c=!1;s||r.forEach(a=>{a.did===l&&(a.included=!0,a.required=!0,c=!0)}),c||r.push({did:l,included:!0,required:!0})}),r},pc=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const t=e.split("/").pop().split("?")[0],s=await(await fetch(e)).blob();return new File([s],t,{type:s.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*fc(e,t){let o=0;for(;o<e.size;)yield e.slice(o,o+t),o+=t}const hc=async({did:e,projectId:t,uploadType:o="logo",imageUrl:s})=>{const r=await pc(s);new FormData().append("file",r);const l={uploaderId:"Uploader",relativePath:encodeURIComponent(r.name),name:encodeURIComponent(r.name),type:r.type},a=(await Po.post(fe(K.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,t,o,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":r.size,"X-Uploader-File-Ext":r.name.split(".").pop(),"Upload-Metadata":Object.keys(l).map(x=>`${x} ${btoa(l[x])}`).join(",")}})).headers.location,u=2*1024*1024;let f=0,m="";for(const x of fc(r,u)){const d=await Po.patch(fe(K.WELLKNOWN_SERVICE_PATH_PREFIX,a),x,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":f,"Content-Type":"application/offset+octet-stream"}});f+=x.size,m=d.data.filename}return m},ds=({params:e,hasSelectedResources:t,projectId:o,status:s,t:r})=>{const i=[];return e.blockletTitle||i.push({param:"blockletTitle",message:r("blocklet.publish.errorTip.noTitle")}),(!o||o===K.UNOWNED_DID)&&i.push({param:"projectId",message:r("blocklet.publish.errorTip.noDid")}),!e.uploadedResource&&!t&&i.push({param:"blockletResource",message:r("blocklet.publish.errorTip.noResource")}),e.blockletVersion?_e.valid(e.blockletVersion)||i.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.inValidVersion")}):i.push({param:"blockletVersion",message:r("blocklet.publish.errorTip.noVersion")}),s===Te.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||i.push({param:"blockletDescription",message:r("blocklet.publish.errorTip.noDescription")}),e.note||i.push({param:"note",message:r("blocklet.publish.errorTip.noNote")})),i.length?i:null},mc=({params:e,hasSelectedResources:t,step:o,t:s,projectId:r})=>{if(o===0){if(!e.blockletTitle)return s("blocklet.publish.errorTip.noTitle");if(!r||r===K.UNOWNED_DID)return s("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return s("blocklet.publish.errorTip.noDescription")}if(o===2&&!e.uploadedResource&&!t)return s("blocklet.publish.errorTip.noResource");if(o>=4){if(!e.blockletVersion)return s("blocklet.publish.errorTip.noVersion");if(!_e.valid(e.blockletVersion))return s("blocklet.publish.errorTip.inValidVersion");if(!e.note)return s("blocklet.publish.errorTip.noNote")}return""};function ko({blocklet:e,releaseId:t,connectedStores:o,projectId:s,releaseType:r,publishedStoreIds:i,onPublish:l,onDelete:c,projectType:a,componentDid:u,onOpenConnectStore:f,behavior:m,onSelectConnectStore:x}){var R,T;const{t:d}=ee(),{actions:{refreshBlocklet:p}}=$e(),{session:b}=mt(),{storeList:S}=Vn({fromBlocklet:!0,blocklet:e,componentDid:u,userDid:(R=b==null?void 0:b.user)==null?void 0:R.did}),j=k.useMemo(()=>o!=null&&o.length?o==null?void 0:o.reduce((v,C)=>(v[C.storeId]=C,v),{}):{},[o]),y=(T=e==null?void 0:e.meta)==null?void 0:T.did;return n.jsxs(n.Fragment,{children:[m==="connect"&&!!(S!=null&&S.length)&&n.jsx(vn,{severity:"info",style:{width:"100%"},children:n.jsxs(g,{color:Vs[400],component:"a",href:a==="pack"?"https://www.arcblock.io/docs/blocklet-developer/en/5PXToZve-5IXAN1bc8rkpxAc":"https://www.arcblock.io/docs/blocklet-developer/en/hB5VWLfg9VnbWsL1JGLuLUfW",target:"_blank",display:"flex",alignItems:"center",rel:"noreferrer",children:[d(a==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),n.jsx(ir,{sx:{marginLeft:1}})]})}),n.jsx(Os,{children:S==null?void 0:S.map(v=>n.jsx(lr,{"data-cy":"store-switch",children:n.jsx(Fs,{children:n.jsx(er,{behavior:m,onSelectConnectStore:x,releaseId:t,projectId:s,releaseType:r,kind:"publish",teamDid:y,store:v,published:(i==null?void 0:i.indexOf(v.id))>-1,connectedStore:j[v.id],onPublish:l,onDelete:c,scope:v.scope||"studio",onOpenConnectStore:f})})},v.url))}),n.jsx(In,{teamDid:y,storeList:S,scope:"studio",onAdd:p})]})}ko.propTypes={blocklet:h.object.isRequired,projectId:h.string.isRequired,releaseId:h.string.isRequired,releaseType:h.string.isRequired,onPublish:h.func,onDelete:h.func,publishedStoreIds:h.arrayOf(h.string),connectedStores:h.arrayOf(h.object).isRequired,projectType:h.string,componentDid:h.string,onOpenConnectStore:h.func,onSelectConnectStore:h.func,behavior:h.string};ko.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};function us({did:e,params:t,setParams:o,projectId:s,open:r,onClose:i}){const{t:l}=ee(),[c,a]=k.useState(!1),{api:u}=Ce(),[f,m]=k.useState(!1),[x,d]=k.useState(!1),p=()=>{m(t.autoUpload),d(t.possibleSameStore),a(!1),i(!1)},b=async()=>{a(!0);try{await u.updateProject({input:{did:e,projectId:s,blockletTitle:t.blockletTitle||"",blockletDescription:t.blockletDescription||"",blockletIntroduction:t.blockletIntroduction||"",autoUpload:!!f,possibleSameStore:!!x}}),o({autoUpload:f,possibleSameStore:x}),i(!1)}catch(j){A.error(j.message)}a(!1)};k.useEffect(()=>{m(t.autoUpload),d(t.possibleSameStore)},[t]);const S=!!(s&&s!==K.UNOWNED_DID);return n.jsx(kn,{title:l("blocklet.publish.projectSettings"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:r,onClose:p,actions:n.jsxs(n.Fragment,{children:[n.jsx(se,{onClick:j=>{j.stopPropagation(),i()},color:"inherit",children:l("common.cancel")}),S&&n.jsxs(se,{onClick:j=>{j.stopPropagation(),b()},color:"primary","data-cy":"install-blocklet-next-step",disabled:c,variant:"contained",autoFocus:!0,children:[c&&n.jsx(at,{size:16}),l("common.confirm")]})]}),children:S?n.jsxs(g,{component:"label",sx:{display:"flex",flexDirection:"column",gap:2},children:[n.jsxs(g,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[n.jsx(g,{component:ae,icon:"ph:upload",sx:{fontSize:24,mr:2}}),n.jsx(V,{variant:"body1",sx:{flex:1},children:l("blocklet.publish.autoUploadTip")}),n.jsx(Mo,{checked:f,onChange:(j,y)=>m(y)})]}),n.jsxs(g,{component:"label",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[n.jsx(g,{component:ae,icon:"fluent-mdl2:merge-duplicate",sx:{fontSize:24,mr:2}}),n.jsx(V,{variant:"body1",sx:{flex:1},children:l("blocklet.publish.possibleSameStoreTip")}),n.jsx(Mo,{checked:x,onChange:(j,y)=>d(y)})]})]}):n.jsxs(g,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[n.jsx(g,{component:ae,icon:"ph:empty",sx:{fontSize:40,mb:3,opacity:.6}}),n.jsx(V,{variant:"body1",sx:{flex:1},children:l("blocklet.publish.needProjectId")})]})})}us.propTypes={did:h.string.isRequired,params:h.object.isRequired,open:h.bool.isRequired,onClose:h.func.isRequired,setParams:h.func.isRequired,projectId:h.string.isRequired};function ps({downloadUrl:e,installUrl:t,handleSetTip:o,isPack:s,disabled:r}){const{t:i}=ee(),[l,c]=k.useState(!1),a=k.useRef(null),u=()=>{c(!l)},f=m=>{a.current&&a.current.contains(m.target)||c(!1)};return n.jsxs(n.Fragment,{children:[n.jsx(se,{disabled:r,ref:a,onClick:u,children:n.jsx(g,{component:ae,sx:{fontSize:18},icon:"bxs:download"})}),n.jsx(mn,{sx:{zIndex:10},open:l,anchorEl:a.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:m})=>n.jsx(bn,{...m,style:{transformOrigin:"center top"},children:n.jsx(zt,{children:n.jsx(gn,{onClickAway:f,children:n.jsxs(xn,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[s&&n.jsx(g,{component:"a",href:t,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:n.jsxs(Be,{sx:{color:"#333"},children:[n.jsx(g,{component:ae,sx:{mr:1},icon:"ic:round-install-desktop"}),n.jsx(V,{variant:"inherit",children:i("blocklet.publish.installToThisServer")})]})}),n.jsxs(Be,{onClick:o,children:[n.jsx(g,{component:ae,sx:{mr:1},icon:"iconamoon:copy"}),n.jsx(V,{variant:"inherit",children:i("blocklet.publish.copyInstallUrl")})]}),n.jsx(g,{component:"a",href:e,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:n.jsxs(Be,{sx:{color:"#333"},children:[n.jsx(g,{component:ae,sx:{mr:1},icon:"ph:download"}),n.jsx(V,{variant:"inherit",children:i("common.download")})]})})]})})})})})]})}ps.propTypes={disabled:h.bool.isRequired,isPack:h.bool.isRequired,downloadUrl:h.string.isRequired,installUrl:h.string.isRequired,handleSetTip:h.func.isRequired};var an;const sn=(an=window.env)==null?void 0:an.serverEndpoint;function fs({projectId:e,params:t,setParamsErrTip:o,initUrl:s,setParams:r,mode:i,loading:l,blocklet:c,release:a,isPublished:u,releaseId:f,getData:m,getRelease:x,paramsErrTip:d,componentDid:p,resourceRelateComponents:b,disabledSelectComponents:S,saveSelectedEventsRef:j,hasSelectedResources:y,initLogoUrl:R,setLoading:T,releaseUsedLast:v,setReleaseUsedLast:C,projectType:P}){var Z;const{t:_,locale:E}=ee(),{api:w}=Ce(),F=Bt(),[N,D]=k.useState(!1),[U,W]=k.useState(!1),[I,M]=k.useState(),$=Je(Q=>Q.breakpoints.down("md")),H=k.useMemo(()=>{var Q;return t!=null&&t.blockletResourceType?t==null?void 0:t.blockletResourceType:((Q=t==null?void 0:t.blockletComponents)==null?void 0:Q.length)>0?(t==null?void 0:t.blockletComponents.find(q=>q.included))?"resource":"pack":"resource"},[t==null?void 0:t.blockletComponents,t==null?void 0:t.blockletResourceType]),G=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:p},"*"),x()},Y=async Q=>{var Oe,jt,Ze;if(d!=null&&d.blockletHomepage||d!=null&&d.blockletSupport||d!=null&&d.blockletCommunity){A.error((d==null?void 0:d.blockletHomepage)||(d==null?void 0:d.blockletSupport)||(d==null?void 0:d.blockletCommunity));return}const re=ds({params:t,hasSelectedResources:y,projectId:e,status:Q,t:_});if(re){A.error(re.map(z=>z.message).join("; ")),o(re.reduce((z,oe)=>({...z,[oe.param]:oe.message}),{}));return}const q={...t};if(q.blockletComponents=uc(q.blockletComponents,c,b,S),q.blockletVersion=_e.valid(q.blockletVersion),!q.blockletVersion){A.error("Invalid Blocklet Version"),o({blockletVersion:"Invalid Blocklet Version"});return}if(R)try{const z=await hc({did:c.meta.did,projectId:e,imageUrl:R});q.blockletLogo=z,r({blockletLogo:z})}catch(z){A.error(z.message);return}if(t.resourceFromSelect){q.uploadedResource="";try{const z=Object.keys(j.current);await dt(z.map(oe=>()=>{const ue=j.current[oe];return Hi({api:w,locale:E,projectId:e,releaseId:v?"":f,appDid:c.meta.did,component:ue.component,resources:ue.resources,initUrl:s})}),{concurrency:2})}catch(z){A.error(((Ze=(jt=(Oe=z==null?void 0:z.response)==null?void 0:Oe.data)==null?void 0:jt.error)==null?void 0:Ze.message)||z.message),o({blockletResource:"Invalid save the resource"});return}}else q.blockletComponents=[];q.blockletTitle=(q.blockletTitle||"").trim(),q.blockletDescription=(q.blockletDescription||"").trim(),q.blockletSupport=(q.blockletSupport||"").trim(),q.blockletHomepage=(q.blockletHomepage||"").trim(),q.blockletCommunity=(q.blockletCommunity||"").trim(),q.blockletRepository=(q.blockletRepository||"").trim(),q.blockletIntroduction=(q.blockletIntroduction||"").trim(),q.note=(q.note||"").trim(),q.blockletComponents=((q==null?void 0:q.blockletComponents)||[]).filter(z=>z.included).map(z=>Ft(z,["did","required"])).map(JSON.stringify);try{await w.createRelease({input:{...q,did:c.meta.did,projectId:e,releaseId:v?"":f,status:Q}}),Q==="draft"?A.success(_("blocklet.publish.saveDraftSuccess")):(C(!1),A.success(_("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:p},"*")),o({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""})}catch(z){const oe=Ee(z);A.error(oe),(/resource/.test(oe)||/zip/.test(oe))&&o({blockletResource:oe});return}const Ye=await w.getProject({input:{did:c.meta.did,projectId:e}}),Me=Ye.project.lastReleaseId;t.autoUpload&&await dt(Ye.project.connectedStores.map(z=>async()=>{try{const oe=await w.publishToStore({input:{did:c.meta.did,storeId:z.storeId,storeName:z.storeName,projectId:e,releaseId:Me,type:H}});A.success(n.jsx(tr,{storeName:z.storeName,storeUrl:z.storeUrl,developerDid:z.developerDid,published:oe.url==="published"}),{duration:1e4})}catch(oe){A.error(Ee(oe))}}),{concurrency:4}),G==null||G(),F(`../${e}/view/${Me}`,{replace:!0})},X=Q=>(T(!0),Y(Q).finally(()=>{T(!1)})),J=async Q=>{await tl(w,Q),m()},ne=()=>{W(!0)},me=fe(sn,`/api/project/${c.meta.did}/${e}/${f}/release/blocklet.json`),ce=new URL(sn);ce.pathname=fe(ce.pathname,"/launch-blocklet/agreement"),ce.searchParams.set("blocklet_meta_url",me);const te=ce.href,Re=()=>M(me);return n.jsxs(n.Fragment,{children:[n.jsx(bc,{className:"sticky-header",children:n.jsxs(g,{display:"flex",alignItems:"center",flexDirection:"row",children:[n.jsxs(Nn,{className:"breadcrumbs","aria-label":"breadcrumb",children:[n.jsx(pe,{to:"../",children:_("common.blockletStudio")}),e===K.UNOWNED_DID?n.jsx(V,{color:"text.primary",children:n.jsx(xe,{maxLength:$?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}):n.jsx(pe,{to:`../${e}`,children:n.jsx(xe,{maxLength:$?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}),n.jsx(V,{color:"text.primary",children:i==="create"?_("common.create"):(t==null?void 0:t.blockletVersion)||_("common.edit")})]}),n.jsx(g,{flex:"1"}),!u&&n.jsxs(Tt,{disabled:l,variant:"contained",children:[n.jsxs(se,{variant:"contained",onClick:()=>X(Te.PROJECT.RELEASE_STATUS.published),children:[l&&n.jsx(at,{size:14,sx:{mr:.5},color:"inherit"}),_("blocklet.publish.createRelease")]}),n.jsx(se,{variant:"contained",onClick:ne,children:n.jsx(ae,{icon:"mage:settings-fill",fontSize:"16px"})})]}),u&&n.jsxs(n.Fragment,{children:[n.jsx(yn,{fullWidth:!0,maxWidth:"sm",open:I,onClose:()=>M(""),children:n.jsxs(g,{sx:{py:5,px:4,wordBreak:"break-all"},children:[n.jsx(V,{variant:"h6",sx:{mb:2},children:_("blocklet.publish.installResourceTip")}),n.jsx(rr,{children:I}),n.jsxs(V,{sx:{mt:2},children:[_("blocklet.publish.installResourceTip2"),n.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:_("blocklet.publish.installResourceHelp")})]})]})}),n.jsxs(Tt,{disabled:l,variant:"contained",children:[n.jsxs(se,{onClick:()=>D(!0),children:[l?n.jsx(at,{size:14,sx:{mr:1},color:"inherit"}):n.jsx(as,{sx:{fontSize:"1.3em",mr:1}}),_($?"common.upload":"blocklet.publish.connectOrUpload")]}),n.jsx(ps,{isPack:H==="pack",downloadUrl:fe(`${K.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${c.meta.did}/${e}/${f}/download/${(a.files||[])[0]}`),installUrl:te,handleSetTip:Re}),n.jsx(se,{onClick:ne,children:n.jsx(ae,{icon:"mage:settings-fill",fontSize:"16px"})})]})]})]})}),n.jsx(kn,{title:_("blocklet.publish.connectOrUpload"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:N,onClose:()=>D(!1),children:n.jsx(ko,{projectType:P,blocklet:c,releaseType:H,projectId:e,releaseId:f,componentDid:p,onPublish:G,onOpenConnectStore:J,onDelete:m,connectedStores:t.connectedStores||[],publishedStoreIds:a==null?void 0:a.publishedStoreIds})}),n.jsx(us,{did:(Z=c==null?void 0:c.meta)==null?void 0:Z.did,params:t,projectId:e,open:U,setParams:r,onClose:()=>W(!1)})]})}fs.propTypes={projectId:h.string.isRequired,params:h.object.isRequired,mode:h.string.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,release:h.object.isRequired,isPublished:h.bool.isRequired,releaseId:h.string.isRequired,getData:h.func.isRequired,getRelease:h.func.isRequired,componentDid:h.string.isRequired,resourceRelateComponents:h.object.isRequired,disabledSelectComponents:h.bool.isRequired,saveSelectedEventsRef:h.object.isRequired,hasSelectedResources:h.bool.isRequired,initLogoUrl:h.string.isRequired,setLoading:h.func.isRequired,releaseUsedLast:h.bool.isRequired,setReleaseUsedLast:h.func.isRequired,projectType:h.string.isRequired,setParamsErrTip:h.func.isRequired,setParams:h.func.isRequired,initUrl:h.object.isRequired,paramsErrTip:h.object.isRequired};const bc=he.div`
|
|
167
|
-
.sticky-header {
|
|
168
|
-
margin-top: -12px;
|
|
169
|
-
padding: 12px 0;
|
|
170
|
-
position: sticky;
|
|
171
|
-
top: 0;
|
|
172
|
-
z-index: 99;
|
|
173
|
-
display: flex;
|
|
174
|
-
align-items: center;
|
|
175
|
-
justify-content: space-between;
|
|
176
|
-
background-color: #fff;
|
|
177
|
-
padding-bottom: 12px;
|
|
178
|
-
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
179
|
-
}
|
|
180
|
-
`;function hs({text:e}){return e?n.jsx(cr,{wrapperElement:{"data-color-mode":"light"},source:ar.sanitize(e),rehypePlugins:[[dr,{target:"_blank"}]]}):n.jsx(Pe,{Icon:Gt})}hs.propTypes={text:h.string.isRequired};function ms({params:e,setParams:t,paramsErrTip:o,loading:s,setParamsErrTip:r,readOnly:i}){var f;const{t:l}=ee(),[c,a]=k.useState(i?"preview":"write"),u=(m,x)=>{a(x)};return n.jsxs(g,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[n.jsxs(g,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[n.jsx(V,{variant:"h6",fontWeight:"bold",sx:{},children:l("common.introduction")}),n.jsxs(Hs,{value:c,onChange:u,"aria-label":"wrapped label tabs example",children:[n.jsx($o,{value:"write",label:"Write"}),n.jsx($o,{value:"preview",label:"Preview"})]})]}),n.jsx(g,{display:c==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:n.jsx(de,{disabled:s||i,sx:{border:"none"},placeholder:`Blocklet ${l("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:i,endAdornment:n.jsxs(bt,{position:"end",children:[((f=e==null?void 0:e.blockletIntroduction)==null?void 0:f.length)||0," / ",Te.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:m=>{r({blockletIntroduction:""}),t({blockletIntroduction:m.target.value.slice(0,Te.PROJECT.MAX_INTRO_LENGTH)})},error:!!o.blockletIntroduction,helperText:o.blockletIntroduction||""})}),n.jsx(g,{display:c==="preview"?"block":"none",mt:3,children:n.jsx(hs,{text:e.blockletIntroduction||""})})]})}ms.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 So={},gc=Se;Object.defineProperty(So,"__esModule",{value:!0});var bs=So.default=void 0,xc=gc(ke()),rn=n;bs=So.default=(0,xc.default)([(0,rn.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,rn.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function Co({step:e,ok:t,active:o,error:s}){let r="grey.500",i=e+1;return t&&(i=n.jsx(ur,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&o>e?(r="error.main",i=n.jsx(bs,{sx:{fontSize:18,margin:0},color:"white"})):o>=e&&(r="primary.main"),n.jsx(g,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:i})}Co.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};Co.defaultProps={step:0,ok:!1,active:0,error:""};function gs({steps:e,activeStep:t,setActiveStep:o,hasSelectedResources:s,params:r,loading:i,paramsErrTip:l,viewMode:c,projectId:a}){const{t:u}=ee(),f=()=>{o(p=>p+1)},m=()=>{o(p=>p-1)},x=p=>p===0?(l==null?void 0:l.blockletTitle)||(l==null?void 0:l.projectId)||(l==null?void 0:l.blockletDescription)||(l==null?void 0:l.blockletHomepage)||(l==null?void 0:l.blockletSupport)||(l==null?void 0:l.blockletCommunity)||(l==null?void 0:l.blockletRepository):p===2?l==null?void 0:l.blockletResource:p>=4?(l==null?void 0:l.blockletVersion)||(l==null?void 0:l.note):"",d=c||ds({hasSelectedResources:s,params:r,projectId:a,t:u})===null;return n.jsxs(g,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[n.jsx(fr,{activeStep:t,orientation:"vertical",children:e.map((p,b)=>{const S={},j=i||!mc({hasSelectedResources:s,params:r,projectId:a,step:b,t:u}),y=i?"":x(b);return y&&(S.optional=n.jsx(V,{variant:"caption",color:"error",children:y}),S.error=!0),n.jsxs(hr,{children:[n.jsx(Er,{icon:n.jsx(Co,{error:y,active:d?99:t,step:b,ok:j}),sx:{cursor:"pointer",color:y?"error.main":"inherit"},disabled:!1,onClick:()=>o(b),...S,children:n.jsx(V,{fontSize:"14px",fontWeight:"500",color:y||!j&&t>b?"error.main":"inherit",children:p.label})}),n.jsxs(Ar,{children:[n.jsx(V,{fontSize:12,children:p.description}),!d&&n.jsx(g,{sx:{mb:2},children:n.jsxs("div",{children:[b<e.length-1&&n.jsx(se,{variant:"contained",onClick:f,sx:{mt:1,mr:1},disabled:y||!j,children:u("common.continue")}),b>0&&n.jsx(se,{disabled:b===0,onClick:m,sx:{mt:1,mr:1},children:u("common.back")})]})})]})]},p.label)})}),t>=e.length-1&&n.jsx(zt,{square:!0,elevation:0,sx:{p:3},children:n.jsx(V,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}gs.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,blockletRepository:h.string}).isRequired};const yc=[".zip",".gz"],jc=1024*1024*100,kc=k.lazy(()=>jn(()=>import("./index-CH1qAD3K.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 Ro({app:e,projectId:t,readOnly:o,params:s,setParams:r,setParamsErrTip:i,error:l}){const{t:c}=ee(),a=k.useRef(null),u=()=>o?!1:!t||t===K.UNOWNED_DID?(A.error(c("blocklet.publish.errorTip.noFirstDid")),!1):!0,f=`${K.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return n.jsxs(g,{sx:{mt:3},children:[n.jsx(V,{gutterBottom:!0,children:c("blocklet.publish.resourceUpload")}),n.jsxs(Ie,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:o?"default":"pointer"},children:[!!s.uploadedResource&&n.jsx(V,{component:"a",href:`${f}/params.uploadedResource`,children:s.uploadedResource}),!o&&n.jsx(se,{variant:"outlined",size:"small",onClick:()=>{var m;u()&&((m=a.current)==null||m.open())},children:s.uploadedResource?c("common.change"):c("common.upload")})]}),n.jsx(k.Suspense,{fallback:n.jsx(Qe,{}),children:n.jsx(kc,{ref:a,popup:!0,onUploadFinish:m=>{var x;r({uploadedResource:m.data.filename}),i({blockletResource:""}),(x=a.current)==null||x.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:f,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:yc,maxFileSize:jc,maxNumberOfFiles:1}}},"uploader-resource")}),!!l&&n.jsx(g,{color:"error.main",mt:1,fontSize:14,children:l})]})}Ro.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};Ro.defaultProps={};function pt({readOnly:e,params:t,setParams:o,paramsErrTip:s,setParamsErrTip:r,loading:i}){var c;const{t:l}=ee();return n.jsx(g,{display:"flex",mt:3,className:"section",children:n.jsxs(g,{sx:{flex:1},children:[n.jsx(de,{required:!0,disabled:i||e,label:`Blocklet ${l("common.version")}`,placeholder:`Blocklet ${l("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:a=>{r({blockletVersion:""}),o({blockletVersion:a.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),n.jsx(de,{label:l("blocklet.publish.releaseNote"),autoComplete:"off",disabled:i||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:n.jsxs(bt,{position:"end",children:[((c=t==null?void 0:t.note)==null?void 0:c.length)||0," / ",Te.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:a=>{r({note:""}),o({note:a.target.value.slice(0,Te.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}pt.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};pt.defaultProps={};function xs(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&xs(e[t]);return e}const Sc=({tabs:e,blocklet:t,ancestors:o=[]})=>{const s=t.meta.did;e.push({label:n.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[n.jsx(Ht,{size:24,blocklet:t,ancestors:o}),n.jsx(g,{ml:"4px",className:"text",children:n.jsx(g,{children:t.meta.title})})]},s),value:s})},ln=(e,t)=>{const o=Ft(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletVideos","blockletScreenshots","blockletResourceType","blockletSupport","blockletHomepage","blockletCommunity","blockletRepository","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return o.blockletComponents?o.blockletComponents=o.blockletComponents.map(s=>({...s,included:!0})):o.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),o.resourceFromSelect=!o.uploadedResource,o},Cc={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},cn={branding:0,introduction:1,resources:2,blocklets:3,version:4};function vo({initUrl:e,...t}){var wo;const{projectId:o,mode:s,releaseId:r,componentDid:i=""}=ht(),{t:l}=ee(),{blocklet:c}=$e(),[a,u]=De({blockletScreenshots:[],blockletVideos:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",blockletResourceType:"",blockletSupport:"",blockletCommunity:"",blockletHomepage:"",blockletRepository:"",resourceFromSelect:!0}),[f,m]=De({}),[x,d]=k.useState(!1),[p,b]=De(null),{api:S}=Ce(),j=Je(L=>L.breakpoints.down("md")),[y,R]=k.useState({}),[T,v]=k.useState(!1),C=k.useRef({}),[P,_]=De({}),[E,w]=k.useState(""),[F,N]=De({}),D=e==null?void 0:e.searchParams.get("dependentComponentsMode"),U=D==="readonly",W=k.useMemo(()=>{const L={};return Object.keys(F).forEach(O=>{const we=F[O];we&&we.forEach(ks=>{L[ks]=!0})}),L},[F]),I=k.useCallback(L=>{U&&u({blockletComponents:[]}),N(L)},[U,N,u]),M=k.useCallback((...L)=>{_(...L),m({blockletResource:""})},[]),$=r==="none"?(a==null?void 0:a.lastReleaseId)||"":r,[H,G]=k.useState(s==="new-release"?4:0);k.useEffect(()=>{o&&m({projectId:""})},[o,m]);const Y=k.useMemo(()=>{var L;return(a==null?void 0:a.blockletResourceType)==="resource"?"resource":(L=a==null?void 0:a.blockletComponents)!=null&&L.some(O=>O.included)||Object.keys(W).length||a!=null&&a.uploadedResource?"pack":"resource"},[a==null?void 0:a.blockletComponents,a==null?void 0:a.uploadedResource,W,a==null?void 0:a.blockletResourceType]),X=[],J=((c==null?void 0:c.children)||[]).filter(L=>{var O;return(O=L.meta.resource)==null?void 0:O.exportApi}).filter(L=>!i||L.meta.did===i);J.forEach(L=>{Sc({tabs:X,blocklet:L,t:l,ancestors:[c]})});const[ne,me]=k.useState((wo=X[0])==null?void 0:wo.value),ce=!T&&(p==null?void 0:p.status)==="published",te=ce,Re=qs(()=>{if(!e)return;w(e.searchParams.get("logo")),u(O=>{var we;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:(we=O==null?void 0:O.blockletComponents)!=null&&we.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 L=e.searchParams.get("resources");try{const O=JSON.parse(L);R(O)}catch{}}),Z=async()=>{if($)try{const L=await S.getRelease({input:{did:c.meta.did,projectId:o,releaseId:$}});if(d(!1),!L.release){A.error("Release not found");return}L.release=xs(L.release),s!=="view"&&(L.release.note=""),u(O=>ln({...O,...L.release,blockletVersion:s==="create"||s==="new-release"?_e.inc(L.release.blockletVersion,"patch"):L.release.blockletVersion},c)),b(L.release)}catch(L){d(!1),A.error(Ee(L))}},Q=async()=>{if(o===K.UNOWNED_DID){u({blockletVersion:"1.0.0",blockletTitle:""});return}if(!o){A.error(l("blocklet.publish.errorTip.noDid"));return}try{const O=(await S.getProject({input:{did:c.meta.did,projectId:o}})).project||{};O.blockletVersion?(s==="create"||s==="new-release")&&_e.valid(O.blockletVersion)&&(O.blockletVersion=_e.inc(O.blockletVersion,"patch")):O.blockletVersion="1.0.0";const we=ln(O,c);u(we),O.lastReleaseId||Re()}catch(L){A.error(Ee(L))}},re=k.useCallback(async()=>{d(!0);try{if(s==="view"){if(!$){A.error("Empty release id");return}await Q(),await Z();return}await Q(),$&&(v(!0),await Z())}finally{d(!1)}},[s,$]),q=L=>{u({blockletComponents:L})},Ye=L=>{u({blockletResourceType:L})};k.useEffect(()=>{re()},[re]),k.useEffect(()=>{o===K.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&Re()},[o,e,s,Re]);const Me=k.useMemo(()=>!!Object.keys(P).find(L=>!!P[L].length),[P]);if(!a&&x)return n.jsx(Qe,{});if(!a)return null;const Oe=J.find(L=>L.meta.did===ne);if(J.every(L=>L.status!=="running")&&(J!=null&&J.length))return n.jsx(Pe,{children:l("blocklet.publish.allComponentsNotRunning")});const Ze=L=>{me(L)},z=e==null?void 0:e.searchParams.get("resourcesTitle"),oe=e==null?void 0:e.searchParams.get("componentsTitle"),ue=[{label:l("blocklet.publish.branding"),description:l("blocklet.publish.steps.branding")},{label:l("common.introduction"),description:l("blocklet.publish.steps.introduction")},{label:z||l("blocklet.publish.resourceTitle"),description:l("blocklet.publish.steps.resources")},{label:oe||l("common.components"),description:l("blocklet.publish.steps.blocklets")},{label:l("blocklet.publish.versionTitle"),description:l("blocklet.publish.steps.version")}],js=ue[H]||ue[ue.length-1],ve=Cc[H];return n.jsxs(Rc,{...t,children:[n.jsx(fs,{blocklet:c,release:p,getData:re,getRelease:Z,mode:s,params:a,setParams:u,setParamsErrTip:m,readOnly:te,isPublished:ce,loading:x,setLoading:d,initLogoUrl:E,releaseId:$,projectId:o,projectType:Y,resourceComponents:J,resourceComponentsMap:F,resourceRelateComponents:W,resourceItem:Oe,saveSelectedEventsRef:C,hasSelectedResources:Me,releaseUsedLast:T,setReleaseUsedLast:v,setRelease:b,paramsErrTip:f}),n.jsxs(g,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[n.jsx(g,{pt:3}),n.jsxs(g,{sx:{gap:3},display:"flex",flexDirection:j?"column":"row",children:[!j&&n.jsx(gs,{steps:ue,loading:x,viewMode:s==="view",params:a,hasSelectedResources:Me||a.uploadedResource,paramsErrTip:f,activeStep:H,setActiveStep:G,projectId:o,resourcesUrlTitle:z,componentsUrlTitle:oe}),n.jsxs(g,{flex:"1",maxWidth:"720px",children:[!j&&ve!=="introduction"&&n.jsxs(V,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[js.label,ve==="branding"&&n.jsx(ge,{title:l("blocklet.publish.brandingHelp"),placement:"right",children:n.jsx(g,{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(Us,{})})})]}),(j||ve==="branding")&&n.jsx(g,{flexDirection:"column",children:n.jsx(cs,{projectId:o,setParams:u,setParamsErrTip:m,params:a,componentDid:i,blocklet:c,initUrl:e,loading:x,setLoading:d,paramsErrTip:f,readOnly:te,initLogoUrl:E,setInitLogoUrl:w})}),j&&n.jsx(g,{flexDirection:"column",children:n.jsx(pt,{loading:x,params:a,paramsErrTip:f,setParams:u,setParamsErrTip:m,readOnly:te})}),(j||ve==="introduction")&&n.jsx(g,{display:"flex",flexDirection:"column",sx:{mt:j?5:0,width:"100%"},children:n.jsx(ms,{loading:x,readOnly:te,params:a,setParams:u,paramsErrTip:f,setParamsErrTip:m})}),j&&n.jsx(V,{variant:"h6",fontWeight:"bold",mt:5,children:ue[cn.resources].label}),n.jsx(g,{display:j||ve==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:n.jsx(g,{display:"flex",mt:3,className:"section full-width",children:n.jsxs(g,{sx:{flex:1},children:[n.jsxs(mr,{onChange:()=>u({resourceFromSelect:!a.resourceFromSelect}),children:[n.jsx(It,{value:"select",disabled:te,control:n.jsx(Oo,{size:"small",checked:a.resourceFromSelect}),label:l("blocklet.publish.resourceSelect")}),n.jsx(It,{value:"select",disabled:te,control:n.jsx(Oo,{size:"small",checked:!a.resourceFromSelect}),label:l("blocklet.publish.resourceUpload")})]}),a.resourceFromSelect&&n.jsxs(n.Fragment,{children:[!i&&n.jsx(Ks,{tabs:X,current:ne,onChange:Ze,sx:{ml:-2,mt:2,maxWidth:j?window.innerWidth-24:"100%"}}),n.jsx(ao,{loading:x,initialResources:y,saveSelectedEventsRef:C,selectedResourceIds:P,setSelectedResourceIds:M,setResourceComponentsMap:I,error:f.blockletResource,app:c,readOnly:te,component:Oe,componentDid:i,initUrl:e,params:a,setParams:u,projectId:o===K.UNOWNED_DID?"":o,releaseUsedLast:T,release:{...p,id:$}})]}),!a.resourceFromSelect&&n.jsx(Ro,{app:c,readOnly:te,projectId:o===K.UNOWNED_DID?"":o,params:a,error:f.blockletResource,setParams:u,setParamsErrTip:m})]})})}),j&&n.jsx(V,{variant:"h6",fontWeight:"bold",mt:5,children:ue[cn.blocklets].label}),(j||ve==="blocklets")&&n.jsx(g,{flexDirection:"column",children:n.jsx(g,{display:"flex",mt:3,className:"section full-width",children:n.jsx(g,{sx:{flex:1},children:n.jsx(oo,{projectType:Y,disabled:x||te,app:c,value:(a==null?void 0:a.blockletComponents)||[],blockletResourceType:(a==null?void 0:a.blockletResourceType)||"",onChange:q,onChangeBlockletResourceType:Ye,resourceRelateComponents:W,dependentComponentsMode:D})})})}),!j&&ve==="version"&&n.jsx(g,{flexDirection:"column",children:n.jsx(pt,{loading:x,params:a,paramsErrTip:f,setParams:u,setParamsErrTip:m,readOnly:te})})]})]})]})]})}vo.propTypes={initUrl:h.object};vo.defaultProps={initUrl:null};const Rc=he.div`
|
|
181
|
-
.section {
|
|
182
|
-
&.full-width {
|
|
183
|
-
max-width: 100%;
|
|
184
|
-
}
|
|
185
|
-
.MuiTypography-h3 {
|
|
186
|
-
font-size: 1.1rem;
|
|
187
|
-
font-weight: 700;
|
|
188
|
-
}
|
|
189
|
-
.left {
|
|
190
|
-
flex-shrink: 0;
|
|
191
|
-
width: 140px;
|
|
192
|
-
}
|
|
193
|
-
.MuiTabs-indicator {
|
|
194
|
-
display: none;
|
|
195
|
-
}
|
|
196
|
-
.MuiTypography-subtitle1 {
|
|
197
|
-
width: 120px;
|
|
198
|
-
font-weight: 700;
|
|
199
|
-
font-size: 1rem;
|
|
200
|
-
${({theme:e})=>e.breakpoints.down("sm")} {
|
|
201
|
-
width: 80px;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
.MuiButtonBase-root {
|
|
206
|
-
a {
|
|
207
|
-
color: inherit;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
.MuiInputBase-multiline .MuiInputAdornment-positionEnd {
|
|
211
|
-
align-self: flex-end;
|
|
212
|
-
.MuiTypography-root {
|
|
213
|
-
font-size: 0.8rem;
|
|
214
|
-
}
|
|
215
|
-
font-size: 0.8rem;
|
|
216
|
-
}
|
|
217
|
-
`;function ys({padding:e,initUrl:t}){const{blocklet:o}=$e(),s=As(),{componentDid:r}=ht();if(k.useEffect(()=>{if(r&&window.parent){const l=`${s.pathname}${s.search}`;window.parent.postMessage({event:"popstate",page:"publish",componentDid:r,path:l},"*")}},[r,s]),!o)return null;const i={};return e&&(i.padding=e),n.jsx(vc,{style:i,children:n.jsxs(Bs,{children:[n.jsx(kt,{path:"/",element:n.jsx(Zt,{initUrl:t})}),n.jsx(kt,{path:"/:projectId",element:n.jsx(Qr,{})}),n.jsx(kt,{path:"/:projectId/:mode/:releaseId",element:n.jsx(vo,{initUrl:t})})]})})}ys.propTypes={padding:h.oneOfType([h.string,h.number]),initUrl:h.object};ys.defaultProps={padding:"",initUrl:null};const vc=he(g)`
|
|
218
|
-
a {
|
|
219
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
220
|
-
}
|
|
221
|
-
`;export{ys as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as h,a6 as g,aQ as y,j as t,C as P,n as v,B as c,a7 as d,P as m,a4 as w}from"./index-CUdjeFH3.js";import{P as T}from"./page-header-cgpPCMon.js";import{u as B}from"./config-space-D4B-Fcx4.js";import{C as E,D,a as N}from"./connect-to-Byo-gZWq.js";import{S as u}from"./step-actions-oy5A5R40.js";import{S as b}from"./layout-CqjS3RFh.js";import"./index-BcaFN_aP.js";import"./api-Du2npubO.js";import"./index-q27UQsWn.js";import"./ExpandMore-CLLcIz7v.js";import"./ButtonGroup-BQ3t8F0M.js";import"./DeleteOutline-CNDiVs89.js";import"./format-error-CpEoP1rb.js";import"./OpenInNew-CIsQ-VD4.js";import"./CloseOutlined-sL5HP2JB.js";import"./Link-BePn_RNM.js";import"./HelpOutline-CMsKsWc3.js";import"./DialogContentText-CEsqdDWz.js";import"./TextField-apRN2NFH.js";import"./FormControl-BXjjQ2Cl.js";import"./utils-DoM3o7-Q.js";import"./useFormControl-Bm0BZQS7.js";import"./Select-BoIViWSN.js";import"./OutlinedInput-B93_cuhJ.js";import"./content-layout-B3qFdI6N.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=h.useContext(g),{blocklet:e}=y(),{spaceGateway:C,settingStorageEndpoint:j,updateSpaceGateway:f,hasStorageEndpoint:S,loading:o,storageEndpoint:s}=B();return o?t.jsx(P,{relative:"parent",children:t.jsx(v,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(T,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(E,{spaceGateway:C,settingStorageEndpoint:j}):t.jsx(D,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:f,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(d,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(d,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:m.func,onPrevious:m.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=w(b)`
|
|
2
|
-
height: 100%;
|
|
3
|
-
overflow-y: auto;
|
|
4
|
-
`;export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f9 as b}from"./index-CUdjeFH3.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{P as l,r as d,j as n,B as g,ba as A,a6 as G,df as H,fy as U,ae as Y,aI as L,n as J,d5 as Q,ed as Z,a4 as v}from"./index-CUdjeFH3.js";import{d as ee}from"./Done-B1Id3HZ7.js";import{C as te}from"./Google-BAgnJN1d.js";import{T as ne}from"./TextField-apRN2NFH.js";import{R as re,F as oe,L as se}from"./logo-uploader-DabQD2dA.js";const N={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function S({editing:r,value:o,onChange:a}){const[c,u]=d.useState(!1),m=d.useRef(),p=d.useRef(o);d.useEffect(()=>{let s=null;return r&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[r]);const k=s=>{p.current=s,a(s)},b=()=>{u(!1),a(p.current)},I=n.jsx(g,{className:"form-item-input slot",px:1,children:n.jsxs(g,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&n.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=n.jsxs(g,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:b,children:[n.jsx(g,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:n.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),n.jsx(A,{open:c,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n.jsx(te,{color:o,onChange:s=>k(s.hex)})})]});return r?f:I}S.propTypes=N;function T({editing:r,description:o,value:a,onChange:c,componentProps:u,...m}){const{placeholder:p}=u,k=d.useRef(a),{t:b}=d.useContext(G),I=s=>{s.key==="Enter"&&c(k.current,"confirm")},f=s=>{k.current=s,c(s)};return r?n.jsx(ne,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:I,...m}):n.jsx(g,{px:1,className:"form-item-input slot",children:a||n.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:o||p})})})}T.propTypes=N;T.defaultProps={componentProps:{}};function _({editing:r,value:o,onChange:a,componentProps:c,...u}){const{blocklet:m}=c,p=o==="auto"?H.getPassportColorFromDid(m.appDid):o;return n.jsxs(g,{display:"flex",alignItems:"center",children:[n.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:U({title:"Owner",issuer:Y.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:o||"auto"})}}),n.jsx(S,{...u,editing:r,value:r?p:o,onChange:a,componentProps:c})]})}_.propTypes={...N,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};_.defaultProps={};const ie=Z`
|
|
2
|
-
0%, 100% {
|
|
3
|
-
transform: scale(1) translateX(0);
|
|
4
|
-
}
|
|
5
|
-
50% {
|
|
6
|
-
transform: scale(1.05) translateX(-3px);
|
|
7
|
-
}
|
|
8
|
-
25%, 75% {
|
|
9
|
-
transform: scale(1.1) translateX(3px);
|
|
10
|
-
}
|
|
11
|
-
`,ae={input:T,color:S,passport:_,uploader:r=>n.jsx(se,{...r.componentProps})};function le(r,{editing:o=!1}){const{componentType:a="input",render:c,renderFormItem:u}=r;return o&&u?u:!o&&c?c:ae[a==null?void 0:a.toLowerCase()]}function O({schema:r,loading:o,value:a,defaultValue:c,onChange:u,style:m,disabled:p}){const k=Object.prototype.toString.call(a)==="[object Object]",[b,I]=d.useState([]),[f,s]=d.useState(k?a:c),V=d.useMemo(()=>r.length===1,[r]),h=d.useCallback(e=>b.find(t=>t.key===e),[b]);d.useEffect(()=>{var e;V&&((e=r[0])!=null&&e.required)&&I([{key:r[0].key,editing:!0,initialValue:c[r[0].key]}])},[r,V,c]);const P=d.useCallback(e=>{I(t=>t.find(i=>i.key===e.key)?t.map(i=>i.key===e.key?e:{...i}):[e].concat(t))},[]),w=d.useCallback((e,t,y)=>{const{key:i,secure:R}=e,x=h(i)??{...e};x.editing=!0;const j=f[i]!==t;x.edited=t&&x.initialValue!==t,x.initialValue=c[i];const C={...f,[i]:t};j&&s(C),u({[i]:t},{allValues:C,action:y,currentItem:e}),y==="confirm"&&R&&s({...f,[i]:"__encrypted__"}),y==="confirm"&&(x.initialValue=f[i]),["confirm","cancel"].includes(y)&&(x.editing=!1,x.edited=!1),P(x)},[c,f,u,P,h]);function z(e,{editing:t=!1}){const{key:y}=e,i=k?a[y]:f[y];return i==="__encrypted__"?t?"":"******":i}const F=d.useCallback(e=>{const t=h(e.key);t&&w(e,t.initialValue,"cancel")},[h,w]),D=d.useCallback(e=>{const t=h(e.key);!t||!t.edited||(t.shaking=!0,P(t),setTimeout(()=>{t.shaking=!1,P(t)},500))},[h,P]),K=d.useCallback(e=>{const t=h(e.key);!t||!t.edited?F(e):D(e)},[h,D,F]);return n.jsx(ce,{className:"form",style:m,children:r==null?void 0:r.map(e=>{const{key:t,description:y,required:i,solo:R=!1,hidden:x=!1,componentProps:q={}}=e;if(x)return null;const j=h(t),{editing:C,shaking:B}=j??{},E=z(e,{editing:C}),M=le(e,{editing:C}),W={inputProps:{"data-cy":"schema-form-item-component"},key:t,description:y,editing:C,value:E,onChange:(X,$="change")=>w(e,X,$),componentProps:q,onBlur:()=>K(e)};return n.jsxs(g,{className:"form-item",children:[!R&&n.jsxs(g,{className:"form-item-label",style:{color:i&&!E?"#ff0000":"#333"},children:[y,i&&n.jsx(re,{})]}),n.jsxs(g,{className:"form-item-body",children:[n.jsx(g,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:R?"center":"left"},style:{cursor:"text"},onClick:()=>{p||j!=null&&j.edited||w(e,f[t],"edit")},children:n.jsx(M,{...W})}),!R&&n.jsx(g,{className:"form-item-action",style:{marginLeft:0},children:C?n.jsxs(n.Fragment,{children:[j.edited?n.jsx(L,{"data-cy":"schema-form-item-confirm",onClick:()=>{w(e,E,"confirm")},disabled:p||o,sx:{animation:B?`${ie} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:o?n.jsx(J,{size:24}):n.jsx(ee,{})}):null,n.jsx(L,{"data-cy":"schema-form-item-cancel",onClick:()=>F(e),style:{paddingLeft:j.edited?4:8},disabled:p||o,size:"large",children:n.jsx(Q,{})})]}):null})]})]},t)})})}O.propTypes={schema:l.array.isRequired,loading:l.bool,onChange:l.func.isRequired,value:l.object,defaultValue:l.object,style:l.object,disabled:l.bool};O.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const ce=v(oe)``;export{O as S};
|