@abtnode/blocklet-services 1.16.43 → 1.16.44-beta-20250513-030435-c2d99062

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 (182) hide show
  1. package/api/emails/_components/activity.js +2 -1
  2. package/api/index.js +5 -1
  3. package/api/libs/email.js +1 -1
  4. package/dist/assets/{AdapterDayjs-BiPHzcUP.js → AdapterDayjs-BD9H1lZ-.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-Dghek9CI.js → ArrowDropDown-BrO-zDlb.js} +1 -1
  6. package/dist/assets/{CheckCircle-Dvhgeo9j.js → CheckCircle-Ds4QI0ey.js} +1 -1
  7. package/dist/assets/{ChevronLeft-DE33N57i.js → ChevronLeft-CnQaQ-rc.js} +1 -1
  8. package/dist/assets/{ChevronRight-BfbPIE2b.js → ChevronRight-a_2_x6Ew.js} +1 -1
  9. package/dist/assets/{Community-2MKVAbIk.js → Community-DW6DJTIs.js} +1 -1
  10. package/dist/assets/{DeleteOutline-B6efX_Fy.js → DeleteOutline-CFN4r-OG.js} +1 -1
  11. package/dist/assets/{Done-Ct5slWpT.js → Done-DqSE6KPe.js} +1 -1
  12. package/dist/assets/{Download-DKQGRFHf.js → Download-C_LRKzbG.js} +1 -1
  13. package/dist/assets/{Edit-BLsIdIOp.js → Edit-CbR4eoK8.js} +1 -1
  14. package/dist/assets/{EditIcon-CwTCQzs9.js → EditIcon-DxUWMw59.js} +1 -1
  15. package/dist/assets/{Email-DOy8vL0N.js → Email-DWueGk7t.js} +1 -1
  16. package/dist/assets/{Error-wpqrAfUT.js → Error-jEHdDLNk.js} +1 -1
  17. package/dist/assets/{ExpandLess-CJXkgMMr.js → ExpandLess-CkoEHpgk.js} +1 -1
  18. package/dist/assets/{Google-BbAgcDQ_.js → Google-DHEolkW-.js} +1 -1
  19. package/dist/assets/{Holiday-DT-VjgQP.js → Holiday-Dwvo6QkZ.js} +1 -1
  20. package/dist/assets/{InfoOutlined-Dy7jTc7H.js → InfoOutlined-DkG0jjos.js} +1 -1
  21. package/dist/assets/{Launch-DBKe0gh0.js → Launch-B-2Jomi6.js} +1 -1
  22. package/dist/assets/{LaunchOutlined-BIq6YUU8.js → LaunchOutlined-CXNijfqX.js} +1 -1
  23. package/dist/assets/{Location-C__VfR4D.js → Location-DUEOr9J2.js} +1 -1
  24. package/dist/assets/{LockIcon-DIGiHKHl.js → LockIcon-Cjg8jV1E.js} +1 -1
  25. package/dist/assets/{Meeting-Cn2X2Ix7.js → Meeting-CJaI_cKm.js} +1 -1
  26. package/dist/assets/{MoreHoriz-BxJelL2A.js → MoreHoriz-B6KdR0Y8.js} +1 -1
  27. package/dist/assets/{OffSick-Cnicwu8x.js → OffSick-C9VqqjrN.js} +1 -1
  28. package/dist/assets/{Phone-CoX1qzAs.js → Phone-DcHUzCa-.js} +1 -1
  29. package/dist/assets/{PlayArrow-C9IFmc-j.js → PlayArrow-BToG9L6q.js} +1 -1
  30. package/dist/assets/{QuestionMarkCircle-DCM9zW3a.js → QuestionMarkCircle-BPVDAm8U.js} +1 -1
  31. package/dist/assets/{ServerLogo-CfbYjQbP.js → ServerLogo-s6cfhx92.js} +1 -1
  32. package/dist/assets/{Timezone-CCdgxxpv.js → Timezone-B-Ho_Uno.js} +1 -1
  33. package/dist/assets/{TuneOutlined-CB7t_nGq.js → TuneOutlined-BR2H7Mxj.js} +1 -1
  34. package/dist/assets/{ViewList-B4hmqizo.js → ViewList-D8vtMKQz.js} +1 -1
  35. package/dist/assets/{WorkingRemotely-DWT54kH1.js → WorkingRemotely-lJ6DUMCR.js} +1 -1
  36. package/dist/assets/{access-control-RJu7xYI3.js → access-control-Din7doVd.js} +1 -1
  37. package/dist/assets/{actions-BCWb2ez1.js → actions-BjTeIzgS.js} +1 -1
  38. package/dist/assets/{add-component-core-DRAzXCeg.js → add-component-core-5x4gTem5.js} +15 -15
  39. package/dist/assets/{add-resource-BDJuVU8K.js → add-resource-BrZnm53f.js} +1 -1
  40. package/dist/assets/{addon-ygDS7Fug.js → addon--u4EErgw.js} +1 -1
  41. package/dist/assets/{advanced-CFME3Vrl.js → advanced-CN6mCSES.js} +1 -1
  42. package/dist/assets/{appearance-BqJwEmtt.js → appearance-Bowm1Shj.js} +1 -1
  43. package/dist/assets/audit-logs-DczjqamJ.js +35 -0
  44. package/dist/assets/{authorize-WekjQ3_M.js → authorize-D2LCmekq.js} +1 -1
  45. package/dist/assets/{base32-BbrXtXL6.js → base32-_zEVBJUg.js} +1 -1
  46. package/dist/assets/{branding-CS-f1gMT.js → branding-B6AmOMI6.js} +6 -6
  47. package/dist/assets/{branding-BTfb8_b4.js → branding-CwhhJRKu.js} +2 -2
  48. package/dist/assets/{bundle-avatar-Db5l8MQ4.js → bundle-avatar-CDJRatFg.js} +1 -1
  49. package/dist/assets/button-D8hoY4xw.js +1 -0
  50. package/dist/assets/click-to-copy-CFiGx48J.js +1 -0
  51. package/dist/assets/{collapse-Bn_BDlF9.js → collapse-QV_2gdtM.js} +1 -1
  52. package/dist/assets/{complete-BRApuFsV.js → complete-CKhw9u_z.js} +2 -2
  53. package/dist/assets/{component-C7g4FGFm.js → component-Cb3m5qUw.js} +2 -2
  54. package/dist/assets/{config-qG8JCIJ_.js → config-LE_EJolF.js} +1 -1
  55. package/dist/assets/{config-C8AXD1JH.js → config-kGXJEkFJ.js} +2 -2
  56. package/dist/assets/{config-navigation-B7r4dV5S.js → config-navigation-CKVyFhfH.js} +4 -4
  57. package/dist/assets/{config-space-CSKkMgqX.js → config-space-CogRdhoQ.js} +1 -1
  58. package/dist/assets/{confirm-BvUfAlkx.js → confirm-SdqBW-ti.js} +1 -1
  59. package/dist/assets/{connect-B2HOOYzS.js → connect-BMn4CxDk.js} +1 -1
  60. package/dist/assets/{connect-DGPdKMcu.js → connect-HAC-YfHh.js} +1 -1
  61. package/dist/assets/{connect-to-BBtnljQ-.js → connect-to-eNQDY2rc.js} +1 -1
  62. package/dist/assets/{content-layout-DzqMXifY.js → content-layout-BzF-fNQz.js} +1 -1
  63. package/dist/assets/dashboard-BYxl5V9e.js +239 -0
  64. package/dist/assets/{delete-confirm-BBaXcAXg.js → delete-confirm-CKF_eljP.js} +1 -1
  65. package/dist/assets/{did-address-BKBBjFqv.js → did-address-DjwPl1uy.js} +1 -1
  66. package/dist/assets/{domain-DTrwCkop.js → domain-DotN6lCb.js} +1 -1
  67. package/dist/assets/{domain-action-card-D-WETV-f.js → domain-action-card-DHH9PLRG.js} +1 -1
  68. package/dist/assets/domains-BV2pykxi.js +1 -0
  69. package/dist/assets/{dot-C05enzim.js → dot-BA3EvSrh.js} +1 -1
  70. package/dist/assets/{email-Bc5KLu5Q.js → email-CHR0EOis.js} +1 -1
  71. package/dist/assets/{empty-spinner-BZlBh4vA.js → empty-spinner-n0_Ehns5.js} +1 -1
  72. package/dist/assets/{exchange-passport-DbNEDTaa.js → exchange-passport-D0iIXJxD.js} +1 -1
  73. package/dist/assets/{fuel-DzWcrU-I.js → fuel-nMTHNcy-.js} +1 -1
  74. package/dist/assets/{gen-access-key-D-ftFU9F.js → gen-access-key-DH4wNzRm.js} +1 -1
  75. package/dist/assets/get-safe-url-B5RJTMjC.js +1 -0
  76. package/dist/assets/get-safe-url-Bk6PlU7n.js +1 -0
  77. package/dist/assets/{home-DXj5oFeO.js → home-DzCwBE8F.js} +1 -1
  78. package/dist/assets/{iframe-CIVgAJuH.js → iframe-DW7zzzTG.js} +1 -1
  79. package/dist/assets/{index-BemEiFHE.js → index-8CHxrfFP.js} +1 -1
  80. package/dist/assets/{index-D64RNKdt.js → index-B54lTbup.js} +6 -6
  81. package/dist/assets/{index-CKheO_aT.js → index-B8r-LrrM.js} +1 -1
  82. package/dist/assets/{index-Bxd86KLJ.js → index-BA8C83iz.js} +4 -4
  83. package/dist/assets/index-BCNchyGN.js +141 -0
  84. package/dist/assets/{index-g0L_1foA.js → index-BCtmnJeV.js} +11 -11
  85. package/dist/assets/{index-BMD-pSqT.js → index-BDYaw77z.js} +1 -1
  86. package/dist/assets/{index-Ce2NSVmU.js → index-BIPRCLBG.js} +1 -1
  87. package/dist/assets/{index-BMPpz8ni.js → index-BJxv6GA4.js} +1 -1
  88. package/dist/assets/index-BLGGjT7N.js +284 -0
  89. package/dist/assets/{index-DjLLC6N3.js → index-BYCeMwoO.js} +1 -1
  90. package/dist/assets/{index-BVU8_1Ed.js → index-B_-kynzD.js} +3 -3
  91. package/dist/assets/{index-D09AfnR1.js → index-BuXc3Oag.js} +1 -1
  92. package/dist/assets/{index-u-w3iMC9.js → index-CIkPfxzG.js} +4 -4
  93. package/dist/assets/{index-CHDiquXf.js → index-CPfvVvHv.js} +11 -11
  94. package/dist/assets/index-CYeNo51G.js +113 -0
  95. package/dist/assets/{index-CUfP1M2j.js → index-CfxcUIhC.js} +1 -1
  96. package/dist/assets/index-Ctzl9JDw.js +55 -0
  97. package/dist/assets/{index-BmWVfEGP.js → index-CxwBhS0_.js} +1 -1
  98. package/dist/assets/{index--HbH1n1_.js → index-D7eC9ptO.js} +1 -1
  99. package/dist/assets/{index-DF3gHUuW.js → index-D9KfgDPN.js} +4 -4
  100. package/dist/assets/{index-wXCx8TFU.js → index-DcUhenm6.js} +1 -1
  101. package/dist/assets/{index-C0SLCehH.js → index-enM9Y412.js} +1 -1
  102. package/dist/assets/{invitation-CKfllvl5.js → invitation-DzT9Qa0A.js} +1 -1
  103. package/dist/assets/{invite-CCCSmPiy.js → invite-CQPeUOT4.js} +1 -1
  104. package/dist/assets/{issue-passport-C3zUptls.js → issue-passport-BYhvmLsl.js} +1 -1
  105. package/dist/assets/{item-CkcpHBHM.js → item-D942q-4T.js} +1 -1
  106. package/dist/assets/{landing-page-q-KgqE9Q.js → landing-page-Due4o1uF.js} +1 -1
  107. package/dist/assets/{launch-result-message-BaU6oEsi.js → launch-result-message-DIYoykBK.js} +1 -1
  108. package/dist/assets/{layout-CyCulQBn.js → layout-BcLfVSqs.js} +1 -1
  109. package/dist/assets/list-BiJWMg_P.js +236 -0
  110. package/dist/assets/list-DKUSPdB6.js +2 -0
  111. package/dist/assets/{list-header-CU9W30JD.js → list-header-HqBQs1yn.js} +1 -1
  112. package/dist/assets/localization-BUDtnbyU.js +1 -0
  113. package/dist/assets/{log-DNpJdgp3.js → log-Iko0jLNA.js} +1 -1
  114. package/dist/assets/{logger-CQ50TnpL.js → logger-BLZgTs_U.js} +1 -1
  115. package/dist/assets/{login-BKaJnfFX.js → login-4Yq_pPSw.js} +1 -1
  116. package/dist/assets/{login-oauth-callback-LJsgXC8E.js → login-oauth-callback-DZaPZfnA.js} +1 -1
  117. package/dist/assets/{logo-uploader-BYnd80uu.js → logo-uploader-Cnkdgyfv.js} +3 -3
  118. package/dist/assets/{lost-passport-Bk0k4I4s.js → lost-passport-D5jMtgH_.js} +1 -1
  119. package/dist/assets/{open-window-DV0D-Mov.js → open-window--2G6Qjbq.js} +1 -1
  120. package/dist/assets/overview-CaQ-tV1t.js +85 -0
  121. package/dist/assets/{page-header-CpNMTtn_.js → page-header-xyZktwBS.js} +1 -1
  122. package/dist/assets/{passport-item-BxfGrDcE.js → passport-item-DH3_49G1.js} +1 -1
  123. package/dist/assets/{permission-BkNXA8B5.js → permission-BH1TY_tz.js} +1 -1
  124. package/dist/assets/{preferences-_jTjKHvU.js → preferences-CfmnTXfl.js} +1 -1
  125. package/dist/assets/{profile-embed-8w4_vg5a.js → profile-embed-ZtzRYgXv.js} +1 -1
  126. package/dist/assets/publish-resource-BtFRgv4P.js +1 -0
  127. package/dist/assets/{react-beautiful-dnd.esm-Cq_dOQ2z.js → react-beautiful-dnd.esm-7PS2VwOi.js} +1 -1
  128. package/dist/assets/runtime-B0207zk1.js +1 -0
  129. package/dist/assets/sdk-9eXJSWHG.js +1 -0
  130. package/dist/assets/section-Cv4udilp.js +41 -0
  131. package/dist/assets/{security-BQbSLSOe.js → security-CX01lhxW.js} +3 -3
  132. package/dist/assets/{session-6XaVDQaE.js → session-CHdTc1We.js} +1 -1
  133. package/dist/assets/{setup-CifjXQIf.js → setup-DIAgbS7c.js} +3 -3
  134. package/dist/assets/{shorten-label-Dq7bVuNa.js → shorten-label-Cng55547.js} +1 -1
  135. package/dist/assets/{simple-select-C-wGUGQR.js → simple-select-CP_Svi_D.js} +1 -1
  136. package/dist/assets/{slicedToArray-vWe02CJE.js → slicedToArray-C7EPqaHf.js} +1 -1
  137. package/dist/assets/{spaces-Cp7TgoZP.js → spaces-BVG-t3ND.js} +1 -1
  138. package/dist/assets/{start-CHmWCQE9.js → start-CMRQU8Px.js} +1 -1
  139. package/dist/assets/{starting-progress-CdpkXOrK.js → starting-progress-CiLZpNpg.js} +1 -1
  140. package/dist/assets/{status-46dMQnxA.js → status-DSQPLYSp.js} +1 -1
  141. package/dist/assets/{step-actions-Bu3Q5M4V.js → step-actions-BfGTFkaB.js} +1 -1
  142. package/dist/assets/{studio-BbeHx14I.js → studio-DikseKRr.js} +1 -1
  143. package/dist/assets/{switch-control-D6CqAlDY.js → switch-control-C5i52ixk.js} +1 -1
  144. package/dist/assets/{traffic-CY9Vj6w7.js → traffic-ClE631in.js} +2 -2
  145. package/dist/assets/{transfer-CSeo2FaW.js → transfer-BnR8fjLW.js} +1 -1
  146. package/dist/assets/{unsubscribe-BLaMmgbM.js → unsubscribe-rUE2LcLN.js} +1 -1
  147. package/dist/assets/{use-blocklet-logo-sEJnYyNL.js → use-blocklet-logo-Phq7jasP.js} +2 -2
  148. package/dist/assets/{use-mobile-BAjFH6d8.js → use-mobile-Boa_xu9A.js} +1 -1
  149. package/dist/assets/{use-mobile-Bh8CHBbH.js → use-mobile-DyX6Fl8Z.js} +1 -1
  150. package/dist/assets/{useLocalStorage-C6U1Aqya.js → useLocalStorage-DVnkpneF.js} +1 -1
  151. package/dist/assets/user-center-D25Vw-wP.js +76 -0
  152. package/dist/assets/{util-RWes6RwK.js → util-Btd7aQEC.js} +1 -1
  153. package/dist/assets/{util-Bg0WSJ-t.js → util-CEAObyfj.js} +1 -1
  154. package/dist/assets/{vendor-arcblock-CN2B_oTr.js → vendor-arcblock-uz9DVywv.js} +45 -45
  155. package/dist/assets/{vendor-mui-core-UZpb7wT7.js → vendor-mui-core-D_bnq77o.js} +1 -1
  156. package/dist/assets/{vendor-mui-x-whuSO90H.js → vendor-mui-x-R-0SFz4c.js} +1 -1
  157. package/dist/assets/{vendor-ux-did-connect-TEE6cGq6.js → vendor-ux-did-connect-DHrruicZ.js} +136 -136
  158. package/dist/assets/{wrap-locale-DZ79GW_G.js → wrap-locale-CPW6a0PM.js} +1 -1
  159. package/dist/index.html +4 -4
  160. package/dist/service-worker.js +1 -1
  161. package/dist/share/shared-bridge.html +4 -4
  162. package/package.json +32 -32
  163. package/dist/assets/audit-logs-CtFZQHby.js +0 -35
  164. package/dist/assets/button-DotKXyjc.js +0 -1
  165. package/dist/assets/click-to-copy-BxhgzyYL.js +0 -1
  166. package/dist/assets/dashboard-C124DXmc.js +0 -279
  167. package/dist/assets/domains-BxkmGeZE.js +0 -1
  168. package/dist/assets/get-safe-url-2RcRY8gU.js +0 -1
  169. package/dist/assets/get-safe-url-CEvgWyL5.js +0 -1
  170. package/dist/assets/index-9ixwCOkw.js +0 -113
  171. package/dist/assets/index-B_fwtN9z.js +0 -55
  172. package/dist/assets/index-CyUXddLG.js +0 -284
  173. package/dist/assets/index-DsT9i24r.js +0 -141
  174. package/dist/assets/list-D1dIr8Je.js +0 -2
  175. package/dist/assets/list-TP-VNuzL.js +0 -236
  176. package/dist/assets/localization-BXLZxF1J.js +0 -1
  177. package/dist/assets/overview-UIMGVO1S.js +0 -85
  178. package/dist/assets/publish-resource-CcM3RwPR.js +0 -1
  179. package/dist/assets/relative-time-Cl7lOTkO.js +0 -1
  180. package/dist/assets/runtime-BVDdcpyT.js +0 -1
  181. package/dist/assets/sdk-7yPC_DtN.js +0 -1
  182. package/dist/assets/user-center-BHyd-rRF.js +0 -76
@@ -1,4 +1,4 @@
1
- import{a9 as Il,j as o,H as N,ab as xt,ah as He,aa as Y,T as ge,v as qt,bt as wi,bS as Ei,I as js,bK as ks,c1 as Os,A as Is,be as Rl,b6 as Rs,br as Cl,O as Sr,bF as Pl,bG as Ll,bH as _l,by as Nl,ak as Cs,L as Al,b5 as Dl,b3 as Ml,q as Si,ad as Ps,af as Fl,al as rt,e as Gt,bL as Bl,y as ir,Z as Ls,a1 as _s,M as Ns,bV as As,an as $l,ai as zt,bc as To,E as jo,a6 as Ul,P as Wl,G as zl,w as ql,a7 as Kl,D as Gl,N as ko}from"./vendor-mui-core-UZpb7wT7.js";import{r as F,g as Ti,h as Vl,f as Hl,a as ji,e as Se,b as Mt,l as Xl}from"./vendor-react-DEoibe3W.js";import{j as Ds,d as Yl,S as Ql,s as Ms,A as Jl}from"./item-CkcpHBHM.js";import{r as Zl,B as dt,am as ki,Y as Fs,j as Bs,u as gt,I as pt,aJ as ec,aA as tc,h as Tr,b4 as nc,ao as $s,bo as Oo,ar as rc,_ as Oi,C as ic,s as Vt,Z as br,ay as Io,aj as Us,bp as mr,d as Ii,b9 as Ws,z as zs,a0 as oc,bq as sc,a as ii,br as ac}from"./vendor-ux-did-connect-TEE6cGq6.js";import{B as Ro,c as kt,G as lc,E as jr,I as cc,J as uc,K as dc,L as hc,S as fc}from"./vendor-arcblock-CN2B_oTr.js";import{L as Co}from"./launch-result-message-BaU6oEsi.js";import{P as qs}from"./page-header-CpNMTtn_.js";import{e as ut,v as pc,B as mc,E as Po,A as Jn,a0 as Ks,a8 as gc,ah as vc,J as yc,o as Dr,z as Ri,_ as bc,aj as xc,ak as wc,al as Ec,b as Vn,am as Sc,c as Tc}from"./vendor-utils-rHXShPKm.js";import{z as Ln,f as Dt,$ as jc,a0 as kc,a1 as Oc,D as Ic,a2 as Rc,a3 as Cc,a4 as Pc,C as kr,a5 as Gs,Z as Lc,a6 as _c,a7 as Nc,a8 as Ac,a9 as lr,aa as Lo,ab as Dc}from"./index-u-w3iMC9.js";import{u as Mc,C as Fc}from"./config-space-CSKkMgqX.js";import{R as Mr}from"./logo-uploader-BYnd80uu.js";import{S as Bc}from"./index-D09AfnR1.js";import{s as Vs,h as $c,w as Uc,f as Wc,a as zc,b as qc,c as Kc,M as Gc}from"./index-CKheO_aT.js";import{m as or,f as Vc,a as Hc,e as Hs,t as Xc}from"./vendor-hooks-rDgu5KV9.js";import{g as Yc}from"./get-safe-url-2RcRY8gU.js";import{p as Qc}from"./index-Bs1kxR8_.js";import{r as Jc}from"./cloneDeep-UpFQ2VNg.js";import{I as _o}from"./index-C0SLCehH.js";import{u as Zc}from"./session-6XaVDQaE.js";import{W as eu}from"./did-address-BKBBjFqv.js";import{_ as Xs}from"./useLocalStorage-C6U1Aqya.js";import{f as Ys}from"./format-error-BrmqJs5a.js";import{a as No}from"./api-BjteVZFg.js";import{d as tu,a as nu,v as ru,e as iu}from"./util-RWes6RwK.js";import{u as Qs}from"./use-mobile-BAjFH6d8.js";import{C as ou}from"./content-layout-DzqMXifY.js";import{C as su,D as au,a as lu}from"./connect-to-BBtnljQ-.js";import{d as cu}from"./ArrowDropDown-Dghek9CI.js";import{d as uu}from"./ChevronLeft-DE33N57i.js";import{d as du}from"./ChevronRight-BfbPIE2b.js";const ag="blocklet-add-component-registry",lg="server-add-registry",cg=e=>`resource-${e}-add-registry`;var Ci={},hu=Il;Object.defineProperty(Ci,"__esModule",{value:!0});var Js=Ci.default=void 0,fu=hu(Zl()),pu=o;Js=Ci.default=(0,fu.default)((0,pu.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 Zs(e){const{info:t}=Ln();return F.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 Pi({disabled:e,children:t,onConfirm:n}){return F.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}Pi.propTypes={disabled:N.bool,children:N.any.isRequired,onConfirm:N.func.isRequired};Pi.defaultProps={disabled:!1};function Li({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=F.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(mu,{children:o.jsxs(Pi,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(dt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(xt,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(ki,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}Li.propTypes={onContinue:N.func.isRequired,nextDisabled:N.bool,launching:N.bool,description:N.any,texts:N.object};Li.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const mu=He.div`
1
+ import{a9 as Il,j as o,H as N,ab as xt,ah as He,aa as Y,T as ge,v as qt,bt as wi,bS as Ei,I as js,bK as ks,b_ as Os,A as Is,be as Rl,b6 as Rs,br as Cl,O as Sr,bF as Pl,bG as _l,bH as Ll,by as Nl,ak as Cs,L as Al,b5 as Dl,b3 as Ml,q as Si,ad as Ps,af as Fl,al as rt,e as Gt,bL as Bl,y as ir,Z as _s,a1 as Ls,M as Ns,bV as As,an as $l,ai as zt,bc as To,E as jo,a6 as Ul,P as Wl,G as zl,w as ql,a7 as Kl,D as Gl,N as ko}from"./vendor-mui-core-D_bnq77o.js";import{r as F,g as Ti,h as Vl,f as Hl,a as ji,e as Se,b as Mt,l as Xl}from"./vendor-react-DEoibe3W.js";import{j as Ds,d as Yl,S as Ql,s as Ms,A as Jl}from"./item-D942q-4T.js";import{r as Zl,B as dt,am as ki,Y as Fs,j as Bs,u as gt,I as pt,aJ as ec,aA as tc,h as Tr,b4 as nc,ao as $s,bn as Oo,ar as rc,_ as Oi,C as ic,s as Vt,Z as br,ay as Io,aj as Us,bo as mr,d as Ii,b8 as Ws,z as zs,a0 as oc,bp as sc,a as ii,bq as ac}from"./vendor-ux-did-connect-DHrruicZ.js";import{B as Ro,c as kt,G as lc,E as jr,I as cc,J as uc,K as dc,L as hc,S as fc}from"./vendor-arcblock-uz9DVywv.js";import{L as Co}from"./launch-result-message-DIYoykBK.js";import{P as qs}from"./page-header-xyZktwBS.js";import{e as ut,v as pc,B as mc,E as Po,A as Jn,a0 as Ks,a8 as gc,ah as vc,J as yc,o as Dr,z as Ri,_ as bc,aj as xc,ak as wc,al as Ec,b as Vn,am as Sc,c as Tc}from"./vendor-utils-rHXShPKm.js";import{z as _n,f as Dt,Z as jc,_ as kc,$ as Oc,D as Ic,a0 as Rc,a1 as Cc,a2 as Pc,C as kr,a3 as Gs,X as _c,a4 as Lc,a5 as Nc,a6 as Ac,a7 as lr,a8 as _o,a9 as Dc}from"./index-CIkPfxzG.js";import{u as Mc,C as Fc}from"./config-space-CogRdhoQ.js";import{R as Mr}from"./logo-uploader-Cnkdgyfv.js";import{S as Bc}from"./index-BuXc3Oag.js";import{s as Vs,h as $c,w as Uc,f as Wc,a as zc,b as qc,c as Kc,M as Gc}from"./index-B8r-LrrM.js";import{m as or,f as Vc,a as Hc,e as Hs,t as Xc}from"./vendor-hooks-rDgu5KV9.js";import{g as Yc}from"./get-safe-url-B5RJTMjC.js";import{p as Qc}from"./index-Bs1kxR8_.js";import{r as Jc}from"./cloneDeep-UpFQ2VNg.js";import{I as Lo}from"./index-enM9Y412.js";import{u as Zc}from"./session-CHdTc1We.js";import{W as eu}from"./did-address-DjwPl1uy.js";import{_ as Xs}from"./useLocalStorage-DVnkpneF.js";import{f as Ys}from"./format-error-BrmqJs5a.js";import{a as No}from"./api-BjteVZFg.js";import{d as tu,a as nu,v as ru,e as iu}from"./util-Btd7aQEC.js";import{u as Qs}from"./use-mobile-Boa_xu9A.js";import{C as ou}from"./content-layout-BzF-fNQz.js";import{C as su,D as au,a as lu}from"./connect-to-eNQDY2rc.js";import{d as cu}from"./ArrowDropDown-BrO-zDlb.js";import{d as uu}from"./ChevronLeft-CnQaQ-rc.js";import{d as du}from"./ChevronRight-a_2_x6Ew.js";const ag="blocklet-add-component-registry",lg="server-add-registry",cg=e=>`resource-${e}-add-registry`;var Ci={},hu=Il;Object.defineProperty(Ci,"__esModule",{value:!0});var Js=Ci.default=void 0,fu=hu(Zl()),pu=o;Js=Ci.default=(0,fu.default)((0,pu.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 Zs(e){const{info:t}=_n();return F.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 Pi({disabled:e,children:t,onConfirm:n}){return F.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}Pi.propTypes={disabled:N.bool,children:N.any.isRequired,onConfirm:N.func.isRequired};Pi.defaultProps={disabled:!1};function _i({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=F.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(mu,{children:o.jsxs(Pi,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(dt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(xt,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(ki,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}_i.propTypes={onContinue:N.func.isRequired,nextDisabled:N.bool,launching:N.bool,description:N.any,texts:N.object};_i.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const mu=He.div`
2
2
  margin: 0 auto;
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -27,8 +27,8 @@ import{a9 as Il,j as o,H as N,ab as xt,ah as He,aa as Y,T as ge,v as qt,bt as wi
27
27
  .next-button {
28
28
  min-width: 200px;
29
29
  }
30
- `;var _i={exports:{}},Ao=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,gu=/\n/g,vu=/^\s*/,yu=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,bu=/^:\s*/,xu=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,wu=/^[;\s]*/,Eu=/^\s+|\s+$/g,Su=`
31
- `,Do="/",Mo="*",hn="",Tu="comment",ju="declaration",ku=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 j=T.match(gu);j&&(n+=j.length);var A=T.lastIndexOf(Su);r=~A?T.length-A:r+T.length}function s(){var T={line:n,column:r};return function(j){return j.position=new a(T),v(),j}}function a(T){this.start=T,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function c(T){var j=new Error(t.source+":"+n+":"+r+": "+T);if(j.reason=T,j.filename=t.source,j.line=n,j.column=r,j.source=e,!t.silent)throw j}function f(T){var j=T.exec(e);if(j){var A=j[0];return i(A),e=e.slice(A.length),j}}function v(){f(vu)}function l(T){var j;for(T=T||[];j=u();)j!==!1&&T.push(j);return T}function u(){var T=s();if(!(Do!=e.charAt(0)||Mo!=e.charAt(1))){for(var j=2;hn!=e.charAt(j)&&(Mo!=e.charAt(j)||Do!=e.charAt(j+1));)++j;if(j+=2,hn===e.charAt(j-1))return c("End of comment missing");var A=e.slice(2,j-2);return r+=2,i(A),e=e.slice(j),r+=2,T({type:Tu,comment:A})}}function S(){var T=s(),j=f(yu);if(j){if(u(),!f(bu))return c("property missing ':'");var A=f(xu),_=T({type:ju,property:Fo(j[0].replace(Ao,hn)),value:A?Fo(A[0].replace(Ao,hn)):hn});return f(wu),_}}function y(){var T=[];l(T);for(var j;j=S();)j!==!1&&(T.push(j),l(T));return T}return v(),y()};function Fo(e){return e?e.replace(Eu,hn):hn}var Ou=ku;function ea(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=Ou(e),s=typeof t=="function",a,c,f=0,v=i.length;f<v;f++)r=i[f],a=r.property,c=r.value,s?t(a,c,r):c&&(n||(n={}),n[a]=c);return n}_i.exports=ea;_i.exports.default=ea;var Iu=_i.exports;const Ru=Ti(Iu),Cu={}.hasOwnProperty;function Pu(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=_u(e),i=Du(e),s=Au(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 ta(e,c,{schema:n.space==="svg"?Vs:$c,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:Nu(e)})}function ta(e,t,n){const r=n.schema;let i=r,s=t.tagName;const a={},c=[];let f=-1,v;r.space==="html"&&s.toLowerCase()==="svg"&&(i=Vs,n.schema=i);for(v in t.properties)t.properties&&Cu.call(t.properties,v)&&Lu(a,v,t.properties[v],n,s);if(n.vdom&&(i.space==="html"?s=s.toUpperCase():i.space&&(a.namespace=Uc[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(ta(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 Lu(e,t,n,r,i){const s=Wc(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?zc(n):qc(n)),s.boolean&&r.hyperscript&&(n=""),s.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Mu(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[Kc[s.property]||s.property]=n:e[s.attribute]=n)}function _u(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Nu(e){return"context"in e&&"cleanup"in e}function Au(e){return e("div",{}).type==="VirtualNode"}function Du(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Mu(e,t){const n={};try{Ru(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 Fu=na;function na(e){if(typeof e=="string")return Wu(e);if(e==null)return zu;if(typeof e=="object")return("length"in e?Uu:$u)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Bu(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=na(e[r]);return t}function $u(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Uu(e){var t=Bu(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 Wu(e){return t;function t(n){return!!(n&&n.type===e)}}function zu(){return!0}var qu=Or,Ku=Fu,ra=!0,ia="skip",gr=!1;Or.CONTINUE=ra;Or.SKIP=ia;Or.EXIT=gr;function Or(e,t,n,r){var i;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),i=Ku(t),s(e,null,[]);function s(c,f,v){var l=[],u;return(!t||i(c,f,v[v.length-1]||null))&&(l=Bo(n(c,v)),l[0]===gr)?l:c.children&&l[0]!==ia?(u=Bo(a(c.children,v.concat(c))),u[0]===gr?u:l):l}function a(c,f){for(var v=-1,l=r?-1:1,u=(r?c.length:v)+l,S;u>v&&u<c.length;){if(S=s(c[u],u,f),S[0]===gr)return S;u=typeof S[1]=="number"?S[1]:u+l}}}function Bo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[ra,e]:[e]}var Gu=Rr,Ir=qu,Vu=Ir.CONTINUE,Hu=Ir.SKIP,Xu=Ir.EXIT;Rr.CONTINUE=Vu;Rr.SKIP=Hu;Rr.EXIT=Xu;function Rr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),Ir(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 Yu=Gu,Qu=Object.prototype.hasOwnProperty,Fr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Ju=function(t){return Yu(t,"element",Zu),t};function Zu(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Fr)!Qu.call(Fr,t)||e.properties[t]===void 0||(n=Fr[t],ed(e,n,e.properties[t]),delete e.properties[t])}}function ed(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 td=Ti(Ju);function nd(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 rd={}.hasOwnProperty,id=new Set(["table","thead","tbody","tfoot","tr"]);function od(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=Pu(i,n?td(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&&id.has(s)&&(c=c.filter(f=>!nd(f))),e.components&&rd.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 Ni({children:e}){return o.jsx(sd,{children:e})}const $o="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",sd=He(Y)`
30
+ `;var Li={exports:{}},Ao=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,gu=/\n/g,vu=/^\s*/,yu=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,bu=/^:\s*/,xu=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,wu=/^[;\s]*/,Eu=/^\s+|\s+$/g,Su=`
31
+ `,Do="/",Mo="*",hn="",Tu="comment",ju="declaration",ku=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 j=T.match(gu);j&&(n+=j.length);var A=T.lastIndexOf(Su);r=~A?T.length-A:r+T.length}function s(){var T={line:n,column:r};return function(j){return j.position=new a(T),v(),j}}function a(T){this.start=T,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function c(T){var j=new Error(t.source+":"+n+":"+r+": "+T);if(j.reason=T,j.filename=t.source,j.line=n,j.column=r,j.source=e,!t.silent)throw j}function f(T){var j=T.exec(e);if(j){var A=j[0];return i(A),e=e.slice(A.length),j}}function v(){f(vu)}function l(T){var j;for(T=T||[];j=u();)j!==!1&&T.push(j);return T}function u(){var T=s();if(!(Do!=e.charAt(0)||Mo!=e.charAt(1))){for(var j=2;hn!=e.charAt(j)&&(Mo!=e.charAt(j)||Do!=e.charAt(j+1));)++j;if(j+=2,hn===e.charAt(j-1))return c("End of comment missing");var A=e.slice(2,j-2);return r+=2,i(A),e=e.slice(j),r+=2,T({type:Tu,comment:A})}}function S(){var T=s(),j=f(yu);if(j){if(u(),!f(bu))return c("property missing ':'");var A=f(xu),L=T({type:ju,property:Fo(j[0].replace(Ao,hn)),value:A?Fo(A[0].replace(Ao,hn)):hn});return f(wu),L}}function y(){var T=[];l(T);for(var j;j=S();)j!==!1&&(T.push(j),l(T));return T}return v(),y()};function Fo(e){return e?e.replace(Eu,hn):hn}var Ou=ku;function ea(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=Ou(e),s=typeof t=="function",a,c,f=0,v=i.length;f<v;f++)r=i[f],a=r.property,c=r.value,s?t(a,c,r):c&&(n||(n={}),n[a]=c);return n}Li.exports=ea;Li.exports.default=ea;var Iu=Li.exports;const Ru=Ti(Iu),Cu={}.hasOwnProperty;function Pu(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Lu(e),i=Du(e),s=Au(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 ta(e,c,{schema:n.space==="svg"?Vs:$c,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:Nu(e)})}function ta(e,t,n){const r=n.schema;let i=r,s=t.tagName;const a={},c=[];let f=-1,v;r.space==="html"&&s.toLowerCase()==="svg"&&(i=Vs,n.schema=i);for(v in t.properties)t.properties&&Cu.call(t.properties,v)&&_u(a,v,t.properties[v],n,s);if(n.vdom&&(i.space==="html"?s=s.toUpperCase():i.space&&(a.namespace=Uc[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(ta(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 _u(e,t,n,r,i){const s=Wc(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?zc(n):qc(n)),s.boolean&&r.hyperscript&&(n=""),s.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Mu(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[Kc[s.property]||s.property]=n:e[s.attribute]=n)}function Lu(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Nu(e){return"context"in e&&"cleanup"in e}function Au(e){return e("div",{}).type==="VirtualNode"}function Du(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Mu(e,t){const n={};try{Ru(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 Fu=na;function na(e){if(typeof e=="string")return Wu(e);if(e==null)return zu;if(typeof e=="object")return("length"in e?Uu:$u)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Bu(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=na(e[r]);return t}function $u(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Uu(e){var t=Bu(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 Wu(e){return t;function t(n){return!!(n&&n.type===e)}}function zu(){return!0}var qu=Or,Ku=Fu,ra=!0,ia="skip",gr=!1;Or.CONTINUE=ra;Or.SKIP=ia;Or.EXIT=gr;function Or(e,t,n,r){var i;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),i=Ku(t),s(e,null,[]);function s(c,f,v){var l=[],u;return(!t||i(c,f,v[v.length-1]||null))&&(l=Bo(n(c,v)),l[0]===gr)?l:c.children&&l[0]!==ia?(u=Bo(a(c.children,v.concat(c))),u[0]===gr?u:l):l}function a(c,f){for(var v=-1,l=r?-1:1,u=(r?c.length:v)+l,S;u>v&&u<c.length;){if(S=s(c[u],u,f),S[0]===gr)return S;u=typeof S[1]=="number"?S[1]:u+l}}}function Bo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[ra,e]:[e]}var Gu=Rr,Ir=qu,Vu=Ir.CONTINUE,Hu=Ir.SKIP,Xu=Ir.EXIT;Rr.CONTINUE=Vu;Rr.SKIP=Hu;Rr.EXIT=Xu;function Rr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),Ir(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 Yu=Gu,Qu=Object.prototype.hasOwnProperty,Fr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Ju=function(t){return Yu(t,"element",Zu),t};function Zu(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Fr)!Qu.call(Fr,t)||e.properties[t]===void 0||(n=Fr[t],ed(e,n,e.properties[t]),delete e.properties[t])}}function ed(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 td=Ti(Ju);function nd(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 rd={}.hasOwnProperty,id=new Set(["table","thead","tbody","tfoot","tr"]);function od(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=Pu(i,n?td(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&&id.has(s)&&(c=c.filter(f=>!nd(f))),e.components&&rd.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 Ni({children:e}){return o.jsx(sd,{children:e})}const $o="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",sd=He(Y)`
32
32
  .highlight pre,
33
33
  pre {
34
34
  border-radius: 5px;
@@ -110,7 +110,7 @@ import{a9 as Il,j as o,H as N,ab as xt,ah as He,aa as Y,T as ge,v as qt,bt as wi
110
110
  margin-left: 2em;
111
111
  }
112
112
  }
113
- `;Ai.propTypes={blockletMeta:N.object.isRequired,locale:N.string.isRequired,handleDescEle:N.node};Ai.defaultProps={handleDescEle:""};function dd({...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 ",Bs.COPYRIGHT_OWNER," version 2020-08-28"]}),o.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),o.jsx("p",{children:"暂无"})]})}function hd(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 Di({installRelated:e,meta:t,show:n,onClose:r,components:i,loading:s}){const{t:a}=gt(),c=qt(u=>u.breakpoints.down("md"));if(!n)return null;const f=!s&&i.length===0,v=!s&&i.length!==0,l=40;return o.jsxs(ki,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(u,S)=>{S!=="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:pt,icon:"line-md:loading-loop"})}),f&&o.jsx(Y,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),v&&o.jsx(Y,{sx:{marginBottom:2},children:i.map(u=>{if(!u.meta)return null;const{required:S}=u;let y;return e||S?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:hd(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(Yc(`${((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:S?"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:pt,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)})})]})}Di.propTypes={meta:N.object,show:N.bool,onClose:N.func.isRequired,installRelated:N.func,components:N.array.isRequired,loading:N.bool.isRequired};Di.defaultProps={meta:null,show:!1,installRelated:!1};function fd(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function pd(e){const{api:t}=Ln(),[n]=Vl(),r=n.get("blocklet_meta_url")||fd(e),[i,s]=F.useState([]),[a,c]=F.useState(!1);return F.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 Mi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:i}){const s=Hl(),{t:a,locale:c}=gt(),[f,v]=F.useState(!1),{components:l,loading:u}=pd(n),S=Zs(n),y=r||(()=>{s(`/launch-blocklet/install${window.location.search}`)}),T=()=>{v(!0)},j=()=>{v(!1)};return o.jsxs(md,{children:[o.jsx("div",{className:"app-content",children:o.jsx("div",{className:"agreement",children:o.jsx("div",{className:"agreement-content",children:S?o.jsx(Ai,{blockletMeta:{data:n},locale:c,handleDescEle:i}):o.jsx(Y,{sx:{p:3},children:o.jsx(ge,{children:a("launchBlocklet.dockerBlockletCantInstall")})})})})}),o.jsxs(Y,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[u?o.jsx(pt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,S&&t&&(l!=null&&l.length)?o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[o.jsx(wi,{sx:{mr:.5},checked:e,onChange:A=>t(A.currentTarget.checked),control:o.jsx(Ei,{}),label:o.jsx("span",{children:a("launchBlocklet.installRelatedComponents")})}),o.jsx(Y,{sx:{"> button svg":{color:"primary.main"}},children:o.jsx(js,{size:"small",onClick:T,children:o.jsx(pt,{icon:"octicon:package-dependencies-16"})})})]}):null,o.jsx("div",{className:"button-container","data-cy":"agree-all",children:S?o.jsx(Li,{onContinue:y,description:o.jsx(dd,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}}):null})]}),o.jsx(Di,{installRelated:e,meta:n,show:f,onClose:j,components:l,loading:u})]})}Mi.propTypes={meta:N.object.isRequired,onClickNext:N.func,handleDescEle:N.node,installRelated:N.bool,onChangeInstallRelated:N.func};Mi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const md=He.div`
113
+ `;Ai.propTypes={blockletMeta:N.object.isRequired,locale:N.string.isRequired,handleDescEle:N.node};Ai.defaultProps={handleDescEle:""};function dd({...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 ",Bs.COPYRIGHT_OWNER," version 2020-08-28"]}),o.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),o.jsx("p",{children:"暂无"})]})}function hd(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 Di({installRelated:e,meta:t,show:n,onClose:r,components:i,loading:s}){const{t:a}=gt(),c=qt(u=>u.breakpoints.down("md"));if(!n)return null;const f=!s&&i.length===0,v=!s&&i.length!==0,l=40;return o.jsxs(ki,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(u,S)=>{S!=="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:pt,icon:"line-md:loading-loop"})}),f&&o.jsx(Y,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),v&&o.jsx(Y,{sx:{marginBottom:2},children:i.map(u=>{if(!u.meta)return null;const{required:S}=u;let y;return e||S?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:hd(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(Yc(`${((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:S?"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:pt,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)})})]})}Di.propTypes={meta:N.object,show:N.bool,onClose:N.func.isRequired,installRelated:N.func,components:N.array.isRequired,loading:N.bool.isRequired};Di.defaultProps={meta:null,show:!1,installRelated:!1};function fd(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function pd(e){const{api:t}=_n(),[n]=Vl(),r=n.get("blocklet_meta_url")||fd(e),[i,s]=F.useState([]),[a,c]=F.useState(!1);return F.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 Mi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:i}){const s=Hl(),{t:a,locale:c}=gt(),[f,v]=F.useState(!1),{components:l,loading:u}=pd(n),S=Zs(n),y=r||(()=>{s(`/launch-blocklet/install${window.location.search}`)}),T=()=>{v(!0)},j=()=>{v(!1)};return o.jsxs(md,{children:[o.jsx("div",{className:"app-content",children:o.jsx("div",{className:"agreement",children:o.jsx("div",{className:"agreement-content",children:S?o.jsx(Ai,{blockletMeta:{data:n},locale:c,handleDescEle:i}):o.jsx(Y,{sx:{p:3},children:o.jsx(ge,{children:a("launchBlocklet.dockerBlockletCantInstall")})})})})}),o.jsxs(Y,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[u?o.jsx(pt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,S&&t&&(l!=null&&l.length)?o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[o.jsx(wi,{sx:{mr:.5},checked:e,onChange:A=>t(A.currentTarget.checked),control:o.jsx(Ei,{}),label:o.jsx("span",{children:a("launchBlocklet.installRelatedComponents")})}),o.jsx(Y,{sx:{"> button svg":{color:"primary.main"}},children:o.jsx(js,{size:"small",onClick:T,children:o.jsx(pt,{icon:"octicon:package-dependencies-16"})})})]}):null,o.jsx("div",{className:"button-container","data-cy":"agree-all",children:S?o.jsx(_i,{onContinue:y,description:o.jsx(dd,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}}):null})]}),o.jsx(Di,{installRelated:e,meta:n,show:f,onClose:j,components:l,loading:u})]})}Mi.propTypes={meta:N.object.isRequired,onClickNext:N.func,handleDescEle:N.node,installRelated:N.bool,onChangeInstallRelated:N.func};Mi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const md=He.div`
114
114
  display: flex;
115
115
  flex-direction: column;
116
116
  align-items: center;
@@ -186,7 +186,7 @@ import{a9 as Il,j as o,H as N,ab as xt,ah as He,aa as Y,T as ge,v as qt,bt as wi
186
186
  padding-bottom: 16px;
187
187
  }
188
188
  }
189
- `;var sa={},Fi={exports:{}},aa={exports:{}},zn=aa.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-"+la(e)}}},Uo={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:la};Object.keys(zn).forEach(function(e){Object.keys(Uo).forEach(function(t){zn[e][t]||(zn[e][t]=Uo[t])}),zn[e].protocols_re=RegExp("^("+zn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function la(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var ca=aa.exports,Wo=ca,Rn=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},gd=Ye;function Ye(e,t,n,r,i,s,a){var c=this;c.type=e,Object.keys(Wo[e]).forEach(function(f){c[f]=Wo[e][f]}),c.user=t,c.auth=n,c.project=r,c.committish=i,c.default=s,c.opts=a||{}}Ye.prototype.hash=function(){return this.committish?"#"+this.committish:""};Ye.prototype._fill=function(e,t){if(e){var n=Rn({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=Rn(Rn({},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(S){return encodeURIComponent(S)}).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 v=e;return Object.keys(n).forEach(function(l){v=v.replace(new RegExp("[{]"+l+"[}]","g"),n[l])}),t.noGitPlus?v.replace(/^git[+]/,""):v}};Ye.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Ye.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Ye.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Rn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Ye.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Ye.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Ye.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Ye.prototype.git=function(e){return this._fill(this.gittemplate,e)};Ye.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Ye.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Ye.prototype.tarball=function(e){var t=Rn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Ye.prototype.file=function(e,t){return this._fill(this.filetemplate,Rn({path:e},t))};Ye.prototype.getDefaultRepresentation=function(){return this.default};Ye.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Br,zo;function vd(){return zo||(zo=1,Br=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Br}var yd=ve;ve.Node=mn;ve.create=ve;function ve(e){var t=this;if(t instanceof ve||(t=new ve),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}ve.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};ve.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++}};ve.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++}};ve.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)xd(this,arguments[e]);return this.length};ve.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)wd(this,arguments[e]);return this.length};ve.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}};ve.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}};ve.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};ve.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};ve.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};ve.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};ve.prototype.map=function(e,t){t=t||this;for(var n=new ve,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ve.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ve,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ve.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};ve.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};ve.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};ve.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};ve.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 ve;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};ve.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 ve;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};ve.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=bd(this,i,n[r]);return s};ve.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 bd(e,t,n){var r=t===e.head?new mn(n,null,t,e):new mn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function xd(e,t){e.tail=new mn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function wd(e,t){e.head=new mn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function mn(e,t,n,r){if(!(this instanceof mn))return new mn(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{vd()(ve)}catch{}const Ed=yd,fn=Symbol("max"),At=Symbol("length"),In=Symbol("lengthCalculator"),Hn=Symbol("allowStale"),pn=Symbol("maxAge"),Nt=Symbol("dispose"),qo=Symbol("noDisposeOnSet"),ze=Symbol("lruList"),yt=Symbol("cache"),ua=Symbol("updateAgeOnGet"),$r=()=>1;class Sd{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[fn]=t.max||1/0;const n=t.length||$r;if(this[In]=typeof n!="function"?$r:n,this[Hn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[pn]=t.maxAge||0,this[Nt]=t.dispose,this[qo]=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[fn]=t||1/0,qn(this)}get max(){return this[fn]}set allowStale(t){this[Hn]=!!t}get allowStale(){return this[Hn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[pn]=t,qn(this)}get maxAge(){return this[pn]}set lengthCalculator(t){typeof t!="function"&&(t=$r),t!==this[In]&&(this[In]=t,this[At]=0,this[ze].forEach(n=>{n.length=this[In](n.value,n.key),this[At]+=n.length})),qn(this)}get lengthCalculator(){return this[In]}get length(){return this[At]}get itemCount(){return this[ze].length}rforEach(t,n){n=n||this;for(let r=this[ze].tail;r!==null;){const i=r.prev;Ko(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[ze].head;r!==null;){const i=r.next;Ko(this,t,r,n),r=i}}keys(){return this[ze].toArray().map(t=>t.key)}values(){return this[ze].toArray().map(t=>t.value)}reset(){this[Nt]&&this[ze]&&this[ze].length&&this[ze].forEach(t=>this[Nt](t.key,t.value)),this[yt]=new Map,this[ze]=new Ed,this[At]=0}dump(){return this[ze].map(t=>xr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ze]}set(t,n,r){if(r=r||this[pn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[In](n,t);if(this[yt].has(t)){if(s>this[fn])return Cn(this,this[yt].get(t)),!1;const f=this[yt].get(t).value;return this[Nt]&&(this[qo]||this[Nt](t,f.value)),f.now=i,f.maxAge=r,f.value=n,this[At]+=s-f.length,f.length=s,this.get(t),qn(this),!0}const a=new Td(t,n,s,i,r);return a.length>this[fn]?(this[Nt]&&this[Nt](t,n),!1):(this[At]+=a.length,this[ze].unshift(a),this[yt].set(t,this[ze].head),qn(this),!0)}has(t){if(!this[yt].has(t))return!1;const n=this[yt].get(t).value;return!xr(this,n)}get(t){return Ur(this,t,!0)}peek(t){return Ur(this,t,!1)}pop(){const t=this[ze].tail;return t?(Cn(this,t),t.value):null}del(t){Cn(this,this[yt].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[yt].forEach((t,n)=>Ur(this,n,!1))}}const Ur=(e,t,n)=>{const r=e[yt].get(t);if(r){const i=r.value;if(xr(e,i)){if(Cn(e,r),!e[Hn])return}else n&&(e[ua]&&(r.value.now=Date.now()),e[ze].unshiftNode(r));return i.value}},xr=(e,t)=>{if(!t||!t.maxAge&&!e[pn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[pn]&&n>e[pn]},qn=e=>{if(e[At]>e[fn])for(let t=e[ze].tail;e[At]>e[fn]&&t!==null;){const n=t.prev;Cn(e,t),t=n}},Cn=(e,t)=>{if(t){const n=t.value;e[Nt]&&e[Nt](n.key,n.value),e[At]-=n.length,e[yt].delete(n.key),e[ze].removeNode(t)}};class Td{constructor(t,n,r,i,s){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Ko=(e,t,n,r)=>{let i=n.value;xr(e,i)&&(Cn(e,n),e[Hn]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var jd=Sd,oi=jc,Go=ca,kd=Fi.exports=gd,Od=jd,Wr=new Od({max:1e3}),Id={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Rd(e){return Id[e]||e.slice(0,-1)}var Cd={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Fi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Wr.has(n)||Wr.set(n,Pd(e,t)),Wr.get(n)}};function Pd(e,t){if(!(e==null||e==="")){var n=_d(Ld(e)?"github:"+e:e),r=Nd(n),i=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),s=Object.keys(Go).map(function(a){try{var c=Go[a],f=null;r.auth&&Cd[r.protocol]&&(f=r.auth);var v=r.hash?decodeURIComponent(r.hash.substr(1)):null,l=null,u=null,S=null;if(i&&i[1]===a)l=i[2]&&decodeURIComponent(i[2]),u=decodeURIComponent(i[3].replace(/\.git$/,"")),S="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]),S=Rd(r.protocol)}return new kd(a,l,f,u,v,S,t)}catch(j){if(!(j instanceof URIError))throw j}}).filter(function(a){return a});if(s.length===1)return s[0]}}function Ld(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function _d(e){var t=oi.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Nd(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 Ad=Fi.exports,gn={},te={},Dd=null;const Md=Object.freeze(Object.defineProperty({__proto__:null,default:Dd},Symbol.toStringTag,{value:"Module"})),da=ji(Md),Fd=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Bd=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var $d={charsWide:Fd,charsFullWidth:Bd};const{charsWide:Ud,charsFullWidth:Wd}=$d,ha=new RegExp(`[${Ud.join("")}${Wd.join("")}]`,"g"),zd=e=>e.replace(ha,"xx").length;var qd={default:zd,charsRegex:ha};/*!
189
+ `;var sa={},Fi={exports:{}},aa={exports:{}},zn=aa.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-"+la(e)}}},Uo={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:la};Object.keys(zn).forEach(function(e){Object.keys(Uo).forEach(function(t){zn[e][t]||(zn[e][t]=Uo[t])}),zn[e].protocols_re=RegExp("^("+zn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function la(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var ca=aa.exports,Wo=ca,Rn=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},gd=Ye;function Ye(e,t,n,r,i,s,a){var c=this;c.type=e,Object.keys(Wo[e]).forEach(function(f){c[f]=Wo[e][f]}),c.user=t,c.auth=n,c.project=r,c.committish=i,c.default=s,c.opts=a||{}}Ye.prototype.hash=function(){return this.committish?"#"+this.committish:""};Ye.prototype._fill=function(e,t){if(e){var n=Rn({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=Rn(Rn({},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(S){return encodeURIComponent(S)}).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 v=e;return Object.keys(n).forEach(function(l){v=v.replace(new RegExp("[{]"+l+"[}]","g"),n[l])}),t.noGitPlus?v.replace(/^git[+]/,""):v}};Ye.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Ye.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Ye.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Rn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Ye.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Ye.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Ye.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Ye.prototype.git=function(e){return this._fill(this.gittemplate,e)};Ye.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Ye.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Ye.prototype.tarball=function(e){var t=Rn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Ye.prototype.file=function(e,t){return this._fill(this.filetemplate,Rn({path:e},t))};Ye.prototype.getDefaultRepresentation=function(){return this.default};Ye.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Br,zo;function vd(){return zo||(zo=1,Br=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Br}var yd=ve;ve.Node=mn;ve.create=ve;function ve(e){var t=this;if(t instanceof ve||(t=new ve),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}ve.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};ve.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++}};ve.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++}};ve.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)xd(this,arguments[e]);return this.length};ve.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)wd(this,arguments[e]);return this.length};ve.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}};ve.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}};ve.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};ve.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};ve.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};ve.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};ve.prototype.map=function(e,t){t=t||this;for(var n=new ve,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ve.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ve,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ve.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};ve.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};ve.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};ve.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};ve.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 ve;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};ve.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 ve;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};ve.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=bd(this,i,n[r]);return s};ve.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 bd(e,t,n){var r=t===e.head?new mn(n,null,t,e):new mn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function xd(e,t){e.tail=new mn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function wd(e,t){e.head=new mn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function mn(e,t,n,r){if(!(this instanceof mn))return new mn(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{vd()(ve)}catch{}const Ed=yd,fn=Symbol("max"),At=Symbol("length"),In=Symbol("lengthCalculator"),Hn=Symbol("allowStale"),pn=Symbol("maxAge"),Nt=Symbol("dispose"),qo=Symbol("noDisposeOnSet"),ze=Symbol("lruList"),yt=Symbol("cache"),ua=Symbol("updateAgeOnGet"),$r=()=>1;class Sd{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[fn]=t.max||1/0;const n=t.length||$r;if(this[In]=typeof n!="function"?$r:n,this[Hn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[pn]=t.maxAge||0,this[Nt]=t.dispose,this[qo]=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[fn]=t||1/0,qn(this)}get max(){return this[fn]}set allowStale(t){this[Hn]=!!t}get allowStale(){return this[Hn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[pn]=t,qn(this)}get maxAge(){return this[pn]}set lengthCalculator(t){typeof t!="function"&&(t=$r),t!==this[In]&&(this[In]=t,this[At]=0,this[ze].forEach(n=>{n.length=this[In](n.value,n.key),this[At]+=n.length})),qn(this)}get lengthCalculator(){return this[In]}get length(){return this[At]}get itemCount(){return this[ze].length}rforEach(t,n){n=n||this;for(let r=this[ze].tail;r!==null;){const i=r.prev;Ko(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[ze].head;r!==null;){const i=r.next;Ko(this,t,r,n),r=i}}keys(){return this[ze].toArray().map(t=>t.key)}values(){return this[ze].toArray().map(t=>t.value)}reset(){this[Nt]&&this[ze]&&this[ze].length&&this[ze].forEach(t=>this[Nt](t.key,t.value)),this[yt]=new Map,this[ze]=new Ed,this[At]=0}dump(){return this[ze].map(t=>xr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ze]}set(t,n,r){if(r=r||this[pn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[In](n,t);if(this[yt].has(t)){if(s>this[fn])return Cn(this,this[yt].get(t)),!1;const f=this[yt].get(t).value;return this[Nt]&&(this[qo]||this[Nt](t,f.value)),f.now=i,f.maxAge=r,f.value=n,this[At]+=s-f.length,f.length=s,this.get(t),qn(this),!0}const a=new Td(t,n,s,i,r);return a.length>this[fn]?(this[Nt]&&this[Nt](t,n),!1):(this[At]+=a.length,this[ze].unshift(a),this[yt].set(t,this[ze].head),qn(this),!0)}has(t){if(!this[yt].has(t))return!1;const n=this[yt].get(t).value;return!xr(this,n)}get(t){return Ur(this,t,!0)}peek(t){return Ur(this,t,!1)}pop(){const t=this[ze].tail;return t?(Cn(this,t),t.value):null}del(t){Cn(this,this[yt].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[yt].forEach((t,n)=>Ur(this,n,!1))}}const Ur=(e,t,n)=>{const r=e[yt].get(t);if(r){const i=r.value;if(xr(e,i)){if(Cn(e,r),!e[Hn])return}else n&&(e[ua]&&(r.value.now=Date.now()),e[ze].unshiftNode(r));return i.value}},xr=(e,t)=>{if(!t||!t.maxAge&&!e[pn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[pn]&&n>e[pn]},qn=e=>{if(e[At]>e[fn])for(let t=e[ze].tail;e[At]>e[fn]&&t!==null;){const n=t.prev;Cn(e,t),t=n}},Cn=(e,t)=>{if(t){const n=t.value;e[Nt]&&e[Nt](n.key,n.value),e[At]-=n.length,e[yt].delete(n.key),e[ze].removeNode(t)}};class Td{constructor(t,n,r,i,s){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Ko=(e,t,n,r)=>{let i=n.value;xr(e,i)&&(Cn(e,n),e[Hn]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var jd=Sd,oi=jc,Go=ca,kd=Fi.exports=gd,Od=jd,Wr=new Od({max:1e3}),Id={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Rd(e){return Id[e]||e.slice(0,-1)}var Cd={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Fi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Wr.has(n)||Wr.set(n,Pd(e,t)),Wr.get(n)}};function Pd(e,t){if(!(e==null||e==="")){var n=Ld(_d(e)?"github:"+e:e),r=Nd(n),i=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),s=Object.keys(Go).map(function(a){try{var c=Go[a],f=null;r.auth&&Cd[r.protocol]&&(f=r.auth);var v=r.hash?decodeURIComponent(r.hash.substr(1)):null,l=null,u=null,S=null;if(i&&i[1]===a)l=i[2]&&decodeURIComponent(i[2]),u=decodeURIComponent(i[3].replace(/\.git$/,"")),S="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]),S=Rd(r.protocol)}return new kd(a,l,f,u,v,S,t)}catch(j){if(!(j instanceof URIError))throw j}}).filter(function(a){return a});if(s.length===1)return s[0]}}function _d(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Ld(e){var t=oi.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Nd(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 Ad=Fi.exports,gn={},te={},Dd=null;const Md=Object.freeze(Object.defineProperty({__proto__:null,default:Dd},Symbol.toStringTag,{value:"Module"})),da=ji(Md),Fd=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Bd=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var $d={charsWide:Fd,charsFullWidth:Bd};const{charsWide:Ud,charsFullWidth:Wd}=$d,ha=new RegExp(`[${Ud.join("")}${Wd.join("")}]`,"g"),zd=e=>e.replace(ha,"xx").length;var qd={default:zd,charsRegex:ha};/*!
190
190
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
191
191
  *
192
192
  * Copyright (c) 2014-2016, Jon Schlinkert.
@@ -196,10 +196,10 @@ import{a9 as Il,j as o,H as N,ab as xt,ah as He,aa as Y,T as ge,v as qt,bt as wi
196
196
  *
197
197
  * Copyright (c) 2014-2017, Jon Schlinkert.
198
198
  * Released under the MIT License.
199
- */var Gd=Kd,fa={"{":"}","(":")","[":"]"},Vd=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=fa[c];if(f){var v=e.indexOf(f,t);v!==-1&&(t=v+1)}if(e[t]==="!")return!0}else t++}return!1},Hd=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=fa[n];if(r){var i=e.indexOf(r,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1},Xd=function(t,n){if(typeof t!="string"||t==="")return!1;if(Gd(t))return!0;var r=Vd;return n&&n.strict===!1&&(r=Hd),r(t)},si={exports:{}};(function(e,t){var n={};t=e.exports=$;var r;typeof pc=="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=[],v=t.safeRe=[],l=t.src=[],u=t.tokens={},S=0;function y(d){u[d]=S++}var T="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",i],[T,c]];function A(d){for(var x=0;x<j.length;x++){var w=j[x][0],P=j[x][1];d=d.split(w+"*").join(w+"{0,"+P+"}").split(w+"+").join(w+"{1,"+P+"}")}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"),v[u.COERCERTL]=new RegExp(A(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"),v[u.TILDETRIM]=new RegExp(A(l[u.TILDETRIM]),"g");var _="$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"),v[u.CARETTRIM]=new RegExp(A(l[u.CARETTRIM]),"g");var D="$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"),v[u.COMPARATORTRIM]=new RegExp(A(l[u.COMPARATORTRIM]),"g");var B="$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 G=0;G<S;G++)r(G,l[G]),f[G]||(f[G]=new RegExp(l[G]),v[G]=new RegExp(A(l[G])));t.parse=k;function k(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $)return d;if(typeof d!="string"||d.length>i)return null;var w=x.loose?v[u.LOOSE]:v[u.FULL];if(!w.test(d))return null;try{return new $(d,x)}catch{return null}}t.valid=M;function M(d,x){var w=k(d,x);return w?w.version:null}t.clean=V;function V(d,x){var w=k(d.trim().replace(/^[=v]+/,""),x);return w?w.version:null}t.SemVer=$;function $(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $){if(d.loose===x.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 $))return new $(d,x);r("SemVer",d,x),this.options=x,this.loose=!!x.loose;var w=d.trim().match(x.loose?v[u.LOOSE]:v[u.FULL]);if(!w)throw new TypeError("Invalid Version: "+d);if(this.raw=d,this.major=+w[1],this.minor=+w[2],this.patch=+w[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");w[4]?this.prerelease=w[4].split(".").map(function(P){if(/^[0-9]+$/.test(P)){var I=+P;if(I>=0&&I<s)return I}return P}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(d){return r("SemVer.compare",this.version,this.options,d),d instanceof $||(d=new $(d,this.options)),this.compareMain(d)||this.comparePre(d)},$.prototype.compareMain=function(d){return d instanceof $||(d=new $(d,this.options)),je(this.major,d.major)||je(this.minor,d.minor)||je(this.patch,d.patch)},$.prototype.comparePre=function(d){if(d instanceof $||(d=new $(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 x=0;do{var w=this.prerelease[x],P=d.prerelease[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.compareBuild=function(d){d instanceof $||(d=new $(d,this.options));var x=0;do{var w=this.build[x],P=d.build[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.inc=function(d,x){switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",x),this.inc("pre",x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",x),this.inc("pre",x);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 w=this.prerelease.length;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);w===-1&&this.prerelease.push(0)}x&&(this.prerelease[0]===x?isNaN(this.prerelease[1])&&(this.prerelease=[x,0]):this.prerelease=[x,0]);break;default:throw new Error("invalid increment argument: "+d)}return this.format(),this.raw=this.version,this},t.inc=le;function le(d,x,w,P){typeof w=="string"&&(P=w,w=void 0);try{return new $(d,w).inc(x,P).version}catch{return null}}t.diff=H;function H(d,x){if(Ht(d,x))return null;var w=k(d),P=k(x),I="";if(w.prerelease.length||P.prerelease.length){I="pre";var L="prerelease"}for(var W in w)if((W==="major"||W==="minor"||W==="patch")&&w[W]!==P[W])return I+W;return L}t.compareIdentifiers=je;var se=/^[0-9]+$/;function je(d,x){var w=se.test(d),P=se.test(x);return w&&P&&(d=+d,x=+x),d===x?0:w&&!P?-1:P&&!w?1:d<x?-1:1}t.rcompareIdentifiers=We;function We(d,x){return je(x,d)}t.major=Me;function Me(d,x){return new $(d,x).major}t.minor=Qe;function Qe(d,x){return new $(d,x).minor}t.patch=Z;function Z(d,x){return new $(d,x).patch}t.compare=pe;function pe(d,x,w){return new $(d,w).compare(new $(x,w))}t.compareLoose=ee;function ee(d,x){return pe(d,x,!0)}t.compareBuild=ye;function ye(d,x,w){var P=new $(d,w),I=new $(x,w);return P.compare(I)||P.compareBuild(I)}t.rcompare=oe;function oe(d,x,w){return pe(x,d,w)}t.sort=Ae;function Ae(d,x){return d.sort(function(w,P){return t.compareBuild(w,P,x)})}t.rsort=we;function we(d,x){return d.sort(function(w,P){return t.compareBuild(P,w,x)})}t.gt=Je;function Je(d,x,w){return pe(d,x,w)>0}t.lt=qe;function qe(d,x,w){return pe(d,x,w)<0}t.eq=Ht;function Ht(d,x,w){return pe(d,x,w)===0}t.neq=Xt;function Xt(d,x,w){return pe(d,x,w)!==0}t.gte=Ft;function Ft(d,x,w){return pe(d,x,w)>=0}t.lte=Yt;function Yt(d,x,w){return pe(d,x,w)<=0}t.cmp=Pe;function Pe(d,x,w,P){switch(x){case"===":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d===w;case"!==":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d!==w;case"":case"=":case"==":return Ht(d,w,P);case"!=":return Xt(d,w,P);case">":return Je(d,w,P);case">=":return Ft(d,w,P);case"<":return qe(d,w,P);case"<=":return Yt(d,w,P);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=Le;function Le(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof Le){if(d.loose===!!x.loose)return d;d=d.value}if(!(this instanceof Le))return new Le(d,x);d=d.trim().split(/\s+/).join(" "),r("comparator",d,x),this.options=x,this.loose=!!x.loose,this.parse(d),this.semver===Ze?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Ze={};Le.prototype.parse=function(d){var x=this.options.loose?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],w=d.match(x);if(!w)throw new TypeError("Invalid comparator: "+d);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new $(w[2],this.options.loose):this.semver=Ze},Le.prototype.toString=function(){return this.value},Le.prototype.test=function(d){if(r("Comparator.test",d,this.options.loose),this.semver===Ze||d===Ze)return!0;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}return Pe(d,this.operator,this.semver,this.options)},Le.prototype.intersects=function(d,x){if(!(d instanceof Le))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new de(d.value,x),ot(this.value,w,x));if(d.operator==="")return d.value===""?!0:(w=new de(this.value,x),ot(d.semver,w,x));var P=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),I=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),L=this.semver.version===d.semver.version,W=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),ne=Pe(this.semver,"<",d.semver,x)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),ae=Pe(this.semver,">",d.semver,x)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return P||I||L&&W||ne||ae},t.Range=de;function de(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof de)return d.loose===!!x.loose&&d.includePrerelease===!!x.includePrerelease?d:new de(d.raw,x);if(d instanceof Le)return new de(d.value,x);if(!(this instanceof de))return new de(d,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=d.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(w){return this.parseRange(w.trim())},this).filter(function(w){return w.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}de.prototype.format=function(){return this.range=this.set.map(function(d){return d.join(" ").trim()}).join("||").trim(),this.range},de.prototype.toString=function(){return this.range},de.prototype.parseRange=function(d){var x=this.options.loose,w=x?v[u.HYPHENRANGELOOSE]:v[u.HYPHENRANGE];d=d.replace(w,tt),r("hyphen replace",d),d=d.replace(v[u.COMPARATORTRIM],B),r("comparator trim",d,v[u.COMPARATORTRIM]),d=d.replace(v[u.TILDETRIM],_),d=d.replace(v[u.CARETTRIM],D),d=d.split(/\s+/).join(" ");var P=x?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],I=d.split(" ").map(function(L){return Zt(L,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(I=I.filter(function(L){return!!L.match(P)})),I=I.map(function(L){return new Le(L,this.options)},this),I},de.prototype.intersects=function(d,x){if(!(d instanceof de))throw new TypeError("a Range is required");return this.set.some(function(w){return Qt(w,x)&&d.set.some(function(P){return Qt(P,x)&&w.every(function(I){return P.every(function(L){return I.intersects(L,x)})})})})};function Qt(d,x){for(var w=!0,P=d.slice(),I=P.pop();w&&P.length;)w=P.every(function(L){return I.intersects(L,x)}),I=P.pop();return w}t.toComparators=Jt;function Jt(d,x){return new de(d,x).set.map(function(w){return w.map(function(P){return P.value}).join(" ").trim().split(" ")})}function Zt(d,x){return r("comp",d,x),d=et(d,x),r("caret",d),d=Bt(d,x),r("tildes",d),d=tn(d,x),r("xrange",d),d=Fe(d,x),r("stars",d),d}function ke(d){return!d||d.toLowerCase()==="x"||d==="*"}function Bt(d,x){return d.trim().split(/\s+/).map(function(w){return Nn(w,x)}).join(" ")}function Nn(d,x){var w=x.loose?v[u.TILDELOOSE]:v[u.TILDE];return d.replace(w,function(P,I,L,W,ne){r("tilde",d,P,I,L,W,ne);var ae;return ke(I)?ae="":ke(L)?ae=">="+I+".0.0 <"+(+I+1)+".0.0":ke(W)?ae=">="+I+"."+L+".0 <"+I+"."+(+L+1)+".0":ne?(r("replaceTilde pr",ne),ae=">="+I+"."+L+"."+W+"-"+ne+" <"+I+"."+(+L+1)+".0"):ae=">="+I+"."+L+"."+W+" <"+I+"."+(+L+1)+".0",r("tilde return",ae),ae})}function et(d,x){return d.trim().split(/\s+/).map(function(w){return en(w,x)}).join(" ")}function en(d,x){r("caret",d,x);var w=x.loose?v[u.CARETLOOSE]:v[u.CARET];return d.replace(w,function(P,I,L,W,ne){r("caret",d,P,I,L,W,ne);var ae;return ke(I)?ae="":ke(L)?ae=">="+I+".0.0 <"+(+I+1)+".0.0":ke(W)?I==="0"?ae=">="+I+"."+L+".0 <"+I+"."+(+L+1)+".0":ae=">="+I+"."+L+".0 <"+(+I+1)+".0.0":ne?(r("replaceCaret pr",ne),I==="0"?L==="0"?ae=">="+I+"."+L+"."+W+"-"+ne+" <"+I+"."+L+"."+(+W+1):ae=">="+I+"."+L+"."+W+"-"+ne+" <"+I+"."+(+L+1)+".0":ae=">="+I+"."+L+"."+W+"-"+ne+" <"+(+I+1)+".0.0"):(r("no pr"),I==="0"?L==="0"?ae=">="+I+"."+L+"."+W+" <"+I+"."+L+"."+(+W+1):ae=">="+I+"."+L+"."+W+" <"+I+"."+(+L+1)+".0":ae=">="+I+"."+L+"."+W+" <"+(+I+1)+".0.0"),r("caret return",ae),ae})}function tn(d,x){return r("replaceXRanges",d,x),d.split(/\s+/).map(function(w){return nn(w,x)}).join(" ")}function nn(d,x){d=d.trim();var w=x.loose?v[u.XRANGELOOSE]:v[u.XRANGE];return d.replace(w,function(P,I,L,W,ne,ae){r("xRange",d,P,I,L,W,ne,ae);var Be=ke(L),Ne=Be||ke(W),Ee=Ne||ke(ne),Te=Ee;return I==="="&&Te&&(I=""),ae=x.includePrerelease?"-0":"",Be?I===">"||I==="<"?P="<0.0.0-0":P="*":I&&Te?(Ne&&(W=0),ne=0,I===">"?(I=">=",Ne?(L=+L+1,W=0,ne=0):(W=+W+1,ne=0)):I==="<="&&(I="<",Ne?L=+L+1:W=+W+1),P=I+L+"."+W+"."+ne+ae):Ne?P=">="+L+".0.0"+ae+" <"+(+L+1)+".0.0"+ae:Ee&&(P=">="+L+"."+W+".0"+ae+" <"+L+"."+(+W+1)+".0"+ae),r("xRange return",P),P})}function Fe(d,x){return r("replaceStars",d,x),d.trim().replace(v[u.STAR],"")}function tt(d,x,w,P,I,L,W,ne,ae,Be,Ne,Ee,Te){return ke(w)?x="":ke(P)?x=">="+w+".0.0":ke(I)?x=">="+w+"."+P+".0":x=">="+x,ke(ae)?ne="":ke(Be)?ne="<"+(+ae+1)+".0.0":ke(Ne)?ne="<"+ae+"."+(+Be+1)+".0":Ee?ne="<="+ae+"."+Be+"."+Ne+"-"+Ee:ne="<="+ne,(x+" "+ne).trim()}de.prototype.test=function(d){if(!d)return!1;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(wt(this.set[x],d,this.options))return!0;return!1};function wt(d,x,w){for(var P=0;P<d.length;P++)if(!d[P].test(x))return!1;if(x.prerelease.length&&!w.includePrerelease){for(P=0;P<d.length;P++)if(r(d[P].semver),d[P].semver!==Ze&&d[P].semver.prerelease.length>0){var I=d[P].semver;if(I.major===x.major&&I.minor===x.minor&&I.patch===x.patch)return!0}return!1}return!0}t.satisfies=ot;function ot(d,x,w){try{x=new de(x,w)}catch{return!1}return x.test(d)}t.maxSatisfying=Et;function Et(d,x,w){var P=null,I=null;try{var L=new de(x,w)}catch{return null}return d.forEach(function(W){L.test(W)&&(!P||I.compare(W)===-1)&&(P=W,I=new $(P,w))}),P}t.minSatisfying=It;function It(d,x,w){var P=null,I=null;try{var L=new de(x,w)}catch{return null}return d.forEach(function(W){L.test(W)&&(!P||I.compare(W)===1)&&(P=W,I=new $(P,w))}),P}t.minVersion=Ke;function Ke(d,x){d=new de(d,x);var w=new $("0.0.0");if(d.test(w)||(w=new $("0.0.0-0"),d.test(w)))return w;w=null;for(var P=0;P<d.set.length;++P){var I=d.set[P];I.forEach(function(L){var W=new $(L.semver.version);switch(L.operator){case">":W.prerelease.length===0?W.patch++:W.prerelease.push(0),W.raw=W.format();case"":case">=":(!w||Je(w,W))&&(w=W);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+L.operator)}})}return w&&d.test(w)?w:null}t.validRange=xn;function xn(d,x){try{return new de(d,x).range||"*"}catch{return null}}t.ltr=rn;function rn(d,x,w){return C(d,x,"<",w)}t.gtr=wn;function wn(d,x,w){return C(d,x,">",w)}t.outside=C;function C(d,x,w,P){d=new $(d,P),x=new de(x,P);var I,L,W,ne,ae;switch(w){case">":I=Je,L=Yt,W=qe,ne=">",ae=">=";break;case"<":I=qe,L=Ft,W=Je,ne="<",ae="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ot(d,x,P))return!1;for(var Be=0;Be<x.set.length;++Be){var Ne=x.set[Be],Ee=null,Te=null;if(Ne.forEach(function(Xe){Xe.semver===Ze&&(Xe=new Le(">=0.0.0")),Ee=Ee||Xe,Te=Te||Xe,I(Xe.semver,Ee.semver,P)?Ee=Xe:W(Xe.semver,Te.semver,P)&&(Te=Xe)}),Ee.operator===ne||Ee.operator===ae||(!Te.operator||Te.operator===ne)&&L(d,Te.semver))return!1;if(Te.operator===ae&&W(d,Te.semver))return!1}return!0}t.prerelease=St;function St(d,x){var w=k(d,x);return w&&w.prerelease.length?w.prerelease:null}t.intersects=Rt;function Rt(d,x,w){return d=new de(d,w),x=new de(x,w),d.intersects(x)}t.coerce=on;function on(d,x){if(d instanceof $)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;x=x||{};var w=null;if(!x.rtl)w=d.match(v[u.COERCE]);else{for(var P;(P=v[u.COERCERTL].exec(d))&&(!w||w.index+w[0].length!==d.length);)(!w||P.index+P[0].length!==w.index+w[0].length)&&(w=P),v[u.COERCERTL].lastIndex=P.index+P[1].length+P[2].length;v[u.COERCERTL].lastIndex=-1}return w===null?null:k(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),x)}})(si,si.exports);var Yd=si.exports;const pa=Ds,Ot=Yd,Ue="semver",Qd={base:pa.string(),type:"semverRange",validate:function(e,{error:t}){return Ot.validRange(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver range"}},bn={};bn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{exp:n})},args:[{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});bn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Ot.cmp(e,n,r)?e:t.error(`${Ue}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};bn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{rng:n})},args:[{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});bn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Ot.outside(e,r,n)?e:t.error(`${Ue}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};const Jd={base:pa.string(),type:"semver",validate:function(e,{error:t}){return Ot.valid(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Ue}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Ue}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Ue}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Ue}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Ue}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Ue}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Ue}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Ue}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Ue}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Ue}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Ue}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:bn};var Zd={semver:Jd,semverRange:Qd};/*!
199
+ */var Gd=Kd,fa={"{":"}","(":")","[":"]"},Vd=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=fa[c];if(f){var v=e.indexOf(f,t);v!==-1&&(t=v+1)}if(e[t]==="!")return!0}else t++}return!1},Hd=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=fa[n];if(r){var i=e.indexOf(r,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1},Xd=function(t,n){if(typeof t!="string"||t==="")return!1;if(Gd(t))return!0;var r=Vd;return n&&n.strict===!1&&(r=Hd),r(t)},si={exports:{}};(function(e,t){var n={};t=e.exports=$;var r;typeof pc=="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=[],v=t.safeRe=[],l=t.src=[],u=t.tokens={},S=0;function y(d){u[d]=S++}var T="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",i],[T,c]];function A(d){for(var x=0;x<j.length;x++){var w=j[x][0],P=j[x][1];d=d.split(w+"*").join(w+"{0,"+P+"}").split(w+"+").join(w+"{1,"+P+"}")}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"),v[u.COERCERTL]=new RegExp(A(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"),v[u.TILDETRIM]=new RegExp(A(l[u.TILDETRIM]),"g");var L="$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"),v[u.CARETTRIM]=new RegExp(A(l[u.CARETTRIM]),"g");var D="$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"),v[u.COMPARATORTRIM]=new RegExp(A(l[u.COMPARATORTRIM]),"g");var B="$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 G=0;G<S;G++)r(G,l[G]),f[G]||(f[G]=new RegExp(l[G]),v[G]=new RegExp(A(l[G])));t.parse=k;function k(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $)return d;if(typeof d!="string"||d.length>i)return null;var w=x.loose?v[u.LOOSE]:v[u.FULL];if(!w.test(d))return null;try{return new $(d,x)}catch{return null}}t.valid=M;function M(d,x){var w=k(d,x);return w?w.version:null}t.clean=V;function V(d,x){var w=k(d.trim().replace(/^[=v]+/,""),x);return w?w.version:null}t.SemVer=$;function $(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $){if(d.loose===x.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 $))return new $(d,x);r("SemVer",d,x),this.options=x,this.loose=!!x.loose;var w=d.trim().match(x.loose?v[u.LOOSE]:v[u.FULL]);if(!w)throw new TypeError("Invalid Version: "+d);if(this.raw=d,this.major=+w[1],this.minor=+w[2],this.patch=+w[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");w[4]?this.prerelease=w[4].split(".").map(function(P){if(/^[0-9]+$/.test(P)){var I=+P;if(I>=0&&I<s)return I}return P}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(d){return r("SemVer.compare",this.version,this.options,d),d instanceof $||(d=new $(d,this.options)),this.compareMain(d)||this.comparePre(d)},$.prototype.compareMain=function(d){return d instanceof $||(d=new $(d,this.options)),je(this.major,d.major)||je(this.minor,d.minor)||je(this.patch,d.patch)},$.prototype.comparePre=function(d){if(d instanceof $||(d=new $(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 x=0;do{var w=this.prerelease[x],P=d.prerelease[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.compareBuild=function(d){d instanceof $||(d=new $(d,this.options));var x=0;do{var w=this.build[x],P=d.build[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.inc=function(d,x){switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",x),this.inc("pre",x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",x),this.inc("pre",x);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 w=this.prerelease.length;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);w===-1&&this.prerelease.push(0)}x&&(this.prerelease[0]===x?isNaN(this.prerelease[1])&&(this.prerelease=[x,0]):this.prerelease=[x,0]);break;default:throw new Error("invalid increment argument: "+d)}return this.format(),this.raw=this.version,this},t.inc=le;function le(d,x,w,P){typeof w=="string"&&(P=w,w=void 0);try{return new $(d,w).inc(x,P).version}catch{return null}}t.diff=H;function H(d,x){if(Ht(d,x))return null;var w=k(d),P=k(x),I="";if(w.prerelease.length||P.prerelease.length){I="pre";var _="prerelease"}for(var W in w)if((W==="major"||W==="minor"||W==="patch")&&w[W]!==P[W])return I+W;return _}t.compareIdentifiers=je;var se=/^[0-9]+$/;function je(d,x){var w=se.test(d),P=se.test(x);return w&&P&&(d=+d,x=+x),d===x?0:w&&!P?-1:P&&!w?1:d<x?-1:1}t.rcompareIdentifiers=We;function We(d,x){return je(x,d)}t.major=Me;function Me(d,x){return new $(d,x).major}t.minor=Qe;function Qe(d,x){return new $(d,x).minor}t.patch=Z;function Z(d,x){return new $(d,x).patch}t.compare=pe;function pe(d,x,w){return new $(d,w).compare(new $(x,w))}t.compareLoose=ee;function ee(d,x){return pe(d,x,!0)}t.compareBuild=ye;function ye(d,x,w){var P=new $(d,w),I=new $(x,w);return P.compare(I)||P.compareBuild(I)}t.rcompare=oe;function oe(d,x,w){return pe(x,d,w)}t.sort=Ae;function Ae(d,x){return d.sort(function(w,P){return t.compareBuild(w,P,x)})}t.rsort=we;function we(d,x){return d.sort(function(w,P){return t.compareBuild(P,w,x)})}t.gt=Je;function Je(d,x,w){return pe(d,x,w)>0}t.lt=qe;function qe(d,x,w){return pe(d,x,w)<0}t.eq=Ht;function Ht(d,x,w){return pe(d,x,w)===0}t.neq=Xt;function Xt(d,x,w){return pe(d,x,w)!==0}t.gte=Ft;function Ft(d,x,w){return pe(d,x,w)>=0}t.lte=Yt;function Yt(d,x,w){return pe(d,x,w)<=0}t.cmp=Pe;function Pe(d,x,w,P){switch(x){case"===":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d===w;case"!==":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d!==w;case"":case"=":case"==":return Ht(d,w,P);case"!=":return Xt(d,w,P);case">":return Je(d,w,P);case">=":return Ft(d,w,P);case"<":return qe(d,w,P);case"<=":return Yt(d,w,P);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=_e;function _e(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof _e){if(d.loose===!!x.loose)return d;d=d.value}if(!(this instanceof _e))return new _e(d,x);d=d.trim().split(/\s+/).join(" "),r("comparator",d,x),this.options=x,this.loose=!!x.loose,this.parse(d),this.semver===Ze?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Ze={};_e.prototype.parse=function(d){var x=this.options.loose?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],w=d.match(x);if(!w)throw new TypeError("Invalid comparator: "+d);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new $(w[2],this.options.loose):this.semver=Ze},_e.prototype.toString=function(){return this.value},_e.prototype.test=function(d){if(r("Comparator.test",d,this.options.loose),this.semver===Ze||d===Ze)return!0;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}return Pe(d,this.operator,this.semver,this.options)},_e.prototype.intersects=function(d,x){if(!(d instanceof _e))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new de(d.value,x),ot(this.value,w,x));if(d.operator==="")return d.value===""?!0:(w=new de(this.value,x),ot(d.semver,w,x));var P=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),I=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),_=this.semver.version===d.semver.version,W=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),ne=Pe(this.semver,"<",d.semver,x)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),ae=Pe(this.semver,">",d.semver,x)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return P||I||_&&W||ne||ae},t.Range=de;function de(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof de)return d.loose===!!x.loose&&d.includePrerelease===!!x.includePrerelease?d:new de(d.raw,x);if(d instanceof _e)return new de(d.value,x);if(!(this instanceof de))return new de(d,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=d.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(w){return this.parseRange(w.trim())},this).filter(function(w){return w.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}de.prototype.format=function(){return this.range=this.set.map(function(d){return d.join(" ").trim()}).join("||").trim(),this.range},de.prototype.toString=function(){return this.range},de.prototype.parseRange=function(d){var x=this.options.loose,w=x?v[u.HYPHENRANGELOOSE]:v[u.HYPHENRANGE];d=d.replace(w,tt),r("hyphen replace",d),d=d.replace(v[u.COMPARATORTRIM],B),r("comparator trim",d,v[u.COMPARATORTRIM]),d=d.replace(v[u.TILDETRIM],L),d=d.replace(v[u.CARETTRIM],D),d=d.split(/\s+/).join(" ");var P=x?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],I=d.split(" ").map(function(_){return Zt(_,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(I=I.filter(function(_){return!!_.match(P)})),I=I.map(function(_){return new _e(_,this.options)},this),I},de.prototype.intersects=function(d,x){if(!(d instanceof de))throw new TypeError("a Range is required");return this.set.some(function(w){return Qt(w,x)&&d.set.some(function(P){return Qt(P,x)&&w.every(function(I){return P.every(function(_){return I.intersects(_,x)})})})})};function Qt(d,x){for(var w=!0,P=d.slice(),I=P.pop();w&&P.length;)w=P.every(function(_){return I.intersects(_,x)}),I=P.pop();return w}t.toComparators=Jt;function Jt(d,x){return new de(d,x).set.map(function(w){return w.map(function(P){return P.value}).join(" ").trim().split(" ")})}function Zt(d,x){return r("comp",d,x),d=et(d,x),r("caret",d),d=Bt(d,x),r("tildes",d),d=tn(d,x),r("xrange",d),d=Fe(d,x),r("stars",d),d}function ke(d){return!d||d.toLowerCase()==="x"||d==="*"}function Bt(d,x){return d.trim().split(/\s+/).map(function(w){return Nn(w,x)}).join(" ")}function Nn(d,x){var w=x.loose?v[u.TILDELOOSE]:v[u.TILDE];return d.replace(w,function(P,I,_,W,ne){r("tilde",d,P,I,_,W,ne);var ae;return ke(I)?ae="":ke(_)?ae=">="+I+".0.0 <"+(+I+1)+".0.0":ke(W)?ae=">="+I+"."+_+".0 <"+I+"."+(+_+1)+".0":ne?(r("replaceTilde pr",ne),ae=">="+I+"."+_+"."+W+"-"+ne+" <"+I+"."+(+_+1)+".0"):ae=">="+I+"."+_+"."+W+" <"+I+"."+(+_+1)+".0",r("tilde return",ae),ae})}function et(d,x){return d.trim().split(/\s+/).map(function(w){return en(w,x)}).join(" ")}function en(d,x){r("caret",d,x);var w=x.loose?v[u.CARETLOOSE]:v[u.CARET];return d.replace(w,function(P,I,_,W,ne){r("caret",d,P,I,_,W,ne);var ae;return ke(I)?ae="":ke(_)?ae=">="+I+".0.0 <"+(+I+1)+".0.0":ke(W)?I==="0"?ae=">="+I+"."+_+".0 <"+I+"."+(+_+1)+".0":ae=">="+I+"."+_+".0 <"+(+I+1)+".0.0":ne?(r("replaceCaret pr",ne),I==="0"?_==="0"?ae=">="+I+"."+_+"."+W+"-"+ne+" <"+I+"."+_+"."+(+W+1):ae=">="+I+"."+_+"."+W+"-"+ne+" <"+I+"."+(+_+1)+".0":ae=">="+I+"."+_+"."+W+"-"+ne+" <"+(+I+1)+".0.0"):(r("no pr"),I==="0"?_==="0"?ae=">="+I+"."+_+"."+W+" <"+I+"."+_+"."+(+W+1):ae=">="+I+"."+_+"."+W+" <"+I+"."+(+_+1)+".0":ae=">="+I+"."+_+"."+W+" <"+(+I+1)+".0.0"),r("caret return",ae),ae})}function tn(d,x){return r("replaceXRanges",d,x),d.split(/\s+/).map(function(w){return nn(w,x)}).join(" ")}function nn(d,x){d=d.trim();var w=x.loose?v[u.XRANGELOOSE]:v[u.XRANGE];return d.replace(w,function(P,I,_,W,ne,ae){r("xRange",d,P,I,_,W,ne,ae);var Be=ke(_),Ne=Be||ke(W),Ee=Ne||ke(ne),Te=Ee;return I==="="&&Te&&(I=""),ae=x.includePrerelease?"-0":"",Be?I===">"||I==="<"?P="<0.0.0-0":P="*":I&&Te?(Ne&&(W=0),ne=0,I===">"?(I=">=",Ne?(_=+_+1,W=0,ne=0):(W=+W+1,ne=0)):I==="<="&&(I="<",Ne?_=+_+1:W=+W+1),P=I+_+"."+W+"."+ne+ae):Ne?P=">="+_+".0.0"+ae+" <"+(+_+1)+".0.0"+ae:Ee&&(P=">="+_+"."+W+".0"+ae+" <"+_+"."+(+W+1)+".0"+ae),r("xRange return",P),P})}function Fe(d,x){return r("replaceStars",d,x),d.trim().replace(v[u.STAR],"")}function tt(d,x,w,P,I,_,W,ne,ae,Be,Ne,Ee,Te){return ke(w)?x="":ke(P)?x=">="+w+".0.0":ke(I)?x=">="+w+"."+P+".0":x=">="+x,ke(ae)?ne="":ke(Be)?ne="<"+(+ae+1)+".0.0":ke(Ne)?ne="<"+ae+"."+(+Be+1)+".0":Ee?ne="<="+ae+"."+Be+"."+Ne+"-"+Ee:ne="<="+ne,(x+" "+ne).trim()}de.prototype.test=function(d){if(!d)return!1;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(wt(this.set[x],d,this.options))return!0;return!1};function wt(d,x,w){for(var P=0;P<d.length;P++)if(!d[P].test(x))return!1;if(x.prerelease.length&&!w.includePrerelease){for(P=0;P<d.length;P++)if(r(d[P].semver),d[P].semver!==Ze&&d[P].semver.prerelease.length>0){var I=d[P].semver;if(I.major===x.major&&I.minor===x.minor&&I.patch===x.patch)return!0}return!1}return!0}t.satisfies=ot;function ot(d,x,w){try{x=new de(x,w)}catch{return!1}return x.test(d)}t.maxSatisfying=Et;function Et(d,x,w){var P=null,I=null;try{var _=new de(x,w)}catch{return null}return d.forEach(function(W){_.test(W)&&(!P||I.compare(W)===-1)&&(P=W,I=new $(P,w))}),P}t.minSatisfying=It;function It(d,x,w){var P=null,I=null;try{var _=new de(x,w)}catch{return null}return d.forEach(function(W){_.test(W)&&(!P||I.compare(W)===1)&&(P=W,I=new $(P,w))}),P}t.minVersion=Ke;function Ke(d,x){d=new de(d,x);var w=new $("0.0.0");if(d.test(w)||(w=new $("0.0.0-0"),d.test(w)))return w;w=null;for(var P=0;P<d.set.length;++P){var I=d.set[P];I.forEach(function(_){var W=new $(_.semver.version);switch(_.operator){case">":W.prerelease.length===0?W.patch++:W.prerelease.push(0),W.raw=W.format();case"":case">=":(!w||Je(w,W))&&(w=W);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+_.operator)}})}return w&&d.test(w)?w:null}t.validRange=xn;function xn(d,x){try{return new de(d,x).range||"*"}catch{return null}}t.ltr=rn;function rn(d,x,w){return C(d,x,"<",w)}t.gtr=wn;function wn(d,x,w){return C(d,x,">",w)}t.outside=C;function C(d,x,w,P){d=new $(d,P),x=new de(x,P);var I,_,W,ne,ae;switch(w){case">":I=Je,_=Yt,W=qe,ne=">",ae=">=";break;case"<":I=qe,_=Ft,W=Je,ne="<",ae="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ot(d,x,P))return!1;for(var Be=0;Be<x.set.length;++Be){var Ne=x.set[Be],Ee=null,Te=null;if(Ne.forEach(function(Xe){Xe.semver===Ze&&(Xe=new _e(">=0.0.0")),Ee=Ee||Xe,Te=Te||Xe,I(Xe.semver,Ee.semver,P)?Ee=Xe:W(Xe.semver,Te.semver,P)&&(Te=Xe)}),Ee.operator===ne||Ee.operator===ae||(!Te.operator||Te.operator===ne)&&_(d,Te.semver))return!1;if(Te.operator===ae&&W(d,Te.semver))return!1}return!0}t.prerelease=St;function St(d,x){var w=k(d,x);return w&&w.prerelease.length?w.prerelease:null}t.intersects=Rt;function Rt(d,x,w){return d=new de(d,w),x=new de(x,w),d.intersects(x)}t.coerce=on;function on(d,x){if(d instanceof $)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;x=x||{};var w=null;if(!x.rtl)w=d.match(v[u.COERCE]);else{for(var P;(P=v[u.COERCERTL].exec(d))&&(!w||w.index+w[0].length!==d.length);)(!w||P.index+P[0].length!==w.index+w[0].length)&&(w=P),v[u.COERCERTL].lastIndex=P.index+P[1].length+P[2].length;v[u.COERCERTL].lastIndex=-1}return w===null?null:k(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),x)}})(si,si.exports);var Yd=si.exports;const pa=Ds,Ot=Yd,Ue="semver",Qd={base:pa.string(),type:"semverRange",validate:function(e,{error:t}){return Ot.validRange(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver range"}},bn={};bn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{exp:n})},args:[{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});bn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Ot.cmp(e,n,r)?e:t.error(`${Ue}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};bn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{rng:n})},args:[{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});bn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Ot.outside(e,r,n)?e:t.error(`${Ue}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};const Jd={base:pa.string(),type:"semver",validate:function(e,{error:t}){return Ot.valid(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Ue}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Ue}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Ue}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Ue}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Ue}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Ue}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Ue}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Ue}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Ue}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Ue}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Ue}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:bn};var Zd={semver:Jd,semverRange:Qd};/*!
200
200
  * is-var-name | ISC (c) Shinnosuke Watanabe
201
201
  * https://github.com/shinnn/is-var-name
202
- */function eh(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const th=Object.freeze(Object.defineProperty({__proto__:null,default:eh},Symbol.toStringTag,{value:"Module"})),nh=ji(th),rh=ji(Yl),ih=ec,oh=tc,Vo=Tr,sh=e=>{if((0,Vo.isValid)(e))return e;const t=(0,oh.toHex)(mc.from(typeof e=="string"?e.trim():e));return(0,Vo.fromPublicKey)(t,{role:ih.types.RoleType.ROLE_ANY})};var ah=sh,vn={},ma=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vn,"__esModule",{value:!0});vn.didExtension=vn.fileExtension=void 0;const Ho=ma(da),lh=ma(Qc),ch=Tr,ga=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=>Ho.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 Ho.default.statSync(lh.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})}}}}});vn.fileExtension=ga;const va=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,ch.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'}});vn.didExtension=va;vn.default={fileExtension:ga,didExtension:va};var Bi={},ya={exports:{}};const uh=["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 ba=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),dh=uh,hh=["node_modules","favicon.ico"],fh=ya.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Kn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Kn(t,n);if(typeof e!="string")return n.push("name must be a string"),Kn(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"),hh.forEach(function(a){e.toLowerCase()===a&&n.push(a+" is a blacklisted name")}),dh.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(ba);if(r){var i=r[1],s=r[2];if(encodeURIComponent(i)===i&&encodeURIComponent(s)===s)return Kn(t,n)}n.push("name can only contain URL-friendly characters")}return Kn(t,n)};fh.scopedPackagePattern=ba;var Kn=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},ph=ya.exports;(function(e){var t=Se&&Se.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=Tr,r=t(ph),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:v,errors:l=[],warnings:u=[]}=(0,r.default)(c);if(!v)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}})(Bi);var mh=Se&&Se.__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]}),gh=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vh=Se&&Se.__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"&&mh(n,t,r[i]);return gh(n,t),n}}(),_n=Se&&Se.__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 yh=_n(da),bh=_n(Ds),xh=_n(qd),wh=_n(Xd),Xo=Zd,Eh=_n(nh),Yo=Bs,Sh=Tr,Th=rh,Re=kt,jh=_n(ah),Qo=vn,ai=Bi,$i=vh(kc),kh=xh.default.default,Jo="/.well-known",h=bh.default.extend(Xo.semver).extend(Xo.semverRange).extend(Qo.fileExtension).extend(Qo.didExtension);te.Joi=h;const Zo=(e,t)=>(0,$i.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
202
+ */function eh(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const th=Object.freeze(Object.defineProperty({__proto__:null,default:eh},Symbol.toStringTag,{value:"Module"})),nh=ji(th),rh=ji(Yl),ih=ec,oh=tc,Vo=Tr,sh=e=>{if((0,Vo.isValid)(e))return e;const t=(0,oh.toHex)(mc.from(typeof e=="string"?e.trim():e));return(0,Vo.fromPublicKey)(t,{role:ih.types.RoleType.ROLE_ANY})};var ah=sh,vn={},ma=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vn,"__esModule",{value:!0});vn.didExtension=vn.fileExtension=void 0;const Ho=ma(da),lh=ma(Qc),ch=Tr,ga=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=>Ho.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 Ho.default.statSync(lh.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})}}}}});vn.fileExtension=ga;const va=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,ch.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'}});vn.didExtension=va;vn.default={fileExtension:ga,didExtension:va};var Bi={},ya={exports:{}};const uh=["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 ba=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),dh=uh,hh=["node_modules","favicon.ico"],fh=ya.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Kn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Kn(t,n);if(typeof e!="string")return n.push("name must be a string"),Kn(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"),hh.forEach(function(a){e.toLowerCase()===a&&n.push(a+" is a blacklisted name")}),dh.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(ba);if(r){var i=r[1],s=r[2];if(encodeURIComponent(i)===i&&encodeURIComponent(s)===s)return Kn(t,n)}n.push("name can only contain URL-friendly characters")}return Kn(t,n)};fh.scopedPackagePattern=ba;var Kn=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},ph=ya.exports;(function(e){var t=Se&&Se.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=Tr,r=t(ph),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:v,errors:l=[],warnings:u=[]}=(0,r.default)(c);if(!v)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}})(Bi);var mh=Se&&Se.__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]}),gh=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vh=Se&&Se.__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"&&mh(n,t,r[i]);return gh(n,t),n}}(),Ln=Se&&Se.__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 yh=Ln(da),bh=Ln(Ds),xh=Ln(qd),wh=Ln(Xd),Xo=Zd,Eh=Ln(nh),Yo=Bs,Sh=Tr,Th=rh,Re=kt,jh=Ln(ah),Qo=vn,ai=Bi,$i=vh(kc),kh=xh.default.default,Jo="/.well-known",h=bh.default.extend(Xo.semver).extend(Xo.semverRange).extend(Qo.fileExtension).extend(Qo.didExtension);te.Joi=h;const Zo=(e,t)=>(0,$i.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
203
203
 
204
204
  A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
205
205
  - /en/home
@@ -213,7 +213,7 @@ A valid navigation id is should follow the rules of javascript variables, such a
213
213
  - foo123
214
214
 
215
215
  see detail in https://www.npmjs.com/package/is-var-name
216
- `),Cr=h.string().trim().min(1).custom(e=>{if(kh(e)>Re.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Re.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});te.titleSchema=Cr;const Pr=h.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=Pr;const xa=h.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=xa;const wa=h.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=wa;const Ea=h.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Yo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Yo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=Ea;const Sa=h.string().trim().min(1),Ui=Sa.meta({className:"TMountPoint"}).custom((e,t)=>(0,$i.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=Ui;const Ta=Sa.meta({className:"TUpdateMountPoint"}).custom(e=>(0,$i.default)(e));te.updateMountPointSchema=Ta;const Pn=h.string().custom(e=>((0,ai.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=Pn;const Ih=[],Wi=h.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Ih.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=Wi;const zi=h.object({name:Wi.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=zi;const qi=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=qi;const Ki=h.object({name:h.string().required().trim(),config:h.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=Ki;const Gi=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=Gi;const ja=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=ja;const Vi=h.object({type:h.string().lowercase().valid(...Re.BLOCKLET_INTERFACE_TYPES).required(),name:h.string().trim().required(),path:h.string().trim().default("/"),prefix:h.string().trim().min(1).default(Re.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:h.number().port().optional(),hostIP:h.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:h.string().lowercase().valid(...Re.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:h.alternatives().try(h.string().uppercase().default(Re.BLOCKLET_DEFAULT_PORT_NAME),h.object({internal:h.string().uppercase().required(),external:h.number().port().required()})).default(Re.BLOCKLET_DEFAULT_PORT_NAME),cacheable:h.array().items(ja).unique(),services:h.array().items(Ki).unique("name"),endpoints:h.array().items(Gi).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=Vi;const Rh=h.alternatives().try(h.string().required(),h.object({url:h.string().uri({scheme:["http","https","file"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),li=h.object({platform:h.string().valid(...Re.BLOCKLET_PLATFORMS).optional(),interpreter:h.string().valid("binary","node","blocklet").default("node"),source:Rh,args:h.array().items(h.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=li;const Xn=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=Xn;const Zn=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=Zn;const ka=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=ka;const Ch=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:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),Oa={source:Ch.required(),required:h.boolean(),title:Cr,description:Pr,mountPoint:Ui,name:Pn},Ia=(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),Hi=Ia(Oa).meta({className:"TComponent",unknownType:"any"});te.componentSchema=Hi;const Ph=Ia(Oa,!0),Ra=({checkStore:e}={})=>{const t=[Hi,Ph];return h.array().items(e?t[0]:t[1]).optional().default([])},Ca=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=Ca;const zr=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],es={id:h.string().custom(Oh),title:h.alternatives().try(h.string().min(1).max(Re.MAX_TITLE_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Re.MAX_TITLE_LENGTH))).required(),description:h.alternatives().try(h.string().min(1).max(Re.MAX_DESCRIPTION_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Re.MAX_DESCRIPTION_LENGTH))),link:h.alternatives().try(h.string().custom(Zo),h.object().min(1).pattern(h.string().valid(...zr),h.string().custom(Zo))),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()},Pa=h.object({...es,items:h.array().items(h.object({...es}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=Pa;const Xi=h.array().items(Pa).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=Xi;const Yi=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=Yi;const La=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=La;const Lh=h.object({type:h.string().trim().min(1).required(),description:h.string().trim().min(1)}),Qi=h.object({did:h.DID().trim().required(),type:h.string().trim().min(1).required(),public:h.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=Qi;const Ji=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=Ji;const _a={did:h.DID().trim().required(),version:h.semver().valid().required(),name:h.string().optional(),description:Pr.required(),group:h.string().valid(...Re.BLOCKLET_GROUPS),main:h.string().trim(),title:Cr.optional().allow(""),logo:h.string().trim().optional(),specVersion:h.semver().valid().gte("1.0.0").optional(),author:Xn.optional(),contributors:h.array().items(Xn).optional(),maintainers:h.array().items(Xn).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("*",...Re.BLOCKLET_PLATFORMS),h.array().items(h.string().valid(...Re.BLOCKLET_PLATFORMS)).min(1)),cpu:h.alternatives().try(h.string().valid("*",...Re.BLOCKLET_ARCHITECTURES),h.array().items(h.string().valid(...Re.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:Re.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:h.array().items(Vi).unique("name").custom((e,t)=>{if(e.filter(i=>i.type===Re.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Re.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(i=>i.type===Re.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const i of r)if(!i.prefix.startsWith(Jo))return t.message(`Wellknown path prefix must start with: ${Jo}`);return e}).default([]),environments:h.array().items(zi).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:qi,capabilities:h.object({clusterMode:h.boolean(),didSpace:h.string().valid(...Object.values(Re.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(Qi),types:h.array().items(Lh).max(10)}),engine:h.alternatives().try(li,h.array().items(li)).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:Zn.optional(),stats:ka.optional(),htmlAst:h.any().optional(),path:h.string().optional(),signatures:h.array().items(Ca).optional(),lastPublishedAt:h.string().isoDate().optional().allow(null),components:Ra(),navigation:Xi,theme:Yi,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:Ji.optional()},_h=h.object(_a).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=_h;const Na=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,...a}={})=>((!e||!yh.default.existsSync(e))&&(t=!1),h.object({..._a,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)=>[Re.BLOCKLET_ENTRY_FILE,Re.BLOCKLET_BUNDLE_FILE].includes(f)||(0,wh.default)(f)}):h.string().trim()).optional(),dist:n?Zn.required():Zn.optional(),components:Ra({checkStore:r}),name:i?h.string().optional():h.string().required(),egress:h.boolean().optional().default(!0),docker:Th.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...a}).rename("children","components").custom((c,f)=>{const{did:v,name:l,docker:u}=c;if(u){const{image:y,dockerfile:T,network:j}=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(j)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 A of u.volumes){if(!A.startsWith("$BLOCKLET_APP_DIR/")&&!A.startsWith("$BLOCKLET_DATA_DIR/"))return f.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(A.indexOf("..")>-1)return f.message('Volume cannot contain ".."')}}let S;if((0,Sh.isValid)(v))try{return(0,ai.validateNewDid)(v),c}catch(y){S=y}if(l){(0,ai.validateName)(l,{checkDid:!s});const y=(0,jh.default)(l);return y!==v?f.message(`The did of name "${l}" should be "${y}"`):c}return S?f.message(S.message):c}));te.createBlockletSchema=Na;te.default={blockletNameSchema:Pn,componentSchema:Hi,endpointSchema:Gi,serviceSchema:Ki,createBlockletSchema:Na,interfaceSchema:Vi,environmentSchema:zi,environmentNameSchema:Wi,scriptsSchema:qi,personSchema:Xn,distSchema:Zn,titleSchema:Cr,descriptionSchema:Pr,logoSchema:Ea,navigationSchema:Xi,themeSchema:Yi,mountPointSchema:Ui,updateMountPointSchema:Ta,authConfigSchema:La,resourceBundleSchema:Qi,installBlockletTitleSchema:xa,installBlockletDescriptionSchema:wa,eventsSchema:Ji,Joi:h};var bt={},Nh=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.setService=bt.findService=bt.getDefaultServiceConfig=bt.getServiceConfig=void 0;const Ah=Nh(Jc),Dh=te,Aa={},Zi=e=>{Aa[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};bt.setService=Zi;Zi({name:"auth",schema:Dh.authConfigSchema,default:{}});const Da=e=>{if(!e)throw new Error("service name should not be empty");const t=Aa[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Ma=(e,t,{validate:n}={})=>{const r=Da(e),i=(0,Ah.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};bt.getServiceConfig=Ma;const Fa=e=>{const{defaultConfig:t}=Da(e);return t};bt.getDefaultServiceConfig=Fa;const Ba=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};bt.findService=Ba;bt.default={getServiceConfig:Ma,getDefaultServiceConfig:Fa,findService:Ba,setService:Zi};Object.defineProperty(gn,"__esModule",{value:!0});gn.fixAndValidateService=gn.validateMeta=void 0;const Mh=te,Fh=bt,Bh=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Fh.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);gn.fixAndValidateService=Bh;const $a=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,schemaOptions:a={}}={})=>{const c=(0,Mh.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:i,skipValidateDidName:s,...a}),{value:f,error:v}=c.validate(e);if(v)throw new Error(`Invalid blocklet meta: ${v.details.map(l=>l.message).join(", ")}`);return f};gn.validateMeta=$a;gn.default=$a;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(k,M,V,$){$===void 0&&($=V);var le=Object.getOwnPropertyDescriptor(M,V);(!le||("get"in le?!M.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return M[V]}}),Object.defineProperty(k,$,le)}:function(k,M,V,$){$===void 0&&($=V),k[$]=M[V]}),n=Se&&Se.__setModuleDefault||(Object.create?function(k,M){Object.defineProperty(k,"default",{enumerable:!0,value:M})}:function(k,M){k.default=M}),r=Se&&Se.__importStar||function(){var k=function(M){return k=Object.getOwnPropertyNames||function(V){var $=[];for(var le in V)Object.prototype.hasOwnProperty.call(V,le)&&($[$.length]=le);return $},k(M)};return function(M){if(M&&M.__esModule)return M;var V={};if(M!=null)for(var $=k(M),le=0;le<$.length;le++)$[le]!=="default"&&t(V,M,$[le]);return n(V,M),V}}(),i=Se&&Se.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};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(Oc),a=r(Ad),c=kt,f=gn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return f.fixAndValidateService}});const v=Bi,l=(k,M)=>{k.description||(k.description=`Blocklet from ${M}`),k.version||(k.version=c.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=l;const u=k=>{if(k.repository&&(typeof k.repository=="string"&&(k.repository={type:"git",url:k.repository}),k.repository.url)){const M=a.fromUrl(k.repository.url);M&&(k.repository.url=M.getDefaultRepresentation()==="shortcut"?M.https():M.toString())}};e.fixRepository=u;const S=k=>{Array.isArray(k.files)?k.files&&(k.files=k.files.filter(M=>!(!M||typeof M!="string"))):delete k.files};e.fixFiles=S;const y=k=>{typeof k.keywords=="string"&&(k.keywords=k.keywords.split(/,\s+/)),k.keywords&&!Array.isArray(k.keywords)?delete k.keywords:k.keywords&&(k.keywords=k.keywords.filter(M=>!(typeof M!="string"||!M)))};e.fixKeywords=y;const T=k=>{typeof k.tags=="string"&&(k.tags=k.tags.split(/,\s+/)),k.tags&&!Array.isArray(k.tags)?delete k.tags:k.tags&&(k.tags=k.tags.filter(M=>!(typeof M!="string"||!M)))};e.fixTags=T;const j=(k,M)=>(k.author&&(k.author=M(k.author)),["maintainers","contributors"].forEach(V=>{Array.isArray(k[V])&&(k[V]=k[V].map(M))}),k),A=k=>{if(!k)return"";if(typeof k=="string")return k;const M=k.name||"",V=k.url||k.web,$=V?` (${V})`:"",le=k.email||k.mail,H=le?` <${le}>`:"";return M+H+$};e.formatPerson=A;const _=k=>{if(typeof k!="string")return k;const M=k.match(/^([^(<]+)/),V=k.match(/\(([^)]+)\)/),$=k.match(/<([^>]+)>/),le={};return M&&M[0].trim()&&(le.name=M[0].trim()),$&&([,le.email]=$),V&&([,le.url]=V),le};e.parsePerson=_;const D=k=>(j(k,A),j(k,_),k);e.fixPerson=D;const B=(k,M=!0)=>{if(Array.isArray(k.interfaces)||(k.interfaces=[]),k.interfaces.length)return k.interfaces.forEach(H=>{H.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(H.protocol="http")}),k;const $=(0,s.default)(k,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",le=({type:H="web",name:se,path:je="/",protocol:We="http",port:Me=c.BLOCKLET_DEFAULT_PORT_NAME})=>{k.interfaces.push({type:H,name:se,path:je,prefix:$,port:Me,protocol:We})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(H=>{k[H]&&le({name:H,path:k[H]})}),Array.isArray(k.exposeServices)&&k.exposeServices.forEach(H=>{le({type:"service",name:H.protocol,protocol:H.protocol,port:{internal:`BLOCKLET_${H.protocol}_PORT`.toUpperCase(),external:H.port}})}),M&&(delete k.publicUrl,delete k.adminUrl,delete k.configUrl,delete k.docUrl,delete k.exposeServices,k.capabilities&&delete k.capabilities.dynamicPathPrefix),k};e.fixInterfaces=B;const G=k=>{const{did:M}=k;try{(0,v.validateNewDid)(M),k.name=M}catch{}return k};e.fixName=G,e.default={fixRequired:l,fixRepository:u,fixFiles:S,fixKeywords:y,fixPerson:D,fixTags:T,fixName:G,formatPerson:A,parsePerson:_,fixInterfaces:B,fixService:f.fixAndValidateService}})(sa);function Ua({owner:e,locale:t}){return o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?o.jsx(Fs,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}Ua.propTypes={owner:N.object.isRequired,locale:N.string.isRequired};const $h="install-blocklet-from-URL",Wa=()=>{const[e,t]=Xs($h,"[]",{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}},Uh=ks(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function eo(e){const{value:t,onValueChange:n,children:r,helperText:i}=e,{urls:s,removeUrlRecord:a}=Wa(),c=(v,l)=>{v.preventDefault(),v.stopPropagation(),a(l)},f=Uh();return o.jsxs(Y,{children:[o.jsx(Os,{freeSolo:!0,options:s,inputValue:t,onInputChange:(v,l)=>{n(l)},disableClearable:!0,popupIcon:null,renderInput:v=>Mt.cloneElement(r,{...v}),renderOption:(v,l)=>F.createElement(Is,{...v,key:l,secondaryAction:o.jsx(js,{edge:"end","aria-label":"delete",onClick:u=>c(u,l),children:o.jsx(nc,{})})},o.jsx(Rl,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:o.jsx(Rs,{primary:l,className:f.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),o.jsx(Cl,{style:{margin:0},children:i})]})}eo.propTypes={onValueChange:N.func,children:N.node,value:N.string,helperText:N.string};eo.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function to({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:i,handleText:s}){const{api:a}=Ln(),{api:c}=Zc(),[f,v]=F.useState(!1),[l,u]=F.useState(""),{t:S,locale:y}=gt(),T={dist:{}},[j,A]=F.useState(e),[_,D]=F.useState(e?1:0),[B,G]=F.useState(T),[k,M]=F.useState(!1),[V,$]=F.useState({}),le=i==="component",H=le?!0:!e,{addUrlRecord:se}=Wa(),je=async()=>{G(T),u(null),v(!0);let oe=j.trim();!oe.startsWith("https://")&&!oe.startsWith("http://")&&!oe.startsWith("file://")&&(oe=`file://${oe}`);try{const Ae=decodeURIComponent(oe);try{new URL(Ae)}catch{throw new Error("Invalid URL")}const{meta:we,inStore:Je,registryUrl:qe}=await a.getBlockletMetaFromUrl({input:{url:Ae}});G(we),$({inStore:Je,registryUrl:qe,inputUrl:oe}),se(oe)}catch(Ae){console.error(Ae);const we=`Blocklet Install failed: ${Ys(Ae)}`;u(we),r(Ae)}finally{v(!1)}},We=()=>{if(le){n({meta:B,...V}),t();return}v(!0),M(!0)},Me=()=>{v(!1),M(!1),n({meta:B,...V}),t()},Qe=()=>{v(!1),M(!1)};F.useEffect(()=>{e&&je()},[e]);const Z=[{name:S("common.name"),value:Dt.getDisplayName({meta:B},!0)},{name:S("common.version"),value:B.version},{name:S("common.did"),value:B.did?o.jsx(eu,{did:B.did}):null},{name:S("common.author"),value:B.owner?o.jsx(Ua,{owner:B.owner,locale:y}):sa.formatPerson(B.author)},{name:S("blocklet.dist.downloadLink"),value:B.dist.tarball}],pe=()=>f?o.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:o.jsx(xt,{})}):B.did?o.jsx("div",{style:{paddingLeft:"10%"},children:Z.map(oe=>oe.name===S("common.did")?o.jsx(_o,{valueComponent:"div",nameWidth:120,name:oe.name,nameFormatter:()=>S("common.did"),children:oe.value},oe.name):o.jsx(_o,{valueComponent:"div",nameWidth:120,name:oe.name,children:oe.value},oe.name))}):null,ee=[{label:S("blocklet.fromUrl.step0"),body:o.jsx(ge,{component:"div",children:o.jsx(eo,{style:{marginBottom:32},value:j,helperText:S("blocklet.fromUrl.description"),onValueChange:oe=>{u(null),A(oe)},children:o.jsx(Sr,{label:S("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:j,onChange:oe=>{u(null),A(oe.target.value)},disabled:f,onKeyPress:oe=>{oe.key==="Enter"&&(oe.preventDefault(),je(),D(1))}})})}),cancel:S("common.cancel"),confirm:S("common.next"),onCancel:t,onConfirm:()=>{je(),D(1)}},{label:S("blocklet.fromUrl.step1"),body:pe(),cancel:S(H?"common.pre":"common.cancel"),confirm:(s==null?void 0:s.confirm)||S("blocklet.fromUrl.confirm"),onCancel:()=>{H?D(oe=>oe-1):t()},onConfirm:()=>{We()}}],ye=ee[_];return o.jsxs(o.Fragment,{children:[o.jsxs(ki,{title:(s==null?void 0:s.title)||S("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>ye.onCancel(),showCloseButton:_===0,disableEscapeKeyDown:!0,open:!0,actions:o.jsxs(o.Fragment,{children:[ye.cancel&&o.jsx(dt,{onClick:oe=>{oe.stopPropagation(),u(null),ye.onCancel()},color:"inherit",children:ye.cancel||S("common.cancel")}),o.jsxs(dt,{onClick:oe=>{oe.stopPropagation(),ye.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:f||!j||l,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[f&&_===0&&o.jsx(xt,{size:16}),ye.confirm]})]}),children:[H&&o.jsx(Pl,{alternativeLabel:!0,activeStep:_,children:ee.map(({label:oe})=>o.jsx(Ll,{children:o.jsx(_l,{children:oe})},oe))}),o.jsx(Nl,{component:"div",style:{marginTop:24},children:ye.body}),!!l&&o.jsx(Cs,{severity:"error",style:{width:"100%",marginTop:8},children:l})]}),B&&k&&o.jsx($s,{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:Me,extraParams:{title:B.title,wt:Ic(B),blockletMetaUrl:decodeURIComponent(j.trim())},messages:{title:S("setup.keyPair.title"),scan:S("setup.keyPair.scan"),confirm:S("setup.keyPair.confirm"),success:S("setup.keyPair.success")},onClose:Qe})]})}to.propTypes={defaultUrl:N.string,onCancel:N.func.isRequired,onSuccess:N.func.isRequired,onError:N.func,mode:N.oneOf(["install","component"]),handleText:N.object};to.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const Wh={meta:N.object.isRequired,onCancel:N.func.isRequired},zh=ks(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function za({action:e,onSelect:t,onNext:n}){const r=zh(),{t:i}=gt(),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(Al,{className:r.tabPanel,children:s.map(a=>o.jsxs(Is,{button:!0,selected:e===a.action,onClick:()=>t(a.action),children:[o.jsx(Dl,{className:r.iconRoot,children:a.action==="purchase"?o.jsx(tu,{style:{color:e==="purchase"?Oo.primary.main:"#AAA",fontSize:32}}):o.jsx(nu,{style:{color:e==="verify"?Oo.primary.main:"#AAA",fontSize:32}})}),o.jsx(Rs,{primary:a.title,secondary:a.description})]},a.action))}),n&&o.jsx(dt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:i("common.next")})]})}za.propTypes={action:N.oneOf(["both","purchase","verify"]).isRequired,onSelect:N.func.isRequired,onNext:N.func.isRequired};function no({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:i,locale:s}=gt(),{info:a}=Ln(),c=Rc(a),[f,v]=F.useState(null),l=new URL(e==null?void 0:e.registryUrl).origin,u=Dt.getDisplayName({meta:e}),S=async(T,j)=>{const A=({downloadTokenList:B})=>{r({downloadTokenList:B})},_=B=>{Oi.error(B),t(B)};function D(B){return rc(()=>No.get(B).then(async({data:G})=>{const k=G==null?void 0:G.downloadTokenList;if(G.status==="succeed"){if(k&&k.length)await A({downloadTokenList:k});else return await _(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return G.status==="error"?(console.error("vc error: ",G),await _(G==null?void 0:G.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&f){const{statusUrl:B}=Cc(f);await D(B)}else await A({downloadTokenList:T.downloadTokenList&&j(T.downloadTokenList)})};if(F.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{No.get(T.href).then(({data:j})=>{const A=`${j.url}`;v(A)})}catch(j){console.error("get next workflow url error: ",j)}}return()=>{v(null)}},[n]),n==="purchase"&&!f)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:Po.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:Po.create({baseURL:Jn(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($s,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:l,onSuccess:S,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...y[n]})}no.propTypes={...Wh,handlePaySuccess:N.func,mode:N.oneOf(["verify","purchase"]).isRequired};no.defaultProps={handlePaySuccess:()=>{}};const ro=F.forwardRef(({mode:e,...t},n)=>{const[r,i]=F.useState(e!=="both"?e:"verify"),[s,a]=F.useState(e!=="both"?2:1),c=v=>{v!==r&&i(v)},f=()=>{r&&s!==2&&a(2)};return F.useImperativeHandle(n,()=>({onNext:f,getCurrentStep:()=>s})),s===1?o.jsx("div",{style:{maxWidth:520},children:o.jsx(za,{action:r,onNext:null,onSelect:c})}):o.jsx(no,{...t,mode:r})});ro.propTypes={mode:N.oneOf(["both","verify","purchase"]).isRequired,ref:N.any};ro.defaultProps={ref:{}};const qh=ro;function Kh({...e}){return o.jsx(dt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function io({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:i}=gt(),s=Qs();return!e||Pc(e.meta)?o.jsx(Gh,{children:n}):o.jsxs(Vh,{isMobile:s,children:[o.jsx(Kh,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:i("setup.startNow")}),o.jsx(Y,{display:"flex",alignItems:"center",children:n})]})}io.propTypes={blocklet:N.object,onStartNow:N.func,children:N.any,disabled:N.bool};io.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Gh=He(Y)`
216
+ `),Cr=h.string().trim().min(1).custom(e=>{if(kh(e)>Re.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Re.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});te.titleSchema=Cr;const Pr=h.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=Pr;const xa=h.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=xa;const wa=h.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=wa;const Ea=h.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Yo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Yo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=Ea;const Sa=h.string().trim().min(1),Ui=Sa.meta({className:"TMountPoint"}).custom((e,t)=>(0,$i.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=Ui;const Ta=Sa.meta({className:"TUpdateMountPoint"}).custom(e=>(0,$i.default)(e));te.updateMountPointSchema=Ta;const Pn=h.string().custom(e=>((0,ai.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=Pn;const Ih=[],Wi=h.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Ih.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=Wi;const zi=h.object({name:Wi.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=zi;const qi=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=qi;const Ki=h.object({name:h.string().required().trim(),config:h.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=Ki;const Gi=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=Gi;const ja=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=ja;const Vi=h.object({type:h.string().lowercase().valid(...Re.BLOCKLET_INTERFACE_TYPES).required(),name:h.string().trim().required(),path:h.string().trim().default("/"),prefix:h.string().trim().min(1).default(Re.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:h.number().port().optional(),hostIP:h.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:h.string().lowercase().valid(...Re.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:h.alternatives().try(h.string().uppercase().default(Re.BLOCKLET_DEFAULT_PORT_NAME),h.object({internal:h.string().uppercase().required(),external:h.number().port().required()})).default(Re.BLOCKLET_DEFAULT_PORT_NAME),cacheable:h.array().items(ja).unique(),services:h.array().items(Ki).unique("name"),endpoints:h.array().items(Gi).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=Vi;const Rh=h.alternatives().try(h.string().required(),h.object({url:h.string().uri({scheme:["http","https","file"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),li=h.object({platform:h.string().valid(...Re.BLOCKLET_PLATFORMS).optional(),interpreter:h.string().valid("binary","node","blocklet").default("node"),source:Rh,args:h.array().items(h.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=li;const Xn=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=Xn;const Zn=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=Zn;const ka=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=ka;const Ch=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:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),Oa={source:Ch.required(),required:h.boolean(),title:Cr,description:Pr,mountPoint:Ui,name:Pn},Ia=(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),Hi=Ia(Oa).meta({className:"TComponent",unknownType:"any"});te.componentSchema=Hi;const Ph=Ia(Oa,!0),Ra=({checkStore:e}={})=>{const t=[Hi,Ph];return h.array().items(e?t[0]:t[1]).optional().default([])},Ca=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=Ca;const zr=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],es={id:h.string().custom(Oh),title:h.alternatives().try(h.string().min(1).max(Re.MAX_TITLE_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Re.MAX_TITLE_LENGTH))).required(),description:h.alternatives().try(h.string().min(1).max(Re.MAX_DESCRIPTION_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Re.MAX_DESCRIPTION_LENGTH))),link:h.alternatives().try(h.string().custom(Zo),h.object().min(1).pattern(h.string().valid(...zr),h.string().custom(Zo))),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()},Pa=h.object({...es,items:h.array().items(h.object({...es}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=Pa;const Xi=h.array().items(Pa).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=Xi;const Yi=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=Yi;const _a=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=_a;const _h=h.object({type:h.string().trim().min(1).required(),description:h.string().trim().min(1)}),Qi=h.object({did:h.DID().trim().required(),type:h.string().trim().min(1).required(),public:h.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=Qi;const Ji=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=Ji;const La={did:h.DID().trim().required(),version:h.semver().valid().required(),name:h.string().optional(),description:Pr.required(),group:h.string().valid(...Re.BLOCKLET_GROUPS),main:h.string().trim(),title:Cr.optional().allow(""),logo:h.string().trim().optional(),specVersion:h.semver().valid().gte("1.0.0").optional(),author:Xn.optional(),contributors:h.array().items(Xn).optional(),maintainers:h.array().items(Xn).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("*",...Re.BLOCKLET_PLATFORMS),h.array().items(h.string().valid(...Re.BLOCKLET_PLATFORMS)).min(1)),cpu:h.alternatives().try(h.string().valid("*",...Re.BLOCKLET_ARCHITECTURES),h.array().items(h.string().valid(...Re.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:Re.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:h.array().items(Vi).unique("name").custom((e,t)=>{if(e.filter(i=>i.type===Re.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Re.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(i=>i.type===Re.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const i of r)if(!i.prefix.startsWith(Jo))return t.message(`Wellknown path prefix must start with: ${Jo}`);return e}).default([]),environments:h.array().items(zi).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:qi,capabilities:h.object({clusterMode:h.boolean(),didSpace:h.string().valid(...Object.values(Re.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(Qi),types:h.array().items(_h).max(10)}),engine:h.alternatives().try(li,h.array().items(li)).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:Zn.optional(),stats:ka.optional(),htmlAst:h.any().optional(),path:h.string().optional(),signatures:h.array().items(Ca).optional(),lastPublishedAt:h.string().isoDate().optional().allow(null),components:Ra(),navigation:Xi,theme:Yi,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:Ji.optional()},Lh=h.object(La).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=Lh;const Na=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,...a}={})=>((!e||!yh.default.existsSync(e))&&(t=!1),h.object({...La,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)=>[Re.BLOCKLET_ENTRY_FILE,Re.BLOCKLET_BUNDLE_FILE].includes(f)||(0,wh.default)(f)}):h.string().trim()).optional(),dist:n?Zn.required():Zn.optional(),components:Ra({checkStore:r}),name:i?h.string().optional():h.string().required(),egress:h.boolean().optional().default(!0),docker:Th.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...a}).rename("children","components").custom((c,f)=>{const{did:v,name:l,docker:u}=c;if(u){const{image:y,dockerfile:T,network:j}=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(j)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 A of u.volumes){if(!A.startsWith("$BLOCKLET_APP_DIR/")&&!A.startsWith("$BLOCKLET_DATA_DIR/"))return f.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(A.indexOf("..")>-1)return f.message('Volume cannot contain ".."')}}let S;if((0,Sh.isValid)(v))try{return(0,ai.validateNewDid)(v),c}catch(y){S=y}if(l){(0,ai.validateName)(l,{checkDid:!s});const y=(0,jh.default)(l);return y!==v?f.message(`The did of name "${l}" should be "${y}"`):c}return S?f.message(S.message):c}));te.createBlockletSchema=Na;te.default={blockletNameSchema:Pn,componentSchema:Hi,endpointSchema:Gi,serviceSchema:Ki,createBlockletSchema:Na,interfaceSchema:Vi,environmentSchema:zi,environmentNameSchema:Wi,scriptsSchema:qi,personSchema:Xn,distSchema:Zn,titleSchema:Cr,descriptionSchema:Pr,logoSchema:Ea,navigationSchema:Xi,themeSchema:Yi,mountPointSchema:Ui,updateMountPointSchema:Ta,authConfigSchema:_a,resourceBundleSchema:Qi,installBlockletTitleSchema:xa,installBlockletDescriptionSchema:wa,eventsSchema:Ji,Joi:h};var bt={},Nh=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.setService=bt.findService=bt.getDefaultServiceConfig=bt.getServiceConfig=void 0;const Ah=Nh(Jc),Dh=te,Aa={},Zi=e=>{Aa[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};bt.setService=Zi;Zi({name:"auth",schema:Dh.authConfigSchema,default:{}});const Da=e=>{if(!e)throw new Error("service name should not be empty");const t=Aa[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Ma=(e,t,{validate:n}={})=>{const r=Da(e),i=(0,Ah.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};bt.getServiceConfig=Ma;const Fa=e=>{const{defaultConfig:t}=Da(e);return t};bt.getDefaultServiceConfig=Fa;const Ba=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};bt.findService=Ba;bt.default={getServiceConfig:Ma,getDefaultServiceConfig:Fa,findService:Ba,setService:Zi};Object.defineProperty(gn,"__esModule",{value:!0});gn.fixAndValidateService=gn.validateMeta=void 0;const Mh=te,Fh=bt,Bh=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Fh.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);gn.fixAndValidateService=Bh;const $a=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,schemaOptions:a={}}={})=>{const c=(0,Mh.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:i,skipValidateDidName:s,...a}),{value:f,error:v}=c.validate(e);if(v)throw new Error(`Invalid blocklet meta: ${v.details.map(l=>l.message).join(", ")}`);return f};gn.validateMeta=$a;gn.default=$a;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(k,M,V,$){$===void 0&&($=V);var le=Object.getOwnPropertyDescriptor(M,V);(!le||("get"in le?!M.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return M[V]}}),Object.defineProperty(k,$,le)}:function(k,M,V,$){$===void 0&&($=V),k[$]=M[V]}),n=Se&&Se.__setModuleDefault||(Object.create?function(k,M){Object.defineProperty(k,"default",{enumerable:!0,value:M})}:function(k,M){k.default=M}),r=Se&&Se.__importStar||function(){var k=function(M){return k=Object.getOwnPropertyNames||function(V){var $=[];for(var le in V)Object.prototype.hasOwnProperty.call(V,le)&&($[$.length]=le);return $},k(M)};return function(M){if(M&&M.__esModule)return M;var V={};if(M!=null)for(var $=k(M),le=0;le<$.length;le++)$[le]!=="default"&&t(V,M,$[le]);return n(V,M),V}}(),i=Se&&Se.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};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(Oc),a=r(Ad),c=kt,f=gn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return f.fixAndValidateService}});const v=Bi,l=(k,M)=>{k.description||(k.description=`Blocklet from ${M}`),k.version||(k.version=c.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=l;const u=k=>{if(k.repository&&(typeof k.repository=="string"&&(k.repository={type:"git",url:k.repository}),k.repository.url)){const M=a.fromUrl(k.repository.url);M&&(k.repository.url=M.getDefaultRepresentation()==="shortcut"?M.https():M.toString())}};e.fixRepository=u;const S=k=>{Array.isArray(k.files)?k.files&&(k.files=k.files.filter(M=>!(!M||typeof M!="string"))):delete k.files};e.fixFiles=S;const y=k=>{typeof k.keywords=="string"&&(k.keywords=k.keywords.split(/,\s+/)),k.keywords&&!Array.isArray(k.keywords)?delete k.keywords:k.keywords&&(k.keywords=k.keywords.filter(M=>!(typeof M!="string"||!M)))};e.fixKeywords=y;const T=k=>{typeof k.tags=="string"&&(k.tags=k.tags.split(/,\s+/)),k.tags&&!Array.isArray(k.tags)?delete k.tags:k.tags&&(k.tags=k.tags.filter(M=>!(typeof M!="string"||!M)))};e.fixTags=T;const j=(k,M)=>(k.author&&(k.author=M(k.author)),["maintainers","contributors"].forEach(V=>{Array.isArray(k[V])&&(k[V]=k[V].map(M))}),k),A=k=>{if(!k)return"";if(typeof k=="string")return k;const M=k.name||"",V=k.url||k.web,$=V?` (${V})`:"",le=k.email||k.mail,H=le?` <${le}>`:"";return M+H+$};e.formatPerson=A;const L=k=>{if(typeof k!="string")return k;const M=k.match(/^([^(<]+)/),V=k.match(/\(([^)]+)\)/),$=k.match(/<([^>]+)>/),le={};return M&&M[0].trim()&&(le.name=M[0].trim()),$&&([,le.email]=$),V&&([,le.url]=V),le};e.parsePerson=L;const D=k=>(j(k,A),j(k,L),k);e.fixPerson=D;const B=(k,M=!0)=>{if(Array.isArray(k.interfaces)||(k.interfaces=[]),k.interfaces.length)return k.interfaces.forEach(H=>{H.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(H.protocol="http")}),k;const $=(0,s.default)(k,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",le=({type:H="web",name:se,path:je="/",protocol:We="http",port:Me=c.BLOCKLET_DEFAULT_PORT_NAME})=>{k.interfaces.push({type:H,name:se,path:je,prefix:$,port:Me,protocol:We})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(H=>{k[H]&&le({name:H,path:k[H]})}),Array.isArray(k.exposeServices)&&k.exposeServices.forEach(H=>{le({type:"service",name:H.protocol,protocol:H.protocol,port:{internal:`BLOCKLET_${H.protocol}_PORT`.toUpperCase(),external:H.port}})}),M&&(delete k.publicUrl,delete k.adminUrl,delete k.configUrl,delete k.docUrl,delete k.exposeServices,k.capabilities&&delete k.capabilities.dynamicPathPrefix),k};e.fixInterfaces=B;const G=k=>{const{did:M}=k;try{(0,v.validateNewDid)(M),k.name=M}catch{}return k};e.fixName=G,e.default={fixRequired:l,fixRepository:u,fixFiles:S,fixKeywords:y,fixPerson:D,fixTags:T,fixName:G,formatPerson:A,parsePerson:L,fixInterfaces:B,fixService:f.fixAndValidateService}})(sa);function Ua({owner:e,locale:t}){return o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?o.jsx(Fs,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}Ua.propTypes={owner:N.object.isRequired,locale:N.string.isRequired};const $h="install-blocklet-from-URL",Wa=()=>{const[e,t]=Xs($h,"[]",{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}},Uh=ks(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function eo(e){const{value:t,onValueChange:n,children:r,helperText:i}=e,{urls:s,removeUrlRecord:a}=Wa(),c=(v,l)=>{v.preventDefault(),v.stopPropagation(),a(l)},f=Uh();return o.jsxs(Y,{children:[o.jsx(Os,{freeSolo:!0,options:s,inputValue:t,onInputChange:(v,l)=>{n(l)},disableClearable:!0,popupIcon:null,renderInput:v=>Mt.cloneElement(r,{...v}),renderOption:(v,l)=>F.createElement(Is,{...v,key:l,secondaryAction:o.jsx(js,{edge:"end","aria-label":"delete",onClick:u=>c(u,l),children:o.jsx(nc,{})})},o.jsx(Rl,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:o.jsx(Rs,{primary:l,className:f.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),o.jsx(Cl,{style:{margin:0},children:i})]})}eo.propTypes={onValueChange:N.func,children:N.node,value:N.string,helperText:N.string};eo.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function to({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:i,handleText:s}){const{api:a}=_n(),{api:c}=Zc(),[f,v]=F.useState(!1),[l,u]=F.useState(""),{t:S,locale:y}=gt(),T={dist:{}},[j,A]=F.useState(e),[L,D]=F.useState(e?1:0),[B,G]=F.useState(T),[k,M]=F.useState(!1),[V,$]=F.useState({}),le=i==="component",H=le?!0:!e,{addUrlRecord:se}=Wa(),je=async()=>{G(T),u(null),v(!0);let oe=j.trim();!oe.startsWith("https://")&&!oe.startsWith("http://")&&!oe.startsWith("file://")&&(oe=`file://${oe}`);try{const Ae=decodeURIComponent(oe);try{new URL(Ae)}catch{throw new Error("Invalid URL")}const{meta:we,inStore:Je,registryUrl:qe}=await a.getBlockletMetaFromUrl({input:{url:Ae}});G(we),$({inStore:Je,registryUrl:qe,inputUrl:oe}),se(oe)}catch(Ae){console.error(Ae);const we=`Blocklet Install failed: ${Ys(Ae)}`;u(we),r(Ae)}finally{v(!1)}},We=()=>{if(le){n({meta:B,...V}),t();return}v(!0),M(!0)},Me=()=>{v(!1),M(!1),n({meta:B,...V}),t()},Qe=()=>{v(!1),M(!1)};F.useEffect(()=>{e&&je()},[e]);const Z=[{name:S("common.name"),value:Dt.getDisplayName({meta:B},!0)},{name:S("common.version"),value:B.version},{name:S("common.did"),value:B.did?o.jsx(eu,{did:B.did}):null},{name:S("common.author"),value:B.owner?o.jsx(Ua,{owner:B.owner,locale:y}):sa.formatPerson(B.author)},{name:S("blocklet.dist.downloadLink"),value:B.dist.tarball}],pe=()=>f?o.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:o.jsx(xt,{})}):B.did?o.jsx("div",{style:{paddingLeft:"10%"},children:Z.map(oe=>oe.name===S("common.did")?o.jsx(Lo,{valueComponent:"div",nameWidth:120,name:oe.name,nameFormatter:()=>S("common.did"),children:oe.value},oe.name):o.jsx(Lo,{valueComponent:"div",nameWidth:120,name:oe.name,children:oe.value},oe.name))}):null,ee=[{label:S("blocklet.fromUrl.step0"),body:o.jsx(ge,{component:"div",children:o.jsx(eo,{style:{marginBottom:32},value:j,helperText:S("blocklet.fromUrl.description"),onValueChange:oe=>{u(null),A(oe)},children:o.jsx(Sr,{label:S("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:j,onChange:oe=>{u(null),A(oe.target.value)},disabled:f,onKeyPress:oe=>{oe.key==="Enter"&&(oe.preventDefault(),je(),D(1))}})})}),cancel:S("common.cancel"),confirm:S("common.next"),onCancel:t,onConfirm:()=>{je(),D(1)}},{label:S("blocklet.fromUrl.step1"),body:pe(),cancel:S(H?"common.pre":"common.cancel"),confirm:(s==null?void 0:s.confirm)||S("blocklet.fromUrl.confirm"),onCancel:()=>{H?D(oe=>oe-1):t()},onConfirm:()=>{We()}}],ye=ee[L];return o.jsxs(o.Fragment,{children:[o.jsxs(ki,{title:(s==null?void 0:s.title)||S("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>ye.onCancel(),showCloseButton:L===0,disableEscapeKeyDown:!0,open:!0,actions:o.jsxs(o.Fragment,{children:[ye.cancel&&o.jsx(dt,{onClick:oe=>{oe.stopPropagation(),u(null),ye.onCancel()},color:"inherit",children:ye.cancel||S("common.cancel")}),o.jsxs(dt,{onClick:oe=>{oe.stopPropagation(),ye.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:f||!j||l,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[f&&L===0&&o.jsx(xt,{size:16}),ye.confirm]})]}),children:[H&&o.jsx(Pl,{alternativeLabel:!0,activeStep:L,children:ee.map(({label:oe})=>o.jsx(_l,{children:o.jsx(Ll,{children:oe})},oe))}),o.jsx(Nl,{component:"div",style:{marginTop:24},children:ye.body}),!!l&&o.jsx(Cs,{severity:"error",style:{width:"100%",marginTop:8},children:l})]}),B&&k&&o.jsx($s,{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:Me,extraParams:{title:B.title,wt:Ic(B),blockletMetaUrl:decodeURIComponent(j.trim())},messages:{title:S("setup.keyPair.title"),scan:S("setup.keyPair.scan"),confirm:S("setup.keyPair.confirm"),success:S("setup.keyPair.success")},onClose:Qe})]})}to.propTypes={defaultUrl:N.string,onCancel:N.func.isRequired,onSuccess:N.func.isRequired,onError:N.func,mode:N.oneOf(["install","component"]),handleText:N.object};to.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const Wh={meta:N.object.isRequired,onCancel:N.func.isRequired},zh=ks(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function za({action:e,onSelect:t,onNext:n}){const r=zh(),{t:i}=gt(),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(Al,{className:r.tabPanel,children:s.map(a=>o.jsxs(Is,{button:!0,selected:e===a.action,onClick:()=>t(a.action),children:[o.jsx(Dl,{className:r.iconRoot,children:a.action==="purchase"?o.jsx(tu,{style:{color:e==="purchase"?Oo.primary.main:"#AAA",fontSize:32}}):o.jsx(nu,{style:{color:e==="verify"?Oo.primary.main:"#AAA",fontSize:32}})}),o.jsx(Rs,{primary:a.title,secondary:a.description})]},a.action))}),n&&o.jsx(dt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:i("common.next")})]})}za.propTypes={action:N.oneOf(["both","purchase","verify"]).isRequired,onSelect:N.func.isRequired,onNext:N.func.isRequired};function no({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:i,locale:s}=gt(),{info:a}=_n(),c=Rc(a),[f,v]=F.useState(null),l=new URL(e==null?void 0:e.registryUrl).origin,u=Dt.getDisplayName({meta:e}),S=async(T,j)=>{const A=({downloadTokenList:B})=>{r({downloadTokenList:B})},L=B=>{Oi.error(B),t(B)};function D(B){return rc(()=>No.get(B).then(async({data:G})=>{const k=G==null?void 0:G.downloadTokenList;if(G.status==="succeed"){if(k&&k.length)await A({downloadTokenList:k});else return await L(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return G.status==="error"?(console.error("vc error: ",G),await L(G==null?void 0:G.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&f){const{statusUrl:B}=Cc(f);await D(B)}else await A({downloadTokenList:T.downloadTokenList&&j(T.downloadTokenList)})};if(F.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{No.get(T.href).then(({data:j})=>{const A=`${j.url}`;v(A)})}catch(j){console.error("get next workflow url error: ",j)}}return()=>{v(null)}},[n]),n==="purchase"&&!f)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:Po.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:Po.create({baseURL:Jn(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($s,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:l,onSuccess:S,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...y[n]})}no.propTypes={...Wh,handlePaySuccess:N.func,mode:N.oneOf(["verify","purchase"]).isRequired};no.defaultProps={handlePaySuccess:()=>{}};const ro=F.forwardRef(({mode:e,...t},n)=>{const[r,i]=F.useState(e!=="both"?e:"verify"),[s,a]=F.useState(e!=="both"?2:1),c=v=>{v!==r&&i(v)},f=()=>{r&&s!==2&&a(2)};return F.useImperativeHandle(n,()=>({onNext:f,getCurrentStep:()=>s})),s===1?o.jsx("div",{style:{maxWidth:520},children:o.jsx(za,{action:r,onNext:null,onSelect:c})}):o.jsx(no,{...t,mode:r})});ro.propTypes={mode:N.oneOf(["both","verify","purchase"]).isRequired,ref:N.any};ro.defaultProps={ref:{}};const qh=ro;function Kh({...e}){return o.jsx(dt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function io({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:i}=gt(),s=Qs();return!e||Pc(e.meta)?o.jsx(Gh,{children:n}):o.jsxs(Vh,{isMobile:s,children:[o.jsx(Kh,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:i("setup.startNow")}),o.jsx(Y,{display:"flex",alignItems:"center",children:n})]})}io.propTypes={blocklet:N.object,onStartNow:N.func,children:N.any,disabled:N.bool};io.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Gh=He(Y)`
217
217
  width: 100%;
218
218
  margin-top: auto;
219
219
  padding-top: 24px;
@@ -263,7 +263,7 @@ see detail in https://www.npmjs.com/package/is-var-name
263
263
  overflow-y: auto;
264
264
  padding-bottom: 32px;
265
265
  overflow-x: hidden;
266
- `;function so({onChange:e,loading:t,children:n,extra:r,stores:i,storageKey:s}){const{t:a}=gt(),{info:c,inService:f}=Ln(),{blocklet:v}=kr(),[l,u]=F.useState(!1),S=F.useRef(null),[y,T]=F.useState(),[j,A]=Xs(s||"tmp"),[_,D]=s?[j,A]:[y,T],{storeList:B,teamDid:G}=Gs({fromBlocklet:f,blocklet:v,nodeInfo:c}),k=Ks([...i.map(V=>({...V,protected:!0})),...B],"url"),M=_&&k.find(V=>_===V.url)||k[0];return o.jsxs(o.Fragment,{children:[o.jsxs(Xh,{children:[o.jsx(dt,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:o.jsx(cu,{color:"primary"}),onClick:()=>{u(!0)},style:{padding:"0 2px"},children:o.jsx(ge,{color:"primary",children:M.name})}),o.jsx(ge,{color:"primary",children:r})]}),o.jsxs(Sr,{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:M,autoFocus:!0,onChange:V=>{const $=V.target.value;D($.url),e($)},SelectProps:{open:l,MenuProps:{anchorEl:S.current},renderValue:V=>V==null?void 0:V.name,onClose:()=>{u(!1)}},style:{display:"none"},margin:"normal",children:[k==null?void 0:k.map(V=>o.jsx(Si,{sx:{width:"400px",maxWidth:"90vw"},value:V,"data-cy":V.url,children:o.jsx(Ql,{teamDid:G,store:V,onDelete:()=>{var $;_===V.url&&D(($=k[0])==null?void 0:$.url)}})},V.url)),!Ms.isInServerlessMode(c)&&o.jsx(Jl,{disabled:t,storeList:k,teamDid:G,onAdd:V=>{D(V)}})]}),n({currentRegistry:M})]})}so.propTypes={onChange:N.func,loading:N.bool,children:N.any.isRequired,extra:N.node,storageKey:N.string,stores:N.arrayOf(N.shape({name:N.string.isRequired,url:N.string.isRequired}))};so.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Xh=He.div`
266
+ `;function so({onChange:e,loading:t,children:n,extra:r,stores:i,storageKey:s}){const{t:a}=gt(),{info:c,inService:f}=_n(),{blocklet:v}=kr(),[l,u]=F.useState(!1),S=F.useRef(null),[y,T]=F.useState(),[j,A]=Xs(s||"tmp"),[L,D]=s?[j,A]:[y,T],{storeList:B,teamDid:G}=Gs({fromBlocklet:f,blocklet:v,nodeInfo:c}),k=Ks([...i.map(V=>({...V,protected:!0})),...B],"url"),M=L&&k.find(V=>L===V.url)||k[0];return o.jsxs(o.Fragment,{children:[o.jsxs(Xh,{children:[o.jsx(dt,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:o.jsx(cu,{color:"primary"}),onClick:()=>{u(!0)},style:{padding:"0 2px"},children:o.jsx(ge,{color:"primary",children:M.name})}),o.jsx(ge,{color:"primary",children:r})]}),o.jsxs(Sr,{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:M,autoFocus:!0,onChange:V=>{const $=V.target.value;D($.url),e($)},SelectProps:{open:l,MenuProps:{anchorEl:S.current},renderValue:V=>V==null?void 0:V.name,onClose:()=>{u(!1)}},style:{display:"none"},margin:"normal",children:[k==null?void 0:k.map(V=>o.jsx(Si,{sx:{width:"400px",maxWidth:"90vw"},value:V,"data-cy":V.url,children:o.jsx(Ql,{teamDid:G,store:V,onDelete:()=>{var $;L===V.url&&D(($=k[0])==null?void 0:$.url)}})},V.url)),!Ms.isInServerlessMode(c)&&o.jsx(Jl,{disabled:t,storeList:k,teamDid:G,onAdd:V=>{D(V)}})]}),n({currentRegistry:M})]})}so.propTypes={onChange:N.func,loading:N.bool,children:N.any.isRequired,extra:N.node,storageKey:N.string,stores:N.arrayOf(N.shape({name:N.string.isRequired,url:N.string.isRequired}))};so.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Xh=He.div`
267
267
  display: flex;
268
268
  justify-content: space-between;
269
269
  align-items: center;
@@ -482,8 +482,8 @@ see detail in https://www.npmjs.com/package/is-var-name
482
482
  color: ${e=>e.theme.palette.common.white}!important;
483
483
  }
484
484
  }
485
- `;const ts=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Qh=(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`},qa={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,v;return e?o.jsx(Ps,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Fl.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:[(v=r==null?void 0:r.popper)==null?void 0:v.sx]]}},children:n}):n}function cr({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(rt,{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(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function Jh(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:v="Install",buttonDisabled:l,buttonLoading:u,button:S,onButtonClick:y=()=>{},onMainClick:T,className:j,ref:A,icons:_,status:D,...B}=e,G=Gt(),k=(H,se=()=>!1)=>(je,...We)=>{const Me=H instanceof Function;(se()||Me)&&(je.preventDefault(),je.stopPropagation(),Me&&H(...We))},M=T&&k(T),V=k(y,()=>!!(S||l||u)),$=F.isValidElement(t)?{children:t}:{title:ts(t),dangerouslySetInnerHTML:{__html:t}},le=F.isValidElement(n)?{children:n}:{title:ts(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Bl,{variant:"outlined",onClick:M,...B,sx:{p:{xs:2,md:3},borderRadius:1,...B.sx},children:[o.jsxs(rt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(br,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...$}),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(lc,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),_==null?void 0:_.map(H=>o.jsx(ci,{title:H.title,children:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon,style:{color:H.color}}):H.icon},H.key))]}),y&&o.jsxs(dt,{color:"reverse",variant:"outlined",size:"small",disabled:l||u,style:{borderColor:G.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:G.typography.fontWeightMedium},onClick:V,children:[u&&o.jsx(xt,{size:15,style:{marginRight:3,color:"inherit"}}),v]}),S]}),o.jsx(rt,{py:2,children:o.jsx(ge,{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(rt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(cr,{icon:o.jsx(br,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(cr,{icon:o.jsx(pt,{icon:qa}),title:a,children:Qh(a)}),D==null?void 0:D.filter(H=>H.align!=="right").map(H=>o.jsx(cr,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,children:H.text},H.key)),o.jsx(Y,{sx:{flex:1}}),D==null?void 0:D.filter(H=>H.align==="right").map(H=>o.jsx(cr,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,sx:{color:H.color},children:H.text},H.key))]})]})}const Zh={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>'},Yn=/^[a-z0-9]+(-[a-z0-9]+)*$/,Lr=(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(),v={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!vr(v)?null:v}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!vr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!vr(c,n)?null:c}return null},vr=(e,t)=>e?!!((e.provider===""||e.provider.match(Yn))&&(t&&e.prefix===""||e.prefix.match(Yn))&&e.name.match(Yn)):!1,Ka=Object.freeze({left:0,top:0,width:16,height:16}),wr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ao=Object.freeze({...Ka,...wr}),ui=Object.freeze({...ao,body:"",hidden:!1});function ef(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 ns(e,t){const n=ef(e,t);for(const r in ui)r in wr?r in e&&!(r in n)&&(n[r]=wr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function tf(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 nf(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=ns(r[c]||i[c],s)}return a(t),n.forEach(a),ns(e,s)}function Ga(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=tf(e);for(const i in r){const s=r[i];s&&(t(i,nf(e,i,s)),n.push(i))}return n}const rf={provider:"",aliases:{},not_found:{},...Ka};function qr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Va(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!qr(e,rf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Yn)||typeof s.body!="string"||!qr(s,ui))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(Yn)||typeof a!="string"||!n[a]&&!r[a]||!qr(s,ui))return null}return t}const rs=Object.create(null);function of(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function yn(e,t){const n=rs[e]||(rs[e]=Object.create(null));return n[t]||(n[t]=of(e,t))}function lo(e,t){return Va(t)?Ga(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function sf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let er=!1;function Ha(e){return typeof e=="boolean"&&(er=e),er}function af(e){const t=typeof e=="string"?Lr(e,!0,er):e;if(t){const n=yn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function lf(e,t){const n=Lr(e,!0,er);if(!n)return!1;const r=yn(n.provider,n.prefix);return sf(r,n.name,t)}function cf(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),er&&!t&&!e.prefix){let i=!1;return Va(e)&&(e.prefix="",Ga(e,(s,a)=>{a&&lf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!vr({provider:t,prefix:n,name:"a"}))return!1;const r=yn(t,n);return!!lo(r,e)}const Xa=Object.freeze({width:null,height:null}),Ya=Object.freeze({...Xa,...wr}),uf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,df=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function is(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(uf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=df.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 hf=e=>e==="unset"||e==="undefined"||e==="none";function ff(e,t){const n={...ao,...e},r={...Ya,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(T=>{const j=[],A=T.hFlip,_=T.vFlip;let D=T.rotate;A?_?D+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):_&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let B;switch(D<0&&(D-=Math.floor(D/4)*4),D=D%4,D){case 1:B=i.height/2+i.top,j.unshift("rotate(90 "+B.toString()+" "+B.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:B=i.width/2+i.left,j.unshift("rotate(-90 "+B.toString()+" "+B.toString()+")");break}D%2===1&&(i.left!==i.top&&(B=i.left,i.left=i.top,i.top=B),i.width!==i.height&&(B=i.width,i.width=i.height,i.height=B)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,v=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?v:c,l=is(u,f/v)):(l=a==="auto"?f:a,u=c===null?is(l,v/f):c==="auto"?v:c);const S={},y=(T,j)=>{hf(j)||(S[T]=j.toString())};return y("width",l),y("height",u),S.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+v.toString(),{attributes:S,body:s}}const pf=/\sid="(\S+)"/g,mf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let gf=0;function vf(e,t=mf){const n=[];let r;for(;r=pf.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+(gf++).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 di=Object.create(null);function yf(e,t){di[e]=t}function hi(e){return di[e]||di[""]}function co(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 uo=Object.create(null),Gn=["https://api.simplesvg.com","https://api.unisvg.com"],yr=[];for(;Gn.length>0;)Gn.length===1||Math.random()>.5?yr.push(Gn.shift()):yr.push(Gn.pop());uo[""]=co({resources:["https://api.iconify.design"].concat(yr)});function bf(e,t){const n=co(t);return n===null?!1:(uo[e]=n,!0)}function ho(e){return uo[e]}const xf=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let os=xf();function wf(e,t){const n=ho(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 Ef(e){return e===404}const Sf=(e,t,n)=>{const r=[],i=wf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,v)=>{c+=f.length+1,c>=i&&v>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function Tf(e){if(typeof e=="string"){const t=ho(e);if(t)return t.path}return"/"}const jf=(e,t,n)=>{if(!os){n("abort",424);return}let r=Tf(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;os(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Ef(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)})},kf={prepare:Sf,send:jf};function Of(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)),v=f[a]||(f[a]=yn(s,a));let l;c in v.icons?l=t.loaded:a===""||v.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Qa(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function If(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 v=f.name;if(e.icons[v])a.loaded.push({provider:r,prefix:i,name:v});else if(e.missing.has(v))a.missing.push({provider:r,prefix:i,name:v});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Qa([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Rf=0;function Cf(e,t,n){const r=Rf++,i=Qa.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 Pf(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?Lr(i,t,n):i;s&&r.push(s)}),r}var Lf={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _f(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 M=e.resources.slice(0);for(a=[];M.length>1;){const V=Math.floor(Math.random()*M.length);a.push(M[V]),M=M.slice(0,V).concat(M.slice(V+1))}a=a.concat(M)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",v=0,l,u=null,S=[],y=[];typeof r=="function"&&y.push(r);function T(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),T(),S.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),S=[]}function A(M,V){V&&(y=[]),typeof M=="function"&&y.push(M)}function _(){return{startTime:c,payload:t,status:f,queriesSent:v,queriesPending:S.length,subscribe:A,abort:j}}function D(){f="failed",y.forEach(M=>{M(void 0,l)})}function B(){S.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),S=[]}function G(M,V,$){const le=V!=="success";switch(S=S.filter(H=>H!==M),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(V==="abort"){l=$,D();return}if(le){l=$,S.length||(a.length?k():D());return}if(T(),B(),!e.random){const H=e.resources.indexOf(M.resource);H!==-1&&H!==e.index&&(e.index=H)}f="completed",y.forEach(H=>{H($)})}function k(){if(f!=="pending")return;T();const M=a.shift();if(M===void 0){if(S.length){u=setTimeout(()=>{T(),f==="pending"&&(B(),D())},e.timeout);return}D();return}const V={status:"pending",resource:M,callback:($,le)=>{G(V,$,le)}};S.push(V),v++,u=setTimeout(k,e.rotate),n(M,t,V.callback)}return setTimeout(k),_}function Ja(e){const t={...Lf,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,v){const l=_f(t,c,f,(u,S)=>{r(),v&&v(u,S)});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 ss(){}const Kr=Object.create(null);function Nf(e){if(!Kr[e]){const t=ho(e);if(!t)return;const n=Ja(t),r={config:t,redundancy:n};Kr[e]=r}return Kr[e]}function Af(e,t,n){let r,i;if(typeof e=="string"){const s=hi(e);if(!s)return n(void 0,424),ss;i=s.send;const a=Nf(e);a&&(r=a.redundancy)}else{const s=co(e);if(s){r=Ja(s);const a=e.resources?e.resources[0]:"",c=hi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),ss):r.query(t,i,n)().abort}const as="iconify2",tr="iconify",Za=tr+"-count",ls=tr+"-version",el=36e5,Df=168;function fi(e,t){try{return e.getItem(t)}catch{}}function fo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function cs(e,t){try{e.removeItem(t)}catch{}}function pi(e,t){return fo(e,Za,t.toString())}function mi(e){return parseInt(fi(e,Za))||0}const _r={local:!0,session:!0},tl={local:new Set,session:new Set};let po=!1;function Mf(e){po=e}let ur=typeof window>"u"?{}:window;function nl(e){const t=e+"Storage";try{if(ur&&ur[t]&&typeof ur[t].length=="number")return ur[t]}catch{}_r[e]=!1}function rl(e,t){const n=nl(e);if(!n)return;const r=fi(n,ls);if(r!==as){if(r){const c=mi(n);for(let f=0;f<c;f++)cs(n,tr+f.toString())}fo(n,ls,as),pi(n,0);return}const i=Math.floor(Date.now()/el)-Df,s=c=>{const f=tr+c.toString(),v=fi(n,f);if(typeof v=="string"){try{const l=JSON.parse(v);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{}cs(n,f)}};let a=mi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,pi(n,a)):tl[e].add(c))}function il(){if(!po){Mf(!0);for(const e in _r)rl(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=yn(r,i);if(!lo(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Ff(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in _r)rl(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Bf(e,t){po||il();function n(r){let i;if(!_r[r]||!(i=nl(r)))return;const s=tl[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=mi(i),!pi(i,a+1))return;const c={cached:Math.floor(Date.now()/el),provider:e.provider,data:t};return fo(i,tr+a.toString(),JSON.stringify(c))}t.lastModified&&!Ff(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function us(){}function $f(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,If(e)}))}function Uf(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=hi(n)))return;s.prepare(n,r,i).forEach(c=>{Af(n,c,f=>{if(typeof f!="object")c.icons.forEach(v=>{e.missing.add(v)});else try{const v=lo(e,f);if(!v.length)return;const l=e.pendingIcons;l&&v.forEach(u=>{l.delete(u)}),Bf(e,f)}catch(v){console.error(v)}$f(e)})})}))}const Wf=(e,t)=>{const n=Pf(e,!0,Ha()),r=Of(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,us)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:v,prefix:l}=f;if(l===c&&v===a)return;a=v,c=l,s.push(yn(v,l));const u=i[v]||(i[v]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:v,prefix:l,name:u}=f,S=yn(v,l),y=S.pendingIcons||(S.pendingIcons=new Set);y.has(u)||(y.add(u),i[v][l].push(u))}),s.forEach(f=>{const{provider:v,prefix:l}=f;i[v][l].length&&Uf(f,i[v][l])}),t?Cf(t,r,s):us};function zf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Xa?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const qf=/[\s,]+/;function Kf(e,t){t.split(qf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Gf(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 Vf(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 Hf(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Xf(e){return"data:image/svg+xml,"+Hf(e)}function Yf(e){return'url("'+Xf(e)+'")'}let Qn;function Qf(){try{Qn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Qn=null}}function Jf(e){return Qn===void 0&&Qf(),Qn?Qn.createHTML(e):e}const ol={...Ya,inline:!1},Zf={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},ep={display:"inline-block"},gi={backgroundColor:"currentColor"},sl={backgroundColor:"transparent"},ds={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},hs={WebkitMask:gi,mask:gi,background:sl};for(const e in hs){const t=hs[e];for(const n in ds)t[e+n]=ds[n]}const tp={...ol,inline:!0};function fs(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const np=(e,t,n,r)=>{const i=n?tp:ol,s=zf(i,t),a=t.mode||"svg",c={},f=t.style||{},v={...a==="svg"?Zf:{},ref:r};for(let _ in t){const D=t[_];if(D!==void 0)switch(_){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[_]=D===!0||D==="true"||D===1;break;case"flip":typeof D=="string"&&Kf(s,D);break;case"color":c.color=D;break;case"rotate":typeof D=="string"?s[_]=Gf(D):typeof D=="number"&&(s[_]=D);break;case"ariaHidden":case"aria-hidden":D!==!0&&D!=="true"&&delete v["aria-hidden"];break;default:i[_]===void 0&&(v[_]=D)}}const l=ff(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){v.style={...c,...f},Object.assign(v,u);let _=0,D=t.id;return typeof D=="string"&&(D=D.replace(/-/g,"_")),v.dangerouslySetInnerHTML={__html:Jf(vf(l.body,D?()=>D+"ID"+_++:"iconifyReact"))},Mt.createElement("svg",v)}const{body:S,width:y,height:T}=e,j=a==="mask"||(a==="bg"?!1:S.indexOf("currentColor")!==-1),A=Vf(S,{...u,width:y+"",height:T+""});return v.style={...c,"--svg":Yf(A),width:fs(u.width),height:fs(u.height),...ep,...j?gi:sl,...f},Mt.createElement("span",v)};Ha(!0);yf("",kf);if(typeof document<"u"&&typeof window<"u"){il();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"||!cf(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;bf(n,i)||console.error(r)}catch{console.error(r)}}}}class al extends Mt.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=Lr(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=af(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:Wf([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:Mt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),np({...ao,...n.data},r,t._inline,t._ref)}}const nr=Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Mt.createElement(al,r)});Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Mt.createElement(al,r)});var ll={exports:{}};(function(e,t){(function(n,r){e.exports=r(F)})(Se,n=>(()=>{var r={703:(c,f,v)=>{var l=v(414);function u(){}function S(){}S.resetWarningCache=u,c.exports=function(){function y(A,_,D,B,G,k){if(k!==l){var M=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 M.name="Invariant Violation",M}}function T(){return y}y.isRequired=y;var j={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:S,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,v)=>{c.exports=v(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",v=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function S(y,T){if(y===T)return!0;if(y&&T&&typeof y=="object"&&typeof T=="object"){if(y.constructor!==T.constructor)return!1;var j,A,_,D;if(Array.isArray(y)){if((j=y.length)!=T.length)return!1;for(A=j;A--!=0;)if(!S(y[A],T[A]))return!1;return!0}if(v&&y instanceof Map&&T instanceof Map){if(y.size!==T.size)return!1;for(D=y.entries();!(A=D.next()).done;)if(!T.has(A.value[0]))return!1;for(D=y.entries();!(A=D.next()).done;)if(!S(A.value[1],T.get(A.value[0])))return!1;return!0}if(l&&y instanceof Set&&T instanceof Set){if(y.size!==T.size)return!1;for(D=y.entries();!(A=D.next()).done;)if(!T.has(A.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(T)){if((j=y.length)!=T.length)return!1;for(A=j;A--!=0;)if(y[A]!==T[A])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((j=(_=Object.keys(y)).length)!==Object.keys(T).length)return!1;for(A=j;A--!=0;)if(!Object.prototype.hasOwnProperty.call(T,_[A]))return!1;if(f&&y instanceof Element)return!1;for(A=j;A--!=0;)if((_[A]!=="_owner"&&_[A]!=="__v"&&_[A]!=="__o"||!y.$$typeof)&&!S(y[_[A]],T[_[A]]))return!1;return!0}return y!=y&&T!=T}c.exports=function(y,T){try{return S(y,T)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var v=i[c]={exports:{}};return r[c](v,v.exports,s),v.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 v in f)s.o(f,v)&&!s.o(c,v)&&Object.defineProperty(c,v,{enumerable:!0,get:f[v]})},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,E,O="";if(typeof b=="string"||typeof b=="number")O+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(E=c(b[p]))&&(O&&(O+=" "),O+=E);else for(p in b)b[p]&&(O&&(O+=" "),O+=p);return O}function f(){for(var b,p,E=0,O="";E<arguments.length;)(b=arguments[E++])&&(p=c(b))&&(O&&(O+=" "),O+=p);return O}s.r(a),s.d(a,{default:()=>kl});var v=s(359),l=s.n(v);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},S=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var y=typeof self=="object"&&self&&self.Object===Object&&self;const T=S||y||Function("return this")(),j=function(){return T.Date.now()};var A=/\s/,_=/^\s+/;const D=function(b){return b&&b.slice(0,function(p){for(var E=p.length;E--&&A.test(p.charAt(E)););return E}(b)+1).replace(_,"")},B=T.Symbol;var G=Object.prototype,k=G.hasOwnProperty,M=G.toString,V=B?B.toStringTag:void 0,$=Object.prototype.toString,le=B?B.toStringTag:void 0;const H=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":le&&le in Object(b)?function(p){var E=k.call(p,V),O=p[V];try{p[V]=void 0;var q=!0}catch{}var re=M.call(p);return q&&(E?p[V]=O:delete p[V]),re}(b):function(p){return $.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,We=/^0o[0-7]+$/i,Me=parseInt;const Qe=function(b){if(typeof b=="number")return b;if(function(O){return typeof O=="symbol"||function(q){return q!=null&&typeof q=="object"}(O)&&H(O)=="[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=D(b);var E=je.test(b);return E||We.test(b)?Me(b.slice(2),E?2:8):se.test(b)?NaN:+b};var Z=Math.max,pe=Math.min;const ee=function(b,p,E){var O,q,re,me,g,m,R=0,U=!1,K=!1,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");function ue(ie){var fe=O,be=q;return O=q=void 0,R=ie,me=b.apply(be,fe)}function ce(ie){return R=ie,g=setTimeout(X,p),U?ue(ie):me}function he(ie){var fe=ie-m;return m===void 0||fe>=p||fe<0||K&&ie-R>=re}function X(){var ie=j();if(he(ie))return Q(ie);g=setTimeout(X,function(fe){var be=p-(fe-m);return K?pe(be,re-(fe-R)):be}(ie))}function Q(ie){return g=void 0,z&&O?ue(ie):(O=q=void 0,me)}function J(){var ie=j(),fe=he(ie);if(O=arguments,q=this,m=ie,fe){if(g===void 0)return ce(m);if(K)return clearTimeout(g),g=setTimeout(X,p),ue(m)}return g===void 0&&(g=setTimeout(X,p)),me}return p=Qe(p)||0,u(E)&&(U=!!E.leading,re=(K="maxWait"in E)?Z(Qe(E.maxWait)||0,p):re,z="trailing"in E?!!E.trailing:z),J.cancel=function(){g!==void 0&&clearTimeout(g),R=0,O=m=q=g=void 0},J.flush=function(){return g===void 0?me:Q(j())},J},ye=function(b,p,E){var O=!0,q=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(E)&&(O="leading"in E?!!E.leading:O,q="trailing"in E?!!E.trailing:q),ee(b,p,{leading:O,maxWait:p,trailing:q})};var oe=s(590),Ae=s.n(oe),we=function(){if(typeof Map<"u")return Map;function b(p,E){var O=-1;return p.some(function(q,re){return q[0]===E&&(O=re,!0)}),O}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(E){var O=b(this.__entries__,E),q=this.__entries__[O];return q&&q[1]},p.prototype.set=function(E,O){var q=b(this.__entries__,E);~q?this.__entries__[q][1]=O:this.__entries__.push([E,O])},p.prototype.delete=function(E){var O=this.__entries__,q=b(O,E);~q&&O.splice(q,1)},p.prototype.has=function(E){return!!~b(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,O){O===void 0&&(O=null);for(var q=0,re=this.__entries__;q<re.length;q++){var me=re[q];E.call(O,me[1],me[0])}},p}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,qe=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")(),Ht=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(qe):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Xt=["top","right","bottom","left","width","height","size","weight"],Ft=typeof MutationObserver<"u",Yt=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var O=!1,q=!1,re=0;function me(){O&&(O=!1,p()),q&&m()}function g(){Ht(me)}function m(){var R=Date.now();if(O){if(R-re<2)return;q=!0}else O=!0,q=!1,setTimeout(g,20);re=R}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 E=this.observers_,O=E.indexOf(p);~O&&E.splice(O,1),!E.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var p=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return p.forEach(function(E){return E.broadcastActive()}),p.length>0},b.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ft?(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(){Je&&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 E=p.propertyName,O=E===void 0?"":E;Xt.some(function(q){return!!~O.indexOf(q)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Pe=function(b,p){for(var E=0,O=Object.keys(p);E<O.length;E++){var q=O[E];Object.defineProperty(b,q,{value:p[q],enumerable:!1,writable:!1,configurable:!0})}return b},Le=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||qe},Ze=ke(0,0,0,0);function de(b){return parseFloat(b)||0}function Qt(b){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(O,q){return O+de(b["border-"+q+"-width"])},0)}var Jt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof Le(b).SVGGraphicsElement}:function(b){return b instanceof Le(b).SVGElement&&typeof b.getBBox=="function"};function Zt(b){return Je?Jt(b)?function(p){var E=p.getBBox();return ke(0,0,E.width,E.height)}(b):function(p){var E=p.clientWidth,O=p.clientHeight;if(!E&&!O)return Ze;var q=Le(p).getComputedStyle(p),re=function(z){for(var ue={},ce=0,he=["top","right","bottom","left"];ce<he.length;ce++){var X=he[ce],Q=z["padding-"+X];ue[X]=de(Q)}return ue}(q),me=re.left+re.right,g=re.top+re.bottom,m=de(q.width),R=de(q.height);if(q.boxSizing==="border-box"&&(Math.round(m+me)!==E&&(m-=Qt(q,"left","right")+me),Math.round(R+g)!==O&&(R-=Qt(q,"top","bottom")+g)),!function(z){return z===Le(z).document.documentElement}(p)){var U=Math.round(m+me)-E,K=Math.round(R+g)-O;Math.abs(U)!==1&&(m-=U),Math.abs(K)!==1&&(R-=K)}return ke(re.left,re.top,m,R)}(b):Ze}function ke(b,p,E,O){return{x:b,y:p,width:E,height:O}}var Bt=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=Zt(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}(),Nn=function(b,p){var E,O,q,re,me,g,m,R=(O=(E=p).x,q=E.y,re=E.width,me=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Pe(m,{x:O,y:q,width:re,height:me,top:q,right:O+re,bottom:me+q,left:O}),m);Pe(this,{target:b,contentRect:R})},et=function(){function b(p,E,O){if(this.activeObservations_=[],this.observations_=new we,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=O}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 Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new Bt(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 Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)&&(E.delete(p),E.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(E){E.isActive()&&p.activeObservations_.push(E)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(O){return new Nn(O.target,O.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),en=typeof WeakMap<"u"?new WeakMap:new we,tn=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 E=Yt.getInstance(),O=new et(p,E,this);en.set(this,O)};["observe","unobserve","disconnect"].forEach(function(b){tn.prototype[b]=function(){var p;return(p=en.get(this))[b].apply(p,arguments)}});const nn=qe.ResizeObserver!==void 0?qe.ResizeObserver:tn,Fe="Left",tt="Right",wt="Up",ot="Down",Et={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},It={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ke="mousemove",xn="mouseup";function rn(b,p){if(p===0)return b;const E=Math.PI/180*p;return[b[0]*Math.cos(E)+b[1]*Math.sin(E),b[1]*Math.cos(E)-b[0]*Math.sin(E)]}function wn(b){const{trackMouse:p}=b,E=v.useRef(Object.assign({},It)),O=v.useRef(Object.assign({},Et)),q=v.useRef(Object.assign({},O.current));let re;for(re in q.current=Object.assign({},O.current),O.current=Object.assign(Object.assign({},Et),b),Et)O.current[re]===void 0&&(O.current[re]=Et[re]);const[me,g]=v.useMemo(()=>function(m,R){const U=X=>{const Q="touches"in X;Q&&X.touches.length>1||m((J,ie)=>{ie.trackMouse&&!Q&&(document.addEventListener(Ke,K),document.addEventListener(xn,ue));const{clientX:fe,clientY:be}=Q?X.touches[0]:X,_e=rn([fe,be],ie.rotationAngle);return ie.onTouchStartOrOnMouseDown&&ie.onTouchStartOrOnMouseDown({event:X}),Object.assign(Object.assign(Object.assign({},J),It),{initial:_e.slice(),xy:_e,start:X.timeStamp||0})})},K=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:fe,clientY:be}=ie?X.touches[0]:X,[_e,lt]=rn([fe,be],J.rotationAngle),nt=_e-Q.xy[0],Ge=lt-Q.xy[1],Ce=Math.abs(nt),xe=Math.abs(Ge),Wt=(X.timeStamp||0)-Q.start,Bn=Math.sqrt(Ce*Ce+xe*xe)/(Wt||1),$n=[nt/(Wt||1),Ge/(Wt||1)],_t=function(Un,On,Wn,ct){return Un>On?Wn>0?tt:Fe:ct>0?ot:wt}(Ce,xe,nt,Ge),un=typeof J.delta=="number"?J.delta:J.delta[_t.toLowerCase()]||Et.delta;if(Ce<un&&xe<un&&!Q.swiping)return Q;const Tt={absX:Ce,absY:xe,deltaX:nt,deltaY:Ge,dir:_t,event:X,first:Q.first,initial:Q.initial,velocity:Bn,vxvy:$n};Tt.first&&J.onSwipeStart&&J.onSwipeStart(Tt),J.onSwiping&&J.onSwiping(Tt);let kn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${_t}`])&&(kn=!0),kn&&J.preventScrollOnSwipe&&J.trackTouch&&X.cancelable&&X.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Tt,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 fe=J[`onSwiped${ie.dir}`];fe&&fe(ie)}}else J.onTap&&J.onTap({event:X});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:X}),Object.assign(Object.assign(Object.assign({},Q),It),{eventData:ie})})},ue=X=>{document.removeEventListener(Ke,K),document.removeEventListener(xn,ue),z(X)},ce=(X,Q)=>{let J=()=>{};if(X&&X.addEventListener){const ie=Object.assign(Object.assign({},Et.touchEventOptions),Q.touchEventOptions),fe=[["touchstart",U,ie],["touchmove",K,Object.assign(Object.assign({},ie),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",z,ie]];fe.forEach(([be,_e,lt])=>X.addEventListener(be,_e,lt)),J=()=>fe.forEach(([be,_e])=>X.removeEventListener(be,_e))}return J},he={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 R.trackMouse&&(he.onMouseDown=U),[he,ce]}(m=>E.current=m(E.current,O.current),{trackMouse:p}),[p]);return E.current=function(m,R,U,K){return R.trackTouch&&m.el?m.cleanUpTouch?R.preventScrollOnSwipe!==U.preventScrollOnSwipe||R.touchEventOptions.passive!==U.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,R)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,R)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,O.current,q.current,g),me}var C=s(697);function St(b){return St=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},St(b)}function Rt(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function on(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Rt(Object(E),!0).forEach(function(O){d(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Rt(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function d(b,p,E){return(p=function(O){var q=function(re,me){if(St(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(St(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(O,"string");return St(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=l().memo(function(b){var p=on(on({},x),b),E=p.description,O=p.fullscreen,q=p.handleImageLoaded,re=p.isFullscreen,me=p.onImageError,g=p.original,m=p.originalAlt,R=p.originalHeight,U=p.originalWidth,K=p.originalTitle,z=p.sizes,ue=p.srcSet,ce=p.loading,he=re&&O||g;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:he,alt:m,srcSet:ue,height:R,width:U,sizes:z,title:K,onLoad:function(X){return q(X,g)},onError:me,loading:ce}),E&&l().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:C.string,fullscreen:C.string,handleImageLoaded:C.func.isRequired,isFullscreen:C.bool,onImageError:C.func.isRequired,original:C.string.isRequired,originalAlt:C.string,originalHeight:C.string,originalWidth:C.string,originalTitle:C.string,sizes:C.string,srcSet:C.string,loading:C.string};const P=w;function I(b){return I=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},I(b)}function L(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function W(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?L(Object(E),!0).forEach(function(O){ne(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):L(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function ne(b,p,E){return(p=function(O){var q=function(re,me){if(I(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(I(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(O,"string");return I(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,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"}))},Be={strokeWidth:1,viewBox:"0 0 24 24"},Ne=function(b){var p=W(W({},Be),b),E=p.strokeWidth,O=p.viewBox,q=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:O,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},ae[q])};Ne.propTypes={strokeWidth:C.number,viewBox:C.string,icon:(0,C.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ee=Ne;var Te=l().memo(function(b){var p=b.isFullscreen,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},l().createElement(Ee,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Te.displayName="Fullscreen",Te.propTypes={isFullscreen:C.bool.isRequired,onClick:C.func.isRequired};const Xe=Te;var Ct=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},l().createElement(Ee,{icon:"left",viewBox:"6 0 12 24"}))});Ct.displayName="LeftNav",Ct.propTypes={disabled:C.bool.isRequired,onClick:C.func.isRequired};const An=Ct;var Pt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},l().createElement(Ee,{icon:"right",viewBox:"6 0 12 24"}))});Pt.displayName="RightNav",Pt.propTypes={disabled:C.bool.isRequired,onClick:C.func.isRequired};const st=Pt;var $t=l().memo(function(b){var p=b.isPlaying,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},l().createElement(Ee,{strokeWidth:2,icon:p?"pause":"play"}))});$t.displayName="PlayPause",$t.propTypes={isPlaying:C.bool.isRequired,onClick:C.func.isRequired};const Ut=$t;function ft(b){return ft=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},ft(b)}function at(){return at=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var O in E)Object.prototype.hasOwnProperty.call(E,O)&&(b[O]=E[O])}return b},at.apply(this,arguments)}function Lt(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function En(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Lt(Object(E),!0).forEach(function(O){Sn(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Lt(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function Sn(b,p,E){return(p=function(O){var q=function(re,me){if(ft(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(ft(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(O,"string");return ft(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var sr={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Dn=function(b){var p=En(En({},sr),b),E=p.children,O=p.className,q=wn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",at({},q,{className:O}),E)};Dn.propTypes={children:C.node.isRequired,className:C.string,delta:C.number,onSwiped:C.func,onSwiping:C.func};const Mn=Dn;function $e(b){return $e=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},$e(b)}function Tn(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function sn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Tn(Object(E),!0).forEach(function(O){ln(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Tn(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function jn(b,p){for(var E=0;E<p.length;E++){var O=p[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(b,cn(O.key),O)}}function an(b,p){return an=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,O){return E.__proto__=O,E},an(b,p)}function Fn(b,p){if(p&&($e(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oe(b)}function Oe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function vt(b){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},vt(b)}function ln(b,p,E){return(p=cn(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}function cn(b){var p=function(E,O){if($e(E)!=="object"||E===null)return E;var q=E[Symbol.toPrimitive];if(q!==void 0){var re=q.call(E,O);if($e(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(b,"string");return $e(p)==="symbol"?p:String(p)}var ar=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],jl=(0,C.arrayOf)((0,C.shape)({srcSet:C.string,media:C.string}));function So(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Ar=function(b){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&an(g,m)})(me,b);var p,E,O,q,re=(O=me,q=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 g,m=vt(O);if(q){var R=vt(this).constructor;g=Reflect.construct(m,arguments,R)}else g=m.apply(this,arguments);return Fn(this,g)});function me(g){var m;return function(R,U){if(!(R instanceof U))throw new TypeError("Cannot call a class as a function")}(this,me),ln(Oe(m=re.call(this,g)),"onBulletClick",function(R,U){var K=m.props,z=K.onBulletClick,ue=K.items,ce=m.state.currentIndex;R.target.blur(),ce!==U&&(ue.length===2?m.slideToIndexWithStyleReset(U,R):m.slideToIndex(U,R)),z&&z(R,U)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.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(Oe(m)),m.handleKeyDown=m.handleKeyDown.bind(Oe(m)),m.handleMouseDown=m.handleMouseDown.bind(Oe(m)),m.handleResize=m.handleResize.bind(Oe(m)),m.handleTouchMove=m.handleTouchMove.bind(Oe(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Oe(m)),m.handleScreenChange=m.handleScreenChange.bind(Oe(m)),m.handleSwiping=m.handleSwiping.bind(Oe(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Oe(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Oe(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Oe(m)),m.handleImageError=m.handleImageError.bind(Oe(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Oe(m)),m.renderThumbInner=m.renderThumbInner.bind(Oe(m)),m.renderItem=m.renderItem.bind(Oe(m)),m.slideLeft=m.slideLeft.bind(Oe(m)),m.slideRight=m.slideRight.bind(Oe(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Oe(m)),m.togglePlay=m.togglePlay.bind(Oe(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=ye(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return p=me,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,R=g.useWindowKeyDown;m&&this.play(),R?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(g,m){var R=this.props,U=R.items,K=R.lazyLoad,z=R.slideDuration,ue=R.slideInterval,ce=R.startIndex,he=R.thumbnailPosition,X=R.showThumbnails,Q=R.useWindowKeyDown,J=this.state,ie=J.currentIndex,fe=J.isPlaying,be=g.items.length!==U.length,_e=!Ae()(g.items,U),lt=g.startIndex!==ce,nt=g.thumbnailPosition!==he,Ge=g.showThumbnails!==X;ue===g.slideInterval&&z===g.slideDuration||fe&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ge&&X&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ge&&!X&&this.removeThumbnailsResizeObserver(),(be||Ge)&&this.handleResize(),m.currentIndex!==ie&&this.slideThumbnailBar(),g.slideDuration!==z&&(this.slideToIndex=ye(this.unthrottledSlideToIndex,z,{trailing:!1})),!K||g.lazyLoad&&!_e||(this.lazyLoaded=[]),Q!==g.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))),(lt||_e)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=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),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,R=m.currentIndex,U=m.isTransitioning,K=this.props,z=K.onSlide,ue=K.slideDuration;this.transitionTimer=window.setTimeout(function(){U&&(g.setState({isTransitioning:!U,isSwipingThumbnail:!1}),z&&z(R))},ue+50)}},{key:"onThumbnailClick",value:function(g,m){var R=this.props,U=R.onThumbnailClick,K=R.items,z=this.state.currentIndex;g.target.parentNode.parentNode.blur(),z!==m&&(K.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),U&&U(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var R=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){R.slideToIndex(m),R.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,R=this.props,U=R.disableThumbnailScroll,K=R.items,z=this.state,ue=z.thumbnailsWrapperWidth,ce=z.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(U)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=ce)return 0;m=he.scrollHeight-ce}else{if(he.scrollWidth<=ue||ue<=0)return 0;m=he.scrollWidth-ue}return g*(m/(K.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,R=this.props,U=R.infinite,K=R.items,z="",ue="image-gallery-left",ce="image-gallery-right";switch(g){case m-1:z=" ".concat(ue);break;case m:z=" ".concat("image-gallery-center");break;case m+1:z=" ".concat(ce)}return K.length>=3&&U&&(g===0&&m===K.length-1?z=" ".concat(ce):g===K.length-1&&m===0&&(z=" ".concat(ue))),z}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,R=m.currentIndex,U=m.currentSlideOffset,K=m.previousIndex,z=R!==K,ue=g===0&&K===0,ce=g===1&&K===1,he=g===0&&R===1,X=g===1&&R===0,Q=U===0,J=-100*R+100*g+U;return U>0?this.direction="left":U<0&&(this.direction="right"),X&&U>0&&(J=-100+U),he&&U<0&&(J=100+U),z?ue&&Q&&this.direction==="left"?J=100:ce&&Q&&this.direction==="right"&&(J=-100):(X&&Q&&this.direction==="left"&&(J=-100),he&&Q&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,R=m.currentIndex,U=m.currentSlideOffset,K=m.slideStyle,z=this.props,ue=z.infinite,ce=z.items,he=z.useTranslate3D,X=z.isRTL,Q=-100*R,J=ce.length-1,ie=(Q+100*g)*(X?-1:1)+U;ue&&ce.length>2&&(R===0&&g===J?ie=-100*(X?-1:1)+U:R===J&&g===0&&(ie=100*(X?-1:1)+U)),ue&&ce.length===2&&(ie=this.getTranslateXForTwoSlide(g));var fe="translate(".concat(ie,"%, 0)");return he&&(fe="translate3d(".concat(ie,"%, 0, 0)")),sn({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:fe,MozTransform:fe,msTransform:fe,OTransform:fe,transform:fe},K)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,R=m.useTranslate3D,U=m.isRTL,K=this.state,z=K.thumbsTranslate,ue=K.thumbsStyle,ce=U?-1*z:z;return this.isThumbnailVertical()?(g="translate(0, ".concat(z,"px)"),R&&(g="translate3d(0, ".concat(z,"px, 0)"))):(g="translate(".concat(ce,"px, 0)"),R&&(g="translate3d(".concat(ce,"px, 0, 0)"))),sn({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},ue)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,R=this.props,U=R.items,K=R.slideOnThumbnailOver,z=R.onClick,ue=R.lazyLoad,ce=R.onTouchMove,he=R.onTouchEnd,X=R.onTouchStart,Q=R.onMouseOver,J=R.onMouseLeave,ie=R.renderItem,fe=R.renderThumbInner,be=R.showThumbnails,_e=R.showBullets,lt=[],nt=[],Ge=[];return U.forEach(function(Ce,xe){var Wt=g.getAlignmentClassName(xe),Bn=Ce.originalClass?" ".concat(Ce.originalClass):"",$n=Ce.thumbnailClass?" ".concat(Ce.thumbnailClass):"",_t=Ce.renderItem||ie||g.renderItem,un=Ce.renderThumbInner||fe||g.renderThumbInner,Tt=!ue||Wt||g.lazyLoaded[xe];Tt&&ue&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var kn=g.getSlideStyle(xe),Un=l().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Wt," ").concat(Bn),style:kn,onClick:z,onKeyUp:g.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:he,onTouchStart:X,onMouseOver:Q,onFocus:Q,onMouseLeave:J,role:"button"},Tt?_t(Ce):l().createElement("div",{style:{height:"100%"}}));if(lt.push(Un),be&&Ce.thumbnail){var On=f("image-gallery-thumbnail",$n,{active:m===xe});nt.push(l().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:On,onMouseLeave:K?g.onThumbnailMouseLeave:null,onMouseOver:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onFocus:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onKeyUp:function(ct){return g.handleThumbnailKeyUp(ct,xe)},onClick:function(ct){return g.onThumbnailClick(ct,xe)}},un(Ce)))}if(_e){var Wn=f("image-gallery-bullet",Ce.bulletClass,{active:m===xe});Ge.push(l().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Wn,onClick:function(ct){return g.onBulletClick(ct,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:lt,thumbnails:nt,bullets:Ge}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,R=m.previousIndex,U=m.currentIndex,K=g.length-1;return Math.abs(R-U)>1&&!(R===0&&U===K)&&!(R===K&&U===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,R=m.isTransitioning,U=m.previousIndex,K=m.currentIndex;return R&&!(g===U||g===K)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,R=g.isSwipingThumbnail,U=-this.getThumbsTranslate(m);R||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:U,thumbsSwipedTranslate:U}))}},{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(g){var m=g.event,R=g.absX,U=g.dir,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=this.state,he=ce.galleryWidth,X=ce.isTransitioning,Q=ce.swipingUpDown,J=ce.swipingLeftRight;if(U!==wt&&U!==ot&&!Q||J){if(U!==Fe&&U!==tt||J||this.setState({swipingLeftRight:!0}),!z){var ie=this.props.swipingTransitionDuration;if(ue&&m.preventDefault(),X)this.setState({currentSlideOffset:0});else{var fe=U===tt?1:-1,be=R/he*100;Math.abs(be)>=100&&(be=100);var _e={transition:"transform ".concat(ie,"ms ease-out")};this.setState({currentSlideOffset:fe*be,slideStyle:_e})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,R=g.absX,U=g.absY,K=g.dir,z=this.props,ue=z.stopPropagation,ce=z.swipingThumbnailTransitionDuration,he=this.state,X=he.thumbsSwipedTranslate,Q=he.thumbnailsWrapperHeight,J=he.thumbnailsWrapperWidth,ie=he.swipingUpDown,fe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((K===Fe||K===tt||fe)&&!ie)return void(fe||this.setState({swipingLeftRight:!0}));K!==wt&&K!==ot||ie||this.setState({swipingUpDown:!0})}else{if((K===wt||K===ot||ie)&&!fe)return void(ie||this.setState({swipingUpDown:!0}));K!==Fe&&K!==tt||fe||this.setState({swipingLeftRight:!0})}var be,_e,lt,nt,Ge,Ce=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=X+(K===ot?U:-U),_e=Ce.scrollHeight-Q+20,lt=Math.abs(be)>_e,nt=be>20,Ge=Ce.scrollHeight<=Q):(be=X+(K===tt?R:-R),_e=Ce.scrollWidth-J+20,lt=Math.abs(be)>_e,nt=be>20,Ge=Ce.scrollWidth<=J),!Ge&&(K!==Fe&&K!==wt||!lt)&&(K!==tt&&K!==ot||!nt)){ue&&m.stopPropagation();var xe={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,R=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),R&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,R=g.dir,U=g.velocity,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=K.flickThreshold;if(!z){var he=this.props.isRTL;ue&&m.stopPropagation(),this.resetSwipingDirection();var X=(R===Fe?1:-1)*(he?-1:1),Q=U>ce&&!(R===wt||R===ot);this.handleOnSwipedTo(X,Q)}}},{key:"handleOnSwipedTo",value:function(g,m){var R=this.state,U=R.currentIndex,K=R.isTransitioning,z=U;!this.sufficientSwipe()&&!m||K||(z+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(z=U),this.unthrottledSlideToIndex(z)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,R=m.disableKeyDown,U=m.useBrowserFullscreen,K=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!R)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:K&&!U&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.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 g=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(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new nn(ee(function(R){R&&R.forEach(function(U){m.setState({thumbnailsWrapperWidth:U.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new nn(ee(function(R){R&&R.forEach(function(U){m.setState({thumbnailsWrapperHeight:U.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.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 g=this.props,m=g.onScreenChange,R=g.useBrowserFullscreen,U=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,K=this.imageGallery.current===U;m&&m(K),R&&this.setState({isFullscreen:K})}},{key:"slideToIndex",value:function(g,m){var R=this.state,U=R.currentIndex,K=R.isTransitioning,z=this.props,ue=z.items,ce=z.slideDuration,he=z.onBeforeSlide;if(!K){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var X=ue.length-1,Q=g;g<0?Q=X:g>X&&(Q=0),he&&Q!==U&&he(Q),this.setState({previousIndex:U,currentIndex:Q,isTransitioning:Q!==U,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var R=this.state,U=R.currentIndex,K=R.isTransitioning,z=this.props.items,ue=U+(m==="left"?-1:1);K||(z.length===2?this.slideToIndexWithStyleReset(ue,g):this.slideToIndex(ue,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var R=this,U=this.state,K=U.currentIndex,z=U.currentSlideOffset;this.setState({currentSlideOffset:z+(K>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return R.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){So(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){So(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?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 g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(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 g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,R=m.onPlay,U=m.slideInterval,K=m.slideDuration,z=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(U,K)),R&&g&&R(z))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,R=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(R))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var R=this.props.onImageLoad;!this.loadedImages[m]&&R&&(this.loadedImages[m]=!0,R(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,R=this.props.onImageError||this.handleImageError;return l().createElement(P,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:R,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){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:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,R=g.isFullscreen,U=g.modalFullscreen,K=g.isPlaying,z=this.props,ue=z.additionalClass,ce=z.disableThumbnailSwipe,he=z.indexSeparator,X=z.isRTL,Q=z.items,J=z.thumbnailPosition,ie=z.renderFullscreenButton,fe=z.renderCustomControls,be=z.renderLeftNav,_e=z.renderRightNav,lt=z.showBullets,nt=z.showFullscreenButton,Ge=z.showIndex,Ce=z.showThumbnails,xe=z.showNav,Wt=z.showPlayButton,Bn=z.renderPlayPauseButton,$n=this.getThumbnailStyle(),_t=this.getSlideItems(),un=_t.slides,Tt=_t.thumbnails,kn=_t.bullets,Un=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":X}),On=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:Un},fe&&fe(),this.canSlide()?l().createElement(l().Fragment,null,xe&&l().createElement(l().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),_e(this.slideRight,!this.canSlideRight())),l().createElement(Mn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},un))):l().createElement("div",{className:"image-gallery-slides"},un),Wt&&Bn(this.togglePlay,K),lt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},kn)),nt&&ie(this.toggleFullScreen,R),Ge&&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"},he),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),Wn=f("image-gallery",ue,{"fullscreen-modal":U}),ct=f("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:R}),Ol=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:Wn,"aria-live":"polite"},l().createElement("div",{className:ct},(J==="bottom"||J==="right")&&On,Ce&&Tt.length>0?l().createElement(Mn,{className:Ol,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:$n,"aria-label":"Thumbnail Navigation"},Tt))):null,(J==="top"||J==="left")&&On))}}],E&&jn(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),me}(l().Component);Ar.propTypes={flickThreshold:C.number,items:(0,C.arrayOf)((0,C.shape)({bulletClass:C.string,bulletOnClick:C.func,description:C.string,original:C.string,originalHeight:C.number,originalWidth:C.number,loading:C.string,thumbnailHeight:C.number,thumbnailWidth:C.number,thumbnailLoading:C.string,fullscreen:C.string,originalAlt:C.string,originalTitle:C.string,thumbnail:C.string,thumbnailAlt:C.string,thumbnailLabel:C.string,thumbnailTitle:C.string,originalClass:C.string,thumbnailClass:C.string,renderItem:C.func,renderThumbInner:C.func,imageSet:jl,srcSet:C.string,sizes:C.string})).isRequired,showNav:C.bool,autoPlay:C.bool,lazyLoad:C.bool,infinite:C.bool,showIndex:C.bool,showBullets:C.bool,showThumbnails:C.bool,showPlayButton:C.bool,showFullscreenButton:C.bool,disableThumbnailScroll:C.bool,disableKeyDown:C.bool,disableSwipe:C.bool,disableThumbnailSwipe:C.bool,useBrowserFullscreen:C.bool,onErrorImageURL:C.string,indexSeparator:C.string,thumbnailPosition:(0,C.oneOf)(["top","bottom","left","right"]),startIndex:C.number,slideDuration:C.number,slideInterval:C.number,slideOnThumbnailOver:C.bool,swipeThreshold:C.number,swipingTransitionDuration:C.number,swipingThumbnailTransitionDuration:C.number,onSlide:C.func,onBeforeSlide:C.func,onScreenChange:C.func,onPause:C.func,onPlay:C.func,onClick:C.func,onImageLoad:C.func,onImageError:C.func,onTouchMove:C.func,onTouchEnd:C.func,onTouchStart:C.func,onMouseOver:C.func,onMouseLeave:C.func,onBulletClick:C.func,onThumbnailError:C.func,onThumbnailClick:C.func,renderCustomControls:C.func,renderLeftNav:C.func,renderRightNav:C.func,renderPlayPauseButton:C.func,renderFullscreenButton:C.func,renderItem:C.func,renderThumbInner:C.func,stopPropagation:C.bool,additionalClass:C.string,useTranslate3D:C.bool,isRTL:C.bool,useWindowKeyDown:C.bool},Ar.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(An,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(st,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Ut,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(Xe,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const kl=Ar})(),a})())})(ll);var rp=ll.exports;const ip=Ti(rp);function op(){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 v=new Map,l=new IntersectionObserver(function(u){u.forEach(function(S){var y=v.get(S.target);y==null||y(S)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:v},a.set(c,f)}return{observe:function(S,y){var T,j;(T=f)==null||T.entryCallbacks.set(S,y),(j=f)==null||j.observer.observe(S)},unobserve:function(S){var y,T;(y=f)==null||y.entryCallbacks.delete(S),(T=f)==null||T.observer.unobserve(S)}}}return{getObserver:t}}var sp="0px",ap=[0],lp=op();function cp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:sp,i=(n=e==null?void 0:e.threshold)!=null?n:ap,s=F.useRef(null),a=F.useRef(null),c=F.useRef(null),f=F.useState(),v=f[0],l=f[1],u=F.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var A=lp.getObserver({root:a.current,rootMargin:r,threshold:i});A.observe(j,function(_){l(_)}),c.current=A},[r,i]),S=F.useCallback(function(){var j=c.current,A=s.current;A&&(j==null||j.unobserve(A)),c.current=null},[]),y=F.useCallback(function(j){S(),s.current=j,u()},[u,S]),T=F.useCallback(function(j){S(),a.current=j,u()},[u,S]);return[y,{entry:v,rootRef:T}]}function vi(){return vi=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},vi.apply(this,arguments)}function up(e){var t,n=cp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=F.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,vi({},i,{isVisible:s,wasEverVisible:c})]}var dp=100;function hp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?dp:a,f=up({rootMargin:i}),v=f[0],l=f[1],u=l.rootRef,S=l.isVisible,y=!s&&!t&&S&&n;return F.useEffect(function(){if(y){var T=setTimeout(function(){r()},c);return function(){clearTimeout(T)}}},[r,y,c]),[v,{rootRef:u}]}const fp={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"/>'},pp={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 Gr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Vr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function cl(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 ul(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 mp(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 mo={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,"-":Gr?173:189,"=":Gr?61:187,";":Gr?59:186,"'":222,"[":219,"]":221,"\\":220},Kt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},yi={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ve={16:!1,18:!1,17:!1,91:!1},De={};for(var dr=1;dr<20;dr++)mo["f".concat(dr)]=111+dr;var Ie=[],ps=!1,dl="all",hl=[],Nr=function(t){return mo[t.toLowerCase()]||Kt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function fl(e){dl=e||"all"}function rr(){return dl||"all"}function gp(){return Ie.slice(0)}function vp(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 yp(e){return typeof e=="string"&&(e=Nr(e)),Ie.indexOf(e)!==-1}function bp(e,t){var n,r;e||(e=rr());for(var i in De)if(Object.prototype.hasOwnProperty.call(De,i))for(n=De[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;rr()===e&&fl(t||"all")}function xp(e){var t=e.keyCode||e.which||e.charCode,n=Ie.indexOf(t);if(n>=0&&Ie.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ie.splice(0,Ie.length),(t===93||t===224)&&(t=91),t in Ve){Ve[t]=!1;for(var r in Kt)Kt[r]===t&&(ht[r]=!1)}}function wp(e){if(typeof e>"u")Object.keys(De).forEach(function(a){return delete De[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Hr(a)});else if(typeof e=="object")e.key&&Hr(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=""),Hr({key:e,scope:i,method:s,splitKey:"+"})}}var Hr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=ul(n);c.forEach(function(f){var v=f.split(a),l=v.length,u=v[l-1],S=u==="*"?"*":Nr(u);if(De[S]){r||(r=rr());var y=l>1?cl(Kt,v):[];De[S]=De[S].filter(function(T){var j=i?T.method===i:!0;return!(j&&T.scope===r&&mp(T.mods,y))})}})};function ms(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 Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(!Ve[s]&&t.mods.indexOf(+s)>-1||Ve[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!Ve[16]&&!Ve[18]&&!Ve[17]&&!Ve[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 gs(e,t){var n=De["*"],r=e.keyCode||e.which||e.charCode;if(ht.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ie.indexOf(r)===-1&&r!==229&&Ie.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(T){var j=yi[T];e[T]&&Ie.indexOf(j)===-1?Ie.push(j):!e[T]&&Ie.indexOf(j)>-1?Ie.splice(Ie.indexOf(j),1):T==="metaKey"&&e[T]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(j))))}),r in Ve){Ve[r]=!0;for(var i in Kt)Kt[i]===r&&(ht[i]=!0);if(!n)return}for(var s in Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(Ve[s]=e[yi[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),Ve[17]=!0,Ve[18]=!0);var a=rr();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)&&ms(e,n[c],a,t);if(r in De){for(var f=0;f<De[r].length;f++)if((e.type==="keydown"&&De[r][f].keydown||e.type==="keyup"&&De[r][f].keyup)&&De[r][f].key){for(var v=De[r][f],l=v.splitKey,u=v.key.split(l),S=[],y=0;y<u.length;y++)S.push(Nr(u[y]));S.sort().join("")===Ie.sort().join("")&&ms(e,v,a,t)}}}}function Ep(e){return hl.indexOf(e)>-1}function ht(e,t,n){Ie=[];var r=ul(e),i=[],s="all",a=document,c=0,f=!1,v=!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&&(v=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=cl(Kt,e)),e=e[e.length-1],e=e==="*"?"*":Nr(e),e in De||(De[e]=[]),De[e].push({keyup:f,keydown:v,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Ep(a)&&window&&(hl.push(a),Vr(a,"keydown",function(S){gs(S,a)},u),ps||(ps=!0,Vr(window,"focus",function(){Ie=[]},u)),Vr(a,"keyup",function(S){gs(S,a),xp(S)},u))}function Sp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(De).forEach(function(n){var r=De[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Xr={setScope:fl,getScope:rr,deleteScope:bp,getPressedKeyCodes:gp,isPressed:yp,filter:vp,trigger:Sp,unbind:wp,keyMap:mo,modifier:Kt,modifierMap:yi};for(var Yr in Xr)Object.prototype.hasOwnProperty.call(Xr,Yr)&&(ht[Yr]=Xr[Yr]);if(typeof window<"u"){var Tp=window.hotkeys;ht.noConflict=function(e){return e&&window.hotkeys===ht&&(window.hotkeys=Tp),ht},window.hotkeys=ht}ht.filter=function(){return!0};var pl=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},jp=function(t){return pl(t,["INPUT","TEXTAREA","SELECT"])};function kp(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,v=i.filterPreventDefault,l=v===void 0?!0:v,u=i.enabled,S=u===void 0?!0:u,y=i.enableOnContentEditable,T=y===void 0?!1:y,j=F.useRef(null),A=F.useCallback(function(_,D){var B,G;return a&&!a(_)?!l:jp(_)&&!pl(_,s)||(B=_.target)!=null&&B.isContentEditable&&!T?!0:j.current===null||document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement)?(t(_,D),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return F.useEffect(function(){if(!S){ht.unbind(e,A);return}return c&&f!==!0&&(n.keydown=!1),ht(e,n||{},A),function(){return ht.unbind(e,A)}},[A,e,S]),j}ht.isPressed;const ml=F.createContext({open:!1,toggleOpen:e=>{}});function Op({children:e}){const[t,n]=F.useState(!1),r=s=>{n(s??!s)},i=F.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(ml.Provider,{value:i,children:e})}function go(){return F.useContext(ml)}const mt={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},Ip=e=>or(async()=>{const{data:t}=await e.get(mt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Rp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...yc(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(Dr(f,v=>v===""||v===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Dr(n,(v,l)=>c.includes(l)):{};r(Dr(f,v=>v===""||v===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 Cp=(e,t,n)=>e&&t||!n,gl=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],vl=(e,t,n)=>{var r,i;const s=bc(e),a=xc(s.search);if((r=wc(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Ec({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:v}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Ri(e,{...f||v?{imageFilter:"resize",w:f,h:v}:{},v:c})},Pp=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Lp=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),_p=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},Np=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Ap=()=>window.innerWidth<=600,Dp={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}"'}},Mp={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}” 的所有搜索结果"}},Qr={en:Io(Dp),zh:Io(Mp)},yl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Fp=e=>(t,n)=>{const r=Qr[e]?Qr[e][t]:Qr.en[t];return Np(r,n)||t},bl={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:()=>{}}},xl=F.createContext(bl),{Provider:Bp,Consumer:ug}=xl;function $p(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=ye=>ye,extraFilter:v=ye=>ye,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:S=!1,showCategory:y=!0,tagFilters:T=[],children:j,storeVersion:A,onSearchSelect:_=()=>{},endpoint:D,blockletRender:B,compact:G=!1}=e,k=yl(r,A),M=F.useMemo(()=>Us({baseURL:D,headers:k}),[D]),V=Rp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:_}),[$,le]=F.useState(""),{data:H=[],error:se,loading:je,run:We}=Ip(M),Me=F.useMemo(()=>{const ye=vc(H,[Ae=>Ae.name],["asc"]),oe=ye.findIndex(Ae=>Ae.name==="All"||Ae.locales.en==="All");return oe>-1?[{...ye[oe],_id:"All"},...ye.slice(0,oe),...ye.slice(oe+1)]:ye},[H]),Qe=F.useCallback(Fp(t),[t]),Z=F.useMemo(()=>Lp(Me,t),[Me,t]),pe=Pp(Qe),ee={search:V,compact:G,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:je},extraFilter:v,endpoint:D,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Qe,storeVersion:A,serverVersion:r,selectedCategory:V.filters.category||(c.showExplore?"":"All"),categoryList:Me,blockletRender:B,locale:t,categoryOptions:Z,priceOptions:pe,storeApi:M,baseSearch:l,showResourcesSwitch:S,showCategory:y,tagFilters:T,onFilterChange:i,getCategoryLocale:ye=>{if(!ye)return null;const oe=H.find(Ae=>Ae._id===ye||Ae.locales.en==="All");return oe?oe.locales[t]||oe.locales.en:null},get developerName(){return $},updateDeveloperName:le};return F.useEffect(()=>{setTimeout(We,u||0)},[D,We,u]),o.jsx(Bp,{value:ee,children:j})}function it(){return F.useContext(xl)||bl}function wl({children:e,onClick:t,size:n=32,...r}){return o.jsx(ir,{...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 hr(e,t){return e===void 0?t:e}function vo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=Gt(),c=qt(a.breakpoints.down("sm")),f=qt(a.breakpoints.between("sm","md")),v=qt(a.breakpoints.between("md","lg")),l=qt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:v?n||null:l?r||null:i||null;let u=e;return c||(u=hr(t,u),f)||(u=hr(n,u),v)||(u=hr(r,u),l)?u:hr(i,u)}function Up({children:e}){const{open:t,toggleOpen:n}=go();return o.jsx(vo,{xs:o.jsx($l,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const Wp=F.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(ir,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(xt,{size:"1em"})}));function bi({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=F.useRef(null),c=Gt(),[f,v]=F.useState(!1),[l,u]=F.useState(e!==null?e:""),S=qt(c.breakpoints.down("sm"));F.useEffect(()=>{u(e!==null?e:"")},[e]);const y=F.useCallback(()=>{v(!1)},[]),T=F.useCallback(()=>{v(!0)},[]);function j(_){u(_.value),n(_.value),S&&y()}function A(_){return _===l}return o.jsxs(o.Fragment,{children:[o.jsxs(zp,{ref:a,onClick:T,variant:"outlined",size:"medium",className:["my-select__selector",Vn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(_=>_.value===l))==null?void 0:s.name)||r,o.jsx(Ul,{className:"my-select__arrowdown",component:uc,sx:{width:18,height:18}})]}),o.jsx(Wl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:_,placement:D})=>o.jsx(zl,{..._,style:{transformOrigin:D==="bottom"?"center top":"center bottom"},children:o.jsx(ql,{children:o.jsx(Kl,{onClickAway:y,children:o.jsx(qp,{autoFocusItem:f,onMouseEnter:T,onMouseLeave:y,children:t.map(B=>o.jsxs(Si,{onClick:()=>j(B),sx:{fontSize:14},children:[o.jsx(zs,{sx:{mr:1,fontSize:16,visibility:A(B.value)?"visible":"hidden"}}),B.name]},B.value))})})})})})]})}const zp=Vt(Wp)`
485
+ `;const ts=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Qh=(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`},qa={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,v;return e?o.jsx(Ps,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Fl.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:[(v=r==null?void 0:r.popper)==null?void 0:v.sx]]}},children:n}):n}function cr({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(rt,{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(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function Jh(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:v="Install",buttonDisabled:l,buttonLoading:u,button:S,onButtonClick:y=()=>{},onMainClick:T,className:j,ref:A,icons:L,status:D,...B}=e,G=Gt(),k=(H,se=()=>!1)=>(je,...We)=>{const Me=H instanceof Function;(se()||Me)&&(je.preventDefault(),je.stopPropagation(),Me&&H(...We))},M=T&&k(T),V=k(y,()=>!!(S||l||u)),$=F.isValidElement(t)?{children:t}:{title:ts(t),dangerouslySetInnerHTML:{__html:t}},le=F.isValidElement(n)?{children:n}:{title:ts(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Bl,{variant:"outlined",onClick:M,...B,sx:{p:{xs:2,md:3},borderRadius:1,...B.sx},children:[o.jsxs(rt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(br,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...$}),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(lc,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),L==null?void 0:L.map(H=>o.jsx(ci,{title:H.title,children:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon,style:{color:H.color}}):H.icon},H.key))]}),y&&o.jsxs(dt,{color:"reverse",variant:"outlined",size:"small",disabled:l||u,style:{borderColor:G.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:G.typography.fontWeightMedium},onClick:V,children:[u&&o.jsx(xt,{size:15,style:{marginRight:3,color:"inherit"}}),v]}),S]}),o.jsx(rt,{py:2,children:o.jsx(ge,{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(rt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(cr,{icon:o.jsx(br,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(cr,{icon:o.jsx(pt,{icon:qa}),title:a,children:Qh(a)}),D==null?void 0:D.filter(H=>H.align!=="right").map(H=>o.jsx(cr,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,children:H.text},H.key)),o.jsx(Y,{sx:{flex:1}}),D==null?void 0:D.filter(H=>H.align==="right").map(H=>o.jsx(cr,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,sx:{color:H.color},children:H.text},H.key))]})]})}const Zh={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>'},Yn=/^[a-z0-9]+(-[a-z0-9]+)*$/,_r=(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(),v={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!vr(v)?null:v}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!vr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!vr(c,n)?null:c}return null},vr=(e,t)=>e?!!((e.provider===""||e.provider.match(Yn))&&(t&&e.prefix===""||e.prefix.match(Yn))&&e.name.match(Yn)):!1,Ka=Object.freeze({left:0,top:0,width:16,height:16}),wr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ao=Object.freeze({...Ka,...wr}),ui=Object.freeze({...ao,body:"",hidden:!1});function ef(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 ns(e,t){const n=ef(e,t);for(const r in ui)r in wr?r in e&&!(r in n)&&(n[r]=wr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function tf(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 nf(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=ns(r[c]||i[c],s)}return a(t),n.forEach(a),ns(e,s)}function Ga(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=tf(e);for(const i in r){const s=r[i];s&&(t(i,nf(e,i,s)),n.push(i))}return n}const rf={provider:"",aliases:{},not_found:{},...Ka};function qr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Va(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!qr(e,rf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Yn)||typeof s.body!="string"||!qr(s,ui))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(Yn)||typeof a!="string"||!n[a]&&!r[a]||!qr(s,ui))return null}return t}const rs=Object.create(null);function of(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function yn(e,t){const n=rs[e]||(rs[e]=Object.create(null));return n[t]||(n[t]=of(e,t))}function lo(e,t){return Va(t)?Ga(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function sf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let er=!1;function Ha(e){return typeof e=="boolean"&&(er=e),er}function af(e){const t=typeof e=="string"?_r(e,!0,er):e;if(t){const n=yn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function lf(e,t){const n=_r(e,!0,er);if(!n)return!1;const r=yn(n.provider,n.prefix);return sf(r,n.name,t)}function cf(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),er&&!t&&!e.prefix){let i=!1;return Va(e)&&(e.prefix="",Ga(e,(s,a)=>{a&&lf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!vr({provider:t,prefix:n,name:"a"}))return!1;const r=yn(t,n);return!!lo(r,e)}const Xa=Object.freeze({width:null,height:null}),Ya=Object.freeze({...Xa,...wr}),uf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,df=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function is(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(uf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=df.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 hf=e=>e==="unset"||e==="undefined"||e==="none";function ff(e,t){const n={...ao,...e},r={...Ya,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(T=>{const j=[],A=T.hFlip,L=T.vFlip;let D=T.rotate;A?L?D+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):L&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let B;switch(D<0&&(D-=Math.floor(D/4)*4),D=D%4,D){case 1:B=i.height/2+i.top,j.unshift("rotate(90 "+B.toString()+" "+B.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:B=i.width/2+i.left,j.unshift("rotate(-90 "+B.toString()+" "+B.toString()+")");break}D%2===1&&(i.left!==i.top&&(B=i.left,i.left=i.top,i.top=B),i.width!==i.height&&(B=i.width,i.width=i.height,i.height=B)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,v=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?v:c,l=is(u,f/v)):(l=a==="auto"?f:a,u=c===null?is(l,v/f):c==="auto"?v:c);const S={},y=(T,j)=>{hf(j)||(S[T]=j.toString())};return y("width",l),y("height",u),S.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+v.toString(),{attributes:S,body:s}}const pf=/\sid="(\S+)"/g,mf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let gf=0;function vf(e,t=mf){const n=[];let r;for(;r=pf.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+(gf++).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 di=Object.create(null);function yf(e,t){di[e]=t}function hi(e){return di[e]||di[""]}function co(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 uo=Object.create(null),Gn=["https://api.simplesvg.com","https://api.unisvg.com"],yr=[];for(;Gn.length>0;)Gn.length===1||Math.random()>.5?yr.push(Gn.shift()):yr.push(Gn.pop());uo[""]=co({resources:["https://api.iconify.design"].concat(yr)});function bf(e,t){const n=co(t);return n===null?!1:(uo[e]=n,!0)}function ho(e){return uo[e]}const xf=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let os=xf();function wf(e,t){const n=ho(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 Ef(e){return e===404}const Sf=(e,t,n)=>{const r=[],i=wf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,v)=>{c+=f.length+1,c>=i&&v>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function Tf(e){if(typeof e=="string"){const t=ho(e);if(t)return t.path}return"/"}const jf=(e,t,n)=>{if(!os){n("abort",424);return}let r=Tf(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;os(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Ef(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)})},kf={prepare:Sf,send:jf};function Of(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)),v=f[a]||(f[a]=yn(s,a));let l;c in v.icons?l=t.loaded:a===""||v.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Qa(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function If(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 v=f.name;if(e.icons[v])a.loaded.push({provider:r,prefix:i,name:v});else if(e.missing.has(v))a.missing.push({provider:r,prefix:i,name:v});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Qa([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Rf=0;function Cf(e,t,n){const r=Rf++,i=Qa.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 Pf(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?_r(i,t,n):i;s&&r.push(s)}),r}var _f={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Lf(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 M=e.resources.slice(0);for(a=[];M.length>1;){const V=Math.floor(Math.random()*M.length);a.push(M[V]),M=M.slice(0,V).concat(M.slice(V+1))}a=a.concat(M)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",v=0,l,u=null,S=[],y=[];typeof r=="function"&&y.push(r);function T(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),T(),S.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),S=[]}function A(M,V){V&&(y=[]),typeof M=="function"&&y.push(M)}function L(){return{startTime:c,payload:t,status:f,queriesSent:v,queriesPending:S.length,subscribe:A,abort:j}}function D(){f="failed",y.forEach(M=>{M(void 0,l)})}function B(){S.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),S=[]}function G(M,V,$){const le=V!=="success";switch(S=S.filter(H=>H!==M),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(V==="abort"){l=$,D();return}if(le){l=$,S.length||(a.length?k():D());return}if(T(),B(),!e.random){const H=e.resources.indexOf(M.resource);H!==-1&&H!==e.index&&(e.index=H)}f="completed",y.forEach(H=>{H($)})}function k(){if(f!=="pending")return;T();const M=a.shift();if(M===void 0){if(S.length){u=setTimeout(()=>{T(),f==="pending"&&(B(),D())},e.timeout);return}D();return}const V={status:"pending",resource:M,callback:($,le)=>{G(V,$,le)}};S.push(V),v++,u=setTimeout(k,e.rotate),n(M,t,V.callback)}return setTimeout(k),L}function Ja(e){const t={..._f,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,v){const l=Lf(t,c,f,(u,S)=>{r(),v&&v(u,S)});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 ss(){}const Kr=Object.create(null);function Nf(e){if(!Kr[e]){const t=ho(e);if(!t)return;const n=Ja(t),r={config:t,redundancy:n};Kr[e]=r}return Kr[e]}function Af(e,t,n){let r,i;if(typeof e=="string"){const s=hi(e);if(!s)return n(void 0,424),ss;i=s.send;const a=Nf(e);a&&(r=a.redundancy)}else{const s=co(e);if(s){r=Ja(s);const a=e.resources?e.resources[0]:"",c=hi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),ss):r.query(t,i,n)().abort}const as="iconify2",tr="iconify",Za=tr+"-count",ls=tr+"-version",el=36e5,Df=168;function fi(e,t){try{return e.getItem(t)}catch{}}function fo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function cs(e,t){try{e.removeItem(t)}catch{}}function pi(e,t){return fo(e,Za,t.toString())}function mi(e){return parseInt(fi(e,Za))||0}const Lr={local:!0,session:!0},tl={local:new Set,session:new Set};let po=!1;function Mf(e){po=e}let ur=typeof window>"u"?{}:window;function nl(e){const t=e+"Storage";try{if(ur&&ur[t]&&typeof ur[t].length=="number")return ur[t]}catch{}Lr[e]=!1}function rl(e,t){const n=nl(e);if(!n)return;const r=fi(n,ls);if(r!==as){if(r){const c=mi(n);for(let f=0;f<c;f++)cs(n,tr+f.toString())}fo(n,ls,as),pi(n,0);return}const i=Math.floor(Date.now()/el)-Df,s=c=>{const f=tr+c.toString(),v=fi(n,f);if(typeof v=="string"){try{const l=JSON.parse(v);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{}cs(n,f)}};let a=mi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,pi(n,a)):tl[e].add(c))}function il(){if(!po){Mf(!0);for(const e in Lr)rl(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=yn(r,i);if(!lo(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Ff(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Lr)rl(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Bf(e,t){po||il();function n(r){let i;if(!Lr[r]||!(i=nl(r)))return;const s=tl[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=mi(i),!pi(i,a+1))return;const c={cached:Math.floor(Date.now()/el),provider:e.provider,data:t};return fo(i,tr+a.toString(),JSON.stringify(c))}t.lastModified&&!Ff(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function us(){}function $f(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,If(e)}))}function Uf(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=hi(n)))return;s.prepare(n,r,i).forEach(c=>{Af(n,c,f=>{if(typeof f!="object")c.icons.forEach(v=>{e.missing.add(v)});else try{const v=lo(e,f);if(!v.length)return;const l=e.pendingIcons;l&&v.forEach(u=>{l.delete(u)}),Bf(e,f)}catch(v){console.error(v)}$f(e)})})}))}const Wf=(e,t)=>{const n=Pf(e,!0,Ha()),r=Of(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,us)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:v,prefix:l}=f;if(l===c&&v===a)return;a=v,c=l,s.push(yn(v,l));const u=i[v]||(i[v]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:v,prefix:l,name:u}=f,S=yn(v,l),y=S.pendingIcons||(S.pendingIcons=new Set);y.has(u)||(y.add(u),i[v][l].push(u))}),s.forEach(f=>{const{provider:v,prefix:l}=f;i[v][l].length&&Uf(f,i[v][l])}),t?Cf(t,r,s):us};function zf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Xa?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const qf=/[\s,]+/;function Kf(e,t){t.split(qf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Gf(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 Vf(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 Hf(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Xf(e){return"data:image/svg+xml,"+Hf(e)}function Yf(e){return'url("'+Xf(e)+'")'}let Qn;function Qf(){try{Qn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Qn=null}}function Jf(e){return Qn===void 0&&Qf(),Qn?Qn.createHTML(e):e}const ol={...Ya,inline:!1},Zf={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},ep={display:"inline-block"},gi={backgroundColor:"currentColor"},sl={backgroundColor:"transparent"},ds={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},hs={WebkitMask:gi,mask:gi,background:sl};for(const e in hs){const t=hs[e];for(const n in ds)t[e+n]=ds[n]}const tp={...ol,inline:!0};function fs(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const np=(e,t,n,r)=>{const i=n?tp:ol,s=zf(i,t),a=t.mode||"svg",c={},f=t.style||{},v={...a==="svg"?Zf:{},ref:r};for(let L in t){const D=t[L];if(D!==void 0)switch(L){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[L]=D===!0||D==="true"||D===1;break;case"flip":typeof D=="string"&&Kf(s,D);break;case"color":c.color=D;break;case"rotate":typeof D=="string"?s[L]=Gf(D):typeof D=="number"&&(s[L]=D);break;case"ariaHidden":case"aria-hidden":D!==!0&&D!=="true"&&delete v["aria-hidden"];break;default:i[L]===void 0&&(v[L]=D)}}const l=ff(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){v.style={...c,...f},Object.assign(v,u);let L=0,D=t.id;return typeof D=="string"&&(D=D.replace(/-/g,"_")),v.dangerouslySetInnerHTML={__html:Jf(vf(l.body,D?()=>D+"ID"+L++:"iconifyReact"))},Mt.createElement("svg",v)}const{body:S,width:y,height:T}=e,j=a==="mask"||(a==="bg"?!1:S.indexOf("currentColor")!==-1),A=Vf(S,{...u,width:y+"",height:T+""});return v.style={...c,"--svg":Yf(A),width:fs(u.width),height:fs(u.height),...ep,...j?gi:sl,...f},Mt.createElement("span",v)};Ha(!0);yf("",kf);if(typeof document<"u"&&typeof window<"u"){il();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"||!cf(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;bf(n,i)||console.error(r)}catch{console.error(r)}}}}class al extends Mt.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=_r(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=af(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:Wf([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:Mt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),np({...ao,...n.data},r,t._inline,t._ref)}}const nr=Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Mt.createElement(al,r)});Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Mt.createElement(al,r)});var ll={exports:{}};(function(e,t){(function(n,r){e.exports=r(F)})(Se,n=>(()=>{var r={703:(c,f,v)=>{var l=v(414);function u(){}function S(){}S.resetWarningCache=u,c.exports=function(){function y(A,L,D,B,G,k){if(k!==l){var M=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 M.name="Invariant Violation",M}}function T(){return y}y.isRequired=y;var j={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:S,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,v)=>{c.exports=v(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",v=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function S(y,T){if(y===T)return!0;if(y&&T&&typeof y=="object"&&typeof T=="object"){if(y.constructor!==T.constructor)return!1;var j,A,L,D;if(Array.isArray(y)){if((j=y.length)!=T.length)return!1;for(A=j;A--!=0;)if(!S(y[A],T[A]))return!1;return!0}if(v&&y instanceof Map&&T instanceof Map){if(y.size!==T.size)return!1;for(D=y.entries();!(A=D.next()).done;)if(!T.has(A.value[0]))return!1;for(D=y.entries();!(A=D.next()).done;)if(!S(A.value[1],T.get(A.value[0])))return!1;return!0}if(l&&y instanceof Set&&T instanceof Set){if(y.size!==T.size)return!1;for(D=y.entries();!(A=D.next()).done;)if(!T.has(A.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(T)){if((j=y.length)!=T.length)return!1;for(A=j;A--!=0;)if(y[A]!==T[A])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((j=(L=Object.keys(y)).length)!==Object.keys(T).length)return!1;for(A=j;A--!=0;)if(!Object.prototype.hasOwnProperty.call(T,L[A]))return!1;if(f&&y instanceof Element)return!1;for(A=j;A--!=0;)if((L[A]!=="_owner"&&L[A]!=="__v"&&L[A]!=="__o"||!y.$$typeof)&&!S(y[L[A]],T[L[A]]))return!1;return!0}return y!=y&&T!=T}c.exports=function(y,T){try{return S(y,T)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var v=i[c]={exports:{}};return r[c](v,v.exports,s),v.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 v in f)s.o(f,v)&&!s.o(c,v)&&Object.defineProperty(c,v,{enumerable:!0,get:f[v]})},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,E,O="";if(typeof b=="string"||typeof b=="number")O+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(E=c(b[p]))&&(O&&(O+=" "),O+=E);else for(p in b)b[p]&&(O&&(O+=" "),O+=p);return O}function f(){for(var b,p,E=0,O="";E<arguments.length;)(b=arguments[E++])&&(p=c(b))&&(O&&(O+=" "),O+=p);return O}s.r(a),s.d(a,{default:()=>kl});var v=s(359),l=s.n(v);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},S=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var y=typeof self=="object"&&self&&self.Object===Object&&self;const T=S||y||Function("return this")(),j=function(){return T.Date.now()};var A=/\s/,L=/^\s+/;const D=function(b){return b&&b.slice(0,function(p){for(var E=p.length;E--&&A.test(p.charAt(E)););return E}(b)+1).replace(L,"")},B=T.Symbol;var G=Object.prototype,k=G.hasOwnProperty,M=G.toString,V=B?B.toStringTag:void 0,$=Object.prototype.toString,le=B?B.toStringTag:void 0;const H=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":le&&le in Object(b)?function(p){var E=k.call(p,V),O=p[V];try{p[V]=void 0;var q=!0}catch{}var re=M.call(p);return q&&(E?p[V]=O:delete p[V]),re}(b):function(p){return $.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,We=/^0o[0-7]+$/i,Me=parseInt;const Qe=function(b){if(typeof b=="number")return b;if(function(O){return typeof O=="symbol"||function(q){return q!=null&&typeof q=="object"}(O)&&H(O)=="[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=D(b);var E=je.test(b);return E||We.test(b)?Me(b.slice(2),E?2:8):se.test(b)?NaN:+b};var Z=Math.max,pe=Math.min;const ee=function(b,p,E){var O,q,re,me,g,m,R=0,U=!1,K=!1,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");function ue(ie){var fe=O,be=q;return O=q=void 0,R=ie,me=b.apply(be,fe)}function ce(ie){return R=ie,g=setTimeout(X,p),U?ue(ie):me}function he(ie){var fe=ie-m;return m===void 0||fe>=p||fe<0||K&&ie-R>=re}function X(){var ie=j();if(he(ie))return Q(ie);g=setTimeout(X,function(fe){var be=p-(fe-m);return K?pe(be,re-(fe-R)):be}(ie))}function Q(ie){return g=void 0,z&&O?ue(ie):(O=q=void 0,me)}function J(){var ie=j(),fe=he(ie);if(O=arguments,q=this,m=ie,fe){if(g===void 0)return ce(m);if(K)return clearTimeout(g),g=setTimeout(X,p),ue(m)}return g===void 0&&(g=setTimeout(X,p)),me}return p=Qe(p)||0,u(E)&&(U=!!E.leading,re=(K="maxWait"in E)?Z(Qe(E.maxWait)||0,p):re,z="trailing"in E?!!E.trailing:z),J.cancel=function(){g!==void 0&&clearTimeout(g),R=0,O=m=q=g=void 0},J.flush=function(){return g===void 0?me:Q(j())},J},ye=function(b,p,E){var O=!0,q=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(E)&&(O="leading"in E?!!E.leading:O,q="trailing"in E?!!E.trailing:q),ee(b,p,{leading:O,maxWait:p,trailing:q})};var oe=s(590),Ae=s.n(oe),we=function(){if(typeof Map<"u")return Map;function b(p,E){var O=-1;return p.some(function(q,re){return q[0]===E&&(O=re,!0)}),O}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(E){var O=b(this.__entries__,E),q=this.__entries__[O];return q&&q[1]},p.prototype.set=function(E,O){var q=b(this.__entries__,E);~q?this.__entries__[q][1]=O:this.__entries__.push([E,O])},p.prototype.delete=function(E){var O=this.__entries__,q=b(O,E);~q&&O.splice(q,1)},p.prototype.has=function(E){return!!~b(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,O){O===void 0&&(O=null);for(var q=0,re=this.__entries__;q<re.length;q++){var me=re[q];E.call(O,me[1],me[0])}},p}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,qe=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")(),Ht=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(qe):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Xt=["top","right","bottom","left","width","height","size","weight"],Ft=typeof MutationObserver<"u",Yt=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var O=!1,q=!1,re=0;function me(){O&&(O=!1,p()),q&&m()}function g(){Ht(me)}function m(){var R=Date.now();if(O){if(R-re<2)return;q=!0}else O=!0,q=!1,setTimeout(g,20);re=R}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 E=this.observers_,O=E.indexOf(p);~O&&E.splice(O,1),!E.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var p=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return p.forEach(function(E){return E.broadcastActive()}),p.length>0},b.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ft?(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(){Je&&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 E=p.propertyName,O=E===void 0?"":E;Xt.some(function(q){return!!~O.indexOf(q)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Pe=function(b,p){for(var E=0,O=Object.keys(p);E<O.length;E++){var q=O[E];Object.defineProperty(b,q,{value:p[q],enumerable:!1,writable:!1,configurable:!0})}return b},_e=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||qe},Ze=ke(0,0,0,0);function de(b){return parseFloat(b)||0}function Qt(b){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(O,q){return O+de(b["border-"+q+"-width"])},0)}var Jt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof _e(b).SVGGraphicsElement}:function(b){return b instanceof _e(b).SVGElement&&typeof b.getBBox=="function"};function Zt(b){return Je?Jt(b)?function(p){var E=p.getBBox();return ke(0,0,E.width,E.height)}(b):function(p){var E=p.clientWidth,O=p.clientHeight;if(!E&&!O)return Ze;var q=_e(p).getComputedStyle(p),re=function(z){for(var ue={},ce=0,he=["top","right","bottom","left"];ce<he.length;ce++){var X=he[ce],Q=z["padding-"+X];ue[X]=de(Q)}return ue}(q),me=re.left+re.right,g=re.top+re.bottom,m=de(q.width),R=de(q.height);if(q.boxSizing==="border-box"&&(Math.round(m+me)!==E&&(m-=Qt(q,"left","right")+me),Math.round(R+g)!==O&&(R-=Qt(q,"top","bottom")+g)),!function(z){return z===_e(z).document.documentElement}(p)){var U=Math.round(m+me)-E,K=Math.round(R+g)-O;Math.abs(U)!==1&&(m-=U),Math.abs(K)!==1&&(R-=K)}return ke(re.left,re.top,m,R)}(b):Ze}function ke(b,p,E,O){return{x:b,y:p,width:E,height:O}}var Bt=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=Zt(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}(),Nn=function(b,p){var E,O,q,re,me,g,m,R=(O=(E=p).x,q=E.y,re=E.width,me=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Pe(m,{x:O,y:q,width:re,height:me,top:q,right:O+re,bottom:me+q,left:O}),m);Pe(this,{target:b,contentRect:R})},et=function(){function b(p,E,O){if(this.activeObservations_=[],this.observations_=new we,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=O}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 _e(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new Bt(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 _e(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)&&(E.delete(p),E.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(E){E.isActive()&&p.activeObservations_.push(E)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(O){return new Nn(O.target,O.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),en=typeof WeakMap<"u"?new WeakMap:new we,tn=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 E=Yt.getInstance(),O=new et(p,E,this);en.set(this,O)};["observe","unobserve","disconnect"].forEach(function(b){tn.prototype[b]=function(){var p;return(p=en.get(this))[b].apply(p,arguments)}});const nn=qe.ResizeObserver!==void 0?qe.ResizeObserver:tn,Fe="Left",tt="Right",wt="Up",ot="Down",Et={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},It={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ke="mousemove",xn="mouseup";function rn(b,p){if(p===0)return b;const E=Math.PI/180*p;return[b[0]*Math.cos(E)+b[1]*Math.sin(E),b[1]*Math.cos(E)-b[0]*Math.sin(E)]}function wn(b){const{trackMouse:p}=b,E=v.useRef(Object.assign({},It)),O=v.useRef(Object.assign({},Et)),q=v.useRef(Object.assign({},O.current));let re;for(re in q.current=Object.assign({},O.current),O.current=Object.assign(Object.assign({},Et),b),Et)O.current[re]===void 0&&(O.current[re]=Et[re]);const[me,g]=v.useMemo(()=>function(m,R){const U=X=>{const Q="touches"in X;Q&&X.touches.length>1||m((J,ie)=>{ie.trackMouse&&!Q&&(document.addEventListener(Ke,K),document.addEventListener(xn,ue));const{clientX:fe,clientY:be}=Q?X.touches[0]:X,Le=rn([fe,be],ie.rotationAngle);return ie.onTouchStartOrOnMouseDown&&ie.onTouchStartOrOnMouseDown({event:X}),Object.assign(Object.assign(Object.assign({},J),It),{initial:Le.slice(),xy:Le,start:X.timeStamp||0})})},K=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:fe,clientY:be}=ie?X.touches[0]:X,[Le,lt]=rn([fe,be],J.rotationAngle),nt=Le-Q.xy[0],Ge=lt-Q.xy[1],Ce=Math.abs(nt),xe=Math.abs(Ge),Wt=(X.timeStamp||0)-Q.start,Bn=Math.sqrt(Ce*Ce+xe*xe)/(Wt||1),$n=[nt/(Wt||1),Ge/(Wt||1)],Lt=function(Un,On,Wn,ct){return Un>On?Wn>0?tt:Fe:ct>0?ot:wt}(Ce,xe,nt,Ge),un=typeof J.delta=="number"?J.delta:J.delta[Lt.toLowerCase()]||Et.delta;if(Ce<un&&xe<un&&!Q.swiping)return Q;const Tt={absX:Ce,absY:xe,deltaX:nt,deltaY:Ge,dir:Lt,event:X,first:Q.first,initial:Q.initial,velocity:Bn,vxvy:$n};Tt.first&&J.onSwipeStart&&J.onSwipeStart(Tt),J.onSwiping&&J.onSwiping(Tt);let kn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${Lt}`])&&(kn=!0),kn&&J.preventScrollOnSwipe&&J.trackTouch&&X.cancelable&&X.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Tt,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 fe=J[`onSwiped${ie.dir}`];fe&&fe(ie)}}else J.onTap&&J.onTap({event:X});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:X}),Object.assign(Object.assign(Object.assign({},Q),It),{eventData:ie})})},ue=X=>{document.removeEventListener(Ke,K),document.removeEventListener(xn,ue),z(X)},ce=(X,Q)=>{let J=()=>{};if(X&&X.addEventListener){const ie=Object.assign(Object.assign({},Et.touchEventOptions),Q.touchEventOptions),fe=[["touchstart",U,ie],["touchmove",K,Object.assign(Object.assign({},ie),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",z,ie]];fe.forEach(([be,Le,lt])=>X.addEventListener(be,Le,lt)),J=()=>fe.forEach(([be,Le])=>X.removeEventListener(be,Le))}return J},he={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 R.trackMouse&&(he.onMouseDown=U),[he,ce]}(m=>E.current=m(E.current,O.current),{trackMouse:p}),[p]);return E.current=function(m,R,U,K){return R.trackTouch&&m.el?m.cleanUpTouch?R.preventScrollOnSwipe!==U.preventScrollOnSwipe||R.touchEventOptions.passive!==U.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,R)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,R)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,O.current,q.current,g),me}var C=s(697);function St(b){return St=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},St(b)}function Rt(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function on(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Rt(Object(E),!0).forEach(function(O){d(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Rt(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function d(b,p,E){return(p=function(O){var q=function(re,me){if(St(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(St(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(O,"string");return St(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=l().memo(function(b){var p=on(on({},x),b),E=p.description,O=p.fullscreen,q=p.handleImageLoaded,re=p.isFullscreen,me=p.onImageError,g=p.original,m=p.originalAlt,R=p.originalHeight,U=p.originalWidth,K=p.originalTitle,z=p.sizes,ue=p.srcSet,ce=p.loading,he=re&&O||g;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:he,alt:m,srcSet:ue,height:R,width:U,sizes:z,title:K,onLoad:function(X){return q(X,g)},onError:me,loading:ce}),E&&l().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:C.string,fullscreen:C.string,handleImageLoaded:C.func.isRequired,isFullscreen:C.bool,onImageError:C.func.isRequired,original:C.string.isRequired,originalAlt:C.string,originalHeight:C.string,originalWidth:C.string,originalTitle:C.string,sizes:C.string,srcSet:C.string,loading:C.string};const P=w;function I(b){return I=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},I(b)}function _(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function W(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_(Object(E),!0).forEach(function(O){ne(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):_(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function ne(b,p,E){return(p=function(O){var q=function(re,me){if(I(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(I(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(O,"string");return I(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,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"}))},Be={strokeWidth:1,viewBox:"0 0 24 24"},Ne=function(b){var p=W(W({},Be),b),E=p.strokeWidth,O=p.viewBox,q=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:O,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},ae[q])};Ne.propTypes={strokeWidth:C.number,viewBox:C.string,icon:(0,C.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ee=Ne;var Te=l().memo(function(b){var p=b.isFullscreen,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},l().createElement(Ee,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Te.displayName="Fullscreen",Te.propTypes={isFullscreen:C.bool.isRequired,onClick:C.func.isRequired};const Xe=Te;var Ct=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},l().createElement(Ee,{icon:"left",viewBox:"6 0 12 24"}))});Ct.displayName="LeftNav",Ct.propTypes={disabled:C.bool.isRequired,onClick:C.func.isRequired};const An=Ct;var Pt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},l().createElement(Ee,{icon:"right",viewBox:"6 0 12 24"}))});Pt.displayName="RightNav",Pt.propTypes={disabled:C.bool.isRequired,onClick:C.func.isRequired};const st=Pt;var $t=l().memo(function(b){var p=b.isPlaying,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},l().createElement(Ee,{strokeWidth:2,icon:p?"pause":"play"}))});$t.displayName="PlayPause",$t.propTypes={isPlaying:C.bool.isRequired,onClick:C.func.isRequired};const Ut=$t;function ft(b){return ft=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},ft(b)}function at(){return at=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var O in E)Object.prototype.hasOwnProperty.call(E,O)&&(b[O]=E[O])}return b},at.apply(this,arguments)}function _t(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function En(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_t(Object(E),!0).forEach(function(O){Sn(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):_t(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function Sn(b,p,E){return(p=function(O){var q=function(re,me){if(ft(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(ft(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(O,"string");return ft(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var sr={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Dn=function(b){var p=En(En({},sr),b),E=p.children,O=p.className,q=wn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",at({},q,{className:O}),E)};Dn.propTypes={children:C.node.isRequired,className:C.string,delta:C.number,onSwiped:C.func,onSwiping:C.func};const Mn=Dn;function $e(b){return $e=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},$e(b)}function Tn(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(b);p&&(O=O.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,O)}return E}function sn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Tn(Object(E),!0).forEach(function(O){ln(b,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Tn(Object(E)).forEach(function(O){Object.defineProperty(b,O,Object.getOwnPropertyDescriptor(E,O))})}return b}function jn(b,p){for(var E=0;E<p.length;E++){var O=p[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(b,cn(O.key),O)}}function an(b,p){return an=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,O){return E.__proto__=O,E},an(b,p)}function Fn(b,p){if(p&&($e(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oe(b)}function Oe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function vt(b){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},vt(b)}function ln(b,p,E){return(p=cn(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}function cn(b){var p=function(E,O){if($e(E)!=="object"||E===null)return E;var q=E[Symbol.toPrimitive];if(q!==void 0){var re=q.call(E,O);if($e(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(b,"string");return $e(p)==="symbol"?p:String(p)}var ar=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],jl=(0,C.arrayOf)((0,C.shape)({srcSet:C.string,media:C.string}));function So(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Ar=function(b){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&an(g,m)})(me,b);var p,E,O,q,re=(O=me,q=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 g,m=vt(O);if(q){var R=vt(this).constructor;g=Reflect.construct(m,arguments,R)}else g=m.apply(this,arguments);return Fn(this,g)});function me(g){var m;return function(R,U){if(!(R instanceof U))throw new TypeError("Cannot call a class as a function")}(this,me),ln(Oe(m=re.call(this,g)),"onBulletClick",function(R,U){var K=m.props,z=K.onBulletClick,ue=K.items,ce=m.state.currentIndex;R.target.blur(),ce!==U&&(ue.length===2?m.slideToIndexWithStyleReset(U,R):m.slideToIndex(U,R)),z&&z(R,U)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.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(Oe(m)),m.handleKeyDown=m.handleKeyDown.bind(Oe(m)),m.handleMouseDown=m.handleMouseDown.bind(Oe(m)),m.handleResize=m.handleResize.bind(Oe(m)),m.handleTouchMove=m.handleTouchMove.bind(Oe(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Oe(m)),m.handleScreenChange=m.handleScreenChange.bind(Oe(m)),m.handleSwiping=m.handleSwiping.bind(Oe(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Oe(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Oe(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Oe(m)),m.handleImageError=m.handleImageError.bind(Oe(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Oe(m)),m.renderThumbInner=m.renderThumbInner.bind(Oe(m)),m.renderItem=m.renderItem.bind(Oe(m)),m.slideLeft=m.slideLeft.bind(Oe(m)),m.slideRight=m.slideRight.bind(Oe(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Oe(m)),m.togglePlay=m.togglePlay.bind(Oe(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=ye(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return p=me,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,R=g.useWindowKeyDown;m&&this.play(),R?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(g,m){var R=this.props,U=R.items,K=R.lazyLoad,z=R.slideDuration,ue=R.slideInterval,ce=R.startIndex,he=R.thumbnailPosition,X=R.showThumbnails,Q=R.useWindowKeyDown,J=this.state,ie=J.currentIndex,fe=J.isPlaying,be=g.items.length!==U.length,Le=!Ae()(g.items,U),lt=g.startIndex!==ce,nt=g.thumbnailPosition!==he,Ge=g.showThumbnails!==X;ue===g.slideInterval&&z===g.slideDuration||fe&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ge&&X&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ge&&!X&&this.removeThumbnailsResizeObserver(),(be||Ge)&&this.handleResize(),m.currentIndex!==ie&&this.slideThumbnailBar(),g.slideDuration!==z&&(this.slideToIndex=ye(this.unthrottledSlideToIndex,z,{trailing:!1})),!K||g.lazyLoad&&!Le||(this.lazyLoaded=[]),Q!==g.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))),(lt||Le)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=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),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,R=m.currentIndex,U=m.isTransitioning,K=this.props,z=K.onSlide,ue=K.slideDuration;this.transitionTimer=window.setTimeout(function(){U&&(g.setState({isTransitioning:!U,isSwipingThumbnail:!1}),z&&z(R))},ue+50)}},{key:"onThumbnailClick",value:function(g,m){var R=this.props,U=R.onThumbnailClick,K=R.items,z=this.state.currentIndex;g.target.parentNode.parentNode.blur(),z!==m&&(K.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),U&&U(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var R=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){R.slideToIndex(m),R.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,R=this.props,U=R.disableThumbnailScroll,K=R.items,z=this.state,ue=z.thumbnailsWrapperWidth,ce=z.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(U)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=ce)return 0;m=he.scrollHeight-ce}else{if(he.scrollWidth<=ue||ue<=0)return 0;m=he.scrollWidth-ue}return g*(m/(K.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,R=this.props,U=R.infinite,K=R.items,z="",ue="image-gallery-left",ce="image-gallery-right";switch(g){case m-1:z=" ".concat(ue);break;case m:z=" ".concat("image-gallery-center");break;case m+1:z=" ".concat(ce)}return K.length>=3&&U&&(g===0&&m===K.length-1?z=" ".concat(ce):g===K.length-1&&m===0&&(z=" ".concat(ue))),z}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,R=m.currentIndex,U=m.currentSlideOffset,K=m.previousIndex,z=R!==K,ue=g===0&&K===0,ce=g===1&&K===1,he=g===0&&R===1,X=g===1&&R===0,Q=U===0,J=-100*R+100*g+U;return U>0?this.direction="left":U<0&&(this.direction="right"),X&&U>0&&(J=-100+U),he&&U<0&&(J=100+U),z?ue&&Q&&this.direction==="left"?J=100:ce&&Q&&this.direction==="right"&&(J=-100):(X&&Q&&this.direction==="left"&&(J=-100),he&&Q&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,R=m.currentIndex,U=m.currentSlideOffset,K=m.slideStyle,z=this.props,ue=z.infinite,ce=z.items,he=z.useTranslate3D,X=z.isRTL,Q=-100*R,J=ce.length-1,ie=(Q+100*g)*(X?-1:1)+U;ue&&ce.length>2&&(R===0&&g===J?ie=-100*(X?-1:1)+U:R===J&&g===0&&(ie=100*(X?-1:1)+U)),ue&&ce.length===2&&(ie=this.getTranslateXForTwoSlide(g));var fe="translate(".concat(ie,"%, 0)");return he&&(fe="translate3d(".concat(ie,"%, 0, 0)")),sn({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:fe,MozTransform:fe,msTransform:fe,OTransform:fe,transform:fe},K)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,R=m.useTranslate3D,U=m.isRTL,K=this.state,z=K.thumbsTranslate,ue=K.thumbsStyle,ce=U?-1*z:z;return this.isThumbnailVertical()?(g="translate(0, ".concat(z,"px)"),R&&(g="translate3d(0, ".concat(z,"px, 0)"))):(g="translate(".concat(ce,"px, 0)"),R&&(g="translate3d(".concat(ce,"px, 0, 0)"))),sn({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},ue)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,R=this.props,U=R.items,K=R.slideOnThumbnailOver,z=R.onClick,ue=R.lazyLoad,ce=R.onTouchMove,he=R.onTouchEnd,X=R.onTouchStart,Q=R.onMouseOver,J=R.onMouseLeave,ie=R.renderItem,fe=R.renderThumbInner,be=R.showThumbnails,Le=R.showBullets,lt=[],nt=[],Ge=[];return U.forEach(function(Ce,xe){var Wt=g.getAlignmentClassName(xe),Bn=Ce.originalClass?" ".concat(Ce.originalClass):"",$n=Ce.thumbnailClass?" ".concat(Ce.thumbnailClass):"",Lt=Ce.renderItem||ie||g.renderItem,un=Ce.renderThumbInner||fe||g.renderThumbInner,Tt=!ue||Wt||g.lazyLoaded[xe];Tt&&ue&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var kn=g.getSlideStyle(xe),Un=l().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Wt," ").concat(Bn),style:kn,onClick:z,onKeyUp:g.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:he,onTouchStart:X,onMouseOver:Q,onFocus:Q,onMouseLeave:J,role:"button"},Tt?Lt(Ce):l().createElement("div",{style:{height:"100%"}}));if(lt.push(Un),be&&Ce.thumbnail){var On=f("image-gallery-thumbnail",$n,{active:m===xe});nt.push(l().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:On,onMouseLeave:K?g.onThumbnailMouseLeave:null,onMouseOver:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onFocus:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onKeyUp:function(ct){return g.handleThumbnailKeyUp(ct,xe)},onClick:function(ct){return g.onThumbnailClick(ct,xe)}},un(Ce)))}if(Le){var Wn=f("image-gallery-bullet",Ce.bulletClass,{active:m===xe});Ge.push(l().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Wn,onClick:function(ct){return g.onBulletClick(ct,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:lt,thumbnails:nt,bullets:Ge}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,R=m.previousIndex,U=m.currentIndex,K=g.length-1;return Math.abs(R-U)>1&&!(R===0&&U===K)&&!(R===K&&U===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,R=m.isTransitioning,U=m.previousIndex,K=m.currentIndex;return R&&!(g===U||g===K)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,R=g.isSwipingThumbnail,U=-this.getThumbsTranslate(m);R||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:U,thumbsSwipedTranslate:U}))}},{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(g){var m=g.event,R=g.absX,U=g.dir,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=this.state,he=ce.galleryWidth,X=ce.isTransitioning,Q=ce.swipingUpDown,J=ce.swipingLeftRight;if(U!==wt&&U!==ot&&!Q||J){if(U!==Fe&&U!==tt||J||this.setState({swipingLeftRight:!0}),!z){var ie=this.props.swipingTransitionDuration;if(ue&&m.preventDefault(),X)this.setState({currentSlideOffset:0});else{var fe=U===tt?1:-1,be=R/he*100;Math.abs(be)>=100&&(be=100);var Le={transition:"transform ".concat(ie,"ms ease-out")};this.setState({currentSlideOffset:fe*be,slideStyle:Le})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,R=g.absX,U=g.absY,K=g.dir,z=this.props,ue=z.stopPropagation,ce=z.swipingThumbnailTransitionDuration,he=this.state,X=he.thumbsSwipedTranslate,Q=he.thumbnailsWrapperHeight,J=he.thumbnailsWrapperWidth,ie=he.swipingUpDown,fe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((K===Fe||K===tt||fe)&&!ie)return void(fe||this.setState({swipingLeftRight:!0}));K!==wt&&K!==ot||ie||this.setState({swipingUpDown:!0})}else{if((K===wt||K===ot||ie)&&!fe)return void(ie||this.setState({swipingUpDown:!0}));K!==Fe&&K!==tt||fe||this.setState({swipingLeftRight:!0})}var be,Le,lt,nt,Ge,Ce=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=X+(K===ot?U:-U),Le=Ce.scrollHeight-Q+20,lt=Math.abs(be)>Le,nt=be>20,Ge=Ce.scrollHeight<=Q):(be=X+(K===tt?R:-R),Le=Ce.scrollWidth-J+20,lt=Math.abs(be)>Le,nt=be>20,Ge=Ce.scrollWidth<=J),!Ge&&(K!==Fe&&K!==wt||!lt)&&(K!==tt&&K!==ot||!nt)){ue&&m.stopPropagation();var xe={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,R=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),R&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,R=g.dir,U=g.velocity,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=K.flickThreshold;if(!z){var he=this.props.isRTL;ue&&m.stopPropagation(),this.resetSwipingDirection();var X=(R===Fe?1:-1)*(he?-1:1),Q=U>ce&&!(R===wt||R===ot);this.handleOnSwipedTo(X,Q)}}},{key:"handleOnSwipedTo",value:function(g,m){var R=this.state,U=R.currentIndex,K=R.isTransitioning,z=U;!this.sufficientSwipe()&&!m||K||(z+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(z=U),this.unthrottledSlideToIndex(z)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,R=m.disableKeyDown,U=m.useBrowserFullscreen,K=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!R)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:K&&!U&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.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 g=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(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new nn(ee(function(R){R&&R.forEach(function(U){m.setState({thumbnailsWrapperWidth:U.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new nn(ee(function(R){R&&R.forEach(function(U){m.setState({thumbnailsWrapperHeight:U.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.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 g=this.props,m=g.onScreenChange,R=g.useBrowserFullscreen,U=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,K=this.imageGallery.current===U;m&&m(K),R&&this.setState({isFullscreen:K})}},{key:"slideToIndex",value:function(g,m){var R=this.state,U=R.currentIndex,K=R.isTransitioning,z=this.props,ue=z.items,ce=z.slideDuration,he=z.onBeforeSlide;if(!K){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var X=ue.length-1,Q=g;g<0?Q=X:g>X&&(Q=0),he&&Q!==U&&he(Q),this.setState({previousIndex:U,currentIndex:Q,isTransitioning:Q!==U,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var R=this.state,U=R.currentIndex,K=R.isTransitioning,z=this.props.items,ue=U+(m==="left"?-1:1);K||(z.length===2?this.slideToIndexWithStyleReset(ue,g):this.slideToIndex(ue,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var R=this,U=this.state,K=U.currentIndex,z=U.currentSlideOffset;this.setState({currentSlideOffset:z+(K>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return R.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){So(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){So(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?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 g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(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 g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,R=m.onPlay,U=m.slideInterval,K=m.slideDuration,z=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(U,K)),R&&g&&R(z))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,R=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(R))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var R=this.props.onImageLoad;!this.loadedImages[m]&&R&&(this.loadedImages[m]=!0,R(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,R=this.props.onImageError||this.handleImageError;return l().createElement(P,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:R,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){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:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,R=g.isFullscreen,U=g.modalFullscreen,K=g.isPlaying,z=this.props,ue=z.additionalClass,ce=z.disableThumbnailSwipe,he=z.indexSeparator,X=z.isRTL,Q=z.items,J=z.thumbnailPosition,ie=z.renderFullscreenButton,fe=z.renderCustomControls,be=z.renderLeftNav,Le=z.renderRightNav,lt=z.showBullets,nt=z.showFullscreenButton,Ge=z.showIndex,Ce=z.showThumbnails,xe=z.showNav,Wt=z.showPlayButton,Bn=z.renderPlayPauseButton,$n=this.getThumbnailStyle(),Lt=this.getSlideItems(),un=Lt.slides,Tt=Lt.thumbnails,kn=Lt.bullets,Un=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":X}),On=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:Un},fe&&fe(),this.canSlide()?l().createElement(l().Fragment,null,xe&&l().createElement(l().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),Le(this.slideRight,!this.canSlideRight())),l().createElement(Mn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},un))):l().createElement("div",{className:"image-gallery-slides"},un),Wt&&Bn(this.togglePlay,K),lt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},kn)),nt&&ie(this.toggleFullScreen,R),Ge&&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"},he),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),Wn=f("image-gallery",ue,{"fullscreen-modal":U}),ct=f("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:R}),Ol=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:Wn,"aria-live":"polite"},l().createElement("div",{className:ct},(J==="bottom"||J==="right")&&On,Ce&&Tt.length>0?l().createElement(Mn,{className:Ol,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:$n,"aria-label":"Thumbnail Navigation"},Tt))):null,(J==="top"||J==="left")&&On))}}],E&&jn(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),me}(l().Component);Ar.propTypes={flickThreshold:C.number,items:(0,C.arrayOf)((0,C.shape)({bulletClass:C.string,bulletOnClick:C.func,description:C.string,original:C.string,originalHeight:C.number,originalWidth:C.number,loading:C.string,thumbnailHeight:C.number,thumbnailWidth:C.number,thumbnailLoading:C.string,fullscreen:C.string,originalAlt:C.string,originalTitle:C.string,thumbnail:C.string,thumbnailAlt:C.string,thumbnailLabel:C.string,thumbnailTitle:C.string,originalClass:C.string,thumbnailClass:C.string,renderItem:C.func,renderThumbInner:C.func,imageSet:jl,srcSet:C.string,sizes:C.string})).isRequired,showNav:C.bool,autoPlay:C.bool,lazyLoad:C.bool,infinite:C.bool,showIndex:C.bool,showBullets:C.bool,showThumbnails:C.bool,showPlayButton:C.bool,showFullscreenButton:C.bool,disableThumbnailScroll:C.bool,disableKeyDown:C.bool,disableSwipe:C.bool,disableThumbnailSwipe:C.bool,useBrowserFullscreen:C.bool,onErrorImageURL:C.string,indexSeparator:C.string,thumbnailPosition:(0,C.oneOf)(["top","bottom","left","right"]),startIndex:C.number,slideDuration:C.number,slideInterval:C.number,slideOnThumbnailOver:C.bool,swipeThreshold:C.number,swipingTransitionDuration:C.number,swipingThumbnailTransitionDuration:C.number,onSlide:C.func,onBeforeSlide:C.func,onScreenChange:C.func,onPause:C.func,onPlay:C.func,onClick:C.func,onImageLoad:C.func,onImageError:C.func,onTouchMove:C.func,onTouchEnd:C.func,onTouchStart:C.func,onMouseOver:C.func,onMouseLeave:C.func,onBulletClick:C.func,onThumbnailError:C.func,onThumbnailClick:C.func,renderCustomControls:C.func,renderLeftNav:C.func,renderRightNav:C.func,renderPlayPauseButton:C.func,renderFullscreenButton:C.func,renderItem:C.func,renderThumbInner:C.func,stopPropagation:C.bool,additionalClass:C.string,useTranslate3D:C.bool,isRTL:C.bool,useWindowKeyDown:C.bool},Ar.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(An,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(st,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Ut,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(Xe,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const kl=Ar})(),a})())})(ll);var rp=ll.exports;const ip=Ti(rp);function op(){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 v=new Map,l=new IntersectionObserver(function(u){u.forEach(function(S){var y=v.get(S.target);y==null||y(S)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:v},a.set(c,f)}return{observe:function(S,y){var T,j;(T=f)==null||T.entryCallbacks.set(S,y),(j=f)==null||j.observer.observe(S)},unobserve:function(S){var y,T;(y=f)==null||y.entryCallbacks.delete(S),(T=f)==null||T.observer.unobserve(S)}}}return{getObserver:t}}var sp="0px",ap=[0],lp=op();function cp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:sp,i=(n=e==null?void 0:e.threshold)!=null?n:ap,s=F.useRef(null),a=F.useRef(null),c=F.useRef(null),f=F.useState(),v=f[0],l=f[1],u=F.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var A=lp.getObserver({root:a.current,rootMargin:r,threshold:i});A.observe(j,function(L){l(L)}),c.current=A},[r,i]),S=F.useCallback(function(){var j=c.current,A=s.current;A&&(j==null||j.unobserve(A)),c.current=null},[]),y=F.useCallback(function(j){S(),s.current=j,u()},[u,S]),T=F.useCallback(function(j){S(),a.current=j,u()},[u,S]);return[y,{entry:v,rootRef:T}]}function vi(){return vi=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},vi.apply(this,arguments)}function up(e){var t,n=cp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=F.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,vi({},i,{isVisible:s,wasEverVisible:c})]}var dp=100;function hp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?dp:a,f=up({rootMargin:i}),v=f[0],l=f[1],u=l.rootRef,S=l.isVisible,y=!s&&!t&&S&&n;return F.useEffect(function(){if(y){var T=setTimeout(function(){r()},c);return function(){clearTimeout(T)}}},[r,y,c]),[v,{rootRef:u}]}const fp={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"/>'},pp={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 Gr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Vr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function cl(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 ul(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 mp(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 mo={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,"-":Gr?173:189,"=":Gr?61:187,";":Gr?59:186,"'":222,"[":219,"]":221,"\\":220},Kt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},yi={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ve={16:!1,18:!1,17:!1,91:!1},De={};for(var dr=1;dr<20;dr++)mo["f".concat(dr)]=111+dr;var Ie=[],ps=!1,dl="all",hl=[],Nr=function(t){return mo[t.toLowerCase()]||Kt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function fl(e){dl=e||"all"}function rr(){return dl||"all"}function gp(){return Ie.slice(0)}function vp(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 yp(e){return typeof e=="string"&&(e=Nr(e)),Ie.indexOf(e)!==-1}function bp(e,t){var n,r;e||(e=rr());for(var i in De)if(Object.prototype.hasOwnProperty.call(De,i))for(n=De[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;rr()===e&&fl(t||"all")}function xp(e){var t=e.keyCode||e.which||e.charCode,n=Ie.indexOf(t);if(n>=0&&Ie.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ie.splice(0,Ie.length),(t===93||t===224)&&(t=91),t in Ve){Ve[t]=!1;for(var r in Kt)Kt[r]===t&&(ht[r]=!1)}}function wp(e){if(typeof e>"u")Object.keys(De).forEach(function(a){return delete De[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Hr(a)});else if(typeof e=="object")e.key&&Hr(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=""),Hr({key:e,scope:i,method:s,splitKey:"+"})}}var Hr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=ul(n);c.forEach(function(f){var v=f.split(a),l=v.length,u=v[l-1],S=u==="*"?"*":Nr(u);if(De[S]){r||(r=rr());var y=l>1?cl(Kt,v):[];De[S]=De[S].filter(function(T){var j=i?T.method===i:!0;return!(j&&T.scope===r&&mp(T.mods,y))})}})};function ms(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 Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(!Ve[s]&&t.mods.indexOf(+s)>-1||Ve[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!Ve[16]&&!Ve[18]&&!Ve[17]&&!Ve[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 gs(e,t){var n=De["*"],r=e.keyCode||e.which||e.charCode;if(ht.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ie.indexOf(r)===-1&&r!==229&&Ie.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(T){var j=yi[T];e[T]&&Ie.indexOf(j)===-1?Ie.push(j):!e[T]&&Ie.indexOf(j)>-1?Ie.splice(Ie.indexOf(j),1):T==="metaKey"&&e[T]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(j))))}),r in Ve){Ve[r]=!0;for(var i in Kt)Kt[i]===r&&(ht[i]=!0);if(!n)return}for(var s in Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(Ve[s]=e[yi[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),Ve[17]=!0,Ve[18]=!0);var a=rr();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)&&ms(e,n[c],a,t);if(r in De){for(var f=0;f<De[r].length;f++)if((e.type==="keydown"&&De[r][f].keydown||e.type==="keyup"&&De[r][f].keyup)&&De[r][f].key){for(var v=De[r][f],l=v.splitKey,u=v.key.split(l),S=[],y=0;y<u.length;y++)S.push(Nr(u[y]));S.sort().join("")===Ie.sort().join("")&&ms(e,v,a,t)}}}}function Ep(e){return hl.indexOf(e)>-1}function ht(e,t,n){Ie=[];var r=ul(e),i=[],s="all",a=document,c=0,f=!1,v=!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&&(v=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=cl(Kt,e)),e=e[e.length-1],e=e==="*"?"*":Nr(e),e in De||(De[e]=[]),De[e].push({keyup:f,keydown:v,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Ep(a)&&window&&(hl.push(a),Vr(a,"keydown",function(S){gs(S,a)},u),ps||(ps=!0,Vr(window,"focus",function(){Ie=[]},u)),Vr(a,"keyup",function(S){gs(S,a),xp(S)},u))}function Sp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(De).forEach(function(n){var r=De[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Xr={setScope:fl,getScope:rr,deleteScope:bp,getPressedKeyCodes:gp,isPressed:yp,filter:vp,trigger:Sp,unbind:wp,keyMap:mo,modifier:Kt,modifierMap:yi};for(var Yr in Xr)Object.prototype.hasOwnProperty.call(Xr,Yr)&&(ht[Yr]=Xr[Yr]);if(typeof window<"u"){var Tp=window.hotkeys;ht.noConflict=function(e){return e&&window.hotkeys===ht&&(window.hotkeys=Tp),ht},window.hotkeys=ht}ht.filter=function(){return!0};var pl=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},jp=function(t){return pl(t,["INPUT","TEXTAREA","SELECT"])};function kp(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,v=i.filterPreventDefault,l=v===void 0?!0:v,u=i.enabled,S=u===void 0?!0:u,y=i.enableOnContentEditable,T=y===void 0?!1:y,j=F.useRef(null),A=F.useCallback(function(L,D){var B,G;return a&&!a(L)?!l:jp(L)&&!pl(L,s)||(B=L.target)!=null&&B.isContentEditable&&!T?!0:j.current===null||document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement)?(t(L,D),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return F.useEffect(function(){if(!S){ht.unbind(e,A);return}return c&&f!==!0&&(n.keydown=!1),ht(e,n||{},A),function(){return ht.unbind(e,A)}},[A,e,S]),j}ht.isPressed;const ml=F.createContext({open:!1,toggleOpen:e=>{}});function Op({children:e}){const[t,n]=F.useState(!1),r=s=>{n(s??!s)},i=F.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(ml.Provider,{value:i,children:e})}function go(){return F.useContext(ml)}const mt={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},Ip=e=>or(async()=>{const{data:t}=await e.get(mt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Rp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...yc(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(Dr(f,v=>v===""||v===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Dr(n,(v,l)=>c.includes(l)):{};r(Dr(f,v=>v===""||v===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 Cp=(e,t,n)=>e&&t||!n,gl=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],vl=(e,t,n)=>{var r,i;const s=bc(e),a=xc(s.search);if((r=wc(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Ec({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:v}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Ri(e,{...f||v?{imageFilter:"resize",w:f,h:v}:{},v:c})},Pp=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],_p=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Lp=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},Np=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Ap=()=>window.innerWidth<=600,Dp={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}"'}},Mp={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}” 的所有搜索结果"}},Qr={en:Io(Dp),zh:Io(Mp)},yl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Fp=e=>(t,n)=>{const r=Qr[e]?Qr[e][t]:Qr.en[t];return Np(r,n)||t},bl={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:()=>{}}},xl=F.createContext(bl),{Provider:Bp,Consumer:ug}=xl;function $p(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=ye=>ye,extraFilter:v=ye=>ye,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:S=!1,showCategory:y=!0,tagFilters:T=[],children:j,storeVersion:A,onSearchSelect:L=()=>{},endpoint:D,blockletRender:B,compact:G=!1}=e,k=yl(r,A),M=F.useMemo(()=>Us({baseURL:D,headers:k}),[D]),V=Rp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:L}),[$,le]=F.useState(""),{data:H=[],error:se,loading:je,run:We}=Ip(M),Me=F.useMemo(()=>{const ye=vc(H,[Ae=>Ae.name],["asc"]),oe=ye.findIndex(Ae=>Ae.name==="All"||Ae.locales.en==="All");return oe>-1?[{...ye[oe],_id:"All"},...ye.slice(0,oe),...ye.slice(oe+1)]:ye},[H]),Qe=F.useCallback(Fp(t),[t]),Z=F.useMemo(()=>_p(Me,t),[Me,t]),pe=Pp(Qe),ee={search:V,compact:G,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:je},extraFilter:v,endpoint:D,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Qe,storeVersion:A,serverVersion:r,selectedCategory:V.filters.category||(c.showExplore?"":"All"),categoryList:Me,blockletRender:B,locale:t,categoryOptions:Z,priceOptions:pe,storeApi:M,baseSearch:l,showResourcesSwitch:S,showCategory:y,tagFilters:T,onFilterChange:i,getCategoryLocale:ye=>{if(!ye)return null;const oe=H.find(Ae=>Ae._id===ye||Ae.locales.en==="All");return oe?oe.locales[t]||oe.locales.en:null},get developerName(){return $},updateDeveloperName:le};return F.useEffect(()=>{setTimeout(We,u||0)},[D,We,u]),o.jsx(Bp,{value:ee,children:j})}function it(){return F.useContext(xl)||bl}function wl({children:e,onClick:t,size:n=32,...r}){return o.jsx(ir,{...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 hr(e,t){return e===void 0?t:e}function vo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=Gt(),c=qt(a.breakpoints.down("sm")),f=qt(a.breakpoints.between("sm","md")),v=qt(a.breakpoints.between("md","lg")),l=qt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:v?n||null:l?r||null:i||null;let u=e;return c||(u=hr(t,u),f)||(u=hr(n,u),v)||(u=hr(r,u),l)?u:hr(i,u)}function Up({children:e}){const{open:t,toggleOpen:n}=go();return o.jsx(vo,{xs:o.jsx($l,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const Wp=F.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(ir,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(xt,{size:"1em"})}));function bi({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=F.useRef(null),c=Gt(),[f,v]=F.useState(!1),[l,u]=F.useState(e!==null?e:""),S=qt(c.breakpoints.down("sm"));F.useEffect(()=>{u(e!==null?e:"")},[e]);const y=F.useCallback(()=>{v(!1)},[]),T=F.useCallback(()=>{v(!0)},[]);function j(L){u(L.value),n(L.value),S&&y()}function A(L){return L===l}return o.jsxs(o.Fragment,{children:[o.jsxs(zp,{ref:a,onClick:T,variant:"outlined",size:"medium",className:["my-select__selector",Vn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(L=>L.value===l))==null?void 0:s.name)||r,o.jsx(Ul,{className:"my-select__arrowdown",component:uc,sx:{width:18,height:18}})]}),o.jsx(Wl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:L,placement:D})=>o.jsx(zl,{...L,style:{transformOrigin:D==="bottom"?"center top":"center bottom"},children:o.jsx(ql,{children:o.jsx(Kl,{onClickAway:y,children:o.jsx(qp,{autoFocusItem:f,onMouseEnter:T,onMouseLeave:y,children:t.map(B=>o.jsxs(Si,{onClick:()=>j(B),sx:{fontSize:14},children:[o.jsx(zs,{sx:{mr:1,fontSize:16,visibility:A(B.value)?"visible":"hidden"}}),B.name]},B.value))})})})})})]})}const zp=Vt(Wp)`
487
487
  border: 1px solid ${e=>e.theme.palette.divider};
488
488
  padding: 6px 8px 6px 12px;
489
489
  font-weight: ${e=>e.theme.typography.fontWeightRegular};
@@ -527,7 +527,7 @@ see detail in https://www.npmjs.com/package/is-var-name
527
527
  color: ${e=>e.theme.palette.primary.main};
528
528
  }
529
529
  }
530
- `;function El(){const{search:e,t}=it(),{filters:n,handleSort:r,handlePrice:i}=e,s=gl(t);return o.jsxs(rt,{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(wi,{control:o.jsx(Ei,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(bi,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function Kp({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v,handleActiveMenu:l,handleCategory:u,cleanFilter:S}=n,{toggleOpen:y}=go();F.useEffect(()=>{y(!1)},[Object.values(v).join("")]);const T=Cp(c,a.showSearch,v.keyword);return a.showCategory&&!f?o.jsxs(Up,{children:[o.jsx(vo,{xs:o.jsxs(rt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(wl,{onClick:()=>y(!1),children:o.jsx(Ii,{})}),o.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(rt,{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(nr,{icon:Zh,width:20,height:20}),o.jsx(ge,{variant:"body1",color:!t&&!v.menu?"text.primary":"grey.400",fontWeight:!t&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{y(!1),S()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx(nr,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ge,{variant:"body1",color:v.menu===j.key?"text.primary":"grey.400",fontWeight:v.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var A;y(!1),l(j.key),(A=j.onClick)==null||A.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(rt,{gap:2,children:i.map(j=>o.jsx(ge,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===j.value?S():u(j.value),y(!1)},children:j.name},j.value))})]}):o.jsx(El,{})})]}):null}function yo(){const{endpoint:e,serverVersion:t,storeVersion:n}=it(),r=yl(t,n),i=F.useMemo(()=>Us({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 Sl=F.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(xt,{})})});function vs({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Gp=16/9,Jr=292,xi=189,Er=336;function Vp(){var e,t;const{t:n,search:r}=it(),{get:i}=yo(),s=Gt(),a=qt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:v,loading:l}=or(async()=>{const _=await i(Ri(mt.blockletsPath,{didList:c.map(D=>D.did).join(",")}));return _!=null&&_.dataList?c.map(D=>_.dataList.find(B=>B.did===D.did)):[]});v&&console.error("Get Banner Blocklets error:",v);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!v&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:Jr},minHeight:Jr,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(zt,{variant:"rounded",height:xi,width:Er}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(zt,{variant:"text",height:50,width:100}),o.jsx(zt,{variant:"text",height:40,width:"100%"}),o.jsx(zt,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(zt,{variant:"circular",height:20,width:20}),o.jsx(zt,{variant:"text",height:20,width:50})]}),o.jsx(zt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(ip,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:_=>o.jsx(Y,{onClick:_,sx:{display:{xs:"none",md:"block"}},children:o.jsx(uu,{sx:{...u,left:5}})}),renderRightNav:_=>o.jsx(Y,{onClick:_,sx:{display:{xs:"none",md:"block"}},children:o.jsx(du,{sx:{...u,right:5}})}),items:c.map((_,D)=>({original:_.did,renderItem:()=>{var B;const G=f[D]||{},k=_.cover||Xp(_.did,(B=G.screenshots)==null?void 0:B[0]),M=vl(k,s.breakpoints.values.md*2);return o.jsxs(rt,{height:{xs:"auto",md:Jr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${M}")`,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(G),gap:{xs:2,md:5},children:[S(M),o.jsxs(rt,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[y(_.name||G.title||_.name),T(_.desc||G.description)]}),G.did&&j(G,_.baseNum),A(G)]})]})}}))})})]}):null;function S(_){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Er},children:o.jsx(Yp,{url:_})})}function y(_){return o.jsx(ge,{variant:"h2",width:"100%",children:_})}function T(_){return o.jsx(ge,{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:_})}function j(_,D=0){const{did:B,owner:G,stats:k}=_;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(vs,{icon:o.jsx(br,{src:G.avatar,did:B,size:20,variant:"circle"}),children:G.fullName}),o.jsx(vs,{icon:o.jsx(nr,{icon:qa}),title:`${k.downloads+D}`,children:Hp(k.downloads+D)})]})}function A(_){return o.jsx(ir,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(_),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Hp=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`,Xp=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Yp({url:e}){const[t,n]=F.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(zt,{variant:"rectangular",sx:{width:{xs:"100%",md:Er},height:{xs:"auto",md:xi}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Er},height:{xs:"auto",md:xi},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Gp},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Qp({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=it();return o.jsxs(Y,{mt:3,children:[o.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(To,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(To,{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 Jp(){const{get:e}=yo(),{t}=it(),{data:n=[],error:r,loading:i}=or(async()=>{const s=await e(mt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(jr,{error:new Error(`Failed to fetch blocklets from ${mt.explorePath}`)}):i?o.jsx(Sl,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(Vp,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(Qp,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const Zr="__FREE_TEXT__",ys="__NO_RESULT__",ei=40;function Zp({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=F.useRef(null),f=F.useRef(!1),[v,l]=F.useState(!1),[u,S]=F.useState(""),[y,T]=F.useState(!1),j=yo(),[A,_]=F.useState(!1),D=(a==null?void 0:a.placeholder)||t("common.searchStore"),B=async Z=>{_(!0);const pe=await j.get(Jn(e,Ri(mt.blockletsPath,Z)));return _(!1),pe.dataList||[]},{data:G,run:k}=or(Z=>Z?B({sortBy:mt.nameDesc,page:1,pageSize:10,keyword:Z,showResources:"true"}):Promise.resolve([]),{manual:!0});F.useEffect(()=>{_(!0),k(r.keyword),S(r.keyword||"")},[r.keyword,k]),kp("ctrl + k, command + k",Z=>{var pe,ee;return Z.stopPropagation(),Z.preventDefault(),(ee=(pe=c.current)==null?void 0:pe.querySelector("input"))==null||ee.focus(),!1},{enableOnTags:["INPUT"]});const M=Hs(Z=>k(Z),{wait:300}),V={name:Zr,title:u,did:""};let $=[];return u&&(A?$=[V]:G!=null&&G.length?$=[V,...G]:$=[{name:ys,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(Gl,{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(As,{fullWidth:!0,sx:{bgcolor:"grey.50",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:D,className:"bl-autocomplete-input",value:u,onChange:Z=>le(Z.target.value),startAdornment:Me(y),endAdornment:Qe()}),o.jsx(ir,{variant:"outlined",onClick:()=>{T(!1),S(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ns,{sx:{p:.5},children:$.map(Z=>je(Z))})]}),o.jsx(mr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.hint"},onClick:()=>T(!0)}),o.jsx(Os,{ref:c,open:!!u&&v,size:"small",onOpen:()=>l(!0),onClose:(Z,pe)=>{l(!1),pe==="selectOption"&&!f.current&&i(u)},onKeyDown:Z=>{Z.key==="Enter"&&!u&&H()},disableClearable:!0,inputValue:u,onInputChange:(Z,pe)=>le(pe),isOptionEqualToValue:(Z,pe)=>Z.name===pe.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(Sr,{...Z,InputProps:{...Z.InputProps,autoFocus:!0,placeholder:D,className:"bl-autocomplete-input",value:u,startAdornment:Me(v),endAdornment:Qe()}}),filterOptions:Z=>Z,...a,options:$,renderOption:(Z,pe)=>je(pe),value:V,sx:[{bgcolor:"grey.50",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){_(!0),S(Z),f.current=!1,M.run(Z)}function H(){T(!1),S(""),le(""),i("")}function se(Z){Z!=null&&Z.did?(T(!1),f.current=!0,S(""),s(Z)):Z.name===Zr&&(T(!1),i(u))}function je(Z){var pe,ee;return o.jsxs(Si,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(Z),children:[We(Z),o.jsxs(ge,{variant:"body1",children:[o.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Z.title}),o.jsx(ge,{sx:{color:"text.hint"},fontSize:"13px",children:((ee=(pe=Z.category)==null?void 0:pe.locales)==null?void 0:ee[n||"en"])||""})]})]},Z.did)}function We(Z){if([Zr,ys].includes(Z.name))return o.jsx(Y,{width:ei,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px",children:o.jsx(mr,{sx:{fontSize:28}})});let pe="";return Z.logo&&(pe=Jn(e,"assets",Z.did,vl(Z.logo,ei,Z.version))),o.jsx(br,{src:pe,size:ei,style:{borderRadius:"8px",overflow:"hidden"}})}function Me(Z=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:Z&&u&&A?o.jsx(xt,{color:"inherit",size:16}):o.jsx(mr,{sx:{fontSize:16,cursor:"default"}})})}function Qe(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:o.jsx(Ii,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>H()})}):null}}function em({placeholder:e,...t}){const{search:n,t:r}=it(),{filters:i,handleKeyword:s}=n,[a,c]=F.useState(i.keyword||""),f=Hs(s,{wait:300}),v=S=>{const{value:y}=S.target;c(y),f.run(y)},l=()=>{c(""),s("")};F.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(tm,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(ko,{position:"start",children:o.jsx(nm,{sx:{fontSize:18,ml:-.5}})}),onChange:v,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(ko,{position:"end",children:o.jsx(rm,{"data-cy":"search-delete",onClick:l})}),...t})}const tm=Vt(As)`
530
+ `;function El(){const{search:e,t}=it(),{filters:n,handleSort:r,handlePrice:i}=e,s=gl(t);return o.jsxs(rt,{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(wi,{control:o.jsx(Ei,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(bi,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function Kp({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v,handleActiveMenu:l,handleCategory:u,cleanFilter:S}=n,{toggleOpen:y}=go();F.useEffect(()=>{y(!1)},[Object.values(v).join("")]);const T=Cp(c,a.showSearch,v.keyword);return a.showCategory&&!f?o.jsxs(Up,{children:[o.jsx(vo,{xs:o.jsxs(rt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(wl,{onClick:()=>y(!1),children:o.jsx(Ii,{})}),o.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(rt,{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(nr,{icon:Zh,width:20,height:20}),o.jsx(ge,{variant:"body1",color:!t&&!v.menu?"text.primary":"grey.400",fontWeight:!t&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{y(!1),S()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx(nr,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ge,{variant:"body1",color:v.menu===j.key?"text.primary":"grey.400",fontWeight:v.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var A;y(!1),l(j.key),(A=j.onClick)==null||A.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(rt,{gap:2,children:i.map(j=>o.jsx(ge,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===j.value?S():u(j.value),y(!1)},children:j.name},j.value))})]}):o.jsx(El,{})})]}):null}function yo(){const{endpoint:e,serverVersion:t,storeVersion:n}=it(),r=yl(t,n),i=F.useMemo(()=>Us({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 Sl=F.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(xt,{})})});function vs({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Gp=16/9,Jr=292,xi=189,Er=336;function Vp(){var e,t;const{t:n,search:r}=it(),{get:i}=yo(),s=Gt(),a=qt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:v,loading:l}=or(async()=>{const L=await i(Ri(mt.blockletsPath,{didList:c.map(D=>D.did).join(",")}));return L!=null&&L.dataList?c.map(D=>L.dataList.find(B=>B.did===D.did)):[]});v&&console.error("Get Banner Blocklets error:",v);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!v&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:Jr},minHeight:Jr,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(zt,{variant:"rounded",height:xi,width:Er}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(zt,{variant:"text",height:50,width:100}),o.jsx(zt,{variant:"text",height:40,width:"100%"}),o.jsx(zt,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(zt,{variant:"circular",height:20,width:20}),o.jsx(zt,{variant:"text",height:20,width:50})]}),o.jsx(zt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(ip,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:L=>o.jsx(Y,{onClick:L,sx:{display:{xs:"none",md:"block"}},children:o.jsx(uu,{sx:{...u,left:5}})}),renderRightNav:L=>o.jsx(Y,{onClick:L,sx:{display:{xs:"none",md:"block"}},children:o.jsx(du,{sx:{...u,right:5}})}),items:c.map((L,D)=>({original:L.did,renderItem:()=>{var B;const G=f[D]||{},k=L.cover||Xp(L.did,(B=G.screenshots)==null?void 0:B[0]),M=vl(k,s.breakpoints.values.md*2);return o.jsxs(rt,{height:{xs:"auto",md:Jr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${M}")`,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(G),gap:{xs:2,md:5},children:[S(M),o.jsxs(rt,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[y(L.name||G.title||L.name),T(L.desc||G.description)]}),G.did&&j(G,L.baseNum),A(G)]})]})}}))})})]}):null;function S(L){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Er},children:o.jsx(Yp,{url:L})})}function y(L){return o.jsx(ge,{variant:"h2",width:"100%",children:L})}function T(L){return o.jsx(ge,{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:L})}function j(L,D=0){const{did:B,owner:G,stats:k}=L;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(vs,{icon:o.jsx(br,{src:G.avatar,did:B,size:20,variant:"circle"}),children:G.fullName}),o.jsx(vs,{icon:o.jsx(nr,{icon:qa}),title:`${k.downloads+D}`,children:Hp(k.downloads+D)})]})}function A(L){return o.jsx(ir,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(L),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Hp=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`,Xp=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Yp({url:e}){const[t,n]=F.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(zt,{variant:"rectangular",sx:{width:{xs:"100%",md:Er},height:{xs:"auto",md:xi}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Er},height:{xs:"auto",md:xi},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Gp},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Qp({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=it();return o.jsxs(Y,{mt:3,children:[o.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(To,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(To,{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 Jp(){const{get:e}=yo(),{t}=it(),{data:n=[],error:r,loading:i}=or(async()=>{const s=await e(mt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(jr,{error:new Error(`Failed to fetch blocklets from ${mt.explorePath}`)}):i?o.jsx(Sl,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(Vp,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(Qp,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const Zr="__FREE_TEXT__",ys="__NO_RESULT__",ei=40;function Zp({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=F.useRef(null),f=F.useRef(!1),[v,l]=F.useState(!1),[u,S]=F.useState(""),[y,T]=F.useState(!1),j=yo(),[A,L]=F.useState(!1),D=(a==null?void 0:a.placeholder)||t("common.searchStore"),B=async Z=>{L(!0);const pe=await j.get(Jn(e,Ri(mt.blockletsPath,Z)));return L(!1),pe.dataList||[]},{data:G,run:k}=or(Z=>Z?B({sortBy:mt.nameDesc,page:1,pageSize:10,keyword:Z,showResources:"true"}):Promise.resolve([]),{manual:!0});F.useEffect(()=>{L(!0),k(r.keyword),S(r.keyword||"")},[r.keyword,k]),kp("ctrl + k, command + k",Z=>{var pe,ee;return Z.stopPropagation(),Z.preventDefault(),(ee=(pe=c.current)==null?void 0:pe.querySelector("input"))==null||ee.focus(),!1},{enableOnTags:["INPUT"]});const M=Hs(Z=>k(Z),{wait:300}),V={name:Zr,title:u,did:""};let $=[];return u&&(A?$=[V]:G!=null&&G.length?$=[V,...G]:$=[{name:ys,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(Gl,{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(As,{fullWidth:!0,sx:{bgcolor:"grey.50",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:D,className:"bl-autocomplete-input",value:u,onChange:Z=>le(Z.target.value),startAdornment:Me(y),endAdornment:Qe()}),o.jsx(ir,{variant:"outlined",onClick:()=>{T(!1),S(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ns,{sx:{p:.5},children:$.map(Z=>je(Z))})]}),o.jsx(mr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.hint"},onClick:()=>T(!0)}),o.jsx(Os,{ref:c,open:!!u&&v,size:"small",onOpen:()=>l(!0),onClose:(Z,pe)=>{l(!1),pe==="selectOption"&&!f.current&&i(u)},onKeyDown:Z=>{Z.key==="Enter"&&!u&&H()},disableClearable:!0,inputValue:u,onInputChange:(Z,pe)=>le(pe),isOptionEqualToValue:(Z,pe)=>Z.name===pe.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(Sr,{...Z,InputProps:{...Z.InputProps,autoFocus:!0,placeholder:D,className:"bl-autocomplete-input",value:u,startAdornment:Me(v),endAdornment:Qe()}}),filterOptions:Z=>Z,...a,options:$,renderOption:(Z,pe)=>je(pe),value:V,sx:[{bgcolor:"grey.50",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){L(!0),S(Z),f.current=!1,M.run(Z)}function H(){T(!1),S(""),le(""),i("")}function se(Z){Z!=null&&Z.did?(T(!1),f.current=!0,S(""),s(Z)):Z.name===Zr&&(T(!1),i(u))}function je(Z){var pe,ee;return o.jsxs(Si,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(Z),children:[We(Z),o.jsxs(ge,{variant:"body1",children:[o.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Z.title}),o.jsx(ge,{sx:{color:"text.hint"},fontSize:"13px",children:((ee=(pe=Z.category)==null?void 0:pe.locales)==null?void 0:ee[n||"en"])||""})]})]},Z.did)}function We(Z){if([Zr,ys].includes(Z.name))return o.jsx(Y,{width:ei,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px",children:o.jsx(mr,{sx:{fontSize:28}})});let pe="";return Z.logo&&(pe=Jn(e,"assets",Z.did,vl(Z.logo,ei,Z.version))),o.jsx(br,{src:pe,size:ei,style:{borderRadius:"8px",overflow:"hidden"}})}function Me(Z=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:Z&&u&&A?o.jsx(xt,{color:"inherit",size:16}):o.jsx(mr,{sx:{fontSize:16,cursor:"default"}})})}function Qe(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:o.jsx(Ii,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>H()})}):null}}function em({placeholder:e,...t}){const{search:n,t:r}=it(),{filters:i,handleKeyword:s}=n,[a,c]=F.useState(i.keyword||""),f=Hs(s,{wait:300}),v=S=>{const{value:y}=S.target;c(y),f.run(y)},l=()=>{c(""),s("")};F.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(tm,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(ko,{position:"start",children:o.jsx(nm,{sx:{fontSize:18,ml:-.5}})}),onChange:v,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(ko,{position:"end",children:o.jsx(rm,{"data-cy":"search-delete",onClick:l})}),...t})}const tm=Vt(As)`
531
531
  background-color: ${e=>e.theme.palette.grey[50]};
532
532
  font-size: 14px;
533
533
  border-radius: 6px;
@@ -550,11 +550,11 @@ see detail in https://www.npmjs.com/package/is-var-name
550
550
  color: ${e=>e.theme.palette.grey[500]};
551
551
  font-size: 16px;
552
552
  cursor: pointer;
553
- `;function im(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:v,categoryOptions:l,compact:u}=it(),{filters:S,handleSort:y,handlePrice:T,handleDeveloper:j,handleSwitchShowResources:A,cleanFilter:_,handleCategory:D}=t,B=gl(n);return o.jsxs(rt,{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(ge,{variant:"h2",textTransform:"capitalize",children:s(S.category)}),o.jsxs(rt,{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:v?o.jsx(em,{}):o.jsx(Zp,{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,S.owner&&a&&o.jsx(jo,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),S.resourceDid&&S.resourceBlocklet&&o.jsx(jo,{label:n("blocklet.resourceTag",{name:S.resourceBlocklet}),size:"small",onDelete:()=>_(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(bs,{checked:S.showResources!=="false",onChange:G=>A(G?"true":"false"),label:n("common.showResources")}):null,o.jsx(bs,{checked:S.price==="free",onChange:G=>T(G?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(bi,{value:S.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:G=>D(G)})}),o.jsx(bi,{value:S.sortBy||B[0].value,options:B,placeholder:n("sort.sort"),onChange:G=>y(G)})]})]})}function bs({checked:e,onChange:t,label:n}){const r=Gt();return o.jsx(wi,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Ei,{checked:e,icon:o.jsx(nr,{style:{padding:0,color:r.palette.text.secondary},icon:fp}),checkedIcon:o.jsx(nr,{style:{padding:0,color:r.palette.primary.main},icon:pp}),size:"large",sx:{p:0,mr:1},onChange:i=>t(i.target.checked)}),label:n})}function fr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint",children:[o.jsx(oc,{}),e]})}function xs(){const{t:e}=it();return o.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function ti({filterTip:e,keywordTip:t}){const{t:n,locale:r}=it(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ge,{children:n("blocklet.keywordTip")})]})}function ni({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ge,{children:e}),o.jsx(ge,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ge,{children:[t," "]})]})}function om(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=it(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(fr,{children:[a?o.jsx(ni,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(xs,{}),o.jsx(ti,{filterTip:!0})]})}return o.jsx(fr,{children:o.jsx(xs,{})})}const sm=(e,t,n,r)=>Xc(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:mt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(mt.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,sc(t)],onError:r});function am(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=it(),{filters:a}=n,c=Hc({currentPage:mt.currentPage,pageSize:Ap()?mt.mobilePageSize:mt.pageSize,defaultCurrentPage:mt.defaultCurrentPage}),[f,v]=F.useState(null),l=sm(t,a,c,v),u=F.useMemo(()=>{var S,y;return r?r(((S=l.data)==null?void 0:S.list)||[]):((y=l.data)==null?void 0:y.list)||[]},[l.data,r]);return F.useEffect(()=>{const S=u.find(y=>y.owner.did===a.owner);s((S==null?void 0:S.owner.fullName)||(S==null?void 0:S.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 lm(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v}=t,{blocklets:l,errors:u,loadMore:S,loadings:y,hasNextPage:T,total:j}=am(),[A]=hp({loading:y.fetchBlockletsLoading||y.loadingMore,hasNextPage:T,onLoadMore:S});if(u.fetchBlockletsError){const G=new Error(`Failed to fetch blocklets from ${n}: ${_p(u.fetchBlockletsError)}`);return o.jsx(jr,{error:G})}const _=c&&a.showSearch||!v.keyword;return o.jsxs(o.Fragment,{children:[_?o.jsx(im,{}):o.jsxs(o.Fragment,{children:[o.jsx(vo,{xs:o.jsx(El,{}),md:null}),B()]}),D(),!y.fetchBlockletsLoading&&T&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:A,children:o.jsx(xt,{})})]});function D(){return y.fetchBlockletsLoading?o.jsx(Sl,{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(G=>o.jsx(Y,{"data-blocklet-did":G.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:G,blocklets:l,serverVersion:i})},G.did))}):o.jsx(om,{})}function B(){return o.jsxs(rt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ge,{variant:"h3",title:v.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:v.keyword})}),o.jsx(ge,{variant:"body1",color:"text.hint",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function cm(){const{t:e,selectedCategory:t,getCategoryLocale:n}=it(),{toggleOpen:r}=go();return o.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(wl,{onClick:()=>r(!0),children:o.jsx(cc,{})}),n(t)||e("common.category")]})}function um({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=it(),{filters:a}=r,c=F.useRef(null),f=a.category||a.keyword||a.price,v=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Op,{children:o.jsxs(Ws,{FallbackComponent:jr,children:[!s&&o.jsx(cm,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(Kp,{menus:e}),o.jsxs(rt,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[v&&(t==null?void 0:t(v)),!v&&(i.showExplore&&!f?o.jsx(Jp,{}):o.jsx(lm,{}))]})]})]})})}function dm(e){const{menus:t,children:n,...r}=e,i=Gt(),s=Ls(gc({},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(_s,{theme:s,children:o.jsx($p,{...r,children:o.jsx(um,{menus:t,children:n})})})}const hm={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"/>'},fm={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>'},pm={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>'},mm=pm,gm={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"/>'},vm=(e,t)=>!t||!e?!0:ii.satisfies(ii.coerce(e),t);function bo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=gt();return vm(t,n)?e:o.jsx(Ps,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ge,{children:o.jsx(ir,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}bo.propTypes={children:N.node.isRequired,serverVersion:N.string,requirementVersion:N.string};bo.defaultProps={serverVersion:"",requirementVersion:""};const ym=(e,t)=>Jn(t,`/blocklets/${e.did}`),ws=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,bm=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1;function xo({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var A,_;const{t:s}=gt();let a=Jn(r,Lc(e.did,e.logo||""));try{const D=new URL(a);D.searchParams.set("v",e.version||+new Date),a=D.href}catch{}const[c,f]=F.useState(!1),v=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(D){Oi.error(D.message)}finally{f(!1)}},{blocklet:l}=kr(),u=()=>((l==null?void 0:l.children)||[]).find(G=>G.meta.bundleDid===e.did).meta.version,y=(()=>{const D=((l==null?void 0:l.children)||[]).find(B=>B.meta.bundleDid===e.did);if(D){try{const B=D.meta.version,G=e.version;if(ii.gt(G,B))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),T=(A=e.requirements)==null?void 0:A.server,j=[];return y==="upgrade"?j.push({key:"upgrade",icon:o.jsx(pt,{icon:gm,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"?j.push({key:"disable",icon:o.jsx(pt,{icon:hm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):bm(e)&&j.push({key:"purchase",icon:o.jsx(pt,{icon:fm,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(xm,{title:ws({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:ws({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:v,icons:(_=e.docker)!=null&&_.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(pt,{icon:mm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(bo,{serverVersion:i,requirementVersion:T,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(Yh,{children:o.jsx(dt,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:D=>{D.preventDefault(),D.stopPropagation();const B=ym(e,r);B&&window.open(B,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}xo.propTypes={blocklet:N.object.isRequired,blocklets:N.array,handleButtonClick:N.func,endpoint:N.string,serverVersion:N.string};xo.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function wo({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:v,compact:l,...u}){const S=Gt(),{locale:y}=gt(),[T,j]=F.useState(!1),[A,_]=F.useState({}),D=k=>{_(k)},B=n,G=F.useMemo(()=>Ls(S,{palette:{background:{default:S.palette.background.paper}}}),[S]);return F.useEffect(()=>{_({showResources:!0,resourceType:a,resourceDid:c})},[B,a,c]),F.useEffect(()=>{j(!0),_({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(_s,{theme:G,children:o.jsx(Ws,{FallbackComponent:jr,resetKeys:[B],children:o.jsxs(Y,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[T&&o.jsx(dm,{showCategory:v,showResourcesSwitch:f,blockletRender:k=>{const M={...k,handleButtonClick:e,endpoint:B};return r({...k,defaultRender:o.jsx(xo,{...M})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:B,locale:y,onFilterChange:D,onSearchSelect:t,filters:A,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}wo.propTypes={storeUrl:N.string.isRequired,handleButtonClick:N.func,handleSearchSelect:N.func,handleBlockletRender:N.func,extraFilter:N.func,serverVersion:N.string,resourceType:N.string,resourceDid:N.string,showResourcesSwitch:N.bool,showCategory:N.bool,compact:N.bool};wo.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const xm=He(Jh)`
553
+ `;function im(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:v,categoryOptions:l,compact:u}=it(),{filters:S,handleSort:y,handlePrice:T,handleDeveloper:j,handleSwitchShowResources:A,cleanFilter:L,handleCategory:D}=t,B=gl(n);return o.jsxs(rt,{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(ge,{variant:"h2",textTransform:"capitalize",children:s(S.category)}),o.jsxs(rt,{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:v?o.jsx(em,{}):o.jsx(Zp,{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,S.owner&&a&&o.jsx(jo,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),S.resourceDid&&S.resourceBlocklet&&o.jsx(jo,{label:n("blocklet.resourceTag",{name:S.resourceBlocklet}),size:"small",onDelete:()=>L(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(bs,{checked:S.showResources!=="false",onChange:G=>A(G?"true":"false"),label:n("common.showResources")}):null,o.jsx(bs,{checked:S.price==="free",onChange:G=>T(G?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(bi,{value:S.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:G=>D(G)})}),o.jsx(bi,{value:S.sortBy||B[0].value,options:B,placeholder:n("sort.sort"),onChange:G=>y(G)})]})]})}function bs({checked:e,onChange:t,label:n}){const r=Gt();return o.jsx(wi,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Ei,{checked:e,icon:o.jsx(nr,{style:{padding:0,color:r.palette.text.secondary},icon:fp}),checkedIcon:o.jsx(nr,{style:{padding:0,color:r.palette.primary.main},icon:pp}),size:"large",sx:{p:0,mr:1},onChange:i=>t(i.target.checked)}),label:n})}function fr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint",children:[o.jsx(oc,{}),e]})}function xs(){const{t:e}=it();return o.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function ti({filterTip:e,keywordTip:t}){const{t:n,locale:r}=it(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ge,{children:n("blocklet.keywordTip")})]})}function ni({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ge,{children:e}),o.jsx(ge,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ge,{children:[t," "]})]})}function om(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=it(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(fr,{children:[a?o.jsx(ni,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(xs,{}),o.jsx(ti,{filterTip:!0})]})}return o.jsx(fr,{children:o.jsx(xs,{})})}const sm=(e,t,n,r)=>Xc(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:mt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(mt.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,sc(t)],onError:r});function am(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=it(),{filters:a}=n,c=Hc({currentPage:mt.currentPage,pageSize:Ap()?mt.mobilePageSize:mt.pageSize,defaultCurrentPage:mt.defaultCurrentPage}),[f,v]=F.useState(null),l=sm(t,a,c,v),u=F.useMemo(()=>{var S,y;return r?r(((S=l.data)==null?void 0:S.list)||[]):((y=l.data)==null?void 0:y.list)||[]},[l.data,r]);return F.useEffect(()=>{const S=u.find(y=>y.owner.did===a.owner);s((S==null?void 0:S.owner.fullName)||(S==null?void 0:S.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 lm(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v}=t,{blocklets:l,errors:u,loadMore:S,loadings:y,hasNextPage:T,total:j}=am(),[A]=hp({loading:y.fetchBlockletsLoading||y.loadingMore,hasNextPage:T,onLoadMore:S});if(u.fetchBlockletsError){const G=new Error(`Failed to fetch blocklets from ${n}: ${Lp(u.fetchBlockletsError)}`);return o.jsx(jr,{error:G})}const L=c&&a.showSearch||!v.keyword;return o.jsxs(o.Fragment,{children:[L?o.jsx(im,{}):o.jsxs(o.Fragment,{children:[o.jsx(vo,{xs:o.jsx(El,{}),md:null}),B()]}),D(),!y.fetchBlockletsLoading&&T&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:A,children:o.jsx(xt,{})})]});function D(){return y.fetchBlockletsLoading?o.jsx(Sl,{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(G=>o.jsx(Y,{"data-blocklet-did":G.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:G,blocklets:l,serverVersion:i})},G.did))}):o.jsx(om,{})}function B(){return o.jsxs(rt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ge,{variant:"h3",title:v.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:v.keyword})}),o.jsx(ge,{variant:"body1",color:"text.hint",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function cm(){const{t:e,selectedCategory:t,getCategoryLocale:n}=it(),{toggleOpen:r}=go();return o.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(wl,{onClick:()=>r(!0),children:o.jsx(cc,{})}),n(t)||e("common.category")]})}function um({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=it(),{filters:a}=r,c=F.useRef(null),f=a.category||a.keyword||a.price,v=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Op,{children:o.jsxs(Ws,{FallbackComponent:jr,children:[!s&&o.jsx(cm,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(Kp,{menus:e}),o.jsxs(rt,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[v&&(t==null?void 0:t(v)),!v&&(i.showExplore&&!f?o.jsx(Jp,{}):o.jsx(lm,{}))]})]})]})})}function dm(e){const{menus:t,children:n,...r}=e,i=Gt(),s=_s(gc({},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(Ls,{theme:s,children:o.jsx($p,{...r,children:o.jsx(um,{menus:t,children:n})})})}const hm={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"/>'},fm={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>'},pm={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>'},mm=pm,gm={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"/>'},vm=(e,t)=>!t||!e?!0:ii.satisfies(ii.coerce(e),t);function bo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=gt();return vm(t,n)?e:o.jsx(Ps,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ge,{children:o.jsx(ir,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}bo.propTypes={children:N.node.isRequired,serverVersion:N.string,requirementVersion:N.string};bo.defaultProps={serverVersion:"",requirementVersion:""};const ym=(e,t)=>Jn(t,`/blocklets/${e.did}`),ws=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,bm=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1;function xo({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var A,L;const{t:s}=gt();let a=Jn(r,_c(e.did,e.logo||""));try{const D=new URL(a);D.searchParams.set("v",e.version||+new Date),a=D.href}catch{}const[c,f]=F.useState(!1),v=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(D){Oi.error(D.message)}finally{f(!1)}},{blocklet:l}=kr(),u=()=>((l==null?void 0:l.children)||[]).find(G=>G.meta.bundleDid===e.did).meta.version,y=(()=>{const D=((l==null?void 0:l.children)||[]).find(B=>B.meta.bundleDid===e.did);if(D){try{const B=D.meta.version,G=e.version;if(ii.gt(G,B))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),T=(A=e.requirements)==null?void 0:A.server,j=[];return y==="upgrade"?j.push({key:"upgrade",icon:o.jsx(pt,{icon:gm,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"?j.push({key:"disable",icon:o.jsx(pt,{icon:hm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):bm(e)&&j.push({key:"purchase",icon:o.jsx(pt,{icon:fm,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(xm,{title:ws({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:ws({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:v,icons:(L=e.docker)!=null&&L.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(pt,{icon:mm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(bo,{serverVersion:i,requirementVersion:T,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(Yh,{children:o.jsx(dt,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:D=>{D.preventDefault(),D.stopPropagation();const B=ym(e,r);B&&window.open(B,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}xo.propTypes={blocklet:N.object.isRequired,blocklets:N.array,handleButtonClick:N.func,endpoint:N.string,serverVersion:N.string};xo.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function wo({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:v,compact:l,...u}){const S=Gt(),{locale:y}=gt(),[T,j]=F.useState(!1),[A,L]=F.useState({}),D=k=>{L(k)},B=n,G=F.useMemo(()=>_s(S,{palette:{background:{default:S.palette.background.paper}}}),[S]);return F.useEffect(()=>{L({showResources:!0,resourceType:a,resourceDid:c})},[B,a,c]),F.useEffect(()=>{j(!0),L({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(Ls,{theme:G,children:o.jsx(Ws,{FallbackComponent:jr,resetKeys:[B],children:o.jsxs(Y,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[T&&o.jsx(dm,{showCategory:v,showResourcesSwitch:f,blockletRender:k=>{const M={...k,handleButtonClick:e,endpoint:B};return r({...k,defaultRender:o.jsx(xo,{...M})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:B,locale:y,onFilterChange:D,onSearchSelect:t,filters:A,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}wo.propTypes={storeUrl:N.string.isRequired,handleButtonClick:N.func,handleSearchSelect:N.func,handleBlockletRender:N.func,extraFilter:N.func,serverVersion:N.string,resourceType:N.string,resourceDid:N.string,showResourcesSwitch:N.bool,showCategory:N.bool,compact:N.bool};wo.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const xm=He(Jh)`
554
554
  .ms-highlight {
555
555
  color: ${e=>e.theme.palette.primary.main};
556
556
  }
557
- `,Eo=F.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=Gt(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=dc(),{t:v,locale:l}=gt(),u=s[a];return F.useEffect(()=>{n(a)},[n,a]),F.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(Em,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:o.jsx(hc,{locale:l,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?_c({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:i,stepTip:v("blocklet.component.add"),children:o.jsx(wm,{children:typeof(u==null?void 0:u.body)=="function"?u.body():u==null?void 0:u.body})})})});Eo.propTypes={meta:N.any,onStepChange:N.func.isRequired,isMobile:N.bool.isRequired};Eo.defaultProps={meta:null};const Es=e=>e.isMobile?`
557
+ `,Eo=F.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=Gt(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=dc(),{t:v,locale:l}=gt(),u=s[a];return F.useEffect(()=>{n(a)},[n,a]),F.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(Em,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:o.jsx(hc,{locale:l,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?Lc({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:i,stepTip:v("blocklet.component.add"),children:o.jsx(wm,{children:typeof(u==null?void 0:u.body)=="function"?u.body():u==null?void 0:u.body})})})});Eo.propTypes={meta:N.any,onStepChange:N.func.isRequired,isMobile:N.bool.isRequired};Eo.defaultProps={meta:null};const Es=e=>e.isMobile?`
558
558
  height: calc(100vh - 56px - 64px - 48px);
559
559
  `:"",wm=He.div`
560
560
  width: 100%;
@@ -695,7 +695,7 @@ see detail in https://www.npmjs.com/package/is-var-name
695
695
  & .connect {
696
696
  background: white;
697
697
  }
698
- `,Sm=Eo,Tm=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1,jm=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},ri=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},km=e=>(e.environments||[]).some(t=>t.required),Ss=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Om=({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")},Ts=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Tl({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:v,showFromUrl:l,enableRunBackground:u,showCategory:S}){var rn,wn,C,St,Rt,on,d,x,w,P;const{t:y,locale:T}=gt(),[j,A]=F.useState(!1),[_,D]=F.useState(null),[B,G]=F.useState(""),[k,M]=F.useState(""),{api:V,ws:{useSubscription:$},inService:le,info:H}=Ln(),{blocklet:se,actions:{refreshBlocklet:je}}=kr(),[We,Me]=F.useState(null),[Qe,Z]=F.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ee,ye]=F.useState(pe),[oe,Ae]=F.useState(0),we=F.useRef({}),Je=F.useRef({}),qe=F.useRef({}),Ht=qt(I=>I.breakpoints.down("md")),Xt=Xl(),[Ft,Yt]=F.useState(!0),{meta:Pe}=we.current,Le=Zs(Pe),Ze=F.useRef(!1),de=I=>ye(L=>({...L,...I}));F.useEffect(()=>{if(ee.pathPrefix){const{errMsg:I}=nn({...ee,pathPrefix:ee.pathPrefix,locale:T});G(I)}},[ee.pathPrefix]),F.useEffect(()=>{oe===0&&ye(pe)},[oe]);const Qt=()=>{const I=ri(se)??"";de({didSpaceEndpoint:I})},Jt=()=>{var I;return(I=we==null?void 0:we.current)!=null&&I.meta?Dt.getDisplayName(we.current):""},Zt=()=>{A(!1),ye({}),Ze.current=!1,we.current={},e()},ke=I=>{const L=W=>{de({installResultProps:{variant:"error",title:Jt(),subTitle:I,footer:o.jsx(dt,{className:"bottom-button",disabled:W,"data-cy":"retry-install-component",onClick:async()=>{L(!0),await tn(we.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[W&&o.jsx(xt,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};L()},Bt=I=>L=>{var W,ne;(((W=L==null?void 0:L.meta)==null?void 0:W.did)||(L==null?void 0:L.meta))===((ne=se==null?void 0:se.meta)==null?void 0:ne.did)&&I(L)},Nn=()=>{Ts({timeout:0,componentDid:Xt.componentDid,manual:!0}),Zt(),setTimeout(()=>{const I=document.getElementsByClassName("dashboard-main")[0];I&&(I.scrollTop=I.scrollHeight)},200)};$(kt.BlockletEvents.componentInstalled,Bt(()=>{de({installResultProps:{variant:"success",title:Jt(),subTitle:y("blocklet.component.installSuccessTip")}}),Ts({componentDid:Xt.componentDid})}),[(rn=se==null?void 0:se.meta)==null?void 0:rn.did]),$(kt.BlockletEvents.statusChange,Bt(()=>{const I=ri(se);de(L=>({...L,didSpaceEndpoint:I}))}),[(wn=se==null?void 0:se.meta)==null?void 0:wn.did]),$(kt.BlockletEvents.downloadFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(C=se==null?void 0:se.meta)==null?void 0:C.did]),$(kt.BlockletEvents.installFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(St=se==null?void 0:se.meta)==null?void 0:St.did]);const et=[],en=I=>((se==null?void 0:se.children)||[]).find(L=>L.meta.did===I),tn=async I=>{var Ut,ft;Ze.current=!0;const{pathPrefix:L,bundleDid:W,title:ne,componentName:ae="",componentDid:Be=""}=ee,Ne=((Ut=we.current)==null?void 0:Ut.meta)||{},{configs:Ee=[],registryUrl:Te,inStore:Xe,inputUrl:Ct,dist:An}=Ne,Pt=(ft=we.current)==null?void 0:ft.downloadTokenList,st=Ct||(Xe?Lo(Te,W,An):"");A(!0);const $t={rootDid:se.meta.did,url:st,mountPoint:L?lr(L):`/${lr(Ne.title||Ne.name)}`,title:ne,name:ae,did:Be,dist:{tarball:"",integrity:""},onlyRequired:!Ft,...ee.hasEnvironmentsStep&&Ee.length>0?{configs:Ee.map(at=>({...at,value:ee.configsValue[at.key]||""}))}:{},...Pt?{downloadTokenList:Pt}:{},...I};try{if(await V.installComponent({input:$t}),Te){const{teamDid:at,storeList:Lt}=Gs({fromBlocklet:le,nodeInfo:H,blocklet:se}),{isNew:En,decoded:Sn}=Dc(Te,Lt);En&&await V.addBlockletStore({input:{teamDid:at,url:Sn}})}de({installResultProps:{}}),je({showError:!1,attachRuntimeInfo:!1})}catch(at){const Lt=Ys(at);Oi.error(Lt),console.error("installComponent error: ",at),ke(Lt)}finally{A(!1),we.current.installInput=$t}},nn=I=>{const L=ru({params:{...I,did:I.bundleDid},blocklets:[se],blocklet:se,locale:T});if(L){const W=en(I.bundleDid),ne=iu({params:{...I,did:I.bundleDid},blocklet:se});if(W&&W.mountPoint===ne)return{errMsg:""}}return{errMsg:L}},Fe=async I=>{var W,ne;const{errMsg:L}=nn({...ee,locale:T});G(L),oe===et.length-2&&!Ze.current&&await tn(I),(ne=(W=Je.current)==null?void 0:W.setActiveStepByIndex)==null||ne.call(W,ae=>ae+1)},tt=()=>{var I,L;(L=(I=Je.current)==null?void 0:I.setActiveStepByIndex)==null||L.call(I,W=>W-1)},wt=()=>{const{pathPrefix:I,bundleDid:L,title:W,componentName:ne="",componentDid:ae=""}=ee,{meta:Be={}}=we.current||{},{registryUrl:Ne,inStore:Ee,inputUrl:Te,dist:Xe}=Be,Ct=Ee?Lo(Ne,L,Xe):Te;Me({meta:Be,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:I,url:Ct,title:W,name:ne,did:ae}})},ot=I=>{Z(!1),de({purchaseResultProps:{variant:"error",title:Jt(),subTitle:I,style:{paddingTop:120},footer:o.jsx(dt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},Et=({downloadTokenList:I})=>{we.current.downloadTokenList=I,Z(!1),Fe()},It=({chooseParams:I=we.current,componentDid:L,isInit:W=!1})=>{var Sn,sr,Dn,Mn;const{meta:ne,registryUrl:ae,inStore:Be,inputUrl:Ne}=I,{did:Ee,title:Te,name:Xe}=ne,Ct=(((Sn=se.settings)==null?void 0:Sn.children)||[]).filter($e=>$e.status==="deleted"&&$e.meta.bundleDid===Ee),An=L||"",Pt=(sr=ne.environments)==null?void 0:sr.map($e=>{const{name:Tn,validation:sn,...jn}=$e,an={validation:Tc(sn)?"":sn};return{...jn,key:Tn,...an}});we.current={...I,meta:{...ne,configs:Pt,registryUrl:ae,inStore:Be,inputUrl:Ne}};let st={};if(W){const $e=[se],Tn=Pt||[],sn=[],jn=Ks(Sc([...Tn,...sn]),"key").filter(vt=>!!vt.key).sort((vt,ln)=>vt.required&&!ln.required?-1:ln.required&&!vt.required?1:0),an=Dt.getSharedConfigObj($e[0],{configs:jn}),Fn={},Oe=jn.map(vt=>{const{default:ln,key:cn,...ar}=vt;return Fn[cn]=an[cn]||ln,{...ar,key:cn,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[cn]}});st={...st,configsList:Oe,configsValue:Fn,hasMissRequiredConfigs:Ss(Oe,Fn)}}const $t=se.children.some($e=>$e.mountPoint==="/"),Ut=Ct.find($e=>$e.meta.bundleDid===Ee),ft=se.children.find($e=>$e.meta.bundleDid===Ee);st.title=Te||"",Ut?st={...st,pathPrefix:Ut.mountPoint||"",componentName:Ut.meta.name,hasEnvironmentsStep:!1}:ft?st={...st,pathPrefix:ft.mountPoint||"",componentName:ft.meta.name,hasEnvironmentsStep:!1}:st={...st,pathPrefix:$t?`/${lr(Te)||lr(Xe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(Dn=we.current.meta)==null?void 0:Dn.environments)==null?void 0:Mn.length)>0};const at=Tm(we.current.meta),Lt=jm(we.current.meta),En=ri(se);de({bundleDid:Ee,componentDid:An,...st,hasRequiredEnvironments:km(we.current.meta),requirePurchase:at,didSpaceIsRequiredSetup:Lt,didSpaceEndpoint:En}),W&&at&&wt()};F.useEffect(()=>{!c||oe!==0||!se||(It({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Fe())},[c,oe,se]),et.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:o.jsxs(dn,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ee.showFromUrlDialog&&o.jsx(to,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:I,inputUrl:L,inStore:W,registryUrl:ne})=>{It({chooseParams:{meta:I,inputUrl:L,inStore:W,registryUrl:ne},isInit:!0}),de({showFromUrlDialog:!1}),Fe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),o.jsx(so,{stores:n,extra:Ms.isInServerlessMode(H)?null:l?o.jsxs(dt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Js,{style:{fontSize:20,marginRight:4}}),y("blocklet.component.addComponentTip.fromUrl")]}):null,loading:j,onChange:()=>{ye({}),we.current={}},storageKey:s,children:({currentRegistry:I})=>o.jsx(wo,{showResourcesSwitch:v,showCategory:S,serverVersion:H==null?void 0:H.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:I.url,resourceType:r,resourceDid:i,handleButtonClick:L=>{It({chooseParams:{...L,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:L,defaultRender:W})=>{const ne=(ee==null?void 0:ee.bundleDid)&&(ee==null?void 0:ee.bundleDid)===(L==null?void 0:L.did);return o.jsxs(Rm,{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:W}),ne&&o.jsx(Y,{className:"check-container",children:o.jsx(zs,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:Om({params:ee,blocklet:se,t:y}),onCancel:Zt,onConfirm:()=>{Fe()}}),et.push({key:"agreement",name:y("launchBlocklet.introduction"),body:o.jsxs(dn,{component:"div",className:"agreement-wrapper",children:[o.jsx(qs,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),o.jsx(Mi,{meta:Pe,onClickNext:Fe,installRelated:Ft,onChangeInstallRelated:Yt,handleDescEle:o.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:y("common.pre"),disabled:!Le,confirm:y(Le?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Zt:tt,onConfirm:()=>{Z(!1),Fe()}}),Pe&&ee.requirePurchase&&et.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[y("common.verifyNFT"),o.jsx(Mr,{})]}),body:o.jsxs(dn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((on=(Rt=qe.current)==null?void 0:Rt.getCurrentStep)==null?void 0:on.call(Rt))===2||Qe)&&o.jsx(pr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Vn(ee.purchaseResultProps)?We&&o.jsx(qh,{ref:qe,meta:We.meta,mode:ee.componentDid?"verify":"both",onCancel:ot,installOpts:We.installOpts,handlePaySuccess:Et}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Co,{...ee.purchaseResultProps})})]}),disabled:((x=(d=qe.current)==null?void 0:d.getCurrentStep)==null?void 0:x.call(d))===2||Qe,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof qe.current.onNext=="function"&&(qe.current.onNext(),Z(!0))},onCancel:()=>{tt()}}),Dt.hasStartEngine(Pe)&&Nc.hasMountPoint(Pe)?et.push({key:"config",name:y("common.config"),error:B,body:o.jsxs(dn,{component:"div",children:[o.jsx(pr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),o.jsx(Sr,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:k||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ee.pathPrefix,onChange:I=>{const L=I.target.value;de({pathPrefix:L}),M(y("common.slugifyHint",{value:Ac(L)}))}}),!!B&&o.jsx(Cs,{severity:"error",style:{width:"100%",marginTop:8},children:B})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:()=>{Fe()}}):Pe&&(ee.pathPrefix=((P=(w=Pe.interfaces)==null?void 0:w[0])==null?void 0:P.path)||`/${Pe.did}`),Pe&&(ee!=null&&ee.hasEnvironmentsStep)&&et.push({key:"environment",name:o.jsxs(o.Fragment,{children:[y("common.environment")," ",ee.hasRequiredEnvironments&&o.jsx(Mr,{})]}),disabled:!!_||(ee==null?void 0:ee.hasMissRequiredConfigs),body:()=>o.jsxs(dn,{component:"div",style:{overflowY:"auto"},children:[o.jsx(pr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),o.jsx(Bc,{style:{marginTop:-12,width:"100%"},schema:ee.configsList,defaultValue:ee.configsValue,onChange:(I,{action:L,currentItem:W,allValues:ne})=>{L==="confirm"&&de({hasMissRequiredConfigs:Ss(ee.configsList,ne),configsValue:ne}),L==="edit"?D(W):["cancel","confirm"].includes(L)&&D(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),Pe&&(ee!=null&&ee.didSpaceIsRequiredSetup)&&et.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",ee.didSpaceIsRequiredSetup==="required"&&o.jsx(Mr,{})]}),disabled:(ee==null?void 0:ee.didSpaceIsRequiredSetup)&&!ee.didSpaceEndpoint,body:()=>o.jsx(Fc,{children:o.jsxs(dn,{component:"div",children:[o.jsx(pr,{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(oo,{blockletMeta:we.current.meta,onNext:()=>{Fe()},onEndpointUpdate:Qt})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),et.push({key:"install",name:en(Pe==null?void 0:Pe.did)?y("common.upgrade"):y("common.install"),disabled:u?!1:Vn(ee.installResultProps),loading:u?!1:Vn(ee.installResultProps),body:o.jsx(dn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Vn(ee.installResultProps)?o.jsx(ac,{message:o.jsx(Cm,{children:y(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Co,{...ee.installResultProps})})}),confirm:y("common.complete"),onConfirm:Nn});const Ke=et[oe]||{},xn=()=>j||Ke.error||!ee.bundleDid?!0:oe>1?!ee.pathPrefix:!1;return se?o.jsxs(Im,{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(fc,{steps:et,mode:"memory",children:o.jsx(Sm,{ref:Je,meta:Pe,isMobile:Ht,onStepChange:I=>{Ae(I)}})}),o.jsxs(Y,{className:"action-bar",children:[Ke.cancel&&o.jsx(dt,{onClick:I=>{I.stopPropagation(),Ke.onCancel()},disabled:oe===et.length-2&&j,color:"inherit",children:Ke.cancel||y("common.cancel")}),Ke.confirm&&o.jsx(dt,{onClick:I=>{I.stopPropagation(),Ke.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Ke.disabled=="boolean"?Ke.disabled:xn()),variant:"contained",autoFocus:!0,title:Ke.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ke.loading=="boolean"?Ke.loading:j)&&o.jsx(xt,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke.confirm})]})})]})]}):null}Tl.propTypes={onClose:N.func,mode:N.oneOf(["normal","embed"]),inDialog:N.bool,stores:N.arrayOf(N.string),storeUrl:N.string,resourceType:N.string,resourceDid:N.string,storageKey:N.string,selectedMeta:N.object,showResourcesSwitch:N.bool,showFromUrl:N.bool,enableRunBackground:N.bool,showCategory:N.bool};Tl.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Im=He(Y)`
698
+ `,Sm=Eo,Tm=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1,jm=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},ri=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},km=e=>(e.environments||[]).some(t=>t.required),Ss=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Om=({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")},Ts=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Tl({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:v,showFromUrl:l,enableRunBackground:u,showCategory:S}){var rn,wn,C,St,Rt,on,d,x,w,P;const{t:y,locale:T}=gt(),[j,A]=F.useState(!1),[L,D]=F.useState(null),[B,G]=F.useState(""),[k,M]=F.useState(""),{api:V,ws:{useSubscription:$},inService:le,info:H}=_n(),{blocklet:se,actions:{refreshBlocklet:je}}=kr(),[We,Me]=F.useState(null),[Qe,Z]=F.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ee,ye]=F.useState(pe),[oe,Ae]=F.useState(0),we=F.useRef({}),Je=F.useRef({}),qe=F.useRef({}),Ht=qt(I=>I.breakpoints.down("md")),Xt=Xl(),[Ft,Yt]=F.useState(!0),{meta:Pe}=we.current,_e=Zs(Pe),Ze=F.useRef(!1),de=I=>ye(_=>({..._,...I}));F.useEffect(()=>{if(ee.pathPrefix){const{errMsg:I}=nn({...ee,pathPrefix:ee.pathPrefix,locale:T});G(I)}},[ee.pathPrefix]),F.useEffect(()=>{oe===0&&ye(pe)},[oe]);const Qt=()=>{const I=ri(se)??"";de({didSpaceEndpoint:I})},Jt=()=>{var I;return(I=we==null?void 0:we.current)!=null&&I.meta?Dt.getDisplayName(we.current):""},Zt=()=>{A(!1),ye({}),Ze.current=!1,we.current={},e()},ke=I=>{const _=W=>{de({installResultProps:{variant:"error",title:Jt(),subTitle:I,footer:o.jsx(dt,{className:"bottom-button",disabled:W,"data-cy":"retry-install-component",onClick:async()=>{_(!0),await tn(we.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[W&&o.jsx(xt,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};_()},Bt=I=>_=>{var W,ne;(((W=_==null?void 0:_.meta)==null?void 0:W.did)||(_==null?void 0:_.meta))===((ne=se==null?void 0:se.meta)==null?void 0:ne.did)&&I(_)},Nn=()=>{Ts({timeout:0,componentDid:Xt.componentDid,manual:!0}),Zt(),setTimeout(()=>{const I=document.getElementsByClassName("dashboard-main")[0];I&&(I.scrollTop=I.scrollHeight)},200)};$(kt.BlockletEvents.componentInstalled,Bt(()=>{de({installResultProps:{variant:"success",title:Jt(),subTitle:y("blocklet.component.installSuccessTip")}}),Ts({componentDid:Xt.componentDid})}),[(rn=se==null?void 0:se.meta)==null?void 0:rn.did]),$(kt.BlockletEvents.statusChange,Bt(()=>{const I=ri(se);de(_=>({..._,didSpaceEndpoint:I}))}),[(wn=se==null?void 0:se.meta)==null?void 0:wn.did]),$(kt.BlockletEvents.downloadFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(C=se==null?void 0:se.meta)==null?void 0:C.did]),$(kt.BlockletEvents.installFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(St=se==null?void 0:se.meta)==null?void 0:St.did]);const et=[],en=I=>((se==null?void 0:se.children)||[]).find(_=>_.meta.did===I),tn=async I=>{var Ut,ft;Ze.current=!0;const{pathPrefix:_,bundleDid:W,title:ne,componentName:ae="",componentDid:Be=""}=ee,Ne=((Ut=we.current)==null?void 0:Ut.meta)||{},{configs:Ee=[],registryUrl:Te,inStore:Xe,inputUrl:Ct,dist:An}=Ne,Pt=(ft=we.current)==null?void 0:ft.downloadTokenList,st=Ct||(Xe?_o(Te,W,An):"");A(!0);const $t={rootDid:se.meta.did,url:st,mountPoint:_?lr(_):`/${lr(Ne.title||Ne.name)}`,title:ne,name:ae,did:Be,dist:{tarball:"",integrity:""},onlyRequired:!Ft,...ee.hasEnvironmentsStep&&Ee.length>0?{configs:Ee.map(at=>({...at,value:ee.configsValue[at.key]||""}))}:{},...Pt?{downloadTokenList:Pt}:{},...I};try{if(await V.installComponent({input:$t}),Te){const{teamDid:at,storeList:_t}=Gs({fromBlocklet:le,nodeInfo:H,blocklet:se}),{isNew:En,decoded:Sn}=Dc(Te,_t);En&&await V.addBlockletStore({input:{teamDid:at,url:Sn}})}de({installResultProps:{}}),je({showError:!1,attachRuntimeInfo:!1})}catch(at){const _t=Ys(at);Oi.error(_t),console.error("installComponent error: ",at),ke(_t)}finally{A(!1),we.current.installInput=$t}},nn=I=>{const _=ru({params:{...I,did:I.bundleDid},blocklets:[se],blocklet:se,locale:T});if(_){const W=en(I.bundleDid),ne=iu({params:{...I,did:I.bundleDid},blocklet:se});if(W&&W.mountPoint===ne)return{errMsg:""}}return{errMsg:_}},Fe=async I=>{var W,ne;const{errMsg:_}=nn({...ee,locale:T});G(_),oe===et.length-2&&!Ze.current&&await tn(I),(ne=(W=Je.current)==null?void 0:W.setActiveStepByIndex)==null||ne.call(W,ae=>ae+1)},tt=()=>{var I,_;(_=(I=Je.current)==null?void 0:I.setActiveStepByIndex)==null||_.call(I,W=>W-1)},wt=()=>{const{pathPrefix:I,bundleDid:_,title:W,componentName:ne="",componentDid:ae=""}=ee,{meta:Be={}}=we.current||{},{registryUrl:Ne,inStore:Ee,inputUrl:Te,dist:Xe}=Be,Ct=Ee?_o(Ne,_,Xe):Te;Me({meta:Be,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:I,url:Ct,title:W,name:ne,did:ae}})},ot=I=>{Z(!1),de({purchaseResultProps:{variant:"error",title:Jt(),subTitle:I,style:{paddingTop:120},footer:o.jsx(dt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},Et=({downloadTokenList:I})=>{we.current.downloadTokenList=I,Z(!1),Fe()},It=({chooseParams:I=we.current,componentDid:_,isInit:W=!1})=>{var Sn,sr,Dn,Mn;const{meta:ne,registryUrl:ae,inStore:Be,inputUrl:Ne}=I,{did:Ee,title:Te,name:Xe}=ne,Ct=(((Sn=se.settings)==null?void 0:Sn.children)||[]).filter($e=>$e.status==="deleted"&&$e.meta.bundleDid===Ee),An=_||"",Pt=(sr=ne.environments)==null?void 0:sr.map($e=>{const{name:Tn,validation:sn,...jn}=$e,an={validation:Tc(sn)?"":sn};return{...jn,key:Tn,...an}});we.current={...I,meta:{...ne,configs:Pt,registryUrl:ae,inStore:Be,inputUrl:Ne}};let st={};if(W){const $e=[se],Tn=Pt||[],sn=[],jn=Ks(Sc([...Tn,...sn]),"key").filter(vt=>!!vt.key).sort((vt,ln)=>vt.required&&!ln.required?-1:ln.required&&!vt.required?1:0),an=Dt.getSharedConfigObj($e[0],{configs:jn}),Fn={},Oe=jn.map(vt=>{const{default:ln,key:cn,...ar}=vt;return Fn[cn]=an[cn]||ln,{...ar,key:cn,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[cn]}});st={...st,configsList:Oe,configsValue:Fn,hasMissRequiredConfigs:Ss(Oe,Fn)}}const $t=se.children.some($e=>$e.mountPoint==="/"),Ut=Ct.find($e=>$e.meta.bundleDid===Ee),ft=se.children.find($e=>$e.meta.bundleDid===Ee);st.title=Te||"",Ut?st={...st,pathPrefix:Ut.mountPoint||"",componentName:Ut.meta.name,hasEnvironmentsStep:!1}:ft?st={...st,pathPrefix:ft.mountPoint||"",componentName:ft.meta.name,hasEnvironmentsStep:!1}:st={...st,pathPrefix:$t?`/${lr(Te)||lr(Xe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(Dn=we.current.meta)==null?void 0:Dn.environments)==null?void 0:Mn.length)>0};const at=Tm(we.current.meta),_t=jm(we.current.meta),En=ri(se);de({bundleDid:Ee,componentDid:An,...st,hasRequiredEnvironments:km(we.current.meta),requirePurchase:at,didSpaceIsRequiredSetup:_t,didSpaceEndpoint:En}),W&&at&&wt()};F.useEffect(()=>{!c||oe!==0||!se||(It({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Fe())},[c,oe,se]),et.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:o.jsxs(dn,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ee.showFromUrlDialog&&o.jsx(to,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:I,inputUrl:_,inStore:W,registryUrl:ne})=>{It({chooseParams:{meta:I,inputUrl:_,inStore:W,registryUrl:ne},isInit:!0}),de({showFromUrlDialog:!1}),Fe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),o.jsx(so,{stores:n,extra:Ms.isInServerlessMode(H)?null:l?o.jsxs(dt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Js,{style:{fontSize:20,marginRight:4}}),y("blocklet.component.addComponentTip.fromUrl")]}):null,loading:j,onChange:()=>{ye({}),we.current={}},storageKey:s,children:({currentRegistry:I})=>o.jsx(wo,{showResourcesSwitch:v,showCategory:S,serverVersion:H==null?void 0:H.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:I.url,resourceType:r,resourceDid:i,handleButtonClick:_=>{It({chooseParams:{..._,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:_,defaultRender:W})=>{const ne=(ee==null?void 0:ee.bundleDid)&&(ee==null?void 0:ee.bundleDid)===(_==null?void 0:_.did);return o.jsxs(Rm,{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:W}),ne&&o.jsx(Y,{className:"check-container",children:o.jsx(zs,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:Om({params:ee,blocklet:se,t:y}),onCancel:Zt,onConfirm:()=>{Fe()}}),et.push({key:"agreement",name:y("launchBlocklet.introduction"),body:o.jsxs(dn,{component:"div",className:"agreement-wrapper",children:[o.jsx(qs,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),o.jsx(Mi,{meta:Pe,onClickNext:Fe,installRelated:Ft,onChangeInstallRelated:Yt,handleDescEle:o.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:y("common.pre"),disabled:!_e,confirm:y(_e?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Zt:tt,onConfirm:()=>{Z(!1),Fe()}}),Pe&&ee.requirePurchase&&et.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[y("common.verifyNFT"),o.jsx(Mr,{})]}),body:o.jsxs(dn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((on=(Rt=qe.current)==null?void 0:Rt.getCurrentStep)==null?void 0:on.call(Rt))===2||Qe)&&o.jsx(pr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Vn(ee.purchaseResultProps)?We&&o.jsx(qh,{ref:qe,meta:We.meta,mode:ee.componentDid?"verify":"both",onCancel:ot,installOpts:We.installOpts,handlePaySuccess:Et}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Co,{...ee.purchaseResultProps})})]}),disabled:((x=(d=qe.current)==null?void 0:d.getCurrentStep)==null?void 0:x.call(d))===2||Qe,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof qe.current.onNext=="function"&&(qe.current.onNext(),Z(!0))},onCancel:()=>{tt()}}),Dt.hasStartEngine(Pe)&&Nc.hasMountPoint(Pe)?et.push({key:"config",name:y("common.config"),error:B,body:o.jsxs(dn,{component:"div",children:[o.jsx(pr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),o.jsx(Sr,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:k||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ee.pathPrefix,onChange:I=>{const _=I.target.value;de({pathPrefix:_}),M(y("common.slugifyHint",{value:Ac(_)}))}}),!!B&&o.jsx(Cs,{severity:"error",style:{width:"100%",marginTop:8},children:B})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:()=>{Fe()}}):Pe&&(ee.pathPrefix=((P=(w=Pe.interfaces)==null?void 0:w[0])==null?void 0:P.path)||`/${Pe.did}`),Pe&&(ee!=null&&ee.hasEnvironmentsStep)&&et.push({key:"environment",name:o.jsxs(o.Fragment,{children:[y("common.environment")," ",ee.hasRequiredEnvironments&&o.jsx(Mr,{})]}),disabled:!!L||(ee==null?void 0:ee.hasMissRequiredConfigs),body:()=>o.jsxs(dn,{component:"div",style:{overflowY:"auto"},children:[o.jsx(pr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),o.jsx(Bc,{style:{marginTop:-12,width:"100%"},schema:ee.configsList,defaultValue:ee.configsValue,onChange:(I,{action:_,currentItem:W,allValues:ne})=>{_==="confirm"&&de({hasMissRequiredConfigs:Ss(ee.configsList,ne),configsValue:ne}),_==="edit"?D(W):["cancel","confirm"].includes(_)&&D(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),Pe&&(ee!=null&&ee.didSpaceIsRequiredSetup)&&et.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",ee.didSpaceIsRequiredSetup==="required"&&o.jsx(Mr,{})]}),disabled:(ee==null?void 0:ee.didSpaceIsRequiredSetup)&&!ee.didSpaceEndpoint,body:()=>o.jsx(Fc,{children:o.jsxs(dn,{component:"div",children:[o.jsx(pr,{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(oo,{blockletMeta:we.current.meta,onNext:()=>{Fe()},onEndpointUpdate:Qt})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),et.push({key:"install",name:en(Pe==null?void 0:Pe.did)?y("common.upgrade"):y("common.install"),disabled:u?!1:Vn(ee.installResultProps),loading:u?!1:Vn(ee.installResultProps),body:o.jsx(dn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Vn(ee.installResultProps)?o.jsx(ac,{message:o.jsx(Cm,{children:y(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Co,{...ee.installResultProps})})}),confirm:y("common.complete"),onConfirm:Nn});const Ke=et[oe]||{},xn=()=>j||Ke.error||!ee.bundleDid?!0:oe>1?!ee.pathPrefix:!1;return se?o.jsxs(Im,{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(fc,{steps:et,mode:"memory",children:o.jsx(Sm,{ref:Je,meta:Pe,isMobile:Ht,onStepChange:I=>{Ae(I)}})}),o.jsxs(Y,{className:"action-bar",children:[Ke.cancel&&o.jsx(dt,{onClick:I=>{I.stopPropagation(),Ke.onCancel()},disabled:oe===et.length-2&&j,color:"inherit",children:Ke.cancel||y("common.cancel")}),Ke.confirm&&o.jsx(dt,{onClick:I=>{I.stopPropagation(),Ke.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Ke.disabled=="boolean"?Ke.disabled:xn()),variant:"contained",autoFocus:!0,title:Ke.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ke.loading=="boolean"?Ke.loading:j)&&o.jsx(xt,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke.confirm})]})})]})]}):null}Tl.propTypes={onClose:N.func,mode:N.oneOf(["normal","embed"]),inDialog:N.bool,stores:N.arrayOf(N.string),storeUrl:N.string,resourceType:N.string,resourceDid:N.string,storageKey:N.string,selectedMeta:N.object,showResourcesSwitch:N.bool,showFromUrl:N.bool,enableRunBackground:N.bool,showCategory:N.bool};Tl.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Im=He(Y)`
699
699
  .action-bar {
700
700
  display: flex;
701
701
  justify-content: flex-end;