@harperfast/harper 5.2.6 → 5.2.7

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 (291) hide show
  1. package/dist/resources/PrimaryRocksDatabase.js +2 -3
  2. package/dist/resources/PrimaryRocksDatabase.js.map +1 -1
  3. package/dist/resources/RecordEncoder.d.ts +16 -0
  4. package/dist/resources/RecordEncoder.js +93 -3
  5. package/dist/resources/RecordEncoder.js.map +1 -1
  6. package/dist/resources/Table.js +53 -0
  7. package/dist/resources/Table.js.map +1 -1
  8. package/dist/resources/graphql.js +1 -1
  9. package/dist/resources/graphql.js.map +1 -1
  10. package/dist/resources/tracked.js +5 -0
  11. package/dist/resources/tracked.js.map +1 -1
  12. package/npm-shrinkwrap.json +6 -6
  13. package/package.json +2 -2
  14. package/resources/DESIGN.md +5 -0
  15. package/resources/PrimaryRocksDatabase.ts +3 -3
  16. package/resources/RecordEncoder.ts +85 -3
  17. package/resources/Table.ts +60 -1
  18. package/resources/graphql.ts +1 -1
  19. package/resources/tracked.ts +4 -0
  20. package/studio/web/assets/{Chat-BNHY84-Z.js → Chat-etJeJv4a.js} +71 -95
  21. package/studio/web/assets/FloatingChat-BvmHsuVo.js +23 -0
  22. package/studio/web/assets/abnfDiagram-VCTEODGH-C0_BAZyO.js +1 -0
  23. package/studio/web/assets/{alertDialog-BaBrZQ4M.js → alertDialog-DIHt7Z0r.js} +1 -1
  24. package/studio/web/assets/apiToken-Bl5LC8EH.js +1 -0
  25. package/studio/web/assets/applications-Dta6Y0Rg.js +296 -0
  26. package/studio/web/assets/arc-CVRByUzA.js +1 -0
  27. package/studio/web/assets/architecture-7GRP2DOG-DNdx5tEU.js +1 -0
  28. package/studio/web/assets/architectureDiagram-5GKGNRK7-BWzrASgm.js +36 -0
  29. package/studio/web/assets/authStore-qKmCZcaf.js +3 -0
  30. package/studio/web/assets/blockDiagram-NRAW4CY4-BdJX9Khj.js +129 -0
  31. package/studio/web/assets/{button-DfBmT4rc.js → button-DhiX-njv.js} +1 -1
  32. package/studio/web/assets/c4Diagram-UCG6FXSJ-CI6MzGmQ.js +38 -0
  33. package/studio/web/assets/channel-DtCV8PTL.js +1 -0
  34. package/studio/web/assets/chevron-up-Df2c8uoU.js +1 -0
  35. package/studio/web/assets/chunk-75Z2AOVW-BT8tVmks.js +2 -0
  36. package/studio/web/assets/chunk-DU6HZSFF-9kAOOmI6.js +127 -0
  37. package/studio/web/assets/{chunk-2GRJ4B5K-DtwG__pv.js → chunk-F27PBJKO-BW7ao8AY.js} +1 -1
  38. package/studio/web/assets/{chunk-KEIR6QF5-BICK3FdT.js → chunk-FOHPRMQF-DHwB1DNv.js} +2 -2
  39. package/studio/web/assets/{chunk-5RXB4S5H-D3c7okHC.js → chunk-G27WJ6UU-COyLMcgK.js} +2 -2
  40. package/studio/web/assets/chunk-GMAD6QVW-BNyXpoQO.js +72 -0
  41. package/studio/web/assets/chunk-JQ64N6SF-Cyz1IeLf.js +1 -0
  42. package/studio/web/assets/{chunk-GF5L2VYU-DreJ7Snz.js → chunk-LCL6LL3I-HOzK_ppE.js} +3 -3
  43. package/studio/web/assets/chunk-OBVCFTLP-D4wWOqDQ.js +1 -0
  44. package/studio/web/assets/chunk-P2QGCYS3-DmIFY4d7.js +1 -0
  45. package/studio/web/assets/{chunk-KBJHAD2P-CLDPbAA-.js → chunk-POPQ4Y6H-BPrvMyKz.js} +1 -1
  46. package/studio/web/assets/{chunk-4I5QYGJK-D1FhvtQq.js → chunk-PWAF6VOD-2zB6IW9i.js} +1 -1
  47. package/studio/web/assets/chunk-R7TYR2AO-Irip67yr.js +10 -0
  48. package/studio/web/assets/chunk-RHFEMEQ7-2FgyI8YU.js +168 -0
  49. package/studio/web/assets/{chunk-6Q2QTUOP-QviMM6bR.js → chunk-SVP7TREG-FwtbH2QC.js} +1 -1
  50. package/studio/web/assets/chunk-TEH6E4GO-P87k5mNi.js +62 -0
  51. package/studio/web/assets/{chunk-XXDRQBXY-CaP_jixK.js → chunk-XXDRQBXY-BoGZu3HH.js} +1 -1
  52. package/studio/web/assets/classDiagram-DTDB5LWJ-DbO_dCNE.js +1 -0
  53. package/studio/web/assets/classDiagram-v2-JRS7N3AN-DbO_dCNE.js +1 -0
  54. package/studio/web/assets/{cose-bilkent-JH36ORCC-BVTNhTKD.js → cose-bilkent-JH36ORCC-Cuuf67Bh.js} +1 -1
  55. package/studio/web/assets/{createLucideIcon-BMkDbMrz.js → createLucideIcon-BKGPfjm2.js} +1 -1
  56. package/studio/web/assets/cssMode-IAbO_2KK.js +1 -0
  57. package/studio/web/assets/cynefin-OW5HDTMX-BRkpLFQV.js +1 -0
  58. package/studio/web/assets/cynefinDiagram-5FMLGOSQ-CHT1DaX6.js +62 -0
  59. package/studio/web/assets/cytoscape.esm-C2x7inlt.js +321 -0
  60. package/studio/web/assets/dagre-3AP2YEHR-DpUXBh63.js +4 -0
  61. package/studio/web/assets/dagre-PrKaheQc.js +1 -0
  62. package/studio/web/assets/diagram-S7CK7UJ4-BuymVFZT.js +30 -0
  63. package/studio/web/assets/diagram-UQ7AKVKN-CyP148RM.js +41 -0
  64. package/studio/web/assets/diagram-VSXAHHWV-CoCAg3M9.js +3 -0
  65. package/studio/web/assets/diagram-VX7I27RA-BpOqCFca.js +24 -0
  66. package/studio/web/assets/diagram-Z3DM3KII-Bfpw7Vbj.js +24 -0
  67. package/studio/web/assets/dialog-CBf0Mr1d.js +1 -0
  68. package/studio/web/assets/{dist-CeoU7cfW.js → dist-kYfyPZP9.js} +1 -1
  69. package/studio/web/assets/{dist-cY0BPcz0.js → dist-lkA3O3eM.js} +1 -1
  70. package/studio/web/assets/download-BtTOBem-.js +1 -0
  71. package/studio/web/assets/ebnfDiagram-PWID7BFC-DS_6aWqL.js +1 -0
  72. package/studio/web/assets/editor-CeRXEhRl.js +1 -0
  73. package/studio/web/assets/erDiagram-SSCWMZ5O-DJNk6Fgw.js +99 -0
  74. package/studio/web/assets/eventmodeling-NTZA5JFV-5jbe4A5P.js +1 -0
  75. package/studio/web/assets/flowDiagram-A5DVABFB-Dp9Ezlow.js +1 -0
  76. package/studio/web/assets/{ganttDiagram-PKOTCBZU-Cit41Zp3.js → ganttDiagram-EL5Y4UJY-2pOExxMY.js} +2 -2
  77. package/studio/web/assets/{getAnalytics-rTxZLIM5.js → getAnalytics-D4LKGeVy.js} +1 -1
  78. package/studio/web/assets/gitGraph-4MIJSDKK-CH5ZxwzF.js +1 -0
  79. package/studio/web/assets/gitGraphDiagram-WWUBYQGX-DVIsIhbO.js +106 -0
  80. package/studio/web/assets/html-DOV4s_YT.js +1 -0
  81. package/studio/web/assets/htmlMode-CdqjnAh4.js +1 -0
  82. package/studio/web/assets/index-CTqasm6g.js +824 -0
  83. package/studio/web/assets/index-Cxj2_wsl.css +1 -0
  84. package/studio/web/assets/index.lazy-VmcKgiEy.js +2 -0
  85. package/studio/web/assets/info-A6RAGUB7-CPQfTnaG.js +1 -0
  86. package/studio/web/assets/infoDiagram-RXCK75RN-DlwLYlwm.js +2 -0
  87. package/studio/web/assets/{ishikawaDiagram-WSZJBQD7-BJYRB-hU.js → ishikawaDiagram-5VMMS53U-BRXRp29U.js} +2 -2
  88. package/studio/web/assets/{javascript-CGzSV8Sd.js → javascript-Dj7yXfx5.js} +1 -1
  89. package/studio/web/assets/{journeyDiagram-NVQOT4AX-B8K4wuMz.js → journeyDiagram-EYS64GPL-B0ou8k0n.js} +1 -1
  90. package/studio/web/assets/jsonMode-khk65qzx.js +1 -0
  91. package/studio/web/assets/{kanban-definition-27J2QSJJ-DKFV1ovM.js → kanban-definition-3QL26DDD-uYg7iYzp.js} +11 -11
  92. package/studio/web/assets/languageServices-D_06p7dw.js +1 -0
  93. package/studio/web/assets/linear-Cnt8506Q.js +1 -0
  94. package/studio/web/assets/lspLanguageFeatures-DTA6wyQw.js +4 -0
  95. package/studio/web/assets/mermaid-parser.core-Ck-fC8b7.js +7 -0
  96. package/studio/web/assets/mermaid.core-CP8aNNYm.js +44 -0
  97. package/studio/web/assets/{mindmap-definition-FAOFIHXS-CKL4PdAv.js → mindmap-definition-FBJOCRG2-CgTZ-rit.js} +25 -25
  98. package/studio/web/assets/notifications-Bah46LXX.js +1 -0
  99. package/studio/web/assets/notifications-CBZXgxVc.js +1 -0
  100. package/studio/web/assets/packet-AYTQ26CC-DEyoPtPb.js +1 -0
  101. package/studio/web/assets/pegDiagram-XKGWAZYB-DrD-7sD9.js +1 -0
  102. package/studio/web/assets/pie-WAS4IAKB-wjj-EI1d.js +1 -0
  103. package/studio/web/assets/pieDiagram-E7YTZNPT-GntqDCzv.js +39 -0
  104. package/studio/web/assets/profile-QspOun_j.js +1 -0
  105. package/studio/web/assets/{quadrantDiagram-CIZ2JOQS-CSbsuWtH.js → quadrantDiagram-AXDQQJYC-0UeqXQGd.js} +1 -1
  106. package/studio/web/assets/radar-RG4KPBEZ-DFSA5h7k.js +1 -0
  107. package/studio/web/assets/railroad-74A4TZTK-CaOUG9wR.js +1 -0
  108. package/studio/web/assets/railroad-abnf-HS5TGJTU-Bc0Qi0WH.js +1 -0
  109. package/studio/web/assets/railroad-ebnf-LZEXJU2U-G8rVVZ2C.js +1 -0
  110. package/studio/web/assets/railroad-peg-WCYAUIDC-CrehKBhC.js +1 -0
  111. package/studio/web/assets/railroadDiagram-O6MQD6OU-yHUELZaV.js +1 -0
  112. package/studio/web/assets/regions-QdUi7bQ9.js +1 -0
  113. package/studio/web/assets/{editor.api-eUd8PqEu.js → register-Buvoxmb8.js} +139 -138
  114. package/studio/web/assets/{requirementDiagram-LRYGKXZP-ZIF0Wlho.js → requirementDiagram-EFPCY7ZU-DNEGFjuW.js} +2 -2
  115. package/studio/web/assets/rolldown-runtime-hePW80VL.js +1 -0
  116. package/studio/web/assets/safeParse-DeaoCCWH.js +1 -0
  117. package/studio/web/assets/{sankeyDiagram-W5VNT64P-BcRESt9x.js → sankeyDiagram-P5KCCOFB-DpyAmSVR.js} +1 -1
  118. package/studio/web/assets/{sequenceDiagram-SI44F4Z6-OpgTeJNU.js → sequenceDiagram-WJ2MYXX4-TyaT7xNk.js} +1 -1
  119. package/studio/web/assets/setComponentFile-BI4E_iDe.js +1 -0
  120. package/studio/web/assets/setLocalStorage-D_kflv4U.js +1 -0
  121. package/studio/web/assets/setSessionStorage-B0bf71m4.js +1 -0
  122. package/studio/web/assets/setup-Cop6LBQN.js +2 -0
  123. package/studio/web/assets/src-CMc7m_Ut.js +1 -0
  124. package/studio/web/assets/stateDiagram-HBIQ2CUA-CeEdTArZ.js +1 -0
  125. package/studio/web/assets/stateDiagram-v2-4QOOHH4V-D4tuw9Su.js +1 -0
  126. package/studio/web/assets/status-DRu3zRgl.js +61 -0
  127. package/studio/web/assets/step-vX8bovaY.js +1 -0
  128. package/studio/web/assets/swimlanes-XN3QIQJK-B54FmF46.js +1 -0
  129. package/studio/web/assets/swimlanesDiagram-VK2B7HYN-XOhmNEvq.js +8 -0
  130. package/studio/web/assets/tabs-B_G5zscN.js +1 -0
  131. package/studio/web/assets/{time-D55sDum-.js → time-Cclkb7kQ.js} +1 -1
  132. package/studio/web/assets/{timeline-definition-Z64GVDOM-Dy5A_tK2.js → timeline-definition-24CTP7MA-D-a9ujbo.js} +5 -5
  133. package/studio/web/assets/toggleHighContrast-C0dJLmZ0.js +49 -0
  134. package/studio/web/assets/treeView-Q6P3EWNA-CrW_6JnS.js +1 -0
  135. package/studio/web/assets/treemap-WGGIJYW6-BxyYLdP_.js +1 -0
  136. package/studio/web/assets/tsMode-dbDiapTA.js +11 -0
  137. package/studio/web/assets/typescript-CT1826cL.js +1 -0
  138. package/studio/web/assets/useEntityRestURL-D1u1X_gE.js +1 -0
  139. package/studio/web/assets/useLocalStorage-Dtj1QS8_.js +1 -0
  140. package/studio/web/assets/{vendor-core-CddkYGh5.js → vendor-core-RCcadM3e.js} +1 -1
  141. package/studio/web/assets/vendor-datadog-BRv-mOv1.js +6 -0
  142. package/studio/web/assets/{vendor-react-BhazFIp8.js → vendor-react-Dyj4O3HE.js} +1 -1
  143. package/studio/web/assets/vendor-tanstack-BiFWSB3W.js +1 -0
  144. package/studio/web/assets/{vendor-ui-BLIveqaL.js → vendor-ui-vhu-UHhF.js} +11 -11
  145. package/studio/web/assets/{vennDiagram-T6HMQDX7-DRvMIiSo.js → vennDiagram-4TSXK5OY-Cy7s7Mpy.js} +3 -3
  146. package/studio/web/assets/wardley-WFR3VGLG-BeBL35g2.js +1 -0
  147. package/studio/web/assets/{wardleyDiagram-T6FBY63Y-B04FSA0i.js → wardleyDiagram-VM6X3IG4-BylmIGSg.js} +3 -3
  148. package/studio/web/assets/workers-FpR9_D2K.js +3 -0
  149. package/studio/web/assets/x-B9o9hsep.js +1 -0
  150. package/studio/web/assets/xml-ZjKUMjth.js +1 -0
  151. package/studio/web/assets/{xychartDiagram-ELKLHX3M-BE0X7RA7.js → xychartDiagram-S5SC5T6Z-CoKALMXr.js} +3 -3
  152. package/studio/web/assets/yaml-B6gXbZU6.js +1 -0
  153. package/studio/web/assets/{yaml.worker-Iyy2Pf1T.js → yaml.worker-BDL8_iuk.js} +153 -153
  154. package/studio/web/harper-studio_black.png +0 -0
  155. package/studio/web/index.html +18 -24
  156. package/studio/web/assets/FloatingChat-BbztUci0.js +0 -23
  157. package/studio/web/assets/abnfDiagram-N423BO3Z-BRuH0ywn.js +0 -1
  158. package/studio/web/assets/apiToken-D0x_S8Wq.js +0 -1
  159. package/studio/web/assets/applications-BU83fSEG.js +0 -296
  160. package/studio/web/assets/arc-3Xw6uabx.js +0 -1
  161. package/studio/web/assets/architecture-TIHT7OUA-CsHfPErM.js +0 -1
  162. package/studio/web/assets/architectureDiagram-T3A2C74G-DrwbS7Gp.js +0 -36
  163. package/studio/web/assets/array-BifhSqXX.js +0 -1
  164. package/studio/web/assets/authStore-B3IhXrn6.js +0 -3
  165. package/studio/web/assets/blockDiagram-VBNYF7ZC-DKN1mht5.js +0 -132
  166. package/studio/web/assets/c4Diagram-5PPSVZJV-CT9bmjm_.js +0 -10
  167. package/studio/web/assets/card-ByrPS_wa.js +0 -1
  168. package/studio/web/assets/channel-mnKBfsP-.js +0 -1
  169. package/studio/web/assets/chevron-right-CY-tr2sG.js +0 -1
  170. package/studio/web/assets/chunk-3NCLNEKW-BVj72ixc.js +0 -1
  171. package/studio/web/assets/chunk-5FCAYU7R-Dh5nylU8.js +0 -1
  172. package/studio/web/assets/chunk-5HE753X5-Bw-yg4kO.js +0 -1
  173. package/studio/web/assets/chunk-5JV3BV7I-Cy5pj3QY.js +0 -1
  174. package/studio/web/assets/chunk-5TONJI2A-DQOY3q1H.js +0 -2
  175. package/studio/web/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
  176. package/studio/web/assets/chunk-7Z6QIM7H-BJhESwQK.js +0 -10
  177. package/studio/web/assets/chunk-BIQX33UG-DZEsGuSn.js +0 -1
  178. package/studio/web/assets/chunk-CQNSW5MT-B8S09OIh.js +0 -1
  179. package/studio/web/assets/chunk-CYSBUYHQ-C1Rf4art.js +0 -1
  180. package/studio/web/assets/chunk-EMLP6XTP-RLD4nXpI.js +0 -1
  181. package/studio/web/assets/chunk-I66GZJ75-DHPYnKNr.js +0 -125
  182. package/studio/web/assets/chunk-J7OUQ5F2-DcY_kb6i.js +0 -2
  183. package/studio/web/assets/chunk-JG7HCLWE-BYfiSaVt.js +0 -2
  184. package/studio/web/assets/chunk-JQJVKLGR-DtEmbHZj.js +0 -156
  185. package/studio/web/assets/chunk-MOZMSUNE-XVucA-n6.js +0 -1
  186. package/studio/web/assets/chunk-NSK5VX7P-DDFNzCU_.js +0 -2
  187. package/studio/web/assets/chunk-OSBZ3O6U-CrKZOUOr.js +0 -1
  188. package/studio/web/assets/chunk-QBLGF6JB-CxAyS2mW.js +0 -1
  189. package/studio/web/assets/chunk-QR6OTTB3-Df7OCENk.js +0 -62
  190. package/studio/web/assets/chunk-R7FJI6CG-Cnn3gE-Y.js +0 -1
  191. package/studio/web/assets/chunk-RYQCIY6F-N0MDKk5G.js +0 -1
  192. package/studio/web/assets/chunk-U6XO7XAA-BFxjP5U3.js +0 -2
  193. package/studio/web/assets/chunk-UBXNYLIW-rn0yw1mp.js +0 -1
  194. package/studio/web/assets/chunk-W5SLKNZC-DKMlAWZk.js +0 -1
  195. package/studio/web/assets/chunk-WRU74C26-Dg10j8Pf.js +0 -70
  196. package/studio/web/assets/chunk-YOTPTUD7-D0vRKqYp.js +0 -1
  197. package/studio/web/assets/chunk-ZIRB5QZD-O39ZBUk3.js +0 -32
  198. package/studio/web/assets/classDiagram-JCYQIIEL-BrXNP4fl.js +0 -1
  199. package/studio/web/assets/classDiagram-v2-OCEON4UE-BrXNP4fl.js +0 -1
  200. package/studio/web/assets/cssMode-DipmMR_-.js +0 -1
  201. package/studio/web/assets/cynefin-VYW2F7L2-Ds2Fw2Y0.js +0 -1
  202. package/studio/web/assets/cynefinDiagram-MW4NZA55-DcTzrsC5.js +0 -62
  203. package/studio/web/assets/cytoscape.esm-B-NFISlW.js +0 -321
  204. package/studio/web/assets/dagre-Buvkdvvj.js +0 -1
  205. package/studio/web/assets/dagre-VZM6K2ZE-CMyJ9QPU.js +0 -4
  206. package/studio/web/assets/diagram-7IWD3JNH-jEGuzdp3.js +0 -30
  207. package/studio/web/assets/diagram-B4RE2ZJO-Ba7wC7iw.js +0 -3
  208. package/studio/web/assets/diagram-LBJQPF4R-Bm7Wj_dF.js +0 -24
  209. package/studio/web/assets/diagram-Q27KOJAE-C-gdktLC.js +0 -24
  210. package/studio/web/assets/diagram-UB23O5K3-COBVIEEk.js +0 -41
  211. package/studio/web/assets/ebnfDiagram-BXEA7PRR-G-t56mVV.js +0 -1
  212. package/studio/web/assets/editor-BDfNodZS.js +0 -1
  213. package/studio/web/assets/erDiagram-JOGREHBK-DpHzpqx1.js +0 -85
  214. package/studio/web/assets/eventmodeling-45OFAUF4-CLEiVx5s.js +0 -1
  215. package/studio/web/assets/flowDiagram-UKHOOZJN-CIxxUUxn.js +0 -1
  216. package/studio/web/assets/getRegistrationInfo--NLLrics.js +0 -1
  217. package/studio/web/assets/gitGraph-TEB2WS4Q-CZFBqwW-.js +0 -1
  218. package/studio/web/assets/gitGraphDiagram-DS77QQ5N-DuGnRv2R.js +0 -106
  219. package/studio/web/assets/html-DmSSmgE8.js +0 -1
  220. package/studio/web/assets/htmlMode-B2LqJw1z.js +0 -1
  221. package/studio/web/assets/index-BO3NaEw8.css +0 -1
  222. package/studio/web/assets/index-BQB9R8Ug.js +0 -810
  223. package/studio/web/assets/index-BnYZFLIB.css +0 -1
  224. package/studio/web/assets/index.lazy-CtErm5q7.js +0 -13
  225. package/studio/web/assets/info-DKCQHKI2--1InqQeT.js +0 -1
  226. package/studio/web/assets/infoDiagram-6WML65LV-DliK38kp.js +0 -2
  227. package/studio/web/assets/isArrayLikeObject-BHDnhloL.js +0 -1
  228. package/studio/web/assets/jsonMode-BVS6P5Xk.js +0 -1
  229. package/studio/web/assets/languageServices-Bl-BvoAb.js +0 -1
  230. package/studio/web/assets/line-Bom3IjHi.js +0 -1
  231. package/studio/web/assets/linear-DwB_ruUT.js +0 -1
  232. package/studio/web/assets/lspLanguageFeatures-C7XtZA_w.js +0 -4
  233. package/studio/web/assets/map-BaFkSB1l.js +0 -1
  234. package/studio/web/assets/math-Bi_r_ZWc.js +0 -1
  235. package/studio/web/assets/mermaid-parser.core-Dd4RYr9Q.js +0 -4
  236. package/studio/web/assets/mermaid.core-Bbo24DGo.js +0 -11
  237. package/studio/web/assets/notifications-B8rDagJM.js +0 -1
  238. package/studio/web/assets/notifications-CPwYKDDH.js +0 -1
  239. package/studio/web/assets/packet-7NZHBO7P-BGMXB0XL.js +0 -1
  240. package/studio/web/assets/path-fybaL0A-.js +0 -1
  241. package/studio/web/assets/pegDiagram-VL7TDLO6-CWEktcBB.js +0 -1
  242. package/studio/web/assets/pie-RZYD4A2V-DgYg3tCt.js +0 -1
  243. package/studio/web/assets/pieDiagram-7S7Q4E2Y-DEAmZOqY.js +0 -39
  244. package/studio/web/assets/pollUnlessForbidden-DIDXGBc5.js +0 -1
  245. package/studio/web/assets/profile-D0hB1xdm.js +0 -1
  246. package/studio/web/assets/purify.es-DrVcFY1Q.js +0 -3
  247. package/studio/web/assets/queryClient-BLhQvmWC.js +0 -1
  248. package/studio/web/assets/radar-I7S5WNFK-Ag-zp_Rq.js +0 -1
  249. package/studio/web/assets/railroad-3IZDKUUU-aibJDIDV.js +0 -1
  250. package/studio/web/assets/railroad-abnf-AHOZXSZD-BBMEuvIl.js +0 -1
  251. package/studio/web/assets/railroad-ebnf-EBAXGLYW-Be1nseej.js +0 -1
  252. package/studio/web/assets/railroad-peg-LSFZ7HO6-DIvD-Eyb.js +0 -1
  253. package/studio/web/assets/railroadDiagram-AXF67PYL-BJWrgR10.js +0 -1
  254. package/studio/web/assets/react-VeAY02s6.js +0 -1
  255. package/studio/web/assets/react-redux-Ds7wf7Ax.js +0 -5
  256. package/studio/web/assets/regions-y_jxsBpN.js +0 -1
  257. package/studio/web/assets/register-3F1Tje_F.js +0 -2
  258. package/studio/web/assets/register-S_PdXsoi.js +0 -2
  259. package/studio/web/assets/rolldown-runtime-B0Z9INg1.js +0 -1
  260. package/studio/web/assets/select-CKgJgpkn.js +0 -1
  261. package/studio/web/assets/setComponentFile-DSHbURTI.js +0 -1
  262. package/studio/web/assets/setLocalStorage-CD_L8p_D.js +0 -1
  263. package/studio/web/assets/setup-J5SrM1Kp.js +0 -2
  264. package/studio/web/assets/src-DUvBCJIr.js +0 -1
  265. package/studio/web/assets/stateDiagram-OKZ733FA-D9oPLTjO.js +0 -1
  266. package/studio/web/assets/stateDiagram-v2-UEYNNEHI-CSD1wbuZ.js +0 -1
  267. package/studio/web/assets/status-IoJkDzlx.js +0 -61
  268. package/studio/web/assets/string-f6JzSHaO.js +0 -1
  269. package/studio/web/assets/swagger-ui-react-BlgSS25O.js +0 -240
  270. package/studio/web/assets/swimlanes-SLNWSIFB-BpeoNE9k.js +0 -2
  271. package/studio/web/assets/swimlanesDiagram-ULZ7WXOC-DHxwzxpp.js +0 -8
  272. package/studio/web/assets/table-BvFflPWi.js +0 -1
  273. package/studio/web/assets/tabs-Dd_ElZ36.js +0 -1
  274. package/studio/web/assets/textarea-a3RnTY31.js +0 -9
  275. package/studio/web/assets/toggleHighContrast-CyNC3SCQ.js +0 -49
  276. package/studio/web/assets/tokenization-CWuvR2gh.js +0 -7
  277. package/studio/web/assets/treeView-QDETBFTQ-uHZ-3Fz8.js +0 -1
  278. package/studio/web/assets/treemap-6X3UGDF4-BnUKyy3l.js +0 -1
  279. package/studio/web/assets/tsMode-CslzhcVk.js +0 -11
  280. package/studio/web/assets/typescript-Dtnury3t.js +0 -1
  281. package/studio/web/assets/useAuth-DiJUZS1C.js +0 -1
  282. package/studio/web/assets/useEntityRestURL-qfahJnvr.js +0 -1
  283. package/studio/web/assets/useLocalStorage-DetQlhBe.js +0 -1
  284. package/studio/web/assets/vendor-datadog-XDrpA25D.js +0 -6
  285. package/studio/web/assets/vendor-tanstack-FsM5XZNE.js +0 -1
  286. package/studio/web/assets/wardley-OPB4EBWU-Da7TLC2F.js +0 -1
  287. package/studio/web/assets/workers-BtibQGyk.js +0 -3
  288. package/studio/web/assets/x-D39AGKMb.js +0 -1
  289. package/studio/web/assets/xml-D41zWqPl.js +0 -1
  290. package/studio/web/assets/yaml-BFQ3mF1U.js +0 -1
  291. /package/studio/web/assets/{editor-jjEx9u7D.css → register-jjEx9u7D.css} +0 -0
@@ -1,296 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-Bbo24DGo.js","assets/vendor-datadog-XDrpA25D.js","assets/rolldown-runtime-B0Z9INg1.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-DUvBCJIr.js","assets/string-f6JzSHaO.js","assets/chunk-I66GZJ75-DHPYnKNr.js","assets/purify.es-DrVcFY1Q.js","assets/isArrayLikeObject-BHDnhloL.js","assets/chunk-NSK5VX7P-DDFNzCU_.js","assets/math-Bi_r_ZWc.js","assets/dist-CeoU7cfW.js","assets/chunk-3NCLNEKW-BVj72ixc.js","assets/chunk-4I5QYGJK-D1FhvtQq.js","assets/chunk-WRU74C26-Dg10j8Pf.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-UBXNYLIW-rn0yw1mp.js","assets/chunk-W5SLKNZC-DKMlAWZk.js","assets/chunk-QR6OTTB3-Df7OCENk.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-7Z6QIM7H-BJhESwQK.js","assets/line-Bom3IjHi.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-J7OUQ5F2-DcY_kb6i.js","assets/chunk-ZIRB5QZD-O39ZBUk3.js"])))=>i.map(i=>d[i]);
2
- import{a as e,r as t,t as n}from"./rolldown-runtime-B0Z9INg1.js";import{d as r,f as i,g as a,h as o,n as s,t as c}from"./authStore-B3IhXrn6.js";import{E as l,_ as u,c as d,n as f,p,t as m,u as h,y as g}from"./vendor-core-CddkYGh5.js";import{n as _,r as v,t as y}from"./button-DfBmT4rc.js";import{D as b,E as x,H as S,I as C,O as w,T,k as E,w as D,z as O}from"./vendor-tanstack-FsM5XZNE.js";import{a as k,i as ee}from"./vendor-datadog-XDrpA25D.js";import{r as te}from"./vendor-react-BhazFIp8.js";import{r as A}from"./useAuth-DiJUZS1C.js";import{$ as j,Rt as M,it as N}from"./vendor-ui-BLIveqaL.js";import{a as P,i as ne,n as F,r as re,t as ie}from"./card-ByrPS_wa.js";import{t as I}from"./createLucideIcon-BMkDbMrz.js";import{c as L,d as ae,f as oe,i as se,l as ce,n as le,o as ue,p as de,s as fe,t as pe,u as me}from"./select-CKgJgpkn.js";import{a as he,n as ge}from"./getRegistrationInfo--NLLrics.js";import{c as _e}from"./table-BvFflPWi.js";import{i as ve,r as ye,t as be}from"./x-D39AGKMb.js";import{t as xe}from"./chevron-right-CY-tr2sG.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./tabs-Dd_ElZ36.js";import{c as De,d as Oe,f as ke,g as Ae,h as je,i as Me,l as Ne,m as Pe,n as Fe,o as Ie,r as Le,t as Re}from"./setComponentFile-DSHbURTI.js";import{n as ze}from"./queryClient-BLhQvmWC.js";import{n as Be}from"./setLocalStorage-CD_L8p_D.js";import{t as Ve}from"./useLocalStorage-DetQlhBe.js";import{o as He,r as Ue,s as We}from"./pollUnlessForbidden-DIDXGBc5.js";import{$ as Ge,$n as Ke,$t as qe,A as Je,An as Ye,At as Xe,C as Ze,Ct as Qe,D as $e,E as et,F as tt,Fn as nt,Ft as rt,G as R,Gn as it,Gt as at,Hn as ot,Ht as st,I as ct,In as lt,Jn as ut,Jt as dt,K as ft,Kt as pt,L as mt,Ln as ht,Lt as gt,M as _t,Mn as vt,Mt as yt,N as bt,Nn as xt,Nt as St,O as Ct,On as wt,P as Tt,Pn as Et,Pt as Dt,Q as Ot,Qn as kt,Qt as At,R as jt,Rn as Mt,Rt as Nt,S as Pt,St as Ft,T as It,Tt as Lt,U as Rt,Un as zt,Vt as Bt,W as Vt,Wt as Ht,X as Ut,Xn as Wt,Xt as Gt,Yn as Kt,Yt as qt,Z as Jt,Zn as Yt,Zt as Xt,_ as Zt,an as Qt,ar as $t,at as en,b as tn,bt as nn,cn as rn,cr as an,dt as on,en as sn,er as cn,et as ln,g as un,gt as dn,h as fn,hn as pn,ht as mn,in as hn,it as gn,j as _n,k as vn,l as yn,ln as bn,lr as xn,m as Sn,mn as Cn,mt as wn,nr as Tn,nt as En,on as Dn,ot as On,p as kn,pn as An,pt as jn,q as Mn,qn as Nn,qt as Pn,rn as Fn,rt as In,sn as Ln,sr as Rn,st as z,tn as zn,tr as Bn,tt as Vn,u as Hn,un as Un,ur as Wn,ut as Gn,v as Kn,vt as qn,w as Jn,wt as Yn,x as Xn,xt as Zn,y as Qn,yt as $n,z as er,zn as tr,zt as nr}from"./index-BQB9R8Ug.js";import{f as rr,i as ir,p as ar,r as or}from"./editor.api-eUd8PqEu.js";import{t as sr}from"./register-3F1Tje_F.js";import{a as cr,c as lr,i as ur,n as dr,o as fr,r as pr,s as mr,t as hr}from"./alertDialog-BaBrZQ4M.js";import{t as gr}from"./useEntityRestURL-qfahJnvr.js";import"./languageServices-Bl-BvoAb.js";import"./editor-BDfNodZS.js";var _r=I(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),vr=I(`arrow-up-a-z`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),yr=I(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),br=I(`case-lower`,[[`path`,{d:`M10 9v7`,key:`ylp826`}],[`path`,{d:`M14 6v10`,key:`1jy4vg`}],[`circle`,{cx:`17.5`,cy:`12.5`,r:`3.5`,key:`1a9481`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`3.5`,key:`2jlv1r`}]]),xr=I(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),Sr=I(`case-upper`,[[`path`,{d:`M15 11h4.5a1 1 0 0 1 0 5h-4a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h3a1 1 0 0 1 0 5`,key:`nxs35`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]),Cr=I(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),wr=I(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Tr=I(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Er=I(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Dr=I(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),Or=I(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),kr=I(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Ar=I(`file-key`,[[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M4 12v6`,key:`bg1pfk`}],[`path`,{d:`M4 14h2`,key:`1sf9f8`}],[`path`,{d:`M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4`,key:`d56i0q`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),jr=I(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Mr=I(`file-type`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11 18h2`,key:`12mj7e`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5`,key:`qbrxap`}]]),Nr=I(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),Pr=I(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Fr=I(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ir=I(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Lr=I(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Rr=I(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),zr=I(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Br=I(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Vr=I(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),Hr=I(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Ur=I(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Wr=I(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Gr=I(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Kr=I(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),qr=I(`package-open`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),Jr=I(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Yr=I(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Xr=I(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Zr=I(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),Qr=I(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),$r=I(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),ei=I(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),ti=I(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),B=e(k(),1);function ni(e,t=!1){let[n,r]=Xe(e,t),i=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(e=>!e)},[r]),a=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(!0)},[r]),o=(0,B.useCallback)(e=>{e?.preventDefault?.(),r(!1)},[r]);return(0,B.useMemo)(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:a,toggleOff:o}),[i,r,o,a,n])}var ri=(0,B.createContext)(null);function V(){return(0,B.useContext)(ri)}var H=te();function ii(){let{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=V(),r=He();return(0,B.useCallback)(async a=>{let o=!1,s=a.filter(e=>e.from!==e.to);if(s.length===0)return!0;let c=`Renaming ${i(s.length,`File`,`Files`)}`,l={duration:6e4,action:{label:`Cancel`,onClick:()=>{o=!0}}};l.id=M.loading(c,{...l,description:(0,H.jsx)(ge,{animated:!0,width:`0%`})});let u=s.length*3,d=0;function f(){d+=1,M.loading(c,{...l,description:(0,H.jsx)(ge,{animated:!0,width:(d===0?0:d/u*100)+`%`})})}try{for(let e of s){let t=e.from.split(`/`),n=t.shift(),i=t.join(`/`),a=e.to.split(`/`),s=a.shift(),c=a.join(`/`),l=await Sn({...r,file:i,project:n,encoding:`base64`});if(o||(f(),await Re({...r,file:c,project:s,encoding:`base64`,payload:l.message}),o)||(f(),await De({...r,file:i,project:n}),o))break;f()}}catch(t){return M.error(`Rename Failed`,{id:l.id,description:t instanceof Error?t.message:`An unexpected error occurred while renaming.`,duration:1e4,action:{label:`OK`,onClick:()=>void 0}}),e(),!1}return d>=u?M.success(`Renamed ${i(s.length,`File`,`Files`)}`,{id:l.id,description:`All done!`,duration:3e3,action:{label:`OK`,onClick:()=>{}}}):M.warning(`Rename Cancelled`,{id:l.id,description:`${d} of ${u} steps completed.`,duration:1e4,action:{label:`OK`,onClick:()=>{}}}),e(),n(e=>{let t=e.slice();for(let e of s){let n=t.indexOf(e.from);n>=0?t.splice(n,1,e.to):t.push(e.to)}return t}),t(e=>{for(let t of s)if(e===t.from)return t.to;return e}),d>=u},[r,e,t,n])}var ai;function oi(e){ai=e}function si(e){return e.files.length>0||e.directories.length>0?ai?new Promise(t=>ai(e,t)):Promise.resolve(!1):Promise.resolve(!0)}function ci(e,t){return e[t]!==void 0}function li(e){return t=>ci(t,e)}var ui={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e===`Delete`)return R(`ShowDeleteDirectoryOrFileModal`,!0),!0},addEditorAction(e){return{id:`delete-file`,label:`Delete File`,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:Vt(`ShowDeleteDirectoryOrFileModal`,!0)}}},di={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e===`˜`)return R(`ShowAddDirectoryOrFileModalType`,`directory`),!0},addEditorAction(e){return{id:`new-directory`,label:`New Directory`,keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyMod.Shift|e.KeyCode.KeyN],run:Vt(`ShowAddDirectoryOrFileModalType`,`directory`)}}},fi={handleGlobal(e,t){if(t.ctrl&&e===`n`)return R(`ShowAddDirectoryOrFileModalType`,`file`),!0},addEditorAction(e){return{id:`new-file`,label:`New File`,keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:Vt(`ShowAddDirectoryOrFileModalType`,`file`)}}},pi;function mi(e){pi=e}function hi(){pi?.()}var gi=[ui,di,fi,{handleGlobal(e){if(e===`F2`)return R(`ShowRenameFileModal`,`file`),!0},addEditorAction(e){return{id:`rename-file`,label:`Rename File`,keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyCode.KeyR,e.KeyCode.F2],run:Vt(`ShowRenameFileModal`,!0)}}},{addEditorAction(){return{id:`revert-file`,label:`Revert File`,run:yt(`RevertChanges`,!0)}}},{handleGlobal(e,t){if(t.cmd&&e===`s`)return St(`SaveFile`,!0),!0},addEditorAction(e){return{id:`save-file`,label:`Save Changes`,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:yt(`SaveFile`,!0)}}}],_i=gi.filter(li(`addEditorAction`)),vi=gi.filter(li(`handleGlobal`));function yi(e){let[t,n]=e,r=_i.map(e=>t.addAction(e.addEditorAction(n)));return()=>{for(let e of r)e?.dispose()}}function bi(){(0,B.useEffect)(()=>(document.addEventListener(`keydown`,xi),()=>{document.removeEventListener(`keydown`,xi)}),[])}function xi(e){let t={cmd:e.getModifierState(`Meta`),alt:e.getModifierState(`Alt`),shift:e.getModifierState(`Shift`),ctrl:e.getModifierState(`Control`)};for(let n of vi)if(n.handleGlobal(e.key,t)){hi(),e.preventDefault();return}}function Si(e){return e.split(`/`).pop()}function Ci(){let[e,t]=(0,B.useState)(!1),[n,r]=(0,B.useState)(void 0),i=(0,B.useCallback)(e=>{if(!e.dataTransfer?.types?.includes(`Files`))return;let n=e.target instanceof Element?e.target:null,i=n?.closest(`.rct-tree-item-button-isFolder`)??n?.closest(`.rct-tree-item-title-container`)?.querySelector(`:scope > .rct-tree-item-button-isFolder`)??null;if(i){let e=i.getAttribute(`data-rct-item-id`);!i.querySelector(`.packageIsLocked`)&&e&&e!==`importedApplications`&&e!==`newApplication`&&r(e=>e===i?e:(e?.classList?.remove?.(`rct-tree-item-title-container-dragging-over`),i.classList.add(`rct-tree-item-title-container-dragging-over`),i))}t(!0)},[]),a=(0,B.useCallback)(()=>{t(!1),r(e=>{e&&e.classList.remove(`rct-tree-item-title-container-dragging-over`)})},[]),o=(0,B.useCallback)(e=>{if(!e.dataTransfer?.types?.includes(`Files`)||e.detail===1337)return;t(!1),n&&(n.classList.remove(`rct-tree-item-title-container-dragging-over`),r(void 0));let i=document.getElementById(`dropTarget`);return i?i.dispatchEvent(new DragEvent(`drop`,{bubbles:!0,detail:1337,cancelable:!0,dataTransfer:e.dataTransfer})):!1},[n]);return(0,B.useEffect)(()=>(document.addEventListener(`dragenter`,i),document.addEventListener(`dragover`,i),document.addEventListener(`dragleave`,a),document.addEventListener(`drop`,o),()=>{document.removeEventListener(`dragenter`,i),document.removeEventListener(`dragover`,i),document.removeEventListener(`dragleave`,a),document.removeEventListener(`drop`,o)}),[i,o,a]),(0,B.useMemo)(()=>({dragging:e,dragTarget:n}),[e,n])}function wi(e){return new Promise((t,n)=>{let r=new FileReader;r.onabort=n,r.onerror=n,r.onload=t,r.readAsDataURL(e)})}var Ti=new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),Ei=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function Di(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&ki(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),ki(r,`relativePath`,a),r}function Oi(e,t=Ti){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function ki(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var Ai=[`.DS_Store`,`Thumbs.db`];async function ji(e,{mimeTypes:t=Ti}={}){return(await Mi(e)).map(e=>e instanceof File?Oi(e,t):e)}async function Mi(e){return Ii(e)&&Ni(e.dataTransfer)?zi(e.dataTransfer,e.type):Pi(e)?Bi(e.clipboardData):Fi(e)?Li(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?Ri(e):[]}function Ni(e){return Ii(e)}function Pi(e){return Ii(e)&&Ni(e.clipboardData)}function Fi(e){return Ii(e)&&Ii(e.target)}function Ii(e){return typeof e==`object`&&!!e}function Li(e){return Hi(e.target.files).map(e=>Di(e))}async function Ri(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>Di(e))}async function zi(e,t){let n=Hi(e.items).filter(e=>e.kind===`file`);return t===`drop`?Vi(Wi(await Promise.all(n.map(Ui)))):n}function Bi(e){let t=Hi(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return Vi((t.length>0?t:Hi(e.files)).map(e=>Di(e)))}function Vi(e){return e.filter(e=>Ai.indexOf(e.name)===-1)}function Hi(e){return e===null?[]:Array.from(e)}async function Ui(e){if(typeof e.webkitGetAsEntry!=`function`)return Gi(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await Ki(e);return n?.kind===`directory`?qi(n,`/${n.name}`):Yi(t)}return Gi(e,t)}function Wi(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...Wi(n)):t.push(n);return t}async function Gi(e,t){let n=e.getAsFile(),r=await Ki(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,Di(e)}if(!n)throw new Ei(e);return Di(n,t?.fullPath??void 0)}async function Ki(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function qi(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await qi(r,e));else{let t=await r.getFile();n.push(Di(t,e,r))}}return n}async function Ji(e){return e.isDirectory?Yi(e):Xi(e)}function Yi(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(Ji));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function Xi(e){return new Promise((t,n)=>{e.file(n=>{t(Di(n,e.fullPath))},e=>{n(e)})})}var Zi=e(n((e=>{e.__esModule=!0,e.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(`,`);if(n.length===0)return!0;var r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(function(e){var t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}}))(),1),Qi=typeof Zi.default==`function`?Zi.default:Zi.default.default,$i=`file-invalid-type`,ea=`file-too-large`,ta=`file-too-small`,na=`too-many-files`;function ra(e=``){let t=e.split(`,`);return{code:$i,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var ia=[`KB`,`MB`,`GB`,`TB`,`PB`];function aa(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<ia.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${ia[n]}`}function oa(e){return{code:ea,message:`File is larger than ${aa(e)}`}}function sa(e){return{code:ta,message:`File is smaller than ${aa(e)}`}}var ca={code:na,message:`Too many files`};function la(e){return e.type===``&&typeof e.getAsFile==`function`}function ua(e,t){let n=e.type===`application/x-moz-file`||Qi(e,t??``)||la(e);return[n,n?null:ra(t)]}function da(e,t,n){if(fa(e.size)){if(fa(t)&&fa(n)){if(e.size>n)return[!1,oa(n)];if(e.size<t)return[!1,sa(t)]}else if(fa(t)&&e.size<t)return[!1,sa(t)];else if(fa(n)&&e.size>n)return[!1,oa(n)]}return[!0,null]}function fa(e){return e!=null}function pa(e){return e!=null&&typeof e.then==`function`}function ma({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=ua(e,t),[o,s]=da(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(ca,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function ha(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function ga(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],_a):!!e.target&&!!e.target.files}function _a(e){return typeof e==`object`&&!!e&&e.kind===`file`}function va(e){e.preventDefault()}function ya(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function ba(e){return e.indexOf(`Edge/`)!==-1}function xa(e=window.navigator.userAgent){return ya(e)||ba(e)}function Sa(...e){return(t,...n)=>e.some(e=>(!ha(t)&&e&&e(t,...n),ha(t)))}function Ca(){return`showOpenFilePicker`in window}function wa(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function Ta(e){if(fa(e))return Array.isArray(e)?e.filter(e=>fa(e)&&fa(e.accept)):[{accept:e}]}function Ea(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of wa(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function Da(e){let t=Ta(e);if(!fa(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of wa(r))e.includes(t)||e.push(t)}return n}function Oa(e){let t=Ta(e);if(!fa(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return Na(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(!(Array.isArray(t)||typeof t==`string`)||!wa(t).every(Fa))&&(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=wa(n),e),{});return{description:fa(e.description)&&e.description!==``?e.description:Ea(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function ka(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(fa(e))return Object.entries(e).reduce((e,[n,r])=>{let i=wa(r);return t&&Pa(n)&&i.some(Fa)?e.push(...i):e.push(n,...i),e},[]).filter(e=>Na(e)||Fa(e)).join(`,`)}function Aa(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function ja(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function Ma(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function Na(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function Pa(e){return e.endsWith(`/*`)}function Fa(e){return/^.*\.[\w]+$/.test(e)}var Ia=(0,B.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=Ra(t);return(0,B.useImperativeHandle)(n,()=>({open:r}),[r]),(0,H.jsx)(H.Fragment,{children:e?.({...i,open:r})})});Ia.displayName=`Dropzone`;var La={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function Ra(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=ji,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,B.useMemo)(()=>Da(t),[t]),O=(0,B.useMemo)(()=>ka(D),[D]),k=(0,B.useMemo)(()=>ka(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),ee=(0,B.useMemo)(()=>Oa(t),[t]),te=(0,B.useMemo)(()=>typeof h==`function`?h:Ba,[h]),A=(0,B.useMemo)(()=>typeof m==`function`?m:Ba,[m]),j=(0,B.useRef)(null),M=(0,B.useRef)(null),[N,P]=(0,B.useReducer)(za,La),{isFocused:ne,isFileDialogActive:F}=N,re=(0,B.useRef)(F);re.current=F;let ie=(0,B.useRef)(null),I=(0,B.useCallback)(()=>{ie.current?.abort();let e=new AbortController;return ie.current=e,P({type:`setProcessing`,isProcessing:!0}),e.signal},[]),L=(0,B.useCallback)(e=>{e.aborted||P({type:`setProcessing`,isProcessing:!1})},[]),ae=(0,B.useRef)(typeof window<`u`&&window.isSecureContext&&g&&Ca()),oe=()=>{!ae.current&&F&&setTimeout(()=>{if(M.current){let{files:e}=M.current;e?.length||(P({type:`closeDialog`}),A())}},300)};(0,B.useEffect)(()=>(window.addEventListener(`focus`,oe,!1),()=>{window.removeEventListener(`focus`,oe,!1)}),[M,F,A,ae]);let se=(0,B.useRef)([]),ce=(0,B.useRef)([]),le=e=>{j.current&&e.target&&j.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),se.current=[])};(0,B.useEffect)(()=>(v&&(document.addEventListener(`dragover`,va,!1),document.addEventListener(`drop`,le,!1)),()=>{v&&(document.removeEventListener(`dragover`,va),document.removeEventListener(`drop`,le))}),[j,v]),(0,B.useEffect)(()=>{let e=e=>{e.target&&(ce.current=[...ce.current,e.target]),ga(e)&&P({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{ce.current=ce.current.filter(t=>t!==e.target&&t!==null),!(ce.current.length>0)&&P({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{ce.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{ce.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[j]),(0,B.useEffect)(()=>(!n&&_&&j.current&&j.current.focus(),()=>{}),[j,_,n]);let ue=(0,B.useCallback)(e=>{w?w(e):console.error(e)},[w]),de=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ee(e),!re.current&&(se.current=[...se.current,e.target],ga(e)&&Promise.resolve(r(e)).then(t=>{if(ha(e)&&!S)return;let n=t.length>0?ma({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;P({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>ue(e)))},[r,c,ue,S,O,a,i,o,s,T,E]),fe=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ee(e),re.current)return!1;let t=ga(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),pe=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ee(e);let t=se.current.filter(e=>j.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),se.current=t,!(t.length>0)&&(P({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),ga(e)&&l&&l(e))},[j,l,S]),me=(0,B.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{if(t&&o&&!c)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(ca,e)]})}),P({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=ua(e,k),[r,o]=da(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>pa(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(L(n),ue(e));return}n.aborted||c(u)},[P,o,k,a,i,s,d,f,p,T,E,ue,L]),he=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ee(e),se.current=[],!(re.current&&e.dataTransfer)&&(P({type:`reset`}),ga(e))){let t=I();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(ha(e)&&!S){L(t);return}return me(n,e,t)}}).catch(e=>{t.aborted||(L(t),ue(e))})}},[r,me,ue,S,I,L]),ge=(0,B.useCallback)(e=>{if(!ga(e))return;e.preventDefault(),e.persist?.(),Ee(e);let t=I();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(ha(e)&&!S){L(t);return}return me(n,e,t)}}).catch(e=>{t.aborted||(L(t),ue(e))})},[r,me,ue,S,I,L]),_e=(0,B.useCallback)(()=>{if(ae.current){P({type:`openDialog`}),te();let e={multiple:o,types:ee},t;window.showOpenFilePicker(e).then(e=>(t=I(),r(e))).then(e=>{if(P({type:`closeDialog`}),!t.aborted)return me(e,null,t)}).catch(e=>{t&&L(t),Aa(e)?(A(e),P({type:`closeDialog`})):ja(e)||Ma(e)?(ae.current=!1,M.current?(M.current.value=``,M.current.click()):ue(Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):ue(e)});return}M.current&&(P({type:`openDialog`}),te(),M.current.value=``,M.current.click())},[P,te,A,g,me,ue,ee,o,I,L]),ve=(0,B.useCallback)(e=>{j.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),_e())},[j,_e]),ye=(0,B.useCallback)(()=>{P({type:`focus`})},[]),be=(0,B.useCallback)(()=>{P({type:`blur`})},[]),xe=(0,B.useCallback)(()=>{y||(xa()?setTimeout(_e,0):_e())},[y,_e]),Se=e=>n?null:e,Ce=e=>b?null:Se(e),we=e=>x?null:Se(e),Te=e=>C?null:Se(e),Ee=e=>{S&&e.stopPropagation()},De=(0,B.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:Ce(Sa(r,ve)),onFocus:Ce(Sa(i,ye)),onBlur:Ce(Sa(a,be)),onClick:Se(Sa(o,xe)),onDragEnter:we(Sa(s,de)),onDragOver:we(Sa(c,fe)),onDragLeave:we(Sa(l,pe)),onDrop:we(Sa(u,he)),onPaste:Te(Sa(d,ge)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:j,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[j,ve,ye,be,xe,de,fe,pe,he,ge,b,x,C,n]),Oe=(0,B.useCallback)(e=>{e.stopPropagation()},[]),ke=(0,B.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:Se(Sa(t,he)),onClick:Se(Sa(n,Oe)),tabIndex:-1,[e]:M,...r}),[M,t,o,he,n]);return{...N,isFocused:ne&&!n,getRootProps:De,getInputProps:ke,rootRef:j,inputRef:M,open:Se(_e)}}function za(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...La,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...La};default:return e}}function Ba(){}function Va(){let[e,t]=(0,B.useState)(``),{clusterId:n}=E({strict:!1}),{openedEntry:r,restrictPackageModification:c,reloadRootEntries:u,entryExists:d}=V(),f=!!r&&!r.package&&!c,p=He(),{dragging:m,dragTarget:h}=Ci(),g=(h?.getAttribute?.(`data-rct-item-id`))?.split?.(`/`)?.pop?.(),_=r?.project,v=!1,y;if(r?.path){let e=r.path.split(`/`),t=z(r);v=f&&(t?e.slice(1):e.slice(1,-1)).join(`/`),y=e[e.length-(t?1:2)]}let b=(0,B.useCallback)(async(e,n)=>{let r=e,a=h?.getAttribute?.(`data-rct-item-id`)?.split?.(`/`),o=a?.length?a[0]:f?_:!1,s=a?.length?a.slice(1).join(`/`):f?v:!1;if(o===!1||o===void 0||s===!1||s===void 0)return;let c=[],l=n.slice(),m=[];for(let e of r){let t=Ha(s,e);e.name.startsWith(`.`)||e.relativePath?.includes(`/.`)?l.push({file:e,errors:[{message:`Sensitive files and folders starting with . are skipped.`,code:`dot-ignored`}]}):d(`${o}/${t}`)?m.push({file:e,path:`${o}/${t}`}):c.push(e)}if(m.length>0){let e=await si({files:m.map(e=>e.path),directories:[]});for(let t of m)e?c.push(t.file):l.push({file:t.file,errors:[{message:`${Ha(s,t.file)} already exists`,code:`duplicate`}]})}let g=!1,y=`uploading-files`,b={label:`Cancel`,onClick:()=>{g=!0}},x={label:`OK`,onClick:()=>void 0};t(`Uploading ${i(c.length,`file`,`files`)}...`);try{let e=c.reduce((e,t)=>e+t.size,0),t=0,n=0;for(let r of c){n+=1,M.loading(`Upload in progress...`,{id:y,descriptionClassName:`whitespace-pre-line`,description:`${n} of ${i(c.length,`file`,`files`)}
3
- ${r.name}
4
- ${st(t)} of ${st(e)}`,action:b});let a=Ha(s,r),u=(await wi(r)).target?.result;if(!u)throw Error(`Failed to read file: ${r.name}`);let d=u.indexOf(`base64,`);if(d===-1)throw Error(`Invalid data URL format for file: ${r.name}`);g?l.push({file:r,errors:[{message:`${a} cancelled`,code:`cancelled`}]}):(await Re({...p,file:a,project:o,encoding:`base64`,payload:u.slice(d+7)}),t+=r.size)}M.loading(`Reloading sidebar...`,{id:y,action:x,description:``}),await u(),l.length===0?r.length>0?M.success(`Uploaded ${i(c.length,`file`,`files`)}!`,{id:y,action:x,description:``}):M.dismiss(y):(console.log(l),M.error(g?`Cancelled uploads`:`Rejected uploads`,{id:y,action:x,descriptionClassName:`whitespace-pre-line overflow-y-auto`,description:l.slice(0,5).map(e=>e.errors.map(e=>e.message).join(`
5
- `)).join(`
6
- `)+(l?.length>5?`
7
- Check the console for the full list.`:``)}))}catch(e){M.dismiss(y),ze(e)}finally{t(``)}},[h,f,_,v,d,p,u]),{getRootProps:x,getInputProps:S}=Ra({multiple:!0,maxSize:n&&s.checkForFabricConnect(n)?o:a,onDrop:b});return!f&&!h?m?(0,H.jsxs)(`div`,{className:l(`border-3 border-dashed`,`pointer-events-auto`,`cursor-copy text-sm text-center`,`p-2 w-full fixed bottom-0 h-16`,`flex flex-col items-center justify-center`,`bg-red-100 border-red-600 dark:bg-red-950 dark:border-red-600`),children:[`You cannot upload into`,(0,H.jsx)(`br`,{}),(0,H.jsx)(`strong`,{children:y})]}):null:(0,H.jsxs)(`div`,{...x(),className:m?`fixed top-0 bottom-0 w-full pointer-events-none`:``,children:[(0,H.jsx)(`input`,{id:`dropTarget`,...S()}),(0,H.jsx)(`div`,{className:l(`border-3 border-dashed`,`pointer-events-auto`,`cursor-copy text-sm text-center`,`p-2 w-full fixed bottom-0 h-16`,`flex flex-col items-center justify-center`,m?`animate-glow-pulse bg-green-100 border-green-600 dark:bg-green-950 dark:border-green-600`:`border-purple-600 backdrop-blur-sm bg-purple-600/10 dark:bg-purple-600/30`),children:e||(h?(0,H.jsxs)(H.Fragment,{children:[`Drop to upload into`,(0,H.jsx)(`br`,{}),(0,H.jsx)(`strong`,{children:g})]}):m?(0,H.jsxs)(H.Fragment,{children:[`Drop to upload into`,(0,H.jsx)(`br`,{}),(0,H.jsx)(`strong`,{children:y})]}):(0,H.jsxs)(H.Fragment,{children:[`Drag and drop to upload`,(0,H.jsx)(`br`,{}),`or click to select files.`]}))})]})}function Ha(e,t){let n=t.relativePath??t.name,r=n.indexOf(`/`),i=r===0||r===1?n.slice(r+1):n;return e?`${e}/${i}`:i}function Ua(e){let{restrictPackageModification:t}=V(),n=dt(),r=!!e?.package,i=!!e&&z(e)&&e.path===e.project;return{canEditFile:!!e&&!z(e)&&!r&&n,canRename:!!e&&!r&&n&&!i,canAddEntries:!!e&&!r&&n,canAddTable:!!e&&e.path.endsWith(`.graphql`)&&n,canDeleteEntry:!t&&n,canDownload:i,canRedeploy:r&&n&&!t}}var Wa=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),Ga={rename:`F2`,newFile:Wa?`⌃N`:`Ctrl+N`,newDirectory:Wa?`⌃⌥⇧N`:`Ctrl+Alt+Shift+N`,delete:Wa?`⌘⌦`:`Ctrl+Del`};function Ka({items:e,children:t}){let{setOpenedEntry:n,setFocusedItem:r,setSelectedItems:i,selectedItems:a}=V(),[o,s]=(0,B.useState)(void 0),[c,l]=(0,B.useState)(``),{canRename:u,canAddEntries:d,canDeleteEntry:f,canDownload:p,canRedeploy:m}=Ua(o?.entry),h=(0,B.useCallback)(e=>{n(e.entry),r(e.id),i(e.selection)},[n,r,i]),g=(0,B.useRef)(o);g.current=o;let[_,v]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(_)return mi(()=>{let e=g.current;e&&h(e)}),()=>mi(void 0)},[_,h]);let y=(0,B.useCallback)(t=>{let n=t.target.closest(`[data-rct-item-id]`)?.getAttribute(`data-rct-item-id`),r=n?e[n]?.data:void 0;if(!n||!r||!r.project||n===`__root__`||n===`newApplication`||n===`importedApplications`){t.preventDefault();return}let i={entry:r,id:n,selection:a.includes(n)?a:[n]};s(i),l(`${t.clientX},${t.clientY}`)},[e,a]),b=(0,B.useCallback)(e=>{o&&h(o),e()},[o,h]),x=pt();return(0,H.jsxs)(Gt,{modal:!1,onOpenChange:v,children:[(0,H.jsx)(zn,{asChild:!0,children:(0,H.jsx)(`div`,{onContextMenu:y,className:`min-h-full`,children:t})}),o&&(0,H.jsxs)(Xt,{className:`min-w-44`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,H.jsxs)(At,{onSelect:()=>x(o.entry.name),children:[(0,H.jsx)(Rn,{}),`Copy Name`]}),(0,H.jsxs)(At,{onSelect:()=>x(o.entry.path),children:[(0,H.jsx)(Vr,{}),`Copy Path`]}),(d||u||p||m||f)&&(0,H.jsx)(qe,{}),d&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(At,{onSelect:()=>b(()=>R(`ShowAddDirectoryOrFileModalType`,`file`)),children:[(0,H.jsx)(jr,{}),`New File`,(0,H.jsx)(sn,{children:Ga.newFile})]}),(0,H.jsxs)(At,{onSelect:()=>b(()=>R(`ShowAddDirectoryOrFileModalType`,`directory`)),children:[(0,H.jsx)(Ir,{}),`Add Directory`,(0,H.jsx)(sn,{children:Ga.newDirectory})]})]}),u&&(0,H.jsxs)(At,{onSelect:()=>b(()=>R(`ShowRenameFileModal`,!0)),children:[(0,H.jsx)(_e,{}),`Rename`,(0,H.jsx)(sn,{children:Ga.rename})]}),p&&(0,H.jsxs)(At,{onSelect:()=>b(()=>R(`ShowDownloadApplicationModal`,!0)),children:[(0,H.jsx)(Se,{}),`Download Application`]}),m&&(0,H.jsxs)(At,{onSelect:()=>b(()=>R(`ShowRedeployApplicationModal`,!0)),children:[(0,H.jsx)(Bn,{}),`Redeploy Package`]}),(d||u||p||m)&&f&&(0,H.jsx)(qe,{}),f&&(0,H.jsxs)(At,{variant:`destructive`,onSelect:()=>b(()=>R(`ShowDeleteDirectoryOrFileModal`,!0)),children:[(0,H.jsx)(zt,{}),`Delete`,(0,H.jsx)(sn,{children:Ga.delete})]})]},c)]})}function qa(e){let t=e.data;return t&&`name`in t?t.name:`root`}function Ja(e){let{instanceId:t,clusterId:n}=E({strict:!1}),[r,i]=Xe(`EditorFileContent/${c}}/${e}`,void 0);return(0,B.useMemo)(()=>({content:e?r:void 0,setContent:i}),[e,r,i])}var Ya=`w-6 pointer-events-none `;function Xa({opened:e,pkg:t}){let n=Ya+`w-4 h-4 shrink-0`;return t?e?(0,H.jsx)(qr,{className:`${n} text-orange-600`}):(0,H.jsx)(Bn,{className:`${n} text-orange-600`}):e?(0,H.jsx)(Fr,{className:`${n} text-orange-400`}):(0,H.jsx)(je,{className:`${n} text-orange-400`})}function Za({extension:e,filename:t}){let n=`w-4 h-4 mr-2 shrink-0`;if(Vn(t))return(0,H.jsx)(Ar,{className:`${n} text-amber-500`});switch(e){case`js`:case`jsx`:case`cjs`:return(0,H.jsx)(Or,{className:`${n} text-yellow-500`});case`ts`:case`tsx`:return(0,H.jsx)(Or,{className:`${n} text-blue-500`});case`yaml`:case`yml`:return(0,H.jsx)(Ae,{className:n});case`css`:return(0,H.jsx)(Ae,{className:`${n} text-blue-500`});case`html`:return(0,H.jsx)(Cr,{className:n});case`json`:return(0,H.jsx)(Dr,{className:n});case`png`:case`jpg`:case`jpeg`:case`gif`:return(0,H.jsx)(kr,{className:n});case`svg`:return(0,H.jsx)(Mr,{className:n});case`vue`:return(0,H.jsx)(Or,{className:`${n} text-green-500`});default:return(0,H.jsx)(Ae,{className:n})}}function Qa(){return(0,H.jsx)(Tn,{className:Ya+`w-4 h-4 shrink-0 text-gray-400 ml-2 packageIsLocked`})}function $a(){return(0,H.jsx)(cn,{className:Ya+`w-4 h-4 shrink-0 text-green-500`})}function eo({title:e,item:t,context:n}){let{content:r}=Ja(t.data?.path);return(0,H.jsxs)(H.Fragment,{children:[t.data?.path===`newApplication`?(0,H.jsx)($a,{}):z(t.data)?(0,H.jsx)(Xa,{opened:n.isExpanded,pkg:!!t.data?.package||t.data.path===`importedApplications`}):(0,H.jsx)(Za,{extension:Kn(e),filename:e}),(0,H.jsxs)(`span`,{className:`text-nowrap pointer-events-none`,children:[e,r?`*`:``]}),t.data?.package&&(0,H.jsx)(Qa,{})]})}function to(){let{rootEntries:e,openedEntry:t,setOpenedEntry:n,focusedItem:r,setFocusedItem:i,expandedItems:a,setExpandedItems:o,selectedItems:s,setSelectedItems:c,entryExists:l}=V(),{items:u,rootId:d}=(0,B.useMemo)(()=>Me(e),[e]);bi();let f=(0,B.useRef)(null);rt(`FocusFileTree`,()=>{requestAnimationFrame(()=>{let e=f.current;if(!e)return;let t=r?e.querySelector(`[data-rct-item-id="${CSS.escape(String(r))}"]`):null;(t??e.querySelector(`[role="tree"]`))?.focus(),t?.scrollIntoView({block:`nearest`})})},[r]),(0,B.useEffect)(function(){if(t?.path!==r&&r){let e=u[r]?.data;e&&n(e)}},[r,u,t?.path,n]);let p=ii(),m=(0,B.useCallback)(async(e,t)=>{switch(t.targetType){case`item`:{if(u[t.targetItem]?.data?.package){M.error(`Read-Only Imported Application`,{description:`To make changes to an application, please click the "Redeploy" button and update the reference.`});return}let n=e.map(e=>({from:e.index,to:Pe(t.targetItem,Si(e.index))})),r=[],i=[];for(let e of n)if(e.from!==e.to&&l(e.to)){let t=u[e.to]?.data;(t&&z(t)?i:r).push(e.to)}return(r.length||i.length)&&!await si({files:r,directories:i})?void 0:p(n)}default:M.error(`${t.targetType} drop not yet supported`)}},[u,p,l]);return(0,H.jsxs)(`div`,{ref:f,className:`app-tree-scroll h-full overflow-auto pr-1.5 pb-18`,children:[(0,H.jsx)(Ka,{items:u,children:(0,H.jsx)(mt,{canDragAndDrop:!0,canDropOnFolder:!0,canDropOnNonFolder:!1,canReorderItems:!1,canSearch:!0,canRename:!1,defaultInteractionMode:jt.DoubleClickItemToExpand,getItemTitle:qa,items:u,onDrop:m,renderItemArrow:er,renderItemTitle:eo,viewState:{applicationsTree:{focusedItem:r,expandedItems:a,selectedItems:s}},onFocusItem:e=>i(e.index),onExpandItem:e=>o([...a,e.index]),onCollapseItem:e=>o(a.filter(t=>t!==e.index)),onSelectItems:e=>c(e),children:(0,H.jsx)(ct,{treeId:`applicationsTree`,rootItem:d,treeLabel:`Applications file tree`})})}),(0,H.jsx)(Va,{})]})}function no(e,t){let n=Math.max(180,Math.floor(t/2));return Math.round(Math.min(Math.max(e,180),n))}function ro(){let[e,t]=Ve(Be.ApplicationsSidebarWidth,224),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(()=>no(e,window.innerWidth)),o=(0,B.useRef)(i);o.current=i,(0,B.useEffect)(()=>{n||a(no(e,window.innerWidth))},[e,n]),(0,B.useEffect)(()=>{let e=()=>t(e=>no(e,window.innerWidth));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[t]);let s=(0,B.useCallback)(e=>{e.preventDefault(),r(!0)},[]);return(0,B.useEffect)(()=>{if(!n)return;let e=e=>a(no(e.clientX,window.innerWidth)),i=()=>{r(!1),t(o.current)},s=document.body.style.userSelect;return document.body.style.userSelect=`none`,window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,i),()=>{document.body.style.userSelect=s,window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,i)}},[n,t]),{width:i,isResizing:n,startResizing:s}}function io({isResizing:e,onMouseDown:t}){return(0,H.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onMouseDown:t,className:l(`absolute top-0 right-0 bottom-0 w-1 z-40 cursor-col-resize`,`hover:bg-violet-400/60 dark:hover:bg-violet-500/60 transition-colors`,e&&`bg-violet-400/60 dark:bg-violet-500/60`)})}var ao=[[{id:`editor.action.formatDocument`,label:`Format Document`,icon:Qr},{id:`editor.action.commentLine`,label:`Toggle Line Comment`,icon:Gr},{id:`editor.action.blockComment`,label:`Toggle Block Comment`,icon:Wr}],[{id:`editor.action.startFindReplaceAction`,label:`Replace`,icon:Zr},{id:`editor.action.quickFix`,label:`Quick Fix…`,icon:Br},{id:`editor.action.rename`,label:`Rename Symbol`,icon:$r}],[{id:`editor.action.sortLinesAscending`,label:`Sort Lines Ascending`,icon:_r},{id:`editor.action.sortLinesDescending`,label:`Sort Lines Descending`,icon:vr},{id:`editor.action.trimTrailingWhitespace`,label:`Trim Trailing Whitespace`,icon:Tr}],[{id:`editor.foldAll`,label:`Fold All`,icon:Nr},{id:`editor.unfoldAll`,label:`Unfold All`,icon:ti}]],oo=[{id:`editor.action.transformToUppercase`,label:`UPPERCASE`,icon:Sr},{id:`editor.action.transformToLowercase`,label:`lowercase`,icon:br},{id:`editor.action.transformToTitlecase`,label:`Title Case`,icon:xr},{id:`editor.action.transformToCamelcase`,label:`camelCase`,icon:xr},{id:`editor.action.transformToPascalcase`,label:`PascalCase`,icon:xr},{id:`editor.action.transformToSnakecase`,label:`snake_case`,icon:xr},{id:`editor.action.transformToKebabcase`,label:`kebab-case`,icon:xr}],so=[[{id:`actions.find`,label:`Find`,icon:Kt}],[{id:`editor.action.quickCommand`,label:`Command Palette`,icon:wr},{id:`editor.action.quickOutline`,label:`Go to Symbol…`,icon:Ur},{id:`editor.action.gotoLine`,label:`Go to Line/Column…`,icon:Hr}],[{id:`editor.action.marker.next`,label:`Next Problem`,icon:xn},{id:`editor.action.marker.prev`,label:`Previous Problem`,icon:xn}]],co=[...ao.flat(),...oo,...so.flat()].map(e=>e.id),lo={},uo=new Set;function fo(e){lo=e;for(let e of uo)e()}function po(e){return uo.add(e),()=>{uo.delete(e)}}function mo(){return(0,B.useSyncExternalStore)(po,()=>lo)}var ho=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),go={save:ho?`⌘S`:`Ctrl+S`,rename:`F2`,newFile:ho?`⌃N`:`Ctrl+N`,newDirectory:ho?`⌃⌥⇧N`:`Ctrl+Alt+Shift+N`,delete:ho?`⌘⌦`:`Ctrl+Del`};function _o({toggledSidebar:e,toggleSidebar:t}){let n=He(),{openedEntryContents:r,openedEntry:i,isSavingFile:a,restrictPackageModification:o}=V(),{content:s}=Ja(i?.path),c=dt(),{onRestartClick:l,isRestartPending:u}=dn({operation:`restart_service`,instanceClient:n.instanceClient}),d=ft(`ShowAddDirectoryOrFileModalType`,`file`),f=ft(`ShowAddDirectoryOrFileModalType`,`directory`),p=ft(`ShowDownloadApplicationModal`,!0),m=ft(`ShowRenameFileModal`,!0),h=ft(`ShowDeleteDirectoryOrFileModal`,!0),g=ft(`ShowRedeployApplicationModal`,!0),_=Dt(`SaveFile`,!0),v=Dt(`RevertChanges`,!0),b=Dt(`AddSchemaTable`,!0),x=Dt(`NavigateBack`,!0),S=Dt(`NavigateForward`,!0),C=Mn(`CanNavigateBack`,!1).value,w=Mn(`CanNavigateForward`,!1).value,T=Mn(`EditorSaveBlocked`,!1).value,E=mo(),D=s===void 0||s===r,[O,k]=(0,B.useState)(null),ee=e=>k(t=>t===null?null:e),te=e=>{let t=e.icon,n=E[e.id];return(0,H.jsxs)(xt,{onSelect:()=>St(`RunEditorAction`,e.id),children:[(0,H.jsx)(t,{}),e.label,n&&(0,H.jsx)(nt,{children:n})]},e.id)},A=e=>e.map((e,t)=>(0,H.jsxs)(B.Fragment,{children:[t>0&&(0,H.jsx)(Et,{}),e.map(te)]},t)),{canEditFile:j,canRename:M,canAddEntries:N,canAddTable:P,canDeleteEntry:ne,canDownload:F,canRedeploy:re}=Ua(i),ie=j||M||N||P||ne,I=F||c||re,L=i&&z(i)?`Directory`:`File`;return(0,H.jsxs)(`div`,{className:`absolute top-0 right-0 left-0 backdrop-blur-sm bg-black-10 shadow-xl flex pr-4 md:pr-12`,children:[(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:(e?`toggled-sidebar-toggler`:`hidden-sidebar-toggler`)+` inline-flex text-sm md:hidden focus:outline-none focus:ring-2 text-foreground hover:text-muted-foreground focus:ring-gray-600 rounded-none`,onClick:t,children:[(0,H.jsxs)(`span`,{className:`sr-only`,children:[e?`Close`:`Open`,` sidebar`]}),e?(0,H.jsx)(Yr,{}):(0,H.jsx)(Jr,{})]}),i&&i?.path!==`newApplication`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:`rounded-none px-2`,onClick:x,disabled:!C,title:`Go Back`,children:[(0,H.jsx)(he,{className:`pointer-events-none`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Go Back`})]}),(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:`rounded-none px-2`,onClick:S,disabled:!w,title:`Go Forward`,children:[(0,H.jsx)(Wn,{className:`pointer-events-none`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Go Forward`})]}),i.package&&(0,H.jsxs)(An,{children:[(0,H.jsx)(pn,{asChild:!0,children:(0,H.jsxs)(y,{variant:`ghost`,type:`button`,className:`cursor-help`,children:[(0,H.jsx)(Tn,{width:16,height:16}),(0,H.jsx)(`span`,{className:`hidden md:inline-block`,children:`Imported applications are read-only`})]})}),(0,H.jsx)(Cn,{children:o?(0,H.jsxs)(H.Fragment,{children:[`This application is read-only, and cannot be modified.`,(0,H.jsx)(`br`,{}),`It helps govern clustering amongst your instances.`]}):(0,H.jsx)(H.Fragment,{children:`This application is read-only, and cannot be directly modified. But you can re-deploy or remove it.`})})]}),ie&&(0,H.jsxs)(Ye,{open:O===`file`,onOpenChange:e=>k(e?`file`:null),modal:!1,children:[(0,H.jsx)(tr,{asChild:!0,children:(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:`rounded-none`,title:L,onPointerEnter:()=>ee(`file`),children:[L,!D&&j&&(0,H.jsx)(`span`,{className:`ml-1 size-1.5 rounded-full bg-primary`,"aria-label":`Unsaved changes`}),(0,H.jsx)(ye,{className:`pointer-events-none opacity-60`})]})}),(0,H.jsxs)(vt,{align:`start`,children:[j&&(0,H.jsxs)(xt,{onSelect:_,disabled:D||a||T,title:T?`Fix the schema errors before saving`:void 0,children:[(0,H.jsx)(Wt,{}),`Save`,(0,H.jsx)(nt,{children:go.save})]}),M&&(0,H.jsxs)(xt,{onSelect:m,disabled:!D||a,children:[(0,H.jsx)(_e,{}),`Rename`,(0,H.jsx)(nt,{children:go.rename})]}),j&&(0,H.jsxs)(xt,{onSelect:v,disabled:D||a,children:[(0,H.jsx)(ei,{}),`Revert`]}),(j||M)&&(N||P)&&(0,H.jsx)(Et,{}),N&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(xt,{onSelect:d,children:[(0,H.jsx)(jr,{}),`New File`,(0,H.jsx)(nt,{children:go.newFile})]}),(0,H.jsxs)(xt,{onSelect:f,children:[(0,H.jsx)(Ir,{}),`Add Directory`,(0,H.jsx)(nt,{children:go.newDirectory})]})]}),P&&(0,H.jsxs)(xt,{onSelect:b,children:[(0,H.jsx)(cn,{}),`New Table`]}),(j||M||N||P)&&ne&&(0,H.jsx)(Et,{}),ne&&(0,H.jsxs)(xt,{variant:`destructive`,onSelect:h,children:[(0,H.jsx)(zt,{}),`Delete`,(0,H.jsx)(nt,{children:go.delete})]})]})]}),j&&(0,H.jsxs)(Ye,{open:O===`edit`,onOpenChange:e=>k(e?`edit`:null),modal:!1,children:[(0,H.jsx)(tr,{asChild:!0,children:(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:`rounded-none`,title:`Edit`,onPointerEnter:()=>ee(`edit`),children:[`Edit`,(0,H.jsx)(ye,{className:`pointer-events-none opacity-60`})]})}),(0,H.jsxs)(vt,{align:`start`,children:[A(ao),(0,H.jsx)(Et,{}),(0,H.jsxs)(lt,{children:[(0,H.jsxs)(Mt,{children:[(0,H.jsx)(xr,{}),`Transform Case`]}),(0,H.jsx)(ht,{children:oo.map(te)})]})]})]}),(0,H.jsxs)(Ye,{open:O===`go`,onOpenChange:e=>k(e?`go`:null),modal:!1,children:[(0,H.jsx)(tr,{asChild:!0,children:(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:`rounded-none`,title:`Go`,onPointerEnter:()=>ee(`go`),children:[`Go`,(0,H.jsx)(ye,{className:`pointer-events-none opacity-60`})]})}),(0,H.jsx)(vt,{align:`start`,children:A(so)})]}),I&&(0,H.jsxs)(Ye,{open:O===`application`,onOpenChange:e=>k(e?`application`:null),modal:!1,children:[(0,H.jsx)(tr,{asChild:!0,children:(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:`rounded-none`,title:`Application`,onPointerEnter:()=>ee(`application`),children:[`Application`,(0,H.jsx)(ye,{className:`pointer-events-none opacity-60`})]})}),(0,H.jsxs)(vt,{align:`start`,children:[F&&(0,H.jsxs)(xt,{onSelect:p,children:[(0,H.jsx)(Se,{}),`Download Application`]}),c&&(0,H.jsxs)(xt,{onSelect:l,disabled:!D||a||u,title:`Restarts all service threads to apply changes. No downtime expected.`,children:[(0,H.jsx)(Yt,{}),`Restart`]}),(F||c)&&re&&(0,H.jsx)(Et,{}),re&&(0,H.jsxs)(xt,{onSelect:g,children:[(0,H.jsx)(Bn,{}),`Redeploy Package`]})]})]})]})]})}function vo(e){return(0,B.useCallback)((t,n,r)=>{if(n!==`href`)return t;if(t.startsWith(`http`))return r.properties.target=`_blank`,t;{let n=Bt().split(`?`)[0];switch(t){case`./apis`:case`./config`:case`./config/roles`:case`./config/users`:case`./databases`:case`./logs`:case`./status`:return`${n}/${t.slice(2)}`}return`${n}?open=${e}/${t.slice(t.startsWith(`../`)?3:2)}`}},[e])}var yo=new Set(`7z.br.bz2.bzip2.cab.gz.gzip.lz.lz4.lzma.rar.tar.tbz.tbz2.tgz.txz.xz.z.zip.zst.zstd.a.bin.class.dll.dylib.exe.jar.node.o.so.wasm.eot.otf.ttf.woff.woff2.aac.flac.m4a.mp3.oga.ogg.opus.wav.wma.heic.heif.psd.tif.tiff.db.pdf.sqlite.sqlite3`.split(`.`));function bo(e){return yo.has(Kn(e).toLowerCase())}var xo={svg:{mime:`image/svg+xml`}};function So(e){return xo[Kn(e).toLowerCase()]}function Co(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var wo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,To=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eo={};function Do(e,t){return((t||Eo).jsx?To:wo).test(e)}var Oo=/[ \t\n\f\r]/g;function ko(e){return typeof e==`object`?e.type===`text`&&Ao(e.value):Ao(e)}function Ao(e){return e.replace(Oo,``)===``}var jo=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};jo.prototype.normal={},jo.prototype.property={},jo.prototype.space=void 0;function Mo(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new jo(n,r,t)}function No(e){return e.toLowerCase()}var Po=class{constructor(e,t){this.attribute=t,this.property=e}};Po.prototype.attribute=``,Po.prototype.booleanish=!1,Po.prototype.boolean=!1,Po.prototype.commaOrSpaceSeparated=!1,Po.prototype.commaSeparated=!1,Po.prototype.defined=!1,Po.prototype.mustUseProperty=!1,Po.prototype.number=!1,Po.prototype.overloadedBoolean=!1,Po.prototype.property=``,Po.prototype.spaceSeparated=!1,Po.prototype.space=void 0;var Fo=t({boolean:()=>U,booleanish:()=>W,commaOrSpaceSeparated:()=>zo,commaSeparated:()=>Ro,number:()=>G,overloadedBoolean:()=>Lo,spaceSeparated:()=>K}),Io=0,U=Bo(),W=Bo(),Lo=Bo(),G=Bo(),K=Bo(),Ro=Bo(),zo=Bo();function Bo(){return 2**++Io}var Vo=Object.keys(Fo),Ho=class extends Po{constructor(e,t,n,r){let i=-1;if(super(e,t),Uo(this,`space`,r),typeof n==`number`)for(;++i<Vo.length;){let e=Vo[i];Uo(this,Vo[i],(n&Fo[e])===Fo[e])}}};Ho.prototype.defined=!0;function Uo(e,t,n){n&&(e[t]=n)}function Wo(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ho(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[No(r)]=r,n[No(a.attribute)]=r}return new jo(t,n,e.space)}var Go=Wo({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:K,ariaCurrent:null,ariaDescribedBy:K,ariaDetails:null,ariaDisabled:W,ariaDropEffect:K,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:K,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:K,ariaLevel:G,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:K,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:K,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:W,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ko(e,t){return t in e?e[t]:t}function qo(e,t){return Ko(e,t.toLowerCase())}var Jo=Wo({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Ro,acceptCharset:K,accessKey:K,action:null,allow:null,allowFullScreen:U,allowPaymentRequest:U,allowUserMedia:U,alt:null,as:null,async:U,autoCapitalize:null,autoComplete:K,autoFocus:U,autoPlay:U,blocking:K,capture:null,charSet:null,checked:U,cite:null,className:K,cols:G,colSpan:null,content:null,contentEditable:W,controls:U,controlsList:K,coords:G|Ro,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U,defer:U,dir:null,dirName:null,disabled:U,download:Lo,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U,formTarget:null,headers:K,height:G,hidden:Lo,high:G,href:null,hrefLang:null,htmlFor:K,httpEquiv:K,id:null,imageSizes:null,imageSrcSet:null,inert:U,inputMode:null,integrity:null,is:null,isMap:U,itemId:null,itemProp:K,itemRef:K,itemScope:U,itemType:K,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:U,muted:U,name:null,nonce:null,noModule:U,noValidate:U,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:U,optimum:G,pattern:null,ping:K,placeholder:null,playsInline:U,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U,referrerPolicy:null,rel:K,required:U,reversed:U,rows:G,rowSpan:G,sandbox:K,scope:null,scoped:U,seamless:U,selected:U,shadowRootClonable:U,shadowRootDelegatesFocus:U,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:U,useMap:null,value:W,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:K,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U,declare:U,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:U,noHref:U,noShade:U,noWrap:U,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:U,disableRemotePlayback:U,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:qo}),Yo=Wo({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:zo,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:K,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:U,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ro,g2:Ro,glyphName:Ro,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:zo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:K,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zo,rev:zo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zo,requiredFeatures:zo,requiredFonts:zo,requiredFormats:zo,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:zo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zo,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ko}),Xo=Wo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Zo=Wo({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:qo}),Qo=Wo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),$o={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},es=/[A-Z]/g,ts=/-[a-z]/g,ns=/^data[-\w.:]+$/i;function rs(e,t){let n=No(t),r=t,i=Po;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ns.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ts,as);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ts.test(e)){let n=e.replace(es,is);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ho}return new i(r,t)}function is(e){return`-`+e.toLowerCase()}function as(e){return e.charAt(1).toUpperCase()}var os=Mo([Go,Jo,Xo,Zo,Qo],`html`),ss=Mo([Go,Yo,Xo,Zo,Qo],`svg`);function cs(e){return e.join(` `).trim()}var ls=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;t.exports=function(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,d=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
8
- `);d=~n?e.length-n:d+e.length}function p(){var e={line:l,column:d};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:l,column:d},this.source=t.source}m.prototype.content=e;var h=[];function g(n){var r=Error(t.source+`:`+l+`:`+d+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=d,r.source=e,t.silent)h.push(r);else throw r}function _(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function v(){_(i)}function y(e){var t;for(e||=[];t=b();)t!==!1&&e.push(t);return e}function b(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return g(`End of comment missing`);var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:`comment`,comment:r})}}function x(){var e=p(),t=_(a);if(t){if(b(),!_(o))return g(`property missing ':'`);var r=_(s),i=e({type:`declaration`,property:u(t[0].replace(n,``)),value:r?u(r[0].replace(n,``)):``});return _(c),i}}function S(){var e=[];y(e);for(var t;t=x();)t!==!1&&(e.push(t),y(e));return e}return v(),S()};function u(e){return e?e.replace(l,``):``}})),us=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(ls());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),ds=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),fs=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(us()),r=ds();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),ps=hs(`end`),ms=hs(`start`);function hs(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function gs(e){let t=ms(e),n=ps(e);if(t&&n)return{start:t,end:n}}function _s(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ys(e.position):`start`in e||`end`in e?ys(e):`line`in e||`column`in e?vs(e):``}function vs(e){return bs(e&&e.line)+`:`+bs(e&&e.column)}function ys(e){return vs(e&&e.start)+`-`+vs(e&&e.end)}function bs(e){return e&&typeof e==`number`?e:1}var q=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=_s(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};q.prototype.file=``,q.prototype.name=``,q.prototype.reason=``,q.prototype.message=``,q.prototype.stack=``,q.prototype.column=void 0,q.prototype.line=void 0,q.prototype.ancestors=void 0,q.prototype.cause=void 0,q.prototype.fatal=void 0,q.prototype.place=void 0,q.prototype.ruleId=void 0,q.prototype.source=void 0;var xs=e(fs(),1),Ss={}.hasOwnProperty,Cs=new Map,ws=/[A-Z]/g,Ts=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Es=new Set([`td`,`th`]);function Ds(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Rs(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Ls(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?ss:os,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Os(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Os(e,t,n){if(t.type===`element`)return ks(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return As(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ms(e,t,n);if(t.type===`mdxjsEsm`)return js(e,t);if(t.type===`root`)return Ns(e,t,n);if(t.type===`text`)return Ps(e,t)}function ks(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=ss,e.schema=i),e.ancestors.push(t);let a=Ws(e,t.tagName,!1),o=zs(e,t),s=Vs(e,t);return Ts.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ko(e)})),Fs(e,o,a,t),Is(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function As(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Gs(e,t.position)}function js(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gs(e,t.position)}function Ms(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=ss,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Ws(e,t.name,!0),o=Bs(e,t),s=Vs(e,t);return Fs(e,o,a,t),Is(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ns(e,t,n){let r={};return Is(r,Vs(e,t)),e.create(t,e.Fragment,r,n)}function Ps(e,t){return t.value}function Fs(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Is(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ls(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Rs(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ms(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function zs(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ss.call(t.properties,i)){let a=Hs(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Es.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Bs(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Gs(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Gs(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Vs(e,t){let n=[],r=-1,i=e.passKeys?new Map:Cs;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Os(e,a,o);s!==void 0&&n.push(s)}return n}function Hs(e,t,n){let r=rs(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Co(n):cs(n)),r.property===`style`){let t=typeof n==`object`?n:Us(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Ks(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?$o[r.property]||r.property:r.attribute,n]}}function Us(e,t){try{return(0,xs.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new q("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Ws(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Do(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Do(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ss.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Gs(e)}function Gs(e,t){let n=new q("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function Ks(e){let t={},n;for(n in e)Ss.call(e,n)&&(t[qs(n)]=e[n]);return t}function qs(e){let t=e.replace(ws,Js);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Js(e){return`-`+e.toLowerCase()}var Ys={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Xs={};function Zs(e,t){let n=t||Xs;return Qs(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Qs(e,t,n){if(ec(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return $s(e.children,t,n)}return Array.isArray(e)?$s(e,t,n):``}function $s(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Qs(e[i],t,n);return r.join(``)}function ec(e){return!!(e&&typeof e==`object`)}var tc=document.createElement(`i`);function nc(e){let t=`&`+e+`;`;tc.innerHTML=t;let n=tc.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function rc(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ic(e,t){return e.length>0?(rc(e,e.length,0,t),e):t}var ac={}.hasOwnProperty;function oc(e){let t={},n=-1;for(;++n<e.length;)sc(t,e[n]);return t}function sc(e,t){let n;for(n in t){let r=(ac.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ac.call(r,a)||(r[a]=[]);let e=i[a];cc(r[a],Array.isArray(e)?e:e?[e]:[])}}}function cc(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);rc(e,0,0,r)}function lc(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function uc(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var dc=yc(/[A-Za-z]/),J=yc(/[\dA-Za-z]/),fc=yc(/[#-'*+\--9=?A-Z^-~]/);function pc(e){return e!==null&&(e<32||e===127)}var mc=yc(/\d/),hc=yc(/[\dA-Fa-f]/),gc=yc(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var _c=yc(/\p{P}|\p{S}/u),vc=yc(/\s/);function yc(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function bc(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var xc={tokenize:Sc};function Sc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Cc={tokenize:Tc},wc={tokenize:Ec};function Tc(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return rc(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wc,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(wc,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;rc(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ec(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Dc(e){if(e===null||X(e)||vc(e))return 1;if(_c(e))return 2}function Oc(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var kc={name:`attention`,resolveAll:Ac,tokenize:jc};function Ac(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Mc(d,-c),Mc(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ic(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ic(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ic(l,Oc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ic(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ic(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,rc(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function jc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Dc(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Dc(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Mc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Nc={name:`autolink`,tokenize:Pc};function Pc(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return dc(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||J(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||J(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||pc(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):fc(t)?(e.consume(t),l):n(t)}function u(e){return J(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||J(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Fc={partial:!0,tokenize:Ic};function Ic(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var Lc={continuation:{tokenize:zc},exit:Bc,name:`blockQuote`,tokenize:Rc};function Rc(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function zc(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Lc,t,n)(r)}}function Bc(e){e.exit(`blockQuote`)}var Vc={name:`characterEscape`,tokenize:Hc};function Hc(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return gc(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Uc={name:`characterReference`,tokenize:Wc};function Wc(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=J,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=hc,u):(e.enter(`characterReferenceValue`),a=7,o=mc,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===J&&!nc(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Gc={partial:!0,tokenize:Jc},Kc={concrete:!0,name:`codeFenced`,tokenize:qc};function qc(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Gc,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(Gc,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Jc(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Yc={name:`codeIndented`,tokenize:Zc},Xc={partial:!0,tokenize:Qc};function Zc(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(Xc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Qc(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}var $c={name:`codeText`,previous:tl,resolve:el,tokenize:nl};function el(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function tl(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function nl(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var rl=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&il(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),il(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),il(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);il(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);il(this.left,t.reverse())}}}};function il(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function al(e){let t={},n=-1,r,i,a,o,s,c,l,u=new rl(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ol(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return rc(e,0,1/0,u.slice(0)),!l}function ol(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var sl={resolve:ll,tokenize:ul},cl={partial:!0,tokenize:dl};function ll(e){return al(e),e}function ul(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(cl,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function dl(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function fl(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||pc(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||pc(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function pl(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function ml(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function hl(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var gl={name:`definition`,tokenize:vl},_l={partial:!0,tokenize:yl};function vl(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return pl.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=uc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?hl(e,l)(t):l(t)}function l(t){return fl(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(_l,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function yl(e,t,n){return r;function r(t){return X(t)?hl(e,i)(t):n(t)}function i(t){return ml(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var bl={name:`hardBreakEscape`,tokenize:xl};function xl(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Sl={name:`headingAtx`,resolve:Cl,tokenize:wl};function Cl(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},rc(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function wl(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Tl=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),El=[`pre`,`script`,`style`,`textarea`],Dl={concrete:!0,name:`htmlFlow`,resolveTo:Al,tokenize:jl},Ol={partial:!0,tokenize:Nl},kl={partial:!0,tokenize:Ml};function Al(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function jl(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):dc(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):dc(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return dc(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&El.includes(l)?(i=1,r.interrupt?t(s):O(s)):Tl.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||J(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||dc(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ol,F,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(kl,ee,F)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),P):O(t)}function j(t){return t===47?(e.consume(t),o=``,M):O(t)}function M(t){if(t===62){let n=o.toLowerCase();return El.includes(n)?(e.consume(t),ne):O(t)}return dc(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),F(t)):(e.consume(t),ne)}function F(n){return e.exit(`htmlFlow`),t(n)}}function Ml(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Nl(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Fc,t,n)}}var Pl={name:`htmlText`,tokenize:Fl};function Fl(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):dc(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):dc(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):Y(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return dc(t)?(e.consume(t),S):n(t)}function S(t){return t===45||J(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,j(t)):Z(t)?(e.consume(t),C):A(t)}function w(t){return t===45||J(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||dc(t)?(e.consume(t),E):Y(t)?(o=T,j(t)):Z(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,j(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,j(t)):Z(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):Y(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||X(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),M}function M(t){return Z(t)?Q(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var Il={name:`labelEnd`,resolveAll:Bl,resolveTo:Vl,tokenize:Hl},Ll={tokenize:Ul},Rl={tokenize:Wl},zl={tokenize:Gl};function Bl(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&rc(e,0,e.length,n),e}function Vl(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=ic(s,e.slice(a+1,a+r+3)),s=ic(s,[[`enter`,u,t]]),s=ic(s,Oc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ic(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ic(s,e.slice(o+1)),s=ic(s,[[`exit`,c,t]]),rc(e,a,e.length,s),e}function Hl(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(uc(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ll,u,o?u:d)(t):t===91?e.attempt(Rl,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(zl,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Ul(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?hl(e,a)(t):a(t)}function a(t){return t===41?u(t):fl(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?hl(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?ml(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?hl(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Wl(e,t,n){let r=this;return i;function i(t){return pl.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(uc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Gl(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Kl={name:`labelStartImage`,resolveAll:Il.resolveAll,tokenize:ql};function ql(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Jl={name:`labelStartLink`,resolveAll:Il.resolveAll,tokenize:Yl};function Yl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Xl={name:`lineEnding`,tokenize:Zl};function Zl(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var Ql={name:`thematicBreak`,tokenize:$l};function $l(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var eu={continuation:{tokenize:iu},exit:ou,name:`list`,tokenize:ru},tu={partial:!0,tokenize:su},nu={partial:!0,tokenize:au};function ru(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:mc(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ql,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return mc(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Fc,r.interrupt?n:u,e.attempt(tu,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function iu(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Fc,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nu,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(eu,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function au(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ou(e){e.exit(this.containerState.type)}function su(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var cu={name:`setextUnderline`,resolveTo:lu,tokenize:uu};function lu(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function uu(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var du={tokenize:fu};function fu(e){let t=this,n=e.attempt(Fc,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(sl,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var pu={resolveAll:_u()},mu=gu(`string`),hu=gu(`text`);function gu(e){return{resolveAll:_u(e===`text`?vu:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function _u(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function vu(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var yu=t({attentionMarkers:()=>Du,contentInitial:()=>xu,disable:()=>Ou,document:()=>bu,flow:()=>Cu,flowInitial:()=>Su,insideSpan:()=>Eu,string:()=>wu,text:()=>Tu}),bu={42:eu,43:eu,45:eu,48:eu,49:eu,50:eu,51:eu,52:eu,53:eu,54:eu,55:eu,56:eu,57:eu,62:Lc},xu={91:gl},Su={[-2]:Yc,[-1]:Yc,32:Yc},Cu={35:Sl,42:Ql,45:[cu,Ql],60:Dl,61:cu,95:Ql,96:Kc,126:Kc},wu={38:Uc,92:Vc},Tu={[-5]:Xl,[-4]:Xl,[-3]:Xl,33:Kl,38:Uc,42:kc,60:[Nc,Pl],91:Jl,92:[bl,Vc],93:Il,95:kc,96:$c},Eu={null:[kc,pu]},Du={null:[42,95]},Ou={null:[]};function ku(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ic(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Oc(a,l.events,l),l.events):[]}function f(e,t){return ju(p(e),t)}function p(e){return Au(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&rc(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Au(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ju(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
9
- `;break;case-3:o=`\r
10
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Mu(e){let t={constructs:oc([yu,...(e||{}).extensions||[]]),content:n(xc),defined:[],document:n(Cc),flow:n(du),lazy:{},string:n(mu),text:n(hu)};return t;function n(e){return n;function n(n){return ku(t,e,n)}}}function Nu(e){for(;!al(e););return e}var Pu=/[\0\t\n\r]/g;function Fu(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Pu.lastIndex=u,c=Pu.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Iu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Lu(e){return e.replace(Iu,Ru)}function Ru(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return lc(n.slice(t?2:1),t?16:10)}return nc(n)||e}var zu={}.hasOwnProperty;function Bu(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),Vu(n)(Nu(Mu(n).document().write(Fu()(e,t,!0))))}function Vu(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(pe),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(ue,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(fe),hardBreakEscape:a(me),hardBreakTrailing:a(me),htmlFlow:a(he,o),htmlFlowData:T,htmlText:a(he,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(pe),strong:a(xe),thematicBreak:a(Ce)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:I,characterReferenceMarkerNumeric:I,characterReferenceValue:L,characterReference:ae,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(j),label:N,labelText:M,lineEnding:D,link:c(A),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:P,resourceTitleString:ne,resource:F,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Uu(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];zu.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Gu).call(a,void 0,e[0])}for(r.position={start:Hu(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Hu(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Hu(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Gu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+_s({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Hu(e.end)}function u(){return Zs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uc(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Se(),n.position={start:Hu(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Hu(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Hu(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Lu(t),n.identifier=uc(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function F(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function I(e){this.data.characterReferenceType=e.type}function L(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=lc(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=nc(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=Hu(e.end)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function ue(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function fe(){return{type:`emphasis`,children:[]}}function pe(){return{type:`heading`,depth:0,children:[]}}function me(){return{type:`break`}}function he(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Se(){return{type:`text`,value:``}}function Ce(){return{type:`thematicBreak`}}}function Hu(e){return{line:e.line,column:e.column,offset:e.offset}}function Uu(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Uu(e,r):Wu(e,r)}}function Wu(e,t){let n;for(n in t)if(zu.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Gu(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+_s({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_s({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+_s({start:t.start,end:t.end})+`) is still open`)}function Ku(e){let t=this;t.parser=n;function n(n){return Bu(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function qu(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ju(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
11
- `}]}function Yu(e,t){let n=t.value?t.value+`
12
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Xu(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zu(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qu(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=bc(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function $u(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ed(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function td(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function nd(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return td(e,t);let i={src:bc(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function rd(e,t){let n={src:bc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function id(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function ad(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return td(e,t);let i={href:bc(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function od(e,t){let n={href:bc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function sd(e,t,n){let r=e.all(t),i=n?cd(n):ld(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
13
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
14
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function cd(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=ld(n[r])}return t}function ld(e){return e.spread??e.children.length>1}function ud(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function dd(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fd(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pd(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function md(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ms(t.children[1]),o=ps(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function hd(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function gd(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var _d=9,vd=32;function yd(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(bd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(bd(t.slice(i),i>0,!1)),a.join(``)}function bd(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===_d||t===vd;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===_d||t===vd;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function xd(e,t){let n={type:`text`,value:yd(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Sd(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Cd={blockquote:qu,break:Ju,code:Yu,delete:Xu,emphasis:Zu,footnoteReference:Qu,heading:$u,html:ed,imageReference:nd,image:rd,inlineCode:id,linkReference:ad,link:od,listItem:sd,list:ud,paragraph:dd,root:fd,strong:pd,table:md,tableCell:gd,tableRow:hd,text:xd,thematicBreak:Sd,toml:wd,yaml:wd,definition:wd,footnoteDefinition:wd};function wd(){}var Td=typeof self==`object`?self:globalThis,Ed=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new Td[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new Td[a](o),i)};return r},Dd=e=>Ed(new Map,e)(0),Od=``,{toString:kd}={},{keys:Ad}=Object,jd=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=kd.call(e).slice(8,-1);switch(n){case`Array`:return[1,Od];case`Object`:return[2,Od];case`Date`:return[3,Od];case`RegExp`:return[4,Od];case`Map`:return[5,Od];case`Set`:return[6,Od];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},Md=([e,t])=>e===0&&(t===`function`||t===`symbol`),Nd=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=jd(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Ad(r))(e||!Md(jd(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Md(jd(n))||Md(jd(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Md(jd(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Pd=(e,{json:t,lossy:n}={})=>{let r=[];return Nd(!(t||n),!!t,new Map,r)(e),r},Fd=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Dd(Pd(e,t)):structuredClone(e):(e,t)=>Dd(Pd(e,t));function Id(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Ld(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Rd(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Id,r=e.options.footnoteBackLabel||Ld,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=bc(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Fd(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
15
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
16
- `}]}}var zd=(function(e){if(e==null)return Wd;if(typeof e==`function`)return Ud(e);if(typeof e==`object`)return Array.isArray(e)?Bd(e):Vd(e);if(typeof e==`string`)return Hd(e);throw Error(`Expected function, string, or object as test`)});function Bd(e){let t=[],n=-1;for(;++n<e.length;)t[n]=zd(e[n]);return Ud(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Vd(e){let t=e;return Ud(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Hd(e){return Ud(t);function t(t){return t&&t.type===e}}function Ud(e){return t;function t(t,n,r){return!!(Gd(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Wd(){return!0}function Gd(e){return typeof e==`object`&&!!e&&`type`in e}function Kd(e){return e}var qd=[];function Jd(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=zd(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Kd(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=qd,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Yd(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Yd(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?qd:[e]}function Xd(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Jd(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Zd={}.hasOwnProperty,Qd={};function $d(e,t){let n=t||Qd,r=new Map,i=new Map,a={all:s,applyData:tf,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Cd,...n.handlers},one:o,options:n,patch:ef,wrap:rf};return Xd(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Zd.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Fd(n);return r.children=a.all(e),r}return Fd(e)}return(a.options.unknownHandler||nf)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=af(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=af(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function ef(e,t){e.position&&(t.position=gs(e))}function tf(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Fd(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function nf(e,t){let n=t.data||{},r=`value`in t&&!(Zd.call(n,`hProperties`)||Zd.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rf(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
17
- `});++r<e.length;)r&&n.push({type:`text`,value:`
18
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
19
- `}),n}function af(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function of(e,t){let n=$d(e,t),r=n.one(e,void 0),i=Rd(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
20
- `},i)),a}function sf(e,t){return e&&`run`in e?async function(n,r){let i=of(n,{file:r,...t});await e.run(i,r)}:function(n,r){return of(n,{file:r,...e||t})}}function cf(e){if(e)throw e}var lf=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function uf(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function df(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?ff(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function ff(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var pf={basename:mf,dirname:hf,extname:gf,join:_f,sep:`/`};function mf(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);bf(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function hf(e){if(bf(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function gf(e){bf(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function _f(...e){let t=-1,n;for(;++t<e.length;)bf(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:vf(n)}function vf(e){bf(e);let t=e.codePointAt(0)===47,n=yf(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function yf(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function bf(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var xf={cwd:Sf};function Sf(){return`/`}function Cf(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function wf(e){if(typeof e==`string`)e=new URL(e);else if(!Cf(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Tf(e)}function Tf(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Ef=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Df=class{constructor(e){let t;t=e?Cf(e)?{path:e}:typeof e==`string`||jf(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:xf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ef.length;){let e=Ef[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Ef.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?pf.basename(this.path):void 0}set basename(e){kf(e,`basename`),Of(e,`basename`),this.path=pf.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?pf.dirname(this.path):void 0}set dirname(e){Af(this.basename,`dirname`),this.path=pf.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?pf.extname(this.path):void 0}set extname(e){if(Of(e,`extname`),Af(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=pf.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Cf(e)&&(e=wf(e)),kf(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?pf.basename(this.path,this.extname):void 0}set stem(e){kf(e,`stem`),Of(e,`stem`),this.path=pf.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new q(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Of(e,t){if(e&&e.includes(pf.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+pf.sep+"`")}function kf(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Af(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function jf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Mf=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Nf=e(lf(),1),Pf={}.hasOwnProperty,Ff=new class e extends Mf{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=df()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Nf.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Rf(`data`,this.frozen),this.namespace[e]=t,this):Pf.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Rf(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Vf(e),n=this.parser||this.Parser;return If(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),If(`process`,this.parser||this.Parser),Lf(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Vf(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Uf(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),If(`processSync`,this.parser||this.Parser),Lf(`processSync`,this.compiler||this.Compiler),this.process(e,r),Bf(`processSync`,`process`,t),n;function r(e,r){t=!0,cf(e),n=r}}run(e,t,n){zf(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Vf(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Bf(`runSync`,`run`,n),r;function i(e,t){cf(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Vf(t),r=this.compiler||this.Compiler;return Lf(`stringify`,r),zf(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Rf(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Nf.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];uf(o)&&uf(r)&&(r=(0,Nf.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function If(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Lf(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Rf(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zf(e){if(!uf(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Bf(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Vf(e){return Hf(e)?e:new Df(e)}function Hf(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Uf(e){return typeof e==`string`||Wf(e)}function Wf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Gf=[],Kf={allowDangerousHtml:!0},qf=/^(https?|ircs?|mailto|xmpp)$/i,Jf=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Yf(e){let t=Xf(e),n=Zf(e);return Qf(t.runSync(t.parse(n),n),e)}function Xf(e){let t=e.rehypePlugins||Gf,n=e.remarkPlugins||Gf,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Kf}:Kf;return Ff().use(Ku).use(n).use(sf,r).use(t)}function Zf(e){let t=e.children||``,n=new Df;return typeof t==`string`?n.value=t:``+t,n}function Qf(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||$f;for(let e of Jf)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Xd(e,l),Ds(e,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Ys)if(Object.hasOwn(Ys,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Ys[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function $f(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||qf.test(e.slice(0,t))?e:``}function ep(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function tp(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function np(e,t,n){let r=zd((n||{}).ignore||[]),i=rp(t),a=-1;for(;++a<i.length;)Jd(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function rp(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ip(e[0]),ap(e[1])])}return t}function ip(e){return typeof e==`string`?new RegExp(tp(e),`g`):e}function ap(e){return typeof e==`function`?e:function(){return e}}var op=`phrasing`,sp=[`autolink`,`link`,`image`,`label`];function cp(){return{transforms:[gp],enter:{literalAutolink:up,literalAutolinkEmail:dp,literalAutolinkHttp:dp,literalAutolinkWww:dp},exit:{literalAutolink:hp,literalAutolinkEmail:mp,literalAutolinkHttp:fp,literalAutolinkWww:pp}}}function lp(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:op,notInConstruct:sp},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:op,notInConstruct:sp},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:op,notInConstruct:sp}]}}function up(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function dp(e){this.config.enter.autolinkProtocol.call(this,e)}function fp(e){this.config.exit.autolinkProtocol.call(this,e)}function pp(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function mp(e){this.config.exit.autolinkEmail.call(this,e)}function hp(e){this.exit(e)}function gp(e){np(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_p],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,vp]],{ignore:[`link`,`linkReference`]})}function _p(e,t,n,r,i){let a=``;if(!xp(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!yp(n)))return!1;let o=bp(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function vp(e,t,n,r){return!xp(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function yp(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function bp(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=ep(e,`(`),a=ep(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function xp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||vc(n)||_c(n))&&(!t||n!==47)}jp.peek=Ap;function Sp(){this.buffer()}function Cp(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function wp(){this.buffer()}function Tp(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Ep(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Dp(e){this.exit(e)}function Op(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kp(e){this.exit(e)}function Ap(){return`[`}function jp(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Mp(){return{enter:{gfmFootnoteCallString:Sp,gfmFootnoteCall:Cp,gfmFootnoteDefinitionLabelString:wp,gfmFootnoteDefinition:Tp},exit:{gfmFootnoteCallString:Ep,gfmFootnoteCall:Dp,gfmFootnoteDefinitionLabelString:Op,gfmFootnoteDefinition:kp}}}function Np(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:jp},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
21
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Fp:Pp))),s(),o}}function Pp(e,t,n){return t===0?e:Fp(e,t,n)}function Fp(e,t,n){return(n?``:` `)+e}var Ip=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Vp.peek=Hp;function Lp(){return{canContainEols:[`delete`],enter:{strikethrough:zp},exit:{strikethrough:Bp}}}function Rp(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Ip}],handlers:{delete:Vp}}}function zp(e){this.enter({type:`delete`,children:[]},e)}function Bp(e){this.exit(e)}function Vp(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Hp(){return`~`}function Up(e){return e.length}function Wp(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Up,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Gp(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Kp(r[d]);else{let e=Kp(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
22
- `)}function Gp(e){return e==null?``:String(e)}function Kp(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function qp(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Jp);return i(),o}function Jp(e,t,n){return`>`+(n?``:` `)+e}function Yp(e,t){return Xp(e,t.inConstruct,!0)&&!Xp(e,t.notInConstruct,!1)}function Xp(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Zp(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
23
- `&&Yp(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
24
- `}function Qp(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function $p(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function em(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function tm(e,t,n,r){let i=em(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if($p(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,nm);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Qp(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
25
- `,encode:["`"],...s.current()})),t()}return u+=s.move(`
26
- `),a&&(u+=s.move(a+`
27
- `)),u+=s.move(c),l(),u}function nm(e,t,n){return(n?``:` `)+e}function rm(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function im(e,t,n,r){let i=rm(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
28
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function am(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function om(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function sm(e,t,n){let r=Dc(e),i=Dc(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cm.peek=lm;function cm(e,t,n,r){let i=am(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=sm(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=om(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=sm(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+om(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function lm(e,t,n){return n.options.emphasis||`*`}function um(e,t){let n=!1;return Xd(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Zs(e)&&(t.options.setext||n))}function dm(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(um(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
29
- `,after:`
30
- `});return r(),t(),o+`
31
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
32
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
33
- `,...a.current()});return/^[\t ]/.test(l)&&(l=om(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}fm.peek=pm;function fm(e){return e.value||``}function pm(){return`<`}mm.peek=hm;function mm(e,t,n,r){let i=rm(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function hm(){return`!`}gm.peek=_m;function gm(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function _m(){return`!`}vm.peek=ym;function vm(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function ym(){return"`"}function bm(e,t){let n=Zs(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}xm.peek=Sm;function xm(e,t,n,r){let i=rm(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(bm(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Sm(e,t,n){return bm(e,n)?`<`:`[`}Cm.peek=wm;function Cm(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function wm(){return`[`}function Tm(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Em(e){let t=Tm(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Dm(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Om(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function km(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Dm(n):Tm(n),s=e.ordered?o===`.`?`)`:`.`:Em(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Om(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Am(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function jm(e,t,n,r){let i=Am(n),a=n.bulletCurrent||Tm(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Mm(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Nm=zd([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Pm(e,t,n,r){return(e.children.some(function(e){return Nm(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Fm(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Im.peek=Lm;function Im(e,t,n,r){let i=Fm(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=sm(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=om(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=sm(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+om(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Lm(e,t,n){return n.options.strong||`*`}function Rm(e,t,n,r){return n.safe(e.value,r)}function zm(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Bm(e,t,n){let r=(Om(n)+(n.options.ruleSpaces?` `:``)).repeat(zm(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Vm={blockquote:qp,break:Zp,code:tm,definition:im,emphasis:cm,hardBreak:Zp,heading:dm,html:fm,image:mm,imageReference:gm,inlineCode:vm,link:xm,linkReference:Cm,list:km,listItem:jm,paragraph:Mm,root:Pm,strong:Im,text:Rm,thematicBreak:Bm};function Hm(){return{enter:{table:Um,tableData:qm,tableHeader:qm,tableRow:Gm},exit:{codeText:Jm,table:Wm,tableData:Km,tableHeader:Km,tableRow:Km}}}function Um(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Wm(e){this.exit(e),this.data.inTable=void 0}function Gm(e){this.enter({type:`tableRow`,children:[]},e)}function Km(e){this.exit(e)}function qm(e){this.enter({type:`tableCell`,children:[]},e)}function Jm(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ym));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ym(e,t){return t===`|`?t:e}function Xm(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
34
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
35
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Wp(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Vm.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Zm(){return{exit:{taskListCheckValueChecked:$m,taskListCheckValueUnchecked:$m,paragraph:eh}}}function Qm(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:th}}}function $m(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function eh(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function th(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Vm.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function nh(){return[cp(),Mp(),Lp(),Hm(),Zm()]}function rh(e){return{extensions:[lp(),Np(e),Rp(),Xm(e),Qm()]}}var ih={tokenize:vh,partial:!0},ah={tokenize:yh,partial:!0},oh={tokenize:bh,partial:!0},sh={tokenize:xh,partial:!0},ch={tokenize:Sh,partial:!0},lh={name:`wwwAutolink`,tokenize:gh,previous:Ch},uh={name:`protocolAutolink`,tokenize:_h,previous:wh},dh={name:`emailAutolink`,tokenize:hh,previous:Th},fh={};function ph(){return{text:fh}}for(var mh=48;mh<123;)fh[mh]=dh,mh++,mh===58?mh=65:mh===91&&(mh=97);fh[43]=dh,fh[45]=dh,fh[46]=dh,fh[95]=dh,fh[72]=[dh,uh],fh[104]=[dh,uh],fh[87]=[dh,lh],fh[119]=[dh,lh];function hh(e,t,n){let r=this,i,a;return o;function o(t){return!Eh(t)||!Th.call(r,r.previous)||Dh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Eh(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ch,u,l)(t):t===45||t===95||J(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&dc(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function gh(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Ch.call(r,r.previous)||Dh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(ih,e.attempt(ah,e.attempt(oh,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function _h(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&wh.call(r,r.previous)&&!Dh(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(dc(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||pc(t)||X(t)||vc(t)||_c(t)?n(t):e.attempt(ah,e.attempt(oh,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function vh(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function yh(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(sh,c,s)(t):t===null||X(t)||vc(t)||t!==45&&_c(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function bh(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(sh,t,a)(o):o===null||X(o)||vc(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function xh(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||vc(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||vc(e)?t(e):r(e)}function a(e){return dc(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):dc(t)?(e.consume(t),o):n(t)}}function Sh(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return J(e)?n(e):t(e)}}function Ch(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function wh(e){return!dc(e)}function Th(e){return!(e===47||Eh(e))}function Eh(e){return e===43||e===45||e===46||e===95||J(e)}function Dh(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Oh={tokenize:Ih,partial:!0};function kh(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Nh,continuation:{tokenize:Ph},exit:Fh}},text:{91:{name:`gfmFootnoteCall`,tokenize:Mh},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ah,resolveTo:jh}}}}function Ah(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=uc(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function jh(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Mh(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(uc(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Nh(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=uc(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Ph(e,t,n){return e.check(Fc,t,e.attempt(Oh,t,n))}function Fh(e){e.exit(`gfmFootnoteDefinition`)}function Ih(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Lh(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&rc(o,o.length,0,Oc(s,e.slice(r+1,n),t)),rc(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),rc(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Dc(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Dc(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Rh=class{constructor(){this.map=[]}add(e,t,n){zh(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function zh(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Bh(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Vh(){return{flow:{null:{name:`table`,tokenize:Hh,resolveAll:Uh}}}}function Hh(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Uh(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Rh;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Gh(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Wh(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Wh(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Wh(f,t,o,i,n,d)):(o[0]=o[1],d=Wh(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Gh(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Bh(t.events,n))}return e}function Wh(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Kh(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Kh(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Kh(t.events,n[2]),a=Kh(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Kh(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Gh(e,t,n,r,i){let a=[],o=Kh(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Kh(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var qh={name:`tasklistCheck`,tokenize:Yh};function Jh(){return{text:{91:qh}}}function Yh(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:Xh},t,n)(r):n(r)}}function Xh(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Zh(e){return oc([ph(),kh(),Lh(e),Vh(),Jh()])}var Qh={};function $h(e){let t=this,n=e||Qh,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Zh(n)),a.push(nh()),o.push(rh(n))}function eg({name:e}){return(0,H.jsxs)(`div`,{className:`max-w-3xl px-6 pt-10 text-muted-foreground select-none`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-lg font-medium`,children:[(0,H.jsx)(Fr,{className:`size-5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e})]}),(0,H.jsx)(`p`,{className:`mt-2 text-sm`,children:`This folder doesn't have a README. A few things you can do with it:`}),(0,H.jsxs)(`ul`,{className:`mt-4 space-y-2 text-sm`,children:[(0,H.jsx)(tg,{icon:(0,H.jsx)(Pr,{className:`size-4 shrink-0`}),children:`Drag and drop files or folders onto it to move them in.`}),(0,H.jsx)(tg,{icon:(0,H.jsx)(Xr,{className:`size-4 shrink-0`}),children:`Use the toolbar above to add a file or directory, rename, or download.`}),(0,H.jsx)(tg,{icon:(0,H.jsx)(Kr,{className:`size-4 shrink-0`}),children:`Right-click the folder for more actions.`})]})]})}function tg({icon:e,children:t}){return(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e,(0,H.jsx)(`span`,{children:t})]})}async function ng({instanceClient:e,entityType:t,project:n,file:r,key:i,value:a}){let{data:o}=await e.post(`/`,{operation:`set_env_value`,project:n,file:r,key:i,value:a,replicated:t===`cluster`});return o}function rg(){return C({mutationFn:ng})}async function ig({instanceClient:e,entityType:t,project:n,file:r,key:i}){let{data:a}=await e.post(`/`,{operation:`delete_env_value`,project:n,file:r,key:i,replicated:t===`cluster`});return a}function ag(){return C({mutationFn:ig})}var og=new Set(`assert.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.domain.events.fs.http.http2.https.inspector.module.net.os.path.perf_hooks.process.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.trace_events.tty.url.util.v8.vm.wasi.worker_threads.zlib`.split(`.`)),sg=/\.(svg|png|jpe?g|gif|webp|avif|ico|bmp|css|scss|sass|less|json|wasm|txt|md|html)$/i,cg=/^(?:@[a-z0-9\-~][a-z0-9\-._~]*\/)?[a-z0-9\-~][a-z0-9\-._~]*(?:\/[a-z0-9\-._~/]+)?$/i,lg=214,ug=1024;function dg(e){let t=e.indexOf(`/`);if(t<0)return e;if(!e.startsWith(`@`))return e.slice(0,t);let n=e.indexOf(`/`,t+1);return n<0?e:e.slice(0,n)}function fg(e){if(!e||e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`@/`)||e.startsWith(`node:`)||sg.test(e))return!1;let t=dg(e);return t===`harper`||t===`harperdb`||og.has(t)?!1:e.length<=ug&&t.length<=lg&&cg.test(e)}var pg=4096,mg=47,hg=42,gg=10,_g=39,vg=34,yg=40,bg=41,xg=123,Sg=125,Cg=44,wg=96,Tg=92,Eg=36,Dg=46,Og=91,kg=93,Ag=60,jg=62;function Mg(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function Ng(e){return e===32||e>=9&&e<=13||e===160||e===65279||e>=8192&&e<=8202||e===8232||e===8233||e===12288}function Pg(e,t,n){let r=t;for(;r<n&&Ng(e.charCodeAt(r));)r++;return r}function Fg(e,t,n,r){for(let i=n;i<r;i++)if(e.charCodeAt(i)===t)return i;return-1}function Ig(e,t,n,r,i){for(let a=r;a+1<i;a++)if(e.charCodeAt(a)===t&&e.charCodeAt(a+1)===n)return a;return-1}function Lg(e,t,n){let r=Pg(e,t,n),i=e.charCodeAt(r);if(r>=n||i!==_g&&i!==vg)return;let a=Math.min(n,r+ug+2);for(let t=r+1;t<a;t++){let n=e.charCodeAt(t);if(n===i)return t===r+1?void 0:{specifier:e.slice(r+1,t),end:t+1};if(n===_g||n===vg)return}}function Rg(e,t){let n=Math.min(e.length,t+pg),r=t;for(;r<n;){let t=e.charCodeAt(r);if(t===mg){let t=e.charCodeAt(r+1);if(t===mg){let t=Fg(e,gg,r+2,n);if(t<0)return;r=t+1}else if(t===hg){let t=Ig(e,hg,mg,r+2,n);if(t<0)return;r=t+2}else return;continue}if(Mg(t)){let t=r+1;for(;t<n&&Mg(e.charCodeAt(t));)t++;if(t-r===4&&e.startsWith(`from`,r)){let r=Lg(e,t,n);if(r)return r}r=t;continue}if(t===xg||t===Sg||t===Cg||t===hg||Ng(t)){r++;continue}return}}var zg=/\/\/\/\s*<reference\s+path\s*=\s*['"]([^'"]+)['"]/g;function Bg(e,t,n){let r=Math.min(e.length,n+pg);if(t!==`export`){let t=Pg(e,n,r);if(e.charCodeAt(t)===yg){let n=Lg(e,t+1,r);if(!n)return;let i=Pg(e,n.end,r);return e.charCodeAt(i)===bg?{specifier:n.specifier,end:i+1}:void 0}}if(t!==`require`)return(t===`import`?Lg(e,n,r):void 0)??Rg(e,n)}function Vg(e,t,n){let r=e.charCodeAt(t);for(let i=t+1;i<n;i++){let n=e.charCodeAt(i);if(n===Tg)i++;else if(n===r)return i+1;else if(n===gg)return t+1}return n}function Hg(e,t,n){let r=!1;for(let i=t+1;i<n;i++){let n=e.charCodeAt(i);if(n===Tg)i++;else if(n===gg)return t+1;else if(n===Og)r=!0;else if(n===kg)r=!1;else if(n===mg&&!r)return i+1}return t+1}var Ug=new Set([`return`,`typeof`,`instanceof`,`case`,`in`,`of`,`delete`,`void`,`new`,`do`,`else`,`yield`,`await`]),Wg=new Set([`if`,`while`,`for`,`switch`,`catch`,`with`]);function Gg(e,t,n){return Mg(e)?Ug.has(t):e===bg?n:e!==kg&&e!==_g&&e!==vg&&e!==wg}var Kg=0,qg=1,Jg=2,Yg=3;function Xg(e){let t=[],n=[],r=[],i=!1,a=0,o=``,s=0;for(;s<e.length;){let c=e.charCodeAt(s),l=n[n.length-1],u=l?.kind;if(u===Kg){c===Tg?s+=2:c===wg?(n.pop(),a=wg,s++):c===Eg&&e.charCodeAt(s+1)===xg?(n.push({kind:qg,braces:0}),a=xg,o=``,s+=2):s++;continue}if(u===Yg){if(c===xg)n.push({kind:qg,braces:0}),a=xg,o=``,s++;else if(c===Ag){if(e.charCodeAt(s+1)===mg){let t=e.indexOf(`>`,s+2);n.pop(),a=jg,o=``,s=t<0?e.length:t+1}else n.push({kind:Jg,braces:0}),s++}else s++;continue}if(u===Jg){c===_g||c===vg?s=Vg(e,s,e.length):c===xg?(n.push({kind:qg,braces:0}),a=xg,o=``,s++):c===mg&&e.charCodeAt(s+1)===jg?(n.pop(),a=jg,o=``,s+=2):(c===jg&&(n[n.length-1]={kind:Yg,braces:0}),s++);continue}if(c===mg){let t=e.charCodeAt(s+1);if(t===mg){let t=e.indexOf(`
36
- `,s+2);s=t<0?e.length:t+1;continue}if(t===hg){let t=e.indexOf(`*/`,s+2);s=t<0?e.length:t+2;continue}s=Gg(a,o,i)?Hg(e,s,e.length):s+1,a=mg,o=``;continue}if(c===_g||c===vg){s=Vg(e,s,e.length),a=c,o=``;continue}if(c===wg){n.push({kind:Kg,braces:0}),s++;continue}if(c===Ag&&Gg(a,o,i)){let t=e.charCodeAt(s+1);if(t===jg||Mg(t)){n.push({kind:t===jg?Yg:Jg,braces:0}),s+=t===jg?2:1;continue}}if(u===qg){if(c===xg)l.braces++;else if(c===Sg){if(l.braces===0){n.pop(),a=Sg,o=``,s++;continue}l.braces--}}if(c===yg?r.push(Wg.has(o)):c===bg&&(i=r.pop()??!1),Mg(c)){let n=s+1;for(;n<e.length&&Mg(e.charCodeAt(n));)n++;let r=e.slice(s,n),i=a!==Dg&&(r===`import`||r===`export`||r===`require`)?Bg(e,r,n):void 0;if(i){t.push({specifier:i.specifier,pos:s,end:i.end}),a=e.charCodeAt(i.end-1),o=``,s=i.end;continue}a=e.charCodeAt(n-1),o=r,s=n;continue}Ng(c)||(a=c,o=``),s++}return t}function Zg(){return{libMap:new Map,preProcessFile(e){let t=Xg(e).filter(({specifier:e})=>fg(e)).map(({specifier:e,pos:t,end:n})=>({fileName:e,pos:t,end:n})),n=[];for(let t of e.matchAll(zg)){let e=t.index??0;n.push({fileName:t[1],pos:e,end:e+t[0].length})}return{referencedFiles:n,importedFiles:t,libReferenceDirectives:[],typeReferenceDirectives:[],ambientExternalModules:[],isLibFile:!1}}}}var Qg,$g=new Set,e_=new yn;function t_(){return Qg||=ee(async()=>{let{setupTypeAcquisition:e}=await import(`./dist-D5VV8yNp.js`);return{setupTypeAcquisition:e}},[]).then(({setupTypeAcquisition:e})=>{let{typescriptDefaults:t,javascriptDefaults:n}=sr;return e({projectName:`Harper Application`,typescript:Zg(),delegate:{receivedFile(e,r){if($g.has(r))return;$g.add(r);let{admitted:i,justExhausted:a,oversize:o}=e_.admit(e.length);if(!i){a?console.warn(`[harper] type acquisition: extra-lib budget exhausted; further packages will report "cannot find module" in this tab`):o&&console.debug(`[harper] type acquisition: skipped oversized declaration ${r} (${e.length} chars)`);return}let s=`file://${r}`;t.addExtraLib(e,s),n.addExtraLib(e,s)}}})}),Qg}function n_(){return e_.isSpent}async function r_(e){if(e.length!==0&&!e_.isSpent)try{await(await t_())(e.join(`
37
- ;
38
- `))}catch(e){console.warn(`[harper] type acquisition unavailable`,e)}}function i_(e,t,n){let r=[],i=0,a=t,o=n;for(let t of e){if(a>=150||o+t.content.length>4194304){i++;continue}r.push(t),a++,o+=t.content.length}return{selected:r,dropped:i}}function a_(e,t){let n=0;for(let r of e){let e=r.uri.toString();e.startsWith(`file:///`)&&(t&&e.startsWith(t)||r.isAttachedToEditor()||(r.dispose(),n++))}return n}function o_(e,t,n){let r=e.filter(e=>e.uri.toString().startsWith(`file:///`)),i=r.length-n;if(i<=0)return 0;let a=0;for(let e of r){if(i<=0)break;e.uri.toString()===t||e.isAttachedToEditor()||(e.dispose(),i--,a++)}return a}var s_=/\.(tsx?|jsx?|mjs|cjs|mts|cts|json)$/i,c_=/(^|\/)(tsconfig.*|jsconfig)\.json$/i,l_=/^(node_modules|dist|build|out|coverage|\.git|\.next|\.turbo|\.cache)$/i,u_=/^(package-lock\.json|pnpm-lock\.yaml|yarn\.lock)$/i,d_=5;function f_(e){return/\.json$/i.test(e)?`json`:/\.(jsx?|mjs|cjs)$/i.test(e)?`javascript`:`typescript`}function p_(e,t){let n=e.find(e=>e.name===t);if(!n||!z(n))return[];let r=[],i=e=>{for(let t of e)z(t)?l_.test(t.name)||i(t.entries):s_.test(t.path)&&!u_.test(t.name)&&r.push(t.path)};return i(n.entries),r}function m_(e){return e.replace(/"(?:\\.|[^"\\])*"|\/\/[^\n\r]*|\/\*[\s\S]*?\*\//g,e=>e.startsWith(`"`)?e:``)}function h_(e,t){return!t||t===`.`||t===`./`?e:`${e}/${t.replace(/^\.\//,``).replace(/^\/+/,``).replace(/\/+$/,``)}`}function g_(e,t){let n=`file:///${e}`,r=n,i={"@/*":[`src/*`]};if(t)try{let e=JSON.parse(m_(t)).compilerOptions??{};e.baseUrl&&(r=h_(n,e.baseUrl)),e.paths&&typeof e.paths==`object`&&(i=e.paths)}catch{}return{baseUrl:r,paths:i}}function __(e,t){let{baseUrl:n,paths:r}=g_(e,t),{typescriptDefaults:i,javascriptDefaults:a}=sr;for(let e of[i,a])e.setCompilerOptions({...e.getCompilerOptions(),baseUrl:n,paths:r})}var v_;function y_(e){return e===void 0?void 0:rr.parse(`file:///${e}/`).toString()}function b_(e,t){let n=He(),r=S(),[i,a]=(0,B.useState)(n_),o=e&&!e.package?e.project:void 0,s=e?.project,c=(0,B.useMemo)(()=>o?p_(t,o):[],[t,o]),l=(0,B.useMemo)(()=>c.join(`|`),[c]),u=(0,B.useRef)(void 0);u.current=e?.path;let d=(0,B.useRef)(void 0);return(0,B.useEffect)(()=>{let e=o??d.current;o&&(d.current=o),v_=e,a_(ar.getModels(),y_(e));let t=ar.onDidCreateModel(e=>{o_(ar.getModels(),e.uri.toString(),150)}),i=!1;return o&&c.length>0&&(async()=>{let e=[],t=[...c];if(await Promise.all(Array.from({length:Math.min(d_,c.length)},async()=>{for(;!i;){let i=t.shift();if(!i)return;let a=i.split(`/`).slice(1).join(`/`);try{let t=await r.fetchQuery(un({...n,project:o,file:a}));e.push({appPath:i,fileWithinProject:a,content:t.message??``})}catch{}}})),i)return;let s=0,l=0;for(let e of ar.getModels())e.uri.toString().startsWith(`file:///`)&&(s++,l+=e.getValueLength());let d=[];for(let t of e){if(t.appPath===u.current||t.content.length>524288)continue;let e=ar.getModel(rr.parse(`file:///${t.appPath}`));if(e){!e.isAttachedToEditor()&&e.getValue()!==t.content&&e.setValue(t.content);continue}d.push(t)}let{selected:f,dropped:p}=i_(d,s,l);for(let e of f){let t=rr.parse(`file:///${e.appPath}`);ar.createModel(e.content,f_(e.appPath),t)}p>0&&console.info(`[harper] type intelligence: skipped ${p} of ${d.length} project files (model budget)`);let m=e.find(e=>c_.test(e.fileWithinProject));__(o,m?.content),await r_(e.filter(e=>/\.(tsx?|jsx?|mjs|cjs|mts|cts)$/i.test(e.appPath)&&!/\.d\.ts$/i.test(e.appPath)&&e.content.length<=524288).map(e=>e.content)),i||a(n_())})(),()=>{i=!0,t.dispose(),v_=void 0,setTimeout(()=>{a_(ar.getModels(),y_(v_))},0)}},[o,s,l]),{typeAcquisitionBudgetExhausted:i}}var x_=10,S_=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent);function C_(e){if(!e)return;if(`startLineNumber`in e)return e;let{lineNumber:t,column:n}=e;return{startLineNumber:t,startColumn:n,endLineNumber:t,endColumn:n}}function w_(e){let{setExpandedItems:t,setSelectedItems:n,setFocusedItem:r,entryExists:i}=V(),a=(0,B.useRef)(()=>{});a.current=e=>{t(t=>{let n=new Set(t),r=e.split(`/`);for(let e=1;e<r.length;e++)n.add(r.slice(0,e).join(`/`));return[...n]}),n([e]),r(e)};let o=(0,B.useRef)(i);o.current=i;let s=(0,B.useRef)([]),c=(0,B.useRef)([]),l=(0,B.useRef)(void 0),u=(0,B.useRef)(!1),d=(0,B.useRef)(()=>{}),f=(0,B.useRef)(()=>{});rt(`NavigateBack`,()=>d.current(),[]),rt(`NavigateForward`,()=>f.current(),[]),(0,B.useEffect)(()=>{if(!e)return;let t=()=>{R(`CanNavigateBack`,s.current.length>0),R(`CanNavigateForward`,c.current.length>0)},n=(t,n,r)=>{let i=!1,a=()=>{i||(i=!0,r())},o=()=>e.getModel()?.uri.toString()===t&&(setTimeout(()=>{n&&e.getModel()?.uri.toString()===t&&(e.setSelection(n),e.revealRangeInCenterIfOutsideViewport(n,ar.ScrollType.Smooth)),e.focus(),a()},0),!0);if(o())return;let s=e.onDidChangeModel(()=>{o()&&s.dispose()});setTimeout(()=>{s.dispose(),a()},8e3)},r=t=>{u.current=!0;let r={lineNumber:t.lineNumber,column:t.column};if(e.getModel()?.uri.toString()===t.uri){e.setPosition(r),e.revealPositionInCenterIfOutsideViewport(r,ar.ScrollType.Smooth),e.focus(),l.current=t,u.current=!1;return}let i=rr.parse(t.uri).path.replace(/^\/+/,``);if(!o.current(i)){u.current=!1;return}a.current(i),n(t.uri,C_(r),()=>{l.current=t,u.current=!1})},i=()=>{let e=s.current.pop();e&&(l.current&&c.current.push(l.current),t(),r(e))},p=()=>{let e=c.current.pop();e&&(l.current&&s.current.push(l.current),t(),r(e))};d.current=i,f.current=p;let m=e.onDidChangeCursorPosition(n=>{let r=e.getModel();if(!r)return;let i={uri:r.uri.toString(),lineNumber:n.position.lineNumber,column:n.position.column};if(u.current){l.current=i;return}let a=l.current;a&&(a.uri!==i.uri||Math.abs(a.lineNumber-i.lineNumber)>=x_)&&a&&(s.current.push(a),c.current=[],t()),l.current=i}),h=ar.registerEditorOpener({openCodeEditor(r,i,d){if(r.getModel()?.uri.toString()===i.toString())return!1;let f=i.path.replace(/^\/+/,``);return o.current(f)?(l.current&&(s.current.push(l.current),c.current=[],t()),u.current=!0,a.current(f),n(i.toString(),C_(d),()=>{let t=e.getModel(),n=e.getPosition();t&&n&&(l.current={uri:t.uri.toString(),lineNumber:n.lineNumber,column:n.column}),u.current=!1}),!0):!1}}),g=e.addAction({id:`harper.navigateBack`,label:`Go Back`,keybindings:[S_?ir.WinCtrl|or.Minus:ir.Alt|or.LeftArrow],contextMenuGroupId:`navigation`,contextMenuOrder:1.5,run:()=>i()}),_=e.addAction({id:`harper.navigateForward`,label:`Go Forward`,keybindings:[S_?ir.WinCtrl|ir.Shift|or.Minus:ir.Alt|or.RightArrow],contextMenuGroupId:`navigation`,contextMenuOrder:1.6,run:()=>p()}),v=e.getDomNode(),y=e=>{(e.button===3||e.button===4)&&e.preventDefault()},b=e=>{e.button===3?(e.preventDefault(),i()):e.button===4&&(e.preventDefault(),p())};return v?.addEventListener(`mousedown`,y),v?.addEventListener(`mouseup`,b),t(),()=>{m.dispose(),h.dispose(),g.dispose(),_.dispose(),v?.removeEventListener(`mousedown`,y),v?.removeEventListener(`mouseup`,b)}},[e])}var T_={budget:`Type information is limited to keep the editor responsive — this application references more packages than the editor can load, so some imports may show “cannot find module.”`,oversized:`This file is large, so it’s shown as plain text without language features.`};function E_({variant:e,onDismiss:t}){return(0,H.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`mt-9 flex items-start gap-2 border-b border-amber-500/40 bg-amber-500/10 px-4 py-2 text-sm text-foreground`,children:[(0,H.jsx)(e===`oversized`?$t:ot,{className:`mt-0.5 size-4 shrink-0 text-amber-500`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`flex-1`,children:T_[e]}),(0,H.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss notice`,className:`shrink-0 rounded p-0.5 text-muted-foreground hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-amber-500`,children:(0,H.jsx)(be,{className:`size-4`,"aria-hidden":!0})})]})}var D_=[{name:`table`,locations:[`OBJECT`],description:`Attach to an object type to persist it as a table.`,args:[{name:`table`,type:`String`,description:`Explicit table name. If omitted, a sensible default derived from the type name is used.`},{name:`database`,type:`String`,description:`Logical database/namespace to place this table in.`},{name:`expiration`,type:`Int`,description:`Default time-to-live (TTL) for records in seconds. Use a positive value to enable automatic expiration; omit or set to 0 to disable.`},{name:`audit`,type:`Boolean`,description:`Enable auditing for create/update/delete operations.`},{name:`eviction`,type:`Int`,description:`The amount of time after expiration before a record can be evicted (defaults to zero).`},{name:`scanInterval`,type:`Int`,description:`The interval for scanning for expired records (defaults to one quarter of the total of expiration and eviction).`},{name:`replicate`,type:`Boolean`,description:`Configure replication for this individual table. Set to false to disable and exclude this table from a replicated database.`},{name:`randomAccessFields`,type:`Boolean`,description:`Encode records as typed random-access structures for fast field access and smaller records. Best for stable, homogeneous field types; pins this table's encoding, overriding the global storage.randomAccessFields config.`}]},{name:`export`,locations:[`OBJECT`],description:`Expose the table via the REST API. When applied to a @table type, routes are generated using the type name or the provided alias.`,args:[{name:`name`,type:`String`,description:`Optional alias to use for REST endpoints. If omitted, the type/table name is used.`},{name:`rest`,type:`Boolean`,description:`REST support is on by default for any exported resource. Specify false to disable it.`},{name:`mqtt`,type:`Boolean`,description:`MQTT support is on by default for any exported resource. Specify false to disable it.`}]},{name:`sealed`,locations:[`OBJECT`],description:`Restrict records to only the defined properties. By default Harper supports heterogeneous records, so you can freely add properties; add @sealed to forbid undefined properties.`,args:[]},{name:`primaryKey`,locations:[`FIELD_DEFINITION`],description:`Marks the primary key field for the table. The value must be unique per record and is used for lookups, updates, and relationships.`,args:[]},{name:`enumerable`,locations:[`FIELD_DEFINITION`],description:`Allows enumeration over a computed field, causing it to be included in serialized responses. (Non-computed fields are always enumerable.)`,args:[]},{name:`expiresAt`,locations:[`FIELD_DEFINITION`],description:`Flags the field as containing the expiration time of the entry.`,args:[]},{name:`allow`,locations:[`FIELD_DEFINITION`],description:`Permit access to the field based on the named roles, only.`,args:[{name:`role`,type:`String`,description:`Role permitted to access the field.`}]},{name:`indexed`,locations:[`FIELD_DEFINITION`],description:`Create an index for the annotated field. Supports traditional and vector/ANN index types.`,args:[{name:`type`,type:`String`,description:`Optional index type, e.g. "HNSW".`},{name:`distance`,type:`String`,description:`Distance metric for vector indexes (e.g., "euclidean", "cosine"). Ignored for non-vector index types.`},{name:`efConstruction`,type:`Int`,description:`Construction effort/recall parameter (HNSW). Higher values improve recall at the cost of build time and memory.`},{name:`M`,type:`Int`,description:`Maximum number of bi-directional connections per node (HNSW). Typical range: 4–64.`},{name:`optimizeRouting`,type:`Int`,description:`Routing optimization level for search graphs (implementation-specific).`},{name:`mL`,type:`Int`,description:`Additional multiplier for graph links (implementation-specific).`},{name:`efConstructionSearch`,type:`Int`,description:`Search-time effort/recall parameter used during construction (implementation-specific). Larger values typically yield better accuracy.`}]},{name:`computed`,locations:[`FIELD_DEFINITION`],description:`Define a derived field whose value is computed from other fields. Useful for denormalized or presentation-friendly data.`,args:[{name:`from`,type:`String`,description:`Computation expression or reference describing how to derive this field from other fields (engine-specific syntax).`},{name:`version`,type:`Int`,description:`Increment when the computation changes to trigger recomputation.`}]},{name:`createdTime`,locations:[`FIELD_DEFINITION`],description:`Automatically sets this field to the record's creation timestamp. The server assigns the value on insert.`,args:[]},{name:`updatedTime`,locations:[`FIELD_DEFINITION`],description:`Automatically updates this field to the current timestamp whenever the record is updated.`,args:[]},{name:`relationship`,locations:[`FIELD_DEFINITION`],description:`Declares a relationship to another record or records. Use on fields that should resolve to related entities by ID.`,args:[{name:`from`,type:`String`,description:`Name of field in THIS table containing foreign key(s) (for one-to-many or many-to-many).`},{name:`to`,type:`String`,description:`Name of field in OTHER table containing foreign key (for one-to-one or many-to-one).`}]}],O_=[{name:`Any`,harperSpecific:!0,description:`A flexible JSON-like value. Accepts objects, arrays, strings, numbers, booleans, or null. Useful for schemaless or mixed content.`},{name:`BigInt`,harperSpecific:!0,description:"Arbitrary-precision integer for values larger than 32-bit/64-bit ranges. Use `Long` for 64-bit integers when possible."},{name:`Blob`,harperSpecific:!0,description:`Binary large object. Represents binary data such as images or files. Typically encoded as Base64 in JSON.`},{name:`Bytes`,harperSpecific:!0,description:`Raw bytes. Typically encoded/transported as Base64 in JSON. Use when you need deterministic binary data that is not a large file.`},{name:`Date`,harperSpecific:!0,description:`Date/time scalar. Recommended format: RFC 3339/ISO-8601 (e.g., "2025-12-02T19:44:00Z"). Represents an absolute timestamp.`},{name:`Long`,harperSpecific:!0,description:`64-bit signed integer. Some clients may serialize values as strings to preserve precision across environments.`},{name:`Boolean`,harperSpecific:!1,description:`true or false`},{name:`Float`,harperSpecific:!1,description:`A signed double-precision floating-point value.`},{name:`ID`,harperSpecific:!1,description:`A unique identifier, serialized as a String, often used to refetch an object or as a cache key. Not intended to be human-readable.`},{name:`Int`,harperSpecific:!1,description:`A signed 32-bit integer.`},{name:`String`,harperSpecific:!1,description:`A UTF-8 character sequence.`}];function k_(e){return D_.find(t=>t.name===e)}function A_(e){return O_.find(t=>t.name===e)}var j_=/@(\w+)\s*\([^)]*$/,M_=/@\w*$/,N_=/:\s*\[?\s*\w*$/;function P_(e){let t=e.match(j_);return t?{kind:`directiveArg`,directive:t[1]}:M_.test(e)?{kind:`directive`}:N_.test(e)?{kind:`fieldType`}:{kind:`none`}}function F_(e){let t=new Set,n=/\b(?:type|input|interface|enum|scalar|union)\s+([A-Za-z_]\w*)/g,r;for(;r=n.exec(e);)t.add(r[1]);return[...t]}function I_({word:e,charBeforeWord:t,lineBeforeWord:n}){if(t===`@`){let t=k_(e);return t?{kind:`directive`,directive:t}:void 0}let r=A_(e);if(r)return{kind:`scalar`,scalar:r};let i=n.match(j_);if(i){let t=k_(i[1]),n=t?.args.find(t=>t.name===e);if(t&&n)return{kind:`directiveArg`,directive:t,arg:n}}}function L_(e){let t=e.args.length>0?`(${e.args.map(e=>`${e.name}: ${e.type}`).join(`, `)})`:``;return`@${e.name}${t} on ${e.locations.join(` | `)}`}function R_(e){switch(e.kind){case`directive`:return`\`\`\`graphql\n${L_(e.directive)}\n\`\`\`\n\n${e.directive.description}`;case`scalar`:{let t=e.scalar.harperSpecific?`Harper scalar`:`GraphQL scalar`;return`\`\`\`graphql\nscalar ${e.scalar.name}\n\`\`\`\n\n_${t}_\n\n${e.scalar.description}`}case`directiveArg`:return`\`\`\`graphql\n${e.arg.name}: ${e.arg.type}\n\`\`\`\n\n_argument of \`@${e.directive.name}\`_\n\n${e.arg.description}`}}function z_(e,t){return D_.map(n=>{let r=n.args.length>0;return{label:`@${n.name}`,kind:e.languages.CompletionItemKind.Function,detail:`directive · ${n.locations.join(` | `)}`,documentation:{value:n.description},filterText:n.name,insertText:r?`${n.name}($1)`:n.name,insertTextRules:r?e.languages.CompletionItemInsertTextRule.InsertAsSnippet:void 0,range:t}})}function B_(e,t,n){let r=O_.map(n=>({label:n.name,kind:e.languages.CompletionItemKind.Struct,detail:n.harperSpecific?`Harper scalar`:`GraphQL scalar`,documentation:{value:n.description},insertText:n.name,range:t})),i=n.map(n=>({label:n,kind:e.languages.CompletionItemKind.Class,detail:`type`,insertText:n,range:t}));return[...r,...i]}function V_(e,t,n){let r=k_(n);return r?r.args.map(n=>({label:n.name,kind:e.languages.CompletionItemKind.Field,detail:n.type,documentation:{value:n.description},insertText:`${n.name}: $1`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:t})):[]}function H_(e){e.languages.registerCompletionItemProvider(`graphql`,{triggerCharacters:[`@`,`:`,`(`],provideCompletionItems(t,n){let r=t.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),i=t.getWordUntilPosition(n),a={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},o=P_(r);switch(o.kind){case`directive`:return{suggestions:z_(e,a)};case`directiveArg`:return{suggestions:V_(e,a,o.directive)};case`fieldType`:return{suggestions:B_(e,a,F_(t.getValue()))};default:return{suggestions:[]}}}}),e.languages.registerHoverProvider(`graphql`,{provideHover(t,n){let r=t.getWordAtPosition(n);if(!r)return null;let i=r.startColumn>1?t.getValueInRange({startLineNumber:n.lineNumber,startColumn:r.startColumn-1,endLineNumber:n.lineNumber,endColumn:r.startColumn}):``,a=t.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:r.startColumn}),o=I_({word:r.word,charBeforeWord:i,lineBeforeWord:a});return o?{range:new e.Range(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn),contents:[{value:R_(o)}]}:null}})}var U_=`
39
- /** Harper structured logger. Each level accepts any number of arguments. */
40
- interface HarperLogger {
41
- notify(...args: any[]): void;
42
- fatal(...args: any[]): void;
43
- error(...args: any[]): void;
44
- warn(...args: any[]): void;
45
- info(...args: any[]): void;
46
- debug(...args: any[]): void;
47
- trace(...args: any[]): void;
48
- }
49
-
50
- /**
51
- * Base class for any Harper resource. Database tables extend it, and you can
52
- * extend it to define custom data sources, caching sources, messaging
53
- * endpoints, and RESTful endpoints. Override the instance methods (get, put,
54
- * post, patch, delete, subscribe, …) to provide behavior; the static methods
55
- * are the entry points that wrap calls in a transaction.
56
- */
57
- declare class Resource<RecordType extends object = any> {
58
- constructor(identifier?: any, source?: any);
59
-
60
- /** Directly get a resource. Called for HTTP GET requests. */
61
- static get(idOrQuery?: any, dataOrContext?: any, context?: any): any;
62
- /** Store the provided record by id. If no id is provided, one is generated. */
63
- static put(idOrQuery?: any, dataOrContext?: any, context?: any): any;
64
- static patch(idOrQuery?: any, dataOrContext?: any, context?: any): any;
65
- static delete(idOrQuery?: any, dataOrContext?: any, context?: any): any;
66
- static post(idOrQuery?: any, dataOrContext?: any, context?: any): any;
67
- static update(idOrQuery?: any, dataOrContext?: any, context?: any): any;
68
- static invalidate(idOrQuery?: any, dataOrContext?: any, context?: any): any;
69
- static connect(idOrQuery?: any, dataOrContext?: any, context?: any): any;
70
- static subscribe(idOrQuery?: any, dataOrContext?: any, context?: any): any;
71
- static publish(idOrQuery?: any, dataOrContext?: any, context?: any): any;
72
- static search(idOrQuery?: any, dataOrContext?: any, context?: any): any;
73
- static query(idOrQuery?: any, dataOrContext?: any, context?: any): any;
74
- static copy(idOrQuery?: any, dataOrContext?: any, context?: any): any;
75
- static move(idOrQuery?: any, dataOrContext?: any, context?: any): any;
76
- /** Create a new resource. If no id is provided, one is generated. */
77
- static create(record: any, context?: any): Promise<any>;
78
- static create(idPrefix: any, record: any, context: any): Promise<any>;
79
- /** Generate a new primary key (a UUID by default). */
80
- static getNewId(): string;
81
- static getResource(target: any, request: any, options?: any): Resource | Promise<Resource>;
82
-
83
- /** Get the primary key value for this resource. */
84
- getId(): any;
85
- /** Get the context (transaction, user, and more) for this resource. */
86
- getContext(): any;
87
- /** Get the current user for the request, or undefined if not logged in. */
88
- getCurrentUser(): any;
89
-
90
- get?(target?: any): any;
91
- search?(target?: any): AsyncIterable<RecordType>;
92
- create?(newRecord?: Partial<RecordType>, target?: any): Promise<any>;
93
- put?(record?: RecordType, target?: any): any;
94
- patch?(record?: Partial<RecordType>, target?: any): any;
95
- post?(target?: any, newRecord?: Partial<RecordType>): any;
96
- delete?(target?: any): boolean | Promise<boolean>;
97
- invalidate?(target?: any): void | Promise<void>;
98
- publish?(target?: any, record?: RecordType, options?: any): void;
99
- subscribe?(request?: any): AsyncIterable<RecordType>;
100
- connect?(target?: any, incomingMessages?: any): AsyncIterable<RecordType>;
101
-
102
- allowRead?(user?: any, target?: any, context?: any): boolean | Promise<boolean>;
103
- allowUpdate?(user?: any, record?: any, context?: any): boolean | Promise<boolean>;
104
- allowCreate?(user?: any, record?: any, context?: any): boolean | Promise<boolean>;
105
- allowDelete?(user?: any, target?: any, context?: any): boolean | Promise<boolean>;
106
- }
107
-
108
- /** The set of tables in a database, keyed by table name. */
109
- interface HarperTables {
110
- [tableName: string]: typeof Resource;
111
- }
112
-
113
- /** All Harper databases, keyed by database name; each holds its tables. */
114
- interface HarperDatabases {
115
- [databaseName: string]: HarperTables;
116
- }
117
-
118
- /** Central interface for registering server protocol handlers. */
119
- interface HarperServer {
120
- /** Register an HTTP request handler. */
121
- http(listener: (request: any, nextLayer: (request: any) => any) => void, options?: any): void;
122
- /** Register a request handler (alias surface of http). */
123
- request(listener: (request: any, nextLayer: (request: any) => any) => void, options?: any): void;
124
- /** Register a WebSocket handler. */
125
- ws(listener: (ws: any, request: any, requestCompletion: Promise<any>) => any, options?: any): void;
126
- /** Register a connection upgrade handler. */
127
- upgrade(listener: (request: any, socket: any, head: any, nextLayer: (...args: any[]) => Promise<void>) => Promise<void>, options?: any): void;
128
- /** Register a raw socket handler. */
129
- socket(listener: (socket: any) => void, options: any): void;
130
- /** Register a custom operation. */
131
- registerOperation(operationDefinition: any): void;
132
- /** Run a Harper operation. */
133
- operation(operation: any, context?: any, authorize?: boolean): Promise<any>;
134
- /** Record an analytics metric. */
135
- recordAnalytics(value: any, metric: string, path?: string, method?: string, type?: string): void;
136
- getUser(username: string, password: string | null, request: any): any;
137
- authenticateUser(username: string, password: string, request: any): any;
138
- contentTypes: Map<string, any>;
139
- hostname: string;
140
- resources: any;
141
- nodes: any[];
142
- replication: any;
143
- [key: string]: any;
144
- }
145
-
146
- /** The default database's tables, keyed by table name. */
147
- declare const tables: HarperTables;
148
- /** All Harper databases, keyed by database name. */
149
- declare const databases: HarperDatabases;
150
- /** The Harper server: register HTTP/WS/socket handlers and operations. */
151
- declare const server: HarperServer;
152
- /** Harper structured logger. */
153
- declare const logger: HarperLogger;
154
- /** Registry of content-type (de)serializers, keyed by media type. */
155
- declare const contentTypes: Record<string, any>;
156
- /** Run a callback inside a Harper transaction. */
157
- declare const transaction: <T = any>(callback: (transaction: any) => T | Promise<T>) => Promise<T>;
158
- /** Create a Blob from binary data or a stream. */
159
- declare const createBlob: (source?: any) => any;
160
- /** Invoke a Harper operation directly. */
161
- declare const operation: (operation: any, context?: any) => Promise<any>;
162
- /** Worker threads available to this resource. */
163
- declare const threads: unknown[];
164
-
165
- declare module 'harper' {
166
- export { Resource, tables, databases, server, logger, contentTypes, transaction, createBlob, operation, threads };
167
-
168
- // Additional value exports from harper's entry point.
169
- export class RequestTarget {
170
- constructor(path?: any, query?: any);
171
- [key: string]: any;
172
- }
173
- export function getContext(): any;
174
- export function getResponse(): any;
175
- export function getUser(): any;
176
-
177
- // Commonly imported types (modeled loosely; see harper/dist/index.d.ts).
178
- export type Logger = HarperLogger;
179
- export type Table = typeof Resource;
180
- export type Attribute = any;
181
- export type Context = any;
182
- export type SourceContext = any;
183
- export type Query = any;
184
- export type Session = any;
185
- export type SubscriptionRequest = any;
186
- export type RequestTargetOrId = any;
187
- export type ResourceInterface<RecordType = any> = any;
188
- export type RecordObject = any;
189
- export type IterableEventQueue<T = any> = any;
190
- export type User = any;
191
- }
192
-
193
- // Harper components historically import from 'harperdb'; alias it to 'harper'.
194
- declare module 'harperdb' {
195
- export * from 'harper';
196
- }
197
- `,W_=`file:///node_modules/@types/harper-globals/index.d.ts`,G_=`file:///node_modules/@types/harper-assets/index.d.ts`,K_=`
198
- declare module '*.svg' { const url: string; export default url; }
199
- declare module '*.png' { const url: string; export default url; }
200
- declare module '*.jpg' { const url: string; export default url; }
201
- declare module '*.jpeg' { const url: string; export default url; }
202
- declare module '*.gif' { const url: string; export default url; }
203
- declare module '*.webp' { const url: string; export default url; }
204
- declare module '*.avif' { const url: string; export default url; }
205
- declare module '*.ico' { const url: string; export default url; }
206
- declare module '*.bmp' { const url: string; export default url; }
207
- declare module '*.css' { const classes: { readonly [name: string]: string }; export default classes; }
208
- declare module '*.scss' { const classes: { readonly [name: string]: string }; export default classes; }
209
- declare module '*.sass' { const classes: { readonly [name: string]: string }; export default classes; }
210
- declare module '*.less' { const classes: { readonly [name: string]: string }; export default classes; }
211
- declare module '*?raw' { const content: string; export default content; }
212
- declare module '*?url' { const url: string; export default url; }
213
- `;function q_(){let{typescriptDefaults:e,javascriptDefaults:t,ScriptTarget:n,ModuleKind:r,ModuleResolutionKind:i,JsxEmit:a}=sr;for(let o of[e,t])o.addExtraLib(U_,W_),o.addExtraLib(K_,G_),o.setEagerModelSync(!0),o.setCompilerOptions({...o.getCompilerOptions(),target:n.ESNext,module:r.ESNext,moduleResolution:i.NodeJs,allowJs:!0,allowNonTsExtensions:!0,esModuleInterop:!0,skipLibCheck:!0,noEmit:!0,jsx:a.Preserve,allowImportingTsExtensions:!0,resolveJsonModule:!0})}var J_;(()=>{var e={975:e=>{function t(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function n(e,t){for(var n,r=``,i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===47)break;n=47}if(n===47){if(a!==s-1&&o!==1){if(a!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var c=r.lastIndexOf(`/`);if(c!==r.length-1){c===-1?(r=``,i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf(`/`),a=s,o=0;continue}}else if(r.length===2||r.length===1){r=``,i=0,a=s,o=0;continue}}t&&(r.length>0?r+=`/..`:r=`..`,i=2)}else r.length>0?r+=`/`+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1}a=s,o=0}else n===46&&o!==-1?++o:o=-1}return r}var r={resolve:function(){for(var e,r=``,i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(e===void 0&&(e=process.cwd()),o=e),t(o),o.length!==0&&(r=o+`/`+r,i=o.charCodeAt(0)===47)}return r=n(r,!i),i?r.length>0?`/`+r:`/`:r.length>0?r:`.`},normalize:function(e){if(t(e),e.length===0)return`.`;var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return(e=n(e,!r)).length!==0||r||(e=`.`),e.length>0&&i&&(e+=`/`),r?`/`+e:e},isAbsolute:function(e){return t(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(e===void 0?e=i:e+=`/`+i)}return e===void 0?`.`:r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n||(e=r.resolve(e))===(n=r.resolve(n)))return``;for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var a=e.length,o=a-i,s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var c=n.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(n.charCodeAt(s+d)===47)return n.slice(s+d+1);if(d===0)return n.slice(s+d)}else o>l&&(e.charCodeAt(i+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=i+u+1;d<=a;++d)d!==a&&e.charCodeAt(d)!==47||(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+n.slice(s+u):(s+=u,n.charCodeAt(s)===47&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),e.length===0)return`.`;for(var n=e.charCodeAt(0),r=n===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if((n=e.charCodeAt(o))===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,n){if(n!==void 0&&typeof n!=`string`)throw TypeError(`"ext" argument must be a string`);t(e);var r,i=0,a=-1,o=!0;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return``;var s=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(l===47){if(!o){i=r+1;break}}else c===-1&&(o=!1,c=r+1),s>=0&&(l===n.charCodeAt(s)?--s==-1&&(a=r):(s=-1,a=c))}return i===a?a=c:a===-1&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!o){i=r+1;break}}else a===-1&&(o=!1,a=r+1);return a===-1?``:e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c!==47)i===-1&&(a=!1,i=s+1),c===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1);else if(!a){r=s+1;break}}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+`/`+r:r}(0,e)},parse:function(e){t(e);var n={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return n;var r,i=e.charCodeAt(0),a=i===47;a?(n.root=`/`,r=1):r=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if((i=e.charCodeAt(u))!==47)c===-1&&(l=!1,c=u+1),i===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1);else if(!l){s=u+1;break}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(n.base=n.name=s===0&&a?e.slice(1,c):e.slice(s,c)):(s===0&&a?(n.name=e.slice(1,o),n.base=e.slice(1,c)):(n.name=e.slice(s,o),n.base=e.slice(s,c)),n.ext=e.slice(o,c)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir=`/`),n},sep:`/`,delimiter:`:`,win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>u,Utils:()=>C}),typeof process==`object`?i=process.platform===`win32`:typeof navigator==`object`&&(i=navigator.userAgent.indexOf(`Windows`)>=0);let a=/^\w[\w\d+.-]*$/,o=/^\//,s=/^\/\//;function c(e,t){if(!e.scheme&&t)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!a.test(e.scheme))throw Error(`[UriError]: Scheme contains illegal characters.`);if(e.path){if(e.authority){if(!o.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(s.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}let l=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static isUri(e){return e instanceof u||!!e&&typeof e.authority==`string`&&typeof e.fragment==`string`&&typeof e.path==`string`&&typeof e.query==`string`&&typeof e.scheme==`string`&&typeof e.fsPath==`string`&&typeof e.with==`function`&&typeof e.toString==`function`}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||``,this.authority=e.authority||``,this.path=e.path||``,this.query=e.query||``,this.fragment=e.fragment||``):(this.scheme=function(e,t){return e||t?e:`file`}(e,a),this.authority=t||``,this.path=function(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==`/`&&(t=`/`+t):t=`/`}return t}(this.scheme,n||``),this.query=r||``,this.fragment=i||``,c(this,a))}get fsPath(){return g(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=``),n===void 0?n=this.authority:n===null&&(n=``),r===void 0?r=this.path:r===null&&(r=``),i===void 0?i=this.query:i===null&&(i=``),a===void 0?a=this.fragment:a===null&&(a=``),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new f(t,n,r,i,a)}static parse(e,t=!1){let n=l.exec(e);return n?new f(n[2]||``,b(n[4]||``),b(n[5]||``),b(n[7]||``),b(n[9]||``),t):new f(``,``,``,``,``)}static file(e){let t=``;if(i&&(e=e.replace(/\\/g,`/`)),e[0]===`/`&&e[1]===`/`){let n=e.indexOf(`/`,2);n===-1?(t=e.substring(2),e=`/`):(t=e.substring(2,n),e=e.substring(n)||`/`)}return new f(`file`,t,e,``,``)}static from(e){let t=new f(e.scheme,e.authority,e.path,e.query,e.fragment);return c(t,!0),t}toString(e=!1){return _(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof u)return e;{let t=new f(e);return t._formatted=e.external,t._fsPath=e._sep===d?e.fsPath:null,t}}return e}}let d=i?1:void 0;class f extends u{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||=g(this,!1),this._fsPath}toString(e=!1){return e?_(this,!0):(this._formatted||=_(this,!1),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=d),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}let p={58:`%3A`,47:`%2F`,63:`%3F`,35:`%23`,91:`%5B`,93:`%5D`,64:`%40`,33:`%21`,36:`%24`,38:`%26`,39:`%27`,40:`%28`,41:`%29`,42:`%2A`,43:`%2B`,44:`%2C`,59:`%3B`,61:`%3D`,32:`%20`};function m(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||t&&o===47||n&&o===91||n&&o===93||n&&o===58)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=p[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}function h(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===35||r===63?(t===void 0&&(t=e.substr(0,n)),t+=p[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}function g(e,t){let n;return n=e.authority&&e.path.length>1&&e.scheme===`file`?`//${e.authority}${e.path}`:e.path.charCodeAt(0)===47&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&e.path.charCodeAt(2)===58?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,i&&(n=n.replace(/\//g,`\\`)),n}function _(e,t){let n=t?h:m,r=``,{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=`/`,r+=`/`),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){let e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){let e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),c&&(r+=`#`,r+=t?c:m(c,!1,!1)),r}function v(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+v(e.substr(3)):e}}let y=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function b(e){return e.match(y)?e.replace(y,(e=>v(e))):e}var x=n(975);let S=x.posix||x;var C;(function(e){e.joinPath=function(e,...t){return e.with({path:S.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==`/`&&(n=`/`+n,r=!0);let i=S.resolve(n,...t);return r&&i[0]===`/`&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(e.path.length===0||e.path===`/`)return e;let t=S.dirname(e.path);return t.length===1&&t.charCodeAt(0)===46&&(t=``),e.with({path:t})},e.basename=function(e){return S.basename(e.path)},e.extname=function(e){return S.extname(e.path)}})(C||={}),J_=r})();var{URI:Y_,Utils:X_}=J_;function Z_(e){return e===4?1:e===3?2:e===2?4:8}function Q_(e){return e}function $_(e){return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function $(e){return{startLineNumber:e.start.line+1,startColumn:e.start.character+1,endLineNumber:e.end.line+1,endColumn:e.end.character+1}}function ev(e){return{...$(e.location.range),message:e.message,resource:Y_.parse(e.location.uri)}}function tv(e){let t={...$(e.range),message:e.message,severity:e.severity?Z_(e.severity):8};return e.code!=null&&(t.code=e.codeDescription==null?String(e.code):{value:String(e.code),target:Y_.parse(e.codeDescription.href)}),e.relatedInformation&&(t.relatedInformation=e.relatedInformation.map(ev)),e.tags&&(t.tags=e.tags.map(Q_)),e.source!=null&&(t.source=e.source),t}function nv(e){return{range:$(e.range),text:e.newText}}function rv(e){let t={label:e.label,needsConfirmation:e.needsConfirmation??!1};return e.description!=null&&(t.description=e.description),t}function iv(e){let t={};return e.ignoreIfExists!=null&&(t.ignoreIfExists=e.ignoreIfExists),e.ignoreIfNotExists!=null&&(t.ignoreIfNotExists=e.ignoreIfNotExists),e.overwrite!=null&&(t.overwrite=e.overwrite),e.recursive!=null&&(t.recursive=e.recursive),t}function av(e){let t=e.kind===`create`?{newResource:Y_.parse(e.uri)}:e.kind===`delete`?{oldResource:Y_.parse(e.uri)}:{oldResource:Y_.parse(e.oldUri),newResource:Y_.parse(e.newUri)};return e.options&&(t.options=iv(e.options)),t}function ov(e,t,n,r){let i={resource:Y_.parse(t),versionId:r,textEdit:nv(e)};if(`annotationId`in e){let t=n?.[e.annotationId];t&&(i.metadata=rv(t))}return i}function sv(e){let t=[];if(e.changes)for(let[n,r]of Object.entries(e.changes))for(let i of r)t.push(ov(i,n,e.changeAnnotations));if(e.documentChanges)for(let n of e.documentChanges){if(!(`textDocument`in n)){t.push(av(n));continue}for(let r of n.edits)t.push(ov(r,n.textDocument.uri,e.changeAnnotations,n.textDocument.version??void 0))}return{edits:t}}function cv(e){let t={title:e.title,isPreferred:e.isPreferred};return e.diagnostics&&(t.diagnostics=e.diagnostics.map(tv)),e.disabled&&(t.disabled=e.disabled.reason),e.edit&&(t.edit=sv(e.edit)),e.isPreferred!=null&&(t.isPreferred=e.isPreferred),e.kind&&(t.kind=e.kind),t}function lv(e){return e}function uv(e){let t={title:e.title,id:e.command};return e.arguments&&(t.arguments=e.arguments),t}function dv(e){let t={range:$(e.range)};return e.command&&(t.command=uv(e.command)),t}function fv(e){return e===1?18:e===2?0:e===3?1:e===4?2:e===5?3:e===6?4:e===7?5:e===8?7:e===9?8:e===10?9:e===11?12:e===12?13:e===13?15:e===14?17:e===15?27:e===16?19:e===17?20:e===18?21:e===19?23:e===20?16:e===21?14:e===22?6:e===23?10:e===24?11:24}function pv(e){return e}function mv(e){return{value:e.value}}function hv(e){return{range:$(e.range),text:e.newText}}function gv(e){return`range`in e?$(e.range):`insert`in e&&`replace`in e?{insert:$(e.insert),replace:$(e.replace)}:$(e)}function _v(e,t){let n=t.itemDefaults??{},r=e.textEdit??n.editRange,i=e.commitCharacters??n.commitCharacters,a=e.insertTextFormat??n.insertTextFormat,o=e.insertTextMode??n.insertTextMode,s=e.insertText,c;r?(c=gv(r),`newText`in r&&(s=r.newText)):c={...t.range};let l={insertText:s??e.label,kind:e.kind==null?18:fv(e.kind),label:e.label,range:c};return e.additionalTextEdits&&(l.additionalTextEdits=e.additionalTextEdits.map(hv)),e.command&&(l.command=uv(e.command)),i&&(l.commitCharacters=i),e.detail!=null&&(l.detail=e.detail),typeof e.documentation==`string`?l.documentation=e.documentation:e.documentation&&(l.documentation=mv(e.documentation)),e.filterText!=null&&(l.filterText=e.filterText),a===2?l.insertTextRules=4:o===2&&(l.insertTextRules=1),e.preselect!=null&&(l.preselect=e.preselect),e.sortText!=null&&(l.sortText=e.sortText),e.tags&&(l.tags=e.tags.map(pv)),l}function vv(e,t){return{incomplete:!!e.isIncomplete,suggestions:e.items.map(n=>_v(n,{range:t.range,itemDefaults:e.itemDefaults}))}}function yv(e){return e===1?0:e===2?1:e===3?2:e===4?3:e===5?4:e===6?5:e===7?6:e===8?7:e===9?8:e===10?9:e===11?10:e===12?11:e===13?12:e===14?13:e===15?14:e===16?15:e===17?16:e===18?17:e===19?18:e===20?19:e===21?20:e===22?21:e===23?22:e===24?23:e===25?24:25}function bv(e){return e}function xv(e){let t={detail:e.detail??``,kind:yv(e.kind),name:e.name,range:$(e.range),selectionRange:$(e.selectionRange),tags:e.tags?.map(bv)??[]};return e.children&&(t.children=e.children.map(xv)),t}function Sv(e){let t={start:e.startLine+1,end:e.endLine+1};return e.kind!=null&&(t.kind={value:e.kind}),t}function Cv(e){return{insertSpaces:e.insertSpaces,tabSize:e.tabSize}}function wv(e){return typeof e==`string`?{value:e}:{value:`\`\`\`${e.language}\n${e.value}\n\`\`\``}}function Tv(e){return typeof e==`string`||`language`in e?[wv(e)]:Array.isArray(e)?e.map(wv):[mv(e)]}function Ev(e){let t={contents:Tv(e.contents)};return e.range&&(t.range=$(e.range)),t}function Dv(e){return{character:e.column-1,line:e.lineNumber-1}}function Ov(e){let t={range:$(e.range)};return e.tooltip!=null&&(t.tooltip=e.tooltip),e.target!=null&&(t.url=Y_.parse(e.target)),t}function kv(e){let t={range:$(e.targetRange),targetSelectionRange:$(e.targetSelectionRange),uri:Y_.parse(e.targetUri)};return e.originSelectionRange&&(t.originSelectionRange=$(e.originSelectionRange)),t}function Av(e){let t=[],n=e;for(;n;)t.push({range:$(n.range)}),n=n.parent;return t}function jv(e,t,n){let r=new Map,i=e=>t===`*`?!0:Array.isArray(t)?t.includes(e):t===e,a=async t=>{let r=t.getVersionId(),a=await n.provideMarkerData(t);!t.isDisposed()&&r===t.getVersionId()&&i(t.getLanguageId())&&e.editor.setModelMarkers(t,n.owner,a??[])},o=e=>{if(!i(e.getLanguageId()))return;let t,n=e.onDidChangeContent(()=>{clearTimeout(t),t=setTimeout(()=>{a(e)},500)});r.set(e,{dispose(){clearTimeout(t),n.dispose()}}),a(e)},s=t=>{e.editor.setModelMarkers(t,n.owner,[]);let i=r.get(t);i&&(i.dispose(),r.delete(t))};function c(e,t=e.getLanguageId()){n.doReset&&i(t)&&n.doReset(e)}let l=e.editor.onDidCreateModel(o),u=e.editor.onWillDisposeModel(e=>{s(e),c(e)}),d=e.editor.onDidChangeModelLanguage(({model:e,oldLanguage:t})=>{s(e),o(e),c(e,t)});for(let t of e.editor.getModels())o(t);return{dispose(){for(let e of r.keys())s(e);l.dispose(),u.dispose(),d.dispose()},async revalidate(){await Promise.all(e.editor.getModels().map(a))}}}function Mv(e,t){let{createData:n,interval:r=3e4,label:i,moduleId:a,stopWhenIdleFor:o=12e4}=t,s,c=0,l=!1,u=()=>{s&&=(s.dispose(),void 0)},d=setInterval(()=>{s&&Date.now()-c>o&&u()},r);return{dispose(){l=!0,clearInterval(d),u()},getWorker(...t){if(l)throw Error(`Worker manager has been disposed`);return c=Date.now(),s||=e.editor.createWebWorker({createData:n,label:i,moduleId:a}),s.withSyncedResources(t)},updateCreateData(e){n=e,u()}}}function Nv(e,t){return{...t,...e,format:{...t.format,...e.format}}}function Pv(e){let t;return{get(){return t},toggle(n){n?t??=e():(t?.dispose(),t=void 0)}}}function Fv(e,t={}){let n=Nv(t,{codeLens:!1,completion:!0,customTags:[],disableAdditionalProperties:!1,disableDefaultProperties:!1,enableSchemaRequest:!1,flowMapping:`allow`,flowSequence:`allow`,format:{bracketSpacing:!0,enable:!0,printWidth:80,proseWrap:`preserve`,singleQuote:!1,trailingComma:!0},hover:!0,hoverAnchor:!0,indentation:` `,isKubernetes:!1,keyOrdering:!1,parentSkeletonSelectedFirst:!1,schemas:[],validate:!0,yamlVersion:`1.2`});e.languages.register({id:`yaml`,extensions:[`.yaml`,`.yml`],aliases:[`YAML`,`yaml`,`YML`,`yml`],mimetypes:[`application/x-yaml`]});let r=Mv(e,{label:`yaml`,moduleId:`monaco-yaml/yaml.worker`,createData:n}),i=new WeakMap,a=Pv(()=>e.languages.registerCodeLensProvider(`yaml`,{async provideCodeLenses(e){let t=await(await r.getWorker(e.uri)).getCodeLens(String(e.uri));if(t)return{lenses:t.map(dv),dispose(){}}}})),o=Pv(()=>e.languages.registerCompletionItemProvider(`yaml`,{triggerCharacters:[` `,`:`],async provideCompletionItems(e,t){let n=e.getWordUntilPosition(t),i=await(await r.getWorker(e.uri)).doComplete(String(e.uri),Dv(t));if(i)return vv(i,{range:{startLineNumber:t.lineNumber,startColumn:n.startColumn,endLineNumber:t.lineNumber,endColumn:n.endColumn}})}})),s=Pv(()=>e.languages.registerDocumentFormattingEditProvider(`yaml`,{displayName:`yaml`,async provideDocumentFormattingEdits(e){return(await(await r.getWorker(e.uri)).format(String(e.uri)))?.map(nv)}})),c=Pv(()=>e.languages.registerHoverProvider(`yaml`,{async provideHover(e,t){let n=await(await r.getWorker(e.uri)).doHover(String(e.uri),Dv(t));if(n)return Ev(n)}})),l=Pv(()=>jv(e,`yaml`,{owner:`yaml`,async provideMarkerData(e){let t=await(await r.getWorker(e.uri)).doValidation(String(e.uri));return i.set(e,t),t?.map(tv)},async doReset(e){await(await r.getWorker(e.uri)).resetSchema(String(e.uri))}}));function u(){a.toggle(n.codeLens),o.toggle(n.completion),s.toggle(n.format?.enable),c.toggle(n.hover),l.toggle(n.validate)}u();let d=[r,e.languages.registerDefinitionProvider(`yaml`,{async provideDefinition(e,t){return(await(await r.getWorker(e.uri)).doDefinition(String(e.uri),Dv(t)))?.map(kv)}}),e.languages.registerDocumentSymbolProvider(`yaml`,{displayName:`yaml`,async provideDocumentSymbols(e){return(await(await r.getWorker(e.uri)).findDocumentSymbols(String(e.uri)))?.map(xv)}}),e.languages.registerLinkProvider(`yaml`,{async provideLinks(e){let t=await(await r.getWorker(e.uri)).findLinks(String(e.uri));if(t)return{links:t.map(Ov)}}}),e.languages.registerCodeActionProvider(`yaml`,{async provideCodeActions(e,t,n){let a=await(await r.getWorker(e.uri)).getCodeAction(String(e.uri),$_(t),{diagnostics:i.get(e)?.filter(e=>t.intersectRanges($(e.range)))||[],only:n.only?[n.only]:void 0,triggerKind:lv(n.trigger)});if(a)return{actions:a.map(cv),dispose(){}}}}),e.languages.registerFoldingRangeProvider(`yaml`,{async provideFoldingRanges(e){return(await(await r.getWorker(e.uri)).getFoldingRanges(String(e.uri)))?.map(Sv)}}),e.languages.setLanguageConfiguration(`yaml`,{comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}]}),e.languages.registerOnTypeFormattingEditProvider(`yaml`,{autoFormatTriggerCharacters:[`
214
- `],async provideOnTypeFormattingEdits(e,t,n,i){return(await(await r.getWorker(e.uri)).doDocumentOnTypeFormatting(String(e.uri),Dv(t),n,Cv(i)))?.map(nv)}}),e.languages.registerRenameProvider(`yaml`,{async provideRenameEdits(e,t,n){let i=await(await r.getWorker(e.uri)).doRename(String(e.uri),Dv(t),n);if(i)return sv(i)},async resolveRenameLocation(e,t){let n=await(await r.getWorker(e.uri)).prepareRename(String(e.uri),Dv(t));if(n)return{range:$(n),text:``}}}),e.languages.registerSelectionRangeProvider(`yaml`,{async provideSelectionRanges(e,t){return(await(await r.getWorker(e.uri)).getSelectionRanges(String(e.uri),t.map(Dv)))?.map(Av)}})];return{dispose(){a.get()?.dispose(),o.get()?.dispose(),s.get()?.dispose(),c.get()?.dispose(),l.get()?.dispose();for(let e of d)e.dispose()},async update(e){n=Nv(e,n),r.updateCreateData(n),u(),await l.get()?.revalidate()},getOptions(){return n}}}var Iv=JSON.parse(`{
215
- "$schema": "https://json-schema.org/draft-06/schema",
216
- "$id": "https://harper.fast/schema/config.schema.json",
217
- "type": "object",
218
- "properties": {
219
- "rest": {
220
- "type": "boolean",
221
- "description": "Enable REST API endpoints."
222
- },
223
- "graphqlSchema": {
224
- "type": "object",
225
- "description": "GraphQL schema configuration.",
226
- "additionalProperties": false,
227
- "properties": {
228
- "files": {
229
- "description": "Glob(s) or path(s) to GraphQL schema files.",
230
- "oneOf": [
231
- {
232
- "type": "string"
233
- },
234
- {
235
- "type": "array",
236
- "items": {
237
- "type": "string"
238
- }
239
- }
240
- ]
241
- }
242
- },
243
- "required": ["files"]
244
- },
245
- "jsResource": {
246
- "type": "object",
247
- "description": "JavaScript resource(s) configuration.",
248
- "additionalProperties": false,
249
- "properties": {
250
- "files": {
251
- "description": "Path(s) to JS resource file(s).",
252
- "oneOf": [
253
- {
254
- "type": "string"
255
- },
256
- {
257
- "type": "array",
258
- "items": {
259
- "type": "string"
260
- }
261
- }
262
- ]
263
- }
264
- },
265
- "required": ["files"]
266
- },
267
- "package": {
268
- "type": "string",
269
- "description": "Package identifier for the application (npm-compatible or git URL)."
270
- },
271
- "loadComponent": {
272
- "type": "string",
273
- "description": "Conditional package loading option.",
274
- "enum": ["always", "if-installed", "dev-only"],
275
- "default": "always"
276
- }
277
- },
278
- "additionalProperties": true,
279
- "examples": [
280
- {
281
- "rest": true,
282
- "graphqlSchema": {
283
- "files": "*.graphql"
284
- },
285
- "jsResource": {
286
- "files": "resources.js"
287
- }
288
- }
289
- ]
290
- }
291
- `),Lv=`harper://schemas/config-app.json`;function Rv(e){Fv(e,{enableSchemaRequest:!1,validate:!0,hover:!0,completion:!0,schemas:[{uri:Lv,fileMatch:[`**/config.yaml`,`*config.yaml`,`config.yaml`],schema:Iv}]})}var zv=`__harperLanguageSupportConfigured`;function Bv(e){let t=globalThis;t[zv]||(t[zv]=!0,H_(e),q_(),Rv(e))}var Vv={js:`javascript`,cjs:`javascript`,jsx:`javascript`,yaml:`yaml`,yml:`yaml`,ts:`typescript`,tsx:`typescript`,json:`json`,md:`markdown`,html:`html`,css:`css`,graphql:`graphql`,mjs:`javascript`,svg:`xml`,xml:`xml`};function Hv(e,t){let n=Object.values(e).find(e=>!!e&&typeof e.lookupKeybinding==`function`),r={};if(!n)return r;for(let e of t){let t=n.lookupKeybinding(e)?.getLabel();t&&(r[e]=t)}return r}function Uv(){let e=He(),{openedEntryContents:t,openedEntry:n,restrictPackageModification:r,isSavingFile:i,saveFile:a,rootEntries:o}=V(),{typeAcquisitionBudgetExhausted:s}=b_(n,o),{content:c,setContent:l}=Ja(!!n&&!n.package&&n.path),u=(0,B.useCallback)(e=>{l(e===t?void 0:e)},[t,l]),d=nr(),f=dt(),[p,m]=(0,B.useState)(null);w_(p?.[0]);let[h,g]=(0,B.useState)(null),_=Kn(n?.path),v=c??t,y=(v?.length??0)>Hn,b=y?`plaintext`:Vv[_]||`plaintext`,x=(0,B.useCallback)(e=>{Bv(e)},[]),S=(0,B.useCallback)((e,t)=>{m([e,t])},[]);if((0,B.useEffect)(()=>{if(p&&f&&!n?.package&&!r)return yi(p)},[p,f,n,r]),rt(`SaveFile`,()=>{n&&!i&&c!==void 0&&a({...e,file:n.path.split(`/`).slice(1).join(`/`),payload:c,project:n.project},n.path)},[n,e,c]),rt(`RevertChanges`,()=>{if(t!==void 0&&p){let[e]=p;u(void 0),e.setValue(t)}},[t,p]),rt(`RunEditorAction`,e=>{p?.[0]?.getAction(e)?.run()},[p]),rt(`FocusEditor`,()=>{requestAnimationFrame(()=>p?.[0]?.focus())},[p]),(0,B.useEffect)(()=>{p&&fo(Hv(p[0],co))},[p]),!n)return null;let C=i||!!n.package||!f,w=y?`oversized`:s&&(b===`javascript`||b===`typescript`)&&!n.package?`budget`:null,T=w?`${n.path}:${w}`:null,E=T!==null&&h!==T;return(0,H.jsxs)(`div`,{className:`flex h-full w-full flex-col`,children:[E&&w&&(0,H.jsx)(E_,{variant:w,onDismiss:()=>g(T)}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,H.jsx)(Nt,{className:`h-full w-full`,path:n.path,language:b,theme:d,value:v,keepCurrentModel:!0,beforeMount:x,onMount:S,onChange:C?void 0:u,options:{automaticLayout:!0,minimap:{enabled:!1},readOnly:C,padding:{top:E?8:48}}})})]})}function Wv(){let e=He(),t=S(),{openedEntry:n}=V(),r=dt(),i=n?.path??``,a=n?.project??``,o=i.split(`/`).slice(1).join(`/`),s=fn({file:o,project:a,...e}),{data:c,isFetching:l,refetch:u}=O(un({file:o,project:a,...e})),{content:d,setContent:f}=Ja(!!n&&!n.package&&i),p=c?.protected===!0,m=d??c?.message,h=(0,B.useMemo)(()=>c?p?(c.keys??[]).map(e=>({name:e})):Object.entries(In(m??``)).map(([e,t])=>({name:e,value:t})):[],[c,p,m]),g=!!n&&!n.package&&r,{mutateAsync:_}=Fe(),{mutateAsync:v}=rg(),{mutateAsync:b}=ag(),x=(0,B.useCallback)(async n=>{await _({...e,project:a,file:o,payload:n}),t.setQueryData(s,e=>e&&{...e,message:n}),f(void 0)},[_,e,a,o,t,s,f]),C=(0,B.useCallback)(e=>{t.setQueryData(s,t=>t&&{...t,keys:e,message:en(e)})},[t,s]),w=(0,B.useCallback)(async(t,n)=>{if(p){let r=await v({...e,project:a,file:o,key:t,value:n});C(r.keys)}else await x(On(m??``,{[t]:n}))},[p,v,e,a,o,C,x,m]),T=(0,B.useCallback)(async t=>{if(p){let n=await b({...e,project:a,file:o,key:t});C(n.keys)}else await x(gn(m??``,t))},[p,b,e,a,o,C,x,m]),[E,D]=(0,B.useState)(void 0),k=(0,B.useCallback)(()=>u(),[u]),[ee,te]=(0,B.useState)(!1);return ee&&!p?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Uv,{}),(0,H.jsxs)(y,{type:`button`,variant:`defaultOutline`,size:`sm`,className:`absolute top-11 right-4 z-10`,onClick:()=>te(!1),children:[(0,H.jsx)(Nn,{}),` Secrets view`]})]}):(0,H.jsxs)(`div`,{className:`pt-12 px-4 pb-8 max-w-4xl`,children:[(0,H.jsxs)(`div`,{className:`mb-4`,children:[(0,H.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n?.name}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ut,{className:`inline-block size-4 me-1 align-text-bottom`}),`This Harper version protects environment secrets: values stay on the instance and are edited by key — they can be replaced or removed, but never read back.`]}):`Values are masked to prevent accidental disclosure. Revealing one is a deliberate action.`}),!p&&d!==void 0&&(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Showing unsaved changes from the text editor — saving a secret writes those too.`})]}),(0,H.jsx)(Ot,{rows:h,isFetching:l,onRefresh:k,canManage:g,selectedName:E,onSelectName:D,addDescription:p?`The value is written to this application’s env file on the instance. It can be replaced or removed later, but never read back.`:`The value is written to ${n?.name??`this env file`} in this application.`,editDescription:p?`The current value can’t be shown — this Harper version never returns secret values. Enter a new value to replace it, or delete the secret.`:`Reveal the current value, or enter a replacement.`,onSet:w,onDelete:g?T:void 0,children:!p&&(0,H.jsxs)(y,{variant:`defaultOutline`,onClick:()=>te(!0),children:[(0,H.jsx)(Cr,{}),(0,H.jsx)(`span`,{className:`hidden lg:inline-block`,children:`Edit as text`})]})})]})}function Gv({media:e}){let{openedEntry:t,openedEntryContents:n}=V(),{content:r}=Ja(!!t&&!t.package&&t.path),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(void 0);if(i)return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Uv,{}),(0,H.jsxs)(y,{type:`button`,variant:`defaultOutline`,size:`sm`,className:`absolute top-11 right-4 z-10`,onClick:()=>a(!1),children:[(0,H.jsx)(zr,{}),` Preview`]})]});let c=r??n;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`mt-9 absolute top-0 right-0 bottom-0 left-0`,children:c&&(c===void 0||c!==o)?(0,H.jsx)(`img`,{className:`w-full h-full object-contain p-20`,alt:t?.name,src:`data:${e.mime};charset=utf-8,${encodeURIComponent(c)}`,onError:()=>s(c)}):c?(0,H.jsx)(`div`,{className:`w-full h-full flex items-center justify-center p-8 text-center text-muted-foreground`,children:(0,H.jsxs)(`p`,{className:`max-w-md text-sm`,children:[`This `,t?.name??`image`,` `,`couldn’t be rendered. Edit it as text to inspect or fix the markup.`]})}):null}),(0,H.jsxs)(y,{type:`button`,variant:`defaultOutline`,size:`sm`,className:`absolute top-11 right-4 z-10`,onClick:()=>a(!0),children:[(0,H.jsx)(Cr,{}),` Edit as text`]})]})}function Kv(e){let{user:t}=A(),n=We(),{instance:r,cluster:i}=T({strict:!1}),a=n.instanceClient.defaults.baseURL;return(0,B.useMemo)(()=>{let n=at(e),r=[t?.username&&` --deploymentUsername="${t?.username}"`,a&&` --deploymentURL="${a}"`].filter(Ue).join(``);return[{title:`Install or update the Harper CLI`,code:`npm install -g harper`},{title:`Create your awesome app`,code:`npm create harper ${n}${r.length?` --`:``}${r}`,note:`You will be asked some easy questions to get you started. To make deployments easy, enter your password for this cluster. It will get saved into your local .env file.`},{title:`Start local Harper instance`,code:`npm run dev`,note:`You will be prompted to configure Harper.`},{title:`Learn, make changes, grow!`,code:`cat AGENTS.md`},{title:`Deploy!`,code:`npm run deploy`,note:`Remember that .env file? It makes this deployment easy!`}]},[e,a,t?.username])}function qv({defaultApplicationName:e,formState:t,watch:n}){let r=n(`applicationName`)||e,i=Kv(r),a=Pn(...i.map(e=>e.code));return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(ne,{children:[(0,H.jsx)(P,{children:`Deploy with Harper CLI`}),(0,H.jsx)(re,{children:`Follow these steps to deploy your application using the Harper CLI`})]}),(0,H.jsxs)(F,{className:`space-y-6`,children:[i.map((e,t)=>(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0`,children:t+1}),(0,H.jsx)(`h3`,{children:e.title})]}),(0,H.jsxs)(`div`,{className:`ml-8`,children:[(0,H.jsxs)(`div`,{className:`bg-muted dark:bg-black rounded-lg p-4 flex items-center justify-between group`,children:[(0,H.jsx)(`code`,{className:`text-sm overflow-auto pl-8 -indent-8 wrap-anywhere`,children:e.code}),(0,H.jsx)(y,{type:`button`,variant:`default`,size:`sm`,onClick:a[t],children:(0,H.jsx)(Rn,{className:`w-4 h-4`})})]}),e.note&&(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm mt-2`,children:e.note})]}),(0,H.jsx)(Lt,{className:`bg-border`})]},e.title)),r&&(0,H.jsxs)(`div`,{className:`bg-accent rounded-lg p-4`,children:[(0,H.jsxs)(`p`,{className:`text-sm`,children:[(0,H.jsx)(`strong`,{children:`Application Name:`}),` `,r]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm mt-2`,children:`Your application will be deployed with this name`})]}),(0,H.jsxs)(y,{className:`w-full`,variant:`secondary`,disabled:!t.isValid,children:[(0,H.jsx)(ve,{className:`w-4 h-4 mr-2`}),`I Have Completed These Steps`]})]})]})}function Jv({control:e,defaultApplicationName:t}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(ne,{children:[(0,H.jsx)(P,{children:`Application Name`}),(0,H.jsx)(re,{children:`Choose a name for your new API application`})]}),(0,H.jsx)(F,{children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(rn,{control:e,name:`applicationName`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`Name`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{type:`text`,autoCapitalize:`words`,autoComplete:`off`,autoFocus:!0,placeholder:t,...e})}),(0,H.jsx)(hn,{})]})}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Use lowercase letters, numbers, underscores, and hyphens`})]})})]})}var Yv=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,Xv=/^(?:[^@/]+@)?([^/:]+):/;function Zv(e){let t=e.trim();if(!t)return null;if(Yv.test(t))try{return new URL(t).hostname||null}catch{return null}let n=Xv.exec(t);return n?n[1]:null}function Qv(e,t){let n=e.trim(),r=Zv(n);if(!r)return e;let i=r.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),a=RegExp(`(^|@|//)${i}(?=[:/]|$)`);return n.replace(a,(e,n)=>`${n}${t}`)}function $v({control:e,setValue:t,watch:n}){let r=E({strict:!1}),i=He(),a=n(`contents.requiresAuth`),o=n(`contents.ref`),s=n(`contents.sshKeyName`),{data:c}=O({...Jt(i),enabled:a}),{data:l}=O({...Ut({...i,name:s}),refetchInterval:!1,enabled:a&&!!s}),u=Zv(o),d=l?.host,f=!!u&&!!d&&u.toLowerCase()===d.toLowerCase(),p=!!u&&!!d&&!f,m=p?Qv(o,d):``,h=(0,B.useCallback)(()=>{t(`contents.ref`,m,{shouldValidate:!0,shouldDirty:!0})},[t,m]),g;return g=c&&c.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rn,{control:e,name:`contents.sshKeyName`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`SSH Key`}),(0,H.jsx)(bn,{children:(0,H.jsxs)(pe,{value:e.value||``,onValueChange:e.onChange,children:[(0,H.jsx)(ue,{className:`w-full`,children:(0,H.jsx)(fe,{placeholder:`Choose an SSH key`})}),(0,H.jsx)(le,{children:c.map(e=>(0,H.jsx)(se,{value:e.name,children:e.name},e.name))})]})})]})}),!s&&(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select the SSH key this repository uses so we can verify the URL.`}),f&&(0,H.jsxs)(jn,{children:[(0,H.jsx)(an,{className:`h-4 w-4`}),(0,H.jsx)(wn,{children:(0,H.jsxs)(`span`,{children:[`This URL targets `,(0,H.jsx)(`code`,{children:d}),`, matching the selected key.`]})})]}),p&&(0,H.jsxs)(jn,{variant:`warning`,children:[(0,H.jsx)(ot,{className:`h-4 w-4`}),(0,H.jsxs)(wn,{children:[(0,H.jsxs)(`span`,{children:[`The URL targets `,(0,H.jsx)(`code`,{children:u}),`, but the selected key `,(0,H.jsx)(`strong`,{children:s}),` uses the host`,` `,(0,H.jsx)(`code`,{children:d}),`. SSH auth resolves the key from the host in the URL, so this import will likely fail to authenticate. Did you mean:`]}),(0,H.jsx)(`code`,{className:`block break-all`,children:m}),(0,H.jsx)(y,{type:`button`,variant:`defaultOutline`,size:`sm`,onClick:h,children:`Use suggested URL`})]})]})]}):(0,H.jsx)(jn,{children:(0,H.jsx)(wn,{children:(0,H.jsxs)(`span`,{children:[`Manage your SSH keys in`,` `,(0,H.jsx)(D,{to:Zn(r,`config`),className:`underline`,children:`Config`}),` >`,` `,(0,H.jsx)(D,{to:Zn(r,`config/ssh-keys`),className:`underline`,children:`SSH Keys`}),`. This enables SSH based auth for private repos, i.e. following the pattern of`,` `,(0,H.jsx)(`a`,{href:`https://github.com/HarperFast/Studio`,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`git@github.com:HarperFast/studio.git`}),`. If you have more than one key, make sure to utilize unique hostnames!`]})})}),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Qt,{children:`Authorization`}),(0,H.jsx)(rn,{control:e,name:`contents.requiresAuth`,render:({field:e})=>(0,H.jsxs)(Ee,{className:`w-full pt-2 pb-0 mb-0`,value:String(e.value),onValueChange:t=>e.onChange(t===`true`),children:[(0,H.jsxs)(Te,{className:`grid w-full grid-cols-2`,children:[(0,H.jsx)(Ce,{value:`false`,children:`Public Access`}),(0,H.jsx)(Ce,{value:`true`,children:`Requires Auth`})]}),(0,H.jsx)(we,{value:`false`,className:`space-y-4 mt-4`}),(0,H.jsx)(we,{value:`true`,className:`space-y-4 mt-4`,children:g})]})})]})}function ey({control:e,formState:t,isImportingApplication:n,setValue:r,watch:i}){let a=i(`contents.source`),o=(0,B.useCallback)(e=>{r(`contents.source`,e)},[r]);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(ne,{children:[(0,H.jsx)(P,{children:`Import Existing Application`}),(0,H.jsx)(re,{children:`Import from Git, NPM, or a tarball URL`})]}),(0,H.jsxs)(F,{className:`space-y-6`,children:[(0,H.jsxs)(Ee,{value:a,onValueChange:o,children:[(0,H.jsxs)(Te,{className:`grid w-full grid-cols-3`,children:[(0,H.jsxs)(Ce,{value:`git`,children:[(0,H.jsx)(Rr,{className:`w-4 h-4 mr-2`}),`Git`]}),(0,H.jsxs)(Ce,{value:`npm`,children:[(0,H.jsx)(Bn,{className:`w-4 h-4 mr-2`}),`NPM`]}),(0,H.jsxs)(Ce,{value:`tarball`,children:[(0,H.jsx)(Vr,{className:`w-4 h-4 mr-2`}),`Tarball`]})]}),(0,H.jsx)(we,{value:`git`,className:`space-y-4 mt-4`,children:(0,H.jsx)(`div`,{className:`space-y-2`,children:(0,H.jsx)(rn,{control:e,name:`contents.ref`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`Git Repository URL`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{type:`text`,autoCapitalize:`none`,autoComplete:`off`,autoFocus:!0,...e})}),(0,H.jsx)(hn,{})]})})})}),(0,H.jsx)(we,{value:`npm`,className:`space-y-4 mt-4`,children:(0,H.jsx)(`div`,{className:`space-y-2`,children:(0,H.jsx)(rn,{control:e,name:`contents.ref`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`NPM Package Reference`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{type:`text`,autoCapitalize:`none`,autoComplete:`off`,autoFocus:!0,...e})}),(0,H.jsx)(hn,{})]})})})}),(0,H.jsx)(we,{value:`tarball`,className:`space-y-4 mt-4`,children:(0,H.jsx)(`div`,{className:`space-y-2`,children:(0,H.jsx)(rn,{control:e,name:`contents.ref`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`Tarball URL`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{type:`url`,autoCapitalize:`none`,autoComplete:`off`,autoFocus:!0,...e})}),(0,H.jsx)(hn,{})]})})})})]}),(0,H.jsx)(rn,{control:e,name:`contents.installCommand`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`Install Command`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{type:`text`,autoCapitalize:`none`,autoComplete:`off`,placeholder:`npm install`,...e})}),(0,H.jsx)(hn,{})]})}),a===`git`&&(0,H.jsx)($v,{control:e,setValue:r,watch:i}),(0,H.jsx)(Lt,{className:`bg-border`}),(0,H.jsxs)(y,{className:`w-full`,disabled:!t.isValid||n,children:[(0,H.jsx)(kt,{className:`w-4 h-4 mr-2`}),`Import Application`]})]})]})}var ty=u({type:p(`template`),id:g(`Please select a template.`)}),ny={type:`template`,id:ke[0].id},ry=u({type:p(`import`),source:f([`git`,`npm`,`tarball`]),ref:g().nonempty(`Please enter a URL or package reference.`),installCommand:g(),requiresAuth:d(),sshKeyName:g()}),iy={type:`import`,source:`git`,ref:``,requiresAuth:!1,installCommand:``,sshKeyName:``},ay=u({type:p(`cli`)}),oy={type:`cli`},sy=u({applicationName:g().trim().max(75,{error:`Application name cannot be longer than 75 characters.`}).regex(/^[a-zA-Z0-9-_]*$/,{error:`Can only contain letters, numbers, dashes and underscores.`}),contents:h(`type`,[ty,ry,ay])});function cy({control:e,formState:t,isCreatingFromTemplate:n}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(ne,{children:[(0,H.jsx)(P,{children:`Choose a Template`}),(0,H.jsx)(re,{children:`Start with a pre-configured template for common use cases`})]}),(0,H.jsxs)(F,{children:[(0,H.jsx)(rn,{control:e,name:`contents.id`,render:({field:e})=>(0,H.jsx)(Ge,{value:e.value,onValueChange:e.onChange,children:(0,H.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:ke.map(e=>(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(ln,{value:e.id,id:e.id,className:`peer sr-only`}),(0,H.jsxs)(Dn,{htmlFor:e.id,className:`flex flex-col gap-3 p-4 border-2 rounded-lg cursor-pointer hover:bg-accent peer-data-[state=checked]:border-green peer-data-[state=checked]:bg-primary/5`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 justify-between`,children:[(0,H.jsx)(`div`,{children:e.name}),(0,H.jsx)(`a`,{href:e.githubUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:Rt,className:`opacity-70 hover:opacity-100 transition-colors -m-4 p-4`,children:(0,H.jsx)(`img`,{src:`/github/GitHub_Lockup_White.svg`,alt:`GitHub`,className:`h-4 invert dark:invert-0`})})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e.description})]}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.tags.map(e=>(0,H.jsx)(wt,{variant:`outline`,children:e},e))})]})]},e.id))})})}),(0,H.jsx)(Lt,{className:`my-6 bg-border`}),(0,H.jsxs)(y,{className:`w-full`,disabled:!t.isValid||n,children:[(0,H.jsx)(kt,{className:`w-4 h-4 mr-2`}),`Create from Template`]})]})]})}function ly(e){let t=We(),{reloadRootEntries:n,setFocusedItem:r,setExpandedItems:i,setSelectedItems:a}=V(),o=(0,B.useCallback)(({project:o})=>{let s=M.loading(`Looking for application...`,{description:`This may take a bit.`,duration:3e5});e(!0),n().then(n=>{let c=n?.entries||[];for(let n of c)if(n.name.toLowerCase()===o.toLowerCase()){r(n.name),a([n.name]),i([n.name]),e(!1),M.success(`Imported successfully`,{description:`${o} is now available in your ${t.entityType}!`,id:s,duration:5e3});return}M.warning(`Deployment Not Detected`,{description:`I searched for ${o} but did not find it in the ${t.entityType} yet. Do you see it on the left? Did you use a different name, perhaps?`,id:s,duration:1e4}),e(!1)})},[t,e,n,r,i,a]);return(0,B.useMemo)(()=>({checkCLI:o}),[o])}function uy(e){let{mutate:t,isPending:n}=Oe(),r=We(),{reloadRootEntries:i,setFocusedItem:a,setExpandedItems:o,setSelectedItems:s}=V(),c=(0,B.useCallback)(({contents:n,project:c})=>{let l=M.loading(`Creating from template...`,{description:`This may take a bit.`,duration:3e5}),u=Ne(ke,`id`,n.id);if(!u)return M.error(`Template Not Found`,{description:`Please select a template`,duration:1e4,id:l});t({project:c,template:u.npm||u.githubUrl,...r},{onSuccess:()=>{M.success(`Created successfully!`,{description:`${c} will be available once you restart your ${r.entityType}!`,id:l,duration:5e3}),e(!0),i(),a(c),s([c]),o([c])}})},[t,r,e,i,a,o,s]);return(0,B.useMemo)(()=>({isCreatingFromTemplate:n,createFromTemplate:c}),[n,c])}var dy=1500,fy=2e3,py=8,my=new Set([`healthy`,`warning`,`error`]);function hy(e,t){return e.entries.find(e=>e.name===t&&`entries`in e)}function gy(e){return(0,B.useCallback)(async t=>{await r(dy);let n={level:`indeterminate`};for(let i=0;i<py;i++){try{let r=hy(await Gn(e),t)?.status;if(r&&(n={level:r.status,message:r.message},my.has(r.status)))return n}catch{}i<7&&await r(fy)}return n},[e])}function _y(e,t){switch(t.level){case`healthy`:M.success(`${e} deployed and healthy`,{description:t.message});return;case`warning`:M.warning(`${e} deployed with warnings`,{description:t.message??`The component loaded but reported a warning.`});return;case`error`:M.error(`${e} deployed but failed to load`,{description:t.message??`The component reported an error after deploying.`});return;default:M.success(`${e} deployed`,{description:`Still verifying — the component is loading. Check its status shortly.`});return}}async function vy({applicationName:e,applicationUrl:t,installCommand:n,entityType:r,entityId:i,instanceClient:a,useSSE:o,onEvent:s,signal:c}){let l=r===`cluster`;if(o&&i)try{return await Ft({connection:{id:i},package:t,project:e,replicated:l,install_command:n,restart:`rolling`,signal:c,onEvent:s})}catch(e){if(!(e instanceof Yn))throw e}let{data:u}=await a.post(`/`,{operation:`deploy_component`,package:t,project:e,replicated:l,install_command:n||void 0,restart:`rolling`},{timeout:3e5});return u}function yy(){return C({mutationFn:vy})}var by={prepare:`Preparing…`,load:`Loading component…`,replicate:`Replicating to nodes…`,restart:`Restarting…`,success:`Finishing…`};function xy(e){let{mutate:t,isPending:n}=yy(),r=S(),i=He(),a=qn(),o=gy(i),{reloadRootEntries:s,setFocusedItem:c,setExpandedItems:l,setSelectedItems:u}=V(),d=(0,B.useCallback)(t=>{e(!0),Ht(r,i.entityId),s(),c(t),u([t]),l([t])},[r,i.entityId,s,c,u,l,e]),f=(0,B.useCallback)(({contents:e,project:n})=>{let r=M.loading(`Importing application...`,{description:`This may take a bit.`,duration:3e5});t({applicationName:n,applicationUrl:e.ref,installCommand:e.installCommand,useSSE:a,onEvent:e=>{e.type===`phase`&&e.data.status===`start`?M.loading(`Importing ${n}…`,{id:r,description:by[e.data.phase]??e.data.phase,duration:3e5}):e.type===`install`&&e.data.line?.trim()&&M.loading(`Importing ${n}…`,{id:r,description:e.data.line.trim().slice(0,140),duration:3e5})},...i},{onSuccess:async()=>{M.dismiss(r),d(n),a?_y(n,await o(n)):M.success(`Imported successfully`,{description:`${n} will be available once you restart your ${i.entityType}!`,duration:5e3})},onError:async e=>{if(M.dismiss(r),e instanceof Qe){d(n),_y(n,await o(n));return}M.error(`Failed to import ${n}`,{description:e instanceof Error?e.message:void 0})}})},[t,a,i,o,d]);return(0,B.useMemo)(()=>({isImportingApplication:n,importApplication:f}),[n,f])}function Sy(){let{rootEntries:e}=V(),{organization:t,instance:n,cluster:r}=T({strict:!1}),i=(0,B.useMemo)(()=>{let i=at(r?.name||n?.name||t?.name||``);if(i===``)return i;let a=i,o=1;for(;Ne(e,`name`,a);)o+=1,a=`${i}-${o}`;return a},[e,r,n,t]),a=(0,B.useCallback)((t,n)=>{!t.applicationName&&!i?n.addIssue({code:`custom`,path:[`applicationName`],message:`Please name your application!`}):e.find(e=>e.name===t.applicationName)&&n.addIssue({code:`custom`,path:[`applicationName`],message:`That application name is already in use!`})},[i,e]),o=N({resolver:j(sy.superRefine(a)),defaultValues:{applicationName:``,contents:{...iy,...oy,...ny}}}),{watch:s,handleSubmit:c,control:l,setValue:u,formState:d,trigger:f}=o,[p,m]=(0,B.useState)(!1),{isCreatingFromTemplate:h,createFromTemplate:g}=uy(m),{isImportingApplication:_,importApplication:v}=xy(m),{checkCLI:y}=ly(m),b=(0,B.useCallback)(e=>{let t=e.applicationName||i;switch(e.contents.type){case`template`:g({contents:e.contents,project:t});break;case`import`:v({contents:e.contents,project:t});break;case`cli`:y({contents:e.contents,project:t})}},[y,g,i,v]),x=s(`contents.type`),S=(0,B.useCallback)(e=>{let t=d.isValid;u(`contents.type`,e),t||f()},[u,d,f]);return(0,H.jsxs)(`div`,{className:`mx-auto max-w-4xl mt-6`,children:[(0,H.jsxs)(`div`,{className:`text-center`,children:[(0,H.jsx)(`h1`,{className:`text-4xl pt-4 pb-2`,children:`Bootstrap New API Application`}),(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new application from templates, import existing code, or deploy with Harper CLI`})]}),(0,H.jsx)(Un,{...o,children:(0,H.jsx)(`form`,{id:`instance-add-application-form`,name:`instance-add-application-form`,onSubmit:c(b),className:`flex flex-col gap-4 p-4`,children:(0,H.jsxs)(`fieldset`,{disabled:_||h||p,children:[(0,H.jsx)(ie,{className:`dark:bg-black-dark`,children:(0,H.jsx)(Jv,{control:l,defaultApplicationName:i})}),(0,H.jsx)(ie,{className:`dark:bg-black-dark mt-4 pt-0`,children:(0,H.jsxs)(Ee,{defaultValue:x,onValueChange:S,children:[(0,H.jsxs)(Te,{className:`w-full grid grid-cols-3 mt-0`,children:[(0,H.jsxs)(Ce,{value:`template`,children:[(0,H.jsx)(yr,{}),(0,H.jsx)(`span`,{className:`hidden sm:inline-block`,children:`Templates`})]}),(0,H.jsxs)(Ce,{value:`import`,children:[(0,H.jsx)(Lr,{}),`Import`]}),(0,H.jsxs)(Ce,{value:`cli`,children:[(0,H.jsx)(it,{}),(0,H.jsx)(`span`,{className:`hidden md:inline-block`,children:`Harper`}),` CLI`]})]}),(0,H.jsx)(`div`,{className:`mx-6 mt-1`,children:(0,H.jsx)(Lt,{className:`bg-border`})}),(0,H.jsx)(we,{value:`template`,className:`space-y-4`,children:(0,H.jsx)(cy,{control:l,formState:d,isCreatingFromTemplate:h})}),(0,H.jsx)(we,{value:`import`,className:`space-y-4`,children:(0,H.jsx)(ey,{control:l,formState:d,isImportingApplication:_,setValue:u,watch:s})}),(0,H.jsx)(we,{value:`cli`,className:`space-y-4`,children:(0,H.jsx)(qv,{defaultApplicationName:i,formState:d,watch:s})})]})})]})})})]})}var Cy=[`table`,`export`,`sealed`],wy=[`primaryKey`,`indexed`,`computed`,`relationship`,`createdTime`,`updatedTime`,`expiresAt`,`enumerable`,`allow`],Ty={table:[`table`,`database`,`expiration`,`audit`,`eviction`,`scanInterval`,`replicate`,`randomAccessFields`],export:[`name`,`rest`,`mqtt`],indexed:[`type`,`distance`,`efConstruction`,`M`,`optimizeRouting`,`mL`,`efConstructionSearch`],computed:[`from`,`version`],relationship:[`from`,`to`],allow:[`role`]};function Ey(e,t,n){let r=e=>{let t=n.indexOf(e);return t<0?n.length:t};return e.map((e,t)=>({item:e,index:t})).sort((e,n)=>r(t(e.item))-r(t(n.item))||e.index-n.index).map(e=>e.item)}function Dy(e){if(e.args.length===0)return`@${e.name}`;let t=Ey(e.args,e=>e.name,Ty[e.name]??[]);return`@${e.name}(${t.map(e=>`${e.name}: ${e.value}`).join(`, `)})`}function Oy(e,t){return Ey(e,e=>e.name,t).map(Dy).join(` `)}function ky(e,t,n){for(let r of t.split(`
292
- `)){let t=r.replace(/\r$/,``).replace(/^[ \t]+/,``);e.push(t?`${n}${t}`:``)}}function Ay(e,t){let{indent:n,newline:r}=t,i=Oy(e.directives,Cy),a=`type ${e.typeName}${i?` ${i}`:``} {`,o=[e.headerComment?`${a} ${e.headerComment}`:a];for(let t of e.fields){if(!t.name.trim())continue;for(let e of t.leadingComments)ky(o,e,n);let e=[Oy(t.directives,wy),t.lineComment].filter(Boolean).join(` `);o.push(`${n}${t.name}: ${bt(t.type)}${e?` ${e}`:``}`)}for(let t of e.trailingComments)ky(o,t,n);return`${o.join(r)}${r}}`}function jy(e,t){if(e.kind===`raw`)return e.text;let{table:n}=e;return n.edited?n.leading+Ay(n,t):n.leading+n.raw}function My(e){let t=new Set;e.segments.forEach((n,r)=>{if(n.kind===`table`&&n.table.typeName.trim()===``){t.add(r);let n=e.segments[r-1];n?.kind===`raw`&&n.text.trim()===``&&t.add(r-1);let i=e.segments[r+1];i?.kind===`raw`&&i.text.trim()===``&&t.add(r+1)}});let n=e.segments.filter((e,n)=>!t.has(n));if(n.some(e=>e.kind===`table`&&e.table.edited)){let e=[];n.forEach((t,n)=>{t.kind===`table`&&e.push(n)});let t=e.map(e=>n[e].table).sort((e,t)=>e.typeName.localeCompare(t.typeName));e.forEach((e,r)=>{n[e]={kind:`table`,table:t[r]}})}return n.map(t=>jy(t,e)).join(``)}var Ny=/^[_A-Za-z][_0-9A-Za-z]*$/;function Py(e){return Ny.test(e)}var Fy=`Use letters, numbers, and underscores, and don’t start with a number.`;function Iy(e){return e.segments.flatMap(e=>e.kind===`table`?[e.table]:[])}function Ly(e){let t=new Set,n=new Set;for(let r of e)t.has(r)&&n.add(r),t.add(r);return n}function Ry(e,t){let n=[],r={tableId:e.id,tableName:e.typeName};Py(e.typeName)?t.has(e.typeName)&&n.push({...r,code:`DUPLICATE_TABLE_NAME`,message:`Another table is already named “${e.typeName}”.`}):n.push({...r,code:`INVALID_TABLE_NAME`,message:Fy});let i=e.fields.filter(e=>e.name.trim()!==``);i.length===0&&n.push({...r,code:`NO_FIELDS`,message:`A table needs at least one field.`});let a=Ly(i.map(e=>e.name));for(let t of e.fields){if(t.name.trim()===``)continue;let e={...r,fieldKey:t.key,fieldName:t.name};Py(t.name)?a.has(t.name)&&n.push({...e,code:`DUPLICATE_FIELD_NAME`,message:`Another field is already named “${t.name}”.`}):n.push({...e,code:`INVALID_FIELD_NAME`,message:Fy})}return n}function zy(e){let t=Iy(e).filter(e=>e.typeName.trim()!==``),n=Ly(t.map(e=>e.typeName));return t.flatMap(e=>Ry(e,n))}var By=0;function Vy(e){return Qn(e).document}function Hy(e){let t=Pt(`new-${By++}`),n=My(e),r=[{kind:`raw`,text:n.length===0?``:n.endsWith(`
293
- `)?e.newline:e.newline+e.newline},{kind:`table`,table:t},{kind:`raw`,text:e.newline}];return{...e,segments:[...e.segments,...r]}}function Uy(e,t){switch(t.type){case`reset`:return Vy(t.source);case`addTable`:return Hy(e);case`removeTable`:return{...e,segments:e.segments.filter(e=>e.kind!==`table`||e.table.id!==t.id)};case`updateTable`:return{...e,segments:e.segments.map(e=>e.kind===`table`&&e.table.id===t.id?{kind:`table`,table:{...t.table,edited:!0}}:e)}}}function Wy(e){return e.segments.flatMap(e=>e.kind===`table`?[e.table]:[])}function Gy(e){return e.segments.some(e=>e.kind===`raw`&&e.text.replace(/#[^\n]*/g,``).trim().length>0)}var Ky=`dark:bg-grey-600 dark:border-grey-500`;function qy({label:e,children:t}){let{toggled:n,toggle:r}=kn(!1);return(0,H.jsxs)(`div`,{className:`mt-3`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:r,className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[n?(0,H.jsx)(ye,{className:`size-4`}):(0,H.jsx)(xe,{className:`size-4`}),e]}),n&&(0,H.jsx)(`div`,{className:`mt-2 pl-1`,children:t})]})}function Jy({label:e,checked:t,onChange:n,disabled:r,description:i}){let a=(0,B.useId)();return(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(gt,{id:a,checked:t,onCheckedChange:n,disabled:r}),(0,H.jsxs)(Dn,{htmlFor:a,className:_(`font-normal`,r&&`opacity-50`),children:[e,i&&(0,H.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground italic`,children:i})]})]})}function Yy({label:e,value:t,onChange:n,placeholder:r,disabled:i,invalid:a,error:o}){let s=(0,B.useId)();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(Dn,{htmlFor:s,className:`text-xs text-muted-foreground`,children:e}),(0,H.jsx)(Fn,{id:s,type:`text`,className:Ky,value:t,placeholder:r,disabled:i,"aria-invalid":a||void 0,onChange:e=>n(e.target.value)}),o&&(0,H.jsx)(`span`,{className:`text-xs text-destructive`,children:o})]})}function Xy({label:e,value:t,onChange:n,disabled:r,min:i}){let a=(0,B.useId)();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(Dn,{htmlFor:a,className:`text-xs text-muted-foreground`,children:e}),(0,H.jsx)(Fn,{id:a,type:`number`,className:Ky,min:i,step:1,value:t??``,disabled:r,onChange:e=>n(e.target.value===``?void 0:Number(e.target.value))})]})}var Zy=new Set([`primaryKey`,`indexed`,`computed`,`relationship`,`allow`,`createdTime`,`updatedTime`,`expiresAt`,`enumerable`]);function Qy({field:e,typeNames:t,readOnly:n,disableRemove:r,error:i,onChange:a,onRemove:o}){let s=t=>a({...e,directives:t}),c=(t,n)=>s(vn(e.directives,t,n)),l=(t,n,r)=>s(_n(e.directives,t,n,r)),u=(t,n,r)=>s(Je(e.directives,t,n,r)),d=(t,n)=>tt(et(e.directives,t,n))??``,f=(t,n)=>Tt(et(e.directives,t,n)),p=Ze(e),m=Jn(e),h=It(e),g=$e(e.directives,`indexed`),_=e.directives.filter(e=>!Zy.has(e.name));return(0,H.jsxs)(`div`,{className:`rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-[1fr_1fr_auto]`,children:[(0,H.jsx)(Yy,{label:`Field name`,value:e.name,disabled:n,invalid:!!i,error:i,onChange:t=>a({...e,name:t})}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Type`}),(0,H.jsxs)(pe,{value:p,disabled:n,onValueChange:t=>a({...e,type:tn(t,m,h)}),children:[(0,H.jsx)(ue,{className:`w-full ${Ky}`,children:(0,H.jsx)(fe,{})}),(0,H.jsxs)(le,{children:[O_.map(e=>(0,H.jsx)(se,{value:e.name,children:e.name},e.name)),t.filter(e=>!O_.some(t=>t.name===e)).map(e=>(0,H.jsx)(se,{value:e,children:e},e)),p&&!O_.some(e=>e.name===p)&&!t.includes(p)&&(0,H.jsx)(se,{value:p,children:p})]})]})]}),(0,H.jsx)(y,{type:`button`,variant:`destructiveGhost`,size:`icon`,className:`self-end`,disabled:n||r,onClick:o,title:r?`A table needs at least one field`:`Remove field`,children:(0,H.jsx)(zt,{})})]}),(0,H.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-6 gap-y-2`,children:[(0,H.jsx)(Jy,{label:`Array`,checked:m,disabled:n,onChange:t=>a({...e,type:tn(p,t,h)})}),(0,H.jsx)(Jy,{label:`Required`,checked:h,disabled:n,onChange:t=>a({...e,type:tn(p,m,t)})}),(0,H.jsx)(Jy,{label:`Primary key`,checked:$e(e.directives,`primaryKey`),disabled:n,onChange:e=>c(`primaryKey`,e)}),(0,H.jsx)(Jy,{label:`Indexed`,checked:g,disabled:n,onChange:e=>c(`indexed`,e)})]}),(0,H.jsx)(qy,{label:`Advanced`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,H.jsx)(Jy,{label:`Created time`,description:`set on insert`,checked:$e(e.directives,`createdTime`),disabled:n,onChange:e=>c(`createdTime`,e)}),(0,H.jsx)(Jy,{label:`Updated time`,description:`set on update`,checked:$e(e.directives,`updatedTime`),disabled:n,onChange:e=>c(`updatedTime`,e)}),(0,H.jsx)(Jy,{label:`Expires at`,checked:$e(e.directives,`expiresAt`),disabled:n,onChange:e=>c(`expiresAt`,e)}),(0,H.jsx)(Jy,{label:`Enumerable`,checked:$e(e.directives,`enumerable`),disabled:n,onChange:e=>c(`enumerable`,e)})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,H.jsx)(Yy,{label:`Relationship — from (this table's key field)`,value:d(`relationship`,`from`),disabled:n,onChange:e=>l(`relationship`,`from`,e)}),(0,H.jsx)(Yy,{label:`Relationship — to (other table's key field)`,value:d(`relationship`,`to`),disabled:n,onChange:e=>l(`relationship`,`to`,e)}),(0,H.jsx)(Yy,{label:`Computed — from (expression)`,value:d(`computed`,`from`),disabled:n,onChange:e=>l(`computed`,`from`,e)}),(0,H.jsx)(Xy,{label:`Computed — version`,value:f(`computed`,`version`),disabled:n,onChange:e=>u(`computed`,`version`,e)}),(0,H.jsx)(Yy,{label:`Allow — role`,value:d(`allow`,`role`),disabled:n,onChange:e=>l(`allow`,`role`,e)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:[`Index options `,(0,H.jsx)(`span`,{className:`italic`,children:`(vector / HNSW — requires Indexed)`})]}),(0,H.jsxs)(`div`,{className:`mt-2 grid grid-cols-1 gap-3 md:grid-cols-3`,children:[(0,H.jsx)(Yy,{label:`Index type`,placeholder:`HNSW`,value:d(`indexed`,`type`),disabled:n,onChange:e=>l(`indexed`,`type`,e)}),(0,H.jsx)(Yy,{label:`Distance`,placeholder:`cosine`,value:d(`indexed`,`distance`),disabled:n,onChange:e=>l(`indexed`,`distance`,e)}),(0,H.jsx)(Xy,{label:`efConstruction`,value:f(`indexed`,`efConstruction`),disabled:n,onChange:e=>u(`indexed`,`efConstruction`,e)}),(0,H.jsx)(Xy,{label:`M`,value:f(`indexed`,`M`),disabled:n,onChange:e=>u(`indexed`,`M`,e)}),(0,H.jsx)(Xy,{label:`optimizeRouting`,value:f(`indexed`,`optimizeRouting`),disabled:n,onChange:e=>u(`indexed`,`optimizeRouting`,e)}),(0,H.jsx)(Xy,{label:`mL`,value:f(`indexed`,`mL`),disabled:n,onChange:e=>u(`indexed`,`mL`,e)}),(0,H.jsx)(Xy,{label:`efConstructionSearch`,value:f(`indexed`,`efConstructionSearch`),disabled:n,onChange:e=>u(`indexed`,`efConstructionSearch`,e)})]})]}),_.length>0&&(0,H.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Preserved directives:`,` `,_.map(e=>(0,H.jsxs)(`code`,{className:`mr-1`,children:[`@`,e.name]},e.name))]})]})})]})}var $y=new Set([`table`,`export`,`sealed`]);function eb({table:e,typeNames:t,readOnly:n,errors:r,defaultCollapsed:i,onChange:a,onRemove:o}){let[s,c]=(0,B.useState)(i),l=t=>a({...e,directives:t}),u=(t,n)=>l(vn(e.directives,t,n)),d=(t,n,r)=>l(_n(e.directives,t,n,r)),f=(t,n,r)=>l(Je(e.directives,t,n,r)),p=(t,n,r,i)=>l(Ct(e.directives,t,n,r,i)),m=(t,n)=>tt(et(e.directives,t,n))??``,h=(t,n)=>Tt(et(e.directives,t,n)),g=(t,n,r)=>_t(et(e.directives,t,n))??r,_=$e(e.directives,`export`),v=r.find(e=>e.code===`INVALID_TABLE_NAME`||e.code===`DUPLICATE_TABLE_NAME`)?.message,b=r.some(e=>e.code===`NO_FIELDS`),x=new Map(r.filter(e=>e.fieldKey).map(e=>[e.fieldKey,e.message])),S=e.directives.filter(e=>!$y.has(e.name)),C=e.fields.length;return(0,H.jsx)(ie,{children:(0,H.jsxs)(F,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),"aria-expanded":!s,className:`flex flex-1 items-center gap-2 text-left`,children:[s?(0,H.jsx)(xe,{className:`size-4 shrink-0`}):(0,H.jsx)(ye,{className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{className:`font-medium`,children:e.typeName||(0,H.jsx)(`span`,{className:`text-muted-foreground italic`,children:`Untitled table`})}),(0,H.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[C,` field`,C===1?``:`s`,_?` · REST`:``]}),r.length>0&&(0,H.jsxs)(`span`,{className:`text-xs font-medium text-destructive`,children:[`⚠ `,r.length,` issue`,r.length===1?``:`s`]})]}),(0,H.jsxs)(y,{type:`button`,variant:`destructiveGhost`,size:`sm`,disabled:n,onClick:o,children:[(0,H.jsx)(zt,{}),` Remove table`]})]}),!s&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Yy,{label:`Table (type) name`,value:e.typeName,disabled:n,invalid:!!v,error:v,onChange:t=>a({...e,typeName:t})}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,H.jsx)(Jy,{label:`REST endpoint`,description:`@export`,checked:_,disabled:n,onChange:e=>u(`export`,e)}),(0,H.jsx)(Jy,{label:`Sealed`,description:`reject undefined properties`,checked:$e(e.directives,`sealed`),disabled:n,onChange:e=>u(`sealed`,e)})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,H.jsx)(Yy,{label:`Database`,placeholder:`data`,value:m(`table`,`database`),disabled:n,onChange:e=>d(`table`,`database`,e)}),(0,H.jsx)(Xy,{label:`Expiration (seconds, 0 = never)`,value:h(`table`,`expiration`),min:0,disabled:n,onChange:e=>f(`table`,`expiration`,e)})]}),(0,H.jsx)(qy,{label:`Advanced table options`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,H.jsx)(Yy,{label:`Table name override (@table table:)`,placeholder:e.typeName||`defaults to type name`,value:m(`table`,`table`),disabled:n,onChange:e=>d(`table`,`table`,e)}),(0,H.jsx)(Xy,{label:`Eviction (seconds after expiration)`,value:h(`table`,`eviction`),min:0,disabled:n,onChange:e=>f(`table`,`eviction`,e)}),(0,H.jsx)(Xy,{label:`Scan interval (seconds)`,value:h(`table`,`scanInterval`),min:0,disabled:n,onChange:e=>f(`table`,`scanInterval`,e)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,H.jsx)(Jy,{label:`Audit`,checked:g(`table`,`audit`,!1),disabled:n,onChange:e=>p(`table`,`audit`,e,!1)}),(0,H.jsx)(Jy,{label:`Replicate`,checked:g(`table`,`replicate`,!0),disabled:n,onChange:e=>p(`table`,`replicate`,e,!0)}),(0,H.jsx)(Jy,{label:`Random-access fields`,checked:g(`table`,`randomAccessFields`,!1),disabled:n,onChange:e=>p(`table`,`randomAccessFields`,e,!1)})]}),_&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 border-l-2 pl-3`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`REST endpoint (@export) options`}),(0,H.jsx)(Yy,{label:`Endpoint name override`,placeholder:e.typeName||`defaults to type name`,value:m(`export`,`name`),disabled:n,onChange:e=>d(`export`,`name`,e)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,H.jsx)(Jy,{label:`REST`,checked:g(`export`,`rest`,!0),disabled:n,onChange:e=>p(`export`,`rest`,e,!0)}),(0,H.jsx)(Jy,{label:`MQTT`,checked:g(`export`,`mqtt`,!0),disabled:n,onChange:e=>p(`export`,`mqtt`,e,!0)})]})]}),S.length>0&&(0,H.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Preserved directives:`,` `,S.map(e=>(0,H.jsxs)(`code`,{className:`mr-1`,children:[`@`,e.name]},e.name))]})]})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h4`,{className:`mb-2 text-sm font-medium`,children:`Fields`}),b&&(0,H.jsx)(`p`,{className:`mb-2 text-xs text-destructive`,children:`A table needs at least one field to be valid. Add one below.`}),(0,H.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.fields.map((r,i)=>(0,H.jsx)(Qy,{field:r,typeNames:t,readOnly:n,disableRemove:C===1,error:r.key?x.get(r.key):void 0,onChange:t=>a({...e,fields:e.fields.map((e,n)=>n===i?t:e)}),onRemove:()=>a({...e,fields:e.fields.filter((e,t)=>t!==i)})},r.key??i))}),(0,H.jsxs)(y,{type:`button`,variant:`ghost`,className:`mt-2 w-full`,disabled:n,onClick:()=>a({...e,fields:[...e.fields,Xn()]}),children:[(0,H.jsx)(cn,{}),` Add field`]})]})]})]})})}function tb(){let{openedEntry:e,openedEntryContents:t,isSavingFile:n,saveFile:r}=V(),i=He(),a=dt(),{content:o,setContent:s}=Ja(!!e&&!e.package&&e.path),c=o??t??``,l=(0,B.useRef)(c);l.current=c;let u=!!e?.package||!a,d=(0,B.useMemo)(()=>c.length<=524288&&Qn(c).ok,[c]),[f,p]=(0,B.useReducer)(Uy,l.current,Vy),[m,h]=(0,B.useState)(()=>!d),g=(0,B.useRef)(!1);(0,B.useEffect)(()=>{m||(p({type:`reset`,source:l.current}),g.current&&(g.current=!1,p({type:`addTable`})))},[t,m]);let _=(0,B.useMemo)(()=>My(f),[f]);(0,B.useEffect)(()=>{m||u||s(_===(t??``)?void 0:_)},[_,m,u,t,s]),rt(`SaveFile`,()=>{m||!e||n||o===void 0||zy(f).length>0||r({...i,file:e.path.split(`/`).slice(1).join(`/`),payload:o,project:e.project},e.path)},[m,e,i,o,n,f]),rt(`RevertChanges`,()=>{m||(s(void 0),p({type:`reset`,source:t??``}))},[m,t,s]),rt(`AddSchemaTable`,()=>{m?(g.current=!0,h(!1)):p({type:`addTable`})},[m]);let v=(0,B.useMemo)(()=>Wy(f),[f]),b=(0,B.useMemo)(()=>v.map(e=>e.typeName).filter(Boolean),[v]),x=(0,B.useMemo)(()=>Gy(f),[f]),S=(0,B.useMemo)(()=>zy(f),[f]),C=(0,B.useMemo)(()=>{let e=new Map;for(let t of S){let n=e.get(t.tableId);n?n.push(t):e.set(t.tableId,[t])}return e},[S]),w=!m&&!u&&S.length>0;return(0,B.useEffect)(()=>(R(`EditorSaveBlocked`,w),()=>R(`EditorSaveBlocked`,!1)),[w]),e?m?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Uv,{}),d&&(0,H.jsxs)(y,{type:`button`,variant:`defaultOutline`,size:`sm`,className:`absolute top-11 right-4 z-10 bg-background shadow-md`,onClick:()=>h(!1),children:[(0,H.jsx)(Nn,{}),` Visual editor`]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`mt-9 absolute inset-0 overflow-y-auto p-4 md:p-8`,children:(0,H.jsxs)(`div`,{className:`mx-auto flex max-w-4xl flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`pr-4`,children:[(0,H.jsx)(`h2`,{className:`text-xl`,children:`Schema`}),(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Tables in `,(0,H.jsx)(`code`,{children:e.name}),`. Changes save back to the file.`]})]}),S.length>0&&(0,H.jsxs)(jn,{variant:`destructive`,children:[(0,H.jsx)(ot,{}),(0,H.jsxs)(mn,{children:[`Fix `,S.length===1?`this issue`:`these issues`,` before saving`]}),(0,H.jsx)(wn,{children:(0,H.jsx)(`ul`,{className:`list-disc pl-4`,children:S.map((e,t)=>(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`span`,{className:`font-medium`,children:[e.tableName||`Untitled table`,e.fieldName?` → ${e.fieldName}`:``]}),`: `,e.message]},`${e.tableId}-${e.code}-${e.fieldKey??``}-${t}`))})})]}),v.length===0&&(0,H.jsxs)(`div`,{className:`rounded-lg border border-dashed p-8 text-center text-muted-foreground`,children:[(0,H.jsx)(`p`,{children:`No tables yet.`}),!u&&(0,H.jsx)(`p`,{className:`mt-1 text-sm`,children:`Use “Add table” to define your first one.`})]}),v.map(e=>(0,H.jsx)(eb,{table:e,typeNames:b,readOnly:u,errors:C.get(e.id)??[],defaultCollapsed:!e.id.startsWith(`new-`),onChange:t=>p({type:`updateTable`,id:e.id,table:t}),onRemove:()=>p({type:`removeTable`,id:e.id})},e.id)),x&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`This file has other content (e.g. non-table definitions) that isn’t shown here. It’s preserved as-is — switch to “Edit as text” to see it.`})]})}),(0,H.jsxs)(`div`,{className:`absolute top-11 right-4 z-10 flex gap-2`,children:[!u&&(0,H.jsxs)(y,{type:`button`,variant:`positive`,size:`sm`,className:`shadow-md`,onClick:()=>p({type:`addTable`}),children:[(0,H.jsx)(cn,{}),` Add table`]}),(0,H.jsxs)(y,{type:`button`,variant:`defaultOutline`,size:`sm`,className:`bg-background shadow-md`,onClick:()=>h(!0),children:[(0,H.jsx)(Cr,{}),` Edit as text`]})]})]}):null}function nb(){let{openedEntry:e,openedEntryContents:t}=V(),n=vo(e?.project);if(e?.path===`newApplication`)return(0,H.jsx)(Sy,{});if(z(e))return e.overviewEntry?(0,H.jsx)(`div`,{className:`directoryReadMe max-w-3xl`,children:(0,H.jsx)(Yf,{urlTransform:n,remarkPlugins:[$h],components:{code:ob},children:t})}):(0,H.jsx)(eg,{name:e.name});let r=Zt(e?.name);if(r)return(0,H.jsx)(ib,{name:e?.name,base64:t,media:r});let i=So(e?.name);return i?(0,H.jsx)(Gv,{media:i},e?.path):bo(e?.name)?(0,H.jsx)(rb,{name:e?.name}):En(e?.name)?(0,H.jsx)(Wv,{},e?.path):e?.name?.endsWith(`.graphql`)?(0,H.jsx)(tb,{},e.path):(0,H.jsx)(Uv,{})}function rb({name:e}){return(0,H.jsx)(`div`,{className:`absolute inset-0 mt-9 flex items-center justify-center p-8 text-center text-muted-foreground`,children:(0,H.jsxs)(`div`,{className:`max-w-md`,children:[(0,H.jsx)(Er,{className:`mx-auto mb-4 h-10 w-10 opacity-60`}),(0,H.jsxs)(`p`,{className:`font-medium text-foreground`,children:[e??`This file`,` can’t be previewed`]}),(0,H.jsx)(`p`,{className:`mt-1 text-sm`,children:`It’s a binary file. You can still rename or delete it from the file tree.`})]})})}function ib({name:e,base64:t,media:n}){if(!t)return null;let r=`data:${n.mime};base64,${t}`;return(0,H.jsx)(`div`,{className:`mt-9 absolute top-0 right-0 bottom-0 left-0`,children:n.kind===`video`?(0,H.jsx)(`video`,{className:`w-full h-full object-contain p-20`,src:r,controls:!0}):(0,H.jsx)(`img`,{className:`w-full h-full object-contain p-20`,alt:e,src:r})})}function ab({chart:e}){let t=(0,B.useRef)(null),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(null);return(0,B.useEffect)(()=>{let t=`mermaid-${Math.random().toString(36).slice(2,9)}`,n=!1;return ee(async()=>{let{default:e}=await import(`./mermaid.core-Bbo24DGo.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])).then(({default:i})=>{n||(i.initialize({startOnLoad:!1,theme:`default`}),i.render(t,e).then(({svg:e})=>{n||(r(e),a(null))}).catch(e=>{n||(console.error(`Mermaid render error:`,e),a(String(e)))}))}),()=>{n=!0}},[e]),i?(0,H.jsx)(`pre`,{className:`text-red-500 bg-red-50 p-3 rounded text-sm overflow-auto`,children:(0,H.jsx)(`code`,{children:e})}):(0,H.jsx)(`div`,{ref:t,className:`my-4 flex justify-center overflow-auto`,dangerouslySetInnerHTML:{__html:n}})}function ob({inline:e,className:t,children:n}){let r=String(n??``).replace(/\n$/,``),[i]=Pn(r),a=t?.replace(`language-`,``);return e||!r.includes(`
294
- `)?(0,H.jsx)(`code`,{className:t,children:n}):a===`mermaid`?(0,H.jsx)(ab,{chart:r}):(0,H.jsxs)(`code`,{className:`relative`,children:[(0,H.jsx)(y,{className:`absolute top-2 right-2`,type:`button`,variant:`default`,size:`sm`,onClick:i,children:(0,H.jsx)(Rn,{className:`w-4 h-4`})}),r]})}function sb(e,t,n){let r=t,i=t.replace(/:9925/,``).replace(/\/?$/,``);return r&&(e=e.replaceAll(/https?:\/\/localhost:9926/g,i)),n.project&&(e=e.replaceAll(`Your New Harper Fabric App`,n.project).replaceAll(`your-project-name-here`,n.project)),e}function cb({children:e}){let t=b(),[n,r]=(0,B.useState)(void 0),[i,a]=(0,B.useState)(void 0),{setContent:o}=Ja(n?.path),s=He(),c=gr(),l=S(),{open:u}=w({strict:!1}),{data:d}=O(on(s)),f=(0,B.useMemo)(()=>d?Le(d.entries):{rootEntries:[],pathsRegistry:new Map,allEntries:new Map},[d]),p=(0,B.useCallback)(async()=>l.fetchQuery({queryKey:[s.entityId,`get_components`],networkMode:`online`}),[l,s]);rt(`ReloadApplicationRootEntries`,p,[p]);let m=(0,B.useCallback)(e=>f.pathsRegistry.has(e),[f.pathsRegistry]),h=f.rootEntries.filter(e=>!e.package&&e.path!==`newApplication`).map(e=>e.name),g=h[0],_=h.slice(0,1);!g&&d&&(g=Ie,_=[Ie]);let[v,y]=Xe(`FileFocused/${s.entityId}`,g),[x,C]=Xe(`FolderOpened/${s.entityId}`,h),[T,E]=Xe(`FileSelected/${s.entityId}`,_);(0,B.useEffect)(()=>{if(u?.length){let e=u.split(`?`),n=e[0],r=e[1],i=n.split(`/`);if(r){let e=r.split(`=`);R(e[0],e[1]===`true`||e[1]!==`false`&&e[1])}C(e=>{let t=new Set(e);for(let e=1;e<i.length;e++)t.add(i.slice(0,e).join(`/`));return[...t]}),E([n]),y(n),t({search:void 0})}},[t,u,C,y,E]);let D=n&&(z(n)?n.overviewEntry?.path:n.path)||``,k=n&&(z(n)?n.overviewEntry?.project:n.project)||``,ee=n&&(z(n)?!!n.overviewEntry?.path:!1)||!1,te=n&&!z(n)&&bo(n.name)?void 0:D?.split(`/`).slice(1).join(`/`),A=fn({file:te,project:k,...s}),{data:j}=O(un({file:te,project:k,...s}));(0,B.useEffect)(function(){let e=j?.project+`/`+j?.file,t=j?.message;e===D&&t!==void 0?(ee&&c&&j&&(t=sb(t,c,j)),a(t)):a(void 0)},[j,D,ee,s]);let{mutate:M,isPending:N}=Fe(),P=(0,B.useCallback)((e,t)=>{M(e,{onSuccess:()=>{n?.path===t&&e.payload!==void 0&&(o(void 0),a(e.payload||void 0),l.setQueryData(A,{...j,message:e.payload}))},onError:e=>{console.error(`Error saving file:`,e)}})},[A,j,n?.path,l,M,o]),ne=(0,B.useMemo)(()=>n?n.package?.includes(`github.com/HarperDB/status-check-fabric`)||n.package?.includes(`github.com/HarperFast/status-check-fabric`)||n.path===`importedApplications`||n.path===`newApplication`:!1,[n]),F=(0,B.useMemo)(()=>({rootEntries:f.rootEntries,reloadRootEntries:p,entryExists:m,focusedItem:v,setFocusedItem:y,expandedItems:x,setExpandedItems:C,selectedItems:T,setSelectedItems:E,restrictPackageModification:ne,openedEntry:n,setOpenedEntry:r,openedEntryContents:i,setOpenedEntryContents:a,saveFile:P,isSavingFile:N}),[f.rootEntries,p,m,v,y,x,C,T,E,ne,n,r,i,a,P,N]);return(0,H.jsx)(ri.Provider,{value:F,children:e})}function lb(e){let t=e;if(t?.focus)ub(t);else{let t=e;t?.target?.focus&&ub(t.target)}}function ub(e){r(1).then(()=>{e.focus?.()})}function db(){let{value:e,trigger:t}=Mn(`ShowAddDirectoryOrFileModalType`,!1),n=(0,B.useCallback)(()=>{R(`ShowAddDirectoryOrFileModalType`,!1),lb(t)},[t]),{openedEntry:r,entryExists:i,reloadRootEntries:a,setFocusedItem:o,setSelectedItems:s,setExpandedItems:c}=V(),l=He(),{mutate:u,isPending:d}=Fe(),f=m.object({name:m.string().nonempty({error:`Please enter a valid name.`}).regex(/^[a-zA-Z0-9_\- .]*$/,{error:`Names can only contain letters, numbers, underscores, hyphens, periods, and spaces.`}).max(50,{error:`Names cannot be longer than 50 characters.`}).trim()}),p=N({resolver:j(f),defaultValues:{name:``}}),h=(0,B.useCallback)(async t=>{if(!r||!e)return;let d=r.path.split(`/`),f=(z(r)?d.slice(1):d.slice(1,-1)).join(`/`),m=f?`${f}/${t.name}`:t.name,h=`${r.project}/${m}`;i(h)&&!await si({files:e===`file`?[h]:[],directories:e===`directory`?[h]:[]})||u({file:m,project:r.project,payload:e===`directory`?void 0:``,...l},{onSuccess:()=>{a(),n(),p.reset();let i=[r.project,f,t.name].filter(Ue).join(`/`);o(i),s([i]),e===`directory`?(c(e=>[...e,i]),R(`FocusFileTree`,!0)):R(`FocusEditor`,!0)}})},[u,p,n,l,r,i,a,c,o,s,e]),g=(0,B.useCallback)(()=>{n(),p.reset()},[n,p]);return(0,H.jsx)(L,{onOpenChange:n,open:!!e,children:(0,H.jsx)(ce,{"aria-describedby":void 0,className:`text-popover-foreground`,onOpenAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>p.setFocus(`name`))},children:(0,H.jsx)(Un,{...p,children:(0,H.jsxs)(`form`,{id:`instance-add-app-${e}-form`,name:`instance-add-app-${e}-form`,onSubmit:p.handleSubmit(h),children:[(0,H.jsxs)(oe,{children:[(0,H.jsxs)(de,{children:[`Add `,e]}),(0,H.jsxs)(me,{children:[`Enter the name of the `,e,` you want to add`,e===`file`?`, don't forget the extension`:``,`!`]})]}),(0,H.jsx)(rn,{control:p.control,name:`name`,render:({field:e})=>(0,H.jsxs)(Ln,{className:`my-2`,children:[(0,H.jsx)(Qt,{children:`Name`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{disabled:d,type:`text`,autoComplete:`off`,autoCapitalize:`off`,...e})}),(0,H.jsx)(hn,{})]})}),(0,H.jsx)(ae,{children:(0,H.jsxs)(`div`,{className:`flex justify-between w-full`,children:[(0,H.jsx)(y,{type:`button`,variant:`ghostOutline`,onClick:g,children:`Cancel`}),(0,H.jsxs)(y,{variant:`positiveOutline`,type:`submit`,disabled:d,children:[(0,H.jsx)(cn,{}),` Add `,e]})]})})]})})})})}async function fb(e,{dropItem:t,onProgress:n,isCanceled:r}){let i=0,a=[];for(let o of e){let e=o.split(`/`);a=e;let s=e[0],c=e.length>1?e.slice(1).join(`/`):void 0;n?.(i);try{await t(s,c),i+=1}catch(e){return{deleted:i,canceled:!1,error:e,lastSplit:a}}if(r?.())return{deleted:i,canceled:!0,lastSplit:a}}return{deleted:i,canceled:!1,lastSplit:a}}function pb(){let{value:e,trigger:t}=Mn(`ShowDeleteDirectoryOrFileModal`,!1),n=He(),{openedEntry:r,reloadRootEntries:a,setFocusedItem:o,setSelectedItems:s,selectedItems:c}=V(),l=c.length>1,u=z(r),d=u&&r.path===r.project,f=!!r?.package,p=f?`Remove`:`Delete`,m=f?`Imported Application`:d?`Application`:u?`Directory`:`File`,h=(0,B.useCallback)(()=>{R(`ShowDeleteDirectoryOrFileModal`,!1),lb(t)},[t]),g=(0,B.useCallback)(async()=>{h();let e=!1,t=`deleting-files`,r=i(c.length,`item`,`items`),l={label:`OK`,onClick:()=>void 0},u=await fb(c.map(String).reverse(),{dropItem:(e,t)=>De({file:t,project:e,...n}),onProgress:n=>{M.loading(`${p} in progress...`,{id:t,description:`${n} of ${r}`,action:{label:`Cancel`,onClick:()=>{e=!0}}})},isCanceled:()=>e});if(u.error?(M.dismiss(t),ze(u.error)):u.canceled?M.warning(`${p} canceled!`,{id:t,description:``,action:l}):M.success(`${p} completed!`,{id:t,description:``,action:l}),u.lastSplit.length){let e=u.lastSplit.slice(0,-1).join(`/`);o(e||void 0),s(e?[e]:[]),a(),R(`FocusFileTree`,!0)}},[p,h,n,a,c,o,s]),_=(0,B.useCallback)(e=>{e.preventDefault(),g()},[g]);return(0,H.jsx)(L,{onOpenChange:h,open:e,children:(0,H.jsxs)(ce,{"aria-describedby":void 0,className:`text-popover-foreground`,children:[(0,H.jsxs)(oe,{children:[(0,H.jsxs)(de,{children:[p,` `,m]}),(0,H.jsxs)(me,{children:[`Are you sure you want to `,p.toLowerCase(),` `,l?`these ${c.length} items`:`this ${m.toLowerCase()}`,`?`]}),!f&&(0,H.jsx)(me,{className:`whitespace-pre`,children:l?c.join(`
295
- `):r?.path})]}),(0,H.jsxs)(`div`,{className:`flex w-full gap-4`,children:[(0,H.jsx)(y,{type:`button`,variant:`ghostOutline`,className:`w-full`,onClick:h,children:`Cancel`}),(0,H.jsxs)(y,{variant:`destructiveOutline`,type:`button`,className:`w-full`,autoFocus:!0,onClick:_,children:[(0,H.jsx)(zt,{}),` `,p,` `,l?`items`:m]})]})]})})}function mb(e,t){if(!e||!e.exact)return`unmeasured`;if(t||e.bytes>1e8)return`large`}function hb(e,t){if(!t)return;let n=e.find(e=>e.name===t);if(!n||!z(n))return;let r=0,i=0,a=!0,o=e=>{for(let t of e){if(z(t)){o(t.entries);continue}i++,typeof t.size==`number`?r+=t.size:a=!1}};return o(n.entries),{bytes:r,fileCount:i,exact:a}}async function gb({packageName:e,project:t,skipNodeModules:n,skipSymlinks:r,instanceClient:i}){let{data:a}=await i.post(`/`,{operation:`package_component`,package:e,project:t,skip_node_modules:n,skip_symlinks:r},{timeout:3e5});return a}function _b(){return C({mutationFn:gb})}function vb(e){let t=atob(e),n=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function yb(){let{value:e,trigger:t}=Mn(`ShowDownloadApplicationModal`,!1),n=He(),{openedEntry:r,rootEntries:i}=V(),{mutate:a,isPending:o,isSuccess:s}=_b(),c=s?`Downloaded`:o?`Downloading`:`Download`,[l,u]=(0,B.useState)(!1),d=(0,B.useMemo)(()=>hb(i,r?.project),[i,r?.project]),f=mb(d,l),p=(0,B.useCallback)(e=>{u(e.target.checked)},[]),m=(0,B.useCallback)(()=>{R(`ShowDownloadApplicationModal`,!1),lb(t)},[t]),h=(0,B.useCallback)(e=>{if(e.preventDefault(),!r)return;m();let t=M.loading(`Packaging...`);a({packageName:r.package,project:r.project,skipNodeModules:!l,...n},{onSuccess:e=>{let n;try{n=new Blob([vb(e.payload)],{type:`application/gzip`})}catch(e){M.error(`${r.project} was packaged, but is too large for the browser to save. Copy it off the host directly instead.`,{id:t}),console.error(`[harper] failed to decode downloaded application archive`,e);return}M.success(`Download ready!`,{id:t});let i=document.createElement(`a`);i.setAttribute(`class`,`invisible absolute top-0`),i.href=URL.createObjectURL(n),i.download=`${r.project}.gz`,document.body.appendChild(i),i.click(),document.body.removeChild(i)},onError:e=>{M.error(`Could not package ${r.project}: ${e.message}`,{id:t})}})},[r,a,l,n,m]);return(0,H.jsx)(L,{onOpenChange:m,open:e,children:(0,H.jsxs)(ce,{"aria-describedby":void 0,className:`text-popover-foreground`,children:[(0,H.jsxs)(oe,{children:[(0,H.jsx)(de,{children:`Download Application`}),(0,H.jsxs)(me,{children:[`This will package up the contents of `,(0,H.jsx)(`strong`,{children:r?.project}),` into a gzipped file.`,d&&(0,H.jsxs)(H.Fragment,{children:[` `,d.bytes>0&&`${d.exact?`About`:`At least`} ${st(d.bytes)} across `,new Intl.NumberFormat().format(d.fileCount),` `,d.fileCount===1?`file`:`files`,d.bytes>0?``:` of unreported size`,l?`, plus node modules`:``,`.`]})]})]}),f&&(0,H.jsxs)(jn,{variant:`warning`,children:[(0,H.jsx)(ot,{}),(0,H.jsx)(mn,{children:f===`large`?`This is a large download`:`This download’s size is unknown`}),(0,H.jsxs)(wn,{children:[f===`unmeasured`&&(0,H.jsx)(`p`,{children:`This instance didn’t report file sizes, so there’s no way to tell up front whether this application is small enough to download.`}),(0,H.jsx)(`p`,{children:`Studio has to hold the whole archive in browser memory before it can be saved, so the tab may run out of memory and crash partway through.`}),(0,H.jsxs)(`p`,{children:[`Copying the application off the host directly — `,(0,H.jsx)(`code`,{children:`scp`}),`, or the Harper CLI — is more reliable`,f===`large`?` at this size`:` when the size is unknown`,`.`]})]})]}),(0,H.jsxs)(Dn,{className:`flex`,children:[(0,H.jsx)(Fn,{type:`checkbox`,className:`w-6`,disabled:o,checked:l,onChange:p}),(0,H.jsx)(`span`,{className:`pl-4 pr-8 flex-1 py-2.5`,children:`Include Node Modules`})]}),(0,H.jsxs)(`div`,{className:`flex w-full gap-4`,children:[(0,H.jsx)(y,{type:`button`,variant:`ghostOutline`,className:`w-full`,onClick:m,children:`Cancel`}),(0,H.jsxs)(y,{variant:`positive`,type:`button`,className:`w-full`,disabled:o,autoFocus:!0,onClick:h,children:[(0,H.jsx)(Se,{}),` `,f&&!o&&!s?`Download anyway`:c,o?`...`:``]})]})]})})}function bb({files:e,directories:t}){let n=[];return e.length&&n.push(`Overwrite ${i(e.length,`file`,`files`)}`),t.length&&n.push(`Merge ${i(t.length,`directory`,`directories`)}`),n.join(` & `)||`Overwrite`}function xb(){let[e,t]=(0,B.useState)(null);(0,B.useEffect)(()=>(oi((e,n)=>{t(t=>(t?.resolve(!1),{request:e,resolve:n}))}),()=>oi(void 0)),[]);let n=(0,B.useCallback)(e=>{t(t=>(t?.resolve(e),null))},[]),r=e?.request,i=r?[...r.directories,...r.files]:[];return(0,H.jsx)(hr,{open:!!e,onOpenChange:e=>!e&&n(!1),children:(0,H.jsxs)(ur,{className:`text-popover-foreground`,children:[(0,H.jsxs)(mr,{children:[(0,H.jsx)(lr,{children:`Overwrite existing items?`}),(0,H.jsx)(cr,{children:r?.directories.length?`Some of these already exist. Files will be overwritten and directories merged.`:`Some of these files already exist and will be overwritten.`})]}),i.length>0&&(0,H.jsxs)(`div`,{className:`max-h-48 overflow-y-auto rounded-md border border-border bg-muted/40 p-2 text-sm whitespace-pre-wrap break-all`,children:[i.slice(0,50).join(`
296
- `),i.length>50?`\n…and ${i.length-50} more`:``]}),(0,H.jsxs)(fr,{children:[(0,H.jsx)(pr,{onClick:()=>n(!1),children:`Cancel`}),(0,H.jsx)(dr,{className:v({variant:`destructive`}),onClick:()=>n(!0),children:r?bb(r):`Overwrite`})]})]})})}function Sb(){let{value:e,trigger:t}=Mn(`ShowRedeployApplicationModal`,!1),n=S(),r=He(),i=qn(),a=$n(),o=gy(r),{openedEntry:s}=V(),c=s?.package,{mutate:l,isPending:u}=yy(),[d,f]=(0,B.useState)(!1),p=N({defaultValues:{applicationUrl:c,installCommand:``}}),{control:m,handleSubmit:h,reset:g}=p;(0,B.useEffect)(()=>{g({applicationUrl:c})},[g,c]);let _=(0,B.useCallback)(()=>{R(`ShowRedeployApplicationModal`,!1),lb(t),g({applicationUrl:c}),f(!1),a.reset()},[g,c,t,a]),v=(0,B.useCallback)(()=>{n.invalidateQueries({queryKey:[r.entityId,`get_components`],refetchType:`active`})},[n,r.entityId]),b=(0,B.useCallback)((e,t)=>{if(!s)return;let n=s.project;a.reset(),a.markStarted(),f(!0),l({applicationName:n,applicationUrl:e,installCommand:t,useSSE:!0,onEvent:a.onEvent,...r},{onSuccess:async()=>{a.markSettled(`success`),v();let e=await o(n);_y(n,e),_()},onError:async e=>{if(e instanceof Qe){a.markSettled(`inconclusive`),v();let e=await o(n);_y(n,e),_();return}a.markSettled(`error`,e instanceof Error?e.message:String(e)),M.error(`Failed to redeploy ${n}`,{description:e instanceof Error?e.message:void 0})}})},[l,s,r,a,v,o,_]),x=(0,B.useCallback)((e,t)=>{if(!s)return;_();let n=M.loading(`Redeploying...`);l({applicationName:s.project,applicationUrl:e,installCommand:t,...r},{onSuccess:()=>{M.success(`Application ${s.project} redeployed successfully`,{id:n}),v()},onError:()=>{M.dismiss(n)}})},[l,s,r,v,_]),C=({applicationUrl:e,installCommand:t})=>{e&&(i?b(e,t):x(e,t))};return(0,H.jsx)(L,{onOpenChange:_,open:e,children:(0,H.jsxs)(ce,{"aria-describedby":void 0,className:`text-popover-foreground`,children:[(0,H.jsxs)(oe,{children:[(0,H.jsx)(de,{children:`Redeploy Package`}),(0,H.jsx)(me,{children:d?`Redeploying ${s?.project??`package`}…`:`Redeploy this package?`})]}),d?(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(nn,{state:a.state,onNavigateAway:_}),(0,H.jsx)(y,{type:`button`,variant:`ghostOutline`,className:`w-full`,onClick:_,disabled:u,children:u?`Deploying…`:`Close`})]}):(0,H.jsx)(`div`,{children:(0,H.jsx)(Un,{...p,children:(0,H.jsxs)(`form`,{id:`instance-redeploy-app-form`,name:`instance-redeploy-app-form`,className:`flex flex-col w-full gap-4`,onSubmit:h(C),children:[(0,H.jsx)(rn,{control:m,name:`applicationUrl`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`Package Reference`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{type:`text`,autoFocus:!0,...e})}),(0,H.jsx)(hn,{})]})}),(0,H.jsx)(rn,{control:m,name:`installCommand`,render:({field:e})=>(0,H.jsxs)(Ln,{children:[(0,H.jsx)(Qt,{className:`pb-1`,children:`Install Command`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{type:`text`,placeholder:`npm install`,...e})}),(0,H.jsx)(hn,{})]})}),(0,H.jsxs)(y,{variant:`positiveOutline`,type:`submit`,className:`w-full`,disabled:u,children:[(0,H.jsx)(Ke,{}),` Redeploy Application`]}),(0,H.jsx)(y,{type:`button`,variant:`ghostOutline`,className:`w-full`,onClick:_,disabled:u,children:`Cancel`})]})})})]})})}function Cb(e){return Pe(e.split(`/`).slice(0,-1))}function wb(e,t){return Pe(Cb(e),t)}function Tb(e){return z(e)?e.entries.flatMap(Tb):[e]}function Eb(){let{value:e,trigger:t}=Mn(`ShowRenameFileModal`,!1),n=(0,B.useCallback)(()=>{R(`ShowRenameFileModal`,!1),lb(t)},[t]),{openedEntry:r,entryExists:i,reloadRootEntries:a}=V(),o=He(),s=m.object({name:m.string().nonempty({error:`Please enter a valid name.`}).regex(/^[a-zA-Z0-9_\- .]*$/,{error:`Names can only contain letters, numbers, underscores, hyphens, periods, and spaces.`}).max(50,{error:`Names cannot be longer than 50 characters.`}).trim().refine(e=>e!==r?.name,{error:`Please enter a new name.`})}),[c,l]=(0,B.useState)(!1),u=ii(),d=N({resolver:j(s)});(0,B.useEffect)(()=>{r?.name&&d.reset({name:r?.name})},[d,r?.name]);let f=(0,B.useCallback)(async e=>{if(!r)return;let t=wb(r.path,e.name),s=z(r);if(i(t)&&!await si({files:s?[]:[t],directories:s?[t]:[]}))return;let c=s?Tb(r).map(e=>({from:e.path,to:t+e.path.slice(r.path.length)})):[{from:r.path,to:t}];l(!0);let f=await u(c);if(f&&s){let e=e=>e.split(`/`).slice(1).join(`/`);try{c.length===0&&await Re({...o,project:r.project,file:e(t),payload:void 0}),await De({...o,project:r.project,file:e(r.path)}),await a()}catch(e){M.error(`Rename Failed`,{description:e instanceof Error?e.message:`Could not remove the original directory.`}),l(!1);return}}l(!1),f&&(n(),d.reset(),R(s?`FocusFileTree`:`FocusEditor`,!0))},[n,i,d,o,r,a,u,l]),p=(0,B.useCallback)(()=>{n(),d.reset()},[n,d]);return(0,H.jsx)(L,{onOpenChange:n,open:e,children:(0,H.jsx)(ce,{"aria-describedby":void 0,className:`text-popover-foreground`,onOpenAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>d.setFocus(`name`,{shouldSelect:!0}))},children:(0,H.jsx)(Un,{...d,children:(0,H.jsxs)(`form`,{id:`instance-rename-app-file-form`,name:`instance-rename-app-file-form`,onSubmit:d.handleSubmit(f),children:[(0,H.jsxs)(oe,{children:[(0,H.jsxs)(de,{children:[`Rename `,z(r)?`Directory`:`File`]}),(0,H.jsx)(me,{children:r?.path})]}),(0,H.jsx)(rn,{control:d.control,name:`name`,render:({field:e})=>(0,H.jsxs)(Ln,{className:`my-2`,children:[(0,H.jsx)(Qt,{children:`Name`}),(0,H.jsx)(bn,{children:(0,H.jsx)(Fn,{disabled:c,type:`text`,autoComplete:`off`,autoCapitalize:`off`,...e})}),(0,H.jsx)(hn,{})]})}),(0,H.jsx)(ae,{children:(0,H.jsxs)(`div`,{className:`flex justify-between w-full`,children:[(0,H.jsx)(y,{type:`button`,variant:`ghostOutline`,onClick:p,children:`Cancel`}),(0,H.jsxs)(y,{variant:`positiveOutline`,type:`submit`,disabled:c||!d.formState.isDirty||!d.formState.isValid,children:[(0,H.jsx)(_e,{}),` Rename`]})]})})]})})})})}function Db(){let e=qt(),t=E({strict:!1}),{toggle:n,toggled:r}=ni(`ApplicationsSidebarOpened`,!0),{width:i,isResizing:a,startResizing:o}=ro();if(!e)return(0,H.jsx)(x,{to:Zn(t,`databases`)});let s={"--app-sidebar-width":`${i}px`};return(0,H.jsxs)(cb,{children:[(0,H.jsxs)(`aside`,{id:`file-explorer-sidebar`,style:s,className:l(`pt-[calc(--spacing(32))] w-[var(--app-sidebar-width)] fixed top-0 left-0 bottom-0 z-30`,`bg-violet-50 border-r border-violet-200 shadow shadow-black/10`,`dark:bg-grey-700 dark:border-grey-600 dark:shadow-black`,`transition-transform -translate-x-full`,r?`translate-x-0`:`md:translate-x-0`),"aria-label":`Sidebar`,children:[(0,H.jsx)(to,{}),(0,H.jsx)(io,{isResizing:a,onMouseDown:o})]}),(0,H.jsxs)(`div`,{style:s,className:l(`applications-content`,`overflow-y-auto overflow-x-hidden`,`fixed top-32 right-0 bottom-0 left-0`,!a&&`transition-[left]`,`md:left-[var(--app-sidebar-width)]`,r&&`sm:left-[var(--app-sidebar-width)]`),children:[(0,H.jsx)(nb,{}),(0,H.jsx)(_o,{toggledSidebar:r,toggleSidebar:n})]}),(0,H.jsx)(db,{}),(0,H.jsx)(pb,{}),(0,H.jsx)(yb,{}),(0,H.jsx)(Sb,{}),(0,H.jsx)(Eb,{}),(0,H.jsx)(xb,{})]})}export{Db as ApplicationsEditor};