@abtnode/blocklet-services 1.16.37 → 1.16.38-beta-20250110-003414-d3c1bfbd

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 (185) hide show
  1. package/api/index.js +24 -1
  2. package/api/libs/open-graph/index.js +9 -15
  3. package/api/libs/open-graph/template.js +15 -10
  4. package/api/middlewares/proxy-to-daemon.js +2 -23
  5. package/api/routes/blocklet.js +37 -1
  6. package/api/services/static.js +11 -1
  7. package/dist/assets/{Add-WwBlcqNF.js → Add-2VCvBnGd.js} +1 -1
  8. package/dist/assets/{ArrowDropDown-B6VSNrNX.js → ArrowDropDown-BdHlAt9a.js} +1 -1
  9. package/dist/assets/{CheckCircle-n23HoB1l.js → CheckCircle-BElcljFC.js} +1 -1
  10. package/dist/assets/{ChevronLeft-DV-sPxhr.js → ChevronLeft-BfF37o7u.js} +1 -1
  11. package/dist/assets/{ChevronRight-UF0hSKpL.js → ChevronRight-B8pf890W.js} +1 -1
  12. package/dist/assets/{DeleteOutline-1Utxk_IX.js → DeleteOutline-VzoIEqow.js} +1 -1
  13. package/dist/assets/{Done-BbnQSLvu.js → Done-BCESxXX2.js} +1 -1
  14. package/dist/assets/{Download-DRJvwpLt.js → Download-BJmwtO6i.js} +1 -1
  15. package/dist/assets/{EditIcon-DDucSncy.js → EditIcon-BF2eKBD0.js} +1 -1
  16. package/dist/assets/{Error-CL8m4Xu6.js → Error-CpAOVH8t.js} +1 -1
  17. package/dist/assets/{Google-CSKRQW0F.js → Google-rxW6OGq8.js} +1 -1
  18. package/dist/assets/{InfoOutlined-7hC78o3_.js → InfoOutlined-BFP30UJa.js} +1 -1
  19. package/dist/assets/{Launch-D9iyATKb.js → Launch-BOCFiYoz.js} +1 -1
  20. package/dist/assets/{LaunchOutlined-D37WOXmf.js → LaunchOutlined-B-PaS5ms.js} +1 -1
  21. package/dist/assets/{LockIcon-BIlUQ2kd.js → LockIcon-DQtUl5vk.js} +1 -1
  22. package/dist/assets/{Loop-Clmz6DRv.js → Loop-n5c7A0qE.js} +1 -1
  23. package/dist/assets/{MoreHoriz-CtnQ7uqf.js → MoreHoriz-DnFq43xg.js} +1 -1
  24. package/dist/assets/{PlayArrow-IJdeSlbo.js → PlayArrow-oA7gV2MA.js} +1 -1
  25. package/dist/assets/{QuestionMarkCircle-2fDrHopp.js → QuestionMarkCircle-gL_QM35Z.js} +1 -1
  26. package/dist/assets/{ServerLogo-DsurTeGQ.js → ServerLogo-UNPlRpuM.js} +1 -1
  27. package/dist/assets/{ViewList-B-HVv7GT.js → ViewList-IMqkd2Sv.js} +1 -1
  28. package/dist/assets/{_createAggregator-BgG70oKG.js → _createAggregator-B4i0o6gy.js} +1 -1
  29. package/dist/assets/{access-control-BP0rhxZ_.js → access-control-DcliPEX2.js} +1 -1
  30. package/dist/assets/{actions-DsY16tuf.js → actions-BEpPU26q.js} +1 -1
  31. package/dist/assets/add-component-core-DSlHbXth.js +716 -0
  32. package/dist/assets/{add-resource-DZFTdNIy.js → add-resource-B9SUcn9b.js} +1 -1
  33. package/dist/assets/{addon-DUnQ9eC0.js → addon-C8Ytd8YY.js} +1 -1
  34. package/dist/assets/{analytics-Cym7YiQM.js → analytics-BVmtToBr.js} +1 -1
  35. package/dist/assets/api-C0C4sDJA.js +1 -0
  36. package/dist/assets/ar-DuHAbPhE.js +3 -0
  37. package/dist/assets/{ar-BAnh0kq-.js → ar-hiIrGdss.js} +1 -1
  38. package/dist/assets/{audit-logs-DtJdynVz.js → audit-logs-DOpEhbRi.js} +1 -1
  39. package/dist/assets/{base32-DZ5GWnEl.js → base32-COJTblwx.js} +1 -1
  40. package/dist/assets/{branding-DEKXfpdd.js → branding-BIbnR-Yt.js} +2 -2
  41. package/dist/assets/{bundle-avatar-CtN88KlG.js → bundle-avatar-DqROxHMq.js} +1 -1
  42. package/dist/assets/button-Bo5ZAcJk.js +1 -0
  43. package/dist/assets/{click-to-copy-D-rDpTU1.js → click-to-copy-DNu8CktB.js} +1 -1
  44. package/dist/assets/{complete-DfhluUOU.js → complete-B_C_fwut.js} +1 -1
  45. package/dist/assets/{component-DET9TWBv.js → component-eAmweIYL.js} +1 -1
  46. package/dist/assets/{config-Dx3rVqe3.js → config-CWoxBu0J.js} +1 -1
  47. package/dist/assets/{config-Bh1NLHps.js → config-d41PVAVu.js} +1 -1
  48. package/dist/assets/{config-navigation-Cn0fwBBG.js → config-navigation-jKhcoDId.js} +3 -3
  49. package/dist/assets/{config-space-CT9a0s7Q.js → config-space-Dofzrh5m.js} +1 -1
  50. package/dist/assets/{confirm-DhCXP8vW.js → confirm-C0rryr4e.js} +1 -1
  51. package/dist/assets/{connect-GHQ2pLWc.js → connect-CfWNBUY4.js} +1 -1
  52. package/dist/assets/{connect-CA2-olTo.js → connect-Wiz0Gw9I.js} +1 -1
  53. package/dist/assets/{connect-to-kYFiSkqc.js → connect-to-Dsq1ST9l.js} +1 -1
  54. package/dist/assets/{content-layout-C8ThavEP.js → content-layout-CK_AzZZ-.js} +1 -1
  55. package/dist/assets/{dashboard-B3UhGh-u.js → dashboard-Ca8O6iHB.js} +3 -3
  56. package/dist/assets/de-CJi7wiel.js +3 -0
  57. package/dist/assets/{de-CYAy3iib.js → de-D_LJn5nm.js} +1 -1
  58. package/dist/assets/{did-address-B-umhomj.js → did-address-49U3oRW2.js} +1 -1
  59. package/dist/assets/{domain-DzFcoe7i.js → domain-DJyjDPmO.js} +1 -1
  60. package/dist/assets/{domain-list-C9eJrdcx.js → domain-list-BEjAE8hh.js} +1 -1
  61. package/dist/assets/{email-BEr-8TYu.js → email-C3ggDSGp.js} +1 -1
  62. package/dist/assets/{es-Bn01DRSJ.js → es-B0ocJhTd.js} +1 -1
  63. package/dist/assets/es-ClwhOFrW.js +3 -0
  64. package/dist/assets/{exchange-passport-DGUT_ZCy.js → exchange-passport-4QuzoW2F.js} +1 -1
  65. package/dist/assets/{form-text-input-E0Z0s35O.js → form-text-input-CT57jMfW.js} +1 -1
  66. package/dist/assets/fr-CAkkNKvy.js +3 -0
  67. package/dist/assets/{fr-D3J0B-tk.js → fr-eolYJCOV.js} +1 -1
  68. package/dist/assets/{fuel-alylOU0b.js → fuel-CJ-CsgDu.js} +1 -1
  69. package/dist/assets/{fullpage-DZPI7F_L.js → fullpage-CFp4hSHz.js} +1 -1
  70. package/dist/assets/{get-safe-url-ByH0hntp.js → get-safe-url-CVhAz4Qr.js} +1 -1
  71. package/dist/assets/{get-safe-url-yHkHYeNB.js → get-safe-url-RTzyOi09.js} +1 -1
  72. package/dist/assets/hi-CGrG89HI.js +1 -0
  73. package/dist/assets/{hi-DdEYPkL3.js → hi-DSwvTH0x.js} +1 -1
  74. package/dist/assets/{home-DG81Vlwd.js → home-D1QP6Ilh.js} +1 -1
  75. package/dist/assets/{id-C6kfQsmT.js → id-5G9oPRk4.js} +1 -1
  76. package/dist/assets/id-D6PyIa8m.js +3 -0
  77. package/dist/assets/{iframe-BB-pL0gd.js → iframe-BUonayoL.js} +1 -1
  78. package/dist/assets/{index-Cp3ZCh7o.js → index-BGO2DsWz.js} +1 -1
  79. package/dist/assets/{index-BRPzwIuP.js → index-BP6sEHV5.js} +1 -1
  80. package/dist/assets/index-BPF3oif7.js +228 -0
  81. package/dist/assets/{index-BaA1-UNL.js → index-BQCwe2Vs.js} +1 -1
  82. package/dist/assets/{index-CxWy6IEg.js → index-BQxL3qXG.js} +1 -1
  83. package/dist/assets/{index-B8B9jSby.js → index-BZnWmdZ0.js} +1 -1
  84. package/dist/assets/{index-7gknQYQQ.js → index-Bi1xb9O8.js} +1 -1
  85. package/dist/assets/{index-e4kRKwa5.js → index-Bxg1LKG8.js} +1 -1
  86. package/dist/assets/index-CQT4qLcx.js +1 -0
  87. package/dist/assets/{index-jViTGvBx.js → index-CqPx8QUY.js} +1 -1
  88. package/dist/assets/{index-CU_Y2Ics.js → index-CrvlY8Z5.js} +1 -1
  89. package/dist/assets/{index-CEyrfuix.js → index-D7mJIWyJ.js} +1 -1
  90. package/dist/assets/{index-DjDooCTg.js → index-DMelUylN.js} +4 -4
  91. package/dist/assets/{index-CcsFwEG1.js → index-DQSF6ElG.js} +1 -1
  92. package/dist/assets/{index-DNd_40WG.js → index-IdPbsC-k.js} +1 -1
  93. package/dist/assets/{index-SrY9WLdy.js → index-ROkOEO9F.js} +1 -1
  94. package/dist/assets/index-l4yaELph.js +144 -0
  95. package/dist/assets/{index-Dk8-Ibsd.js → index-mnKcDZP2.js} +1 -1
  96. package/dist/assets/{index-tDqjC_e2.js → index-wG4Kh8A_.js} +6 -6
  97. package/dist/assets/{invitation-BNOVM03D.js → invitation-Dn2JFqk3.js} +1 -1
  98. package/dist/assets/{invite-CDXZxcmB.js → invite-k-THgUaE.js} +1 -1
  99. package/dist/assets/{issue-passport-1v1d15DW.js → issue-passport-Cp0z7zOC.js} +1 -1
  100. package/dist/assets/item-DqTNLhw3.js +2 -0
  101. package/dist/assets/{ja-DN837plG.js → ja-B2h7onKc.js} +1 -1
  102. package/dist/assets/ja-C82Szos_.js +3 -0
  103. package/dist/assets/{ko-LU148n3o.js → ko-B8lz4XE7.js} +1 -1
  104. package/dist/assets/ko-zaXquvPm.js +3 -0
  105. package/dist/assets/{launch-result-message-BEuCq9h1.js → launch-result-message-zXOcVqEr.js} +1 -1
  106. package/dist/assets/{layout-PlCf3Rtw.js → layout-BRN0uPvp.js} +1 -1
  107. package/dist/assets/{list-header-DdT6PG1D.js → list-header-Bn1GhGok.js} +1 -1
  108. package/dist/assets/localization-L03Lvx4v.js +1 -0
  109. package/dist/assets/{log-B5iPDWZ_.js → log-D1ShKaDY.js} +1 -1
  110. package/dist/assets/{login-DvM79Mfd.js → login-D9awP98G.js} +1 -1
  111. package/dist/assets/{login-oauth-callback-CO19RzCL.js → login-oauth-callback-DHA7e6Ar.js} +1 -1
  112. package/dist/assets/{logo-uploader-CNnYMPxh.js → logo-uploader-BA8U554_.js} +3 -3
  113. package/dist/assets/{lost-passport-DsG6aS5u.js → lost-passport-kJqVsdV1.js} +1 -1
  114. package/dist/assets/{open-window-Km_9DMrz.js → open-window-B-5Hms7z.js} +1 -1
  115. package/dist/assets/{overview-Dc_26DuW.js → overview-4bff7RWe.js} +1 -1
  116. package/dist/assets/{page-header-B3m4UCOV.js → page-header-6EUz18Qu.js} +1 -1
  117. package/dist/assets/{permission-C7OYX2OJ.js → permission-SgzW7fBj.js} +1 -1
  118. package/dist/assets/{preferences-Ci4dS6YC.js → preferences-RkqN3i2t.js} +1 -1
  119. package/dist/assets/pt-CMq2TmiV.js +1 -0
  120. package/dist/assets/{pt-CSZkEO8C.js → pt-JWdcQImo.js} +1 -1
  121. package/dist/assets/publish-resource-BhQQlAPL.js +1 -0
  122. package/dist/assets/{react-beautiful-dnd.esm-D6d5Zfr8.js → react-beautiful-dnd.esm-C8vTtkBe.js} +1 -1
  123. package/dist/assets/{relative-time-BHAJs1ji.js → relative-time-BXb5Mt72.js} +1 -1
  124. package/dist/assets/ru-BwmmHWZS.js +1 -0
  125. package/dist/assets/{ru-CPz1NiGU.js → ru-CWgdu04g.js} +1 -1
  126. package/dist/assets/sdk-Dqc91xl4.js +1 -0
  127. package/dist/assets/{session-UImnJahL.js → session-ocxAyn6f.js} +1 -1
  128. package/dist/assets/{setup-LHpIYQbe.js → setup-DTQXAoXZ.js} +3 -3
  129. package/dist/assets/{shorten-label-CKNjZbhF.js → shorten-label-BnvWOC_s.js} +1 -1
  130. package/dist/assets/{simple-select-BMYrmYam.js → simple-select-BwufbE2b.js} +1 -1
  131. package/dist/assets/{slicedToArray-BPEJIbVV.js → slicedToArray-DNAGECrJ.js} +1 -1
  132. package/dist/assets/{start-DxAs4dHz.js → start-DNpygdxp.js} +1 -1
  133. package/dist/assets/{step-actions-FdD-71wr.js → step-actions-ClTz1KhK.js} +1 -1
  134. package/dist/assets/{studio-g2uaz9WG.js → studio-DPoV-6q9.js} +1 -1
  135. package/dist/assets/{switch-control-BMO1MVhi.js → switch-control-D-IROOaC.js} +1 -1
  136. package/dist/assets/{th-DN9Th20c.js → th-BnfuNX_7.js} +1 -1
  137. package/dist/assets/{th-CKxPcxWD.js → th-C-hKn9xa.js} +1 -1
  138. package/dist/assets/{toUpper-DUImrX4s.js → toUpper-BQrWudMF.js} +1 -1
  139. package/dist/assets/{transfer-Bq5kjW_S.js → transfer-A_yTwCWw.js} +1 -1
  140. package/dist/assets/{unsubscribe-DUmfJRPR.js → unsubscribe-uaBnibKD.js} +1 -1
  141. package/dist/assets/{use-mobile-DOkke39c.js → use-mobile-DAR0hmJd.js} +1 -1
  142. package/dist/assets/{useAsync-BfmmMB4I.js → useAsync-cdOzMWPw.js} +1 -1
  143. package/dist/assets/{useAsyncRetry-m5oMMmVh.js → useAsyncRetry-KXMle3o0.js} +1 -1
  144. package/dist/assets/{useLocalStorage-ganqTrK6.js → useLocalStorage-CSyjxtUy.js} +1 -1
  145. package/dist/assets/{user-center-CYnDNkIf.js → user-center-B3stHKHJ.js} +1 -1
  146. package/dist/assets/{util-CmcVraD_.js → util-ao8gSgii.js} +1 -1
  147. package/dist/assets/{vendor-arcblock-Dn16DH88.js → vendor-arcblock-CiLB_TiI.js} +8 -8
  148. package/dist/assets/{vendor-hooks-DzETutIU.js → vendor-hooks-CLzfFpO7.js} +1 -1
  149. package/dist/assets/{vendor-mui-core-COxJgW9_.js → vendor-mui-core-BlX2BJoA.js} +31 -31
  150. package/dist/assets/{vendor-mui-x-Be0GxtOJ.js → vendor-mui-x-Bq1FyQ7S.js} +1 -1
  151. package/dist/assets/{vendor-utils-CV7RLr7b.js → vendor-utils-DCpRgzMR.js} +4 -4
  152. package/dist/assets/{vi-DsheN6LQ.js → vi-C_iM9J2X.js} +1 -1
  153. package/dist/assets/{vi-ChReTICx.js → vi-D7HQHu1T.js} +1 -1
  154. package/dist/assets/wrap-locale-DNve09jN.js +1 -0
  155. package/dist/assets/{zh-BJMvTFip.js → zh-DNY792IC.js} +1 -1
  156. package/dist/assets/zh-tw-9sY6BN2s.js +3 -0
  157. package/dist/assets/{zh-tw-DkLkQUwb.js → zh-tw-jFbTVB_K.js} +1 -1
  158. package/dist/index.html +6 -6
  159. package/dist/manifest.webmanifest +1 -0
  160. package/dist/registerSW.js +1 -0
  161. package/dist/service-worker.js +1 -1
  162. package/dist/share/shared-service-worker.js +55 -26
  163. package/package.json +32 -31
  164. package/dist/assets/add-component-core-C8hvHJq0.js +0 -716
  165. package/dist/assets/api-C7qcY4XU.js +0 -1
  166. package/dist/assets/ar-DJ10cGfc.js +0 -3
  167. package/dist/assets/button-CPeDg26t.js +0 -1
  168. package/dist/assets/de-5ORoKwiw.js +0 -3
  169. package/dist/assets/es-CWClvbjs.js +0 -3
  170. package/dist/assets/fr-CE8mlhdK.js +0 -3
  171. package/dist/assets/hi-DVuJdQme.js +0 -1
  172. package/dist/assets/id-L6JUyxUh.js +0 -3
  173. package/dist/assets/index-B-0OFwWF.js +0 -144
  174. package/dist/assets/index-CYh2QqLk.js +0 -1
  175. package/dist/assets/index-DHmJ4NAw.js +0 -221
  176. package/dist/assets/item-DoetJFaA.js +0 -1
  177. package/dist/assets/ja-C5orBePq.js +0 -3
  178. package/dist/assets/ko-BeIurXFC.js +0 -3
  179. package/dist/assets/localization-Cm0dNj2B.js +0 -1
  180. package/dist/assets/pt-BED0VqHV.js +0 -1
  181. package/dist/assets/publish-resource-BumbS1yx.js +0 -1
  182. package/dist/assets/ru-B5wj2v7e.js +0 -1
  183. package/dist/assets/sdk-0UwYHc-i.js +0 -1
  184. package/dist/assets/wrap-locale-DTO386nY.js +0 -1
  185. package/dist/assets/zh-tw-B_su4eMW.js +0 -3
@@ -1,716 +0,0 @@
1
- import{a1 as on,j as w,E as W,a2 as pt,aa as Ye,a3 as ue,T as Ee,t as Ft,aN as Gn,bJ as Hn,I as Ms,bK as Fs,bL as Bs,z as Us,aJ as Ta,bq as qs,bM as Ca,M as an,bt as Ia,bu as $a,bv as Aa,aS as Pa,ad as zs,L as La,bp as Na,aw as Da,al as Xn,e as Wr,x as Vr,R as Ws,V as Vs,ar as Ks,bH as Gs,ac as wt,aF as Ma,as as Kt,bN as Gi,A as Hi,Z as Fa,P as Ba,G as Ua,v as qa,$ as za,D as Wa,K as Xi,a4 as Va,aQ as Ka}from"./vendor-mui-core-COxJgW9_.js";import{r as K,g as ln,u as Ga,k as Ha,a as Hs,e as Ie,b as Xa,l as Ya}from"./vendor-react-D-afvo_7.js";import{S as Za,s as Xs,A as Ja}from"./item-DoetJFaA.js";import{ad as cn,ag as ct,al as Yn,b0 as lt,U as Ys,b1 as Yi,d as Zs,g as mt,b2 as Ut,F as Qa,D as el,E as un,b3 as tl,s as rl,ao as nl,ab as Js,b4 as Zi,b5 as il,z as Zn,C as sl,b6 as Qs,b7 as ar,ai as ol,Q as Jn,b8 as al,b9 as ll,f as Ji,ba as eo,bb as tn,bc as Qn,aD as to,a6 as dn,bd as xn,be as cl,v as Mr,bf as ro,aM as ul,bg as dl,bh as Fn,bi as hl,ak as fl,bj as pl,aj as ml,$ as gl,bk as yl}from"./vendor-arcblock-Dn16DH88.js";import{f as Bt,y as Kr,Y as vl,Z as bl,h as Ct,C as xl,$ as wl,a0 as _l,a1 as Sl,B as hn,a2 as no,U as El,W as jl,a3 as kl,a4 as Rl,a5 as Yr,a6 as Qi,a7 as Ol}from"./index-tDqjC_e2.js";import{L as es}from"./launch-result-message-BEuCq9h1.js";import{P as io}from"./page-header-B3m4UCOV.js";import{u as Tl,C as Cl}from"./config-space-CT9a0s7Q.js";import{R as wn}from"./logo-uploader-CNnYMPxh.js";import{S as Il}from"./index-DNd_40WG.js";import{s as so,h as $l,w as Al,f as Pl,a as Ll,b as Nl,c as Dl,M as Ml}from"./index-7gknQYQQ.js";import{B as Gr,o as Fl,k as Bl,q as oo,K as Ul}from"./vendor-hooks-DzETutIU.js";import{g as ql}from"./get-safe-url-ByH0hntp.js";import{p as zl,B as Wl,a as ts,j as Ur,w as ei,q as Vl,s as Kl,t as Gl,u as Hl}from"./vendor-utils-CV7RLr7b.js";import{p as Xl}from"./index-Cp3ZCh7o.js";import{I as rs}from"./index-Dk8-Ibsd.js";import{u as Yl}from"./session-UImnJahL.js";import{W as Zl}from"./did-address-B-umhomj.js";import{_ as ao}from"./useLocalStorage-ganqTrK6.js";import{f as lo}from"./format-error-C0Ke3VXF.js";import{a as ns}from"./api-C7qcY4XU.js";import{d as Jl,v as Ql,e as ec}from"./util-CmcVraD_.js";import{u as co}from"./use-mobile-DOkke39c.js";import{C as tc}from"./content-layout-C8ThavEP.js";import{C as rc,D as nc,a as ic}from"./connect-to-kYFiSkqc.js";import{d as sc}from"./ArrowDropDown-B6VSNrNX.js";import{d as oc}from"./ChevronLeft-DV-sPxhr.js";import{d as ac}from"./ChevronRight-UF0hSKpL.js";const sp="blocklet-add-component-registry",op="server-add-registry",ap=e=>`resource-${e}-add-registry`;var ti={},lc=on;Object.defineProperty(ti,"__esModule",{value:!0});var uo=ti.default=void 0,cc=lc(cn()),uc=w;uo=ti.default=(0,cc.default)((0,uc.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 ri({disabled:e,children:r,onConfirm:d}){return K.useEffect(()=>{if(e)return()=>{};const m=_=>{_.code==="Enter"&&(_.metaKey===!0||_.ctrlKey===!0)&&(_.preventDefault(),_.stopPropagation(),d())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e,d]),r}ri.propTypes={disabled:W.bool,children:W.any.isRequired,onConfirm:W.func.isRequired};ri.defaultProps={disabled:!1};function ni({onContinue:e,nextDisabled:r,launching:d,texts:m,description:_}){const[x,g]=K.useState(!1),o=()=>g(v=>!v);return w.jsxs(w.Fragment,{children:[w.jsx(dc,{children:w.jsxs(ri,{disabled:r,onConfirm:e,children:[w.jsx("div",{className:"eula-trigger",onClick:o,children:m.listenName}),w.jsx(ct,{disabled:r,color:"primary",variant:"contained",className:"next-button",onClick:e,children:d?w.jsxs(w.Fragment,{children:[w.jsx(pt,{size:14}),m.launchingText]}):m.buttonNext})]})}),w.jsx(Yn,{open:x,title:m.listenName,onClose:()=>g(!1),children:_})]})}ni.propTypes={onContinue:W.func.isRequired,nextDisabled:W.bool,launching:W.bool,description:W.any,texts:W.object};ni.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const dc=Ye.div`
2
- margin: 0 auto;
3
- display: flex;
4
- justify-content: space-between;
5
- align-items: center;
6
-
7
- @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
8
- flex-direction: column;
9
- }
10
-
11
- .eula-trigger {
12
- cursor: pointer;
13
- text-decoration: underline;
14
- ${e=>e.theme.breakpoints.up("md")} {
15
- padding-right: 24px;
16
- }
17
- ${e=>e.theme.breakpoints.down("md")} {
18
- padding: 16px;
19
- }
20
- font-size: 14px;
21
- white-space: nowrap;
22
- &:hover {
23
- color: ${e=>e.theme.palette.primary.main};
24
- }
25
- }
26
-
27
- .next-button {
28
- min-width: 200px;
29
- }
30
- `;var ii={exports:{}},is=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hc=/\n/g,fc=/^\s*/,pc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mc=/^:\s*/,gc=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yc=/^[;\s]*/,vc=/^\s+|\s+$/g,bc=`
31
- `,ss="/",os="*",tr="",xc="comment",wc="declaration",_c=function(e,r){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];r=r||{};var d=1,m=1;function _(n){var i=n.match(hc);i&&(d+=i.length);var h=n.lastIndexOf(bc);m=~h?n.length-h:m+n.length}function x(){var n={line:d,column:m};return function(i){return i.position=new g(n),y(),i}}function g(n){this.start=n,this.end={line:d,column:m},this.source=r.source}g.prototype.content=e;function o(n){var i=new Error(r.source+":"+d+":"+m+": "+n);if(i.reason=n,i.filename=r.source,i.line=d,i.column=m,i.source=e,!r.silent)throw i}function v(n){var i=n.exec(e);if(i){var h=i[0];return _(h),e=e.slice(h.length),i}}function y(){v(fc)}function c(n){var i;for(n=n||[];i=t();)i!==!1&&n.push(i);return n}function t(){var n=x();if(!(ss!=e.charAt(0)||os!=e.charAt(1))){for(var i=2;tr!=e.charAt(i)&&(os!=e.charAt(i)||ss!=e.charAt(i+1));)++i;if(i+=2,tr===e.charAt(i-1))return o("End of comment missing");var h=e.slice(2,i-2);return m+=2,_(h),e=e.slice(i),m+=2,n({type:xc,comment:h})}}function a(){var n=x(),i=v(pc);if(i){if(t(),!v(mc))return o("property missing ':'");var h=v(gc),l=n({type:wc,property:as(i[0].replace(is,tr)),value:h?as(h[0].replace(is,tr)):tr});return v(yc),l}}function s(){var n=[];c(n);for(var i;i=a();)i!==!1&&(n.push(i),c(n));return n}return y(),s()};function as(e){return e?e.replace(vc,tr):tr}var Sc=_c;function ho(e,r){var d=null;if(!e||typeof e!="string")return d;for(var m,_=Sc(e),x=typeof r=="function",g,o,v=0,y=_.length;v<y;v++)m=_[v],g=m.property,o=m.value,x?r(g,o,m):o&&(d||(d={}),d[g]=o);return d}ii.exports=ho;ii.exports.default=ho;var Ec=ii.exports;const jc=ln(Ec),kc={}.hasOwnProperty;function Rc(e,r,d){if(typeof e!="function")throw new TypeError("h is not a function");const m=Tc(e),_=$c(e),x=Ic(e);let g,o;if(typeof d=="string"||typeof d=="boolean"?(g=d,d={}):(d||(d={}),g=d.prefix),r&&r.type==="root"){const v=r.children[0];o=r.children.length===1&&v.type==="element"?v:{type:"element",tagName:"div",properties:{},children:r.children}}else if(r&&r.type==="element")o=r;else throw new Error("Expected root or element, not `"+(r&&r.type||r)+"`");return fo(e,o,{schema:d.space==="svg"?so:$l,prefix:g==null?m||_||x?"h-":void 0:typeof g=="string"?g:g?"h-":void 0,key:0,react:m,vue:_,vdom:x,hyperscript:Cc(e)})}function fo(e,r,d){const m=d.schema;let _=m,x=r.tagName;const g={},o=[];let v=-1,y;m.space==="html"&&x.toLowerCase()==="svg"&&(_=so,d.schema=_);for(y in r.properties)r.properties&&kc.call(r.properties,y)&&Oc(g,y,r.properties[y],d,x);if(d.vdom&&(_.space==="html"?x=x.toUpperCase():_.space&&(g.namespace=Al[_.space])),d.prefix&&(d.key++,g.key=d.prefix+d.key),r.children)for(;++v<r.children.length;){const c=r.children[v];c.type==="element"?o.push(fo(e,c,d)):c.type==="text"&&o.push(c.value)}return d.schema=m,o.length>0?e.call(r,x,g,o):e.call(r,x,g)}function Oc(e,r,d,m,_){const x=Pl(m.schema,r);let g;d==null||typeof d=="number"&&Number.isNaN(d)||d===!1&&(m.vue||m.vdom||m.hyperscript)||!d&&x.boolean&&(m.vue||m.vdom||m.hyperscript)||(Array.isArray(d)&&(d=x.commaSeparated?Ll(d):Nl(d)),x.boolean&&m.hyperscript&&(d=""),x.property==="style"&&typeof d=="string"&&(m.react||m.vue||m.vdom)&&(d=Ac(d,_)),m.vue?x.property!=="style"&&(g="attrs"):x.mustUseProperty||(m.vdom?x.property!=="style"&&(g="attributes"):m.hyperscript&&(g="attrs")),g?e[g]=Object.assign(e[g]||{},{[x.attribute]:d}):x.space&&m.react?e[Dl[x.property]||x.property]=d:e[x.attribute]=d)}function Tc(e){const r=e("div",{});return!!(r&&("_owner"in r||"_store"in r)&&(r.key===void 0||r.key===null))}function Cc(e){return"context"in e&&"cleanup"in e}function Ic(e){return e("div",{}).type==="VirtualNode"}function $c(e){const r=e("div",{});return!!(r&&r.context&&r.context._isVue)}function Ac(e,r){const d={};try{jc(e,(m,_)=>{m.slice(0,4)==="-ms-"&&(m="ms-"+m.slice(4)),d[m.replace(/-([a-z])/g,(x,g)=>g.toUpperCase())]=_})}catch(m){const _=m;throw _.message=r+"[style]"+_.message.slice(9),_}return d}var Pc=po;function po(e){if(typeof e=="string")return Mc(e);if(e==null)return Fc;if(typeof e=="object")return("length"in e?Dc:Nc)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Lc(e){for(var r=[],d=e.length,m=-1;++m<d;)r[m]=po(e[m]);return r}function Nc(e){return r;function r(d){var m;for(m in e)if(d[m]!==e[m])return!1;return!0}}function Dc(e){var r=Lc(e),d=r.length;return m;function m(){for(var _=-1;++_<d;)if(r[_].apply(this,arguments))return!0;return!1}}function Mc(e){return r;function r(d){return!!(d&&d.type===e)}}function Fc(){return!0}var Bc=fn,Uc=Pc,mo=!0,go="skip",rn=!1;fn.CONTINUE=mo;fn.SKIP=go;fn.EXIT=rn;function fn(e,r,d,m){var _;typeof r=="function"&&typeof d!="function"&&(m=d,d=r,r=null),_=Uc(r),x(e,null,[]);function x(o,v,y){var c=[],t;return(!r||_(o,v,y[y.length-1]||null))&&(c=ls(d(o,y)),c[0]===rn)?c:o.children&&c[0]!==go?(t=ls(g(o.children,y.concat(o))),t[0]===rn?t:c):c}function g(o,v){for(var y=-1,c=m?-1:1,t=(m?o.length:y)+c,a;t>y&&t<o.length;){if(a=x(o[t],t,v),a[0]===rn)return a;t=typeof a[1]=="number"?a[1]:t+c}}}function ls(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[mo,e]:[e]}var qc=mn,pn=Bc,zc=pn.CONTINUE,Wc=pn.SKIP,Vc=pn.EXIT;mn.CONTINUE=zc;mn.SKIP=Wc;mn.EXIT=Vc;function mn(e,r,d,m){typeof r=="function"&&typeof d!="function"&&(m=d,d=r,r=null),pn(e,r,_,m);function _(x,g){var o=g[g.length-1],v=o?o.children.indexOf(x):null;return d(x,v,o)}}var Kc=qc,Gc=Object.prototype.hasOwnProperty,_n={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Hc=function(r){return Kc(r,"element",Xc),r};function Xc(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var r,d;for(r in _n)!Gc.call(_n,r)||e.properties[r]===void 0||(d=_n[r],Yc(e,d,e.properties[r]),delete e.properties[r])}}function Yc(e,r,d){var m=(e.properties.style||"").trim();m&&!/;\s*/.test(m)&&(m+=";"),m&&(m+=" ");var _=m+r+": "+d+";";e.properties.style=_}const Zc=ln(Hc);function Jc(e){const r=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof r=="string"&&r.replace(/[ \t\n\f\r]/g,"")===""}const Qc={}.hasOwnProperty,eu=new Set(["table","thead","tbody","tfoot","tr"]);function tu(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const r=e.createElement,d=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:m});function m(x){let g=Rc(_,d?Zc(x):x,e.prefix);return x.type==="root"?(g=g&&typeof g=="object"&&"type"in g&&"props"in g&&g.type==="div"&&(x.children.length!==1||x.children[0].type!=="element")?g.props.children:[g],r(e.Fragment||"div",{},g)):g}function _(x,g,o){if(o&&eu.has(x)&&(o=o.filter(v=>!Jc(v))),e.components&&Qc.call(e.components,x)){const v=e.components[x];return e.passNode&&typeof v=="function"&&(g=Object.assign({node:this},g)),r(v,g,o)}return r(x,g,o)}}function si({children:e}){return w.jsx(ru,{children:e})}const cs="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",ru=Ye(ue)`
32
- .highlight pre,
33
- pre {
34
- border-radius: 5px;
35
- }
36
- code {
37
- font-family: ${cs};
38
- }
39
- pre code {
40
- font-size: 14px;
41
- font-family: ${cs};
42
- }
43
-
44
- h1,
45
- h2,
46
- h3,
47
- h4,
48
- h5,
49
- h6 {
50
- font-weight: 700 !important;
51
- font-size: 1.2rem !important;
52
- line-height: 1.5 !important;
53
- margin-bottom: 16px;
54
- margin-top: 24px;
55
- border-bottom: initial !important;
56
- }
57
-
58
- .CodeMirror pre {
59
- background: #f6f8fa !important;
60
- }
61
-
62
- .anchor {
63
- display: none;
64
- }
65
- `;si.propTypes={children:W.any.isRequired};si.defaultProps={};function yo({infoList:e=[]}){return w.jsx(ue,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(r=>w.jsxs(w.Fragment,{children:[w.jsx(ue,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:r.key}),w.jsx(ue,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:r.value})]}))})}yo.propTypes={infoList:W.arrayOf(W.shape({key:W.string,value:W.string}))};const nu=e=>e.payment?(e.payment.price||[]).map(d=>d.value||0).every(d=>d===0):!0,iu=new tu({createElement:K.createElement}).Compiler,Tt={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function oi({blockletMeta:e,locale:r,handleDescEle:d}){const{data:m}=e,{registryUrl:_,did:x}=m,g=Bt.getDisplayName({meta:m}),o=Gr(()=>_&&x?fetch(Yi(_,"/api/blocklets",x,"readme")).then(n=>n.json()):null,{refreshDeps:[_,x]}),v=Fl(()=>o.data?o.data[r]||o.data.en||o.data[Object.keys(o.data)[0]]:"",[o]),y=m&&m.htmlAst?iu(m.htmlAst):"",c=nu(m);let t=lt(m,"owner.fullName");if(t){const n=lt(m,"owner.did");n&&(t=w.jsxs(ue,{sx:{display:"flex",alignItems:"center",gap:1},children:[t,w.jsx(Ys,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:n,compact:!0,size:14,locale:r})]}))}else t=lt(m,"author.name");const a=[{key:lt(Tt[r],"appinfo.name"),value:Bt.getDisplayName({meta:m})},{key:lt(Tt[r],"appinfo.version"),value:m.version},{key:lt(Tt[r],"appinfo.author"),value:t},{type:"description",key:lt(Tt[r],"appinfo.description"),value:m.description}];m.requirements&&a.push({key:lt(Tt[r],"appinfo.requirements"),value:m.requirements.server}),m.community&&a.push({key:lt(Tt[r],"appinfo.community"),value:w.jsx("a",{href:m.community,target:"_blank",rel:"noreferrer",children:m.community})}),m.documentation&&a.push({key:lt(Tt[r],"appinfo.documentation"),value:w.jsx("a",{href:m.documentation,target:"_blank",rel:"noreferrer",children:m.documentation})}),m.support&&a.push({key:lt(Tt[r],"appinfo.support"),value:w.jsx("a",{href:`mailto:${m.support}`,target:"_blank",rel:"noreferrer",children:m.support})}),y&&a.push({key:lt(Tt[r],"appinfo.overview"),value:""});let s;return r==="zh"?s=w.jsxs(w.Fragment,{children:[c?w.jsxs("p",{children:["您可以免费使用 ",w.jsx("b",{children:g}),";"]}):w.jsxs("p",{children:["您需要购买才能使用 ",w.jsx("b",{children:g}),";"]}),w.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),w.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),w.jsx("p",{children:"下面为该应用的信息:"})]}):s=w.jsxs(w.Fragment,{children:[c?w.jsxs("p",{children:["You can use ",w.jsx("b",{children:g})," for free;"]}):w.jsxs("p",{children:["You need to purchase before launch ",w.jsx("b",{children:g}),";"]}),w.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),w.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),w.jsx("p",{children:"Below is the information for the blocklet: "})]}),w.jsxs(ou,{children:[d||s,w.jsx(yo,{infoList:a}),v?w.jsxs("div",{className:"app-overview",children:[w.jsx(Ee,{variant:"h5",gutterBottom:!0,children:lt(Tt[r],"appinfo.overview")}),w.jsx(si,{children:w.jsx(su,{component:"div",className:"content-wrapper post-content",children:w.jsx(Ml,{source:v,wrapperElement:{"data-color-mode":"light"},urlTransform:(n,i,h)=>n.startsWith("/")?Yi(_,n):n})})})]}):y?w.jsx("div",{className:"app-overview",children:y}):null]})}const su=Ye(Ee)`
66
- width: 100%;
67
- word-wrap: break-word;
68
- word-break: break-word;
69
- line-height: 1.5em;
70
- min-height: 10vh;
71
- margin-bottom: 40px !important;
72
-
73
- .alert-content {
74
- max-width: 100%;
75
- p:last-of-type {
76
- margin-bottom: 0;
77
- }
78
- }
79
-
80
- iframe {
81
- width: 100% !important;
82
- }
83
- `,ou=Ye.div`
84
- .info-table {
85
- a {
86
- word-break: break-all;
87
- }
88
- }
89
- .app-overview {
90
- font-size: 16px;
91
- margin: 16px 0 0 16px;
92
- h1 {
93
- margin: 8px 0;
94
- font-size: 20px;
95
- }
96
- h2 {
97
- margin: 8px 0;
98
- font-size: 18px;
99
- }
100
- ul {
101
- display: block;
102
- list-style-type: disc;
103
- padding-left: 2em;
104
- li {
105
- display: list-item;
106
- list-style: disc;
107
- }
108
- }
109
- blockquote {
110
- margin-left: 2em;
111
- }
112
- }
113
- `;oi.propTypes={blockletMeta:W.object.isRequired,locale:W.string.isRequired,handleDescEle:W.node};oi.defaultProps={handleDescEle:""};function au({...e}){return w.jsxs("div",{...e,style:{width:"100%"},children:[w.jsx("h3",{children:"End User License Agreement for Application"}),w.jsxs("p",{children:["Blocklet Server License Agreement ",Zs.COPYRIGHT_OWNER," version 2020-08-28"]}),w.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),w.jsx("p",{children:"暂无"})]})}function lu(e){var r,d,m,_;return`${((r=e.bundleSource)==null?void 0:r.store)||e.meta.homepage}/assets/${(d=e.meta)==null?void 0:d.did}/${((m=e.meta)==null?void 0:m.logo)||"logo.png"}?v=${(_=e.meta)==null?void 0:_.version}`}function ai({installRelated:e,meta:r,show:d,onClose:m,components:_,loading:x}){const{t:g}=mt(),o=Ft(t=>t.breakpoints.down("md"));if(!d)return null;const v=!x&&_.length===0,y=!x&&_.length!==0,c=40;return w.jsxs(Yn,{title:g("blocklet.component.relatedComponents",{name:r.title}),maxWidth:!1,fullWidth:!1,onClose:(t,a)=>{a!=="backdropClick"&&m(!1)},PaperProps:{style:o?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[x&&w.jsx(ue,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:w.jsx(ue,{sx:{fontSize:32},color:"primary.main",component:Ut,icon:"line-md:loading-loop"})}),v&&w.jsx(ue,{sx:{textAlign:"center"},children:g("blocklet.component.noDependencies",{name:r.title})}),y&&w.jsx(ue,{sx:{marginBottom:2},children:_.map(t=>{if(!t.meta)return null;const{required:a}=t;let s;return e||a?s=1:s=.5,w.jsxs(ue,{sx:{opacity:s,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[w.jsx("img",{style:{width:c,height:c,minWidth:c,minHeight:c},src:lu(t),alt:t.meta.title}),w.jsxs(ue,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[w.jsxs(ue,{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 n;window.open(ql(`${((n=t.bundleSource)==null?void 0:n.store)||t.meta.homepage}/blocklets/${t.meta.did}`,{allowDomains:null}),"_blank")},children:[t.meta.title,w.jsx(ue,{sx:{display:a?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:g("blocklet.component.required")}),w.jsxs(ue,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[t.meta.version,w.jsx(ue,{className:"link-icon",icon:"fluent:open-20-filled",component:Ut,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),w.jsx(ue,{sx:{marginTop:0,opacity:.7},children:t.meta.description})]})]},t.meta.did)})})]})}ai.propTypes={meta:W.object,show:W.bool,onClose:W.func.isRequired,installRelated:W.func,components:W.array.isRequired,loading:W.bool.isRequired};ai.defaultProps={meta:null,show:!1,installRelated:!1};function cu(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function uu(e){const{api:r}=Kr(),[d]=Ga(),m=d.get("blocklet_meta_url")||cu(e),[_,x]=K.useState([]),[g,o]=K.useState(!1);return K.useEffect(()=>{!m||e!=null&&e.inputUrl||(o(!0),r.getDynamicComponents({input:{url:m}}).then(v=>{x(v.components)}).finally(()=>{o(!1)}))},[m]),{components:_,loading:g}}function li({installRelated:e,onChangeInstallRelated:r,meta:d,onClickNext:m,handleDescEle:_}){const x=Ha(),{t:g,locale:o}=mt(),[v,y]=K.useState(!1),{components:c,loading:t}=uu(d),a=m||(()=>{x(`/launch-blocklet/install${window.location.search}`)}),s=()=>{y(!0)},n=()=>{y(!1)};return w.jsxs(du,{children:[w.jsx("div",{className:"app-content",children:w.jsx("div",{className:"agreement",children:w.jsx("div",{className:"agreement-content",children:w.jsx(oi,{blockletMeta:{data:d},locale:o,handleDescEle:_})})})}),w.jsxs(ue,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[t?w.jsx(Ut,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,r&&(c!=null&&c.length)?w.jsxs(ue,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[w.jsx(Gn,{sx:{mr:.5},checked:e,onChange:i=>r(i.currentTarget.checked),control:w.jsx(Hn,{}),label:w.jsx("span",{children:g("launchBlocklet.installRelatedComponents")})}),w.jsx(ue,{sx:{"> button svg":{color:"primary.main"}},children:w.jsx(Ms,{size:"small",onClick:s,children:w.jsx(Ut,{icon:"octicon:package-dependencies-16"})})})]}):null,w.jsx("div",{className:"button-container","data-cy":"agree-all",children:w.jsx(ni,{onContinue:a,description:w.jsx(au,{}),texts:{listenName:g("launchBlocklet.license"),buttonNext:g("launchBlocklet.next")}})})]}),w.jsx(ai,{installRelated:e,meta:d,show:v,onClose:n,components:c,loading:t})]})}li.propTypes={meta:W.object.isRequired,onClickNext:W.func,handleDescEle:W.node,installRelated:W.bool,onChangeInstallRelated:W.func};li.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const du=Ye.div`
114
- display: flex;
115
- flex-direction: column;
116
- align-items: center;
117
- width: 100%;
118
- height: 100%;
119
- flex: 1;
120
- .app-content {
121
- padding: 2px 24px 24px;
122
- ${e=>e.theme.breakpoints.down("md")} {
123
- padding-top: 10px;
124
- }
125
- width: 100%;
126
- flex: 1;
127
- letter-spacing: normal;
128
- }
129
- .agreement {
130
- position: relative;
131
- display: flex;
132
- flex-direction: column;
133
- width: 100%;
134
- height: 100%;
135
- border: 1px solid ${e=>e.theme.palette.grey[100]};
136
- border-radius: 12px;
137
- ${e=>e.theme.breakpoints.up("md")} {
138
- margin-top: 24px;
139
- }
140
- ${e=>e.theme.breakpoints.down("md")} {
141
- margin-top: 16px;
142
- }
143
- .agreement-content {
144
- position: absolute;
145
- left: 0;
146
- top: 0;
147
- width: 100%;
148
- height: 100%;
149
- font-size: 14px;
150
- overflow-y: auto;
151
- ${e=>e.theme.breakpoints.up("md")} {
152
- padding: 0 24px;
153
- }
154
- ${e=>e.theme.breakpoints.down("md")} {
155
- padding: 0 16px;
156
- }
157
- &:after {
158
- display: block;
159
- content: '';
160
- height: 24px;
161
- }
162
- }
163
- }
164
- .agreement-bottom {
165
- display: flex;
166
- width: 100%;
167
- padding: 24px;
168
- ${e=>e.theme.breakpoints.up("md")} {
169
- flex-direction: row;
170
- align-items: center;
171
- margin-left: auto;
172
- }
173
- ${e=>e.theme.breakpoints.down("md")} {
174
- flex-direction: column;
175
- align-items: center;
176
- padding-top: 0;
177
- padding-bottom: 16px;
178
- }
179
- }
180
- .button-container {
181
- ${e=>e.theme.breakpoints.up("md")} {
182
- margin-left: auto;
183
- }
184
- ${e=>e.theme.breakpoints.down("md")} {
185
- padding-top: 0;
186
- padding-bottom: 16px;
187
- }
188
- }
189
- `;var vo={},ci={exports:{}},bo={exports:{}},Pr=bo.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-"+xo(e)}}},us={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:xo};Object.keys(Pr).forEach(function(e){Object.keys(us).forEach(function(r){Pr[e][r]||(Pr[e][r]=us[r])}),Pr[e].protocols_re=RegExp("^("+Pr[e].protocols.map(function(r){return r.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function xo(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var wo=bo.exports,ds=wo,Er=Object.assign||function(r,d){if(d===null||typeof d!="object")return r;const m=Object.keys(d);let _=m.length;for(;_--;)r[m[_]]=d[m[_]];return r},hu=Je;function Je(e,r,d,m,_,x,g){var o=this;o.type=e,Object.keys(ds[e]).forEach(function(v){o[v]=ds[e][v]}),o.user=r,o.auth=d,o.project=m,o.committish=_,o.default=x,o.opts=g||{}}Je.prototype.hash=function(){return this.committish?"#"+this.committish:""};Je.prototype._fill=function(e,r){if(e){var d=Er({},r);d.path=d.path?d.path.replace(/^[/]+/g,""):"",r=Er(Er({},this.opts),r);var m=this;Object.keys(this).forEach(function(c){m[c]!=null&&d[c]==null&&(d[c]=m[c])});var _=d.auth,x=d.committish,g=d.fragment,o=d.path,v=d.project;Object.keys(d).forEach(function(c){var t=d[c];(c==="path"||c==="project")&&typeof t=="string"?d[c]=t.split("/").map(function(a){return encodeURIComponent(a)}).join("/"):c!=="domain"&&(d[c]=encodeURIComponent(t))}),d["auth@"]=_?_+"@":"",d["#fragment"]=g?"#"+this.hashformat(g):"",d.fragment=d.fragment?d.fragment:"",d["#path"]=o?"#"+this.hashformat(o):"",d["/path"]=d.path?"/"+d.path:"",d.projectPath=v.split("/").map(encodeURIComponent).join("/"),r.noCommittish?(d["#committish"]="",d["/tree/committish"]="",d["/committish"]="",d.committish=""):(d["#committish"]=x?"#"+x:"",d["/tree/committish"]=d.committish?"/"+d.treepath+"/"+d.committish:"",d["/committish"]=d.committish?"/"+d.committish:"",d.committish=d.committish||"master");var y=e;return Object.keys(d).forEach(function(c){y=y.replace(new RegExp("[{]"+c+"[}]","g"),d[c])}),r.noGitPlus?y.replace(/^git[+]/,""):y}};Je.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Je.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Je.prototype.browse=function(e,r,d){return typeof e=="string"?(typeof r!="string"&&(d=r,r=null),this._fill(this.browsefiletemplate,Er({fragment:r,path:e},d))):this._fill(this.browsetemplate,e)};Je.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Je.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Je.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Je.prototype.git=function(e){return this._fill(this.gittemplate,e)};Je.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Je.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Je.prototype.tarball=function(e){var r=Er({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,r)};Je.prototype.file=function(e,r){return this._fill(this.filetemplate,Er({path:e},r))};Je.prototype.getDefaultRepresentation=function(){return this.default};Je.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Sn,hs;function fu(){return hs||(hs=1,Sn=function(e){e.prototype[Symbol.iterator]=function*(){for(let r=this.head;r;r=r.next)yield r.value}}),Sn}var pu=Re;Re.Node=ir;Re.create=Re;function Re(e){var r=this;if(r instanceof Re||(r=new Re),r.tail=null,r.head=null,r.length=0,e&&typeof e.forEach=="function")e.forEach(function(_){r.push(_)});else if(arguments.length>0)for(var d=0,m=arguments.length;d<m;d++)r.push(arguments[d]);return r}Re.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var r=e.next,d=e.prev;return r&&(r.prev=d),d&&(d.next=r),e===this.head&&(this.head=r),e===this.tail&&(this.tail=d),e.list.length--,e.next=null,e.prev=null,e.list=null,r};Re.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var r=this.head;e.list=this,e.next=r,r&&(r.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};Re.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var r=this.tail;e.list=this,e.prev=r,r&&(r.next=e),this.tail=e,this.head||(this.head=e),this.length++}};Re.prototype.push=function(){for(var e=0,r=arguments.length;e<r;e++)gu(this,arguments[e]);return this.length};Re.prototype.unshift=function(){for(var e=0,r=arguments.length;e<r;e++)yu(this,arguments[e]);return this.length};Re.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}};Re.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}};Re.prototype.forEach=function(e,r){r=r||this;for(var d=this.head,m=0;d!==null;m++)e.call(r,d.value,m,this),d=d.next};Re.prototype.forEachReverse=function(e,r){r=r||this;for(var d=this.tail,m=this.length-1;d!==null;m--)e.call(r,d.value,m,this),d=d.prev};Re.prototype.get=function(e){for(var r=0,d=this.head;d!==null&&r<e;r++)d=d.next;if(r===e&&d!==null)return d.value};Re.prototype.getReverse=function(e){for(var r=0,d=this.tail;d!==null&&r<e;r++)d=d.prev;if(r===e&&d!==null)return d.value};Re.prototype.map=function(e,r){r=r||this;for(var d=new Re,m=this.head;m!==null;)d.push(e.call(r,m.value,this)),m=m.next;return d};Re.prototype.mapReverse=function(e,r){r=r||this;for(var d=new Re,m=this.tail;m!==null;)d.push(e.call(r,m.value,this)),m=m.prev;return d};Re.prototype.reduce=function(e,r){var d,m=this.head;if(arguments.length>1)d=r;else if(this.head)m=this.head.next,d=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var _=0;m!==null;_++)d=e(d,m.value,_),m=m.next;return d};Re.prototype.reduceReverse=function(e,r){var d,m=this.tail;if(arguments.length>1)d=r;else if(this.tail)m=this.tail.prev,d=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var _=this.length-1;m!==null;_--)d=e(d,m.value,_),m=m.prev;return d};Re.prototype.toArray=function(){for(var e=new Array(this.length),r=0,d=this.head;d!==null;r++)e[r]=d.value,d=d.next;return e};Re.prototype.toArrayReverse=function(){for(var e=new Array(this.length),r=0,d=this.tail;d!==null;r++)e[r]=d.value,d=d.prev;return e};Re.prototype.slice=function(e,r){r=r||this.length,r<0&&(r+=this.length),e=e||0,e<0&&(e+=this.length);var d=new Re;if(r<e||r<0)return d;e<0&&(e=0),r>this.length&&(r=this.length);for(var m=0,_=this.head;_!==null&&m<e;m++)_=_.next;for(;_!==null&&m<r;m++,_=_.next)d.push(_.value);return d};Re.prototype.sliceReverse=function(e,r){r=r||this.length,r<0&&(r+=this.length),e=e||0,e<0&&(e+=this.length);var d=new Re;if(r<e||r<0)return d;e<0&&(e=0),r>this.length&&(r=this.length);for(var m=this.length,_=this.tail;_!==null&&m>r;m--)_=_.prev;for(;_!==null&&m>e;m--,_=_.prev)d.push(_.value);return d};Re.prototype.splice=function(e,r,...d){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var m=0,_=this.head;_!==null&&m<e;m++)_=_.next;for(var x=[],m=0;_&&m<r;m++)x.push(_.value),_=this.removeNode(_);_===null&&(_=this.tail),_!==this.head&&_!==this.tail&&(_=_.prev);for(var m=0;m<d.length;m++)_=mu(this,_,d[m]);return x};Re.prototype.reverse=function(){for(var e=this.head,r=this.tail,d=e;d!==null;d=d.prev){var m=d.prev;d.prev=d.next,d.next=m}return this.head=r,this.tail=e,this};function mu(e,r,d){var m=r===e.head?new ir(d,null,r,e):new ir(d,r,r.next,e);return m.next===null&&(e.tail=m),m.prev===null&&(e.head=m),e.length++,m}function gu(e,r){e.tail=new ir(r,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function yu(e,r){e.head=new ir(r,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function ir(e,r,d,m){if(!(this instanceof ir))return new ir(e,r,d,m);this.list=m,this.value=e,r?(r.next=this,this.prev=r):this.prev=null,d?(d.prev=this,this.next=d):this.next=null}try{fu()(Re)}catch{}const vu=pu,rr=Symbol("max"),Mt=Symbol("length"),Sr=Symbol("lengthCalculator"),Fr=Symbol("allowStale"),nr=Symbol("maxAge"),Dt=Symbol("dispose"),fs=Symbol("noDisposeOnSet"),Ve=Symbol("lruList"),bt=Symbol("cache"),_o=Symbol("updateAgeOnGet"),En=()=>1;class bu{constructor(r){if(typeof r=="number"&&(r={max:r}),r||(r={}),r.max&&(typeof r.max!="number"||r.max<0))throw new TypeError("max must be a non-negative number");this[rr]=r.max||1/0;const d=r.length||En;if(this[Sr]=typeof d!="function"?En:d,this[Fr]=r.stale||!1,r.maxAge&&typeof r.maxAge!="number")throw new TypeError("maxAge must be a number");this[nr]=r.maxAge||0,this[Dt]=r.dispose,this[fs]=r.noDisposeOnSet||!1,this[_o]=r.updateAgeOnGet||!1,this.reset()}set max(r){if(typeof r!="number"||r<0)throw new TypeError("max must be a non-negative number");this[rr]=r||1/0,Lr(this)}get max(){return this[rr]}set allowStale(r){this[Fr]=!!r}get allowStale(){return this[Fr]}set maxAge(r){if(typeof r!="number")throw new TypeError("maxAge must be a non-negative number");this[nr]=r,Lr(this)}get maxAge(){return this[nr]}set lengthCalculator(r){typeof r!="function"&&(r=En),r!==this[Sr]&&(this[Sr]=r,this[Mt]=0,this[Ve].forEach(d=>{d.length=this[Sr](d.value,d.key),this[Mt]+=d.length})),Lr(this)}get lengthCalculator(){return this[Sr]}get length(){return this[Mt]}get itemCount(){return this[Ve].length}rforEach(r,d){d=d||this;for(let m=this[Ve].tail;m!==null;){const _=m.prev;ps(this,r,m,d),m=_}}forEach(r,d){d=d||this;for(let m=this[Ve].head;m!==null;){const _=m.next;ps(this,r,m,d),m=_}}keys(){return this[Ve].toArray().map(r=>r.key)}values(){return this[Ve].toArray().map(r=>r.value)}reset(){this[Dt]&&this[Ve]&&this[Ve].length&&this[Ve].forEach(r=>this[Dt](r.key,r.value)),this[bt]=new Map,this[Ve]=new vu,this[Mt]=0}dump(){return this[Ve].map(r=>nn(this,r)?!1:{k:r.key,v:r.value,e:r.now+(r.maxAge||0)}).toArray().filter(r=>r)}dumpLru(){return this[Ve]}set(r,d,m){if(m=m||this[nr],m&&typeof m!="number")throw new TypeError("maxAge must be a number");const _=m?Date.now():0,x=this[Sr](d,r);if(this[bt].has(r)){if(x>this[rr])return jr(this,this[bt].get(r)),!1;const v=this[bt].get(r).value;return this[Dt]&&(this[fs]||this[Dt](r,v.value)),v.now=_,v.maxAge=m,v.value=d,this[Mt]+=x-v.length,v.length=x,this.get(r),Lr(this),!0}const g=new xu(r,d,x,_,m);return g.length>this[rr]?(this[Dt]&&this[Dt](r,d),!1):(this[Mt]+=g.length,this[Ve].unshift(g),this[bt].set(r,this[Ve].head),Lr(this),!0)}has(r){if(!this[bt].has(r))return!1;const d=this[bt].get(r).value;return!nn(this,d)}get(r){return jn(this,r,!0)}peek(r){return jn(this,r,!1)}pop(){const r=this[Ve].tail;return r?(jr(this,r),r.value):null}del(r){jr(this,this[bt].get(r))}load(r){this.reset();const d=Date.now();for(let m=r.length-1;m>=0;m--){const _=r[m],x=_.e||0;if(x===0)this.set(_.k,_.v);else{const g=x-d;g>0&&this.set(_.k,_.v,g)}}}prune(){this[bt].forEach((r,d)=>jn(this,d,!1))}}const jn=(e,r,d)=>{const m=e[bt].get(r);if(m){const _=m.value;if(nn(e,_)){if(jr(e,m),!e[Fr])return}else d&&(e[_o]&&(m.value.now=Date.now()),e[Ve].unshiftNode(m));return _.value}},nn=(e,r)=>{if(!r||!r.maxAge&&!e[nr])return!1;const d=Date.now()-r.now;return r.maxAge?d>r.maxAge:e[nr]&&d>e[nr]},Lr=e=>{if(e[Mt]>e[rr])for(let r=e[Ve].tail;e[Mt]>e[rr]&&r!==null;){const d=r.prev;jr(e,r),r=d}},jr=(e,r)=>{if(r){const d=r.value;e[Dt]&&e[Dt](d.key,d.value),e[Mt]-=d.length,e[bt].delete(d.key),e[Ve].removeNode(r)}};class xu{constructor(r,d,m,_,x){this.key=r,this.value=d,this.length=m,this.now=_,this.maxAge=x||0}}const ps=(e,r,d,m)=>{let _=d.value;nn(e,_)&&(jr(e,d),e[Fr]||(_=void 0)),_&&r.call(m,_.value,_.key,e)};var wu=bu,Bn=vl,ms=wo,_u=ci.exports=hu,Su=wu,kn=new Su({max:1e3}),Eu={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function ju(e){return Eu[e]||e.slice(0,-1)}var ku={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};ci.exports.fromUrl=function(e,r){if(typeof e=="string"){var d=e+JSON.stringify(r||{});return kn.has(d)||kn.set(d,Ru(e,r)),kn.get(d)}};function Ru(e,r){if(!(e==null||e==="")){var d=Tu(Ou(e)?"github:"+e:e),m=Cu(d),_=d.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),x=Object.keys(ms).map(function(g){try{var o=ms[g],v=null;m.auth&&ku[m.protocol]&&(v=m.auth);var y=m.hash?decodeURIComponent(m.hash.substr(1)):null,c=null,t=null,a=null;if(_&&_[1]===g)c=_[2]&&decodeURIComponent(_[2]),t=decodeURIComponent(_[3].replace(/\.git$/,"")),a="shortcut";else{if(m.host&&m.host!==o.domain&&m.host.replace(/^www[.]/,"")!==o.domain||!o.protocols_re.test(m.protocol)||!m.path)return;var s=o.pathmatch,n=m.path.match(s);if(!n)return;n[1]!==null&&n[1]!==void 0&&(c=decodeURIComponent(n[1].replace(/^:/,""))),t=decodeURIComponent(n[2]),a=ju(m.protocol)}return new _u(g,c,v,t,y,a,r)}catch(i){if(!(i instanceof URIError))throw i}}).filter(function(g){return g});if(x.length===1)return x[0]}}function Ou(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Tu(e){var r=Bn.parse(e);return r.protocol==="gist:"&&r.host&&!r.path?r.protocol+"/"+r.host:e}function Cu(e){var r=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!r){var d=Bn.parse(e);if(d.auth){const _=e.match(/[^@]+@[^:/]+/);if(_){var m=new Bn.URL(_[0]);d.auth=m.username||"",m.password&&(d.auth+=":"+m.password)}}return d}return{protocol:"git+ssh:",slashes:!0,auth:r[1],host:r[2],port:null,hostname:r[2],hash:r[4],search:null,query:null,pathname:"/"+r[3],path:"/"+r[3],href:"git+ssh://"+r[1]+"@"+r[2]+"/"+r[3]+(r[4]||"")}}var Iu=ci.exports,sr={},ce={},$u=null;const Au=Object.freeze(Object.defineProperty({__proto__:null,default:$u},Symbol.toStringTag,{value:"Module"})),So=Hs(Au);var Eo={exports:{}};(function(e,r){(function(d,m){e.exports=m()})(self,()=>{return d={7629:(_,x,g)=>{const o=g(375),v=g(8571),y=g(9474),c=g(1687),t=g(8652),a=g(8160),s=g(3292),n=g(6354),i=g(8901),h=g(9708),l=g(6914),u=g(2294),p=g(6133),S=g(1152),b=g(8863),O=g(2036),R={Base:class{constructor(f){this.type=f,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new u.Ids,this._preferences=null,this._refs=new p.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return o(typeof h.describe=="function","Manifest functionality disabled"),h.describe(this)}allow(...f){return a.verifyFlat(f,"allow"),this._values(f,"_valids")}alter(f){o(f&&typeof f=="object"&&!Array.isArray(f),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const E=this.clone();E.$_terms.alterations=E.$_terms.alterations||[];for(const j in f){const L=f[j];o(typeof L=="function","Alteration adjuster for",j,"must be a function"),E.$_terms.alterations.push({target:j,adjuster:L})}return E.$_temp.ruleset=!1,E}artifact(f){return o(f!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",f)}cast(f){return o(f===!1||typeof f=="string","Invalid to value"),o(f===!1||this._definition.cast[f],"Type",this.type,"does not support casting to",f),this.$_setFlag("cast",f===!1?void 0:f)}default(f,E){return this._default("default",f,E)}description(f){return o(f&&typeof f=="string","Description must be a non-empty string"),this.$_setFlag("description",f)}empty(f){const E=this.clone();return f!==void 0&&(f=E.$_compile(f,{override:!1})),E.$_setFlag("empty",f,{clone:!1})}error(f){return o(f,"Missing error"),o(f instanceof Error||typeof f=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",f)}example(f,E={}){return o(f!==void 0,"Missing example"),a.assertOptions(E,["override"]),this._inner("examples",f,{single:!0,override:E.override})}external(f,E){return typeof f=="object"&&(o(!E,"Cannot combine options with description"),E=f.description,f=f.method),o(typeof f=="function","Method must be a function"),o(E===void 0||E&&typeof E=="string","Description must be a non-empty string"),this._inner("externals",{method:f,description:E},{single:!0})}failover(f,E){return this._default("failover",f,E)}forbidden(){return this.presence("forbidden")}id(f){return f?(o(typeof f=="string","id must be a non-empty string"),o(/^[^\.]+$/.test(f),"id cannot contain period character"),this.$_setFlag("id",f)):this.$_setFlag("id",void 0)}invalid(...f){return this._values(f,"_invalids")}label(f){return o(f&&typeof f=="string","Label name must be a non-empty string"),this.$_setFlag("label",f)}meta(f){return o(f!==void 0,"Meta cannot be undefined"),this._inner("metas",f,{single:!0})}note(...f){o(f.length,"Missing notes");for(const E of f)o(E&&typeof E=="string","Notes must be non-empty strings");return this._inner("notes",f)}only(f=!0){return o(typeof f=="boolean","Invalid mode:",f),this.$_setFlag("only",f)}optional(){return this.presence("optional")}prefs(f){o(f,"Missing preferences"),o(f.context===void 0,"Cannot override context"),o(f.externals===void 0,"Cannot override externals"),o(f.warnings===void 0,"Cannot override warnings"),o(f.debug===void 0,"Cannot override debug"),a.checkPreferences(f);const E=this.clone();return E._preferences=a.preferences(E._preferences,f),E}presence(f){return o(["optional","required","forbidden"].includes(f),"Unknown presence mode",f),this.$_setFlag("presence",f)}raw(f=!0){return this.$_setFlag("result",f?"raw":void 0)}result(f){return o(["raw","strip"].includes(f),"Unknown result mode",f),this.$_setFlag("result",f)}required(){return this.presence("required")}strict(f){const E=this.clone(),j=f!==void 0&&!f;return E._preferences=a.preferences(E._preferences,{convert:j}),E}strip(f=!0){return this.$_setFlag("result",f?"strip":void 0)}tag(...f){o(f.length,"Missing tags");for(const E of f)o(E&&typeof E=="string","Tags must be non-empty strings");return this._inner("tags",f)}unit(f){return o(f&&typeof f=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",f)}valid(...f){a.verifyFlat(f,"valid");const E=this.allow(...f);return E.$_setFlag("only",!!E._valids,{clone:!1}),E}when(f,E){const j=this.clone();j.$_terms.whens||(j.$_terms.whens=[]);const L=s.when(j,f,E);if(!["any","link"].includes(j.type)){const B=L.is?[L]:L.switch;for(const z of B)o(!z.then||z.then.type==="any"||z.then.type===j.type,"Cannot combine",j.type,"with",z.then&&z.then.type),o(!z.otherwise||z.otherwise.type==="any"||z.otherwise.type===j.type,"Cannot combine",j.type,"with",z.otherwise&&z.otherwise.type)}return j.$_terms.whens.push(L),j.$_mutateRebuild()}cache(f){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const E=this.clone();return E._cache=f||t.provider.provision(),E.$_temp.ruleset=!1,E}clone(){const f=Object.create(Object.getPrototypeOf(this));return this._assign(f)}concat(f){o(a.isSchema(f),"Invalid schema object"),o(this.type==="any"||f.type==="any"||f.type===this.type,"Cannot merge type",this.type,"with another type:",f.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!f._inRuleset(),"Cannot concatenate a schema with open ruleset");let E=this.clone();if(this.type==="any"&&f.type!=="any"){const j=f.clone();for(const L of Object.keys(E))L!=="type"&&(j[L]=E[L]);E=j}E._ids.concat(f._ids),E._refs.register(f,p.toSibling),E._preferences=E._preferences?a.preferences(E._preferences,f._preferences):f._preferences,E._valids=O.merge(E._valids,f._valids,f._invalids),E._invalids=O.merge(E._invalids,f._invalids,f._valids);for(const j of f._singleRules.keys())E._singleRules.has(j)&&(E._rules=E._rules.filter(L=>L.keep||L.name!==j),E._singleRules.delete(j));for(const j of f._rules)f._definition.rules[j.method].multi||E._singleRules.set(j.name,j),E._rules.push(j);if(E._flags.empty&&f._flags.empty){E._flags.empty=E._flags.empty.concat(f._flags.empty);const j=Object.assign({},f._flags);delete j.empty,c(E._flags,j)}else if(f._flags.empty){E._flags.empty=f._flags.empty;const j=Object.assign({},f._flags);delete j.empty,c(E._flags,j)}else c(E._flags,f._flags);for(const j in f.$_terms){const L=f.$_terms[j];L?E.$_terms[j]?E.$_terms[j]=E.$_terms[j].concat(L):E.$_terms[j]=L.slice():E.$_terms[j]||(E.$_terms[j]=L)}return this.$_root._tracer&&this.$_root._tracer._combine(E,[this,f]),E.$_mutateRebuild()}extend(f){return o(!f.base,"Cannot extend type with another base"),i.type(this,f)}extract(f){return f=Array.isArray(f)?f:f.split("."),this._ids.reach(f)}fork(f,E){o(!this._inRuleset(),"Cannot fork inside a ruleset");let j=this;for(let L of[].concat(f))L=Array.isArray(L)?L:L.split("."),j=j._ids.fork(L,E,j);return j.$_temp.ruleset=!1,j}rule(f){const E=this._definition;a.assertOptions(f,Object.keys(E.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const j=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(j>=0&&j<this._rules.length,"Cannot apply rules to empty ruleset");const L=this.clone();for(let B=j;B<L._rules.length;++B){const z=L._rules[B],ee=v(z);for(const ne in f)E.modifiers[ne](ee,f[ne]),o(ee.name===z.name,"Cannot change rule name");L._rules[B]=ee,L._singleRules.get(ee.name)===z&&L._singleRules.set(ee.name,ee)}return L.$_temp.ruleset=!1,L.$_mutateRebuild()}get ruleset(){o(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const f=this.clone();return f.$_temp.ruleset=f._rules.length,f}get $(){return this.ruleset}tailor(f){f=[].concat(f),o(!this._inRuleset(),"Cannot tailor inside a ruleset");let E=this;if(this.$_terms.alterations)for(const{target:j,adjuster:L}of this.$_terms.alterations)f.includes(j)&&(E=L(E),o(a.isSchema(E),"Alteration adjuster for",j,"failed to return a schema object"));return E=E.$_modify({each:j=>j.tailor(f),ref:!1}),E.$_temp.ruleset=!1,E.$_mutateRebuild()}tracer(){return S.location?S.location(this):this}validate(f,E){return b.entry(f,this,E)}validateAsync(f,E){return b.entryAsync(f,this,E)}$_addRule(f){typeof f=="string"&&(f={name:f}),o(f&&typeof f=="object","Invalid options"),o(f.name&&typeof f.name=="string","Invalid rule name");for(const z in f)o(z[0]!=="_","Cannot set private rule properties");const E=Object.assign({},f);E._resolve=[],E.method=E.method||E.name;const j=this._definition.rules[E.method],L=E.args;o(j,"Unknown rule",E.method);const B=this.clone();if(L){o(Object.keys(L).length===1||Object.keys(L).length===this._definition.rules[E.name].args.length,"Invalid rule definition for",this.type,E.name);for(const z in L){let ee=L[z];if(j.argsByName){const ne=j.argsByName.get(z);if(ne.ref&&a.isResolvable(ee))E._resolve.push(z),B.$_mutateRegister(ee);else if(ne.normalize&&(ee=ne.normalize(ee),L[z]=ee),ne.assert){const G=a.validateArg(ee,z,ne);o(!G,G,"or reference")}}ee!==void 0?L[z]=ee:delete L[z]}}return j.multi||(B._ruleRemove(E.name,{clone:!1}),B._singleRules.set(E.name,E)),B.$_temp.ruleset===!1&&(B.$_temp.ruleset=null),j.priority?B._rules.unshift(E):B._rules.push(E),B}$_compile(f,E){return s.schema(this.$_root,f,E)}$_createError(f,E,j,L,B,z={}){const ee=z.flags!==!1?this._flags:{},ne=z.messages?l.merge(this._definition.messages,z.messages):this._definition.messages;return new n.Report(f,E,j,ee,ne,L,B)}$_getFlag(f){return this._flags[f]}$_getRule(f){return this._singleRules.get(f)}$_mapLabels(f){return f=Array.isArray(f)?f:f.split("."),this._ids.labels(f)}$_match(f,E,j,L){(j=Object.assign({},j)).abortEarly=!0,j._externals=!1,E.snapshot();const B=!b.validate(f,this,E,j,L).errors;return E.restore(),B}$_modify(f){return a.assertOptions(f,["each","once","ref","schema"]),u.schema(this,f)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(f,{source:E,name:j,path:L,key:B})=>{const z=this._definition[E][j]&&this._definition[E][j].register;z!==!1&&this.$_mutateRegister(f,{family:z,key:B})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(f,{family:E,key:j}={}){this._refs.register(f,E),this._ids.register(f,{key:j})}$_property(f){return this._definition.properties[f]}$_reach(f){return this._ids.reach(f)}$_rootReferences(){return this._refs.roots()}$_setFlag(f,E,j={}){o(f[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const L=this._definition.flags[f]||{};if(y(E,L.default)&&(E=void 0),y(E,this._flags[f]))return this;const B=j.clone!==!1?this.clone():this;return E!==void 0?(B._flags[f]=E,B.$_mutateRegister(E)):delete B._flags[f],f[0]!=="_"&&(B.$_temp.ruleset=!1),B}$_parent(f,...E){return this[f][a.symbols.parent].call(this,...E)}$_validate(f,E,j){return b.validate(f,this,E,j)}_assign(f){f.type=this.type,f.$_root=this.$_root,f.$_temp=Object.assign({},this.$_temp),f.$_temp.whens={},f._ids=this._ids.clone(),f._preferences=this._preferences,f._valids=this._valids&&this._valids.clone(),f._invalids=this._invalids&&this._invalids.clone(),f._rules=this._rules.slice(),f._singleRules=v(this._singleRules,{shallow:!0}),f._refs=this._refs.clone(),f._flags=Object.assign({},this._flags),f._cache=null,f.$_terms={};for(const E in this.$_terms)f.$_terms[E]=this.$_terms[E]?this.$_terms[E].slice():null;f.$_super={};for(const E in this.$_super)f.$_super[E]=this._super[E].bind(f);return f}_bare(){const f=this.clone();f._reset();const E=f._definition.terms;for(const j in E){const L=E[j];f.$_terms[j]=L.init}return f.$_mutateRebuild()}_default(f,E,j={}){return a.assertOptions(j,"literal"),o(E!==void 0,"Missing",f,"value"),o(typeof E=="function"||!j.literal,"Only function value supports literal option"),typeof E=="function"&&j.literal&&(E={[a.symbols.literal]:!0,literal:E}),this.$_setFlag(f,E)}_generate(f,E,j){if(!this.$_terms.whens)return{schema:this};const L=[],B=[];for(let ne=0;ne<this.$_terms.whens.length;++ne){const G=this.$_terms.whens[ne];if(G.concat){L.push(G.concat),B.push(`${ne}.concat`);continue}const oe=G.ref?G.ref.resolve(f,E,j):f,H=G.is?[G]:G.switch,xe=B.length;for(let Q=0;Q<H.length;++Q){const{is:ve,then:ye,otherwise:$e}=H[Q],Ae=`${ne}${G.switch?"."+Q:""}`;if(ve.$_match(oe,E.nest(ve,`${Ae}.is`),j)){if(ye){const Qe=E.localize([...E.path,`${Ae}.then`],E.ancestors,E.schemas),{schema:gt,id:st}=ye._generate(f,Qe,j);L.push(gt),B.push(`${Ae}.then${st?`(${st})`:""}`);break}}else if($e){const Qe=E.localize([...E.path,`${Ae}.otherwise`],E.ancestors,E.schemas),{schema:gt,id:st}=$e._generate(f,Qe,j);L.push(gt),B.push(`${Ae}.otherwise${st?`(${st})`:""}`);break}}if(G.break&&B.length>xe)break}const z=B.join(", ");if(E.mainstay.tracer.debug(E,"rule","when",z),!z)return{schema:this};if(!E.mainstay.tracer.active&&this.$_temp.whens[z])return{schema:this.$_temp.whens[z],id:z};let ee=this;this._definition.generate&&(ee=this._definition.generate(this,f,E,j));for(const ne of L)ee=ee.concat(ne);return this.$_root._tracer&&this.$_root._tracer._combine(ee,[this,...L]),this.$_temp.whens[z]=ee,{schema:ee,id:z}}_inner(f,E,j={}){o(!this._inRuleset(),`Cannot set ${f} inside a ruleset`);const L=this.clone();return L.$_terms[f]&&!j.override||(L.$_terms[f]=[]),j.single?L.$_terms[f].push(E):L.$_terms[f].push(...E),L.$_temp.ruleset=!1,L}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(f,E={}){if(!this._singleRules.has(f))return this;const j=E.clone!==!1?this.clone():this;j._singleRules.delete(f);const L=[];for(let B=0;B<j._rules.length;++B){const z=j._rules[B];z.name!==f||z.keep?L.push(z):j._inRuleset()&&B<j.$_temp.ruleset&&--j.$_temp.ruleset}return j._rules=L,j}_values(f,E){a.verifyFlat(f,E.slice(1,-1));const j=this.clone(),L=f[0]===a.symbols.override;if(L&&(f=f.slice(1)),!j[E]&&f.length?j[E]=new O:L&&(j[E]=f.length?new O:null,j.$_mutateRebuild()),!j[E])return j;L&&j[E].override();for(const B of f){o(B!==void 0,"Cannot call allow/valid/invalid with undefined"),o(B!==a.symbols.override,"Override must be the first value");const z=E==="_invalids"?"_valids":"_invalids";j[z]&&(j[z].remove(B),j[z].length||(o(E==="_valids"||!j._flags.only,"Setting invalid value",B,"leaves schema rejecting all values due to previous valid rule"),j[z]=null)),j[E].add(B,j._refs)}return j}}};R.Base.prototype[a.symbols.any]={version:a.version,compile:s.compile,root:"$_root"},R.Base.prototype.isImmutable=!0,R.Base.prototype.deny=R.Base.prototype.invalid,R.Base.prototype.disallow=R.Base.prototype.invalid,R.Base.prototype.equal=R.Base.prototype.valid,R.Base.prototype.exist=R.Base.prototype.required,R.Base.prototype.not=R.Base.prototype.invalid,R.Base.prototype.options=R.Base.prototype.prefs,R.Base.prototype.preferences=R.Base.prototype.prefs,_.exports=new R.Base},8652:(_,x,g)=>{const o=g(375),v=g(8571),y=g(8160),c={max:1e3,supported:new Set(["undefined","boolean","number","string"])};x.provider={provision:t=>new c.Cache(t)},c.Cache=class{constructor(t={}){y.assertOptions(t,["max"]),o(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||c.max,this._map=new Map,this._list=new c.List}get length(){return this._map.size}set(t,a){if(t!==null&&!c.supported.has(typeof t))return;let s=this._map.get(t);if(s)return s.value=a,void this._list.first(s);s=this._list.unshift({key:t,value:a}),this._map.set(t,s),this._compact()}get(t){const a=this._map.get(t);if(a)return this._list.first(a),v(a.value)}_compact(){if(this._map.size>this._max){const t=this._list.pop();this._map.delete(t.key)}}},c.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){const{next:a,prev:s}=t;return a.prev=s,s&&(s.next=a),t===this.tail&&(this.tail=a),t.prev=null,t.next=null,t}}},8160:(_,x,g)=>{const o=g(375),v=g(7916),y=g(5934);let c,t;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};x.version=y.version,x.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},x.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},x.assertOptions=function(s,n,i="Options"){o(s&&typeof s=="object"&&!Array.isArray(s),"Options must be of type object");const h=Object.keys(s).filter(l=>!n.includes(l));o(h.length===0,`${i} contain unknown keys: ${h}`)},x.checkPreferences=function(s){t=t||g(3378);const n=t.preferences.validate(s);if(n.error)throw new v([n.error.details[0].message])},x.compare=function(s,n,i){switch(i){case"=":return s===n;case">":return s>n;case"<":return s<n;case">=":return s>=n;case"<=":return s<=n}},x.default=function(s,n){return s===void 0?n:s},x.isIsoDate=function(s){return a.isoDate.test(s)},x.isNumber=function(s){return typeof s=="number"&&!isNaN(s)},x.isResolvable=function(s){return!!s&&(s[x.symbols.ref]||s[x.symbols.template])},x.isSchema=function(s,n={}){const i=s&&s[x.symbols.any];return!!i&&(o(n.legacy||i.version===x.version,"Cannot mix different versions of joi schemas"),!0)},x.isValues=function(s){return s[x.symbols.values]},x.limit=function(s){return Number.isSafeInteger(s)&&s>=0},x.preferences=function(s,n){c=c||g(6914),s=s||{},n=n||{};const i=Object.assign({},s,n);return n.errors&&s.errors&&(i.errors=Object.assign({},s.errors,n.errors),i.errors.wrap=Object.assign({},s.errors.wrap,n.errors.wrap)),n.messages&&(i.messages=c.compile(n.messages,s.messages)),delete i[x.symbols.prefs],i},x.tryWithPath=function(s,n,i={}){try{return s()}catch(h){throw h.path!==void 0?h.path=n+"."+h.path:h.path=n,i.append&&(h.message=`${h.message} (${h.path})`),h}},x.validateArg=function(s,n,{assert:i,message:h}){if(x.isSchema(i)){const l=i.validate(s);return l.error?l.error.message:void 0}if(!i(s))return n?`${n} ${h}`:h},x.verifyFlat=function(s,n){for(const i of s)o(!Array.isArray(i),"Method no longer accepts array arguments:",n)}},3292:(_,x,g)=>{const o=g(375),v=g(8160),y=g(6133),c={};x.schema=function(t,a,s={}){v.assertOptions(s,["appendPath","override"]);try{return c.schema(t,a,s)}catch(n){throw s.appendPath&&n.path!==void 0&&(n.message=`${n.message} (${n.path})`),n}},c.schema=function(t,a,s){o(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(o(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const n=(i,...h)=>s.override!==!1?i.valid(t.override,...h):i.valid(...h);if(c.simple(a))return n(t,a);if(typeof a=="function")return t.custom(a);if(o(typeof a=="object","Invalid schema content:",typeof a),v.isResolvable(a))return n(t,a);if(v.isSchema(a))return a;if(Array.isArray(a)){for(const i of a)if(!c.simple(i))return t.alternatives().try(...a);return n(t,...a)}return a instanceof RegExp?t.string().regex(a):a instanceof Date?n(t.date(),a):(o(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(a))},x.ref=function(t,a){return y.isRef(t)?t:y.create(t,a)},x.compile=function(t,a,s={}){v.assertOptions(s,["legacy"]);const n=a&&a[v.symbols.any];if(n)return o(s.legacy||n.version===v.version,"Cannot mix different versions of joi schemas:",n.version,v.version),a;if(typeof a!="object"||!s.legacy)return x.schema(t,a,{appendPath:!0});const i=c.walk(a);return i?i.compile(i.root,a):x.schema(t,a,{appendPath:!0})},c.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(const s of t){const n=c.walk(s);if(n)return n}return null}const a=t[v.symbols.any];if(a)return{root:t[a.root],compile:a.compile};o(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const s in t){const n=c.walk(t[s]);if(n)return n}return null},c.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)},x.when=function(t,a,s){if(s===void 0&&(o(a&&typeof a=="object","Missing options"),s=a,a=y.create(".")),Array.isArray(s)&&(s={switch:s}),v.assertOptions(s,["is","not","then","otherwise","switch","break"]),v.isSchema(a))return o(s.is===void 0,'"is" can not be used with a schema condition'),o(s.not===void 0,'"not" can not be used with a schema condition'),o(s.switch===void 0,'"switch" can not be used with a schema condition'),c.condition(t,{is:a,then:s.then,otherwise:s.otherwise,break:s.break});if(o(y.isRef(a)||typeof a=="string","Invalid condition:",a),o(s.not===void 0||s.is===void 0,'Cannot combine "is" with "not"'),s.switch===void 0){let i=s;s.not!==void 0&&(i={is:s.not,then:s.otherwise,otherwise:s.then,break:s.break});let h=i.is!==void 0?t.$_compile(i.is):t.$_root.invalid(null,!1,0,"").required();return o(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),s.is===void 0||y.isRef(s.is)||v.isSchema(s.is)||(h=h.required()),c.condition(t,{ref:x.ref(a),is:h,then:i.then,otherwise:i.otherwise,break:i.break})}o(Array.isArray(s.switch),'"switch" must be an array'),o(s.is===void 0,'Cannot combine "switch" with "is"'),o(s.not===void 0,'Cannot combine "switch" with "not"'),o(s.then===void 0,'Cannot combine "switch" with "then"');const n={ref:x.ref(a),switch:[],break:s.break};for(let i=0;i<s.switch.length;++i){const h=s.switch[i],l=i===s.switch.length-1;v.assertOptions(h,l?["is","then","otherwise"]:["is","then"]),o(h.is!==void 0,'Switch statement missing "is"'),o(h.then!==void 0,'Switch statement missing "then"');const u={is:t.$_compile(h.is),then:t.$_compile(h.then)};if(y.isRef(h.is)||v.isSchema(h.is)||(u.is=u.is.required()),l){o(s.otherwise===void 0||h.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const p=s.otherwise!==void 0?s.otherwise:h.otherwise;p!==void 0&&(o(n.break===void 0,"Cannot specify both otherwise and break"),u.otherwise=t.$_compile(p))}n.switch.push(u)}return n},c.condition=function(t,a){for(const s of["then","otherwise"])a[s]===void 0?delete a[s]:a[s]=t.$_compile(a[s]);return a}},6354:(_,x,g)=>{const o=g(5688),v=g(8160),y=g(3328);x.Report=class{constructor(c,t,a,s,n,i,h){if(this.code=c,this.flags=s,this.messages=n,this.path=i.path,this.prefs=h,this.state=i,this.value=t,this.message=null,this.template=null,this.local=a||{},this.local.label=x.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const l=this.path[this.path.length-1];typeof l!="object"&&(this.local.key=l)}}_setTemplate(c){if(this.template=c,!this.flags.label&&this.path.length===0){const t=this._template(this.template,"root");t&&(this.local.label=t)}}toString(){if(this.message)return this.message;const c=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return t===void 0?`Error code "${c}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(c,t){return x.template(this.value,c,t||this.code,this.state,this.prefs)}},x.path=function(c){let t="";for(const a of c)typeof a!="object"&&(typeof a=="string"?(t&&(t+="."),t+=a):t+=`[${a}]`);return t},x.template=function(c,t,a,s,n){if(!t)return;if(y.isTemplate(t))return a!=="root"?t:null;let i=n.errors.language;if(v.isResolvable(i)&&(i=i.resolve(c,s,n)),i&&t[i]){if(t[i][a]!==void 0)return t[i][a];if(t[i]["*"]!==void 0)return t[i]["*"]}return t[a]?t[a]:t["*"]},x.label=function(c,t,a,s){if(c.label)return c.label;if(!a.errors.label)return"";let n=t.path;return a.errors.label==="key"&&t.path.length>1&&(n=t.path.slice(-1)),x.path(n)||x.template(null,a.messages,"root",t,a)||s&&x.template(null,s,"root",t,a)||"value"},x.process=function(c,t,a){if(!c)return null;const{override:s,message:n,details:i}=x.details(c);if(s)return s;if(a.errors.stack)return new x.ValidationError(n,i,t);const h=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new x.ValidationError(n,i,t);return Error.stackTraceLimit=h,l},x.details=function(c,t={}){let a=[];const s=[];for(const n of c){if(n instanceof Error){if(t.override!==!1)return{override:n};const h=n.toString();a.push(h),s.push({message:h,type:"override",context:{error:n}});continue}const i=n.toString();a.push(i),s.push({message:i,path:n.path.filter(h=>typeof h!="object"),type:n.code,context:n.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:s}},x.ValidationError=class extends Error{constructor(c,t,a){super(c),this._original=a,this.details=t}static isError(c){return c instanceof x.ValidationError}},x.ValidationError.prototype.isJoi=!0,x.ValidationError.prototype.name="ValidationError",x.ValidationError.prototype.annotate=o.error},8901:(_,x,g)=>{const o=g(375),v=g(8571),y=g(8160),c=g(6914),t={};x.type=function(a,s){const n=Object.getPrototypeOf(a),i=v(n),h=a._assign(Object.create(i)),l=Object.assign({},s);delete l.base,i._definition=l;const u=n._definition||{};l.messages=c.merge(u.messages,l.messages),l.properties=Object.assign({},u.properties,l.properties),h.type=l.type,l.flags=Object.assign({},u.flags,l.flags);const p=Object.assign({},u.terms);if(l.terms)for(const R in l.terms){const f=l.terms[R];o(h.$_terms[R]===void 0,"Invalid term override for",l.type,R),h.$_terms[R]=f.init,p[R]=f}l.terms=p,l.args||(l.args=u.args),l.prepare=t.prepare(l.prepare,u.prepare),l.coerce&&(typeof l.coerce=="function"&&(l.coerce={method:l.coerce}),l.coerce.from&&!Array.isArray(l.coerce.from)&&(l.coerce={method:l.coerce.method,from:[].concat(l.coerce.from)})),l.coerce=t.coerce(l.coerce,u.coerce),l.validate=t.validate(l.validate,u.validate);const S=Object.assign({},u.rules);if(l.rules)for(const R in l.rules){const f=l.rules[R];o(typeof f=="object","Invalid rule definition for",l.type,R);let E=f.method;if(E===void 0&&(E=function(){return this.$_addRule(R)}),E&&(o(!i[R],"Rule conflict in",l.type,R),i[R]=E),o(!S[R],"Rule conflict in",l.type,R),S[R]=f,f.alias){const j=[].concat(f.alias);for(const L of j)i[L]=f.method}f.args&&(f.argsByName=new Map,f.args=f.args.map(j=>(typeof j=="string"&&(j={name:j}),o(!f.argsByName.has(j.name),"Duplicated argument name",j.name),y.isSchema(j.assert)&&(j.assert=j.assert.strict().label(j.name)),f.argsByName.set(j.name,j),j)))}l.rules=S;const b=Object.assign({},u.modifiers);if(l.modifiers)for(const R in l.modifiers){o(!i[R],"Rule conflict in",l.type,R);const f=l.modifiers[R];o(typeof f=="function","Invalid modifier definition for",l.type,R);const E=function(j){return this.rule({[R]:j})};i[R]=E,b[R]=f}if(l.modifiers=b,l.overrides){i._super=n,h.$_super={};for(const R in l.overrides)o(n[R],"Cannot override missing",R),l.overrides[R][y.symbols.parent]=n[R],h.$_super[R]=n[R].bind(h);Object.assign(i,l.overrides)}l.cast=Object.assign({},u.cast,l.cast);const O=Object.assign({},u.manifest,l.manifest);return O.build=t.build(l.manifest&&l.manifest.build,u.manifest&&u.manifest.build),l.manifest=O,l.rebuild=t.rebuild(l.rebuild,u.rebuild),h},t.build=function(a,s){return a&&s?function(n,i){return s(a(n,i),i)}:a||s},t.coerce=function(a,s){return a&&s?{from:a.from&&s.from?[...new Set([...a.from,...s.from])]:null,method(n,i){let h;if((!s.from||s.from.includes(typeof n))&&(h=s.method(n,i),h)){if(h.errors||h.value===void 0)return h;n=h.value}if(!a.from||a.from.includes(typeof n)){const l=a.method(n,i);if(l)return l}return h}}:a||s},t.prepare=function(a,s){return a&&s?function(n,i){const h=a(n,i);if(h){if(h.errors||h.value===void 0)return h;n=h.value}return s(n,i)||h}:a||s},t.rebuild=function(a,s){return a&&s?function(n){s(n),a(n)}:a||s},t.validate=function(a,s){return a&&s?function(n,i){const h=s(n,i);if(h){if(h.errors&&(!Array.isArray(h.errors)||h.errors.length))return h;n=h.value}return a(n,i)||h}:a||s}},5107:(_,x,g)=>{const o=g(375),v=g(8571),y=g(8652),c=g(8160),t=g(3292),a=g(6354),s=g(8901),n=g(9708),i=g(6133),h=g(3328),l=g(1152);let u;const p={types:{alternatives:g(4946),any:g(8068),array:g(546),boolean:g(4937),date:g(7500),function:g(390),link:g(8785),number:g(3832),object:g(8966),string:g(7417),symbol:g(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const S={_types:new Set(Object.keys(p.types))};for(const b of S._types)S[b]=function(...O){return o(!O.length||["alternatives","link","object"].includes(b),"The",b,"type does not allow arguments"),p.generate(this,p.types[b],O)};for(const b of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])S[b]=function(...O){return this.any()[b](...O)};Object.assign(S,p.methods);for(const b in p.aliases){const O=p.aliases[b];S[b]=S[O]}return S.x=S.expression,l.setup&&l.setup(S),S}};p.methods={ValidationError:a.ValidationError,version:c.version,cache:y.provider,assert(S,b,...O){p.assert(S,b,!0,O)},attempt:(S,b,...O)=>p.assert(S,b,!1,O),build(S){return o(typeof n.build=="function","Manifest functionality disabled"),n.build(this,S)},checkPreferences(S){c.checkPreferences(S)},compile(S,b){return t.compile(this,S,b)},defaults(S){o(typeof S=="function","modifier must be a function");const b=Object.assign({},this);for(const O of b._types){const R=S(b[O]());o(c.isSchema(R),"modifier must return a valid schema object"),b[O]=function(...f){return p.generate(this,R,f)}}return b},expression:(...S)=>new h(...S),extend(...S){c.verifyFlat(S,"extend"),u=u||g(3378),o(S.length,"You need to provide at least one extension"),this.assert(S,u.extensions);const b=Object.assign({},this);b._types=new Set(b._types);for(let O of S){typeof O=="function"&&(O=O(b)),this.assert(O,u.extension);const R=p.expandExtension(O,b);for(const f of R){o(b[f.type]===void 0||b._types.has(f.type),"Cannot override name",f.type);const E=f.base||this.any(),j=s.type(E,f);b._types.add(f.type),b[f.type]=function(...L){return p.generate(this,j,L)}}}return b},isError:a.ValidationError.isError,isExpression:h.isTemplate,isRef:i.isRef,isSchema:c.isSchema,in:(...S)=>i.in(...S),override:c.symbols.override,ref:(...S)=>i.create(...S),types(){const S={};for(const b of this._types)S[b]=this[b]();for(const b in p.aliases)S[b]=this[b]();return S}},p.assert=function(S,b,O,R){const f=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,E=f!==null?R[1]:R[0],j=b.validate(S,c.preferences({errors:{stack:!0}},E||{}));let L=j.error;if(!L)return j.value;if(f instanceof Error)throw f;const B=O&&typeof L.annotate=="function"?L.annotate():L.message;throw L instanceof a.ValidationError==0&&(L=v(L)),L.message=f?`${f} ${B}`:B,L},p.generate=function(S,b,O){return o(S,"Must be invoked on a Joi instance."),b.$_root=S,b._definition.args&&O.length?b._definition.args(b,...O):b},p.expandExtension=function(S,b){if(typeof S.type=="string")return[S];const O=[];for(const R of b._types)if(S.type.test(R)){const f=Object.assign({},S);f.type=R,f.base=b[R](),O.push(f)}return O},_.exports=p.root()},6914:(_,x,g)=>{const o=g(375),v=g(8571),y=g(3328);x.compile=function(c,t){if(typeof c=="string")return o(!t,"Cannot set single message string"),new y(c);if(y.isTemplate(c))return o(!t,"Cannot set single message template"),c;o(typeof c=="object"&&!Array.isArray(c),"Invalid message options"),t=t?v(t):{};for(let a in c){const s=c[a];if(a==="root"||y.isTemplate(s)){t[a]=s;continue}if(typeof s=="string"){t[a]=new y(s);continue}o(typeof s=="object"&&!Array.isArray(s),"Invalid message for",a);const n=a;for(a in t[n]=t[n]||{},s){const i=s[a];a==="root"||y.isTemplate(i)?t[n][a]=i:(o(typeof i=="string","Invalid message for",a,"in",n),t[n][a]=new y(i))}}return t},x.decompile=function(c){const t={};for(let a in c){const s=c[a];if(a==="root"){t.root=s;continue}if(y.isTemplate(s)){t[a]=s.describe({compact:!0});continue}const n=a;for(a in t[n]={},s){const i=s[a];a!=="root"?t[n][a]=i.describe({compact:!0}):t[n].root=i}}return t},x.merge=function(c,t){if(!c)return x.compile(t);if(!t)return c;if(typeof t=="string")return new y(t);if(y.isTemplate(t))return t;const a=v(c);for(let s in t){const n=t[s];if(s==="root"||y.isTemplate(n)){a[s]=n;continue}if(typeof n=="string"){a[s]=new y(n);continue}o(typeof n=="object"&&!Array.isArray(n),"Invalid message for",s);const i=s;for(s in a[i]=a[i]||{},n){const h=n[s];s==="root"||y.isTemplate(h)?a[i][s]=h:(o(typeof h=="string","Invalid message for",s,"in",i),a[i][s]=new y(h))}}return a}},2294:(_,x,g)=>{const o=g(375),v=g(8160),y=g(6133),c={};x.Ids=c.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const t=new c.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(const[a,s]of t._byId.entries())o(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,s);for(const[a,s]of t._byKey.entries())o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,s)}fork(t,a,s){const n=this._collect(t);n.push({schema:s});const i=n.shift();let h={id:i.id,schema:a(i.schema)};o(v.isSchema(h.schema),"adjuster function failed to return a joi schema type");for(const l of n)h={id:l.id,schema:c.fork(l.schema,h.id,h.schema)};return h.schema}labels(t,a=[]){const s=t[0],n=this._get(s);if(!n)return[...a,...t].join(".");const i=t.slice(1);return a=[...a,n.schema._flags.label||s],i.length?n.schema._ids.labels(i,a):a.join(".")}reach(t,a=[]){const s=t[0],n=this._get(s);o(n,"Schema does not contain path",[...a,...t].join("."));const i=t.slice(1);return i.length?n.schema._ids.reach(i,[...a,s]):n.schema}register(t,{key:a}={}){if(!t||!v.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);const s=t._flags.id;if(s){const n=this._byId.get(s);o(!n||n.schema===t,"Cannot add different schemas with the same id:",s),o(!this._byKey.has(s),"Schema id conflicts with existing key:",s),this._byId.set(s,{schema:t,id:s})}a&&(o(!this._byKey.has(a),"Schema already contains key:",a),o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:t,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,a=[],s=[]){const n=t[0],i=this._get(n);o(i,"Schema does not contain path",[...a,...t].join(".")),s=[i,...s];const h=t.slice(1);return h.length?i.schema._ids._collect(h,[...a,n],s):s}_get(t){return this._byId.get(t)||this._byKey.get(t)}},c.fork=function(t,a,s){const n=x.schema(t,{each:(i,{key:h})=>{if(a===(i._flags.id||h))return s},ref:!1});return n?n.$_mutateRebuild():t},x.schema=function(t,a){let s;for(const n in t._flags){if(n[0]==="_")continue;const i=c.scan(t._flags[n],{source:"flags",name:n},a);i!==void 0&&(s=s||t.clone(),s._flags[n]=i)}for(let n=0;n<t._rules.length;++n){const i=t._rules[n],h=c.scan(i.args,{source:"rules",name:i.name},a);if(h!==void 0){s=s||t.clone();const l=Object.assign({},i);l.args=h,s._rules[n]=l,s._singleRules.get(i.name)===i&&s._singleRules.set(i.name,l)}}for(const n in t.$_terms){if(n[0]==="_")continue;const i=c.scan(t.$_terms[n],{source:"terms",name:n},a);i!==void 0&&(s=s||t.clone(),s.$_terms[n]=i)}return s},c.scan=function(t,a,s,n,i){const h=n||[];if(t===null||typeof t!="object")return;let l;if(Array.isArray(t)){for(let u=0;u<t.length;++u){const p=a.source==="terms"&&a.name==="keys"&&t[u].key,S=c.scan(t[u],a,s,[u,...h],p);S!==void 0&&(l=l||t.slice(),l[u]=S)}return l}if(s.schema!==!1&&v.isSchema(t)||s.ref!==!1&&y.isRef(t)){const u=s.each(t,{...a,path:h,key:i});return u===t?void 0:u}for(const u in t){if(u[0]==="_")continue;const p=c.scan(t[u],a,s,[u,...h],i);p!==void 0&&(l=l||Object.assign({},t),l[u]=p)}return l}},6133:(_,x,g)=>{const o=g(375),v=g(8571),y=g(9621),c=g(8160);let t;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};x.create=function(s,n={}){o(typeof s=="string","Invalid reference key:",s),c.assertOptions(n,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!n.prefix||typeof n.prefix=="object","options.prefix must be of type object");const i=Object.assign({},a.defaults,n);delete i.prefix;const h=i.separator,l=a.context(s,h,n.prefix);if(i.type=l.type,s=l.key,i.type==="value")if(l.root&&(o(!h||s[0]!==h,"Cannot specify relative path with root prefix"),i.ancestor="root",s||(s=null)),h&&h===s)s=null,i.ancestor=0;else if(i.ancestor!==void 0)o(!h||!s||s[0]!==h,"Cannot combine prefix with ancestor option");else{const[u,p]=a.ancestor(s,h);p&&(s=s.slice(p))===""&&(s=null),i.ancestor=u}return i.path=h?s===null?[]:s.split(h):[s],new a.Ref(i)},x.in=function(s,n={}){return x.create(s,{...n,in:!0})},x.isRef=function(s){return!!s&&!!s[c.symbols.ref]},a.Ref=class{constructor(s){o(typeof s=="object","Invalid reference construction"),c.assertOptions(s,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(s.separator)||typeof s.separator=="string"&&s.separator.length===1,"Invalid separator"),o(!s.adjust||typeof s.adjust=="function","options.adjust must be a function"),o(!s.map||Array.isArray(s.map),"options.map must be an array"),o(!s.map||!s.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,s),o(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(s,n,i,h,l={}){return o(!this.in||l.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(i.context,n,l):this.type==="local"?this._resolve(h,n,l):this.ancestor?this.ancestor==="root"?this._resolve(n.ancestors[n.ancestors.length-1],n,l):(o(this.ancestor<=n.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(n.ancestors[this.ancestor-1],n,l)):this._resolve(s,n,l)}_resolve(s,n,i){let h;if(this.type==="value"&&n.mainstay.shadow&&i.shadow!==!1&&(h=n.mainstay.shadow.get(this.absolute(n))),h===void 0&&(h=y(s,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(h=this.adjust(h)),this.map){const l=this.map.get(h);l!==void 0&&(h=l)}return n.mainstay&&n.mainstay.tracer.resolve(n,this,h),h}toString(){return this.display}absolute(s){return[...s.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const s={path:this.path};this.type!=="value"&&(s.type=this.type),this.separator!=="."&&(s.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(s.ancestor=this.ancestor),this.map&&(s.map=[...this.map]);for(const n of["adjust","iterables","render"])this[n]!==null&&this[n]!==void 0&&(s[n]=this[n]);return this.in!==!1&&(s.in=!0),{ref:s}}updateDisplay(){const s=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${s}`);if(!this.separator)return void(this.display=`ref:${s}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${s}`);if(this.ancestor==="root")return void(this.display=`ref:root:${s}`);if(this.ancestor===1)return void(this.display=`ref:${s||".."}`);const n=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${n}${s||""}`}},a.Ref.prototype[c.symbols.ref]=!0,x.build=function(s){return(s=Object.assign({},a.defaults,s)).type==="value"&&s.ancestor===void 0&&(s.ancestor=1),new a.Ref(s)},a.context=function(s,n,i={}){if(s=s.trim(),i){const h=i.global===void 0?"$":i.global;if(h!==n&&s.startsWith(h))return{key:s.slice(h.length),type:"global"};const l=i.local===void 0?"#":i.local;if(l!==n&&s.startsWith(l))return{key:s.slice(l.length),type:"local"};const u=i.root===void 0?"/":i.root;if(u!==n&&s.startsWith(u))return{key:s.slice(u.length),type:"value",root:!0}}return{key:s,type:"value"}},a.ancestor=function(s,n){if(!n)return[1,0];if(s[0]!==n)return[1,0];if(s[1]!==n)return[0,1];let i=2;for(;s[i]===n;)++i;return[i-1,i]},x.toSibling=0,x.toParent=1,x.Manager=class{constructor(){this.refs=[]}register(s,n){if(s)if(n=n===void 0?x.toParent:n,Array.isArray(s))for(const i of s)this.register(i,n);else if(c.isSchema(s))for(const i of s._refs.refs)i.ancestor-n>=0&&this.refs.push({ancestor:i.ancestor-n,root:i.root});else x.isRef(s)&&s.type==="value"&&s.ancestor-n>=0&&this.refs.push({ancestor:s.ancestor-n,root:s.root}),t=t||g(3328),t.isTemplate(s)&&this.register(s.refs(),n)}get length(){return this.refs.length}clone(){const s=new x.Manager;return s.refs=v(this.refs),s}reset(){this.refs=[]}roots(){return this.refs.filter(s=>!s.ancestor).map(s=>s.root)}}},3378:(_,x,g)=>{const o=g(5107),v={};v.wrap=o.string().min(1).max(2).allow(!1),x.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:v.wrap,array:v.wrap,string:v.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),v.nameRx=/^[a-zA-Z0-9]\w*$/,v.rule=o.object({alias:o.array().items(o.string().pattern(v.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(v.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),x.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(v.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(v.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(v.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(v.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(v.nameRx,v.rule),terms:o.object().pattern(v.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),x.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),v.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},v.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),v.desc.buffer,v.desc.func,v.desc.ref,v.desc.regex,v.desc.special,v.desc.template,v.desc.value,o.link("/")]),v.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.symbol(),v.desc.buffer,v.desc.func,v.desc.override,v.desc.ref,v.desc.regex,v.desc.template,v.desc.value),v.desc.messages=o.object().pattern(/.+/,[o.string(),v.desc.template,o.object().pattern(/.+/,[o.string(),v.desc.template])]),x.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:v.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),v.desc.ref],wrap:{label:v.wrap,array:v.wrap}},externals:o.boolean(),messages:v.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:v.desc.values,invalid:v.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),v.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:v.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(_,x,g)=>{const o=g(8571),v=g(9621),y=g(8160),c={value:Symbol("value")};_.exports=c.State=class{constructor(t,a,s){this.path=t,this.ancestors=a,this.mainstay=s.mainstay,this.schemas=s.schemas,this.debug=null}localize(t,a=null,s=null){const n=new c.State(t,a,this);return s&&n.schemas&&(n.schemas=[c.schemas(s),...n.schemas]),n}nest(t,a){const s=new c.State(this.path,this.ancestors,this);return s.schemas=s.schemas&&[c.schemas(t),...s.schemas],s.debug=a,s}shadow(t,a){this.mainstay.shadow=this.mainstay.shadow||new c.Shadow,this.mainstay.shadow.set(this.path,t,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},c.schemas=function(t){return y.isSchema(t)?{schema:t}:t},c.Shadow=class{constructor(){this._values=null}set(t,a,s){if(!t.length||s==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let n=this._values;for(let i=0;i<t.length;++i){const h=t[i];let l=n.get(h);l||(l=new Map,n.set(h,l)),n=l}n[c.value]=a}get(t){const a=this.node(t);if(a)return a[c.value]}node(t){if(this._values)return v(this._values,t,{iterables:!0})}override(t,a){if(!this._values)return;const s=t.slice(0,-1),n=t[t.length-1],i=v(this._values,s,{iterables:!0});a?i.set(n,a):i&&i.delete(n)}}},3328:(_,x,g)=>{const o=g(375),v=g(8571),y=g(5277),c=g(1447),t=g(8160),a=g(6354),s=g(6133),n={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};_.exports=n.Template=class{constructor(i,h){if(o(typeof i=="string","Template source must be a string"),o(!i.includes("\0")&&!i.includes(""),"Template source cannot contain reserved control characters"),this.source=i,this.rendered=i,this._template=null,h){const{functions:l,...u}=h;this._settings=Object.keys(u).length?v(u):void 0,this._functions=l,this._functions&&(o(Object.keys(this._functions).every(p=>typeof p=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(p=>typeof p=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const i=n.encode(this.source),h=n.split(i);let l=!1;const u=[],p=h.shift();p&&u.push(p);for(const S of h){const b=S[0]!=="{",O=b?"}":"}}",R=S.indexOf(O);if(R===-1||S[1]==="{"){u.push(`{${n.decode(S)}`);continue}let f=S.slice(b?0:1,R);const E=f[0]===":";E&&(f=f.slice(1));const j=this._ref(n.decode(f),{raw:b,wrapped:E});u.push(j),typeof j!="string"&&(l=!0);const L=S.slice(R+O.length);L&&u.push(n.decode(L))}l?this._template=u:this.rendered=u.join("")}static date(i,h){return n.dateFormat[h.dateFormat].call(i)}describe(i={}){if(!this._settings&&i.compact)return this.source;const h={template:this.source};return this._settings&&(h.options=this._settings),this._functions&&(h.functions=this._functions),h}static build(i){return new n.Template(i.template,i.options||i.functions?{...i.options,functions:i.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(i){return!!i&&!!i[t.symbols.template]}refs(){if(!this._template)return;const i=[];for(const h of this._template)typeof h!="string"&&i.push(...h.refs);return i}resolve(i,h,l,u){return this._template&&this._template.length===1?this._part(this._template[0],i,h,l,u,{}):this.render(i,h,l,u)}_part(i,...h){return i.ref?i.ref.resolve(...h):i.formula.evaluate(h)}render(i,h,l,u,p={}){if(!this.isDynamic())return this.rendered;const S=[];for(const b of this._template)if(typeof b=="string")S.push(b);else{const O=this._part(b,i,h,l,u,p),R=n.stringify(O,i,h,l,u,p);if(R!==void 0){const f=b.raw||(p.errors&&p.errors.escapeHtml)===!1?R:y(R);S.push(n.wrap(f,b.wrapped&&l.errors.wrap.label))}}return S.join("")}_ref(i,{raw:h,wrapped:l}){const u=[],p=b=>{const O=s.create(b,this._settings);return u.push(O),R=>{const f=O.resolve(...R);return f!==void 0?f:null}};try{const b=this._functions?{...n.functions,...this._functions}:n.functions;var S=new c.Parser(i,{reference:p,functions:b,constants:n.constants})}catch(b){throw b.message=`Invalid template variable "${i}" fails due to: ${b.message}`,b}if(S.single){if(S.single.type==="reference"){const b=u[0];return{ref:b,raw:h,refs:u,wrapped:l||b.type==="local"&&b.key==="label"}}return n.stringify(S.single.value)}return{formula:S,raw:h,refs:u}}toString(){return this.source}},n.Template.prototype[t.symbols.template]=!0,n.Template.prototype.isImmutable=!0,n.encode=function(i){return i.replace(/\\(\{+)/g,(h,l)=>n.opens.slice(0,l.length)).replace(/\\(\}+)/g,(h,l)=>n.closes.slice(0,l.length))},n.decode=function(i){return i.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},n.split=function(i){const h=[];let l="";for(let u=0;u<i.length;++u){const p=i[u];if(p==="{"){let S="";for(;u+1<i.length&&i[u+1]==="{";)S+="{",++u;h.push(l),l=S}else l+=p}return h.push(l),h},n.wrap=function(i,h){return h?h.length===1?`${h}${i}${h}`:`${h[0]}${i}${h[1]}`:i},n.stringify=function(i,h,l,u,p,S={}){const b=typeof i,O=u&&u.errors&&u.errors.wrap||{};let R=!1;if(s.isRef(i)&&i.render&&(R=i.in,i=i.resolve(h,l,u,p,{in:i.in,...S})),i===null)return"null";if(b==="string")return n.wrap(i,S.arrayItems&&O.string);if(b==="number"||b==="function"||b==="symbol")return i.toString();if(b!=="object")return JSON.stringify(i);if(i instanceof Date)return n.Template.date(i,u);if(i instanceof Map){const E=[];for(const[j,L]of i.entries())E.push(`${j.toString()} -> ${L.toString()}`);i=E}if(!Array.isArray(i))return i.toString();const f=[];for(const E of i)f.push(n.stringify(E,h,l,u,p,{arrayItems:!0,...S}));return n.wrap(f.join(", "),!R&&O.array)},n.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},n.functions={if:(i,h,l)=>i?h:l,length:i=>typeof i=="string"?i.length:i&&typeof i=="object"?Array.isArray(i)?i.length:Object.keys(i).length:null,msg(i){const[h,l,u,p,S]=this,b=S.messages;if(!b)return"";const O=a.template(h,b[0],i,l,u)||a.template(h,b[1],i,l,u);return O?O.render(h,l,u,p,S):""},number:i=>typeof i=="number"?i:typeof i=="string"?parseFloat(i):typeof i=="boolean"?i?1:0:i instanceof Date?i.getTime():null}},4946:(_,x,g)=>{const o=g(375),v=g(1687),y=g(8068),c=g(8160),t=g(3292),a=g(6354),s=g(6133),n={};_.exports=y.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:s.toSibling}},args:(i,...h)=>h.length===1&&Array.isArray(h[0])?i.try(...h[0]):i.try(...h),validate(i,h){const{schema:l,error:u,state:p,prefs:S}=h;if(l._flags.match){const O=[],R=[];for(let E=0;E<l.$_terms.matches.length;++E){const j=l.$_terms.matches[E],L=p.nest(j.schema,`match.${E}`);L.snapshot();const B=j.schema.$_validate(i,L,S);B.errors?(R.push(B.errors),L.restore()):(O.push(B.value),L.commit())}if(O.length===0)return{errors:u("alternatives.any",{details:R.map(E=>a.details(E,{override:!1}))})};if(l._flags.match==="one")return O.length===1?{value:O[0]}:{errors:u("alternatives.one")};if(O.length!==l.$_terms.matches.length)return{errors:u("alternatives.all",{details:R.map(E=>a.details(E,{override:!1}))})};const f=E=>E.$_terms.matches.some(j=>j.schema.type==="object"||j.schema.type==="alternatives"&&f(j.schema));return f(l)?{value:O.reduce((E,j)=>v(E,j,{mergeArrays:!1}))}:{value:O[O.length-1]}}const b=[];for(let O=0;O<l.$_terms.matches.length;++O){const R=l.$_terms.matches[O];if(R.schema){const j=p.nest(R.schema,`match.${O}`);j.snapshot();const L=R.schema.$_validate(i,j,S);if(!L.errors)return j.commit(),L;j.restore(),b.push({schema:R.schema,reports:L.errors});continue}const f=R.ref?R.ref.resolve(i,p,S):i,E=R.is?[R]:R.switch;for(let j=0;j<E.length;++j){const L=E[j],{is:B,then:z,otherwise:ee}=L,ne=`match.${O}${R.switch?"."+j:""}`;if(B.$_match(f,p.nest(B,`${ne}.is`),S)){if(z)return z.$_validate(i,p.nest(z,`${ne}.then`),S)}else if(ee)return ee.$_validate(i,p.nest(ee,`${ne}.otherwise`),S)}}return n.errors(b,h)},rules:{conditional:{method(i,h){o(!this._flags._endedSwitch,"Unreachable condition"),o(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),o(h.break===void 0,"Cannot use break option with alternatives conditional");const l=this.clone(),u=t.when(l,i,h),p=u.is?[u]:u.switch;for(const S of p)if(S.then&&S.otherwise){l.$_setFlag("_endedSwitch",!0,{clone:!1});break}return l.$_terms.matches.push(u),l.$_mutateRebuild()}},match:{method(i){if(o(["any","one","all"].includes(i),"Invalid alternatives match mode",i),i!=="any")for(const h of this.$_terms.matches)o(h.schema,"Cannot combine match mode",i,"with conditional rules");return this.$_setFlag("match",i)}},try:{method(...i){o(i.length,"Missing alternative schemas"),c.verifyFlat(i,"try"),o(!this._flags._endedSwitch,"Unreachable condition");const h=this.clone();for(const l of i)h.$_terms.matches.push({schema:h.$_compile(l)});return h.$_mutateRebuild()}}},overrides:{label(i){return this.$_parent("label",i).$_modify({each:(h,l)=>l.path[0]!=="is"&&typeof h._flags.label!="string"?h.label(i):void 0,ref:!1})}},rebuild(i){i.$_modify({each:h=>{c.isSchema(h)&&h.type==="array"&&i.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(i,h){if(h.matches)for(const l of h.matches){const{schema:u,ref:p,is:S,not:b,then:O,otherwise:R}=l;i=u?i.try(u):p?i.conditional(p,{is:S,then:O,not:b,otherwise:R,switch:l.switch}):i.conditional(S,{then:O,otherwise:R})}return i}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),n.errors=function(i,{error:h,state:l}){if(!i.length)return{errors:h("alternatives.any")};if(i.length===1)return{errors:i[0].reports};const u=new Set,p=[];for(const{reports:S,schema:b}of i){if(S.length>1)return n.unmatched(i,h);const O=S[0];if(O instanceof a.Report==0)return n.unmatched(i,h);if(O.state.path.length!==l.path.length){p.push({type:b.type,report:O});continue}if(O.code==="any.only"){for(const E of O.local.valids)u.add(E);continue}const[R,f]=O.code.split(".");f==="base"?u.add(R):p.push({type:b.type,report:O})}return p.length?p.length===1?{errors:p[0].report}:n.unmatched(i,h):{errors:h("alternatives.types",{types:[...u]})}},n.unmatched=function(i,h){const l=[];for(const u of i)l.push(...u.reports);return{errors:h("alternatives.match",a.details(l,{override:!1}))}}},8068:(_,x,g)=>{const o=g(375),v=g(7629),y=g(8160),c=g(6914);_.exports=v.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,a){return o(typeof t=="function","Method must be a function"),o(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:a}})},validate(t,a,{method:s}){try{return s(t,a)}catch(n){return a.error("any.custom",{error:n})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){o(y.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(t),a.$_mutateRegister(t),a}},warning:{method(t,a){return o(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:a},warn:!0})},validate:(t,a,{code:s,local:n})=>a.error(s,n),args:["code","local"],multi:!0}},modifiers:{keep(t,a=!0){t.keep=a},message(t,a){t.message=c.compile(a)},warn(t,a=!0){t.warn=a}},manifest:{build(t,a){for(const s in a){const n=a[s];if(["examples","externals","metas","notes","tags"].includes(s))for(const i of n)t=t[s.slice(0,-1)](i);else if(s!=="alterations")if(s!=="whens"){if(s==="shared")for(const i of n)t=t.shared(i)}else for(const i of n){const{ref:h,is:l,not:u,then:p,otherwise:S,concat:b}=i;t=b?t.concat(b):h?t.when(h,{is:l,not:u,then:p,otherwise:S,switch:i.switch,break:i.break}):t.when(l,{then:p,otherwise:S,break:i.break})}else{const i={};for(const{target:h,adjuster:l}of n)i[h]=l;t=t.alter(i)}}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(_,x,g)=>{const o=g(375),v=g(9474),y=g(9621),c=g(8068),t=g(8160),a=g(3292),s={};_.exports=c.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(n,{schema:i,state:h,prefs:l}){if(!Array.isArray(n))return;const u=i.$_getRule("sort");return u?s.sort(i,n,u.args.options,h,l):void 0}},validate(n,{schema:i,error:h}){if(!Array.isArray(n)){if(i._flags.single){const l=[n];return l[t.symbols.arraySingle]=!0,{value:l}}return{errors:h("array.base")}}if(i.$_getRule("items")||i.$_terms.externals)return{value:n.slice()}},rules:{has:{method(n){n=this.$_compile(n,{appendPath:!0});const i=this.$_addRule({name:"has",args:{schema:n}});return i.$_mutateRegister(n),i},validate(n,{state:i,prefs:h,error:l},{schema:u}){const p=[n,...i.ancestors];for(let b=0;b<n.length;++b){const O=i.localize([...i.path,b],p,u);if(u.$_match(n[b],O,h))return n}const S=u._flags.label;return S?l("array.hasKnown",{patternLabel:S}):l("array.hasUnknown",null)},multi:!0},items:{method(...n){t.verifyFlat(n,"items");const i=this.$_addRule("items");for(let h=0;h<n.length;++h){const l=t.tryWithPath(()=>this.$_compile(n[h]),h,{append:!0});i.$_terms.items.push(l)}return i.$_mutateRebuild()},validate(n,{schema:i,error:h,state:l,prefs:u,errorsArray:p}){const S=i.$_terms._requireds.slice(),b=i.$_terms.ordered.slice(),O=[...i.$_terms._inclusions,...S],R=!n[t.symbols.arraySingle];delete n[t.symbols.arraySingle];const f=p();let E=n.length;for(let j=0;j<E;++j){const L=n[j];let B=!1,z=!1;const ee=R?j:new Number(j),ne=[...l.path,ee];if(!i._flags.sparse&&L===void 0){if(f.push(h("array.sparse",{key:ee,path:ne,pos:j,value:void 0},l.localize(ne))),u.abortEarly)return f;b.shift();continue}const G=[n,...l.ancestors];for(const Q of i.$_terms._exclusions)if(Q.$_match(L,l.localize(ne,G,Q),u,{presence:"ignore"})){if(f.push(h("array.excludes",{pos:j,value:L},l.localize(ne))),u.abortEarly)return f;B=!0,b.shift();break}if(B)continue;if(i.$_terms.ordered.length){if(b.length){const Q=b.shift(),ve=Q.$_validate(L,l.localize(ne,G,Q),u);if(ve.errors){if(f.push(...ve.errors),u.abortEarly)return f}else if(Q._flags.result==="strip")s.fastSplice(n,j),--j,--E;else{if(!i._flags.sparse&&ve.value===void 0){if(f.push(h("array.sparse",{key:ee,path:ne,pos:j,value:void 0},l.localize(ne))),u.abortEarly)return f;continue}n[j]=ve.value}continue}if(!i.$_terms.items.length){if(f.push(h("array.orderedLength",{pos:j,limit:i.$_terms.ordered.length})),u.abortEarly)return f;break}}const oe=[];let H=S.length;for(let Q=0;Q<H;++Q){const ve=l.localize(ne,G,S[Q]);ve.snapshot();const ye=S[Q].$_validate(L,ve,u);if(oe[Q]=ye,!ye.errors){if(ve.commit(),n[j]=ye.value,z=!0,s.fastSplice(S,Q),--Q,--H,!i._flags.sparse&&ye.value===void 0&&(f.push(h("array.sparse",{key:ee,path:ne,pos:j,value:void 0},l.localize(ne))),u.abortEarly))return f;break}ve.restore()}if(z)continue;const xe=u.stripUnknown&&!!u.stripUnknown.arrays||!1;H=O.length;for(const Q of O){let ve;const ye=S.indexOf(Q);if(ye!==-1)ve=oe[ye];else{const $e=l.localize(ne,G,Q);if($e.snapshot(),ve=Q.$_validate(L,$e,u),!ve.errors){$e.commit(),Q._flags.result==="strip"?(s.fastSplice(n,j),--j,--E):i._flags.sparse||ve.value!==void 0?n[j]=ve.value:(f.push(h("array.sparse",{key:ee,path:ne,pos:j,value:void 0},l.localize(ne))),B=!0),z=!0;break}$e.restore()}if(H===1){if(xe){s.fastSplice(n,j),--j,--E,z=!0;break}if(f.push(...ve.errors),u.abortEarly)return f;B=!0;break}}if(!B&&(i.$_terms._inclusions.length||i.$_terms._requireds.length)&&!z){if(xe){s.fastSplice(n,j),--j,--E;continue}if(f.push(h("array.includes",{pos:j,value:L},l.localize(ne))),u.abortEarly)return f}}return S.length&&s.fillMissedErrors(i,f,S,n,l,u),b.length&&(s.fillOrderedErrors(i,f,b,n,l,u),f.length||s.fillDefault(b,n,l,u)),f.length?f:n},priority:!0,manifest:!1},length:{method(n){return this.$_addRule({name:"length",args:{limit:n},operator:"="})},validate:(n,i,{limit:h},{name:l,operator:u,args:p})=>t.compare(n.length,h,u)?n:i.error("array."+l,{limit:p.limit,value:n}),args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"}]},max:{method(n){return this.$_addRule({name:"max",method:"length",args:{limit:n},operator:"<="})}},min:{method(n){return this.$_addRule({name:"min",method:"length",args:{limit:n},operator:">="})}},ordered:{method(...n){t.verifyFlat(n,"ordered");const i=this.$_addRule("items");for(let h=0;h<n.length;++h){const l=t.tryWithPath(()=>this.$_compile(n[h]),h,{append:!0});s.validateSingle(l,i),i.$_mutateRegister(l),i.$_terms.ordered.push(l)}return i.$_mutateRebuild()}},single:{method(n){const i=n===void 0||!!n;return o(!i||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",i)}},sort:{method(n={}){t.assertOptions(n,["by","order"]);const i={order:n.order||"ascending"};return n.by&&(i.by=a.ref(n.by,{ancestor:0}),o(!i.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:i}})},validate(n,{error:i,state:h,prefs:l,schema:u},{options:p}){const{value:S,errors:b}=s.sort(u,n,p,h,l);if(b)return b;for(let O=0;O<n.length;++O)if(n[O]!==S[O])return i("array.sort",{order:p.order,by:p.by?p.by.key:"value"});return n},convert:!0},sparse:{method(n){const i=n===void 0||!!n;return this._flags.sparse===i?this:(i?this.clone():this.$_addRule("items")).$_setFlag("sparse",i,{clone:!1})}},unique:{method(n,i={}){o(!n||typeof n=="function"||typeof n=="string","comparator must be a function or a string"),t.assertOptions(i,["ignoreUndefined","separator"]);const h={name:"unique",args:{options:i,comparator:n}};if(n)if(typeof n=="string"){const l=t.default(i.separator,".");h.path=l?n.split(l):[n]}else h.comparator=n;return this.$_addRule(h)},validate(n,{state:i,error:h,schema:l},{comparator:u,options:p},{comparator:S,path:b}){const O={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},R=S||v,f=p.ignoreUndefined;for(let E=0;E<n.length;++E){const j=b?y(n[E],b):n[E],L=S?O.custom:O[typeof j];if(o(L,"Failed to find unique map container for type",typeof j),L instanceof Map){const B=L.entries();let z;for(;!(z=B.next()).done;)if(R(z.value[0],j)){const ee=i.localize([...i.path,E],[n,...i.ancestors]),ne={pos:E,value:n[E],dupePos:z.value[1],dupeValue:n[z.value[1]]};return b&&(ne.path=u),h("array.unique",ne,ee)}L.set(j,E)}else{if((!f||j!==void 0)&&L[j]!==void 0){const B={pos:E,value:n[E],dupePos:L[j],dupeValue:n[L[j]]};return b&&(B.path=u),h("array.unique",B,i.localize([...i.path,E],[n,...i.ancestors]))}L[j]=E}}return n},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(n,i)=>new Set(n)}},rebuild(n){n.$_terms._inclusions=[],n.$_terms._exclusions=[],n.$_terms._requireds=[];for(const i of n.$_terms.items)s.validateSingle(i,n),i._flags.presence==="required"?n.$_terms._requireds.push(i):i._flags.presence==="forbidden"?n.$_terms._exclusions.push(i):n.$_terms._inclusions.push(i);for(const i of n.$_terms.ordered)s.validateSingle(i,n)},manifest:{build:(n,i)=>(i.items&&(n=n.items(...i.items)),i.ordered&&(n=n.ordered(...i.ordered)),n)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),s.fillMissedErrors=function(n,i,h,l,u,p){const S=[];let b=0;for(const O of h){const R=O._flags.label;R?S.push(R):++b}S.length?b?i.push(n.$_createError("array.includesRequiredBoth",l,{knownMisses:S,unknownMisses:b},u,p)):i.push(n.$_createError("array.includesRequiredKnowns",l,{knownMisses:S},u,p)):i.push(n.$_createError("array.includesRequiredUnknowns",l,{unknownMisses:b},u,p))},s.fillOrderedErrors=function(n,i,h,l,u,p){const S=[];for(const b of h)b._flags.presence==="required"&&S.push(b);S.length&&s.fillMissedErrors(n,i,S,l,u,p)},s.fillDefault=function(n,i,h,l){const u=[];let p=!0;for(let S=n.length-1;S>=0;--S){const b=n[S],O=[i,...h.ancestors],R=b.$_validate(void 0,h.localize(h.path,O,b),l).value;if(p){if(R===void 0)continue;p=!1}u.unshift(R)}u.length&&i.push(...u)},s.fastSplice=function(n,i){let h=i;for(;h<n.length;)n[h++]=n[h];--n.length},s.validateSingle=function(n,i){(n.type==="array"||n._flags._arrayItems)&&(o(!i._flags.single,"Cannot specify array item with single rule enabled"),i.$_setFlag("_arrayItems",!0,{clone:!1}))},s.sort=function(n,i,h,l,u){const p=h.order==="ascending"?1:-1,S=-1*p,b=p,O=(R,f)=>{let E=s.compare(R,f,S,b);if(E!==null||(h.by&&(R=h.by.resolve(R,l,u),f=h.by.resolve(f,l,u)),E=s.compare(R,f,S,b),E!==null))return E;const j=typeof R;if(j!==typeof f)throw n.$_createError("array.sort.mismatching",i,null,l,u);if(j!=="number"&&j!=="string")throw n.$_createError("array.sort.unsupported",i,{type:j},l,u);return j==="number"?(R-f)*p:R<f?S:b};try{return{value:i.slice().sort(O)}}catch(R){return{errors:R}}},s.compare=function(n,i,h,l){return n===i?0:n===void 0?1:i===void 0?-1:n===null?l:i===null?h:null}},4937:(_,x,g)=>{const o=g(375),v=g(8068),y=g(8160),c=g(2036),t={isBool:function(a){return typeof a=="boolean"}};_.exports=v.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:s}){if(typeof a!="boolean"){if(typeof a=="string"){const n=s._flags.sensitive?a:a.toLowerCase();a=n==="true"||n!=="false"&&a}return typeof a!="boolean"&&(a=s.$_terms.truthy&&s.$_terms.truthy.has(a,null,null,!s._flags.sensitive)||(!s.$_terms.falsy||!s.$_terms.falsy.has(a,null,null,!s._flags.sensitive))&&a),{value:a}}},validate(a,{error:s}){if(typeof a!="boolean")return{value:a,errors:s("boolean.base")}},rules:{truthy:{method(...a){y.verifyFlat(a,"truthy");const s=this.clone();s.$_terms.truthy=s.$_terms.truthy||new c;for(let n=0;n<a.length;++n){const i=a[n];o(i!==void 0,"Cannot call truthy with undefined"),s.$_terms.truthy.add(i)}return s}},falsy:{method(...a){y.verifyFlat(a,"falsy");const s=this.clone();s.$_terms.falsy=s.$_terms.falsy||new c;for(let n=0;n<a.length;++n){const i=a[n];o(i!==void 0,"Cannot call falsy with undefined"),s.$_terms.falsy.add(i)}return s}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:t.isBool,to:(a,s)=>a?1:0},string:{from:t.isBool,to:(a,s)=>a?"true":"false"}},manifest:{build:(a,s)=>(s.truthy&&(a=a.truthy(...s.truthy)),s.falsy&&(a=a.falsy(...s.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(_,x,g)=>{const o=g(375),v=g(8068),y=g(8160),c=g(3328),t={isDate:function(a){return a instanceof Date}};_.exports=v.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:s})=>({value:t.parse(a,s._flags.format)||a})},validate(a,{schema:s,error:n,prefs:i}){if(a instanceof Date&&!isNaN(a.getTime()))return;const h=s._flags.format;return i.convert&&h&&typeof a=="string"?{value:a,errors:n("date.format",{format:h})}:{value:a,errors:n("date.base")}},rules:{compare:{method:!1,validate(a,s,{date:n},{name:i,operator:h,args:l}){const u=n==="now"?Date.now():n.getTime();return y.compare(a.getTime(),u,h)?a:s.error("date."+i,{limit:l.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:t.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return o(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return o(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:t.isDate,to:(a,s)=>a.getTime()},string:{from:t.isDate,to:(a,{prefs:s})=>c.date(a,s)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),t.parse=function(a,s){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(s==="iso")return y.isIsoDate(a)?t.date(a.toString()):null;const n=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),s){if(s==="javascript")return t.date(1*a);if(s==="unix")return t.date(1e3*a);if(typeof n=="string")return null}return t.date(a)},t.date=function(a){const s=new Date(a);return isNaN(s.getTime())?null:s}},390:(_,x,g)=>{const o=g(375),v=g(7824);_.exports=v.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(y){return o(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:y}})},validate:(y,c,{n:t})=>y.length===t?y:c.error("function.arity",{n:t})},class:{method(){return this.$_addRule("class")},validate:(y,c)=>/^\s*class\s/.test(y.toString())?y:c.error("function.class",{value:y})},minArity:{method(y){return o(Number.isSafeInteger(y)&&y>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:y}})},validate:(y,c,{n:t})=>y.length>=t?y:c.error("function.minArity",{n:t})},maxArity:{method(y){return o(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:y}})},validate:(y,c,{n:t})=>y.length<=t?y:c.error("function.maxArity",{n:t})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(_,x,g)=>{const o=g(978),v=g(375),y=g(8571),c=g(3652),t=g(8068),a=g(8160),s=g(3292),n=g(6354),i=g(6133),h=g(3328),l={renameDefaults:{alias:!1,multiple:!1,override:!1}};_.exports=t.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(u,p)=>u.keys(p),validate(u,{schema:p,error:S,state:b,prefs:O}){if(!u||typeof u!==p.$_property("typeof")||Array.isArray(u))return{value:u,errors:S("object.base",{type:p.$_property("typeof")})};if(!(p.$_terms.renames||p.$_terms.dependencies||p.$_terms.keys||p.$_terms.patterns||p.$_terms.externals))return;u=l.clone(u,O);const R=[];if(p.$_terms.renames&&!l.rename(p,u,b,O,R))return{value:u,errors:R};if(!p.$_terms.keys&&!p.$_terms.patterns&&!p.$_terms.dependencies)return{value:u,errors:R};const f=new Set(Object.keys(u));if(p.$_terms.keys){const E=[u,...b.ancestors];for(const j of p.$_terms.keys){const L=j.key,B=u[L];f.delete(L);const z=b.localize([...b.path,L],E,j),ee=j.schema.$_validate(B,z,O);if(ee.errors){if(O.abortEarly)return{value:u,errors:ee.errors};ee.value!==void 0&&(u[L]=ee.value),R.push(...ee.errors)}else j.schema._flags.result==="strip"||ee.value===void 0&&B!==void 0?delete u[L]:ee.value!==void 0&&(u[L]=ee.value)}}if(f.size||p._flags._hasPatternMatch){const E=l.unknown(p,u,f,R,b,O);if(E)return E}if(p.$_terms.dependencies)for(const E of p.$_terms.dependencies){if(E.key!==null&&l.isPresent(E.options)(E.key.resolve(u,b,O,null,{shadow:!1}))===!1)continue;const j=l.dependencies[E.rel](p,E,u,b,O);if(j){const L=p.$_createError(j.code,u,j.context,b,O);if(O.abortEarly)return{value:u,errors:L};R.push(L)}}return{value:u,errors:R}},rules:{and:{method(...u){return a.verifyFlat(u,"and"),l.dependency(this,"and",null,u)}},append:{method(u){return u==null||Object.keys(u).length===0?this:this.keys(u)}},assert:{method(u,p,S){h.isTemplate(u)||(u=s.ref(u)),v(S===void 0||typeof S=="string","Message must be a string"),p=this.$_compile(p,{appendPath:!0});const b=this.$_addRule({name:"assert",args:{subject:u,schema:p,message:S}});return b.$_mutateRegister(u),b.$_mutateRegister(p),b},validate(u,{error:p,prefs:S,state:b},{subject:O,schema:R,message:f}){const E=O.resolve(u,b,S),j=i.isRef(O)?O.absolute(b):[];return R.$_match(E,b.localize(j,[u,...b.ancestors],R),S)?u:p("object.assert",{subject:O,message:f})},args:["subject","schema","message"],multi:!0},instance:{method(u,p){return v(typeof u=="function","constructor must be a function"),p=p||u.name,this.$_addRule({name:"instance",args:{constructor:u,name:p}})},validate:(u,p,{constructor:S,name:b})=>u instanceof S?u:p.error("object.instance",{type:b,value:u}),args:["constructor","name"]},keys:{method(u){v(u===void 0||typeof u=="object","Object schema must be a valid object"),v(!a.isSchema(u),"Object schema cannot be a joi schema");const p=this.clone();if(u)if(Object.keys(u).length){p.$_terms.keys=p.$_terms.keys?p.$_terms.keys.filter(S=>!u.hasOwnProperty(S.key)):new l.Keys;for(const S in u)a.tryWithPath(()=>p.$_terms.keys.push({key:S,schema:this.$_compile(u[S])}),S)}else p.$_terms.keys=new l.Keys;else p.$_terms.keys=null;return p.$_mutateRebuild()}},length:{method(u){return this.$_addRule({name:"length",args:{limit:u},operator:"="})},validate:(u,p,{limit:S},{name:b,operator:O,args:R})=>a.compare(Object.keys(u).length,S,O)?u:p.error("object."+b,{limit:R.limit,value:u}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(u){return this.$_addRule({name:"max",method:"length",args:{limit:u},operator:"<="})}},min:{method(u){return this.$_addRule({name:"min",method:"length",args:{limit:u},operator:">="})}},nand:{method(...u){return a.verifyFlat(u,"nand"),l.dependency(this,"nand",null,u)}},or:{method(...u){return a.verifyFlat(u,"or"),l.dependency(this,"or",null,u)}},oxor:{method(...u){return l.dependency(this,"oxor",null,u)}},pattern:{method(u,p,S={}){const b=u instanceof RegExp;b||(u=this.$_compile(u,{appendPath:!0})),v(p!==void 0,"Invalid rule"),a.assertOptions(S,["fallthrough","matches"]),b&&v(!u.flags.includes("g")&&!u.flags.includes("y"),"pattern should not use global or sticky mode"),p=this.$_compile(p,{appendPath:!0});const O=this.clone();O.$_terms.patterns=O.$_terms.patterns||[];const R={[b?"regex":"schema"]:u,rule:p};return S.matches&&(R.matches=this.$_compile(S.matches),R.matches.type!=="array"&&(R.matches=R.matches.$_root.array().items(R.matches)),O.$_mutateRegister(R.matches),O.$_setFlag("_hasPatternMatch",!0,{clone:!1})),S.fallthrough&&(R.fallthrough=!0),O.$_terms.patterns.push(R),O.$_mutateRegister(p),O}},ref:{method(){return this.$_addRule("ref")},validate:(u,p)=>i.isRef(u)?u:p.error("object.refType",{value:u})},regex:{method(){return this.$_addRule("regex")},validate:(u,p)=>u instanceof RegExp?u:p.error("object.regex",{value:u})},rename:{method(u,p,S={}){v(typeof u=="string"||u instanceof RegExp,"Rename missing the from argument"),v(typeof p=="string"||p instanceof h,"Invalid rename to argument"),v(p!==u,"Cannot rename key to same name:",u),a.assertOptions(S,["alias","ignoreUndefined","override","multiple"]);const b=this.clone();b.$_terms.renames=b.$_terms.renames||[];for(const O of b.$_terms.renames)v(O.from!==u,"Cannot rename the same key multiple times");return p instanceof h&&b.$_mutateRegister(p),b.$_terms.renames.push({from:u,to:p,options:o(l.renameDefaults,S)}),b}},schema:{method(u="any"){return this.$_addRule({name:"schema",args:{type:u}})},validate:(u,p,{type:S})=>!a.isSchema(u)||S!=="any"&&u.type!==S?p.error("object.schema",{type:S}):u},unknown:{method(u){return this.$_setFlag("unknown",u!==!1)}},with:{method(u,p,S={}){return l.dependency(this,"with",u,p,S)}},without:{method(u,p,S={}){return l.dependency(this,"without",u,p,S)}},xor:{method(...u){return a.verifyFlat(u,"xor"),l.dependency(this,"xor",null,u)}}},overrides:{default(u,p){return u===void 0&&(u=a.symbols.deepDefault),this.$_parent("default",u,p)}},rebuild(u){if(u.$_terms.keys){const p=new c.Sorter;for(const S of u.$_terms.keys)a.tryWithPath(()=>p.add(S,{after:S.schema.$_rootReferences(),group:S.key}),S.key);u.$_terms.keys=new l.Keys(...p.nodes)}},manifest:{build(u,p){if(p.keys&&(u=u.keys(p.keys)),p.dependencies)for(const{rel:S,key:b=null,peers:O,options:R}of p.dependencies)u=l.dependency(u,S,b,O,R);if(p.patterns)for(const{regex:S,schema:b,rule:O,fallthrough:R,matches:f}of p.patterns)u=u.pattern(S||b,O,{fallthrough:R,matches:f});if(p.renames)for(const{from:S,to:b,options:O}of p.renames)u=u.rename(S,b,O);return u}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),l.clone=function(u,p){if(typeof u=="object"){if(p.nonEnumerables)return y(u,{shallow:!0});const b=Object.create(Object.getPrototypeOf(u));return Object.assign(b,u),b}const S=function(...b){return u.apply(this,b)};return S.prototype=y(u.prototype),Object.defineProperty(S,"name",{value:u.name,writable:!1}),Object.defineProperty(S,"length",{value:u.length,writable:!1}),Object.assign(S,u),S},l.dependency=function(u,p,S,b,O){v(S===null||typeof S=="string",p,"key must be a strings"),O||(O=b.length>1&&typeof b[b.length-1]=="object"?b.pop():{}),a.assertOptions(O,["separator","isPresent"]),b=[].concat(b);const R=a.default(O.separator,"."),f=[];for(const j of b)v(typeof j=="string",p,"peers must be strings"),f.push(s.ref(j,{separator:R,ancestor:0,prefix:!1}));S!==null&&(S=s.ref(S,{separator:R,ancestor:0,prefix:!1}));const E=u.clone();return E.$_terms.dependencies=E.$_terms.dependencies||[],E.$_terms.dependencies.push(new l.Dependency(p,S,f,b,O)),E},l.dependencies={and(u,p,S,b,O){const R=[],f=[],E=p.peers.length,j=l.isPresent(p.options);for(const L of p.peers)j(L.resolve(S,b,O,null,{shadow:!1}))===!1?R.push(L.key):f.push(L.key);if(R.length!==E&&f.length!==E)return{code:"object.and",context:{present:f,presentWithLabels:l.keysToLabels(u,f),missing:R,missingWithLabels:l.keysToLabels(u,R)}}},nand(u,p,S,b,O){const R=[],f=l.isPresent(p.options);for(const L of p.peers)f(L.resolve(S,b,O,null,{shadow:!1}))&&R.push(L.key);if(R.length!==p.peers.length)return;const E=p.paths[0],j=p.paths.slice(1);return{code:"object.nand",context:{main:E,mainWithLabel:l.keysToLabels(u,E),peers:j,peersWithLabels:l.keysToLabels(u,j)}}},or(u,p,S,b,O){const R=l.isPresent(p.options);for(const f of p.peers)if(R(f.resolve(S,b,O,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:p.paths,peersWithLabels:l.keysToLabels(u,p.paths)}}},oxor(u,p,S,b,O){const R=[],f=l.isPresent(p.options);for(const j of p.peers)f(j.resolve(S,b,O,null,{shadow:!1}))&&R.push(j.key);if(!R.length||R.length===1)return;const E={peers:p.paths,peersWithLabels:l.keysToLabels(u,p.paths)};return E.present=R,E.presentWithLabels=l.keysToLabels(u,R),{code:"object.oxor",context:E}},with(u,p,S,b,O){const R=l.isPresent(p.options);for(const f of p.peers)if(R(f.resolve(S,b,O,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:p.key.key,mainWithLabel:l.keysToLabels(u,p.key.key),peer:f.key,peerWithLabel:l.keysToLabels(u,f.key)}}},without(u,p,S,b,O){const R=l.isPresent(p.options);for(const f of p.peers)if(R(f.resolve(S,b,O,null,{shadow:!1})))return{code:"object.without",context:{main:p.key.key,mainWithLabel:l.keysToLabels(u,p.key.key),peer:f.key,peerWithLabel:l.keysToLabels(u,f.key)}}},xor(u,p,S,b,O){const R=[],f=l.isPresent(p.options);for(const j of p.peers)f(j.resolve(S,b,O,null,{shadow:!1}))&&R.push(j.key);if(R.length===1)return;const E={peers:p.paths,peersWithLabels:l.keysToLabels(u,p.paths)};return R.length===0?{code:"object.missing",context:E}:(E.present=R,E.presentWithLabels=l.keysToLabels(u,R),{code:"object.xor",context:E})}},l.keysToLabels=function(u,p){return Array.isArray(p)?p.map(S=>u.$_mapLabels(S)):u.$_mapLabels(p)},l.isPresent=function(u){return typeof u.isPresent=="function"?u.isPresent:p=>p!==void 0},l.rename=function(u,p,S,b,O){const R={};for(const f of u.$_terms.renames){const E=[],j=typeof f.from!="string";if(j)for(const L in p){if(p[L]===void 0&&f.options.ignoreUndefined||L===f.to)continue;const B=f.from.exec(L);B&&E.push({from:L,to:f.to,match:B})}else!Object.prototype.hasOwnProperty.call(p,f.from)||p[f.from]===void 0&&f.options.ignoreUndefined||E.push(f);for(const L of E){const B=L.from;let z=L.to;if(z instanceof h&&(z=z.render(p,S,b,L.match)),B!==z){if(!f.options.multiple&&R[z]&&(O.push(u.$_createError("object.rename.multiple",p,{from:B,to:z,pattern:j},S,b)),b.abortEarly)||Object.prototype.hasOwnProperty.call(p,z)&&!f.options.override&&!R[z]&&(O.push(u.$_createError("object.rename.override",p,{from:B,to:z,pattern:j},S,b)),b.abortEarly))return!1;p[B]===void 0?delete p[z]:p[z]=p[B],R[z]=!0,f.options.alias||delete p[B]}}}return!0},l.unknown=function(u,p,S,b,O,R){if(u.$_terms.patterns){let f=!1;const E=u.$_terms.patterns.map(L=>{if(L.matches)return f=!0,[]}),j=[p,...O.ancestors];for(const L of S){const B=p[L],z=[...O.path,L];for(let ee=0;ee<u.$_terms.patterns.length;++ee){const ne=u.$_terms.patterns[ee];if(ne.regex){const H=ne.regex.test(L);if(O.mainstay.tracer.debug(O,"rule",`pattern.${ee}`,H?"pass":"error"),!H)continue}else if(!ne.schema.$_match(L,O.nest(ne.schema,`pattern.${ee}`),R))continue;S.delete(L);const G=O.localize(z,j,{schema:ne.rule,key:L}),oe=ne.rule.$_validate(B,G,R);if(oe.errors){if(R.abortEarly)return{value:p,errors:oe.errors};b.push(...oe.errors)}if(ne.matches&&E[ee].push(L),p[L]=oe.value,!ne.fallthrough)break}}if(f)for(let L=0;L<E.length;++L){const B=E[L];if(!B)continue;const z=u.$_terms.patterns[L].matches,ee=O.localize(O.path,j,z),ne=z.$_validate(B,ee,R);if(ne.errors){const G=n.details(ne.errors,{override:!1});G.matches=B;const oe=u.$_createError("object.pattern.match",p,G,O,R);if(R.abortEarly)return{value:p,errors:oe};b.push(oe)}}}if(S.size&&(u.$_terms.keys||u.$_terms.patterns)){if(R.stripUnknown&&!u._flags.unknown||R.skipFunctions){const f=!(!R.stripUnknown||R.stripUnknown!==!0&&!R.stripUnknown.objects);for(const E of S)f?(delete p[E],S.delete(E)):typeof p[E]=="function"&&S.delete(E)}if(!a.default(u._flags.unknown,R.allowUnknown))for(const f of S){const E=O.localize([...O.path,f],[]),j=u.$_createError("object.unknown",p[f],{child:f},E,R,{flags:!1});if(R.abortEarly)return{value:p,errors:j};b.push(j)}}},l.Dependency=class{constructor(u,p,S,b,O){this.rel=u,this.key=p,this.peers=S,this.paths=b,this.options=O}describe(){const u={rel:this.rel,peers:this.paths};return this.key!==null&&(u.key=this.key.key),this.peers[0].separator!=="."&&(u.options={...u.options,separator:this.peers[0].separator}),this.options.isPresent&&(u.options={...u.options,isPresent:this.options.isPresent}),u}},l.Keys=class extends Array{concat(u){const p=this.slice(),S=new Map;for(let b=0;b<p.length;++b)S.set(p[b].key,b);for(const b of u){const O=b.key,R=S.get(O);R!==void 0?p[R]={key:O,schema:p[R].schema.concat(b.schema)}:p.push(b)}return p}}},8785:(_,x,g)=>{const o=g(375),v=g(8068),y=g(8160),c=g(3292),t=g(6354),a={};_.exports=v.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(s,n)=>s.ref(n),validate(s,{schema:n,state:i,prefs:h}){o(n.$_terms.link,"Uninitialized link schema");const l=a.generate(n,s,i,h),u=n.$_terms.link[0].ref;return l.$_validate(s,i.nest(l,`link:${u.display}:${l.type}`),h)},generate:(s,n,i,h)=>a.generate(s,n,i,h),rules:{ref:{method(s){o(!this.$_terms.link,"Cannot reinitialize schema"),s=c.ref(s),o(s.type==="value"||s.type==="local","Invalid reference type:",s.type),o(s.type==="local"||s.ancestor==="root"||s.ancestor>0,"Link cannot reference itself");const n=this.clone();return n.$_terms.link=[{ref:s}],n}},relative:{method(s=!0){return this.$_setFlag("relative",s)}}},overrides:{concat(s){o(this.$_terms.link,"Uninitialized link schema"),o(y.isSchema(s),"Invalid schema object"),o(s.type!=="link","Cannot merge type link with another link");const n=this.clone();return n.$_terms.whens||(n.$_terms.whens=[]),n.$_terms.whens.push({concat:s}),n.$_mutateRebuild()}},manifest:{build:(s,n)=>(o(n.link,"Invalid link description missing link"),s.ref(n.link))}}),a.generate=function(s,n,i,h){let l=i.mainstay.links.get(s);if(l)return l._generate(n,i,h).schema;const u=s.$_terms.link[0].ref,{perspective:p,path:S}=a.perspective(u,i);a.assert(p,"which is outside of schema boundaries",u,s,i,h);try{l=S.length?p.$_reach(S):p}catch{a.assert(!1,"to non-existing schema",u,s,i,h)}return a.assert(l.type!=="link","which is another link",u,s,i,h),s._flags.relative||i.mainstay.links.set(s,l),l._generate(n,i,h).schema},a.perspective=function(s,n){if(s.type==="local"){for(const{schema:i,key:h}of n.schemas){if((i._flags.id||h)===s.path[0])return{perspective:i,path:s.path.slice(1)};if(i.$_terms.shared){for(const l of i.$_terms.shared)if(l._flags.id===s.path[0])return{perspective:l,path:s.path.slice(1)}}}return{perspective:null,path:null}}return s.ancestor==="root"?{perspective:n.schemas[n.schemas.length-1].schema,path:s.path}:{perspective:n.schemas[s.ancestor]&&n.schemas[s.ancestor].schema,path:s.path}},a.assert=function(s,n,i,h,l,u){s||o(!1,`"${t.label(h._flags,l,u)}" contains link reference "${i.display}" ${n}`)}},3832:(_,x,g)=>{const o=g(375),v=g(8068),y=g(8160),c={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){const a=t.toString(),s=a.indexOf("."),n=a.indexOf("e");return(s<0?0:(n<0?a.length:n)-s-1)+(n<0?0:Math.max(0,-parseInt(a.slice(n+1))))}};_.exports=v.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:a,error:s}){if(!t.match(c.numberRx))return;t=t.trim();const n={value:parseFloat(t)};if(n.value===0&&(n.value=0),!a._flags.unsafe)if(t.match(/e/i)){if(c.extractSignificantDigits(t)!==c.extractSignificantDigits(String(n.value)))return n.errors=s("number.unsafe"),n}else{const i=n.value.toString();if(i.match(/e/i))return n;if(i!==c.normalizeDecimal(t))return n.errors=s("number.unsafe"),n}return n}},validate(t,{schema:a,error:s,prefs:n}){if(t===1/0||t===-1/0)return{value:t,errors:s("number.infinity")};if(!y.isNumber(t))return{value:t,errors:s("number.base")};const i={value:t};if(n.convert){const h=a.$_getRule("precision");if(h){const l=Math.pow(10,h.args.limit);i.value=Math.round(i.value*l)/l}}return i.value===0&&(i.value=0),!a._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(i.errors=s("number.unsafe")),i},rules:{compare:{method:!1,validate:(t,a,{limit:s},{name:n,operator:i,args:h})=>y.compare(t,s,i)?t:a.error("number."+n,{limit:h.limit,value:t}),args:[{name:"limit",ref:!0,assert:y.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(t,a)=>Math.trunc(t)-t==0?t:a.error("number.integer")},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){const a=typeof t=="number"?c.decimalPlaces(t):null,s=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:a,pfactor:s}})},validate:(t,a,{base:s,baseDecimalPlace:n,pfactor:i},h)=>c.decimalPlaces(t)>n?a.error("number.multiple",{multiple:h.args.base,value:t}):Math.round(i*t)%Math.round(i*s)==0?t:a.error("number.multiple",{multiple:h.args.base,value:t}),args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(t,a)=>Number.isSafeInteger(t)&&t>=0&&t<=65535?t:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(t){return o(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,a,{limit:s}){const n=t.toString().match(c.precisionRx);return Math.max((n[1]?n[1].length:0)-(n[2]?parseInt(n[2],10):0),0)<=s?t:a.error("number.precision",{limit:s,value:t})},convert:!0},sign:{method(t){return o(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate:(t,a,{sign:s})=>s==="negative"&&t<0||s==="positive"&&t>0?t:a.error(`number.${s}`)},unsafe:{method(t=!0){return o(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to:(t,a)=>t.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),c.extractSignificantDigits=function(t){return t.replace(c.exponentialPartRegex,"").replace(c.dotRegex,"").replace(c.trailingZerosRegex,"").replace(c.leadingSignAndZerosRegex,"")},c.normalizeDecimal=function(t){return(t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}},8966:(_,x,g)=>{const o=g(7824);_.exports=o.extend({type:"object",cast:{map:{from:v=>v&&typeof v=="object",to:(v,y)=>new Map(Object.entries(v))}}})},7417:(_,x,g)=>{const o=g(375),v=g(5380),y=g(1745),c=g(9959),t=g(6064),a=g(9926),s=g(5752),n=g(8068),i=g(8160),h={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:c.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};_.exports=n.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(l,{schema:u,state:p,prefs:S}){const b=u.$_getRule("normalize");b&&(l=l.normalize(b.args.form));const O=u.$_getRule("case");O&&(l=O.args.direction==="upper"?l.toLocaleUpperCase():l.toLocaleLowerCase());const R=u.$_getRule("trim");if(R&&R.args.enabled&&(l=l.trim()),u.$_terms.replacements)for(const E of u.$_terms.replacements)l=l.replace(E.pattern,E.replacement);const f=u.$_getRule("hex");if(f&&f.args.options.byteAligned&&l.length%2!=0&&(l=`0${l}`),u.$_getRule("isoDate")){const E=h.isoDate(l);E&&(l=E)}if(u._flags.truncate){const E=u.$_getRule("max");if(E){let j=E.args.limit;if(i.isResolvable(j)&&(j=j.resolve(l,p,S),!i.limit(j)))return{value:l,errors:u.$_createError("any.ref",j,{ref:E.args.limit,arg:"limit",reason:"must be a positive integer"},p,S)};l=l.slice(0,j)}}return{value:l}}},validate(l,{schema:u,error:p}){if(typeof l!="string")return{value:l,errors:p("string.base")};if(l===""){const S=u.$_getRule("min");return S&&S.args.limit===0?void 0:{value:l,errors:p("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(l,u)=>/^[a-zA-Z0-9]+$/.test(l)?l:u.error("string.alphanum")},base64:{method(l={}){return i.assertOptions(l,["paddingRequired","urlSafe"]),l={urlSafe:!1,paddingRequired:!0,...l},o(typeof l.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof l.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:l}})},validate:(l,u,{options:p})=>h.base64Regex[p.paddingRequired][p.urlSafe].test(l)?l:u.error("string.base64")},case:{method(l){return o(["lower","upper"].includes(l),"Invalid case:",l),this.$_addRule({name:"case",args:{direction:l}})},validate:(l,u,{direction:p})=>p==="lower"&&l===l.toLocaleLowerCase()||p==="upper"&&l===l.toLocaleUpperCase()?l:u.error(`string.${p}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(l,u){let p=l.length,S=0,b=1;for(;p--;){const O=l.charAt(p)*b;S+=O-9*(O>9),b^=3}return S>0&&S%10==0?l:u.error("string.creditCard")}},dataUri:{method(l={}){return i.assertOptions(l,["paddingRequired"]),l={paddingRequired:!0,...l},o(typeof l.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:l}})},validate(l,u,{options:p}){const S=l.match(h.dataUriRegex);return S&&(!S[2]||S[2]!=="base64"||h.base64Regex[p.paddingRequired].false.test(S[3]))?l:u.error("string.dataUri")}},domain:{method(l){l&&i.assertOptions(l,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const u=h.addressOptions(l);return this.$_addRule({name:"domain",args:{options:l},address:u})},validate:(l,u,p,{address:S})=>v.isValid(l,S)?l:u.error("string.domain")},email:{method(l={}){i.assertOptions(l,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(l.multiple===void 0||typeof l.multiple=="boolean","multiple option must be an boolean");const u=h.addressOptions(l),p=new RegExp(`\\s*[${l.separator?t(l.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:l},regex:p,address:u})},validate(l,u,{options:p},{regex:S,address:b}){const O=p.multiple?l.split(S):[l],R=[];for(const f of O)y.isValid(f,b)||R.push(f);return R.length?u.error("string.email",{value:l,invalids:R}):l}},guid:{alias:"uuid",method(l={}){i.assertOptions(l,["version","separator"]);let u="";if(l.version){const b=[].concat(l.version);o(b.length>=1,"version must have at least 1 valid version specified");const O=new Set;for(let R=0;R<b.length;++R){const f=b[R];o(typeof f=="string","version at position "+R+" must be a string");const E=h.guidVersions[f.toLowerCase()];o(E,"version at position "+R+" must be one of "+Object.keys(h.guidVersions).join(", ")),o(!O.has(E),"version at position "+R+" must not be a duplicate"),u+=E,O.add(E)}}o(h.guidSeparators.has(l.separator),'separator must be one of true, false, "-", or ":"');const p=l.separator===void 0?"[:-]?":l.separator===!0?"[:-]":l.separator===!1?"[]?":`\\${l.separator}`,S=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${p})[0-9A-F]{4}\\2?[${u||"0-9A-F"}][0-9A-F]{3}\\2?[${u?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:l},regex:S})},validate(l,u,p,{regex:S}){const b=S.exec(l);return b?h.guidBrackets[b[1]]!==b[b.length-1]?u.error("string.guid"):l:u.error("string.guid")}},hex:{method(l={}){return i.assertOptions(l,["byteAligned","prefix"]),l={byteAligned:!1,prefix:!1,...l},o(typeof l.byteAligned=="boolean","byteAligned must be boolean"),o(typeof l.prefix=="boolean"||l.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:l}})},validate:(l,u,{options:p})=>(p.prefix==="optional"?h.hexRegex.withOptionalPrefix:p.prefix===!0?h.hexRegex.withPrefix:h.hexRegex.withoutPrefix).test(l)?p.byteAligned&&l.length%2!=0?u.error("string.hexAlign"):l:u.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(l,u)=>v.isValid(l,{minDomainSegments:1})||h.ipRegex.test(l)?l:u.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(l={}){i.assertOptions(l,["cidr","version"]);const{cidr:u,versions:p,regex:S}=c.regex(l),b=l.version?p:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:u,version:b}},regex:S})},validate:(l,u,{options:p},{regex:S})=>S.test(l)?l:p.version?u.error("string.ipVersion",{value:l,cidr:p.cidr,version:p.version}):u.error("string.ip",{value:l,cidr:p.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(l,{error:u})=>h.isoDate(l)?l:u("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(l,u)=>h.isoDurationRegex.test(l)?l:u.error("string.isoDuration")},length:{method(l,u){return h.length(this,"length",l,"=",u)},validate(l,u,{limit:p,encoding:S},{name:b,operator:O,args:R}){const f=!S&&l.length;return i.compare(f,p,O)?l:u.error("string."+b,{limit:R.limit,value:l,encoding:S})},args:[{name:"limit",ref:!0,assert:i.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(l,u){return h.length(this,"max",l,"<=",u)},args:["limit","encoding"]},min:{method(l,u){return h.length(this,"min",l,">=",u)},args:["limit","encoding"]},normalize:{method(l="NFC"){return o(h.normalizationForms.includes(l),"normalization form must be one of "+h.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:l}})},validate:(l,{error:u},{form:p})=>l===l.normalize(p)?l:u("string.normalize",{value:l,form:p}),convert:!0},pattern:{alias:"regex",method(l,u={}){o(l instanceof RegExp,"regex must be a RegExp"),o(!l.flags.includes("g")&&!l.flags.includes("y"),"regex should not use global or sticky mode"),typeof u=="string"&&(u={name:u}),i.assertOptions(u,["invert","name"]);const p=["string.pattern",u.invert?".invert":"",u.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:l,options:u},errorCode:p})},validate:(l,u,{regex:p,options:S},{errorCode:b})=>p.test(l)^S.invert?l:u.error(b,{name:S.name,regex:p,value:l}),args:["regex","options"],multi:!0},replace:{method(l,u){typeof l=="string"&&(l=new RegExp(t(l),"g")),o(l instanceof RegExp,"pattern must be a RegExp"),o(typeof u=="string","replacement must be a String");const p=this.clone();return p.$_terms.replacements||(p.$_terms.replacements=[]),p.$_terms.replacements.push({pattern:l,replacement:u}),p}},token:{method(){return this.$_addRule("token")},validate:(l,u)=>/^\w+$/.test(l)?l:u.error("string.token")},trim:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:l}})},validate:(l,u,{enabled:p})=>p&&l!==l.trim()?u.error("string.trim"):l,convert:!0},truncate:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",l)}},uppercase:{method(){return this.case("upper")}},uri:{method(l={}){i.assertOptions(l,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),l.domain&&i.assertOptions(l.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:u,scheme:p}=s.regex(l),S=l.domain?h.addressOptions(l.domain):null;return this.$_addRule({name:"uri",args:{options:l},regex:u,domain:S,scheme:p})},validate(l,u,{options:p},{regex:S,domain:b,scheme:O}){if(["http:/","https:/"].includes(l))return u.error("string.uri");const R=S.exec(l);if(R){const f=R[1]||R[2];return!b||p.allowRelative&&!f||v.isValid(f,b)?l:u.error("string.domain",{value:f})}return p.relativeOnly?u.error("string.uriRelativeOnly"):p.scheme?u.error("string.uriCustomScheme",{scheme:O,value:l}):u.error("string.uri")}}},manifest:{build(l,u){if(u.replacements)for(const{pattern:p,replacement:S}of u.replacements)l=l.replace(p,S);return l}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),h.addressOptions=function(l){if(!l)return h.tlds||l;if(o(l.minDomainSegments===void 0||Number.isSafeInteger(l.minDomainSegments)&&l.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(l.maxDomainSegments===void 0||Number.isSafeInteger(l.maxDomainSegments)&&l.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),l.tlds===!1)return l;if(l.tlds===!0||l.tlds===void 0)return o(h.tlds,"Built-in TLD list disabled"),Object.assign({},l,h.tlds);o(typeof l.tlds=="object","tlds must be true, false, or an object");const u=l.tlds.deny;if(u)return Array.isArray(u)&&(l=Object.assign({},l,{tlds:{deny:new Set(u)}})),o(l.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!l.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),h.validateTlds(l.tlds.deny,"tlds.deny"),l;const p=l.tlds.allow;return p?p===!0?(o(h.tlds,"Built-in TLD list disabled"),Object.assign({},l,h.tlds)):(Array.isArray(p)&&(l=Object.assign({},l,{tlds:{allow:new Set(p)}})),o(l.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),h.validateTlds(l.tlds.allow,"tlds.allow"),l):l},h.validateTlds=function(l,u){for(const p of l)o(v.isValid(p,{minDomainSegments:1,maxDomainSegments:1}),`${u} must contain valid top level domain names`)},h.isoDate=function(l){if(!i.isIsoDate(l))return null;/.*T.*[+-]\d\d$/.test(l)&&(l+="00");const u=new Date(l);return isNaN(u.getTime())?null:u.toISOString()},h.length=function(l,u,p,S,b){return o(!b||!1,"Invalid encoding:",b),l.$_addRule({name:u,method:"length",args:{limit:p,encoding:b},operator:S})}},8826:(_,x,g)=>{const o=g(375),v=g(8068),y={};y.Map=class extends Map{slice(){return new y.Map(this)}},_.exports=v.extend({type:"symbol",terms:{map:{init:new y.Map}},coerce:{method(c,{schema:t,error:a}){const s=t.$_terms.map.get(c);return s&&(c=s),t._flags.only&&typeof c!="symbol"?{value:c,errors:a("symbol.map",{map:t.$_terms.map})}:{value:c}}},validate(c,{error:t}){if(typeof c!="symbol")return{value:c,errors:t("symbol.base")}},rules:{map:{method(c){c&&!c[Symbol.iterator]&&typeof c=="object"&&(c=Object.entries(c)),o(c&&c[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),a=[];for(const s of c){o(s&&s[Symbol.iterator],"Entry must be an iterable");const[n,i]=s;o(typeof n!="object"&&typeof n!="function"&&typeof n!="symbol","Key must not be of type object, function, or Symbol"),o(typeof i=="symbol","Value must be a Symbol"),t.$_terms.map.set(n,i),a.push(i)}return t.valid(...a)}}},manifest:{build:(c,t)=>(t.map&&(c=c.map(t.map)),c)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(_,x,g)=>{const o=g(375),v=g(8571),y=g(738),c=g(9621),t=g(8160),a=g(6354),s=g(493),n={result:Symbol("result")};x.entry=function(i,h,l){let u=t.defaults;l&&(o(l.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(l.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),u=t.preferences(t.defaults,l));const p=n.entry(i,h,u);o(!p.mainstay.externals.length,"Schema with external rules must use validateAsync()");const S={value:p.value};return p.error&&(S.error=p.error),p.mainstay.warnings.length&&(S.warning=a.details(p.mainstay.warnings)),p.mainstay.debug&&(S.debug=p.mainstay.debug),p.mainstay.artifacts&&(S.artifacts=p.mainstay.artifacts),S},x.entryAsync=async function(i,h,l){let u=t.defaults;l&&(u=t.preferences(t.defaults,l));const p=n.entry(i,h,u),S=p.mainstay;if(p.error)throw S.debug&&(p.error.debug=S.debug),p.error;if(S.externals.length){let O=p.value;const R=[];for(const f of S.externals){const E=f.state.path,j=f.schema.type==="link"?S.links.get(f.schema):null;let L,B,z=O;const ee=E.length?[O]:[],ne=E.length?c(i,E):i;if(E.length){L=E[E.length-1];let G=O;for(const oe of E.slice(0,-1))G=G[oe],ee.unshift(G);B=ee[0],z=B[L]}try{const G=(H,xe)=>(j||f.schema).$_createError(H,z,xe,f.state,u),oe=await f.method(z,{schema:f.schema,linked:j,state:f.state,prefs:l,original:ne,error:G,errorsArray:n.errorsArray,warn:(H,xe)=>S.warnings.push((j||f.schema).$_createError(H,z,xe,f.state,u)),message:(H,xe)=>(j||f.schema).$_createError("external",z,xe,f.state,u,{messages:H})});if(oe===void 0||oe===z)continue;if(oe instanceof a.Report){if(S.tracer.log(f.schema,f.state,"rule","external","error"),R.push(oe),u.abortEarly)break;continue}if(Array.isArray(oe)&&oe[t.symbols.errors]){if(S.tracer.log(f.schema,f.state,"rule","external","error"),R.push(...oe),u.abortEarly)break;continue}B?(S.tracer.value(f.state,"rule",z,oe,"external"),B[L]=oe):(S.tracer.value(f.state,"rule",O,oe,"external"),O=oe)}catch(G){throw u.errors.label&&(G.message+=` (${f.label})`),G}}if(p.value=O,R.length)throw p.error=a.process(R,i,u),S.debug&&(p.error.debug=S.debug),p.error}if(!u.warnings&&!u.debug&&!u.artifacts)return p.value;const b={value:p.value};return S.warnings.length&&(b.warning=a.details(S.warnings)),S.debug&&(b.debug=S.debug),S.artifacts&&(b.artifacts=S.artifacts),b},n.Mainstay=class{constructor(i,h,l){this.externals=[],this.warnings=[],this.tracer=i,this.debug=h,this.links=l,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const i=this._snapshots.pop();this.externals=i.externals,this.warnings=i.warnings}commit(){this._snapshots.pop()}},n.entry=function(i,h,l){const{tracer:u,cleanup:p}=n.tracer(h,l),S=l.debug?[]:null,b=h._ids._schemaChain?new Map:null,O=new n.Mainstay(u,S,b),R=h._ids._schemaChain?[{schema:h}]:null,f=new s([],[],{mainstay:O,schemas:R}),E=x.validate(i,h,f,l);p&&h.$_root.untrace();const j=a.process(E.errors,i,l);return{value:E.value,error:j,mainstay:O}},n.tracer=function(i,h){return i.$_root._tracer?{tracer:i.$_root._tracer._register(i)}:h.debug?(o(i.$_root.trace,"Debug mode not supported"),{tracer:i.$_root.trace()._register(i),cleanup:!0}):{tracer:n.ignore}},x.validate=function(i,h,l,u,p={}){if(h.$_terms.whens&&(h=h._generate(i,l,u).schema),h._preferences&&(u=n.prefs(h,u)),h._cache&&u.cache){const j=h._cache.get(i);if(l.mainstay.tracer.debug(l,"validate","cached",!!j),j)return j}const S=(j,L,B)=>h.$_createError(j,i,L,B||l,u),b={original:i,prefs:u,schema:h,state:l,error:S,errorsArray:n.errorsArray,warn:(j,L,B)=>l.mainstay.warnings.push(S(j,L,B)),message:(j,L)=>h.$_createError("custom",i,L,l,u,{messages:j})};l.mainstay.tracer.entry(h,l);const O=h._definition;if(O.prepare&&i!==void 0&&u.convert){const j=O.prepare(i,b);if(j){if(l.mainstay.tracer.value(l,"prepare",i,j.value),j.errors)return n.finalize(j.value,[].concat(j.errors),b);i=j.value}}if(O.coerce&&i!==void 0&&u.convert&&(!O.coerce.from||O.coerce.from.includes(typeof i))){const j=O.coerce.method(i,b);if(j){if(l.mainstay.tracer.value(l,"coerced",i,j.value),j.errors)return n.finalize(j.value,[].concat(j.errors),b);i=j.value}}const R=h._flags.empty;R&&R.$_match(n.trim(i,h),l.nest(R),t.defaults)&&(l.mainstay.tracer.value(l,"empty",i,void 0),i=void 0);const f=p.presence||h._flags.presence||(h._flags._endedSwitch?null:u.presence);if(i===void 0){if(f==="forbidden")return n.finalize(i,null,b);if(f==="required")return n.finalize(i,[h.$_createError("any.required",i,null,l,u)],b);if(f==="optional"){if(h._flags.default!==t.symbols.deepDefault)return n.finalize(i,null,b);l.mainstay.tracer.value(l,"default",i,{}),i={}}}else if(f==="forbidden")return n.finalize(i,[h.$_createError("any.unknown",i,null,l,u)],b);const E=[];if(h._valids){const j=h._valids.get(i,l,u,h._flags.insensitive);if(j)return u.convert&&(l.mainstay.tracer.value(l,"valids",i,j.value),i=j.value),l.mainstay.tracer.filter(h,l,"valid",j),n.finalize(i,null,b);if(h._flags.only){const L=h.$_createError("any.only",i,{valids:h._valids.values({display:!0})},l,u);if(u.abortEarly)return n.finalize(i,[L],b);E.push(L)}}if(h._invalids){const j=h._invalids.get(i,l,u,h._flags.insensitive);if(j){l.mainstay.tracer.filter(h,l,"invalid",j);const L=h.$_createError("any.invalid",i,{invalids:h._invalids.values({display:!0})},l,u);if(u.abortEarly)return n.finalize(i,[L],b);E.push(L)}}if(O.validate){const j=O.validate(i,b);if(j&&(l.mainstay.tracer.value(l,"base",i,j.value),i=j.value,j.errors)){if(!Array.isArray(j.errors))return E.push(j.errors),n.finalize(i,E,b);if(j.errors.length)return E.push(...j.errors),n.finalize(i,E,b)}}return h._rules.length?n.rules(i,E,b):n.finalize(i,E,b)},n.rules=function(i,h,l){const{schema:u,state:p,prefs:S}=l;for(const b of u._rules){const O=u._definition.rules[b.method];if(O.convert&&S.convert){p.mainstay.tracer.log(u,p,"rule",b.name,"full");continue}let R,f=b.args;if(b._resolve.length){f=Object.assign({},f);for(const j of b._resolve){const L=O.argsByName.get(j),B=f[j].resolve(i,p,S),z=L.normalize?L.normalize(B):B,ee=t.validateArg(z,null,L);if(ee){R=u.$_createError("any.ref",B,{arg:j,ref:f[j],reason:ee},p,S);break}f[j]=z}}R=R||O.validate(i,l,f,b);const E=n.rule(R,b);if(E.errors){if(p.mainstay.tracer.log(u,p,"rule",b.name,"error"),b.warn){p.mainstay.warnings.push(...E.errors);continue}if(S.abortEarly)return n.finalize(i,E.errors,l);h.push(...E.errors)}else p.mainstay.tracer.log(u,p,"rule",b.name,"pass"),p.mainstay.tracer.value(p,"rule",i,E.value,b.name),i=E.value}return n.finalize(i,h,l)},n.rule=function(i,h){return i instanceof a.Report?(n.error(i,h),{errors:[i],value:null}):Array.isArray(i)&&i[t.symbols.errors]?(i.forEach(l=>n.error(l,h)),{errors:i,value:null}):{errors:null,value:i}},n.error=function(i,h){return h.message&&i._setTemplate(h.message),i},n.finalize=function(i,h,l){h=h||[];const{schema:u,state:p,prefs:S}=l;if(h.length){const O=n.default("failover",void 0,h,l);O!==void 0&&(p.mainstay.tracer.value(p,"failover",i,O),i=O,h=[])}if(h.length&&u._flags.error)if(typeof u._flags.error=="function"){h=u._flags.error(h),Array.isArray(h)||(h=[h]);for(const O of h)o(O instanceof Error||O instanceof a.Report,"error() must return an Error object")}else h=[u._flags.error];if(i===void 0){const O=n.default("default",i,h,l);p.mainstay.tracer.value(p,"default",i,O),i=O}if(u._flags.cast&&i!==void 0){const O=u._definition.cast[u._flags.cast];if(O.from(i)){const R=O.to(i,l);p.mainstay.tracer.value(p,"cast",i,R,u._flags.cast),i=R}}if(u.$_terms.externals&&S.externals&&S._externals!==!1)for(const{method:O}of u.$_terms.externals)p.mainstay.externals.push({method:O,schema:u,state:p,label:a.label(u._flags,p,S)});const b={value:i,errors:h.length?h:null};return u._flags.result&&(b.value=u._flags.result==="strip"?void 0:l.original,p.mainstay.tracer.value(p,u._flags.result,i,b.value),p.shadow(i,u._flags.result)),u._cache&&S.cache!==!1&&!u._refs.length&&u._cache.set(l.original,b),i===void 0||b.errors||u._flags.artifact===void 0||(p.mainstay.artifacts=p.mainstay.artifacts||new Map,p.mainstay.artifacts.has(u._flags.artifact)||p.mainstay.artifacts.set(u._flags.artifact,[]),p.mainstay.artifacts.get(u._flags.artifact).push(p.path)),b},n.prefs=function(i,h){const l=h===t.defaults;return l&&i._preferences[t.symbols.prefs]?i._preferences[t.symbols.prefs]:(h=t.preferences(h,i._preferences),l&&(i._preferences[t.symbols.prefs]=h),h)},n.default=function(i,h,l,u){const{schema:p,state:S,prefs:b}=u,O=p._flags[i];if(b.noDefaults||O===void 0)return h;if(S.mainstay.tracer.log(p,S,"rule",i,"full"),!O)return O;if(typeof O=="function"){const R=O.length?[v(S.ancestors[0]),u]:[];try{return O(...R)}catch(f){return void l.push(p.$_createError(`any.${i}`,null,{error:f},S,b))}}return typeof O!="object"?O:O[t.symbols.literal]?O.literal:t.isResolvable(O)?O.resolve(h,S,b):v(O)},n.trim=function(i,h){if(typeof i!="string")return i;const l=h.$_getRule("trim");return l&&l.args.enabled?i.trim():i},n.ignore={active:!1,debug:y,entry:y,filter:y,log:y,resolve:y,value:y},n.errorsArray=function(){const i=[];return i[t.symbols.errors]=!0,i}},2036:(_,x,g)=>{const o=g(375),v=g(9474),y=g(8160),c={};_.exports=c.Values=class{constructor(t,a){this._values=new Set(t),this._refs=new Set(a),this._lowercase=c.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,a){y.isResolvable(t)?this._refs.has(t)||(this._refs.add(t),a&&a.register(t)):this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,a,s){if(t=t||new c.Values,a){if(a._override)return a.clone();for(const n of[...a._values,...a._refs])t.add(n)}if(s)for(const n of[...s._values,...s._refs])t.remove(n);return t.length?t:null}remove(t){y.isResolvable(t)?this._refs.delete(t):(this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase()))}has(t,a,s,n){return!!this.get(t,a,s,n)}get(t,a,s,n){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&n){const i=this._lowercase.get(t.toLowerCase());if(i)return{value:i}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(const i of this._values)if(v(i,t))return{value:i}}if(a)for(const i of this._refs){const h=i.resolve(t,a,s,null,{in:!0});if(h===void 0)continue;const l=i.in&&typeof h=="object"?Array.isArray(h)?h:Object.keys(h):[h];for(const u of l)if(typeof u==typeof t){if(n&&t&&typeof t=="string"){if(u.toLowerCase()===t.toLowerCase())return{value:u,ref:i}}else if(v(u,t))return{value:u,ref:i}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){const a=[];for(const s of[...this._values,...this._refs])s!==void 0&&a.push(s);return a}return Array.from([...this._values,...this._refs])}clone(){const t=new c.Values(this._values,this._refs);return t._override=this._override,t}concat(t){o(!t._override,"Cannot concat override set of values");const a=new c.Values([...this._values,...t._values],[...this._refs,...t._refs]);return a._override=this._override,a}describe(){const t=[];this._override&&t.push({override:!0});for(const a of this._values.values())t.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())t.push(a.describe());return t}},c.Values.prototype[y.symbols.values]=!0,c.Values.prototype.slice=c.Values.prototype.clone,c.lowercases=function(t){const a=new Map;if(t)for(const s of t)typeof s=="string"&&a.set(s.toLowerCase(),s);return a}},978:(_,x,g)=>{const o=g(375),v=g(8571),y=g(1687),c=g(9621),t={};_.exports=function(a,s,n={}){if(o(a&&typeof a=="object","Invalid defaults value: must be an object"),o(!s||s===!0||typeof s=="object","Invalid source value: must be true, falsy or an object"),o(typeof n=="object","Invalid options: must be an object"),!s)return null;if(n.shallow)return t.applyToDefaultsWithShallow(a,s,n);const i=v(a);if(s===!0)return i;const h=n.nullOverride!==void 0&&n.nullOverride;return y(i,s,{nullOverride:h,mergeArrays:!1})},t.applyToDefaultsWithShallow=function(a,s,n){const i=n.shallow;o(Array.isArray(i),"Invalid keys");const h=new Map,l=s===!0?null:new Set;for(let S of i){S=Array.isArray(S)?S:S.split(".");const b=c(a,S);b&&typeof b=="object"?h.set(b,l&&c(s,S)||b):l&&l.add(S)}const u=v(a,{},h);if(!l)return u;for(const S of l)t.reachCopy(u,s,S);const p=n.nullOverride!==void 0&&n.nullOverride;return y(u,s,{nullOverride:p,mergeArrays:!1})},t.reachCopy=function(a,s,n){for(const l of n){if(!(l in s))return;const u=s[l];if(typeof u!="object"||u===null)return;s=u}const i=s;let h=a;for(let l=0;l<n.length-1;++l){const u=n[l];typeof h[u]!="object"&&(h[u]={}),h=h[u]}h[n[n.length-1]]=i}},375:(_,x,g)=>{const o=g(7916);_.exports=function(v,...y){if(!v)throw y.length===1&&y[0]instanceof Error?y[0]:new o(y)}},8571:(_,x,g)=>{const o=g(9621),v=g(4277),y=g(7043),c={needsProtoHack:new Set([v.set,v.map,v.weakSet,v.weakMap])};_.exports=c.clone=function(t,a={},s=null){if(typeof t!="object"||t===null)return t;let n=c.clone,i=s;if(a.shallow){if(a.shallow!==!0)return c.cloneWithShallow(t,a);n=p=>p}else if(i){const p=i.get(t);if(p)return p}else i=new Map;const h=v.getInternalProto(t);if(h===v.buffer)return!1;if(h===v.date)return new Date(t.getTime());if(h===v.regex)return new RegExp(t);const l=c.base(t,h,a);if(l===t)return t;if(i&&i.set(t,l),h===v.set)for(const p of t)l.add(n(p,a,i));else if(h===v.map)for(const[p,S]of t)l.set(p,n(S,a,i));const u=y.keys(t,a);for(const p of u){if(p==="__proto__")continue;if(h===v.array&&p==="length"){l.length=t.length;continue}const S=Object.getOwnPropertyDescriptor(t,p);S?S.get||S.set?Object.defineProperty(l,p,S):S.enumerable?l[p]=n(t[p],a,i):Object.defineProperty(l,p,{enumerable:!1,writable:!0,configurable:!0,value:n(t[p],a,i)}):Object.defineProperty(l,p,{enumerable:!0,writable:!0,configurable:!0,value:n(t[p],a,i)})}return l},c.cloneWithShallow=function(t,a){const s=a.shallow;(a=Object.assign({},a)).shallow=!1;const n=new Map;for(const i of s){const h=o(t,i);typeof h!="object"&&typeof h!="function"||n.set(h,h)}return c.clone(t,a,n)},c.base=function(t,a,s){if(s.prototype===!1)return c.needsProtoHack.has(a)?new a.constructor:a===v.array?[]:{};const n=Object.getPrototypeOf(t);if(n&&n.isImmutable)return t;if(a===v.array){const i=[];return n!==a&&Object.setPrototypeOf(i,n),i}if(c.needsProtoHack.has(a)){const i=new n.constructor;return n!==a&&Object.setPrototypeOf(i,n),i}return Object.create(n)}},9474:(_,x,g)=>{const o=g(4277),v={mismatched:null};_.exports=function(y,c,t){return t=Object.assign({prototype:!0},t),!!v.isDeepEqual(y,c,t,[])},v.isDeepEqual=function(y,c,t,a){if(y===c)return y!==0||1/y==1/c;const s=typeof y;if(s!==typeof c||y===null||c===null)return!1;if(s==="function"){if(!t.deepFunction||y.toString()!==c.toString())return!1}else if(s!=="object")return y!=y&&c!=c;const n=v.getSharedType(y,c,!!t.prototype);switch(n){case o.buffer:return!1;case o.promise:return y===c;case o.regex:return y.toString()===c.toString();case v.mismatched:return!1}for(let i=a.length-1;i>=0;--i)if(a[i].isSame(y,c))return!0;a.push(new v.SeenEntry(y,c));try{return!!v.isDeepEqualObj(n,y,c,t,a)}finally{a.pop()}},v.getSharedType=function(y,c,t){if(t)return Object.getPrototypeOf(y)!==Object.getPrototypeOf(c)?v.mismatched:o.getInternalProto(y);const a=o.getInternalProto(y);return a!==o.getInternalProto(c)?v.mismatched:a},v.valueOf=function(y){const c=y.valueOf;if(c===void 0)return y;try{return c.call(y)}catch(t){return t}},v.hasOwnEnumerableProperty=function(y,c){return Object.prototype.propertyIsEnumerable.call(y,c)},v.isSetSimpleEqual=function(y,c){for(const t of Set.prototype.values.call(y))if(!Set.prototype.has.call(c,t))return!1;return!0},v.isDeepEqualObj=function(y,c,t,a,s){const{isDeepEqual:n,valueOf:i,hasOwnEnumerableProperty:h}=v,{keys:l,getOwnPropertySymbols:u}=Object;if(y===o.array){if(!a.part){if(c.length!==t.length)return!1;for(let R=0;R<c.length;++R)if(!n(c[R],t[R],a,s))return!1;return!0}for(const R of c)for(const f of t)if(n(R,f,a,s))return!0}else if(y===o.set){if(c.size!==t.size)return!1;if(!v.isSetSimpleEqual(c,t)){const R=new Set(Set.prototype.values.call(t));for(const f of Set.prototype.values.call(c)){if(R.delete(f))continue;let E=!1;for(const j of R)if(n(f,j,a,s)){R.delete(j),E=!0;break}if(!E)return!1}}}else if(y===o.map){if(c.size!==t.size)return!1;for(const[R,f]of Map.prototype.entries.call(c))if(f===void 0&&!Map.prototype.has.call(t,R)||!n(f,Map.prototype.get.call(t,R),a,s))return!1}else if(y===o.error&&(c.name!==t.name||c.message!==t.message))return!1;const p=i(c),S=i(t);if((c!==p||t!==S)&&!n(p,S,a,s))return!1;const b=l(c);if(!a.part&&b.length!==l(t).length&&!a.skip)return!1;let O=0;for(const R of b)if(a.skip&&a.skip.includes(R))t[R]===void 0&&++O;else if(!h(t,R)||!n(c[R],t[R],a,s))return!1;if(!a.part&&b.length-O!==l(t).length)return!1;if(a.symbols!==!1){const R=u(c),f=new Set(u(t));for(const E of R){if(!a.skip||!a.skip.includes(E)){if(h(c,E)){if(!h(t,E)||!n(c[E],t[E],a,s))return!1}else if(h(t,E))return!1}f.delete(E)}for(const E of f)if(h(t,E))return!1}return!0},v.SeenEntry=class{constructor(y,c){this.obj=y,this.ref=c}isSame(y,c){return this.obj===y&&this.ref===c}}},7916:(_,x,g)=>{const o=g(8761);_.exports=class extends Error{constructor(v){super(v.filter(y=>y!=="").map(y=>typeof y=="string"?y:y instanceof Error?y.message:o(y)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,x.assert)}}},5277:_=>{const x={};_.exports=function(g){if(!g)return"";let o="";for(let v=0;v<g.length;++v){const y=g.charCodeAt(v);x.isSafe(y)?o+=g[v]:o+=x.escapeHtmlChar(y)}return o},x.escapeHtmlChar=function(g){return x.namedHtml.get(g)||(g>=256?"&#"+g+";":`&#x${g.toString(16).padStart(2,"0")};`)},x.isSafe=function(g){return x.safeCharCodes.has(g)},x.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),x.safeCharCodes=function(){const g=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&g.add(o);return g}()},6064:_=>{_.exports=function(x){return x.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:_=>{_.exports=function(){}},1687:(_,x,g)=>{const o=g(375),v=g(8571),y=g(7043),c={};_.exports=c.merge=function(t,a,s){if(o(t&&typeof t=="object","Invalid target value: must be an object"),o(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return t;if(s=Object.assign({nullOverride:!0,mergeArrays:!0},s),Array.isArray(a)){o(Array.isArray(t),"Cannot merge array onto an object"),s.mergeArrays||(t.length=0);for(let i=0;i<a.length;++i)t.push(v(a[i],{symbols:s.symbols}));return t}const n=y.keys(a,s);for(let i=0;i<n.length;++i){const h=n[i];if(h==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,h))continue;const l=a[h];if(l&&typeof l=="object"){if(t[h]===l)continue;!t[h]||typeof t[h]!="object"||Array.isArray(t[h])!==Array.isArray(l)||l instanceof Date||l instanceof RegExp?t[h]=v(l,{symbols:s.symbols}):c.merge(t[h],l,s)}else(l!=null||s.nullOverride)&&(t[h]=l)}return t}},9621:(_,x,g)=>{const o=g(375),v={};_.exports=function(y,c,t){if(c===!1||c==null)return y;typeof(t=t||{})=="string"&&(t={separator:t});const a=Array.isArray(c);o(!a||!t.separator,"Separator option is not valid for array-based chain");const s=a?c:c.split(t.separator||".");let n=y;for(let i=0;i<s.length;++i){let h=s[i];const l=t.iterables&&v.iterables(n);if(Array.isArray(n)||l==="set"){const u=Number(h);Number.isInteger(u)&&(h=u<0?n.length+u:u)}if(!n||typeof n=="function"&&t.functions===!1||!l&&n[h]===void 0){o(!t.strict||i+1===s.length,"Missing segment",h,"in reach path ",c),o(typeof n=="object"||t.functions===!0||typeof n!="function","Invalid segment",h,"in reach path ",c),n=t.default;break}n=l?l==="set"?[...n][h]:n.get(h):n[h]}return n},v.iterables=function(y){return y instanceof Set?"set":y instanceof Map?"map":void 0}},8761:_=>{_.exports=function(...x){try{return JSON.stringify(...x)}catch(g){return"[Cannot display object: "+g.message+"]"}}},4277:(_,x)=>{const g={};x=_.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},g.typeMap=new Map([["[object Error]",x.error],["[object Map]",x.map],["[object Promise]",x.promise],["[object Set]",x.set],["[object WeakMap]",x.weakMap],["[object WeakSet]",x.weakSet]]),x.getInternalProto=function(o){if(Array.isArray(o))return x.array;if(o instanceof Date)return x.date;if(o instanceof RegExp)return x.regex;if(o instanceof Error)return x.error;const v=Object.prototype.toString.call(o);return g.typeMap.get(v)||x.generic}},7043:(_,x)=>{x.keys=function(g,o={}){return o.symbols!==!1?Reflect.ownKeys(g):Object.getOwnPropertyNames(g)}},3652:(_,x,g)=>{const o=g(375),v={};x.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(y,c){const t=[].concat((c=c||{}).before||[]),a=[].concat(c.after||[]),s=c.group||"?",n=c.sort||0;o(!t.includes(s),`Item cannot come before itself: ${s}`),o(!t.includes("?"),"Item cannot come before unassociated items"),o(!a.includes(s),`Item cannot come after itself: ${s}`),o(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(y)||(y=[y]);for(const i of y){const h={seq:this._items.length,sort:n,before:t,after:a,group:s,node:i};this._items.push(h)}if(!c.manual){const i=this._sort();o(i,"item",s!=="?"?`added into group ${s}`:"","created a dependencies error")}return this.nodes}merge(y){Array.isArray(y)||(y=[y]);for(const t of y)if(t)for(const a of t._items)this._items.push(Object.assign({},a));this._items.sort(v.mergeSort);for(let t=0;t<this._items.length;++t)this._items[t].seq=t;const c=this._sort();return o(c,"merge created a dependencies error"),this.nodes}sort(){const y=this._sort();return o(y,"sort created a dependencies error"),this.nodes}_sort(){const y={},c=Object.create(null),t=Object.create(null);for(const h of this._items){const l=h.seq,u=h.group;t[u]=t[u]||[],t[u].push(l),y[l]=h.before;for(const p of h.after)c[p]=c[p]||[],c[p].push(l)}for(const h in y){const l=[];for(const u in y[h]){const p=y[h][u];t[p]=t[p]||[],l.push(...t[p])}y[h]=l}for(const h in c)if(t[h])for(const l of t[h])y[l].push(...c[h]);const a={};for(const h in y){const l=y[h];for(const u of l)a[u]=a[u]||[],a[u].push(h)}const s={},n=[];for(let h=0;h<this._items.length;++h){let l=h;if(a[h]){l=null;for(let u=0;u<this._items.length;++u){if(s[u]===!0)continue;a[u]||(a[u]=[]);const p=a[u].length;let S=0;for(let b=0;b<p;++b)s[a[u][b]]&&++S;if(S===p){l=u;break}}}l!==null&&(s[l]=!0,n.push(l))}if(n.length!==this._items.length)return!1;const i={};for(const h of this._items)i[h.seq]=h;this._items=[],this.nodes=[];for(const h of n){const l=i[h];this.nodes.push(l.node),this._items.push(l)}return!0}},v.mergeSort=(y,c)=>y.sort===c.sort?0:y.sort<c.sort?-1:1},5380:(_,x,g)=>{const o=g(443),v=g(2178),y={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:o.URL||URL};x.analyze=function(c,t={}){if(!c)return v.code("DOMAIN_NON_EMPTY_STRING");if(typeof c!="string")throw new Error("Invalid input: domain must be a string");if(c.length>256)return v.code("DOMAIN_TOO_LONG");if(y.nonAsciiRx.test(c)){if(t.allowUnicode===!1)return v.code("DOMAIN_INVALID_UNICODE_CHARS");c=c.normalize("NFC")}if(y.domainControlRx.test(c))return v.code("DOMAIN_INVALID_CHARS");c=y.punycode(c),t.allowFullyQualified&&c[c.length-1]==="."&&(c=c.slice(0,-1));const a=t.minDomainSegments||y.minDomainSegments,s=c.split(".");if(s.length<a)return v.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&s.length>t.maxDomainSegments)return v.code("DOMAIN_SEGMENTS_COUNT_MAX");const n=t.tlds;if(n){const i=s[s.length-1].toLowerCase();if(n.deny&&n.deny.has(i)||n.allow&&!n.allow.has(i))return v.code("DOMAIN_FORBIDDEN_TLDS")}for(let i=0;i<s.length;++i){const h=s[i];if(!h.length)return v.code("DOMAIN_EMPTY_SEGMENT");if(h.length>63)return v.code("DOMAIN_LONG_SEGMENT");if(i<s.length-1){if(!y.domainSegmentRx.test(h))return v.code("DOMAIN_INVALID_CHARS")}else if(!y.tldSegmentRx.test(h))return v.code("DOMAIN_INVALID_TLDS_CHARS")}return null},x.isValid=function(c,t){return!x.analyze(c,t)},y.punycode=function(c){c.includes("%")&&(c=c.replace(/%/g,"%25"));try{return new y.URL(`http://${c}`).host}catch{return c}}},1745:(_,x,g)=>{const o=g(9848),v=g(5380),y=g(2178),c={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};x.analyze=function(t,a){return c.email(t,a)},x.isValid=function(t,a){return!c.email(t,a)},c.email=function(t,a={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return y.code("EMPTY_STRING");const s=!c.nonAsciiRx.test(t);if(!s){if(a.allowUnicode===!1)return y.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}const n=t.split("@");if(n.length!==2)return n.length>2?y.code("MULTIPLE_AT_CHAR"):y.code("MISSING_AT_CHAR");const[i,h]=n;if(!i)return y.code("EMPTY_LOCAL");if(!a.ignoreLength){if(t.length>254)return y.code("ADDRESS_TOO_LONG");if(c.encoder.encode(i).length>64)return y.code("LOCAL_TOO_LONG")}return c.local(i,s)||v.analyze(h,a)},c.local=function(t,a){const s=t.split(".");for(const n of s){if(!n.length)return y.code("EMPTY_LOCAL_SEGMENT");if(a){if(!c.atextRx.test(n))return y.code("INVALID_LOCAL_CHARS")}else for(const i of n){if(c.atextRx.test(i))continue;const h=c.binary(i);if(!c.atomRx.test(h))return y.code("INVALID_LOCAL_CHARS")}}},c.binary=function(t){return Array.from(c.encoder.encode(t)).map(a=>String.fromCharCode(a)).join("")},c.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,c.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(_,x)=>{x.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},x.code=function(g){return{code:g,error:x.codes[g]}}},9959:(_,x,g)=>{const o=g(375),v=g(5752);x.regex=function(y={}){o(y.cidr===void 0||typeof y.cidr=="string","options.cidr must be a string");const c=y.cidr?y.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(c),"options.cidr must be one of required, optional, forbidden"),o(y.version===void 0||typeof y.version=="string"||Array.isArray(y.version),"options.version must be a string or an array of string");let t=y.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t)||(t=[t]),o(t.length>=1,"options.version must have at least 1 version specified");for(let n=0;n<t.length;++n)o(typeof t[n]=="string","options.version must only contain strings"),t[n]=t[n].toLowerCase(),o(["ipv4","ipv6","ipvfuture"].includes(t[n]),"options.version contains unknown version "+t[n]+" - must be one of ipv4, ipv6, ipvfuture");t=Array.from(new Set(t));const a=`(?:${t.map(n=>{if(c==="forbidden")return v.ip[n];const i=`\\/${n==="ipv4"?v.ip.v4Cidr:v.ip.v6Cidr}`;return c==="required"?`${v.ip[n]}${i}`:`${v.ip[n]}(?:${i})?`}).join("|")})`,s=new RegExp(`^${a}$`);return{cidr:c,versions:t,regex:s,raw:a}}},5752:(_,x,g)=>{const o=g(375),v=g(6064),y={generate:function(){const c={},t="\\dA-Fa-f",a="["+t+"]",s="\\w-\\.~",n="!\\$&'\\(\\)\\*\\+,;=",i="%"+t,h=s+i+n+":@",l="["+h+"]",u="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";c.ipv4address="(?:"+u+"\\.){3}"+u;const p=a+"{1,4}",S="(?:"+p+":"+p+"|"+c.ipv4address+")",b="(?:"+p+":){6}"+S,O="::(?:"+p+":){5}"+S,R="(?:"+p+")?::(?:"+p+":){4}"+S,f="(?:(?:"+p+":){0,1}"+p+")?::(?:"+p+":){3}"+S,E="(?:(?:"+p+":){0,2}"+p+")?::(?:"+p+":){2}"+S,j="(?:(?:"+p+":){0,3}"+p+")?::"+p+":"+S,L="(?:(?:"+p+":){0,4}"+p+")?::"+S,B="(?:(?:"+p+":){0,5}"+p+")?::"+p,z="(?:(?:"+p+":){0,6}"+p+")?::";c.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",c.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",c.ipv6address="(?:"+b+"|"+O+"|"+R+"|"+f+"|"+E+"|"+j+"|"+L+"|"+B+"|"+z+")",c.ipvFuture="v"+a+"+\\.["+s+n+":]+",c.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",c.schemeRegex=new RegExp(c.scheme);const ee="["+s+i+n+":]*",ne="["+s+i+n+"]{1,255}",G="(?:\\[(?:"+c.ipv6address+"|"+c.ipvFuture+")\\]|"+c.ipv4address+"|"+ne+")",oe="(?:"+ee+"@)?"+G+"(?::\\d*)?",H="(?:"+ee+"@)?("+G+")(?::\\d*)?",xe=l+"*",Q=l+"+",ve="(?:\\/"+xe+")*",ye="\\/(?:"+Q+ve+")?",$e=Q+ve,Ae="["+s+i+n+"@]+"+ve,Qe="(?:\\/\\/\\/"+xe+ve+")";return c.hierPart="(?:(?:\\/\\/"+oe+ve+")|"+ye+"|"+$e+"|"+Qe+")",c.hierPartCapture="(?:(?:\\/\\/"+H+ve+")|"+ye+"|"+$e+")",c.relativeRef="(?:(?:\\/\\/"+oe+ve+")|"+ye+"|"+Ae+"|)",c.relativeRefCapture="(?:(?:\\/\\/"+H+ve+")|"+ye+"|"+Ae+"|)",c.query="["+h+"\\/\\?]*(?=#|$)",c.queryWithSquareBrackets="["+h+"\\[\\]\\/\\?]*(?=#|$)",c.fragment="["+h+"\\/\\?]*",c}};y.rfc3986=y.generate(),x.ip={v4Cidr:y.rfc3986.ipv4Cidr,v6Cidr:y.rfc3986.ipv6Cidr,ipv4:y.rfc3986.ipv4address,ipv6:y.rfc3986.ipv6address,ipvfuture:y.rfc3986.ipvFuture},y.createRegex=function(c){const t=y.rfc3986,a="(?:\\?"+(c.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",s=c.domain?t.relativeRefCapture:t.relativeRef;if(c.relativeOnly)return y.wrap(s+a);let n="";if(c.scheme){o(c.scheme instanceof RegExp||typeof c.scheme=="string"||Array.isArray(c.scheme),"scheme must be a RegExp, String, or Array");const l=[].concat(c.scheme);o(l.length>=1,"scheme must have at least 1 scheme specified");const u=[];for(let p=0;p<l.length;++p){const S=l[p];o(S instanceof RegExp||typeof S=="string","scheme at position "+p+" must be a RegExp or String"),S instanceof RegExp?u.push(S.source.toString()):(o(t.schemeRegex.test(S),"scheme at position "+p+" must be a valid scheme"),u.push(v(S)))}n=u.join("|")}const i="(?:"+(n?"(?:"+n+")":t.scheme)+":"+(c.domain?t.hierPartCapture:t.hierPart)+")",h=c.allowRelative?"(?:"+i+"|"+s+")":i;return y.wrap(h+a,n)},y.wrap=function(c,t){return{raw:c=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${c}`,regex:new RegExp(`^${c}$`),scheme:t}},y.uriRegex=y.createRegex({}),x.regex=function(c={}){return c.scheme||c.allowRelative||c.relativeOnly||c.allowQuerySquareBrackets||c.domain?y.createRegex(c):y.uriRegex}},1447:(_,x)=>{const g={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};x.Parser=class{constructor(o,v={}){if(!v[g.settings]&&v.constants)for(const y in v.constants){const c=v.constants[y];if(c!==null&&!["boolean","number","string"].includes(typeof c))throw new Error(`Formula constant ${y} contains invalid ${typeof c} value type`)}this.settings=v[g.settings]?v:Object.assign({[g.settings]:!0,constants:{},functions:{}},v),this.single=null,this._parts=null,this._parse(o)}_parse(o){let v=[],y="",c=0,t=!1;const a=n=>{if(c)throw new Error("Formula missing closing parenthesis");const i=v.length?v[v.length-1]:null;if(t||y||n){if(i&&i.type==="reference"&&n===")")return i.type="function",i.value=this._subFormula(y,i.value),void(y="");if(n===")"){const h=new x.Parser(y,this.settings);v.push({type:"segment",value:h})}else if(t){if(t==="]")return v.push({type:"reference",value:y}),void(y="");v.push({type:"literal",value:y})}else if(g.operatorCharacters.includes(y))i&&i.type==="operator"&&g.operators.includes(i.value+y)?i.value+=y:v.push({type:"operator",value:y});else if(y.match(g.numberRx))v.push({type:"constant",value:parseFloat(y)});else if(this.settings.constants[y]!==void 0)v.push({type:"constant",value:this.settings.constants[y]});else{if(!y.match(g.tokenRx))throw new Error(`Formula contains invalid token: ${y}`);v.push({type:"reference",value:y})}y=""}};for(const n of o)t?n===t?(a(),t=!1):y+=n:c?n==="("?(y+=n,++c):n===")"?(--c,c?y+=n:a(n)):y+=n:n in g.literals?t=g.literals[n]:n==="("?(a(),++c):g.operatorCharacters.includes(n)?(a(),y=n,a()):n!==" "?y+=n:a();a(),v=v.map((n,i)=>n.type!=="operator"||n.value!=="-"||i&&v[i-1].type!=="operator"?n:{type:"operator",value:"n"});let s=!1;for(const n of v){if(n.type==="operator"){if(g.operatorsPrefix.includes(n.value))continue;if(!s)throw new Error("Formula contains an operator in invalid position");if(!g.operators.includes(n.value))throw new Error(`Formula contains an unknown operator ${n.value}`)}else if(s)throw new Error("Formula missing expected operator");s=!s}if(!s)throw new Error("Formula contains invalid trailing operator");v.length===1&&["reference","literal","constant"].includes(v[0].type)&&(this.single={type:v[0].type==="reference"?"reference":"value",value:v[0].value}),this._parts=v.map(n=>{if(n.type==="operator")return g.operatorsPrefix.includes(n.value)?n:n.value;if(n.type!=="reference")return n.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(n.value))throw new Error(`Formula contains invalid reference ${n.value}`);return this.settings.reference?this.settings.reference(n.value):g.reference(n.value)})}_subFormula(o,v){const y=this.settings.functions[v];if(typeof y!="function")throw new Error(`Formula contains unknown function ${v}`);let c=[];if(o){let t="",a=0,s=!1;const n=()=>{if(!t)throw new Error(`Formula contains function ${v} with invalid arguments ${o}`);c.push(t),t=""};for(let i=0;i<o.length;++i){const h=o[i];s?(t+=h,h===s&&(s=!1)):h in g.literals&&!a?(t+=h,s=g.literals[h]):h!==","||a?(t+=h,h==="("?++a:h===")"&&--a):n()}n()}return c=c.map(t=>new x.Parser(t,this.settings)),function(t){const a=[];for(const s of c)a.push(s.evaluate(t));return y.call(t,...a)}}evaluate(o){const v=this._parts.slice();for(let y=v.length-2;y>=0;--y){const c=v[y];if(c&&c.type==="operator"){const t=v[y+1];v.splice(y+1,1);const a=g.evaluate(t,o);v[y]=g.single(c.value,a)}}return g.operatorsOrder.forEach(y=>{for(let c=1;c<v.length-1;)if(y.includes(v[c])){const t=v[c],a=g.evaluate(v[c-1],o),s=g.evaluate(v[c+1],o);v.splice(c,2);const n=g.calculate(t,a,s);v[c-1]=n===0?0:n}else c+=2}),g.evaluate(v[0],o)}},x.Parser.prototype[g.symbol]=!0,g.reference=function(o){return function(v){return v&&v[o]!==void 0?v[o]:null}},g.evaluate=function(o,v){return o===null?null:typeof o=="function"?o(v):o[g.symbol]?o.evaluate(v):o},g.single=function(o,v){if(o==="!")return!v;const y=-v;return y===0?0:y},g.calculate=function(o,v,y){if(o==="??")return g.exists(v)?v:y;if(typeof v=="string"||typeof y=="string"){if(o==="+")return(v=g.exists(v)?v:"")+(g.exists(y)?y:"")}else switch(o){case"^":return Math.pow(v,y);case"*":return v*y;case"/":return v/y;case"%":return v%y;case"+":return v+y;case"-":return v-y}switch(o){case"<":return v<y;case"<=":return v<=y;case">":return v>y;case">=":return v>=y;case"==":return v===y;case"!=":return v!==y;case"&&":return v&&y;case"||":return v||y}return null},g.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:_=>{_.exports=JSON.parse('{"version":"17.12.2"}')}},m={},function _(x){var g=m[x];if(g!==void 0)return g.exports;var o=m[x]={exports:{}};return d[x](o,o.exports,_),o.exports}(5107);var d,m})})(Eo);var jo=Eo.exports;const Pu=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Lu=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Nu={charsWide:Pu,charsFullWidth:Lu};const{charsWide:Du,charsFullWidth:Mu}=Nu,ko=new RegExp(`[${Du.join("")}${Mu.join("")}]`,"g"),Fu=e=>e.replace(ko,"xx").length;var Bu={default:Fu,charsRegex:ko};/*!
190
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
191
- *
192
- * Copyright (c) 2014-2016, Jon Schlinkert.
193
- * Licensed under the MIT License.
194
- */var Uu=function(r){if(typeof r!="string"||r==="")return!1;for(var d;d=/(\\).|([@?!+*]\(.*\))/g.exec(r);){if(d[2])return!0;r=r.slice(d.index+d[0].length)}return!1};/*!
195
- * is-glob <https://github.com/jonschlinkert/is-glob>
196
- *
197
- * Copyright (c) 2014-2017, Jon Schlinkert.
198
- * Released under the MIT License.
199
- */var qu=Uu,Ro={"{":"}","(":")","[":"]"},zu=function(e){if(e[0]==="!")return!0;for(var r=0,d=-2,m=-2,_=-2,x=-2,g=-2;r<e.length;){if(e[r]==="*"||e[r+1]==="?"&&/[\].+)]/.test(e[r])||m!==-1&&e[r]==="["&&e[r+1]!=="]"&&(m<r&&(m=e.indexOf("]",r)),m>r&&(g===-1||g>m||(g=e.indexOf("\\",r),g===-1||g>m)))||_!==-1&&e[r]==="{"&&e[r+1]!=="}"&&(_=e.indexOf("}",r),_>r&&(g=e.indexOf("\\",r),g===-1||g>_))||x!==-1&&e[r]==="("&&e[r+1]==="?"&&/[:!=]/.test(e[r+2])&&e[r+3]!==")"&&(x=e.indexOf(")",r),x>r&&(g=e.indexOf("\\",r),g===-1||g>x))||d!==-1&&e[r]==="("&&e[r+1]!=="|"&&(d<r&&(d=e.indexOf("|",r)),d!==-1&&e[d+1]!==")"&&(x=e.indexOf(")",d),x>d&&(g=e.indexOf("\\",d),g===-1||g>x))))return!0;if(e[r]==="\\"){var o=e[r+1];r+=2;var v=Ro[o];if(v){var y=e.indexOf(v,r);y!==-1&&(r=y+1)}if(e[r]==="!")return!0}else r++}return!1},Wu=function(e){if(e[0]==="!")return!0;for(var r=0;r<e.length;){if(/[*?{}()[\]]/.test(e[r]))return!0;if(e[r]==="\\"){var d=e[r+1];r+=2;var m=Ro[d];if(m){var _=e.indexOf(m,r);_!==-1&&(r=_+1)}if(e[r]==="!")return!0}else r++}return!1},Vu=function(r,d){if(typeof r!="string"||r==="")return!1;if(qu(r))return!0;var m=zu;return d&&d.strict===!1&&(m=Wu),m(r)},Un={exports:{}};(function(e,r){var d={};r=e.exports=f;var m;typeof zl=="object"&&d&&d.NODE_DEBUG&&/\bsemver\b/i.test(d.NODE_DEBUG)?m=function(){var k=Array.prototype.slice.call(arguments,0);k.unshift("SEMVER"),console.log.apply(console,k)}:m=function(){},r.SEMVER_SPEC_VERSION="2.0.0";var _=256,x=Number.MAX_SAFE_INTEGER||9007199254740991,g=16,o=_-6,v=r.re=[],y=r.safeRe=[],c=r.src=[],t=r.tokens={},a=0;function s(k){t[k]=a++}var n="[a-zA-Z0-9-]",i=[["\\s",1],["\\d",_],[n,o]];function h(k){for(var A=0;A<i.length;A++){var N=i[A][0],U=i[A][1];k=k.split(N+"*").join(N+"{0,"+U+"}").split(N+"+").join(N+"{1,"+U+"}")}return k}s("NUMERICIDENTIFIER"),c[t.NUMERICIDENTIFIER]="0|[1-9]\\d*",s("NUMERICIDENTIFIERLOOSE"),c[t.NUMERICIDENTIFIERLOOSE]="\\d+",s("NONNUMERICIDENTIFIER"),c[t.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+n+"*",s("MAINVERSION"),c[t.MAINVERSION]="("+c[t.NUMERICIDENTIFIER]+")\\.("+c[t.NUMERICIDENTIFIER]+")\\.("+c[t.NUMERICIDENTIFIER]+")",s("MAINVERSIONLOOSE"),c[t.MAINVERSIONLOOSE]="("+c[t.NUMERICIDENTIFIERLOOSE]+")\\.("+c[t.NUMERICIDENTIFIERLOOSE]+")\\.("+c[t.NUMERICIDENTIFIERLOOSE]+")",s("PRERELEASEIDENTIFIER"),c[t.PRERELEASEIDENTIFIER]="(?:"+c[t.NUMERICIDENTIFIER]+"|"+c[t.NONNUMERICIDENTIFIER]+")",s("PRERELEASEIDENTIFIERLOOSE"),c[t.PRERELEASEIDENTIFIERLOOSE]="(?:"+c[t.NUMERICIDENTIFIERLOOSE]+"|"+c[t.NONNUMERICIDENTIFIER]+")",s("PRERELEASE"),c[t.PRERELEASE]="(?:-("+c[t.PRERELEASEIDENTIFIER]+"(?:\\."+c[t.PRERELEASEIDENTIFIER]+")*))",s("PRERELEASELOOSE"),c[t.PRERELEASELOOSE]="(?:-?("+c[t.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+c[t.PRERELEASEIDENTIFIERLOOSE]+")*))",s("BUILDIDENTIFIER"),c[t.BUILDIDENTIFIER]=n+"+",s("BUILD"),c[t.BUILD]="(?:\\+("+c[t.BUILDIDENTIFIER]+"(?:\\."+c[t.BUILDIDENTIFIER]+")*))",s("FULL"),s("FULLPLAIN"),c[t.FULLPLAIN]="v?"+c[t.MAINVERSION]+c[t.PRERELEASE]+"?"+c[t.BUILD]+"?",c[t.FULL]="^"+c[t.FULLPLAIN]+"$",s("LOOSEPLAIN"),c[t.LOOSEPLAIN]="[v=\\s]*"+c[t.MAINVERSIONLOOSE]+c[t.PRERELEASELOOSE]+"?"+c[t.BUILD]+"?",s("LOOSE"),c[t.LOOSE]="^"+c[t.LOOSEPLAIN]+"$",s("GTLT"),c[t.GTLT]="((?:<|>)?=?)",s("XRANGEIDENTIFIERLOOSE"),c[t.XRANGEIDENTIFIERLOOSE]=c[t.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",s("XRANGEIDENTIFIER"),c[t.XRANGEIDENTIFIER]=c[t.NUMERICIDENTIFIER]+"|x|X|\\*",s("XRANGEPLAIN"),c[t.XRANGEPLAIN]="[v=\\s]*("+c[t.XRANGEIDENTIFIER]+")(?:\\.("+c[t.XRANGEIDENTIFIER]+")(?:\\.("+c[t.XRANGEIDENTIFIER]+")(?:"+c[t.PRERELEASE]+")?"+c[t.BUILD]+"?)?)?",s("XRANGEPLAINLOOSE"),c[t.XRANGEPLAINLOOSE]="[v=\\s]*("+c[t.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[t.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[t.XRANGEIDENTIFIERLOOSE]+")(?:"+c[t.PRERELEASELOOSE]+")?"+c[t.BUILD]+"?)?)?",s("XRANGE"),c[t.XRANGE]="^"+c[t.GTLT]+"\\s*"+c[t.XRANGEPLAIN]+"$",s("XRANGELOOSE"),c[t.XRANGELOOSE]="^"+c[t.GTLT]+"\\s*"+c[t.XRANGEPLAINLOOSE]+"$",s("COERCE"),c[t.COERCE]="(^|[^\\d])(\\d{1,"+g+"})(?:\\.(\\d{1,"+g+"}))?(?:\\.(\\d{1,"+g+"}))?(?:$|[^\\d])",s("COERCERTL"),v[t.COERCERTL]=new RegExp(c[t.COERCE],"g"),y[t.COERCERTL]=new RegExp(h(c[t.COERCE]),"g"),s("LONETILDE"),c[t.LONETILDE]="(?:~>?)",s("TILDETRIM"),c[t.TILDETRIM]="(\\s*)"+c[t.LONETILDE]+"\\s+",v[t.TILDETRIM]=new RegExp(c[t.TILDETRIM],"g"),y[t.TILDETRIM]=new RegExp(h(c[t.TILDETRIM]),"g");var l="$1~";s("TILDE"),c[t.TILDE]="^"+c[t.LONETILDE]+c[t.XRANGEPLAIN]+"$",s("TILDELOOSE"),c[t.TILDELOOSE]="^"+c[t.LONETILDE]+c[t.XRANGEPLAINLOOSE]+"$",s("LONECARET"),c[t.LONECARET]="(?:\\^)",s("CARETTRIM"),c[t.CARETTRIM]="(\\s*)"+c[t.LONECARET]+"\\s+",v[t.CARETTRIM]=new RegExp(c[t.CARETTRIM],"g"),y[t.CARETTRIM]=new RegExp(h(c[t.CARETTRIM]),"g");var u="$1^";s("CARET"),c[t.CARET]="^"+c[t.LONECARET]+c[t.XRANGEPLAIN]+"$",s("CARETLOOSE"),c[t.CARETLOOSE]="^"+c[t.LONECARET]+c[t.XRANGEPLAINLOOSE]+"$",s("COMPARATORLOOSE"),c[t.COMPARATORLOOSE]="^"+c[t.GTLT]+"\\s*("+c[t.LOOSEPLAIN]+")$|^$",s("COMPARATOR"),c[t.COMPARATOR]="^"+c[t.GTLT]+"\\s*("+c[t.FULLPLAIN]+")$|^$",s("COMPARATORTRIM"),c[t.COMPARATORTRIM]="(\\s*)"+c[t.GTLT]+"\\s*("+c[t.LOOSEPLAIN]+"|"+c[t.XRANGEPLAIN]+")",v[t.COMPARATORTRIM]=new RegExp(c[t.COMPARATORTRIM],"g"),y[t.COMPARATORTRIM]=new RegExp(h(c[t.COMPARATORTRIM]),"g");var p="$1$2$3";s("HYPHENRANGE"),c[t.HYPHENRANGE]="^\\s*("+c[t.XRANGEPLAIN]+")\\s+-\\s+("+c[t.XRANGEPLAIN]+")\\s*$",s("HYPHENRANGELOOSE"),c[t.HYPHENRANGELOOSE]="^\\s*("+c[t.XRANGEPLAINLOOSE]+")\\s+-\\s+("+c[t.XRANGEPLAINLOOSE]+")\\s*$",s("STAR"),c[t.STAR]="(<|>)?=?\\s*\\*";for(var S=0;S<a;S++)m(S,c[S]),v[S]||(v[S]=new RegExp(c[S]),y[S]=new RegExp(h(c[S])));r.parse=b;function b(k,A){if((!A||typeof A!="object")&&(A={loose:!!A,includePrerelease:!1}),k instanceof f)return k;if(typeof k!="string"||k.length>_)return null;var N=A.loose?y[t.LOOSE]:y[t.FULL];if(!N.test(k))return null;try{return new f(k,A)}catch{return null}}r.valid=O;function O(k,A){var N=b(k,A);return N?N.version:null}r.clean=R;function R(k,A){var N=b(k.trim().replace(/^[=v]+/,""),A);return N?N.version:null}r.SemVer=f;function f(k,A){if((!A||typeof A!="object")&&(A={loose:!!A,includePrerelease:!1}),k instanceof f){if(k.loose===A.loose)return k;k=k.version}else if(typeof k!="string")throw new TypeError("Invalid Version: "+k);if(k.length>_)throw new TypeError("version is longer than "+_+" characters");if(!(this instanceof f))return new f(k,A);m("SemVer",k,A),this.options=A,this.loose=!!A.loose;var N=k.trim().match(A.loose?y[t.LOOSE]:y[t.FULL]);if(!N)throw new TypeError("Invalid Version: "+k);if(this.raw=k,this.major=+N[1],this.minor=+N[2],this.patch=+N[3],this.major>x||this.major<0)throw new TypeError("Invalid major version");if(this.minor>x||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>x||this.patch<0)throw new TypeError("Invalid patch version");N[4]?this.prerelease=N[4].split(".").map(function(U){if(/^[0-9]+$/.test(U)){var V=+U;if(V>=0&&V<x)return V}return U}):this.prerelease=[],this.build=N[5]?N[5].split("."):[],this.format()}f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.toString=function(){return this.version},f.prototype.compare=function(k){return m("SemVer.compare",this.version,this.options,k),k instanceof f||(k=new f(k,this.options)),this.compareMain(k)||this.comparePre(k)},f.prototype.compareMain=function(k){return k instanceof f||(k=new f(k,this.options)),B(this.major,k.major)||B(this.minor,k.minor)||B(this.patch,k.patch)},f.prototype.comparePre=function(k){if(k instanceof f||(k=new f(k,this.options)),this.prerelease.length&&!k.prerelease.length)return-1;if(!this.prerelease.length&&k.prerelease.length)return 1;if(!this.prerelease.length&&!k.prerelease.length)return 0;var A=0;do{var N=this.prerelease[A],U=k.prerelease[A];if(m("prerelease compare",A,N,U),N===void 0&&U===void 0)return 0;if(U===void 0)return 1;if(N===void 0)return-1;if(N===U)continue;return B(N,U)}while(++A)},f.prototype.compareBuild=function(k){k instanceof f||(k=new f(k,this.options));var A=0;do{var N=this.build[A],U=k.build[A];if(m("prerelease compare",A,N,U),N===void 0&&U===void 0)return 0;if(U===void 0)return 1;if(N===void 0)return-1;if(N===U)continue;return B(N,U)}while(++A)},f.prototype.inc=function(k,A){switch(k){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",A);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",A);break;case"prepatch":this.prerelease.length=0,this.inc("patch",A),this.inc("pre",A);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",A),this.inc("pre",A);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 N=this.prerelease.length;--N>=0;)typeof this.prerelease[N]=="number"&&(this.prerelease[N]++,N=-2);N===-1&&this.prerelease.push(0)}A&&(this.prerelease[0]===A?isNaN(this.prerelease[1])&&(this.prerelease=[A,0]):this.prerelease=[A,0]);break;default:throw new Error("invalid increment argument: "+k)}return this.format(),this.raw=this.version,this},r.inc=E;function E(k,A,N,U){typeof N=="string"&&(U=N,N=void 0);try{return new f(k,N).inc(A,U).version}catch{return null}}r.diff=j;function j(k,A){if(Qe(k,A))return null;var N=b(k),U=b(A),V="";if(N.prerelease.length||U.prerelease.length){V="pre";var te="prerelease"}for(var re in N)if((re==="major"||re==="minor"||re==="patch")&&N[re]!==U[re])return V+re;return te}r.compareIdentifiers=B;var L=/^[0-9]+$/;function B(k,A){var N=L.test(k),U=L.test(A);return N&&U&&(k=+k,A=+A),k===A?0:N&&!U?-1:U&&!N?1:k<A?-1:1}r.rcompareIdentifiers=z;function z(k,A){return B(A,k)}r.major=ee;function ee(k,A){return new f(k,A).major}r.minor=ne;function ne(k,A){return new f(k,A).minor}r.patch=G;function G(k,A){return new f(k,A).patch}r.compare=oe;function oe(k,A,N){return new f(k,N).compare(new f(A,N))}r.compareLoose=H;function H(k,A){return oe(k,A,!0)}r.compareBuild=xe;function xe(k,A,N){var U=new f(k,N),V=new f(A,N);return U.compare(V)||U.compareBuild(V)}r.rcompare=Q;function Q(k,A,N){return oe(A,k,N)}r.sort=ve;function ve(k,A){return k.sort(function(N,U){return r.compareBuild(N,U,A)})}r.rsort=ye;function ye(k,A){return k.sort(function(N,U){return r.compareBuild(U,N,A)})}r.gt=$e;function $e(k,A,N){return oe(k,A,N)>0}r.lt=Ae;function Ae(k,A,N){return oe(k,A,N)<0}r.eq=Qe;function Qe(k,A,N){return oe(k,A,N)===0}r.neq=gt;function gt(k,A,N){return oe(k,A,N)!==0}r.gte=st;function st(k,A,N){return oe(k,A,N)>=0}r.lte=Ht;function Ht(k,A,N){return oe(k,A,N)<=0}r.cmp=Ke;function Ke(k,A,N,U){switch(A){case"===":return typeof k=="object"&&(k=k.version),typeof N=="object"&&(N=N.version),k===N;case"!==":return typeof k=="object"&&(k=k.version),typeof N=="object"&&(N=N.version),k!==N;case"":case"=":case"==":return Qe(k,N,U);case"!=":return gt(k,N,U);case">":return $e(k,N,U);case">=":return st(k,N,U);case"<":return Ae(k,N,U);case"<=":return Ht(k,N,U);default:throw new TypeError("Invalid operator: "+A)}}r.Comparator=je;function je(k,A){if((!A||typeof A!="object")&&(A={loose:!!A,includePrerelease:!1}),k instanceof je){if(k.loose===!!A.loose)return k;k=k.value}if(!(this instanceof je))return new je(k,A);k=k.trim().split(/\s+/).join(" "),m("comparator",k,A),this.options=A,this.loose=!!A.loose,this.parse(k),this.semver===yt?this.value="":this.value=this.operator+this.semver.version,m("comp",this)}var yt={};je.prototype.parse=function(k){var A=this.options.loose?y[t.COMPARATORLOOSE]:y[t.COMPARATOR],N=k.match(A);if(!N)throw new TypeError("Invalid comparator: "+k);this.operator=N[1]!==void 0?N[1]:"",this.operator==="="&&(this.operator=""),N[2]?this.semver=new f(N[2],this.options.loose):this.semver=yt},je.prototype.toString=function(){return this.value},je.prototype.test=function(k){if(m("Comparator.test",k,this.options.loose),this.semver===yt||k===yt)return!0;if(typeof k=="string")try{k=new f(k,this.options)}catch{return!1}return Ke(k,this.operator,this.semver,this.options)},je.prototype.intersects=function(k,A){if(!(k instanceof je))throw new TypeError("a Comparator is required");(!A||typeof A!="object")&&(A={loose:!!A,includePrerelease:!1});var N;if(this.operator==="")return this.value===""?!0:(N=new ke(k.value,A),Pe(this.value,N,A));if(k.operator==="")return k.value===""?!0:(N=new ke(this.value,A),Pe(k.semver,N,A));var U=(this.operator===">="||this.operator===">")&&(k.operator===">="||k.operator===">"),V=(this.operator==="<="||this.operator==="<")&&(k.operator==="<="||k.operator==="<"),te=this.semver.version===k.semver.version,re=(this.operator===">="||this.operator==="<=")&&(k.operator===">="||k.operator==="<="),be=Ke(this.semver,"<",k.semver,A)&&(this.operator===">="||this.operator===">")&&(k.operator==="<="||k.operator==="<"),pe=Ke(this.semver,">",k.semver,A)&&(this.operator==="<="||this.operator==="<")&&(k.operator===">="||k.operator===">");return U||V||te&&re||be||pe},r.Range=ke;function ke(k,A){if((!A||typeof A!="object")&&(A={loose:!!A,includePrerelease:!1}),k instanceof ke)return k.loose===!!A.loose&&k.includePrerelease===!!A.includePrerelease?k:new ke(k.raw,A);if(k instanceof je)return new ke(k.value,A);if(!(this instanceof ke))return new ke(k,A);if(this.options=A,this.loose=!!A.loose,this.includePrerelease=!!A.includePrerelease,this.raw=k.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(N){return this.parseRange(N.trim())},this).filter(function(N){return N.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ke.prototype.format=function(){return this.range=this.set.map(function(k){return k.join(" ").trim()}).join("||").trim(),this.range},ke.prototype.toString=function(){return this.range},ke.prototype.parseRange=function(k){var A=this.options.loose,N=A?y[t.HYPHENRANGELOOSE]:y[t.HYPHENRANGE];k=k.replace(N,vt),m("hyphen replace",k),k=k.replace(y[t.COMPARATORTRIM],p),m("comparator trim",k,y[t.COMPARATORTRIM]),k=k.replace(y[t.TILDETRIM],l),k=k.replace(y[t.CARETTRIM],u),k=k.split(/\s+/).join(" ");var U=A?y[t.COMPARATORLOOSE]:y[t.COMPARATOR],V=k.split(" ").map(function(te){return et(te,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(V=V.filter(function(te){return!!te.match(U)})),V=V.map(function(te){return new je(te,this.options)},this),V},ke.prototype.intersects=function(k,A){if(!(k instanceof ke))throw new TypeError("a Range is required");return this.set.some(function(N){return $t(N,A)&&k.set.some(function(U){return $t(U,A)&&N.every(function(V){return U.every(function(te){return V.intersects(te,A)})})})})};function $t(k,A){for(var N=!0,U=k.slice(),V=U.pop();N&&U.length;)N=U.every(function(te){return V.intersects(te,A)}),V=U.pop();return N}r.toComparators=Xt;function Xt(k,A){return new ke(k,A).set.map(function(N){return N.map(function(U){return U.value}).join(" ").trim().split(" ")})}function et(k,A){return m("comp",k,A),k=dr(k,A),m("caret",k),k=cr(k,A),m("tildes",k),k=_t(k,A),m("xrange",k),k=St(k,A),m("stars",k),k}function Le(k){return!k||k.toLowerCase()==="x"||k==="*"}function cr(k,A){return k.trim().split(/\s+/).map(function(N){return ur(N,A)}).join(" ")}function ur(k,A){var N=A.loose?y[t.TILDELOOSE]:y[t.TILDE];return k.replace(N,function(U,V,te,re,be){m("tilde",k,U,V,te,re,be);var pe;return Le(V)?pe="":Le(te)?pe=">="+V+".0.0 <"+(+V+1)+".0.0":Le(re)?pe=">="+V+"."+te+".0 <"+V+"."+(+te+1)+".0":be?(m("replaceTilde pr",be),pe=">="+V+"."+te+"."+re+"-"+be+" <"+V+"."+(+te+1)+".0"):pe=">="+V+"."+te+"."+re+" <"+V+"."+(+te+1)+".0",m("tilde return",pe),pe})}function dr(k,A){return k.trim().split(/\s+/).map(function(N){return tt(N,A)}).join(" ")}function tt(k,A){m("caret",k,A);var N=A.loose?y[t.CARETLOOSE]:y[t.CARET];return k.replace(N,function(U,V,te,re,be){m("caret",k,U,V,te,re,be);var pe;return Le(V)?pe="":Le(te)?pe=">="+V+".0.0 <"+(+V+1)+".0.0":Le(re)?V==="0"?pe=">="+V+"."+te+".0 <"+V+"."+(+te+1)+".0":pe=">="+V+"."+te+".0 <"+(+V+1)+".0.0":be?(m("replaceCaret pr",be),V==="0"?te==="0"?pe=">="+V+"."+te+"."+re+"-"+be+" <"+V+"."+te+"."+(+re+1):pe=">="+V+"."+te+"."+re+"-"+be+" <"+V+"."+(+te+1)+".0":pe=">="+V+"."+te+"."+re+"-"+be+" <"+(+V+1)+".0.0"):(m("no pr"),V==="0"?te==="0"?pe=">="+V+"."+te+"."+re+" <"+V+"."+te+"."+(+re+1):pe=">="+V+"."+te+"."+re+" <"+V+"."+(+te+1)+".0":pe=">="+V+"."+te+"."+re+" <"+(+V+1)+".0.0"),m("caret return",pe),pe})}function _t(k,A){return m("replaceXRanges",k,A),k.split(/\s+/).map(function(N){return hr(N,A)}).join(" ")}function hr(k,A){k=k.trim();var N=A.loose?y[t.XRANGELOOSE]:y[t.XRANGE];return k.replace(N,function(U,V,te,re,be,pe){m("xRange",k,U,V,te,re,be,pe);var Ze=Le(te),ze=Ze||Le(re),Oe=ze||Le(be),Me=Oe;return V==="="&&Me&&(V=""),pe=A.includePrerelease?"-0":"",Ze?V===">"||V==="<"?U="<0.0.0-0":U="*":V&&Me?(ze&&(re=0),be=0,V===">"?(V=">=",ze?(te=+te+1,re=0,be=0):(re=+re+1,be=0)):V==="<="&&(V="<",ze?te=+te+1:re=+re+1),U=V+te+"."+re+"."+be+pe):ze?U=">="+te+".0.0"+pe+" <"+(+te+1)+".0.0"+pe:Oe&&(U=">="+te+"."+re+".0"+pe+" <"+te+"."+(+re+1)+".0"+pe),m("xRange return",U),U})}function St(k,A){return m("replaceStars",k,A),k.trim().replace(y[t.STAR],"")}function vt(k,A,N,U,V,te,re,be,pe,Ze,ze,Oe,Me){return Le(N)?A="":Le(U)?A=">="+N+".0.0":Le(V)?A=">="+N+"."+U+".0":A=">="+A,Le(pe)?be="":Le(Ze)?be="<"+(+pe+1)+".0.0":Le(ze)?be="<"+pe+"."+(+Ze+1)+".0":Oe?be="<="+pe+"."+Ze+"."+ze+"-"+Oe:be="<="+be,(A+" "+be).trim()}ke.prototype.test=function(k){if(!k)return!1;if(typeof k=="string")try{k=new f(k,this.options)}catch{return!1}for(var A=0;A<this.set.length;A++)if(dt(this.set[A],k,this.options))return!0;return!1};function dt(k,A,N){for(var U=0;U<k.length;U++)if(!k[U].test(A))return!1;if(A.prerelease.length&&!N.includePrerelease){for(U=0;U<k.length;U++)if(m(k[U].semver),k[U].semver!==yt&&k[U].semver.prerelease.length>0){var V=k[U].semver;if(V.major===A.major&&V.minor===A.minor&&V.patch===A.patch)return!0}return!1}return!0}r.satisfies=Pe;function Pe(k,A,N){try{A=new ke(A,N)}catch{return!1}return A.test(k)}r.maxSatisfying=Et;function Et(k,A,N){var U=null,V=null;try{var te=new ke(A,N)}catch{return null}return k.forEach(function(re){te.test(re)&&(!U||V.compare(re)===-1)&&(U=re,V=new f(U,N))}),U}r.minSatisfying=qt;function qt(k,A,N){var U=null,V=null;try{var te=new ke(A,N)}catch{return null}return k.forEach(function(re){te.test(re)&&(!U||V.compare(re)===1)&&(U=re,V=new f(U,N))}),U}r.minVersion=Yt;function Yt(k,A){k=new ke(k,A);var N=new f("0.0.0");if(k.test(N)||(N=new f("0.0.0-0"),k.test(N)))return N;N=null;for(var U=0;U<k.set.length;++U){var V=k.set[U];V.forEach(function(te){var re=new f(te.semver.version);switch(te.operator){case">":re.prerelease.length===0?re.patch++:re.prerelease.push(0),re.raw=re.format();case"":case">=":(!N||$e(N,re))&&(N=re);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+te.operator)}})}return N&&k.test(N)?N:null}r.validRange=Zt;function Zt(k,A){try{return new ke(k,A).range||"*"}catch{return null}}r.ltr=At;function At(k,A,N){return q(k,A,"<",N)}r.gtr=fr;function fr(k,A,N){return q(k,A,">",N)}r.outside=q;function q(k,A,N,U){k=new f(k,U),A=new ke(A,U);var V,te,re,be,pe;switch(N){case">":V=$e,te=Ht,re=Ae,be=">",pe=">=";break;case"<":V=Ae,te=st,re=$e,be="<",pe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Pe(k,A,U))return!1;for(var Ze=0;Ze<A.set.length;++Ze){var ze=A.set[Ze],Oe=null,Me=null;if(ze.forEach(function(Ge){Ge.semver===yt&&(Ge=new je(">=0.0.0")),Oe=Oe||Ge,Me=Me||Ge,V(Ge.semver,Oe.semver,U)?Oe=Ge:re(Ge.semver,Me.semver,U)&&(Me=Ge)}),Oe.operator===be||Oe.operator===pe||(!Me.operator||Me.operator===be)&&te(k,Me.semver))return!1;if(Me.operator===pe&&re(k,Me.semver))return!1}return!0}r.prerelease=jt;function jt(k,A){var N=b(k,A);return N&&N.prerelease.length?N.prerelease:null}r.intersects=le;function le(k,A,N){return k=new ke(k,N),A=new ke(A,N),k.intersects(A)}r.coerce=fe;function fe(k,A){if(k instanceof f)return k;if(typeof k=="number"&&(k=String(k)),typeof k!="string")return null;A=A||{};var N=null;if(!A.rtl)N=k.match(y[t.COERCE]);else{for(var U;(U=y[t.COERCERTL].exec(k))&&(!N||N.index+N[0].length!==k.length);)(!N||U.index+U[0].length!==N.index+N[0].length)&&(N=U),y[t.COERCERTL].lastIndex=U.index+U[1].length+U[2].length;y[t.COERCERTL].lastIndex=-1}return N===null?null:b(N[2]+"."+(N[3]||"0")+"."+(N[4]||"0"),A)}})(Un,Un.exports);var Ku=Un.exports;const Oo=jo,It=Ku,We="semver",Gu={base:Oo.string(),type:"semverRange",validate:function(e,{error:r}){return It.validRange(e)?{value:e}:{errors:r(`${We}.valid`)}},messages:{[`${We}.valid`]:"{{#label}} needs to be a valid semver range"}},lr={};lr.compare={method:!1,validate:function(e,r,{exp:d},{name:m}){return It[m](e,d)?e:r.error(`${We}.${m}`,{exp:d})},args:[{name:"exp",assert:It.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){lr[e]={method:function(r){return this.$_addRule({name:e,method:"compare",args:{exp:r}})}}});lr.cmp={method:function(e,r){return this.$_addRule({name:"cmp",args:{cmp:e,exp:r}})},validate:function(e,r,{cmp:d,exp:m}){return It.cmp(e,d,m)?e:r.error(`${We}.cmp`,{cmp:d,exp:m})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:It.valid,message:"needs to be a valid semver expression"}]};lr.compareRange={method:!1,validate:function(e,r,{rng:d},{name:m}){return It[m](e,d)?e:r.error(`${We}.${m}`,{rng:d})},args:[{name:"rng",assert:It.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){lr[e]={method:function(r){return this.$_addRule({name:e,method:"compareRange",args:{rng:r}})}}});lr.outside={method:function(e,r){return this.$_addRule({name:"outside",args:{hilo:e,rng:r}})},validate:function(e,r,{hilo:d,rng:m}){return It.outside(e,m,d)?e:r.error(`${We}.outside`,{hilo:d,rng:m})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:It.validRange,message:"needs to be a valid semver range"}]};const Hu={base:Oo.string(),type:"semver",validate:function(e,{error:r}){return It.valid(e)?{value:e}:{errors:r(`${We}.valid`)}},messages:{[`${We}.valid`]:"{{#label}} needs to be a valid semver expression",[`${We}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${We}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${We}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${We}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${We}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${We}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${We}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${We}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${We}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${We}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${We}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:lr};var Xu={semver:Hu,semverRange:Gu};/*!
200
- * is-var-name | ISC (c) Shinnosuke Watanabe
201
- * https://github.com/shinnn/is-var-name
202
- */function Yu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const Zu=Object.freeze(Object.defineProperty({__proto__:null,default:Yu},Symbol.toStringTag,{value:"Module"})),Ju=Hs(Zu),Qu=Qa,ed=el,gs=un,td=e=>{if((0,gs.isValid)(e))return e;const r=(0,ed.toHex)(Wl.from(typeof e=="string"?e.trim():e));return(0,gs.fromPublicKey)(r,{role:Qu.types.RoleType.ROLE_ANY})};var rd=td,or={},To=Ie&&Ie.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(or,"__esModule",{value:!0});or.didExtension=or.fileExtension=void 0;const ys=To(So),nd=To(Xl),id=un,Co=e=>({type:"file",base:e.string(),validate(r,{error:d}){return r&&typeof r=="string"?{value:r}:{errors:d("file.empty",{file:r})}},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:r=null,canSkip:d=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:r,canSkip:d}})},args:[{name:"baseDir",assert:r=>ys.default.existsSync(r),message:"baseDir must exist"},{name:"canSkip",assert:r=>typeof r=="function",message:"canSkip must be a function"}],validate(r,{error:d},{baseDir:m,canSkip:_}={}){if(typeof _=="function"&&_(m,r))return r;try{return ys.default.statSync(nd.default.join(m,r)),r}catch(x){switch(x.code){case"ENOENT":return d("file.enoent",{file:r})}return d("file.error.generic",{message:x.message})}}}}});or.fileExtension=Co;const Io=e=>({type:"DID",base:e.string(),validate(r,{error:d}){return!r||typeof r!="string"?{errors:d("did.empty",{did:r})}:(0,id.isValid)(r)===!1?{errors:d("did.invalid",{did:r})}:{value:r}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});or.didExtension=Io;or.default={fileExtension:Co,didExtension:Io};var ui={},$o={exports:{}};const sd=["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 Ao=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),od=sd,ad=["node_modules","favicon.ico"],ld=$o.exports=function(e){var r=[],d=[];if(e===null)return d.push("name cannot be null"),Nr(r,d);if(e===void 0)return d.push("name cannot be undefined"),Nr(r,d);if(typeof e!="string")return d.push("name must be a string"),Nr(r,d);if(e.length||d.push("name length must be greater than zero"),e.match(/^\./)&&d.push("name cannot start with a period"),e.match(/^_/)&&d.push("name cannot start with an underscore"),e.trim()!==e&&d.push("name cannot contain leading or trailing spaces"),ad.forEach(function(g){e.toLowerCase()===g&&d.push(g+" is a blacklisted name")}),od.forEach(function(g){e.toLowerCase()===g&&r.push(g+" is a core module name")}),e.length>214&&r.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&r.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&r.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var m=e.match(Ao);if(m){var _=m[1],x=m[2];if(encodeURIComponent(_)===_&&encodeURIComponent(x)===x)return Nr(r,d)}d.push("name can only contain URL-friendly characters")}return Nr(r,d)};ld.scopedPackagePattern=Ao;var Nr=function(e,r){var d={validForNewPackages:r.length===0&&e.length===0,validForOldPackages:r.length===0,warnings:e,errors:r};return d.warnings.length||delete d.warnings,d.errors.length||delete d.errors,d},cd=$o.exports;(function(e){var r=Ie&&Ie.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const d=un,m=r(cd),_=32,x=o=>{if((0,d.toTypeInfo)(o).role!==d.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=x;const g=(o,{checkDid:v=!0}={})=>{if((0,d.isValid)(o))v&&(0,e.validateNewDid)(o);else{const{validForNewPackages:y,errors:c=[],warnings:t=[]}=(0,m.default)(o);if(!y)throw new Error(c[0]||t[0]);if(o.length>_)throw new Error("Blocklet name is too long")}};e.validateName=g,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(ui);var ud=Ie&&Ie.__createBinding||(Object.create?function(e,r,d,m){m===void 0&&(m=d);var _=Object.getOwnPropertyDescriptor(r,d);(!_||("get"in _?!r.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return r[d]}}),Object.defineProperty(e,m,_)}:function(e,r,d,m){m===void 0&&(m=d),e[m]=r[d]}),dd=Ie&&Ie.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),hd=Ie&&Ie.__importStar||function(){var e=function(r){return e=Object.getOwnPropertyNames||function(d){var m=[];for(var _ in d)Object.prototype.hasOwnProperty.call(d,_)&&(m[m.length]=_);return m},e(r)};return function(r){if(r&&r.__esModule)return r;var d={};if(r!=null)for(var m=e(r),_=0;_<m.length;_++)m[_]!=="default"&&ud(d,r,m[_]);return dd(d,r),d}}(),Rr=Ie&&Ie.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ce,"__esModule",{value:!0});ce.Joi=ce.installBlockletDescriptionSchema=ce.installBlockletTitleSchema=ce.resourceBundleSchema=ce.authConfigSchema=ce.cacheableSchema=ce.statsSchema=ce.titleSchema=ce.themeSchema=ce.signatureSchema=ce.serviceSchema=ce.scriptsSchema=ce.personSchema=ce.navigationSchema=ce.navigationItemSchema=ce.updateMountPointSchema=ce.mountPointSchema=ce.logoSchema=ce.interfaceSchema=ce.environmentNameSchema=ce.environmentSchema=ce.engineSchema=ce.endpointSchema=ce.distSchema=ce.descriptionSchema=ce.createBlockletSchema=ce.componentSchema=ce.blockletNameSchema=ce.blockletMetaSchema=void 0;const fd=Rr(So),pd=Rr(jo),md=Rr(Bu),gd=Rr(Vu),vs=Xu,yd=Rr(Ju),bs=Zs,vd=un,Be=Ct,bd=Rr(rd),xs=or,qn=ui,di=hd(bl),xd=md.default.default,ws="/.well-known",T=pd.default.extend(vs.semver).extend(vs.semverRange).extend(xs.fileExtension).extend(xs.didExtension);ce.Joi=T;const _s=(e,r)=>(0,di.checkLink)(e)?e:r.message(`Invalid navigation link: ${e}
203
-
204
- A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
205
- - /en/home
206
- - /zh/home
207
- - https://www.arcblock.io
208
- `),wd=(e,r)=>!e||(0,yd.default)(e)?e:r.message(`Invalid navigation id: ${e}
209
-
210
- A valid navigation id is should follow the rules of javascript variables, such as:
211
- - foo
212
- - fooBar
213
- - foo123
214
-
215
- see detail in https://www.npmjs.com/package/is-var-name
216
- `),gn=T.string().trim().min(1).custom(e=>{if(xd(e)>Be.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Be.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);if(e.includes("."))throw new Error('title cannot contain "."');return e}).meta({className:"TTitle"});ce.titleSchema=gn;const yn=T.string().trim().min(3).max(160).meta({className:"TDescription"});ce.descriptionSchema=yn;const Po=T.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});ce.installBlockletTitleSchema=Po;const Lo=T.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});ce.installBlockletDescriptionSchema=Lo;const No=T.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,r)=>e.includes(bs.WELLKNOWN_BLOCKLET_LOGO_PATH)?r.message(`logo url should not include ${bs.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});ce.logoSchema=No;const Do=T.string().trim().min(1),hi=Do.meta({className:"TMountPoint"}).custom((e,r)=>(0,di.isValidUrlPath)(e)?e:r.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));ce.mountPointSchema=hi;const Mo=Do.meta({className:"TUpdateMountPoint"}).custom(e=>(0,di.default)(e));ce.updateMountPointSchema=Mo;const kr=T.string().custom(e=>((0,qn.validateName)(e),e)).meta({className:"TBlockletName"});ce.blockletNameSchema=kr;const _d=[],fi=T.string().trim().min(1).max(50).required().custom((e,r)=>e.startsWith("BLOCKLET")&&!_d.includes(e)?r.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?r.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?r.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?r.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});ce.environmentNameSchema=fi;const pi=T.object({name:fi.required(),description:T.string().trim().required(),default:T.string().optional().allow("").default(""),required:T.boolean().default(!1),secure:T.boolean().default(!1),validation:T.string().optional(),shared:T.boolean().default(e=>e.secure?!1:void 0)}).custom((e,r)=>e.secure&&e.default?r.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});ce.environmentSchema=pi;const mi=T.object({dev:T.string().trim().min(1),e2eDev:T.string().trim().min(1),preFlight:T.string().trim().min(1),preInstall:T.string().trim().min(1),postInstall:T.string().trim().min(1),preStart:T.string().trim().min(1),postStart:T.string().trim().min(1),preStop:T.string().trim().min(1),preUninstall:T.string().trim().min(1),preConfig:T.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"});ce.scriptsSchema=mi;const gi=T.object({name:T.string().required().trim(),config:T.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});ce.serviceSchema=gi;const yi=T.object({type:T.string().trim(!0).min(1).required(),path:T.string().required(),meta:T.object({vcType:T.string(),payable:T.boolean(),params:T.array().items({name:T.string().required().trim(),description:T.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});ce.endpointSchema=yi;const Fo=T.string().trim().custom((e,r)=>{const d=e.split("/").filter(Boolean);return d.length===0?r.message("cacheable path must be a valid pathname that is not /"):`/${d.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});ce.cacheableSchema=Fo;const vi=T.object({type:T.string().lowercase().valid(...Be.BLOCKLET_INTERFACE_TYPES).required(),name:T.string().trim().required(),path:T.string().trim().default("/"),prefix:T.string().trim().min(1).default(Be.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:T.number().port().optional(),hostIP:T.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:T.string().lowercase().valid(...Be.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:T.alternatives().try(T.string().uppercase().default(Be.BLOCKLET_DEFAULT_PORT_NAME),T.object({internal:T.string().uppercase().required(),external:T.number().port().required()})).default(Be.BLOCKLET_DEFAULT_PORT_NAME),cacheable:T.array().items(Fo).unique(),services:T.array().items(gi).unique("name"),endpoints:T.array().items(yi).unique("type"),pageGroups:T.array().items(T.string().min(1).max(255).trim()).unique()}).meta({className:"TInterface",unknownType:"any"});ce.interfaceSchema=vi;const Sd=T.alternatives().try(T.string().required(),T.object({url:T.string().uri({scheme:["http","https","file"]}).required(),name:kr.required(),version:T.alternatives().try(T.string().valid("latest"),T.semverRange().valid())}),T.object({store:T.string().uri({scheme:["http","https"]}).required(),name:kr.required(),version:T.alternatives().try(T.string().valid("latest"),T.semverRange().valid()).default("latest")})),zn=T.object({platform:T.string().valid(...Be.BLOCKLET_PLATFORMS).optional(),interpreter:T.string().valid("binary","node","blocklet").default("node"),source:Sd,args:T.array().items(T.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});ce.engineSchema=zn;const Br=T.object({name:T.string().min(1).required(),email:T.string().email({tlds:!1}).optional(),url:T.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});ce.personSchema=Br;const qr=T.object({tarball:T.alternatives().try(T.string().uri(),T.string()).required(),integrity:T.string().required(),size:T.number().optional()}).meta({className:"TDist",unknownType:"any"});ce.distSchema=qr;const Bo=T.object({downloads:T.number().integer().greater(-1),star:T.number().default(0),purchases:T.number().default(0)}).meta({className:"TStats",unknownType:"any"});ce.statsSchema=Bo;const Ed=T.alternatives().try(T.object({url:T.alternatives().try(T.string().uri(),T.array().items(T.string().uri()).min(1)).required(),version:T.alternatives().try(T.string().valid("latest"),T.semverRange().valid())}),T.object({store:T.string().uri({scheme:["http","https"]}),name:kr.required(),version:T.alternatives().try(T.string().valid("latest"),T.semverRange().valid()).default("latest")})),Uo={source:Ed.required(),required:T.boolean(),title:gn,description:yn,mountPoint:hi,name:kr},qo=(e,r)=>T.object(e).custom((d,m)=>!r&&d.source&&d.source.name&&!d.source.store?m.message(`missing 'store' in source of component ${d.name}`):d),bi=qo(Uo).meta({className:"TComponent",unknownType:"any"});ce.componentSchema=bi;const jd=qo(Uo,!0),zo=({checkStore:e}={})=>{const r=[bi,jd];return T.array().items(e?r[0]:r[1]).optional().default([])},Wo=T.object({type:T.string().required(),name:T.string().required(),signer:T.string().required(),pk:T.string().required(),created:T.string().isoDate().required(),sig:T.string().required(),excludes:T.array().items(T.string()).optional(),appended:T.array().items(T.string()).optional(),delegatee:T.string(),delegateePk:T.string(),delegation:T.string()}).meta({className:"TSignature",unknownType:"any"});ce.signatureSchema=Wo;const Ss=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Es={id:T.string().custom(wd),title:T.alternatives().try(T.string().min(1).max(Be.MAX_TITLE_LENGTH),T.object().min(1).pattern(T.string().valid(...Ss),T.string().min(1).max(Be.MAX_TITLE_LENGTH))).required(),link:T.alternatives().try(T.string().custom(_s),T.object().min(1).pattern(T.string().valid(...Ss),T.string().custom(_s))),component:T.string().min(1),section:T.array().items(T.string().min(1)).single(),role:T.array().items(T.string().min(1)).single(),icon:T.string().min(1),visible:T.boolean()},Vo=T.object({...Es,items:T.array().items(T.object({...Es}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});ce.navigationItemSchema=Vo;const xi=T.array().items(Vo).unique((e,r)=>e.id&&r.id?e.id===r.id:!1).meta({className:"TNavigation",unknownType:"any"});ce.navigationSchema=xi;const wi=T.object({background:T.alternatives().try(T.string().min(1),T.object({header:T.string().min(1),footer:T.string().min(1),default:T.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});ce.themeSchema=wi;const Ko=T.object({whoCanAccess:T.string().valid("owner","invited","all"),profileFields:T.array().items(T.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:T.array().items(T.string().min(1)),allowSwitchProfile:T.boolean(),blockUnauthenticated:T.boolean(),blockUnauthorized:T.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});ce.authConfigSchema=Ko;const kd=T.object({type:T.string().trim().min(1).required(),description:T.string().trim().min(1)}),_i=T.object({did:T.DID().trim().required(),type:T.string().trim().min(1).required(),public:T.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});ce.resourceBundleSchema=_i;const Go={did:T.DID().trim().required(),version:T.semver().valid().required(),name:T.string().optional(),description:yn.required(),group:T.string().valid(...Be.BLOCKLET_GROUPS),main:T.string().trim(),title:gn.optional().allow(""),logo:T.string().trim().optional(),specVersion:T.semver().valid().gte("1.0.0").optional(),author:Br.optional(),contributors:T.array().items(Br).optional(),maintainers:T.array().items(Br).optional(),community:T.string().uri().optional().allow("").default(""),documentation:T.string().uri().optional().allow("").default(""),homepage:T.string().uri().optional().allow("").default(""),license:T.string().optional().allow("").default(""),support:T.alternatives().try(T.string().uri(),T.string().email({tlds:!1})).optional(),nftFactory:T.DID().optional().allow("").default(""),payment:T.object({price:T.array().max(1).items(T.object({value:T.number().greater(0).required(),address:T.DID().required()})).default([]),share:T.array().max(4).items(T.object({name:T.string().required(),address:T.DID().required(),value:T.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const r=e.reduce((d,m)=>d+m.value,0);if(r!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${r}`);return e},"invalid blocklet share"),componentPrice:T.array().items(T.object({parentPriceRange:T.array().items(T.number()).custom((e,r)=>e.length!==2?r.message("length of range should be 2"):e[0]<0?r.message("the first value should not less than 0 in range"):e[1]<=e[0]?r.message("the second value should greater than the first value in range"):e),type:T.string().valid("fixed","percentage").required(),value:T.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:T.alternatives().try(T.string().trim().min(1),T.array().items(T.string().min(1))).optional(),tags:T.alternatives().try(T.string().trim().min(1),T.array().items(T.string().min(1))).optional(),gitHash:T.string().optional().allow(""),repository:T.alternatives().try(T.string().min(1),T.object({type:T.string().valid("git","https","svn").required(),url:T.string().uri().required(),directory:T.string()})).optional(),timeout:T.object({start:T.number().min(10).max(600),script:T.number().min(1).max(1800)}).default({start:60}),requirements:T.object({abtnode:T.semverRange().valid(),server:T.semverRange().valid(),os:T.alternatives().try(T.string().valid("*",...Be.BLOCKLET_PLATFORMS),T.array().items(T.string().valid(...Be.BLOCKLET_PLATFORMS)).min(1)),cpu:T.alternatives().try(T.string().valid("*",...Be.BLOCKLET_ARCHITECTURES),T.array().items(T.string().valid(...Be.BLOCKLET_ARCHITECTURES)).min(1)),fuels:T.array().items(T.object({endpoint:T.string().trim().required(),address:T.string().trim(),value:T.string().trim().required(),reason:T.string().trim().required()})),nodejs:T.semverRange().valid()}).default({server:Be.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:T.array().items(vi).unique("name").custom((e,r)=>{if(e.filter(_=>_.type===Be.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return r.message(`Only one ${Be.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const m=e.filter(_=>_.type===Be.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const _ of m)if(!_.prefix.startsWith(ws))return r.message(`Wellknown path prefix must start with: ${ws}`);return e}).default([]),environments:T.array().items(pi).default([]).optional().custom((e,r)=>{if(e&&e.length){const d=e.filter((m,_)=>e.findIndex(x=>x.name===m.name)!==_);if(d.length)return r.message(`find duplicate environment names ${d.map(m=>m.name).join(", ")}`)}return e}),scripts:mi,capabilities:T.object({clusterMode:T.boolean(),didSpace:T.string().valid(...Object.values(Be.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:T.boolean().default(!0),serverless:T.boolean().optional(),component:T.boolean(),sitemap:T.boolean().optional()}).default({}),files:T.array().items(T.string().trim()).optional(),resource:T.object({exportApi:T.string().trim(),bundles:T.array().items(_i),types:T.array().items(kd).max(10)}),engine:T.alternatives().try(zn,T.array().items(zn)).optional(),screenshots:T.array().items(T.string().min(1)).optional().default([]),videos:T.array().items(T.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:T.string().optional().allow(""),dist:qr.optional(),stats:Bo.optional(),htmlAst:T.any().optional(),path:T.string().optional(),signatures:T.array().items(Wo).optional(),lastPublishedAt:T.string().isoDate().optional(),components:zo(),navigation:xi,theme:wi,copyright:T.object({owner:T.string().min(1),year:T.alternatives().try(T.string(),T.number())}),bundleName:T.string(),bundleDid:T.DID().trim(),storeId:T.string()},Rd=T.object(Go).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});ce.blockletMetaSchema=Rd;const Ho=(e,{ensureFiles:r=!1,ensureDist:d=!1,ensureComponentStore:m=!0,ensureName:_=!1,skipValidateDidName:x=!1,...g}={})=>((!e||!fd.default.existsSync(e))&&(r=!1),T.object({...Go,owner:T.object({avatar:T.string().optional(),did:T.DID().trim().required(),fullName:T.string().trim().required(),email:T.string().optional().allow(null).empty("").default("")}).optional(),logo:r?T.file().trim().exists({baseDir:e}).optional():T.string().trim().optional(),files:T.array().items(r?T.file().exists({baseDir:e,canSkip:(o,v)=>[Be.BLOCKLET_ENTRY_FILE,Be.BLOCKLET_BUNDLE_FILE].includes(v)||(0,gd.default)(v)}):T.string().trim()).optional(),dist:d?qr.required():qr.optional(),components:zo({checkStore:m}),name:_?T.string().optional():T.string().required(),egress:T.boolean().optional().default(!0),docker:T.object({workdir:T.string().trim(),image:T.string().trim().optional(),dockerfile:r?T.file().trim().exists({baseDir:e}).optional():T.string().trim().optional(),shell:T.string().trim().optional(),network:T.string().valid("host","bridge","none").default("host").optional(),volumes:T.array().items(T.string().trim()).optional(),script:T.string().trim().optional(),installNodeModules:T.boolean().optional(),command:T.string().trim().optional(),runBaseScript:T.boolean().optional()}).optional()}).options({stripUnknown:!0,noDefaults:!1,...g}).rename("children","components").custom((o,v)=>{const{did:y,name:c,docker:t}=o;if(t){const{image:s,dockerfile:n,exportPorts:i,network:h}=t;if(!s&&!n)return v.message("Image or dockerfile must be set");if(s&&n)return v.message("Image and dockerfile cannot be set at the same time");if(i&&h)return v.message("ExportPorts and network cannot be set at the same time");if(!i&&!h)return v.message("ExportPorts or network must be set");if(n&&(o.files||(o.files=[]),o.files.push(n)),t.volumes)for(const l of t.volumes){if(!l.startsWith("$BLOCKLET_APP_DIR/")&&!l.startsWith("$BLOCKLET_DATA_DIR/"))return v.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(l.indexOf("..")>-1)return v.message('Volume cannot contain ".."')}}let a;if((0,vd.isValid)(y))try{return(0,qn.validateNewDid)(y),o}catch(s){a=s}if(c){(0,qn.validateName)(c,{checkDid:!x});const s=(0,bd.default)(c);return s!==y?v.message(`The did of name "${c}" should be "${s}"`):o}return a?v.message(a.message):o}));ce.createBlockletSchema=Ho;ce.default={blockletNameSchema:kr,componentSchema:bi,endpointSchema:yi,serviceSchema:gi,createBlockletSchema:Ho,interfaceSchema:vi,environmentSchema:pi,environmentNameSchema:fi,scriptsSchema:mi,personSchema:Br,distSchema:qr,titleSchema:gn,descriptionSchema:yn,logoSchema:No,navigationSchema:xi,themeSchema:wi,mountPointSchema:hi,updateMountPointSchema:Mo,authConfigSchema:Ko,resourceBundleSchema:_i,installBlockletTitleSchema:Po,installBlockletDescriptionSchema:Lo,Joi:T};var xt={},Od=Ie&&Ie.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xt,"__esModule",{value:!0});xt.setService=xt.findService=xt.getDefaultServiceConfig=xt.getServiceConfig=void 0;const Td=Od(tl),Cd=ce,Xo={},Si=e=>{Xo[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};xt.setService=Si;Si({name:"auth",schema:Cd.authConfigSchema,default:{}});const Yo=e=>{if(!e)throw new Error("service name should not be empty");const r=Xo[e];if(!r)throw new Error(`service ${e} does not exist`);return r},Zo=(e,r,{validate:d}={})=>{const m=Yo(e),_=(0,Td.default)(r||{}),{value:x,error:g}=m.validate(_);if(d&&g)throw new Error(`Invalid blocklet service config: ${g.details.map(o=>o.message).join(", ")}`);return x};xt.getServiceConfig=Zo;const Jo=e=>{const{defaultConfig:r}=Yo(e);return r};xt.getDefaultServiceConfig=Jo;const Qo=(e,r)=>{const d=[r];return(e||[]).find(m=>d.includes(m.name))};xt.findService=Qo;xt.default={getServiceConfig:Zo,getDefaultServiceConfig:Jo,findService:Qo,setService:Si};Object.defineProperty(sr,"__esModule",{value:!0});sr.fixAndValidateService=sr.validateMeta=void 0;const Id=ce,$d=xt,Ad=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(r=>{r.services&&r.services.length&&r.services.forEach(d=>{d.config=(0,$d.getServiceConfig)(d.name,d.config,{validate:!0})})}),e);sr.fixAndValidateService=Ad;const ea=(e,{ensureFiles:r=!1,ensureDist:d=!1,ensureComponentStore:m=!0,ensureName:_=!1,skipValidateDidName:x=!1,schemaOptions:g={}}={})=>{const o=(0,Id.createBlockletSchema)(null,{ensureFiles:r,ensureDist:d,ensureComponentStore:m,ensureName:_,skipValidateDidName:x,...g}),{value:v,error:y}=o.validate(e);if(y)throw new Error(`Invalid blocklet meta: ${y.details.map(c=>c.message).join(", ")}`);return v};sr.validateMeta=ea;sr.default=ea;(function(e){var r=Ie&&Ie.__createBinding||(Object.create?function(b,O,R,f){f===void 0&&(f=R);var E=Object.getOwnPropertyDescriptor(O,R);(!E||("get"in E?!O.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return O[R]}}),Object.defineProperty(b,f,E)}:function(b,O,R,f){f===void 0&&(f=R),b[f]=O[R]}),d=Ie&&Ie.__setModuleDefault||(Object.create?function(b,O){Object.defineProperty(b,"default",{enumerable:!0,value:O})}:function(b,O){b.default=O}),m=Ie&&Ie.__importStar||function(){var b=function(O){return b=Object.getOwnPropertyNames||function(R){var f=[];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(f[f.length]=E);return f},b(O)};return function(O){if(O&&O.__esModule)return O;var R={};if(O!=null)for(var f=b(O),E=0;E<f.length;E++)f[E]!=="default"&&r(R,O,f[E]);return d(R,O),R}}(),_=Ie&&Ie.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};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 x=_(rl),g=m(Iu),o=Ct,v=sr;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return v.fixAndValidateService}});const y=ui,c=(b,O)=>{b.description||(b.description=`Blocklet from ${O}`),b.version||(b.version=o.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=c;const t=b=>{if(b.repository&&(typeof b.repository=="string"&&(b.repository={type:"git",url:b.repository}),b.repository.url)){const O=g.fromUrl(b.repository.url);O&&(b.repository.url=O.getDefaultRepresentation()==="shortcut"?O.https():O.toString())}};e.fixRepository=t;const a=b=>{Array.isArray(b.files)?b.files&&(b.files=b.files.filter(O=>!(!O||typeof O!="string"))):delete b.files};e.fixFiles=a;const s=b=>{typeof b.keywords=="string"&&(b.keywords=b.keywords.split(/,\s+/)),b.keywords&&!Array.isArray(b.keywords)?delete b.keywords:b.keywords&&(b.keywords=b.keywords.filter(O=>!(typeof O!="string"||!O)))};e.fixKeywords=s;const n=b=>{typeof b.tags=="string"&&(b.tags=b.tags.split(/,\s+/)),b.tags&&!Array.isArray(b.tags)?delete b.tags:b.tags&&(b.tags=b.tags.filter(O=>!(typeof O!="string"||!O)))};e.fixTags=n;const i=(b,O)=>(b.author&&(b.author=O(b.author)),["maintainers","contributors"].forEach(R=>{Array.isArray(b[R])&&(b[R]=b[R].map(O))}),b),h=b=>{if(!b)return"";if(typeof b=="string")return b;const O=b.name||"",R=b.url||b.web,f=R?` (${R})`:"",E=b.email||b.mail,j=E?` <${E}>`:"";return O+j+f};e.formatPerson=h;const l=b=>{if(typeof b!="string")return b;const O=b.match(/^([^(<]+)/),R=b.match(/\(([^)]+)\)/),f=b.match(/<([^>]+)>/),E={};return O&&O[0].trim()&&(E.name=O[0].trim()),f&&([,E.email]=f),R&&([,E.url]=R),E};e.parsePerson=l;const u=b=>(i(b,h),i(b,l),b);e.fixPerson=u;const p=(b,O=!0)=>{if(Array.isArray(b.interfaces)||(b.interfaces=[]),b.interfaces.length)return b.interfaces.forEach(j=>{j.type===o.BLOCKLET_INTERFACE_TYPE_WEB&&(j.protocol="http")}),b;const f=(0,x.default)(b,"capabilities.dynamicPathPrefix",!0)?o.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",E=({type:j="web",name:L,path:B="/",protocol:z="http",port:ee=o.BLOCKLET_DEFAULT_PORT_NAME})=>{b.interfaces.push({type:j,name:L,path:B,prefix:f,port:ee,protocol:z})};return[o.BLOCKLET_INTERFACE_PUBLIC].forEach(j=>{b[j]&&E({name:j,path:b[j]})}),Array.isArray(b.exposeServices)&&b.exposeServices.forEach(j=>{E({type:"service",name:j.protocol,protocol:j.protocol,port:{internal:`BLOCKLET_${j.protocol}_PORT`.toUpperCase(),external:j.port}})}),O&&(delete b.publicUrl,delete b.adminUrl,delete b.configUrl,delete b.docUrl,delete b.exposeServices,b.capabilities&&delete b.capabilities.dynamicPathPrefix),b};e.fixInterfaces=p;const S=b=>{const{did:O}=b;try{(0,y.validateNewDid)(O),b.name=O}catch{}return b};e.fixName=S,e.default={fixRequired:c,fixRepository:t,fixFiles:a,fixKeywords:s,fixPerson:u,fixTags:n,fixName:S,formatPerson:h,parsePerson:l,fixInterfaces:p,fixService:v.fixAndValidateService}})(vo);function ta({owner:e,locale:r}){return w.jsxs(ue,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?w.jsx(Ys,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:r}):null]})}ta.propTypes={owner:W.object.isRequired,locale:W.string.isRequired};const Pd="install-blocklet-from-URL",ra=()=>{const[e,r]=ao(Pd,"[]",{raw:!0}),d=_=>{const x=_.trim(),g=JSON.parse(e),o=g.findIndex(v=>v===x);o!==0&&(o>0&&g.splice(o,1),g.length>=10&&g.splice(9),g.unshift(x),r(JSON.stringify(g)))},m=_=>{if(!_)return;const x=JSON.parse(e),g=_.trim(),o=x.findIndex(v=>v===g);o>-1&&(x.splice(o,1),r(JSON.stringify(x)))};return{urls:e?JSON.parse(e):[],addUrlRecord:d,removeUrlRecord:m}},Ld=Fs(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function Ei(e){const{value:r,onValueChange:d,children:m,helperText:_}=e,{urls:x,removeUrlRecord:g}=ra(),o=(y,c)=>{y.preventDefault(),y.stopPropagation(),g(c)},v=Ld();return w.jsxs(ue,{children:[w.jsx(Bs,{freeSolo:!0,options:x,inputValue:r,onInputChange:(y,c)=>{d(c)},disableClearable:!0,popupIcon:null,renderInput:y=>Xa.cloneElement(m,{...y}),renderOption:(y,c)=>K.createElement(Us,{...y,key:c,secondaryAction:w.jsx(Ms,{edge:"end","aria-label":"delete",onClick:t=>o(t,c),children:w.jsx(nl,{})})},w.jsx(Ta,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:w.jsx(qs,{primary:c,className:v.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),w.jsx(Ca,{style:{margin:0},children:_})]})}Ei.propTypes={onValueChange:W.func,children:W.node,value:W.string,helperText:W.string};Ei.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function ji({defaultUrl:e,onCancel:r,onSuccess:d,onError:m,mode:_,handleText:x}){const{api:g}=Kr(),{api:o}=Yl(),[v,y]=K.useState(!1),[c,t]=K.useState(""),{t:a,locale:s}=mt(),n={dist:{}},[i,h]=K.useState(e),[l,u]=K.useState(e?1:0),[p,S]=K.useState(n),[b,O]=K.useState(!1),[R,f]=K.useState({}),E=_==="component",j=E?!0:!e,{addUrlRecord:L}=ra(),B=async()=>{S(n),t(null),y(!0);let Q=i.trim();!Q.startsWith("https://")&&!Q.startsWith("http://")&&!Q.startsWith("file://")&&(Q=`file://${Q}`);try{const ve=decodeURIComponent(Q);try{new URL(ve)}catch{throw new Error("Invalid URL")}const{meta:ye,inStore:$e,registryUrl:Ae}=await g.getBlockletMetaFromUrl({input:{url:ve}});S(ye),f({inStore:$e,registryUrl:Ae,inputUrl:Q}),L(Q)}catch(ve){console.error(ve);const ye=`Blocklet Install failed: ${lo(ve)}`;t(ye),m(ve)}finally{y(!1)}},z=()=>{if(E){d({meta:p,...R}),r();return}y(!0),O(!0)},ee=()=>{y(!1),O(!1),d({meta:p,...R}),r()},ne=()=>{y(!1),O(!1)};K.useEffect(()=>{e&&B()},[e]);const G=[{name:a("common.name"),value:Bt.getDisplayName({meta:p},!0)},{name:a("common.version"),value:p.version},{name:a("common.did"),value:p.did?w.jsx(Zl,{did:p.did}):null},{name:a("common.author"),value:p.owner?w.jsx(ta,{owner:p.owner,locale:s}):vo.formatPerson(p.author)},{name:a("blocklet.dist.downloadLink"),value:p.dist.tarball}],oe=()=>v?w.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:w.jsx(pt,{})}):p.did?w.jsx("div",{style:{paddingLeft:"10%"},children:G.map(Q=>Q.name===a("common.did")?w.jsx(rs,{valueComponent:"div",nameWidth:120,name:Q.name,nameFormatter:()=>a("common.did"),children:Q.value},Q.name):w.jsx(rs,{valueComponent:"div",nameWidth:120,name:Q.name,children:Q.value},Q.name))}):null,H=[{label:a("blocklet.fromUrl.step0"),body:w.jsx(Ee,{component:"div",children:w.jsx(Ei,{style:{marginBottom:32},value:i,helperText:a("blocklet.fromUrl.description"),onValueChange:Q=>{t(null),h(Q)},children:w.jsx(an,{label:a("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:i,onChange:Q=>{t(null),h(Q.target.value)},disabled:v,onKeyPress:Q=>{Q.key==="Enter"&&(Q.preventDefault(),B(),u(1))}})})}),cancel:a("common.cancel"),confirm:a("common.next"),onCancel:r,onConfirm:()=>{B(),u(1)}},{label:a("blocklet.fromUrl.step1"),body:oe(),cancel:a(j?"common.pre":"common.cancel"),confirm:(x==null?void 0:x.confirm)||a("blocklet.fromUrl.confirm"),onCancel:()=>{j?u(Q=>Q-1):r()},onConfirm:()=>{z()}}],xe=H[l];return w.jsxs(w.Fragment,{children:[w.jsxs(Yn,{title:(x==null?void 0:x.title)||a("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>xe.onCancel(),showCloseButton:l===0,disableEscapeKeyDown:!0,open:!0,actions:w.jsxs(w.Fragment,{children:[xe.cancel&&w.jsx(ct,{onClick:Q=>{Q.stopPropagation(),t(null),xe.onCancel()},color:"inherit",children:xe.cancel||a("common.cancel")}),w.jsxs(ct,{onClick:Q=>{Q.stopPropagation(),xe.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:v||!i||c,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[v&&l===0&&w.jsx(pt,{size:16}),xe.confirm]})]}),children:[j&&w.jsx(Ia,{alternativeLabel:!0,activeStep:l,children:H.map(({label:Q})=>w.jsx($a,{children:w.jsx(Aa,{children:Q})},Q))}),w.jsx(Pa,{component:"div",style:{marginTop:24},children:xe.body}),!!c&&w.jsx(zs,{severity:"error",style:{width:"100%",marginTop:8},children:c})]}),p&&b&&w.jsx(Js,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:o.get,checkTimeout:5*60*1e3,onSuccess:ee,extraParams:{title:p.title,wt:xl(p),blockletMetaUrl:decodeURIComponent(i.trim())},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:ne})]})}ji.propTypes={defaultUrl:W.string,onCancel:W.func.isRequired,onSuccess:W.func.isRequired,onError:W.func,mode:W.oneOf(["install","component"]),handleText:W.object};ji.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};var ki={},Nd=on;Object.defineProperty(ki,"__esModule",{value:!0});var na=ki.default=void 0,Dd=Nd(cn()),Md=w;na=ki.default=(0,Dd.default)((0,Md.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const Fd={meta:W.object.isRequired,onCancel:W.func.isRequired},Bd=Fs(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function ia({action:e,onSelect:r,onNext:d}){const m=Bd(),{t:_}=mt(),x=[{action:"purchase",title:_("store.purchase.purchase.title"),description:_("store.purchase.purchase.description")},{action:"verify",title:_("store.purchase.verify.title"),description:_("store.purchase.verify.description")}];return w.jsxs(w.Fragment,{children:[w.jsx(La,{className:m.tabPanel,children:x.map(g=>w.jsxs(Us,{button:!0,selected:e===g.action,onClick:()=>r(g.action),children:[w.jsx(Na,{className:m.iconRoot,children:g.action==="purchase"?w.jsx(Jl,{style:{color:e==="purchase"?Zi.primary.main:"#AAA",fontSize:32}}):w.jsx(na,{style:{color:e==="verify"?Zi.primary.main:"#AAA",fontSize:32}})}),w.jsx(qs,{primary:g.title,secondary:g.description})]},g.action))}),d&&w.jsx(ct,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:d,children:_("common.next")})]})}ia.propTypes={action:W.oneOf(["both","purchase","verify"]).isRequired,onSelect:W.func.isRequired,onNext:W.func.isRequired};function Ri({meta:e,onCancel:r,mode:d,handlePaySuccess:m}){const{t:_,locale:x}=mt(),{info:g}=Kr(),o=wl(g),[v,y]=K.useState(null),c=new URL(e==null?void 0:e.registryUrl).origin,t=Bt.getDisplayName({meta:e}),a=async(n,i)=>{const h=({downloadTokenList:p})=>{m({downloadTokenList:p})},l=p=>{Zn.error(p),r(p)};function u(p){return il(()=>ns.get(p).then(async({data:S})=>{const b=S==null?void 0:S.downloadTokenList;if(S.status==="succeed"){if(b&&b.length)await h({downloadTokenList:b});else return await l(_("blocklet.component.missDownloadTokenTip")),!0;return!0}return S.status==="error"?(console.error("vc error: ",S),await l(S==null?void 0:S.error),!0):!1}),{interval:1e3})}if(d==="purchase"&&v){const{statusUrl:p}=_l(v);await u(p)}else await h({downloadTokenList:n.downloadTokenList&&i(n.downloadTokenList)})};if(K.useEffect(()=>{if(d==="purchase"){const n=new URL(c);n.pathname="/api/did/verify-purchase-blocklet/token",n.searchParams.set("serverDid",g.did),n.searchParams.set("blockletDid",e==null?void 0:e.did);try{ns.get(n.href).then(({data:i})=>{const h=`${i.url}`;y(h)})}catch(i){console.error("get next workflow url error: ",i)}}return()=>{y(null)}},[d]),d==="purchase"&&!v)return"";const s={verify:{action:"verify-purchase-blocklet",checkFn:ts.create({baseURL:c}).get,extraParams:{serverDid:g.did,blockletDid:e==null?void 0:e.did},messages:{title:_("store.purchase.verify.auth.title",{name:t}),scan:_("store.purchase.verify.auth.scan"),confirm:_("store.purchase.verify.auth.confirm"),success:_("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:ts.create({baseURL:Ur(c,"/store")}).get,extraParams:{factory:e.nftFactory,nw:v},messages:{title:_("store.purchase.auth.title",{name:t}),scan:_("store.purchase.auth.scan"),confirm:_("store.purchase.auth.confirm"),success:w.jsxs(w.Fragment,{children:[w.jsx("p",{children:_("store.purchase.auth.success")}),w.jsx("p",{children:_("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return w.jsx(Js,{open:!0,locale:x,popup:!1,saveConnect:!1,className:"connect",baseUrl:c,onSuccess:a,cancelWhenScanned:r,onClose:r,checkTimeout:60*5e3,webWalletUrl:o,disableClose:!0,showDownload:!1,...s[d]})}Ri.propTypes={...Fd,handlePaySuccess:W.func,mode:W.oneOf(["verify","purchase"]).isRequired};Ri.defaultProps={handlePaySuccess:()=>{}};const Oi=K.forwardRef(({mode:e,...r},d)=>{const[m,_]=K.useState(e!=="both"?e:"verify"),[x,g]=K.useState(e!=="both"?2:1),o=y=>{y!==m&&_(y)},v=()=>{m&&x!==2&&g(2)};return K.useImperativeHandle(d,()=>({onNext:v,getCurrentStep:()=>x})),x===1?w.jsx("div",{style:{maxWidth:520},children:w.jsx(ia,{action:m,onNext:null,onSelect:o})}):w.jsx(Ri,{...r,mode:m})});Oi.propTypes={mode:W.oneOf(["both","verify","purchase"]).isRequired,ref:W.any};Oi.defaultProps={ref:{}};const Ud=Oi;function qd({...e}){return w.jsx(ct,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Ti({blocklet:e,onStartNow:r,children:d,disabled:m}){const{t:_}=mt(),x=co();return!e||Sl(e.meta)?w.jsx(zd,{children:d}):w.jsxs(Wd,{isMobile:x,children:[w.jsx(qd,{className:"start-now",variant:"contained",color:"primary",disabled:m,onClick:()=>r(),children:_("setup.startNow")}),w.jsx(ue,{display:"flex",alignItems:"center",children:d})]})}Ti.propTypes={blocklet:W.object,onStartNow:W.func,children:W.any,disabled:W.bool};Ti.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const zd=Ye(ue)`
217
- width: 100%;
218
- margin-top: auto;
219
- padding-top: 24px;
220
- display: flex;
221
- align-items: center;
222
- justify-content: center;
223
- .bottom-button {
224
- min-width: 200px;
225
- }
226
- ${e=>e.theme.breakpoints.down("md")} {
227
- .bottom-button {
228
- width: 100%;
229
- }
230
- }
231
- `,Wd=Ye(ue)`
232
- padding-top: 24px;
233
- margin-top: auto;
234
- width: 100%;
235
- display: flex;
236
- align-items: center;
237
- justify-content: space-between;
238
- .start-now {
239
- min-width: 140px;
240
- }
241
- .bottom-button {
242
- min-width: 120px;
243
- }
244
- ${e=>e.theme.breakpoints.down("lg")} {
245
- width: 100%;
246
- }
247
-
248
- ${e=>e.theme.breakpoints.down("md")} {
249
- .start-now {
250
- min-width: inherit;
251
- }
252
- .bottom-button {
253
- min-width: 100px;
254
- }
255
- }
256
-
257
- ${e=>e.isMobile} {
258
- justify-content: space-between;
259
- gap: '32px',
260
- }}
261
- `;function Ci({blockletMeta:e,onEndpointUpdate:r}){var o;const d=co(),{blocklet:m}=hn(),{updateSpaceGateway:_,loading:x,hasStorageEndpoint:g}=Tl();return K.useEffect(()=>{r==null||r()},[m]),x?w.jsx(sl,{relative:"parent",children:w.jsx(pt,{})}):w.jsxs(Vd,{children:[w.jsx(ue,{width:d?"360px":"720px",children:g?w.jsx(rc,{}):w.jsx(nc,{})}),((o=e==null?void 0:e.capabilities)==null?void 0:o.didSpace)==="required"&&w.jsx(Ti,{mt:8,children:w.jsx(ic,{onConnect:_})})]})}Ci.propTypes={blockletMeta:W.any.isRequired,onEndpointUpdate:Da.func};Ci.defaultProps={onEndpointUpdate:()=>{}};const Vd=Ye(tc)`
262
- height: 100%;
263
- overflow-y: auto;
264
- padding-bottom: 32px;
265
- overflow-x: hidden;
266
- `;function Ii({onChange:e,loading:r,children:d,extra:m,stores:_,storageKey:x}){const{t:g}=mt(),{info:o,inService:v}=Kr(),{blocklet:y}=hn(),[c,t]=K.useState(!1),a=K.useRef(null),[s,n]=K.useState(),[i,h]=ao(x||"tmp"),[l,u]=x?[i,h]:[s,n],{storeList:p,teamDid:S}=no({fromBlocklet:v,blocklet:y,nodeInfo:o}),b=Qs([..._.map(R=>({...R,protected:!0})),...p],"url"),O=l&&b.find(R=>l===R.url)||b[0];return w.jsxs(w.Fragment,{children:[w.jsxs(Kd,{children:[w.jsx(ct,{ref:a,color:"primary","data-cy":"add-component-select-store",endIcon:w.jsx(sc,{color:"primary"}),onClick:()=>{t(!0)},style:{padding:"0 2px"},children:w.jsx(Ee,{color:"primary",children:O.name})}),w.jsx(Ee,{color:"primary",children:m})]}),w.jsxs(an,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:g("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:O,autoFocus:!0,onChange:R=>{const f=R.target.value;u(f.url),e(f)},SelectProps:{open:c,MenuProps:{anchorEl:a.current},renderValue:R=>R==null?void 0:R.name,onClose:()=>{t(!1)}},style:{display:"none"},margin:"normal",children:[b==null?void 0:b.map(R=>w.jsx(Xn,{sx:{width:"400px",maxWidth:"90vw"},value:R,"data-cy":R.url,children:w.jsx(Za,{teamDid:S,store:R,onDelete:()=>{var f;l===R.url&&u((f=b[0])==null?void 0:f.url)}})},R.url)),!Xs.isInServerlessMode(o)&&w.jsx(Ja,{disabled:r,storeList:b,teamDid:S,onAdd:R=>{u(R)}})]}),d({currentRegistry:O})]})}Ii.propTypes={onChange:W.func,loading:W.bool,children:W.any.isRequired,extra:W.node,storageKey:W.string,stores:W.arrayOf(W.shape({name:W.string.isRequired,url:W.string.isRequired}))};Ii.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Kd=Ye.div`
267
- display: flex;
268
- justify-content: space-between;
269
- align-items: center;
270
- margin-bottom: 16px;
271
-
272
- span {
273
- font-size: 16px;
274
- color: ${e=>e.theme.palette.common.black};
275
- // font-weight: bold;
276
- }
277
- `,Gd=ar("div")`
278
- background-color: transparent !important;
279
- & > :not(.Mui-disabled) {
280
- position: relative;
281
- z-index: 1;
282
- &::before {
283
- content: '';
284
- position: absolute;
285
- height: 100%;
286
- width: 100%;
287
- left: 0;
288
- top: 0;
289
- transition: opacity 0.3s;
290
- }
291
- &:hover::before {
292
- opacity: 0;
293
- }
294
- &::after {
295
- content: '';
296
- position: absolute;
297
- height: 100%;
298
- width: 100%;
299
- top: 0;
300
- left: 0;
301
- border-radius: 2px;
302
- background-color: ${e=>e.theme.palette.primary.main};
303
- transform: scale(0.1);
304
- opacity: 0;
305
- z-index: -1;
306
- transition:
307
- transform 0.3s,
308
- opacity 0.3s,
309
- background-color 0.3s;
310
- }
311
- &:hover::after {
312
- opacity: 1;
313
- transform-origin: center;
314
- transform: scale(1);
315
- }
316
- }
317
- & > :not(.Mui-disabled) {
318
- background-color: transparent !important;
319
- color: ${e=>e.theme.palette.primary.main}!important;
320
- }
321
- & > :not(.Mui-disabled) {
322
- &:hover {
323
- color: ${e=>e.theme.palette.common.white}!important;
324
- }
325
- }
326
- `,js=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Hd=ar("div")`
327
- &.arcblock-blocklet {
328
- padding: ${e=>e.theme.spacing(2)} ${e=>e.theme.spacing(2)} 0
329
- ${e=>e.theme.spacing(2)};
330
- }
331
- .arcblock-blocklet__content {
332
- cursor: pointer;
333
- display: flex;
334
- ${e=>e.theme.breakpoints.up("sm")} {
335
- align-items: center;
336
- }
337
- }
338
- .arcblock-blocklet__cover {
339
- width: 64px;
340
- height: 64px;
341
- margin-right: ${e=>e.theme.spacing(2)};
342
- overflow: hidden;
343
- border-radius: 12px;
344
- /* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
345
- transform: translateZ(0);
346
- ${e=>e.theme.breakpoints.up("sm")} {
347
- width: 80px;
348
- height: 80px;
349
- margin-bottom: 12px;
350
- }
351
- }
352
- .arcblock-blocklet__button--hover {
353
- &:not(.Mui-disabled) {
354
- position: relative;
355
- z-index: 1;
356
- &::before {
357
- content: '';
358
- position: absolute;
359
- height: 100%;
360
- width: 100%;
361
- left: 0;
362
- top: 0;
363
- transition: opacity 0.3s;
364
- }
365
- &:hover::before {
366
- opacity: 0;
367
- }
368
- &::after {
369
- content: '';
370
- position: absolute;
371
- height: 100%;
372
- width: 100%;
373
- background-color: ${e=>e.theme.palette.primary.main};
374
- transform: scale(0.1);
375
- opacity: 0;
376
- z-index: -1;
377
- transition:
378
- transform 0.3s,
379
- opacity 0.3s,
380
- background-color 0.3s;
381
- }
382
- &:hover::after {
383
- opacity: 1;
384
- transform-origin: center;
385
- transform: scale(1);
386
- }
387
- }
388
-
389
- &:not(.Mui-disabled) {
390
- background-color: transparent !important;
391
- color: ${e=>e.theme.palette.primary.main};
392
- }
393
- &:not(.Mui-disabled) {
394
- &:hover {
395
- color: ${e=>e.theme.palette.common.white};
396
- }
397
- }
398
- }
399
- .arcblock-blocklet__info {
400
- flex: 1;
401
- overflow: hidden;
402
- border-bottom: 1px solid ${e=>e.theme.palette.divider};
403
- padding-bottom: ${e=>e.theme.spacing(2)};
404
- }
405
- .arcblock-blocklet__text {
406
- height: 65px;
407
- overflow: hidden;
408
- }
409
- /* 设置多行文本溢出显示省略号 兼容fireFox、safari */
410
- .arcblock-blocklet__title {
411
- margin: 0;
412
- font-size: 16px;
413
- font-weight: 500;
414
- overflow: hidden;
415
- text-overflow: ellipsis;
416
- white-space: nowrap;
417
- }
418
- .arcblock-blocklet__describe {
419
- margin-top: ${e=>e.theme.spacing(.5)};
420
- color: ${e=>e.theme.palette.grey[600]};
421
- font-size: 14px;
422
- font-weight: 500;
423
- line-height: 17px;
424
- max-height: 34px;
425
- overflow: hidden;
426
- text-overflow: ellipsis;
427
- display: -webkit-box;
428
- -webkit-line-clamp: 2;
429
- -webkit-box-orient: vertical;
430
- word-break: break-word;
431
- }
432
- .arcblock-blocklet__version {
433
- color: ${e=>e.theme.palette.grey[600]};
434
- font-size: 12px;
435
- }
436
- `;function $i({title:e,did:r,description:d,cover:m,version:_,button:x,buttonText:g,buttonDisabled:o,buttonLoading:v,onButtonClick:y,onMainClick:c,className:t,...a}){const s=(p,S=()=>!1)=>(b,...O)=>{S()?(b.preventDefault(),b.stopPropagation()):p instanceof Function&&(b.preventDefault(),b.stopPropagation(),p(...O))},n=s(y,()=>!!(x||o||v)),i=Wr(),h=Ft(i.breakpoints.up("sm")),l=s(c),u=h?80:64;return w.jsx(Hd,{className:`${t} arcblock-blocklet`,...a,children:w.jsxs("div",{className:"arcblock-blocklet__content",onClick:l,children:[m?w.jsx("div",{className:"arcblock-blocklet__cover",children:w.jsx(ol,{src:m})}):r&&w.jsx("div",{className:"arcblock-blocklet__cover",children:w.jsx(Jn,{did:r,size:u})}),w.jsxs("div",{className:"arcblock-blocklet__info",children:[w.jsxs("div",{className:"arcblock-blocklet__text",children:[K.isValidElement(e)?w.jsx(Ee,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",children:e}):w.jsx(Ee,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",title:js(e),dangerouslySetInnerHTML:{__html:e}}),K.isValidElement(d)?w.jsx(Ee,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",children:d}):w.jsx(Ee,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",title:js(d),dangerouslySetInnerHTML:{__html:d}})]}),w.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"10px",flexFlow:"wrap"},children:[w.jsx("div",{onClick:n,style:{marginRight:"12px"},children:x||y&&w.jsxs(ct,{className:"arcblock-blocklet__button--hover",variant:"outlined",color:"primary",size:"small",disabled:o||v,style:{padding:"3px 6px",fontSize:"14px",minWidth:"92px",textAlign:"center"},children:[v&&w.jsx(pt,{size:15,style:{marginRight:3,color:"inherit"}}),g]})}),w.jsx("div",{className:"arcblock-blocklet__version",children:_&&`v${_}`})]})]})]})})}$i.propTypes={title:W.string||W.node,did:W.string,description:W.string||W.node,cover:W.string,buttonText:W.string,buttonDisabled:W.bool,buttonLoading:W.bool,button:W.element,version:W.string,onButtonClick:W.func,onMainClick:W.func,className:W.string};$i.defaultProps={title:"",description:"",cover:null,did:null,buttonText:"Install",buttonDisabled:!1,buttonLoading:!1,button:null,version:null,onButtonClick:null,onMainClick:null,className:null};const Xd={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>'};var Yd=al,ks=ll;function Zd(e,r,d,m){return e==null?[]:(ks(r)||(r=r==null?[]:[r]),d=m?void 0:d,ks(d)||(d=d==null?[]:[d]),Yd(e,r,d))}var Jd=Zd;const Qd=ln(Jd);var Ai={},eh=on;Object.defineProperty(Ai,"__esModule",{value:!0});var sa=Ai.default=void 0,th=eh(cn()),rh=w;sa=Ai.default=(0,th.default)((0,rh.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");const nh={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"/>'};var oa={exports:{}};(function(e,r){(function(d,m){e.exports=m(K)})(Ie,d=>(()=>{var m={703:(o,v,y)=>{var c=y(414);function t(){}function a(){}a.resetWarningCache=t,o.exports=function(){function s(h,l,u,p,S,b){if(b!==c){var O=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 O.name="Invariant Violation",O}}function n(){return s}s.isRequired=s;var i={array:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:n,element:s,elementType:s,instanceOf:n,node:s,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:a,resetWarningCache:t};return i.PropTypes=i,i}},697:(o,v,y)=>{o.exports=y(703)()},414:o=>{o.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:o=>{var v=typeof Element<"u",y=typeof Map=="function",c=typeof Set=="function",t=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function a(s,n){if(s===n)return!0;if(s&&n&&typeof s=="object"&&typeof n=="object"){if(s.constructor!==n.constructor)return!1;var i,h,l,u;if(Array.isArray(s)){if((i=s.length)!=n.length)return!1;for(h=i;h--!=0;)if(!a(s[h],n[h]))return!1;return!0}if(y&&s instanceof Map&&n instanceof Map){if(s.size!==n.size)return!1;for(u=s.entries();!(h=u.next()).done;)if(!n.has(h.value[0]))return!1;for(u=s.entries();!(h=u.next()).done;)if(!a(h.value[1],n.get(h.value[0])))return!1;return!0}if(c&&s instanceof Set&&n instanceof Set){if(s.size!==n.size)return!1;for(u=s.entries();!(h=u.next()).done;)if(!n.has(h.value[0]))return!1;return!0}if(t&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(n)){if((i=s.length)!=n.length)return!1;for(h=i;h--!=0;)if(s[h]!==n[h])return!1;return!0}if(s.constructor===RegExp)return s.source===n.source&&s.flags===n.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===n.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===n.toString();if((i=(l=Object.keys(s)).length)!==Object.keys(n).length)return!1;for(h=i;h--!=0;)if(!Object.prototype.hasOwnProperty.call(n,l[h]))return!1;if(v&&s instanceof Element)return!1;for(h=i;h--!=0;)if((l[h]!=="_owner"&&l[h]!=="__v"&&l[h]!=="__o"||!s.$$typeof)&&!a(s[l[h]],n[l[h]]))return!1;return!0}return s!=s&&n!=n}o.exports=function(s,n){try{return a(s,n)}catch(i){if((i.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw i}}},359:o=>{o.exports=d}},_={};function x(o){var v=_[o];if(v!==void 0)return v.exports;var y=_[o]={exports:{}};return m[o](y,y.exports,x),y.exports}x.n=o=>{var v=o&&o.__esModule?()=>o.default:()=>o;return x.d(v,{a:v}),v},x.d=(o,v)=>{for(var y in v)x.o(v,y)&&!x.o(o,y)&&Object.defineProperty(o,y,{enumerable:!0,get:v[y]})},x.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),x.o=(o,v)=>Object.prototype.hasOwnProperty.call(o,v),x.r=o=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var g={};return(()=>{function o(P){var C,D,M="";if(typeof P=="string"||typeof P=="number")M+=P;else if(typeof P=="object")if(Array.isArray(P))for(C=0;C<P.length;C++)P[C]&&(D=o(P[C]))&&(M&&(M+=" "),M+=D);else for(C in P)P[C]&&(M&&(M+=" "),M+=C);return M}function v(){for(var P,C,D=0,M="";D<arguments.length;)(P=arguments[D++])&&(C=o(P))&&(M&&(M+=" "),M+=C);return M}x.r(g),x.d(g,{default:()=>Ra});var y=x(359),c=x.n(y);const t=function(P){var C=typeof P;return P!=null&&(C=="object"||C=="function")},a=typeof Ie=="object"&&Ie&&Ie.Object===Object&&Ie;var s=typeof self=="object"&&self&&self.Object===Object&&self;const n=a||s||Function("return this")(),i=function(){return n.Date.now()};var h=/\s/,l=/^\s+/;const u=function(P){return P&&P.slice(0,function(C){for(var D=C.length;D--&&h.test(C.charAt(D)););return D}(P)+1).replace(l,"")},p=n.Symbol;var S=Object.prototype,b=S.hasOwnProperty,O=S.toString,R=p?p.toStringTag:void 0,f=Object.prototype.toString,E=p?p.toStringTag:void 0;const j=function(P){return P==null?P===void 0?"[object Undefined]":"[object Null]":E&&E in Object(P)?function(C){var D=b.call(C,R),M=C[R];try{C[R]=void 0;var Z=!0}catch{}var de=O.call(C);return Z&&(D?C[R]=M:delete C[R]),de}(P):function(C){return f.call(C)}(P)};var L=/^[-+]0x[0-9a-f]+$/i,B=/^0b[01]+$/i,z=/^0o[0-7]+$/i,ee=parseInt;const ne=function(P){if(typeof P=="number")return P;if(function(M){return typeof M=="symbol"||function(Z){return Z!=null&&typeof Z=="object"}(M)&&j(M)=="[object Symbol]"}(P))return NaN;if(t(P)){var C=typeof P.valueOf=="function"?P.valueOf():P;P=t(C)?C+"":C}if(typeof P!="string")return P===0?P:+P;P=u(P);var D=B.test(P);return D||z.test(P)?ee(P.slice(2),D?2:8):L.test(P)?NaN:+P};var G=Math.max,oe=Math.min;const H=function(P,C,D){var M,Z,de,Se,$,I,F=0,X=!1,J=!1,Y=!0;if(typeof P!="function")throw new TypeError("Expected a function");function ge(he){var _e=M,Te=Z;return M=Z=void 0,F=he,Se=P.apply(Te,_e)}function me(he){return F=he,$=setTimeout(ie,C),X?ge(he):Se}function we(he){var _e=he-I;return I===void 0||_e>=C||_e<0||J&&he-F>=de}function ie(){var he=i();if(we(he))return se(he);$=setTimeout(ie,function(_e){var Te=C-(_e-I);return J?oe(Te,de-(_e-F)):Te}(he))}function se(he){return $=void 0,Y&&M?ge(he):(M=Z=void 0,Se)}function ae(){var he=i(),_e=we(he);if(M=arguments,Z=this,I=he,_e){if($===void 0)return me(I);if(J)return clearTimeout($),$=setTimeout(ie,C),ge(I)}return $===void 0&&($=setTimeout(ie,C)),Se}return C=ne(C)||0,t(D)&&(X=!!D.leading,de=(J="maxWait"in D)?G(ne(D.maxWait)||0,C):de,Y="trailing"in D?!!D.trailing:Y),ae.cancel=function(){$!==void 0&&clearTimeout($),F=0,M=I=Z=$=void 0},ae.flush=function(){return $===void 0?Se:se(i())},ae},xe=function(P,C,D){var M=!0,Z=!0;if(typeof P!="function")throw new TypeError("Expected a function");return t(D)&&(M="leading"in D?!!D.leading:M,Z="trailing"in D?!!D.trailing:Z),H(P,C,{leading:M,maxWait:C,trailing:Z})};var Q=x(590),ve=x.n(Q),ye=function(){if(typeof Map<"u")return Map;function P(C,D){var M=-1;return C.some(function(Z,de){return Z[0]===D&&(M=de,!0)}),M}return function(){function C(){this.__entries__=[]}return Object.defineProperty(C.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),C.prototype.get=function(D){var M=P(this.__entries__,D),Z=this.__entries__[M];return Z&&Z[1]},C.prototype.set=function(D,M){var Z=P(this.__entries__,D);~Z?this.__entries__[Z][1]=M:this.__entries__.push([D,M])},C.prototype.delete=function(D){var M=this.__entries__,Z=P(M,D);~Z&&M.splice(Z,1)},C.prototype.has=function(D){return!!~P(this.__entries__,D)},C.prototype.clear=function(){this.__entries__.splice(0)},C.prototype.forEach=function(D,M){M===void 0&&(M=null);for(var Z=0,de=this.__entries__;Z<de.length;Z++){var Se=de[Z];D.call(M,Se[1],Se[0])}},C}()}(),$e=typeof window<"u"&&typeof document<"u"&&window.document===document,Ae=x.g!==void 0&&x.g.Math===Math?x.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Qe=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ae):function(P){return setTimeout(function(){return P(Date.now())},1e3/60)},gt=["top","right","bottom","left","width","height","size","weight"],st=typeof MutationObserver<"u",Ht=function(){function P(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(C,D){var M=!1,Z=!1,de=0;function Se(){M&&(M=!1,C()),Z&&I()}function $(){Qe(Se)}function I(){var F=Date.now();if(M){if(F-de<2)return;Z=!0}else M=!0,Z=!1,setTimeout($,20);de=F}return I}(this.refresh.bind(this))}return P.prototype.addObserver=function(C){~this.observers_.indexOf(C)||this.observers_.push(C),this.connected_||this.connect_()},P.prototype.removeObserver=function(C){var D=this.observers_,M=D.indexOf(C);~M&&D.splice(M,1),!D.length&&this.connected_&&this.disconnect_()},P.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},P.prototype.updateObservers_=function(){var C=this.observers_.filter(function(D){return D.gatherActive(),D.hasActive()});return C.forEach(function(D){return D.broadcastActive()}),C.length>0},P.prototype.connect_=function(){$e&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),st?(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)},P.prototype.disconnect_=function(){$e&&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)},P.prototype.onTransitionEnd_=function(C){var D=C.propertyName,M=D===void 0?"":D;gt.some(function(Z){return!!~M.indexOf(Z)})&&this.refresh()},P.getInstance=function(){return this.instance_||(this.instance_=new P),this.instance_},P.instance_=null,P}(),Ke=function(P,C){for(var D=0,M=Object.keys(C);D<M.length;D++){var Z=M[D];Object.defineProperty(P,Z,{value:C[Z],enumerable:!1,writable:!1,configurable:!0})}return P},je=function(P){return P&&P.ownerDocument&&P.ownerDocument.defaultView||Ae},yt=Le(0,0,0,0);function ke(P){return parseFloat(P)||0}function $t(P){for(var C=[],D=1;D<arguments.length;D++)C[D-1]=arguments[D];return C.reduce(function(M,Z){return M+ke(P["border-"+Z+"-width"])},0)}var Xt=typeof SVGGraphicsElement<"u"?function(P){return P instanceof je(P).SVGGraphicsElement}:function(P){return P instanceof je(P).SVGElement&&typeof P.getBBox=="function"};function et(P){return $e?Xt(P)?function(C){var D=C.getBBox();return Le(0,0,D.width,D.height)}(P):function(C){var D=C.clientWidth,M=C.clientHeight;if(!D&&!M)return yt;var Z=je(C).getComputedStyle(C),de=function(Y){for(var ge={},me=0,we=["top","right","bottom","left"];me<we.length;me++){var ie=we[me],se=Y["padding-"+ie];ge[ie]=ke(se)}return ge}(Z),Se=de.left+de.right,$=de.top+de.bottom,I=ke(Z.width),F=ke(Z.height);if(Z.boxSizing==="border-box"&&(Math.round(I+Se)!==D&&(I-=$t(Z,"left","right")+Se),Math.round(F+$)!==M&&(F-=$t(Z,"top","bottom")+$)),!function(Y){return Y===je(Y).document.documentElement}(C)){var X=Math.round(I+Se)-D,J=Math.round(F+$)-M;Math.abs(X)!==1&&(I-=X),Math.abs(J)!==1&&(F-=J)}return Le(de.left,de.top,I,F)}(P):yt}function Le(P,C,D,M){return{x:P,y:C,width:D,height:M}}var cr=function(){function P(C){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Le(0,0,0,0),this.target=C}return P.prototype.isActive=function(){var C=et(this.target);return this.contentRect_=C,C.width!==this.broadcastWidth||C.height!==this.broadcastHeight},P.prototype.broadcastRect=function(){var C=this.contentRect_;return this.broadcastWidth=C.width,this.broadcastHeight=C.height,C},P}(),ur=function(P,C){var D,M,Z,de,Se,$,I,F=(M=(D=C).x,Z=D.y,de=D.width,Se=D.height,$=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,I=Object.create($.prototype),Ke(I,{x:M,y:Z,width:de,height:Se,top:Z,right:M+de,bottom:Se+Z,left:M}),I);Ke(this,{target:P,contentRect:F})},dr=function(){function P(C,D,M){if(this.activeObservations_=[],this.observations_=new ye,typeof C!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=C,this.controller_=D,this.callbackCtx_=M}return P.prototype.observe=function(C){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(C instanceof je(C).Element))throw new TypeError('parameter 1 is not of type "Element".');var D=this.observations_;D.has(C)||(D.set(C,new cr(C)),this.controller_.addObserver(this),this.controller_.refresh())}},P.prototype.unobserve=function(C){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(C instanceof je(C).Element))throw new TypeError('parameter 1 is not of type "Element".');var D=this.observations_;D.has(C)&&(D.delete(C),D.size||this.controller_.removeObserver(this))}},P.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},P.prototype.gatherActive=function(){var C=this;this.clearActive(),this.observations_.forEach(function(D){D.isActive()&&C.activeObservations_.push(D)})},P.prototype.broadcastActive=function(){if(this.hasActive()){var C=this.callbackCtx_,D=this.activeObservations_.map(function(M){return new ur(M.target,M.broadcastRect())});this.callback_.call(C,D,C),this.clearActive()}},P.prototype.clearActive=function(){this.activeObservations_.splice(0)},P.prototype.hasActive=function(){return this.activeObservations_.length>0},P}(),tt=typeof WeakMap<"u"?new WeakMap:new ye,_t=function P(C){if(!(this instanceof P))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var D=Ht.getInstance(),M=new dr(C,D,this);tt.set(this,M)};["observe","unobserve","disconnect"].forEach(function(P){_t.prototype[P]=function(){var C;return(C=tt.get(this))[P].apply(C,arguments)}});const hr=Ae.ResizeObserver!==void 0?Ae.ResizeObserver:_t,St="Left",vt="Right",dt="Up",Pe="Down",Et={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},qt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Yt="mousemove",Zt="mouseup";function At(P,C){if(C===0)return P;const D=Math.PI/180*C;return[P[0]*Math.cos(D)+P[1]*Math.sin(D),P[1]*Math.cos(D)-P[0]*Math.sin(D)]}function fr(P){const{trackMouse:C}=P,D=y.useRef(Object.assign({},qt)),M=y.useRef(Object.assign({},Et)),Z=y.useRef(Object.assign({},M.current));let de;for(de in Z.current=Object.assign({},M.current),M.current=Object.assign(Object.assign({},Et),P),Et)M.current[de]===void 0&&(M.current[de]=Et[de]);const[Se,$]=y.useMemo(()=>function(I,F){const X=ie=>{const se="touches"in ie;se&&ie.touches.length>1||I((ae,he)=>{he.trackMouse&&!se&&(document.addEventListener(Yt,J),document.addEventListener(Zt,ge));const{clientX:_e,clientY:Te}=se?ie.touches[0]:ie,Fe=At([_e,Te],he.rotationAngle);return he.onTouchStartOrOnMouseDown&&he.onTouchStartOrOnMouseDown({event:ie}),Object.assign(Object.assign(Object.assign({},ae),qt),{initial:Fe.slice(),xy:Fe,start:ie.timeStamp||0})})},J=ie=>{I((se,ae)=>{const he="touches"in ie;if(he&&ie.touches.length>1)return se;if(ie.timeStamp-se.start>ae.swipeDuration)return se.swiping?Object.assign(Object.assign({},se),{swiping:!1}):se;const{clientX:_e,clientY:Te}=he?ie.touches[0]:ie,[Fe,ot]=At([_e,Te],ae.rotationAngle),nt=Fe-se.xy[0],He=ot-se.xy[1],De=Math.abs(nt),Ce=Math.abs(He),Vt=(ie.timeStamp||0)-se.start,Cr=Math.sqrt(De*De+Ce*Ce)/(Vt||1),Ir=[nt/(Vt||1),He/(Vt||1)],Nt=function($r,_r,Ar,at){return $r>_r?Ar>0?vt:St:at>0?Pe:dt}(De,Ce,nt,He),Qt=typeof ae.delta=="number"?ae.delta:ae.delta[Nt.toLowerCase()]||Et.delta;if(De<Qt&&Ce<Qt&&!se.swiping)return se;const Ot={absX:De,absY:Ce,deltaX:nt,deltaY:He,dir:Nt,event:ie,first:se.first,initial:se.initial,velocity:Cr,vxvy:Ir};Ot.first&&ae.onSwipeStart&&ae.onSwipeStart(Ot),ae.onSwiping&&ae.onSwiping(Ot);let wr=!1;return(ae.onSwiping||ae.onSwiped||ae[`onSwiped${Nt}`])&&(wr=!0),wr&&ae.preventScrollOnSwipe&&ae.trackTouch&&ie.cancelable&&ie.preventDefault(),Object.assign(Object.assign({},se),{first:!1,eventData:Ot,swiping:!0})})},Y=ie=>{I((se,ae)=>{let he;if(se.swiping&&se.eventData){if(ie.timeStamp-se.start<ae.swipeDuration){he=Object.assign(Object.assign({},se.eventData),{event:ie}),ae.onSwiped&&ae.onSwiped(he);const _e=ae[`onSwiped${he.dir}`];_e&&_e(he)}}else ae.onTap&&ae.onTap({event:ie});return ae.onTouchEndOrOnMouseUp&&ae.onTouchEndOrOnMouseUp({event:ie}),Object.assign(Object.assign(Object.assign({},se),qt),{eventData:he})})},ge=ie=>{document.removeEventListener(Yt,J),document.removeEventListener(Zt,ge),Y(ie)},me=(ie,se)=>{let ae=()=>{};if(ie&&ie.addEventListener){const he=Object.assign(Object.assign({},Et.touchEventOptions),se.touchEventOptions),_e=[["touchstart",X,he],["touchmove",J,Object.assign(Object.assign({},he),se.preventScrollOnSwipe?{passive:!1}:{})],["touchend",Y,he]];_e.forEach(([Te,Fe,ot])=>ie.addEventListener(Te,Fe,ot)),ae=()=>_e.forEach(([Te,Fe])=>ie.removeEventListener(Te,Fe))}return ae},we={ref:ie=>{ie!==null&&I((se,ae)=>{if(se.el===ie)return se;const he={};return se.el&&se.el!==ie&&se.cleanUpTouch&&(se.cleanUpTouch(),he.cleanUpTouch=void 0),ae.trackTouch&&ie&&(he.cleanUpTouch=me(ie,ae)),Object.assign(Object.assign(Object.assign({},se),{el:ie}),he)})}};return F.trackMouse&&(we.onMouseDown=X),[we,me]}(I=>D.current=I(D.current,M.current),{trackMouse:C}),[C]);return D.current=function(I,F,X,J){return F.trackTouch&&I.el?I.cleanUpTouch?F.preventScrollOnSwipe!==X.preventScrollOnSwipe||F.touchEventOptions.passive!==X.touchEventOptions.passive?(I.cleanUpTouch(),Object.assign(Object.assign({},I),{cleanUpTouch:J(I.el,F)})):I:Object.assign(Object.assign({},I),{cleanUpTouch:J(I.el,F)}):(I.cleanUpTouch&&I.cleanUpTouch(),Object.assign(Object.assign({},I),{cleanUpTouch:void 0}))}(D.current,M.current,Z.current,$),Se}var q=x(697);function jt(P){return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},jt(P)}function le(P,C){var D=Object.keys(P);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(P);C&&(M=M.filter(function(Z){return Object.getOwnPropertyDescriptor(P,Z).enumerable})),D.push.apply(D,M)}return D}function fe(P){for(var C=1;C<arguments.length;C++){var D=arguments[C]!=null?arguments[C]:{};C%2?le(Object(D),!0).forEach(function(M){k(P,M,D[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(D)):le(Object(D)).forEach(function(M){Object.defineProperty(P,M,Object.getOwnPropertyDescriptor(D,M))})}return P}function k(P,C,D){return(C=function(M){var Z=function(de,Se){if(jt(de)!=="object"||de===null)return de;var $=de[Symbol.toPrimitive];if($!==void 0){var I=$.call(de,Se);if(jt(I)!=="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(de)}(M,"string");return jt(Z)==="symbol"?Z:String(Z)}(C))in P?Object.defineProperty(P,C,{value:D,enumerable:!0,configurable:!0,writable:!0}):P[C]=D,P}var A={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},N=c().memo(function(P){var C=fe(fe({},A),P),D=C.description,M=C.fullscreen,Z=C.handleImageLoaded,de=C.isFullscreen,Se=C.onImageError,$=C.original,I=C.originalAlt,F=C.originalHeight,X=C.originalWidth,J=C.originalTitle,Y=C.sizes,ge=C.srcSet,me=C.loading,we=de&&M||$;return c().createElement(c().Fragment,null,c().createElement("img",{className:"image-gallery-image",src:we,alt:I,srcSet:ge,height:F,width:X,sizes:Y,title:J,onLoad:function(ie){return Z(ie,$)},onError:Se,loading:me}),D&&c().createElement("span",{className:"image-gallery-description"},D))});N.displayName="Item",N.propTypes={description:q.string,fullscreen:q.string,handleImageLoaded:q.func.isRequired,isFullscreen:q.bool,onImageError:q.func.isRequired,original:q.string.isRequired,originalAlt:q.string,originalHeight:q.string,originalWidth:q.string,originalTitle:q.string,sizes:q.string,srcSet:q.string,loading:q.string};const U=N;function V(P){return V=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},V(P)}function te(P,C){var D=Object.keys(P);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(P);C&&(M=M.filter(function(Z){return Object.getOwnPropertyDescriptor(P,Z).enumerable})),D.push.apply(D,M)}return D}function re(P){for(var C=1;C<arguments.length;C++){var D=arguments[C]!=null?arguments[C]:{};C%2?te(Object(D),!0).forEach(function(M){be(P,M,D[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(D)):te(Object(D)).forEach(function(M){Object.defineProperty(P,M,Object.getOwnPropertyDescriptor(D,M))})}return P}function be(P,C,D){return(C=function(M){var Z=function(de,Se){if(V(de)!=="object"||de===null)return de;var $=de[Symbol.toPrimitive];if($!==void 0){var I=$.call(de,Se);if(V(I)!=="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(de)}(M,"string");return V(Z)==="symbol"?Z:String(Z)}(C))in P?Object.defineProperty(P,C,{value:D,enumerable:!0,configurable:!0,writable:!0}):P[C]=D,P}var pe={left:c().createElement("polyline",{points:"15 18 9 12 15 6"}),right:c().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:c().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:c().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:c().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:c().createElement(c().Fragment,null,c().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),c().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Ze={strokeWidth:1,viewBox:"0 0 24 24"},ze=function(P){var C=re(re({},Ze),P),D=C.strokeWidth,M=C.viewBox,Z=C.icon;return c().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:M,fill:"none",stroke:"currentColor",strokeWidth:D,strokeLinecap:"round",strokeLinejoin:"round"},pe[Z])};ze.propTypes={strokeWidth:q.number,viewBox:q.string,icon:(0,q.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Oe=ze;var Me=c().memo(function(P){var C=P.isFullscreen,D=P.onClick;return c().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:D,"aria-label":"Open Fullscreen"},c().createElement(Oe,{strokeWidth:2,icon:C?"minimize":"maximize"}))});Me.displayName="Fullscreen",Me.propTypes={isFullscreen:q.bool.isRequired,onClick:q.func.isRequired};const Ge=Me;var kt=c().memo(function(P){var C=P.disabled,D=P.onClick;return c().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:C,onClick:D,"aria-label":"Previous Slide"},c().createElement(Oe,{icon:"left",viewBox:"6 0 12 24"}))});kt.displayName="LeftNav",kt.propTypes={disabled:q.bool.isRequired,onClick:q.func.isRequired};const ht=kt;var Rt=c().memo(function(P){var C=P.disabled,D=P.onClick;return c().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:C,onClick:D,"aria-label":"Next Slide"},c().createElement(Oe,{icon:"right",viewBox:"6 0 12 24"}))});Rt.displayName="RightNav",Rt.propTypes={disabled:q.bool.isRequired,onClick:q.func.isRequired};const Or=Rt;var zt=c().memo(function(P){var C=P.isPlaying,D=P.onClick;return c().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:D,"aria-label":"Play or Pause Slideshow"},c().createElement(Oe,{strokeWidth:2,icon:C?"pause":"play"}))});zt.displayName="PlayPause",zt.propTypes={isPlaying:q.bool.isRequired,onClick:q.func.isRequired};const Hr=zt;function Wt(P){return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Wt(P)}function pr(){return pr=Object.assign?Object.assign.bind():function(P){for(var C=1;C<arguments.length;C++){var D=arguments[C];for(var M in D)Object.prototype.hasOwnProperty.call(D,M)&&(P[M]=D[M])}return P},pr.apply(this,arguments)}function rt(P,C){var D=Object.keys(P);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(P);C&&(M=M.filter(function(Z){return Object.getOwnPropertyDescriptor(P,Z).enumerable})),D.push.apply(D,M)}return D}function mr(P){for(var C=1;C<arguments.length;C++){var D=arguments[C]!=null?arguments[C]:{};C%2?rt(Object(D),!0).forEach(function(M){gr(P,M,D[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(D)):rt(Object(D)).forEach(function(M){Object.defineProperty(P,M,Object.getOwnPropertyDescriptor(D,M))})}return P}function gr(P,C,D){return(C=function(M){var Z=function(de,Se){if(Wt(de)!=="object"||de===null)return de;var $=de[Symbol.toPrimitive];if($!==void 0){var I=$.call(de,Se);if(Wt(I)!=="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(de)}(M,"string");return Wt(Z)==="symbol"?Z:String(Z)}(C))in P?Object.defineProperty(P,C,{value:D,enumerable:!0,configurable:!0,writable:!0}):P[C]=D,P}var yr={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},vr=function(P){var C=mr(mr({},yr),P),D=C.children,M=C.className,Z=fr({delta:C.delta,onSwiping:C.onSwiping,onSwiped:C.onSwiped});return c().createElement("div",pr({},Z,{className:M}),D)};vr.propTypes={children:q.node.isRequired,className:q.string,delta:q.number,onSwiped:q.func,onSwiping:q.func};const br=vr;function Pt(P){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Pt(P)}function Lt(P,C){var D=Object.keys(P);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(P);C&&(M=M.filter(function(Z){return Object.getOwnPropertyDescriptor(P,Z).enumerable})),D.push.apply(D,M)}return D}function Jt(P){for(var C=1;C<arguments.length;C++){var D=arguments[C]!=null?arguments[C]:{};C%2?Lt(Object(D),!0).forEach(function(M){zi(P,M,D[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(D)):Lt(Object(D)).forEach(function(M){Object.defineProperty(P,M,Object.getOwnPropertyDescriptor(D,M))})}return P}function xr(P,C){for(var D=0;D<C.length;D++){var M=C[D];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(P,Wi(M.key),M)}}function Tr(P,C){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,M){return D.__proto__=M,D},Tr(P,C)}function ja(P,C){if(C&&(Pt(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ue(P)}function Ue(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}function Xr(P){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(C){return C.__proto__||Object.getPrototypeOf(C)},Xr(P)}function zi(P,C,D){return(C=Wi(C))in P?Object.defineProperty(P,C,{value:D,enumerable:!0,configurable:!0,writable:!0}):P[C]=D,P}function Wi(P){var C=function(D,M){if(Pt(D)!=="object"||D===null)return D;var Z=D[Symbol.toPrimitive];if(Z!==void 0){var de=Z.call(D,M);if(Pt(de)!=="object")return de;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(D)}(P,"string");return Pt(C)==="symbol"?C:String(C)}var Vi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],ka=(0,q.arrayOf)((0,q.shape)({srcSet:q.string,media:q.string}));function Ki(P){var C=parseInt(P.keyCode||P.which||0,10);return C===66||C===62}var bn=function(P){(function($,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(I&&I.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),Object.defineProperty($,"prototype",{writable:!1}),I&&Tr($,I)})(Se,P);var C,D,M,Z,de=(M=Se,Z=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 $,I=Xr(M);if(Z){var F=Xr(this).constructor;$=Reflect.construct(I,arguments,F)}else $=I.apply(this,arguments);return ja(this,$)});function Se($){var I;return function(F,X){if(!(F instanceof X))throw new TypeError("Cannot call a class as a function")}(this,Se),zi(Ue(I=de.call(this,$)),"onBulletClick",function(F,X){var J=I.props,Y=J.onBulletClick,ge=J.items,me=I.state.currentIndex;F.target.blur(),me!==X&&(ge.length===2?I.slideToIndexWithStyleReset(X,F):I.slideToIndex(X,F)),Y&&Y(F,X)}),I.state={currentIndex:$.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat($.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},I.loadedImages={},I.imageGallery=c().createRef(),I.thumbnailsWrapper=c().createRef(),I.thumbnails=c().createRef(),I.imageGallerySlideWrapper=c().createRef(),I.handleImageLoaded=I.handleImageLoaded.bind(Ue(I)),I.handleKeyDown=I.handleKeyDown.bind(Ue(I)),I.handleMouseDown=I.handleMouseDown.bind(Ue(I)),I.handleResize=I.handleResize.bind(Ue(I)),I.handleTouchMove=I.handleTouchMove.bind(Ue(I)),I.handleOnSwiped=I.handleOnSwiped.bind(Ue(I)),I.handleScreenChange=I.handleScreenChange.bind(Ue(I)),I.handleSwiping=I.handleSwiping.bind(Ue(I)),I.handleThumbnailSwiping=I.handleThumbnailSwiping.bind(Ue(I)),I.handleOnThumbnailSwiped=I.handleOnThumbnailSwiped.bind(Ue(I)),I.onThumbnailMouseLeave=I.onThumbnailMouseLeave.bind(Ue(I)),I.handleImageError=I.handleImageError.bind(Ue(I)),I.pauseOrPlay=I.pauseOrPlay.bind(Ue(I)),I.renderThumbInner=I.renderThumbInner.bind(Ue(I)),I.renderItem=I.renderItem.bind(Ue(I)),I.slideLeft=I.slideLeft.bind(Ue(I)),I.slideRight=I.slideRight.bind(Ue(I)),I.toggleFullScreen=I.toggleFullScreen.bind(Ue(I)),I.togglePlay=I.togglePlay.bind(Ue(I)),I.unthrottledSlideToIndex=I.slideToIndex,I.slideToIndex=xe(I.unthrottledSlideToIndex,$.slideDuration,{trailing:!1}),$.lazyLoad&&(I.lazyLoaded=[]),I}return C=Se,D=[{key:"componentDidMount",value:function(){var $=this.props,I=$.autoPlay,F=$.useWindowKeyDown;I&&this.play(),F?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($,I){var F=this.props,X=F.items,J=F.lazyLoad,Y=F.slideDuration,ge=F.slideInterval,me=F.startIndex,we=F.thumbnailPosition,ie=F.showThumbnails,se=F.useWindowKeyDown,ae=this.state,he=ae.currentIndex,_e=ae.isPlaying,Te=$.items.length!==X.length,Fe=!ve()($.items,X),ot=$.startIndex!==me,nt=$.thumbnailPosition!==we,He=$.showThumbnails!==ie;ge===$.slideInterval&&Y===$.slideDuration||_e&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),He&&ie&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),He&&!ie&&this.removeThumbnailsResizeObserver(),(Te||He)&&this.handleResize(),I.currentIndex!==he&&this.slideThumbnailBar(),$.slideDuration!==Y&&(this.slideToIndex=xe(this.unthrottledSlideToIndex,Y,{trailing:!1})),!J||$.lazyLoad&&!Fe||(this.lazyLoaded=[]),se!==$.useWindowKeyDown&&(se?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ot||Fe)&&this.setState({currentIndex:me,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var $=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),$?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var $=this,I=this.state,F=I.currentIndex,X=I.isTransitioning,J=this.props,Y=J.onSlide,ge=J.slideDuration;this.transitionTimer=window.setTimeout(function(){X&&($.setState({isTransitioning:!X,isSwipingThumbnail:!1}),Y&&Y(F))},ge+50)}},{key:"onThumbnailClick",value:function($,I){var F=this.props,X=F.onThumbnailClick,J=F.items,Y=this.state.currentIndex;$.target.parentNode.parentNode.blur(),Y!==I&&(J.length===2?this.slideToIndexWithStyleReset(I,$):this.slideToIndex(I,$)),X&&X($,I)}},{key:"onThumbnailMouseOver",value:function($,I){var F=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){F.slideToIndex(I),F.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var $=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,$&&this.play()}}},{key:"setThumbsTranslate",value:function($){this.setState({thumbsTranslate:$})}},{key:"setModalFullscreen",value:function($){var I=this.props.onScreenChange;this.setState({modalFullscreen:$}),I&&I($)}},{key:"getThumbsTranslate",value:function($){var I,F=this.props,X=F.disableThumbnailScroll,J=F.items,Y=this.state,ge=Y.thumbnailsWrapperWidth,me=Y.thumbnailsWrapperHeight,we=this.thumbnails&&this.thumbnails.current;if(X)return 0;if(we){if(this.isThumbnailVertical()){if(we.scrollHeight<=me)return 0;I=we.scrollHeight-me}else{if(we.scrollWidth<=ge||ge<=0)return 0;I=we.scrollWidth-ge}return $*(I/(J.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function($){switch($){case"left":$=" ".concat("image-gallery-thumbnails-left");break;case"right":$=" ".concat("image-gallery-thumbnails-right");break;case"bottom":$=" ".concat("image-gallery-thumbnails-bottom");break;case"top":$=" ".concat("image-gallery-thumbnails-top")}return $}},{key:"getAlignmentClassName",value:function($){var I=this.state.currentIndex,F=this.props,X=F.infinite,J=F.items,Y="",ge="image-gallery-left",me="image-gallery-right";switch($){case I-1:Y=" ".concat(ge);break;case I:Y=" ".concat("image-gallery-center");break;case I+1:Y=" ".concat(me)}return J.length>=3&&X&&($===0&&I===J.length-1?Y=" ".concat(me):$===J.length-1&&I===0&&(Y=" ".concat(ge))),Y}},{key:"getTranslateXForTwoSlide",value:function($){var I=this.state,F=I.currentIndex,X=I.currentSlideOffset,J=I.previousIndex,Y=F!==J,ge=$===0&&J===0,me=$===1&&J===1,we=$===0&&F===1,ie=$===1&&F===0,se=X===0,ae=-100*F+100*$+X;return X>0?this.direction="left":X<0&&(this.direction="right"),ie&&X>0&&(ae=-100+X),we&&X<0&&(ae=100+X),Y?ge&&se&&this.direction==="left"?ae=100:me&&se&&this.direction==="right"&&(ae=-100):(ie&&se&&this.direction==="left"&&(ae=-100),we&&se&&this.direction==="right"&&(ae=100)),ae}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function($){var I=this.state,F=I.currentIndex,X=I.currentSlideOffset,J=I.slideStyle,Y=this.props,ge=Y.infinite,me=Y.items,we=Y.useTranslate3D,ie=Y.isRTL,se=-100*F,ae=me.length-1,he=(se+100*$)*(ie?-1:1)+X;ge&&me.length>2&&(F===0&&$===ae?he=-100*(ie?-1:1)+X:F===ae&&$===0&&(he=100*(ie?-1:1)+X)),ge&&me.length===2&&(he=this.getTranslateXForTwoSlide($));var _e="translate(".concat(he,"%, 0)");return we&&(_e="translate3d(".concat(he,"%, 0, 0)")),Jt({display:this.isSlideVisible($)?"inherit":"none",WebkitTransform:_e,MozTransform:_e,msTransform:_e,OTransform:_e,transform:_e},J)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var $,I=this.props,F=I.useTranslate3D,X=I.isRTL,J=this.state,Y=J.thumbsTranslate,ge=J.thumbsStyle,me=X?-1*Y:Y;return this.isThumbnailVertical()?($="translate(0, ".concat(Y,"px)"),F&&($="translate3d(0, ".concat(Y,"px, 0)"))):($="translate(".concat(me,"px, 0)"),F&&($="translate3d(".concat(me,"px, 0, 0)"))),Jt({WebkitTransform:$,MozTransform:$,msTransform:$,OTransform:$,transform:$},ge)}},{key:"getSlideItems",value:function(){var $=this,I=this.state.currentIndex,F=this.props,X=F.items,J=F.slideOnThumbnailOver,Y=F.onClick,ge=F.lazyLoad,me=F.onTouchMove,we=F.onTouchEnd,ie=F.onTouchStart,se=F.onMouseOver,ae=F.onMouseLeave,he=F.renderItem,_e=F.renderThumbInner,Te=F.showThumbnails,Fe=F.showBullets,ot=[],nt=[],He=[];return X.forEach(function(De,Ce){var Vt=$.getAlignmentClassName(Ce),Cr=De.originalClass?" ".concat(De.originalClass):"",Ir=De.thumbnailClass?" ".concat(De.thumbnailClass):"",Nt=De.renderItem||he||$.renderItem,Qt=De.renderThumbInner||_e||$.renderThumbInner,Ot=!ge||Vt||$.lazyLoaded[Ce];Ot&&ge&&!$.lazyLoaded[Ce]&&($.lazyLoaded[Ce]=!0);var wr=$.getSlideStyle(Ce),$r=c().createElement("div",{"aria-label":"Go to Slide ".concat(Ce+1),key:"slide-".concat(Ce),tabIndex:"-1",className:"image-gallery-slide ".concat(Vt," ").concat(Cr),style:wr,onClick:Y,onKeyUp:$.handleSlideKeyUp,onTouchMove:me,onTouchEnd:we,onTouchStart:ie,onMouseOver:se,onFocus:se,onMouseLeave:ae,role:"button"},Ot?Nt(De):c().createElement("div",{style:{height:"100%"}}));if(ot.push($r),Te&&De.thumbnail){var _r=v("image-gallery-thumbnail",Ir,{active:I===Ce});nt.push(c().createElement("button",{key:"thumbnail-".concat(Ce),type:"button",tabIndex:"0","aria-pressed":I===Ce?"true":"false","aria-label":"Go to Slide ".concat(Ce+1),className:_r,onMouseLeave:J?$.onThumbnailMouseLeave:null,onMouseOver:function(at){return $.handleThumbnailMouseOver(at,Ce)},onFocus:function(at){return $.handleThumbnailMouseOver(at,Ce)},onKeyUp:function(at){return $.handleThumbnailKeyUp(at,Ce)},onClick:function(at){return $.onThumbnailClick(at,Ce)}},Qt(De)))}if(Fe){var Ar=v("image-gallery-bullet",De.bulletClass,{active:I===Ce});He.push(c().createElement("button",{type:"button",key:"bullet-".concat(Ce),className:Ar,onClick:function(at){return $.onBulletClick(at,Ce)},"aria-pressed":I===Ce?"true":"false","aria-label":"Go to Slide ".concat(Ce+1)}))}}),{slides:ot,thumbnails:nt,bullets:He}}},{key:"ignoreIsTransitioning",value:function(){var $=this.props.items,I=this.state,F=I.previousIndex,X=I.currentIndex,J=$.length-1;return Math.abs(F-X)>1&&!(F===0&&X===J)&&!(F===J&&X===0)}},{key:"isFirstOrLastSlide",value:function($){return $===this.props.items.length-1||$===0}},{key:"slideIsTransitioning",value:function($){var I=this.state,F=I.isTransitioning,X=I.previousIndex,J=I.currentIndex;return F&&!($===X||$===J)}},{key:"isSlideVisible",value:function($){return!this.slideIsTransitioning($)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide($)}},{key:"slideThumbnailBar",value:function(){var $=this.state,I=$.currentIndex,F=$.isSwipingThumbnail,X=-this.getThumbsTranslate(I);F||(I===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:X,thumbsSwipedTranslate:X}))}},{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($){var I=$.event,F=$.absX,X=$.dir,J=this.props,Y=J.disableSwipe,ge=J.stopPropagation,me=this.state,we=me.galleryWidth,ie=me.isTransitioning,se=me.swipingUpDown,ae=me.swipingLeftRight;if(X!==dt&&X!==Pe&&!se||ae){if(X!==St&&X!==vt||ae||this.setState({swipingLeftRight:!0}),!Y){var he=this.props.swipingTransitionDuration;if(ge&&I.preventDefault(),ie)this.setState({currentSlideOffset:0});else{var _e=X===vt?1:-1,Te=F/we*100;Math.abs(Te)>=100&&(Te=100);var Fe={transition:"transform ".concat(he,"ms ease-out")};this.setState({currentSlideOffset:_e*Te,slideStyle:Fe})}}}else se||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function($){var I=$.event,F=$.absX,X=$.absY,J=$.dir,Y=this.props,ge=Y.stopPropagation,me=Y.swipingThumbnailTransitionDuration,we=this.state,ie=we.thumbsSwipedTranslate,se=we.thumbnailsWrapperHeight,ae=we.thumbnailsWrapperWidth,he=we.swipingUpDown,_e=we.swipingLeftRight;if(this.isThumbnailVertical()){if((J===St||J===vt||_e)&&!he)return void(_e||this.setState({swipingLeftRight:!0}));J!==dt&&J!==Pe||he||this.setState({swipingUpDown:!0})}else{if((J===dt||J===Pe||he)&&!_e)return void(he||this.setState({swipingUpDown:!0}));J!==St&&J!==vt||_e||this.setState({swipingLeftRight:!0})}var Te,Fe,ot,nt,He,De=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(Te=ie+(J===Pe?X:-X),Fe=De.scrollHeight-se+20,ot=Math.abs(Te)>Fe,nt=Te>20,He=De.scrollHeight<=se):(Te=ie+(J===vt?F:-F),Fe=De.scrollWidth-ae+20,ot=Math.abs(Te)>Fe,nt=Te>20,He=De.scrollWidth<=ae),!He&&(J!==St&&J!==dt||!ot)&&(J!==vt&&J!==Pe||!nt)){ge&&I.stopPropagation();var Ce={transition:"transform ".concat(me,"ms ease-out")};this.setState({thumbsTranslate:Te,thumbsStyle:Ce})}}},{key:"handleOnThumbnailSwiped",value:function(){var $=this.state.thumbsTranslate,I=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:$,thumbsStyle:{transition:"all ".concat(I,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var $=this.state.currentSlideOffset,I=this.props.swipeThreshold;return Math.abs($)>I}},{key:"resetSwipingDirection",value:function(){var $=this.state,I=$.swipingUpDown,F=$.swipingLeftRight;I&&this.setState({swipingUpDown:!1}),F&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function($){var I=$.event,F=$.dir,X=$.velocity,J=this.props,Y=J.disableSwipe,ge=J.stopPropagation,me=J.flickThreshold;if(!Y){var we=this.props.isRTL;ge&&I.stopPropagation(),this.resetSwipingDirection();var ie=(F===St?1:-1)*(we?-1:1),se=X>me&&!(F===dt||F===Pe);this.handleOnSwipedTo(ie,se)}}},{key:"handleOnSwipedTo",value:function($,I){var F=this.state,X=F.currentIndex,J=F.isTransitioning,Y=X;!this.sufficientSwipe()&&!I||J||(Y+=$),($===-1&&!this.canSlideLeft()||$===1&&!this.canSlideRight())&&(Y=X),this.unthrottledSlideToIndex(Y)}},{key:"handleTouchMove",value:function($){this.state.swipingLeftRight&&$.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function($){var I=this.props,F=I.disableKeyDown,X=I.useBrowserFullscreen,J=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!F)switch(parseInt($.keyCode||$.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft($);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight($);break;case 27:J&&!X&&this.exitFullScreen()}}},{key:"handleImageError",value:function($){var I=this.props.onErrorImageURL;I&&$.target.src.indexOf(I)===-1&&($.target.src=I)}},{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 $=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($)))}},{key:"initSlideWrapperResizeObserver",value:function($){var I=this;$&&!$.current||(this.resizeSlideWrapperObserver=new hr(H(function(F){F&&F.forEach(function(X){I.setState({thumbnailsWrapperWidth:X.contentRect.width},I.handleResize)})},50)),this.resizeSlideWrapperObserver.observe($.current))}},{key:"initThumbnailWrapperResizeObserver",value:function($){var I=this;$&&!$.current||(this.resizeThumbnailWrapperObserver=new hr(H(function(F){F&&F.forEach(function(X){I.setState({thumbnailsWrapperHeight:X.contentRect.height},I.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe($.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 $=this.props,I=$.onScreenChange,F=$.useBrowserFullscreen,X=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,J=this.imageGallery.current===X;I&&I(J),F&&this.setState({isFullscreen:J})}},{key:"slideToIndex",value:function($,I){var F=this.state,X=F.currentIndex,J=F.isTransitioning,Y=this.props,ge=Y.items,me=Y.slideDuration,we=Y.onBeforeSlide;if(!J){I&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var ie=ge.length-1,se=$;$<0?se=ie:$>ie&&(se=0),we&&se!==X&&we(se),this.setState({previousIndex:X,currentIndex:se,isTransitioning:se!==X,currentSlideOffset:0,slideStyle:{transition:"all ".concat(me,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function($){var I=this.props.isRTL;this.slideTo($,I?"right":"left")}},{key:"slideRight",value:function($){var I=this.props.isRTL;this.slideTo($,I?"left":"right")}},{key:"slideTo",value:function($,I){var F=this.state,X=F.currentIndex,J=F.isTransitioning,Y=this.props.items,ge=X+(I==="left"?-1:1);J||(Y.length===2?this.slideToIndexWithStyleReset(ge,$):this.slideToIndex(ge,$))}},{key:"slideToIndexWithStyleReset",value:function($,I){var F=this,X=this.state,J=X.currentIndex,Y=X.currentSlideOffset;this.setState({currentSlideOffset:Y+(J>$?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return F.slideToIndex($,I)},25)})}},{key:"handleThumbnailMouseOver",value:function($,I){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver($,I)}},{key:"handleThumbnailKeyUp",value:function($,I){Ki($)&&this.onThumbnailClick($,I)}},{key:"handleSlideKeyUp",value:function($){Ki($)&&(0,this.props.onClick)($)}},{key:"isThumbnailVertical",value:function(){var $=this.props.thumbnailPosition;return $==="left"||$==="right"}},{key:"addScreenChangeEvent",value:function(){var $=this;Vi.forEach(function(I){document.addEventListener(I,$.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var $=this;Vi.forEach(function(I){document.removeEventListener(I,$.handleScreenChange)})}},{key:"fullScreen",value:function(){var $=this.props.useBrowserFullscreen,I=this.imageGallery.current;$?I.requestFullscreen?I.requestFullscreen():I.msRequestFullscreen?I.msRequestFullscreen():I.mozRequestFullScreen?I.mozRequestFullScreen():I.webkitRequestFullscreen?I.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var $=this.state.isFullscreen,I=this.props.useBrowserFullscreen;$&&(I?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 $=this.props.infinite,I=this.state.currentIndex;$||this.canSlideRight()?this.slideToIndex(I+1):this.pause()}},{key:"play",value:function(){var $=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],I=this.props,F=I.onPlay,X=I.slideInterval,J=I.slideDuration,Y=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(X,J)),F&&$&&F(Y))}},{key:"pause",value:function(){var $=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],I=this.props.onPause,F=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),I&&$&&I(F))}},{key:"isImageLoaded",value:function($){return!!this.loadedImages[$.original]||(this.loadedImages[$.original]=!0,!1)}},{key:"handleImageLoaded",value:function($,I){var F=this.props.onImageLoad;!this.loadedImages[I]&&F&&(this.loadedImages[I]=!0,F($))}},{key:"renderItem",value:function($){var I=this.state.isFullscreen,F=this.props.onImageError||this.handleImageError;return c().createElement(U,{description:$.description,fullscreen:$.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:I,onImageError:F,original:$.original,originalAlt:$.originalAlt,originalHeight:$.originalHeight,originalWidth:$.originalWidth,originalTitle:$.originalTitle,sizes:$.sizes,loading:$.loading,srcSet:$.srcSet})}},{key:"renderThumbInner",value:function($){var I=this.props.onThumbnailError||this.handleImageError;return c().createElement("span",{className:"image-gallery-thumbnail-inner"},c().createElement("img",{className:"image-gallery-thumbnail-image",src:$.thumbnail,height:$.thumbnailHeight,width:$.thumbnailWidth,alt:$.thumbnailAlt,title:$.thumbnailTitle,loading:$.thumbnailLoading,onError:I}),$.thumbnailLabel&&c().createElement("div",{className:"image-gallery-thumbnail-label"},$.thumbnailLabel))}},{key:"render",value:function(){var $=this.state,I=$.currentIndex,F=$.isFullscreen,X=$.modalFullscreen,J=$.isPlaying,Y=this.props,ge=Y.additionalClass,me=Y.disableThumbnailSwipe,we=Y.indexSeparator,ie=Y.isRTL,se=Y.items,ae=Y.thumbnailPosition,he=Y.renderFullscreenButton,_e=Y.renderCustomControls,Te=Y.renderLeftNav,Fe=Y.renderRightNav,ot=Y.showBullets,nt=Y.showFullscreenButton,He=Y.showIndex,De=Y.showThumbnails,Ce=Y.showNav,Vt=Y.showPlayButton,Cr=Y.renderPlayPauseButton,Ir=this.getThumbnailStyle(),Nt=this.getSlideItems(),Qt=Nt.slides,Ot=Nt.thumbnails,wr=Nt.bullets,$r=v("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ae),{"image-gallery-rtl":ie}),_r=c().createElement("div",{ref:this.imageGallerySlideWrapper,className:$r},_e&&_e(),this.canSlide()?c().createElement(c().Fragment,null,Ce&&c().createElement(c().Fragment,null,Te(this.slideLeft,!this.canSlideLeft()),Fe(this.slideRight,!this.canSlideRight())),c().createElement(br,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},c().createElement("div",{className:"image-gallery-slides"},Qt))):c().createElement("div",{className:"image-gallery-slides"},Qt),Vt&&Cr(this.togglePlay,J),ot&&c().createElement("div",{className:"image-gallery-bullets"},c().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},wr)),nt&&he(this.toggleFullScreen,F),He&&c().createElement("div",{className:"image-gallery-index"},c().createElement("span",{className:"image-gallery-index-current"},I+1),c().createElement("span",{className:"image-gallery-index-separator"},we),c().createElement("span",{className:"image-gallery-index-total"},se.length))),Ar=v("image-gallery",ge,{"fullscreen-modal":X}),at=v("image-gallery-content",this.getThumbnailPositionClassName(ae),{fullscreen:F}),Oa=v("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ae),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&ie},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!me},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!me});return c().createElement("div",{ref:this.imageGallery,className:Ar,"aria-live":"polite"},c().createElement("div",{className:at},(ae==="bottom"||ae==="right")&&_r,De&&Ot.length>0?c().createElement(br,{className:Oa,delta:0,onSwiping:!me&&this.handleThumbnailSwiping,onSwiped:!me&&this.handleOnThumbnailSwiped},c().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},c().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:Ir,"aria-label":"Thumbnail Navigation"},Ot))):null,(ae==="top"||ae==="left")&&_r))}}],D&&xr(C.prototype,D),Object.defineProperty(C,"prototype",{writable:!1}),Se}(c().Component);bn.propTypes={flickThreshold:q.number,items:(0,q.arrayOf)((0,q.shape)({bulletClass:q.string,bulletOnClick:q.func,description:q.string,original:q.string,originalHeight:q.number,originalWidth:q.number,loading:q.string,thumbnailHeight:q.number,thumbnailWidth:q.number,thumbnailLoading:q.string,fullscreen:q.string,originalAlt:q.string,originalTitle:q.string,thumbnail:q.string,thumbnailAlt:q.string,thumbnailLabel:q.string,thumbnailTitle:q.string,originalClass:q.string,thumbnailClass:q.string,renderItem:q.func,renderThumbInner:q.func,imageSet:ka,srcSet:q.string,sizes:q.string})).isRequired,showNav:q.bool,autoPlay:q.bool,lazyLoad:q.bool,infinite:q.bool,showIndex:q.bool,showBullets:q.bool,showThumbnails:q.bool,showPlayButton:q.bool,showFullscreenButton:q.bool,disableThumbnailScroll:q.bool,disableKeyDown:q.bool,disableSwipe:q.bool,disableThumbnailSwipe:q.bool,useBrowserFullscreen:q.bool,onErrorImageURL:q.string,indexSeparator:q.string,thumbnailPosition:(0,q.oneOf)(["top","bottom","left","right"]),startIndex:q.number,slideDuration:q.number,slideInterval:q.number,slideOnThumbnailOver:q.bool,swipeThreshold:q.number,swipingTransitionDuration:q.number,swipingThumbnailTransitionDuration:q.number,onSlide:q.func,onBeforeSlide:q.func,onScreenChange:q.func,onPause:q.func,onPlay:q.func,onClick:q.func,onImageLoad:q.func,onImageError:q.func,onTouchMove:q.func,onTouchEnd:q.func,onTouchStart:q.func,onMouseOver:q.func,onMouseLeave:q.func,onBulletClick:q.func,onThumbnailError:q.func,onThumbnailClick:q.func,renderCustomControls:q.func,renderLeftNav:q.func,renderRightNav:q.func,renderPlayPauseButton:q.func,renderFullscreenButton:q.func,renderItem:q.func,renderThumbInner:q.func,stopPropagation:q.bool,additionalClass:q.string,useTranslate3D:q.bool,isRTL:q.bool,useWindowKeyDown:q.bool},bn.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(P,C){return c().createElement(ht,{onClick:P,disabled:C})},renderRightNav:function(P,C){return c().createElement(Or,{onClick:P,disabled:C})},renderPlayPauseButton:function(P,C){return c().createElement(Hr,{onClick:P,isPlaying:C})},renderFullscreenButton:function(P,C){return c().createElement(Ge,{onClick:P,isFullscreen:C})},useWindowKeyDown:!0};const Ra=bn})(),g})())})(oa);var ih=oa.exports;const sh=ln(ih);function oh(){var e=new Map;function r(d){var m=d.root,_=d.rootMargin,x=d.threshold,g=e.get(m);g||(g=new Map,e.set(m,g));var o=JSON.stringify({rootMargin:_,threshold:x}),v=g.get(o);if(!v){var y=new Map,c=new IntersectionObserver(function(t){t.forEach(function(a){var s=y.get(a.target);s==null||s(a)})},{root:m,rootMargin:_,threshold:x});v={observer:c,entryCallbacks:y},g.set(o,v)}return{observe:function(a,s){var n,i;(n=v)==null||n.entryCallbacks.set(a,s),(i=v)==null||i.observer.observe(a)},unobserve:function(a){var s,n;(s=v)==null||s.entryCallbacks.delete(a),(n=v)==null||n.observer.unobserve(a)}}}return{getObserver:r}}var ah="0px",lh=[0],ch=oh();function uh(e){var r,d,m=(r=e==null?void 0:e.rootMargin)!=null?r:ah,_=(d=e==null?void 0:e.threshold)!=null?d:lh,x=K.useRef(null),g=K.useRef(null),o=K.useRef(null),v=K.useState(),y=v[0],c=v[1],t=K.useCallback(function(){var i=x.current;if(!i){c(void 0);return}var h=ch.getObserver({root:g.current,rootMargin:m,threshold:_});h.observe(i,function(l){c(l)}),o.current=h},[m,_]),a=K.useCallback(function(){var i=o.current,h=x.current;h&&(i==null||i.unobserve(h)),o.current=null},[]),s=K.useCallback(function(i){a(),x.current=i,t()},[t,a]),n=K.useCallback(function(i){a(),g.current=i,t()},[t,a]);return[s,{entry:y,rootRef:n}]}function Wn(){return Wn=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var d=arguments[r];for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(e[m]=d[m])}return e},Wn.apply(this,arguments)}function dh(e){var r,d=uh(e),m=d[0],_=d[1],x=!!((r=_.entry)!=null&&r.isIntersecting),g=K.useState(x),o=g[0],v=g[1];return x&&!o&&v(!0),[m,Wn({},_,{isVisible:x,wasEverVisible:o})]}var hh=100;function fh(e){var r=e.loading,d=e.hasNextPage,m=e.onLoadMore,_=e.rootMargin,x=e.disabled,g=e.delayInMs,o=g===void 0?hh:g,v=dh({rootMargin:_}),y=v[0],c=v[1],t=c.rootRef,a=c.isVisible,s=!x&&!r&&a&&d;return K.useEffect(function(){if(s){var n=setTimeout(function(){m()},o);return function(){clearTimeout(n)}}},[m,s,o]),[y,{rootRef:t}]}const ph={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"/>'},mh={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 Rn=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function On(e,r,d,m){e.addEventListener?e.addEventListener(r,d,m):e.attachEvent&&e.attachEvent("on".concat(r),function(){d(window.event)})}function aa(e,r){for(var d=r.slice(0,r.length-1),m=0;m<d.length;m++)d[m]=e[d[m].toLowerCase()];return d}function la(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var r=e.split(","),d=r.lastIndexOf("");d>=0;)r[d-1]+=",",r.splice(d,1),d=r.lastIndexOf("");return r}function gh(e,r){for(var d=e.length>=r.length?e:r,m=e.length>=r.length?r:e,_=!0,x=0;x<d.length;x++)m.indexOf(d[x])===-1&&(_=!1);return _}var Pi={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,"-":Rn?173:189,"=":Rn?61:187,";":Rn?59:186,"'":222,"[":219,"]":221,"\\":220},Gt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Vn={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Xe={16:!1,18:!1,17:!1,91:!1},qe={};for(var Zr=1;Zr<20;Zr++)Pi["f".concat(Zr)]=111+Zr;var Ne=[],Rs=!1,ca="all",ua=[],vn=function(r){return Pi[r.toLowerCase()]||Gt[r.toLowerCase()]||r.toUpperCase().charCodeAt(0)};function da(e){ca=e||"all"}function zr(){return ca||"all"}function yh(){return Ne.slice(0)}function vh(e){var r=e.target||e.srcElement,d=r.tagName,m=!0;return(r.isContentEditable||(d==="INPUT"||d==="TEXTAREA"||d==="SELECT")&&!r.readOnly)&&(m=!1),m}function bh(e){return typeof e=="string"&&(e=vn(e)),Ne.indexOf(e)!==-1}function xh(e,r){var d,m;e||(e=zr());for(var _ in qe)if(Object.prototype.hasOwnProperty.call(qe,_))for(d=qe[_],m=0;m<d.length;)d[m].scope===e?d.splice(m,1):m++;zr()===e&&da(r||"all")}function wh(e){var r=e.keyCode||e.which||e.charCode,d=Ne.indexOf(r);if(d>=0&&Ne.splice(d,1),e.key&&e.key.toLowerCase()==="meta"&&Ne.splice(0,Ne.length),(r===93||r===224)&&(r=91),r in Xe){Xe[r]=!1;for(var m in Gt)Gt[m]===r&&(ut[m]=!1)}}function _h(e){if(typeof e>"u")Object.keys(qe).forEach(function(g){return delete qe[g]});else if(Array.isArray(e))e.forEach(function(g){g.key&&Tn(g)});else if(typeof e=="object")e.key&&Tn(e);else if(typeof e=="string"){for(var r=arguments.length,d=new Array(r>1?r-1:0),m=1;m<r;m++)d[m-1]=arguments[m];var _=d[0],x=d[1];typeof _=="function"&&(x=_,_=""),Tn({key:e,scope:_,method:x,splitKey:"+"})}}var Tn=function(r){var d=r.key,m=r.scope,_=r.method,x=r.splitKey,g=x===void 0?"+":x,o=la(d);o.forEach(function(v){var y=v.split(g),c=y.length,t=y[c-1],a=t==="*"?"*":vn(t);if(qe[a]){m||(m=zr());var s=c>1?aa(Gt,y):[];qe[a]=qe[a].filter(function(n){var i=_?n.method===_:!0;return!(i&&n.scope===m&&gh(n.mods,s))})}})};function Os(e,r,d,m){if(r.element===m){var _;if(r.scope===d||r.scope==="all"){_=r.mods.length>0;for(var x in Xe)Object.prototype.hasOwnProperty.call(Xe,x)&&(!Xe[x]&&r.mods.indexOf(+x)>-1||Xe[x]&&r.mods.indexOf(+x)===-1)&&(_=!1);(r.mods.length===0&&!Xe[16]&&!Xe[18]&&!Xe[17]&&!Xe[91]||_||r.shortcut==="*")&&r.method(e,r)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function Ts(e,r){var d=qe["*"],m=e.keyCode||e.which||e.charCode;if(ut.filter.call(this,e)){if((m===93||m===224)&&(m=91),Ne.indexOf(m)===-1&&m!==229&&Ne.push(m),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(n){var i=Vn[n];e[n]&&Ne.indexOf(i)===-1?Ne.push(i):!e[n]&&Ne.indexOf(i)>-1?Ne.splice(Ne.indexOf(i),1):n==="metaKey"&&e[n]&&Ne.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ne=Ne.slice(Ne.indexOf(i))))}),m in Xe){Xe[m]=!0;for(var _ in Gt)Gt[_]===m&&(ut[_]=!0);if(!d)return}for(var x in Xe)Object.prototype.hasOwnProperty.call(Xe,x)&&(Xe[x]=e[Vn[x]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ne.indexOf(17)===-1&&Ne.push(17),Ne.indexOf(18)===-1&&Ne.push(18),Xe[17]=!0,Xe[18]=!0);var g=zr();if(d)for(var o=0;o<d.length;o++)d[o].scope===g&&(e.type==="keydown"&&d[o].keydown||e.type==="keyup"&&d[o].keyup)&&Os(e,d[o],g,r);if(m in qe){for(var v=0;v<qe[m].length;v++)if((e.type==="keydown"&&qe[m][v].keydown||e.type==="keyup"&&qe[m][v].keyup)&&qe[m][v].key){for(var y=qe[m][v],c=y.splitKey,t=y.key.split(c),a=[],s=0;s<t.length;s++)a.push(vn(t[s]));a.sort().join("")===Ne.sort().join("")&&Os(e,y,g,r)}}}}function Sh(e){return ua.indexOf(e)>-1}function ut(e,r,d){Ne=[];var m=la(e),_=[],x="all",g=document,o=0,v=!1,y=!0,c="+",t=!1;for(d===void 0&&typeof r=="function"&&(d=r),Object.prototype.toString.call(r)==="[object Object]"&&(r.scope&&(x=r.scope),r.element&&(g=r.element),r.keyup&&(v=r.keyup),r.keydown!==void 0&&(y=r.keydown),r.capture!==void 0&&(t=r.capture),typeof r.splitKey=="string"&&(c=r.splitKey)),typeof r=="string"&&(x=r);o<m.length;o++)e=m[o].split(c),_=[],e.length>1&&(_=aa(Gt,e)),e=e[e.length-1],e=e==="*"?"*":vn(e),e in qe||(qe[e]=[]),qe[e].push({keyup:v,keydown:y,scope:x,mods:_,shortcut:m[o],method:d,key:m[o],splitKey:c,element:g});typeof g<"u"&&!Sh(g)&&window&&(ua.push(g),On(g,"keydown",function(a){Ts(a,g)},t),Rs||(Rs=!0,On(window,"focus",function(){Ne=[]},t)),On(g,"keyup",function(a){Ts(a,g),wh(a)},t))}function Eh(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(qe).forEach(function(d){var m=qe[d].find(function(_){return _.scope===r&&_.shortcut===e});m&&m.method&&m.method()})}var Cn={setScope:da,getScope:zr,deleteScope:xh,getPressedKeyCodes:yh,isPressed:bh,filter:vh,trigger:Eh,unbind:_h,keyMap:Pi,modifier:Gt,modifierMap:Vn};for(var In in Cn)Object.prototype.hasOwnProperty.call(Cn,In)&&(ut[In]=Cn[In]);if(typeof window<"u"){var jh=window.hotkeys;ut.noConflict=function(e){return e&&window.hotkeys===ut&&(window.hotkeys=jh),ut},window.hotkeys=ut}ut.filter=function(){return!0};var ha=function(r,d){var m=r.target,_=m&&m.tagName;return!!(_&&d&&d.includes(_))},kh=function(r){return ha(r,["INPUT","TEXTAREA","SELECT"])};function Rh(e,r,d,m){d instanceof Array&&(m=d,d=void 0);var _=d||{},x=_.enableOnTags,g=_.filter,o=_.keyup,v=_.keydown,y=_.filterPreventDefault,c=y===void 0?!0:y,t=_.enabled,a=t===void 0?!0:t,s=_.enableOnContentEditable,n=s===void 0?!1:s,i=K.useRef(null),h=K.useCallback(function(l,u){var p,S;return g&&!g(l)?!c:kh(l)&&!ha(l,x)||(p=l.target)!=null&&p.isContentEditable&&!n?!0:i.current===null||document.activeElement===i.current||(S=i.current)!=null&&S.contains(document.activeElement)?(r(l,u),!0):!1},m?[i,x,g].concat(m):[i,x,g]);return K.useEffect(function(){if(!a){ut.unbind(e,h);return}return o&&v!==!0&&(d.keydown=!1),ut(e,d||{},h),function(){return ut.unbind(e,h)}},[h,e,a]),i}ut.isPressed;const fa=K.createContext({open:!1,toggleOpen:e=>{}});function Oh({children:e}){const[r,d]=K.useState(!1),m=x=>{d(x??!x)},_=K.useMemo(()=>({open:r,toggleOpen:m}),[r]);return w.jsx(fa.Provider,{value:_,children:e})}function Li(){return K.useContext(fa)}const ft={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},Th=e=>Gr(async()=>{const{data:r}=await e.get(ft.categoriesPath);return Array.isArray(r)?r:[]},{manual:!0});function Ch(e,r){const d={sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:m,onSearchSelect:_=o=>{r.onFilterChange({...d,keyword:o.title})},emptyCategory:x}=r;!d.category&&!x&&(d.category="All");const g=o=>{const v={...d,...o};m(xn(v,y=>y===""||y===void 0))};return{filters:e,cleanFilter:o=>{const v=o?xn(d,(y,c)=>o.includes(c)):{};m(xn(v,y=>y===""||y===void 0))},handleActiveMenu:o=>{o!==e.menu&&m({menu:o})},handleSort:(o,v)=>{g({sortBy:o,sortDirection:v||o==="nameAsc"?"asc":"desc"})},handleKeyword:o=>{g({category:void 0,keyword:o||void 0})},handlePrice:o=>{g({price:o===e.price?void 0:o})},handleCategory:o=>{g({category:o===e.category?"":o})},handleDeveloper:o=>{g({owner:o||void 0})},handlePage:o=>{g({currentPage:o})},handleSwitchShowResources:o=>{g({showResources:o})},handleSearchSelect:o=>{_(o)}}}const Ih=(e,r,d)=>e&&r||!d,pa=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ma=(e,r,d)=>{var m,_;const x=Vl(e),g=Kl(x.search);if((m=Gl(e,{strict:!0}))!=null&&m.endsWith(".gif"))return g.imageFilter?Hl({...x,search:""}):e;if(g.imageFilter)return e;const o=d||((_=window.blocklet)==null?void 0:_.version),{w:v,h:y}=typeof r=="object"?{w:r.w,h:r.h}:{w:r,h:r};return ei(e,{...v||y?{imageFilter:"resize",w:v,h:y}:{},v:o})},$h=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Ah=(e=[],r="en")=>e.map(d=>({name:d.locales[r]||d.locales.en,value:d._id})),Ph=(e,r)=>e==null?void 0:e.replace(/{(\w*)}/g,(d,m)=>r.hasOwnProperty(m)?r[m]:""),Lh=()=>window.innerWidth<=600,Nh={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"},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}"'}},Dh={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试"},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}” 的所有搜索结果"}},$n={en:Ji(Nh),zh:Ji(Dh)},ga=(e,r)=>{const d={};return e&&(d["x-blocklet-server-version"]=e),r&&(d["x-blocklet-store-version"]=r),d},Mh=e=>(r,d)=>{const m=$n[e]?$n[e][r]:$n.en[r];return Ph(m,d)||r},ya={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!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:()=>{}}},va=K.createContext(ya),{Provider:Fh,Consumer:lp}=va;function Bh(e){const{locale:r="zh",filters:d={},serverVersion:m="",onFilterChange:_=()=>{},minItemWidth:x=350,queryFilter:g=!0,layout:o={},wrapChildren:v=H=>H,extraFilter:y=H=>H,baseSearch:c=!1,fetchCategoryDelay:t=0,showResourcesSwitch:a=!1,showCategory:s=!0,tagFilters:n=[],children:i,storeVersion:h,onSearchSelect:l=()=>{},endpoint:u,blockletRender:p}=e,S=ga(m,h),b=K.useMemo(()=>eo({baseURL:u,headers:S}),[u]),O=Ch(d,{onFilterChange:_,emptyCategory:!o.showExplore,onSearchSelect:l}),[R,f]=K.useState(""),{data:E=[],error:j,loading:L,run:B}=Th(b),z=K.useMemo(()=>{const H=Qd(E,[Q=>Q.name],["asc"]),xe=H.findIndex(Q=>Q.name==="All"||Q.locales.en==="All");return xe>-1?[{...H[xe],_id:"All"},...H.slice(0,xe),...H.slice(xe+1)]:H},[E]),ee=K.useCallback(Mh(r),[r]),ne=K.useMemo(()=>Ah(z,r),[z,r]),G=$h(ee),oe={search:O,errors:{fetchCategoriesError:j},loadings:{fetchCategoriesLoading:L},extraFilter:y,endpoint:u,queryFilter:g,layout:{showExplore:o.showExplore??!1,showCategory:o.showCategory??!0,showTitle:o.showTitle??!0,showSearch:o.showSearch??!0},minItemWidth:x,wrapChildren:v,t:ee,storeVersion:h,serverVersion:m,selectedCategory:O.filters.category||(o.showExplore?"":"All"),categoryList:z,blockletRender:p,locale:r,categoryOptions:ne,priceOptions:G,storeApi:b,baseSearch:c,showResourcesSwitch:a,showCategory:s,tagFilters:n,onFilterChange:_,getCategoryLocale:H=>{if(!H)return null;const xe=E.find(Q=>Q._id===H||Q.locales.en==="All");return xe?xe.locales[r]||xe.locales.en:null},get developerName(){return R},updateDeveloperName:f};return K.useEffect(()=>{setTimeout(B,t||0)},[u,B,t]),w.jsx(Fh,{value:oe,children:i})}function it(){return K.useContext(va)||ya}function ba({children:e,onClick:r,size:d=32,...m}){return w.jsx(Vr,{...m,onClick:r,variant:"outlined",sx:[{minWidth:d,height:d,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(m.sx)?m.sx:[m.sx]],children:e})}function Jr(e,r){return e===void 0?r:e}function Ni({xs:e,sm:r,md:d,lg:m,xl:_,exact:x}){const g=Wr(),o=Ft(g.breakpoints.down("sm")),v=Ft(g.breakpoints.between("sm","md")),y=Ft(g.breakpoints.between("md","lg")),c=Ft(g.breakpoints.between("lg","xl"));if(x)return o?e||null:v?r||null:y?d||null:c?m||null:_||null;let t=e;return o||(t=Jr(r,t),v)||(t=Jr(d,t),y)||(t=Jr(m,t),c)?t:Jr(_,t)}function Uh({children:e}){const{open:r,toggleOpen:d}=Li();return w.jsx(Ni,{xs:w.jsx(Ma,{open:r,onClose:()=>d(!1),children:e}),md:w.jsx(ue,{children:e})})}const qh=K.forwardRef(({loading:e,disabled:r,...d},m)=>w.jsx(Vr,{ref:m,disableElevation:!0,disabled:r||e,...d,sx:[{borderRadius:"4px"},...Array.isArray(d.sx)?d.sx:[d.sx]],startIcon:e&&w.jsx(pt,{size:"1em"})}));function xa({value:e,options:r,onChange:d,placeholder:m,..._}){var x;const g=K.useRef(null),o=Wr(),[v,y]=K.useState(!1),[c,t]=K.useState(e!==null?e:""),a=Ft(o.breakpoints.down("sm"));K.useEffect(()=>{t(e!==null?e:"")},[e]);const s=K.useCallback(()=>{y(!1)},[]),n=K.useCallback(()=>{y(!0)},[]);function i(l){t(l.value),d(l.value),a&&s()}function h(l){return l===c}return w.jsxs(w.Fragment,{children:[w.jsxs(zh,{ref:g,onClick:n,variant:"outlined",size:"medium",className:["my-select__selector",Mr(c)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary",borderRadius:"8px"},..._,children:[((x=r.find(l=>l.value===c))==null?void 0:x.name)||m,w.jsx(Fa,{className:"my-select__arrowdown",component:sa,sx:{width:18,height:18}})]}),w.jsx(Ba,{open:v,anchorEl:g.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:l,placement:u})=>w.jsx(Ua,{...l,style:{transformOrigin:u==="bottom"?"center top":"center bottom"},children:w.jsx(qa,{children:w.jsx(za,{onClickAway:s,children:w.jsx(Wh,{autoFocusItem:v,onMouseEnter:n,onMouseLeave:s,children:r.map(p=>w.jsxs(Xn,{onClick:()=>i(p),sx:{fontSize:14},children:[w.jsx(ro,{sx:{mr:1,fontSize:16,visibility:h(p.value)?"visible":"hidden"}}),p.name]},p.value))})})})})})]})}const zh=ar(qh)`
437
- border: 1px solid #f0f0f0;
438
- padding: 6px 8px 6px 12px;
439
- font-weight: ${e=>e.theme.typography.fontWeightRegular};
440
- font-size: 14px;
441
- color: #666;
442
- line-height: 1;
443
- text-transform: none;
444
- & + & {
445
- margin-left: 10px;
446
- }
447
- &.my-select__selector--active {
448
- &,
449
- .my-select__arrowdown,
450
- }
451
- .my-select__arrowdown {
452
- color: #999;
453
- font-size: 14px;
454
- margin-left: 6px;
455
- }
456
- .my-select__icon {
457
- font-size: 0;
458
- svg {
459
- color: #999;
460
- font-size: 18px;
461
- margin-right: 3px;
462
- }
463
- }
464
- `,Wh=ar(Ks)`
465
- .my-select__option__icon {
466
- color: transparent;
467
- font-size: 14px;
468
- margin: 0 3px 0 -5px;
469
- }
470
- .my-select__option {
471
- font-size: 14px;
472
- color: #999;
473
- }
474
- .my-select__option--active {
475
- &,
476
- .my-select__option__icon {
477
- color: ${e=>e.theme.palette.primary.main};
478
- }
479
- }
480
- `;function wa(){const{search:e,t:r}=it(),{filters:d,handleSort:m,handlePrice:_}=e,x=pa(r);return w.jsxs(wt,{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:[w.jsx(Gn,{control:w.jsx(Hn,{checked:d.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:g=>_(g.target.checked?"free":"")}),label:r("blocklet.free")}),w.jsx(xa,{value:d.sortBy||x[0].value,options:x,onChange:g=>m(g),placeholder:r("sort.sort")})]})}function Vh({menus:e}){const{selectedCategory:r,search:d,t:m,categoryOptions:_,loadings:x,layout:g,baseSearch:o}=it(),{filters:v,handleActiveMenu:y,handleCategory:c,cleanFilter:t}=d,{toggleOpen:a}=Li();K.useEffect(()=>{a(!1)},[Object.values(v).join("")]);const s=Ih(o,g.showSearch,v.keyword);return g.showCategory?w.jsxs(Uh,{children:[w.jsx(Ni,{xs:w.jsxs(wt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[w.jsx(ba,{onClick:()=>a(!1),children:w.jsx(Qn,{})}),w.jsx(Ee,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:m("common.category")})]}),md:null}),w.jsx(wt,{visibility:x.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:s?w.jsxs(w.Fragment,{children:[g.showExplore&&w.jsxs(ue,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[w.jsxs(ue,{display:"flex",alignItems:"center",gap:1,children:[w.jsx(Ut,{icon:Xd,width:20,height:20}),w.jsx(Ee,{variant:"body1",color:!r&&!v.menu?"text.primary":"text.lighter",fontWeight:!r&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{a(!1),t()},children:m("explore.title")})]}),e==null?void 0:e.map(n=>w.jsxs(ue,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof n.icon=="string"?w.jsx(Ut,{icon:n.icon,width:20,height:20}):n.icon,w.jsx(Ee,{variant:"body1",color:v.menu===n.key?"text.primary":"text.lighter",fontWeight:v.menu===n.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var i;a(!1),y(n.key),(i=n.onClick)==null||i.call(n)},children:n.title})]},n.key))]}),!!_.length&&w.jsx(wt,{gap:2,children:_.map(n=>w.jsx(Ee,{variant:"body1",title:n.name,sx:{cursor:"pointer"},"data-cy":"filter",color:r===n.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{r===n.value?t():c(n.value),a(!1)},children:n.name},n.value))})]}):w.jsx(wa,{})})]}):null}function Di(){const{endpoint:e,serverVersion:r,storeVersion:d}=it(),m=ga(r,d),_=K.useMemo(()=>eo({baseURL:e,headers:m}),[e]);return{get:async x=>{const{data:g}=await _.get(x);return g},post:async(x,g)=>{const{data:o}=await _.post(x,g);return o}}}const _a=K.memo(function(e){return w.jsx(ue,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:w.jsx(pt,{})})});function Cs({icon:e,children:r,maxWidth:d=100,title:m}){return(r===0||r)&&w.jsxs(wt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:d,overflow:"hidden"},children:[e,w.jsx(Ee,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:m||(typeof r=="string"?r:void 0),children:r})]})}const Kh=16/9,An=292,Kn=189,sn=336;function Gh(){var e,r;const{t:d,search:m}=it(),{get:_}=Di(),x=Wr(),g=Ft(x.breakpoints.down("md")),o=((r=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:r.homeBanner)||[],{data:v=[],error:y,loading:c}=Gr(async()=>{const l=await _(ei(ft.blockletsPath,{didList:o.map(u=>u.did).join(",")}));return l!=null&&l.dataList?o.map(u=>l.dataList.find(p=>p.did===u.did)):[]});y&&console.error("Get Banner Blocklets error:",y);const t={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!y&&o.length>0?w.jsxs(w.Fragment,{children:[w.jsx(Ee,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:d("explore.title")}),w.jsx(ue,{height:{xs:"auto",md:An},minHeight:An,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:c?w.jsxs(ue,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[w.jsx(Kt,{variant:"rounded",height:Kn,width:sn}),w.jsxs(ue,{flex:1,height:"100%",children:[w.jsx(Kt,{variant:"text",height:50,width:100}),w.jsx(Kt,{variant:"text",height:40,width:"100%"}),w.jsx(Kt,{variant:"text",height:40,width:300}),w.jsxs(ue,{display:"flex",gap:1,my:2,children:[w.jsx(Kt,{variant:"circular",height:20,width:20}),w.jsx(Kt,{variant:"text",height:20,width:50})]}),w.jsx(Kt,{variant:"rounded",height:30,width:100})]})]}):w.jsx(sh,{showNav:!0,autoPlay:!0,slideDuration:g?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:l=>w.jsx(ue,{onClick:l,sx:{display:{xs:"none",md:"block"}},children:w.jsx(oc,{sx:{...t,left:5}})}),renderRightNav:l=>w.jsx(ue,{onClick:l,sx:{display:{xs:"none",md:"block"}},children:w.jsx(ac,{sx:{...t,right:5}})}),items:o.map((l,u)=>({original:l.did,renderItem:()=>{var p;const S=v[u]||{},b=l.cover||Xh(l.did,(p=S.screenshots)==null?void 0:p[0]),O=ma(b,x.breakpoints.values.md*2);return w.jsxs(wt,{height:{xs:"auto",md:An},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${O}")`,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:()=>m.handleSearchSelect(S),gap:{xs:2,md:5},children:[a(O),w.jsxs(wt,{flex:1,height:"100%",gap:3,children:[w.jsxs(ue,{flex:1,children:[s(l.name||S.title||l.name),n(l.desc||S.description)]}),S.did&&i(S,l.baseNum),h(S)]})]})}}))})})]}):null;function a(l){return w.jsx(ue,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:sn},children:w.jsx(Yh,{url:l})})}function s(l){return w.jsx(Ee,{variant:"h2",width:"100%",children:l})}function n(l){return w.jsx(Ee,{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 i(l,u=0){const{did:p,owner:S,stats:b}=l;return w.jsxs(ue,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[w.jsx(Cs,{icon:w.jsx(Jn,{src:S.avatar,did:p,size:20,variant:"circle"}),children:S.fullName}),w.jsx(Cs,{icon:w.jsx(Ut,{icon:nh}),title:`${b.downloads+u}`,children:Hh(b.downloads+u)})]})}function h(l){return w.jsx(Vr,{variant:"outlined",size:"small",onClick:()=>m.handleSearchSelect(l),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:d("explore.viewDetail")})}}const Hh=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`,Xh=(e,r)=>e&&r?`/assets/${e}/screenshots/${r}`:"";function Yh({url:e}){const[r,d]=K.useState(!0);return w.jsxs(w.Fragment,{children:[r&&w.jsx(Kt,{variant:"rectangular",sx:{width:{xs:"100%",md:sn},height:{xs:"auto",md:Kn}}}),w.jsx(ue,{display:r?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:sn},height:{xs:"auto",md:Kn},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Kh},onLoad:()=>d(!1),onError:()=>d(!1)})]})}function Zh({title:e,blocklets:r}){const{blockletRender:d,serverVersion:m}=it();return w.jsxs(ue,{mt:3,children:[w.jsx(Ee,{component:"h3",variant:"h3",sx:{mb:2},children:e}),w.jsx(Gi,{container:!0,spacing:2,children:r.map(_=>w.jsx(Gi,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":_.did,children:w.jsx(ue,{padding:"1px",children:d({blocklet:_,blocklets:r,serverVersion:m})})},_.did))})]})}function Jh(){const{get:e}=Di(),{t:r}=it(),{data:d=[],error:m,loading:_}=Gr(async()=>{const x=await e(ft.explorePath);return Array.isArray(x)?x:[]});return m?w.jsx(dn,{error:new Error(`Failed to fetch blocklets from ${ft.explorePath}`)}):_?w.jsx(_a,{mt:15}):w.jsxs(w.Fragment,{children:[w.jsx(Gh,{}),d.map(x=>x.blocklets.length>0?w.jsx(Zh,{title:r(`explore.${x.type}`),blocklets:x.blocklets},x.type):null)]})}const Pn="__FREE_TEXT__",Is="__NO_RESULT__",Ln=40;function Qh({endpoint:e,t:r,locale:d,filters:m,handleKeyword:_,handleSearchSelect:x,...g}){const o=K.useRef(null),v=K.useRef(!1),[y,c]=K.useState(!1),[t,a]=K.useState(""),[s,n]=K.useState(!1),i=Di(),[h,l]=K.useState(!1),u=(g==null?void 0:g.placeholder)||r("common.searchStore"),p=async G=>{l(!0);const oe=await i.get(Ur(e,ei(ft.blockletsPath,G)));return l(!1),oe.dataList||[]},{data:S,run:b}=Gr(G=>G?p({sortBy:ft.nameDesc,page:1,pageSize:10,keyword:G,showResources:"true"}):Promise.resolve([]),{manual:!0});K.useEffect(()=>{l(!0),b(m.keyword),a(m.keyword||"")},[m.keyword,b]),Rh("ctrl + k, command + k",G=>{var oe,H;return G.stopPropagation(),G.preventDefault(),(H=(oe=o.current)==null?void 0:oe.querySelector("input"))==null||H.focus(),!1},{enableOnTags:["INPUT"]});const O=oo(G=>b(G),{wait:300}),R={name:Pn,title:t,did:""};let f=[];return t&&(h?f=[R]:S!=null&&S.length?f=[R,...S]:f=[{name:Is,title:r("blocklet.noResults"),did:""}]),w.jsxs(w.Fragment,{children:[w.jsxs(Wa,{fullScreen:!0,open:s,sx:{display:{md:"none"}},children:[w.jsxs(ue,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[w.jsx(Gs,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:u,className:"bl-autocomplete-input",value:t,onChange:G=>E(G.target.value),startAdornment:ee(s),endAdornment:ne()}),w.jsx(Vr,{variant:"outlined",onClick:()=>{n(!1),a(m.keyword||"")},children:r("common.cancel")})]}),w.jsx(Ks,{sx:{p:.5},children:f.map(G=>B(G))})]}),w.jsx(tn,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>n(!0)}),w.jsx(Bs,{ref:o,open:!!t&&y,size:"small",onOpen:()=>c(!0),onClose:(G,oe)=>{c(!1),oe==="selectOption"&&!v.current&&_(t)},onKeyDown:G=>{G.key==="Enter"&&!t&&j()},disableClearable:!0,inputValue:t,onInputChange:(G,oe)=>E(oe),isOptionEqualToValue:(G,oe)=>G.name===oe.name,getOptionLabel:G=>G.title,getOptionKey:G=>G.name,noOptionsText:r("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:G=>w.jsx(an,{...G,InputProps:{...G.InputProps,autoFocus:!0,placeholder:u,className:"bl-autocomplete-input",value:t,startAdornment:ee(y),endAdornment:ne()}}),filterOptions:G=>G,...g,options:f,renderOption:(G,oe)=>B(oe),value:R,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(g.sx)?g.sx:[g.sx]]})]});function E(G){l(!0),a(G),v.current=!1,O.run(G)}function j(){n(!1),a(""),E(""),_("")}function L(G){G!=null&&G.did?(n(!1),v.current=!0,a(""),x(G)):G.name===Pn&&(n(!1),_(t))}function B(G){var oe,H;return w.jsxs(Xn,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>L(G),children:[z(G),w.jsxs(Ee,{variant:"body1",children:[w.jsx(Ee,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:G.title}),w.jsx(Ee,{sx:{color:"text.lighter"},fontSize:"13px",children:((H=(oe=G.category)==null?void 0:oe.locales)==null?void 0:H[d||"en"])||""})]})]},G.did)}function z(G){if([Pn,Is].includes(G.name))return w.jsx(ue,{width:Ln,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:w.jsx(tn,{sx:{fontSize:28}})});let oe="";return G.logo&&(oe=Ur(e,"assets",G.did,ma(G.logo,Ln,G.version))),w.jsx(Jn,{src:oe,size:Ln,style:{borderRadius:"8px",overflow:"hidden"}})}function ee(G=!0){return w.jsx(ue,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:G&&t&&h?w.jsx(pt,{color:"inherit",size:16}):w.jsx(tn,{sx:{fontSize:16,cursor:"default"}})})}function ne(){return t?w.jsx(ue,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:w.jsx(Qn,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>j()})}):null}}function ef({placeholder:e="Type to search...",...r}){const{search:d}=it(),{filters:m,handleKeyword:_}=d,[x,g]=K.useState(m.keyword||""),o=oo(_,{wait:300}),v=c=>{const{value:t}=c.target;g(t),o.run(t)},y=()=>{g(""),_("")};return K.useEffect(()=>{g(m.keyword||"")},[m.keyword]),w.jsx(tf,{inputProps:{"data-cy":"search-blocklet"},startAdornment:w.jsx(Xi,{position:"start",children:w.jsx(rf,{})}),onChange:v,placeholder:e,value:x,title:e,"data-cy":"search",endAdornment:x&&w.jsx(Xi,{position:"end",children:w.jsx(nf,{"data-cy":"search-delete",onClick:y})}),...r})}const tf=ar(Gs)`
481
- background-color: ${e=>e.theme.palette.grey[50]};
482
- font-size: 14px;
483
- border-radius: 6px;
484
- width: 100%;
485
- .MuiInputBase-input {
486
- padding: 8px 0 8px 10px;
487
- }
488
- .MuiOutlinedInput-notchedOutline {
489
- border: none;
490
- }
491
- .Mui-focused {
492
- background-color: #f6f6f6;
493
- .MuiInputBase-input::placeholder {
494
- color: transparent;
495
- }
496
- }
497
- `,rf=ar(tn)`
498
- color: ${e=>e.theme.palette.grey[500]};
499
- font-size: 28px;
500
- @media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
501
- font-size: 24px;
502
- }
503
- `,nf=ar(Qn)`
504
- color: ${e=>e.theme.palette.grey[500]};
505
- font-size: 16px;
506
- cursor: pointer;
507
- `;function sf(){const{search:e,t:r,endpoint:d,locale:m,getCategoryLocale:_,developerName:x,showResourcesSwitch:g,layout:o,baseSearch:v}=it(),{filters:y,handleSort:c,handlePrice:t,handleDeveloper:a,handleSwitchShowResources:s,cleanFilter:n}=e,i=pa(r);return w.jsxs(wt,{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:3,children:[w.jsx(Ee,{variant:"h2",textTransform:"capitalize",children:_(y.category)}),w.jsxs(wt,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[o.showSearch?w.jsx(ue,{flex:1,children:v?w.jsx(ef,{}):w.jsx(Qh,{locale:m,endpoint:d,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:r,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,y.owner&&x&&w.jsx(Hi,{label:r("blocklet.authorTag",{name:x}),size:"small",onDelete:()=>a("")}),y.resourceDid&&y.resourceBlocklet&&w.jsx(Hi,{label:r("blocklet.resourceTag",{name:y.resourceBlocklet}),size:"small",onDelete:()=>n(["resourceDid","resourceBlocklet","showResources"])}),g?w.jsx($s,{checked:y.showResources!=="false",onChange:h=>s(h?"true":"false"),label:r("common.showResources")}):null,w.jsx($s,{checked:y.price==="free",onChange:h=>t(h?"free":""),label:r("blocklet.free")}),w.jsx(xa,{value:y.sortBy||i[0].value,options:i,placeholder:r("sort.sort"),onChange:h=>c(h)})]})]})}function $s({checked:e,onChange:r,label:d}){return w.jsx(Gn,{sx:{m:0,p:0},className:"check-button",control:w.jsx(Hn,{checked:e,icon:w.jsx(Ut,{style:{padding:0},icon:ph}),checkedIcon:w.jsx(Ut,{style:{padding:0,color:"#3478E2"},icon:mh}),size:"large",sx:{p:0,mr:1},onChange:m=>r(m.target.checked)}),label:d})}function Qr({children:e}){return w.jsxs(ue,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[w.jsx(ul,{}),e]})}function As(){const{t:e}=it();return w.jsx(Ee,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Nn({filterTip:e,keywordTip:r}){const{t:d,locale:m}=it(),_=()=>m==="zh"?"、":" , ";return w.jsxs(ue,{mt:1,display:"flex",children:[w.jsx(Ee,{style:{marginRight:"16px"},children:d("blocklet.emptyTip")}),e&&w.jsx(Ee,{children:d("blocklet.filterTip")}),e&&r&&_(),r&&w.jsx(Ee,{children:d("blocklet.keywordTip")})]})}function Dn({primaryStart:e,primaryEnd:r,filter:d}){return w.jsxs(Ee,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[w.jsx(Ee,{children:e}),w.jsx(Ee,{color:"primary",children:d}),w.jsxs(Ee,{children:[r," "]})]})}function of(){const{t:e,search:r,getCategoryLocale:d,selectedCategory:m}=it(),{filters:_}=r,x=!!m||!!_.price;if(_.keyword&&x)return w.jsxs(Qr,{children:[w.jsx(Dn,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:_.keyword}),w.jsx(Nn,{keywordTip:!0,filterTip:!0})]});if(_.keyword)return w.jsxs(Qr,{children:[w.jsx(Dn,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:_.keyword}),w.jsx(Nn,{keywordTip:!0})]});if(x){const g=d(m);return w.jsxs(Qr,{children:[g?w.jsx(Dn,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:g}):w.jsx(As,{}),w.jsx(Nn,{filterTip:!0})]})}return w.jsx(Qr,{children:w.jsx(As,{})})}const af=(e,r,d,m)=>Ul(async _=>{_||(d.currentPage=d.defaultCurrentPage);const{currentPage:x,pageSize:g}=d,o={...r,category:r.category==="All"?"":r.category,sortBy:ft[r.sortBy],page:x,pageSize:g};m(null);const{data:v={}}=await e.get(ft.blockletsPath,{params:o});return d.currentPage++,{page:x,pageSize:g,list:(v==null?void 0:v.dataList)||[],total:(v==null?void 0:v.total)||0}},{isNoMore:_=>_?_.page*_.pageSize>=_.total:!1,reloadDeps:[e,dl(r)],onError:m});function lf(){var e;const{storeApi:r,search:d,extraFilter:m,errors:_,updateDeveloperName:x}=it(),{filters:g}=d,o=Bl({currentPage:ft.currentPage,pageSize:Lh()?ft.mobilePageSize:ft.pageSize,defaultCurrentPage:ft.defaultCurrentPage}),[v,y]=K.useState(null),c=af(r,g,o,y),t=K.useMemo(()=>{var a,s;return m?m(((a=c.data)==null?void 0:a.list)||[]):((s=c.data)==null?void 0:s.list)||[]},[c.data,m]);return K.useEffect(()=>{const a=t.find(s=>s.owner.did===g.owner);x((a==null?void 0:a.owner.fullName)||(a==null?void 0:a.author.name)||"")},[g.owner,t,x]),{blocklets:t,fetchBlockletsError:v,loadMore:c.loadMore,hasNextPage:!c.noMore,total:((e=c.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:c.loading,loadingMore:c.loadingMore},errors:{..._,fetchBlockletsError:v}}}function cf(){const{t:e,search:r,endpoint:d,blockletRender:m,serverVersion:_,minItemWidth:x,layout:g,baseSearch:o}=it(),{filters:v}=r,{blocklets:y,errors:c,loadMore:t,loadings:a,hasNextPage:s,total:n}=lf(),[i]=fh({loading:a.fetchBlockletsLoading||a.loadingMore,hasNextPage:s,onLoadMore:t});if(c.fetchBlockletsError){const p=new Error(`Failed to fetch blocklets from ${d}: ${c.fetchBlockletsError.message}`);return w.jsx(dn,{error:p})}const h=o&&g.showSearch||!v.keyword;return w.jsxs(w.Fragment,{children:[h?w.jsx(sf,{}):w.jsxs(w.Fragment,{children:[w.jsx(Ni,{xs:w.jsx(wa,{}),md:null}),u()]}),l(),!a.fetchBlockletsLoading&&s&&w.jsx(ue,{height:60,display:"flex",justifyContent:"center",py:2,ref:i,children:w.jsx(pt,{})})]});function l(){return a.fetchBlockletsLoading?w.jsx(_a,{mt:15}):y.length?w.jsx(ue,{className:"blocklet-list",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${x}px, 1fr))`,p:"2px",gap:2,children:y.map(p=>w.jsx(ue,{"data-blocklet-did":p.did,sx:{minWidth:x},children:m({blocklet:p,blocklets:y,serverVersion:_})},p.did))}):w.jsx(of,{})}function u(){return w.jsxs(wt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[w.jsx(Ee,{variant:"h3",children:e("blocklet.search",{keyword:v.keyword})}),w.jsx(Ee,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:n})})]})}}function uf(){const{t:e,selectedCategory:r,getCategoryLocale:d}=it(),{toggleOpen:m}=Li();return w.jsxs(Ee,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[w.jsx(ba,{onClick:()=>m(!0),children:w.jsx(cl,{})}),d(r)||e("common.category")]})}function df({menus:e,children:r}){var d;const{search:m,layout:_}=it(),{filters:x}=m,g=x.category||x.keyword||x.price,o=(d=e==null?void 0:e.find(v=>v.key===x.menu))==null?void 0:d.key;return w.jsx(Oh,{children:w.jsxs(to,{FallbackComponent:dn,children:[w.jsx(uf,{}),w.jsxs(ue,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[w.jsx(Vh,{menus:e}),w.jsxs(wt,{height:"100%",position:"relative",flex:1,overflow:"visible",children:[o&&(r==null?void 0:r(o)),!o&&(_.showExplore&&!g?w.jsx(Jh,{}):w.jsx(cf,{}))]})]})]})})}function hf(e){const{menus:r,children:d,...m}=e,_=Wr(),x=Ws(El({..._,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 w.jsx(Vs,{theme:x,children:w.jsx(Bh,{...m,children:w.jsx(df,{menus:r,children:d})})})}var Mi={},ff=on;Object.defineProperty(Mi,"__esModule",{value:!0});var Sa=Mi.default=void 0,pf=ff(cn()),mf=w;Sa=Mi.default=(0,pf.default)((0,mf.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const gf=(e,r)=>!r||!e?!0:Fn.satisfies(Fn.coerce(e),r);function Fi({children:e,serverVersion:r="",requirementVersion:d="",...m}){const{t:_}=mt();return gf(r,d)?e:w.jsx(Va,{title:_("store.tooltip.upgradeServer",{serverVersion:r,version:d}),arrow:!0,children:w.jsx(Ee,{children:w.jsx(Vr,{disabled:!0,variant:"outlined",...m,children:_("common.upgradeServer")})})})}Fi.propTypes={children:W.node.isRequired,serverVersion:W.string,requirementVersion:W.string};Fi.defaultProps={serverVersion:"",requirementVersion:""};const Dr=getComputedStyle(document.documentElement),yf=Ws({palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:Dr.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:Dr.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:Dr.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:Dr.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:Dr.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{fontSize:14,button:{textTransform:"none"},allVariants:{textTransform:"none"},h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),vf=(e,r)=>Ur(r,`/blocklets/${e.did}`),Ps=({blocklet:e,attribute:r,value:d})=>e._formatted?e._formatted[r]:d,bf=e=>e.inStore&&Bt.isFreeBlocklet(e)===!1;function Bi({blocklet:e,blocklets:r,handleButtonClick:d,endpoint:m,serverVersion:_}){var l;const{t:x}=mt();let g=Ur(m,jl(e.did,e.logo||""));try{const u=new URL(g);u.searchParams.set("v",e.version||+new Date),g=u.href}catch{}const[o,v]=K.useState(!1),y=u=>u.currentTarget.contains(u.target)?!0:(u.preventDefault(),!1),c=async u=>{u.preventDefault(),u.stopPropagation();try{v(!0),await d({meta:e,registryUrl:m,blocklets:r})}catch(p){Zn.error(p.message)}finally{v(!1)}},{blocklet:t}=hn(),a=()=>((t==null?void 0:t.children)||[]).find(S=>S.meta.bundleDid===e.did).meta.version,n=(()=>{const u=((t==null?void 0:t.children)||[]).find(p=>p.meta.bundleDid===e.did);if(u){try{const p=u.meta.version,S=e.version;if(Fn.gt(S,p))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let i=x("blocklet.component.choose");n==="upgrade"?i=x("blocklet.component.upgrade"):n==="disable"?i=x("blocklet.component.installed"):bf(e)&&(i=x("common.purchase"));const h=(l=e.requirements)==null?void 0:l.server;return w.jsx(Ka,{href:vf(e,m),style:{color:"initial",textDecoration:"none"},onClick:y,target:"_blank",children:w.jsx(xf,{title:Ps({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Ps({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?g:"",version:e.version,button:w.jsx(Fi,{serverVersion:_,requirementVersion:h,size:"small",children:w.jsx("div",{style:{display:"flex",alignItems:"center"},children:w.jsx(Gd,{children:w.jsxs(ct,{onClick:c,size:"small",disabled:o||n==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:n==="upgrade"?`${a()} -> ${e.version}`:"",children:[o?w.jsxs(w.Fragment,{children:[w.jsx(pt,{size:16,style:{marginRight:3}}),i]}):i,n==="upgrade"?w.jsx(Sa,{style:{fontSize:"1.2rem"}}):null]},e.did)})})})})})}Bi.propTypes={blocklet:W.object.isRequired,blocklets:W.array,handleButtonClick:W.func,endpoint:W.string,serverVersion:W.string};Bi.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function Ui({handleButtonClick:e,handleSearchSelect:r,storeUrl:d,handleBlockletRender:m,extraFilter:_,serverVersion:x,resourceType:g,resourceDid:o,showResourcesSwitch:v,showCategory:y,...c}){const{locale:t}=mt(),[a,s]=K.useState(!1),[n,i]=K.useState({}),h=u=>{i(u)},l=d;return K.useEffect(()=>{i({showResources:!0,resourceType:g,resourceDid:o})},[l,g,o]),K.useEffect(()=>{s(!0),i({showResources:!0,resourceType:g,resourceDid:o})},[]),w.jsx(Vs,{theme:yf,children:w.jsx(to,{FallbackComponent:dn,resetKeys:[l],children:w.jsxs(ue,{...c,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(c.sx)?c.sx:[c.sx]],children:[a&&w.jsx(hf,{showCategory:y,showResourcesSwitch:v,blockletRender:u=>{const p={...u,handleButtonClick:e,endpoint:l};return m({...u,defaultRender:w.jsx(Bi,{...p})})},baseSearch:!0,endpoint:l,locale:t,onFilterChange:h,onSearchSelect:r,filters:n,extraFilter:_,serverVersion:x,fetchCategoryDelay:500}),w.jsx(ue,{sx:{mt:2},children:" "})]})})})}Ui.propTypes={storeUrl:W.string.isRequired,handleButtonClick:W.func,handleSearchSelect:W.func,handleBlockletRender:W.func,extraFilter:W.func,serverVersion:W.string,resourceType:W.string,resourceDid:W.string,showResourcesSwitch:W.bool,showCategory:W.bool};Ui.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const xf=Ye($i)`
508
- .ms-highlight {
509
- color: ${e=>e.theme.palette.primary.main};
510
- }
511
- `,qi=K.forwardRef(({meta:e,isMobile:r,onStepChange:d},m)=>{const{steps:_,activeStep:x,setActiveStepByKey:g,setActiveStepByIndex:o}=hl(),{t:v,locale:y}=mt(),c=_[x];return K.useEffect(()=>{d(x)},[d,x]),K.useImperativeHandle(m,()=>({setActiveStepByKey:g,setActiveStepByIndex:o})),w.jsx(_f,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:w.jsx(fl,{locale:y,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?kl({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,stepTip:v("blocklet.component.add"),children:w.jsx(wf,{children:typeof(c==null?void 0:c.body)=="function"?c.body():c==null?void 0:c.body})})})});qi.propTypes={meta:W.any,onStepChange:W.func.isRequired,isMobile:W.bool.isRequired};qi.defaultProps={meta:null};const Ls=e=>e.isMobile?`
512
- height: calc(100vh - 56px - 64px - 48px);
513
- `:"",wf=Ye.div`
514
- width: 100%;
515
- height: 100%;
516
- display: flex;
517
- flex-direction: column;
518
- justify-content: flex-start;
519
- align-items: flex-start;
520
-
521
- .bottom-button {
522
- min-width: 200px;
523
- }
524
-
525
- // blocklet-select-side
526
- aside {
527
- width: 140px;
528
- }
529
- `,_f=Ye(ue)`
530
- ${({className:e})=>e==="mobileStyle"?`
531
- & > div{
532
- height: 100%;
533
- }
534
- .root-header {
535
- .app-name-content {
536
- display: none;
537
- }
538
- }
539
-
540
- // content-panel
541
- .root-header + div{
542
- padding-top: 0;
543
- position: relative;
544
- & > div {
545
- padding-top: 0;
546
- }
547
- }
548
-
549
- header + div {
550
- padding-top: 0;
551
- }
552
-
553
- header {
554
- .header-title {
555
- margin-left: 0;
556
- }
557
-
558
- .header-title-name {
559
- max-width: 100% !important;
560
- }
561
- }
562
- .app-content {
563
- padding: 0!important;
564
- }
565
- `:`
566
- position: relative;
567
- .ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
568
- width: 100%;
569
- height: 100%;
570
- }
571
-
572
- .root-header {
573
- z-index: auto !important;
574
- position: fixed !important;
575
- }
576
- & > div {
577
- height: 100%;
578
- width: 100%;
579
- max-width: 100%;
580
- & > div {
581
- max-height: unset !important;
582
- max-width: 100%;
583
- & > div {
584
- // left-panel
585
- &:first-child {
586
- padding: 0;
587
- width: 20%;
588
- min-width: 180px;
589
-
590
- & > div:first-child {
591
- display: none;
592
- }
593
- // step
594
- & > div:last-child {
595
- // margin-top: 32px;
596
- margin-top: 0;
597
- }
598
- }
599
- // right-panel
600
- &:last-child {
601
- padding-top: 0;
602
- padding-right: 0px;
603
- overflow-y: hidden;
604
- .app-content {
605
- padding: 0 0 24px 0;
606
- }
607
- .button-container {
608
- padding-right: 0;
609
- }
610
- }
611
- }
612
- }
613
- }
614
-
615
- `}
616
-
617
- & .app-overview {
618
- margin-left: 0 !important;
619
- }
620
-
621
- & .flex-justify-center {
622
- display: flex;
623
- justify-content: center;
624
- }
625
-
626
- & .flex-align-center {
627
- display: flex;
628
- height: 100%;
629
- align-items: center;
630
- ${e=>Ls(e)}
631
- }
632
-
633
- & .agreement-wrapper {
634
- ${e=>Ls(e)}
635
- max-height: 60vh;
636
- .eula-trigger {
637
- padding-right: 0;
638
- }
639
- .next-button {
640
- display: none;
641
- }
642
- }
643
-
644
- & .connect {
645
- background: white;
646
- }
647
- `,Sf=qi,Ef=e=>e.inStore&&Bt.isFreeBlocklet(e)===!1,jf=e=>{var r;return[Ct.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Ct.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)},Mn=e=>{var r,d;return((d=(r=e==null?void 0:e.configs)==null?void 0:r.find(m=>m.key===Ct.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:d.value)||null},kf=e=>(e.environments||[]).some(r=>r.required),Ns=(e,r)=>e==null?void 0:e.some(d=>d.required&&!r[d.key]),Rf=({params:e,blocklet:r,t:d})=>{const m=e.title||e.name;return m?((r==null?void 0:r.children)||[]).find(x=>x.meta.bundleDid===e.bundleDid)?d("blocklet.component.upgradeNext",{name:m}):d("blocklet.component.addNext",{name:m}):d("common.next")},Ds=({componentDid:e,timeout:r=1e3,manual:d=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:d},"*")},r)};function Ea({onClose:e,mode:r,stores:d,resourceType:m,resourceDid:_,storageKey:x,inDialog:g,selectedMeta:o,storeUrl:v,showResourcesSwitch:y,showFromUrl:c,enableRunBackground:t,showCategory:a}){var qt,Yt,Zt,At,fr,q,jt;const{t:s,locale:n}=mt(),[i,h]=K.useState(!1),[l,u]=K.useState(null),[p,S]=K.useState(""),[b,O]=K.useState(""),{api:R,ws:{useSubscription:f},inService:E,info:j}=Kr(),{blocklet:L,actions:{refreshBlocklet:B}}=hn(),[z,ee]=K.useState(null),[ne,G]=K.useState(!1),oe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[H,xe]=K.useState(oe),[Q,ve]=K.useState(0),ye=K.useRef({}),$e=K.useRef({}),Ae=K.useRef({}),Qe=Ft(le=>le.breakpoints.down("md")),gt=Ya(),[st,Ht]=K.useState(!0),{meta:Ke}=ye.current,je=le=>xe(fe=>({...fe,...le}));K.useEffect(()=>{if(H.pathPrefix){const{errMsg:le}=dr({...H,pathPrefix:H.pathPrefix,locale:n});S(le)}},[H.pathPrefix]),K.useEffect(()=>{Q===0&&xe(oe)},[Q]);const yt=()=>{const le=Mn(L)??"";je({didSpaceEndpoint:le})},ke=()=>{var le;return(le=ye==null?void 0:ye.current)!=null&&le.meta?Bt.getDisplayName(ye.current):""},$t=le=>{const fe=k=>{je({installResultProps:{variant:"error",title:ke(),subTitle:le,footer:w.jsx(ct,{className:"bottom-button",disabled:k,"data-cy":"retry-install-component",onClick:async()=>{fe(!0),await ur(ye.current.installInput)},children:w.jsxs(ue,{display:"flex",alignItems:"center",children:[k&&w.jsx(pt,{size:16,style:{marginRight:8}}),s("common.retry")]})})}})};fe()},Xt=le=>fe=>{var k,A;(((k=fe==null?void 0:fe.meta)==null?void 0:k.did)||(fe==null?void 0:fe.meta))===((A=L==null?void 0:L.meta)==null?void 0:A.did)&&le(fe)};f(Ct.BlockletEvents.statusChange,Xt(le=>{switch(le.status){case Ct.BlockletStatus.upgrading:je({installResultProps:{variant:"success",title:ke(),subTitle:s("blocklet.component.installSuccessTip")}}),Ds({componentDid:gt.componentDid});break}const fe=Mn(L);je(k=>({...k,didSpaceEndpoint:fe}))}),[(qt=L==null?void 0:L.meta)==null?void 0:qt.did]),f(Ct.BlockletEvents.downloadFailed,Xt(()=>{$t(s("blocklet.component.installComponentError"))}),[(Yt=L==null?void 0:L.meta)==null?void 0:Yt.did]),f(Ct.BlockletEvents.installFailed,Xt(()=>{$t(s("blocklet.component.installComponentError"))}),[(Zt=L==null?void 0:L.meta)==null?void 0:Zt.did]);const et=[],Le=()=>{h(!1),xe({}),ye.current={},e()},cr=le=>((L==null?void 0:L.children)||[]).find(fe=>fe.meta.did===le),ur=async le=>{var Ge,kt;const{pathPrefix:fe,bundleDid:k,title:A,componentName:N="",componentDid:U=""}=H,V=((Ge=ye.current)==null?void 0:Ge.meta)||{},{configs:te=[],registryUrl:re,inStore:be,inputUrl:pe,dist:Ze}=V,ze=(kt=ye.current)==null?void 0:kt.downloadTokenList,Oe=be?Qi(re,k,Ze):pe;h(!0);const Me={rootDid:L.meta.did,url:Oe,mountPoint:fe?Yr(fe):`/${Yr(V.title||V.name)}`,title:A,name:N,did:U,onlyRequired:!st,...H.hasEnvironmentsStep&&te.length>0?{configs:te.map(ht=>({...ht,value:H.configsValue[ht.key]||""}))}:{},...ze?{downloadTokenList:ze}:{},...le};try{if(await R.installComponent({input:Me}),re){const{teamDid:ht,storeList:Rt}=no({fromBlocklet:E,nodeInfo:j,blocklet:L}),{isNew:Or,decoded:zt}=Ol(re,Rt);Or&&await R.addBlockletStore({input:{teamDid:ht,url:zt}})}je({installResultProps:{}}),B({showError:!1,attachRuntimeInfo:!1})}catch(ht){const Rt=lo(ht);Zn.error(Rt),console.error("installComponent error: ",ht),$t(Rt)}finally{h(!1),ye.current.installInput=Me}},dr=le=>{const fe=Ql({params:{...le,did:le.bundleDid},blocklets:[L],blocklet:L,locale:n});if(fe){const k=cr(le.bundleDid),A=ec({params:{...le,did:le.bundleDid},blocklet:L});if(k&&k.mountPoint===A)return{errMsg:""}}return{errMsg:fe}},tt=async le=>{var k,A;const{errMsg:fe}=dr({...H,locale:n});S(fe),Q===et.length-2&&await ur(le),(A=(k=$e.current)==null?void 0:k.setActiveStepByIndex)==null||A.call(k,N=>N+1)},_t=()=>{var le,fe;(fe=(le=$e.current)==null?void 0:le.setActiveStepByIndex)==null||fe.call(le,k=>k-1)},hr=()=>{const{pathPrefix:le,bundleDid:fe,title:k,componentName:A="",componentDid:N=""}=H,{meta:U={}}=ye.current||{},{registryUrl:V,inStore:te,inputUrl:re,dist:be}=U,pe=te?Qi(V,fe,be):re;ee({meta:U,installOpts:{type:"component",rootDid:L.meta.did,mountPoint:le,url:pe,title:k,name:A,did:N}})},St=le=>{G(!1),je({purchaseResultProps:{variant:"error",title:ke(),subTitle:le,style:{paddingTop:120},footer:w.jsx(ct,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{je({purchaseResultProps:{}})},children:s("common.retry")})}})},vt=({downloadTokenList:le})=>{ye.current.downloadTokenList=le,G(!1),tt()},dt=({chooseParams:le=ye.current,componentDid:fe,isInit:k=!1})=>{var zt,Hr,Wt,pr;const{meta:A,registryUrl:N,inStore:U,inputUrl:V}=le,{did:te,title:re,name:be}=A,pe=(((zt=L.settings)==null?void 0:zt.children)||[]).filter(rt=>rt.status==="deleted"&&rt.meta.bundleDid===te),Ze=fe||"",ze=(Hr=A.environments)==null?void 0:Hr.map(rt=>{const{name:mr,validation:gr,...yr}=rt,vr={validation:gl(gr)?"":gr};return{...yr,key:mr,...vr}});ye.current={...le,meta:{...A,configs:ze,registryUrl:N,inStore:U,inputUrl:V}};let Oe={};if(k){const rt=[L],mr=ze||[],gr=[],yr=Qs(yl([...mr,...gr]),"key").filter(Lt=>!!Lt.key).sort((Lt,Jt)=>Lt.required&&!Jt.required?-1:Jt.required&&!Lt.required?1:0),vr=Bt.getSharedConfigObj(rt[0],{configs:yr}),br={},Pt=yr.map(Lt=>{const{default:Jt,key:xr,...Tr}=Lt;return br[xr]=vr[xr]||Jt,{...Tr,key:xr,hidden:!!Ct.BLOCKLET_CONFIGURABLE_KEY[xr]}});Oe={...Oe,configsList:Pt,configsValue:br,hasMissRequiredConfigs:Ns(Pt,br)}}const Me=L.children.some(rt=>rt.mountPoint==="/"),Ge=pe.find(rt=>rt.meta.bundleDid===te),kt=L.children.find(rt=>rt.meta.bundleDid===te);Oe.title=re||"",Ge?Oe={...Oe,pathPrefix:Ge.mountPoint||"",componentName:Ge.meta.name,hasEnvironmentsStep:!1}:kt?Oe={...Oe,pathPrefix:kt.mountPoint||"",componentName:kt.meta.name,hasEnvironmentsStep:!1}:Oe={...Oe,pathPrefix:Me?`/${Yr(re)||Yr(be)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((pr=(Wt=ye.current.meta)==null?void 0:Wt.environments)==null?void 0:pr.length)>0};const ht=Ef(ye.current.meta),Rt=jf(ye.current.meta),Or=Mn(L);je({bundleDid:te,componentDid:Ze,...Oe,hasRequiredEnvironments:kf(ye.current.meta),requirePurchase:ht,didSpaceIsRequiredSetup:Rt,didSpaceEndpoint:Or}),k&&ht&&hr()};K.useEffect(()=>{!o||Q!==0||!L||(dt({chooseParams:{blocklets:[o],meta:o,registryUrl:v||o.homepage,inStore:!0},isInit:!0}),je({showFromUrlDialog:!1}),tt())},[o,Q,L]),et.push({key:"selectComponent",name:s("blocklet.component.selectComponent"),body:w.jsxs(er,{sx:{width:400},component:"div",children:[c&&H.showFromUrlDialog&&w.jsx(ji,{mode:"component",onCancel:()=>{je({showFromUrlDialog:!1})},onSuccess:({meta:le,inputUrl:fe,inStore:k,registryUrl:A})=>{dt({chooseParams:{meta:le,inputUrl:fe,inStore:k,registryUrl:A},isInit:!0}),je({showFromUrlDialog:!1}),tt()},handleText:{title:s("blocklet.component.addComponentTip.fromUrl"),confirm:s("blocklet.component.choose")}}),w.jsx(Ii,{stores:d,extra:Xs.isInServerlessMode(j)?null:c?w.jsxs(ct,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{je({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[w.jsx(uo,{style:{fontSize:20,marginRight:4}})," ",s("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:i,onChange:()=>{xe({}),ye.current={}},storageKey:x,children:({currentRegistry:le})=>w.jsx(Ui,{showResourcesSwitch:y,showCategory:a,serverVersion:j==null?void 0:j.version,style:Qe?{height:"calc(100vh - 56px - 80px - 32px - 10px )"}:{height:"calc(100% - 10px)"},storeUrl:le.url,resourceType:m,resourceDid:_,handleButtonClick:fe=>{dt({chooseParams:{...fe,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:fe,defaultRender:k})=>{const A=(H==null?void 0:H.bundleDid)&&(H==null?void 0:H.bundleDid)===(fe==null?void 0:fe.did);return w.jsxs(Tf,{children:[A&&w.jsx("div",{className:"check-container",children:w.jsx(ro,{className:"check-icon"})}),w.jsx("div",{className:A?"choose-blocklet":"",style:{marginLeft:16},children:k})]})}})})]}),cancel:r==="embed"?void 0:s("common.cancel"),confirm:Rf({params:H,blocklet:L,t:s}),onCancel:Le,onConfirm:()=>{tt()}}),et.push({key:"agreement",name:s("launchBlocklet.introduction"),body:w.jsxs(er,{component:"div",className:"agreement-wrapper",children:[w.jsx(io,{title:s("launchBlocklet.introduction"),subTitle:s("blocklet.component.addComponentTip.introduction")}),w.jsx(li,{meta:Ke,onClickNext:tt,installRelated:st,onChangeInstallRelated:Ht,handleDescEle:w.jsx("p",{children:s("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:o?void 0:s("common.pre"),confirm:s("launchBlocklet.next"),onCancel:o?Le:_t,onConfirm:()=>{G(!1),tt()}}),Ke&&H.requirePurchase&&et.push({key:"purchase",name:w.jsxs(w.Fragment,{children:[s("common.verifyNFT"),w.jsx(wn,{})]}),body:w.jsxs(er,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((fr=(At=Ae.current)==null?void 0:At.getCurrentStep)==null?void 0:fr.call(At))===2||ne)&&w.jsx(en,{title:s("common.verifyNFT"),subTitle:s("blocklet.component.addComponentTip.verifyNFT")}),Mr(H.purchaseResultProps)?z&&w.jsx(Ud,{ref:Ae,meta:z.meta,mode:H.componentDid?"verify":"both",onCancel:St,installOpts:z.installOpts,handlePaySuccess:vt}):w.jsx("div",{className:"flex-align-center flex-justify-center",children:w.jsx(es,{...H.purchaseResultProps})})]}),disabled:((jt=(q=Ae.current)==null?void 0:q.getCurrentStep)==null?void 0:jt.call(q))===2||ne,cancel:s("common.pre"),confirm:s("common.next"),onConfirm:()=>{typeof Ae.current.onNext=="function"&&(Ae.current.onNext(),G(!0))},onCancel:()=>{_t()}}),Bt.hasStartEngine(Ke)&&et.push({key:"config",name:s("common.config"),error:p,body:w.jsxs(er,{component:"div",children:[w.jsx(en,{title:s("common.config"),subTitle:s("blocklet.component.addComponentTip.config")}),w.jsx(an,{label:s("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:b||s("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:H.pathPrefix,onChange:le=>{const fe=le.target.value;je({pathPrefix:fe}),O(s("common.slugifyHint",{value:Rl(fe)}))}}),!!p&&w.jsx(zs,{severity:"error",style:{width:"100%",marginTop:8},children:p})]}),cancel:s("common.pre"),confirm:s("common.next"),onCancel:_t,onConfirm:()=>{tt()}}),Ke&&(H!=null&&H.hasEnvironmentsStep)&&et.push({key:"environment",name:w.jsxs(w.Fragment,{children:[s("common.environment")," ",H.hasRequiredEnvironments&&w.jsx(wn,{})]}),disabled:!!l||(H==null?void 0:H.hasMissRequiredConfigs),body:()=>w.jsxs(er,{component:"div",style:{overflowY:"auto"},children:[w.jsx(en,{title:s("common.environment"),subTitle:s("blocklet.component.addComponentTip.environment")}),w.jsx(Il,{style:{marginTop:-12,width:"100%"},schema:H.configsList,defaultValue:H.configsValue,onChange:(le,{action:fe,currentItem:k,allValues:A})=>{fe==="confirm"&&je({hasMissRequiredConfigs:Ns(H.configsList,A),configsValue:A}),fe==="edit"?u(k):["cancel","confirm"].includes(fe)&&u(null)}})]}),cancel:s("common.pre"),confirm:s("common.next"),onCancel:_t,onConfirm:tt}),Ke&&(H!=null&&H.didSpaceIsRequiredSetup)&&et.push({key:"didSpace",name:w.jsxs(w.Fragment,{children:[s("blocklet.component.didSpaceConfig")," ",H.didSpaceIsRequiredSetup==="required"&&w.jsx(wn,{})]}),disabled:(H==null?void 0:H.didSpaceIsRequiredSetup)&&!H.didSpaceEndpoint,body:()=>w.jsx(Cl,{children:w.jsxs(er,{component:"div",children:[w.jsx(en,{title:s("blocklet.component.didSpaceConfig"),subTitle:s("blocklet.component.didSpaceConfigTip")}),w.jsx(ue,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:w.jsx(Ci,{blockletMeta:ye.current.meta,onNext:()=>{tt()},onEndpointUpdate:yt})})]})}),cancel:s("common.pre"),confirm:s("common.next"),onCancel:_t,onConfirm:tt}),et.push({key:"install",name:cr(Ke==null?void 0:Ke.did)?s("common.upgrade"):s("common.install"),disabled:t?!1:Mr(H.installResultProps),loading:t?!1:Mr(H.installResultProps),body:w.jsx(er,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Mr(H.installResultProps)?w.jsx(pl,{message:w.jsx(Cf,{children:s(t?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):w.jsx("div",{style:{marginTop:120},children:w.jsx(es,{...H.installResultProps})})}),confirm:s("common.complete"),onConfirm:()=>{Ds({timeout:0,componentDid:gt.componentDid,manual:!0}),Le(),setTimeout(()=>{const le=document.getElementsByClassName("dashboard-main")[0];le&&(le.scrollTop=le.scrollHeight)},200)}});const Pe=et[Q]||{},Et=()=>i||Pe.error||!H.bundleDid?!0:Q>1?!H.pathPrefix:!1;return L?w.jsxs(Of,{sx:{width:"100%",height:Qe?window.innerHeight:g?"72vh":"100vh"},children:[w.jsx(ml,{steps:et,mode:"memory",children:w.jsx(Sf,{ref:$e,meta:Ke,isMobile:Qe,onStepChange:le=>{ve(le)}})}),w.jsxs(ue,{className:"action-bar",children:[Pe.cancel&&w.jsx(ct,{onClick:le=>{le.stopPropagation(),Pe.onCancel()},disabled:Q===et.length-2&&i,color:"inherit",children:Pe.cancel||s("common.cancel")}),Pe.confirm&&w.jsx(ct,{onClick:le=>{le.stopPropagation(),Pe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:i||(typeof Pe.disabled=="boolean"?Pe.disabled:Et()),variant:"contained",autoFocus:!0,title:Pe.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:w.jsxs(ue,{display:"flex",alignItems:"center",children:[(typeof Pe.loading=="boolean"?Pe.loading:i)&&w.jsx(pt,{style:{marginRight:8},size:16}),Pe.confirm]})})]})]}):null}Ea.propTypes={onClose:W.func,mode:W.oneOf(["normal","embed"]),inDialog:W.bool,stores:W.arrayOf(W.string),storeUrl:W.string,resourceType:W.string,resourceDid:W.string,storageKey:W.string,selectedMeta:W.object,showResourcesSwitch:W.bool,showFromUrl:W.bool,enableRunBackground:W.bool,showCategory:W.bool};Ea.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Of=Ye(ue)`
648
- .action-bar {
649
- display: flex;
650
- justify-content: flex-end;
651
- position: sticky;
652
- bottom: 0;
653
- padding-top: 16px;
654
- z-index: 100;
655
- width: 100%;
656
- background: #fff;
657
- border-top: 1px solid #eee;
658
- }
659
- `,er=Ye(Ee)`
660
- width: 100%;
661
- height: 100%;
662
- `,en=Ye(io)`
663
- margin-bottom: 24px;
664
- `,Tf=Ye.div`
665
- position: relative;
666
-
667
- .choose-blocklet {
668
- background-color: rgb(236, 251, 253);
669
- border-color: rgb(236, 251, 253);
670
- border-radius: 8px;
671
- }
672
-
673
- .check-container {
674
- position: absolute;
675
- right: 0;
676
- bottom: 0;
677
- display: flex;
678
- justify-content: flex-end;
679
- align-items: flex-end;
680
- width: 30px;
681
- height: 30px;
682
- border-radius: 0 0 8px 0;
683
- color: ${e=>e.theme.palette.common.white};
684
- overflow: hidden;
685
- transition: all ease 0.3s;
686
- &:after {
687
- position: absolute;
688
- z-index: 0;
689
- display: block;
690
- width: 0;
691
- height: 0;
692
- border-top: transparent solid 15px;
693
- border-left: transparent solid 15px;
694
- border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
695
- border-right: ${e=>e.theme.palette.primary.main} solid 15px;
696
- transition: all ease 0.1s;
697
- content: '';
698
- }
699
-
700
- .check-icon {
701
- position: relative;
702
- z-index: 2;
703
- margin: 0 1px 1px 0;
704
- font-size: 16px;
705
- transition: all ease 0.2s;
706
- }
707
- }
708
- `,Cf=Ye.div`
709
- color: ${e=>e.theme.palette.primary.main};
710
- .msg-before {
711
- display: inline-block;
712
- color: #aaa;
713
- font-size: 14px;
714
- margin-right: 6px;
715
- }
716
- `;export{Ea as A,ta as B,ap as S,sp as a,op as b,uo as d,vo as f};