@abtnode/webapp 1.16.44-beta-20250516-225119-c0b5ec8d → 1.16.44-beta-20250520-004606-6cd8a0d3

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 (236) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-Hu_1QWFw.js → AdapterDayjs-C79-iXnA.js} +6 -6
  4. package/dist/assets/{Add-B-whK8Og.js → Add-Dr17acvQ.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-D24TTMvH.js → ArrowDropDown-BeVQ7W_f.js} +1 -1
  6. package/dist/assets/{Autocomplete-CHlN80bM.js → Autocomplete-Dxuf1ndW.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-Do80FKEd.js → Breadcrumbs-m3ZWWS-Y.js} +1 -1
  8. package/dist/assets/{ButtonGroup-BJpKQaa5.js → ButtonGroup-D8iCR_UA.js} +1 -1
  9. package/dist/assets/{CSSTransition-CL3Ps2jl.js → CSSTransition-DMBk20B6.js} +1 -1
  10. package/dist/assets/{CallMerge-6gNoogQf.js → CallMerge-CuhH8Rfn.js} +1 -1
  11. package/dist/assets/CardContent-BhT4vmBc.js +1 -0
  12. package/dist/assets/{ChevronLeft-DCgw7PVK.js → ChevronLeft-DRnsqgri.js} +1 -1
  13. package/dist/assets/{ChevronRight-BkDmz6Jp.js → ChevronRight-BUxNE2e8.js} +1 -1
  14. package/dist/assets/{Clear-CH1dCzcl.js → Clear-DiiXyvpY.js} +1 -1
  15. package/dist/assets/{Close-qBNbi4Ug.js → Close-Cx2b036Y.js} +1 -1
  16. package/dist/assets/{Community-C7i42E2Q.js → Community-DT6H5xHG.js} +1 -1
  17. package/dist/assets/{Delete-CgPI_eC5.js → Delete-Db12JNaW.js} +1 -1
  18. package/dist/assets/{Delete-DliA3mdg.js → Delete-DibgMbRa.js} +1 -1
  19. package/dist/assets/{DeleteOutline-Cx4fsGxu.js → DeleteOutline-vkCr-A0J.js} +1 -1
  20. package/dist/assets/{Done-DNcp5cRU.js → Done-CDp0yF_G.js} +1 -1
  21. package/dist/assets/{Edit-WMHj4INs.js → Edit-CQIAI4Xx.js} +1 -1
  22. package/dist/assets/{ErrorOutline-CBbwlMhr.js → ErrorOutline-DCAxmStN.js} +1 -1
  23. package/dist/assets/{HelpOutline-9IHMC0WQ.js → HelpOutline-4rllQwkH.js} +1 -1
  24. package/dist/assets/{Holiday-C8LY8_Xa.js → Holiday-Bhfc8ari.js} +1 -1
  25. package/dist/assets/{Launch-Dw-I3nnd.js → Launch-Dss7Qu-X.js} +1 -1
  26. package/dist/assets/{Link-e5N_7Dtu.js → Link-BL98xVyl.js} +1 -1
  27. package/dist/assets/{ListItemButton-glXjZswW.js → ListItemButton-CalO7fFj.js} +1 -1
  28. package/dist/assets/{ListSubheader-q3nAde5e.js → ListSubheader-CZoW0Yjm.js} +1 -1
  29. package/dist/assets/{LoadingButton-BXZL61GP.js → LoadingButton-C1tBqNRZ.js} +1 -1
  30. package/dist/assets/{LockIcon-BJD4BUmY.js → LockIcon-BIs3NFsi.js} +1 -1
  31. package/dist/assets/{Meeting-Bzs1L390.js → Meeting-DElinHPN.js} +1 -1
  32. package/dist/assets/{MoreHoriz-BPa-vzup.js → MoreHoriz-BamWxTeP.js} +1 -1
  33. package/dist/assets/{MoreVert-ygAE5zXH.js → MoreVert-BrdZPzwo.js} +1 -1
  34. package/dist/assets/{OffSick-CzZuC8-v.js → OffSick-PL_bKC4S.js} +1 -1
  35. package/dist/assets/{OpenInNew-BIkhjwqJ.js → OpenInNew-DXZU9TBc.js} +1 -1
  36. package/dist/assets/{Public-Dxdvvihr.js → Public-Dr1m2N7G.js} +1 -1
  37. package/dist/assets/{Refresh-9g5ukYUh.js → Refresh-VxrYYzfd.js} +1 -1
  38. package/dist/assets/{SchemaReference.es-rTtLb9nE.js → SchemaReference.es-Bm8CNcXG.js} +1 -1
  39. package/dist/assets/{Search-BWfKoeW0.js → Search-DqihVCic.js} +1 -1
  40. package/dist/assets/{Slider-X_Dbeb_B.js → Slider-B8HWvhga.js} +1 -1
  41. package/dist/assets/{Stepper-CAwK24YR.js → Stepper-BCrOaECo.js} +1 -1
  42. package/dist/assets/{Switch-B_ZA3R4H.js → Switch-CIGEpWB6.js} +1 -1
  43. package/dist/assets/{TableRow-LUYIbYYH.js → TableRow-DSBApqUZ.js} +1 -1
  44. package/dist/assets/{TableSearch-DryNoX9z.js → TableSearch-C3sQDzER.js} +1 -1
  45. package/dist/assets/{ToggleButtonGroup-vsVyuLtl.js → ToggleButtonGroup-2wE1N-s9.js} +1 -1
  46. package/dist/assets/{Verified-BDGlFDHV.js → Verified-DAT8F9n5.js} +1 -1
  47. package/dist/assets/{VerifiedUser-CahjDQlN.js → VerifiedUser-BzqFFroG.js} +1 -1
  48. package/dist/assets/{ViewColumn-Y-NBF0dy.js → ViewColumn-DZ8hNz9g.js} +1 -1
  49. package/dist/assets/{ViewList-Bd5d0iY_.js → ViewList-B52x_JLH.js} +1 -1
  50. package/dist/assets/{WorkingRemotely-9hVl1hvM.js → WorkingRemotely-Cr2dx3vw.js} +1 -1
  51. package/dist/assets/{_createAggregator-DLtLS5ot.js → _createAggregator-CtUq-Bm1.js} +1 -1
  52. package/dist/assets/{actions-BhwFbvNf.js → actions-CSIY5MjI.js} +1 -1
  53. package/dist/assets/{actions-CQrliwxs.js → actions-pkMFjLzT.js} +2 -2
  54. package/dist/assets/{agreement-DOCzlZYK.js → agreement-D5AaipUa.js} +5 -5
  55. package/dist/assets/api-CWQIMtn6.js +1 -0
  56. package/dist/assets/{appearance-Bj48z57w.js → appearance-Rsnizthu.js} +1 -1
  57. package/dist/assets/{ar-2yn9i2dw.js → ar-C_INBNFD.js} +1 -1
  58. package/dist/assets/{audit-logs-DZxZnVwe.js → audit-logs-DuYx96S8.js} +1 -1
  59. package/dist/assets/blocklet-Ca7hIY9r.js +1 -0
  60. package/dist/assets/{brace-fold.es-CwvOFnq9.js → brace-fold.es-BbuUT1bx.js} +1 -1
  61. package/dist/assets/{chain-DW6-BOPV.js → chain-lJbBI8lt.js} +2 -2
  62. package/dist/assets/{click-to-copy-NkGN8EyZ.js → click-to-copy-DunM7RYV.js} +1 -1
  63. package/dist/assets/cloneDeep-B7rgkTOg.js +1 -0
  64. package/dist/assets/{closebrackets.es-DrjVd75R.js → closebrackets.es-iBNy7XLq.js} +1 -1
  65. package/dist/assets/{codemirror.es-DQ3ePCqU.js → codemirror.es-olwlvV8O.js} +1 -1
  66. package/dist/assets/{collapse-FkL4URhV.js → collapse-pVfCVGsT.js} +1 -1
  67. package/dist/assets/{comment.es-DlV3kW-O.js → comment.es-CYuI6LGK.js} +1 -1
  68. package/dist/assets/{config-navigation-BijLYy-F.js → config-navigation-DCerXksA.js} +3 -3
  69. package/dist/assets/{connect-to-Vc7E5-UM.js → connect-to-PXHcA1x_.js} +1 -1
  70. package/dist/assets/{de-CEKbJD3-.js → de-EYXdEi3Y.js} +1 -1
  71. package/dist/assets/{delete-confirm-WhK8nGuj.js → delete-confirm-CKJM7oLk.js} +1 -1
  72. package/dist/assets/{detail-Df6H4ZPs.js → detail-Dg3I6B4n.js} +3 -3
  73. package/dist/assets/{dialog.es-xMJKI9Lh.js → dialog.es-D824_H5X.js} +1 -1
  74. package/dist/assets/domains-NOopC5Rf.js +28 -0
  75. package/dist/assets/{download-BLbVLPTB.js → download-B2axstvn.js} +1 -1
  76. package/dist/assets/emotion-react.browser.esm-CH67Z3jf.js +1 -0
  77. package/dist/assets/{es-dvMygD-W.js → es-3jqVamM8.js} +1 -1
  78. package/dist/assets/{foldgutter.es-B_-xDjtB.js → foldgutter.es-9QgJOpar.js} +1 -1
  79. package/dist/assets/{fr-BvFd5xp9.js → fr-CUcR-yNv.js} +1 -1
  80. package/dist/assets/{get-safe-url-BJSiqBsp.js → get-safe-url-BswgeNVU.js} +1 -1
  81. package/dist/assets/{get-safe-url-M6nGqKp3.js → get-safe-url-BwrYOF2l.js} +1 -1
  82. package/dist/assets/getValidReactChildren-2WQ5-6h6.js +1 -0
  83. package/dist/assets/hi-DNldhMTl.js +5 -0
  84. package/dist/assets/{hint.es-Du2uNLDf.js → hint.es-Bg3Bg91x.js} +1 -1
  85. package/dist/assets/{hint.es2-DfyQQrQH.js → hint.es2-CtVGSKy-.js} +1 -1
  86. package/dist/assets/{id-B1Mq_eQI.js → id-CmSIFhX-.js} +1 -1
  87. package/dist/assets/{iframe-uzgOIcHS.js → iframe-D8EuM9FZ.js} +1 -1
  88. package/dist/assets/{index-Bb_ZoBt1.js → index-1fHL4NLA.js} +1 -1
  89. package/dist/assets/{index-CED3Eqhn.js → index-3hUI0XWj.js} +1 -1
  90. package/dist/assets/{index-M-c0W-SQ.js → index-7AfdoVCB.js} +1 -1
  91. package/dist/assets/{index-2NLfrlha.js → index-9SxmA2ZK.js} +1 -1
  92. package/dist/assets/{index-YTaSOOwL.js → index-B1T9zVyF.js} +1 -1
  93. package/dist/assets/{index-DrUjokqV.js → index-BSVtXZA5.js} +1 -1
  94. package/dist/assets/{index-Bmtcygi9.js → index-Bd6-uEej.js} +4 -4
  95. package/dist/assets/{index-Ducl-yvK.js → index-BgfI9oqP.js} +4 -4
  96. package/dist/assets/{index-DANmjPqe.js → index-BmTru3ER.js} +1 -1
  97. package/dist/assets/{index-idlXfnJU.js → index-BsaFIq1a.js} +1 -1
  98. package/dist/assets/{index-DX3h3jsX.js → index-BwcQ-v7n.js} +1 -1
  99. package/dist/assets/index-C1AeyTeh.js +1 -0
  100. package/dist/assets/{index-BkYiBMUu.js → index-C3nC1vZU.js} +1 -1
  101. package/dist/assets/index-C4GlctnC.js +87 -0
  102. package/dist/assets/{index-DTI4BkNW.js → index-CGargw6n.js} +9 -9
  103. package/dist/assets/{index-DgMghQir.js → index-CL9Vrgs0.js} +1 -1
  104. package/dist/assets/{index-BACNAzdg.js → index-CMAKmzMc.js} +11 -11
  105. package/dist/assets/{index-ChGWeAoT.js → index-CMPNSvEP.js} +1 -1
  106. package/dist/assets/{index-CjFBhX6R.js → index-CR29WT8-.js} +1 -1
  107. package/dist/assets/{index-DutylRlW.js → index-CRLGpfQP.js} +1 -1
  108. package/dist/assets/index-CT5y3MWl.js +155 -0
  109. package/dist/assets/{index-DuODXdGq.js → index-CVvuXYj2.js} +3 -3
  110. package/dist/assets/{index-Bq85UHN2.js → index-Cnc4xzOD.js} +1 -1
  111. package/dist/assets/{index-CjBp95Te.js → index-CrtwGdrB.js} +1 -1
  112. package/dist/assets/{index-SqBYmqJv.js → index-D2Z-mQN5.js} +3 -3
  113. package/dist/assets/{index-DKUpJiTq.js → index-D9LzJ8Wk.js} +12 -12
  114. package/dist/assets/index-D9dQPWQL.js +1 -0
  115. package/dist/assets/{index-Bo-N9ZZS.js → index-DDhjA_J6.js} +1 -1
  116. package/dist/assets/{index-DQIKAMuC.js → index-DJo_NuyL.js} +1 -1
  117. package/dist/assets/{index-DqvSsunq.js → index-DO0xkQta.js} +17 -17
  118. package/dist/assets/{index-Api0RkD_.js → index-DQsQI7y-.js} +1 -1
  119. package/dist/assets/index-DYNPc0x8.js +109 -0
  120. package/dist/assets/{index-B8GS99Wr.js → index-DjuHtL5I.js} +1 -1
  121. package/dist/assets/{index-hJGrUWVV.js → index-Dl2gy2lk.js} +1 -1
  122. package/dist/assets/{index-yA3tM1jB.js → index-DmdIxVQV.js} +1 -1
  123. package/dist/assets/{index-DMDws1yA.js → index-EiK_j914.js} +1 -1
  124. package/dist/assets/{index-CgUGS_Zn.js → index-GsLKPFh7.js} +5 -5
  125. package/dist/assets/{index-DY0rnIvQ.js → index-JLvEb6lq.js} +1 -1
  126. package/dist/assets/{index-G6hKL35m.js → index-L99IjMpo.js} +1 -1
  127. package/dist/assets/{index-DU8P3lNm.js → index-MaZo-0IY.js} +1 -1
  128. package/dist/assets/{index-C4b651ZQ.js → index-NkYFHo4Q.js} +1 -1
  129. package/dist/assets/{index-BLUexfy_.js → index-QcWYn0US.js} +1 -1
  130. package/dist/assets/{index-RCmuyDMR.js → index-U1KqpW6O.js} +1 -1
  131. package/dist/assets/{index-u0GcnVeV.js → index-fFK_YyO8.js} +1 -1
  132. package/dist/assets/{index-3KlQvd1f.js → index-g4Pa9QCu.js} +2 -2
  133. package/dist/assets/{index-BVT-ixIa.js → index-k4OGecmF.js} +1 -1
  134. package/dist/assets/{index-Cax1rLeF.js → index-lHULqi5l.js} +1 -1
  135. package/dist/assets/{index-IWXwGVVh.js → index-n0V_zECF.js} +2 -2
  136. package/dist/assets/{index-CR2gE5g2.js → index-rlAZJLp4.js} +1 -1
  137. package/dist/assets/{index.esm-BhU35G9C.js → index.esm-CvOsHG0z.js} +1 -1
  138. package/dist/assets/{info-addon.es-CPzyoWb4.js → info-addon.es-Cx99Eu34.js} +1 -1
  139. package/dist/assets/{info.es-D5-UslFk.js → info.es-r6G7pvuv.js} +1 -1
  140. package/dist/assets/{install-from-url-CvqMMCKo.js → install-from-url-CAMFT77K.js} +1 -1
  141. package/dist/assets/{invitation-qA5bVm--.js → invitation-a75PydJz.js} +6 -6
  142. package/dist/assets/is-path-prefix-equal-tP_Em7g6.js +1 -0
  143. package/dist/assets/item-MkdTA7ZR.js +277 -0
  144. package/dist/assets/{ja-CCKVmbEX.js → ja-D-vAGmH7.js} +1 -1
  145. package/dist/assets/{javascript.es-Bi4XiziU.js → javascript.es-3UOa6hAX.js} +1 -1
  146. package/dist/assets/{jump-to-line.es-BEhBaQVE.js → jump-to-line.es-DtpaMTlX.js} +1 -1
  147. package/dist/assets/{jump.es-D_HGlVff.js → jump.es-DhxXT_Sj.js} +1 -1
  148. package/dist/assets/{ko-A_w8tIEg.js → ko-DpdamIdS.js} +1 -1
  149. package/dist/assets/{lint.es-DXIQDiFW.js → lint.es-CsD0hQVi.js} +1 -1
  150. package/dist/assets/{lint.es2-T86XSfSx.js → lint.es2-DU2epyfs.js} +1 -1
  151. package/dist/assets/{lint.es3-QrsCURAc.js → lint.es3-CtwrSwHH.js} +1 -1
  152. package/dist/assets/{list-header-DbzM_GZd.js → list-header-DLHqbQMu.js} +1 -1
  153. package/dist/assets/{log-D1woDO46.js → log-T4Gys8TD.js} +2 -2
  154. package/dist/assets/{lottie-react.esm-5SHHR4Kh.js → lottie-react.esm-DE7PZzmM.js} +1 -1
  155. package/dist/assets/{matchbrackets.es-DkhIDR9b.js → matchbrackets.es-Cbfo0kGw.js} +1 -1
  156. package/dist/assets/{memory-D1fug3gB.js → memory-DnziUg0a.js} +1 -1
  157. package/dist/assets/{metric-ChZoSNSx.js → metric-CXeJ1pVj.js} +1 -1
  158. package/dist/assets/{mode.es-C7vpO80y.js → mode.es-81u6K4KX.js} +1 -1
  159. package/dist/assets/{mode.es2-BxPP91JH.js → mode.es2-CKKLFqL3.js} +1 -1
  160. package/dist/assets/{mode.es3-D3euCiUs.js → mode.es3-Bv3GIpLP.js} +1 -1
  161. package/dist/assets/omit-BS9HjQsW.js +1 -0
  162. package/dist/assets/{onlineParser.es-Dv3ojmYM.js → onlineParser.es-Dao3EmVs.js} +1 -1
  163. package/dist/assets/overview-CINcLtup.js +13 -0
  164. package/dist/assets/{permission-CIEFWkaR.js → permission-BY_usLPC.js} +1 -1
  165. package/dist/assets/{preference-CGZrxant.js → preference-CquEhb-_.js} +4 -4
  166. package/dist/assets/pt-CEcOQeEC.js +5 -0
  167. package/dist/assets/{raf-schd.esm-D2YdSSsT.js → raf-schd.esm-Ivpfp78X.js} +1 -1
  168. package/dist/assets/refType-CSs4l3lt.js +1 -0
  169. package/dist/assets/{resource-dialog-BUsD19Cy.js → resource-dialog-sYzuZVwE.js} +4 -4
  170. package/dist/assets/ru-83xhwzPD.js +5 -0
  171. package/dist/assets/{runtime-DmliCtHn.js → runtime-By4tJgnP.js} +1 -1
  172. package/dist/assets/{schema-Dcd_4PT9.js → schema-CIVGWbJp.js} +1 -1
  173. package/dist/assets/sdk-dj0ARauA.js +1 -0
  174. package/dist/assets/{search.es-Dq2R-yp_.js → search.es-BoSdwsl_.js} +1 -1
  175. package/dist/assets/{searchcursor.es-sSprtinS.js → searchcursor.es-CbyR05zG.js} +1 -1
  176. package/dist/assets/{service-CRQQROx3.js → service-mHOJi74L.js} +1 -1
  177. package/dist/assets/{shorten-label-C03p-pfG.js → shorten-label-Cx9WVX2w.js} +1 -1
  178. package/dist/assets/{show-hint.es-DT0uCiTE.js → show-hint.es-BBwAXg-d.js} +1 -1
  179. package/dist/assets/{simple-select-9Y5bam0M.js → simple-select-D8ZhRe5q.js} +1 -1
  180. package/dist/assets/{spaces-C11TOrvj.js → spaces-Cg3ymUIh.js} +1 -1
  181. package/dist/assets/{status-D0j9AxRu.js → status-D68KxBTS.js} +1 -1
  182. package/dist/assets/{status-D-H-SlzG.js → status-DdweCl-L.js} +1 -1
  183. package/dist/assets/{sublime.es-Dlq8qSkc.js → sublime.es-J03GHmnf.js} +1 -1
  184. package/dist/assets/{switch-control-CIiFijrf.js → switch-control-DSz3cmNm.js} +1 -1
  185. package/dist/assets/{table-icons-BviR-2XS.js → table-icons-CHCR_r_-.js} +1 -1
  186. package/dist/assets/{table-tips-D63O0ZjI.js → table-tips-CFO-Ys9P.js} +1 -1
  187. package/dist/assets/team-DeJfgyE0.js +1 -0
  188. package/dist/assets/th-BQLlyW1N.js +5 -0
  189. package/dist/assets/{toLower-BPzu2rPJ.js → toLower-CRFOnVAM.js} +1 -1
  190. package/dist/assets/toUpper-wDnuTnwH.js +1 -0
  191. package/dist/assets/{traffic-DMf28Jqy.js → traffic-CILl5dnV.js} +2 -2
  192. package/dist/assets/{url-evaluation-CiS0m0gE.js → url-evaluation-Cjrq8Y2H.js} +1 -1
  193. package/dist/assets/{url-join-CwE3EUnC.js → url-join-Mz1JcbbA.js} +1 -1
  194. package/dist/assets/{use-mobile-B6rWKjo_.js → use-mobile-CpVsXFoV.js} +1 -1
  195. package/dist/assets/{use-mobile-DQ4xY9vN.js → use-mobile-DK73qoH8.js} +1 -1
  196. package/dist/assets/{useAsync-BwpiQkh2.js → useAsync-BCZg9cpL.js} +1 -1
  197. package/dist/assets/useAsyncRetry-DBtDInVv.js +1 -0
  198. package/dist/assets/{useLocalStorage-yyXOU8sf.js → useLocalStorage-1IK8Xf3D.js} +1 -1
  199. package/dist/assets/{useThemeProps-DA06OkGc.js → useThemeProps-Btw9Aun5.js} +1 -1
  200. package/dist/assets/{util-DIcvOfJ0.js → util-ks9_6DYA.js} +1 -1
  201. package/dist/assets/vi-DgWAr6FA.js +5 -0
  202. package/dist/assets/{wait-container-DB7Fvl8u.js → wait-container-B7LdKBV0.js} +3 -3
  203. package/dist/assets/withStyles-DWVK59by.js +1 -0
  204. package/dist/assets/wrap-locale-DoH7AJX_.js +1 -0
  205. package/dist/assets/{zh-Cti0XXui.js → zh-BL80PoOh.js} +2 -2
  206. package/dist/assets/{zh-tw-BLcDG99i.js → zh-tw-Dg5z1DFE.js} +1 -1
  207. package/dist/index.html +1 -1
  208. package/dist/service-worker.js +1 -1
  209. package/package.json +1 -1
  210. package/dist/assets/CardContent-_VxRx6xT.js +0 -1
  211. package/dist/assets/api-B2krrsTm.js +0 -1
  212. package/dist/assets/blocklet-DMuA5PdQ.js +0 -1
  213. package/dist/assets/cloneDeep-B1r2JtFj.js +0 -1
  214. package/dist/assets/domains-BLjPj3AW.js +0 -28
  215. package/dist/assets/emotion-react.browser.esm-BPIpPz3P.js +0 -1
  216. package/dist/assets/getValidReactChildren-rb5pggFM.js +0 -1
  217. package/dist/assets/hi-C51yBXa5.js +0 -5
  218. package/dist/assets/index-B59U_Lup.js +0 -155
  219. package/dist/assets/index-BENdKQR9.js +0 -87
  220. package/dist/assets/index-C2b2CJyH.js +0 -1
  221. package/dist/assets/index-D40SuWQU.js +0 -109
  222. package/dist/assets/index-yQhfY-D-.js +0 -1
  223. package/dist/assets/is-path-prefix-equal-CP-xgvsY.js +0 -1
  224. package/dist/assets/item-6mCxa8bi.js +0 -277
  225. package/dist/assets/omit-CaeWYRyw.js +0 -1
  226. package/dist/assets/overview-Dha81GsQ.js +0 -13
  227. package/dist/assets/pt-7HHecjdA.js +0 -5
  228. package/dist/assets/refType-BtU4sc8V.js +0 -1
  229. package/dist/assets/ru-Bw8FVC4M.js +0 -5
  230. package/dist/assets/sdk-Bg9zUQQV.js +0 -1
  231. package/dist/assets/team-Bt5GsvTe.js +0 -1
  232. package/dist/assets/th-DyW-mYrC.js +0 -5
  233. package/dist/assets/toUpper-Bk6xSBue.js +0 -1
  234. package/dist/assets/vi-bzer6J4H.js +0 -5
  235. package/dist/assets/withStyles-CPbSyJRI.js +0 -1
  236. package/dist/assets/wrap-locale-CYxNfqSO.js +0 -1
@@ -1,4 +1,4 @@
1
- import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as H,K as y,aA as Ce,P as i,y as L,al as ft,r as f,e as ve,bG as qe,b as Y,H as B,V as $t,bF as He,t as K,n as $,X as ie,l6 as Ao,a4 as X,aY as ao,k as te,D as ht,b4 as qo,gJ as Go,gK as Wo,e1 as Fo,C as ue,fM as zo,w as Vo,ay as Gn,a2 as gt,v as Yo,l7 as Ko,l8 as Ho,B as ae,l9 as Qo,Y as Xo,Z as Zo,la as lo,bs as co,Q as ye,dE as Jo,dR as er,aC as tr,aD as nr,aE as or,aG as Q,aR as rr,cR as sr,E as uo,bo as ir,$ as ar,M as at,aF as po,b0 as Ft,lb as lr,b1 as je,aB as Wn,cP as cr,k0 as dr,A as U,ae as Ge,aN as mo,bX as zt,cA as ur,g as xt,lc as pr,bc as mr,x as fo,aX as Mt,T as fr,aV as Ke,R as Ut,W as hr,bH as ho,gI as gr,cv as xr,aJ as yr,bz as Cr,aU as jr,en as vr,fV as Fn,ld as zn,h8 as Vn,U as Yn,G as lt,cO as br,h9 as Rr,bW as Sr,k1 as wr}from"./index-DTI4BkNW.js";import{d as Er}from"./Add-B-whK8Og.js";import{E as Tr}from"./index-3KlQvd1f.js";import{e as Pr,f as kr,g as _r,u as Vt,a as Ir}from"./actions-CQrliwxs.js";import{S as Dr}from"./switch-control-CIiFijrf.js";import{u as pe}from"./blocklet-DMuA5PdQ.js";import{P as At,w as yt}from"./permission-CIEFWkaR.js";import{d as go}from"./Edit-WMHj4INs.js";import{T as Ur,M as Nr,t as Lr}from"./table-icons-BviR-2XS.js";import{C as Kn}from"./click-to-copy-NkGN8EyZ.js";import{d as Yt}from"./Link-e5N_7Dtu.js";import{c as Br,C as Or,b as $r,s as xo,e as Mr,z as Ar,d as yo,a as qr,A as Gr,B as Wr,f as Fr,S as zr}from"./item-6mCxa8bi.js";import{u as Vr,a as Yr,P as Co,L as Hn,A as Kr,S as Hr}from"./index-DMDws1yA.js";import{u as Qr,C as Xr,D as Zr,a as Jr,b as es}from"./connect-to-Vc7E5-UM.js";import{C as ts,u as ns,A as os}from"./agreement-DOCzlZYK.js";import{R as dt,F as rs,L as ss,d as is,B as as}from"./preference-CGZrxant.js";import{d as ls}from"./Done-DNcp5cRU.js";import{A as cs,a as ds,d as us,b as ps}from"./collapse-FkL4URhV.js";import{C as ms,L as fs}from"./LockIcon-BJD4BUmY.js";import{I as hs,a as gs,f as xs,B as ys}from"./install-from-url-CvqMMCKo.js";import{a as Qn}from"./api-B2krrsTm.js";import{v as jo,e as Cs,a as ut}from"./util-DIcvOfJ0.js";import{u as vo}from"./use-mobile-DQ4xY9vN.js";import{d as js}from"./ArrowDropDown-D24TTMvH.js";import{_ as vs}from"./useLocalStorage-yyXOU8sf.js";import{d as Ct}from"./Delete-DliA3mdg.js";import{d as bo}from"./Launch-Dw-I3nnd.js";import{D as bs}from"./delete-confirm-WhK8nGuj.js";import{W as Qe,R as Rs,a as Xn}from"./url-evaluation-CiS0m0gE.js";import{B as Ro}from"./status-D0j9AxRu.js";import{A as So}from"./actions-BhwFbvNf.js";import{I as Nt}from"./index-ChGWeAoT.js";import{t as Ss}from"./toUpper-Bk6xSBue.js";import{S as ws}from"./Switch-B_ZA3R4H.js";import{a as Es}from"./team-Bt5GsvTe.js";import"./MoreVert-ygAE5zXH.js";import"./get-safe-url-M6nGqKp3.js";import"./ButtonGroup-BJpKQaa5.js";import"./getValidReactChildren-rb5pggFM.js";import"./index-DgMghQir.js";import"./raf-schd.esm-D2YdSSsT.js";import"./index-idlXfnJU.js";import"./ViewColumn-Y-NBF0dy.js";import"./CSSTransition-CL3Ps2jl.js";import"./index-Bo-N9ZZS.js";import"./Clear-CH1dCzcl.js";import"./ChevronRight-BkDmz6Jp.js";import"./ChevronLeft-DCgw7PVK.js";import"./Search-BWfKoeW0.js";import"./index-C2b2CJyH.js";import"./Autocomplete-CHlN80bM.js";import"./ListSubheader-q3nAde5e.js";import"./Verified-BDGlFDHV.js";import"./VerifiedUser-CahjDQlN.js";import"./DeleteOutline-Cx4fsGxu.js";import"./url-join-CwE3EUnC.js";import"./Close-qBNbi4Ug.js";import"./index-SqBYmqJv.js";import"./OpenInNew-BIkhjwqJ.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-9IHMC0WQ.js";import"./index-CjBp95Te.js";import"./spaces-C11TOrvj.js";import"./index-DKUpJiTq.js";import"./index-DANmjPqe.js";import"./iframe-uzgOIcHS.js";import"./cloneDeep-B1r2JtFj.js";import"./schema-Dcd_4PT9.js";import"./index-YTaSOOwL.js";import"./ListItemButton-glXjZswW.js";import"./Stepper-CAwK24YR.js";import"./is-path-prefix-equal-CP-xgvsY.js";import"./MoreHoriz-BPa-vzup.js";const Ts=Bo(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");function Zn(e,o){var n={};return o=Oo(o),$o(e,function(a,r,s){Mo(n,r,o(a,r,s))}),n}var Kt={},Ps=Wt;Object.defineProperty(Kt,"__esModule",{value:!0});var wo=Kt.default=void 0,ks=Ps(Gt()),_s=t;wo=Kt.default=(0,ks.default)((0,_s.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");var Ht={},Is=Wt;Object.defineProperty(Ht,"__esModule",{value:!0});var Qt=Ht.default=void 0,Ds=Is(Gt()),Us=t;Qt=Ht.default=(0,Ds.default)((0,Us.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");function Xt({children:e,...o}){var x;const{t:n}=W(),{api:a}=H(),{blocklet:r}=pe(),s=(x=r==null?void 0:r.settings)==null?void 0:x.autoCheckUpdate,h=async g=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:g}})},c=async()=>{try{const g=!(s!=null&&s.enabled);await h({enabled:g}),L.success(n(g?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(g){L.error(g.message)}},p=!!(s!=null&&s.enabled);return t.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[e,t.jsx(Ce,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Dr,{checked:p,onChange:c,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Xt.propTypes={children:i.any};Xt.defaultProps={children:null};function Jn(e){function o({sx:n,...a}){return t.jsx(e,{...a,sx:{color:"text.primary",...n}})}return o}const Ns={...Zn(Lr,Jn),...Zn(Pr,Jn)},Ls=(e,o)=>{let{description:n}=e;return(Object.values(Y.CHAIN_PROP_MAP).includes(e.key)||B.isEnvShareable(e))&&(n?n=`${n} (${o("blocklet.config.sharedToAllComponents")})`:n=o("blocklet.config.sharedToAllComponents")),n&&t.jsx("div",{style:{marginLeft:12},children:n})},Lt=(e,o,n=[])=>!(n!=null&&n.length)&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!o.meta.environments.find(a=>a.name===e.key)&&o.children.every(a=>!a.meta.environments.find(r=>r.name===e.key))?!0:e.custom,eo=e=>[Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),Bt=e=>[Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function Zt({blocklet:e,ancestors:o}){const n=H(),{palette:a}=ft(),{inService:r}=n,{t:s}=f.useContext(ve),h=[...o.map(m=>m.meta.did),e.meta.did],c=()=>L.success(s("blocklet.config.changedTip")),p=m=>Lt(m,e,o);if(qe(e.status)||e.status==="unknown"&&qe(e.status))return null;const x=m=>new Promise(async(u,v)=>{if(!m.key.trim()||!m.value.trim()){L.error(s("blocklet.config.environment.keyValueRequired")),v();return}if(eo(m.key)===!1){L.error(s("blocklet.config.environment.invalidKey")),v();return}m.custom=Bt(m.key);try{const w=await n.api.configBlocklet({input:{did:h,configs:[m]}});c(w.blocklet),u()}catch(w){L.error(ie(w)),v()}}),g=(m,u)=>new Promise(async(v,w)=>{if(m.required&&(!m.key.trim()||!m.value.trim())){L.error(s("blocklet.config.environment.keyValueRequired")),w();return}if(eo(m.key)===!1){L.error(s("blocklet.config.environment.invalidKey")),w();return}if(m.key===Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const N=Ao(m);if(N){L.error(N),w();return}}const j=[{...m,value:m.secure&&m.value==="__encrypted__"?"":m.value}];if(m.key!==u.key){if(!Lt(m,e,o)){L.error("Only key of custom env can be changed"),w();return}j.push({key:u.key,custom:Bt(m.key)})}try{const N=await n.api.configBlocklet({input:{did:h,configs:j}});c(N.blocklet),v()}catch(N){L.error(ie(N)),w()}}),l=m=>new Promise(async(u,v)=>{if(m.required){L.error(s("blocklet.config.environment.deleteForbidden")),v();return}if(!Lt(m,e,o)){L.error("Only key of custom env can be changed"),v();return}try{const w=await n.api.configBlocklet({input:{did:h,configs:[{key:m.key,custom:Bt(m.key)}]}});c(w.blocklet),u()}catch(w){L.error(ie(w)),v()}}),b=(e.configs||[]).filter(m=>!Y.BLOCKLET_CONFIGURABLE_KEY[m.key]||[Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(m.key)),d=B.getSharedConfigObj(o[0],e),T=B.getComponentMissingConfigs(e,o[0]),S=b.map(m=>({...m,value:Object.values(Y.CHAIN_PROP_MAP).includes(m.key)&&Object.keys(d).includes(m.key)?d[m.key]:d[m.key]||m.value})),R=S.some(m=>m.key&&m.key.startsWith("BWA_")),k={onRowAdd:x,onRowUpdate:g,onRowDelete:l,isDeletable:p},C=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:m=>t.jsx(Kn,{value:m.value,style:{color:m.required&&!m.value?a.error.main:a.text.primary,fontWeight:m.required?"bold":"normal"},children:m.key}),editComponent:m=>{const{value:u,rowData:v,onChange:w}=m;return t.jsx(to,{children:t.jsx(K,{fullWidth:!0,size:"small",disabled:p(v)===!1,value:u,onChange:j=>w(j.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:m=>m.value?m.secure?"******":t.jsx(Kn,{unstyled:!0,value:m.value,style:{wordBreak:"break-all"},children:m.value}):null,editComponent:m=>{const{value:u,rowData:v,onChange:w}=m;return t.jsxs(to,{children:[t.jsx(K,{fullWidth:!0,size:"small",value:u==="__encrypted__"?"":u,onChange:j=>w(j.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),Ls(v,s)]})}}];return t.jsxs(Bs,{children:[!!T.length&&t.jsx($t,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),R&&t.jsx($t,{severity:"info",children:s("blocklet.config.environment.tip")}),t.jsx(At,{permission:r?"":"mutate_blocklets",role:r?He:[],children:m=>t.jsx(Ur,{className:"config-table",children:t.jsx(Nr,{title:t.jsx(y,{fontWeight:"bold",children:s("common.environments")}),columns:C(),icons:Ns,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:S,editable:m?k:{}})})})]})}Zt.propTypes={blocklet:i.object.isRequired,ancestors:i.array};Zt.defaultProps={ancestors:[]};const Bs=$.div`
1
+ import{bW as Bo,j as t,f6 as Oo,hL as $o,l6 as Mo,aO as Wt,aP as Gt,m as G,bp as H,K as y,aA as Ce,P as i,y as L,al as ft,r as f,e as ve,bE as qe,b as Y,H as B,V as $t,bD as He,t as K,n as $,X as ie,l7 as Ao,a4 as X,aY as ao,k as te,D as ht,b4 as qo,gK as Wo,gL as Go,e2 as Fo,C as ue,fN as zo,w as Vo,ay as Wn,a2 as gt,v as Yo,l8 as Ko,l9 as Ho,B as ae,la as Qo,Y as Xo,Z as Zo,lb as lo,bq as co,Q as ye,dF as Jo,dS as er,aC as tr,aD as nr,aE as or,aG as Q,aR as rr,cQ as sr,E as uo,bo as ir,$ as ar,M as at,aF as po,b0 as Ft,lc as lr,b1 as je,aB as Gn,cO as cr,k1 as dr,A as U,ae as We,aN as mo,bV as zt,cy as ur,g as xt,ld as pr,bc as mr,x as fo,aX as Mt,T as fr,aV as Ke,R as Ut,W as hr,bF as ho,gJ as gr,ct as xr,aJ as yr,bx as Cr,aU as jr,eo as vr,fW as Fn,le as zn,h9 as Vn,U as Yn,G as lt,cN as br,ha as Rr,bU as Sr,k2 as wr}from"./index-CGargw6n.js";import{d as Er}from"./Add-Dr17acvQ.js";import{E as Tr}from"./index-g4Pa9QCu.js";import{e as kr,f as Pr,g as _r,u as Vt,a as Ir}from"./actions-pkMFjLzT.js";import{S as Dr}from"./switch-control-DSz3cmNm.js";import{u as pe}from"./blocklet-Ca7hIY9r.js";import{P as At,w as yt}from"./permission-BY_usLPC.js";import{d as go}from"./Edit-CQIAI4Xx.js";import{T as Ur,M as Nr,t as Lr}from"./table-icons-CHCR_r_-.js";import{C as Kn}from"./click-to-copy-DunM7RYV.js";import{d as Yt}from"./Link-BL98xVyl.js";import{c as Br,C as Or,b as $r,s as xo,e as Mr,z as Ar,d as yo,a as qr,A as Wr,B as Gr,f as Fr,S as zr}from"./item-MkdTA7ZR.js";import{u as Vr,a as Yr,P as Co,L as Hn,A as Kr,S as Hr}from"./index-EiK_j914.js";import{u as Qr,C as Xr,D as Zr,a as Jr,b as es}from"./connect-to-PXHcA1x_.js";import{C as ts,u as ns,A as os}from"./agreement-D5AaipUa.js";import{R as dt,F as rs,L as ss,d as is,B as as}from"./preference-CquEhb-_.js";import{d as ls}from"./Done-CDp0yF_G.js";import{A as cs,a as ds,d as us,b as ps}from"./collapse-pVfCVGsT.js";import{C as ms,L as fs}from"./LockIcon-BIs3NFsi.js";import{I as hs,a as gs,f as xs,B as ys}from"./install-from-url-CAMFT77K.js";import{a as Qn}from"./api-CWQIMtn6.js";import{v as jo,e as Cs,a as ut}from"./util-ks9_6DYA.js";import{u as vo}from"./use-mobile-DK73qoH8.js";import{d as js}from"./ArrowDropDown-BeVQ7W_f.js";import{_ as vs}from"./useLocalStorage-1IK8Xf3D.js";import{d as Ct}from"./Delete-DibgMbRa.js";import{d as bo}from"./Launch-Dss7Qu-X.js";import{D as bs}from"./delete-confirm-CKJM7oLk.js";import{W as Qe,R as Rs,a as Xn}from"./url-evaluation-Cjrq8Y2H.js";import{B as Ro}from"./status-D68KxBTS.js";import{A as So}from"./actions-CSIY5MjI.js";import{I as Nt}from"./index-CMPNSvEP.js";import{t as Ss}from"./toUpper-wDnuTnwH.js";import{S as ws}from"./Switch-CIGEpWB6.js";import{a as Es}from"./team-DeJfgyE0.js";import"./MoreVert-BrdZPzwo.js";import"./get-safe-url-BwrYOF2l.js";import"./ButtonGroup-D8iCR_UA.js";import"./getValidReactChildren-2WQ5-6h6.js";import"./index-CL9Vrgs0.js";import"./raf-schd.esm-Ivpfp78X.js";import"./index-BsaFIq1a.js";import"./ViewColumn-DZ8hNz9g.js";import"./CSSTransition-DMBk20B6.js";import"./index-DDhjA_J6.js";import"./Clear-DiiXyvpY.js";import"./ChevronRight-BUxNE2e8.js";import"./ChevronLeft-DRnsqgri.js";import"./Search-DqihVCic.js";import"./index-D9dQPWQL.js";import"./Autocomplete-Dxuf1ndW.js";import"./ListSubheader-CZoW0Yjm.js";import"./Verified-DAT8F9n5.js";import"./VerifiedUser-BzqFFroG.js";import"./DeleteOutline-vkCr-A0J.js";import"./url-join-Mz1JcbbA.js";import"./Close-Cx2b036Y.js";import"./index-D2Z-mQN5.js";import"./OpenInNew-DXZU9TBc.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-4rllQwkH.js";import"./index-CrtwGdrB.js";import"./spaces-Cg3ymUIh.js";import"./index-D9LzJ8Wk.js";import"./index-BmTru3ER.js";import"./iframe-D8EuM9FZ.js";import"./cloneDeep-B7rgkTOg.js";import"./schema-CIVGWbJp.js";import"./index-B1T9zVyF.js";import"./ListItemButton-CalO7fFj.js";import"./Stepper-BCrOaECo.js";import"./is-path-prefix-equal-tP_Em7g6.js";import"./MoreHoriz-BamWxTeP.js";const Ts=Bo(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");function Zn(e,o){var n={};return o=Oo(o),$o(e,function(a,r,s){Mo(n,r,o(a,r,s))}),n}var Kt={},ks=Gt;Object.defineProperty(Kt,"__esModule",{value:!0});var wo=Kt.default=void 0,Ps=ks(Wt()),_s=t;wo=Kt.default=(0,Ps.default)((0,_s.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");var Ht={},Is=Gt;Object.defineProperty(Ht,"__esModule",{value:!0});var Qt=Ht.default=void 0,Ds=Is(Wt()),Us=t;Qt=Ht.default=(0,Ds.default)((0,Us.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");function Xt({children:e,...o}){var x;const{t:n}=G(),{api:a}=H(),{blocklet:r}=pe(),s=(x=r==null?void 0:r.settings)==null?void 0:x.autoCheckUpdate,h=async g=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:g}})},c=async()=>{try{const g=!(s!=null&&s.enabled);await h({enabled:g}),L.success(n(g?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(g){L.error(g.message)}},p=!!(s!=null&&s.enabled);return t.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[e,t.jsx(Ce,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Dr,{checked:p,onChange:c,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Xt.propTypes={children:i.any};Xt.defaultProps={children:null};function Jn(e){function o({sx:n,...a}){return t.jsx(e,{...a,sx:{color:"text.primary",...n}})}return o}const Ns={...Zn(Lr,Jn),...Zn(kr,Jn)},Ls=(e,o)=>{let{description:n}=e;return(Object.values(Y.CHAIN_PROP_MAP).includes(e.key)||B.isEnvShareable(e))&&(n?n=`${n} (${o("blocklet.config.sharedToAllComponents")})`:n=o("blocklet.config.sharedToAllComponents")),n&&t.jsx("div",{style:{marginLeft:12},children:n})},Lt=(e,o,n=[])=>!(n!=null&&n.length)&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!o.meta.environments.find(a=>a.name===e.key)&&o.children.every(a=>!a.meta.environments.find(r=>r.name===e.key))?!0:e.custom,eo=e=>[Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),Bt=e=>[Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function Zt({blocklet:e,ancestors:o}){const n=H(),{palette:a}=ft(),{inService:r}=n,{t:s}=f.useContext(ve),h=[...o.map(m=>m.meta.did),e.meta.did],c=()=>L.success(s("blocklet.config.changedTip")),p=m=>Lt(m,e,o);if(qe(e.status)||e.status==="unknown"&&qe(e.status))return null;const x=m=>new Promise(async(u,v)=>{if(!m.key.trim()||!m.value.trim()){L.error(s("blocklet.config.environment.keyValueRequired")),v();return}if(eo(m.key)===!1){L.error(s("blocklet.config.environment.invalidKey")),v();return}m.custom=Bt(m.key);try{const w=await n.api.configBlocklet({input:{did:h,configs:[m]}});c(w.blocklet),u()}catch(w){L.error(ie(w)),v()}}),g=(m,u)=>new Promise(async(v,w)=>{if(m.required&&(!m.key.trim()||!m.value.trim())){L.error(s("blocklet.config.environment.keyValueRequired")),w();return}if(eo(m.key)===!1){L.error(s("blocklet.config.environment.invalidKey")),w();return}if(m.key===Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const N=Ao(m);if(N){L.error(N),w();return}}const j=[{...m,value:m.secure&&m.value==="__encrypted__"?"":m.value}];if(m.key!==u.key){if(!Lt(m,e,o)){L.error("Only key of custom env can be changed"),w();return}j.push({key:u.key,custom:Bt(m.key)})}try{const N=await n.api.configBlocklet({input:{did:h,configs:j}});c(N.blocklet),v()}catch(N){L.error(ie(N)),w()}}),l=m=>new Promise(async(u,v)=>{if(m.required){L.error(s("blocklet.config.environment.deleteForbidden")),v();return}if(!Lt(m,e,o)){L.error("Only key of custom env can be changed"),v();return}try{const w=await n.api.configBlocklet({input:{did:h,configs:[{key:m.key,custom:Bt(m.key)}]}});c(w.blocklet),u()}catch(w){L.error(ie(w)),v()}}),b=(e.configs||[]).filter(m=>!Y.BLOCKLET_CONFIGURABLE_KEY[m.key]||[Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(m.key)),d=B.getSharedConfigObj(o[0],e),T=B.getComponentMissingConfigs(e,o[0]),S=b.map(m=>({...m,value:Object.values(Y.CHAIN_PROP_MAP).includes(m.key)&&Object.keys(d).includes(m.key)?d[m.key]:d[m.key]||m.value})),R=S.some(m=>m.key&&m.key.startsWith("BWA_")),P={onRowAdd:x,onRowUpdate:g,onRowDelete:l,isDeletable:p},C=()=>[{title:s("common.key"),field:"key",initialEditValue:"",width:"30%",render:m=>t.jsx(Kn,{value:m.value,style:{color:m.required&&!m.value?a.error.main:a.text.primary,fontWeight:m.required?"bold":"normal"},children:m.key}),editComponent:m=>{const{value:u,rowData:v,onChange:w}=m;return t.jsx(to,{children:t.jsx(K,{fullWidth:!0,size:"small",disabled:p(v)===!1,value:u,onChange:j=>w(j.target.value),variant:"outlined",label:"Key",placeholder:s("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:s("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:m=>m.value?m.secure?"******":t.jsx(Kn,{unstyled:!0,value:m.value,style:{wordBreak:"break-all"},children:m.value}):null,editComponent:m=>{const{value:u,rowData:v,onChange:w}=m;return t.jsxs(to,{children:[t.jsx(K,{fullWidth:!0,size:"small",value:u==="__encrypted__"?"":u,onChange:j=>w(j.target.value),variant:"outlined",label:s("common.value"),placeholder:s("blocklet.config.environment.value"),margin:"dense"}),Ls(v,s)]})}}];return t.jsxs(Bs,{children:[!!T.length&&t.jsx($t,{severity:"error",style:{marginTop:24},children:s("blocklet.config.missingRequired")}),R&&t.jsx($t,{severity:"info",children:s("blocklet.config.environment.tip")}),t.jsx(At,{permission:r?"":"mutate_blocklets",role:r?He:[],children:m=>t.jsx(Ur,{className:"config-table",children:t.jsx(Nr,{title:t.jsx(y,{fontWeight:"bold",children:s("common.environments")}),columns:C(),icons:Ns,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:s("common.actions")},body:{emptyDataSourceMessage:s("common.noData")}},data:S,editable:m?P:{}})})})]})}Zt.propTypes={blocklet:i.object.isRequired,ancestors:i.array};Zt.defaultProps={ancestors:[]};const Bs=$.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -52,7 +52,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
52
52
  }
53
53
  `,to=$.div`
54
54
  height: 60px;
55
- `;function jt({open:e,onClose:o,hiddenChildren:n,blocklet:a,ancestors:r,children:s}){const[h,c]=f.useState(!1),{t:p}=W(),x=p("environmentFor",{name:B.getDisplayName(a,!0)});if(qe(a.status)||a.status==="unknown"&&qe(a.status))return null;const g=()=>{o==null||o(),c(!1)},l=d=>{d.stopPropagation(),c(!0)};let b=null;return n||(b=typeof s=="function"?s({open:l}):t.jsx(X,{onClick:l,"data-cy":"action-config-component",children:t.jsx(go,{})})),t.jsxs(t.Fragment,{children:[b,(e||h)&&t.jsx(Os,{open:!0,fullWidth:!0,maxWidth:"md",title:x,onClose:g,PaperProps:{style:{minHeight:"auto"}},children:t.jsxs(ao,{gap:0,children:[t.jsx(te,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:p("description.environment",{name:B.getDisplayName(a,!0)})}),t.jsx(Zt,{blocklet:a,ancestors:r})]})})]})}jt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,children:i.any,open:i.bool,onClose:i.func,hiddenChildren:i.bool};jt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Os=$(ht)`
55
+ `;function jt({open:e,onClose:o,hiddenChildren:n,blocklet:a,ancestors:r,children:s}){const[h,c]=f.useState(!1),{t:p}=G(),x=p("environmentFor",{name:B.getDisplayName(a,!0)});if(qe(a.status)||a.status==="unknown"&&qe(a.status))return null;const g=()=>{o==null||o(),c(!1)},l=d=>{d.stopPropagation(),c(!0)};let b=null;return n||(b=typeof s=="function"?s({open:l}):t.jsx(X,{onClick:l,"data-cy":"action-config-component",children:t.jsx(go,{})})),t.jsxs(t.Fragment,{children:[b,(e||h)&&t.jsx(Os,{open:!0,fullWidth:!0,maxWidth:"md",title:x,onClose:g,PaperProps:{style:{minHeight:"auto"}},children:t.jsxs(ao,{gap:0,children:[t.jsx(te,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:p("description.environment",{name:B.getDisplayName(a,!0)})}),t.jsx(Zt,{blocklet:a,ancestors:r})]})})]})}jt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,children:i.any,open:i.bool,onClose:i.func,hiddenChildren:i.bool};jt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Os=$(ht)`
56
56
  .MuiDialogContent-root {
57
57
  padding-top: 0;
58
58
  padding-bottom: 24px;
@@ -65,7 +65,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
65
65
  .ux-dialog_closeButton {
66
66
  margin: 0;
67
67
  }
68
- `,Jt={description:i.string,editing:i.bool,onChange:i.func,required:i.bool,value:i.any,componentProps:i.object,render:i.func,renderFormItem:i.func};function en({editing:e,value:o,onChange:n}){const[a,r]=f.useState(!1),s=f.useRef(),h=f.useRef(o);f.useEffect(()=>{let l=null;return e&&(l=setTimeout(()=>{r(!0)},50)),()=>{clearTimeout(l)}},[e]);const c=l=>{h.current=l,n(l)},p=()=>{r(!1),n(h.current)},x=t.jsx(y,{className:"form-item-input slot",px:1,children:t.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&t.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=t.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:p,children:[t.jsx(y,{display:"flex",alignItems:"center",onClick:()=>r(!0),children:t.jsx("div",{ref:s,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),t.jsx(qo,{open:a,anchorEl:s.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsx(ms,{color:o,onChange:l=>c(l.hex)})})]});return e?g:x}en.propTypes=Jt;function tn({editing:e,description:o,value:n,onChange:a,componentProps:r,...s}){const{placeholder:h}=r,c=f.useRef(n),{t:p}=f.useContext(ve),x=l=>{l.key==="Enter"&&a(c.current,"confirm")},g=l=>{c.current=l,a(l)};return e?t.jsx(K,{style:{flex:1},fullWidth:!0,value:n,onChange:l=>{l.persist(),g(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||h,onKeyDown:x,...s}):t.jsx(y,{px:1,className:"form-item-input slot",children:n||t.jsx("span",{className:"placeholder",children:p("common.requiredInputPlaceholder",{name:o||h})})})}tn.propTypes=Jt;tn.defaultProps={componentProps:{}};function nn({editing:e,value:o,onChange:n,componentProps:a,...r}){const{blocklet:s}=a,h=o==="auto"?Go.getPassportColorFromDid(s.appDid):o;return t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Wo({title:"Owner",issuer:B.getDisplayName(s),issuerDid:s.appDid,ownerName:"Your Name",ownerDid:s.appDid,preferredColor:o||"auto"})}}),t.jsx(en,{...r,editing:e,value:e?h:o,onChange:n,componentProps:a})]})}nn.propTypes={...Jt,componentProps:i.shape({blocklet:i.object.isRequired}).isRequired};nn.defaultProps={};const $s=Fo`
68
+ `,Jt={description:i.string,editing:i.bool,onChange:i.func,required:i.bool,value:i.any,componentProps:i.object,render:i.func,renderFormItem:i.func};function en({editing:e,value:o,onChange:n}){const[a,r]=f.useState(!1),s=f.useRef(),h=f.useRef(o);f.useEffect(()=>{let l=null;return e&&(l=setTimeout(()=>{r(!0)},50)),()=>{clearTimeout(l)}},[e]);const c=l=>{h.current=l,n(l)},p=()=>{r(!1),n(h.current)},x=t.jsx(y,{className:"form-item-input slot",px:1,children:t.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&t.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=t.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:p,children:[t.jsx(y,{display:"flex",alignItems:"center",onClick:()=>r(!0),children:t.jsx("div",{ref:s,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),t.jsx(qo,{open:a,anchorEl:s.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsx(ms,{color:o,onChange:l=>c(l.hex)})})]});return e?g:x}en.propTypes=Jt;function tn({editing:e,description:o,value:n,onChange:a,componentProps:r,...s}){const{placeholder:h}=r,c=f.useRef(n),{t:p}=f.useContext(ve),x=l=>{l.key==="Enter"&&a(c.current,"confirm")},g=l=>{c.current=l,a(l)};return e?t.jsx(K,{style:{flex:1},fullWidth:!0,value:n,onChange:l=>{l.persist(),g(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||h,onKeyDown:x,...s}):t.jsx(y,{px:1,className:"form-item-input slot",children:n||t.jsx("span",{className:"placeholder",children:p("common.requiredInputPlaceholder",{name:o||h})})})}tn.propTypes=Jt;tn.defaultProps={componentProps:{}};function nn({editing:e,value:o,onChange:n,componentProps:a,...r}){const{blocklet:s}=a,h=o==="auto"?Wo.getPassportColorFromDid(s.appDid):o;return t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Go({title:"Owner",issuer:B.getDisplayName(s),issuerDid:s.appDid,ownerName:"Your Name",ownerDid:s.appDid,preferredColor:o||"auto"})}}),t.jsx(en,{...r,editing:e,value:e?h:o,onChange:n,componentProps:a})]})}nn.propTypes={...Jt,componentProps:i.shape({blocklet:i.object.isRequired}).isRequired};nn.defaultProps={};const $s=Fo`
69
69
  0%, 100% {
70
70
  transform: scale(1) translateX(0);
71
71
  }
@@ -75,7 +75,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
75
75
  25%, 75% {
76
76
  transform: scale(1.1) translateX(3px);
77
77
  }
78
- `,Ms={input:tn,color:en,passport:nn,uploader:e=>t.jsx(ss,{...e.componentProps})};function As(e,{editing:o=!1}){const{componentType:n="input",render:a,renderFormItem:r}=e;return o&&r?r:!o&&a?a:Ms[n==null?void 0:n.toLowerCase()]}vt.propTypes={item:i.object.isRequired,findEditingItem:i.func.isRequired,getItemValue:i.func.isRequired,onFormItemChange:i.func.isRequired,onFocusOut:i.func.isRequired,disabled:i.bool,loading:i.bool,onCancel:i.func,formValues:i.object.isRequired};vt.defaultProps={disabled:!1,loading:!1,onCancel:()=>{}};function vt({item:e,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,disabled:s,loading:h,onCancel:c,formValues:p}){var w;const{key:x,description:g,required:l,solo:b=!1,hidden:d=!1,componentProps:T={},skipButtonDisabled:S=!1}=e;if(d)return null;const R=o(x),{editing:k,shaking:C}=R??{},m=n(e,{editing:k}),u=As(e,{editing:k}),v={inputProps:{"data-cy":"schema-form-item-component"},key:x,description:g,editing:k,value:m,onChange:(j,N="change")=>a(e,j,N),componentProps:T,skipButtonDisabled:S,onBlur:()=>r(e)};return e.componentType==="collapse"&&((w=e.children)==null?void 0:w.length)>0?t.jsxs(cs,{children:[t.jsx(ds,{expandIcon:t.jsx(us,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),t.jsx(ps,{children:e.children.map(j=>t.jsx(vt,{item:j,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,formValues:p,disabled:s,loading:h,onCancel:c},j.key))})]}):t.jsxs(y,{className:"form-item",children:[!b&&t.jsxs(y,{className:"form-item-label",sx:{color:l&&!m?"error.main":"text.secondary"},children:[g,l&&t.jsx(dt,{})]}),t.jsxs(y,{className:"form-item-body",children:[t.jsx(y,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:b?"center":"left"},style:{cursor:"text"},onClick:()=>{s||R!=null&&R.edited||S||a(e,p[x],"edit")},children:t.jsx(u,{...v})}),!b&&t.jsx(y,{className:"form-item-action",style:{marginLeft:0},children:k?t.jsxs(t.Fragment,{children:[R.edited?t.jsx(X,{"data-cy":"schema-form-item-confirm",onClick:()=>{a(e,m,"confirm")},disabled:s||h,sx:{animation:C?`${$s} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:h?t.jsx(ue,{size:24}):t.jsx(ls,{})}):null,t.jsx(X,{"data-cy":"schema-form-item-cancel",onClick:()=>c(e),style:{paddingLeft:R.edited?4:8},disabled:s||h,size:"large",children:t.jsx(zo,{})})]}):null})]})]},x)}function on({schema:e,loading:o,value:n,defaultValue:a,onChange:r,style:s,disabled:h}){const c=Object.prototype.toString.call(n)==="[object Object]",[p,x]=f.useState([]),[g,l]=f.useState(c?n:a),b=f.useMemo(()=>e.length===1,[e]),d=f.useCallback(u=>p.find(v=>v.key===u),[p]);f.useEffect(()=>{var u;b&&((u=e[0])!=null&&u.required)&&x([{key:e[0].key,editing:!0,initialValue:a[e[0].key]}])},[e,b,a]);const T=f.useCallback(u=>{x(v=>v.find(j=>j.key===u.key)?v.map(j=>j.key===u.key?u:{...j}):[u].concat(v))},[]),S=f.useCallback((u,v,w)=>{const{key:j,secure:N}=u,M=d(j)??{...u};M.editing=!0;const I=g[j]!==v;M.edited=v&&M.initialValue!==v,M.initialValue=a[j];const ne={...g,[j]:v};I&&l(ne),r({[j]:v},{allValues:ne,action:w,currentItem:u}),w==="confirm"&&N&&l({...g,[j]:"__encrypted__"}),w==="confirm"&&(M.initialValue=g[j]),["confirm","cancel"].includes(w)&&(M.editing=!1,M.edited=!1),T(M)},[a,g,r,T,d]),R=f.useCallback((u,{editing:v=!1})=>{const{key:w}=u,j=c?n[w]:g[w];return j==="__encrypted__"?v?"":"******":j},[c,n,g]),k=f.useCallback(u=>{const v=d(u.key);v&&S(u,v.initialValue,"cancel")},[d,S]),C=f.useCallback(u=>{const v=d(u.key);!v||!v.edited||(v.shaking=!0,T(v),setTimeout(()=>{v.shaking=!1,T(v)},500))},[d,T]),m=f.useCallback(u=>{const v=d(u.key);!v||!v.edited?k(u):C(u)},[d,C,k]);return t.jsx(qs,{className:"form",style:s,children:e==null?void 0:e.map(u=>{const{hidden:v=!1}=u;return v?null:t.jsx(vt,{item:u,findEditingItem:d,getItemValue:R,onFormItemChange:S,onFocusOut:m,formValues:g,disabled:h,loading:o,onCancel:k})})})}on.propTypes={schema:i.array.isRequired,loading:i.bool,onChange:i.func.isRequired,value:i.object,defaultValue:i.object,style:i.object,disabled:i.bool};on.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const qs=$(rs)``;function rn({meta:e,onCancel:o,mode:n,handlePaySuccess:a}){const{t:r,locale:s}=W(),{info:h}=H(),c=Vo(h),[p,x]=f.useState(null),g=new URL(e==null?void 0:e.registryUrl).origin,l=B.getDisplayName({meta:e}),b=async(T,S)=>{const R=({downloadTokenList:m})=>{a({downloadTokenList:m})},k=m=>{L.error(m),o(m)};function C(m){return Ho(()=>Qn.get(m).then(async({data:u})=>{const v=u==null?void 0:u.downloadTokenList;if(u.status==="succeed"){if(v&&v.length)await R({downloadTokenList:v});else return await k(r("blocklet.component.missDownloadTokenTip")),!0;return!0}return u.status==="error"?(console.error("vc error: ",u),await k(u==null?void 0:u.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&p){const{statusUrl:m}=Ko(p);await C(m)}else await R({downloadTokenList:T.downloadTokenList&&S(T.downloadTokenList)})};if(f.useEffect(()=>{if(n==="purchase"){const T=new URL(g);T.pathname="/api/did/verify-purchase-blocklet/token",T.searchParams.set("serverDid",h.did),T.searchParams.set("blockletDid",e==null?void 0:e.did);try{Qn.get(T.href).then(({data:S})=>{const R=`${S.url}`;x(R)})}catch(S){console.error("get next workflow url error: ",S)}}return()=>{x(null)}},[n]),n==="purchase"&&!p)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:Gn.create({baseURL:g}).get,extraParams:{serverDid:h.did,blockletDid:e==null?void 0:e.did},messages:{title:r("store.purchase.verify.auth.title",{name:l}),scan:r("store.purchase.verify.auth.scan"),confirm:r("store.purchase.verify.auth.confirm"),success:r("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Gn.create({baseURL:gt(g,"/store")}).get,extraParams:{factory:e.nftFactory,nw:p},messages:{title:r("store.purchase.auth.title",{name:l}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:r("store.purchase.auth.success")}),t.jsx("p",{children:r("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return t.jsx(Yo,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:b,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...d[n]})}rn.propTypes={...Br,handlePaySuccess:i.func,mode:i.oneOf(["verify","purchase"]).isRequired};rn.defaultProps={handlePaySuccess:()=>{}};const sn=f.forwardRef(({mode:e,...o},n)=>{const[a,r]=f.useState(e!=="both"?e:"verify"),[s,h]=f.useState(e!=="both"?2:1),c=x=>{x!==a&&r(x)},p=()=>{a&&s!==2&&h(2)};return f.useImperativeHandle(n,()=>({onNext:p,getCurrentStep:()=>s})),s===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(Or,{action:a,onNext:null,onSelect:c})}):t.jsx(rn,{...o,mode:a})});sn.propTypes={mode:i.oneOf(["both","verify","purchase"]).isRequired,ref:i.any};sn.defaultProps={ref:{}};const Gs=sn;function Ws({...e}){return t.jsx(ae,{className:"bottom-button",variant:"contained",color:"primary",...e})}function an({blocklet:e,onStartNow:o,children:n,disabled:a}){const{t:r}=W(),s=vo();return!e||Qo(e.meta)?t.jsx(Fs,{children:n}):t.jsxs(zs,{isMobile:s,children:[t.jsx(Ws,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:r("setup.startNow")}),t.jsx(y,{display:"flex",alignItems:"center",children:n})]})}an.propTypes={blocklet:i.object,onStartNow:i.func,children:i.any,disabled:i.bool};an.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Fs=$(y)`
78
+ `,Ms={input:tn,color:en,passport:nn,uploader:e=>t.jsx(ss,{...e.componentProps})};function As(e,{editing:o=!1}){const{componentType:n="input",render:a,renderFormItem:r}=e;return o&&r?r:!o&&a?a:Ms[n==null?void 0:n.toLowerCase()]}vt.propTypes={item:i.object.isRequired,findEditingItem:i.func.isRequired,getItemValue:i.func.isRequired,onFormItemChange:i.func.isRequired,onFocusOut:i.func.isRequired,disabled:i.bool,loading:i.bool,onCancel:i.func,formValues:i.object.isRequired};vt.defaultProps={disabled:!1,loading:!1,onCancel:()=>{}};function vt({item:e,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,disabled:s,loading:h,onCancel:c,formValues:p}){var w;const{key:x,description:g,required:l,solo:b=!1,hidden:d=!1,componentProps:T={},skipButtonDisabled:S=!1}=e;if(d)return null;const R=o(x),{editing:P,shaking:C}=R??{},m=n(e,{editing:P}),u=As(e,{editing:P}),v={inputProps:{"data-cy":"schema-form-item-component"},key:x,description:g,editing:P,value:m,onChange:(j,N="change")=>a(e,j,N),componentProps:T,skipButtonDisabled:S,onBlur:()=>r(e)};return e.componentType==="collapse"&&((w=e.children)==null?void 0:w.length)>0?t.jsxs(cs,{children:[t.jsx(ds,{expandIcon:t.jsx(us,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),t.jsx(ps,{children:e.children.map(j=>t.jsx(vt,{item:j,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,formValues:p,disabled:s,loading:h,onCancel:c},j.key))})]}):t.jsxs(y,{className:"form-item",children:[!b&&t.jsxs(y,{className:"form-item-label",sx:{color:l&&!m?"error.main":"text.secondary"},children:[g,l&&t.jsx(dt,{})]}),t.jsxs(y,{className:"form-item-body",children:[t.jsx(y,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:b?"center":"left"},style:{cursor:"text"},onClick:()=>{s||R!=null&&R.edited||S||a(e,p[x],"edit")},children:t.jsx(u,{...v})}),!b&&t.jsx(y,{className:"form-item-action",style:{marginLeft:0},children:P?t.jsxs(t.Fragment,{children:[R.edited?t.jsx(X,{"data-cy":"schema-form-item-confirm",onClick:()=>{a(e,m,"confirm")},disabled:s||h,sx:{animation:C?`${$s} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:h?t.jsx(ue,{size:24}):t.jsx(ls,{})}):null,t.jsx(X,{"data-cy":"schema-form-item-cancel",onClick:()=>c(e),style:{paddingLeft:R.edited?4:8},disabled:s||h,size:"large",children:t.jsx(zo,{})})]}):null})]})]},x)}function on({schema:e,loading:o,value:n,defaultValue:a,onChange:r,style:s,disabled:h}){const c=Object.prototype.toString.call(n)==="[object Object]",[p,x]=f.useState([]),[g,l]=f.useState(c?n:a),b=f.useMemo(()=>e.length===1,[e]),d=f.useCallback(u=>p.find(v=>v.key===u),[p]);f.useEffect(()=>{var u;b&&((u=e[0])!=null&&u.required)&&x([{key:e[0].key,editing:!0,initialValue:a[e[0].key]}])},[e,b,a]);const T=f.useCallback(u=>{x(v=>v.find(j=>j.key===u.key)?v.map(j=>j.key===u.key?u:{...j}):[u].concat(v))},[]),S=f.useCallback((u,v,w)=>{const{key:j,secure:N}=u,M=d(j)??{...u};M.editing=!0;const I=g[j]!==v;M.edited=v&&M.initialValue!==v,M.initialValue=a[j];const ne={...g,[j]:v};I&&l(ne),r({[j]:v},{allValues:ne,action:w,currentItem:u}),w==="confirm"&&N&&l({...g,[j]:"__encrypted__"}),w==="confirm"&&(M.initialValue=g[j]),["confirm","cancel"].includes(w)&&(M.editing=!1,M.edited=!1),T(M)},[a,g,r,T,d]),R=f.useCallback((u,{editing:v=!1})=>{const{key:w}=u,j=c?n[w]:g[w];return j==="__encrypted__"?v?"":"******":j},[c,n,g]),P=f.useCallback(u=>{const v=d(u.key);v&&S(u,v.initialValue,"cancel")},[d,S]),C=f.useCallback(u=>{const v=d(u.key);!v||!v.edited||(v.shaking=!0,T(v),setTimeout(()=>{v.shaking=!1,T(v)},500))},[d,T]),m=f.useCallback(u=>{const v=d(u.key);!v||!v.edited?P(u):C(u)},[d,C,P]);return t.jsx(qs,{className:"form",style:s,children:e==null?void 0:e.map(u=>{const{hidden:v=!1}=u;return v?null:t.jsx(vt,{item:u,findEditingItem:d,getItemValue:R,onFormItemChange:S,onFocusOut:m,formValues:g,disabled:h,loading:o,onCancel:P})})})}on.propTypes={schema:i.array.isRequired,loading:i.bool,onChange:i.func.isRequired,value:i.object,defaultValue:i.object,style:i.object,disabled:i.bool};on.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const qs=$(rs)``;function rn({meta:e,onCancel:o,mode:n,handlePaySuccess:a}){const{t:r,locale:s}=G(),{info:h}=H(),c=Vo(h),[p,x]=f.useState(null),g=new URL(e==null?void 0:e.registryUrl).origin,l=B.getDisplayName({meta:e}),b=async(T,S)=>{const R=({downloadTokenList:m})=>{a({downloadTokenList:m})},P=m=>{L.error(m),o(m)};function C(m){return Ho(()=>Qn.get(m).then(async({data:u})=>{const v=u==null?void 0:u.downloadTokenList;if(u.status==="succeed"){if(v&&v.length)await R({downloadTokenList:v});else return await P(r("blocklet.component.missDownloadTokenTip")),!0;return!0}return u.status==="error"?(console.error("vc error: ",u),await P(u==null?void 0:u.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&p){const{statusUrl:m}=Ko(p);await C(m)}else await R({downloadTokenList:T.downloadTokenList&&S(T.downloadTokenList)})};if(f.useEffect(()=>{if(n==="purchase"){const T=new URL(g);T.pathname="/api/did/verify-purchase-blocklet/token",T.searchParams.set("serverDid",h.did),T.searchParams.set("blockletDid",e==null?void 0:e.did);try{Qn.get(T.href).then(({data:S})=>{const R=`${S.url}`;x(R)})}catch(S){console.error("get next workflow url error: ",S)}}return()=>{x(null)}},[n]),n==="purchase"&&!p)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:Wn.create({baseURL:g}).get,extraParams:{serverDid:h.did,blockletDid:e==null?void 0:e.did},messages:{title:r("store.purchase.verify.auth.title",{name:l}),scan:r("store.purchase.verify.auth.scan"),confirm:r("store.purchase.verify.auth.confirm"),success:r("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Wn.create({baseURL:gt(g,"/store")}).get,extraParams:{factory:e.nftFactory,nw:p},messages:{title:r("store.purchase.auth.title",{name:l}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:r("store.purchase.auth.success")}),t.jsx("p",{children:r("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return t.jsx(Yo,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:b,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...d[n]})}rn.propTypes={...Br,handlePaySuccess:i.func,mode:i.oneOf(["verify","purchase"]).isRequired};rn.defaultProps={handlePaySuccess:()=>{}};const sn=f.forwardRef(({mode:e,...o},n)=>{const[a,r]=f.useState(e!=="both"?e:"verify"),[s,h]=f.useState(e!=="both"?2:1),c=x=>{x!==a&&r(x)},p=()=>{a&&s!==2&&h(2)};return f.useImperativeHandle(n,()=>({onNext:p,getCurrentStep:()=>s})),s===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(Or,{action:a,onNext:null,onSelect:c})}):t.jsx(rn,{...o,mode:a})});sn.propTypes={mode:i.oneOf(["both","verify","purchase"]).isRequired,ref:i.any};sn.defaultProps={ref:{}};const Ws=sn;function Gs({...e}){return t.jsx(ae,{className:"bottom-button",variant:"contained",color:"primary",...e})}function an({blocklet:e,onStartNow:o,children:n,disabled:a}){const{t:r}=G(),s=vo();return!e||Qo(e.meta)?t.jsx(Fs,{children:n}):t.jsxs(zs,{isMobile:s,children:[t.jsx(Gs,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:r("setup.startNow")}),t.jsx(y,{display:"flex",alignItems:"center",children:n})]})}an.propTypes={blocklet:i.object,onStartNow:i.func,children:i.any,disabled:i.bool};an.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Fs=$(y)`
79
79
  width: 100%;
80
80
  margin-top: auto;
81
81
  padding-top: 24px;
@@ -125,7 +125,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
125
125
  overflow-y: auto;
126
126
  padding-bottom: 32px;
127
127
  overflow-x: hidden;
128
- `;function cn({onChange:e,loading:o,children:n,extra:a,stores:r,storageKey:s}){const{t:h}=W(),{info:c,inService:p}=H(),{blocklet:x}=pe(),[g,l]=f.useState(!1),b=f.useRef(null),[d,T]=f.useState(),[S,R]=vs(s||"tmp"),[k,C]=s?[S,R]:[d,T],{storeList:m,teamDid:u}=lo({fromBlocklet:p,blocklet:x,nodeInfo:c}),v=co([...r.map(j=>({...j,protected:!0})),...m],"url"),w=k&&v.find(j=>k===j.url)||v[0];return t.jsxs(t.Fragment,{children:[t.jsxs(Ys,{children:[t.jsx(ae,{ref:b,color:"primary","data-cy":"add-component-select-store",endIcon:t.jsx(js,{color:"primary"}),onClick:()=>{l(!0)},style:{padding:"0 2px"},children:t.jsx(te,{color:"primary",children:w.name})}),t.jsx(te,{color:"primary",children:a})]}),t.jsxs(K,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:h("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:w,autoFocus:!0,onChange:j=>{const N=j.target.value;C(N.url),e(N)},SelectProps:{open:g,MenuProps:{anchorEl:b.current},renderValue:j=>j==null?void 0:j.name,onClose:()=>{l(!1)}},style:{display:"none"},margin:"normal",children:[v==null?void 0:v.map(j=>t.jsx(ye,{sx:{width:"400px",maxWidth:"90vw"},value:j,"data-cy":j.url,children:t.jsx($r,{teamDid:u,store:j,onDelete:()=>{var N;k===j.url&&C((N=v[0])==null?void 0:N.url)}})},j.url)),!xo.isInServerlessMode(c)&&t.jsx(Mr,{disabled:o,storeList:v,teamDid:u,onAdd:j=>{C(j)}})]}),n({currentRegistry:w})]})}cn.propTypes={onChange:i.func,loading:i.bool,children:i.any.isRequired,extra:i.node,storageKey:i.string,stores:i.arrayOf(i.shape({name:i.string.isRequired,url:i.string.isRequired}))};cn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Ys=$.div`
128
+ `;function cn({onChange:e,loading:o,children:n,extra:a,stores:r,storageKey:s}){const{t:h}=G(),{info:c,inService:p}=H(),{blocklet:x}=pe(),[g,l]=f.useState(!1),b=f.useRef(null),[d,T]=f.useState(),[S,R]=vs(s||"tmp"),[P,C]=s?[S,R]:[d,T],{storeList:m,teamDid:u}=lo({fromBlocklet:p,blocklet:x,nodeInfo:c}),v=co([...r.map(j=>({...j,protected:!0})),...m],"url"),w=P&&v.find(j=>P===j.url)||v[0];return t.jsxs(t.Fragment,{children:[t.jsxs(Ys,{children:[t.jsx(ae,{ref:b,color:"primary","data-cy":"add-component-select-store",endIcon:t.jsx(js,{color:"primary"}),onClick:()=>{l(!0)},style:{padding:"0 2px"},children:t.jsx(te,{color:"primary",children:w.name})}),t.jsx(te,{color:"primary",children:a})]}),t.jsxs(K,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:h("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:w,autoFocus:!0,onChange:j=>{const N=j.target.value;C(N.url),e(N)},SelectProps:{open:g,MenuProps:{anchorEl:b.current},renderValue:j=>j==null?void 0:j.name,onClose:()=>{l(!1)}},style:{display:"none"},margin:"normal",children:[v==null?void 0:v.map(j=>t.jsx(ye,{sx:{width:"400px",maxWidth:"90vw"},value:j,"data-cy":j.url,children:t.jsx($r,{teamDid:u,store:j,onDelete:()=>{var N;P===j.url&&C((N=v[0])==null?void 0:N.url)}})},j.url)),!xo.isInServerlessMode(c)&&t.jsx(Mr,{disabled:o,storeList:v,teamDid:u,onAdd:j=>{C(j)}})]}),n({currentRegistry:w})]})}cn.propTypes={onChange:i.func,loading:i.bool,children:i.any.isRequired,extra:i.node,storageKey:i.string,stores:i.arrayOf(i.shape({name:i.string.isRequired,url:i.string.isRequired}))};cn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Ys=$.div`
129
129
  display: flex;
130
130
  justify-content: space-between;
131
131
  align-items: center;
@@ -136,11 +136,11 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
136
136
  color: ${e=>e.theme.palette.text.primary};
137
137
  // font-weight: bold;
138
138
  }
139
- `,Ks={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},Hs={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},Qs={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},Xs=(e,o)=>gt(o,`/blocklets/${e.did}`),no=({blocklet:e,attribute:o,value:n})=>e._formatted?e._formatted[o]:n,Zs=e=>e.inStore&&B.isFreeBlocklet(e)===!1;function dn({blocklet:e,blocklets:o,handleButtonClick:n,endpoint:a,serverVersion:r}){var R,k;const{t:s}=W();let h=gt(a,or(e.did,e.logo||""));try{const C=new URL(h);C.searchParams.set("v",e.version||+new Date),h=C.href}catch{}const[c,p]=f.useState(!1),x=async()=>{try{p(!0),await n({meta:e,registryUrl:a,blocklets:o})}catch(C){L.error(C.message)}finally{p(!1)}},{blocklet:g}=pe(),l=()=>((g==null?void 0:g.children)||[]).find(u=>u.meta.bundleDid===e.did).meta.version,d=(()=>{const C=((g==null?void 0:g.children)||[]).find(m=>m.meta.bundleDid===e.did);if(C){try{const m=C.meta.version,u=e.version;if(rr.gt(u,m))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),T=(R=e.requirements)==null?void 0:R.server,S=[];return d==="upgrade"?S.push({key:"upgrade",icon:t.jsx(Q,{icon:Qs,color:"success.light",width:20,height:20},"version"),title:`${l()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:t.jsx(y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):d==="disable"?S.push({key:"disable",icon:t.jsx(Q,{icon:Ks,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Zs(e)&&S.push({key:"purchase",icon:t.jsx(Q,{icon:Hs,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),t.jsx(Js,{title:no({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:no({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?h:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:d!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:d==="disable"?void 0:x,icons:(k=e.docker)!=null&&k.image?[{key:"docker",icon:t.jsx(y,{display:"flex",color:"primary.main",children:t.jsx(Q,{icon:yo})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:S,button:t.jsx(qr,{serverVersion:r,requirementVersion:T,size:"small",children:t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Gr,{children:t.jsx(ae,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:C=>{C.preventDefault(),C.stopPropagation();const m=Xs(e,a);m&&window.open(m,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}dn.propTypes={blocklet:i.object.isRequired,blocklets:i.array,handleButtonClick:i.func,endpoint:i.string,serverVersion:i.string};dn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function un({handleButtonClick:e,handleSearchSelect:o,storeUrl:n,handleBlockletRender:a,extraFilter:r,serverVersion:s,resourceType:h,resourceDid:c,showResourcesSwitch:p,showCategory:x,compact:g,...l}){const b=ft(),{locale:d}=W(),[T,S]=f.useState(!1),[R,k]=f.useState({}),C=v=>{k(v)},m=n,u=f.useMemo(()=>Jo(b,{palette:{background:{default:b.palette.background.paper}}}),[b]);return f.useEffect(()=>{k({showResources:!0,resourceType:h,resourceDid:c})},[m,h,c]),f.useEffect(()=>{S(!0),k({showResources:!0,resourceType:h,resourceDid:c})},[]),t.jsx(er,{theme:u,children:t.jsx(tr,{FallbackComponent:nr,resetKeys:[m],children:t.jsxs(y,{...l,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(l.sx)?l.sx:[l.sx]],children:[T&&t.jsx(Ar,{showCategory:x,showResourcesSwitch:p,blockletRender:v=>{const w={...v,handleButtonClick:e,endpoint:m};return a({...v,defaultRender:t.jsx(dn,{...w})})},compact:g,minItemWidth:300,baseSearch:!0,endpoint:m,locale:d,onFilterChange:C,onSearchSelect:o,filters:R,extraFilter:r,serverVersion:s,fetchCategoryDelay:500}),t.jsx(y,{sx:{mt:2},children:" "})]})})})}un.propTypes={storeUrl:i.string.isRequired,handleButtonClick:i.func,handleSearchSelect:i.func,handleBlockletRender:i.func,extraFilter:i.func,serverVersion:i.string,resourceType:i.string,resourceDid:i.string,showResourcesSwitch:i.bool,showCategory:i.bool,compact:i.bool};un.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Js=$(Wr)`
139
+ `,Ks={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},Hs={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},Qs={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},Xs=(e,o)=>gt(o,`/blocklets/${e.did}`),no=({blocklet:e,attribute:o,value:n})=>e._formatted?e._formatted[o]:n,Zs=e=>e.inStore&&B.isFreeBlocklet(e)===!1;function dn({blocklet:e,blocklets:o,handleButtonClick:n,endpoint:a,serverVersion:r}){var R,P;const{t:s}=G();let h=gt(a,or(e.did,e.logo||""));try{const C=new URL(h);C.searchParams.set("v",e.version||+new Date),h=C.href}catch{}const[c,p]=f.useState(!1),x=async()=>{try{p(!0),await n({meta:e,registryUrl:a,blocklets:o})}catch(C){L.error(C.message)}finally{p(!1)}},{blocklet:g}=pe(),l=()=>((g==null?void 0:g.children)||[]).find(u=>u.meta.bundleDid===e.did).meta.version,d=(()=>{const C=((g==null?void 0:g.children)||[]).find(m=>m.meta.bundleDid===e.did);if(C){try{const m=C.meta.version,u=e.version;if(rr.gt(u,m))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),T=(R=e.requirements)==null?void 0:R.server,S=[];return d==="upgrade"?S.push({key:"upgrade",icon:t.jsx(Q,{icon:Qs,color:"success.light",width:20,height:20},"version"),title:`${l()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:t.jsx(y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):d==="disable"?S.push({key:"disable",icon:t.jsx(Q,{icon:Ks,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Zs(e)&&S.push({key:"purchase",icon:t.jsx(Q,{icon:Hs,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),t.jsx(Js,{title:no({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:no({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?h:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:d!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:d==="disable"?void 0:x,icons:(P=e.docker)!=null&&P.image?[{key:"docker",icon:t.jsx(y,{display:"flex",color:"primary.main",children:t.jsx(Q,{icon:yo})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:S,button:t.jsx(qr,{serverVersion:r,requirementVersion:T,size:"small",children:t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Wr,{children:t.jsx(ae,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:C=>{C.preventDefault(),C.stopPropagation();const m=Xs(e,a);m&&window.open(m,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}dn.propTypes={blocklet:i.object.isRequired,blocklets:i.array,handleButtonClick:i.func,endpoint:i.string,serverVersion:i.string};dn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function un({handleButtonClick:e,handleSearchSelect:o,storeUrl:n,handleBlockletRender:a,extraFilter:r,serverVersion:s,resourceType:h,resourceDid:c,showResourcesSwitch:p,showCategory:x,compact:g,...l}){const b=ft(),{locale:d}=G(),[T,S]=f.useState(!1),[R,P]=f.useState({}),C=v=>{P(v)},m=n,u=f.useMemo(()=>Jo(b,{palette:{background:{default:b.palette.background.paper}}}),[b]);return f.useEffect(()=>{P({showResources:!0,resourceType:h,resourceDid:c})},[m,h,c]),f.useEffect(()=>{S(!0),P({showResources:!0,resourceType:h,resourceDid:c})},[]),t.jsx(er,{theme:u,children:t.jsx(tr,{FallbackComponent:nr,resetKeys:[m],children:t.jsxs(y,{...l,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(l.sx)?l.sx:[l.sx]],children:[T&&t.jsx(Ar,{showCategory:x,showResourcesSwitch:p,blockletRender:v=>{const w={...v,handleButtonClick:e,endpoint:m};return a({...v,defaultRender:t.jsx(dn,{...w})})},compact:g,minItemWidth:300,baseSearch:!0,endpoint:m,locale:d,onFilterChange:C,onSearchSelect:o,filters:R,extraFilter:r,serverVersion:s,fetchCategoryDelay:500}),t.jsx(y,{sx:{mt:2},children:" "})]})})})}un.propTypes={storeUrl:i.string.isRequired,handleButtonClick:i.func,handleSearchSelect:i.func,handleBlockletRender:i.func,extraFilter:i.func,serverVersion:i.string,resourceType:i.string,resourceDid:i.string,showResourcesSwitch:i.bool,showCategory:i.bool,compact:i.bool};un.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Js=$(Gr)`
140
140
  .ms-highlight {
141
141
  color: ${e=>e.theme.palette.primary.main};
142
142
  }
143
- `,pn=f.forwardRef(({meta:e,isMobile:o,onStepChange:n},a)=>{const r=ft(),{steps:s,activeStep:h,setActiveStepByKey:c,setActiveStepByIndex:p}=Vr(),{t:x,locale:g}=W(),l=s[h];return f.useEffect(()=>{n(h)},[n,h]),f.useImperativeHandle(a,()=>({setActiveStepByKey:c,setActiveStepByIndex:p})),t.jsx(ti,{component:"div",className:o?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:t.jsx(Yr,{locale:g,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?sr({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:r,stepTip:x("blocklet.component.add"),children:t.jsx(ei,{children:typeof(l==null?void 0:l.body)=="function"?l.body():l==null?void 0:l.body})})})});pn.propTypes={meta:i.any,onStepChange:i.func.isRequired,isMobile:i.bool.isRequired};pn.defaultProps={meta:null};const oo=e=>e.isMobile?`
143
+ `,pn=f.forwardRef(({meta:e,isMobile:o,onStepChange:n},a)=>{const r=ft(),{steps:s,activeStep:h,setActiveStepByKey:c,setActiveStepByIndex:p}=Vr(),{t:x,locale:g}=G(),l=s[h];return f.useEffect(()=>{n(h)},[n,h]),f.useImperativeHandle(a,()=>({setActiveStepByKey:c,setActiveStepByIndex:p})),t.jsx(ti,{component:"div",className:o?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:t.jsx(Yr,{locale:g,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?sr({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:r,stepTip:x("blocklet.component.add"),children:t.jsx(ei,{children:typeof(l==null?void 0:l.body)=="function"?l.body():l==null?void 0:l.body})})})});pn.propTypes={meta:i.any,onStepChange:i.func.isRequired,isMobile:i.bool.isRequired};pn.defaultProps={meta:null};const oo=e=>e.isMobile?`
144
144
  height: calc(100vh - 56px - 64px - 48px);
145
145
  `:"",ei=$.div`
146
146
  width: 100%;
@@ -281,7 +281,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
281
281
  & .connect {
282
282
  background: white;
283
283
  }
284
- `,ni=pn,oi=e=>e.inStore&&B.isFreeBlocklet(e)===!1,ri=e=>{var o;return[Y.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Y.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=e==null?void 0:e.capabilities)==null?void 0:o.didSpace)},Ot=e=>{var o,n;return((n=(o=e==null?void 0:e.configs)==null?void 0:o.find(a=>a.key===Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},si=e=>(e.environments||[]).some(o=>o.required),ro=(e,o)=>e==null?void 0:e.some(n=>n.required&&!o[n.key]),ii=({params:e,blocklet:o,t:n})=>{const a=e.title||e.name;return a?((o==null?void 0:o.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:a}):n("blocklet.component.addNext",{name:a}):n("common.next")},so=({componentDid:e,timeout:o=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},o)};function mn({onClose:e,mode:o,stores:n,resourceType:a,resourceDid:r,storageKey:s,inDialog:h,selectedMeta:c,storeUrl:p,showResourcesSwitch:x,showFromUrl:g,enableRunBackground:l,showCategory:b}){var _n,In,Dn,Un,Je,Nn,et,Ln,Bn,On;const{t:d,locale:T}=W(),[S,R]=f.useState(!1),[k,C]=f.useState(null),[m,u]=f.useState(""),[v,w]=f.useState(""),{api:j,ws:{useSubscription:N},inService:M,info:Z}=H(),{blocklet:I,actions:{refreshBlocklet:ne}}=pe(),[me,J]=f.useState(null),[Pe,we]=f.useState(!1),Ee={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[_,fe]=f.useState(Ee),[G,he]=f.useState(0),A=f.useRef({}),ke=f.useRef({}),le=f.useRef({}),_e=uo(P=>P.breakpoints.down("md")),E=ir(),[V,ce]=f.useState(!0),{meta:F}=A.current,ee=ns(F),be=f.useRef(!1),z=P=>fe(D=>({...D,...P}));f.useEffect(()=>{if(_.pathPrefix){const{errMsg:P}=kn({..._,pathPrefix:_.pathPrefix,locale:T});u(P)}},[_.pathPrefix]),f.useEffect(()=>{G===0&&fe(Ee)},[G]);const Ie=()=>{const P=Ot(I)??"";z({didSpaceEndpoint:P})},Re=()=>{var P;return(P=A==null?void 0:A.current)!=null&&P.meta?B.getDisplayName(A.current):""},We=()=>{R(!1),fe({}),be.current=!1,A.current={},e()},Le=P=>{const D=O=>{z({installResultProps:{variant:"error",title:Re(),subTitle:P,footer:t.jsx(ae,{className:"bottom-button",disabled:O,"data-cy":"retry-install-component",onClick:async()=>{D(!0),await Pn(A.current.installInput)},children:t.jsxs(y,{display:"flex",alignItems:"center",children:[O&&t.jsx(ue,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};D()},Ze=P=>D=>{var O,q;(((O=D==null?void 0:D.meta)==null?void 0:O.did)||(D==null?void 0:D.meta))===((q=I==null?void 0:I.meta)==null?void 0:q.did)&&P(D)},_o=()=>{so({timeout:0,componentDid:E.componentDid,manual:!0}),We(),setTimeout(()=>{const P=document.getElementsByClassName("dashboard-main")[0];P&&(P.scrollTop=P.scrollHeight)},200)};N(Y.BlockletEvents.componentInstalled,Ze(()=>{z({installResultProps:{variant:"success",title:Re(),subTitle:d("blocklet.component.installSuccessTip")}}),so({componentDid:E.componentDid})}),[(_n=I==null?void 0:I.meta)==null?void 0:_n.did]),N(Y.BlockletEvents.statusChange,Ze(()=>{const P=Ot(I);z(D=>({...D,didSpaceEndpoint:P}))}),[(In=I==null?void 0:I.meta)==null?void 0:In.did]),N(Y.BlockletEvents.downloadFailed,Ze(()=>{be.current=!1,Le(d("blocklet.component.installComponentError"))}),[(Dn=I==null?void 0:I.meta)==null?void 0:Dn.did]),N(Y.BlockletEvents.installFailed,Ze(()=>{be.current=!1,Le(d("blocklet.component.installComponentError"))}),[(Un=I==null?void 0:I.meta)==null?void 0:Un.did]);const de=[],Tn=P=>((I==null?void 0:I.children)||[]).find(D=>D.meta.did===P),Pn=async P=>{var Oe,$e;be.current=!0;const{pathPrefix:D,bundleDid:O,title:q,componentName:De="",componentDid:Be=""}=_,Ue=((Oe=A.current)==null?void 0:Oe.meta)||{},{configs:Se=[],registryUrl:Te,inStore:ze,inputUrl:Ve,dist:Pt}=Ue,Ye=($e=A.current)==null?void 0:$e.downloadTokenList,re=Ve||(ze?Wn(Te,O,Pt):"");R(!0);const tt={rootDid:I.meta.did,url:re,mountPoint:D?je(D):`/${je(Ue.title||Ue.name)}`,title:q,name:De,did:Be,dist:{tarball:"",integrity:""},onlyRequired:!V,..._.hasEnvironmentsStep&&Se.length>0?{configs:Se.map(xe=>({...xe,value:_.configsValue[xe.key]||""}))}:{},...Ye?{downloadTokenList:Ye}:{},...P};try{if(await j.installComponent({input:tt}),Te){const{teamDid:xe,storeList:Me}=lo({fromBlocklet:M,nodeInfo:Z,blocklet:I}),{isNew:kt,decoded:nt}=cr(Te,Me);kt&&await j.addBlockletStore({input:{teamDid:xe,url:nt}})}z({installResultProps:{}}),ne({showError:!1,attachRuntimeInfo:!1})}catch(xe){const Me=ie(xe);L.error(Me),console.error("installComponent error: ",xe),Le(Me)}finally{R(!1),A.current.installInput=tt}},kn=P=>{const D=jo({params:{...P,did:P.bundleDid},blocklets:[I],blocklet:I,locale:T});if(D){const O=Tn(P.bundleDid),q=Cs({params:{...P,did:P.bundleDid},blocklet:I});if(O&&O.mountPoint===q)return{errMsg:""}}return{errMsg:D}},ge=async P=>{var O,q;const{errMsg:D}=kn({..._,locale:T});u(D),G===de.length-2&&!be.current&&await Pn(P),(q=(O=ke.current)==null?void 0:O.setActiveStepByIndex)==null||q.call(O,De=>De+1)},Fe=()=>{var P,D;(D=(P=ke.current)==null?void 0:P.setActiveStepByIndex)==null||D.call(P,O=>O-1)},Io=()=>{const{pathPrefix:P,bundleDid:D,title:O,componentName:q="",componentDid:De=""}=_,{meta:Be={}}=A.current||{},{registryUrl:Ue,inStore:Se,inputUrl:Te,dist:ze}=Be,Ve=Se?Wn(Ue,D,ze):Te;J({meta:Be,installOpts:{type:"component",rootDid:I.meta.did,mountPoint:P,url:Ve,title:O,name:q,did:De}})},Do=P=>{we(!1),z({purchaseResultProps:{variant:"error",title:Re(),subTitle:P,style:{paddingTop:120},footer:t.jsx(ae,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{z({purchaseResultProps:{}})},children:d("common.retry")})}})},Uo=({downloadTokenList:P})=>{A.current.downloadTokenList=P,we(!1),ge()},Tt=({chooseParams:P=A.current,componentDid:D,isInit:O=!1})=>{var nt,$n,Mn,An;const{meta:q,registryUrl:De,inStore:Be,inputUrl:Ue}=P,{did:Se,title:Te,name:ze}=q,Ve=(((nt=I.settings)==null?void 0:nt.children)||[]).filter(se=>se.status==="deleted"&&se.meta.bundleDid===Se),Pt=D||"",Ye=($n=q.environments)==null?void 0:$n.map(se=>{const{name:_t,validation:ot,...rt}=se,It={validation:dr(ot)?"":ot};return{...rt,key:_t,...It}});A.current={...P,meta:{...q,configs:Ye,registryUrl:De,inStore:Be,inputUrl:Ue}};let re={};if(O){const se=[I],_t=Ye||[],ot=[],rt=co(lr([..._t,...ot]),"key").filter(Ae=>!!Ae.key).sort((Ae,st)=>Ae.required&&!st.required?-1:st.required&&!Ae.required?1:0),It=B.getSharedConfigObj(se[0],{configs:rt}),Dt={},qn=rt.map(Ae=>{const{default:st,key:it,...Lo}=Ae;return Dt[it]=It[it]||st,{...Lo,key:it,hidden:!!Y.BLOCKLET_CONFIGURABLE_KEY[it]}});re={...re,configsList:qn,configsValue:Dt,hasMissRequiredConfigs:ro(qn,Dt)}}const tt=I.children.some(se=>se.mountPoint==="/"),Oe=Ve.find(se=>se.meta.bundleDid===Se),$e=I.children.find(se=>se.meta.bundleDid===Se);re.title=Te||"",Oe?re={...re,pathPrefix:Oe.mountPoint||"",componentName:Oe.meta.name,hasEnvironmentsStep:!1}:$e?re={...re,pathPrefix:$e.mountPoint||"",componentName:$e.meta.name,hasEnvironmentsStep:!1}:re={...re,pathPrefix:tt?`/${je(Te)||je(ze)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((An=(Mn=A.current.meta)==null?void 0:Mn.environments)==null?void 0:An.length)>0};const xe=oi(A.current.meta),Me=ri(A.current.meta),kt=Ot(I);z({bundleDid:Se,componentDid:Pt,...re,hasRequiredEnvironments:si(A.current.meta),requirePurchase:xe,didSpaceIsRequiredSetup:Me,didSpaceEndpoint:kt}),O&&xe&&Io()};f.useEffect(()=>{!c||G!==0||!I||(Tt({chooseParams:{blocklets:[c],meta:c,registryUrl:p||c.homepage,inStore:!0},isInit:!0}),z({showFromUrlDialog:!1}),ge())},[c,G,I]),de.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:t.jsxs(Ne,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[g&&_.showFromUrlDialog&&t.jsx(hs,{mode:"component",onCancel:()=>{z({showFromUrlDialog:!1})},onSuccess:({meta:P,inputUrl:D,inStore:O,registryUrl:q})=>{Tt({chooseParams:{meta:P,inputUrl:D,inStore:O,registryUrl:q},isInit:!0}),z({showFromUrlDialog:!1}),ge()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),t.jsx(cn,{stores:n,extra:xo.isInServerlessMode(Z)?null:g?t.jsxs(ae,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{z({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(Yt,{style:{fontSize:20,marginRight:4}}),d("blocklet.component.addComponentTip.fromUrl")]}):null,loading:S,onChange:()=>{fe({}),A.current={}},storageKey:s,children:({currentRegistry:P})=>t.jsx(un,{showResourcesSwitch:x,showCategory:b,serverVersion:Z==null?void 0:Z.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:P.url,resourceType:a,resourceDid:r,handleButtonClick:D=>{Tt({chooseParams:{...D,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:D,defaultRender:O})=>{const q=(_==null?void 0:_.bundleDid)&&(_==null?void 0:_.bundleDid)===(D==null?void 0:D.did);return t.jsxs(li,{children:[t.jsx(y,{className:q?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...q?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:O}),q&&t.jsx(y,{className:"check-container",children:t.jsx(ar,{className:"check-icon"})})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:ii({params:_,blocklet:I,t:d}),onCancel:We,onConfirm:()=>{ge()}}),de.push({key:"agreement",name:d("launchBlocklet.introduction"),body:t.jsxs(Ne,{component:"div",className:"agreement-wrapper",children:[t.jsx(Co,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),t.jsx(os,{meta:F,onClickNext:ge,installRelated:V,onChangeInstallRelated:ce,handleDescEle:t.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:d("common.pre"),disabled:!ee,confirm:d(ee?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?We:Fe,onConfirm:()=>{we(!1),ge()}}),F&&_.requirePurchase&&de.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[d("common.verifyNFT"),t.jsx(dt,{})]}),body:t.jsxs(Ne,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Nn=(Je=le.current)==null?void 0:Je.getCurrentStep)==null?void 0:Nn.call(Je))===2||Pe)&&t.jsx(ct,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),at(_.purchaseResultProps)?me&&t.jsx(Gs,{ref:le,meta:me.meta,mode:_.componentDid?"verify":"both",onCancel:Do,installOpts:me.installOpts,handlePaySuccess:Uo}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(Hn,{..._.purchaseResultProps})})]}),disabled:((Ln=(et=le.current)==null?void 0:et.getCurrentStep)==null?void 0:Ln.call(et))===2||Pe,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof le.current.onNext=="function"&&(le.current.onNext(),we(!0))},onCancel:()=>{Fe()}}),B.hasStartEngine(F)&&po.hasMountPoint(F)?de.push({key:"config",name:d("common.config"),error:m,body:t.jsxs(Ne,{component:"div",children:[t.jsx(ct,{title:d("common.config"),subTitle:d("blocklet.component.addComponentTip.config")}),t.jsx(K,{label:d("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:v||d("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:_.pathPrefix,onChange:P=>{const D=P.target.value;z({pathPrefix:D}),w(d("common.slugifyHint",{value:Ft(D)}))}}),!!m&&t.jsx($t,{severity:"error",style:{width:"100%",marginTop:8},children:m})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Fe,onConfirm:()=>{ge()}}):F&&(_.pathPrefix=((On=(Bn=F.interfaces)==null?void 0:Bn[0])==null?void 0:On.path)||`/${F.did}`),F&&(_!=null&&_.hasEnvironmentsStep)&&de.push({key:"environment",name:t.jsxs(t.Fragment,{children:[d("common.environment")," ",_.hasRequiredEnvironments&&t.jsx(dt,{})]}),disabled:!!k||(_==null?void 0:_.hasMissRequiredConfigs),body:()=>t.jsxs(Ne,{component:"div",style:{overflowY:"auto"},children:[t.jsx(ct,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),t.jsx(on,{style:{marginTop:-12,width:"100%"},schema:_.configsList,defaultValue:_.configsValue,onChange:(P,{action:D,currentItem:O,allValues:q})=>{D==="confirm"&&z({hasMissRequiredConfigs:ro(_.configsList,q),configsValue:q}),D==="edit"?C(O):["cancel","confirm"].includes(D)&&C(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Fe,onConfirm:ge}),F&&(_!=null&&_.didSpaceIsRequiredSetup)&&de.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",_.didSpaceIsRequiredSetup==="required"&&t.jsx(dt,{})]}),disabled:(_==null?void 0:_.didSpaceIsRequiredSetup)&&!_.didSpaceEndpoint,body:()=>t.jsx(es,{children:t.jsxs(Ne,{component:"div",children:[t.jsx(ct,{title:d("blocklet.component.didSpaceConfig"),subTitle:d("blocklet.component.didSpaceConfigTip")}),t.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx(ln,{blockletMeta:A.current.meta,onNext:()=>{ge()},onEndpointUpdate:Ie})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Fe,onConfirm:ge}),de.push({key:"install",name:Tn(F==null?void 0:F.did)?d("common.upgrade"):d("common.install"),disabled:l?!1:at(_.installResultProps),loading:l?!1:at(_.installResultProps),body:t.jsx(Ne,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:at(_.installResultProps)?t.jsx(Kr,{message:t.jsx(ci,{children:d(l?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(Hn,{..._.installResultProps})})}),confirm:d("common.complete"),onConfirm:_o});const oe=de[G]||{},No=()=>S||oe.error||!_.bundleDid?!0:G>1?!_.pathPrefix:!1;return I?t.jsxs(ai,{sx:h?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[t.jsx(Hr,{steps:de,mode:"memory",children:t.jsx(ni,{ref:ke,meta:F,isMobile:_e,onStepChange:P=>{he(P)}})}),t.jsxs(y,{className:"action-bar",children:[oe.cancel&&t.jsx(ae,{onClick:P=>{P.stopPropagation(),oe.onCancel()},disabled:G===de.length-2&&S,color:"inherit",children:oe.cancel||d("common.cancel")}),oe.confirm&&t.jsx(ae,{onClick:P=>{P.stopPropagation(),oe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:S||(typeof oe.disabled=="boolean"?oe.disabled:No()),variant:"contained",autoFocus:!0,title:oe.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof oe.loading=="boolean"?oe.loading:S)&&t.jsx(ue,{style:{marginRight:8},size:16}),t.jsx(y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:oe.confirm})]})})]})]}):null}mn.propTypes={onClose:i.func,mode:i.oneOf(["normal","embed"]),inDialog:i.bool,stores:i.arrayOf(i.string),storeUrl:i.string,resourceType:i.string,resourceDid:i.string,storageKey:i.string,selectedMeta:i.object,showResourcesSwitch:i.bool,showFromUrl:i.bool,enableRunBackground:i.bool,showCategory:i.bool};mn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const ai=$(y)`
284
+ `,ni=pn,oi=e=>e.inStore&&B.isFreeBlocklet(e)===!1,ri=e=>{var o;return[Y.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Y.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=e==null?void 0:e.capabilities)==null?void 0:o.didSpace)},Ot=e=>{var o,n;return((n=(o=e==null?void 0:e.configs)==null?void 0:o.find(a=>a.key===Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},si=e=>(e.environments||[]).some(o=>o.required),ro=(e,o)=>e==null?void 0:e.some(n=>n.required&&!o[n.key]),ii=({params:e,blocklet:o,t:n})=>{const a=e.title||e.name;return a?((o==null?void 0:o.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:a}):n("blocklet.component.addNext",{name:a}):n("common.next")},so=({componentDid:e,timeout:o=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},o)};function mn({onClose:e,mode:o,stores:n,resourceType:a,resourceDid:r,storageKey:s,inDialog:h,selectedMeta:c,storeUrl:p,showResourcesSwitch:x,showFromUrl:g,enableRunBackground:l,showCategory:b}){var _n,In,Dn,Un,Je,Nn,et,Ln,Bn,On;const{t:d,locale:T}=G(),[S,R]=f.useState(!1),[P,C]=f.useState(null),[m,u]=f.useState(""),[v,w]=f.useState(""),{api:j,ws:{useSubscription:N},inService:M,info:Z}=H(),{blocklet:I,actions:{refreshBlocklet:ne}}=pe(),[me,J]=f.useState(null),[ke,we]=f.useState(!1),Ee={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[_,fe]=f.useState(Ee),[W,he]=f.useState(0),A=f.useRef({}),Pe=f.useRef({}),le=f.useRef({}),_e=uo(k=>k.breakpoints.down("md")),E=ir(),[V,ce]=f.useState(!0),{meta:F}=A.current,ee=ns(F),be=f.useRef(!1),z=k=>fe(D=>({...D,...k}));f.useEffect(()=>{if(_.pathPrefix){const{errMsg:k}=Pn({..._,pathPrefix:_.pathPrefix,locale:T});u(k)}},[_.pathPrefix]),f.useEffect(()=>{W===0&&fe(Ee)},[W]);const Ie=()=>{const k=Ot(I)??"";z({didSpaceEndpoint:k})},Re=()=>{var k;return(k=A==null?void 0:A.current)!=null&&k.meta?B.getDisplayName(A.current):""},Ge=()=>{R(!1),fe({}),be.current=!1,A.current={},e()},Le=k=>{const D=O=>{z({installResultProps:{variant:"error",title:Re(),subTitle:k,footer:t.jsx(ae,{className:"bottom-button",disabled:O,"data-cy":"retry-install-component",onClick:async()=>{D(!0),await kn(A.current.installInput)},children:t.jsxs(y,{display:"flex",alignItems:"center",children:[O&&t.jsx(ue,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};D()},Ze=k=>D=>{var O,q;(((O=D==null?void 0:D.meta)==null?void 0:O.did)||(D==null?void 0:D.meta))===((q=I==null?void 0:I.meta)==null?void 0:q.did)&&k(D)},_o=()=>{so({timeout:0,componentDid:E.componentDid,manual:!0}),Ge(),setTimeout(()=>{const k=document.getElementsByClassName("dashboard-main")[0];k&&(k.scrollTop=k.scrollHeight)},200)};N(Y.BlockletEvents.componentInstalled,Ze(()=>{z({installResultProps:{variant:"success",title:Re(),subTitle:d("blocklet.component.installSuccessTip")}}),so({componentDid:E.componentDid})}),[(_n=I==null?void 0:I.meta)==null?void 0:_n.did]),N(Y.BlockletEvents.statusChange,Ze(()=>{const k=Ot(I);z(D=>({...D,didSpaceEndpoint:k}))}),[(In=I==null?void 0:I.meta)==null?void 0:In.did]),N(Y.BlockletEvents.downloadFailed,Ze(()=>{be.current=!1,Le(d("blocklet.component.installComponentError"))}),[(Dn=I==null?void 0:I.meta)==null?void 0:Dn.did]),N(Y.BlockletEvents.installFailed,Ze(()=>{be.current=!1,Le(d("blocklet.component.installComponentError"))}),[(Un=I==null?void 0:I.meta)==null?void 0:Un.did]);const de=[],Tn=k=>((I==null?void 0:I.children)||[]).find(D=>D.meta.did===k),kn=async k=>{var Oe,$e;be.current=!0;const{pathPrefix:D,bundleDid:O,title:q,componentName:De="",componentDid:Be=""}=_,Ue=((Oe=A.current)==null?void 0:Oe.meta)||{},{configs:Se=[],registryUrl:Te,inStore:ze,inputUrl:Ve,dist:kt}=Ue,Ye=($e=A.current)==null?void 0:$e.downloadTokenList,re=Ve||(ze?Gn(Te,O,kt):"");R(!0);const tt={rootDid:I.meta.did,url:re,mountPoint:D?je(D):`/${je(Ue.title||Ue.name)}`,title:q,name:De,did:Be,dist:{tarball:"",integrity:""},onlyRequired:!V,..._.hasEnvironmentsStep&&Se.length>0?{configs:Se.map(xe=>({...xe,value:_.configsValue[xe.key]||""}))}:{},...Ye?{downloadTokenList:Ye}:{},...k};try{if(await j.installComponent({input:tt}),Te){const{teamDid:xe,storeList:Me}=lo({fromBlocklet:M,nodeInfo:Z,blocklet:I}),{isNew:Pt,decoded:nt}=cr(Te,Me);Pt&&await j.addBlockletStore({input:{teamDid:xe,url:nt}})}z({installResultProps:{}}),ne({showError:!1,attachRuntimeInfo:!1})}catch(xe){const Me=ie(xe);L.error(Me),console.error("installComponent error: ",xe),Le(Me)}finally{R(!1),A.current.installInput=tt}},Pn=k=>{const D=jo({params:{...k,did:k.bundleDid},blocklets:[I],blocklet:I,locale:T});if(D){const O=Tn(k.bundleDid),q=Cs({params:{...k,did:k.bundleDid},blocklet:I});if(O&&O.mountPoint===q)return{errMsg:""}}return{errMsg:D}},ge=async k=>{var O,q;const{errMsg:D}=Pn({..._,locale:T});u(D),W===de.length-2&&!be.current&&await kn(k),(q=(O=Pe.current)==null?void 0:O.setActiveStepByIndex)==null||q.call(O,De=>De+1)},Fe=()=>{var k,D;(D=(k=Pe.current)==null?void 0:k.setActiveStepByIndex)==null||D.call(k,O=>O-1)},Io=()=>{const{pathPrefix:k,bundleDid:D,title:O,componentName:q="",componentDid:De=""}=_,{meta:Be={}}=A.current||{},{registryUrl:Ue,inStore:Se,inputUrl:Te,dist:ze}=Be,Ve=Se?Gn(Ue,D,ze):Te;J({meta:Be,installOpts:{type:"component",rootDid:I.meta.did,mountPoint:k,url:Ve,title:O,name:q,did:De}})},Do=k=>{we(!1),z({purchaseResultProps:{variant:"error",title:Re(),subTitle:k,style:{paddingTop:120},footer:t.jsx(ae,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{z({purchaseResultProps:{}})},children:d("common.retry")})}})},Uo=({downloadTokenList:k})=>{A.current.downloadTokenList=k,we(!1),ge()},Tt=({chooseParams:k=A.current,componentDid:D,isInit:O=!1})=>{var nt,$n,Mn,An;const{meta:q,registryUrl:De,inStore:Be,inputUrl:Ue}=k,{did:Se,title:Te,name:ze}=q,Ve=(((nt=I.settings)==null?void 0:nt.children)||[]).filter(se=>se.status==="deleted"&&se.meta.bundleDid===Se),kt=D||"",Ye=($n=q.environments)==null?void 0:$n.map(se=>{const{name:_t,validation:ot,...rt}=se,It={validation:dr(ot)?"":ot};return{...rt,key:_t,...It}});A.current={...k,meta:{...q,configs:Ye,registryUrl:De,inStore:Be,inputUrl:Ue}};let re={};if(O){const se=[I],_t=Ye||[],ot=[],rt=co(lr([..._t,...ot]),"key").filter(Ae=>!!Ae.key).sort((Ae,st)=>Ae.required&&!st.required?-1:st.required&&!Ae.required?1:0),It=B.getSharedConfigObj(se[0],{configs:rt}),Dt={},qn=rt.map(Ae=>{const{default:st,key:it,...Lo}=Ae;return Dt[it]=It[it]||st,{...Lo,key:it,hidden:!!Y.BLOCKLET_CONFIGURABLE_KEY[it]}});re={...re,configsList:qn,configsValue:Dt,hasMissRequiredConfigs:ro(qn,Dt)}}const tt=I.children.some(se=>se.mountPoint==="/"),Oe=Ve.find(se=>se.meta.bundleDid===Se),$e=I.children.find(se=>se.meta.bundleDid===Se);re.title=Te||"",Oe?re={...re,pathPrefix:Oe.mountPoint||"",componentName:Oe.meta.name,hasEnvironmentsStep:!1}:$e?re={...re,pathPrefix:$e.mountPoint||"",componentName:$e.meta.name,hasEnvironmentsStep:!1}:re={...re,pathPrefix:tt?`/${je(Te)||je(ze)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((An=(Mn=A.current.meta)==null?void 0:Mn.environments)==null?void 0:An.length)>0};const xe=oi(A.current.meta),Me=ri(A.current.meta),Pt=Ot(I);z({bundleDid:Se,componentDid:kt,...re,hasRequiredEnvironments:si(A.current.meta),requirePurchase:xe,didSpaceIsRequiredSetup:Me,didSpaceEndpoint:Pt}),O&&xe&&Io()};f.useEffect(()=>{!c||W!==0||!I||(Tt({chooseParams:{blocklets:[c],meta:c,registryUrl:p||c.homepage,inStore:!0},isInit:!0}),z({showFromUrlDialog:!1}),ge())},[c,W,I]),de.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:t.jsxs(Ne,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[g&&_.showFromUrlDialog&&t.jsx(hs,{mode:"component",onCancel:()=>{z({showFromUrlDialog:!1})},onSuccess:({meta:k,inputUrl:D,inStore:O,registryUrl:q})=>{Tt({chooseParams:{meta:k,inputUrl:D,inStore:O,registryUrl:q},isInit:!0}),z({showFromUrlDialog:!1}),ge()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),t.jsx(cn,{stores:n,extra:xo.isInServerlessMode(Z)?null:g?t.jsxs(ae,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{z({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(Yt,{style:{fontSize:20,marginRight:4}}),d("blocklet.component.addComponentTip.fromUrl")]}):null,loading:S,onChange:()=>{fe({}),A.current={}},storageKey:s,children:({currentRegistry:k})=>t.jsx(un,{showResourcesSwitch:x,showCategory:b,serverVersion:Z==null?void 0:Z.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:k.url,resourceType:a,resourceDid:r,handleButtonClick:D=>{Tt({chooseParams:{...D,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:D,defaultRender:O})=>{const q=(_==null?void 0:_.bundleDid)&&(_==null?void 0:_.bundleDid)===(D==null?void 0:D.did);return t.jsxs(li,{children:[t.jsx(y,{className:q?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...q?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:O}),q&&t.jsx(y,{className:"check-container",children:t.jsx(ar,{className:"check-icon"})})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:ii({params:_,blocklet:I,t:d}),onCancel:Ge,onConfirm:()=>{ge()}}),de.push({key:"agreement",name:d("launchBlocklet.introduction"),body:t.jsxs(Ne,{component:"div",className:"agreement-wrapper",children:[t.jsx(Co,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),t.jsx(os,{meta:F,onClickNext:ge,installRelated:V,onChangeInstallRelated:ce,handleDescEle:t.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:d("common.pre"),disabled:!ee,confirm:d(ee?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Ge:Fe,onConfirm:()=>{we(!1),ge()}}),F&&_.requirePurchase&&de.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[d("common.verifyNFT"),t.jsx(dt,{})]}),body:t.jsxs(Ne,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Nn=(Je=le.current)==null?void 0:Je.getCurrentStep)==null?void 0:Nn.call(Je))===2||ke)&&t.jsx(ct,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),at(_.purchaseResultProps)?me&&t.jsx(Ws,{ref:le,meta:me.meta,mode:_.componentDid?"verify":"both",onCancel:Do,installOpts:me.installOpts,handlePaySuccess:Uo}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(Hn,{..._.purchaseResultProps})})]}),disabled:((Ln=(et=le.current)==null?void 0:et.getCurrentStep)==null?void 0:Ln.call(et))===2||ke,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof le.current.onNext=="function"&&(le.current.onNext(),we(!0))},onCancel:()=>{Fe()}}),B.hasStartEngine(F)&&po.hasMountPoint(F)?de.push({key:"config",name:d("common.config"),error:m,body:t.jsxs(Ne,{component:"div",children:[t.jsx(ct,{title:d("common.config"),subTitle:d("blocklet.component.addComponentTip.config")}),t.jsx(K,{label:d("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:v||d("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:_.pathPrefix,onChange:k=>{const D=k.target.value;z({pathPrefix:D}),w(d("common.slugifyHint",{value:Ft(D)}))}}),!!m&&t.jsx($t,{severity:"error",style:{width:"100%",marginTop:8},children:m})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Fe,onConfirm:()=>{ge()}}):F&&(_.pathPrefix=((On=(Bn=F.interfaces)==null?void 0:Bn[0])==null?void 0:On.path)||`/${F.did}`),F&&(_!=null&&_.hasEnvironmentsStep)&&de.push({key:"environment",name:t.jsxs(t.Fragment,{children:[d("common.environment")," ",_.hasRequiredEnvironments&&t.jsx(dt,{})]}),disabled:!!P||(_==null?void 0:_.hasMissRequiredConfigs),body:()=>t.jsxs(Ne,{component:"div",style:{overflowY:"auto"},children:[t.jsx(ct,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),t.jsx(on,{style:{marginTop:-12,width:"100%"},schema:_.configsList,defaultValue:_.configsValue,onChange:(k,{action:D,currentItem:O,allValues:q})=>{D==="confirm"&&z({hasMissRequiredConfigs:ro(_.configsList,q),configsValue:q}),D==="edit"?C(O):["cancel","confirm"].includes(D)&&C(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Fe,onConfirm:ge}),F&&(_!=null&&_.didSpaceIsRequiredSetup)&&de.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",_.didSpaceIsRequiredSetup==="required"&&t.jsx(dt,{})]}),disabled:(_==null?void 0:_.didSpaceIsRequiredSetup)&&!_.didSpaceEndpoint,body:()=>t.jsx(es,{children:t.jsxs(Ne,{component:"div",children:[t.jsx(ct,{title:d("blocklet.component.didSpaceConfig"),subTitle:d("blocklet.component.didSpaceConfigTip")}),t.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx(ln,{blockletMeta:A.current.meta,onNext:()=>{ge()},onEndpointUpdate:Ie})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Fe,onConfirm:ge}),de.push({key:"install",name:Tn(F==null?void 0:F.did)?d("common.upgrade"):d("common.install"),disabled:l?!1:at(_.installResultProps),loading:l?!1:at(_.installResultProps),body:t.jsx(Ne,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:at(_.installResultProps)?t.jsx(Kr,{message:t.jsx(ci,{children:d(l?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(Hn,{..._.installResultProps})})}),confirm:d("common.complete"),onConfirm:_o});const oe=de[W]||{},No=()=>S||oe.error||!_.bundleDid?!0:W>1?!_.pathPrefix:!1;return I?t.jsxs(ai,{sx:h?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[t.jsx(Hr,{steps:de,mode:"memory",children:t.jsx(ni,{ref:Pe,meta:F,isMobile:_e,onStepChange:k=>{he(k)}})}),t.jsxs(y,{className:"action-bar",children:[oe.cancel&&t.jsx(ae,{onClick:k=>{k.stopPropagation(),oe.onCancel()},disabled:W===de.length-2&&S,color:"inherit",children:oe.cancel||d("common.cancel")}),oe.confirm&&t.jsx(ae,{onClick:k=>{k.stopPropagation(),oe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:S||(typeof oe.disabled=="boolean"?oe.disabled:No()),variant:"contained",autoFocus:!0,title:oe.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof oe.loading=="boolean"?oe.loading:S)&&t.jsx(ue,{style:{marginRight:8},size:16}),t.jsx(y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:oe.confirm})]})})]})]}):null}mn.propTypes={onClose:i.func,mode:i.oneOf(["normal","embed"]),inDialog:i.bool,stores:i.arrayOf(i.string),storeUrl:i.string,resourceType:i.string,resourceDid:i.string,storageKey:i.string,selectedMeta:i.object,showResourcesSwitch:i.bool,showFromUrl:i.bool,enableRunBackground:i.bool,showCategory:i.bool};mn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const ai=$(y)`
285
285
  .action-bar {
286
286
  display: flex;
287
287
  justify-content: flex-end;
@@ -351,14 +351,14 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
351
351
  font-size: 14px;
352
352
  margin-right: 6px;
353
353
  }
354
- `;function bt({blocklet:e,showDialog:o,setShowDialog:n,selectedMeta:a}){const{t:r}=W(),s=uo(p=>p.breakpoints.down("md")),{inService:h}=H(),c=()=>{n(!1)};return o?t.jsx(di,{title:r("blocklet.component.addWithName",{name:B.getDisplayName(e)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:s?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(p,x)=>{x!=="backdropClick"&&c()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:t.jsx(mn,{selectedMeta:a,onClose:c,storageKey:h?Fr:zr})}):null}bt.propTypes={selectedMeta:i.object,showDialog:i.bool.isRequired,setShowDialog:i.func.isRequired,blocklet:i.object.isRequired};bt.defaultProps={selectedMeta:null};const di=$(ht)`
354
+ `;function bt({blocklet:e,showDialog:o,setShowDialog:n,selectedMeta:a}){const{t:r}=G(),s=uo(p=>p.breakpoints.down("md")),{inService:h}=H(),c=()=>{n(!1)};return o?t.jsx(di,{title:r("blocklet.component.addWithName",{name:B.getDisplayName(e)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:s?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(p,x)=>{x!=="backdropClick"&&c()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:t.jsx(mn,{selectedMeta:a,onClose:c,storageKey:h?Fr:zr})}):null}bt.propTypes={selectedMeta:i.object,showDialog:i.bool.isRequired,setShowDialog:i.func.isRequired,blocklet:i.object.isRequired};bt.defaultProps={selectedMeta:null};const di=$(ht)`
355
355
  .ux-dialog_header {
356
356
  background-color: ${({theme:e})=>e.palette.background.paper};
357
357
  }
358
358
  .MuiDialogContent-root {
359
359
  background-color: ${({theme:e})=>e.palette.background.paper};
360
360
  }
361
- `;function fn({blocklet:e,children:o}){const{t:n}=W(),[a,r]=f.useState(!1),s=h=>{h.stopPropagation(),r(!0)};return t.jsxs(t.Fragment,{children:[typeof o=="function"?o({open:s}):t.jsxs(ye,{onClick:s,className:"component-action","data-cy":"action-add-component",children:[t.jsx(Yt,{style:{fontSize:18,marginRight:5}}),n("blocklet.component.add")]}),t.jsx(bt,{showDialog:a,setShowDialog:r,blocklet:e})]})}fn.propTypes={children:i.any,blocklet:i.object.isRequired};fn.defaultProps={children:null};const ui=e=>e.children.filter(o=>o.meta.interfaces.find(n=>n.type===Y.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:e,setParams:o,setError:n,serviceTypes:a}){const{t:r}=W(),{blocklet:s}=pe(),h=s.meta.did,c=ui(s),[p,x]=f.useState([]),g={301:r("common.redirectPermanently"),302:r("common.redirectTemporary"),307:r("common.redirectTemporary"),308:r("common.redirectPermanently")};return f.useEffect(()=>{if(e.type===U.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const l=c.find(T=>T.meta.did===e.componentId),b=B.findWebInterface(l.meta),d=(Array.isArray(b==null?void 0:b.pageGroups)?b.pageGroups:[]).map(T=>({value:T,label:`${T} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),x(d),e.pageGroup&&d.find(T=>T.value===e.pageGroup)===!1&&o({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(K,{select:!0,label:r("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:e.type,onChange:l=>{n(""),o({...e,type:l.target.value,did:l.target.value===U.ROUTING_RULE_TYPES.BLOCKLET?h:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:l,value:b})=>t.jsx(ye,{value:b,children:l},b))}),e.type===U.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(K,{select:!0,label:r("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:e.redirectCode,onChange:l=>o({...e,redirectCode:l.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(g).map(l=>t.jsx(ye,{value:l,children:`${g[l]} - ${l}`},l))},"redirectCode"),t.jsx(K,{label:r("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{o({...e,url:l.target.value,__disableConfirm:!l.target.value.trim()}),l.target.value.trim()?n(""):n(r("router.validation.redirectUrlRequired"))}},"redirectUrl")],e.type===U.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(K,{select:!0,label:r("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:e.componentId,onChange:l=>{o({...e,componentId:l.target.value})},style:{marginBottom:32},SelectProps:{},children:c.map(l=>t.jsx(ye,{value:l.meta.did,selected:l.meta.did===e.componentId,children:B.getDisplayName(l,!0)},l.meta.did))},"componentId"),p.length?t.jsx(K,{select:!0,label:r("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:e.pageGroup,helperText:r("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:l=>{o({...e,pageGroup:l.target.value})},SelectProps:{},children:p.map(l=>t.jsx(ye,{value:l.value,selected:l.value===e.pageGroup,children:l.label},l.label))},"pageGroup"):null].filter(Boolean),e.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(K,{label:r("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{const b=l.target.value.trim();o({...e,url:l.target.value,__disableConfirm:!b}),n(b?"":r("router.validation.rewriteUrlRequired"))}},"url"),e.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(K,{select:!0,label:r("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:e.responseType,onChange:l=>o({...e,responseType:l.target.value}),style:{marginBottom:32},SelectProps:{},children:U.ROUTING_RESPONSE_TYPES.map(l=>t.jsx(ye,{value:l.value,children:l.text},l.value))},"responseType"),t.jsx(K,{label:r("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:e.responseBody,helperText:r("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:l=>{const b=l.target.value.trim();o({...e,responseBody:l.target.value,__disableConfirm:!b}),n(b?"":r("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:i.object,serviceTypes:i.array,setParams:i.func,setError:i.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:U.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:U.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:U.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:U.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:U.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function hn({children:e,hiddenChildren:o,open:n,onClose:a}){const{t:r}=W(),{api:s}=H(),{blocklet:h}=pe(),[c,p]=f.useState(!1),[x,g]=f.useState(!1),l=h.meta.did,b=h.site.id,d=()=>{a==null||a(),p(!1),g(!1)},T=async C=>{try{const m=await ut(C,r);if(m)throw m;p(!0);const u={from:{pathPrefix:je(C.pathPrefix)},to:{type:C.type}};C.type===U.ROUTING_RULE_TYPES.REDIRECT&&(u.to.url=C.url.trim(),u.to.redirectCode=C.redirectCode),C.type===U.ROUTING_RULE_TYPES.COMPONENT&&(u.to.did=l,u.to.componentId=C.componentId,u.to.pageGroup=C.pageGroup),C.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(u.to.url=je(C.url)),C.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(u.to.response={status:200,contentType:C.responseType,body:C.responseBody}),await s.addRoutingRule({input:{id:b,rule:u,teamDid:l}}),a==null||a()}catch(m){L.error(m.message)}finally{p(!1),g(!1)}},S={title:r("router.rule.add.title"),description:(C,m,u)=>{const v=w=>{if(u(null),ut(w,r)){m({...w,__disableConfirm:!0});return}m({...w})};return t.jsxs(te,{component:"div",children:[t.jsx(K,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:C.pathPrefixHint||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:C.pathPrefix,onChange:w=>{let j=!1;const N=jo({params:{...C,pathPrefix:w.target.value},blocklets:[h]});u(N),C.type===U.ROUTING_RULE_TYPES.BLOCKLET&&N&&(j=!0),C.type===U.ROUTING_RULE_TYPES.REDIRECT&&!C.url&&(j=!0),C.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!C.url&&(j=!0),C.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!C.responseType||!C.responseBody)&&(j=!0),w.target.value.trim()||(j=!0,u(r("router.validation.pathPrefixRequired"))),j||u("");const M=r("common.slugifyHint",{value:Ft(w.target.value)});m({...C,pathPrefix:w.target.value,pathPrefixHint:M,__disableConfirm:j})}}),t.jsx(Rt,{params:C,setParams:v,setError:u})]})},confirm:r("router.rule.add.confirm"),cancel:r("common.cancel"),params:{did:"",pathPrefix:"",type:U.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:T,onCancel:d},R=C=>{C.stopPropagation(),g(!0)};let k=null;return o||(k=typeof e=="function"?e({open:R}):t.jsxs(ye,{onClick:R,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(ue,{size:16}):t.jsx(Yt,{style:{fontSize:18,marginRight:5}}),r("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[k,(n||x)&&t.jsx(Ge,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel,color:"primary"})]})}hn.propTypes={children:i.any,onClose:i.func,hiddenChildren:i.bool,open:i.bool};hn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function Xe({depth:e,className:o}){return t.jsx(y,{ml:Math.max((e-1)*2,0),className:o,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}Xe.propTypes={depth:i.number,className:i.string};Xe.defaultProps={depth:1,className:""};function gn({id:e,from:o,children:n}){const{t:a}=W(),{api:r}=H(),{blocklet:s}=pe(),[h,c]=f.useState(!1),[p,x]=f.useState(null),g=s.meta.did,l=s.site.id,b=o.pathPrefix,d=()=>{c(!1),x(null)},T=async()=>{c(!0);try{await r.deleteRoutingRule({input:{id:l,ruleId:e,teamDid:g}})}catch(k){L.error(k.message)}finally{x(null),c(!1)}},S={keyName:b,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${b}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:b}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:T,onCancel:d},R=k=>{k.stopPropagation(),x(S)};return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({loading:h,open:R}):t.jsxs(ye,{onClick:R,className:"rule-action","data-cy":"action-delete-rule",children:[h?t.jsx(ue,{size:16}):t.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),p&&t.jsx(bs,{keyName:p.keyName,title:p.title,description:p.description,confirmPlaceholder:p.confirmPlaceholder,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}gn.propTypes={id:i.string.isRequired,from:i.object.isRequired,children:i.any};gn.defaultProps={children:null};function xn({id:e,from:o,to:n,children:a}){var C,m;const{t:r}=W(),{api:s}=H(),{blocklet:h}=pe(),[c,p]=f.useState(!1),[x,g]=f.useState(null),l=h.meta.did,b=h.site.id,d=o.pathPrefix,T=()=>{p(!1),g(null)},S=async u=>{try{const v=await ut(u,r);if(v)throw v;p(!0);const w={id:e,from:{pathPrefix:je(u.pathPrefix)},to:{type:u.type}};u.type===U.ROUTING_RULE_TYPES.REDIRECT&&(w.to.url=u.url,w.to.redirectCode=u.redirectCode),u.type===U.ROUTING_RULE_TYPES.COMPONENT&&(w.to.did=l,w.to.componentId=u.componentId,w.to.pageGroup=u.pageGroup),u.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(w.to.url=je(u.url)),u.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(w.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await s.updateRoutingRule({input:{id:b,rule:w,teamDid:l}})}catch(v){L.error(v.message)}finally{p(!1),g(null)}},R={title:r("router.rule.update.title"),description:(u,v,w)=>{const j=N=>{if(ut(N,r)){v({...N,__disableConfirm:!0});return}v({...N})};return t.jsxs(te,{component:"div",children:[t.jsx(K,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:u.helperText||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:N=>{let M=!1;u.type===U.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(M=!0),u.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(M=!0),u.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(M=!0),N.target.value.trim()||(M=!0,w(r("router.validation.pathPrefixRequired"))),M||w("");const Z=r("common.slugifyHint",{value:Ft(N.target.value)});v({...u,pathPrefix:N.target.value,helperText:Z,__disableConfirm:M})}}),t.jsx(Rt,{params:u,setParams:j,setError:w})]})},confirm:r("router.rule.update.confirm"),cancel:r("router.rule.update.cancel"),color:"primary",params:{did:n.did||"",pathPrefix:d==="/"?d:d.replace(/^\/+/,"").replace(/\/+$/,""),type:n.type||U.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:n.redirectCode||302,componentId:n.componentId||"",pageGroup:n.pageGroup||"",url:n.url||"",responseType:((C=n.response)==null?void 0:C.contentType)||"",responseBody:(((m=n.response)==null?void 0:m.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:S,onCancel:T},k=u=>{u.stopPropagation(),g(R)};return t.jsxs(t.Fragment,{children:[typeof a=="function"?a({loading:c,open:k}):t.jsxs(ye,{onClick:k,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(ue,{size:16}):t.jsx(go,{style:{fontSize:18,marginRight:5}}),r("router.rule.update.title")]}),x&&t.jsx(Ge,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}xn.propTypes={id:i.string.isRequired,from:i.object.isRequired,to:i.object.isRequired,children:i.any};xn.defaultProps={children:null};function yn(e){const{locale:o}=W(),{blocklet:n,recommendedDomain:a}=pe(),r=mo(a,e.from.pathPrefix,zt(n,o));return t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:r,rel:"noopener noreferrer",title:r,children:t.jsx(X,{size:"small",children:t.jsx(bo,{})})}),t.jsx(xn,{...e,children:({open:s})=>t.jsx(X,{size:"small",onClick:s,disabled:e.isProtected,"data-cy":"action-update-rule",children:t.jsx(is,{})})}),t.jsx(gn,{...e,children:({open:s})=>t.jsx(X,{size:"small",onClick:s,disabled:e.isProtected,"data-cy":"action-delete-rule",children:t.jsx(Ct,{})})})]})}yn.propTypes={isProtected:i.bool};yn.defaultProps={isProtected:!1};function Eo({group:e,...o}){return e?t.jsx(Qe,{type:"reverse",...o,children:e}):null}Eo.propTypes={group:i.string.isRequired};function pt({domain:e,isHttps:o,toUrl:n}){const a=o?"https":"http";let r=n;return mr(r)||(r=`${a}://${e}${n}`),t.jsx(xt,{href:r,target:"_blank",style:{fontSize:14},underline:"hover",children:n},r)}pt.propTypes={domain:i.string.isRequired,toUrl:i.string.isRequired,isHttps:i.bool};pt.defaultProps={isHttps:!1};function St({hasPermission:e}){const{t:o,locale:n}=W(),a=ft(),{blocklet:r,recommendedDomain:s}=pe();return r.site.rules.filter(c=>c.to.type!==U.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{var l;let p=null,x=null;c.to.type===U.ROUTING_RULE_TYPES.NONE?p="404":c.to.type===U.ROUTING_RULE_TYPES.REDIRECT?p=c.to.redirectCode:c.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE?p="R":c.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE?p=t.jsx(Ts,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(x=r.children.find(b=>b.meta.did===c.to.componentId),p="C");const g=c.isProtected?t.jsx(Ce,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(X,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(fs,{style:{fill:a.palette.text.disabled}})})})}):t.jsx(yn,{...c});return[t.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[t.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[t.jsx(y,{className:"component-item__indent",width:28}),typeof p=="object"?p:t.jsx(ur,{children:p}),t.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(y,{style:{color:"text.primary",fontSize:16},children:[c.to.type===U.ROUTING_RULE_TYPES.NONE&&o("common.page404"),c.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),c.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),c.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((l=U.ROUTING_RESPONSE_TYPES.find(b=>b.value===c.to.response.contentType))==null?void 0:l.text),c.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&B.getDisplayName(x,!0)]}),t.jsxs(y,{display:"flex",alignItems:"center",children:[c.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(pt,{domain:s,toUrl:c.to.url}),c.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(pt,{domain:s,toUrl:c.to.url}),c.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(Eo,{group:c.to.pageGroup})]})]})]}),t.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:t.jsx(xt,{href:mo(s,c.from.pathPrefix,zt(r,n)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:pr(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(y,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),t.jsx(Xe,{},"divider")]})}St.propTypes={hasPermission:i.bool};St.defaultProps={hasPermission:!1};const pi=yt(St,"mutate_blocklets"),mi=yt(St,"",He);function fi(e){const{inService:o}=H();return o?t.jsx(mi,{...e}):t.jsx(pi,{...e})}function hi(e,o){const n=f.useRef(o);f.useEffect(()=>{const a=r=>n.current(r.detail);return window.addEventListener(e,a),()=>window.removeEventListener(e,a)},[e])}function gi(e){const o=fo(),{t:n}=W(),a=()=>{const r=new URLSearchParams(window.location.search);r.get("checkUpdate")&&(r.delete("checkUpdate"),o(r.toString()),e(),L.success(n("notification.checkingForUpdates")))};f.useEffect(a,[]),hi("checkUpdate",a)}function xi({blocklet:e,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const n=fo(),{t:a}=W(),r=f.useRef(null),s=f.useMemo(()=>{if(!e||!e.optionalComponents)return null;const h=new URLSearchParams(window.location.search),c=h.get("install-component");if(c){r.current=c,h.delete("install-component"),n(h.toString());const p=e.optionalComponents.find(g=>g.meta.did===c);if(!p)return L.success(a("notification.installComponentError",{did:c})),null;const{meta:x}=p;if(o){const g=document.getElementById(`optional-component-${c}`),l=document.querySelector(".dashboard-main");if(g){const b=g.getBoundingClientRect(),d=l.getBoundingClientRect();l.scrollTo({top:b.top-d.top+l.scrollTop,behavior:"smooth"})}}return x}return null},[e,n,a,o]);return f.useEffect(()=>{var h;r.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},(h=window.blocklet)==null?void 0:h.appUrl)},[e]),s}function wt({open:e,onClose:o,blocklet:n,ancestors:a}){var x;const{t:r}=W(),s=[...(a||[]).map(g=>{var l;return((l=g==null?void 0:g.meta)==null?void 0:l.did)||""}),((x=n==null?void 0:n.meta)==null?void 0:x.did)||""].filter(Boolean).join("/"),h=r("preferencesFor",{name:B.getDisplayName(n,!0)}),c=f.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(qe(n.status)||n.status==="unknown"&&qe(n.status))return null;const p=()=>{o==null||o()};return t.jsx(yi,{open:e,fullWidth:!0,maxWidth:"md",title:h,onClose:p,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(ao,{gap:1,children:[t.jsx(te,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:r("description.preferences",{name:B.getDisplayName(n,!0)})}),t.jsx(as,{id:s,styles:c})]})})}wt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,open:i.bool,onClose:i.func};wt.defaultProps={ancestors:[],open:!1,onClose:null};const yi=$(ht)`
361
+ `;function fn({blocklet:e,children:o}){const{t:n}=G(),[a,r]=f.useState(!1),s=h=>{h.stopPropagation(),r(!0)};return t.jsxs(t.Fragment,{children:[typeof o=="function"?o({open:s}):t.jsxs(ye,{onClick:s,className:"component-action","data-cy":"action-add-component",children:[t.jsx(Yt,{style:{fontSize:18,marginRight:5}}),n("blocklet.component.add")]}),t.jsx(bt,{showDialog:a,setShowDialog:r,blocklet:e})]})}fn.propTypes={children:i.any,blocklet:i.object.isRequired};fn.defaultProps={children:null};const ui=e=>e.children.filter(o=>o.meta.interfaces.find(n=>n.type===Y.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:e,setParams:o,setError:n,serviceTypes:a}){const{t:r}=G(),{blocklet:s}=pe(),h=s.meta.did,c=ui(s),[p,x]=f.useState([]),g={301:r("common.redirectPermanently"),302:r("common.redirectTemporary"),307:r("common.redirectTemporary"),308:r("common.redirectPermanently")};return f.useEffect(()=>{if(e.type===U.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const l=c.find(T=>T.meta.did===e.componentId),b=B.findWebInterface(l.meta),d=(Array.isArray(b==null?void 0:b.pageGroups)?b.pageGroups:[]).map(T=>({value:T,label:`${T} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),x(d),e.pageGroup&&d.find(T=>T.value===e.pageGroup)===!1&&o({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(K,{select:!0,label:r("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:e.type,onChange:l=>{n(""),o({...e,type:l.target.value,did:l.target.value===U.ROUTING_RULE_TYPES.BLOCKLET?h:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:l,value:b})=>t.jsx(ye,{value:b,children:l},b))}),e.type===U.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(K,{select:!0,label:r("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:e.redirectCode,onChange:l=>o({...e,redirectCode:l.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(g).map(l=>t.jsx(ye,{value:l,children:`${g[l]} - ${l}`},l))},"redirectCode"),t.jsx(K,{label:r("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{o({...e,url:l.target.value,__disableConfirm:!l.target.value.trim()}),l.target.value.trim()?n(""):n(r("router.validation.redirectUrlRequired"))}},"redirectUrl")],e.type===U.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(K,{select:!0,label:r("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:e.componentId,onChange:l=>{o({...e,componentId:l.target.value})},style:{marginBottom:32},SelectProps:{},children:c.map(l=>t.jsx(ye,{value:l.meta.did,selected:l.meta.did===e.componentId,children:B.getDisplayName(l,!0)},l.meta.did))},"componentId"),p.length?t.jsx(K,{select:!0,label:r("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:e.pageGroup,helperText:r("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:l=>{o({...e,pageGroup:l.target.value})},SelectProps:{},children:p.map(l=>t.jsx(ye,{value:l.value,selected:l.value===e.pageGroup,children:l.label},l.label))},"pageGroup"):null].filter(Boolean),e.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(K,{label:r("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{const b=l.target.value.trim();o({...e,url:l.target.value,__disableConfirm:!b}),n(b?"":r("router.validation.rewriteUrlRequired"))}},"url"),e.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(K,{select:!0,label:r("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:e.responseType,onChange:l=>o({...e,responseType:l.target.value}),style:{marginBottom:32},SelectProps:{},children:U.ROUTING_RESPONSE_TYPES.map(l=>t.jsx(ye,{value:l.value,children:l.text},l.value))},"responseType"),t.jsx(K,{label:r("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:e.responseBody,helperText:r("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:l=>{const b=l.target.value.trim();o({...e,responseBody:l.target.value,__disableConfirm:!b}),n(b?"":r("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:i.object,serviceTypes:i.array,setParams:i.func,setError:i.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:U.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:U.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:U.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:U.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:U.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function hn({children:e,hiddenChildren:o,open:n,onClose:a}){const{t:r}=G(),{api:s}=H(),{blocklet:h}=pe(),[c,p]=f.useState(!1),[x,g]=f.useState(!1),l=h.meta.did,b=h.site.id,d=()=>{a==null||a(),p(!1),g(!1)},T=async C=>{try{const m=await ut(C,r);if(m)throw m;p(!0);const u={from:{pathPrefix:je(C.pathPrefix)},to:{type:C.type}};C.type===U.ROUTING_RULE_TYPES.REDIRECT&&(u.to.url=C.url.trim(),u.to.redirectCode=C.redirectCode),C.type===U.ROUTING_RULE_TYPES.COMPONENT&&(u.to.did=l,u.to.componentId=C.componentId,u.to.pageGroup=C.pageGroup),C.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(u.to.url=je(C.url)),C.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(u.to.response={status:200,contentType:C.responseType,body:C.responseBody}),await s.addRoutingRule({input:{id:b,rule:u,teamDid:l}}),a==null||a()}catch(m){L.error(m.message)}finally{p(!1),g(!1)}},S={title:r("router.rule.add.title"),description:(C,m,u)=>{const v=w=>{if(u(null),ut(w,r)){m({...w,__disableConfirm:!0});return}m({...w})};return t.jsxs(te,{component:"div",children:[t.jsx(K,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:C.pathPrefixHint||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:C.pathPrefix,onChange:w=>{let j=!1;const N=jo({params:{...C,pathPrefix:w.target.value},blocklets:[h]});u(N),C.type===U.ROUTING_RULE_TYPES.BLOCKLET&&N&&(j=!0),C.type===U.ROUTING_RULE_TYPES.REDIRECT&&!C.url&&(j=!0),C.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!C.url&&(j=!0),C.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!C.responseType||!C.responseBody)&&(j=!0),w.target.value.trim()||(j=!0,u(r("router.validation.pathPrefixRequired"))),j||u("");const M=r("common.slugifyHint",{value:Ft(w.target.value)});m({...C,pathPrefix:w.target.value,pathPrefixHint:M,__disableConfirm:j})}}),t.jsx(Rt,{params:C,setParams:v,setError:u})]})},confirm:r("router.rule.add.confirm"),cancel:r("common.cancel"),params:{did:"",pathPrefix:"",type:U.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:T,onCancel:d},R=C=>{C.stopPropagation(),g(!0)};let P=null;return o||(P=typeof e=="function"?e({open:R}):t.jsxs(ye,{onClick:R,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(ue,{size:16}):t.jsx(Yt,{style:{fontSize:18,marginRight:5}}),r("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[P,(n||x)&&t.jsx(We,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel,color:"primary"})]})}hn.propTypes={children:i.any,onClose:i.func,hiddenChildren:i.bool,open:i.bool};hn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function Xe({depth:e,className:o}){return t.jsx(y,{ml:Math.max((e-1)*2,0),className:o,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}Xe.propTypes={depth:i.number,className:i.string};Xe.defaultProps={depth:1,className:""};function gn({id:e,from:o,children:n}){const{t:a}=G(),{api:r}=H(),{blocklet:s}=pe(),[h,c]=f.useState(!1),[p,x]=f.useState(null),g=s.meta.did,l=s.site.id,b=o.pathPrefix,d=()=>{c(!1),x(null)},T=async()=>{c(!0);try{await r.deleteRoutingRule({input:{id:l,ruleId:e,teamDid:g}})}catch(P){L.error(P.message)}finally{x(null),c(!1)}},S={keyName:b,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${b}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:b}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:T,onCancel:d},R=P=>{P.stopPropagation(),x(S)};return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({loading:h,open:R}):t.jsxs(ye,{onClick:R,className:"rule-action","data-cy":"action-delete-rule",children:[h?t.jsx(ue,{size:16}):t.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),p&&t.jsx(bs,{keyName:p.keyName,title:p.title,description:p.description,confirmPlaceholder:p.confirmPlaceholder,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}gn.propTypes={id:i.string.isRequired,from:i.object.isRequired,children:i.any};gn.defaultProps={children:null};function xn({id:e,from:o,to:n,children:a}){var C,m;const{t:r}=G(),{api:s}=H(),{blocklet:h}=pe(),[c,p]=f.useState(!1),[x,g]=f.useState(null),l=h.meta.did,b=h.site.id,d=o.pathPrefix,T=()=>{p(!1),g(null)},S=async u=>{try{const v=await ut(u,r);if(v)throw v;p(!0);const w={id:e,from:{pathPrefix:je(u.pathPrefix)},to:{type:u.type}};u.type===U.ROUTING_RULE_TYPES.REDIRECT&&(w.to.url=u.url,w.to.redirectCode=u.redirectCode),u.type===U.ROUTING_RULE_TYPES.COMPONENT&&(w.to.did=l,w.to.componentId=u.componentId,w.to.pageGroup=u.pageGroup),u.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(w.to.url=je(u.url)),u.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(w.to.response={status:200,contentType:u.responseType,body:u.responseBody}),await s.updateRoutingRule({input:{id:b,rule:w,teamDid:l}})}catch(v){L.error(v.message)}finally{p(!1),g(null)}},R={title:r("router.rule.update.title"),description:(u,v,w)=>{const j=N=>{if(ut(N,r)){v({...N,__disableConfirm:!0});return}v({...N})};return t.jsxs(te,{component:"div",children:[t.jsx(K,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:u.helperText||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:u.pathPrefix,onChange:N=>{let M=!1;u.type===U.ROUTING_RULE_TYPES.REDIRECT&&!u.url&&(M=!0),u.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!u.url&&(M=!0),u.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!u.responseType||!u.responseBody)&&(M=!0),N.target.value.trim()||(M=!0,w(r("router.validation.pathPrefixRequired"))),M||w("");const Z=r("common.slugifyHint",{value:Ft(N.target.value)});v({...u,pathPrefix:N.target.value,helperText:Z,__disableConfirm:M})}}),t.jsx(Rt,{params:u,setParams:j,setError:w})]})},confirm:r("router.rule.update.confirm"),cancel:r("router.rule.update.cancel"),color:"primary",params:{did:n.did||"",pathPrefix:d==="/"?d:d.replace(/^\/+/,"").replace(/\/+$/,""),type:n.type||U.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:n.redirectCode||302,componentId:n.componentId||"",pageGroup:n.pageGroup||"",url:n.url||"",responseType:((C=n.response)==null?void 0:C.contentType)||"",responseBody:(((m=n.response)==null?void 0:m.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:S,onCancel:T},P=u=>{u.stopPropagation(),g(R)};return t.jsxs(t.Fragment,{children:[typeof a=="function"?a({loading:c,open:P}):t.jsxs(ye,{onClick:P,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(ue,{size:16}):t.jsx(go,{style:{fontSize:18,marginRight:5}}),r("router.rule.update.title")]}),x&&t.jsx(We,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}xn.propTypes={id:i.string.isRequired,from:i.object.isRequired,to:i.object.isRequired,children:i.any};xn.defaultProps={children:null};function yn(e){const{locale:o}=G(),{blocklet:n,recommendedDomain:a}=pe(),r=mo(a,e.from.pathPrefix,zt(n,o));return t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:r,rel:"noopener noreferrer",title:r,children:t.jsx(X,{size:"small",children:t.jsx(bo,{})})}),t.jsx(xn,{...e,children:({open:s})=>t.jsx(X,{size:"small",onClick:s,disabled:e.isProtected,"data-cy":"action-update-rule",children:t.jsx(is,{})})}),t.jsx(gn,{...e,children:({open:s})=>t.jsx(X,{size:"small",onClick:s,disabled:e.isProtected,"data-cy":"action-delete-rule",children:t.jsx(Ct,{})})})]})}yn.propTypes={isProtected:i.bool};yn.defaultProps={isProtected:!1};function Eo({group:e,...o}){return e?t.jsx(Qe,{type:"reverse",...o,children:e}):null}Eo.propTypes={group:i.string.isRequired};function pt({domain:e,isHttps:o,toUrl:n}){const a=o?"https":"http";let r=n;return mr(r)||(r=`${a}://${e}${n}`),t.jsx(xt,{href:r,target:"_blank",style:{fontSize:14},underline:"hover",children:n},r)}pt.propTypes={domain:i.string.isRequired,toUrl:i.string.isRequired,isHttps:i.bool};pt.defaultProps={isHttps:!1};function St({hasPermission:e}){const{t:o,locale:n}=G(),a=ft(),{blocklet:r,recommendedDomain:s}=pe();return r.site.rules.filter(c=>c.to.type!==U.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{var l;let p=null,x=null;c.to.type===U.ROUTING_RULE_TYPES.NONE?p="404":c.to.type===U.ROUTING_RULE_TYPES.REDIRECT?p=c.to.redirectCode:c.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE?p="R":c.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE?p=t.jsx(Ts,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(x=r.children.find(b=>b.meta.did===c.to.componentId),p="C");const g=c.isProtected?t.jsx(Ce,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(X,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(fs,{style:{fill:a.palette.text.disabled}})})})}):t.jsx(yn,{...c});return[t.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[t.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[t.jsx(y,{className:"component-item__indent",width:28}),typeof p=="object"?p:t.jsx(ur,{children:p}),t.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(y,{style:{color:"text.primary",fontSize:16},children:[c.to.type===U.ROUTING_RULE_TYPES.NONE&&o("common.page404"),c.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),c.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),c.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((l=U.ROUTING_RESPONSE_TYPES.find(b=>b.value===c.to.response.contentType))==null?void 0:l.text),c.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&B.getDisplayName(x,!0)]}),t.jsxs(y,{display:"flex",alignItems:"center",children:[c.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(pt,{domain:s,toUrl:c.to.url}),c.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(pt,{domain:s,toUrl:c.to.url}),c.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(Eo,{group:c.to.pageGroup})]})]})]}),t.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:t.jsx(xt,{href:mo(s,c.from.pathPrefix,zt(r,n)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:pr(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(y,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),t.jsx(Xe,{},"divider")]})}St.propTypes={hasPermission:i.bool};St.defaultProps={hasPermission:!1};const pi=yt(St,"mutate_blocklets"),mi=yt(St,"",He);function fi(e){const{inService:o}=H();return o?t.jsx(mi,{...e}):t.jsx(pi,{...e})}function hi(e,o){const n=f.useRef(o);f.useEffect(()=>{const a=r=>n.current(r.detail);return window.addEventListener(e,a),()=>window.removeEventListener(e,a)},[e])}function gi(e){const o=fo(),{t:n}=G(),a=()=>{const r=new URLSearchParams(window.location.search);r.get("checkUpdate")&&(r.delete("checkUpdate"),o(r.toString()),e(),L.success(n("notification.checkingForUpdates")))};f.useEffect(a,[]),hi("checkUpdate",a)}function xi({blocklet:e,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const n=fo(),{t:a}=G(),r=f.useRef(null),s=f.useMemo(()=>{if(!e||!e.optionalComponents)return null;const h=new URLSearchParams(window.location.search),c=h.get("install-component");if(c){r.current=c,h.delete("install-component"),n(h.toString());const p=e.optionalComponents.find(g=>g.meta.did===c);if(!p)return L.success(a("notification.installComponentError",{did:c})),null;const{meta:x}=p;if(o){const g=document.getElementById(`optional-component-${c}`),l=document.querySelector(".dashboard-main");if(g){const b=g.getBoundingClientRect(),d=l.getBoundingClientRect();l.scrollTo({top:b.top-d.top+l.scrollTop,behavior:"smooth"})}}return x}return null},[e,n,a,o]);return f.useEffect(()=>{var h;r.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},(h=window.blocklet)==null?void 0:h.appUrl)},[e]),s}function wt({open:e,onClose:o,blocklet:n,ancestors:a}){var x;const{t:r}=G(),s=[...(a||[]).map(g=>{var l;return((l=g==null?void 0:g.meta)==null?void 0:l.did)||""}),((x=n==null?void 0:n.meta)==null?void 0:x.did)||""].filter(Boolean).join("/"),h=r("preferencesFor",{name:B.getDisplayName(n,!0)}),c=f.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(qe(n.status)||n.status==="unknown"&&qe(n.status))return null;const p=()=>{o==null||o()};return t.jsx(yi,{open:e,fullWidth:!0,maxWidth:"md",title:h,onClose:p,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(ao,{gap:1,children:[t.jsx(te,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:r("description.preferences",{name:B.getDisplayName(n,!0)})}),t.jsx(as,{id:s,styles:c})]})})}wt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,open:i.bool,onClose:i.func};wt.defaultProps={ancestors:[],open:!1,onClose:null};const yi=$(ht)`
362
362
  .MuiDialogContent-root {
363
363
  padding-top: 0;
364
364
  padding-bottom: 24px;
@@ -371,15 +371,15 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
371
371
  .ux-dialog_closeButton {
372
372
  margin: 0;
373
373
  }
374
- `;function Cn({component:e,remove:o,disabled:n,tip:a,showConfirm:r,hideBtn:s,onCancel:h}){const{t:c}=f.useContext(ve),[p,x]=f.useState(!1),[g,l]=f.useState(null),b=async k=>{x(!0),await o(k.component,k.removeType),x(!1),l(null)},d=n||p,T=()=>{l({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(k,C)=>t.jsxs(te,{component:"div",children:[t.jsx(te,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(Rs,{name:"removeType",value:k.removeType,onChange:m=>C({...k,removeType:m.target.value}),children:[t.jsx(Mt,{value:"keepData",control:t.jsx(Xn,{}),label:c("blocklet.action.removeComponentKeepData")}),t.jsx(Mt,{value:"complete",control:t.jsx(Xn,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:e,removeType:"keepData"},onConfirm:b,onCancel:()=>{l(null),h()}})};f.useEffect(()=>{r?T():(x(!1),l(null))},[r]);const S=t.jsx(Ci,{size:"small",disabled:d,onClick:()=>T,"data-cy":"delete-component-btn",children:t.jsx(Ct,{disabled:d})}),R=t.jsx(Ce,{title:a||c("common.delete"),children:t.jsx("span",{children:S})});return t.jsxs(t.Fragment,{children:[!s&&R,g&&t.jsx(Ge,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}Cn.propTypes={component:i.object.isRequired,remove:i.func,onCancel:i.func,disabled:i.bool,showConfirm:i.bool,hideBtn:i.bool,tip:i.string};Cn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const Ci=$(X)`
374
+ `;function Cn({component:e,remove:o,disabled:n,tip:a,showConfirm:r,hideBtn:s,onCancel:h}){const{t:c}=f.useContext(ve),[p,x]=f.useState(!1),[g,l]=f.useState(null),b=async P=>{x(!0),await o(P.component,P.removeType),x(!1),l(null)},d=n||p,T=()=>{l({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(P,C)=>t.jsxs(te,{component:"div",children:[t.jsx(te,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(Rs,{name:"removeType",value:P.removeType,onChange:m=>C({...P,removeType:m.target.value}),children:[t.jsx(Mt,{value:"keepData",control:t.jsx(Xn,{}),label:c("blocklet.action.removeComponentKeepData")}),t.jsx(Mt,{value:"complete",control:t.jsx(Xn,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:e,removeType:"keepData"},onConfirm:b,onCancel:()=>{l(null),h()}})};f.useEffect(()=>{r?T():(x(!1),l(null))},[r]);const S=t.jsx(Ci,{size:"small",disabled:d,onClick:()=>T,"data-cy":"delete-component-btn",children:t.jsx(Ct,{disabled:d})}),R=t.jsx(Ce,{title:a||c("common.delete"),children:t.jsx("span",{children:S})});return t.jsxs(t.Fragment,{children:[!s&&R,g&&t.jsx(We,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}Cn.propTypes={component:i.object.isRequired,remove:i.func,onCancel:i.func,disabled:i.bool,showConfirm:i.bool,hideBtn:i.bool,tip:i.string};Cn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const Ci=$(X)`
375
375
  &.Mui-disabled {
376
376
  opacity: 0.5;
377
377
  }
378
- `;function jn({component:e,onStart:o,onStop:n,disabled:a,tip:r}){const{t:s}=f.useContext(ve),[h,c]=f.useState(!1),[p,x]=f.useState(),g=async()=>{c(!0);try{await o(e)}catch(R){L.error(R.message)}c(!1)},l=async()=>{c(!0);try{await n(e)}catch(R){L.error(R.message)}c(!1)},b=a||h,d=["starting","running","stopping"].includes(e.status),T=d?kr:_r,S=t.jsx(ji,{disabled:b,onClick:()=>{var R;d?x({title:`${s("common.stop")} ${(R=e==null?void 0:e.meta)==null?void 0:R.title}`,description:s("blocklet.action.stopComponentDescription"),confirm:s("blocklet.action.confirmStop"),cancel:s("common.cancel"),onConfirm:()=>(x(null),l()),onCancel:()=>x(null)}):g()},"data-cy":`${d?"stop":"start"}-component-btn`,children:t.jsx(T,{disabled:b,fontSize:"small"})});return[t.jsx(Ce,{title:r||s(`common.${d?"stop":"start"}`),children:t.jsx("span",{children:S})},"btn"),p&&t.jsx(Ge,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}jn.propTypes={component:i.object.isRequired,onStart:i.func,onStop:i.func,disabled:i.bool,tip:i.string};jn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const ji=$(X)`
378
+ `;function jn({component:e,onStart:o,onStop:n,disabled:a,tip:r}){const{t:s}=f.useContext(ve),[h,c]=f.useState(!1),[p,x]=f.useState(),g=async()=>{c(!0);try{await o(e)}catch(R){L.error(R.message)}c(!1)},l=async()=>{c(!0);try{await n(e)}catch(R){L.error(R.message)}c(!1)},b=a||h,d=["starting","running","stopping"].includes(e.status),T=d?Pr:_r,S=t.jsx(ji,{disabled:b,onClick:()=>{var R;d?x({title:`${s("common.stop")} ${(R=e==null?void 0:e.meta)==null?void 0:R.title}`,description:s("blocklet.action.stopComponentDescription"),confirm:s("blocklet.action.confirmStop"),cancel:s("common.cancel"),onConfirm:()=>(x(null),l()),onCancel:()=>x(null)}):g()},"data-cy":`${d?"stop":"start"}-component-btn`,children:t.jsx(T,{disabled:b,fontSize:"small"})});return[t.jsx(Ce,{title:r||s(`common.${d?"stop":"start"}`),children:t.jsx("span",{children:S})},"btn"),p&&t.jsx(We,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}jn.propTypes={component:i.object.isRequired,onStart:i.func,onStop:i.func,disabled:i.bool,tip:i.string};jn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const ji=$(X)`
379
379
  &.Mui-disabled {
380
380
  opacity: 0.5;
381
381
  }
382
- `;function vn({sourceInfo:e,blocklet:o}){var r;const{t:n}=f.useContext(ve);let{source:a}=e;return a==="registry"&&(a="Blocklet Store"),t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx(fr,{type:"success",children:Ss(a)},"source"),e.source==="registry"&&t.jsx(xt,{href:gt(e.deployedFrom,"blocklets",((r=o==null?void 0:o.meta)==null?void 0:r.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:n("blocklet.overview.viewInStore")})]})}vn.propTypes={sourceInfo:i.shape({source:i.string,deployedFrom:i.string}),blocklet:i.object};vn.defaultProps={sourceInfo:{},blocklet:{}};var bn={},vi=Wt;Object.defineProperty(bn,"__esModule",{value:!0});var To=bn.default=void 0,bi=vi(Gt()),Ri=t;To=bn.default=(0,bi.default)((0,Ri.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Et({blocklet:e,checkUpgrade:o,hasPermission:n,...a}){const{api:r}=H(),{t:s}=f.useContext(ve),[h,c]=f.useState(!1),[p,x]=f.useState(""),[g,l]=f.useState(null),[b,d]=f.useState(null);f.useEffect(()=>{l(null),o&&(e.mode,Y.BLOCKLET_MODES.DEVELOPMENT)},[e,o]);const T=()=>{c(!1),d(null)},S=async()=>{c(!0);try{const k={did:e.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ke(2e3),await r.upgradeBlocklet({input:k})}catch(k){L.error(`Blocklet upgrade failed: ${ie(k)}`)}finally{c(!1),d(null)}},R={title:`${s("common.upgrade")} ${s("common.blocklet")} ${B.getDisplayName(e)}`,description:s("blocklet.action.upgradeDescription"),confirm:s("blocklet.action.confirmUpgrade"),cancel:s("common.cancel"),onConfirm:S,onCancel:T};return n&&g&&!B.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{...a,children:e.meta.version}),t.jsx(Ce,{title:s("common.updateAvailable",{version:g.version}),children:t.jsx(X,{size:"small",style:{marginLeft:8},disabled:h,onClick:()=>d(R),children:h?t.jsx(ue,{size:16}):t.jsx(To,{style:{fontSize:16,color:"red"}})})}),!!p&&t.jsx(L,{variant:"error",message:p,onClose:()=>x("")}),b&&t.jsx(Ge,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]}):t.jsx(Qe,{...a,children:e.meta.version})}Et.propTypes={blocklet:i.object.isRequired,checkUpgrade:i.bool,hasPermission:i.bool};Et.defaultProps={checkUpgrade:!1,hasPermission:!1};const Si=yt(Et,"mutate_blocklets"),wi=yt(Et,"",He);function Ei(e){const{inService:o}=H();return o?t.jsx(wi,{...e}):t.jsx(Si,{...e})}const Ti=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},Pi=(e,o)=>e?[{name:o("common.name"),value:e.displayName},{name:o("common.description"),value:e.description},{name:o("common.version"),value:t.jsx(Qe,{children:e.version})}]:[],ki=e=>{const{source:o,deployedFrom:n,bundleSource:a}=e;if(o)return{source:o,deployedFrom:n};if(!a)return{source:"upload",deployedFrom:n};if(a.url){const r=n||Array.isArray(a.url)?a.url[0]:a.url;return{source:"url",deployedFrom:r,link:r}}if(a.store){const r=n||Array.isArray(a.store)?a.store[0]:a.store;return{source:"registry",deployedFrom:r,link:r}}return{}},_i=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const s=[];for(;a&&r<n.length;){const h=a.children.find(c=>c.meta.did===n[r]);a=h,r++,h&&s.push(h.meta.title)}return s.join(" / ")};function Rn({blocklet:e,depth:o,componentInfo:n,app:a,onClose:r}){var d,T;const{t:s,locale:h}=f.useContext(ve),{deletingBlocklets:c}=Vt();let{status:p}=e;o===1&&c.includes(e.meta.did)&&(p="deleting");const x=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),g=S=>S.map(R=>R.name===s("common.did")||R.name===s("blocklet.appId")?t.jsx(Nt,{valueComponent:"div",nameWidth:120,name:R.name,nameFormatter:()=>R.name,children:R.value},R.name):t.jsx(Nt,{valueComponent:"div",nameWidth:120,name:R.name,children:R.link?t.jsx(xt,{href:R.link,target:"_blank",className:"page-link",underline:"hover",children:R.value}):R.value},R.name)),l=n?ki(n):{},b=n?[{name:s("common.name"),value:B.getDisplayName(n,!0)},{name:s("common.version"),value:t.jsx(Ei,{blocklet:n,checkUpgrade:!1})},{name:s("common.status"),value:t.jsx(Ro,{isResource:Ti(e),status:p,source:n.source,progress:e.progress})},e.status==="running"?{name:s("blocklet.startedAt"),value:e.startedAt?t.jsx(Ut,{value:e.startedAt,type:"all",locale:h}):"-"}:null,e.status!=="running"?{name:s("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(Ut,{value:e.stoppedAt,type:"all",locale:h}):"-"}:null,e.installedAt?{name:s("blocklet.installedAt"),value:e.installedAt?t.jsx(Ut,{value:e.installedAt,type:"all",locale:h}):"-"}:null,B.hasStartEngine(e.meta)?{name:s("common.mountPoint"),value:x}:null,n.meta.group?{name:s("common.group"),value:t.jsx(Qe,{type:"success",children:n.meta.group})}:null,{name:s("blocklet.overview.source"),value:t.jsx(vn,{sourceInfo:l,blocklet:e})},{name:s("blocklet.overview.deployedFrom"),value:l.deployedFrom||"-",link:l.link??""},{name:s("common.did"),value:t.jsx(hr,{did:n.meta.did,showQrcode:!0})},{name:s("common.author"),value:n.meta.owner?t.jsx(gs,{owner:n.meta.owner,locale:h}):xs.formatPerson(n.meta.author)},{name:s("common.engine"),value:Pi(n.engine,s).map(({name:S,value:R})=>t.jsx(Nt,{style:{marginBottom:4},nameWidth:120,name:S,children:R},S))},(d=e.dependents)!=null&&d.length?{name:s("common.dependents"),value:t.jsx(y,{children:e.dependents.map(S=>t.jsx(y,{children:`${_i(S.id,a)} ${S.required?`(${s("common.required")})`:""}`},S.id))})}:null,(T=e.meta.resources)!=null&&T.length?{name:s("common.resource"),value:e.meta.resources.join(", ")}:null].filter(Boolean):[];return n?t.jsx(ht,{open:!0,title:s("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{r(null)},children:t.jsx(y,{paddingBottom:1.5,children:g(b)},"dialog-wrapper")},"base-info-dialog"):null}Rn.propTypes={blocklet:i.object.isRequired,depth:i.number,app:i.object,componentInfo:i.object,onClose:i.func.isRequired};Rn.defaultProps={depth:0,app:null,componentInfo:null};$(ho)`
382
+ `;function vn({sourceInfo:e,blocklet:o}){var r;const{t:n}=f.useContext(ve);let{source:a}=e;return a==="registry"&&(a="Blocklet Store"),t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx(fr,{type:"success",children:Ss(a)},"source"),e.source==="registry"&&t.jsx(xt,{href:gt(e.deployedFrom,"blocklets",((r=o==null?void 0:o.meta)==null?void 0:r.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:n("blocklet.overview.viewInStore")})]})}vn.propTypes={sourceInfo:i.shape({source:i.string,deployedFrom:i.string}),blocklet:i.object};vn.defaultProps={sourceInfo:{},blocklet:{}};var bn={},vi=Gt;Object.defineProperty(bn,"__esModule",{value:!0});var To=bn.default=void 0,bi=vi(Wt()),Ri=t;To=bn.default=(0,bi.default)((0,Ri.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Et({blocklet:e,checkUpgrade:o,hasPermission:n,...a}){const{api:r}=H(),{t:s}=f.useContext(ve),[h,c]=f.useState(!1),[p,x]=f.useState(""),[g,l]=f.useState(null),[b,d]=f.useState(null);f.useEffect(()=>{l(null),o&&(e.mode,Y.BLOCKLET_MODES.DEVELOPMENT)},[e,o]);const T=()=>{c(!1),d(null)},S=async()=>{c(!0);try{const P={did:e.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ke(2e3),await r.upgradeBlocklet({input:P})}catch(P){L.error(`Blocklet upgrade failed: ${ie(P)}`)}finally{c(!1),d(null)}},R={title:`${s("common.upgrade")} ${s("common.blocklet")} ${B.getDisplayName(e)}`,description:s("blocklet.action.upgradeDescription"),confirm:s("blocklet.action.confirmUpgrade"),cancel:s("common.cancel"),onConfirm:S,onCancel:T};return n&&g&&!B.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{...a,children:e.meta.version}),t.jsx(Ce,{title:s("common.updateAvailable",{version:g.version}),children:t.jsx(X,{size:"small",style:{marginLeft:8},disabled:h,onClick:()=>d(R),children:h?t.jsx(ue,{size:16}):t.jsx(To,{style:{fontSize:16,color:"red"}})})}),!!p&&t.jsx(L,{variant:"error",message:p,onClose:()=>x("")}),b&&t.jsx(We,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]}):t.jsx(Qe,{...a,children:e.meta.version})}Et.propTypes={blocklet:i.object.isRequired,checkUpgrade:i.bool,hasPermission:i.bool};Et.defaultProps={checkUpgrade:!1,hasPermission:!1};const Si=yt(Et,"mutate_blocklets"),wi=yt(Et,"",He);function Ei(e){const{inService:o}=H();return o?t.jsx(wi,{...e}):t.jsx(Si,{...e})}const Ti=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},ki=(e,o)=>e?[{name:o("common.name"),value:e.displayName},{name:o("common.description"),value:e.description},{name:o("common.version"),value:t.jsx(Qe,{children:e.version})}]:[],Pi=e=>{const{source:o,deployedFrom:n,bundleSource:a}=e;if(o)return{source:o,deployedFrom:n};if(!a)return{source:"upload",deployedFrom:n};if(a.url){const r=n||Array.isArray(a.url)?a.url[0]:a.url;return{source:"url",deployedFrom:r,link:r}}if(a.store){const r=n||Array.isArray(a.store)?a.store[0]:a.store;return{source:"registry",deployedFrom:r,link:r}}return{}},_i=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const s=[];for(;a&&r<n.length;){const h=a.children.find(c=>c.meta.did===n[r]);a=h,r++,h&&s.push(h.meta.title)}return s.join(" / ")};function Rn({blocklet:e,depth:o,componentInfo:n,app:a,onClose:r}){var d,T;const{t:s,locale:h}=f.useContext(ve),{deletingBlocklets:c}=Vt();let{status:p}=e;o===1&&c.includes(e.meta.did)&&(p="deleting");const x=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),g=S=>S.map(R=>R.name===s("common.did")||R.name===s("blocklet.appId")?t.jsx(Nt,{valueComponent:"div",nameWidth:120,name:R.name,nameFormatter:()=>R.name,children:R.value},R.name):t.jsx(Nt,{valueComponent:"div",nameWidth:120,name:R.name,children:R.link?t.jsx(xt,{href:R.link,target:"_blank",className:"page-link",underline:"hover",children:R.value}):R.value},R.name)),l=n?Pi(n):{},b=n?[{name:s("common.name"),value:B.getDisplayName(n,!0)},{name:s("common.version"),value:t.jsx(Ei,{blocklet:n,checkUpgrade:!1})},{name:s("common.status"),value:t.jsx(Ro,{isResource:Ti(e),status:p,source:n.source,progress:e.progress})},e.status==="running"?{name:s("blocklet.startedAt"),value:e.startedAt?t.jsx(Ut,{value:e.startedAt,type:"all",locale:h}):"-"}:null,e.status!=="running"?{name:s("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(Ut,{value:e.stoppedAt,type:"all",locale:h}):"-"}:null,e.installedAt?{name:s("blocklet.installedAt"),value:e.installedAt?t.jsx(Ut,{value:e.installedAt,type:"all",locale:h}):"-"}:null,B.hasStartEngine(e.meta)?{name:s("common.mountPoint"),value:x}:null,n.meta.group?{name:s("common.group"),value:t.jsx(Qe,{type:"success",children:n.meta.group})}:null,{name:s("blocklet.overview.source"),value:t.jsx(vn,{sourceInfo:l,blocklet:e})},{name:s("blocklet.overview.deployedFrom"),value:l.deployedFrom||"-",link:l.link??""},{name:s("common.did"),value:t.jsx(hr,{did:n.meta.did,showQrcode:!0})},{name:s("common.author"),value:n.meta.owner?t.jsx(gs,{owner:n.meta.owner,locale:h}):xs.formatPerson(n.meta.author)},{name:s("common.engine"),value:ki(n.engine,s).map(({name:S,value:R})=>t.jsx(Nt,{style:{marginBottom:4},nameWidth:120,name:S,children:R},S))},(d=e.dependents)!=null&&d.length?{name:s("common.dependents"),value:t.jsx(y,{children:e.dependents.map(S=>t.jsx(y,{children:`${_i(S.id,a)} ${S.required?`(${s("common.required")})`:""}`},S.id))})}:null,(T=e.meta.resources)!=null&&T.length?{name:s("common.resource"),value:e.meta.resources.join(", ")}:null].filter(Boolean):[];return n?t.jsx(ht,{open:!0,title:s("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{r(null)},children:t.jsx(y,{paddingBottom:1.5,children:g(b)},"dialog-wrapper")},"base-info-dialog"):null}Rn.propTypes={blocklet:i.object.isRequired,depth:i.number,app:i.object,componentInfo:i.object,onClose:i.func.isRequired};Rn.defaultProps={depth:0,app:null,componentInfo:null};$(ho)`
383
383
  .BaseBadge-badge {
384
384
  top: ${e=>e.top*8||6}px;
385
385
  right: ${e=>e.right*8||6}px;
@@ -401,7 +401,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
401
401
  margin-left: 4px;
402
402
  transform: translateY(-1px);
403
403
  }
404
- `;function Po({blocklet:e,ancestors:o,mountPoint:n,href:a}){const[r,s]=f.useState(!1),[h,c]=f.useState(!1),[p,x]=f.useState(!1),[g,l]=f.useState(n),{api:b}=H(),d=!o.length,T=d?e.meta.did:o.map(j=>j.meta.did)[0],{t:S}=W(),{confirmApi:R,confirmHolder:k}=gr();f.useEffect(()=>{c(!1),s(!1),x(!1)},[n]);const C=()=>{s(!1),c(!1),l(n)},m=async()=>{x(!0),s(!1);try{const j={rootDid:T,mountPoint:je(g)};d||(j.did=e.meta.did),await b.updateComponentMountPoint({input:j})}catch(j){throw j.message=ie(j),L.error(j.message),j}finally{C()}},u=xr(()=>{R.open({title:S("common.noticeTitle"),content:t.jsxs(y,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(te,{sx:{mb:1.5},children:S("blocklet.mountPoint.description1")}),t.jsx(te,{component:"li",children:S("blocklet.mountPoint.case1")}),t.jsx(te,{component:"li",children:S("blocklet.mountPoint.case2")}),t.jsx(te,{sx:{mt:1.5},children:S("blocklet.mountPoint.description2")})]}),confirmButtonText:S("common.confirm"),cancelButtonText:S("common.cancel"),async onConfirm(j){await m(),j()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),v=j=>{j==null||j.preventDefault(),je(g)!==n?u():c(!1)},w=h?t.jsxs(y,{sx:{ml:1},children:[t.jsx(X,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"data-cy":"edit-mount-point-submit",onClick:v,children:t.jsx(y,{component:Q,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(X,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:C,children:t.jsx(y,{component:Q,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(X,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:()=>c(!0),children:t.jsx(y,{component:Q,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:r?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[k,h?t.jsx("form",{onSubmit:v,children:t.jsx(K,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:j=>l(j.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:n})}):t.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:t.jsx(y,{maxWidth:400,sx:{color:"primary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:yr(n)})}),p?t.jsx(ue,{size:20,sx:{ml:1}}):w]},n)}Po.propTypes={mountPoint:i.string.isRequired,href:i.string.isRequired,blocklet:i.object.isRequired,ancestors:i.array.isRequired};const Ii=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},io=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const s=[];for(;a&&r<n.length;){const h=a.children.find(c=>c.meta.did===n[r]);a=h,r++,h&&s.push(h.meta.title)}return s.join(" / ")};function mt({blocklet:e,ancestors:o,depth:n,onRemove:a,onStart:r,onStop:s,onRestart:h,getComponentUrl:c,app:p}){var Ee,_,fe;const{t:x}=f.useContext(ve),[g,l]=f.useState(),[b,d]=f.useState(!1),[T,S]=f.useState(!1),[R,k]=f.useState(null),{info:C}=H(),[m,u]=f.useState(!1),[v,w]=f.useState(!1),{deletingBlocklets:j}=Vt();let{status:N}=e;n===1&&j.includes(e.meta.did)&&(N="deleting");const M=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),Z=c(M),I=B.isInProgress(p.status),ne=B.isInProgress(e.status);let me="";if(I||ne||n===1&&j.includes(e.meta.did))me=x("blocklet.component.tip.stopBlocklet");else if((Ee=e.dependents)!=null&&Ee.length){const G=e.dependents.filter(he=>he.required);if(G.length){const he=G.map(A=>io(A.id,p));me=x("blocklet.component.tip.requiredBy",{name:he.join(", ")})}}const J=async(...G)=>{S(!0);try{await a(...G)}catch{}S(!1),d(!1)},{usingDocker:Pe,usingIsolation:we}=f.useMemo(()=>{var le,_e;if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const G=!!(C!=null&&C.enableDocker)||((le=window.blocklet)==null?void 0:le.enableDocker),he=[...p.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER"&&E.value),A=[...p.configs,...e.configs].find(E=>E.key==="USE_DOCKER"&&E.value),ke=[...p.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER_NETWORK"&&E.value);return{usingDocker:G?!he:!!A,usingIsolation:G&&!ke&&((C==null?void 0:C.enableDockerNetwork)||((_e=window.blocklet)==null?void 0:_e.enableDockerNetwork))}},[e.configs,C==null?void 0:C.enableDocker,C==null?void 0:C.enableDockerNetwork,p.configs,e.meta.group]);return t.jsxs(t.Fragment,{children:[t.jsxs(Sn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(y,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[t.jsx(Cr,{blocklet:e,ancestors:o}),t.jsxs(y,{ml:"16px",sx:{minWidth:0},children:[t.jsxs(y,{className:"component-header",onClick:()=>l(e),children:[t.jsx(y,{className:"component-name",children:B.getDisplayName(e,!0)}),t.jsx(y,{className:"component-version",children:(_=e==null?void 0:e.meta)==null?void 0:_.version})]}),t.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[N!=="unknown"&&t.jsx(Ro,{style:{marginLeft:4},status:N,source:e.source,progress:e.progress}),t.jsx(ys,{style:{marginLeft:4},mode:e.mode||""}),e.mode!=="development"&&Pe&&t.jsx(Ce,{title:x("blocklet.usingDocker"),children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:yo})})}),e.mode!=="development"&&we&&t.jsx(Ce,{title:x("blocklet.usingIsolation"),children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:"streamline:network"})})}),!!((fe=e.dependents)!=null&&fe.length)&&t.jsx(Ce,{title:[`${x("common.dependents")}: `,e.dependents.map(G=>t.jsx(y,{pl:1,children:`${io(G.id,p)} ${G.required?`(${x("common.required")})`:""}`},G.id))],children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:"octicon:package-dependents-16"})})})]})]})]},e),po.hasMountPoint(e.meta)&&t.jsx(Po,{blocklet:e,ancestors:o,mountPoint:M,href:Z},M),t.jsx("div",{style:{flex:1}}),t.jsxs(y,{display:"flex",alignItems:"center",children:[B.hasStartEngine(e.meta)&&t.jsx(Ce,{title:x("common.visit"),children:t.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:Z,rel:"noopener noreferrer",children:t.jsx(X,{size:"small",children:t.jsx(bo,{})})})}),t.jsx(jn,{blocklet:p,component:e,onStart:r,onStop:s,disabled:!["starting","stopping"].includes(p.status)&&B.isInProgress(p.status)}),t.jsx(X,{onClick:()=>w(!0),disabled:I||ne,children:t.jsx(Qt,{fontSize:"small"})}),t.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(So,{"data-cy":"component-actions",actions:[B.hasStartEngine(e.meta)||Ii(e)?{icon:t.jsx(jr,{}),text:x("common.detail"),onClick:()=>{l(e)}}:null,{icon:t.jsx(Ir,{}),text:x("common.restart"),onClick:()=>{k({title:`${x("common.restart")} ${e.meta.title}`,description:x("blocklet.action.restartDescription"),confirm:x("blocklet.action.confirmRestart"),cancel:x("common.cancel"),onConfirm:async()=>{S(!0),await h(e),S(!1),k(null)},onCancel:()=>k(null)})},disabled:T||I||ne||e.status!=="running"},{icon:t.jsx(Ct,{}),text:x("common.delete"),onClick:()=>{d(!0)},disabled:I||ne||!!me,tip:me},{separator:!0},{icon:t.jsx(Q,{icon:"mdi:variable"}),onClick:()=>{u(!0)},text:t.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(y,{sx:{width:"100%"},children:x("common.environments")})}),disabled:I||ne}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(Xe,{},"line"),t.jsx(Rn,{componentInfo:g,onClose:l,blocklet:e,app:p,depth:n}),t.jsx(Cn,{blocklet:p,component:e,remove:J,onCancel:()=>d(!1),hideBtn:!0,showConfirm:b},"delete-component"),R&&t.jsx(Ge,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel},"confirm-setting"),m&&t.jsx(jt,{open:!0,hiddenChildren:!0,onClose:()=>u(!1),blocklet:e,ancestors:o}),v&&t.jsx(wt,{open:!0,onClose:()=>w(!1),blocklet:e,ancestors:o})]})}mt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,depth:i.number,onRemove:i.func,onStart:i.func,onStop:i.func,onRestart:i.func,getComponentUrl:i.func,app:i.object};mt.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const qt=$(ho)`
404
+ `;function ko({blocklet:e,ancestors:o,mountPoint:n,href:a}){const[r,s]=f.useState(!1),[h,c]=f.useState(!1),[p,x]=f.useState(!1),[g,l]=f.useState(n),{api:b}=H(),d=!o.length,T=d?e.meta.did:o.map(j=>j.meta.did)[0],{t:S}=G(),{confirmApi:R,confirmHolder:P}=gr();f.useEffect(()=>{c(!1),s(!1),x(!1)},[n]);const C=()=>{s(!1),c(!1),l(n)},m=async()=>{x(!0),s(!1);try{const j={rootDid:T,mountPoint:je(g)};d||(j.did=e.meta.did),await b.updateComponentMountPoint({input:j})}catch(j){throw j.message=ie(j),L.error(j.message),j}finally{C()}},u=xr(()=>{R.open({title:S("common.noticeTitle"),content:t.jsxs(y,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(te,{sx:{mb:1.5},children:S("blocklet.mountPoint.description1")}),t.jsx(te,{component:"li",children:S("blocklet.mountPoint.case1")}),t.jsx(te,{component:"li",children:S("blocklet.mountPoint.case2")}),t.jsx(te,{sx:{mt:1.5},children:S("blocklet.mountPoint.description2")})]}),confirmButtonText:S("common.confirm"),cancelButtonText:S("common.cancel"),async onConfirm(j){await m(),j()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),v=j=>{j==null||j.preventDefault(),je(g)!==n?u():c(!1)},w=h?t.jsxs(y,{sx:{ml:1},children:[t.jsx(X,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"data-cy":"edit-mount-point-submit",onClick:v,children:t.jsx(y,{component:Q,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(X,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:C,children:t.jsx(y,{component:Q,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(X,{size:"medium",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:()=>c(!0),children:t.jsx(y,{component:Q,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:r?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[P,h?t.jsx("form",{onSubmit:v,children:t.jsx(K,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:j=>l(j.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:n})}):t.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:t.jsx(y,{maxWidth:400,sx:{color:"primary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:yr(n)})}),p?t.jsx(ue,{size:20,sx:{ml:1}}):w]},n)}ko.propTypes={mountPoint:i.string.isRequired,href:i.string.isRequired,blocklet:i.object.isRequired,ancestors:i.array.isRequired};const Ii=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},io=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const s=[];for(;a&&r<n.length;){const h=a.children.find(c=>c.meta.did===n[r]);a=h,r++,h&&s.push(h.meta.title)}return s.join(" / ")};function mt({blocklet:e,ancestors:o,depth:n,onRemove:a,onStart:r,onStop:s,onRestart:h,getComponentUrl:c,app:p}){var Ee,_,fe;const{t:x}=f.useContext(ve),[g,l]=f.useState(),[b,d]=f.useState(!1),[T,S]=f.useState(!1),[R,P]=f.useState(null),{info:C}=H(),[m,u]=f.useState(!1),[v,w]=f.useState(!1),{deletingBlocklets:j}=Vt();let{status:N}=e;n===1&&j.includes(e.meta.did)&&(N="deleting");const M=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),Z=c(M),I=B.isInProgress(p.status),ne=B.isInProgress(e.status);let me="";if(I||ne||n===1&&j.includes(e.meta.did))me=x("blocklet.component.tip.stopBlocklet");else if((Ee=e.dependents)!=null&&Ee.length){const W=e.dependents.filter(he=>he.required);if(W.length){const he=W.map(A=>io(A.id,p));me=x("blocklet.component.tip.requiredBy",{name:he.join(", ")})}}const J=async(...W)=>{S(!0);try{await a(...W)}catch{}S(!1),d(!1)},{usingDocker:ke,usingIsolation:we}=f.useMemo(()=>{var le,_e;if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const W=!!(C!=null&&C.enableDocker)||((le=window.blocklet)==null?void 0:le.enableDocker),he=[...p.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER"&&E.value),A=[...p.configs,...e.configs].find(E=>E.key==="USE_DOCKER"&&E.value),Pe=[...p.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER_NETWORK"&&E.value);return{usingDocker:W?!he:!!A,usingIsolation:W&&!Pe&&((C==null?void 0:C.enableDockerNetwork)||((_e=window.blocklet)==null?void 0:_e.enableDockerNetwork))}},[e.configs,C==null?void 0:C.enableDocker,C==null?void 0:C.enableDockerNetwork,p.configs,e.meta.group]);return t.jsxs(t.Fragment,{children:[t.jsxs(Sn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(y,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[t.jsx(Cr,{blocklet:e,ancestors:o}),t.jsxs(y,{ml:"16px",sx:{minWidth:0},children:[t.jsxs(y,{className:"component-header",onClick:()=>l(e),children:[t.jsx(y,{className:"component-name",children:B.getDisplayName(e,!0)}),t.jsx(y,{className:"component-version",children:(_=e==null?void 0:e.meta)==null?void 0:_.version})]}),t.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[N!=="unknown"&&t.jsx(Ro,{style:{marginLeft:4},status:N,source:e.source,progress:e.progress}),t.jsx(ys,{style:{marginLeft:4},mode:e.mode||""}),e.mode!=="development"&&ke&&t.jsx(Ce,{title:x("blocklet.usingDocker"),children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:yo})})}),e.mode!=="development"&&we&&t.jsx(Ce,{title:x("blocklet.usingIsolation"),children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:"streamline:network"})})}),!!((fe=e.dependents)!=null&&fe.length)&&t.jsx(Ce,{title:[`${x("common.dependents")}: `,e.dependents.map(W=>t.jsx(y,{pl:1,children:`${io(W.id,p)} ${W.required?`(${x("common.required")})`:""}`},W.id))],children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:"octicon:package-dependents-16"})})})]})]})]},e),po.hasMountPoint(e.meta)&&t.jsx(ko,{blocklet:e,ancestors:o,mountPoint:M,href:Z},M),t.jsx("div",{style:{flex:1}}),t.jsxs(y,{display:"flex",alignItems:"center",children:[B.hasStartEngine(e.meta)&&t.jsx(Ce,{title:x("common.visit"),children:t.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:Z,rel:"noopener noreferrer",children:t.jsx(X,{size:"small",children:t.jsx(bo,{})})})}),t.jsx(jn,{blocklet:p,component:e,onStart:r,onStop:s,disabled:!["starting","stopping"].includes(p.status)&&B.isInProgress(p.status)}),t.jsx(X,{onClick:()=>w(!0),disabled:I||ne,children:t.jsx(Qt,{fontSize:"small"})}),t.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(So,{"data-cy":"component-actions",actions:[B.hasStartEngine(e.meta)||Ii(e)?{icon:t.jsx(jr,{}),text:x("common.detail"),onClick:()=>{l(e)}}:null,{icon:t.jsx(Ir,{}),text:x("common.restart"),onClick:()=>{P({title:`${x("common.restart")} ${e.meta.title}`,description:x("blocklet.action.restartDescription"),confirm:x("blocklet.action.confirmRestart"),cancel:x("common.cancel"),onConfirm:async()=>{S(!0),await h(e),S(!1),P(null)},onCancel:()=>P(null)})},disabled:T||I||ne||e.status!=="running"},{icon:t.jsx(Ct,{}),text:x("common.delete"),onClick:()=>{d(!0)},disabled:I||ne||!!me,tip:me},{separator:!0},{icon:t.jsx(Q,{icon:"mdi:variable"}),onClick:()=>{u(!0)},text:t.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(y,{sx:{width:"100%"},children:x("common.environments")})}),disabled:I||ne}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(Xe,{},"line"),t.jsx(Rn,{componentInfo:g,onClose:l,blocklet:e,app:p,depth:n}),t.jsx(Cn,{blocklet:p,component:e,remove:J,onCancel:()=>d(!1),hideBtn:!0,showConfirm:b},"delete-component"),R&&t.jsx(We,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel},"confirm-setting"),m&&t.jsx(jt,{open:!0,hiddenChildren:!0,onClose:()=>u(!1),blocklet:e,ancestors:o}),v&&t.jsx(wt,{open:!0,onClose:()=>w(!1),blocklet:e,ancestors:o})]})}mt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,depth:i.number,onRemove:i.func,onStart:i.func,onStop:i.func,onRestart:i.func,getComponentUrl:i.func,app:i.object};mt.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const qt=$(ho)`
405
405
  .BaseBadge-badge {
406
406
  top: ${e=>e.top*8||6}px;
407
407
  right: ${e=>e.right*8||6}px;
@@ -430,7 +430,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
430
430
  margin-left: 4px;
431
431
  transform: translateY(-1px);
432
432
  }
433
- `;function wn({meta:e,dependencies:o,logoUrl:n,setInstallComponentMeta:a}){const r=H(),{t:s}=W(),h=()=>{a(e)},c=40;return t.jsxs(Di,{id:`optional-component-${e.did}`,children:[t.jsxs("div",{className:"cell",children:[t.jsxs("div",{className:"component-left",children:[t.jsx("img",{className:"component-logo",src:n,onError:()=>`${r.imgPrefix}/blocklet.png`,alt:e.title,style:{width:c,height:c}}),t.jsxs("div",{className:"component-header",children:[t.jsx("div",{className:"component-name",children:e.title}),t.jsx("div",{className:"component-version",children:e.version})]}),t.jsx(Ce,{title:[`${s("common.dependents")}: `,o.map(p=>t.jsx(y,{pl:1,children:`${p.parentTitle} ${p.required?`(${s("common.required")})`:""}`},p.parentName+p.mount_point))],children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:"octicon:package-dependents-16"})})})]}),t.jsx("div",{style:{flex:1}}),t.jsx(y,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(vr,{onClick:h,startIcon:t.jsx(Q,{icon:"ph:download-simple-bold"}),children:s("common.install")})})]}),t.jsx(Xe,{class:"line"},"line")]})}wn.propTypes={meta:i.object.isRequired,logoUrl:i.string,setInstallComponentMeta:i.func.isRequired,dependencies:i.arrayOf(i.shape({parentDid:i.string,parentName:i.string,parentPoint:i.string,required:i.bool}))};wn.defaultProps={logoUrl:"",dependencies:[]};const Di=$(Sn)`
433
+ `;function wn({meta:e,dependencies:o,logoUrl:n,setInstallComponentMeta:a}){const r=H(),{t:s}=G(),h=()=>{a(e)},c=40;return t.jsxs(Di,{id:`optional-component-${e.did}`,children:[t.jsxs("div",{className:"cell",children:[t.jsxs("div",{className:"component-left",children:[t.jsx("img",{className:"component-logo",src:n,onError:()=>`${r.imgPrefix}/blocklet.png`,alt:e.title,style:{width:c,height:c}}),t.jsxs("div",{className:"component-header",children:[t.jsx("div",{className:"component-name",children:e.title}),t.jsx("div",{className:"component-version",children:e.version})]}),t.jsx(Ce,{title:[`${s("common.dependents")}: `,o.map(p=>t.jsx(y,{pl:1,children:`${p.parentTitle} ${p.required?`(${s("common.required")})`:""}`},p.parentName+p.mount_point))],children:t.jsx(y,{display:"flex",color:"primary.main",ml:1,children:t.jsx(Q,{icon:"octicon:package-dependents-16"})})})]}),t.jsx("div",{style:{flex:1}}),t.jsx(y,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(vr,{onClick:h,startIcon:t.jsx(Q,{icon:"ph:download-simple-bold"}),children:s("common.install")})})]}),t.jsx(Xe,{class:"line"},"line")]})}wn.propTypes={meta:i.object.isRequired,logoUrl:i.string,setInstallComponentMeta:i.func.isRequired,dependencies:i.arrayOf(i.shape({parentDid:i.string,parentName:i.string,parentPoint:i.string,required:i.bool}))};wn.defaultProps={logoUrl:"",dependencies:[]};const Di=$(Sn)`
434
434
  .line {
435
435
  opacity: 0.5;
436
436
  }
@@ -480,7 +480,7 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
480
480
  margin-left: 4px;
481
481
  transform: translateY(-1px);
482
482
  }
483
- `;function En({blocklet:e,onUpdate:o,getComponentUrl:n,...a}){var _e;const{t:r}=f.useContext(ve),{api:s,inService:h,info:c}=H(),{addDeletingDid:p,removeDeletingDid:x,matchDeletingDid:g}=Vt(),[l,b]=f.useState(!1),[d,T]=f.useState(null),[S,R]=f.useState(null),[k,C]=f.useState(!1),[m,u]=f.useState(!1),[v,w]=f.useState(!1),[j,N]=f.useState(!1),[M,Z]=f.useState(null),I=e&&e.structVersion!==U.APP_STRUCT_VERSION,[ne,me]=f.useState(!1),J=[...e.children];e.meta.group!=="gateway"&&J.unshift(e),g(J.map(E=>E.meta.did));const Pe=async()=>{if(!l){b(!0);try{const{updateId:E,updateList:V}=(await s.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(b(!1),!E){L.info(r("blocklet.component.noUpdate"));return}const ce=[];B.forEachChildSync(e,(ee,{id:be,ancestors:z})=>{const Ie=V.find(Re=>Re.id===be);if(Ie){const Re=z.slice(1).concat(ee).map(Le=>Le.meta.title||Le.meta.name).join(" / "),We=(z[1]||ee).meta.did;ce.push({groupId:We,name:Re,version:ee.meta.version,newVersion:Ie.meta.version})}});const F={};ce.forEach(ee=>{F[ee.groupId]?ee.disabled=!0:F[ee.groupId]=!0}),T({params:{updateId:E},list:ce,checks:F,hasChecks:!0})}catch(E){b(!1),L.error(ie(E))}}},we=async()=>{if(!l)try{b(!0);const E=Object.keys(d.checks).filter(ce=>d.checks[ce]),V={updateId:d.params.updateId,rootDid:e.meta.did,selectedComponents:E};await s.upgradeComponents({input:V}),b(!1),T(null),me(null)}catch(E){b(!1),L.error(ie(E))}},Ee=async(E,V)=>{p(E.meta.did);try{await s.deleteComponent({input:{did:E.meta.did,keepData:V==="keepData",rootDid:e.meta.did}}),await Ke(800)}catch(ce){L.error(ie(ce)),x(E.meta.did)}},_=async E=>{try{await s.startBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},fe=async E=>{try{await s.stopBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},G=async E=>{try{await s.restartBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},he=(E,V)=>{const{checked:ce}=E.target;T(F=>{const ee=Object.entries(F.checks).reduce((z,[Ie,Re])=>(z[Ie]=V===Ie||V==="all"?ce:Re,z),{}),be=Object.values(ee).includes(!0);return{...F,checks:ee,hasChecks:be}})},A=f.useMemo(()=>d==null?void 0:d.list.filter(E=>!E.disabled).every(E=>d.checks[E.groupId]),[d]);gi(Pe);const ke=xi({blocklet:e,scrollToComponent:!0}),le=M||ke;return t.jsxs(Ui,{component:"div",...a,children:[t.jsxs(Ni,{display:"flex",children:[t.jsxs(Li,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[J!=null&&J.length?`${r("common.components")} (${J.length})`:`${r("common.components")}`,!I&&t.jsx(At,{permission:h?"":"mutate_blocklets",role:h?He:[],children:t.jsx(Xt,{children:t.jsx(qt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!ne,children:t.jsxs(ae,{disabled:l||B.isInProgress(e.status),onClick:()=>{Pe()},"data-cy":"check-for-updates",children:[t.jsx(y,{ml:.5,mr:.5,display:"flex",children:l?t.jsx(ue,{size:16}):t.jsx(wo,{style:{fontSize:"1em"}})}),r("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(At,{permission:h?"":"mutate_blocklets",role:h?He:[],children:t.jsxs(y,{display:"flex",alignItems:"center",children:[!I&&t.jsx(fn,{blocklet:e,serverVersion:c.version,children:({open:E})=>t.jsxs(ae,{disabled:l||B.isInProgress(e.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:E,children:[t.jsx(Er,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.component.add")]})}),t.jsx(So,{"data-cy":"component-actions",actions:[{icon:t.jsx(Q,{icon:"fluent:link-20-filled"}),onClick:()=>u(!0),text:r("router.rule.add.title"),disabled:l||B.isInProgress(e.status)},...I?[]:[{icon:t.jsx(Q,{icon:"mdi:variable"}),onClick:()=>{w(!0)},text:r("common.environments")},{icon:t.jsx(Qt,{}),onClick:()=>{N(!0)},text:r("common.preferences")}]].filter(Boolean)})]})})]}),J!=null&&J.length?t.jsxs(t.Fragment,{children:[t.jsxs(y,{mt:2,children:[e.meta.group!=="gateway"&&t.jsx(mt,{blocklet:e,app:e,onRemove:Ee,onStart:_,onStop:fe,onRestart:G,getComponentUrl:n},`0-${e.meta.did}`),e.children.map(E=>t.jsx(mt,{depth:1,blocklet:E,ancestors:[e],app:e,onRemove:Ee,onStart:_,onStop:fe,onRestart:G,getComponentUrl:n},`1-${E.meta.did}`))]},`top-blocklet-${e.meta.did}`),(_e=e.optionalComponents)==null?void 0:_e.map(E=>t.jsx(Sn,{children:t.jsx(wn,{setInstallComponentMeta:Z,...E})},E.meta.did))]}):t.jsx(y,{mt:8,children:t.jsx(Tr,{children:r("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(fi,{})}),!!d&&t.jsx(Fn,{open:!0,fullWidth:!0,children:t.jsxs(y,{paddingY:1.5,children:[t.jsx(zn,{children:r("blocklet.component.updateTitle")}),t.jsxs(y,{component:Vn,py:4,children:[d.list.filter(E=>!E.disabled).length>1&&t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx(Yn,{checked:A,onChange:E=>he(E,"all")}),t.jsx(y,{children:r(A?"common.unselectAll":"common.selectAll")})]}),d.list.map(E=>t.jsxs(y,{display:"flex",alignItems:"center",mb:1,children:[t.jsx(Yn,{checked:d.checks[E.groupId],onChange:V=>he(V,E.groupId),style:{marginLeft:E.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:E.disabled}),t.jsxs(y,{flexGrow:1,children:[t.jsx(y,{pt:1,xs:8,children:E.name}),E.version&&t.jsxs(lt,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[t.jsx(lt,{item:!0,xs:3,children:E.version}),t.jsx(lt,{item:!0,xs:1,children:t.jsx(br,{style:{fontSize:"0.9em"}})}),t.jsx(lt,{item:!0,xs:3,children:t.jsx(y,{color:"secondary.main",children:E.newVersion})})]})]},`${E.name}-${E.newVersion}`)]},E.name))]}),t.jsxs(Rr,{style:{padding:"8px 24px 24px"},children:[t.jsx(ae,{onClick:()=>{T(null)},children:r("common.cancel")}),t.jsxs(ae,{onClick:E=>{E.stopPropagation(),we()},color:"primary",disabled:l||!d.hasChecks,variant:"contained",autoFocus:!0,children:[l&&t.jsx(ue,{size:16}),r("common.update")]})]})]})}),!!S&&t.jsx(Fn,{open:!0,fullWidth:!0,onClose:()=>R(!1),children:t.jsxs(y,{paddingY:1.5,children:[t.jsx(zn,{children:r("common.configuration")}),t.jsx(Vn,{children:t.jsx(y,{py:2,children:t.jsx(Mt,{control:t.jsx(ws,{checked:k,onChange:E=>C(!!E.target.checked)}),label:r("blocklet.component.showContainer")})})})]})}),t.jsx(bt,{selectedMeta:le,blocklet:e,showDialog:!!le,setShowDialog:()=>Z(null)}),m&&t.jsx(hn,{hiddenChildren:!0,open:!0,onClose:()=>u(!1)}),v&&t.jsx(jt,{open:!0,onClose:()=>w(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),j&&t.jsx(wt,{open:!0,onClose:()=>N(!1),blocklet:e,ancestors:[]})]})}En.propTypes={blocklet:i.object.isRequired,onUpdate:i.func,getComponentUrl:i.func};En.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Ui=$.div`
483
+ `;function En({blocklet:e,onUpdate:o,getComponentUrl:n,...a}){var _e;const{t:r}=f.useContext(ve),{api:s,inService:h,info:c}=H(),{addDeletingDid:p,removeDeletingDid:x,matchDeletingDid:g}=Vt(),[l,b]=f.useState(!1),[d,T]=f.useState(null),[S,R]=f.useState(null),[P,C]=f.useState(!1),[m,u]=f.useState(!1),[v,w]=f.useState(!1),[j,N]=f.useState(!1),[M,Z]=f.useState(null),I=e&&e.structVersion!==U.APP_STRUCT_VERSION,[ne,me]=f.useState(!1),J=[...e.children];e.meta.group!=="gateway"&&J.unshift(e),g(J.map(E=>E.meta.did));const ke=async()=>{if(!l){b(!0);try{const{updateId:E,updateList:V}=(await s.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(b(!1),!E){L.info(r("blocklet.component.noUpdate"));return}const ce=[];B.forEachChildSync(e,(ee,{id:be,ancestors:z})=>{const Ie=V.find(Re=>Re.id===be);if(Ie){const Re=z.slice(1).concat(ee).map(Le=>Le.meta.title||Le.meta.name).join(" / "),Ge=(z[1]||ee).meta.did;ce.push({groupId:Ge,name:Re,version:ee.meta.version,newVersion:Ie.meta.version})}});const F={};ce.forEach(ee=>{F[ee.groupId]?ee.disabled=!0:F[ee.groupId]=!0}),T({params:{updateId:E},list:ce,checks:F,hasChecks:!0})}catch(E){b(!1),L.error(ie(E))}}},we=async()=>{if(!l)try{b(!0);const E=Object.keys(d.checks).filter(ce=>d.checks[ce]),V={updateId:d.params.updateId,rootDid:e.meta.did,selectedComponents:E};await s.upgradeComponents({input:V}),b(!1),T(null),me(null)}catch(E){b(!1),L.error(ie(E))}},Ee=async(E,V)=>{p(E.meta.did);try{await s.deleteComponent({input:{did:E.meta.did,keepData:V==="keepData",rootDid:e.meta.did}}),await Ke(800)}catch(ce){L.error(ie(ce)),x(E.meta.did)}},_=async E=>{try{await s.startBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},fe=async E=>{try{await s.stopBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},W=async E=>{try{await s.restartBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ke(800)}catch(V){L.error(ie(V))}},he=(E,V)=>{const{checked:ce}=E.target;T(F=>{const ee=Object.entries(F.checks).reduce((z,[Ie,Re])=>(z[Ie]=V===Ie||V==="all"?ce:Re,z),{}),be=Object.values(ee).includes(!0);return{...F,checks:ee,hasChecks:be}})},A=f.useMemo(()=>d==null?void 0:d.list.filter(E=>!E.disabled).every(E=>d.checks[E.groupId]),[d]);gi(ke);const Pe=xi({blocklet:e,scrollToComponent:!0}),le=M||Pe;return t.jsxs(Ui,{component:"div",...a,children:[t.jsxs(Ni,{display:"flex",children:[t.jsxs(Li,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[J!=null&&J.length?`${r("common.components")} (${J.length})`:`${r("common.components")}`,!I&&t.jsx(At,{permission:h?"":"mutate_blocklets",role:h?He:[],children:t.jsx(Xt,{children:t.jsx(qt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!ne,children:t.jsxs(ae,{disabled:l||B.isInProgress(e.status),onClick:()=>{ke()},"data-cy":"check-for-updates",children:[t.jsx(y,{ml:.5,mr:.5,display:"flex",children:l?t.jsx(ue,{size:16}):t.jsx(wo,{style:{fontSize:"1em"}})}),r("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(At,{permission:h?"":"mutate_blocklets",role:h?He:[],children:t.jsxs(y,{display:"flex",alignItems:"center",children:[!I&&t.jsx(fn,{blocklet:e,serverVersion:c.version,children:({open:E})=>t.jsxs(ae,{disabled:l||B.isInProgress(e.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:E,children:[t.jsx(Er,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.component.add")]})}),t.jsx(So,{"data-cy":"component-actions",actions:[{icon:t.jsx(Q,{icon:"fluent:link-20-filled"}),onClick:()=>u(!0),text:r("router.rule.add.title"),disabled:l||B.isInProgress(e.status)},...I?[]:[{icon:t.jsx(Q,{icon:"mdi:variable"}),onClick:()=>{w(!0)},text:r("common.environments")},{icon:t.jsx(Qt,{}),onClick:()=>{N(!0)},text:r("common.preferences")}]].filter(Boolean)})]})})]}),J!=null&&J.length?t.jsxs(t.Fragment,{children:[t.jsxs(y,{mt:2,children:[e.meta.group!=="gateway"&&t.jsx(mt,{blocklet:e,app:e,onRemove:Ee,onStart:_,onStop:fe,onRestart:W,getComponentUrl:n},`0-${e.meta.did}`),e.children.map(E=>t.jsx(mt,{depth:1,blocklet:E,ancestors:[e],app:e,onRemove:Ee,onStart:_,onStop:fe,onRestart:W,getComponentUrl:n},`1-${E.meta.did}`))]},`top-blocklet-${e.meta.did}`),(_e=e.optionalComponents)==null?void 0:_e.map(E=>t.jsx(Sn,{children:t.jsx(wn,{setInstallComponentMeta:Z,...E})},E.meta.did))]}):t.jsx(y,{mt:8,children:t.jsx(Tr,{children:r("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(fi,{})}),!!d&&t.jsx(Fn,{open:!0,fullWidth:!0,children:t.jsxs(y,{paddingY:1.5,children:[t.jsx(zn,{children:r("blocklet.component.updateTitle")}),t.jsxs(y,{component:Vn,py:4,children:[d.list.filter(E=>!E.disabled).length>1&&t.jsxs(y,{display:"flex",alignItems:"center",children:[t.jsx(Yn,{checked:A,onChange:E=>he(E,"all")}),t.jsx(y,{children:r(A?"common.unselectAll":"common.selectAll")})]}),d.list.map(E=>t.jsxs(y,{display:"flex",alignItems:"center",mb:1,children:[t.jsx(Yn,{checked:d.checks[E.groupId],onChange:V=>he(V,E.groupId),style:{marginLeft:E.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:E.disabled}),t.jsxs(y,{flexGrow:1,children:[t.jsx(y,{pt:1,xs:8,children:E.name}),E.version&&t.jsxs(lt,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[t.jsx(lt,{item:!0,xs:3,children:E.version}),t.jsx(lt,{item:!0,xs:1,children:t.jsx(br,{style:{fontSize:"0.9em"}})}),t.jsx(lt,{item:!0,xs:3,children:t.jsx(y,{color:"secondary.main",children:E.newVersion})})]})]},`${E.name}-${E.newVersion}`)]},E.name))]}),t.jsxs(Rr,{style:{padding:"8px 24px 24px"},children:[t.jsx(ae,{onClick:()=>{T(null)},children:r("common.cancel")}),t.jsxs(ae,{onClick:E=>{E.stopPropagation(),we()},color:"primary",disabled:l||!d.hasChecks,variant:"contained",autoFocus:!0,children:[l&&t.jsx(ue,{size:16}),r("common.update")]})]})]})}),!!S&&t.jsx(Fn,{open:!0,fullWidth:!0,onClose:()=>R(!1),children:t.jsxs(y,{paddingY:1.5,children:[t.jsx(zn,{children:r("common.configuration")}),t.jsx(Vn,{children:t.jsx(y,{py:2,children:t.jsx(Mt,{control:t.jsx(ws,{checked:P,onChange:E=>C(!!E.target.checked)}),label:r("blocklet.component.showContainer")})})})]})}),t.jsx(bt,{selectedMeta:le,blocklet:e,showDialog:!!le,setShowDialog:()=>Z(null)}),m&&t.jsx(hn,{hiddenChildren:!0,open:!0,onClose:()=>u(!1)}),v&&t.jsx(jt,{open:!0,onClose:()=>w(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),j&&t.jsx(wt,{open:!0,onClose:()=>N(!1),blocklet:e,ancestors:[]})]})}En.propTypes={blocklet:i.object.isRequired,onUpdate:i.func,getComponentUrl:i.func};En.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Ui=$.div`
484
484
  .title {
485
485
  font-size: 1.2rem;
486
486
  font-weight: bold;
@@ -518,4 +518,4 @@ import{bY as Bo,j as t,f5 as Oo,hK as $o,l5 as Mo,aO as Gt,aP as Wt,m as W,br as
518
518
  width: 100%;
519
519
  justify-content: space-between;
520
520
  }
521
- `;function ko(e){const{locale:o}=f.useContext(ve),{blocklet:n,recommendedDomain:a}=Es(),r=s=>Sr({blocklet:n,domain:{value:a||`${wr.encode(n.appPid)}.${U.DEFAULT_DID_DOMAIN}`},mountPoint:s,params:zt(n,o)});return t.jsx(En,{blocklet:n,getComponentUrl:r,...e})}ko.propTypes={};ko.defaultProps={};export{ko as default};
521
+ `;function Po(e){const{locale:o}=f.useContext(ve),{blocklet:n,recommendedDomain:a}=Es(),r=s=>Sr({blocklet:n,domain:{value:a||`${wr.encode(n.appPid)}.${U.DEFAULT_DID_DOMAIN}`},mountPoint:s,params:zt(n,o)});return t.jsx(En,{blocklet:n,getComponentUrl:r,...e})}Po.propTypes={};Po.defaultProps={};export{Po as default};