@abtnode/webapp 1.16.28 → 1.16.29-beta-e04c6f40

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 (205) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-B8Ae2MjM.js → Add-xExgHDod.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-BNt-WuI3.js → ArrowDropDown-KUzipi3t.js} +1 -1
  5. package/dist/assets/{Autocomplete-Bo6UH2XL.js → Autocomplete-Er311sva.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-CkmMkQDW.js → Breadcrumbs-Pqx4il3S.js} +1 -1
  7. package/dist/assets/{ButtonGroup-OcQcEz6r.js → ButtonGroup-BcupcRIM.js} +1 -1
  8. package/dist/assets/{CheckCircle-BnRenrK4.js → CheckCircle-zUiCwNZs.js} +1 -1
  9. package/dist/assets/{ChevronLeft-Dp9aa91c.js → ChevronLeft-Bet4yQzf.js} +1 -1
  10. package/dist/assets/{ChevronRight-C3NPaw6o.js → ChevronRight-DVus-Y96.js} +1 -1
  11. package/dist/assets/{Close-Cbaq-RRq.js → Close-O3YNtovt.js} +1 -1
  12. package/dist/assets/Delete-DOCRW1Ln.js +1 -0
  13. package/dist/assets/{DeleteOutline-B4LqoCK2.js → DeleteOutline-CUojn4xn.js} +1 -1
  14. package/dist/assets/{Done-BCLH1e-Y.js → Done-BbWcazKr.js} +1 -1
  15. package/dist/assets/{Edit-i_Bman7K.js → Edit-BhCFwv7o.js} +1 -1
  16. package/dist/assets/{EditIcon-DmNEjmIQ.js → EditIcon-CERx0ivQ.js} +1 -1
  17. package/dist/assets/{FilterList-fpG1-3KQ.js → FilterList-BRYDdfFq.js} +4 -4
  18. package/dist/assets/{Google-DLkd6TAZ.js → Google-CdmAvvA5.js} +3 -3
  19. package/dist/assets/{Https-amCzjB1a.js → Https-D3zQe1g3.js} +1 -1
  20. package/dist/assets/{InputAdornment-C6LFxcti.js → InputAdornment-CiVUPEjM.js} +1 -1
  21. package/dist/assets/{InputLabel-avYwCvJM.js → InputLabel-Cl0jKlH9.js} +1 -1
  22. package/dist/assets/{LastPage-DnBOlrut.js → LastPage-DIXa5YVo.js} +1 -1
  23. package/dist/assets/{Launch-DPclIZbd.js → Launch-u57ssxVt.js} +1 -1
  24. package/dist/assets/{Link-DfSEdivF.js → Link-8ntBDNt-.js} +1 -1
  25. package/dist/assets/{LoadingButton-xveWP_M5.js → LoadingButton-BhxaC5Ed.js} +1 -1
  26. package/dist/assets/{LockIcon-9c7sG23a.js → LockIcon-CkFf2isB.js} +1 -1
  27. package/dist/assets/{Loop-DwAWKPvc.js → Loop-BnL-Vxc4.js} +1 -1
  28. package/dist/assets/{MoreVert-Nc1QBj2D.js → MoreVert-LBoMA9yq.js} +1 -1
  29. package/dist/assets/{Pagination-D5t0OCBH.js → Pagination-B0vuu0Jz.js} +1 -1
  30. package/dist/assets/{Public-BLh26Bb9.js → Public-BPRyPUP1.js} +1 -1
  31. package/dist/assets/{SchemaReference.es--oFfd0mm.js → SchemaReference.es-Cw9PnK9u.js} +1 -1
  32. package/dist/assets/{Search-DnnCUnjB.js → Search-DoXY8XQp.js} +1 -1
  33. package/dist/assets/{Select-CBA-xyOJ.js → Select-CSRNZbOq.js} +2 -2
  34. package/dist/assets/{Skeleton-CQPjJHp3.js → Skeleton-CZxXS4jE.js} +5 -5
  35. package/dist/assets/{Slider-Bdpm9oO4.js → Slider-BcITXKtu.js} +1 -1
  36. package/dist/assets/{Stepper-UEQaZPW7.js → Stepper-mccJibcr.js} +1 -1
  37. package/dist/assets/TextField-HCXJkIb-.js +1 -0
  38. package/dist/assets/{ToggleButtonGroup-Drarswgi.js → ToggleButtonGroup-DNi-APKM.js} +1 -1
  39. package/dist/assets/{ViewList-CoYI2XgO.js → ViewList-B0D9uEjF.js} +1 -1
  40. package/dist/assets/{actions-BAUfPsQv.js → actions-CAskIzvr.js} +1 -1
  41. package/dist/assets/actions-Cs-U54uv.js +11 -0
  42. package/dist/assets/{agreement-_qYynElX.js → agreement-Dqwk0Qk1.js} +3 -3
  43. package/dist/assets/api-UGqvGbaE.js +1 -0
  44. package/dist/assets/app-avatar-DnQtdz_O.js +1 -0
  45. package/dist/assets/ar-DDqDOM6_.js +1 -0
  46. package/dist/assets/{audit-logs-BqT_1MLt.js → audit-logs-elaTyIYr.js} +1 -1
  47. package/dist/assets/{brace-fold.es-CkrKXotH.js → brace-fold.es-CHAwFrP-.js} +1 -1
  48. package/dist/assets/{bundle-avatar-RiFaz1Hb.js → bundle-avatar-DQKqTcLf.js} +1 -1
  49. package/dist/assets/{chart-Cinf5zq_.js → chart-B4WtoTol.js} +1 -1
  50. package/dist/assets/{click-to-copy-Bj13kdln.js → click-to-copy-BxTGXnkW.js} +1 -1
  51. package/dist/assets/{closebrackets.es-C32XuxI5.js → closebrackets.es-Cowrx9Wh.js} +1 -1
  52. package/dist/assets/{codemirror.es-oms3GpFv.js → codemirror.es-DDaWBk7v.js} +1 -1
  53. package/dist/assets/{comment.es-AVZXTIDr.js → comment.es-BpMZ3nSF.js} +1 -1
  54. package/dist/assets/config-navigation-mgsMFCq0.js +25 -0
  55. package/dist/assets/de-Df9PmQSL.js +1 -0
  56. package/dist/assets/delete-confirm-G3-jMPGR.js +1 -0
  57. package/dist/assets/{detail-CHKmnQLc.js → detail-BBKDt7TH.js} +3 -3
  58. package/dist/assets/{dialog.es-DHZdXjGS.js → dialog.es-CRh6VOLz.js} +1 -1
  59. package/dist/assets/{download-DFPnF7mz.js → download-BK5ocL5s.js} +1 -1
  60. package/dist/assets/es-BQD9zWi-.js +1 -0
  61. package/dist/assets/{foldgutter.es-CSicbQSJ.js → foldgutter.es-CHLe3IFg.js} +1 -1
  62. package/dist/assets/fr-DNx2OQyQ.js +1 -0
  63. package/dist/assets/getValidReactChildren-C2KGwF2r.js +1 -0
  64. package/dist/assets/hi-BmEkoTIE.js +1 -0
  65. package/dist/assets/{hint.es-DAEQ9N76.js → hint.es-qHNwvQXY.js} +1 -1
  66. package/dist/assets/{hint.es2-DYXluLKu.js → hint.es2-DRHlNN6z.js} +1 -1
  67. package/dist/assets/id-DXu5sStK.js +1 -0
  68. package/dist/assets/{iframe-DwuYX0Xq.js → iframe-D-PNyLg3.js} +1 -1
  69. package/dist/assets/{index-B60jROHj.js → index-3ruoHhFa.js} +26 -26
  70. package/dist/assets/{index-zFXZLqso.js → index-3sl31tmo.js} +2 -2
  71. package/dist/assets/{index-CZKHzmkC.js → index-B1h0P1L0.js} +1 -1
  72. package/dist/assets/index-B1yKtvhn.js +54 -0
  73. package/dist/assets/{index-BbS1Wq4p.js → index-B6HWus5t.js} +1 -1
  74. package/dist/assets/{index-baq8DMtQ.js → index-BhwGm9ir.js} +9 -9
  75. package/dist/assets/{index-DKkTRBZn.js → index-BlSaylBC.js} +4 -4
  76. package/dist/assets/{index-DOsg2sHH.js → index-Boc7heJK.js} +1 -1
  77. package/dist/assets/{index-cmiUur_8.js → index-Boe-4fof.js} +1 -1
  78. package/dist/assets/{index-CiZAReVP.js → index-Br7MMAwb.js} +1 -1
  79. package/dist/assets/{index-ZQu91rXz.js → index-Bt8_a71i.js} +1 -1
  80. package/dist/assets/{index-BVznp3M0.js → index-C4esebAE.js} +1 -1
  81. package/dist/assets/{index-BbW2IRRR.js → index-C5c3sxc7.js} +3 -3
  82. package/dist/assets/{index-0RUAEm49.js → index-C7piHvhS.js} +2 -2
  83. package/dist/assets/{index-BKi0XLcv.js → index-C8OOX63T.js} +1 -1
  84. package/dist/assets/{index-DfNh08gP.js → index-CAP7ccf-.js} +3 -3
  85. package/dist/assets/{index-Cl2QG8J6.js → index-CCMFLAjE.js} +16 -16
  86. package/dist/assets/{index-CKOyruf_.js → index-CGedY69r.js} +2 -2
  87. package/dist/assets/{index-ByF3apMm.js → index-CI3-G8f5.js} +3 -3
  88. package/dist/assets/{index-9R6mPPbN.js → index-CMw6A55r.js} +1 -1
  89. package/dist/assets/index-COVe-oac.js +1 -0
  90. package/dist/assets/{index-D5MDxbqt.js → index-CTWxKp8R.js} +1 -1
  91. package/dist/assets/{index-DHYJxTcV.js → index-CU4Kco8M.js} +57 -57
  92. package/dist/assets/{index-DrWhB0MJ.js → index-CfjU2vkP.js} +1 -1
  93. package/dist/assets/{index-BBnT5XB9.js → index-Cjw9QiwF.js} +1 -1
  94. package/dist/assets/{index-CyYUysSv.js → index-CpWB9aT7.js} +1 -1
  95. package/dist/assets/{index-CIbzY-F7.js → index-CsGASsXO.js} +1 -1
  96. package/dist/assets/{index-v2cqn0eS.js → index-CuZgQfxG.js} +1 -1
  97. package/dist/assets/{index-BnFWpIPQ.js → index-Cx08Fq4-.js} +1 -1
  98. package/dist/assets/{index-CHjwpGia.js → index-D0mxQWU5.js} +7 -7
  99. package/dist/assets/{index-DSByvARI.js → index-DHWCojAQ.js} +1 -1
  100. package/dist/assets/{index-DcU_Cijj.js → index-DIJ53y8c.js} +1 -1
  101. package/dist/assets/index-DIbFXQTV.js +1 -0
  102. package/dist/assets/{index-7J6TijHC.js → index-Dkkm6kzm.js} +1 -1
  103. package/dist/assets/{index-rPqHtLu4.js → index-Dw9clXjq.js} +1 -1
  104. package/dist/assets/{index-CucnV9EX.js → index-DzW0Cxov.js} +25 -25
  105. package/dist/assets/index-LlxzMpy3.js +231 -0
  106. package/dist/assets/{index-DV2quTIn.js → index-M5WcRzZV.js} +1 -1
  107. package/dist/assets/index-P1GJ1Y4T.js +177 -0
  108. package/dist/assets/{index-CqcpZ8C3.js → index-Pf5VRxU2.js} +174 -210
  109. package/dist/assets/{index-CtzAe2AR.js → index-RQQsaMDK.js} +1 -1
  110. package/dist/assets/{index-DPx9NPlp.js → index-_RvLZsys.js} +1 -1
  111. package/dist/assets/index-hFhjFjqL.js +58 -0
  112. package/dist/assets/{index-ECk6dODK.js → index-y8_7sFXl.js} +10 -10
  113. package/dist/assets/{index.es-Dkh9ejMp.js → index.es-0GspS0hl.js} +1 -1
  114. package/dist/assets/{index.esm-Hqw0Nfnx.js → index.esm-CJT_Vb_Y.js} +1 -1
  115. package/dist/assets/{info-addon.es-5NmROke-.js → info-addon.es-BvWPiOWh.js} +1 -1
  116. package/dist/assets/{info.es-CsELEfUv.js → info.es-D6grONEz.js} +1 -1
  117. package/dist/assets/{install-from-url-DXGlT7R8.js → install-from-url-CLk48T0_.js} +1 -1
  118. package/dist/assets/invitation-4W3IOdXy.js +200 -0
  119. package/dist/assets/{is-path-prefix-equal-CoJozASB.js → is-path-prefix-equal-DQciVrFn.js} +1 -1
  120. package/dist/assets/{isEqual-BLnnfE4T.js → isEqual-C5Iu_kl-.js} +1 -1
  121. package/dist/assets/{item-tD3jAfba.js → item-C9bzNYRu.js} +31 -31
  122. package/dist/assets/ja-thyFR9rH.js +1 -0
  123. package/dist/assets/{javascript.es-BIUhEWTj.js → javascript.es-CWlPpygW.js} +1 -1
  124. package/dist/assets/{jump-to-line.es-BQjWkUgo.js → jump-to-line.es-D7dd2At6.js} +1 -1
  125. package/dist/assets/{jump.es-D8ZxFsmc.js → jump.es-WtAW-Ijf.js} +1 -1
  126. package/dist/assets/ko-BJSWgMML.js +1 -0
  127. package/dist/assets/{line-DW0juCGB.js → line-Cfyg0g9I.js} +4 -4
  128. package/dist/assets/{lint.es-Dv2pWRyz.js → lint.es-aUUps1ME.js} +1 -1
  129. package/dist/assets/{lint.es2-CqGQ_rnk.js → lint.es2-CDvv_d9A.js} +1 -1
  130. package/dist/assets/{lint.es3-g58ofVJA.js → lint.es3-DTrQmP6j.js} +1 -1
  131. package/dist/assets/{list-header-tjKXNgOR.js → list-header-BG2QMZZz.js} +1 -1
  132. package/dist/assets/{log-BFiA_Tyh.js → log-DIJPVIRP.js} +1 -1
  133. package/dist/assets/{lottie-yeTV0Y2m.js → lottie-BkwIvhEu.js} +1 -1
  134. package/dist/assets/{matchbrackets.es-B-Xj5H9Q.js → matchbrackets.es-CCjeMHPP.js} +1 -1
  135. package/dist/assets/{memory-C7a59RsU.js → memory-CYabGN8q.js} +1 -1
  136. package/dist/assets/{mode.es-BSNxo6gK.js → mode.es-kZQjUXx0.js} +1 -1
  137. package/dist/assets/{mode.es2-C1LDwVOl.js → mode.es2-hCaXf0ad.js} +1 -1
  138. package/dist/assets/{mode.es3-C6-ZTyOk.js → mode.es3-DlVh9_RV.js} +1 -1
  139. package/dist/assets/{onlineParser.es-BzK7GlZv.js → onlineParser.es-g03lcwfp.js} +1 -1
  140. package/dist/assets/overview-BFHUS9cz.js +23 -0
  141. package/dist/assets/{pt-fvVMjgC8.js → pt-D828CXoS.js} +1 -1
  142. package/dist/assets/{react-1fE0Sobf.js → react-DjQtZm70.js} +7 -7
  143. package/dist/assets/{redux-hfExDDyr.js → redux-0yltQfyb.js} +1 -1
  144. package/dist/assets/{resource-dialog-DinbvH2C.js → resource-dialog-B2vu5Of2.js} +2 -2
  145. package/dist/assets/ru-t_aX-wsm.js +1 -0
  146. package/dist/assets/{runtime-tAjj0dmb.js → runtime-C9hFU3Ij.js} +1 -1
  147. package/dist/assets/{search.es-DxfjuUNu.js → search.es-C20qP8Vq.js} +1 -1
  148. package/dist/assets/{searchcursor.es-C0Z2DY1c.js → searchcursor.es-Cy-3eaEN.js} +1 -1
  149. package/dist/assets/service-CkoGqY1V.js +1 -0
  150. package/dist/assets/{show-hint.es-q24U0q_A.js → show-hint.es-DAqKK5Qn.js} +1 -1
  151. package/dist/assets/{slicedToArray-CYGiqzmA.js → slicedToArray-Bl_ysqUF.js} +3 -3
  152. package/dist/assets/{spaces-C58gy1rM.js → spaces-CE3KwDvq.js} +1 -1
  153. package/dist/assets/{sublime.es-BffqyCoy.js → sublime.es-DPcVE8hJ.js} +1 -1
  154. package/dist/assets/{switch-control-CuPWIx6T.js → switch-control-CCSLs9W3.js} +1 -1
  155. package/dist/assets/{table-icons-DOOoyljy.js → table-icons-B9NLkXar.js} +10 -10
  156. package/dist/assets/{tag-Cxx1sXPF.js → tag-_nponNF2.js} +1 -1
  157. package/dist/assets/{team-BynFP1rM.js → team-wy2ENAAe.js} +1 -1
  158. package/dist/assets/th-DvaD_9E5.js +1 -0
  159. package/dist/assets/toUpper-D-lxmi1w.js +1 -0
  160. package/dist/assets/{traffic-D03HdfGL.js → traffic-BU3E2tw9.js} +5 -5
  161. package/dist/assets/{url-evaluation-dheoi_Nj.js → url-evaluation-CAG0Y4FK.js} +4 -4
  162. package/dist/assets/{url-join-DMIMYkEk.js → url-join-DMJmszyo.js} +1 -1
  163. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-DWywlTbc.js → use-blocklet-info-for-connect-did-spaces-Bc-o6Zkq.js} +1 -1
  164. package/dist/assets/{useLocalStorage-C3GQNaV2.js → useLocalStorage-D4xQyg06.js} +1 -1
  165. package/dist/assets/{util-cf4pvQDW.js → util-CuvemqGW.js} +1 -1
  166. package/dist/assets/vi-B4VdHKzm.js +1 -0
  167. package/dist/assets/{wait-container-BwlRhWl0.js → wait-container-CdR6E8LE.js} +4 -4
  168. package/dist/assets/{withStyles-BkcRLEgx.js → withStyles-Ct7uoTy7.js} +1 -1
  169. package/dist/assets/wrap-locale-C2k9YLGh.js +1 -0
  170. package/dist/assets/zh-D0ck6JaG.js +2 -0
  171. package/dist/assets/zh-tw-C19pg5Jo.js +1 -0
  172. package/dist/index.html +1 -1
  173. package/dist/service-worker.js +1 -1
  174. package/package.json +1 -1
  175. package/dist/assets/Delete-CnrKsAGC.js +0 -1
  176. package/dist/assets/TextField-DjRhIjo4.js +0 -1
  177. package/dist/assets/actions-C1t0ka-G.js +0 -11
  178. package/dist/assets/api-xvCGCwMn.js +0 -1
  179. package/dist/assets/app-avatar-DcgC0kB0.js +0 -1
  180. package/dist/assets/ar-B5gcsN0k.js +0 -1
  181. package/dist/assets/config-navigation-LFUjTzgk.js +0 -25
  182. package/dist/assets/de-WUCASh9G.js +0 -1
  183. package/dist/assets/delete-confirm-BoeDYrYX.js +0 -1
  184. package/dist/assets/es-DsRorAcf.js +0 -1
  185. package/dist/assets/fr-CUMFVKph.js +0 -1
  186. package/dist/assets/getValidReactChildren-GMOIXwRG.js +0 -1
  187. package/dist/assets/hi-BinC6-tx.js +0 -1
  188. package/dist/assets/id-BVFhYsL8.js +0 -1
  189. package/dist/assets/index-BKck0oIO.js +0 -234
  190. package/dist/assets/index-DU7hJgoO.js +0 -1
  191. package/dist/assets/index-DmPgcoiv.js +0 -150
  192. package/dist/assets/index-DsUZ7uiP.js +0 -58
  193. package/dist/assets/index-HOVCi07-.js +0 -54
  194. package/dist/assets/invitation-CSNEw5oM.js +0 -200
  195. package/dist/assets/ja-B1xj2XMp.js +0 -1
  196. package/dist/assets/ko-Buo9FEc0.js +0 -1
  197. package/dist/assets/overview-BlWFlRx2.js +0 -23
  198. package/dist/assets/ru-OQD02sOm.js +0 -1
  199. package/dist/assets/service-1GhnQw9a.js +0 -1
  200. package/dist/assets/th-DaDxf6qI.js +0 -1
  201. package/dist/assets/toUpper-mYvRPeiI.js +0 -1
  202. package/dist/assets/vi-D2hO2mdU.js +0 -1
  203. package/dist/assets/wrap-locale-BqGpRCMA.js +0 -1
  204. package/dist/assets/zh-OQY8LvIH.js +0 -2
  205. package/dist/assets/zh-tw-Dd8o0udA.js +0 -1
@@ -1,4 +1,4 @@
1
- import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J,r as f,f as Ce,bp as Je,b as X,M as O,aO as _n,U as Ot,cd as Me,n as F,K as Z,gG as Vo,bH as Fe,aW as ue,aV as ht,aC as Mt,a2 as $,D as gt,F as D,bn as _o,Y as Ke,$ as Wn,a$ as Wo,fD as Ho,fE as Yo,C as re,f8 as Jo,y as po,av as dt,a1 as we,x as Ft,hv as Ko,hw as Qo,B as ne,bb as uo,H as _t,hx as Zo,m as ee,a3 as Xo,ez as $o,W as mo,Z as fo,ak as es,w as ts,J as ho,Q as He,V as ns,hy as go,S as ge,az as os,aA as ss,aB as rs,i as xt,hz as is,cz as as,bg as ls,h6 as cs,hA as ds,ay as Hn,cx as ps,ad as Ge,aJ as xo,bJ as Wt,cf as us,hB as ms,b6 as fs,z as hs,aX as Gt,T as gs,aN as Ye,at as Bt,dE as xs,bq as yo,aF as ys,fP as Pe,dM as Cs,hC as js,ge as Yn,hD as Jn,gg as Kn,aY as vs,G as at,gi as Ss,bI as bs}from"./index-CqcpZ8C3.js";import{d as Rs}from"./Add-B8Ae2MjM.js";import{a as Es,R as ct,F as Ts,L as ws,d as Ht,b as Yt}from"./line-DW0juCGB.js";import{C as Ps,A as Is,d as ks}from"./agreement-_qYynElX.js";import{E as Us}from"./index-CtzAe2AR.js";import{b as Ds,a as Bs,c as Ns,u as Jt,e as As}from"./actions-C1t0ka-G.js";import{S as Ls}from"./switch-control-CuPWIx6T.js";import{u as Os}from"./detail-CHKmnQLc.js";import{d as Co}from"./Edit-i_Bman7K.js";import{T as Ms}from"./index-CIbzY-F7.js";import{T as Fs,M as Gs,t as zs}from"./table-icons-DOOoyljy.js";import{C as Qn}from"./click-to-copy-Bj13kdln.js";import{T as K}from"./TextField-DjRhIjo4.js";import{d as Kt}from"./Link-DfSEdivF.js";import{c as qs,C as Vs,a as _s,b as Ws,D as Hs,A as Ys,B as Js,d as Ks,S as Qs}from"./item-tD3jAfba.js";import{u as Zs,a as Xs,P as jo,L as Zn,A as $s,S as er}from"./index-D5MDxbqt.js";import{u as vo,t as tr}from"./toUpper-mYvRPeiI.js";import{u as ie,a as nr}from"./team-BynFP1rM.js";import{c as or,d as sr,a as rr,e as ir,f as ar,g as Xn,h as lr,i as $n}from"./spaces-C58gy1rM.js";import{d as cr}from"./EditIcon-DmNEjmIQ.js";import{d as dr}from"./Done-BCLH1e-Y.js";import{C as pr}from"./Google-DLkd6TAZ.js";import{I as ur,B as mr}from"./install-from-url-DXGlT7R8.js";import{a as eo}from"./api-xvCGCwMn.js";import{v as So,a as pt}from"./util-cf4pvQDW.js";import{P as fr,u as hr}from"./use-blocklet-info-for-connect-did-spaces-DWywlTbc.js";import{d as gr}from"./DeleteOutline-B4LqoCK2.js";import{S as to}from"./index-CKOyruf_.js";import{d as xr}from"./ArrowDropDown-BNt-WuI3.js";import{_ as yr}from"./useLocalStorage-C3GQNaV2.js";import{d as Cr}from"./LockIcon-9c7sG23a.js";import{d as yt}from"./Delete-CnrKsAGC.js";import{d as bo}from"./Launch-DPclIZbd.js";import{C as jr}from"./delete-confirm-BoeDYrYX.js";import{W as Qe}from"./tag-Cxx1sXPF.js";import{d as vr}from"./is-path-prefix-equal-CoJozASB.js";import{R as Sr,b as no,B as Ro}from"./url-evaluation-dheoi_Nj.js";import{B as br}from"./bundle-avatar-RiFaz1Hb.js";import{A as Eo}from"./actions-BAUfPsQv.js";import{I as Nt}from"./index-BKi0XLcv.js";import{a as Rr}from"./index-DcU_Cijj.js";import"./ButtonGroup-OcQcEz6r.js";import"./getValidReactChildren-GMOIXwRG.js";import"./index-v2cqn0eS.js";import"./index-BbS1Wq4p.js";import"./url-join-DMIMYkEk.js";import"./MoreVert-Nc1QBj2D.js";import"./app-avatar-DcgC0kB0.js";import"./Breadcrumbs-CkmMkQDW.js";import"./FilterList-fpG1-3KQ.js";import"./Select-CBA-xyOJ.js";import"./InputLabel-avYwCvJM.js";import"./LastPage-DnBOlrut.js";import"./slicedToArray-CYGiqzmA.js";import"./Search-DnnCUnjB.js";import"./ChevronLeft-Dp9aa91c.js";import"./ChevronRight-C3NPaw6o.js";import"./redux-hfExDDyr.js";import"./Skeleton-CQPjJHp3.js";import"./InputAdornment-C6LFxcti.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-CyYUysSv.js";import"./preact.module-B1z5cdvs.js";import"./Close-Cbaq-RRq.js";import"./lottie-yeTV0Y2m.js";import"./Stepper-UEQaZPW7.js";import"./index-DSByvARI.js";const Er=qo(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 Qt={},Tr=Vt;Object.defineProperty(Qt,"__esModule",{value:!0});var To=Qt.default=void 0,wr=Tr(qt()),Pr=e;To=Qt.default=(0,wr.default)((0,Pr.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 Zt({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Os(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),A.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){A.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}})})})]})}Zt.propTypes={children:r.any};Zt.defaultProps={children:null};const Ir=(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})},At=(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 ut({blocklet:t,ancestors:o}){const s=J(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.success(n("blocklet.config.changedTip")),l=c=>At(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()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")||c.key.startsWith("COMPONENT_")){A.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){A.error(Z(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")&&!X.BLOCKLET_CONFIGURABLE_KEY[c.key]){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=Vo(c);if(T){A.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!At(c,t,o)){A.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){A.error(Z(T))}},g=async c=>{if(c.required){A.error(n("blocklet.config.environment.deleteForbidden"));return}if(!At(c,t,o)){A.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){A.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]),b=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=b.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},R=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Qn,{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(oo,{children:e.jsx(K,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:I=>T(I.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(Qn,{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(oo,{children:[e.jsx(K,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:I=>T(I.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Ir(j,n)]})}}];return e.jsxs(kr,{children:[!!d.length&&e.jsx(_n,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(_n,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Ot,{permission:a?"":"mutate_blocklets",role:a?Me:[],children:c=>e.jsx(Fs,{className:"config-table",children:e.jsx(Gs,{title:e.jsx("h4",{children:n("common.environment")}),columns:R(),icons:{...Ds,...zs},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:b,editable:c?x:{}})})})]})}ut.propTypes={blocklet:r.object.isRequired,ancestors:r.array};ut.defaultProps={ancestors:[]};const kr=F.div`
1
+ import{bK as zo,j as e,aK as qt,aL as _t,q as z,O as y,ax as ve,P as r,A,bk as J,r as f,f as Ce,bo as Je,b as X,M as O,J as dt,U as Mt,cc as Me,n as F,K as Z,gG as Vo,bG as Fe,aV as ue,aU as gt,aC as Ft,a2 as $,D as xt,F as D,bm as qo,Y as Ke,$ as Wn,a_ as _o,fF as Wo,fG as Ho,C as re,fa as Yo,y as po,av as pt,a1 as we,x as Gt,hu as Jo,hv as Ko,B as ne,ba as uo,H as Wt,hw as Qo,m as ee,a3 as Zo,eB as Xo,W as mo,Z as fo,ak as $o,w as es,Q as He,V as ts,hx as ho,S as ge,az as ns,aA as os,aB as ss,i as yt,hy as rs,cF as is,bf as as,h5 as ls,hz as cs,ay as Hn,cD as ds,ad as Ge,aJ as go,bI as Ht,ce as ps,hA as us,b5 as ms,z as fs,aW as zt,T as hs,aN as Ye,at as Nt,dG as gs,bp as xo,aF as xs,fR as Pe,dO as ys,hB as Cs,ge as Yn,hC as Jn,gg as Kn,aX as js,G as at,gi as vs,bH as Ss}from"./index-Pf5VRxU2.js";import{d as bs}from"./Add-xExgHDod.js";import{a as Rs,R as ct,F as Es,L as Ts,d as Yt,b as Jt}from"./line-Cfyg0g9I.js";import{C as ws,A as Ps,d as Is}from"./agreement-Dqwk0Qk1.js";import{E as ks}from"./index-RQQsaMDK.js";import{b as Us,a as Ds,c as Bs,u as Kt,e as Ns}from"./actions-Cs-U54uv.js";import{S as As}from"./switch-control-CCSLs9W3.js";import{u as Ls}from"./detail-BBKDt7TH.js";import{d as yo}from"./Edit-BhCFwv7o.js";import{T as Os}from"./index-CsGASsXO.js";import{T as Ms,M as Fs,t as Gs}from"./table-icons-B9NLkXar.js";import{C as Qn}from"./click-to-copy-BxTGXnkW.js";import{T as K}from"./TextField-HCXJkIb-.js";import{d as Qt}from"./Link-8ntBDNt-.js";import{c as zs,C as Vs,a as qs,b as _s,D as Ws,A as Hs,B as Ys,d as Js,S as Ks}from"./item-C9bzNYRu.js";import{u as Qs,a as Zs,P as Co,L as Zn,A as Xs,S as $s}from"./index-CTWxKp8R.js";import{u as jo,t as er}from"./toUpper-D-lxmi1w.js";import{u as ie,a as tr}from"./team-wy2ENAAe.js";import{c as nr,d as or,a as sr,e as rr,f as ir,g as Xn,h as ar,i as $n}from"./spaces-CE3KwDvq.js";import{d as lr}from"./EditIcon-CERx0ivQ.js";import{d as cr}from"./Done-BbWcazKr.js";import{C as dr}from"./Google-CdmAvvA5.js";import{I as pr,B as ur}from"./install-from-url-CLk48T0_.js";import{a as eo}from"./api-UGqvGbaE.js";import{v as vo,a as ut}from"./util-CuvemqGW.js";import{P as mr,u as fr}from"./use-blocklet-info-for-connect-did-spaces-Bc-o6Zkq.js";import{d as hr}from"./DeleteOutline-CUojn4xn.js";import{S as to}from"./index-CGedY69r.js";import{d as gr}from"./ArrowDropDown-KUzipi3t.js";import{_ as xr}from"./useLocalStorage-D4xQyg06.js";import{d as yr}from"./LockIcon-CkFf2isB.js";import{d as Ct}from"./Delete-DOCRW1Ln.js";import{d as So}from"./Launch-u57ssxVt.js";import{C as Cr}from"./delete-confirm-G3-jMPGR.js";import{W as Qe}from"./tag-_nponNF2.js";import{d as jr}from"./is-path-prefix-equal-DQciVrFn.js";import{R as vr,b as no,B as bo}from"./url-evaluation-CAG0Y4FK.js";import{B as Sr}from"./bundle-avatar-DQKqTcLf.js";import{A as Ro}from"./actions-CAskIzvr.js";import{I as At}from"./index-C8OOX63T.js";import{a as br}from"./index-DIJ53y8c.js";import"./ButtonGroup-BcupcRIM.js";import"./getValidReactChildren-C2KGwF2r.js";import"./index-CuZgQfxG.js";import"./index-B6HWus5t.js";import"./url-join-DMJmszyo.js";import"./MoreVert-LBoMA9yq.js";import"./app-avatar-DnQtdz_O.js";import"./Breadcrumbs-Pqx4il3S.js";import"./FilterList-BRYDdfFq.js";import"./Select-CSRNZbOq.js";import"./InputLabel-Cl0jKlH9.js";import"./LastPage-DIXa5YVo.js";import"./slicedToArray-Bl_ysqUF.js";import"./Search-DoXY8XQp.js";import"./ChevronLeft-Bet4yQzf.js";import"./ChevronRight-DVus-Y96.js";import"./redux-0yltQfyb.js";import"./Skeleton-CZxXS4jE.js";import"./InputAdornment-CiVUPEjM.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-CpWB9aT7.js";import"./preact.module-B1z5cdvs.js";import"./Close-O3YNtovt.js";import"./lottie-BkwIvhEu.js";import"./Stepper-mccJibcr.js";import"./index-DHWCojAQ.js";const Rr=zo(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={},Er=_t;Object.defineProperty(Zt,"__esModule",{value:!0});var Eo=Zt.default=void 0,Tr=Er(qt()),wr=e;Eo=Zt.default=(0,Tr.default)((0,wr.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 Xt({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Ls(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),A.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){A.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(As,{checked:m,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Xt.propTypes={children:r.any};Xt.defaultProps={children:null};const Pr=(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=J(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.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()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")||c.key.startsWith("COMPONENT_")){A.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){A.error(Z(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")&&!X.BLOCKLET_CONFIGURABLE_KEY[c.key]){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=Vo(c);if(T){A.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!Lt(c,t,o)){A.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){A.error(Z(T))}},g=async c=>{if(c.required){A.error(n("blocklet.config.environment.deleteForbidden"));return}if(!Lt(c,t,o)){A.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){A.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]),b=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=b.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},R=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Qn,{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(oo,{children:e.jsx(K,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:I=>T(I.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(Qn,{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(oo,{children:[e.jsx(K,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:I=>T(I.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Pr(j,n)]})}}];return e.jsxs(Ir,{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?Me:[],children:c=>e.jsx(Ms,{className:"config-table",children:e.jsx(Fs,{title:e.jsx("h4",{children:n("common.environment")}),columns:R(),icons:{...Us,...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:b,editable:c?x:{}})})})]})}mt.propTypes={blocklet:r.object.isRequired,ancestors:r.array};mt.defaultProps={ancestors:[]};const Ir=F.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -52,7 +52,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
52
52
  }
53
53
  `,oo=F.div`
54
54
  height: 60px;
55
- `;function Ct({blocklet:t,ancestors:o,hasPermission:s,...a}){const{t:n}=z(),{api:i}=J(),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),A.error(x.message),x}},b=C=>{p(n("common.slugifyHint",{value:ht(C)}))};return e.jsx(Nr,{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:b,helperText:g,formatterBeforeSubmit:C=>ue(C)})})})}const Ur=Fe(Ct,"mutate_blocklets"),Dr=Fe(Ct,"",Me);function Br(t){const{inService:o}=J();return o?e.jsx(Dr,{...t}):e.jsx(Ur,{...t})}Ct.propTypes={blocklet:r.object.isRequired,ancestors:r.array,hasPermission:r.bool};Ct.defaultProps={ancestors:[],hasPermission:!1};const Nr=F.div``;function jt({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(Mt.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)},b=T=>{T.stopPropagation(),l(!0)},C={settings:Mt.hasMountPoint(a.meta)&&{label:u("blocklet.component.setting"),value:"settings",component:e.jsx(Br,{blocklet:a,ancestors:n})},environments:{label:u("common.environment"),value:"environments",component:e.jsx(ut,{blocklet:a,ancestors:n})}},x=Object.values(C).filter(Boolean),R=x.map(({label:T,value:I})=>({label:T,value:I})),c=T=>{p(T)},v=C[g]||x[0];let j=null;return s||(j=typeof i=="function"?i({open:b}):e.jsx($,{onClick:b,"data-cy":"action-config-component",children:e.jsx(Co,{})})),e.jsxs(e.Fragment,{children:[j,(t||m)&&e.jsx(Ar,{open:!0,fullWidth:!0,maxWidth:"md",title:S,onClose:d,PaperProps:{style:{minHeight:"auto"}},children:h?e.jsxs(y,{mt:1,children:[e.jsx(Ms,{tabs:R,current:g,onChange:c,scrollButtons:"auto"}),v.component]}):e.jsx(ut,{blocklet:a,ancestors:n})})]})}jt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,children:r.any,open:r.bool,onClose:r.func,hiddenChildren:r.bool};jt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Ar=F(gt)`
55
+ `;function jt({blocklet:t,ancestors:o,hasPermission:s,...a}){const{t:n}=z(),{api:i}=J(),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),A.error(x.message),x}},b=C=>{p(n("common.slugifyHint",{value:gt(C)}))};return e.jsx(Br,{component:"div",...a,children:e.jsx(y,{mt:3,children:e.jsx(Rs,{label:n("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:u||S,loading:u,required:!0,initialValue:t.mountPoint,onSubmit:d,onChange:b,helperText:g,formatterBeforeSubmit:C=>ue(C)})})})}const kr=Fe(jt,"mutate_blocklets"),Ur=Fe(jt,"",Me);function Dr(t){const{inService:o}=J();return o?e.jsx(Ur,{...t}):e.jsx(kr,{...t})}jt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,hasPermission:r.bool};jt.defaultProps={ancestors:[],hasPermission:!1};const Br=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)},b=T=>{T.stopPropagation(),l(!0)},C={settings:Ft.hasMountPoint(a.meta)&&{label:u("blocklet.component.setting"),value:"settings",component:e.jsx(Dr,{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),R=x.map(({label:T,value:I})=>({label:T,value:I})),c=T=>{p(T)},v=C[g]||x[0];let j=null;return s||(j=typeof i=="function"?i({open:b}):e.jsx($,{onClick:b,"data-cy":"action-config-component",children:e.jsx(yo,{})})),e.jsxs(e.Fragment,{children:[j,(t||m)&&e.jsx(Nr,{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:R,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 Nr=F(xt)`
56
56
  .MuiDialogContent-root {
57
57
  padding-top: 0;
58
58
  margin-top: -32px;
@@ -63,7 +63,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
63
63
  .ux-dialog_right {
64
64
  padding-right: 20px;
65
65
  }
66
- `,{NODE_MODES:so}=D,Lr=({mode:t,previousMode:o}={})=>t===so.SERVERLESS||o===so.SERVERLESS;var wo={isInServerlessMode:Lr};function Or(){const[t,o]=f.useState(null),{blocklet:s}=ie();return f.useEffect(()=>{o(or(s))},[s]),{storageEndpoint:t}}const Po=f.createContext({}),{Provider:Mr,Consumer:Ja}=Po;function Xt({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=ie(),{storageEndpoint:l}=Or(),{api:u}=J();_o(async()=>{try{if(s(!0),Wn.isEmpty(l)){n(null);return}const d=await sr(l);n(d)}catch(d){console.error(d),A.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 b=await rr(a.endpoint,a.name),C=Wn.merge(a,{name:b});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Mr,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}Xt.propTypes={children:Ke.node.isRequired};Xt.defaultProps={};function $t(){return f.useContext(Po)}const en={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 tn({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(Wo,{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}tn.propTypes=en;function nn({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})}nn.propTypes=en;nn.defaultProps={componentProps:{}};function on({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Ho.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Yo({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(tn,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}on.propTypes={...en,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};on.defaultProps={};const Fr={input:nn,color:tn,passport:on,uploader:t=>e.jsx(ws,{...t.componentProps})};function Gr(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Fr[s==null?void 0:s.toLowerCase()]}function sn({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,R,c){const{key:v,secure:j}=x,I=g[v]!==R,U={...g,[v]:R};I&&p(U),n({[v]:R},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?b(null):b(x)}function b(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:R=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?R?"":"******":v}return e.jsx(zr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:R,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const U=!!(u&&R===u.key),L=C(x,{editing:U}),k=Gr(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:R,description:c,editing:U,value:L,onChange:(B,q="change")=>d(x,B,q),componentProps:I};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(k,{...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(re,{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(Jo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[R],"edit")},disabled:m||u,size:"large",children:e.jsx(cr,{})})})]})]},R)})})}sn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};sn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const zr=F(Ts)``;function rn({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=J(),l=po(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(b,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},R=v=>{A.error(v),o(v)};function c(v){return Qo(()=>eo.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 R(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await R(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Ko(u);await c(v)}else await x({downloadTokenList:b.downloadTokenList&&C(b.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const b=new URL(g);b.pathname="/api/did/verify-purchase-blocklet/token",b.searchParams.set("serverDid",m.did),b.searchParams.set("blockletDid",t==null?void 0:t.did);try{eo.get(b.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:dt.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:dt.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(Ft,{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]})}rn.propTypes={...qs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};rn.defaultProps={handlePaySuccess:()=>{}};const an=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(Vs,{action:a,onNext:null,onSelect:l})}):e.jsx(rn,{...o,mode:a})});an.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};an.defaultProps={ref:{}};const qr=an;function Vr({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function ln({key:t}={key:"sm"}){const o=uo();return _t(o.breakpoints.down(t))}function cn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=ln();return!t||Zo(t.meta)?e.jsx(_r,{children:s}):e.jsxs(Wr,{isMobile:i,children:[e.jsx(Vr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}cn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};cn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const _r=F(y)`
66
+ `,{NODE_MODES:so}=D,Ar=({mode:t,previousMode:o}={})=>t===so.SERVERLESS||o===so.SERVERLESS;var To={isInServerlessMode:Ar};function Lr(){const[t,o]=f.useState(null),{blocklet:s}=ie();return f.useEffect(()=>{o(nr(s))},[s]),{storageEndpoint:t}}const wo=f.createContext({}),{Provider:Or,Consumer:Ya}=wo;function $t({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=ie(),{storageEndpoint:l}=Lr(),{api:u}=J();qo(async()=>{try{if(s(!0),Wn.isEmpty(l)){n(null);return}const d=await or(l);n(d)}catch(d){console.error(d),A.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 b=await sr(a.endpoint,a.name),C=Wn.merge(a,{name:b});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Or,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}$t.propTypes={children:Ke.node.isRequired};$t.defaultProps={};function en(){return f.useContext(wo)}const tn={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 nn({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(_o,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(dr,{color:o,onChange:p=>l(p.hex)})})]});return t?g:h}nn.propTypes=tn;function on({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})}on.propTypes=tn;on.defaultProps={componentProps:{}};function sn({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Wo.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ho({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(nn,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}sn.propTypes={...tn,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};sn.defaultProps={};const Mr={input:on,color:nn,passport:sn,uploader:t=>e.jsx(Ts,{...t.componentProps})};function Fr(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Mr[s==null?void 0:s.toLowerCase()]}function rn({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,R,c){const{key:v,secure:j}=x,I=g[v]!==R,U={...g,[v]:R};I&&p(U),n({[v]:R},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?b(null):b(x)}function b(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:R=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?R?"":"******":v}return e.jsx(Gr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:R,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const U=!!(u&&R===u.key),L=C(x,{editing:U}),k=Fr(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:R,description:c,editing:U,value:L,onChange:(B,V="change")=>d(x,B,V),componentProps:I};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(k,{...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(re,{size:24}):e.jsx(cr,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Yo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[R],"edit")},disabled:m||u,size:"large",children:e.jsx(lr,{})})})]})]},R)})})}rn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};rn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Gr=F(Es)``;function an({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=J(),l=po(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(b,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},R=v=>{A.error(v),o(v)};function c(v){return Ko(()=>eo.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 R(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await R(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Jo(u);await c(v)}else await x({downloadTokenList:b.downloadTokenList&&C(b.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const b=new URL(g);b.pathname="/api/did/verify-purchase-blocklet/token",b.searchParams.set("serverDid",m.did),b.searchParams.set("blockletDid",t==null?void 0:t.did);try{eo.get(b.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]})}an.propTypes={...zs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};an.defaultProps={handlePaySuccess:()=>{}};const ln=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(Vs,{action:a,onNext:null,onSelect:l})}):e.jsx(an,{...o,mode:a})});ln.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};ln.defaultProps={ref:{}};const zr=ln;function Vr({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function cn({key:t}={key:"sm"}){const o=uo();return Wt(o.breakpoints.down(t))}function dn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=cn();return!t||Qo(t.meta)?e.jsx(qr,{children:s}):e.jsxs(_r,{isMobile:i,children:[e.jsx(Vr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}dn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};dn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const qr=F(y)`
67
67
  width: 100%;
68
68
  margin-top: auto;
69
69
  padding-top: 24px;
@@ -78,7 +78,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
78
78
  width: 100%;
79
79
  }
80
80
  }
81
- `,Wr=F(y)`
81
+ `,_r=F(y)`
82
82
  padding-top: 24px;
83
83
  margin-top: auto;
84
84
  width: 100%;
@@ -108,7 +108,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
108
108
  justify-content: space-between;
109
109
  gap: '32px',
110
110
  }}
111
- `;var Io=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+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUiEwBOMsHUisZiXU8k3bVSTrPcHsKEEg8gV/vP7U26vRWhl2UnfEbX3VlVbRHgSwmcy2tWTjsxmIb4YjgbAkmpyEOINs1gCtSC4YsjwnY9l1MJYRz1NMk5NAC3MffnLwiHnNH7IoyER5VEI6S4Um++uKyho0BwmD+1rA90yarpO4ZpjLgs8+BTUfU9w+gkwE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ONYy6WQkAc9+ZocJMnELtCFNKLySGLwUIuW1fJLBKOoydII6+sDlhy8xYI1vchhF6qZnM0/oZSUzcd5By2cDzUtH3ng8PHIzAKL25wuSv+gDBsggYWWkvLT27f2dhwRULpny5D5yKI7vD/4iAW9KWHB7JsEZeCE1E/mdgVHZTOci8X+YIanJt7+aBd2k8f2RL45Z2puefelcXjUWbKdMSYwr58dAPaHymSU0o9/zjFt7/VoGmNAwCyvrKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};Io.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function ko(){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(Io,{style:{width:200,height:250}}),e.jsx(ee,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.providerForStorage")})]})})}ko.propTypes={};function dn({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),A.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(Xo,{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)})]})}dn.propTypes={onDeleteSpace:r.func,spaceGateway:r.shape({name:r.string.isRequired,url:r.string.isRequired,protected:r.bool}).isRequired};dn.defaultProps={onDeleteSpace:()=>{}};var Uo=function(o){return e.jsx("svg",{...o,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Uo.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pn({spaceGateway:t,connected:o,onDisconnect:s,...a}){const n=ln(),{t:i}=z(),m=async()=>{try{await s(),A.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name}))}catch(l){console.error(l),A.error(Z(l))}};return e.jsxs(Hr,{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:ir(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($o,{label:e.jsxs(e.Fragment,{children:[e.jsx(Uo,{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(mo,{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(dn,{spaceGateway:t,onDeleteSpace:m})})})]}),e.jsx(y,{className:"selected-container selected",children:e.jsx(fo,{className:"selected-icon"})})]})}pn.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};pn.defaultProps={connected:!1,onDisconnect:()=>{}};const Hr=F(y)`
111
+ `;var Po=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+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUiEwBOMsHUisZiXU8k3bVSTrPcHsKEEg8gV/vP7U26vRWhl2UnfEbX3VlVbRHgSwmcy2tWTjsxmIb4YjgbAkmpyEOINs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p9sR8MWBNzQTNNrIt4XCVHh+OwfYAo9QybSeFUX5a9bl1On+cL5YHUjp/eID+XwV2AwZUXHswFw0IhIUlwmaTdQtlKJUpbAArh1IONYy6WQkAc9+ZocJMnELtCFNKLySGLwUIuW1fJLBKOoydII6+sDlhy8xYI1vchhF6qZnM0/oZSUzcd5By2cDzUtH3ng8PHIzAKL25wuSv+gDBsggYWWkvLT27f2dhwRULpny5D5yKI7vD/4iAW9KWHB7JsEZeCE1E/mdgVHZTOci8X+YIanJt7+aBd2k8f2RL45Z2puefelcXjUWbKdMSYwr58dAPaHymSU0o9/zjFt7/VoGmNAwCyvrKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};Po.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Io(){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(Po,{style:{width:200,height:250}}),e.jsx(ee,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.providerForStorage")})]})})}Io.propTypes={};function pn({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),A.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(hr,{})}),e.jsx(Zo,{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)})]})}pn.propTypes={onDeleteSpace:r.func,spaceGateway:r.shape({name:r.string.isRequired,url:r.string.isRequired,protected:r.bool}).isRequired};pn.defaultProps={onDeleteSpace:()=>{}};var ko=function(o){return e.jsx("svg",{...o,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};ko.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function un({spaceGateway:t,connected:o,onDisconnect:s,...a}){const n=cn(),{t:i}=z(),m=async()=>{try{await s(),A.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name}))}catch(l){console.error(l),A.error(Z(l))}};return e.jsxs(Wr,{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(mr,{alt:t.did,src:rr(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(Xo,{label:e.jsxs(e.Fragment,{children:[e.jsx(ko,{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(mo,{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(pn,{spaceGateway:t,onDeleteSpace:m})})})]}),e.jsx(y,{className:"selected-container selected",children:e.jsx(fo,{className:"selected-icon"})})]})}un.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};un.defaultProps={connected:!1,onDisconnect:()=>{}};const Wr=F(y)`
112
112
  .selected-container {
113
113
  position: absolute;
114
114
  right: 0px;
@@ -161,12 +161,12 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
161
161
  visibility: visible;
162
162
  }
163
163
  }
164
- `;function Yr(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=$t();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(pn,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function un({onConnect:t,...o}){const{blocklet:s}=ie(),{info:a}=J(),{t:n,locale:i}=z(),[m,l]=f.useState(""),[u,h]=f.useState(!1),[g,p]=f.useState(!1),[S,d]=f.useState(""),b=hr({blocklet:s}),C=po(a),{storageEndpoint:x}=$t(),[R,c]=f.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:dt.create({baseURL:we(window.location.origin,es())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:b.appName},i),scan:n("storage.spaces.provideNFT.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(k=>({...k,open:!1}))}}),[v,j]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:b.appName},i),scan:n("storage.spaces.authorize.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{j(k=>({...k,open:!1}))}}),T=async({did:k,name:M,endpoint:B})=>{const q=await Xn(B);if(!await $n(q)){A.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Q={name:M,did:k,url:q,endpoint:B};await t(Q),A.success(n("storage.spaces.connectedWithName",{name:Q.name}))},I=(k,M)=>{setTimeout(async()=>{if(j(Q=>({...Q,open:!1})),l(null),c(Q=>({...Q,open:!1})),!He(k.spaceGateway)){await T(M(k.spaceGateway));return}const B=M(k.endpoint),q=k.space?M(k.space):{};await T({endpoint:B,did:ar(B),name:"DID Space",...q})},0)},U=()=>{c(k=>({...k,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{h(!0);const k=await Xn(m),M=lr(k),B=new URL(k).searchParams.get("spaceDid");if(!await $n(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:dt.create({baseURL:we(M,"space")}).get,extraParams:{appDid:b.appDid,appName:b.appName,appDescription:b.appDescription,scopes:b.scopes,appUrl:b.appUrl,referrer:b.referrer,nodeDid:a.did,spaceDid:B}})),p(!1)}catch(k){const M=`${n("storage.spaces.gateway.add.failed",i)}: ${Z(k)}`;d(M)}finally{h(!1)}};return e.jsxs(y,{children:[e.jsx(to,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:U,variant:"outlined",menu:[e.jsx(to.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(Ft,{forceConnected:!1,saveConnect:!1,prefix:R.prefix,open:R.open,popup:!0,action:R.action,webWalletUrl:C,baseUrl:R.baseUrl,checkFn:R.checkFn,onSuccess:I,onClose:R.onClose,checkTimeout:R.checkTimeout,extraParams:R.extraParams,messages:R.messages,locale:i}),e.jsx(Ft,{forceConnected:!1,saveConnect:!1,prefix:v.prefix,open:v.open,popup:!0,action:v.action,baseUrl:v.baseUrl,checkFn:v.checkFn,onSuccess:I,onClose:v.onClose,checkTimeout:v.checkTimeout,extraParams:v.extraParams,messages:v.messages,locale:i}),e.jsxs(gt,{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(ne,{onClick:k=>{k.stopPropagation(),p(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(ne,{onClick:L,color:"primary",disabled:u||!m,variant:"contained",autoFocus:!0,children:[u&&e.jsx(re,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(ts,{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:k=>{d(null),l(k.target.value)},disabled:u,onKeyPress:async k=>{k.key==="Enter"&&await L()},autoFocus:!0})})})}),!!S&&e.jsx(ho,{type:"error",style:{width:"100%"},children:S})]})]})}un.propTypes={onConnect:Ke.func};un.defaultProps={onConnect:()=>{}};function mn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=ln(),{blocklet:a}=ie(),{updateSpaceGateway:n,loading:i,hasStorageEndpoint:m}=$t();return f.useEffect(()=>{o==null||o()},[a]),i?e.jsx(ns,{relative:"parent",children:e.jsx(re,{})}):e.jsxs(Jr,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx(Yr,{}):e.jsx(ko,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(cn,{mt:8,children:e.jsx(un,{onConnect:n})})]})}mn.propTypes={blockletMeta:r.any.isRequired,onEndpointUpdate:Ke.func};mn.defaultProps={onEndpointUpdate:()=>{}};const Jr=F(Ps)`
164
+ `;function Hr(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=en();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(un,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function mn({onConnect:t,...o}){const{blocklet:s}=ie(),{info:a}=J(),{t:n,locale:i}=z(),[m,l]=f.useState(""),[u,h]=f.useState(!1),[g,p]=f.useState(!1),[S,d]=f.useState(""),b=fr({blocklet:s}),C=po(a),{storageEndpoint:x}=en(),[R,c]=f.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:pt.create({baseURL:we(window.location.origin,$o())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:b.appName},i),scan:n("storage.spaces.provideNFT.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(k=>({...k,open:!1}))}}),[v,j]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:b.appName},i),scan:n("storage.spaces.authorize.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{j(k=>({...k,open:!1}))}}),T=async({did:k,name:M,endpoint:B})=>{const V=await Xn(B);if(!await $n(V)){A.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Q={name:M,did:k,url:V,endpoint:B};await t(Q),A.success(n("storage.spaces.connectedWithName",{name:Q.name}))},I=(k,M)=>{setTimeout(async()=>{if(j(Q=>({...Q,open:!1})),l(null),c(Q=>({...Q,open:!1})),!He(k.spaceGateway)){await T(M(k.spaceGateway));return}const B=M(k.endpoint),V=k.space?M(k.space):{};await T({endpoint:B,did:ir(B),name:"DID Space",...V})},0)},U=()=>{c(k=>({...k,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{h(!0);const k=await Xn(m),M=ar(k),B=new URL(k).searchParams.get("spaceDid");if(!await $n(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:b.appDid,appName:b.appName,appDescription:b.appDescription,scopes:b.scopes,appUrl:b.appUrl,referrer:b.referrer,nodeDid:a.did,spaceDid:B}})),p(!1)}catch(k){const M=`${n("storage.spaces.gateway.add.failed",i)}: ${Z(k)}`;d(M)}finally{h(!1)}};return e.jsxs(y,{children:[e.jsx(to,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:U,variant:"outlined",menu:[e.jsx(to.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:R.prefix,open:R.open,popup:!0,action:R.action,webWalletUrl:C,baseUrl:R.baseUrl,checkFn:R.checkFn,onSuccess:I,onClose:R.onClose,checkTimeout:R.checkTimeout,extraParams:R.extraParams,messages:R.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:I,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(ne,{onClick:k=>{k.stopPropagation(),p(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(ne,{onClick:L,color:"primary",disabled:u||!m,variant:"contained",autoFocus:!0,children:[u&&e.jsx(re,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(es,{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:k=>{d(null),l(k.target.value)},disabled:u,onKeyPress:async k=>{k.key==="Enter"&&await L()},autoFocus:!0})})})}),!!S&&e.jsx(dt,{severity:"error",style:{width:"100%"},children:S})]})]})}mn.propTypes={onConnect:Ke.func};mn.defaultProps={onConnect:()=>{}};function fn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=cn(),{blocklet:a}=ie(),{updateSpaceGateway:n,loading:i,hasStorageEndpoint:m}=en();return f.useEffect(()=>{o==null||o()},[a]),i?e.jsx(ts,{relative:"parent",children:e.jsx(re,{})}):e.jsxs(Yr,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx(Hr,{}):e.jsx(Io,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(dn,{mt:8,children:e.jsx(mn,{onConnect:n})})]})}fn.propTypes={blockletMeta:r.any.isRequired,onEndpointUpdate:Ke.func};fn.defaultProps={onEndpointUpdate:()=>{}};const Yr=F(ws)`
165
165
  height: 100%;
166
166
  overflow-y: auto;
167
167
  padding-bottom: 32px;
168
168
  overflow-x: hidden;
169
- `;function fn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:i}){const{t:m}=z(),{info:l,inService:u}=J(),{blocklet:h}=ie(),[g,p]=f.useState(!1),S=f.useRef(null),[d,b]=f.useState(),[C,x]=yr(i||"tmp"),[R,c]=i?[C,x]:[d,b],{storeList:v,teamDid:j}=go({fromBlocklet:u,blocklet:h,nodeInfo:l}),T=vo([...n.map(U=>({...U,protected:!0})),...v],"url"),I=R&&T.find(U=>R===U.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Kr,{children:[e.jsx(ne,{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:I.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:I,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(_s,{teamDid:j,store:U,onDelete:()=>{var L;R===U.url&&c((L=T[0])==null?void 0:L.url)}})},U.url)),!wo.isInServerlessMode(l)&&e.jsx(Ws,{disabled:o,storeList:T,teamDid:j,onAdd:U=>{c(U)}})]}),s({currentRegistry:I})]})}fn.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}))};fn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Kr=F.div`
169
+ `;function hn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:i}){const{t:m}=z(),{info:l,inService:u}=J(),{blocklet:h}=ie(),[g,p]=f.useState(!1),S=f.useRef(null),[d,b]=f.useState(),[C,x]=xr(i||"tmp"),[R,c]=i?[C,x]:[d,b],{storeList:v,teamDid:j}=ho({fromBlocklet:u,blocklet:h,nodeInfo:l}),T=jo([...n.map(U=>({...U,protected:!0})),...v],"url"),I=R&&T.find(U=>R===U.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Jr,{children:[e.jsx(ne,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(gr,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:e.jsx(ee,{color:"primary",children:I.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:I,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(qs,{teamDid:j,store:U,onDelete:()=>{var L;R===U.url&&c((L=T[0])==null?void 0:L.url)}})},U.url)),!To.isInServerlessMode(l)&&e.jsx(_s,{disabled:o,storeList:T,teamDid:j,onAdd:U=>{c(U)}})]}),s({currentRegistry:I})]})}hn.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}))};hn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Jr=F.div`
170
170
  display: flex;
171
171
  justify-content: space-between;
172
172
  align-items: center;
@@ -177,13 +177,13 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
177
177
  color: ${t=>t.theme.palette.common.black};
178
178
  // font-weight: bold;
179
179
  }
180
- `;var hn={},Qr=Vt;Object.defineProperty(hn,"__esModule",{value:!0});var Do=hn.default=void 0,Zr=Qr(qt()),Xr=e;Do=hn.default=(0,Zr.default)((0,Xr.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const $r=(t,o)=>we(o,`/blocklets/${t.did}`),ro=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,ei=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function gn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let i=we(a,rs(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){A.error(x.message)}finally{l(!1)}},{blocklet:g}=ie(),p=()=>((g==null?void 0:g.children)||[]).find(R=>R.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,R=t.version;if(is.gt(R,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let b=n("blocklet.component.choose");return d==="upgrade"?b=n("blocklet.component.upgrade"):d==="disable"?b=n("blocklet.component.installed"):ei(t)&&(b=n("common.purchase")),e.jsx(xt,{href:$r(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(ti,{title:ro({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:ro({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(ne,{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(re,{size:16,style:{marginRight:3}}),b]}):b,d==="upgrade"?e.jsx(Do,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}gn.propTypes={blocklet:r.object.isRequired,blocklets:r.array,handleButtonClick:r.func,endpoint:r.string};gn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function xn({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),[b,C]=f.useState({}),x=c=>{C(c)},R=s;return f.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[R,m,l]),f.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(os,{FallbackComponent:ss,resetKeys:[R],children:e.jsx("div",{...g,children:S&&e.jsx(Hs,{showCategory:h,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:R};return a({...c,defaultRender:e.jsx(gn,{...v})})},baseSearch:!0,endpoint:R,locale:p,onFilterChange:x,onSearchSelect:o,filters:b,extraFilter:n,serverVersion:i,fetchCategoryDelay:500})})})}xn.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};xn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const ti=F(Js)`
180
+ `;var gn={},Kr=_t;Object.defineProperty(gn,"__esModule",{value:!0});var Uo=gn.default=void 0,Qr=Kr(qt()),Zr=e;Uo=gn.default=(0,Qr.default)((0,Zr.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const Xr=(t,o)=>we(o,`/blocklets/${t.did}`),ro=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,$r=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function xn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let i=we(a,ss(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){A.error(x.message)}finally{l(!1)}},{blocklet:g}=ie(),p=()=>((g==null?void 0:g.children)||[]).find(R=>R.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,R=t.version;if(rs.gt(R,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let b=n("blocklet.component.choose");return d==="upgrade"?b=n("blocklet.component.upgrade"):d==="disable"?b=n("blocklet.component.installed"):$r(t)&&(b=n("common.purchase")),e.jsx(yt,{href:Xr(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(ei,{title:ro({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:ro({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(ne,{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(re,{size:16,style:{marginRight:3}}),b]}):b,d==="upgrade"?e.jsx(Uo,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}xn.propTypes={blocklet:r.object.isRequired,blocklets:r.array,handleButtonClick:r.func,endpoint:r.string};xn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function yn({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),[b,C]=f.useState({}),x=c=>{C(c)},R=s;return f.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[R,m,l]),f.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(ns,{FallbackComponent:os,resetKeys:[R],children:e.jsx("div",{...g,children:S&&e.jsx(Ws,{showCategory:h,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:R};return a({...c,defaultRender:e.jsx(xn,{...v})})},baseSearch:!0,endpoint:R,locale:p,onFilterChange:x,onSearchSelect:o,filters:b,extraFilter:n,serverVersion:i,fetchCategoryDelay:500})})})}yn.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};yn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const ei=F(Ys)`
181
181
  .ms-highlight {
182
182
  color: ${t=>t.theme.palette.primary.main};
183
183
  }
184
- `,yn=f.forwardRef(({meta:t,isMobile:o,onStepChange:s},a)=>{const{steps:n,activeStep:i,setActiveStepByKey:m,setActiveStepByIndex:l}=Zs(),{t:u,locale:h}=z(),g=n[i];return f.useEffect(()=>{s(i)},[s,i]),f.useImperativeHandle(a,()=>({setActiveStepByKey:m,setActiveStepByIndex:l})),e.jsx(oi,{component:"div",className:o?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:e.jsx(Xs,{locale:h,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?as({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:u("blocklet.component.add"),children:e.jsx(ni,{children:g!=null&&g.body&&typeof g.body=="function"?g.body():g.body})})})});yn.propTypes={meta:r.any,onStepChange:r.func.isRequired,isMobile:r.bool.isRequired};yn.defaultProps={meta:null};const io=t=>t.isMobile?`
184
+ `,Cn=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(ni,{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?is({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:u("blocklet.component.add"),children:e.jsx(ti,{children:g!=null&&g.body&&typeof g.body=="function"?g.body():g.body})})})});Cn.propTypes={meta:r.any,onStepChange:r.func.isRequired,isMobile:r.bool.isRequired};Cn.defaultProps={meta:null};const io=t=>t.isMobile?`
185
185
  height: calc(100vh - 56px - 64px - 48px);
186
- `:"",ni=F.div`
186
+ `:"",ti=F.div`
187
187
  width: 100%;
188
188
  height: 100%;
189
189
  display: flex;
@@ -199,7 +199,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
199
199
  aside {
200
200
  width: 140px;
201
201
  }
202
- `,oi=F(y)`
202
+ `,ni=F(y)`
203
203
  ${({className:t})=>t==="mobileStyle"?`
204
204
  & > div{
205
205
  height: 100%;
@@ -319,7 +319,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
319
319
  & .connect {
320
320
  background: white;
321
321
  }
322
- `,si=yn,ri=t=>t.inStore&&O.isFreeBlocklet(t)===!1,ii=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)},Lt=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},ai=t=>(t.environments||[]).some(o=>o.required),ao=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),li=({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")},lo=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function Cn({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 An,Ln,On,$e,Mn,et,Fn;const{t:d,locale:b}=z(),[C,x]=f.useState(!1),[R,c]=f.useState(null),[v,j]=f.useState(""),[T,I]=f.useState(""),{api:U,ws:{useSubscription:L},inService:k,info:M}=J(),{blocklet:B,actions:{refreshBlocklet:q}}=ie(),[Q,Ie]=f.useState(null),[te,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},[w,ke]=f.useState(Se),[me,Ze]=f.useState(0),V=f.useRef({}),P=f.useRef({}),_=f.useRef({}),oe=_t(E=>E.breakpoints.down("md")),xe=ls(),[se,ze]=f.useState(!0),{meta:Y}=V.current,H=E=>ke(N=>({...N,...E}));f.useEffect(()=>{if(w.pathPrefix){const{errMsg:E}=Nn({...w,pathPrefix:w.pathPrefix,locale:b});j(E)}},[w.pathPrefix]),f.useEffect(()=>{me===0&&ke(Se)},[me]);const be=()=>{const E=Lt(B)??"";H({didSpaceEndpoint:E})},Ue=()=>{var E;return(E=V==null?void 0:V.current)!=null&&E.meta?O.getDisplayName(V.current):""},De=E=>{const N=G=>{H({installResultProps:{variant:"error",title:Ue(),subTitle:E,footer:e.jsx(ne,{className:"bottom-button",disabled:G,"data-cy":"retry-install-component",onClick:async()=>{N(!0),await Bn(V.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[G&&e.jsx(re,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};N()},Et=E=>N=>{var G,W;(((G=N==null?void 0:N.meta)==null?void 0:G.did)||(N==null?void 0:N.meta))===((W=B==null?void 0:B.meta)==null?void 0:W.did)&&E(N)};L(X.BlockletEvents.statusChange,Et(E=>{switch(E.status){case X.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:Ue(),subTitle:d("blocklet.component.installSuccessTip")}}),lo({componentDid:xe.componentDid});break}const N=Lt(B);H(G=>({...G,didSpaceEndpoint:N}))}),[(An=B==null?void 0:B.meta)==null?void 0:An.did]),L(X.BlockletEvents.downloadFailed,Et(()=>{De(d("blocklet.component.installComponentError"))}),[(Ln=B==null?void 0:B.meta)==null?void 0:Ln.did]),L(X.BlockletEvents.installFailed,Et(()=>{De(d("blocklet.component.installComponentError"))}),[(On=B==null?void 0:B.meta)==null?void 0:On.did]);const pe=[],Tt=()=>{x(!1),ke({}),V.current={},t()},Xe=E=>((B==null?void 0:B.children)||[]).some(N=>N.meta.did===E),Bn=async E=>{var Ne,Ae;const{pathPrefix:N,bundleDid:G,title:W,componentName:Re="",componentDid:Be=""}=w,Ee=((Ne=V.current)==null?void 0:Ne.meta)||{},{configs:ye=[],registryUrl:je,inStore:Ve,inputUrl:_e,dist:Pt}=Ee,We=(Ae=V.current)==null?void 0:Ae.downloadTokenList,le=Ve?Hn(je,G,Pt):_e;x(!0);const tt={rootDid:B.meta.did,url:le,mountPoint:N?ue(N):`/${ue(Ee.title||Ee.name)}`,title:W,name:Re,did:Be,onlyRequired:!se,...w.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:w.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await U.installComponent({input:tt}),je){const{teamDid:he,storeList:Le}=go({fromBlocklet:k,nodeInfo:M,blocklet:B}),{isNew:It,decoded:nt}=ps(je,Le);It&&await U.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),q({showError:!1,attachRuntimeInfo:!1})}catch(he){const Le=Z(he);A.error(Le),console.error("installComponent error: ",he),De(Le)}finally{x(!1),V.current.installInput=tt}},Nn=E=>({errMsg:So({params:{...E,did:E.bundleDid},blocklets:[B],blocklet:B,locale:b})}),fe=async E=>{var G,W;const{errMsg:N}=Nn({...w,locale:b});j(N),me===pe.length-2&&await Bn(E),(W=(G=P.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,Re=>Re+1)},qe=()=>{var E,N;(N=(E=P.current)==null?void 0:E.setActiveStepByIndex)==null||N.call(E,G=>G-1)},Oo=()=>{const{pathPrefix:E,bundleDid:N,title:G,componentName:W="",componentDid:Re=""}=w,{meta:Be={}}=V.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:Ve}=Be,_e=ye?Hn(Ee,N,Ve):je;Ie({meta:Be,installOpts:{type:"component",rootDid:B.meta.did,mountPoint:E,url:_e,title:G,name:W,did:Re}})},Mo=E=>{de(!1),H({purchaseResultProps:{variant:"error",title:Ue(),subTitle:E,style:{paddingTop:120},footer:e.jsx(ne,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{H({purchaseResultProps:{}})},children:d("common.retry")})}})},Fo=({downloadTokenList:E})=>{V.current.downloadTokenList=E,de(!1),fe()},wt=({chooseParams:E=V.current,componentDid:N,isInit:G=!1})=>{var nt,Gn,zn,qn;const{meta:W,registryUrl:Re,inStore:Be,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),Pt=N||"",We=(Gn=W.environments)==null?void 0:Gn.map(ce=>{const{name:kt,validation:ot,...st}=ce,Ut={validation:cs(ot)?"":ot};return{...st,key:kt,...Ut}});V.current={...E,meta:{...W,configs:We,registryUrl:Re,inStore:Be,inputUrl:Ee}};let le={};if(G){const ce=[B],kt=We||[],ot=[],st=vo(ds([...kt,...ot]),"key").filter(Oe=>!!Oe.key).sort((Oe,rt)=>Oe.required&&!rt.required?-1:rt.required&&!Oe.required?1:0),Ut=O.getSharedConfigObj(ce[0],{configs:st}),Dt={},Vn=st.map(Oe=>{const{default:rt,key:it,...zo}=Oe;return Dt[it]=Ut[it]||rt,{...zo,key:it,hidden:!!X.BLOCKLET_CONFIGURABLE_KEY[it]}});le={...le,configsList:Vn,configsValue:Dt,hasMissRequiredConfigs:ao(Vn,Dt)}}const tt=B.children.some(ce=>ce.mountPoint==="/"),Ne=_e.find(ce=>ce.meta.bundleDid===ye),Ae=B.children.find(ce=>ce.meta.bundleDid===ye);le.title=je||"",Ne?le={...le,pathPrefix:Ne.mountPoint||"",componentName:Ne.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:((qn=(zn=V.current.meta)==null?void 0:zn.environments)==null?void 0:qn.length)>0};const he=ri(V.current.meta),Le=ii(V.current.meta),It=Lt(B);H({bundleDid:ye,componentDid:Pt,...le,hasRequiredEnvironments:ai(V.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Le,didSpaceEndpoint:It}),G&&he&&Oo()};f.useEffect(()=>{!l||me!==0||!B||(wt({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&&w.showFromUrlDialog&&e.jsx(ur,{mode:"component",onCancel:()=>{H({showFromUrlDialog:!1})},onSuccess:({meta:E,inputUrl:N,inStore:G,registryUrl:W})=>{wt({chooseParams:{meta:E,inputUrl:N,inStore:G,registryUrl:W},isInit:!0}),H({showFromUrlDialog:!1}),fe()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),e.jsx(fn,{stores:s,extra:wo.isInServerlessMode(M)?null:g?e.jsxs(ne,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{H({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Kt,{style:{fontSize:20,marginRight:4}})," ",d("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:C,onChange:()=>{ke({}),V.current={}},storageKey:i,children:({currentRegistry:E})=>e.jsx(xn,{showResourcesSwitch:h,showCategory:S,serverVersion:M==null?void 0:M.version,style:oe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:E.url,resourceType:a,resourceDid:n,handleButtonClick:N=>{wt({chooseParams:{...N,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:N,defaultRender:G})=>{const W=(w==null?void 0:w.bundleDid)&&(w==null?void 0:w.bundleDid)===(N==null?void 0:N.did);return e.jsxs(di,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(fo,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:li({params:w,blocklet:B,t:d}),onCancel:Tt,onConfirm:()=>{fe()}}),pe.push({key:"agreement",name:d("launchBlocklet.introduction"),body:e.jsxs(Te,{component:"div",className:"agreement-wrapper",children:[e.jsx(jo,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(Is,{meta:Y,onClickNext:fe,installRelated:se,onChangeInstallRelated:ze,handleDescEle:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:e.jsx("div",{dangerouslySetInnerHTML:{__html:d(`blocklet.component.addComponentTip.${w.requirePurchase?"isPurchase":"isFree"}`,{name:Ue()})}})}),e.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:l?void 0:d("common.pre"),confirm:d("launchBlocklet.next"),onCancel:l?Tt:qe,onConfirm:()=>{de(!1),fe()}}),Y&&w.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:[!(((Mn=($e=_.current)==null?void 0:$e.getCurrentStep)==null?void 0:Mn.call($e))===2||te)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(w.purchaseResultProps)?Q&&e.jsx(qr,{ref:_,meta:Q.meta,mode:w.componentDid?"verify":"both",onCancel:Mo,installOpts:Q.installOpts,handlePaySuccess:Fo}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Zn,{...w.purchaseResultProps})})]}),disabled:((Fn=(et=_.current)==null?void 0:et.getCurrentStep)==null?void 0:Fn.call(et))===2||te,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof _.current.onNext=="function"&&(_.current.onNext(),de(!0))},onCancel:()=>{qe()}}),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(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:w.pathPrefix,onChange:E=>{const N=E.target.value;H({pathPrefix:N}),I(d("common.slugifyHint",{value:ht(N)}))}}),!!v&&e.jsx(ho,{type:"error",style:{width:"100%",marginTop:8},children:v})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:()=>{fe()}}),Y&&!Xe(Y.did)&&(w!=null&&w.hasEnvironmentsStep)&&pe.push({key:"environment",name:e.jsxs(e.Fragment,{children:[d("common.environment")," ",w.hasRequiredEnvironments&&e.jsx(ct,{})]}),disabled:!!R||(w==null?void 0:w.hasMissRequiredConfigs),body:()=>e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),e.jsx(sn,{style:{marginTop:-12,width:"100%"},schema:w.configsList,defaultValue:w.configsValue,onChange:(E,{action:N,currentItem:G,allValues:W})=>{N==="confirm"&&H({hasMissRequiredConfigs:ao(w.configsList,W),configsValue:W}),N==="edit"?c(G):["cancel","confirm"].includes(N)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:fe}),Y&&!Xe(Y.did)&&(w!=null&&w.didSpaceIsRequiredSetup)&&pe.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",w.didSpaceIsRequiredSetup==="required"&&e.jsx(ct,{})]}),disabled:(w==null?void 0:w.didSpaceIsRequiredSetup)&&!w.didSpaceEndpoint,body:()=>e.jsx(Xt,{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(mn,{blockletMeta:V.current.meta,onNext:()=>{fe()},onEndpointUpdate:be})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:fe}),pe.push({key:"install",name:Xe(Y==null?void 0:Y.did)?d("common.upgrade"):d("common.install"),disabled:p?!1:He(w.installResultProps),loading:p?!1:He(w.installResultProps),body:e.jsx(Te,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:He(w.installResultProps)?e.jsx($s,{message:e.jsx(pi,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Zn,{...w.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{lo({timeout:0,componentDid:xe.componentDid,manual:!0}),Tt(),setTimeout(()=>{const E=document.getElementsByClassName("dashboard-main")[0];E&&(E.scrollTop=E.scrollHeight)},200)}});const ae=pe[me]||{},Go=()=>C||ae.error||!w.bundleDid?!0:me>1?!w.pathPrefix:!1;return B?e.jsxs(ci,{sx:{width:"100%",height:oe?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx(er,{steps:pe,mode:"memory",children:e.jsx(si,{ref:P,meta:Y,isMobile:oe,onStepChange:E=>{Ze(E)}})}),e.jsxs(y,{className:"action-bar",children:[ae.cancel&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onCancel()},disabled:me===pe.length-2&&C,color:"inherit",children:ae.cancel||d("common.cancel")}),ae.confirm&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof ae.disabled=="boolean"?ae.disabled:Go()),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(re,{style:{marginRight:8},size:16}),ae.confirm]})})]})]}):null}Cn.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};Cn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const ci=F(y)`
322
+ `,oi=Cn,si=t=>t.inStore&&O.isFreeBlocklet(t)===!1,ri=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},ii=t=>(t.environments||[]).some(o=>o.required),ao=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),ai=({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")},lo=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function jn({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 Ln,On,Mn,$e,Fn,et,Gn;const{t:d,locale:b}=z(),[C,x]=f.useState(!1),[R,c]=f.useState(null),[v,j]=f.useState(""),[T,I]=f.useState(""),{api:U,ws:{useSubscription:L},inService:k,info:M}=J(),{blocklet:B,actions:{refreshBlocklet:V}}=ie(),[Q,Ie]=f.useState(null),[te,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},[w,ke]=f.useState(Se),[me,Ze]=f.useState(0),q=f.useRef({}),P=f.useRef({}),_=f.useRef({}),oe=Wt(E=>E.breakpoints.down("md")),xe=as(),[se,ze]=f.useState(!0),{meta:Y}=q.current,H=E=>ke(N=>({...N,...E}));f.useEffect(()=>{if(w.pathPrefix){const{errMsg:E}=An({...w,pathPrefix:w.pathPrefix,locale:b});j(E)}},[w.pathPrefix]),f.useEffect(()=>{me===0&&ke(Se)},[me]);const be=()=>{const E=Ot(B)??"";H({didSpaceEndpoint:E})},Ue=()=>{var E;return(E=q==null?void 0:q.current)!=null&&E.meta?O.getDisplayName(q.current):""},De=E=>{const N=G=>{H({installResultProps:{variant:"error",title:Ue(),subTitle:E,footer:e.jsx(ne,{className:"bottom-button",disabled:G,"data-cy":"retry-install-component",onClick:async()=>{N(!0),await Nn(q.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[G&&e.jsx(re,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};N()},Tt=E=>N=>{var G,W;(((G=N==null?void 0:N.meta)==null?void 0:G.did)||(N==null?void 0:N.meta))===((W=B==null?void 0:B.meta)==null?void 0:W.did)&&E(N)};L(X.BlockletEvents.statusChange,Tt(E=>{switch(E.status){case X.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:Ue(),subTitle:d("blocklet.component.installSuccessTip")}}),lo({componentDid:xe.componentDid});break}const N=Ot(B);H(G=>({...G,didSpaceEndpoint:N}))}),[(Ln=B==null?void 0:B.meta)==null?void 0:Ln.did]),L(X.BlockletEvents.downloadFailed,Tt(()=>{De(d("blocklet.component.installComponentError"))}),[(On=B==null?void 0:B.meta)==null?void 0:On.did]),L(X.BlockletEvents.installFailed,Tt(()=>{De(d("blocklet.component.installComponentError"))}),[(Mn=B==null?void 0:B.meta)==null?void 0:Mn.did]);const pe=[],wt=()=>{x(!1),ke({}),q.current={},t()},Xe=E=>((B==null?void 0:B.children)||[]).some(N=>N.meta.did===E),Nn=async E=>{var Ne,Ae;const{pathPrefix:N,bundleDid:G,title:W,componentName:Re="",componentDid:Be=""}=w,Ee=((Ne=q.current)==null?void 0:Ne.meta)||{},{configs:ye=[],registryUrl:je,inStore:qe,inputUrl:_e,dist:It}=Ee,We=(Ae=q.current)==null?void 0:Ae.downloadTokenList,le=qe?Hn(je,G,It):_e;x(!0);const tt={rootDid:B.meta.did,url:le,mountPoint:N?ue(N):`/${ue(Ee.title||Ee.name)}`,title:W,name:Re,did:Be,onlyRequired:!se,...w.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:w.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await U.installComponent({input:tt}),je){const{teamDid:he,storeList:Le}=ho({fromBlocklet:k,nodeInfo:M,blocklet:B}),{isNew:kt,decoded:nt}=ds(je,Le);kt&&await U.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),V({showError:!1,attachRuntimeInfo:!1})}catch(he){const Le=Z(he);A.error(Le),console.error("installComponent error: ",he),De(Le)}finally{x(!1),q.current.installInput=tt}},An=E=>({errMsg:vo({params:{...E,did:E.bundleDid},blocklets:[B],blocklet:B,locale:b})}),fe=async E=>{var G,W;const{errMsg:N}=An({...w,locale:b});j(N),me===pe.length-2&&await Nn(E),(W=(G=P.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,Re=>Re+1)},Ve=()=>{var E,N;(N=(E=P.current)==null?void 0:E.setActiveStepByIndex)==null||N.call(E,G=>G-1)},Lo=()=>{const{pathPrefix:E,bundleDid:N,title:G,componentName:W="",componentDid:Re=""}=w,{meta:Be={}}=q.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:qe}=Be,_e=ye?Hn(Ee,N,qe):je;Ie({meta:Be,installOpts:{type:"component",rootDid:B.meta.did,mountPoint:E,url:_e,title:G,name:W,did:Re}})},Oo=E=>{de(!1),H({purchaseResultProps:{variant:"error",title:Ue(),subTitle:E,style:{paddingTop:120},footer:e.jsx(ne,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{H({purchaseResultProps:{}})},children:d("common.retry")})}})},Mo=({downloadTokenList:E})=>{q.current.downloadTokenList=E,de(!1),fe()},Pt=({chooseParams:E=q.current,componentDid:N,isInit:G=!1})=>{var nt,zn,Vn,qn;const{meta:W,registryUrl:Re,inStore:Be,inputUrl:Ee}=E,{did:ye,title:je,name:qe}=W,_e=(((nt=B.settings)==null?void 0:nt.children)||[]).filter(ce=>ce.status==="deleted"&&ce.meta.bundleDid===ye),It=N||"",We=(zn=W.environments)==null?void 0:zn.map(ce=>{const{name:Ut,validation:ot,...st}=ce,Dt={validation:ls(ot)?"":ot};return{...st,key:Ut,...Dt}});q.current={...E,meta:{...W,configs:We,registryUrl:Re,inStore:Be,inputUrl:Ee}};let le={};if(G){const ce=[B],Ut=We||[],ot=[],st=jo(cs([...Ut,...ot]),"key").filter(Oe=>!!Oe.key).sort((Oe,rt)=>Oe.required&&!rt.required?-1:rt.required&&!Oe.required?1:0),Dt=O.getSharedConfigObj(ce[0],{configs:st}),Bt={},_n=st.map(Oe=>{const{default:rt,key:it,...Go}=Oe;return Bt[it]=Dt[it]||rt,{...Go,key:it,hidden:!!X.BLOCKLET_CONFIGURABLE_KEY[it]}});le={...le,configsList:_n,configsValue:Bt,hasMissRequiredConfigs:ao(_n,Bt)}}const tt=B.children.some(ce=>ce.mountPoint==="/"),Ne=_e.find(ce=>ce.meta.bundleDid===ye),Ae=B.children.find(ce=>ce.meta.bundleDid===ye);le.title=je||"",Ne?le={...le,pathPrefix:Ne.mountPoint||"",componentName:Ne.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:((qn=(Vn=q.current.meta)==null?void 0:Vn.environments)==null?void 0:qn.length)>0};const he=si(q.current.meta),Le=ri(q.current.meta),kt=Ot(B);H({bundleDid:ye,componentDid:It,...le,hasRequiredEnvironments:ii(q.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Le,didSpaceEndpoint:kt}),G&&he&&Lo()};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&&w.showFromUrlDialog&&e.jsx(pr,{mode:"component",onCancel:()=>{H({showFromUrlDialog:!1})},onSuccess:({meta:E,inputUrl:N,inStore:G,registryUrl:W})=>{Pt({chooseParams:{meta:E,inputUrl:N,inStore:G,registryUrl:W},isInit:!0}),H({showFromUrlDialog:!1}),fe()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),e.jsx(hn,{stores:s,extra:To.isInServerlessMode(M)?null:g?e.jsxs(ne,{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:()=>{ke({}),q.current={}},storageKey:i,children:({currentRegistry:E})=>e.jsx(yn,{showResourcesSwitch:h,showCategory:S,serverVersion:M==null?void 0:M.version,style:oe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:E.url,resourceType:a,resourceDid:n,handleButtonClick:N=>{Pt({chooseParams:{...N,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:N,defaultRender:G})=>{const W=(w==null?void 0:w.bundleDid)&&(w==null?void 0:w.bundleDid)===(N==null?void 0:N.did);return e.jsxs(ci,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(fo,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:ai({params:w,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(Co,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(Ps,{meta:Y,onClickNext:fe,installRelated:se,onChangeInstallRelated:ze,handleDescEle:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:e.jsx("div",{dangerouslySetInnerHTML:{__html:d(`blocklet.component.addComponentTip.${w.requirePurchase?"isPurchase":"isFree"}`,{name:Ue()})}})}),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&&w.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:[!(((Fn=($e=_.current)==null?void 0:$e.getCurrentStep)==null?void 0:Fn.call($e))===2||te)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(w.purchaseResultProps)?Q&&e.jsx(zr,{ref:_,meta:Q.meta,mode:w.componentDid?"verify":"both",onCancel:Oo,installOpts:Q.installOpts,handlePaySuccess:Mo}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Zn,{...w.purchaseResultProps})})]}),disabled:((Gn=(et=_.current)==null?void 0:et.getCurrentStep)==null?void 0:Gn.call(et))===2||te,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(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:w.pathPrefix,onChange:E=>{const N=E.target.value;H({pathPrefix:N}),I(d("common.slugifyHint",{value:gt(N)}))}}),!!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)&&(w!=null&&w.hasEnvironmentsStep)&&pe.push({key:"environment",name:e.jsxs(e.Fragment,{children:[d("common.environment")," ",w.hasRequiredEnvironments&&e.jsx(ct,{})]}),disabled:!!R||(w==null?void 0:w.hasMissRequiredConfigs),body:()=>e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),e.jsx(rn,{style:{marginTop:-12,width:"100%"},schema:w.configsList,defaultValue:w.configsValue,onChange:(E,{action:N,currentItem:G,allValues:W})=>{N==="confirm"&&H({hasMissRequiredConfigs:ao(w.configsList,W),configsValue:W}),N==="edit"?c(G):["cancel","confirm"].includes(N)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Ve,onConfirm:fe}),Y&&!Xe(Y.did)&&(w!=null&&w.didSpaceIsRequiredSetup)&&pe.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",w.didSpaceIsRequiredSetup==="required"&&e.jsx(ct,{})]}),disabled:(w==null?void 0:w.didSpaceIsRequiredSetup)&&!w.didSpaceEndpoint,body:()=>e.jsx($t,{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(fn,{blockletMeta:q.current.meta,onNext:()=>{fe()},onEndpointUpdate:be})})]})}),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(w.installResultProps),loading:p?!1:He(w.installResultProps),body:e.jsx(Te,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:He(w.installResultProps)?e.jsx(Xs,{message:e.jsx(di,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Zn,{...w.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{lo({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]||{},Fo=()=>C||ae.error||!w.bundleDid?!0:me>1?!w.pathPrefix:!1;return B?e.jsxs(li,{sx:{width:"100%",height:oe?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx($s,{steps:pe,mode:"memory",children:e.jsx(oi,{ref:P,meta:Y,isMobile:oe,onStepChange:E=>{Ze(E)}})}),e.jsxs(y,{className:"action-bar",children:[ae.cancel&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onCancel()},disabled:me===pe.length-2&&C,color:"inherit",children:ae.cancel||d("common.cancel")}),ae.confirm&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof ae.disabled=="boolean"?ae.disabled:Fo()),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(re,{style:{marginRight:8},size:16}),ae.confirm]})})]})]}):null}jn.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};jn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const li=F(y)`
323
323
  .action-bar {
324
324
  display: flex;
325
325
  justify-content: flex-end;
@@ -334,9 +334,9 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
334
334
  `,Te=F(ee)`
335
335
  width: 100%;
336
336
  height: 100%;
337
- `,lt=F(jo)`
337
+ `,lt=F(Co)`
338
338
  margin-bottom: 24px;
339
- `,di=F.div`
339
+ `,ci=F.div`
340
340
  position: relative;
341
341
 
342
342
  .choose-blocklet {
@@ -380,7 +380,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
380
380
  transition: all ease 0.2s;
381
381
  }
382
382
  }
383
- `,pi=F.div`
383
+ `,di=F.div`
384
384
  color: ${t=>t.theme.palette.primary.main};
385
385
  .msg-before {
386
386
  display: inline-block;
@@ -388,18 +388,18 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
388
388
  font-size: 14px;
389
389
  margin-right: 6px;
390
390
  }
391
- `;function vt({blocklet:t,showDialog:o,setShowDialog:s,selectedMeta:a}){const{t:n}=z(),i=_t(u=>u.breakpoints.down("md")),{inService:m}=J(),l=()=>{s(!1)};return o?e.jsx(ui,{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(Cn,{selectedMeta:a,onClose:l,storageKey:m?Ks:Qs})}):null}vt.propTypes={selectedMeta:r.object,showDialog:r.bool.isRequired,setShowDialog:r.func.isRequired,blocklet:r.object.isRequired};vt.defaultProps={selectedMeta:null};const ui=F(gt)`
391
+ `;function St({blocklet:t,showDialog:o,setShowDialog:s,selectedMeta:a}){const{t:n}=z(),i=Wt(u=>u.breakpoints.down("md")),{inService:m}=J(),l=()=>{s(!1)};return o?e.jsx(pi,{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(jn,{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 pi=F(xt)`
392
392
  .MuiDialogContent-root {
393
393
  }
394
- `;function jn({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(Kt,{style:{fontSize:18,marginRight:5}}),s("blocklet.component.add")]}),e.jsx(vt,{showDialog:a,setShowDialog:n,blocklet:t})]})}jn.propTypes={children:r.any,blocklet:r.object.isRequired};jn.defaultProps={children:null};const mi=t=>t.children.filter(o=>o.meta.interfaces.find(s=>s.type===X.BLOCKLET_INTERFACE_TYPE_WEB));function St({params:t,setParams:o,setError:s,serviceTypes:a}){const{t:n}=z(),{blocklet:i}=ie(),m=i.meta.did,l=mi(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(b=>b.meta.did===t.componentId),S=O.findWebInterface(p.meta),d=(Array.isArray(S==null?void 0:S.pageGroups)?S.pageGroups:[]).map(b=>({value:b,label:`${b} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),h(d),t.pageGroup&&d.find(b=>b.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")]]})}St.propTypes={params:r.object,serviceTypes:r.array,setParams:r.func,setError:r.func};St.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 vn({children:t,hiddenChildren:o,open:s,onClose:a}){const{t:n}=z(),{api:i}=J(),{blocklet:m}=ie(),[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)},b=async c=>{try{const v=await pt(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){A.error(v.message)}finally{u(!1),g(!1)}},C={title:n("router.rule.add.title"),description:(c,v,j)=>{const T=I=>{if(j(null),pt(I,n)){v({...I,__disableConfirm:!0});return}v({...I})};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:I=>{let U=!1;const L=So({params:{...c,pathPrefix:I.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),I.target.value.trim()||(U=!0,j(n("router.validation.pathPrefixRequired"))),U||j("");const k=n("common.slugifyHint",{value:ht(I.target.value)});v({...c,pathPrefix:I.target.value,pathPrefixHint:k,__disableConfirm:U})}}),e.jsx(St,{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:b,onCancel:d},x=c=>{c.stopPropagation(),g(!0)};let R=null;return o||(R=typeof t=="function"?t({open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-add-rule",children:[l?e.jsx(re,{size:16}):e.jsx(Kt,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[R,(s||h)&&e.jsx(Ge,{title:C.title,description:C.description,confirm:C.confirm,cancel:C.cancel,params:C.params,onConfirm:C.onConfirm,onCancel:C.onCancel,color:"primary"})]})}vn.propTypes={children:r.any,onClose:r.func,hiddenChildren:r.bool,open:r.bool};vn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function Sn({id:t,from:o,children:s}){const{t:a}=z(),{api:n}=J(),{blocklet:i}=ie(),[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)},b=async()=>{l(!0);try{await n.deleteRoutingRule({input:{id:p,ruleId:t,teamDid:g}})}catch(R){A.error(R.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:b,onCancel:d},x=R=>{R.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(re,{size:16}):e.jsx(yt,{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})]})}Sn.propTypes={id:r.string.isRequired,from:r.object.isRequired,children:r.any};Sn.defaultProps={children:null};function bn({id:t,from:o,to:s,children:a}){var c,v;const{t:n}=z(),{api:i}=J(),{blocklet:m}=ie(),[l,u]=f.useState(!1),[h,g]=f.useState(null),p=m.meta.did,S=m.site.id,d=o.pathPrefix,b=()=>{u(!1),g(null)},C=async j=>{try{const T=await pt(j,n);if(T)throw T;u(!0);const I={id:t,from:{pathPrefix:ue(j.pathPrefix)},to:{type:j.type}};j.type===D.ROUTING_RULE_TYPES.REDIRECT&&(I.to.url=j.url,I.to.redirectCode=j.redirectCode),j.type===D.ROUTING_RULE_TYPES.COMPONENT&&(I.to.did=p,I.to.componentId=j.componentId,I.to.pageGroup=j.pageGroup),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(I.to.url=ue(j.url)),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(I.to.response={status:200,contentType:j.responseType,body:j.responseBody}),await i.updateRoutingRule({input:{id:S,rule:I,teamDid:p}})}catch(T){A.error(T.message)}finally{u(!1),g(null)}},x={title:n("router.rule.update.title"),description:(j,T,I)=>{const U=L=>{if(pt(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 k=!1;j.type===D.ROUTING_RULE_TYPES.REDIRECT&&!j.url&&(k=!0),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!j.url&&(k=!0),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!j.responseType||!j.responseBody)&&(k=!0),L.target.value.trim()||(k=!0,I(n("router.validation.pathPrefixRequired"))),k||I("");const M=n("common.slugifyHint",{value:ht(L.target.value)});T({...j,pathPrefix:L.target.value,helperText:M,__disableConfirm:k})}}),e.jsx(St,{params:j,setParams:U,setError:I})]})},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:b},R=j=>{j.stopPropagation(),g(x)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:l,open:R}):e.jsxs(ge,{onClick:R,className:"rule-action","data-cy":"action-update-rule",children:[l?e.jsx(re,{size:16}):e.jsx(Co,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),h&&e.jsx(Ge,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}bn.propTypes={id:r.string.isRequired,from:r.object.isRequired,to:r.object.isRequired,children:r.any};bn.defaultProps={children:null};function Rn(t){const{locale:o}=z(),{blocklet:s,recommendedDomain:a}=ie(),n=xo(a,t.from.pathPrefix,Wt(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(bn,{...t,children:({open:i})=>e.jsx($,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-update-rule",children:e.jsx(Ht,{})})}),e.jsx(Sn,{...t,children:({open:i})=>e.jsx($,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-delete-rule",children:e.jsx(yt,{})})})]})}Rn.propTypes={isProtected:r.bool};Rn.defaultProps={isProtected:!1};function Bo({group:t,...o}){return t?e.jsx(Qe,{type:"reverse",...o,children:t}):null}Bo.propTypes={group:r.string.isRequired};function mt({domain:t,isHttps:o,toUrl:s}){const a=o?"https":"http";let n=s;return fs(n)||(n=`${a}://${t}${s}`),e.jsx(xt,{href:n,target:"_blank",style:{fontSize:14},underline:"hover",children:s},n)}mt.propTypes={domain:r.string.isRequired,toUrl:r.string.isRequired,isHttps:r.bool};mt.defaultProps={isHttps:!1};function bt({hasPermission:t}){const{t:o,locale:s}=z(),a=uo(),{blocklet:n,recommendedDomain:i}=ie();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(Er,{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(Rn,{...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(us,{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(mt,{domain:i,toUrl:l.to.url}),l.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(mt,{domain:i,toUrl:l.to.url}),l.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(Bo,{group:l.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(xt,{href:xo(i,l.from.pathPrefix,Wt(n,s)),target:"_blank",style:{fontSize:16},underline:"hover",children:ms(l.from.pathPrefix,"/")||"/"})},l.from.pathPrefix),e.jsx(y,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),e.jsx(Yt,{},"divider")]})}bt.propTypes={hasPermission:r.bool};bt.defaultProps={hasPermission:!1};const fi=Fe(bt,"mutate_blocklets"),hi=Fe(bt,"",Me);function gi(t){const{inService:o}=J();return o?e.jsx(hi,{...t}):e.jsx(fi,{...t})}function xi({blocklet:t,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const s=hs(),{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 A.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 En({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 R=>{h(!0),await o(R.component,R.removeType),h(!1),p(null)},d=s||u,b=()=>{p({title:`${l("common.delete")} ${t.meta.title||t.meta.name}`,description:(R,c)=>e.jsxs(ee,{component:"div",children:[e.jsx(ee,{gutterBottom:!0,children:l("blocklet.action.removeComponentDescription")}),e.jsxs(Sr,{name:"removeType",value:R.removeType,onChange:v=>c({...R,removeType:v.target.value}),children:[e.jsx(Gt,{value:"keepData",control:e.jsx(no,{}),label:l("blocklet.action.removeComponentKeepData")}),e.jsx(Gt,{value:"complete",control:e.jsx(no,{}),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?b():(h(!1),p(null))},[n]);const C=e.jsx(yi,{size:"small",disabled:d,onClick:()=>b,"data-cy":"delete-component-btn",children:e.jsx(yt,{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(Ge,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}En.propTypes={component:r.object.isRequired,remove:r.func,onCancel:r.func,disabled:r.bool,showConfirm:r.bool,hideBtn:r.bool,tip:r.string};En.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const yi=F($)`
394
+ `;function vn({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})]})}vn.propTypes={children:r.any,blocklet:r.object.isRequired};vn.defaultProps={children:null};const ui=t=>t.children.filter(o=>o.meta.interfaces.find(s=>s.type===X.BLOCKLET_INTERFACE_TYPE_WEB));function bt({params:t,setParams:o,setError:s,serviceTypes:a}){const{t:n}=z(),{blocklet:i}=ie(),m=i.meta.did,l=ui(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(b=>b.meta.did===t.componentId),S=O.findWebInterface(p.meta),d=(Array.isArray(S==null?void 0:S.pageGroups)?S.pageGroups:[]).map(b=>({value:b,label:`${b} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),h(d),t.pageGroup&&d.find(b=>b.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")]]})}bt.propTypes={params:r.object,serviceTypes:r.array,setParams:r.func,setError:r.func};bt.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 Sn({children:t,hiddenChildren:o,open:s,onClose:a}){const{t:n}=z(),{api:i}=J(),{blocklet:m}=ie(),[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)},b=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){A.error(v.message)}finally{u(!1),g(!1)}},C={title:n("router.rule.add.title"),description:(c,v,j)=>{const T=I=>{if(j(null),ut(I,n)){v({...I,__disableConfirm:!0});return}v({...I})};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:I=>{let U=!1;const L=vo({params:{...c,pathPrefix:I.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),I.target.value.trim()||(U=!0,j(n("router.validation.pathPrefixRequired"))),U||j("");const k=n("common.slugifyHint",{value:gt(I.target.value)});v({...c,pathPrefix:I.target.value,pathPrefixHint:k,__disableConfirm:U})}}),e.jsx(bt,{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:b,onCancel:d},x=c=>{c.stopPropagation(),g(!0)};let R=null;return o||(R=typeof t=="function"?t({open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-add-rule",children:[l?e.jsx(re,{size:16}):e.jsx(Qt,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[R,(s||h)&&e.jsx(Ge,{title:C.title,description:C.description,confirm:C.confirm,cancel:C.cancel,params:C.params,onConfirm:C.onConfirm,onCancel:C.onCancel,color:"primary"})]})}Sn.propTypes={children:r.any,onClose:r.func,hiddenChildren:r.bool,open:r.bool};Sn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function bn({id:t,from:o,children:s}){const{t:a}=z(),{api:n}=J(),{blocklet:i}=ie(),[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)},b=async()=>{l(!0);try{await n.deleteRoutingRule({input:{id:p,ruleId:t,teamDid:g}})}catch(R){A.error(R.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:b,onCancel:d},x=R=>{R.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(re,{size:16}):e.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),u&&e.jsx(Cr,{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 Rn({id:t,from:o,to:s,children:a}){var c,v;const{t:n}=z(),{api:i}=J(),{blocklet:m}=ie(),[l,u]=f.useState(!1),[h,g]=f.useState(null),p=m.meta.did,S=m.site.id,d=o.pathPrefix,b=()=>{u(!1),g(null)},C=async j=>{try{const T=await ut(j,n);if(T)throw T;u(!0);const I={id:t,from:{pathPrefix:ue(j.pathPrefix)},to:{type:j.type}};j.type===D.ROUTING_RULE_TYPES.REDIRECT&&(I.to.url=j.url,I.to.redirectCode=j.redirectCode),j.type===D.ROUTING_RULE_TYPES.COMPONENT&&(I.to.did=p,I.to.componentId=j.componentId,I.to.pageGroup=j.pageGroup),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(I.to.url=ue(j.url)),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(I.to.response={status:200,contentType:j.responseType,body:j.responseBody}),await i.updateRoutingRule({input:{id:S,rule:I,teamDid:p}})}catch(T){A.error(T.message)}finally{u(!1),g(null)}},x={title:n("router.rule.update.title"),description:(j,T,I)=>{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 k=!1;j.type===D.ROUTING_RULE_TYPES.REDIRECT&&!j.url&&(k=!0),j.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!j.url&&(k=!0),j.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!j.responseType||!j.responseBody)&&(k=!0),L.target.value.trim()||(k=!0,I(n("router.validation.pathPrefixRequired"))),k||I("");const M=n("common.slugifyHint",{value:gt(L.target.value)});T({...j,pathPrefix:L.target.value,helperText:M,__disableConfirm:k})}}),e.jsx(bt,{params:j,setParams:U,setError:I})]})},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:b},R=j=>{j.stopPropagation(),g(x)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:l,open:R}):e.jsxs(ge,{onClick:R,className:"rule-action","data-cy":"action-update-rule",children:[l?e.jsx(re,{size:16}):e.jsx(yo,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),h&&e.jsx(Ge,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Rn.propTypes={id:r.string.isRequired,from:r.object.isRequired,to:r.object.isRequired,children:r.any};Rn.defaultProps={children:null};function En(t){const{locale:o}=z(),{blocklet:s,recommendedDomain:a}=ie(),n=go(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(So,{})})}),e.jsx(Rn,{...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,{})})})]})}En.propTypes={isProtected:r.bool};En.defaultProps={isProtected:!1};function Do({group:t,...o}){return t?e.jsx(Qe,{type:"reverse",...o,children:t}):null}Do.propTypes={group:r.string.isRequired};function ft({domain:t,isHttps:o,toUrl:s}){const a=o?"https":"http";let n=s;return ms(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 Rt({hasPermission:t}){const{t:o,locale:s}=z(),a=uo(),{blocklet:n,recommendedDomain:i}=ie();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(Rr,{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(yr,{style:{fill:a.palette.text.disabled}})})})}):e.jsx(En,{...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(ps,{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(Do,{group:l.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(yt,{href:go(i,l.from.pathPrefix,Ht(n,s)),target:"_blank",style:{fontSize:16},underline:"hover",children:us(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")]})}Rt.propTypes={hasPermission:r.bool};Rt.defaultProps={hasPermission:!1};const mi=Fe(Rt,"mutate_blocklets"),fi=Fe(Rt,"",Me);function hi(t){const{inService:o}=J();return o?e.jsx(fi,{...t}):e.jsx(mi,{...t})}function gi({blocklet:t,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const s=fs(),{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 A.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 Tn({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 R=>{h(!0),await o(R.component,R.removeType),h(!1),p(null)},d=s||u,b=()=>{p({title:`${l("common.delete")} ${t.meta.title||t.meta.name}`,description:(R,c)=>e.jsxs(ee,{component:"div",children:[e.jsx(ee,{gutterBottom:!0,children:l("blocklet.action.removeComponentDescription")}),e.jsxs(vr,{name:"removeType",value:R.removeType,onChange:v=>c({...R,removeType:v.target.value}),children:[e.jsx(zt,{value:"keepData",control:e.jsx(no,{}),label:l("blocklet.action.removeComponentKeepData")}),e.jsx(zt,{value:"complete",control:e.jsx(no,{}),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?b():(h(!1),p(null))},[n]);const C=e.jsx(xi,{size:"small",disabled:d,onClick:()=>b,"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(Ge,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}Tn.propTypes={component:r.object.isRequired,remove:r.func,onCancel:r.func,disabled:r.bool,showConfirm:r.bool,hideBtn:r.bool,tip:r.string};Tn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const xi=F($)`
395
395
  &.Mui-disabled {
396
396
  opacity: 0.5;
397
397
  }
398
- `;function Tn({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){A.error(x.message)}l(!1)},p=async()=>{l(!0);try{await s(t)}catch(x){A.error(x.message)}l(!1)},S=a||m,d=["starting","running","stopping"].includes(t.status),b=d?Bs:Ns,C=e.jsx(Ci,{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(b,{disabled:S})});return[e.jsx(ve,{title:n||i(`common.${d?"stop":"start"}`),children:e.jsx("span",{children:C})},"btn"),u&&e.jsx(Ge,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"connect")]}Tn.propTypes={component:r.object.isRequired,onStart:r.func,onStop:r.func,disabled:r.bool,tip:r.string};Tn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const Ci=F($)`
398
+ `;function wn({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){A.error(x.message)}l(!1)},p=async()=>{l(!0);try{await s(t)}catch(x){A.error(x.message)}l(!1)},S=a||m,d=["starting","running","stopping"].includes(t.status),b=d?Ds:Bs,C=e.jsx(yi,{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(b,{disabled:S})});return[e.jsx(ve,{title:n||i(`common.${d?"stop":"start"}`),children:e.jsx("span",{children:C})},"btn"),u&&e.jsx(Ge,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"connect")]}wn.propTypes={component:r.object.isRequired,onStart:r.func,onStop:r.func,disabled:r.bool,tip:r.string};wn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const yi=F($)`
399
399
  &.Mui-disabled {
400
400
  opacity: 0.5;
401
401
  }
402
- `;function wn({sourceInfo:t,blocklet:o}){var a;const{t:s}=f.useContext(Ce);return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(gs,{type:"success",children:tr(t.source)},"source"),t.source==="registry"&&e.jsx(xt,{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")})]})}wn.propTypes={sourceInfo:r.shape({source:r.string,deployedFrom:r.string}),blocklet:r.object};wn.defaultProps={sourceInfo:{},blocklet:{}};var Pn={},ji=Vt;Object.defineProperty(Pn,"__esModule",{value:!0});var No=Pn.default=void 0,vi=ji(qt()),Si=e;No=Pn.default=(0,vi.default)((0,Si.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Rt({blocklet:t,checkUpgrade:o,hasPermission:s,...a}){const{api:n}=J(),{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 b=()=>{l(!1),d(null)},C=async()=>{l(!0);try{const R={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ye(2e3),await n.upgradeBlocklet({input:R})}catch(R){A.error(`Blocklet upgrade failed: ${Z(R)}`)}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:b};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(re,{size:16}):e.jsx(No,{style:{fontSize:16,color:"red"}})})}),!!u&&e.jsx(A,{variant:"error",message:u,onClose:()=>h("")}),S&&e.jsx(Ge,{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})}Rt.propTypes={blocklet:r.object.isRequired,checkUpgrade:r.bool,hasPermission:r.bool};Rt.defaultProps={checkUpgrade:!1,hasPermission:!1};const bi=Fe(Rt,"mutate_blocklets"),Ri=Fe(Rt,"",Me);function Ei(t){const{inService:o}=J();return o?e.jsx(Ri,{...t}):e.jsx(bi,{...t})}const Ti=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},wi=(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})}]:[],Pi=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}},Ii=(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 In({blocklet:t,depth:o,componentInfo:s,app:a,onClose:n}){var d,b;const{t:i,locale:m}=f.useContext(Ce),{deletingBlocklets:l}=Jt();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?Pi(s):{},S=s?[{name:i("common.name"),value:O.getDisplayName(s,!0)},{name:i("common.version"),value:e.jsx(Ei,{blocklet:s,checkUpgrade:!1})},{name:i("common.status"),value:e.jsx(Ro,{isResource:Ti(t),status:u,source:s.source,progress:t.progress})},t.status==="running"?{name:i("blocklet.startedAt"),value:Bt(t.startedAt,m)}:null,t.status!=="running"?{name:i("blocklet.stoppedAt"),value:Bt(t.stoppedAt,m)}:null,t.installedAt?{name:i("blocklet.installedAt"),value:Bt(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(wn,{sourceInfo:p,blocklet:t})},{name:i("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-"},{name:i("common.did"),value:e.jsx(mo,{did:s.meta.did,showQrcode:!0})},{name:i("common.author"),value:xs(s.meta.author)},{name:i("common.engine"),value:wi(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:`${Ii(C.id,a)} ${C.required?`(${i("common.required")})`:""}`},C.id))})}:null,(b=t.meta.resources)!=null&&b.length?{name:i("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return s?e.jsx(gt,{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}In.propTypes={blocklet:r.object.isRequired,depth:r.number,app:r.object,componentInfo:r.object,onClose:r.func.isRequired};In.defaultProps={depth:0,app:null,componentInfo:null};F(yo)`
402
+ `;function Pn({sourceInfo:t,blocklet:o}){var a;const{t:s}=f.useContext(Ce);return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(hs,{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")})]})}Pn.propTypes={sourceInfo:r.shape({source:r.string,deployedFrom:r.string}),blocklet:r.object};Pn.defaultProps={sourceInfo:{},blocklet:{}};var In={},Ci=_t;Object.defineProperty(In,"__esModule",{value:!0});var Bo=In.default=void 0,ji=Ci(qt()),vi=e;Bo=In.default=(0,ji.default)((0,vi.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}=J(),{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 b=()=>{l(!1),d(null)},C=async()=>{l(!0);try{const R={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ye(2e3),await n.upgradeBlocklet({input:R})}catch(R){A.error(`Blocklet upgrade failed: ${Z(R)}`)}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:b};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(re,{size:16}):e.jsx(Bo,{style:{fontSize:16,color:"red"}})})}),!!u&&e.jsx(A,{variant:"error",message:u,onClose:()=>h("")}),S&&e.jsx(Ge,{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 Si=Fe(Et,"mutate_blocklets"),bi=Fe(Et,"",Me);function Ri(t){const{inService:o}=J();return o?e.jsx(bi,{...t}):e.jsx(Si,{...t})}const Ei=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},Ti=(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})}]:[],wi=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}},Pi=(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 kn({blocklet:t,depth:o,componentInfo:s,app:a,onClose:n}){var d,b;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(At,{valueComponent:"div",nameWidth:120,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name):e.jsx(At,{valueComponent:"div",nameWidth:120,name:x.name,children:x.value},x.name)),p=s?wi(s):{},S=s?[{name:i("common.name"),value:O.getDisplayName(s,!0)},{name:i("common.version"),value:e.jsx(Ri,{blocklet:s,checkUpgrade:!1})},{name:i("common.status"),value:e.jsx(bo,{isResource:Ei(t),status:u,source:s.source,progress:t.progress})},t.status==="running"?{name:i("blocklet.startedAt"),value:Nt(t.startedAt,m)}:null,t.status!=="running"?{name:i("blocklet.stoppedAt"),value:Nt(t.stoppedAt,m)}:null,t.installedAt?{name:i("blocklet.installedAt"),value:Nt(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(Pn,{sourceInfo:p,blocklet:t})},{name:i("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-"},{name:i("common.did"),value:e.jsx(mo,{did:s.meta.did,showQrcode:!0})},{name:i("common.author"),value:gs(s.meta.author)},{name:i("common.engine"),value:Ti(s.engine,i).map(({name:C,value:x})=>e.jsx(At,{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:`${Pi(C.id,a)} ${C.required?`(${i("common.required")})`:""}`},C.id))})}:null,(b=t.meta.resources)!=null&&b.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}kn.propTypes={blocklet:r.object.isRequired,depth:r.number,app:r.object,componentInfo:r.object,onClose:r.func.isRequired};kn.defaultProps={depth:0,app:null,componentInfo:null};F(xo)`
403
403
  .BaseBadge-badge {
404
404
  top: ${t=>t.top*8||6}px;
405
405
  right: ${t=>t.right*8||6}px;
@@ -421,12 +421,12 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
421
421
  margin-left: 4px;
422
422
  transform: translateY(-1px);
423
423
  }
424
- `;function Ao({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}=J(),d=!o.length,b=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:b,mountPoint:ue(g)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw h(!1),v.message=Z(v),A.error(v.message),v}},R=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(re,{size:20,sx:{ml:1}}):R]},s)}Ao.propTypes={mountPoint:r.string.isRequired,href:r.string.isRequired,blocklet:r.object.isRequired,ancestors:r.array.isRequired};const ki=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},co=(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 ft({blocklet:t,ancestors:o,depth:s,onRemove:a,onStart:n,onStop:i,onRestart:m,getComponentUrl:l,app:u}){var q,Q,Ie;const{t:h}=f.useContext(Ce),[g,p]=f.useState(),[S,d]=f.useState(!1),[b,C]=f.useState(!1),[x,R]=f.useState(null),[c,v]=f.useState(!1),{deletingBlocklets:j}=Jt();let{status:T}=t;s===1&&j.includes(t.meta.did)&&(T="deleting");const I=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),U=l(I),L=O.isInProgress(u.status),k=O.isInProgress(t.status);let M="";if(L||k||s===1&&j.includes(t.meta.did))M=h("blocklet.component.tip.stopBlocklet");else if((q=t.dependents)!=null&&q.length){const te=t.dependents.filter(de=>de.required);if(te.length){const de=te.map(Se=>co(Se.id,u));M=h("blocklet.component.tip.requiredBy",{name:de.join(", ")})}}const B=async(...te)=>{C(!0);try{await a(...te)}catch{}C(!1),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(kn,{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(br,{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(Ro,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(mr,{style:{marginLeft:4},mode:t.mode||""}),!!((Ie=t.dependents)!=null&&Ie.length)&&e.jsx(ve,{title:[`${h("common.dependents")}: `,t.dependents.map(te=>e.jsx(y,{pl:1,children:`${co(te.id,u)} ${te.required?`(${h("common.required")})`:""}`},te.id))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]})]})]},t),Mt.hasMountPoint(t.meta)&&e.jsx(Ao,{blocklet:t,ancestors:o,mountPoint:I,href:U},I),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(Tn,{blocklet:u,component:t,onStart:n,onStop:i,disabled:!["starting","stopping"].includes(u.status)&&O.isInProgress(u.status)}),e.jsx(zt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(Eo,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||ki(t)?{icon:e.jsx(vr,{}),text:h("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(As,{}),text:h("common.restart"),onClick:()=>{R({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:()=>R(null)})},disabled:b||L||k||t.status!=="running"},{icon:e.jsx(yt,{}),text:h("common.delete"),onClick:()=>{d(!0)},disabled:L||k||!!M,tip:M},{separator:!0},{icon:e.jsx(Ht,{}),onClick:()=>{v(!0)},text:e.jsx(zt,{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||k}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Yt,{},"line"),e.jsx(In,{componentInfo:g,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(En,{blocklet:u,component:t,remove:B,onCancel:()=>d(!1),hideBtn:!0,showConfirm:S},"delete-component"),x&&e.jsx(Ge,{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(jt,{open:!0,hiddenChildren:!0,onClose:()=>v(!1),blocklet:t,ancestors:o})]})}ft.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};ft.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const zt=F(yo)`
424
+ `;function No({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}=J(),d=!o.length,b=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:b,mountPoint:ue(g)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw h(!1),v.message=Z(v),A.error(v.message),v}},R=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:xs(s)})}),u?e.jsx(re,{size:20,sx:{ml:1}}):R]},s)}No.propTypes={mountPoint:r.string.isRequired,href:r.string.isRequired,blocklet:r.object.isRequired,ancestors:r.array.isRequired};const Ii=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},co=(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,Ie;const{t:h}=f.useContext(Ce),[g,p]=f.useState(),[S,d]=f.useState(!1),[b,C]=f.useState(!1),[x,R]=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 I=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),U=l(I),L=O.isInProgress(u.status),k=O.isInProgress(t.status);let M="";if(L||k||s===1&&j.includes(t.meta.did))M=h("blocklet.component.tip.stopBlocklet");else if((V=t.dependents)!=null&&V.length){const te=t.dependents.filter(de=>de.required);if(te.length){const de=te.map(Se=>co(Se.id,u));M=h("blocklet.component.tip.requiredBy",{name:de.join(", ")})}}const B=async(...te)=>{C(!0);try{await a(...te)}catch{}C(!1),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(Un,{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(Sr,{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(bo,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(ur,{style:{marginLeft:4},mode:t.mode||""}),!!((Ie=t.dependents)!=null&&Ie.length)&&e.jsx(ve,{title:[`${h("common.dependents")}: `,t.dependents.map(te=>e.jsx(y,{pl:1,children:`${co(te.id,u)} ${te.required?`(${h("common.required")})`:""}`},te.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(No,{blocklet:t,ancestors:o,mountPoint:I,href:U},I),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(So,{})})})}),e.jsx(wn,{blocklet:u,component:t,onStart:n,onStop:i,disabled:!["starting","stopping"].includes(u.status)&&O.isInProgress(u.status)}),e.jsx(Vt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(Ro,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||Ii(t)?{icon:e.jsx(jr,{}),text:h("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(Ns,{}),text:h("common.restart"),onClick:()=>{R({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:()=>R(null)})},disabled:b||L||k||t.status!=="running"},{icon:e.jsx(Ct,{}),text:h("common.delete"),onClick:()=>{d(!0)},disabled:L||k||!!M,tip:M},{separator:!0},{icon:e.jsx(Yt,{}),onClick:()=>{v(!0)},text:e.jsx(Vt,{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||k}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Jt,{},"line"),e.jsx(kn,{componentInfo:g,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(Tn,{blocklet:u,component:t,remove:B,onCancel:()=>d(!1),hideBtn:!0,showConfirm:S},"delete-component"),x&&e.jsx(Ge,{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 Vt=F(xo)`
425
425
  .BaseBadge-badge {
426
426
  top: ${t=>t.top*8||6}px;
427
427
  right: ${t=>t.right*8||6}px;
428
428
  }
429
- `,kn=F(y)`
429
+ `,Un=F(y)`
430
430
  .component-header {
431
431
  display: flex;
432
432
  align-items: center;
@@ -443,7 +443,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
443
443
  margin-left: 4px;
444
444
  transform: translateY(-1px);
445
445
  }
446
- `;function Un({meta:t,dependencies:o,logoUrl:s,setInstallComponentMeta:a}){const n=J(),{t:i}=z(),m=()=>{a(t)},l=40;return e.jsxs(Ui,{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(Yt,{class:"line"},"line")]})}Un.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}))};Un.defaultProps={logoUrl:"",dependencies:[]};const Ui=F(kn)`
446
+ `;function Dn({meta:t,dependencies:o,logoUrl:s,setInstallComponentMeta:a}){const n=J(),{t:i}=z(),m=()=>{a(t)},l=40;return e.jsxs(ki,{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(ys,{onClick:m,startIcon:e.jsx(Pe,{icon:"ph:download-simple-bold"}),children:i("common.install")})]}),e.jsx(Jt,{class:"line"},"line")]})}Dn.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}))};Dn.defaultProps={logoUrl:"",dependencies:[]};const ki=F(Un)`
447
447
  .line {
448
448
  opacity: 0.5;
449
449
  }
@@ -489,7 +489,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
489
489
  margin-left: 4px;
490
490
  transform: translateY(-1px);
491
491
  }
492
- `;function Dn({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var V;const{t:n}=f.useContext(Ce),{api:i,inService:m,info:l}=J(),{addDeletingDid:u,removeDeletingDid:h,matchDeletingDid:g}=Jt(),[p,S]=f.useState(!1),[d,b]=f.useState(null),[C,x]=f.useState(null),[R,c]=f.useState(!1),[v,j]=f.useState(!1),[T,I]=f.useState(!1),[U,L]=f.useState(null),k=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(P=>P.meta.did));const Q=async()=>{if(!p){S(!0);try{const{updateId:P,updateList:_}=(await i.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!P){A.info(n("blocklet.component.noUpdate"));return}const oe=[];O.forEachChildSync(t,(se,{id:ze,ancestors:Y})=>{const H=_.find(be=>be.id===ze);if(H){const be=Y.slice(1).concat(se).map(De=>De.meta.title||De.meta.name).join(" / "),Ue=(Y[1]||se).meta.did;oe.push({groupId:Ue,name:be,version:se.meta.version,newVersion:H.meta.version})}});const xe={};oe.forEach(se=>{xe[se.groupId]?se.disabled=!0:xe[se.groupId]=!0}),b({params:{updateId:P},list:oe,checks:xe,hasChecks:!0})}catch(P){S(!1),A.error(Z(P))}}},Ie=async()=>{if(!p)try{S(!0);const P=Object.keys(d.checks).filter(oe=>d.checks[oe]),_={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:P};await i.upgradeComponents({input:_}),S(!1),b(null),B(null)}catch(P){S(!1),A.error(Z(P))}},te=async(P,_)=>{u(P.meta.did);try{await i.deleteComponent({input:{did:P.meta.did,keepData:_==="keepData",rootDid:t.meta.did}}),await Ye(800)}catch(oe){A.error(Z(oe)),h(P.meta.did)}},de=async P=>{try{await i.startBlocklet({input:{did:t.meta.did,componentDids:[P.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},Se=async P=>{try{await i.stopBlocklet({input:{did:t.meta.did,componentDids:[P.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},w=async P=>{try{await i.restartBlocklet({input:{did:t.meta.did,componentDids:[P.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},ke=(P,_)=>{const{checked:oe}=P.target;b(xe=>{const se=Object.entries(xe.checks).reduce((Y,[H,be])=>(Y[H]=_===H?oe:be,Y),{}),ze=Object.values(se).includes(!0);return{...xe,checks:se,hasChecks:ze}})};js(Q);const me=xi({blocklet:t,scrollToComponent:!0}),Ze=U||me;return e.jsxs(Di,{component:"div",...a,children:[e.jsxs(Bi,{display:"flex",children:[e.jsxs(Ni,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[q!=null&&q.length?`${n("common.components")} (${q.length})`:`${n("common.components")}`,!k&&e.jsx(Ot,{permission:m?"":"mutate_blocklets",role:m?Me:[],children:e.jsx(Zt,{children:e.jsx(zt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!M,children:e.jsxs(ne,{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(re,{size:16}):e.jsx(To,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Ot,{permission:m?"":"mutate_blocklets",role:m?Me:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!k&&e.jsx(jn,{blocklet:t,serverVersion:l.version,children:({open:P})=>e.jsxs(ne,{disabled:p||O.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:P,children:[e.jsx(Rs,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(Eo,{"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)},!k&&{icon:e.jsx(Ht,{}),text:`${n("blocklet.component.container")}`,onClick:()=>I(!0)}].filter(Boolean)})]})})]}),q!=null&&q.length?e.jsxs(e.Fragment,{children:[e.jsxs(y,{mt:2,children:[t.meta.group!=="gateway"&&e.jsx(ft,{blocklet:t,app:t,onRemove:te,onStart:de,onStop:Se,onRestart:w,getComponentUrl:s},`0-${t.meta.did}`),t.children.map(P=>e.jsx(ft,{depth:1,blocklet:P,ancestors:[t],app:t,onRemove:te,onStart:de,onStop:Se,onRestart:w,getComponentUrl:s},`1-${P.meta.did}`))]},`top-blocklet-${t.meta.did}`),(V=t.optionalComponents)==null?void 0:V.map(P=>e.jsx(kn,{children:e.jsx(Un,{setInstallComponentMeta:L,...P})},P.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(gi,{})}),!!d&&e.jsx(Yn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("blocklet.component.updateTitle")}),e.jsx(y,{component:Kn,py:4,children:d.list.map(P=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(vs,{checked:d.checks[P.groupId],onChange:_=>ke(_,P.groupId),style:{marginLeft:P.disabled?16:0},defaultChecked:!0,disabled:P.disabled}),e.jsxs(y,{flexGrow:1,mt:3,children:[e.jsx(y,{item:!0,xs:8,children:P.name}),P.version&&e.jsxs(at,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(at,{item:!0,xs:3,children:P.version}),e.jsx(at,{item:!0,xs:1,children:e.jsx(ks,{style:{fontSize:"0.9em"}})}),e.jsx(at,{item:!0,xs:3,children:e.jsx(y,{color:"secondary.main",children:P.newVersion})})]})]},`${P.name}-${P.newVersion}`)]},P.name))}),e.jsxs(Ss,{style:{padding:"8px 24px 24px"},children:[e.jsx(ne,{onClick:()=>{b(null)},children:n("common.cancel")}),e.jsxs(ne,{onClick:P=>{P.stopPropagation(),Ie()},color:"primary",disabled:p||!d.hasChecks,variant:"contained",autoFocus:!0,children:[p&&e.jsx(re,{size:16}),n("common.update")]})]})]})}),!!C&&e.jsx(Yn,{open:!0,fullWidth:!0,onClose:()=>x(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("common.configuration")}),e.jsx(Kn,{children:e.jsx(y,{py:2,children:e.jsx(Gt,{control:e.jsx(Rr,{checked:R,onChange:P=>c(!!P.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(vt,{selectedMeta:Ze,blocklet:t,showDialog:!!Ze,setShowDialog:()=>L(null)}),v&&e.jsx(vn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(jt,{open:!0,onClose:()=>I(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}Dn.propTypes={blocklet:r.object.isRequired,onUpdate:r.func,getComponentUrl:r.func};Dn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Di=F.div`
492
+ `;function Bn({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var q;const{t:n}=f.useContext(Ce),{api:i,inService:m,info:l}=J(),{addDeletingDid:u,removeDeletingDid:h,matchDeletingDid:g}=Kt(),[p,S]=f.useState(!1),[d,b]=f.useState(null),[C,x]=f.useState(null),[R,c]=f.useState(!1),[v,j]=f.useState(!1),[T,I]=f.useState(!1),[U,L]=f.useState(null),k=t&&t.structVersion!==D.APP_STRUCT_VERSION,[M,B]=f.useState(!1),V=[...t.children];t.meta.group!=="gateway"&&V.unshift(t),g(V.map(P=>P.meta.did));const Q=async()=>{if(!p){S(!0);try{const{updateId:P,updateList:_}=(await i.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!P){A.info(n("blocklet.component.noUpdate"));return}const oe=[];O.forEachChildSync(t,(se,{id:ze,ancestors:Y})=>{const H=_.find(be=>be.id===ze);if(H){const be=Y.slice(1).concat(se).map(De=>De.meta.title||De.meta.name).join(" / "),Ue=(Y[1]||se).meta.did;oe.push({groupId:Ue,name:be,version:se.meta.version,newVersion:H.meta.version})}});const xe={};oe.forEach(se=>{xe[se.groupId]?se.disabled=!0:xe[se.groupId]=!0}),b({params:{updateId:P},list:oe,checks:xe,hasChecks:!0})}catch(P){S(!1),A.error(Z(P))}}},Ie=async()=>{if(!p)try{S(!0);const P=Object.keys(d.checks).filter(oe=>d.checks[oe]),_={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:P};await i.upgradeComponents({input:_}),S(!1),b(null),B(null)}catch(P){S(!1),A.error(Z(P))}},te=async(P,_)=>{u(P.meta.did);try{await i.deleteComponent({input:{did:P.meta.did,keepData:_==="keepData",rootDid:t.meta.did}}),await Ye(800)}catch(oe){A.error(Z(oe)),h(P.meta.did)}},de=async P=>{try{await i.startBlocklet({input:{did:t.meta.did,componentDids:[P.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},Se=async P=>{try{await i.stopBlocklet({input:{did:t.meta.did,componentDids:[P.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},w=async P=>{try{await i.restartBlocklet({input:{did:t.meta.did,componentDids:[P.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},ke=(P,_)=>{const{checked:oe}=P.target;b(xe=>{const se=Object.entries(xe.checks).reduce((Y,[H,be])=>(Y[H]=_===H?oe:be,Y),{}),ze=Object.values(se).includes(!0);return{...xe,checks:se,hasChecks:ze}})};Cs(Q);const me=gi({blocklet:t,scrollToComponent:!0}),Ze=U||me;return e.jsxs(Ui,{component:"div",...a,children:[e.jsxs(Di,{display:"flex",children:[e.jsxs(Bi,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[V!=null&&V.length?`${n("common.components")} (${V.length})`:`${n("common.components")}`,!k&&e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Me:[],children:e.jsx(Xt,{children:e.jsx(Vt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!M,children:e.jsxs(ne,{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(re,{size:16}):e.jsx(Eo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Me:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!k&&e.jsx(vn,{blocklet:t,serverVersion:l.version,children:({open:P})=>e.jsxs(ne,{disabled:p||O.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:P,children:[e.jsx(bs,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(Ro,{"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)},!k&&{icon:e.jsx(Yt,{}),text:`${n("blocklet.component.container")}`,onClick:()=>I(!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:te,onStart:de,onStop:Se,onRestart:w,getComponentUrl:s},`0-${t.meta.did}`),t.children.map(P=>e.jsx(ht,{depth:1,blocklet:P,ancestors:[t],app:t,onRemove:te,onStart:de,onStop:Se,onRestart:w,getComponentUrl:s},`1-${P.meta.did}`))]},`top-blocklet-${t.meta.did}`),(q=t.optionalComponents)==null?void 0:q.map(P=>e.jsx(Un,{children:e.jsx(Dn,{setInstallComponentMeta:L,...P})},P.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(ks,{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(hi,{})}),!!d&&e.jsx(Yn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("blocklet.component.updateTitle")}),e.jsx(y,{component:Kn,py:4,children:d.list.map(P=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(js,{checked:d.checks[P.groupId],onChange:_=>ke(_,P.groupId),style:{marginLeft:P.disabled?16:0},defaultChecked:!0,disabled:P.disabled}),e.jsxs(y,{flexGrow:1,mt:3,children:[e.jsx(y,{item:!0,xs:8,children:P.name}),P.version&&e.jsxs(at,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(at,{item:!0,xs:3,children:P.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:P.newVersion})})]})]},`${P.name}-${P.newVersion}`)]},P.name))}),e.jsxs(vs,{style:{padding:"8px 24px 24px"},children:[e.jsx(ne,{onClick:()=>{b(null)},children:n("common.cancel")}),e.jsxs(ne,{onClick:P=>{P.stopPropagation(),Ie()},color:"primary",disabled:p||!d.hasChecks,variant:"contained",autoFocus:!0,children:[p&&e.jsx(re,{size:16}),n("common.update")]})]})]})}),!!C&&e.jsx(Yn,{open:!0,fullWidth:!0,onClose:()=>x(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("common.configuration")}),e.jsx(Kn,{children:e.jsx(y,{py:2,children:e.jsx(zt,{control:e.jsx(br,{checked:R,onChange:P=>c(!!P.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(St,{selectedMeta:Ze,blocklet:t,showDialog:!!Ze,setShowDialog:()=>L(null)}),v&&e.jsx(Sn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(vt,{open:!0,onClose:()=>I(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}Bn.propTypes={blocklet:r.object.isRequired,onUpdate:r.func,getComponentUrl:r.func};Bn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Ui=F.div`
493
493
  .title {
494
494
  font-size: 1.2rem;
495
495
  font-weight: bold;
@@ -508,7 +508,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
508
508
  .component-item {
509
509
  animation: showDelay 0.75s ease 1;
510
510
  }
511
- `,Bi=F(y)`
511
+ `,Di=F(y)`
512
512
  ${t=>t.theme.breakpoints.up("sm")} {
513
513
  flex-direction: row;
514
514
  justify-content: space-between;
@@ -522,9 +522,9 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
522
522
  display: none;
523
523
  }
524
524
  }
525
- `,Ni=F(y)`
525
+ `,Bi=F(y)`
526
526
  ${t=>t.theme.breakpoints.down("sm")} {
527
527
  width: 100%;
528
528
  justify-content: space-between;
529
529
  }
530
- `;function Lo(t){const{locale:o}=f.useContext(Ce),{blocklet:s,recommendedDomain:a}=nr(),n=i=>bs({blocklet:s,domain:{value:a},mountPoint:i,params:Wt(s,o)});return e.jsx(Dn,{blocklet:s,getComponentUrl:n,...t})}Lo.propTypes={};Lo.defaultProps={};export{Lo as default};
530
+ `;function Ao(t){const{locale:o}=f.useContext(Ce),{blocklet:s,recommendedDomain:a}=tr(),n=i=>Ss({blocklet:s,domain:{value:a},mountPoint:i,params:Ht(s,o)});return e.jsx(Bn,{blocklet:s,getComponentUrl:n,...t})}Ao.propTypes={};Ao.defaultProps={};export{Ao as default};