@abtnode/blocklet-services 1.16.29-beta-db5c4ed6 → 1.16.29-beta-bb5685f8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/routes/env.js +2 -1
- package/dist/assets/{Add-CG-F3Tpq.js → Add-Brs6l0hU.js} +1 -1
- package/dist/assets/{AddBox-CCE1buV8.js → AddBox-BorsWH1L.js} +1 -1
- package/dist/assets/{Alert-cwZghN5o.js → Alert-CdrO9wp_.js} +1 -1
- package/dist/assets/{ArrowDropDown-DpHnrXJX.js → ArrowDropDown-Cc7ZV2yN.js} +1 -1
- package/dist/assets/{Avatar-BVTgZMZu.js → Avatar-B857twI0.js} +1 -1
- package/dist/assets/{ButtonGroup-Cf877fOo.js → ButtonGroup-CNCUbNBn.js} +1 -1
- package/dist/assets/{CheckCircle-CZETHIjv.js → CheckCircle-OSzkr55G.js} +1 -1
- package/dist/assets/{ChevronRight-B1-v0rVj.js → ChevronRight-p9uIbU8Z.js} +1 -1
- package/dist/assets/{Close-DM3JyAUN.js → Close-gciQI04i.js} +1 -1
- package/dist/assets/{CloseOutlined-D-nYpxl4.js → CloseOutlined-Xl6vJm1S.js} +1 -1
- package/dist/assets/{Delete-DJZzf2v3.js → Delete-k49MPvRz.js} +1 -1
- package/dist/assets/{DeleteOutline-UAdOMkx7.js → DeleteOutline-QSrwg0EI.js} +1 -1
- package/dist/assets/{Done-CIjx7jUD.js → Done-D_Xh37ry.js} +1 -1
- package/dist/assets/{Download-CZGyacWn.js → Download-B2JnXf0Y.js} +1 -1
- package/dist/assets/{Edit-DUj2eyUz.js → Edit-Bj54pAe_.js} +1 -1
- package/dist/assets/{EditIcon-jpbTcPi9.js → EditIcon-489vuPgf.js} +1 -1
- package/dist/assets/{Error-CzevJZgV.js → Error-DVFEbqrz.js} +1 -1
- package/dist/assets/{ExpandMore-Vsh2QVwZ.js → ExpandMore-B8-mtsJf.js} +1 -1
- package/dist/assets/{FilterList-Cy1sL14k.js → FilterList-Du3mVkNU.js} +1 -1
- package/dist/assets/{FormControl-B_Do5Nt6.js → FormControl-DrLoqvI1.js} +1 -1
- package/dist/assets/{FormControlLabel-BDYHQJ8F.js → FormControlLabel-BZ-Na1Px.js} +1 -1
- package/dist/assets/{FormGroup-Bk12j31H.js → FormGroup-B_cYMk58.js} +1 -1
- package/dist/assets/{Google-CPv9gImr.js → Google-1aQCgZJc.js} +1 -1
- package/dist/assets/{Hidden-kVeQMxEt.js → Hidden-B3_ybJ-q.js} +1 -1
- package/dist/assets/{InfoOutlined-DUs9-7mj.js → InfoOutlined-5DVg0LZC.js} +1 -1
- package/dist/assets/{InputAdornment-C-wpGP7M.js → InputAdornment-Dmqc2UlU.js} +1 -1
- package/dist/assets/{InputLabel-4YX1ylv6.js → InputLabel-ys_ApPlk.js} +1 -1
- package/dist/assets/{LastPage-BfloM2Wq.js → LastPage-BlouWXDK.js} +1 -1
- package/dist/assets/{Launch-CahVoyyw.js → Launch-BT1RubZl.js} +1 -1
- package/dist/assets/{LaunchOutlined-CK6AtL0o.js → LaunchOutlined-_SVqRfwQ.js} +1 -1
- package/dist/assets/{Link-D9C6v4KL.js → Link-ltWIbLQC.js} +1 -1
- package/dist/assets/{ListItemText-CbVOTWQ3.js → ListItemText-CK7nMTkm.js} +1 -1
- package/dist/assets/{LoadingButton-CIR80MCf.js → LoadingButton-B9MhTSHg.js} +1 -1
- package/dist/assets/{LockIcon-C20NfK7J.js → LockIcon-Bt33Hpov.js} +1 -1
- package/dist/assets/{Loop-AFtqcSsh.js → Loop-Cw5ml29r.js} +1 -1
- package/dist/assets/{MoreHoriz-kAuD1nY3.js → MoreHoriz-CcbBublh.js} +1 -1
- package/dist/assets/{MoreVert-Dd_rZHl1.js → MoreVert-CB4vQPic.js} +1 -1
- package/dist/assets/{OpenInNew-DYXjNtnC.js → OpenInNew-BqTIjahQ.js} +1 -1
- package/dist/assets/{Pagination-8KVsI0JZ.js → Pagination-DASlGbyu.js} +1 -1
- package/dist/assets/{PlayArrow-s9OSCCm9.js → PlayArrow-vh3KxOxB.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-50eq7smQ.js → QuestionMarkCircle-iO2RyeuL.js} +1 -1
- package/dist/assets/{RadioGroup-DImJzaoP.js → RadioGroup-BN2d11MQ.js} +1 -1
- package/dist/assets/{Search-CxTEsXhT.js → Search-6e7HNczH.js} +1 -1
- package/dist/assets/{Select-D6CeNImJ.js → Select-C_8EtoAI.js} +1 -1
- package/dist/assets/{ServerLogo-dvjXsp5I.js → ServerLogo-BVgOVZYs.js} +1 -1
- package/dist/assets/{Skeleton-DL2VL97S.js → Skeleton-BnhPRGgN.js} +1 -1
- package/dist/assets/{Slider-DSplqaCn.js → Slider-BAB85oRN.js} +1 -1
- package/dist/assets/{Stepper-DJQ-xHUp.js → Stepper-CC1pyQEm.js} +1 -1
- package/dist/assets/{TextField-DVioGsc-.js → TextField-COPeEWpZ.js} +1 -1
- package/dist/assets/{Toolbar-CRxjvb2_.js → Toolbar-BPW2rPOy.js} +1 -1
- package/dist/assets/{ViewList-2sUBAhN9.js → ViewList-DF9-4lGA.js} +1 -1
- package/dist/assets/{access-control-q6rCI632.js → access-control-diYEKGpc.js} +1 -1
- package/dist/assets/{actions-DLwaHSiX.js → actions-CGml5EzX.js} +1 -1
- package/dist/assets/{add-component-core-B3gU-T0w.js → add-component-core-B8i7T4Kg.js} +1 -1
- package/dist/assets/{add-resource-b81lLJ0f.js → add-resource-YZL6z_wU.js} +1 -1
- package/dist/assets/{addon-FuoBpuOX.js → addon-OfXnspdE.js} +1 -1
- package/dist/assets/{analytics-DiVy8Vmf.js → analytics-Dq8yHdj9.js} +1 -1
- package/dist/assets/api-DQ0CtWLc.js +1 -0
- package/dist/assets/{audit-logs-Bv-gENHC.js → audit-logs-BYoVbCT9.js} +1 -1
- package/dist/assets/{button-eQ0RcFyP.js → button-CFuVKG7l.js} +1 -1
- package/dist/assets/{click-to-copy-C0t70-Pv.js → click-to-copy-BFYwGrB_.js} +1 -1
- package/dist/assets/{complete-pY8wsJjf.js → complete-cYx5ykZG.js} +1 -1
- package/dist/assets/{component-BFX3kRXD.js → component-B5cayF5L.js} +1 -1
- package/dist/assets/{config-ndQXqG8O.js → config-B0F49VCo.js} +1 -1
- package/dist/assets/{config-CIbQaP5R.js → config-BbIXkvgr.js} +1 -1
- package/dist/assets/{config-navigation-CC8qHxUp.js → config-navigation-DAac71Vd.js} +1 -1
- package/dist/assets/{config-space-DN8oNvsB.js → config-space-C5zZHk3Q.js} +1 -1
- package/dist/assets/{confirm-DcZkK6Pc.js → confirm-BnMV0-HV.js} +1 -1
- package/dist/assets/{connect-6vivetnz.js → connect-BPk-2UWA.js} +1 -1
- package/dist/assets/{connect-nZhD-SxO.js → connect-CZP4VPEG.js} +1 -1
- package/dist/assets/{connect-to-BU03yn0n.js → connect-to-D5VCzm-i.js} +1 -1
- package/dist/assets/{content-layout-DgQ1ivqD.js → content-layout-B22yg9Bb.js} +1 -1
- package/dist/assets/{dashboard-DJj7YdCJ.js → dashboard-B3FiMlvK.js} +3 -3
- package/dist/assets/{did-address-1pTl5ZJp.js → did-address-B8N2tjFV.js} +1 -1
- package/dist/assets/{domain-DbHm_W8g.js → domain-e0H5zZEP.js} +1 -1
- package/dist/assets/{domain-list-D69n3xq6.js → domain-list-DgSG0eYl.js} +1 -1
- package/dist/assets/{exchange-passport-C1vO8vf7.js → exchange-passport-6c_9Fn5y.js} +1 -1
- package/dist/assets/{fallback-Co8Kc2kj.js → fallback-rmTIFQSJ.js} +1 -1
- package/dist/assets/{format-error-DSoyPyVx.js → format-error-Bl69lCj-.js} +1 -1
- package/dist/assets/{fuel-C-ZdhzZC.js → fuel-ZNj56cX4.js} +1 -1
- package/dist/assets/{fullpage-BxLSpyM0.js → fullpage-CwwzBmps.js} +1 -1
- package/dist/assets/{home-6XDnH9s-.js → home-COTTRtSb.js} +1 -1
- package/dist/assets/{iframe-BWL5r6kn.js → iframe-coF9tnYB.js} +1 -1
- package/dist/assets/{index-BWJ8VQ8o.js → index-3gowKxHt.js} +1 -1
- package/dist/assets/{index-Bc3Y41oE.js → index-5uzjMizz.js} +1 -1
- package/dist/assets/{index-B36YvF84.js → index-7WP5qycS.js} +1 -1
- package/dist/assets/{index-DpC9sww1.js → index-BBng4lwc.js} +1 -1
- package/dist/assets/{index-C82L-zg9.js → index-BJrPsPDp.js} +1 -1
- package/dist/assets/{index-D7CVGBHs.js → index-BR2_C7Zl.js} +1 -1
- package/dist/assets/{index-0Kwb6jmK.js → index-Bdg3eQL4.js} +1 -1
- package/dist/assets/{index-DRjKGjM-.js → index-BrZFXRud.js} +1 -1
- package/dist/assets/{index-DkWYK9Jo.js → index-C7HdzERt.js} +8 -8
- package/dist/assets/{index-6uPYP6zK.js → index-C9lrp93a.js} +1 -1
- package/dist/assets/{index-CHSnAsQ1.js → index-CL2MuWgy.js} +2 -2
- package/dist/assets/{index-CkaWI_Zl.js → index-CSvt-uFl.js} +1 -1
- package/dist/assets/{index-Cnmgkvme.js → index-Cj6tOOrI.js} +1 -1
- package/dist/assets/{index-BaC0Haea.js → index-Cp_x9pQ7.js} +1 -1
- package/dist/assets/{index-DJWtIeK5.js → index-CsVY8MSI.js} +1 -1
- package/dist/assets/{index-knmEO6mr.js → index-DDeCtOVE.js} +1 -1
- package/dist/assets/{index-vwRhQ5RS.js → index-DH5UmDxM.js} +1 -1
- package/dist/assets/{index-vP3Tn4O7.js → index-DLFs97ye.js} +1 -1
- package/dist/assets/{index-B8_eoYBV.js → index-DVbPOY8J.js} +1 -1
- package/dist/assets/{index-DhQKOamW.js → index-DZ-4NSdT.js} +1 -1
- package/dist/assets/{index-NRVaJz9f.js → index-DdYRNkRT.js} +1 -1
- package/dist/assets/{index-BtByfVAB.js → index-De96Lyyw.js} +1 -1
- package/dist/assets/{index-DCBDib20.js → index-DfknqkBQ.js} +1 -1
- package/dist/assets/{index-DUwoq2dS.js → index-MIJejdfR.js} +1 -1
- package/dist/assets/{index-CnDdm9g9.js → index-MfIQbGJk.js} +3 -3
- package/dist/assets/{index-CsPuSl01.js → index-OyvKdcXL.js} +1 -1
- package/dist/assets/{index-D_gLZbnC.js → index-PxS9yNQw.js} +1 -1
- package/dist/assets/{index-DViM25Vy.js → index-hKKO_ETj.js} +1 -1
- package/dist/assets/{index-CI4IafEw.js → index-xH4Oj7ao.js} +1 -1
- package/dist/assets/{index-uHERBk1s.js → index-zLmacV1e.js} +1 -1
- package/dist/assets/{index.es-CAvKNGJJ.js → index.es-BvO-sO5c.js} +1 -1
- package/dist/assets/{index.esm-OBsOHYQt.js → index.esm-dtU2uSGd.js} +1 -1
- package/dist/assets/{invitation-BgQ2lCo2.js → invitation-Iw42cpUv.js} +1 -1
- package/dist/assets/{invite-B8ygHcEw.js → invite-CVLYppb4.js} +1 -1
- package/dist/assets/{issue-passport-CQSIbZov.js → issue-passport-eurFLrCb.js} +1 -1
- package/dist/assets/{item-D_tapEj7.js → item-Dq2QNfn5.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-D277VpMG.js → jss-plugin-props-sort.esm-DzavEauW.js} +1 -1
- package/dist/assets/{launch-result-message-zvz9QdJ0.js → launch-result-message-Df16VNd8.js} +1 -1
- package/dist/assets/{layout-66Qddc3Z.js → layout-CDguKnNr.js} +1 -1
- package/dist/assets/{list-header-CVFTxg9p.js → list-header-E2yyBlW8.js} +1 -1
- package/dist/assets/localization-DTZCbh2e.js +1 -0
- package/dist/assets/{log-m5_kgR9i.js → log-BMysUlUH.js} +1 -1
- package/dist/assets/{login-BCQZewGI.js → login-CWETzIqM.js} +1 -1
- package/dist/assets/{login-oauth-callback-DrGlI4fl.js → login-oauth-callback-DdEzqi_q.js} +1 -1
- package/dist/assets/{logo-uploader-BxL2AT1m.js → logo-uploader-B96Ok6Ys.js} +3 -3
- package/dist/assets/{lost-passport-CvgZJmfW.js → lost-passport-BgvFWPpw.js} +3 -3
- package/dist/assets/{lottie-C925gYap.js → lottie-CQi0bh2D.js} +1 -1
- package/dist/assets/{notifications-Dle2tsHf.js → notifications-H3utjGZ3.js} +1 -1
- package/dist/assets/{overview-RpXehI-A.js → overview-ZAPewHci.js} +1 -1
- package/dist/assets/{page-header-nMH5Nm1-.js → page-header-CLjZ-_ic.js} +1 -1
- package/dist/assets/{permission-DPowxK7C.js → permission-BTXpHNMQ.js} +1 -1
- package/dist/assets/{preferences-C1i7ovMQ.js → preferences-8FPR-jP2.js} +1 -1
- package/dist/assets/publish-resource-_ZSTQIwh.js +1 -0
- package/dist/assets/{react-DR-nB82P.js → react-DhoomF4D.js} +3 -3
- package/dist/assets/{redux-DfSDCKtt.js → redux-vempXYa0.js} +1 -1
- package/dist/assets/{resource-dialog-ifz0m_FZ.js → resource-dialog-D9_0yRlW.js} +1 -1
- package/dist/assets/{selector-C4Gh2j9t.js → selector-BNNdkkFG.js} +1 -1
- package/dist/assets/session-CkWtK0_2.js +1 -0
- package/dist/assets/{setup-BKousrMa.js → setup-DaVOczDK.js} +3 -3
- package/dist/assets/{shorten-label--VZVYLZC.js → shorten-label-HQwCiW2q.js} +1 -1
- package/dist/assets/{slicedToArray-CVLbnzuy.js → slicedToArray-V2PX1JN8.js} +1 -1
- package/dist/assets/{spaces-BGhjBX1b.js → spaces-CzJrHGyH.js} +1 -1
- package/dist/assets/{start-Be-aPrp4.js → start-DCN0_Fob.js} +1 -1
- package/dist/assets/{step-actions-CEK8mgUw.js → step-actions-DjXtFHj4.js} +1 -1
- package/dist/assets/{studio-DAsrT0p3.js → studio-DjONt7Ut.js} +1 -1
- package/dist/assets/{switch-control-CdZ7hT3y.js → switch-control-DmU8QSF4.js} +1 -1
- package/dist/assets/{toUpper-B3I7eG1g.js → toUpper-D5PDJ7_3.js} +1 -1
- package/dist/assets/{transfer--Bgmivmp.js → transfer-CZ1khuA-.js} +1 -1
- package/dist/assets/{uniqBy-BA_TMJYf.js → uniqBy-CPwHHBOm.js} +1 -1
- package/dist/assets/{unsubscribe-fhr9EaAr.js → unsubscribe-B_bxr7uP.js} +1 -1
- package/dist/assets/{url-join-JgKEtdA2.js → url-join-Dnsu_5vQ.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-rQZBR8_3.js → use-blocklet-info-for-connect-did-spaces-oRSb2cvE.js} +1 -1
- package/dist/assets/{use-mobile-DCi1_Enm.js → use-mobile-CIUcHXVJ.js} +1 -1
- package/dist/assets/{useAsync-B3RNaSvA.js → useAsync-D4jpP_Cn.js} +1 -1
- package/dist/assets/{useFormControl-oAKl9UVb.js → useFormControl-DhPkOJZO.js} +1 -1
- package/dist/assets/{useLocalStorage-BnVJN1iM.js → useLocalStorage-DLUzHeWb.js} +1 -1
- package/dist/assets/{useSetState-Bw-0RwWQ.js → useSetState-COv8V7Hh.js} +1 -1
- package/dist/assets/{useSlot-Cwz6OM5B.js → useSlot-DGpPHvLx.js} +1 -1
- package/dist/assets/{user-center-BsD4RIvy.js → user-center-foGiOHVN.js} +1 -1
- package/dist/assets/{user-sessions-COQO8nIH.js → user-sessions-Bu6WVoE0.js} +1 -1
- package/dist/assets/{util-CRACQuGi.js → util-DuWlpeLs.js} +1 -1
- package/dist/assets/{wrap-locale-CNoCPP-4.js → wrap-locale-BZGc1oQt.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +18 -18
- package/dist/assets/api-CK31hCQN.js +0 -1
- package/dist/assets/localization-BNU71z-g.js +0 -1
- package/dist/assets/publish-resource-Cdc_Imtz.js +0 -1
- package/dist/assets/session-DFjt4_rn.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__fileDeps=["assets/react-
|
|
2
|
-
import{ao as K0,j as o,aD as re,cE as a0,aG as B,fl as O1,aF as me,aB as Ne,aC as De,T as K,r as R,aK as _e,aH as c0,aI as Be,aJ as Ee,cK as X0,fm as We,X as Se,Y as ke,B as z,l as s1,P as f,$ as Ae,E as U,e as i1,u as le,aM as je,aV as Me,bx as Ge,a1 as Fe,L as de,bG as d0,a as fe,az as se,I as J0,q,Z as ie,dn as Q0,a9 as ge,c as ue,F as Y0,bU as a1,ce as u0,cz as Z0,cI as Te,cJ as p0,bj as e2,cZ as t2,cD as $e,bB as qe,c1 as Ze,f6 as o2,b as ne,bm as l2,dr as r2,ae as h0,bn as n2,ck as s2,aQ as $1,aP as i2,a2 as f0,bk as a2,eX as ye,fn as F1,cQ as c2,ap as d2,ay as u2,al as p2,am as Xe}from"./index-CHSnAsQ1.js";import{d as c1}from"./Add-CG-F3Tpq.js";import{d as h2}from"./AddBox-CCE1buV8.js";import{d as x0}from"./Delete-DJZzf2v3.js";import{d as f2}from"./Error-CzevJZgV.js";import{D as d1}from"./index-DpC9sww1.js";import{T as m0,b as x2}from"./index-0Kwb6jmK.js";import{C as u1}from"./confirm-DcZkK6Pc.js";import{u as Ke}from"./session-DFjt4_rn.js";import{W as q1}from"./did-address-1pTl5ZJp.js";import{B as p1,d as m2}from"./ChevronRight-B1-v0rVj.js";import{S as xe}from"./shorten-label--VZVYLZC.js";import{A as v0}from"./Avatar-BVTgZMZu.js";import{d as v2}from"./Download-CZGyacWn.js";import{d as g2}from"./QuestionMarkCircle-50eq7smQ.js";import{b as b2,c as U1,T as j2}from"./index-B8_eoYBV.js";import{_ as Ce}from"./useSetState-Bw-0RwWQ.js";import{c as h1}from"./index-C82L-zg9.js";import{C as e1,F as t1,S as w2}from"./FormControlLabel-BDYHQJ8F.js";import{A as g0}from"./Alert-cwZghN5o.js";import{p as b0}from"./index-HqFqdQ4r.js";import"./api-CK31hCQN.js";import{i as R2}from"./index-vwRhQ5RS.js";import{d as C2}from"./ExpandMore-Vsh2QVwZ.js";import{d as y2}from"./OpenInNew-DYXjNtnC.js";import{d as z2}from"./DeleteOutline-UAdOMkx7.js";import{d as S2}from"./ArrowDropDown-DpHnrXJX.js";import{f as Ve}from"./format-error-DSoyPyVx.js";import{c as k2,A as j0,u as M2,S as I2}from"./item-D_tapEj7.js";import{B as L2}from"./ButtonGroup-Cf877fOo.js";import{T as ze}from"./TextField-DVioGsc-.js";import{M as f1}from"./InputAdornment-C-wpGP7M.js";import{d as P2}from"./Launch-CahVoyyw.js";import{L as T2}from"./MoreVert-Dd_rZHl1.js";import{a as V2}from"./ListItemText-CbVOTWQ3.js";import{C as N2}from"./click-to-copy-C0t70-Pv.js";import{M as D2}from"./index-knmEO6mr.js";import{r as _2}from"./index-NRVaJz9f.js";import{d as B2}from"./Done-CIjx7jUD.js";import{c as w0,d as R0,b as E2,S as A2,a as H2}from"./Stepper-DJQ-xHUp.js";import{R as O2,a as W1}from"./RadioGroup-DImJzaoP.js";import"./FilterList-Cy1sL14k.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-B_Do5Nt6.js";import"./useFormControl-oAKl9UVb.js";import"./FormGroup-Bk12j31H.js";import"./InputLabel-4YX1ylv6.js";import"./Select-D6CeNImJ.js";import"./LastPage-BfloM2Wq.js";import"./Toolbar-CRxjvb2_.js";import"./index-BaC0Haea.js";import"./redux-DfSDCKtt.js";import"./Search-CxTEsXhT.js";import"./index-DJWtIeK5.js";import"./Link-D9C6v4KL.js";import"./useSlot-Cwz6OM5B.js";import"./jss-plugin-props-sort.esm-D277VpMG.js";const $2=K0(o.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"),F2=["slots","slotProps"],q2=re(a0)(({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:O1(e.palette.grey[200],.12)}:{backgroundColor:O1(e.palette.grey[600],.12)})})),U2=re($2)({width:24,height:16});function W2(e){const{slots:t={},slotProps:l={}}=e,n=me(e,F2),s=e;return o.jsx("li",{children:o.jsx(q2,B({focusRipple:!0},n,{ownerState:s,children:o.jsx(U2,B({as:t.CollapsedIcon,ownerState:s},l.collapsedIcon))}))})}function G2(e){return De("MuiBreadcrumbs",e)}const K2=Ne("MuiBreadcrumbs",["root","ol","li","separator"]),X2=K2,J2=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],Q2=e=>{const{classes:t}=e;return Ee({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},G2,t)},Y2=re(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${X2.li}`]:t.li},t.root]})({}),Z2=re("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),et=re("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function tt(e,t,l,n){return e.reduce((s,a,c)=>(c<e.length-1?s=s.concat(a,o.jsx(et,{"aria-hidden":!0,className:t,ownerState:n,children:l},`separator-${c}`)):s.push(a),s),[])}const ot=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiBreadcrumbs"}),{children:s,className:a,component:c="nav",slots:d={},slotProps:u={},expandText:h="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=n,i=me(n,J2),[m,w]=R.useState(!1),v=B({},n,{component:c,expanded:m,expandText:h,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=Q2(v),S=c0({elementType:d.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),V=R.useRef(null),T=k=>{const O=()=>{w(!0);const D=V.current.querySelector("a[href],button,[tabindex]");D&&D.focus()};return g+x>=k.length?k:[...k.slice(0,g),o.jsx(W2,{"aria-label":h,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:O},"ellipsis"),...k.slice(k.length-x,k.length)]},I=R.Children.toArray(s).filter(k=>R.isValidElement(k)).map((k,O)=>o.jsx("li",{className:C.li,children:k},`child-${O}`));return o.jsx(Y2,B({ref:l,component:c,color:"text.secondary",className:Be(C.root,a),ownerState:v},i,{children:o.jsx(Z2,{className:C.ol,ref:V,ownerState:v,children:tt(m||y&&I.length<=y?I:T(I),C.separator,p,v)})}))}),C0=ot;function lt(e){return De("MuiStepButton",e)}const rt=Ne("MuiStepButton",["root","horizontal","vertical","touchRipple"]),G1=rt,nt=["children","className","icon","optional"],st=e=>{const{classes:t,orientation:l}=e;return Ee({root:["root",l],touchRipple:["touchRipple"]},lt,t)},it=re(a0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${G1.touchRipple}`]:t.touchRipple},t.root,t[l.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"},{[`& .${G1.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),at=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiStepButton"}),{children:s,className:a,icon:c,optional:d}=n,u=me(n,nt),{disabled:h,active:x}=R.useContext(w0),{orientation:g}=R.useContext(R0),y=B({},n,{orientation:g}),p=st(y),i={icon:c,optional:d},m=X0(s,["StepLabel"])?R.cloneElement(s,i):o.jsx(E2,B({},i,{children:s}));return o.jsx(it,B({focusRipple:!0,disabled:h,TouchRippleProps:{className:p.touchRipple},className:Be(p.root,a),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),ct=at;function dt(e){return De("MuiStepContent",e)}Ne("MuiStepContent",["root","last","transition"]);const ut=["children","className","TransitionComponent","transitionDuration","TransitionProps"],pt=e=>{const{classes:t,last:l}=e;return Ee({root:["root",l&&"last"],transition:["transition"]},dt,t)},ht=re("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.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"})),ft=re(We,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),xt=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiStepContent"}),{children:s,className:a,TransitionComponent:c=We,transitionDuration:d="auto",TransitionProps:u}=n,h=me(n,ut);R.useContext(R0);const{active:x,last:g,expanded:y}=R.useContext(w0),p=B({},n,{last:g}),i=pt(p);let m=d;return d==="auto"&&!c.muiSupportAuto&&(m=void 0),o.jsx(ht,B({className:Be(i.root,a),ref:l,ownerState:p},h,{children:o.jsx(ft,B({as:c,in:x||y,className:i.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:s}))}))}),mt=xt;var x1={},vt=ke;Object.defineProperty(x1,"__esModule",{value:!0});var y0=x1.default=void 0,gt=vt(Se()),bt=o;y0=x1.default=(0,gt.default)((0,bt.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 m1={},jt=ke;Object.defineProperty(m1,"__esModule",{value:!0});var z0=m1.default=void 0,wt=jt(Se()),Rt=o;z0=m1.default=(0,wt.default)((0,Rt.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 we({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(s1,{size:e})})}we.propTypes={size:f.number};we.defaultProps={size:24};function v1({did:e,projectId:t,title:l,logo:n,describe:s}){const c=`${`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${n}`,[d,u]=R.useState(!1),h=Ae(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(v0,{sx:{borderRadius:1},src:c}),o.jsxs(z,{children:[o.jsx(xe,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:h?"primary.main":""},children:l||"/"}),o.jsx(xe,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:h||d?"primary.main":"grey.700"},children:s||"/"})]})]})}v1.propTypes={projectId:f.string.isRequired,did:f.string.isRequired,title:f.string.isRequired,logo:f.string.isRequired,describe:f.string.isRequired};function g1({initUrl:e}){const t=i1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:n,locale:s}=le(),{api:a}=je(),{api:c}=Ke(),[d,u]=R.useState(!0),{blocklet:h}=Me(),[x,g]=R.useState(null),[y,p]=R.useState(!1),i=Ae(M=>M.breakpoints.down("xl")),{componentDid:m=""}=Ge(),[w,v]=R.useState(null),C=()=>{a.getProjects({input:{did:h.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const L=(M==null?void 0:M.projects)||[];u(!1),v(L)}).catch(M=>{u(!1),q.error(M.message)})},S=()=>{t(`${U.UNOWNED_DID}/create/none`,{replace:!0})},V=M=>{g(M)},T=()=>{u(!1),p(!0)},I=()=>{p(!1),g(null)},k=M=>{q.error(M.message),p(!1),g(null)},O=M=>{if(!(M!=null&&M.deleted)){q.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!w&&d)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(we,{})});if(!w)return null;if(!w.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),o.jsx(Fe,{onClick:S,variant:"contained",children:n("blocklet.publish.createBlocklet")})]});const D=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const L=w[M];return o.jsx(de,{to:`${L.id}`,children:o.jsx(v1,{did:h.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(m0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(q1,{size:14,compact:!0,responsive:!1,did:M}):null}},i||m?null:{label:n("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},i||m?null:{label:n("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const L=(h.children||[]).find(E=>E.meta.did===M);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(p1,{size:14,blocklet:L,ancestors:[h]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},M):""}}},i||l?null:{label:n("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(xe,{children:M})})}},{label:n("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(d0,{value:Number(M),locale:s})}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const L=w[M];return o.jsxs(z,{display:"flex",children:[o.jsx(de,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(fe,{title:n("blocklet.publish.createRelease"),placement:"top",children:o.jsx(se,{color:"primary","aria-label":"create",children:o.jsx(h2,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(fe,{title:n("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(se,{color:"secondary","aria-label":"create",children:o.jsx(de,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(y0,{sx:{fontSize:18}})})})}),o.jsx(fe,{title:n("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(se,{color:"primary","aria-label":"delete",onClick:()=>V(L),children:o.jsx(x0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),P=y?o.jsx(J0,{open:!0,popup:!0,onClose:I,action:"check-has-project-id",locale:s,checkFn:c.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:O,onError:k,extraParams:{projectId:x.id,did:h.meta.did,name:x.blockletTitle},messages:{title:n("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:n("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:n("blocklet.publish.deleteProject.confirm"),success:n("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Ct,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("common.blockletStudio")}),o.jsx(fe,{title:n("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(z0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Fe,{onClick:S,variant:"contained",children:[o.jsx(c1,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(d1,{className:"main-table",locale:s,data:w,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(u1,{title:`${n("common.delete")} ${x.blockletTitle}`,description:n("blocklet.publish.deleteProject.description"),confirm:n("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[n("blocklet.publish.deleteProject.tip1"),n("blocklet.publish.deleteProject.tip2"),n("blocklet.publish.deleteProject.tip3")].map(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(f2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(K,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),P]})}g1.propTypes={initUrl:f.object};g1.defaultProps={initUrl:null};const Ct=ie(z)`
|
|
1
|
+
const __vite__fileDeps=["assets/react-DhoomF4D.js","assets/index-CL2MuWgy.js","assets/index-CCovGSMB.css","assets/index-PxS9yNQw.js","assets/preact.module-B1z5cdvs.js","assets/index-OyvKdcXL.js","assets/index-BJrPsPDp.js","assets/toUpper-D5PDJ7_3.js","assets/index-C9lrp93a.js","assets/fallback-rmTIFQSJ.js","assets/index-7WP5qycS.js","assets/Toolbar-BPW2rPOy.js","assets/Hidden-B3_ybJ-q.js","assets/MoreHoriz-CcbBublh.js","assets/ExpandMore-B8-mtsJf.js","assets/index-hKKO_ETj.js","assets/MoreVert-CB4vQPic.js","assets/selector-BNNdkkFG.js","assets/Avatar-B857twI0.js","assets/useSlot-DGpPHvLx.js","assets/resource-dialog-D9_0yRlW.js","assets/use-mobile-CIUcHXVJ.js","assets/OpenInNew-BqTIjahQ.js","assets/CloseOutlined-Xl6vJm1S.js","assets/index-DVbPOY8J.js","assets/index-CsVY8MSI.js","assets/index-Cj6tOOrI.js","assets/FormControlLabel-BZ-Na1Px.js","assets/useFormControl-DhPkOJZO.js","assets/index-BBng4lwc.js","assets/FilterList-Du3mVkNU.js","assets/toPropertyKey-hKuLU48H.js","assets/FormControl-DrLoqvI1.js","assets/FormGroup-B_cYMk58.js","assets/InputLabel-ys_ApPlk.js","assets/ListItemText-CK7nMTkm.js","assets/Select-C_8EtoAI.js","assets/TextField-COPeEWpZ.js","assets/LastPage-BlouWXDK.js","assets/index-Cp_x9pQ7.js","assets/redux-vempXYa0.js","assets/Search-6e7HNczH.js","assets/Delete-k49MPvRz.js","assets/url-join-Dnsu_5vQ.js","assets/uniqBy-CPwHHBOm.js","assets/react-BW7E7-P9.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
|
+
import{ao as K0,j as o,aD as re,cE as a0,aG as E,fl as O1,aF as me,aB as Ne,aC as De,T as K,r as R,aK as _e,aH as c0,aI as Be,aJ as Ee,cK as X0,fm as We,X as Se,Y as ke,B as z,l as s1,P as f,$ as Ae,E as U,e as i1,u as le,aM as je,aV as Me,bx as Ge,a1 as Fe,L as de,bG as d0,a as fe,az as se,I as J0,q,Z as ie,dn as Q0,a9 as ge,c as ue,F as Y0,bU as a1,ce as u0,cz as Z0,cI as Te,cJ as p0,bj as e2,cZ as t2,cD as $e,bB as qe,c1 as Ze,f6 as o2,b as ne,bm as l2,dr as r2,ae as h0,bn as n2,ck as s2,aQ as $1,aP as i2,a2 as f0,bk as a2,eX as ye,fn as F1,cQ as c2,ap as d2,ay as u2,al as p2,am as Xe}from"./index-CL2MuWgy.js";import{d as c1}from"./Add-Brs6l0hU.js";import{d as h2}from"./AddBox-BorsWH1L.js";import{d as x0}from"./Delete-k49MPvRz.js";import{d as f2}from"./Error-DVFEbqrz.js";import{D as d1}from"./index-BBng4lwc.js";import{T as m0,b as x2}from"./index-Bdg3eQL4.js";import{C as u1}from"./confirm-BnMV0-HV.js";import{u as Ke}from"./session-CkWtK0_2.js";import{W as q1}from"./did-address-B8N2tjFV.js";import{B as p1,d as m2}from"./ChevronRight-p9uIbU8Z.js";import{S as xe}from"./shorten-label-HQwCiW2q.js";import{A as v0}from"./Avatar-B857twI0.js";import{d as v2}from"./Download-B2JnXf0Y.js";import{d as g2}from"./QuestionMarkCircle-iO2RyeuL.js";import{b as b2,c as U1,T as j2}from"./index-DVbPOY8J.js";import{_ as Ce}from"./useSetState-COv8V7Hh.js";import{c as h1}from"./index-BJrPsPDp.js";import{C as e1,F as t1,S as w2}from"./FormControlLabel-BZ-Na1Px.js";import{A as g0}from"./Alert-CdrO9wp_.js";import{p as b0}from"./index-HqFqdQ4r.js";import"./api-DQ0CtWLc.js";import{i as R2}from"./index-DH5UmDxM.js";import{d as C2}from"./ExpandMore-B8-mtsJf.js";import{d as y2}from"./OpenInNew-BqTIjahQ.js";import{d as z2}from"./DeleteOutline-QSrwg0EI.js";import{d as S2}from"./ArrowDropDown-Cc7ZV2yN.js";import{f as Ve}from"./format-error-Bl69lCj-.js";import{c as k2,A as j0,u as M2,S as I2}from"./item-Dq2QNfn5.js";import{B as L2}from"./ButtonGroup-CNCUbNBn.js";import{T as ze}from"./TextField-COPeEWpZ.js";import{M as f1}from"./InputAdornment-Dmqc2UlU.js";import{d as P2}from"./Launch-BT1RubZl.js";import{L as T2}from"./MoreVert-CB4vQPic.js";import{a as V2}from"./ListItemText-CK7nMTkm.js";import{C as N2}from"./click-to-copy-BFYwGrB_.js";import{M as D2}from"./index-DDeCtOVE.js";import{r as _2}from"./index-DdYRNkRT.js";import{d as B2}from"./Done-D_Xh37ry.js";import{c as w0,d as R0,b as E2,S as A2,a as H2}from"./Stepper-CC1pyQEm.js";import{R as O2,a as W1}from"./RadioGroup-BN2d11MQ.js";import"./FilterList-Du3mVkNU.js";import"./toPropertyKey-hKuLU48H.js";import"./FormControl-DrLoqvI1.js";import"./useFormControl-DhPkOJZO.js";import"./FormGroup-B_cYMk58.js";import"./InputLabel-ys_ApPlk.js";import"./Select-C_8EtoAI.js";import"./LastPage-BlouWXDK.js";import"./Toolbar-BPW2rPOy.js";import"./index-Cp_x9pQ7.js";import"./redux-vempXYa0.js";import"./Search-6e7HNczH.js";import"./index-CsVY8MSI.js";import"./Link-ltWIbLQC.js";import"./useSlot-DGpPHvLx.js";import"./jss-plugin-props-sort.esm-DzavEauW.js";const $2=K0(o.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"),F2=["slots","slotProps"],q2=re(a0)(({theme:e})=>E({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":E({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":E({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:O1(e.palette.grey[200],.12)}:{backgroundColor:O1(e.palette.grey[600],.12)})})),U2=re($2)({width:24,height:16});function W2(e){const{slots:t={},slotProps:l={}}=e,n=me(e,F2),s=e;return o.jsx("li",{children:o.jsx(q2,E({focusRipple:!0},n,{ownerState:s,children:o.jsx(U2,E({as:t.CollapsedIcon,ownerState:s},l.collapsedIcon))}))})}function G2(e){return De("MuiBreadcrumbs",e)}const K2=Ne("MuiBreadcrumbs",["root","ol","li","separator"]),X2=K2,J2=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],Q2=e=>{const{classes:t}=e;return Ee({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},G2,t)},Y2=re(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${X2.li}`]:t.li},t.root]})({}),Z2=re("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),et=re("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function tt(e,t,l,n){return e.reduce((s,a,c)=>(c<e.length-1?s=s.concat(a,o.jsx(et,{"aria-hidden":!0,className:t,ownerState:n,children:l},`separator-${c}`)):s.push(a),s),[])}const ot=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiBreadcrumbs"}),{children:s,className:a,component:c="nav",slots:d={},slotProps:u={},expandText:h="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=n,i=me(n,J2),[m,w]=R.useState(!1),v=E({},n,{component:c,expanded:m,expandText:h,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=Q2(v),S=c0({elementType:d.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),V=R.useRef(null),T=k=>{const $=()=>{w(!0);const D=V.current.querySelector("a[href],button,[tabindex]");D&&D.focus()};return g+x>=k.length?k:[...k.slice(0,g),o.jsx(W2,{"aria-label":h,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:$},"ellipsis"),...k.slice(k.length-x,k.length)]},I=R.Children.toArray(s).filter(k=>R.isValidElement(k)).map((k,$)=>o.jsx("li",{className:C.li,children:k},`child-${$}`));return o.jsx(Y2,E({ref:l,component:c,color:"text.secondary",className:Be(C.root,a),ownerState:v},i,{children:o.jsx(Z2,{className:C.ol,ref:V,ownerState:v,children:tt(m||y&&I.length<=y?I:T(I),C.separator,p,v)})}))}),C0=ot;function lt(e){return De("MuiStepButton",e)}const rt=Ne("MuiStepButton",["root","horizontal","vertical","touchRipple"]),G1=rt,nt=["children","className","icon","optional"],st=e=>{const{classes:t,orientation:l}=e;return Ee({root:["root",l],touchRipple:["touchRipple"]},lt,t)},it=re(a0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${G1.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>E({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${G1.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),at=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiStepButton"}),{children:s,className:a,icon:c,optional:d}=n,u=me(n,nt),{disabled:h,active:x}=R.useContext(w0),{orientation:g}=R.useContext(R0),y=E({},n,{orientation:g}),p=st(y),i={icon:c,optional:d},m=X0(s,["StepLabel"])?R.cloneElement(s,i):o.jsx(E2,E({},i,{children:s}));return o.jsx(it,E({focusRipple:!0,disabled:h,TouchRippleProps:{className:p.touchRipple},className:Be(p.root,a),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))}),ct=at;function dt(e){return De("MuiStepContent",e)}Ne("MuiStepContent",["root","last","transition"]);const ut=["children","className","TransitionComponent","transitionDuration","TransitionProps"],pt=e=>{const{classes:t,last:l}=e;return Ee({root:["root",l&&"last"],transition:["transition"]},dt,t)},ht=re("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>E({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"})),ft=re(We,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),xt=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiStepContent"}),{children:s,className:a,TransitionComponent:c=We,transitionDuration:d="auto",TransitionProps:u}=n,h=me(n,ut);R.useContext(R0);const{active:x,last:g,expanded:y}=R.useContext(w0),p=E({},n,{last:g}),i=pt(p);let m=d;return d==="auto"&&!c.muiSupportAuto&&(m=void 0),o.jsx(ht,E({className:Be(i.root,a),ref:l,ownerState:p},h,{children:o.jsx(ft,E({as:c,in:x||y,className:i.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:s}))}))}),mt=xt;var x1={},vt=ke;Object.defineProperty(x1,"__esModule",{value:!0});var y0=x1.default=void 0,gt=vt(Se()),bt=o;y0=x1.default=(0,gt.default)((0,bt.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 m1={},jt=ke;Object.defineProperty(m1,"__esModule",{value:!0});var z0=m1.default=void 0,wt=jt(Se()),Rt=o;z0=m1.default=(0,wt.default)((0,Rt.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 we({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(s1,{size:e})})}we.propTypes={size:f.number};we.defaultProps={size:24};function v1({did:e,projectId:t,title:l,logo:n,describe:s}){const c=`${`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${n}`,[d,u]=R.useState(!1),h=Ae(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(v0,{sx:{borderRadius:1},src:c}),o.jsxs(z,{children:[o.jsx(xe,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:h?"primary.main":""},children:l||"/"}),o.jsx(xe,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:h||d?"primary.main":"grey.700"},children:s||"/"})]})]})}v1.propTypes={projectId:f.string.isRequired,did:f.string.isRequired,title:f.string.isRequired,logo:f.string.isRequired,describe:f.string.isRequired};function g1({initUrl:e}){const t=i1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:n,locale:s}=le(),{api:a}=je(),{api:c}=Ke(),[d,u]=R.useState(!0),{blocklet:h}=Me(),[x,g]=R.useState(null),[y,p]=R.useState(!1),i=Ae(M=>M.breakpoints.down("xl")),{componentDid:m=""}=Ge(),[w,v]=R.useState(null),C=()=>{a.getProjects({input:{did:h.meta.did,componentDid:m,tenantScope:l}}).then(M=>{const L=(M==null?void 0:M.projects)||[];u(!1),v(L)}).catch(M=>{u(!1),q.error(M.message)})},S=()=>{t(`${U.UNOWNED_DID}/create/none`,{replace:!0})},V=M=>{g(M)},T=()=>{u(!1),p(!0)},I=()=>{p(!1),g(null)},k=M=>{q.error(M.message),p(!1),g(null)},$=M=>{if(!(M!=null&&M.deleted)){q.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!w&&d)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(we,{})});if(!w)return null;if(!w.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),o.jsx(Fe,{onClick:S,variant:"contained",children:n("blocklet.publish.createBlocklet")})]});const D=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:M=>{const L=w[M];return o.jsx(de,{to:`${L.id}`,children:o.jsx(v1,{did:h.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:M=>M?o.jsx(m0,{type:"success",children:M}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:M=>M?o.jsx(q1,{size:14,compact:!0,responsive:!1,did:M}):null}},i||m?null:{label:n("common.createdBy"),name:"createdBy",options:{customBodyRender:M=>M?o.jsx(q1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${M}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:M}):null}},i||m?null:{label:n("common.scope"),name:"componentDid",options:{customBodyRender:M=>{const L=(h.children||[]).find(A=>A.meta.did===M);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(p1,{size:14,blocklet:L,ancestors:[h]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},M):""}}},i||l?null:{label:n("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:M=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(xe,{children:M})})}},{label:n("common.updatedAt"),name:"updatedAt",options:{customBodyRender:M=>o.jsx(d0,{value:Number(M),locale:s})}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:M=>{const L=w[M];return o.jsxs(z,{display:"flex",children:[o.jsx(de,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(fe,{title:n("blocklet.publish.createRelease"),placement:"top",children:o.jsx(se,{color:"primary","aria-label":"create",children:o.jsx(h2,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(fe,{title:n("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(se,{color:"secondary","aria-label":"create",children:o.jsx(de,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(y0,{sx:{fontSize:18}})})})}),o.jsx(fe,{title:n("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(se,{color:"primary","aria-label":"delete",onClick:()=>V(L),children:o.jsx(x0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),P=y?o.jsx(J0,{open:!0,popup:!0,onClose:I,action:"check-has-project-id",locale:s,checkFn:c.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:$,onError:k,extraParams:{projectId:x.id,did:h.meta.did,name:x.blockletTitle},messages:{title:n("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:n("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:n("blocklet.publish.deleteProject.confirm"),success:n("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Ct,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("common.blockletStudio")}),o.jsx(fe,{title:n("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(z0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(Fe,{onClick:S,variant:"contained",children:[o.jsx(c1,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(d1,{className:"main-table",locale:s,data:w,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(u1,{title:`${n("common.delete")} ${x.blockletTitle}`,description:n("blocklet.publish.deleteProject.description"),confirm:n("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[n("blocklet.publish.deleteProject.tip1"),n("blocklet.publish.deleteProject.tip2"),n("blocklet.publish.deleteProject.tip3")].map(M=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(f2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(K,{component:"span",variant:"inherit",color:"text.secondary",children:M})]}))})}),P]})}g1.propTypes={initUrl:f.object};g1.defaultProps={initUrl:null};const Ct=ie(z)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
6
|
-
`;var b1={},yt=ke;Object.defineProperty(b1,"__esModule",{value:!0});var S0=b1.default=void 0,zt=yt(Se()),K1=o;S0=b1.default=(0,zt.default)([(0,K1.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,K1.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");function St(){var T;const{t:e,locale:t}=le(),{projectId:l}=Ge(),{api:n}=je(),[s,a]=R.useState(!0),{blocklet:c}=Me(),d=Ae(I=>I.breakpoints.down("md")),[u,h]=R.useState(null),[x,g]=R.useState(null),[y,p]=R.useState(null),i=(T=window.env)==null?void 0:T.serverEndpoint,m=()=>{n.getReleases({input:{did:c.meta.did,projectId:l}}).then(I=>{const k=(I==null?void 0:I.releases)||[];a(!1),h(k)}).catch(I=>{a(!1),q.error(I.message)})},w=()=>{n.doBatchQuery({getProject:{input:{did:c.meta.did,projectId:l}},getReleases:{input:{did:c.meta.did,projectId:l}}}).then(I=>{g(I.getProject.project||{}),h(I.getReleases.releases||[]),a(!1)}).catch(I=>{a(!1),q.error(I.message)})};R.useEffect(()=>{w()},[]);const v=()=>{a(!1);const I=y.id;n.deleteRelease({input:{did:c.meta.did,projectId:l,releaseId:I}}).then(()=>{a(!1),m(),q.success(e("common.removeSuccess")),p(null)}).catch(k=>{a(!1),q.error(k.message)})},C=I=>{p(I)};if(!u&&s)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(we,{})});if(!u)return null;const S=o.jsxs(C0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(de,{to:"..",children:e("common.blockletStudio")}),o.jsx(K,{color:"text.primary",children:o.jsx(xe,{maxLength:d?6:30,children:x.blockletTitle})})]});if(!u.length)return o.jsxs(o.Fragment,{children:[S,o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),o.jsx(de,{to:"create/none",children:o.jsx(Fe,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const V=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:I=>{const k=u[I];return o.jsx(de,{to:`view/${k.id}`,children:o.jsx(v1,{did:c.meta.did,projectId:x.id,logo:k.blockletLogo,title:k.blockletVersion,describe:k.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:I=>{const k=u[I];return o.jsx(K,{className:"note",children:k.note||""})}}},{label:e("common.status"),name:"status",options:{customBodyRender:I=>o.jsx(m0,{type:I==="published"?"success":"warning",children:I==="published"?"Released":Q0(I)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:I=>{const k=u[I];return k.status!==ge.PROJECT.RELEASE_STATUS.published?"":o.jsx(d0,{value:Number(k.updatedAt),locale:t})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:I=>{var L;const k=u[I];let
|
|
6
|
+
`;var b1={},yt=ke;Object.defineProperty(b1,"__esModule",{value:!0});var S0=b1.default=void 0,zt=yt(Se()),K1=o;S0=b1.default=(0,zt.default)([(0,K1.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,K1.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");function St(){var T;const{t:e,locale:t}=le(),{projectId:l}=Ge(),{api:n}=je(),[s,a]=R.useState(!0),{blocklet:c}=Me(),d=Ae(I=>I.breakpoints.down("md")),[u,h]=R.useState(null),[x,g]=R.useState(null),[y,p]=R.useState(null),i=(T=window.env)==null?void 0:T.serverEndpoint,m=()=>{n.getReleases({input:{did:c.meta.did,projectId:l}}).then(I=>{const k=(I==null?void 0:I.releases)||[];a(!1),h(k)}).catch(I=>{a(!1),q.error(I.message)})},w=()=>{n.doBatchQuery({getProject:{input:{did:c.meta.did,projectId:l}},getReleases:{input:{did:c.meta.did,projectId:l}}}).then(I=>{g(I.getProject.project||{}),h(I.getReleases.releases||[]),a(!1)}).catch(I=>{a(!1),q.error(I.message)})};R.useEffect(()=>{w()},[]);const v=()=>{a(!1);const I=y.id;n.deleteRelease({input:{did:c.meta.did,projectId:l,releaseId:I}}).then(()=>{a(!1),m(),q.success(e("common.removeSuccess")),p(null)}).catch(k=>{a(!1),q.error(k.message)})},C=I=>{p(I)};if(!u&&s)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(we,{})});if(!u)return null;const S=o.jsxs(C0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(de,{to:"..",children:e("common.blockletStudio")}),o.jsx(K,{color:"text.primary",children:o.jsx(xe,{maxLength:d?6:30,children:x.blockletTitle})})]});if(!u.length)return o.jsxs(o.Fragment,{children:[S,o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.releaseEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createReleaseTip")}),o.jsx(de,{to:"create/none",children:o.jsx(Fe,{variant:"contained",children:e("blocklet.publish.createRelease")})})]})]});const V=[{label:e("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:I=>{const k=u[I];return o.jsx(de,{to:`view/${k.id}`,children:o.jsx(v1,{did:c.meta.did,projectId:x.id,logo:k.blockletLogo,title:k.blockletVersion,describe:k.blockletTitle})})}}},{label:e("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:I=>{const k=u[I];return o.jsx(K,{className:"note",children:k.note||""})}}},{label:e("common.status"),name:"status",options:{customBodyRender:I=>o.jsx(m0,{type:I==="published"?"success":"warning",children:I==="published"?"Released":Q0(I)})}},{label:e("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:I=>{const k=u[I];return k.status!==ge.PROJECT.RELEASE_STATUS.published?"":o.jsx(d0,{value:Number(k.updatedAt),locale:t})}}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:I=>{var L;const k=u[I];let $="",D="";const P=k.status==="published";if(P){const A=ue(i,`/api/project/${c.meta.did}/${x.id}/${x.lastReleaseId}/release/blocklet.json`),H=new URL(i);H.pathname=ue(H.pathname,"/launch-blocklet/agreement"),H.searchParams.set("blocklet_meta_url",A),$=H.href,D=ue(`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${c.meta.did}/${x.id}/${x.lastReleaseId}/download/${(x.lastReleaseFiles||[])[0]}`)}const M=(L=x.blockletComponents)!=null&&L.some(A=>A.included)||k.uploadedResource?"pack":"resource";return o.jsxs(z,{display:"flex",alignItems:"center",children:[P&&M==="pack"&&o.jsx(fe,{title:e("blocklet.publish.install",{name:x.blockletTitle}),placement:"top",children:o.jsx(se,{color:"secondary","aria-label":"create",children:o.jsx("a",{style:{display:"flex"},href:$,target:"_blank",rel:"noreferrer",children:o.jsx(S0,{sx:{fontSize:18}})})})}),P&&o.jsx(fe,{title:e("blocklet.publish.download",{name:x.blockletTitle}),placement:"top",children:o.jsx(se,{color:"primary","aria-label":"download",children:o.jsx("a",{style:{display:"flex"},href:D,children:o.jsx(v2,{sx:{fontSize:18}})})})}),o.jsx(fe,{title:e("blocklet.publish.delete",{name:x.blockletTitle}),placement:"top",children:o.jsx(se,{color:"primary","aria-label":"delete",onClick:()=>C(k),children:o.jsx(x0,{sx:{fontSize:18}})})})]})}}}];return o.jsxs(kt,{children:[o.jsxs(z,{className:"header",children:[S,o.jsx(de,{to:"new-release/none",children:o.jsxs(Fe,{variant:"contained",children:[o.jsx(c1,{style:{fontSize:"1.3em",marginRight:4}}),e("blocklet.publish.createRelease")]})})]}),o.jsx(d1,{className:"main-table",verticalKeyWidth:100,locale:t,data:u,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),y&&o.jsx(u1,{title:e(`${e("common.delete")} ${y.blockletVersion}`),description:e("blocklet.publish.deleteReleaseTip"),confirm:e("common.confirm"),onConfirm:v,onCancel:()=>p(null)})]})}const kt=ie(z)`
|
|
7
7
|
.header {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
@@ -43,7 +43,7 @@ import{ao as K0,j as o,aD as re,cE as a0,aG as B,fl as O1,aF as me,aB as Ne,aC a
|
|
|
43
43
|
display: none;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`;function Fo(e){return De("MuiTreeView",e)}Ne("MuiTreeView",["root"]);const M0={instance:null,multiSelect:!1,disabledItemsFocusable:!1,treeId:void 0,icons:{defaultCollapseIcon:null,defaultExpandIcon:null,defaultParentIcon:null,defaultEndIcon:null}},I0=R.createContext(M0),qo=(e,t)=>{const l=R.useRef({}),[n,s]=R.useState(()=>{const c={};return e.forEach(d=>{d.models&&Object.entries(d.models).forEach(([u,h])=>{l.current[u]={controlledProp:h.controlledProp,defaultProp:h.defaultProp,isControlled:t[h.controlledProp]!==void 0},c[u]=t[h.defaultProp]})}),c});return Object.fromEntries(Object.entries(l.current).map(([c,d])=>{const u=d.isControlled?t[d.controlledProp]:n[c];return[c,{value:u,setValue:h=>{d.isControlled||s(x=>B({},x,{[c]:h}))}}]}))};class Uo{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,l,n={}){let s=this.events[t];s||(s={highPriority:new Map,regular:new Map},this.events[t]=s),n.isFirst?s.highPriority.set(l,!0):s.regular.set(l,!0)}removeListener(t,l){this.events[t]&&(this.events[t].regular.delete(l),this.events[t].highPriority.delete(l))}removeAllListeners(){this.events={}}emit(t,...l){const n=this.events[t];if(!n)return;const s=Array.from(n.highPriority.keys()),a=Array.from(n.regular.keys());for(let c=s.length-1;c>=0;c-=1){const d=s[c];n.highPriority.has(d)&&d.apply(this,l)}for(let c=0;c<a.length;c+=1){const d=a[c];n.regular.has(d)&&d.apply(this,l)}}once(t,l){const n=this;this.on(t,function s(...a){n.removeListener(t,s),l.apply(n,a)})}}const Je=(e,t)=>{const l=e.getNode(t),n=e.getNavigableChildrenIds(l.parentId),s=n.indexOf(t);if(s===0)return l.parentId;let a=n[s-1];for(;e.isNodeExpanded(a)&&e.getNavigableChildrenIds(a).length>0;)a=e.getNavigableChildrenIds(a).pop();return a},Pe=(e,t)=>{if(e.isNodeExpanded(t)&&e.getNavigableChildrenIds(t).length>0)return e.getNavigableChildrenIds(t)[0];let l=e.getNode(t);for(;l!=null;){const n=e.getNavigableChildrenIds(l.parentId),s=n[n.indexOf(l.id)+1];if(s)return s;l=e.getNode(l.parentId)}return null},o1=e=>{let t=e.getNavigableChildrenIds(null).pop();for(;e.isNodeExpanded(t);)t=e.getNavigableChildrenIds(t).pop();return t},l1=e=>e.getNavigableChildrenIds(null)[0],Ie=(e,t)=>{Object.assign(e,t)},Wo=e=>e.isPropagationStopped!==void 0,Go=({instance:e})=>{const[t]=R.useState(()=>new Uo),l=R.useCallback((...s)=>{const[a,c,d={}]=s;d.defaultMuiPrevented=!1,!(Wo(d)&&d.isPropagationStopped())&&t.emit(a,c,d)},[t]),n=R.useCallback((s,a)=>(t.on(s,a),()=>{t.removeListener(s,a)}),[t]);Ie(e,{$$publishEvent:l,$$subscribeEvent:n})},Ko=[Go],Xo=e=>{const t=[...Ko,...e.plugins],l=t.reduce((i,m)=>m.getDefaultizedParams?m.getDefaultizedParams(i):i,e),n=qo(t,l),a=R.useRef({}).current,c=R.useRef(null),d=u0(c,e.rootRef),[u,h]=R.useState(()=>{const i={};return t.forEach(m=>{m.getInitialState&&Object.assign(i,m.getInitialState(l))}),i}),x=[];let g=M0;const y=i=>{const m=i({instance:a,params:l,state:u,setState:h,rootRef:c,models:n})||{};m.getRootProps&&x.push(m.getRootProps),m.contextValue&&(g=m.contextValue)};return t.forEach(y),{getRootProps:(i={})=>{const m=B({role:"tree",tabIndex:0},i,{ref:d});return x.forEach(w=>{Object.assign(m,w(i))}),m},rootRef:d,contextValue:g}},Jo=["element"];function Qo(e,t){for(let l=0;l<e.length;l+=1)if(t(e[l]))return l;return-1}function Yo(e,t){let l=0,n=e.length-1;for(;l<=n;){const s=Math.floor((l+n)/2);if(e[s].element===t)return s;e[s].element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?n=s-1:l=s+1}return l}const L0=R.createContext({});function Zo(e){const t=R.useRef(null);return R.useEffect(()=>{t.current=e},[e]),t.current}const J1=()=>{};function el(e){const[,t]=R.useState(),{registerDescendant:l=J1,unregisterDescendant:n=J1,descendants:s=[],parentId:a=null}=R.useContext(L0),c=Qo(s,h=>h.element===e.element),d=Zo(s),u=s.some((h,x)=>d&&d[x]&&d[x].element!==h.element);return Z0(()=>{if(e.element)return l(B({},e,{index:c})),()=>{n(e.element)};t({})},[l,n,c,u,e]),{parentId:a,index:c}}function P0(e){const{children:t,id:l}=e,[n,s]=R.useState([]),a=R.useCallback(u=>{let{element:h}=u,x=me(u,Jo);s(g=>{if(g.length===0)return[B({},x,{element:h,index:0})];const y=Yo(g,h);let p;if(g[y]&&g[y].element===h)p=g;else{const i=B({},x,{element:h,index:y});p=g.slice(),p.splice(y,0,i)}return p.forEach((i,m)=>{i.index=m}),p})},[]),c=R.useCallback(u=>{s(h=>h.filter(x=>u!==x.element))},[]),d=R.useMemo(()=>({descendants:n,registerDescendant:a,unregisterDescendant:c,parentId:l}),[n,a,c,l]);return o.jsx(L0.Provider,{value:d,children:t})}function tl(e){const{value:t,children:l}=e;return o.jsx(I0.Provider,{value:t,children:o.jsx(P0,{children:l})})}const ol=(e,t,l)=>{e.$$publishEvent(t,l)},ll=({instance:e,params:t})=>{const l=R.useRef({}),n=R.useCallback(h=>l.current[h],[]),s=R.useCallback(h=>{l.current[h.id]=h},[]),a=R.useCallback(h=>{const x=B({},l.current);delete x[h],l.current=x,ol(e,"removeNode",{id:h})},[e]),c=R.useCallback(h=>{if(h==null)return!1;let x=e.getNode(h);if(!x)return!1;if(x.disabled)return!0;for(;x.parentId!=null;)if(x=e.getNode(x.parentId),x.disabled)return!0;return!1},[e]),d=Te(h=>Object.values(l.current).filter(x=>x.parentId===h).sort((x,g)=>x.index-g.index).map(x=>x.id));Ie(e,{getNode:n,updateNode:s,removeNode:a,getChildrenIds:d,getNavigableChildrenIds:h=>{let x=e.getChildrenIds(h);return t.disabledItemsFocusable||(x=x.filter(g=>!e.isNodeDisabled(g))),x},isNodeDisabled:c})},R1=({instance:e,params:t,models:l})=>{const n=R.useCallback(d=>Array.isArray(l.expanded.value)?l.expanded.value.indexOf(d)!==-1:!1,[l.expanded.value]),s=R.useCallback(d=>{var u;return!!((u=e.getNode(d))!=null&&u.expandable)},[e]),a=Te((d,u)=>{if(u==null)return;let h;l.expanded.value.indexOf(u)!==-1?h=l.expanded.value.filter(x=>x!==u):h=[u].concat(l.expanded.value),t.onNodeToggle&&t.onNodeToggle(d,h),l.expanded.setValue(h)});Ie(e,{isNodeExpanded:n,isNodeExpandable:s,toggleNodeExpansion:a,expandAllSiblings:(d,u)=>{const h=e.getNode(u),g=e.getChildrenIds(h.parentId).filter(p=>e.isNodeExpandable(p)&&!e.isNodeExpanded(p)),y=l.expanded.value.concat(g);g.length>0&&(l.expanded.setValue(y),t.onNodeToggle&&t.onNodeToggle(d,y))}})};R1.models={expanded:{controlledProp:"expanded",defaultProp:"defaultExpanded"}};const rl=[];R1.getDefaultizedParams=e=>{var t;return B({},e,{defaultExpanded:(t=e.defaultExpanded)!=null?t:rl})};const nl=(e,t,l)=>{if(t===l)return[t,l];const n=e.getNode(t),s=e.getNode(l);if(n.parentId===s.id||s.parentId===n.id)return s.parentId===n.id?[n.id,s.id]:[s.id,n.id];const a=[n.id],c=[s.id];let d=n.parentId,u=s.parentId,h=c.indexOf(d)!==-1,x=a.indexOf(u)!==-1,g=!0,y=!0;for(;!x&&!h;)g&&(a.push(d),h=c.indexOf(d)!==-1,g=d!==null,!h&&g&&(d=e.getNode(d).parentId)),y&&!h&&(c.push(u),x=a.indexOf(u)!==-1,y=u!==null,!x&&y&&(u=e.getNode(u).parentId));const p=h?d:u,i=e.getChildrenIds(p),m=a[a.indexOf(p)-1],w=c[c.indexOf(p)-1];return i.indexOf(m)<i.indexOf(w)?[t,l]:[l,t]},C1=({instance:e,params:t,models:l})=>{const n=R.useRef(null),s=R.useRef(!1),a=R.useRef([]),c=i=>Array.isArray(l.selected.value)?l.selected.value.indexOf(i)!==-1:l.selected.value===i,d=(i,m,w=!1)=>{if(!t.disableSelection){if(w){if(Array.isArray(l.selected.value)){let v;l.selected.value.indexOf(m)!==-1?v=l.selected.value.filter(C=>C!==m):v=[m].concat(l.selected.value),t.onNodeSelect&&t.onNodeSelect(i,v),l.selected.setValue(v)}}else{const v=t.multiSelect?[m]:m;t.onNodeSelect&&t.onNodeSelect(i,v),l.selected.setValue(v)}n.current=m,s.current=!1,a.current=[]}},u=(i,m)=>{const[w,v]=nl(e,i,m),C=[w];let S=w;for(;S!==v;)S=Pe(e,S),C.push(S);return C},h=(i,m)=>{let w=l.selected.value.slice();const{start:v,next:C,current:S}=m;!C||!S||(a.current.indexOf(S)===-1&&(a.current=[]),s.current?a.current.indexOf(C)!==-1?(w=w.filter(V=>V===v||V!==S),a.current=a.current.filter(V=>V===v||V!==S)):(w.push(C),a.current.push(C)):(w.push(C),a.current.push(S,C)),t.onNodeSelect&&t.onNodeSelect(i,w),l.selected.setValue(w))},x=(i,m)=>{let w=l.selected.value.slice();const{start:v,end:C}=m;s.current&&(w=w.filter(T=>a.current.indexOf(T)===-1));let S=u(v,C);S=S.filter(T=>!e.isNodeDisabled(T)),a.current=S;let V=w.concat(S);V=V.filter((T,I)=>V.indexOf(T)===I),t.onNodeSelect&&t.onNodeSelect(i,V),l.selected.setValue(V)};return Ie(e,{isNodeSelected:c,selectNode:d,selectRange:(i,m,w=!1)=>{if(t.disableSelection)return;const{start:v=n.current,end:C,current:S}=m;w?h(i,{start:v,next:C,current:S}):v!=null&&C!=null&&x(i,{start:v,end:C}),s.current=!0},rangeSelectToLast:(i,m)=>{n.current||(n.current=m);const w=s.current?n.current:m;e.selectRange(i,{start:w,end:o1(e)})},rangeSelectToFirst:(i,m)=>{n.current||(n.current=m);const w=s.current?n.current:m;e.selectRange(i,{start:w,end:l1(e)})}}),{getRootProps:()=>({"aria-multiselectable":t.multiSelect})}};C1.models={selected:{controlledProp:"selected",defaultProp:"defaultSelected"}};const sl=[];C1.getDefaultizedParams=e=>{var t,l,n;return B({},e,{disableSelection:(t=e.disableSelection)!=null?t:!1,multiSelect:(l=e.multiSelect)!=null?l:!1,defaultSelected:(n=e.defaultSelected)!=null?n:e.multiSelect?sl:null})};const Q1=1e3;class il{constructor(t=Q1){this.timeouts=new Map,this.cleanupTimeout=Q1,this.cleanupTimeout=t}register(t,l,n){this.timeouts||(this.timeouts=new Map);const s=setTimeout(()=>{typeof l=="function"&&l(),this.timeouts.delete(n.cleanupToken)},this.cleanupTimeout);this.timeouts.set(n.cleanupToken,s)}unregister(t){const l=this.timeouts.get(t.cleanupToken);l&&(this.timeouts.delete(t.cleanupToken),clearTimeout(l))}reset(){this.timeouts&&(this.timeouts.forEach((t,l)=>{this.unregister({cleanupToken:l})}),this.timeouts=void 0)}}class al{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,l,n){this.registry.register(t,l,n)}unregister(t){this.registry.unregister(t)}reset(){}}class cl{}function dl(e){let t=0;return function(n,s,a){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new al:new il);const[c]=R.useState(new cl),d=R.useRef(null),u=R.useRef();u.current=a;const h=R.useRef(null);if(!d.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};d.current=n.$$subscribeEvent(s,x),t+=1,h.current={cleanupToken:t},e.registry.register(c,()=>{var g;(g=d.current)==null||g.call(d),d.current=null,h.current=null},h.current)}else!u.current&&d.current&&(d.current(),d.current=null,h.current&&(e.registry.unregister(h.current),h.current=null));R.useEffect(()=>{if(!d.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};d.current=n.$$subscribeEvent(s,x)}return h.current&&e.registry&&(e.registry.unregister(h.current),h.current=null),()=>{var x;(x=d.current)==null||x.call(d),d.current=null}},[n,s])}}const ul={registry:null},pl=dl(ul),y1=({instance:e,params:t,state:l,setState:n,models:s,rootRef:a})=>{const c=Te(p=>{const i=typeof p=="function"?p(l.focusedNodeId):p;n(m=>B({},m,{focusedNodeId:i}))}),d=R.useCallback(p=>l.focusedNodeId===p,[l.focusedNodeId]),u=Te((p,i)=>{i&&(c(i),t.onNodeFocus&&t.onNodeFocus(p,i))});Ie(e,{isNodeFocused:d,focusNode:u}),pl(e,"removeNode",({id:p})=>{c(i=>i===p&&a.current===p0(a.current).activeElement?e.getChildrenIds(null)[0]:i)});const h=p=>i=>{var m;if((m=p.onFocus)==null||m.call(p,i),i.target===i.currentTarget){const w=C=>{const S=e.getNode(C);return S&&(S.parentId==null||e.isNodeExpanded(S.parentId))};let v;Array.isArray(s.selected.value)?v=s.selected.value.find(w):s.selected.value!=null&&w(s.selected.value)&&(v=s.selected.value),v==null&&(v=e.getNavigableChildrenIds(null)[0]),e.focusNode(i,v)}},x=p=>i=>{var m;(m=p.onBlur)==null||m.call(p,i),c(null)},g=e.getNode(l.focusedNodeId),y=g?g.idAttribute:null;return{getRootProps:p=>({onFocus:h(p),onBlur:x(p),"aria-activedescendant":y??void 0})}};y1.getInitialState=()=>({focusedNodeId:null});y1.getDefaultizedParams=e=>{var t;return B({},e,{disabledItemsFocusable:(t=e.disabledItemsFocusable)!=null?t:!1})};function hl(e){return e&&e.length===1&&e.match(/\S/)}function Y1(e,t,l){for(let n=t;n<e.length;n+=1)if(l===e[n])return n;return-1}const fl=({instance:e,params:t,state:l})=>{const s=e2().direction==="rtl",a=R.useRef({}),c=Te((p,i)=>(a.current[p]=i,()=>{const m=B({},a.current);delete m[p],a.current=m}));Ie(e,{mapFirstChar:c});const d=p=>(l.focusedNodeId!=null&&e.isNodeExpandable(l.focusedNodeId)&&(e.isNodeExpanded(l.focusedNodeId)?e.focusNode(p,Pe(e,l.focusedNodeId)):e.isNodeDisabled(l.focusedNodeId)||e.toggleNodeExpansion(p,l.focusedNodeId)),!0),u=p=>{if(l.focusedNodeId==null)return!1;if(e.isNodeExpanded(l.focusedNodeId)&&!e.isNodeDisabled(l.focusedNodeId))return e.toggleNodeExpansion(p,l.focusedNodeId),!0;const i=e.getNode(l.focusedNodeId).parentId;return i?(e.focusNode(p,i),!0):!1},h=(p,i,m)=>{let w,v;const C=m.toLowerCase(),S=[],V=[];Object.keys(a.current).forEach(T=>{const I=e.getNode(T),k=I.parentId?e.isNodeExpanded(I.parentId):!0,O=t.disabledItemsFocusable?!1:e.isNodeDisabled(T);k&&!O&&(S.push(T),V.push(a.current[T]))}),w=S.indexOf(i)+1,w>=S.length&&(w=0),v=Y1(V,w,C),v===-1&&(v=Y1(V,0,C)),v>-1&&e.focusNode(p,S[v])},x=(p,i)=>{e.isNodeDisabled(Pe(e,i))||e.selectRange(p,{end:Pe(e,i),current:i},!0)},g=(p,i)=>{e.isNodeDisabled(Je(e,i))||e.selectRange(p,{end:Je(e,i),current:i},!0)},y=p=>i=>{var m;(m=p.onKeyDown)==null||m.call(p,i);let w=!1;const v=i.key;if(i.altKey||i.currentTarget!==i.target||l.focusedNodeId==null)return;const C=i.ctrlKey||i.metaKey;switch(v){case" ":!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&(w=!0,t.multiSelect&&i.shiftKey?e.selectRange(i,{end:l.focusedNodeId}):t.multiSelect?e.selectNode(i,l.focusedNodeId,!0):e.selectNode(i,l.focusedNodeId)),i.stopPropagation();break;case"Enter":e.isNodeDisabled(l.focusedNodeId)||(e.isNodeExpandable(l.focusedNodeId)?(e.toggleNodeExpansion(i,l.focusedNodeId),w=!0):t.disableSelection||(w=!0,t.multiSelect?e.selectNode(i,l.focusedNodeId,!0):e.selectNode(i,l.focusedNodeId))),i.stopPropagation();break;case"ArrowDown":t.multiSelect&&i.shiftKey&&!t.disableSelection&&x(i,l.focusedNodeId),e.focusNode(i,Pe(e,l.focusedNodeId)),w=!0;break;case"ArrowUp":t.multiSelect&&i.shiftKey&&!t.disableSelection&&g(i,l.focusedNodeId),e.focusNode(i,Je(e,l.focusedNodeId)),w=!0;break;case"ArrowRight":s?w=u(i):w=d(i);break;case"ArrowLeft":s?w=d(i):w=u(i);break;case"Home":t.multiSelect&&C&&i.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToFirst(i,l.focusedNodeId),e.focusNode(i,l1(e)),w=!0;break;case"End":t.multiSelect&&C&&i.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToLast(i,l.focusedNodeId),e.focusNode(i,o1(e)),w=!0;break;default:v==="*"?(e.expandAllSiblings(i,l.focusedNodeId),w=!0):t.multiSelect&&C&&v.toLowerCase()==="a"&&!t.disableSelection?(e.selectRange(i,{start:l1(e),end:o1(e)}),w=!0):!C&&!i.shiftKey&&hl(v)&&(h(i,l.focusedNodeId,v),w=!0)}w&&(i.preventDefault(),i.stopPropagation())};return{getRootProps:p=>({onKeyDown:y(p)})}},xl=({instance:e,params:t})=>{const l=t2(t.id);return{getRootProps:()=>({id:l}),contextValue:{treeId:l,instance:e,multiSelect:t.multiSelect,disabledItemsFocusable:t.disabledItemsFocusable,icons:{defaultCollapseIcon:t.defaultCollapseIcon,defaultEndIcon:t.defaultEndIcon,defaultExpandIcon:t.defaultExpandIcon,defaultParentIcon:t.defaultParentIcon}}}},ml=[ll,R1,C1,y1,fl,xl],vl=["disabledItemsFocusable","expanded","defaultExpanded","onNodeToggle","onNodeFocus","disableSelection","defaultSelected","selected","multiSelect","onNodeSelect","id","defaultCollapseIcon","defaultEndIcon","defaultExpandIcon","defaultParentIcon","children"],gl=e=>{const{classes:t}=e;return Ee({root:["root"]},Fo,t)},Z1=re("ul",{name:"MuiTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0}),bl=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiTreeView"}),s=n,a=n,{disabledItemsFocusable:c,expanded:d,defaultExpanded:u,onNodeToggle:h,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:i,onNodeSelect:m,id:w,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:V,children:T}=a,I=me(a,vl),{getRootProps:k,contextValue:O}=Xo({disabledItemsFocusable:c,expanded:d,defaultExpanded:u,onNodeToggle:h,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:i,onNodeSelect:m,id:w,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:V,plugins:ml,rootRef:l}),D=gl(n),P=c0({elementType:Z1,externalSlotProps:{},externalForwardedProps:I,className:D.root,getSlotProps:k,ownerState:s});return o.jsx(tl,{value:O,children:o.jsx(Z1,B({},P,{children:T}))})}),T0=()=>R.useContext(I0);function jl(e){const{instance:t,multiSelect:l}=T0(),n=t?t.isNodeExpandable(e):!1,s=t?t.isNodeExpanded(e):!1,a=t?t.isNodeFocused(e):!1,c=t?t.isNodeSelected(e):!1,d=t?t.isNodeDisabled(e):!1;return{disabled:d,expanded:s,selected:c,focused:a,handleExpansion:g=>{if(t&&!d){a||t.focusNode(g,e);const y=l&&(g.shiftKey||g.ctrlKey||g.metaKey);n&&!(y&&t.isNodeExpanded(e))&&t.toggleNodeExpansion(g,e)}},handleSelection:g=>{t&&!d&&(a||t.focusNode(g,e),l&&(g.shiftKey||g.ctrlKey||g.metaKey)?g.shiftKey?t.selectRange(g,{end:e}):t.selectNode(g,e,!0):t.selectNode(g,e))},preventSelection:g=>{(g.shiftKey||g.ctrlKey||g.metaKey||d)&&g.preventDefault()}}}const wl=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"],V0=R.forwardRef(function(t,l){const{classes:n,className:s,displayIcon:a,expansionIcon:c,icon:d,label:u,nodeId:h,onClick:x,onMouseDown:g}=t,y=me(t,wl),{disabled:p,expanded:i,selected:m,focused:w,handleExpansion:v,handleSelection:C,preventSelection:S}=jl(h),V=d||c||a,T=k=>{S(k),g&&g(k)},I=k=>{v(k),C(k),x&&x(k)};return o.jsxs("div",B({},y,{className:Be(s,n.root,i&&n.expanded,m&&n.selected,w&&n.focused,p&&n.disabled),onClick:I,onMouseDown:T,ref:l,children:[o.jsx("div",{className:n.iconContainer,children:V}),o.jsx("div",{className:n.label,children:u})]}))});function Rl(e){return De("MuiTreeItem",e)}const he=Ne("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]),Cl=["children","className","collapseIcon","ContentComponent","ContentProps","endIcon","expandIcon","disabled","icon","id","label","nodeId","onClick","onMouseDown","TransitionComponent","TransitionProps"],yl=e=>{const{classes:t}=e;return Ee({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],group:["group"]},Rl,t)},zl=re("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Sl=re(V0,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${he.iconContainer}`]:t.iconContainer},t.label&&{[`& .${he.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"}},[`&.${he.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${he.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${he.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:$e(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}))`:$e(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})`:$e(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${he.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:$e(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${he.iconContainer}`]:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${he.label}`]:B({paddingLeft:4,width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1)})),kl=re(We,{name:"MuiTreeItem",slot:"Group",overridesResolver:(e,t)=>t.group})({margin:0,padding:0,marginLeft:17}),Ml=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiTreeItem"}),{children:s,className:a,collapseIcon:c,ContentComponent:d=V0,ContentProps:u,endIcon:h,expandIcon:x,disabled:g,icon:y,id:p,label:i,nodeId:m,onClick:w,onMouseDown:v,TransitionComponent:C=We,TransitionProps:S}=n,V=me(n,Cl),{icons:T,multiSelect:I,disabledItemsFocusable:k,treeId:O,instance:D}=T0();let P;p!=null?P=p:O&&m&&(P=`${O}-${m}`);const[M,L]=R.useState(null),E=R.useRef(null),A=u0(L,l),$=R.useMemo(()=>({element:M,id:m}),[m,M]),{index:X,parentId:J}=el($),W=!!(Array.isArray(s)?s.length:s),te=D?D.isNodeExpanded(m):!1,pe=D?D.isNodeFocused(m):!1,G=D?D.isNodeSelected(m):!1,Y=D?D.isNodeDisabled(m):!1,F=B({},n,{expanded:te,focused:pe,selected:G,disabled:Y}),oe=yl(F);let ae,Z;W&&(te?Z=c||T.defaultCollapseIcon:Z=x||T.defaultExpandIcon),W?ae=T.defaultParentIcon:ae=h||T.defaultEndIcon,R.useEffect(()=>{if(D&&X!==-1)return D.updateNode({id:m,idAttribute:P,index:X,parentId:J,expandable:W,disabled:g}),()=>D.removeNode(m)},[D,J,X,m,W,g,P]),R.useEffect(()=>{if(D&&i){var H,ee;return D.mapFirstChar(m,((H=(ee=E.current)==null?void 0:ee.textContent)!=null?H:"").substring(0,1).toLowerCase())}},[D,m,i]);let ce;I?ce=G:G&&(ce=!0);function _(H){if(H.target===H.currentTarget){let Le;typeof H.target.getRootNode=="function"?Le=H.target.getRootNode():Le=p0(H.target),Le.getElementById(O).focus({preventScroll:!0})}const ee=!k&&Y;D&&!pe&&H.currentTarget===H.target&&!ee&&D.focusNode(H,m)}return o.jsxs(zl,B({className:Be(oe.root,a),role:"treeitem","aria-expanded":W?te:void 0,"aria-selected":ce,"aria-disabled":Y||void 0,id:P,tabIndex:-1},V,{ownerState:F,onFocus:_,ref:A,children:[o.jsx(Sl,B({as:d,ref:E,classes:{root:oe.content,expanded:oe.expanded,selected:oe.selected,focused:oe.focused,disabled:oe.disabled,iconContainer:oe.iconContainer,label:oe.label},label:i,nodeId:m,onClick:w,onMouseDown:v,icon:y,expansionIcon:Z,displayIcon:ae,ownerState:F},u)),s&&o.jsx(P0,{id:m,children:o.jsx(kl,B({as:C,unmountOnExit:!0,className:oe.group,in:te,component:"ul",role:"group"},S,{children:s}))})]}))});function z1({data:e,...t}){return!e||!e.length?null:o.jsx(Il,{...t,children:e.map(l=>o.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",children:o.jsx("img",{src:l.url,alt:l.alt||""})},l.url))})}z1.propTypes={data:f.arrayOf(f.shape({url:f.string,alt:f.string}))};z1.defaultProps={data:[]};const Il=ie(z)`
|
|
46
|
+
`;function Fo(e){return De("MuiTreeView",e)}Ne("MuiTreeView",["root"]);const M0={instance:null,multiSelect:!1,disabledItemsFocusable:!1,treeId:void 0,icons:{defaultCollapseIcon:null,defaultExpandIcon:null,defaultParentIcon:null,defaultEndIcon:null}},I0=R.createContext(M0),qo=(e,t)=>{const l=R.useRef({}),[n,s]=R.useState(()=>{const c={};return e.forEach(d=>{d.models&&Object.entries(d.models).forEach(([u,h])=>{l.current[u]={controlledProp:h.controlledProp,defaultProp:h.defaultProp,isControlled:t[h.controlledProp]!==void 0},c[u]=t[h.defaultProp]})}),c});return Object.fromEntries(Object.entries(l.current).map(([c,d])=>{const u=d.isControlled?t[d.controlledProp]:n[c];return[c,{value:u,setValue:h=>{d.isControlled||s(x=>E({},x,{[c]:h}))}}]}))};class Uo{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,l,n={}){let s=this.events[t];s||(s={highPriority:new Map,regular:new Map},this.events[t]=s),n.isFirst?s.highPriority.set(l,!0):s.regular.set(l,!0)}removeListener(t,l){this.events[t]&&(this.events[t].regular.delete(l),this.events[t].highPriority.delete(l))}removeAllListeners(){this.events={}}emit(t,...l){const n=this.events[t];if(!n)return;const s=Array.from(n.highPriority.keys()),a=Array.from(n.regular.keys());for(let c=s.length-1;c>=0;c-=1){const d=s[c];n.highPriority.has(d)&&d.apply(this,l)}for(let c=0;c<a.length;c+=1){const d=a[c];n.regular.has(d)&&d.apply(this,l)}}once(t,l){const n=this;this.on(t,function s(...a){n.removeListener(t,s),l.apply(n,a)})}}const Je=(e,t)=>{const l=e.getNode(t),n=e.getNavigableChildrenIds(l.parentId),s=n.indexOf(t);if(s===0)return l.parentId;let a=n[s-1];for(;e.isNodeExpanded(a)&&e.getNavigableChildrenIds(a).length>0;)a=e.getNavigableChildrenIds(a).pop();return a},Pe=(e,t)=>{if(e.isNodeExpanded(t)&&e.getNavigableChildrenIds(t).length>0)return e.getNavigableChildrenIds(t)[0];let l=e.getNode(t);for(;l!=null;){const n=e.getNavigableChildrenIds(l.parentId),s=n[n.indexOf(l.id)+1];if(s)return s;l=e.getNode(l.parentId)}return null},o1=e=>{let t=e.getNavigableChildrenIds(null).pop();for(;e.isNodeExpanded(t);)t=e.getNavigableChildrenIds(t).pop();return t},l1=e=>e.getNavigableChildrenIds(null)[0],Ie=(e,t)=>{Object.assign(e,t)},Wo=e=>e.isPropagationStopped!==void 0,Go=({instance:e})=>{const[t]=R.useState(()=>new Uo),l=R.useCallback((...s)=>{const[a,c,d={}]=s;d.defaultMuiPrevented=!1,!(Wo(d)&&d.isPropagationStopped())&&t.emit(a,c,d)},[t]),n=R.useCallback((s,a)=>(t.on(s,a),()=>{t.removeListener(s,a)}),[t]);Ie(e,{$$publishEvent:l,$$subscribeEvent:n})},Ko=[Go],Xo=e=>{const t=[...Ko,...e.plugins],l=t.reduce((i,m)=>m.getDefaultizedParams?m.getDefaultizedParams(i):i,e),n=qo(t,l),a=R.useRef({}).current,c=R.useRef(null),d=u0(c,e.rootRef),[u,h]=R.useState(()=>{const i={};return t.forEach(m=>{m.getInitialState&&Object.assign(i,m.getInitialState(l))}),i}),x=[];let g=M0;const y=i=>{const m=i({instance:a,params:l,state:u,setState:h,rootRef:c,models:n})||{};m.getRootProps&&x.push(m.getRootProps),m.contextValue&&(g=m.contextValue)};return t.forEach(y),{getRootProps:(i={})=>{const m=E({role:"tree",tabIndex:0},i,{ref:d});return x.forEach(w=>{Object.assign(m,w(i))}),m},rootRef:d,contextValue:g}},Jo=["element"];function Qo(e,t){for(let l=0;l<e.length;l+=1)if(t(e[l]))return l;return-1}function Yo(e,t){let l=0,n=e.length-1;for(;l<=n;){const s=Math.floor((l+n)/2);if(e[s].element===t)return s;e[s].element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?n=s-1:l=s+1}return l}const L0=R.createContext({});function Zo(e){const t=R.useRef(null);return R.useEffect(()=>{t.current=e},[e]),t.current}const J1=()=>{};function el(e){const[,t]=R.useState(),{registerDescendant:l=J1,unregisterDescendant:n=J1,descendants:s=[],parentId:a=null}=R.useContext(L0),c=Qo(s,h=>h.element===e.element),d=Zo(s),u=s.some((h,x)=>d&&d[x]&&d[x].element!==h.element);return Z0(()=>{if(e.element)return l(E({},e,{index:c})),()=>{n(e.element)};t({})},[l,n,c,u,e]),{parentId:a,index:c}}function P0(e){const{children:t,id:l}=e,[n,s]=R.useState([]),a=R.useCallback(u=>{let{element:h}=u,x=me(u,Jo);s(g=>{if(g.length===0)return[E({},x,{element:h,index:0})];const y=Yo(g,h);let p;if(g[y]&&g[y].element===h)p=g;else{const i=E({},x,{element:h,index:y});p=g.slice(),p.splice(y,0,i)}return p.forEach((i,m)=>{i.index=m}),p})},[]),c=R.useCallback(u=>{s(h=>h.filter(x=>u!==x.element))},[]),d=R.useMemo(()=>({descendants:n,registerDescendant:a,unregisterDescendant:c,parentId:l}),[n,a,c,l]);return o.jsx(L0.Provider,{value:d,children:t})}function tl(e){const{value:t,children:l}=e;return o.jsx(I0.Provider,{value:t,children:o.jsx(P0,{children:l})})}const ol=(e,t,l)=>{e.$$publishEvent(t,l)},ll=({instance:e,params:t})=>{const l=R.useRef({}),n=R.useCallback(h=>l.current[h],[]),s=R.useCallback(h=>{l.current[h.id]=h},[]),a=R.useCallback(h=>{const x=E({},l.current);delete x[h],l.current=x,ol(e,"removeNode",{id:h})},[e]),c=R.useCallback(h=>{if(h==null)return!1;let x=e.getNode(h);if(!x)return!1;if(x.disabled)return!0;for(;x.parentId!=null;)if(x=e.getNode(x.parentId),x.disabled)return!0;return!1},[e]),d=Te(h=>Object.values(l.current).filter(x=>x.parentId===h).sort((x,g)=>x.index-g.index).map(x=>x.id));Ie(e,{getNode:n,updateNode:s,removeNode:a,getChildrenIds:d,getNavigableChildrenIds:h=>{let x=e.getChildrenIds(h);return t.disabledItemsFocusable||(x=x.filter(g=>!e.isNodeDisabled(g))),x},isNodeDisabled:c})},R1=({instance:e,params:t,models:l})=>{const n=R.useCallback(d=>Array.isArray(l.expanded.value)?l.expanded.value.indexOf(d)!==-1:!1,[l.expanded.value]),s=R.useCallback(d=>{var u;return!!((u=e.getNode(d))!=null&&u.expandable)},[e]),a=Te((d,u)=>{if(u==null)return;let h;l.expanded.value.indexOf(u)!==-1?h=l.expanded.value.filter(x=>x!==u):h=[u].concat(l.expanded.value),t.onNodeToggle&&t.onNodeToggle(d,h),l.expanded.setValue(h)});Ie(e,{isNodeExpanded:n,isNodeExpandable:s,toggleNodeExpansion:a,expandAllSiblings:(d,u)=>{const h=e.getNode(u),g=e.getChildrenIds(h.parentId).filter(p=>e.isNodeExpandable(p)&&!e.isNodeExpanded(p)),y=l.expanded.value.concat(g);g.length>0&&(l.expanded.setValue(y),t.onNodeToggle&&t.onNodeToggle(d,y))}})};R1.models={expanded:{controlledProp:"expanded",defaultProp:"defaultExpanded"}};const rl=[];R1.getDefaultizedParams=e=>{var t;return E({},e,{defaultExpanded:(t=e.defaultExpanded)!=null?t:rl})};const nl=(e,t,l)=>{if(t===l)return[t,l];const n=e.getNode(t),s=e.getNode(l);if(n.parentId===s.id||s.parentId===n.id)return s.parentId===n.id?[n.id,s.id]:[s.id,n.id];const a=[n.id],c=[s.id];let d=n.parentId,u=s.parentId,h=c.indexOf(d)!==-1,x=a.indexOf(u)!==-1,g=!0,y=!0;for(;!x&&!h;)g&&(a.push(d),h=c.indexOf(d)!==-1,g=d!==null,!h&&g&&(d=e.getNode(d).parentId)),y&&!h&&(c.push(u),x=a.indexOf(u)!==-1,y=u!==null,!x&&y&&(u=e.getNode(u).parentId));const p=h?d:u,i=e.getChildrenIds(p),m=a[a.indexOf(p)-1],w=c[c.indexOf(p)-1];return i.indexOf(m)<i.indexOf(w)?[t,l]:[l,t]},C1=({instance:e,params:t,models:l})=>{const n=R.useRef(null),s=R.useRef(!1),a=R.useRef([]),c=i=>Array.isArray(l.selected.value)?l.selected.value.indexOf(i)!==-1:l.selected.value===i,d=(i,m,w=!1)=>{if(!t.disableSelection){if(w){if(Array.isArray(l.selected.value)){let v;l.selected.value.indexOf(m)!==-1?v=l.selected.value.filter(C=>C!==m):v=[m].concat(l.selected.value),t.onNodeSelect&&t.onNodeSelect(i,v),l.selected.setValue(v)}}else{const v=t.multiSelect?[m]:m;t.onNodeSelect&&t.onNodeSelect(i,v),l.selected.setValue(v)}n.current=m,s.current=!1,a.current=[]}},u=(i,m)=>{const[w,v]=nl(e,i,m),C=[w];let S=w;for(;S!==v;)S=Pe(e,S),C.push(S);return C},h=(i,m)=>{let w=l.selected.value.slice();const{start:v,next:C,current:S}=m;!C||!S||(a.current.indexOf(S)===-1&&(a.current=[]),s.current?a.current.indexOf(C)!==-1?(w=w.filter(V=>V===v||V!==S),a.current=a.current.filter(V=>V===v||V!==S)):(w.push(C),a.current.push(C)):(w.push(C),a.current.push(S,C)),t.onNodeSelect&&t.onNodeSelect(i,w),l.selected.setValue(w))},x=(i,m)=>{let w=l.selected.value.slice();const{start:v,end:C}=m;s.current&&(w=w.filter(T=>a.current.indexOf(T)===-1));let S=u(v,C);S=S.filter(T=>!e.isNodeDisabled(T)),a.current=S;let V=w.concat(S);V=V.filter((T,I)=>V.indexOf(T)===I),t.onNodeSelect&&t.onNodeSelect(i,V),l.selected.setValue(V)};return Ie(e,{isNodeSelected:c,selectNode:d,selectRange:(i,m,w=!1)=>{if(t.disableSelection)return;const{start:v=n.current,end:C,current:S}=m;w?h(i,{start:v,next:C,current:S}):v!=null&&C!=null&&x(i,{start:v,end:C}),s.current=!0},rangeSelectToLast:(i,m)=>{n.current||(n.current=m);const w=s.current?n.current:m;e.selectRange(i,{start:w,end:o1(e)})},rangeSelectToFirst:(i,m)=>{n.current||(n.current=m);const w=s.current?n.current:m;e.selectRange(i,{start:w,end:l1(e)})}}),{getRootProps:()=>({"aria-multiselectable":t.multiSelect})}};C1.models={selected:{controlledProp:"selected",defaultProp:"defaultSelected"}};const sl=[];C1.getDefaultizedParams=e=>{var t,l,n;return E({},e,{disableSelection:(t=e.disableSelection)!=null?t:!1,multiSelect:(l=e.multiSelect)!=null?l:!1,defaultSelected:(n=e.defaultSelected)!=null?n:e.multiSelect?sl:null})};const Q1=1e3;class il{constructor(t=Q1){this.timeouts=new Map,this.cleanupTimeout=Q1,this.cleanupTimeout=t}register(t,l,n){this.timeouts||(this.timeouts=new Map);const s=setTimeout(()=>{typeof l=="function"&&l(),this.timeouts.delete(n.cleanupToken)},this.cleanupTimeout);this.timeouts.set(n.cleanupToken,s)}unregister(t){const l=this.timeouts.get(t.cleanupToken);l&&(this.timeouts.delete(t.cleanupToken),clearTimeout(l))}reset(){this.timeouts&&(this.timeouts.forEach((t,l)=>{this.unregister({cleanupToken:l})}),this.timeouts=void 0)}}class al{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,l,n){this.registry.register(t,l,n)}unregister(t){this.registry.unregister(t)}reset(){}}class cl{}function dl(e){let t=0;return function(n,s,a){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new al:new il);const[c]=R.useState(new cl),d=R.useRef(null),u=R.useRef();u.current=a;const h=R.useRef(null);if(!d.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};d.current=n.$$subscribeEvent(s,x),t+=1,h.current={cleanupToken:t},e.registry.register(c,()=>{var g;(g=d.current)==null||g.call(d),d.current=null,h.current=null},h.current)}else!u.current&&d.current&&(d.current(),d.current=null,h.current&&(e.registry.unregister(h.current),h.current=null));R.useEffect(()=>{if(!d.current&&u.current){const x=(g,y)=>{if(!y.defaultMuiPrevented){var p;(p=u.current)==null||p.call(u,g,y)}};d.current=n.$$subscribeEvent(s,x)}return h.current&&e.registry&&(e.registry.unregister(h.current),h.current=null),()=>{var x;(x=d.current)==null||x.call(d),d.current=null}},[n,s])}}const ul={registry:null},pl=dl(ul),y1=({instance:e,params:t,state:l,setState:n,models:s,rootRef:a})=>{const c=Te(p=>{const i=typeof p=="function"?p(l.focusedNodeId):p;n(m=>E({},m,{focusedNodeId:i}))}),d=R.useCallback(p=>l.focusedNodeId===p,[l.focusedNodeId]),u=Te((p,i)=>{i&&(c(i),t.onNodeFocus&&t.onNodeFocus(p,i))});Ie(e,{isNodeFocused:d,focusNode:u}),pl(e,"removeNode",({id:p})=>{c(i=>i===p&&a.current===p0(a.current).activeElement?e.getChildrenIds(null)[0]:i)});const h=p=>i=>{var m;if((m=p.onFocus)==null||m.call(p,i),i.target===i.currentTarget){const w=C=>{const S=e.getNode(C);return S&&(S.parentId==null||e.isNodeExpanded(S.parentId))};let v;Array.isArray(s.selected.value)?v=s.selected.value.find(w):s.selected.value!=null&&w(s.selected.value)&&(v=s.selected.value),v==null&&(v=e.getNavigableChildrenIds(null)[0]),e.focusNode(i,v)}},x=p=>i=>{var m;(m=p.onBlur)==null||m.call(p,i),c(null)},g=e.getNode(l.focusedNodeId),y=g?g.idAttribute:null;return{getRootProps:p=>({onFocus:h(p),onBlur:x(p),"aria-activedescendant":y??void 0})}};y1.getInitialState=()=>({focusedNodeId:null});y1.getDefaultizedParams=e=>{var t;return E({},e,{disabledItemsFocusable:(t=e.disabledItemsFocusable)!=null?t:!1})};function hl(e){return e&&e.length===1&&e.match(/\S/)}function Y1(e,t,l){for(let n=t;n<e.length;n+=1)if(l===e[n])return n;return-1}const fl=({instance:e,params:t,state:l})=>{const s=e2().direction==="rtl",a=R.useRef({}),c=Te((p,i)=>(a.current[p]=i,()=>{const m=E({},a.current);delete m[p],a.current=m}));Ie(e,{mapFirstChar:c});const d=p=>(l.focusedNodeId!=null&&e.isNodeExpandable(l.focusedNodeId)&&(e.isNodeExpanded(l.focusedNodeId)?e.focusNode(p,Pe(e,l.focusedNodeId)):e.isNodeDisabled(l.focusedNodeId)||e.toggleNodeExpansion(p,l.focusedNodeId)),!0),u=p=>{if(l.focusedNodeId==null)return!1;if(e.isNodeExpanded(l.focusedNodeId)&&!e.isNodeDisabled(l.focusedNodeId))return e.toggleNodeExpansion(p,l.focusedNodeId),!0;const i=e.getNode(l.focusedNodeId).parentId;return i?(e.focusNode(p,i),!0):!1},h=(p,i,m)=>{let w,v;const C=m.toLowerCase(),S=[],V=[];Object.keys(a.current).forEach(T=>{const I=e.getNode(T),k=I.parentId?e.isNodeExpanded(I.parentId):!0,$=t.disabledItemsFocusable?!1:e.isNodeDisabled(T);k&&!$&&(S.push(T),V.push(a.current[T]))}),w=S.indexOf(i)+1,w>=S.length&&(w=0),v=Y1(V,w,C),v===-1&&(v=Y1(V,0,C)),v>-1&&e.focusNode(p,S[v])},x=(p,i)=>{e.isNodeDisabled(Pe(e,i))||e.selectRange(p,{end:Pe(e,i),current:i},!0)},g=(p,i)=>{e.isNodeDisabled(Je(e,i))||e.selectRange(p,{end:Je(e,i),current:i},!0)},y=p=>i=>{var m;(m=p.onKeyDown)==null||m.call(p,i);let w=!1;const v=i.key;if(i.altKey||i.currentTarget!==i.target||l.focusedNodeId==null)return;const C=i.ctrlKey||i.metaKey;switch(v){case" ":!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&(w=!0,t.multiSelect&&i.shiftKey?e.selectRange(i,{end:l.focusedNodeId}):t.multiSelect?e.selectNode(i,l.focusedNodeId,!0):e.selectNode(i,l.focusedNodeId)),i.stopPropagation();break;case"Enter":e.isNodeDisabled(l.focusedNodeId)||(e.isNodeExpandable(l.focusedNodeId)?(e.toggleNodeExpansion(i,l.focusedNodeId),w=!0):t.disableSelection||(w=!0,t.multiSelect?e.selectNode(i,l.focusedNodeId,!0):e.selectNode(i,l.focusedNodeId))),i.stopPropagation();break;case"ArrowDown":t.multiSelect&&i.shiftKey&&!t.disableSelection&&x(i,l.focusedNodeId),e.focusNode(i,Pe(e,l.focusedNodeId)),w=!0;break;case"ArrowUp":t.multiSelect&&i.shiftKey&&!t.disableSelection&&g(i,l.focusedNodeId),e.focusNode(i,Je(e,l.focusedNodeId)),w=!0;break;case"ArrowRight":s?w=u(i):w=d(i);break;case"ArrowLeft":s?w=d(i):w=u(i);break;case"Home":t.multiSelect&&C&&i.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToFirst(i,l.focusedNodeId),e.focusNode(i,l1(e)),w=!0;break;case"End":t.multiSelect&&C&&i.shiftKey&&!t.disableSelection&&!e.isNodeDisabled(l.focusedNodeId)&&e.rangeSelectToLast(i,l.focusedNodeId),e.focusNode(i,o1(e)),w=!0;break;default:v==="*"?(e.expandAllSiblings(i,l.focusedNodeId),w=!0):t.multiSelect&&C&&v.toLowerCase()==="a"&&!t.disableSelection?(e.selectRange(i,{start:l1(e),end:o1(e)}),w=!0):!C&&!i.shiftKey&&hl(v)&&(h(i,l.focusedNodeId,v),w=!0)}w&&(i.preventDefault(),i.stopPropagation())};return{getRootProps:p=>({onKeyDown:y(p)})}},xl=({instance:e,params:t})=>{const l=t2(t.id);return{getRootProps:()=>({id:l}),contextValue:{treeId:l,instance:e,multiSelect:t.multiSelect,disabledItemsFocusable:t.disabledItemsFocusable,icons:{defaultCollapseIcon:t.defaultCollapseIcon,defaultEndIcon:t.defaultEndIcon,defaultExpandIcon:t.defaultExpandIcon,defaultParentIcon:t.defaultParentIcon}}}},ml=[ll,R1,C1,y1,fl,xl],vl=["disabledItemsFocusable","expanded","defaultExpanded","onNodeToggle","onNodeFocus","disableSelection","defaultSelected","selected","multiSelect","onNodeSelect","id","defaultCollapseIcon","defaultEndIcon","defaultExpandIcon","defaultParentIcon","children"],gl=e=>{const{classes:t}=e;return Ee({root:["root"]},Fo,t)},Z1=re("ul",{name:"MuiTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0}),bl=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiTreeView"}),s=n,a=n,{disabledItemsFocusable:c,expanded:d,defaultExpanded:u,onNodeToggle:h,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:i,onNodeSelect:m,id:w,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:V,children:T}=a,I=me(a,vl),{getRootProps:k,contextValue:$}=Xo({disabledItemsFocusable:c,expanded:d,defaultExpanded:u,onNodeToggle:h,onNodeFocus:x,disableSelection:g,defaultSelected:y,selected:p,multiSelect:i,onNodeSelect:m,id:w,defaultCollapseIcon:v,defaultEndIcon:C,defaultExpandIcon:S,defaultParentIcon:V,plugins:ml,rootRef:l}),D=gl(n),P=c0({elementType:Z1,externalSlotProps:{},externalForwardedProps:I,className:D.root,getSlotProps:k,ownerState:s});return o.jsx(tl,{value:$,children:o.jsx(Z1,E({},P,{children:T}))})}),T0=()=>R.useContext(I0);function jl(e){const{instance:t,multiSelect:l}=T0(),n=t?t.isNodeExpandable(e):!1,s=t?t.isNodeExpanded(e):!1,a=t?t.isNodeFocused(e):!1,c=t?t.isNodeSelected(e):!1,d=t?t.isNodeDisabled(e):!1;return{disabled:d,expanded:s,selected:c,focused:a,handleExpansion:g=>{if(t&&!d){a||t.focusNode(g,e);const y=l&&(g.shiftKey||g.ctrlKey||g.metaKey);n&&!(y&&t.isNodeExpanded(e))&&t.toggleNodeExpansion(g,e)}},handleSelection:g=>{t&&!d&&(a||t.focusNode(g,e),l&&(g.shiftKey||g.ctrlKey||g.metaKey)?g.shiftKey?t.selectRange(g,{end:e}):t.selectNode(g,e,!0):t.selectNode(g,e))},preventSelection:g=>{(g.shiftKey||g.ctrlKey||g.metaKey||d)&&g.preventDefault()}}}const wl=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"],V0=R.forwardRef(function(t,l){const{classes:n,className:s,displayIcon:a,expansionIcon:c,icon:d,label:u,nodeId:h,onClick:x,onMouseDown:g}=t,y=me(t,wl),{disabled:p,expanded:i,selected:m,focused:w,handleExpansion:v,handleSelection:C,preventSelection:S}=jl(h),V=d||c||a,T=k=>{S(k),g&&g(k)},I=k=>{v(k),C(k),x&&x(k)};return o.jsxs("div",E({},y,{className:Be(s,n.root,i&&n.expanded,m&&n.selected,w&&n.focused,p&&n.disabled),onClick:I,onMouseDown:T,ref:l,children:[o.jsx("div",{className:n.iconContainer,children:V}),o.jsx("div",{className:n.label,children:u})]}))});function Rl(e){return De("MuiTreeItem",e)}const he=Ne("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]),Cl=["children","className","collapseIcon","ContentComponent","ContentProps","endIcon","expandIcon","disabled","icon","id","label","nodeId","onClick","onMouseDown","TransitionComponent","TransitionProps"],yl=e=>{const{classes:t}=e;return Ee({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],group:["group"]},Rl,t)},zl=re("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Sl=re(V0,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${he.iconContainer}`]:t.iconContainer},t.label&&{[`& .${he.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"}},[`&.${he.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${he.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${he.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:$e(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}))`:$e(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})`:$e(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${he.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:$e(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${he.iconContainer}`]:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${he.label}`]:E({paddingLeft:4,width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1)})),kl=re(We,{name:"MuiTreeItem",slot:"Group",overridesResolver:(e,t)=>t.group})({margin:0,padding:0,marginLeft:17}),Ml=R.forwardRef(function(t,l){const n=_e({props:t,name:"MuiTreeItem"}),{children:s,className:a,collapseIcon:c,ContentComponent:d=V0,ContentProps:u,endIcon:h,expandIcon:x,disabled:g,icon:y,id:p,label:i,nodeId:m,onClick:w,onMouseDown:v,TransitionComponent:C=We,TransitionProps:S}=n,V=me(n,Cl),{icons:T,multiSelect:I,disabledItemsFocusable:k,treeId:$,instance:D}=T0();let P;p!=null?P=p:$&&m&&(P=`${$}-${m}`);const[M,L]=R.useState(null),A=R.useRef(null),H=u0(L,l),B=R.useMemo(()=>({element:M,id:m}),[m,M]),{index:X,parentId:J}=el(B),W=!!(Array.isArray(s)?s.length:s),te=D?D.isNodeExpanded(m):!1,pe=D?D.isNodeFocused(m):!1,G=D?D.isNodeSelected(m):!1,Y=D?D.isNodeDisabled(m):!1,F=E({},n,{expanded:te,focused:pe,selected:G,disabled:Y}),oe=yl(F);let ae,Z;W&&(te?Z=c||T.defaultCollapseIcon:Z=x||T.defaultExpandIcon),W?ae=T.defaultParentIcon:ae=h||T.defaultEndIcon,R.useEffect(()=>{if(D&&X!==-1)return D.updateNode({id:m,idAttribute:P,index:X,parentId:J,expandable:W,disabled:g}),()=>D.removeNode(m)},[D,J,X,m,W,g,P]),R.useEffect(()=>{if(D&&i){var O,ee;return D.mapFirstChar(m,((O=(ee=A.current)==null?void 0:ee.textContent)!=null?O:"").substring(0,1).toLowerCase())}},[D,m,i]);let ce;I?ce=G:G&&(ce=!0);function _(O){if(O.target===O.currentTarget){let Le;typeof O.target.getRootNode=="function"?Le=O.target.getRootNode():Le=p0(O.target),Le.getElementById($).focus({preventScroll:!0})}const ee=!k&&Y;D&&!pe&&O.currentTarget===O.target&&!ee&&D.focusNode(O,m)}return o.jsxs(zl,E({className:Be(oe.root,a),role:"treeitem","aria-expanded":W?te:void 0,"aria-selected":ce,"aria-disabled":Y||void 0,id:P,tabIndex:-1},V,{ownerState:F,onFocus:_,ref:H,children:[o.jsx(Sl,E({as:d,ref:A,classes:{root:oe.content,expanded:oe.expanded,selected:oe.selected,focused:oe.focused,disabled:oe.disabled,iconContainer:oe.iconContainer,label:oe.label},label:i,nodeId:m,onClick:w,onMouseDown:v,icon:y,expansionIcon:Z,displayIcon:ae,ownerState:F},u)),s&&o.jsx(P0,{id:m,children:o.jsx(kl,E({as:C,unmountOnExit:!0,className:oe.group,in:te,component:"ul",role:"group"},S,{children:s}))})]}))});function z1({data:e,...t}){return!e||!e.length?null:o.jsx(Il,{...t,children:e.map(l=>o.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",children:o.jsx("img",{src:l.url,alt:l.alt||""})},l.url))})}z1.propTypes={data:f.arrayOf(f.shape({url:f.string,alt:f.string}))};z1.defaultProps={data:[]};const Il=ie(z)`
|
|
47
47
|
display: flex;
|
|
48
48
|
justify-content: flex-start;
|
|
49
49
|
flex-wrap: wrap;
|
|
@@ -112,7 +112,7 @@ import{ao as K0,j as o,aD as re,cE as a0,aG as B,fl as O1,aF as me,aB as Ne,aC a
|
|
|
112
112
|
font-size: 14px;
|
|
113
113
|
color: ${({theme:e})=>e.palette.text.secondary};
|
|
114
114
|
}
|
|
115
|
-
`;function Pl(e,t){const l=new Set(t||[]),n=[];function s(a){l.has(a==null?void 0:a.id)&&n.push(a==null?void 0:a.id),a!=null&&a.children&&a.children.forEach(s)}return(e||[]).forEach(s),n}const r1=(e,t)=>(e.forEach(l=>{t&&(l.parent=t),(l.children||[]).forEach(n=>{n.parent=l.id,r1(n.children||[],n.id)})}),e),n1=(e,t,l,n,s)=>{const{exportApi:a="/"}=(e==null?void 0:e.meta.resource)||{},c=new URL(ue("http://127.0.0.1",e.mountPoint,a||"/").replace(/\/+/g,"/"));return c.searchParams.set("projectId",t),c.searchParams.set("releaseId",l),c.searchParams.set("local",n),s&&c.searchParams.set("resourcesParams",s.searchParams.get("resourcesParams")),`${c.pathname}${c.search}`},Tl=async({api:e,appDid:t,component:l,projectId:n,releaseId:s,locale:a,initUrl:c,resources:d})=>{await Ze.post(n1(l,n,s,a,c),{resources:d,projectId:n,releaseId:s,locale:a}),await e.updateSelectedResources({input:{did:t,projectId:n,releaseId:s,componentDid:l.meta.did,resources:d}})},Vl=(e,t)=>{if(!e)return{};const l=t.reduce((s,a)=>(s[a]=!0,s),{}),n=(s,a)=>(s.forEach(c=>{var d;l[c.id]&&((d=c.dependentComponents)!=null&&d.length)&&c.dependentComponents.forEach(u=>{a[u]=!0}),c.children&&n(c.children,a)}),a);return n(e,{})};function M1({app:e,component:t,projectId:l,release:n,loading:s,error:a,saveSelectedEventsRef:c,readOnly:d,componentDid:u,initialResources:h={},setResourceComponentsMap:x,selectedResourceIds:g,setSelectedResourceIds:y,initUrl:p}){var D;const{t:i,locale:m}=le(),{api:w}=je(),[v,C]=Ce({}),S=R.useRef({}),V=R.useRef(!1),T=n.id;S.current.projectId=l,S.current.releaseId=T;const I=(P,M,L)=>{if(!M)return;const
|
|
115
|
+
`;function Pl(e,t){const l=new Set(t||[]),n=[];function s(a){l.has(a==null?void 0:a.id)&&n.push(a==null?void 0:a.id),a!=null&&a.children&&a.children.forEach(s)}return(e||[]).forEach(s),n}const r1=(e,t)=>(e.forEach(l=>{t&&(l.parent=t),(l.children||[]).forEach(n=>{n.parent=l.id,r1(n.children||[],n.id)})}),e),n1=(e,t,l,n,s)=>{const{exportApi:a="/"}=(e==null?void 0:e.meta.resource)||{},c=new URL(ue("http://127.0.0.1",e.mountPoint,a||"/").replace(/\/+/g,"/"));return c.searchParams.set("projectId",t),c.searchParams.set("releaseId",l),c.searchParams.set("local",n),s&&c.searchParams.set("resourcesParams",s.searchParams.get("resourcesParams")),`${c.pathname}${c.search}`},Tl=async({api:e,appDid:t,component:l,projectId:n,releaseId:s,locale:a,initUrl:c,resources:d})=>{await Ze.post(n1(l,n,s,a,c),{resources:d,projectId:n,releaseId:s,locale:a}),await e.updateSelectedResources({input:{did:t,projectId:n,releaseId:s,componentDid:l.meta.did,resources:d}})},Vl=(e,t)=>{if(!e)return{};const l=t.reduce((s,a)=>(s[a]=!0,s),{}),n=(s,a)=>(s.forEach(c=>{var d;l[c.id]&&((d=c.dependentComponents)!=null&&d.length)&&c.dependentComponents.forEach(u=>{a[u]=!0}),c.children&&n(c.children,a)}),a);return n(e,{})};function M1({app:e,component:t,projectId:l,release:n,loading:s,error:a,saveSelectedEventsRef:c,readOnly:d,componentDid:u,initialResources:h={},setResourceComponentsMap:x,selectedResourceIds:g,setSelectedResourceIds:y,initUrl:p}){var D;const{t:i,locale:m}=le(),{api:w}=je(),[v,C]=Ce({}),S=R.useRef({}),V=R.useRef(!1),T=n.id;S.current.projectId=l,S.current.releaseId=T;const I=(P,M,L)=>{if(!M)return;const A=Vl(M,L);x==null||x({[P]:Object.keys(A)})},k=P=>{c.current[t.meta.did]={resources:P,component:t},y({[t.meta.did]:P}),I(t.meta.did,v[t.meta.did],P)};R.useEffect(()=>{v[t==null?void 0:t.meta.did]||Ze.get(n1(t,l,T,m,p)).then(P=>{var L;const M=r1(((L=P.data)==null?void 0:L.resources)||[]);C({[t==null?void 0:t.meta.did]:M})}).catch(P=>{q.error(P.message)})},[t,l,n,m,p,C,v,T]),R.useEffect(()=>{T&&l&&!V.current&&b0(e.children.map(P=>async()=>{var M;if(!(u&&u!==P.meta.did)&&!(!(P!=null&&P.mountPoint)||!o2.hasStartEngine(P==null?void 0:P.meta)))try{const L=await Ze.get(n1(P,l,T,m,p)),A=r1(((M=L==null?void 0:L.data)==null?void 0:M.resources)||[]);C({[P==null?void 0:P.meta.did]:A});const H=await w.getSelectedResources({input:{did:e.meta.did,projectId:l,releaseId:T,componentDid:P.meta.did}}),B=(H==null?void 0:H.resources)||[];B!=null&&B.length&&(y({[P.meta.did]:Pl(A,B)}),I(P.meta.did,A,B),d||(c.current[P==null?void 0:P.meta.did]={resources:B,component:P}))}catch(L){q.error(L.message)}}),{concurrency:2}).then(()=>{V.current=!0})},[T,l,d,m,p,C]),R.useEffect(()=>{h&&Object.keys(h).length&&e.children.forEach(P=>{const M=h[P.meta.did];M!=null&&M.length&&(y({[P.meta.did]:M}),d||(c.current[P==null?void 0:P.meta.did]={resources:M,component:P}))})},[e,h,d]);let $=null;return(!t||!((D=v[t.meta.did])!=null&&D.length))&&($=o.jsx(be,{Icon:He,children:i("blocklet.publish.resourceEmptyTip",{name:t.meta.title})})),(t==null?void 0:t.status)!=="running"&&($=o.jsx(be,{children:i("blocklet.publish.componentNotRunning",{name:t.meta.title})})),o.jsxs(o.Fragment,{children:[o.jsx(Nl,{className:h1(a&&"error"),children:o.jsx(z,{pb:2,width:"100%",children:$||o.jsx(k1,{data:v[t.meta.did]||[],value:g[t.meta.did]||[],onChange:k,disabled:s||d})})}),!!a&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:a})]})}M1.propTypes={component:f.object.isRequired,app:f.object.isRequired,projectId:f.string.isRequired,error:f.string,saveSelectedEventsRef:f.object.isRequired,readOnly:f.bool.isRequired,loading:f.bool.isRequired,release:f.shape({id:f.string.isRequired,status:f.string}),initialResources:f.object,initUrl:f.object,setResourceComponentsMap:f.func,componentDid:f.string,selectedResourceIds:f.array.isRequired,setSelectedResourceIds:f.func.isRequired};M1.defaultProps={error:"",release:{id:""},initUrl:null,initialResources:{},setResourceComponentsMap:()=>{},componentDid:""};const Nl=ie(z)`
|
|
116
116
|
border: 1px solid #ccc;
|
|
117
117
|
max-height: 600px;
|
|
118
118
|
width: 100%;
|
|
@@ -133,7 +133,7 @@ import{ao as K0,j as o,aD as re,cE as a0,aG as B,fl as O1,aF as me,aB as Ne,aC a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,N0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:n})=>{var c,d;const s=e?(c=l==null?void 0:l.meta)==null?void 0:c.did:t==null?void 0:t.did;let a=e?((d=l==null?void 0:l.settings)==null?void 0:d.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return a=a.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===n),{teamDid:s,storeList:a}};function I1({blocklet:e,store:t,onChangeStore:l,onClick:n,disabled:s,loading:a,componentDid:c}){var L,E,A;const{t:d}=le(),{session:u}=Ke(),{api:h,info:x,inService:g}=je(),y=Me(),[p,i]=R.useState(!1),m=R.useRef(null),[w,v]=R.useState(!1),[C,S]=R.useState(null),V=$=>{l($),i(!1)},T=()=>{i(!0)},I=$=>{m.current&&m.current.contains($.target)||i(!1)},k=()=>{v(!0)},O=()=>{v(!1)},D=async()=>{var $;if(C)try{await h.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await(($=y==null?void 0:y.actions)==null?void 0:$.refreshBlocklet())}catch(X){q.error(`Remove Blocklet Store Error: ${Ve(X)}`)}finally{S(null)}},{storeList:P}=N0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:c,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),M=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(L2,{disabled:s,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:n,children:[a&&o.jsx(s1,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${(t==null?void 0:t.name)||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(S2,{})})]}),o.jsx(l2,{sx:{zIndex:1},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:$})=>o.jsx(r2,{...$,style:{transformOrigin:"center top"},children:o.jsx(h0,{children:o.jsx(n2,{onClickAway:I,children:o.jsxs(s2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto"},children:[P.map(X=>{var J;return o.jsxs($1,{selected:X.id===t.id,sx:{height:56},onClick:()=>V(X),children:[o.jsxs(z,{children:[o.jsx(xe,{sx:{fontSize:"16px"},maxLength:24,children:X.name}),o.jsx(xe,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:X.url})]}),k2({store:X,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(se,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(X)},children:o.jsx(qe,{icon:"ic:outline-delete"})})]},X.url)}),o.jsx(i2,{}),o.jsxs($1,{onClick:k,children:[o.jsx(c1,{font:!0}),o.jsx(K,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&o.jsx(j0,{hiddenChildren:!0,open:!0,onClose:O,teamDid:M,storeList:P,scope:"studio",onAdd:(A=y==null?void 0:y.actions)==null?void 0:A.refreshBlocklet}),C&&o.jsx(u1,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:D,onCancel:()=>S(null)})]})}I1.propTypes={store:f.object,blocklet:f.object,onChangeStore:f.func.isRequired,onClick:f.func.isRequired,loading:f.bool.isRequired,disabled:f.bool.isRequired,componentDid:f.string.isRequired,projectType:f.string.isRequired,getData:f.func.isRequired};I1.defaultProps={store:null,blocklet:null};async function D0(e,t=1500,l=600,n=5e3){let s=0;await new Promise(c=>setTimeout(c,n));const a=async(c,d)=>{try{const u=await e();c(u)}catch(u){s++,s>=l?d(u):setTimeout(()=>a(c,d),t)}};return new Promise(a)}function Dl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function _l(e,{did:t,projectId:l,messageId:n}){return D0(async()=>{var a;const s=await e.getProject({input:{did:t,projectId:l,messageId:n}});if(!((a=s==null?void 0:s.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid})}function Bl(e,{did:t,projectId:l,storeId:n}){return D0(async()=>{var c,d;const s=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((d=(c=s==null?void 0:s.project)==null?void 0:c.connectedStores)!=null&&d.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(u=>u.storeId===n))throw new Error("Connected store not found")})}const e0="lastWantToConnectStoreId";function El(e){var d,u;const[t,l]=R.useState(null),{session:n}=Ke(),s=R.useCallback(h=>{l(h),localStorage.setItem(e0,h==null?void 0:h.id)},[l]),a=R.useMemo(()=>{var g,y;const h=localStorage.getItem(e0),x=h?(((g=e==null?void 0:e.settings)==null?void 0:g.storeList)||[]).find(p=>p.id===h):null;return x||(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(p=>{var i;return!(p.id!==U.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==((i=n==null?void 0:n.user)==null?void 0:i.did))})},[(d=e==null?void 0:e.settings)==null?void 0:d.storeList,(u=n==null?void 0:n.user)==null?void 0:u.did]);return[t||a,s]}const t0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],o0=1024*1024*10,l0=R.lazy(()=>f0(()=>import("./react-DR-nB82P.js").then(e=>e.r),__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])).then(e=>({default:e.Uploader})));function _0({projectId:e,readOnly:t,loading:l,blocklet:n,params:s,setParams:a,paramsErrTip:c,setParamsErrTip:d,setLoading:u,initUrl:h,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=le(),{api:i}=je(),m=i1(),w=R.useRef(null),v=R.useRef(null),[C,S]=El(n),V=M2({onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),A=await _l(i,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${U.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},I=()=>{if(!s.blockletTitle){q.error(p("blocklet.publish.errorTip.noTitle"));return}if(!C){q.error("No store found");return}const L=Dl();V(async(E,A)=>{var $,X,J;try{const W=await i.connectByStudio({input:{did:($=n==null?void 0:n.meta)==null?void 0:$.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((X=s==null?void 0:s.blockletComponents)==null?void 0:X.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(h==null?void 0:h.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){q.error("failed to connect to store");return}A(W.url),T({did:(J=n==null?void 0:n.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const te=Ve(W);q.error(te),E.document.write(te),u(!1)}})},k=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/logo/upload`,O=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/screenshot/upload`,D=s!=null&&s.blockletLogo?`${k}/${s.blockletLogo}`:`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,P=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(L=>`${O}/${L}`),M=()=>t?!1:!e||e===U.UNOWNED_DID?(q.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Al,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(ze,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:s.blockletTitle||"",onChange:L=>{d({blockletTitle:""}),a({blockletTitle:L.target.value})},error:!!c.blockletTitle,helperText:c.blockletTitle||""}),o.jsx(ze,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===U.UNOWNED_DID&&o.jsx(f1,{position:"end",children:o.jsx(I1,{blocklet:n,store:C,componentDid:y,onChangeStore:S,disabled:!s.blockletTitle||t||l,loading:l,onClick:I})})},error:!!c.projectId,helperText:c.projectId||"",value:e===U.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(ze,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletDescription||"",onChange:L=>{d({blockletDescription:""}),a({blockletDescription:L.target.value})},error:!!c.blockletDescription,helperText:c.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(K,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(v0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||D,onClick:()=>{M()&&w.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(K,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[P.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(se,{className:"action",onClick:()=>{const A=[...s.blockletScreenshots];A.splice(E,1),a({blockletScreenshots:A})},children:o.jsx(z2,{})})]})),P.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(we,{}),children:[o.jsx(l0,{ref:w,popup:!0,onUploadFinish:L=>{a({blockletLogo:L.data.filename}),g(""),w.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:t0,maxFileSize:o0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(l0,{ref:v,popup:!0,onUploadFinish:L=>{var A;const E=s.blockletScreenshots||[];E.push((A=L.data)==null?void 0:A.filename),a({blockletScreenshots:E}),v.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:O,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:t0,maxFileSize:o0,maxNumberOfFiles:5-P.length}}},"uploader-screenshot")]})]})}_0.propTypes={projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired,blocklet:f.object.isRequired,setLoading:f.func.isRequired,initUrl:f.object.isRequired,componentDid:f.isRequired,initLogoUrl:f.string.isRequired,setInitLogoUrl:f.func.isRequired};const Al=ie.div`
|
|
136
|
+
`,N0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:n})=>{var c,d;const s=e?(c=l==null?void 0:l.meta)==null?void 0:c.did:t==null?void 0:t.did;let a=e?((d=l==null?void 0:l.settings)==null?void 0:d.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return a=a.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===n),{teamDid:s,storeList:a}};function I1({blocklet:e,store:t,onChangeStore:l,onClick:n,disabled:s,loading:a,componentDid:c}){var L,A,H;const{t:d}=le(),{session:u}=Ke(),{api:h,info:x,inService:g}=je(),y=Me(),[p,i]=R.useState(!1),m=R.useRef(null),[w,v]=R.useState(!1),[C,S]=R.useState(null),V=B=>{l(B),i(!1)},T=()=>{i(!0)},I=B=>{m.current&&m.current.contains(B.target)||i(!1)},k=()=>{v(!0)},$=()=>{v(!1)},D=async()=>{var B;if(C)try{await h.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet())}catch(X){q.error(`Remove Blocklet Store Error: ${Ve(X)}`)}finally{S(null)}},{storeList:P}=N0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:c,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),M=(A=e==null?void 0:e.meta)==null?void 0:A.did;return o.jsxs(o.Fragment,{children:[o.jsxs(L2,{disabled:s,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:n,children:[a&&o.jsx(s1,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${(t==null?void 0:t.name)||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx(S2,{})})]}),o.jsx(l2,{sx:{zIndex:1},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:B})=>o.jsx(r2,{...B,style:{transformOrigin:"center top"},children:o.jsx(h0,{children:o.jsx(n2,{onClickAway:I,children:o.jsxs(s2,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto"},children:[P.map(X=>{var J;return o.jsxs($1,{selected:X.id===t.id,sx:{height:56},onClick:()=>V(X),children:[o.jsxs(z,{children:[o.jsx(xe,{sx:{fontSize:"16px"},maxLength:24,children:X.name}),o.jsx(xe,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:X.url})]}),k2({store:X,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(se,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(X)},children:o.jsx(qe,{icon:"ic:outline-delete"})})]},X.url)}),o.jsx(i2,{}),o.jsxs($1,{onClick:k,children:[o.jsx(c1,{font:!0}),o.jsx(K,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&o.jsx(j0,{hiddenChildren:!0,open:!0,onClose:$,teamDid:M,storeList:P,scope:"studio",onAdd:(H=y==null?void 0:y.actions)==null?void 0:H.refreshBlocklet}),C&&o.jsx(u1,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:D,onCancel:()=>S(null)})]})}I1.propTypes={store:f.object,blocklet:f.object,onChangeStore:f.func.isRequired,onClick:f.func.isRequired,loading:f.bool.isRequired,disabled:f.bool.isRequired,componentDid:f.string.isRequired,projectType:f.string.isRequired,getData:f.func.isRequired};I1.defaultProps={store:null,blocklet:null};async function D0(e,t=1500,l=600,n=5e3){let s=0;await new Promise(c=>setTimeout(c,n));const a=async(c,d)=>{try{const u=await e();c(u)}catch(u){s++,s>=l?d(u):setTimeout(()=>a(c,d),t)}};return new Promise(a)}function Dl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function _l(e,{did:t,projectId:l,messageId:n}){return D0(async()=>{var a;const s=await e.getProject({input:{did:t,projectId:l,messageId:n}});if(!((a=s==null?void 0:s.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid})}function Bl(e,{did:t,projectId:l,storeId:n}){return D0(async()=>{var c,d;const s=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((d=(c=s==null?void 0:s.project)==null?void 0:c.connectedStores)!=null&&d.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(u=>u.storeId===n))throw new Error("Connected store not found")})}const e0="lastWantToConnectStoreId";function El(e){var d,u;const[t,l]=R.useState(null),{session:n}=Ke(),s=R.useCallback(h=>{l(h),localStorage.setItem(e0,h==null?void 0:h.id)},[l]),a=R.useMemo(()=>{var g,y;const h=localStorage.getItem(e0),x=h?(((g=e==null?void 0:e.settings)==null?void 0:g.storeList)||[]).find(p=>p.id===h):null;return x||(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(p=>{var i;return!(p.id!==U.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==((i=n==null?void 0:n.user)==null?void 0:i.did))})},[(d=e==null?void 0:e.settings)==null?void 0:d.storeList,(u=n==null?void 0:n.user)==null?void 0:u.did]);return[t||a,s]}const t0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],o0=1024*1024*10,l0=R.lazy(()=>f0(()=>import("./react-DhoomF4D.js").then(e=>e.r),__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])).then(e=>({default:e.Uploader})));function _0({projectId:e,readOnly:t,loading:l,blocklet:n,params:s,setParams:a,paramsErrTip:c,setParamsErrTip:d,setLoading:u,initUrl:h,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=le(),{api:i}=je(),m=i1(),w=R.useRef(null),v=R.useRef(null),[C,S]=El(n),V=M2({onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const A=setTimeout(()=>{u(!1)},2e4),H=await _l(i,L);u(!1),clearTimeout(A),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${U.UNOWNED_DID}/create`,`${H}/create`),{replace:!0})},I=()=>{if(!s.blockletTitle){q.error(p("blocklet.publish.errorTip.noTitle"));return}if(!C){q.error("No store found");return}const L=Dl();V(async(A,H)=>{var B,X,J;try{const W=await i.connectByStudio({input:{did:(B=n==null?void 0:n.meta)==null?void 0:B.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((X=s==null?void 0:s.blockletComponents)==null?void 0:X.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(h==null?void 0:h.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){q.error("failed to connect to store");return}H(W.url),T({did:(J=n==null?void 0:n.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const te=Ve(W);q.error(te),A.document.write(te),u(!1)}})},k=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/logo/upload`,$=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/screenshot/upload`,D=s!=null&&s.blockletLogo?`${k}/${s.blockletLogo}`:`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,P=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(L=>`${$}/${L}`),M=()=>t?!1:!e||e===U.UNOWNED_DID?(q.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Al,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(ze,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:s.blockletTitle||"",onChange:L=>{d({blockletTitle:""}),a({blockletTitle:L.target.value})},error:!!c.blockletTitle,helperText:c.blockletTitle||""}),o.jsx(ze,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===U.UNOWNED_DID&&o.jsx(f1,{position:"end",children:o.jsx(I1,{blocklet:n,store:C,componentDid:y,onChangeStore:S,disabled:!s.blockletTitle||t||l,loading:l,onClick:I})})},error:!!c.projectId,helperText:c.projectId||"",value:e===U.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(ze,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletDescription||"",onChange:L=>{d({blockletDescription:""}),a({blockletDescription:L.target.value})},error:!!c.blockletDescription,helperText:c.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(K,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(v0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||D,onClick:()=>{M()&&w.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(K,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[P.map((L,A)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(se,{className:"action",onClick:()=>{a(H=>{const B=[...H.blockletScreenshots];return B.splice(A,1),{...H,blockletScreenshots:B}})},children:o.jsx(z2,{})})]},L)),P.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{M()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(we,{}),children:[o.jsx(l0,{ref:w,popup:!0,onUploadFinish:L=>{a({blockletLogo:L.data.filename}),g(""),w.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:k,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:t0,maxFileSize:o0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(l0,{ref:v,popup:!0,onUploadFinish:L=>{a(A=>{var B;const H=A.blockletScreenshots||[];return H.push((B=L.data)==null?void 0:B.filename),{...A,blockletScreenshots:H}}),v.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:$,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:t0,maxFileSize:o0,maxNumberOfFiles:5-P.length}}},"uploader-screenshot")]})]})}_0.propTypes={projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired,blocklet:f.object.isRequired,setLoading:f.func.isRequired,initUrl:f.object.isRequired,componentDid:f.isRequired,initLogoUrl:f.string.isRequired,setInitLogoUrl:f.func.isRequired};const Al=ie.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -164,7 +164,7 @@ import{ao as K0,j as o,aD as re,cE as a0,aG as B,fl as O1,aF as me,aB as Ne,aC a
|
|
|
164
164
|
width: 100%; /* 图像宽度填充容器 */
|
|
165
165
|
height: auto; /* 图像高度自适应 */
|
|
166
166
|
}
|
|
167
|
-
`;var L1={},Hl=ke;Object.defineProperty(L1,"__esModule",{value:!0});var B0=L1.default=void 0,Ol=Hl(Se()),$l=o;B0=L1.default=(0,Ol.default)((0,$l.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");function P1({blocklet:e,releaseId:t,connectedStores:l,projectId:n,releaseType:s,publishedStoreIds:a,onPublish:c,onDelete:d,projectType:u,componentDid:h,onOpenConnectStore:x,behavior:g,onSelectConnectStore:y}){var S,V;const{t:p}=le(),{actions:{refreshBlocklet:i}}=Me(),{session:m}=Ke(),{storeList:w}=N0({fromBlocklet:!0,blocklet:e,componentDid:h,userDid:(S=m==null?void 0:m.user)==null?void 0:S.did}),v=R.useMemo(()=>l!=null&&l.length?l==null?void 0:l.reduce((T,I)=>(T[I.storeId]=I,T),{}):{},[l]),C=(V=e==null?void 0:e.meta)==null?void 0:V.did;return o.jsxs(o.Fragment,{children:[g==="connect"&&!!(w!=null&&w.length)&&o.jsx(g0,{severity:"info",style:{width:"100%"},children:o.jsxs(z,{color:x2[400],component:"a",href:u==="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:[p(u==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),o.jsx(P2,{sx:{marginLeft:1}})]})}),o.jsx(a2,{children:w==null?void 0:w.map(T=>o.jsx(T2,{"data-cy":"store-switch",children:o.jsx(V2,{children:o.jsx(I2,{behavior:g,onSelectConnectStore:y,releaseId:t,projectId:n,releaseType:s,kind:"publish",teamDid:C,store:T,published:(a==null?void 0:a.indexOf(T.id))>-1,connectedStore:v[T.id],onPublish:c,onDelete:d,scope:T.scope||"studio",onOpenConnectStore:x})})},T.url))}),o.jsx(j0,{teamDid:C,storeList:w,scope:"studio",onAdd:i})]})}P1.propTypes={blocklet:f.object.isRequired,projectId:f.string.isRequired,releaseId:f.string.isRequired,releaseType:f.string.isRequired,onPublish:f.func,onDelete:f.func,publishedStoreIds:f.arrayOf(f.string),connectedStores:f.arrayOf(f.object).isRequired,projectType:f.string,componentDid:f.string,onOpenConnectStore:f.func,onSelectConnectStore:f.func,behavior:f.string};P1.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};const E0=({params:e,hasSelectedResources:t,projectId:l,status:n,t:s})=>{const a=[];return e.blockletTitle||a.push({param:"blockletTitle",message:s("blocklet.publish.errorTip.noTitle")}),(!l||l===U.UNOWNED_DID)&&a.push({param:"projectId",message:s("blocklet.publish.errorTip.noDid")}),!e.uploadedResource&&!t&&a.push({param:"blockletResource",message:s("blocklet.publish.errorTip.noResource")}),e.blockletVersion?ye.valid(e.blockletVersion)||a.push({param:"blockletVersion",message:s("blocklet.publish.errorTip.inValidVersion")}):a.push({param:"blockletVersion",message:s("blocklet.publish.errorTip.noVersion")}),n===ge.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||a.push({param:"blockletDescription",message:s("blocklet.publish.errorTip.noDescription")}),e.note||a.push({param:"note",message:s("blocklet.publish.errorTip.noNote")})),a.length?a:null},Fl=({params:e,hasSelectedResources:t,step:l,t:n,projectId:s})=>{if(l===0){if(!e.blockletTitle)return n("blocklet.publish.errorTip.noTitle");if(!s||s===U.UNOWNED_DID)return n("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return n("blocklet.publish.errorTip.noDescription")}if(l===2&&!e.uploadedResource&&!t)return n("blocklet.publish.errorTip.noResource");if(l>=4){if(!e.blockletVersion)return n("blocklet.publish.errorTip.noVersion");if(!ye.valid(e.blockletVersion))return n("blocklet.publish.errorTip.inValidVersion");if(!e.note)return n("blocklet.publish.errorTip.noNote")}return""},ql=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const t=e.split("/").pop().split("?")[0],n=await(await fetch(e)).blob();return new File([n],t,{type:n.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*Ul(e,t){let l=0;for(;l<e.size;)yield e.slice(l,l+t),l+=t}const Wl=async({did:e,projectId:t,uploadType:l="logo",imageUrl:n})=>{const s=await ql(n);new FormData().append("file",s);const c={uploaderId:"Uploader",relativePath:encodeURIComponent(s.name),name:encodeURIComponent(s.name),type:s.type},u=(await F1.post(ue(U.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,t,l,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":s.size,"X-Uploader-File-Ext":s.name.split(".").pop(),"Upload-Metadata":Object.keys(c).map(y=>`${y} ${btoa(c[y])}`).join(",")}})).headers.location,h=2*1024*1024;let x=0,g="";for(const y of Ul(s,h)){const p=await F1.patch(ue(U.WELLKNOWN_SERVICE_PATH_PREFIX,u),y,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":x,"Content-Type":"application/offset+octet-stream"}});x+=y.size,g=p.data.filename}return g};var i0;const Ye=(i0=window.env)==null?void 0:i0.serverEndpoint;function A0({projectId:e,params:t,setParamsErrTip:l,initUrl:n,setParams:s,mode:a,loading:c,blocklet:d,release:u,isPublished:h,releaseId:x,getData:g,getRelease:y,componentDid:p,resourceRelateComponents:i,disabledSelectComponents:m,saveSelectedEventsRef:w,hasSelectedResources:v,initLogoUrl:C,setLoading:S,releaseUsedLast:V,setReleaseUsedLast:T,projectType:I}){var pe;const{t:k,locale:O}=le(),{api:D}=je(),P=i1(),[M,L]=R.useState(!1),[E,A]=R.useState(),$=Ae(G=>G.breakpoints.down("md")),X=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:p},"*"),y()},J=async G=>{var ae,Z,ce;const Y=E0({params:t,hasSelectedResources:v,projectId:e,status:G,t:k});if(Y){q.error(Y.map(_=>_.message).join("; ")),l(Y.reduce((_,H)=>({..._,[H.param]:H.message}),{}));return}const F={...t},oe=((d==null?void 0:d.children)||[]).reduce((_,H)=>(_[H.meta.did]=!0,_),{});if(Object.keys(i).forEach(_=>{if(!oe[_])return;let H=!1;m||F.blockletComponents.forEach(ee=>{ee.did===_&&(ee.included=!0,ee.required=!0,H=!0)}),H||F.blockletComponents.push({did:_,included:!0,required:!0})}),F.blockletVersion=ye.valid(F.blockletVersion),!F.blockletVersion){q.error("Invalid Blocklet Version"),l({blockletVersion:"Invalid Blocklet Version"});return}if(S(!0),C)try{const _=await Wl({did:d.meta.did,projectId:e,imageUrl:C});F.blockletLogo=_,s({blockletLogo:_})}catch(_){q.error(_.message),S(!1);return}if(t.resourceFromSelect){F.uploadedResource="";try{const _=Object.keys(w.current);await b0(_.map(H=>()=>{const ee=w.current[H];return Tl({api:D,locale:O,projectId:e,releaseId:V?"":x,appDid:d.meta.did,component:ee.component,resources:ee.resources,initUrl:n})}),{concurrency:2})}catch(_){q.error(((ce=(Z=(ae=_==null?void 0:_.response)==null?void 0:ae.data)==null?void 0:Z.error)==null?void 0:ce.message)||_.message),S(!1),l({blockletResource:"Invalid save the resource"});return}}else F.blockletComponents=[];F.blockletTitle=(F.blockletTitle||"").trim(),F.blockletDescription=(F.blockletDescription||"").trim(),F.blockletIntroduction=(F.blockletIntroduction||"").trim(),F.note=(F.note||"").trim(),F.blockletComponents=((F==null?void 0:F.blockletComponents)||[]).filter(_=>_.included).map(_=>a1(_,["did","required"])).map(JSON.stringify),S(!0),D.createRelease({input:{...F,did:d.meta.did,projectId:e,releaseId:V?"":x,status:G}}).then(_=>{var H;if(G==="draft"?q.success(k("blocklet.publish.saveDraftSuccess")):(T(!1),q.success(k("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:p},"*")),l({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""}),a==="create"||a==="new-release"){const ee=(H=_==null?void 0:_.release)==null?void 0:H.id;P(`../${e}/view/${ee}`,{replace:!0})}else y()}).catch(_=>{const H=Ve(_);q.error(H),(/resource/.test(H)||/zip/.test(H))&&l({blockletResource:H})}).finally(()=>{S(!1)})},W=async G=>{await Bl(D,G),g()};let te=null;if(h&&Ye){const G=ue(Ye,`/api/project/${d.meta.did}/${e}/${x}/release/blocklet.json`);if(I==="pack"){const Y=new URL(Ye);Y.pathname=ue(Y.pathname,"/launch-blocklet/agreement"),Y.searchParams.set("blocklet_meta_url",G),te=o.jsx("a",{href:Y.href,target:"_blank",rel:"noreferrer",children:$?o.jsx(se,{color:"primary",sx:{mr:1},onClick:()=>A(G),children:o.jsx(qe,{icon:"ic:baseline-install-desktop"})}):o.jsx(ne,{variant:"outlined",sx:{mr:1},onClick:()=>A(G),children:k("common.install")})})}else te=o.jsxs(o.Fragment,{children:[$?o.jsx(se,{color:"primary",sx:{mr:1},onClick:()=>A(G),children:o.jsx(qe,{icon:"ic:baseline-install-desktop"})}):o.jsx(ne,{variant:"outlined",sx:{mr:1},onClick:()=>A(G),children:k("blocklet.publish.copyInstallUrl")}),o.jsx(c2,{fullWidth:!0,maxWidth:"sm",open:E,onClose:()=>A(""),children:o.jsxs(z,{sx:{py:5,px:4,wordBreak:"break-all"},children:[o.jsx(K,{variant:"h6",sx:{mb:2},children:k("blocklet.publish.installResourceTip")}),o.jsx(N2,{children:E}),o.jsxs(K,{sx:{mt:2},children:[k("blocklet.publish.installResourceTip2"),o.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:k("blocklet.publish.installResourceHelp")})]})]})})]})}return o.jsxs(o.Fragment,{children:[o.jsx(Gl,{className:"sticky-header",children:o.jsxs(z,{display:"flex",alignItems:"center",flexDirection:"row",children:[o.jsxs(C0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(de,{to:"../",children:k("common.blockletStudio")}),e===U.UNOWNED_DID?o.jsx(K,{color:"text.primary",children:o.jsx(xe,{maxLength:$?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}):o.jsx(de,{to:`../${e}`,children:o.jsx(xe,{maxLength:$?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}),o.jsx(K,{color:"text.primary",children:a==="create"?k("common.create"):(t==null?void 0:t.blockletVersion)||k("common.edit")})]}),o.jsx(z,{flex:"1"}),!h&&o.jsxs(ne,{variant:"contained",disabled:c,style:{marginRight:12},onClick:()=>J(ge.PROJECT.RELEASE_STATUS.published),children:[c&&o.jsx(s1,{size:14,sx:{mr:.5},color:"inherit"}),k("blocklet.publish.createRelease")]}),h&&o.jsxs(o.Fragment,{children:[te,o.jsx("a",{href:ue(`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${d.meta.did}/${e}/${x}/download/${(u.files||[])[0]}`),children:$?null:o.jsx(ne,{variant:"outlined",sx:{mr:1},children:k("common.download")})}),o.jsxs(ne,{variant:"contained",onClick:()=>L(!0),children:[o.jsx(B0,{style:{fontSize:"1.3em",marginRight:4}}),k($?"common.upload":"common.uploadToStore")]})]})]})}),o.jsx(d2,{title:k("common.connectToStore"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:M,onClose:()=>L(!1),children:o.jsx(P1,{projectType:I,blocklet:d,releaseType:((pe=t==null?void 0:t.blockletComponents)==null?void 0:pe.length)>0?"pack":"resource",projectId:e,releaseId:x,componentDid:p,onPublish:X,onOpenConnectStore:W,onDelete:g,connectedStores:t.connectedStores||[],publishedStoreIds:u==null?void 0:u.publishedStoreIds})})]})}A0.propTypes={projectId:f.string.isRequired,params:f.object.isRequired,mode:f.string.isRequired,loading:f.bool.isRequired,blocklet:f.object.isRequired,release:f.object.isRequired,isPublished:f.bool.isRequired,releaseId:f.string.isRequired,getData:f.func.isRequired,getRelease:f.func.isRequired,componentDid:f.string.isRequired,resourceRelateComponents:f.object.isRequired,disabledSelectComponents:f.bool.isRequired,saveSelectedEventsRef:f.object.isRequired,hasSelectedResources:f.bool.isRequired,initLogoUrl:f.string.isRequired,setLoading:f.func.isRequired,releaseUsedLast:f.bool.isRequired,setReleaseUsedLast:f.func.isRequired,projectType:f.string.isRequired,setParamsErrTip:f.func.isRequired,setParams:f.func.isRequired,initUrl:f.object.isRequired};const Gl=ie.div`
|
|
167
|
+
`;var L1={},Hl=ke;Object.defineProperty(L1,"__esModule",{value:!0});var B0=L1.default=void 0,Ol=Hl(Se()),$l=o;B0=L1.default=(0,Ol.default)((0,$l.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");function P1({blocklet:e,releaseId:t,connectedStores:l,projectId:n,releaseType:s,publishedStoreIds:a,onPublish:c,onDelete:d,projectType:u,componentDid:h,onOpenConnectStore:x,behavior:g,onSelectConnectStore:y}){var S,V;const{t:p}=le(),{actions:{refreshBlocklet:i}}=Me(),{session:m}=Ke(),{storeList:w}=N0({fromBlocklet:!0,blocklet:e,componentDid:h,userDid:(S=m==null?void 0:m.user)==null?void 0:S.did}),v=R.useMemo(()=>l!=null&&l.length?l==null?void 0:l.reduce((T,I)=>(T[I.storeId]=I,T),{}):{},[l]),C=(V=e==null?void 0:e.meta)==null?void 0:V.did;return o.jsxs(o.Fragment,{children:[g==="connect"&&!!(w!=null&&w.length)&&o.jsx(g0,{severity:"info",style:{width:"100%"},children:o.jsxs(z,{color:x2[400],component:"a",href:u==="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:[p(u==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),o.jsx(P2,{sx:{marginLeft:1}})]})}),o.jsx(a2,{children:w==null?void 0:w.map(T=>o.jsx(T2,{"data-cy":"store-switch",children:o.jsx(V2,{children:o.jsx(I2,{behavior:g,onSelectConnectStore:y,releaseId:t,projectId:n,releaseType:s,kind:"publish",teamDid:C,store:T,published:(a==null?void 0:a.indexOf(T.id))>-1,connectedStore:v[T.id],onPublish:c,onDelete:d,scope:T.scope||"studio",onOpenConnectStore:x})})},T.url))}),o.jsx(j0,{teamDid:C,storeList:w,scope:"studio",onAdd:i})]})}P1.propTypes={blocklet:f.object.isRequired,projectId:f.string.isRequired,releaseId:f.string.isRequired,releaseType:f.string.isRequired,onPublish:f.func,onDelete:f.func,publishedStoreIds:f.arrayOf(f.string),connectedStores:f.arrayOf(f.object).isRequired,projectType:f.string,componentDid:f.string,onOpenConnectStore:f.func,onSelectConnectStore:f.func,behavior:f.string};P1.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};const E0=({params:e,hasSelectedResources:t,projectId:l,status:n,t:s})=>{const a=[];return e.blockletTitle||a.push({param:"blockletTitle",message:s("blocklet.publish.errorTip.noTitle")}),(!l||l===U.UNOWNED_DID)&&a.push({param:"projectId",message:s("blocklet.publish.errorTip.noDid")}),!e.uploadedResource&&!t&&a.push({param:"blockletResource",message:s("blocklet.publish.errorTip.noResource")}),e.blockletVersion?ye.valid(e.blockletVersion)||a.push({param:"blockletVersion",message:s("blocklet.publish.errorTip.inValidVersion")}):a.push({param:"blockletVersion",message:s("blocklet.publish.errorTip.noVersion")}),n===ge.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||a.push({param:"blockletDescription",message:s("blocklet.publish.errorTip.noDescription")}),e.note||a.push({param:"note",message:s("blocklet.publish.errorTip.noNote")})),a.length?a:null},Fl=({params:e,hasSelectedResources:t,step:l,t:n,projectId:s})=>{if(l===0){if(!e.blockletTitle)return n("blocklet.publish.errorTip.noTitle");if(!s||s===U.UNOWNED_DID)return n("blocklet.publish.errorTip.noDid");if(!e.blockletDescription)return n("blocklet.publish.errorTip.noDescription")}if(l===2&&!e.uploadedResource&&!t)return n("blocklet.publish.errorTip.noResource");if(l>=4){if(!e.blockletVersion)return n("blocklet.publish.errorTip.noVersion");if(!ye.valid(e.blockletVersion))return n("blocklet.publish.errorTip.inValidVersion");if(!e.note)return n("blocklet.publish.errorTip.noNote")}return""},ql=async e=>{if(typeof e!="string")throw new Error("URL must be a string");try{const t=e.split("/").pop().split("?")[0],n=await(await fetch(e)).blob();return new File([n],t,{type:n.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*Ul(e,t){let l=0;for(;l<e.size;)yield e.slice(l,l+t),l+=t}const Wl=async({did:e,projectId:t,uploadType:l="logo",imageUrl:n})=>{const s=await ql(n);new FormData().append("file",s);const c={uploaderId:"Uploader",relativePath:encodeURIComponent(s.name),name:encodeURIComponent(s.name),type:s.type},u=(await F1.post(ue(U.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",e,t,l,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":s.size,"X-Uploader-File-Ext":s.name.split(".").pop(),"Upload-Metadata":Object.keys(c).map(y=>`${y} ${btoa(c[y])}`).join(",")}})).headers.location,h=2*1024*1024;let x=0,g="";for(const y of Ul(s,h)){const p=await F1.patch(ue(U.WELLKNOWN_SERVICE_PATH_PREFIX,u),y,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":x,"Content-Type":"application/offset+octet-stream"}});x+=y.size,g=p.data.filename}return g};var i0;const Ye=(i0=window.env)==null?void 0:i0.serverEndpoint;function A0({projectId:e,params:t,setParamsErrTip:l,initUrl:n,setParams:s,mode:a,loading:c,blocklet:d,release:u,isPublished:h,releaseId:x,getData:g,getRelease:y,componentDid:p,resourceRelateComponents:i,disabledSelectComponents:m,saveSelectedEventsRef:w,hasSelectedResources:v,initLogoUrl:C,setLoading:S,releaseUsedLast:V,setReleaseUsedLast:T,projectType:I}){var pe;const{t:k,locale:$}=le(),{api:D}=je(),P=i1(),[M,L]=R.useState(!1),[A,H]=R.useState(),B=Ae(G=>G.breakpoints.down("md")),X=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:p},"*"),y()},J=async G=>{var ae,Z,ce;const Y=E0({params:t,hasSelectedResources:v,projectId:e,status:G,t:k});if(Y){q.error(Y.map(_=>_.message).join("; ")),l(Y.reduce((_,O)=>({..._,[O.param]:O.message}),{}));return}const F={...t},oe=((d==null?void 0:d.children)||[]).reduce((_,O)=>(_[O.meta.did]=!0,_),{});if(Object.keys(i).forEach(_=>{if(!oe[_])return;let O=!1;m||F.blockletComponents.forEach(ee=>{ee.did===_&&(ee.included=!0,ee.required=!0,O=!0)}),O||F.blockletComponents.push({did:_,included:!0,required:!0})}),F.blockletVersion=ye.valid(F.blockletVersion),!F.blockletVersion){q.error("Invalid Blocklet Version"),l({blockletVersion:"Invalid Blocklet Version"});return}if(S(!0),C)try{const _=await Wl({did:d.meta.did,projectId:e,imageUrl:C});F.blockletLogo=_,s({blockletLogo:_})}catch(_){q.error(_.message),S(!1);return}if(t.resourceFromSelect){F.uploadedResource="";try{const _=Object.keys(w.current);await b0(_.map(O=>()=>{const ee=w.current[O];return Tl({api:D,locale:$,projectId:e,releaseId:V?"":x,appDid:d.meta.did,component:ee.component,resources:ee.resources,initUrl:n})}),{concurrency:2})}catch(_){q.error(((ce=(Z=(ae=_==null?void 0:_.response)==null?void 0:ae.data)==null?void 0:Z.error)==null?void 0:ce.message)||_.message),S(!1),l({blockletResource:"Invalid save the resource"});return}}else F.blockletComponents=[];F.blockletTitle=(F.blockletTitle||"").trim(),F.blockletDescription=(F.blockletDescription||"").trim(),F.blockletIntroduction=(F.blockletIntroduction||"").trim(),F.note=(F.note||"").trim(),F.blockletComponents=((F==null?void 0:F.blockletComponents)||[]).filter(_=>_.included).map(_=>a1(_,["did","required"])).map(JSON.stringify),S(!0),D.createRelease({input:{...F,did:d.meta.did,projectId:e,releaseId:V?"":x,status:G}}).then(_=>{var O;if(G==="draft"?q.success(k("blocklet.publish.saveDraftSuccess")):(T(!1),q.success(k("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:p},"*")),l({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""}),a==="create"||a==="new-release"){const ee=(O=_==null?void 0:_.release)==null?void 0:O.id;P(`../${e}/view/${ee}`,{replace:!0})}else y()}).catch(_=>{const O=Ve(_);q.error(O),(/resource/.test(O)||/zip/.test(O))&&l({blockletResource:O})}).finally(()=>{S(!1)})},W=async G=>{await Bl(D,G),g()};let te=null;if(h&&Ye){const G=ue(Ye,`/api/project/${d.meta.did}/${e}/${x}/release/blocklet.json`);if(I==="pack"){const Y=new URL(Ye);Y.pathname=ue(Y.pathname,"/launch-blocklet/agreement"),Y.searchParams.set("blocklet_meta_url",G),te=o.jsx("a",{href:Y.href,target:"_blank",rel:"noreferrer",children:B?o.jsx(se,{color:"primary",sx:{mr:1},onClick:()=>H(G),children:o.jsx(qe,{icon:"ic:baseline-install-desktop"})}):o.jsx(ne,{variant:"outlined",sx:{mr:1},onClick:()=>H(G),children:k("common.install")})})}else te=o.jsxs(o.Fragment,{children:[B?o.jsx(se,{color:"primary",sx:{mr:1},onClick:()=>H(G),children:o.jsx(qe,{icon:"ic:baseline-install-desktop"})}):o.jsx(ne,{variant:"outlined",sx:{mr:1},onClick:()=>H(G),children:k("blocklet.publish.copyInstallUrl")}),o.jsx(c2,{fullWidth:!0,maxWidth:"sm",open:A,onClose:()=>H(""),children:o.jsxs(z,{sx:{py:5,px:4,wordBreak:"break-all"},children:[o.jsx(K,{variant:"h6",sx:{mb:2},children:k("blocklet.publish.installResourceTip")}),o.jsx(N2,{children:A}),o.jsxs(K,{sx:{mt:2},children:[k("blocklet.publish.installResourceTip2"),o.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:k("blocklet.publish.installResourceHelp")})]})]})})]})}return o.jsxs(o.Fragment,{children:[o.jsx(Gl,{className:"sticky-header",children:o.jsxs(z,{display:"flex",alignItems:"center",flexDirection:"row",children:[o.jsxs(C0,{className:"breadcrumbs","aria-label":"breadcrumb",children:[o.jsx(de,{to:"../",children:k("common.blockletStudio")}),e===U.UNOWNED_DID?o.jsx(K,{color:"text.primary",children:o.jsx(xe,{maxLength:B?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}):o.jsx(de,{to:`../${e}`,children:o.jsx(xe,{maxLength:B?6:30,children:(t==null?void 0:t.blockletTitle)||"Blocklet"})}),o.jsx(K,{color:"text.primary",children:a==="create"?k("common.create"):(t==null?void 0:t.blockletVersion)||k("common.edit")})]}),o.jsx(z,{flex:"1"}),!h&&o.jsxs(ne,{variant:"contained",disabled:c,style:{marginRight:12},onClick:()=>J(ge.PROJECT.RELEASE_STATUS.published),children:[c&&o.jsx(s1,{size:14,sx:{mr:.5},color:"inherit"}),k("blocklet.publish.createRelease")]}),h&&o.jsxs(o.Fragment,{children:[te,o.jsx("a",{href:ue(`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${d.meta.did}/${e}/${x}/download/${(u.files||[])[0]}`),children:B?null:o.jsx(ne,{variant:"outlined",sx:{mr:1},children:k("common.download")})}),o.jsxs(ne,{variant:"contained",onClick:()=>L(!0),children:[o.jsx(B0,{style:{fontSize:"1.3em",marginRight:4}}),k(B?"common.upload":"common.uploadToStore")]})]})]})}),o.jsx(d2,{title:k("common.connectToStore"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:M,onClose:()=>L(!1),children:o.jsx(P1,{projectType:I,blocklet:d,releaseType:((pe=t==null?void 0:t.blockletComponents)==null?void 0:pe.length)>0?"pack":"resource",projectId:e,releaseId:x,componentDid:p,onPublish:X,onOpenConnectStore:W,onDelete:g,connectedStores:t.connectedStores||[],publishedStoreIds:u==null?void 0:u.publishedStoreIds})})]})}A0.propTypes={projectId:f.string.isRequired,params:f.object.isRequired,mode:f.string.isRequired,loading:f.bool.isRequired,blocklet:f.object.isRequired,release:f.object.isRequired,isPublished:f.bool.isRequired,releaseId:f.string.isRequired,getData:f.func.isRequired,getRelease:f.func.isRequired,componentDid:f.string.isRequired,resourceRelateComponents:f.object.isRequired,disabledSelectComponents:f.bool.isRequired,saveSelectedEventsRef:f.object.isRequired,hasSelectedResources:f.bool.isRequired,initLogoUrl:f.string.isRequired,setLoading:f.func.isRequired,releaseUsedLast:f.bool.isRequired,setReleaseUsedLast:f.func.isRequired,projectType:f.string.isRequired,setParamsErrTip:f.func.isRequired,setParams:f.func.isRequired,initUrl:f.object.isRequired};const Gl=ie.div`
|
|
168
168
|
.sticky-header {
|
|
169
169
|
margin-top: -12px;
|
|
170
170
|
padding: 12px 0;
|
|
@@ -178,7 +178,7 @@ import{ao as K0,j as o,aD as re,cE as a0,aG as B,fl as O1,aF as me,aB as Ne,aC a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function H0({text:e}){return e?o.jsx(D2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[_2,{target:"_blank"}]]}):o.jsx(be,{Icon:He})}H0.propTypes={text:f.string.isRequired};function O0({params:e,setParams:t,paramsErrTip:l,loading:n,setParamsErrTip:s,readOnly:a}){var x;const{t:c}=le(),[d,u]=R.useState(a?"preview":"write"),h=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(K,{variant:"h6",fontWeight:"bold",sx:{},children:c("common.introduction")}),o.jsxs(b2,{value:d,onChange:h,"aria-label":"wrapped label tabs example",children:[o.jsx(U1,{value:"write",label:"Write"}),o.jsx(U1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:d==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(ze,{disabled:n||a,sx:{border:"none"},placeholder:`Blocklet ${c("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:o.jsxs(f1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ge.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{s({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ge.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:d==="preview"?"block":"none",mt:3,children:o.jsx(H0,{text:e.blockletIntroduction||""})})]})}O0.propTypes={params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,readOnly:f.bool.isRequired,loading:f.bool.isRequired};var T1={},Kl=ke;Object.defineProperty(T1,"__esModule",{value:!0});var $0=T1.default=void 0,Xl=Kl(Se()),r0=o;$0=T1.default=(0,Xl.default)([(0,r0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,r0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function V1({step:e,ok:t,active:l,error:n}){let s="grey.500",a=e+1;return t&&(a=o.jsx(B2,{sx:{fontSize:18,margin:0},color:"white"})),n||!t&&l>e?(s="error.main",a=o.jsx($0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(s="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:a})}V1.propTypes={step:f.number,ok:f.bool,active:f.number,error:f.string};V1.defaultProps={step:0,ok:!1,active:0,error:""};function F0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:n,params:s,loading:a,paramsErrTip:c,viewMode:d,projectId:u}){const{t:h}=le(),x=()=>{l(i=>i+1)},g=()=>{l(i=>i-1)},y=i=>i===0?(c==null?void 0:c.blockletTitle)||(c==null?void 0:c.projectId)||(c==null?void 0:c.blockletDescription):i===2?c==null?void 0:c.blockletResource:i>=4?(c==null?void 0:c.blockletVersion)||(c==null?void 0:c.note):"",p=d||E0({hasSelectedResources:n,params:s,projectId:u,t:h})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(A2,{activeStep:t,orientation:"vertical",children:e.map((i,m)=>{const w={},v=a||!Fl({hasSelectedResources:n,params:s,projectId:u,step:m,t:h}),C=a?"":y(m);return C&&(w.optional=o.jsx(K,{variant:"caption",color:"error",children:C}),w.error=!0),o.jsxs(H2,{children:[o.jsx(ct,{icon:o.jsx(V1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...w,children:o.jsx(K,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:i.label})}),o.jsxs(mt,{children:[o.jsx(K,{fontSize:12,children:i.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:h("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:h("common.back")})]})})]})]},i.label)})}),t>=e.length-1&&o.jsx(h0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(K,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}F0.propTypes={steps:f.array.isRequired,activeStep:f.number.isRequired,setActiveStep:f.func.isRequired,params:f.object.isRequired,viewMode:f.string.isRequired,loading:f.bool.isRequired,projectId:f.string.isRequired,hasSelectedResources:f.bool.isRequired,paramsErrTip:f.shape({projectId:f.string,blockletVersion:f.string,blockletTitle:f.string,blockletDescription:f.string,note:f.string,blockletResource:f.string}).isRequired};function Ue({readOnly:e,params:t,setParams:l,paramsErrTip:n,setParamsErrTip:s,loading:a}){var d;const{t:c}=le();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(ze,{required:!0,disabled:a||e,label:`Blocklet ${c("common.version")}`,placeholder:`Blocklet ${c("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{s({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!n.blockletVersion,helperText:n.blockletVersion||""}),o.jsx(ze,{label:c("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(f1,{position:"end",children:[((d=t==null?void 0:t.note)==null?void 0:d.length)||0," / ",ge.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{s({note:""}),l({note:u.target.value.slice(0,ge.PROJECT.MAX_NOTE_LENGTH)})},error:!!n.note,helperText:n.note||"",sx:{mt:3}})]})})}Ue.propTypes={readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired};Ue.defaultProps={};const Jl=[".zip",".gz"],Ql=1024*1024*100,Yl=R.lazy(()=>f0(()=>import("./react-DR-nB82P.js").then(e=>e.r),__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])).then(e=>({default:e.Uploader})));function N1({app:e,projectId:t,readOnly:l,params:n,setParams:s,setParamsErrTip:a,error:c}){const{t:d}=le(),u=R.useRef(null),h=()=>l?!1:!t||t===U.UNOWNED_DID?(q.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(K,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),o.jsxs(w2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!n.uploadedResource&&o.jsx(K,{component:"a",href:`${x}/params.uploadedResource`,children:n.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;h()&&((g=u.current)==null||g.open())},children:n.uploadedResource?d("common.change"):d("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(we,{}),children:o.jsx(Yl,{ref:u,popup:!0,onUploadFinish:g=>{var y;s({uploadedResource:g.data.filename}),a({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:Jl,maxFileSize:Ql,maxNumberOfFiles:1}}},"uploader-resource")}),!!c&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:c})]})}N1.propTypes={app:f.object.isRequired,projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,error:f.string.isRequired,setParamsErrTip:f.func.isRequired};N1.defaultProps={};const Zl=({tabs:e,blocklet:t,ancestors:l=[]})=>{const n=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(p1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},n),value:n})},n0=(e,t)=>{const l=a1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(n=>({...n,included:!0})):l.blockletComponents=(t.children||[]).map(n=>({did:n.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},e3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},s0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function D1({initUrl:e,...t}){var H1;const{projectId:l,mode:n,releaseId:s,componentDid:a=""}=Ge(),{t:c}=le(),{blocklet:d}=Me(),[u,h]=Ce({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Ce({}),[y,p]=R.useState(!1),[i,m]=Ce(null),{api:w}=je(),v=Ae(N=>N.breakpoints.down("md")),[C,S]=R.useState({}),[V,T]=R.useState(!1),I=R.useRef({}),[k,O]=Ce({}),[D,P]=R.useState(""),[M,L]=Ce({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),A=E==="readonly",$=R.useCallback(N=>{A&&h({blockletComponents:[]}),L(N)},[A,L,h]),X=R.useCallback((...N)=>{O(...N),g({blockletResource:""})},[]),J=s==="none"?(u==null?void 0:u.lastReleaseId)||"":s,[W,te]=R.useState(n==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const pe=R.useMemo(()=>{var N;return(N=u==null?void 0:u.blockletComponents)!=null&&N.some(Q=>Q.included)||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource]),G=[],Y=((d==null?void 0:d.children)||[]).filter(N=>{var Q;return(Q=N.meta.resource)==null?void 0:Q.exportApi}).filter(N=>!a||N.meta.did===a);Y.forEach(N=>{Zl({tabs:G,blocklet:N,t:c,ancestors:[d]})});const[F,oe]=R.useState((H1=G[0])==null?void 0:H1.value),ae=!V&&(i==null?void 0:i.status)==="published",Z=ae,ce=R.useMemo(()=>{const N={};return Object.keys(M).forEach(Q=>{const Oe=M[Q];Oe&&Oe.forEach(G0=>{N[G0]=!0})}),N},[M]),_=async()=>{if(J)try{const N=await w.getRelease({input:{did:d.meta.did,projectId:l,releaseId:J}});if(p(!1),!N.release){q.error("Release not found");return}n!=="view"&&(N.release.note=""),h(Q=>n0({...Q,...N.release,blockletVersion:n==="create"||n==="new-release"?ye.inc(N.release.blockletVersion,"patch"):N.release.blockletVersion},d)),m(N.release)}catch(N){p(!1),q.error(Ve(N))}},H=async()=>{if(l===U.UNOWNED_DID){h({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){q.error(c("blocklet.publish.errorTip.noDid"));return}try{const N=await w.getProject({input:{did:d.meta.did,projectId:l}});p(!1);const Q=N.project||{};Q.blockletVersion?(n==="create"||n==="new-release")&&ye.valid(Q.blockletVersion)&&(Q.blockletVersion=ye.inc(Q.blockletVersion,"patch")):Q.blockletVersion="1.0.0";const Oe=n0(Q,d);h(Oe)}catch(N){p(!1),q.error(Ve(N))}},ee=R.useCallback(async()=>{if(n==="view"){if(!J){q.error("Empty release id");return}await H(),await _();return}await H(),J&&(T(!0),await _())},[n,J]),Le=N=>{h({blockletComponents:N})};R.useEffect(()=>{ee()},[ee]),R.useEffect(()=>{if(l===U.UNOWNED_DID&&(n==="create"||n==="new-release")&&e){P(e.searchParams.get("logo")),h({blockletTitle:e.searchParams.get("title"),blockletDescription:e.searchParams.get("description"),blockletIntroduction:e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:e.searchParams.get("note")||"No note"});const N=e.searchParams.get("resources");try{const Q=JSON.parse(N);S(Q)}catch{}}},[h,l,e,n]);const _1=R.useMemo(()=>!!Object.keys(k).find(N=>!!k[N].length),[k]);if(!u&&y)return o.jsx(we,{});if(!u)return null;const B1=Y.find(N=>N.meta.did===F);if(Y.every(N=>N.status!=="running"))return o.jsx(be,{children:c("blocklet.publish.allComponentsNotRunning")});const U0=N=>{oe(N)},E1=e==null?void 0:e.searchParams.get("resourcesTitle"),A1=e==null?void 0:e.searchParams.get("componentsTitle"),Re=[{label:c("blocklet.publish.branding"),description:c("blocklet.publish.steps.branding")},{label:c("common.introduction"),description:c("blocklet.publish.steps.introduction")},{label:E1||c("blocklet.publish.resourceTitle"),description:c("blocklet.publish.steps.resources")},{label:A1||c("common.components"),description:c("blocklet.publish.steps.blocklets")},{label:c("blocklet.publish.versionTitle"),description:c("blocklet.publish.steps.version")}],W0=Re[W]||Re[Re.length-1],ve=e3[W];return o.jsxs(t3,{...t,children:[o.jsx(A0,{blocklet:d,release:i,getData:ee,getRelease:_,mode:n,params:u,setParams:h,setParamsErrTip:g,readOnly:Z,isPublished:ae,loading:y,setLoading:p,initLogoUrl:D,releaseId:J,projectId:l,projectType:pe,resourceComponents:Y,resourceComponentsMap:M,resourceRelateComponents:ce,resourceItem:B1,saveSelectedEventsRef:I,hasSelectedResources:_1,releaseUsedLast:V,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(F0,{steps:Re,viewMode:n==="view",params:u,hasSelectedResources:_1||u.uploadedResource,paramsErrTip:x,activeStep:W,setActiveStep:te,projectId:l,resourcesUrlTitle:E1,componentsUrlTitle:A1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&ve!=="introduction"&&o.jsxs(K,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[W0.label,ve==="branding"&&o.jsx(fe,{title:c("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{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:o.jsx(g2,{})})})]}),(v||ve==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(_0,{projectId:l,setParams:h,setParamsErrTip:g,params:u,componentDid:a,blocklet:d,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Z,initLogoUrl:D,setInitLogoUrl:P})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(Ue,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:Z})}),(v||ve==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(O0,{loading:y,readOnly:Z,params:u,setParams:h,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Re[s0.resources].label}),o.jsx(z,{display:v||ve==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(O2,{onChange:()=>h({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(t1,{value:"select",disabled:Z,control:o.jsx(W1,{size:"small",checked:u.resourceFromSelect}),label:c("blocklet.publish.resourceSelect")}),o.jsx(t1,{value:"select",disabled:Z,control:o.jsx(W1,{size:"small",checked:!u.resourceFromSelect}),label:c("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!a&&o.jsx(j2,{tabs:G,current:F,onChange:U0,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(M1,{loading:y,initialResources:C,saveSelectedEventsRef:I,selectedResourceIds:k,setSelectedResourceIds:X,setResourceComponentsMap:$,error:x.blockletResource,app:d,readOnly:Z,component:B1,componentDid:a,initUrl:e,params:u,setParams:h,projectId:l===U.UNOWNED_DID?"":l,releaseUsedLast:V,release:{...i,id:J}})]}),!u.resourceFromSelect&&o.jsx(N1,{app:d,readOnly:Z,projectId:l===U.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:h,setParamsErrTip:g})]})})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Re[s0.blocklets].label}),(v||ve==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(w1,{projectType:pe,disabled:y||Z,app:d,value:(u==null?void 0:u.blockletComponents)||[],onChange:Le,resourceRelateComponents:ce,dependentComponentsMode:E})})})}),!v&&ve==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(Ue,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:Z})})]})]})]})]})}D1.propTypes={initUrl:f.object};D1.defaultProps={initUrl:null};const t3=ie.div`
|
|
181
|
+
`;function H0({text:e}){return e?o.jsx(D2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[_2,{target:"_blank"}]]}):o.jsx(be,{Icon:He})}H0.propTypes={text:f.string.isRequired};function O0({params:e,setParams:t,paramsErrTip:l,loading:n,setParamsErrTip:s,readOnly:a}){var x;const{t:c}=le(),[d,u]=R.useState(a?"preview":"write"),h=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(K,{variant:"h6",fontWeight:"bold",sx:{},children:c("common.introduction")}),o.jsxs(b2,{value:d,onChange:h,"aria-label":"wrapped label tabs example",children:[o.jsx(U1,{value:"write",label:"Write"}),o.jsx(U1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:d==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(ze,{disabled:n||a,sx:{border:"none"},placeholder:`Blocklet ${c("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:o.jsxs(f1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ge.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{s({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ge.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:d==="preview"?"block":"none",mt:3,children:o.jsx(H0,{text:e.blockletIntroduction||""})})]})}O0.propTypes={params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,readOnly:f.bool.isRequired,loading:f.bool.isRequired};var T1={},Kl=ke;Object.defineProperty(T1,"__esModule",{value:!0});var $0=T1.default=void 0,Xl=Kl(Se()),r0=o;$0=T1.default=(0,Xl.default)([(0,r0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,r0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function V1({step:e,ok:t,active:l,error:n}){let s="grey.500",a=e+1;return t&&(a=o.jsx(B2,{sx:{fontSize:18,margin:0},color:"white"})),n||!t&&l>e?(s="error.main",a=o.jsx($0,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(s="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:a})}V1.propTypes={step:f.number,ok:f.bool,active:f.number,error:f.string};V1.defaultProps={step:0,ok:!1,active:0,error:""};function F0({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:n,params:s,loading:a,paramsErrTip:c,viewMode:d,projectId:u}){const{t:h}=le(),x=()=>{l(i=>i+1)},g=()=>{l(i=>i-1)},y=i=>i===0?(c==null?void 0:c.blockletTitle)||(c==null?void 0:c.projectId)||(c==null?void 0:c.blockletDescription):i===2?c==null?void 0:c.blockletResource:i>=4?(c==null?void 0:c.blockletVersion)||(c==null?void 0:c.note):"",p=d||E0({hasSelectedResources:n,params:s,projectId:u,t:h})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(A2,{activeStep:t,orientation:"vertical",children:e.map((i,m)=>{const w={},v=a||!Fl({hasSelectedResources:n,params:s,projectId:u,step:m,t:h}),C=a?"":y(m);return C&&(w.optional=o.jsx(K,{variant:"caption",color:"error",children:C}),w.error=!0),o.jsxs(H2,{children:[o.jsx(ct,{icon:o.jsx(V1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...w,children:o.jsx(K,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:i.label})}),o.jsxs(mt,{children:[o.jsx(K,{fontSize:12,children:i.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:h("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:h("common.back")})]})})]})]},i.label)})}),t>=e.length-1&&o.jsx(h0,{square:!0,elevation:0,sx:{p:3},children:o.jsx(K,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}F0.propTypes={steps:f.array.isRequired,activeStep:f.number.isRequired,setActiveStep:f.func.isRequired,params:f.object.isRequired,viewMode:f.string.isRequired,loading:f.bool.isRequired,projectId:f.string.isRequired,hasSelectedResources:f.bool.isRequired,paramsErrTip:f.shape({projectId:f.string,blockletVersion:f.string,blockletTitle:f.string,blockletDescription:f.string,note:f.string,blockletResource:f.string}).isRequired};function Ue({readOnly:e,params:t,setParams:l,paramsErrTip:n,setParamsErrTip:s,loading:a}){var d;const{t:c}=le();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(ze,{required:!0,disabled:a||e,label:`Blocklet ${c("common.version")}`,placeholder:`Blocklet ${c("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{s({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!n.blockletVersion,helperText:n.blockletVersion||""}),o.jsx(ze,{label:c("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(f1,{position:"end",children:[((d=t==null?void 0:t.note)==null?void 0:d.length)||0," / ",ge.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{s({note:""}),l({note:u.target.value.slice(0,ge.PROJECT.MAX_NOTE_LENGTH)})},error:!!n.note,helperText:n.note||"",sx:{mt:3}})]})})}Ue.propTypes={readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,paramsErrTip:f.object.isRequired,setParamsErrTip:f.func.isRequired,loading:f.bool.isRequired};Ue.defaultProps={};const Jl=[".zip",".gz"],Ql=1024*1024*100,Yl=R.lazy(()=>f0(()=>import("./react-DhoomF4D.js").then(e=>e.r),__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])).then(e=>({default:e.Uploader})));function N1({app:e,projectId:t,readOnly:l,params:n,setParams:s,setParamsErrTip:a,error:c}){const{t:d}=le(),u=R.useRef(null),h=()=>l?!1:!t||t===U.UNOWNED_DID?(q.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(K,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),o.jsxs(w2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!n.uploadedResource&&o.jsx(K,{component:"a",href:`${x}/params.uploadedResource`,children:n.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;h()&&((g=u.current)==null||g.open())},children:n.uploadedResource?d("common.change"):d("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(we,{}),children:o.jsx(Yl,{ref:u,popup:!0,onUploadFinish:g=>{var y;s({uploadedResource:g.data.filename}),a({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:Jl,maxFileSize:Ql,maxNumberOfFiles:1}}},"uploader-resource")}),!!c&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:c})]})}N1.propTypes={app:f.object.isRequired,projectId:f.string.isRequired,readOnly:f.bool.isRequired,params:f.object.isRequired,setParams:f.func.isRequired,error:f.string.isRequired,setParamsErrTip:f.func.isRequired};N1.defaultProps={};const Zl=({tabs:e,blocklet:t,ancestors:l=[]})=>{const n=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(p1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},n),value:n})},n0=(e,t)=>{const l=a1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(n=>({...n,included:!0})):l.blockletComponents=(t.children||[]).map(n=>({did:n.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},e3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},s0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function D1({initUrl:e,...t}){var H1;const{projectId:l,mode:n,releaseId:s,componentDid:a=""}=Ge(),{t:c}=le(),{blocklet:d}=Me(),[u,h]=Ce({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Ce({}),[y,p]=R.useState(!1),[i,m]=Ce(null),{api:w}=je(),v=Ae(N=>N.breakpoints.down("md")),[C,S]=R.useState({}),[V,T]=R.useState(!1),I=R.useRef({}),[k,$]=Ce({}),[D,P]=R.useState(""),[M,L]=Ce({}),A=e==null?void 0:e.searchParams.get("dependentComponentsMode"),H=A==="readonly",B=R.useCallback(N=>{H&&h({blockletComponents:[]}),L(N)},[H,L,h]),X=R.useCallback((...N)=>{$(...N),g({blockletResource:""})},[]),J=s==="none"?(u==null?void 0:u.lastReleaseId)||"":s,[W,te]=R.useState(n==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const pe=R.useMemo(()=>{var N;return(N=u==null?void 0:u.blockletComponents)!=null&&N.some(Q=>Q.included)||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource]),G=[],Y=((d==null?void 0:d.children)||[]).filter(N=>{var Q;return(Q=N.meta.resource)==null?void 0:Q.exportApi}).filter(N=>!a||N.meta.did===a);Y.forEach(N=>{Zl({tabs:G,blocklet:N,t:c,ancestors:[d]})});const[F,oe]=R.useState((H1=G[0])==null?void 0:H1.value),ae=!V&&(i==null?void 0:i.status)==="published",Z=ae,ce=R.useMemo(()=>{const N={};return Object.keys(M).forEach(Q=>{const Oe=M[Q];Oe&&Oe.forEach(G0=>{N[G0]=!0})}),N},[M]),_=async()=>{if(J)try{const N=await w.getRelease({input:{did:d.meta.did,projectId:l,releaseId:J}});if(p(!1),!N.release){q.error("Release not found");return}n!=="view"&&(N.release.note=""),h(Q=>n0({...Q,...N.release,blockletVersion:n==="create"||n==="new-release"?ye.inc(N.release.blockletVersion,"patch"):N.release.blockletVersion},d)),m(N.release)}catch(N){p(!1),q.error(Ve(N))}},O=async()=>{if(l===U.UNOWNED_DID){h({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){q.error(c("blocklet.publish.errorTip.noDid"));return}try{const N=await w.getProject({input:{did:d.meta.did,projectId:l}});p(!1);const Q=N.project||{};Q.blockletVersion?(n==="create"||n==="new-release")&&ye.valid(Q.blockletVersion)&&(Q.blockletVersion=ye.inc(Q.blockletVersion,"patch")):Q.blockletVersion="1.0.0";const Oe=n0(Q,d);h(Oe)}catch(N){p(!1),q.error(Ve(N))}},ee=R.useCallback(async()=>{if(n==="view"){if(!J){q.error("Empty release id");return}await O(),await _();return}await O(),J&&(T(!0),await _())},[n,J]),Le=N=>{h({blockletComponents:N})};R.useEffect(()=>{ee()},[ee]),R.useEffect(()=>{if(l===U.UNOWNED_DID&&(n==="create"||n==="new-release")&&e){P(e.searchParams.get("logo")),h({blockletTitle:e.searchParams.get("title"),blockletDescription:e.searchParams.get("description"),blockletIntroduction:e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:e.searchParams.get("note")||"No note"});const N=e.searchParams.get("resources");try{const Q=JSON.parse(N);S(Q)}catch{}}},[h,l,e,n]);const _1=R.useMemo(()=>!!Object.keys(k).find(N=>!!k[N].length),[k]);if(!u&&y)return o.jsx(we,{});if(!u)return null;const B1=Y.find(N=>N.meta.did===F);if(Y.every(N=>N.status!=="running"))return o.jsx(be,{children:c("blocklet.publish.allComponentsNotRunning")});const U0=N=>{oe(N)},E1=e==null?void 0:e.searchParams.get("resourcesTitle"),A1=e==null?void 0:e.searchParams.get("componentsTitle"),Re=[{label:c("blocklet.publish.branding"),description:c("blocklet.publish.steps.branding")},{label:c("common.introduction"),description:c("blocklet.publish.steps.introduction")},{label:E1||c("blocklet.publish.resourceTitle"),description:c("blocklet.publish.steps.resources")},{label:A1||c("common.components"),description:c("blocklet.publish.steps.blocklets")},{label:c("blocklet.publish.versionTitle"),description:c("blocklet.publish.steps.version")}],W0=Re[W]||Re[Re.length-1],ve=e3[W];return o.jsxs(t3,{...t,children:[o.jsx(A0,{blocklet:d,release:i,getData:ee,getRelease:_,mode:n,params:u,setParams:h,setParamsErrTip:g,readOnly:Z,isPublished:ae,loading:y,setLoading:p,initLogoUrl:D,releaseId:J,projectId:l,projectType:pe,resourceComponents:Y,resourceComponentsMap:M,resourceRelateComponents:ce,resourceItem:B1,saveSelectedEventsRef:I,hasSelectedResources:_1,releaseUsedLast:V,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(F0,{steps:Re,viewMode:n==="view",params:u,hasSelectedResources:_1||u.uploadedResource,paramsErrTip:x,activeStep:W,setActiveStep:te,projectId:l,resourcesUrlTitle:E1,componentsUrlTitle:A1}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&ve!=="introduction"&&o.jsxs(K,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[W0.label,ve==="branding"&&o.jsx(fe,{title:c("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{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:o.jsx(g2,{})})})]}),(v||ve==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(_0,{projectId:l,setParams:h,setParamsErrTip:g,params:u,componentDid:a,blocklet:d,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Z,initLogoUrl:D,setInitLogoUrl:P})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(Ue,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:Z})}),(v||ve==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(O0,{loading:y,readOnly:Z,params:u,setParams:h,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Re[s0.resources].label}),o.jsx(z,{display:v||ve==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(O2,{onChange:()=>h({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(t1,{value:"select",disabled:Z,control:o.jsx(W1,{size:"small",checked:u.resourceFromSelect}),label:c("blocklet.publish.resourceSelect")}),o.jsx(t1,{value:"select",disabled:Z,control:o.jsx(W1,{size:"small",checked:!u.resourceFromSelect}),label:c("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!a&&o.jsx(j2,{tabs:G,current:F,onChange:U0,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(M1,{loading:y,initialResources:C,saveSelectedEventsRef:I,selectedResourceIds:k,setSelectedResourceIds:X,setResourceComponentsMap:B,error:x.blockletResource,app:d,readOnly:Z,component:B1,componentDid:a,initUrl:e,params:u,setParams:h,projectId:l===U.UNOWNED_DID?"":l,releaseUsedLast:V,release:{...i,id:J}})]}),!u.resourceFromSelect&&o.jsx(N1,{app:d,readOnly:Z,projectId:l===U.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:h,setParamsErrTip:g})]})})}),v&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Re[s0.blocklets].label}),(v||ve==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(w1,{projectType:pe,disabled:y||Z,app:d,value:(u==null?void 0:u.blockletComponents)||[],onChange:Le,resourceRelateComponents:ce,dependentComponentsMode:A})})})}),!v&&ve==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(Ue,{loading:y,params:u,paramsErrTip:x,setParams:h,setParamsErrTip:g,readOnly:Z})})]})]})]})]})}D1.propTypes={initUrl:f.object};D1.defaultProps={initUrl:null};const t3=ie.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{P as o,j as n,dj as z,dk as Z,dl as U,bt as b,M as q,u as B,r as $,dm as _,B as y,aI as C,bj as ee,F as W}from"./index-
|
|
1
|
+
import{P as o,j as n,dj as z,dk as Z,dl as U,bt as b,M as q,u as B,r as $,dm as _,B as y,aI as C,bj as ee,F as W}from"./index-CL2MuWgy.js";import{E as D}from"./fallback-rmTIFQSJ.js";import{R as oe,N as ne}from"./index-7WP5qycS.js";import{i as te,a as re,B as G,S as ie,u as ae,f as K,g as R,p as se,m as V,b as le,c as pe,H as de}from"./index-hKKO_ETj.js";import{d as ce}from"./ExpandMore-B8-mtsJf.js";import{A}from"./Avatar-B857twI0.js";function N({icon:e,size:t,sx:r,...a}){const i=[...Array.isArray(r)?r:[r]];if(t&&i.push({width:t,height:t}),a.variant||i.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),te(e))return n.jsx(A,{as:"span",...a,src:e,sx:i});if(re(e)){const u=t?.6*t+4:0;return n.jsx(A,{as:"span",...a,sx:i,children:n.jsx("iconify-icon",{icon:e,height:u||void 0})})}return e&&typeof e=="string"?(i.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),n.jsx(A,{as:"span",...a,sx:i,children:Array.from(e)[0]})):null}N.propTypes={icon:o.string.isRequired,size:o.number,sx:o.oneOfType([o.array,o.func,o.object])};N.defaultProps={size:null,sx:null};const ue=z();function S({theme:e,children:t}){const r=e?z(e):ue;return n.jsx(Z,{theme:r,children:t})}S.propTypes={children:o.any.isRequired,theme:o.object};S.defaultProps={theme:null};const fe=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const a=V(e,s=>{var d,c;const p=s.icon?n.jsx(N,{icon:s.icon}):null;if(s.items)return{id:`${t++}`,label:s.title,icon:p,children:s.items};let l={};return((d=s.link)!=null&&d.startsWith("http://")||(c=s.link)!=null&&c.startsWith("https://"))&&(l={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:n.jsx("a",{href:s.link,...l,children:s.title}),icon:p,link:s.link}},"items"),i=le(a),u=pe(i.map(s=>s.link));return{navItems:a,activeId:u>=0?i[u].id:null}};function P({meta:e,addons:t,sessionManagerProps:r,homeLink:a,theme:i,hideNavMenu:u,...s}){var m,M;ae();const{locale:p}=B()||{},l=$.useMemo(()=>{const w=Object.assign({},window.blocklet,e);try{return K(w)}catch(X){return console.error("Failed to format blocklet info",X,w),w}},[e]);if(!l.appName)return null;const{appLogo:d,appLogoRect:c,theme:h}=l,f=R((m=l==null?void 0:l.navigation)==null?void 0:m.header,p),k=fe(f),{navItems:g,activeId:v}=k,j=typeof t=="function"?w=>t(w,{navigation:k}):t,x=n.jsx(de,{formattedBlocklet:l,addons:j,sessionManagerProps:r});return n.jsx(S,{theme:i,children:n.jsx(me,{homeLink:a,logo:n.jsx("img",{src:c||d,alt:"logo"}),addons:x,..._(s,["bordered"]),$bordered:s==null?void 0:s.bordered,$bgcolor:(M=h==null?void 0:h.background)==null?void 0:M.header,children:u||!(g!=null&&g.length)?null:({isMobile:w})=>n.jsx(ne,{mode:w?"inline":"horizontal",activeId:v,items:g,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}P.propTypes={meta:G,addons:o.oneOfType([o.func,o.node]),sessionManagerProps:ie,homeLink:o.string,theme:o.object,hideNavMenu:o.bool};P.defaultProps={meta:{},addons:null,sessionManagerProps:{showRole:!0},homeLink:se,theme:null,hideNavMenu:!1};const me=b(oe)`
|
|
2
2
|
${({$bgcolor:e})=>`background-color: ${e||"#fff"};`}
|
|
3
3
|
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
4
4
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|