@abtnode/webapp 1.16.29 → 1.16.30-beta-958ae719

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 (201) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-BIVkDKiV.js → Add-CdB1GTw1.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-BSN8E-vL.js → ArrowDropDown-cQI9feYM.js} +1 -1
  5. package/dist/assets/{Autocomplete-3iEbBt3p.js → Autocomplete-Bhg6P1T-.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-B1EjQ7_S.js → Breadcrumbs-zBxzGTSz.js} +1 -1
  7. package/dist/assets/{ButtonGroup-5q10mUxm.js → ButtonGroup-CEodIFRb.js} +1 -1
  8. package/dist/assets/{CheckCircle-SQxexLA6.js → CheckCircle-D2TmcEFh.js} +1 -1
  9. package/dist/assets/{ChevronLeft-DGO3AjSX.js → ChevronLeft-Eu14H7S5.js} +1 -1
  10. package/dist/assets/{ChevronRight-DcNBTOQr.js → ChevronRight-Ba-Rcz-i.js} +1 -1
  11. package/dist/assets/{Close-Dr9bVY_7.js → Close-Dq2gRzdt.js} +1 -1
  12. package/dist/assets/{Delete-BA9-i54s.js → Delete-Di-3Vxhz.js} +1 -1
  13. package/dist/assets/{DeleteOutline-BQLCdvYk.js → DeleteOutline-BQeXrAk8.js} +1 -1
  14. package/dist/assets/DeleteOutline-CaAz8YM2.js +1 -0
  15. package/dist/assets/{Done-CCcZllux.js → Done-BiwCZjD9.js} +1 -1
  16. package/dist/assets/{Edit-BFcAkLvC.js → Edit-CeoVDX9P.js} +1 -1
  17. package/dist/assets/{EditIcon-Bsk6W7fb.js → EditIcon-CIZQcG-N.js} +1 -1
  18. package/dist/assets/{ExpandMore-rt48LU-T.js → ExpandMore-Co2TCgMe.js} +1 -1
  19. package/dist/assets/{FilterList-qnkLmWiK.js → FilterList-CtKjjq1V.js} +5 -5
  20. package/dist/assets/{Google-ZwJqo6k4.js → Google-CB64yAYZ.js} +3 -3
  21. package/dist/assets/{Https-D5FI5kRj.js → Https-CZ8ckEIE.js} +1 -1
  22. package/dist/assets/{InputAdornment-O2bgTsbw.js → InputAdornment-DAdjrwZB.js} +1 -1
  23. package/dist/assets/{InputLabel-DKHlRadP.js → InputLabel-E2n2XENL.js} +1 -1
  24. package/dist/assets/{LastPage-DSz-M1aM.js → LastPage-Dk3Ng8r_.js} +1 -1
  25. package/dist/assets/{Launch-e9NpOcr5.js → Launch-DCauoB9i.js} +1 -1
  26. package/dist/assets/{Link-CWm9FEnI.js → Link-B5_3_F5M.js} +1 -1
  27. package/dist/assets/{LoadingButton-D7VQLypv.js → LoadingButton-CmY35jLm.js} +1 -1
  28. package/dist/assets/{LockIcon-BGABEZ6C.js → LockIcon-DLnWJnFU.js} +1 -1
  29. package/dist/assets/{Loop-v-roMehG.js → Loop-BK2g7AZi.js} +1 -1
  30. package/dist/assets/{MoreVert-CpEsw2Tj.js → MoreVert-CGx6Mqxv.js} +1 -1
  31. package/dist/assets/{Pagination-BPPkQTXZ.js → Pagination-B4jmH7k6.js} +1 -1
  32. package/dist/assets/{Public-s40J-s3W.js → Public-C0O-VR0x.js} +1 -1
  33. package/dist/assets/{SchemaReference.es-yLf24oFH.js → SchemaReference.es-CwVyx9KR.js} +1 -1
  34. package/dist/assets/{Search-BvtdswCD.js → Search-Drx5S2Fc.js} +1 -1
  35. package/dist/assets/{Select-6AAHiQjm.js → Select-BAE2ztrO.js} +2 -2
  36. package/dist/assets/{Skeleton-8M4ffKSP.js → Skeleton-Dg829dzN.js} +5 -5
  37. package/dist/assets/{Slider-dM16D4dK.js → Slider-DalB8Bfa.js} +1 -1
  38. package/dist/assets/{Stepper-qCoo64ls.js → Stepper-CyP9t2tf.js} +1 -1
  39. package/dist/assets/{TextField-D7-Vl4N2.js → TextField-UIj7bh4L.js} +1 -1
  40. package/dist/assets/{ToggleButtonGroup-C8YC_AbK.js → ToggleButtonGroup-BezYeHSt.js} +1 -1
  41. package/dist/assets/{ViewList-ww_Jy26j.js → ViewList-BdFK3ZRI.js} +1 -1
  42. package/dist/assets/{actions-DVIIvqI9.js → actions-ByIKLhO5.js} +1 -1
  43. package/dist/assets/{actions-CfLfEA5o.js → actions-DvMK194y.js} +1 -1
  44. package/dist/assets/{agreement-j9qZoXbi.js → agreement-CaStPJUg.js} +6 -6
  45. package/dist/assets/api-px2wpsj4.js +1 -0
  46. package/dist/assets/app-avatar-DMwKWgcU.js +1 -0
  47. package/dist/assets/{ar-D-8bmv2Q.js → ar-CYspPmSu.js} +1 -1
  48. package/dist/assets/{audit-logs-DtLwS7ge.js → audit-logs-t-VHu0Dr.js} +1 -1
  49. package/dist/assets/blocklet-BkUmmvf6.js +1 -0
  50. package/dist/assets/{brace-fold.es-MaAtm0YJ.js → brace-fold.es-CTXnLvpw.js} +1 -1
  51. package/dist/assets/{bundle-avatar-CzY4FWcT.js → bundle-avatar-FKqqno38.js} +1 -1
  52. package/dist/assets/{chart-CL8fHlYj.js → chart-CRT8ZY2D.js} +2 -2
  53. package/dist/assets/{click-to-copy-CRCcWlGf.js → click-to-copy-D6fJs3Fy.js} +1 -1
  54. package/dist/assets/{closebrackets.es-ClBbybwI.js → closebrackets.es-CeqttfBg.js} +1 -1
  55. package/dist/assets/{codemirror.es-CVvRjjht.js → codemirror.es-DLcwUx7p.js} +1 -1
  56. package/dist/assets/{comment.es-C82zWRz0.js → comment.es-Dwlg7zZ0.js} +1 -1
  57. package/dist/assets/{config-navigation-Ba5IHsVi.js → config-navigation-iOt18Gkq.js} +5 -5
  58. package/dist/assets/{de-BXUm1QYV.js → de-DIG5UukX.js} +1 -1
  59. package/dist/assets/{delete-confirm-BGrzi75s.js → delete-confirm-SB_AYHUI.js} +1 -1
  60. package/dist/assets/{detail-dhpUaLCM.js → detail-aujfRVSm.js} +3 -3
  61. package/dist/assets/{dialog.es-DqPlApF_.js → dialog.es-BoZ8Hndg.js} +1 -1
  62. package/dist/assets/{download-C05PPT48.js → download-DQwdlhb7.js} +1 -1
  63. package/dist/assets/{es-CH6tZGrR.js → es-iIE-oygq.js} +1 -1
  64. package/dist/assets/{foldgutter.es-CeF_j6cJ.js → foldgutter.es-C0B3TZBw.js} +1 -1
  65. package/dist/assets/{fr-roccVFT3.js → fr-D8XyKysR.js} +1 -1
  66. package/dist/assets/getValidReactChildren-COQgThjG.js +1 -0
  67. package/dist/assets/{hi-VN-lZj6f.js → hi-C12r029w.js} +1 -1
  68. package/dist/assets/{hint.es-DNAfoVMm.js → hint.es-8QwfI9G8.js} +1 -1
  69. package/dist/assets/{hint.es2-CU1qoYEt.js → hint.es2-CSc3mT9h.js} +1 -1
  70. package/dist/assets/{id-C-ovCb8b.js → id-BM1nX889.js} +1 -1
  71. package/dist/assets/{iframe-BvKPLFbb.js → iframe-BsBQ7ohV.js} +1 -1
  72. package/dist/assets/{index-CwFZQrLE.js → index-7Qh6jCeM.js} +1 -1
  73. package/dist/assets/{index-Ck3GPasE.js → index-AmOaldrX.js} +3 -3
  74. package/dist/assets/{index-B47niqg_.js → index-B-ybRhYS.js} +3 -3
  75. package/dist/assets/{index-CBdRhIVO.js → index-B4C9ArGO.js} +3 -3
  76. package/dist/assets/{index-DeHtrQ7P.js → index-B4uBhVoZ.js} +1 -1
  77. package/dist/assets/index-B6-dKqLH.js +11 -0
  78. package/dist/assets/index-BHylZj48.js +278 -0
  79. package/dist/assets/{index-xdp5_tXH.js → index-BNTzqgfC.js} +1 -1
  80. package/dist/assets/{index-BTXMR9xa.js → index-BTF_a0ok.js} +2 -2
  81. package/dist/assets/{index-DD86vUxF.js → index-BZBRVOaw.js} +1 -1
  82. package/dist/assets/{index-DbPVOvSO.js → index-B_W7z3II.js} +1 -1
  83. package/dist/assets/{index-47g0cU0E.js → index-BaJfxzLi.js} +1 -1
  84. package/dist/assets/{index-BwYDd0Tm.js → index-BaSZHjNU.js} +1 -1
  85. package/dist/assets/{index-DxfcfSRi.js → index-By1cj6yo.js} +1 -1
  86. package/dist/assets/index-C69Wt2SK.js +150 -0
  87. package/dist/assets/{index-BOqdAGub.js → index-CBMSKoCT.js} +1 -1
  88. package/dist/assets/{index-BmYxQtQ4.js → index-CEXcSiNy.js} +1 -1
  89. package/dist/assets/index-CKyWFL_5.js +54 -0
  90. package/dist/assets/index-Cp7_fpD3.js +1 -0
  91. package/dist/assets/{index-CP_gsEZk.js → index-CpTpPC7E.js} +1 -1
  92. package/dist/assets/{index-C5QsMFdj.js → index-CvB9dSIF.js} +1 -1
  93. package/dist/assets/index-DBXP37Lb.js +288 -0
  94. package/dist/assets/{index-nSc0VxEZ.js → index-DBmLMLK2.js} +1 -1
  95. package/dist/assets/{index-CPISMYm_.js → index-DWzRY4Xk.js} +1 -1
  96. package/dist/assets/{index-ZGnAW8k-.js → index-DhKEzK4G.js} +120 -120
  97. package/dist/assets/{index-CTuqdacw.js → index-DiVGhjwz.js} +1 -1
  98. package/dist/assets/{index-D-60mXOg.js → index-DpsnjJXZ.js} +1 -1
  99. package/dist/assets/{index-C0k3BC5k.js → index-Dr-mhUSe.js} +3 -3
  100. package/dist/assets/{index-DbXIo2GY.js → index-DzY48FPR.js} +9 -9
  101. package/dist/assets/index-FEwB9kgu.js +262 -0
  102. package/dist/assets/{index-Jx4Fqi_s.js → index-GRZ7T-Vj.js} +28 -28
  103. package/dist/assets/{index-Q8y1koUx.js → index-PM4c29FK.js} +1 -1
  104. package/dist/assets/{index-htQb1has.js → index-Q7qqT9VL.js} +1 -1
  105. package/dist/assets/{index-CcHjeoRT.js → index-UcfhuBCV.js} +1 -1
  106. package/dist/assets/{index-Dpm78Z5H.js → index-W1Roe0KR.js} +1 -1
  107. package/dist/assets/{index-CRpa8mt0.js → index-Z-ABz1jd.js} +5 -5
  108. package/dist/assets/{index-BzvNtIY8.js → index-_7deM5fB.js} +1 -1
  109. package/dist/assets/{index-2KEUrOnp.js → index-aGlAj0Zr.js} +1 -1
  110. package/dist/assets/index-hQaQ5PJ4.js +314 -0
  111. package/dist/assets/{index-C1yo1XnB.js → index-lU5qXZaf.js} +1 -1
  112. package/dist/assets/{index-CsDwstJh.js → index-lfnvzeT0.js} +1 -1
  113. package/dist/assets/{index-B2Ydaom7.js → index-uXUXUKt1.js} +7 -7
  114. package/dist/assets/{index-CmC3_Eds.js → index-vVyFVEQx.js} +1 -1
  115. package/dist/assets/{index-COUqkfTn.js → index-xq7hcpVR.js} +1 -1
  116. package/dist/assets/{index.es-hjsi54WY.js → index.es-BN3JAuK7.js} +1 -1
  117. package/dist/assets/{index.esm-w_WP2iFy.js → index.esm--UowQ839.js} +1 -1
  118. package/dist/assets/{info-addon.es-BwQtq18_.js → info-addon.es-CTOMNSVc.js} +1 -1
  119. package/dist/assets/{info.es-Bxzc18tW.js → info.es-BrcMiDXg.js} +1 -1
  120. package/dist/assets/{install-from-url-BpQI48sC.js → install-from-url-CWSHHc8X.js} +1 -1
  121. package/dist/assets/{invitation-DxXG7nra.js → invitation-VBkiv8Lw.js} +8 -8
  122. package/dist/assets/is-path-prefix-equal-BRfJaTzW.js +1 -0
  123. package/dist/assets/{isEqual-DkxHXXMW.js → isEqual-RXiETUsF.js} +1 -1
  124. package/dist/assets/{item-CZsxlZnz.js → item-BE4r4zK9.js} +1 -1
  125. package/dist/assets/{ja-D-sN9ij0.js → ja-D8yfIRFO.js} +1 -1
  126. package/dist/assets/{javascript.es-CGn-ScFl.js → javascript.es-oUt02u-R.js} +1 -1
  127. package/dist/assets/{jump-to-line.es-CWVtSCYy.js → jump-to-line.es-xeQdXXR7.js} +1 -1
  128. package/dist/assets/{jump.es-DxdpkWWi.js → jump.es-DoHQC_ja.js} +1 -1
  129. package/dist/assets/{ko-DFpbqZ_Q.js → ko-BYDKCXC0.js} +1 -1
  130. package/dist/assets/{line-DfRJLxHw.js → line-DmTazELP.js} +4 -4
  131. package/dist/assets/{lint.es-Cn-NE8s7.js → lint.es-CPYwltP7.js} +1 -1
  132. package/dist/assets/{lint.es2-DiLIozTW.js → lint.es2-6T7H8Exj.js} +1 -1
  133. package/dist/assets/{lint.es3-BKeD_KCD.js → lint.es3-Cz2FVjJI.js} +1 -1
  134. package/dist/assets/{list-header-Cn6ronu6.js → list-header-B6f1dZ3Q.js} +1 -1
  135. package/dist/assets/{log-CBd4yiLd.js → log-DfA15qoc.js} +1 -1
  136. package/dist/assets/{lottie-BhIusYBK.js → lottie-C-f15GXo.js} +1 -1
  137. package/dist/assets/{matchbrackets.es-C8Sy_DTp.js → matchbrackets.es-BOyxvkba.js} +1 -1
  138. package/dist/assets/{memory-CrREi08U.js → memory-BCv7wlIh.js} +1 -1
  139. package/dist/assets/{mode.es-CRX6d_8r.js → mode.es-DwFnPhPx.js} +1 -1
  140. package/dist/assets/{mode.es2-BYlzTYp8.js → mode.es2-BWVwRWIf.js} +1 -1
  141. package/dist/assets/{mode.es3-BlMpLqAY.js → mode.es3-BQDrBmo8.js} +1 -1
  142. package/dist/assets/{onlineParser.es-Buh5bsDU.js → onlineParser.es-B9niO3Rc.js} +1 -1
  143. package/dist/assets/{overview--S9u2G7d.js → overview-Cx_VZc65.js} +1 -1
  144. package/dist/assets/{pt-BXC7UTMq.js → pt-B9DRiZEN.js} +1 -1
  145. package/dist/assets/{react-C3TTI-Hf.js → react-DSqvcQYy.js} +3 -3
  146. package/dist/assets/{redux-D53RmvG3.js → redux-BsHcI3_9.js} +1 -1
  147. package/dist/assets/{resource-dialog-BqPaioMe.js → resource-dialog-DLQewgrN.js} +2 -2
  148. package/dist/assets/{ru-BbD1NNUC.js → ru-CUxGgO8D.js} +1 -1
  149. package/dist/assets/{runtime-8R1L5Qei.js → runtime-851oSSvI.js} +1 -1
  150. package/dist/assets/{schema-vba8ScMR.js → schema-CHbqUY8n.js} +1 -1
  151. package/dist/assets/sdk-BNPz4UBQ.js +1 -0
  152. package/dist/assets/{search.es-CUmn7XrO.js → search.es-BwvbmPsk.js} +1 -1
  153. package/dist/assets/{searchcursor.es-CnWycfn9.js → searchcursor.es-mmx6SXwj.js} +1 -1
  154. package/dist/assets/service-CeSZ159H.js +1 -0
  155. package/dist/assets/{shorten-label-BbyRZw10.js → shorten-label-Zm18p2j_.js} +1 -1
  156. package/dist/assets/{show-hint.es-yYddy2nN.js → show-hint.es-BWO21koW.js} +1 -1
  157. package/dist/assets/{slicedToArray-C-ReaQzH.js → slicedToArray-CSiWJNnp.js} +1 -1
  158. package/dist/assets/{spaces-CHvfSEjC.js → spaces-B_PEyuiK.js} +1 -1
  159. package/dist/assets/{sublime.es-C7Xwv4Fs.js → sublime.es-DbB59fDR.js} +1 -1
  160. package/dist/assets/{switch-control-YIGp_J-o.js → switch-control-CVljCfLQ.js} +1 -1
  161. package/dist/assets/{table-icons-Htpo0aNL.js → table-icons-DRSK9N17.js} +1 -1
  162. package/dist/assets/{tag-CxVWvL3v.js → tag-s8n8kLNC.js} +1 -1
  163. package/dist/assets/team-DcawcK1N.js +1 -0
  164. package/dist/assets/{th-VkDcmE_T.js → th-D6abaOt7.js} +1 -1
  165. package/dist/assets/toUpper-Caw7x1nX.js +1 -0
  166. package/dist/assets/{traffic-B7M7MwN4.js → traffic-Cp_OUEwu.js} +1 -1
  167. package/dist/assets/url-evaluation-85NTzVAr.js +7 -0
  168. package/dist/assets/{url-join-CZQCk0ge.js → url-join-BTiLIGs1.js} +1 -1
  169. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-DePpDQKa.js → use-blocklet-info-for-connect-did-spaces-B_L8zOwH.js} +1 -1
  170. package/dist/assets/{useLocalStorage-Cpx0Qijo.js → useLocalStorage-Dkuy7Y9c.js} +1 -1
  171. package/dist/assets/{useThemeProps-DMpUSpUQ.js → useThemeProps-DY6u-Sl5.js} +1 -1
  172. package/dist/assets/{util-opsnBGhQ.js → util-CR7yn4Rx.js} +1 -1
  173. package/dist/assets/{vi-CanFbf1v.js → vi-BsX5AAJJ.js} +1 -1
  174. package/dist/assets/{wait-container-DP8Bb6X-.js → wait-container-D6A_wUSz.js} +1 -1
  175. package/dist/assets/withStyles-B8wbvHA2.js +1 -0
  176. package/dist/assets/wrap-locale-B0GJBc6u.js +1 -0
  177. package/dist/assets/{zh-BxXo7x1m.js → zh-BxFByN8K.js} +1 -1
  178. package/dist/assets/{zh-tw-Bvqjz2OU.js → zh-tw-D7VeUoit.js} +1 -1
  179. package/dist/index.html +1 -1
  180. package/dist/service-worker.js +1 -1
  181. package/package.json +1 -1
  182. package/dist/assets/DeleteOutline-BngWwPLv.js +0 -1
  183. package/dist/assets/api-1QhTD3Py.js +0 -1
  184. package/dist/assets/app-avatar-DX2Wz0PD.js +0 -1
  185. package/dist/assets/blocklet-F36VtnS3.js +0 -1
  186. package/dist/assets/getValidReactChildren-BulArIz5.js +0 -1
  187. package/dist/assets/index-ByhJ7PKw.js +0 -278
  188. package/dist/assets/index-ByoVNU5z.js +0 -1
  189. package/dist/assets/index-C5jvxTRJ.js +0 -309
  190. package/dist/assets/index-D-TSSwe_.js +0 -54
  191. package/dist/assets/index-DShKrg-W.js +0 -150
  192. package/dist/assets/index-N35a-P_5.js +0 -288
  193. package/dist/assets/index-W_RWClvn.js +0 -262
  194. package/dist/assets/index-ziy-s42n.js +0 -11
  195. package/dist/assets/is-path-prefix-equal-BiTDqCe2.js +0 -1
  196. package/dist/assets/service-C47VUoeK.js +0 -1
  197. package/dist/assets/team-CgUZDWzH.js +0 -1
  198. package/dist/assets/toUpper-CeMG-5le.js +0 -1
  199. package/dist/assets/url-evaluation-DCs4qJ1s.js +0 -7
  200. package/dist/assets/withStyles-CiarYOCJ.js +0 -1
  201. package/dist/assets/wrap-locale-BSVVLHW0.js +0 -1
@@ -1,4 +1,4 @@
1
- import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O as y,ax as ve,A as N,f as Ce,bp as Je,b as X,M as O,J as dt,U as Mt,cc as Oe,n as F,K as Z,gN as Wo,bH as Me,aY as ue,aX as gt,aC as Ft,a2 as $,D as xt,F as D,Y as Ke,$ as Hn,b1 as Ho,fP as Yo,fQ as Jo,C as ie,fe as Ko,y as mo,av as pt,a1 as we,x as Gt,hB as Qo,hC as Zo,B as oe,bc as fo,H as Wt,hD as Xo,m as ee,a3 as $o,eC as es,W as ho,Z as go,ak as ts,w as ns,Q as He,V as os,hE as xo,S as ge,az as ss,aA as rs,aB as is,i as yt,aN as as,cx as ls,bh as cs,hc as ds,hF as ps,ay as Yn,cv as us,ad as Fe,aJ as yo,bJ as Ht,ce as ms,hG as fs,b7 as hs,z as gs,aZ as zt,T as xs,aQ as Ye,at as At,bq as Co,aF as ys,fY as Pe,dP as Cs,hH as js,gl as Jn,hI as Kn,gn as Qn,a_ as vs,G as at,gp as Ss,bI as Rs}from"./index-ZGnAW8k-.js";import{d as bs}from"./Add-BIVkDKiV.js";import{a as Es,R as ct,F as Ts,L as ws,d as Yt,b as Jt}from"./line-DfRJLxHw.js";import{C as Ps,A as ks,d as Is}from"./agreement-j9qZoXbi.js";import{E as Us}from"./index-Q8y1koUx.js";import{b as Ds,a as Bs,c as As,u as Kt,e as Ns}from"./actions-DVIIvqI9.js";import{S as Ls}from"./switch-control-YIGp_J-o.js";import{u as te}from"./blocklet-F36VtnS3.js";import{d as jo}from"./Edit-BFcAkLvC.js";import{T as Os}from"./index-CPISMYm_.js";import{T as Ms,M as Fs,t as Gs}from"./table-icons-Htpo0aNL.js";import{C as Zn}from"./click-to-copy-CRCcWlGf.js";import{T as K}from"./TextField-D7-Vl4N2.js";import{d as Qt}from"./Link-CWm9FEnI.js";import{c as zs,C as qs,a as Vs,b as _s,D as Ws,A as Hs,B as Ys,d as Js,S as Ks}from"./item-CZsxlZnz.js";import{u as Qs,a as Zs,P as vo,L as Xn,A as Xs,S as $s}from"./index-BwYDd0Tm.js";import{u as So,t as er}from"./toUpper-CeMG-5le.js";import{a as tr,b as nr,c as or,d as sr,e as rr,g as $n,f as ir,i as eo}from"./spaces-CHvfSEjC.js";import{d as ar}from"./EditIcon-Bsk6W7fb.js";import{d as lr}from"./Done-CCcZllux.js";import{C as cr}from"./Google-ZwJqo6k4.js";import{I as dr,a as pr,f as ur,B as mr}from"./install-from-url-BpQI48sC.js";import{a as to}from"./api-1QhTD3Py.js";import{v as Ro,a as ut}from"./util-opsnBGhQ.js";import{P as fr,u as hr}from"./use-blocklet-info-for-connect-did-spaces-DePpDQKa.js";import{D as gr}from"./DeleteOutline-BngWwPLv.js";import{S as no}from"./index-BTXMR9xa.js";import{d as xr}from"./ArrowDropDown-BSN8E-vL.js";import{_ as yr}from"./useLocalStorage-Cpx0Qijo.js";import{d as Cr}from"./LockIcon-BGABEZ6C.js";import{d as Ct}from"./Delete-BA9-i54s.js";import{d as bo}from"./Launch-e9NpOcr5.js";import{C as jr}from"./delete-confirm-BGrzi75s.js";import{W as Qe}from"./tag-CxVWvL3v.js";import{d as vr}from"./is-path-prefix-equal-BiTDqCe2.js";import{R as Sr,b as oo,B as Eo}from"./url-evaluation-DCs4qJ1s.js";import{B as Rr}from"./bundle-avatar-CzY4FWcT.js";import{A as To}from"./actions-CfLfEA5o.js";import{I as Nt}from"./index-DeHtrQ7P.js";import{a as br}from"./index-CP_gsEZk.js";import{u as Er}from"./team-CgUZDWzH.js";import"./ButtonGroup-5q10mUxm.js";import"./getValidReactChildren-BulArIz5.js";import"./index-C5QsMFdj.js";import"./index-DxfcfSRi.js";import"./url-join-CZQCk0ge.js";import"./MoreVert-CpEsw2Tj.js";import"./FilterList-qnkLmWiK.js";import"./useThemeProps-DMpUSpUQ.js";import"./Select-6AAHiQjm.js";import"./InputLabel-DKHlRadP.js";import"./LastPage-DSz-M1aM.js";import"./slicedToArray-C-ReaQzH.js";import"./Search-BvtdswCD.js";import"./ChevronLeft-DGO3AjSX.js";import"./ChevronRight-DcNBTOQr.js";import"./DeleteOutline-BQLCdvYk.js";import"./redux-D53RmvG3.js";import"./Skeleton-8M4ffKSP.js";import"./InputAdornment-O2bgTsbw.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-Ck3GPasE.js";import"./index-ZG7jWpak.js";import"./preact.module-B1z5cdvs.js";import"./Close-Dr9bVY_7.js";import"./lottie-BhIusYBK.js";import"./schema-vba8ScMR.js";import"./index-BzvNtIY8.js";import"./isEqual-DkxHXXMW.js";import"./index-Dpm78Z5H.js";import"./Stepper-qCoo64ls.js";import"./index-47g0cU0E.js";import"./ExpandMore-rt48LU-T.js";import"./shorten-label-BbyRZw10.js";const Tr=_o(e.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");var Zt={},wr=_t;Object.defineProperty(Zt,"__esModule",{value:!0});var wo=Zt.default=void 0,Pr=wr(Vt()),kr=e;wo=Zt.default=(0,Pr.default)((0,kr.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");function Ir({deps:t}={deps:[]}){var i;const{blocklet:o}=te(),{api:s}=Y(),[a,n]=f.useState(null);return uo(async()=>{var m;if((m=o==null?void 0:o.meta)!=null&&m.did){const{autoCheckUpdate:l}=await s.getAutoCheckUpdate({input:{did:o.meta.did}});n(l)}},[(i=o==null?void 0:o.meta)==null?void 0:i.did].concat(t)),a}const Po=f.createContext({}),{Provider:Ur,Consumer:rl}=Po;function Xt({children:t}){const{api:o}=Y(),{blocklet:s}=te(),[a,n]=f.useState(!1),i=Ir({deps:[a]}),m=()=>{n(u=>!u)},l=async u=>{await o.updateAutoCheckUpdate({input:{did:s.meta.did,autoCheckUpdate:u}}),m()};return e.jsx(Ur,{value:{updateAutoCheckUpdate:l,autoCheckUpdate:i},children:t})}Xt.propTypes={children:r.any.isRequired};Xt.defaultProps={};function Dr(){return f.useContext(Po)}function $t({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Dr(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),N.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){N.error(l.message)}},m=!!(n!=null&&n.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(ve,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ls,{checked:m,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}$t.propTypes={children:r.any};$t.defaultProps={children:null};const Br=(t,o)=>{let{description:s}=t;return(Object.values(X.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},Lt=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom;function mt({blocklet:t,ancestors:o}){const s=Y(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>N.success(n("blocklet.config.changedTip")),l=c=>Lt(c,t,o);if(Je(t.status)||t.status==="unknown"&&Je(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")||c.key.startsWith("COMPONENT_")){N.error(n("blocklet.config.environment.invalidKey"));return}c.custom=!0;try{const v=await s.api.configBlocklet({input:{did:i,configs:[c]}});m(v.blocklet)}catch(v){N.error(Z(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")&&!X.BLOCKLET_CONFIGURABLE_KEY[c.key]){N.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=Wo(c);if(T){N.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!Lt(c,t,o)){N.error("Only key of custom env can be changed");return}j.push({key:v.key,custom:!0})}try{const T=await s.api.configBlocklet({input:{did:i,configs:j}});m(T.blocklet)}catch(T){N.error(Z(T))}},g=async c=>{if(c.required){N.error(n("blocklet.config.environment.deleteForbidden"));return}if(!Lt(c,t,o)){N.error("Only key of custom env can be changed");return}try{const v=await s.api.configBlocklet({input:{did:i,configs:[{key:c.key,custom:!0}]}});m(v.blocklet)}catch(v){N.error(Z(v))}},p=(t.configs||[]).filter(c=>!X.BLOCKLET_CONFIGURABLE_KEY[c.key]),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),R=p.map(c=>({...c,value:Object.values(X.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=R.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},b=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Zn,{value:c.value,style:{color:c.required&&!c.value?"#ff4436":"#222222",fontWeight:c.required?"bold":"normal"},children:c.key}),editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsx(so,{children:e.jsx(K,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:k=>T(k.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:c=>c.value?c.secure?"******":e.jsx(Zn,{unstyled:!0,value:c.value,style:{wordBreak:"break-all"},children:c.value}):null,editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsxs(so,{children:[e.jsx(K,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:k=>T(k.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Br(j,n)]})}}];return e.jsxs(Ar,{children:[!!d.length&&e.jsx(dt,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(dt,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Mt,{permission:a?"":"mutate_blocklets",role:a?Oe:[],children:c=>e.jsx(Ms,{className:"config-table",children:e.jsx(Fs,{title:e.jsx("h4",{children:n("common.environment")}),columns:b(),icons:{...Ds,...Gs},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:R,editable:c?x:{}})})})]})}mt.propTypes={blocklet:r.object.isRequired,ancestors:r.array};mt.defaultProps={ancestors:[]};const Ar=F.div`
1
+ import{bJ as Ho,j as e,aK as _t,aL as Wt,bl as K,r as f,aP as fo,P as r,q as z,O as y,ax as ve,A as N,f as Ce,bo as Ye,b as J,M as O,J as dt,U as Ft,cb as Oe,n as F,K as X,hz as Ko,bG as Me,aY as ue,aX as gt,aC as Gt,a2 as $,D as xt,F as B,Y as Je,$ as Kn,b1 as Yo,fO as Jo,fP as Zo,C as ie,fc as Qo,y as ho,av as pt,a1 as we,x as zt,hA as Xo,hB as $o,B as oe,ai as go,H as Ht,hC as es,m as ee,a3 as ts,eA as ns,W as xo,Z as yo,ak as os,w as ss,Q as He,V as rs,hD as Co,S as ge,az as is,aA as as,aB as ls,i as yt,aN as cs,cw as ds,bg as ps,ha as us,hE as ms,ay as Yn,cu as fs,ac as Fe,aJ as jo,bI as Kt,cd as hs,hF as gs,b7 as xs,z as ys,aZ as Vt,T as Cs,aQ as Ke,at as At,bp as vo,aF as js,fL as Pe,dN as vs,hG as Ss,gl as Jn,hH as Zn,gn as Qn,a_ as Rs,G as at,gp as bs,bH as Es}from"./index-DhKEzK4G.js";import{d as Ts}from"./Add-CdB1GTw1.js";import{a as ws,R as ct,F as Ps,L as ks,d as Yt,b as Jt}from"./line-DmTazELP.js";import{C as Is,A as Us,d as Bs}from"./agreement-CaStPJUg.js";import{E as Ds}from"./index-PM4c29FK.js";import{b as As,a as Ns,c as Ls,u as Zt,e as Os}from"./actions-ByIKLhO5.js";import{S as Ms}from"./switch-control-CVljCfLQ.js";import{u as te}from"./blocklet-BkUmmvf6.js";import{d as So}from"./Edit-CeoVDX9P.js";import{T as Fs}from"./index-DWzRY4Xk.js";import{T as Gs,M as zs,t as Vs}from"./table-icons-DRSK9N17.js";import{C as Xn}from"./click-to-copy-D6fJs3Fy.js";import{T as Z}from"./TextField-UIj7bh4L.js";import{d as Qt}from"./Link-B5_3_F5M.js";import{c as qs,C as _s,a as Ws,b as Hs,D as Ks,A as Ys,B as Js,d as Zs,S as Qs}from"./item-BE4r4zK9.js";import{u as Xs,a as $s,P as Ro,L as $n,A as er,S as tr}from"./index-BaSZHjNU.js";import{u as bo,t as nr}from"./toUpper-Caw7x1nX.js";import{a as or,b as sr,c as rr,d as ir,e as ar,g as eo,f as lr,i as to}from"./spaces-B_PEyuiK.js";import{d as cr}from"./EditIcon-CIZQcG-N.js";import{d as dr}from"./Done-BiwCZjD9.js";import{C as pr}from"./Google-CB64yAYZ.js";import{I as ur,a as mr,f as fr,B as hr}from"./install-from-url-CWSHHc8X.js";import{a as no}from"./api-px2wpsj4.js";import{v as Eo,a as ut}from"./util-CR7yn4Rx.js";import{P as gr,u as xr}from"./use-blocklet-info-for-connect-did-spaces-B_L8zOwH.js";import{D as yr}from"./DeleteOutline-CaAz8YM2.js";import{S as oo}from"./index-BTF_a0ok.js";import{d as Cr}from"./ArrowDropDown-cQI9feYM.js";import{_ as jr}from"./useLocalStorage-Dkuy7Y9c.js";import{d as vr}from"./LockIcon-DLnWJnFU.js";import{d as Ct}from"./Delete-Di-3Vxhz.js";import{d as To}from"./Launch-DCauoB9i.js";import{C as Sr}from"./delete-confirm-SB_AYHUI.js";import{W as Ze}from"./tag-s8n8kLNC.js";import{d as Rr}from"./is-path-prefix-equal-BRfJaTzW.js";import{R as br,b as so,B as wo}from"./url-evaluation-85NTzVAr.js";import{B as Er}from"./bundle-avatar-FKqqno38.js";import{A as Po}from"./actions-DvMK194y.js";import{I as Nt}from"./index-B4uBhVoZ.js";import{a as Tr}from"./index-CpTpPC7E.js";import{u as wr}from"./team-DcawcK1N.js";import"./ButtonGroup-CEodIFRb.js";import"./getValidReactChildren-COQgThjG.js";import"./index-CvB9dSIF.js";import"./index-By1cj6yo.js";import"./url-join-BTiLIGs1.js";import"./MoreVert-CGx6Mqxv.js";import"./FilterList-CtKjjq1V.js";import"./useThemeProps-DY6u-Sl5.js";import"./Select-BAE2ztrO.js";import"./InputLabel-E2n2XENL.js";import"./LastPage-Dk3Ng8r_.js";import"./slicedToArray-CSiWJNnp.js";import"./Search-Drx5S2Fc.js";import"./ChevronLeft-Eu14H7S5.js";import"./ChevronRight-Ba-Rcz-i.js";import"./DeleteOutline-BQeXrAk8.js";import"./redux-BsHcI3_9.js";import"./Skeleton-Dg829dzN.js";import"./InputAdornment-DAdjrwZB.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-AmOaldrX.js";import"./index-ZG7jWpak.js";import"./preact.module-B1z5cdvs.js";import"./Close-Dq2gRzdt.js";import"./lottie-C-f15GXo.js";import"./schema-CHbqUY8n.js";import"./index-_7deM5fB.js";import"./isEqual-RXiETUsF.js";import"./index-W1Roe0KR.js";import"./Stepper-CyP9t2tf.js";import"./index-BaJfxzLi.js";import"./ExpandMore-Co2TCgMe.js";import"./shorten-label-Zm18p2j_.js";const Pr=Ho(e.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");var Xt={},kr=Wt;Object.defineProperty(Xt,"__esModule",{value:!0});var ko=Xt.default=void 0,Ir=kr(_t()),Ur=e;ko=Xt.default=(0,Ir.default)((0,Ur.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");function Br({deps:t}={deps:[]}){var i;const{blocklet:o}=te(),{api:s}=K(),[a,n]=f.useState(null);return fo(async()=>{var m;if((m=o==null?void 0:o.meta)!=null&&m.did){const{autoCheckUpdate:l}=await s.getAutoCheckUpdate({input:{did:o.meta.did}});n(l)}},[(i=o==null?void 0:o.meta)==null?void 0:i.did].concat(t)),a}const Io=f.createContext({}),{Provider:Dr,Consumer:al}=Io;function $t({children:t}){const{api:o}=K(),{blocklet:s}=te(),[a,n]=f.useState(!1),i=Br({deps:[a]}),m=()=>{n(u=>!u)},l=async u=>{await o.updateAutoCheckUpdate({input:{did:s.meta.did,autoCheckUpdate:u}}),m()};return e.jsx(Dr,{value:{updateAutoCheckUpdate:l,autoCheckUpdate:i},children:t})}$t.propTypes={children:r.any.isRequired};$t.defaultProps={};function Ar(){return f.useContext(Io)}function en({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Ar(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),N.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){N.error(l.message)}},m=!!(n!=null&&n.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(ve,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ms,{checked:m,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}en.propTypes={children:r.any};en.defaultProps={children:null};const Nr=(t,o)=>{let{description:s}=t;return(Object.values(J.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},Lt=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom,ro=t=>[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),Ot=t=>[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function mt({blocklet:t,ancestors:o}){const s=K(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>N.success(n("blocklet.config.changedTip")),l=c=>Lt(c,t,o);if(Ye(t.status)||t.status==="unknown"&&Ye(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(ro(c.key)===!1){N.error(n("blocklet.config.environment.invalidKey"));return}c.custom=Ot(c.key);try{const v=await s.api.configBlocklet({input:{did:i,configs:[c]}});m(v.blocklet)}catch(v){N.error(X(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(ro(c.key)===!1){N.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=Ko(c);if(T){N.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!Lt(c,t,o)){N.error("Only key of custom env can be changed");return}j.push({key:v.key,custom:Ot(c.key)})}try{const T=await s.api.configBlocklet({input:{did:i,configs:j}});m(T.blocklet)}catch(T){N.error(X(T))}},g=async c=>{if(c.required){N.error(n("blocklet.config.environment.deleteForbidden"));return}if(!Lt(c,t,o)){N.error("Only key of custom env can be changed");return}try{const v=await s.api.configBlocklet({input:{did:i,configs:[{key:c.key,custom:Ot(c.key)}]}});m(v.blocklet)}catch(v){N.error(X(v))}},p=(t.configs||[]).filter(c=>!J.BLOCKLET_CONFIGURABLE_KEY[c.key]||[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(c.key)),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),R=p.map(c=>({...c,value:Object.values(J.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=R.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},b=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Xn,{value:c.value,style:{color:c.required&&!c.value?"#ff4436":"#222222",fontWeight:c.required?"bold":"normal"},children:c.key}),editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsx(io,{children:e.jsx(Z,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:k=>T(k.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:c=>c.value?c.secure?"******":e.jsx(Xn,{unstyled:!0,value:c.value,style:{wordBreak:"break-all"},children:c.value}):null,editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsxs(io,{children:[e.jsx(Z,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:k=>T(k.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Nr(j,n)]})}}];return e.jsxs(Lr,{children:[!!d.length&&e.jsx(dt,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(dt,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Ft,{permission:a?"":"mutate_blocklets",role:a?Oe:[],children:c=>e.jsx(Gs,{className:"config-table",children:e.jsx(zs,{title:e.jsx("h4",{children:n("common.environment")}),columns:b(),icons:{...As,...Vs},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:R,editable:c?x:{}})})})]})}mt.propTypes={blocklet:r.object.isRequired,ancestors:r.array};mt.defaultProps={ancestors:[]};const Lr=F.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -50,9 +50,9 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
50
50
  }
51
51
  }
52
52
  }
53
- `,so=F.div`
53
+ `,io=F.div`
54
54
  height: 60px;
55
- `;function jt({blocklet:t,ancestors:o,hasPermission:s,...a}){const{t:n}=z(),{api:i}=Y(),m=!o.length,l=m?t.meta.did:o.map(C=>C.meta.did)[0],[u,h]=f.useState(""),[g,p]=f.useState(""),S=u||!s;if(!l||t.status==="unknown"&&Je(t.status))return null;const d=async C=>{h(!0);try{const x={rootDid:l,mountPoint:ue(C)};return m||(x.did=t.meta.did),await i.updateComponentMountPoint({input:x}),h(!1),!0}catch(x){throw h(!1),x.message=Z(x),N.error(x.message),x}},R=C=>{p(n("common.slugifyHint",{value:gt(C)}))};return e.jsx(Mr,{component:"div",...a,children:e.jsx(y,{mt:3,children:e.jsx(Es,{label:n("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:u||S,loading:u,required:!0,initialValue:t.mountPoint,onSubmit:d,onChange:R,helperText:g,formatterBeforeSubmit:C=>ue(C)})})})}const Nr=Me(jt,"mutate_blocklets"),Lr=Me(jt,"",Oe);function Or(t){const{inService:o}=Y();return o?e.jsx(Lr,{...t}):e.jsx(Nr,{...t})}jt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,hasPermission:r.bool};jt.defaultProps={ancestors:[],hasPermission:!1};const Mr=F.div``;function vt({open:t,onClose:o,hiddenChildren:s,blocklet:a,ancestors:n,children:i}){const[m,l]=f.useState(!1),{t:u}=z(),h=!!n.length,[g,p]=f.useState(Ft.hasMountPoint(a==null?void 0:a.meta)?"settings":"environments"),S=h?O.getDisplayName(a,!0):u("blocklet.component.container");if(Je(a.status)||a.status==="unknown"&&Je(a.status))return null;const d=()=>{o==null||o(),l(!1)},R=T=>{T.stopPropagation(),l(!0)},C={settings:Ft.hasMountPoint(a.meta)&&{label:u("blocklet.component.setting"),value:"settings",component:e.jsx(Or,{blocklet:a,ancestors:n})},environments:{label:u("common.environment"),value:"environments",component:e.jsx(mt,{blocklet:a,ancestors:n})}},x=Object.values(C).filter(Boolean),b=x.map(({label:T,value:k})=>({label:T,value:k})),c=T=>{p(T)},v=C[g]||x[0];let j=null;return s||(j=typeof i=="function"?i({open:R}):e.jsx($,{onClick:R,"data-cy":"action-config-component",children:e.jsx(jo,{})})),e.jsxs(e.Fragment,{children:[j,(t||m)&&e.jsx(Fr,{open:!0,fullWidth:!0,maxWidth:"md",title:S,onClose:d,PaperProps:{style:{minHeight:"auto"}},children:h?e.jsxs(y,{mt:1,children:[e.jsx(Os,{tabs:b,current:g,onChange:c,scrollButtons:"auto"}),v.component]}):e.jsx(mt,{blocklet:a,ancestors:n})})]})}vt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,children:r.any,open:r.bool,onClose:r.func,hiddenChildren:r.bool};vt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Fr=F(xt)`
55
+ `;function jt({blocklet:t,ancestors:o,hasPermission:s,...a}){const{t:n}=z(),{api:i}=K(),m=!o.length,l=m?t.meta.did:o.map(C=>C.meta.did)[0],[u,h]=f.useState(""),[g,p]=f.useState(""),S=u||!s;if(!l||t.status==="unknown"&&Ye(t.status))return null;const d=async C=>{h(!0);try{const x={rootDid:l,mountPoint:ue(C)};return m||(x.did=t.meta.did),await i.updateComponentMountPoint({input:x}),h(!1),!0}catch(x){throw h(!1),x.message=X(x),N.error(x.message),x}},R=C=>{p(n("common.slugifyHint",{value:gt(C)}))};return e.jsx(Gr,{component:"div",...a,children:e.jsx(y,{mt:3,children:e.jsx(ws,{label:n("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:u||S,loading:u,required:!0,initialValue:t.mountPoint,onSubmit:d,onChange:R,helperText:g,formatterBeforeSubmit:C=>ue(C)})})})}const Or=Me(jt,"mutate_blocklets"),Mr=Me(jt,"",Oe);function Fr(t){const{inService:o}=K();return o?e.jsx(Mr,{...t}):e.jsx(Or,{...t})}jt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,hasPermission:r.bool};jt.defaultProps={ancestors:[],hasPermission:!1};const Gr=F.div``;function vt({open:t,onClose:o,hiddenChildren:s,blocklet:a,ancestors:n,children:i}){const[m,l]=f.useState(!1),{t:u}=z(),h=!!n.length,[g,p]=f.useState(Gt.hasMountPoint(a==null?void 0:a.meta)?"settings":"environments"),S=h?O.getDisplayName(a,!0):u("blocklet.component.container");if(Ye(a.status)||a.status==="unknown"&&Ye(a.status))return null;const d=()=>{o==null||o(),l(!1)},R=T=>{T.stopPropagation(),l(!0)},C={settings:Gt.hasMountPoint(a.meta)&&{label:u("blocklet.component.setting"),value:"settings",component:e.jsx(Fr,{blocklet:a,ancestors:n})},environments:{label:u("common.environment"),value:"environments",component:e.jsx(mt,{blocklet:a,ancestors:n})}},x=Object.values(C).filter(Boolean),b=x.map(({label:T,value:k})=>({label:T,value:k})),c=T=>{p(T)},v=C[g]||x[0];let j=null;return s||(j=typeof i=="function"?i({open:R}):e.jsx($,{onClick:R,"data-cy":"action-config-component",children:e.jsx(So,{})})),e.jsxs(e.Fragment,{children:[j,(t||m)&&e.jsx(zr,{open:!0,fullWidth:!0,maxWidth:"md",title:S,onClose:d,PaperProps:{style:{minHeight:"auto"}},children:h?e.jsxs(y,{mt:1,children:[e.jsx(Fs,{tabs:b,current:g,onChange:c,scrollButtons:"auto"}),v.component]}):e.jsx(mt,{blocklet:a,ancestors:n})})]})}vt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,children:r.any,open:r.bool,onClose:r.func,hiddenChildren:r.bool};vt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const zr=F(xt)`
56
56
  .MuiDialogContent-root {
57
57
  padding-top: 0;
58
58
  margin-top: -32px;
@@ -63,7 +63,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
63
63
  .ux-dialog_right {
64
64
  padding-right: 20px;
65
65
  }
66
- `,{NODE_MODES:ro}=D,Gr=({mode:t,previousMode:o}={})=>t===ro.SERVERLESS||o===ro.SERVERLESS;var ko={isInServerlessMode:Gr};function zr(){const[t,o]=f.useState(null),{blocklet:s}=te();return f.useEffect(()=>{o(tr(s))},[s]),{storageEndpoint:t}}const Io=f.createContext({}),{Provider:qr,Consumer:il}=Io;function en({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=te(),{storageEndpoint:l}=zr(),{api:u}=Y();uo(async()=>{try{if(s(!0),Hn.isEmpty(l)){n(null);return}const d=await nr(l);n(d)}catch(d){console.error(d),N.error(d.message)}finally{s(!1)}},[l]);const h=()=>{n(null),m()},g=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};f.useEffect(()=>{async function d(){if(!a)return;const R=await or(a.endpoint,a.name),C=Hn.merge(a,{name:R});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(qr,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}en.propTypes={children:Ke.node.isRequired};en.defaultProps={};function tn(){return f.useContext(Io)}const nn={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function on({editing:t,value:o,onChange:s}){const[a,n]=f.useState(!1),i=f.useRef(),m=f.useRef(o);f.useEffect(()=>{let p=null;return t&&(p=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(p)}},[t]);const l=p=>{m.current=p,s(p)},u=()=>{n(!1),s(m.current)},h=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,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"}})}),e.jsx(Ho,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(cr,{color:o,onChange:p=>l(p.hex)})})]});return t?g:h}on.propTypes=nn;function sn({editing:t,description:o,value:s,onChange:a,componentProps:n,...i}){const{placeholder:m}=n,l=f.useRef(s),u=g=>{g.key==="Enter"&&a(l.current,"confirm")},h=g=>{l.current=g,a(g)};return t?e.jsx(K,{style:{flex:1},fullWidth:!0,value:s,onChange:g=>{g.persist(),h(g.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...i}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}sn.propTypes=nn;sn.defaultProps={componentProps:{}};function rn({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Yo.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Jo({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(on,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}rn.propTypes={...nn,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};rn.defaultProps={};const Vr={input:sn,color:on,passport:rn,uploader:t=>e.jsx(ws,{...t.componentProps})};function _r(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Vr[s==null?void 0:s.toLowerCase()]}function an({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:i,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,h]=f.useState(null),[g,p]=f.useState(l?s:a),S=f.useRef();function d(x,b,c){const{key:v,secure:j}=x,k=g[v]!==b,U={...g,[v]:b};k&&p(U),n({[v]:b},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?R(null):R(x)}function R(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:b=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?b?"":"******":v}return e.jsx(Wr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:b,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:k={}}=x;if(T)return null;const U=!!(u&&b===u.key),L=C(x,{editing:U}),I=_r(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:b,description:c,editing:U,value:L,onChange:(B,q="change")=>d(x,B,q),componentProps:k};return e.jsxs(y,{className:"form-item",children:[!j&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!L?"#ff0000":"#333"},children:[c,v&&e.jsx(ct,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input",sx:{textAlign:j?"center":"left"},children:e.jsx(I,{...M})}),!j&&e.jsx(y,{className:"form-item-action",children:U?e.jsxs(e.Fragment,{children:[e.jsx($,{"data-cy":"schema-form-item-confirm",onClick:()=>{d(x,L,"confirm")},disabled:m||o,size:"large",children:o?e.jsx(ie,{size:24}):e.jsx(lr,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Ko,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[b],"edit")},disabled:m||u,size:"large",children:e.jsx(ar,{})})})]})]},b)})})}an.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};an.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Wr=F(Ts)``;function ln({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=Y(),l=mo(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(R,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},b=v=>{N.error(v),o(v)};function c(v){return Zo(()=>to.get(v).then(async({data:j})=>{const T=j==null?void 0:j.downloadTokenList;if(j.status==="succeed"){if(T&&T.length)await x({downloadTokenList:T});else return await b(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await b(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Qo(u);await c(v)}else await x({downloadTokenList:R.downloadTokenList&&C(R.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const R=new URL(g);R.pathname="/api/did/verify-purchase-blocklet/token",R.searchParams.set("serverDid",m.did),R.searchParams.set("blockletDid",t==null?void 0:t.did);try{to.get(R.href).then(({data:C})=>{const x=`${C.url}`;h(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{h(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:pt.create({baseURL:g}).get,extraParams:{serverDid:m.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:p}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:pt.create({baseURL:we(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:p}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Gt,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}ln.propTypes={...zs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};ln.defaultProps={handlePaySuccess:()=>{}};const cn=f.forwardRef(({mode:t,...o},s)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[i,m]=f.useState(t!=="both"?2:1),l=h=>{h!==a&&n(h)},u=()=>{a&&i!==2&&m(2)};return f.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(qs,{action:a,onNext:null,onSelect:l})}):e.jsx(ln,{...o,mode:a})});cn.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};cn.defaultProps={ref:{}};const Hr=cn;function Yr({...t}){return e.jsx(oe,{className:"bottom-button",variant:"contained",color:"primary",...t})}function dn({key:t}={key:"sm"}){const o=fo();return Wt(o.breakpoints.down(t))}function pn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=dn();return!t||Xo(t.meta)?e.jsx(Jr,{children:s}):e.jsxs(Kr,{isMobile:i,children:[e.jsx(Yr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}pn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};pn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Jr=F(y)`
66
+ `,{NODE_MODES:ao}=B,Vr=({mode:t,previousMode:o}={})=>t===ao.SERVERLESS||o===ao.SERVERLESS;var Uo={isInServerlessMode:Vr};function qr(){const[t,o]=f.useState(null),{blocklet:s}=te();return f.useEffect(()=>{o(or(s))},[s]),{storageEndpoint:t}}const Bo=f.createContext({}),{Provider:_r,Consumer:ll}=Bo;function tn({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=te(),{storageEndpoint:l}=qr(),{api:u}=K();fo(async()=>{try{if(s(!0),Kn.isEmpty(l)){n(null);return}const d=await sr(l);n(d)}catch(d){console.error(d),N.error(d.message)}finally{s(!1)}},[l]);const h=()=>{n(null),m()},g=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};f.useEffect(()=>{async function d(){if(!a)return;const R=await rr(a.endpoint,a.name),C=Kn.merge(a,{name:R});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(_r,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}tn.propTypes={children:Je.node.isRequired};tn.defaultProps={};function nn(){return f.useContext(Bo)}const on={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function sn({editing:t,value:o,onChange:s}){const[a,n]=f.useState(!1),i=f.useRef(),m=f.useRef(o);f.useEffect(()=>{let p=null;return t&&(p=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(p)}},[t]);const l=p=>{m.current=p,s(p)},u=()=>{n(!1),s(m.current)},h=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,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"}})}),e.jsx(Yo,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(pr,{color:o,onChange:p=>l(p.hex)})})]});return t?g:h}sn.propTypes=on;function rn({editing:t,description:o,value:s,onChange:a,componentProps:n,...i}){const{placeholder:m}=n,l=f.useRef(s),u=g=>{g.key==="Enter"&&a(l.current,"confirm")},h=g=>{l.current=g,a(g)};return t?e.jsx(Z,{style:{flex:1},fullWidth:!0,value:s,onChange:g=>{g.persist(),h(g.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...i}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}rn.propTypes=on;rn.defaultProps={componentProps:{}};function an({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Jo.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Zo({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(sn,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}an.propTypes={...on,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};an.defaultProps={};const Wr={input:rn,color:sn,passport:an,uploader:t=>e.jsx(ks,{...t.componentProps})};function Hr(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Wr[s==null?void 0:s.toLowerCase()]}function ln({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:i,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,h]=f.useState(null),[g,p]=f.useState(l?s:a),S=f.useRef();function d(x,b,c){const{key:v,secure:j}=x,k=g[v]!==b,U={...g,[v]:b};k&&p(U),n({[v]:b},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?R(null):R(x)}function R(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:b=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?b?"":"******":v}return e.jsx(Kr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:b,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:k={}}=x;if(T)return null;const U=!!(u&&b===u.key),L=C(x,{editing:U}),I=Hr(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:b,description:c,editing:U,value:L,onChange:(D,V="change")=>d(x,D,V),componentProps:k};return e.jsxs(y,{className:"form-item",children:[!j&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!L?"#ff0000":"#333"},children:[c,v&&e.jsx(ct,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input",sx:{textAlign:j?"center":"left"},children:e.jsx(I,{...M})}),!j&&e.jsx(y,{className:"form-item-action",children:U?e.jsxs(e.Fragment,{children:[e.jsx($,{"data-cy":"schema-form-item-confirm",onClick:()=>{d(x,L,"confirm")},disabled:m||o,size:"large",children:o?e.jsx(ie,{size:24}):e.jsx(dr,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Qo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[b],"edit")},disabled:m||u,size:"large",children:e.jsx(cr,{})})})]})]},b)})})}ln.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};ln.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Kr=F(Ps)``;function cn({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=K(),l=ho(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(R,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},b=v=>{N.error(v),o(v)};function c(v){return $o(()=>no.get(v).then(async({data:j})=>{const T=j==null?void 0:j.downloadTokenList;if(j.status==="succeed"){if(T&&T.length)await x({downloadTokenList:T});else return await b(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await b(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Xo(u);await c(v)}else await x({downloadTokenList:R.downloadTokenList&&C(R.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const R=new URL(g);R.pathname="/api/did/verify-purchase-blocklet/token",R.searchParams.set("serverDid",m.did),R.searchParams.set("blockletDid",t==null?void 0:t.did);try{no.get(R.href).then(({data:C})=>{const x=`${C.url}`;h(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{h(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:pt.create({baseURL:g}).get,extraParams:{serverDid:m.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:p}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:pt.create({baseURL:we(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:p}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(zt,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}cn.propTypes={...qs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};cn.defaultProps={handlePaySuccess:()=>{}};const dn=f.forwardRef(({mode:t,...o},s)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[i,m]=f.useState(t!=="both"?2:1),l=h=>{h!==a&&n(h)},u=()=>{a&&i!==2&&m(2)};return f.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(_s,{action:a,onNext:null,onSelect:l})}):e.jsx(cn,{...o,mode:a})});dn.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};dn.defaultProps={ref:{}};const Yr=dn;function Jr({...t}){return e.jsx(oe,{className:"bottom-button",variant:"contained",color:"primary",...t})}function pn({key:t}={key:"sm"}){const o=go();return Ht(o.breakpoints.down(t))}function un({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=pn();return!t||es(t.meta)?e.jsx(Zr,{children:s}):e.jsxs(Qr,{isMobile:i,children:[e.jsx(Jr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}un.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};un.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Zr=F(y)`
67
67
  width: 100%;
68
68
  margin-top: auto;
69
69
  padding-top: 24px;
@@ -78,7 +78,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
78
78
  width: 100%;
79
79
  }
80
80
  }
81
- `,Kr=F(y)`
81
+ `,Qr=F(y)`
82
82
  padding-top: 24px;
83
83
  margin-top: auto;
84
84
  width: 100%;
@@ -108,7 +108,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
108
108
  justify-content: space-between;
109
109
  gap: '32px',
110
110
  }}
111
- `;var Uo=function(o){return e.jsxs("svg",{...o,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte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8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};Uo.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Do(){const{t}=z();return e.jsx(y,{children:e.jsxs(y,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(Uo,{style:{width:200,height:250}}),e.jsx(ee,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.providerForStorage")})]})})}Do.propTypes={};function un({spaceGateway:t,onDeleteSpace:o}){const{t:s}=z(),[a,n]=f.useState(!1),[i,m]=f.useState(!1),l=(h,g)=>{h==null||h.stopPropagation(),n(g)},u=async h=>{try{h==null||h.stopPropagation(),m(!0),await o(t),n(!1)}catch(g){console.error(g),N.error(`${s("storage.spaces.gateway.delete.failed")}: ${Z(g)}`)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx($,{size:"small",onClick:h=>l(h,!0),children:e.jsx(gr,{})}),e.jsx($o,{title:s("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`}),open:a,confirmButton:{text:s("common.confirm"),props:{variant:"contained",color:"error",loading:i}},cancelButton:{text:s("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:u,onCancel:h=>l(h,!1)})]})}un.propTypes={onDeleteSpace:r.func,spaceGateway:r.shape({name:r.string.isRequired,url:r.string.isRequired,protected:r.bool}).isRequired};un.defaultProps={onDeleteSpace:()=>{}};var Bo=function(o){return e.jsx("svg",{...o,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Bo.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mn({spaceGateway:t,connected:o,onDisconnect:s,...a}){const n=dn(),{t:i}=z(),m=async()=>{try{await s(),N.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name}))}catch(l){console.error(l),N.error(Z(l))}};return e.jsxs(Qr,{style:{position:"relative"},children:[e.jsxs(y,{sx:{backgroundColor:o?"#F0FDFF":"inherit","&:hover":{backgroundColor:o?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...a,children:[e.jsx(y,{display:"flex",children:e.jsx(fr,{alt:t.did,src:sr(t.endpoint)})}),e.jsxs(y,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[e.jsxs(y,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[e.jsx(ee,{color:o?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:t.name}),e.jsx(es,{label:e.jsxs(e.Fragment,{children:[e.jsx(Bo,{style:{marginRight:"4px"}}),i("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:n?null:"20px",fontWeight:"bold"}})]}),e.jsx(y,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:e.jsx(ee,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:t.did&&e.jsx(ho,{copyable:!1,size:14,compact:!0,responsive:!1,did:t.did})})})]}),e.jsx(y,{className:"spaces-backup",display:"flex",alignItems:"center",children:e.jsx(y,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:e.jsx(un,{spaceGateway:t,onDeleteSpace:m})})})]}),e.jsx(y,{className:"selected-container selected",children:e.jsx(go,{className:"selected-icon"})})]})}mn.propTypes={spaceGateway:r.shape({did:r.string.isRequired,name:r.string.isRequired,url:r.string.isRequired,endpoint:r.string.isRequired,protected:r.bool}).isRequired,connected:Ke.bool,onDisconnect:Ke.func};mn.defaultProps={connected:!1,onDisconnect:()=>{}};const Qr=F(y)`
111
+ `;var Do=function(o){return e.jsxs("svg",{...o,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElE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JdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};Do.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Ao(){const{t}=z();return e.jsx(y,{children:e.jsxs(y,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(Do,{style:{width:200,height:250}}),e.jsx(ee,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.providerForStorage")})]})})}Ao.propTypes={};function mn({spaceGateway:t,onDeleteSpace:o}){const{t:s}=z(),[a,n]=f.useState(!1),[i,m]=f.useState(!1),l=(h,g)=>{h==null||h.stopPropagation(),n(g)},u=async h=>{try{h==null||h.stopPropagation(),m(!0),await o(t),n(!1)}catch(g){console.error(g),N.error(`${s("storage.spaces.gateway.delete.failed")}: ${X(g)}`)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx($,{size:"small",onClick:h=>l(h,!0),children:e.jsx(yr,{})}),e.jsx(ts,{title:s("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`}),open:a,confirmButton:{text:s("common.confirm"),props:{variant:"contained",color:"error",loading:i}},cancelButton:{text:s("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:u,onCancel:h=>l(h,!1)})]})}mn.propTypes={onDeleteSpace:r.func,spaceGateway:r.shape({name:r.string.isRequired,url:r.string.isRequired,protected:r.bool}).isRequired};mn.defaultProps={onDeleteSpace:()=>{}};var No=function(o){return e.jsx("svg",{...o,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};No.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fn({spaceGateway:t,connected:o,onDisconnect:s,...a}){const n=pn(),{t:i}=z(),m=async()=>{try{await s(),N.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name}))}catch(l){console.error(l),N.error(X(l))}};return e.jsxs(Xr,{style:{position:"relative"},children:[e.jsxs(y,{sx:{backgroundColor:o?"#F0FDFF":"inherit","&:hover":{backgroundColor:o?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...a,children:[e.jsx(y,{display:"flex",children:e.jsx(gr,{alt:t.did,src:ir(t.endpoint)})}),e.jsxs(y,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px",minWidth:0},children:[e.jsxs(y,{className:"spaces-info",display:"flex",children:[e.jsx(ee,{sx:{color:o?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),e.jsx(ns,{label:e.jsxs(e.Fragment,{children:[e.jsx(No,{style:{marginRight:"4px"}}),i("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:n?null:"20px",fontWeight:"bold"}})]}),e.jsx(y,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:e.jsx(ee,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:t.did&&e.jsx(xo,{copyable:!1,size:14,compact:!0,responsive:!1,did:t.did})})})]}),e.jsx(y,{className:"spaces-backup",display:"flex",alignItems:"center",children:e.jsx(y,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:e.jsx(mn,{spaceGateway:t,onDeleteSpace:m})})})]}),e.jsx(y,{className:"selected-container selected",children:e.jsx(yo,{className:"selected-icon"})})]})}fn.propTypes={spaceGateway:r.shape({did:r.string.isRequired,name:r.string.isRequired,url:r.string.isRequired,endpoint:r.string.isRequired,protected:r.bool}).isRequired,connected:Je.bool,onDisconnect:Je.func};fn.defaultProps={connected:!1,onDisconnect:()=>{}};const Xr=F(y)`
112
112
  .selected-container {
113
113
  position: absolute;
114
114
  right: 0px;
@@ -161,12 +161,12 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
161
161
  visibility: visible;
162
162
  }
163
163
  }
164
- `;function Zr(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=tn();return e.jsxs(y,{display:"flex",flexDirection:"column",children:[e.jsx(y,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:e.jsx(ee,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.connected.title")})}),e.jsx(y,{children:e.jsx(mn,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function fn({onConnect:t,...o}){const{blocklet:s}=te(),{info:a}=Y(),{t:n,locale:i}=z(),[m,l]=f.useState(""),[u,h]=f.useState(!1),[g,p]=f.useState(!1),[S,d]=f.useState(""),R=hr({blocklet:s}),C=mo(a),{storageEndpoint:x}=tn(),[b,c]=f.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:pt.create({baseURL:we(window.location.origin,ts())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:R.appName},i),scan:n("storage.spaces.provideNFT.scan",{appName:R.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(I=>({...I,open:!1}))}}),[v,j]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:R.appName},i),scan:n("storage.spaces.authorize.scan",{appName:R.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{j(I=>({...I,open:!1}))}}),T=async({did:I,name:M,endpoint:B})=>{const q=await $n(B);if(!await eo(q)){N.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Q={name:M,did:I,url:q,endpoint:B};await t(Q),N.success(n("storage.spaces.connectedWithName",{name:Q.name}))},k=(I,M)=>{setTimeout(async()=>{if(j(Q=>({...Q,open:!1})),l(null),c(Q=>({...Q,open:!1})),!He(I.spaceGateway)){await T(M(I.spaceGateway));return}const B=M(I.endpoint),q=I.space?M(I.space):{};await T({endpoint:B,did:rr(B),name:"DID Space",...q})},0)},U=()=>{c(I=>({...I,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{h(!0);const I=await $n(m),M=ir(I),B=new URL(I).searchParams.get("spaceDid");if(!await eo(M))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));j(q=>({...q,open:!0,prefix:we(M,"space/api/did"),baseUrl:new URL(M).origin,checkFn:pt.create({baseURL:we(M,"space")}).get,extraParams:{appDid:R.appDid,appName:R.appName,appDescription:R.appDescription,scopes:R.scopes,appUrl:R.appUrl,referrer:R.referrer,nodeDid:a.did,spaceDid:B}})),p(!1)}catch(I){const M=`${n("storage.spaces.gateway.add.failed",i)}: ${Z(I)}`;d(M)}finally{h(!1)}};return e.jsxs(y,{children:[e.jsx(no,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:U,variant:"outlined",menu:[e.jsx(no.Item,{sx:{textTransform:"none"},onClick:()=>p(!0),size:"small",...o,children:n(x?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(ee,{sx:{fontWeight:"bold",textTransform:"none"},children:n(x?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),e.jsx(Gt,{forceConnected:!1,saveConnect:!1,prefix:b.prefix,open:b.open,popup:!0,action:b.action,webWalletUrl:C,baseUrl:b.baseUrl,checkFn:b.checkFn,onSuccess:k,onClose:b.onClose,checkTimeout:b.checkTimeout,extraParams:b.extraParams,messages:b.messages,locale:i}),e.jsx(Gt,{forceConnected:!1,saveConnect:!1,prefix:v.prefix,open:v.open,popup:!0,action:v.action,baseUrl:v.baseUrl,checkFn:v.checkFn,onSuccess:k,onClose:v.onClose,checkTimeout:v.checkTimeout,extraParams:v.extraParams,messages:v.messages,locale:i}),e.jsxs(xt,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:g,onClose:()=>p(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(oe,{onClick:I=>{I.stopPropagation(),p(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(oe,{onClick:L,color:"primary",disabled:u||!m,variant:"contained",autoFocus:!0,children:[u&&e.jsx(ie,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(ns,{component:"div",children:e.jsx(ee,{component:"div",children:e.jsx(K,{label:n("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:m,onChange:I=>{d(null),l(I.target.value)},disabled:u,onKeyPress:async I=>{I.key==="Enter"&&await L()},autoFocus:!0})})})}),!!S&&e.jsx(dt,{severity:"error",style:{width:"100%"},children:S})]})]})}fn.propTypes={onConnect:Ke.func};fn.defaultProps={onConnect:()=>{}};function hn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=dn(),{blocklet:a}=te(),{updateSpaceGateway:n,loading:i,hasStorageEndpoint:m}=tn();return f.useEffect(()=>{o==null||o()},[a]),i?e.jsx(os,{relative:"parent",children:e.jsx(ie,{})}):e.jsxs(Xr,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx(Zr,{}):e.jsx(Do,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(pn,{mt:8,children:e.jsx(fn,{onConnect:n})})]})}hn.propTypes={blockletMeta:r.any.isRequired,onEndpointUpdate:Ke.func};hn.defaultProps={onEndpointUpdate:()=>{}};const Xr=F(Ps)`
164
+ `;function $r(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=nn();return e.jsxs(y,{display:"flex",flexDirection:"column",children:[e.jsx(y,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:e.jsx(ee,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.connected.title")})}),e.jsx(y,{children:e.jsx(fn,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function hn({onConnect:t,...o}){const{blocklet:s}=te(),{info:a}=K(),{t:n,locale:i}=z(),[m,l]=f.useState(""),[u,h]=f.useState(!1),[g,p]=f.useState(!1),[S,d]=f.useState(""),R=xr({blocklet:s}),C=ho(a),{storageEndpoint:x}=nn(),[b,c]=f.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:pt.create({baseURL:we(window.location.origin,os())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:R.appName},i),scan:n("storage.spaces.provideNFT.scan",{appName:R.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(I=>({...I,open:!1}))}}),[v,j]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:R.appName},i),scan:n("storage.spaces.authorize.scan",{appName:R.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{j(I=>({...I,open:!1}))}}),T=async({did:I,name:M,endpoint:D})=>{const V=await eo(D);if(!await to(V)){N.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Q={name:M,did:I,url:V,endpoint:D};await t(Q),N.success(n("storage.spaces.connectedWithName",{name:Q.name}))},k=(I,M)=>{setTimeout(async()=>{if(j(Q=>({...Q,open:!1})),l(null),c(Q=>({...Q,open:!1})),!He(I.spaceGateway)){await T(M(I.spaceGateway));return}const D=M(I.endpoint),V=I.space?M(I.space):{};await T({endpoint:D,did:ar(D),name:"DID Space",...V})},0)},U=()=>{c(I=>({...I,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{h(!0);const I=await eo(m),M=lr(I),D=new URL(I).searchParams.get("spaceDid");if(!await to(M))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));j(V=>({...V,open:!0,prefix:we(M,"space/api/did"),baseUrl:new URL(M).origin,checkFn:pt.create({baseURL:we(M,"space")}).get,extraParams:{appDid:R.appDid,appName:R.appName,appDescription:R.appDescription,scopes:R.scopes,appUrl:R.appUrl,referrer:R.referrer,nodeDid:a.did,spaceDid:D}})),p(!1)}catch(I){const M=`${n("storage.spaces.gateway.add.failed",i)}: ${X(I)}`;d(M)}finally{h(!1)}};return e.jsxs(y,{children:[e.jsx(oo,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:U,variant:"outlined",menu:[e.jsx(oo.Item,{sx:{textTransform:"none"},onClick:()=>p(!0),size:"small",...o,children:n(x?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(ee,{sx:{fontWeight:"bold",textTransform:"none"},children:n(x?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),e.jsx(zt,{forceConnected:!1,saveConnect:!1,prefix:b.prefix,open:b.open,popup:!0,action:b.action,webWalletUrl:C,baseUrl:b.baseUrl,checkFn:b.checkFn,onSuccess:k,onClose:b.onClose,checkTimeout:b.checkTimeout,extraParams:b.extraParams,messages:b.messages,locale:i}),e.jsx(zt,{forceConnected:!1,saveConnect:!1,prefix:v.prefix,open:v.open,popup:!0,action:v.action,baseUrl:v.baseUrl,checkFn:v.checkFn,onSuccess:k,onClose:v.onClose,checkTimeout:v.checkTimeout,extraParams:v.extraParams,messages:v.messages,locale:i}),e.jsxs(xt,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:g,onClose:()=>p(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(oe,{onClick:I=>{I.stopPropagation(),p(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(oe,{onClick:L,color:"primary",disabled:u||!m,variant:"contained",autoFocus:!0,children:[u&&e.jsx(ie,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(ss,{component:"div",children:e.jsx(ee,{component:"div",children:e.jsx(Z,{label:n("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:m,onChange:I=>{d(null),l(I.target.value)},disabled:u,onKeyPress:async I=>{I.key==="Enter"&&await L()},autoFocus:!0})})})}),!!S&&e.jsx(dt,{severity:"error",style:{width:"100%"},children:S})]})]})}hn.propTypes={onConnect:Je.func};hn.defaultProps={onConnect:()=>{}};function gn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=pn(),{blocklet:a}=te(),{updateSpaceGateway:n,loading:i,hasStorageEndpoint:m}=nn();return f.useEffect(()=>{o==null||o()},[a]),i?e.jsx(rs,{relative:"parent",children:e.jsx(ie,{})}):e.jsxs(ei,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx($r,{}):e.jsx(Ao,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(un,{mt:8,children:e.jsx(hn,{onConnect:n})})]})}gn.propTypes={blockletMeta:r.any.isRequired,onEndpointUpdate:Je.func};gn.defaultProps={onEndpointUpdate:()=>{}};const ei=F(Is)`
165
165
  height: 100%;
166
166
  overflow-y: auto;
167
167
  padding-bottom: 32px;
168
168
  overflow-x: hidden;
169
- `;function gn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:i}){const{t:m}=z(),{info:l,inService:u}=Y(),{blocklet:h}=te(),[g,p]=f.useState(!1),S=f.useRef(null),[d,R]=f.useState(),[C,x]=yr(i||"tmp"),[b,c]=i?[C,x]:[d,R],{storeList:v,teamDid:j}=xo({fromBlocklet:u,blocklet:h,nodeInfo:l}),T=So([...n.map(U=>({...U,protected:!0})),...v],"url"),k=b&&T.find(U=>b===U.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs($r,{children:[e.jsx(oe,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(xr,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:e.jsx(ee,{color:"primary",children:k.name})}),e.jsx(ee,{color:"primary",children:a})]}),e.jsxs(K,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:m("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:k,autoFocus:!0,onChange:U=>{const L=U.target.value;c(L.url),t(L)},SelectProps:{open:g,MenuProps:{anchorEl:S.current},renderValue:U=>U==null?void 0:U.name,onClose:()=>{p(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(U=>e.jsx(ge,{sx:{width:"400px",maxWidth:"90vw"},value:U,"data-cy":U.url,children:e.jsx(Vs,{teamDid:j,store:U,onDelete:()=>{var L;b===U.url&&c((L=T[0])==null?void 0:L.url)}})},U.url)),!ko.isInServerlessMode(l)&&e.jsx(_s,{disabled:o,storeList:T,teamDid:j,onAdd:U=>{c(U)}})]}),s({currentRegistry:k})]})}gn.propTypes={onChange:r.func,loading:r.bool,children:r.any.isRequired,extra:r.node,storageKey:r.string,stores:r.arrayOf(r.shape({name:r.string.isRequired,url:r.string.isRequired}))};gn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const $r=F.div`
169
+ `;function xn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:i}){const{t:m}=z(),{info:l,inService:u}=K(),{blocklet:h}=te(),[g,p]=f.useState(!1),S=f.useRef(null),[d,R]=f.useState(),[C,x]=jr(i||"tmp"),[b,c]=i?[C,x]:[d,R],{storeList:v,teamDid:j}=Co({fromBlocklet:u,blocklet:h,nodeInfo:l}),T=bo([...n.map(U=>({...U,protected:!0})),...v],"url"),k=b&&T.find(U=>b===U.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs(ti,{children:[e.jsx(oe,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(Cr,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:e.jsx(ee,{color:"primary",children:k.name})}),e.jsx(ee,{color:"primary",children:a})]}),e.jsxs(Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:m("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:k,autoFocus:!0,onChange:U=>{const L=U.target.value;c(L.url),t(L)},SelectProps:{open:g,MenuProps:{anchorEl:S.current},renderValue:U=>U==null?void 0:U.name,onClose:()=>{p(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(U=>e.jsx(ge,{sx:{width:"400px",maxWidth:"90vw"},value:U,"data-cy":U.url,children:e.jsx(Ws,{teamDid:j,store:U,onDelete:()=>{var L;b===U.url&&c((L=T[0])==null?void 0:L.url)}})},U.url)),!Uo.isInServerlessMode(l)&&e.jsx(Hs,{disabled:o,storeList:T,teamDid:j,onAdd:U=>{c(U)}})]}),s({currentRegistry:k})]})}xn.propTypes={onChange:r.func,loading:r.bool,children:r.any.isRequired,extra:r.node,storageKey:r.string,stores:r.arrayOf(r.shape({name:r.string.isRequired,url:r.string.isRequired}))};xn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const ti=F.div`
170
170
  display: flex;
171
171
  justify-content: space-between;
172
172
  align-items: center;
@@ -177,13 +177,13 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
177
177
  color: ${t=>t.theme.palette.common.black};
178
178
  // font-weight: bold;
179
179
  }
180
- `;var xn={},ei=_t;Object.defineProperty(xn,"__esModule",{value:!0});var Ao=xn.default=void 0,ti=ei(Vt()),ni=e;Ao=xn.default=(0,ti.default)((0,ni.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const oi=(t,o)=>we(o,`/blocklets/${t.did}`),io=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,si=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function yn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let i=we(a,is(t.did,t.logo||""));try{const C=new URL(i);C.searchParams.set("v",t.version||+new Date),i=C.href}catch{}const[m,l]=f.useState(!1),u=C=>C.currentTarget.contains(C.target)?!0:(C.preventDefault(),!1),h=async C=>{C.preventDefault(),C.stopPropagation();try{l(!0),await s({meta:t,registryUrl:a,blocklets:o})}catch(x){N.error(x.message)}finally{l(!1)}},{blocklet:g}=te(),p=()=>((g==null?void 0:g.children)||[]).find(b=>b.meta.bundleDid===t.did).meta.version,d=(()=>{const C=((g==null?void 0:g.children)||[]).find(x=>x.meta.bundleDid===t.did);if(C){try{const x=C.meta.version,b=t.version;if(as.gt(b,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let R=n("blocklet.component.choose");return d==="upgrade"?R=n("blocklet.component.upgrade"):d==="disable"?R=n("blocklet.component.installed"):si(t)&&(R=n("common.purchase")),e.jsx(yt,{href:oi(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(ri,{title:io({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:io({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?i:"",version:t.version,button:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Hs,{children:e.jsxs(oe,{onClick:h,size:"small",disabled:m||d==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:d==="upgrade"?`${p()} -> ${t.version}`:"",children:[m?e.jsxs(e.Fragment,{children:[e.jsx(ie,{size:16,style:{marginRight:3}}),R]}):R,d==="upgrade"?e.jsx(Ao,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}yn.propTypes={blocklet:r.object.isRequired,blocklets:r.array,handleButtonClick:r.func,endpoint:r.string};yn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function Cn({handleButtonClick:t,handleSearchSelect:o,storeUrl:s,handleBlockletRender:a,extraFilter:n,serverVersion:i,resourceType:m,resourceDid:l,showResourcesSwitch:u,showCategory:h,...g}){const{locale:p}=z(),[S,d]=f.useState(!1),[R,C]=f.useState({}),x=c=>{C(c)},b=s;return f.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[b,m,l]),f.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(ss,{FallbackComponent:rs,resetKeys:[b],children:e.jsx("div",{...g,children:S&&e.jsx(Ws,{showCategory:h,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:b};return a({...c,defaultRender:e.jsx(yn,{...v})})},baseSearch:!0,endpoint:b,locale:p,onFilterChange:x,onSearchSelect:o,filters:R,extraFilter:n,serverVersion:i,fetchCategoryDelay:500})})})}Cn.propTypes={storeUrl:r.string.isRequired,handleButtonClick:r.func,handleSearchSelect:r.func,handleBlockletRender:r.func,extraFilter:r.func,serverVersion:r.string,resourceType:r.string,resourceDid:r.string,showResourcesSwitch:r.bool,showCategory:r.bool};Cn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const ri=F(Ys)`
180
+ `;var yn={},ni=Wt;Object.defineProperty(yn,"__esModule",{value:!0});var Lo=yn.default=void 0,oi=ni(_t()),si=e;Lo=yn.default=(0,oi.default)((0,si.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const ri=(t,o)=>we(o,`/blocklets/${t.did}`),lo=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,ii=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function Cn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let i=we(a,ls(t.did,t.logo||""));try{const C=new URL(i);C.searchParams.set("v",t.version||+new Date),i=C.href}catch{}const[m,l]=f.useState(!1),u=C=>C.currentTarget.contains(C.target)?!0:(C.preventDefault(),!1),h=async C=>{C.preventDefault(),C.stopPropagation();try{l(!0),await s({meta:t,registryUrl:a,blocklets:o})}catch(x){N.error(x.message)}finally{l(!1)}},{blocklet:g}=te(),p=()=>((g==null?void 0:g.children)||[]).find(b=>b.meta.bundleDid===t.did).meta.version,d=(()=>{const C=((g==null?void 0:g.children)||[]).find(x=>x.meta.bundleDid===t.did);if(C){try{const x=C.meta.version,b=t.version;if(cs.gt(b,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let R=n("blocklet.component.choose");return d==="upgrade"?R=n("blocklet.component.upgrade"):d==="disable"?R=n("blocklet.component.installed"):ii(t)&&(R=n("common.purchase")),e.jsx(yt,{href:ri(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(ai,{title:lo({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:lo({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?i:"",version:t.version,button:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Ys,{children:e.jsxs(oe,{onClick:h,size:"small",disabled:m||d==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:d==="upgrade"?`${p()} -> ${t.version}`:"",children:[m?e.jsxs(e.Fragment,{children:[e.jsx(ie,{size:16,style:{marginRight:3}}),R]}):R,d==="upgrade"?e.jsx(Lo,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}Cn.propTypes={blocklet:r.object.isRequired,blocklets:r.array,handleButtonClick:r.func,endpoint:r.string};Cn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function jn({handleButtonClick:t,handleSearchSelect:o,storeUrl:s,handleBlockletRender:a,extraFilter:n,serverVersion:i,resourceType:m,resourceDid:l,showResourcesSwitch:u,showCategory:h,...g}){const{locale:p}=z(),[S,d]=f.useState(!1),[R,C]=f.useState({}),x=c=>{C(c)},b=s;return f.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[b,m,l]),f.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(is,{FallbackComponent:as,resetKeys:[b],children:e.jsx("div",{...g,children:S&&e.jsx(Ks,{showCategory:h,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:b};return a({...c,defaultRender:e.jsx(Cn,{...v})})},baseSearch:!0,endpoint:b,locale:p,onFilterChange:x,onSearchSelect:o,filters:R,extraFilter:n,serverVersion:i,fetchCategoryDelay:500})})})}jn.propTypes={storeUrl:r.string.isRequired,handleButtonClick:r.func,handleSearchSelect:r.func,handleBlockletRender:r.func,extraFilter:r.func,serverVersion:r.string,resourceType:r.string,resourceDid:r.string,showResourcesSwitch:r.bool,showCategory:r.bool};jn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const ai=F(Js)`
181
181
  .ms-highlight {
182
182
  color: ${t=>t.theme.palette.primary.main};
183
183
  }
184
- `,jn=f.forwardRef(({meta:t,isMobile:o,onStepChange:s},a)=>{const{steps:n,activeStep:i,setActiveStepByKey:m,setActiveStepByIndex:l}=Qs(),{t:u,locale:h}=z(),g=n[i];return f.useEffect(()=>{s(i)},[s,i]),f.useImperativeHandle(a,()=>({setActiveStepByKey:m,setActiveStepByIndex:l})),e.jsx(ai,{component:"div",className:o?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:e.jsx(Zs,{locale:h,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?ls({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:u("blocklet.component.add"),children:e.jsx(ii,{children:typeof(g==null?void 0:g.body)=="function"?g.body():g==null?void 0:g.body})})})});jn.propTypes={meta:r.any,onStepChange:r.func.isRequired,isMobile:r.bool.isRequired};jn.defaultProps={meta:null};const ao=t=>t.isMobile?`
184
+ `,vn=f.forwardRef(({meta:t,isMobile:o,onStepChange:s},a)=>{const{steps:n,activeStep:i,setActiveStepByKey:m,setActiveStepByIndex:l}=Xs(),{t:u,locale:h}=z(),g=n[i];return f.useEffect(()=>{s(i)},[s,i]),f.useImperativeHandle(a,()=>({setActiveStepByKey:m,setActiveStepByIndex:l})),e.jsx(ci,{component:"div",className:o?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:e.jsx($s,{locale:h,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?ds({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:u("blocklet.component.add"),children:e.jsx(li,{children:typeof(g==null?void 0:g.body)=="function"?g.body():g==null?void 0:g.body})})})});vn.propTypes={meta:r.any,onStepChange:r.func.isRequired,isMobile:r.bool.isRequired};vn.defaultProps={meta:null};const co=t=>t.isMobile?`
185
185
  height: calc(100vh - 56px - 64px - 48px);
186
- `:"",ii=F.div`
186
+ `:"",li=F.div`
187
187
  width: 100%;
188
188
  height: 100%;
189
189
  display: flex;
@@ -199,7 +199,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
199
199
  aside {
200
200
  width: 140px;
201
201
  }
202
- `,ai=F(y)`
202
+ `,ci=F(y)`
203
203
  ${({className:t})=>t==="mobileStyle"?`
204
204
  & > div{
205
205
  height: 100%;
@@ -300,11 +300,11 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
300
300
  display: flex;
301
301
  height: 100%;
302
302
  align-items: center;
303
- ${t=>ao(t)}
303
+ ${t=>co(t)}
304
304
  }
305
305
 
306
306
  & .agreement-wrapper {
307
- ${t=>ao(t)}
307
+ ${t=>co(t)}
308
308
  max-height: 60vh;
309
309
  .eula-trigger {
310
310
  padding-right: 0;
@@ -317,7 +317,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
317
317
  & .connect {
318
318
  background: white;
319
319
  }
320
- `,li=jn,ci=t=>t.inStore&&O.isFreeBlocklet(t)===!1,di=t=>{var o;return[X.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,X.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=t==null?void 0:t.capabilities)==null?void 0:o.didSpace)},Ot=t=>{var o,s;return((s=(o=t==null?void 0:t.configs)==null?void 0:o.find(a=>a.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:s.value)||null},pi=t=>(t.environments||[]).some(o=>o.required),lo=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),ui=({params:t,blocklet:o,t:s})=>{const a=t.title||t.name;return a?((o==null?void 0:o.children)||[]).find(i=>i.meta.bundleDid===t.bundleDid)?s("blocklet.component.upgradeNext",{name:a}):s("blocklet.component.addNext",{name:a}):s("common.next")},co=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function vn({onClose:t,mode:o,stores:s,resourceType:a,resourceDid:n,storageKey:i,inDialog:m,selectedMeta:l,storeUrl:u,showResourcesSwitch:h,showFromUrl:g,enableRunBackground:p,showCategory:S}){var On,Mn,Fn,$e,Gn,et,zn;const{t:d,locale:R}=z(),[C,x]=f.useState(!1),[b,c]=f.useState(null),[v,j]=f.useState(""),[T,k]=f.useState(""),{api:U,ws:{useSubscription:L},inService:I,info:M}=Y(),{blocklet:B,actions:{refreshBlocklet:q}}=te(),[Q,ke]=f.useState(null),[ne,de]=f.useState(!1),Se={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[P,Ie]=f.useState(Se),[me,Ze]=f.useState(0),V=f.useRef({}),w=f.useRef({}),_=f.useRef({}),se=Wt(E=>E.breakpoints.down("md")),xe=cs(),[re,Ge]=f.useState(!0),{meta:J}=V.current,H=E=>Ie(A=>({...A,...E}));f.useEffect(()=>{if(P.pathPrefix){const{errMsg:E}=Ln({...P,pathPrefix:P.pathPrefix,locale:R});j(E)}},[P.pathPrefix]),f.useEffect(()=>{me===0&&Ie(Se)},[me]);const Re=()=>{const E=Ot(B)??"";H({didSpaceEndpoint:E})},ze=()=>{var E;return(E=V==null?void 0:V.current)!=null&&E.meta?O.getDisplayName(V.current):""},Ue=E=>{const A=G=>{H({installResultProps:{variant:"error",title:ze(),subTitle:E,footer:e.jsx(oe,{className:"bottom-button",disabled:G,"data-cy":"retry-install-component",onClick:async()=>{A(!0),await Nn(V.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[G&&e.jsx(ie,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};A()},Tt=E=>A=>{var G,W;(((G=A==null?void 0:A.meta)==null?void 0:G.did)||(A==null?void 0:A.meta))===((W=B==null?void 0:B.meta)==null?void 0:W.did)&&E(A)};L(X.BlockletEvents.statusChange,Tt(E=>{switch(E.status){case X.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:ze(),subTitle:d("blocklet.component.installSuccessTip")}}),co({componentDid:xe.componentDid});break}const A=Ot(B);H(G=>({...G,didSpaceEndpoint:A}))}),[(On=B==null?void 0:B.meta)==null?void 0:On.did]),L(X.BlockletEvents.downloadFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Mn=B==null?void 0:B.meta)==null?void 0:Mn.did]),L(X.BlockletEvents.installFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Fn=B==null?void 0:B.meta)==null?void 0:Fn.did]);const pe=[],wt=()=>{x(!1),Ie({}),V.current={},t()},Xe=E=>((B==null?void 0:B.children)||[]).some(A=>A.meta.did===E),Nn=async E=>{var Be,Ae;const{pathPrefix:A,bundleDid:G,title:W,componentName:be="",componentDid:De=""}=P,Ee=((Be=V.current)==null?void 0:Be.meta)||{},{configs:ye=[],registryUrl:je,inStore:Ve,inputUrl:_e,dist:kt}=Ee,We=(Ae=V.current)==null?void 0:Ae.downloadTokenList,le=Ve?Yn(je,G,kt):_e;x(!0);const tt={rootDid:B.meta.did,url:le,mountPoint:A?ue(A):`/${ue(Ee.title||Ee.name)}`,title:W,name:be,did:De,onlyRequired:!re,...P.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:P.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await U.installComponent({input:tt}),je){const{teamDid:he,storeList:Ne}=xo({fromBlocklet:I,nodeInfo:M,blocklet:B}),{isNew:It,decoded:nt}=us(je,Ne);It&&await U.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),q({showError:!1,attachRuntimeInfo:!1})}catch(he){const Ne=Z(he);N.error(Ne),console.error("installComponent error: ",he),Ue(Ne)}finally{x(!1),V.current.installInput=tt}},Ln=E=>({errMsg:Ro({params:{...E,did:E.bundleDid},blocklets:[B],blocklet:B,locale:R})}),fe=async E=>{var G,W;const{errMsg:A}=Ln({...P,locale:R});j(A),me===pe.length-2&&await Nn(E),(W=(G=w.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,be=>be+1)},qe=()=>{var E,A;(A=(E=w.current)==null?void 0:E.setActiveStepByIndex)==null||A.call(E,G=>G-1)},Fo=()=>{const{pathPrefix:E,bundleDid:A,title:G,componentName:W="",componentDid:be=""}=P,{meta:De={}}=V.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:Ve}=De,_e=ye?Yn(Ee,A,Ve):je;ke({meta:De,installOpts:{type:"component",rootDid:B.meta.did,mountPoint:E,url:_e,title:G,name:W,did:be}})},Go=E=>{de(!1),H({purchaseResultProps:{variant:"error",title:ze(),subTitle:E,style:{paddingTop:120},footer:e.jsx(oe,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{H({purchaseResultProps:{}})},children:d("common.retry")})}})},zo=({downloadTokenList:E})=>{V.current.downloadTokenList=E,de(!1),fe()},Pt=({chooseParams:E=V.current,componentDid:A,isInit:G=!1})=>{var nt,qn,Vn,_n;const{meta:W,registryUrl:be,inStore:De,inputUrl:Ee}=E,{did:ye,title:je,name:Ve}=W,_e=(((nt=B.settings)==null?void 0:nt.children)||[]).filter(ce=>ce.status==="deleted"&&ce.meta.bundleDid===ye),kt=A||"",We=(qn=W.environments)==null?void 0:qn.map(ce=>{const{name:Ut,validation:ot,...st}=ce,Dt={validation:ds(ot)?"":ot};return{...st,key:Ut,...Dt}});V.current={...E,meta:{...W,configs:We,registryUrl:be,inStore:De,inputUrl:Ee}};let le={};if(G){const ce=[B],Ut=We||[],ot=[],st=So(ps([...Ut,...ot]),"key").filter(Le=>!!Le.key).sort((Le,rt)=>Le.required&&!rt.required?-1:rt.required&&!Le.required?1:0),Dt=O.getSharedConfigObj(ce[0],{configs:st}),Bt={},Wn=st.map(Le=>{const{default:rt,key:it,...Vo}=Le;return Bt[it]=Dt[it]||rt,{...Vo,key:it,hidden:!!X.BLOCKLET_CONFIGURABLE_KEY[it]}});le={...le,configsList:Wn,configsValue:Bt,hasMissRequiredConfigs:lo(Wn,Bt)}}const tt=B.children.some(ce=>ce.mountPoint==="/"),Be=_e.find(ce=>ce.meta.bundleDid===ye),Ae=B.children.find(ce=>ce.meta.bundleDid===ye);le.title=je||"",Be?le={...le,pathPrefix:Be.mountPoint||"",componentName:Be.meta.name,hasEnvironmentsStep:!1}:Ae?le={...le,pathPrefix:Ae.mountPoint||"",componentName:Ae.meta.name,hasEnvironmentsStep:!1}:le={...le,pathPrefix:tt?`/${ue(je)||ue(Ve)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((_n=(Vn=V.current.meta)==null?void 0:Vn.environments)==null?void 0:_n.length)>0};const he=ci(V.current.meta),Ne=di(V.current.meta),It=Ot(B);H({bundleDid:ye,componentDid:kt,...le,hasRequiredEnvironments:pi(V.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Ne,didSpaceEndpoint:It}),G&&he&&Fo()};f.useEffect(()=>{!l||me!==0||!B||(Pt({chooseParams:{blocklets:[l],meta:l,registryUrl:u||l.homepage,inStore:!0},isInit:!0}),H({showFromUrlDialog:!1}),fe())},[l,me,B]),pe.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:e.jsxs(Te,{sx:{width:400},component:"div",children:[g&&P.showFromUrlDialog&&e.jsx(dr,{mode:"component",onCancel:()=>{H({showFromUrlDialog:!1})},onSuccess:({meta:E,inputUrl:A,inStore:G,registryUrl:W})=>{Pt({chooseParams:{meta:E,inputUrl:A,inStore:G,registryUrl:W},isInit:!0}),H({showFromUrlDialog:!1}),fe()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),e.jsx(gn,{stores:s,extra:ko.isInServerlessMode(M)?null:g?e.jsxs(oe,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{H({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Qt,{style:{fontSize:20,marginRight:4}})," ",d("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:C,onChange:()=>{Ie({}),V.current={}},storageKey:i,children:({currentRegistry:E})=>e.jsx(Cn,{showResourcesSwitch:h,showCategory:S,serverVersion:M==null?void 0:M.version,style:se?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:E.url,resourceType:a,resourceDid:n,handleButtonClick:A=>{Pt({chooseParams:{...A,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:A,defaultRender:G})=>{const W=(P==null?void 0:P.bundleDid)&&(P==null?void 0:P.bundleDid)===(A==null?void 0:A.did);return e.jsxs(fi,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(go,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:ui({params:P,blocklet:B,t:d}),onCancel:wt,onConfirm:()=>{fe()}}),pe.push({key:"agreement",name:d("launchBlocklet.introduction"),body:e.jsxs(Te,{component:"div",className:"agreement-wrapper",children:[e.jsx(vo,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(ks,{meta:J,onClickNext:fe,installRelated:re,onChangeInstallRelated:Ge,handleDescEle:e.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:l?void 0:d("common.pre"),confirm:d("launchBlocklet.next"),onCancel:l?wt:qe,onConfirm:()=>{de(!1),fe()}}),J&&P.requirePurchase&&pe.push({key:"purchase",name:e.jsxs(e.Fragment,{children:[d("common.verifyNFT"),e.jsx(ct,{})]}),body:e.jsxs(Te,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Gn=($e=_.current)==null?void 0:$e.getCurrentStep)==null?void 0:Gn.call($e))===2||ne)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(P.purchaseResultProps)?Q&&e.jsx(Hr,{ref:_,meta:Q.meta,mode:P.componentDid?"verify":"both",onCancel:Go,installOpts:Q.installOpts,handlePaySuccess:zo}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Xn,{...P.purchaseResultProps})})]}),disabled:((zn=(et=_.current)==null?void 0:et.getCurrentStep)==null?void 0:zn.call(et))===2||ne,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof _.current.onNext=="function"&&(_.current.onNext(),de(!0))},onCancel:()=>{qe()}}),O.hasStartEngine(J)&&!Xe(J.did)&&pe.push({key:"config",name:d("common.config"),error:v,body:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.config"),subTitle:d("blocklet.component.addComponentTip.config")}),e.jsx(K,{label:d("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:T||d("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:P.pathPrefix,onChange:E=>{const A=E.target.value;H({pathPrefix:A}),k(d("common.slugifyHint",{value:gt(A)}))}}),!!v&&e.jsx(dt,{severity:"error",style:{width:"100%",marginTop:8},children:v})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:()=>{fe()}}),J&&!Xe(J.did)&&(P!=null&&P.hasEnvironmentsStep)&&pe.push({key:"environment",name:e.jsxs(e.Fragment,{children:[d("common.environment")," ",P.hasRequiredEnvironments&&e.jsx(ct,{})]}),disabled:!!b||(P==null?void 0:P.hasMissRequiredConfigs),body:()=>e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),e.jsx(an,{style:{marginTop:-12,width:"100%"},schema:P.configsList,defaultValue:P.configsValue,onChange:(E,{action:A,currentItem:G,allValues:W})=>{A==="confirm"&&H({hasMissRequiredConfigs:lo(P.configsList,W),configsValue:W}),A==="edit"?c(G):["cancel","confirm"].includes(A)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:fe}),J&&!Xe(J.did)&&(P!=null&&P.didSpaceIsRequiredSetup)&&pe.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",P.didSpaceIsRequiredSetup==="required"&&e.jsx(ct,{})]}),disabled:(P==null?void 0:P.didSpaceIsRequiredSetup)&&!P.didSpaceEndpoint,body:()=>e.jsx(en,{children:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("blocklet.component.didSpaceConfig"),subTitle:d("blocklet.component.didSpaceConfigTip")}),e.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:e.jsx(hn,{blockletMeta:V.current.meta,onNext:()=>{fe()},onEndpointUpdate:Re})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:fe}),pe.push({key:"install",name:Xe(J==null?void 0:J.did)?d("common.upgrade"):d("common.install"),disabled:p?!1:He(P.installResultProps),loading:p?!1:He(P.installResultProps),body:e.jsx(Te,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:He(P.installResultProps)?e.jsx(Xs,{message:e.jsx(hi,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Xn,{...P.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{co({timeout:0,componentDid:xe.componentDid,manual:!0}),wt(),setTimeout(()=>{const E=document.getElementsByClassName("dashboard-main")[0];E&&(E.scrollTop=E.scrollHeight)},200)}});const ae=pe[me]||{},qo=()=>C||ae.error||!P.bundleDid?!0:me>1?!P.pathPrefix:!1;return B?e.jsxs(mi,{sx:{width:"100%",height:se?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx($s,{steps:pe,mode:"memory",children:e.jsx(li,{ref:w,meta:J,isMobile:se,onStepChange:E=>{Ze(E)}})}),e.jsxs(y,{className:"action-bar",children:[ae.cancel&&e.jsx(oe,{onClick:E=>{E.stopPropagation(),ae.onCancel()},disabled:me===pe.length-2&&C,color:"inherit",children:ae.cancel||d("common.cancel")}),ae.confirm&&e.jsx(oe,{onClick:E=>{E.stopPropagation(),ae.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof ae.disabled=="boolean"?ae.disabled:qo()),variant:"contained",autoFocus:!0,title:ae.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[(typeof ae.loading=="boolean"?ae.loading:C)&&e.jsx(ie,{style:{marginRight:8},size:16}),ae.confirm]})})]})]}):null}vn.propTypes={onClose:r.func,mode:r.oneOf(["normal","embed"]),inDialog:r.bool,stores:r.arrayOf(r.string),storeUrl:r.string,resourceType:r.string,resourceDid:r.string,storageKey:r.string,selectedMeta:r.object,showResourcesSwitch:r.bool,showFromUrl:r.bool,enableRunBackground:r.bool,showCategory:r.bool};vn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const mi=F(y)`
320
+ `,di=vn,pi=t=>t.inStore&&O.isFreeBlocklet(t)===!1,ui=t=>{var o;return[J.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,J.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=t==null?void 0:t.capabilities)==null?void 0:o.didSpace)},Mt=t=>{var o,s;return((s=(o=t==null?void 0:t.configs)==null?void 0:o.find(a=>a.key===J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:s.value)||null},mi=t=>(t.environments||[]).some(o=>o.required),po=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),fi=({params:t,blocklet:o,t:s})=>{const a=t.title||t.name;return a?((o==null?void 0:o.children)||[]).find(i=>i.meta.bundleDid===t.bundleDid)?s("blocklet.component.upgradeNext",{name:a}):s("blocklet.component.addNext",{name:a}):s("common.next")},uo=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function Sn({onClose:t,mode:o,stores:s,resourceType:a,resourceDid:n,storageKey:i,inDialog:m,selectedMeta:l,storeUrl:u,showResourcesSwitch:h,showFromUrl:g,enableRunBackground:p,showCategory:S}){var Mn,Fn,Gn,$e,zn,et,Vn;const{t:d,locale:R}=z(),[C,x]=f.useState(!1),[b,c]=f.useState(null),[v,j]=f.useState(""),[T,k]=f.useState(""),{api:U,ws:{useSubscription:L},inService:I,info:M}=K(),{blocklet:D,actions:{refreshBlocklet:V}}=te(),[Q,ke]=f.useState(null),[ne,de]=f.useState(!1),Se={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[P,Ie]=f.useState(Se),[me,Qe]=f.useState(0),q=f.useRef({}),w=f.useRef({}),_=f.useRef({}),se=Ht(E=>E.breakpoints.down("md")),xe=ps(),[re,Ge]=f.useState(!0),{meta:Y}=q.current,H=E=>Ie(A=>({...A,...E}));f.useEffect(()=>{if(P.pathPrefix){const{errMsg:E}=On({...P,pathPrefix:P.pathPrefix,locale:R});j(E)}},[P.pathPrefix]),f.useEffect(()=>{me===0&&Ie(Se)},[me]);const Re=()=>{const E=Mt(D)??"";H({didSpaceEndpoint:E})},ze=()=>{var E;return(E=q==null?void 0:q.current)!=null&&E.meta?O.getDisplayName(q.current):""},Ue=E=>{const A=G=>{H({installResultProps:{variant:"error",title:ze(),subTitle:E,footer:e.jsx(oe,{className:"bottom-button",disabled:G,"data-cy":"retry-install-component",onClick:async()=>{A(!0),await Ln(q.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[G&&e.jsx(ie,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};A()},Tt=E=>A=>{var G,W;(((G=A==null?void 0:A.meta)==null?void 0:G.did)||(A==null?void 0:A.meta))===((W=D==null?void 0:D.meta)==null?void 0:W.did)&&E(A)};L(J.BlockletEvents.statusChange,Tt(E=>{switch(E.status){case J.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:ze(),subTitle:d("blocklet.component.installSuccessTip")}}),uo({componentDid:xe.componentDid});break}const A=Mt(D);H(G=>({...G,didSpaceEndpoint:A}))}),[(Mn=D==null?void 0:D.meta)==null?void 0:Mn.did]),L(J.BlockletEvents.downloadFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Fn=D==null?void 0:D.meta)==null?void 0:Fn.did]),L(J.BlockletEvents.installFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Gn=D==null?void 0:D.meta)==null?void 0:Gn.did]);const pe=[],wt=()=>{x(!1),Ie({}),q.current={},t()},Xe=E=>((D==null?void 0:D.children)||[]).some(A=>A.meta.did===E),Ln=async E=>{var De,Ae;const{pathPrefix:A,bundleDid:G,title:W,componentName:be="",componentDid:Be=""}=P,Ee=((De=q.current)==null?void 0:De.meta)||{},{configs:ye=[],registryUrl:je,inStore:qe,inputUrl:_e,dist:kt}=Ee,We=(Ae=q.current)==null?void 0:Ae.downloadTokenList,le=qe?Yn(je,G,kt):_e;x(!0);const tt={rootDid:D.meta.did,url:le,mountPoint:A?ue(A):`/${ue(Ee.title||Ee.name)}`,title:W,name:be,did:Be,onlyRequired:!re,...P.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:P.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await U.installComponent({input:tt}),je){const{teamDid:he,storeList:Ne}=Co({fromBlocklet:I,nodeInfo:M,blocklet:D}),{isNew:It,decoded:nt}=fs(je,Ne);It&&await U.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),V({showError:!1,attachRuntimeInfo:!1})}catch(he){const Ne=X(he);N.error(Ne),console.error("installComponent error: ",he),Ue(Ne)}finally{x(!1),q.current.installInput=tt}},On=E=>({errMsg:Eo({params:{...E,did:E.bundleDid},blocklets:[D],blocklet:D,locale:R})}),fe=async E=>{var G,W;const{errMsg:A}=On({...P,locale:R});j(A),me===pe.length-2&&await Ln(E),(W=(G=w.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,be=>be+1)},Ve=()=>{var E,A;(A=(E=w.current)==null?void 0:E.setActiveStepByIndex)==null||A.call(E,G=>G-1)},zo=()=>{const{pathPrefix:E,bundleDid:A,title:G,componentName:W="",componentDid:be=""}=P,{meta:Be={}}=q.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:qe}=Be,_e=ye?Yn(Ee,A,qe):je;ke({meta:Be,installOpts:{type:"component",rootDid:D.meta.did,mountPoint:E,url:_e,title:G,name:W,did:be}})},Vo=E=>{de(!1),H({purchaseResultProps:{variant:"error",title:ze(),subTitle:E,style:{paddingTop:120},footer:e.jsx(oe,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{H({purchaseResultProps:{}})},children:d("common.retry")})}})},qo=({downloadTokenList:E})=>{q.current.downloadTokenList=E,de(!1),fe()},Pt=({chooseParams:E=q.current,componentDid:A,isInit:G=!1})=>{var nt,qn,_n,Wn;const{meta:W,registryUrl:be,inStore:Be,inputUrl:Ee}=E,{did:ye,title:je,name:qe}=W,_e=(((nt=D.settings)==null?void 0:nt.children)||[]).filter(ce=>ce.status==="deleted"&&ce.meta.bundleDid===ye),kt=A||"",We=(qn=W.environments)==null?void 0:qn.map(ce=>{const{name:Ut,validation:ot,...st}=ce,Bt={validation:us(ot)?"":ot};return{...st,key:Ut,...Bt}});q.current={...E,meta:{...W,configs:We,registryUrl:be,inStore:Be,inputUrl:Ee}};let le={};if(G){const ce=[D],Ut=We||[],ot=[],st=bo(ms([...Ut,...ot]),"key").filter(Le=>!!Le.key).sort((Le,rt)=>Le.required&&!rt.required?-1:rt.required&&!Le.required?1:0),Bt=O.getSharedConfigObj(ce[0],{configs:st}),Dt={},Hn=st.map(Le=>{const{default:rt,key:it,...Wo}=Le;return Dt[it]=Bt[it]||rt,{...Wo,key:it,hidden:!!J.BLOCKLET_CONFIGURABLE_KEY[it]}});le={...le,configsList:Hn,configsValue:Dt,hasMissRequiredConfigs:po(Hn,Dt)}}const tt=D.children.some(ce=>ce.mountPoint==="/"),De=_e.find(ce=>ce.meta.bundleDid===ye),Ae=D.children.find(ce=>ce.meta.bundleDid===ye);le.title=je||"",De?le={...le,pathPrefix:De.mountPoint||"",componentName:De.meta.name,hasEnvironmentsStep:!1}:Ae?le={...le,pathPrefix:Ae.mountPoint||"",componentName:Ae.meta.name,hasEnvironmentsStep:!1}:le={...le,pathPrefix:tt?`/${ue(je)||ue(qe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Wn=(_n=q.current.meta)==null?void 0:_n.environments)==null?void 0:Wn.length)>0};const he=pi(q.current.meta),Ne=ui(q.current.meta),It=Mt(D);H({bundleDid:ye,componentDid:kt,...le,hasRequiredEnvironments:mi(q.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Ne,didSpaceEndpoint:It}),G&&he&&zo()};f.useEffect(()=>{!l||me!==0||!D||(Pt({chooseParams:{blocklets:[l],meta:l,registryUrl:u||l.homepage,inStore:!0},isInit:!0}),H({showFromUrlDialog:!1}),fe())},[l,me,D]),pe.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:e.jsxs(Te,{sx:{width:400},component:"div",children:[g&&P.showFromUrlDialog&&e.jsx(ur,{mode:"component",onCancel:()=>{H({showFromUrlDialog:!1})},onSuccess:({meta:E,inputUrl:A,inStore:G,registryUrl:W})=>{Pt({chooseParams:{meta:E,inputUrl:A,inStore:G,registryUrl:W},isInit:!0}),H({showFromUrlDialog:!1}),fe()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),e.jsx(xn,{stores:s,extra:Uo.isInServerlessMode(M)?null:g?e.jsxs(oe,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{H({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Qt,{style:{fontSize:20,marginRight:4}})," ",d("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:C,onChange:()=>{Ie({}),q.current={}},storageKey:i,children:({currentRegistry:E})=>e.jsx(jn,{showResourcesSwitch:h,showCategory:S,serverVersion:M==null?void 0:M.version,style:se?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:E.url,resourceType:a,resourceDid:n,handleButtonClick:A=>{Pt({chooseParams:{...A,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:A,defaultRender:G})=>{const W=(P==null?void 0:P.bundleDid)&&(P==null?void 0:P.bundleDid)===(A==null?void 0:A.did);return e.jsxs(gi,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(yo,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:fi({params:P,blocklet:D,t:d}),onCancel:wt,onConfirm:()=>{fe()}}),pe.push({key:"agreement",name:d("launchBlocklet.introduction"),body:e.jsxs(Te,{component:"div",className:"agreement-wrapper",children:[e.jsx(Ro,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(Us,{meta:Y,onClickNext:fe,installRelated:re,onChangeInstallRelated:Ge,handleDescEle:e.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:l?void 0:d("common.pre"),confirm:d("launchBlocklet.next"),onCancel:l?wt:Ve,onConfirm:()=>{de(!1),fe()}}),Y&&P.requirePurchase&&pe.push({key:"purchase",name:e.jsxs(e.Fragment,{children:[d("common.verifyNFT"),e.jsx(ct,{})]}),body:e.jsxs(Te,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((zn=($e=_.current)==null?void 0:$e.getCurrentStep)==null?void 0:zn.call($e))===2||ne)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(P.purchaseResultProps)?Q&&e.jsx(Yr,{ref:_,meta:Q.meta,mode:P.componentDid?"verify":"both",onCancel:Vo,installOpts:Q.installOpts,handlePaySuccess:qo}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx($n,{...P.purchaseResultProps})})]}),disabled:((Vn=(et=_.current)==null?void 0:et.getCurrentStep)==null?void 0:Vn.call(et))===2||ne,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof _.current.onNext=="function"&&(_.current.onNext(),de(!0))},onCancel:()=>{Ve()}}),O.hasStartEngine(Y)&&!Xe(Y.did)&&pe.push({key:"config",name:d("common.config"),error:v,body:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.config"),subTitle:d("blocklet.component.addComponentTip.config")}),e.jsx(Z,{label:d("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:T||d("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:P.pathPrefix,onChange:E=>{const A=E.target.value;H({pathPrefix:A}),k(d("common.slugifyHint",{value:gt(A)}))}}),!!v&&e.jsx(dt,{severity:"error",style:{width:"100%",marginTop:8},children:v})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Ve,onConfirm:()=>{fe()}}),Y&&!Xe(Y.did)&&(P!=null&&P.hasEnvironmentsStep)&&pe.push({key:"environment",name:e.jsxs(e.Fragment,{children:[d("common.environment")," ",P.hasRequiredEnvironments&&e.jsx(ct,{})]}),disabled:!!b||(P==null?void 0:P.hasMissRequiredConfigs),body:()=>e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),e.jsx(ln,{style:{marginTop:-12,width:"100%"},schema:P.configsList,defaultValue:P.configsValue,onChange:(E,{action:A,currentItem:G,allValues:W})=>{A==="confirm"&&H({hasMissRequiredConfigs:po(P.configsList,W),configsValue:W}),A==="edit"?c(G):["cancel","confirm"].includes(A)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Ve,onConfirm:fe}),Y&&!Xe(Y.did)&&(P!=null&&P.didSpaceIsRequiredSetup)&&pe.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",P.didSpaceIsRequiredSetup==="required"&&e.jsx(ct,{})]}),disabled:(P==null?void 0:P.didSpaceIsRequiredSetup)&&!P.didSpaceEndpoint,body:()=>e.jsx(tn,{children:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("blocklet.component.didSpaceConfig"),subTitle:d("blocklet.component.didSpaceConfigTip")}),e.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:e.jsx(gn,{blockletMeta:q.current.meta,onNext:()=>{fe()},onEndpointUpdate:Re})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Ve,onConfirm:fe}),pe.push({key:"install",name:Xe(Y==null?void 0:Y.did)?d("common.upgrade"):d("common.install"),disabled:p?!1:He(P.installResultProps),loading:p?!1:He(P.installResultProps),body:e.jsx(Te,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:He(P.installResultProps)?e.jsx(er,{message:e.jsx(xi,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx($n,{...P.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{uo({timeout:0,componentDid:xe.componentDid,manual:!0}),wt(),setTimeout(()=>{const E=document.getElementsByClassName("dashboard-main")[0];E&&(E.scrollTop=E.scrollHeight)},200)}});const ae=pe[me]||{},_o=()=>C||ae.error||!P.bundleDid?!0:me>1?!P.pathPrefix:!1;return D?e.jsxs(hi,{sx:{width:"100%",height:se?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx(tr,{steps:pe,mode:"memory",children:e.jsx(di,{ref:w,meta:Y,isMobile:se,onStepChange:E=>{Qe(E)}})}),e.jsxs(y,{className:"action-bar",children:[ae.cancel&&e.jsx(oe,{onClick:E=>{E.stopPropagation(),ae.onCancel()},disabled:me===pe.length-2&&C,color:"inherit",children:ae.cancel||d("common.cancel")}),ae.confirm&&e.jsx(oe,{onClick:E=>{E.stopPropagation(),ae.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof ae.disabled=="boolean"?ae.disabled:_o()),variant:"contained",autoFocus:!0,title:ae.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[(typeof ae.loading=="boolean"?ae.loading:C)&&e.jsx(ie,{style:{marginRight:8},size:16}),ae.confirm]})})]})]}):null}Sn.propTypes={onClose:r.func,mode:r.oneOf(["normal","embed"]),inDialog:r.bool,stores:r.arrayOf(r.string),storeUrl:r.string,resourceType:r.string,resourceDid:r.string,storageKey:r.string,selectedMeta:r.object,showResourcesSwitch:r.bool,showFromUrl:r.bool,enableRunBackground:r.bool,showCategory:r.bool};Sn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const hi=F(y)`
321
321
  .action-bar {
322
322
  display: flex;
323
323
  justify-content: flex-end;
@@ -332,9 +332,9 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
332
332
  `,Te=F(ee)`
333
333
  width: 100%;
334
334
  height: 100%;
335
- `,lt=F(vo)`
335
+ `,lt=F(Ro)`
336
336
  margin-bottom: 24px;
337
- `,fi=F.div`
337
+ `,gi=F.div`
338
338
  position: relative;
339
339
 
340
340
  .choose-blocklet {
@@ -378,7 +378,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
378
378
  transition: all ease 0.2s;
379
379
  }
380
380
  }
381
- `,hi=F.div`
381
+ `,xi=F.div`
382
382
  color: ${t=>t.theme.palette.primary.main};
383
383
  .msg-before {
384
384
  display: inline-block;
@@ -386,18 +386,18 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
386
386
  font-size: 14px;
387
387
  margin-right: 6px;
388
388
  }
389
- `;function St({blocklet:t,showDialog:o,setShowDialog:s,selectedMeta:a}){const{t:n}=z(),i=Wt(u=>u.breakpoints.down("md")),{inService:m}=Y(),l=()=>{s(!1)};return o?e.jsx(gi,{title:n("blocklet.component.addWithName",{name:O.getDisplayName(t)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:i?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(u,h)=>{h!=="backdropClick"&&l()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:e.jsx(vn,{selectedMeta:a,onClose:l,storageKey:m?Js:Ks})}):null}St.propTypes={selectedMeta:r.object,showDialog:r.bool.isRequired,setShowDialog:r.func.isRequired,blocklet:r.object.isRequired};St.defaultProps={selectedMeta:null};const gi=F(xt)`
389
+ `;function St({blocklet:t,showDialog:o,setShowDialog:s,selectedMeta:a}){const{t:n}=z(),i=Ht(u=>u.breakpoints.down("md")),{inService:m}=K(),l=()=>{s(!1)};return o?e.jsx(yi,{title:n("blocklet.component.addWithName",{name:O.getDisplayName(t)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:i?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(u,h)=>{h!=="backdropClick"&&l()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:e.jsx(Sn,{selectedMeta:a,onClose:l,storageKey:m?Zs:Qs})}):null}St.propTypes={selectedMeta:r.object,showDialog:r.bool.isRequired,setShowDialog:r.func.isRequired,blocklet:r.object.isRequired};St.defaultProps={selectedMeta:null};const yi=F(xt)`
390
390
  .MuiDialogContent-root {
391
391
  }
392
- `;function Sn({blocklet:t,children:o}){const{t:s}=z(),[a,n]=f.useState(!1),i=m=>{m.stopPropagation(),n(!0)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({open:i}):e.jsxs(ge,{onClick:i,className:"component-action","data-cy":"action-add-component",children:[e.jsx(Qt,{style:{fontSize:18,marginRight:5}}),s("blocklet.component.add")]}),e.jsx(St,{showDialog:a,setShowDialog:n,blocklet:t})]})}Sn.propTypes={children:r.any,blocklet:r.object.isRequired};Sn.defaultProps={children:null};const xi=t=>t.children.filter(o=>o.meta.interfaces.find(s=>s.type===X.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:t,setParams:o,setError:s,serviceTypes:a}){const{t:n}=z(),{blocklet:i}=te(),m=i.meta.did,l=xi(i),[u,h]=f.useState([]),g={301:n("common.redirectPermanently"),302:n("common.redirectTemporary"),307:n("common.redirectTemporary"),308:n("common.redirectPermanently")};return f.useEffect(()=>{if(t.type===D.ROUTING_RULE_TYPES.COMPONENT&&t.componentId){const p=l.find(R=>R.meta.did===t.componentId),S=O.findWebInterface(p.meta),d=(Array.isArray(S==null?void 0:S.pageGroups)?S.pageGroups:[]).map(R=>({value:R,label:`${R} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),h(d),t.pageGroup&&d.find(R=>R.value===t.pageGroup)===!1&&o({...t,pageGroups:""})}},[t.componentId,t.type]),e.jsxs(e.Fragment,{children:[e.jsx(K,{select:!0,label:n("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:t.type,onChange:p=>{s(""),o({...t,type:p.target.value,did:p.target.value===D.ROUTING_RULE_TYPES.BLOCKLET?m:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:p,value:S})=>e.jsx(ge,{value:S,children:p},S))}),t.type===D.ROUTING_RULE_TYPES.REDIRECT&&[e.jsx(K,{select:!0,label:n("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:t.redirectCode,onChange:p=>o({...t,redirectCode:p.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(g).map(p=>e.jsx(ge,{value:p,children:`${g[p]} - ${p}`},p))},"redirectCode"),e.jsx(K,{label:n("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{o({...t,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?s(""):s(n("router.validation.redirectUrlRequired"))}},"redirectUrl")],t.type===D.ROUTING_RULE_TYPES.COMPONENT&&[e.jsx(K,{select:!0,label:n("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:t.componentId,onChange:p=>{o({...t,componentId:p.target.value})},style:{marginBottom:32},SelectProps:{},children:l.map(p=>e.jsx(ge,{value:p.meta.did,selected:p.meta.did===t.componentId,children:O.getDisplayName(p,!0)},p.meta.did))},"componentId"),u.length?e.jsx(K,{select:!0,label:n("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:t.pageGroup,helperText:n("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{o({...t,pageGroup:p.target.value})},SelectProps:{},children:u.map(p=>e.jsx(ge,{value:p.value,selected:p.value===t.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),t.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(K,{label:n("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,url:p.target.value,__disableConfirm:!S}),s(S?"":n("router.validation.rewriteUrlRequired"))}},"url"),t.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[e.jsx(K,{select:!0,label:n("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:t.responseType,onChange:p=>o({...t,responseType:p.target.value}),style:{marginBottom:32},SelectProps:{},children:D.ROUTING_RESPONSE_TYPES.map(p=>e.jsx(ge,{value:p.value,children:p.text},p.value))},"responseType"),e.jsx(K,{label:n("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:t.responseBody,helperText:n("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,responseBody:p.target.value,__disableConfirm:!S}),s(S?"":n("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:r.object,serviceTypes:r.array,setParams:r.func,setError:r.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:D.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:D.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:D.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:D.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:D.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function Rn({children:t,hiddenChildren:o,open:s,onClose:a}){const{t:n}=z(),{api:i}=Y(),{blocklet:m}=te(),[l,u]=f.useState(!1),[h,g]=f.useState(!1),p=m.meta.did,S=m.site.id,d=()=>{a==null||a(),u(!1),g(!1)},R=async c=>{try{const v=await ut(c,n);if(v)throw v;u(!0);const j={from:{pathPrefix:ue(c.pathPrefix)},to:{type:c.type}};c.type===D.ROUTING_RULE_TYPES.REDIRECT&&(j.to.url=c.url.trim(),j.to.redirectCode=c.redirectCode),c.type===D.ROUTING_RULE_TYPES.COMPONENT&&(j.to.did=p,j.to.componentId=c.componentId,j.to.pageGroup=c.pageGroup),c.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(j.to.url=ue(c.url)),c.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(j.to.response={status:200,contentType:c.responseType,body:c.responseBody}),await i.addRoutingRule({input:{id:S,rule:j,teamDid:p}})}catch(v){N.error(v.message)}finally{u(!1),g(!1)}},C={title:n("router.rule.add.title"),description:(c,v,j)=>{const T=k=>{if(j(null),ut(k,n)){v({...k,__disableConfirm:!0});return}v({...k})};return e.jsxs(ee,{component:"div",children:[e.jsx(K,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:c.pathPrefixHint||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:c.pathPrefix,onChange:k=>{let U=!1;const L=Ro({params:{...c,pathPrefix:k.target.value},blocklets:[m]});j(L),c.type===D.ROUTING_RULE_TYPES.BLOCKLET&&L&&(U=!0),c.type===D.ROUTING_RULE_TYPES.REDIRECT&&!c.url&&(U=!0),c.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!c.url&&(U=!0),c.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!c.responseType||!c.responseBody)&&(U=!0),k.target.value.trim()||(U=!0,j(n("router.validation.pathPrefixRequired"))),U||j("");const I=n("common.slugifyHint",{value:gt(k.target.value)});v({...c,pathPrefix:k.target.value,pathPrefixHint:I,__disableConfirm:U})}}),e.jsx(Rt,{params:c,setParams:T,setError:j})]})},confirm:n("router.rule.add.confirm"),cancel:n("common.cancel"),params:{did:"",pathPrefix:"",type:D.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:R,onCancel:d},x=c=>{c.stopPropagation(),g(!0)};let b=null;return o||(b=typeof t=="function"?t({open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-add-rule",children:[l?e.jsx(ie,{size:16}):e.jsx(Qt,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[b,(s||h)&&e.jsx(Fe,{title:C.title,description:C.description,confirm:C.confirm,cancel:C.cancel,params:C.params,onConfirm:C.onConfirm,onCancel:C.onCancel,color:"primary"})]})}Rn.propTypes={children:r.any,onClose:r.func,hiddenChildren:r.bool,open:r.bool};Rn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function bn({id:t,from:o,children:s}){const{t:a}=z(),{api:n}=Y(),{blocklet:i}=te(),[m,l]=f.useState(!1),[u,h]=f.useState(null),g=i.meta.did,p=i.site.id,S=o.pathPrefix,d=()=>{l(!1),h(null)},R=async()=>{l(!0);try{await n.deleteRoutingRule({input:{id:p,ruleId:t,teamDid:g}})}catch(b){N.error(b.message)}finally{h(null),l(!1)}},C={keyName:S,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${S}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:S}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:R,onCancel:d},x=b=>{b.stopPropagation(),h(C)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({loading:m,open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-delete-rule",children:[m?e.jsx(ie,{size:16}):e.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),u&&e.jsx(jr,{keyName:u.keyName,title:u.title,description:u.description,confirmPlaceholder:u.confirmPlaceholder,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}bn.propTypes={id:r.string.isRequired,from:r.object.isRequired,children:r.any};bn.defaultProps={children:null};function En({id:t,from:o,to:s,children:a}){var c,v;const{t:n}=z(),{api:i}=Y(),{blocklet:m}=te(),[l,u]=f.useState(!1),[h,g]=f.useState(null),p=m.meta.did,S=m.site.id,d=o.pathPrefix,R=()=>{u(!1),g(null)},C=async j=>{try{const T=await ut(j,n);if(T)throw T;u(!0);const k={id:t,from:{pathPrefix:ue(j.pathPrefix)},to:{type:j.type}};j.type===D.ROUTING_RULE_TYPES.REDIRECT&&(k.to.url=j.url,k.to.redirectCode=j.redirectCode),j.type===D.ROUTING_RULE_TYPES.COMPONENT&&(k.to.did=p,k.to.componentId=j.componentId,k.to.pageGroup=j.pageGroup),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(k.to.url=ue(j.url)),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(k.to.response={status:200,contentType:j.responseType,body:j.responseBody}),await i.updateRoutingRule({input:{id:S,rule:k,teamDid:p}})}catch(T){N.error(T.message)}finally{u(!1),g(null)}},x={title:n("router.rule.update.title"),description:(j,T,k)=>{const U=L=>{if(ut(L,n)){T({...L,__disableConfirm:!0});return}T({...L})};return e.jsxs(ee,{component:"div",children:[e.jsx(K,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:j.helperText||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:j.pathPrefix,onChange:L=>{let I=!1;j.type===D.ROUTING_RULE_TYPES.REDIRECT&&!j.url&&(I=!0),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!j.url&&(I=!0),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!j.responseType||!j.responseBody)&&(I=!0),L.target.value.trim()||(I=!0,k(n("router.validation.pathPrefixRequired"))),I||k("");const M=n("common.slugifyHint",{value:gt(L.target.value)});T({...j,pathPrefix:L.target.value,helperText:M,__disableConfirm:I})}}),e.jsx(Rt,{params:j,setParams:U,setError:k})]})},confirm:n("router.rule.update.confirm"),cancel:n("router.rule.update.cancel"),color:"primary",params:{did:s.did||"",pathPrefix:d==="/"?d:d.replace(/^\/+/,"").replace(/\/+$/,""),type:s.type||D.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:s.redirectCode||302,componentId:s.componentId||"",pageGroup:s.pageGroup||"",url:s.url||"",responseType:((c=s.response)==null?void 0:c.contentType)||"",responseBody:(((v=s.response)==null?void 0:v.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:C,onCancel:R},b=j=>{j.stopPropagation(),g(x)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:l,open:b}):e.jsxs(ge,{onClick:b,className:"rule-action","data-cy":"action-update-rule",children:[l?e.jsx(ie,{size:16}):e.jsx(jo,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),h&&e.jsx(Fe,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}En.propTypes={id:r.string.isRequired,from:r.object.isRequired,to:r.object.isRequired,children:r.any};En.defaultProps={children:null};function Tn(t){const{locale:o}=z(),{blocklet:s,recommendedDomain:a}=te(),n=yo(a,t.from.pathPrefix,Ht(s,o));return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:n,rel:"noopener noreferrer",title:n,children:e.jsx($,{size:"small",children:e.jsx(bo,{})})}),e.jsx(En,{...t,children:({open:i})=>e.jsx($,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-update-rule",children:e.jsx(Yt,{})})}),e.jsx(bn,{...t,children:({open:i})=>e.jsx($,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-delete-rule",children:e.jsx(Ct,{})})})]})}Tn.propTypes={isProtected:r.bool};Tn.defaultProps={isProtected:!1};function No({group:t,...o}){return t?e.jsx(Qe,{type:"reverse",...o,children:t}):null}No.propTypes={group:r.string.isRequired};function ft({domain:t,isHttps:o,toUrl:s}){const a=o?"https":"http";let n=s;return hs(n)||(n=`${a}://${t}${s}`),e.jsx(yt,{href:n,target:"_blank",style:{fontSize:14},underline:"hover",children:s},n)}ft.propTypes={domain:r.string.isRequired,toUrl:r.string.isRequired,isHttps:r.bool};ft.defaultProps={isHttps:!1};function bt({hasPermission:t}){const{t:o,locale:s}=z(),a=fo(),{blocklet:n,recommendedDomain:i}=te();return n.site.rules.filter(l=>l.to.type!==D.ROUTING_RULE_TYPES.BLOCKLET).map(l=>{var p;let u=null,h=null;l.to.type===D.ROUTING_RULE_TYPES.NONE?u="404":l.to.type===D.ROUTING_RULE_TYPES.REDIRECT?u=l.to.redirectCode:l.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE?u="R":l.to.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE?u=e.jsx(Tr,{sx:{color:"text.secondary",fontSize:"45px"}}):l.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&(h=n.children.find(S=>S.meta.did===l.to.componentId),u="C");const g=l.isProtected?e.jsx(ve,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:e.jsx("span",{children:e.jsx($,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:e.jsx(Cr,{style:{fill:a.palette.text.disabled}})})})}):e.jsx(Tn,{...l});return[e.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(y,{className:"component-item__indent",width:28}),typeof u=="object"?u:e.jsx(ms,{children:u}),e.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[e.jsxs(y,{style:{color:"#222",fontSize:16},children:[l.to.type===D.ROUTING_RULE_TYPES.NONE&&o("common.page404"),l.to.type===D.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),l.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),l.to.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((p=D.ROUTING_RESPONSE_TYPES.find(S=>S.value===l.to.response.contentType))==null?void 0:p.text),l.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&O.getDisplayName(h,!0)]}),e.jsxs(y,{display:"flex",alignItems:"center",children:[l.to.type===D.ROUTING_RULE_TYPES.REDIRECT&&e.jsx(ft,{domain:i,toUrl:l.to.url}),l.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(ft,{domain:i,toUrl:l.to.url}),l.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(No,{group:l.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(yt,{href:yo(i,l.from.pathPrefix,Ht(n,s)),target:"_blank",style:{fontSize:16},underline:"hover",children:fs(l.from.pathPrefix,"/")||"/"})},l.from.pathPrefix),e.jsx(y,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),e.jsx(Jt,{},"divider")]})}bt.propTypes={hasPermission:r.bool};bt.defaultProps={hasPermission:!1};const yi=Me(bt,"mutate_blocklets"),Ci=Me(bt,"",Oe);function ji(t){const{inService:o}=Y();return o?e.jsx(Ci,{...t}):e.jsx(yi,{...t})}function vi({blocklet:t,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const s=gs(),{t:a}=z(),n=f.useRef(null),i=f.useMemo(()=>{if(!t||!t.optionalComponents)return null;const m=new URLSearchParams(window.location.search),l=m.get("install-component");if(l){n.current=l,m.delete("install-component"),s(m.toString());const u=t.optionalComponents.find(g=>g.meta.did===l);if(!u)return N.success(a("notification.installComponentError",{did:l})),null;const{meta:h}=u;if(o){const g=document.getElementById(`optional-component-${l}`),p=document.querySelector(".dashboard-main");if(g){const S=g.getBoundingClientRect(),d=p.getBoundingClientRect();p.scrollTo({top:S.top-d.top+p.scrollTop,behavior:"smooth"})}}return h}return null},[t,s,a,o]);return f.useEffect(()=>{var m;n.current&&window.opener&&window.opener.postMessage({blocklet:t,kind:"component-installer"},(m=window.blocklet)==null?void 0:m.appUrl)},[t]),i}function wn({component:t,remove:o,disabled:s,tip:a,showConfirm:n,hideBtn:i,onCancel:m}){const{t:l}=f.useContext(Ce),[u,h]=f.useState(!1),[g,p]=f.useState(null),S=async b=>{h(!0),await o(b.component,b.removeType),h(!1),p(null)},d=s||u,R=()=>{p({title:`${l("common.delete")} ${t.meta.title||t.meta.name}`,description:(b,c)=>e.jsxs(ee,{component:"div",children:[e.jsx(ee,{gutterBottom:!0,children:l("blocklet.action.removeComponentDescription")}),e.jsxs(Sr,{name:"removeType",value:b.removeType,onChange:v=>c({...b,removeType:v.target.value}),children:[e.jsx(zt,{value:"keepData",control:e.jsx(oo,{}),label:l("blocklet.action.removeComponentKeepData")}),e.jsx(zt,{value:"complete",control:e.jsx(oo,{}),label:l("blocklet.action.removeComponentComplete")})]})]}),confirm:l("common.confirm"),cancel:l("common.cancel"),params:{component:t,removeType:"keepData"},onConfirm:S,onCancel:()=>{p(null),m()}})};f.useEffect(()=>{n?R():(h(!1),p(null))},[n]);const C=e.jsx(Si,{size:"small",disabled:d,onClick:()=>R,"data-cy":"delete-component-btn",children:e.jsx(Ct,{disabled:d})}),x=e.jsx(ve,{title:a||l("common.delete"),children:e.jsx("span",{children:C})});return e.jsxs(e.Fragment,{children:[!i&&x,g&&e.jsx(Fe,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}wn.propTypes={component:r.object.isRequired,remove:r.func,onCancel:r.func,disabled:r.bool,showConfirm:r.bool,hideBtn:r.bool,tip:r.string};wn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const Si=F($)`
392
+ `;function Rn({blocklet:t,children:o}){const{t:s}=z(),[a,n]=f.useState(!1),i=m=>{m.stopPropagation(),n(!0)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({open:i}):e.jsxs(ge,{onClick:i,className:"component-action","data-cy":"action-add-component",children:[e.jsx(Qt,{style:{fontSize:18,marginRight:5}}),s("blocklet.component.add")]}),e.jsx(St,{showDialog:a,setShowDialog:n,blocklet:t})]})}Rn.propTypes={children:r.any,blocklet:r.object.isRequired};Rn.defaultProps={children:null};const Ci=t=>t.children.filter(o=>o.meta.interfaces.find(s=>s.type===J.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:t,setParams:o,setError:s,serviceTypes:a}){const{t:n}=z(),{blocklet:i}=te(),m=i.meta.did,l=Ci(i),[u,h]=f.useState([]),g={301:n("common.redirectPermanently"),302:n("common.redirectTemporary"),307:n("common.redirectTemporary"),308:n("common.redirectPermanently")};return f.useEffect(()=>{if(t.type===B.ROUTING_RULE_TYPES.COMPONENT&&t.componentId){const p=l.find(R=>R.meta.did===t.componentId),S=O.findWebInterface(p.meta),d=(Array.isArray(S==null?void 0:S.pageGroups)?S.pageGroups:[]).map(R=>({value:R,label:`${R} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),h(d),t.pageGroup&&d.find(R=>R.value===t.pageGroup)===!1&&o({...t,pageGroups:""})}},[t.componentId,t.type]),e.jsxs(e.Fragment,{children:[e.jsx(Z,{select:!0,label:n("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:t.type,onChange:p=>{s(""),o({...t,type:p.target.value,did:p.target.value===B.ROUTING_RULE_TYPES.BLOCKLET?m:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:p,value:S})=>e.jsx(ge,{value:S,children:p},S))}),t.type===B.ROUTING_RULE_TYPES.REDIRECT&&[e.jsx(Z,{select:!0,label:n("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:t.redirectCode,onChange:p=>o({...t,redirectCode:p.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(g).map(p=>e.jsx(ge,{value:p,children:`${g[p]} - ${p}`},p))},"redirectCode"),e.jsx(Z,{label:n("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{o({...t,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?s(""):s(n("router.validation.redirectUrlRequired"))}},"redirectUrl")],t.type===B.ROUTING_RULE_TYPES.COMPONENT&&[e.jsx(Z,{select:!0,label:n("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:t.componentId,onChange:p=>{o({...t,componentId:p.target.value})},style:{marginBottom:32},SelectProps:{},children:l.map(p=>e.jsx(ge,{value:p.meta.did,selected:p.meta.did===t.componentId,children:O.getDisplayName(p,!0)},p.meta.did))},"componentId"),u.length?e.jsx(Z,{select:!0,label:n("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:t.pageGroup,helperText:n("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{o({...t,pageGroup:p.target.value})},SelectProps:{},children:u.map(p=>e.jsx(ge,{value:p.value,selected:p.value===t.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),t.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(Z,{label:n("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,url:p.target.value,__disableConfirm:!S}),s(S?"":n("router.validation.rewriteUrlRequired"))}},"url"),t.type===B.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[e.jsx(Z,{select:!0,label:n("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:t.responseType,onChange:p=>o({...t,responseType:p.target.value}),style:{marginBottom:32},SelectProps:{},children:B.ROUTING_RESPONSE_TYPES.map(p=>e.jsx(ge,{value:p.value,children:p.text},p.value))},"responseType"),e.jsx(Z,{label:n("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:t.responseBody,helperText:n("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,responseBody:p.target.value,__disableConfirm:!S}),s(S?"":n("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:r.object,serviceTypes:r.array,setParams:r.func,setError:r.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:B.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:B.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:B.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:B.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:B.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function bn({children:t,hiddenChildren:o,open:s,onClose:a}){const{t:n}=z(),{api:i}=K(),{blocklet:m}=te(),[l,u]=f.useState(!1),[h,g]=f.useState(!1),p=m.meta.did,S=m.site.id,d=()=>{a==null||a(),u(!1),g(!1)},R=async c=>{try{const v=await ut(c,n);if(v)throw v;u(!0);const j={from:{pathPrefix:ue(c.pathPrefix)},to:{type:c.type}};c.type===B.ROUTING_RULE_TYPES.REDIRECT&&(j.to.url=c.url.trim(),j.to.redirectCode=c.redirectCode),c.type===B.ROUTING_RULE_TYPES.COMPONENT&&(j.to.did=p,j.to.componentId=c.componentId,j.to.pageGroup=c.pageGroup),c.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(j.to.url=ue(c.url)),c.type===B.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(j.to.response={status:200,contentType:c.responseType,body:c.responseBody}),await i.addRoutingRule({input:{id:S,rule:j,teamDid:p}})}catch(v){N.error(v.message)}finally{u(!1),g(!1)}},C={title:n("router.rule.add.title"),description:(c,v,j)=>{const T=k=>{if(j(null),ut(k,n)){v({...k,__disableConfirm:!0});return}v({...k})};return e.jsxs(ee,{component:"div",children:[e.jsx(Z,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:c.pathPrefixHint||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:c.pathPrefix,onChange:k=>{let U=!1;const L=Eo({params:{...c,pathPrefix:k.target.value},blocklets:[m]});j(L),c.type===B.ROUTING_RULE_TYPES.BLOCKLET&&L&&(U=!0),c.type===B.ROUTING_RULE_TYPES.REDIRECT&&!c.url&&(U=!0),c.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!c.url&&(U=!0),c.type===B.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!c.responseType||!c.responseBody)&&(U=!0),k.target.value.trim()||(U=!0,j(n("router.validation.pathPrefixRequired"))),U||j("");const I=n("common.slugifyHint",{value:gt(k.target.value)});v({...c,pathPrefix:k.target.value,pathPrefixHint:I,__disableConfirm:U})}}),e.jsx(Rt,{params:c,setParams:T,setError:j})]})},confirm:n("router.rule.add.confirm"),cancel:n("common.cancel"),params:{did:"",pathPrefix:"",type:B.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:R,onCancel:d},x=c=>{c.stopPropagation(),g(!0)};let b=null;return o||(b=typeof t=="function"?t({open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-add-rule",children:[l?e.jsx(ie,{size:16}):e.jsx(Qt,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[b,(s||h)&&e.jsx(Fe,{title:C.title,description:C.description,confirm:C.confirm,cancel:C.cancel,params:C.params,onConfirm:C.onConfirm,onCancel:C.onCancel,color:"primary"})]})}bn.propTypes={children:r.any,onClose:r.func,hiddenChildren:r.bool,open:r.bool};bn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function En({id:t,from:o,children:s}){const{t:a}=z(),{api:n}=K(),{blocklet:i}=te(),[m,l]=f.useState(!1),[u,h]=f.useState(null),g=i.meta.did,p=i.site.id,S=o.pathPrefix,d=()=>{l(!1),h(null)},R=async()=>{l(!0);try{await n.deleteRoutingRule({input:{id:p,ruleId:t,teamDid:g}})}catch(b){N.error(b.message)}finally{h(null),l(!1)}},C={keyName:S,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${S}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:S}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:R,onCancel:d},x=b=>{b.stopPropagation(),h(C)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({loading:m,open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-delete-rule",children:[m?e.jsx(ie,{size:16}):e.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),u&&e.jsx(Sr,{keyName:u.keyName,title:u.title,description:u.description,confirmPlaceholder:u.confirmPlaceholder,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}En.propTypes={id:r.string.isRequired,from:r.object.isRequired,children:r.any};En.defaultProps={children:null};function Tn({id:t,from:o,to:s,children:a}){var c,v;const{t:n}=z(),{api:i}=K(),{blocklet:m}=te(),[l,u]=f.useState(!1),[h,g]=f.useState(null),p=m.meta.did,S=m.site.id,d=o.pathPrefix,R=()=>{u(!1),g(null)},C=async j=>{try{const T=await ut(j,n);if(T)throw T;u(!0);const k={id:t,from:{pathPrefix:ue(j.pathPrefix)},to:{type:j.type}};j.type===B.ROUTING_RULE_TYPES.REDIRECT&&(k.to.url=j.url,k.to.redirectCode=j.redirectCode),j.type===B.ROUTING_RULE_TYPES.COMPONENT&&(k.to.did=p,k.to.componentId=j.componentId,k.to.pageGroup=j.pageGroup),j.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(k.to.url=ue(j.url)),j.type===B.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(k.to.response={status:200,contentType:j.responseType,body:j.responseBody}),await i.updateRoutingRule({input:{id:S,rule:k,teamDid:p}})}catch(T){N.error(T.message)}finally{u(!1),g(null)}},x={title:n("router.rule.update.title"),description:(j,T,k)=>{const U=L=>{if(ut(L,n)){T({...L,__disableConfirm:!0});return}T({...L})};return e.jsxs(ee,{component:"div",children:[e.jsx(Z,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:j.helperText||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:j.pathPrefix,onChange:L=>{let I=!1;j.type===B.ROUTING_RULE_TYPES.REDIRECT&&!j.url&&(I=!0),j.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!j.url&&(I=!0),j.type===B.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!j.responseType||!j.responseBody)&&(I=!0),L.target.value.trim()||(I=!0,k(n("router.validation.pathPrefixRequired"))),I||k("");const M=n("common.slugifyHint",{value:gt(L.target.value)});T({...j,pathPrefix:L.target.value,helperText:M,__disableConfirm:I})}}),e.jsx(Rt,{params:j,setParams:U,setError:k})]})},confirm:n("router.rule.update.confirm"),cancel:n("router.rule.update.cancel"),color:"primary",params:{did:s.did||"",pathPrefix:d==="/"?d:d.replace(/^\/+/,"").replace(/\/+$/,""),type:s.type||B.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:s.redirectCode||302,componentId:s.componentId||"",pageGroup:s.pageGroup||"",url:s.url||"",responseType:((c=s.response)==null?void 0:c.contentType)||"",responseBody:(((v=s.response)==null?void 0:v.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:C,onCancel:R},b=j=>{j.stopPropagation(),g(x)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:l,open:b}):e.jsxs(ge,{onClick:b,className:"rule-action","data-cy":"action-update-rule",children:[l?e.jsx(ie,{size:16}):e.jsx(So,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),h&&e.jsx(Fe,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Tn.propTypes={id:r.string.isRequired,from:r.object.isRequired,to:r.object.isRequired,children:r.any};Tn.defaultProps={children:null};function wn(t){const{locale:o}=z(),{blocklet:s,recommendedDomain:a}=te(),n=jo(a,t.from.pathPrefix,Kt(s,o));return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:n,rel:"noopener noreferrer",title:n,children:e.jsx($,{size:"small",children:e.jsx(To,{})})}),e.jsx(Tn,{...t,children:({open:i})=>e.jsx($,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-update-rule",children:e.jsx(Yt,{})})}),e.jsx(En,{...t,children:({open:i})=>e.jsx($,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-delete-rule",children:e.jsx(Ct,{})})})]})}wn.propTypes={isProtected:r.bool};wn.defaultProps={isProtected:!1};function Oo({group:t,...o}){return t?e.jsx(Ze,{type:"reverse",...o,children:t}):null}Oo.propTypes={group:r.string.isRequired};function ft({domain:t,isHttps:o,toUrl:s}){const a=o?"https":"http";let n=s;return xs(n)||(n=`${a}://${t}${s}`),e.jsx(yt,{href:n,target:"_blank",style:{fontSize:14},underline:"hover",children:s},n)}ft.propTypes={domain:r.string.isRequired,toUrl:r.string.isRequired,isHttps:r.bool};ft.defaultProps={isHttps:!1};function bt({hasPermission:t}){const{t:o,locale:s}=z(),a=go(),{blocklet:n,recommendedDomain:i}=te();return n.site.rules.filter(l=>l.to.type!==B.ROUTING_RULE_TYPES.BLOCKLET).map(l=>{var p;let u=null,h=null;l.to.type===B.ROUTING_RULE_TYPES.NONE?u="404":l.to.type===B.ROUTING_RULE_TYPES.REDIRECT?u=l.to.redirectCode:l.to.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE?u="R":l.to.type===B.ROUTING_RULE_TYPES.DIRECT_RESPONSE?u=e.jsx(Pr,{sx:{color:"text.secondary",fontSize:"45px"}}):l.to.type===B.ROUTING_RULE_TYPES.COMPONENT&&(h=n.children.find(S=>S.meta.did===l.to.componentId),u="C");const g=l.isProtected?e.jsx(ve,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:e.jsx("span",{children:e.jsx($,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:e.jsx(vr,{style:{fill:a.palette.text.disabled}})})})}):e.jsx(wn,{...l});return[e.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(y,{className:"component-item__indent",width:28}),typeof u=="object"?u:e.jsx(hs,{children:u}),e.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[e.jsxs(y,{style:{color:"#222",fontSize:16},children:[l.to.type===B.ROUTING_RULE_TYPES.NONE&&o("common.page404"),l.to.type===B.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),l.to.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),l.to.type===B.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((p=B.ROUTING_RESPONSE_TYPES.find(S=>S.value===l.to.response.contentType))==null?void 0:p.text),l.to.type===B.ROUTING_RULE_TYPES.COMPONENT&&O.getDisplayName(h,!0)]}),e.jsxs(y,{display:"flex",alignItems:"center",children:[l.to.type===B.ROUTING_RULE_TYPES.REDIRECT&&e.jsx(ft,{domain:i,toUrl:l.to.url}),l.to.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(ft,{domain:i,toUrl:l.to.url}),l.to.type===B.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(Oo,{group:l.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(yt,{href:jo(i,l.from.pathPrefix,Kt(n,s)),target:"_blank",style:{fontSize:16},underline:"hover",children:gs(l.from.pathPrefix,"/")||"/"})},l.from.pathPrefix),e.jsx(y,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),e.jsx(Jt,{},"divider")]})}bt.propTypes={hasPermission:r.bool};bt.defaultProps={hasPermission:!1};const ji=Me(bt,"mutate_blocklets"),vi=Me(bt,"",Oe);function Si(t){const{inService:o}=K();return o?e.jsx(vi,{...t}):e.jsx(ji,{...t})}function Ri({blocklet:t,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const s=ys(),{t:a}=z(),n=f.useRef(null),i=f.useMemo(()=>{if(!t||!t.optionalComponents)return null;const m=new URLSearchParams(window.location.search),l=m.get("install-component");if(l){n.current=l,m.delete("install-component"),s(m.toString());const u=t.optionalComponents.find(g=>g.meta.did===l);if(!u)return N.success(a("notification.installComponentError",{did:l})),null;const{meta:h}=u;if(o){const g=document.getElementById(`optional-component-${l}`),p=document.querySelector(".dashboard-main");if(g){const S=g.getBoundingClientRect(),d=p.getBoundingClientRect();p.scrollTo({top:S.top-d.top+p.scrollTop,behavior:"smooth"})}}return h}return null},[t,s,a,o]);return f.useEffect(()=>{var m;n.current&&window.opener&&window.opener.postMessage({blocklet:t,kind:"component-installer"},(m=window.blocklet)==null?void 0:m.appUrl)},[t]),i}function Pn({component:t,remove:o,disabled:s,tip:a,showConfirm:n,hideBtn:i,onCancel:m}){const{t:l}=f.useContext(Ce),[u,h]=f.useState(!1),[g,p]=f.useState(null),S=async b=>{h(!0),await o(b.component,b.removeType),h(!1),p(null)},d=s||u,R=()=>{p({title:`${l("common.delete")} ${t.meta.title||t.meta.name}`,description:(b,c)=>e.jsxs(ee,{component:"div",children:[e.jsx(ee,{gutterBottom:!0,children:l("blocklet.action.removeComponentDescription")}),e.jsxs(br,{name:"removeType",value:b.removeType,onChange:v=>c({...b,removeType:v.target.value}),children:[e.jsx(Vt,{value:"keepData",control:e.jsx(so,{}),label:l("blocklet.action.removeComponentKeepData")}),e.jsx(Vt,{value:"complete",control:e.jsx(so,{}),label:l("blocklet.action.removeComponentComplete")})]})]}),confirm:l("common.confirm"),cancel:l("common.cancel"),params:{component:t,removeType:"keepData"},onConfirm:S,onCancel:()=>{p(null),m()}})};f.useEffect(()=>{n?R():(h(!1),p(null))},[n]);const C=e.jsx(bi,{size:"small",disabled:d,onClick:()=>R,"data-cy":"delete-component-btn",children:e.jsx(Ct,{disabled:d})}),x=e.jsx(ve,{title:a||l("common.delete"),children:e.jsx("span",{children:C})});return e.jsxs(e.Fragment,{children:[!i&&x,g&&e.jsx(Fe,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}Pn.propTypes={component:r.object.isRequired,remove:r.func,onCancel:r.func,disabled:r.bool,showConfirm:r.bool,hideBtn:r.bool,tip:r.string};Pn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const bi=F($)`
393
393
  &.Mui-disabled {
394
394
  opacity: 0.5;
395
395
  }
396
- `;function Pn({component:t,onStart:o,onStop:s,disabled:a,tip:n}){const{t:i}=f.useContext(Ce),[m,l]=f.useState(!1),[u,h]=f.useState(),g=async()=>{l(!0);try{await o(t)}catch(x){N.error(x.message)}l(!1)},p=async()=>{l(!0);try{await s(t)}catch(x){N.error(x.message)}l(!1)},S=a||m,d=["starting","running","stopping"].includes(t.status),R=d?Bs:As,C=e.jsx(Ri,{disabled:S,onClick:()=>{var x;d?h({title:`${i("common.stop")} ${(x=t==null?void 0:t.meta)==null?void 0:x.title}`,description:i("blocklet.action.stopComponentDescription"),confirm:i("blocklet.action.confirmStop"),cancel:i("common.cancel"),onConfirm:()=>(h(null),p()),onCancel:()=>h(null)}):g()},"data-cy":`${d?"stop":"start"}-component-btn`,children:e.jsx(R,{disabled:S})});return[e.jsx(ve,{title:n||i(`common.${d?"stop":"start"}`),children:e.jsx("span",{children:C})},"btn"),u&&e.jsx(Fe,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"connect")]}Pn.propTypes={component:r.object.isRequired,onStart:r.func,onStop:r.func,disabled:r.bool,tip:r.string};Pn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const Ri=F($)`
396
+ `;function kn({component:t,onStart:o,onStop:s,disabled:a,tip:n}){const{t:i}=f.useContext(Ce),[m,l]=f.useState(!1),[u,h]=f.useState(),g=async()=>{l(!0);try{await o(t)}catch(x){N.error(x.message)}l(!1)},p=async()=>{l(!0);try{await s(t)}catch(x){N.error(x.message)}l(!1)},S=a||m,d=["starting","running","stopping"].includes(t.status),R=d?Ns:Ls,C=e.jsx(Ei,{disabled:S,onClick:()=>{var x;d?h({title:`${i("common.stop")} ${(x=t==null?void 0:t.meta)==null?void 0:x.title}`,description:i("blocklet.action.stopComponentDescription"),confirm:i("blocklet.action.confirmStop"),cancel:i("common.cancel"),onConfirm:()=>(h(null),p()),onCancel:()=>h(null)}):g()},"data-cy":`${d?"stop":"start"}-component-btn`,children:e.jsx(R,{disabled:S})});return[e.jsx(ve,{title:n||i(`common.${d?"stop":"start"}`),children:e.jsx("span",{children:C})},"btn"),u&&e.jsx(Fe,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"connect")]}kn.propTypes={component:r.object.isRequired,onStart:r.func,onStop:r.func,disabled:r.bool,tip:r.string};kn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const Ei=F($)`
397
397
  &.Mui-disabled {
398
398
  opacity: 0.5;
399
399
  }
400
- `;function kn({sourceInfo:t,blocklet:o}){var a;const{t:s}=f.useContext(Ce);return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(xs,{type:"success",children:er(t.source)},"source"),t.source==="registry"&&e.jsx(yt,{href:we(t.deployedFrom,"blocklets",((a=o==null?void 0:o.meta)==null?void 0:a.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:s("blocklet.overview.viewInStore")})]})}kn.propTypes={sourceInfo:r.shape({source:r.string,deployedFrom:r.string}),blocklet:r.object};kn.defaultProps={sourceInfo:{},blocklet:{}};var In={},bi=_t;Object.defineProperty(In,"__esModule",{value:!0});var Lo=In.default=void 0,Ei=bi(Vt()),Ti=e;Lo=In.default=(0,Ei.default)((0,Ti.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Et({blocklet:t,checkUpgrade:o,hasPermission:s,...a}){const{api:n}=Y(),{t:i}=f.useContext(Ce),[m,l]=f.useState(!1),[u,h]=f.useState(""),[g,p]=f.useState(null),[S,d]=f.useState(null);f.useEffect(()=>{p(null),o&&(t.mode,X.BLOCKLET_MODES.DEVELOPMENT)},[t,o]);const R=()=>{l(!1),d(null)},C=async()=>{l(!0);try{const b={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ye(2e3),await n.upgradeBlocklet({input:b})}catch(b){N.error(`Blocklet upgrade failed: ${Z(b)}`)}finally{l(!1),d(null)}},x={title:`${i("common.upgrade")} ${i("common.blocklet")} ${O.getDisplayName(t)}`,description:i("blocklet.action.upgradeDescription"),confirm:i("blocklet.action.confirmUpgrade"),cancel:i("common.cancel"),onConfirm:C,onCancel:R};return s&&g&&!O.isInProgress(t.status)?e.jsxs(e.Fragment,{children:[e.jsx(Qe,{...a,children:t.meta.version}),e.jsx(ve,{title:i("common.updateAvailable",{version:g.version}),children:e.jsx($,{size:"small",style:{marginLeft:8},disabled:m,onClick:()=>d(x),children:m?e.jsx(ie,{size:16}):e.jsx(Lo,{style:{fontSize:16,color:"red"}})})}),!!u&&e.jsx(N,{variant:"error",message:u,onClose:()=>h("")}),S&&e.jsx(Fe,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):e.jsx(Qe,{...a,children:t.meta.version})}Et.propTypes={blocklet:r.object.isRequired,checkUpgrade:r.bool,hasPermission:r.bool};Et.defaultProps={checkUpgrade:!1,hasPermission:!1};const wi=Me(Et,"mutate_blocklets"),Pi=Me(Et,"",Oe);function ki(t){const{inService:o}=Y();return o?e.jsx(Pi,{...t}):e.jsx(wi,{...t})}const Ii=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},Ui=(t,o)=>t?[{name:o("common.name"),value:t.displayName},{name:o("common.description"),value:t.description},{name:o("common.version"),value:e.jsx(Qe,{children:t.version})}]:[],Di=t=>{const{source:o,deployedFrom:s,bundleSource:a}=t;return o?{source:o,deployedFrom:s}:a?a.url?{source:"url",deployedFrom:s||Array.isArray(a.url)?a.url[0]:a.url}:a.store?{source:"registry",deployedFrom:s||Array.isArray(a.store)?a.store[0]:a.store}:{}:{source:"upload",deployedFrom:s}},Bi=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function Un({blocklet:t,depth:o,componentInfo:s,app:a,onClose:n}){var d,R;const{t:i,locale:m}=f.useContext(Ce),{deletingBlocklets:l}=Kt();let{status:u}=t;o===1&&l.includes(t.meta.did)&&(u="deleting");const h=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),g=C=>C.map(x=>x.name===i("common.did")||x.name===i("blocklet.appId")?e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name):e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:x.name,children:x.value},x.name)),p=s?Di(s):{},S=s?[{name:i("common.name"),value:O.getDisplayName(s,!0)},{name:i("common.version"),value:e.jsx(ki,{blocklet:s,checkUpgrade:!1})},{name:i("common.status"),value:e.jsx(Eo,{isResource:Ii(t),status:u,source:s.source,progress:t.progress})},t.status==="running"?{name:i("blocklet.startedAt"),value:At(t.startedAt,m)}:null,t.status!=="running"?{name:i("blocklet.stoppedAt"),value:At(t.stoppedAt,m)}:null,t.installedAt?{name:i("blocklet.installedAt"),value:At(t.installedAt,m)}:null,O.hasStartEngine(t.meta)?{name:i("common.mountPoint"),value:h}:null,s.meta.group?{name:i("common.group"),value:e.jsx(Qe,{type:"success",children:s.meta.group})}:null,{name:i("blocklet.overview.source"),value:e.jsx(kn,{sourceInfo:p,blocklet:t})},{name:i("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-"},{name:i("common.did"),value:e.jsx(ho,{did:s.meta.did,showQrcode:!0})},{name:i("common.author"),value:s.meta.owner?e.jsx(pr,{owner:s.meta.owner,locale:m}):ur.formatPerson(s.meta.author)},{name:i("common.engine"),value:Ui(s.engine,i).map(({name:C,value:x})=>e.jsx(Nt,{style:{marginBottom:4},nameWidth:120,name:C,children:x},C))},(d=t.dependents)!=null&&d.length?{name:i("common.dependents"),value:e.jsx(y,{children:t.dependents.map(C=>e.jsx(y,{children:`${Bi(C.id,a)} ${C.required?`(${i("common.required")})`:""}`},C.id))})}:null,(R=t.meta.resources)!=null&&R.length?{name:i("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return s?e.jsx(xt,{open:!0,title:i("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{n(null)},children:e.jsx(y,{paddingBottom:1.5,children:g(S)},"dialog-wrapper")},"base-info-dialog"):null}Un.propTypes={blocklet:r.object.isRequired,depth:r.number,app:r.object,componentInfo:r.object,onClose:r.func.isRequired};Un.defaultProps={depth:0,app:null,componentInfo:null};F(Co)`
400
+ `;function In({sourceInfo:t,blocklet:o}){var a;const{t:s}=f.useContext(Ce);return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(Cs,{type:"success",children:nr(t.source)},"source"),t.source==="registry"&&e.jsx(yt,{href:we(t.deployedFrom,"blocklets",((a=o==null?void 0:o.meta)==null?void 0:a.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:s("blocklet.overview.viewInStore")})]})}In.propTypes={sourceInfo:r.shape({source:r.string,deployedFrom:r.string}),blocklet:r.object};In.defaultProps={sourceInfo:{},blocklet:{}};var Un={},Ti=Wt;Object.defineProperty(Un,"__esModule",{value:!0});var Mo=Un.default=void 0,wi=Ti(_t()),Pi=e;Mo=Un.default=(0,wi.default)((0,Pi.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Et({blocklet:t,checkUpgrade:o,hasPermission:s,...a}){const{api:n}=K(),{t:i}=f.useContext(Ce),[m,l]=f.useState(!1),[u,h]=f.useState(""),[g,p]=f.useState(null),[S,d]=f.useState(null);f.useEffect(()=>{p(null),o&&(t.mode,J.BLOCKLET_MODES.DEVELOPMENT)},[t,o]);const R=()=>{l(!1),d(null)},C=async()=>{l(!0);try{const b={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ke(2e3),await n.upgradeBlocklet({input:b})}catch(b){N.error(`Blocklet upgrade failed: ${X(b)}`)}finally{l(!1),d(null)}},x={title:`${i("common.upgrade")} ${i("common.blocklet")} ${O.getDisplayName(t)}`,description:i("blocklet.action.upgradeDescription"),confirm:i("blocklet.action.confirmUpgrade"),cancel:i("common.cancel"),onConfirm:C,onCancel:R};return s&&g&&!O.isInProgress(t.status)?e.jsxs(e.Fragment,{children:[e.jsx(Ze,{...a,children:t.meta.version}),e.jsx(ve,{title:i("common.updateAvailable",{version:g.version}),children:e.jsx($,{size:"small",style:{marginLeft:8},disabled:m,onClick:()=>d(x),children:m?e.jsx(ie,{size:16}):e.jsx(Mo,{style:{fontSize:16,color:"red"}})})}),!!u&&e.jsx(N,{variant:"error",message:u,onClose:()=>h("")}),S&&e.jsx(Fe,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):e.jsx(Ze,{...a,children:t.meta.version})}Et.propTypes={blocklet:r.object.isRequired,checkUpgrade:r.bool,hasPermission:r.bool};Et.defaultProps={checkUpgrade:!1,hasPermission:!1};const ki=Me(Et,"mutate_blocklets"),Ii=Me(Et,"",Oe);function Ui(t){const{inService:o}=K();return o?e.jsx(Ii,{...t}):e.jsx(ki,{...t})}const Bi=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},Di=(t,o)=>t?[{name:o("common.name"),value:t.displayName},{name:o("common.description"),value:t.description},{name:o("common.version"),value:e.jsx(Ze,{children:t.version})}]:[],Ai=t=>{const{source:o,deployedFrom:s,bundleSource:a}=t;return o?{source:o,deployedFrom:s}:a?a.url?{source:"url",deployedFrom:s||Array.isArray(a.url)?a.url[0]:a.url}:a.store?{source:"registry",deployedFrom:s||Array.isArray(a.store)?a.store[0]:a.store}:{}:{source:"upload",deployedFrom:s}},Ni=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function Bn({blocklet:t,depth:o,componentInfo:s,app:a,onClose:n}){var d,R;const{t:i,locale:m}=f.useContext(Ce),{deletingBlocklets:l}=Zt();let{status:u}=t;o===1&&l.includes(t.meta.did)&&(u="deleting");const h=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),g=C=>C.map(x=>x.name===i("common.did")||x.name===i("blocklet.appId")?e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name):e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:x.name,children:x.value},x.name)),p=s?Ai(s):{},S=s?[{name:i("common.name"),value:O.getDisplayName(s,!0)},{name:i("common.version"),value:e.jsx(Ui,{blocklet:s,checkUpgrade:!1})},{name:i("common.status"),value:e.jsx(wo,{isResource:Bi(t),status:u,source:s.source,progress:t.progress})},t.status==="running"?{name:i("blocklet.startedAt"),value:At(t.startedAt,m)}:null,t.status!=="running"?{name:i("blocklet.stoppedAt"),value:At(t.stoppedAt,m)}:null,t.installedAt?{name:i("blocklet.installedAt"),value:At(t.installedAt,m)}:null,O.hasStartEngine(t.meta)?{name:i("common.mountPoint"),value:h}:null,s.meta.group?{name:i("common.group"),value:e.jsx(Ze,{type:"success",children:s.meta.group})}:null,{name:i("blocklet.overview.source"),value:e.jsx(In,{sourceInfo:p,blocklet:t})},{name:i("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-"},{name:i("common.did"),value:e.jsx(xo,{did:s.meta.did,showQrcode:!0})},{name:i("common.author"),value:s.meta.owner?e.jsx(mr,{owner:s.meta.owner,locale:m}):fr.formatPerson(s.meta.author)},{name:i("common.engine"),value:Di(s.engine,i).map(({name:C,value:x})=>e.jsx(Nt,{style:{marginBottom:4},nameWidth:120,name:C,children:x},C))},(d=t.dependents)!=null&&d.length?{name:i("common.dependents"),value:e.jsx(y,{children:t.dependents.map(C=>e.jsx(y,{children:`${Ni(C.id,a)} ${C.required?`(${i("common.required")})`:""}`},C.id))})}:null,(R=t.meta.resources)!=null&&R.length?{name:i("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return s?e.jsx(xt,{open:!0,title:i("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{n(null)},children:e.jsx(y,{paddingBottom:1.5,children:g(S)},"dialog-wrapper")},"base-info-dialog"):null}Bn.propTypes={blocklet:r.object.isRequired,depth:r.number,app:r.object,componentInfo:r.object,onClose:r.func.isRequired};Bn.defaultProps={depth:0,app:null,componentInfo:null};F(vo)`
401
401
  .BaseBadge-badge {
402
402
  top: ${t=>t.top*8||6}px;
403
403
  right: ${t=>t.right*8||6}px;
@@ -419,7 +419,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
419
419
  margin-left: 4px;
420
420
  transform: translateY(-1px);
421
421
  }
422
- `;function Oo({blocklet:t,ancestors:o,mountPoint:s,href:a}){const[n,i]=f.useState(!1),[m,l]=f.useState(!1),[u,h]=f.useState(!1),[g,p]=f.useState(s),{api:S}=Y(),d=!o.length,R=d?t.meta.did:o.map(c=>c.meta.did)[0];f.useEffect(()=>{l(!1),i(!1),h(!1)},[s]);const C=()=>{i(!1),l(!1),p(s)},x=async c=>{c.preventDefault(),h(!0),i(!1);try{const v={rootDid:R,mountPoint:ue(g)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw h(!1),v.message=Z(v),N.error(v.message),v}},b=m?e.jsxs(y,{sx:{ml:1},children:[e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"data-cy":"edit-mount-point-submit",onClick:x,children:e.jsx(y,{component:Pe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:C,children:e.jsx(y,{component:Pe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>l(!0),children:e.jsx(y,{component:Pe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:n?1:0,color:"primary.main",transition:"0.3s opacity"}})});return e.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[m?e.jsx("form",{onSubmit:x,children:e.jsx(K,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:c=>p(c.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:s})}):e.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:ys(s)})}),u?e.jsx(ie,{size:20,sx:{ml:1}}):b]},s)}Oo.propTypes={mountPoint:r.string.isRequired,href:r.string.isRequired,blocklet:r.object.isRequired,ancestors:r.array.isRequired};const Ai=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},po=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function ht({blocklet:t,ancestors:o,depth:s,onRemove:a,onStart:n,onStop:i,onRestart:m,getComponentUrl:l,app:u}){var q,Q,ke;const{t:h}=f.useContext(Ce),[g,p]=f.useState(),[S,d]=f.useState(!1),[R,C]=f.useState(!1),[x,b]=f.useState(null),[c,v]=f.useState(!1),{deletingBlocklets:j}=Kt();let{status:T}=t;s===1&&j.includes(t.meta.did)&&(T="deleting");const k=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),U=l(k),L=O.isInProgress(u.status),I=O.isInProgress(t.status);let M="";if(L||I||s===1&&j.includes(t.meta.did))M=h("blocklet.component.tip.stopBlocklet");else if((q=t.dependents)!=null&&q.length){const ne=t.dependents.filter(de=>de.required);if(ne.length){const de=ne.map(Se=>po(Se.id,u));M=h("blocklet.component.tip.requiredBy",{name:de.join(", ")})}}const B=async(...ne)=>{C(!0);try{await a(...ne)}catch{}C(!1),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(Dn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(Rr,{blocklet:t,ancestors:o}),e.jsxs(y,{ml:"16px",children:[e.jsxs(y,{className:"component-header",onClick:()=>p(t),children:[e.jsx(y,{className:"component-name",children:O.getDisplayName(t,!0)}),e.jsx(y,{className:"component-version",children:(Q=t==null?void 0:t.meta)==null?void 0:Q.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[T!=="unknown"&&e.jsx(Eo,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(mr,{style:{marginLeft:4},mode:t.mode||""}),!!((ke=t.dependents)!=null&&ke.length)&&e.jsx(ve,{title:[`${h("common.dependents")}: `,t.dependents.map(ne=>e.jsx(y,{pl:1,children:`${po(ne.id,u)} ${ne.required?`(${h("common.required")})`:""}`},ne.id))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]})]})]},t),Ft.hasMountPoint(t.meta)&&e.jsx(Oo,{blocklet:t,ancestors:o,mountPoint:k,href:U},k),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[O.hasStartEngine(t.meta)&&e.jsx(ve,{title:h("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:U,rel:"noopener noreferrer",children:e.jsx($,{size:"small",children:e.jsx(bo,{})})})}),e.jsx(Pn,{blocklet:u,component:t,onStart:n,onStop:i,disabled:!["starting","stopping"].includes(u.status)&&O.isInProgress(u.status)}),e.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(To,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||Ai(t)?{icon:e.jsx(vr,{}),text:h("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(Ns,{}),text:h("common.restart"),onClick:()=>{b({title:`${h("common.restart")} ${t.meta.title}`,description:h("blocklet.action.restartDescription"),confirm:h("blocklet.action.confirmRestart"),cancel:h("common.cancel"),onConfirm:async()=>{C(!0),await m(t),C(!1)},onCancel:()=>b(null)})},disabled:R||L||I||t.status!=="running"},{icon:e.jsx(Ct,{}),text:h("common.delete"),onClick:()=>{d(!0)},disabled:L||I||!!M,tip:M},{separator:!0},{icon:e.jsx(Yt,{}),onClick:()=>{v(!0)},text:e.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(y,{sx:{width:"100%"},children:h("common.config")})}),disabled:L||I}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Jt,{},"line"),e.jsx(Un,{componentInfo:g,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(wn,{blocklet:u,component:t,remove:B,onCancel:()=>d(!1),hideBtn:!0,showConfirm:S},"delete-component"),x&&e.jsx(Fe,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel},"confirm-setting"),c&&e.jsx(vt,{open:!0,hiddenChildren:!0,onClose:()=>v(!1),blocklet:t,ancestors:o})]})}ht.propTypes={blocklet:r.object.isRequired,ancestors:r.array,depth:r.number,onRemove:r.func,onStart:r.func,onStop:r.func,onRestart:r.func,getComponentUrl:r.func,app:r.object};ht.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const qt=F(Co)`
422
+ `;function Fo({blocklet:t,ancestors:o,mountPoint:s,href:a}){const[n,i]=f.useState(!1),[m,l]=f.useState(!1),[u,h]=f.useState(!1),[g,p]=f.useState(s),{api:S}=K(),d=!o.length,R=d?t.meta.did:o.map(c=>c.meta.did)[0];f.useEffect(()=>{l(!1),i(!1),h(!1)},[s]);const C=()=>{i(!1),l(!1),p(s)},x=async c=>{c.preventDefault(),h(!0),i(!1);try{const v={rootDid:R,mountPoint:ue(g)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw h(!1),v.message=X(v),N.error(v.message),v}},b=m?e.jsxs(y,{sx:{ml:1},children:[e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"data-cy":"edit-mount-point-submit",onClick:x,children:e.jsx(y,{component:Pe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:C,children:e.jsx(y,{component:Pe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>l(!0),children:e.jsx(y,{component:Pe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:n?1:0,color:"primary.main",transition:"0.3s opacity"}})});return e.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[m?e.jsx("form",{onSubmit:x,children:e.jsx(Z,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:c=>p(c.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:s})}):e.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:js(s)})}),u?e.jsx(ie,{size:20,sx:{ml:1}}):b]},s)}Fo.propTypes={mountPoint:r.string.isRequired,href:r.string.isRequired,blocklet:r.object.isRequired,ancestors:r.array.isRequired};const Li=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},mo=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function ht({blocklet:t,ancestors:o,depth:s,onRemove:a,onStart:n,onStop:i,onRestart:m,getComponentUrl:l,app:u}){var V,Q,ke;const{t:h}=f.useContext(Ce),[g,p]=f.useState(),[S,d]=f.useState(!1),[R,C]=f.useState(!1),[x,b]=f.useState(null),[c,v]=f.useState(!1),{deletingBlocklets:j}=Zt();let{status:T}=t;s===1&&j.includes(t.meta.did)&&(T="deleting");const k=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),U=l(k),L=O.isInProgress(u.status),I=O.isInProgress(t.status);let M="";if(L||I||s===1&&j.includes(t.meta.did))M=h("blocklet.component.tip.stopBlocklet");else if((V=t.dependents)!=null&&V.length){const ne=t.dependents.filter(de=>de.required);if(ne.length){const de=ne.map(Se=>mo(Se.id,u));M=h("blocklet.component.tip.requiredBy",{name:de.join(", ")})}}const D=async(...ne)=>{C(!0);try{await a(...ne)}catch{}C(!1),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(Dn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(Er,{blocklet:t,ancestors:o}),e.jsxs(y,{ml:"16px",children:[e.jsxs(y,{className:"component-header",onClick:()=>p(t),children:[e.jsx(y,{className:"component-name",children:O.getDisplayName(t,!0)}),e.jsx(y,{className:"component-version",children:(Q=t==null?void 0:t.meta)==null?void 0:Q.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[T!=="unknown"&&e.jsx(wo,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(hr,{style:{marginLeft:4},mode:t.mode||""}),!!((ke=t.dependents)!=null&&ke.length)&&e.jsx(ve,{title:[`${h("common.dependents")}: `,t.dependents.map(ne=>e.jsx(y,{pl:1,children:`${mo(ne.id,u)} ${ne.required?`(${h("common.required")})`:""}`},ne.id))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]})]})]},t),Gt.hasMountPoint(t.meta)&&e.jsx(Fo,{blocklet:t,ancestors:o,mountPoint:k,href:U},k),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[O.hasStartEngine(t.meta)&&e.jsx(ve,{title:h("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:U,rel:"noopener noreferrer",children:e.jsx($,{size:"small",children:e.jsx(To,{})})})}),e.jsx(kn,{blocklet:u,component:t,onStart:n,onStop:i,disabled:!["starting","stopping"].includes(u.status)&&O.isInProgress(u.status)}),e.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(Po,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||Li(t)?{icon:e.jsx(Rr,{}),text:h("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(Os,{}),text:h("common.restart"),onClick:()=>{b({title:`${h("common.restart")} ${t.meta.title}`,description:h("blocklet.action.restartDescription"),confirm:h("blocklet.action.confirmRestart"),cancel:h("common.cancel"),onConfirm:async()=>{C(!0),await m(t),C(!1)},onCancel:()=>b(null)})},disabled:R||L||I||t.status!=="running"},{icon:e.jsx(Ct,{}),text:h("common.delete"),onClick:()=>{d(!0)},disabled:L||I||!!M,tip:M},{separator:!0},{icon:e.jsx(Yt,{}),onClick:()=>{v(!0)},text:e.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(y,{sx:{width:"100%"},children:h("common.config")})}),disabled:L||I}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Jt,{},"line"),e.jsx(Bn,{componentInfo:g,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(Pn,{blocklet:u,component:t,remove:D,onCancel:()=>d(!1),hideBtn:!0,showConfirm:S},"delete-component"),x&&e.jsx(Fe,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel},"confirm-setting"),c&&e.jsx(vt,{open:!0,hiddenChildren:!0,onClose:()=>v(!1),blocklet:t,ancestors:o})]})}ht.propTypes={blocklet:r.object.isRequired,ancestors:r.array,depth:r.number,onRemove:r.func,onStart:r.func,onStop:r.func,onRestart:r.func,getComponentUrl:r.func,app:r.object};ht.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const qt=F(vo)`
423
423
  .BaseBadge-badge {
424
424
  top: ${t=>t.top*8||6}px;
425
425
  right: ${t=>t.right*8||6}px;
@@ -444,7 +444,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
444
444
  margin-left: 4px;
445
445
  transform: translateY(-1px);
446
446
  }
447
- `;function Bn({meta:t,dependencies:o,logoUrl:s,setInstallComponentMeta:a}){const n=Y(),{t:i}=z(),m=()=>{a(t)},l=40;return e.jsxs(Ni,{id:`optional-component-${t.did}`,children:[e.jsxs("div",{className:"cell",children:[e.jsxs("div",{className:"component-left",children:[e.jsx("img",{className:"component-logo",src:s,onError:()=>`${n.imgPrefix}/blocklet.png`,alt:t.title,style:{width:l,height:l}}),e.jsxs("div",{className:"component-header",children:[e.jsx("div",{className:"component-name",children:t.title}),e.jsx("div",{className:"component-version",children:t.version})]}),e.jsx(ve,{title:[`${i("common.dependents")}: `,o.map(u=>e.jsx(y,{pl:1,children:`${u.parentTitle} ${u.required?`(${i("common.required")})`:""}`},u.parentName+u.mount_point))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]}),e.jsx("div",{style:{flex:1}}),e.jsx(Cs,{onClick:m,startIcon:e.jsx(Pe,{icon:"ph:download-simple-bold"}),children:i("common.install")})]}),e.jsx(Jt,{class:"line"},"line")]})}Bn.propTypes={meta:r.object.isRequired,logoUrl:r.string,setInstallComponentMeta:r.func.isRequired,dependencies:r.arrayOf(r.shape({parentDid:r.string,parentName:r.string,parentPoint:r.string,required:r.bool}))};Bn.defaultProps={logoUrl:"",dependencies:[]};const Ni=F(Dn)`
447
+ `;function An({meta:t,dependencies:o,logoUrl:s,setInstallComponentMeta:a}){const n=K(),{t:i}=z(),m=()=>{a(t)},l=40;return e.jsxs(Oi,{id:`optional-component-${t.did}`,children:[e.jsxs("div",{className:"cell",children:[e.jsxs("div",{className:"component-left",children:[e.jsx("img",{className:"component-logo",src:s,onError:()=>`${n.imgPrefix}/blocklet.png`,alt:t.title,style:{width:l,height:l}}),e.jsxs("div",{className:"component-header",children:[e.jsx("div",{className:"component-name",children:t.title}),e.jsx("div",{className:"component-version",children:t.version})]}),e.jsx(ve,{title:[`${i("common.dependents")}: `,o.map(u=>e.jsx(y,{pl:1,children:`${u.parentTitle} ${u.required?`(${i("common.required")})`:""}`},u.parentName+u.mount_point))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]}),e.jsx("div",{style:{flex:1}}),e.jsx(vs,{onClick:m,startIcon:e.jsx(Pe,{icon:"ph:download-simple-bold"}),children:i("common.install")})]}),e.jsx(Jt,{class:"line"},"line")]})}An.propTypes={meta:r.object.isRequired,logoUrl:r.string,setInstallComponentMeta:r.func.isRequired,dependencies:r.arrayOf(r.shape({parentDid:r.string,parentName:r.string,parentPoint:r.string,required:r.bool}))};An.defaultProps={logoUrl:"",dependencies:[]};const Oi=F(Dn)`
448
448
  .line {
449
449
  opacity: 0.5;
450
450
  }
@@ -490,7 +490,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
490
490
  margin-left: 4px;
491
491
  transform: translateY(-1px);
492
492
  }
493
- `;function An({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var V;const{t:n}=f.useContext(Ce),{api:i,inService:m,info:l}=Y(),{addDeletingDid:u,removeDeletingDid:h,matchDeletingDid:g}=Kt(),[p,S]=f.useState(!1),[d,R]=f.useState(null),[C,x]=f.useState(null),[b,c]=f.useState(!1),[v,j]=f.useState(!1),[T,k]=f.useState(!1),[U,L]=f.useState(null),I=t&&t.structVersion!==D.APP_STRUCT_VERSION,[M,B]=f.useState(!1),q=[...t.children];t.meta.group!=="gateway"&&q.unshift(t),g(q.map(w=>w.meta.did));const Q=async()=>{if(!p){S(!0);try{const{updateId:w,updateList:_}=(await i.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!w){N.info(n("blocklet.component.noUpdate"));return}const se=[];O.forEachChildSync(t,(re,{id:Ge,ancestors:J})=>{const H=_.find(Re=>Re.id===Ge);if(H){const Re=J.slice(1).concat(re).map(Ue=>Ue.meta.title||Ue.meta.name).join(" / "),ze=(J[1]||re).meta.did;se.push({groupId:ze,name:Re,version:re.meta.version,newVersion:H.meta.version})}});const xe={};se.forEach(re=>{xe[re.groupId]?re.disabled=!0:xe[re.groupId]=!0}),R({params:{updateId:w},list:se,checks:xe,hasChecks:!0})}catch(w){S(!1),N.error(Z(w))}}},ke=async()=>{if(!p)try{S(!0);const w=Object.keys(d.checks).filter(se=>d.checks[se]),_={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:w};await i.upgradeComponents({input:_}),S(!1),R(null),B(null)}catch(w){S(!1),N.error(Z(w))}},ne=async(w,_)=>{u(w.meta.did);try{await i.deleteComponent({input:{did:w.meta.did,keepData:_==="keepData",rootDid:t.meta.did}}),await Ye(800)}catch(se){N.error(Z(se)),h(w.meta.did)}},de=async w=>{try{await i.startBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){N.error(Z(_))}},Se=async w=>{try{await i.stopBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){N.error(Z(_))}},P=async w=>{try{await i.restartBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){N.error(Z(_))}},Ie=(w,_)=>{const{checked:se}=w.target;R(xe=>{const re=Object.entries(xe.checks).reduce((J,[H,Re])=>(J[H]=_===H?se:Re,J),{}),Ge=Object.values(re).includes(!0);return{...xe,checks:re,hasChecks:Ge}})};js(Q);const me=vi({blocklet:t,scrollToComponent:!0}),Ze=U||me;return e.jsxs(Li,{component:"div",...a,children:[e.jsxs(Oi,{display:"flex",children:[e.jsxs(Mi,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[q!=null&&q.length?`${n("common.components")} (${q.length})`:`${n("common.components")}`,!I&&e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsx(Xt,{children:e.jsx($t,{children:e.jsx(qt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!M,children:e.jsxs(oe,{disabled:p||O.isInProgress(t.status),color:"secondary",onClick:()=>{Q()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:p?e.jsx(ie,{size:16}):e.jsx(wo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})})]}),e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!I&&e.jsx(Sn,{blocklet:t,serverVersion:l.version,children:({open:w})=>e.jsxs(oe,{disabled:p||O.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:w,children:[e.jsx(bs,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(To,{"data-cy":"component-actions",actions:[{icon:e.jsx(Pe,{icon:"fluent:link-20-filled"}),onClick:()=>j(!0),text:n("router.rule.add.title"),disabled:p||O.isInProgress(t.status)},!I&&{icon:e.jsx(Yt,{}),text:`${n("blocklet.component.container")}`,onClick:()=>k(!0)}].filter(Boolean)})]})})]}),q!=null&&q.length?e.jsxs(e.Fragment,{children:[e.jsxs(y,{mt:2,children:[t.meta.group!=="gateway"&&e.jsx(ht,{blocklet:t,app:t,onRemove:ne,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`0-${t.meta.did}`),t.children.map(w=>e.jsx(ht,{depth:1,blocklet:w,ancestors:[t],app:t,onRemove:ne,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`1-${w.meta.did}`))]},`top-blocklet-${t.meta.did}`),(V=t.optionalComponents)==null?void 0:V.map(w=>e.jsx(Dn,{children:e.jsx(Bn,{setInstallComponentMeta:L,...w})},w.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(Us,{children:n("blocklet.component.noComponent")})}),!!t.site.rules.length&&e.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:e.jsx(ji,{})}),!!d&&e.jsx(Jn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Kn,{children:n("blocklet.component.updateTitle")}),e.jsx(y,{component:Qn,py:4,children:d.list.map(w=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(vs,{checked:d.checks[w.groupId],onChange:_=>Ie(_,w.groupId),style:{marginLeft:w.disabled?16:0},defaultChecked:!0,disabled:w.disabled}),e.jsxs(y,{flexGrow:1,mt:3,children:[e.jsx(y,{item:!0,xs:8,children:w.name}),w.version&&e.jsxs(at,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(at,{item:!0,xs:3,children:w.version}),e.jsx(at,{item:!0,xs:1,children:e.jsx(Is,{style:{fontSize:"0.9em"}})}),e.jsx(at,{item:!0,xs:3,children:e.jsx(y,{color:"secondary.main",children:w.newVersion})})]})]},`${w.name}-${w.newVersion}`)]},w.name))}),e.jsxs(Ss,{style:{padding:"8px 24px 24px"},children:[e.jsx(oe,{onClick:()=>{R(null)},children:n("common.cancel")}),e.jsxs(oe,{onClick:w=>{w.stopPropagation(),ke()},color:"primary",disabled:p||!d.hasChecks,variant:"contained",autoFocus:!0,children:[p&&e.jsx(ie,{size:16}),n("common.update")]})]})]})}),!!C&&e.jsx(Jn,{open:!0,fullWidth:!0,onClose:()=>x(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Kn,{children:n("common.configuration")}),e.jsx(Qn,{children:e.jsx(y,{py:2,children:e.jsx(zt,{control:e.jsx(br,{checked:b,onChange:w=>c(!!w.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(St,{selectedMeta:Ze,blocklet:t,showDialog:!!Ze,setShowDialog:()=>L(null)}),v&&e.jsx(Rn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(vt,{open:!0,onClose:()=>k(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}An.propTypes={blocklet:r.object.isRequired,onUpdate:r.func,getComponentUrl:r.func};An.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Li=F.div`
493
+ `;function Nn({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var q;const{t:n}=f.useContext(Ce),{api:i,inService:m,info:l}=K(),{addDeletingDid:u,removeDeletingDid:h,matchDeletingDid:g}=Zt(),[p,S]=f.useState(!1),[d,R]=f.useState(null),[C,x]=f.useState(null),[b,c]=f.useState(!1),[v,j]=f.useState(!1),[T,k]=f.useState(!1),[U,L]=f.useState(null),I=t&&t.structVersion!==B.APP_STRUCT_VERSION,[M,D]=f.useState(!1),V=[...t.children];t.meta.group!=="gateway"&&V.unshift(t),g(V.map(w=>w.meta.did));const Q=async()=>{if(!p){S(!0);try{const{updateId:w,updateList:_}=(await i.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!w){N.info(n("blocklet.component.noUpdate"));return}const se=[];O.forEachChildSync(t,(re,{id:Ge,ancestors:Y})=>{const H=_.find(Re=>Re.id===Ge);if(H){const Re=Y.slice(1).concat(re).map(Ue=>Ue.meta.title||Ue.meta.name).join(" / "),ze=(Y[1]||re).meta.did;se.push({groupId:ze,name:Re,version:re.meta.version,newVersion:H.meta.version})}});const xe={};se.forEach(re=>{xe[re.groupId]?re.disabled=!0:xe[re.groupId]=!0}),R({params:{updateId:w},list:se,checks:xe,hasChecks:!0})}catch(w){S(!1),N.error(X(w))}}},ke=async()=>{if(!p)try{S(!0);const w=Object.keys(d.checks).filter(se=>d.checks[se]),_={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:w};await i.upgradeComponents({input:_}),S(!1),R(null),D(null)}catch(w){S(!1),N.error(X(w))}},ne=async(w,_)=>{u(w.meta.did);try{await i.deleteComponent({input:{did:w.meta.did,keepData:_==="keepData",rootDid:t.meta.did}}),await Ke(800)}catch(se){N.error(X(se)),h(w.meta.did)}},de=async w=>{try{await i.startBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(_){N.error(X(_))}},Se=async w=>{try{await i.stopBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(_){N.error(X(_))}},P=async w=>{try{await i.restartBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(_){N.error(X(_))}},Ie=(w,_)=>{const{checked:se}=w.target;R(xe=>{const re=Object.entries(xe.checks).reduce((Y,[H,Re])=>(Y[H]=_===H?se:Re,Y),{}),Ge=Object.values(re).includes(!0);return{...xe,checks:re,hasChecks:Ge}})};Ss(Q);const me=Ri({blocklet:t,scrollToComponent:!0}),Qe=U||me;return e.jsxs(Mi,{component:"div",...a,children:[e.jsxs(Fi,{display:"flex",children:[e.jsxs(Gi,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[V!=null&&V.length?`${n("common.components")} (${V.length})`:`${n("common.components")}`,!I&&e.jsx(Ft,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsx($t,{children:e.jsx(en,{children:e.jsx(qt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!M,children:e.jsxs(oe,{disabled:p||O.isInProgress(t.status),color:"secondary",onClick:()=>{Q()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:p?e.jsx(ie,{size:16}):e.jsx(ko,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})})]}),e.jsx(Ft,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!I&&e.jsx(Rn,{blocklet:t,serverVersion:l.version,children:({open:w})=>e.jsxs(oe,{disabled:p||O.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:w,children:[e.jsx(Ts,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(Po,{"data-cy":"component-actions",actions:[{icon:e.jsx(Pe,{icon:"fluent:link-20-filled"}),onClick:()=>j(!0),text:n("router.rule.add.title"),disabled:p||O.isInProgress(t.status)},!I&&{icon:e.jsx(Yt,{}),text:`${n("blocklet.component.container")}`,onClick:()=>k(!0)}].filter(Boolean)})]})})]}),V!=null&&V.length?e.jsxs(e.Fragment,{children:[e.jsxs(y,{mt:2,children:[t.meta.group!=="gateway"&&e.jsx(ht,{blocklet:t,app:t,onRemove:ne,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`0-${t.meta.did}`),t.children.map(w=>e.jsx(ht,{depth:1,blocklet:w,ancestors:[t],app:t,onRemove:ne,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`1-${w.meta.did}`))]},`top-blocklet-${t.meta.did}`),(q=t.optionalComponents)==null?void 0:q.map(w=>e.jsx(Dn,{children:e.jsx(An,{setInstallComponentMeta:L,...w})},w.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(Ds,{children:n("blocklet.component.noComponent")})}),!!t.site.rules.length&&e.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:e.jsx(Si,{})}),!!d&&e.jsx(Jn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Zn,{children:n("blocklet.component.updateTitle")}),e.jsx(y,{component:Qn,py:4,children:d.list.map(w=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(Rs,{checked:d.checks[w.groupId],onChange:_=>Ie(_,w.groupId),style:{marginLeft:w.disabled?16:0},defaultChecked:!0,disabled:w.disabled}),e.jsxs(y,{flexGrow:1,mt:3,children:[e.jsx(y,{item:!0,xs:8,children:w.name}),w.version&&e.jsxs(at,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(at,{item:!0,xs:3,children:w.version}),e.jsx(at,{item:!0,xs:1,children:e.jsx(Bs,{style:{fontSize:"0.9em"}})}),e.jsx(at,{item:!0,xs:3,children:e.jsx(y,{color:"secondary.main",children:w.newVersion})})]})]},`${w.name}-${w.newVersion}`)]},w.name))}),e.jsxs(bs,{style:{padding:"8px 24px 24px"},children:[e.jsx(oe,{onClick:()=>{R(null)},children:n("common.cancel")}),e.jsxs(oe,{onClick:w=>{w.stopPropagation(),ke()},color:"primary",disabled:p||!d.hasChecks,variant:"contained",autoFocus:!0,children:[p&&e.jsx(ie,{size:16}),n("common.update")]})]})]})}),!!C&&e.jsx(Jn,{open:!0,fullWidth:!0,onClose:()=>x(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Zn,{children:n("common.configuration")}),e.jsx(Qn,{children:e.jsx(y,{py:2,children:e.jsx(Vt,{control:e.jsx(Tr,{checked:b,onChange:w=>c(!!w.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(St,{selectedMeta:Qe,blocklet:t,showDialog:!!Qe,setShowDialog:()=>L(null)}),v&&e.jsx(bn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(vt,{open:!0,onClose:()=>k(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}Nn.propTypes={blocklet:r.object.isRequired,onUpdate:r.func,getComponentUrl:r.func};Nn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Mi=F.div`
494
494
  .title {
495
495
  font-size: 1.2rem;
496
496
  font-weight: bold;
@@ -509,7 +509,7 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
509
509
  .component-item {
510
510
  animation: showDelay 0.75s ease 1;
511
511
  }
512
- `,Oi=F(y)`
512
+ `,Fi=F(y)`
513
513
  ${t=>t.theme.breakpoints.up("sm")} {
514
514
  flex-direction: row;
515
515
  justify-content: space-between;
@@ -523,9 +523,9 @@ import{bK as _o,j as e,aK as Vt,aL as _t,bm as Y,r as f,aP as uo,P as r,q as z,O
523
523
  display: none;
524
524
  }
525
525
  }
526
- `,Mi=F(y)`
526
+ `,Gi=F(y)`
527
527
  ${t=>t.theme.breakpoints.down("sm")} {
528
528
  width: 100%;
529
529
  justify-content: space-between;
530
530
  }
531
- `;function Mo(t){const{locale:o}=f.useContext(Ce),{blocklet:s,recommendedDomain:a}=Er(),n=i=>Rs({blocklet:s,domain:{value:a},mountPoint:i,params:Ht(s,o)});return e.jsx(An,{blocklet:s,getComponentUrl:n,...t})}Mo.propTypes={};Mo.defaultProps={};export{Mo as default};
531
+ `;function Go(t){const{locale:o}=f.useContext(Ce),{blocklet:s,recommendedDomain:a}=wr(),n=i=>Es({blocklet:s,domain:{value:a},mountPoint:i,params:Kt(s,o)});return e.jsx(Nn,{blocklet:s,getComponentUrl:n,...t})}Go.propTypes={};Go.defaultProps={};export{Go as default};