@abtnode/blocklet-services 1.16.42-beta-20250409-161010-b0a88c5c → 1.16.42-beta-20250412-074212-ef879757

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 (192) hide show
  1. package/api/index.js +1 -1
  2. package/api/routes/user.js +2 -2
  3. package/api/services/auth/session.js +35 -2
  4. package/api/services/studio/index.js +1 -1
  5. package/dist/assets/{ArrowDropDown-CDjPVis_.js → ArrowDropDown-C_E3qkPd.js} +1 -1
  6. package/dist/assets/{CheckCircle-BHD7aj9l.js → CheckCircle-D7Ntmb2o.js} +1 -1
  7. package/dist/assets/{ChevronLeft-CUdxcGLW.js → ChevronLeft-BIgT65EY.js} +1 -1
  8. package/dist/assets/{ChevronRight-Bol9kSyE.js → ChevronRight-foZmiP4J.js} +1 -1
  9. package/dist/assets/{DeleteOutline-BiIEYa8g.js → DeleteOutline-CKVA3PXs.js} +1 -1
  10. package/dist/assets/{Done-kAy_Y9ti.js → Done-BDrYSkZM.js} +1 -1
  11. package/dist/assets/{Download-COul5Jpx.js → Download-BQiSNQBP.js} +1 -1
  12. package/dist/assets/{Error-xVtnHALO.js → Error-CK4gTMoT.js} +1 -1
  13. package/dist/assets/{ExpandLess-CW9G6ynD.js → ExpandLess-1B6PdCYC.js} +1 -1
  14. package/dist/assets/{Google-D98Bf-5Y.js → Google-DimUFzIe.js} +1 -1
  15. package/dist/assets/{InfoOutlined-jnMrCCfZ.js → InfoOutlined-CEHciuDy.js} +1 -1
  16. package/dist/assets/{Launch-DFNlDQlk.js → Launch-DX76v5dw.js} +1 -1
  17. package/dist/assets/{LaunchOutlined-yZsgpXar.js → LaunchOutlined-CnOQGhu-.js} +1 -1
  18. package/dist/assets/{MoreHoriz-BqdKN70-.js → MoreHoriz-THEF6D0C.js} +1 -1
  19. package/dist/assets/{PlayArrow-CXtQLadK.js → PlayArrow-DpcMtsY5.js} +1 -1
  20. package/dist/assets/{TuneOutlined-EaV8HxdX.js → TuneOutlined-DHqZ7jGz.js} +1 -1
  21. package/dist/assets/{ViewList-BPuXZDcI.js → ViewList-DOu7Co_L.js} +1 -1
  22. package/dist/assets/{access-control-CuKW2kRZ.js → access-control-CkJaSWqQ.js} +1 -1
  23. package/dist/assets/{actions-DqeM3yie.js → actions-CAL1KFv7.js} +1 -1
  24. package/dist/assets/add-component-core-CcE5hcL-.js +762 -0
  25. package/dist/assets/add-resource-CWB03UX7.js +1 -0
  26. package/dist/assets/{addon-B5UBB-pU.js → addon-D1_etOjl.js} +1 -1
  27. package/dist/assets/{advanced-Cvboset8.js → advanced-xfBXRmMb.js} +4 -38
  28. package/dist/assets/api-kwOW9mRz.js +1 -0
  29. package/dist/assets/{appearance-DmQgth7a.js → appearance-CSHu4pbk.js} +1 -1
  30. package/dist/assets/ar-Cb5zQ0go.js +13 -0
  31. package/dist/assets/{audit-logs-LLoqbniS.js → audit-logs-JU-7pKhW.js} +3 -3
  32. package/dist/assets/{base32-CMrsHquD.js → base32-CLGITfm-.js} +1 -1
  33. package/dist/assets/branding-BWmZMyhk.js +55 -0
  34. package/dist/assets/{branding-BfxdFbW1.js → branding-CcjXuXBu.js} +2 -2
  35. package/dist/assets/bundle-avatar-DW07bLBG.js +1 -0
  36. package/dist/assets/{button-OxbVr1Od.js → button-BSJ2z68-.js} +1 -1
  37. package/dist/assets/{click-to-copy-q_I2l6Sg.js → click-to-copy-C9iEVQIO.js} +1 -1
  38. package/dist/assets/cloneDeep-DHAAvuEH.js +1 -0
  39. package/dist/assets/{complete-ogipf6id.js → complete-DJafaAbP.js} +2 -2
  40. package/dist/assets/{component-DVhWy5jQ.js → component-Dixh8MiE.js} +1 -1
  41. package/dist/assets/{config-YsfQuvvt.js → config-DnWRl-e4.js} +2 -2
  42. package/dist/assets/{config-BdUShvO-.js → config-DzZULB-q.js} +1 -1
  43. package/dist/assets/{config-navigation-C4hgzi4R.js → config-navigation-Dy2e3bWx.js} +6 -6
  44. package/dist/assets/{config-space-DJ-fZ6j4.js → config-space-D9XSZ43O.js} +1 -1
  45. package/dist/assets/{confirm-C1Nde1Nq.js → confirm-D36_98HC.js} +1 -1
  46. package/dist/assets/connect-DfFQY1g3.js +1 -0
  47. package/dist/assets/connect-XFyjVd39.js +5 -0
  48. package/dist/assets/{connect-to-CdG3TX0A.js → connect-to-nV6QlEXH.js} +1 -1
  49. package/dist/assets/dashboard-BX25tvc1.js +262 -0
  50. package/dist/assets/de-BOcpEFUQ.js +13 -0
  51. package/dist/assets/{delete-confirm-CpPzqeJx.js → delete-confirm-DXKGHbZ0.js} +1 -1
  52. package/dist/assets/{did-address-D-fI5ZyH.js → did-address-B_VfxEC5.js} +1 -1
  53. package/dist/assets/domain-BwDvbkr6.js +9 -0
  54. package/dist/assets/{domain-action-card-Crwneu7N.js → domain-action-card-CE5RoGLV.js} +2 -2
  55. package/dist/assets/domains-D7bzAvx0.js +1 -0
  56. package/dist/assets/{email-DGh9v0en.js → email-Blo2BcBK.js} +2 -2
  57. package/dist/assets/es-DAe7HpzA.js +14 -0
  58. package/dist/assets/{exchange-passport-CgGOJDm9.js → exchange-passport-C2ib3_Sn.js} +1 -1
  59. package/dist/assets/fr-Chv_7X3-.js +13 -0
  60. package/dist/assets/{fuel-CItPP5Vk.js → fuel-Dy1g5bbZ.js} +1 -1
  61. package/dist/assets/{get-safe-url-B2BlmlqT.js → get-safe-url-BOY9UAaI.js} +1 -1
  62. package/dist/assets/{get-safe-url-C2N97NJc.js → get-safe-url-D_Puq_oh.js} +1 -1
  63. package/dist/assets/hi-BqgGDMzX.js +11 -0
  64. package/dist/assets/{home-12LB7wlV.js → home-CjHQSa_8.js} +1 -1
  65. package/dist/assets/id-DbN1Ye4x.js +14 -0
  66. package/dist/assets/{iframe-54rcs7kU.js → iframe-BhRKCdFb.js} +1 -1
  67. package/dist/assets/{index-643kpB1h.js → index-9aeq_G-H.js} +1 -1
  68. package/dist/assets/{index-Du71d9ZJ.js → index-9fAsRy5T.js} +1 -1
  69. package/dist/assets/index-B0eRJvP0.js +346 -0
  70. package/dist/assets/{index-G26gYrxE.js → index-BFJrqJbJ.js} +2 -2
  71. package/dist/assets/{index-DQC9zneB.js → index-BqFOxrIh.js} +4 -4
  72. package/dist/assets/{index-0CgHVUpB.js → index-C1nvgBfF.js} +1 -1
  73. package/dist/assets/{index-D5G2v7wN.js → index-CAftUN2f.js} +2 -2
  74. package/dist/assets/{index-4WjT4o1e.js → index-CH6NslvK.js} +1 -1
  75. package/dist/assets/index-C_bxIWi7.js +55 -0
  76. package/dist/assets/{index-CTpJt8AJ.js → index-CwaFNZTA.js} +47 -34
  77. package/dist/assets/index-DF8FqhFx.js +6 -0
  78. package/dist/assets/{index-BIu-u1kW.js → index-DR9nQ2tJ.js} +1 -1
  79. package/dist/assets/{index-YqrAgavD.js → index-DW20Eg1X.js} +1 -1
  80. package/dist/assets/{index-DKPGWA5E.js → index-Du2DtxVt.js} +2 -2
  81. package/dist/assets/index-FiEfCjCd.js +113 -0
  82. package/dist/assets/index-_bdib4_X.js +290 -0
  83. package/dist/assets/{index-9XJ5HzSd.js → index-lIOjK585.js} +1 -1
  84. package/dist/assets/{index-CB6NPYWM.js → index-rMaglH7e.js} +3 -3
  85. package/dist/assets/{index-DVogNW6l.js → index-uyugLR5M.js} +1 -1
  86. package/dist/assets/{invitation-BBqRmSx1.js → invitation-BhpO2wrv.js} +3 -3
  87. package/dist/assets/{invite-CKxzd-7d.js → invite-Dho4ZotB.js} +1 -1
  88. package/dist/assets/{issue-passport-BA7u3NC-.js → issue-passport-ChG1IKWf.js} +1 -1
  89. package/dist/assets/{item-DssQyiFI.js → item-CuaUMkzc.js} +2 -2
  90. package/dist/assets/ja-Bv-A_sTl.js +14 -0
  91. package/dist/assets/ko-Bl3kd-sp.js +14 -0
  92. package/dist/assets/landing-page-B5nKEn_3.js +1 -0
  93. package/dist/assets/{layout-R4Ynfcbq.js → layout-DMTV9CZD.js} +1 -1
  94. package/dist/assets/{list-BhXWs05I.js → list-BpDs72YC.js} +9 -9
  95. package/dist/assets/localization-WUgLuLwU.js +1 -0
  96. package/dist/assets/{log-D4PQ7UF3.js → log-BHx8x694.js} +1 -1
  97. package/dist/assets/logger-Bd77RetM.js +1 -0
  98. package/dist/assets/login-C8IgtQHG.js +1 -0
  99. package/dist/assets/{login-oauth-callback-BzcAZfXM.js → login-oauth-callback-5AlLzjZ2.js} +1 -1
  100. package/dist/assets/logo-uploader-COdhJAZk.js +133 -0
  101. package/dist/assets/{lost-passport-DD7XCIgg.js → lost-passport-D7rMK1P8.js} +1 -1
  102. package/dist/assets/omit-IjXSqbDA.js +1 -0
  103. package/dist/assets/{open-window-Dsc5mHei.js → open-window-CX_mRFPs.js} +1 -1
  104. package/dist/assets/overview-d6gDgxnh.js +85 -0
  105. package/dist/assets/{page-header-B7j9M6Zp.js → page-header-DWf5vODI.js} +1 -1
  106. package/dist/assets/{permission-CLAOGeOf.js → permission-CmHMB8NK.js} +1 -1
  107. package/dist/assets/{preferences-qZW-dsds.js → preferences-COMN8FgJ.js} +1 -1
  108. package/dist/assets/{profile-embed-6mTqkL03.js → profile-embed-Crj1xM6Z.js} +1 -1
  109. package/dist/assets/pt-B7_jgyK-.js +12 -0
  110. package/dist/assets/publish-resource-KUiHUSOS.js +1 -0
  111. package/dist/assets/{react-beautiful-dnd.esm-Bu3K07pf.js → react-beautiful-dnd.esm-B3HYEQUw.js} +1 -1
  112. package/dist/assets/{relative-time-Cu4jaQ9H.js → relative-time-B-K8BXmq.js} +1 -1
  113. package/dist/assets/ru-CToatViJ.js +11 -0
  114. package/dist/assets/{runtime-kNyRK8Hy.js → runtime-BLeEmHaM.js} +1 -1
  115. package/dist/assets/sdk-j4w1A_X4.js +1 -0
  116. package/dist/assets/{security-Dkk4FgYt.js → security-4VIghIsi.js} +4 -4
  117. package/dist/assets/session-0rF5SuCk.js +1 -0
  118. package/dist/assets/setup-Bbl0UvNZ.js +19 -0
  119. package/dist/assets/{spaces-B_lJq3Uz.js → spaces-CyFGYf34.js} +1 -1
  120. package/dist/assets/{start-C53MN0u7.js → start-D0qy1O4h.js} +1 -1
  121. package/dist/assets/{status-5Z1CW-le.js → status-B9rkBROD.js} +1 -1
  122. package/dist/assets/{step-actions-CujnheOz.js → step-actions-BxdcbLc6.js} +1 -1
  123. package/dist/assets/{studio-BYzuzhpL.js → studio-cLKWVbyy.js} +1 -1
  124. package/dist/assets/{switch-control-DWiX5YiK.js → switch-control-DpvMHPLC.js} +1 -1
  125. package/dist/assets/th-23Hwasay.js +12 -0
  126. package/dist/assets/{traffic-WemHsP0B.js → traffic-Diahv-s-.js} +3 -3
  127. package/dist/assets/{transfer-CF7CWbdm.js → transfer-DIxD0NHy.js} +1 -1
  128. package/dist/assets/{unsubscribe-Dfof7yLG.js → unsubscribe-C3uPy6Yj.js} +1 -1
  129. package/dist/assets/useAsync-BxB2TpDl.js +1 -0
  130. package/dist/assets/useAsync-L7_fHBH5.js +1 -0
  131. package/dist/assets/useAsyncRetry-W2lp7mi1.js +7 -0
  132. package/dist/assets/{useLocalStorage-DLwAkPmo.js → useLocalStorage-Cq9THoCr.js} +1 -1
  133. package/dist/assets/{user-center-CowUpoIn.js → user-center-CcFqKY18.js} +2 -2
  134. package/dist/assets/{util-B6E4W35Y.js → util-1n1Ulk5w.js} +1 -1
  135. package/dist/assets/{util-C57yoAn6.js → util-B_UMdXQ8.js} +1 -1
  136. package/dist/assets/{vendor-arcblock-CD8CMsgQ.js → vendor-arcblock-V3HYELzG.js} +95 -99
  137. package/dist/assets/{vendor-hooks-8r-lvvPs.js → vendor-hooks-DN4nZ7TU.js} +1 -1
  138. package/dist/assets/vendor-utils-C3FZIS9A.js +11 -0
  139. package/dist/assets/{vendor-ux-did-connect-DlrX4cqq.js → vendor-ux-did-connect-DEbq97Xz.js} +149 -158
  140. package/dist/assets/vi-D-QGxDS1.js +12 -0
  141. package/dist/assets/wrap-locale-D2zd2sgL.js +1 -0
  142. package/dist/assets/{zh-D4Lak9gZ.js → zh-gJhiLbCP.js} +1 -1
  143. package/dist/assets/zh-nDA-W8Iz.js +15 -0
  144. package/dist/assets/zh-tw-B9PQstHP.js +14 -0
  145. package/dist/images/all-done.png +0 -0
  146. package/dist/index.html +5 -5
  147. package/dist/service-worker.js +1 -1
  148. package/package.json +30 -29
  149. package/dist/assets/add-component-core-DXPSI3Ti.js +0 -762
  150. package/dist/assets/add-resource-S3Z1zjbJ.js +0 -1
  151. package/dist/assets/api-BVwAqPhr.js +0 -1
  152. package/dist/assets/ar-688M-cDq.js +0 -3
  153. package/dist/assets/branding-DcviCyPr.js +0 -50
  154. package/dist/assets/bundle-avatar-Ci9fNblN.js +0 -1
  155. package/dist/assets/cloneDeep-g5lbcy6_.js +0 -1
  156. package/dist/assets/connect-BkxyLG9H.js +0 -1
  157. package/dist/assets/connect-dGBjAgNF.js +0 -5
  158. package/dist/assets/dashboard-2jQIZ8v5.js +0 -222
  159. package/dist/assets/de-dAK4siFW.js +0 -3
  160. package/dist/assets/domain-1X_uRV9L.js +0 -9
  161. package/dist/assets/domains-BHkUaPc7.js +0 -1
  162. package/dist/assets/es-DScgwpYm.js +0 -3
  163. package/dist/assets/fr-BBQTxbA5.js +0 -3
  164. package/dist/assets/hi-Bw7OKUaN.js +0 -1
  165. package/dist/assets/id-CKyyz3c3.js +0 -3
  166. package/dist/assets/index-3dawiJIg.js +0 -6
  167. package/dist/assets/index-Bj10Vbvc.js +0 -113
  168. package/dist/assets/index-C4dzrN-k.js +0 -290
  169. package/dist/assets/index-CFs0La6o.js +0 -15
  170. package/dist/assets/index-jny05NvM.js +0 -346
  171. package/dist/assets/ja-C9-S8RGg.js +0 -3
  172. package/dist/assets/ko-B7Et6Phj.js +0 -3
  173. package/dist/assets/landing-page-2uYUfHoY.js +0 -1
  174. package/dist/assets/localization-BsSUbpzO.js +0 -1
  175. package/dist/assets/login-CuCcTu--.js +0 -1
  176. package/dist/assets/logo-uploader-C9TwiAKx.js +0 -134
  177. package/dist/assets/omit-DF3Nt1_-.js +0 -1
  178. package/dist/assets/overview-BjFpvrpN.js +0 -85
  179. package/dist/assets/pt-BYJAg1Zs.js +0 -1
  180. package/dist/assets/publish-resource-DO-PRxdk.js +0 -1
  181. package/dist/assets/ru-DUqsqieR.js +0 -1
  182. package/dist/assets/sdk-BjsIctsl.js +0 -1
  183. package/dist/assets/session-UJ7B0EdV.js +0 -1
  184. package/dist/assets/setup-SAEzURDR.js +0 -19
  185. package/dist/assets/th-BIzIDice.js +0 -1
  186. package/dist/assets/useAsync-De6s-0n9.js +0 -1
  187. package/dist/assets/useAsyncRetry-B6OdNqyX.js +0 -7
  188. package/dist/assets/vendor-utils-Cm2BKG2b.js +0 -11
  189. package/dist/assets/vi-DQnObbNS.js +0 -1
  190. package/dist/assets/wrap-locale-NNP_yq5G.js +0 -1
  191. package/dist/assets/zh-DQI8vsAI.js +0 -4
  192. package/dist/assets/zh-tw-DqaJtqXb.js +0 -3
@@ -0,0 +1,762 @@
1
+ var Qo=e=>{throw TypeError(e)};var Zr=(e,t,n)=>t.has(e)||Qo("Cannot "+n);var ue=(e,t,n)=>(Zr(e,t,"read from private field"),n?n.call(e):t.get(e)),Zt=(e,t,n)=>t.has(e)?Qo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),nt=(e,t,n,r)=>(Zr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Pe=(e,t,n)=>(Zr(e,t,"access private method"),n);var ei=(e,t,n,r)=>({set _(i){nt(e,t,i,n)},get _(){return ue(e,t,r)}});import{a2 as dc,j as o,E as A,a3 as Ct,aa as et,a4 as Y,T as ye,t as rn,br as Hi,bN as Gi,I as na,bF as ra,bV as ia,z as oa,bg as hc,b4 as sa,bp as fc,M as Wr,by as pc,bz as mc,bA as gc,bu as vc,ad as aa,L as yc,b3 as bc,b1 as Ec,ak as Xi,a5 as la,a7 as xc,ae as ut,e as Vn,bG as Sc,x as Er,R as wc,W as ca,an as ua,bQ as da,ag as Tc,ab as en,bf as Jo,A as Zo,$ as Oc,P as _c,G as Rc,v as Ic,a0 as Cc,D as kc,K as es}from"./vendor-mui-core-1jJmAutq.js";import{r as M,g as Yi,h as Lc,f as jc,a as Qi,e as _e,b as Ht,l as Nc}from"./vendor-react-DEoibe3W.js";import{j as ha,d as Ac,S as Pc,s as fa,A as Dc}from"./item-CuaUMkzc.js";import{r as Mc,B as yt,ak as Ji,W as pa,p as ma,u as Tt,h as St,aF as Bc,aE as Fc,l as xr,b1 as Uc,am as ga,bh as ts,ap as Wc,Y as Zi,C as $c,s as sn,X as Mr,bi as zc,bj as va,aw as ns,bk as Nr,d as eo,b4 as ya,e as ba,_ as Kc,g as wi,bl as qc,bm as Vc}from"./vendor-ux-did-connect-DEbq97Xz.js";import{t as rs,c as Pt,v as Hc,E as $r,w as Gc,x as Xc,y as Yc,L as Qc,S as Jc}from"./vendor-arcblock-V3HYELzG.js";import{L as is}from"./launch-result-message-C0Ao1hE-.js";import{P as Ea}from"./page-header-DWf5vODI.js";import{c as vt,p as Zc,B as eu,D as Ti,y as Kn,_ as xa,A as tu,C as nu,a2 as ru,ac as iu,I as ou,o as ti,x as to,Y as su,ad as au,ae as lu,af as cu,z as cr,ag as uu,b as du}from"./vendor-utils-C3FZIS9A.js";import{z as Hn,f as Vt,W as hu,X as fu,Y as pu,D as mu,Z as gu,_ as vu,$ as yu,C as zr,a0 as Sa,U as bu,a1 as Eu,a2 as xu,a3 as Su,a4 as Or,a5 as os,a6 as wu}from"./index-CwaFNZTA.js";import{u as Tu,C as Ou}from"./config-space-D9XSZ43O.js";import{R as ni}from"./logo-uploader-COdhJAZk.js";import{S as _u}from"./index-CAftUN2f.js";import{s as wa,h as Ru,w as Iu,f as Cu,a as ku,b as Lu,c as ju,M as Nu}from"./index-BTOIZL6e.js";import{m as Sr,f as Au,a as Pu,e as Ta,x as Du}from"./vendor-hooks-DN4nZ7TU.js";import{g as Mu}from"./get-safe-url-D_Puq_oh.js";import{p as Bu}from"./index-C1nvgBfF.js";import{r as Fu}from"./cloneDeep-DHAAvuEH.js";import{I as ss}from"./index-Du2DtxVt.js";import{u as Uu}from"./session-0rF5SuCk.js";import{W as Wu}from"./did-address-B_VfxEC5.js";import{_ as Oa}from"./useLocalStorage-Cq9THoCr.js";import{f as _a}from"./format-error-BrmqJs5a.js";import{a as as}from"./api-kwOW9mRz.js";import{d as $u,a as zu,v as Ku,e as qu}from"./util-B_UMdXQ8.js";import{u as Ra}from"./use-mobile-DjnNmGRG.js";import{C as Vu}from"./content-layout-Bs-vdQ_U.js";import{C as Hu,D as Gu,a as Xu}from"./connect-to-nV6QlEXH.js";import{d as Yu}from"./ArrowDropDown-C_E3qkPd.js";import{d as Qu}from"./ChevronLeft-BIgT65EY.js";import{d as Ju}from"./ChevronRight-foZmiP4J.js";const Fv="blocklet-add-component-registry",Uv="server-add-registry",Wv=e=>`resource-${e}-add-registry`;var no={},Zu=dc;Object.defineProperty(no,"__esModule",{value:!0});var Ia=no.default=void 0,ed=Zu(Mc()),td=o;Ia=no.default=(0,ed.default)((0,td.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function Ca(e){const{info:t}=Hn();return M.useMemo(()=>{var n,r,i;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((i=e.docker)!=null&&i.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function ro({disabled:e,children:t,onConfirm:n}){return M.useEffect(()=>{if(e)return()=>{};const r=i=>{i.code==="Enter"&&(i.metaKey===!0||i.ctrlKey===!0)&&(i.preventDefault(),i.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}ro.propTypes={disabled:A.bool,children:A.any.isRequired,onConfirm:A.func.isRequired};ro.defaultProps={disabled:!1};function io({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=M.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(nd,{children:o.jsxs(ro,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(yt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(Ct,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(Ji,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}io.propTypes={onContinue:A.func.isRequired,nextDisabled:A.bool,launching:A.bool,description:A.any,texts:A.object};io.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const nd=et.div`
2
+ margin: 0 auto;
3
+ display: flex;
4
+ justify-content: space-between;
5
+ align-items: center;
6
+
7
+ @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
8
+ flex-direction: column;
9
+ }
10
+
11
+ .eula-trigger {
12
+ cursor: pointer;
13
+ text-decoration: underline;
14
+ ${e=>e.theme.breakpoints.up("md")} {
15
+ padding-right: 24px;
16
+ }
17
+ ${e=>e.theme.breakpoints.down("md")} {
18
+ padding: 16px;
19
+ }
20
+ font-size: 14px;
21
+ white-space: nowrap;
22
+ &:hover {
23
+ color: ${e=>e.theme.palette.primary.main};
24
+ }
25
+ }
26
+
27
+ .next-button {
28
+ min-width: 200px;
29
+ }
30
+ `;var oo={exports:{}},ls=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rd=/\n/g,id=/^\s*/,od=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,sd=/^:\s*/,ad=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ld=/^[;\s]*/,cd=/^\s+|\s+$/g,ud=`
31
+ `,cs="/",us="*",Tn="",dd="comment",hd="declaration",fd=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(T){var O=T.match(rd);O&&(n+=O.length);var N=T.lastIndexOf(ud);r=~N?T.length-N:r+T.length}function s(){var T={line:n,column:r};return function(O){return O.position=new a(T),g(),O}}function a(T){this.start=T,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function c(T){var O=new Error(t.source+":"+n+":"+r+": "+T);if(O.reason=T,O.filename=t.source,O.line=n,O.column=r,O.source=e,!t.silent)throw O}function f(T){var O=T.exec(e);if(O){var N=O[0];return i(N),e=e.slice(N.length),O}}function g(){f(id)}function l(T){var O;for(T=T||[];O=u();)O!==!1&&T.push(O);return T}function u(){var T=s();if(!(cs!=e.charAt(0)||us!=e.charAt(1))){for(var O=2;Tn!=e.charAt(O)&&(us!=e.charAt(O)||cs!=e.charAt(O+1));)++O;if(O+=2,Tn===e.charAt(O-1))return c("End of comment missing");var N=e.slice(2,O-2);return r+=2,i(N),e=e.slice(O),r+=2,T({type:dd,comment:N})}}function x(){var T=s(),O=f(od);if(O){if(u(),!f(sd))return c("property missing ':'");var N=f(ad),D=T({type:hd,property:ds(O[0].replace(ls,Tn)),value:N?ds(N[0].replace(ls,Tn)):Tn});return f(ld),D}}function y(){var T=[];l(T);for(var O;O=x();)O!==!1&&(T.push(O),l(T));return T}return g(),y()};function ds(e){return e?e.replace(cd,Tn):Tn}var pd=fd;function ka(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=pd(e),s=typeof t=="function",a,c,f=0,g=i.length;f<g;f++)r=i[f],a=r.property,c=r.value,s?t(a,c,r):c&&(n||(n={}),n[a]=c);return n}oo.exports=ka;oo.exports.default=ka;var md=oo.exports;const gd=Yi(md),vd={}.hasOwnProperty;function yd(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Ed(e),i=wd(e),s=Sd(e);let a,c;if(typeof n=="string"||typeof n=="boolean"?(a=n,n={}):(n||(n={}),a=n.prefix),t&&t.type==="root"){const f=t.children[0];c=t.children.length===1&&f.type==="element"?f:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")c=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return La(e,c,{schema:n.space==="svg"?wa:Ru,prefix:a==null?r||i||s?"h-":void 0:typeof a=="string"?a:a?"h-":void 0,key:0,react:r,vue:i,vdom:s,hyperscript:xd(e)})}function La(e,t,n){const r=n.schema;let i=r,s=t.tagName;const a={},c=[];let f=-1,g;r.space==="html"&&s.toLowerCase()==="svg"&&(i=wa,n.schema=i);for(g in t.properties)t.properties&&vd.call(t.properties,g)&&bd(a,g,t.properties[g],n,s);if(n.vdom&&(i.space==="html"?s=s.toUpperCase():i.space&&(a.namespace=Iu[i.space])),n.prefix&&(n.key++,a.key=n.prefix+n.key),t.children)for(;++f<t.children.length;){const l=t.children[f];l.type==="element"?c.push(La(e,l,n)):l.type==="text"&&c.push(l.value)}return n.schema=r,c.length>0?e.call(t,s,a,c):e.call(t,s,a)}function bd(e,t,n,r,i){const s=Cu(r.schema,t);let a;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&s.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=s.commaSeparated?ku(n):Lu(n)),s.boolean&&r.hyperscript&&(n=""),s.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Td(n,i)),r.vue?s.property!=="style"&&(a="attrs"):s.mustUseProperty||(r.vdom?s.property!=="style"&&(a="attributes"):r.hyperscript&&(a="attrs")),a?e[a]=Object.assign(e[a]||{},{[s.attribute]:n}):s.space&&r.react?e[ju[s.property]||s.property]=n:e[s.attribute]=n)}function Ed(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function xd(e){return"context"in e&&"cleanup"in e}function Sd(e){return e("div",{}).type==="VirtualNode"}function wd(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Td(e,t){const n={};try{gd(e,(r,i)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(s,a)=>a.toUpperCase())]=i})}catch(r){const i=r;throw i.message=t+"[style]"+i.message.slice(9),i}return n}var Od=ja;function ja(e){if(typeof e=="string")return Cd(e);if(e==null)return kd;if(typeof e=="object")return("length"in e?Id:Rd)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function _d(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=ja(e[r]);return t}function Rd(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Id(e){var t=_d(e),n=t.length;return r;function r(){for(var i=-1;++i<n;)if(t[i].apply(this,arguments))return!0;return!1}}function Cd(e){return t;function t(n){return!!(n&&n.type===e)}}function kd(){return!0}var Ld=Kr,jd=Od,Na=!0,Aa="skip",Ar=!1;Kr.CONTINUE=Na;Kr.SKIP=Aa;Kr.EXIT=Ar;function Kr(e,t,n,r){var i;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),i=jd(t),s(e,null,[]);function s(c,f,g){var l=[],u;return(!t||i(c,f,g[g.length-1]||null))&&(l=hs(n(c,g)),l[0]===Ar)?l:c.children&&l[0]!==Aa?(u=hs(a(c.children,g.concat(c))),u[0]===Ar?u:l):l}function a(c,f){for(var g=-1,l=r?-1:1,u=(r?c.length:g)+l,x;u>g&&u<c.length;){if(x=s(c[u],u,f),x[0]===Ar)return x;u=typeof x[1]=="number"?x[1]:u+l}}}function hs(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[Na,e]:[e]}var Nd=Vr,qr=Ld,Ad=qr.CONTINUE,Pd=qr.SKIP,Dd=qr.EXIT;Vr.CONTINUE=Ad;Vr.SKIP=Pd;Vr.EXIT=Dd;function Vr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),qr(e,t,i,r);function i(s,a){var c=a[a.length-1],f=c?c.children.indexOf(s):null;return n(s,f,c)}}var Md=Nd,Bd=Object.prototype.hasOwnProperty,ri={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Fd=function(t){return Md(t,"element",Ud),t};function Ud(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in ri)!Bd.call(ri,t)||e.properties[t]===void 0||(n=ri[t],Wd(e,n,e.properties[t]),delete e.properties[t])}}function Wd(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var i=r+t+": "+n+";";e.properties.style=i}const $d=Yi(Fd);function zd(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const Kd={}.hasOwnProperty,qd=new Set(["table","thead","tbody","tfoot","tr"]);function Vd(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,n=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:r});function r(s){let a=yd(i,n?$d(s):s,e.prefix);return s.type==="root"?(a=a&&typeof a=="object"&&"type"in a&&"props"in a&&a.type==="div"&&(s.children.length!==1||s.children[0].type!=="element")?a.props.children:[a],t(e.Fragment||"div",{},a)):a}function i(s,a,c){if(c&&qd.has(s)&&(c=c.filter(f=>!zd(f))),e.components&&Kd.call(e.components,s)){const f=e.components[s];return e.passNode&&typeof f=="function"&&(a=Object.assign({node:this},a)),t(f,a,c)}return t(s,a,c)}}function so({children:e}){return o.jsx(Hd,{children:e})}const fs="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",Hd=et(Y)`
32
+ .highlight pre,
33
+ pre {
34
+ border-radius: 5px;
35
+ }
36
+ code {
37
+ font-family: ${fs};
38
+ }
39
+ pre code {
40
+ font-size: 14px;
41
+ font-family: ${fs};
42
+ }
43
+
44
+ h1,
45
+ h2,
46
+ h3,
47
+ h4,
48
+ h5,
49
+ h6 {
50
+ font-weight: 700 !important;
51
+ font-size: 1.2rem !important;
52
+ line-height: 1.5 !important;
53
+ margin-bottom: 16px;
54
+ margin-top: 24px;
55
+ border-bottom: initial !important;
56
+ }
57
+
58
+ .CodeMirror pre {
59
+ background: #f6f8fa !important;
60
+ }
61
+
62
+ .anchor {
63
+ display: none;
64
+ }
65
+ `;so.propTypes={children:A.any.isRequired};so.defaultProps={};function Pa({infoList:e=[]}){return o.jsx(Y,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>o.jsxs(o.Fragment,{children:[o.jsx(Y,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),o.jsx(Y,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}Pa.propTypes={infoList:A.arrayOf(A.shape({key:A.string,value:A.string}))};const Gd=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,Xd=new Vd({createElement:M.createElement}).Compiler,At={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ao({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:i,did:s}=r,a=Vt.getDisplayName({meta:r}),c=Sr(()=>i&&s?fetch(rs(i,"/api/blocklets",s,"readme")).then(T=>T.json()):null,{refreshDeps:[i,s]}),f=Au(()=>c.data?c.data[t]||c.data.en||c.data[Object.keys(c.data)[0]]:"",[c]),g=r&&r.htmlAst?Xd(r.htmlAst):"",l=Gd(r);let u=vt(r,"owner.fullName");if(u){const T=vt(r,"owner.did");T&&(u=o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[u,o.jsx(pa,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:T,compact:!0,size:14,locale:t})]}))}else u=vt(r,"author.name");const x=[{key:vt(At[t],"appinfo.name"),value:Vt.getDisplayName({meta:r})},{key:vt(At[t],"appinfo.version"),value:r.version},{key:vt(At[t],"appinfo.author"),value:u},{type:"description",key:vt(At[t],"appinfo.description"),value:r.description}];r.requirements&&x.push({key:vt(At[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&x.push({key:vt(At[t],"appinfo.community"),value:o.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&x.push({key:vt(At[t],"appinfo.documentation"),value:o.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&x.push({key:vt(At[t],"appinfo.support"),value:o.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),g&&x.push({key:vt(At[t],"appinfo.overview"),value:""});let y;return t==="zh"?y=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["您可以免费使用 ",o.jsx("b",{children:a}),";"]}):o.jsxs("p",{children:["您需要购买才能使用 ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),o.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),o.jsx("p",{children:"下面为该应用的信息:"})]}):y=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["You can use ",o.jsx("b",{children:a})," for free;"]}):o.jsxs("p",{children:["You need to purchase before launch ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),o.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),o.jsx("p",{children:"Below is the information for the blocklet: "})]}),o.jsxs(Qd,{children:[n||y,o.jsx(Pa,{infoList:x}),f?o.jsxs("div",{className:"app-overview",children:[o.jsx(ye,{variant:"h5",gutterBottom:!0,children:vt(At[t],"appinfo.overview")}),o.jsx(so,{children:o.jsx(Yd,{component:"div",className:"content-wrapper post-content",children:o.jsx(Nu,{source:f,wrapperElement:{"data-color-mode":"light"},urlTransform:(T,O,N)=>T.startsWith("/")?rs(i,T):T})})})]}):g?o.jsx("div",{className:"app-overview",children:g}):null]})}const Yd=et(ye)`
66
+ width: 100%;
67
+ word-wrap: break-word;
68
+ word-break: break-word;
69
+ line-height: 1.5em;
70
+ min-height: 10vh;
71
+ margin-bottom: 40px !important;
72
+
73
+ .alert-content {
74
+ max-width: 100%;
75
+ p:last-of-type {
76
+ margin-bottom: 0;
77
+ }
78
+ }
79
+
80
+ iframe {
81
+ width: 100% !important;
82
+ }
83
+ `,Qd=et.div`
84
+ .info-table {
85
+ a {
86
+ word-break: break-all;
87
+ }
88
+ }
89
+ .app-overview {
90
+ font-size: 16px;
91
+ margin: 16px 0 0 16px;
92
+ h1 {
93
+ margin: 8px 0;
94
+ font-size: 20px;
95
+ }
96
+ h2 {
97
+ margin: 8px 0;
98
+ font-size: 18px;
99
+ }
100
+ ul {
101
+ display: block;
102
+ list-style-type: disc;
103
+ padding-left: 2em;
104
+ li {
105
+ display: list-item;
106
+ list-style: disc;
107
+ }
108
+ }
109
+ blockquote {
110
+ margin-left: 2em;
111
+ }
112
+ }
113
+ `;ao.propTypes={blockletMeta:A.object.isRequired,locale:A.string.isRequired,handleDescEle:A.node};ao.defaultProps={handleDescEle:""};function Jd({...e}){return o.jsxs("div",{...e,style:{width:"100%"},children:[o.jsx("h3",{children:"End User License Agreement for Application"}),o.jsxs("p",{children:["Blocklet Server License Agreement ",ma.COPYRIGHT_OWNER," version 2020-08-28"]}),o.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),o.jsx("p",{children:"暂无"})]})}function Zd(e){var t,n,r,i;return`${((t=e.bundleSource)==null?void 0:t.store)||e.meta.homepage}/assets/${(n=e.meta)==null?void 0:n.did}/${((r=e.meta)==null?void 0:r.logo)||"logo.png"}?v=${(i=e.meta)==null?void 0:i.version}`}function lo({installRelated:e,meta:t,show:n,onClose:r,components:i,loading:s}){const{t:a}=Tt(),c=rn(u=>u.breakpoints.down("md"));if(!n)return null;const f=!s&&i.length===0,g=!s&&i.length!==0,l=40;return o.jsxs(Ji,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(u,x)=>{x!=="backdropClick"&&r(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[s&&o.jsx(Y,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:o.jsx(Y,{sx:{fontSize:32},color:"primary.main",component:St,icon:"line-md:loading-loop"})}),f&&o.jsx(Y,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),g&&o.jsx(Y,{sx:{marginBottom:2},children:i.map(u=>{if(!u.meta)return null;const{required:x}=u;let y;return e||x?y=1:y=.5,o.jsxs(Y,{sx:{opacity:y,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[o.jsx("img",{style:{width:l,height:l,minWidth:l,minHeight:l},src:Zd(u),alt:u.meta.title}),o.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var T;window.open(Mu(`${((T=u.bundleSource)==null?void 0:T.store)||u.meta.homepage}/blocklets/${u.meta.did}`,{allowDomains:null}),"_blank")},children:[u.meta.title,o.jsx(Y,{sx:{display:x?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),o.jsxs(Y,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[u.meta.version,o.jsx(Y,{className:"link-icon",icon:"fluent:open-20-filled",component:St,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),o.jsx(Y,{sx:{marginTop:0,opacity:.7},children:u.meta.description})]})]},u.meta.did)})})]})}lo.propTypes={meta:A.object,show:A.bool,onClose:A.func.isRequired,installRelated:A.func,components:A.array.isRequired,loading:A.bool.isRequired};lo.defaultProps={meta:null,show:!1,installRelated:!1};function eh(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function th(e){const{api:t}=Hn(),[n]=Lc(),r=n.get("blocklet_meta_url")||eh(e),[i,s]=M.useState([]),[a,c]=M.useState(!1);return M.useEffect(()=>{!r||e!=null&&e.inputUrl||(c(!0),t.getDynamicComponents({input:{url:r}}).then(f=>{s(f.components)}).finally(()=>{c(!1)}))},[r]),{components:i,loading:a}}function co({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:i}){const s=jc(),{t:a,locale:c}=Tt(),[f,g]=M.useState(!1),{components:l,loading:u}=th(n),x=Ca(n),y=r||(()=>{s(`/launch-blocklet/install${window.location.search}`)}),T=()=>{g(!0)},O=()=>{g(!1)};return o.jsxs(nh,{children:[o.jsx("div",{className:"app-content",children:o.jsx("div",{className:"agreement",children:o.jsx("div",{className:"agreement-content",children:x?o.jsx(ao,{blockletMeta:{data:n},locale:c,handleDescEle:i}):o.jsx(Y,{sx:{p:3},children:o.jsx(ye,{children:a("launchBlocklet.dockerBlockletCantInstall")})})})})}),o.jsxs(Y,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[u?o.jsx(St,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,x&&t&&(l!=null&&l.length)?o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[o.jsx(Hi,{sx:{mr:.5},checked:e,onChange:N=>t(N.currentTarget.checked),control:o.jsx(Gi,{}),label:o.jsx("span",{children:a("launchBlocklet.installRelatedComponents")})}),o.jsx(Y,{sx:{"> button svg":{color:"primary.main"}},children:o.jsx(na,{size:"small",onClick:T,children:o.jsx(St,{icon:"octicon:package-dependencies-16"})})})]}):null,o.jsx("div",{className:"button-container","data-cy":"agree-all",children:x?o.jsx(io,{onContinue:y,description:o.jsx(Jd,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}}):null})]}),o.jsx(lo,{installRelated:e,meta:n,show:f,onClose:O,components:l,loading:u})]})}co.propTypes={meta:A.object.isRequired,onClickNext:A.func,handleDescEle:A.node,installRelated:A.bool,onChangeInstallRelated:A.func};co.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const nh=et.div`
114
+ display: flex;
115
+ flex-direction: column;
116
+ align-items: center;
117
+ width: 100%;
118
+ height: 100%;
119
+ flex: 1;
120
+ .app-content {
121
+ padding: 2px 24px 24px;
122
+ ${e=>e.theme.breakpoints.down("md")} {
123
+ padding-top: 10px;
124
+ }
125
+ width: 100%;
126
+ flex: 1;
127
+ letter-spacing: normal;
128
+ }
129
+ .agreement {
130
+ position: relative;
131
+ display: flex;
132
+ flex-direction: column;
133
+ width: 100%;
134
+ height: 100%;
135
+ border: 1px solid ${e=>e.theme.palette.grey[100]};
136
+ border-radius: 12px;
137
+ ${e=>e.theme.breakpoints.up("md")} {
138
+ margin-top: 24px;
139
+ }
140
+ ${e=>e.theme.breakpoints.down("md")} {
141
+ margin-top: 16px;
142
+ }
143
+ .agreement-content {
144
+ position: absolute;
145
+ left: 0;
146
+ top: 0;
147
+ width: 100%;
148
+ height: 100%;
149
+ font-size: 14px;
150
+ overflow-y: auto;
151
+ ${e=>e.theme.breakpoints.up("md")} {
152
+ padding: 0 24px;
153
+ }
154
+ ${e=>e.theme.breakpoints.down("md")} {
155
+ padding: 0 16px;
156
+ }
157
+ &:after {
158
+ display: block;
159
+ content: '';
160
+ height: 24px;
161
+ }
162
+ }
163
+ }
164
+ .agreement-bottom {
165
+ display: flex;
166
+ width: 100%;
167
+ padding: 24px;
168
+ ${e=>e.theme.breakpoints.up("md")} {
169
+ flex-direction: row;
170
+ align-items: center;
171
+ margin-left: auto;
172
+ }
173
+ ${e=>e.theme.breakpoints.down("md")} {
174
+ flex-direction: column;
175
+ align-items: center;
176
+ padding-top: 0;
177
+ padding-bottom: 16px;
178
+ }
179
+ }
180
+ .button-container {
181
+ ${e=>e.theme.breakpoints.up("md")} {
182
+ margin-left: auto;
183
+ }
184
+ ${e=>e.theme.breakpoints.down("md")} {
185
+ padding-top: 0;
186
+ padding-bottom: 16px;
187
+ }
188
+ }
189
+ `;var Da={},uo={exports:{}},Ma={exports:{}},ir=Ma.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(e){return"file-"+Ba(e)}}},ps={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:Ba};Object.keys(ir).forEach(function(e){Object.keys(ps).forEach(function(t){ir[e][t]||(ir[e][t]=ps[t])}),ir[e].protocols_re=RegExp("^("+ir[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ba(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var Fa=Ma.exports,ms=Fa,$n=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let i=r.length;for(;i--;)t[r[i]]=n[r[i]];return t},rh=rt;function rt(e,t,n,r,i,s,a){var c=this;c.type=e,Object.keys(ms[e]).forEach(function(f){c[f]=ms[e][f]}),c.user=t,c.auth=n,c.project=r,c.committish=i,c.default=s,c.opts=a||{}}rt.prototype.hash=function(){return this.committish?"#"+this.committish:""};rt.prototype._fill=function(e,t){if(e){var n=$n({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=$n($n({},this.opts),t);var r=this;Object.keys(this).forEach(function(l){r[l]!=null&&n[l]==null&&(n[l]=r[l])});var i=n.auth,s=n.committish,a=n.fragment,c=n.path,f=n.project;Object.keys(n).forEach(function(l){var u=n[l];(l==="path"||l==="project")&&typeof u=="string"?n[l]=u.split("/").map(function(x){return encodeURIComponent(x)}).join("/"):l!=="domain"&&(n[l]=encodeURIComponent(u))}),n["auth@"]=i?i+"@":"",n["#fragment"]=a?"#"+this.hashformat(a):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=c?"#"+this.hashformat(c):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=s?"#"+s:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var g=e;return Object.keys(n).forEach(function(l){g=g.replace(new RegExp("[{]"+l+"[}]","g"),n[l])}),t.noGitPlus?g.replace(/^git[+]/,""):g}};rt.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};rt.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};rt.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,$n({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};rt.prototype.docs=function(e){return this._fill(this.docstemplate,e)};rt.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};rt.prototype.https=function(e){return this._fill(this.httpstemplate,e)};rt.prototype.git=function(e){return this._fill(this.gittemplate,e)};rt.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};rt.prototype.path=function(e){return this._fill(this.pathtemplate,e)};rt.prototype.tarball=function(e){var t=$n({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};rt.prototype.file=function(e,t){return this._fill(this.filetemplate,$n({path:e},t))};rt.prototype.getDefaultRepresentation=function(){return this.default};rt.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var ii,gs;function ih(){return gs||(gs=1,ii=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),ii}var oh=Ee;Ee.Node=Rn;Ee.create=Ee;function Ee(e){var t=this;if(t instanceof Ee||(t=new Ee),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}Ee.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};Ee.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};Ee.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};Ee.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)ah(this,arguments[e]);return this.length};Ee.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)lh(this,arguments[e]);return this.length};Ee.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};Ee.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};Ee.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};Ee.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};Ee.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};Ee.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};Ee.prototype.map=function(e,t){t=t||this;for(var n=new Ee,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};Ee.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Ee,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};Ee.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};Ee.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};Ee.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};Ee.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};Ee.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Ee;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n};Ee.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Ee;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};Ee.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var s=[],r=0;i&&r<t;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=sh(this,i,n[r]);return s};Ee.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function sh(e,t,n){var r=t===e.head?new Rn(n,null,t,e):new Rn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function ah(e,t){e.tail=new Rn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function lh(e,t){e.head=new Rn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Rn(e,t,n,r){if(!(this instanceof Rn))return new Rn(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{ih()(Ee)}catch{}const ch=oh,On=Symbol("max"),qt=Symbol("length"),Un=Symbol("lengthCalculator"),ur=Symbol("allowStale"),_n=Symbol("maxAge"),zt=Symbol("dispose"),vs=Symbol("noDisposeOnSet"),Xe=Symbol("lruList"),Rt=Symbol("cache"),Ua=Symbol("updateAgeOnGet"),oi=()=>1;class uh{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[On]=t.max||1/0;const n=t.length||oi;if(this[Un]=typeof n!="function"?oi:n,this[ur]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[_n]=t.maxAge||0,this[zt]=t.dispose,this[vs]=t.noDisposeOnSet||!1,this[Ua]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[On]=t||1/0,or(this)}get max(){return this[On]}set allowStale(t){this[ur]=!!t}get allowStale(){return this[ur]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[_n]=t,or(this)}get maxAge(){return this[_n]}set lengthCalculator(t){typeof t!="function"&&(t=oi),t!==this[Un]&&(this[Un]=t,this[qt]=0,this[Xe].forEach(n=>{n.length=this[Un](n.value,n.key),this[qt]+=n.length})),or(this)}get lengthCalculator(){return this[Un]}get length(){return this[qt]}get itemCount(){return this[Xe].length}rforEach(t,n){n=n||this;for(let r=this[Xe].tail;r!==null;){const i=r.prev;ys(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[Xe].head;r!==null;){const i=r.next;ys(this,t,r,n),r=i}}keys(){return this[Xe].toArray().map(t=>t.key)}values(){return this[Xe].toArray().map(t=>t.value)}reset(){this[zt]&&this[Xe]&&this[Xe].length&&this[Xe].forEach(t=>this[zt](t.key,t.value)),this[Rt]=new Map,this[Xe]=new ch,this[qt]=0}dump(){return this[Xe].map(t=>Br(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Xe]}set(t,n,r){if(r=r||this[_n],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[Un](n,t);if(this[Rt].has(t)){if(s>this[On])return zn(this,this[Rt].get(t)),!1;const f=this[Rt].get(t).value;return this[zt]&&(this[vs]||this[zt](t,f.value)),f.now=i,f.maxAge=r,f.value=n,this[qt]+=s-f.length,f.length=s,this.get(t),or(this),!0}const a=new dh(t,n,s,i,r);return a.length>this[On]?(this[zt]&&this[zt](t,n),!1):(this[qt]+=a.length,this[Xe].unshift(a),this[Rt].set(t,this[Xe].head),or(this),!0)}has(t){if(!this[Rt].has(t))return!1;const n=this[Rt].get(t).value;return!Br(this,n)}get(t){return si(this,t,!0)}peek(t){return si(this,t,!1)}pop(){const t=this[Xe].tail;return t?(zn(this,t),t.value):null}del(t){zn(this,this[Rt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const a=s-n;a>0&&this.set(i.k,i.v,a)}}}prune(){this[Rt].forEach((t,n)=>si(this,n,!1))}}const si=(e,t,n)=>{const r=e[Rt].get(t);if(r){const i=r.value;if(Br(e,i)){if(zn(e,r),!e[ur])return}else n&&(e[Ua]&&(r.value.now=Date.now()),e[Xe].unshiftNode(r));return i.value}},Br=(e,t)=>{if(!t||!t.maxAge&&!e[_n])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[_n]&&n>e[_n]},or=e=>{if(e[qt]>e[On])for(let t=e[Xe].tail;e[qt]>e[On]&&t!==null;){const n=t.prev;zn(e,t),t=n}},zn=(e,t)=>{if(t){const n=t.value;e[zt]&&e[zt](n.key,n.value),e[qt]-=n.length,e[Rt].delete(n.key),e[Xe].removeNode(t)}};class dh{constructor(t,n,r,i,s){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const ys=(e,t,n,r)=>{let i=n.value;Br(e,i)&&(zn(e,n),e[ur]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var hh=uh,Oi=hu,bs=Fa,fh=uo.exports=rh,ph=hh,ai=new ph({max:1e3}),mh={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function gh(e){return mh[e]||e.slice(0,-1)}var vh={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};uo.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return ai.has(n)||ai.set(n,yh(e,t)),ai.get(n)}};function yh(e,t){if(!(e==null||e==="")){var n=Eh(bh(e)?"github:"+e:e),r=xh(n),i=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),s=Object.keys(bs).map(function(a){try{var c=bs[a],f=null;r.auth&&vh[r.protocol]&&(f=r.auth);var g=r.hash?decodeURIComponent(r.hash.substr(1)):null,l=null,u=null,x=null;if(i&&i[1]===a)l=i[2]&&decodeURIComponent(i[2]),u=decodeURIComponent(i[3].replace(/\.git$/,"")),x="shortcut";else{if(r.host&&r.host!==c.domain&&r.host.replace(/^www[.]/,"")!==c.domain||!c.protocols_re.test(r.protocol)||!r.path)return;var y=c.pathmatch,T=r.path.match(y);if(!T)return;T[1]!==null&&T[1]!==void 0&&(l=decodeURIComponent(T[1].replace(/^:/,""))),u=decodeURIComponent(T[2]),x=gh(r.protocol)}return new fh(a,l,f,u,g,x,t)}catch(O){if(!(O instanceof URIError))throw O}}).filter(function(a){return a});if(s.length===1)return s[0]}}function bh(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Eh(e){var t=Oi.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function xh(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=Oi.parse(e);if(n.auth){const i=e.match(/[^@]+@[^:/]+/);if(i){var r=new Oi.URL(i[0]);n.auth=r.username||"",r.password&&(n.auth+=":"+r.password)}}return n}return{protocol:"git+ssh:",slashes:!0,auth:t[1],host:t[2],port:null,hostname:t[2],hash:t[4],search:null,query:null,pathname:"/"+t[3],path:"/"+t[3],href:"git+ssh://"+t[1]+"@"+t[2]+"/"+t[3]+(t[4]||"")}}var Sh=uo.exports,In={},te={},wh=null;const Th=Object.freeze(Object.defineProperty({__proto__:null,default:wh},Symbol.toStringTag,{value:"Module"})),Wa=Qi(Th),Oh=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],_h=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Rh={charsWide:Oh,charsFullWidth:_h};const{charsWide:Ih,charsFullWidth:Ch}=Rh,$a=new RegExp(`[${Ih.join("")}${Ch.join("")}]`,"g"),kh=e=>e.replace($a,"xx").length;var Lh={default:kh,charsRegex:$a};/*!
190
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
191
+ *
192
+ * Copyright (c) 2014-2016, Jon Schlinkert.
193
+ * Licensed under the MIT License.
194
+ */var jh=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
195
+ * is-glob <https://github.com/jonschlinkert/is-glob>
196
+ *
197
+ * Copyright (c) 2014-2017, Jon Schlinkert.
198
+ * Released under the MIT License.
199
+ */var Nh=jh,za={"{":"}","(":")","[":"]"},Ah=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,i=-2,s=-2,a=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||r!==-1&&e[t]==="["&&e[t+1]!=="]"&&(r<t&&(r=e.indexOf("]",t)),r>t&&(a===-1||a>r||(a=e.indexOf("\\",t),a===-1||a>r)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(a=e.indexOf("\\",t),a===-1||a>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(a=e.indexOf("\\",t),a===-1||a>s))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(s=e.indexOf(")",n),s>n&&(a=e.indexOf("\\",n),a===-1||a>s))))return!0;if(e[t]==="\\"){var c=e[t+1];t+=2;var f=za[c];if(f){var g=e.indexOf(f,t);g!==-1&&(t=g+1)}if(e[t]==="!")return!0}else t++}return!1},Ph=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var n=e[t+1];t+=2;var r=za[n];if(r){var i=e.indexOf(r,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1},Dh=function(t,n){if(typeof t!="string"||t==="")return!1;if(Nh(t))return!0;var r=Ah;return n&&n.strict===!1&&(r=Ph),r(t)},_i={exports:{}};(function(e,t){var n={};t=e.exports=U;var r;typeof Zc=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var d=Array.prototype.slice.call(arguments,0);d.unshift("SEMVER"),console.log.apply(console,d)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=16,c=i-6,f=t.re=[],g=t.safeRe=[],l=t.src=[],u=t.tokens={},x=0;function y(d){u[d]=x++}var T="[a-zA-Z0-9-]",O=[["\\s",1],["\\d",i],[T,c]];function N(d){for(var E=0;E<O.length;E++){var S=O[E][0],L=O[E][1];d=d.split(S+"*").join(S+"{0,"+L+"}").split(S+"+").join(S+"{1,"+L+"}")}return d}y("NUMERICIDENTIFIER"),l[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",y("NUMERICIDENTIFIERLOOSE"),l[u.NUMERICIDENTIFIERLOOSE]="\\d+",y("NONNUMERICIDENTIFIER"),l[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+T+"*",y("MAINVERSION"),l[u.MAINVERSION]="("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")",y("MAINVERSIONLOOSE"),l[u.MAINVERSIONLOOSE]="("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")",y("PRERELEASEIDENTIFIER"),l[u.PRERELEASEIDENTIFIER]="(?:"+l[u.NUMERICIDENTIFIER]+"|"+l[u.NONNUMERICIDENTIFIER]+")",y("PRERELEASEIDENTIFIERLOOSE"),l[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[u.NUMERICIDENTIFIERLOOSE]+"|"+l[u.NONNUMERICIDENTIFIER]+")",y("PRERELEASE"),l[u.PRERELEASE]="(?:-("+l[u.PRERELEASEIDENTIFIER]+"(?:\\."+l[u.PRERELEASEIDENTIFIER]+")*))",y("PRERELEASELOOSE"),l[u.PRERELEASELOOSE]="(?:-?("+l[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[u.PRERELEASEIDENTIFIERLOOSE]+")*))",y("BUILDIDENTIFIER"),l[u.BUILDIDENTIFIER]=T+"+",y("BUILD"),l[u.BUILD]="(?:\\+("+l[u.BUILDIDENTIFIER]+"(?:\\."+l[u.BUILDIDENTIFIER]+")*))",y("FULL"),y("FULLPLAIN"),l[u.FULLPLAIN]="v?"+l[u.MAINVERSION]+l[u.PRERELEASE]+"?"+l[u.BUILD]+"?",l[u.FULL]="^"+l[u.FULLPLAIN]+"$",y("LOOSEPLAIN"),l[u.LOOSEPLAIN]="[v=\\s]*"+l[u.MAINVERSIONLOOSE]+l[u.PRERELEASELOOSE]+"?"+l[u.BUILD]+"?",y("LOOSE"),l[u.LOOSE]="^"+l[u.LOOSEPLAIN]+"$",y("GTLT"),l[u.GTLT]="((?:<|>)?=?)",y("XRANGEIDENTIFIERLOOSE"),l[u.XRANGEIDENTIFIERLOOSE]=l[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",y("XRANGEIDENTIFIER"),l[u.XRANGEIDENTIFIER]=l[u.NUMERICIDENTIFIER]+"|x|X|\\*",y("XRANGEPLAIN"),l[u.XRANGEPLAIN]="[v=\\s]*("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:"+l[u.PRERELEASE]+")?"+l[u.BUILD]+"?)?)?",y("XRANGEPLAINLOOSE"),l[u.XRANGEPLAINLOOSE]="[v=\\s]*("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:"+l[u.PRERELEASELOOSE]+")?"+l[u.BUILD]+"?)?)?",y("XRANGE"),l[u.XRANGE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAIN]+"$",y("XRANGELOOSE"),l[u.XRANGELOOSE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAINLOOSE]+"$",y("COERCE"),l[u.COERCE]="(^|[^\\d])(\\d{1,"+a+"})(?:\\.(\\d{1,"+a+"}))?(?:\\.(\\d{1,"+a+"}))?(?:$|[^\\d])",y("COERCERTL"),f[u.COERCERTL]=new RegExp(l[u.COERCE],"g"),g[u.COERCERTL]=new RegExp(N(l[u.COERCE]),"g"),y("LONETILDE"),l[u.LONETILDE]="(?:~>?)",y("TILDETRIM"),l[u.TILDETRIM]="(\\s*)"+l[u.LONETILDE]+"\\s+",f[u.TILDETRIM]=new RegExp(l[u.TILDETRIM],"g"),g[u.TILDETRIM]=new RegExp(N(l[u.TILDETRIM]),"g");var D="$1~";y("TILDE"),l[u.TILDE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAIN]+"$",y("TILDELOOSE"),l[u.TILDELOOSE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAINLOOSE]+"$",y("LONECARET"),l[u.LONECARET]="(?:\\^)",y("CARETTRIM"),l[u.CARETTRIM]="(\\s*)"+l[u.LONECARET]+"\\s+",f[u.CARETTRIM]=new RegExp(l[u.CARETTRIM],"g"),g[u.CARETTRIM]=new RegExp(N(l[u.CARETTRIM]),"g");var P="$1^";y("CARET"),l[u.CARET]="^"+l[u.LONECARET]+l[u.XRANGEPLAIN]+"$",y("CARETLOOSE"),l[u.CARETLOOSE]="^"+l[u.LONECARET]+l[u.XRANGEPLAINLOOSE]+"$",y("COMPARATORLOOSE"),l[u.COMPARATORLOOSE]="^"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+")$|^$",y("COMPARATOR"),l[u.COMPARATOR]="^"+l[u.GTLT]+"\\s*("+l[u.FULLPLAIN]+")$|^$",y("COMPARATORTRIM"),l[u.COMPARATORTRIM]="(\\s*)"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+"|"+l[u.XRANGEPLAIN]+")",f[u.COMPARATORTRIM]=new RegExp(l[u.COMPARATORTRIM],"g"),g[u.COMPARATORTRIM]=new RegExp(N(l[u.COMPARATORTRIM]),"g");var F="$1$2$3";y("HYPHENRANGE"),l[u.HYPHENRANGE]="^\\s*("+l[u.XRANGEPLAIN]+")\\s+-\\s+("+l[u.XRANGEPLAIN]+")\\s*$",y("HYPHENRANGELOOSE"),l[u.HYPHENRANGELOOSE]="^\\s*("+l[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+l[u.XRANGEPLAINLOOSE]+")\\s*$",y("STAR"),l[u.STAR]="(<|>)?=?\\s*\\*";for(var V=0;V<x;V++)r(V,l[V]),f[V]||(f[V]=new RegExp(l[V]),g[V]=new RegExp(N(l[V])));t.parse=I;function I(d,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),d instanceof U)return d;if(typeof d!="string"||d.length>i)return null;var S=E.loose?g[u.LOOSE]:g[u.FULL];if(!S.test(d))return null;try{return new U(d,E)}catch{return null}}t.valid=B;function B(d,E){var S=I(d,E);return S?S.version:null}t.clean=H;function H(d,E){var S=I(d.trim().replace(/^[=v]+/,""),E);return S?S.version:null}t.SemVer=U;function U(d,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),d instanceof U){if(d.loose===E.loose)return d;d=d.version}else if(typeof d!="string")throw new TypeError("Invalid Version: "+d);if(d.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof U))return new U(d,E);r("SemVer",d,E),this.options=E,this.loose=!!E.loose;var S=d.trim().match(E.loose?g[u.LOOSE]:g[u.FULL]);if(!S)throw new TypeError("Invalid Version: "+d);if(this.raw=d,this.major=+S[1],this.minor=+S[2],this.patch=+S[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");S[4]?this.prerelease=S[4].split(".").map(function(L){if(/^[0-9]+$/.test(L)){var R=+L;if(R>=0&&R<s)return R}return L}):this.prerelease=[],this.build=S[5]?S[5].split("."):[],this.format()}U.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},U.prototype.toString=function(){return this.version},U.prototype.compare=function(d){return r("SemVer.compare",this.version,this.options,d),d instanceof U||(d=new U(d,this.options)),this.compareMain(d)||this.comparePre(d)},U.prototype.compareMain=function(d){return d instanceof U||(d=new U(d,this.options)),Ie(this.major,d.major)||Ie(this.minor,d.minor)||Ie(this.patch,d.patch)},U.prototype.comparePre=function(d){if(d instanceof U||(d=new U(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;var E=0;do{var S=this.prerelease[E],L=d.prerelease[E];if(r("prerelease compare",E,S,L),S===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(S===void 0)return-1;if(S===L)continue;return Ie(S,L)}while(++E)},U.prototype.compareBuild=function(d){d instanceof U||(d=new U(d,this.options));var E=0;do{var S=this.build[E],L=d.build[E];if(r("prerelease compare",E,S,L),S===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(S===void 0)return-1;if(S===L)continue;return Ie(S,L)}while(++E)},U.prototype.inc=function(d,E){switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",E);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",E);break;case"prepatch":this.prerelease.length=0,this.inc("patch",E),this.inc("pre",E);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",E),this.inc("pre",E);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var S=this.prerelease.length;--S>=0;)typeof this.prerelease[S]=="number"&&(this.prerelease[S]++,S=-2);S===-1&&this.prerelease.push(0)}E&&(this.prerelease[0]===E?isNaN(this.prerelease[1])&&(this.prerelease=[E,0]):this.prerelease=[E,0]);break;default:throw new Error("invalid increment argument: "+d)}return this.format(),this.raw=this.version,this},t.inc=le;function le(d,E,S,L){typeof S=="string"&&(L=S,S=void 0);try{return new U(d,S).inc(E,L).version}catch{return null}}t.diff=G;function G(d,E){if(an(d,E))return null;var S=I(d),L=I(E),R="";if(S.prerelease.length||L.prerelease.length){R="pre";var j="prerelease"}for(var $ in S)if(($==="major"||$==="minor"||$==="patch")&&S[$]!==L[$])return R+$;return j}t.compareIdentifiers=Ie;var se=/^[0-9]+$/;function Ie(d,E){var S=se.test(d),L=se.test(E);return S&&L&&(d=+d,E=+E),d===E?0:S&&!L?-1:L&&!S?1:d<E?-1:1}t.rcompareIdentifiers=Ge;function Ge(d,E){return Ie(E,d)}t.major=ze;function ze(d,E){return new U(d,E).major}t.minor=it;function it(d,E){return new U(d,E).minor}t.patch=Z;function Z(d,E){return new U(d,E).patch}t.compare=me;function me(d,E,S){return new U(d,S).compare(new U(E,S))}t.compareLoose=ee;function ee(d,E){return me(d,E,!0)}t.compareBuild=xe;function xe(d,E,S){var L=new U(d,S),R=new U(E,S);return L.compare(R)||L.compareBuild(R)}t.rcompare=oe;function oe(d,E,S){return me(E,d,S)}t.sort=We;function We(d,E){return d.sort(function(S,L){return t.compareBuild(S,L,E)})}t.rsort=Te;function Te(d,E){return d.sort(function(S,L){return t.compareBuild(L,S,E)})}t.gt=ot;function ot(d,E,S){return me(d,E,S)>0}t.lt=Ye;function Ye(d,E,S){return me(d,E,S)<0}t.eq=an;function an(d,E,S){return me(d,E,S)===0}t.neq=ln;function ln(d,E,S){return me(d,E,S)!==0}t.gte=Gt;function Gt(d,E,S){return me(d,E,S)>=0}t.lte=cn;function cn(d,E,S){return me(d,E,S)<=0}t.cmp=De;function De(d,E,S,L){switch(E){case"===":return typeof d=="object"&&(d=d.version),typeof S=="object"&&(S=S.version),d===S;case"!==":return typeof d=="object"&&(d=d.version),typeof S=="object"&&(S=S.version),d!==S;case"":case"=":case"==":return an(d,S,L);case"!=":return ln(d,S,L);case">":return ot(d,S,L);case">=":return Gt(d,S,L);case"<":return Ye(d,S,L);case"<=":return cn(d,S,L);default:throw new TypeError("Invalid operator: "+E)}}t.Comparator=Me;function Me(d,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),d instanceof Me){if(d.loose===!!E.loose)return d;d=d.value}if(!(this instanceof Me))return new Me(d,E);d=d.trim().split(/\s+/).join(" "),r("comparator",d,E),this.options=E,this.loose=!!E.loose,this.parse(d),this.semver===st?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var st={};Me.prototype.parse=function(d){var E=this.options.loose?g[u.COMPARATORLOOSE]:g[u.COMPARATOR],S=d.match(E);if(!S)throw new TypeError("Invalid comparator: "+d);this.operator=S[1]!==void 0?S[1]:"",this.operator==="="&&(this.operator=""),S[2]?this.semver=new U(S[2],this.options.loose):this.semver=st},Me.prototype.toString=function(){return this.value},Me.prototype.test=function(d){if(r("Comparator.test",d,this.options.loose),this.semver===st||d===st)return!0;if(typeof d=="string")try{d=new U(d,this.options)}catch{return!1}return De(d,this.operator,this.semver,this.options)},Me.prototype.intersects=function(d,E){if(!(d instanceof Me))throw new TypeError("a Comparator is required");(!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1});var S;if(this.operator==="")return this.value===""?!0:(S=new he(d.value,E),ht(this.value,S,E));if(d.operator==="")return d.value===""?!0:(S=new he(this.value,E),ht(d.semver,S,E));var L=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),R=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),j=this.semver.version===d.semver.version,$=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),ne=De(this.semver,"<",d.semver,E)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),ae=De(this.semver,">",d.semver,E)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return L||R||j&&$||ne||ae},t.Range=he;function he(d,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),d instanceof he)return d.loose===!!E.loose&&d.includePrerelease===!!E.includePrerelease?d:new he(d.raw,E);if(d instanceof Me)return new he(d.value,E);if(!(this instanceof he))return new he(d,E);if(this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease,this.raw=d.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(S){return this.parseRange(S.trim())},this).filter(function(S){return S.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}he.prototype.format=function(){return this.range=this.set.map(function(d){return d.join(" ").trim()}).join("||").trim(),this.range},he.prototype.toString=function(){return this.range},he.prototype.parseRange=function(d){var E=this.options.loose,S=E?g[u.HYPHENRANGELOOSE]:g[u.HYPHENRANGE];d=d.replace(S,lt),r("hyphen replace",d),d=d.replace(g[u.COMPARATORTRIM],F),r("comparator trim",d,g[u.COMPARATORTRIM]),d=d.replace(g[u.TILDETRIM],D),d=d.replace(g[u.CARETTRIM],P),d=d.split(/\s+/).join(" ");var L=E?g[u.COMPARATORLOOSE]:g[u.COMPARATOR],R=d.split(" ").map(function(j){return hn(j,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(R=R.filter(function(j){return!!j.match(L)})),R=R.map(function(j){return new Me(j,this.options)},this),R},he.prototype.intersects=function(d,E){if(!(d instanceof he))throw new TypeError("a Range is required");return this.set.some(function(S){return un(S,E)&&d.set.some(function(L){return un(L,E)&&S.every(function(R){return L.every(function(j){return R.intersects(j,E)})})})})};function un(d,E){for(var S=!0,L=d.slice(),R=L.pop();S&&L.length;)S=L.every(function(j){return R.intersects(j,E)}),R=L.pop();return S}t.toComparators=dn;function dn(d,E){return new he(d,E).set.map(function(S){return S.map(function(L){return L.value}).join(" ").trim().split(" ")})}function hn(d,E){return r("comp",d,E),d=at(d,E),r("caret",d),d=Xt(d,E),r("tildes",d),d=pn(d,E),r("xrange",d),d=Ke(d,E),r("stars",d),d}function ke(d){return!d||d.toLowerCase()==="x"||d==="*"}function Xt(d,E){return d.trim().split(/\s+/).map(function(S){return Xn(S,E)}).join(" ")}function Xn(d,E){var S=E.loose?g[u.TILDELOOSE]:g[u.TILDE];return d.replace(S,function(L,R,j,$,ne){r("tilde",d,L,R,j,$,ne);var ae;return ke(R)?ae="":ke(j)?ae=">="+R+".0.0 <"+(+R+1)+".0.0":ke($)?ae=">="+R+"."+j+".0 <"+R+"."+(+j+1)+".0":ne?(r("replaceTilde pr",ne),ae=">="+R+"."+j+"."+$+"-"+ne+" <"+R+"."+(+j+1)+".0"):ae=">="+R+"."+j+"."+$+" <"+R+"."+(+j+1)+".0",r("tilde return",ae),ae})}function at(d,E){return d.trim().split(/\s+/).map(function(S){return fn(S,E)}).join(" ")}function fn(d,E){r("caret",d,E);var S=E.loose?g[u.CARETLOOSE]:g[u.CARET];return d.replace(S,function(L,R,j,$,ne){r("caret",d,L,R,j,$,ne);var ae;return ke(R)?ae="":ke(j)?ae=">="+R+".0.0 <"+(+R+1)+".0.0":ke($)?R==="0"?ae=">="+R+"."+j+".0 <"+R+"."+(+j+1)+".0":ae=">="+R+"."+j+".0 <"+(+R+1)+".0.0":ne?(r("replaceCaret pr",ne),R==="0"?j==="0"?ae=">="+R+"."+j+"."+$+"-"+ne+" <"+R+"."+j+"."+(+$+1):ae=">="+R+"."+j+"."+$+"-"+ne+" <"+R+"."+(+j+1)+".0":ae=">="+R+"."+j+"."+$+"-"+ne+" <"+(+R+1)+".0.0"):(r("no pr"),R==="0"?j==="0"?ae=">="+R+"."+j+"."+$+" <"+R+"."+j+"."+(+$+1):ae=">="+R+"."+j+"."+$+" <"+R+"."+(+j+1)+".0":ae=">="+R+"."+j+"."+$+" <"+(+R+1)+".0.0"),r("caret return",ae),ae})}function pn(d,E){return r("replaceXRanges",d,E),d.split(/\s+/).map(function(S){return mn(S,E)}).join(" ")}function mn(d,E){d=d.trim();var S=E.loose?g[u.XRANGELOOSE]:g[u.XRANGE];return d.replace(S,function(L,R,j,$,ne,ae){r("xRange",d,L,R,j,$,ne,ae);var qe=ke(j),Ue=qe||ke($),Oe=Ue||ke(ne),Re=Oe;return R==="="&&Re&&(R=""),ae=E.includePrerelease?"-0":"",qe?R===">"||R==="<"?L="<0.0.0-0":L="*":R&&Re?(Ue&&($=0),ne=0,R===">"?(R=">=",Ue?(j=+j+1,$=0,ne=0):($=+$+1,ne=0)):R==="<="&&(R="<",Ue?j=+j+1:$=+$+1),L=R+j+"."+$+"."+ne+ae):Ue?L=">="+j+".0.0"+ae+" <"+(+j+1)+".0.0"+ae:Oe&&(L=">="+j+"."+$+".0"+ae+" <"+j+"."+(+$+1)+".0"+ae),r("xRange return",L),L})}function Ke(d,E){return r("replaceStars",d,E),d.trim().replace(g[u.STAR],"")}function lt(d,E,S,L,R,j,$,ne,ae,qe,Ue,Oe,Re){return ke(S)?E="":ke(L)?E=">="+S+".0.0":ke(R)?E=">="+S+"."+L+".0":E=">="+E,ke(ae)?ne="":ke(qe)?ne="<"+(+ae+1)+".0.0":ke(Ue)?ne="<"+ae+"."+(+qe+1)+".0":Oe?ne="<="+ae+"."+qe+"."+Ue+"-"+Oe:ne="<="+ne,(E+" "+ne).trim()}he.prototype.test=function(d){if(!d)return!1;if(typeof d=="string")try{d=new U(d,this.options)}catch{return!1}for(var E=0;E<this.set.length;E++)if(kt(this.set[E],d,this.options))return!0;return!1};function kt(d,E,S){for(var L=0;L<d.length;L++)if(!d[L].test(E))return!1;if(E.prerelease.length&&!S.includePrerelease){for(L=0;L<d.length;L++)if(r(d[L].semver),d[L].semver!==st&&d[L].semver.prerelease.length>0){var R=d[L].semver;if(R.major===E.major&&R.minor===E.minor&&R.patch===E.patch)return!0}return!1}return!0}t.satisfies=ht;function ht(d,E,S){try{E=new he(E,S)}catch{return!1}return E.test(d)}t.maxSatisfying=Lt;function Lt(d,E,S){var L=null,R=null;try{var j=new he(E,S)}catch{return null}return d.forEach(function($){j.test($)&&(!L||R.compare($)===-1)&&(L=$,R=new U(L,S))}),L}t.minSatisfying=Mt;function Mt(d,E,S){var L=null,R=null;try{var j=new he(E,S)}catch{return null}return d.forEach(function($){j.test($)&&(!L||R.compare($)===1)&&(L=$,R=new U(L,S))}),L}t.minVersion=Qe;function Qe(d,E){d=new he(d,E);var S=new U("0.0.0");if(d.test(S)||(S=new U("0.0.0-0"),d.test(S)))return S;S=null;for(var L=0;L<d.set.length;++L){var R=d.set[L];R.forEach(function(j){var $=new U(j.semver.version);switch(j.operator){case">":$.prerelease.length===0?$.patch++:$.prerelease.push(0),$.raw=$.format();case"":case">=":(!S||ot(S,$))&&(S=$);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+j.operator)}})}return S&&d.test(S)?S:null}t.validRange=jn;function jn(d,E){try{return new he(d,E).range||"*"}catch{return null}}t.ltr=gn;function gn(d,E,S){return k(d,E,"<",S)}t.gtr=Nn;function Nn(d,E,S){return k(d,E,">",S)}t.outside=k;function k(d,E,S,L){d=new U(d,L),E=new he(E,L);var R,j,$,ne,ae;switch(S){case">":R=ot,j=cn,$=Ye,ne=">",ae=">=";break;case"<":R=Ye,j=Gt,$=ot,ne="<",ae="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ht(d,E,L))return!1;for(var qe=0;qe<E.set.length;++qe){var Ue=E.set[qe],Oe=null,Re=null;if(Ue.forEach(function(tt){tt.semver===st&&(tt=new Me(">=0.0.0")),Oe=Oe||tt,Re=Re||tt,R(tt.semver,Oe.semver,L)?Oe=tt:$(tt.semver,Re.semver,L)&&(Re=tt)}),Oe.operator===ne||Oe.operator===ae||(!Re.operator||Re.operator===ne)&&j(d,Re.semver))return!1;if(Re.operator===ae&&$(d,Re.semver))return!1}return!0}t.prerelease=jt;function jt(d,E){var S=I(d,E);return S&&S.prerelease.length?S.prerelease:null}t.intersects=Bt;function Bt(d,E,S){return d=new he(d,S),E=new he(E,S),d.intersects(E)}t.coerce=vn;function vn(d,E){if(d instanceof U)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;E=E||{};var S=null;if(!E.rtl)S=d.match(g[u.COERCE]);else{for(var L;(L=g[u.COERCERTL].exec(d))&&(!S||S.index+S[0].length!==d.length);)(!S||L.index+L[0].length!==S.index+S[0].length)&&(S=L),g[u.COERCERTL].lastIndex=L.index+L[1].length+L[2].length;g[u.COERCERTL].lastIndex=-1}return S===null?null:I(S[2]+"."+(S[3]||"0")+"."+(S[4]||"0"),E)}})(_i,_i.exports);var Mh=_i.exports;const Ka=ha,Dt=Mh,He="semver",Bh={base:Ka.string(),type:"semverRange",validate:function(e,{error:t}){return Dt.validRange(e)?{value:e}:{errors:t(`${He}.valid`)}},messages:{[`${He}.valid`]:"{{#label}} needs to be a valid semver range"}},Ln={};Ln.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Dt[r](e,n)?e:t.error(`${He}.${r}`,{exp:n})},args:[{name:"exp",assert:Dt.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){Ln[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});Ln.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Dt.cmp(e,n,r)?e:t.error(`${He}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Dt.valid,message:"needs to be a valid semver expression"}]};Ln.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Dt[r](e,n)?e:t.error(`${He}.${r}`,{rng:n})},args:[{name:"rng",assert:Dt.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){Ln[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});Ln.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Dt.outside(e,r,n)?e:t.error(`${He}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Dt.validRange,message:"needs to be a valid semver range"}]};const Fh={base:Ka.string(),type:"semver",validate:function(e,{error:t}){return Dt.valid(e)?{value:e}:{errors:t(`${He}.valid`)}},messages:{[`${He}.valid`]:"{{#label}} needs to be a valid semver expression",[`${He}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${He}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${He}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${He}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${He}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${He}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${He}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${He}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${He}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${He}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${He}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:Ln};var Uh={semver:Fh,semverRange:Bh};/*!
200
+ * is-var-name | ISC (c) Shinnosuke Watanabe
201
+ * https://github.com/shinnn/is-var-name
202
+ */function Wh(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const $h=Object.freeze(Object.defineProperty({__proto__:null,default:Wh},Symbol.toStringTag,{value:"Module"})),zh=Qi($h),Kh=Qi(Ac),qh=Bc,Vh=Fc,Es=xr,Hh=e=>{if((0,Es.isValid)(e))return e;const t=(0,Vh.toHex)(eu.from(typeof e=="string"?e.trim():e));return(0,Es.fromPublicKey)(t,{role:qh.types.RoleType.ROLE_ANY})};var Gh=Hh,Cn={},qa=_e&&_e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.didExtension=Cn.fileExtension=void 0;const xs=qa(Wa),Xh=qa(Bu),Yh=xr,Va=e=>({type:"file",base:e.string(),validate(t,{error:n}){return t&&typeof t=="string"?{value:t}:{errors:n("file.empty",{file:t})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:t=null,canSkip:n=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:t,canSkip:n}})},args:[{name:"baseDir",assert:t=>xs.default.existsSync(t),message:"baseDir must exist"},{name:"canSkip",assert:t=>typeof t=="function",message:"canSkip must be a function"}],validate(t,{error:n},{baseDir:r,canSkip:i}={}){if(typeof i=="function"&&i(r,t))return t;try{return xs.default.statSync(Xh.default.join(r,t)),t}catch(s){switch(s.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:s.message})}}}}});Cn.fileExtension=Va;const Ha=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,Yh.isValid)(t)===!1?{errors:n("did.invalid",{did:t})}:{value:t}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});Cn.didExtension=Ha;Cn.default={fileExtension:Va,didExtension:Ha};var ho={},Ga={exports:{}};const Qh=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var Xa=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),Jh=Qh,Zh=["node_modules","favicon.ico"],ef=Ga.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),sr(t,n);if(e===void 0)return n.push("name cannot be undefined"),sr(t,n);if(typeof e!="string")return n.push("name must be a string"),sr(t,n);if(e.length||n.push("name length must be greater than zero"),e.match(/^\./)&&n.push("name cannot start with a period"),e.match(/^_/)&&n.push("name cannot start with an underscore"),e.trim()!==e&&n.push("name cannot contain leading or trailing spaces"),Zh.forEach(function(a){e.toLowerCase()===a&&n.push(a+" is a blacklisted name")}),Jh.forEach(function(a){e.toLowerCase()===a&&t.push(a+" is a core module name")}),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var r=e.match(Xa);if(r){var i=r[1],s=r[2];if(encodeURIComponent(i)===i&&encodeURIComponent(s)===s)return sr(t,n)}n.push("name can only contain URL-friendly characters")}return sr(t,n)};ef.scopedPackagePattern=Xa;var sr=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n},tf=Ga.exports;(function(e){var t=_e&&_e.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=xr,r=t(tf),i=32,s=c=>{if((0,n.toTypeInfo)(c).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=s;const a=(c,{checkDid:f=!0}={})=>{if((0,n.isValid)(c))f&&(0,e.validateNewDid)(c);else{const{validForNewPackages:g,errors:l=[],warnings:u=[]}=(0,r.default)(c);if(!g)throw new Error(l[0]||u[0]);if(c.length>i)throw new Error("Blocklet name is too long")}};e.validateName=a,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(ho);var nf=_e&&_e.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),rf=_e&&_e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=_e&&_e.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&nf(n,t,r[i]);return rf(n,t),n}}(),Gn=_e&&_e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});te.Joi=te.eventsSchema=te.installBlockletDescriptionSchema=te.installBlockletTitleSchema=te.resourceBundleSchema=te.authConfigSchema=te.cacheableSchema=te.statsSchema=te.titleSchema=te.themeSchema=te.signatureSchema=te.serviceSchema=te.scriptsSchema=te.personSchema=te.navigationSchema=te.navigationItemSchema=te.updateMountPointSchema=te.mountPointSchema=te.logoSchema=te.interfaceSchema=te.environmentNameSchema=te.environmentSchema=te.engineSchema=te.endpointSchema=te.distSchema=te.descriptionSchema=te.createBlockletSchema=te.componentSchema=te.blockletNameSchema=te.blockletMetaSchema=void 0;const sf=Gn(Wa),af=Gn(ha),lf=Gn(Lh),cf=Gn(Dh),Ss=Uh,uf=Gn(zh),ws=ma,df=xr,hf=Kh,Ne=Pt,ff=Gn(Gh),Ts=Cn,Ri=ho,fo=of(fu),pf=lf.default.default,Os="/.well-known",h=af.default.extend(Ss.semver).extend(Ss.semverRange).extend(Ts.fileExtension).extend(Ts.didExtension);te.Joi=h;const _s=(e,t)=>(0,fo.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
203
+
204
+ A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
205
+ - /en/home
206
+ - /zh/home
207
+ - https://www.arcblock.io
208
+ `),mf=(e,t)=>!e||(0,uf.default)(e)?e:t.message(`Invalid navigation id: ${e}
209
+
210
+ A valid navigation id is should follow the rules of javascript variables, such as:
211
+ - foo
212
+ - fooBar
213
+ - foo123
214
+
215
+ see detail in https://www.npmjs.com/package/is-var-name
216
+ `),Hr=h.string().trim().min(1).custom(e=>{if(pf(e)>Ne.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Ne.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});te.titleSchema=Hr;const Gr=h.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=Gr;const Ya=h.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=Ya;const Qa=h.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=Qa;const Ja=h.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(ws.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${ws.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=Ja;const Za=h.string().trim().min(1),po=Za.meta({className:"TMountPoint"}).custom((e,t)=>(0,fo.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=po;const el=Za.meta({className:"TUpdateMountPoint"}).custom(e=>(0,fo.default)(e));te.updateMountPointSchema=el;const qn=h.string().custom(e=>((0,Ri.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=qn;const gf=[],mo=h.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!gf.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});te.environmentNameSchema=mo;const go=h.object({name:mo.required(),description:h.string().trim().required(),default:h.string().optional().allow("").default(""),required:h.boolean().default(!1),secure:h.boolean().default(!1),validation:h.string().optional(),shared:h.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});te.environmentSchema=go;const vo=h.object({dev:h.string().trim().min(1),e2eDev:h.string().trim().min(1),preFlight:h.string().trim().min(1),preInstall:h.string().trim().min(1),postInstall:h.string().trim().min(1),preStart:h.string().trim().min(1),postStart:h.string().trim().min(1),preStop:h.string().trim().min(1),preUninstall:h.string().trim().min(1),preConfig:h.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});te.scriptsSchema=vo;const yo=h.object({name:h.string().required().trim(),config:h.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=yo;const bo=h.object({type:h.string().trim(!0).min(1).required(),path:h.string().required(),meta:h.object({vcType:h.string(),payable:h.boolean(),params:h.array().items({name:h.string().required().trim(),description:h.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});te.endpointSchema=bo;const tl=h.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});te.cacheableSchema=tl;const Eo=h.object({type:h.string().lowercase().valid(...Ne.BLOCKLET_INTERFACE_TYPES).required(),name:h.string().trim().required(),path:h.string().trim().default("/"),prefix:h.string().trim().min(1).default(Ne.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:h.number().port().optional(),hostIP:h.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:h.string().lowercase().valid(...Ne.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:h.alternatives().try(h.string().uppercase().default(Ne.BLOCKLET_DEFAULT_PORT_NAME),h.object({internal:h.string().uppercase().required(),external:h.number().port().required()})).default(Ne.BLOCKLET_DEFAULT_PORT_NAME),cacheable:h.array().items(tl).unique(),services:h.array().items(yo).unique("name"),endpoints:h.array().items(bo).unique("type"),pageGroups:h.array().items(h.string().min(1).max(255).trim()).unique(),proxyBehavior:h.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});te.interfaceSchema=Eo;const vf=h.alternatives().try(h.string().required(),h.object({url:h.string().uri({scheme:["http","https","file"]}).required(),name:qn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}).required(),name:qn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),Ii=h.object({platform:h.string().valid(...Ne.BLOCKLET_PLATFORMS).optional(),interpreter:h.string().valid("binary","node","blocklet").default("node"),source:vf,args:h.array().items(h.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=Ii;const dr=h.object({name:h.string().min(1).required(),email:h.string().email({tlds:!1}).optional(),url:h.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});te.personSchema=dr;const pr=h.object({tarball:h.alternatives().try(h.string().uri(),h.string()).required(),integrity:h.string().required(),size:h.number().optional()}).meta({className:"TDist",unknownType:"any"});te.distSchema=pr;const nl=h.object({downloads:h.number().integer().greater(-1),star:h.number().default(0),purchases:h.number().default(0)}).meta({className:"TStats",unknownType:"any"});te.statsSchema=nl;const yf=h.alternatives().try(h.object({url:h.alternatives().try(h.string().uri(),h.array().items(h.string().uri()).min(1)).required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}),name:qn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),rl={source:yf.required(),required:h.boolean(),title:Hr,description:Gr,mountPoint:po,name:qn},il=(e,t)=>h.object(e).custom((n,r)=>!t&&n.source&&n.source.name&&!n.source.store?r.message(`missing 'store' in source of component ${n.name}`):n),xo=il(rl).meta({className:"TComponent",unknownType:"any"});te.componentSchema=xo;const bf=il(rl,!0),ol=({checkStore:e}={})=>{const t=[xo,bf];return h.array().items(e?t[0]:t[1]).optional().default([])},sl=h.object({type:h.string().required(),name:h.string().required(),signer:h.string().required(),pk:h.string().required(),created:h.string().isoDate().required(),sig:h.string().required(),excludes:h.array().items(h.string()).optional(),appended:h.array().items(h.string()).optional(),delegatee:h.string(),delegateePk:h.string(),delegation:h.string()}).meta({className:"TSignature",unknownType:"any"});te.signatureSchema=sl;const li=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Rs={id:h.string().custom(mf),title:h.alternatives().try(h.string().min(1).max(Ne.MAX_TITLE_LENGTH),h.object().min(1).pattern(h.string().valid(...li),h.string().min(1).max(Ne.MAX_TITLE_LENGTH))).required(),description:h.alternatives().try(h.string().min(1).max(Ne.MAX_DESCRIPTION_LENGTH),h.object().min(1).pattern(h.string().valid(...li),h.string().min(1).max(Ne.MAX_DESCRIPTION_LENGTH))),link:h.alternatives().try(h.string().custom(_s),h.object().min(1).pattern(h.string().valid(...li),h.string().custom(_s))),component:h.string().min(1),section:h.array().items(h.string().min(1)).single(),role:h.array().items(h.string().min(1)).single(),icon:h.string().min(1),visible:h.boolean()},al=h.object({...Rs,items:h.array().items(h.object({...Rs}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=al;const So=h.array().items(al).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=So;const wo=h.object({background:h.alternatives().try(h.string().min(1),h.object({header:h.string().min(1),footer:h.string().min(1),default:h.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});te.themeSchema=wo;const ll=h.object({whoCanAccess:h.string().valid("owner","invited","all"),profileFields:h.array().items(h.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:h.array().items(h.string().min(1)),allowSwitchProfile:h.boolean(),blockUnauthenticated:h.boolean(),blockUnauthorized:h.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});te.authConfigSchema=ll;const Ef=h.object({type:h.string().trim().min(1).required(),description:h.string().trim().min(1)}),To=h.object({did:h.DID().trim().required(),type:h.string().trim().min(1).required(),public:h.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=To;const Oo=h.array().items(h.object({type:h.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:h.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});te.eventsSchema=Oo;const cl={did:h.DID().trim().required(),version:h.semver().valid().required(),name:h.string().optional(),description:Gr.required(),group:h.string().valid(...Ne.BLOCKLET_GROUPS),main:h.string().trim(),title:Hr.optional().allow(""),logo:h.string().trim().optional(),specVersion:h.semver().valid().gte("1.0.0").optional(),author:dr.optional(),contributors:h.array().items(dr).optional(),maintainers:h.array().items(dr).optional(),community:h.string().uri().optional().allow("").default(""),documentation:h.string().uri().optional().allow("").default(""),homepage:h.string().uri().optional().allow("").default(""),license:h.string().optional().allow("").default(""),support:h.alternatives().try(h.string().uri(),h.string().email({tlds:!1})).optional(),nftFactory:h.DID().optional().allow("").default(""),payment:h.object({price:h.array().max(1).items(h.object({value:h.number().greater(0).required(),address:h.DID().required()})).default([]),share:h.array().max(4).items(h.object({name:h.string().required(),address:h.DID().required(),value:h.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const t=e.reduce((n,r)=>n+r.value,0);if(t!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${t}`);return e},"invalid blocklet share"),componentPrice:h.array().items(h.object({parentPriceRange:h.array().items(h.number()).custom((e,t)=>e.length!==2?t.message("length of range should be 2"):e[0]<0?t.message("the first value should not less than 0 in range"):e[1]<=e[0]?t.message("the second value should greater than the first value in range"):e),type:h.string().valid("fixed","percentage").required(),value:h.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),tags:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),gitHash:h.string().optional().allow(""),repository:h.alternatives().try(h.string().min(1),h.object({type:h.string().valid("git","https","svn").required(),url:h.string().uri().required(),directory:h.string()})).optional(),timeout:h.object({start:h.number().min(10).max(600),script:h.number().min(1).max(1800)}).default({start:60}),requirements:h.object({abtnode:h.semverRange().valid(),server:h.semverRange().valid(),os:h.alternatives().try(h.string().valid("*",...Ne.BLOCKLET_PLATFORMS),h.array().items(h.string().valid(...Ne.BLOCKLET_PLATFORMS)).min(1)),cpu:h.alternatives().try(h.string().valid("*",...Ne.BLOCKLET_ARCHITECTURES),h.array().items(h.string().valid(...Ne.BLOCKLET_ARCHITECTURES)).min(1)),fuels:h.array().items(h.object({endpoint:h.string().trim().required(),address:h.string().trim(),value:h.string().trim().required(),reason:h.string().trim().required()})),nodejs:h.semverRange().valid()}).default({server:Ne.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:h.array().items(Eo).unique("name").custom((e,t)=>{if(e.filter(i=>i.type===Ne.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Ne.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(i=>i.type===Ne.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const i of r)if(!i.prefix.startsWith(Os))return t.message(`Wellknown path prefix must start with: ${Os}`);return e}).default([]),environments:h.array().items(go).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,i)=>e.findIndex(s=>s.name===r.name)!==i);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:vo,capabilities:h.object({clusterMode:h.boolean(),didSpace:h.string().valid(...Object.values(Ne.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:h.boolean().default(!0),serverless:h.boolean().optional(),component:h.boolean(),sitemap:h.boolean().optional(),mcp:h.boolean().optional()}).default({}),files:h.array().items(h.string().trim()).optional(),resource:h.object({exportApi:h.string().trim(),bundles:h.array().items(To),types:h.array().items(Ef).max(10)}),engine:h.alternatives().try(Ii,h.array().items(Ii)).optional(),screenshots:h.array().items(h.string().min(1)).optional().default([]),videos:h.array().items(h.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:h.string().optional().allow(""),dist:pr.optional(),stats:nl.optional(),htmlAst:h.any().optional(),path:h.string().optional(),signatures:h.array().items(sl).optional(),lastPublishedAt:h.string().isoDate().optional().allow(null),components:ol(),navigation:So,theme:wo,copyright:h.object({owner:h.string().min(1),year:h.alternatives().try(h.string(),h.number())}),bundleName:h.string(),bundleDid:h.DID().trim(),storeId:h.string(),events:Oo.optional()},xf=h.object(cl).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=xf;const ul=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,...a}={})=>((!e||!sf.default.existsSync(e))&&(t=!1),h.object({...cl,owner:h.object({avatar:h.string().optional(),did:h.DID().trim().required(),fullName:h.string().trim().required(),email:h.string().optional().allow(null).empty("").default("")}).optional(),logo:t?h.file().trim().exists({baseDir:e}).optional():h.string().trim().optional(),files:h.array().items(t?h.file().exists({baseDir:e,canSkip:(c,f)=>[Ne.BLOCKLET_ENTRY_FILE,Ne.BLOCKLET_BUNDLE_FILE].includes(f)||(0,cf.default)(f)}):h.string().trim()).optional(),dist:n?pr.required():pr.optional(),components:ol({checkStore:r}),name:i?h.string().optional():h.string().required(),egress:h.boolean().optional().default(!0),docker:hf.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...a}).rename("children","components").custom((c,f)=>{const{did:g,name:l,docker:u}=c;if(u){const{image:y,dockerfile:T,network:O}=u;if(!y&&!T)return f.message("Image or dockerfile must be set");if(y&&T)return f.message("Image and dockerfile cannot be set at the same time");if(O)return f.message("ExportPorts and network cannot be set at the same time");if(T&&(c.files||(c.files=[]),c.files.push(T)),u.volumes)for(const N of u.volumes){if(!N.startsWith("$BLOCKLET_APP_DIR/")&&!N.startsWith("$BLOCKLET_DATA_DIR/"))return f.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(N.indexOf("..")>-1)return f.message('Volume cannot contain ".."')}}let x;if((0,df.isValid)(g))try{return(0,Ri.validateNewDid)(g),c}catch(y){x=y}if(l){(0,Ri.validateName)(l,{checkDid:!s});const y=(0,ff.default)(l);return y!==g?f.message(`The did of name "${l}" should be "${y}"`):c}return x?f.message(x.message):c}));te.createBlockletSchema=ul;te.default={blockletNameSchema:qn,componentSchema:xo,endpointSchema:bo,serviceSchema:yo,createBlockletSchema:ul,interfaceSchema:Eo,environmentSchema:go,environmentNameSchema:mo,scriptsSchema:vo,personSchema:dr,distSchema:pr,titleSchema:Hr,descriptionSchema:Gr,logoSchema:Ja,navigationSchema:So,themeSchema:wo,mountPointSchema:po,updateMountPointSchema:el,authConfigSchema:ll,resourceBundleSchema:To,installBlockletTitleSchema:Ya,installBlockletDescriptionSchema:Qa,eventsSchema:Oo,Joi:h};var It={},Sf=_e&&_e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(It,"__esModule",{value:!0});It.setService=It.findService=It.getDefaultServiceConfig=It.getServiceConfig=void 0;const wf=Sf(Fu),Tf=te,dl={},_o=e=>{dl[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};It.setService=_o;_o({name:"auth",schema:Tf.authConfigSchema,default:{}});const hl=e=>{if(!e)throw new Error("service name should not be empty");const t=dl[e];if(!t)throw new Error(`service ${e} does not exist`);return t},fl=(e,t,{validate:n}={})=>{const r=hl(e),i=(0,wf.default)(t||{}),{value:s,error:a}=r.validate(i);if(n&&a)throw new Error(`Invalid blocklet service config: ${a.details.map(c=>c.message).join(", ")}`);return s};It.getServiceConfig=fl;const pl=e=>{const{defaultConfig:t}=hl(e);return t};It.getDefaultServiceConfig=pl;const ml=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};It.findService=ml;It.default={getServiceConfig:fl,getDefaultServiceConfig:pl,findService:ml,setService:_o};Object.defineProperty(In,"__esModule",{value:!0});In.fixAndValidateService=In.validateMeta=void 0;const Of=te,_f=It,Rf=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,_f.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);In.fixAndValidateService=Rf;const gl=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,schemaOptions:a={}}={})=>{const c=(0,Of.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:i,skipValidateDidName:s,...a}),{value:f,error:g}=c.validate(e);if(g)throw new Error(`Invalid blocklet meta: ${g.details.map(l=>l.message).join(", ")}`);return f};In.validateMeta=gl;In.default=gl;(function(e){var t=_e&&_e.__createBinding||(Object.create?function(I,B,H,U){U===void 0&&(U=H);var le=Object.getOwnPropertyDescriptor(B,H);(!le||("get"in le?!B.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return B[H]}}),Object.defineProperty(I,U,le)}:function(I,B,H,U){U===void 0&&(U=H),I[U]=B[H]}),n=_e&&_e.__setModuleDefault||(Object.create?function(I,B){Object.defineProperty(I,"default",{enumerable:!0,value:B})}:function(I,B){I.default=B}),r=_e&&_e.__importStar||function(){var I=function(B){return I=Object.getOwnPropertyNames||function(H){var U=[];for(var le in H)Object.prototype.hasOwnProperty.call(H,le)&&(U[U.length]=le);return U},I(B)};return function(B){if(B&&B.__esModule)return B;var H={};if(B!=null)for(var U=I(B),le=0;le<U.length;le++)U[le]!=="default"&&t(H,B,U[le]);return n(H,B),H}}(),i=_e&&_e.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const s=i(pu),a=r(Sh),c=Pt,f=In;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return f.fixAndValidateService}});const g=ho,l=(I,B)=>{I.description||(I.description=`Blocklet from ${B}`),I.version||(I.version=c.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=l;const u=I=>{if(I.repository&&(typeof I.repository=="string"&&(I.repository={type:"git",url:I.repository}),I.repository.url)){const B=a.fromUrl(I.repository.url);B&&(I.repository.url=B.getDefaultRepresentation()==="shortcut"?B.https():B.toString())}};e.fixRepository=u;const x=I=>{Array.isArray(I.files)?I.files&&(I.files=I.files.filter(B=>!(!B||typeof B!="string"))):delete I.files};e.fixFiles=x;const y=I=>{typeof I.keywords=="string"&&(I.keywords=I.keywords.split(/,\s+/)),I.keywords&&!Array.isArray(I.keywords)?delete I.keywords:I.keywords&&(I.keywords=I.keywords.filter(B=>!(typeof B!="string"||!B)))};e.fixKeywords=y;const T=I=>{typeof I.tags=="string"&&(I.tags=I.tags.split(/,\s+/)),I.tags&&!Array.isArray(I.tags)?delete I.tags:I.tags&&(I.tags=I.tags.filter(B=>!(typeof B!="string"||!B)))};e.fixTags=T;const O=(I,B)=>(I.author&&(I.author=B(I.author)),["maintainers","contributors"].forEach(H=>{Array.isArray(I[H])&&(I[H]=I[H].map(B))}),I),N=I=>{if(!I)return"";if(typeof I=="string")return I;const B=I.name||"",H=I.url||I.web,U=H?` (${H})`:"",le=I.email||I.mail,G=le?` <${le}>`:"";return B+G+U};e.formatPerson=N;const D=I=>{if(typeof I!="string")return I;const B=I.match(/^([^(<]+)/),H=I.match(/\(([^)]+)\)/),U=I.match(/<([^>]+)>/),le={};return B&&B[0].trim()&&(le.name=B[0].trim()),U&&([,le.email]=U),H&&([,le.url]=H),le};e.parsePerson=D;const P=I=>(O(I,N),O(I,D),I);e.fixPerson=P;const F=(I,B=!0)=>{if(Array.isArray(I.interfaces)||(I.interfaces=[]),I.interfaces.length)return I.interfaces.forEach(G=>{G.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(G.protocol="http")}),I;const U=(0,s.default)(I,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",le=({type:G="web",name:se,path:Ie="/",protocol:Ge="http",port:ze=c.BLOCKLET_DEFAULT_PORT_NAME})=>{I.interfaces.push({type:G,name:se,path:Ie,prefix:U,port:ze,protocol:Ge})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(G=>{I[G]&&le({name:G,path:I[G]})}),Array.isArray(I.exposeServices)&&I.exposeServices.forEach(G=>{le({type:"service",name:G.protocol,protocol:G.protocol,port:{internal:`BLOCKLET_${G.protocol}_PORT`.toUpperCase(),external:G.port}})}),B&&(delete I.publicUrl,delete I.adminUrl,delete I.configUrl,delete I.docUrl,delete I.exposeServices,I.capabilities&&delete I.capabilities.dynamicPathPrefix),I};e.fixInterfaces=F;const V=I=>{const{did:B}=I;try{(0,g.validateNewDid)(B),I.name=B}catch{}return I};e.fixName=V,e.default={fixRequired:l,fixRepository:u,fixFiles:x,fixKeywords:y,fixPerson:P,fixTags:T,fixName:V,formatPerson:N,parsePerson:D,fixInterfaces:F,fixService:f.fixAndValidateService}})(Da);function vl({owner:e,locale:t}){return o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?o.jsx(pa,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}vl.propTypes={owner:A.object.isRequired,locale:A.string.isRequired};const If="install-blocklet-from-URL",yl=()=>{const[e,t]=Oa(If,"[]",{raw:!0}),n=i=>{const s=i.trim(),a=JSON.parse(e),c=a.findIndex(f=>f===s);c!==0&&(c>0&&a.splice(c,1),a.length>=10&&a.splice(9),a.unshift(s),t(JSON.stringify(a)))},r=i=>{if(!i)return;const s=JSON.parse(e),a=i.trim(),c=s.findIndex(f=>f===a);c>-1&&(s.splice(c,1),t(JSON.stringify(s)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Cf=ra(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function Ro(e){const{value:t,onValueChange:n,children:r,helperText:i}=e,{urls:s,removeUrlRecord:a}=yl(),c=(g,l)=>{g.preventDefault(),g.stopPropagation(),a(l)},f=Cf();return o.jsxs(Y,{children:[o.jsx(ia,{freeSolo:!0,options:s,inputValue:t,onInputChange:(g,l)=>{n(l)},disableClearable:!0,popupIcon:null,renderInput:g=>Ht.cloneElement(r,{...g}),renderOption:(g,l)=>M.createElement(oa,{...g,key:l,secondaryAction:o.jsx(na,{edge:"end","aria-label":"delete",onClick:u=>c(u,l),children:o.jsx(Uc,{})})},o.jsx(hc,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:o.jsx(sa,{primary:l,className:f.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),o.jsx(fc,{style:{margin:0},children:i})]})}Ro.propTypes={onValueChange:A.func,children:A.node,value:A.string,helperText:A.string};Ro.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Io({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:i,handleText:s}){const{api:a}=Hn(),{api:c}=Uu(),[f,g]=M.useState(!1),[l,u]=M.useState(""),{t:x,locale:y}=Tt(),T={dist:{}},[O,N]=M.useState(e),[D,P]=M.useState(e?1:0),[F,V]=M.useState(T),[I,B]=M.useState(!1),[H,U]=M.useState({}),le=i==="component",G=le?!0:!e,{addUrlRecord:se}=yl(),Ie=async()=>{V(T),u(null),g(!0);let oe=O.trim();!oe.startsWith("https://")&&!oe.startsWith("http://")&&!oe.startsWith("file://")&&(oe=`file://${oe}`);try{const We=decodeURIComponent(oe);try{new URL(We)}catch{throw new Error("Invalid URL")}const{meta:Te,inStore:ot,registryUrl:Ye}=await a.getBlockletMetaFromUrl({input:{url:We}});V(Te),U({inStore:ot,registryUrl:Ye,inputUrl:oe}),se(oe)}catch(We){console.error(We);const Te=`Blocklet Install failed: ${_a(We)}`;u(Te),r(We)}finally{g(!1)}},Ge=()=>{if(le){n({meta:F,...H}),t();return}g(!0),B(!0)},ze=()=>{g(!1),B(!1),n({meta:F,...H}),t()},it=()=>{g(!1),B(!1)};M.useEffect(()=>{e&&Ie()},[e]);const Z=[{name:x("common.name"),value:Vt.getDisplayName({meta:F},!0)},{name:x("common.version"),value:F.version},{name:x("common.did"),value:F.did?o.jsx(Wu,{did:F.did}):null},{name:x("common.author"),value:F.owner?o.jsx(vl,{owner:F.owner,locale:y}):Da.formatPerson(F.author)},{name:x("blocklet.dist.downloadLink"),value:F.dist.tarball}],me=()=>f?o.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:o.jsx(Ct,{})}):F.did?o.jsx("div",{style:{paddingLeft:"10%"},children:Z.map(oe=>oe.name===x("common.did")?o.jsx(ss,{valueComponent:"div",nameWidth:120,name:oe.name,nameFormatter:()=>x("common.did"),children:oe.value},oe.name):o.jsx(ss,{valueComponent:"div",nameWidth:120,name:oe.name,children:oe.value},oe.name))}):null,ee=[{label:x("blocklet.fromUrl.step0"),body:o.jsx(ye,{component:"div",children:o.jsx(Ro,{style:{marginBottom:32},value:O,helperText:x("blocklet.fromUrl.description"),onValueChange:oe=>{u(null),N(oe)},children:o.jsx(Wr,{label:x("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:O,onChange:oe=>{u(null),N(oe.target.value)},disabled:f,onKeyPress:oe=>{oe.key==="Enter"&&(oe.preventDefault(),Ie(),P(1))}})})}),cancel:x("common.cancel"),confirm:x("common.next"),onCancel:t,onConfirm:()=>{Ie(),P(1)}},{label:x("blocklet.fromUrl.step1"),body:me(),cancel:x(G?"common.pre":"common.cancel"),confirm:(s==null?void 0:s.confirm)||x("blocklet.fromUrl.confirm"),onCancel:()=>{G?P(oe=>oe-1):t()},onConfirm:()=>{Ge()}}],xe=ee[D];return o.jsxs(o.Fragment,{children:[o.jsxs(Ji,{title:(s==null?void 0:s.title)||x("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>xe.onCancel(),showCloseButton:D===0,disableEscapeKeyDown:!0,open:!0,actions:o.jsxs(o.Fragment,{children:[xe.cancel&&o.jsx(yt,{onClick:oe=>{oe.stopPropagation(),u(null),xe.onCancel()},color:"inherit",children:xe.cancel||x("common.cancel")}),o.jsxs(yt,{onClick:oe=>{oe.stopPropagation(),xe.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:f||!O||l,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[f&&D===0&&o.jsx(Ct,{size:16}),xe.confirm]})]}),children:[G&&o.jsx(pc,{alternativeLabel:!0,activeStep:D,children:ee.map(({label:oe})=>o.jsx(mc,{children:o.jsx(gc,{children:oe})},oe))}),o.jsx(vc,{component:"div",style:{marginTop:24},children:xe.body}),!!l&&o.jsx(aa,{severity:"error",style:{width:"100%",marginTop:8},children:l})]}),F&&I&&o.jsx(ga,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:c.get,checkTimeout:5*60*1e3,onSuccess:ze,extraParams:{title:F.title,wt:mu(F),blockletMetaUrl:decodeURIComponent(O.trim())},messages:{title:x("setup.keyPair.title"),scan:x("setup.keyPair.scan"),confirm:x("setup.keyPair.confirm"),success:x("setup.keyPair.success")},onClose:it})]})}Io.propTypes={defaultUrl:A.string,onCancel:A.func.isRequired,onSuccess:A.func.isRequired,onError:A.func,mode:A.oneOf(["install","component"]),handleText:A.object};Io.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const kf={meta:A.object.isRequired,onCancel:A.func.isRequired},Lf=ra(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function bl({action:e,onSelect:t,onNext:n}){const r=Lf(),{t:i}=Tt(),s=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return o.jsxs(o.Fragment,{children:[o.jsx(yc,{className:r.tabPanel,children:s.map(a=>o.jsxs(oa,{button:!0,selected:e===a.action,onClick:()=>t(a.action),children:[o.jsx(bc,{className:r.iconRoot,children:a.action==="purchase"?o.jsx($u,{style:{color:e==="purchase"?ts.primary.main:"#AAA",fontSize:32}}):o.jsx(zu,{style:{color:e==="verify"?ts.primary.main:"#AAA",fontSize:32}})}),o.jsx(sa,{primary:a.title,secondary:a.description})]},a.action))}),n&&o.jsx(yt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:i("common.next")})]})}bl.propTypes={action:A.oneOf(["both","purchase","verify"]).isRequired,onSelect:A.func.isRequired,onNext:A.func.isRequired};function Co({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:i,locale:s}=Tt(),{info:a}=Hn(),c=gu(a),[f,g]=M.useState(null),l=new URL(e==null?void 0:e.registryUrl).origin,u=Vt.getDisplayName({meta:e}),x=async(T,O)=>{const N=({downloadTokenList:F})=>{r({downloadTokenList:F})},D=F=>{Zi.error(F),t(F)};function P(F){return Wc(()=>as.get(F).then(async({data:V})=>{const I=V==null?void 0:V.downloadTokenList;if(V.status==="succeed"){if(I&&I.length)await N({downloadTokenList:I});else return await D(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return V.status==="error"?(console.error("vc error: ",V),await D(V==null?void 0:V.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&f){const{statusUrl:F}=vu(f);await P(F)}else await N({downloadTokenList:T.downloadTokenList&&O(T.downloadTokenList)})};if(M.useEffect(()=>{if(n==="purchase"){const T=new URL(l);T.pathname="/api/did/verify-purchase-blocklet/token",T.searchParams.set("serverDid",a.did),T.searchParams.set("blockletDid",e==null?void 0:e.did);try{as.get(T.href).then(({data:O})=>{const N=`${O.url}`;g(N)})}catch(O){console.error("get next workflow url error: ",O)}}return()=>{g(null)}},[n]),n==="purchase"&&!f)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:Ti.create({baseURL:l}).get,extraParams:{serverDid:a.did,blockletDid:e==null?void 0:e.did},messages:{title:i("store.purchase.verify.auth.title",{name:u}),scan:i("store.purchase.verify.auth.scan"),confirm:i("store.purchase.verify.auth.confirm"),success:i("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Ti.create({baseURL:Kn(l,"/store")}).get,extraParams:{factory:e.nftFactory,nw:f},messages:{title:i("store.purchase.auth.title",{name:u}),scan:i("store.purchase.auth.scan"),confirm:i("store.purchase.auth.confirm"),success:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:i("store.purchase.auth.success")}),o.jsx("p",{children:i("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return o.jsx(ga,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:l,onSuccess:x,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...y[n]})}Co.propTypes={...kf,handlePaySuccess:A.func,mode:A.oneOf(["verify","purchase"]).isRequired};Co.defaultProps={handlePaySuccess:()=>{}};const ko=M.forwardRef(({mode:e,...t},n)=>{const[r,i]=M.useState(e!=="both"?e:"verify"),[s,a]=M.useState(e!=="both"?2:1),c=g=>{g!==r&&i(g)},f=()=>{r&&s!==2&&a(2)};return M.useImperativeHandle(n,()=>({onNext:f,getCurrentStep:()=>s})),s===1?o.jsx("div",{style:{maxWidth:520},children:o.jsx(bl,{action:r,onNext:null,onSelect:c})}):o.jsx(Co,{...t,mode:r})});ko.propTypes={mode:A.oneOf(["both","verify","purchase"]).isRequired,ref:A.any};ko.defaultProps={ref:{}};const jf=ko;function Nf({...e}){return o.jsx(yt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Lo({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:i}=Tt(),s=Ra();return!e||yu(e.meta)?o.jsx(Af,{children:n}):o.jsxs(Pf,{isMobile:s,children:[o.jsx(Nf,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:i("setup.startNow")}),o.jsx(Y,{display:"flex",alignItems:"center",children:n})]})}Lo.propTypes={blocklet:A.object,onStartNow:A.func,children:A.any,disabled:A.bool};Lo.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Af=et(Y)`
217
+ width: 100%;
218
+ margin-top: auto;
219
+ padding-top: 24px;
220
+ display: flex;
221
+ align-items: center;
222
+ justify-content: center;
223
+ .bottom-button {
224
+ min-width: 200px;
225
+ }
226
+ ${e=>e.theme.breakpoints.down("md")} {
227
+ .bottom-button {
228
+ width: 100%;
229
+ }
230
+ }
231
+ `,Pf=et(Y)`
232
+ padding-top: 24px;
233
+ margin-top: auto;
234
+ width: 100%;
235
+ display: flex;
236
+ align-items: center;
237
+ justify-content: space-between;
238
+ .start-now {
239
+ min-width: 140px;
240
+ }
241
+ .bottom-button {
242
+ min-width: 120px;
243
+ }
244
+ ${e=>e.theme.breakpoints.down("lg")} {
245
+ width: 100%;
246
+ }
247
+
248
+ ${e=>e.theme.breakpoints.down("md")} {
249
+ .start-now {
250
+ min-width: inherit;
251
+ }
252
+ .bottom-button {
253
+ min-width: 100px;
254
+ }
255
+ }
256
+
257
+ ${e=>e.isMobile} {
258
+ justify-content: space-between;
259
+ gap: '32px',
260
+ }}
261
+ `;function jo({blockletMeta:e,onEndpointUpdate:t}){var c;const n=Ra(),{blocklet:r}=zr(),{updateSpaceGateway:i,loading:s,hasStorageEndpoint:a}=Tu();return M.useEffect(()=>{t==null||t()},[r]),s?o.jsx($c,{relative:"parent",children:o.jsx(Ct,{})}):o.jsxs(Df,{children:[o.jsx(Y,{width:n?"360px":"720px",children:a?o.jsx(Hu,{}):o.jsx(Gu,{})}),((c=e==null?void 0:e.capabilities)==null?void 0:c.didSpace)==="required"&&o.jsx(Lo,{mt:8,children:o.jsx(Xu,{onConnect:i})})]})}jo.propTypes={blockletMeta:A.any.isRequired,onEndpointUpdate:Ec.func};jo.defaultProps={onEndpointUpdate:()=>{}};const Df=et(Vu)`
262
+ height: 100%;
263
+ overflow-y: auto;
264
+ padding-bottom: 32px;
265
+ overflow-x: hidden;
266
+ `;function No({onChange:e,loading:t,children:n,extra:r,stores:i,storageKey:s}){const{t:a}=Tt(),{info:c,inService:f}=Hn(),{blocklet:g}=zr(),[l,u]=M.useState(!1),x=M.useRef(null),[y,T]=M.useState(),[O,N]=Oa(s||"tmp"),[D,P]=s?[O,N]:[y,T],{storeList:F,teamDid:V}=Sa({fromBlocklet:f,blocklet:g,nodeInfo:c}),I=xa([...i.map(H=>({...H,protected:!0})),...F],"url"),B=D&&I.find(H=>D===H.url)||I[0];return o.jsxs(o.Fragment,{children:[o.jsxs(Mf,{children:[o.jsx(yt,{ref:x,color:"primary","data-cy":"add-component-select-store",endIcon:o.jsx(Yu,{color:"primary"}),onClick:()=>{u(!0)},style:{padding:"0 2px"},children:o.jsx(ye,{color:"primary",children:B.name})}),o.jsx(ye,{color:"primary",children:r})]}),o.jsxs(Wr,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:a("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:B,autoFocus:!0,onChange:H=>{const U=H.target.value;P(U.url),e(U)},SelectProps:{open:l,MenuProps:{anchorEl:x.current},renderValue:H=>H==null?void 0:H.name,onClose:()=>{u(!1)}},style:{display:"none"},margin:"normal",children:[I==null?void 0:I.map(H=>o.jsx(Xi,{sx:{width:"400px",maxWidth:"90vw"},value:H,"data-cy":H.url,children:o.jsx(Pc,{teamDid:V,store:H,onDelete:()=>{var U;D===H.url&&P((U=I[0])==null?void 0:U.url)}})},H.url)),!fa.isInServerlessMode(c)&&o.jsx(Dc,{disabled:t,storeList:I,teamDid:V,onAdd:H=>{P(H)}})]}),n({currentRegistry:B})]})}No.propTypes={onChange:A.func,loading:A.bool,children:A.any.isRequired,extra:A.node,storageKey:A.string,stores:A.arrayOf(A.shape({name:A.string.isRequired,url:A.string.isRequired}))};No.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Mf=et.div`
267
+ display: flex;
268
+ justify-content: space-between;
269
+ align-items: center;
270
+ margin-bottom: 16px;
271
+
272
+ span {
273
+ font-size: 16px;
274
+ color: ${e=>e.theme.palette.common.black};
275
+ // font-weight: bold;
276
+ }
277
+ `,Bf=sn("div")`
278
+ background-color: transparent !important;
279
+ & > :not(.Mui-disabled) {
280
+ position: relative;
281
+ z-index: 1;
282
+ &::before {
283
+ content: '';
284
+ position: absolute;
285
+ height: 100%;
286
+ width: 100%;
287
+ left: 0;
288
+ top: 0;
289
+ transition: opacity 0.3s;
290
+ }
291
+ &:hover::before {
292
+ opacity: 0;
293
+ }
294
+ &::after {
295
+ content: '';
296
+ position: absolute;
297
+ height: 100%;
298
+ width: 100%;
299
+ top: 0;
300
+ left: 0;
301
+ border-radius: 2px;
302
+ background-color: ${e=>e.theme.palette.primary.main};
303
+ transform: scale(0.1);
304
+ opacity: 0;
305
+ z-index: -1;
306
+ transition:
307
+ transform 0.3s,
308
+ opacity 0.3s,
309
+ background-color 0.3s;
310
+ }
311
+ &:hover::after {
312
+ opacity: 1;
313
+ transform-origin: center;
314
+ transform: scale(1);
315
+ }
316
+ }
317
+ & > :not(.Mui-disabled) {
318
+ background-color: transparent !important;
319
+ color: ${e=>e.theme.palette.primary.main}!important;
320
+ }
321
+ & > :not(.Mui-disabled) {
322
+ &:hover {
323
+ color: ${e=>e.theme.palette.common.white}!important;
324
+ }
325
+ }
326
+ `;sn("div")`
327
+ &.arcblock-blocklet {
328
+ padding: ${e=>e.theme.spacing(2)} ${e=>e.theme.spacing(2)} 0
329
+ ${e=>e.theme.spacing(2)};
330
+ }
331
+ .arcblock-blocklet__content {
332
+ cursor: pointer;
333
+ display: flex;
334
+ ${e=>e.theme.breakpoints.up("sm")} {
335
+ align-items: center;
336
+ }
337
+ }
338
+ .arcblock-blocklet__cover {
339
+ width: 64px;
340
+ height: 64px;
341
+ margin-right: ${e=>e.theme.spacing(2)};
342
+ overflow: hidden;
343
+ border-radius: 12px;
344
+ /* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
345
+ transform: translateZ(0);
346
+ ${e=>e.theme.breakpoints.up("sm")} {
347
+ width: 80px;
348
+ height: 80px;
349
+ margin-bottom: 12px;
350
+ }
351
+ }
352
+ .arcblock-blocklet__button--hover {
353
+ &:not(.Mui-disabled) {
354
+ position: relative;
355
+ z-index: 1;
356
+ &::before {
357
+ content: '';
358
+ position: absolute;
359
+ height: 100%;
360
+ width: 100%;
361
+ left: 0;
362
+ top: 0;
363
+ transition: opacity 0.3s;
364
+ }
365
+ &:hover::before {
366
+ opacity: 0;
367
+ }
368
+ &::after {
369
+ content: '';
370
+ position: absolute;
371
+ height: 100%;
372
+ width: 100%;
373
+ background-color: ${e=>e.theme.palette.primary.main};
374
+ transform: scale(0.1);
375
+ opacity: 0;
376
+ z-index: -1;
377
+ transition:
378
+ transform 0.3s,
379
+ opacity 0.3s,
380
+ background-color 0.3s;
381
+ }
382
+ &:hover::after {
383
+ opacity: 1;
384
+ transform-origin: center;
385
+ transform: scale(1);
386
+ }
387
+ }
388
+
389
+ &:not(.Mui-disabled) {
390
+ background-color: transparent !important;
391
+ color: ${e=>e.theme.palette.primary.main};
392
+ }
393
+ &:not(.Mui-disabled) {
394
+ &:hover {
395
+ color: ${e=>e.theme.palette.common.white};
396
+ }
397
+ }
398
+ }
399
+ .arcblock-blocklet__info {
400
+ flex: 1;
401
+ overflow: hidden;
402
+ border-bottom: 1px solid ${e=>e.theme.palette.divider};
403
+ padding-bottom: ${e=>e.theme.spacing(2)};
404
+ }
405
+ .arcblock-blocklet__text {
406
+ height: 65px;
407
+ overflow: hidden;
408
+ }
409
+ /* 设置多行文本溢出显示省略号 兼容fireFox、safari */
410
+ .arcblock-blocklet__title {
411
+ margin: 0;
412
+ font-size: 16px;
413
+ font-weight: 500;
414
+ overflow: hidden;
415
+ text-overflow: ellipsis;
416
+ white-space: nowrap;
417
+ }
418
+ .arcblock-blocklet__describe {
419
+ margin-top: ${e=>e.theme.spacing(.5)};
420
+ color: ${e=>e.theme.palette.grey[600]};
421
+ font-size: 14px;
422
+ font-weight: 500;
423
+ line-height: 17px;
424
+ max-height: 34px;
425
+ overflow: hidden;
426
+ text-overflow: ellipsis;
427
+ display: -webkit-box;
428
+ -webkit-line-clamp: 2;
429
+ -webkit-box-orient: vertical;
430
+ word-break: break-word;
431
+ }
432
+ .arcblock-blocklet__version {
433
+ color: ${e=>e.theme.palette.grey[600]};
434
+ font-size: 12px;
435
+ }
436
+ `;A.string||A.node,A.string,A.string||A.node,A.string,A.string,A.bool,A.bool,A.element,A.string,A.func,A.func,A.string;sn("div")`
437
+ background-color: transparent !important;
438
+ & > :not(.Mui-disabled) {
439
+ position: relative;
440
+ z-index: 1;
441
+ &::before {
442
+ content: '';
443
+ position: absolute;
444
+ height: 100%;
445
+ width: 100%;
446
+ left: 0;
447
+ top: 0;
448
+ transition: opacity 0.3s;
449
+ }
450
+ &:hover::before {
451
+ opacity: 0;
452
+ }
453
+ &::after {
454
+ content: '';
455
+ position: absolute;
456
+ height: 100%;
457
+ width: 100%;
458
+ top: 0;
459
+ left: 0;
460
+ border-radius: 2px;
461
+ background-color: ${e=>e.theme.palette.primary.main};
462
+ transform: scale(0.1);
463
+ opacity: 0;
464
+ z-index: -1;
465
+ transition:
466
+ transform 0.3s,
467
+ opacity 0.3s,
468
+ background-color 0.3s;
469
+ }
470
+ &:hover::after {
471
+ opacity: 1;
472
+ transform-origin: center;
473
+ transform: scale(1);
474
+ }
475
+ }
476
+ & > :not(.Mui-disabled) {
477
+ background-color: transparent !important;
478
+ color: ${e=>e.theme.palette.primary.main}!important;
479
+ }
480
+ & > :not(.Mui-disabled) {
481
+ &:hover {
482
+ color: ${e=>e.theme.palette.common.white}!important;
483
+ }
484
+ }
485
+ `;const Is=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Ff=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},El={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function Ci({title:e,sx:t,children:n,slotProps:r,fontSize:i=12,fontWeight:s=500,color:a="text.secondary",...c}){var f,g;return e?o.jsx(la,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${xc.tooltip}`]:{backgroundColor:"common.white",fontSize:i,fontWeight:s,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:a,display:"flex",alignItems:"center"}},...Array.isArray((f=r==null?void 0:r.popper)==null?void 0:f.sx)?r.popper.sx:[(g=r==null?void 0:r.popper)==null?void 0:g.sx]]}},children:n}):n}function _r({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(ut,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(i)?i:[i]],children:[e,o.jsx(Ci,{title:r||(typeof t=="string"?t:""),children:o.jsx(ye,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function Uf(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:g="Install",buttonDisabled:l,buttonLoading:u,button:x,onButtonClick:y=()=>{},onMainClick:T,className:O,ref:N,icons:D,status:P,...F}=e,V=Vn(),I=(G,se=()=>!1)=>(Ie,...Ge)=>{const ze=G instanceof Function;(se()||ze)&&(Ie.preventDefault(),Ie.stopPropagation(),ze&&G(...Ge))},B=T&&I(T),H=I(y,()=>!!(x||l||u)),U=M.isValidElement(t)?{children:t}:{title:Is(t),dangerouslySetInnerHTML:{__html:t}},le=M.isValidElement(n)?{children:n}:{title:Is(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Sc,{variant:"outlined",onClick:B,...F,sx:{p:{xs:2,md:3},borderRadius:2,...F.sx},children:[o.jsxs(ut,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(Mr,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ye,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...U}),o.jsxs(Y,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[f&&o.jsx(Ci,{title:f.tooltip,children:o.jsx(Hc,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),D==null?void 0:D.map(G=>o.jsx(Ci,{title:G.title,children:typeof G.icon=="string"?o.jsx(St,{icon:G.icon,style:{color:G.color}}):G.icon},G.key))]}),y&&o.jsxs(yt,{color:"reverse",variant:"outlined",size:"small",disabled:l||u,style:{borderColor:V.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:V.typography.fontWeightMedium},onClick:H,children:[u&&o.jsx(Ct,{size:15,style:{marginRight:3,color:"inherit"}}),g]}),x]}),o.jsx(ut,{py:2,children:o.jsx(ye,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...le})}),o.jsxs(ut,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(_r,{icon:o.jsx(Mr,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(_r,{icon:o.jsx(St,{icon:El}),title:a,children:Ff(a)}),P==null?void 0:P.filter(G=>G.align!=="right").map(G=>o.jsx(_r,{icon:typeof G.icon=="string"?o.jsx(St,{icon:G.icon}):G.icon,title:G.title,maxWidth:G.maxWidth,children:G.text},G.key)),o.jsx(Y,{sx:{flex:1}}),P==null?void 0:P.filter(G=>G.align==="right").map(G=>o.jsx(_r,{icon:typeof G.icon=="string"?o.jsx(St,{icon:G.icon}):G.icon,title:G.title,maxWidth:G.maxWidth,sx:{color:G.color},children:G.text},G.key))]})]})}const Wf={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'},hr=/^[a-z0-9]+(-[a-z0-9]+)*$/,Xr=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),f=i.pop(),g={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!Pr(g)?null:g}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Pr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Pr(c,n)?null:c}return null},Pr=(e,t)=>e?!!((e.provider===""||e.provider.match(hr))&&(t&&e.prefix===""||e.prefix.match(hr))&&e.name.match(hr)):!1,xl=Object.freeze({left:0,top:0,width:16,height:16}),Fr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ao=Object.freeze({...xl,...Fr}),ki=Object.freeze({...Ao,body:"",hidden:!1});function $f(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Cs(e,t){const n=$f(e,t);for(const r in ki)r in Fr?r in e&&!(r in n)&&(n[r]=Fr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function zf(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,f=c&&s(c);f&&(i[a]=[c].concat(f))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function Kf(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=Cs(r[c]||i[c],s)}return a(t),n.forEach(a),Cs(e,s)}function Sl(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=zf(e);for(const i in r){const s=r[i];s&&(t(i,Kf(e,i,s)),n.push(i))}return n}const qf={provider:"",aliases:{},not_found:{},...xl};function ci(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function wl(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ci(e,qf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(hr)||typeof s.body!="string"||!ci(s,ki))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(hr)||typeof a!="string"||!n[a]&&!r[a]||!ci(s,ki))return null}return t}const ks=Object.create(null);function Vf(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function kn(e,t){const n=ks[e]||(ks[e]=Object.create(null));return n[t]||(n[t]=Vf(e,t))}function Po(e,t){return wl(t)?Sl(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Hf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let mr=!1;function Tl(e){return typeof e=="boolean"&&(mr=e),mr}function Gf(e){const t=typeof e=="string"?Xr(e,!0,mr):e;if(t){const n=kn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Xf(e,t){const n=Xr(e,!0,mr);if(!n)return!1;const r=kn(n.provider,n.prefix);return Hf(r,n.name,t)}function Yf(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),mr&&!t&&!e.prefix){let i=!1;return wl(e)&&(e.prefix="",Sl(e,(s,a)=>{a&&Xf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!Pr({provider:t,prefix:n,name:"a"}))return!1;const r=kn(t,n);return!!Po(r,e)}const Ol=Object.freeze({width:null,height:null}),_l=Object.freeze({...Ol,...Fr}),Qf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Jf=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ls(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Qf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=Jf.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}const Zf=e=>e==="unset"||e==="undefined"||e==="none";function ep(e,t){const n={...Ao,...e},r={..._l,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(T=>{const O=[],N=T.hFlip,D=T.vFlip;let P=T.rotate;N?D?P+=2:(O.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),O.push("scale(-1 1)"),i.top=i.left=0):D&&(O.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),O.push("scale(1 -1)"),i.top=i.left=0);let F;switch(P<0&&(P-=Math.floor(P/4)*4),P=P%4,P){case 1:F=i.height/2+i.top,O.unshift("rotate(90 "+F.toString()+" "+F.toString()+")");break;case 2:O.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:F=i.width/2+i.left,O.unshift("rotate(-90 "+F.toString()+" "+F.toString()+")");break}P%2===1&&(i.left!==i.top&&(F=i.left,i.left=i.top,i.top=F),i.width!==i.height&&(F=i.width,i.width=i.height,i.height=F)),O.length&&(s='<g transform="'+O.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,g=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?g:c,l=Ls(u,f/g)):(l=a==="auto"?f:a,u=c===null?Ls(l,g/f):c==="auto"?g:c);const x={},y=(T,O)=>{Zf(O)||(x[T]=O.toString())};return y("width",l),y("height",u),x.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+g.toString(),{attributes:x,body:s}}const tp=/\sid="(\S+)"/g,np="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let rp=0;function ip(e,t=np){const n=[];let r;for(;r=tp.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(rp++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const Li=Object.create(null);function op(e,t){Li[e]=t}function ji(e){return Li[e]||Li[""]}function Do(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Mo=Object.create(null),ar=["https://api.simplesvg.com","https://api.unisvg.com"],Dr=[];for(;ar.length>0;)ar.length===1||Math.random()>.5?Dr.push(ar.shift()):Dr.push(ar.pop());Mo[""]=Do({resources:["https://api.iconify.design"].concat(Dr)});function sp(e,t){const n=Do(t);return n===null?!1:(Mo[e]=n,!0)}function Bo(e){return Mo[e]}const ap=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let js=ap();function lp(e,t){const n=Bo(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function cp(e){return e===404}const up=(e,t,n)=>{const r=[],i=lp(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,g)=>{c+=f.length+1,c>=i&&g>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function dp(e){if(typeof e=="string"){const t=Bo(e);if(t)return t.path}return"/"}const hp=(e,t,n)=>{if(!js){n("abort",424);return}let r=dp(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),f=new URLSearchParams({icons:c});r+=s+".json?"+f.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;js(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(cp(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},fp={prepare:up,send:hp};function pp(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,f=n[s]||(n[s]=Object.create(null)),g=f[a]||(f[a]=kn(s,a));let l;c in g.icons?l=t.loaded:a===""||g.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Rl(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function mp(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(f=>{if(f.prefix!==i)return!0;const g=f.name;if(e.icons[g])a.loaded.push({provider:r,prefix:i,name:g});else if(e.missing.has(g))a.missing.push({provider:r,prefix:i,name:g});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Rl([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let gp=0;function vp(e,t,n){const r=gp++,i=Rl.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function yp(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?Xr(i,t,n):i;s&&r.push(s)}),r}var bp={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ep(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let B=e.resources.slice(0);for(a=[];B.length>1;){const H=Math.floor(Math.random()*B.length);a.push(B[H]),B=B.slice(0,H).concat(B.slice(H+1))}a=a.concat(B)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",g=0,l,u=null,x=[],y=[];typeof r=="function"&&y.push(r);function T(){u&&(clearTimeout(u),u=null)}function O(){f==="pending"&&(f="aborted"),T(),x.forEach(B=>{B.status==="pending"&&(B.status="aborted")}),x=[]}function N(B,H){H&&(y=[]),typeof B=="function"&&y.push(B)}function D(){return{startTime:c,payload:t,status:f,queriesSent:g,queriesPending:x.length,subscribe:N,abort:O}}function P(){f="failed",y.forEach(B=>{B(void 0,l)})}function F(){x.forEach(B=>{B.status==="pending"&&(B.status="aborted")}),x=[]}function V(B,H,U){const le=H!=="success";switch(x=x.filter(G=>G!==B),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(H==="abort"){l=U,P();return}if(le){l=U,x.length||(a.length?I():P());return}if(T(),F(),!e.random){const G=e.resources.indexOf(B.resource);G!==-1&&G!==e.index&&(e.index=G)}f="completed",y.forEach(G=>{G(U)})}function I(){if(f!=="pending")return;T();const B=a.shift();if(B===void 0){if(x.length){u=setTimeout(()=>{T(),f==="pending"&&(F(),P())},e.timeout);return}P();return}const H={status:"pending",resource:B,callback:(U,le)=>{V(H,U,le)}};x.push(H),g++,u=setTimeout(I,e.rotate),n(B,t,H.callback)}return setTimeout(I),D}function Il(e){const t={...bp,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,g){const l=Ep(t,c,f,(u,x)=>{r(),g&&g(u,x)});return n.push(l),l}function s(c){return n.find(f=>c(f))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Ns(){}const ui=Object.create(null);function xp(e){if(!ui[e]){const t=Bo(e);if(!t)return;const n=Il(t),r={config:t,redundancy:n};ui[e]=r}return ui[e]}function Sp(e,t,n){let r,i;if(typeof e=="string"){const s=ji(e);if(!s)return n(void 0,424),Ns;i=s.send;const a=xp(e);a&&(r=a.redundancy)}else{const s=Do(e);if(s){r=Il(s);const a=e.resources?e.resources[0]:"",c=ji(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),Ns):r.query(t,i,n)().abort}const As="iconify2",gr="iconify",Cl=gr+"-count",Ps=gr+"-version",kl=36e5,wp=168;function Ni(e,t){try{return e.getItem(t)}catch{}}function Fo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ds(e,t){try{e.removeItem(t)}catch{}}function Ai(e,t){return Fo(e,Cl,t.toString())}function Pi(e){return parseInt(Ni(e,Cl))||0}const Yr={local:!0,session:!0},Ll={local:new Set,session:new Set};let Uo=!1;function Tp(e){Uo=e}let Rr=typeof window>"u"?{}:window;function jl(e){const t=e+"Storage";try{if(Rr&&Rr[t]&&typeof Rr[t].length=="number")return Rr[t]}catch{}Yr[e]=!1}function Nl(e,t){const n=jl(e);if(!n)return;const r=Ni(n,Ps);if(r!==As){if(r){const c=Pi(n);for(let f=0;f<c;f++)Ds(n,gr+f.toString())}Fo(n,Ps,As),Ai(n,0);return}const i=Math.floor(Date.now()/kl)-wp,s=c=>{const f=gr+c.toString(),g=Ni(n,f);if(typeof g=="string"){try{const l=JSON.parse(g);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>i&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&t(l,c))return!0}catch{}Ds(n,f)}};let a=Pi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,Ai(n,a)):Ll[e].add(c))}function Al(){if(!Uo){Tp(!0);for(const e in Yr)Nl(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=kn(r,i);if(!Po(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Op(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Yr)Nl(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function _p(e,t){Uo||Al();function n(r){let i;if(!Yr[r]||!(i=jl(r)))return;const s=Ll[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=Pi(i),!Ai(i,a+1))return;const c={cached:Math.floor(Date.now()/kl),provider:e.provider,data:t};return Fo(i,gr+a.toString(),JSON.stringify(c))}t.lastModified&&!Op(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Ms(){}function Rp(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,mp(e)}))}function Ip(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=ji(n)))return;s.prepare(n,r,i).forEach(c=>{Sp(n,c,f=>{if(typeof f!="object")c.icons.forEach(g=>{e.missing.add(g)});else try{const g=Po(e,f);if(!g.length)return;const l=e.pendingIcons;l&&g.forEach(u=>{l.delete(u)}),_p(e,f)}catch(g){console.error(g)}Rp(e)})})}))}const Cp=(e,t)=>{const n=yp(e,!0,Tl()),r=pp(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,Ms)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:g,prefix:l}=f;if(l===c&&g===a)return;a=g,c=l,s.push(kn(g,l));const u=i[g]||(i[g]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:g,prefix:l,name:u}=f,x=kn(g,l),y=x.pendingIcons||(x.pendingIcons=new Set);y.has(u)||(y.add(u),i[g][l].push(u))}),s.forEach(f=>{const{provider:g,prefix:l}=f;i[g][l].length&&Ip(f,i[g][l])}),t?vp(t,r,s):Ms};function kp(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Ol?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Lp=/[\s,]+/;function jp(e,t){t.split(Lp).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Np(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function Ap(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Pp(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Dp(e){return"data:image/svg+xml,"+Pp(e)}function Mp(e){return'url("'+Dp(e)+'")'}let fr;function Bp(){try{fr=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{fr=null}}function Fp(e){return fr===void 0&&Bp(),fr?fr.createHTML(e):e}const Pl={..._l,inline:!1},Up={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Wp={display:"inline-block"},Di={backgroundColor:"currentColor"},Dl={backgroundColor:"transparent"},Bs={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Fs={WebkitMask:Di,mask:Di,background:Dl};for(const e in Fs){const t=Fs[e];for(const n in Bs)t[e+n]=Bs[n]}const $p={...Pl,inline:!0};function Us(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const zp=(e,t,n,r)=>{const i=n?$p:Pl,s=kp(i,t),a=t.mode||"svg",c={},f=t.style||{},g={...a==="svg"?Up:{},ref:r};for(let D in t){const P=t[D];if(P!==void 0)switch(D){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[D]=P===!0||P==="true"||P===1;break;case"flip":typeof P=="string"&&jp(s,P);break;case"color":c.color=P;break;case"rotate":typeof P=="string"?s[D]=Np(P):typeof P=="number"&&(s[D]=P);break;case"ariaHidden":case"aria-hidden":P!==!0&&P!=="true"&&delete g["aria-hidden"];break;default:i[D]===void 0&&(g[D]=P)}}const l=ep(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){g.style={...c,...f},Object.assign(g,u);let D=0,P=t.id;return typeof P=="string"&&(P=P.replace(/-/g,"_")),g.dangerouslySetInnerHTML={__html:Fp(ip(l.body,P?()=>P+"ID"+D++:"iconifyReact"))},Ht.createElement("svg",g)}const{body:x,width:y,height:T}=e,O=a==="mask"||(a==="bg"?!1:x.indexOf("currentColor")!==-1),N=Ap(x,{...u,width:y+"",height:T+""});return g.style={...c,"--svg":Mp(N),width:Us(u.width),height:Us(u.height),...Wp,...O?Di:Dl,...f},Ht.createElement("span",g)};Tl(!0);op("",fp);if(typeof document<"u"&&typeof window<"u"){Al();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Yf(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;sp(n,i)||console.error(r)}catch{console.error(r)}}}}class Ml extends Ht.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||n.icon===null)&&this._setData({data:r});return}let i;if(typeof r!="string"||(i=Xr(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=Gf(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:Cp([i],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const a=["iconify"];i.prefix!==""&&a.push("iconify--"+i.prefix),i.provider!==""&&a.push("iconify--"+i.provider),this._setData({data:s,classes:a}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,n=this.state.icon;if(n===null)return t.children?t.children:Ht.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),zp({...Ao,...n.data},r,t._inline,t._ref)}}const vr=Ht.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Ht.createElement(Ml,r)});Ht.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Ht.createElement(Ml,r)});const Kp=Object.freeze({AUTH:"auth"}),Wo=Object.freeze({OWNER:"owner",ADMIN:"admin",MEMBER:"member",GUEST:"guest"}),ge=Object.freeze({...Wo,CI:"ci",CERTIFICATE:"certificate",BLOCKLET_OWNER:"blocklet-owner",BLOCKLET_ADMIN:"blocklet-admin",BLOCKLET_MEMBER:"blocklet-member",BLOCKLET_SDK:"blocklet-sdk",EXTERNAL_BLOCKLET_CONTROLLER:"external-blocklet-controller",EXTERNAL_BLOCKLETS_MANAGER:"external-blocklets-manager"}),qp=Object.freeze({BLOCKLET_GUEST:"blocklet-guest"}),Bl=[ge.BLOCKLET_OWNER,ge.BLOCKLET_ADMIN,ge.BLOCKLET_MEMBER,ge.BLOCKLET_SDK],Vp=e=>e&&Bl.includes(e),Hp=[ge.BLOCKLET_OWNER,ge.BLOCKLET_ADMIN,ge.BLOCKLET_MEMBER,ge.BLOCKLET_SDK,qp.BLOCKLET_GUEST],Gp=e=>e&&Hp.includes(e),Xp={USER:"user",OWNERSHIP_NFT:"ownership_nft",BLOCKLET_USER:"blocklet_user",BLOCKLET_CONTROLLER:"blocklet_controller"},Yp={roles:Object.freeze([{name:ge.OWNER,title:"Owner",description:"Has full administrative access to the Blocklet Server",passport:!0},{name:ge.ADMIN,title:"Admin",description:"Has full permissions to manage blocklet and Blocklet Server such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates, manage blocklet team, manage node integrations and access keys, upgrade node to a new version",passport:!0},{name:ge.MEMBER,title:"Member",description:"Has permissions to manage blocklets, such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates",passport:!0},{name:ge.GUEST,title:"Guest",description:"Has all read permissions on Blocklet Server",passport:!0},{name:ge.CI,title:"CI",description:"Deploy blocklet to Blocklet Server",passport:!0,noHuman:!0},{name:ge.CERTIFICATE,title:"Certificate",description:"Manage https certificates for blocklets on the Blocklet Server",passport:!0,noHuman:!0},{name:ge.BLOCKLET_OWNER,title:"Blocklet Owner"},{name:ge.BLOCKLET_ADMIN,title:"Blocklet Admin"},{name:ge.BLOCKLET_MEMBER,title:"Blocklet Member"},{name:ge.BLOCKLET_SDK,title:"Blocklet SDK"},{name:ge.EXTERNAL_BLOCKLET_CONTROLLER,title:"External Blocklet Controller"},{name:ge.EXTERNAL_BLOCKLETS_MANAGER,title:"External Blocklets Manager",description:"Manage external blocklets in the Blocklet Server",passport:!0,noHuman:!0}]),permissions:Object.freeze([{name:"query_node",description:"View node data, include dashboard and node settings, log stream for both Blocklet Server and blocklets"},{name:"mutate_node",description:"Change node settings, upgrade node to a new version"},{name:"query_session",description:"Get data from a long running session"},{name:"mutate_session",description:"Start/update/end a long running session"},{name:"query_accessKey",description:"View access keys for Blocklet Server"},{name:"mutate_accessKey",description:"Manage access keys for Blocklet Server, such as create/update/delete"},{name:"query_team",description:"View team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"mutate_team",description:"Manage team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"query_blocklets",description:"View store and installed blocklets, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklets",description:"Perform state changing actions on blocklets, such as install/upgrade/config/start/stop/remove"},{name:"query_router",description:"View sites, URL mapping and certificates in service gateway"},{name:"mutate_router",description:"Manage sites, URL mapping and certificates in service gateway"},{name:"query_certificate",description:"View certificates in service gateway"},{name:"mutate_certificate",description:"Manage certificates in service gateway"},{name:"query_notification",description:"View notifications"},{name:"mutate_notification",description:"Manage notifications, such as mark notifications as read"},{name:"query_webhook",description:"View integrations"},{name:"mutate_webhook",description:"Manage integrations"},{name:"query_blocklet",description:"View a blocklet, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklet",description:"Perform state changing actions on a blocklet, such as upgrade/config/start/stop"}]),grants:Object.freeze({[ge.GUEST]:["query_blocklets","query_router","query_webhook","query_notification","query_team","query_accessKey","query_node","query_session"],[ge.MEMBER]:[ge.GUEST,"mutate_blocklets","mutate_router","mutate_notification","mutate_session"],[ge.ADMIN]:[ge.MEMBER,"mutate_team","mutate_webhook","mutate_accessKey","mutate_node","mutate_certificate"],[ge.OWNER]:[Wo.ADMIN],[ge.CI]:["query_blocklets","mutate_blocklets"],[ge.CERTIFICATE]:["query_certificate","mutate_certificate"],[ge.BLOCKLET_SDK]:["query_team","mutate_team","query_blocklet"],[ge.BLOCKLET_OWNER]:[ge.BLOCKLET_ADMIN],[ge.BLOCKLET_ADMIN]:[ge.BLOCKLET_MEMBER,"mutate_team","mutate_blocklet","mutate_notification"],[ge.BLOCKLET_MEMBER]:["query_team","query_blocklet","query_notification"],[ge.EXTERNAL_BLOCKLET_CONTROLLER]:["query_blocklets","mutate_blocklets"],[ge.EXTERNAL_BLOCKLETS_MANAGER]:["query_blocklets","mutate_blocklets"]})},Ws=24*60*60*1e3,Qp={NOTIFICATION_CREATE:"notification.create",NOTIFICATION_READ:"notification.read",NOTIFICATION_BLOCKLET_READ:"blocklet.notification.read",NOTIFICATION_BLOCKLET_CREATE:"notification.blockletCreate",ROUTING_UPDATED:"routing.updated",NODE_UPDATED:"node.updated",NODE_MAINTAIN_PROGRESS:"node.upgrade.progress",NODE_STARTED:"node.started",NODE_STOPPED:"node.stopped",NODE_ADDED_OWNER:"node.addedOwner",NODE_RUNTIME_INFO:"node.runtimeInfo",BLOCKLETS_RUNTIME_INFO:"node.blockletsRuntimeInfo",DOMAIN_STATUS:"domain.status",CERT_ADDED:"cert.added",CERT_ISSUED:"cert.issued",CERT_UPDATED:"cert.updated",CERT_REMOVED:"cert.removed",CERT_ERROR:"cert.error",RELOAD_GATEWAY:"gateway.reload",NOTIFICATION_CREATE_QUEUED:"notification.create.queued"},Jp=Object.freeze({OWNER:"owner",ADMIN:"admin",INVITED:"invited",ALL:"all"}),Zp="https://test.store.blocklet.dev",$s="https://store.blocklet.dev",zs="https://dev.store.blocklet.dev",em="https://main.abtnetwork.io/api/",tm=Object.freeze({DERIVED:"derived",WALLET:"wallet"}),nm={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},rm={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},Fl=20,im=86400/Fl,om={SYNC_LIMIT:3},sm=[{text:"Plain Text",value:"text/plain"},{text:"JSON",value:"application/json"},{text:"XML",value:"application/xml"},{text:"HTML Document",value:"text/html"},{text:"YAML",value:"application/x-yaml"},{text:"TOML",value:"application/toml"},{text:"CSS",value:"text/css"},{text:"JavaScript",value:"application/javascript"},{text:"CSV",value:"text/csv"},{text:"Markdown",value:"text/markdown"},{text:"SVG",value:"image/svg+xml"}],am=30,lm=Object.freeze({created:0,selected:10,connected:20,timeout:25,paid:30,nftMinted:35,allocated:40,consuming:46,installed:50,overdue:60,canceled:65,terminated:70,transferred:90}),cm="default",um="public",dm="invited-only",hm="owner-only",fm="admin-only",pm="simple-cors",mm="security-header",gm="simple-cors-and-security-header",vm="event-bus";var Kt=Object.freeze({NODE_MODES:Object.freeze({PRODUCTION:"production",DEBUG:"debug",MAINTENANCE:"maintenance",SERVERLESS:"serverless"}),DEFAULT_DESCRIPTION:"Web Interface to manage your Blocklet Server",NODE_MAINTAIN_PROGRESS:Object.freeze({SETUP:"setup",INSTALLING:"installing",VERIFYING:"verifying",RESTARTING:"restarting",CLEANUP:"cleanup",COMPLETE:"complete",ROLLBACK:"rollback"}),VC_TYPE_BLOCKLET_PURCHASE:"BlockletPurchaseCredential",VC_TYPE_NODE_PASSPORT:"ABTNodePassport",VC_TYPE_GENERAL_PASSPORT:"NFTPassport",NFT_TYPE_SERVER_OWNERSHIP:"BlockletServerOwnershipNFT",NFT_TYPE_SERVERLESS:"BlockletServerServerlessNFT",NODE_PACKAGE_NAME:"@abtnode/cli",NODE_COMMAND_NAME:"abtnode",NODE_DATA_DIR_NAME:"_abtnode",USER_AVATAR_DIR:"/.assets/avatar",USER_AVATAR_URL_PREFIX:"bn://avatar",USER_AVATAR_PATH_PREFIX:"/user/avatar",USER_MAX_INVITE_DEPTH:8,PROCESS_NAME_DAEMON:"abt-node-daemon",PROCESS_NAME_PROXY:"abt-node-db-hub",PROCESS_NAME_UPDATER:"abt-node-updater",PROCESS_NAME_SERVICE:"abt-node-service",PROCESS_NAME_ROUTER:"abt-node-router",PROCESS_NAME_LOG_ROTATE:"abt-node-log-rotate",PROCESS_NAME_EVENT_HUB:"abt-node-event-hub",NODE_REGISTER_URL:"https://install.arcblock.io/",WEB_WALLET_URL:"https://web.abtwallet.io",TEST_STORE_URL:Zp,BLOCKLET_STORE_URL:$s,BLOCKLET_STORE_URL_DEV:zs,BLOCKLET_STORE_DID:"z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ",BLOCKLET_STORE_API_PREFIX:"/api",BLOCKLET_STORE_API_BLOCKLET_PREFIX:"/api/blocklets",BLOCKLET_STORE_META_PATH:"/api/store.json",BLOCKLET_STORE:{id:"zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT",name:"Official Store",description:"ArcBlock official blocklet registry",url:$s,logoUrl:"/logo.png",maintainer:"arcblock"},BLOCKLET_STORE_DEV:{id:"zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m",name:"Dev Store",description:"ArcBlock dev registry that contains demo and example blocklets",url:zs,maintainer:"arcblock",logoUrl:"/logo.png"},APP_STRUCT_VERSION:"2",DEFAULT_DID_REGISTRY:"https://registry.abtnet.io",DEFAULT_SLP_DOMAIN:"slp.abtnet.io",DEFAULT_DID_DOMAIN:"did.abtnet.io",DEFAULT_IP_DOMAIN:"*.ip.abtnet.io",DEFAULT_IP_DOMAIN_SUFFIX:"ip.abtnet.io",DEFAULT_WILDCARD_CERT_HOST:"https://releases.arcblock.io/",DEFAULT_NFT_DOMAIN_URL:"https://domain.didlabs.org/",DEFAULT_CERTIFICATE_EMAIL:"certs@arcblock.io",CONFIG_FILENAME:"config.yml",CONFIG_FILENAME_OLD:"abtnode.yml",CONFIG_FOLDER_NAME:".blocklet-server",CONFIG_FOLDER_NAME_OLD:".abtnode",EXPORTED_FOLDER_NAME:"exported_blocklet_server",StatusCode:Object.freeze({ok:0,blocklet_not_found:1,blocklet_not_purchased:2,forbidden:403,internal:500,timeout:504}),IP:new RegExp("-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"),DOMAIN_FOR_IP_SITE:"",DOMAIN_FOR_IP_SITE_REGEXP:"~^\\d+.\\d+.\\d+.\\d+$",DOMAIN_FOR_DEFAULT_SITE:"*",DOMAIN_FOR_INTERNAL_SITE:"127.0.0.1",NAME_FOR_WELLKNOWN_SITE:"wellknown",WELLKNOWN_PATH_PREFIX:"/.well-known",WELLKNOWN_ACME_CHALLENGE_PREFIX:"/.well-known/acme-challenge",WELLKNOWN_DID_RESOLVER_PREFIX:"/.well-known/did.json",WELLKNOWN_BLACKLIST_PREFIX:"/.well-known/blacklist",WELLKNOWN_PING_PREFIX:"/.well-known/ping",WELLKNOWN_ANALYTICS_PREFIX:"/.well-known/analytics",WELLKNOWN_SERVICE_PATH_PREFIX:"/.well-known/service",WELLKNOWN_BLOCKLET_ADMIN_PATH:"/.well-known/service/admin",WELLKNOWN_BLOCKLET_HEALTH_PATH:"/.well-known/service/health",WELLKNOWN_BLOCKLET_LOGO_PATH:"/.well-known/service/blocklet/logo",SLOT_FOR_IP_DNS_SITE:"888-888-888-888",DEFAULT_ADMIN_PATH:"/admin",WELLKNOWN_SERVER_ADMIN_PATH:"/.well-known/server/admin",DEFAULT_SERVICE_PATH:"/.abtnode/service",DEFAULT_HTTP_PORT:80,DEFAULT_HTTPS_PORT:443,MAX_UPLOAD_FILE_SIZE:500,DEFAULT_DAEMON_PORT:8089,MAX_NGINX_WORKER_CONNECTIONS:10240,BLOCKLET_PROXY_PATH_PREFIX:"/.blocklet/proxy",BLOCKLET_SITE_GROUP_SUFFIX:".blocklet-domain-group",DAY_IN_MS:Ws,DAEMON_MAX_MEM_LIMIT_IN_MB:800,PROXY_MAX_MEM_LIMIT_IN_MB:800,BLOCKLET_MAX_MEM_LIMIT_IN_MB:800,CERTIFICATE_EXPIRES_OFFSET:10*Ws,ROUTING_RESPONSE_TYPES:sm,ROUTING_RULE_TYPES:Object.freeze({NONE:"none",DAEMON:"daemon",SERVICE:"service",BLOCKLET:"blocklet",REDIRECT:"redirect",GENERAL_REWRITE:"rewrite",GENERAL_PROXY:"general_proxy",DIRECT_RESPONSE:"direct_response",COMPONENT:"component"}),ROLES:Wo,SERVER_ROLES:ge,BLOCKLET_ROLES:Bl,isBlockletRole:Vp,isBlockletMultipleTenantRole:Gp,AUTH_CERT_TYPE:Xp,RBAC_CONFIG:Yp,genPermissionName:(e,t="access")=>`${t}_${e.replace("_","-")}`,PASSPORT_STATUS:{VALID:"valid",REVOKED:"revoked",EXPIRED:"expired"},NODE_SERVICES:Kp,DISK_ALERT_THRESHOLD_PERCENT:80,EVENTS:Qp,WHO_CAN_ACCESS:Jp,WHO_CAN_ACCESS_PREFIX_ROLES:"roles:",GATEWAY_REQ_LIMIT:Object.freeze({min:10,max:100}),STORE_DETAIL_PAGE_PATH_PREFIX:"/blocklets",MAX_USER_PAGE_SIZE:100,MAX_PAGE_SIZE:100,SERVER_STATUS:{RUNNING:1,STOPPED:2,START_FROM_CRASH:3},LOG_RETAIN_IN_DAYS:60,BLOCKLET_INSTALL_TYPE:{STORE:"store",URL:"url",DEV:"dev",CREATE:"create",RESTORE:"restore"},ROUTER_CACHE_GROUPS:{blockletProxy:{minSize:"1m",maxSize:"2g",period:"30d"}},MAIN_CHAIN_ENDPOINT:em,USER_TYPE:tm,SERVER_CACHE_TTL:300*1e3,BLOCKLET_CACHE_TTL:3600*1e3,SESSION_CACHE_TTL:3600,SESSION_TTL:7*86400,BACKUPS:nm,CHECK_UPDATE:rm,MONITOR_HISTORY_LENGTH:im,MONITOR_RECORD_INTERVAL_SEC:Fl,INSTALL_ACTIONS:{INSTALL:"install",INSTALL_COMPONENT:"installComponent",UPGRADE_COMPONENT:"upgradeComponent"},COPYRIGHT_OWNER:"ArcBlock",FEDERATED:om,SESSION_TOKEN_STORAGE_KEY:"login_token",REFRESH_TOKEN_STORAGE_KEY:"refresh_token",SERVERLESS_BLOCKLET_DATA_RETENTION_DAYS:am,LAUNCH_SESSION_STATUS:lm,UNOWNED_DID:"z".repeat(35),STUDIO_CONNECTED_STORE:"studio_connected_store",STUDIO_CONNECTED_AND_DEVELOPED:"studio_connected_and_developed",VERIFY_CODE_LENGTH:6,VERIFY_CODE_TTL:30*60*1e3,VERIFY_SEND_TTL:1*60*1e3,SECURITY_RULE_DEFAULT_ID:cm,ACCESS_POLICY_PUBLIC:um,ACCESS_POLICY_INVITED_ONLY:dm,ACCESS_POLICY_OWNER_ONLY:hm,ACCESS_POLICY_ADMIN_ONLY:fm,RESPONSE_HEADER_POLICY_SIMPLE_CORS:pm,RESPONSE_HEADER_POLICY_SECURITY_HEADER:mm,RESPONSE_HEADER_POLICY_SIMPLE_CORS_AND_SECURITY_HEADER:gm,MFA_PROTECTED_METHODS:["deleteBlocklet","deleteComponent","rotateSessionKey","upgradeNodeVersion","removeUser","updateUserApproval","deleteRoutingRule","deleteDomainAlias","deleteCertificate","deleteAccessKey","deleteWebHook","deleteBlockletSecurityRule","deleteBlockletResponseHeaderPolicy","deleteBlockletAccessPolicy","configVault"],STUDIO_ALLOWED_METHODS:{getBlocklet:!0,createProject:!0,getProjects:!0,getProject:!0,updateProject:!0,deleteProject:!0,getReleases:!0,getRelease:!0,createRelease:!0,deleteRelease:!0,addBlockletStore:!0,deleteBlockletStore:!0,publishToStore:!0,connectToStore:!0,connectByStudio:!0,disconnectFromStore:!0,getSelectedResources:!0,updateSelectedResources:!0,getBlockletRuntimeHistory:!0,checkDomains:!0},SKIP_ACCESS_VERIFY_METHODS:{makeAllNotificationsAsRead:!0,readNotifications:!0,unreadNotifications:!0,launchBlockletByLauncher:!0},NOTIFICATION_SEND_STATUS:{PENDING:0,SENT:1,FAILED:2},NOTIFICATION_SEND_FAILED_REASON:{USER_DISABLED:"user_disabled",CHANNEL_UNAVAILABLE:"channel_unavailable",CHANNEL_DISABLED:"channel_disabled",NOT_ONLINE:"not_online"},NOTIFICATION_SEND_CHANNEL:{WALLET:"app",EMAIL:"email",PUSH:"push",WEBHOOK:"webhook"},BLACKLIST_SCOPE:{ROUTER:"router"},EVENT_BUS_EVENT:vm,PASSPORT_SOURCE:{INVITE:"invite",ISSUE:"issue",RECOVER:"recover",TRUSTED:"trusted"},PASSPORT_LOG_ACTION:{ISSUE:"issue",REVOKE:"revoke",APPROVE:"approve",RECOVER:"recover",LOGIN:"login",EXPIRED:"expired",USED:"used"},PASSPORT_ISSUE_ACTION:{ISSUE_ON_INVITE:"issueOnInvite",ISSUE_ON_LAUNCH:"issueOnLaunch",ISSUE_ON_KYC:"issueOnKyc",ISSUE_ON_RECOVER:"issueOnRecover",ISSUE_ON_ROTATE_KEY_PAIR:"issueOnRotateKeyPair",ISSUE_ON_TRANSFER:"issueOnTransferPassportForBindWallet",ISSUE_ON_BLOCKLET_START:"issueOnBlockletStart",ISSUE_ON_RECEIVE_TRANSFER_APP_OWNER:"receiveTransferAppOwner",ISSUE_ON_AUTH0:"issueOnAuth0",ISSUE_ON_SETUP_APP_OWNER:"issueOnLaunchSetupAppOwner",ISSUE_ON_EXCHANGE_PASSPORT:"issueOnExchangePassport",ISSUE_ON_TRUST_PASSPORT:"issueOnTrustPassport"}});/*! js-cookie v3.0.5 | MIT */function Ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var ym={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Mi(e,t){function n(i,s,a){if(!(typeof document>"u")){a=Ir({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var f in a)a[f]&&(c+="; "+f,a[f]!==!0&&(c+="="+a[f].split(";")[0]));return document.cookie=i+"="+e.write(s,i)+c}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],a={},c=0;c<s.length;c++){var f=s[c].split("="),g=f.slice(1).join("=");try{var l=decodeURIComponent(f[0]);if(a[l]=e.read(g,l),i===l)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,s){n(i,"",Ir({},s,{expires:-1}))},withAttributes:function(i){return Mi(this.converter,Ir({},this.attributes,i))},withConverter:function(i){return Mi(Ir({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Wn=Mi(ym,{path:"/"}),xt,Ce,Fe,tn,br,nn,be,Bi,_t,Ul,Fi,Ui,Wi,Wl,$i;class bm extends Map{constructor(n={}){super();Zt(this,be);Zt(this,xt,0);Zt(this,Ce,new Map);Zt(this,Fe,new Map);Zt(this,tn);Zt(this,br);Zt(this,nn);if(!(n.maxSize&&n.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof n.maxAge=="number"&&n.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");nt(this,tn,n.maxSize),nt(this,br,n.maxAge||Number.POSITIVE_INFINITY),nt(this,nn,n.onEviction)}get __oldCache(){return ue(this,Fe)}get(n){if(ue(this,Ce).has(n)){const r=ue(this,Ce).get(n);return Pe(this,be,Fi).call(this,n,r)}if(ue(this,Fe).has(n)){const r=ue(this,Fe).get(n);if(Pe(this,be,_t).call(this,n,r)===!1)return Pe(this,be,Wl).call(this,n,r),r.value}}set(n,r,{maxAge:i=ue(this,br)}={}){const s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return ue(this,Ce).has(n)?ue(this,Ce).set(n,{value:r,expiry:s}):Pe(this,be,Wi).call(this,n,{value:r,expiry:s}),this}has(n){return ue(this,Ce).has(n)?!Pe(this,be,_t).call(this,n,ue(this,Ce).get(n)):ue(this,Fe).has(n)?!Pe(this,be,_t).call(this,n,ue(this,Fe).get(n)):!1}peek(n){if(ue(this,Ce).has(n))return Pe(this,be,Ui).call(this,n,ue(this,Ce));if(ue(this,Fe).has(n))return Pe(this,be,Ui).call(this,n,ue(this,Fe))}delete(n){const r=ue(this,Ce).delete(n);return r&&ei(this,xt)._--,ue(this,Fe).delete(n)||r}clear(){ue(this,Ce).clear(),ue(this,Fe).clear(),nt(this,xt,0)}resize(n){if(!(n&&n>0))throw new TypeError("`maxSize` must be a number greater than 0");const r=[...Pe(this,be,$i).call(this)],i=r.length-n;i<0?(nt(this,Ce,new Map(r)),nt(this,Fe,new Map),nt(this,xt,r.length)):(i>0&&Pe(this,be,Bi).call(this,r.slice(0,i)),nt(this,Fe,new Map(r.slice(i))),nt(this,Ce,new Map),nt(this,xt,0)),nt(this,tn,n)}*keys(){for(const[n]of this)yield n}*values(){for(const[,n]of this)yield n}*[Symbol.iterator](){for(const n of ue(this,Ce)){const[r,i]=n;Pe(this,be,_t).call(this,r,i)===!1&&(yield[r,i.value])}for(const n of ue(this,Fe)){const[r,i]=n;ue(this,Ce).has(r)||Pe(this,be,_t).call(this,r,i)===!1&&(yield[r,i.value])}}*entriesDescending(){let n=[...ue(this,Ce)];for(let r=n.length-1;r>=0;--r){const i=n[r],[s,a]=i;Pe(this,be,_t).call(this,s,a)===!1&&(yield[s,a.value])}n=[...ue(this,Fe)];for(let r=n.length-1;r>=0;--r){const i=n[r],[s,a]=i;ue(this,Ce).has(s)||Pe(this,be,_t).call(this,s,a)===!1&&(yield[s,a.value])}}*entriesAscending(){for(const[n,r]of Pe(this,be,$i).call(this))yield[n,r.value]}get size(){if(!ue(this,xt))return ue(this,Fe).size;let n=0;for(const r of ue(this,Fe).keys())ue(this,Ce).has(r)||n++;return Math.min(ue(this,xt)+n,ue(this,tn))}get maxSize(){return ue(this,tn)}entries(){return this.entriesAscending()}forEach(n,r=this){for(const[i,s]of this.entriesAscending())n.call(r,s,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}xt=new WeakMap,Ce=new WeakMap,Fe=new WeakMap,tn=new WeakMap,br=new WeakMap,nn=new WeakMap,be=new WeakSet,Bi=function(n){if(typeof ue(this,nn)=="function")for(const[r,i]of n)ue(this,nn).call(this,r,i.value)},_t=function(n,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof ue(this,nn)=="function"&&ue(this,nn).call(this,n,r.value),this.delete(n)):!1},Ul=function(n,r){if(Pe(this,be,_t).call(this,n,r)===!1)return r.value},Fi=function(n,r){return r.expiry?Pe(this,be,Ul).call(this,n,r):r.value},Ui=function(n,r){const i=r.get(n);return Pe(this,be,Fi).call(this,n,i)},Wi=function(n,r){ue(this,Ce).set(n,r),ei(this,xt)._++,ue(this,xt)>=ue(this,tn)&&(nt(this,xt,0),Pe(this,be,Bi).call(this,ue(this,Fe)),nt(this,Fe,ue(this,Ce)),nt(this,Ce,new Map))},Wl=function(n,r){ue(this,Fe).delete(n),Pe(this,be,Wi).call(this,n,r)},$i=function*(){for(const n of ue(this,Fe)){const[r,i]=n;ue(this,Ce).has(r)||Pe(this,be,_t).call(this,r,i)===!1&&(yield n)}for(const n of ue(this,Ce)){const[r,i]=n;Pe(this,be,_t).call(this,r,i)===!1&&(yield n)}};class Em{getSessionToken(t){return Wn.get(Kt.SESSION_TOKEN_STORAGE_KEY)?Wn.get(Kt.SESSION_TOKEN_STORAGE_KEY):t.sessionTokenKey?window.localStorage.getItem(t.sessionTokenKey):""}setSessionToken(t){Wn.set(Kt.SESSION_TOKEN_STORAGE_KEY,t)}removeSessionToken(){Wn.remove(Kt.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(Kt.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(t){localStorage.setItem(Kt.REFRESH_TOKEN_STORAGE_KEY,t)}removeRefreshToken(){localStorage.removeItem(Kt.REFRESH_TOKEN_STORAGE_KEY)}}new bm({maxSize:30,maxAge:60*1e3});var xm=Object.defineProperty,Sm=(e,t,n)=>t in e?xm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wm=(e,t,n)=>(Sm(e,t+"",n),n);class Tm{constructor({blocklet:t=window.blocklet}={}){wm(this,"blocklet"),this.blocklet=t}getComponent(t){var i;return(((i=this.blocklet)==null?void 0:i.componentMountPoints)||[]).find(s=>[s.title,s.name,s.did].includes(t))}getComponentMountPoint(t){const n=this.getComponent(t);return(n==null?void 0:n.mountPoint)||""}getUrl(t,...n){var s;const r=this.getComponentMountPoint(t),i=((s=this.blocklet)==null?void 0:s.appUrl)||"";return Kn(i,r,...n)}}const Om="1.16.41",_m=(e=0)=>new Promise(t=>{setTimeout(()=>{t()},e)}),$l=e=>`Bearer ${encodeURIComponent(e)}`,Rm="__visitor_id",Im=()=>localStorage.getItem(Rm),Cm=(e,t)=>{if(tu(e.data)&&e.status>=200&&e.status<300&&window.blocklet&&window.blocklet.appId&&window.blocklet.appPk){if(!e.data.$signature)throw t(),new Error("Invalid response");const{appId:n,appPk:r}=window.blocklet;if(zc(r,xr.toTypeInfo(n)).verify(va(nu(e.data,["$signature"])),e.data.$signature)===!1)throw t(),new Error("Invalid response")}return e};function km(){return Wn.get("x-csrf-token")}async function Ks(e,t=300){e.metaData.endTime=+new Date;const{startTime:n,endTime:r}=e.metaData,i=r-n;i<t&&await _m(t-i),delete e.metaData}const zl=(e,t)=>{const n={...e==null?void 0:e.headers,"x-blocklet-js-sdk-version":Om},r=new Tm,i=Im();[void 0,null].includes(i)||(n["x-blocklet-visitor-id"]=i);const s=Ti.create({...e,headers:n});return t!=null&&t.lazy&&(s.interceptors.request.use(a=>(a.metaData={startTime:+new Date},a),a=>Promise.reject(a)),s.interceptors.response.use(async a=>(a.config&&await Ks(a.config,t==null?void 0:t.lazyTime),a),async a=>(a.response&&await Ks(a.response.config,t==null?void 0:t.lazyTime),Promise.reject(a)))),s.interceptors.request.use(a=>{var f,g;const c=(t==null?void 0:t.componentDid)??((g=(f=window.blocklet)==null?void 0:f.componentId)==null?void 0:g.split("/").pop());return a.baseURL=a.baseURL||r.getComponentMountPoint(c),a.timeout=a.timeout||20*1e3,a.headers["x-csrf-token"]=km(),a},a=>Promise.reject(a)),s};async function Lm(e){if(!e)throw new Error("Refresh token not found");const t=zl({baseURL:Kt.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:10*1e3,secure:!0,headers:{authorization:$l(e)}}),{data:n}=await t.post("/api/did/refreshSession");return n}function jm({getSessionToken:e,setSessionToken:t,removeSessionToken:n,getRefreshToken:r,setRefreshToken:i,removeRefreshToken:s,onRefreshTokenError:a,onRefreshTokenSuccess:c},f,g){let l=null;const u=zl({timeout:30*1e3,...f},g);return u.interceptors.request.use(async x=>{if(!Wn.get(Kt.SESSION_TOKEN_STORAGE_KEY)){const y=e(x);y&&(x.headers.authorization=$l(y))}return l&&await l,x},x=>Promise.reject(x)),u.interceptors.response.use(x=>{var y;return(y=x.config)!=null&&y.secure?Cm(x,()=>{n(),s()}):x},async x=>{var T;const y=x.config;if(y&&(y.headers=y!=null&&y.headers?{...y.headers}:{},((T=x==null?void 0:x.response)==null?void 0:T.status)===401&&!y._retry)){y._retry=!0;try{l||(l=Lm(r()));const O=await l;return t(O.nextToken),i(O.nextRefreshToken),typeof c=="function"&&c(O),u(y)}catch(O){return n(),s(),typeof a=="function"&&a(O),Promise.reject(x)}finally{l=null}}return Promise.reject(x)}),u}function Kl(e={},t={}){const n=new Em;return jm({getSessionToken:n.getSessionToken,setSessionToken:n.setSessionToken,removeSessionToken:n.removeSessionToken,getRefreshToken:n.getRefreshToken,setRefreshToken:n.setRefreshToken,removeRefreshToken:n.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},e,t)}var ql={exports:{}};(function(e,t){(function(n,r){e.exports=r(M)})(_e,n=>(()=>{var r={703:(c,f,g)=>{var l=g(414);function u(){}function x(){}x.resetWarningCache=u,c.exports=function(){function y(N,D,P,F,V,I){if(I!==l){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}}function T(){return y}y.isRequired=y;var O={array:y,bool:y,func:y,number:y,object:y,string:y,symbol:y,any:y,arrayOf:T,element:y,elementType:y,instanceOf:T,node:y,objectOf:T,oneOf:T,oneOfType:T,shape:T,exact:T,checkPropTypes:x,resetWarningCache:u};return O.PropTypes=O,O}},697:(c,f,g)=>{c.exports=g(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",g=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function x(y,T){if(y===T)return!0;if(y&&T&&typeof y=="object"&&typeof T=="object"){if(y.constructor!==T.constructor)return!1;var O,N,D,P;if(Array.isArray(y)){if((O=y.length)!=T.length)return!1;for(N=O;N--!=0;)if(!x(y[N],T[N]))return!1;return!0}if(g&&y instanceof Map&&T instanceof Map){if(y.size!==T.size)return!1;for(P=y.entries();!(N=P.next()).done;)if(!T.has(N.value[0]))return!1;for(P=y.entries();!(N=P.next()).done;)if(!x(N.value[1],T.get(N.value[0])))return!1;return!0}if(l&&y instanceof Set&&T instanceof Set){if(y.size!==T.size)return!1;for(P=y.entries();!(N=P.next()).done;)if(!T.has(N.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(T)){if((O=y.length)!=T.length)return!1;for(N=O;N--!=0;)if(y[N]!==T[N])return!1;return!0}if(y.constructor===RegExp)return y.source===T.source&&y.flags===T.flags;if(y.valueOf!==Object.prototype.valueOf)return y.valueOf()===T.valueOf();if(y.toString!==Object.prototype.toString)return y.toString()===T.toString();if((O=(D=Object.keys(y)).length)!==Object.keys(T).length)return!1;for(N=O;N--!=0;)if(!Object.prototype.hasOwnProperty.call(T,D[N]))return!1;if(f&&y instanceof Element)return!1;for(N=O;N--!=0;)if((D[N]!=="_owner"&&D[N]!=="__v"&&D[N]!=="__o"||!y.$$typeof)&&!x(y[D[N]],T[D[N]]))return!1;return!0}return y!=y&&T!=T}c.exports=function(y,T){try{return x(y,T)}catch(O){if((O.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw O}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var g=i[c]={exports:{}};return r[c](g,g.exports,s),g.exports}s.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return s.d(f,{a:f}),f},s.d=(c,f)=>{for(var g in f)s.o(f,g)&&!s.o(c,g)&&Object.defineProperty(c,g,{enumerable:!0,get:f[g]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),s.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};return(()=>{function c(b){var p,w,_="";if(typeof b=="string"||typeof b=="number")_+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(w=c(b[p]))&&(_&&(_+=" "),_+=w);else for(p in b)b[p]&&(_&&(_+=" "),_+=p);return _}function f(){for(var b,p,w=0,_="";w<arguments.length;)(b=arguments[w++])&&(p=c(b))&&(_&&(_+=" "),_+=p);return _}s.r(a),s.d(a,{default:()=>cc});var g=s(359),l=s.n(g);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},x=typeof _e=="object"&&_e&&_e.Object===Object&&_e;var y=typeof self=="object"&&self&&self.Object===Object&&self;const T=x||y||Function("return this")(),O=function(){return T.Date.now()};var N=/\s/,D=/^\s+/;const P=function(b){return b&&b.slice(0,function(p){for(var w=p.length;w--&&N.test(p.charAt(w)););return w}(b)+1).replace(D,"")},F=T.Symbol;var V=Object.prototype,I=V.hasOwnProperty,B=V.toString,H=F?F.toStringTag:void 0,U=Object.prototype.toString,le=F?F.toStringTag:void 0;const G=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":le&&le in Object(b)?function(p){var w=I.call(p,H),_=p[H];try{p[H]=void 0;var K=!0}catch{}var re=B.call(p);return K&&(w?p[H]=_:delete p[H]),re}(b):function(p){return U.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,Ie=/^0b[01]+$/i,Ge=/^0o[0-7]+$/i,ze=parseInt;const it=function(b){if(typeof b=="number")return b;if(function(_){return typeof _=="symbol"||function(K){return K!=null&&typeof K=="object"}(_)&&G(_)=="[object Symbol]"}(b))return NaN;if(u(b)){var p=typeof b.valueOf=="function"?b.valueOf():b;b=u(p)?p+"":p}if(typeof b!="string")return b===0?b:+b;b=P(b);var w=Ie.test(b);return w||Ge.test(b)?ze(b.slice(2),w?2:8):se.test(b)?NaN:+b};var Z=Math.max,me=Math.min;const ee=function(b,p,w){var _,K,re,ve,v,m,C=0,W=!1,q=!1,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");function de(ie){var pe=_,Se=K;return _=K=void 0,C=ie,ve=b.apply(Se,pe)}function ce(ie){return C=ie,v=setTimeout(X,p),W?de(ie):ve}function fe(ie){var pe=ie-m;return m===void 0||pe>=p||pe<0||q&&ie-C>=re}function X(){var ie=O();if(fe(ie))return Q(ie);v=setTimeout(X,function(pe){var Se=p-(pe-m);return q?me(Se,re-(pe-C)):Se}(ie))}function Q(ie){return v=void 0,z&&_?de(ie):(_=K=void 0,ve)}function J(){var ie=O(),pe=fe(ie);if(_=arguments,K=this,m=ie,pe){if(v===void 0)return ce(m);if(q)return clearTimeout(v),v=setTimeout(X,p),de(m)}return v===void 0&&(v=setTimeout(X,p)),ve}return p=it(p)||0,u(w)&&(W=!!w.leading,re=(q="maxWait"in w)?Z(it(w.maxWait)||0,p):re,z="trailing"in w?!!w.trailing:z),J.cancel=function(){v!==void 0&&clearTimeout(v),C=0,_=m=K=v=void 0},J.flush=function(){return v===void 0?ve:Q(O())},J},xe=function(b,p,w){var _=!0,K=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(w)&&(_="leading"in w?!!w.leading:_,K="trailing"in w?!!w.trailing:K),ee(b,p,{leading:_,maxWait:p,trailing:K})};var oe=s(590),We=s.n(oe),Te=function(){if(typeof Map<"u")return Map;function b(p,w){var _=-1;return p.some(function(K,re){return K[0]===w&&(_=re,!0)}),_}return function(){function p(){this.__entries__=[]}return Object.defineProperty(p.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),p.prototype.get=function(w){var _=b(this.__entries__,w),K=this.__entries__[_];return K&&K[1]},p.prototype.set=function(w,_){var K=b(this.__entries__,w);~K?this.__entries__[K][1]=_:this.__entries__.push([w,_])},p.prototype.delete=function(w){var _=this.__entries__,K=b(_,w);~K&&_.splice(K,1)},p.prototype.has=function(w){return!!~b(this.__entries__,w)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(w,_){_===void 0&&(_=null);for(var K=0,re=this.__entries__;K<re.length;K++){var ve=re[K];w.call(_,ve[1],ve[0])}},p}()}(),ot=typeof window<"u"&&typeof document<"u"&&window.document===document,Ye=s.g!==void 0&&s.g.Math===Math?s.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),an=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ye):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},ln=["top","right","bottom","left","width","height","size","weight"],Gt=typeof MutationObserver<"u",cn=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,w){var _=!1,K=!1,re=0;function ve(){_&&(_=!1,p()),K&&m()}function v(){an(ve)}function m(){var C=Date.now();if(_){if(C-re<2)return;K=!0}else _=!0,K=!1,setTimeout(v,20);re=C}return m}(this.refresh.bind(this))}return b.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},b.prototype.removeObserver=function(p){var w=this.observers_,_=w.indexOf(p);~_&&w.splice(_,1),!w.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var p=this.observers_.filter(function(w){return w.gatherActive(),w.hasActive()});return p.forEach(function(w){return w.broadcastActive()}),p.length>0},b.prototype.connect_=function(){ot&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Gt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){ot&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(p){var w=p.propertyName,_=w===void 0?"":w;ln.some(function(K){return!!~_.indexOf(K)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),De=function(b,p){for(var w=0,_=Object.keys(p);w<_.length;w++){var K=_[w];Object.defineProperty(b,K,{value:p[K],enumerable:!1,writable:!1,configurable:!0})}return b},Me=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||Ye},st=ke(0,0,0,0);function he(b){return parseFloat(b)||0}function un(b){for(var p=[],w=1;w<arguments.length;w++)p[w-1]=arguments[w];return p.reduce(function(_,K){return _+he(b["border-"+K+"-width"])},0)}var dn=typeof SVGGraphicsElement<"u"?function(b){return b instanceof Me(b).SVGGraphicsElement}:function(b){return b instanceof Me(b).SVGElement&&typeof b.getBBox=="function"};function hn(b){return ot?dn(b)?function(p){var w=p.getBBox();return ke(0,0,w.width,w.height)}(b):function(p){var w=p.clientWidth,_=p.clientHeight;if(!w&&!_)return st;var K=Me(p).getComputedStyle(p),re=function(z){for(var de={},ce=0,fe=["top","right","bottom","left"];ce<fe.length;ce++){var X=fe[ce],Q=z["padding-"+X];de[X]=he(Q)}return de}(K),ve=re.left+re.right,v=re.top+re.bottom,m=he(K.width),C=he(K.height);if(K.boxSizing==="border-box"&&(Math.round(m+ve)!==w&&(m-=un(K,"left","right")+ve),Math.round(C+v)!==_&&(C-=un(K,"top","bottom")+v)),!function(z){return z===Me(z).document.documentElement}(p)){var W=Math.round(m+ve)-w,q=Math.round(C+v)-_;Math.abs(W)!==1&&(m-=W),Math.abs(q)!==1&&(C-=q)}return ke(re.left,re.top,m,C)}(b):st}function ke(b,p,w,_){return{x:b,y:p,width:w,height:_}}var Xt=function(){function b(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ke(0,0,0,0),this.target=p}return b.prototype.isActive=function(){var p=hn(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},b}(),Xn=function(b,p){var w,_,K,re,ve,v,m,C=(_=(w=p).x,K=w.y,re=w.width,ve=w.height,v=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(v.prototype),De(m,{x:_,y:K,width:re,height:ve,top:K,right:_+re,bottom:ve+K,left:_}),m);De(this,{target:b,contentRect:C})},at=function(){function b(p,w,_){if(this.activeObservations_=[],this.observations_=new Te,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=w,this.callbackCtx_=_}return b.prototype.observe=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Me(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var w=this.observations_;w.has(p)||(w.set(p,new Xt(p)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Me(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var w=this.observations_;w.has(p)&&(w.delete(p),w.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(w){w.isActive()&&p.activeObservations_.push(w)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,w=this.activeObservations_.map(function(_){return new Xn(_.target,_.broadcastRect())});this.callback_.call(p,w,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),fn=typeof WeakMap<"u"?new WeakMap:new Te,pn=function b(p){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var w=cn.getInstance(),_=new at(p,w,this);fn.set(this,_)};["observe","unobserve","disconnect"].forEach(function(b){pn.prototype[b]=function(){var p;return(p=fn.get(this))[b].apply(p,arguments)}});const mn=Ye.ResizeObserver!==void 0?Ye.ResizeObserver:pn,Ke="Left",lt="Right",kt="Up",ht="Down",Lt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Mt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Qe="mousemove",jn="mouseup";function gn(b,p){if(p===0)return b;const w=Math.PI/180*p;return[b[0]*Math.cos(w)+b[1]*Math.sin(w),b[1]*Math.cos(w)-b[0]*Math.sin(w)]}function Nn(b){const{trackMouse:p}=b,w=g.useRef(Object.assign({},Mt)),_=g.useRef(Object.assign({},Lt)),K=g.useRef(Object.assign({},_.current));let re;for(re in K.current=Object.assign({},_.current),_.current=Object.assign(Object.assign({},Lt),b),Lt)_.current[re]===void 0&&(_.current[re]=Lt[re]);const[ve,v]=g.useMemo(()=>function(m,C){const W=X=>{const Q="touches"in X;Q&&X.touches.length>1||m((J,ie)=>{ie.trackMouse&&!Q&&(document.addEventListener(Qe,q),document.addEventListener(jn,de));const{clientX:pe,clientY:Se}=Q?X.touches[0]:X,Be=gn([pe,Se],ie.rotationAngle);return ie.onTouchStartOrOnMouseDown&&ie.onTouchStartOrOnMouseDown({event:X}),Object.assign(Object.assign(Object.assign({},J),Mt),{initial:Be.slice(),xy:Be,start:X.timeStamp||0})})},q=X=>{m((Q,J)=>{const ie="touches"in X;if(ie&&X.touches.length>1)return Q;if(X.timeStamp-Q.start>J.swipeDuration)return Q.swiping?Object.assign(Object.assign({},Q),{swiping:!1}):Q;const{clientX:pe,clientY:Se}=ie?X.touches[0]:X,[Be,mt]=gn([pe,Se],J.rotationAngle),ct=Be-Q.xy[0],Je=mt-Q.xy[1],Ae=Math.abs(ct),we=Math.abs(Je),Jt=(X.timeStamp||0)-Q.start,er=Math.sqrt(Ae*Ae+we*we)/(Jt||1),tr=[ct/(Jt||1),Je/(Jt||1)],$t=function(nr,Fn,rr,gt){return nr>Fn?rr>0?lt:Ke:gt>0?ht:kt}(Ae,we,ct,Je),Sn=typeof J.delta=="number"?J.delta:J.delta[$t.toLowerCase()]||Lt.delta;if(Ae<Sn&&we<Sn&&!Q.swiping)return Q;const Nt={absX:Ae,absY:we,deltaX:ct,deltaY:Je,dir:$t,event:X,first:Q.first,initial:Q.initial,velocity:er,vxvy:tr};Nt.first&&J.onSwipeStart&&J.onSwipeStart(Nt),J.onSwiping&&J.onSwiping(Nt);let Bn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${$t}`])&&(Bn=!0),Bn&&J.preventScrollOnSwipe&&J.trackTouch&&X.cancelable&&X.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Nt,swiping:!0})})},z=X=>{m((Q,J)=>{let ie;if(Q.swiping&&Q.eventData){if(X.timeStamp-Q.start<J.swipeDuration){ie=Object.assign(Object.assign({},Q.eventData),{event:X}),J.onSwiped&&J.onSwiped(ie);const pe=J[`onSwiped${ie.dir}`];pe&&pe(ie)}}else J.onTap&&J.onTap({event:X});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:X}),Object.assign(Object.assign(Object.assign({},Q),Mt),{eventData:ie})})},de=X=>{document.removeEventListener(Qe,q),document.removeEventListener(jn,de),z(X)},ce=(X,Q)=>{let J=()=>{};if(X&&X.addEventListener){const ie=Object.assign(Object.assign({},Lt.touchEventOptions),Q.touchEventOptions),pe=[["touchstart",W,ie],["touchmove",q,Object.assign(Object.assign({},ie),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",z,ie]];pe.forEach(([Se,Be,mt])=>X.addEventListener(Se,Be,mt)),J=()=>pe.forEach(([Se,Be])=>X.removeEventListener(Se,Be))}return J},fe={ref:X=>{X!==null&&m((Q,J)=>{if(Q.el===X)return Q;const ie={};return Q.el&&Q.el!==X&&Q.cleanUpTouch&&(Q.cleanUpTouch(),ie.cleanUpTouch=void 0),J.trackTouch&&X&&(ie.cleanUpTouch=ce(X,J)),Object.assign(Object.assign(Object.assign({},Q),{el:X}),ie)})}};return C.trackMouse&&(fe.onMouseDown=W),[fe,ce]}(m=>w.current=m(w.current,_.current),{trackMouse:p}),[p]);return w.current=function(m,C,W,q){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==W.preventScrollOnSwipe||C.touchEventOptions.passive!==W.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:q(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:q(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(w.current,_.current,K.current,v),ve}var k=s(697);function jt(b){return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},jt(b)}function Bt(b,p){var w=Object.keys(b);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(b);p&&(_=_.filter(function(K){return Object.getOwnPropertyDescriptor(b,K).enumerable})),w.push.apply(w,_)}return w}function vn(b){for(var p=1;p<arguments.length;p++){var w=arguments[p]!=null?arguments[p]:{};p%2?Bt(Object(w),!0).forEach(function(_){d(b,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(w)):Bt(Object(w)).forEach(function(_){Object.defineProperty(b,_,Object.getOwnPropertyDescriptor(w,_))})}return b}function d(b,p,w){return(p=function(_){var K=function(re,ve){if(jt(re)!=="object"||re===null)return re;var v=re[Symbol.toPrimitive];if(v!==void 0){var m=v.call(re,ve);if(jt(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(_,"string");return jt(K)==="symbol"?K:String(K)}(p))in b?Object.defineProperty(b,p,{value:w,enumerable:!0,configurable:!0,writable:!0}):b[p]=w,b}var E={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},S=l().memo(function(b){var p=vn(vn({},E),b),w=p.description,_=p.fullscreen,K=p.handleImageLoaded,re=p.isFullscreen,ve=p.onImageError,v=p.original,m=p.originalAlt,C=p.originalHeight,W=p.originalWidth,q=p.originalTitle,z=p.sizes,de=p.srcSet,ce=p.loading,fe=re&&_||v;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:fe,alt:m,srcSet:de,height:C,width:W,sizes:z,title:q,onLoad:function(X){return K(X,v)},onError:ve,loading:ce}),w&&l().createElement("span",{className:"image-gallery-description"},w))});S.displayName="Item",S.propTypes={description:k.string,fullscreen:k.string,handleImageLoaded:k.func.isRequired,isFullscreen:k.bool,onImageError:k.func.isRequired,original:k.string.isRequired,originalAlt:k.string,originalHeight:k.string,originalWidth:k.string,originalTitle:k.string,sizes:k.string,srcSet:k.string,loading:k.string};const L=S;function R(b){return R=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},R(b)}function j(b,p){var w=Object.keys(b);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(b);p&&(_=_.filter(function(K){return Object.getOwnPropertyDescriptor(b,K).enumerable})),w.push.apply(w,_)}return w}function $(b){for(var p=1;p<arguments.length;p++){var w=arguments[p]!=null?arguments[p]:{};p%2?j(Object(w),!0).forEach(function(_){ne(b,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(w)):j(Object(w)).forEach(function(_){Object.defineProperty(b,_,Object.getOwnPropertyDescriptor(w,_))})}return b}function ne(b,p,w){return(p=function(_){var K=function(re,ve){if(R(re)!=="object"||re===null)return re;var v=re[Symbol.toPrimitive];if(v!==void 0){var m=v.call(re,ve);if(R(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(_,"string");return R(K)==="symbol"?K:String(K)}(p))in b?Object.defineProperty(b,p,{value:w,enumerable:!0,configurable:!0,writable:!0}):b[p]=w,b}var ae={left:l().createElement("polyline",{points:"15 18 9 12 15 6"}),right:l().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:l().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:l().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:l().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:l().createElement(l().Fragment,null,l().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),l().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},qe={strokeWidth:1,viewBox:"0 0 24 24"},Ue=function(b){var p=$($({},qe),b),w=p.strokeWidth,_=p.viewBox,K=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:_,fill:"none",stroke:"currentColor",strokeWidth:w,strokeLinecap:"round",strokeLinejoin:"round"},ae[K])};Ue.propTypes={strokeWidth:k.number,viewBox:k.string,icon:(0,k.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Oe=Ue;var Re=l().memo(function(b){var p=b.isFullscreen,w=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:w,"aria-label":"Open Fullscreen"},l().createElement(Oe,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Re.displayName="Fullscreen",Re.propTypes={isFullscreen:k.bool.isRequired,onClick:k.func.isRequired};const tt=Re;var Ft=l().memo(function(b){var p=b.disabled,w=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:w,"aria-label":"Previous Slide"},l().createElement(Oe,{icon:"left",viewBox:"6 0 12 24"}))});Ft.displayName="LeftNav",Ft.propTypes={disabled:k.bool.isRequired,onClick:k.func.isRequired};const Yn=Ft;var Ut=l().memo(function(b){var p=b.disabled,w=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:w,"aria-label":"Next Slide"},l().createElement(Oe,{icon:"right",viewBox:"6 0 12 24"}))});Ut.displayName="RightNav",Ut.propTypes={disabled:k.bool.isRequired,onClick:k.func.isRequired};const ft=Ut;var Yt=l().memo(function(b){var p=b.isPlaying,w=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:w,"aria-label":"Play or Pause Slideshow"},l().createElement(Oe,{strokeWidth:2,icon:p?"pause":"play"}))});Yt.displayName="PlayPause",Yt.propTypes={isPlaying:k.bool.isRequired,onClick:k.func.isRequired};const Qt=Yt;function Et(b){return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},Et(b)}function pt(){return pt=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var w=arguments[p];for(var _ in w)Object.prototype.hasOwnProperty.call(w,_)&&(b[_]=w[_])}return b},pt.apply(this,arguments)}function Wt(b,p){var w=Object.keys(b);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(b);p&&(_=_.filter(function(K){return Object.getOwnPropertyDescriptor(b,K).enumerable})),w.push.apply(w,_)}return w}function An(b){for(var p=1;p<arguments.length;p++){var w=arguments[p]!=null?arguments[p]:{};p%2?Wt(Object(w),!0).forEach(function(_){Pn(b,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(w)):Wt(Object(w)).forEach(function(_){Object.defineProperty(b,_,Object.getOwnPropertyDescriptor(w,_))})}return b}function Pn(b,p,w){return(p=function(_){var K=function(re,ve){if(Et(re)!=="object"||re===null)return re;var v=re[Symbol.toPrimitive];if(v!==void 0){var m=v.call(re,ve);if(Et(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(_,"string");return Et(K)==="symbol"?K:String(K)}(p))in b?Object.defineProperty(b,p,{value:w,enumerable:!0,configurable:!0,writable:!0}):b[p]=w,b}var wr={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Qn=function(b){var p=An(An({},wr),b),w=p.children,_=p.className,K=Nn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",pt({},K,{className:_}),w)};Qn.propTypes={children:k.node.isRequired,className:k.string,delta:k.number,onSwiped:k.func,onSwiping:k.func};const Jn=Qn;function Ve(b){return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},Ve(b)}function Dn(b,p){var w=Object.keys(b);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(b);p&&(_=_.filter(function(K){return Object.getOwnPropertyDescriptor(b,K).enumerable})),w.push.apply(w,_)}return w}function yn(b){for(var p=1;p<arguments.length;p++){var w=arguments[p]!=null?arguments[p]:{};p%2?Dn(Object(w),!0).forEach(function(_){En(b,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(w)):Dn(Object(w)).forEach(function(_){Object.defineProperty(b,_,Object.getOwnPropertyDescriptor(w,_))})}return b}function Mn(b,p){for(var w=0;w<p.length;w++){var _=p[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(b,xn(_.key),_)}}function bn(b,p){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,_){return w.__proto__=_,w},bn(b,p)}function Zn(b,p){if(p&&(Ve(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Le(b)}function Le(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function Ot(b){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},Ot(b)}function En(b,p,w){return(p=xn(p))in b?Object.defineProperty(b,p,{value:w,enumerable:!0,configurable:!0,writable:!0}):b[p]=w,b}function xn(b){var p=function(w,_){if(Ve(w)!=="object"||w===null)return w;var K=w[Symbol.toPrimitive];if(K!==void 0){var re=K.call(w,_);if(Ve(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}(b,"string");return Ve(p)==="symbol"?p:String(p)}var Tr=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],lc=(0,k.arrayOf)((0,k.shape)({srcSet:k.string,media:k.string}));function Yo(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Jr=function(b){(function(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&bn(v,m)})(ve,b);var p,w,_,K,re=(_=ve,K=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var v,m=Ot(_);if(K){var C=Ot(this).constructor;v=Reflect.construct(m,arguments,C)}else v=m.apply(this,arguments);return Zn(this,v)});function ve(v){var m;return function(C,W){if(!(C instanceof W))throw new TypeError("Cannot call a class as a function")}(this,ve),En(Le(m=re.call(this,v)),"onBulletClick",function(C,W){var q=m.props,z=q.onBulletClick,de=q.items,ce=m.state.currentIndex;C.target.blur(),ce!==W&&(de.length===2?m.slideToIndexWithStyleReset(W,C):m.slideToIndex(W,C)),z&&z(C,W)}),m.state={currentIndex:v.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(v.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=l().createRef(),m.thumbnailsWrapper=l().createRef(),m.thumbnails=l().createRef(),m.imageGallerySlideWrapper=l().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(Le(m)),m.handleKeyDown=m.handleKeyDown.bind(Le(m)),m.handleMouseDown=m.handleMouseDown.bind(Le(m)),m.handleResize=m.handleResize.bind(Le(m)),m.handleTouchMove=m.handleTouchMove.bind(Le(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Le(m)),m.handleScreenChange=m.handleScreenChange.bind(Le(m)),m.handleSwiping=m.handleSwiping.bind(Le(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Le(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Le(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Le(m)),m.handleImageError=m.handleImageError.bind(Le(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Le(m)),m.renderThumbInner=m.renderThumbInner.bind(Le(m)),m.renderItem=m.renderItem.bind(Le(m)),m.slideLeft=m.slideLeft.bind(Le(m)),m.slideRight=m.slideRight.bind(Le(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Le(m)),m.togglePlay=m.togglePlay.bind(Le(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=xe(m.unthrottledSlideToIndex,v.slideDuration,{trailing:!1}),v.lazyLoad&&(m.lazyLoaded=[]),m}return p=ve,w=[{key:"componentDidMount",value:function(){var v=this.props,m=v.autoPlay,C=v.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(v,m){var C=this.props,W=C.items,q=C.lazyLoad,z=C.slideDuration,de=C.slideInterval,ce=C.startIndex,fe=C.thumbnailPosition,X=C.showThumbnails,Q=C.useWindowKeyDown,J=this.state,ie=J.currentIndex,pe=J.isPlaying,Se=v.items.length!==W.length,Be=!We()(v.items,W),mt=v.startIndex!==ce,ct=v.thumbnailPosition!==fe,Je=v.showThumbnails!==X;de===v.slideInterval&&z===v.slideDuration||pe&&(this.pause(),this.play()),ct&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Je&&X&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Je&&!X&&this.removeThumbnailsResizeObserver(),(Se||Je)&&this.handleResize(),m.currentIndex!==ie&&this.slideThumbnailBar(),v.slideDuration!==z&&(this.slideToIndex=xe(this.unthrottledSlideToIndex,z,{trailing:!1})),!q||v.lazyLoad&&!Be||(this.lazyLoaded=[]),Q!==v.useWindowKeyDown&&(Q?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(mt||Be)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var v=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),v?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var v=this,m=this.state,C=m.currentIndex,W=m.isTransitioning,q=this.props,z=q.onSlide,de=q.slideDuration;this.transitionTimer=window.setTimeout(function(){W&&(v.setState({isTransitioning:!W,isSwipingThumbnail:!1}),z&&z(C))},de+50)}},{key:"onThumbnailClick",value:function(v,m){var C=this.props,W=C.onThumbnailClick,q=C.items,z=this.state.currentIndex;v.target.parentNode.parentNode.blur(),z!==m&&(q.length===2?this.slideToIndexWithStyleReset(m,v):this.slideToIndex(m,v)),W&&W(v,m)}},{key:"onThumbnailMouseOver",value:function(v,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var v=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,v&&this.play()}}},{key:"setThumbsTranslate",value:function(v){this.setState({thumbsTranslate:v})}},{key:"setModalFullscreen",value:function(v){var m=this.props.onScreenChange;this.setState({modalFullscreen:v}),m&&m(v)}},{key:"getThumbsTranslate",value:function(v){var m,C=this.props,W=C.disableThumbnailScroll,q=C.items,z=this.state,de=z.thumbnailsWrapperWidth,ce=z.thumbnailsWrapperHeight,fe=this.thumbnails&&this.thumbnails.current;if(W)return 0;if(fe){if(this.isThumbnailVertical()){if(fe.scrollHeight<=ce)return 0;m=fe.scrollHeight-ce}else{if(fe.scrollWidth<=de||de<=0)return 0;m=fe.scrollWidth-de}return v*(m/(q.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(v){switch(v){case"left":v=" ".concat("image-gallery-thumbnails-left");break;case"right":v=" ".concat("image-gallery-thumbnails-right");break;case"bottom":v=" ".concat("image-gallery-thumbnails-bottom");break;case"top":v=" ".concat("image-gallery-thumbnails-top")}return v}},{key:"getAlignmentClassName",value:function(v){var m=this.state.currentIndex,C=this.props,W=C.infinite,q=C.items,z="",de="image-gallery-left",ce="image-gallery-right";switch(v){case m-1:z=" ".concat(de);break;case m:z=" ".concat("image-gallery-center");break;case m+1:z=" ".concat(ce)}return q.length>=3&&W&&(v===0&&m===q.length-1?z=" ".concat(ce):v===q.length-1&&m===0&&(z=" ".concat(de))),z}},{key:"getTranslateXForTwoSlide",value:function(v){var m=this.state,C=m.currentIndex,W=m.currentSlideOffset,q=m.previousIndex,z=C!==q,de=v===0&&q===0,ce=v===1&&q===1,fe=v===0&&C===1,X=v===1&&C===0,Q=W===0,J=-100*C+100*v+W;return W>0?this.direction="left":W<0&&(this.direction="right"),X&&W>0&&(J=-100+W),fe&&W<0&&(J=100+W),z?de&&Q&&this.direction==="left"?J=100:ce&&Q&&this.direction==="right"&&(J=-100):(X&&Q&&this.direction==="left"&&(J=-100),fe&&Q&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(v){var m=this.state,C=m.currentIndex,W=m.currentSlideOffset,q=m.slideStyle,z=this.props,de=z.infinite,ce=z.items,fe=z.useTranslate3D,X=z.isRTL,Q=-100*C,J=ce.length-1,ie=(Q+100*v)*(X?-1:1)+W;de&&ce.length>2&&(C===0&&v===J?ie=-100*(X?-1:1)+W:C===J&&v===0&&(ie=100*(X?-1:1)+W)),de&&ce.length===2&&(ie=this.getTranslateXForTwoSlide(v));var pe="translate(".concat(ie,"%, 0)");return fe&&(pe="translate3d(".concat(ie,"%, 0, 0)")),yn({display:this.isSlideVisible(v)?"inherit":"none",WebkitTransform:pe,MozTransform:pe,msTransform:pe,OTransform:pe,transform:pe},q)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var v,m=this.props,C=m.useTranslate3D,W=m.isRTL,q=this.state,z=q.thumbsTranslate,de=q.thumbsStyle,ce=W?-1*z:z;return this.isThumbnailVertical()?(v="translate(0, ".concat(z,"px)"),C&&(v="translate3d(0, ".concat(z,"px, 0)"))):(v="translate(".concat(ce,"px, 0)"),C&&(v="translate3d(".concat(ce,"px, 0, 0)"))),yn({WebkitTransform:v,MozTransform:v,msTransform:v,OTransform:v,transform:v},de)}},{key:"getSlideItems",value:function(){var v=this,m=this.state.currentIndex,C=this.props,W=C.items,q=C.slideOnThumbnailOver,z=C.onClick,de=C.lazyLoad,ce=C.onTouchMove,fe=C.onTouchEnd,X=C.onTouchStart,Q=C.onMouseOver,J=C.onMouseLeave,ie=C.renderItem,pe=C.renderThumbInner,Se=C.showThumbnails,Be=C.showBullets,mt=[],ct=[],Je=[];return W.forEach(function(Ae,we){var Jt=v.getAlignmentClassName(we),er=Ae.originalClass?" ".concat(Ae.originalClass):"",tr=Ae.thumbnailClass?" ".concat(Ae.thumbnailClass):"",$t=Ae.renderItem||ie||v.renderItem,Sn=Ae.renderThumbInner||pe||v.renderThumbInner,Nt=!de||Jt||v.lazyLoaded[we];Nt&&de&&!v.lazyLoaded[we]&&(v.lazyLoaded[we]=!0);var Bn=v.getSlideStyle(we),nr=l().createElement("div",{"aria-label":"Go to Slide ".concat(we+1),key:"slide-".concat(we),tabIndex:"-1",className:"image-gallery-slide ".concat(Jt," ").concat(er),style:Bn,onClick:z,onKeyUp:v.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:fe,onTouchStart:X,onMouseOver:Q,onFocus:Q,onMouseLeave:J,role:"button"},Nt?$t(Ae):l().createElement("div",{style:{height:"100%"}}));if(mt.push(nr),Se&&Ae.thumbnail){var Fn=f("image-gallery-thumbnail",tr,{active:m===we});ct.push(l().createElement("button",{key:"thumbnail-".concat(we),type:"button",tabIndex:"0","aria-pressed":m===we?"true":"false","aria-label":"Go to Slide ".concat(we+1),className:Fn,onMouseLeave:q?v.onThumbnailMouseLeave:null,onMouseOver:function(gt){return v.handleThumbnailMouseOver(gt,we)},onFocus:function(gt){return v.handleThumbnailMouseOver(gt,we)},onKeyUp:function(gt){return v.handleThumbnailKeyUp(gt,we)},onClick:function(gt){return v.onThumbnailClick(gt,we)}},Sn(Ae)))}if(Be){var rr=f("image-gallery-bullet",Ae.bulletClass,{active:m===we});Je.push(l().createElement("button",{type:"button",key:"bullet-".concat(we),className:rr,onClick:function(gt){return v.onBulletClick(gt,we)},"aria-pressed":m===we?"true":"false","aria-label":"Go to Slide ".concat(we+1)}))}}),{slides:mt,thumbnails:ct,bullets:Je}}},{key:"ignoreIsTransitioning",value:function(){var v=this.props.items,m=this.state,C=m.previousIndex,W=m.currentIndex,q=v.length-1;return Math.abs(C-W)>1&&!(C===0&&W===q)&&!(C===q&&W===0)}},{key:"isFirstOrLastSlide",value:function(v){return v===this.props.items.length-1||v===0}},{key:"slideIsTransitioning",value:function(v){var m=this.state,C=m.isTransitioning,W=m.previousIndex,q=m.currentIndex;return C&&!(v===W||v===q)}},{key:"isSlideVisible",value:function(v){return!this.slideIsTransitioning(v)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(v)}},{key:"slideThumbnailBar",value:function(){var v=this.state,m=v.currentIndex,C=v.isSwipingThumbnail,W=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:W,thumbsSwipedTranslate:W}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(v){var m=v.event,C=v.absX,W=v.dir,q=this.props,z=q.disableSwipe,de=q.stopPropagation,ce=this.state,fe=ce.galleryWidth,X=ce.isTransitioning,Q=ce.swipingUpDown,J=ce.swipingLeftRight;if(W!==kt&&W!==ht&&!Q||J){if(W!==Ke&&W!==lt||J||this.setState({swipingLeftRight:!0}),!z){var ie=this.props.swipingTransitionDuration;if(de&&m.preventDefault(),X)this.setState({currentSlideOffset:0});else{var pe=W===lt?1:-1,Se=C/fe*100;Math.abs(Se)>=100&&(Se=100);var Be={transition:"transform ".concat(ie,"ms ease-out")};this.setState({currentSlideOffset:pe*Se,slideStyle:Be})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(v){var m=v.event,C=v.absX,W=v.absY,q=v.dir,z=this.props,de=z.stopPropagation,ce=z.swipingThumbnailTransitionDuration,fe=this.state,X=fe.thumbsSwipedTranslate,Q=fe.thumbnailsWrapperHeight,J=fe.thumbnailsWrapperWidth,ie=fe.swipingUpDown,pe=fe.swipingLeftRight;if(this.isThumbnailVertical()){if((q===Ke||q===lt||pe)&&!ie)return void(pe||this.setState({swipingLeftRight:!0}));q!==kt&&q!==ht||ie||this.setState({swipingUpDown:!0})}else{if((q===kt||q===ht||ie)&&!pe)return void(ie||this.setState({swipingUpDown:!0}));q!==Ke&&q!==lt||pe||this.setState({swipingLeftRight:!0})}var Se,Be,mt,ct,Je,Ae=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(Se=X+(q===ht?W:-W),Be=Ae.scrollHeight-Q+20,mt=Math.abs(Se)>Be,ct=Se>20,Je=Ae.scrollHeight<=Q):(Se=X+(q===lt?C:-C),Be=Ae.scrollWidth-J+20,mt=Math.abs(Se)>Be,ct=Se>20,Je=Ae.scrollWidth<=J),!Je&&(q!==Ke&&q!==kt||!mt)&&(q!==lt&&q!==ht||!ct)){de&&m.stopPropagation();var we={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:Se,thumbsStyle:we})}}},{key:"handleOnThumbnailSwiped",value:function(){var v=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:v,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var v=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(v)>m}},{key:"resetSwipingDirection",value:function(){var v=this.state,m=v.swipingUpDown,C=v.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(v){var m=v.event,C=v.dir,W=v.velocity,q=this.props,z=q.disableSwipe,de=q.stopPropagation,ce=q.flickThreshold;if(!z){var fe=this.props.isRTL;de&&m.stopPropagation(),this.resetSwipingDirection();var X=(C===Ke?1:-1)*(fe?-1:1),Q=W>ce&&!(C===kt||C===ht);this.handleOnSwipedTo(X,Q)}}},{key:"handleOnSwipedTo",value:function(v,m){var C=this.state,W=C.currentIndex,q=C.isTransitioning,z=W;!this.sufficientSwipe()&&!m||q||(z+=v),(v===-1&&!this.canSlideLeft()||v===1&&!this.canSlideRight())&&(z=W),this.unthrottledSlideToIndex(z)}},{key:"handleTouchMove",value:function(v){this.state.swipingLeftRight&&v.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(v){var m=this.props,C=m.disableKeyDown,W=m.useBrowserFullscreen,q=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(v.keyCode||v.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(v);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(v);break;case 27:q&&!W&&this.exitFullScreen()}}},{key:"handleImageError",value:function(v){var m=this.props.onErrorImageURL;m&&v.target.src.indexOf(m)===-1&&(v.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var v=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(v)))}},{key:"initSlideWrapperResizeObserver",value:function(v){var m=this;v&&!v.current||(this.resizeSlideWrapperObserver=new mn(ee(function(C){C&&C.forEach(function(W){m.setState({thumbnailsWrapperWidth:W.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(v.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(v){var m=this;v&&!v.current||(this.resizeThumbnailWrapperObserver=new mn(ee(function(C){C&&C.forEach(function(W){m.setState({thumbnailsWrapperHeight:W.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(v.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var v=this.props,m=v.onScreenChange,C=v.useBrowserFullscreen,W=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,q=this.imageGallery.current===W;m&&m(q),C&&this.setState({isFullscreen:q})}},{key:"slideToIndex",value:function(v,m){var C=this.state,W=C.currentIndex,q=C.isTransitioning,z=this.props,de=z.items,ce=z.slideDuration,fe=z.onBeforeSlide;if(!q){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var X=de.length-1,Q=v;v<0?Q=X:v>X&&(Q=0),fe&&Q!==W&&fe(Q),this.setState({previousIndex:W,currentIndex:Q,isTransitioning:Q!==W,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(v){var m=this.props.isRTL;this.slideTo(v,m?"right":"left")}},{key:"slideRight",value:function(v){var m=this.props.isRTL;this.slideTo(v,m?"left":"right")}},{key:"slideTo",value:function(v,m){var C=this.state,W=C.currentIndex,q=C.isTransitioning,z=this.props.items,de=W+(m==="left"?-1:1);q||(z.length===2?this.slideToIndexWithStyleReset(de,v):this.slideToIndex(de,v))}},{key:"slideToIndexWithStyleReset",value:function(v,m){var C=this,W=this.state,q=W.currentIndex,z=W.currentSlideOffset;this.setState({currentSlideOffset:z+(q>v?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(v,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(v,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(v,m)}},{key:"handleThumbnailKeyUp",value:function(v,m){Yo(v)&&this.onThumbnailClick(v,m)}},{key:"handleSlideKeyUp",value:function(v){Yo(v)&&(0,this.props.onClick)(v)}},{key:"isThumbnailVertical",value:function(){var v=this.props.thumbnailPosition;return v==="left"||v==="right"}},{key:"addScreenChangeEvent",value:function(){var v=this;Tr.forEach(function(m){document.addEventListener(m,v.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var v=this;Tr.forEach(function(m){document.removeEventListener(m,v.handleScreenChange)})}},{key:"fullScreen",value:function(){var v=this.props.useBrowserFullscreen,m=this.imageGallery.current;v?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var v=this.state.isFullscreen,m=this.props.useBrowserFullscreen;v&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var v=this.props.infinite,m=this.state.currentIndex;v||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var v=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,W=m.slideInterval,q=m.slideDuration,z=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(W,q)),C&&v&&C(z))}},{key:"pause",value:function(){var v=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&v&&m(C))}},{key:"isImageLoaded",value:function(v){return!!this.loadedImages[v.original]||(this.loadedImages[v.original]=!0,!1)}},{key:"handleImageLoaded",value:function(v,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(v))}},{key:"renderItem",value:function(v){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return l().createElement(L,{description:v.description,fullscreen:v.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:v.original,originalAlt:v.originalAlt,originalHeight:v.originalHeight,originalWidth:v.originalWidth,originalTitle:v.originalTitle,sizes:v.sizes,loading:v.loading,srcSet:v.srcSet})}},{key:"renderThumbInner",value:function(v){var m=this.props.onThumbnailError||this.handleImageError;return l().createElement("span",{className:"image-gallery-thumbnail-inner"},l().createElement("img",{className:"image-gallery-thumbnail-image",src:v.thumbnail,height:v.thumbnailHeight,width:v.thumbnailWidth,alt:v.thumbnailAlt,title:v.thumbnailTitle,loading:v.thumbnailLoading,onError:m}),v.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},v.thumbnailLabel))}},{key:"render",value:function(){var v=this.state,m=v.currentIndex,C=v.isFullscreen,W=v.modalFullscreen,q=v.isPlaying,z=this.props,de=z.additionalClass,ce=z.disableThumbnailSwipe,fe=z.indexSeparator,X=z.isRTL,Q=z.items,J=z.thumbnailPosition,ie=z.renderFullscreenButton,pe=z.renderCustomControls,Se=z.renderLeftNav,Be=z.renderRightNav,mt=z.showBullets,ct=z.showFullscreenButton,Je=z.showIndex,Ae=z.showThumbnails,we=z.showNav,Jt=z.showPlayButton,er=z.renderPlayPauseButton,tr=this.getThumbnailStyle(),$t=this.getSlideItems(),Sn=$t.slides,Nt=$t.thumbnails,Bn=$t.bullets,nr=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":X}),Fn=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:nr},pe&&pe(),this.canSlide()?l().createElement(l().Fragment,null,we&&l().createElement(l().Fragment,null,Se(this.slideLeft,!this.canSlideLeft()),Be(this.slideRight,!this.canSlideRight())),l().createElement(Jn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},Sn))):l().createElement("div",{className:"image-gallery-slides"},Sn),Jt&&er(this.togglePlay,q),mt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},Bn)),ct&&ie(this.toggleFullScreen,C),Je&&l().createElement("div",{className:"image-gallery-index"},l().createElement("span",{className:"image-gallery-index-current"},m+1),l().createElement("span",{className:"image-gallery-index-separator"},fe),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),rr=f("image-gallery",de,{"fullscreen-modal":W}),gt=f("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:C}),uc=f("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(J),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&X},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ce},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ce});return l().createElement("div",{ref:this.imageGallery,className:rr,"aria-live":"polite"},l().createElement("div",{className:gt},(J==="bottom"||J==="right")&&Fn,Ae&&Nt.length>0?l().createElement(Jn,{className:uc,delta:0,onSwiping:!ce&&this.handleThumbnailSwiping,onSwiped:!ce&&this.handleOnThumbnailSwiped},l().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},l().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:tr,"aria-label":"Thumbnail Navigation"},Nt))):null,(J==="top"||J==="left")&&Fn))}}],w&&Mn(p.prototype,w),Object.defineProperty(p,"prototype",{writable:!1}),ve}(l().Component);Jr.propTypes={flickThreshold:k.number,items:(0,k.arrayOf)((0,k.shape)({bulletClass:k.string,bulletOnClick:k.func,description:k.string,original:k.string,originalHeight:k.number,originalWidth:k.number,loading:k.string,thumbnailHeight:k.number,thumbnailWidth:k.number,thumbnailLoading:k.string,fullscreen:k.string,originalAlt:k.string,originalTitle:k.string,thumbnail:k.string,thumbnailAlt:k.string,thumbnailLabel:k.string,thumbnailTitle:k.string,originalClass:k.string,thumbnailClass:k.string,renderItem:k.func,renderThumbInner:k.func,imageSet:lc,srcSet:k.string,sizes:k.string})).isRequired,showNav:k.bool,autoPlay:k.bool,lazyLoad:k.bool,infinite:k.bool,showIndex:k.bool,showBullets:k.bool,showThumbnails:k.bool,showPlayButton:k.bool,showFullscreenButton:k.bool,disableThumbnailScroll:k.bool,disableKeyDown:k.bool,disableSwipe:k.bool,disableThumbnailSwipe:k.bool,useBrowserFullscreen:k.bool,onErrorImageURL:k.string,indexSeparator:k.string,thumbnailPosition:(0,k.oneOf)(["top","bottom","left","right"]),startIndex:k.number,slideDuration:k.number,slideInterval:k.number,slideOnThumbnailOver:k.bool,swipeThreshold:k.number,swipingTransitionDuration:k.number,swipingThumbnailTransitionDuration:k.number,onSlide:k.func,onBeforeSlide:k.func,onScreenChange:k.func,onPause:k.func,onPlay:k.func,onClick:k.func,onImageLoad:k.func,onImageError:k.func,onTouchMove:k.func,onTouchEnd:k.func,onTouchStart:k.func,onMouseOver:k.func,onMouseLeave:k.func,onBulletClick:k.func,onThumbnailError:k.func,onThumbnailClick:k.func,renderCustomControls:k.func,renderLeftNav:k.func,renderRightNav:k.func,renderPlayPauseButton:k.func,renderFullscreenButton:k.func,renderItem:k.func,renderThumbInner:k.func,stopPropagation:k.bool,additionalClass:k.string,useTranslate3D:k.bool,isRTL:k.bool,useWindowKeyDown:k.bool},Jr.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(b,p){return l().createElement(Yn,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(ft,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Qt,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(tt,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const cc=Jr})(),a})())})(ql);var Nm=ql.exports;const Am=Yi(Nm);function Pm(){var e=new Map;function t(n){var r=n.root,i=n.rootMargin,s=n.threshold,a=e.get(r);a||(a=new Map,e.set(r,a));var c=JSON.stringify({rootMargin:i,threshold:s}),f=a.get(c);if(!f){var g=new Map,l=new IntersectionObserver(function(u){u.forEach(function(x){var y=g.get(x.target);y==null||y(x)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:g},a.set(c,f)}return{observe:function(x,y){var T,O;(T=f)==null||T.entryCallbacks.set(x,y),(O=f)==null||O.observer.observe(x)},unobserve:function(x){var y,T;(y=f)==null||y.entryCallbacks.delete(x),(T=f)==null||T.observer.unobserve(x)}}}return{getObserver:t}}var Dm="0px",Mm=[0],Bm=Pm();function Fm(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:Dm,i=(n=e==null?void 0:e.threshold)!=null?n:Mm,s=M.useRef(null),a=M.useRef(null),c=M.useRef(null),f=M.useState(),g=f[0],l=f[1],u=M.useCallback(function(){var O=s.current;if(!O){l(void 0);return}var N=Bm.getObserver({root:a.current,rootMargin:r,threshold:i});N.observe(O,function(D){l(D)}),c.current=N},[r,i]),x=M.useCallback(function(){var O=c.current,N=s.current;N&&(O==null||O.unobserve(N)),c.current=null},[]),y=M.useCallback(function(O){x(),s.current=O,u()},[u,x]),T=M.useCallback(function(O){x(),a.current=O,u()},[u,x]);return[y,{entry:g,rootRef:T}]}function zi(){return zi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zi.apply(this,arguments)}function Um(e){var t,n=Fm(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=M.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,zi({},i,{isVisible:s,wasEverVisible:c})]}var Wm=100;function $m(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?Wm:a,f=Um({rootMargin:i}),g=f[0],l=f[1],u=l.rootRef,x=l.isVisible,y=!s&&!t&&x&&n;return M.useEffect(function(){if(y){var T=setTimeout(function(){r()},c);return function(){clearTimeout(T)}}},[r,y,c]),[g,{rootRef:u}]}const zm={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},Km={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'};var di=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function hi(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function Vl(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function Hl(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function qm(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}var $o={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":di?173:189,"=":di?61:187,";":di?59:186,"'":222,"[":219,"]":221,"\\":220},on={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ki={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ze={16:!1,18:!1,17:!1,91:!1},$e={};for(var Cr=1;Cr<20;Cr++)$o["f".concat(Cr)]=111+Cr;var je=[],qs=!1,Gl="all",Xl=[],Qr=function(t){return $o[t.toLowerCase()]||on[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Yl(e){Gl=e||"all"}function yr(){return Gl||"all"}function Vm(){return je.slice(0)}function Hm(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function Gm(e){return typeof e=="string"&&(e=Qr(e)),je.indexOf(e)!==-1}function Xm(e,t){var n,r;e||(e=yr());for(var i in $e)if(Object.prototype.hasOwnProperty.call($e,i))for(n=$e[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;yr()===e&&Yl(t||"all")}function Ym(e){var t=e.keyCode||e.which||e.charCode,n=je.indexOf(t);if(n>=0&&je.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&je.splice(0,je.length),(t===93||t===224)&&(t=91),t in Ze){Ze[t]=!1;for(var r in on)on[r]===t&&(bt[r]=!1)}}function Qm(e){if(typeof e>"u")Object.keys($e).forEach(function(a){return delete $e[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&fi(a)});else if(typeof e=="object")e.key&&fi(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],s=n[1];typeof i=="function"&&(s=i,i=""),fi({key:e,scope:i,method:s,splitKey:"+"})}}var fi=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=Hl(n);c.forEach(function(f){var g=f.split(a),l=g.length,u=g[l-1],x=u==="*"?"*":Qr(u);if($e[x]){r||(r=yr());var y=l>1?Vl(on,g):[];$e[x]=$e[x].filter(function(T){var O=i?T.method===i:!0;return!(O&&T.scope===r&&qm(T.mods,y))})}})};function Vs(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var s in Ze)Object.prototype.hasOwnProperty.call(Ze,s)&&(!Ze[s]&&t.mods.indexOf(+s)>-1||Ze[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!Ze[16]&&!Ze[18]&&!Ze[17]&&!Ze[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function Hs(e,t){var n=$e["*"],r=e.keyCode||e.which||e.charCode;if(bt.filter.call(this,e)){if((r===93||r===224)&&(r=91),je.indexOf(r)===-1&&r!==229&&je.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(T){var O=Ki[T];e[T]&&je.indexOf(O)===-1?je.push(O):!e[T]&&je.indexOf(O)>-1?je.splice(je.indexOf(O),1):T==="metaKey"&&e[T]&&je.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(je=je.slice(je.indexOf(O))))}),r in Ze){Ze[r]=!0;for(var i in on)on[i]===r&&(bt[i]=!0);if(!n)return}for(var s in Ze)Object.prototype.hasOwnProperty.call(Ze,s)&&(Ze[s]=e[Ki[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(je.indexOf(17)===-1&&je.push(17),je.indexOf(18)===-1&&je.push(18),Ze[17]=!0,Ze[18]=!0);var a=yr();if(n)for(var c=0;c<n.length;c++)n[c].scope===a&&(e.type==="keydown"&&n[c].keydown||e.type==="keyup"&&n[c].keyup)&&Vs(e,n[c],a,t);if(r in $e){for(var f=0;f<$e[r].length;f++)if((e.type==="keydown"&&$e[r][f].keydown||e.type==="keyup"&&$e[r][f].keyup)&&$e[r][f].key){for(var g=$e[r][f],l=g.splitKey,u=g.key.split(l),x=[],y=0;y<u.length;y++)x.push(Qr(u[y]));x.sort().join("")===je.sort().join("")&&Vs(e,g,a,t)}}}}function Jm(e){return Xl.indexOf(e)>-1}function bt(e,t,n){je=[];var r=Hl(e),i=[],s="all",a=document,c=0,f=!1,g=!0,l="+",u=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(g=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(l=t.splitKey)),typeof t=="string"&&(s=t);c<r.length;c++)e=r[c].split(l),i=[],e.length>1&&(i=Vl(on,e)),e=e[e.length-1],e=e==="*"?"*":Qr(e),e in $e||($e[e]=[]),$e[e].push({keyup:f,keydown:g,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Jm(a)&&window&&(Xl.push(a),hi(a,"keydown",function(x){Hs(x,a)},u),qs||(qs=!0,hi(window,"focus",function(){je=[]},u)),hi(a,"keyup",function(x){Hs(x,a),Ym(x)},u))}function Zm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys($e).forEach(function(n){var r=$e[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var pi={setScope:Yl,getScope:yr,deleteScope:Xm,getPressedKeyCodes:Vm,isPressed:Gm,filter:Hm,trigger:Zm,unbind:Qm,keyMap:$o,modifier:on,modifierMap:Ki};for(var mi in pi)Object.prototype.hasOwnProperty.call(pi,mi)&&(bt[mi]=pi[mi]);if(typeof window<"u"){var eg=window.hotkeys;bt.noConflict=function(e){return e&&window.hotkeys===bt&&(window.hotkeys=eg),bt},window.hotkeys=bt}bt.filter=function(){return!0};var Ql=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},tg=function(t){return Ql(t,["INPUT","TEXTAREA","SELECT"])};function ng(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,c=i.keyup,f=i.keydown,g=i.filterPreventDefault,l=g===void 0?!0:g,u=i.enabled,x=u===void 0?!0:u,y=i.enableOnContentEditable,T=y===void 0?!1:y,O=M.useRef(null),N=M.useCallback(function(D,P){var F,V;return a&&!a(D)?!l:tg(D)&&!Ql(D,s)||(F=D.target)!=null&&F.isContentEditable&&!T?!0:O.current===null||document.activeElement===O.current||(V=O.current)!=null&&V.contains(document.activeElement)?(t(D,P),!0):!1},r?[O,s,a].concat(r):[O,s,a]);return M.useEffect(function(){if(!x){bt.unbind(e,N);return}return c&&f!==!0&&(n.keydown=!1),bt(e,n||{},N),function(){return bt.unbind(e,N)}},[N,e,x]),O}bt.isPressed;const Jl=M.createContext({open:!1,toggleOpen:e=>{}});function rg({children:e}){const[t,n]=M.useState(!1),r=s=>{n(s??!s)},i=M.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(Jl.Provider,{value:i,children:e})}function zo(){return M.useContext(Jl)}const wt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},ig=e=>Sr(async()=>{const{data:t}=await e.get(wt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function og(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...ou(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:i=c=>{t.onFilterChange({...n,keyword:c.title})},emptyCategory:s}=t;!n.category&&!s&&(n.category="All");const a=c=>{const f={...n,...c};r(ti(f,g=>g===""||g===void 0))};return{filters:e,cleanFilter:c=>{const f=c?ti(n,(g,l)=>c.includes(l)):{};r(ti(f,g=>g===""||g===void 0))},handleActiveMenu:c=>{c!==e.menu&&r({menu:c})},handleSort:(c,f)=>{a({sortBy:c,sortDirection:f||c==="nameAsc"?"asc":"desc"})},handleKeyword:c=>{a({category:void 0,keyword:c||void 0})},handlePrice:c=>{a({price:c===e.price?void 0:c})},handleCategory:c=>{a({category:c===e.category?"":c})},handleDeveloper:c=>{a({owner:c||void 0})},handlePage:c=>{a({currentPage:c})},handleSwitchShowResources:c=>{a({showResources:c})},handleSearchSelect:c=>{i(c)}}}const sg=(e,t,n)=>e&&t||!n,Zl=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ec=(e,t,n)=>{var r,i;const s=su(e),a=au(s.search);if((r=lu(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?cu({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:g}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return to(e,{...f||g?{imageFilter:"resize",w:f,h:g}:{},v:c})},ag=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],lg=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),cg=e=>{var t,n;return Array.isArray(e)?e.map(r=>r.message).join(`
486
+ `):(n=(t=e.response)==null?void 0:t.data)!=null&&n.error?e.response.data.error.message||e.response.data.error:e.message||e},ug=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),dg=()=>window.innerWidth<=600,hg={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later",searchPlaceholder:"Search blocklet"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},fg={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试",searchPlaceholder:"搜索 Blocklet"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},gi={en:ns(hg),zh:ns(fg)},tc=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},pg=e=>(t,n)=>{const r=gi[e]?gi[e][t]:gi.en[t];return ug(r,n)||t},nc={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!1,endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},rc=M.createContext(nc),{Provider:mg,Consumer:$v}=rc;function gg(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=xe=>xe,extraFilter:g=xe=>xe,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:x=!1,showCategory:y=!0,tagFilters:T=[],children:O,storeVersion:N,onSearchSelect:D=()=>{},endpoint:P,blockletRender:F,compact:V=!1}=e,I=tc(r,N),B=M.useMemo(()=>Kl({baseURL:P,headers:I}),[P]),H=og(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:D}),[U,le]=M.useState(""),{data:G=[],error:se,loading:Ie,run:Ge}=ig(B),ze=M.useMemo(()=>{const xe=iu(G,[We=>We.name],["asc"]),oe=xe.findIndex(We=>We.name==="All"||We.locales.en==="All");return oe>-1?[{...xe[oe],_id:"All"},...xe.slice(0,oe),...xe.slice(oe+1)]:xe},[G]),it=M.useCallback(pg(t),[t]),Z=M.useMemo(()=>lg(ze,t),[ze,t]),me=ag(it),ee={search:H,compact:V,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:Ie},extraFilter:g,endpoint:P,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:it,storeVersion:N,serverVersion:r,selectedCategory:H.filters.category||(c.showExplore?"":"All"),categoryList:ze,blockletRender:F,locale:t,categoryOptions:Z,priceOptions:me,storeApi:B,baseSearch:l,showResourcesSwitch:x,showCategory:y,tagFilters:T,onFilterChange:i,getCategoryLocale:xe=>{if(!xe)return null;const oe=G.find(We=>We._id===xe||We.locales.en==="All");return oe?oe.locales[t]||oe.locales.en:null},get developerName(){return U},updateDeveloperName:le};return M.useEffect(()=>{setTimeout(Ge,u||0)},[P,Ge,u]),o.jsx(mg,{value:ee,children:O})}function dt(){return M.useContext(rc)||nc}function ic({children:e,onClick:t,size:n=32,...r}){return o.jsx(Er,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function kr(e,t){return e===void 0?t:e}function Ko({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=Vn(),c=rn(a.breakpoints.down("sm")),f=rn(a.breakpoints.between("sm","md")),g=rn(a.breakpoints.between("md","lg")),l=rn(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:g?n||null:l?r||null:i||null;let u=e;return c||(u=kr(t,u),f)||(u=kr(n,u),g)||(u=kr(r,u),l)?u:kr(i,u)}function vg({children:e}){const{open:t,toggleOpen:n}=zo();return o.jsx(Ko,{xs:o.jsx(Tc,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const yg=M.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(Er,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(Ct,{size:"1em"})}));function qi({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=M.useRef(null),c=Vn(),[f,g]=M.useState(!1),[l,u]=M.useState(e!==null?e:""),x=rn(c.breakpoints.down("sm"));M.useEffect(()=>{u(e!==null?e:"")},[e]);const y=M.useCallback(()=>{g(!1)},[]),T=M.useCallback(()=>{g(!0)},[]);function O(D){u(D.value),n(D.value),x&&y()}function N(D){return D===l}return o.jsxs(o.Fragment,{children:[o.jsxs(bg,{ref:a,onClick:T,variant:"outlined",size:"medium",className:["my-select__selector",cr(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(D=>D.value===l))==null?void 0:s.name)||r,o.jsx(Oc,{className:"my-select__arrowdown",component:Xc,sx:{width:18,height:18}})]}),o.jsx(_c,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:D,placement:P})=>o.jsx(Rc,{...D,style:{transformOrigin:P==="bottom"?"center top":"center bottom"},children:o.jsx(Ic,{children:o.jsx(Cc,{onClickAway:y,children:o.jsx(Eg,{autoFocusItem:f,onMouseEnter:T,onMouseLeave:y,children:t.map(F=>o.jsxs(Xi,{onClick:()=>O(F),sx:{fontSize:14},children:[o.jsx(ba,{sx:{mr:1,fontSize:16,visibility:N(F.value)?"visible":"hidden"}}),F.name]},F.value))})})})})})]})}const bg=sn(yg)`
487
+ border: 1px solid #f0f0f0;
488
+ padding: 6px 8px 6px 12px;
489
+ font-weight: ${e=>e.theme.typography.fontWeightRegular};
490
+ font-size: 14px;
491
+ color: #666;
492
+ line-height: 1;
493
+ text-transform: none;
494
+ & + & {
495
+ margin-left: 10px;
496
+ }
497
+ &.my-select__selector--active {
498
+ &,
499
+ .my-select__arrowdown,
500
+ }
501
+ .my-select__arrowdown {
502
+ color: #999;
503
+ font-size: 14px;
504
+ margin-left: 6px;
505
+ }
506
+ .my-select__icon {
507
+ font-size: 0;
508
+ svg {
509
+ color: #999;
510
+ font-size: 18px;
511
+ margin-right: 3px;
512
+ }
513
+ }
514
+ `,Eg=sn(ua)`
515
+ .my-select__option__icon {
516
+ color: transparent;
517
+ font-size: 14px;
518
+ margin: 0 3px 0 -5px;
519
+ }
520
+ .my-select__option {
521
+ font-size: 14px;
522
+ color: #999;
523
+ }
524
+ .my-select__option--active {
525
+ &,
526
+ .my-select__option__icon {
527
+ color: ${e=>e.theme.palette.primary.main};
528
+ }
529
+ }
530
+ `;function oc(){const{search:e,t}=dt(),{filters:n,handleSort:r,handlePrice:i}=e,s=Zl(t);return o.jsxs(ut,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[o.jsx(Hi,{control:o.jsx(Gi,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(qi,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function xg({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=dt(),{filters:g,handleActiveMenu:l,handleCategory:u,cleanFilter:x}=n,{toggleOpen:y}=zo();M.useEffect(()=>{y(!1)},[Object.values(g).join("")]);const T=sg(c,a.showSearch,g.keyword);return a.showCategory&&!f?o.jsxs(vg,{children:[o.jsx(Ko,{xs:o.jsxs(ut,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(ic,{onClick:()=>y(!1),children:o.jsx(eo,{})}),o.jsx(ye,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(ut,{visibility:s.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:T?o.jsxs(o.Fragment,{children:[a.showExplore&&o.jsxs(Y,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[o.jsxs(Y,{display:"flex",alignItems:"center",gap:1,children:[o.jsx(vr,{icon:Wf,width:20,height:20}),o.jsx(ye,{variant:"body1",color:!t&&!g.menu?"text.primary":"text.lighter",fontWeight:!t&&!g.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{y(!1),x()},children:r("explore.title")})]}),e==null?void 0:e.map(O=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof O.icon=="string"?o.jsx(vr,{icon:O.icon,width:20,height:20}):O.icon,o.jsx(ye,{variant:"body1",color:g.menu===O.key?"text.primary":"text.lighter",fontWeight:g.menu===O.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var N;y(!1),l(O.key),(N=O.onClick)==null||N.call(O)},children:O.title})]},O.key))]}),!!i.length&&o.jsx(ut,{gap:2,children:i.map(O=>o.jsx(ye,{variant:"body1",title:O.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===O.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{t===O.value?x():u(O.value),y(!1)},children:O.name},O.value))})]}):o.jsx(oc,{})})]}):null}function qo(){const{endpoint:e,serverVersion:t,storeVersion:n}=dt(),r=tc(t,n),i=M.useMemo(()=>Kl({baseURL:e,headers:r}),[e]);return{get:async s=>{const{data:a}=await i.get(s);return a},post:async(s,a)=>{const{data:c}=await i.post(s,a);return c}}}const sc=M.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(Ct,{})})});function Gs({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(ut,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ye,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Sg=16/9,vi=292,Vi=189,Ur=336;function wg(){var e,t;const{t:n,search:r}=dt(),{get:i}=qo(),s=Vn(),a=rn(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:g,loading:l}=Sr(async()=>{const D=await i(to(wt.blockletsPath,{didList:c.map(P=>P.did).join(",")}));return D!=null&&D.dataList?c.map(P=>D.dataList.find(F=>F.did===P.did)):[]});g&&console.error("Get Banner Blocklets error:",g);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!g&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ye,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:vi},minHeight:vi,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:l?o.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[o.jsx(en,{variant:"rounded",height:Vi,width:Ur}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(en,{variant:"text",height:50,width:100}),o.jsx(en,{variant:"text",height:40,width:"100%"}),o.jsx(en,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(en,{variant:"circular",height:20,width:20}),o.jsx(en,{variant:"text",height:20,width:50})]}),o.jsx(en,{variant:"rounded",height:30,width:100})]})]}):o.jsx(Am,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(Qu,{sx:{...u,left:5}})}),renderRightNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(Ju,{sx:{...u,right:5}})}),items:c.map((D,P)=>({original:D.did,renderItem:()=>{var F;const V=f[P]||{},I=D.cover||Og(D.did,(F=V.screenshots)==null?void 0:F[0]),B=ec(I,s.breakpoints.values.md*2);return o.jsxs(ut,{height:{xs:"auto",md:vi},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${B}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(V),gap:{xs:2,md:5},children:[x(B),o.jsxs(ut,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[y(D.name||V.title||D.name),T(D.desc||V.description)]}),V.did&&O(V,D.baseNum),N(V)]})]})}}))})})]}):null;function x(D){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Ur},children:o.jsx(_g,{url:D})})}function y(D){return o.jsx(ye,{variant:"h2",width:"100%",children:D})}function T(D){return o.jsx(ye,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:D})}function O(D,P=0){const{did:F,owner:V,stats:I}=D;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(Gs,{icon:o.jsx(Mr,{src:V.avatar,did:F,size:20,variant:"circle"}),children:V.fullName}),o.jsx(Gs,{icon:o.jsx(vr,{icon:El}),title:`${I.downloads+P}`,children:Tg(I.downloads+P)})]})}function N(D){return o.jsx(Er,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(D),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Tg=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,Og=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function _g({url:e}){const[t,n]=M.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(en,{variant:"rectangular",sx:{width:{xs:"100%",md:Ur},height:{xs:"auto",md:Vi}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Ur},height:{xs:"auto",md:Vi},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Sg},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Rg({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=dt();return o.jsxs(Y,{mt:3,children:[o.jsx(ye,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(Jo,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(Jo,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":i.did,children:o.jsx(Y,{padding:"1px",children:n({blocklet:i,blocklets:t,serverVersion:r})})},i.did))})]})}function Ig(){const{get:e}=qo(),{t}=dt(),{data:n=[],error:r,loading:i}=Sr(async()=>{const s=await e(wt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx($r,{error:new Error(`Failed to fetch blocklets from ${wt.explorePath}`)}):i?o.jsx(sc,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(wg,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(Rg,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const yi="__FREE_TEXT__",Xs="__NO_RESULT__",bi=40;function Cg({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=M.useRef(null),f=M.useRef(!1),[g,l]=M.useState(!1),[u,x]=M.useState(""),[y,T]=M.useState(!1),O=qo(),[N,D]=M.useState(!1),P=(a==null?void 0:a.placeholder)||t("common.searchStore"),F=async Z=>{D(!0);const me=await O.get(Kn(e,to(wt.blockletsPath,Z)));return D(!1),me.dataList||[]},{data:V,run:I}=Sr(Z=>Z?F({sortBy:wt.nameDesc,page:1,pageSize:10,keyword:Z,showResources:"true"}):Promise.resolve([]),{manual:!0});M.useEffect(()=>{D(!0),I(r.keyword),x(r.keyword||"")},[r.keyword,I]),ng("ctrl + k, command + k",Z=>{var me,ee;return Z.stopPropagation(),Z.preventDefault(),(ee=(me=c.current)==null?void 0:me.querySelector("input"))==null||ee.focus(),!1},{enableOnTags:["INPUT"]});const B=Ta(Z=>I(Z),{wait:300}),H={name:yi,title:u,did:""};let U=[];return u&&(N?U=[H]:V!=null&&V.length?U=[H,...V]:U=[{name:Xs,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(kc,{fullScreen:!0,open:y,sx:{display:{md:"none"}},children:[o.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[o.jsx(da,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:P,className:"bl-autocomplete-input",value:u,onChange:Z=>le(Z.target.value),startAdornment:ze(y),endAdornment:it()}),o.jsx(Er,{variant:"outlined",onClick:()=>{T(!1),x(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(ua,{sx:{p:.5},children:U.map(Z=>Ie(Z))})]}),o.jsx(Nr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>T(!0)}),o.jsx(ia,{ref:c,open:!!u&&g,size:"small",onOpen:()=>l(!0),onClose:(Z,me)=>{l(!1),me==="selectOption"&&!f.current&&i(u)},onKeyDown:Z=>{Z.key==="Enter"&&!u&&G()},disableClearable:!0,inputValue:u,onInputChange:(Z,me)=>le(me),isOptionEqualToValue:(Z,me)=>Z.name===me.name,getOptionLabel:Z=>Z.title,getOptionKey:Z=>Z.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:Z=>o.jsx(Wr,{...Z,InputProps:{...Z.InputProps,autoFocus:!0,placeholder:P,className:"bl-autocomplete-input",value:u,startAdornment:ze(g),endAdornment:it()}}),filterOptions:Z=>Z,...a,options:U,renderOption:(Z,me)=>Ie(me),value:H,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(a.sx)?a.sx:[a.sx]]})]});function le(Z){D(!0),x(Z),f.current=!1,B.run(Z)}function G(){T(!1),x(""),le(""),i("")}function se(Z){Z!=null&&Z.did?(T(!1),f.current=!0,x(""),s(Z)):Z.name===yi&&(T(!1),i(u))}function Ie(Z){var me,ee;return o.jsxs(Xi,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(Z),children:[Ge(Z),o.jsxs(ye,{variant:"body1",children:[o.jsx(ye,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Z.title}),o.jsx(ye,{sx:{color:"text.lighter"},fontSize:"13px",children:((ee=(me=Z.category)==null?void 0:me.locales)==null?void 0:ee[n||"en"])||""})]})]},Z.did)}function Ge(Z){if([yi,Xs].includes(Z.name))return o.jsx(Y,{width:bi,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:o.jsx(Nr,{sx:{fontSize:28}})});let me="";return Z.logo&&(me=Kn(e,"assets",Z.did,ec(Z.logo,bi,Z.version))),o.jsx(Mr,{src:me,size:bi,style:{borderRadius:"8px",overflow:"hidden"}})}function ze(Z=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:Z&&u&&N?o.jsx(Ct,{color:"inherit",size:16}):o.jsx(Nr,{sx:{fontSize:16,cursor:"default"}})})}function it(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:o.jsx(eo,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>G()})}):null}}function kg({placeholder:e,...t}){const{search:n,t:r}=dt(),{filters:i,handleKeyword:s}=n,[a,c]=M.useState(i.keyword||""),f=Ta(s,{wait:300}),g=x=>{const{value:y}=x.target;c(y),f.run(y)},l=()=>{c(""),s("")};M.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(Lg,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(es,{position:"start",children:o.jsx(jg,{sx:{fontSize:18,ml:-.5}})}),onChange:g,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(es,{position:"end",children:o.jsx(Ng,{"data-cy":"search-delete",onClick:l})}),...t})}const Lg=sn(da)`
531
+ background-color: ${e=>e.theme.palette.grey[50]};
532
+ font-size: 14px;
533
+ border-radius: 6px;
534
+ width: 100%;
535
+ .MuiInputBase-input {
536
+ padding: 8px 0 8px 0px;
537
+ }
538
+ .MuiOutlinedInput-notchedOutline {
539
+ border: none;
540
+ }
541
+ .Mui-focused {
542
+ background-color: #f6f6f6;
543
+ .MuiInputBase-input::placeholder {
544
+ color: transparent;
545
+ }
546
+ }
547
+ `,jg=sn(Nr)`
548
+ color: ${e=>e.theme.palette.grey[500]};
549
+ `,Ng=sn(eo)`
550
+ color: ${e=>e.theme.palette.grey[500]};
551
+ font-size: 16px;
552
+ cursor: pointer;
553
+ `;function Ag(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:g,categoryOptions:l,compact:u}=dt(),{filters:x,handleSort:y,handlePrice:T,handleDeveloper:O,handleSwitchShowResources:N,cleanFilter:D,handleCategory:P}=t,F=Zl(n);return o.jsxs(ut,{position:"sticky",top:0,zIndex:1e3,className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:u?2:3,sx:{backgroundColor:"background.default"},children:[!u&&o.jsx(ye,{variant:"h2",textTransform:"capitalize",children:s(x.category)}),o.jsxs(ut,{flex:1,direction:"row",alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2,children:[f.showSearch?o.jsx(Y,{flex:1,flexBasis:{xs:"100%",md:"auto"},children:g?o.jsx(kg,{}):o.jsx(Cg,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:t.filters,handleKeyword:t.handleKeyword,handleSearchSelect:t.handleSearchSelect})}):null,x.owner&&a&&o.jsx(Zo,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>O("")}),x.resourceDid&&x.resourceBlocklet&&o.jsx(Zo,{label:n("blocklet.resourceTag",{name:x.resourceBlocklet}),size:"small",onDelete:()=>D(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(Ys,{checked:x.showResources!=="false",onChange:V=>N(V?"true":"false"),label:n("common.showResources")}):null,o.jsx(Ys,{checked:x.price==="free",onChange:V=>T(V?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(qi,{value:x.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:V=>P(V)})}),o.jsx(qi,{value:x.sortBy||F[0].value,options:F,placeholder:n("sort.sort"),onChange:V=>y(V)})]})]})}function Ys({checked:e,onChange:t,label:n}){return o.jsx(Hi,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Gi,{checked:e,icon:o.jsx(vr,{style:{padding:0},icon:zm}),checkedIcon:o.jsx(vr,{style:{padding:0,color:"#3478E2"},icon:Km}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function Lr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[o.jsx(Kc,{}),e]})}function Qs(){const{t:e}=dt();return o.jsx(ye,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Ei({filterTip:e,keywordTip:t}){const{t:n,locale:r}=dt(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ye,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ye,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ye,{children:n("blocklet.keywordTip")})]})}function xi({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ye,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ye,{children:e}),o.jsx(ye,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ye,{children:[t," "]})]})}function Pg(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=dt(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(Lr,{children:[o.jsx(xi,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(Ei,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(Lr,{children:[o.jsx(xi,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(Ei,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(Lr,{children:[a?o.jsx(xi,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(Qs,{}),o.jsx(Ei,{filterTip:!0})]})}return o.jsx(Lr,{children:o.jsx(Qs,{})})}const Dg=(e,t,n,r)=>Du(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:wt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(wt.blockletsPath,{params:c});return n.currentPage++,{page:s,pageSize:a,list:(f==null?void 0:f.dataList)||[],total:(f==null?void 0:f.total)||0}},{isNoMore:i=>i?i.page*i.pageSize>=i.total:!1,reloadDeps:[e,va(t)],onError:r});function Mg(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=dt(),{filters:a}=n,c=Pu({currentPage:wt.currentPage,pageSize:dg()?wt.mobilePageSize:wt.pageSize,defaultCurrentPage:wt.defaultCurrentPage}),[f,g]=M.useState(null),l=Dg(t,a,c,g),u=M.useMemo(()=>{var x,y;return r?r(((x=l.data)==null?void 0:x.list)||[]):((y=l.data)==null?void 0:y.list)||[]},[l.data,r]);return M.useEffect(()=>{const x=u.find(y=>y.owner.did===a.owner);s((x==null?void 0:x.owner.fullName)||(x==null?void 0:x.author.name)||"")},[a.owner,u,s]),{blocklets:u,fetchBlockletsError:f,loadMore:l.loadMore,hasNextPage:!l.noMore,total:((e=l.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:l.loading,loadingMore:l.loadingMore},errors:{...i,fetchBlockletsError:f}}}function Bg(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=dt(),{filters:g}=t,{blocklets:l,errors:u,loadMore:x,loadings:y,hasNextPage:T,total:O}=Mg(),[N]=$m({loading:y.fetchBlockletsLoading||y.loadingMore,hasNextPage:T,onLoadMore:x});if(u.fetchBlockletsError){const V=new Error(`Failed to fetch blocklets from ${n}: ${cg(u.fetchBlockletsError)}`);return o.jsx($r,{error:V})}const D=c&&a.showSearch||!g.keyword;return o.jsxs(o.Fragment,{children:[D?o.jsx(Ag,{}):o.jsxs(o.Fragment,{children:[o.jsx(Ko,{xs:o.jsx(oc,{}),md:null}),F()]}),P(),!y.fetchBlockletsLoading&&T&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:N,children:o.jsx(Ct,{})})]});function P(){return y.fetchBlockletsLoading?o.jsx(sc,{mt:15}):l.length?o.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${s}px, 1fr))`},p:"2px",rowGap:2,columnGap:f?0:2,children:l.map(V=>o.jsx(Y,{"data-blocklet-did":V.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:V,blocklets:l,serverVersion:i})},V.did))}):o.jsx(Pg,{})}function F(){return o.jsxs(ut,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ye,{variant:"h3",title:g.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:g.keyword})}),o.jsx(ye,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:O})})]})}}function Fg(){const{t:e,selectedCategory:t,getCategoryLocale:n}=dt(),{toggleOpen:r}=zo();return o.jsxs(ye,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(ic,{onClick:()=>r(!0),children:o.jsx(Gc,{})}),n(t)||e("common.category")]})}function Ug({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=dt(),{filters:a}=r,c=M.useRef(null),f=a.category||a.keyword||a.price,g=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(rg,{children:o.jsxs(ya,{FallbackComponent:$r,children:[!s&&o.jsx(Fg,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(xg,{menus:e}),o.jsxs(ut,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[g&&(t==null?void 0:t(g)),!g&&(i.showExplore&&!f?o.jsx(Ig,{}):o.jsx(Bg,{}))]})]})]})})}function Wg(e){const{menus:t,children:n,...r}=e,i=Vn(),s=wc(ru({...i,typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return o.jsx(ca,{theme:s,children:o.jsx(gg,{...r,children:o.jsx(Ug,{menus:t,children:n})})})}const $g={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},zg={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},Kg={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},qg=Kg,Vg={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},Hg=(e,t)=>!t||!e?!0:wi.satisfies(wi.coerce(e),t);function Vo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=Tt();return Hg(t,n)?e:o.jsx(la,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ye,{children:o.jsx(Er,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}Vo.propTypes={children:A.node.isRequired,serverVersion:A.string,requirementVersion:A.string};Vo.defaultProps={serverVersion:"",requirementVersion:""};const lr=getComputedStyle(document.documentElement),Gg=qc({palette:{storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:lr.getPropertyValue("--stroke-sep").trim()||"#F4F4F5",text:{primary:lr.getPropertyValue("--foregrounds-fg-base").trim()||"#18181B",secondary:lr.getPropertyValue("--foregrounds-fg-subtle").trim()||"#71717B",disabled:"#D4D4D8",lighter:lr.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:lr.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{button:{textTransform:"none"},allVariants:{textTransform:"none"},h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),Xg=(e,t)=>Kn(t,`/blocklets/${e.did}`),Js=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Yg=e=>e.inStore&&Vt.isFreeBlocklet(e)===!1;function Ho({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var N,D;const{t:s}=Tt();let a=Kn(r,bu(e.did,e.logo||""));try{const P=new URL(a);P.searchParams.set("v",e.version||+new Date),a=P.href}catch{}const[c,f]=M.useState(!1),g=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(P){Zi.error(P.message)}finally{f(!1)}},{blocklet:l}=zr(),u=()=>((l==null?void 0:l.children)||[]).find(V=>V.meta.bundleDid===e.did).meta.version,y=(()=>{const P=((l==null?void 0:l.children)||[]).find(F=>F.meta.bundleDid===e.did);if(P){try{const F=P.meta.version,V=e.version;if(wi.gt(V,F))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),T=(N=e.requirements)==null?void 0:N.server,O=[];return y==="upgrade"?O.push({key:"upgrade",icon:o.jsx(St,{icon:Vg,color:"success.light",width:20,height:20},"version"),title:`${u()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:o.jsx(Y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):y==="disable"?O.push({key:"disable",icon:o.jsx(St,{icon:$g,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Yg(e)&&O.push({key:"purchase",icon:o.jsx(St,{icon:zg,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(Qg,{title:Js({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Js({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:y!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:y==="disable"?void 0:g,icons:(D=e.docker)!=null&&D.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(St,{icon:qg})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:O,button:o.jsx(Vo,{serverVersion:i,requirementVersion:T,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(Bf,{children:o.jsx(yt,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:P=>{P.preventDefault(),P.stopPropagation();const F=Xg(e,r);F&&window.open(F,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}Ho.propTypes={blocklet:A.object.isRequired,blocklets:A.array,handleButtonClick:A.func,endpoint:A.string,serverVersion:A.string};Ho.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function Go({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:g,compact:l,...u}){const{locale:x}=Tt(),[y,T]=M.useState(!1),[O,N]=M.useState({}),D=F=>{N(F)},P=n;return M.useEffect(()=>{N({showResources:!0,resourceType:a,resourceDid:c})},[P,a,c]),M.useEffect(()=>{T(!0),N({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(ca,{theme:Gg,children:o.jsx(ya,{FallbackComponent:$r,resetKeys:[P],children:o.jsxs(Y,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[y&&o.jsx(Wg,{showCategory:g,showResourcesSwitch:f,blockletRender:F=>{const V={...F,handleButtonClick:e,endpoint:P};return r({...F,defaultRender:o.jsx(Ho,{...V})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:P,locale:x,onFilterChange:D,onSearchSelect:t,filters:O,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}Go.propTypes={storeUrl:A.string.isRequired,handleButtonClick:A.func,handleSearchSelect:A.func,handleBlockletRender:A.func,extraFilter:A.func,serverVersion:A.string,resourceType:A.string,resourceDid:A.string,showResourcesSwitch:A.bool,showCategory:A.bool,compact:A.bool};Go.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Qg=et(Uf)`
554
+ .ms-highlight {
555
+ color: ${e=>e.theme.palette.primary.main};
556
+ }
557
+ `,Xo=M.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=Vn(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=Yc(),{t:g,locale:l}=Tt(),u=s[a];return M.useEffect(()=>{n(a)},[n,a]),M.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(Zg,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:o.jsx(Qc,{locale:l,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?Eu({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:i,stepTip:g("blocklet.component.add"),children:o.jsx(Jg,{children:typeof(u==null?void 0:u.body)=="function"?u.body():u==null?void 0:u.body})})})});Xo.propTypes={meta:A.any,onStepChange:A.func.isRequired,isMobile:A.bool.isRequired};Xo.defaultProps={meta:null};const Zs=e=>e.isMobile?`
558
+ height: calc(100vh - 56px - 64px - 48px);
559
+ `:"",Jg=et.div`
560
+ width: 100%;
561
+ height: 100%;
562
+ display: flex;
563
+ flex-direction: column;
564
+ justify-content: flex-start;
565
+ align-items: flex-start;
566
+
567
+ .bottom-button {
568
+ min-width: 200px;
569
+ }
570
+
571
+ // blocklet-select-side
572
+ aside {
573
+ width: 140px;
574
+ }
575
+ `,Zg=et(Y)`
576
+ ${({className:e})=>e==="mobileStyle"?`
577
+ & > div{
578
+ height: 100%;
579
+ }
580
+ .root-header {
581
+ .app-name-content {
582
+ display: none;
583
+ }
584
+ }
585
+
586
+ // content-panel
587
+ .root-header + div{
588
+ padding-top: 0;
589
+ position: relative;
590
+ & > div {
591
+ padding-top: 0;
592
+ }
593
+ }
594
+
595
+ header + div {
596
+ padding-top: 0;
597
+ }
598
+
599
+ header {
600
+ .header-title {
601
+ margin-left: 0;
602
+ }
603
+
604
+ .header-title-name {
605
+ max-width: 100% !important;
606
+ }
607
+ }
608
+ .app-content {
609
+ padding: 0!important;
610
+ }
611
+ `:`
612
+ position: relative;
613
+ .ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
614
+ width: 100%;
615
+ height: 100%;
616
+ }
617
+
618
+ .root-header {
619
+ z-index: auto !important;
620
+ position: fixed !important;
621
+ }
622
+ & > div {
623
+ height: 100%;
624
+ width: 100%;
625
+ max-width: 100%;
626
+ & > div {
627
+ max-height: unset !important;
628
+ max-width: 100%;
629
+ & > div {
630
+ // left-panel
631
+ &:first-child {
632
+ padding: 0;
633
+ width: 20%;
634
+ min-width: 180px;
635
+
636
+ & > div:first-child {
637
+ display: none;
638
+ }
639
+ // step
640
+ & > div:last-child {
641
+ // margin-top: 32px;
642
+ margin-top: 0;
643
+ }
644
+ }
645
+ // right-panel
646
+ &:last-child {
647
+ padding-top: 0;
648
+ padding-right: 0px;
649
+ overflow-y: hidden;
650
+ .app-content {
651
+ padding: 0 0 24px 0;
652
+ }
653
+ .button-container {
654
+ padding-right: 0;
655
+ }
656
+ }
657
+ }
658
+ }
659
+ }
660
+
661
+ `}
662
+
663
+ & .app-overview {
664
+ margin-left: 0 !important;
665
+ }
666
+
667
+ & .flex-justify-center {
668
+ display: flex;
669
+ justify-content: center;
670
+ }
671
+
672
+ & .flex-align-center {
673
+ display: flex;
674
+ height: 100%;
675
+ align-items: center;
676
+ ${e=>Zs(e)}
677
+ }
678
+
679
+ & .agreement-wrapper {
680
+ ${e=>Zs(e)}
681
+ max-height: 60vh;
682
+ .eula-trigger {
683
+ padding-right: 0;
684
+ }
685
+ .next-button {
686
+ display: none;
687
+ }
688
+ }
689
+
690
+ & .connect {
691
+ background: white;
692
+ }
693
+ `,ev=Xo,tv=e=>e.inStore&&Vt.isFreeBlocklet(e)===!1,nv=e=>{var t;return[Pt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Pt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},Si=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===Pt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},rv=e=>(e.environments||[]).some(t=>t.required),ea=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),iv=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},ta=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function ac({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:g,showFromUrl:l,enableRunBackground:u,showCategory:x}){var gn,Nn,k,jt,Bt,vn,d,E,S,L;const{t:y,locale:T}=Tt(),[O,N]=M.useState(!1),[D,P]=M.useState(null),[F,V]=M.useState(""),[I,B]=M.useState(""),{api:H,ws:{useSubscription:U},inService:le,info:G}=Hn(),{blocklet:se,actions:{refreshBlocklet:Ie}}=zr(),[Ge,ze]=M.useState(null),[it,Z]=M.useState(!1),me={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ee,xe]=M.useState(me),[oe,We]=M.useState(0),Te=M.useRef({}),ot=M.useRef({}),Ye=M.useRef({}),an=rn(R=>R.breakpoints.down("md")),ln=Nc(),[Gt,cn]=M.useState(!0),{meta:De}=Te.current,Me=Ca(De),st=M.useRef(!1),he=R=>xe(j=>({...j,...R}));M.useEffect(()=>{if(ee.pathPrefix){const{errMsg:R}=mn({...ee,pathPrefix:ee.pathPrefix,locale:T});V(R)}},[ee.pathPrefix]),M.useEffect(()=>{oe===0&&xe(me)},[oe]);const un=()=>{const R=Si(se)??"";he({didSpaceEndpoint:R})},dn=()=>{var R;return(R=Te==null?void 0:Te.current)!=null&&R.meta?Vt.getDisplayName(Te.current):""},hn=()=>{N(!1),xe({}),st.current=!1,Te.current={},e()},ke=R=>{const j=$=>{he({installResultProps:{variant:"error",title:dn(),subTitle:R,footer:o.jsx(yt,{className:"bottom-button",disabled:$,"data-cy":"retry-install-component",onClick:async()=>{j(!0),await pn(Te.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[$&&o.jsx(Ct,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};j()},Xt=R=>j=>{var $,ne;((($=j==null?void 0:j.meta)==null?void 0:$.did)||(j==null?void 0:j.meta))===((ne=se==null?void 0:se.meta)==null?void 0:ne.did)&&R(j)},Xn=()=>{ta({timeout:0,componentDid:ln.componentDid,manual:!0}),hn(),setTimeout(()=>{const R=document.getElementsByClassName("dashboard-main")[0];R&&(R.scrollTop=R.scrollHeight)},200)};U(Pt.BlockletEvents.componentInstalled,Xt(()=>{he({installResultProps:{variant:"success",title:dn(),subTitle:y("blocklet.component.installSuccessTip")}}),ta({componentDid:ln.componentDid})}),[(gn=se==null?void 0:se.meta)==null?void 0:gn.did]),U(Pt.BlockletEvents.statusChange,Xt(()=>{const R=Si(se);he(j=>({...j,didSpaceEndpoint:R}))}),[(Nn=se==null?void 0:se.meta)==null?void 0:Nn.did]),U(Pt.BlockletEvents.downloadFailed,Xt(()=>{st.current=!1,ke(y("blocklet.component.installComponentError"))}),[(k=se==null?void 0:se.meta)==null?void 0:k.did]),U(Pt.BlockletEvents.installFailed,Xt(()=>{st.current=!1,ke(y("blocklet.component.installComponentError"))}),[(jt=se==null?void 0:se.meta)==null?void 0:jt.did]);const at=[],fn=R=>((se==null?void 0:se.children)||[]).find(j=>j.meta.did===R),pn=async R=>{var Qt,Et;st.current=!0;const{pathPrefix:j,bundleDid:$,title:ne,componentName:ae="",componentDid:qe=""}=ee,Ue=((Qt=Te.current)==null?void 0:Qt.meta)||{},{configs:Oe=[],registryUrl:Re,inStore:tt,inputUrl:Ft,dist:Yn}=Ue,Ut=(Et=Te.current)==null?void 0:Et.downloadTokenList,ft=Ft||(tt?os(Re,$,Yn):"");N(!0);const Yt={rootDid:se.meta.did,url:ft,mountPoint:j?Or(j):`/${Or(Ue.title||Ue.name)}`,title:ne,name:ae,did:qe,onlyRequired:!Gt,...ee.hasEnvironmentsStep&&Oe.length>0?{configs:Oe.map(pt=>({...pt,value:ee.configsValue[pt.key]||""}))}:{},...Ut?{downloadTokenList:Ut}:{},...R};try{if(await H.installComponent({input:Yt}),Re){const{teamDid:pt,storeList:Wt}=Sa({fromBlocklet:le,nodeInfo:G,blocklet:se}),{isNew:An,decoded:Pn}=wu(Re,Wt);An&&await H.addBlockletStore({input:{teamDid:pt,url:Pn}})}he({installResultProps:{}}),Ie({showError:!1,attachRuntimeInfo:!1})}catch(pt){const Wt=_a(pt);Zi.error(Wt),console.error("installComponent error: ",pt),ke(Wt)}finally{N(!1),Te.current.installInput=Yt}},mn=R=>{const j=Ku({params:{...R,did:R.bundleDid},blocklets:[se],blocklet:se,locale:T});if(j){const $=fn(R.bundleDid),ne=qu({params:{...R,did:R.bundleDid},blocklet:se});if($&&$.mountPoint===ne)return{errMsg:""}}return{errMsg:j}},Ke=async R=>{var $,ne;const{errMsg:j}=mn({...ee,locale:T});V(j),oe===at.length-2&&!st.current&&await pn(R),(ne=($=ot.current)==null?void 0:$.setActiveStepByIndex)==null||ne.call($,ae=>ae+1)},lt=()=>{var R,j;(j=(R=ot.current)==null?void 0:R.setActiveStepByIndex)==null||j.call(R,$=>$-1)},kt=()=>{const{pathPrefix:R,bundleDid:j,title:$,componentName:ne="",componentDid:ae=""}=ee,{meta:qe={}}=Te.current||{},{registryUrl:Ue,inStore:Oe,inputUrl:Re,dist:tt}=qe,Ft=Oe?os(Ue,j,tt):Re;ze({meta:qe,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:R,url:Ft,title:$,name:ne,did:ae}})},ht=R=>{Z(!1),he({purchaseResultProps:{variant:"error",title:dn(),subTitle:R,style:{paddingTop:120},footer:o.jsx(yt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{he({purchaseResultProps:{}})},children:y("common.retry")})}})},Lt=({downloadTokenList:R})=>{Te.current.downloadTokenList=R,Z(!1),Ke()},Mt=({chooseParams:R=Te.current,componentDid:j,isInit:$=!1})=>{var Pn,wr,Qn,Jn;const{meta:ne,registryUrl:ae,inStore:qe,inputUrl:Ue}=R,{did:Oe,title:Re,name:tt}=ne,Ft=(((Pn=se.settings)==null?void 0:Pn.children)||[]).filter(Ve=>Ve.status==="deleted"&&Ve.meta.bundleDid===Oe),Yn=j||"",Ut=(wr=ne.environments)==null?void 0:wr.map(Ve=>{const{name:Dn,validation:yn,...Mn}=Ve,bn={validation:du(yn)?"":yn};return{...Mn,key:Dn,...bn}});Te.current={...R,meta:{...ne,configs:Ut,registryUrl:ae,inStore:qe,inputUrl:Ue}};let ft={};if($){const Ve=[se],Dn=Ut||[],yn=[],Mn=xa(uu([...Dn,...yn]),"key").filter(Ot=>!!Ot.key).sort((Ot,En)=>Ot.required&&!En.required?-1:En.required&&!Ot.required?1:0),bn=Vt.getSharedConfigObj(Ve[0],{configs:Mn}),Zn={},Le=Mn.map(Ot=>{const{default:En,key:xn,...Tr}=Ot;return Zn[xn]=bn[xn]||En,{...Tr,key:xn,hidden:!!Pt.BLOCKLET_CONFIGURABLE_KEY[xn]}});ft={...ft,configsList:Le,configsValue:Zn,hasMissRequiredConfigs:ea(Le,Zn)}}const Yt=se.children.some(Ve=>Ve.mountPoint==="/"),Qt=Ft.find(Ve=>Ve.meta.bundleDid===Oe),Et=se.children.find(Ve=>Ve.meta.bundleDid===Oe);ft.title=Re||"",Qt?ft={...ft,pathPrefix:Qt.mountPoint||"",componentName:Qt.meta.name,hasEnvironmentsStep:!1}:Et?ft={...ft,pathPrefix:Et.mountPoint||"",componentName:Et.meta.name,hasEnvironmentsStep:!1}:ft={...ft,pathPrefix:Yt?`/${Or(Re)||Or(tt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Jn=(Qn=Te.current.meta)==null?void 0:Qn.environments)==null?void 0:Jn.length)>0};const pt=tv(Te.current.meta),Wt=nv(Te.current.meta),An=Si(se);he({bundleDid:Oe,componentDid:Yn,...ft,hasRequiredEnvironments:rv(Te.current.meta),requirePurchase:pt,didSpaceIsRequiredSetup:Wt,didSpaceEndpoint:An}),$&&pt&&kt()};M.useEffect(()=>{!c||oe!==0||!se||(Mt({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),he({showFromUrlDialog:!1}),Ke())},[c,oe,se]),at.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:o.jsxs(wn,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ee.showFromUrlDialog&&o.jsx(Io,{mode:"component",onCancel:()=>{he({showFromUrlDialog:!1})},onSuccess:({meta:R,inputUrl:j,inStore:$,registryUrl:ne})=>{Mt({chooseParams:{meta:R,inputUrl:j,inStore:$,registryUrl:ne},isInit:!0}),he({showFromUrlDialog:!1}),Ke()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),o.jsx(No,{stores:n,extra:fa.isInServerlessMode(G)?null:l?o.jsxs(yt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{he({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Ia,{style:{fontSize:20,marginRight:4}})," ",y("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:O,onChange:()=>{xe({}),Te.current={}},storageKey:s,children:({currentRegistry:R})=>o.jsx(Go,{showResourcesSwitch:g,showCategory:x,serverVersion:G==null?void 0:G.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:R.url,resourceType:r,resourceDid:i,handleButtonClick:j=>{Mt({chooseParams:{...j,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:j,defaultRender:$})=>{const ne=(ee==null?void 0:ee.bundleDid)&&(ee==null?void 0:ee.bundleDid)===(j==null?void 0:j.did);return o.jsxs(sv,{children:[o.jsx(Y,{className:ne?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...ne?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:$}),ne&&o.jsx(Y,{className:"check-container",children:o.jsx(ba,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:iv({params:ee,blocklet:se,t:y}),onCancel:hn,onConfirm:()=>{Ke()}}),at.push({key:"agreement",name:y("launchBlocklet.introduction"),body:o.jsxs(wn,{component:"div",className:"agreement-wrapper",children:[o.jsx(Ea,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),o.jsx(co,{meta:De,onClickNext:Ke,installRelated:Gt,onChangeInstallRelated:cn,handleDescEle:o.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:y("common.pre"),disabled:!Me,confirm:y(Me?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?hn:lt,onConfirm:()=>{Z(!1),Ke()}}),De&&ee.requirePurchase&&at.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[y("common.verifyNFT"),o.jsx(ni,{})]}),body:o.jsxs(wn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((vn=(Bt=Ye.current)==null?void 0:Bt.getCurrentStep)==null?void 0:vn.call(Bt))===2||it)&&o.jsx(jr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),cr(ee.purchaseResultProps)?Ge&&o.jsx(jf,{ref:Ye,meta:Ge.meta,mode:ee.componentDid?"verify":"both",onCancel:ht,installOpts:Ge.installOpts,handlePaySuccess:Lt}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(is,{...ee.purchaseResultProps})})]}),disabled:((E=(d=Ye.current)==null?void 0:d.getCurrentStep)==null?void 0:E.call(d))===2||it,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof Ye.current.onNext=="function"&&(Ye.current.onNext(),Z(!0))},onCancel:()=>{lt()}}),Vt.hasStartEngine(De)&&xu.hasMountPoint(De)?at.push({key:"config",name:y("common.config"),error:F,body:o.jsxs(wn,{component:"div",children:[o.jsx(jr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),o.jsx(Wr,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:I||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ee.pathPrefix,onChange:R=>{const j=R.target.value;he({pathPrefix:j}),B(y("common.slugifyHint",{value:Su(j)}))}}),!!F&&o.jsx(aa,{severity:"error",style:{width:"100%",marginTop:8},children:F})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:lt,onConfirm:()=>{Ke()}}):De&&(ee.pathPrefix=((L=(S=De.interfaces)==null?void 0:S[0])==null?void 0:L.path)||`/${De.did}`),De&&(ee!=null&&ee.hasEnvironmentsStep)&&at.push({key:"environment",name:o.jsxs(o.Fragment,{children:[y("common.environment")," ",ee.hasRequiredEnvironments&&o.jsx(ni,{})]}),disabled:!!D||(ee==null?void 0:ee.hasMissRequiredConfigs),body:()=>o.jsxs(wn,{component:"div",style:{overflowY:"auto"},children:[o.jsx(jr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),o.jsx(_u,{style:{marginTop:-12,width:"100%"},schema:ee.configsList,defaultValue:ee.configsValue,onChange:(R,{action:j,currentItem:$,allValues:ne})=>{j==="confirm"&&he({hasMissRequiredConfigs:ea(ee.configsList,ne),configsValue:ne}),j==="edit"?P($):["cancel","confirm"].includes(j)&&P(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:lt,onConfirm:Ke}),De&&(ee!=null&&ee.didSpaceIsRequiredSetup)&&at.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",ee.didSpaceIsRequiredSetup==="required"&&o.jsx(ni,{})]}),disabled:(ee==null?void 0:ee.didSpaceIsRequiredSetup)&&!ee.didSpaceEndpoint,body:()=>o.jsx(Ou,{children:o.jsxs(wn,{component:"div",children:[o.jsx(jr,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),o.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:o.jsx(jo,{blockletMeta:Te.current.meta,onNext:()=>{Ke()},onEndpointUpdate:un})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:lt,onConfirm:Ke}),at.push({key:"install",name:fn(De==null?void 0:De.did)?y("common.upgrade"):y("common.install"),disabled:u?!1:cr(ee.installResultProps),loading:u?!1:cr(ee.installResultProps),body:o.jsx(wn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:cr(ee.installResultProps)?o.jsx(Vc,{message:o.jsx(av,{children:y(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(is,{...ee.installResultProps})})}),confirm:y("common.complete"),onConfirm:Xn});const Qe=at[oe]||{},jn=()=>O||Qe.error||!ee.bundleDid?!0:oe>1?!ee.pathPrefix:!1;return se?o.jsxs(ov,{sx:a?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[o.jsx(Jc,{steps:at,mode:"memory",children:o.jsx(ev,{ref:ot,meta:De,isMobile:an,onStepChange:R=>{We(R)}})}),o.jsxs(Y,{className:"action-bar",children:[Qe.cancel&&o.jsx(yt,{onClick:R=>{R.stopPropagation(),Qe.onCancel()},disabled:oe===at.length-2&&O,color:"inherit",children:Qe.cancel||y("common.cancel")}),Qe.confirm&&o.jsx(yt,{onClick:R=>{R.stopPropagation(),Qe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:O||(typeof Qe.disabled=="boolean"?Qe.disabled:jn()),variant:"contained",autoFocus:!0,title:Qe.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Qe.loading=="boolean"?Qe.loading:O)&&o.jsx(Ct,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Qe.confirm})]})})]})]}):null}ac.propTypes={onClose:A.func,mode:A.oneOf(["normal","embed"]),inDialog:A.bool,stores:A.arrayOf(A.string),storeUrl:A.string,resourceType:A.string,resourceDid:A.string,storageKey:A.string,selectedMeta:A.object,showResourcesSwitch:A.bool,showFromUrl:A.bool,enableRunBackground:A.bool,showCategory:A.bool};ac.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const ov=et(Y)`
694
+ .action-bar {
695
+ display: flex;
696
+ justify-content: flex-end;
697
+ position: sticky;
698
+ bottom: 0;
699
+ padding-top: 16px;
700
+ z-index: 100;
701
+ width: 100%;
702
+ background: #fff;
703
+ border-top: 1px solid #eee;
704
+ }
705
+ `,wn=et(ye)`
706
+ width: 100%;
707
+ height: 100%;
708
+ `,jr=et(Ea)`
709
+ margin-bottom: 24px;
710
+ `,sv=et.div`
711
+ position: relative;
712
+
713
+ .choose-blocklet {
714
+ background-color: rgb(236, 251, 253);
715
+ border-color: rgb(236, 251, 253);
716
+ border-radius: 8px;
717
+ }
718
+
719
+ .check-container {
720
+ position: absolute;
721
+ right: 0;
722
+ bottom: 0;
723
+ display: flex;
724
+ justify-content: flex-end;
725
+ align-items: flex-end;
726
+ width: 30px;
727
+ height: 30px;
728
+ border-radius: 0 0 8px 0;
729
+ color: ${e=>e.theme.palette.common.white};
730
+ overflow: hidden;
731
+ transition: all ease 0.3s;
732
+ &:after {
733
+ position: absolute;
734
+ z-index: 0;
735
+ display: block;
736
+ width: 0;
737
+ height: 0;
738
+ border-top: transparent solid 15px;
739
+ border-left: transparent solid 15px;
740
+ border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
741
+ border-right: ${e=>e.theme.palette.primary.main} solid 15px;
742
+ transition: all ease 0.1s;
743
+ content: '';
744
+ }
745
+
746
+ .check-icon {
747
+ position: relative;
748
+ z-index: 2;
749
+ margin: 0 1px 1px 0;
750
+ font-size: 16px;
751
+ transition: all ease 0.2s;
752
+ }
753
+ }
754
+ `,av=et.div`
755
+ color: ${e=>e.theme.palette.primary.main};
756
+ .msg-before {
757
+ display: inline-block;
758
+ color: #aaa;
759
+ font-size: 14px;
760
+ margin-right: 6px;
761
+ }
762
+ `;export{ac as A,vl as B,Wv as S,Fv as a,Uv as b,qg as c,Ia as d,Da as f};