@abtnode/blocklet-services 1.16.33-beta-20241030-102817-90ad7cd5 → 1.16.33-beta-20241031-130110-767ce94a

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.
Files changed (244) hide show
  1. package/api/libs/connect/session.js +3 -3
  2. package/api/libs/kyc.js +5 -5
  3. package/api/libs/push-kit/index.js +6 -10
  4. package/api/middlewares/verify-sig.js +7 -35
  5. package/api/services/auth/connect/invite.js +1 -1
  6. package/api/services/auth/connect/login.js +2 -1
  7. package/api/services/auth/connect/update-kyc.js +1 -1
  8. package/api/services/auth/index.js +21 -0
  9. package/api/services/kyc/index.js +1 -1
  10. package/dist/assets/{Add-BuhvbaJP.js → Add-w8WVX4Xk.js} +1 -1
  11. package/dist/assets/{Alert-BXclFQiZ.js → Alert-DBECv8Dk.js} +1 -1
  12. package/dist/assets/{ArrowDropDown-D4RtOSAM.js → ArrowDropDown-D8HoHnV2.js} +1 -1
  13. package/dist/assets/Autocomplete-CopPr5fu.js +1 -0
  14. package/dist/assets/{Avatar-CU1PDmMK.js → Avatar-DxxyX-k_.js} +1 -1
  15. package/dist/assets/{ButtonGroup-DvLyOukY.js → ButtonGroup-C6tThDqG.js} +1 -1
  16. package/dist/assets/{CSSTransition-CmQ27wjk.js → CSSTransition-15IKQ8tC.js} +1 -1
  17. package/dist/assets/{CheckCircle-DK5rK4sE.js → CheckCircle-Dnb1dYCF.js} +1 -1
  18. package/dist/assets/{ChevronLeft-a4s0VWsi.js → ChevronLeft-CfHfbxYR.js} +1 -1
  19. package/dist/assets/{ChevronRight-D01XFLKN.js → ChevronRight-DfXjrDyG.js} +1 -1
  20. package/dist/assets/{Close-DoATUWkN.js → Close-CEHuSxMp.js} +1 -1
  21. package/dist/assets/{CloseOutlined-CZYzjcmU.js → CloseOutlined-DsS_G_PJ.js} +1 -1
  22. package/dist/assets/{Delete-Dk5UXao5.js → Delete-ZSqIrcgk.js} +1 -1
  23. package/dist/assets/{DeleteOutline-U-qMYbn7.js → DeleteOutline-Csn3uTIE.js} +1 -1
  24. package/dist/assets/{DialogContentText-CikEvQJO.js → DialogContentText-vfNBMZmk.js} +1 -1
  25. package/dist/assets/{Done-BoHYRzAH.js → Done-CemlqiD_.js} +1 -1
  26. package/dist/assets/{Download-BEBSlmlP.js → Download-BsmoTH3s.js} +1 -1
  27. package/dist/assets/{EditIcon-Bnrh7zQ2.js → EditIcon-CT0EaMpT.js} +1 -1
  28. package/dist/assets/{Error-C5Js2YKI.js → Error-B7k9iYaE.js} +1 -1
  29. package/dist/assets/{ExpandMore-D33RJFod.js → ExpandMore-D9r_eS88.js} +1 -1
  30. package/dist/assets/{FormControl-DMRdCQLs.js → FormControl-BjU2NH3y.js} +1 -1
  31. package/dist/assets/{FormControlLabel-CdNVqVaq.js → FormControlLabel-C2gffv1J.js} +1 -1
  32. package/dist/assets/{FormGroup-LumLdi1D.js → FormGroup-Bd3iPgM5.js} +1 -1
  33. package/dist/assets/{Google-CMj00R2G.js → Google-CQo1jg-a.js} +1 -1
  34. package/dist/assets/{Grid-DacUFAHC.js → Grid-G51OChUI.js} +1 -1
  35. package/dist/assets/{HelpOutline-CM2PJrIe.js → HelpOutline-Bn776zsn.js} +1 -1
  36. package/dist/assets/{Hidden-CBqApxXF.js → Hidden-LUQhZs-w.js} +1 -1
  37. package/dist/assets/{InfoOutlined-CQWaSksy.js → InfoOutlined-CDz5Mhp6.js} +1 -1
  38. package/dist/assets/{InputAdornment-DLVtE-Lr.js → InputAdornment-CRVgwkQ9.js} +1 -1
  39. package/dist/assets/{LastPage-Co36cDpZ.js → LastPage-B8G6wH6k.js} +1 -1
  40. package/dist/assets/{Launch-BjLFGpiP.js → Launch-mty9jus0.js} +1 -1
  41. package/dist/assets/{LaunchOutlined-Bz7FdIr3.js → LaunchOutlined-DVo-QKmK.js} +1 -1
  42. package/dist/assets/{Link-NcbVNOUv.js → Link-BMMtX5fH.js} +1 -1
  43. package/dist/assets/{ListItemButton-CuEJfWpW.js → ListItemButton-DdNCGCpQ.js} +1 -1
  44. package/dist/assets/ListSubheader-BhMsFVX-.js +1 -0
  45. package/dist/assets/{LoadingButton-DWp6pXN_.js → LoadingButton-tO921QzP.js} +1 -1
  46. package/dist/assets/{LockIcon-Bz5V3mTh.js → LockIcon-DTU4giTY.js} +1 -1
  47. package/dist/assets/{Loop-DIqFtGpP.js → Loop-Bj3bQOI5.js} +1 -1
  48. package/dist/assets/{MarkEmailRead-DqFTE73J.js → MarkEmailRead-CZVFeLGG.js} +1 -1
  49. package/dist/assets/{Menu-BjwutyVD.js → Menu-CXWnBcF2.js} +1 -1
  50. package/dist/assets/{MoreHoriz-CXjEH64l.js → MoreHoriz-BwoEUpk-.js} +1 -1
  51. package/dist/assets/{MoreVert-PF1NggNP.js → MoreVert-BnSgpwk3.js} +1 -1
  52. package/dist/assets/{OpenInNew-BkifOq3K.js → OpenInNew-I9vejj1P.js} +1 -1
  53. package/dist/assets/{Pagination-BfrG7RfX.js → Pagination-DlLEi_8o.js} +1 -1
  54. package/dist/assets/{PlayArrow-CiWUQmI-.js → PlayArrow-7GIEwKnh.js} +1 -1
  55. package/dist/assets/{QuestionMarkCircle-BFMXM1VC.js → QuestionMarkCircle-CnAmHSAB.js} +1 -1
  56. package/dist/assets/{RadioGroup-DZefrQFL.js → RadioGroup-BT3WvzXu.js} +1 -1
  57. package/dist/assets/{Search-CzlBub2-.js → Search-DRpl0xea.js} +1 -1
  58. package/dist/assets/Select-TRN3ZncP.js +2 -0
  59. package/dist/assets/{ServerLogo-DCN1Dhrh.js → ServerLogo-BrH_z3Pg.js} +1 -1
  60. package/dist/assets/{Skeleton-5Emfs8wW.js → Skeleton-DSmjDa3c.js} +1 -1
  61. package/dist/assets/{Slider-J8U2Kw9e.js → Slider-GISyEXox.js} +1 -1
  62. package/dist/assets/{Stack-_Z2gAuxA.js → Stack-4MJdxh6I.js} +1 -1
  63. package/dist/assets/{Stepper-BitOpZXe.js → Stepper-Dvn_4zS7.js} +1 -1
  64. package/dist/assets/TextField-CQhkYpMM.js +1 -0
  65. package/dist/assets/{Toolbar-Bgc4EEaB.js → Toolbar-kIo5eXBU.js} +1 -1
  66. package/dist/assets/{ViewColumn-Ds3-xDVV.js → ViewColumn-CsFjsWag.js} +1 -1
  67. package/dist/assets/{ViewList-CeajtJGT.js → ViewList-Dw3g1bEO.js} +1 -1
  68. package/dist/assets/{access-control-DtFd3da7.js → access-control-BK21Lw2V.js} +1 -1
  69. package/dist/assets/{actions-BweC25e_.js → actions-CFxZdzF3.js} +1 -1
  70. package/dist/assets/{add-component-core-CDYLC0Tw.js → add-component-core-Bba0B_4h.js} +2 -2
  71. package/dist/assets/add-resource-DbOd4xW5.js +1 -0
  72. package/dist/assets/{addon-CPDaxNbn.js → addon-DdejitH8.js} +1 -1
  73. package/dist/assets/analytics-DnqUPS95.js +52 -0
  74. package/dist/assets/api-Bl2-YSti.js +1 -0
  75. package/dist/assets/{ar-CsWAxMD2.js → ar-DwhokVLj.js} +1 -1
  76. package/dist/assets/audit-logs-C8otdipr.js +58 -0
  77. package/dist/assets/{base32-B42sTZfk.js → base32-BBZELAoX.js} +1 -1
  78. package/dist/assets/branding-DU46ds73.js +37 -0
  79. package/dist/assets/{bundle-avatar-BdN0yF1i.js → bundle-avatar-CbTVaQ_M.js} +1 -1
  80. package/dist/assets/{button-CKBiMg-B.js → button-n_9jfCIf.js} +1 -1
  81. package/dist/assets/{click-to-copy-BR_BV1OB.js → click-to-copy-DptGmuUO.js} +1 -1
  82. package/dist/assets/{complete-ajBnay6M.js → complete-BNbCNTJu.js} +1 -1
  83. package/dist/assets/{component-BNsLhak7.js → component-DSUpigYV.js} +1 -1
  84. package/dist/assets/{config-Li44wRQx.js → config-77U-le3X.js} +1 -1
  85. package/dist/assets/{config-Cv2fsaLf.js → config-9il9cF0d.js} +1 -1
  86. package/dist/assets/{config-navigation-De6ukMqe.js → config-navigation-DcNUxLGX.js} +1 -1
  87. package/dist/assets/{confirm-ZZqOGxR9.js → confirm-C1rEM5YR.js} +1 -1
  88. package/dist/assets/{connect-DkucsoSu.js → connect-3dKIAigZ.js} +1 -1
  89. package/dist/assets/{connect-BrYdYlZO.js → connect-tHFesj8q.js} +1 -1
  90. package/dist/assets/{connect-to-BFbje_tX.js → connect-to-4aaJxXqE.js} +1 -1
  91. package/dist/assets/{content-layout-BxZnHkrN.js → content-layout-BM5SJrue.js} +1 -1
  92. package/dist/assets/{dashboard-BZ3VUNwp.js → dashboard-CzRyzKlc.js} +3 -3
  93. package/dist/assets/{de-mIS6PpQ1.js → de-CS8qZeoq.js} +1 -1
  94. package/dist/assets/{deprecate-DAqKso0o.js → deprecate-zsgH7k5s.js} +1 -1
  95. package/dist/assets/{did-address-9ZWWJ9us.js → did-address-DwWl4S12.js} +1 -1
  96. package/dist/assets/domain-BZTMEPUG.js +9 -0
  97. package/dist/assets/{domain-list-Dd9q9_FX.js → domain-list-DASDR2zI.js} +1 -1
  98. package/dist/assets/{email-nLCeenJ5.js → email-BHuQsqD5.js} +3 -3
  99. package/dist/assets/emotion-cache.browser.esm-DnONerVw.js +1 -0
  100. package/dist/assets/{es-SjtV3THj.js → es-xG0Pi6Vu.js} +1 -1
  101. package/dist/assets/{exchange-passport-BpXxYSLz.js → exchange-passport-BJnSn4h1.js} +1 -1
  102. package/dist/assets/{fallback-tJauburX.js → fallback-BpkT3yJa.js} +1 -1
  103. package/dist/assets/{form-text-input-CTYW53Jc.js → form-text-input-Dq-mYb-y.js} +1 -1
  104. package/dist/assets/format-error-Cm24Mb6K.js +2 -0
  105. package/dist/assets/{fr-ob22J7W8.js → fr-D_NT6aZ9.js} +1 -1
  106. package/dist/assets/{fuel-Cbs1bauD.js → fuel-C5E6gyYw.js} +1 -1
  107. package/dist/assets/{fullpage-BnlcD0xt.js → fullpage-Dv48OHgB.js} +1 -1
  108. package/dist/assets/{hi-CU_pVcX3.js → hi-gQURTn8d.js} +1 -1
  109. package/dist/assets/{home-uMe0Xd8s.js → home-Be9EmoGZ.js} +1 -1
  110. package/dist/assets/{id-B8NuutwY.js → id-CS1bsZtf.js} +1 -1
  111. package/dist/assets/{iframe-CbjJQorJ.js → iframe-Bn0BO1ke.js} +1 -1
  112. package/dist/assets/{index-CPSRMN2V.js → index-64TPCNae.js} +1 -1
  113. package/dist/assets/{index-9wo4TLHE.js → index-BE6Ke5gn.js} +1 -1
  114. package/dist/assets/{index-BKFM1Brp.js → index-BXfEXarc.js} +4 -4
  115. package/dist/assets/{index-V2YR34ND.js → index-BZiRGnQv.js} +1 -1
  116. package/dist/assets/{index-za03K8ah.js → index-Bi9C59qj.js} +4 -4
  117. package/dist/assets/{index-q29ib3lg.js → index-BiEAq9_T.js} +1 -1
  118. package/dist/assets/{index-CMUa3RBg.js → index-BoDR4F7z.js} +1 -1
  119. package/dist/assets/{index-1gRenUVL.js → index-BxmbivV2.js} +1 -1
  120. package/dist/assets/{index-D0CCI3Hl.js → index-C5OdroAa.js} +1 -1
  121. package/dist/assets/{index-jUk8eiQg.js → index-C8MAHjVt.js} +4 -4
  122. package/dist/assets/{index-DhN23b8j.js → index-CE6XlUwJ.js} +1 -1
  123. package/dist/assets/{index-DLEsNCDa.js → index-CEl72yMR.js} +1 -1
  124. package/dist/assets/{index-fQjWAgEu.js → index-CcoKjcPZ.js} +1 -1
  125. package/dist/assets/index-CmJqc_pr.js +291 -0
  126. package/dist/assets/{index-BESmlIJN.js → index-CqcHIeW4.js} +1 -1
  127. package/dist/assets/{index-CpDWCbHl.js → index-CrwNbpvE.js} +1 -1
  128. package/dist/assets/{index-BnR2tZ2P.js → index-CspPySnp.js} +1 -1
  129. package/dist/assets/{index-l7q9RzCB.js → index-D3Zi9XXS.js} +1 -1
  130. package/dist/assets/index-D41Nns21.js +4 -0
  131. package/dist/assets/{index-CgcN3n1w.js → index-D47v1fSP.js} +1 -1
  132. package/dist/assets/{index-BeGBbMtZ.js → index-D6JzGLsD.js} +1 -1
  133. package/dist/assets/{index-ZPdYa2mE.js → index-DCK3Y1u2.js} +1 -1
  134. package/dist/assets/{index-5jUNfq2w.js → index-DKCt9nfb.js} +1 -1
  135. package/dist/assets/index-DOuJwOay.js +1 -0
  136. package/dist/assets/{index-DIbwkm1o.js → index-DV0GJZ_u.js} +1 -1
  137. package/dist/assets/{index-Dqnh1P99.js → index-DgopjaBb.js} +1 -1
  138. package/dist/assets/{index-BznqT-_F.js → index-DvpaD3gO.js} +1 -1
  139. package/dist/assets/{index-6CQyAonv.js → index-E4hQM_9u.js} +1 -1
  140. package/dist/assets/{index-DCI63HkD.js → index-K2rlHa7x.js} +1 -1
  141. package/dist/assets/{index-DDZurhZd.js → index-Lpzdluz-.js} +1 -1
  142. package/dist/assets/{index-CrSEovwq.js → index-S4zyOh_f.js} +1 -1
  143. package/dist/assets/{index-BGmpmx3x.js → index-e_suJSDw.js} +4 -4
  144. package/dist/assets/{index-DTcrDWp-.js → index-pFa-OI2-.js} +4 -4
  145. package/dist/assets/{index-BabxtPtb.js → index-sZdRdnSY.js} +1 -1
  146. package/dist/assets/{index-ByltTxdd.js → index-tbzY0Oht.js} +1 -1
  147. package/dist/assets/{index.es-DWfi6Qx5.js → index.es-DUZKvvbB.js} +1 -1
  148. package/dist/assets/{invitation-Da4HnJYZ.js → invitation-_z1Xj-DN.js} +1 -1
  149. package/dist/assets/{invite-BhdJhhrG.js → invite-BICcMHub.js} +1 -1
  150. package/dist/assets/{isEmail-C6vUUtvk.js → isEmail-DVQRhME2.js} +1 -1
  151. package/dist/assets/{issue-passport-D1kt4vfn.js → issue-passport-F092lKT7.js} +1 -1
  152. package/dist/assets/{item-DH_a0xKg.js → item-58VHQKdW.js} +1 -1
  153. package/dist/assets/{ja-Uy7OpVJX.js → ja-dRhtFh3i.js} +1 -1
  154. package/dist/assets/{jss-plugin-props-sort.esm-BTobZ28x.js → jss-plugin-props-sort.esm-DD0RfxgD.js} +1 -1
  155. package/dist/assets/{ko-DaCQeMuZ.js → ko-Bf5brKj6.js} +1 -1
  156. package/dist/assets/{launch-result-message-BCT6Ot6g.js → launch-result-message-DovJkIwn.js} +1 -1
  157. package/dist/assets/{layout-wzlST3sB.js → layout-CX--ufXj.js} +1 -1
  158. package/dist/assets/{list-header-B9lGrwQq.js → list-header-CK7gsYNw.js} +1 -1
  159. package/dist/assets/localization-B6LrUnQq.js +1 -0
  160. package/dist/assets/{log-c_vjKf4-.js → log-DVdMrPJd.js} +26 -14
  161. package/dist/assets/{login-C-IH9OwE.js → login-DQc63E-c.js} +1 -1
  162. package/dist/assets/{login-oauth-callback-eSuKsGqY.js → login-oauth-callback-DD7JbhiI.js} +1 -1
  163. package/dist/assets/logo-uploader-BDLcfxYH.js +133 -0
  164. package/dist/assets/{lost-passport-C-AXpR8L.js → lost-passport-DKxLM9Ug.js} +3 -3
  165. package/dist/assets/{lottie-DCxZqQ_w.js → lottie-AeAuO2MQ.js} +1 -1
  166. package/dist/assets/{notifications-Cu8vodw6.js → notifications-Bn5ZHzBu.js} +1 -1
  167. package/dist/assets/{open-window-XrtqitVi.js → open-window-5NGDF8DC.js} +1 -1
  168. package/dist/assets/overview-DTsJPc6k.js +12 -0
  169. package/dist/assets/{page-header-DSbeB9Fw.js → page-header-COehVty5.js} +1 -1
  170. package/dist/assets/{permission-B0oNf0ui.js → permission-Cqge6JOf.js} +1 -1
  171. package/dist/assets/{preferences-DrN4bxay.js → preferences-DA8lJH35.js} +1 -1
  172. package/dist/assets/{pt-BOxpawqS.js → pt-DT1ewc-i.js} +1 -1
  173. package/dist/assets/publish-resource-kamh1Zx5.js +1 -0
  174. package/dist/assets/{raf-schd.esm-Bvs1xTwL.js → raf-schd.esm-BfaLZ_aP.js} +1 -1
  175. package/dist/assets/{react-beautiful-dnd.esm-C4IOCC-P.js → react-beautiful-dnd.esm-1g48s8ci.js} +1 -1
  176. package/dist/assets/refType-Dpwlu3pw.js +1 -0
  177. package/dist/assets/{resource-dialog-99NEwTiv.js → resource-dialog-BHy7M0SS.js} +1 -1
  178. package/dist/assets/{ru-6GVtb7_u.js → ru-Bu6fUIp5.js} +1 -1
  179. package/dist/assets/sdk-De7qEvqq.js +1 -0
  180. package/dist/assets/{selector-MezacA1q.js → selector-B78wSPTM.js} +1 -1
  181. package/dist/assets/session-C7vFWF9o.js +1 -0
  182. package/dist/assets/setup-GIymuFZc.js +19 -0
  183. package/dist/assets/{shorten-label-CQ54B6Xf.js → shorten-label-DJCp0Yiv.js} +1 -1
  184. package/dist/assets/simple-select-b5ivFPVt.js +1 -0
  185. package/dist/assets/{slicedToArray-2MvrTDlG.js → slicedToArray-BApf6A7a.js} +1 -1
  186. package/dist/assets/{spaces-CwozzHvw.js → spaces-9zBZHE2B.js} +1 -1
  187. package/dist/assets/{start-CYThcgLA.js → start-CnjLydkf.js} +1 -1
  188. package/dist/assets/{step-actions-KZZKBOwF.js → step-actions-8KY-8Bex.js} +1 -1
  189. package/dist/assets/{studio-DkK4Pm_e.js → studio-X7Nwx0dT.js} +1 -1
  190. package/dist/assets/{switch-control-BKbjlOCN.js → switch-control-GexWf5e4.js} +1 -1
  191. package/dist/assets/{th-Dv20telW.js → th-Dc8W01H6.js} +1 -1
  192. package/dist/assets/{toUpper-DuakUn5q.js → toUpper-DTfkR7-6.js} +1 -1
  193. package/dist/assets/{transfer-DkFaqhXx.js → transfer-Bhn-x9WX.js} +1 -1
  194. package/dist/assets/{trim-JoNmnE5P.js → trim-BZY-1hvK.js} +1 -1
  195. package/dist/assets/{uniqBy-CHDL8lL5.js → uniqBy-BcDiFdXx.js} +1 -1
  196. package/dist/assets/{unsubscribe-y6XXWIyY.js → unsubscribe-D5MNNVO_.js} +1 -1
  197. package/dist/assets/{url-join-eN9RCMAk.js → url-join-D63J6Csv.js} +1 -1
  198. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-iWGqHiMP.js → use-blocklet-info-for-connect-did-spaces-DeEGMQDm.js} +1 -1
  199. package/dist/assets/{use-mobile-CiITr0-o.js → use-mobile-C2Zyl0Iw.js} +1 -1
  200. package/dist/assets/{useAsync-jXWdbUYl.js → useAsync-WIvo8QcA.js} +1 -1
  201. package/dist/assets/{useFormControl-CWHopALS.js → useFormControl-c0TPHUQp.js} +1 -1
  202. package/dist/assets/{useLocalStorage-CJN2xbTj.js → useLocalStorage-BhDOt9DJ.js} +1 -1
  203. package/dist/assets/{useSetState-Ybjugw6L.js → useSetState-DRBw6Ay4.js} +1 -1
  204. package/dist/assets/{useSlot-C3ETjnzl.js → useSlot-BtZjkxjI.js} +1 -1
  205. package/dist/assets/{useSlotProps-D38Z1cUG.js → useSlotProps-D77uQwOK.js} +1 -1
  206. package/dist/assets/{useThemeProps-gYu-cV7d.js → useThemeProps-BoD_v9_f.js} +1 -1
  207. package/dist/assets/user-center-DQH4PW1L.js +1 -0
  208. package/dist/assets/{user-sessions-Befk5-7A.js → user-sessions-BjEKb9RA.js} +1 -1
  209. package/dist/assets/{util-DDS66i8y.js → util-BwLN-7fK.js} +1 -1
  210. package/dist/assets/{vi-B-VzHaKw.js → vi-CO4j8X-h.js} +1 -1
  211. package/dist/assets/wrap-locale-fQx_G_1w.js +1 -0
  212. package/dist/assets/{zh-DDshC-kD.js → zh-D3BaPKV5.js} +2 -2
  213. package/dist/assets/zh-tw-18T4kLe_.js +1 -0
  214. package/dist/assets/{zh-tw-BmDuFoYe.js → zh-tw-B7-6_fNO.js} +1 -1
  215. package/dist/index.html +1 -1
  216. package/dist/service-worker.js +1 -1
  217. package/package.json +32 -32
  218. package/dist/assets/Autocomplete-BbGrVwpO.js +0 -1
  219. package/dist/assets/InputLabel-Dv8rQIGD.js +0 -1
  220. package/dist/assets/Select-DxrI6-_0.js +0 -2
  221. package/dist/assets/TextField-Dihuo-6c.js +0 -1
  222. package/dist/assets/add-resource-eVrxsxaG.js +0 -1
  223. package/dist/assets/analytics-Dg2f8YYT.js +0 -52
  224. package/dist/assets/api-DzBlSnp2.js +0 -1
  225. package/dist/assets/audit-logs-DqcEaLyQ.js +0 -58
  226. package/dist/assets/branding-Dq4U1t76.js +0 -37
  227. package/dist/assets/domain-DNZWHRFW.js +0 -9
  228. package/dist/assets/emotion-cache.browser.esm-CaQ5ewfb.js +0 -1
  229. package/dist/assets/format-error-DCY2LFso.js +0 -2
  230. package/dist/assets/index-CGL-74vO.js +0 -293
  231. package/dist/assets/index-CwySuP27.js +0 -1
  232. package/dist/assets/index-uQgDHjXg.js +0 -4
  233. package/dist/assets/localization-DFFNMipy.js +0 -1
  234. package/dist/assets/logo-uploader-B5gBP8jD.js +0 -133
  235. package/dist/assets/overview-CQnix0I1.js +0 -12
  236. package/dist/assets/publish-resource-CMGOF2oO.js +0 -1
  237. package/dist/assets/refType-CzADmYx1.js +0 -1
  238. package/dist/assets/sdk-Dyx3NlaH.js +0 -1
  239. package/dist/assets/session-BjbXU0q-.js +0 -1
  240. package/dist/assets/setup-DmKj9hXW.js +0 -19
  241. package/dist/assets/simple-select-B0Xi7RXx.js +0 -1
  242. package/dist/assets/user-center-CsNNFoPX.js +0 -1
  243. package/dist/assets/wrap-locale-CbLkBXWp.js +0 -1
  244. package/dist/assets/zh-tw-BnNsaJba.js +0 -1
@@ -1 +1 @@
1
- import{fq as _e,aK as R,r as g,aJ as B,aH as F,dr as Z,eF as Ee,aM as ee,j as s,G as ae,aP as W,u as z,T as E,au as $e,a1 as te,n as q,fp as De,P as i,X as H,Y as V,aY as Ne,aj as Pe,b as D,t as $,aa as Ie,aR as Me,aT as ne,B as N,eT as ce,c as L,l as Le,eu as ze,a as qe}from"./index-BKFM1Brp.js";import{d as Oe}from"./Add-BuhvbaJP.js";import{L as Be,d as Ue}from"./MoreVert-PF1NggNP.js";import{D as Ae}from"./DialogContentText-CikEvQJO.js";import{T as le}from"./TextField-Dihuo-6c.js";import{A as de}from"./Alert-BXclFQiZ.js";import{f as O}from"./format-error-DCY2LFso.js";import{d as ue}from"./Launch-BjLFGpiP.js";import{d as Fe}from"./Done-BoHYRzAH.js";import{d as fe}from"./DeleteOutline-U-qMYbn7.js";import{C as We}from"./click-to-copy-BR_BV1OB.js";import{S as He}from"./shorten-label-CQ54B6Xf.js";import{u as Ve,C as pe}from"./confirm-ZZqOGxR9.js";import{u as Ge}from"./session-BjbXU0q-.js";import{W as Je}from"./did-address-9ZWWJ9us.js";import{A as Ke}from"./Avatar-CU1PDmMK.js";import{B as se}from"./ButtonGroup-DvLyOukY.js";import{f as Ye,j as Xe,a as Qe,c as Ze,d as et,b as tt,e as nt,g as st,h as rt}from"./jss-plugin-props-sort.esm-BTobZ28x.js";const ot=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function it(e={}){const{disableGlobal:r=!1,productionPrefix:n="jss",seed:t=""}=e,o=t===""?"":`${t}-`;let u=0;const d=()=>(u+=1,u);return(c,l)=>{const a=l.options.name;if(a&&a.indexOf("Mui")===0&&!l.options.link&&!r){if(ot.indexOf(c.key)!==-1)return`Mui-${c.key}`;const f=`${o}${a}-${c.key}`;return!l.options.theme[_e]||t!==""?f:`${f}-${d()}`}return`${o}${n}${d()}`}}function at(){return{plugins:[Ye(),Xe(),Qe(),Ze(),et(),typeof window>"u"?null:tt(),nt()]}}function me(e={}){const{baseClasses:r,newClasses:n,Component:t}=e;if(!n)return r;const o=R({},r);return Object.keys(n).forEach(u=>{n[u]&&(o[u]=`${r[u]} ${n[u]}`)}),o}const M={set:(e,r,n,t)=>{let o=e.get(r);o||(o=new Map,e.set(r,o)),o.set(n,t)},get:(e,r,n)=>{const t=e.get(r);return t?t.get(n):void 0},delete:(e,r,n)=>{e.get(r).delete(n)}},ct=st(at()),lt=it(),dt=new Map,ut={disableGeneration:!1,generateClassName:lt,jss:ct,sheetsCache:null,sheetsManager:dt,sheetsRegistry:null},ft=g.createContext(ut);let re=-1e9;function pt(){return re+=1,re}const mt=["variant"];function oe(e){return e.length===0}function ht(e){const{variant:r}=e,n=B(e,mt);let t=r||"";return Object.keys(n).sort().forEach(o=>{o==="color"?t+=oe(t)?e[o]:F(e[o]):t+=`${oe(t)?o:F(o)}${F(e[o].toString())}`}),t}const gt={};function xt(e){const r=typeof e=="function";return{create:(n,t)=>{let o;try{o=r?e(n):e}catch(l){throw l}if(!t||!n.components||!n.components[t]||!n.components[t].styleOverrides&&!n.components[t].variants)return o;const u=n.components[t].styleOverrides||{},d=n.components[t].variants||[],c=R({},o);return Object.keys(u).forEach(l=>{c[l]=Z(c[l]||{},u[l])}),d.forEach(l=>{const a=ht(l.props);c[a]=Z(c[a]||{},l.style)}),c},options:{}}}const vt=["name","classNamePrefix","Component","defaultTheme"];function yt({state:e,stylesOptions:r},n,t){if(r.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let o=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,o=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,o=!0),o&&(e.cacheClasses.value=me({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:t})),e.cacheClasses.value}function jt({state:e,theme:r,stylesOptions:n,stylesCreator:t,name:o},u){if(n.disableGeneration)return;let d=M.get(n.sheetsManager,t,r);d||(d={refs:0,staticSheet:null,dynamicStyles:null},M.set(n.sheetsManager,t,r,d));const c=R({},t.options,n,{theme:r,flip:typeof n.flip=="boolean"?n.flip:r.direction==="rtl"});c.generateId=c.serverGenerateClassName||c.generateClassName;const l=n.sheetsRegistry;if(d.refs===0){let a;n.sheetsCache&&(a=M.get(n.sheetsCache,t,r));const f=t.create(r,o);a||(a=n.jss.createStyleSheet(f,R({link:!1},c)),a.attach(),n.sheetsCache&&M.set(n.sheetsCache,t,r,a)),l&&l.add(a),d.staticSheet=a,d.dynamicStyles=rt(f)}if(d.dynamicStyles){const a=n.jss.createStyleSheet(d.dynamicStyles,R({link:!0},c));a.update(u),a.attach(),e.dynamicSheet=a,e.classes=me({baseClasses:d.staticSheet.classes,newClasses:a.classes}),l&&l.add(a)}else e.classes=d.staticSheet.classes;d.refs+=1}function St({state:e},r){e.dynamicSheet&&e.dynamicSheet.update(r)}function Ct({state:e,theme:r,stylesOptions:n,stylesCreator:t}){if(n.disableGeneration)return;const o=M.get(n.sheetsManager,t,r);o.refs-=1;const u=n.sheetsRegistry;o.refs===0&&(M.delete(n.sheetsManager,t,r),n.jss.removeStyleSheet(o.staticSheet),u&&u.remove(o.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),u&&u.remove(e.dynamicSheet))}function bt(e,r){const n=g.useRef([]);let t;const o=g.useMemo(()=>({}),r);n.current!==o&&(n.current=o,t=e()),g.useEffect(()=>()=>{t&&t()},[o])}function G(e,r={}){const{name:n,classNamePrefix:t,Component:o,defaultTheme:u=gt}=r,d=B(r,vt),c=xt(e),l=n||t||"makeStyles";return c.options={index:pt(),name:n,meta:l,classNamePrefix:l},(f={})=>{const h=Ve()||u,v=R({},g.useContext(ft),d),S=g.useRef(),p=g.useRef();return bt(()=>{const C={name:n,state:{},stylesCreator:c,stylesOptions:v,theme:h};return jt(C,f),p.current=!1,S.current=C,()=>{Ct(C)}},[h,c]),g.useEffect(()=>{p.current&&St(S.current,f),p.current=!0}),yt(S.current,f.classes,o)}}const wt=["name"],Rt=["children","className","clone","component"];function kt(e,r){const n={};return Object.keys(e).forEach(t=>{r.indexOf(t)===-1&&(n[t]=e[t])}),n}function Tt(e){return(n,t={})=>{const{name:o}=t,u=B(t,wt);let d=o;const l=G(typeof n=="function"?h=>({root:v=>n(R({theme:h},v))}):{root:n},R({Component:e,name:o||e.displayName,classNamePrefix:d},u));let a;n.filterProps&&(a=n.filterProps,delete n.filterProps),n.propTypes&&(n.propTypes,delete n.propTypes);const f=g.forwardRef(function(v,S){const{children:p,className:y,clone:C,component:w}=v,j=B(v,Rt),m=l(v),b=ee(m.root,y);let k=j;if(a&&(k=kt(k,a)),C)return g.cloneElement(p,R({className:ee(p.props.className,b)},k));if(typeof p=="function")return p(R({className:b},k));const T=w||e;return s.jsx(T,R({ref:S,className:b},k,{children:p}))});return Ee(f,e),f}}const{NODE_MODES:ie}=ae,_t=({mode:e,previousMode:r}={})=>e===ie.SERVERLESS||r===ie.SERVERLESS;var Et={isInServerlessMode:_t};const $t=G(e=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}));function he({disabled:e,storeList:r,teamDid:n,onAdd:t,scope:o,hiddenChildren:u,open:d,onClose:c}){const{api:l}=W(),[a,f]=g.useState(!1),[h,v]=g.useState(!0),[S,p]=g.useState(!1),[y,C]=g.useState(""),[w,j]=g.useState(""),{t:m}=z(),b=$t(),k=async()=>{f(!0);try{const{decoded:x}=De(y,r);await l.addBlockletStore({input:{teamDid:n,url:x,scope:o}}),t(x),p(!1),c()}catch(x){const P=`${m("store.blockletRegistry.addFailed")} ${O(x)}`;j(P)}finally{f(!1)}},T=()=>{p(!1),c()};return s.jsxs(s.Fragment,{children:[!u&&s.jsxs(Be,{button:!0,disabled:e,className:b.addMenuItemRoot,onClick:()=>{p(!0)},children:[s.jsx(Oe,{font:!0}),s.jsx(E,{variant:"inherit",children:m("store.blockletRegistry.addRegistry")})]}),s.jsxs($e,{title:m("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:d||S,onClose:T,PaperProps:{style:{minHeight:"auto"}},actions:s.jsxs(s.Fragment,{children:[s.jsx(te,{onClick:x=>{x.stopPropagation(),T()},color:"inherit",children:m("common.cancel")}),s.jsxs(te,{onClick:x=>{x.stopPropagation(),k()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a||!y||h,variant:"contained",autoFocus:!0,children:[a&&s.jsx(q,{size:16}),m("common.confirm")]})]}),children:[s.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:s.jsx(Ae,{component:"div",children:s.jsx(E,{component:"div",children:s.jsx(le,{label:m("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:y,onChange:x=>{j(null);let P=!1;x.target.value.trim()||(P=!0),x.target.value.trim()||j(m("store.blockletRegistry.registryUrlEmpty")),C(x.target.value),v(P)},disabled:a,onKeyPress:x=>{x.key==="Enter"&&(x.preventDefault(),x.target.value.trim()?k():j(m("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!w&&s.jsx(de,{severity:"error",style:{width:"100%"},children:w})]})]})}he.propTypes={teamDid:i.string.isRequired,disabled:i.bool,storeList:i.array,onAdd:i.func,scope:i.string,hiddenChildren:i.bool,open:i.bool,onClose:i.func};he.defaultProps={disabled:!1,storeList:[],onAdd:()=>{},scope:"",hiddenChildren:!1,open:!1,onClose:()=>{}};var J={},Dt=V;Object.defineProperty(J,"__esModule",{value:!0});var ge=J.default=void 0,Nt=Dt(H()),Pt=s;ge=J.default=(0,Nt.default)((0,Pt.jsx)("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}),"LinkOutlined");var K={},It=V;Object.defineProperty(K,"__esModule",{value:!0});var xe=K.default=void 0,Mt=It(H()),Lt=s;xe=K.default=(0,Mt.default)((0,Lt.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.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"BackupOutlined");function Y({title:e,description:r,confirmPlaceholder:n,cancel:t,confirm:o,params:u,onCancel:d,onConfirm:c,keyName:l}){const{t:a}=z(),f={title:()=>s.jsxs("div",{children:[e,s.jsx(He,{sx:{fontSize:"14px"},maxLength:64,children:` (${l})`})]}),description:(h,v)=>{const S=p=>{v({...p,__disableConfirm:p.__disableConfirm})};return s.jsxs("div",{children:[s.jsx(de,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),s.jsx("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:r}}),s.jsxs("div",{style:{marginBottom:24},children:[a("common.click"),":",s.jsx(We,{"data-cy":"click-copy",children:l})]}),s.jsx(E,{component:"div",children:s.jsx(le,{label:n,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:h.inputVal,onChange:p=>{S({...h,inputVal:p.target.value,__disableConfirm:l!==p.target.value})}})})]})},confirm:o,cancel:t,onConfirm:c,onCancel:d,params:{inputVal:"",__disableConfirm:!0,...u}};return s.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}Y.propTypes={title:i.any.isRequired,keyName:i.any.isRequired,description:i.any.isRequired,confirmPlaceholder:i.any.isRequired,cancel:i.string,confirm:i.string,params:i.object,onCancel:i.func,onConfirm:i.func.isRequired};Y.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}};function A({store:e,teamDid:r,onDelete:n,children:t,projectId:o="",scope:u=""}){const{api:d}=W(),{t:c}=z(),l=Ne(),[a,f]=g.useState(!1),[h,v]=g.useState(null),S=Pe(),p=()=>{f(!1),v(null)},y=async()=>{try{f(!0),await d.deleteBlockletStore({input:{teamDid:r,url:e.url,projectId:o,scope:u}}),await(l==null?void 0:l.actions.refreshBlocklet()),n&&typeof n=="function"&&n()}catch(j){$.error(`Remove Blocklet Store Error: ${O(j)}`)}finally{f(!1),v(null)}},C={keyName:e.url,title:c("store.blockletRegistry.deleteRegistry"),description:c("store.blockletRegistry.deleteDesc",{name:`<b>${e.url}</b>`,color:S.palette.error.main}),confirmPlaceholder:c("store.blockletRegistry.confirmDesc",{name:e.url}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:y,onCancel:p},w=j=>{e.protected||(j.stopPropagation(),v(C))};return s.jsxs(s.Fragment,{children:[t?s.jsx("span",{onClick:w,children:t}):s.jsx(D,{color:"primary",disabled:a,onClick:w,size:"small",children:s.jsx(fe,{sx:{zoom:.95}})}),h&&s.jsx(Y,{keyName:h.keyName,title:h.title,description:h.description,confirmPlaceholder:h.confirmPlaceholder,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}A.propTypes={children:i.node,teamDid:i.string.isRequired,store:i.object.isRequired,onDelete:i.func,projectId:i.string,scope:i.string};A.defaultProps={children:null,projectId:"",scope:"",onDelete:()=>{}};var X={},zt=V;Object.defineProperty(X,"__esModule",{value:!0});var ve=X.default=void 0,qt=zt(H()),Ot=s;ve=X.default=(0,qt.default)((0,Ot.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff");const Bt=({store:e,userDid:r})=>{var t;const n=((t=window.blocklet)==null?void 0:t.tenantMode)!==Ie.BLOCKLET_TENANT_MODES.MULTIPLE;return e.protected?!1:e.scope&&e.scope===r?!0:n?e.scope==="studio":!1};function Q({connectedStore:e,onDisconnect:r,onDelete:n,store:t,teamDid:o,projectId:u}){var j;const[d,c]=g.useState(null),l=!!d,{t:a}=z(),{session:f}=Ge(),[h,v]=g.useState(!1),S=m=>{if(m.stopPropagation(),e!=null&&e.developerDid){const b=ce.from(JSON.stringify({forceConnected:e==null?void 0:e.developerDid}),"utf8").toString("base64");window.open(`${L(t.url,"developer/blocklets")}?__did-connect__=${b}`)}else window.open(`${L(t.url,"developer/blocklets")}`)},p=m=>{c(m.currentTarget)},y=()=>{c(null)},C=()=>{v(!1),r()},w=[{label:a("common.visitStore"),action:S,icon:ue},{label:a("common.disconnect"),action:()=>{y(),v(!0)},icon:ve,hidden:!e}];return s.jsxs(s.Fragment,{children:[s.jsx(D,{ref:d,color:"primary",onClick:p,size:"small",children:s.jsx(Ue,{sx:{zoom:.95}})}),s.jsxs(Me,{anchorEl:d,open:l,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[w.map(m=>m.hidden?null:s.jsxs(ne,{dense:!0,onClick:m.action,disabled:m.disabled,children:[m.icon&&s.jsx(m.icon,{color:"action",sx:{marginRight:1}}),s.jsx(N,{color:"action",children:m.label})]},m.label)),Bt({store:t,userDid:(j=f==null?void 0:f.user)==null?void 0:j.did})&&s.jsx(A,{store:t,onDelete:n,teamDid:o,projectId:u,scope:t.scope||"studio",children:s.jsxs(ne,{dense:!0,disabled:t.protected,children:[s.jsx(fe,{sx:{color:t.protected?"action":"error.main",marginRight:1}}),s.jsx(N,{color:t.protected?"action":"error.main",children:a("common.delete")})]})})]}),h&&s.jsx(pe,{displayError:!0,title:`${a("common.disconnect")} ${t.name}`,description:a("blocklet.publish.disconnectStoreTip"),confirm:a("common.confirm"),onConfirm:C,onCancel:()=>v(!1)})]})}Q.propTypes={connectedStore:i.object.isRequired,onDisconnect:i.func,onDelete:i.func,store:i.object.isRequired,teamDid:i.string.isRequired,projectId:i.string};Q.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function Ut({messageType:e,onOpen:r,onClose:n}){const t=g.useRef(null),o=g.useRef(null),u=async c=>{setTimeout(()=>{try{n==null||n()}catch{}},10*1e3),t.current&&(clearInterval(o.current),t.current.close());const l=Math.random().toString(36).slice(2);t.current=window.open(`${ae.WELLKNOWN_SERVICE_PATH_PREFIX}/open-window?key=${l}`,"_blank"),r==null||r(t.current),o.current=setInterval(()=>{(!t.current||t.current.closed)&&(t.current=null,clearInterval(o.current),setTimeout(()=>{n==null||n()},1100))},200),await Promise.resolve(c(t.current,a=>{if(!t.current){localStorage.setItem(`open-window-url-${l}`,JSON.stringify({url:a,time:Date.now()}));return}t.current.location.href=a}))},d=Le(c=>{const{type:l,error:a}=c.data;t.current&&l===e&&a&&($.error(a),n==null||n())});return g.useEffect(()=>(window.addEventListener("message",d),()=>{window.removeEventListener("message",d)}),[d]),u}function U({connectedStore:e,sx:r,...n}){return s.jsx(Ke,{sx:{width:24,height:24,...r},src:L(e.storeUrl,`/.well-known/service/user/avatar/${e.developerDid}?imageFilter=resize&w=120&h=120`),...n})}U.propTypes={connectedStore:i.object.isRequired,sx:i.object};U.defaultProps={sx:{}};function ye({storeUrl:e,storeName:r,developerDid:n,published:t}){const{t:o}=z(),u=()=>{if(n){const d=ce.from(JSON.stringify({forceConnected:n}),"utf8").toString("base64");window.open(`${L(e,"developer/blocklets")}?__did-connect__=${d}`)}else window.open(`${L(e,"developer/blocklets")}`)};return s.jsxs(N,{children:[s.jsx(E,{variant:"subtitle2",children:o(t?"blocklet.publish.publishToStoreSuccess":"blocklet.publish.uploadToStoreSuccess",{name:r})}),s.jsx(D,{size:"small",sx:{mt:1},onClick:u,variant:"contained",color:"success",children:o("common.visitTarget",{name:r})})]})}ye.propTypes={storeName:i.string.isRequired,storeUrl:i.string.isRequired,developerDid:i.string.isRequired,published:i.bool.isRequired};const je={CONNECT:"connect",SELECT:"select"},At=G(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),Ft=Tt(({className:e,...r})=>s.jsx(qe,{...r,classes:{popper:e}}))(({theme:e})=>({[`& .${ze.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:e.spacing(2),fontSize:e.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function Se({teamDid:e,projectId:r,releaseId:n,store:t,onDelete:o,kind:u,published:d,connectedStore:c,releaseType:l,onPublish:a,onOpenConnectStore:f,onSelectConnectStore:h,behavior:v,scope:S=""}){const p=At(),{t:y}=z(),{api:C,info:w,inService:j}=W(),[m,b]=g.useState(!1),k=Ut({messageType:"connect-store-message",onOpen:()=>b(!0),onClose:()=>b(!1)}),T=u==="publish",x=!!c,P=_=>{if(_.stopPropagation(),T){window.open(L(t.url,"developer/blocklets"));return}window.open(t.url)},Ce=()=>{if(v===je.SELECT){h(t);return}k(async(_,ke)=>{try{const I=await C.connectToStore({input:{did:e,storeUrl:t.url,storeId:t.id,storeName:t.name,projectId:r}});if(!(I!=null&&I.url)){$.error("failed to connect to store");return}ke(I.url),await f({did:e,projectId:r,storeId:t.id}),b(!1)}catch(I){const Te=O(I);$.error(Te),b(!1)}})},be=async()=>{try{await C.disconnectFromStore({input:{did:e,storeId:t.id,projectId:r,storeScope:S}}),o()}catch(_){$.error(O(_))}},we=()=>{b(!0),C.publishToStore({input:{did:e,storeId:t.id,storeName:t.name,projectId:r,releaseId:n,type:l}}).then(_=>{$.success(s.jsx(ye,{storeName:c.storeName,storeUrl:c.storeUrl,developerDid:c.developerDid,published:_.url==="published"}),{duration:1e4}),a==null||a(null)}).catch(_=>{$.error(O(_)),a==null||a(_)}).finally(()=>{b(!1)})};g.useEffect(()=>{x&&b(!1)},[x]);const Re=g.useMemo(()=>!(j&&Et.isInServerlessMode(w)),[j,w]);return s.jsxs("div",{className:p.box,children:[!T&&m&&s.jsx(q,{sx:{marginRight:2},size:16}),s.jsxs("div",{className:p.menuName,children:[s.jsx(N,{sx:{display:"flex",flexDirection:"row"},children:s.jsx(E,{component:"span",className:p.title,variant:"subtitle1",children:t.name})}),s.jsx(E,{className:p.url,component:"span",variant:"inherit",children:`${t.url}`})]}),s.jsxs("div",{className:p.actions,children:[c&&s.jsx(Ft,{placement:"top",title:s.jsxs(N,{children:[s.jsx(E,{component:"span",variant:"caption",sx:{opacity:.7},children:y("blocklet.publish.developerInfo")}),s.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[s.jsx(U,{connectedStore:c,sx:{width:42,height:42}}),s.jsxs(N,{sx:{flex:1},children:[s.jsx(E,{component:"span",variant:"subtitle1",children:c.developerName}),s.jsx(Je,{size:14,copyable:!0,compact:!0,responsive:!1,did:c.developerDid})]})]})]}),children:s.jsx("div",{children:s.jsx(U,{connectedStore:c,sx:{marginRight:1,cursor:"help"}})})}),T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:38},size:"small",children:[!x&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:Ce,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(ge,{sx:{marginRight:1}}),y("common.connect")]}),x&&d&&s.jsxs(D,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(Fe,{sx:{marginRight:1}}),y("common.uploaded")]}),x&&!d&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:we,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(xe,{sx:{marginRight:1,fontSize:20}}),y("common.upload")]}),s.jsx(Q,{projectId:r,connectedStore:c,store:t,onDelete:o,teamDid:e,onDisconnect:be})]}),!T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:36},size:"small",children:[s.jsx(D,{onClick:P,children:s.jsx(ue,{sx:{zoom:.9}})}),!t.protected&&Re&&s.jsx(A,{store:t,onDelete:o,teamDid:e,scope:""})]})]})]})}Se.propTypes={kind:i.string,teamDid:i.string.isRequired,published:i.bool,connectedStore:i.shape({storeName:i.string,storeId:i.string,storeUrl:i.string,developerDid:i.string,developerName:i.string}),projectId:i.string,releaseId:i.string,releaseType:i.string,store:i.shape({id:i.string.isRequired,name:i.string.isRequired,url:i.string.isRequired,protected:i.bool,connected:i.bool}).isRequired,scope:i.string,onDelete:i.func,onPublish:i.func,onOpenConnectStore:i.func,behavior:i.string,onSelectConnectStore:i.func};Se.defaultProps={kind:"store",published:!1,connectedStore:null,releaseId:"",projectId:"",releaseType:"",scope:"",behavior:je.CONNECT,onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{}};export{he as A,Y as C,Se as S,ye as U,Bt as c,G as m,Et as s,Ut as u};
1
+ import{fq as _e,aK as R,r as g,aJ as B,aH as F,dr as Z,eF as Ee,aM as ee,j as s,G as ae,aP as W,u as z,T as E,au as $e,a1 as te,n as q,fp as De,P as i,X as H,Y as V,aY as Ne,aj as Pe,b as D,t as $,aa as Ie,aR as Me,aT as ne,B as N,eT as ce,c as L,l as Le,eu as ze,a as qe}from"./index-BXfEXarc.js";import{d as Oe}from"./Add-w8WVX4Xk.js";import{L as Be,d as Ue}from"./MoreVert-BnSgpwk3.js";import{D as Ae}from"./DialogContentText-vfNBMZmk.js";import{T as le}from"./TextField-CQhkYpMM.js";import{A as de}from"./Alert-DBECv8Dk.js";import{f as O}from"./format-error-Cm24Mb6K.js";import{d as ue}from"./Launch-mty9jus0.js";import{d as Fe}from"./Done-CemlqiD_.js";import{d as fe}from"./DeleteOutline-Csn3uTIE.js";import{C as We}from"./click-to-copy-DptGmuUO.js";import{S as He}from"./shorten-label-DJCp0Yiv.js";import{u as Ve,C as pe}from"./confirm-C1rEM5YR.js";import{u as Ge}from"./session-C7vFWF9o.js";import{W as Je}from"./did-address-DwWl4S12.js";import{A as Ke}from"./Avatar-DxxyX-k_.js";import{B as se}from"./ButtonGroup-C6tThDqG.js";import{f as Ye,j as Xe,a as Qe,c as Ze,d as et,b as tt,e as nt,g as st,h as rt}from"./jss-plugin-props-sort.esm-DD0RfxgD.js";const ot=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function it(e={}){const{disableGlobal:r=!1,productionPrefix:n="jss",seed:t=""}=e,o=t===""?"":`${t}-`;let u=0;const d=()=>(u+=1,u);return(c,l)=>{const a=l.options.name;if(a&&a.indexOf("Mui")===0&&!l.options.link&&!r){if(ot.indexOf(c.key)!==-1)return`Mui-${c.key}`;const f=`${o}${a}-${c.key}`;return!l.options.theme[_e]||t!==""?f:`${f}-${d()}`}return`${o}${n}${d()}`}}function at(){return{plugins:[Ye(),Xe(),Qe(),Ze(),et(),typeof window>"u"?null:tt(),nt()]}}function me(e={}){const{baseClasses:r,newClasses:n,Component:t}=e;if(!n)return r;const o=R({},r);return Object.keys(n).forEach(u=>{n[u]&&(o[u]=`${r[u]} ${n[u]}`)}),o}const M={set:(e,r,n,t)=>{let o=e.get(r);o||(o=new Map,e.set(r,o)),o.set(n,t)},get:(e,r,n)=>{const t=e.get(r);return t?t.get(n):void 0},delete:(e,r,n)=>{e.get(r).delete(n)}},ct=st(at()),lt=it(),dt=new Map,ut={disableGeneration:!1,generateClassName:lt,jss:ct,sheetsCache:null,sheetsManager:dt,sheetsRegistry:null},ft=g.createContext(ut);let re=-1e9;function pt(){return re+=1,re}const mt=["variant"];function oe(e){return e.length===0}function ht(e){const{variant:r}=e,n=B(e,mt);let t=r||"";return Object.keys(n).sort().forEach(o=>{o==="color"?t+=oe(t)?e[o]:F(e[o]):t+=`${oe(t)?o:F(o)}${F(e[o].toString())}`}),t}const gt={};function xt(e){const r=typeof e=="function";return{create:(n,t)=>{let o;try{o=r?e(n):e}catch(l){throw l}if(!t||!n.components||!n.components[t]||!n.components[t].styleOverrides&&!n.components[t].variants)return o;const u=n.components[t].styleOverrides||{},d=n.components[t].variants||[],c=R({},o);return Object.keys(u).forEach(l=>{c[l]=Z(c[l]||{},u[l])}),d.forEach(l=>{const a=ht(l.props);c[a]=Z(c[a]||{},l.style)}),c},options:{}}}const vt=["name","classNamePrefix","Component","defaultTheme"];function yt({state:e,stylesOptions:r},n,t){if(r.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let o=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,o=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,o=!0),o&&(e.cacheClasses.value=me({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:t})),e.cacheClasses.value}function jt({state:e,theme:r,stylesOptions:n,stylesCreator:t,name:o},u){if(n.disableGeneration)return;let d=M.get(n.sheetsManager,t,r);d||(d={refs:0,staticSheet:null,dynamicStyles:null},M.set(n.sheetsManager,t,r,d));const c=R({},t.options,n,{theme:r,flip:typeof n.flip=="boolean"?n.flip:r.direction==="rtl"});c.generateId=c.serverGenerateClassName||c.generateClassName;const l=n.sheetsRegistry;if(d.refs===0){let a;n.sheetsCache&&(a=M.get(n.sheetsCache,t,r));const f=t.create(r,o);a||(a=n.jss.createStyleSheet(f,R({link:!1},c)),a.attach(),n.sheetsCache&&M.set(n.sheetsCache,t,r,a)),l&&l.add(a),d.staticSheet=a,d.dynamicStyles=rt(f)}if(d.dynamicStyles){const a=n.jss.createStyleSheet(d.dynamicStyles,R({link:!0},c));a.update(u),a.attach(),e.dynamicSheet=a,e.classes=me({baseClasses:d.staticSheet.classes,newClasses:a.classes}),l&&l.add(a)}else e.classes=d.staticSheet.classes;d.refs+=1}function St({state:e},r){e.dynamicSheet&&e.dynamicSheet.update(r)}function Ct({state:e,theme:r,stylesOptions:n,stylesCreator:t}){if(n.disableGeneration)return;const o=M.get(n.sheetsManager,t,r);o.refs-=1;const u=n.sheetsRegistry;o.refs===0&&(M.delete(n.sheetsManager,t,r),n.jss.removeStyleSheet(o.staticSheet),u&&u.remove(o.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),u&&u.remove(e.dynamicSheet))}function bt(e,r){const n=g.useRef([]);let t;const o=g.useMemo(()=>({}),r);n.current!==o&&(n.current=o,t=e()),g.useEffect(()=>()=>{t&&t()},[o])}function G(e,r={}){const{name:n,classNamePrefix:t,Component:o,defaultTheme:u=gt}=r,d=B(r,vt),c=xt(e),l=n||t||"makeStyles";return c.options={index:pt(),name:n,meta:l,classNamePrefix:l},(f={})=>{const h=Ve()||u,v=R({},g.useContext(ft),d),S=g.useRef(),p=g.useRef();return bt(()=>{const C={name:n,state:{},stylesCreator:c,stylesOptions:v,theme:h};return jt(C,f),p.current=!1,S.current=C,()=>{Ct(C)}},[h,c]),g.useEffect(()=>{p.current&&St(S.current,f),p.current=!0}),yt(S.current,f.classes,o)}}const wt=["name"],Rt=["children","className","clone","component"];function kt(e,r){const n={};return Object.keys(e).forEach(t=>{r.indexOf(t)===-1&&(n[t]=e[t])}),n}function Tt(e){return(n,t={})=>{const{name:o}=t,u=B(t,wt);let d=o;const l=G(typeof n=="function"?h=>({root:v=>n(R({theme:h},v))}):{root:n},R({Component:e,name:o||e.displayName,classNamePrefix:d},u));let a;n.filterProps&&(a=n.filterProps,delete n.filterProps),n.propTypes&&(n.propTypes,delete n.propTypes);const f=g.forwardRef(function(v,S){const{children:p,className:y,clone:C,component:w}=v,j=B(v,Rt),m=l(v),b=ee(m.root,y);let k=j;if(a&&(k=kt(k,a)),C)return g.cloneElement(p,R({className:ee(p.props.className,b)},k));if(typeof p=="function")return p(R({className:b},k));const T=w||e;return s.jsx(T,R({ref:S,className:b},k,{children:p}))});return Ee(f,e),f}}const{NODE_MODES:ie}=ae,_t=({mode:e,previousMode:r}={})=>e===ie.SERVERLESS||r===ie.SERVERLESS;var Et={isInServerlessMode:_t};const $t=G(e=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}));function he({disabled:e,storeList:r,teamDid:n,onAdd:t,scope:o,hiddenChildren:u,open:d,onClose:c}){const{api:l}=W(),[a,f]=g.useState(!1),[h,v]=g.useState(!0),[S,p]=g.useState(!1),[y,C]=g.useState(""),[w,j]=g.useState(""),{t:m}=z(),b=$t(),k=async()=>{f(!0);try{const{decoded:x}=De(y,r);await l.addBlockletStore({input:{teamDid:n,url:x,scope:o}}),t(x),p(!1),c()}catch(x){const P=`${m("store.blockletRegistry.addFailed")} ${O(x)}`;j(P)}finally{f(!1)}},T=()=>{p(!1),c()};return s.jsxs(s.Fragment,{children:[!u&&s.jsxs(Be,{button:!0,disabled:e,className:b.addMenuItemRoot,onClick:()=>{p(!0)},children:[s.jsx(Oe,{font:!0}),s.jsx(E,{variant:"inherit",children:m("store.blockletRegistry.addRegistry")})]}),s.jsxs($e,{title:m("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:d||S,onClose:T,PaperProps:{style:{minHeight:"auto"}},actions:s.jsxs(s.Fragment,{children:[s.jsx(te,{onClick:x=>{x.stopPropagation(),T()},color:"inherit",children:m("common.cancel")}),s.jsxs(te,{onClick:x=>{x.stopPropagation(),k()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a||!y||h,variant:"contained",autoFocus:!0,children:[a&&s.jsx(q,{size:16}),m("common.confirm")]})]}),children:[s.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:s.jsx(Ae,{component:"div",children:s.jsx(E,{component:"div",children:s.jsx(le,{label:m("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:y,onChange:x=>{j(null);let P=!1;x.target.value.trim()||(P=!0),x.target.value.trim()||j(m("store.blockletRegistry.registryUrlEmpty")),C(x.target.value),v(P)},disabled:a,onKeyPress:x=>{x.key==="Enter"&&(x.preventDefault(),x.target.value.trim()?k():j(m("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!w&&s.jsx(de,{severity:"error",style:{width:"100%"},children:w})]})]})}he.propTypes={teamDid:i.string.isRequired,disabled:i.bool,storeList:i.array,onAdd:i.func,scope:i.string,hiddenChildren:i.bool,open:i.bool,onClose:i.func};he.defaultProps={disabled:!1,storeList:[],onAdd:()=>{},scope:"",hiddenChildren:!1,open:!1,onClose:()=>{}};var J={},Dt=V;Object.defineProperty(J,"__esModule",{value:!0});var ge=J.default=void 0,Nt=Dt(H()),Pt=s;ge=J.default=(0,Nt.default)((0,Pt.jsx)("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}),"LinkOutlined");var K={},It=V;Object.defineProperty(K,"__esModule",{value:!0});var xe=K.default=void 0,Mt=It(H()),Lt=s;xe=K.default=(0,Mt.default)((0,Lt.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.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"BackupOutlined");function Y({title:e,description:r,confirmPlaceholder:n,cancel:t,confirm:o,params:u,onCancel:d,onConfirm:c,keyName:l}){const{t:a}=z(),f={title:()=>s.jsxs("div",{children:[e,s.jsx(He,{sx:{fontSize:"14px"},maxLength:64,children:` (${l})`})]}),description:(h,v)=>{const S=p=>{v({...p,__disableConfirm:p.__disableConfirm})};return s.jsxs("div",{children:[s.jsx(de,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),s.jsx("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:r}}),s.jsxs("div",{style:{marginBottom:24},children:[a("common.click"),":",s.jsx(We,{"data-cy":"click-copy",children:l})]}),s.jsx(E,{component:"div",children:s.jsx(le,{label:n,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:h.inputVal,onChange:p=>{S({...h,inputVal:p.target.value,__disableConfirm:l!==p.target.value})}})})]})},confirm:o,cancel:t,onConfirm:c,onCancel:d,params:{inputVal:"",__disableConfirm:!0,...u}};return s.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}Y.propTypes={title:i.any.isRequired,keyName:i.any.isRequired,description:i.any.isRequired,confirmPlaceholder:i.any.isRequired,cancel:i.string,confirm:i.string,params:i.object,onCancel:i.func,onConfirm:i.func.isRequired};Y.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}};function A({store:e,teamDid:r,onDelete:n,children:t,projectId:o="",scope:u=""}){const{api:d}=W(),{t:c}=z(),l=Ne(),[a,f]=g.useState(!1),[h,v]=g.useState(null),S=Pe(),p=()=>{f(!1),v(null)},y=async()=>{try{f(!0),await d.deleteBlockletStore({input:{teamDid:r,url:e.url,projectId:o,scope:u}}),await(l==null?void 0:l.actions.refreshBlocklet()),n&&typeof n=="function"&&n()}catch(j){$.error(`Remove Blocklet Store Error: ${O(j)}`)}finally{f(!1),v(null)}},C={keyName:e.url,title:c("store.blockletRegistry.deleteRegistry"),description:c("store.blockletRegistry.deleteDesc",{name:`<b>${e.url}</b>`,color:S.palette.error.main}),confirmPlaceholder:c("store.blockletRegistry.confirmDesc",{name:e.url}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:y,onCancel:p},w=j=>{e.protected||(j.stopPropagation(),v(C))};return s.jsxs(s.Fragment,{children:[t?s.jsx("span",{onClick:w,children:t}):s.jsx(D,{color:"primary",disabled:a,onClick:w,size:"small",children:s.jsx(fe,{sx:{zoom:.95}})}),h&&s.jsx(Y,{keyName:h.keyName,title:h.title,description:h.description,confirmPlaceholder:h.confirmPlaceholder,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}A.propTypes={children:i.node,teamDid:i.string.isRequired,store:i.object.isRequired,onDelete:i.func,projectId:i.string,scope:i.string};A.defaultProps={children:null,projectId:"",scope:"",onDelete:()=>{}};var X={},zt=V;Object.defineProperty(X,"__esModule",{value:!0});var ve=X.default=void 0,qt=zt(H()),Ot=s;ve=X.default=(0,qt.default)((0,Ot.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff");const Bt=({store:e,userDid:r})=>{var t;const n=((t=window.blocklet)==null?void 0:t.tenantMode)!==Ie.BLOCKLET_TENANT_MODES.MULTIPLE;return e.protected?!1:e.scope&&e.scope===r?!0:n?e.scope==="studio":!1};function Q({connectedStore:e,onDisconnect:r,onDelete:n,store:t,teamDid:o,projectId:u}){var j;const[d,c]=g.useState(null),l=!!d,{t:a}=z(),{session:f}=Ge(),[h,v]=g.useState(!1),S=m=>{if(m.stopPropagation(),e!=null&&e.developerDid){const b=ce.from(JSON.stringify({forceConnected:e==null?void 0:e.developerDid}),"utf8").toString("base64");window.open(`${L(t.url,"developer/blocklets")}?__did-connect__=${b}`)}else window.open(`${L(t.url,"developer/blocklets")}`)},p=m=>{c(m.currentTarget)},y=()=>{c(null)},C=()=>{v(!1),r()},w=[{label:a("common.visitStore"),action:S,icon:ue},{label:a("common.disconnect"),action:()=>{y(),v(!0)},icon:ve,hidden:!e}];return s.jsxs(s.Fragment,{children:[s.jsx(D,{ref:d,color:"primary",onClick:p,size:"small",children:s.jsx(Ue,{sx:{zoom:.95}})}),s.jsxs(Me,{anchorEl:d,open:l,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[w.map(m=>m.hidden?null:s.jsxs(ne,{dense:!0,onClick:m.action,disabled:m.disabled,children:[m.icon&&s.jsx(m.icon,{color:"action",sx:{marginRight:1}}),s.jsx(N,{color:"action",children:m.label})]},m.label)),Bt({store:t,userDid:(j=f==null?void 0:f.user)==null?void 0:j.did})&&s.jsx(A,{store:t,onDelete:n,teamDid:o,projectId:u,scope:t.scope||"studio",children:s.jsxs(ne,{dense:!0,disabled:t.protected,children:[s.jsx(fe,{sx:{color:t.protected?"action":"error.main",marginRight:1}}),s.jsx(N,{color:t.protected?"action":"error.main",children:a("common.delete")})]})})]}),h&&s.jsx(pe,{displayError:!0,title:`${a("common.disconnect")} ${t.name}`,description:a("blocklet.publish.disconnectStoreTip"),confirm:a("common.confirm"),onConfirm:C,onCancel:()=>v(!1)})]})}Q.propTypes={connectedStore:i.object.isRequired,onDisconnect:i.func,onDelete:i.func,store:i.object.isRequired,teamDid:i.string.isRequired,projectId:i.string};Q.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function Ut({messageType:e,onOpen:r,onClose:n}){const t=g.useRef(null),o=g.useRef(null),u=async c=>{setTimeout(()=>{try{n==null||n()}catch{}},10*1e3),t.current&&(clearInterval(o.current),t.current.close());const l=Math.random().toString(36).slice(2);t.current=window.open(`${ae.WELLKNOWN_SERVICE_PATH_PREFIX}/open-window?key=${l}`,"_blank"),r==null||r(t.current),o.current=setInterval(()=>{(!t.current||t.current.closed)&&(t.current=null,clearInterval(o.current),setTimeout(()=>{n==null||n()},1100))},200),await Promise.resolve(c(t.current,a=>{if(!t.current){localStorage.setItem(`open-window-url-${l}`,JSON.stringify({url:a,time:Date.now()}));return}t.current.location.href=a}))},d=Le(c=>{const{type:l,error:a}=c.data;t.current&&l===e&&a&&($.error(a),n==null||n())});return g.useEffect(()=>(window.addEventListener("message",d),()=>{window.removeEventListener("message",d)}),[d]),u}function U({connectedStore:e,sx:r,...n}){return s.jsx(Ke,{sx:{width:24,height:24,...r},src:L(e.storeUrl,`/.well-known/service/user/avatar/${e.developerDid}?imageFilter=resize&w=120&h=120`),...n})}U.propTypes={connectedStore:i.object.isRequired,sx:i.object};U.defaultProps={sx:{}};function ye({storeUrl:e,storeName:r,developerDid:n,published:t}){const{t:o}=z(),u=()=>{if(n){const d=ce.from(JSON.stringify({forceConnected:n}),"utf8").toString("base64");window.open(`${L(e,"developer/blocklets")}?__did-connect__=${d}`)}else window.open(`${L(e,"developer/blocklets")}`)};return s.jsxs(N,{children:[s.jsx(E,{variant:"subtitle2",children:o(t?"blocklet.publish.publishToStoreSuccess":"blocklet.publish.uploadToStoreSuccess",{name:r})}),s.jsx(D,{size:"small",sx:{mt:1},onClick:u,variant:"contained",color:"success",children:o("common.visitTarget",{name:r})})]})}ye.propTypes={storeName:i.string.isRequired,storeUrl:i.string.isRequired,developerDid:i.string.isRequired,published:i.bool.isRequired};const je={CONNECT:"connect",SELECT:"select"},At=G(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),Ft=Tt(({className:e,...r})=>s.jsx(qe,{...r,classes:{popper:e}}))(({theme:e})=>({[`& .${ze.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:e.spacing(2),fontSize:e.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function Se({teamDid:e,projectId:r,releaseId:n,store:t,onDelete:o,kind:u,published:d,connectedStore:c,releaseType:l,onPublish:a,onOpenConnectStore:f,onSelectConnectStore:h,behavior:v,scope:S=""}){const p=At(),{t:y}=z(),{api:C,info:w,inService:j}=W(),[m,b]=g.useState(!1),k=Ut({messageType:"connect-store-message",onOpen:()=>b(!0),onClose:()=>b(!1)}),T=u==="publish",x=!!c,P=_=>{if(_.stopPropagation(),T){window.open(L(t.url,"developer/blocklets"));return}window.open(t.url)},Ce=()=>{if(v===je.SELECT){h(t);return}k(async(_,ke)=>{try{const I=await C.connectToStore({input:{did:e,storeUrl:t.url,storeId:t.id,storeName:t.name,projectId:r}});if(!(I!=null&&I.url)){$.error("failed to connect to store");return}ke(I.url),await f({did:e,projectId:r,storeId:t.id}),b(!1)}catch(I){const Te=O(I);$.error(Te),b(!1)}})},be=async()=>{try{await C.disconnectFromStore({input:{did:e,storeId:t.id,projectId:r,storeScope:S}}),o()}catch(_){$.error(O(_))}},we=()=>{b(!0),C.publishToStore({input:{did:e,storeId:t.id,storeName:t.name,projectId:r,releaseId:n,type:l}}).then(_=>{$.success(s.jsx(ye,{storeName:c.storeName,storeUrl:c.storeUrl,developerDid:c.developerDid,published:_.url==="published"}),{duration:1e4}),a==null||a(null)}).catch(_=>{$.error(O(_)),a==null||a(_)}).finally(()=>{b(!1)})};g.useEffect(()=>{x&&b(!1)},[x]);const Re=g.useMemo(()=>!(j&&Et.isInServerlessMode(w)),[j,w]);return s.jsxs("div",{className:p.box,children:[!T&&m&&s.jsx(q,{sx:{marginRight:2},size:16}),s.jsxs("div",{className:p.menuName,children:[s.jsx(N,{sx:{display:"flex",flexDirection:"row"},children:s.jsx(E,{component:"span",className:p.title,variant:"subtitle1",children:t.name})}),s.jsx(E,{className:p.url,component:"span",variant:"inherit",children:`${t.url}`})]}),s.jsxs("div",{className:p.actions,children:[c&&s.jsx(Ft,{placement:"top",title:s.jsxs(N,{children:[s.jsx(E,{component:"span",variant:"caption",sx:{opacity:.7},children:y("blocklet.publish.developerInfo")}),s.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[s.jsx(U,{connectedStore:c,sx:{width:42,height:42}}),s.jsxs(N,{sx:{flex:1},children:[s.jsx(E,{component:"span",variant:"subtitle1",children:c.developerName}),s.jsx(Je,{size:14,copyable:!0,compact:!0,responsive:!1,did:c.developerDid})]})]})]}),children:s.jsx("div",{children:s.jsx(U,{connectedStore:c,sx:{marginRight:1,cursor:"help"}})})}),T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:38},size:"small",children:[!x&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:Ce,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(ge,{sx:{marginRight:1}}),y("common.connect")]}),x&&d&&s.jsxs(D,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(Fe,{sx:{marginRight:1}}),y("common.uploaded")]}),x&&!d&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:we,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(xe,{sx:{marginRight:1,fontSize:20}}),y("common.upload")]}),s.jsx(Q,{projectId:r,connectedStore:c,store:t,onDelete:o,teamDid:e,onDisconnect:be})]}),!T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:36},size:"small",children:[s.jsx(D,{onClick:P,children:s.jsx(ue,{sx:{zoom:.9}})}),!t.protected&&Re&&s.jsx(A,{store:t,onDelete:o,teamDid:e,scope:""})]})]})]})}Se.propTypes={kind:i.string,teamDid:i.string.isRequired,published:i.bool,connectedStore:i.shape({storeName:i.string,storeId:i.string,storeUrl:i.string,developerDid:i.string,developerName:i.string}),projectId:i.string,releaseId:i.string,releaseType:i.string,store:i.shape({id:i.string.isRequired,name:i.string.isRequired,url:i.string.isRequired,protected:i.bool,connected:i.bool}).isRequired,scope:i.string,onDelete:i.func,onPublish:i.func,onOpenConnectStore:i.func,behavior:i.string,onSelectConnectStore:i.func};Se.defaultProps={kind:"store",published:!1,connectedStore:null,releaseId:"",projectId:"",releaseType:"",scope:"",behavior:je.CONNECT,onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{}};export{he as A,Y as C,Se as S,ye as U,Bt as c,G as m,Et as s,Ut as u};