bmad-studio 0.1.0 → 1.0.0

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 (1077) hide show
  1. package/README.md +6 -0
  2. package/package.json +27 -2
  3. package/packages/client/dist/assets/index-CWL4J-eZ.css +1 -0
  4. package/packages/client/dist/assets/index-DBqsFqD5.js +535 -0
  5. package/packages/client/dist/assets/inter-tight-cyrillic-400-normal-DPRou3KO.woff +0 -0
  6. package/packages/client/dist/assets/inter-tight-cyrillic-400-normal-G7BuwYWK.woff2 +0 -0
  7. package/packages/client/dist/assets/inter-tight-cyrillic-700-normal-DDZiLR3d.woff +0 -0
  8. package/packages/client/dist/assets/inter-tight-cyrillic-700-normal-DtWWjp29.woff2 +0 -0
  9. package/packages/client/dist/assets/inter-tight-cyrillic-800-normal-CC_RRmyd.woff2 +0 -0
  10. package/packages/client/dist/assets/inter-tight-cyrillic-800-normal-ChWbk4mt.woff +0 -0
  11. package/packages/client/dist/assets/inter-tight-cyrillic-ext-400-normal-CKO3cWyd.woff2 +0 -0
  12. package/packages/client/dist/assets/inter-tight-cyrillic-ext-400-normal-DiHHcP5k.woff +0 -0
  13. package/packages/client/dist/assets/inter-tight-cyrillic-ext-700-normal-BFcoPt71.woff +0 -0
  14. package/packages/client/dist/assets/inter-tight-cyrillic-ext-700-normal-D_7NT8eF.woff2 +0 -0
  15. package/packages/client/dist/assets/inter-tight-cyrillic-ext-800-normal-CzCOBUhR.woff2 +0 -0
  16. package/packages/client/dist/assets/inter-tight-cyrillic-ext-800-normal-WowoGRZX.woff +0 -0
  17. package/packages/client/dist/assets/inter-tight-greek-400-normal-BLLSFQTx.woff +0 -0
  18. package/packages/client/dist/assets/inter-tight-greek-400-normal-Br_GQm5W.woff2 +0 -0
  19. package/packages/client/dist/assets/inter-tight-greek-700-normal-DU8XoIeX.woff +0 -0
  20. package/packages/client/dist/assets/inter-tight-greek-700-normal-RgALSHS4.woff2 +0 -0
  21. package/packages/client/dist/assets/inter-tight-greek-800-normal-CxHmUlv4.woff +0 -0
  22. package/packages/client/dist/assets/inter-tight-greek-800-normal-X9eW6L67.woff2 +0 -0
  23. package/packages/client/dist/assets/inter-tight-greek-ext-400-normal-C3GMUg_S.woff2 +0 -0
  24. package/packages/client/dist/assets/inter-tight-greek-ext-400-normal-DMqR5RoS.woff +0 -0
  25. package/packages/client/dist/assets/inter-tight-greek-ext-700-normal-D0RkHJEE.woff2 +0 -0
  26. package/packages/client/dist/assets/inter-tight-greek-ext-700-normal-mW3dmpoD.woff +0 -0
  27. package/packages/client/dist/assets/inter-tight-greek-ext-800-normal-DNWjXg9N.woff2 +0 -0
  28. package/packages/client/dist/assets/inter-tight-greek-ext-800-normal-DfP-QoiQ.woff +0 -0
  29. package/packages/client/dist/assets/inter-tight-latin-400-normal-BLrFJfvD.woff +0 -0
  30. package/packages/client/dist/assets/inter-tight-latin-400-normal-iW8qmuJY.woff2 +0 -0
  31. package/packages/client/dist/assets/inter-tight-latin-700-normal-BZKd_v_8.woff2 +0 -0
  32. package/packages/client/dist/assets/inter-tight-latin-700-normal-DvYAVZQd.woff +0 -0
  33. package/packages/client/dist/assets/inter-tight-latin-800-normal-CRGCHRPv.woff2 +0 -0
  34. package/packages/client/dist/assets/inter-tight-latin-800-normal-D2te1T7i.woff +0 -0
  35. package/packages/client/dist/assets/inter-tight-latin-ext-400-normal-BQQeeQrv.woff +0 -0
  36. package/packages/client/dist/assets/inter-tight-latin-ext-400-normal-DN7wyBvd.woff2 +0 -0
  37. package/packages/client/dist/assets/inter-tight-latin-ext-700-normal-BpKPOkj3.woff2 +0 -0
  38. package/packages/client/dist/assets/inter-tight-latin-ext-700-normal-CrlzIQ10.woff +0 -0
  39. package/packages/client/dist/assets/inter-tight-latin-ext-800-normal-A39zhqaD.woff +0 -0
  40. package/packages/client/dist/assets/inter-tight-latin-ext-800-normal-DfKN99cy.woff2 +0 -0
  41. package/packages/client/dist/assets/inter-tight-vietnamese-400-normal-CqzIqjuX.woff2 +0 -0
  42. package/packages/client/dist/assets/inter-tight-vietnamese-400-normal-kSDs3Vd1.woff +0 -0
  43. package/packages/client/dist/assets/inter-tight-vietnamese-700-normal-Cn_DV52A.woff2 +0 -0
  44. package/packages/client/dist/assets/inter-tight-vietnamese-700-normal-DwHBAXeT.woff +0 -0
  45. package/packages/client/dist/assets/inter-tight-vietnamese-800-normal-CbYrLkxo.woff +0 -0
  46. package/packages/client/dist/assets/inter-tight-vietnamese-800-normal-OJoDhpMd.woff2 +0 -0
  47. package/packages/client/dist/index.html +13 -0
  48. package/packages/server/dist/app.d.ts +12 -0
  49. package/packages/server/dist/app.d.ts.map +1 -0
  50. package/packages/server/dist/app.js +94 -0
  51. package/packages/server/dist/app.js.map +1 -0
  52. package/packages/server/dist/app.test.d.ts +2 -0
  53. package/packages/server/dist/app.test.d.ts.map +1 -0
  54. package/packages/server/dist/app.test.js +72 -0
  55. package/packages/server/dist/app.test.js.map +1 -0
  56. package/packages/server/dist/core/errors.d.ts +29 -0
  57. package/packages/server/dist/core/errors.d.ts.map +1 -0
  58. package/packages/server/dist/core/errors.js +49 -0
  59. package/packages/server/dist/core/errors.js.map +1 -0
  60. package/packages/server/dist/core/errors.test.d.ts +2 -0
  61. package/packages/server/dist/core/errors.test.d.ts.map +1 -0
  62. package/packages/server/dist/core/errors.test.js +37 -0
  63. package/packages/server/dist/core/errors.test.js.map +1 -0
  64. package/packages/server/dist/core/file-store.d.ts +40 -0
  65. package/packages/server/dist/core/file-store.d.ts.map +1 -0
  66. package/packages/server/dist/core/file-store.js +160 -0
  67. package/packages/server/dist/core/file-store.js.map +1 -0
  68. package/packages/server/dist/core/file-store.test.d.ts +2 -0
  69. package/packages/server/dist/core/file-store.test.d.ts.map +1 -0
  70. package/packages/server/dist/core/file-store.test.js +75 -0
  71. package/packages/server/dist/core/file-store.test.js.map +1 -0
  72. package/packages/server/dist/core/ide-skill-generator.d.ts +58 -0
  73. package/packages/server/dist/core/ide-skill-generator.d.ts.map +1 -0
  74. package/packages/server/dist/core/ide-skill-generator.js +270 -0
  75. package/packages/server/dist/core/ide-skill-generator.js.map +1 -0
  76. package/packages/server/dist/core/ide-skill-generator.test.d.ts +2 -0
  77. package/packages/server/dist/core/ide-skill-generator.test.d.ts.map +1 -0
  78. package/packages/server/dist/core/ide-skill-generator.test.js +257 -0
  79. package/packages/server/dist/core/ide-skill-generator.test.js.map +1 -0
  80. package/packages/server/dist/core/module-installer.d.ts +165 -0
  81. package/packages/server/dist/core/module-installer.d.ts.map +1 -0
  82. package/packages/server/dist/core/module-installer.js +445 -0
  83. package/packages/server/dist/core/module-installer.js.map +1 -0
  84. package/packages/server/dist/core/module-installer.test.d.ts +2 -0
  85. package/packages/server/dist/core/module-installer.test.d.ts.map +1 -0
  86. package/packages/server/dist/core/module-installer.test.js +509 -0
  87. package/packages/server/dist/core/module-installer.test.js.map +1 -0
  88. package/packages/server/dist/core/module-registry.d.ts +5 -0
  89. package/packages/server/dist/core/module-registry.d.ts.map +1 -0
  90. package/packages/server/dist/core/module-registry.js +109 -0
  91. package/packages/server/dist/core/module-registry.js.map +1 -0
  92. package/packages/server/dist/core/module-registry.test.d.ts +2 -0
  93. package/packages/server/dist/core/module-registry.test.d.ts.map +1 -0
  94. package/packages/server/dist/core/module-registry.test.js +280 -0
  95. package/packages/server/dist/core/module-registry.test.js.map +1 -0
  96. package/packages/server/dist/core/project-detector.d.ts +14 -0
  97. package/packages/server/dist/core/project-detector.d.ts.map +1 -0
  98. package/packages/server/dist/core/project-detector.js +67 -0
  99. package/packages/server/dist/core/project-detector.js.map +1 -0
  100. package/packages/server/dist/core/project-detector.test.d.ts +2 -0
  101. package/packages/server/dist/core/project-detector.test.d.ts.map +1 -0
  102. package/packages/server/dist/core/project-detector.test.js +73 -0
  103. package/packages/server/dist/core/project-detector.test.js.map +1 -0
  104. package/packages/server/dist/core/websocket.d.ts +16 -0
  105. package/packages/server/dist/core/websocket.d.ts.map +1 -0
  106. package/packages/server/dist/core/websocket.js +30 -0
  107. package/packages/server/dist/core/websocket.js.map +1 -0
  108. package/packages/server/dist/core/websocket.test.d.ts +2 -0
  109. package/packages/server/dist/core/websocket.test.d.ts.map +1 -0
  110. package/packages/server/dist/core/websocket.test.js +64 -0
  111. package/packages/server/dist/core/websocket.test.js.map +1 -0
  112. package/packages/server/dist/core/write-service.d.ts +32 -0
  113. package/packages/server/dist/core/write-service.d.ts.map +1 -0
  114. package/packages/server/dist/core/write-service.js +173 -0
  115. package/packages/server/dist/core/write-service.js.map +1 -0
  116. package/packages/server/dist/core/write-service.test.d.ts +2 -0
  117. package/packages/server/dist/core/write-service.test.d.ts.map +1 -0
  118. package/packages/server/dist/core/write-service.test.js +156 -0
  119. package/packages/server/dist/core/write-service.test.js.map +1 -0
  120. package/packages/server/dist/index.d.ts +2 -0
  121. package/packages/server/dist/index.d.ts.map +1 -0
  122. package/packages/server/dist/index.js +133 -0
  123. package/packages/server/dist/index.js.map +1 -0
  124. package/packages/server/dist/parsers/agent-parser.d.ts +4 -0
  125. package/packages/server/dist/parsers/agent-parser.d.ts.map +1 -0
  126. package/packages/server/dist/parsers/agent-parser.js +88 -0
  127. package/packages/server/dist/parsers/agent-parser.js.map +1 -0
  128. package/packages/server/dist/parsers/agent-parser.test.d.ts +2 -0
  129. package/packages/server/dist/parsers/agent-parser.test.d.ts.map +1 -0
  130. package/packages/server/dist/parsers/agent-parser.test.js +66 -0
  131. package/packages/server/dist/parsers/agent-parser.test.js.map +1 -0
  132. package/packages/server/dist/parsers/config-parser.d.ts +14 -0
  133. package/packages/server/dist/parsers/config-parser.d.ts.map +1 -0
  134. package/packages/server/dist/parsers/config-parser.js +39 -0
  135. package/packages/server/dist/parsers/config-parser.js.map +1 -0
  136. package/packages/server/dist/parsers/config-parser.test.d.ts +2 -0
  137. package/packages/server/dist/parsers/config-parser.test.d.ts.map +1 -0
  138. package/packages/server/dist/parsers/config-parser.test.js +56 -0
  139. package/packages/server/dist/parsers/config-parser.test.js.map +1 -0
  140. package/packages/server/dist/parsers/csv-parser.d.ts +4 -0
  141. package/packages/server/dist/parsers/csv-parser.d.ts.map +1 -0
  142. package/packages/server/dist/parsers/csv-parser.js +50 -0
  143. package/packages/server/dist/parsers/csv-parser.js.map +1 -0
  144. package/packages/server/dist/parsers/csv-parser.test.d.ts +2 -0
  145. package/packages/server/dist/parsers/csv-parser.test.d.ts.map +1 -0
  146. package/packages/server/dist/parsers/csv-parser.test.js +44 -0
  147. package/packages/server/dist/parsers/csv-parser.test.js.map +1 -0
  148. package/packages/server/dist/parsers/ide-config-parser.d.ts +9 -0
  149. package/packages/server/dist/parsers/ide-config-parser.d.ts.map +1 -0
  150. package/packages/server/dist/parsers/ide-config-parser.js +28 -0
  151. package/packages/server/dist/parsers/ide-config-parser.js.map +1 -0
  152. package/packages/server/dist/parsers/ide-config-parser.test.d.ts +2 -0
  153. package/packages/server/dist/parsers/ide-config-parser.test.d.ts.map +1 -0
  154. package/packages/server/dist/parsers/ide-config-parser.test.js +32 -0
  155. package/packages/server/dist/parsers/ide-config-parser.test.js.map +1 -0
  156. package/packages/server/dist/parsers/index-builder.d.ts +20 -0
  157. package/packages/server/dist/parsers/index-builder.d.ts.map +1 -0
  158. package/packages/server/dist/parsers/index-builder.js +155 -0
  159. package/packages/server/dist/parsers/index-builder.js.map +1 -0
  160. package/packages/server/dist/parsers/index-builder.test.d.ts +2 -0
  161. package/packages/server/dist/parsers/index-builder.test.d.ts.map +1 -0
  162. package/packages/server/dist/parsers/index-builder.test.js +57 -0
  163. package/packages/server/dist/parsers/index-builder.test.js.map +1 -0
  164. package/packages/server/dist/parsers/module-yaml-parser.d.ts +16 -0
  165. package/packages/server/dist/parsers/module-yaml-parser.d.ts.map +1 -0
  166. package/packages/server/dist/parsers/module-yaml-parser.js +62 -0
  167. package/packages/server/dist/parsers/module-yaml-parser.js.map +1 -0
  168. package/packages/server/dist/parsers/module-yaml-parser.test.d.ts +2 -0
  169. package/packages/server/dist/parsers/module-yaml-parser.test.d.ts.map +1 -0
  170. package/packages/server/dist/parsers/module-yaml-parser.test.js +156 -0
  171. package/packages/server/dist/parsers/module-yaml-parser.test.js.map +1 -0
  172. package/packages/server/dist/parsers/package-parser.d.ts +4 -0
  173. package/packages/server/dist/parsers/package-parser.d.ts.map +1 -0
  174. package/packages/server/dist/parsers/package-parser.js +29 -0
  175. package/packages/server/dist/parsers/package-parser.js.map +1 -0
  176. package/packages/server/dist/parsers/package-parser.test.d.ts +2 -0
  177. package/packages/server/dist/parsers/package-parser.test.d.ts.map +1 -0
  178. package/packages/server/dist/parsers/package-parser.test.js +34 -0
  179. package/packages/server/dist/parsers/package-parser.test.js.map +1 -0
  180. package/packages/server/dist/parsers/skill-parser.d.ts +4 -0
  181. package/packages/server/dist/parsers/skill-parser.d.ts.map +1 -0
  182. package/packages/server/dist/parsers/skill-parser.js +58 -0
  183. package/packages/server/dist/parsers/skill-parser.js.map +1 -0
  184. package/packages/server/dist/parsers/skill-parser.test.d.ts +2 -0
  185. package/packages/server/dist/parsers/skill-parser.test.d.ts.map +1 -0
  186. package/packages/server/dist/parsers/skill-parser.test.js +49 -0
  187. package/packages/server/dist/parsers/skill-parser.test.js.map +1 -0
  188. package/packages/server/dist/parsers/team-parser.d.ts +4 -0
  189. package/packages/server/dist/parsers/team-parser.d.ts.map +1 -0
  190. package/packages/server/dist/parsers/team-parser.js +108 -0
  191. package/packages/server/dist/parsers/team-parser.js.map +1 -0
  192. package/packages/server/dist/parsers/team-parser.test.d.ts +2 -0
  193. package/packages/server/dist/parsers/team-parser.test.d.ts.map +1 -0
  194. package/packages/server/dist/parsers/team-parser.test.js +142 -0
  195. package/packages/server/dist/parsers/team-parser.test.js.map +1 -0
  196. package/packages/server/dist/parsers/workflow-parser.d.ts +4 -0
  197. package/packages/server/dist/parsers/workflow-parser.d.ts.map +1 -0
  198. package/packages/server/dist/parsers/workflow-parser.js +266 -0
  199. package/packages/server/dist/parsers/workflow-parser.js.map +1 -0
  200. package/packages/server/dist/parsers/workflow-parser.test.d.ts +2 -0
  201. package/packages/server/dist/parsers/workflow-parser.test.d.ts.map +1 -0
  202. package/packages/server/dist/parsers/workflow-parser.test.js +318 -0
  203. package/packages/server/dist/parsers/workflow-parser.test.js.map +1 -0
  204. package/packages/server/dist/plugins/agents-plugin.d.ts +3 -0
  205. package/packages/server/dist/plugins/agents-plugin.d.ts.map +1 -0
  206. package/packages/server/dist/plugins/agents-plugin.js +129 -0
  207. package/packages/server/dist/plugins/agents-plugin.js.map +1 -0
  208. package/packages/server/dist/plugins/agents-plugin.test.d.ts +2 -0
  209. package/packages/server/dist/plugins/agents-plugin.test.d.ts.map +1 -0
  210. package/packages/server/dist/plugins/agents-plugin.test.js +94 -0
  211. package/packages/server/dist/plugins/agents-plugin.test.js.map +1 -0
  212. package/packages/server/dist/plugins/commands-plugin.d.ts +16 -0
  213. package/packages/server/dist/plugins/commands-plugin.d.ts.map +1 -0
  214. package/packages/server/dist/plugins/commands-plugin.js +38 -0
  215. package/packages/server/dist/plugins/commands-plugin.js.map +1 -0
  216. package/packages/server/dist/plugins/datasources-plugin.d.ts +3 -0
  217. package/packages/server/dist/plugins/datasources-plugin.d.ts.map +1 -0
  218. package/packages/server/dist/plugins/datasources-plugin.js +211 -0
  219. package/packages/server/dist/plugins/datasources-plugin.js.map +1 -0
  220. package/packages/server/dist/plugins/files-plugin.d.ts +3 -0
  221. package/packages/server/dist/plugins/files-plugin.d.ts.map +1 -0
  222. package/packages/server/dist/plugins/files-plugin.js +77 -0
  223. package/packages/server/dist/plugins/files-plugin.js.map +1 -0
  224. package/packages/server/dist/plugins/files-plugin.test.d.ts +2 -0
  225. package/packages/server/dist/plugins/files-plugin.test.d.ts.map +1 -0
  226. package/packages/server/dist/plugins/files-plugin.test.js +107 -0
  227. package/packages/server/dist/plugins/files-plugin.test.js.map +1 -0
  228. package/packages/server/dist/plugins/modules-plugin.d.ts +3 -0
  229. package/packages/server/dist/plugins/modules-plugin.d.ts.map +1 -0
  230. package/packages/server/dist/plugins/modules-plugin.js +1313 -0
  231. package/packages/server/dist/plugins/modules-plugin.js.map +1 -0
  232. package/packages/server/dist/plugins/modules-plugin.test.d.ts +2 -0
  233. package/packages/server/dist/plugins/modules-plugin.test.d.ts.map +1 -0
  234. package/packages/server/dist/plugins/modules-plugin.test.js +2124 -0
  235. package/packages/server/dist/plugins/modules-plugin.test.js.map +1 -0
  236. package/packages/server/dist/plugins/outputs-plugin.d.ts +3 -0
  237. package/packages/server/dist/plugins/outputs-plugin.d.ts.map +1 -0
  238. package/packages/server/dist/plugins/outputs-plugin.js +75 -0
  239. package/packages/server/dist/plugins/outputs-plugin.js.map +1 -0
  240. package/packages/server/dist/plugins/outputs-plugin.test.d.ts +2 -0
  241. package/packages/server/dist/plugins/outputs-plugin.test.d.ts.map +1 -0
  242. package/packages/server/dist/plugins/outputs-plugin.test.js +79 -0
  243. package/packages/server/dist/plugins/outputs-plugin.test.js.map +1 -0
  244. package/packages/server/dist/plugins/overview-plugin.d.ts +3 -0
  245. package/packages/server/dist/plugins/overview-plugin.d.ts.map +1 -0
  246. package/packages/server/dist/plugins/overview-plugin.js +70 -0
  247. package/packages/server/dist/plugins/overview-plugin.js.map +1 -0
  248. package/packages/server/dist/plugins/search-plugin.d.ts +3 -0
  249. package/packages/server/dist/plugins/search-plugin.d.ts.map +1 -0
  250. package/packages/server/dist/plugins/search-plugin.js +46 -0
  251. package/packages/server/dist/plugins/search-plugin.js.map +1 -0
  252. package/packages/server/dist/plugins/settings-plugin.d.ts +3 -0
  253. package/packages/server/dist/plugins/settings-plugin.d.ts.map +1 -0
  254. package/packages/server/dist/plugins/settings-plugin.js +61 -0
  255. package/packages/server/dist/plugins/settings-plugin.js.map +1 -0
  256. package/packages/server/dist/plugins/settings-plugin.test.d.ts +2 -0
  257. package/packages/server/dist/plugins/settings-plugin.test.d.ts.map +1 -0
  258. package/packages/server/dist/plugins/settings-plugin.test.js +144 -0
  259. package/packages/server/dist/plugins/settings-plugin.test.js.map +1 -0
  260. package/packages/server/dist/plugins/skills-plugin.d.ts +3 -0
  261. package/packages/server/dist/plugins/skills-plugin.d.ts.map +1 -0
  262. package/packages/server/dist/plugins/skills-plugin.js +72 -0
  263. package/packages/server/dist/plugins/skills-plugin.js.map +1 -0
  264. package/packages/server/dist/plugins/teams-plugin.d.ts +3 -0
  265. package/packages/server/dist/plugins/teams-plugin.d.ts.map +1 -0
  266. package/packages/server/dist/plugins/teams-plugin.js +162 -0
  267. package/packages/server/dist/plugins/teams-plugin.js.map +1 -0
  268. package/packages/server/dist/plugins/teams-plugin.test.d.ts +2 -0
  269. package/packages/server/dist/plugins/teams-plugin.test.d.ts.map +1 -0
  270. package/packages/server/dist/plugins/teams-plugin.test.js +171 -0
  271. package/packages/server/dist/plugins/teams-plugin.test.js.map +1 -0
  272. package/packages/server/dist/plugins/validation-plugin.d.ts +3 -0
  273. package/packages/server/dist/plugins/validation-plugin.d.ts.map +1 -0
  274. package/packages/server/dist/plugins/validation-plugin.js +102 -0
  275. package/packages/server/dist/plugins/validation-plugin.js.map +1 -0
  276. package/packages/server/dist/plugins/validation-plugin.test.d.ts +2 -0
  277. package/packages/server/dist/plugins/validation-plugin.test.d.ts.map +1 -0
  278. package/packages/server/dist/plugins/validation-plugin.test.js +161 -0
  279. package/packages/server/dist/plugins/validation-plugin.test.js.map +1 -0
  280. package/packages/server/dist/plugins/workflows-plugin.d.ts +3 -0
  281. package/packages/server/dist/plugins/workflows-plugin.d.ts.map +1 -0
  282. package/packages/server/dist/plugins/workflows-plugin.js +227 -0
  283. package/packages/server/dist/plugins/workflows-plugin.js.map +1 -0
  284. package/packages/server/dist/plugins/workflows-plugin.test.d.ts +2 -0
  285. package/packages/server/dist/plugins/workflows-plugin.test.d.ts.map +1 -0
  286. package/packages/server/dist/plugins/workflows-plugin.test.js +115 -0
  287. package/packages/server/dist/plugins/workflows-plugin.test.js.map +1 -0
  288. package/packages/server/dist/static.d.ts +3 -0
  289. package/packages/server/dist/static.d.ts.map +1 -0
  290. package/packages/server/dist/static.js +23 -0
  291. package/packages/server/dist/static.js.map +1 -0
  292. package/packages/shared/src/agents.ts +4 -0
  293. package/packages/shared/src/config.ts +26 -0
  294. package/packages/shared/src/connections.ts +11 -8
  295. package/packages/shared/src/index.ts +13 -0
  296. package/packages/shared/src/modules.ts +42 -0
  297. package/packages/shared/src/registry.ts +26 -0
  298. package/packages/shared/src/types.test.ts +41 -4
  299. package/.prettierrc +0 -8
  300. package/CONTRIBUTING.md +0 -109
  301. package/_bmad/_config/agent-manifest.csv +0 -11
  302. package/_bmad/_config/bmad-help.csv +0 -57
  303. package/_bmad/_config/files-manifest.csv +0 -646
  304. package/_bmad/_config/ides/claude-code.yaml +0 -5
  305. package/_bmad/_config/manifest.yaml +0 -42
  306. package/_bmad/_config/skill-manifest.csv +0 -48
  307. package/_bmad/_config/task-manifest.csv +0 -1
  308. package/_bmad/_config/tool-manifest.csv +0 -1
  309. package/_bmad/_config/workflow-manifest.csv +0 -1
  310. package/_bmad/bmb/config.yaml +0 -13
  311. package/_bmad/bmb/module-help.csv +0 -7
  312. package/_bmad/bmb/skills/bmad-agent-builder/SKILL.md +0 -65
  313. package/_bmad/bmb/skills/bmad-agent-builder/assets/SKILL-template.md +0 -97
  314. package/_bmad/bmb/skills/bmad-agent-builder/assets/autonomous-wake.md +0 -37
  315. package/_bmad/bmb/skills/bmad-agent-builder/assets/init-template.md +0 -47
  316. package/_bmad/bmb/skills/bmad-agent-builder/assets/memory-system.md +0 -129
  317. package/_bmad/bmb/skills/bmad-agent-builder/assets/quality-report-template.md +0 -282
  318. package/_bmad/bmb/skills/bmad-agent-builder/assets/save-memory.md +0 -29
  319. package/_bmad/bmb/skills/bmad-agent-builder/bmad-manifest.json +0 -24
  320. package/_bmad/bmb/skills/bmad-agent-builder/bmad-skill-manifest.yaml +0 -1
  321. package/_bmad/bmb/skills/bmad-agent-builder/build-process.md +0 -199
  322. package/_bmad/bmb/skills/bmad-agent-builder/quality-optimizer.md +0 -208
  323. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-agent-cohesion.md +0 -272
  324. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-enhancement-opportunities.md +0 -277
  325. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-execution-efficiency.md +0 -181
  326. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-prompt-craft.md +0 -245
  327. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-script-opportunities.md +0 -262
  328. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-structure.md +0 -183
  329. package/_bmad/bmb/skills/bmad-agent-builder/references/metadata-reference.md +0 -126
  330. package/_bmad/bmb/skills/bmad-agent-builder/references/quality-dimensions.md +0 -46
  331. package/_bmad/bmb/skills/bmad-agent-builder/references/script-opportunities-reference.md +0 -385
  332. package/_bmad/bmb/skills/bmad-agent-builder/references/skill-best-practices.md +0 -218
  333. package/_bmad/bmb/skills/bmad-agent-builder/references/standard-fields.md +0 -103
  334. package/_bmad/bmb/skills/bmad-agent-builder/references/template-substitution-rules.md +0 -72
  335. package/_bmad/bmb/skills/bmad-agent-builder/references/universal-scan-schema.md +0 -267
  336. package/_bmad/bmb/skills/bmad-agent-builder/report-quality-scan-creator.md +0 -138
  337. package/_bmad/bmb/skills/bmad-agent-builder/scripts/bmad-manifest-schema.json +0 -103
  338. package/_bmad/bmb/skills/bmad-agent-builder/scripts/generate-html-report.py +0 -1002
  339. package/_bmad/bmb/skills/bmad-agent-builder/scripts/manifest.py +0 -420
  340. package/_bmad/bmb/skills/bmad-agent-builder/scripts/prepass-execution-deps.py +0 -368
  341. package/_bmad/bmb/skills/bmad-agent-builder/scripts/prepass-prompt-metrics.py +0 -476
  342. package/_bmad/bmb/skills/bmad-agent-builder/scripts/prepass-structure-capabilities.py +0 -636
  343. package/_bmad/bmb/skills/bmad-agent-builder/scripts/scan-path-standards.py +0 -253
  344. package/_bmad/bmb/skills/bmad-agent-builder/scripts/scan-scripts.py +0 -745
  345. package/_bmad/bmb/skills/bmad-workflow-builder/SKILL.md +0 -65
  346. package/_bmad/bmb/skills/bmad-workflow-builder/assets/SKILL-template.md +0 -117
  347. package/_bmad/bmb/skills/bmad-workflow-builder/assets/quality-report-template.md +0 -260
  348. package/_bmad/bmb/skills/bmad-workflow-builder/bmad-manifest.json +0 -23
  349. package/_bmad/bmb/skills/bmad-workflow-builder/bmad-skill-manifest.yaml +0 -1
  350. package/_bmad/bmb/skills/bmad-workflow-builder/build-process.md +0 -208
  351. package/_bmad/bmb/skills/bmad-workflow-builder/quality-optimizer.md +0 -209
  352. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-enhancement-opportunities.md +0 -273
  353. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-execution-efficiency.md +0 -322
  354. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-prompt-craft.md +0 -328
  355. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-script-opportunities.md +0 -261
  356. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-skill-cohesion.md +0 -340
  357. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-workflow-integrity.md +0 -280
  358. package/_bmad/bmb/skills/bmad-workflow-builder/references/classification-reference.md +0 -61
  359. package/_bmad/bmb/skills/bmad-workflow-builder/references/complex-workflow-patterns.md +0 -523
  360. package/_bmad/bmb/skills/bmad-workflow-builder/references/metadata-reference.md +0 -126
  361. package/_bmad/bmb/skills/bmad-workflow-builder/references/quality-dimensions.md +0 -45
  362. package/_bmad/bmb/skills/bmad-workflow-builder/references/script-opportunities-reference.md +0 -354
  363. package/_bmad/bmb/skills/bmad-workflow-builder/references/skill-best-practices.md +0 -218
  364. package/_bmad/bmb/skills/bmad-workflow-builder/references/standard-fields.md +0 -121
  365. package/_bmad/bmb/skills/bmad-workflow-builder/references/template-substitution-rules.md +0 -85
  366. package/_bmad/bmb/skills/bmad-workflow-builder/references/universal-scan-schema.md +0 -267
  367. package/_bmad/bmb/skills/bmad-workflow-builder/report-quality-scan-creator.md +0 -134
  368. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/bmad-manifest-schema.json +0 -103
  369. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/generate-html-report.py +0 -1002
  370. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/manifest.py +0 -420
  371. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/prepass-execution-deps.py +0 -313
  372. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/prepass-prompt-metrics.py +0 -285
  373. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/prepass-workflow-integrity.py +0 -485
  374. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/scan-path-standards.py +0 -213
  375. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/scan-scripts.py +0 -745
  376. package/_bmad/bmm/agents/analyst.md +0 -69
  377. package/_bmad/bmm/agents/architect.md +0 -59
  378. package/_bmad/bmm/agents/bmad-skill-manifest.yaml +0 -39
  379. package/_bmad/bmm/agents/dev.md +0 -66
  380. package/_bmad/bmm/agents/pm.md +0 -63
  381. package/_bmad/bmm/agents/qa.md +0 -89
  382. package/_bmad/bmm/agents/quick-flow-solo-dev.md +0 -61
  383. package/_bmad/bmm/agents/sm.md +0 -67
  384. package/_bmad/bmm/agents/tech-writer/bmad-skill-manifest.yaml +0 -3
  385. package/_bmad/bmm/agents/tech-writer/tech-writer.md +0 -67
  386. package/_bmad/bmm/agents/ux-designer.md +0 -58
  387. package/_bmad/bmm/config.yaml +0 -16
  388. package/_bmad/bmm/data/project-context-template.md +0 -26
  389. package/_bmad/bmm/module-help.csv +0 -32
  390. package/_bmad/bmm/teams/default-party.csv +0 -20
  391. package/_bmad/bmm/teams/team-fullstack.yaml +0 -12
  392. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/SKILL.md +0 -6
  393. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/bmad-skill-manifest.yaml +0 -1
  394. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/product-brief.template.md +0 -10
  395. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-01-init.md +0 -170
  396. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-01b-continue.md +0 -158
  397. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-02-vision.md +0 -193
  398. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-03-users.md +0 -196
  399. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-04-metrics.md +0 -199
  400. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-05-scope.md +0 -213
  401. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-06-complete.md +0 -159
  402. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/workflow.md +0 -55
  403. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/SKILL.md +0 -88
  404. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/artifact-analyzer.md +0 -60
  405. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/opportunity-reviewer.md +0 -44
  406. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/skeptic-reviewer.md +0 -44
  407. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/web-researcher.md +0 -49
  408. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/bmad-manifest.json +0 -17
  409. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/bmad-skill-manifest.yaml +0 -1
  410. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/contextual-discovery.md +0 -57
  411. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/draft-and-review.md +0 -86
  412. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/finalize.md +0 -75
  413. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/guided-elicitation.md +0 -70
  414. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/resources/brief-template.md +0 -60
  415. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/SKILL.md +0 -6
  416. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/bmad-skill-manifest.yaml +0 -1
  417. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-01-init.md +0 -137
  418. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-02-domain-analysis.md +0 -229
  419. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-03-competitive-landscape.md +0 -238
  420. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-04-regulatory-focus.md +0 -206
  421. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-05-technical-trends.md +0 -234
  422. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-06-research-synthesis.md +0 -444
  423. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/research.template.md +0 -29
  424. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/workflow.md +0 -49
  425. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/SKILL.md +0 -6
  426. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/bmad-skill-manifest.yaml +0 -1
  427. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md +0 -29
  428. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-01-init.md +0 -184
  429. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-02-customer-behavior.md +0 -239
  430. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-03-customer-pain-points.md +0 -251
  431. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-04-customer-decisions.md +0 -261
  432. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-05-competitive-analysis.md +0 -173
  433. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-06-research-completion.md +0 -478
  434. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/workflow.md +0 -49
  435. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/SKILL.md +0 -6
  436. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/bmad-skill-manifest.yaml +0 -1
  437. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/research.template.md +0 -29
  438. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-01-init.md +0 -137
  439. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-02-technical-overview.md +0 -239
  440. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-03-integration-patterns.md +0 -248
  441. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-04-architectural-patterns.md +0 -202
  442. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-05-implementation-research.md +0 -233
  443. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-06-research-synthesis.md +0 -487
  444. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/workflow.md +0 -50
  445. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-01-init.md +0 -182
  446. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +0 -237
  447. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +0 -249
  448. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +0 -259
  449. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +0 -177
  450. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-06-research-completion.md +0 -476
  451. package/_bmad/bmm/workflows/1-analysis/research/research.template.md +0 -29
  452. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/SKILL.md +0 -6
  453. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/bmad-skill-manifest.yaml +0 -1
  454. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-01-init.md +0 -135
  455. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-01b-continue.md +0 -127
  456. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-02-discovery.md +0 -190
  457. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-03-core-experience.md +0 -217
  458. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-04-emotional-response.md +0 -220
  459. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-05-inspiration.md +0 -235
  460. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-06-design-system.md +0 -253
  461. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-07-defining-experience.md +0 -255
  462. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-08-visual-foundation.md +0 -225
  463. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-09-design-directions.md +0 -225
  464. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-10-user-journeys.md +0 -242
  465. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-11-component-strategy.md +0 -249
  466. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-12-ux-patterns.md +0 -238
  467. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-13-responsive-accessibility.md +0 -265
  468. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-14-complete.md +0 -171
  469. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/ux-design-template.md +0 -13
  470. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/workflow.md +0 -36
  471. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/SKILL.md +0 -6
  472. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/bmad-skill-manifest.yaml +0 -1
  473. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01-discovery.md +0 -242
  474. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md +0 -204
  475. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-02-review.md +0 -245
  476. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-03-edit.md +0 -250
  477. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-04-complete.md +0 -165
  478. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/workflow.md +0 -63
  479. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/SKILL.md +0 -6
  480. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/bmad-skill-manifest.yaml +0 -1
  481. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/data/domain-complexity.csv +0 -15
  482. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/data/prd-purpose.md +0 -197
  483. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/data/project-types.csv +0 -11
  484. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-01-discovery.md +0 -221
  485. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-02-format-detection.md +0 -188
  486. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-02b-parity-check.md +0 -206
  487. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-03-density-validation.md +0 -171
  488. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +0 -211
  489. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-05-measurability-validation.md +0 -225
  490. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-06-traceability-validation.md +0 -214
  491. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -202
  492. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +0 -240
  493. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-09-project-type-validation.md +0 -260
  494. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-10-smart-validation.md +0 -206
  495. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +0 -261
  496. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-12-completeness-validation.md +0 -239
  497. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-13-report-complete.md +0 -229
  498. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/workflow.md +0 -62
  499. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/domain-complexity.csv +0 -15
  500. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/prd-purpose.md +0 -197
  501. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/project-types.csv +0 -11
  502. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +0 -224
  503. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-02-format-detection.md +0 -191
  504. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-02b-parity-check.md +0 -209
  505. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-03-density-validation.md +0 -174
  506. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-04-brief-coverage-validation.md +0 -214
  507. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-05-measurability-validation.md +0 -228
  508. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-06-traceability-validation.md +0 -217
  509. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -205
  510. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-08-domain-compliance-validation.md +0 -243
  511. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-09-project-type-validation.md +0 -263
  512. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md +0 -209
  513. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +0 -264
  514. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-12-completeness-validation.md +0 -242
  515. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +0 -232
  516. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +0 -65
  517. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/SKILL.md +0 -6
  518. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/bmad-skill-manifest.yaml +0 -1
  519. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-01-document-discovery.md +0 -179
  520. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-02-prd-analysis.md +0 -168
  521. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +0 -169
  522. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-04-ux-alignment.md +0 -129
  523. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-05-epic-quality-review.md +0 -241
  524. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-06-final-assessment.md +0 -126
  525. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/templates/readiness-report-template.md +0 -4
  526. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/workflow.md +0 -49
  527. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/SKILL.md +0 -6
  528. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/architecture-decision-template.md +0 -12
  529. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/bmad-skill-manifest.yaml +0 -1
  530. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/data/domain-complexity.csv +0 -13
  531. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/data/project-types.csv +0 -7
  532. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-01-init.md +0 -153
  533. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-01b-continue.md +0 -173
  534. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-02-context.md +0 -224
  535. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-03-starter.md +0 -329
  536. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-04-decisions.md +0 -318
  537. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-05-patterns.md +0 -359
  538. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-06-structure.md +0 -379
  539. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-07-validation.md +0 -359
  540. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-08-complete.md +0 -76
  541. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/workflow.md +0 -38
  542. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/SKILL.md +0 -6
  543. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/bmad-skill-manifest.yaml +0 -1
  544. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -255
  545. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-02-design-epics.md +0 -212
  546. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-03-create-stories.md +0 -255
  547. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-04-final-validation.md +0 -131
  548. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/templates/epics-template.md +0 -61
  549. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/workflow.md +0 -53
  550. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/SKILL.md +0 -6
  551. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/bmad-skill-manifest.yaml +0 -1
  552. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-01-gather-context.md +0 -61
  553. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-02-review.md +0 -41
  554. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-03-triage.md +0 -50
  555. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-04-present.md +0 -38
  556. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/workflow.md +0 -54
  557. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/SKILL.md +0 -6
  558. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/bmad-skill-manifest.yaml +0 -1
  559. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/checklist.md +0 -288
  560. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/workflow.md +0 -267
  561. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/SKILL.md +0 -6
  562. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/bmad-skill-manifest.yaml +0 -1
  563. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/checklist.md +0 -357
  564. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/discover-inputs.md +0 -88
  565. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/template.md +0 -49
  566. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/workflow.md +0 -380
  567. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/SKILL.md +0 -6
  568. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/bmad-skill-manifest.yaml +0 -1
  569. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/checklist.md +0 -80
  570. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/workflow.md +0 -450
  571. package/_bmad/bmm/workflows/4-implementation/bmad-retrospective/SKILL.md +0 -6
  572. package/_bmad/bmm/workflows/4-implementation/bmad-retrospective/bmad-skill-manifest.yaml +0 -1
  573. package/_bmad/bmm/workflows/4-implementation/bmad-retrospective/workflow.md +0 -1479
  574. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/SKILL.md +0 -6
  575. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/bmad-skill-manifest.yaml +0 -1
  576. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/checklist.md +0 -33
  577. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/sprint-status-template.yaml +0 -56
  578. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/workflow.md +0 -263
  579. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-status/SKILL.md +0 -6
  580. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-status/bmad-skill-manifest.yaml +0 -1
  581. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-status/workflow.md +0 -261
  582. package/_bmad/bmm/workflows/bmad-document-project/SKILL.md +0 -6
  583. package/_bmad/bmm/workflows/bmad-document-project/bmad-skill-manifest.yaml +0 -1
  584. package/_bmad/bmm/workflows/bmad-document-project/checklist.md +0 -245
  585. package/_bmad/bmm/workflows/bmad-document-project/documentation-requirements.csv +0 -12
  586. package/_bmad/bmm/workflows/bmad-document-project/instructions.md +0 -128
  587. package/_bmad/bmm/workflows/bmad-document-project/templates/deep-dive-template.md +0 -345
  588. package/_bmad/bmm/workflows/bmad-document-project/templates/index-template.md +0 -169
  589. package/_bmad/bmm/workflows/bmad-document-project/templates/project-overview-template.md +0 -103
  590. package/_bmad/bmm/workflows/bmad-document-project/templates/project-scan-report-schema.json +0 -160
  591. package/_bmad/bmm/workflows/bmad-document-project/templates/source-tree-template.md +0 -135
  592. package/_bmad/bmm/workflows/bmad-document-project/workflow.md +0 -27
  593. package/_bmad/bmm/workflows/bmad-document-project/workflows/deep-dive-instructions.md +0 -299
  594. package/_bmad/bmm/workflows/bmad-document-project/workflows/deep-dive-workflow.md +0 -34
  595. package/_bmad/bmm/workflows/bmad-document-project/workflows/full-scan-instructions.md +0 -1107
  596. package/_bmad/bmm/workflows/bmad-document-project/workflows/full-scan-workflow.md +0 -34
  597. package/_bmad/bmm/workflows/bmad-generate-project-context/SKILL.md +0 -6
  598. package/_bmad/bmm/workflows/bmad-generate-project-context/bmad-skill-manifest.yaml +0 -1
  599. package/_bmad/bmm/workflows/bmad-generate-project-context/project-context-template.md +0 -21
  600. package/_bmad/bmm/workflows/bmad-generate-project-context/steps/step-01-discover.md +0 -186
  601. package/_bmad/bmm/workflows/bmad-generate-project-context/steps/step-02-generate.md +0 -321
  602. package/_bmad/bmm/workflows/bmad-generate-project-context/steps/step-03-complete.md +0 -278
  603. package/_bmad/bmm/workflows/bmad-generate-project-context/workflow.md +0 -43
  604. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/SKILL.md +0 -6
  605. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/bmad-skill-manifest.yaml +0 -1
  606. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/checklist.md +0 -33
  607. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/workflow.md +0 -136
  608. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/SKILL.md +0 -6
  609. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/bmad-skill-manifest.yaml +0 -1
  610. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-01-mode-detection.md +0 -169
  611. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-02-context-gathering.md +0 -114
  612. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-03-execute.md +0 -107
  613. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-04-self-check.md +0 -107
  614. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-05-adversarial-review.md +0 -94
  615. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-06-resolve-findings.md +0 -144
  616. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/workflow.md +0 -38
  617. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/SKILL.md +0 -6
  618. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/bmad-skill-manifest.yaml +0 -1
  619. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-01-clarify-and-route.md +0 -51
  620. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-02-plan.md +0 -35
  621. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-03-implement.md +0 -33
  622. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md +0 -50
  623. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-05-present.md +0 -17
  624. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/tech-spec-template.md +0 -90
  625. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md +0 -79
  626. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/SKILL.md +0 -6
  627. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/bmad-skill-manifest.yaml +0 -1
  628. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-01-understand.md +0 -185
  629. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-02-investigate.md +0 -140
  630. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-03-generate.md +0 -123
  631. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-04-review.md +0 -195
  632. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/tech-spec-template.md +0 -74
  633. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/workflow.md +0 -73
  634. package/_bmad/core/config.yaml +0 -9
  635. package/_bmad/core/module-help.csv +0 -11
  636. package/_bmad/core/skills/bmad-advanced-elicitation/SKILL.md +0 -6
  637. package/_bmad/core/skills/bmad-advanced-elicitation/bmad-skill-manifest.yaml +0 -1
  638. package/_bmad/core/skills/bmad-advanced-elicitation/methods.csv +0 -51
  639. package/_bmad/core/skills/bmad-advanced-elicitation/workflow.md +0 -135
  640. package/_bmad/core/skills/bmad-brainstorming/SKILL.md +0 -6
  641. package/_bmad/core/skills/bmad-brainstorming/bmad-skill-manifest.yaml +0 -1
  642. package/_bmad/core/skills/bmad-brainstorming/brain-methods.csv +0 -62
  643. package/_bmad/core/skills/bmad-brainstorming/steps/step-01-session-setup.md +0 -214
  644. package/_bmad/core/skills/bmad-brainstorming/steps/step-01b-continue.md +0 -124
  645. package/_bmad/core/skills/bmad-brainstorming/steps/step-02a-user-selected.md +0 -229
  646. package/_bmad/core/skills/bmad-brainstorming/steps/step-02b-ai-recommended.md +0 -239
  647. package/_bmad/core/skills/bmad-brainstorming/steps/step-02c-random-selection.md +0 -211
  648. package/_bmad/core/skills/bmad-brainstorming/steps/step-02d-progressive-flow.md +0 -266
  649. package/_bmad/core/skills/bmad-brainstorming/steps/step-03-technique-execution.md +0 -401
  650. package/_bmad/core/skills/bmad-brainstorming/steps/step-04-idea-organization.md +0 -305
  651. package/_bmad/core/skills/bmad-brainstorming/template.md +0 -15
  652. package/_bmad/core/skills/bmad-brainstorming/workflow.md +0 -53
  653. package/_bmad/core/skills/bmad-distillator/SKILL.md +0 -178
  654. package/_bmad/core/skills/bmad-distillator/agents/distillate-compressor.md +0 -116
  655. package/_bmad/core/skills/bmad-distillator/agents/round-trip-reconstructor.md +0 -68
  656. package/_bmad/core/skills/bmad-distillator/bmad-skill-manifest.yaml +0 -15
  657. package/_bmad/core/skills/bmad-distillator/resources/compression-rules.md +0 -51
  658. package/_bmad/core/skills/bmad-distillator/resources/distillate-format-reference.md +0 -227
  659. package/_bmad/core/skills/bmad-distillator/resources/splitting-strategy.md +0 -78
  660. package/_bmad/core/skills/bmad-distillator/scripts/analyze_sources.py +0 -300
  661. package/_bmad/core/skills/bmad-distillator/scripts/tests/test_analyze_sources.py +0 -204
  662. package/_bmad/core/skills/bmad-editorial-review-prose/SKILL.md +0 -6
  663. package/_bmad/core/skills/bmad-editorial-review-prose/bmad-skill-manifest.yaml +0 -1
  664. package/_bmad/core/skills/bmad-editorial-review-prose/workflow.md +0 -81
  665. package/_bmad/core/skills/bmad-editorial-review-structure/SKILL.md +0 -6
  666. package/_bmad/core/skills/bmad-editorial-review-structure/bmad-skill-manifest.yaml +0 -1
  667. package/_bmad/core/skills/bmad-editorial-review-structure/workflow.md +0 -174
  668. package/_bmad/core/skills/bmad-help/SKILL.md +0 -6
  669. package/_bmad/core/skills/bmad-help/bmad-skill-manifest.yaml +0 -1
  670. package/_bmad/core/skills/bmad-help/workflow.md +0 -88
  671. package/_bmad/core/skills/bmad-index-docs/SKILL.md +0 -6
  672. package/_bmad/core/skills/bmad-index-docs/bmad-skill-manifest.yaml +0 -1
  673. package/_bmad/core/skills/bmad-index-docs/workflow.md +0 -61
  674. package/_bmad/core/skills/bmad-party-mode/SKILL.md +0 -6
  675. package/_bmad/core/skills/bmad-party-mode/bmad-skill-manifest.yaml +0 -1
  676. package/_bmad/core/skills/bmad-party-mode/steps/step-01-agent-loading.md +0 -138
  677. package/_bmad/core/skills/bmad-party-mode/steps/step-02-discussion-orchestration.md +0 -187
  678. package/_bmad/core/skills/bmad-party-mode/steps/step-03-graceful-exit.md +0 -167
  679. package/_bmad/core/skills/bmad-party-mode/workflow.md +0 -190
  680. package/_bmad/core/skills/bmad-review-adversarial-general/SKILL.md +0 -6
  681. package/_bmad/core/skills/bmad-review-adversarial-general/bmad-skill-manifest.yaml +0 -1
  682. package/_bmad/core/skills/bmad-review-adversarial-general/workflow.md +0 -32
  683. package/_bmad/core/skills/bmad-review-edge-case-hunter/SKILL.md +0 -6
  684. package/_bmad/core/skills/bmad-review-edge-case-hunter/bmad-skill-manifest.yaml +0 -1
  685. package/_bmad/core/skills/bmad-review-edge-case-hunter/workflow.md +0 -62
  686. package/_bmad/core/skills/bmad-shard-doc/SKILL.md +0 -6
  687. package/_bmad/core/skills/bmad-shard-doc/bmad-skill-manifest.yaml +0 -1
  688. package/_bmad/core/skills/bmad-shard-doc/workflow.md +0 -100
  689. package/_bmad/core/tasks/bmad-create-prd/SKILL.md +0 -6
  690. package/_bmad/core/tasks/bmad-create-prd/bmad-skill-manifest.yaml +0 -1
  691. package/_bmad/core/tasks/bmad-create-prd/data/domain-complexity.csv +0 -15
  692. package/_bmad/core/tasks/bmad-create-prd/data/prd-purpose.md +0 -197
  693. package/_bmad/core/tasks/bmad-create-prd/data/project-types.csv +0 -11
  694. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-01-init.md +0 -178
  695. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-01b-continue.md +0 -161
  696. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-02-discovery.md +0 -208
  697. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-02b-vision.md +0 -142
  698. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-02c-executive-summary.md +0 -158
  699. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-03-success.md +0 -214
  700. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-04-journeys.md +0 -201
  701. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-05-domain.md +0 -194
  702. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-06-innovation.md +0 -211
  703. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-07-project-type.md +0 -222
  704. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-08-scoping.md +0 -216
  705. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-09-functional.md +0 -219
  706. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-10-nonfunctional.md +0 -230
  707. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-11-polish.md +0 -221
  708. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-12-complete.md +0 -115
  709. package/_bmad/core/tasks/bmad-create-prd/templates/prd-template.md +0 -10
  710. package/_bmad/core/tasks/bmad-create-prd/workflow.md +0 -62
  711. package/_bmad/tea/agents/tea.md +0 -63
  712. package/_bmad/tea/config.yaml +0 -25
  713. package/_bmad/tea/module-help.csv +0 -10
  714. package/_bmad/tea/teams/default-party.csv +0 -2
  715. package/_bmad/tea/testarch/knowledge/adr-quality-readiness-checklist.md +0 -377
  716. package/_bmad/tea/testarch/knowledge/api-request.md +0 -563
  717. package/_bmad/tea/testarch/knowledge/api-testing-patterns.md +0 -915
  718. package/_bmad/tea/testarch/knowledge/auth-session.md +0 -548
  719. package/_bmad/tea/testarch/knowledge/burn-in.md +0 -273
  720. package/_bmad/tea/testarch/knowledge/ci-burn-in.md +0 -717
  721. package/_bmad/tea/testarch/knowledge/component-tdd.md +0 -486
  722. package/_bmad/tea/testarch/knowledge/contract-testing.md +0 -1050
  723. package/_bmad/tea/testarch/knowledge/data-factories.md +0 -500
  724. package/_bmad/tea/testarch/knowledge/email-auth.md +0 -721
  725. package/_bmad/tea/testarch/knowledge/error-handling.md +0 -725
  726. package/_bmad/tea/testarch/knowledge/feature-flags.md +0 -750
  727. package/_bmad/tea/testarch/knowledge/file-utils.md +0 -456
  728. package/_bmad/tea/testarch/knowledge/fixture-architecture.md +0 -401
  729. package/_bmad/tea/testarch/knowledge/fixtures-composition.md +0 -382
  730. package/_bmad/tea/testarch/knowledge/intercept-network-call.md +0 -426
  731. package/_bmad/tea/testarch/knowledge/log.md +0 -426
  732. package/_bmad/tea/testarch/knowledge/network-error-monitor.md +0 -401
  733. package/_bmad/tea/testarch/knowledge/network-first.md +0 -486
  734. package/_bmad/tea/testarch/knowledge/network-recorder.md +0 -527
  735. package/_bmad/tea/testarch/knowledge/nfr-criteria.md +0 -670
  736. package/_bmad/tea/testarch/knowledge/overview.md +0 -286
  737. package/_bmad/tea/testarch/knowledge/pact-consumer-di.md +0 -310
  738. package/_bmad/tea/testarch/knowledge/pact-consumer-framework-setup.md +0 -635
  739. package/_bmad/tea/testarch/knowledge/pact-mcp.md +0 -204
  740. package/_bmad/tea/testarch/knowledge/pactjs-utils-consumer-helpers.md +0 -270
  741. package/_bmad/tea/testarch/knowledge/pactjs-utils-overview.md +0 -216
  742. package/_bmad/tea/testarch/knowledge/pactjs-utils-provider-verifier.md +0 -315
  743. package/_bmad/tea/testarch/knowledge/pactjs-utils-request-filter.md +0 -224
  744. package/_bmad/tea/testarch/knowledge/playwright-cli.md +0 -165
  745. package/_bmad/tea/testarch/knowledge/playwright-config.md +0 -730
  746. package/_bmad/tea/testarch/knowledge/probability-impact.md +0 -601
  747. package/_bmad/tea/testarch/knowledge/recurse.md +0 -421
  748. package/_bmad/tea/testarch/knowledge/risk-governance.md +0 -615
  749. package/_bmad/tea/testarch/knowledge/selective-testing.md +0 -732
  750. package/_bmad/tea/testarch/knowledge/selector-resilience.md +0 -527
  751. package/_bmad/tea/testarch/knowledge/test-healing-patterns.md +0 -644
  752. package/_bmad/tea/testarch/knowledge/test-levels-framework.md +0 -473
  753. package/_bmad/tea/testarch/knowledge/test-priorities-matrix.md +0 -373
  754. package/_bmad/tea/testarch/knowledge/test-quality.md +0 -664
  755. package/_bmad/tea/testarch/knowledge/timing-debugging.md +0 -372
  756. package/_bmad/tea/testarch/knowledge/visual-debugging.md +0 -524
  757. package/_bmad/tea/testarch/tea-index.csv +0 -43
  758. package/_bmad/tea/workflows/testarch/README.md +0 -74
  759. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/SKILL.md +0 -6
  760. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/bmad-skill-manifest.yaml +0 -1
  761. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/checklist.md +0 -197
  762. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/curriculum.yaml +0 -129
  763. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/quiz-questions.yaml +0 -206
  764. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/role-paths.yaml +0 -136
  765. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/session-content-map.yaml +0 -207
  766. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/tea-resources-index.yaml +0 -359
  767. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/instructions.md +0 -130
  768. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-01-init.md +0 -235
  769. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-01b-continue.md +0 -147
  770. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-02-assess.md +0 -258
  771. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-03-session-menu.md +0 -219
  772. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-01.md +0 -460
  773. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-02.md +0 -465
  774. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-03.md +0 -301
  775. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-04.md +0 -234
  776. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-05.md +0 -234
  777. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-06.md +0 -209
  778. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-07.md +0 -212
  779. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md +0 -339
  780. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-01-assess-workflow.md +0 -141
  781. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-02-apply-edits.md +0 -122
  782. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-v/step-v-01-validate.md +0 -263
  783. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/templates/certificate-template.md +0 -86
  784. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/templates/progress-template.yaml +0 -95
  785. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/templates/session-notes-template.md +0 -83
  786. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/workflow-plan-teach-me-testing.md +0 -950
  787. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/workflow.md +0 -90
  788. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/SKILL.md +0 -6
  789. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/atdd-checklist-template.md +0 -371
  790. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/bmad-skill-manifest.yaml +0 -1
  791. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/checklist.md +0 -374
  792. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/instructions.md +0 -45
  793. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-01-preflight-and-context.md +0 -226
  794. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-01b-resume.md +0 -96
  795. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-02-generation-mode.md +0 -125
  796. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-03-test-strategy.md +0 -110
  797. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04-generate-tests.md +0 -334
  798. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04a-subagent-api-failing.md +0 -286
  799. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04b-subagent-e2e-failing.md +0 -244
  800. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04c-aggregate.md +0 -370
  801. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-05-validate-and-complete.md +0 -106
  802. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-e/step-01-assess.md +0 -65
  803. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-e/step-02-apply-edit.md +0 -60
  804. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-v/step-01-validate.md +0 -67
  805. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/validation-report-20260127-095021.md +0 -73
  806. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/validation-report-20260127-102401.md +0 -116
  807. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/workflow-plan.md +0 -21
  808. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/workflow.md +0 -41
  809. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/workflow.yaml +0 -46
  810. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/SKILL.md +0 -6
  811. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/bmad-skill-manifest.yaml +0 -1
  812. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/checklist.md +0 -611
  813. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/instructions.md +0 -50
  814. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-01-preflight-and-context.md +0 -237
  815. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-01b-resume.md +0 -94
  816. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-02-identify-targets.md +0 -169
  817. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03-generate-tests.md +0 -394
  818. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03a-subagent-api.md +0 -263
  819. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03b-subagent-backend.md +0 -246
  820. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03b-subagent-e2e.md +0 -213
  821. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03c-aggregate.md +0 -393
  822. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-04-validate-and-summarize.md +0 -106
  823. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-e/step-01-assess.md +0 -65
  824. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-e/step-02-apply-edit.md +0 -60
  825. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-v/step-01-validate.md +0 -67
  826. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/validation-report-20260127-095021.md +0 -72
  827. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/validation-report-20260127-102401.md +0 -114
  828. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/workflow-plan.md +0 -20
  829. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/workflow.md +0 -41
  830. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/workflow.yaml +0 -53
  831. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/SKILL.md +0 -6
  832. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/azure-pipelines-template.yaml +0 -155
  833. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/bmad-skill-manifest.yaml +0 -1
  834. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/checklist.md +0 -289
  835. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/github-actions-template.yaml +0 -328
  836. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/gitlab-ci-template.yaml +0 -158
  837. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/harness-pipeline-template.yaml +0 -159
  838. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/instructions.md +0 -45
  839. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/jenkins-pipeline-template.groovy +0 -129
  840. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-01-preflight.md +0 -158
  841. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-01b-resume.md +0 -110
  842. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-02-generate-pipeline.md +0 -279
  843. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-03-configure-quality-gates.md +0 -135
  844. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-04-validate-and-summary.md +0 -92
  845. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-e/step-01-assess.md +0 -65
  846. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-e/step-02-apply-edit.md +0 -60
  847. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-v/step-01-validate.md +0 -81
  848. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/validation-report-20260127-095021.md +0 -72
  849. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/validation-report-20260127-102401.md +0 -114
  850. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/workflow-plan.md +0 -20
  851. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/workflow.md +0 -41
  852. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/workflow.yaml +0 -48
  853. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/SKILL.md +0 -6
  854. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/bmad-skill-manifest.yaml +0 -1
  855. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/checklist.md +0 -345
  856. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/instructions.md +0 -45
  857. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-01-preflight.md +0 -132
  858. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-01b-resume.md +0 -116
  859. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-02-select-framework.md +0 -117
  860. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-03-scaffold-framework.md +0 -323
  861. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-04-docs-and-scripts.md +0 -105
  862. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-05-validate-and-summary.md +0 -93
  863. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-e/step-01-assess.md +0 -65
  864. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-e/step-02-apply-edit.md +0 -60
  865. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-v/step-01-validate.md +0 -67
  866. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/validation-report-20260127-095021.md +0 -73
  867. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/validation-report-20260127-102401.md +0 -116
  868. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/workflow-plan.md +0 -22
  869. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/workflow.md +0 -41
  870. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/workflow.yaml +0 -48
  871. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/SKILL.md +0 -6
  872. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/bmad-skill-manifest.yaml +0 -1
  873. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/checklist.md +0 -407
  874. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/instructions.md +0 -43
  875. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/nfr-report-template.md +0 -470
  876. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-01-load-context.md +0 -138
  877. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-01b-resume.md +0 -106
  878. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-02-define-thresholds.md +0 -107
  879. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-03-gather-evidence.md +0 -108
  880. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04-evaluate-and-score.md +0 -254
  881. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04a-subagent-security.md +0 -138
  882. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04b-subagent-performance.md +0 -84
  883. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04c-subagent-reliability.md +0 -85
  884. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04d-subagent-scalability.md +0 -88
  885. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04e-aggregate-nfr.md +0 -264
  886. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-05-generate-report.md +0 -108
  887. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-e/step-01-assess.md +0 -65
  888. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-e/step-02-apply-edit.md +0 -60
  889. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-v/step-01-validate.md +0 -67
  890. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/validation-report-20260127-095021.md +0 -73
  891. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/validation-report-20260127-102401.md +0 -116
  892. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/workflow-plan.md +0 -19
  893. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/workflow.md +0 -41
  894. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/workflow.yaml +0 -48
  895. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/SKILL.md +0 -6
  896. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/bmad-skill-manifest.yaml +0 -1
  897. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/checklist.md +0 -464
  898. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/instructions.md +0 -105
  899. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-01-detect-mode.md +0 -134
  900. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-01b-resume.md +0 -102
  901. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-02-load-context.md +0 -242
  902. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-03-risk-and-testability.md +0 -110
  903. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-04-coverage-plan.md +0 -123
  904. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-05-generate-output.md +0 -222
  905. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-e/step-01-assess.md +0 -65
  906. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-e/step-02-apply-edit.md +0 -60
  907. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-v/step-01-validate.md +0 -67
  908. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-architecture-template.md +0 -230
  909. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-handoff-template.md +0 -70
  910. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-qa-template.md +0 -396
  911. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-template.md +0 -344
  912. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/validation-report-20260127-095021.md +0 -73
  913. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/validation-report-20260127-102401.md +0 -116
  914. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/workflow-plan.md +0 -22
  915. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/workflow.md +0 -41
  916. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/workflow.yaml +0 -77
  917. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/SKILL.md +0 -6
  918. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/bmad-skill-manifest.yaml +0 -1
  919. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/checklist.md +0 -475
  920. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/instructions.md +0 -45
  921. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-01-load-context.md +0 -197
  922. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-01b-resume.md +0 -104
  923. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-02-discover-tests.md +0 -113
  924. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03-quality-evaluation.md +0 -274
  925. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03a-subagent-determinism.md +0 -214
  926. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03b-subagent-isolation.md +0 -125
  927. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03c-subagent-maintainability.md +0 -102
  928. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03e-subagent-performance.md +0 -117
  929. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03f-aggregate-scores.md +0 -277
  930. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-04-generate-report.md +0 -111
  931. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-e/step-01-assess.md +0 -65
  932. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-e/step-02-apply-edit.md +0 -60
  933. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-v/step-01-validate.md +0 -67
  934. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/test-review-template.md +0 -387
  935. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/validation-report-20260127-095021.md +0 -72
  936. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/validation-report-20260127-102401.md +0 -114
  937. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/workflow-plan.md +0 -18
  938. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/workflow.md +0 -41
  939. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/workflow.yaml +0 -48
  940. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/SKILL.md +0 -6
  941. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/bmad-skill-manifest.yaml +0 -1
  942. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/checklist.md +0 -647
  943. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/instructions.md +0 -43
  944. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-01-load-context.md +0 -105
  945. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-01b-resume.md +0 -102
  946. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-02-discover-tests.md +0 -112
  947. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-03-map-criteria.md +0 -97
  948. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-04-analyze-gaps.md +0 -421
  949. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-05-gate-decision.md +0 -266
  950. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-e/step-01-assess.md +0 -65
  951. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-e/step-02-apply-edit.md +0 -60
  952. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-v/step-01-validate.md +0 -67
  953. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/trace-template.md +0 -708
  954. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/validation-report-20260127-095021.md +0 -73
  955. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/validation-report-20260127-102401.md +0 -116
  956. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/workflow-plan.md +0 -21
  957. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/workflow.md +0 -41
  958. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/workflow.yaml +0 -56
  959. package/eslint.config.js +0 -38
  960. package/packages/client/index.html +0 -12
  961. package/packages/client/package.json +0 -46
  962. package/packages/client/src/app.tsx +0 -57
  963. package/packages/client/src/features/about/AboutPage.tsx +0 -144
  964. package/packages/client/src/features/agents/AgentCard.tsx +0 -52
  965. package/packages/client/src/features/agents/AgentDetail.tsx +0 -338
  966. package/packages/client/src/features/agents/AgentOverrideEditor.tsx +0 -127
  967. package/packages/client/src/features/agents/AgentsPage.tsx +0 -114
  968. package/packages/client/src/features/agents/EditAgentDialog.tsx +0 -260
  969. package/packages/client/src/features/agents/SkillAssignment.tsx +0 -153
  970. package/packages/client/src/features/agents/use-agent-detail.ts +0 -17
  971. package/packages/client/src/features/agents/use-agent-mutations.ts +0 -47
  972. package/packages/client/src/features/agents/use-agents.ts +0 -17
  973. package/packages/client/src/features/connections/ConnectionsPage.tsx +0 -165
  974. package/packages/client/src/features/files/FilesPage.tsx +0 -177
  975. package/packages/client/src/features/outputs/OutputsPage.tsx +0 -190
  976. package/packages/client/src/features/overview/OverviewPage.tsx +0 -282
  977. package/packages/client/src/features/packages/EditModuleDialog.tsx +0 -118
  978. package/packages/client/src/features/packages/PackagesPage.tsx +0 -982
  979. package/packages/client/src/features/settings/SettingsPage.tsx +0 -141
  980. package/packages/client/src/features/settings/use-settings.ts +0 -34
  981. package/packages/client/src/features/skills/CreateSkillDialog.tsx +0 -328
  982. package/packages/client/src/features/skills/SkillDetailSlideOver.tsx +0 -179
  983. package/packages/client/src/features/skills/SkillsPage.tsx +0 -142
  984. package/packages/client/src/features/skills/use-skills.ts +0 -27
  985. package/packages/client/src/features/teams/CreateTeamDialog.tsx +0 -239
  986. package/packages/client/src/features/teams/TeamDetailPanel.tsx +0 -549
  987. package/packages/client/src/features/teams/TeamsPage.tsx +0 -196
  988. package/packages/client/src/features/teams/use-teams.ts +0 -39
  989. package/packages/client/src/features/workflows/CreateWorkflowDialog.tsx +0 -395
  990. package/packages/client/src/features/workflows/EditWorkflowDialog.tsx +0 -131
  991. package/packages/client/src/features/workflows/WorkflowDetailPanel.tsx +0 -503
  992. package/packages/client/src/features/workflows/WorkflowGraph.tsx +0 -108
  993. package/packages/client/src/features/workflows/WorkflowsPage.tsx +0 -277
  994. package/packages/client/src/features/workflows/use-workflows.ts +0 -27
  995. package/packages/client/src/features/workspace/WorkspacePage.tsx +0 -304
  996. package/packages/client/src/globals.css +0 -184
  997. package/packages/client/src/hooks/use-detail-param.ts +0 -31
  998. package/packages/client/src/hooks/use-file-save.ts +0 -22
  999. package/packages/client/src/hooks/use-websocket.ts +0 -38
  1000. package/packages/client/src/layout/AppShell.tsx +0 -20
  1001. package/packages/client/src/layout/Breadcrumbs.tsx +0 -52
  1002. package/packages/client/src/layout/NotificationProvider.tsx +0 -95
  1003. package/packages/client/src/layout/Sidebar.tsx +0 -176
  1004. package/packages/client/src/lib/theme.ts +0 -30
  1005. package/packages/client/src/lib/websocket-client.ts +0 -97
  1006. package/packages/client/src/main.tsx +0 -14
  1007. package/packages/client/src/shared/CommandPalette.tsx +0 -151
  1008. package/packages/client/src/shared/CsvViewer.tsx +0 -120
  1009. package/packages/client/src/shared/EmptyState.tsx +0 -20
  1010. package/packages/client/src/shared/EntityPageHeader.tsx +0 -95
  1011. package/packages/client/src/shared/FilepathLink.tsx +0 -22
  1012. package/packages/client/src/shared/Skeleton.tsx +0 -31
  1013. package/packages/client/src/shared/SlideOver.tsx +0 -63
  1014. package/packages/client/src/shared/VocabularyHelper.tsx +0 -48
  1015. package/packages/client/src/shared/diff-viewer/DiffViewer.tsx +0 -93
  1016. package/packages/client/src/shared/markdown-editor/CodeMirrorEditor.tsx +0 -199
  1017. package/packages/client/src/shared/markdown-editor/MarkdownEditor.tsx +0 -95
  1018. package/packages/client/src/stores/ui-store.ts +0 -13
  1019. package/packages/client/tsconfig.json +0 -13
  1020. package/packages/client/vite.config.ts +0 -20
  1021. package/packages/server/package.json +0 -30
  1022. package/packages/server/src/app.test.ts +0 -89
  1023. package/packages/server/src/app.ts +0 -101
  1024. package/packages/server/src/core/errors.test.ts +0 -49
  1025. package/packages/server/src/core/errors.ts +0 -62
  1026. package/packages/server/src/core/file-store.test.ts +0 -104
  1027. package/packages/server/src/core/file-store.ts +0 -209
  1028. package/packages/server/src/core/project-detector.test.ts +0 -94
  1029. package/packages/server/src/core/project-detector.ts +0 -97
  1030. package/packages/server/src/core/websocket.test.ts +0 -80
  1031. package/packages/server/src/core/websocket.ts +0 -47
  1032. package/packages/server/src/core/write-service.test.ts +0 -87
  1033. package/packages/server/src/core/write-service.ts +0 -75
  1034. package/packages/server/src/index.ts +0 -97
  1035. package/packages/server/src/parsers/agent-parser.test.ts +0 -71
  1036. package/packages/server/src/parsers/agent-parser.ts +0 -83
  1037. package/packages/server/src/parsers/config-parser.test.ts +0 -65
  1038. package/packages/server/src/parsers/config-parser.ts +0 -51
  1039. package/packages/server/src/parsers/csv-parser.test.ts +0 -53
  1040. package/packages/server/src/parsers/csv-parser.ts +0 -55
  1041. package/packages/server/src/parsers/ide-config-parser.test.ts +0 -35
  1042. package/packages/server/src/parsers/ide-config-parser.ts +0 -37
  1043. package/packages/server/src/parsers/index-builder.test.ts +0 -78
  1044. package/packages/server/src/parsers/index-builder.ts +0 -195
  1045. package/packages/server/src/parsers/package-parser.test.ts +0 -36
  1046. package/packages/server/src/parsers/package-parser.ts +0 -34
  1047. package/packages/server/src/parsers/skill-parser.test.ts +0 -51
  1048. package/packages/server/src/parsers/skill-parser.ts +0 -26
  1049. package/packages/server/src/parsers/team-parser.test.ts +0 -186
  1050. package/packages/server/src/parsers/team-parser.ts +0 -128
  1051. package/packages/server/src/parsers/workflow-parser.test.ts +0 -415
  1052. package/packages/server/src/parsers/workflow-parser.ts +0 -311
  1053. package/packages/server/src/plugins/agents-plugin.test.ts +0 -111
  1054. package/packages/server/src/plugins/agents-plugin.ts +0 -164
  1055. package/packages/server/src/plugins/files-plugin.test.ts +0 -121
  1056. package/packages/server/src/plugins/files-plugin.ts +0 -93
  1057. package/packages/server/src/plugins/modules-plugin.test.ts +0 -264
  1058. package/packages/server/src/plugins/modules-plugin.ts +0 -386
  1059. package/packages/server/src/plugins/outputs-plugin.test.ts +0 -89
  1060. package/packages/server/src/plugins/outputs-plugin.ts +0 -93
  1061. package/packages/server/src/plugins/overview-plugin.ts +0 -73
  1062. package/packages/server/src/plugins/search-plugin.ts +0 -63
  1063. package/packages/server/src/plugins/settings-plugin.test.ts +0 -82
  1064. package/packages/server/src/plugins/settings-plugin.ts +0 -46
  1065. package/packages/server/src/plugins/skills-plugin.ts +0 -87
  1066. package/packages/server/src/plugins/teams-plugin.test.ts +0 -157
  1067. package/packages/server/src/plugins/teams-plugin.ts +0 -198
  1068. package/packages/server/src/plugins/validation-plugin.test.ts +0 -229
  1069. package/packages/server/src/plugins/validation-plugin.ts +0 -116
  1070. package/packages/server/src/plugins/workflows-plugin.test.ts +0 -145
  1071. package/packages/server/src/plugins/workflows-plugin.ts +0 -270
  1072. package/packages/server/src/static.ts +0 -29
  1073. package/packages/server/tsconfig.json +0 -8
  1074. package/packages/shared/package.json +0 -20
  1075. package/packages/shared/tsconfig.json +0 -8
  1076. package/tsconfig.base.json +0 -19
  1077. package/vitest.config.ts +0 -7
@@ -0,0 +1,535 @@
1
+ var sN=t=>{throw TypeError(t)};var Vb=(t,e,n)=>e.has(t)||sN("Cannot "+n);var te=(t,e,n)=>(Vb(t,e,"read from private field"),n?n.call(t):e.get(t)),Me=(t,e,n)=>e.has(t)?sN("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),we=(t,e,n,r)=>(Vb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),tt=(t,e,n)=>(Vb(t,e,"access private method"),n);var yg=(t,e,n,r)=>({set _(i){we(t,e,i,n)},get _(){return te(t,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function mp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yb={exports:{}},xf={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var aN;function PB(){if(aN)return xf;aN=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var o in i)o!=="key"&&(s[o]=i[o])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return xf.Fragment=e,xf.jsx=n,xf.jsxs=n,xf}var lN;function _B(){return lN||(lN=1,Yb.exports=PB()),Yb.exports}var p=_B(),Ub={exports:{}},Ze={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var oN;function AB(){if(oN)return Ze;oN=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function x(z){return z===null||typeof z!="object"?null:(z=g&&z[g]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,k={};function w(z,q,M){this.props=z,this.context=q,this.refs=k,this.updater=M||v}w.prototype.isReactComponent={},w.prototype.setState=function(z,q){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,q,"setState")},w.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function j(){}j.prototype=w.prototype;function Q(z,q,M){this.props=z,this.context=q,this.refs=k,this.updater=M||v}var E=Q.prototype=new j;E.constructor=Q,b(E,w.prototype),E.isPureReactComponent=!0;var R=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function W(z,q,M){var G=M.ref;return{$$typeof:t,type:z,key:q,ref:G!==void 0?G:null,props:M}}function F(z,q){return W(z.type,q,z.props)}function Z(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function B(z){var q={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(M){return q[M]})}var H=/\/+/g;function P(z,q){return typeof z=="object"&&z!==null&&z.key!=null?B(""+z.key):q.toString(36)}function D(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(T,T):(z.status="pending",z.then(function(q){z.status==="pending"&&(z.status="fulfilled",z.value=q)},function(q){z.status==="pending"&&(z.status="rejected",z.reason=q)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function _(z,q,M,G,ie){var J=typeof z;(J==="undefined"||J==="boolean")&&(z=null);var ne=!1;if(z===null)ne=!0;else switch(J){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(z.$$typeof){case t:case e:ne=!0;break;case h:return ne=z._init,_(ne(z._payload),q,M,G,ie)}}if(ne)return ie=ie(z),ne=G===""?"."+P(z,0):G,R(ie)?(M="",ne!=null&&(M=ne.replace(H,"$&/")+"/"),_(ie,q,M,"",function(ye){return ye})):ie!=null&&(Z(ie)&&(ie=F(ie,M+(ie.key==null||z&&z.key===ie.key?"":(""+ie.key).replace(H,"$&/")+"/")+ne)),q.push(ie)),1;ne=0;var se=G===""?".":G+":";if(R(z))for(var pe=0;pe<z.length;pe++)G=z[pe],J=se+P(G,pe),ne+=_(G,q,M,J,ie);else if(pe=x(z),typeof pe=="function")for(z=pe.call(z),pe=0;!(G=z.next()).done;)G=G.value,J=se+P(G,pe++),ne+=_(G,q,M,J,ie);else if(J==="object"){if(typeof z.then=="function")return _(D(z),q,M,G,ie);throw q=String(z),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ne}function X(z,q,M){if(z==null)return z;var G=[],ie=0;return _(z,G,"","",function(J){return q.call(M,J,ie++)}),G}function Y(z){if(z._status===-1){var q=z._result;q=q(),q.then(function(M){(z._status===0||z._status===-1)&&(z._status=1,z._result=M)},function(M){(z._status===0||z._status===-1)&&(z._status=2,z._result=M)}),z._status===-1&&(z._status=0,z._result=q)}if(z._status===1)return z._result.default;throw z._result}var V=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},$={map:X,forEach:function(z,q,M){X(z,function(){q.apply(this,arguments)},M)},count:function(z){var q=0;return X(z,function(){q++}),q},toArray:function(z){return X(z,function(q){return q})||[]},only:function(z){if(!Z(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Ze.Activity=m,Ze.Children=$,Ze.Component=w,Ze.Fragment=n,Ze.Profiler=i,Ze.PureComponent=Q,Ze.StrictMode=r,Ze.Suspense=u,Ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ze.__COMPILER_RUNTIME={__proto__:null,c:function(z){return A.H.useMemoCache(z)}},Ze.cache=function(z){return function(){return z.apply(null,arguments)}},Ze.cacheSignal=function(){return null},Ze.cloneElement=function(z,q,M){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var G=b({},z.props),ie=z.key;if(q!=null)for(J in q.key!==void 0&&(ie=""+q.key),q)!I.call(q,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&q.ref===void 0||(G[J]=q[J]);var J=arguments.length-2;if(J===1)G.children=M;else if(1<J){for(var ne=Array(J),se=0;se<J;se++)ne[se]=arguments[se+2];G.children=ne}return W(z.type,ie,G)},Ze.createContext=function(z){return z={$$typeof:a,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},Ze.createElement=function(z,q,M){var G,ie={},J=null;if(q!=null)for(G in q.key!==void 0&&(J=""+q.key),q)I.call(q,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(ie[G]=q[G]);var ne=arguments.length-2;if(ne===1)ie.children=M;else if(1<ne){for(var se=Array(ne),pe=0;pe<ne;pe++)se[pe]=arguments[pe+2];ie.children=se}if(z&&z.defaultProps)for(G in ne=z.defaultProps,ne)ie[G]===void 0&&(ie[G]=ne[G]);return W(z,J,ie)},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(z){return{$$typeof:o,render:z}},Ze.isValidElement=Z,Ze.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:Y}},Ze.memo=function(z,q){return{$$typeof:d,type:z,compare:q===void 0?null:q}},Ze.startTransition=function(z){var q=A.T,M={};A.T=M;try{var G=z(),ie=A.S;ie!==null&&ie(M,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,V)}catch(J){V(J)}finally{q!==null&&M.types!==null&&(q.types=M.types),A.T=q}},Ze.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ze.use=function(z){return A.H.use(z)},Ze.useActionState=function(z,q,M){return A.H.useActionState(z,q,M)},Ze.useCallback=function(z,q){return A.H.useCallback(z,q)},Ze.useContext=function(z){return A.H.useContext(z)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(z,q){return A.H.useDeferredValue(z,q)},Ze.useEffect=function(z,q){return A.H.useEffect(z,q)},Ze.useEffectEvent=function(z){return A.H.useEffectEvent(z)},Ze.useId=function(){return A.H.useId()},Ze.useImperativeHandle=function(z,q,M){return A.H.useImperativeHandle(z,q,M)},Ze.useInsertionEffect=function(z,q){return A.H.useInsertionEffect(z,q)},Ze.useLayoutEffect=function(z,q){return A.H.useLayoutEffect(z,q)},Ze.useMemo=function(z,q){return A.H.useMemo(z,q)},Ze.useOptimistic=function(z,q){return A.H.useOptimistic(z,q)},Ze.useReducer=function(z,q,M){return A.H.useReducer(z,q,M)},Ze.useRef=function(z){return A.H.useRef(z)},Ze.useState=function(z){return A.H.useState(z)},Ze.useSyncExternalStore=function(z,q,M){return A.H.useSyncExternalStore(z,q,M)},Ze.useTransition=function(){return A.H.useTransition()},Ze.version="19.2.4",Ze}var cN;function gp(){return cN||(cN=1,Ub.exports=AB()),Ub.exports}var C=gp();const zf=mp(C);var Wb={exports:{}},vf={},Hb={exports:{}},Gb={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var uN;function RB(){return uN||(uN=1,(function(t){function e(_,X){var Y=_.length;_.push(X);e:for(;0<Y;){var V=Y-1>>>1,$=_[V];if(0<i($,X))_[V]=X,_[Y]=$,Y=V;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var X=_[0],Y=_.pop();if(Y!==X){_[0]=Y;e:for(var V=0,$=_.length,z=$>>>1;V<z;){var q=2*(V+1)-1,M=_[q],G=q+1,ie=_[G];if(0>i(M,Y))G<$&&0>i(ie,M)?(_[V]=ie,_[G]=Y,V=G):(_[V]=M,_[q]=Y,V=q);else if(G<$&&0>i(ie,Y))_[V]=ie,_[G]=Y,V=G;else break e}}return X}function i(_,X){var Y=_.sortIndex-X.sortIndex;return Y!==0?Y:_.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var u=[],d=[],h=1,m=null,g=3,x=!1,v=!1,b=!1,k=!1,w=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function E(_){for(var X=n(d);X!==null;){if(X.callback===null)r(d);else if(X.startTime<=_)r(d),X.sortIndex=X.expirationTime,e(u,X);else break;X=n(d)}}function R(_){if(b=!1,E(_),!v)if(n(u)!==null)v=!0,T||(T=!0,B());else{var X=n(d);X!==null&&D(R,X.startTime-_)}}var T=!1,A=-1,I=5,W=-1;function F(){return k?!0:!(t.unstable_now()-W<I)}function Z(){if(k=!1,T){var _=t.unstable_now();W=_;var X=!0;try{e:{v=!1,b&&(b=!1,j(A),A=-1),x=!0;var Y=g;try{t:{for(E(_),m=n(u);m!==null&&!(m.expirationTime>_&&F());){var V=m.callback;if(typeof V=="function"){m.callback=null,g=m.priorityLevel;var $=V(m.expirationTime<=_);if(_=t.unstable_now(),typeof $=="function"){m.callback=$,E(_),X=!0;break t}m===n(u)&&r(u),E(_)}else r(u);m=n(u)}if(m!==null)X=!0;else{var z=n(d);z!==null&&D(R,z.startTime-_),X=!1}}break e}finally{m=null,g=Y,x=!1}X=void 0}}finally{X?B():T=!1}}}var B;if(typeof Q=="function")B=function(){Q(Z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,P=H.port2;H.port1.onmessage=Z,B=function(){P.postMessage(null)}}else B=function(){w(Z,0)};function D(_,X){A=w(function(){_(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(_){_.callback=null},t.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(_){switch(g){case 1:case 2:case 3:var X=3;break;default:X=g}var Y=g;g=X;try{return _()}finally{g=Y}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(_,X){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var Y=g;g=_;try{return X()}finally{g=Y}},t.unstable_scheduleCallback=function(_,X,Y){var V=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?V+Y:V):Y=V,_){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Y+$,_={id:h++,callback:X,priorityLevel:_,startTime:Y,expirationTime:$,sortIndex:-1},Y>V?(_.sortIndex=Y,e(d,_),n(u)===null&&_===n(d)&&(b?(j(A),A=-1):b=!0,D(R,Y-V))):(_.sortIndex=$,e(u,_),v||x||(v=!0,T||(T=!0,B()))),_},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(_){var X=g;return function(){var Y=g;g=X;try{return _.apply(this,arguments)}finally{g=Y}}}})(Gb)),Gb}var dN;function MB(){return dN||(dN=1,Hb.exports=RB()),Hb.exports}var Fb={exports:{}},Xn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var fN;function zB(){if(fN)return Xn;fN=1;var t=gp();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(u,d,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:u,containerInfo:d,implementation:h}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Xn.createPortal=function(u,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(u,d,null,h)},Xn.flushSync=function(u){var d=a.T,h=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=d,r.p=h,r.d.f()}},Xn.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},Xn.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Xn.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var h=d.as,m=o(h,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:x}):h==="script"&&r.d.X(u,{crossOrigin:m,integrity:g,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Xn.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=o(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},Xn.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,m=o(h,d.crossOrigin);r.d.L(u,h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Xn.preloadModule=function(u,d){if(typeof u=="string")if(d){var h=o(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},Xn.requestFormReset=function(u){r.d.r(u)},Xn.unstable_batchedUpdates=function(u,d){return u(d)},Xn.useFormState=function(u,d,h){return a.H.useFormState(u,d,h)},Xn.useFormStatus=function(){return a.H.useHostTransitionStatus()},Xn.version="19.2.4",Xn}var hN;function O5(){if(hN)return Fb.exports;hN=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Fb.exports=zB(),Fb.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var pN;function DB(){if(pN)return vf;pN=1;var t=MB(),e=gp(),n=O5();function r(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function s(l){var c=l,f=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(f=c.return),l=c.return;while(l)}return c.tag===3?f:null}function a(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function o(l){if(l.tag===31){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function u(l){if(s(l)!==l)throw Error(r(188))}function d(l){var c=l.alternate;if(!c){if(c=s(l),c===null)throw Error(r(188));return c!==l?null:l}for(var f=l,O=c;;){var y=f.return;if(y===null)break;var S=y.alternate;if(S===null){if(O=y.return,O!==null){f=O;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===f)return u(y),l;if(S===O)return u(y),c;S=S.sibling}throw Error(r(188))}if(f.return!==O.return)f=y,O=S;else{for(var N=!1,L=y.child;L;){if(L===f){N=!0,f=y,O=S;break}if(L===O){N=!0,O=y,f=S;break}L=L.sibling}if(!N){for(L=S.child;L;){if(L===f){N=!0,f=S,O=y;break}if(L===O){N=!0,O=S,f=y;break}L=L.sibling}if(!N)throw Error(r(189))}}if(f.alternate!==O)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?l:c}function h(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(c=h(l),c!==null)return c;l=l.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function B(l){return l===null||typeof l!="object"?null:(l=Z&&l[Z]||l["@@iterator"],typeof l=="function"?l:null)}var H=Symbol.for("react.client.reference");function P(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===H?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case b:return"Fragment";case w:return"Profiler";case k:return"StrictMode";case R:return"Suspense";case T:return"SuspenseList";case W:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case v:return"Portal";case Q:return l.displayName||"Context";case j:return(l._context.displayName||"Context")+".Consumer";case E:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case A:return c=l.displayName||null,c!==null?c:P(l.type)||"Memo";case I:c=l._payload,l=l._init;try{return P(l(c))}catch{}}return null}var D=Array.isArray,_=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},V=[],$=-1;function z(l){return{current:l}}function q(l){0>$||(l.current=V[$],V[$]=null,$--)}function M(l,c){$++,V[$]=l.current,l.current=c}var G=z(null),ie=z(null),J=z(null),ne=z(null);function se(l,c){switch(M(J,c),M(ie,l),M(G,null),c.nodeType){case 9:case 11:l=(l=c.documentElement)&&(l=l.namespaceURI)?E$(l):0;break;default:if(l=c.tagName,c=c.namespaceURI)c=E$(c),l=$$(c,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}q(G),M(G,l)}function pe(){q(G),q(ie),q(J)}function ye(l){l.memoizedState!==null&&M(ne,l);var c=G.current,f=$$(c,l.type);c!==f&&(M(ie,l),M(G,f))}function be(l){ie.current===l&&(q(G),q(ie)),ne.current===l&&(q(ne),pf._currentValue=Y)}var Se,ke;function _e(l){if(Se===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);Se=c&&c[1]||"",ke=-1<f.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Se+l+ke}var We=!1;function De(l,c){if(!l||We)return"";We=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var O={DetermineComponentFrameRoot:function(){try{if(c){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ce){var oe=ce}Reflect.construct(l,[],he)}else{try{he.call()}catch(ce){oe=ce}l.call(he.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(he=l())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=O.DetermineComponentFrameRoot(),N=S[0],L=S[1];if(N&&L){var K=N.split(`
44
+ `),le=L.split(`
45
+ `);for(y=O=0;O<K.length&&!K[O].includes("DetermineComponentFrameRoot");)O++;for(;y<le.length&&!le[y].includes("DetermineComponentFrameRoot");)y++;if(O===K.length||y===le.length)for(O=K.length-1,y=le.length-1;1<=O&&0<=y&&K[O]!==le[y];)y--;for(;1<=O&&0<=y;O--,y--)if(K[O]!==le[y]){if(O!==1||y!==1)do if(O--,y--,0>y||K[O]!==le[y]){var de=`
46
+ `+K[O].replace(" at new "," at ");return l.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",l.displayName)),de}while(1<=O&&0<=y);break}}}finally{We=!1,Error.prepareStackTrace=f}return(f=l?l.displayName||l.name:"")?_e(f):""}function yt(l,c){switch(l.tag){case 26:case 27:case 5:return _e(l.type);case 16:return _e("Lazy");case 13:return l.child!==c&&c!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return De(l.type,!1);case 11:return De(l.type.render,!1);case 1:return De(l.type,!0);case 31:return _e("Activity");default:return""}}function Cn(l){try{var c="",f=null;do c+=yt(l,f),f=l,l=l.return;while(l);return c}catch(O){return`
47
+ Error generating stack: `+O.message+`
48
+ `+O.stack}}var Jt=Object.prototype.hasOwnProperty,jn=t.unstable_scheduleCallback,ar=t.unstable_cancelCallback,Er=t.unstable_shouldYield,Ur=t.unstable_requestPaint,en=t.unstable_now,wi=t.unstable_getCurrentPriorityLevel,ue=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,Ve=t.log,ht=t.unstable_setDisableYieldValue,kt=null,Qt=null;function qt(l){if(typeof Ve=="function"&&ht(l),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(kt,l)}catch{}}var ot=Math.clz32?Math.clz32:wd,Wr=Math.log,En=Math.LN2;function wd(l){return l>>>=0,l===0?32:31-(Wr(l)/En|0)|0}var Hr=256,ic=262144,sc=4194304;function js(l){var c=l&42;if(c!==0)return c;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function ac(l,c,f){var O=l.pendingLanes;if(O===0)return 0;var y=0,S=l.suspendedLanes,N=l.pingedLanes;l=l.warmLanes;var L=O&134217727;return L!==0?(O=L&~S,O!==0?y=js(O):(N&=L,N!==0?y=js(N):f||(f=L&~l,f!==0&&(y=js(f))))):(L=O&~S,L!==0?y=js(L):N!==0?y=js(N):f||(f=O&~l,f!==0&&(y=js(f)))),y===0?0:c!==0&&c!==y&&(c&S)===0&&(S=y&-y,f=c&-c,S>=f||S===32&&(f&4194048)!==0)?c:y}function Al(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function Av(l,c){switch(l){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fp(){var l=sc;return sc<<=1,(sc&62914560)===0&&(sc=4194304),l}function kd(l){for(var c=[],f=0;31>f;f++)c.push(l);return c}function Rl(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Rv(l,c,f,O,y,S){var N=l.pendingLanes;l.pendingLanes=f,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=f,l.entangledLanes&=f,l.errorRecoveryDisabledLanes&=f,l.shellSuspendCounter=0;var L=l.entanglements,K=l.expirationTimes,le=l.hiddenUpdates;for(f=N&~f;0<f;){var de=31-ot(f),he=1<<de;L[de]=0,K[de]=-1;var oe=le[de];if(oe!==null)for(le[de]=null,de=0;de<oe.length;de++){var ce=oe[de];ce!==null&&(ce.lane&=-536870913)}f&=~he}O!==0&&Kp(l,O,0),S!==0&&y===0&&l.tag!==0&&(l.suspendedLanes|=S&~(N&~c))}function Kp(l,c,f){l.pendingLanes|=c,l.suspendedLanes&=~c;var O=31-ot(c);l.entangledLanes|=c,l.entanglements[O]=l.entanglements[O]|1073741824|f&261930}function Jp(l,c){var f=l.entangledLanes|=c;for(l=l.entanglements;f;){var O=31-ot(f),y=1<<O;y&c|l[O]&c&&(l[O]|=c),f&=~y}}function em(l,c){var f=c&-c;return f=(f&42)!==0?1:Qd(f),(f&(l.suspendedLanes|c))!==0?0:f}function Qd(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function Cd(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function tm(){var l=X.p;return l!==0?l:(l=window.event,l===void 0?32:K$(l.type))}function nm(l,c){var f=X.p;try{return X.p=l,c()}finally{X.p=f}}var Ui=Math.random().toString(36).slice(2),On="__reactFiber$"+Ui,Ln="__reactProps$"+Ui,Es="__reactContainer$"+Ui,lc="__reactEvents$"+Ui,rm="__reactListeners$"+Ui,Mv="__reactHandles$"+Ui,im="__reactResources$"+Ui,Ml="__reactMarker$"+Ui;function jd(l){delete l[On],delete l[Ln],delete l[lc],delete l[rm],delete l[Mv]}function ka(l){var c=l[On];if(c)return c;for(var f=l.parentNode;f;){if(c=f[Es]||f[On]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(l=M$(l);l!==null;){if(f=l[On])return f;l=M$(l)}return c}l=f,f=l.parentNode}return null}function Qa(l){if(l=l[On]||l[Es]){var c=l.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return l}return null}function Ca(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l.stateNode;throw Error(r(33))}function ja(l){var c=l[im];return c||(c=l[im]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function on(l){l[Ml]=!0}var sm=new Set,am={};function $s(l,c){Ea(l,c),Ea(l+"Capture",c)}function Ea(l,c){for(am[l]=c,l=0;l<c.length;l++)sm.add(c[l])}var zv=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ed={},lm={};function Dv(l){return Jt.call(lm,l)?!0:Jt.call(Ed,l)?!1:zv.test(l)?lm[l]=!0:(Ed[l]=!0,!1)}function oc(l,c,f){if(Dv(c))if(f===null)l.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":l.removeAttribute(c);return;case"boolean":var O=c.toLowerCase().slice(0,5);if(O!=="data-"&&O!=="aria-"){l.removeAttribute(c);return}}l.setAttribute(c,""+f)}}function cc(l,c,f){if(f===null)l.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(c);return}l.setAttribute(c,""+f)}}function ki(l,c,f,O){if(O===null)l.removeAttribute(f);else{switch(typeof O){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(f);return}l.setAttributeNS(c,f,""+O)}}function lr(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function om(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Lv(l,c,f){var O=Object.getOwnPropertyDescriptor(l.constructor.prototype,c);if(!l.hasOwnProperty(c)&&typeof O<"u"&&typeof O.get=="function"&&typeof O.set=="function"){var y=O.get,S=O.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return y.call(this)},set:function(N){f=""+N,S.call(this,N)}}),Object.defineProperty(l,c,{enumerable:O.enumerable}),{getValue:function(){return f},setValue:function(N){f=""+N},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function $a(l){if(!l._valueTracker){var c=om(l)?"checked":"value";l._valueTracker=Lv(l,c,""+l[c])}}function cm(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var f=c.getValue(),O="";return l&&(O=om(l)?l.checked?"true":"false":l.value),l=O,l!==f?(c.setValue(l),!0):!1}function zl(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Xv=/[\n"\\]/g;function or(l){return l.replace(Xv,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Dl(l,c,f,O,y,S,N,L){l.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?l.type=N:l.removeAttribute("type"),c!=null?N==="number"?(c===0&&l.value===""||l.value!=c)&&(l.value=""+lr(c)):l.value!==""+lr(c)&&(l.value=""+lr(c)):N!=="submit"&&N!=="reset"||l.removeAttribute("value"),c!=null?$d(l,N,lr(c)):f!=null?$d(l,N,lr(f)):O!=null&&l.removeAttribute("value"),y==null&&S!=null&&(l.defaultChecked=!!S),y!=null&&(l.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?l.name=""+lr(L):l.removeAttribute("name")}function um(l,c,f,O,y,S,N,L){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(l.type=S),c!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||c!=null)){$a(l);return}f=f!=null?""+lr(f):"",c=c!=null?""+lr(c):f,L||c===l.value||(l.value=c),l.defaultValue=c}O=O??y,O=typeof O!="function"&&typeof O!="symbol"&&!!O,l.checked=L?l.checked:!!O,l.defaultChecked=!!O,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(l.name=N),$a(l)}function $d(l,c,f){c==="number"&&zl(l.ownerDocument)===l||l.defaultValue===""+f||(l.defaultValue=""+f)}function Ns(l,c,f,O){if(l=l.options,c){c={};for(var y=0;y<f.length;y++)c["$"+f[y]]=!0;for(f=0;f<l.length;f++)y=c.hasOwnProperty("$"+l[f].value),l[f].selected!==y&&(l[f].selected=y),y&&O&&(l[f].defaultSelected=!0)}else{for(f=""+lr(f),c=null,y=0;y<l.length;y++){if(l[y].value===f){l[y].selected=!0,O&&(l[y].defaultSelected=!0);return}c!==null||l[y].disabled||(c=l[y])}c!==null&&(c.selected=!0)}}function wC(l,c,f){if(c!=null&&(c=""+lr(c),c!==l.value&&(l.value=c),f==null)){l.defaultValue!==c&&(l.defaultValue=c);return}l.defaultValue=f!=null?""+lr(f):""}function kC(l,c,f,O){if(c==null){if(O!=null){if(f!=null)throw Error(r(92));if(D(O)){if(1<O.length)throw Error(r(93));O=O[0]}f=O}f==null&&(f=""),c=f}f=lr(c),l.defaultValue=f,O=l.textContent,O===f&&O!==""&&O!==null&&(l.value=O),$a(l)}function uc(l,c){if(c){var f=l.firstChild;if(f&&f===l.lastChild&&f.nodeType===3){f.nodeValue=c;return}}l.textContent=c}var j6=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function QC(l,c,f){var O=c.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?O?l.setProperty(c,""):c==="float"?l.cssFloat="":l[c]="":O?l.setProperty(c,f):typeof f!="number"||f===0||j6.has(c)?c==="float"?l.cssFloat=f:l[c]=(""+f).trim():l[c]=f+"px"}function CC(l,c,f){if(c!=null&&typeof c!="object")throw Error(r(62));if(l=l.style,f!=null){for(var O in f)!f.hasOwnProperty(O)||c!=null&&c.hasOwnProperty(O)||(O.indexOf("--")===0?l.setProperty(O,""):O==="float"?l.cssFloat="":l[O]="");for(var y in c)O=c[y],c.hasOwnProperty(y)&&f[y]!==O&&QC(l,y,O)}else for(var S in c)c.hasOwnProperty(S)&&QC(l,S,c[S])}function Zv(l){if(l.indexOf("-")===-1)return!1;switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var E6=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$6=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function dm(l){return $6.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function Ts(){}var Iv=null;function Bv(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var dc=null,fc=null;function jC(l){var c=Qa(l);if(c&&(l=c.stateNode)){var f=l[Ln]||null;e:switch(l=c.stateNode,c.type){case"input":if(Dl(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),c=f.name,f.type==="radio"&&c!=null){for(f=l;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+or(""+c)+'"][type="radio"]'),c=0;c<f.length;c++){var O=f[c];if(O!==l&&O.form===l.form){var y=O[Ln]||null;if(!y)throw Error(r(90));Dl(O,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(c=0;c<f.length;c++)O=f[c],O.form===l.form&&cm(O)}break e;case"textarea":wC(l,f.value,f.defaultValue);break e;case"select":c=f.value,c!=null&&Ns(l,!!f.multiple,c,!1)}}}var qv=!1;function EC(l,c,f){if(qv)return l(c,f);qv=!0;try{var O=l(c);return O}finally{if(qv=!1,(dc!==null||fc!==null)&&(Km(),dc&&(c=dc,l=fc,fc=dc=null,jC(c),l)))for(c=0;c<l.length;c++)jC(l[c])}}function Nd(l,c){var f=l.stateNode;if(f===null)return null;var O=f[Ln]||null;if(O===null)return null;f=O[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(O=!O.disabled)||(l=l.type,O=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!O;break e;default:l=!1}if(l)return null;if(f&&typeof f!="function")throw Error(r(231,c,typeof f));return f}var Ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vv=!1;if(Ps)try{var Td={};Object.defineProperty(Td,"passive",{get:function(){Vv=!0}}),window.addEventListener("test",Td,Td),window.removeEventListener("test",Td,Td)}catch{Vv=!1}var Na=null,Yv=null,fm=null;function $C(){if(fm)return fm;var l,c=Yv,f=c.length,O,y="value"in Na?Na.value:Na.textContent,S=y.length;for(l=0;l<f&&c[l]===y[l];l++);var N=f-l;for(O=1;O<=N&&c[f-O]===y[S-O];O++);return fm=y.slice(l,1<O?1-O:void 0)}function hm(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function pm(){return!0}function NC(){return!1}function cr(l){function c(f,O,y,S,N){this._reactName=f,this._targetInst=y,this.type=O,this.nativeEvent=S,this.target=N,this.currentTarget=null;for(var L in l)l.hasOwnProperty(L)&&(f=l[L],this[L]=f?f(S):S[L]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?pm:NC,this.isPropagationStopped=NC,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=pm)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=pm)},persist:function(){},isPersistent:pm}),c}var Ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mm=cr(Ll),Pd=m({},Ll,{view:0,detail:0}),N6=cr(Pd),Uv,Wv,_d,gm=m({},Pd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gv,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==_d&&(_d&&l.type==="mousemove"?(Uv=l.screenX-_d.screenX,Wv=l.screenY-_d.screenY):Wv=Uv=0,_d=l),Uv)},movementY:function(l){return"movementY"in l?l.movementY:Wv}}),TC=cr(gm),T6=m({},gm,{dataTransfer:0}),P6=cr(T6),_6=m({},Pd,{relatedTarget:0}),Hv=cr(_6),A6=m({},Ll,{animationName:0,elapsedTime:0,pseudoElement:0}),R6=cr(A6),M6=m({},Ll,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),z6=cr(M6),D6=m({},Ll,{data:0}),PC=cr(D6),L6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X6={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Z6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I6(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=Z6[l])?!!c[l]:!1}function Gv(){return I6}var B6=m({},Pd,{key:function(l){if(l.key){var c=L6[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=hm(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?X6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gv,charCode:function(l){return l.type==="keypress"?hm(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?hm(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),q6=cr(B6),V6=m({},gm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_C=cr(V6),Y6=m({},Pd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gv}),U6=cr(Y6),W6=m({},Ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),H6=cr(W6),G6=m({},gm,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),F6=cr(G6),K6=m({},Ll,{newState:0,oldState:0}),J6=cr(K6),eI=[9,13,27,32],Fv=Ps&&"CompositionEvent"in window,Ad=null;Ps&&"documentMode"in document&&(Ad=document.documentMode);var tI=Ps&&"TextEvent"in window&&!Ad,AC=Ps&&(!Fv||Ad&&8<Ad&&11>=Ad),RC=" ",MC=!1;function zC(l,c){switch(l){case"keyup":return eI.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var hc=!1;function nI(l,c){switch(l){case"compositionend":return DC(c);case"keypress":return c.which!==32?null:(MC=!0,RC);case"textInput":return l=c.data,l===RC&&MC?null:l;default:return null}}function rI(l,c){if(hc)return l==="compositionend"||!Fv&&zC(l,c)?(l=$C(),fm=Yv=Na=null,hc=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return AC&&c.locale!=="ko"?null:c.data;default:return null}}var iI={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function LC(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!iI[l.type]:c==="textarea"}function XC(l,c,f,O){dc?fc?fc.push(O):fc=[O]:dc=O,c=sg(c,"onChange"),0<c.length&&(f=new mm("onChange","change",null,f,O),l.push({event:f,listeners:c}))}var Rd=null,Md=null;function sI(l){S$(l,0)}function Om(l){var c=Ca(l);if(cm(c))return l}function ZC(l,c){if(l==="change")return c}var IC=!1;if(Ps){var Kv;if(Ps){var Jv="oninput"in document;if(!Jv){var BC=document.createElement("div");BC.setAttribute("oninput","return;"),Jv=typeof BC.oninput=="function"}Kv=Jv}else Kv=!1;IC=Kv&&(!document.documentMode||9<document.documentMode)}function qC(){Rd&&(Rd.detachEvent("onpropertychange",VC),Md=Rd=null)}function VC(l){if(l.propertyName==="value"&&Om(Md)){var c=[];XC(c,Md,l,Bv(l)),EC(sI,c)}}function aI(l,c,f){l==="focusin"?(qC(),Rd=c,Md=f,Rd.attachEvent("onpropertychange",VC)):l==="focusout"&&qC()}function lI(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Om(Md)}function oI(l,c){if(l==="click")return Om(c)}function cI(l,c){if(l==="input"||l==="change")return Om(c)}function uI(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var $r=typeof Object.is=="function"?Object.is:uI;function zd(l,c){if($r(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var f=Object.keys(l),O=Object.keys(c);if(f.length!==O.length)return!1;for(O=0;O<f.length;O++){var y=f[O];if(!Jt.call(c,y)||!$r(l[y],c[y]))return!1}return!0}function YC(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function UC(l,c){var f=YC(l);l=0;for(var O;f;){if(f.nodeType===3){if(O=l+f.textContent.length,l<=c&&O>=c)return{node:f,offset:c-l};l=O}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=YC(f)}}function WC(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?WC(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function HC(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var c=zl(l.document);c instanceof l.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)l=c.contentWindow;else break;c=zl(l.document)}return c}function ey(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}var dI=Ps&&"documentMode"in document&&11>=document.documentMode,pc=null,ty=null,Dd=null,ny=!1;function GC(l,c,f){var O=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;ny||pc==null||pc!==zl(O)||(O=pc,"selectionStart"in O&&ey(O)?O={start:O.selectionStart,end:O.selectionEnd}:(O=(O.ownerDocument&&O.ownerDocument.defaultView||window).getSelection(),O={anchorNode:O.anchorNode,anchorOffset:O.anchorOffset,focusNode:O.focusNode,focusOffset:O.focusOffset}),Dd&&zd(Dd,O)||(Dd=O,O=sg(ty,"onSelect"),0<O.length&&(c=new mm("onSelect","select",null,c,f),l.push({event:c,listeners:O}),c.target=pc)))}function Xl(l,c){var f={};return f[l.toLowerCase()]=c.toLowerCase(),f["Webkit"+l]="webkit"+c,f["Moz"+l]="moz"+c,f}var mc={animationend:Xl("Animation","AnimationEnd"),animationiteration:Xl("Animation","AnimationIteration"),animationstart:Xl("Animation","AnimationStart"),transitionrun:Xl("Transition","TransitionRun"),transitionstart:Xl("Transition","TransitionStart"),transitioncancel:Xl("Transition","TransitionCancel"),transitionend:Xl("Transition","TransitionEnd")},ry={},FC={};Ps&&(FC=document.createElement("div").style,"AnimationEvent"in window||(delete mc.animationend.animation,delete mc.animationiteration.animation,delete mc.animationstart.animation),"TransitionEvent"in window||delete mc.transitionend.transition);function Zl(l){if(ry[l])return ry[l];if(!mc[l])return l;var c=mc[l],f;for(f in c)if(c.hasOwnProperty(f)&&f in FC)return ry[l]=c[f];return l}var KC=Zl("animationend"),JC=Zl("animationiteration"),ej=Zl("animationstart"),fI=Zl("transitionrun"),hI=Zl("transitionstart"),pI=Zl("transitioncancel"),tj=Zl("transitionend"),nj=new Map,iy="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");iy.push("scrollEnd");function Qi(l,c){nj.set(l,c),$s(c,[l])}var xm=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Gr=[],gc=0,sy=0;function vm(){for(var l=gc,c=sy=gc=0;c<l;){var f=Gr[c];Gr[c++]=null;var O=Gr[c];Gr[c++]=null;var y=Gr[c];Gr[c++]=null;var S=Gr[c];if(Gr[c++]=null,O!==null&&y!==null){var N=O.pending;N===null?y.next=y:(y.next=N.next,N.next=y),O.pending=y}S!==0&&rj(f,y,S)}}function ym(l,c,f,O){Gr[gc++]=l,Gr[gc++]=c,Gr[gc++]=f,Gr[gc++]=O,sy|=O,l.lanes|=O,l=l.alternate,l!==null&&(l.lanes|=O)}function ay(l,c,f,O){return ym(l,c,f,O),bm(l)}function Il(l,c){return ym(l,null,null,c),bm(l)}function rj(l,c,f){l.lanes|=f;var O=l.alternate;O!==null&&(O.lanes|=f);for(var y=!1,S=l.return;S!==null;)S.childLanes|=f,O=S.alternate,O!==null&&(O.childLanes|=f),S.tag===22&&(l=S.stateNode,l===null||l._visibility&1||(y=!0)),l=S,S=S.return;return l.tag===3?(S=l.stateNode,y&&c!==null&&(y=31-ot(f),l=S.hiddenUpdates,O=l[y],O===null?l[y]=[c]:O.push(c),c.lane=f|536870912),S):null}function bm(l){if(50<lf)throw lf=0,mb=null,Error(r(185));for(var c=l.return;c!==null;)l=c,c=l.return;return l.tag===3?l.stateNode:null}var Oc={};function mI(l,c,f,O){this.tag=l,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=O,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nr(l,c,f,O){return new mI(l,c,f,O)}function ly(l){return l=l.prototype,!(!l||!l.isReactComponent)}function _s(l,c){var f=l.alternate;return f===null?(f=Nr(l.tag,c,l.key,l.mode),f.elementType=l.elementType,f.type=l.type,f.stateNode=l.stateNode,f.alternate=l,l.alternate=f):(f.pendingProps=c,f.type=l.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=l.flags&65011712,f.childLanes=l.childLanes,f.lanes=l.lanes,f.child=l.child,f.memoizedProps=l.memoizedProps,f.memoizedState=l.memoizedState,f.updateQueue=l.updateQueue,c=l.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=l.sibling,f.index=l.index,f.ref=l.ref,f.refCleanup=l.refCleanup,f}function ij(l,c){l.flags&=65011714;var f=l.alternate;return f===null?(l.childLanes=0,l.lanes=c,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=f.childLanes,l.lanes=f.lanes,l.child=f.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=f.memoizedProps,l.memoizedState=f.memoizedState,l.updateQueue=f.updateQueue,l.type=f.type,c=f.dependencies,l.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),l}function Sm(l,c,f,O,y,S){var N=0;if(O=l,typeof l=="function")ly(l)&&(N=1);else if(typeof l=="string")N=yB(l,f,G.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case W:return l=Nr(31,f,c,y),l.elementType=W,l.lanes=S,l;case b:return Bl(f.children,y,S,c);case k:N=8,y|=24;break;case w:return l=Nr(12,f,c,y|2),l.elementType=w,l.lanes=S,l;case R:return l=Nr(13,f,c,y),l.elementType=R,l.lanes=S,l;case T:return l=Nr(19,f,c,y),l.elementType=T,l.lanes=S,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Q:N=10;break e;case j:N=9;break e;case E:N=11;break e;case A:N=14;break e;case I:N=16,O=null;break e}N=29,f=Error(r(130,l===null?"null":typeof l,"")),O=null}return c=Nr(N,f,c,y),c.elementType=l,c.type=O,c.lanes=S,c}function Bl(l,c,f,O){return l=Nr(7,l,O,c),l.lanes=f,l}function oy(l,c,f){return l=Nr(6,l,null,c),l.lanes=f,l}function sj(l){var c=Nr(18,null,null,0);return c.stateNode=l,c}function cy(l,c,f){return c=Nr(4,l.children!==null?l.children:[],l.key,c),c.lanes=f,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}var aj=new WeakMap;function Fr(l,c){if(typeof l=="object"&&l!==null){var f=aj.get(l);return f!==void 0?f:(c={value:l,source:c,stack:Cn(c)},aj.set(l,c),c)}return{value:l,source:c,stack:Cn(c)}}var xc=[],vc=0,wm=null,Ld=0,Kr=[],Jr=0,Ta=null,Wi=1,Hi="";function As(l,c){xc[vc++]=Ld,xc[vc++]=wm,wm=l,Ld=c}function lj(l,c,f){Kr[Jr++]=Wi,Kr[Jr++]=Hi,Kr[Jr++]=Ta,Ta=l;var O=Wi;l=Hi;var y=32-ot(O)-1;O&=~(1<<y),f+=1;var S=32-ot(c)+y;if(30<S){var N=y-y%5;S=(O&(1<<N)-1).toString(32),O>>=N,y-=N,Wi=1<<32-ot(c)+y|f<<y|O,Hi=S+l}else Wi=1<<S|f<<y|O,Hi=l}function uy(l){l.return!==null&&(As(l,1),lj(l,1,0))}function dy(l){for(;l===wm;)wm=xc[--vc],xc[vc]=null,Ld=xc[--vc],xc[vc]=null;for(;l===Ta;)Ta=Kr[--Jr],Kr[Jr]=null,Hi=Kr[--Jr],Kr[Jr]=null,Wi=Kr[--Jr],Kr[Jr]=null}function oj(l,c){Kr[Jr++]=Wi,Kr[Jr++]=Hi,Kr[Jr++]=Ta,Wi=c.id,Hi=c.overflow,Ta=l}var $n=null,Dt=null,nt=!1,Pa=null,ei=!1,fy=Error(r(519));function _a(l){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xd(Fr(c,l)),fy}function cj(l){var c=l.stateNode,f=l.type,O=l.memoizedProps;switch(c[On]=l,c[Ln]=O,f){case"dialog":Fe("cancel",c),Fe("close",c);break;case"iframe":case"object":case"embed":Fe("load",c);break;case"video":case"audio":for(f=0;f<cf.length;f++)Fe(cf[f],c);break;case"source":Fe("error",c);break;case"img":case"image":case"link":Fe("error",c),Fe("load",c);break;case"details":Fe("toggle",c);break;case"input":Fe("invalid",c),um(c,O.value,O.defaultValue,O.checked,O.defaultChecked,O.type,O.name,!0);break;case"select":Fe("invalid",c);break;case"textarea":Fe("invalid",c),kC(c,O.value,O.defaultValue,O.children)}f=O.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||c.textContent===""+f||O.suppressHydrationWarning===!0||C$(c.textContent,f)?(O.popover!=null&&(Fe("beforetoggle",c),Fe("toggle",c)),O.onScroll!=null&&Fe("scroll",c),O.onScrollEnd!=null&&Fe("scrollend",c),O.onClick!=null&&(c.onclick=Ts),c=!0):c=!1,c||_a(l,!0)}function uj(l){for($n=l.return;$n;)switch($n.tag){case 5:case 31:case 13:ei=!1;return;case 27:case 3:ei=!0;return;default:$n=$n.return}}function yc(l){if(l!==$n)return!1;if(!nt)return uj(l),nt=!0,!1;var c=l.tag,f;if((f=c!==3&&c!==27)&&((f=c===5)&&(f=l.type,f=!(f!=="form"&&f!=="button")||Nb(l.type,l.memoizedProps)),f=!f),f&&Dt&&_a(l),uj(l),c===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Dt=R$(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Dt=R$(l)}else c===27?(c=Dt,Ua(l.type)?(l=Rb,Rb=null,Dt=l):Dt=c):Dt=$n?ni(l.stateNode.nextSibling):null;return!0}function ql(){Dt=$n=null,nt=!1}function hy(){var l=Pa;return l!==null&&(hr===null?hr=l:hr.push.apply(hr,l),Pa=null),l}function Xd(l){Pa===null?Pa=[l]:Pa.push(l)}var py=z(null),Vl=null,Rs=null;function Aa(l,c,f){M(py,c._currentValue),c._currentValue=f}function Ms(l){l._currentValue=py.current,q(py)}function my(l,c,f){for(;l!==null;){var O=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,O!==null&&(O.childLanes|=c)):O!==null&&(O.childLanes&c)!==c&&(O.childLanes|=c),l===f)break;l=l.return}}function gy(l,c,f,O){var y=l.child;for(y!==null&&(y.return=l);y!==null;){var S=y.dependencies;if(S!==null){var N=y.child;S=S.firstContext;e:for(;S!==null;){var L=S;S=y;for(var K=0;K<c.length;K++)if(L.context===c[K]){S.lanes|=f,L=S.alternate,L!==null&&(L.lanes|=f),my(S.return,f,l),O||(N=null);break e}S=L.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=f,S=N.alternate,S!==null&&(S.lanes|=f),my(N,f,l),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===l){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function bc(l,c,f,O){l=null;for(var y=c,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var L=y.type;$r(y.pendingProps.value,N.value)||(l!==null?l.push(L):l=[L])}}else if(y===ne.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(l!==null?l.push(pf):l=[pf])}y=y.return}l!==null&&gy(c,l,f,O),c.flags|=262144}function km(l){for(l=l.firstContext;l!==null;){if(!$r(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function Yl(l){Vl=l,Rs=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Nn(l){return dj(Vl,l)}function Qm(l,c){return Vl===null&&Yl(l),dj(l,c)}function dj(l,c){var f=c._currentValue;if(c={context:c,memoizedValue:f,next:null},Rs===null){if(l===null)throw Error(r(308));Rs=c,l.dependencies={lanes:0,firstContext:c},l.flags|=524288}else Rs=Rs.next=c;return f}var gI=typeof AbortController<"u"?AbortController:function(){var l=[],c=this.signal={aborted:!1,addEventListener:function(f,O){l.push(O)}};this.abort=function(){c.aborted=!0,l.forEach(function(f){return f()})}},OI=t.unstable_scheduleCallback,xI=t.unstable_NormalPriority,cn={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oy(){return{controller:new gI,data:new Map,refCount:0}}function Zd(l){l.refCount--,l.refCount===0&&OI(xI,function(){l.controller.abort()})}var Id=null,xy=0,Sc=0,wc=null;function vI(l,c){if(Id===null){var f=Id=[];xy=0,Sc=bb(),wc={status:"pending",value:void 0,then:function(O){f.push(O)}}}return xy++,c.then(fj,fj),c}function fj(){if(--xy===0&&Id!==null){wc!==null&&(wc.status="fulfilled");var l=Id;Id=null,Sc=0,wc=null;for(var c=0;c<l.length;c++)(0,l[c])()}}function yI(l,c){var f=[],O={status:"pending",value:null,reason:null,then:function(y){f.push(y)}};return l.then(function(){O.status="fulfilled",O.value=c;for(var y=0;y<f.length;y++)(0,f[y])(c)},function(y){for(O.status="rejected",O.reason=y,y=0;y<f.length;y++)(0,f[y])(void 0)}),O}var hj=_.S;_.S=function(l,c){GE=en(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&vI(l,c),hj!==null&&hj(l,c)};var Ul=z(null);function vy(){var l=Ul.current;return l!==null?l:Tt.pooledCache}function Cm(l,c){c===null?M(Ul,Ul.current):M(Ul,c.pool)}function pj(){var l=vy();return l===null?null:{parent:cn._currentValue,pool:l}}var kc=Error(r(460)),yy=Error(r(474)),jm=Error(r(542)),Em={then:function(){}};function mj(l){return l=l.status,l==="fulfilled"||l==="rejected"}function gj(l,c,f){switch(f=l[f],f===void 0?l.push(c):f!==c&&(c.then(Ts,Ts),c=f),c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,xj(l),l;default:if(typeof c.status=="string")c.then(Ts,Ts);else{if(l=Tt,l!==null&&100<l.shellSuspendCounter)throw Error(r(482));l=c,l.status="pending",l.then(function(O){if(c.status==="pending"){var y=c;y.status="fulfilled",y.value=O}},function(O){if(c.status==="pending"){var y=c;y.status="rejected",y.reason=O}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,xj(l),l}throw Hl=c,kc}}function Wl(l){try{var c=l._init;return c(l._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Hl=f,kc):f}}var Hl=null;function Oj(){if(Hl===null)throw Error(r(459));var l=Hl;return Hl=null,l}function xj(l){if(l===kc||l===jm)throw Error(r(483))}var Qc=null,Bd=0;function $m(l){var c=Bd;return Bd+=1,Qc===null&&(Qc=[]),gj(Qc,l,c)}function qd(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function Nm(l,c){throw c.$$typeof===g?Error(r(525)):(l=Object.prototype.toString.call(c),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l)))}function vj(l){function c(re,ee){if(l){var ae=re.deletions;ae===null?(re.deletions=[ee],re.flags|=16):ae.push(ee)}}function f(re,ee){if(!l)return null;for(;ee!==null;)c(re,ee),ee=ee.sibling;return null}function O(re){for(var ee=new Map;re!==null;)re.key!==null?ee.set(re.key,re):ee.set(re.index,re),re=re.sibling;return ee}function y(re,ee){return re=_s(re,ee),re.index=0,re.sibling=null,re}function S(re,ee,ae){return re.index=ae,l?(ae=re.alternate,ae!==null?(ae=ae.index,ae<ee?(re.flags|=67108866,ee):ae):(re.flags|=67108866,ee)):(re.flags|=1048576,ee)}function N(re){return l&&re.alternate===null&&(re.flags|=67108866),re}function L(re,ee,ae,fe){return ee===null||ee.tag!==6?(ee=oy(ae,re.mode,fe),ee.return=re,ee):(ee=y(ee,ae),ee.return=re,ee)}function K(re,ee,ae,fe){var Ne=ae.type;return Ne===b?de(re,ee,ae.props.children,fe,ae.key):ee!==null&&(ee.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===I&&Wl(Ne)===ee.type)?(ee=y(ee,ae.props),qd(ee,ae),ee.return=re,ee):(ee=Sm(ae.type,ae.key,ae.props,null,re.mode,fe),qd(ee,ae),ee.return=re,ee)}function le(re,ee,ae,fe){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ae.containerInfo||ee.stateNode.implementation!==ae.implementation?(ee=cy(ae,re.mode,fe),ee.return=re,ee):(ee=y(ee,ae.children||[]),ee.return=re,ee)}function de(re,ee,ae,fe,Ne){return ee===null||ee.tag!==7?(ee=Bl(ae,re.mode,fe,Ne),ee.return=re,ee):(ee=y(ee,ae),ee.return=re,ee)}function he(re,ee,ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=oy(""+ee,re.mode,ae),ee.return=re,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:return ae=Sm(ee.type,ee.key,ee.props,null,re.mode,ae),qd(ae,ee),ae.return=re,ae;case v:return ee=cy(ee,re.mode,ae),ee.return=re,ee;case I:return ee=Wl(ee),he(re,ee,ae)}if(D(ee)||B(ee))return ee=Bl(ee,re.mode,ae,null),ee.return=re,ee;if(typeof ee.then=="function")return he(re,$m(ee),ae);if(ee.$$typeof===Q)return he(re,Qm(re,ee),ae);Nm(re,ee)}return null}function oe(re,ee,ae,fe){var Ne=ee!==null?ee.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Ne!==null?null:L(re,ee,""+ae,fe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return ae.key===Ne?K(re,ee,ae,fe):null;case v:return ae.key===Ne?le(re,ee,ae,fe):null;case I:return ae=Wl(ae),oe(re,ee,ae,fe)}if(D(ae)||B(ae))return Ne!==null?null:de(re,ee,ae,fe,null);if(typeof ae.then=="function")return oe(re,ee,$m(ae),fe);if(ae.$$typeof===Q)return oe(re,ee,Qm(re,ae),fe);Nm(re,ae)}return null}function ce(re,ee,ae,fe,Ne){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return re=re.get(ae)||null,L(ee,re,""+fe,Ne);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return re=re.get(fe.key===null?ae:fe.key)||null,K(ee,re,fe,Ne);case v:return re=re.get(fe.key===null?ae:fe.key)||null,le(ee,re,fe,Ne);case I:return fe=Wl(fe),ce(re,ee,ae,fe,Ne)}if(D(fe)||B(fe))return re=re.get(ae)||null,de(ee,re,fe,Ne,null);if(typeof fe.then=="function")return ce(re,ee,ae,$m(fe),Ne);if(fe.$$typeof===Q)return ce(re,ee,ae,Qm(ee,fe),Ne);Nm(ee,fe)}return null}function Ce(re,ee,ae,fe){for(var Ne=null,ct=null,je=ee,Ye=ee=0,et=null;je!==null&&Ye<ae.length;Ye++){je.index>Ye?(et=je,je=null):et=je.sibling;var ut=oe(re,je,ae[Ye],fe);if(ut===null){je===null&&(je=et);break}l&&je&&ut.alternate===null&&c(re,je),ee=S(ut,ee,Ye),ct===null?Ne=ut:ct.sibling=ut,ct=ut,je=et}if(Ye===ae.length)return f(re,je),nt&&As(re,Ye),Ne;if(je===null){for(;Ye<ae.length;Ye++)je=he(re,ae[Ye],fe),je!==null&&(ee=S(je,ee,Ye),ct===null?Ne=je:ct.sibling=je,ct=je);return nt&&As(re,Ye),Ne}for(je=O(je);Ye<ae.length;Ye++)et=ce(je,re,Ye,ae[Ye],fe),et!==null&&(l&&et.alternate!==null&&je.delete(et.key===null?Ye:et.key),ee=S(et,ee,Ye),ct===null?Ne=et:ct.sibling=et,ct=et);return l&&je.forEach(function(Ka){return c(re,Ka)}),nt&&As(re,Ye),Ne}function Re(re,ee,ae,fe){if(ae==null)throw Error(r(151));for(var Ne=null,ct=null,je=ee,Ye=ee=0,et=null,ut=ae.next();je!==null&&!ut.done;Ye++,ut=ae.next()){je.index>Ye?(et=je,je=null):et=je.sibling;var Ka=oe(re,je,ut.value,fe);if(Ka===null){je===null&&(je=et);break}l&&je&&Ka.alternate===null&&c(re,je),ee=S(Ka,ee,Ye),ct===null?Ne=Ka:ct.sibling=Ka,ct=Ka,je=et}if(ut.done)return f(re,je),nt&&As(re,Ye),Ne;if(je===null){for(;!ut.done;Ye++,ut=ae.next())ut=he(re,ut.value,fe),ut!==null&&(ee=S(ut,ee,Ye),ct===null?Ne=ut:ct.sibling=ut,ct=ut);return nt&&As(re,Ye),Ne}for(je=O(je);!ut.done;Ye++,ut=ae.next())ut=ce(je,re,Ye,ut.value,fe),ut!==null&&(l&&ut.alternate!==null&&je.delete(ut.key===null?Ye:ut.key),ee=S(ut,ee,Ye),ct===null?Ne=ut:ct.sibling=ut,ct=ut);return l&&je.forEach(function(TB){return c(re,TB)}),nt&&As(re,Ye),Ne}function Et(re,ee,ae,fe){if(typeof ae=="object"&&ae!==null&&ae.type===b&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:e:{for(var Ne=ae.key;ee!==null;){if(ee.key===Ne){if(Ne=ae.type,Ne===b){if(ee.tag===7){f(re,ee.sibling),fe=y(ee,ae.props.children),fe.return=re,re=fe;break e}}else if(ee.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===I&&Wl(Ne)===ee.type){f(re,ee.sibling),fe=y(ee,ae.props),qd(fe,ae),fe.return=re,re=fe;break e}f(re,ee);break}else c(re,ee);ee=ee.sibling}ae.type===b?(fe=Bl(ae.props.children,re.mode,fe,ae.key),fe.return=re,re=fe):(fe=Sm(ae.type,ae.key,ae.props,null,re.mode,fe),qd(fe,ae),fe.return=re,re=fe)}return N(re);case v:e:{for(Ne=ae.key;ee!==null;){if(ee.key===Ne)if(ee.tag===4&&ee.stateNode.containerInfo===ae.containerInfo&&ee.stateNode.implementation===ae.implementation){f(re,ee.sibling),fe=y(ee,ae.children||[]),fe.return=re,re=fe;break e}else{f(re,ee);break}else c(re,ee);ee=ee.sibling}fe=cy(ae,re.mode,fe),fe.return=re,re=fe}return N(re);case I:return ae=Wl(ae),Et(re,ee,ae,fe)}if(D(ae))return Ce(re,ee,ae,fe);if(B(ae)){if(Ne=B(ae),typeof Ne!="function")throw Error(r(150));return ae=Ne.call(ae),Re(re,ee,ae,fe)}if(typeof ae.then=="function")return Et(re,ee,$m(ae),fe);if(ae.$$typeof===Q)return Et(re,ee,Qm(re,ae),fe);Nm(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,ee!==null&&ee.tag===6?(f(re,ee.sibling),fe=y(ee,ae),fe.return=re,re=fe):(f(re,ee),fe=oy(ae,re.mode,fe),fe.return=re,re=fe),N(re)):f(re,ee)}return function(re,ee,ae,fe){try{Bd=0;var Ne=Et(re,ee,ae,fe);return Qc=null,Ne}catch(je){if(je===kc||je===jm)throw je;var ct=Nr(29,je,null,re.mode);return ct.lanes=fe,ct.return=re,ct}finally{}}}var Gl=vj(!0),yj=vj(!1),Ra=!1;function by(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sy(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Ma(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function za(l,c,f){var O=l.updateQueue;if(O===null)return null;if(O=O.shared,(pt&2)!==0){var y=O.pending;return y===null?c.next=c:(c.next=y.next,y.next=c),O.pending=c,c=bm(l),rj(l,null,f),c}return ym(l,O,c,f),bm(l)}function Vd(l,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var O=c.lanes;O&=l.pendingLanes,f|=O,c.lanes=f,Jp(l,f)}}function wy(l,c){var f=l.updateQueue,O=l.alternate;if(O!==null&&(O=O.updateQueue,f===O)){var y=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var N={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?y=S=N:S=S.next=N,f=f.next}while(f!==null);S===null?y=S=c:S=S.next=c}else y=S=c;f={baseState:O.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:O.shared,callbacks:O.callbacks},l.updateQueue=f;return}l=f.lastBaseUpdate,l===null?f.firstBaseUpdate=c:l.next=c,f.lastBaseUpdate=c}var ky=!1;function Yd(){if(ky){var l=wc;if(l!==null)throw l}}function Ud(l,c,f,O){ky=!1;var y=l.updateQueue;Ra=!1;var S=y.firstBaseUpdate,N=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var K=L,le=K.next;K.next=null,N===null?S=le:N.next=le,N=K;var de=l.alternate;de!==null&&(de=de.updateQueue,L=de.lastBaseUpdate,L!==N&&(L===null?de.firstBaseUpdate=le:L.next=le,de.lastBaseUpdate=K))}if(S!==null){var he=y.baseState;N=0,de=le=K=null,L=S;do{var oe=L.lane&-536870913,ce=oe!==L.lane;if(ce?(Je&oe)===oe:(O&oe)===oe){oe!==0&&oe===Sc&&(ky=!0),de!==null&&(de=de.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ce=l,Re=L;oe=c;var Et=f;switch(Re.tag){case 1:if(Ce=Re.payload,typeof Ce=="function"){he=Ce.call(Et,he,oe);break e}he=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Re.payload,oe=typeof Ce=="function"?Ce.call(Et,he,oe):Ce,oe==null)break e;he=m({},he,oe);break e;case 2:Ra=!0}}oe=L.callback,oe!==null&&(l.flags|=64,ce&&(l.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:L.tag,payload:L.payload,callback:L.callback,next:null},de===null?(le=de=ce,K=he):de=de.next=ce,N|=oe;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;ce=L,L=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);de===null&&(K=he),y.baseState=K,y.firstBaseUpdate=le,y.lastBaseUpdate=de,S===null&&(y.shared.lanes=0),Ia|=N,l.lanes=N,l.memoizedState=he}}function bj(l,c){if(typeof l!="function")throw Error(r(191,l));l.call(c)}function Sj(l,c){var f=l.callbacks;if(f!==null)for(l.callbacks=null,l=0;l<f.length;l++)bj(f[l],c)}var Cc=z(null),Tm=z(0);function wj(l,c){l=Vs,M(Tm,l),M(Cc,c),Vs=l|c.baseLanes}function Qy(){M(Tm,Vs),M(Cc,Cc.current)}function Cy(){Vs=Tm.current,q(Cc),q(Tm)}var Tr=z(null),ti=null;function Da(l){var c=l.alternate;M(tn,tn.current&1),M(Tr,l),ti===null&&(c===null||Cc.current!==null||c.memoizedState!==null)&&(ti=l)}function jy(l){M(tn,tn.current),M(Tr,l),ti===null&&(ti=l)}function kj(l){l.tag===22?(M(tn,tn.current),M(Tr,l),ti===null&&(ti=l)):La()}function La(){M(tn,tn.current),M(Tr,Tr.current)}function Pr(l){q(Tr),ti===l&&(ti=null),q(tn)}var tn=z(0);function Pm(l){for(var c=l;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||_b(f)||Ab(f)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var zs=0,Be=null,Ct=null,un=null,_m=!1,jc=!1,Fl=!1,Am=0,Wd=0,Ec=null,bI=0;function Yt(){throw Error(r(321))}function Ey(l,c){if(c===null)return!1;for(var f=0;f<c.length&&f<l.length;f++)if(!$r(l[f],c[f]))return!1;return!0}function $y(l,c,f,O,y,S){return zs=S,Be=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,_.H=l===null||l.memoizedState===null?lE:qy,Fl=!1,S=f(O,y),Fl=!1,jc&&(S=Cj(c,f,O,y)),Qj(l),S}function Qj(l){_.H=Fd;var c=Ct!==null&&Ct.next!==null;if(zs=0,un=Ct=Be=null,_m=!1,Wd=0,Ec=null,c)throw Error(r(300));l===null||dn||(l=l.dependencies,l!==null&&km(l)&&(dn=!0))}function Cj(l,c,f,O){Be=l;var y=0;do{if(jc&&(Ec=null),Wd=0,jc=!1,25<=y)throw Error(r(301));if(y+=1,un=Ct=null,l.updateQueue!=null){var S=l.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}_.H=oE,S=c(f,O)}while(jc);return S}function SI(){var l=_.H,c=l.useState()[0];return c=typeof c.then=="function"?Hd(c):c,l=l.useState()[0],(Ct!==null?Ct.memoizedState:null)!==l&&(Be.flags|=1024),c}function Ny(){var l=Am!==0;return Am=0,l}function Ty(l,c,f){c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~f}function Py(l){if(_m){for(l=l.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}_m=!1}zs=0,un=Ct=Be=null,jc=!1,Wd=Am=0,Ec=null}function Hn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Be.memoizedState=un=l:un=un.next=l,un}function nn(){if(Ct===null){var l=Be.alternate;l=l!==null?l.memoizedState:null}else l=Ct.next;var c=un===null?Be.memoizedState:un.next;if(c!==null)un=c,Ct=l;else{if(l===null)throw Be.alternate===null?Error(r(467)):Error(r(310));Ct=l,l={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},un===null?Be.memoizedState=un=l:un=un.next=l}return un}function Rm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hd(l){var c=Wd;return Wd+=1,Ec===null&&(Ec=[]),l=gj(Ec,l,c),c=Be,(un===null?c.memoizedState:un.next)===null&&(c=c.alternate,_.H=c===null||c.memoizedState===null?lE:qy),l}function Mm(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return Hd(l);if(l.$$typeof===Q)return Nn(l)}throw Error(r(438,String(l)))}function _y(l){var c=null,f=Be.updateQueue;if(f!==null&&(c=f.memoCache),c==null){var O=Be.alternate;O!==null&&(O=O.updateQueue,O!==null&&(O=O.memoCache,O!=null&&(c={data:O.data.map(function(y){return y.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),f===null&&(f=Rm(),Be.updateQueue=f),f.memoCache=c,f=c.data[c.index],f===void 0)for(f=c.data[c.index]=Array(l),O=0;O<l;O++)f[O]=F;return c.index++,f}function Ds(l,c){return typeof c=="function"?c(l):c}function zm(l){var c=nn();return Ay(c,Ct,l)}function Ay(l,c,f){var O=l.queue;if(O===null)throw Error(r(311));O.lastRenderedReducer=f;var y=l.baseQueue,S=O.pending;if(S!==null){if(y!==null){var N=y.next;y.next=S.next,S.next=N}c.baseQueue=y=S,O.pending=null}if(S=l.baseState,y===null)l.memoizedState=S;else{c=y.next;var L=N=null,K=null,le=c,de=!1;do{var he=le.lane&-536870913;if(he!==le.lane?(Je&he)===he:(zs&he)===he){var oe=le.revertLane;if(oe===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),he===Sc&&(de=!0);else if((zs&oe)===oe){le=le.next,oe===Sc&&(de=!0);continue}else he={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},K===null?(L=K=he,N=S):K=K.next=he,Be.lanes|=oe,Ia|=oe;he=le.action,Fl&&f(S,he),S=le.hasEagerState?le.eagerState:f(S,he)}else oe={lane:he,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},K===null?(L=K=oe,N=S):K=K.next=oe,Be.lanes|=he,Ia|=he;le=le.next}while(le!==null&&le!==c);if(K===null?N=S:K.next=L,!$r(S,l.memoizedState)&&(dn=!0,de&&(f=wc,f!==null)))throw f;l.memoizedState=S,l.baseState=N,l.baseQueue=K,O.lastRenderedState=S}return y===null&&(O.lanes=0),[l.memoizedState,O.dispatch]}function Ry(l){var c=nn(),f=c.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=l;var O=f.dispatch,y=f.pending,S=c.memoizedState;if(y!==null){f.pending=null;var N=y=y.next;do S=l(S,N.action),N=N.next;while(N!==y);$r(S,c.memoizedState)||(dn=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),f.lastRenderedState=S}return[S,O]}function jj(l,c,f){var O=Be,y=nn(),S=nt;if(S){if(f===void 0)throw Error(r(407));f=f()}else f=c();var N=!$r((Ct||y).memoizedState,f);if(N&&(y.memoizedState=f,dn=!0),y=y.queue,Dy(Nj.bind(null,O,y,l),[l]),y.getSnapshot!==c||N||un!==null&&un.memoizedState.tag&1){if(O.flags|=2048,$c(9,{destroy:void 0},$j.bind(null,O,y,f,c),null),Tt===null)throw Error(r(349));S||(zs&127)!==0||Ej(O,c,f)}return f}function Ej(l,c,f){l.flags|=16384,l={getSnapshot:c,value:f},c=Be.updateQueue,c===null?(c=Rm(),Be.updateQueue=c,c.stores=[l]):(f=c.stores,f===null?c.stores=[l]:f.push(l))}function $j(l,c,f,O){c.value=f,c.getSnapshot=O,Tj(c)&&Pj(l)}function Nj(l,c,f){return f(function(){Tj(c)&&Pj(l)})}function Tj(l){var c=l.getSnapshot;l=l.value;try{var f=c();return!$r(l,f)}catch{return!0}}function Pj(l){var c=Il(l,2);c!==null&&pr(c,l,2)}function My(l){var c=Hn();if(typeof l=="function"){var f=l;if(l=f(),Fl){qt(!0);try{f()}finally{qt(!1)}}}return c.memoizedState=c.baseState=l,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:l},c}function _j(l,c,f,O){return l.baseState=f,Ay(l,Ct,typeof O=="function"?O:Ds)}function wI(l,c,f,O,y){if(Xm(l))throw Error(r(485));if(l=c.action,l!==null){var S={payload:y,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){S.listeners.push(N)}};_.T!==null?f(!0):S.isTransition=!1,O(S),f=c.pending,f===null?(S.next=c.pending=S,Aj(c,S)):(S.next=f.next,c.pending=f.next=S)}}function Aj(l,c){var f=c.action,O=c.payload,y=l.state;if(c.isTransition){var S=_.T,N={};_.T=N;try{var L=f(y,O),K=_.S;K!==null&&K(N,L),Rj(l,c,L)}catch(le){zy(l,c,le)}finally{S!==null&&N.types!==null&&(S.types=N.types),_.T=S}}else try{S=f(y,O),Rj(l,c,S)}catch(le){zy(l,c,le)}}function Rj(l,c,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(O){Mj(l,c,O)},function(O){return zy(l,c,O)}):Mj(l,c,f)}function Mj(l,c,f){c.status="fulfilled",c.value=f,zj(c),l.state=f,c=l.pending,c!==null&&(f=c.next,f===c?l.pending=null:(f=f.next,c.next=f,Aj(l,f)))}function zy(l,c,f){var O=l.pending;if(l.pending=null,O!==null){O=O.next;do c.status="rejected",c.reason=f,zj(c),c=c.next;while(c!==O)}l.action=null}function zj(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function Dj(l,c){return c}function Lj(l,c){if(nt){var f=Tt.formState;if(f!==null){e:{var O=Be;if(nt){if(Dt){t:{for(var y=Dt,S=ei;y.nodeType!==8;){if(!S){y=null;break t}if(y=ni(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){Dt=ni(y.nextSibling),O=y.data==="F!";break e}}_a(O)}O=!1}O&&(c=f[0])}}return f=Hn(),f.memoizedState=f.baseState=c,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dj,lastRenderedState:c},f.queue=O,f=iE.bind(null,Be,O),O.dispatch=f,O=My(!1),S=By.bind(null,Be,!1,O.queue),O=Hn(),y={state:c,dispatch:null,action:l,pending:null},O.queue=y,f=wI.bind(null,Be,y,S,f),y.dispatch=f,O.memoizedState=l,[c,f,!1]}function Xj(l){var c=nn();return Zj(c,Ct,l)}function Zj(l,c,f){if(c=Ay(l,c,Dj)[0],l=zm(Ds)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var O=Hd(c)}catch(N){throw N===kc?jm:N}else O=c;c=nn();var y=c.queue,S=y.dispatch;return f!==c.memoizedState&&(Be.flags|=2048,$c(9,{destroy:void 0},kI.bind(null,y,f),null)),[O,S,l]}function kI(l,c){l.action=c}function Ij(l){var c=nn(),f=Ct;if(f!==null)return Zj(c,f,l);nn(),c=c.memoizedState,f=nn();var O=f.queue.dispatch;return f.memoizedState=l,[c,O,!1]}function $c(l,c,f,O){return l={tag:l,create:f,deps:O,inst:c,next:null},c=Be.updateQueue,c===null&&(c=Rm(),Be.updateQueue=c),f=c.lastEffect,f===null?c.lastEffect=l.next=l:(O=f.next,f.next=l,l.next=O,c.lastEffect=l),l}function Bj(){return nn().memoizedState}function Dm(l,c,f,O){var y=Hn();Be.flags|=l,y.memoizedState=$c(1|c,{destroy:void 0},f,O===void 0?null:O)}function Lm(l,c,f,O){var y=nn();O=O===void 0?null:O;var S=y.memoizedState.inst;Ct!==null&&O!==null&&Ey(O,Ct.memoizedState.deps)?y.memoizedState=$c(c,S,f,O):(Be.flags|=l,y.memoizedState=$c(1|c,S,f,O))}function qj(l,c){Dm(8390656,8,l,c)}function Dy(l,c){Lm(2048,8,l,c)}function QI(l){Be.flags|=4;var c=Be.updateQueue;if(c===null)c=Rm(),Be.updateQueue=c,c.events=[l];else{var f=c.events;f===null?c.events=[l]:f.push(l)}}function Vj(l){var c=nn().memoizedState;return QI({ref:c,nextImpl:l}),function(){if((pt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function Yj(l,c){return Lm(4,2,l,c)}function Uj(l,c){return Lm(4,4,l,c)}function Wj(l,c){if(typeof c=="function"){l=l();var f=c(l);return function(){typeof f=="function"?f():c(null)}}if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function Hj(l,c,f){f=f!=null?f.concat([l]):null,Lm(4,4,Wj.bind(null,c,l),f)}function Ly(){}function Gj(l,c){var f=nn();c=c===void 0?null:c;var O=f.memoizedState;return c!==null&&Ey(c,O[1])?O[0]:(f.memoizedState=[l,c],l)}function Fj(l,c){var f=nn();c=c===void 0?null:c;var O=f.memoizedState;if(c!==null&&Ey(c,O[1]))return O[0];if(O=l(),Fl){qt(!0);try{l()}finally{qt(!1)}}return f.memoizedState=[O,c],O}function Xy(l,c,f){return f===void 0||(zs&1073741824)!==0&&(Je&261930)===0?l.memoizedState=c:(l.memoizedState=f,l=KE(),Be.lanes|=l,Ia|=l,f)}function Kj(l,c,f,O){return $r(f,c)?f:Cc.current!==null?(l=Xy(l,f,O),$r(l,c)||(dn=!0),l):(zs&42)===0||(zs&1073741824)!==0&&(Je&261930)===0?(dn=!0,l.memoizedState=f):(l=KE(),Be.lanes|=l,Ia|=l,c)}function Jj(l,c,f,O,y){var S=X.p;X.p=S!==0&&8>S?S:8;var N=_.T,L={};_.T=L,By(l,!1,c,f);try{var K=y(),le=_.S;if(le!==null&&le(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var de=yI(K,O);Gd(l,c,de,Rr(l))}else Gd(l,c,O,Rr(l))}catch(he){Gd(l,c,{then:function(){},status:"rejected",reason:he},Rr())}finally{X.p=S,N!==null&&L.types!==null&&(N.types=L.types),_.T=N}}function CI(){}function Zy(l,c,f,O){if(l.tag!==5)throw Error(r(476));var y=eE(l).queue;Jj(l,y,c,Y,f===null?CI:function(){return tE(l),f(O)})}function eE(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:Y},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:f},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function tE(l){var c=eE(l);c.next===null&&(c=l.alternate.memoizedState),Gd(l,c.next.queue,{},Rr())}function Iy(){return Nn(pf)}function nE(){return nn().memoizedState}function rE(){return nn().memoizedState}function jI(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var f=Rr();l=Ma(f);var O=za(c,l,f);O!==null&&(pr(O,c,f),Vd(O,c,f)),c={cache:Oy()},l.payload=c;return}c=c.return}}function EI(l,c,f){var O=Rr();f={lane:O,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Xm(l)?sE(c,f):(f=ay(l,c,f,O),f!==null&&(pr(f,l,O),aE(f,c,O)))}function iE(l,c,f){var O=Rr();Gd(l,c,f,O)}function Gd(l,c,f,O){var y={lane:O,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Xm(l))sE(c,y);else{var S=l.alternate;if(l.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var N=c.lastRenderedState,L=S(N,f);if(y.hasEagerState=!0,y.eagerState=L,$r(L,N))return ym(l,c,y,0),Tt===null&&vm(),!1}catch{}finally{}if(f=ay(l,c,y,O),f!==null)return pr(f,l,O),aE(f,c,O),!0}return!1}function By(l,c,f,O){if(O={lane:2,revertLane:bb(),gesture:null,action:O,hasEagerState:!1,eagerState:null,next:null},Xm(l)){if(c)throw Error(r(479))}else c=ay(l,f,O,2),c!==null&&pr(c,l,2)}function Xm(l){var c=l.alternate;return l===Be||c!==null&&c===Be}function sE(l,c){jc=_m=!0;var f=l.pending;f===null?c.next=c:(c.next=f.next,f.next=c),l.pending=c}function aE(l,c,f){if((f&4194048)!==0){var O=c.lanes;O&=l.pendingLanes,f|=O,c.lanes=f,Jp(l,f)}}var Fd={readContext:Nn,use:Mm,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};Fd.useEffectEvent=Yt;var lE={readContext:Nn,use:Mm,useCallback:function(l,c){return Hn().memoizedState=[l,c===void 0?null:c],l},useContext:Nn,useEffect:qj,useImperativeHandle:function(l,c,f){f=f!=null?f.concat([l]):null,Dm(4194308,4,Wj.bind(null,c,l),f)},useLayoutEffect:function(l,c){return Dm(4194308,4,l,c)},useInsertionEffect:function(l,c){Dm(4,2,l,c)},useMemo:function(l,c){var f=Hn();c=c===void 0?null:c;var O=l();if(Fl){qt(!0);try{l()}finally{qt(!1)}}return f.memoizedState=[O,c],O},useReducer:function(l,c,f){var O=Hn();if(f!==void 0){var y=f(c);if(Fl){qt(!0);try{f(c)}finally{qt(!1)}}}else y=c;return O.memoizedState=O.baseState=y,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:y},O.queue=l,l=l.dispatch=EI.bind(null,Be,l),[O.memoizedState,l]},useRef:function(l){var c=Hn();return l={current:l},c.memoizedState=l},useState:function(l){l=My(l);var c=l.queue,f=iE.bind(null,Be,c);return c.dispatch=f,[l.memoizedState,f]},useDebugValue:Ly,useDeferredValue:function(l,c){var f=Hn();return Xy(f,l,c)},useTransition:function(){var l=My(!1);return l=Jj.bind(null,Be,l.queue,!0,!1),Hn().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,f){var O=Be,y=Hn();if(nt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),Tt===null)throw Error(r(349));(Je&127)!==0||Ej(O,c,f)}y.memoizedState=f;var S={value:f,getSnapshot:c};return y.queue=S,qj(Nj.bind(null,O,S,l),[l]),O.flags|=2048,$c(9,{destroy:void 0},$j.bind(null,O,S,f,c),null),f},useId:function(){var l=Hn(),c=Tt.identifierPrefix;if(nt){var f=Hi,O=Wi;f=(O&~(1<<32-ot(O)-1)).toString(32)+f,c="_"+c+"R_"+f,f=Am++,0<f&&(c+="H"+f.toString(32)),c+="_"}else f=bI++,c="_"+c+"r_"+f.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:Iy,useFormState:Lj,useActionState:Lj,useOptimistic:function(l){var c=Hn();c.memoizedState=c.baseState=l;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=f,c=By.bind(null,Be,!0,f),f.dispatch=c,[l,c]},useMemoCache:_y,useCacheRefresh:function(){return Hn().memoizedState=jI.bind(null,Be)},useEffectEvent:function(l){var c=Hn(),f={impl:l};return c.memoizedState=f,function(){if((pt&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},qy={readContext:Nn,use:Mm,useCallback:Gj,useContext:Nn,useEffect:Dy,useImperativeHandle:Hj,useInsertionEffect:Yj,useLayoutEffect:Uj,useMemo:Fj,useReducer:zm,useRef:Bj,useState:function(){return zm(Ds)},useDebugValue:Ly,useDeferredValue:function(l,c){var f=nn();return Kj(f,Ct.memoizedState,l,c)},useTransition:function(){var l=zm(Ds)[0],c=nn().memoizedState;return[typeof l=="boolean"?l:Hd(l),c]},useSyncExternalStore:jj,useId:nE,useHostTransitionStatus:Iy,useFormState:Xj,useActionState:Xj,useOptimistic:function(l,c){var f=nn();return _j(f,Ct,l,c)},useMemoCache:_y,useCacheRefresh:rE};qy.useEffectEvent=Vj;var oE={readContext:Nn,use:Mm,useCallback:Gj,useContext:Nn,useEffect:Dy,useImperativeHandle:Hj,useInsertionEffect:Yj,useLayoutEffect:Uj,useMemo:Fj,useReducer:Ry,useRef:Bj,useState:function(){return Ry(Ds)},useDebugValue:Ly,useDeferredValue:function(l,c){var f=nn();return Ct===null?Xy(f,l,c):Kj(f,Ct.memoizedState,l,c)},useTransition:function(){var l=Ry(Ds)[0],c=nn().memoizedState;return[typeof l=="boolean"?l:Hd(l),c]},useSyncExternalStore:jj,useId:nE,useHostTransitionStatus:Iy,useFormState:Ij,useActionState:Ij,useOptimistic:function(l,c){var f=nn();return Ct!==null?_j(f,Ct,l,c):(f.baseState=l,[l,f.queue.dispatch])},useMemoCache:_y,useCacheRefresh:rE};oE.useEffectEvent=Vj;function Vy(l,c,f,O){c=l.memoizedState,f=f(O,c),f=f==null?c:m({},c,f),l.memoizedState=f,l.lanes===0&&(l.updateQueue.baseState=f)}var Yy={enqueueSetState:function(l,c,f){l=l._reactInternals;var O=Rr(),y=Ma(O);y.payload=c,f!=null&&(y.callback=f),c=za(l,y,O),c!==null&&(pr(c,l,O),Vd(c,l,O))},enqueueReplaceState:function(l,c,f){l=l._reactInternals;var O=Rr(),y=Ma(O);y.tag=1,y.payload=c,f!=null&&(y.callback=f),c=za(l,y,O),c!==null&&(pr(c,l,O),Vd(c,l,O))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var f=Rr(),O=Ma(f);O.tag=2,c!=null&&(O.callback=c),c=za(l,O,f),c!==null&&(pr(c,l,f),Vd(c,l,f))}};function cE(l,c,f,O,y,S,N){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(O,S,N):c.prototype&&c.prototype.isPureReactComponent?!zd(f,O)||!zd(y,S):!0}function uE(l,c,f,O){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,O),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,O),c.state!==l&&Yy.enqueueReplaceState(c,c.state,null)}function Kl(l,c){var f=c;if("ref"in c){f={};for(var O in c)O!=="ref"&&(f[O]=c[O])}if(l=l.defaultProps){f===c&&(f=m({},f));for(var y in l)f[y]===void 0&&(f[y]=l[y])}return f}function dE(l){xm(l)}function fE(l){console.error(l)}function hE(l){xm(l)}function Zm(l,c){try{var f=l.onUncaughtError;f(c.value,{componentStack:c.stack})}catch(O){setTimeout(function(){throw O})}}function pE(l,c,f){try{var O=l.onCaughtError;O(f.value,{componentStack:f.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Uy(l,c,f){return f=Ma(f),f.tag=3,f.payload={element:null},f.callback=function(){Zm(l,c)},f}function mE(l){return l=Ma(l),l.tag=3,l}function gE(l,c,f,O){var y=f.type.getDerivedStateFromError;if(typeof y=="function"){var S=O.value;l.payload=function(){return y(S)},l.callback=function(){pE(c,f,O)}}var N=f.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(l.callback=function(){pE(c,f,O),typeof y!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var L=O.stack;this.componentDidCatch(O.value,{componentStack:L!==null?L:""})})}function $I(l,c,f,O,y){if(f.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){if(c=f.alternate,c!==null&&bc(c,f,y,!0),f=Tr.current,f!==null){switch(f.tag){case 31:case 13:return ti===null?Jm():f.alternate===null&&Ut===0&&(Ut=3),f.flags&=-257,f.flags|=65536,f.lanes=y,O===Em?f.flags|=16384:(c=f.updateQueue,c===null?f.updateQueue=new Set([O]):c.add(O),xb(l,O,y)),!1;case 22:return f.flags|=65536,O===Em?f.flags|=16384:(c=f.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([O])},f.updateQueue=c):(f=c.retryQueue,f===null?c.retryQueue=new Set([O]):f.add(O)),xb(l,O,y)),!1}throw Error(r(435,f.tag))}return xb(l,O,y),Jm(),!1}if(nt)return c=Tr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=y,O!==fy&&(l=Error(r(422),{cause:O}),Xd(Fr(l,f)))):(O!==fy&&(c=Error(r(423),{cause:O}),Xd(Fr(c,f))),l=l.current.alternate,l.flags|=65536,y&=-y,l.lanes|=y,O=Fr(O,f),y=Uy(l.stateNode,O,y),wy(l,y),Ut!==4&&(Ut=2)),!1;var S=Error(r(520),{cause:O});if(S=Fr(S,f),af===null?af=[S]:af.push(S),Ut!==4&&(Ut=2),c===null)return!0;O=Fr(O,f),f=c;do{switch(f.tag){case 3:return f.flags|=65536,l=y&-y,f.lanes|=l,l=Uy(f.stateNode,O,l),wy(f,l),!1;case 1:if(c=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ba===null||!Ba.has(S))))return f.flags|=65536,y&=-y,f.lanes|=y,y=mE(y),gE(y,l,f,O),wy(f,y),!1}f=f.return}while(f!==null);return!1}var Wy=Error(r(461)),dn=!1;function Tn(l,c,f,O){c.child=l===null?yj(c,null,f,O):Gl(c,l.child,f,O)}function OE(l,c,f,O,y){f=f.render;var S=c.ref;if("ref"in O){var N={};for(var L in O)L!=="ref"&&(N[L]=O[L])}else N=O;return Yl(c),O=$y(l,c,f,N,S,y),L=Ny(),l!==null&&!dn?(Ty(l,c,y),Ls(l,c,y)):(nt&&L&&uy(c),c.flags|=1,Tn(l,c,O,y),c.child)}function xE(l,c,f,O,y){if(l===null){var S=f.type;return typeof S=="function"&&!ly(S)&&S.defaultProps===void 0&&f.compare===null?(c.tag=15,c.type=S,vE(l,c,S,O,y)):(l=Sm(f.type,null,O,c,c.mode,y),l.ref=c.ref,l.return=c,c.child=l)}if(S=l.child,!nb(l,y)){var N=S.memoizedProps;if(f=f.compare,f=f!==null?f:zd,f(N,O)&&l.ref===c.ref)return Ls(l,c,y)}return c.flags|=1,l=_s(S,O),l.ref=c.ref,l.return=c,c.child=l}function vE(l,c,f,O,y){if(l!==null){var S=l.memoizedProps;if(zd(S,O)&&l.ref===c.ref)if(dn=!1,c.pendingProps=O=S,nb(l,y))(l.flags&131072)!==0&&(dn=!0);else return c.lanes=l.lanes,Ls(l,c,y)}return Hy(l,c,f,O,y)}function yE(l,c,f,O){var y=O.children,S=l!==null?l.memoizedState:null;if(l===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),O.mode==="hidden"){if((c.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,l!==null){for(O=c.child=l.child,y=0;O!==null;)y=y|O.lanes|O.childLanes,O=O.sibling;O=y&~S}else O=0,c.child=null;return bE(l,c,S,f,O)}if((f&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&Cm(c,S!==null?S.cachePool:null),S!==null?wj(c,S):Qy(),kj(c);else return O=c.lanes=536870912,bE(l,c,S!==null?S.baseLanes|f:f,f,O)}else S!==null?(Cm(c,S.cachePool),wj(c,S),La(),c.memoizedState=null):(l!==null&&Cm(c,null),Qy(),La());return Tn(l,c,y,f),c.child}function Kd(l,c){return l!==null&&l.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function bE(l,c,f,O,y){var S=vy();return S=S===null?null:{parent:cn._currentValue,pool:S},c.memoizedState={baseLanes:f,cachePool:S},l!==null&&Cm(c,null),Qy(),kj(c),l!==null&&bc(l,c,O,!0),c.childLanes=y,null}function Im(l,c){return c=qm({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function SE(l,c,f){return Gl(c,l.child,null,f),l=Im(c,c.pendingProps),l.flags|=2,Pr(c),c.memoizedState=null,l}function NI(l,c,f){var O=c.pendingProps,y=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(nt){if(O.mode==="hidden")return l=Im(c,O),c.lanes=536870912,Kd(null,l);if(jy(c),(l=Dt)?(l=A$(l,ei),l=l!==null&&l.data==="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:Ta!==null?{id:Wi,overflow:Hi}:null,retryLane:536870912,hydrationErrors:null},f=sj(l),f.return=c,c.child=f,$n=c,Dt=null)):l=null,l===null)throw _a(c);return c.lanes=536870912,null}return Im(c,O)}var S=l.memoizedState;if(S!==null){var N=S.dehydrated;if(jy(c),y)if(c.flags&256)c.flags&=-257,c=SE(l,c,f);else if(c.memoizedState!==null)c.child=l.child,c.flags|=128,c=null;else throw Error(r(558));else if(dn||bc(l,c,f,!1),y=(f&l.childLanes)!==0,dn||y){if(O=Tt,O!==null&&(N=em(O,f),N!==0&&N!==S.retryLane))throw S.retryLane=N,Il(l,N),pr(O,l,N),Wy;Jm(),c=SE(l,c,f)}else l=S.treeContext,Dt=ni(N.nextSibling),$n=c,nt=!0,Pa=null,ei=!1,l!==null&&oj(c,l),c=Im(c,O),c.flags|=4096;return c}return l=_s(l.child,{mode:O.mode,children:O.children}),l.ref=c.ref,c.child=l,l.return=c,l}function Bm(l,c){var f=c.ref;if(f===null)l!==null&&l.ref!==null&&(c.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(l===null||l.ref!==f)&&(c.flags|=4194816)}}function Hy(l,c,f,O,y){return Yl(c),f=$y(l,c,f,O,void 0,y),O=Ny(),l!==null&&!dn?(Ty(l,c,y),Ls(l,c,y)):(nt&&O&&uy(c),c.flags|=1,Tn(l,c,f,y),c.child)}function wE(l,c,f,O,y,S){return Yl(c),c.updateQueue=null,f=Cj(c,O,f,y),Qj(l),O=Ny(),l!==null&&!dn?(Ty(l,c,S),Ls(l,c,S)):(nt&&O&&uy(c),c.flags|=1,Tn(l,c,f,S),c.child)}function kE(l,c,f,O,y){if(Yl(c),c.stateNode===null){var S=Oc,N=f.contextType;typeof N=="object"&&N!==null&&(S=Nn(N)),S=new f(O,S),c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Yy,c.stateNode=S,S._reactInternals=c,S=c.stateNode,S.props=O,S.state=c.memoizedState,S.refs={},by(c),N=f.contextType,S.context=typeof N=="object"&&N!==null?Nn(N):Oc,S.state=c.memoizedState,N=f.getDerivedStateFromProps,typeof N=="function"&&(Vy(c,f,N,O),S.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(N=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),N!==S.state&&Yy.enqueueReplaceState(S,S.state,null),Ud(c,O,S,y),Yd(),S.state=c.memoizedState),typeof S.componentDidMount=="function"&&(c.flags|=4194308),O=!0}else if(l===null){S=c.stateNode;var L=c.memoizedProps,K=Kl(f,L);S.props=K;var le=S.context,de=f.contextType;N=Oc,typeof de=="object"&&de!==null&&(N=Nn(de));var he=f.getDerivedStateFromProps;de=typeof he=="function"||typeof S.getSnapshotBeforeUpdate=="function",L=c.pendingProps!==L,de||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(L||le!==N)&&uE(c,S,O,N),Ra=!1;var oe=c.memoizedState;S.state=oe,Ud(c,O,S,y),Yd(),le=c.memoizedState,L||oe!==le||Ra?(typeof he=="function"&&(Vy(c,f,he,O),le=c.memoizedState),(K=Ra||cE(c,f,K,O,oe,le,N))?(de||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(c.flags|=4194308)):(typeof S.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=O,c.memoizedState=le),S.props=O,S.state=le,S.context=N,O=K):(typeof S.componentDidMount=="function"&&(c.flags|=4194308),O=!1)}else{S=c.stateNode,Sy(l,c),N=c.memoizedProps,de=Kl(f,N),S.props=de,he=c.pendingProps,oe=S.context,le=f.contextType,K=Oc,typeof le=="object"&&le!==null&&(K=Nn(le)),L=f.getDerivedStateFromProps,(le=typeof L=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N!==he||oe!==K)&&uE(c,S,O,K),Ra=!1,oe=c.memoizedState,S.state=oe,Ud(c,O,S,y),Yd();var ce=c.memoizedState;N!==he||oe!==ce||Ra||l!==null&&l.dependencies!==null&&km(l.dependencies)?(typeof L=="function"&&(Vy(c,f,L,O),ce=c.memoizedState),(de=Ra||cE(c,f,de,O,oe,ce,K)||l!==null&&l.dependencies!==null&&km(l.dependencies))?(le||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(O,ce,K),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(O,ce,K)),typeof S.componentDidUpdate=="function"&&(c.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof S.componentDidUpdate!="function"||N===l.memoizedProps&&oe===l.memoizedState||(c.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===l.memoizedProps&&oe===l.memoizedState||(c.flags|=1024),c.memoizedProps=O,c.memoizedState=ce),S.props=O,S.state=ce,S.context=K,O=de):(typeof S.componentDidUpdate!="function"||N===l.memoizedProps&&oe===l.memoizedState||(c.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===l.memoizedProps&&oe===l.memoizedState||(c.flags|=1024),O=!1)}return S=O,Bm(l,c),O=(c.flags&128)!==0,S||O?(S=c.stateNode,f=O&&typeof f.getDerivedStateFromError!="function"?null:S.render(),c.flags|=1,l!==null&&O?(c.child=Gl(c,l.child,null,y),c.child=Gl(c,null,f,y)):Tn(l,c,f,y),c.memoizedState=S.state,l=c.child):l=Ls(l,c,y),l}function QE(l,c,f,O){return ql(),c.flags|=256,Tn(l,c,f,O),c.child}var Gy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fy(l){return{baseLanes:l,cachePool:pj()}}function Ky(l,c,f){return l=l!==null?l.childLanes&~f:0,c&&(l|=Ar),l}function CE(l,c,f){var O=c.pendingProps,y=!1,S=(c.flags&128)!==0,N;if((N=S)||(N=l!==null&&l.memoizedState===null?!1:(tn.current&2)!==0),N&&(y=!0,c.flags&=-129),N=(c.flags&32)!==0,c.flags&=-33,l===null){if(nt){if(y?Da(c):La(),(l=Dt)?(l=A$(l,ei),l=l!==null&&l.data!=="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:Ta!==null?{id:Wi,overflow:Hi}:null,retryLane:536870912,hydrationErrors:null},f=sj(l),f.return=c,c.child=f,$n=c,Dt=null)):l=null,l===null)throw _a(c);return Ab(l)?c.lanes=32:c.lanes=536870912,null}var L=O.children;return O=O.fallback,y?(La(),y=c.mode,L=qm({mode:"hidden",children:L},y),O=Bl(O,y,f,null),L.return=c,O.return=c,L.sibling=O,c.child=L,O=c.child,O.memoizedState=Fy(f),O.childLanes=Ky(l,N,f),c.memoizedState=Gy,Kd(null,O)):(Da(c),Jy(c,L))}var K=l.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(S)c.flags&256?(Da(c),c.flags&=-257,c=eb(l,c,f)):c.memoizedState!==null?(La(),c.child=l.child,c.flags|=128,c=null):(La(),L=O.fallback,y=c.mode,O=qm({mode:"visible",children:O.children},y),L=Bl(L,y,f,null),L.flags|=2,O.return=c,L.return=c,O.sibling=L,c.child=O,Gl(c,l.child,null,f),O=c.child,O.memoizedState=Fy(f),O.childLanes=Ky(l,N,f),c.memoizedState=Gy,c=Kd(null,O));else if(Da(c),Ab(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var le=N.dgst;N=le,O=Error(r(419)),O.stack="",O.digest=N,Xd({value:O,source:null,stack:null}),c=eb(l,c,f)}else if(dn||bc(l,c,f,!1),N=(f&l.childLanes)!==0,dn||N){if(N=Tt,N!==null&&(O=em(N,f),O!==0&&O!==K.retryLane))throw K.retryLane=O,Il(l,O),pr(N,l,O),Wy;_b(L)||Jm(),c=eb(l,c,f)}else _b(L)?(c.flags|=192,c.child=l.child,c=null):(l=K.treeContext,Dt=ni(L.nextSibling),$n=c,nt=!0,Pa=null,ei=!1,l!==null&&oj(c,l),c=Jy(c,O.children),c.flags|=4096);return c}return y?(La(),L=O.fallback,y=c.mode,K=l.child,le=K.sibling,O=_s(K,{mode:"hidden",children:O.children}),O.subtreeFlags=K.subtreeFlags&65011712,le!==null?L=_s(le,L):(L=Bl(L,y,f,null),L.flags|=2),L.return=c,O.return=c,O.sibling=L,c.child=O,Kd(null,O),O=c.child,L=l.child.memoizedState,L===null?L=Fy(f):(y=L.cachePool,y!==null?(K=cn._currentValue,y=y.parent!==K?{parent:K,pool:K}:y):y=pj(),L={baseLanes:L.baseLanes|f,cachePool:y}),O.memoizedState=L,O.childLanes=Ky(l,N,f),c.memoizedState=Gy,Kd(l.child,O)):(Da(c),f=l.child,l=f.sibling,f=_s(f,{mode:"visible",children:O.children}),f.return=c,f.sibling=null,l!==null&&(N=c.deletions,N===null?(c.deletions=[l],c.flags|=16):N.push(l)),c.child=f,c.memoizedState=null,f)}function Jy(l,c){return c=qm({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function qm(l,c){return l=Nr(22,l,null,c),l.lanes=0,l}function eb(l,c,f){return Gl(c,l.child,null,f),l=Jy(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function jE(l,c,f){l.lanes|=c;var O=l.alternate;O!==null&&(O.lanes|=c),my(l.return,c,f)}function tb(l,c,f,O,y,S){var N=l.memoizedState;N===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:O,tail:f,tailMode:y,treeForkCount:S}:(N.isBackwards=c,N.rendering=null,N.renderingStartTime=0,N.last=O,N.tail=f,N.tailMode=y,N.treeForkCount=S)}function EE(l,c,f){var O=c.pendingProps,y=O.revealOrder,S=O.tail;O=O.children;var N=tn.current,L=(N&2)!==0;if(L?(N=N&1|2,c.flags|=128):N&=1,M(tn,N),Tn(l,c,O,f),O=nt?Ld:0,!L&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&jE(l,f,c);else if(l.tag===19)jE(l,f,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(y){case"forwards":for(f=c.child,y=null;f!==null;)l=f.alternate,l!==null&&Pm(l)===null&&(y=f),f=f.sibling;f=y,f===null?(y=c.child,c.child=null):(y=f.sibling,f.sibling=null),tb(c,!1,y,f,S,O);break;case"backwards":case"unstable_legacy-backwards":for(f=null,y=c.child,c.child=null;y!==null;){if(l=y.alternate,l!==null&&Pm(l)===null){c.child=y;break}l=y.sibling,y.sibling=f,f=y,y=l}tb(c,!0,f,null,S,O);break;case"together":tb(c,!1,null,null,void 0,O);break;default:c.memoizedState=null}return c.child}function Ls(l,c,f){if(l!==null&&(c.dependencies=l.dependencies),Ia|=c.lanes,(f&c.childLanes)===0)if(l!==null){if(bc(l,c,f,!1),(f&c.childLanes)===0)return null}else return null;if(l!==null&&c.child!==l.child)throw Error(r(153));if(c.child!==null){for(l=c.child,f=_s(l,l.pendingProps),c.child=f,f.return=c;l.sibling!==null;)l=l.sibling,f=f.sibling=_s(l,l.pendingProps),f.return=c;f.sibling=null}return c.child}function nb(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&km(l)))}function TI(l,c,f){switch(c.tag){case 3:se(c,c.stateNode.containerInfo),Aa(c,cn,l.memoizedState.cache),ql();break;case 27:case 5:ye(c);break;case 4:se(c,c.stateNode.containerInfo);break;case 10:Aa(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,jy(c),null;break;case 13:var O=c.memoizedState;if(O!==null)return O.dehydrated!==null?(Da(c),c.flags|=128,null):(f&c.child.childLanes)!==0?CE(l,c,f):(Da(c),l=Ls(l,c,f),l!==null?l.sibling:null);Da(c);break;case 19:var y=(l.flags&128)!==0;if(O=(f&c.childLanes)!==0,O||(bc(l,c,f,!1),O=(f&c.childLanes)!==0),y){if(O)return EE(l,c,f);c.flags|=128}if(y=c.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),M(tn,tn.current),O)break;return null;case 22:return c.lanes=0,yE(l,c,f,c.pendingProps);case 24:Aa(c,cn,l.memoizedState.cache)}return Ls(l,c,f)}function $E(l,c,f){if(l!==null)if(l.memoizedProps!==c.pendingProps)dn=!0;else{if(!nb(l,f)&&(c.flags&128)===0)return dn=!1,TI(l,c,f);dn=(l.flags&131072)!==0}else dn=!1,nt&&(c.flags&1048576)!==0&&lj(c,Ld,c.index);switch(c.lanes=0,c.tag){case 16:e:{var O=c.pendingProps;if(l=Wl(c.elementType),c.type=l,typeof l=="function")ly(l)?(O=Kl(l,O),c.tag=1,c=kE(null,c,l,O,f)):(c.tag=0,c=Hy(null,c,l,O,f));else{if(l!=null){var y=l.$$typeof;if(y===E){c.tag=11,c=OE(null,c,l,O,f);break e}else if(y===A){c.tag=14,c=xE(null,c,l,O,f);break e}}throw c=P(l)||l,Error(r(306,c,""))}}return c;case 0:return Hy(l,c,c.type,c.pendingProps,f);case 1:return O=c.type,y=Kl(O,c.pendingProps),kE(l,c,O,y,f);case 3:e:{if(se(c,c.stateNode.containerInfo),l===null)throw Error(r(387));O=c.pendingProps;var S=c.memoizedState;y=S.element,Sy(l,c),Ud(c,O,null,f);var N=c.memoizedState;if(O=N.cache,Aa(c,cn,O),O!==S.cache&&gy(c,[cn],f,!0),Yd(),O=N.element,S.isDehydrated)if(S={element:O,isDehydrated:!1,cache:N.cache},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){c=QE(l,c,O,f);break e}else if(O!==y){y=Fr(Error(r(424)),c),Xd(y),c=QE(l,c,O,f);break e}else{switch(l=c.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(Dt=ni(l.firstChild),$n=c,nt=!0,Pa=null,ei=!0,f=yj(c,null,O,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(ql(),O===y){c=Ls(l,c,f);break e}Tn(l,c,O,f)}c=c.child}return c;case 26:return Bm(l,c),l===null?(f=X$(c.type,null,c.pendingProps,null))?c.memoizedState=f:nt||(f=c.type,l=c.pendingProps,O=ag(J.current).createElement(f),O[On]=c,O[Ln]=l,Pn(O,f,l),on(O),c.stateNode=O):c.memoizedState=X$(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:return ye(c),l===null&&nt&&(O=c.stateNode=z$(c.type,c.pendingProps,J.current),$n=c,ei=!0,y=Dt,Ua(c.type)?(Rb=y,Dt=ni(O.firstChild)):Dt=y),Tn(l,c,c.pendingProps.children,f),Bm(l,c),l===null&&(c.flags|=4194304),c.child;case 5:return l===null&&nt&&((y=O=Dt)&&(O=lB(O,c.type,c.pendingProps,ei),O!==null?(c.stateNode=O,$n=c,Dt=ni(O.firstChild),ei=!1,y=!0):y=!1),y||_a(c)),ye(c),y=c.type,S=c.pendingProps,N=l!==null?l.memoizedProps:null,O=S.children,Nb(y,S)?O=null:N!==null&&Nb(y,N)&&(c.flags|=32),c.memoizedState!==null&&(y=$y(l,c,SI,null,null,f),pf._currentValue=y),Bm(l,c),Tn(l,c,O,f),c.child;case 6:return l===null&&nt&&((l=f=Dt)&&(f=oB(f,c.pendingProps,ei),f!==null?(c.stateNode=f,$n=c,Dt=null,l=!0):l=!1),l||_a(c)),null;case 13:return CE(l,c,f);case 4:return se(c,c.stateNode.containerInfo),O=c.pendingProps,l===null?c.child=Gl(c,null,O,f):Tn(l,c,O,f),c.child;case 11:return OE(l,c,c.type,c.pendingProps,f);case 7:return Tn(l,c,c.pendingProps,f),c.child;case 8:return Tn(l,c,c.pendingProps.children,f),c.child;case 12:return Tn(l,c,c.pendingProps.children,f),c.child;case 10:return O=c.pendingProps,Aa(c,c.type,O.value),Tn(l,c,O.children,f),c.child;case 9:return y=c.type._context,O=c.pendingProps.children,Yl(c),y=Nn(y),O=O(y),c.flags|=1,Tn(l,c,O,f),c.child;case 14:return xE(l,c,c.type,c.pendingProps,f);case 15:return vE(l,c,c.type,c.pendingProps,f);case 19:return EE(l,c,f);case 31:return NI(l,c,f);case 22:return yE(l,c,f,c.pendingProps);case 24:return Yl(c),O=Nn(cn),l===null?(y=vy(),y===null&&(y=Tt,S=Oy(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=f),y=S),c.memoizedState={parent:O,cache:y},by(c),Aa(c,cn,y)):((l.lanes&f)!==0&&(Sy(l,c),Ud(c,null,null,f),Yd()),y=l.memoizedState,S=c.memoizedState,y.parent!==O?(y={parent:O,cache:O},c.memoizedState=y,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=y),Aa(c,cn,O)):(O=S.cache,Aa(c,cn,O),O!==y.cache&&gy(c,[cn],f,!0))),Tn(l,c,c.pendingProps.children,f),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Xs(l){l.flags|=4}function rb(l,c,f,O,y){if((c=(l.mode&32)!==0)&&(c=!1),c){if(l.flags|=16777216,(y&335544128)===y)if(l.stateNode.complete)l.flags|=8192;else if(n$())l.flags|=8192;else throw Hl=Em,yy}else l.flags&=-16777217}function NE(l,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!V$(c))if(n$())l.flags|=8192;else throw Hl=Em,yy}function Vm(l,c){c!==null&&(l.flags|=4),l.flags&16384&&(c=l.tag!==22?Fp():536870912,l.lanes|=c,_c|=c)}function Jd(l,c){if(!nt)switch(l.tailMode){case"hidden":c=l.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?l.tail=null:f.sibling=null;break;case"collapsed":f=l.tail;for(var O=null;f!==null;)f.alternate!==null&&(O=f),f=f.sibling;O===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:O.sibling=null}}function Lt(l){var c=l.alternate!==null&&l.alternate.child===l.child,f=0,O=0;if(c)for(var y=l.child;y!==null;)f|=y.lanes|y.childLanes,O|=y.subtreeFlags&65011712,O|=y.flags&65011712,y.return=l,y=y.sibling;else for(y=l.child;y!==null;)f|=y.lanes|y.childLanes,O|=y.subtreeFlags,O|=y.flags,y.return=l,y=y.sibling;return l.subtreeFlags|=O,l.childLanes=f,c}function PI(l,c,f){var O=c.pendingProps;switch(dy(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(c),null;case 1:return Lt(c),null;case 3:return f=c.stateNode,O=null,l!==null&&(O=l.memoizedState.cache),c.memoizedState.cache!==O&&(c.flags|=2048),Ms(cn),pe(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(l===null||l.child===null)&&(yc(c)?Xs(c):l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,hy())),Lt(c),null;case 26:var y=c.type,S=c.memoizedState;return l===null?(Xs(c),S!==null?(Lt(c),NE(c,S)):(Lt(c),rb(c,y,null,O,f))):S?S!==l.memoizedState?(Xs(c),Lt(c),NE(c,S)):(Lt(c),c.flags&=-16777217):(l=l.memoizedProps,l!==O&&Xs(c),Lt(c),rb(c,y,l,O,f)),null;case 27:if(be(c),f=J.current,y=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==O&&Xs(c);else{if(!O){if(c.stateNode===null)throw Error(r(166));return Lt(c),null}l=G.current,yc(c)?cj(c):(l=z$(y,O,f),c.stateNode=l,Xs(c))}return Lt(c),null;case 5:if(be(c),y=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==O&&Xs(c);else{if(!O){if(c.stateNode===null)throw Error(r(166));return Lt(c),null}if(S=G.current,yc(c))cj(c);else{var N=ag(J.current);switch(S){case 1:S=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=N.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof O.is=="string"?N.createElement("select",{is:O.is}):N.createElement("select"),O.multiple?S.multiple=!0:O.size&&(S.size=O.size);break;default:S=typeof O.is=="string"?N.createElement(y,{is:O.is}):N.createElement(y)}}S[On]=c,S[Ln]=O;e:for(N=c.child;N!==null;){if(N.tag===5||N.tag===6)S.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===c)break e;for(;N.sibling===null;){if(N.return===null||N.return===c)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}c.stateNode=S;e:switch(Pn(S,y,O),y){case"button":case"input":case"select":case"textarea":O=!!O.autoFocus;break e;case"img":O=!0;break e;default:O=!1}O&&Xs(c)}}return Lt(c),rb(c,c.type,l===null?null:l.memoizedProps,c.pendingProps,f),null;case 6:if(l&&c.stateNode!=null)l.memoizedProps!==O&&Xs(c);else{if(typeof O!="string"&&c.stateNode===null)throw Error(r(166));if(l=J.current,yc(c)){if(l=c.stateNode,f=c.memoizedProps,O=null,y=$n,y!==null)switch(y.tag){case 27:case 5:O=y.memoizedProps}l[On]=c,l=!!(l.nodeValue===f||O!==null&&O.suppressHydrationWarning===!0||C$(l.nodeValue,f)),l||_a(c,!0)}else l=ag(l).createTextNode(O),l[On]=c,c.stateNode=l}return Lt(c),null;case 31:if(f=c.memoizedState,l===null||l.memoizedState!==null){if(O=yc(c),f!==null){if(l===null){if(!O)throw Error(r(318));if(l=c.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[On]=c}else ql(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Lt(c),l=!1}else f=hy(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=f),l=!0;if(!l)return c.flags&256?(Pr(c),c):(Pr(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Lt(c),null;case 13:if(O=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(y=yc(c),O!==null&&O.dehydrated!==null){if(l===null){if(!y)throw Error(r(318));if(y=c.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[On]=c}else ql(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Lt(c),y=!1}else y=hy(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=y),y=!0;if(!y)return c.flags&256?(Pr(c),c):(Pr(c),null)}return Pr(c),(c.flags&128)!==0?(c.lanes=f,c):(f=O!==null,l=l!==null&&l.memoizedState!==null,f&&(O=c.child,y=null,O.alternate!==null&&O.alternate.memoizedState!==null&&O.alternate.memoizedState.cachePool!==null&&(y=O.alternate.memoizedState.cachePool.pool),S=null,O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(S=O.memoizedState.cachePool.pool),S!==y&&(O.flags|=2048)),f!==l&&f&&(c.child.flags|=8192),Vm(c,c.updateQueue),Lt(c),null);case 4:return pe(),l===null&&Qb(c.stateNode.containerInfo),Lt(c),null;case 10:return Ms(c.type),Lt(c),null;case 19:if(q(tn),O=c.memoizedState,O===null)return Lt(c),null;if(y=(c.flags&128)!==0,S=O.rendering,S===null)if(y)Jd(O,!1);else{if(Ut!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(S=Pm(l),S!==null){for(c.flags|=128,Jd(O,!1),l=S.updateQueue,c.updateQueue=l,Vm(c,l),c.subtreeFlags=0,l=f,f=c.child;f!==null;)ij(f,l),f=f.sibling;return M(tn,tn.current&1|2),nt&&As(c,O.treeForkCount),c.child}l=l.sibling}O.tail!==null&&en()>Gm&&(c.flags|=128,y=!0,Jd(O,!1),c.lanes=4194304)}else{if(!y)if(l=Pm(S),l!==null){if(c.flags|=128,y=!0,l=l.updateQueue,c.updateQueue=l,Vm(c,l),Jd(O,!0),O.tail===null&&O.tailMode==="hidden"&&!S.alternate&&!nt)return Lt(c),null}else 2*en()-O.renderingStartTime>Gm&&f!==536870912&&(c.flags|=128,y=!0,Jd(O,!1),c.lanes=4194304);O.isBackwards?(S.sibling=c.child,c.child=S):(l=O.last,l!==null?l.sibling=S:c.child=S,O.last=S)}return O.tail!==null?(l=O.tail,O.rendering=l,O.tail=l.sibling,O.renderingStartTime=en(),l.sibling=null,f=tn.current,M(tn,y?f&1|2:f&1),nt&&As(c,O.treeForkCount),l):(Lt(c),null);case 22:case 23:return Pr(c),Cy(),O=c.memoizedState!==null,l!==null?l.memoizedState!==null!==O&&(c.flags|=8192):O&&(c.flags|=8192),O?(f&536870912)!==0&&(c.flags&128)===0&&(Lt(c),c.subtreeFlags&6&&(c.flags|=8192)):Lt(c),f=c.updateQueue,f!==null&&Vm(c,f.retryQueue),f=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),O=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(O=c.memoizedState.cachePool.pool),O!==f&&(c.flags|=2048),l!==null&&q(Ul),null;case 24:return f=null,l!==null&&(f=l.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),Ms(cn),Lt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function _I(l,c){switch(dy(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return Ms(cn),pe(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return be(c),null;case 31:if(c.memoizedState!==null){if(Pr(c),c.alternate===null)throw Error(r(340));ql()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 13:if(Pr(c),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(r(340));ql()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return q(tn),null;case 4:return pe(),null;case 10:return Ms(c.type),null;case 22:case 23:return Pr(c),Cy(),l!==null&&q(Ul),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return Ms(cn),null;case 25:return null;default:return null}}function TE(l,c){switch(dy(c),c.tag){case 3:Ms(cn),pe();break;case 26:case 27:case 5:be(c);break;case 4:pe();break;case 31:c.memoizedState!==null&&Pr(c);break;case 13:Pr(c);break;case 19:q(tn);break;case 10:Ms(c.type);break;case 22:case 23:Pr(c),Cy(),l!==null&&q(Ul);break;case 24:Ms(cn)}}function ef(l,c){try{var f=c.updateQueue,O=f!==null?f.lastEffect:null;if(O!==null){var y=O.next;f=y;do{if((f.tag&l)===l){O=void 0;var S=f.create,N=f.inst;O=S(),N.destroy=O}f=f.next}while(f!==y)}}catch(L){St(c,c.return,L)}}function Xa(l,c,f){try{var O=c.updateQueue,y=O!==null?O.lastEffect:null;if(y!==null){var S=y.next;O=S;do{if((O.tag&l)===l){var N=O.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,y=c;var K=f,le=L;try{le()}catch(de){St(y,K,de)}}}O=O.next}while(O!==S)}}catch(de){St(c,c.return,de)}}function PE(l){var c=l.updateQueue;if(c!==null){var f=l.stateNode;try{Sj(c,f)}catch(O){St(l,l.return,O)}}}function _E(l,c,f){f.props=Kl(l.type,l.memoizedProps),f.state=l.memoizedState;try{f.componentWillUnmount()}catch(O){St(l,c,O)}}function tf(l,c){try{var f=l.ref;if(f!==null){switch(l.tag){case 26:case 27:case 5:var O=l.stateNode;break;case 30:O=l.stateNode;break;default:O=l.stateNode}typeof f=="function"?l.refCleanup=f(O):f.current=O}}catch(y){St(l,c,y)}}function Gi(l,c){var f=l.ref,O=l.refCleanup;if(f!==null)if(typeof O=="function")try{O()}catch(y){St(l,c,y)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(y){St(l,c,y)}else f.current=null}function AE(l){var c=l.type,f=l.memoizedProps,O=l.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&O.focus();break e;case"img":f.src?O.src=f.src:f.srcSet&&(O.srcset=f.srcSet)}}catch(y){St(l,l.return,y)}}function ib(l,c,f){try{var O=l.stateNode;tB(O,l.type,f,c),O[Ln]=c}catch(y){St(l,l.return,y)}}function RE(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Ua(l.type)||l.tag===4}function sb(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||RE(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Ua(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function ab(l,c,f){var O=l.tag;if(O===5||O===6)l=l.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(l,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(l),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Ts));else if(O!==4&&(O===27&&Ua(l.type)&&(f=l.stateNode,c=null),l=l.child,l!==null))for(ab(l,c,f),l=l.sibling;l!==null;)ab(l,c,f),l=l.sibling}function Ym(l,c,f){var O=l.tag;if(O===5||O===6)l=l.stateNode,c?f.insertBefore(l,c):f.appendChild(l);else if(O!==4&&(O===27&&Ua(l.type)&&(f=l.stateNode),l=l.child,l!==null))for(Ym(l,c,f),l=l.sibling;l!==null;)Ym(l,c,f),l=l.sibling}function ME(l){var c=l.stateNode,f=l.memoizedProps;try{for(var O=l.type,y=c.attributes;y.length;)c.removeAttributeNode(y[0]);Pn(c,O,f),c[On]=l,c[Ln]=f}catch(S){St(l,l.return,S)}}var Zs=!1,fn=!1,lb=!1,zE=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function AI(l,c){if(l=l.containerInfo,Eb=hg,l=HC(l),ey(l)){if("selectionStart"in l)var f={start:l.selectionStart,end:l.selectionEnd};else e:{f=(f=l.ownerDocument)&&f.defaultView||window;var O=f.getSelection&&f.getSelection();if(O&&O.rangeCount!==0){f=O.anchorNode;var y=O.anchorOffset,S=O.focusNode;O=O.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var N=0,L=-1,K=-1,le=0,de=0,he=l,oe=null;t:for(;;){for(var ce;he!==f||y!==0&&he.nodeType!==3||(L=N+y),he!==S||O!==0&&he.nodeType!==3||(K=N+O),he.nodeType===3&&(N+=he.nodeValue.length),(ce=he.firstChild)!==null;)oe=he,he=ce;for(;;){if(he===l)break t;if(oe===f&&++le===y&&(L=N),oe===S&&++de===O&&(K=N),(ce=he.nextSibling)!==null)break;he=oe,oe=he.parentNode}he=ce}f=L===-1||K===-1?null:{start:L,end:K}}else f=null}f=f||{start:0,end:0}}else f=null;for($b={focusedElem:l,selectionRange:f},hg=!1,Sn=c;Sn!==null;)if(c=Sn,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Sn=l;else for(;Sn!==null;){switch(c=Sn,S=c.alternate,l=c.flags,c.tag){case 0:if((l&4)!==0&&(l=c.updateQueue,l=l!==null?l.events:null,l!==null))for(f=0;f<l.length;f++)y=l[f],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&S!==null){l=void 0,f=c,y=S.memoizedProps,S=S.memoizedState,O=f.stateNode;try{var Ce=Kl(f.type,y);l=O.getSnapshotBeforeUpdate(Ce,S),O.__reactInternalSnapshotBeforeUpdate=l}catch(Re){St(f,f.return,Re)}}break;case 3:if((l&1024)!==0){if(l=c.stateNode.containerInfo,f=l.nodeType,f===9)Pb(l);else if(f===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Pb(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(r(163))}if(l=c.sibling,l!==null){l.return=c.return,Sn=l;break}Sn=c.return}}function DE(l,c,f){var O=f.flags;switch(f.tag){case 0:case 11:case 15:Bs(l,f),O&4&&ef(5,f);break;case 1:if(Bs(l,f),O&4)if(l=f.stateNode,c===null)try{l.componentDidMount()}catch(N){St(f,f.return,N)}else{var y=Kl(f.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(y,c,l.__reactInternalSnapshotBeforeUpdate)}catch(N){St(f,f.return,N)}}O&64&&PE(f),O&512&&tf(f,f.return);break;case 3:if(Bs(l,f),O&64&&(l=f.updateQueue,l!==null)){if(c=null,f.child!==null)switch(f.child.tag){case 27:case 5:c=f.child.stateNode;break;case 1:c=f.child.stateNode}try{Sj(l,c)}catch(N){St(f,f.return,N)}}break;case 27:c===null&&O&4&&ME(f);case 26:case 5:Bs(l,f),c===null&&O&4&&AE(f),O&512&&tf(f,f.return);break;case 12:Bs(l,f);break;case 31:Bs(l,f),O&4&&ZE(l,f);break;case 13:Bs(l,f),O&4&&IE(l,f),O&64&&(l=f.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(f=BI.bind(null,f),cB(l,f))));break;case 22:if(O=f.memoizedState!==null||Zs,!O){c=c!==null&&c.memoizedState!==null||fn,y=Zs;var S=fn;Zs=O,(fn=c)&&!S?qs(l,f,(f.subtreeFlags&8772)!==0):Bs(l,f),Zs=y,fn=S}break;case 30:break;default:Bs(l,f)}}function LE(l){var c=l.alternate;c!==null&&(l.alternate=null,LE(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&jd(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var Xt=null,ur=!1;function Is(l,c,f){for(f=f.child;f!==null;)XE(l,c,f),f=f.sibling}function XE(l,c,f){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(kt,f)}catch{}switch(f.tag){case 26:fn||Gi(f,c),Is(l,c,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:fn||Gi(f,c);var O=Xt,y=ur;Ua(f.type)&&(Xt=f.stateNode,ur=!1),Is(l,c,f),df(f.stateNode),Xt=O,ur=y;break;case 5:fn||Gi(f,c);case 6:if(O=Xt,y=ur,Xt=null,Is(l,c,f),Xt=O,ur=y,Xt!==null)if(ur)try{(Xt.nodeType===9?Xt.body:Xt.nodeName==="HTML"?Xt.ownerDocument.body:Xt).removeChild(f.stateNode)}catch(S){St(f,c,S)}else try{Xt.removeChild(f.stateNode)}catch(S){St(f,c,S)}break;case 18:Xt!==null&&(ur?(l=Xt,P$(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,f.stateNode),Zc(l)):P$(Xt,f.stateNode));break;case 4:O=Xt,y=ur,Xt=f.stateNode.containerInfo,ur=!0,Is(l,c,f),Xt=O,ur=y;break;case 0:case 11:case 14:case 15:Xa(2,f,c),fn||Xa(4,f,c),Is(l,c,f);break;case 1:fn||(Gi(f,c),O=f.stateNode,typeof O.componentWillUnmount=="function"&&_E(f,c,O)),Is(l,c,f);break;case 21:Is(l,c,f);break;case 22:fn=(O=fn)||f.memoizedState!==null,Is(l,c,f),fn=O;break;default:Is(l,c,f)}}function ZE(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{Zc(l)}catch(f){St(c,c.return,f)}}}function IE(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Zc(l)}catch(f){St(c,c.return,f)}}function RI(l){switch(l.tag){case 31:case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new zE),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new zE),c;default:throw Error(r(435,l.tag))}}function Um(l,c){var f=RI(l);c.forEach(function(O){if(!f.has(O)){f.add(O);var y=qI.bind(null,l,O);O.then(y,y)}})}function dr(l,c){var f=c.deletions;if(f!==null)for(var O=0;O<f.length;O++){var y=f[O],S=l,N=c,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(Ua(L.type)){Xt=L.stateNode,ur=!1;break e}break;case 5:Xt=L.stateNode,ur=!1;break e;case 3:case 4:Xt=L.stateNode.containerInfo,ur=!0;break e}L=L.return}if(Xt===null)throw Error(r(160));XE(S,N,y),Xt=null,ur=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)BE(c,l),c=c.sibling}var Ci=null;function BE(l,c){var f=l.alternate,O=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:dr(c,l),fr(l),O&4&&(Xa(3,l,l.return),ef(3,l),Xa(5,l,l.return));break;case 1:dr(c,l),fr(l),O&512&&(fn||f===null||Gi(f,f.return)),O&64&&Zs&&(l=l.updateQueue,l!==null&&(O=l.callbacks,O!==null&&(f=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=f===null?O:f.concat(O))));break;case 26:var y=Ci;if(dr(c,l),fr(l),O&512&&(fn||f===null||Gi(f,f.return)),O&4){var S=f!==null?f.memoizedState:null;if(O=l.memoizedState,f===null)if(O===null)if(l.stateNode===null){e:{O=l.type,f=l.memoizedProps,y=y.ownerDocument||y;t:switch(O){case"title":S=y.getElementsByTagName("title")[0],(!S||S[Ml]||S[On]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(O),y.head.insertBefore(S,y.querySelector("head > title"))),Pn(S,O,f),S[On]=l,on(S),O=S;break e;case"link":var N=B$("link","href",y).get(O+(f.href||""));if(N){for(var L=0;L<N.length;L++)if(S=N[L],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){N.splice(L,1);break t}}S=y.createElement(O),Pn(S,O,f),y.head.appendChild(S);break;case"meta":if(N=B$("meta","content",y).get(O+(f.content||""))){for(L=0;L<N.length;L++)if(S=N[L],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){N.splice(L,1);break t}}S=y.createElement(O),Pn(S,O,f),y.head.appendChild(S);break;default:throw Error(r(468,O))}S[On]=l,on(S),O=S}l.stateNode=O}else q$(y,l.type,l.stateNode);else l.stateNode=I$(y,O,l.memoizedProps);else S!==O?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,O===null?q$(y,l.type,l.stateNode):I$(y,O,l.memoizedProps)):O===null&&l.stateNode!==null&&ib(l,l.memoizedProps,f.memoizedProps)}break;case 27:dr(c,l),fr(l),O&512&&(fn||f===null||Gi(f,f.return)),f!==null&&O&4&&ib(l,l.memoizedProps,f.memoizedProps);break;case 5:if(dr(c,l),fr(l),O&512&&(fn||f===null||Gi(f,f.return)),l.flags&32){y=l.stateNode;try{uc(y,"")}catch(Ce){St(l,l.return,Ce)}}O&4&&l.stateNode!=null&&(y=l.memoizedProps,ib(l,y,f!==null?f.memoizedProps:y)),O&1024&&(lb=!0);break;case 6:if(dr(c,l),fr(l),O&4){if(l.stateNode===null)throw Error(r(162));O=l.memoizedProps,f=l.stateNode;try{f.nodeValue=O}catch(Ce){St(l,l.return,Ce)}}break;case 3:if(cg=null,y=Ci,Ci=lg(c.containerInfo),dr(c,l),Ci=y,fr(l),O&4&&f!==null&&f.memoizedState.isDehydrated)try{Zc(c.containerInfo)}catch(Ce){St(l,l.return,Ce)}lb&&(lb=!1,qE(l));break;case 4:O=Ci,Ci=lg(l.stateNode.containerInfo),dr(c,l),fr(l),Ci=O;break;case 12:dr(c,l),fr(l);break;case 31:dr(c,l),fr(l),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,Um(l,O)));break;case 13:dr(c,l),fr(l),l.child.flags&8192&&l.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Hm=en()),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,Um(l,O)));break;case 22:y=l.memoizedState!==null;var K=f!==null&&f.memoizedState!==null,le=Zs,de=fn;if(Zs=le||y,fn=de||K,dr(c,l),fn=de,Zs=le,fr(l),O&8192)e:for(c=l.stateNode,c._visibility=y?c._visibility&-2:c._visibility|1,y&&(f===null||K||Zs||fn||Jl(l)),f=null,c=l;;){if(c.tag===5||c.tag===26){if(f===null){K=f=c;try{if(S=K.stateNode,y)N=S.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=K.stateNode;var he=K.memoizedProps.style,oe=he!=null&&he.hasOwnProperty("display")?he.display:null;L.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ce){St(K,K.return,Ce)}}}else if(c.tag===6){if(f===null){K=c;try{K.stateNode.nodeValue=y?"":K.memoizedProps}catch(Ce){St(K,K.return,Ce)}}}else if(c.tag===18){if(f===null){K=c;try{var ce=K.stateNode;y?_$(ce,!0):_$(K.stateNode,!1)}catch(Ce){St(K,K.return,Ce)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.sibling}O&4&&(O=l.updateQueue,O!==null&&(f=O.retryQueue,f!==null&&(O.retryQueue=null,Um(l,f))));break;case 19:dr(c,l),fr(l),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,Um(l,O)));break;case 30:break;case 21:break;default:dr(c,l),fr(l)}}function fr(l){var c=l.flags;if(c&2){try{for(var f,O=l.return;O!==null;){if(RE(O)){f=O;break}O=O.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var y=f.stateNode,S=sb(l);Ym(l,S,y);break;case 5:var N=f.stateNode;f.flags&32&&(uc(N,""),f.flags&=-33);var L=sb(l);Ym(l,L,N);break;case 3:case 4:var K=f.stateNode.containerInfo,le=sb(l);ab(l,le,K);break;default:throw Error(r(161))}}catch(de){St(l,l.return,de)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function qE(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var c=l;qE(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),l=l.sibling}}function Bs(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)DE(l,c.alternate,c),c=c.sibling}function Jl(l){for(l=l.child;l!==null;){var c=l;switch(c.tag){case 0:case 11:case 14:case 15:Xa(4,c,c.return),Jl(c);break;case 1:Gi(c,c.return);var f=c.stateNode;typeof f.componentWillUnmount=="function"&&_E(c,c.return,f),Jl(c);break;case 27:df(c.stateNode);case 26:case 5:Gi(c,c.return),Jl(c);break;case 22:c.memoizedState===null&&Jl(c);break;case 30:Jl(c);break;default:Jl(c)}l=l.sibling}}function qs(l,c,f){for(f=f&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var O=c.alternate,y=l,S=c,N=S.flags;switch(S.tag){case 0:case 11:case 15:qs(y,S,f),ef(4,S);break;case 1:if(qs(y,S,f),O=S,y=O.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(le){St(O,O.return,le)}if(O=S,y=O.updateQueue,y!==null){var L=O.stateNode;try{var K=y.shared.hiddenCallbacks;if(K!==null)for(y.shared.hiddenCallbacks=null,y=0;y<K.length;y++)bj(K[y],L)}catch(le){St(O,O.return,le)}}f&&N&64&&PE(S),tf(S,S.return);break;case 27:ME(S);case 26:case 5:qs(y,S,f),f&&O===null&&N&4&&AE(S),tf(S,S.return);break;case 12:qs(y,S,f);break;case 31:qs(y,S,f),f&&N&4&&ZE(y,S);break;case 13:qs(y,S,f),f&&N&4&&IE(y,S);break;case 22:S.memoizedState===null&&qs(y,S,f),tf(S,S.return);break;case 30:break;default:qs(y,S,f)}c=c.sibling}}function ob(l,c){var f=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),l=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(l=c.memoizedState.cachePool.pool),l!==f&&(l!=null&&l.refCount++,f!=null&&Zd(f))}function cb(l,c){l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Zd(l))}function ji(l,c,f,O){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)VE(l,c,f,O),c=c.sibling}function VE(l,c,f,O){var y=c.flags;switch(c.tag){case 0:case 11:case 15:ji(l,c,f,O),y&2048&&ef(9,c);break;case 1:ji(l,c,f,O);break;case 3:ji(l,c,f,O),y&2048&&(l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Zd(l)));break;case 12:if(y&2048){ji(l,c,f,O),l=c.stateNode;try{var S=c.memoizedProps,N=S.id,L=S.onPostCommit;typeof L=="function"&&L(N,c.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(K){St(c,c.return,K)}}else ji(l,c,f,O);break;case 31:ji(l,c,f,O);break;case 13:ji(l,c,f,O);break;case 23:break;case 22:S=c.stateNode,N=c.alternate,c.memoizedState!==null?S._visibility&2?ji(l,c,f,O):nf(l,c):S._visibility&2?ji(l,c,f,O):(S._visibility|=2,Nc(l,c,f,O,(c.subtreeFlags&10256)!==0||!1)),y&2048&&ob(N,c);break;case 24:ji(l,c,f,O),y&2048&&cb(c.alternate,c);break;default:ji(l,c,f,O)}}function Nc(l,c,f,O,y){for(y=y&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var S=l,N=c,L=f,K=O,le=N.flags;switch(N.tag){case 0:case 11:case 15:Nc(S,N,L,K,y),ef(8,N);break;case 23:break;case 22:var de=N.stateNode;N.memoizedState!==null?de._visibility&2?Nc(S,N,L,K,y):nf(S,N):(de._visibility|=2,Nc(S,N,L,K,y)),y&&le&2048&&ob(N.alternate,N);break;case 24:Nc(S,N,L,K,y),y&&le&2048&&cb(N.alternate,N);break;default:Nc(S,N,L,K,y)}c=c.sibling}}function nf(l,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var f=l,O=c,y=O.flags;switch(O.tag){case 22:nf(f,O),y&2048&&ob(O.alternate,O);break;case 24:nf(f,O),y&2048&&cb(O.alternate,O);break;default:nf(f,O)}c=c.sibling}}var rf=8192;function Tc(l,c,f){if(l.subtreeFlags&rf)for(l=l.child;l!==null;)YE(l,c,f),l=l.sibling}function YE(l,c,f){switch(l.tag){case 26:Tc(l,c,f),l.flags&rf&&l.memoizedState!==null&&bB(f,Ci,l.memoizedState,l.memoizedProps);break;case 5:Tc(l,c,f);break;case 3:case 4:var O=Ci;Ci=lg(l.stateNode.containerInfo),Tc(l,c,f),Ci=O;break;case 22:l.memoizedState===null&&(O=l.alternate,O!==null&&O.memoizedState!==null?(O=rf,rf=16777216,Tc(l,c,f),rf=O):Tc(l,c,f));break;default:Tc(l,c,f)}}function UE(l){var c=l.alternate;if(c!==null&&(l=c.child,l!==null)){c.child=null;do c=l.sibling,l.sibling=null,l=c;while(l!==null)}}function sf(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var O=c[f];Sn=O,HE(O,l)}UE(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)WE(l),l=l.sibling}function WE(l){switch(l.tag){case 0:case 11:case 15:sf(l),l.flags&2048&&Xa(9,l,l.return);break;case 3:sf(l);break;case 12:sf(l);break;case 22:var c=l.stateNode;l.memoizedState!==null&&c._visibility&2&&(l.return===null||l.return.tag!==13)?(c._visibility&=-3,Wm(l)):sf(l);break;default:sf(l)}}function Wm(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var O=c[f];Sn=O,HE(O,l)}UE(l)}for(l=l.child;l!==null;){switch(c=l,c.tag){case 0:case 11:case 15:Xa(8,c,c.return),Wm(c);break;case 22:f=c.stateNode,f._visibility&2&&(f._visibility&=-3,Wm(c));break;default:Wm(c)}l=l.sibling}}function HE(l,c){for(;Sn!==null;){var f=Sn;switch(f.tag){case 0:case 11:case 15:Xa(8,f,c);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var O=f.memoizedState.cachePool.pool;O!=null&&O.refCount++}break;case 24:Zd(f.memoizedState.cache)}if(O=f.child,O!==null)O.return=f,Sn=O;else e:for(f=l;Sn!==null;){O=Sn;var y=O.sibling,S=O.return;if(LE(O),O===f){Sn=null;break e}if(y!==null){y.return=S,Sn=y;break e}Sn=S}}}var MI={getCacheForType:function(l){var c=Nn(cn),f=c.data.get(l);return f===void 0&&(f=l(),c.data.set(l,f)),f},cacheSignal:function(){return Nn(cn).controller.signal}},zI=typeof WeakMap=="function"?WeakMap:Map,pt=0,Tt=null,Ge=null,Je=0,bt=0,_r=null,Za=!1,Pc=!1,ub=!1,Vs=0,Ut=0,Ia=0,eo=0,db=0,Ar=0,_c=0,af=null,hr=null,fb=!1,Hm=0,GE=0,Gm=1/0,Fm=null,Ba=null,xn=0,qa=null,Ac=null,Ys=0,hb=0,pb=null,FE=null,lf=0,mb=null;function Rr(){return(pt&2)!==0&&Je!==0?Je&-Je:_.T!==null?bb():tm()}function KE(){if(Ar===0)if((Je&536870912)===0||nt){var l=ic;ic<<=1,(ic&3932160)===0&&(ic=262144),Ar=l}else Ar=536870912;return l=Tr.current,l!==null&&(l.flags|=32),Ar}function pr(l,c,f){(l===Tt&&(bt===2||bt===9)||l.cancelPendingCommit!==null)&&(Rc(l,0),Va(l,Je,Ar,!1)),Rl(l,f),((pt&2)===0||l!==Tt)&&(l===Tt&&((pt&2)===0&&(eo|=f),Ut===4&&Va(l,Je,Ar,!1)),Fi(l))}function JE(l,c,f){if((pt&6)!==0)throw Error(r(327));var O=!f&&(c&127)===0&&(c&l.expiredLanes)===0||Al(l,c),y=O?XI(l,c):Ob(l,c,!0),S=O;do{if(y===0){Pc&&!O&&Va(l,c,0,!1);break}else{if(f=l.current.alternate,S&&!DI(f)){y=Ob(l,c,!1),S=!1;continue}if(y===2){if(S=c,l.errorRecoveryDisabledLanes&S)var N=0;else N=l.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){c=N;e:{var L=l;y=af;var K=L.current.memoizedState.isDehydrated;if(K&&(Rc(L,N).flags|=256),N=Ob(L,N,!1),N!==2){if(ub&&!K){L.errorRecoveryDisabledLanes|=S,eo|=S,y=4;break e}S=hr,hr=y,S!==null&&(hr===null?hr=S:hr.push.apply(hr,S))}y=N}if(S=!1,y!==2)continue}}if(y===1){Rc(l,0),Va(l,c,0,!0);break}e:{switch(O=l,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:Va(O,c,Ar,!Za);break e;case 2:hr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(y=Hm+300-en(),10<y)){if(Va(O,c,Ar,!Za),ac(O,0,!0)!==0)break e;Ys=c,O.timeoutHandle=N$(e$.bind(null,O,f,hr,Fm,fb,c,Ar,eo,_c,Za,S,"Throttled",-0,0),y);break e}e$(O,f,hr,Fm,fb,c,Ar,eo,_c,Za,S,null,-0,0)}}break}while(!0);Fi(l)}function e$(l,c,f,O,y,S,N,L,K,le,de,he,oe,ce){if(l.timeoutHandle=-1,he=c.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ts},YE(c,S,he);var Ce=(S&62914560)===S?Hm-en():(S&4194048)===S?GE-en():0;if(Ce=SB(he,Ce),Ce!==null){Ys=S,l.cancelPendingCommit=Ce(o$.bind(null,l,c,S,f,O,y,N,L,K,de,he,null,oe,ce)),Va(l,S,N,!le);return}}o$(l,c,S,f,O,y,N,L,K)}function DI(l){for(var c=l;;){var f=c.tag;if((f===0||f===11||f===15)&&c.flags&16384&&(f=c.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var O=0;O<f.length;O++){var y=f[O],S=y.getSnapshot;y=y.value;try{if(!$r(S(),y))return!1}catch{return!1}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Va(l,c,f,O){c&=~db,c&=~eo,l.suspendedLanes|=c,l.pingedLanes&=~c,O&&(l.warmLanes|=c),O=l.expirationTimes;for(var y=c;0<y;){var S=31-ot(y),N=1<<S;O[S]=-1,y&=~N}f!==0&&Kp(l,f,c)}function Km(){return(pt&6)===0?(of(0),!1):!0}function gb(){if(Ge!==null){if(bt===0)var l=Ge.return;else l=Ge,Rs=Vl=null,Py(l),Qc=null,Bd=0,l=Ge;for(;l!==null;)TE(l.alternate,l),l=l.return;Ge=null}}function Rc(l,c){var f=l.timeoutHandle;f!==-1&&(l.timeoutHandle=-1,iB(f)),f=l.cancelPendingCommit,f!==null&&(l.cancelPendingCommit=null,f()),Ys=0,gb(),Tt=l,Ge=f=_s(l.current,null),Je=c,bt=0,_r=null,Za=!1,Pc=Al(l,c),ub=!1,_c=Ar=db=eo=Ia=Ut=0,hr=af=null,fb=!1,(c&8)!==0&&(c|=c&32);var O=l.entangledLanes;if(O!==0)for(l=l.entanglements,O&=c;0<O;){var y=31-ot(O),S=1<<y;c|=l[y],O&=~S}return Vs=c,vm(),f}function t$(l,c){Be=null,_.H=Fd,c===kc||c===jm?(c=Oj(),bt=3):c===yy?(c=Oj(),bt=4):bt=c===Wy?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,_r=c,Ge===null&&(Ut=1,Zm(l,Fr(c,l.current)))}function n$(){var l=Tr.current;return l===null?!0:(Je&4194048)===Je?ti===null:(Je&62914560)===Je||(Je&536870912)!==0?l===ti:!1}function r$(){var l=_.H;return _.H=Fd,l===null?Fd:l}function i$(){var l=_.A;return _.A=MI,l}function Jm(){Ut=4,Za||(Je&4194048)!==Je&&Tr.current!==null||(Pc=!0),(Ia&134217727)===0&&(eo&134217727)===0||Tt===null||Va(Tt,Je,Ar,!1)}function Ob(l,c,f){var O=pt;pt|=2;var y=r$(),S=i$();(Tt!==l||Je!==c)&&(Fm=null,Rc(l,c)),c=!1;var N=Ut;e:do try{if(bt!==0&&Ge!==null){var L=Ge,K=_r;switch(bt){case 8:gb(),N=6;break e;case 3:case 2:case 9:case 6:Tr.current===null&&(c=!0);var le=bt;if(bt=0,_r=null,Mc(l,L,K,le),f&&Pc){N=0;break e}break;default:le=bt,bt=0,_r=null,Mc(l,L,K,le)}}LI(),N=Ut;break}catch(de){t$(l,de)}while(!0);return c&&l.shellSuspendCounter++,Rs=Vl=null,pt=O,_.H=y,_.A=S,Ge===null&&(Tt=null,Je=0,vm()),N}function LI(){for(;Ge!==null;)s$(Ge)}function XI(l,c){var f=pt;pt|=2;var O=r$(),y=i$();Tt!==l||Je!==c?(Fm=null,Gm=en()+500,Rc(l,c)):Pc=Al(l,c);e:do try{if(bt!==0&&Ge!==null){c=Ge;var S=_r;t:switch(bt){case 1:bt=0,_r=null,Mc(l,c,S,1);break;case 2:case 9:if(mj(S)){bt=0,_r=null,a$(c);break}c=function(){bt!==2&&bt!==9||Tt!==l||(bt=7),Fi(l)},S.then(c,c);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:mj(S)?(bt=0,_r=null,a$(c)):(bt=0,_r=null,Mc(l,c,S,7));break;case 5:var N=null;switch(Ge.tag){case 26:N=Ge.memoizedState;case 5:case 27:var L=Ge;if(N?V$(N):L.stateNode.complete){bt=0,_r=null;var K=L.sibling;if(K!==null)Ge=K;else{var le=L.return;le!==null?(Ge=le,eg(le)):Ge=null}break t}}bt=0,_r=null,Mc(l,c,S,5);break;case 6:bt=0,_r=null,Mc(l,c,S,6);break;case 8:gb(),Ut=6;break e;default:throw Error(r(462))}}ZI();break}catch(de){t$(l,de)}while(!0);return Rs=Vl=null,_.H=O,_.A=y,pt=f,Ge!==null?0:(Tt=null,Je=0,vm(),Ut)}function ZI(){for(;Ge!==null&&!Er();)s$(Ge)}function s$(l){var c=$E(l.alternate,l,Vs);l.memoizedProps=l.pendingProps,c===null?eg(l):Ge=c}function a$(l){var c=l,f=c.alternate;switch(c.tag){case 15:case 0:c=wE(f,c,c.pendingProps,c.type,void 0,Je);break;case 11:c=wE(f,c,c.pendingProps,c.type.render,c.ref,Je);break;case 5:Py(c);default:TE(f,c),c=Ge=ij(c,Vs),c=$E(f,c,Vs)}l.memoizedProps=l.pendingProps,c===null?eg(l):Ge=c}function Mc(l,c,f,O){Rs=Vl=null,Py(c),Qc=null,Bd=0;var y=c.return;try{if($I(l,y,c,f,Je)){Ut=1,Zm(l,Fr(f,l.current)),Ge=null;return}}catch(S){if(y!==null)throw Ge=y,S;Ut=1,Zm(l,Fr(f,l.current)),Ge=null;return}c.flags&32768?(nt||O===1?l=!0:Pc||(Je&536870912)!==0?l=!1:(Za=l=!0,(O===2||O===9||O===3||O===6)&&(O=Tr.current,O!==null&&O.tag===13&&(O.flags|=16384))),l$(c,l)):eg(c)}function eg(l){var c=l;do{if((c.flags&32768)!==0){l$(c,Za);return}l=c.return;var f=PI(c.alternate,c,Vs);if(f!==null){Ge=f;return}if(c=c.sibling,c!==null){Ge=c;return}Ge=c=l}while(c!==null);Ut===0&&(Ut=5)}function l$(l,c){do{var f=_I(l.alternate,l);if(f!==null){f.flags&=32767,Ge=f;return}if(f=l.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!c&&(l=l.sibling,l!==null)){Ge=l;return}Ge=l=f}while(l!==null);Ut=6,Ge=null}function o$(l,c,f,O,y,S,N,L,K){l.cancelPendingCommit=null;do tg();while(xn!==0);if((pt&6)!==0)throw Error(r(327));if(c!==null){if(c===l.current)throw Error(r(177));if(S=c.lanes|c.childLanes,S|=sy,Rv(l,f,S,N,L,K),l===Tt&&(Ge=Tt=null,Je=0),Ac=c,qa=l,Ys=f,hb=S,pb=y,FE=O,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,VI(Pe,function(){return h$(),null})):(l.callbackNode=null,l.callbackPriority=0),O=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||O){O=_.T,_.T=null,y=X.p,X.p=2,N=pt,pt|=4;try{AI(l,c,f)}finally{pt=N,X.p=y,_.T=O}}xn=1,c$(),u$(),d$()}}function c$(){if(xn===1){xn=0;var l=qa,c=Ac,f=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||f){f=_.T,_.T=null;var O=X.p;X.p=2;var y=pt;pt|=4;try{BE(c,l);var S=$b,N=HC(l.containerInfo),L=S.focusedElem,K=S.selectionRange;if(N!==L&&L&&L.ownerDocument&&WC(L.ownerDocument.documentElement,L)){if(K!==null&&ey(L)){var le=K.start,de=K.end;if(de===void 0&&(de=le),"selectionStart"in L)L.selectionStart=le,L.selectionEnd=Math.min(de,L.value.length);else{var he=L.ownerDocument||document,oe=he&&he.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Ce=L.textContent.length,Re=Math.min(K.start,Ce),Et=K.end===void 0?Re:Math.min(K.end,Ce);!ce.extend&&Re>Et&&(N=Et,Et=Re,Re=N);var re=UC(L,Re),ee=UC(L,Et);if(re&&ee&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==ee.node||ce.focusOffset!==ee.offset)){var ae=he.createRange();ae.setStart(re.node,re.offset),ce.removeAllRanges(),Re>Et?(ce.addRange(ae),ce.extend(ee.node,ee.offset)):(ae.setEnd(ee.node,ee.offset),ce.addRange(ae))}}}}for(he=[],ce=L;ce=ce.parentNode;)ce.nodeType===1&&he.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<he.length;L++){var fe=he[L];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}hg=!!Eb,$b=Eb=null}finally{pt=y,X.p=O,_.T=f}}l.current=c,xn=2}}function u$(){if(xn===2){xn=0;var l=qa,c=Ac,f=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||f){f=_.T,_.T=null;var O=X.p;X.p=2;var y=pt;pt|=4;try{DE(l,c.alternate,c)}finally{pt=y,X.p=O,_.T=f}}xn=3}}function d$(){if(xn===4||xn===3){xn=0,Ur();var l=qa,c=Ac,f=Ys,O=FE;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?xn=5:(xn=0,Ac=qa=null,f$(l,l.pendingLanes));var y=l.pendingLanes;if(y===0&&(Ba=null),Cd(f),c=c.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(kt,c,void 0,(c.current.flags&128)===128)}catch{}if(O!==null){c=_.T,y=X.p,X.p=2,_.T=null;try{for(var S=l.onRecoverableError,N=0;N<O.length;N++){var L=O[N];S(L.value,{componentStack:L.stack})}}finally{_.T=c,X.p=y}}(Ys&3)!==0&&tg(),Fi(l),y=l.pendingLanes,(f&261930)!==0&&(y&42)!==0?l===mb?lf++:(lf=0,mb=l):lf=0,of(0)}}function f$(l,c){(l.pooledCacheLanes&=c)===0&&(c=l.pooledCache,c!=null&&(l.pooledCache=null,Zd(c)))}function tg(){return c$(),u$(),d$(),h$()}function h$(){if(xn!==5)return!1;var l=qa,c=hb;hb=0;var f=Cd(Ys),O=_.T,y=X.p;try{X.p=32>f?32:f,_.T=null,f=pb,pb=null;var S=qa,N=Ys;if(xn=0,Ac=qa=null,Ys=0,(pt&6)!==0)throw Error(r(331));var L=pt;if(pt|=4,WE(S.current),VE(S,S.current,N,f),pt=L,of(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(kt,S)}catch{}return!0}finally{X.p=y,_.T=O,f$(l,c)}}function p$(l,c,f){c=Fr(f,c),c=Uy(l.stateNode,c,2),l=za(l,c,2),l!==null&&(Rl(l,2),Fi(l))}function St(l,c,f){if(l.tag===3)p$(l,l,f);else for(;c!==null;){if(c.tag===3){p$(c,l,f);break}else if(c.tag===1){var O=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof O.componentDidCatch=="function"&&(Ba===null||!Ba.has(O))){l=Fr(f,l),f=mE(2),O=za(c,f,2),O!==null&&(gE(f,O,c,l),Rl(O,2),Fi(O));break}}c=c.return}}function xb(l,c,f){var O=l.pingCache;if(O===null){O=l.pingCache=new zI;var y=new Set;O.set(c,y)}else y=O.get(c),y===void 0&&(y=new Set,O.set(c,y));y.has(f)||(ub=!0,y.add(f),l=II.bind(null,l,c,f),c.then(l,l))}function II(l,c,f){var O=l.pingCache;O!==null&&O.delete(c),l.pingedLanes|=l.suspendedLanes&f,l.warmLanes&=~f,Tt===l&&(Je&f)===f&&(Ut===4||Ut===3&&(Je&62914560)===Je&&300>en()-Hm?(pt&2)===0&&Rc(l,0):db|=f,_c===Je&&(_c=0)),Fi(l)}function m$(l,c){c===0&&(c=Fp()),l=Il(l,c),l!==null&&(Rl(l,c),Fi(l))}function BI(l){var c=l.memoizedState,f=0;c!==null&&(f=c.retryLane),m$(l,f)}function qI(l,c){var f=0;switch(l.tag){case 31:case 13:var O=l.stateNode,y=l.memoizedState;y!==null&&(f=y.retryLane);break;case 19:O=l.stateNode;break;case 22:O=l.stateNode._retryCache;break;default:throw Error(r(314))}O!==null&&O.delete(c),m$(l,f)}function VI(l,c){return jn(l,c)}var ng=null,zc=null,vb=!1,rg=!1,yb=!1,Ya=0;function Fi(l){l!==zc&&l.next===null&&(zc===null?ng=zc=l:zc=zc.next=l),rg=!0,vb||(vb=!0,UI())}function of(l,c){if(!yb&&rg){yb=!0;do for(var f=!1,O=ng;O!==null;){if(l!==0){var y=O.pendingLanes;if(y===0)var S=0;else{var N=O.suspendedLanes,L=O.pingedLanes;S=(1<<31-ot(42|l)+1)-1,S&=y&~(N&~L),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,v$(O,S))}else S=Je,S=ac(O,O===Tt?S:0,O.cancelPendingCommit!==null||O.timeoutHandle!==-1),(S&3)===0||Al(O,S)||(f=!0,v$(O,S));O=O.next}while(f);yb=!1}}function YI(){g$()}function g$(){rg=vb=!1;var l=0;Ya!==0&&rB()&&(l=Ya);for(var c=en(),f=null,O=ng;O!==null;){var y=O.next,S=O$(O,c);S===0?(O.next=null,f===null?ng=y:f.next=y,y===null&&(zc=f)):(f=O,(l!==0||(S&3)!==0)&&(rg=!0)),O=y}xn!==0&&xn!==5||of(l),Ya!==0&&(Ya=0)}function O$(l,c){for(var f=l.suspendedLanes,O=l.pingedLanes,y=l.expirationTimes,S=l.pendingLanes&-62914561;0<S;){var N=31-ot(S),L=1<<N,K=y[N];K===-1?((L&f)===0||(L&O)!==0)&&(y[N]=Av(L,c)):K<=c&&(l.expiredLanes|=L),S&=~L}if(c=Tt,f=Je,f=ac(l,l===c?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),O=l.callbackNode,f===0||l===c&&(bt===2||bt===9)||l.cancelPendingCommit!==null)return O!==null&&O!==null&&ar(O),l.callbackNode=null,l.callbackPriority=0;if((f&3)===0||Al(l,f)){if(c=f&-f,c===l.callbackPriority)return c;switch(O!==null&&ar(O),Cd(f)){case 2:case 8:f=ge;break;case 32:f=Pe;break;case 268435456:f=Ke;break;default:f=Pe}return O=x$.bind(null,l),f=jn(f,O),l.callbackPriority=c,l.callbackNode=f,c}return O!==null&&O!==null&&ar(O),l.callbackPriority=2,l.callbackNode=null,2}function x$(l,c){if(xn!==0&&xn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var f=l.callbackNode;if(tg()&&l.callbackNode!==f)return null;var O=Je;return O=ac(l,l===Tt?O:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),O===0?null:(JE(l,O,c),O$(l,en()),l.callbackNode!=null&&l.callbackNode===f?x$.bind(null,l):null)}function v$(l,c){if(tg())return null;JE(l,c,!0)}function UI(){sB(function(){(pt&6)!==0?jn(ue,YI):g$()})}function bb(){if(Ya===0){var l=Sc;l===0&&(l=Hr,Hr<<=1,(Hr&261888)===0&&(Hr=256)),Ya=l}return Ya}function y$(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:dm(""+l)}function b$(l,c){var f=c.ownerDocument.createElement("input");return f.name=c.name,f.value=c.value,l.id&&f.setAttribute("form",l.id),c.parentNode.insertBefore(f,c),l=new FormData(l),f.parentNode.removeChild(f),l}function WI(l,c,f,O,y){if(c==="submit"&&f&&f.stateNode===y){var S=y$((y[Ln]||null).action),N=O.submitter;N&&(c=(c=N[Ln]||null)?y$(c.formAction):N.getAttribute("formAction"),c!==null&&(S=c,N=null));var L=new mm("action","action",null,O,y);l.push({event:L,listeners:[{instance:null,listener:function(){if(O.defaultPrevented){if(Ya!==0){var K=N?b$(y,N):new FormData(y);Zy(f,{pending:!0,data:K,method:y.method,action:S},null,K)}}else typeof S=="function"&&(L.preventDefault(),K=N?b$(y,N):new FormData(y),Zy(f,{pending:!0,data:K,method:y.method,action:S},S,K))},currentTarget:y}]})}}for(var Sb=0;Sb<iy.length;Sb++){var wb=iy[Sb],HI=wb.toLowerCase(),GI=wb[0].toUpperCase()+wb.slice(1);Qi(HI,"on"+GI)}Qi(KC,"onAnimationEnd"),Qi(JC,"onAnimationIteration"),Qi(ej,"onAnimationStart"),Qi("dblclick","onDoubleClick"),Qi("focusin","onFocus"),Qi("focusout","onBlur"),Qi(fI,"onTransitionRun"),Qi(hI,"onTransitionStart"),Qi(pI,"onTransitionCancel"),Qi(tj,"onTransitionEnd"),Ea("onMouseEnter",["mouseout","mouseover"]),Ea("onMouseLeave",["mouseout","mouseover"]),Ea("onPointerEnter",["pointerout","pointerover"]),Ea("onPointerLeave",["pointerout","pointerover"]),$s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$s("onBeforeInput",["compositionend","keypress","textInput","paste"]),$s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),FI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cf));function S$(l,c){c=(c&4)!==0;for(var f=0;f<l.length;f++){var O=l[f],y=O.event;O=O.listeners;e:{var S=void 0;if(c)for(var N=O.length-1;0<=N;N--){var L=O[N],K=L.instance,le=L.currentTarget;if(L=L.listener,K!==S&&y.isPropagationStopped())break e;S=L,y.currentTarget=le;try{S(y)}catch(de){xm(de)}y.currentTarget=null,S=K}else for(N=0;N<O.length;N++){if(L=O[N],K=L.instance,le=L.currentTarget,L=L.listener,K!==S&&y.isPropagationStopped())break e;S=L,y.currentTarget=le;try{S(y)}catch(de){xm(de)}y.currentTarget=null,S=K}}}}function Fe(l,c){var f=c[lc];f===void 0&&(f=c[lc]=new Set);var O=l+"__bubble";f.has(O)||(w$(c,l,2,!1),f.add(O))}function kb(l,c,f){var O=0;c&&(O|=4),w$(f,l,O,c)}var ig="_reactListening"+Math.random().toString(36).slice(2);function Qb(l){if(!l[ig]){l[ig]=!0,sm.forEach(function(f){f!=="selectionchange"&&(FI.has(f)||kb(f,!1,l),kb(f,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[ig]||(c[ig]=!0,kb("selectionchange",!1,c))}}function w$(l,c,f,O){switch(K$(c)){case 2:var y=QB;break;case 8:y=CB;break;default:y=Xb}f=y.bind(null,c,f,l),y=void 0,!Vv||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(y=!0),O?y!==void 0?l.addEventListener(c,f,{capture:!0,passive:y}):l.addEventListener(c,f,!0):y!==void 0?l.addEventListener(c,f,{passive:y}):l.addEventListener(c,f,!1)}function Cb(l,c,f,O,y){var S=O;if((c&1)===0&&(c&2)===0&&O!==null)e:for(;;){if(O===null)return;var N=O.tag;if(N===3||N===4){var L=O.stateNode.containerInfo;if(L===y)break;if(N===4)for(N=O.return;N!==null;){var K=N.tag;if((K===3||K===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;L!==null;){if(N=ka(L),N===null)return;if(K=N.tag,K===5||K===6||K===26||K===27){O=S=N;continue e}L=L.parentNode}}O=O.return}EC(function(){var le=S,de=Bv(f),he=[];e:{var oe=nj.get(l);if(oe!==void 0){var ce=mm,Ce=l;switch(l){case"keypress":if(hm(f)===0)break e;case"keydown":case"keyup":ce=q6;break;case"focusin":Ce="focus",ce=Hv;break;case"focusout":Ce="blur",ce=Hv;break;case"beforeblur":case"afterblur":ce=Hv;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=TC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=P6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=U6;break;case KC:case JC:case ej:ce=R6;break;case tj:ce=H6;break;case"scroll":case"scrollend":ce=N6;break;case"wheel":ce=F6;break;case"copy":case"cut":case"paste":ce=z6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=_C;break;case"toggle":case"beforetoggle":ce=J6}var Re=(c&4)!==0,Et=!Re&&(l==="scroll"||l==="scrollend"),re=Re?oe!==null?oe+"Capture":null:oe;Re=[];for(var ee=le,ae;ee!==null;){var fe=ee;if(ae=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ae===null||re===null||(fe=Nd(ee,re),fe!=null&&Re.push(uf(ee,fe,ae))),Et)break;ee=ee.return}0<Re.length&&(oe=new ce(oe,Ce,null,f,de),he.push({event:oe,listeners:Re}))}}if((c&7)===0){e:{if(oe=l==="mouseover"||l==="pointerover",ce=l==="mouseout"||l==="pointerout",oe&&f!==Iv&&(Ce=f.relatedTarget||f.fromElement)&&(ka(Ce)||Ce[Es]))break e;if((ce||oe)&&(oe=de.window===de?de:(oe=de.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Ce=f.relatedTarget||f.toElement,ce=le,Ce=Ce?ka(Ce):null,Ce!==null&&(Et=s(Ce),Re=Ce.tag,Ce!==Et||Re!==5&&Re!==27&&Re!==6)&&(Ce=null)):(ce=null,Ce=le),ce!==Ce)){if(Re=TC,fe="onMouseLeave",re="onMouseEnter",ee="mouse",(l==="pointerout"||l==="pointerover")&&(Re=_C,fe="onPointerLeave",re="onPointerEnter",ee="pointer"),Et=ce==null?oe:Ca(ce),ae=Ce==null?oe:Ca(Ce),oe=new Re(fe,ee+"leave",ce,f,de),oe.target=Et,oe.relatedTarget=ae,fe=null,ka(de)===le&&(Re=new Re(re,ee+"enter",Ce,f,de),Re.target=ae,Re.relatedTarget=Et,fe=Re),Et=fe,ce&&Ce)t:{for(Re=KI,re=ce,ee=Ce,ae=0,fe=re;fe;fe=Re(fe))ae++;fe=0;for(var Ne=ee;Ne;Ne=Re(Ne))fe++;for(;0<ae-fe;)re=Re(re),ae--;for(;0<fe-ae;)ee=Re(ee),fe--;for(;ae--;){if(re===ee||ee!==null&&re===ee.alternate){Re=re;break t}re=Re(re),ee=Re(ee)}Re=null}else Re=null;ce!==null&&k$(he,oe,ce,Re,!1),Ce!==null&&Et!==null&&k$(he,Et,Ce,Re,!0)}}e:{if(oe=le?Ca(le):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var ct=ZC;else if(LC(oe))if(IC)ct=cI;else{ct=lI;var je=aI}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?le&&Zv(le.elementType)&&(ct=ZC):ct=oI;if(ct&&(ct=ct(l,le))){XC(he,ct,f,de);break e}je&&je(l,oe,le),l==="focusout"&&le&&oe.type==="number"&&le.memoizedProps.value!=null&&$d(oe,"number",oe.value)}switch(je=le?Ca(le):window,l){case"focusin":(LC(je)||je.contentEditable==="true")&&(pc=je,ty=le,Dd=null);break;case"focusout":Dd=ty=pc=null;break;case"mousedown":ny=!0;break;case"contextmenu":case"mouseup":case"dragend":ny=!1,GC(he,f,de);break;case"selectionchange":if(dI)break;case"keydown":case"keyup":GC(he,f,de)}var Ye;if(Fv)e:{switch(l){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else hc?zC(l,f)&&(et="onCompositionEnd"):l==="keydown"&&f.keyCode===229&&(et="onCompositionStart");et&&(AC&&f.locale!=="ko"&&(hc||et!=="onCompositionStart"?et==="onCompositionEnd"&&hc&&(Ye=$C()):(Na=de,Yv="value"in Na?Na.value:Na.textContent,hc=!0)),je=sg(le,et),0<je.length&&(et=new PC(et,l,null,f,de),he.push({event:et,listeners:je}),Ye?et.data=Ye:(Ye=DC(f),Ye!==null&&(et.data=Ye)))),(Ye=tI?nI(l,f):rI(l,f))&&(et=sg(le,"onBeforeInput"),0<et.length&&(je=new PC("onBeforeInput","beforeinput",null,f,de),he.push({event:je,listeners:et}),je.data=Ye)),WI(he,l,le,f,de)}S$(he,c)})}function uf(l,c,f){return{instance:l,listener:c,currentTarget:f}}function sg(l,c){for(var f=c+"Capture",O=[];l!==null;){var y=l,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Nd(l,f),y!=null&&O.unshift(uf(l,y,S)),y=Nd(l,c),y!=null&&O.push(uf(l,y,S))),l.tag===3)return O;l=l.return}return[]}function KI(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function k$(l,c,f,O,y){for(var S=c._reactName,N=[];f!==null&&f!==O;){var L=f,K=L.alternate,le=L.stateNode;if(L=L.tag,K!==null&&K===O)break;L!==5&&L!==26&&L!==27||le===null||(K=le,y?(le=Nd(f,S),le!=null&&N.unshift(uf(f,le,K))):y||(le=Nd(f,S),le!=null&&N.push(uf(f,le,K)))),f=f.return}N.length!==0&&l.push({event:c,listeners:N})}var JI=/\r\n?/g,eB=/\u0000|\uFFFD/g;function Q$(l){return(typeof l=="string"?l:""+l).replace(JI,`
49
+ `).replace(eB,"")}function C$(l,c){return c=Q$(c),Q$(l)===c}function jt(l,c,f,O,y,S){switch(f){case"children":typeof O=="string"?c==="body"||c==="textarea"&&O===""||uc(l,O):(typeof O=="number"||typeof O=="bigint")&&c!=="body"&&uc(l,""+O);break;case"className":cc(l,"class",O);break;case"tabIndex":cc(l,"tabindex",O);break;case"dir":case"role":case"viewBox":case"width":case"height":cc(l,f,O);break;case"style":CC(l,O,S);break;case"data":if(c!=="object"){cc(l,"data",O);break}case"src":case"href":if(O===""&&(c!=="a"||f!=="href")){l.removeAttribute(f);break}if(O==null||typeof O=="function"||typeof O=="symbol"||typeof O=="boolean"){l.removeAttribute(f);break}O=dm(""+O),l.setAttribute(f,O);break;case"action":case"formAction":if(typeof O=="function"){l.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(c!=="input"&&jt(l,c,"name",y.name,y,null),jt(l,c,"formEncType",y.formEncType,y,null),jt(l,c,"formMethod",y.formMethod,y,null),jt(l,c,"formTarget",y.formTarget,y,null)):(jt(l,c,"encType",y.encType,y,null),jt(l,c,"method",y.method,y,null),jt(l,c,"target",y.target,y,null)));if(O==null||typeof O=="symbol"||typeof O=="boolean"){l.removeAttribute(f);break}O=dm(""+O),l.setAttribute(f,O);break;case"onClick":O!=null&&(l.onclick=Ts);break;case"onScroll":O!=null&&Fe("scroll",l);break;case"onScrollEnd":O!=null&&Fe("scrollend",l);break;case"dangerouslySetInnerHTML":if(O!=null){if(typeof O!="object"||!("__html"in O))throw Error(r(61));if(f=O.__html,f!=null){if(y.children!=null)throw Error(r(60));l.innerHTML=f}}break;case"multiple":l.multiple=O&&typeof O!="function"&&typeof O!="symbol";break;case"muted":l.muted=O&&typeof O!="function"&&typeof O!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(O==null||typeof O=="function"||typeof O=="boolean"||typeof O=="symbol"){l.removeAttribute("xlink:href");break}f=dm(""+O),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":O!=null&&typeof O!="function"&&typeof O!="symbol"?l.setAttribute(f,""+O):l.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":O&&typeof O!="function"&&typeof O!="symbol"?l.setAttribute(f,""):l.removeAttribute(f);break;case"capture":case"download":O===!0?l.setAttribute(f,""):O!==!1&&O!=null&&typeof O!="function"&&typeof O!="symbol"?l.setAttribute(f,O):l.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":O!=null&&typeof O!="function"&&typeof O!="symbol"&&!isNaN(O)&&1<=O?l.setAttribute(f,O):l.removeAttribute(f);break;case"rowSpan":case"start":O==null||typeof O=="function"||typeof O=="symbol"||isNaN(O)?l.removeAttribute(f):l.setAttribute(f,O);break;case"popover":Fe("beforetoggle",l),Fe("toggle",l),oc(l,"popover",O);break;case"xlinkActuate":ki(l,"http://www.w3.org/1999/xlink","xlink:actuate",O);break;case"xlinkArcrole":ki(l,"http://www.w3.org/1999/xlink","xlink:arcrole",O);break;case"xlinkRole":ki(l,"http://www.w3.org/1999/xlink","xlink:role",O);break;case"xlinkShow":ki(l,"http://www.w3.org/1999/xlink","xlink:show",O);break;case"xlinkTitle":ki(l,"http://www.w3.org/1999/xlink","xlink:title",O);break;case"xlinkType":ki(l,"http://www.w3.org/1999/xlink","xlink:type",O);break;case"xmlBase":ki(l,"http://www.w3.org/XML/1998/namespace","xml:base",O);break;case"xmlLang":ki(l,"http://www.w3.org/XML/1998/namespace","xml:lang",O);break;case"xmlSpace":ki(l,"http://www.w3.org/XML/1998/namespace","xml:space",O);break;case"is":oc(l,"is",O);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=E6.get(f)||f,oc(l,f,O))}}function jb(l,c,f,O,y,S){switch(f){case"style":CC(l,O,S);break;case"dangerouslySetInnerHTML":if(O!=null){if(typeof O!="object"||!("__html"in O))throw Error(r(61));if(f=O.__html,f!=null){if(y.children!=null)throw Error(r(60));l.innerHTML=f}}break;case"children":typeof O=="string"?uc(l,O):(typeof O=="number"||typeof O=="bigint")&&uc(l,""+O);break;case"onScroll":O!=null&&Fe("scroll",l);break;case"onScrollEnd":O!=null&&Fe("scrollend",l);break;case"onClick":O!=null&&(l.onclick=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!am.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(y=f.endsWith("Capture"),c=f.slice(2,y?f.length-7:void 0),S=l[Ln]||null,S=S!=null?S[f]:null,typeof S=="function"&&l.removeEventListener(c,S,y),typeof O=="function")){typeof S!="function"&&S!==null&&(f in l?l[f]=null:l.hasAttribute(f)&&l.removeAttribute(f)),l.addEventListener(c,O,y);break e}f in l?l[f]=O:O===!0?l.setAttribute(f,""):oc(l,f,O)}}}function Pn(l,c,f){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",l),Fe("load",l);var O=!1,y=!1,S;for(S in f)if(f.hasOwnProperty(S)){var N=f[S];if(N!=null)switch(S){case"src":O=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:jt(l,c,S,N,f,null)}}y&&jt(l,c,"srcSet",f.srcSet,f,null),O&&jt(l,c,"src",f.src,f,null);return;case"input":Fe("invalid",l);var L=S=N=y=null,K=null,le=null;for(O in f)if(f.hasOwnProperty(O)){var de=f[O];if(de!=null)switch(O){case"name":y=de;break;case"type":N=de;break;case"checked":K=de;break;case"defaultChecked":le=de;break;case"value":S=de;break;case"defaultValue":L=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,c));break;default:jt(l,c,O,de,f,null)}}um(l,S,L,K,le,N,y,!1);return;case"select":Fe("invalid",l),O=N=S=null;for(y in f)if(f.hasOwnProperty(y)&&(L=f[y],L!=null))switch(y){case"value":S=L;break;case"defaultValue":N=L;break;case"multiple":O=L;default:jt(l,c,y,L,f,null)}c=S,f=N,l.multiple=!!O,c!=null?Ns(l,!!O,c,!1):f!=null&&Ns(l,!!O,f,!0);return;case"textarea":Fe("invalid",l),S=y=O=null;for(N in f)if(f.hasOwnProperty(N)&&(L=f[N],L!=null))switch(N){case"value":O=L;break;case"defaultValue":y=L;break;case"children":S=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:jt(l,c,N,L,f,null)}kC(l,O,y,S);return;case"option":for(K in f)if(f.hasOwnProperty(K)&&(O=f[K],O!=null))switch(K){case"selected":l.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:jt(l,c,K,O,f,null)}return;case"dialog":Fe("beforetoggle",l),Fe("toggle",l),Fe("cancel",l),Fe("close",l);break;case"iframe":case"object":Fe("load",l);break;case"video":case"audio":for(O=0;O<cf.length;O++)Fe(cf[O],l);break;case"image":Fe("error",l),Fe("load",l);break;case"details":Fe("toggle",l);break;case"embed":case"source":case"link":Fe("error",l),Fe("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in f)if(f.hasOwnProperty(le)&&(O=f[le],O!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:jt(l,c,le,O,f,null)}return;default:if(Zv(c)){for(de in f)f.hasOwnProperty(de)&&(O=f[de],O!==void 0&&jb(l,c,de,O,f,void 0));return}}for(L in f)f.hasOwnProperty(L)&&(O=f[L],O!=null&&jt(l,c,L,O,f,null))}function tB(l,c,f,O){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,N=null,L=null,K=null,le=null,de=null;for(ce in f){var he=f[ce];if(f.hasOwnProperty(ce)&&he!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":K=he;default:O.hasOwnProperty(ce)||jt(l,c,ce,null,O,he)}}for(var oe in O){var ce=O[oe];if(he=f[oe],O.hasOwnProperty(oe)&&(ce!=null||he!=null))switch(oe){case"type":S=ce;break;case"name":y=ce;break;case"checked":le=ce;break;case"defaultChecked":de=ce;break;case"value":N=ce;break;case"defaultValue":L=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,c));break;default:ce!==he&&jt(l,c,oe,ce,O,he)}}Dl(l,N,L,K,le,de,S,y);return;case"select":ce=N=L=oe=null;for(S in f)if(K=f[S],f.hasOwnProperty(S)&&K!=null)switch(S){case"value":break;case"multiple":ce=K;default:O.hasOwnProperty(S)||jt(l,c,S,null,O,K)}for(y in O)if(S=O[y],K=f[y],O.hasOwnProperty(y)&&(S!=null||K!=null))switch(y){case"value":oe=S;break;case"defaultValue":L=S;break;case"multiple":N=S;default:S!==K&&jt(l,c,y,S,O,K)}c=L,f=N,O=ce,oe!=null?Ns(l,!!f,oe,!1):!!O!=!!f&&(c!=null?Ns(l,!!f,c,!0):Ns(l,!!f,f?[]:"",!1));return;case"textarea":ce=oe=null;for(L in f)if(y=f[L],f.hasOwnProperty(L)&&y!=null&&!O.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:jt(l,c,L,null,O,y)}for(N in O)if(y=O[N],S=f[N],O.hasOwnProperty(N)&&(y!=null||S!=null))switch(N){case"value":oe=y;break;case"defaultValue":ce=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&jt(l,c,N,y,O,S)}wC(l,oe,ce);return;case"option":for(var Ce in f)if(oe=f[Ce],f.hasOwnProperty(Ce)&&oe!=null&&!O.hasOwnProperty(Ce))switch(Ce){case"selected":l.selected=!1;break;default:jt(l,c,Ce,null,O,oe)}for(K in O)if(oe=O[K],ce=f[K],O.hasOwnProperty(K)&&oe!==ce&&(oe!=null||ce!=null))switch(K){case"selected":l.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:jt(l,c,K,oe,O,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in f)oe=f[Re],f.hasOwnProperty(Re)&&oe!=null&&!O.hasOwnProperty(Re)&&jt(l,c,Re,null,O,oe);for(le in O)if(oe=O[le],ce=f[le],O.hasOwnProperty(le)&&oe!==ce&&(oe!=null||ce!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,c));break;default:jt(l,c,le,oe,O,ce)}return;default:if(Zv(c)){for(var Et in f)oe=f[Et],f.hasOwnProperty(Et)&&oe!==void 0&&!O.hasOwnProperty(Et)&&jb(l,c,Et,void 0,O,oe);for(de in O)oe=O[de],ce=f[de],!O.hasOwnProperty(de)||oe===ce||oe===void 0&&ce===void 0||jb(l,c,de,oe,O,ce);return}}for(var re in f)oe=f[re],f.hasOwnProperty(re)&&oe!=null&&!O.hasOwnProperty(re)&&jt(l,c,re,null,O,oe);for(he in O)oe=O[he],ce=f[he],!O.hasOwnProperty(he)||oe===ce||oe==null&&ce==null||jt(l,c,he,oe,O,ce)}function j$(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nB(){if(typeof performance.getEntriesByType=="function"){for(var l=0,c=0,f=performance.getEntriesByType("resource"),O=0;O<f.length;O++){var y=f[O],S=y.transferSize,N=y.initiatorType,L=y.duration;if(S&&L&&j$(N)){for(N=0,L=y.responseEnd,O+=1;O<f.length;O++){var K=f[O],le=K.startTime;if(le>L)break;var de=K.transferSize,he=K.initiatorType;de&&j$(he)&&(K=K.responseEnd,N+=de*(K<L?1:(L-le)/(K-le)))}if(--O,c+=8*(S+N)/(y.duration/1e3),l++,10<l)break}}if(0<l)return c/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var Eb=null,$b=null;function ag(l){return l.nodeType===9?l:l.ownerDocument}function E$(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $$(l,c){if(l===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&c==="foreignObject"?0:l}function Nb(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Tb=null;function rB(){var l=window.event;return l&&l.type==="popstate"?l===Tb?!1:(Tb=l,!0):(Tb=null,!1)}var N$=typeof setTimeout=="function"?setTimeout:void 0,iB=typeof clearTimeout=="function"?clearTimeout:void 0,T$=typeof Promise=="function"?Promise:void 0,sB=typeof queueMicrotask=="function"?queueMicrotask:typeof T$<"u"?function(l){return T$.resolve(null).then(l).catch(aB)}:N$;function aB(l){setTimeout(function(){throw l})}function Ua(l){return l==="head"}function P$(l,c){var f=c,O=0;do{var y=f.nextSibling;if(l.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"||f==="/&"){if(O===0){l.removeChild(y),Zc(c);return}O--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")O++;else if(f==="html")df(l.ownerDocument.documentElement);else if(f==="head"){f=l.ownerDocument.head,df(f);for(var S=f.firstChild;S;){var N=S.nextSibling,L=S.nodeName;S[Ml]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=N}}else f==="body"&&df(l.ownerDocument.body);f=y}while(f);Zc(c)}function _$(l,c){var f=l;l=0;do{var O=f.nextSibling;if(f.nodeType===1?c?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(c?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),O&&O.nodeType===8)if(f=O.data,f==="/$"){if(l===0)break;l--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||l++;f=O}while(f)}function Pb(l){var c=l.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var f=c;switch(c=c.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Pb(f),jd(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}l.removeChild(f)}}function lB(l,c,f,O){for(;l.nodeType===1;){var y=f;if(l.nodeName.toLowerCase()!==c.toLowerCase()){if(!O&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(O){if(!l[Ml])switch(c){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(S=l.getAttribute("rel"),S==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(S!==y.rel||l.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||l.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||l.getAttribute("title")!==(y.title==null?null:y.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(S=l.getAttribute("src"),(S!==(y.src==null?null:y.src)||l.getAttribute("type")!==(y.type==null?null:y.type)||l.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(c==="input"&&l.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&l.getAttribute("name")===S)return l}else return l;if(l=ni(l.nextSibling),l===null)break}return null}function oB(l,c,f){if(c==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!f||(l=ni(l.nextSibling),l===null))return null;return l}function A$(l,c){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!c||(l=ni(l.nextSibling),l===null))return null;return l}function _b(l){return l.data==="$?"||l.data==="$~"}function Ab(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function cB(l,c){var f=l.ownerDocument;if(l.data==="$~")l._reactRetry=c;else if(l.data!=="$?"||f.readyState!=="loading")c();else{var O=function(){c(),f.removeEventListener("DOMContentLoaded",O)};f.addEventListener("DOMContentLoaded",O),l._reactRetry=O}}function ni(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return l}var Rb=null;function R$(l){l=l.nextSibling;for(var c=0;l;){if(l.nodeType===8){var f=l.data;if(f==="/$"||f==="/&"){if(c===0)return ni(l.nextSibling);c--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||c++}l=l.nextSibling}return null}function M$(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var f=l.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(c===0)return l;c--}else f!=="/$"&&f!=="/&"||c++}l=l.previousSibling}return null}function z$(l,c,f){switch(c=ag(f),l){case"html":if(l=c.documentElement,!l)throw Error(r(452));return l;case"head":if(l=c.head,!l)throw Error(r(453));return l;case"body":if(l=c.body,!l)throw Error(r(454));return l;default:throw Error(r(451))}}function df(l){for(var c=l.attributes;c.length;)l.removeAttributeNode(c[0]);jd(l)}var ri=new Map,D$=new Set;function lg(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var Us=X.d;X.d={f:uB,r:dB,D:fB,C:hB,L:pB,m:mB,X:OB,S:gB,M:xB};function uB(){var l=Us.f(),c=Km();return l||c}function dB(l){var c=Qa(l);c!==null&&c.tag===5&&c.type==="form"?tE(c):Us.r(l)}var Dc=typeof document>"u"?null:document;function L$(l,c,f){var O=Dc;if(O&&typeof c=="string"&&c){var y=or(c);y='link[rel="'+l+'"][href="'+y+'"]',typeof f=="string"&&(y+='[crossorigin="'+f+'"]'),D$.has(y)||(D$.add(y),l={rel:l,crossOrigin:f,href:c},O.querySelector(y)===null&&(c=O.createElement("link"),Pn(c,"link",l),on(c),O.head.appendChild(c)))}}function fB(l){Us.D(l),L$("dns-prefetch",l,null)}function hB(l,c){Us.C(l,c),L$("preconnect",l,c)}function pB(l,c,f){Us.L(l,c,f);var O=Dc;if(O&&l&&c){var y='link[rel="preload"][as="'+or(c)+'"]';c==="image"&&f&&f.imageSrcSet?(y+='[imagesrcset="'+or(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(y+='[imagesizes="'+or(f.imageSizes)+'"]')):y+='[href="'+or(l)+'"]';var S=y;switch(c){case"style":S=Lc(l);break;case"script":S=Xc(l)}ri.has(S)||(l=m({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:l,as:c},f),ri.set(S,l),O.querySelector(y)!==null||c==="style"&&O.querySelector(ff(S))||c==="script"&&O.querySelector(hf(S))||(c=O.createElement("link"),Pn(c,"link",l),on(c),O.head.appendChild(c)))}}function mB(l,c){Us.m(l,c);var f=Dc;if(f&&l){var O=c&&typeof c.as=="string"?c.as:"script",y='link[rel="modulepreload"][as="'+or(O)+'"][href="'+or(l)+'"]',S=y;switch(O){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Xc(l)}if(!ri.has(S)&&(l=m({rel:"modulepreload",href:l},c),ri.set(S,l),f.querySelector(y)===null)){switch(O){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(hf(S)))return}O=f.createElement("link"),Pn(O,"link",l),on(O),f.head.appendChild(O)}}}function gB(l,c,f){Us.S(l,c,f);var O=Dc;if(O&&l){var y=ja(O).hoistableStyles,S=Lc(l);c=c||"default";var N=y.get(S);if(!N){var L={loading:0,preload:null};if(N=O.querySelector(ff(S)))L.loading=5;else{l=m({rel:"stylesheet",href:l,"data-precedence":c},f),(f=ri.get(S))&&Mb(l,f);var K=N=O.createElement("link");on(K),Pn(K,"link",l),K._p=new Promise(function(le,de){K.onload=le,K.onerror=de}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,og(N,c,O)}N={type:"stylesheet",instance:N,count:1,state:L},y.set(S,N)}}}function OB(l,c){Us.X(l,c);var f=Dc;if(f&&l){var O=ja(f).hoistableScripts,y=Xc(l),S=O.get(y);S||(S=f.querySelector(hf(y)),S||(l=m({src:l,async:!0},c),(c=ri.get(y))&&zb(l,c),S=f.createElement("script"),on(S),Pn(S,"link",l),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},O.set(y,S))}}function xB(l,c){Us.M(l,c);var f=Dc;if(f&&l){var O=ja(f).hoistableScripts,y=Xc(l),S=O.get(y);S||(S=f.querySelector(hf(y)),S||(l=m({src:l,async:!0,type:"module"},c),(c=ri.get(y))&&zb(l,c),S=f.createElement("script"),on(S),Pn(S,"link",l),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},O.set(y,S))}}function X$(l,c,f,O){var y=(y=J.current)?lg(y):null;if(!y)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=Lc(f.href),f=ja(y).hoistableStyles,O=f.get(c),O||(O={type:"style",instance:null,count:0,state:null},f.set(c,O)),O):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){l=Lc(f.href);var S=ja(y).hoistableStyles,N=S.get(l);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(l,N),(S=y.querySelector(ff(l)))&&!S._p&&(N.instance=S,N.state.loading=5),ri.has(l)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},ri.set(l,f),S||vB(y,l,f,N.state))),c&&O===null)throw Error(r(528,""));return N}if(c&&O!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Xc(f),f=ja(y).hoistableScripts,O=f.get(c),O||(O={type:"script",instance:null,count:0,state:null},f.set(c,O)),O):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function Lc(l){return'href="'+or(l)+'"'}function ff(l){return'link[rel="stylesheet"]['+l+"]"}function Z$(l){return m({},l,{"data-precedence":l.precedence,precedence:null})}function vB(l,c,f,O){l.querySelector('link[rel="preload"][as="style"]['+c+"]")?O.loading=1:(c=l.createElement("link"),O.preload=c,c.addEventListener("load",function(){return O.loading|=1}),c.addEventListener("error",function(){return O.loading|=2}),Pn(c,"link",f),on(c),l.head.appendChild(c))}function Xc(l){return'[src="'+or(l)+'"]'}function hf(l){return"script[async]"+l}function I$(l,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var O=l.querySelector('style[data-href~="'+or(f.href)+'"]');if(O)return c.instance=O,on(O),O;var y=m({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return O=(l.ownerDocument||l).createElement("style"),on(O),Pn(O,"style",y),og(O,f.precedence,l),c.instance=O;case"stylesheet":y=Lc(f.href);var S=l.querySelector(ff(y));if(S)return c.state.loading|=4,c.instance=S,on(S),S;O=Z$(f),(y=ri.get(y))&&Mb(O,y),S=(l.ownerDocument||l).createElement("link"),on(S);var N=S;return N._p=new Promise(function(L,K){N.onload=L,N.onerror=K}),Pn(S,"link",O),c.state.loading|=4,og(S,f.precedence,l),c.instance=S;case"script":return S=Xc(f.src),(y=l.querySelector(hf(S)))?(c.instance=y,on(y),y):(O=f,(y=ri.get(S))&&(O=m({},f),zb(O,y)),l=l.ownerDocument||l,y=l.createElement("script"),on(y),Pn(y,"link",O),l.head.appendChild(y),c.instance=y);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(O=c.instance,c.state.loading|=4,og(O,f.precedence,l));return c.instance}function og(l,c,f){for(var O=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=O.length?O[O.length-1]:null,S=y,N=0;N<O.length;N++){var L=O[N];if(L.dataset.precedence===c)S=L;else if(S!==y)break}S?S.parentNode.insertBefore(l,S.nextSibling):(c=f.nodeType===9?f.head:f,c.insertBefore(l,c.firstChild))}function Mb(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.title==null&&(l.title=c.title)}function zb(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.integrity==null&&(l.integrity=c.integrity)}var cg=null;function B$(l,c,f){if(cg===null){var O=new Map,y=cg=new Map;y.set(f,O)}else y=cg,O=y.get(f),O||(O=new Map,y.set(f,O));if(O.has(l))return O;for(O.set(l,null),f=f.getElementsByTagName(l),y=0;y<f.length;y++){var S=f[y];if(!(S[Ml]||S[On]||l==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var N=S.getAttribute(c)||"";N=l+N;var L=O.get(N);L?L.push(S):O.set(N,[S])}}return O}function q$(l,c,f){l=l.ownerDocument||l,l.head.insertBefore(f,c==="title"?l.querySelector("head > title"):null)}function yB(l,c,f){if(f===1||c.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return l=c.disabled,typeof c.precedence=="string"&&l==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function V$(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function bB(l,c,f,O){if(f.type==="stylesheet"&&(typeof O.media!="string"||matchMedia(O.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var y=Lc(O.href),S=c.querySelector(ff(y));if(S){c=S._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(l.count++,l=ug.bind(l),c.then(l,l)),f.state.loading|=4,f.instance=S,on(S);return}S=c.ownerDocument||c,O=Z$(O),(y=ri.get(y))&&Mb(O,y),S=S.createElement("link"),on(S);var N=S;N._p=new Promise(function(L,K){N.onload=L,N.onerror=K}),Pn(S,"link",O),f.instance=S}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(l.count++,f=ug.bind(l),c.addEventListener("load",f),c.addEventListener("error",f))}}var Db=0;function SB(l,c){return l.stylesheets&&l.count===0&&fg(l,l.stylesheets),0<l.count||0<l.imgCount?function(f){var O=setTimeout(function(){if(l.stylesheets&&fg(l,l.stylesheets),l.unsuspend){var S=l.unsuspend;l.unsuspend=null,S()}},6e4+c);0<l.imgBytes&&Db===0&&(Db=62500*nB());var y=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&fg(l,l.stylesheets),l.unsuspend)){var S=l.unsuspend;l.unsuspend=null,S()}},(l.imgBytes>Db?50:800)+c);return l.unsuspend=f,function(){l.unsuspend=null,clearTimeout(O),clearTimeout(y)}}:null}function ug(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fg(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var dg=null;function fg(l,c){l.stylesheets=null,l.unsuspend!==null&&(l.count++,dg=new Map,c.forEach(wB,l),dg=null,ug.call(l))}function wB(l,c){if(!(c.state.loading&4)){var f=dg.get(l);if(f)var O=f.get(null);else{f=new Map,dg.set(l,f);for(var y=l.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var N=y[S];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(f.set(N.dataset.precedence,N),O=N)}O&&f.set(null,O)}y=c.instance,N=y.getAttribute("data-precedence"),S=f.get(N)||O,S===O&&f.set(null,y),f.set(N,y),this.count++,O=ug.bind(this),y.addEventListener("load",O),y.addEventListener("error",O),S?S.parentNode.insertBefore(y,S.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(y,l.firstChild)),c.state.loading|=4}}var pf={$$typeof:Q,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function kB(l,c,f,O,y,S,N,L,K){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kd(0),this.hiddenUpdates=kd(null),this.identifierPrefix=O,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function Y$(l,c,f,O,y,S,N,L,K,le,de,he){return l=new kB(l,c,f,N,K,le,de,he,L),c=1,S===!0&&(c|=24),S=Nr(3,null,null,c),l.current=S,S.stateNode=l,c=Oy(),c.refCount++,l.pooledCache=c,c.refCount++,S.memoizedState={element:O,isDehydrated:f,cache:c},by(S),l}function U$(l){return l?(l=Oc,l):Oc}function W$(l,c,f,O,y,S){y=U$(y),O.context===null?O.context=y:O.pendingContext=y,O=Ma(c),O.payload={element:f},S=S===void 0?null:S,S!==null&&(O.callback=S),f=za(l,O,c),f!==null&&(pr(f,l,c),Vd(f,l,c))}function H$(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var f=l.retryLane;l.retryLane=f!==0&&f<c?f:c}}function Lb(l,c){H$(l,c),(l=l.alternate)&&H$(l,c)}function G$(l){if(l.tag===13||l.tag===31){var c=Il(l,67108864);c!==null&&pr(c,l,67108864),Lb(l,67108864)}}function F$(l){if(l.tag===13||l.tag===31){var c=Rr();c=Qd(c);var f=Il(l,c);f!==null&&pr(f,l,c),Lb(l,c)}}var hg=!0;function QB(l,c,f,O){var y=_.T;_.T=null;var S=X.p;try{X.p=2,Xb(l,c,f,O)}finally{X.p=S,_.T=y}}function CB(l,c,f,O){var y=_.T;_.T=null;var S=X.p;try{X.p=8,Xb(l,c,f,O)}finally{X.p=S,_.T=y}}function Xb(l,c,f,O){if(hg){var y=Zb(O);if(y===null)Cb(l,c,O,pg,f),J$(l,O);else if(EB(y,l,c,f,O))O.stopPropagation();else if(J$(l,O),c&4&&-1<jB.indexOf(l)){for(;y!==null;){var S=Qa(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var N=js(S.pendingLanes);if(N!==0){var L=S;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var K=1<<31-ot(N);L.entanglements[1]|=K,N&=~K}Fi(S),(pt&6)===0&&(Gm=en()+500,of(0))}}break;case 31:case 13:L=Il(S,2),L!==null&&pr(L,S,2),Km(),Lb(S,2)}if(S=Zb(O),S===null&&Cb(l,c,O,pg,f),S===y)break;y=S}y!==null&&O.stopPropagation()}else Cb(l,c,O,null,f)}}function Zb(l){return l=Bv(l),Ib(l)}var pg=null;function Ib(l){if(pg=null,l=ka(l),l!==null){var c=s(l);if(c===null)l=null;else{var f=c.tag;if(f===13){if(l=a(c),l!==null)return l;l=null}else if(f===31){if(l=o(c),l!==null)return l;l=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null)}}return pg=l,null}function K$(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(wi()){case ue:return 2;case ge:return 8;case Pe:case Ie:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var Bb=!1,Wa=null,Ha=null,Ga=null,mf=new Map,gf=new Map,Fa=[],jB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function J$(l,c){switch(l){case"focusin":case"focusout":Wa=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":mf.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":gf.delete(c.pointerId)}}function Of(l,c,f,O,y,S){return l===null||l.nativeEvent!==S?(l={blockedOn:c,domEventName:f,eventSystemFlags:O,nativeEvent:S,targetContainers:[y]},c!==null&&(c=Qa(c),c!==null&&G$(c)),l):(l.eventSystemFlags|=O,c=l.targetContainers,y!==null&&c.indexOf(y)===-1&&c.push(y),l)}function EB(l,c,f,O,y){switch(c){case"focusin":return Wa=Of(Wa,l,c,f,O,y),!0;case"dragenter":return Ha=Of(Ha,l,c,f,O,y),!0;case"mouseover":return Ga=Of(Ga,l,c,f,O,y),!0;case"pointerover":var S=y.pointerId;return mf.set(S,Of(mf.get(S)||null,l,c,f,O,y)),!0;case"gotpointercapture":return S=y.pointerId,gf.set(S,Of(gf.get(S)||null,l,c,f,O,y)),!0}return!1}function eN(l){var c=ka(l.target);if(c!==null){var f=s(c);if(f!==null){if(c=f.tag,c===13){if(c=a(f),c!==null){l.blockedOn=c,nm(l.priority,function(){F$(f)});return}}else if(c===31){if(c=o(f),c!==null){l.blockedOn=c,nm(l.priority,function(){F$(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){l.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}l.blockedOn=null}function mg(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var f=Zb(l.nativeEvent);if(f===null){f=l.nativeEvent;var O=new f.constructor(f.type,f);Iv=O,f.target.dispatchEvent(O),Iv=null}else return c=Qa(f),c!==null&&G$(c),l.blockedOn=f,!1;c.shift()}return!0}function tN(l,c,f){mg(l)&&f.delete(c)}function $B(){Bb=!1,Wa!==null&&mg(Wa)&&(Wa=null),Ha!==null&&mg(Ha)&&(Ha=null),Ga!==null&&mg(Ga)&&(Ga=null),mf.forEach(tN),gf.forEach(tN)}function gg(l,c){l.blockedOn===c&&(l.blockedOn=null,Bb||(Bb=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,$B)))}var Og=null;function nN(l){Og!==l&&(Og=l,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Og===l&&(Og=null);for(var c=0;c<l.length;c+=3){var f=l[c],O=l[c+1],y=l[c+2];if(typeof O!="function"){if(Ib(O||f)===null)continue;break}var S=Qa(f);S!==null&&(l.splice(c,3),c-=3,Zy(S,{pending:!0,data:y,method:f.method,action:O},O,y))}}))}function Zc(l){function c(K){return gg(K,l)}Wa!==null&&gg(Wa,l),Ha!==null&&gg(Ha,l),Ga!==null&&gg(Ga,l),mf.forEach(c),gf.forEach(c);for(var f=0;f<Fa.length;f++){var O=Fa[f];O.blockedOn===l&&(O.blockedOn=null)}for(;0<Fa.length&&(f=Fa[0],f.blockedOn===null);)eN(f),f.blockedOn===null&&Fa.shift();if(f=(l.ownerDocument||l).$$reactFormReplay,f!=null)for(O=0;O<f.length;O+=3){var y=f[O],S=f[O+1],N=y[Ln]||null;if(typeof S=="function")N||nN(f);else if(N){var L=null;if(S&&S.hasAttribute("formAction")){if(y=S,N=S[Ln]||null)L=N.formAction;else if(Ib(y)!==null)continue}else L=N.action;typeof L=="function"?f[O+1]=L:(f.splice(O,3),O-=3),nN(f)}}}function rN(){function l(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function c(){y!==null&&(y(),y=null),O||setTimeout(f,20)}function f(){if(!O&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var O=!1,y=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(f,100),function(){O=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),y!==null&&(y(),y=null)}}}function qb(l){this._internalRoot=l}xg.prototype.render=qb.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(r(409));var f=c.current,O=Rr();W$(f,O,l,c,null,null)},xg.prototype.unmount=qb.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;W$(l.current,2,null,l,null,null),Km(),c[Es]=null}};function xg(l){this._internalRoot=l}xg.prototype.unstable_scheduleHydration=function(l){if(l){var c=tm();l={blockedOn:null,target:l,priority:c};for(var f=0;f<Fa.length&&c!==0&&c<Fa[f].priority;f++);Fa.splice(f,0,l),f===0&&eN(l)}};var iN=e.version;if(iN!=="19.2.4")throw Error(r(527,iN,"19.2.4"));X.findDOMNode=function(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=d(c),l=l!==null?h(l):null,l=l===null?null:l.stateNode,l};var NB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vg.isDisabled&&vg.supportsFiber)try{kt=vg.inject(NB),Qt=vg}catch{}}return vf.createRoot=function(l,c){if(!i(l))throw Error(r(299));var f=!1,O="",y=dE,S=fE,N=hE;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(O=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(S=c.onCaughtError),c.onRecoverableError!==void 0&&(N=c.onRecoverableError)),c=Y$(l,1,!1,null,null,f,O,null,y,S,N,rN),l[Es]=c.current,Qb(l),new qb(c)},vf.hydrateRoot=function(l,c,f){if(!i(l))throw Error(r(299));var O=!1,y="",S=dE,N=fE,L=hE,K=null;return f!=null&&(f.unstable_strictMode===!0&&(O=!0),f.identifierPrefix!==void 0&&(y=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(N=f.onCaughtError),f.onRecoverableError!==void 0&&(L=f.onRecoverableError),f.formState!==void 0&&(K=f.formState)),c=Y$(l,1,!0,c,f??null,O,y,K,S,N,L,rN),c.context=U$(null),f=c.current,O=Rr(),O=Qd(O),y=Ma(O),y.callback=null,za(f,y,O),f=O,c.current.lanes=f,Rl(c,f),Fi(c),l[Es]=c.current,Qb(l),new xg(c)},vf.version="19.2.4",vf}var mN;function LB(){if(mN)return Wb.exports;mN=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Wb.exports=DB(),Wb.exports}var XB=LB();/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var gN="popstate";function ON(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function ZB(t={}){function e(r,i){var d;let s=(d=i.state)==null?void 0:d.masked,{pathname:a,search:o,hash:u}=s||r.location;return hS("",{pathname:a,search:o,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:Sh(i)}return BB(e,n,null,t)}function Vt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function zi(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function IB(){return Math.random().toString(36).substring(2,10)}function xN(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function hS(t,e,n=null,r,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?id(e):e,state:n,key:e&&e.key||r||IB(),unstable_mask:i}}function Sh({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function id(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function BB(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o="POP",u=null,d=h();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function h(){return(a.state||{idx:null}).idx}function m(){o="POP";let k=h(),w=k==null?null:k-d;d=k,u&&u({action:o,location:b.location,delta:w})}function g(k,w){o="PUSH";let j=ON(k)?k:hS(b.location,k,w);d=h()+1;let Q=xN(j,d),E=b.createHref(j.unstable_mask||j);try{a.pushState(Q,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(E)}s&&u&&u({action:o,location:b.location,delta:1})}function x(k,w){o="REPLACE";let j=ON(k)?k:hS(b.location,k,w);d=h();let Q=xN(j,d),E=b.createHref(j.unstable_mask||j);a.replaceState(Q,"",E),s&&u&&u({action:o,location:b.location,delta:0})}function v(k){return qB(k)}let b={get action(){return o},get location(){return t(i,a)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(gN,m),u=k,()=>{i.removeEventListener(gN,m),u=null}},createHref(k){return e(i,k)},createURL:v,encodeLocation(k){let w=v(k);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:g,replace:x,go(k){return a.go(k)}};return b}function qB(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vt(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Sh(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function x5(t,e,n="/"){return VB(t,e,n,!1)}function VB(t,e,n,r){let i=typeof e=="string"?id(e):e,s=fa(i.pathname||"/",n);if(s==null)return null;let a=v5(t);YB(a);let o=null;for(let u=0;o==null&&u<a.length;++u){let d=r8(s);o=t8(a[u],d,r)}return o}function v5(t,e=[],n=[],r="",i=!1){let s=(a,o,u=i,d)=>{let h={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&u)return;Vt(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let m=Os([r,h.relativePath]),g=n.concat(h);a.children&&a.children.length>0&&(Vt(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),v5(a.children,e,g,m,u)),!(a.path==null&&!a.index)&&e.push({path:m,score:JB(m,a.index),routesMeta:g})};return t.forEach((a,o)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))s(a,o);else for(let d of y5(a.path))s(a,o,!0,d)}),e}function y5(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=y5(r.join("/")),o=[];return o.push(...a.map(u=>u===""?s:[s,u].join("/"))),i&&o.push(...a),o.map(u=>t.startsWith("/")&&u===""?"/":u)}function YB(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:e8(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var UB=/^:[\w-]+$/,WB=3,HB=2,GB=1,FB=10,KB=-2,vN=t=>t==="*";function JB(t,e){let n=t.split("/"),r=n.length;return n.some(vN)&&(r+=KB),e&&(r+=HB),n.filter(i=>!vN(i)).reduce((i,s)=>i+(UB.test(s)?WB:s===""?GB:FB),r)}function e8(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function t8(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",a=[];for(let o=0;o<r.length;++o){let u=r[o],d=o===r.length-1,h=s==="/"?e:e.slice(s.length)||"/",m=RO({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},h),g=u.route;if(!m&&d&&n&&!r[r.length-1].route.index&&(m=RO({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!m)return null;Object.assign(i,m.params),a.push({params:i,pathname:Os([s,m.pathname]),pathnameBase:l8(Os([s,m.pathnameBase])),route:g}),m.pathnameBase!=="/"&&(s=Os([s,m.pathnameBase]))}return a}function RO(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=n8(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((d,{paramName:h,isOptional:m},g)=>{if(h==="*"){let v=o[g]||"";a=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const x=o[g];return m&&!x?d[h]=void 0:d[h]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:a,pattern:t}}function n8(t,e=!1,n=!0){zi(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,u,d,h)=>{if(r.push({paramName:o,isOptional:u!=null}),u){let m=h.charAt(d+a.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function r8(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return zi(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function fa(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var i8=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function s8(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?id(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=yN(n.substring(1),"/"):s=yN(n,e)):s=e,{pathname:s,search:o8(r),hash:c8(i)}}function yN(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Kb(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function a8(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function b5(t){let e=a8(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Mk(t,e,n,r=!1){let i;typeof t=="string"?i=id(t):(i={...t},Vt(!i.pathname||!i.pathname.includes("?"),Kb("?","pathname","search",i)),Vt(!i.pathname||!i.pathname.includes("#"),Kb("#","pathname","hash",i)),Vt(!i.search||!i.search.includes("#"),Kb("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let m=e.length-1;if(!r&&a.startsWith("..")){let g=a.split("/");for(;g[0]==="..";)g.shift(),m-=1;i.pathname=g.join("/")}o=m>=0?e[m]:"/"}let u=s8(i,o),d=a&&a!=="/"&&a.endsWith("/"),h=(s||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||h)&&(u.pathname+="/"),u}var Os=t=>t.join("/").replace(/\/\/+/g,"/"),l8=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),o8=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,c8=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,u8=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function d8(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function f8(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var S5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function w5(t,e){let n=t;if(typeof n!="string"||!i8.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(S5)try{let s=new URL(window.location.href),a=n.startsWith("//")?new URL(s.protocol+n):new URL(n),o=fa(a.pathname,e);a.origin===s.origin&&o!=null?n=o+a.search+a.hash:i=!0}catch{zi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var k5=["POST","PUT","PATCH","DELETE"];new Set(k5);var h8=["GET",...k5];new Set(h8);var sd=C.createContext(null);sd.displayName="DataRouter";var Zx=C.createContext(null);Zx.displayName="DataRouterState";var p8=C.createContext(!1),Q5=C.createContext({isTransitioning:!1});Q5.displayName="ViewTransition";var m8=C.createContext(new Map);m8.displayName="Fetchers";var g8=C.createContext(null);g8.displayName="Await";var xi=C.createContext(null);xi.displayName="Navigation";var Op=C.createContext(null);Op.displayName="Location";var Li=C.createContext({outlet:null,matches:[],isDataRoute:!1});Li.displayName="Route";var zk=C.createContext(null);zk.displayName="RouteError";var C5="REACT_ROUTER_ERROR",O8="REDIRECT",x8="ROUTE_ERROR_RESPONSE";function v8(t){if(t.startsWith(`${C5}:${O8}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function y8(t){if(t.startsWith(`${C5}:${x8}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new u8(e.status,e.statusText,e.data)}catch{}}function b8(t,{relative:e}={}){Vt(xp(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=C.useContext(xi),{hash:i,pathname:s,search:a}=vp(t,{relative:e}),o=s;return n!=="/"&&(o=s==="/"?n:Os([n,s])),r.createHref({pathname:o,search:a,hash:i})}function xp(){return C.useContext(Op)!=null}function Qs(){return Vt(xp(),"useLocation() may be used only in the context of a <Router> component."),C.useContext(Op).location}var j5="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function E5(t){C.useContext(xi).static||C.useLayoutEffect(t)}function Oa(){let{isDataRoute:t}=C.useContext(Li);return t?M8():S8()}function S8(){Vt(xp(),"useNavigate() may be used only in the context of a <Router> component.");let t=C.useContext(sd),{basename:e,navigator:n}=C.useContext(xi),{matches:r}=C.useContext(Li),{pathname:i}=Qs(),s=JSON.stringify(b5(r)),a=C.useRef(!1);return E5(()=>{a.current=!0}),C.useCallback((u,d={})=>{if(zi(a.current,j5),!a.current)return;if(typeof u=="number"){n.go(u);return}let h=Mk(u,JSON.parse(s),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Os([e,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[e,n,s,i,t])}var w8=C.createContext(null);function k8(t){let e=C.useContext(Li).outlet;return C.useMemo(()=>e&&C.createElement(w8.Provider,{value:t},e),[e,t])}function $5(){let{matches:t}=C.useContext(Li),e=t[t.length-1];return e?e.params:{}}function vp(t,{relative:e}={}){let{matches:n}=C.useContext(Li),{pathname:r}=Qs(),i=JSON.stringify(b5(n));return C.useMemo(()=>Mk(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function Q8(t,e){return N5(t,e)}function N5(t,e,n){var k;Vt(xp(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=C.useContext(xi),{matches:i}=C.useContext(Li),s=i[i.length-1],a=s?s.params:{},o=s?s.pathname:"/",u=s?s.pathnameBase:"/",d=s&&s.route;{let w=d&&d.path||"";P5(o,!d||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let h=Qs(),m;if(e){let w=typeof e=="string"?id(e):e;Vt(u==="/"||((k=w.pathname)==null?void 0:k.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${w.pathname}" was given in the \`location\` prop.`),m=w}else m=h;let g=m.pathname||"/",x=g;if(u!=="/"){let w=u.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=x5(t,{pathname:x});zi(d||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),zi(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=N8(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:Os([u,r.encodeLocation?r.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:Os([u,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return e&&b?C.createElement(Op.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},b):b}function C8(){let t=R8(),e=d8(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=C.createElement(C.Fragment,null,C.createElement("p",null,"💿 Hey developer 👋"),C.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",C.createElement("code",{style:s},"ErrorBoundary")," or"," ",C.createElement("code",{style:s},"errorElement")," prop on your route.")),C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},e),n?C.createElement("pre",{style:i},n):null,a)}var j8=C.createElement(C8,null),T5=class extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=y8(t.digest);n&&(t=n)}let e=t!==void 0?C.createElement(Li.Provider,{value:this.props.routeContext},C.createElement(zk.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?C.createElement(E8,{error:t},e):e}};T5.contextType=p8;var Jb=new WeakMap;function E8({children:t,error:e}){let{basename:n}=C.useContext(xi);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=v8(e.digest);if(r){let i=Jb.get(e);if(i)throw i;let s=w5(r.location,n);if(S5&&!Jb.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Jb.set(e,a),a}return C.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function $8({routeContext:t,match:e,children:n}){let r=C.useContext(sd);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),C.createElement(Li.Provider,{value:t},n)}function N8(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let i=t,s=r==null?void 0:r.errors;if(s!=null){let h=i.findIndex(m=>m.route.id&&(s==null?void 0:s[m.route.id])!==void 0);Vt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let a=!1,o=-1;if(n&&r){a=r.renderFallback;for(let h=0;h<i.length;h++){let m=i[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(o=h),m.route.id){let{loaderData:g,errors:x}=r,v=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||v){n.isStatic&&(a=!0),o>=0?i=i.slice(0,o+1):i=[i[0]];break}}}}let u=n==null?void 0:n.onError,d=r&&u?(h,m)=>{var g,x;u(h,{location:r.location,params:((x=(g=r.matches)==null?void 0:g[0])==null?void 0:x.params)??{},unstable_pattern:f8(r.matches),errorInfo:m})}:void 0;return i.reduceRight((h,m,g)=>{let x,v=!1,b=null,k=null;r&&(x=s&&m.route.id?s[m.route.id]:void 0,b=m.route.errorElement||j8,a&&(o<0&&g===0?(P5("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,k=null):o===g&&(v=!0,k=m.route.hydrateFallbackElement||null)));let w=e.concat(i.slice(0,g+1)),j=()=>{let Q;return x?Q=b:v?Q=k:m.route.Component?Q=C.createElement(m.route.Component,null):m.route.element?Q=m.route.element:Q=h,C.createElement($8,{match:m,routeContext:{outlet:h,matches:w,isDataRoute:r!=null},children:Q})};return r&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?C.createElement(T5,{location:r.location,revalidation:r.revalidation,component:b,error:x,children:j(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:d}):j()},null)}function Dk(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function T8(t){let e=C.useContext(sd);return Vt(e,Dk(t)),e}function P8(t){let e=C.useContext(Zx);return Vt(e,Dk(t)),e}function _8(t){let e=C.useContext(Li);return Vt(e,Dk(t)),e}function Lk(t){let e=_8(t),n=e.matches[e.matches.length-1];return Vt(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function A8(){return Lk("useRouteId")}function R8(){var r;let t=C.useContext(zk),e=P8("useRouteError"),n=Lk("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function M8(){let{router:t}=T8("useNavigate"),e=Lk("useNavigate"),n=C.useRef(!1);return E5(()=>{n.current=!0}),C.useCallback(async(i,s={})=>{zi(n.current,j5),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var bN={};function P5(t,e,n){!e&&!bN[t]&&(bN[t]=!0,zi(!1,n))}C.memo(z8);function z8({routes:t,future:e,state:n,isStatic:r,onError:i}){return N5(t,void 0,{state:n,isStatic:r,onError:i})}function D8(t){return k8(t.context)}function _n(t){Vt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function L8({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:a}){Vt(!xp(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=t.replace(/^\/*/,"/"),u=C.useMemo(()=>({basename:o,navigator:i,static:s,unstable_useTransitions:a,future:{}}),[o,i,s,a]);typeof n=="string"&&(n=id(n));let{pathname:d="/",search:h="",hash:m="",state:g=null,key:x="default",unstable_mask:v}=n,b=C.useMemo(()=>{let k=fa(d,o);return k==null?null:{location:{pathname:k,search:h,hash:m,state:g,key:x,unstable_mask:v},navigationType:r}},[o,d,h,m,g,x,r,v]);return zi(b!=null,`<Router basename="${o}"> is not able to match the URL "${d}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:C.createElement(xi.Provider,{value:u},C.createElement(Op.Provider,{children:e,value:b}))}function X8({children:t,location:e}){return Q8(pS(t),e)}function pS(t,e=[]){let n=[];return C.Children.forEach(t,(r,i)=>{if(!C.isValidElement(r))return;let s=[...e,i];if(r.type===C.Fragment){n.push.apply(n,pS(r.props.children,s));return}Vt(r.type===_n,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Vt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=pS(r.props.children,s)),n.push(a)}),n}var aO="get",lO="application/x-www-form-urlencoded";function Ix(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Z8(t){return Ix(t)&&t.tagName.toLowerCase()==="button"}function I8(t){return Ix(t)&&t.tagName.toLowerCase()==="form"}function B8(t){return Ix(t)&&t.tagName.toLowerCase()==="input"}function q8(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function V8(t,e){return t.button===0&&(!e||e==="_self")&&!q8(t)}function mS(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Y8(t,e){let n=mS(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}var bg=null;function U8(){if(bg===null)try{new FormData(document.createElement("form"),0),bg=!1}catch{bg=!0}return bg}var W8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function e0(t){return t!=null&&!W8.has(t)?(zi(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${lO}"`),null):t}function H8(t,e){let n,r,i,s,a;if(I8(t)){let o=t.getAttribute("action");r=o?fa(o,e):null,n=t.getAttribute("method")||aO,i=e0(t.getAttribute("enctype"))||lO,s=new FormData(t)}else if(Z8(t)||B8(t)&&(t.type==="submit"||t.type==="image")){let o=t.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||o.getAttribute("action");if(r=u?fa(u,e):null,n=t.getAttribute("formmethod")||o.getAttribute("method")||aO,i=e0(t.getAttribute("formenctype"))||e0(o.getAttribute("enctype"))||lO,s=new FormData(o,t),!U8()){let{name:d,type:h,value:m}=t;if(h==="image"){let g=d?`${d}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else d&&s.append(d,m)}}else{if(Ix(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=aO,r=null,i=lO,a=t}return s&&i==="text/plain"&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xk(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function G8(t,e,n,r){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:e&&fa(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function F8(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function K8(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function J8(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let a=await F8(s,n);return a.links?a.links():[]}return[]}));return rq(r.flat(1).filter(K8).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function SN(t,e,n,r,i,s){let a=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,o=(u,d)=>{var h;return n[d].pathname!==u.pathname||((h=n[d].route.path)==null?void 0:h.endsWith("*"))&&n[d].params["*"]!==u.params["*"]};return s==="assets"?e.filter((u,d)=>a(u,d)||o(u,d)):s==="data"?e.filter((u,d)=>{var m;let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(a(u,d)||o(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function eq(t,e,{includeHydrateFallback:n}={}){return tq(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function tq(t){return[...new Set(t)]}function nq(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function rq(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(nq(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function _5(){let t=C.useContext(sd);return Xk(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function iq(){let t=C.useContext(Zx);return Xk(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Zk=C.createContext(void 0);Zk.displayName="FrameworkContext";function A5(){let t=C.useContext(Zk);return Xk(t,"You must render this element inside a <HydratedRouter> element"),t}function sq(t,e){let n=C.useContext(Zk),[r,i]=C.useState(!1),[s,a]=C.useState(!1),{onFocus:o,onBlur:u,onMouseEnter:d,onMouseLeave:h,onTouchStart:m}=e,g=C.useRef(null);C.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let b=w=>{w.forEach(j=>{a(j.isIntersecting)})},k=new IntersectionObserver(b,{threshold:.5});return g.current&&k.observe(g.current),()=>{k.disconnect()}}},[t]),C.useEffect(()=>{if(r){let b=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(b)}}},[r]);let x=()=>{i(!0)},v=()=>{i(!1),a(!1)};return n?t!=="intent"?[s,g,{}]:[s,g,{onFocus:yf(o,x),onBlur:yf(u,v),onMouseEnter:yf(d,x),onMouseLeave:yf(h,v),onTouchStart:yf(m,x)}]:[!1,g,{}]}function yf(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function aq({page:t,...e}){let{router:n}=_5(),r=C.useMemo(()=>x5(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?C.createElement(oq,{page:t,matches:r,...e}):null}function lq(t){let{manifest:e,routeModules:n}=A5(),[r,i]=C.useState([]);return C.useEffect(()=>{let s=!1;return J8(t,e,n).then(a=>{s||i(a)}),()=>{s=!0}},[t,e,n]),r}function oq({page:t,matches:e,...n}){let r=Qs(),{future:i,manifest:s,routeModules:a}=A5(),{basename:o}=_5(),{loaderData:u,matches:d}=iq(),h=C.useMemo(()=>SN(t,e,d,s,r,"data"),[t,e,d,s,r]),m=C.useMemo(()=>SN(t,e,d,s,r,"assets"),[t,e,d,s,r]),g=C.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let b=new Set,k=!1;if(e.forEach(j=>{var E;let Q=s.routes[j.route.id];!Q||!Q.hasLoader||(!h.some(R=>R.route.id===j.route.id)&&j.route.id in u&&((E=a[j.route.id])!=null&&E.shouldRevalidate)||Q.hasClientLoader?k=!0:b.add(j.route.id))}),b.size===0)return[];let w=G8(t,o,i.unstable_trailingSlashAwareDataRequests,"data");return k&&b.size>0&&w.searchParams.set("_routes",e.filter(j=>b.has(j.route.id)).map(j=>j.route.id).join(",")),[w.pathname+w.search]},[o,i.unstable_trailingSlashAwareDataRequests,u,r,s,h,e,t,a]),x=C.useMemo(()=>eq(m,s),[m,s]),v=lq(m);return C.createElement(C.Fragment,null,g.map(b=>C.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),x.map(b=>C.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),v.map(({key:b,link:k})=>C.createElement("link",{key:b,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function cq(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var uq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uq&&(window.__reactRouterVersion="7.13.1")}catch{}function dq({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=C.useRef();i.current==null&&(i.current=ZB({window:r,v5Compat:!0}));let s=i.current,[a,o]=C.useState({action:s.action,location:s.location}),u=C.useCallback(d=>{n===!1?o(d):C.startTransition(()=>o(d))},[n]);return C.useLayoutEffect(()=>s.listen(u),[s,u]),C.createElement(L8,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:s,unstable_useTransitions:n})}var R5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nr=C.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:a,unstable_mask:o,state:u,target:d,to:h,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x,...v},b){let{basename:k,navigator:w,unstable_useTransitions:j}=C.useContext(xi),Q=typeof h=="string"&&R5.test(h),E=w5(h,k);h=E.to;let R=b8(h,{relative:i}),T=Qs(),A=null;if(o){let D=Mk(o,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);k!=="/"&&(D.pathname=D.pathname==="/"?k:Os([k,D.pathname])),A=w.createHref(D)}let[I,W,F]=sq(r,v),Z=pq(h,{replace:a,unstable_mask:o,state:u,target:d,preventScrollReset:m,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:x,unstable_useTransitions:j});function B(D){e&&e(D),D.defaultPrevented||Z(D)}let H=!(E.isExternal||s),P=C.createElement("a",{...v,...F,href:(H?A:void 0)||E.absoluteURL||R,onClick:H?B:e,ref:cq(b,W),target:d,"data-discover":!Q&&n==="render"?"true":void 0});return I&&!Q?C.createElement(C.Fragment,null,P,C.createElement(aq,{page:R})):P});nr.displayName="Link";var Ik=C.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:a,viewTransition:o,children:u,...d},h){let m=vp(a,{relative:d.relative}),g=Qs(),x=C.useContext(Zx),{navigator:v,basename:b}=C.useContext(xi),k=x!=null&&yq(m)&&o===!0,w=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,j=g.pathname,Q=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(j=j.toLowerCase(),Q=Q?Q.toLowerCase():null,w=w.toLowerCase()),Q&&b&&(Q=fa(Q,b)||Q);const E=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let R=j===w||!i&&j.startsWith(w)&&j.charAt(E)==="/",T=Q!=null&&(Q===w||!i&&Q.startsWith(w)&&Q.charAt(w.length)==="/"),A={isActive:R,isPending:T,isTransitioning:k},I=R?e:void 0,W;typeof r=="function"?W=r(A):W=[r,R?"active":null,T?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let F=typeof s=="function"?s(A):s;return C.createElement(nr,{...d,"aria-current":I,className:W,ref:h,style:F,to:a,viewTransition:o},typeof u=="function"?u(A):u)});Ik.displayName="NavLink";var fq=C.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:a=aO,action:o,onSubmit:u,relative:d,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:g,...x},v)=>{let{unstable_useTransitions:b}=C.useContext(xi),k=xq(),w=vq(o,{relative:d}),j=a.toLowerCase()==="get"?"get":"post",Q=typeof o=="string"&&R5.test(o),E=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let T=R.nativeEvent.submitter,A=(T==null?void 0:T.getAttribute("formmethod"))||a,I=()=>k(T||R.currentTarget,{fetcherKey:e,method:A,navigate:n,replace:i,state:s,relative:d,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:g});b&&n!==!1?C.startTransition(()=>I()):I()};return C.createElement("form",{ref:v,method:j,action:w,onSubmit:r?u:E,...x,"data-discover":!Q&&t==="render"?"true":void 0})});fq.displayName="Form";function hq(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M5(t){let e=C.useContext(sd);return Vt(e,hq(t)),e}function pq(t,{target:e,replace:n,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let h=Oa(),m=Qs(),g=vp(t,{relative:a});return C.useCallback(x=>{if(V8(x,e)){x.preventDefault();let v=n!==void 0?n:Sh(m)===Sh(g),b=()=>h(t,{replace:v,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:u});d?C.startTransition(()=>b()):b()}},[m,h,g,n,r,i,e,t,s,a,o,u,d])}function mq(t){zi(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=C.useRef(mS(t)),n=C.useRef(!1),r=Qs(),i=C.useMemo(()=>Y8(r.search,n.current?null:e.current),[r.search]),s=Oa(),a=C.useCallback((o,u)=>{const d=mS(typeof o=="function"?o(new URLSearchParams(i)):o);n.current=!0,s("?"+d,u)},[s,i]);return[i,a]}var gq=0,Oq=()=>`__${String(++gq)}__`;function xq(){let{router:t}=M5("useSubmit"),{basename:e}=C.useContext(xi),n=A8(),r=t.fetch,i=t.navigate;return C.useCallback(async(s,a={})=>{let{action:o,method:u,encType:d,formData:h,body:m}=H8(s,e);if(a.navigate===!1){let g=a.fetcherKey||Oq();await r(g,n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:h,body:m,formMethod:a.method||u,formEncType:a.encType||d,flushSync:a.flushSync})}else await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:h,body:m,formMethod:a.method||u,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,e,n])}function vq(t,{relative:e}={}){let{basename:n}=C.useContext(xi),r=C.useContext(Li);Vt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...vp(t||".",{relative:e})},a=Qs();if(t==null){s.search=a.search;let o=new URLSearchParams(s.search),u=o.getAll("index");if(u.some(h=>h==="")){o.delete("index"),u.filter(m=>m).forEach(m=>o.append("index",m));let h=o.toString();s.search=h?`?${h}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Os([n,s.pathname])),Sh(s)}function yq(t,{relative:e}={}){let n=C.useContext(Q5);Vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=M5("useViewTransitionState"),i=vp(t,{relative:e});if(!n.isTransitioning)return!1;let s=fa(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=fa(n.nextLocation.pathname,r)||n.nextLocation.pathname;return RO(i.pathname,a)!=null||RO(i.pathname,s)!=null}var bq=O5(),yp=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},So,dl,xu,l5,Sq=(l5=class extends yp{constructor(){super();Me(this,So);Me(this,dl);Me(this,xu);we(this,xu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){te(this,dl)||this.setEventListener(te(this,xu))}onUnsubscribe(){var e;this.hasListeners()||((e=te(this,dl))==null||e.call(this),we(this,dl,void 0))}setEventListener(e){var n;we(this,xu,e),(n=te(this,dl))==null||n.call(this),we(this,dl,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){te(this,So)!==e&&(we(this,So,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof te(this,So)=="boolean"?te(this,So):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},So=new WeakMap,dl=new WeakMap,xu=new WeakMap,l5),Bk=new Sq,wq={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},fl,Rk,o5,kq=(o5=class{constructor(){Me(this,fl,wq);Me(this,Rk,!1)}setTimeoutProvider(t){we(this,fl,t)}setTimeout(t,e){return te(this,fl).setTimeout(t,e)}clearTimeout(t){te(this,fl).clearTimeout(t)}setInterval(t,e){return te(this,fl).setInterval(t,e)}clearInterval(t){te(this,fl).clearInterval(t)}},fl=new WeakMap,Rk=new WeakMap,o5),go=new kq;function Qq(t){setTimeout(t,0)}var Cq=typeof window>"u"||"Deno"in globalThis;function vr(){}function jq(t,e){return typeof t=="function"?t(e):t}function gS(t){return typeof t=="number"&&t>=0&&t!==1/0}function z5(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Sl(t,e){return typeof t=="function"?t(e):t}function si(t,e){return typeof t=="function"?t(e):t}function wN(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==qk(a,e.options))return!1}else if(!kh(e.queryKey,a))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function kN(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(wh(e.options.mutationKey)!==wh(s))return!1}else if(!kh(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function qk(t,e){return((e==null?void 0:e.queryKeyHashFn)||wh)(t)}function wh(t){return JSON.stringify(t,(e,n)=>xS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function kh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>kh(t[n],e[n])):!1}var Eq=Object.prototype.hasOwnProperty;function D5(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=QN(t)&&QN(e);if(!r&&!(xS(t)&&xS(e)))return e;const s=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),o=a.length,u=r?new Array(o):{};let d=0;for(let h=0;h<o;h++){const m=r?h:a[h],g=t[m],x=e[m];if(g===x){u[m]=g,(r?h<s:Eq.call(t,m))&&d++;continue}if(g===null||x===null||typeof g!="object"||typeof x!="object"){u[m]=x;continue}const v=D5(g,x,n+1);u[m]=v,v===g&&d++}return s===o&&d===s?t:u}function OS(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function QN(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function xS(t){if(!CN(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!CN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function CN(t){return Object.prototype.toString.call(t)==="[object Object]"}function $q(t){return new Promise(e=>{go.setTimeout(e,t)})}function vS(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?D5(t,e):e}function Nq(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Tq(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Vk=Symbol();function L5(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Vk?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function X5(t,e){return typeof t=="function"?t(...e):!!t}function Pq(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Qh=(()=>{let t=()=>Cq;return{isServer(){return t()},setIsServer(e){t=e}}})();function yS(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var _q=Qq;function Aq(){let t=[],e=0,n=o=>{o()},r=o=>{o()},i=_q;const s=o=>{e?t.push(o):i(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{r(()=>{o.forEach(u=>{n(u)})})})};return{batch:o=>{let u;e++;try{u=o()}finally{e--,e||a()}return u},batchCalls:o=>(...u)=>{s(()=>{o(...u)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Mn=Aq(),vu,hl,yu,c5,Rq=(c5=class extends yp{constructor(){super();Me(this,vu,!0);Me(this,hl);Me(this,yu);we(this,yu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){te(this,hl)||this.setEventListener(te(this,yu))}onUnsubscribe(){var e;this.hasListeners()||((e=te(this,hl))==null||e.call(this),we(this,hl,void 0))}setEventListener(e){var n;we(this,yu,e),(n=te(this,hl))==null||n.call(this),we(this,hl,e(this.setOnline.bind(this)))}setOnline(e){te(this,vu)!==e&&(we(this,vu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return te(this,vu)}},vu=new WeakMap,hl=new WeakMap,yu=new WeakMap,c5),MO=new Rq;function Mq(t){return Math.min(1e3*2**t,3e4)}function Z5(t){return(t??"online")==="online"?MO.isOnline():!0}var bS=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function I5(t){let e=!1,n=0,r;const i=yS(),s=()=>i.status!=="pending",a=b=>{var k;if(!s()){const w=new bS(b);g(w),(k=t.onCancel)==null||k.call(t,w)}},o=()=>{e=!0},u=()=>{e=!1},d=()=>Bk.isFocused()&&(t.networkMode==="always"||MO.isOnline())&&t.canRun(),h=()=>Z5(t.networkMode)&&t.canRun(),m=b=>{s()||(r==null||r(),i.resolve(b))},g=b=>{s()||(r==null||r(),i.reject(b))},x=()=>new Promise(b=>{var k;r=w=>{(s()||d())&&b(w)},(k=t.onPause)==null||k.call(t)}).then(()=>{var b;r=void 0,s()||(b=t.onContinue)==null||b.call(t)}),v=()=>{if(s())return;let b;const k=n===0?t.initialPromise:void 0;try{b=k??t.fn()}catch(w){b=Promise.reject(w)}Promise.resolve(b).then(m).catch(w=>{var T;if(s())return;const j=t.retry??(Qh.isServer()?0:3),Q=t.retryDelay??Mq,E=typeof Q=="function"?Q(n,w):Q,R=j===!0||typeof j=="number"&&n<j||typeof j=="function"&&j(n,w);if(e||!R){g(w);return}n++,(T=t.onFail)==null||T.call(t,n,w),$q(E).then(()=>d()?void 0:x()).then(()=>{e?g(w):v()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r==null||r(),i),cancelRetry:o,continueRetry:u,canStart:h,start:()=>(h()?v():x().then(v),i)}}var wo,u5,B5=(u5=class{constructor(){Me(this,wo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gS(this.gcTime)&&we(this,wo,go.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Qh.isServer()?1/0:300*1e3))}clearGcTimeout(){te(this,wo)&&(go.clearTimeout(te(this,wo)),we(this,wo,void 0))}},wo=new WeakMap,u5),ko,bu,ii,Qo,wn,up,Co,Ir,q5,Gs,d5,zq=(d5=class extends B5{constructor(e){super();Me(this,Ir);Me(this,ko);Me(this,bu);Me(this,ii);Me(this,Qo);Me(this,wn);Me(this,up);Me(this,Co);we(this,Co,!1),we(this,up,e.defaultOptions),this.setOptions(e.options),this.observers=[],we(this,Qo,e.client),we(this,ii,te(this,Qo).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,we(this,ko,EN(this.options)),this.state=e.state??te(this,ko),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=te(this,wn))==null?void 0:e.promise}setOptions(e){if(this.options={...te(this,up),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=EN(this.options);n.data!==void 0&&(this.setState(jN(n.data,n.dataUpdatedAt)),we(this,ko,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&te(this,ii).remove(this)}setData(e,n){const r=vS(this.state.data,e,this.options);return tt(this,Ir,Gs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){tt(this,Ir,Gs).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=te(this,wn))==null?void 0:r.promise;return(i=te(this,wn))==null||i.cancel(e),n?n.then(vr).catch(vr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return te(this,ko)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>si(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vk||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Sl(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!z5(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=te(this,wn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=te(this,wn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),te(this,ii).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(te(this,wn)&&(te(this,Co)||tt(this,Ir,q5).call(this)?te(this,wn).cancel({revert:!0}):te(this,wn).cancelRetry()),this.scheduleGc()),te(this,ii).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||tt(this,Ir,Gs).call(this,{type:"invalidate"})}async fetch(e,n){var u,d,h,m,g,x,v,b,k,w,j,Q;if(this.state.fetchStatus!=="idle"&&((u=te(this,wn))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(te(this,wn))return te(this,wn).continueRetry(),te(this,wn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const E=this.observers.find(R=>R.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,i=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(we(this,Co,!0),r.signal)})},s=()=>{const E=L5(this.options,n),T=(()=>{const A={client:te(this,Qo),queryKey:this.queryKey,meta:this.meta};return i(A),A})();return we(this,Co,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:te(this,Qo),state:this.state,fetchFn:s};return i(E),E})();(d=this.options.behavior)==null||d.onFetch(o,this),we(this,bu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=o.fetchOptions)==null?void 0:h.meta))&&tt(this,Ir,Gs).call(this,{type:"fetch",meta:(m=o.fetchOptions)==null?void 0:m.meta}),we(this,wn,I5({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof bS&&E.revert&&this.setState({...te(this,bu),fetchStatus:"idle"}),r.abort()},onFail:(E,R)=>{tt(this,Ir,Gs).call(this,{type:"failed",failureCount:E,error:R})},onPause:()=>{tt(this,Ir,Gs).call(this,{type:"pause"})},onContinue:()=>{tt(this,Ir,Gs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await te(this,wn).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(g=te(this,ii).config).onSuccess)==null||x.call(g,E,this),(b=(v=te(this,ii).config).onSettled)==null||b.call(v,E,this.state.error,this),E}catch(E){if(E instanceof bS){if(E.silent)return te(this,wn).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw tt(this,Ir,Gs).call(this,{type:"error",error:E}),(w=(k=te(this,ii).config).onError)==null||w.call(k,E,this),(Q=(j=te(this,ii).config).onSettled)==null||Q.call(j,this.state.data,E,this),E}finally{this.scheduleGc()}}},ko=new WeakMap,bu=new WeakMap,ii=new WeakMap,Qo=new WeakMap,wn=new WeakMap,up=new WeakMap,Co=new WeakMap,Ir=new WeakSet,q5=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Gs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...V5(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...jN(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return we(this,bu,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Mn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),te(this,ii).notify({query:this,type:"updated",action:e})})},d5);function V5(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z5(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function jN(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function EN(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Or,rt,dp,Gn,jo,Su,Ks,pl,fp,wu,ku,Eo,$o,ml,Qu,vt,Df,SS,wS,kS,QS,CS,jS,ES,Y5,f5,Dq=(f5=class extends yp{constructor(e,n){super();Me(this,vt);Me(this,Or);Me(this,rt);Me(this,dp);Me(this,Gn);Me(this,jo);Me(this,Su);Me(this,Ks);Me(this,pl);Me(this,fp);Me(this,wu);Me(this,ku);Me(this,Eo);Me(this,$o);Me(this,ml);Me(this,Qu,new Set);this.options=n,we(this,Or,e),we(this,pl,null),we(this,Ks,yS()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(te(this,rt).addObserver(this),$N(te(this,rt),this.options)?tt(this,vt,Df).call(this):this.updateResult(),tt(this,vt,QS).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $S(te(this,rt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $S(te(this,rt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,tt(this,vt,CS).call(this),tt(this,vt,jS).call(this),te(this,rt).removeObserver(this)}setOptions(e){const n=this.options,r=te(this,rt);if(this.options=te(this,Or).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof si(this.options.enabled,te(this,rt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");tt(this,vt,ES).call(this),te(this,rt).setOptions(this.options),n._defaulted&&!OS(this.options,n)&&te(this,Or).getQueryCache().notify({type:"observerOptionsUpdated",query:te(this,rt),observer:this});const i=this.hasListeners();i&&NN(te(this,rt),r,this.options,n)&&tt(this,vt,Df).call(this),this.updateResult(),i&&(te(this,rt)!==r||si(this.options.enabled,te(this,rt))!==si(n.enabled,te(this,rt))||Sl(this.options.staleTime,te(this,rt))!==Sl(n.staleTime,te(this,rt)))&&tt(this,vt,SS).call(this);const s=tt(this,vt,wS).call(this);i&&(te(this,rt)!==r||si(this.options.enabled,te(this,rt))!==si(n.enabled,te(this,rt))||s!==te(this,ml))&&tt(this,vt,kS).call(this,s)}getOptimisticResult(e){const n=te(this,Or).getQueryCache().build(te(this,Or),e),r=this.createResult(n,e);return Xq(this,r)&&(we(this,Gn,r),we(this,Su,this.options),we(this,jo,te(this,rt).state)),r}getCurrentResult(){return te(this,Gn)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&te(this,Ks).status==="pending"&&te(this,Ks).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){te(this,Qu).add(e)}getCurrentQuery(){return te(this,rt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=te(this,Or).defaultQueryOptions(e),r=te(this,Or).getQueryCache().build(te(this,Or),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return tt(this,vt,Df).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),te(this,Gn)))}createResult(e,n){var W;const r=te(this,rt),i=this.options,s=te(this,Gn),a=te(this,jo),o=te(this,Su),d=e!==r?e.state:te(this,dp),{state:h}=e;let m={...h},g=!1,x;if(n._optimisticResults){const F=this.hasListeners(),Z=!F&&$N(e,n),B=F&&NN(e,r,n,i);(Z||B)&&(m={...m,...V5(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:b,status:k}=m;x=m.data;let w=!1;if(n.placeholderData!==void 0&&x===void 0&&k==="pending"){let F;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(F=s.data,w=!0):F=typeof n.placeholderData=="function"?n.placeholderData((W=te(this,ku))==null?void 0:W.state.data,te(this,ku)):n.placeholderData,F!==void 0&&(k="success",x=vS(s==null?void 0:s.data,F,n),g=!0)}if(n.select&&x!==void 0&&!w)if(s&&x===(a==null?void 0:a.data)&&n.select===te(this,fp))x=te(this,wu);else try{we(this,fp,n.select),x=n.select(x),x=vS(s==null?void 0:s.data,x,n),we(this,wu,x),we(this,pl,null)}catch(F){we(this,pl,F)}te(this,pl)&&(v=te(this,pl),x=te(this,wu),b=Date.now(),k="error");const j=m.fetchStatus==="fetching",Q=k==="pending",E=k==="error",R=Q&&j,T=x!==void 0,I={status:k,fetchStatus:m.fetchStatus,isPending:Q,isSuccess:k==="success",isError:E,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:j,isRefetching:j&&!Q,isLoadingError:E&&!T,isPaused:m.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:E&&T,isStale:Yk(e,n),refetch:this.refetch,promise:te(this,Ks),isEnabled:si(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=I.data!==void 0,Z=I.status==="error"&&!F,B=D=>{Z?D.reject(I.error):F&&D.resolve(I.data)},H=()=>{const D=we(this,Ks,I.promise=yS());B(D)},P=te(this,Ks);switch(P.status){case"pending":e.queryHash===r.queryHash&&B(P);break;case"fulfilled":(Z||I.data!==P.value)&&H();break;case"rejected":(!Z||I.error!==P.reason)&&H();break}}return I}updateResult(){const e=te(this,Gn),n=this.createResult(te(this,rt),this.options);if(we(this,jo,te(this,rt).state),we(this,Su,this.options),te(this,jo).data!==void 0&&we(this,ku,te(this,rt)),OS(n,e))return;we(this,Gn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!te(this,Qu).size)return!0;const a=new Set(s??te(this,Qu));return this.options.throwOnError&&a.add("error"),Object.keys(te(this,Gn)).some(o=>{const u=o;return te(this,Gn)[u]!==e[u]&&a.has(u)})};tt(this,vt,Y5).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&tt(this,vt,QS).call(this)}},Or=new WeakMap,rt=new WeakMap,dp=new WeakMap,Gn=new WeakMap,jo=new WeakMap,Su=new WeakMap,Ks=new WeakMap,pl=new WeakMap,fp=new WeakMap,wu=new WeakMap,ku=new WeakMap,Eo=new WeakMap,$o=new WeakMap,ml=new WeakMap,Qu=new WeakMap,vt=new WeakSet,Df=function(e){tt(this,vt,ES).call(this);let n=te(this,rt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(vr)),n},SS=function(){tt(this,vt,CS).call(this);const e=Sl(this.options.staleTime,te(this,rt));if(Qh.isServer()||te(this,Gn).isStale||!gS(e))return;const r=z5(te(this,Gn).dataUpdatedAt,e)+1;we(this,Eo,go.setTimeout(()=>{te(this,Gn).isStale||this.updateResult()},r))},wS=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(te(this,rt)):this.options.refetchInterval)??!1},kS=function(e){tt(this,vt,jS).call(this),we(this,ml,e),!(Qh.isServer()||si(this.options.enabled,te(this,rt))===!1||!gS(te(this,ml))||te(this,ml)===0)&&we(this,$o,go.setInterval(()=>{(this.options.refetchIntervalInBackground||Bk.isFocused())&&tt(this,vt,Df).call(this)},te(this,ml)))},QS=function(){tt(this,vt,SS).call(this),tt(this,vt,kS).call(this,tt(this,vt,wS).call(this))},CS=function(){te(this,Eo)&&(go.clearTimeout(te(this,Eo)),we(this,Eo,void 0))},jS=function(){te(this,$o)&&(go.clearInterval(te(this,$o)),we(this,$o,void 0))},ES=function(){const e=te(this,Or).getQueryCache().build(te(this,Or),this.options);if(e===te(this,rt))return;const n=te(this,rt);we(this,rt,e),we(this,dp,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},Y5=function(e){Mn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(te(this,Gn))}),te(this,Or).getQueryCache().notify({query:te(this,rt),type:"observerResultsUpdated"})})},f5);function Lq(t,e){return si(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function $N(t,e){return Lq(t,e)||t.state.data!==void 0&&$S(t,e,e.refetchOnMount)}function $S(t,e,n){if(si(e.enabled,t)!==!1&&Sl(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Yk(t,e)}return!1}function NN(t,e,n,r){return(t!==e||si(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Yk(t,n)}function Yk(t,e){return si(e.enabled,t)!==!1&&t.isStaleByTime(Sl(e.staleTime,t))}function Xq(t,e){return!OS(t.getCurrentResult(),e)}function TN(t){return{onFetch:(e,n)=>{var h,m,g,x,v;const r=e.options,i=(g=(m=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:g.direction,s=((x=e.state.data)==null?void 0:x.pages)||[],a=((v=e.state.data)==null?void 0:v.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const d=async()=>{let b=!1;const k=Q=>{Pq(Q,()=>e.signal,()=>b=!0)},w=L5(e.options,e.fetchOptions),j=async(Q,E,R)=>{if(b)return Promise.reject();if(E==null&&Q.pages.length)return Promise.resolve(Q);const A=(()=>{const Z={client:e.client,queryKey:e.queryKey,pageParam:E,direction:R?"backward":"forward",meta:e.options.meta};return k(Z),Z})(),I=await w(A),{maxPages:W}=e.options,F=R?Tq:Nq;return{pages:F(Q.pages,I,W),pageParams:F(Q.pageParams,E,W)}};if(i&&s.length){const Q=i==="backward",E=Q?Zq:PN,R={pages:s,pageParams:a},T=E(r,R);o=await j(R,T,Q)}else{const Q=t??s.length;do{const E=u===0?a[0]??r.initialPageParam:PN(r,o);if(u>0&&E==null)break;o=await j(o,E),u++}while(u<Q)}return o};e.options.persister?e.fetchFn=()=>{var b,k;return(k=(b=e.options).persister)==null?void 0:k.call(b,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function PN(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function Zq(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var hp,is,Zn,No,ss,rl,h5,Iq=(h5=class extends B5{constructor(e){super();Me(this,ss);Me(this,hp);Me(this,is);Me(this,Zn);Me(this,No);we(this,hp,e.client),this.mutationId=e.mutationId,we(this,Zn,e.mutationCache),we(this,is,[]),this.state=e.state||Bq(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){te(this,is).includes(e)||(te(this,is).push(e),this.clearGcTimeout(),te(this,Zn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){we(this,is,te(this,is).filter(n=>n!==e)),this.scheduleGc(),te(this,Zn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){te(this,is).length||(this.state.status==="pending"?this.scheduleGc():te(this,Zn).remove(this))}continue(){var e;return((e=te(this,No))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,o,u,d,h,m,g,x,v,b,k,w,j,Q,E,R,T,A;const n=()=>{tt(this,ss,rl).call(this,{type:"continue"})},r={client:te(this,hp),meta:this.options.meta,mutationKey:this.options.mutationKey};we(this,No,I5({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,W)=>{tt(this,ss,rl).call(this,{type:"failed",failureCount:I,error:W})},onPause:()=>{tt(this,ss,rl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>te(this,Zn).canRun(this)}));const i=this.state.status==="pending",s=!te(this,No).canStart();try{if(i)n();else{tt(this,ss,rl).call(this,{type:"pending",variables:e,isPaused:s}),te(this,Zn).config.onMutate&&await te(this,Zn).config.onMutate(e,this,r);const W=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e,r));W!==this.state.context&&tt(this,ss,rl).call(this,{type:"pending",context:W,variables:e,isPaused:s})}const I=await te(this,No).start();return await((d=(u=te(this,Zn).config).onSuccess)==null?void 0:d.call(u,I,e,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,I,e,this.state.context,r)),await((x=(g=te(this,Zn).config).onSettled)==null?void 0:x.call(g,I,null,this.state.variables,this.state.context,this,r)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,I,null,e,this.state.context,r)),tt(this,ss,rl).call(this,{type:"success",data:I}),I}catch(I){try{await((w=(k=te(this,Zn).config).onError)==null?void 0:w.call(k,I,e,this.state.context,this,r))}catch(W){Promise.reject(W)}try{await((Q=(j=this.options).onError)==null?void 0:Q.call(j,I,e,this.state.context,r))}catch(W){Promise.reject(W)}try{await((R=(E=te(this,Zn).config).onSettled)==null?void 0:R.call(E,void 0,I,this.state.variables,this.state.context,this,r))}catch(W){Promise.reject(W)}try{await((A=(T=this.options).onSettled)==null?void 0:A.call(T,void 0,I,e,this.state.context,r))}catch(W){Promise.reject(W)}throw tt(this,ss,rl).call(this,{type:"error",error:I}),I}finally{te(this,Zn).runNext(this)}}},hp=new WeakMap,is=new WeakMap,Zn=new WeakMap,No=new WeakMap,ss=new WeakSet,rl=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Mn.batch(()=>{te(this,is).forEach(r=>{r.onMutationUpdate(e)}),te(this,Zn).notify({mutation:this,type:"updated",action:e})})},h5);function Bq(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Js,Ei,pp,p5,qq=(p5=class extends yp{constructor(e={}){super();Me(this,Js);Me(this,Ei);Me(this,pp);this.config=e,we(this,Js,new Set),we(this,Ei,new Map),we(this,pp,0)}build(e,n,r){const i=new Iq({client:e,mutationCache:this,mutationId:++yg(this,pp)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){te(this,Js).add(e);const n=Sg(e);if(typeof n=="string"){const r=te(this,Ei).get(n);r?r.push(e):te(this,Ei).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(te(this,Js).delete(e)){const n=Sg(e);if(typeof n=="string"){const r=te(this,Ei).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&te(this,Ei).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Sg(e);if(typeof n=="string"){const r=te(this,Ei).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Sg(e);if(typeof n=="string"){const i=(r=te(this,Ei).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Mn.batch(()=>{te(this,Js).forEach(e=>{this.notify({type:"removed",mutation:e})}),te(this,Js).clear(),te(this,Ei).clear()})}getAll(){return Array.from(te(this,Js))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>kN(n,r))}findAll(e={}){return this.getAll().filter(n=>kN(e,n))}notify(e){Mn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Mn.batch(()=>Promise.all(e.map(n=>n.continue().catch(vr))))}},Js=new WeakMap,Ei=new WeakMap,pp=new WeakMap,p5);function Sg(t){var e;return(e=t.options.scope)==null?void 0:e.id}var as,m5,Vq=(m5=class extends yp{constructor(e={}){super();Me(this,as);this.config=e,we(this,as,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??qk(i,n);let a=this.get(s);return a||(a=new zq({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){te(this,as).has(e.queryHash)||(te(this,as).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=te(this,as).get(e.queryHash);n&&(e.destroy(),n===e&&te(this,as).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Mn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return te(this,as).get(e)}getAll(){return[...te(this,as).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>wN(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>wN(e,r)):n}notify(e){Mn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Mn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Mn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},as=new WeakMap,m5),Wt,gl,Ol,Cu,ju,xl,Eu,$u,g5,Yq=(g5=class{constructor(t={}){Me(this,Wt);Me(this,gl);Me(this,Ol);Me(this,Cu);Me(this,ju);Me(this,xl);Me(this,Eu);Me(this,$u);we(this,Wt,t.queryCache||new Vq),we(this,gl,t.mutationCache||new qq),we(this,Ol,t.defaultOptions||{}),we(this,Cu,new Map),we(this,ju,new Map),we(this,xl,0)}mount(){yg(this,xl)._++,te(this,xl)===1&&(we(this,Eu,Bk.subscribe(async t=>{t&&(await this.resumePausedMutations(),te(this,Wt).onFocus())})),we(this,$u,MO.subscribe(async t=>{t&&(await this.resumePausedMutations(),te(this,Wt).onOnline())})))}unmount(){var t,e;yg(this,xl)._--,te(this,xl)===0&&((t=te(this,Eu))==null||t.call(this),we(this,Eu,void 0),(e=te(this,$u))==null||e.call(this),we(this,$u,void 0))}isFetching(t){return te(this,Wt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return te(this,gl).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=te(this,Wt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=te(this,Wt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Sl(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return te(this,Wt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=te(this,Wt).get(r.queryHash),s=i==null?void 0:i.state.data,a=jq(e,s);if(a!==void 0)return te(this,Wt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Mn.batch(()=>te(this,Wt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=te(this,Wt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=te(this,Wt);Mn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=te(this,Wt);return Mn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Mn.batch(()=>te(this,Wt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(vr).catch(vr)}invalidateQueries(t,e={}){return Mn.batch(()=>(te(this,Wt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Mn.batch(()=>te(this,Wt).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(vr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=te(this,Wt).build(this,e);return n.isStaleByTime(Sl(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(vr).catch(vr)}fetchInfiniteQuery(t){return t.behavior=TN(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(vr).catch(vr)}ensureInfiniteQueryData(t){return t.behavior=TN(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return MO.isOnline()?te(this,gl).resumePausedMutations():Promise.resolve()}getQueryCache(){return te(this,Wt)}getMutationCache(){return te(this,gl)}getDefaultOptions(){return te(this,Ol)}setDefaultOptions(t){we(this,Ol,t)}setQueryDefaults(t,e){te(this,Cu).set(wh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...te(this,Cu).values()],n={};return e.forEach(r=>{kh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){te(this,ju).set(wh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...te(this,ju).values()],n={};return e.forEach(r=>{kh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...te(this,Ol).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=qk(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Vk&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...te(this,Ol).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){te(this,Wt).clear(),te(this,gl).clear()}},Wt=new WeakMap,gl=new WeakMap,Ol=new WeakMap,Cu=new WeakMap,ju=new WeakMap,xl=new WeakMap,Eu=new WeakMap,$u=new WeakMap,g5),U5=C.createContext(void 0),Ho=t=>{const e=C.useContext(U5);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Uq=({client:t,children:e})=>(C.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),p.jsx(U5.Provider,{value:t,children:e})),W5=C.createContext(!1),Wq=()=>C.useContext(W5);W5.Provider;function Hq(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Gq=C.createContext(Hq()),Fq=()=>C.useContext(Gq),Kq=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?X5(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},Jq=t=>{C.useEffect(()=>{t.clearReset()},[t])},e9=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||X5(n,[t.error,r])),t9=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},n9=(t,e)=>t.isLoading&&t.isFetching&&!e,r9=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,_N=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function i9(t,e,n){var g,x,v,b;const r=Wq(),i=Fq(),s=Ho(),a=s.defaultQueryOptions(t);(x=(g=s.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||x.call(g,a);const o=s.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",t9(a),Kq(a,i,o),Jq(i);const u=!s.getQueryCache().get(a.queryHash),[d]=C.useState(()=>new e(s,a)),h=d.getOptimisticResult(a),m=!r&&t.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(k=>{const w=m?d.subscribe(Mn.batchCalls(k)):vr;return d.updateResult(),w},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),C.useEffect(()=>{d.setOptions(a)},[a,d]),r9(a,h))throw _N(a,d,i);if(e9({result:h,errorResetBoundary:i,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw h.error;if((b=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||b.call(v,a,h),a.experimental_prefetchInRender&&!Qh.isServer()&&n9(h,r)){const k=u?_N(a,d,i):o==null?void 0:o.promise;k==null||k.catch(vr).finally(()=>{d.updateResult()})}return a.notifyOnChangeProps?h:d.trackResult(h)}function xa(t,e){return i9(t,Dq)}const H5=C.createContext({notifications:[],notify:()=>{},dismiss:()=>{}});function ad(){return C.useContext(H5)}let s9=0;function a9({children:t}){const[e,n]=C.useState([]),r=C.useCallback(s=>{n(a=>a.filter(o=>o.id!==s))},[]),i=C.useCallback((s,a,o)=>{const u=String(++s9),d=s==="error"||s==="warning";n(h=>[...h.slice(-2),{id:u,type:s,message:a,details:o,persistent:d}]),d||setTimeout(()=>r(u),s==="success"?3e3:5e3)},[r]);return p.jsxs(H5.Provider,{value:{notifications:e,notify:i,dismiss:r},children:[t,p.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>p.jsxs("div",{role:"alert","aria-live":"polite",className:`px-4 py-3 rounded-md shadow-lg border text-sm ${s.type==="success"?"bg-[var(--color-surface-raised)] border-[var(--color-success)] text-[var(--color-success)]":s.type==="warning"?"bg-[var(--color-surface-raised)] border-[var(--color-warning)] text-[var(--color-warning)]":s.type==="error"?"bg-[var(--color-surface-raised)] border-[var(--color-error)] text-[var(--color-error)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] text-[var(--color-text)]"}`,children:[p.jsxs("div",{className:"flex items-start justify-between gap-2",children:[p.jsx("p",{children:s.message}),s.persistent&&p.jsx("button",{onClick:()=>r(s.id),className:"text-[var(--color-muted)] hover:text-[var(--color-text)] shrink-0","aria-label":"Dismiss notification",children:"x"})]}),s.details&&p.jsxs("details",{className:"mt-2 text-xs text-[var(--color-muted)]",children:[p.jsx("summary",{className:"cursor-pointer",children:"Details"}),p.jsx("pre",{className:"mt-1 whitespace-pre-wrap font-[var(--font-mono)]",children:s.details})]})]},s.id))})]})}/**
61
+ * @license lucide-react v0.577.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const G5=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
66
+ * @license lucide-react v0.577.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const l9=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
+ * @license lucide-react v0.577.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const o9=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
76
+ * @license lucide-react v0.577.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const AN=t=>{const e=o9(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
81
+ * @license lucide-react v0.577.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */var c9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
86
+ * @license lucide-react v0.577.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const u9=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
91
+ * @license lucide-react v0.577.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const d9=C.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},u)=>C.createElement("svg",{ref:u,...c9,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:G5("lucide",i),...!s&&!u9(o)&&{"aria-hidden":"true"},...o},[...a.map(([d,h])=>C.createElement(d,h)),...Array.isArray(s)?s:[s]]));/**
96
+ * @license lucide-react v0.577.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Te=(t,e)=>{const n=C.forwardRef(({className:r,...i},s)=>C.createElement(d9,{ref:s,iconNode:e,className:G5(`lucide-${l9(AN(t))}`,`lucide-${t}`,r),...i}));return n.displayName=AN(t),n};/**
101
+ * @license lucide-react v0.577.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const f9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zO=Te("arrow-left",f9);/**
106
+ * @license lucide-react v0.577.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const h9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],p9=Te("arrow-right",h9);/**
111
+ * @license lucide-react v0.577.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const m9=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Uk=Te("book-open",m9);/**
116
+ * @license lucide-react v0.577.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const g9=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],F5=Te("briefcase",g9);/**
121
+ * @license lucide-react v0.577.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const O9=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],x9=Te("check",O9);/**
126
+ * @license lucide-react v0.577.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const v9=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ra=Te("chevron-down",v9);/**
131
+ * @license lucide-react v0.577.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const y9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ia=Te("chevron-right",y9);/**
136
+ * @license lucide-react v0.577.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const b9=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Bx=Te("circle-check-big",b9);/**
141
+ * @license lucide-react v0.577.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const S9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],w9=Te("circle-arrow-up",S9);/**
146
+ * @license lucide-react v0.577.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const k9=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Q9=Te("copy",k9);/**
151
+ * @license lucide-react v0.577.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const C9=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],K5=Te("database",C9);/**
156
+ * @license lucide-react v0.577.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const j9=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],DO=Te("download",j9);/**
161
+ * @license lucide-react v0.577.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const E9=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Wk=Te("external-link",E9);/**
166
+ * @license lucide-react v0.577.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const $9=[["path",{d:"M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z",key:"1340ok"}],["path",{d:"M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z",key:"1hz3m3"}],["path",{d:"M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z",key:"1oz8n2"}],["path",{d:"M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z",key:"1ff65i"}],["path",{d:"M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z",key:"pdip6e"}]],N9=Te("figma",$9);/**
171
+ * @license lucide-react v0.577.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const T9=[["path",{d:"M4 11V4a2 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 2H6a2 2 0 0 1-2-2v-1",key:"1q9hii"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],P9=Te("file-input",T9);/**
176
+ * @license lucide-react v0.577.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const _9=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 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 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],qx=Te("file-output",_9);/**
181
+ * @license lucide-react v0.577.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const A9=[["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 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],To=Te("file-text",A9);/**
186
+ * @license lucide-react v0.577.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const R9=[["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"}]],M9=Te("file",R9);/**
191
+ * @license lucide-react v0.577.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const z9=[["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"}]],RN=Te("folder-open",z9);/**
196
+ * @license lucide-react v0.577.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const D9=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],J5=Te("folder-tree",D9);/**
201
+ * @license lucide-react v0.577.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const L9=[["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"}]],eM=Te("folder",L9);/**
206
+ * @license lucide-react v0.577.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const X9=[["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"}]],Mi=Te("git-branch",X9);/**
211
+ * @license lucide-react v0.577.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const Z9=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],tM=Te("github",Z9);/**
216
+ * @license lucide-react v0.577.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const I9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],B9=Te("globe",I9);/**
221
+ * @license lucide-react v0.577.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const q9=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],V9=Te("grip-vertical",q9);/**
226
+ * @license lucide-react v0.577.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const Y9=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],U9=Te("heart",Y9);/**
231
+ * @license lucide-react v0.577.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const W9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],nM=Te("info",W9);/**
236
+ * @license lucide-react v0.577.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const H9=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],G9=Te("layers",H9);/**
241
+ * @license lucide-react v0.577.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const F9=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],K9=Te("layout-grid",F9);/**
246
+ * @license lucide-react v0.577.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const J9=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],eV=Te("layout-dashboard",J9);/**
251
+ * @license lucide-react v0.577.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const tV=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],nV=Te("list",tV);/**
256
+ * @license lucide-react v0.577.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const rV=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Po=Te("loader-circle",rV);/**
261
+ * @license lucide-react v0.577.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const iV=[["path",{d:"M5 12h14",key:"1ays0h"}]],sV=Te("minus",iV);/**
266
+ * @license lucide-react v0.577.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const aV=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],lV=Te("monitor",aV);/**
271
+ * @license lucide-react v0.577.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const oV=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],cV=Te("moon",oV);/**
276
+ * @license lucide-react v0.577.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const uV=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Ch=Te("package",uV);/**
281
+ * @license lucide-react v0.577.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const dV=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Nu=Te("pencil",dV);/**
286
+ * @license lucide-react v0.577.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const fV=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],hV=Te("play",fV);/**
291
+ * @license lucide-react v0.577.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const pV=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Hk=Te("plug",pV);/**
296
+ * @license lucide-react v0.577.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const mV=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ln=Te("plus",mV);/**
301
+ * @license lucide-react v0.577.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const gV=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],rM=Te("refresh-cw",gV);/**
306
+ * @license lucide-react v0.577.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const OV=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],xV=Te("rocket",OV);/**
311
+ * @license lucide-react v0.577.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const vV=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],jh=Te("save",vV);/**
316
+ * @license lucide-react v0.577.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const yV=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],bV=Te("scale",yV);/**
321
+ * @license lucide-react v0.577.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const SV=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Nl=Te("search",SV);/**
326
+ * @license lucide-react v0.577.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const wV=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],th=Te("settings",wV);/**
331
+ * @license lucide-react v0.577.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const kV=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],QV=Te("sun",kV);/**
336
+ * @license lucide-react v0.577.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const CV=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ld=Te("trash-2",CV);/**
341
+ * @license lucide-react v0.577.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const jV=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Tu=Te("triangle-alert",jV);/**
346
+ * @license lucide-react v0.577.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const EV=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],LO=Te("upload",EV);/**
351
+ * @license lucide-react v0.577.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const $V=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],iM=Te("users-round",$V);/**
356
+ * @license lucide-react v0.577.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const NV=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],hi=Te("users",NV);/**
361
+ * @license lucide-react v0.577.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const TV=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qn=Te("x",TV);/**
366
+ * @license lucide-react v0.577.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const PV=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],sa=Te("zap",PV),sM="bmad-studio-theme";function _V(){const t=localStorage.getItem(sM);return t==="dark"||t==="light"?t:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function aM(t){t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem(sM,t)}function lM(){const e=(document.documentElement.classList.contains("dark")?"dark":"light")==="dark"?"light":"dark";return aM(e),e}const MN=t=>{let e;const n=new Set,r=(d,h)=>{const m=typeof d=="function"?d(e):d;if(!Object.is(m,e)){const g=e;e=h??(typeof m!="object"||m===null)?m:Object.assign({},e,m),n.forEach(x=>x(e,g))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(r,i,o);return o},AV=(t=>t?MN(t):MN),RV=t=>t;function MV(t,e=RV){const n=zf.useSyncExternalStore(t.subscribe,zf.useCallback(()=>e(t.getState()),[t,e]),zf.useCallback(()=>e(t.getInitialState()),[t,e]));return zf.useDebugValue(n),n}const zN=t=>{const e=AV(t),n=r=>MV(e,r);return Object.assign(n,e),n},zV=(t=>t?zN(t):zN),Eh=zV(t=>({theme:document.documentElement.classList.contains("dark")?"dark":"light",setTheme:e=>t({theme:e})})),DN=1e3,DV=3e4;class LV{constructor(e){this.ws=null,this.retryMs=DN,this.retryTimer=null,this.handlers=[],this.statusHandlers=[],this.closed=!1,this.url=e}connect(){if(!this.closed)try{this.ws=new WebSocket(this.url),this.ws.onopen=()=>{this.retryMs=DN,this.notifyStatus(!0)},this.ws.onmessage=e=>{try{const n=JSON.parse(e.data);for(const r of this.handlers)r(n)}catch{}},this.ws.onclose=()=>{this.notifyStatus(!1),this.scheduleReconnect()},this.ws.onerror=()=>{}}catch{this.scheduleReconnect()}}scheduleReconnect(){this.closed||(this.retryTimer=setTimeout(()=>{this.retryMs=Math.min(this.retryMs*2,DV),this.connect()},this.retryMs))}notifyStatus(e){for(const n of this.statusHandlers)n(e)}onMessage(e){return this.handlers.push(e),()=>{this.handlers=this.handlers.filter(n=>n!==e)}}onStatusChange(e){return this.statusHandlers.push(e),()=>{this.statusHandlers=this.statusHandlers.filter(n=>n!==e)}}close(){this.closed=!0,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.ws&&(this.ws.close(),this.ws=null)}}function XV(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function ZV(t){const e=C.useRef(null),[n,r]=C.useState(!1),i=C.useCallback(s=>{t==null||t(s)},[t]);return C.useEffect(()=>{const s=new LV(XV());e.current=s,s.onStatusChange(r);const a=s.onMessage(i);return s.connect(),()=>{a(),s.close()}},[i]),{connected:n}}const NS="BMAD Studio";function IV(t){const e=t==null?void 0:t.appTitle;if(typeof e!="string")return NS;const n=e.trim();return n||NS}function BV(){const[t,e]=C.useState(NS);return C.useEffect(()=>{let n=!1;const r=new AbortController;return fetch("/api/settings",{cache:"no-store",signal:r.signal}).then(i=>i.ok?i.json():null).then(i=>{n||e(IV(i))}).catch(i=>{(i==null?void 0:i.name)!=="AbortError"&&console.warn("[useAppTitle] failed to load /api/settings:",i)}),()=>{n=!0,r.abort()}},[]),C.useEffect(()=>{document.title=t},[t]),t}const qV=[{to:"/",label:"Overview",icon:eV},{to:"/agents",label:"Agents",icon:hi,badgeKey:"agents"},{to:"/teams",label:"Teams",icon:iM,badgeKey:"teams"},{to:"/skills",label:"Skills",icon:sa,badgeKey:"skills"},{to:"/workflows",label:"Workflows",icon:Mi,badgeKey:"workflows"},{to:"/connections",label:"Data Sources",icon:Hk,badgeKey:"connections"},{to:"/workspace",label:"Workspace",icon:F5},{to:"/modules",label:"Modules",icon:Ch,badgeKey:"modules"}],VV=[{to:"/outputs",label:"Outputs",icon:qx},{to:"/commands",label:"Commands",icon:Uk},{to:"/settings",label:"Settings",icon:th},{to:"/files",label:"Files",icon:J5}];function LN({to:t,label:e,icon:n,badge:r}){return p.jsxs(Ik,{to:t,end:t==="/",className:({isActive:i})=>`flex items-center gap-3 px-3 py-2 min-h-[44px] rounded-md text-sm transition-colors ${i?"text-[var(--color-accent)] font-bold bg-[var(--color-surface-raised)]":"text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsx(n,{size:18}),p.jsx("span",{className:"flex-1",children:e}),r!==void 0&&r>0&&p.jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)]",children:r})]})}function YV(){const t=Eh(u=>u.theme),e=Eh(u=>u.setTheme),[n,r]=C.useState({}),i=C.useRef(null),s=C.useCallback(()=>{Promise.all([fetch("/api/overview").then(u=>u.json()).catch(()=>null),fetch("/api/modules").then(u=>u.json()).catch(()=>null)]).then(([u,d])=>{var m,g,x,v,b;const h={};u!=null&&u.sections&&(h.agents=((m=u.sections.team)==null?void 0:m.count)??0,h.teams=((g=u.sections.teams)==null?void 0:g.count)??0,h.skills=((x=u.sections.toolkit)==null?void 0:x.count)??0,h.workflows=((v=u.sections.process)==null?void 0:v.count)??0,h.connections=((b=u.sections.ideConfigs)==null?void 0:b.count)??0),Array.isArray(d)&&(h.modules=d.length),r(h)})},[]);C.useEffect(()=>{s()},[s]),ZV(C.useCallback(()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(s,200)},[s]));const a=BV();function o(){const u=lM();e(u)}return p.jsxs("aside",{className:"w-60 h-screen flex flex-col border-r border-[var(--color-border-subtle)] bg-[var(--color-bg)]",children:[p.jsx("div",{className:"px-4 py-5",children:p.jsx("h1",{className:"text-lg font-extrabold text-[var(--color-text)]",children:a})}),p.jsxs("nav",{className:"flex-1 px-2 space-y-1","aria-label":"Main navigation",children:[qV.map(u=>p.jsx(LN,{to:u.to,label:u.label,icon:u.icon,badge:u.badgeKey?n[u.badgeKey]:void 0},u.to)),p.jsx("div",{className:"my-3 border-t border-[var(--color-border-subtle)]"}),VV.map(u=>p.jsx(LN,{...u},u.to))]}),p.jsxs("div",{className:"px-3 py-3 border-t border-[var(--color-border-subtle)] space-y-1",children:[p.jsxs(Ik,{to:"/about",className:({isActive:u})=>`flex items-center gap-2 px-3 py-2 min-h-[44px] w-full rounded-md text-sm transition-colors ${u?"text-[var(--color-accent)] font-bold bg-[var(--color-surface-raised)]":"text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsx(nM,{size:18}),p.jsx("span",{children:"About"})]}),p.jsxs("button",{onClick:o,className:"flex items-center gap-2 px-3 py-2 min-h-[44px] w-full rounded-md text-sm text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:[t==="dark"?p.jsx(QV,{size:18}):p.jsx(cV,{size:18}),p.jsx("span",{children:t==="dark"?"Light mode":"Dark mode"})]})]})]})}const UV={agents:"Agents",teams:"Teams",skills:"Skills",workflows:"Workflows",outputs:"Outputs",connections:"Connections",workspace:"Workspace",modules:"Modules",packages:"Packages",files:"Files",settings:"Settings"};function WV(){const e=Qs().pathname.split("/").filter(Boolean);return e.length===0?null:p.jsx("nav",{"aria-label":"Breadcrumb",className:"mb-4 text-sm text-[var(--color-muted)]",children:p.jsxs("ol",{className:"flex items-center gap-1",children:[p.jsx("li",{children:p.jsx(nr,{to:"/",className:"hover:text-[var(--color-text)] transition-colors",children:"Home"})}),e.map((n,r)=>{const i="/"+e.slice(0,r+1).join("/"),s=UV[n]||n,a=r===e.length-1;return p.jsxs("li",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"text-[var(--color-border-subtle)]",children:"/"}),a?p.jsx("span",{className:"text-[var(--color-text)]",children:s}):p.jsx(nr,{to:i,className:"hover:text-[var(--color-text)] transition-colors",children:s})]},i)})]})})}function HV(){const[t,e]=C.useState(!1),[n,r]=C.useState(""),[i,s]=C.useState([]),[a,o]=C.useState(0),u=C.useRef(null),d=Oa(),h=C.useCallback(()=>{r(""),s([]),o(0),e(!0)},[]),m=C.useCallback(()=>{e(!1)},[]);C.useEffect(()=>{function v(b){(b.metaKey||b.ctrlKey)&&b.key==="k"&&(b.preventDefault(),t?m():h()),b.key==="Escape"&&t&&m()}return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[t,h,m]),C.useEffect(()=>{var v;t&&((v=u.current)==null||v.focus())},[t]),C.useEffect(()=>{if(!n.trim())return;const v=new AbortController;return fetch(`/api/search?q=${encodeURIComponent(n)}`,{signal:v.signal}).then(b=>b.json()).then(b=>s(b)).catch(()=>{}),()=>v.abort()},[n]);function g(v){d(`${{agent:"/agents",skill:"/skills",workflow:"/workflows"}[v.type]}/${v.id}`),m()}function x(v){v.key==="ArrowDown"?(v.preventDefault(),o(b=>Math.min(b+1,i.length-1))):v.key==="ArrowUp"?(v.preventDefault(),o(b=>Math.max(b-1,0))):v.key==="Enter"&&i[a]&&g(i[a])}return t?p.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:m,children:p.jsxs("div",{className:"w-full max-w-lg bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-xl shadow-2xl overflow-hidden",onClick:v=>v.stopPropagation(),onKeyDown:x,children:[p.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[var(--color-border-subtle)]",children:[p.jsx(Nl,{size:18,className:"text-[var(--color-muted)]"}),p.jsx("input",{ref:u,type:"text",placeholder:"Search agents, skills, workflows...",value:n,onChange:v=>{r(v.target.value),v.target.value.trim()||s([])},className:"flex-1 bg-transparent text-sm text-[var(--color-text)] outline-none placeholder:text-[var(--color-muted)]"}),p.jsx("kbd",{className:"text-xs text-[var(--color-muted)] px-1.5 py-0.5 rounded border border-[var(--color-border-subtle)]",children:"esc"})]}),i.length>0&&p.jsx("div",{className:"max-h-64 overflow-y-auto py-2",children:i.map((v,b)=>p.jsxs("button",{onClick:()=>g(v),className:`w-full px-4 py-2 text-left flex items-center gap-3 text-sm ${b===a?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-muted)] hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] uppercase",children:v.type}),p.jsxs("div",{children:[p.jsx("p",{className:"font-bold",children:v.name}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate",children:v.description})]})]},`${v.type}-${v.id}`))}),n&&i.length===0&&p.jsx("div",{className:"px-4 py-6 text-center text-sm text-[var(--color-muted)]",children:"No results found"})]})}):null}function GV(){return p.jsxs("div",{className:"flex h-screen overflow-hidden",children:[p.jsx(YV,{}),p.jsx("main",{className:"flex-1 overflow-y-auto",children:p.jsxs("div",{className:"px-8 py-6",children:[p.jsx(WV,{}),p.jsx(D8,{})]})}),p.jsx(HV,{})]})}function Xi({icon:t,title:e,description:n,actions:r}){return p.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[p.jsx(t,{size:48,className:"text-[var(--color-muted)] mb-4",strokeWidth:1.5}),p.jsx("h2",{className:"text-lg font-bold text-[var(--color-text)] mb-2",children:e}),p.jsx("p",{className:"text-sm text-[var(--color-muted)] max-w-md mb-6",children:n}),r&&p.jsx("div",{className:"flex gap-3",children:r})]})}function oM(){return xa({queryKey:["workflows"],queryFn:async()=>{const t=await fetch("/api/workflows");if(!t.ok)throw new Error("Failed to fetch workflows");return t.json()},staleTime:3e4})}function cM(t){return xa({queryKey:["workflows",{id:t}],queryFn:async()=>{const e=await fetch(`/api/workflows/${t}`);if(!e.ok)throw new Error(`Failed to fetch workflow ${t}`);return e.json()},enabled:!!t})}function FV({workflow:t,onClose:e,onSaved:n}){const r=Ho(),[i,s]=C.useState(t.description||""),[a,o]=C.useState(null),[u,d]=C.useState(!1),h=async()=>{var m;d(!0),o(null);try{const g=await fetch(`/api/workflows/${encodeURIComponent(t.id)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:i.trim()})});if(!g.ok){const x=await g.json();throw new Error(((m=x.error)==null?void 0:m.message)??"Failed to update workflow")}await r.invalidateQueries({queryKey:["workflows"]}),await r.invalidateQueries({queryKey:["workflow",t.id]}),n()}catch(g){o(g instanceof Error?g.message:"Failed to update workflow")}finally{d(!1)}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"Edit Workflow"}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:t.name,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Type"}),p.jsx("input",{type:"text",value:t.type??"step-based",disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Type cannot be changed after creation"})]}),t.phase&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Phase"}),p.jsx("input",{type:"text",value:t.phase,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:i,onChange:m=>s(m.target.value),rows:3,placeholder:"What does this workflow do?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{className:"text-xs text-[var(--color-muted)] space-y-1 pt-2 border-t border-[var(--color-border-subtle)]",children:[p.jsxs("p",{children:["Module: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.module??"unknown"})]}),p.jsxs("p",{children:["Steps: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.steps.length})]}),p.jsxs("p",{children:["File: ",p.jsx("code",{className:"font-[var(--font-mono)] break-all",children:t.entryPoint})]})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:h,disabled:u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(jh,{size:14}),u?"Saving...":"Save Changes"]})]})]})]})}function KV(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const JV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tY={};function XN(t,e){return(tY.jsx?eY:JV).test(t)}const nY=/[ \t\n\f\r]/g;function rY(t){return typeof t=="object"?t.type==="text"?ZN(t.value):!1:ZN(t)}function ZN(t){return t.replace(nY,"")===""}let bp=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};bp.prototype.normal={};bp.prototype.property={};bp.prototype.space=void 0;function uM(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bp(n,r,e)}function TS(t){return t.toLowerCase()}class jr{constructor(e,n){this.attribute=n,this.property=e}}jr.prototype.attribute="";jr.prototype.booleanish=!1;jr.prototype.boolean=!1;jr.prototype.commaOrSpaceSeparated=!1;jr.prototype.commaSeparated=!1;jr.prototype.defined=!1;jr.prototype.mustUseProperty=!1;jr.prototype.number=!1;jr.prototype.overloadedBoolean=!1;jr.prototype.property="";jr.prototype.spaceSeparated=!1;jr.prototype.space=void 0;let iY=0;const Ue=Go(),hn=Go(),PS=Go(),Oe=Go(),_t=Go(),lu=Go(),Dr=Go();function Go(){return 2**++iY}const _S=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:hn,commaOrSpaceSeparated:Dr,commaSeparated:lu,number:Oe,overloadedBoolean:PS,spaceSeparated:_t},Symbol.toStringTag,{value:"Module"})),t0=Object.keys(_S);class Gk extends jr{constructor(e,n,r,i){let s=-1;if(super(e,n),IN(this,"space",i),typeof r=="number")for(;++s<t0.length;){const a=t0[s];IN(this,t0[s],(r&_S[a])===_S[a])}}}Gk.prototype.defined=!0;function IN(t,e,n){n&&(t[e]=n)}function od(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Gk(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[TS(r)]=r,n[TS(s.attribute)]=r}return new bp(e,n,t.space)}const dM=od({properties:{ariaActiveDescendant:null,ariaAtomic:hn,ariaAutoComplete:null,ariaBusy:hn,ariaChecked:hn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:_t,ariaCurrent:null,ariaDescribedBy:_t,ariaDetails:null,ariaDisabled:hn,ariaDropEffect:_t,ariaErrorMessage:null,ariaExpanded:hn,ariaFlowTo:_t,ariaGrabbed:hn,ariaHasPopup:null,ariaHidden:hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_t,ariaLevel:Oe,ariaLive:null,ariaModal:hn,ariaMultiLine:hn,ariaMultiSelectable:hn,ariaOrientation:null,ariaOwns:_t,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:hn,ariaReadOnly:hn,ariaRelevant:null,ariaRequired:hn,ariaRoleDescription:_t,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:hn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function fM(t,e){return e in t?t[e]:e}function hM(t,e){return fM(t,e.toLowerCase())}const sY=od({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lu,acceptCharset:_t,accessKey:_t,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:_t,autoFocus:Ue,autoPlay:Ue,blocking:_t,capture:null,charSet:null,checked:Ue,cite:null,className:_t,cols:Oe,colSpan:null,content:null,contentEditable:hn,controls:Ue,controlsList:_t,coords:Oe|lu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:PS,draggable:hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:_t,height:Oe,hidden:PS,high:Oe,href:null,hrefLang:null,htmlFor:_t,httpEquiv:_t,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:_t,itemRef:_t,itemScope:Ue,itemType:_t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:Oe,pattern:null,ping:_t,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:_t,required:Ue,reversed:Ue,rows:Oe,rowSpan:Oe,sandbox:_t,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:hn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_t,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:hn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:hM}),aY=od({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:Dr,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:_t,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:lu,g2:lu,glyphName:lu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:Dr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Dr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Dr,rev:Dr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Dr,requiredFeatures:Dr,requiredFonts:Dr,requiredFormats:Dr,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:Dr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Dr,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Dr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fM}),pM=od({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),mM=od({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hM}),gM=od({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),lY={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"},oY=/[A-Z]/g,BN=/-[a-z]/g,cY=/^data[-\w.:]+$/i;function uY(t,e){const n=TS(e);let r=e,i=jr;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cY.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(BN,fY);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!BN.test(s)){let a=s.replace(oY,dY);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Gk}return new i(r,e)}function dY(t){return"-"+t.toLowerCase()}function fY(t){return t.charAt(1).toUpperCase()}const hY=uM([dM,sY,pM,mM,gM],"html"),Fk=uM([dM,aY,pM,mM,gM],"svg");function pY(t){return t.join(" ").trim()}var Ic={},n0,qN;function mY(){if(qN)return n0;qN=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
371
+ `,d="/",h="*",m="",g="comment",x="declaration";function v(k,w){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];w=w||{};var j=1,Q=1;function E(P){var D=P.match(e);D&&(j+=D.length);var _=P.lastIndexOf(u);Q=~_?P.length-_:Q+P.length}function R(){var P={line:j,column:Q};return function(D){return D.position=new T(P),W(),D}}function T(P){this.start=P,this.end={line:j,column:Q},this.source=w.source}T.prototype.content=k;function A(P){var D=new Error(w.source+":"+j+":"+Q+": "+P);if(D.reason=P,D.filename=w.source,D.line=j,D.column=Q,D.source=k,!w.silent)throw D}function I(P){var D=P.exec(k);if(D){var _=D[0];return E(_),k=k.slice(_.length),D}}function W(){I(n)}function F(P){var D;for(P=P||[];D=Z();)D!==!1&&P.push(D);return P}function Z(){var P=R();if(!(d!=k.charAt(0)||h!=k.charAt(1))){for(var D=2;m!=k.charAt(D)&&(h!=k.charAt(D)||d!=k.charAt(D+1));)++D;if(D+=2,m===k.charAt(D-1))return A("End of comment missing");var _=k.slice(2,D-2);return Q+=2,E(_),k=k.slice(D),Q+=2,P({type:g,comment:_})}}function B(){var P=R(),D=I(r);if(D){if(Z(),!I(i))return A("property missing ':'");var _=I(s),X=P({type:x,property:b(D[0].replace(t,m)),value:_?b(_[0].replace(t,m)):m});return I(a),X}}function H(){var P=[];F(P);for(var D;D=B();)D!==!1&&(P.push(D),F(P));return P}return W(),H()}function b(k){return k?k.replace(o,m):m}return n0=v,n0}var VN;function gY(){if(VN)return Ic;VN=1;var t=Ic&&Ic.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.default=n;const e=t(mY());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,e.default)(r),o=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:h}=u;o?i(d,h,u):h&&(s=s||{},s[d]=h)}),s}return Ic}var bf={},YN;function OY(){if(YN)return bf;YN=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(d){return!d||n.test(d)||t.test(d)},a=function(d,h){return h.toUpperCase()},o=function(d,h){return"".concat(h,"-")},u=function(d,h){return h===void 0&&(h={}),s(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(i,o):d=d.replace(r,o),d.replace(e,a))};return bf.camelCase=u,bf}var Sf,UN;function xY(){if(UN)return Sf;UN=1;var t=Sf&&Sf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(gY()),n=OY();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(o,u){o&&u&&(a[(0,n.camelCase)(o,s)]=u)}),a}return r.default=r,Sf=r,Sf}var vY=xY();const yY=mp(vY),OM=xM("end"),Kk=xM("start");function xM(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function bY(t){const e=Kk(t),n=OM(t);if(e&&n)return{start:e,end:n}}function nh(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?WN(t.position):"start"in t||"end"in t?WN(t):"line"in t||"column"in t?AS(t):""}function AS(t){return HN(t&&t.line)+":"+HN(t&&t.column)}function WN(t){return AS(t&&t.start)+"-"+AS(t&&t.end)}function HN(t){return t&&typeof t=="number"?t:1}class Un extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=nh(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Un.prototype.file="";Un.prototype.name="";Un.prototype.reason="";Un.prototype.message="";Un.prototype.stack="";Un.prototype.column=void 0;Un.prototype.line=void 0;Un.prototype.ancestors=void 0;Un.prototype.cause=void 0;Un.prototype.fatal=void 0;Un.prototype.place=void 0;Un.prototype.ruleId=void 0;Un.prototype.source=void 0;const Jk={}.hasOwnProperty,SY=new Map,wY=/[A-Z]/g,kY=new Set(["table","tbody","thead","tfoot","tr"]),QY=new Set(["td","th"]),vM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function CY(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=AY(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_Y(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Fk:hY,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=yM(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function yM(t,e,n){if(e.type==="element")return jY(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return EY(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return NY(t,e,n);if(e.type==="mdxjsEsm")return $Y(t,e);if(e.type==="root")return TY(t,e,n);if(e.type==="text")return PY(t,e)}function jY(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Fk,t.schema=i),t.ancestors.push(e);const s=SM(t,e.tagName,!1),a=RY(t,e);let o=t2(t,e);return kY.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!rY(u):!0})),bM(t,a,s,e),e2(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function EY(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}$h(t,e.position)}function $Y(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);$h(t,e.position)}function NY(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Fk,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:SM(t,e.name,!0),a=MY(t,e),o=t2(t,e);return bM(t,a,s,e),e2(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function TY(t,e,n){const r={};return e2(r,t2(t,e)),t.create(e,t.Fragment,r,n)}function PY(t,e){return e.value}function bM(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function e2(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function _Y(t,e,n){return r;function r(i,s,a,o){const d=Array.isArray(a.children)?n:e;return o?d(s,a,o):d(s,a)}}function AY(t,e){return n;function n(r,i,s,a){const o=Array.isArray(s.children),u=Kk(r);return e(i,s,a,o,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function RY(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Jk.call(e.properties,i)){const s=zY(t,i,e.properties[i]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&QY.has(e.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function MY(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else $h(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else $h(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function t2(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:SY;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const d=i.get(u)||0;a=u+"-"+d,i.set(u,d+1)}}const o=yM(t,s,a);o!==void 0&&n.push(o)}return n}function zY(t,e,n){const r=uY(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?KV(n):pY(n)),r.property==="style"){let i=typeof n=="object"?n:DY(t,String(n));return t.stylePropertyNameCase==="css"&&(i=LY(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?lY[r.property]||r.property:r.attribute,n]}}function DY(t,e){try{return yY(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Un("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=vM+"#cannot-parse-style-attribute",i}}function SM(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const o=XN(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=XN(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Jk.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);$h(t)}function $h(t,e){const n=new Un("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=vM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function LY(t){const e={};let n;for(n in t)Jk.call(t,n)&&(e[XY(n)]=t[n]);return e}function XY(t){let e=t.replace(wY,ZY);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function ZY(t){return"-"+t.toLowerCase()}const r0={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"]},IY={};function BY(t,e){const n=IY,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wM(t,r,i)}function wM(t,e,n){if(qY(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return GN(t.children,e,n)}return Array.isArray(t)?GN(t,e,n):""}function GN(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=wM(t[i],e,n);return r.join("")}function qY(t){return!!(t&&typeof t=="object")}const FN=document.createElement("i");function n2(t){const e="&"+t+";";FN.innerHTML=e;const n=FN.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function bs(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function ai(t,e){return t.length>0?(bs(t,t.length,0,e),t):e}const KN={}.hasOwnProperty;function VY(t){const e={};let n=-1;for(;++n<t.length;)YY(e,t[n]);return e}function YY(t,e){let n;for(n in e){const i=(KN.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){KN.call(i,a)||(i[a]=[]);const o=s[a];UY(i[a],Array.isArray(o)?o:o?[o]:[])}}}function UY(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);bs(t,0,0,r)}function kM(t,e){const n=Number.parseInt(t,e);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 ou(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cs=Tl(/[A-Za-z]/),qr=Tl(/[\dA-Za-z]/),WY=Tl(/[#-'*+\--9=?A-Z^-~]/);function RS(t){return t!==null&&(t<32||t===127)}const MS=Tl(/\d/),HY=Tl(/[\dA-Fa-f]/),GY=Tl(/[!-/:-@[-`{-~]/);function Le(t){return t!==null&&t<-2}function kr(t){return t!==null&&(t<0||t===32)}function mt(t){return t===-2||t===-1||t===32}const FY=Tl(new RegExp("\\p{P}|\\p{S}","u")),KY=Tl(/\s/);function Tl(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function cd(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&qr(t.charCodeAt(n+1))&&qr(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Rt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return mt(u)?(t.enter(n),o(u)):e(u)}function o(u){return mt(u)&&s++<i?(t.consume(u),o):(t.exit(n),e(u))}}const JY={tokenize:e7};function e7(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Rt(t,e,"linePrefix")}function i(o){return t.enter("paragraph"),s(o)}function s(o){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return Le(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const t7={tokenize:n7},JN={tokenize:r7};function n7(t){const e=this,n=[];let r=0,i,s,a;return o;function o(Q){if(r<n.length){const E=n[r];return e.containerState=E[1],t.attempt(E[0].continuation,u,d)(Q)}return d(Q)}function u(Q){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&j();const E=e.events.length;let R=E,T;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){T=e.events[R][1].end;break}w(r);let A=E;for(;A<e.events.length;)e.events[A][1].end={...T},A++;return bs(e.events,R+1,0,e.events.slice(E)),e.events.length=A,d(Q)}return o(Q)}function d(Q){if(r===n.length){if(!i)return g(Q);if(i.currentConstruct&&i.currentConstruct.concrete)return v(Q);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(JN,h,m)(Q)}function h(Q){return i&&j(),w(r),g(Q)}function m(Q){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,v(Q)}function g(Q){return e.containerState={},t.attempt(JN,x,v)(Q)}function x(Q){return r++,n.push([e.currentConstruct,e.containerState]),g(Q)}function v(Q){if(Q===null){i&&j(),w(0),t.consume(Q);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b(Q)}function b(Q){if(Q===null){k(t.exit("chunkFlow"),!0),w(0),t.consume(Q);return}return Le(Q)?(t.consume(Q),k(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(Q),b)}function k(Q,E){const R=e.sliceStream(Q);if(E&&R.push(null),Q.previous=s,s&&(s.next=Q),s=Q,i.defineSkip(Q.start),i.write(R),e.parser.lazy[Q.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<a&&(!i.events[T][1].end||i.events[T][1].end.offset>a))return;const A=e.events.length;let I=A,W,F;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){if(W){F=e.events[I][1].end;break}W=!0}for(w(r),T=A;T<e.events.length;)e.events[T][1].end={...F},T++;bs(e.events,I+1,0,e.events.slice(A)),e.events.length=T}}function w(Q){let E=n.length;for(;E-- >Q;){const R=n[E];e.containerState=R[1],R[0].exit.call(e,t)}n.length=Q}function j(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function r7(t,e,n){return Rt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function eT(t){if(t===null||kr(t)||KY(t))return 1;if(FY(t))return 2}function r2(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const zS={name:"attention",resolveAll:i7,tokenize:s7};function i7(t,e){let n=-1,r,i,s,a,o,u,d,h;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},g={...t[n][1].start};tT(m,-u),tT(g,u),a={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=ai(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=ai(d,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),d=ai(d,r2(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=ai(d,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,d=ai(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,bs(t,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function s7(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=eT(r);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),o(u)}function o(u){if(u===s)return t.consume(u),o;const d=t.exit("attentionSequence"),h=eT(u),m=!h||h===2&&i||n.includes(u),g=!i||i===2&&h||n.includes(r);return d._open=!!(s===42?m:m&&(i||!g)),d._close=!!(s===42?g:g&&(h||!m)),e(u)}}function tT(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const a7={name:"autolink",tokenize:l7};function l7(t,e,n){let r=0;return i;function i(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(x){return cs(x)?(t.consume(x),a):x===64?n(x):d(x)}function a(x){return x===43||x===45||x===46||qr(x)?(r=1,o(x)):d(x)}function o(x){return x===58?(t.consume(x),r=0,u):(x===43||x===45||x===46||qr(x))&&r++<32?(t.consume(x),o):(r=0,d(x))}function u(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):x===null||x===32||x===60||RS(x)?n(x):(t.consume(x),u)}function d(x){return x===64?(t.consume(x),h):WY(x)?(t.consume(x),d):n(x)}function h(x){return qr(x)?m(x):n(x)}function m(x){return x===46?(t.consume(x),r=0,h):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):g(x)}function g(x){if((x===45||qr(x))&&r++<63){const v=x===45?g:m;return t.consume(x),v}return n(x)}}const Vx={partial:!0,tokenize:o7};function o7(t,e,n){return r;function r(s){return mt(s)?Rt(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||Le(s)?e(s):n(s)}}const QM={continuation:{tokenize:u7},exit:d7,name:"blockQuote",tokenize:c7};function c7(t,e,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return mt(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function u7(t,e,n){const r=this;return i;function i(a){return mt(a)?Rt(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(QM,e,n)(a)}}function d7(t){t.exit("blockQuote")}const CM={name:"characterEscape",tokenize:f7};function f7(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return GY(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const jM={name:"characterReference",tokenize:h7};function h7(t,e,n){const r=this;let i=0,s,a;return o;function o(m){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),u}function u(m){return m===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(m),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),s=31,a=qr,h(m))}function d(m){return m===88||m===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(m),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=HY,h):(t.enter("characterReferenceValue"),s=7,a=MS,h(m))}function h(m){if(m===59&&i){const g=t.exit("characterReferenceValue");return a===qr&&!n2(r.sliceSerialize(g))?n(m):(t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(m)&&i++<s?(t.consume(m),h):n(m)}}const nT={partial:!0,tokenize:m7},rT={concrete:!0,name:"codeFenced",tokenize:p7};function p7(t,e,n){const r=this,i={partial:!0,tokenize:R};let s=0,a=0,o;return u;function u(T){return d(T)}function d(T){const A=r.events[r.events.length-1];return s=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,o=T,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(T)}function h(T){return T===o?(a++,t.consume(T),h):a<3?n(T):(t.exit("codeFencedFenceSequence"),mt(T)?Rt(t,m,"whitespace")(T):m(T))}function m(T){return T===null||Le(T)?(t.exit("codeFencedFence"),r.interrupt?e(T):t.check(nT,b,E)(T)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(T))}function g(T){return T===null||Le(T)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),m(T)):mt(T)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Rt(t,x,"whitespace")(T)):T===96&&T===o?n(T):(t.consume(T),g)}function x(T){return T===null||Le(T)?m(T):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===null||Le(T)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),m(T)):T===96&&T===o?n(T):(t.consume(T),v)}function b(T){return t.attempt(i,E,k)(T)}function k(T){return t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),w}function w(T){return s>0&&mt(T)?Rt(t,j,"linePrefix",s+1)(T):j(T)}function j(T){return T===null||Le(T)?t.check(nT,b,E)(T):(t.enter("codeFlowValue"),Q(T))}function Q(T){return T===null||Le(T)?(t.exit("codeFlowValue"),j(T)):(t.consume(T),Q)}function E(T){return t.exit("codeFenced"),e(T)}function R(T,A,I){let W=0;return F;function F(D){return T.enter("lineEnding"),T.consume(D),T.exit("lineEnding"),Z}function Z(D){return T.enter("codeFencedFence"),mt(D)?Rt(T,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):B(D)}function B(D){return D===o?(T.enter("codeFencedFenceSequence"),H(D)):I(D)}function H(D){return D===o?(W++,T.consume(D),H):W>=a?(T.exit("codeFencedFenceSequence"),mt(D)?Rt(T,P,"whitespace")(D):P(D)):I(D)}function P(D){return D===null||Le(D)?(T.exit("codeFencedFence"),A(D)):I(D)}}}function m7(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const i0={name:"codeIndented",tokenize:O7},g7={partial:!0,tokenize:x7};function O7(t,e,n){const r=this;return i;function i(d){return t.enter("codeIndented"),Rt(t,s,"linePrefix",5)(d)}function s(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?u(d):Le(d)?t.attempt(g7,a,u)(d):(t.enter("codeFlowValue"),o(d))}function o(d){return d===null||Le(d)?(t.exit("codeFlowValue"),a(d)):(t.consume(d),o)}function u(d){return t.exit("codeIndented"),e(d)}}function x7(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Le(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Rt(t,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):Le(a)?i(a):n(a)}}const v7={name:"codeText",previous:b7,resolve:y7,tokenize:S7};function y7(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function b7(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function S7(t,e,n){let r=0,i,s;return a;function a(m){return t.enter("codeText"),t.enter("codeTextSequence"),o(m)}function o(m){return m===96?(t.consume(m),r++,o):(t.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(t.enter("space"),t.consume(m),t.exit("space"),u):m===96?(s=t.enter("codeTextSequence"),i=0,h(m)):Le(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),u):(t.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Le(m)?(t.exit("codeTextData"),u(m)):(t.consume(m),d)}function h(m){return m===96?(t.consume(m),i++,h):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(m)):(s.type="codeTextData",d(m))}}class w7{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&wf(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),wf(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wf(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){const n=this.left.splice(e,Number.POSITIVE_INFINITY);wf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);wf(this.left,n.reverse())}}}function wf(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function EM(t){const e={};let n=-1,r,i,s,a,o,u,d;const h=new w7(t);for(;++n<h.length;){for(;n in e;)n=e[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,k7(h,n)),n=e[n],d=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=h.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return bs(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!d}function k7(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],d={};let h,m,g=-1,x=n,v=0,b=0;const k=[b];for(;x;){for(;t.get(++i)[1]!==x;);s.push(i),x._tokenizer||(h=r.sliceStream(x),x.next||h.push(null),m&&a.defineSkip(x.start),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=n;++g<o.length;)o[g][0]==="exit"&&o[g-1][0]==="enter"&&o[g][1].type===o[g-1][1].type&&o[g][1].start.line!==o[g][1].end.line&&(b=g+1,k.push(b),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(a.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),g=k.length;g--;){const w=o.slice(k[g],k[g+1]),j=s.pop();u.push([j,j+w.length-1]),t.splice(j,2,w)}for(u.reverse(),g=-1;++g<u.length;)d[v+u[g][0]]=v+u[g][1],v+=u[g][1]-u[g][0]-1;return d}const Q7={resolve:j7,tokenize:E7},C7={partial:!0,tokenize:$7};function j7(t){return EM(t),t}function E7(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):Le(o)?t.check(C7,a,s)(o):(t.consume(o),i)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function $7(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Rt(t,s,"linePrefix")}function s(a){if(a===null||Le(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function $M(t,e,n,r,i,s,a,o,u){const d=u||Number.POSITIVE_INFINITY;let h=0;return m;function m(w){return w===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(w),t.exit(s),g):w===null||w===32||w===41||RS(w)?n(w):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),b(w))}function g(w){return w===62?(t.enter(s),t.consume(w),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===62?(t.exit("chunkString"),t.exit(o),g(w)):w===null||w===60||Le(w)?n(w):(t.consume(w),w===92?v:x)}function v(w){return w===60||w===62||w===92?(t.consume(w),x):x(w)}function b(w){return!h&&(w===null||w===41||kr(w))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(w)):h<d&&w===40?(t.consume(w),h++,b):w===41?(t.consume(w),h--,b):w===null||w===32||w===40||RS(w)?n(w):(t.consume(w),w===92?k:b)}function k(w){return w===40||w===41||w===92?(t.consume(w),b):b(w)}}function NM(t,e,n,r,i,s){const a=this;let o=0,u;return d;function d(x){return t.enter(r),t.enter(i),t.consume(x),t.exit(i),t.enter(s),h}function h(x){return o>999||x===null||x===91||x===93&&!u||x===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(t.exit(s),t.enter(i),t.consume(x),t.exit(i),t.exit(r),e):Le(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||Le(x)||o++>999?(t.exit("chunkString"),h(x)):(t.consume(x),u||(u=!mt(x)),x===92?g:m)}function g(x){return x===91||x===92||x===93?(t.consume(x),o++,m):m(x)}}function TM(t,e,n,r,i,s){let a;return o;function o(g){return g===34||g===39||g===40?(t.enter(r),t.enter(i),t.consume(g),t.exit(i),a=g===40?41:g,u):n(g)}function u(g){return g===a?(t.enter(i),t.consume(g),t.exit(i),t.exit(r),e):(t.enter(s),d(g))}function d(g){return g===a?(t.exit(s),u(a)):g===null?n(g):Le(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),Rt(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===a||g===null||Le(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?m:h)}function m(g){return g===a||g===92?(t.consume(g),h):h(g)}}function rh(t,e){let n;return r;function r(i){return Le(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):mt(i)?Rt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const N7={name:"definition",tokenize:P7},T7={partial:!0,tokenize:_7};function P7(t,e,n){const r=this;let i;return s;function s(x){return t.enter("definition"),a(x)}function a(x){return NM.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function o(x){return i=ou(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),u):n(x)}function u(x){return kr(x)?rh(t,d)(x):d(x)}function d(x){return $M(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return t.attempt(T7,m,m)(x)}function m(x){return mt(x)?Rt(t,g,"whitespace")(x):g(x)}function g(x){return x===null||Le(x)?(t.exit("definition"),r.parser.defined.push(i),e(x)):n(x)}}function _7(t,e,n){return r;function r(o){return kr(o)?rh(t,i)(o):n(o)}function i(o){return TM(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return mt(o)?Rt(t,a,"whitespace")(o):a(o)}function a(o){return o===null||Le(o)?e(o):n(o)}}const A7={name:"hardBreakEscape",tokenize:R7};function R7(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return Le(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const M7={name:"headingAtx",resolve:z7,tokenize:D7};function z7(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},bs(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function D7(t,e,n){let r=0;return i;function i(h){return t.enter("atxHeading"),s(h)}function s(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||kr(h)?(t.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(t.enter("atxHeadingSequence"),u(h)):h===null||Le(h)?(t.exit("atxHeading"),e(h)):mt(h)?Rt(t,o,"whitespace")(h):(t.enter("atxHeadingText"),d(h))}function u(h){return h===35?(t.consume(h),u):(t.exit("atxHeadingSequence"),o(h))}function d(h){return h===null||h===35||kr(h)?(t.exit("atxHeadingText"),o(h)):(t.consume(h),d)}}const L7=["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"],iT=["pre","script","style","textarea"],X7={concrete:!0,name:"htmlFlow",resolveTo:B7,tokenize:q7},Z7={partial:!0,tokenize:Y7},I7={partial:!0,tokenize:V7};function B7(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function q7(t,e,n){const r=this;let i,s,a,o,u;return d;function d(M){return h(M)}function h(M){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(M),m}function m(M){return M===33?(t.consume(M),g):M===47?(t.consume(M),s=!0,b):M===63?(t.consume(M),i=3,r.interrupt?e:$):cs(M)?(t.consume(M),a=String.fromCharCode(M),k):n(M)}function g(M){return M===45?(t.consume(M),i=2,x):M===91?(t.consume(M),i=5,o=0,v):cs(M)?(t.consume(M),i=4,r.interrupt?e:$):n(M)}function x(M){return M===45?(t.consume(M),r.interrupt?e:$):n(M)}function v(M){const G="CDATA[";return M===G.charCodeAt(o++)?(t.consume(M),o===G.length?r.interrupt?e:B:v):n(M)}function b(M){return cs(M)?(t.consume(M),a=String.fromCharCode(M),k):n(M)}function k(M){if(M===null||M===47||M===62||kr(M)){const G=M===47,ie=a.toLowerCase();return!G&&!s&&iT.includes(ie)?(i=1,r.interrupt?e(M):B(M)):L7.includes(a.toLowerCase())?(i=6,G?(t.consume(M),w):r.interrupt?e(M):B(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):s?j(M):Q(M))}return M===45||qr(M)?(t.consume(M),a+=String.fromCharCode(M),k):n(M)}function w(M){return M===62?(t.consume(M),r.interrupt?e:B):n(M)}function j(M){return mt(M)?(t.consume(M),j):F(M)}function Q(M){return M===47?(t.consume(M),F):M===58||M===95||cs(M)?(t.consume(M),E):mt(M)?(t.consume(M),Q):F(M)}function E(M){return M===45||M===46||M===58||M===95||qr(M)?(t.consume(M),E):R(M)}function R(M){return M===61?(t.consume(M),T):mt(M)?(t.consume(M),R):Q(M)}function T(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(t.consume(M),u=M,A):mt(M)?(t.consume(M),T):I(M)}function A(M){return M===u?(t.consume(M),u=null,W):M===null||Le(M)?n(M):(t.consume(M),A)}function I(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||kr(M)?R(M):(t.consume(M),I)}function W(M){return M===47||M===62||mt(M)?Q(M):n(M)}function F(M){return M===62?(t.consume(M),Z):n(M)}function Z(M){return M===null||Le(M)?B(M):mt(M)?(t.consume(M),Z):n(M)}function B(M){return M===45&&i===2?(t.consume(M),_):M===60&&i===1?(t.consume(M),X):M===62&&i===4?(t.consume(M),z):M===63&&i===3?(t.consume(M),$):M===93&&i===5?(t.consume(M),V):Le(M)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Z7,q,H)(M)):M===null||Le(M)?(t.exit("htmlFlowData"),H(M)):(t.consume(M),B)}function H(M){return t.check(I7,P,q)(M)}function P(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),D}function D(M){return M===null||Le(M)?H(M):(t.enter("htmlFlowData"),B(M))}function _(M){return M===45?(t.consume(M),$):B(M)}function X(M){return M===47?(t.consume(M),a="",Y):B(M)}function Y(M){if(M===62){const G=a.toLowerCase();return iT.includes(G)?(t.consume(M),z):B(M)}return cs(M)&&a.length<8?(t.consume(M),a+=String.fromCharCode(M),Y):B(M)}function V(M){return M===93?(t.consume(M),$):B(M)}function $(M){return M===62?(t.consume(M),z):M===45&&i===2?(t.consume(M),$):B(M)}function z(M){return M===null||Le(M)?(t.exit("htmlFlowData"),q(M)):(t.consume(M),z)}function q(M){return t.exit("htmlFlow"),e(M)}}function V7(t,e,n){const r=this;return i;function i(a){return Le(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function Y7(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Vx,e,n)}}const U7={name:"htmlText",tokenize:W7};function W7(t,e,n){const r=this;let i,s,a;return o;function o($){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume($),u}function u($){return $===33?(t.consume($),d):$===47?(t.consume($),R):$===63?(t.consume($),Q):cs($)?(t.consume($),I):n($)}function d($){return $===45?(t.consume($),h):$===91?(t.consume($),s=0,v):cs($)?(t.consume($),j):n($)}function h($){return $===45?(t.consume($),x):n($)}function m($){return $===null?n($):$===45?(t.consume($),g):Le($)?(a=m,X($)):(t.consume($),m)}function g($){return $===45?(t.consume($),x):m($)}function x($){return $===62?_($):$===45?g($):m($)}function v($){const z="CDATA[";return $===z.charCodeAt(s++)?(t.consume($),s===z.length?b:v):n($)}function b($){return $===null?n($):$===93?(t.consume($),k):Le($)?(a=b,X($)):(t.consume($),b)}function k($){return $===93?(t.consume($),w):b($)}function w($){return $===62?_($):$===93?(t.consume($),w):b($)}function j($){return $===null||$===62?_($):Le($)?(a=j,X($)):(t.consume($),j)}function Q($){return $===null?n($):$===63?(t.consume($),E):Le($)?(a=Q,X($)):(t.consume($),Q)}function E($){return $===62?_($):Q($)}function R($){return cs($)?(t.consume($),T):n($)}function T($){return $===45||qr($)?(t.consume($),T):A($)}function A($){return Le($)?(a=A,X($)):mt($)?(t.consume($),A):_($)}function I($){return $===45||qr($)?(t.consume($),I):$===47||$===62||kr($)?W($):n($)}function W($){return $===47?(t.consume($),_):$===58||$===95||cs($)?(t.consume($),F):Le($)?(a=W,X($)):mt($)?(t.consume($),W):_($)}function F($){return $===45||$===46||$===58||$===95||qr($)?(t.consume($),F):Z($)}function Z($){return $===61?(t.consume($),B):Le($)?(a=Z,X($)):mt($)?(t.consume($),Z):W($)}function B($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),i=$,H):Le($)?(a=B,X($)):mt($)?(t.consume($),B):(t.consume($),P)}function H($){return $===i?(t.consume($),i=void 0,D):$===null?n($):Le($)?(a=H,X($)):(t.consume($),H)}function P($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||kr($)?W($):(t.consume($),P)}function D($){return $===47||$===62||kr($)?W($):n($)}function _($){return $===62?(t.consume($),t.exit("htmlTextData"),t.exit("htmlText"),e):n($)}function X($){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),Y}function Y($){return mt($)?Rt(t,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):V($)}function V($){return t.enter("htmlTextData"),a($)}}const i2={name:"labelEnd",resolveAll:K7,resolveTo:J7,tokenize:eU},H7={tokenize:tU},G7={tokenize:nU},F7={tokenize:rU};function K7(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&bs(t,0,t.length,n),t}function J7(t,e){let n=t.length,r=0,i,s,a,o;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},h={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",u,e],["enter",d,e]],o=ai(o,t.slice(s+1,s+r+3)),o=ai(o,[["enter",h,e]]),o=ai(o,r2(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),o=ai(o,[["exit",h,e],t[a-2],t[a-1],["exit",d,e]]),o=ai(o,t.slice(a+1)),o=ai(o,[["exit",u,e]]),bs(t,s,t.length,o),t}function eU(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(g){return s?s._inactive?m(g):(a=r.parser.defined.includes(ou(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),u):n(g)}function u(g){return g===40?t.attempt(H7,h,a?h:m)(g):g===91?t.attempt(G7,h,a?d:m)(g):a?h(g):m(g)}function d(g){return t.attempt(F7,h,m)(g)}function h(g){return e(g)}function m(g){return s._balanced=!0,n(g)}}function tU(t,e,n){return r;function r(m){return t.enter("resource"),t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),i}function i(m){return kr(m)?rh(t,s)(m):s(m)}function s(m){return m===41?h(m):$M(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return kr(m)?rh(t,u)(m):h(m)}function o(m){return n(m)}function u(m){return m===34||m===39||m===40?TM(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):h(m)}function d(m){return kr(m)?rh(t,h)(m):h(m)}function h(m){return m===41?(t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),t.exit("resource"),e):n(m)}}function nU(t,e,n){const r=this;return i;function i(o){return NM.call(r,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(ou(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function rU(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const iU={name:"labelStartImage",resolveAll:i2.resolveAll,tokenize:sU};function sU(t,e,n){const r=this;return i;function i(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const aU={name:"labelStartLink",resolveAll:i2.resolveAll,tokenize:lU};function lU(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const s0={name:"lineEnding",tokenize:oU};function oU(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Rt(t,e,"linePrefix")}}const oO={name:"thematicBreak",tokenize:cU};function cU(t,e,n){let r=0,i;return s;function s(d){return t.enter("thematicBreak"),a(d)}function a(d){return i=d,o(d)}function o(d){return d===i?(t.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||Le(d))?(t.exit("thematicBreak"),e(d)):n(d)}function u(d){return d===i?(t.consume(d),r++,u):(t.exit("thematicBreakSequence"),mt(d)?Rt(t,o,"whitespace")(d):o(d))}}const mr={continuation:{tokenize:hU},exit:mU,name:"list",tokenize:fU},uU={partial:!0,tokenize:gU},dU={partial:!0,tokenize:pU};function fU(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(x){const v=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:MS(x)){if(r.containerState.type||(r.containerState.type=v,t.enter(v,{_container:!0})),v==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(oO,n,d)(x):d(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(x)}return n(x)}function u(x){return MS(x)&&++a<10?(t.consume(x),u):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),d(x)):n(x)}function d(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(Vx,r.interrupt?n:h,t.attempt(uU,g,m))}function h(x){return r.containerState.initialBlankLine=!0,s++,g(x)}function m(x){return mt(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function hU(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Vx,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(t,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!mt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(dU,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(t,t.attempt(mr,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function pU(t,e,n){const r=this;return Rt(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function mU(t){t.exit(this.containerState.type)}function gU(t,e,n){const r=this;return Rt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!mt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const sT={name:"setextUnderline",resolveTo:OU,tokenize:xU};function OU(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function xU(t,e,n){const r=this;let i;return s;function s(d){let h=r.events.length,m;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){m=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),i=d,a(d)):n(d)}function a(d){return t.enter("setextHeadingLineSequence"),o(d)}function o(d){return d===i?(t.consume(d),o):(t.exit("setextHeadingLineSequence"),mt(d)?Rt(t,u,"lineSuffix")(d):u(d))}function u(d){return d===null||Le(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const vU={tokenize:yU};function yU(t){const e=this,n=t.attempt(Vx,r,t.attempt(this.parser.constructs.flowInitial,i,Rt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Q7,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const bU={resolveAll:_M()},SU=PM("string"),wU=PM("text");function PM(t){return{resolveAll:_M(t==="text"?kU:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,o);return a;function a(h){return d(h)?s(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return d(h)?(n.exit("data"),s(h)):(n.consume(h),u)}function d(h){if(h===null)return!0;const m=i[h];let g=-1;if(m)for(;++g<m.length;){const x=m[g];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function _M(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function kU(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,o=0,u;for(;s--;){const d=i[s];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(d===-2)u=!0,o++;else if(d!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const d={type:n===t.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const QU={42:mr,43:mr,45:mr,48:mr,49:mr,50:mr,51:mr,52:mr,53:mr,54:mr,55:mr,56:mr,57:mr,62:QM},CU={91:N7},jU={[-2]:i0,[-1]:i0,32:i0},EU={35:M7,42:oO,45:[sT,oO],60:X7,61:sT,95:oO,96:rT,126:rT},$U={38:jM,92:CM},NU={[-5]:s0,[-4]:s0,[-3]:s0,33:iU,38:jM,42:zS,60:[a7,U7],91:aU,92:[A7,CM],93:i2,95:zS,96:v7},TU={null:[zS,bU]},PU={null:[42,95]},_U={null:[]},AU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:PU,contentInitial:CU,disable:_U,document:QU,flow:EU,flowInitial:jU,insideSpan:TU,string:$U,text:NU},Symbol.toStringTag,{value:"Module"}));function RU(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const u={attempt:A(R),check:A(T),consume:j,enter:Q,exit:E,interrupt:A(T,{interrupt:!0})},d={code:null,containerState:{},defineSkip:b,events:[],now:v,parser:t,previous:null,sliceSerialize:g,sliceStream:x,write:m};let h=e.tokenize.call(d,u);return e.resolveAll&&s.push(e),d;function m(Z){return a=ai(a,Z),k(),a[a.length-1]!==null?[]:(I(e,0),d.events=r2(s,d.events,d),d.events)}function g(Z,B){return zU(x(Z),B)}function x(Z){return MU(a,Z)}function v(){const{_bufferIndex:Z,_index:B,line:H,column:P,offset:D}=r;return{_bufferIndex:Z,_index:B,line:H,column:P,offset:D}}function b(Z){i[Z.line]=Z.column,F()}function k(){let Z;for(;r._index<a.length;){const B=a[r._index];if(typeof B=="string")for(Z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===Z&&r._bufferIndex<B.length;)w(B.charCodeAt(r._bufferIndex));else w(B)}}function w(Z){h=h(Z)}function j(Z){Le(Z)?(r.line++,r.column=1,r.offset+=Z===-3?2:1,F()):Z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=Z}function Q(Z,B){const H=B||{};return H.type=Z,H.start=v(),d.events.push(["enter",H,d]),o.push(H),H}function E(Z){const B=o.pop();return B.end=v(),d.events.push(["exit",B,d]),B}function R(Z,B){I(Z,B.from)}function T(Z,B){B.restore()}function A(Z,B){return H;function H(P,D,_){let X,Y,V,$;return Array.isArray(P)?q(P):"tokenize"in P?q([P]):z(P);function z(J){return ne;function ne(se){const pe=se!==null&&J[se],ye=se!==null&&J.null,be=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return q(be)(se)}}function q(J){return X=J,Y=0,J.length===0?_:M(J[Y])}function M(J){return ne;function ne(se){return $=W(),V=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?ie():J.tokenize.call(B?Object.assign(Object.create(d),B):d,u,G,ie)(se)}}function G(J){return Z(V,$),D}function ie(J){return $.restore(),++Y<X.length?M(X[Y]):_}}}function I(Z,B){Z.resolveAll&&!s.includes(Z)&&s.push(Z),Z.resolve&&bs(d.events,B,d.events.length-B,Z.resolve(d.events.slice(B),d)),Z.resolveTo&&(d.events=Z.resolveTo(d.events,d))}function W(){const Z=v(),B=d.previous,H=d.currentConstruct,P=d.events.length,D=Array.from(o);return{from:P,restore:_};function _(){r=Z,d.previous=B,d.currentConstruct=H,d.events.length=P,o=D,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function MU(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function zU(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
372
+ `;break}case-3:{a=`\r
373
+ `;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function DU(t){const r={constructs:VY([AU,...(t||{}).extensions||[]]),content:i(JY),defined:[],document:i(t7),flow:i(vU),lazy:{},string:i(SU),text:i(wU)};return r;function i(s){return a;function a(o){return RU(r,s,o)}}}function LU(t){for(;!EM(t););return t}const aT=/[\0\t\n\r]/g;function XU(){let t=1,e="",n=!0,r;return i;function i(s,a,o){const u=[];let d,h,m,g,x;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),m=0,e="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(aT.lastIndex=m,d=aT.exec(s),g=d&&d.index!==void 0?d.index:s.length,x=s.charCodeAt(g),!d){e=s.slice(m);break}if(x===10&&m===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),m<g&&(u.push(s.slice(m,g)),t+=g-m),x){case 0:{u.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,u.push(-2);t++<h;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}m=g+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const ZU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function IU(t){return t.replace(ZU,BU)}function BU(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return kM(n.slice(s?2:1),s?16:10)}return n2(n)||t}const AM={}.hasOwnProperty;function qU(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),VU(n)(LU(DU(n).document().write(XU()(t,e,!0))))}function VU(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Jt),autolinkProtocol:W,autolinkEmail:W,atxHeading:s(We),blockQuote:s(ye),characterEscape:W,characterReference:W,codeFenced:s(be),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(be,a),codeText:s(Se,a),codeTextData:W,data:W,codeFlowValue:W,definition:s(ke),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(_e),hardBreakEscape:s(De),hardBreakTrailing:s(De),htmlFlow:s(yt,a),htmlFlowData:W,htmlText:s(yt,a),htmlTextData:W,image:s(Cn),label:a,link:s(Jt),listItem:s(ar),listItemValue:g,listOrdered:s(jn,m),listUnordered:s(jn),paragraph:s(Er),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(We),strong:s(Ur),thematicBreak:s(wi)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:pe,autolinkProtocol:se,blockQuote:u(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:J,characterReference:ne,codeFenced:u(k),codeFencedFence:b,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:F,codeIndented:u(w),codeText:u(D),codeTextData:F,data:F,definition:u(),definitionDestinationString:E,definitionLabelString:j,definitionTitleString:Q,emphasis:u(),hardBreakEscape:u(B),hardBreakTrailing:u(B),htmlFlow:u(H),htmlFlowData:F,htmlText:u(P),htmlTextData:F,image:u(X),label:V,labelText:Y,lineEnding:Z,link:u(_),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:G,resourceDestinationString:$,resourceTitleString:z,resource:q,setextHeading:u(I),setextHeadingLineSequence:A,setextHeadingText:T,strong:u(),thematicBreak:u()}};RM(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ue){let ge={type:"root",children:[]};const Pe={stack:[ge],tokenStack:[],config:e,enter:o,exit:d,buffer:a,resume:h,data:n},Ie=[];let Ke=-1;for(;++Ke<ue.length;)if(ue[Ke][1].type==="listOrdered"||ue[Ke][1].type==="listUnordered")if(ue[Ke][0]==="enter")Ie.push(Ke);else{const Ve=Ie.pop();Ke=i(ue,Ve,Ke)}for(Ke=-1;++Ke<ue.length;){const Ve=e[ue[Ke][0]];AM.call(Ve,ue[Ke][1].type)&&Ve[ue[Ke][1].type].call(Object.assign({sliceSerialize:ue[Ke][2].sliceSerialize},Pe),ue[Ke][1])}if(Pe.tokenStack.length>0){const Ve=Pe.tokenStack[Pe.tokenStack.length-1];(Ve[1]||lT).call(Pe,void 0,Ve[0])}for(ge.position={start:Ja(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ja(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<e.transforms.length;)ge=e.transforms[Ke](ge)||ge;return ge}function i(ue,ge,Pe){let Ie=ge-1,Ke=-1,Ve=!1,ht,kt,Qt,qt;for(;++Ie<=Pe;){const ot=ue[Ie];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Ke++:Ke--,qt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(ht&&!qt&&!Ke&&!Qt&&(Qt=Ie),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!Ke&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Ke===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(ht){let Wr=Ie;for(kt=void 0;Wr--;){const En=ue[Wr];if(En[1].type==="lineEnding"||En[1].type==="lineEndingBlank"){if(En[0]==="exit")continue;kt&&(ue[kt][1].type="lineEndingBlank",Ve=!0),En[1].type="lineEnding",kt=Wr}else if(!(En[1].type==="linePrefix"||En[1].type==="blockQuotePrefix"||En[1].type==="blockQuotePrefixWhitespace"||En[1].type==="blockQuoteMarker"||En[1].type==="listItemIndent"))break}Qt&&(!kt||Qt<kt)&&(ht._spread=!0),ht.end=Object.assign({},kt?ue[kt][1].start:ot[1].end),ue.splice(kt||Ie,0,["exit",ht,ot[2]]),Ie++,Pe++}if(ot[1].type==="listItemPrefix"){const Wr={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};ht=Wr,ue.splice(Ie,0,["enter",Wr,ot[2]]),Ie++,Pe++,Qt=void 0,qt=!0}}}return ue[ge][1]._spread=Ve,Pe}function s(ue,ge){return Pe;function Pe(Ie){o.call(this,ue(Ie),Ie),ge&&ge.call(this,Ie)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(ue,ge,Pe){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ge,Pe||void 0]),ue.position={start:Ja(ge.start),end:void 0}}function u(ue){return ge;function ge(Pe){ue&&ue.call(this,Pe),d.call(this,Pe)}}function d(ue,ge){const Pe=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==ue.type&&(ge?ge.call(this,ue,Ie[0]):(Ie[1]||lT).call(this,ue,Ie[0]));else throw new Error("Cannot close `"+ue.type+"` ("+nh({start:ue.start,end:ue.end})+"): it’s not open");Pe.position.end=Ja(ue.end)}function h(){return BY(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(ue){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ue}function v(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ue}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue.replace(/(\r?\n|\r)$/g,"")}function j(ue){const ge=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ge,Pe.identifier=ou(this.sliceSerialize(ue)).toLowerCase()}function Q(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ue}function E(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ue}function R(ue){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Pe=this.sliceSerialize(ue).length;ge.depth=Pe}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function A(ue){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function W(ue){const Pe=this.stack[this.stack.length-1].children;let Ie=Pe[Pe.length-1];(!Ie||Ie.type!=="text")&&(Ie=en(),Ie.position={start:Ja(ue.start),end:void 0},Pe.push(Ie)),this.stack.push(Ie)}function F(ue){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ue),ge.position.end=Ja(ue.end)}function Z(ue){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=ge.children[ge.children.length-1];Pe.position.end=Ja(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ge.type)&&(W.call(this,ue),F.call(this,ue))}function B(){this.data.atHardBreak=!0}function H(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function P(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function D(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function _(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ge,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function X(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ge,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function Y(ue){const ge=this.sliceSerialize(ue),Pe=this.stack[this.stack.length-2];Pe.label=IU(ge),Pe.identifier=ou(ge).toLowerCase()}function V(){const ue=this.stack[this.stack.length-1],ge=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const Ie=ue.children;Pe.children=Ie}else Pe.alt=ge}function $(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ue}function z(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ue}function q(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function G(ue){const ge=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ge,Pe.identifier=ou(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function ie(ue){this.data.characterReferenceType=ue.type}function J(ue){const ge=this.sliceSerialize(ue),Pe=this.data.characterReferenceType;let Ie;Pe?(Ie=kM(ge,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=n2(ge);const Ke=this.stack[this.stack.length-1];Ke.value+=Ie}function ne(ue){const ge=this.stack.pop();ge.position.end=Ja(ue.end)}function se(ue){F.call(this,ue);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ue)}function pe(ue){F.call(this,ue);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ue)}function ye(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _e(){return{type:"emphasis",children:[]}}function We(){return{type:"heading",depth:0,children:[]}}function De(){return{type:"break"}}function yt(){return{type:"html",value:""}}function Cn(){return{type:"image",title:null,url:"",alt:null}}function Jt(){return{type:"link",title:null,url:"",children:[]}}function jn(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function ar(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Er(){return{type:"paragraph",children:[]}}function Ur(){return{type:"strong",children:[]}}function en(){return{type:"text",value:""}}function wi(){return{type:"thematicBreak"}}}function Ja(t){return{line:t.line,column:t.column,offset:t.offset}}function RM(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?RM(t,r):YU(t,r)}}function YU(t,e){let n;for(n in e)if(AM.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function lT(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+nh({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+nh({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+nh({start:e.start,end:e.end})+") is still open")}function UU(t){const e=this;e.parser=n;function n(r){return qU(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function WU(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function HU(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
374
+ `}]}function GU(t,e){const n=e.value?e.value+`
375
+ `:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function FU(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function KU(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function JU(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=cd(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,o=t.footnoteCounts.get(r);o===void 0?(o=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,d),t.applyData(e,d)}function eW(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function tW(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function MM(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function nW(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return MM(t,e);const i={src:cd(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function rW(t,e){const n={src:cd(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function iW(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function sW(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return MM(t,e);const i={href:cd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function aW(t,e){const n={href:cd(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function lW(t,e,n){const r=t.all(e),i=n?oW(n):zM(e),s={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
376
+ `}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
377
+ `});const d={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,d),t.applyData(e,d)}function oW(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=zM(n[r])}return e}function zM(t){const e=t.spread;return e??t.children.length>1}function cW(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function uW(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function dW(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function fW(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function hW(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=Kk(e.children[1]),u=OM(e.children[e.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function pW(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let u=-1;const d=[];for(;++u<o;){const m=e.children[u],g={},x=a?a[u]:void 0;x&&(g.align=x);let v={type:"element",tagName:s,properties:g,children:[]};m&&(v.children=t.all(m),t.patch(m,v),v=t.applyData(m,v)),d.push(v)}const h={type:"element",tagName:"tr",properties:{},children:t.wrap(d,!0)};return t.patch(e,h),t.applyData(e,h)}function mW(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const oT=9,cT=32;function gW(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(uT(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(uT(e.slice(i),i>0,!1)),s.join("")}function uT(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===oT||s===cT;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===oT||s===cT;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function OW(t,e){const n={type:"text",value:gW(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function xW(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const vW={blockquote:WU,break:HU,code:GU,delete:FU,emphasis:KU,footnoteReference:JU,heading:eW,html:tW,imageReference:nW,image:rW,inlineCode:iW,linkReference:sW,link:aW,listItem:lW,list:cW,paragraph:uW,root:dW,strong:fW,table:hW,tableCell:mW,tableRow:pW,text:OW,thematicBreak:xW,toml:wg,yaml:wg,definition:wg,footnoteDefinition:wg};function wg(){}const DM=-1,Yx=0,ih=1,XO=2,s2=3,a2=4,l2=5,o2=6,LM=7,XM=8,dT=typeof self=="object"?self:globalThis,yW=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case Yx:case DM:return n(a,i);case ih:{const o=n([],i);for(const u of a)o.push(r(u));return o}case XO:{const o=n({},i);for(const[u,d]of a)o[r(u)]=r(d);return o}case s2:return n(new Date(a),i);case a2:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case l2:{const o=n(new Map,i);for(const[u,d]of a)o.set(r(u),r(d));return o}case o2:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case LM:{const{name:o,message:u}=a;return n(new dT[o](u),i)}case XM:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new dT[s](a),i)};return r},fT=t=>yW(new Map,t)(0),Bc="",{toString:bW}={},{keys:SW}=Object,kf=t=>{const e=typeof t;if(e!=="object"||!t)return[Yx,e];const n=bW.call(t).slice(8,-1);switch(n){case"Array":return[ih,Bc];case"Object":return[XO,Bc];case"Date":return[s2,Bc];case"RegExp":return[a2,Bc];case"Map":return[l2,Bc];case"Set":return[o2,Bc];case"DataView":return[ih,n]}return n.includes("Array")?[ih,n]:n.includes("Error")?[LM,n]:[XO,n]},kg=([t,e])=>t===Yx&&(e==="function"||e==="symbol"),wW=(t,e,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},s=a=>{if(n.has(a))return n.get(a);let[o,u]=kf(a);switch(o){case Yx:{let h=a;switch(u){case"bigint":o=XM,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([DM],a)}return i([o,h],a)}case ih:{if(u){let g=a;return u==="DataView"?g=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(a)),i([u,[...g]],a)}const h=[],m=i([o,h],a);for(const g of a)h.push(s(g));return m}case XO:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const h=[],m=i([o,h],a);for(const g of SW(a))(t||!kg(kf(a[g])))&&h.push([s(g),s(a[g])]);return m}case s2:return i([o,a.toISOString()],a);case a2:{const{source:h,flags:m}=a;return i([o,{source:h,flags:m}],a)}case l2:{const h=[],m=i([o,h],a);for(const[g,x]of a)(t||!(kg(kf(g))||kg(kf(x))))&&h.push([s(g),s(x)]);return m}case o2:{const h=[],m=i([o,h],a);for(const g of a)(t||!kg(kf(g)))&&h.push(s(g));return m}}const{message:d}=a;return i([o,{name:u,message:d}],a)};return s},hT=(t,{json:e,lossy:n}={})=>{const r=[];return wW(!(e||n),!!e,new Map,r)(t),r},ZO=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?fT(hT(t,e)):structuredClone(t):(t,e)=>fT(hT(t,e));function kW(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function QW(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function CW(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||kW,r=t.options.footnoteBackLabel||QW,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<t.footnoteOrder.length;){const d=t.footnoteById.get(t.footnoteOrder[u]);if(!d)continue;const h=t.all(d),m=String(d.identifier).toUpperCase(),g=cd(m.toLowerCase());let x=0;const v=[],b=t.footnoteCounts.get(m);for(;b!==void 0&&++x<=b;){v.length>0&&v.push({type:"text",value:" "});let j=typeof n=="string"?n:n(u,x);typeof j=="string"&&(j={type:"text",value:j}),v.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const k=h[h.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const j=k.children[k.children.length-1];j&&j.type==="text"?j.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...v)}else h.push(...v);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(h,!0)};t.patch(d,w),o.push(w)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ZO(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
378
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
379
+ `}]}}const ZM=(function(t){if(t==null)return NW;if(typeof t=="function")return Ux(t);if(typeof t=="object")return Array.isArray(t)?jW(t):EW(t);if(typeof t=="string")return $W(t);throw new Error("Expected function, string, or object as test")});function jW(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=ZM(t[n]);return Ux(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function EW(t){const e=t;return Ux(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function $W(t){return Ux(e);function e(n){return n&&n.type===t}}function Ux(t){return e;function e(n,r,i){return!!(TW(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function NW(){return!0}function TW(t){return t!==null&&typeof t=="object"&&"type"in t}const IM=[],PW=!0,pT=!1,_W="skip";function AW(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=ZM(i),a=r?-1:1;o(t,void 0,[])();function o(u,d,h){const m=u&&typeof u=="object"?u:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return g;function g(){let x=IM,v,b,k;if((!e||s(u,d,h[h.length-1]||void 0))&&(x=RW(n(u,h)),x[0]===pT))return x;if("children"in u&&u.children){const w=u;if(w.children&&x[0]!==_W)for(b=(r?w.children.length:-1)+a,k=h.concat(w);b>-1&&b<w.children.length;){const j=w.children[b];if(v=o(j,b,k)(),v[0]===pT)return v;b=typeof v[1]=="number"?v[1]:b+a}}return x}}}function RW(t){return Array.isArray(t)?t:typeof t=="number"?[PW,t]:t==null?IM:[t]}function BM(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),AW(t,s,o,i);function o(u,d){const h=d[d.length-1],m=h?h.children.indexOf(u):void 0;return a(u,m,h)}}const DS={}.hasOwnProperty,MW={};function zW(t,e){const n=e||MW,r=new Map,i=new Map,s=new Map,a={...vW,...n.handlers},o={all:d,applyData:LW,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:DW,wrap:ZW};return BM(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const m=h.type==="definition"?r:i,g=String(h.identifier).toUpperCase();m.has(g)||m.set(g,h)}}),o;function u(h,m){const g=h.type,x=o.handlers[g];if(DS.call(o.handlers,g)&&x)return x(o,h,m);if(o.options.passThrough&&o.options.passThrough.includes(g)){if("children"in h){const{children:b,...k}=h,w=ZO(k);return w.children=o.all(h),w}return ZO(h)}return(o.options.unknownHandler||XW)(o,h,m)}function d(h){const m=[];if("children"in h){const g=h.children;let x=-1;for(;++x<g.length;){const v=o.one(g[x],h);if(v){if(x&&g[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=mT(v.value)),!Array.isArray(v)&&v.type==="element")){const b=v.children[0];b&&b.type==="text"&&(b.value=mT(b.value))}Array.isArray(v)?m.push(...v):m.push(v)}}}return m}}function DW(t,e){t.position&&(e.position=bY(t))}function LW(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,ZO(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function XW(t,e){const n=e.data||{},r="value"in e&&!(DS.call(n,"hProperties")||DS.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function ZW(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
380
+ `});++r<t.length;)r&&n.push({type:"text",value:`
381
+ `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
382
+ `}),n}function mT(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function gT(t,e){const n=zW(t,e),r=n.one(t,void 0),i=CW(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
383
+ `},i),s}function IW(t,e){return t&&"run"in t?async function(n,r){const i=gT(n,{file:r,...e});await t.run(i,r)}:function(n,r){return gT(n,{file:r,...t||e})}}function OT(t){if(t)throw t}var a0,xT;function BW(){if(xT)return a0;xT=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},s=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var h=t.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!m)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},a=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},o=function(d,h){if(h==="__proto__")if(t.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return a0=function u(){var d,h,m,g,x,v,b=arguments[0],k=1,w=arguments.length,j=!1;for(typeof b=="boolean"&&(j=b,b=arguments[1]||{},k=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});k<w;++k)if(d=arguments[k],d!=null)for(h in d)m=o(b,h),g=o(d,h),b!==g&&(j&&g&&(s(g)||(x=i(g)))?(x?(x=!1,v=m&&i(m)?m:[]):v=m&&s(m)?m:{},a(b,{name:h,newValue:u(j,v,g)})):typeof g<"u"&&a(b,{name:h,newValue:g}));return b},a0}var qW=BW();const l0=mp(qW);function LS(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function VW(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...d){const h=t[++s];let m=-1;if(u){a(u);return}for(;++m<i.length;)(d[m]===null||d[m]===void 0)&&(d[m]=i[m]);i=d,h?YW(h,o)(...d):a(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function YW(t,e){let n;return r;function r(...a){const o=t.length>a.length;let u;o&&a.push(i);try{u=t.apply(this,a)}catch(d){const h=d;if(o&&n)throw h;return i(h)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...o){n||(n=!0,e(a,...o))}function s(a){i(null,a)}}const ns={basename:UW,dirname:WW,extname:HW,join:GW,sep:"/"};function UW(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Sp(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function WW(t){if(Sp(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function HW(t){Sp(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function GW(...t){let e=-1,n;for(;++e<t.length;)Sp(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":FW(n)}function FW(t){Sp(t);const e=t.codePointAt(0)===47;let n=KW(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function KW(t,e){let n="",r=0,i=-1,s=0,a=-1,o,u;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function Sp(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const JW={cwd:eH};function eH(){return"/"}function XS(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function tH(t){if(typeof t=="string")t=new URL(t);else if(!XS(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return nH(t)}function nH(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const o0=["history","path","basename","stem","extname","dirname"];class qM{constructor(e){let n;e?XS(e)?n={path:e}:typeof e=="string"||rH(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":JW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<o0.length;){const s=o0[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)o0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ns.basename(this.path):void 0}set basename(e){u0(e,"basename"),c0(e,"basename"),this.path=ns.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ns.dirname(this.path):void 0}set dirname(e){vT(this.basename,"dirname"),this.path=ns.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ns.extname(this.path):void 0}set extname(e){if(c0(e,"extname"),vT(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ns.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){XS(e)&&(e=tH(e)),u0(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ns.basename(this.path,this.extname):void 0}set stem(e){u0(e,"stem"),c0(e,"stem"),this.path=ns.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Un(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function c0(t,e){if(t&&t.includes(ns.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ns.sep+"`")}function u0(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function vT(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function rH(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const iH=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),sH={}.hasOwnProperty;class c2 extends iH{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=VW()}copy(){const e=new c2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(l0(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(h0("data",this.frozen),this.namespace[e]=n,this):sH.call(this.namespace,e)&&this.namespace[e]||void 0:e?(h0("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Qg(e),r=this.parser||this.Parser;return d0("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),d0("process",this.parser||this.Parser),f0("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Qg(e),u=r.parse(o);r.run(u,o,function(h,m,g){if(h||!m||!g)return d(h);const x=m,v=r.stringify(x,g);oH(v)?g.value=v:g.result=v,d(h,g)});function d(h,m){h||!m?a(h):s?s(m):n(void 0,m)}}}processSync(e){let n=!1,r;return this.freeze(),d0("processSync",this.parser||this.Parser),f0("processSync",this.compiler||this.Compiler),this.process(e,i),bT("processSync","process",n),r;function i(s,a){n=!0,OT(s),r=a}}run(e,n,r){yT(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const u=Qg(n);i.run(e,u,d);function d(h,m,g){const x=m||e;h?o(h):a?a(x):r(void 0,x,g)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),bT("runSync","run",r),i;function s(a,o){OT(a),i=o,r=!0}}stringify(e,n){this.freeze();const r=Qg(n),i=this.compiler||this.Compiler;return f0("stringify",i),yT(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(h0("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[h,...m]=d;u(h,m)}else a(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function a(d){if(!("plugins"in d)&&!("settings"in d))throw new 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(d.plugins),d.settings&&(i.settings=l0(!0,i.settings,d.settings))}function o(d){let h=-1;if(d!=null)if(Array.isArray(d))for(;++h<d.length;){const m=d[h];s(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,h){let m=-1,g=-1;for(;++m<r.length;)if(r[m][0]===d){g=m;break}if(g===-1)r.push([d,...h]);else if(h.length>0){let[x,...v]=h;const b=r[g][1];LS(b)&&LS(x)&&(x=l0(!0,b,x)),r[g]=[d,x,...v]}}}}const aH=new c2().freeze();function d0(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function f0(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function h0(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function yT(t){if(!LS(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function bT(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Qg(t){return lH(t)?t:new qM(t)}function lH(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function oH(t){return typeof t=="string"||cH(t)}function cH(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const uH="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ST=[],wT={allowDangerousHtml:!0},dH=/^(https?|ircs?|mailto|xmpp)$/i,fH=[{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 VM(t){const e=hH(t),n=pH(t);return mH(e.runSync(e.parse(n),n),t)}function hH(t){const e=t.rehypePlugins||ST,n=t.remarkPlugins||ST,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...wT}:wT;return aH().use(UU).use(n).use(IW,r).use(e)}function pH(t){const e=t.children||"",n=new qM;return typeof e=="string"&&(n.value=e),n}function mH(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||gH;for(const h of fH)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+uH+h.id,void 0);return BM(t,d),CY(t,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function d(h,m,g){if(h.type==="raw"&&g&&typeof m=="number")return a?g.children.splice(m,1):g.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in r0)if(Object.hasOwn(r0,x)&&Object.hasOwn(h.properties,x)){const v=h.properties[x],b=r0[x];(b===null||b.includes(h.tagName))&&(h.properties[x]=u(String(v||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(h,m,g)),x&&g&&typeof m=="number")return o&&h.children?g.children.splice(m,1,...h.children):g.children.splice(m,1),m}}}function gH(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||dH.test(t.slice(0,e))?t:""}let ZS=[],YM=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?YM:ZS).push(n=n+t[e])})();function OH(t){if(t<768)return!1;for(let e=0,n=ZS.length;;){let r=e+n>>1;if(t<ZS[r])n=r;else if(t>=YM[r])e=r+1;else return!0;if(e==n)return!1}}function kT(t){return t>=127462&&t<=127487}const QT=8205;function xH(t,e,n=!0,r=!0){return(n?UM:vH)(t,e,r)}function UM(t,e,n){if(e==t.length)return e;e&&WM(t.charCodeAt(e))&&HM(t.charCodeAt(e-1))&&e--;let r=p0(t,e);for(e+=CT(r);e<t.length;){let i=p0(t,e);if(r==QT||i==QT||n&&OH(i))e+=CT(i),r=i;else if(kT(i)){let s=0,a=e-2;for(;a>=0&&kT(p0(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function vH(t,e,n){for(;e>0;){let r=UM(t,e-2,n);if(r<e)return r;e--}return 0}function p0(t,e){let n=t.charCodeAt(e);if(!HM(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return WM(r)?(n-55296<<10)+(r-56320)+65536:n}function WM(t){return t>=56320&&t<57344}function HM(t){return t>=55296&&t<56320}function CT(t){return t<65536?1:2}class st{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Pu(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),us.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Pu(this,e,n);let r=[];return this.decompose(e,n,r,0),us.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new sh(this),s=new sh(e);for(let a=n,o=n;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new sh(this,e)}iterRange(e,n=this.length){return new GM(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new FM(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?st.empty:e.length<=32?new rn(e):us.from(rn.split(e,[]))}}class rn extends st{constructor(e,n=yH(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.text[s],o=i+a.length;if((n?r:o)>=e)return new bH(i,o,r,a);i=o+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new rn(jT(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=cO(s.text,a.text.slice(),0,s.length);if(o.length<=32)r.push(new rn(o,a.length+s.length));else{let u=o.length>>1;r.push(new rn(o.slice(0,u)),new rn(o.slice(u)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof rn))return super.replace(e,n,r);[e,n]=Pu(this,e,n);let i=cO(this.text,cO(r.text,jT(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new rn(i,s):us.from(rn.split(i,[]),s)}sliceString(e,n=this.length,r=`
384
+ `){[e,n]=Pu(this,e,n);let i="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let o=this.text[a],u=s+o.length;s>e&&a&&(i+=r),e<u&&n>s&&(i+=o.slice(Math.max(0,e-s),n-s)),s=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new rn(r,i)),r=[],i=-1);return i>-1&&n.push(new rn(r,i)),n}}class us extends st{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.children[s],o=i+a.length,u=r+a.lines-1;if((n?u:o)>=e)return a.lineInner(e,n,r,i);i=o+1,r=u+1}}decompose(e,n,r,i){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let o=this.children[s],u=a+o.length;if(e<=u&&n>=a){let d=i&((a<=e?1:0)|(u>=n?2:0));a>=e&&u<=n&&!d?r.push(o):o.decompose(e-a,n-a,r,d)}a=u+1}}replace(e,n,r){if([e,n]=Pu(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let a=this.children[i],o=s+a.length;if(e>=s&&n<=o){let u=a.replace(e-s,n-s,r),d=this.lines-a.lines+u.lines;if(u.lines<d>>4&&u.lines>d>>6){let h=this.children.slice();return h[i]=u,new us(h,this.length-(n-e)+r.length)}return super.replace(s,o,u)}s=o+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
385
+ `){[e,n]=Pu(this,e,n);let i="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let o=this.children[s],u=a+o.length;a>e&&s&&(i+=r),e<u&&n>a&&(i+=o.sliceString(e-a,n-a,r)),a=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof us))return 0;let r=0,[i,s,a,o]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==a||s==o)return r;let u=this.children[i],d=e.children[s];if(u!=d)return r+u.scanIdentical(d,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let v of e)v.flatten(x);return new rn(x,n)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,o=[],u=0,d=-1,h=[];function m(x){let v;if(x.lines>s&&x instanceof us)for(let b of x.children)m(b);else x.lines>a&&(u>a||!u)?(g(),o.push(x)):x instanceof rn&&u&&(v=h[h.length-1])instanceof rn&&x.lines+v.lines<=32?(u+=x.lines,d+=x.length+1,h[h.length-1]=new rn(v.text.concat(x.text),v.length+1+x.length)):(u+x.lines>i&&g(),u+=x.lines,d+=x.length+1,h.push(x))}function g(){u!=0&&(o.push(h.length==1?h[0]:us.from(h,d)),d=-1,u=h.length=0)}for(let x of e)m(x);return g(),o.length==1?o[0]:new us(o,n)}}st.empty=new rn([""],0);function yH(t){let e=-1;for(let n of t)e+=n.length+1;return e}function cO(t,e,n=0,r=1e9){for(let i=0,s=0,a=!0;s<t.length&&i<=r;s++){let o=t[s],u=i+o.length;u>=n&&(u>r&&(o=o.slice(0,r-i)),i<n&&(o=o.slice(n-i)),a?(e[e.length-1]+=o,a=!1):e.push(o)),i=u+1}return e}function jT(t,e,n){return cO(t,[""],e,n)}class sh{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof rn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,o=i instanceof rn?i.text.length:i.children.length;if(a==(n>0?o:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
386
+ `,this;e--}else if(i instanceof rn){let u=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[a+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof rn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class GM{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new sh(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class FM{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(st.prototype[Symbol.iterator]=function(){return this.iter()},sh.prototype[Symbol.iterator]=GM.prototype[Symbol.iterator]=FM.prototype[Symbol.iterator]=function(){return this});let bH=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function Pu(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Yn(t,e,n=!0,r=!0){return xH(t,e,n,r)}function SH(t){return t>=56320&&t<57344}function wH(t){return t>=55296&&t<56320}function kH(t,e){let n=t.charCodeAt(e);if(!wH(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return SH(r)?(n-55296<<10)+(r-56320)+65536:n}function QH(t){return t<65536?1:2}const IS=/\r\n?|\n/;var er=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(er||(er={}));class xs{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(r,i,s),i+=s):i+=a,r+=s}}iterChangedRanges(e,n=!1){BS(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new xs(e)}composeDesc(e){return this.empty?e:e.empty?this:KM(this,e)}mapDesc(e,n=!1){return e.empty?this:qS(this,e,n)}mapPos(e,n=-1,r=er.Simple){let i=0,s=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],u=this.sections[a++],d=i+o;if(u<0){if(d>e)return s+(e-i);s+=o}else{if(r!=er.Simple&&d>=e&&(r==er.TrackDel&&i<e&&d>e||r==er.TrackBefore&&i<e||r==er.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!o)return e==i||n<0?s:s+u;s+=u}i=d}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],a=this.sections[r++],o=i+s;if(a>=0&&i<=n&&o>=e)return i<e&&o>n?"cover":!0;i=o}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new xs(e)}static create(e){return new xs(e)}}class yn extends xs{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return BS(this,(n,r,i,s,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return qS(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let a=n[i],o=n[i+1];if(o>=0){n[i]=o,n[i+1]=a;let u=i>>1;for(;r.length<u;)r.push(st.empty);r.push(a?e.slice(s,s+a):st.empty)}s+=a}return new yn(n,r)}compose(e){return this.empty?e:e.empty?this:KM(this,e,!0)}map(e,n=!1){return e.empty?this:qS(this,e,n,!0)}iterChanges(e,n=!1){BS(this,e,n)}get desc(){return xs.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Nh(this);e:for(let a=0,o=0;;){let u=a==e.length?1e9:e[a++];for(;o<u||o==u&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,u-o);qn(i,h,-1);let m=s.ins==-1?-1:s.off==0?s.ins:0;qn(n,h,m),m>0&&vl(r,n,s.text),s.forward(h),o+=h}let d=e[a++];for(;o<d;){if(s.done)break e;let h=Math.min(s.len,d-o);qn(n,h,-1),qn(i,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),o+=h}}return{changes:new yn(n,r),filtered:xs.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],a=0,o=null;function u(h=!1){if(!h&&!i.length)return;a<n&&qn(i,n-a,-1);let m=new yn(i,s);o=o?o.compose(m.map(o)):m,i=[],s=[],a=0}function d(h){if(Array.isArray(h))for(let m of h)d(m);else if(h instanceof yn){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);u(),o=o?o.compose(h.map(o)):h}else{let{from:m,to:g=m,insert:x}=h;if(m>g||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let v=x?typeof x=="string"?st.of(x.split(r||IS)):x:st.empty,b=v.length;if(m==g&&b==0)return;m<a&&u(),m>a&&qn(i,m-a,-1),qn(i,g-m,b),vl(s,i,v),a=g}}return d(e),u(!o),o}static empty(e){return new yn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,o)=>o&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(st.empty);r[i]=st.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new yn(n,r)}static createSet(e,n){return new yn(e,n)}}function qn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function vl(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(st.empty);t.push(n)}}function BS(t,e,n){let r=t.inserted;for(let i=0,s=0,a=0;a<t.sections.length;){let o=t.sections[a++],u=t.sections[a++];if(u<0)i+=o,s+=o;else{let d=i,h=s,m=st.empty;for(;d+=o,h+=u,u&&r&&(m=m.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)o=t.sections[a++],u=t.sections[a++];e(i,d,s,h,m),i=d,s=h}}}function qS(t,e,n,r=!1){let i=[],s=r?[]:null,a=new Nh(t),o=new Nh(e);for(let u=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let d=Math.min(a.len,o.len);qn(i,d,-1),a.forward(d),o.forward(d)}else if(o.ins>=0&&(a.ins<0||u==a.i||a.off==0&&(o.len<a.len||o.len==a.len&&!n))){let d=o.len;for(qn(i,o.ins,-1);d;){let h=Math.min(a.len,d);a.ins>=0&&u<a.i&&a.len<=h&&(qn(i,0,a.ins),s&&vl(s,i,a.text),u=a.i),a.forward(h),d-=h}o.next()}else if(a.ins>=0){let d=0,h=a.len;for(;h;)if(o.ins==-1){let m=Math.min(h,o.len);d+=m,h-=m,o.forward(m)}else if(o.ins==0&&o.len<h)h-=o.len,o.next();else break;qn(i,d,u<a.i?a.ins:0),s&&u<a.i&&vl(s,i,a.text),u=a.i,a.forward(a.len-h)}else{if(a.done&&o.done)return s?yn.createSet(i,s):xs.create(i);throw new Error("Mismatched change set lengths")}}}function KM(t,e,n=!1){let r=[],i=n?[]:null,s=new Nh(t),a=new Nh(e);for(let o=!1;;){if(s.done&&a.done)return i?yn.createSet(r,i):xs.create(r);if(s.ins==0)qn(r,s.len,0,o),s.next();else if(a.len==0&&!a.done)qn(r,0,a.ins,o),i&&vl(i,r,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,a.len),d=r.length;if(s.ins==-1){let h=a.ins==-1?-1:a.off?0:a.ins;qn(r,u,h,o),i&&h&&vl(i,r,a.text)}else a.ins==-1?(qn(r,s.off?0:s.len,u,o),i&&vl(i,r,s.textBit(u))):(qn(r,s.off?0:s.len,a.off?0:a.ins,o),i&&!a.off&&vl(i,r,a.text));o=(s.ins>u||a.ins>=0&&a.len>u)&&(o||r.length>d),s.forward2(u),a.forward(u)}}}}class Nh{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?st.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?st.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Oo{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Oo(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return me.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return me.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return me.range(e.anchor,e.head)}static create(e,n,r){return new Oo(e,n,r)}}class me{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:me.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new me([this.main],0)}addRange(e,n=!0){return me.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,me.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new me(e.ranges.map(n=>Oo.fromJSON(n)),e.main)}static single(e,n=e){return new me([me.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return me.normalized(e.slice(),n);r=s.to}return new me(e,n)}static cursor(e,n=0,r,i){return Oo.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?Oo.create(n,e,48|a):Oo.create(e,n,(s?s<0?8:16:0)|a)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],a=e[i-1];if(s.empty?s.from<=a.to:s.from<a.to){let o=a.from,u=Math.max(s.to,a.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?me.range(u,o):me.range(o,u))}}return new me(e,n)}}function JM(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let u2=0;class ze{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=u2++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ze(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:d2),!!e.static,e.enables)}of(e){return new uO([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new uO(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new uO(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function d2(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class uO{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=u2++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,a=e[s]>>1,o=this.type==2,u=!1,d=!1,h=[];for(let m of this.dependencies)m=="doc"?u=!0:m=="selection"?d=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,g){if(u&&g.docChanged||d&&(g.docChanged||g.selection)||VS(m,h)){let x=r(m);if(o?!ET(x,m.values[a],i):!i(x,m.values[a]))return m.values[a]=x,1}return 0},reconfigure:(m,g)=>{let x,v=g.config.address[s];if(v!=null){let b=BO(g,v);if(this.dependencies.every(k=>k instanceof ze?g.facet(k)===m.facet(k):k instanceof va?g.field(k,!1)==m.field(k,!1):!0)||(o?ET(x=r(m),b,i):i(x=r(m),b)))return m.values[a]=b,0}else x=r(m);return m.values[a]=x,1}}}}function ET(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function VS(t,e){let n=!1;for(let r of e)ah(t,r)&1&&(n=!0);return n}function CH(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),s=r.filter(u=>!(u&1)),a=t[e.id]>>1;function o(u){let d=[];for(let h=0;h<r.length;h++){let m=BO(u,r[h]);if(i[h]==2)for(let g of m)d.push(g);else d.push(m)}return e.combine(d)}return{create(u){for(let d of r)ah(u,d);return u.values[a]=o(u),1},update(u,d){if(!VS(u,s))return 0;let h=o(u);return e.compare(h,u.values[a])?0:(u.values[a]=h,1)},reconfigure(u,d){let h=VS(u,r),m=d.config.facets[e.id],g=d.facet(e);if(m&&!h&&d2(n,m))return u.values[a]=g,0;let x=o(u);return e.compare(x,g)?(u.values[a]=g,0):(u.values[a]=x,1)}}}const Cg=ze.define({static:!0});class va{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new va(u2++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Cg).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let s=r.facet(Cg),a=i.facet(Cg),o;return(o=s.find(u=>u.field==this))&&o!=a.find(u=>u.field==this)?(r.values[n]=o.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Cg.of({field:this,create:e})]}get extension(){return this}}const uo={lowest:4,low:3,default:2,high:1,highest:0};function Qf(t){return e=>new e3(e,t)}const wp={highest:Qf(uo.highest),high:Qf(uo.high),default:Qf(uo.default),low:Qf(uo.low),lowest:Qf(uo.lowest)};class e3{constructor(e,n){this.inner=e,this.prec=n}}class Wx{of(e){return new YS(this,e)}reconfigure(e){return Wx.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class YS{constructor(e,n){this.compartment=e,this.inner=n}}class IO{constructor(e,n,r,i,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),a=new Map;for(let g of jH(e,n,a))g instanceof va?i.push(g):(s[g.facet.id]||(s[g.facet.id]=[])).push(g);let o=Object.create(null),u=[],d=[];for(let g of i)o[g.id]=d.length<<1,d.push(x=>g.slot(x));let h=r==null?void 0:r.config.facets;for(let g in s){let x=s[g],v=x[0].facet,b=h&&h[g]||[];if(x.every(k=>k.type==0))if(o[v.id]=u.length<<1|1,d2(b,x))u.push(r.facet(v));else{let k=v.combine(x.map(w=>w.value));u.push(r&&v.compare(k,r.facet(v))?r.facet(v):k)}else{for(let k of x)k.type==0?(o[k.id]=u.length<<1|1,u.push(k.value)):(o[k.id]=d.length<<1,d.push(w=>k.dynamicSlot(w)));o[v.id]=d.length<<1,d.push(k=>CH(k,v,x))}}let m=d.map(g=>g(o));return new IO(e,a,m,o,u,s)}}function jH(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(a,o){let u=i.get(a);if(u!=null){if(u<=o)return;let d=r[u].indexOf(a);d>-1&&r[u].splice(d,1),a instanceof YS&&n.delete(a.compartment)}if(i.set(a,o),Array.isArray(a))for(let d of a)s(d,o);else if(a instanceof YS){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),s(d,o)}else if(a instanceof e3)s(a.inner,a.prec);else if(a instanceof va)r[o].push(a),a.provides&&s(a.provides,o);else if(a instanceof uO)r[o].push(a),a.facet.extensions&&s(a.facet.extensions,uo.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,o)}}return s(t,uo.default),r.reduce((a,o)=>a.concat(o))}function ah(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function BO(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const t3=ze.define(),US=ze.define({combine:t=>t.some(e=>e),static:!0}),n3=ze.define({combine:t=>t.length?t[0]:void 0,static:!0}),r3=ze.define(),i3=ze.define(),s3=ze.define(),a3=ze.define({combine:t=>t.length?t[0]:!1});class ya{constructor(e,n){this.type=e,this.value=n}static define(){return new EH}}class EH{of(e){return new ya(this,e)}}class $H{constructor(e){this.map=e}of(e){return new Zt(this,e)}}class Zt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Zt(this.type,n)}is(e){return this.type==e}static define(e={}){return new $H(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}Zt.reconfigure=Zt.define();Zt.appendConfig=Zt.define();class pn{constructor(e,n,r,i,s,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&JM(r,n.newLength),s.some(o=>o.type==pn.time)||(this.annotations=s.concat(pn.time.of(Date.now())))}static create(e,n,r,i,s,a){return new pn(e,n,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(pn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}pn.time=ya.define();pn.userEvent=ya.define();pn.addToHistory=ya.define();pn.remote=ya.define();function NH(t,e){let n=[];for(let r=0,i=0;;){let s,a;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],a=t[r++];else if(i<e.length)s=e[i++],a=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function l3(t,e,n){var r;let i,s,a;return n?(i=e.changes,s=yn.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Zt.mapEffects(t.effects,i).concat(Zt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function WS(t,e,n){let r=e.selection,i=cu(e.annotations);return e.userEvent&&(i=i.concat(pn.userEvent.of(e.userEvent))),{changes:e.changes instanceof yn?e.changes:yn.of(e.changes||[],n,t.facet(n3)),selection:r&&(r instanceof me?r:me.single(r.anchor,r.head)),effects:cu(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function o3(t,e,n){let r=WS(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let a=!!e[s].sequential;r=l3(r,WS(t,e[s],a?r.changes.newLength:t.doc.length),a)}let i=pn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return PH(n?TH(i):i)}function TH(t){let e=t.startState,n=!0;for(let i of e.facet(r3)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:NH(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=yn.empty(e.doc.length);else{let a=t.changes.filter(n);i=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=pn.create(e,i,t.selection&&t.selection.map(s),Zt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(i3);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof pn?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof pn?t=s[0]:t=o3(e,cu(s),!1)}return t}function PH(t){let e=t.startState,n=e.facet(s3),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=l3(r,WS(e,s,t.changes.newLength),!0))}return r==t?t:pn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const _H=[];function cu(t){return t==null?_H:Array.isArray(t)?t:[t]}var ta=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(ta||(ta={}));const AH=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let HS;try{HS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function RH(t){if(HS)return HS.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||AH.test(n)))return!0}return!1}function MH(t){return e=>{if(!/\S/.test(e))return ta.Space;if(RH(e))return ta.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return ta.Word;return ta.Other}}class dt{constructor(e,n,r,i,s,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)ah(this,o<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return ah(this,r),BO(this,r)}update(...e){return o3(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let o of e.effects)o.is(Wx.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,d)=>i.set(d,u)),n=null),i.set(o.value.compartment,o.value.extension)):o.is(Zt.reconfigure)?(n=null,r=o.value):o.is(Zt.appendConfig)&&(n=null,r=cu(r).concat(o.value));let s;n?s=e.startState.values.slice():(n=IO.resolve(r,i,this),s=new dt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,d)=>d.reconfigure(u,this),null).values);let a=e.startState.facet(US)?e.newSelection:e.newSelection.asSingle();new dt(n,e.newDoc,a,s,(o,u)=>u.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:me.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],a=cu(r.effects);for(let o=1;o<n.ranges.length;o++){let u=e(n.ranges[o]),d=this.changes(u.changes),h=d.map(i);for(let g=0;g<o;g++)s[g]=s[g].map(h);let m=i.mapDesc(d,!0);s.push(u.range.map(m)),i=i.compose(h),a=Zt.mapEffects(a,h).concat(Zt.mapEffects(cu(u.effects),m))}return{changes:i,selection:me.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof yn?e:yn.of(e,this.doc.length,this.facet(dt.lineSeparator))}toText(e){return st.of(e.split(this.facet(dt.lineSeparator)||IS))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(ah(this,n),BO(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof va&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let a=r[s],o=e[s];i.push(a.init(u=>a.spec.fromJSON(o,u)))}}return dt.create({doc:e.doc,selection:me.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=IO.resolve(e.extensions||[],new Map),r=e.doc instanceof st?e.doc:st.of((e.doc||"").split(n.staticFacet(dt.lineSeparator)||IS)),i=e.selection?e.selection instanceof me?e.selection:me.single(e.selection.anchor,e.selection.head):me.single(0);return JM(i,r.length),n.staticFacet(US)||(i=i.asSingle()),new dt(n,r,i,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(dt.tabSize)}get lineBreak(){return this.facet(dt.lineSeparator)||`
387
+ `}get readOnly(){return this.facet(a3)}phrase(e,...n){for(let r of this.facet(dt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(t3))for(let a of s(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return MH(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-r,o=e-r;for(;a>0;){let u=Yn(n,a,!1);if(s(n.slice(u,a))!=ta.Word)break;a=u}for(;o<i;){let u=Yn(n,o);if(s(n.slice(o,u))!=ta.Word)break;o=u}return a==o?null:me.range(a+r,o+r)}}dt.allowMultipleSelections=US;dt.tabSize=ze.define({combine:t=>t.length?t[0]:4});dt.lineSeparator=n3;dt.readOnly=a3;dt.phrases=ze.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});dt.languageData=t3;dt.changeFilter=r3;dt.transactionFilter=i3;dt.transactionExtender=s3;Wx.reconfigure=Zt.define();function zH(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let a=i[s],o=r[s];if(o===void 0)r[s]=a;else if(!(o===a||a===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](o,a);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class kl{eq(e){return this==e}range(e,n=e){return GS.create(e,n,this)}}kl.prototype.startSide=kl.prototype.endSide=0;kl.prototype.point=!1;kl.prototype.mapMode=er.TrackDel;function f2(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let GS=class c3{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new c3(e,n,r)}};function FS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class h2{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let a=i,o=s.length;;){if(a==o)return a;let u=a+o>>1,d=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==a)return d>=0?a:o;d>=0?o=u:a=u+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,s);s<a;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],a=-1,o=-1;for(let u=0;u<this.value.length;u++){let d=this.value[u],h=this.from[u]+e,m=this.to[u]+e,g,x;if(h==m){let v=n.mapPos(h,d.startSide,d.mapMode);if(v==null||(g=x=v,d.startSide!=d.endSide&&(x=n.mapPos(h,d.endSide),x<g)))continue}else if(g=n.mapPos(h,d.startSide),x=n.mapPos(m,d.endSide),g>x||g==x&&d.startSide>0&&d.endSide<=0)continue;(x-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(o=Math.max(o,x-g)),r.push(d),i.push(g-a),s.push(x-a))}return{mapped:r.length?new h2(i,s,r,o):null,pos:a}}}class wt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new wt(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(FS)),this.isEmpty)return n.length?wt.of(n):this;let o=new u3(this,null,-1).goto(0),u=0,d=[],h=new Th;for(;o.value||u<n.length;)if(u<n.length&&(o.from-n[u].from||o.startSide-n[u].value.startSide)>=0){let m=n[u++];h.addInner(m.from,m.to,m.value)||d.push(m)}else o.rangeIndex==1&&o.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(o.chunkIndex)<n[u].from)&&(!a||i>this.chunkEnd(o.chunkIndex)||s<this.chunkPos[o.chunkIndex])&&h.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!a||i>o.to||s<o.from||a(o.from,o.to,o.value))&&(h.addInner(o.from,o.to,o.value)||d.push(GS.create(o.from,o.to,o.value))),o.next());return h.finishInner(this.nextLayer.isEmpty&&!d.length?wt.empty:this.nextLayer.update({add:d,filter:a,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let o=this.chunkPos[a],u=this.chunk[a],d=e.touchesRange(o,o+u.length);if(d===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(o));else if(d===!0){let{mapped:h,pos:m}=u.map(o,e);h&&(i=Math.max(i,h.maxPoint),n.push(h),r.push(m))}}let s=this.nextLayer.map(e);return n.length==0?s:new wt(r,n,s||wt.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],a=this.chunk[i];if(n>=s&&e<=s+a.length&&a.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Ph.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Ph.from(e).goto(n)}static compare(e,n,r,i,s=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=s),o=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=s),u=$T(a,o,r),d=new Cf(a,u,s),h=new Cf(o,u,s);r.iterGaps((m,g,x)=>NT(d,m,h,g,x,i)),r.empty&&r.length==0&&NT(d,0,h,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let o=$T(s,a),u=new Cf(s,o,0).goto(r),d=new Cf(a,o,0).goto(r);for(;;){if(u.to!=d.to||!KS(u.active,d.active)||u.point&&(!d.point||!f2(u.point,d.point)))return!1;if(u.to>i)return!0;u.next(),d.next()}}static spans(e,n,r,i,s=-1){let a=new Cf(e,null,s).goto(n),o=n,u=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),m=a.pointFrom<n?h.length+1:a.point.startSide<0?h.length:Math.min(h.length,u);i.point(o,d,a.point,h,m,a.pointRank),u=Math.min(a.openEnd(d),h.length)}else d>o&&(i.span(o,d,a.active,u),u=a.openEnd(d));if(a.to>r)return u+(a.point&&a.to>r?1:0);o=a.to,a.next()}}static of(e,n=!1){let r=new Th;for(let i of e instanceof GS?[e]:n?DH(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return wt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=wt.empty;i=i.nextLayer)n=new wt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}wt.empty=new wt([],[],null,-1);function DH(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(FS(e,r)>0)return t.slice().sort(FS);e=r}return t}wt.empty.nextLayer=wt.empty;class Th{finishChunk(e){this.chunks.push(new h2(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Th)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(wt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=wt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function $T(t,e,n){let r=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&r.set(s.chunk[a],s.chunkPos[a]);let i=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let o=r.get(s.chunk[a]);o!=null&&(n?n.mapPos(o):o)==s.chunkPos[a]&&!(n!=null&&n.touchesRange(o,o+s.chunk[a].length))&&i.add(s.chunk[a])}return i}class u3{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Ph{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new u3(a,n,r,s));return i.length==1?i[0]:new Ph(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)m0(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)m0(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),m0(this.heap,0)}}}function m0(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Cf{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ph.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){jg(this.active,e),jg(this.activeTo,e),jg(this.activeRank,e),this.minActive=TT(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Eg(this.active,n,r),Eg(this.activeTo,n,i),Eg(this.activeRank,n,s),e&&Eg(e,n,this.cursor.from),this.minActive=TT(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&jg(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function NT(t,e,n,r,i,s){t.goto(e),n.goto(r);let a=r+i,o=r,u=r-e,d=!!s.boundChange;for(let h=!1;;){let m=t.to+u-n.to,g=m||t.endSide-n.endSide,x=g<0?t.to+u:n.to,v=Math.min(x,a);if(t.point||n.point?(t.point&&n.point&&f2(t.point,n.point)&&KS(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(o,v,t.point,n.point),h=!1):(h&&s.boundChange(o),v>o&&!KS(t.active,n.active)&&s.compareRange(o,v,t.active,n.active),d&&v<a&&(m||t.openEnd(x)!=n.openEnd(x))&&(h=!0)),x>a)break;o=x,g<=0&&t.next(),g>=0&&n.next()}}function KS(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!f2(t[n],e[n]))return!1;return!0}function jg(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Eg(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function TT(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function ha(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Yn(t,i));return r}function LH(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=Yn(t,i)}return t.length}const JS="ͼ",PT=typeof Symbol>"u"?"__"+JS:Symbol.for(JS),ew=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),_T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ql{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,o,u,d){let h=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&o==null)return u.push(a[0]+";");for(let x in o){let v=o[x];if(/&/.test(x))s(x.split(/,\s*/).map(b=>a.map(k=>b.replace(/&/,k))).reduce((b,k)=>b.concat(k)),v,u);else if(v&&typeof v=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");s(i(x),v,h,g)}else v!=null&&h.push(x.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+v+";")}(h.length||g)&&u.push((r&&!m&&!d?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)s(i(a),e[a],this.rules)}getRules(){return this.rules.join(`
388
+ `)}static newName(){let e=_T[PT]||1;return _T[PT]=e+1,JS+e.toString(36)}static mount(e,n,r){let i=e[ew],s=r&&r.nonce;i?s&&i.setNonce(s):i=new XH(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let AT=new Map;class XH{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=AT.get(r);if(s)return e[ew]=s;this.sheet=new i.CSSStyleSheet,AT.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[ew]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let a=0;a<e.length;a++){let o=e[a],u=this.modules.indexOf(o);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,o),r)for(let d=0;d<o.rules.length;d++)r.insertRule(o.rules[d],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let u=0;u<this.modules.length;u++)a+=this.modules[u].getRules()+`
389
+ `;this.styleTag.textContent=a;let o=n.head||n;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Cl={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_h={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ZH=typeof navigator<"u"&&/Mac/.test(navigator.platform),IH=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var zn=0;zn<10;zn++)Cl[48+zn]=Cl[96+zn]=String(zn);for(var zn=1;zn<=24;zn++)Cl[zn+111]="F"+zn;for(var zn=65;zn<=90;zn++)Cl[zn]=String.fromCharCode(zn+32),_h[zn]=String.fromCharCode(zn);for(var g0 in Cl)_h.hasOwnProperty(g0)||(_h[g0]=Cl[g0]);function BH(t){var e=ZH&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||IH&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?_h:Cl)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let Fn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},tw=typeof document<"u"?document:{documentElement:{style:{}}};const nw=/Edge\/(\d+)/.exec(Fn.userAgent),d3=/MSIE \d/.test(Fn.userAgent),rw=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fn.userAgent),Hx=!!(d3||rw||nw),RT=!Hx&&/gecko\/(\d+)/i.test(Fn.userAgent),O0=!Hx&&/Chrome\/(\d+)/.exec(Fn.userAgent),qH="webkitFontSmoothing"in tw.documentElement.style,iw=!Hx&&/Apple Computer/.test(Fn.vendor),MT=iw&&(/Mobile\/\w+/.test(Fn.userAgent)||Fn.maxTouchPoints>2);var Qe={mac:MT||/Mac/.test(Fn.platform),windows:/Win/.test(Fn.platform),linux:/Linux|X11/.test(Fn.platform),ie:Hx,ie_version:d3?tw.documentMode||6:rw?+rw[1]:nw?+nw[1]:0,gecko:RT,gecko_version:RT?+(/Firefox\/(\d+)/.exec(Fn.userAgent)||[0,0])[1]:0,chrome:!!O0,chrome_version:O0?+O0[1]:0,ios:MT,android:/Android\b/.test(Fn.userAgent),webkit_version:qH?+(/\bAppleWebKit\/(\d+)/.exec(Fn.userAgent)||[0,0])[1]:0,safari:iw,safari_version:iw?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Fn.userAgent)||[0,0])[1]:0,tabSize:tw.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function p2(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const qO=Object.create(null);function m2(t,e,n){if(t==e)return!0;t||(t=qO),e||(e=qO);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function VH(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function zT(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function YH(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class ud{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var pi=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(pi||(pi={}));class zt extends kl{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new kp(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Ro(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:a}=f3(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new Ro(e,r,i,n,e.widget||null,!0)}static line(e){return new Qp(e)}static set(e,n=!1){return wt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}zt.none=wt.empty;class kp extends zt{constructor(e){let{start:n,end:r}=f3(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?p2(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||qO}eq(e){return this==e||e instanceof kp&&this.tagName==e.tagName&&m2(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}kp.prototype.point=!1;class Qp extends zt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Qp&&this.spec.class==e.spec.class&&m2(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Qp.prototype.mapMode=er.TrackBefore;Qp.prototype.point=!0;class Ro extends zt{constructor(e,n,r,i,s,a){super(n,r,s,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?er.TrackBefore:er.TrackAfter:er.TrackDel}get type(){return this.startSide!=this.endSide?pi.WidgetRange:this.startSide<=0?pi.WidgetBefore:pi.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Ro&&UH(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Ro.prototype.point=!0;function f3(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function UH(t,e){return t==e||!!(t&&e&&t.compare(e))}function uu(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Ah extends kl{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof Ah&&this.tagName==e.tagName&&m2(this.attributes,e.attributes)}static create(e){return new Ah(e.tagName,e.attributes||qO)}static set(e,n=!1){return wt.of(e,n)}}Ah.prototype.startSide=Ah.prototype.endSide=-1;function Rh(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function sw(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function lh(t,e){if(!e.anchorNode)return!1;try{return sw(t,e.anchorNode)}catch{return!1}}function oh(t){return t.nodeType==3?zh(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ch(t,e,n,r){return n?DT(t,e,n,r,-1)||DT(t,e,n,r,1):!1}function jl(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function VO(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function DT(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:pa(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=jl(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?pa(t):0}else return!1}}function pa(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Mh(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function WH(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function h3(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function HH(t,e,n,r,i,s,a,o){let u=t.ownerDocument,d=u.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let g,x=h==u.body,v=1,b=1;if(x)g=WH(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let j=h.getBoundingClientRect();({scaleX:v,scaleY:b}=h3(h,j)),g={left:j.left,right:j.left+h.clientWidth*v,top:j.top,bottom:j.top+h.clientHeight*b}}let k=0,w=0;if(i=="nearest")e.top<g.top?(w=e.top-(g.top+a),n>0&&e.bottom>g.bottom+w&&(w=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(w=e.bottom-g.bottom+a,n<0&&e.top-w<g.top&&(w=e.top-(g.top+a)));else{let j=e.bottom-e.top,Q=g.bottom-g.top;w=(i=="center"&&j<=Q?e.top+j/2-Q/2:i=="start"||i=="center"&&n<0?e.top-a:e.bottom-Q+a)-g.top}if(r=="nearest"?e.left<g.left?(k=e.left-(g.left+s),n>0&&e.right>g.right+k&&(k=e.right-g.right+s)):e.right>g.right&&(k=e.right-g.right+s,n<0&&e.left<g.left+k&&(k=e.left-(g.left+s))):k=(r=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:r=="start"==o?e.left-s:e.right-(g.right-g.left)+s)-g.left,k||w)if(x)d.scrollBy(k,w);else{let j=0,Q=0;if(w){let E=h.scrollTop;h.scrollTop+=w/b,Q=(h.scrollTop-E)*b}if(k){let E=h.scrollLeft;h.scrollLeft+=k/v,j=(h.scrollLeft-E)*v}e={left:e.left-j,top:e.top-Q,right:e.right-j,bottom:e.bottom-Q},j&&Math.abs(j-k)<1&&(r="nearest"),Q&&Math.abs(Q-w)<1&&(i="nearest")}if(x)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function p3(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class GH{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?pa(n):0),r,Math.min(e.focusOffset,r?pa(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let ro=null;Qe.safari&&Qe.safari_version>=26&&(ro=!1);function m3(t){if(t.setActive)return t.setActive();if(ro)return t.focus(ro);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ro==null?{get preventScroll(){return ro={preventScroll:!0},!0}}:void 0),!ro){ro=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let LT;function zh(t,e,n=e){let r=LT||(LT=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function du(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function FH(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function KH(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,pa(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=pa(n))}else{if(n==t)return!0;r=jl(n),n=n.parentNode}}function g3(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function O3(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=pa(n)}else if(n.parentNode&&!VO(n))r=jl(n),n=n.parentNode;else return null}}function x3(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!VO(n))r=jl(n)+1,n=n.parentNode;else return null}}class _i{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new _i(e.parentNode,jl(e),n)}static after(e,n){return new _i(e.parentNode,jl(e)+1,n)}}var mn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(mn||(mn={}));const Mo=mn.LTR,g2=mn.RTL;function v3(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const JH=v3("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),eG=v3("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),aw=Object.create(null),Ki=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);aw[e]=n,aw[n]=-e}function y3(t){return t<=247?JH[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?eG[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const tG=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class hs{get dir(){return this.level%2?g2:Mo}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=n&&o.to>=n){if(o.level==r)return a;(s<0||(i!=0?i<0?o.from<n:o.to>n:e[s].level>o.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function b3(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!b3(r.inner,i.inner))return!1}return!0}const Pt=[];function nG(t,e,n,r,i){for(let s=0;s<=r.length;s++){let a=s?r[s-1].to:e,o=s<r.length?r[s].from:n,u=s?256:i;for(let d=a,h=u,m=u;d<o;d++){let g=y3(t.charCodeAt(d));g==512?g=h:g==8&&m==4&&(g=16),Pt[d]=g==4?2:g,g&7&&(m=g),h=g}for(let d=a,h=u,m=u;d<o;d++){let g=Pt[d];if(g==128)d<o-1&&h==Pt[d+1]&&h&24?g=Pt[d]=h:Pt[d]=256;else if(g==64){let x=d+1;for(;x<o&&Pt[x]==64;)x++;let v=d&&h==8||x<n&&Pt[x]==8?m==1?1:8:256;for(let b=d;b<x;b++)Pt[b]=v;d=x-1}else g==8&&m==1&&(Pt[d]=1);h=g,g&7&&(m=g)}}}function rG(t,e,n,r,i){let s=i==1?2:1;for(let a=0,o=0,u=0;a<=r.length;a++){let d=a?r[a-1].to:e,h=a<r.length?r[a].from:n;for(let m=d,g,x,v;m<h;m++)if(x=aw[g=t.charCodeAt(m)])if(x<0){for(let b=o-3;b>=0;b-=3)if(Ki[b+1]==-x){let k=Ki[b+2],w=k&2?i:k&4?k&1?s:i:0;w&&(Pt[m]=Pt[Ki[b]]=w),o=b;break}}else{if(Ki.length==189)break;Ki[o++]=m,Ki[o++]=g,Ki[o++]=u}else if((v=Pt[m])==2||v==1){let b=v==i;u=b?0:1;for(let k=o-3;k>=0;k-=3){let w=Ki[k+2];if(w&2)break;if(b)Ki[k+2]|=2;else{if(w&4)break;Ki[k+2]|=4}}}}}function iG(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let a=i?n[i-1].to:t,o=i<n.length?n[i].from:e;for(let u=a;u<o;){let d=Pt[u];if(d==256){let h=u+1;for(;;)if(h==o){if(i==n.length)break;h=n[i++].to,o=i<n.length?n[i].from:e}else if(Pt[h]==256)h++;else break;let m=s==1,g=(h<e?Pt[h]:r)==1,x=m==g?m?1:2:r;for(let v=h,b=i,k=b?n[b-1].to:t;v>u;)v==k&&(v=n[--b].from,k=b?n[b-1].to:t),Pt[--v]=x;u=h}else s=d,u++}}}function lw(t,e,n,r,i,s,a){let o=r%2?2:1;if(r%2==i%2)for(let u=e,d=0;u<n;){let h=!0,m=!1;if(d==s.length||u<s[d].from){let b=Pt[u];b!=o&&(h=!1,m=b==16)}let g=!h&&o==1?[]:null,x=h?r:r+1,v=u;e:for(;;)if(d<s.length&&v==s[d].from){if(m)break e;let b=s[d];if(!h)for(let k=b.to,w=d+1;;){if(k==n)break e;if(w<s.length&&s[w].from==k)k=s[w++].to;else{if(Pt[k]==o)break e;break}}if(d++,g)g.push(b);else{b.from>u&&a.push(new hs(u,b.from,x));let k=b.direction==Mo!=!(x%2);ow(t,k?r+1:r,i,b.inner,b.from,b.to,a),u=b.to}v=b.to}else{if(v==n||(h?Pt[v]!=o:Pt[v]==o))break;v++}g?lw(t,u,v,r+1,i,g,a):u<v&&a.push(new hs(u,v,x)),u=v}else for(let u=n,d=s.length;u>e;){let h=!0,m=!1;if(!d||u>s[d-1].to){let b=Pt[u-1];b!=o&&(h=!1,m=b==16)}let g=!h&&o==1?[]:null,x=h?r:r+1,v=u;e:for(;;)if(d&&v==s[d-1].to){if(m)break e;let b=s[--d];if(!h)for(let k=b.from,w=d;;){if(k==e)break e;if(w&&s[w-1].to==k)k=s[--w].from;else{if(Pt[k-1]==o)break e;break}}if(g)g.push(b);else{b.to<u&&a.push(new hs(b.to,u,x));let k=b.direction==Mo!=!(x%2);ow(t,k?r+1:r,i,b.inner,b.from,b.to,a),u=b.from}v=b.from}else{if(v==e||(h?Pt[v-1]!=o:Pt[v-1]==o))break;v--}g?lw(t,v,u,r+1,i,g,a):v<u&&a.push(new hs(v,u,x)),u=v}}function ow(t,e,n,r,i,s,a){let o=e%2?2:1;nG(t,i,s,r,o),rG(t,i,s,r,o),iG(i,s,r,o),lw(t,i,s,e,n,r,a)}function sG(t,e,n){if(!t)return[new hs(0,0,e==g2?1:0)];if(e==Mo&&!n.length&&!tG.test(t))return S3(t.length);if(n.length)for(;t.length>Pt.length;)Pt[Pt.length]=256;let r=[],i=e==Mo?0:1;return ow(t,i,i,n,0,t.length,r),r}function S3(t){return[new hs(0,t,0)]}let w3="";function aG(t,e,n,r,i){var s;let a=r.head-t.from,o=hs.find(e,a,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),u=e[o],d=u.side(i,n);if(a==d){let g=o+=i?1:-1;if(g<0||g>=e.length)return null;u=e[o=g],a=u.side(!i,n),d=u.side(i,n)}let h=Yn(t.text,a,u.forward(i,n));(h<u.from||h>u.to)&&(h=d),w3=t.text.slice(Math.min(a,h),Math.max(a,h));let m=o==(i?e.length-1:0)?null:e[o+(i?1:-1)];return m&&h==d&&m.level+(i?0:1)<u.level?me.cursor(m.side(!i,n)+t.from,m.forward(i,n)?1:-1,m.level):me.cursor(h+t.from,u.forward(i,n)?-1:1,u.level)}function lG(t,e,n){for(let r=e;r<n;r++){let i=y3(t.charCodeAt(r));if(i==1)return Mo;if(i==2||i==4)return g2}return Mo}const k3=ze.define(),Q3=ze.define(),C3=ze.define(),j3=ze.define(),cw=ze.define(),E3=ze.define(),$3=ze.define(),O2=ze.define(),x2=ze.define(),N3=ze.define({combine:t=>t.some(e=>e)}),oG=ze.define({combine:t=>t.some(e=>e)}),T3=ze.define();class fu{constructor(e,n="nearest",r="nearest",i=5,s=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new fu(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new fu(me.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $g=Zt.define({map:(t,e)=>t.map(e)}),P3=Zt.define();function ps(t,e,n){let r=t.facet(j3);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const ea=ze.define({combine:t=>t.length?t[0]:!0});let cG=0;const nu=ze.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class El{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(nu.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(nu.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new El(cG++,e,r,i,o=>{let u=[];return a&&u.push(Gx.of(d=>{let h=d.plugin(o);return h?a(h):zt.none})),s&&u.push(s(o)),u})}static fromClass(e,n){return El.define((r,i)=>new e(r,i),n)}}class x0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(ps(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){ps(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){ps(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const _3=ze.define(),v2=ze.define(),Gx=ze.define(),A3=ze.define(),y2=ze.define(),Cp=ze.define(),R3=ze.define();function XT(t,e){let n=t.state.facet(R3);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return wt.spans(r,e.from,e.to,{point(){},span(s,a,o,u){let d=s-e.from,h=a-e.from,m=i;for(let g=o.length-1;g>=0;g--,u--){let x=o[g].spec.bidiIsolate,v;if(x==null&&(x=lG(e.text,d,h)),u>0&&m.length&&(v=m[m.length-1]).to==d&&v.direction==x)v.to=h,m=v.inner;else{let b={from:d,to:h,direction:x,inner:[]};m.push(b),m=b.inner}}}}),i}const M3=ze.define();function z3(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(M3)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Lf=ze.define();class li{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new li(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,a=0;;){let o=i<e.length?e[i].fromB:1e9,u=s<n.length?n[s]:1e9,d=Math.min(o,u);if(d==1e9)break;let h=d+a,m=d,g=h;for(;;)if(s<n.length&&n[s]<=m){let x=n[s+1];s+=2,m=Math.max(m,x);for(let v=i;v<e.length&&e[v].fromB<=m;v++)a=e[v].toA-e[v].toB;g=Math.max(g,x+a)}else if(i<e.length&&e[i].fromB<=m){let x=e[i++];m=Math.max(m,x.toB),g=Math.max(g,x.toA),a=x.toA-x.toB}else break;r.push(new li(h,g,d,m))}return r}}class YO{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=yn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,a,o,u)=>i.push(new li(s,a,o,u))),this.changedRanges=i}static create(e,n,r){return new YO(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const uG=[];class Gt{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return uG}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&VH(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=jl(this.dom),i=this.length?e>0:n>0;return new _i(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Kx)return e;return null}static get(e){return e.cmTile}}class Fx extends Gt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=(e==null?void 0:e.node)==n?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=o.dom&&(s.written=!0),o.dom.parentNode==n)for(;i&&i!=o.dom;)i=ZT(i);else n.insertBefore(o.dom,i);r=o.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=ZT(i);this.length=a}}function ZT(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Kx extends Fx{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Gt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let a=r.children[i++];if(a instanceof aa)n.push(i),r=a,i=0;else{let o=s+a.length,u=e(a,s);if(u!==void 0)return u;s=o+a.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,a=-1;if(this.blockTiles((o,u)=>{let d=u+o.length;if(e>=u&&e<=d){if(o.isWidget()&&n>=-1&&n<=1){if(o.flags&32)return!0;o.flags&16&&(r=void 0)}(u<e||e==d&&(n<-1?o.length:o.covers(1)))&&(!r||!o.isWidget()&&r.isWidget())&&(r=o,i=e-u),(d>e||e==u&&(n>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,a=e-u)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:a}}}class aa extends Fx{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new aa(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class _u extends Fx{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new _u(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,a=null,o=-1;function u(h,m){for(let g=0,x=0;g<h.children.length&&x<=m;g++){let v=h.children[g],b=x+v.length;b>=m&&(v.isComposite()?u(v,m-x):(!a||a.isHidden&&(n>0||r&&fG(a,v)))&&(b>m||v.flags&32)?(a=v,o=m-x):(x<m||v.flags&16&&!v.isHidden)&&(i=v,s=m-x)),x=b}}u(this,e);let d=(n<0?i:a)||i||a;return d?{tile:d,offset:d==i?s:o}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):dG(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new _i(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let a=r.tile.parent,o=!1;for(let u of a.children){if(o)return new _i(u.dom,0);u==r.tile&&(o=!0)}}return new _i(this.dom,0)}}function dG(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=oh(e);return n[n.length-1]||null}function fG(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class br extends Fx{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new br(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class xo extends Gt{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,a=0;e==0&&n<0||e==r&&n>=0?Qe.chrome||Qe.gecko||(e?(i--,a=1):s<r&&(s++,a=-1)):n<0?i--:s<r&&s++;let o=zh(this.dom,i,s).getClientRects();if(!o.length)return null;let u=o[(a?a<0:n>=0)?0:o.length-1];return Qe.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(o,d=>d.width)||u),a?Mh(u,a<0):u||null}static of(e,n){let r=new xo(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class zo extends Gt{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return Mh(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=o?s.length-1:0;a=s[u],!(e>0?u==0:u==s.length-1||a.top<a.bottom);u+=o?-1:1);return Mh(a,!o)}}get overrideDOMText(){if(!this.length)return st.empty;let{root:e}=this;if(!e)return st.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new zo(s,r,e,i)}}class UO extends Gt{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return st.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class hG{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:a,parents:o}=this;for(;e||n>0;)if(i.isComposite())if(a){if(!e)break;r&&r.break(),e--,a=!1}else if(s==i.children.length){if(!e&&!o.length)break;r&&r.leave(i),a=!!i.breakAfter,{tile:i,index:s}=o.pop(),s++}else{let u=i.children[s],d=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(a=!!d,s++,e-=u.length):(o.push({tile:i,index:s}),i=u,s=0,r&&u.isComposite()&&r.enter(u))}else if(s==i.length)a=!!i.breakAfter,{tile:i,index:s}=o.pop(),s++;else if(e){let u=Math.min(e,i.length-s);r&&r.skip(i,s,s+u),e-=u,s+=u}else break;return this.tile=i,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class pG{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class mG{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let a=this.ensureMarks(n,r),o=a.lastChild;if(o&&o.isText()&&!(o.flags&8)&&o.length+e.length<512){this.cache.reused.set(o,2);let u=a.children[a.children.length-1]=new xo(o.dom,o.text+e);u.parent=a}else a.append(i||xo.of(e,(s=this.cache.find(xo))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?v0(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let o=n.marks.length-1;o>=0;o--){let u=n.marks[o],d=i.lastChild;if(d instanceof br&&d.mark.eq(u.mark))d.dom!=u.dom&&d.setDOM(v0(u.dom)),i=d;else{if(this.cache.reused.get(u)){let m=Gt.get(u.dom);m&&m.setDOM(v0(u.dom))}let h=br.of(u.mark,u.dom);i.append(h),i=h}this.cache.reused.set(u,2)}let s=Gt.get(e.text);s&&this.cache.reused.set(s,2);let a=new xo(e.text,e.text.nodeValue);a.flags|=8,i.append(a)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=D3);let i=_u.start(e,n||((r=this.cache.find(_u))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],o;if(n>0&&(o=i.lastChild)&&o instanceof br&&o.mark.eq(a))i=o,n--;else{let u=br.of(a,(r=this.cache.find(br,d=>d.mark.eq(a)))===null||r===void 0?void 0:r.dom);i.append(u),i=u,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!IT(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Qe.ios&&IT(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(y0,0,32)||new zo(y0.toDOM(),0,y0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new pG(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof aa&&i.wrapper.eq(r.wrapper))n=i;else{let s=aa.of(r.wrapper,(e=this.cache.find(aa,a=>a.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(UO,void 0,1);return r&&(r.flags=n),r||new UO(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class gG{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=i;let o=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,o)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const WO=[zo,_u,xo,br,UO,aa,Kx];for(let t=0;t<WO.length;t++)WO[t].bucket=t;class OG{constructor(e){this.view=e,this.buckets=WO.map(()=>[]),this.index=WO.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],a=this.index[i];for(let o=s.length-1;o>=0;o--){let u=(o+a)%s.length,d=s[u];if((!n||n(d))&&!this.reused.has(d))return s.splice(u,1),u<a&&this.index[i]--,this.reused.set(d,r),d}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,a=0;;s++){if(s==i.length){if(a)return null;a=1,s=0}let o=i[s];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,o.widget==e&&o.length==n&&(o.flags&497)==r?(this.reused.set(o,1),o):(this.reused.set(o,2),new zo(o.dom,n,e,o.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class xG{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new OG(e),this.text=new gG(e.state.doc),this.builder=new mG(this.cache,new Kx(e,e.contentDOM),wt.iter(r)),this.cache.reused.set(n,2),this.old=new hG(n),this.reuseWalker={skip:(a,o,u)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,a=0;;){let o=a<e.length?e[a++]:null,u=o?o.fromA:this.old.root.length;if(u>i){let d=u-i;this.preserve(d,!a,!o),i=u,s+=d}if(!o)break;n&&o.fromA<=n.range.fromA&&o.toA>=n.range.toA?(this.forward(o.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,o.toA),this.emit(n.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(s,o.toB)),s=o.toB,i=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=bG(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(a,o,u)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(u-o);else{let d=u>0||o<a.length?zo.of(a.widget,this.view,u-o,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,i,s),s=i.length)}else if(a.isText())this.builder.ensureLine(null),!o&&u==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,i,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(o,u),i,s)),s=i.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof UO)this.cache.add(a);else if(a instanceof br)this.builder.ensureLine(null),this.builder.addMark(a,i,s),this.cache.reused.set(a,1),s=i.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof br&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof br&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,a=wt.spans(this.decorations,e,n,{point:(o,u,d,h,m,g)=>{if(d instanceof Ro){if(this.disallowBlockEffectsFor[g]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=h.length,m>h.length)i.continueWidget(u-o);else{let x=d.widget||(d.block?Au.block:Au.inline),v=vG(d),b=this.cache.findWidget(x,u-o,v)||zo.of(x,this.view,u-o,v);d.block?(d.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(b)):(i.ensureLine(r),i.addInlineWidget(b,h,m))}r=null}else r=yG(r,d);u>o&&this.text.skip(u-o)},span:(o,u,d,h)=>{for(let m=o;m<u;){let g=this.text.next(Math.min(512,u-m));g==null?(i.addLineStartIfNotCovered(r),i.addBreak(),m++):(i.ensureLine(r),i.addText(g,d,m==o?h:d.length),m+=g.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=a>s,this.openMarks=a}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Gt.get(i);if(i==this.view.contentDOM)break;s instanceof br?n.push(s):s!=null&&s.isLine()?r=s:s instanceof aa||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new _u(i,D3):r||n.push(br.of(new kp({tagName:i.nodeName.toLowerCase(),attributes:YH(i)}),i)))}return{line:r,marks:n}}}function IT(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function vG(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const D3={class:"cm-line"};function yG(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&p2(n,t),r&&(t.class+=" "+r)),t}function bG(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof br&&e.push(r.mark)}return e}function v0(t){let e=Gt.get(t);return e&&e.setDOM(t.cloneNode()),t}class Au extends ud{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Au.inline=new Au("span");Au.block=new Au("div");const y0=new class extends ud{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class BT{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=zt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Kx(e,e.contentDOM),this.updateInner([new li(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:h,toA:m})=>m<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!NG(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?wG(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:m}=this.hasComposition;r=new li(h,m,e.changes.mapPos(h,-1),e.changes.mapPos(m,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Qe.ie||Qe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,o=this.blockWrappers;this.updateDeco();let u=CG(a,this.decorations,e.changes);u.length&&(r=li.extendWithRanges(r,u));let d=EG(o,this.blockWrappers,e.changes);return d.length&&(r=li.extendWithRanges(r,d)),s&&!r.some(h=>h.fromA<=s.range.fromA&&h.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let a=this.tile,o=new xG(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Gt.get(n.text)&&o.cache.reused.set(Gt.get(n.text),2),this.tile=o.run(e,n),uw(a,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Qe.chrome||Qe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof b0&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(P3)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,a=!s&&!(this.view.state.facet(ea)||r.tabIndex>-1)&&lh(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||a))return;let o=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,d,h;if(u.empty?h=d=this.inlineDOMNearPos(u.anchor,u.assoc||1):(h=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),d=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),Qe.gecko&&u.empty&&!this.hasComposition&&SG(d)){let g=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(g,d.node.childNodes[d.offset]||null)),d=h=new _i(g,0),o=!0}let m=this.view.observer.selectionRange;(o||!m.focusNode||(!ch(d.node,d.offset,m.anchorNode,m.anchorOffset)||!ch(h.node,h.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,u))&&(this.view.observer.ignore(()=>{Qe.android&&Qe.chrome&&r.contains(m.focusNode)&&$G(m.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let g=Rh(this.view.root);if(g)if(u.empty){if(Qe.gecko){let x=kG(d.node,d.offset);if(x&&x!=3){let v=(x==1?O3:x3)(d.node,d.offset);v&&(d=new _i(v.node,v.offset))}}g.collapse(d.node,d.offset),u.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=u.bidiLevel)}else if(g.extend){g.collapse(d.node,d.offset);try{g.extend(h.node,h.offset)}catch{}}else{let x=document.createRange();u.anchor>u.head&&([d,h]=[h,d]),x.setEnd(h.node,h.offset),x.setStart(d.node,d.offset),g.removeAllRanges(),g.addRange(x)}a&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(d,h)),this.impreciseAnchor=d.precise?null:new _i(m.anchorNode,m.anchorOffset),this.impreciseHead=h.precise?null:new _i(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ch(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Rh(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let o=a.posAtStart;if(n.head==o||n.head==o+a.length)return;let u=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!u||!d||u.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let a=pa(e)==0?0:n==0?-1:1;for(;;){let o=e.parentNode;if(o==r.dom)break;a==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?a=-1:a=1),e=o}a<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Gt.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let a=0,o=i;;a++){let u=r.children[a];if(u.dom==s)return o;o+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,a,o=-1,u=!1;return this.tile.blockTiles((d,h)=>{if(d.isWidget()){if(d.flags&32&&h>=e)return!0;d.flags&16&&(s=!0)}else{let m=h+d.length;if(h<=e&&(r=d,i=e-h,s=m<e),m>=e&&!a&&(a=d,o=e-h,u=h>e),h>e&&a)return!0}}),!r&&!a?this.domAtPos(e,n):(s&&a?r=null:u&&r&&(a=null),r&&n<0||!a?r.domIn(i,n):a.domIn(o,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof b0?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,a){if(s.isComposite())for(let o of s.children){if(o.length>=a){let u=i(o,a);if(u)return u}if(a-=o.length,a<0)break}else if(s.isText()&&a<s.length){let o=Yn(s.text,a);if(o==a)return null;let u=zh(s.dom,a,o).getClientRects();for(let d=0;d<u.length;d++){let h=u[d];if(d==u.length-1||h.top<h.bottom&&h.left<h.right)return h}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,u=this.view.textDirection==mn.LTR,d=0,h=(m,g,x)=>{for(let v=0;v<m.children.length&&!(g>i);v++){let b=m.children[v],k=g+b.length,w=b.dom.getBoundingClientRect(),{height:j}=w;if(x&&!v&&(d+=w.top-x.top),b instanceof aa)k>r&&h(b,g,w);else if(g>=r&&(d>0&&n.push(-d),n.push(j+d),d=0,a)){let Q=b.dom.lastChild,E=Q?oh(Q):[];if(E.length){let R=E[E.length-1],T=u?R.right-w.left:w.right-R.left;T>o&&(o=T,this.minWidth=s,this.minWidthFrom=g,this.minWidthTo=k)}}x&&v==m.children.length-1&&(d+=x.bottom-w.bottom),g=k+b.breakAfter}};return h(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?mn.RTL:mn.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let o=0,u;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let h=oh(d.dom);if(h.length!=1)return;o+=h[0].width,u=h[0].height}if(o)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:o/a.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=oh(n.firstChild)[0];r=n.getBoundingClientRect().height,i=a&&a.width?a.width/27:7,s=a&&a.height?a.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],a=s?s.from-1:this.view.state.doc.length;if(a>r){let o=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(zt.replace({widget:new b0(o),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return zt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Gx).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(y2).map((s,a)=>{let o=typeof s=="function";return o&&(r=!0),o?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(wt.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(A3).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(T3))try{if(h(this.view,e.range,e))return!0}catch(m){ps(this.view.state,m,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let a=z3(this.view),o={left:i.left-a.left,top:i.top-a.top,right:i.right+a.right,bottom:i.bottom+a.bottom},{offsetWidth:u,offsetHeight:d}=this.view.scrollDOM;if(HH(this.view.scrollDOM,o,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,d),-d),this.view.textDirection==mn.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let h=this.view.docView.lineAt(r.head,1);h&&h.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){uw(this.tile)}}function uw(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)uw(r,e)}}function SG(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function L3(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=O3(n.focusNode,n.focusOffset),i=x3(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let o=Gt.get(i.node);if(!o||o.isText()&&o.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let u=Gt.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function wG(t,e,n){let r=L3(t,n);if(!r)return null;let{node:i,from:s,to:a}=r,o=i.nodeValue;if(/[\n\r]/.test(o)||t.state.doc.sliceString(r.from,r.to)!=o)return null;let u=e.invertedDesc;return{range:new li(u.mapPos(s),u.mapPos(a),s,a),text:i}}function kG(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let QG=class{constructor(){this.changes=[]}compareRange(e,n){uu(e,n,this.changes)}comparePoint(e,n){uu(e,n,this.changes)}boundChange(e){uu(e,e,this.changes)}};function CG(t,e,n){let r=new QG;return wt.compare(t,e,n,r),r.changes}class jG{constructor(){this.changes=[]}compareRange(e,n){uu(e,n,this.changes)}comparePoint(){}boundChange(e){uu(e,e,this.changes)}}function EG(t,e,n){let r=new jG;return wt.compare(t,e,n,r),r.changes}function $G(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function NG(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class b0 extends ud{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function TG(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return me.cursor(e);s==0?n=1:s==i.length&&(n=-1);let a=s,o=s;n<0?a=Yn(i.text,s,!1):o=Yn(i.text,s);let u=r(i.text.slice(a,o));for(;a>0;){let d=Yn(i.text,a,!1);if(r(i.text.slice(d,a))!=u)break;a=d}for(;o<i.length;){let d=Yn(i.text,o);if(r(i.text.slice(o,d))!=u)break;o=d}return me.range(a+i.from,o+i.from)}function PG(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let o=t.viewState.heightOracle.textHeight,u=Math.floor((i-n.top-(t.defaultLineHeight-o)*.5)/o);s+=u*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+LH(a,s,t.state.tabSize)}function _G(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==pi.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function AG(t,e,n,r){let i=_G(t,e.head,e.assoc||-1),s=!r||i.type!=pi.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),o=t.textDirectionAt(i.from),u=t.posAtCoords({x:n==(o==mn.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(u!=null)return me.cursor(u,n?-1:1)}return me.cursor(n?i.to:i.from,n?-1:1)}function qT(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let o=e,u=null;;){let d=aG(i,s,a,o,n),h=w3;if(!d){if(i.number==(n?t.state.doc.lines:1))return o;h=`
390
+ `,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),d=t.visualLineSide(i,!n)}if(u){if(!u(h))return o}else{if(!r)return d;u=r(h)}o=d}}function RG(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let a=r(s);return i==ta.Space&&(i=a),i==a}}function MG(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return me.cursor(i,e.assoc);let a=e.goalColumn,o,u=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),h=t.documentTop;if(d)a==null&&(a=d.left-u.left),o=s<0?d.top:d.bottom;else{let v=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(u.right-u.left,t.defaultCharacterWidth*(i-v.from))),o=(s<0?v.top:v.bottom)+h}let m=u.left+a,g=t.viewState.heightOracle.textHeight>>1,x=r??g;for(let v=0;;v+=g){let b=o+(x+v)*s,k=dw(t,{x:m,y:b},!1,s);if(n?b>u.bottom:b<u.top)return me.cursor(k.pos,k.assoc);let w=t.coordsAtPos(k.pos,k.assoc),j=w?(w.top+w.bottom)/2:0;if(!w||(n?j>o:j<o))return me.cursor(k.pos,k.assoc,void 0,a)}}function uh(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,a,o)=>{if(e>s&&e<a){let u=r||n||(e-s<a-e?-1:1);e=u<0?s:a,r=u}});if(!r)return e}}function X3(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let a=uh(t,i.from,0);a!=i.from&&(s=me.cursor(a,-1))}else{let a=uh(t,i.from,-1),o=uh(t,i.to,1);(a!=i.from||o!=i.to)&&(s=me.range(i.from==i.anchor?a:o,i.from==i.head?a:o))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?me.create(n,e.mainIndex):e}function S0(t,e,n){let r=uh(t.state.facet(Cp).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:me.cursor(r,r<n.from?1:-1)}class ds{constructor(e,n){this.pos=e,this.assoc=n}}function dw(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:a,y:o}=e,u=o-s,d;for(;;){if(u<0)return new ds(0,1);if(u>t.viewState.docHeight)return new ds(t.state.doc.length,-1);if(d=t.elementAtHeight(u),r==null)break;if(d.type==pi.Text){if(r<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let g=t.docView.coordsAt(r<0?d.from:d.to,r>0?-1:1);if(g&&(r<0?g.top<=u+s:g.bottom>=u+s))break}let m=t.viewState.heightOracle.textHeight/2;u=r>0?d.bottom+m:d.top-m}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==pi.Text){let m=PG(t,i,d,a,o);return new ds(m,m==d.from?1:-1)}}if(d.type!=pi.Text)return u<(d.top+d.bottom)/2?new ds(d.from,1):new ds(d.to,-1);let h=t.docView.lineAt(d.from,2);return(!h||h.length!=d.length)&&(h=t.docView.lineAt(d.from,-2)),new zG(t,a,o,t.textDirectionAt(d.from)).scanTile(h,d.from)}class zG{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[hs.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[hs.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,a=this.bidiIn(e[0],e[i]),o,u,d=-1,h=1e9,m;e:for(;r<i;){let x=i-r,v=r+i>>1;t:if(s.has(v)){let k=r+Math.floor(Math.random()*x);for(let w=0;w<x;w++){if(!s.has(k)){v=k;break t}k++,k==i&&(k=r)}break e}s.add(v);let b=n(v);if(b)for(let k=0;k<b.length;k++){let w=b[k],j=0;if(!(w.width==0&&b.length>1)){if(w.bottom<this.y)(!o||o.bottom<w.bottom)&&(o=w),j=1;else if(w.top>this.y)(!u||u.top>w.top)&&(u=w),j=-1;else{let Q=w.left>this.x?this.x-w.left:w.right<this.x?this.x-w.right:0,E=Math.abs(Q);E<h&&(d=v,h=E,m=w),Q&&(j=Q<0==(this.baseDir==mn.LTR)?-1:1)}j==-1&&(!a||this.baseDirAt(e[v],1))?i=v:j==1&&(!a||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}}if(!m){let x=o&&(!u||this.y-o.bottom<u.top-this.y)?o:u;return this.y=(x.top+x.bottom)/2,this.scan(e,n)}let g=(a?this.dirAt(e[d],1):this.baseDir)==mn.LTR;return{i:d,after:this.x>(m.left+m.right)/2==g}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=Yn(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let a=r[s]-n,o=r[s+1]-n;return zh(e.dom,a,o).getClientRects()});return i.after?new ds(r[i.i+1],-1):new ds(r[i.i],1)}scanTile(e,n){if(!e.length)return new ds(n,1);if(e.children.length==1){let o=e.children[0];if(o.isText())return this.scanText(o,n);if(o.isComposite())return this.scanTile(o,n)}let r=[n];for(let o=0,u=n;o<e.children.length;o++)r.push(u+=e.children[o].length);let i=this.scan(r,o=>{let u=e.children[o];return u.flags&48?null:(u.dom.nodeType==1?u.dom:zh(u.dom,0,u.length)).getClientRects()}),s=e.children[i.i],a=r[i.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):i.after?new ds(r[i.i+1],-1):new ds(a,1)}}const Wc="￿";class DG{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(dt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Wc}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let a=Gt.get(i),o=i.nextSibling;if(o==n){a!=null&&a.breakAfter&&!o&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Gt.get(o);(a&&u?a.breakAfter:(a?a.breakAfter:VO(i))||VO(o)&&(i.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!XG(o,n)&&this.lineBreak(),i=o}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,o;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(o=i.exec(n))&&(s=o.index,a=o[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=a-1);r=s+a}}readNode(e){let n=Gt.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(LG(e,r.node,r.offset)?n:0))}}function LG(t,e,n){for(;;){if(!e||n<pa(e))return!1;if(e==t)return!0;n=jl(e)+1,e=e.parentNode}}function XG(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Gt.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class VT{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class ZG{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=Z3(e.docView.tile,n,r,0))){let u=s||a?[]:BG(e),d=new DG(u,e);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=qG(u,this.bounds.from)}else{let u=e.observer.selectionRange,d=s&&s.node==u.focusNode&&s.offset==u.focusOffset||!sw(e.contentDOM,u.focusNode)?o.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),h=a&&a.node==u.anchorNode&&a.offset==u.anchorOffset||!sw(e.contentDOM,u.anchorNode)?o.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),m=e.viewport;if((Qe.ios||Qe.chrome)&&o.main.empty&&d!=h&&(m.from>0||m.to<e.state.doc.length)){let g=Math.min(d,h),x=Math.max(d,h),v=m.from-g,b=m.to-x;(v==0||v==1||g==0)&&(b==0||b==-1||x==e.state.doc.length)&&(d=0,h=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(me.range(h,d));else if(e.lineWrapping&&h==d&&!(o.main.empty&&o.main.head==d)&&e.inputState.lastTouchTime>Date.now()-100){let g=e.coordsAtPos(d,-1),x=0;g&&(x=e.inputState.lastTouchY<=g.bottom?-1:1),this.newSel=me.create([me.cursor(d,x)])}else this.newSel=me.single(h,d)}}}function Z3(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,a=-1,o=-1;for(let u=0,d=r,h=r;u<t.children.length;u++){let m=t.children[u],g=d+m.length;if(d<e&&g>n)return Z3(m,e,n,d);if(g>=e&&i==-1&&(i=u,s=d),d>n&&m.dom.parentNode==t.dom){a=u,o=h;break}h=g,d=g+m.breakAfter}return{from:s,to:o<0?r+t.length:o,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function I3(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:u}=e.bounds,d=s.from,h=null;(a===8||Qe.android&&e.text.length<u-o)&&(d=s.to,h="end");let m=i.doc.sliceString(o,u,Wc),g,x;!s.empty&&s.from>=o&&s.to<=u&&(e.typeOver||m!=e.text)&&m.slice(0,s.from-o)==e.text.slice(0,s.from-o)&&m.slice(s.to-o)==e.text.slice(g=e.text.length-(m.length-(s.to-o)))?n={from:s.from,to:s.to,insert:st.of(e.text.slice(s.from-o,g).split(Wc))}:(x=B3(m,e.text,d-o,h))&&(Qe.chrome&&a==13&&x.toB==x.from+2&&e.text.slice(x.from,x.toB)==Wc+Wc&&x.toB--,n={from:o+x.from,to:o+x.toA,insert:st.of(e.text.slice(x.from,x.toB).split(Wc))})}else r&&(!t.hasFocus&&i.facet(ea)||HO(r,s))&&(r=null);if(!n&&!r)return!1;if((Qe.mac||Qe.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=me.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:st.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:Qe.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
391
+ `&&t.lineWrapping&&(r&&(r=me.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:st.of([" "])}),n)return b2(t,n,r,a);if(r&&!HO(r,s)){let o=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(r=X3(i.facet(Cp).map(d=>d(t)),r))),t.dispatch({selection:r,scrollIntoView:o,userEvent:u}),!0}else return!1}function b2(t,e,n,r=-1){if(Qe.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Qe.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&du(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&du(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&du(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,o=()=>a||(a=IG(t,e,n));return t.state.facet(E3).some(u=>u(t,e.from,e.to,s,o))||t.dispatch(o()),!0}function IG(t,e,n){let r,i=t.state,s=i.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,d=u<0?s.from:s.to,h=uh(i.facet(Cp).map(m=>m(t)),d,u);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:me.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=s.from<e.from?i.sliceDoc(s.from,e.from):"",d=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let u=i.changes(e),d=n&&n.main.to<=u.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=t.state.sliceDoc(e.from,e.to),m,g=n&&L3(t,n.main.head);if(g){let v=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-v}}else m=t.state.doc.lineAt(s.head);let x=s.to-e.to;r=i.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:u,range:d||v.map(u)};let b=v.to-x,k=b-h.length;if(t.state.sliceDoc(k,b)!=h||b>=m.from&&k<=m.to)return{range:v};let w=i.changes({from:k,to:b,insert:e.insert}),j=v.to-s.to;return{changes:w,range:d?me.range(Math.max(0,d.anchor+j),Math.max(0,d.head+j)):v.map(w)}})}else r={changes:u,selection:d&&i.selection.replaceRange(d)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function B3(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let a=t.length,o=e.length;for(;a>0&&o>0&&t.charCodeAt(a-1)==e.charCodeAt(o-1);)a--,o--;if(r=="end"){let u=Math.max(0,s-Math.min(a,o));n-=a+u-s}if(a<s&&t.length<e.length){let u=n<=s&&n>=a?s-n:0;s-=u,o=s+(o-a),a=s}else if(o<s){let u=n<=s&&n>=o?s-n:0;s-=u,a=s+(a-o),o=s}return{from:s,toA:a,toB:o}}function BG(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new VT(n,r)),(i!=n||s!=r)&&e.push(new VT(i,s))),e}function qG(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?me.single(n+e,r+e):null}function HO(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class VG{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Qe.safari&&e.contentDOM.addEventListener("input",()=>null),Qe.gecko&&aF(e.contentDOM.ownerDocument)}handleEvent(e){!JG(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=YG(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,o=r[s];o&&a!=!o.handlers.length&&(i.removeEventListener(s,this.handleEvent),o=null),o||i.addEventListener(s,this.handleEvent,{passive:a})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&V3.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Qe.android&&Qe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Qe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=q3.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||UG.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,du(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Qe.safari&&!Qe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function YT(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){ps(n.state,i)}}}function YG(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(s)for(let o in s){let u=s[o];u&&n(o).handlers.push(YT(r.value,u))}if(a)for(let o in a){let u=a[o];u&&n(o).observers.push(YT(r.value,u))}}for(let r in Di)n(r).handlers.push(Di[r]);for(let r in Qr)n(r).observers.push(Qr[r]);return e}const q3=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],UG="dthko",V3=[16,17,18,20,91,92,224,225],Ng=6;function Tg(t){return Math.max(0,t)*.7+8}function WG(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class HG{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=p3(e.contentDOM),this.atoms=e.state.facet(Cp).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(dt.allowMultipleSelections)&&GG(e,n),this.dragging=KG(e,n)&&W3(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&WG(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let u=z3(this.view);e.clientX-u.left<=i+Ng?n=-Tg(i-e.clientX):e.clientX+u.right>=a-Ng&&(n=Tg(e.clientX-a)),e.clientY-u.top<=s+Ng?r=-Tg(s-e.clientY):e.clientY+u.bottom>=o-Ng&&(r=Tg(e.clientY-o)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=X3(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function GG(t,e){let n=t.state.facet(k3);return n.length?n[0](e):Qe.mac?e.metaKey:e.ctrlKey}function FG(t,e){let n=t.state.facet(Q3);return n.length?n[0](e):Qe.mac?!e.altKey:!e.ctrlKey}function KG(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Rh(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let a=i[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function JG(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Gt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Di=Object.create(null),Qr=Object.create(null),Y3=Qe.ie&&Qe.ie_version<15||Qe.ios&&Qe.webkit_version<604;function eF(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),U3(t,n.value)},50)}function Jx(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function U3(t,e){e=Jx(t.state,O2,e);let{state:n}=t,r,i=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(fw!=null&&n.selection.ranges.every(u=>u.empty)&&fw==s.toString()){let u=-1;r=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==u)return{range:d};u=h.from;let m=n.toText((a?s.line(i++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:me.cursor(d.from+m.length)}})}else a?r=n.changeByRange(u=>{let d=s.line(i++);return{changes:{from:u.from,to:u.to,insert:d.text},range:me.cursor(u.from+d.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Qr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Qr.wheel=Qr.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Di.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Qr.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Qr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Di.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(C3))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=nF(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new HG(t,e,n,r)),r&&t.observer.ignore(()=>{m3(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function UT(t,e,n,r){if(r==1)return me.cursor(e,n);if(r==2)return TG(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:s.from,o=i?i.posAtEnd:s.to;return o<t.state.doc.length&&o==s.to&&o++,me.range(a,o)}}const tF=Qe.ie&&Qe.ie_version<=11;let WT=null,HT=0,GT=0;function W3(t){if(!tF)return t.detail;let e=WT,n=GT;return WT=t,GT=Date.now(),HT=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(HT+1)%3:1}function nF(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=W3(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,a,o){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),d,h=UT(t,u.pos,u.assoc,r);if(n.pos!=u.pos&&!a){let m=UT(t,n.pos,n.assoc,r),g=Math.min(m.from,h.from),x=Math.max(m.to,h.to);h=g<h.from?me.range(g,x,h.assoc):me.range(x,g,h.assoc)}return a?i.replaceRange(i.main.extend(h.from,h.to,h.assoc)):o&&r==1&&i.ranges.length>1&&(d=rF(i,u.pos))?d:o?i.addRange(h):me.create([h])}}}function rF(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return me.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Di.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,a=s+i.length;(s>=n.to||a<=n.from)&&(n=me.range(s,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Jx(t.state,x2,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Di.dragend=t=>(t.inputState.draggedContent=null,!1);function FT(t,e,n,r){if(n=Jx(t.state,O2,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=r&&s&&FG(t,e)?{from:s.from,to:s.to}:null,o={from:i,insert:n},u=t.state.changes(a?[a,o]:o);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Di.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&FT(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let o=new FileReader;o.onerror=s,o.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(r[a]=o.result),s()},o.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return FT(t,e,r,!0),!0}return!1};Di.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Y3?null:e.clipboardData;return n?(U3(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(eF(t),!1)};function iF(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function sF(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:Jx(t,x2,e.join(t.lineBreak)),ranges:n,linewise:r}}let fw=null;Di.copy=Di.cut=(t,e)=>{if(!lh(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=sF(t.state);if(!n&&!i)return!1;fw=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=Y3?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(iF(t,n),!1)};const H3=ya.define();function G3(t,e){let n=[];for(let r of t.facet($3)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:H3.of(!0)}):null}function F3(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=G3(t.state,e);n?t.dispatch(n):t.update([])}},10)}Qr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),F3(t)};Qr.blur=t=>{t.observer.clearSelectionRange(),F3(t)};Qr.compositionstart=Qr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Qr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Qe.chrome&&Qe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Qr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Di.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let o=a[0],u=t.posAtDOM(o.startContainer,o.startOffset),d=t.posAtDOM(o.endContainer,o.endOffset);return b2(t,{from:u,to:d,insert:t.state.toText(s)},null),!0}}let i;if(Qe.chrome&&Qe.android&&(i=q3.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Qe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Qe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Qr.compositionend(t,e),20),!1};const KT=new Set;function aF(t){KT.has(t)||(KT.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const JT=["pre-wrap","normal","pre-line","break-spaces"];let Ru=!1;function eP(){Ru=!1}class lF{constructor(e){this.lineWrapping=e,this.doc=st.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return JT.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,a){let o=JT.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,u){this.heightSamples={};for(let d=0;d<a.length;d++){let h=a[d];h<0?d++:this.heightSamples[Math.floor(h*10)]=!0}}return u}}class oF{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Ti{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?pi.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Ro?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ti(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var At=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(At||(At={}));const dO=.001;class rr{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>dO&&(Ru=!0),this.height=e)}replace(e,n,r){return rr.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,a=r.doc;for(let o=i.length-1;o>=0;o--){let{fromA:u,toA:d,fromB:h,toB:m}=i[o],g=s.lineAt(u,At.ByPosNoHeight,r.setDoc(n),0,0),x=g.to>=d?g:s.lineAt(d,At.ByPosNoHeight,r,0,0);for(m+=x.to-d,d=x.to;o>0&&g.from<=i[o-1].toA;)u=i[o-1].fromA,h=i[o-1].fromB,o--,u<g.from&&(g=s.lineAt(u,At.ByPosNoHeight,r,0,0));h+=g.from-u,u=g.from;let v=S2.build(r.setDoc(a),e,h,m);s=GO(s,s.replace(u,d,v))}return s.updateHeight(r,0)}static empty(){return new Lr(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let o=e[n-1];o.break?e.splice(--n,1,o.left,null,o.right):e.splice(--n,1,o.left,o.right),r+=1+o.break,i-=o.size}else if(s>i*2){let o=e[r];o.break?e.splice(r,1,o.left,null,o.right):e.splice(r,1,o.left,o.right),r+=2+o.break,s-=o.size}else break;else if(i<s){let o=e[n++];o&&(i+=o.size)}else{let o=e[--r];o&&(s+=o.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new uF(rr.of(e.slice(0,n)),a,rr.of(e.slice(r)))}}function GO(t,e){return t==e?t:(t.constructor!=e.constructor&&(Ru=!0),e)}rr.prototype.size=1;const cF=zt.replace({});class K3 extends rr{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Ti(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Ti(i,0,r,this.spaceAbove,cF):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let a=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(a):a}forEachLine(e,n,r,i,s,a){e<=s+this.length&&n>=s&&a(this.lineAt(0,At.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Lr extends K3{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Ti(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Lr||i instanceof An&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof An?i=new Lr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):rr.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class An extends rr{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,a,o=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);a=u/s,this.length>s+1&&(o=(this.height-u)/(this.length-s-1))}else a=this.height/s;return{firstLine:r,lastLine:i,perLine:a,perChar:o}}blockAt(e,n,r,i){let{firstLine:s,lastLine:a,perLine:o,perChar:u}=this.heightMetrics(n,i);if(n.lineWrapping){let d=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),h=n.doc.lineAt(d),m=o+h.length*u,g=Math.max(r,e-m/2);return new Ti(h.from,h.length,g,m,0)}else{let d=Math.max(0,Math.min(a-s,Math.floor((e-r)/o))),{from:h,length:m}=n.doc.line(s+d);return new Ti(h,m,r+o*d,o,0)}}lineAt(e,n,r,i,s){if(n==At.ByHeight)return this.blockAt(e,r,i,s);if(n==At.ByPosNoHeight){let{from:x,to:v}=r.doc.lineAt(e);return new Ti(x,v-x,0,0,0)}let{firstLine:a,perLine:o,perChar:u}=this.heightMetrics(r,s),d=r.doc.lineAt(e),h=o+d.length*u,m=d.number-a,g=i+o*m+u*(d.from-s-m);return new Ti(d.from,d.length,Math.max(i,Math.min(g,i+this.height-h)),h,0)}forEachLine(e,n,r,i,s,a){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:o,perLine:u,perChar:d}=this.heightMetrics(r,s);for(let h=e,m=i;h<=n;){let g=r.doc.lineAt(h);if(h==e){let v=g.number-o;m+=u*v+d*(e-s-v)}let x=u+d*g.length;a(new Ti(g.from,g.length,m,x,0)),m+=x,h=g.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof An?r[r.length-1]=new An(s.length+i):r.push(null,new An(i-1))}if(e>0){let s=r[0];s instanceof An?r[0]=new An(e+s.length):r.unshift(new An(e-1),null)}return rr.of(r)}decomposeLeft(e,n){n.push(new An(e-1),null)}decomposeRight(e,n){n.push(null,new An(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],o=Math.max(n,i.from),u=-1;for(i.from>n&&a.push(new An(i.from-n-1).updateHeight(e,n));o<=s&&i.more;){let h=e.doc.lineAt(o).length;a.length&&a.push(null);let m=i.heights[i.index++],g=0;m<0&&(g=-m,m=i.heights[i.index++]),u==-1?u=m:Math.abs(m-u)>=dO&&(u=-2);let x=new Lr(h,m,g);x.outdated=!1,a.push(x),o+=h+1}o<=s&&a.push(null,new An(s-o).updateHeight(e,o));let d=rr.of(a);return(u<0||Math.abs(d.height-this.height)>=dO||Math.abs(u-this.heightMetrics(e,n).perLine)>=dO)&&(Ru=!0),GO(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class uF extends rr{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let a=i+this.left.height,o=s+this.left.length+this.break,u=n==At.ByHeight?e<a:e<o,d=u?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,a,o);if(this.break||(u?d.to<o:d.from>o))return d;let h=n==At.ByPosNoHeight?At.ByPosNoHeight:At.ByPos;return u?d.join(this.right.lineAt(o,h,r,a,o)):this.left.lineAt(o,h,r,i,s).join(d)}forEachLine(e,n,r,i,s,a){let o=i+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,r,i,s,a),n>=u&&this.right.forEachLine(e,n,r,o,u,a);else{let d=this.lineAt(u,At.ByPos,r,i,s);e<d.from&&this.left.forEachLine(e,d.from-1,r,i,s,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,o,u,a)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let o of r)s.push(o);if(e>0&&tP(s,a-1),n<this.length){let o=s.length;this.decomposeRight(n,s),tP(s,o)}return rr.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?rr.of(this.break?[e,null,n]:[e,n]):(this.left=GO(this.left,e),this.right=GO(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:a}=this,o=n+s.length+this.break,u=null;return i&&i.from<=n+s.length&&i.more?u=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=o+a.length&&i.more?u=a=a.updateHeight(e,o,r,i):a.updateHeight(e,o,r),u?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tP(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof An&&(r=t[e+1])instanceof An&&t.splice(e-1,3,new An(n.length+1+r.length))}const dF=5;class S2{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Lr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Lr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new K3(a,i,r)):(a||s||i>=dF)&&this.addLineDeco(i,s,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Lr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new An(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Lr)return e;let n=new Lr(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Lr)&&!this.isCovered?this.nodes.push(new Lr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Lr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new S2(r,e);return wt.spans(n,r,i,s,0),s.finish(r)}}function fF(t,e,n){let r=new hF;return wt.compare(t,e,n,r,0),r.changes}class hF{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&uu(e,n,this.changes,5)}}function pF(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),o=Math.max(0,n.top),u=Math.min(i.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=r.body;)if(d.nodeType==1){let h=d,m=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let g=h.getBoundingClientRect();s=Math.max(s,g.left),a=Math.min(a,g.right),o=Math.max(o,g.top),u=Math.min(d==t.parentNode?i.innerHeight:u,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:o-(n.top+e),bottom:Math.max(o,u)-(n.top+e)}}function mF(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function gF(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class w0{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return zt.replace({widget:new OF(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class OF extends ud{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class nP{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=rP,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(v2).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new lF(r),this.stateDeco=iP(n),this.heightMap=rr.empty().applyChanges(this.stateDeco,st.empty,this.heightOracle.setDoc(n.doc),[new li(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=zt.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:a})=>i>=s&&i<=a)){let{from:s,to:a}=this.lineBlockAt(i);e.push(new Pg(s,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?rP:new w2(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Xf(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=iP(this.state);let i=e.changedRanges,s=li.extendWithRanges(i,fF(r,this.stateDeco,e?e.changes:yn.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);eP(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||Ru)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let d=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(oG)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?mn.RTL:mn.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",o=n.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let d=0,h=0;if(o.width&&o.height){let{scaleX:R,scaleY:T}=h3(n,o);(R>.005&&Math.abs(this.scaleX-R)>.005||T>.005&&Math.abs(this.scaleY-T)>.005)&&(this.scaleX=R,this.scaleY=T,d|=16,a=u=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=p3(this.view.contentDOM,!1).y;x!=this.scrollParent&&(this.scrollParent=x,this.scrollAnchorHeight=-1,this.scrollOffset=0);let v=this.getScrollOffset();this.scrollOffset!=v&&(this.scrollAnchorHeight=-1,this.scrollOffset=v),this.scrolledToBottom=g3(this.scrollParent||e.win);let b=(this.printing?gF:pF)(n,this.paddingTop),k=b.top-this.pixelViewport.top,w=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let j=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(j!=this.inView&&(this.inView=j,j&&(u=!0)),!this.inView&&!this.scrollTarget&&!mF(e.dom))return 0;let Q=o.width;if((this.contentDOMWidth!=Q||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),u){let R=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(R)&&(a=!0),a||i.lineWrapping&&Math.abs(Q-this.contentDOMWidth)>i.charWidth){let{lineHeight:T,charWidth:A,textHeight:I}=e.docView.measureTextSize();a=T>0&&i.refresh(s,T,A,I,Math.max(5,Q/A),R),a&&(e.docView.minWidth=0,d|=16)}k>0&&w>0?h=Math.max(k,w):k<0&&w<0&&(h=Math.min(k,w)),eP();for(let T of this.viewports){let A=T.from==this.viewport.from?R:e.docView.measureVisibleLineHeights(T);this.heightMap=(a?rr.empty().applyChanges(this.stateDeco,st.empty,this.heightOracle,[new li(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new oF(T.from,A))}Ru&&(d|=2)}let E=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return E&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||E)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,u=new Pg(i.lineAt(a-r*1e3,At.ByHeight,s,0,0).from,i.lineAt(o+(1-r)*1e3,At.ByHeight,s,0,0).to);if(n){let{head:d}=n.range;if(d<u.from||d>u.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=i.lineAt(d,At.ByPos,s,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d<u.from?g=m.top:g=m.bottom-h,u=new Pg(i.lineAt(g-1e3/2,At.ByHeight,s,0,0).from,i.lineAt(g+h+1e3/2,At.ByHeight,s,0,0).to)}}return u}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new Pg(this.heightMap.lineAt(r,At.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,At.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,At.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,At.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=o+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&s<o+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new w0(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,a=i<<1;if(this.defaultTextDirection!=mn.LTR&&!r)return[];let o=[],u=(h,m,g,x)=>{if(m-h<s)return;let v=this.state.selection.main,b=[v.from];v.empty||b.push(v.to);for(let w of b)if(w>h&&w<m){u(h,w-10,g,x),u(w+10,m,g,x);return}let k=vF(e,w=>w.from>=g.from&&w.to<=g.to&&Math.abs(w.from-h)<s&&Math.abs(w.to-m)<s&&!b.some(j=>w.from<j&&w.to>j));if(!k){if(m<g.to&&n&&r&&n.visibleRanges.some(Q=>Q.from<=m&&Q.to>=m)){let Q=n.moveToLineBoundary(me.cursor(m),!1,!0).head;Q>h&&(m=Q)}let w=this.gapSize(g,h,m,x),j=r||w<2e6?w:2e6;k=new w0(h,m,w,j)}o.push(k)},d=h=>{if(h.length<a||h.type!=pi.Text)return;let m=xF(h.from,h.to,this.stateDeco);if(m.total<a)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,x,v;if(r){let b=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,k,w;if(g!=null){let j=Ag(m,g),Q=((this.visibleBottom-this.visibleTop)/2+b)/h.height;k=j-Q,w=j+Q}else k=(this.visibleTop-h.top-b)/h.height,w=(this.visibleBottom-h.top+b)/h.height;x=_g(m,k),v=_g(m,w)}else{let b=m.total*this.heightOracle.charWidth,k=i*this.heightOracle.charWidth,w=0;if(b>2e6)for(let T of e)T.from>=h.from&&T.from<h.to&&T.size!=T.displaySize&&T.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=T.size-T.displaySize);let j=this.pixelViewport.left+w,Q=this.pixelViewport.right+w,E,R;if(g!=null){let T=Ag(m,g),A=((Q-j)/2+k)/b;E=T-A,R=T+A}else E=(j-k)/b,R=(Q+k)/b;x=_g(m,E),v=_g(m,R)}x>h.from&&u(h.from,x,h,m),v<h.to&&u(v,h.to,h,m)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(d):d(h);return o}gapSize(e,n,r,i){let s=Ag(i,r)-Ag(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){w0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=zt.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];wt.spans(n,this.viewport.from,this.viewport.to,{span(s,a){r.push({from:s,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let a=this.visibleRanges[s],o=r[s];(a.from!=o.from||a.to!=o.to)&&(i|=4,e&&e.mapPos(a.from,-1)==o.from&&e.mapPos(a.to,1)==o.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Xf(this.heightMap.lineAt(e,At.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Xf(this.heightMap.lineAt(this.scaler.fromDOM(e),At.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Xf(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let Pg=class{constructor(e,n){this.from=e,this.to=n}};function xF(t,e,n){let r=[],i=t,s=0;return wt.spans(n,t,e,{span(){},point(a,o){a>i&&(r.push({from:i,to:a}),s+=a-i),i=o}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function _g({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:a}=e[i],o=a-s;if(r<=o)return s+r;r-=o}}function Ag(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function vF(t,e){for(let n of t)if(e(n))return n}const rP={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function iP(t){let e=t.facet(Gx).filter(r=>typeof r!="function"),n=t.facet(y2).filter(r=>typeof r!="function");return n.length&&e.push(wt.join(n)),e}class w2{constructor(e,n,r){let i=0,s=0,a=0;this.viewports=r.map(({from:o,to:u})=>{let d=n.lineAt(o,At.ByPos,e,0,0).top,h=n.lineAt(u,At.ByPos,e,0,0).bottom;return i+=h-d,{from:o,to:u,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let o of this.viewports)o.domTop=a+(o.top-s)*this.scale,a=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof w2?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Xf(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Ti(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Xf(i,e)):t._content)}const Rg=ze.define({combine:t=>t.join(" ")}),hw=ze.define({combine:t=>t.indexOf(!0)>-1}),pw=Ql.newName(),J3=Ql.newName(),e4=Ql.newName(),t4={"&light":"."+J3,"&dark":"."+e4};function mw(t,e,n){return new Ql(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const yF=mw("."+pw,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},t4),bF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},k0=Qe.ie&&Qe.ie_version<=11;class SF{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new GH,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Qe.ie&&Qe.ie_version<=11||Qe.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Qe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Qe.chrome&&Qe.chrome_version<126)&&(this.editContext=new kF(e),e.state.facet(ea)&&(e.contentDOM.editContext=this.editContext.editContext)),k0&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(ea)?r.root.activeElement!=this.dom:!lh(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Qe.ie&&Qe.ie_version<=11||Qe.android&&Qe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&ch(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Rh(e.root);if(!n)return!1;let r=Qe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&wF(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=lh(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&KH(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,bF),k0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),k0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&du(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&lh(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new ZG(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=I3(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!HO(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=sP(n,e.previousSibling||e.target.previousSibling,-1),i=sP(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ea)!=e.state.facet(ea)&&(e.view.contentDOM.editContext=e.state.facet(ea)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function sP(t,e,n){for(;e;){let r=Gt.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function aP(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return ch(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function wF(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return aP(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?aP(t,n):null}class kF{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:a}=i,o=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:o,drifted:!1});let d=u-o>r.text.length;o==this.from&&s<this.from?o=s:u==this.to&&s>this.to&&(u=s);let h=B3(e.state.sliceDoc(o,u),r.text,(d?i.from:i.to)-o,d?"end":null);if(!h){let g=me.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));HO(g,i)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:h.from+o,to:h.toA+o,insert:st.of(r.text.slice(h.from,h.toB).split(`
392
+ `))};if((Qe.mac||Qe.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:o,to:u,insert:st.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);b2(e,m,me.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let a=this.toEditorPos(r.rangeStart),o=this.toEditorPos(r.rangeEnd);a<o;a++){let u=e.coordsForChar(a);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let a=s.underlineStyle,o=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(o)){let u=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(u<d){let h=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(o)?1:2}px`;i.push(zt.mark({attributes:{style:h}}).range(u,d))}}}e.dispatch({effects:P3.of(zt.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Rh(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,a,o,u,d)=>{if(r)return;let h=d.length-(a-s);if(i&&a>=i.to)if(i.from==s&&i.to==a&&i.insert.eq(d)){i=this.pendingContextChange=null,n+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(s+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ae{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||FH(e.parent)||document,this.viewState=new nP(this,e.state||dt.create(e)),e.scrollTo&&e.scrollTo.is($g)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(nu).map(i=>new x0(i));for(let i of this.plugins)i.update(this);this.observer=new SF(this),this.inputState=new VG(this),this.inputState.ensureHandlers(this.plugins),this.docView=new BT(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof pn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let g of e){if(g.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=g.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,o=0,u=null;e.some(g=>g.annotation(H3))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,u=G3(s,a),u||(o=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(dt.phrases)!=this.state.facet(dt.phrases))return this.setState(s);i=YO.create(this,s,e),i.flags|=o;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:x}=g.state.selection;m=new fu(x.empty?x:me.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of g.effects)x.is($g)&&(m=x.value.clip(this.state))}this.viewState.update(i,m),this.bidiCache=FO.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Lf)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Rg)!=i.state.facet(Rg)&&(this.viewState.mustMeasureContent=!0),(n||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let g of this.state.facet(cw))try{g(i)}catch(x){ps(this.state,x,"update listener")}(u||h)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),h&&!I3(this,h)&&d.force&&du(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new nP(this,e),this.plugins=e.facet(nu).map(r=>new x0(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new BT(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(nu),r=e.state.facet(nu);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new x0(s));else{let o=this.plugins[a];o.mustUpdate=e,i.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){ps(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(a<0)if(g3(r||this.win))s=-1,a=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(i);s=x.from,a=x.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];u&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(x=>{try{return x.read(this)}catch(v){return ps(this.state,v),lP}}),m=YO.create(this,this.state,[]),g=!1;m.flags|=u,n?n.flags|=u:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let x=0;x<d.length;x++)if(h[x]!=lP)try{let v=d[x];v.write&&v.write(h[x],this)}catch(v){ps(this.state,v)}if(g&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let v=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((v>1||v<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+v,r?r.scrollTop+=v:this.win.scrollBy(0,v),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let o of this.state.facet(cw))o(n)}get themeClasses(){return pw+" "+(this.state.facet(hw)?e4:J3)+" "+this.state.facet(Rg)}updateAttrs(){let e=oP(this,_3,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ea)?"true":"false",class:"cm-content",style:`${Qe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),oP(this,v2,n);let r=this.observer.ignore(()=>{let i=zT(this.contentDOM,this.contentAttrs,n),s=zT(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Ae.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Lf);let e=this.state.facet(Ae.cspNonce);Ql.mount(this.root,this.styleModules.concat(yF).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return S0(this,e,qT(this,e,n,r))}moveByGroup(e,n){return S0(this,e,qT(this,e,n,r=>RG(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return me.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return AG(this,e,n,r)}moveVertically(e,n,r){return S0(this,e,MG(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=dw(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),dw(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),a=s[hs.find(s,e-i.from,-1,n)];return Mh(r,a.dir==mn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(N3)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>QF)return S3(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||b3(s.isolates,r=XT(this,e))))return s.order;r||(r=XT(this,e));let i=sG(e.text,n,r);return this.bidiCache.push(new FO(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Qe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{m3(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return $g.of(new fu(typeof e=="number"?me.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return $g.of(new fu(me.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return El.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return El.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Ql.newName(),i=[Rg.of(r),Lf.of(mw(`.${r}`,e))];return n&&n.dark&&i.push(hw.of(!0)),i}static baseTheme(e){return wp.lowest(Lf.of(mw("."+pw,e,t4)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Gt.get(r)||Gt.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}Ae.styleModule=Lf;Ae.inputHandler=E3;Ae.clipboardInputFilter=O2;Ae.clipboardOutputFilter=x2;Ae.scrollHandler=T3;Ae.focusChangeEffect=$3;Ae.perLineTextDirection=N3;Ae.exceptionSink=j3;Ae.updateListener=cw;Ae.editable=ea;Ae.mouseSelectionStyle=C3;Ae.dragMovesSelection=Q3;Ae.clickAddsSelectionRange=k3;Ae.decorations=Gx;Ae.blockWrappers=A3;Ae.outerDecorations=y2;Ae.atomicRanges=Cp;Ae.bidiIsolatedRanges=R3;Ae.scrollMargins=M3;Ae.darkTheme=hw;Ae.cspNonce=ze.define({combine:t=>t.length?t[0]:""});Ae.contentAttributes=v2;Ae.editorAttributes=_3;Ae.lineWrapping=Ae.contentAttributes.of({class:"cm-lineWrapping"});Ae.announce=Zt.define();const QF=4096,lP={};class FO{constructor(e,n,r,i,s,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=a}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:mn.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new FO(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function oP(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],a=typeof s=="function"?s(t):s;a&&p2(a,n)}return n}const CF=Qe.mac?"mac":Qe.windows?"win":Qe.linux?"linux":"key";function jF(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,a,o;for(let u=0;u<n.length-1;++u){const d=n[u];if(/^(cmd|meta|m)$/i.test(d))o=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),o&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function Mg(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const EF=wp.default(Ae.domEventHandlers({keydown(t,e){return PF($F(e.state),t,e,"editor")}})),ev=ze.define({enables:EF}),cP=new WeakMap;function $F(t){let e=t.facet(ev),n=cP.get(e);return n||cP.set(e,n=TF(e.reduce((r,i)=>r.concat(i),[]))),n}let cl=null;const NF=4e3;function TF(t,e=CF){let n=Object.create(null),r=Object.create(null),i=(a,o)=>{let u=r[a];if(u==null)r[a]=o;else if(u!=o)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,o,u,d,h)=>{var m,g;let x=n[a]||(n[a]=Object.create(null)),v=o.split(/ (?!$)/).map(w=>jF(w,e));for(let w=1;w<v.length;w++){let j=v.slice(0,w).join(" ");i(j,!0),x[j]||(x[j]={preventDefault:!0,stopPropagation:!1,run:[Q=>{let E=cl={view:Q,prefix:j,scope:a};return setTimeout(()=>{cl==E&&(cl=null)},NF),!0}]})}let b=v.join(" ");i(b,!1);let k=x[b]||(x[b]={preventDefault:!1,stopPropagation:!1,run:((g=(m=x._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});u&&k.run.push(u),d&&(k.preventDefault=!0),h&&(k.stopPropagation=!0)};for(let a of t){let o=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of o){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in h)h[g].run.push(x=>m(x,gw))}let u=a[e]||a.key;if(u)for(let d of o)s(d,u,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(d,"Shift-"+u,a.shift,a.preventDefault,a.stopPropagation)}return n}let gw=null;function PF(t,e,n,r){gw=e;let i=BH(e),s=kH(i,0),a=QH(s)==i.length&&i!=" ",o="",u=!1,d=!1,h=!1;cl&&cl.view==n&&cl.scope==r&&(o=cl.prefix+" ",V3.indexOf(e.keyCode)<0&&(d=!0,cl=null));let m=new Set,g=k=>{if(k){for(let w of k.run)if(!m.has(w)&&(m.add(w),w(n)))return k.stopPropagation&&(h=!0),!0;k.preventDefault&&(k.stopPropagation&&(h=!0),d=!0)}return!1},x=t[r],v,b;return x&&(g(x[o+Mg(i,e,!a)])?u=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Qe.windows&&e.ctrlKey&&e.altKey)&&!(Qe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=Cl[e.keyCode])&&v!=i?(g(x[o+Mg(v,e,!0)])||e.shiftKey&&(b=_h[e.keyCode])!=i&&b!=v&&g(x[o+Mg(b,e,!1)]))&&(u=!0):a&&e.shiftKey&&g(x[o+Mg(i,e,!0)])&&(u=!0),!u&&g(x._any)&&(u=!0)),d&&(u=!0),u&&h&&e.stopPropagation(),gw=null,u}class _F extends ud{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?oh(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Mh(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function AF(t){let e=El.fromClass(class{constructor(n){this.view=n,this.placeholder=t?zt.set([zt.widget({widget:new _F(t),side:1}).range(0)]):zt.none}get decorations(){return this.view.state.doc.length?zt.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Ae.contentAttributes.of({"aria-placeholder":t})]:e}class Mu extends kl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Mu.prototype.elementClass="";Mu.prototype.toDOM=void 0;Mu.prototype.mapMode=er.TrackBefore;Mu.prototype.startSide=Mu.prototype.endSide=-1;Mu.prototype.point=!0;const n4=1024;let RF=0;class oi{constructor(e,n){this.from=e,this.to=n}}class Xe{constructor(e={}){this.id=RF++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=bn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Xe.closedBy=new Xe({deserialize:t=>t.split(" ")});Xe.openedBy=new Xe({deserialize:t=>t.split(" ")});Xe.group=new Xe({deserialize:t=>t.split(" ")});Xe.isolate=new Xe({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Xe.contextHash=new Xe({perNode:!0});Xe.lookAhead=new Xe({perNode:!0});Xe.mounted=new Xe({perNode:!0});class hu{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Xe.mounted.id]}}const MF=Object.create(null);class bn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):MF,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new bn(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Xe.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Xe.group),s=-1;s<(i?i.length:0);s++){let a=n[s<0?r.name:i[s]];if(a)return a}}}}bn.none=new bn("",Object.create(null),0,8);class jp{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let s of e){let a=s(r);if(a){i||(i=Object.assign({},r.props));let o=a[1],u=a[0];u.combine&&u.id in i&&(o=u.combine(i[u.id],o)),i[u.id]=o}}n.push(i?new bn(r.name,i,r.id,r.flags):r)}return new jp(n)}}const zg=new WeakMap,uP=new WeakMap;var xt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(xt||(xt={}));class gt{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,o]of s)this.props[typeof a=="number"?a:a.id]=o}}toString(){let e=hu.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new KO(this.topNode,e)}cursorAt(e,n=0,r=0){let i=zg.get(this)||this.topNode,s=new KO(i);return s.moveTo(e,n),zg.set(this,s._tree),s}get topNode(){return new Oi(this,0,0,null)}resolve(e,n=0){let r=Dh(zg.get(this)||this.topNode,e,n,!1);return zg.set(this,r),r}resolveInner(e,n=0){let r=Dh(uP.get(this)||this.topNode,e,n,!0);return uP.set(this,r),r}resolveStack(e,n=0){return LF(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,a=e.mode||0,o=(a&xt.IncludeAnonymous)>0;for(let u=this.cursor(a|xt.IncludeAnonymous);;){let d=!1;if(u.from<=s&&u.to>=i&&(!o&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;d=!0}for(;d&&r&&(o||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:C2(bn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new gt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new gt(bn.none,n,r,i)))}static build(e){return XF(e)}}gt.empty=new gt(bn.none,[],[],0);class k2{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new k2(this.buffer,this.index)}}class $l{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return bn.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,n,r,i,s){let{buffer:a}=this,o=-1;for(let u=e;u!=n&&!(r4(s,i,a[u+1],a[u+2])&&(o=u,r>0));u=a[u+3]);return o}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),a=0;for(let o=e,u=0;o<n;){s[u++]=i[o++],s[u++]=i[o++]-r;let d=s[u++]=i[o++]-r;s[u++]=i[o++]-e,a=Math.max(a,d)}return new $l(s,a,this.set)}}function r4(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Dh(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof Oi&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=r?0:xt.IgnoreOverlays;if(r)for(let a=t,o=a.parent;o;a=o,o=a.parent)a instanceof Oi&&a.index<0&&((i=o.enter(e,n,s))===null||i===void 0?void 0:i.from)!=a.from&&(t=o);for(;;){let a=t.enter(e,n,s);if(!a)return t;t=a}}class i4{cursor(e=0){return new KO(this,e)}getChild(e,n=null,r=null){let i=dP(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return dP(this,e,n,r)}resolve(e,n=0){return Dh(this,e,n,!1)}resolveInner(e,n=0){return Dh(this,e,n,!0)}matchContext(e){return Ow(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}let Oi=class fO extends i4{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let a=this;;){for(let{children:o,positions:u}=a._tree,d=n>0?o.length:-1;e!=d;e+=n){let h=o[e],m=u[e]+a.from,g;if(!(!(s&xt.EnterBracketed&&h instanceof gt&&(g=hu.get(h))&&!g.overlay&&g.bracketed&&r>=m&&r<=m+h.length)&&!r4(i,r,m,m+h.length))){if(h instanceof $l){if(s&xt.ExcludeBuffers)continue;let x=h.findChild(0,h.buffer.length,n,r-m,i);if(x>-1)return new ms(new zF(a,h,e,m),null,x)}else if(s&xt.IncludeAnonymous||!h.type.isAnonymous||Q2(h)){let x;if(!(s&xt.IgnoreMounts)&&(x=hu.get(h))&&!x.overlay)return new fO(x.tree,m,e,a);let v=new fO(h,m,e,a);return s&xt.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?h.children.length-1:0,n,r,i,s)}}}if(s&xt.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&xt.IgnoreOverlays)&&(i=hu.get(this._tree))&&i.overlay){let s=e-this.from,a=r&xt.EnterBracketed&&i.bracketed;for(let{from:o,to:u}of i.overlay)if((n>0||a?o<=s:o<s)&&(n<0||a?u>=s:u>s))return new fO(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function dP(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Ow(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class zF{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class ms extends i4{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new ms(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&xt.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new ms(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ms(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ms(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let a=r.buffer[this.index+1];e.push(r.slice(i,s,a)),n.push(0)}return new gt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function s4(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>n.from||a.to<n.to)&&(n=a,e=s)}let r=n instanceof Oi&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new DF(i,n)}class DF{constructor(e,n){this.heads=e,this.node=n}get next(){return s4(this.heads)}}function LF(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof Oi?r:r.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(i||(i=[r])).push(a.resolve(e,n)),s=a}else{let a=hu.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let o=new Oi(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Dh(o,e,n,!1))}}return i?s4(i):r}class KO{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~xt.EnterBracketed,e instanceof Oi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Oi?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&xt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,a=e<0?-1:r._tree.children.length;s!=a;s+=e){let o=r._tree.children[s];if(this.mode&xt.IncludeAnonymous||o instanceof $l||!o.type.isAnonymous||Q2(o))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new ms(this.buffer,n,this.stack[i]);return this.bufferNode=new ms(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Ow(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return Ow(this._tree,e,i);let a=r[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function Q2(t){return t.children.some(e=>e instanceof $l||!e.type.isAnonymous||Q2(e))}function XF(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=n4,reused:s=[],minRepeatType:a=r.types.length}=t,o=Array.isArray(n)?new k2(n,n.length):n,u=r.types,d=0,h=0;function m(R,T,A,I,W,F){let{id:Z,start:B,end:H,size:P}=o,D=h,_=d;if(P<0)if(o.next(),P==-1){let z=s[Z];A.push(z),I.push(B-R);return}else if(P==-3){d=Z;return}else if(P==-4){h=Z;return}else throw new RangeError(`Unrecognized record size: ${P}`);let X=u[Z],Y,V,$=B-R;if(H-B<=i&&(V=k(o.pos-T,W))){let z=new Uint16Array(V.size-V.skip),q=o.pos-V.size,M=z.length;for(;o.pos>q;)M=w(V.start,z,M);Y=new $l(z,H-V.start,r),$=V.start-R}else{let z=o.pos-P;o.next();let q=[],M=[],G=Z>=a?Z:-1,ie=0,J=H;for(;o.pos>z;)G>=0&&o.id==G&&o.size>=0?(o.end<=J-i&&(v(q,M,B,ie,o.end,J,G,D,_),ie=q.length,J=o.end),o.next()):F>2500?g(B,z,q,M):m(B,z,q,M,G,F+1);if(G>=0&&ie>0&&ie<q.length&&v(q,M,B,ie,B,J,G,D,_),q.reverse(),M.reverse(),G>-1&&ie>0){let ne=x(X,_);Y=C2(X,q,M,0,q.length,0,H-B,ne,ne)}else Y=b(X,q,M,H-B,D-H,_)}A.push(Y),I.push($)}function g(R,T,A,I){let W=[],F=0,Z=-1;for(;o.pos>T;){let{id:B,start:H,end:P,size:D}=o;if(D>4)o.next();else{if(Z>-1&&H<Z)break;Z<0&&(Z=P-i),W.push(B,H,P),F++,o.next()}}if(F){let B=new Uint16Array(F*4),H=W[W.length-2];for(let P=W.length-3,D=0;P>=0;P-=3)B[D++]=W[P],B[D++]=W[P+1]-H,B[D++]=W[P+2]-H,B[D++]=D;A.push(new $l(B,W[2]-H,r)),I.push(H-R)}}function x(R,T){return(A,I,W)=>{let F=0,Z=A.length-1,B,H;if(Z>=0&&(B=A[Z])instanceof gt){if(!Z&&B.type==R&&B.length==W)return B;(H=B.prop(Xe.lookAhead))&&(F=I[Z]+B.length+H)}return b(R,A,I,W,F,T)}}function v(R,T,A,I,W,F,Z,B,H){let P=[],D=[];for(;R.length>I;)P.push(R.pop()),D.push(T.pop()+A-W);R.push(b(r.types[Z],P,D,F-W,B-F,H)),T.push(W-A)}function b(R,T,A,I,W,F,Z){if(F){let B=[Xe.contextHash,F];Z=Z?[B].concat(Z):[B]}if(W>25){let B=[Xe.lookAhead,W];Z=Z?[B].concat(Z):[B]}return new gt(R,T,A,I,Z)}function k(R,T){let A=o.fork(),I=0,W=0,F=0,Z=A.end-i,B={size:0,start:0,skip:0};e:for(let H=A.pos-R;A.pos>H;){let P=A.size;if(A.id==T&&P>=0){B.size=I,B.start=W,B.skip=F,F+=4,I+=4,A.next();continue}let D=A.pos-P;if(P<0||D<H||A.start<Z)break;let _=A.id>=a?4:0,X=A.start;for(A.next();A.pos>D;){if(A.size<0)if(A.size==-3||A.size==-4)_+=4;else break e;else A.id>=a&&(_+=4);A.next()}W=X,I+=P,F+=_}return(T<0||I==R)&&(B.size=I,B.start=W,B.skip=F),B.size>4?B:void 0}function w(R,T,A){let{id:I,start:W,end:F,size:Z}=o;if(o.next(),Z>=0&&I<a){let B=A;if(Z>4){let H=o.pos-(Z-4);for(;o.pos>H;)A=w(R,T,A)}T[--A]=B,T[--A]=F-R,T[--A]=W-R,T[--A]=I}else Z==-3?d=I:Z==-4&&(h=I);return A}let j=[],Q=[];for(;o.pos>0;)m(t.start||0,t.bufferStart||0,j,Q,-1,0);let E=(e=t.length)!==null&&e!==void 0?e:j.length?Q[0]+j[0].length:0;return new gt(u[t.topID],j.reverse(),Q.reverse(),E)}const fP=new WeakMap;function hO(t,e){if(!t.isAnonymous||e instanceof $l||e.type!=t)return 1;let n=fP.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof gt)){n=1;break}n+=hO(t,r)}fP.set(e,n)}return n}function C2(t,e,n,r,i,s,a,o,u){let d=0;for(let v=r;v<i;v++)d+=hO(t,e[v]);let h=Math.ceil(d*1.5/8),m=[],g=[];function x(v,b,k,w,j){for(let Q=k;Q<w;){let E=Q,R=b[Q],T=hO(t,v[Q]);for(Q++;Q<w;Q++){let A=hO(t,v[Q]);if(T+A>=h)break;T+=A}if(Q==E+1){if(T>h){let A=v[E];x(A.children,A.positions,0,A.children.length,b[E]+j);continue}m.push(v[E])}else{let A=b[Q-1]+v[Q-1].length-R;m.push(C2(t,v,b,E,Q,R,A,null,u))}g.push(R+j-s)}}return x(e,n,r,i,0),(o||u)(m,g,a)}class a4{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof ms?this.setBuffer(e.context.buffer,e.index,n):e instanceof Oi&&this.map.set(e.tree,n)}get(e){return e instanceof ms?this.getBuffer(e.context.buffer,e.index):e instanceof Oi?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class la{constructor(e,n,r,i,s=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new la(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,a=e.length?e[0]:null;for(let o=0,u=0,d=0;;o++){let h=o<n.length?n[o]:null,m=h?h.fromA:1e9;if(m-u>=r)for(;a&&a.from<m;){let g=a;if(u>=g.from||m<=g.to||d){let x=Math.max(g.from,u)-d,v=Math.min(g.to,m)-d;g=x>=v?null:new la(x,v,g.tree,g.offset+d,o>0,!!h)}if(g&&i.push(g),a.to>m)break;a=s<e.length?e[s++]:null}if(!h)break;u=h.toA,d=h.toA-h.toB}return i}}class j2{startParse(e,n,r){return typeof e=="string"&&(e=new ZF(e)),r=r?r.length?r.map(i=>new oi(i.from,i.to)):[new oi(0,0)]:[new oi(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class ZF{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function l4(t){return(e,n,r,i)=>new BF(e,t,n,r,i)}class hP{constructor(e,n,r,i,s,a){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=s,this.from=a}}function pP(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class IF{constructor(e,n,r,i,s,a,o,u){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=s,this.bracketed=a,this.target=o,this.prev=u,this.depth=0,this.ranges=[]}}const xw=new Xe({perNode:!0});class BF{constructor(e,n,r,i,s){this.nest=n,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new gt(r.type,r.children,r.positions,r.length,r.propValues.concat([[xw,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Xe.mounted.id]=new hu(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new YF(this.fragments),n=null,r=null,i=new KO(new Oi(this.baseTree,this.ranges[0].from,0,null),xt.IncludeAnonymous|xt.IgnoreMounts);e:for(let s,a;;){let o=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(n){let d=n.mounts.find(h=>h.frag.from<=i.from&&h.frag.to>=i.to&&h.mount.overlay);if(d)for(let h of d.mount.overlay){let m=h.from+d.pos,g=h.to+d.pos;m>=i.from&&g<=i.to&&!n.ranges.some(x=>x.from<g&&x.to>m)&&n.ranges.push({from:m,to:g})}}o=!1}else if(r&&(a=qF(r.ranges,i.from,i.to)))o=a!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(VF(i),n&&n.depth++,r&&r.depth++);let d=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")n=new IF(s.parser,s.overlay,d,this.inner.length,i.from,!!s.bracketed,i.tree,n);else{let h=OP(this.ranges,s.overlay||(i.from<i.to?[new oi(i.from,i.to)]:[]));h.length&&pP(h),(h.length||!s.overlay)&&this.inner.push(new hP(s.parser,h.length?s.parser.startParse(this.input,xP(d,h),h):s.parser.startParse(""),s.overlay?s.overlay.map(m=>new oi(m.from-i.from,m.to-i.from)):null,!!s.bracketed,i.tree,h.length?h[0].from:i.from)),s.overlay?h.length&&(r={ranges:h,depth:0,prev:r}):o=!1}}else if(n&&(u=n.predicate(i))&&(u===!0&&(u=new oi(i.from,i.to)),u.from<u.to)){let d=n.ranges.length-1;d>=0&&n.ranges[d].to==u.from?n.ranges[d]={from:n.ranges[d].from,to:u.to}:n.ranges.push(u)}if(o&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let d=OP(this.ranges,n.ranges);d.length&&(pP(d),this.inner.splice(n.index,0,new hP(n.parser,n.parser.startParse(this.input,xP(n.mounts,d),d),n.ranges.map(h=>new oi(h.from-n.start,h.to-n.start)),n.bracketed,n.target,d[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function qF(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function mP(t,e,n,r,i,s){if(e<n){let a=t.buffer[e+1];r.push(t.slice(e,n,a)),i.push(a-s)}}function VF(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,s=i.children.indexOf(r),a=i.children[s],o=a.buffer,u=[s];function d(h,m,g,x,v,b){let k=n[b],w=[],j=[];mP(a,h,k,w,j,x);let Q=o[k+1],E=o[k+2];u.push(w.length);let R=b?d(k+4,o[k+3],a.set.types[o[k]],Q,E-Q,b-1):e.toTree();return w.push(R),j.push(Q-x),mP(a,o[k+3],m,w,j,x),new gt(g,w,j,v)}i.children[s]=d(0,o.length,bn.none,0,a.length,n.length-1);for(let h of u){let m=t.tree.children[h],g=t.tree.positions[h];t.yield(new Oi(m,g+t.from,h,t._tree))}}class gP{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(xt.IncludeAnonymous|xt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,xt.IgnoreOverlays|xt.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof gt)n=n.children[0];else break}return!1}}let YF=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(xw))!==null&&n!==void 0?n:r.to,this.inner=new gP(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(xw))!==null&&e!==void 0?e:n.to,this.inner=new gP(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let a=(r=s.tree)===null||r===void 0?void 0:r.prop(Xe.mounted);if(a&&a.parser==n)for(let o=this.fragI;o<this.fragments.length;o++){let u=this.fragments[o];if(u.from>=s.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:s.from-u.offset,mount:a})}}}return i}};function OP(t,e){let n=null,r=e;for(let i=1,s=0;i<t.length;i++){let a=t[i-1].to,o=t[i].from;for(;s<r.length;s++){let u=r[s];if(u.from>=o)break;u.to<=a||(n||(r=n=e.slice()),u.from<a?(n[s]=new oi(u.from,a),u.to>o&&n.splice(s+1,0,new oi(o,u.to))):u.to>o?n[s--]=new oi(o,u.to):n.splice(s--,1))}}return r}function UF(t,e,n,r){let i=0,s=0,a=!1,o=!1,u=-1e9,d=[];for(;;){let h=i==t.length?1e9:a?t[i].to:t[i].from,m=s==e.length?1e9:o?e[s].to:e[s].from;if(a!=o){let g=Math.max(u,n),x=Math.min(h,m,r);g<x&&d.push(new oi(g,x))}if(u=Math.min(h,m),u==1e9)break;h==u&&(a?(a=!1,i++):a=!0),m==u&&(o?(o=!1,s++):o=!0)}return d}function xP(t,e){let n=[];for(let{pos:r,mount:i,frag:s}of t){let a=r+(i.overlay?i.overlay[0].from:0),o=a+i.tree.length,u=Math.max(s.from,a),d=Math.min(s.to,o);if(i.overlay){let h=i.overlay.map(g=>new oi(g.from+r,g.to+r)),m=UF(e,h,u,d);for(let g=0,x=u;;g++){let v=g==m.length,b=v?d:m[g].from;if(b>x&&n.push(new la(x,b,i.tree,-a,s.from>=x||s.openStart,s.to<=b||s.openEnd)),v)break;x=m[g].to}}else n.push(new la(u,d,i.tree,-a,s.from>=a||s.openStart,s.to<=o||s.openEnd))}return n}let WF=0,ls=class vw{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=WF++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof vw&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new vw(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new vP(e);return r=>r.modified.indexOf(n)>-1?r:vP.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}},HF=0,vP=class o4{constructor(e){this.name=e,this.instances=[],this.id=HF++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(o=>o.base==e&&GF(n,o.modified));if(r)return r;let i=[],s=new ls(e.name,i,e,n);for(let o of n)o.instances.push(s);let a=FF(n);for(let o of e.set)if(!o.modified.length)for(let u of a)i.push(o4.get(o,u));return s}};function GF(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function FF(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Fo(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],a=2,o=i;for(let m=0;;){if(o=="..."&&m>0&&m+3==i.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!g)throw new RangeError("Invalid path: "+i);if(s.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==i.length)break;let x=i[m++];if(m==i.length&&x=="!"){a=0;break}if(x!="/")throw new RangeError("Invalid path: "+i);o=i.slice(m)}let u=s.length-1,d=s[u];if(!d)throw new RangeError("Invalid path: "+i);let h=new Lh(r,a,u>0?s.slice(0,u):null);e[d]=h.sort(e[d])}}return c4.add(e)}const c4=new Xe({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new Lh(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class Lh{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Lh.empty=new Lh([],2,null);function u4(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let a of s.tag)n[a.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let a=i;for(let o of s)for(let u of o.set){let d=n[u.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}function KF(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function JF(t,e,n,r=0,i=t.length){let s=new eK(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class eK{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:a,from:o,to:u}=e;if(o>=r||u<=n)return;a.isTop&&(s=this.highlighters.filter(x=>!x.scope||x.scope(a)));let d=i,h=tK(e)||Lh.empty,m=KF(s,h.tags);if(m&&(d&&(d+=" "),d+=m,h.mode==1&&(i+=(i?" ":"")+m)),this.startSpan(Math.max(n,o),d),h.opaque)return;let g=e.tree&&e.tree.prop(Xe.mounted);if(g&&g.overlay){let x=e.node.enter(g.overlay[0].from+o,1),v=this.highlighters.filter(k=>!k.scope||k.scope(g.tree.type)),b=e.firstChild();for(let k=0,w=o;;k++){let j=k<g.overlay.length?g.overlay[k]:null,Q=j?j.from+o:u,E=Math.max(n,w),R=Math.min(r,Q);if(E<R&&b)for(;e.from<R&&(this.highlightRange(e,E,R,i,s),this.startSpan(Math.min(R,e.to),d),!(e.to>=Q||!e.nextSibling())););if(!j||Q>r)break;w=j.to+o,w>n&&(this.highlightRange(x.cursor(),Math.max(n,j.from+o),Math.min(r,w),"",v),this.startSpan(Math.min(r,w),d))}b&&e.parent()}else if(e.firstChild()){g&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function tK(t){let e=t.type.prop(c4);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const ve=ls.define,Dg=ve(),al=ve(),yP=ve(al),bP=ve(al),ll=ve(),Lg=ve(ll),Q0=ve(ll),ts=ve(),to=ve(ts),Ji=ve(),es=ve(),yw=ve(),jf=ve(yw),Xg=ve(),U={comment:Dg,lineComment:ve(Dg),blockComment:ve(Dg),docComment:ve(Dg),name:al,variableName:ve(al),typeName:yP,tagName:ve(yP),propertyName:bP,attributeName:ve(bP),className:ve(al),labelName:ve(al),namespace:ve(al),macroName:ve(al),literal:ll,string:Lg,docString:ve(Lg),character:ve(Lg),attributeValue:ve(Lg),number:Q0,integer:ve(Q0),float:ve(Q0),bool:ve(ll),regexp:ve(ll),escape:ve(ll),color:ve(ll),url:ve(ll),keyword:Ji,self:ve(Ji),null:ve(Ji),atom:ve(Ji),unit:ve(Ji),modifier:ve(Ji),operatorKeyword:ve(Ji),controlKeyword:ve(Ji),definitionKeyword:ve(Ji),moduleKeyword:ve(Ji),operator:es,derefOperator:ve(es),arithmeticOperator:ve(es),logicOperator:ve(es),bitwiseOperator:ve(es),compareOperator:ve(es),updateOperator:ve(es),definitionOperator:ve(es),typeOperator:ve(es),controlOperator:ve(es),punctuation:yw,separator:ve(yw),bracket:jf,angleBracket:ve(jf),squareBracket:ve(jf),paren:ve(jf),brace:ve(jf),content:ts,heading:to,heading1:ve(to),heading2:ve(to),heading3:ve(to),heading4:ve(to),heading5:ve(to),heading6:ve(to),contentSeparator:ve(ts),list:ve(ts),quote:ve(ts),emphasis:ve(ts),strong:ve(ts),link:ve(ts),monospace:ve(ts),strikethrough:ve(ts),inserted:ve(),deleted:ve(),changed:ve(),invalid:ve(),meta:Xg,documentMeta:ve(Xg),annotation:ve(Xg),processingInstruction:ve(Xg),definition:ls.defineModifier("definition"),constant:ls.defineModifier("constant"),function:ls.defineModifier("function"),standard:ls.defineModifier("standard"),local:ls.defineModifier("local"),special:ls.defineModifier("special")};for(let t in U){let e=U[t];e instanceof ls&&(e.name=t)}u4([{tag:U.link,class:"tok-link"},{tag:U.heading,class:"tok-heading"},{tag:U.emphasis,class:"tok-emphasis"},{tag:U.strong,class:"tok-strong"},{tag:U.keyword,class:"tok-keyword"},{tag:U.atom,class:"tok-atom"},{tag:U.bool,class:"tok-bool"},{tag:U.url,class:"tok-url"},{tag:U.labelName,class:"tok-labelName"},{tag:U.inserted,class:"tok-inserted"},{tag:U.deleted,class:"tok-deleted"},{tag:U.literal,class:"tok-literal"},{tag:U.string,class:"tok-string"},{tag:U.number,class:"tok-number"},{tag:[U.regexp,U.escape,U.special(U.string)],class:"tok-string2"},{tag:U.variableName,class:"tok-variableName"},{tag:U.local(U.variableName),class:"tok-variableName tok-local"},{tag:U.definition(U.variableName),class:"tok-variableName tok-definition"},{tag:U.special(U.variableName),class:"tok-variableName2"},{tag:U.definition(U.propertyName),class:"tok-propertyName tok-definition"},{tag:U.typeName,class:"tok-typeName"},{tag:U.namespace,class:"tok-namespace"},{tag:U.className,class:"tok-className"},{tag:U.macroName,class:"tok-macroName"},{tag:U.propertyName,class:"tok-propertyName"},{tag:U.operator,class:"tok-operator"},{tag:U.comment,class:"tok-comment"},{tag:U.meta,class:"tok-meta"},{tag:U.invalid,class:"tok-invalid"},{tag:U.punctuation,class:"tok-punctuation"}]);var C0;const vo=new Xe;function E2(t){return ze.define({combine:t?e=>e.concat(t):void 0})}const $2=new Xe;class ci{constructor(e,n,r=[],i=""){this.data=e,this.name=i,dt.prototype.hasOwnProperty("tree")||Object.defineProperty(dt.prototype,"tree",{get(){return Kt(this)}}),this.parser=n,this.extension=[Du.of(this),dt.languageData.of((s,a,o)=>{let u=SP(s,a,o),d=u.type.prop(vo);if(!d)return[];let h=s.facet(d),m=u.type.prop($2);if(m){let g=u.resolve(a-u.from,o);for(let x of m)if(x.test(g,s)){let v=s.facet(x.facet);return x.type=="replace"?v:v.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return SP(e,n,r).type.prop(vo)==this.data}findRegions(e){let n=e.facet(Du);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,a)=>{if(s.prop(vo)==this.data){r.push({from:a,to:a+s.length});return}let o=s.prop(Xe.mounted);if(o){if(o.tree.prop(vo)==this.data){if(o.overlay)for(let u of o.overlay)r.push({from:u.from+a,to:u.to+a});else r.push({from:a,to:a+s.length});return}else if(o.overlay){let u=r.length;if(i(o.tree,o.overlay[0].from+a),r.length>u)return}}for(let u=0;u<s.children.length;u++){let d=s.children[u];d instanceof gt&&i(d,s.positions[u]+a)}};return i(Kt(e),0),r}get allowsNesting(){return!0}}ci.setState=Zt.define();function SP(t,e,n){let r=t.facet(Du),i=Kt(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,xt.ExcludeBuffers|xt.EnterBracketed))s.type.isTop&&(i=s);return i}class Do extends ci{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=E2(e.languageData);return new Do(n,e.parser.configure({props:[vo.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new Do(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Kt(t){let e=t.field(ci.state,!1);return e?e.tree:gt.empty}class nK{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Ef=null;class Xh{constructor(e,n,r=[],i,s,a,o,u){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=a,this.skipped=o,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Xh(e,n,[],gt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new nK(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=gt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(la.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(la.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Ef;Ef=this;try{return e()}finally{Ef=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=wP(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((d,h,m,g)=>u.push({fromA:d,toA:h,fromB:m,toB:g})),r=la.applyChanges(r,u),i=gt.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);h<m&&o.push({from:h,to:m})}}}return new Xh(this.parser,n,r,i,s,a,o,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=wP(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends j2{createParse(n,r,i){let s=i[0].from,a=i[i.length-1].to;return{parsedPos:s,advance(){let u=Ef;if(u){for(let d of i)u.tempSkipped.push(d);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=a,new gt(bn.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Ef}}function wP(t,e,n){return la.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class zu{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new zu(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Xh.create(e.facet(Du).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new zu(r)}}ci.state=va.define({create:zu.init,update(t,e){for(let n of e.effects)if(n.is(ci.setState))return n.value;return e.startState.facet(Du)!=e.state.facet(Du)?zu.init(e.state):t.apply(e)}});let d4=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(d4=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const j0=typeof navigator<"u"&&(!((C0=navigator.scheduling)===null||C0===void 0)&&C0.isInputPending)?()=>navigator.scheduling.isInputPending():null,rK=El.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(ci.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(ci.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=d4(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(ci.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!j0?Math.max(25,e.timeRemaining()-5):1e9),o=s.context.treeLen<i&&r.doc.length>i+1e3,u=s.context.work(()=>j0&&j0()||Date.now()>a,i+(o?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ci.setState.of(new zu(s.context))})),this.chunkBudget>0&&!(u&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>ps(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Du=ze.define({combine(t){return t.length?t[0]:null},enables:t=>[ci.state,rK,Ae.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Lu{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class JO{constructor(e,n,r,i,s,a=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new JO(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(s=>s==n))return i;if(r)for(let i of e)for(let s of i.alias){let a=n.indexOf(s);if(a>-1&&(s.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+s.length])))return i}return null}}const iK=ze.define(),Ep=ze.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function ex(t){let e=t.facet(Ep);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function tx(t,e){let n="",r=t.tabSize,i=t.facet(Ep)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function f4(t,e){t instanceof dt&&(t=new tv(t));for(let r of t.state.facet(iK)){let i=r(t,e);if(i!==void 0)return i}let n=Kt(t.state);return n.length>=e?sK(t,n,e):null}class tv{constructor(e,n={}){this.state=e,this.options=n,this.unit=ex(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(s+=a-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return ha(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let a=s(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const dd=new Xe;function sK(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let a=i;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)r={node:s[a],next:r}}return h4(r,t,n)}function h4(t,e,n){for(let r=t;r;r=r.next){let i=lK(r.node);if(i)return i(N2.create(e,n,r))}return 0}function aK(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function lK(t){let e=t.type.prop(dd);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Xe.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return a=>p4(a,!0,1,void 0,s&&!aK(a)?i.from:void 0)}return t.parent==null?oK:null}function oK(){return 0}class N2 extends tv{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new N2(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(cK(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return h4(this.context.next,this.base,this.pos)}}function cK(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function uK(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),a=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let o=n.to;;){let u=e.childAfter(o);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=a)return null;let d=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+d}}o=u.to}}function bw({closing:t,align:e=!0,units:n=1}){return r=>p4(r,e,n,t)}function p4(t,e,n,r,i){let s=t.textAfter,a=s.match(/^\s*/)[0].length,o=r&&s.slice(a,a+r.length)==r||i==t.pos+a,u=e?uK(t):null;return u?o?t.column(u.from):t.column(u.to):t.baseIndent+(o?0:t.unit*n)}const dK=t=>t.baseIndent;function pO({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const fK=ze.define(),fd=new Xe;function T2(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}class $p{constructor(e,n){this.specs=e;let r;function i(o){let u=Ql.newName();return(r||(r=Object.create(null)))["."+u]=o,u}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof ci?o=>o.prop(vo)==a.data:a?o=>o==a:void 0,this.style=u4(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=r?new Ql(r):null,this.themeType=n.themeType}static define(e,n){return new $p(e,n||{})}}const Sw=ze.define(),hK=ze.define({combine(t){return t.length?[t[0]]:null}});function E0(t){let e=t.facet(Sw);return e.length?e:t.facet(hK)}function m4(t,e){let n=[mK],r;return t instanceof $p&&(t.module&&n.push(Ae.styleModule.of(t.module)),r=t.themeType),r?n.push(Sw.computeN([Ae.darkTheme],i=>i.facet(Ae.darkTheme)==(r=="dark")?[t]:[])):n.push(Sw.of(t)),n}class pK{constructor(e){this.markCache=Object.create(null),this.tree=Kt(e.state),this.decorations=this.buildDeco(e,E0(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Kt(e.state),r=E0(e.state),i=r!=E0(e.startState),{viewport:s}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&a>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return zt.none;let r=new Th;for(let{from:i,to:s}of e.visibleRanges)JF(this.tree,n,(a,o,u)=>{r.add(a,o,this.markCache[u]||(this.markCache[u]=zt.mark({class:u})))},i,s);return r.finish()}}const mK=wp.high(El.fromClass(pK,{decorations:t=>t.decorations})),gK=$p.define([{tag:U.meta,color:"#404740"},{tag:U.link,textDecoration:"underline"},{tag:U.heading,textDecoration:"underline",fontWeight:"bold"},{tag:U.emphasis,fontStyle:"italic"},{tag:U.strong,fontWeight:"bold"},{tag:U.strikethrough,textDecoration:"line-through"},{tag:U.keyword,color:"#708"},{tag:[U.atom,U.bool,U.url,U.contentSeparator,U.labelName],color:"#219"},{tag:[U.literal,U.inserted],color:"#164"},{tag:[U.string,U.deleted],color:"#a11"},{tag:[U.regexp,U.escape,U.special(U.string)],color:"#e40"},{tag:U.definition(U.variableName),color:"#00f"},{tag:U.local(U.variableName),color:"#30a"},{tag:[U.typeName,U.namespace],color:"#085"},{tag:U.className,color:"#167"},{tag:[U.special(U.variableName),U.macroName],color:"#256"},{tag:U.definition(U.propertyName),color:"#00c"},{tag:U.comment,color:"#940"},{tag:U.invalid,color:"#f00"}]),OK=1e4,xK="()[]{}",g4=new Xe;function ww(t,e,n){let r=t.prop(e<0?Xe.openedBy:Xe.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function kw(t){let e=t.type.prop(g4);return e?e(t.node):t}function ru(t,e,n,r={}){let i=r.maxScanDistance||OK,s=r.brackets||xK,a=Kt(t),o=a.resolveInner(e,n);for(let u=o;u;u=u.parent){let d=ww(u.type,n,s);if(d&&u.from<u.to){let h=kw(u);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return vK(t,e,n,u,h,d,s)}}return yK(t,e,n,a,o.type,i,s)}function vK(t,e,n,r,i,s,a){let o=r.parent,u={from:i.from,to:i.to},d=0,h=o==null?void 0:o.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(d==0&&s.indexOf(h.type.name)>-1&&h.from<h.to){let m=kw(h);return{start:u,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(ww(h.type,n,a))d++;else if(ww(h.type,-n,a)){if(d==0){let m=kw(h);return{start:u,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}d--}}while(n<0?h.prevSibling():h.nextSibling());return{start:u,matched:!1}}function yK(t,e,n,r,i,s,a){let o=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(o);if(u<0||u%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!h.next().done&&g<=s;){let x=h.value;n<0&&(g+=x.length);let v=e+g*n;for(let b=n>0?0:x.length-1,k=n>0?x.length:-1;b!=k;b+=n){let w=a.indexOf(x[b]);if(!(w<0||r.resolveInner(v+b,1).type!=i))if(w%2==0==n>0)m++;else{if(m==1)return{start:d,end:{from:v+b,to:v+b+1},matched:w>>1==u>>1};m--}}n>0&&(g+=x.length)}return h.done?{start:d,matched:!1}:null}const bK=Object.create(null),kP=[bn.none],QP=[],CP=Object.create(null),SK=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])SK[t]=wK(bK,e);function $0(t,e){QP.indexOf(t)>-1||(QP.push(t),console.warn(e))}function wK(t,e){let n=[];for(let o of e.split(" ")){let u=[];for(let d of o.split(".")){let h=t[d]||U[d];h?typeof h=="function"?u.length?u=u.map(h):$0(d,`Modifier ${d} used at start of tag`):u.length?$0(d,`Tag ${d} used as modifier`):u=Array.isArray(h)?h:[h]:$0(d,`Unknown highlighting tag ${d}`)}for(let d of u)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(o=>o.id),s=CP[i];if(s)return s.id;let a=CP[i]=bn.define({id:kP.length,name:r,props:[Fo({[r]:n})]});return kP.push(a),a.id}mn.RTL,mn.LTR;class kK{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Kt(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(EK(e));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function jP(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function QK(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=jP(e)+jP(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function CK(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:QK(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function jK(t,e){return n=>{for(let r=Kt(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}function EK(t,e){var n;let{source:r}=t,i=r[r.length-1]!="$";return i?new RegExp(`(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":""):t}const $K=ya.define(),NK=Ae.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class TK{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class P2{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,er.TrackDel),r=e.mapPos(this.to,1,er.TrackDel);return n==null||r==null?null:new P2(this.field,n,r)}}class _2{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(r.length){let d=a,h=/^\t*/.exec(u)[0].length;for(let m=0;m<h;m++)d+=e.facet(Ep);i.push(n+d.length-h),u=d+u.slice(h)}r.push(u),n+=u.length+1}let o=this.fieldPositions.map(u=>new P2(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:o}}static parse(e){let n=[],r=[],i=[],s;for(let a of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=s[1]?+s[1]:null,u=s[2]||s[3]||"",d=-1,h=u.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m<n.length;m++)(o!=null?n[m].seq==o:h&&n[m].name==h)&&(d=m);if(d<0){let m=0;for(;m<n.length&&(o==null||n[m].seq!=null&&n[m].seq<o);)m++;n.splice(m,0,{seq:o,name:h}),d=m;for(let g of i)g.field>=d&&g.field++}for(let m of i)if(m.line==r.length&&m.from>s.index){let g=s[2]?3+(s[1]||"").length:2;m.from-=g,m.to-=g}i.push(new TK(d,r.length,s.index,s.index+h.length)),a=a.slice(0,s.index)+u+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(o,u,d)=>{for(let h of i)h.line==r.length&&h.from>d&&(h.from--,h.to--);return u}),r.push(a)}return new _2(r,i)}}let PK=zt.widget({widget:new class extends ud{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),_K=zt.mark({class:"cm-snippetField"});class hd{constructor(e,n){this.ranges=e,this.active=n,this.deco=zt.set(e.map(r=>(r.from==r.to?PK:_K).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new hd(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Np=Zt.define({map(t,e){return t&&t.map(e)}}),AK=Zt.define(),Zh=va.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Np))return n.value;if(n.is(AK)&&t)return new hd(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ae.decorations.from(t,e=>e?e.deco:zt.none)});function A2(t,e){return me.create(t.filter(n=>n.field==e).map(n=>me.range(n.from,n.to)))}function RK(t){let e=_2.parse(t);return(n,r,i,s)=>{let{text:a,ranges:o}=e.instantiate(n.state,i),{main:u}=n.state.selection,d={changes:{from:i,to:s==u.from?u.to:s,insert:st.of(a)},scrollIntoView:!0,annotations:r?[$K.of(r),pn.userEvent.of("input.complete")]:void 0};if(o.length&&(d.selection=A2(o,0)),o.some(h=>h.field>0)){let h=new hd(o,0),m=d.effects=[Np.of(h)];n.state.field(Zh,!1)===void 0&&m.push(Zt.appendConfig.of([Zh,XK,ZK,NK]))}n.dispatch(n.state.update(d))}}function O4(t){return({state:e,dispatch:n})=>{let r=e.field(Zh,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:A2(r.ranges,i),effects:Np.of(s?null:new hd(r.ranges,i)),scrollIntoView:!0})),!0}}const MK=({state:t,dispatch:e})=>t.field(Zh,!1)?(e(t.update({effects:Np.of(null)})),!0):!1,zK=O4(1),DK=O4(-1),LK=[{key:"Tab",run:zK,shift:DK},{key:"Escape",run:MK}],EP=ze.define({combine(t){return t.length?t[0]:LK}}),XK=wp.highest(ev.compute([EP],t=>t.facet(EP)));function gr(t,e){return{...e,apply:RK(t)}}const ZK=Ae.domEventHandlers({mousedown(t,e){let n=e.state.field(Zh,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:A2(n.ranges,i.field),effects:Np.of(n.ranges.some(s=>s.field>i.field)?new hd(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),x4=new class extends kl{};x4.startSide=1;x4.endSide=-1;class nx{static create(e,n,r,i,s){let a=i+(i<<8)+e+(n<<4)|0;return new nx(e,n,r,a,s,[],[])}constructor(e,n,r,i,s,a,o){this.type=e,this.value=n,this.from=r,this.hash=i,this.end=s,this.children=a,this.positions=o,this.hashProp=[[Xe.contextHash,i]]}addChild(e,n){e.prop(Xe.contextHash)!=this.hash&&(e=new gt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new gt(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,s,a)=>new gt(bn.none,i,s,a,this.hashProp)})}}var xe;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(xe||(xe={}));class IK{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class BK{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return dh(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,r=0){for(let i=n;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function $P(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(t.type==xe.OrderedList?z2:M2)(n,e,!1);return r>0&&(t.type!=xe.BulletList||R2(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const v4={[xe.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(it(xe.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(vi(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[xe.ListItem](t,e,n){return n.indent<n.baseIndent+t.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[xe.OrderedList]:$P,[xe.BulletList]:$P,[xe.Document](){return!0}};function vi(t){return t==32||t==9||t==10||t==13}function dh(t,e=0){for(;e<t.length&&vi(t.charCodeAt(e));)e++;return e}function NP(t,e,n){for(;e>n&&vi(t.charCodeAt(e-1));)e--;return e}function y4(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function b4(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function R2(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let i=t.pos+1;i<t.text.length;i++){let s=t.text.charCodeAt(i);if(s==t.next)r++;else if(!vi(s))return-1}return n&&t.next==45&&k4(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(E4.SetextHeading)>-1||r<3?-1:1}function S4(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function M2(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||vi(t.text.charCodeAt(t.pos+1)))&&(!n||S4(e,xe.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function z2(t,e,n){let r=t.pos,i=t.next;for(;i>=48&&i<=57;){r++;if(r==t.text.length)return-1;i=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||i!=46&&i!=41||r<t.text.length-1&&!vi(t.text.charCodeAt(r+1))||n&&!S4(e,xe.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.pos+1||t.next!=49)?-1:r+1-t.pos}function w4(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-1:n}function k4(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&vi(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const Qw=/^[ \t]*$/,Q4=/-->/,C4=/\?>/,Cw=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Q4],[/^\s*<\?/,C4],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Qw],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Qw]];function j4(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let i=0,s=Cw.length-(n?1:0);i<s;i++)if(Cw[i][0].test(r))return i;return-1}function TP(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.countIndent(t.skipSpace(e),e,n);return r>=n+5?n+1:r}function el(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==xe.CodeText?t[r].to=n:t.push(it(xe.CodeText,e,n))}const Zg={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),i=t.lineStart+r,s=t.lineStart+e.text.length,a=[],o=[];for(el(a,i,s);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){el(o,t.lineStart-1,t.lineStart);for(let u of e.markers)o.push(u)}else{if(e.indent<n)break;{if(o.length){for(let d of o)d.type==xe.CodeText?el(a,d.from,d.to):a.push(d);o=[]}el(a,t.lineStart-1,t.lineStart);for(let d of e.markers)a.push(d);s=t.lineStart+e.text.length;let u=t.lineStart+e.findColumn(e.baseIndent+4);u<s&&el(a,u,s)}}return o.length&&(o=o.filter(u=>u.type!=xe.CodeText),o.length&&(e.markers=o.concat(e.markers))),t.addNode(t.buffer.writeElements(a,-i).finish(xe.CodeBlock,s-i),i),!0},FencedCode(t,e){let n=y4(e);if(n<0)return!1;let r=t.lineStart+e.pos,i=e.next,s=n-e.pos,a=e.skipSpace(n),o=NP(e.text,e.text.length,a),u=[it(xe.CodeMark,r,r+s)];a<o&&u.push(it(xe.CodeInfo,t.lineStart+a,t.lineStart+o));for(let d=!0,h=!0,m=!1;t.nextLine()&&e.depth>=t.stack.length;d=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==i;)g++;if(g-e.pos>=s&&e.skipSpace(g)==e.text.length){for(let x of e.markers)u.push(x);h&&m&&el(u,t.lineStart-1,t.lineStart),u.push(it(xe.CodeMark,t.lineStart+e.pos,t.lineStart+g)),t.nextLine();break}else{m=!0,d||(el(u,t.lineStart-1,t.lineStart),h=!1);for(let b of e.markers)u.push(b);let x=t.lineStart+e.basePos,v=t.lineStart+e.text.length;x<v&&(el(u,x,v),h=!1)}}return t.addNode(t.buffer.writeElements(u,-r).finish(xe.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=b4(e);return n<0?!1:(t.startContext(xe.Blockquote,e.pos),t.addNode(xe.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(R2(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(xe.HorizontalRule,n),!0},BulletList(t,e){let n=M2(e,t,!1);if(n<0)return!1;t.block.type!=xe.BulletList&&t.startContext(xe.BulletList,e.basePos,e.next);let r=TP(e,e.pos+1);return t.startContext(xe.ListItem,e.basePos,r-e.baseIndent),t.addNode(xe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=z2(e,t,!1);if(n<0)return!1;t.block.type!=xe.OrderedList&&t.startContext(xe.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=TP(e,e.pos+n);return t.startContext(xe.ListItem,e.basePos,r-e.baseIndent),t.addNode(xe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=w4(e);if(n<0)return!1;let r=e.pos,i=t.lineStart+r,s=NP(e.text,e.text.length,r),a=s;for(;a>r&&e.text.charCodeAt(a-1)==e.next;)a--;(a==s||a==r||!vi(e.text.charCodeAt(a-1)))&&(a=e.text.length);let o=t.buffer.write(xe.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,a),i+n+1),-i);a<e.text.length&&o.write(xe.HeaderMark,a-r,s-r);let u=o.finish(xe.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(u,i),!0},HTMLBlock(t,e){let n=j4(e,t,!1);if(n<0)return!1;let r=t.lineStart+e.pos,i=Cw[n][1],s=[],a=i!=Qw;for(;!i.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){a=!1;break}for(let d of e.markers)s.push(d)}a&&t.nextLine();let o=i==Q4?xe.CommentBlock:i==C4?xe.ProcessingInstructionBlock:xe.HTMLBlock,u=t.prevLineEnd();return t.addNode(t.buffer.writeElements(s,-r).finish(o,u-r),r),!0},SetextHeading:void 0};class qK{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let i=r.content+`
393
+ `+n.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,n){return(this.stage==2||this.stage==3)&&dh(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,it(xe.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(z4(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(it(xe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(R4(e,dh(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=dh(e,this.pos),r=0;if(n>this.pos){let i=M4(e,n,this.start);if(i){let s=N0(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=N0(e,this.pos)),r>0&&r<e.length?r:-1}else return N0(e,this.pos)}}}function N0(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!vi(n))return-1}return e}class VK{nextLine(e,n,r){let i=n.depth<e.stack.length?-1:k4(n),s=n.next;if(i<0)return!1;let a=it(xe.HeaderMark,e.lineStart+n.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,it(s==61?xe.SetextHeading1:xe.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),a])),!0}finish(){return!1}}const E4={LinkReference(t,e){return e.content.charCodeAt(0)==91?new qK(e):null},SetextHeading(){return new VK}},YK=[(t,e)=>w4(e)>=0,(t,e)=>y4(e)>=0,(t,e)=>b4(e)>=0,(t,e)=>M2(e,t,!0)>=0,(t,e)=>z2(e,t,!0)>=0,(t,e)=>R2(e,t,!0)>=0,(t,e)=>j4(e,t,!0)>=0],UK={text:"",end:0};class WK{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.line=new BK,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=nx.create(xe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new FK(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let n=new IK(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
394
+ `+e.scrub();for(let r of e.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=D4(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=UK;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let s=this.ranges[i].from,a=this.lineChunkAt(s);n.end=s+a.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+a,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+xe[i.type]);let a=this.line.markers.length;if(!s(i,this,e)){this.line.markers.length>a&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
395
+ `?"":n;else{let i=n.indexOf(`
396
+ `);r=i<0?n:n.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=nx.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new gt(this.parser.nodeSet.types[e],Xu,Xu,(r??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(Ew(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?$4(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=Ew(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(xe.Paragraph,e.content.length),e.start)}elt(e,n,r,i){return typeof e=="string"?it(this.parser.getNodeType(e),n,r,i):new P4(e,n)}get buffer(){return new T4(this.parser.nodeSet)}}function $4(t,e,n,r,i){let s=t[e].to,a=[],o=[],u=n.from+r;function d(h,m){for(;m?h>=s:h>s;){let g=t[e+1].from-s;r+=g,h+=g,e++,s=t[e].to}}for(let h=n.firstChild;h;h=h.nextSibling){d(h.from+r,!0);let m=h.from+r,g,x=i.get(h.tree);x?g=x:h.to+r>s?(g=$4(t,e,h,r,i),d(h.to+r,!1)):g=h.toTree(),a.push(g),o.push(m-u)}return d(n.to+r,!1),new gt(n.type,a,o,n.to+r-u,n.tree?n.tree.propValues:void 0)}class nv extends j2{constructor(e,n,r,i,s,a,o,u,d){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=s,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=u,this.wrappers=d,this.nodeTypes=Object.create(null);for(let h of e.types)this.nodeTypes[h.name]=h.id}createParse(e,n,r){let i=new WK(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}configure(e){let n=jw(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,s=this.blockParsers.slice(),a=this.leafBlockParsers.slice(),o=this.blockNames.slice(),u=this.inlineParsers.slice(),d=this.inlineNames.slice(),h=this.endLeafBlock.slice(),m=this.wrappers;if($f(n.defineNodes)){i=Object.assign({},i);let g=r.types.slice(),x;for(let v of n.defineNodes){let{name:b,block:k,composite:w,style:j}=typeof v=="string"?{name:v}:v;if(g.some(R=>R.name==b))continue;w&&(i[g.length]=(R,T,A)=>w(T,A,R.value));let Q=g.length,E=w?["Block","BlockContext"]:k?Q>=xe.ATXHeading1&&Q<=xe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(bn.define({id:Q,name:b,props:E&&[[Xe.group,E]]})),j&&(x||(x={}),Array.isArray(j)||j instanceof ls?x[b]=j:Object.assign(x,j))}r=new jp(g),x&&(r=r.extend(Fo(x)))}if($f(n.props)&&(r=r.extend(...n.props)),$f(n.remove))for(let g of n.remove){let x=this.blockNames.indexOf(g),v=this.inlineNames.indexOf(g);x>-1&&(s[x]=a[x]=void 0),v>-1&&(u[v]=void 0)}if($f(n.parseBlock))for(let g of n.parseBlock){let x=o.indexOf(g.name);if(x>-1)s[x]=g.parse,a[x]=g.leaf;else{let v=g.before?Ig(o,g.before):g.after?Ig(o,g.after)+1:o.length-1;s.splice(v,0,g.parse),a.splice(v,0,g.leaf),o.splice(v,0,g.name)}g.endLeaf&&h.push(g.endLeaf)}if($f(n.parseInline))for(let g of n.parseInline){let x=d.indexOf(g.name);if(x>-1)u[x]=g.parse;else{let v=g.before?Ig(d,g.before):g.after?Ig(d,g.after)+1:d.length-1;u.splice(v,0,g.parse),d.splice(v,0,g.name)}}return n.wrap&&(m=m.concat(n.wrap)),new nv(r,s,a,o,h,i,u,d,m)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let r=new D2(this,e,n);e:for(let i=n;i<r.end;){let s=r.char(i);for(let a of this.inlineParsers)if(a){let o=a(r,s,i);if(o>=0){i=o;continue e}}i++}return r.resolveMarkers(0)}}function $f(t){return t!=null&&t.length>0}function jw(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=jw(t[0]);if(t.length==1)return e;let n=jw(t.slice(1));if(!n||!e)return e||n;let r=(a,o)=>(a||Xu).concat(o||Xu),i=e.wrap,s=n.wrap;return{props:r(e.props,n.props),defineNodes:r(e.defineNodes,n.defineNodes),parseBlock:r(e.parseBlock,n.parseBlock),parseInline:r(e.parseInline,n.parseInline),remove:r(e.remove,n.remove),wrap:i?s?(a,o,u,d)=>i(s(a,o,u,d),o,u,d):i:s}}function Ig(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let N4=[bn.none];for(let t=1,e;e=xe[t];t++)N4[t]=bn.define({id:t,name:e,props:t>=xe.Escape?[]:[[Xe.group,t in v4?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Xu=[];class T4{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,r,i=0){return this.content.push(e,n,r,4+i*4),this}writeElements(e,n=0){for(let r of e)r.writeTo(this,n);return this}finish(e,n){return gt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}}let Ih=class{constructor(e,n,r,i=Xu){this.type=e,this.from=n,this.to=r,this.children=i}writeTo(e,n){let r=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-r)}toTree(e){return new T4(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class P4{constructor(e,n){this.tree=e,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Xu}writeTo(e,n){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function it(t,e,n,r){return new Ih(t,e,n,r)}const _4={resolve:"Emphasis",mark:"EmphasisMark"},A4={resolve:"Emphasis",mark:"EmphasisMark"},fo={},rx={};class Xr{constructor(e,n,r,i){this.type=e,this.from=n,this.to=r,this.side=i}}const PP="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Bh=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Bh=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const T0={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let r=t.char(n+1);for(let i=0;i<PP.length;i++)if(PP.charCodeAt(i)==r)return t.append(it(xe.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return r?t.append(it(xe.Entity,n,n+1+r[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let r=n+1;for(;r<t.end&&t.char(r)==96;)r++;let i=r-n,s=0;for(;r<t.end;r++)if(t.char(r)==96){if(s++,s==i&&t.char(r+1)!=96)return t.append(it(xe.InlineCode,n,r+1,[it(xe.CodeMark,n,n+i),it(xe.CodeMark,r+1-i,r+1)]))}else s=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let r=t.slice(n+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return t.append(it(xe.Autolink,n,n+1+i[0].length,[it(xe.LinkMark,n,n+1),it(xe.URL,n+1,n+i[0].length),it(xe.LinkMark,n+i[0].length,n+1+i[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(s)return t.append(it(xe.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(r);if(a)return t.append(it(xe.ProcessingInstruction,n,n+1+a[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return o?t.append(it(xe.HTMLTag,n,n+1+o[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let r=n+1;for(;t.char(r)==e;)r++;let i=t.slice(n-1,n),s=t.slice(r,r+1),a=Bh.test(i),o=Bh.test(s),u=/\s|^$/.test(i),d=/\s|^$/.test(s),h=!d&&(!o||u||a),m=!u&&(!a||d||o),g=h&&(e==42||!m||a),x=m&&(e==42||!h||o);return t.append(new Xr(e==95?_4:A4,n,r,(g?1:0)|(x?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(it(xe.HardBreak,n,n+2));if(e==32){let r=n+1;for(;t.char(r)==32;)r++;if(t.char(r)==10&&r>=n+2)return t.append(it(xe.HardBreak,n,r+1))}return-1},Link(t,e,n){return e==91?t.append(new Xr(fo,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new Xr(rx,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let r=t.parts.length-1;r>=0;r--){let i=t.parts[r];if(i instanceof Xr&&(i.type==fo||i.type==rx)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[r]=null,-1;let s=t.takeContent(r),a=t.parts[r]=HK(t,s,i.type==fo?xe.Link:xe.Image,i.from,n+1);if(i.type==fo)for(let o=0;o<r;o++){let u=t.parts[o];u instanceof Xr&&u.type==fo&&(u.side=0)}return a.to}}return-1}};function HK(t,e,n,r,i){let{text:s}=t,a=t.char(i),o=i;if(e.unshift(it(xe.LinkMark,r,r+(n==xe.Image?2:1))),e.push(it(xe.LinkMark,i-1,i)),a==40){let u=t.skipSpace(i+1),d=R4(s,u-t.offset,t.offset),h;d&&(u=t.skipSpace(d.to),u!=d.to&&(h=M4(s,u-t.offset,t.offset),h&&(u=t.skipSpace(h.to)))),t.char(u)==41&&(e.push(it(xe.LinkMark,i,i+1)),o=u+1,d&&e.push(d),h&&e.push(h),e.push(it(xe.LinkMark,u,o)))}else if(a==91){let u=z4(s,i-t.offset,t.offset,!1);u&&(e.push(u),o=u.to)}return it(n,r,o,e)}function R4(t,e,n){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let s=t.charCodeAt(i);if(s==62)return it(xe.URL,e+n,i+1+n);if(s==60||s==10)return!1}return null}else{let i=0,s=e;for(let a=!1;s<t.length;s++){let o=t.charCodeAt(s);if(vi(o))break;if(a)a=!1;else if(o==40)i++;else if(o==41){if(!i)break;i--}else o==92&&(a=!0)}return s>e?it(xe.URL,e+n,s+n):s==t.length?null:!1}}function M4(t,e,n){let r=t.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let s=e+1,a=!1;s<t.length;s++){let o=t.charCodeAt(s);if(a)a=!1;else{if(o==i)return it(xe.LinkTitle,e+n,s+1+n);o==92&&(a=!0)}}return null}function z4(t,e,n,r){for(let i=!1,s=e+1,a=Math.min(t.length,s+999);s<a;s++){let o=t.charCodeAt(s);if(i)i=!1;else{if(o==93)return r?!1:it(xe.LinkLabel,e+n,s+1+n);if(r&&!vi(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}class D2{constructor(e,n,r){this.parser=e,this.text=n,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,n){return this.text.slice(e-this.offset,n-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,n,r,i,s){return this.append(new Xr(e,n,r,(i?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let n=this.parts[e];if(n instanceof Xr&&(n.type==fo||n.type==rx))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof Xr&&i.type.resolve&&i.side&2))continue;let s=i.type==_4||i.type==A4,a=i.to-i.from,o,u=r-1;for(;u>=e;u--){let b=this.parts[u];if(b instanceof Xr&&b.side&1&&b.type==i.type&&!(s&&(i.side&1||b.side&2)&&(b.to-b.from+a)%3==0&&((b.to-b.from)%3||a%3))){o=b;break}}if(!o)continue;let d=i.type.resolve,h=[],m=o.from,g=i.to;if(s){let b=Math.min(2,o.to-o.from,a);m=o.to-b,g=i.from+b,d=b==1?"Emphasis":"StrongEmphasis"}o.type.mark&&h.push(this.elt(o.type.mark,m,o.to));for(let b=u+1;b<r;b++)this.parts[b]instanceof Ih&&h.push(this.parts[b]),this.parts[b]=null;i.type.mark&&h.push(this.elt(i.type.mark,i.from,g));let x=this.elt(d,m,g,h);this.parts[u]=s&&o.from!=m?new Xr(o.type,o.from,m,o.side):null,(this.parts[r]=s&&i.to!=g?new Xr(i.type,g,i.to,i.side):null)?this.parts.splice(r,0,x):this.parts[r]=x}let n=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof Ih&&n.push(i)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=0;n--){let r=this.parts[n];if(r instanceof Xr&&r.type==e&&r.side&1)return n}return null}takeContent(e){let n=this.resolveMarkers(e);return this.parts.length=e,n}getDelimiterAt(e){let n=this.parts[e];return n instanceof Xr?n:null}skipSpace(e){return dh(this.text,e-this.offset)+this.offset}elt(e,n,r,i){return typeof e=="string"?it(this.parser.getNodeType(e),n,r,i):new P4(e,n)}}D2.linkStart=fo;D2.imageStart=rx;function Ew(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),r=0;for(let i of e){for(;r<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let s=n[r];s instanceof Ih&&(n[r]=new Ih(s.type,s.from,s.to,Ew(s.children,[i])))}else n.splice(r++,0,i)}return n}const GK=[xe.CodeBlock,xe.ListItem,xe.OrderedList,xe.BulletList];let FK=class{constructor(e,n){this.fragments=e,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,n){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
397
+ `;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(Xe.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,a=s,o=e.block.children.length,u=a,d=o;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let h=D4(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,h);else{let m=new gt(e.parser.nodeSet.types[xe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(m,n.tree),e.addNode(m,h)}if(n.type.is("Block")&&(GK.indexOf(n.type.id)<0?(a=n.to-r,o=e.block.children.length):(a=u,o=d),u=n.to-r,d=e.block.children.length),!n.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-s}};function D4(t,e){let n=t;for(let r=1;r<e.length;r++){let i=e[r-1].to,s=e[r].from;i<t&&(n-=s-i)}return n}const KK=Fo({"Blockquote/...":U.quote,HorizontalRule:U.contentSeparator,"ATXHeading1/... SetextHeading1/...":U.heading1,"ATXHeading2/... SetextHeading2/...":U.heading2,"ATXHeading3/...":U.heading3,"ATXHeading4/...":U.heading4,"ATXHeading5/...":U.heading5,"ATXHeading6/...":U.heading6,"Comment CommentBlock":U.comment,Escape:U.escape,Entity:U.character,"Emphasis/...":U.emphasis,"StrongEmphasis/...":U.strong,"Link/... Image/...":U.link,"OrderedList/... BulletList/...":U.list,"BlockQuote/...":U.quote,"InlineCode CodeText":U.monospace,"URL Autolink":U.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":U.processingInstruction,"CodeInfo LinkLabel":U.labelName,LinkTitle:U.string,Paragraph:U.content}),JK=new nv(new jp(N4).extend(KK),Object.keys(Zg).map(t=>Zg[t]),Object.keys(Zg).map(t=>E4[t]),Object.keys(Zg),YK,v4,Object.keys(T0).map(t=>T0[t]),Object.keys(T0),[]);function eJ(t,e,n){let r=[];for(let i=t.firstChild,s=e;;i=i.nextSibling){let a=i?i.from:n;if(a>s&&r.push({from:s,to:a}),!i)break;s=i.to}return r}function tJ(t){let{codeParser:e,htmlParser:n}=t;return{wrap:l4((i,s)=>{let a=i.type.id;if(e&&(a==xe.CodeBlock||a==xe.FencedCode)){let o="";if(a==xe.FencedCode){let d=i.node.getChild(xe.CodeInfo);d&&(o=s.read(d.from,d.to))}let u=e(o);if(u)return{parser:u,overlay:d=>d.type.id==xe.CodeText,bracketed:a==xe.FencedCode}}else if(n&&(a==xe.HTMLBlock||a==xe.HTMLTag||a==xe.CommentBlock))return{parser:n,overlay:eJ(i.node,i.from,i.to)};return null})}}const nJ={resolve:"Strikethrough",mark:"StrikethroughMark"},rJ={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":U.strikethrough}},{name:"StrikethroughMark",style:U.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let r=t.slice(n-1,n),i=t.slice(n+2,n+3),s=/\s|^$/.test(r),a=/\s|^$/.test(i),o=Bh.test(r),u=Bh.test(i);return t.addDelimiter(nJ,n,n+2,!a&&(!u||s||o),!s&&(!o||a||u))},after:"Emphasis"}]};function fh(t,e,n=0,r,i=0){let s=0,a=!0,o=-1,u=-1,d=!1,h=()=>{r.push(t.elt("TableCell",i+o,i+u,t.parser.parseInline(e.slice(o,u),i+o)))};for(let m=n;m<e.length;m++){let g=e.charCodeAt(m);g==124&&!d?((!a||o>-1)&&s++,a=!1,r&&(o>-1&&h(),r.push(t.elt("TableDelimiter",m+i,m+i+1))),o=u=-1):(d||g!=32&&g!=9)&&(o<0&&(o=m),u=m+1),d=!d&&g==92}return o>-1&&(s++,r&&h()),s}function _P(t,e){for(let n=e;n<t.length;n++){let r=t.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const L4=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class AP{constructor(){this.rows=null}nextLine(e,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&L4.test(i=n.text.slice(n.pos))){let s=[];fh(e,r.content,0,s,r.start)==fh(e,i,n.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let i=[];fh(e,n.text,n.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,i))}return!1}finish(e,n){return this.rows?(e.addLeafElement(n,e.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const iJ={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":U.heading}},"TableRow",{name:"TableCell",style:U.content},{name:"TableDelimiter",style:U.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return _P(e.content,0)?new AP:null},endLeaf(t,e,n){if(n.parsers.some(i=>i instanceof AP)||!_P(e.text,e.basePos))return!1;let r=t.peekLine();return L4.test(r)&&fh(t,e.text,e.basePos)==fh(t,r,e.basePos)},before:"SetextHeading"}]};class sJ{nextLine(){return!1}finish(e,n){return e.addLeafElement(n,e.elt("Task",n.start,n.start+n.content.length,[e.elt("TaskMarker",n.start,n.start+3),...e.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const aJ={defineNodes:[{name:"Task",block:!0,style:U.list},{name:"TaskMarker",style:U.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new sJ:null},after:"SetextHeading"}]},RP=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,MP=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,lJ=/[\w-]+\.[\w-]+($|\/)/,zP=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,DP=/\/[a-zA-Z\d@.]+/gy;function LP(t,e,n,r){let i=0;for(let s=e;s<n;s++)t[s]==r&&i++;return i}function oJ(t,e){MP.lastIndex=e;let n=MP.exec(t);if(!n||lJ.exec(n[0])[0].indexOf("_")>-1)return-1;let r=e+n[0].length;for(;;){let i=t[r-1],s;if(/[?!.,:*_~]/.test(i)||i==")"&&LP(t,e,r,")")>LP(t,e,r,"("))r--;else if(i==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,r))))r=e+s.index;else break}return r}function XP(t,e){zP.lastIndex=e;let n=zP.exec(t);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:e+n[0].length-(r=="."?1:0)}const cJ={parseInline:[{name:"Autolink",parse(t,e,n){let r=n-t.offset;if(r&&/\w/.test(t.text[r-1]))return-1;RP.lastIndex=r;let i=RP.exec(t.text),s=-1;if(!i)return-1;if(i[1]||i[2]){if(s=oJ(t.text,r+i[0].length),s>-1&&t.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(r,s));s=r+a[0].length}}else i[3]?s=XP(t.text,r):(s=XP(t.text,r+i[0].length),s>-1&&i[0]=="xmpp:"&&(DP.lastIndex=s,i=DP.exec(t.text),i&&(s=i.index+i[0].length)));return s<0?-1:(t.addElement(t.elt("URL",n,s+t.offset)),s+t.offset)}}]},uJ=[iJ,aJ,rJ,cJ];function X4(t,e,n){return(r,i,s)=>{if(i!=t||r.char(s+1)==t)return-1;let a=[r.elt(n,s,s+1)];for(let o=s+1;o<r.end;o++){let u=r.char(o);if(u==t)return r.addElement(r.elt(e,s,o+1,a.concat(r.elt(n,o,o+1))));if(u==92&&a.push(r.elt("Escape",o,o+++2)),vi(u))break}return-1}}const dJ={defineNodes:[{name:"Superscript",style:U.special(U.content)},{name:"SuperscriptMark",style:U.processingInstruction}],parseInline:[{name:"Superscript",parse:X4(94,"Superscript","SuperscriptMark")}]},fJ={defineNodes:[{name:"Subscript",style:U.special(U.content)},{name:"SubscriptMark",style:U.processingInstruction}],parseInline:[{name:"Subscript",parse:X4(126,"Subscript","SubscriptMark")}]},hJ={defineNodes:[{name:"Emoji",style:U.character}],parseInline:[{name:"Emoji",parse(t,e,n){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+r[0].length))}}]};var ZP={};class ix{constructor(e,n,r,i,s,a,o,u,d,h=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=a,this.buffer=o,this.bufferBase=u,this.curContext=d,this.lookAhead=h,this.parent=m}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new ix(e,[],n,r,r,0,[],0,i?new IP(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),o=s.dynamicPrecedence(i);if(o&&(this.score+=o),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(i,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),d=u?this.stack[u-2]:this.p.ranges[0].from,h=this.reducePos-d;h>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=h));let m=u?this.stack[u-1]:0,g=this.bufferBase+this.buffer.length-m;if(i<s.minRepeatTerm||e&131072){let x=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,d,x,g+4,!0)}if(e&262144)this.state=this.stack[u];else{let x=this.stack[u-3];this.state=s.getGoto(x,i,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(i,d)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,o=this.buffer.length;if(o==0&&a.parent&&(o=a.bufferBase-a.parent.bufferBase,a=a.parent),o>0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(n==r)return;if(a.buffer[o-2]>=n){a.buffer[o-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let o=!1;for(let u=a;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){o=!0;break}if(o)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:a}=this.p;this.pos=i;let o=a.stateFlag(s,1);!o&&(i>r||n<=a.maxNode)&&(this.reducePos=i),this.pushState(s,o?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new ix(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new pJ(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,a;s<n.length;s+=2)(a=n[s+1])!=this.state&&this.p.parser.hasAction(a,e)&&i.push(n[s],a);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let a=n[s+1];i.some((o,u)=>u&1&&o==a)||i.push(n[s],a)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+1];if(s==this.state)continue;let a=this.split();a.pushState(s,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(n[i],this.pos),a.reducePos=this.pos,a.score-=200,r.push(a)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let o=(a>>19)-s;if(o>1){let u=a&65535,d=this.stack.length-o*3;if(d>=0&&e.getGoto(this.stack[d],u,!1)>=0)return o<<19|65536|u}}else{let o=r(a,s+1);if(o!=null)return o}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new IP(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class IP{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class pJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class sx{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new sx(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new sx(this.stack,this.pos,this.index)}}function Zf(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let s=0;for(;;){let a=t.charCodeAt(r++),o=!1;if(a==126){s=65535;break}a>=92&&a--,a>=34&&a--;let u=a-32;if(u>=46&&(u-=46,o=!0),s+=u,o)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class mO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const BP=new mO;class mJ{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=BP,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let a=this.ranges[--i];s-=r.from-a.to,r=a}for(;n<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];s+=a.from-r.to,r=a}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let a=this.rangeIndex,o=this.range;for(;o.to<=r;)o=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=BP,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class pu{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Z4(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}pu.prototype.contextual=pu.prototype.fallback=pu.prototype.extend=!1;class ax{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Zf(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,a=e.resolveOffset(1,1);if(Z4(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,a==null)break;e.reset(a,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}ax.prototype.contextual=pu.prototype.fallback=pu.prototype.extend=!1;class Dn{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Z4(t,e,n,r,i,s){let a=0,o=1<<r,{dialect:u}=n.p.parser;e:for(;(o&t[a])!=0;){let d=t[a+1];for(let x=a+3;x<d;x+=2)if((t[x+1]&o)>0){let v=t[x];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||gJ(v,e.token.value,i,s))){e.acceptToken(v);break}}let h=e.next,m=0,g=t[a+2];if(e.next<0&&g>m&&t[d+g*3-3]==65535){a=t[d+g*3-1];continue e}for(;m<g;){let x=m+g>>1,v=d+x+(x<<1),b=t[v],k=t[v+1]||65536;if(h<b)g=x;else if(h>=k)m=x+1;else{a=t[v+2],e.advance();continue e}}break}}function qP(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function gJ(t,e,n,r){let i=qP(n,r,e);return i<0||qP(n,r,t)<i}const Mr=typeof process<"u"&&ZP&&/\bparse\b/.test(ZP.LOG);let P0=null;function VP(t,e,n){let r=t.cursor(xt.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class OJ{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?VP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?VP(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],a=this.start[n]+r.positions[i];if(a>e)return this.nextStart=a,null;if(s instanceof gt){if(a==e){if(a<this.safeFrom)return null;let o=a+s.length;if(o<=this.safeTo){let u=s.prop(Xe.lookAhead);if(!u||o+u<this.fragment.to)return s}}this.index[n]++,a+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}}class xJ{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new mO)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,a=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,u=0;for(let d=0;d<s.length;d++){if((1<<d&a)==0)continue;let h=s[d],m=this.tokens[d];if(!(r&&!h.fallback)&&((h.contextual||m.start!=e.pos||m.mask!=a||m.context!=o)&&(this.updateCachedToken(m,h,e),m.mask=a,m.context=o),m.lookAhead>m.end+25&&(u=Math.max(m.lookAhead,u)),m.value!=0)){let g=n;if(m.extended>-1&&(n=this.addActions(e,m.extended,m.end,n)),n=this.addActions(e,m.value,m.end,n),!h.extend&&(r=m,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new mO,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new mO,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let a=0;a<s.specialized.length;a++)if(s.specialized[a]==e.value){let o=s.specializers[a](this.stream.read(e.start,e.end),r);if(o>=0&&r.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:a}=e.p,{data:o}=a;for(let u=0;u<2;u++)for(let d=a.stateSlot(s,u?2:1);;d+=3){if(o[d]==65535)if(o[d+1]==1)d=Fs(o,d+2);else{i==0&&o[d+1]==2&&(i=this.putAction(Fs(o,d+2),n,r,i));break}o[d]==n&&(i=this.putAction(Fs(o,d+1),n,r,i))}return i}}class vJ{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new mJ(n,i),this.tokens=new xJ(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[ix.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new OJ(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>n)r.push(o);else{if(this.advanceStack(o,r,e))continue;{i||(i=[],s=[]),i.push(o);let u=this.tokens.getMainToken(o);s.push(u.value,u.end)}}break}}if(!r.length){let a=i&&bJ(i);if(a)return Mr&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Mr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(a)return Mr&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((o,u)=>u.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a<r.length-1;a++){let o=r[a];for(let u=a+1;u<r.length;u++){let d=r[u];if(o.sameState(d)||o.buffer.length>500&&d.buffer.length>500)if((o.score-d.score||o.buffer.length-d.buffer.length)>0)r.splice(u--,1);else{r.splice(a--,1);continue e}}}r.length>12&&(r.sort((a,o)=>o.score-a.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let a=1;a<r.length;a++)r[a].pos<this.minStackPos&&(this.minStackPos=r[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:s}=this,a=Mr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,h=d?e.curContext.hash:0;for(let m=this.fragments.nodeAt(i);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?s.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!d||(m.prop(Xe.contextHash)||0)==h))return e.useNode(m,g),Mr&&console.log(a+this.stackID(e)+` (via reuse of ${s.getName(m.type.id)})`),!0;if(!(m instanceof gt)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof gt&&m.positions[0]==0)m=x;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),Mr&&console.log(a+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let d=0;d<u.length;){let h=u[d++],m=u[d++],g=u[d++],x=d==u.length||!r,v=x?e:e.split(),b=this.tokens.mainToken;if(v.apply(h,m,b?b.start:v.pos,g),Mr&&console.log(a+this.stackID(v)+` (via ${(h&65536)==0?"shift":`reduce of ${s.getName(h&65535)}`} for ${s.getName(m)} @ ${i}${v==e?"":", split"})`),x)return!0;v.pos>i?n.push(v):r.push(v)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return YP(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let a=0;a<e.length;a++){let o=e[a],u=n[a<<1],d=n[(a<<1)+1],h=Mr?this.stackID(o)+" -> ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),Mr&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let m=o.split(),g=h;for(let x=0;x<10&&m.forceReduce()&&(Mr&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)Mr&&(g=this.stackID(m)+" -> ");for(let x of o.recoverByInsert(u))Mr&&console.log(h+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>o.pos?(d==o.pos&&(d++,u=0),o.recoverByDelete(u,d),Mr&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(u)})`),YP(o,r)):(!i||i.score<m.score)&&(i=m)}return i}stackToTree(e){return e.close(),gt.build({buffer:sx.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(P0||(P0=new WeakMap)).get(e);return n||P0.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function YP(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class yJ{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const _0=t=>t;class L2{constructor(e){this.start=e.start,this.shift=e.shift||_0,this.reduce=e.reduce||_0,this.reuse=e.reuse||_0,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Lo extends j2{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let o=0;o<e.repeatNodeCount;o++)n.push("");let r=Object.keys(e.topRules).map(o=>e.topRules[o][1]),i=[];for(let o=0;o<n.length;o++)i.push([]);function s(o,u,d){i[o].push([u,u.deserialize(String(d))])}if(e.nodeProps)for(let o of e.nodeProps){let u=o[0];typeof u=="string"&&(u=Xe[u]);for(let d=1;d<o.length;){let h=o[d++];if(h>=0)s(h,u,o[d++]);else{let m=o[d+-h];for(let g=-h;g>0;g--)s(o[d++],u,m);d++}}}this.nodeSet=new jp(n.map((o,u)=>bn.define({name:u>=this.minRepeatTerm?void 0:o,id:u,props:i[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=n4;let a=Zf(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(UP),this.states=Zf(e.states,Uint32Array),this.data=Zf(e.stateData),this.goto=Zf(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new pu(a,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new vJ(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let a=i[s++],o=a&1,u=i[s++];if(o&&r)return u;for(let d=s+(a>>1);s<d;s++)if(i[s]==e)return u;if(o)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),a;;s+=3){if((a=r[s])==65535)if(r[s+1]==1)a=r[s=Fs(r,s+2)];else{if(r[s+1]==2)return Fs(r,s+2);break}if(a==n||a==0)return Fs(r,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Fs(this.data,s+2);else break;i=n(Fs(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Fs(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,a)=>a&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Lo.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(o=>o.from==r.external);if(!s)return r;let a=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=UP(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let a=n.indexOf(s);a>=0&&(r[a]=!0)}let i=null;for(let s=0;s<n.length;s++)if(!r[s])for(let a=this.dialects[n[s]],o;(o=this.data[a++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[o]=1;return new yJ(e,r,i)}static deserialize(e){return new Lo(e)}}function Fs(t,e){return t[e]|t[e+1]<<16}function bJ(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function UP(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const SJ=55,wJ=1,kJ=56,QJ=2,CJ=57,jJ=3,WP=4,EJ=5,X2=6,I4=7,B4=8,q4=9,V4=10,$J=11,NJ=12,TJ=13,A0=58,PJ=14,_J=15,HP=59,Y4=21,AJ=23,U4=24,RJ=25,$w=27,W4=28,MJ=29,zJ=32,DJ=35,LJ=37,XJ=38,ZJ=0,IJ=1,BJ={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},qJ={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},GP={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function VJ(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let FP=null,KP=null,JP=0;function Nw(t,e){let n=t.pos+e;if(JP==n&&KP==t)return FP;let r=t.peek(e),i="";for(;VJ(r);)i+=String.fromCharCode(r),r=t.peek(++e);return KP=t,JP=n,FP=i?i.toLowerCase():r==YJ||r==UJ?void 0:null}const H4=60,lx=62,Z2=47,YJ=63,UJ=33,WJ=45;function e_(t,e){this.name=t,this.parent=e}const HJ=[X2,V4,I4,B4,q4],GJ=new L2({start:null,shift(t,e,n,r){return HJ.indexOf(e)>-1?new e_(Nw(r,1)||"",t):t},reduce(t,e){return e==Y4&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==X2||i==LJ?new e_(Nw(r,1)||"",t):t},strict:!1}),FJ=new Dn((t,e)=>{if(t.next!=H4){t.next<0&&e.context&&t.acceptToken(A0);return}t.advance();let n=t.next==Z2;n&&t.advance();let r=Nw(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?_J:PJ);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken($J);if(i&&qJ[i])return t.acceptToken(A0,-2);if(e.dialectEnabled(ZJ))return t.acceptToken(NJ);for(let s=e.context;s;s=s.parent)if(s.name==r)return;t.acceptToken(TJ)}else{if(r=="script")return t.acceptToken(I4);if(r=="style")return t.acceptToken(B4);if(r=="textarea")return t.acceptToken(q4);if(BJ.hasOwnProperty(r))return t.acceptToken(V4);i&&GP[i]&&GP[i][r]?t.acceptToken(A0,-1):t.acceptToken(X2)}},{contextual:!0}),KJ=new Dn(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(HP);break}if(t.next==WJ)e++;else if(t.next==lx&&e>=2){n>=3&&t.acceptToken(HP,-2);break}else e=0;t.advance()}});function JJ(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const eee=new Dn((t,e)=>{if(t.next==Z2&&t.peek(1)==lx){let n=e.dialectEnabled(IJ)||JJ(e.context);t.acceptToken(n?EJ:WP,2)}else t.next==lx&&t.acceptToken(WP,1)});function I2(t,e,n){let r=2+t.length;return new Dn(i=>{for(let s=0,a=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(s==0&&i.next==H4||s==1&&i.next==Z2||s>=2&&s<r&&i.next==t.charCodeAt(s-2))s++,a++;else if(s==r&&i.next==lx){o>a?i.acceptToken(e,-a):i.acceptToken(n,-(a-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else s=a=0;i.advance()}})}const tee=I2("script",SJ,wJ),nee=I2("style",kJ,QJ),ree=I2("textarea",CJ,jJ),iee=Fo({"Text RawText IncompleteTag IncompleteCloseTag":U.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":U.angleBracket,TagName:U.tagName,"MismatchedCloseTag/TagName":[U.tagName,U.invalid],AttributeName:U.attributeName,"AttributeValue UnquotedAttributeValue":U.attributeValue,Is:U.definitionOperator,"EntityReference CharacterReference":U.character,Comment:U.blockComment,ProcessingInst:U.processingInstruction,DoctypeDecl:U.documentMeta}),see=Lo.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:GJ,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[iee],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[tee,nee,ree,eee,FJ,KJ,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function G4(t,e){let n=Object.create(null);for(let r of t.getChildren(U4)){let i=r.getChild(RJ),s=r.getChild($w)||r.getChild(W4);i&&(n[e.read(i.from,i.to)]=s?s.type.id==$w?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return n}function t_(t,e){let n=t.getChild(AJ);return n?e.read(n.from,n.to):" "}function R0(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=G4(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function F4(t=[],e=[]){let n=[],r=[],i=[],s=[];for(let o of t)(o.tag=="script"?n:o.tag=="style"?r:o.tag=="textarea"?i:s).push(o);let a=e.length?Object.create(null):null;for(let o of e)(a[o.name]||(a[o.name]=[])).push(o);return l4((o,u)=>{let d=o.type.id;if(d==MJ)return R0(o,u,n);if(d==zJ)return R0(o,u,r);if(d==DJ)return R0(o,u,i);if(d==Y4&&s.length){let h=o.node,m=h.firstChild,g=m&&t_(m,u),x;if(g){for(let v of s)if(v.tag==g&&(!v.attrs||v.attrs(x||(x=G4(m,u))))){let b=h.lastChild,k=b.type.id==XJ?b.from:h.to;if(k>m.to)return{parser:v.parser,overlay:[{from:m.to,to:k}]}}}}if(a&&d==U4){let h=o.node,m;if(m=h.firstChild){let g=a[u.read(m.from,m.to)];if(g)for(let x of g){if(x.tagName&&x.tagName!=t_(h.parent,u))continue;let v=h.lastChild;if(v.type.id==$w){let b=v.from+1,k=v.lastChild,w=v.to-(k&&k.isError?0:1);if(w>b)return{parser:x.parser,overlay:[{from:b,to:w}],bracketed:!0}}else if(v.type.id==W4)return{parser:x.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const aee=122,n_=1,lee=123,oee=124,K4=2,cee=125,uee=3,dee=4,J4=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],fee=58,hee=40,ez=95,pee=91,gO=45,mee=46,gee=35,Oee=37,xee=38,vee=92,yee=10,bee=42;function qh(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function B2(t){return t>=48&&t<=57}function r_(t){return B2(t)||t>=97&&t<=102||t>=65&&t<=70}const tz=(t,e,n)=>(r,i)=>{for(let s=!1,a=0,o=0;;o++){let{next:u}=r;if(qh(u)||u==gO||u==ez||s&&B2(u))!s&&(u!=gO||o>0)&&(s=!0),a===o&&u==gO&&a++,r.advance();else if(u==vee&&r.peek(1)!=yee){if(r.advance(),r_(r.next)){do r.advance();while(r_(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(a==2&&i.canShift(K4)?e:u==hee?n:t);break}}},See=new Dn(tz(lee,K4,oee)),wee=new Dn(tz(cee,uee,dee)),kee=new Dn(t=>{if(J4.includes(t.peek(-1))){let{next:e}=t;(qh(e)||e==ez||e==gee||e==mee||e==bee||e==pee||e==fee&&qh(t.peek(1))||e==gO||e==xee)&&t.acceptToken(aee)}}),Qee=new Dn(t=>{if(!J4.includes(t.peek(-1))){let{next:e}=t;if(e==Oee&&(t.advance(),t.acceptToken(n_)),qh(e)){do t.advance();while(qh(t.next)||B2(t.next));t.acceptToken(n_)}}}),Cee=Fo({"AtKeyword import charset namespace keyframes media supports":U.definitionKeyword,"from to selector":U.keyword,NamespaceName:U.namespace,KeyframeName:U.labelName,KeyframeRangeName:U.operatorKeyword,TagName:U.tagName,ClassName:U.className,PseudoClassName:U.constant(U.className),IdName:U.labelName,"FeatureName PropertyName":U.propertyName,AttributeName:U.attributeName,NumberLiteral:U.number,KeywordQuery:U.keyword,UnaryQueryOp:U.operatorKeyword,"CallTag ValueName":U.atom,VariableName:U.variableName,Callee:U.operatorKeyword,Unit:U.unit,"UniversalSelector NestingSelector":U.definitionOperator,"MatchOp CompareOp":U.compareOperator,"ChildOp SiblingOp, LogicOp":U.logicOperator,BinOp:U.arithmeticOperator,Important:U.modifier,Comment:U.blockComment,ColorLiteral:U.color,"ParenthesizedContent StringLiteral":U.string,":":U.punctuation,"PseudoOp #":U.derefOperator,"; ,":U.separator,"( )":U.paren,"[ ]":U.squareBracket,"{ }":U.brace}),jee={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Eee={__proto__:null,or:98,and:98,not:106,only:106,layer:170},$ee={__proto__:null,selector:112,layer:166},Nee={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},Tee={__proto__:null,to:207},Pee=Lo.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[Cee],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[kee,Qee,See,wee,1,2,3,4,new ax("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:t=>jee[t]||-1},{term:125,get:t=>Eee[t]||-1},{term:4,get:t=>$ee[t]||-1},{term:25,get:t=>Nee[t]||-1},{term:123,get:t=>Tee[t]||-1}],tokenPrec:1963});let M0=null;function z0(){if(!M0&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));M0=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return M0||[]}const i_=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),s_=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),_ee=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Aee=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Ws=/^(\w[\w-]*|-\w[\w-]*|)$/,Ree=/^-(-[\w-]*)?$/;function Mee(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const a_=new a4,zee=["Declaration"];function Dee(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function nz(t,e,n){if(e.to-e.from>4096){let r=a_.get(e);if(r)return r;let i=[],s=new Set,a=e.cursor(xt.IncludeAnonymous);if(a.firstChild())do for(let o of nz(t,a.node,n))s.has(o.label)||(s.add(o.label),i.push(o));while(a.nextSibling());return a_.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(zee)&&((a=s.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let o=t.sliceString(s.from,s.to);i.has(o)||(i.add(o),r.push({label:o,type:"variable"}))}}),r}}const Lee=t=>e=>{let{state:n,pos:r}=e,i=Kt(n).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:z0(),validFor:Ws};if(i.name=="ValueName")return{from:i.from,options:s_,validFor:Ws};if(i.name=="PseudoClassName")return{from:i.from,options:i_,validFor:Ws};if(t(i)||(e.explicit||s)&&Mee(i,n.doc))return{from:t(i)||s?i.from:r,options:nz(n.doc,Dee(i),t),validFor:Ree};if(i.name=="TagName"){for(let{parent:u}=i;u;u=u.parent)if(u.name=="Block")return{from:i.from,options:z0(),validFor:Ws};return{from:i.from,options:_ee,validFor:Ws}}if(i.name=="AtKeyword")return{from:i.from,options:Aee,validFor:Ws};if(!e.explicit)return null;let a=i.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:i_,validFor:Ws}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:s_,validFor:Ws}:a.name=="Block"||a.name=="Styles"?{from:r,options:z0(),validFor:Ws}:null},Xee=Lee(t=>t.name=="VariableName"),ox=Do.define({name:"css",parser:Pee.configure({props:[dd.add({Declaration:pO()}),fd.add({"Block KeyframeList":T2})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Zee(){return new Lu(ox,ox.data.of({autocomplete:Xee}))}const Iee=316,Bee=317,l_=1,qee=2,Vee=3,Yee=4,Uee=318,Wee=320,Hee=321,Gee=5,Fee=6,Kee=0,Tw=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],rz=125,Jee=59,Pw=47,ete=42,tte=43,nte=45,rte=60,ite=44,ste=63,ate=46,lte=91,ote=new L2({start:!1,shift(t,e){return e==Gee||e==Fee||e==Wee?t:e==Hee},strict:!1}),cte=new Dn((t,e)=>{let{next:n}=t;(n==rz||n==-1||e.context)&&t.acceptToken(Uee)},{contextual:!0,fallback:!0}),ute=new Dn((t,e)=>{let{next:n}=t,r;Tw.indexOf(n)>-1||n==Pw&&((r=t.peek(1))==Pw||r==ete)||n!=rz&&n!=Jee&&n!=-1&&!e.context&&t.acceptToken(Iee)},{contextual:!0}),dte=new Dn((t,e)=>{t.next==lte&&!e.context&&t.acceptToken(Bee)},{contextual:!0}),fte=new Dn((t,e)=>{let{next:n}=t;if(n==tte||n==nte){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(l_);t.acceptToken(r?l_:qee)}}else n==ste&&t.peek(1)==ate&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(Vee))},{contextual:!0});function D0(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const hte=new Dn((t,e)=>{if(t.next!=rte||!e.dialectEnabled(Kee)||(t.advance(),t.next==Pw))return;let n=0;for(;Tw.indexOf(t.next)>-1;)t.advance(),n++;if(D0(t.next,!0)){for(t.advance(),n++;D0(t.next,!1);)t.advance(),n++;for(;Tw.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==ite)return;for(let r=0;;r++){if(r==7){if(!D0(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(Yee,-n)}),pte=Fo({"get set async static":U.modifier,"for while do if else switch try catch finally return throw break continue default case defer":U.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":U.operatorKeyword,"let var const using function class extends":U.definitionKeyword,"import export from":U.moduleKeyword,"with debugger new":U.keyword,TemplateString:U.special(U.string),super:U.atom,BooleanLiteral:U.bool,this:U.self,null:U.null,Star:U.modifier,VariableName:U.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":U.function(U.variableName),VariableDefinition:U.definition(U.variableName),Label:U.labelName,PropertyName:U.propertyName,PrivatePropertyName:U.special(U.propertyName),"CallExpression/MemberExpression/PropertyName":U.function(U.propertyName),"FunctionDeclaration/VariableDefinition":U.function(U.definition(U.variableName)),"ClassDeclaration/VariableDefinition":U.definition(U.className),"NewExpression/VariableName":U.className,PropertyDefinition:U.definition(U.propertyName),PrivatePropertyDefinition:U.definition(U.special(U.propertyName)),UpdateOp:U.updateOperator,"LineComment Hashbang":U.lineComment,BlockComment:U.blockComment,Number:U.number,String:U.string,Escape:U.escape,ArithOp:U.arithmeticOperator,LogicOp:U.logicOperator,BitOp:U.bitwiseOperator,CompareOp:U.compareOperator,RegExp:U.regexp,Equals:U.definitionOperator,Arrow:U.function(U.punctuation),": Spread":U.punctuation,"( )":U.paren,"[ ]":U.squareBracket,"{ }":U.brace,"InterpolationStart InterpolationEnd":U.special(U.brace),".":U.derefOperator,", ;":U.separator,"@":U.meta,TypeName:U.typeName,TypeDefinition:U.definition(U.typeName),"type enum interface implements namespace module declare":U.definitionKeyword,"abstract global Privacy readonly override":U.modifier,"is keyof unique infer asserts":U.operatorKeyword,JSXAttributeValue:U.attributeValue,JSXText:U.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":U.angleBracket,"JSXIdentifier JSXNameSpacedName":U.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":U.attributeName,"JSXBuiltin/JSXIdentifier":U.standard(U.tagName)}),mte={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},gte={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Ote={__proto__:null,"<":193},xte=Lo.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:ote,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[pte],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ute,dte,fte,hte,2,3,4,5,6,7,8,9,10,11,12,13,14,cte,new ax("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new ax("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>mte[t]||-1},{term:343,get:t=>gte[t]||-1},{term:95,get:t=>Ote[t]||-1}],tokenPrec:15201}),iz=[gr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),gr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),gr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),gr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),gr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),gr(`try {
398
+ \${}
399
+ } catch (\${error}) {
400
+ \${}
401
+ }`,{label:"try",detail:"/ catch block",type:"keyword"}),gr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),gr(`if (\${}) {
402
+ \${}
403
+ } else {
404
+ \${}
405
+ }`,{label:"if",detail:"/ else block",type:"keyword"}),gr(`class \${name} {
406
+ constructor(\${params}) {
407
+ \${}
408
+ }
409
+ }`,{label:"class",detail:"definition",type:"keyword"}),gr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),gr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],vte=iz.concat([gr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),gr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),gr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),o_=new a4,sz=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Nf(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const yte=["FunctionDeclaration"],bte={FunctionDeclaration:Nf("function"),ClassDeclaration:Nf("class"),ClassExpression:()=>!0,EnumDeclaration:Nf("constant"),TypeAliasDeclaration:Nf("type"),NamespaceDeclaration:Nf("namespace"),VariableDefinition(t,e){t.matchContext(yte)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function az(t,e){let n=o_.get(e);if(n)return n;let r=[],i=!0;function s(a,o){let u=t.sliceString(a.from,a.to);r.push({label:u,type:o})}return e.cursor(xt.IncludeAnonymous).iterate(a=>{if(i)i=!1;else if(a.name){let o=bte[a.name];if(o&&o(a,s)||sz.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of az(t,a.node))r.push(o);return!1}}),o_.set(e,r),r}const c_=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,lz=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Ste(t){let e=Kt(t.state).resolveInner(t.pos,-1);if(lz.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&c_.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)sz.has(i.name)&&(r=r.concat(az(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:c_}}const vs=Do.define({name:"javascript",parser:xte.configure({props:[dd.add({IfStatement:pO({except:/^\s*({|else\b)/}),TryStatement:pO({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:dK,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:bw({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":pO({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),fd.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":T2,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),oz={test:t=>/^JSX/.test(t.name),facet:E2({commentTokens:{block:{open:"{/*",close:"*/}"}}})},cz=vs.configure({dialect:"ts"},"typescript"),uz=vs.configure({dialect:"jsx",props:[$2.add(t=>t.isTop?[oz]:void 0)]}),dz=vs.configure({dialect:"jsx ts",props:[$2.add(t=>t.isTop?[oz]:void 0)]},"typescript");let fz=t=>({label:t,type:"keyword"});const hz="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(fz),wte=hz.concat(["declare","implements","private","protected","public"].map(fz));function pz(t={}){let e=t.jsx?t.typescript?dz:uz:t.typescript?cz:vs,n=t.typescript?vte.concat(wte):iz.concat(hz);return new Lu(e,[vs.data.of({autocomplete:jK(lz,CK(n))}),vs.data.of({autocomplete:Ste}),t.jsx?Cte:[]])}function kte(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function u_(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const Qte=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Cte=Ae.inputHandler.of((t,e,n,r,i)=>{if((Qte?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!vs.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:a}=s,o=a.changeByRange(u=>{var d;let{head:h}=u,m=Kt(a).resolveInner(h-1,-1),g;if(m.name=="JSXStartTag"&&(m=m.parent),!(a.doc.sliceString(h-1,h)!=r||m.name=="JSXAttributeValue"&&m.to>h)){if(r==">"&&m.name=="JSXFragmentTag")return{range:u,changes:{from:h,insert:"</>"}};if(r=="/"&&m.name=="JSXStartCloseTag"){let x=m.parent,v=x.parent;if(v&&x.from==h-2&&((g=u_(a.doc,v.firstChild,h))||((d=v.firstChild)===null||d===void 0?void 0:d.name)=="JSXFragmentTag")){let b=`${g}>`;return{range:me.cursor(h+b.length,-1),changes:{from:h,insert:b}}}}else if(r==">"){let x=kte(m);if(x&&x.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(h,h+2))&&(g=u_(a.doc,x,h)))return{range:u,changes:{from:h,insert:`</${g}>`}}}}return{range:u}});return o.changes.empty?!1:(t.dispatch([s,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Tf=["_blank","_self","_top","_parent"],L0=["ascii","utf-8","utf-16","latin1","latin1"],X0=["get","post","put","delete"],Z0=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],zr=["true","false"],Ee={},jte={a:{attrs:{href:null,ping:null,type:null,media:null,target:Tf,hreflang:null}},abbr:Ee,address:Ee,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ee,aside:Ee,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ee,base:{attrs:{href:null,target:Tf}},bdi:Ee,bdo:Ee,blockquote:{attrs:{cite:null}},body:Ee,br:Ee,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Z0,formmethod:X0,formnovalidate:["novalidate"],formtarget:Tf,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ee,center:Ee,cite:Ee,code:Ee,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ee,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ee,div:Ee,dl:Ee,dt:Ee,em:Ee,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ee,figure:Ee,footer:Ee,form:{attrs:{action:null,name:null,"accept-charset":L0,autocomplete:["on","off"],enctype:Z0,method:X0,novalidate:["novalidate"],target:Tf}},h1:Ee,h2:Ee,h3:Ee,h4:Ee,h5:Ee,h6:Ee,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ee,hgroup:Ee,hr:Ee,html:{attrs:{manifest:null}},i:Ee,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Z0,formmethod:X0,formnovalidate:["novalidate"],formtarget:Tf,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ee,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ee,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ee,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:L0,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ee,noscript:Ee,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ee,param:{attrs:{name:null,value:null}},pre:Ee,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ee,rt:Ee,ruby:Ee,samp:Ee,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:L0}},section:Ee,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ee,source:{attrs:{src:null,type:null,media:null}},span:Ee,strong:Ee,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ee,summary:Ee,sup:Ee,table:Ee,tbody:Ee,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ee,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ee,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ee,time:{attrs:{datetime:null}},title:Ee,tr:Ee,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ee,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ee},mz={accesskey:null,class:null,contenteditable:zr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:zr,autocorrect:zr,autocapitalize:zr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":zr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":zr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":zr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":zr,"aria-hidden":zr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":zr,"aria-multiselectable":zr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":zr,"aria-relevant":null,"aria-required":zr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},gz="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of gz)mz[t]=null;class Vh{constructor(e,n){this.tags={...jte,...e},this.globalAttrs={...mz,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Vh.default=new Vh;function Zu(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Iu(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function Oz(t,e,n){let r=n.tags[Zu(t,Iu(e))];return(r==null?void 0:r.children)||n.allTags}function q2(t,e){let n=[];for(let r=Iu(e);r&&!r.type.isTop;r=Iu(r.parent)){let i=Zu(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const xz=/^[:\-\.\w\u00b7-\uffff]*$/;function d_(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",a=Iu(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:Oz(t.doc,a,e).map(o=>({label:o,type:"type"})).concat(q2(t.doc,n).map((o,u)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function f_(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:q2(t.doc,e).map((s,a)=>({label:s,apply:s+i,type:"type",boost:99-a})),validFor:xz}}function Ete(t,e,n,r){let i=[],s=0;for(let a of Oz(t.doc,n,e))i.push({label:"<"+a,type:"type"});for(let a of q2(t.doc,n))i.push({label:"</"+a+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function $te(t,e,n,r,i){let s=Iu(n),a=s?e.tags[Zu(t.doc,s)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],u=a&&a.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:u.map(d=>({label:d,type:"property"})),validFor:xz}}function Nte(t,e,n,r,i){var s;let a=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],u;if(a){let d=t.sliceDoc(a.from,a.to),h=e.globalAttrs[d];if(!h){let m=Iu(n),g=m?e.tags[Zu(t.doc,m)]:null;h=(g==null?void 0:g.attrs)&&g.attrs[d]}if(h){let m=t.sliceDoc(r,i).toLowerCase(),g='"',x='"';/^['"]/.test(m)?(u=m[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",x=t.sliceDoc(i,i+1)==m[0]?"":m[0],m=m.slice(1),r++):u=/^[^\s<>='"]*$/;for(let v of h)o.push({label:v,apply:g+v+x,type:"constant"})}}return{from:r,to:i,options:o,validFor:u}}function vz(t,e){let{state:n,pos:r}=e,i=Kt(n).resolveInner(r,-1),s=i.resolve(r);for(let a=r,o;s==i&&(o=i.childBefore(a));){let u=o.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=i=o,a=u.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?f_(n,i,i.from,r):d_(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?d_(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?f_(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?$te(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?Nte(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?Ete(n,t,i,r):null}function Tte(t){return vz(Vh.default,t)}function Pte(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new Vh(e,n):Vh.default;return i=>vz(r,i)}const _te=vs.parser.configure({top:"SingleExpression"}),yz=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:cz.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:uz.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:dz.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:_te},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:vs.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:ox.parser}],bz=[{name:"style",parser:ox.parser.configure({top:"Styles"})}].concat(gz.map(t=>({name:t,parser:vs.parser}))),Sz=Do.define({name:"html",parser:see.configure({props:[dd.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),fd.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),g4.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),OO=Sz.configure({wrap:F4(yz,bz)});function wz(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=F4((t.nestedLanguages||[]).concat(yz),(t.nestedAttributes||[]).concat(bz)));let r=n?Sz.configure({wrap:n,dialect:e}):e?OO.configure({dialect:e}):OO;return new Lu(r,[OO.data.of({autocomplete:Pte(t)}),t.autoCloseTags!==!1?Ate:[],pz().support,Zee().support])}const h_=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Ate=Ae.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!OO.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:a}=s,o=a.changeByRange(u=>{var d,h,m;let g=a.doc.sliceString(u.from-1,u.to)==r,{head:x}=u,v=Kt(a).resolveInner(x,-1),b;if(g&&r==">"&&v.name=="EndTag"){let k=v.parent;if(((h=(d=k.parent)===null||d===void 0?void 0:d.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(b=Zu(a.doc,k.parent,x))&&!h_.has(b)){let w=x+(a.doc.sliceString(x,x+1)===">"?1:0),j=`</${b}>`;return{range:u,changes:{from:x,to:w,insert:j}}}}else if(g&&r=="/"&&v.name=="IncompleteCloseTag"){let k=v.parent;if(v.from==x-2&&((m=k.lastChild)===null||m===void 0?void 0:m.name)!="CloseTag"&&(b=Zu(a.doc,k,x))&&!h_.has(b)){let w=x+(a.doc.sliceString(x,x+1)===">"?1:0),j=`${b}>`;return{range:me.cursor(x+j.length,-1),changes:{from:x,to:w,insert:j}}}}return{range:u}});return o.changes.empty?!1:(t.dispatch([s,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),kz=E2({commentTokens:{block:{open:"<!--",close:"-->"}}}),Qz=new Xe,Cz=JK.configure({props:[fd.add(t=>!t.is("Block")||t.is("Document")||_w(t)!=null||Rte(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),Qz.add(_w),dd.add({Document:()=>null}),vo.add({Document:kz})]});function _w(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Rte(t){return t.name=="OrderedList"||t.name=="BulletList"}function Mte(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=_w(r.type))!=null&&i<=e)break;n=r}return n.to}const zte=fK.of((t,e,n)=>{for(let r=Kt(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(Qz);if(i==null)continue;let s=Mte(r,i);if(s>n)return{from:n,to:s}}return null});function V2(t){return new ci(kz,t,[],"markdown")}const Dte=V2(Cz),Lte=Cz.configure([uJ,fJ,dJ,hJ,{props:[fd.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),cx=V2(Lte);function Xte(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=JO.matchLanguageName(t,n,!0),r instanceof JO)return r.support?r.support.language.parser:Xh.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}let I0=class{constructor(e,n,r,i,s,a,o){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=a,this.item=o}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+Ez(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function jz(t,e){let n=[],r=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&n.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i],a,o=e.lineAt(s.from),u=s.from-o.from;if(s.name=="Blockquote"&&(a=/^ *>( ?)/.exec(o.text.slice(u))))r.push(new I0(s,u,u+a[0].length,"",a[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(u)))){let d=a[3],h=a[0].length;d.length>=4&&(d=d.slice(0,d.length-4),h-=4),r.push(new I0(s.parent,u,u+h,a[1],d,a[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(u)))){let d=a[4],h=a[0].length;d.length>4&&(d=d.slice(0,d.length-4),h-=4);let m=a[2];a[3]&&(m+=a[3].replace(/[xX]/," ")),r.push(new I0(s.parent,u,u+h,a[1],d,m,s))}}return r}function Ez(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function B0(t,e,n,r=0){for(let i=-1,s=t;;){if(s.name=="ListItem"){let o=Ez(s,e),u=+o[2];if(i>=0){if(u!=i+1)return;n.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(i+2+r)})}i=u}let a=s.nextSibling;if(!a)break;s=a}}function Y2(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(Ep)!=" ")return t;let r=ha(t,4,n),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+t.slice(n)}const Zte=(t={})=>({state:e,dispatch:n})=>{let r=Kt(e),{doc:i}=e,s=null,a=e.changeByRange(o=>{if(!o.empty||!cx.isActiveAt(e,o.from,-1)&&!cx.isActiveAt(e,o.from,1))return s={range:o};let u=o.from,d=i.lineAt(u),h=jz(r.resolveInner(u,-1),i);for(;h.length&&h[h.length-1].from>u-d.from;)h.pop();if(!h.length)return s={range:o};let m=h[h.length-1];if(m.to-m.spaceAfter.length>u-d.from)return s={range:o};let g=u>=m.to-m.spaceAfter.length&&!/\S/.test(d.text.slice(m.to));if(m.item&&g){let w=m.node.firstChild,j=m.node.getChild("ListItem","ListItem");if(w.to>=u||j&&j.to<u||d.from>0&&!/[^\s>]/.test(i.lineAt(d.from-1).text)||t.nonTightLists===!1){let Q=h.length>1?h[h.length-2]:null,E,R="";Q&&Q.item?(E=d.from+Q.from,R=Q.marker(i,1)):E=d.from+(Q?Q.to:0);let T=[{from:E,to:u,insert:R}];return m.node.name=="OrderedList"&&B0(m.item,i,T,-2),Q&&Q.node.name=="OrderedList"&&B0(Q.item,i,T),{range:me.cursor(E+R.length),changes:T}}else{let Q=m_(h,e,d);return{range:me.cursor(u+Q.length+1),changes:{from:d.from,insert:Q+e.lineBreak}}}}if(m.node.name=="Blockquote"&&g&&d.from){let w=i.lineAt(d.from-1),j=/>\s*$/.exec(w.text);if(j&&j.index==m.from){let Q=e.changes([{from:w.from+j.index,to:w.to},{from:d.from+m.from,to:d.to}]);return{range:o.map(Q),changes:Q}}}let x=[];m.node.name=="OrderedList"&&B0(m.item,i,x);let v=m.item&&m.item.from<d.from,b="";if(!v||/^[\s\d.)\-+*>]*/.exec(d.text)[0].length>=m.to)for(let w=0,j=h.length-1;w<=j;w++)b+=w==j&&!v?h[w].marker(i,1):h[w].blank(w<j?ha(d.text,4,h[w+1].from)-b.length:null);let k=u;for(;k>d.from&&/\s/.test(d.text.charAt(k-d.from-1));)k--;return b=Y2(b,e),Bte(m.node,e.doc)&&(b=m_(h,e,d)+e.lineBreak+b),x.push({from:k,to:u,insert:e.lineBreak+b}),{range:me.cursor(k+b.length+1),changes:x}});return s?!1:(n(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},Ite=Zte();function p_(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Bte(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),s=e.lineAt(r.from),a=/^[\s>]*$/.test(i.text);return i.number+(a?0:1)<s.number}function m_(t,e,n){let r="";for(let i=0,s=t.length-2;i<=s;i++)r+=t[i].blank(i<s?ha(n.text,4,t[i+1].from)-r.length:null,i<s);return Y2(r,e)}function qte(t,e){let n=t.resolveInner(e,-1),r=e;p_(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(p_(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const Vte=({state:t,dispatch:e})=>{let n=Kt(t),r=null,i=t.changeByRange(s=>{let a=s.from,{doc:o}=t;if(s.empty&&cx.isActiveAt(t,s.from)){let u=o.lineAt(a),d=jz(qte(n,a),o);if(d.length){let h=d[d.length-1],m=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(a-u.from>m&&!/\S/.test(u.text.slice(m,a-u.from)))return{range:me.cursor(u.from+m),changes:{from:u.from+m,to:a}};if(a-u.from==m&&(!h.item||u.from<=h.item.from||!/\S/.test(u.text.slice(0,h.to)))){let g=u.from+h.from;if(h.item&&h.node.from<h.item.from&&/\S/.test(u.text.slice(h.from,h.to))){let x=h.blank(ha(u.text,4,h.to)-ha(u.text,4,h.from));return g==u.from&&(x=Y2(x,t)),{range:me.cursor(g+x.length),changes:{from:g,to:u.from+h.to,insert:x}}}if(g<a)return{range:me.cursor(g),changes:{from:g,to:a}}}}}return r={range:s}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},Yte=[{key:"Enter",run:Ite},{key:"Backspace",run:Vte}],$z=wz({matchClosingTags:!1});function Ute(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=Dte,completeHTMLTags:s=!0,pasteURLAsLink:a=!0,htmlTagLanguage:o=$z}=t;if(!(i instanceof nv))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=t.extensions?[t.extensions]:[],d=[o.support,zte],h;a&&d.push(Fte),n instanceof Lu?(d.push(n.support),h=n.language):n&&(h=n);let m=e||h?Xte(e,h):void 0;u.push(tJ({codeParser:m,htmlParser:o.language.parser})),r&&d.push(wp.high(ev.of(Yte)));let g=V2(i.configure(u));return s&&d.push(g.data.of({autocomplete:Wte})),new Lu(g,d)}function Wte(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=Kt(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:Hte(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let q0=null;function Hte(){if(q0)return q0;let t=Tte(new kK(dt.create({extensions:$z}),0,!0));return q0=t?t.options:[]}const Gte=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Fte=Ae.domEventHandlers({paste:(t,e)=>{var n;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!cx.isActiveAt(e.state,r.from,1)))return!1;let s=Kt(e.state),a=!1;return s.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||Gte.test(o.name))&&(a=!0)},leave:o=>{o.to<r.to&&(a=!0)}}),a?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Hc=63,g_=64,Kte=1,Jte=2,Nz=3,ene=4,Tz=5,tne=6,nne=7,Pz=65,rne=66,ine=8,sne=9,ane=10,lne=11,one=12,_z=13,cne=19,une=20,dne=29,fne=33,hne=34,pne=47,mne=0,U2=1,Aw=2,Yh=3,Rw=4;class ho{constructor(e,n,r){this.parent=e,this.depth=n,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+r}}ho.top=new ho(null,-1,mne);function hh(t,e){for(let n=0,r=e-t.pos-1;;r--,n++){let i=t.peek(r);if(ma(i)||i==-1)return n}}function Mw(t){return t==32||t==9}function ma(t){return t==10||t==13}function Az(t){return Mw(t)||ma(t)}function yo(t){return t<0||Az(t)}const gne=new L2({start:ho.top,reduce(t,e){return t.type==Yh&&(e==une||e==hne)?t.parent:t},shift(t,e,n,r){if(e==Nz)return new ho(t,hh(r,r.pos),U2);if(e==Pz||e==Tz)return new ho(t,hh(r,r.pos),Aw);if(e==Hc)return t.parent;if(e==cne||e==fne)return new ho(t,0,Yh);if(e==_z&&t.type==Rw)return t.parent;if(e==pne){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new ho(t,t.depth+ +i[0],Rw)}return t},hash(t){return t.hash}});function Bu(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&yo(t.peek(n+3))}const One=new Dn((t,e)=>{if(t.next==-1&&e.canShift(g_))return t.acceptToken(g_);let n=t.peek(-1);if((ma(n)||n<0)&&e.context.type!=Yh){if(Bu(t,45))if(e.canShift(Hc))t.acceptToken(Hc);else return t.acceptToken(Kte,3);if(Bu(t,46))if(e.canShift(Hc))t.acceptToken(Hc);else return t.acceptToken(Jte,3);let r=0;for(;t.next==32;)r++,t.advance();(r<e.context.depth||r==e.context.depth&&e.context.type==U2&&(t.next!=45||!yo(t.peek(1))))&&t.next!=-1&&!ma(t.next)&&t.next!=35&&t.acceptToken(Hc,-r)}},{contextual:!0}),xne=new Dn((t,e)=>{if(e.context.type==Yh){t.next==63&&(t.advance(),yo(t.next)&&t.acceptToken(nne));return}if(t.next==45)t.advance(),yo(t.next)&&t.acceptToken(e.context.type==U2&&e.context.depth==hh(t,t.pos-1)?ene:Nz);else if(t.next==63)t.advance(),yo(t.next)&&t.acceptToken(e.context.type==Aw&&e.context.depth==hh(t,t.pos-1)?tne:Tz);else{let n=t.pos;for(;;)if(Mw(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)Rz(t);else if(t.next==38)zw(t);else if(t.next==42){zw(t);break}else if(t.next==39||t.next==34){if(W2(t,!0))break;return}else if(t.next==91||t.next==123){if(!yne(t))return;break}else{Mz(t,!0,!1,0);break}for(;Mw(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(dne))return;let r=t.peek(1);yo(r)&&t.acceptTokenTo(e.context.type==Aw&&e.context.depth==hh(t,n)?rne:Pz,n)}}},{contextual:!0});function vne(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function O_(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function x_(t,e){return t.next==37?(t.advance(),O_(t.next)&&t.advance(),O_(t.next)&&t.advance(),!0):vne(t.next)||e&&t.next==44?(t.advance(),!0):!1}function Rz(t){if(t.advance(),t.next==60){for(t.advance();;)if(!x_(t,!0)){t.next==62&&t.advance();break}}else for(;x_(t,!1););}function zw(t){for(t.advance();!yo(t.next)&&ux(t.next)!="f";)t.advance()}function W2(t,e){let n=t.next,r=!1,i=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(ma(s)){if(e)return!1;r=!0}else if(e&&t.pos>=i+1024)return!1}return!r}function yne(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!W2(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||ma(t.next))return!1;t.advance()}}const bne="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function ux(t){return t<33?"u":t>125?"s":bne[t-33]}function V0(t,e){let n=ux(t);return n!="u"&&!(e&&n=="f")}function Mz(t,e,n,r){if(ux(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&V0(t.peek(1),n))t.advance();else return!1;let i=t.pos;for(;;){let s=t.next,a=0,o=r+1;for(;Az(s);){if(ma(s)){if(e)return!1;o=0}else o++;s=t.peek(++a)}if(!(s>=0&&(s==58?V0(t.peek(a+1),n):s==35?t.peek(a-1)!=32:V0(s,n)))||!n&&o<=r||o==0&&!n&&(Bu(t,45,a)||Bu(t,46,a)))break;if(e&&ux(s)=="f")return!1;for(let d=a;d>=0;d--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const Sne=new Dn((t,e)=>{if(t.next==33)Rz(t),t.acceptToken(one);else if(t.next==38||t.next==42){let n=t.next==38?ane:lne;zw(t),t.acceptToken(n)}else t.next==39||t.next==34?(W2(t,!1),t.acceptToken(sne)):Mz(t,!1,e.context.type==Yh,e.context.depth)&&t.acceptToken(ine)}),wne=new Dn((t,e)=>{let n=e.context.type==Rw?e.context.depth:-1,r=t.pos;e:for(;;){let i=0,s=t.next;for(;s==32;)s=t.peek(++i);if(!i&&(Bu(t,45,i)||Bu(t,46,i))||!ma(s)&&(n<0&&(n=Math.max(e.context.depth+1,i)),i<n))break;for(;;){if(t.next<0)break e;let a=ma(t.next);if(t.advance(),a)continue e;r=t.pos}}t.acceptTokenTo(_z,r)}),kne=Fo({DirectiveName:U.keyword,DirectiveContent:U.attributeValue,"DirectiveEnd DocEnd":U.meta,QuotedLiteral:U.string,BlockLiteralHeader:U.special(U.string),BlockLiteralContent:U.content,Literal:U.content,"Key/Literal Key/QuotedLiteral":U.definition(U.propertyName),"Anchor Alias":U.labelName,Tag:U.typeName,Comment:U.lineComment,": , -":U.separator,"?":U.punctuation,"[ ]":U.squareBracket,"{ }":U.brace}),Qne=Lo.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:gne,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[kne],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[One,xne,Sne,wne,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),Cne=Do.define({name:"yaml",parser:Qne.configure({props:[dd.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:bw({closing:"}"}),FlowSequence:bw({closing:"]"})}),fd.add({"FlowMapping FlowSequence":T2,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function jne(){return new Lu(Cne)}const Ene=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=G2(t.state,n.from);return r.line?$ne(t):r.block?Tne(t):!1};function H2(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const $ne=H2(Ane,0),Nne=H2(zz,0),Tne=H2((t,e)=>zz(t,e,_ne(e)),0);function G2(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Pf=50;function Pne(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-Pf,r),a=t.sliceDoc(i,i+Pf),o=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(a)[0].length,d=s.length-o;if(s.slice(d-e.length,d)==e&&a.slice(u,u+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:i+u,margin:u&&1}};let h,m;i-r<=2*Pf?h=m=t.sliceDoc(r,i):(h=t.sliceDoc(r,r+Pf),m=t.sliceDoc(i-Pf,i));let g=/^\s*/.exec(h)[0].length,x=/\s*$/.exec(m)[0].length,v=m.length-x-n.length;return h.slice(g,g+e.length)==e&&m.slice(v,v+n.length)==n?{open:{pos:r+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:i-x-n.length,margin:/\s/.test(m.charAt(v-1))?1:0}}:null}function _ne(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function zz(t,e,n=e.selection.ranges){let r=n.map(s=>G2(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>Pne(e,r[a],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,a)=>i[a]?[]:[{from:s.from,insert:r[a].open+" "},{from:s.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let a=0,o;a<i.length;a++)if(o=i[a]){let u=r[a],{open:d,close:h}=o;s.push({from:d.pos-u.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+u.close.length})}return{changes:s}}return null}function Ane(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:a}of n){let o=r.length,u=1e9,d;for(let h=s;h<=a;){let m=e.doc.lineAt(h);if(d==null&&(d=G2(e,m.from).line,!d))continue e;if(m.from>i&&(s==a||a>m.from)){i=m.from;let g=/^\s*/.exec(m.text)[0].length,x=g==m.length,v=m.text.slice(g,g+d.length)==d?g:-1;g<m.text.length&&g<u&&(u=g),r.push({line:m,comment:v,token:d,indent:g,empty:x,single:!1})}h=m.to+1}if(u<1e9)for(let h=o;h<r.length;h++)r[h].indent<r[h].line.text.length&&(r[h].indent=u);r.length==o+1&&(r[o].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:u,indent:d,empty:h,single:m}of r)(m||!h)&&s.push({from:o.from+d,insert:u+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:o,token:u}of r)if(o>=0){let d=a.from+o,h=d+u.length;a.text[h-a.from]==" "&&h++,s.push({from:d,to:h})}return{changes:s}}return null}const Dw=ya.define(),Rne=ya.define(),Mne=ze.define(),Dz=ze.define({combine(t){return zH(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),Lz=va.define({create(){return gs.empty},update(t,e){let n=e.state.facet(Dz),r=e.annotation(Dw);if(r){let u=Sr.fromTransaction(e,r.selection),d=r.side,h=d==0?t.undone:t.done;return u?h=dx(h,h.length,n.minDepth,u):h=Iz(h,e.startState.selection),new gs(d==0?r.rest:h,d==0?h:r.rest)}let i=e.annotation(Rne);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(pn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=Sr.fromTransaction(e),a=e.annotation(pn.time),o=e.annotation(pn.userEvent);return s?t=t.addChanges(s,a,o,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,o,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new gs(t.done.map(Sr.fromJSON),t.undone.map(Sr.fromJSON))}});function zne(t={}){return[Lz,Dz.of(t),Ae.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?Xz:e.inputType=="historyRedo"?Lw:null;return r?(e.preventDefault(),r(n)):!1}})]}function rv(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(Lz,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const Xz=rv(0,!1),Lw=rv(1,!1),Dne=rv(0,!0),Lne=rv(1,!0);class Sr{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new Sr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Sr(e.changes&&yn.fromJSON(e.changes),[],e.mapped&&xs.fromJSON(e.mapped),e.startSelection&&me.fromJSON(e.startSelection),e.selectionsAfter.map(me.fromJSON))}static fromTransaction(e,n){let r=ui;for(let i of e.startState.facet(Mne)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new Sr(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ui)}static selection(e){return new Sr(void 0,ui,void 0,void 0,e)}}function dx(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function Xne(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,a,o)=>{for(let u=0;u<n.length;){let d=n[u++],h=n[u++];o>=d&&a<=h&&(r=!0)}}),r}function Zne(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function Zz(t,e){return t.length?e.length?t.concat(e):t:e}const ui=[],Ine=200;function Iz(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Ine));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),dx(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Sr.selection([e])]}function Bne(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Y0(t,e){if(!t.length)return t;let n=t.length,r=ui;for(;n;){let i=qne(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Sr.selection(r)]:ui}function qne(t,e,n){let r=Zz(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):ui,n);if(!t.changes)return Sr.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(s):s;return new Sr(i,Zt.mapEffects(t.effects,e),a,t.startSelection.map(s),r)}const Vne=/^(input\.type|delete)($|\.)/;class gs{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new gs(this.done,this.undone):this}addChanges(e,n,r,i,s){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||Vne.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,Xne(o.changes,e.changes))||r=="input.type.compose")?a=dx(a,a.length-1,i.minDepth,new Sr(e.changes.compose(o.changes),Zz(Zt.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,ui)):a=dx(a,a.length,i.minDepth,e),new gs(a,ui,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ui;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Zne(s[s.length-1],e)?this:new gs(Iz(this.done,e),this.undone,n,r)}addMapping(e){return new gs(Y0(this.done,e),Y0(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Dw.of({side:e,rest:Bne(i),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=i.length==1?ui:i.slice(0,i.length-1);return s.mapped&&(o=Y0(o,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Dw.of({side:e,rest:o,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}gs.empty=new gs(ui,ui);const Yne=[{key:"Mod-z",run:Xz,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Lw,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Lw,preventDefault:!0},{key:"Mod-u",run:Dne,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Lne,preventDefault:!0}];function pd(t,e){return me.create(t.ranges.map(e),t.mainIndex)}function Zi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ii({state:t,dispatch:e},n){let r=pd(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Zi(t,r)),!0)}function iv(t,e){return me.cursor(e?t.to:t.from)}function Bz(t,e){return Ii(t,n=>n.empty?t.moveByChar(n,e):iv(n,e))}function Wn(t){return t.textDirectionAt(t.state.selection.main.head)==mn.LTR}const qz=t=>Bz(t,!Wn(t)),Vz=t=>Bz(t,Wn(t));function Yz(t,e){return Ii(t,n=>n.empty?t.moveByGroup(n,e):iv(n,e))}const Une=t=>Yz(t,!Wn(t)),Wne=t=>Yz(t,Wn(t));function Hne(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function sv(t,e,n){let r=Kt(t).resolveInner(e.head),i=n?Xe.closedBy:Xe.openedBy;for(let u=e.head;;){let d=n?r.childAfter(u):r.childBefore(u);if(!d)break;Hne(t,d,i)?r=d:u=n?d.to:d.from}let s=r.type.prop(i),a,o;return s&&(a=n?ru(t,r.from,1):ru(t,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,me.cursor(o,n?-1:1)}const Gne=t=>Ii(t,e=>sv(t.state,e,!Wn(t))),Fne=t=>Ii(t,e=>sv(t.state,e,Wn(t)));function Uz(t,e){return Ii(t,n=>{if(!n.empty)return iv(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Wz=t=>Uz(t,!1),Hz=t=>Uz(t,!0);function Gz(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(Ae.scrollMargins)){let a=s(t);a!=null&&a.top&&(n=Math.max(a==null?void 0:a.top,n)),a!=null&&a.bottom&&(r=Math.max(a==null?void 0:a.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function Fz(t,e){let n=Gz(t),{state:r}=t,i=pd(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):iv(a,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),u=o.top+n.marginTop,d=o.bottom-n.marginBottom;a&&a.top>u&&a.bottom<d&&(s=Ae.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-u}))}return t.dispatch(Zi(r,i),{effects:s}),!0}const v_=t=>Fz(t,!1),Xw=t=>Fz(t,!0);function Pl(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=me.cursor(r.from+s))}return i}const Kne=t=>Ii(t,e=>Pl(t,e,!0)),Jne=t=>Ii(t,e=>Pl(t,e,!1)),ere=t=>Ii(t,e=>Pl(t,e,!Wn(t))),tre=t=>Ii(t,e=>Pl(t,e,Wn(t))),nre=t=>Ii(t,e=>me.cursor(t.lineBlockAt(e.head).from,1)),rre=t=>Ii(t,e=>me.cursor(t.lineBlockAt(e.head).to,-1));function ire(t,e,n){let r=!1,i=pd(t.selection,s=>{let a=ru(t,s.head,-1)||ru(t,s.head,1)||s.head>0&&ru(t,s.head-1,1)||s.head<t.doc.length&&ru(t,s.head+1,-1);if(!a||!a.end)return s;r=!0;let o=a.start.from==s.head?a.end.to:a.end.from;return me.cursor(o)});return r?(e(Zi(t,i)),!0):!1}const sre=({state:t,dispatch:e})=>ire(t,e);function yi(t,e){let n=pd(t.state.selection,r=>{let i=e(r);return me.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(Zi(t.state,n)),!0)}function Kz(t,e){return yi(t,n=>t.moveByChar(n,e))}const Jz=t=>Kz(t,!Wn(t)),eD=t=>Kz(t,Wn(t));function tD(t,e){return yi(t,n=>t.moveByGroup(n,e))}const are=t=>tD(t,!Wn(t)),lre=t=>tD(t,Wn(t)),ore=t=>yi(t,e=>sv(t.state,e,!Wn(t))),cre=t=>yi(t,e=>sv(t.state,e,Wn(t)));function nD(t,e){return yi(t,n=>t.moveVertically(n,e))}const rD=t=>nD(t,!1),iD=t=>nD(t,!0);function sD(t,e){return yi(t,n=>t.moveVertically(n,e,Gz(t).height))}const y_=t=>sD(t,!1),b_=t=>sD(t,!0),ure=t=>yi(t,e=>Pl(t,e,!0)),dre=t=>yi(t,e=>Pl(t,e,!1)),fre=t=>yi(t,e=>Pl(t,e,!Wn(t))),hre=t=>yi(t,e=>Pl(t,e,Wn(t))),pre=t=>yi(t,e=>me.cursor(t.lineBlockAt(e.head).from)),mre=t=>yi(t,e=>me.cursor(t.lineBlockAt(e.head).to)),S_=({state:t,dispatch:e})=>(e(Zi(t,{anchor:0})),!0),w_=({state:t,dispatch:e})=>(e(Zi(t,{anchor:t.doc.length})),!0),k_=({state:t,dispatch:e})=>(e(Zi(t,{anchor:t.selection.main.anchor,head:0})),!0),Q_=({state:t,dispatch:e})=>(e(Zi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),gre=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Ore=({state:t,dispatch:e})=>{let n=av(t).map(({from:r,to:i})=>me.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:me.create(n),userEvent:"select"})),!0},xre=({state:t,dispatch:e})=>{let n=pd(t.selection,r=>{let i=Kt(t),s=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:o}=a;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return me.range(o.to,o.from)}return r});return n.eq(t.selection)?!1:(e(Zi(t,n)),!0)};function aD(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let o=s;;){let u=t.moveVertically(o,e);if(u.head<a.from||u.head>a.to){i.some(d=>d.head==u.head)||i.push(u);break}else{if(u.head==o.head)break;o=u}}}return i.length==r.ranges.length?!1:(t.dispatch(Zi(n,me.create(i,i.length-1))),!0)}const vre=t=>aD(t,!1),yre=t=>aD(t,!0),bre=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=me.create([n.main]):n.main.empty||(r=me.create([me.cursor(n.main.head)])),r?(e(Zi(t,r)),!0):!1};function Tp(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:a,to:o}=s;if(a==o){let u=e(s);u<a?(n="delete.backward",u=Bg(t,u,!1)):u>a&&(n="delete.forward",u=Bg(t,u,!0)),a=Math.min(a,u),o=Math.max(o,u)}else a=Bg(t,a,!1),o=Bg(t,o,!0);return a==o?{range:s}:{changes:{from:a,to:o},range:me.cursor(a,a<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ae.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Bg(t,e,n){if(t instanceof Ae)for(let r of t.state.facet(Ae.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const lD=(t,e,n)=>Tp(t,r=>{let i=r.from,{state:s}=t,a=s.doc.lineAt(i),o,u;if(n&&!e&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(o=a.text.slice(0,i-a.from))){if(o[o.length-1]==" ")return i-1;let d=ha(o,s.tabSize),h=d%ex(s)||ex(s);for(let m=0;m<h&&o[o.length-1-m]==" ";m++)i--;u=i}else u=Yn(a.text,i-a.from,e,e)+a.from,u==i&&a.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(u-a.from,i-a.from))&&(u=Yn(a.text,u-a.from,!1,!1)+a.from);return u}),Zw=t=>lD(t,!1,!0),oD=t=>lD(t,!0,!1),cD=(t,e)=>Tp(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),a=i.charCategorizer(r);for(let o=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=Yn(s.text,r-s.from,e)+s.from,d=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),h=a(d);if(o!=null&&h!=o)break;(d!=" "||r!=n.head)&&(o=h),r=u}return r}),uD=t=>cD(t,!1),Sre=t=>cD(t,!0),wre=t=>Tp(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),kre=t=>Tp(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Qre=t=>Tp(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Cre=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:st.of(["",""])},range:me.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},jre=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),a=i==s.from?i-1:Yn(s.text,i-s.from,!1)+s.from,o=i==s.to?i+1:Yn(s.text,i-s.from,!0)+s.from;return{changes:{from:a,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(a,i))},range:me.cursor(o)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function av(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function dD(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of av(t)){if(n?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(n?s.to+1:s.from-1),o=a.length+1;if(n){r.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let u of s.ranges)i.push(me.range(Math.min(t.doc.length,u.anchor+o),Math.min(t.doc.length,u.head+o)))}else{r.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let u of s.ranges)i.push(me.range(u.anchor-o,u.head-o))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:me.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Ere=({state:t,dispatch:e})=>dD(t,e,!1),$re=({state:t,dispatch:e})=>dD(t,e,!0);function fD(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of av(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Nre=({state:t,dispatch:e})=>fD(t,e,!1),Tre=({state:t,dispatch:e})=>fD(t,e,!0),Pre=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(av(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=pd(e.selection,i=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(s=a.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function _re(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Kt(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Xe.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const C_=hD(!1),Are=hD(!0);function hD(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:a}=i,o=e.doc.lineAt(s),u=!t&&s==a&&_re(e,s);t&&(s=a=(a<=o.to?o:e.doc.lineAt(a)).to);let d=new tv(e,{simulateBreak:s,simulateDoubleBreak:!!u}),h=f4(d,s);for(h==null&&(h=ha(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<o.to&&/\s/.test(o.text[a-o.from]);)a++;u?{from:s,to:a}=u:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let m=["",tx(e,h)];return u&&m.push(tx(e,d.lineIndent(o.from,-1))),{changes:{from:s,to:a,insert:st.of(m)},range:me.cursor(s+1+m[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function F2(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=t.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(e(o,i,r),n=o.number),a=o.to+1}let s=t.changes(i);return{changes:i,range:me.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Rre=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new tv(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=F2(t,(s,a,o)=>{let u=f4(r,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let d=/^\s*/.exec(s.text)[0],h=tx(t,u);(d!=h||o.from<s.from+d.length)&&(n[s.from]=u,a.push({from:s.from,to:s.from+d.length,insert:h}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},Mre=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(F2(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Ep)})}),{userEvent:"input.indent"})),!0),zre=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(F2(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=ha(i,t.tabSize),a=0,o=tx(t,Math.max(0,s-ex(t)));for(;a<i.length&&a<o.length&&i.charCodeAt(a)==o.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:o.slice(a)})}),{userEvent:"delete.dedent"})),!0),Dre=t=>(t.setTabFocusMode(),!0),Lre=[{key:"Ctrl-b",run:qz,shift:Jz,preventDefault:!0},{key:"Ctrl-f",run:Vz,shift:eD},{key:"Ctrl-p",run:Wz,shift:rD},{key:"Ctrl-n",run:Hz,shift:iD},{key:"Ctrl-a",run:nre,shift:pre},{key:"Ctrl-e",run:rre,shift:mre},{key:"Ctrl-d",run:oD},{key:"Ctrl-h",run:Zw},{key:"Ctrl-k",run:wre},{key:"Ctrl-Alt-h",run:uD},{key:"Ctrl-o",run:Cre},{key:"Ctrl-t",run:jre},{key:"Ctrl-v",run:Xw}],Xre=[{key:"ArrowLeft",run:qz,shift:Jz,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Une,shift:are,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ere,shift:fre,preventDefault:!0},{key:"ArrowRight",run:Vz,shift:eD,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Wne,shift:lre,preventDefault:!0},{mac:"Cmd-ArrowRight",run:tre,shift:hre,preventDefault:!0},{key:"ArrowUp",run:Wz,shift:rD,preventDefault:!0},{mac:"Cmd-ArrowUp",run:S_,shift:k_},{mac:"Ctrl-ArrowUp",run:v_,shift:y_},{key:"ArrowDown",run:Hz,shift:iD,preventDefault:!0},{mac:"Cmd-ArrowDown",run:w_,shift:Q_},{mac:"Ctrl-ArrowDown",run:Xw,shift:b_},{key:"PageUp",run:v_,shift:y_},{key:"PageDown",run:Xw,shift:b_},{key:"Home",run:Jne,shift:dre,preventDefault:!0},{key:"Mod-Home",run:S_,shift:k_},{key:"End",run:Kne,shift:ure,preventDefault:!0},{key:"Mod-End",run:w_,shift:Q_},{key:"Enter",run:C_,shift:C_},{key:"Mod-a",run:gre},{key:"Backspace",run:Zw,shift:Zw,preventDefault:!0},{key:"Delete",run:oD,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:uD,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Sre,preventDefault:!0},{mac:"Mod-Backspace",run:kre,preventDefault:!0},{mac:"Mod-Delete",run:Qre,preventDefault:!0}].concat(Lre.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Zre=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Gne,shift:ore},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Fne,shift:cre},{key:"Alt-ArrowUp",run:Ere},{key:"Shift-Alt-ArrowUp",run:Nre},{key:"Alt-ArrowDown",run:$re},{key:"Shift-Alt-ArrowDown",run:Tre},{key:"Mod-Alt-ArrowUp",run:vre},{key:"Mod-Alt-ArrowDown",run:yre},{key:"Escape",run:bre},{key:"Mod-Enter",run:Are},{key:"Alt-l",mac:"Ctrl-l",run:Ore},{key:"Mod-i",run:xre,preventDefault:!0},{key:"Mod-[",run:zre},{key:"Mod-]",run:Mre},{key:"Mod-Alt-\\",run:Rre},{key:"Shift-Mod-k",run:Pre},{key:"Shift-Mod-\\",run:sre},{key:"Mod-/",run:Ene},{key:"Alt-A",run:Nne},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Dre}].concat(Xre),Ire="#e5c07b",j_="#e06c75",Bre="#56b6c2",qre="#ffffff",xO="#abb2bf",Iw="#7d8799",Vre="#61afef",Yre="#98c379",E_="#d19a66",Ure="#c678dd",Wre="#21252b",$_="#2c313a",N_="#282c34",U0="#353a42",Hre="#3E4451",T_="#528bff",Gre=Ae.theme({"&":{color:xO,backgroundColor:N_},".cm-content":{caretColor:T_},".cm-cursor, .cm-dropCursor":{borderLeftColor:T_},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Hre},".cm-panels":{backgroundColor:Wre,color:xO},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:N_,color:Iw,border:"none"},".cm-activeLineGutter":{backgroundColor:$_},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U0},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U0,borderBottomColor:U0},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$_,color:xO}}},{dark:!0}),Fre=$p.define([{tag:U.keyword,color:Ure},{tag:[U.name,U.deleted,U.character,U.propertyName,U.macroName],color:j_},{tag:[U.function(U.variableName),U.labelName],color:Vre},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:E_},{tag:[U.definition(U.name),U.separator],color:xO},{tag:[U.typeName,U.className,U.number,U.changed,U.annotation,U.modifier,U.self,U.namespace],color:Ire},{tag:[U.operator,U.operatorKeyword,U.url,U.escape,U.regexp,U.link,U.special(U.string)],color:Bre},{tag:[U.meta,U.comment],color:Iw},{tag:U.strong,fontWeight:"bold"},{tag:U.emphasis,fontStyle:"italic"},{tag:U.strikethrough,textDecoration:"line-through"},{tag:U.link,color:Iw,textDecoration:"underline"},{tag:U.heading,fontWeight:"bold",color:j_},{tag:[U.atom,U.bool,U.special(U.variableName)],color:E_},{tag:[U.processingInstruction,U.string,U.inserted],color:Yre},{tag:U.invalid,color:qre}]),Kre=[Gre,m4(Fre)];function Jre(t){switch(t){case"markdown":return Ute();case"yaml":return jne();case"html":return wz();case"javascript":return pz();case"plaintext":return null}}function eie(t){var n;switch(((n=t.split(".").pop())==null?void 0:n.toLowerCase())??""){case"md":case"markdown":return"markdown";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";case"js":case"jsx":case"ts":case"tsx":case"json":return"javascript";default:return"plaintext"}}const tie=Ae.theme({"&":{backgroundColor:"var(--color-bg)",color:"var(--color-text)",height:"100%"},".cm-content":{fontFamily:"var(--font-mono)",fontSize:"13px",padding:"16px 0"},".cm-gutters":{backgroundColor:"var(--color-bg)",borderRight:"1px solid var(--color-border-subtle)",color:"var(--color-muted)"},".cm-activeLineGutter":{backgroundColor:"var(--color-surface-raised)"},".cm-activeLine":{backgroundColor:"var(--color-surface-raised)"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:"rgba(255, 74, 0, 0.15) !important"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"rgba(255, 74, 0, 0.2) !important"},".cm-scroller":{overflow:"auto"}});function nie({content:t,onChange:e,onSave:n,readOnly:r=!1,dark:i=!1,placeholder:s,language:a="markdown"}){const o=C.useRef(null),u=C.useRef(null),d=C.useRef(e),h=C.useRef(n);d.current=e,h.current=n;const m=C.useCallback(()=>{const g=[zne(),ev.of([...Zre,...Yne,{key:"Mod-s",run:v=>{var b;return(b=h.current)==null||b.call(h,v.state.doc.toString()),!0}}]),Ae.updateListener.of(v=>{var b;v.docChanged&&((b=d.current)==null||b.call(d,v.state.doc.toString()))}),Ae.lineWrapping],x=Jre(a);return x&&g.push(x),i?g.push(Kre):g.push(tie,m4(gK)),r&&g.push(dt.readOnly.of(!0)),s&&g.push(AF(s)),g},[i,r,s,a]);return C.useEffect(()=>{if(!o.current)return;const g=dt.create({doc:t,extensions:m()}),x=new Ae({state:g,parent:o.current});return u.current=x,()=>{x.destroy(),u.current=null}},[m]),C.useEffect(()=>{const g=u.current;if(!g)return;const x=g.state.doc.toString();x!==t&&g.dispatch({changes:{from:0,to:x.length,insert:t}})},[t]),p.jsx("div",{ref:o,className:"h-full overflow-hidden"})}function mi({content:t,filePath:e,onChange:n,onSave:r,readOnly:i=!1,defaultMode:s}){const[a,o]=C.useState(s??"edit"),u=Eh(g=>g.theme),d=eie(e),h=d==="markdown",m=C.useCallback(g=>{(g.metaKey||g.ctrlKey)&&g.key==="s"&&(g.preventDefault(),r==null||r(t))},[t,r]);return p.jsxs("div",{className:"flex flex-col h-full",onKeyDown:m,children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-[var(--color-border-subtle)] shrink-0",children:[p.jsx("span",{className:"text-xs font-[var(--font-mono)] text-[var(--color-muted)] truncate mr-4",children:e}),p.jsx("div",{className:"flex gap-0.5 shrink-0",children:["edit","preview","split"].map(g=>p.jsx("button",{onClick:()=>o(g),className:`px-2.5 py-1 text-xs rounded transition-colors ${a===g?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:g.charAt(0).toUpperCase()+g.slice(1)},g))})]}),p.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[(a==="edit"||a==="split")&&p.jsx("div",{className:`${a==="split"?"w-1/2":"w-full"} overflow-hidden`,children:p.jsx(nie,{content:t,onChange:n,onSave:r,readOnly:i,dark:u==="dark",language:d})}),(a==="preview"||a==="split")&&p.jsx("div",{className:`${a==="split"?"w-1/2 border-l border-[var(--color-border-subtle)]":"w-full"} overflow-auto p-6`,children:h?p.jsx("div",{className:"prose prose-sm max-w-none text-[var(--color-text)] prose-headings:text-[var(--color-text)] prose-headings:font-bold prose-h1:text-2xl prose-h1:border-b prose-h1:border-[var(--color-border-subtle)] prose-h1:pb-2 prose-h2:text-xl prose-h3:text-lg prose-h4:text-base prose-p:leading-relaxed prose-a:text-[var(--color-accent)] prose-strong:text-[var(--color-text)] prose-code:font-[var(--font-mono)] prose-code:text-xs prose-code:bg-[var(--color-surface-raised)] prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-pre:bg-[var(--color-surface-raised)] prose-pre:font-[var(--font-mono)] prose-li:marker:text-[var(--color-muted)] prose-blockquote:border-[var(--color-accent)] prose-blockquote:text-[var(--color-muted)] prose-hr:border-[var(--color-border-subtle)]",children:p.jsx(VM,{children:t})}):p.jsx("pre",{className:"text-sm font-[var(--font-mono)] whitespace-pre-wrap",children:t})})]})]})}function rie(t){const e=t.lastIndexOf("/_bmad/");return e>=0?t.slice(e+7):t}function iie(t){const e=t.replace(/\/$/,"").split("/");return e[e.length-1]??t}const sie={"steps-c":"Conditional","steps-e":"Editorial","steps-v":"Validation"};function aie(t){return t?sie[t]??t.replace(/^steps-/,"").replace(/-steps$/,"").split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):"Primary"}function lie(t){const e=new Map;return t.forEach((n,r)=>{const i=n.variantSet??"__primary";e.has(i)||e.set(i,{key:i,label:aie(n.variantSet),steps:[]}),e.get(i).steps.push({...n,globalIndex:r})}),Array.from(e.values()).sort((n,r)=>n.key==="__primary"?-1:r.key==="__primary"?1:n.key.localeCompare(r.key))}function oie({workflowId:t,onClose:e}){const{data:n,isLoading:r}=cM(t),[i,s]=C.useState(!1),[a,o]=C.useState(null),[u,d]=C.useState(null),[h,m]=C.useState(!1),[g,x]=C.useState(null),[v,b]=C.useState(null),[k,w]=C.useState(!1),[j,Q]=C.useState("__primary"),[E,R]=C.useState([]),[T,A]=C.useState(null),[I,W]=C.useState(null),[F,Z]=C.useState(!1),B=C.useRef(null),H=C.useRef(null),P=C.useRef(null);C.useEffect(()=>()=>{var $,z,q;($=B.current)==null||$.abort(),(z=H.current)==null||z.abort(),(q=P.current)==null||q.abort()},[]),C.useEffect(()=>{if(!n||n.type!=="agent-based"){R([]);return}fetch(`/api/workflows/${t}/supporting-files`).then($=>$.json()).then($=>R($.groups)).catch(()=>R([]))},[n,t]);const D=C.useCallback(async $=>{var q;if(T===$){A(null),W(null);return}(q=P.current)==null||q.abort();const z=new AbortController;if(P.current=z,A($),W(null),$.endsWith(".md")){Z(!0);try{const M=await fetch(`/api/files/${$}`,{signal:z.signal});if(M.ok){const G=await M.json();W(G.content)}else W("Could not load file.")}catch(M){if(M instanceof Error&&M.name==="AbortError")return;W("Failed to load file.")}finally{z.signal.aborted||Z(!1)}}},[T]),_=C.useMemo(()=>n?lie(n.steps):[],[n]),X=C.useMemo(()=>_.find($=>$.key===j)??_[0],[_,j]),Y=C.useCallback(async $=>{var q;if(a===$){o(null),d(null);return}(q=B.current)==null||q.abort();const z=new AbortController;B.current=z,o($),d(null),m(!0);try{const M=await fetch(`/api/workflows/${t}/steps/${$}`,{signal:z.signal});if(M.ok){const G=await M.json();d(G.content)}else d("Could not load step instructions.")}catch(M){if(M instanceof Error&&M.name==="AbortError")return;d("Failed to load step instructions.")}finally{z.signal.aborted||m(!1)}},[a,t]),V=C.useCallback(async $=>{var q;if(g===$){x(null),b(null);return}(q=H.current)==null||q.abort();const z=new AbortController;H.current=z,x($),b(null),w(!0);try{const M=rie($),G=await fetch(`/api/files/${M}`,{signal:z.signal});if(G.ok){const ie=await G.json();b(ie.content)}else b("Could not load template.")}catch(M){if(M instanceof Error&&M.name==="AbortError")return;b("Failed to load template.")}finally{z.signal.aborted||w(!1)}},[g]);return p.jsxs("div",{className:"slide-over-backdrop",onClick:$=>{$.target===$.currentTarget&&e()},children:[p.jsx("div",{className:"slide-over-bg",onClick:e}),p.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[p.jsx("h2",{className:"text-lg font-bold truncate",children:(n==null?void 0:n.name)??"Loading..."}),n&&p.jsx(gQ,{type:n.type})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[n&&p.jsx("button",{onClick:()=>s(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Workflow",children:p.jsx(Nu,{size:16})}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]})]}),r&&p.jsxs("div",{className:"p-6 space-y-3",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),n&&p.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[p.jsx("div",{children:p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:n.description})}),p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.module&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:n.module}),n.phase&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:n.phase})]}),n.steps.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Steps (",n.steps.length,")"]}),_.length>1&&p.jsx("div",{className:"flex gap-1 mb-3 flex-wrap bg-[var(--color-surface-raised)] rounded-md p-1",children:_.map($=>p.jsxs("button",{onClick:()=>Q($.key),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded transition-colors ${j===$.key?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[$.label,p.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)] font-bold",children:$.steps.length})]},$.key))}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mb-3",children:"Click a step to view its instructions"}),p.jsx("div",{className:"space-y-1.5",children:X==null?void 0:X.steps.map(($,z)=>{var G,ie,J,ne;const q=String(z+1).padStart(2,"0"),M=$.description?$.description.split(`
410
+ `)[0].slice(0,80)+($.description.length>80?"…":""):null;return p.jsxs("div",{className:$.isVariant?"ml-6 pl-4 border-l-2 border-[var(--color-border-subtle)]":"",children:[p.jsxs("button",{onClick:()=>$.filePath&&Y($.globalIndex),className:`w-full text-left px-3 py-2.5 rounded-lg border transition-colors ${a===$.globalIndex?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"} ${$.filePath?"cursor-pointer":""}`,children:[p.jsxs("div",{className:"flex items-center gap-2.5",children:[$.filePath?a===$.globalIndex?p.jsx(ra,{size:12,className:"text-[var(--color-accent)] shrink-0"}):p.jsx(ia,{size:12,className:"text-[var(--color-muted)] shrink-0"}):null,$.isVariant?p.jsx("span",{className:"text-xs text-[var(--color-muted)] shrink-0",children:"↳"}):p.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)] font-[var(--font-mono)] w-5 shrink-0 text-right",children:q}),p.jsx("span",{className:`text-sm font-bold truncate ${$.isVariant?"text-[var(--color-muted)]":""}`,children:$.title}),$.agent&&p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-accent)] font-bold shrink-0",children:[p.jsx(hi,{size:9}),$.agent]})]}),M&&p.jsx("p",{className:`text-xs mt-1 ml-[calc(12px+0.625rem+1.25rem)] truncate ${$.isVariant?"text-[var(--color-muted)]/60":"text-[var(--color-muted)]"}`,children:M}),(((G=$.inputs)==null?void 0:G.length)||((ie=$.outputs)==null?void 0:ie.length))&&p.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-1.5 ml-[calc(12px+0.625rem+1.25rem)]",children:[(J=$.inputs)==null?void 0:J.map(se=>p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:[p.jsx(P9,{size:9}),se]},se)),(ne=$.outputs)==null?void 0:ne.map(se=>p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-success)]",children:[p.jsx(qx,{size:9}),se]},se))]})]}),a===$.globalIndex&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-64",children:h?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(mi,{content:u??"",filePath:$.filePath,onChange:()=>{},readOnly:!0})})]},$.globalIndex)})})]}),n.templates&&n.templates.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Templates (",n.templates.length,")"]}),p.jsx("div",{className:"space-y-2",children:n.templates.map($=>p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>V($.filePath),className:`w-full flex items-center gap-2 p-3 rounded-lg border transition-colors cursor-pointer text-left ${g===$.filePath?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[g===$.filePath?p.jsx(ra,{size:12,className:"text-[var(--color-accent)]"}):p.jsx(ia,{size:12,className:"text-[var(--color-muted)]"}),p.jsx(To,{size:14,className:"text-[var(--color-muted)]"}),p.jsxs("span",{className:"text-sm",children:[$.name,".template.md"]})]}),g===$.filePath&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-48",children:k?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(mi,{content:v??"",filePath:$.filePath,onChange:()=>{},readOnly:!0})})]},$.filePath))})]}),n.subWorkflows&&n.subWorkflows.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Sub-Workflows (",n.subWorkflows.length,")"]}),p.jsx("div",{className:"space-y-1",children:n.subWorkflows.map($=>p.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsx(G9,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:$.name})]},$.filePath))})]}),n.type==="agent-based"&&E.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Agents & Resources"}),p.jsx("div",{className:"space-y-4",children:E.map($=>p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx(RN,{size:12,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-[var(--color-muted)]",children:$.name}),p.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)] font-bold",children:$.files.length})]}),p.jsx("div",{className:"space-y-1",children:$.files.map(z=>p.jsxs("div",{children:[z.name.endsWith(".md")?p.jsxs("button",{onClick:()=>D(z.relativePath),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors cursor-pointer text-left ${T===z.relativePath?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[T===z.relativePath?p.jsx(ra,{size:12,className:"text-[var(--color-accent)]"}):p.jsx(ia,{size:12,className:"text-[var(--color-muted)]"}),p.jsx(To,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:z.name})]}):p.jsxs(nr,{to:`/files?path=${encodeURIComponent(z.relativePath)}`,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(To,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm text-[var(--color-accent)] hover:underline",children:z.name})]}),T===z.relativePath&&z.name.endsWith(".md")&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-48",children:F?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(mi,{content:I??"",filePath:z.relativePath,onChange:()=>{},readOnly:!0})})]},z.relativePath))})]},$.name))})]}),n.type!=="agent-based"&&n.supportingFiles&&n.supportingFiles.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Supporting Files"}),p.jsx("div",{className:"space-y-1",children:n.supportingFiles.map($=>p.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsx(RN,{size:14,className:"text-[var(--color-muted)]"}),p.jsxs("span",{className:"text-sm",children:[iie($),"/"]})]},$))})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-muted)]",children:[p.jsx(Mi,{size:12}),p.jsx("span",{className:"font-[var(--font-mono)]",children:n.filePath})]})]})]}),i&&n&&p.jsx(FV,{workflow:n,onClose:()=>s(!1),onSaved:()=>s(!1)})]})}function gn(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,r;n<t.length;n++)(r=gn(t[n]))!==""&&(e+=(e&&" ")+r);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var cie={value:()=>{}};function lv(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new vO(n)}function vO(t){this._=t}function uie(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}vO.prototype=lv.prototype={constructor:vO,on:function(t,e){var n=this._,r=uie(t+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(t=r[s]).type)&&(i=die(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(i=(t=r[s]).type)n[i]=P_(n[i],t.name,e);else if(e==null)for(i in n)n[i]=P_(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new vO(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,s=r.length;i<s;++i)r[i].value.apply(e,n)}};function die(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function P_(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=cie,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Bw="http://www.w3.org/1999/xhtml";const __={svg:"http://www.w3.org/2000/svg",xhtml:Bw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ov(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),__.hasOwnProperty(e)?{space:__[e],local:t}:t}function fie(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Bw&&e.documentElement.namespaceURI===Bw?e.createElement(t):e.createElementNS(n,t)}}function hie(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pD(t){var e=ov(t);return(e.local?hie:fie)(e)}function pie(){}function K2(t){return t==null?pie:function(){return this.querySelector(t)}}function mie(t){typeof t!="function"&&(t=K2(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,o=r[i]=new Array(a),u,d,h=0;h<a;++h)(u=s[h])&&(d=t.call(u,u.__data__,h,s))&&("__data__"in u&&(d.__data__=u.__data__),o[h]=d);return new Vr(r,this._parents)}function gie(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Oie(){return[]}function mD(t){return t==null?Oie:function(){return this.querySelectorAll(t)}}function xie(t){return function(){return gie(t.apply(this,arguments))}}function vie(t){typeof t=="function"?t=xie(t):t=mD(t);for(var e=this._groups,n=e.length,r=[],i=[],s=0;s<n;++s)for(var a=e[s],o=a.length,u,d=0;d<o;++d)(u=a[d])&&(r.push(t.call(u,u.__data__,d,a)),i.push(u));return new Vr(r,i)}function gD(t){return function(){return this.matches(t)}}function OD(t){return function(e){return e.matches(t)}}var yie=Array.prototype.find;function bie(t){return function(){return yie.call(this.children,t)}}function Sie(){return this.firstElementChild}function wie(t){return this.select(t==null?Sie:bie(typeof t=="function"?t:OD(t)))}var kie=Array.prototype.filter;function Qie(){return Array.from(this.children)}function Cie(t){return function(){return kie.call(this.children,t)}}function jie(t){return this.selectAll(t==null?Qie:Cie(typeof t=="function"?t:OD(t)))}function Eie(t){typeof t!="function"&&(t=gD(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,o=r[i]=[],u,d=0;d<a;++d)(u=s[d])&&t.call(u,u.__data__,d,s)&&o.push(u);return new Vr(r,this._parents)}function xD(t){return new Array(t.length)}function $ie(){return new Vr(this._enter||this._groups.map(xD),this._parents)}function fx(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}fx.prototype={constructor:fx,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Nie(t){return function(){return t}}function Tie(t,e,n,r,i,s){for(var a=0,o,u=e.length,d=s.length;a<d;++a)(o=e[a])?(o.__data__=s[a],r[a]=o):n[a]=new fx(t,s[a]);for(;a<u;++a)(o=e[a])&&(i[a]=o)}function Pie(t,e,n,r,i,s,a){var o,u,d=new Map,h=e.length,m=s.length,g=new Array(h),x;for(o=0;o<h;++o)(u=e[o])&&(g[o]=x=a.call(u,u.__data__,o,e)+"",d.has(x)?i[o]=u:d.set(x,u));for(o=0;o<m;++o)x=a.call(t,s[o],o,s)+"",(u=d.get(x))?(r[o]=u,u.__data__=s[o],d.delete(x)):n[o]=new fx(t,s[o]);for(o=0;o<h;++o)(u=e[o])&&d.get(g[o])===u&&(i[o]=u)}function _ie(t){return t.__data__}function Aie(t,e){if(!arguments.length)return Array.from(this,_ie);var n=e?Pie:Tie,r=this._parents,i=this._groups;typeof t!="function"&&(t=Nie(t));for(var s=i.length,a=new Array(s),o=new Array(s),u=new Array(s),d=0;d<s;++d){var h=r[d],m=i[d],g=m.length,x=Rie(t.call(h,h&&h.__data__,d,r)),v=x.length,b=o[d]=new Array(v),k=a[d]=new Array(v),w=u[d]=new Array(g);n(h,m,b,k,w,x,e);for(var j=0,Q=0,E,R;j<v;++j)if(E=b[j]){for(j>=Q&&(Q=j+1);!(R=k[Q])&&++Q<v;);E._next=R||null}}return a=new Vr(a,r),a._enter=o,a._exit=u,a}function Rie(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Mie(){return new Vr(this._exit||this._groups.map(xD),this._parents)}function zie(t,e,n){var r=this.enter(),i=this,s=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Die(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),u=0;u<a;++u)for(var d=n[u],h=r[u],m=d.length,g=o[u]=new Array(m),x,v=0;v<m;++v)(x=d[v]||h[v])&&(g[v]=x);for(;u<i;++u)o[u]=n[u];return new Vr(o,this._parents)}function Lie(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Xie(t){t||(t=Zie);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,u=i[s]=new Array(o),d,h=0;h<o;++h)(d=a[h])&&(u[h]=d);u.sort(e)}return new Vr(i,this._parents).order()}function Zie(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Iie(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Bie(){return Array.from(this)}function qie(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function Vie(){let t=0;for(const e of this)++t;return t}function Yie(){return!this.node()}function Uie(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&t.call(o,o.__data__,s,i);return this}function Wie(t){return function(){this.removeAttribute(t)}}function Hie(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gie(t,e){return function(){this.setAttribute(t,e)}}function Fie(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Kie(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Jie(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ese(t,e){var n=ov(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Hie:Wie:typeof e=="function"?n.local?Jie:Kie:n.local?Fie:Gie)(n,e))}function vD(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function tse(t){return function(){this.style.removeProperty(t)}}function nse(t,e,n){return function(){this.style.setProperty(t,e,n)}}function rse(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ise(t,e,n){return arguments.length>1?this.each((e==null?tse:typeof e=="function"?rse:nse)(t,e,n??"")):qu(this.node(),t)}function qu(t,e){return t.style.getPropertyValue(e)||vD(t).getComputedStyle(t,null).getPropertyValue(e)}function sse(t){return function(){delete this[t]}}function ase(t,e){return function(){this[t]=e}}function lse(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function ose(t,e){return arguments.length>1?this.each((e==null?sse:typeof e=="function"?lse:ase)(t,e)):this.node()[t]}function yD(t){return t.trim().split(/^|\s+/)}function J2(t){return t.classList||new bD(t)}function bD(t){this._node=t,this._names=yD(t.getAttribute("class")||"")}bD.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function SD(t,e){for(var n=J2(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function wD(t,e){for(var n=J2(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function cse(t){return function(){SD(this,t)}}function use(t){return function(){wD(this,t)}}function dse(t,e){return function(){(e.apply(this,arguments)?SD:wD)(this,t)}}function fse(t,e){var n=yD(t+"");if(arguments.length<2){for(var r=J2(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?dse:e?cse:use)(n,e))}function hse(){this.textContent=""}function pse(t){return function(){this.textContent=t}}function mse(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function gse(t){return arguments.length?this.each(t==null?hse:(typeof t=="function"?mse:pse)(t)):this.node().textContent}function Ose(){this.innerHTML=""}function xse(t){return function(){this.innerHTML=t}}function vse(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function yse(t){return arguments.length?this.each(t==null?Ose:(typeof t=="function"?vse:xse)(t)):this.node().innerHTML}function bse(){this.nextSibling&&this.parentNode.appendChild(this)}function Sse(){return this.each(bse)}function wse(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function kse(){return this.each(wse)}function Qse(t){var e=typeof t=="function"?t:pD(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Cse(){return null}function jse(t,e){var n=typeof t=="function"?t:pD(t),r=e==null?Cse:typeof e=="function"?e:K2(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ese(){var t=this.parentNode;t&&t.removeChild(this)}function $se(){return this.each(Ese)}function Nse(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Tse(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Pse(t){return this.select(t?Tse:Nse)}function _se(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ase(t){return function(e){t.call(this,e,this.__data__)}}function Rse(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Mse(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++r]=s;++r?e.length=r:delete this.__on}}}function zse(t,e,n){return function(){var r=this.__on,i,s=Ase(e);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Dse(t,e,n){var r=Rse(t+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var u=0,d=o.length,h;u<d;++u)for(i=0,h=o[u];i<s;++i)if((a=r[i]).type===h.type&&a.name===h.name)return h.value}return}for(o=e?zse:Mse,i=0;i<s;++i)this.each(o(r[i],e,n));return this}function kD(t,e,n){var r=vD(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Lse(t,e){return function(){return kD(this,t,e)}}function Xse(t,e){return function(){return kD(this,t,e.apply(this,arguments))}}function Zse(t,e){return this.each((typeof e=="function"?Xse:Lse)(t,e))}function*Ise(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var QD=[null];function Vr(t,e){this._groups=t,this._parents=e}function Pp(){return new Vr([[document.documentElement]],QD)}function Bse(){return this}Vr.prototype=Pp.prototype={constructor:Vr,select:mie,selectAll:vie,selectChild:wie,selectChildren:jie,filter:Eie,data:Aie,enter:$ie,exit:Mie,join:zie,merge:Die,selection:Bse,order:Lie,sort:Xie,call:Iie,nodes:Bie,node:qie,size:Vie,empty:Yie,each:Uie,attr:ese,style:ise,property:ose,classed:fse,text:gse,html:yse,raise:Sse,lower:kse,append:Qse,insert:jse,remove:$se,clone:Pse,datum:_se,on:Dse,dispatch:Zse,[Symbol.iterator]:Ise};function Br(t){return typeof t=="string"?new Vr([[document.querySelector(t)]],[document.documentElement]):new Vr([[t]],QD)}function qse(t){let e;for(;e=t.sourceEvent;)t=e;return t}function $i(t,e){if(t=qse(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Vse={passive:!1},Uh={capture:!0,passive:!1};function W0(t){t.stopImmediatePropagation()}function mu(t){t.preventDefault(),t.stopImmediatePropagation()}function CD(t){var e=t.document.documentElement,n=Br(t).on("dragstart.drag",mu,Uh);"onselectstart"in e?n.on("selectstart.drag",mu,Uh):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function jD(t,e){var n=t.document.documentElement,r=Br(t).on("dragstart.drag",null);e&&(r.on("click.drag",mu,Uh),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const qg=t=>()=>t;function qw(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:s,x:a,y:o,dx:u,dy:d,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:h}})}qw.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Yse(t){return!t.ctrlKey&&!t.button}function Use(){return this.parentNode}function Wse(t,e){return e??{x:t.x,y:t.y}}function Hse(){return navigator.maxTouchPoints||"ontouchstart"in this}function ED(){var t=Yse,e=Use,n=Wse,r=Hse,i={},s=lv("start","drag","end"),a=0,o,u,d,h,m=0;function g(E){E.on("mousedown.drag",x).filter(r).on("touchstart.drag",k).on("touchmove.drag",w,Vse).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(E,R){if(!(h||!t.call(this,E,R))){var T=Q(this,e.call(this,E,R),E,R,"mouse");T&&(Br(E.view).on("mousemove.drag",v,Uh).on("mouseup.drag",b,Uh),CD(E.view),W0(E),d=!1,o=E.clientX,u=E.clientY,T("start",E))}}function v(E){if(mu(E),!d){var R=E.clientX-o,T=E.clientY-u;d=R*R+T*T>m}i.mouse("drag",E)}function b(E){Br(E.view).on("mousemove.drag mouseup.drag",null),jD(E.view,d),mu(E),i.mouse("end",E)}function k(E,R){if(t.call(this,E,R)){var T=E.changedTouches,A=e.call(this,E,R),I=T.length,W,F;for(W=0;W<I;++W)(F=Q(this,A,E,R,T[W].identifier,T[W]))&&(W0(E),F("start",E,T[W]))}}function w(E){var R=E.changedTouches,T=R.length,A,I;for(A=0;A<T;++A)(I=i[R[A].identifier])&&(mu(E),I("drag",E,R[A]))}function j(E){var R=E.changedTouches,T=R.length,A,I;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),A=0;A<T;++A)(I=i[R[A].identifier])&&(W0(E),I("end",E,R[A]))}function Q(E,R,T,A,I,W){var F=s.copy(),Z=$i(W||T,R),B,H,P;if((P=n.call(E,new qw("beforestart",{sourceEvent:T,target:g,identifier:I,active:a,x:Z[0],y:Z[1],dx:0,dy:0,dispatch:F}),A))!=null)return B=P.x-Z[0]||0,H=P.y-Z[1]||0,function D(_,X,Y){var V=Z,$;switch(_){case"start":i[I]=D,$=a++;break;case"end":delete i[I],--a;case"drag":Z=$i(Y||X,R),$=a;break}F.call(_,E,new qw(_,{sourceEvent:X,subject:P,target:g,identifier:I,active:$,x:Z[0]+B,y:Z[1]+H,dx:Z[0]-V[0],dy:Z[1]-V[1],dispatch:F}),A)}}return g.filter=function(E){return arguments.length?(t=typeof E=="function"?E:qg(!!E),g):t},g.container=function(E){return arguments.length?(e=typeof E=="function"?E:qg(E),g):e},g.subject=function(E){return arguments.length?(n=typeof E=="function"?E:qg(E),g):n},g.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:qg(!!E),g):r},g.on=function(){var E=s.on.apply(s,arguments);return E===s?g:E},g.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,g):Math.sqrt(m)},g}function eQ(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $D(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function _p(){}var Wh=.7,hx=1/Wh,gu="\\s*([+-]?\\d+)\\s*",Hh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ys="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gse=/^#([0-9a-f]{3,8})$/,Fse=new RegExp(`^rgb\\(${gu},${gu},${gu}\\)$`),Kse=new RegExp(`^rgb\\(${ys},${ys},${ys}\\)$`),Jse=new RegExp(`^rgba\\(${gu},${gu},${gu},${Hh}\\)$`),eae=new RegExp(`^rgba\\(${ys},${ys},${ys},${Hh}\\)$`),tae=new RegExp(`^hsl\\(${Hh},${ys},${ys}\\)$`),nae=new RegExp(`^hsla\\(${Hh},${ys},${ys},${Hh}\\)$`),A_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};eQ(_p,Xo,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:R_,formatHex:R_,formatHex8:rae,formatHsl:iae,formatRgb:M_,toString:M_});function R_(){return this.rgb().formatHex()}function rae(){return this.rgb().formatHex8()}function iae(){return ND(this).formatHsl()}function M_(){return this.rgb().formatRgb()}function Xo(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Gse.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?z_(e):n===3?new wr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Vg(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Vg(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Fse.exec(t))?new wr(e[1],e[2],e[3],1):(e=Kse.exec(t))?new wr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Jse.exec(t))?Vg(e[1],e[2],e[3],e[4]):(e=eae.exec(t))?Vg(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tae.exec(t))?X_(e[1],e[2]/100,e[3]/100,1):(e=nae.exec(t))?X_(e[1],e[2]/100,e[3]/100,e[4]):A_.hasOwnProperty(t)?z_(A_[t]):t==="transparent"?new wr(NaN,NaN,NaN,0):null}function z_(t){return new wr(t>>16&255,t>>8&255,t&255,1)}function Vg(t,e,n,r){return r<=0&&(t=e=n=NaN),new wr(t,e,n,r)}function sae(t){return t instanceof _p||(t=Xo(t)),t?(t=t.rgb(),new wr(t.r,t.g,t.b,t.opacity)):new wr}function Vw(t,e,n,r){return arguments.length===1?sae(t):new wr(t,e,n,r??1)}function wr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}eQ(wr,Vw,$D(_p,{brighter(t){return t=t==null?hx:Math.pow(hx,t),new wr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wh:Math.pow(Wh,t),new wr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new wr(_o(this.r),_o(this.g),_o(this.b),px(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:D_,formatHex:D_,formatHex8:aae,formatRgb:L_,toString:L_}));function D_(){return`#${bo(this.r)}${bo(this.g)}${bo(this.b)}`}function aae(){return`#${bo(this.r)}${bo(this.g)}${bo(this.b)}${bo((isNaN(this.opacity)?1:this.opacity)*255)}`}function L_(){const t=px(this.opacity);return`${t===1?"rgb(":"rgba("}${_o(this.r)}, ${_o(this.g)}, ${_o(this.b)}${t===1?")":`, ${t})`}`}function px(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function _o(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bo(t){return t=_o(t),(t<16?"0":"")+t.toString(16)}function X_(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pi(t,e,n,r)}function ND(t){if(t instanceof Pi)return new Pi(t.h,t.s,t.l,t.opacity);if(t instanceof _p||(t=Xo(t)),!t)return new Pi;if(t instanceof Pi)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),a=NaN,o=s-i,u=(s+i)/2;return o?(e===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-e)/o+2:a=(e-n)/o+4,o/=u<.5?s+i:2-s-i,a*=60):o=u>0&&u<1?0:a,new Pi(a,o,u,t.opacity)}function lae(t,e,n,r){return arguments.length===1?ND(t):new Pi(t,e,n,r??1)}function Pi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}eQ(Pi,lae,$D(_p,{brighter(t){return t=t==null?hx:Math.pow(hx,t),new Pi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wh:Math.pow(Wh,t),new Pi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new wr(H0(t>=240?t-240:t+120,i,r),H0(t,i,r),H0(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Pi(Z_(this.h),Yg(this.s),Yg(this.l),px(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=px(this.opacity);return`${t===1?"hsl(":"hsla("}${Z_(this.h)}, ${Yg(this.s)*100}%, ${Yg(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Z_(t){return t=(t||0)%360,t<0?t+360:t}function Yg(t){return Math.max(0,Math.min(1,t||0))}function H0(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const tQ=t=>()=>t;function oae(t,e){return function(n){return t+n*e}}function cae(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function uae(t){return(t=+t)==1?TD:function(e,n){return n-e?cae(e,n,t):tQ(isNaN(e)?n:e)}}function TD(t,e){var n=e-t;return n?oae(t,n):tQ(isNaN(t)?e:t)}const mx=(function t(e){var n=uae(e);function r(i,s){var a=n((i=Vw(i)).r,(s=Vw(s)).r),o=n(i.g,s.g),u=n(i.b,s.b),d=TD(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=u(h),i.opacity=d(h),i+""}}return r.gamma=t,r})(1);function dae(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=t[i]*(1-s)+e[i]*s;return r}}function fae(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function hae(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=ph(t[a],e[a]);for(;a<n;++a)s[a]=e[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function pae(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function os(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function mae(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=ph(t[i],e[i]):r[i]=e[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Yw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,G0=new RegExp(Yw.source,"g");function gae(t){return function(){return t}}function Oae(t){return function(e){return t(e)+""}}function PD(t,e){var n=Yw.lastIndex=G0.lastIndex=0,r,i,s,a=-1,o=[],u=[];for(t=t+"",e=e+"";(r=Yw.exec(t))&&(i=G0.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,u.push({i:a,x:os(r,i)})),n=G0.lastIndex;return n<e.length&&(s=e.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?u[0]?Oae(u[0].x):gae(e):(e=u.length,function(d){for(var h=0,m;h<e;++h)o[(m=u[h]).i]=m.x(d);return o.join("")})}function ph(t,e){var n=typeof e,r;return e==null||n==="boolean"?tQ(e):(n==="number"?os:n==="string"?(r=Xo(e))?(e=r,mx):PD:e instanceof Xo?mx:e instanceof Date?pae:fae(e)?dae:Array.isArray(e)?hae:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?mae:os)(t,e)}var I_=180/Math.PI,Uw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _D(t,e,n,r,i,s){var a,o,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,u/=o),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(e,t)*I_,skewX:Math.atan(u)*I_,scaleX:a,scaleY:o}}var Ug;function xae(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Uw:_D(e.a,e.b,e.c,e.d,e.e,e.f)}function vae(t){return t==null||(Ug||(Ug=document.createElementNS("http://www.w3.org/2000/svg","g")),Ug.setAttribute("transform",t),!(t=Ug.transform.baseVal.consolidate()))?Uw:(t=t.matrix,_D(t.a,t.b,t.c,t.d,t.e,t.f))}function AD(t,e,n,r){function i(d){return d.length?d.pop()+" ":""}function s(d,h,m,g,x,v){if(d!==m||h!==g){var b=x.push("translate(",null,e,null,n);v.push({i:b-4,x:os(d,m)},{i:b-2,x:os(h,g)})}else(m||g)&&x.push("translate("+m+e+g+n)}function a(d,h,m,g){d!==h?(d-h>180?h+=360:h-d>180&&(d+=360),g.push({i:m.push(i(m)+"rotate(",null,r)-2,x:os(d,h)})):h&&m.push(i(m)+"rotate("+h+r)}function o(d,h,m,g){d!==h?g.push({i:m.push(i(m)+"skewX(",null,r)-2,x:os(d,h)}):h&&m.push(i(m)+"skewX("+h+r)}function u(d,h,m,g,x,v){if(d!==m||h!==g){var b=x.push(i(x)+"scale(",null,",",null,")");v.push({i:b-4,x:os(d,m)},{i:b-2,x:os(h,g)})}else(m!==1||g!==1)&&x.push(i(x)+"scale("+m+","+g+")")}return function(d,h){var m=[],g=[];return d=t(d),h=t(h),s(d.translateX,d.translateY,h.translateX,h.translateY,m,g),a(d.rotate,h.rotate,m,g),o(d.skewX,h.skewX,m,g),u(d.scaleX,d.scaleY,h.scaleX,h.scaleY,m,g),d=h=null,function(x){for(var v=-1,b=g.length,k;++v<b;)m[(k=g[v]).i]=k.x(x);return m.join("")}}}var yae=AD(xae,"px, ","px)","deg)"),bae=AD(vae,", ",")",")"),Sae=1e-12;function B_(t){return((t=Math.exp(t))+1/t)/2}function wae(t){return((t=Math.exp(t))-1/t)/2}function kae(t){return((t=Math.exp(2*t))-1)/(t+1)}const yO=(function t(e,n,r){function i(s,a){var o=s[0],u=s[1],d=s[2],h=a[0],m=a[1],g=a[2],x=h-o,v=m-u,b=x*x+v*v,k,w;if(b<Sae)w=Math.log(g/d)/e,k=function(A){return[o+A*x,u+A*v,d*Math.exp(e*A*w)]};else{var j=Math.sqrt(b),Q=(g*g-d*d+r*b)/(2*d*n*j),E=(g*g-d*d-r*b)/(2*g*n*j),R=Math.log(Math.sqrt(Q*Q+1)-Q),T=Math.log(Math.sqrt(E*E+1)-E);w=(T-R)/e,k=function(A){var I=A*w,W=B_(R),F=d/(n*j)*(W*kae(e*I+R)-wae(R));return[o+F*x,u+F*v,d*W/B_(e*I+R)]}}return k.duration=w*1e3*e/Math.SQRT2,k}return i.rho=function(s){var a=Math.max(.001,+s),o=a*a,u=o*o;return t(a,o,u)},i})(Math.SQRT2,2,4);var Vu=0,If=0,_f=0,RD=1e3,gx,Bf,Ox=0,Zo=0,cv=0,Gh=typeof performance=="object"&&performance.now?performance:Date,MD=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function nQ(){return Zo||(MD(Qae),Zo=Gh.now()+cv)}function Qae(){Zo=0}function xx(){this._call=this._time=this._next=null}xx.prototype=zD.prototype={constructor:xx,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?nQ():+n)+(e==null?0:+e),!this._next&&Bf!==this&&(Bf?Bf._next=this:gx=this,Bf=this),this._call=t,this._time=n,Ww()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ww())}};function zD(t,e,n){var r=new xx;return r.restart(t,e,n),r}function Cae(){nQ(),++Vu;for(var t=gx,e;t;)(e=Zo-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Vu}function q_(){Zo=(Ox=Gh.now())+cv,Vu=If=0;try{Cae()}finally{Vu=0,Eae(),Zo=0}}function jae(){var t=Gh.now(),e=t-Ox;e>RD&&(cv-=e,Ox=t)}function Eae(){for(var t,e=gx,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:gx=n);Bf=t,Ww(r)}function Ww(t){if(!Vu){If&&(If=clearTimeout(If));var e=t-Zo;e>24?(t<1/0&&(If=setTimeout(q_,t-Gh.now()-cv)),_f&&(_f=clearInterval(_f))):(_f||(Ox=Gh.now(),_f=setInterval(jae,RD)),Vu=1,MD(q_))}}function V_(t,e,n){var r=new xx;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var $ae=lv("start","end","cancel","interrupt"),Nae=[],DD=0,Y_=1,Hw=2,bO=3,U_=4,Gw=5,SO=6;function uv(t,e,n,r,i,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Tae(t,n,{name:e,index:r,group:i,on:$ae,tween:Nae,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:DD})}function rQ(t,e){var n=Bi(t,e);if(n.state>DD)throw new Error("too late; already scheduled");return n}function Cs(t,e){var n=Bi(t,e);if(n.state>bO)throw new Error("too late; already running");return n}function Bi(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Tae(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=zD(s,0,n.time);function s(d){n.state=Y_,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var h,m,g,x;if(n.state!==Y_)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===bO)return V_(a);x.state===U_?(x.state=SO,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[h]):+h<e&&(x.state=SO,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete r[h])}if(V_(function(){n.state===bO&&(n.state=U_,n.timer.restart(o,n.delay,n.time),o(d))}),n.state=Hw,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Hw){for(n.state=bO,i=new Array(g=n.tween.length),h=0,m=-1;h<g;++h)(x=n.tween[h].value.call(t,t.__data__,n.index,n.group))&&(i[++m]=x);i.length=m+1}}function o(d){for(var h=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=Gw,1),m=-1,g=i.length;++m<g;)i[m].call(t,h);n.state===Gw&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=SO,n.timer.stop(),delete r[e];for(var d in r)return;delete t.__transition}}function wO(t,e){var n=t.__transition,r,i,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){s=!1;continue}i=r.state>Hw&&r.state<Gw,r.state=SO,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}s&&delete t.__transition}}function Pae(t){return this.each(function(){wO(this,t)})}function _ae(t,e){var n,r;return function(){var i=Cs(this,t),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Aae(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Cs(this,t),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:e,value:n},u=0,d=i.length;u<d;++u)if(i[u].name===e){i[u]=o;break}u===d&&i.push(o)}s.tween=i}}function Rae(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Bi(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?_ae:Aae)(n,t,e))}function iQ(t,e,n){var r=t._id;return t.each(function(){var i=Cs(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Bi(i,r).value[e]}}function LD(t,e){var n;return(typeof e=="number"?os:e instanceof Xo?mx:(n=Xo(e))?(e=n,mx):PD)(t,e)}function Mae(t){return function(){this.removeAttribute(t)}}function zae(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Dae(t,e,n){var r,i=n+"",s;return function(){var a=this.getAttribute(t);return a===i?null:a===r?s:s=e(r=a,n)}}function Lae(t,e,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?s:s=e(r=a,n)}}function Xae(t,e,n){var r,i,s;return function(){var a,o=n(this),u;return o==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=o+"",a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,o)))}}function Zae(t,e,n){var r,i,s;return function(){var a,o=n(this),u;return o==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=o+"",a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,o)))}}function Iae(t,e){var n=ov(t),r=n==="transform"?bae:LD;return this.attrTween(t,typeof e=="function"?(n.local?Zae:Xae)(n,r,iQ(this,"attr."+t,e)):e==null?(n.local?zae:Mae)(n):(n.local?Lae:Dae)(n,r,e))}function Bae(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function qae(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Vae(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&qae(t,s)),n}return i._value=e,i}function Yae(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&Bae(t,s)),n}return i._value=e,i}function Uae(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=ov(t);return this.tween(n,(r.local?Vae:Yae)(r,e))}function Wae(t,e){return function(){rQ(this,t).delay=+e.apply(this,arguments)}}function Hae(t,e){return e=+e,function(){rQ(this,t).delay=e}}function Gae(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Wae:Hae)(e,t)):Bi(this.node(),e).delay}function Fae(t,e){return function(){Cs(this,t).duration=+e.apply(this,arguments)}}function Kae(t,e){return e=+e,function(){Cs(this,t).duration=e}}function Jae(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Fae:Kae)(e,t)):Bi(this.node(),e).duration}function ele(t,e){if(typeof e!="function")throw new Error;return function(){Cs(this,t).ease=e}}function tle(t){var e=this._id;return arguments.length?this.each(ele(e,t)):Bi(this.node(),e).ease}function nle(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Cs(this,t).ease=n}}function rle(t){if(typeof t!="function")throw new Error;return this.each(nle(this._id,t))}function ile(t){typeof t!="function"&&(t=gD(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,o=r[i]=[],u,d=0;d<a;++d)(u=s[d])&&t.call(u,u.__data__,d,s)&&o.push(u);return new ga(r,this._parents,this._name,this._id)}function sle(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var u=e[o],d=n[o],h=u.length,m=a[o]=new Array(h),g,x=0;x<h;++x)(g=u[x]||d[x])&&(m[x]=g);for(;o<r;++o)a[o]=e[o];return new ga(a,this._parents,this._name,this._id)}function ale(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function lle(t,e,n){var r,i,s=ale(e)?rQ:Cs;return function(){var a=s(this,t),o=a.on;o!==r&&(i=(r=o).copy()).on(e,n),a.on=i}}function ole(t,e){var n=this._id;return arguments.length<2?Bi(this.node(),n).on.on(t):this.each(lle(n,t,e))}function cle(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ule(){return this.on("end.remove",cle(this._id))}function dle(t){var e=this._name,n=this._id;typeof t!="function"&&(t=K2(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],u=o.length,d=s[a]=new Array(u),h,m,g=0;g<u;++g)(h=o[g])&&(m=t.call(h,h.__data__,g,o))&&("__data__"in h&&(m.__data__=h.__data__),d[g]=m,uv(d[g],e,n,g,d,Bi(h,n)));return new ga(s,this._parents,e,n)}function fle(t){var e=this._name,n=this._id;typeof t!="function"&&(t=mD(t));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var u=r[o],d=u.length,h,m=0;m<d;++m)if(h=u[m]){for(var g=t.call(h,h.__data__,m,u),x,v=Bi(h,n),b=0,k=g.length;b<k;++b)(x=g[b])&&uv(x,e,n,b,g,v);s.push(g),a.push(h)}return new ga(s,a,e,n)}var hle=Pp.prototype.constructor;function ple(){return new hle(this._groups,this._parents)}function mle(t,e){var n,r,i;return function(){var s=qu(this,t),a=(this.style.removeProperty(t),qu(this,t));return s===a?null:s===n&&a===r?i:i=e(n=s,r=a)}}function XD(t){return function(){this.style.removeProperty(t)}}function gle(t,e,n){var r,i=n+"",s;return function(){var a=qu(this,t);return a===i?null:a===r?s:s=e(r=a,n)}}function Ole(t,e,n){var r,i,s;return function(){var a=qu(this,t),o=n(this),u=o+"";return o==null&&(u=o=(this.style.removeProperty(t),qu(this,t))),a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,o))}}function xle(t,e){var n,r,i,s="style."+e,a="end."+s,o;return function(){var u=Cs(this,t),d=u.on,h=u.value[s]==null?o||(o=XD(e)):void 0;(d!==n||i!==h)&&(r=(n=d).copy()).on(a,i=h),u.on=r}}function vle(t,e,n){var r=(t+="")=="transform"?yae:LD;return e==null?this.styleTween(t,mle(t,r)).on("end.style."+t,XD(t)):typeof e=="function"?this.styleTween(t,Ole(t,r,iQ(this,"style."+t,e))).each(xle(this._id,t)):this.styleTween(t,gle(t,r,e),n).on("end.style."+t,null)}function yle(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ble(t,e,n){var r,i;function s(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&yle(t,a,n)),r}return s._value=e,s}function Sle(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,ble(t,e,n??""))}function wle(t){return function(){this.textContent=t}}function kle(t){return function(){var e=t(this);this.textContent=e??""}}function Qle(t){return this.tween("text",typeof t=="function"?kle(iQ(this,"text",t)):wle(t==null?"":t+""))}function Cle(t){return function(e){this.textContent=t.call(this,e)}}function jle(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Cle(i)),e}return r._value=t,r}function Ele(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,jle(t))}function $le(){for(var t=this._name,e=this._id,n=ZD(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,u,d=0;d<o;++d)if(u=a[d]){var h=Bi(u,e);uv(u,t,n,d,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new ga(r,this._parents,t,n)}function Nle(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},u={value:function(){--i===0&&s()}};n.each(function(){var d=Cs(this,r),h=d.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(u)),d.on=e}),i===0&&s()})}var Tle=0;function ga(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function ZD(){return++Tle}var Hs=Pp.prototype;ga.prototype={constructor:ga,select:dle,selectAll:fle,selectChild:Hs.selectChild,selectChildren:Hs.selectChildren,filter:ile,merge:sle,selection:ple,transition:$le,call:Hs.call,nodes:Hs.nodes,node:Hs.node,size:Hs.size,empty:Hs.empty,each:Hs.each,on:ole,attr:Iae,attrTween:Uae,style:vle,styleTween:Sle,text:Qle,textTween:Ele,remove:ule,tween:Rae,delay:Gae,duration:Jae,ease:tle,easeVarying:rle,end:Nle,[Symbol.iterator]:Hs[Symbol.iterator]};function Ple(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var _le={time:null,delay:0,duration:250,ease:Ple};function Ale(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Rle(t){var e,n;t instanceof ga?(e=t._id,t=t._name):(e=ZD(),(n=_le).time=nQ(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,u,d=0;d<o;++d)(u=a[d])&&uv(u,t,e,d,a,n||Ale(u,e));return new ga(r,this._parents,t,e)}Pp.prototype.interrupt=Pae;Pp.prototype.transition=Rle;const Wg=t=>()=>t;function Mle(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function na(t,e,n){this.k=t,this.x=e,this.y=n}na.prototype={constructor:na,scale:function(t){return t===1?this:new na(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new na(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var dv=new na(1,0,0);ID.prototype=na.prototype;function ID(t){for(;!t.__zoom;)if(!(t=t.parentNode))return dv;return t.__zoom}function F0(t){t.stopImmediatePropagation()}function Af(t){t.preventDefault(),t.stopImmediatePropagation()}function zle(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Dle(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function W_(){return this.__zoom||dv}function Lle(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Xle(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zle(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function BD(){var t=zle,e=Dle,n=Zle,r=Lle,i=Xle,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,u=yO,d=lv("start","zoom","end"),h,m,g,x=500,v=150,b=0,k=10;function w(P){P.property("__zoom",W_).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",Z).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(P,D,_,X){var Y=P.selection?P.selection():P;Y.property("__zoom",W_),P!==Y?R(P,D,_,X):Y.interrupt().each(function(){T(this,arguments).event(X).start().zoom(null,typeof D=="function"?D.apply(this,arguments):D).end()})},w.scaleBy=function(P,D,_,X){w.scaleTo(P,function(){var Y=this.__zoom.k,V=typeof D=="function"?D.apply(this,arguments):D;return Y*V},_,X)},w.scaleTo=function(P,D,_,X){w.transform(P,function(){var Y=e.apply(this,arguments),V=this.__zoom,$=_==null?E(Y):typeof _=="function"?_.apply(this,arguments):_,z=V.invert($),q=typeof D=="function"?D.apply(this,arguments):D;return n(Q(j(V,q),$,z),Y,a)},_,X)},w.translateBy=function(P,D,_,X){w.transform(P,function(){return n(this.__zoom.translate(typeof D=="function"?D.apply(this,arguments):D,typeof _=="function"?_.apply(this,arguments):_),e.apply(this,arguments),a)},null,X)},w.translateTo=function(P,D,_,X,Y){w.transform(P,function(){var V=e.apply(this,arguments),$=this.__zoom,z=X==null?E(V):typeof X=="function"?X.apply(this,arguments):X;return n(dv.translate(z[0],z[1]).scale($.k).translate(typeof D=="function"?-D.apply(this,arguments):-D,typeof _=="function"?-_.apply(this,arguments):-_),V,a)},X,Y)};function j(P,D){return D=Math.max(s[0],Math.min(s[1],D)),D===P.k?P:new na(D,P.x,P.y)}function Q(P,D,_){var X=D[0]-_[0]*P.k,Y=D[1]-_[1]*P.k;return X===P.x&&Y===P.y?P:new na(P.k,X,Y)}function E(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function R(P,D,_,X){P.on("start.zoom",function(){T(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(X).end()}).tween("zoom",function(){var Y=this,V=arguments,$=T(Y,V).event(X),z=e.apply(Y,V),q=_==null?E(z):typeof _=="function"?_.apply(Y,V):_,M=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),G=Y.__zoom,ie=typeof D=="function"?D.apply(Y,V):D,J=u(G.invert(q).concat(M/G.k),ie.invert(q).concat(M/ie.k));return function(ne){if(ne===1)ne=ie;else{var se=J(ne),pe=M/se[2];ne=new na(pe,q[0]-se[0]*pe,q[1]-se[1]*pe)}$.zoom(null,ne)}})}function T(P,D,_){return!_&&P.__zooming||new A(P,D)}function A(P,D){this.that=P,this.args=D,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,D),this.taps=0}A.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,D){return this.mouse&&P!=="mouse"&&(this.mouse[1]=D.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=D.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=D.invert(this.touch1[0])),this.that.__zoom=D,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var D=Br(this.that).datum();d.call(P,this.that,new Mle(P,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:d}),D)}};function I(P,...D){if(!t.apply(this,arguments))return;var _=T(this,D).event(P),X=this.__zoom,Y=Math.max(s[0],Math.min(s[1],X.k*Math.pow(2,r.apply(this,arguments)))),V=$i(P);if(_.wheel)(_.mouse[0][0]!==V[0]||_.mouse[0][1]!==V[1])&&(_.mouse[1]=X.invert(_.mouse[0]=V)),clearTimeout(_.wheel);else{if(X.k===Y)return;_.mouse=[V,X.invert(V)],wO(this),_.start()}Af(P),_.wheel=setTimeout($,v),_.zoom("mouse",n(Q(j(X,Y),_.mouse[0],_.mouse[1]),_.extent,a));function $(){_.wheel=null,_.end()}}function W(P,...D){if(g||!t.apply(this,arguments))return;var _=P.currentTarget,X=T(this,D,!0).event(P),Y=Br(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",M,!0),V=$i(P,_),$=P.clientX,z=P.clientY;CD(P.view),F0(P),X.mouse=[V,this.__zoom.invert(V)],wO(this),X.start();function q(G){if(Af(G),!X.moved){var ie=G.clientX-$,J=G.clientY-z;X.moved=ie*ie+J*J>b}X.event(G).zoom("mouse",n(Q(X.that.__zoom,X.mouse[0]=$i(G,_),X.mouse[1]),X.extent,a))}function M(G){Y.on("mousemove.zoom mouseup.zoom",null),jD(G.view,X.moved),Af(G),X.event(G).end()}}function F(P,...D){if(t.apply(this,arguments)){var _=this.__zoom,X=$i(P.changedTouches?P.changedTouches[0]:P,this),Y=_.invert(X),V=_.k*(P.shiftKey?.5:2),$=n(Q(j(_,V),X,Y),e.apply(this,D),a);Af(P),o>0?Br(this).transition().duration(o).call(R,$,X,P):Br(this).call(w.transform,$,X,P)}}function Z(P,...D){if(t.apply(this,arguments)){var _=P.touches,X=_.length,Y=T(this,D,P.changedTouches.length===X).event(P),V,$,z,q;for(F0(P),$=0;$<X;++$)z=_[$],q=$i(z,this),q=[q,this.__zoom.invert(q),z.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==q[2]&&(Y.touch1=q,Y.taps=0):(Y.touch0=q,V=!0,Y.taps=1+!!h);h&&(h=clearTimeout(h)),V&&(Y.taps<2&&(m=q[0],h=setTimeout(function(){h=null},x)),wO(this),Y.start())}}function B(P,...D){if(this.__zooming){var _=T(this,D).event(P),X=P.changedTouches,Y=X.length,V,$,z,q;for(Af(P),V=0;V<Y;++V)$=X[V],z=$i($,this),_.touch0&&_.touch0[2]===$.identifier?_.touch0[0]=z:_.touch1&&_.touch1[2]===$.identifier&&(_.touch1[0]=z);if($=_.that.__zoom,_.touch1){var M=_.touch0[0],G=_.touch0[1],ie=_.touch1[0],J=_.touch1[1],ne=(ne=ie[0]-M[0])*ne+(ne=ie[1]-M[1])*ne,se=(se=J[0]-G[0])*se+(se=J[1]-G[1])*se;$=j($,Math.sqrt(ne/se)),z=[(M[0]+ie[0])/2,(M[1]+ie[1])/2],q=[(G[0]+J[0])/2,(G[1]+J[1])/2]}else if(_.touch0)z=_.touch0[0],q=_.touch0[1];else return;_.zoom("touch",n(Q($,z,q),_.extent,a))}}function H(P,...D){if(this.__zooming){var _=T(this,D).event(P),X=P.changedTouches,Y=X.length,V,$;for(F0(P),g&&clearTimeout(g),g=setTimeout(function(){g=null},x),V=0;V<Y;++V)$=X[V],_.touch0&&_.touch0[2]===$.identifier?delete _.touch0:_.touch1&&_.touch1[2]===$.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&($=$i($,this),Math.hypot(m[0]-$[0],m[1]-$[1])<k)){var z=Br(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return w.wheelDelta=function(P){return arguments.length?(r=typeof P=="function"?P:Wg(+P),w):r},w.filter=function(P){return arguments.length?(t=typeof P=="function"?P:Wg(!!P),w):t},w.touchable=function(P){return arguments.length?(i=typeof P=="function"?P:Wg(!!P),w):i},w.extent=function(P){return arguments.length?(e=typeof P=="function"?P:Wg([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),w):e},w.scaleExtent=function(P){return arguments.length?(s[0]=+P[0],s[1]=+P[1],w):[s[0],s[1]]},w.translateExtent=function(P){return arguments.length?(a[0][0]=+P[0][0],a[1][0]=+P[1][0],a[0][1]=+P[0][1],a[1][1]=+P[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(P){return arguments.length?(n=P,w):n},w.duration=function(P){return arguments.length?(o=+P,w):o},w.interpolate=function(P){return arguments.length?(u=P,w):u},w.on=function(){var P=d.on.apply(d,arguments);return P===d?w:P},w.clickDistance=function(P){return arguments.length?(b=(P=+P)*P,w):Math.sqrt(b)},w.tapDistance=function(P){return arguments.length?(k=+P,w):k},w}const Ss={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:r}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Fh=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],qD=["Enter"," ","Escape"],VD={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Yu;(function(t){t.Strict="strict",t.Loose="loose"})(Yu||(Yu={}));var Ao;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ao||(Ao={}));var Kh;(function(t){t.Partial="partial",t.Full="full"})(Kh||(Kh={}));const YD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ul;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(ul||(ul={}));var vx;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(vx||(vx={}));var $e;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})($e||($e={}));const H_={[$e.Left]:$e.Right,[$e.Right]:$e.Left,[$e.Top]:$e.Bottom,[$e.Bottom]:$e.Top};function UD(t){return t===null?null:t?"valid":"invalid"}const WD=t=>"id"in t&&"source"in t&&"target"in t,Ile=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),sQ=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ap=(t,e=[0,0])=>{const{width:n,height:r}=ba(t),i=t.origin??e,s=n*i[0],a=r*i[1];return{x:t.position.x-s,y:t.position.y-a}},Ble=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((r,i)=>{const s=typeof i=="string";let a=!e.nodeLookup&&!s?i:void 0;e.nodeLookup&&(a=s?e.nodeLookup.get(i):sQ(i)?i:e.nodeLookup.get(i.id));const o=a?yx(a,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return fv(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return hv(n)},Rp=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return t.forEach(i=>{(e.filter===void 0||e.filter(i))&&(n=fv(n,yx(i)),r=!0)}),r?hv(n):{x:0,y:0,width:0,height:0}},aQ=(t,e,[n,r,i]=[0,0,1],s=!1,a=!1)=>{const o={...zp(e,[n,r,i]),width:e.width/i,height:e.height/i},u=[];for(const d of t.values()){const{measured:h,selectable:m=!0,hidden:g=!1}=d;if(a&&!m||g)continue;const x=h.width??d.width??d.initialWidth??null,v=h.height??d.height??d.initialHeight??null,b=Jh(o,Wu(d)),k=(x??0)*(v??0),w=s&&b>0;(!d.internals.handleBounds||w||b>=k||d.dragging)&&u.push(d)}return u},qle=(t,e)=>{const n=new Set;return t.forEach(r=>{n.add(r.id)}),e.filter(r=>n.has(r.source)||n.has(r.target))};function Vle(t,e){const n=new Map,r=e!=null&&e.nodes?new Set(e.nodes.map(i=>i.id)):null;return t.forEach(i=>{i.measured.width&&i.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Yle({nodes:t,width:e,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(t.size===0)return Promise.resolve(!0);const o=Vle(t,a),u=Rp(o),d=lQ(u,e,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await r.setViewport(d,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function HD({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const a=n.get(t),o=a.parentId?n.get(a.parentId):void 0,{x:u,y:d}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let m=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!o)s==null||s("005",Ss.error005());else{const x=o.measured.width,v=o.measured.height;x&&v&&(m=[[u,d],[u+x,d+v]])}else o&&Hu(a.extent)&&(m=[[a.extent[0][0]+u,a.extent[0][1]+d],[a.extent[1][0]+u,a.extent[1][1]+d]]);const g=Hu(m)?Io(e,m,a.measured):e;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Ss.error015())),{position:{x:g.x-u+(a.measured.width??0)*h[0],y:g.y-d+(a.measured.height??0)*h[1]},positionAbsolute:g}}async function Ule({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(t.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const x=s.has(g.id),v=!x&&g.parentId&&a.find(b=>b.id===g.parentId);(x||v)&&a.push(g)}const o=new Set(e.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),h=qle(a,u);for(const g of u)o.has(g.id)&&!h.find(v=>v.id===g.id)&&h.push(g);if(!i)return{edges:h,nodes:a};const m=await i({nodes:a,edges:h});return typeof m=="boolean"?m?{edges:h,nodes:a}:{edges:[],nodes:[]}:m}const Uu=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Io=(t={x:0,y:0},e,n)=>({x:Uu(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:Uu(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function GD(t,e,n){const{width:r,height:i}=ba(n),{x:s,y:a}=n.internals.positionAbsolute;return Io(t,[[s,a],[s+r,a+i]],e)}const G_=(t,e,n)=>t<e?Uu(Math.abs(t-e),1,e)/e:t>n?-Uu(Math.abs(t-n),1,e)/e:0,FD=(t,e,n=15,r=40)=>{const i=G_(t.x,r,e.width-r)*n,s=G_(t.y,r,e.height-r)*n;return[i,s]},fv=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),Fw=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),hv=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),Wu=(t,e=[0,0])=>{var i,s;const{x:n,y:r}=sQ(t)?t.internals.positionAbsolute:Ap(t,e);return{x:n,y:r,width:((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},yx=(t,e=[0,0])=>{var i,s;const{x:n,y:r}=sQ(t)?t.internals.positionAbsolute:Ap(t,e);return{x:n,y:r,x2:n+(((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0),y2:r+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},KD=(t,e)=>hv(fv(Fw(t),Fw(e))),Jh=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),r=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*r)},F_=t=>Ai(t.width)&&Ai(t.height)&&Ai(t.x)&&Ai(t.y),Ai=t=>!isNaN(t)&&isFinite(t),Wle=(t,e)=>{},Mp=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),zp=({x:t,y:e},[n,r,i],s=!1,a=[1,1])=>{const o={x:(t-n)/i,y:(e-r)/i};return s?Mp(o,a):o},bx=({x:t,y:e},[n,r,i])=>({x:t*i+n,y:e*i+r});function qc(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Hle(t,e,n){if(typeof t=="string"||typeof t=="number"){const r=qc(t,n),i=qc(t,e);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof t=="object"){const r=qc(t.top??t.y??0,n),i=qc(t.bottom??t.y??0,n),s=qc(t.left??t.x??0,e),a=qc(t.right??t.x??0,e);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Gle(t,e,n,r,i,s){const{x:a,y:o}=bx(t,[e,n,r]),{x:u,y:d}=bx({x:t.x+t.width,y:t.y+t.height},[e,n,r]),h=i-u,m=s-d;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(m)}}const lQ=(t,e,n,r,i,s)=>{const a=Hle(s,e,n),o=(e-a.x)/t.width,u=(n-a.y)/t.height,d=Math.min(o,u),h=Uu(d,r,i),m=t.x+t.width/2,g=t.y+t.height/2,x=e/2-m*h,v=n/2-g*h,b=Gle(t,x,v,h,e,n),k={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:x-k.left+k.right,y:v-k.top+k.bottom,zoom:h}},ep=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Hu(t){return t!=null&&t!=="parent"}function ba(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function JD(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function eL(t,e={width:0,height:0},n,r,i){const s={...t},a=r.get(n);if(a){const o=a.origin||i;s.x+=a.internals.positionAbsolute.x-(e.width??0)*o[0],s.y+=a.internals.positionAbsolute.y-(e.height??0)*o[1]}return s}function K_(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Fle(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}function Kle(t){return{...VD,...t||{}}}function mh(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:a}=Ri(t),o=zp({x:s-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},r),{x:u,y:d}=n?Mp(o,e):o;return{xSnapped:u,ySnapped:d,...o}}const oQ=t=>({width:t.offsetWidth,height:t.offsetHeight}),tL=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Jle=["INPUT","SELECT","TEXTAREA"];function nL(t){var r,i;const e=((i=(r=t.composedPath)==null?void 0:r.call(t))==null?void 0:i[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:Jle.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const rL=t=>"clientX"in t,Ri=(t,e)=>{var s,a;const n=rL(t),r=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,i=n?t.clientY:(a=t.touches)==null?void 0:a[0].clientY;return{x:r-((e==null?void 0:e.left)??0),y:i-((e==null?void 0:e.top)??0)}},J_=(t,e,n,r,i)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...oQ(a)}})};function iL({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:o}){const u=t*.125+i*.375+a*.375+n*.125,d=e*.125+s*.375+o*.375+r*.125,h=Math.abs(u-t),m=Math.abs(d-e);return[u,d,h,m]}function Hg(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function eA({pos:t,x1:e,y1:n,x2:r,y2:i,c:s}){switch(t){case $e.Left:return[e-Hg(e-r,s),n];case $e.Right:return[e+Hg(r-e,s),n];case $e.Top:return[e,n-Hg(n-i,s)];case $e.Bottom:return[e,n+Hg(i-n,s)]}}function sL({sourceX:t,sourceY:e,sourcePosition:n=$e.Bottom,targetX:r,targetY:i,targetPosition:s=$e.Top,curvature:a=.25}){const[o,u]=eA({pos:n,x1:t,y1:e,x2:r,y2:i,c:a}),[d,h]=eA({pos:s,x1:r,y1:i,x2:t,y2:e,c:a}),[m,g,x,v]=iL({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:o,sourceControlY:u,targetControlX:d,targetControlY:h});return[`M${t},${e} C${o},${u} ${d},${h} ${r},${i}`,m,g,x,v]}function aL({sourceX:t,sourceY:e,targetX:n,targetY:r}){const i=Math.abs(n-t)/2,s=n<t?n+i:n-i,a=Math.abs(r-e)/2,o=r<e?r+a:r-a;return[s,o,i,a]}function eoe({sourceNode:t,targetNode:e,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const a=i&&n?r+1e3:r,o=Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0);return a+o}function toe({sourceNode:t,targetNode:e,width:n,height:r,transform:i}){const s=fv(yx(t),yx(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Jh(a,hv(s))>0}const noe=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`xy-edge__${t}${e||""}-${n}${r||""}`,roe=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),ioe=(t,e,n={})=>{if(!t.source||!t.target)return e;const r=n.getEdgeId||noe;let i;return WD(t)?i={...t}:i={...t,id:r(t)},roe(i,e)?e:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,e.concat(i))};function lL({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[i,s,a,o]=aL({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,i,s,a,o]}const tA={[$e.Left]:{x:-1,y:0},[$e.Right]:{x:1,y:0},[$e.Top]:{x:0,y:-1},[$e.Bottom]:{x:0,y:1}},soe=({source:t,sourcePosition:e=$e.Bottom,target:n})=>e===$e.Left||e===$e.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},nA=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function aoe({source:t,sourcePosition:e=$e.Bottom,target:n,targetPosition:r=$e.Top,center:i,offset:s,stepPosition:a}){const o=tA[e],u=tA[r],d={x:t.x+o.x*s,y:t.y+o.y*s},h={x:n.x+u.x*s,y:n.y+u.y*s},m=soe({source:d,sourcePosition:e,target:h}),g=m.x!==0?"x":"y",x=m[g];let v=[],b,k;const w={x:0,y:0},j={x:0,y:0},[,,Q,E]=aL({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(o[g]*u[g]===-1){g==="x"?(b=i.x??d.x+(h.x-d.x)*a,k=i.y??(d.y+h.y)/2):(b=i.x??(d.x+h.x)/2,k=i.y??d.y+(h.y-d.y)*a);const T=[{x:b,y:d.y},{x:b,y:h.y}],A=[{x:d.x,y:k},{x:h.x,y:k}];o[g]===x?v=g==="x"?T:A:v=g==="x"?A:T}else{const T=[{x:d.x,y:h.y}],A=[{x:h.x,y:d.y}];if(g==="x"?v=o.x===x?A:T:v=o.y===x?T:A,e===r){const B=Math.abs(t[g]-n[g]);if(B<=s){const H=Math.min(s-1,s-B);o[g]===x?w[g]=(d[g]>t[g]?-1:1)*H:j[g]=(h[g]>n[g]?-1:1)*H}}if(e!==r){const B=g==="x"?"y":"x",H=o[g]===u[B],P=d[B]>h[B],D=d[B]<h[B];(o[g]===1&&(!H&&P||H&&D)||o[g]!==1&&(!H&&D||H&&P))&&(v=g==="x"?T:A)}const I={x:d.x+w.x,y:d.y+w.y},W={x:h.x+j.x,y:h.y+j.y},F=Math.max(Math.abs(I.x-v[0].x),Math.abs(W.x-v[0].x)),Z=Math.max(Math.abs(I.y-v[0].y),Math.abs(W.y-v[0].y));F>=Z?(b=(I.x+W.x)/2,k=v[0].y):(b=v[0].x,k=(I.y+W.y)/2)}return[[t,{x:d.x+w.x,y:d.y+w.y},...v,{x:h.x+j.x,y:h.y+j.y},n],b,k,Q,E]}function loe(t,e,n,r){const i=Math.min(nA(t,e)/2,nA(e,n)/2,r),{x:s,y:a}=e;if(t.x===s&&s===n.x||t.y===a&&a===n.y)return`L${s} ${a}`;if(t.y===a){const d=t.x<n.x?-1:1,h=t.y<n.y?1:-1;return`L ${s+i*d},${a}Q ${s},${a} ${s},${a+i*h}`}const o=t.x<n.x?1:-1,u=t.y<n.y?-1:1;return`L ${s},${a+i*u}Q ${s},${a} ${s+i*o},${a}`}function Kw({sourceX:t,sourceY:e,sourcePosition:n=$e.Bottom,targetX:r,targetY:i,targetPosition:s=$e.Top,borderRadius:a=5,centerX:o,centerY:u,offset:d=20,stepPosition:h=.5}){const[m,g,x,v,b]=aoe({source:{x:t,y:e},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:o,y:u},offset:d,stepPosition:h});return[m.reduce((w,j,Q)=>{let E="";return Q>0&&Q<m.length-1?E=loe(m[Q-1],j,m[Q+1],a):E=`${Q===0?"M":"L"}${j.x} ${j.y}`,w+=E,w},""),g,x,v,b]}function rA(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function ooe(t){var m;const{sourceNode:e,targetNode:n}=t;if(!rA(e)||!rA(n))return null;const r=e.internals.handleBounds||iA(e.handles),i=n.internals.handleBounds||iA(n.handles),s=sA((r==null?void 0:r.source)??[],t.sourceHandle),a=sA(t.connectionMode===Yu.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),t.targetHandle);if(!s||!a)return(m=t.onError)==null||m.call(t,"008",Ss.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const o=(s==null?void 0:s.position)||$e.Bottom,u=(a==null?void 0:a.position)||$e.Top,d=Bo(e,s,o),h=Bo(n,a,u);return{sourceX:d.x,sourceY:d.y,targetX:h.x,targetY:h.y,sourcePosition:o,targetPosition:u}}function iA(t){if(!t)return null;const e=[],n=[];for(const r of t)r.width=r.width??1,r.height=r.height??1,r.type==="source"?e.push(r):r.type==="target"&&n.push(r);return{source:e,target:n}}function Bo(t,e,n=$e.Left,r=!1){const i=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:a,height:o}=e??ba(t);if(r)return{x:i+a/2,y:s+o/2};switch((e==null?void 0:e.position)??n){case $e.Top:return{x:i+a/2,y:s};case $e.Right:return{x:i+a,y:s+o/2};case $e.Bottom:return{x:i+a/2,y:s+o};case $e.Left:return{x:i,y:s+o/2}}}function sA(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function Jw(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`:""}function coe(t,{id:e,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return t.reduce((a,o)=>([o.markerStart||r,o.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const d=Jw(u,e);s.has(d)||(a.push({id:d,color:u.color||n,...u}),s.add(d))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const oL=1e3,uoe=10,cQ={nodeOrigin:[0,0],nodeExtent:Fh,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},doe={...cQ,checkEquality:!0};function uQ(t,e){const n={...t};for(const r in e)e[r]!==void 0&&(n[r]=e[r]);return n}function foe(t,e,n){const r=uQ(cQ,n);for(const i of t.values())if(i.parentId)fQ(i,t,e,r);else{const s=Ap(i,r.nodeOrigin),a=Hu(i.extent)?i.extent:r.nodeExtent,o=Io(s,a,ba(i));i.internals.positionAbsolute=o}}function hoe(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],r=[];for(const i of t.handles){const s={id:i.id,width:i.width??1,height:i.height??1,nodeId:t.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function dQ(t){return t==="manual"}function ek(t,e,n,r={}){var d,h;const i=uQ(doe,r),s={i:0},a=new Map(e),o=i!=null&&i.elevateNodesOnSelect&&!dQ(i.zIndexMode)?oL:0;let u=t.length>0;e.clear(),n.clear();for(const m of t){let g=a.get(m.id);if(i.checkEquality&&m===(g==null?void 0:g.internals.userNode))e.set(m.id,g);else{const x=Ap(m,i.nodeOrigin),v=Hu(m.extent)?m.extent:i.nodeExtent,b=Io(x,v,ba(m));g={...i.defaults,...m,measured:{width:(d=m.measured)==null?void 0:d.width,height:(h=m.measured)==null?void 0:h.height},internals:{positionAbsolute:b,handleBounds:hoe(m,g),z:cL(m,o,i.zIndexMode),userNode:m}},e.set(m.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),m.parentId&&fQ(g,e,n,r,s)}return u}function poe(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function fQ(t,e,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:o,zIndexMode:u}=uQ(cQ,r),d=t.parentId,h=e.get(d);if(!h){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}poe(t,n),i&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++i.i,h.internals.z=h.internals.z+i.i*uoe),i&&h.internals.rootParentIndex!==void 0&&(i.i=h.internals.rootParentIndex);const m=s&&!dQ(u)?oL:0,{x:g,y:x,z:v}=moe(t,h,a,o,m,u),{positionAbsolute:b}=t.internals,k=g!==b.x||x!==b.y;(k||v!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:k?{x:g,y:x}:b,z:v}})}function cL(t,e,n){const r=Ai(t.zIndex)?t.zIndex:0;return dQ(n)?r:r+(t.selected?e:0)}function moe(t,e,n,r,i,s){const{x:a,y:o}=e.internals.positionAbsolute,u=ba(t),d=Ap(t,n),h=Hu(t.extent)?Io(d,t.extent,u):d;let m=Io({x:a+h.x,y:o+h.y},r,u);t.extent==="parent"&&(m=GD(m,u,e));const g=cL(t,i,s),x=e.internals.z??0;return{x:m.x,y:m.y,z:x>=g?x+1:g}}function hQ(t,e,n,r=[0,0]){var a;const i=[],s=new Map;for(const o of t){const u=e.get(o.parentId);if(!u)continue;const d=((a=s.get(o.parentId))==null?void 0:a.expandedRect)??Wu(u),h=KD(d,o.rect);s.set(o.parentId,{expandedRect:h,parent:u})}return s.size>0&&s.forEach(({expandedRect:o,parent:u},d)=>{var Q;const h=u.internals.positionAbsolute,m=ba(u),g=u.origin??r,x=o.x<h.x?Math.round(Math.abs(h.x-o.x)):0,v=o.y<h.y?Math.round(Math.abs(h.y-o.y)):0,b=Math.max(m.width,Math.round(o.width)),k=Math.max(m.height,Math.round(o.height)),w=(b-m.width)*g[0],j=(k-m.height)*g[1];(x>0||v>0||w||j)&&(i.push({id:d,type:"position",position:{x:u.position.x-x+w,y:u.position.y-v+j}}),(Q=n.get(d))==null||Q.forEach(E=>{t.some(R=>R.id===E.id)||i.push({id:E.id,type:"position",position:{x:E.position.x+x,y:E.position.y+v}})})),(m.width<o.width||m.height<o.height||x||v)&&i.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:b+(x?g[0]*x-w:0),height:k+(v?g[1]*v-j:0)}})}),i}function goe(t,e,n,r,i,s,a){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!o)return{changes:[],updatedInternals:u};const d=[],h=window.getComputedStyle(o),{m22:m}=new window.DOMMatrixReadOnly(h.transform),g=[];for(const x of t.values()){const v=e.get(x.id);if(!v)continue;if(v.hidden){e.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),u=!0;continue}const b=oQ(x.nodeElement),k=v.measured.width!==b.width||v.measured.height!==b.height;if(!!(b.width&&b.height&&(k||!v.internals.handleBounds||x.force))){const j=x.nodeElement.getBoundingClientRect(),Q=Hu(v.extent)?v.extent:s;let{positionAbsolute:E}=v.internals;v.parentId&&v.extent==="parent"?E=GD(E,b,e.get(v.parentId)):Q&&(E=Io(E,Q,b));const R={...v,measured:b,internals:{...v.internals,positionAbsolute:E,handleBounds:{source:J_("source",x.nodeElement,j,m,v.id),target:J_("target",x.nodeElement,j,m,v.id)}}};e.set(v.id,R),v.parentId&&fQ(R,e,n,{nodeOrigin:i,zIndexMode:a}),u=!0,k&&(d.push({id:v.id,type:"dimensions",dimensions:b}),v.expandParent&&v.parentId&&g.push({id:v.id,parentId:v.parentId,rect:Wu(R,i)}))}}if(g.length>0){const x=hQ(g,e,n,i);d.push(...x)}return{changes:d,updatedInternals:u}}async function Ooe({delta:t,panZoom:e,transform:n,translateExtent:r,width:i,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,s]],r),o=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(o)}function aA(t,e,n,r,i,s){let a=i;const o=r.get(a)||new Map;r.set(a,o.set(n,e)),a=`${i}-${t}`;const u=r.get(a)||new Map;if(r.set(a,u.set(n,e)),s){a=`${i}-${t}-${s}`;const d=r.get(a)||new Map;r.set(a,d.set(n,e))}}function uL(t,e,n){t.clear(),e.clear();for(const r of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:o=null}=r,u={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:o},d=`${i}-${a}--${s}-${o}`,h=`${s}-${o}--${i}-${a}`;aA("source",u,h,t,i,a),aA("target",u,d,t,s,o),e.set(r.id,r)}}function dL(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:dL(n,e):!1}function lA(t,e,n){var i;let r=t;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,e))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xoe(t,e,n,r){const i=new Map;for(const[s,a]of t)if((a.selected||a.id===r)&&(!a.parentId||!dL(a,t))&&(a.draggable||e&&typeof a.draggable>"u")){const o=t.get(s);o&&i.set(s,{id:s,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return i}function K0({nodeId:t,dragItems:e,nodeLookup:n,dragging:r=!0}){var a,o,u;const i=[];for(const[d,h]of e){const m=(a=n.get(d))==null?void 0:a.internals.userNode;m&&i.push({...m,position:h.position,dragging:r})}if(!t)return[i[0],i];const s=(o=n.get(t))==null?void 0:o.internals.userNode;return[s?{...s,position:((u=e.get(t))==null?void 0:u.position)||s.position,dragging:r}:i[0],i]}function voe({dragItems:t,snapGrid:e,x:n,y:r}){const i=t.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},a=Mp(s,e);return{x:a.x-s.x,y:a.y-s.y}}function yoe({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,o=new Map,u=!1,d={x:0,y:0},h=null,m=!1,g=null,x=!1,v=!1,b=null;function k({noDragClassName:j,handleSelector:Q,domNode:E,isSelectable:R,nodeId:T,nodeClickDistance:A=0}){g=Br(E);function I({x:B,y:H}){const{nodeLookup:P,nodeExtent:D,snapGrid:_,snapToGrid:X,nodeOrigin:Y,onNodeDrag:V,onSelectionDrag:$,onError:z,updateNodePositions:q}=e();s={x:B,y:H};let M=!1;const G=o.size>1,ie=G&&D?Fw(Rp(o)):null,J=G&&X?voe({dragItems:o,snapGrid:_,x:B,y:H}):null;for(const[ne,se]of o){if(!P.has(ne))continue;let pe={x:B-se.distance.x,y:H-se.distance.y};X&&(pe=J?{x:Math.round(pe.x+J.x),y:Math.round(pe.y+J.y)}:Mp(pe,_));let ye=null;if(G&&D&&!se.extent&&ie){const{positionAbsolute:ke}=se.internals,_e=ke.x-ie.x+D[0][0],We=ke.x+se.measured.width-ie.x2+D[1][0],De=ke.y-ie.y+D[0][1],yt=ke.y+se.measured.height-ie.y2+D[1][1];ye=[[_e,De],[We,yt]]}const{position:be,positionAbsolute:Se}=HD({nodeId:ne,nextPosition:pe,nodeLookup:P,nodeExtent:ye||D,nodeOrigin:Y,onError:z});M=M||se.position.x!==be.x||se.position.y!==be.y,se.position=be,se.internals.positionAbsolute=Se}if(v=v||M,!!M&&(q(o,!0),b&&(r||V||!T&&$))){const[ne,se]=K0({nodeId:T,dragItems:o,nodeLookup:P});r==null||r(b,o,ne,se),V==null||V(b,ne,se),T||$==null||$(b,se)}}async function W(){if(!h)return;const{transform:B,panBy:H,autoPanSpeed:P,autoPanOnNodeDrag:D}=e();if(!D){u=!1,cancelAnimationFrame(a);return}const[_,X]=FD(d,h,P);(_!==0||X!==0)&&(s.x=(s.x??0)-_/B[2],s.y=(s.y??0)-X/B[2],await H({x:_,y:X})&&I(s)),a=requestAnimationFrame(W)}function F(B){var G;const{nodeLookup:H,multiSelectionActive:P,nodesDraggable:D,transform:_,snapGrid:X,snapToGrid:Y,selectNodesOnDrag:V,onNodeDragStart:$,onSelectionDragStart:z,unselectNodesAndEdges:q}=e();m=!0,(!V||!R)&&!P&&T&&((G=H.get(T))!=null&&G.selected||q()),R&&V&&T&&(t==null||t(T));const M=mh(B.sourceEvent,{transform:_,snapGrid:X,snapToGrid:Y,containerBounds:h});if(s=M,o=xoe(H,D,M,T),o.size>0&&(n||$||!T&&z)){const[ie,J]=K0({nodeId:T,dragItems:o,nodeLookup:H});n==null||n(B.sourceEvent,o,ie,J),$==null||$(B.sourceEvent,ie,J),T||z==null||z(B.sourceEvent,J)}}const Z=ED().clickDistance(A).on("start",B=>{const{domNode:H,nodeDragThreshold:P,transform:D,snapGrid:_,snapToGrid:X}=e();h=(H==null?void 0:H.getBoundingClientRect())||null,x=!1,v=!1,b=B.sourceEvent,P===0&&F(B),s=mh(B.sourceEvent,{transform:D,snapGrid:_,snapToGrid:X,containerBounds:h}),d=Ri(B.sourceEvent,h)}).on("drag",B=>{const{autoPanOnNodeDrag:H,transform:P,snapGrid:D,snapToGrid:_,nodeDragThreshold:X,nodeLookup:Y}=e(),V=mh(B.sourceEvent,{transform:P,snapGrid:D,snapToGrid:_,containerBounds:h});if(b=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||T&&!Y.has(T))&&(x=!0),!x){if(!u&&H&&m&&(u=!0,W()),!m){const $=Ri(B.sourceEvent,h),z=$.x-d.x,q=$.y-d.y;Math.sqrt(z*z+q*q)>X&&F(B)}(s.x!==V.xSnapped||s.y!==V.ySnapped)&&o&&m&&(d=Ri(B.sourceEvent,h),I(V))}}).on("end",B=>{if(!(!m||x)&&(u=!1,m=!1,cancelAnimationFrame(a),o.size>0)){const{nodeLookup:H,updateNodePositions:P,onNodeDragStop:D,onSelectionDragStop:_}=e();if(v&&(P(o,!1),v=!1),i||D||!T&&_){const[X,Y]=K0({nodeId:T,dragItems:o,nodeLookup:H,dragging:!1});i==null||i(B.sourceEvent,o,X,Y),D==null||D(B.sourceEvent,X,Y),T||_==null||_(B.sourceEvent,Y)}}}).filter(B=>{const H=B.target;return!B.button&&(!j||!lA(H,`.${j}`,E))&&(!Q||lA(H,Q,E))});g.call(Z)}function w(){g==null||g.on(".drag",null)}return{update:k,destroy:w}}function boe(t,e,n){const r=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())Jh(i,Wu(s))>0&&r.push(s);return r}const Soe=250;function woe(t,e,n,r){var o,u;let i=[],s=1/0;const a=boe(t,n,e+Soe);for(const d of a){const h=[...((o=d.internals.handleBounds)==null?void 0:o.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const m of h){if(r.nodeId===m.nodeId&&r.type===m.type&&r.id===m.id)continue;const{x:g,y:x}=Bo(d,m,m.position,!0),v=Math.sqrt(Math.pow(g-t.x,2)+Math.pow(x-t.y,2));v>e||(v<s?(i=[{...m,x:g,y:x}],s=v):v===s&&i.push({...m,x:g,y:x}))}}if(!i.length)return null;if(i.length>1){const d=r.type==="source"?"target":"source";return i.find(h=>h.type===d)??i[0]}return i[0]}function fL(t,e,n,r,i,s=!1){var d,h,m;const a=r.get(t);if(!a)return null;const o=i==="strict"?(d=a.internals.handleBounds)==null?void 0:d[e]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((m=a.internals.handleBounds)==null?void 0:m.target)??[]],u=(n?o==null?void 0:o.find(g=>g.id===n):o==null?void 0:o[0])??null;return u&&s?{...u,...Bo(a,u,u.position,!0)}:u}function hL(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function koe(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const pL=()=>!0;function Qoe(t,{connectionMode:e,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:o,nodeLookup:u,lib:d,autoPanOnConnect:h,flowId:m,panBy:g,cancelConnection:x,onConnectStart:v,onConnect:b,onConnectEnd:k,isValidConnection:w=pL,onReconnectEnd:j,updateConnection:Q,getTransform:E,getFromHandle:R,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:I}){const W=tL(t.target);let F=0,Z;const{x:B,y:H}=Ri(t),P=hL(s,I),D=o==null?void 0:o.getBoundingClientRect();let _=!1;if(!D||!P)return;const X=fL(i,P,r,u,e);if(!X)return;let Y=Ri(t,D),V=!1,$=null,z=!1,q=null;function M(){if(!h||!D)return;const[be,Se]=FD(Y,D,T);g({x:be,y:Se}),F=requestAnimationFrame(M)}const G={...X,nodeId:i,type:P,position:X.position},ie=u.get(i);let ne={inProgress:!0,isValid:null,from:Bo(ie,G,$e.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:ie,to:Y,toHandle:null,toPosition:H_[G.position],toNode:null,pointer:Y};function se(){_=!0,Q(ne),v==null||v(t,{nodeId:i,handleId:r,handleType:P})}A===0&&se();function pe(be){if(!_){const{x:yt,y:Cn}=Ri(be),Jt=yt-B,jn=Cn-H;if(!(Jt*Jt+jn*jn>A*A))return;se()}if(!R()||!G){ye(be);return}const Se=E();Y=Ri(be,D),Z=woe(zp(Y,Se,!1,[1,1]),n,u,G),V||(M(),V=!0);const ke=mL(be,{handle:Z,connectionMode:e,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:w,doc:W,lib:d,flowId:m,nodeLookup:u});q=ke.handleDomNode,$=ke.connection,z=koe(!!Z,ke.isValid);const _e=u.get(i),We=_e?Bo(_e,G,$e.Left,!0):ne.from,De={...ne,from:We,isValid:z,to:ke.toHandle&&z?bx({x:ke.toHandle.x,y:ke.toHandle.y},Se):Y,toHandle:ke.toHandle,toPosition:z&&ke.toHandle?ke.toHandle.position:H_[G.position],toNode:ke.toHandle?u.get(ke.toHandle.nodeId):null,pointer:Y};Q(De),ne=De}function ye(be){if(!("touches"in be&&be.touches.length>0)){if(_){(Z||q)&&$&&z&&(b==null||b($));const{inProgress:Se,...ke}=ne,_e={...ke,toPosition:ne.toHandle?ne.toPosition:null};k==null||k(be,_e),s&&(j==null||j(be,_e))}x(),cancelAnimationFrame(F),V=!1,z=!1,$=null,q=null,W.removeEventListener("mousemove",pe),W.removeEventListener("mouseup",ye),W.removeEventListener("touchmove",pe),W.removeEventListener("touchend",ye)}}W.addEventListener("mousemove",pe),W.addEventListener("mouseup",ye),W.addEventListener("touchmove",pe),W.addEventListener("touchend",ye)}function mL(t,{handle:e,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:o,flowId:u,isValidConnection:d=pL,nodeLookup:h}){const m=s==="target",g=e?a.querySelector(`.${o}-flow__handle[data-id="${u}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x,y:v}=Ri(t),b=a.elementFromPoint(x,v),k=b!=null&&b.classList.contains(`${o}-flow__handle`)?b:g,w={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const j=hL(void 0,k),Q=k.getAttribute("data-nodeid"),E=k.getAttribute("data-handleid"),R=k.classList.contains("connectable"),T=k.classList.contains("connectableend");if(!Q||!j)return w;const A={source:m?Q:r,sourceHandle:m?E:i,target:m?r:Q,targetHandle:m?i:E};w.connection=A;const W=R&&T&&(n===Yu.Strict?m&&j==="source"||!m&&j==="target":Q!==r||E!==i);w.isValid=W&&d(A),w.toHandle=fL(Q,j,E,h,n,!0)}return w}const tk={onPointerDown:Qoe,isValid:mL};function Coe({domNode:t,panZoom:e,getTransform:n,getViewScale:r}){const i=Br(t);function s({translateExtent:o,width:u,height:d,zoomStep:h=1,pannable:m=!0,zoomable:g=!0,inversePan:x=!1}){const v=Q=>{if(Q.sourceEvent.type!=="wheel"||!e)return;const E=n(),R=Q.sourceEvent.ctrlKey&&ep()?10:1,T=-Q.sourceEvent.deltaY*(Q.sourceEvent.deltaMode===1?.05:Q.sourceEvent.deltaMode?1:.002)*h,A=E[2]*Math.pow(2,T*R);e.scaleTo(A)};let b=[0,0];const k=Q=>{(Q.sourceEvent.type==="mousedown"||Q.sourceEvent.type==="touchstart")&&(b=[Q.sourceEvent.clientX??Q.sourceEvent.touches[0].clientX,Q.sourceEvent.clientY??Q.sourceEvent.touches[0].clientY])},w=Q=>{const E=n();if(Q.sourceEvent.type!=="mousemove"&&Q.sourceEvent.type!=="touchmove"||!e)return;const R=[Q.sourceEvent.clientX??Q.sourceEvent.touches[0].clientX,Q.sourceEvent.clientY??Q.sourceEvent.touches[0].clientY],T=[R[0]-b[0],R[1]-b[1]];b=R;const A=r()*Math.max(E[2],Math.log(E[2]))*(x?-1:1),I={x:E[0]-T[0]*A,y:E[1]-T[1]*A},W=[[0,0],[u,d]];e.setViewportConstrained({x:I.x,y:I.y,zoom:E[2]},W,o)},j=BD().on("start",k).on("zoom",m?w:null).on("zoom.wheel",g?v:null);i.call(j,{})}function a(){i.on("zoom",null)}return{update:s,destroy:a,pointer:$i}}const pv=t=>({x:t.x,y:t.y,zoom:t.k}),J0=({x:t,y:e,zoom:n})=>dv.translate(t,e).scale(n),iu=(t,e)=>t.target.closest(`.${e}`),gL=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),joe=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,e1=(t,e=0,n=joe,r=()=>{})=>{const i=typeof e=="number"&&e>0;return i||r(),i?t.transition().duration(e).ease(n).on("end",r):t},OL=t=>{const e=t.ctrlKey&&ep()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function Eoe({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:u,onPanZoomEnd:d}){return h=>{if(iu(h,e))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(h.ctrlKey&&a){const k=$i(h),w=OL(h),j=m*Math.pow(2,w);r.scaleTo(n,j,k,h);return}const g=h.deltaMode===1?20:1;let x=i===Ao.Vertical?0:h.deltaX*g,v=i===Ao.Horizontal?0:h.deltaY*g;!ep()&&h.shiftKey&&i!==Ao.Vertical&&(x=h.deltaY*g,v=0),r.translateBy(n,-(x/m)*s,-(v/m)*s,{internal:!0});const b=pv(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(u==null||u(h,b),t.panScrollTimeout=setTimeout(()=>{d==null||d(h,b),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,o==null||o(h,b))}}function $oe({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",a=!e&&s&&!r.ctrlKey,o=iu(r,t);if(r.ctrlKey&&s&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,i)}}function Noe({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return r=>{var s,a,o;if((s=r.sourceEvent)!=null&&s.internal)return;const i=pv(r.transform);t.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=i,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&e(!0),n&&(n==null||n(r.sourceEvent,i))}}function Toe({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var a,o;t.usedRightMouseButton=!!(n&&gL(e,t.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((o=s.sourceEvent)!=null&&o.internal)&&(i==null||i(s.sourceEvent,pv(s.transform)))}}function Poe({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(t.isZoomingOrPanning=!1,s&&gL(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),t.usedRightMouseButton=!1,r(!1),i)){const u=pv(a.transform);t.prevViewport=u,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,u)},n?150:0)}}}function _oe({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:o,noPanClassName:u,lib:d,connectionInProgress:h}){return m=>{var k;const g=t||e,x=n&&m.ctrlKey,v=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(iu(m,`${d}-flow__node`)||iu(m,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!s&&!n||a||h&&!v||iu(m,o)&&v||iu(m,u)&&(!v||i&&v&&!t)||!n&&m.ctrlKey&&v)return!1;if(!n&&m.type==="touchstart"&&((k=m.touches)==null?void 0:k.length)>1)return m.preventDefault(),!1;if(!g&&!i&&!x&&v||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const b=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||v)&&b}}function Aoe({domNode:t,minZoom:e,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=t.getBoundingClientRect(),m=BD().scaleExtent([e,n]).translateExtent(r),g=Br(t).call(m);j({x:i.x,y:i.y,zoom:Uu(i.zoom,e,n)},[[0,0],[h.width,h.height]],r);const x=g.on("wheel.zoom"),v=g.on("dblclick.zoom");m.wheelDelta(OL);function b(Z,B){return g?new Promise(H=>{m==null||m.interpolate((B==null?void 0:B.interpolate)==="linear"?ph:yO).transform(e1(g,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>H(!0)),Z)}):Promise.resolve(!1)}function k({noWheelClassName:Z,noPanClassName:B,onPaneContextMenu:H,userSelectionActive:P,panOnScroll:D,panOnDrag:_,panOnScrollMode:X,panOnScrollSpeed:Y,preventScrolling:V,zoomOnPinch:$,zoomOnScroll:z,zoomOnDoubleClick:q,zoomActivationKeyPressed:M,lib:G,onTransformChange:ie,connectionInProgress:J,paneClickDistance:ne,selectionOnDrag:se}){P&&!d.isZoomingOrPanning&&w();const pe=D&&!M&&!P;m.clickDistance(se?1/0:!Ai(ne)||ne<0?0:ne);const ye=pe?Eoe({zoomPanValues:d,noWheelClassName:Z,d3Selection:g,d3Zoom:m,panOnScrollMode:X,panOnScrollSpeed:Y,zoomOnPinch:$,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:o}):$oe({noWheelClassName:Z,preventScrolling:V,d3ZoomHandler:x});if(g.on("wheel.zoom",ye,{passive:!1}),!P){const Se=Noe({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:a});m.on("start",Se);const ke=Toe({zoomPanValues:d,panOnDrag:_,onPaneContextMenu:!!H,onPanZoom:s,onTransformChange:ie});m.on("zoom",ke);const _e=Poe({zoomPanValues:d,panOnDrag:_,panOnScroll:D,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:u});m.on("end",_e)}const be=_oe({zoomActivationKeyPressed:M,panOnDrag:_,zoomOnScroll:z,panOnScroll:D,zoomOnDoubleClick:q,zoomOnPinch:$,userSelectionActive:P,noPanClassName:B,noWheelClassName:Z,lib:G,connectionInProgress:J});m.filter(be),q?g.on("dblclick.zoom",v):g.on("dblclick.zoom",null)}function w(){m.on("zoom",null)}async function j(Z,B,H){const P=J0(Z),D=m==null?void 0:m.constrain()(P,B,H);return D&&await b(D),new Promise(_=>_(D))}async function Q(Z,B){const H=J0(Z);return await b(H,B),new Promise(P=>P(H))}function E(Z){if(g){const B=J0(Z),H=g.property("__zoom");(H.k!==Z.zoom||H.x!==Z.x||H.y!==Z.y)&&(m==null||m.transform(g,B,null,{sync:!0}))}}function R(){const Z=g?ID(g.node()):{x:0,y:0,k:1};return{x:Z.x,y:Z.y,zoom:Z.k}}function T(Z,B){return g?new Promise(H=>{m==null||m.interpolate((B==null?void 0:B.interpolate)==="linear"?ph:yO).scaleTo(e1(g,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>H(!0)),Z)}):Promise.resolve(!1)}function A(Z,B){return g?new Promise(H=>{m==null||m.interpolate((B==null?void 0:B.interpolate)==="linear"?ph:yO).scaleBy(e1(g,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>H(!0)),Z)}):Promise.resolve(!1)}function I(Z){m==null||m.scaleExtent(Z)}function W(Z){m==null||m.translateExtent(Z)}function F(Z){const B=!Ai(Z)||Z<0?0:Z;m==null||m.clickDistance(B)}return{update:k,destroy:w,setViewport:Q,setViewportConstrained:j,getViewport:R,scaleTo:T,scaleBy:A,setScaleExtent:I,setTranslateExtent:W,syncViewport:E,setClickDistance:F}}var Gu;(function(t){t.Line="line",t.Handle="handle"})(Gu||(Gu={}));function Roe({width:t,prevWidth:e,height:n,prevHeight:r,affectsX:i,affectsY:s}){const a=t-e,o=n-r,u=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&i&&(u[0]=u[0]*-1),o&&s&&(u[1]=u[1]*-1),u}function oA(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),r=t.includes("left"),i=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:r,affectsY:i}}function tl(t,e){return Math.max(0,e-t)}function nl(t,e){return Math.max(0,t-e)}function Gg(t,e,n){return Math.max(0,e-t,t-n)}function cA(t,e){return t?!e:e}function Moe(t,e,n,r,i,s,a,o){let{affectsX:u,affectsY:d}=e;const{isHorizontal:h,isVertical:m}=e,g=h&&m,{xSnapped:x,ySnapped:v}=n,{minWidth:b,maxWidth:k,minHeight:w,maxHeight:j}=r,{x:Q,y:E,width:R,height:T,aspectRatio:A}=t;let I=Math.floor(h?x-t.pointerX:0),W=Math.floor(m?v-t.pointerY:0);const F=R+(u?-I:I),Z=T+(d?-W:W),B=-s[0]*R,H=-s[1]*T;let P=Gg(F,b,k),D=Gg(Z,w,j);if(a){let Y=0,V=0;u&&I<0?Y=tl(Q+I+B,a[0][0]):!u&&I>0&&(Y=nl(Q+F+B,a[1][0])),d&&W<0?V=tl(E+W+H,a[0][1]):!d&&W>0&&(V=nl(E+Z+H,a[1][1])),P=Math.max(P,Y),D=Math.max(D,V)}if(o){let Y=0,V=0;u&&I>0?Y=nl(Q+I,o[0][0]):!u&&I<0&&(Y=tl(Q+F,o[1][0])),d&&W>0?V=nl(E+W,o[0][1]):!d&&W<0&&(V=tl(E+Z,o[1][1])),P=Math.max(P,Y),D=Math.max(D,V)}if(i){if(h){const Y=Gg(F/A,w,j)*A;if(P=Math.max(P,Y),a){let V=0;!u&&!d||u&&!d&&g?V=nl(E+H+F/A,a[1][1])*A:V=tl(E+H+(u?I:-I)/A,a[0][1])*A,P=Math.max(P,V)}if(o){let V=0;!u&&!d||u&&!d&&g?V=tl(E+F/A,o[1][1])*A:V=nl(E+(u?I:-I)/A,o[0][1])*A,P=Math.max(P,V)}}if(m){const Y=Gg(Z*A,b,k)/A;if(D=Math.max(D,Y),a){let V=0;!u&&!d||d&&!u&&g?V=nl(Q+Z*A+B,a[1][0])/A:V=tl(Q+(d?W:-W)*A+B,a[0][0])/A,D=Math.max(D,V)}if(o){let V=0;!u&&!d||d&&!u&&g?V=tl(Q+Z*A,o[1][0])/A:V=nl(Q+(d?W:-W)*A,o[0][0])/A,D=Math.max(D,V)}}}W=W+(W<0?D:-D),I=I+(I<0?P:-P),i&&(g?F>Z*A?W=(cA(u,d)?-I:I)/A:I=(cA(u,d)?-W:W)*A:h?(W=I/A,d=u):(I=W*A,u=d));const _=u?Q+I:Q,X=d?E+W:E;return{width:R+(u?-I:I),height:T+(d?-W:W),x:s[0]*I*(u?-1:1)+_,y:s[1]*W*(d?-1:1)+X}}const xL={width:0,height:0,x:0,y:0},zoe={...xL,pointerX:0,pointerY:0,aspectRatio:1};function Doe(t){return[[0,0],[t.measured.width,t.measured.height]]}function Loe(t,e,n){const r=e.position.x+t.position.x,i=e.position.y+t.position.y,s=t.measured.width??0,a=t.measured.height??0,o=n[0]*s,u=n[1]*a;return[[r-o,i-u],[r+s-o,i+a-u]]}function Xoe({domNode:t,nodeId:e,getStoreItems:n,onChange:r,onEnd:i}){const s=Br(t);let a={controlDirection:oA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:d,boundaries:h,keepAspectRatio:m,resizeDirection:g,onResizeStart:x,onResize:v,onResizeEnd:b,shouldResize:k}){let w={...xL},j={...zoe};a={boundaries:h,resizeDirection:g,keepAspectRatio:m,controlDirection:oA(d)};let Q,E=null,R=[],T,A,I,W=!1;const F=ED().on("start",Z=>{const{nodeLookup:B,transform:H,snapGrid:P,snapToGrid:D,nodeOrigin:_,paneDomNode:X}=n();if(Q=B.get(e),!Q)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:V}=mh(Z.sourceEvent,{transform:H,snapGrid:P,snapToGrid:D,containerBounds:E});w={width:Q.measured.width??0,height:Q.measured.height??0,x:Q.position.x??0,y:Q.position.y??0},j={...w,pointerX:Y,pointerY:V,aspectRatio:w.width/w.height},T=void 0,Q.parentId&&(Q.extent==="parent"||Q.expandParent)&&(T=B.get(Q.parentId),A=T&&Q.extent==="parent"?Doe(T):void 0),R=[],I=void 0;for(const[$,z]of B)if(z.parentId===e&&(R.push({id:$,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const q=Loe(z,Q,z.origin??_);I?I=[[Math.min(q[0][0],I[0][0]),Math.min(q[0][1],I[0][1])],[Math.max(q[1][0],I[1][0]),Math.max(q[1][1],I[1][1])]]:I=q}x==null||x(Z,{...w})}).on("drag",Z=>{const{transform:B,snapGrid:H,snapToGrid:P,nodeOrigin:D}=n(),_=mh(Z.sourceEvent,{transform:B,snapGrid:H,snapToGrid:P,containerBounds:E}),X=[];if(!Q)return;const{x:Y,y:V,width:$,height:z}=w,q={},M=Q.origin??D,{width:G,height:ie,x:J,y:ne}=Moe(j,a.controlDirection,_,a.boundaries,a.keepAspectRatio,M,A,I),se=G!==$,pe=ie!==z,ye=J!==Y&&se,be=ne!==V&&pe;if(!ye&&!be&&!se&&!pe)return;if((ye||be||M[0]===1||M[1]===1)&&(q.x=ye?J:w.x,q.y=be?ne:w.y,w.x=q.x,w.y=q.y,R.length>0)){const We=J-Y,De=ne-V;for(const yt of R)yt.position={x:yt.position.x-We+M[0]*(G-$),y:yt.position.y-De+M[1]*(ie-z)},X.push(yt)}if((se||pe)&&(q.width=se&&(!a.resizeDirection||a.resizeDirection==="horizontal")?G:w.width,q.height=pe&&(!a.resizeDirection||a.resizeDirection==="vertical")?ie:w.height,w.width=q.width,w.height=q.height),T&&Q.expandParent){const We=M[0]*(q.width??0);q.x&&q.x<We&&(w.x=We,j.x=j.x-(q.x-We));const De=M[1]*(q.height??0);q.y&&q.y<De&&(w.y=De,j.y=j.y-(q.y-De))}const Se=Roe({width:w.width,prevWidth:$,height:w.height,prevHeight:z,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),ke={...w,direction:Se};(k==null?void 0:k(Z,ke))!==!1&&(W=!0,v==null||v(Z,ke),r(q,X))}).on("end",Z=>{W&&(b==null||b(Z,{...w}),i==null||i({...w}),W=!1)});s.call(F)}function u(){s.on(".drag",null)}return{update:o,destroy:u}}var t1={exports:{}},n1={},r1={exports:{}},i1={};/**
411
+ * @license React
412
+ * use-sync-external-store-shim.production.js
413
+ *
414
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
415
+ *
416
+ * This source code is licensed under the MIT license found in the
417
+ * LICENSE file in the root directory of this source tree.
418
+ */var uA;function Zoe(){if(uA)return i1;uA=1;var t=gp();function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function o(m,g){var x=g(),v=r({inst:{value:x,getSnapshot:g}}),b=v[0].inst,k=v[1];return s(function(){b.value=x,b.getSnapshot=g,u(b)&&k({inst:b})},[m,x,g]),i(function(){return u(b)&&k({inst:b}),m(function(){u(b)&&k({inst:b})})},[m]),a(x),x}function u(m){var g=m.getSnapshot;m=m.value;try{var x=g();return!n(m,x)}catch{return!0}}function d(m,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:o;return i1.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,i1}var dA;function Ioe(){return dA||(dA=1,r1.exports=Zoe()),r1.exports}/**
419
+ * @license React
420
+ * use-sync-external-store-shim/with-selector.production.js
421
+ *
422
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
423
+ *
424
+ * This source code is licensed under the MIT license found in the
425
+ * LICENSE file in the root directory of this source tree.
426
+ */var fA;function Boe(){if(fA)return n1;fA=1;var t=gp(),e=Ioe();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,o=t.useMemo,u=t.useDebugValue;return n1.useSyncExternalStoreWithSelector=function(d,h,m,g,x){var v=s(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=o(function(){function w(T){if(!j){if(j=!0,Q=T,T=g(T),x!==void 0&&b.hasValue){var A=b.value;if(x(A,T))return E=A}return E=T}if(A=E,r(Q,T))return A;var I=g(T);return x!==void 0&&x(A,I)?(Q=T,A):(Q=T,E=I)}var j=!1,Q,E,R=m===void 0?null:m;return[function(){return w(h())},R===null?void 0:function(){return w(R())}]},[h,m,g,x]);var k=i(d,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=k},[k]),u(k),k},n1}var hA;function qoe(){return hA||(hA=1,t1.exports=Boe()),t1.exports}var Voe=qoe();const Yoe=mp(Voe),Uoe={},pA=t=>{let e;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(e):h;if(!Object.is(g,e)){const x=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(v=>v(e,x))}},i=()=>e,u={setState:r,getState:i,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(Uoe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=e=t(r,i,u);return u},Woe=t=>t?pA(t):pA,{useDebugValue:Hoe}=zf,{useSyncExternalStoreWithSelector:Goe}=Yoe,Foe=t=>t;function vL(t,e=Foe,n){const r=Goe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Hoe(r),r}const mA=(t,e)=>{const n=Woe(t),r=(i,s=e)=>vL(n,i,s);return Object.assign(r,n),r},Koe=(t,e)=>t?mA(t,e):mA;function It(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,i]of t)if(!Object.is(i,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}const mv=C.createContext(null),Joe=mv.Provider,yL=Ss.error001();function at(t,e){const n=C.useContext(mv);if(n===null)throw new Error(yL);return vL(n,t,e)}function Bt(){const t=C.useContext(mv);if(t===null)throw new Error(yL);return C.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const gA={display:"none"},ece={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bL="react-flow__node-desc",SL="react-flow__edge-desc",tce="react-flow__aria-live",nce=t=>t.ariaLiveMessage,rce=t=>t.ariaLabelConfig;function ice({rfId:t}){const e=at(nce);return p.jsx("div",{id:`${tce}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ece,children:e})}function sce({rfId:t,disableKeyboardA11y:e}){const n=at(rce);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${bL}-${t}`,style:gA,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${SL}-${t}`,style:gA,children:n["edge.a11yDescription.default"]}),!e&&p.jsx(ice,{rfId:t})]})}const gv=C.forwardRef(({position:t="top-left",children:e,className:n,style:r,...i},s)=>{const a=`${t}`.split("-");return p.jsx("div",{className:gn(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:e})});gv.displayName="Panel";function ace({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:p.jsx(gv,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const lce=t=>{const e=[],n=[];for(const[,r]of t.nodeLookup)r.selected&&e.push(r.internals.userNode);for(const[,r]of t.edgeLookup)r.selected&&n.push(r);return{selectedNodes:e,selectedEdges:n}},Fg=t=>t.id;function oce(t,e){return It(t.selectedNodes.map(Fg),e.selectedNodes.map(Fg))&&It(t.selectedEdges.map(Fg),e.selectedEdges.map(Fg))}function cce({onSelectionChange:t}){const e=Bt(),{selectedNodes:n,selectedEdges:r}=at(lce,oce);return C.useEffect(()=>{const i={nodes:n,edges:r};t==null||t(i),e.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,t]),null}const uce=t=>!!t.onSelectionChangeHandlers;function dce({onSelectionChange:t}){const e=at(uce);return t||e?p.jsx(cce,{onSelectionChange:t}):null}const wL=[0,0],fce={x:0,y:0,zoom:1},hce=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],OA=[...hce,"rfId"],pce=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),xA={translateExtent:Fh,nodeOrigin:wL,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function mce(t){const{setNodes:e,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:u}=at(pce,It),d=Bt();C.useEffect(()=>(u(t.defaultNodes,t.defaultEdges),()=>{h.current=xA,o()}),[]);const h=C.useRef(xA);return C.useEffect(()=>{for(const m of OA){const g=t[m],x=h.current[m];g!==x&&(typeof t[m]>"u"||(m==="nodes"?e(g):m==="edges"?n(g):m==="minZoom"?r(g):m==="maxZoom"?i(g):m==="translateExtent"?s(g):m==="nodeExtent"?a(g):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:Kle(g)}):m==="fitView"?d.setState({fitViewQueued:g}):m==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[m]:g})))}h.current=t},OA.map(m=>t[m])),null}function vA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function gce(t){var r;const[e,n]=C.useState(t==="system"?null:t);return C.useEffect(()=>{if(t!=="system"){n(t);return}const i=vA(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[t]),e!==null?e:(r=vA())!=null&&r.matches?"dark":"light"}const yA=typeof document<"u"?document:null;function tp(t=null,e={target:yA,actInsideInputWithModifier:!0}){const[n,r]=C.useState(!1),i=C.useRef(!1),s=C.useRef(new Set([])),[a,o]=C.useMemo(()=>{if(t!==null){const d=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
427
+ `).replace(`
428
+
429
+ `,`
430
+ +`).split(`
431
+ `)),h=d.reduce((m,g)=>m.concat(...g),[]);return[d,h]}return[[],[]]},[t]);return C.useEffect(()=>{const u=(e==null?void 0:e.target)??yA,d=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const h=x=>{var k,w;if(i.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!i.current||i.current&&!d)&&nL(x))return!1;const b=SA(x.code,o);if(s.current.add(x[b]),bA(a,s.current,!1)){const j=((w=(k=x.composedPath)==null?void 0:k.call(x))==null?void 0:w[0])||x.target,Q=(j==null?void 0:j.nodeName)==="BUTTON"||(j==null?void 0:j.nodeName)==="A";e.preventDefault!==!1&&(i.current||!Q)&&x.preventDefault(),r(!0)}},m=x=>{const v=SA(x.code,o);bA(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(x[v]),x.key==="Meta"&&s.current.clear(),i.current=!1},g=()=>{s.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",m),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",m),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[t,r]),n}function bA(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(i=>e.has(i)))}function SA(t,e){return e.includes(t)?"code":"key"}const Oce=()=>{const t=Bt();return C.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:r}=t.getState();return r?r.scaleTo(e,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[r,i,s],panZoom:a}=t.getState();return a?(await a.setViewport({x:e.x??r,y:e.y??i,zoom:e.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,r]=t.getState().transform;return{x:e,y:n,zoom:r}},setCenter:async(e,n,r)=>t.getState().setCenter(e,n,r),fitBounds:async(e,n)=>{const{width:r,height:i,minZoom:s,maxZoom:a,panZoom:o}=t.getState(),u=lQ(e,r,i,s,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:r,snapGrid:i,snapToGrid:s,domNode:a}=t.getState();if(!a)return e;const{x:o,y:u}=a.getBoundingClientRect(),d={x:e.x-o,y:e.y-u},h=n.snapGrid??i,m=n.snapToGrid??s;return zp(d,r,m,h)},flowToScreenPosition:e=>{const{transform:n,domNode:r}=t.getState();if(!r)return e;const{x:i,y:s}=r.getBoundingClientRect(),a=bx(e,n);return{x:a.x+i,y:a.y+s}}}),[])};function kL(t,e){const n=[],r=new Map,i=[];for(const s of t)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(const s of e){const a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...s};for(const u of a)xce(u,o);n.push(o)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function xce(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function vce(t,e){return kL(t,e)}function yce(t,e){return kL(t,e)}function io(t,e){return{id:t,type:"select",selected:e}}function su(t,e=new Set,n=!1){const r=[];for(const[i,s]of t){const a=e.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(io(s.id,a)))}return r}function wA({items:t=[],lookup:e}){var i;const n=[],r=new Map(t.map(s=>[s.id,s]));for(const[s,a]of t.entries()){const o=e.get(a.id),u=((i=o==null?void 0:o.internals)==null?void 0:i.userNode)??o;u!==void 0&&u!==a&&n.push({id:a.id,item:a,type:"replace"}),u===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of e)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function kA(t){return{id:t.id,type:"remove"}}const QA=t=>Ile(t),bce=t=>WD(t);function QL(t){return C.forwardRef(t)}const Sce=typeof window<"u"?C.useLayoutEffect:C.useEffect;function CA(t){const[e,n]=C.useState(BigInt(0)),[r]=C.useState(()=>wce(()=>n(i=>i+BigInt(1))));return Sce(()=>{const i=r.get();i.length&&(t(i),r.reset())},[e]),r}function wce(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const CL=C.createContext(null);function kce({children:t}){const e=Bt(),n=C.useCallback(o=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:h,onNodesChange:m,nodeLookup:g,fitViewQueued:x,onNodesChangeMiddlewareMap:v}=e.getState();let b=u;for(const w of o)b=typeof w=="function"?w(b):w;let k=wA({items:b,lookup:g});for(const w of v.values())k=w(k);h&&d(b),k.length>0?m==null||m(k):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:j,setNodes:Q}=e.getState();w&&Q(j)})},[]),r=CA(n),i=C.useCallback(o=>{const{edges:u=[],setEdges:d,hasDefaultEdges:h,onEdgesChange:m,edgeLookup:g}=e.getState();let x=u;for(const v of o)x=typeof v=="function"?v(x):v;h?d(x):m&&m(wA({items:x,lookup:g}))},[]),s=CA(i),a=C.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return p.jsx(CL.Provider,{value:a,children:t})}function Qce(){const t=C.useContext(CL);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const Cce=t=>!!t.panZoom;function pQ(){const t=Oce(),e=Bt(),n=Qce(),r=at(Cce),i=C.useMemo(()=>{const s=m=>e.getState().nodeLookup.get(m),a=m=>{n.nodeQueue.push(m)},o=m=>{n.edgeQueue.push(m)},u=m=>{var w,j;const{nodeLookup:g,nodeOrigin:x}=e.getState(),v=QA(m)?m:g.get(m.id),b=v.parentId?eL(v.position,v.measured,v.parentId,g,x):v.position,k={...v,position:b,width:((w=v.measured)==null?void 0:w.width)??v.width,height:((j=v.measured)==null?void 0:j.height)??v.height};return Wu(k)},d=(m,g,x={replace:!1})=>{a(v=>v.map(b=>{if(b.id===m){const k=typeof g=="function"?g(b):g;return x.replace&&QA(k)?k:{...b,...k}}return b}))},h=(m,g,x={replace:!1})=>{o(v=>v.map(b=>{if(b.id===m){const k=typeof g=="function"?g(b):g;return x.replace&&bce(k)?k:{...b,...k}}return b}))};return{getNodes:()=>e.getState().nodes.map(m=>({...m})),getNode:m=>{var g;return(g=s(m))==null?void 0:g.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:m=[]}=e.getState();return m.map(g=>({...g}))},getEdge:m=>e.getState().edgeLookup.get(m),setNodes:a,setEdges:o,addNodes:m=>{const g=Array.isArray(m)?m:[m];n.nodeQueue.push(x=>[...x,...g])},addEdges:m=>{const g=Array.isArray(m)?m:[m];n.edgeQueue.push(x=>[...x,...g])},toObject:()=>{const{nodes:m=[],edges:g=[],transform:x}=e.getState(),[v,b,k]=x;return{nodes:m.map(w=>({...w})),edges:g.map(w=>({...w})),viewport:{x:v,y:b,zoom:k}}},deleteElements:async({nodes:m=[],edges:g=[]})=>{const{nodes:x,edges:v,onNodesDelete:b,onEdgesDelete:k,triggerNodeChanges:w,triggerEdgeChanges:j,onDelete:Q,onBeforeDelete:E}=e.getState(),{nodes:R,edges:T}=await Ule({nodesToRemove:m,edgesToRemove:g,nodes:x,edges:v,onBeforeDelete:E}),A=T.length>0,I=R.length>0;if(A){const W=T.map(kA);k==null||k(T),j(W)}if(I){const W=R.map(kA);b==null||b(R),w(W)}return(I||A)&&(Q==null||Q({nodes:R,edges:T})),{deletedNodes:R,deletedEdges:T}},getIntersectingNodes:(m,g=!0,x)=>{const v=F_(m),b=v?m:u(m),k=x!==void 0;return b?(x||e.getState().nodes).filter(w=>{const j=e.getState().nodeLookup.get(w.id);if(j&&!v&&(w.id===m.id||!j.internals.positionAbsolute))return!1;const Q=Wu(k?w:j),E=Jh(Q,b);return g&&E>0||E>=Q.width*Q.height||E>=b.width*b.height}):[]},isNodeIntersecting:(m,g,x=!0)=>{const b=F_(m)?m:u(m);if(!b)return!1;const k=Jh(b,g);return x&&k>0||k>=g.width*g.height||k>=b.width*b.height},updateNode:d,updateNodeData:(m,g,x={replace:!1})=>{d(m,v=>{const b=typeof g=="function"?g(v):g;return x.replace?{...v,data:b}:{...v,data:{...v.data,...b}}},x)},updateEdge:h,updateEdgeData:(m,g,x={replace:!1})=>{h(m,v=>{const b=typeof g=="function"?g(v):g;return x.replace?{...v,data:b}:{...v,data:{...v.data,...b}}},x)},getNodesBounds:m=>{const{nodeLookup:g,nodeOrigin:x}=e.getState();return Ble(m,{nodeLookup:g,nodeOrigin:x})},getHandleConnections:({type:m,id:g,nodeId:x})=>{var v;return Array.from(((v=e.getState().connectionLookup.get(`${x}-${m}${g?`-${g}`:""}`))==null?void 0:v.values())??[])},getNodeConnections:({type:m,handleId:g,nodeId:x})=>{var v;return Array.from(((v=e.getState().connectionLookup.get(`${x}${m?g?`-${m}-${g}`:`-${m}`:""}`))==null?void 0:v.values())??[])},fitView:async m=>{const g=e.getState().fitViewResolver??Fle();return e.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:g}),n.nodeQueue.push(x=>[...x]),g.promise}}},[]);return C.useMemo(()=>({...i,...t,viewportInitialized:r}),[r])}const jA=t=>t.selected,jce=typeof window<"u"?window:void 0;function Ece({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=Bt(),{deleteElements:r}=pQ(),i=tp(t,{actInsideInputWithModifier:!1}),s=tp(e,{target:jce});C.useEffect(()=>{if(i){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(jA),edges:a.filter(jA)}),n.setState({nodesSelectionActive:!1})}},[i]),C.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function $ce(t){const e=Bt();C.useEffect(()=>{const n=()=>{var i,s,a,o;if(!t.current||!(((s=(i=t.current).checkVisibility)==null?void 0:s.call(i))??!0))return!1;const r=oQ(t.current);(r.height===0||r.width===0)&&((o=(a=e.getState()).onError)==null||o.call(a,"004",Ss.error004())),e.setState({width:r.width||500,height:r.height||500})};if(t.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(t.current),()=>{window.removeEventListener("resize",n),r&&t.current&&r.unobserve(t.current)}}},[])}const Ov={position:"absolute",width:"100%",height:"100%",top:0,left:0},Nce=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function Tce({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=Ao.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:u,translateExtent:d,minZoom:h,maxZoom:m,zoomActivationKeyCode:g,preventScrolling:x=!0,children:v,noWheelClassName:b,noPanClassName:k,onViewportChange:w,isControlledViewport:j,paneClickDistance:Q,selectionOnDrag:E}){const R=Bt(),T=C.useRef(null),{userSelectionActive:A,lib:I,connectionInProgress:W}=at(Nce,It),F=tp(g),Z=C.useRef();$ce(T);const B=C.useCallback(H=>{w==null||w({x:H[0],y:H[1],zoom:H[2]}),j||R.setState({transform:H})},[w,j]);return C.useEffect(()=>{if(T.current){Z.current=Aoe({domNode:T.current,minZoom:h,maxZoom:m,translateExtent:d,viewport:u,onDraggingChange:_=>R.setState(X=>X.paneDragging===_?X:{paneDragging:_}),onPanZoomStart:(_,X)=>{const{onViewportChangeStart:Y,onMoveStart:V}=R.getState();V==null||V(_,X),Y==null||Y(X)},onPanZoom:(_,X)=>{const{onViewportChange:Y,onMove:V}=R.getState();V==null||V(_,X),Y==null||Y(X)},onPanZoomEnd:(_,X)=>{const{onViewportChangeEnd:Y,onMoveEnd:V}=R.getState();V==null||V(_,X),Y==null||Y(X)}});const{x:H,y:P,zoom:D}=Z.current.getViewport();return R.setState({panZoom:Z.current,transform:[H,P,D],domNode:T.current.closest(".react-flow")}),()=>{var _;(_=Z.current)==null||_.destroy()}}},[]),C.useEffect(()=>{var H;(H=Z.current)==null||H.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:F,preventScrolling:x,noPanClassName:k,userSelectionActive:A,noWheelClassName:b,lib:I,onTransformChange:B,connectionInProgress:W,selectionOnDrag:E,paneClickDistance:Q})},[t,e,n,r,i,s,a,o,F,x,k,A,b,I,B,W,E,Q]),p.jsx("div",{className:"react-flow__renderer",ref:T,style:Ov,children:v})}const Pce=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function _ce(){const{userSelectionActive:t,userSelectionRect:e}=at(Pce,It);return t&&e?p.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const s1=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},Ace=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function Rce({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Kh.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:o,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:h,onPaneMouseEnter:m,onPaneMouseMove:g,onPaneMouseLeave:x,children:v}){const b=Bt(),{userSelectionActive:k,elementsSelectable:w,dragging:j,connectionInProgress:Q}=at(Ace,It),E=w&&(t||k),R=C.useRef(null),T=C.useRef(),A=C.useRef(new Set),I=C.useRef(new Set),W=C.useRef(!1),F=Y=>{if(W.current||Q){W.current=!1;return}u==null||u(Y),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},Z=Y=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Y.preventDefault();return}d==null||d(Y)},B=h?Y=>h(Y):void 0,H=Y=>{W.current&&(Y.stopPropagation(),W.current=!1)},P=Y=>{var ie,J;const{domNode:V}=b.getState();if(T.current=V==null?void 0:V.getBoundingClientRect(),!T.current)return;const $=Y.target===R.current;if(!$&&!!Y.target.closest(".nokey")||!t||!(s&&$||e)||Y.button!==0||!Y.isPrimary)return;(J=(ie=Y.target)==null?void 0:ie.setPointerCapture)==null||J.call(ie,Y.pointerId),W.current=!1;const{x:M,y:G}=Ri(Y.nativeEvent,T.current);b.setState({userSelectionRect:{width:0,height:0,startX:M,startY:G,x:M,y:G}}),$||(Y.stopPropagation(),Y.preventDefault())},D=Y=>{const{userSelectionRect:V,transform:$,nodeLookup:z,edgeLookup:q,connectionLookup:M,triggerNodeChanges:G,triggerEdgeChanges:ie,defaultEdgeOptions:J,resetSelectedElements:ne}=b.getState();if(!T.current||!V)return;const{x:se,y:pe}=Ri(Y.nativeEvent,T.current),{startX:ye,startY:be}=V;if(!W.current){const De=e?0:i;if(Math.hypot(se-ye,pe-be)<=De)return;ne(),a==null||a(Y)}W.current=!0;const Se={startX:ye,startY:be,x:se<ye?se:ye,y:pe<be?pe:be,width:Math.abs(se-ye),height:Math.abs(pe-be)},ke=A.current,_e=I.current;A.current=new Set(aQ(z,Se,$,n===Kh.Partial,!0).map(De=>De.id)),I.current=new Set;const We=(J==null?void 0:J.selectable)??!0;for(const De of A.current){const yt=M.get(De);if(yt)for(const{edgeId:Cn}of yt.values()){const Jt=q.get(Cn);Jt&&(Jt.selectable??We)&&I.current.add(Cn)}}if(!K_(ke,A.current)){const De=su(z,A.current,!0);G(De)}if(!K_(_e,I.current)){const De=su(q,I.current);ie(De)}b.setState({userSelectionRect:Se,userSelectionActive:!0,nodesSelectionActive:!1})},_=Y=>{var V,$;Y.button===0&&(($=(V=Y.target)==null?void 0:V.releasePointerCapture)==null||$.call(V,Y.pointerId),!k&&Y.target===R.current&&b.getState().userSelectionRect&&(F==null||F(Y)),b.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(o==null||o(Y),b.setState({nodesSelectionActive:A.current.size>0})))},X=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:gn(["react-flow__pane",{draggable:X,dragging:j,selection:t}]),onClick:E?void 0:s1(F,R),onContextMenu:s1(Z,R),onWheel:s1(B,R),onPointerEnter:E?void 0:m,onPointerMove:E?D:g,onPointerUp:E?_:void 0,onPointerDownCapture:E?P:void 0,onClickCapture:E?H:void 0,onPointerLeave:x,ref:R,style:Ov,children:[v,p.jsx(_ce,{})]})}function nk({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:o,onError:u}=e.getState(),d=o.get(t);if(!d){u==null||u("012",Ss.error012(t));return}e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):i([t])}function jL({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){const o=Bt(),[u,d]=C.useState(!1),h=C.useRef();return C.useEffect(()=>{h.current=yoe({getStoreItems:()=>o.getState(),onNodeMouseDown:m=>{nk({id:m,store:o,nodeRef:t})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),C.useEffect(()=>{if(!(e||!t.current||!h.current))return h.current.update({noDragClassName:n,handleSelector:r,domNode:t.current,isSelectable:s,nodeId:i,nodeClickDistance:a}),()=>{var m;(m=h.current)==null||m.destroy()}},[n,r,e,s,t,i,a]),u}const Mce=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function EL(){const t=Bt();return C.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:o,updateNodePositions:u,nodeLookup:d,nodeOrigin:h}=t.getState(),m=new Map,g=Mce(a),x=i?s[0]:5,v=i?s[1]:5,b=n.direction.x*x*n.factor,k=n.direction.y*v*n.factor;for(const[,w]of d){if(!g(w))continue;let j={x:w.internals.positionAbsolute.x+b,y:w.internals.positionAbsolute.y+k};i&&(j=Mp(j,s));const{position:Q,positionAbsolute:E}=HD({nodeId:w.id,nextPosition:j,nodeLookup:d,nodeExtent:r,nodeOrigin:h,onError:o});w.position=Q,w.internals.positionAbsolute=E,m.set(w.id,w)}u(m)},[])}const mQ=C.createContext(null),zce=mQ.Provider;mQ.Consumer;const $L=()=>C.useContext(mQ),Dce=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),Lce=(t,e,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:o,toHandle:u,isValid:d}=a,h=(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===e&&(u==null?void 0:u.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===t&&(o==null?void 0:o.id)===e&&(o==null?void 0:o.type)===n,connectingTo:h,clickConnecting:(i==null?void 0:i.nodeId)===t&&(i==null?void 0:i.id)===e&&(i==null?void 0:i.type)===n,isPossibleEndHandle:s===Yu.Strict?(o==null?void 0:o.type)!==n:t!==(o==null?void 0:o.nodeId)||e!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!i,valid:h&&d}};function Xce({type:t="source",position:e=$e.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:o,children:u,className:d,onMouseDown:h,onTouchStart:m,...g},x){var D,_;const v=a||null,b=t==="target",k=Bt(),w=$L(),{connectOnClick:j,noPanClassName:Q,rfId:E}=at(Dce,It),{connectingFrom:R,connectingTo:T,clickConnecting:A,isPossibleEndHandle:I,connectionInProcess:W,clickConnectionInProcess:F,valid:Z}=at(Lce(w,v,t),It);w||(_=(D=k.getState()).onError)==null||_.call(D,"010",Ss.error010());const B=X=>{const{defaultEdgeOptions:Y,onConnect:V,hasDefaultEdges:$}=k.getState(),z={...Y,...X};if($){const{edges:q,setEdges:M}=k.getState();M(ioe(z,q))}V==null||V(z),o==null||o(z)},H=X=>{if(!w)return;const Y=rL(X.nativeEvent);if(i&&(Y&&X.button===0||!Y)){const V=k.getState();tk.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:b,handleId:v,nodeId:w,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:(...$)=>{var z,q;return(q=(z=k.getState()).onConnectEnd)==null?void 0:q.call(z,...$)},updateConnection:V.updateConnection,onConnect:B,isValidConnection:n||((...$)=>{var z,q;return((q=(z=k.getState()).isValidConnection)==null?void 0:q.call(z,...$))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}Y?h==null||h(X):m==null||m(X)},P=X=>{const{onClickConnectStart:Y,onClickConnectEnd:V,connectionClickStartHandle:$,connectionMode:z,isValidConnection:q,lib:M,rfId:G,nodeLookup:ie,connection:J}=k.getState();if(!w||!$&&!i)return;if(!$){Y==null||Y(X.nativeEvent,{nodeId:w,handleId:v,handleType:t}),k.setState({connectionClickStartHandle:{nodeId:w,type:t,id:v}});return}const ne=tL(X.target),se=n||q,{connection:pe,isValid:ye}=tk.isValid(X.nativeEvent,{handle:{nodeId:w,id:v,type:t},connectionMode:z,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:se,flowId:G,doc:ne,lib:M,nodeLookup:ie});ye&&pe&&B(pe);const be=structuredClone(J);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,V==null||V(X,be),k.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":v,"data-nodeid":w,"data-handlepos":e,"data-id":`${E}-${w}-${v}-${t}`,className:gn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",Q,d,{source:!b,target:b,connectable:r,connectablestart:i,connectableend:s,clickconnecting:A,connectingfrom:R,connectingto:T,valid:Z,connectionindicator:r&&(!W||I)&&(W||F?s:i)}]),onMouseDown:H,onTouchStart:H,onClick:j?P:void 0,ref:x,...g,children:u})}const Fu=C.memo(QL(Xce));function Zce({data:t,isConnectable:e,sourcePosition:n=$e.Bottom}){return p.jsxs(p.Fragment,{children:[t==null?void 0:t.label,p.jsx(Fu,{type:"source",position:n,isConnectable:e})]})}function Ice({data:t,isConnectable:e,targetPosition:n=$e.Top,sourcePosition:r=$e.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(Fu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,p.jsx(Fu,{type:"source",position:r,isConnectable:e})]})}function Bce(){return null}function qce({data:t,isConnectable:e,targetPosition:n=$e.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(Fu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const Sx={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},EA={input:Zce,default:Ice,output:qce,group:Bce};function Vce(t){var e,n,r,i;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((r=t.style)==null?void 0:r.width),height:t.height??((i=t.style)==null?void 0:i.height)}}const Yce=t=>{const{width:e,height:n,x:r,y:i}=Rp(t.nodeLookup,{filter:s=>!!s.selected});return{width:Ai(e)?e:null,height:Ai(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${r}px,${i}px)`}};function Uce({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=Bt(),{width:i,height:s,transformString:a,userSelectionActive:o}=at(Yce,It),u=EL(),d=C.useRef(null);C.useEffect(()=>{var x;n||(x=d.current)==null||x.focus({preventScroll:!0})},[n]);const h=!o&&i!==null&&s!==null;if(jL({nodeRef:d,disabled:!h}),!h)return null;const m=t?x=>{const v=r.getState().nodes.filter(b=>b.selected);t(x,v)}:void 0,g=x=>{Object.prototype.hasOwnProperty.call(Sx,x.key)&&(x.preventDefault(),u({direction:Sx[x.key],factor:x.shiftKey?4:1}))};return p.jsx("div",{className:gn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:a},children:p.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:s}})})}const $A=typeof window<"u"?window:void 0,Wce=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function NL({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:x,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:k,elementsSelectable:w,zoomOnScroll:j,zoomOnPinch:Q,panOnScroll:E,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:I,defaultViewport:W,translateExtent:F,minZoom:Z,maxZoom:B,preventScrolling:H,onSelectionContextMenu:P,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:X,onViewportChange:Y,isControlledViewport:V}){const{nodesSelectionActive:$,userSelectionActive:z}=at(Wce,It),q=tp(d,{target:$A}),M=tp(b,{target:$A}),G=M||I,ie=M||E,J=h&&G!==!0,ne=q||z||J;return Ece({deleteKeyCode:u,multiSelectionKeyCode:v}),p.jsx(Tce,{onPaneContextMenu:s,elementsSelectable:w,zoomOnScroll:j,zoomOnPinch:Q,panOnScroll:ie,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!q&&G,defaultViewport:W,translateExtent:F,minZoom:Z,maxZoom:B,zoomActivationKeyCode:k,preventScrolling:H,noWheelClassName:D,noPanClassName:_,onViewportChange:Y,isControlledViewport:V,paneClickDistance:o,selectionOnDrag:J,children:p.jsxs(Rce,{onSelectionStart:g,onSelectionEnd:x,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:G,isSelecting:!!ne,selectionMode:m,selectionKeyPressed:q,paneClickDistance:o,selectionOnDrag:J,children:[t,$&&p.jsx(Uce,{onSelectionContextMenu:P,noPanClassName:_,disableKeyboardA11y:X})]})})}NL.displayName="FlowRenderer";const Hce=C.memo(NL),Gce=t=>e=>t?aQ(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function Fce(t){return at(C.useCallback(Gce(t),[t]),It)}const Kce=t=>t.updateNodeInternals;function Jce(){const t=at(Kce),[e]=C.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),t(r)}));return C.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function eue({node:t,nodeType:e,hasDimensions:n,resizeObserver:r}){const i=Bt(),s=C.useRef(null),a=C.useRef(null),o=C.useRef(t.sourcePosition),u=C.useRef(t.targetPosition),d=C.useRef(e),h=n&&!!t.internals.handleBounds;return C.useEffect(()=>{s.current&&!t.hidden&&(!h||a.current!==s.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(s.current),a.current=s.current)},[h,t.hidden]),C.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),C.useEffect(()=>{if(s.current){const m=d.current!==e,g=o.current!==t.sourcePosition,x=u.current!==t.targetPosition;(m||g||x)&&(d.current=e,o.current=t.sourcePosition,u.current=t.targetPosition,i.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:s.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),s}function tue({id:t,onClick:e,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:o,elementsSelectable:u,nodesConnectable:d,nodesFocusable:h,resizeObserver:m,noDragClassName:g,noPanClassName:x,disableKeyboardA11y:v,rfId:b,nodeTypes:k,nodeClickDistance:w,onError:j}){const{node:Q,internals:E,isParent:R}=at(se=>{const pe=se.nodeLookup.get(t),ye=se.parentLookup.has(t);return{node:pe,internals:pe.internals,isParent:ye}},It);let T=Q.type||"default",A=(k==null?void 0:k[T])||EA[T];A===void 0&&(j==null||j("003",Ss.error003(T)),T="default",A=(k==null?void 0:k.default)||EA.default);const I=!!(Q.draggable||o&&typeof Q.draggable>"u"),W=!!(Q.selectable||u&&typeof Q.selectable>"u"),F=!!(Q.connectable||d&&typeof Q.connectable>"u"),Z=!!(Q.focusable||h&&typeof Q.focusable>"u"),B=Bt(),H=JD(Q),P=eue({node:Q,nodeType:T,hasDimensions:H,resizeObserver:m}),D=jL({nodeRef:P,disabled:Q.hidden||!I,noDragClassName:g,handleSelector:Q.dragHandle,nodeId:t,isSelectable:W,nodeClickDistance:w}),_=EL();if(Q.hidden)return null;const X=ba(Q),Y=Vce(Q),V=W||I||e||n||r||i,$=n?se=>n(se,{...E.userNode}):void 0,z=r?se=>r(se,{...E.userNode}):void 0,q=i?se=>i(se,{...E.userNode}):void 0,M=s?se=>s(se,{...E.userNode}):void 0,G=a?se=>a(se,{...E.userNode}):void 0,ie=se=>{const{selectNodesOnDrag:pe,nodeDragThreshold:ye}=B.getState();W&&(!pe||!I||ye>0)&&nk({id:t,store:B,nodeRef:P}),e&&e(se,{...E.userNode})},J=se=>{if(!(nL(se.nativeEvent)||v)){if(qD.includes(se.key)&&W){const pe=se.key==="Escape";nk({id:t,store:B,unselect:pe,nodeRef:P})}else if(I&&Q.selected&&Object.prototype.hasOwnProperty.call(Sx,se.key)){se.preventDefault();const{ariaLabelConfig:pe}=B.getState();B.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),_({direction:Sx[se.key],factor:se.shiftKey?4:1})}}},ne=()=>{var _e;if(v||!((_e=P.current)!=null&&_e.matches(":focus-visible")))return;const{transform:se,width:pe,height:ye,autoPanOnNodeFocus:be,setCenter:Se}=B.getState();if(!be)return;aQ(new Map([[t,Q]]),{x:0,y:0,width:pe,height:ye},se,!0).length>0||Se(Q.position.x+X.width/2,Q.position.y+X.height/2,{zoom:se[2]})};return p.jsx("div",{className:gn(["react-flow__node",`react-flow__node-${T}`,{[x]:I},Q.className,{selected:Q.selected,selectable:W,parent:R,draggable:I,dragging:D}]),ref:P,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:H?"visible":"hidden",...Q.style,...Y},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:$,onMouseMove:z,onMouseLeave:q,onContextMenu:M,onClick:ie,onDoubleClick:G,onKeyDown:Z?J:void 0,tabIndex:Z?0:void 0,onFocus:Z?ne:void 0,role:Q.ariaRole??(Z?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${bL}-${b}`,"aria-label":Q.ariaLabel,...Q.domAttributes,children:p.jsx(zce,{value:t,children:p.jsx(A,{id:t,data:Q.data,type:T,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:Q.selected??!1,selectable:W,draggable:I,deletable:Q.deletable??!0,isConnectable:F,sourcePosition:Q.sourcePosition,targetPosition:Q.targetPosition,dragging:D,dragHandle:Q.dragHandle,zIndex:E.z,parentId:Q.parentId,...X})})})}var nue=C.memo(tue);const rue=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function TL(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=at(rue,It),a=Fce(t.onlyRenderVisibleElements),o=Jce();return p.jsx("div",{className:"react-flow__nodes",style:Ov,children:a.map(u=>p.jsx(nue,{id:u,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:t.nodeClickDistance,onError:s},u))})}TL.displayName="NodeRenderer";const iue=C.memo(TL);function sue(t){return at(C.useCallback(n=>{if(!t)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&toe({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[t]),It)}const aue=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return p.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lue=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return p.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},NA={[vx.Arrow]:aue,[vx.ArrowClosed]:lue};function oue(t){const e=Bt();return C.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(NA,t)?NA[t]:((s=(i=e.getState()).onError)==null||s.call(i,"009",Ss.error009(t)),null)},[t])}const cue=({id:t,type:e,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const u=oue(e);return u?p.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:o,refX:"0",refY:"0",children:p.jsx(u,{color:n,strokeWidth:a})}):null},PL=({defaultColor:t,rfId:e})=>{const n=at(s=>s.edges),r=at(s=>s.defaultEdgeOptions),i=C.useMemo(()=>coe(n,{id:e,defaultColor:t,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,e,t]);return i.length?p.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:p.jsx("defs",{children:i.map(s=>p.jsx(cue,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};PL.displayName="MarkerDefinitions";var uue=C.memo(PL);function _L({x:t,y:e,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:u,className:d,...h}){const[m,g]=C.useState({x:1,y:0,width:0,height:0}),x=gn(["react-flow__edge-textwrapper",d]),v=C.useRef(null);return C.useEffect(()=>{if(v.current){const b=v.current.getBBox();g({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?p.jsxs("g",{transform:`translate(${t-m.width/2} ${e-m.height/2})`,className:x,visibility:m.width?"visible":"hidden",...h,children:[i&&p.jsx("rect",{width:m.width+2*a[0],x:-a[0],y:-a[1],height:m.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:o,ry:o}),p.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:v,style:r,children:n}),u]}):null}_L.displayName="EdgeText";const due=C.memo(_L);function xv({path:t,labelX:e,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:u,interactionWidth:d=20,...h}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...h,d:t,fill:"none",className:gn(["react-flow__edge-path",h.className])}),d?p.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Ai(e)&&Ai(n)?p.jsx(due,{x:e,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:u}):null]})}function TA({pos:t,x1:e,y1:n,x2:r,y2:i}){return t===$e.Left||t===$e.Right?[.5*(e+r),n]:[e,.5*(n+i)]}function AL({sourceX:t,sourceY:e,sourcePosition:n=$e.Bottom,targetX:r,targetY:i,targetPosition:s=$e.Top}){const[a,o]=TA({pos:n,x1:t,y1:e,x2:r,y2:i}),[u,d]=TA({pos:s,x1:r,y1:i,x2:t,y2:e}),[h,m,g,x]=iL({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:a,sourceControlY:o,targetControlX:u,targetControlY:d});return[`M${t},${e} C${a},${o} ${u},${d} ${r},${i}`,h,m,g,x]}function RL(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:o,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,style:v,markerEnd:b,markerStart:k,interactionWidth:w})=>{const[j,Q,E]=AL({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o}),R=t.isInternal?void 0:e;return p.jsx(xv,{id:R,path:j,labelX:Q,labelY:E,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,style:v,markerEnd:b,markerStart:k,interactionWidth:w})})}const fue=RL({isInternal:!1}),ML=RL({isInternal:!0});fue.displayName="SimpleBezierEdge";ML.displayName="SimpleBezierEdgeInternal";function zL(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,sourcePosition:x=$e.Bottom,targetPosition:v=$e.Top,markerEnd:b,markerStart:k,pathOptions:w,interactionWidth:j})=>{const[Q,E,R]=Kw({sourceX:n,sourceY:r,sourcePosition:x,targetX:i,targetY:s,targetPosition:v,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),T=t.isInternal?void 0:e;return p.jsx(xv,{id:T,path:Q,labelX:E,labelY:R,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:k,interactionWidth:j})})}const DL=zL({isInternal:!1}),LL=zL({isInternal:!0});DL.displayName="SmoothStepEdge";LL.displayName="SmoothStepEdgeInternal";function XL(t){return C.memo(({id:e,...n})=>{var i;const r=t.isInternal?void 0:e;return p.jsx(DL,{...n,id:r,pathOptions:C.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const hue=XL({isInternal:!1}),ZL=XL({isInternal:!0});hue.displayName="StepEdge";ZL.displayName="StepEdgeInternal";function IL(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:b})=>{const[k,w,j]=lL({sourceX:n,sourceY:r,targetX:i,targetY:s}),Q=t.isInternal?void 0:e;return p.jsx(xv,{id:Q,path:k,labelX:w,labelY:j,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:b})})}const pue=IL({isInternal:!1}),BL=IL({isInternal:!0});pue.displayName="StraightEdge";BL.displayName="StraightEdgeInternal";function qL(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=$e.Bottom,targetPosition:o=$e.Top,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,style:v,markerEnd:b,markerStart:k,pathOptions:w,interactionWidth:j})=>{const[Q,E,R]=sL({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o,curvature:w==null?void 0:w.curvature}),T=t.isInternal?void 0:e;return p.jsx(xv,{id:T,path:Q,labelX:E,labelY:R,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,style:v,markerEnd:b,markerStart:k,interactionWidth:j})})}const mue=qL({isInternal:!1}),VL=qL({isInternal:!0});mue.displayName="BezierEdge";VL.displayName="BezierEdgeInternal";const PA={default:VL,straight:BL,step:ZL,smoothstep:LL,simplebezier:ML},_A={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},gue=(t,e,n)=>n===$e.Left?t-e:n===$e.Right?t+e:t,Oue=(t,e,n)=>n===$e.Top?t-e:n===$e.Bottom?t+e:t,AA="react-flow__edgeupdater";function RA({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:o}){return p.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:gn([AA,`${AA}-${o}`]),cx:gue(e,r,t),cy:Oue(n,r,t),r,stroke:"transparent",fill:"transparent"})}function xue({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:o,targetPosition:u,onReconnect:d,onReconnectStart:h,onReconnectEnd:m,setReconnecting:g,setUpdateHover:x}){const v=Bt(),b=(E,R)=>{if(E.button!==0)return;const{autoPanOnConnect:T,domNode:A,connectionMode:I,connectionRadius:W,lib:F,onConnectStart:Z,cancelConnection:B,nodeLookup:H,rfId:P,panBy:D,updateConnection:_}=v.getState(),X=R.type==="target",Y=(z,q)=>{g(!1),m==null||m(z,n,R.type,q)},V=z=>d==null?void 0:d(n,z),$=(z,q)=>{g(!0),h==null||h(E,n,R.type),Z==null||Z(z,q)};tk.onPointerDown(E.nativeEvent,{autoPanOnConnect:T,connectionMode:I,connectionRadius:W,domNode:A,handleId:R.id,nodeId:R.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:R.type,lib:F,flowId:P,cancelConnection:B,panBy:D,isValidConnection:(...z)=>{var q,M;return((M=(q=v.getState()).isValidConnection)==null?void 0:M.call(q,...z))??!0},onConnect:V,onConnectStart:$,onConnectEnd:(...z)=>{var q,M;return(M=(q=v.getState()).onConnectEnd)==null?void 0:M.call(q,...z)},onReconnectEnd:Y,updateConnection:_,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},k=E=>b(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=E=>b(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),j=()=>x(!0),Q=()=>x(!1);return p.jsxs(p.Fragment,{children:[(t===!0||t==="source")&&p.jsx(RA,{position:o,centerX:r,centerY:i,radius:e,onMouseDown:k,onMouseEnter:j,onMouseOut:Q,type:"source"}),(t===!0||t==="target")&&p.jsx(RA,{position:u,centerX:s,centerY:a,radius:e,onMouseDown:w,onMouseEnter:j,onMouseOut:Q,type:"target"})]})}function vue({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:o,onMouseMove:u,onMouseLeave:d,reconnectRadius:h,onReconnect:m,onReconnectStart:g,onReconnectEnd:x,rfId:v,edgeTypes:b,noPanClassName:k,onError:w,disableKeyboardA11y:j}){let Q=at(Se=>Se.edgeLookup.get(t));const E=at(Se=>Se.defaultEdgeOptions);Q=E?{...E,...Q}:Q;let R=Q.type||"default",T=(b==null?void 0:b[R])||PA[R];T===void 0&&(w==null||w("011",Ss.error011(R)),R="default",T=(b==null?void 0:b.default)||PA.default);const A=!!(Q.focusable||e&&typeof Q.focusable>"u"),I=typeof m<"u"&&(Q.reconnectable||n&&typeof Q.reconnectable>"u"),W=!!(Q.selectable||r&&typeof Q.selectable>"u"),F=C.useRef(null),[Z,B]=C.useState(!1),[H,P]=C.useState(!1),D=Bt(),{zIndex:_,sourceX:X,sourceY:Y,targetX:V,targetY:$,sourcePosition:z,targetPosition:q}=at(C.useCallback(Se=>{const ke=Se.nodeLookup.get(Q.source),_e=Se.nodeLookup.get(Q.target);if(!ke||!_e)return{zIndex:Q.zIndex,..._A};const We=ooe({id:t,sourceNode:ke,targetNode:_e,sourceHandle:Q.sourceHandle||null,targetHandle:Q.targetHandle||null,connectionMode:Se.connectionMode,onError:w});return{zIndex:eoe({selected:Q.selected,zIndex:Q.zIndex,sourceNode:ke,targetNode:_e,elevateOnSelect:Se.elevateEdgesOnSelect,zIndexMode:Se.zIndexMode}),...We||_A}},[Q.source,Q.target,Q.sourceHandle,Q.targetHandle,Q.selected,Q.zIndex]),It),M=C.useMemo(()=>Q.markerStart?`url('#${Jw(Q.markerStart,v)}')`:void 0,[Q.markerStart,v]),G=C.useMemo(()=>Q.markerEnd?`url('#${Jw(Q.markerEnd,v)}')`:void 0,[Q.markerEnd,v]);if(Q.hidden||X===null||Y===null||V===null||$===null)return null;const ie=Se=>{var De;const{addSelectedEdges:ke,unselectNodesAndEdges:_e,multiSelectionActive:We}=D.getState();W&&(D.setState({nodesSelectionActive:!1}),Q.selected&&We?(_e({nodes:[],edges:[Q]}),(De=F.current)==null||De.blur()):ke([t])),i&&i(Se,Q)},J=s?Se=>{s(Se,{...Q})}:void 0,ne=a?Se=>{a(Se,{...Q})}:void 0,se=o?Se=>{o(Se,{...Q})}:void 0,pe=u?Se=>{u(Se,{...Q})}:void 0,ye=d?Se=>{d(Se,{...Q})}:void 0,be=Se=>{var ke;if(!j&&qD.includes(Se.key)&&W){const{unselectNodesAndEdges:_e,addSelectedEdges:We}=D.getState();Se.key==="Escape"?((ke=F.current)==null||ke.blur(),_e({edges:[Q]})):We([t])}};return p.jsx("svg",{style:{zIndex:_},children:p.jsxs("g",{className:gn(["react-flow__edge",`react-flow__edge-${R}`,Q.className,k,{selected:Q.selected,animated:Q.animated,inactive:!W&&!i,updating:Z,selectable:W}]),onClick:ie,onDoubleClick:J,onContextMenu:ne,onMouseEnter:se,onMouseMove:pe,onMouseLeave:ye,onKeyDown:A?be:void 0,tabIndex:A?0:void 0,role:Q.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":Q.ariaLabel===null?void 0:Q.ariaLabel||`Edge from ${Q.source} to ${Q.target}`,"aria-describedby":A?`${SL}-${v}`:void 0,ref:F,...Q.domAttributes,children:[!H&&p.jsx(T,{id:t,source:Q.source,target:Q.target,type:Q.type,selected:Q.selected,animated:Q.animated,selectable:W,deletable:Q.deletable??!0,label:Q.label,labelStyle:Q.labelStyle,labelShowBg:Q.labelShowBg,labelBgStyle:Q.labelBgStyle,labelBgPadding:Q.labelBgPadding,labelBgBorderRadius:Q.labelBgBorderRadius,sourceX:X,sourceY:Y,targetX:V,targetY:$,sourcePosition:z,targetPosition:q,data:Q.data,style:Q.style,sourceHandleId:Q.sourceHandle,targetHandleId:Q.targetHandle,markerStart:M,markerEnd:G,pathOptions:"pathOptions"in Q?Q.pathOptions:void 0,interactionWidth:Q.interactionWidth}),I&&p.jsx(xue,{edge:Q,isReconnectable:I,reconnectRadius:h,onReconnect:m,onReconnectStart:g,onReconnectEnd:x,sourceX:X,sourceY:Y,targetX:V,targetY:$,sourcePosition:z,targetPosition:q,setUpdateHover:B,setReconnecting:P})]})})}var yue=C.memo(vue);const bue=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function YL({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:h,reconnectRadius:m,onEdgeDoubleClick:g,onReconnectStart:x,onReconnectEnd:v,disableKeyboardA11y:b}){const{edgesFocusable:k,edgesReconnectable:w,elementsSelectable:j,onError:Q}=at(bue,It),E=sue(e);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(uue,{defaultColor:t,rfId:n}),E.map(R=>p.jsx(yue,{id:R,edgesFocusable:k,edgesReconnectable:w,elementsSelectable:j,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:o,onMouseMove:u,onMouseLeave:d,onClick:h,reconnectRadius:m,onDoubleClick:g,onReconnectStart:x,onReconnectEnd:v,rfId:n,onError:Q,edgeTypes:r,disableKeyboardA11y:b},R))]})}YL.displayName="EdgeRenderer";const Sue=C.memo(YL),wue=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function kue({children:t}){const e=at(wue);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function Que(t){const e=pQ(),n=C.useRef(!1);C.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const Cue=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function jue(t){const e=at(Cue),n=Bt();return C.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function Eue(t){return t.connection.inProgress?{...t.connection,to:zp(t.connection.to,t.transform)}:{...t.connection}}function $ue(t){return Eue}function Nue(t){const e=$ue();return at(e,It)}const Tue=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function Pue({containerStyle:t,style:e,type:n,component:r}){const{nodesConnectable:i,width:s,height:a,isValid:o,inProgress:u}=at(Tue,It);return!(s&&i&&u)?null:p.jsx("svg",{style:t,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:gn(["react-flow__connection",UD(o)]),children:p.jsx(UL,{style:e,type:n,CustomComponent:r,isValid:o})})})}const UL=({style:t,type:e=ul.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:a,fromHandle:o,fromPosition:u,to:d,toNode:h,toHandle:m,toPosition:g,pointer:x}=Nue();if(!i)return;if(n)return p.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:a,fromHandle:o,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:UD(r),toNode:h,toHandle:m,pointer:x});let v="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(e){case ul.Bezier:[v]=sL(b);break;case ul.SimpleBezier:[v]=AL(b);break;case ul.Step:[v]=Kw({...b,borderRadius:0});break;case ul.SmoothStep:[v]=Kw(b);break;default:[v]=lL(b)}return p.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:t})};UL.displayName="ConnectionLine";const _ue={};function MA(t=_ue){C.useRef(t),Bt(),C.useEffect(()=>{},[t])}function Aue(){Bt(),C.useRef(!1),C.useEffect(()=>{},[])}function WL({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:x,connectionLineType:v,connectionLineStyle:b,connectionLineComponent:k,connectionLineContainerStyle:w,selectionKeyCode:j,selectionOnDrag:Q,selectionMode:E,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:I,onlyRenderVisibleElements:W,elementsSelectable:F,defaultViewport:Z,translateExtent:B,minZoom:H,maxZoom:P,preventScrolling:D,defaultMarkerColor:_,zoomOnScroll:X,zoomOnPinch:Y,panOnScroll:V,panOnScrollSpeed:$,panOnScrollMode:z,zoomOnDoubleClick:q,panOnDrag:M,onPaneClick:G,onPaneMouseEnter:ie,onPaneMouseMove:J,onPaneMouseLeave:ne,onPaneScroll:se,onPaneContextMenu:pe,paneClickDistance:ye,nodeClickDistance:be,onEdgeContextMenu:Se,onEdgeMouseEnter:ke,onEdgeMouseMove:_e,onEdgeMouseLeave:We,reconnectRadius:De,onReconnect:yt,onReconnectStart:Cn,onReconnectEnd:Jt,noDragClassName:jn,noWheelClassName:ar,noPanClassName:Er,disableKeyboardA11y:Ur,nodeExtent:en,rfId:wi,viewport:ue,onViewportChange:ge}){return MA(t),MA(e),Aue(),Que(n),jue(ue),p.jsx(Hce,{onPaneClick:G,onPaneMouseEnter:ie,onPaneMouseMove:J,onPaneMouseLeave:ne,onPaneContextMenu:pe,onPaneScroll:se,paneClickDistance:ye,deleteKeyCode:I,selectionKeyCode:j,selectionOnDrag:Q,selectionMode:E,onSelectionStart:g,onSelectionEnd:x,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:F,zoomOnScroll:X,zoomOnPinch:Y,zoomOnDoubleClick:q,panOnScroll:V,panOnScrollSpeed:$,panOnScrollMode:z,panOnDrag:M,defaultViewport:Z,translateExtent:B,minZoom:H,maxZoom:P,onSelectionContextMenu:m,preventScrolling:D,noDragClassName:jn,noWheelClassName:ar,noPanClassName:Er,disableKeyboardA11y:Ur,onViewportChange:ge,isControlledViewport:!!ue,children:p.jsxs(kue,{children:[p.jsx(Sue,{edgeTypes:e,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:yt,onReconnectStart:Cn,onReconnectEnd:Jt,onlyRenderVisibleElements:W,onEdgeContextMenu:Se,onEdgeMouseEnter:ke,onEdgeMouseMove:_e,onEdgeMouseLeave:We,reconnectRadius:De,defaultMarkerColor:_,noPanClassName:Er,disableKeyboardA11y:Ur,rfId:wi}),p.jsx(Pue,{style:b,type:v,component:k,containerStyle:w}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(iue,{nodeTypes:t,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:o,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:be,onlyRenderVisibleElements:W,noPanClassName:Er,noDragClassName:jn,disableKeyboardA11y:Ur,nodeExtent:en,rfId:wi}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}WL.displayName="GraphView";const Rue=C.memo(WL),zA=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:u=.5,maxZoom:d=2,nodeOrigin:h,nodeExtent:m,zIndexMode:g="basic"}={})=>{const x=new Map,v=new Map,b=new Map,k=new Map,w=r??e??[],j=n??t??[],Q=h??[0,0],E=m??Fh;uL(b,k,w);const R=ek(j,x,v,{nodeOrigin:Q,nodeExtent:E,zIndexMode:g});let T=[0,0,1];if(a&&i&&s){const A=Rp(x,{filter:Z=>!!((Z.width||Z.initialWidth)&&(Z.height||Z.initialHeight))}),{x:I,y:W,zoom:F}=lQ(A,i,s,u,d,(o==null?void 0:o.padding)??.1);T=[I,W,F]}return{rfId:"1",width:i??0,height:s??0,transform:T,nodes:j,nodesInitialized:R,nodeLookup:x,parentLookup:v,edges:w,edgeLookup:k,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:Fh,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Yu.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:Q,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...YD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Wle,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:VD,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Mue=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:u,maxZoom:d,nodeOrigin:h,nodeExtent:m,zIndexMode:g})=>Koe((x,v)=>{async function b(){const{nodeLookup:k,panZoom:w,fitViewOptions:j,fitViewResolver:Q,width:E,height:R,minZoom:T,maxZoom:A}=v();w&&(await Yle({nodes:k,width:E,height:R,panZoom:w,minZoom:T,maxZoom:A},j),Q==null||Q.resolve(!0),x({fitViewResolver:null}))}return{...zA({nodes:t,edges:e,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:u,maxZoom:d,nodeOrigin:h,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:k=>{const{nodeLookup:w,parentLookup:j,nodeOrigin:Q,elevateNodesOnSelect:E,fitViewQueued:R,zIndexMode:T}=v(),A=ek(k,w,j,{nodeOrigin:Q,nodeExtent:m,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:T});R&&A?(b(),x({nodes:k,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:k,nodesInitialized:A})},setEdges:k=>{const{connectionLookup:w,edgeLookup:j}=v();uL(w,j,k),x({edges:k})},setDefaultNodesAndEdges:(k,w)=>{if(k){const{setNodes:j}=v();j(k),x({hasDefaultNodes:!0})}if(w){const{setEdges:j}=v();j(w),x({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:w,nodeLookup:j,parentLookup:Q,domNode:E,nodeOrigin:R,nodeExtent:T,debug:A,fitViewQueued:I,zIndexMode:W}=v(),{changes:F,updatedInternals:Z}=goe(k,j,Q,E,R,T,W);Z&&(foe(j,Q,{nodeOrigin:R,nodeExtent:T,zIndexMode:W}),I?(b(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(F==null?void 0:F.length)>0&&(A&&console.log("React Flow: trigger node changes",F),w==null||w(F)))},updateNodePositions:(k,w=!1)=>{const j=[];let Q=[];const{nodeLookup:E,triggerNodeChanges:R,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:I}=v();for(const[W,F]of k){const Z=E.get(W),B=!!(Z!=null&&Z.expandParent&&(Z!=null&&Z.parentId)&&(F!=null&&F.position)),H={id:W,type:"position",position:B?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:w};if(Z&&T.inProgress&&T.fromNode.id===Z.id){const P=Bo(Z,T.fromHandle,$e.Left,!0);A({...T,from:P})}B&&Z.parentId&&j.push({id:W,parentId:Z.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),Q.push(H)}if(j.length>0){const{parentLookup:W,nodeOrigin:F}=v(),Z=hQ(j,E,W,F);Q.push(...Z)}for(const W of I.values())Q=W(Q);R(Q)},triggerNodeChanges:k=>{const{onNodesChange:w,setNodes:j,nodes:Q,hasDefaultNodes:E,debug:R}=v();if(k!=null&&k.length){if(E){const T=vce(k,Q);j(T)}R&&console.log("React Flow: trigger node changes",k),w==null||w(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:w,setEdges:j,edges:Q,hasDefaultEdges:E,debug:R}=v();if(k!=null&&k.length){if(E){const T=yce(k,Q);j(T)}R&&console.log("React Flow: trigger edge changes",k),w==null||w(k)}},addSelectedNodes:k=>{const{multiSelectionActive:w,edgeLookup:j,nodeLookup:Q,triggerNodeChanges:E,triggerEdgeChanges:R}=v();if(w){const T=k.map(A=>io(A,!0));E(T);return}E(su(Q,new Set([...k]),!0)),R(su(j))},addSelectedEdges:k=>{const{multiSelectionActive:w,edgeLookup:j,nodeLookup:Q,triggerNodeChanges:E,triggerEdgeChanges:R}=v();if(w){const T=k.map(A=>io(A,!0));R(T);return}R(su(j,new Set([...k]))),E(su(Q,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:w}={})=>{const{edges:j,nodes:Q,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:T}=v(),A=k||Q,I=w||j,W=[];for(const Z of A){if(!Z.selected)continue;const B=E.get(Z.id);B&&(B.selected=!1),W.push(io(Z.id,!1))}const F=[];for(const Z of I)Z.selected&&F.push(io(Z.id,!1));R(W),T(F)},setMinZoom:k=>{const{panZoom:w,maxZoom:j}=v();w==null||w.setScaleExtent([k,j]),x({minZoom:k})},setMaxZoom:k=>{const{panZoom:w,minZoom:j}=v();w==null||w.setScaleExtent([j,k]),x({maxZoom:k})},setTranslateExtent:k=>{var w;(w=v().panZoom)==null||w.setTranslateExtent(k),x({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:w,triggerNodeChanges:j,triggerEdgeChanges:Q,elementsSelectable:E}=v();if(!E)return;const R=w.reduce((A,I)=>I.selected?[...A,io(I.id,!1)]:A,[]),T=k.reduce((A,I)=>I.selected?[...A,io(I.id,!1)]:A,[]);j(R),Q(T)},setNodeExtent:k=>{const{nodes:w,nodeLookup:j,parentLookup:Q,nodeOrigin:E,elevateNodesOnSelect:R,nodeExtent:T,zIndexMode:A}=v();k[0][0]===T[0][0]&&k[0][1]===T[0][1]&&k[1][0]===T[1][0]&&k[1][1]===T[1][1]||(ek(w,j,Q,{nodeOrigin:E,nodeExtent:k,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:A}),x({nodeExtent:k}))},panBy:k=>{const{transform:w,width:j,height:Q,panZoom:E,translateExtent:R}=v();return Ooe({delta:k,panZoom:E,transform:w,translateExtent:R,width:j,height:Q})},setCenter:async(k,w,j)=>{const{width:Q,height:E,maxZoom:R,panZoom:T}=v();if(!T)return Promise.resolve(!1);const A=typeof(j==null?void 0:j.zoom)<"u"?j.zoom:R;return await T.setViewport({x:Q/2-k*A,y:E/2-w*A,zoom:A},{duration:j==null?void 0:j.duration,ease:j==null?void 0:j.ease,interpolate:j==null?void 0:j.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...YD}})},updateConnection:k=>{x({connection:k})},reset:()=>x({...zA()})}},Object.is);function zue({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:u,fitView:d,nodeOrigin:h,nodeExtent:m,zIndexMode:g,children:x}){const[v]=C.useState(()=>Mue({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:d,minZoom:a,maxZoom:o,fitViewOptions:u,nodeOrigin:h,nodeExtent:m,zIndexMode:g}));return p.jsx(Joe,{value:v,children:p.jsx(kce,{children:x})})}function Due({children:t,nodes:e,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:o,fitViewOptions:u,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:g,zIndexMode:x}){return C.useContext(mv)?p.jsx(p.Fragment,{children:t}):p.jsx(zue,{initialNodes:e,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:o,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:h,nodeOrigin:m,nodeExtent:g,zIndexMode:x,children:t})}const Lue={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Xue({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:o,onEdgeClick:u,onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:v,onConnectEnd:b,onClickConnectStart:k,onClickConnectEnd:w,onNodeMouseEnter:j,onNodeMouseMove:Q,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:I,onNodeDragStop:W,onNodesDelete:F,onEdgesDelete:Z,onDelete:B,onSelectionChange:H,onSelectionDragStart:P,onSelectionDrag:D,onSelectionDragStop:_,onSelectionContextMenu:X,onSelectionStart:Y,onSelectionEnd:V,onBeforeDelete:$,connectionMode:z,connectionLineType:q=ul.Bezier,connectionLineStyle:M,connectionLineComponent:G,connectionLineContainerStyle:ie,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:se=!1,selectionMode:pe=Kh.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:be=ep()?"Meta":"Control",zoomActivationKeyCode:Se=ep()?"Meta":"Control",snapToGrid:ke,snapGrid:_e,onlyRenderVisibleElements:We=!1,selectNodesOnDrag:De,nodesDraggable:yt,autoPanOnNodeFocus:Cn,nodesConnectable:Jt,nodesFocusable:jn,nodeOrigin:ar=wL,edgesFocusable:Er,edgesReconnectable:Ur,elementsSelectable:en=!0,defaultViewport:wi=fce,minZoom:ue=.5,maxZoom:ge=2,translateExtent:Pe=Fh,preventScrolling:Ie=!0,nodeExtent:Ke,defaultMarkerColor:Ve="#b1b1b7",zoomOnScroll:ht=!0,zoomOnPinch:kt=!0,panOnScroll:Qt=!1,panOnScrollSpeed:qt=.5,panOnScrollMode:ot=Ao.Free,zoomOnDoubleClick:Wr=!0,panOnDrag:En=!0,onPaneClick:wd,onPaneMouseEnter:Hr,onPaneMouseMove:ic,onPaneMouseLeave:sc,onPaneScroll:js,onPaneContextMenu:ac,paneClickDistance:Al=1,nodeClickDistance:Av=0,children:Fp,onReconnect:kd,onReconnectStart:Rl,onReconnectEnd:Rv,onEdgeContextMenu:Kp,onEdgeDoubleClick:Jp,onEdgeMouseEnter:em,onEdgeMouseMove:Qd,onEdgeMouseLeave:Cd,reconnectRadius:tm=10,onNodesChange:nm,onEdgesChange:Ui,noDragClassName:On="nodrag",noWheelClassName:Ln="nowheel",noPanClassName:Es="nopan",fitView:lc,fitViewOptions:rm,connectOnClick:Mv,attributionPosition:im,proOptions:Ml,defaultEdgeOptions:jd,elevateNodesOnSelect:ka=!0,elevateEdgesOnSelect:Qa=!1,disableKeyboardA11y:Ca=!1,autoPanOnConnect:ja,autoPanOnNodeDrag:on,autoPanSpeed:sm,connectionRadius:am,isValidConnection:$s,onError:Ea,style:zv,id:Ed,nodeDragThreshold:lm,connectionDragThreshold:Dv,viewport:oc,onViewportChange:cc,width:ki,height:lr,colorMode:om="light",debug:Lv,onScroll:$a,ariaLabelConfig:cm,zIndexMode:zl="basic",...Xv},or){const Dl=Ed||"1",um=gce(om),$d=C.useCallback(Ns=>{Ns.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),$a==null||$a(Ns)},[$a]);return p.jsx("div",{"data-testid":"rf__wrapper",...Xv,onScroll:$d,style:{...zv,...Lue},ref:or,className:gn(["react-flow",i,um]),id:Ed,role:"application",children:p.jsxs(Due,{nodes:t,edges:e,width:ki,height:lr,fitView:lc,fitViewOptions:rm,minZoom:ue,maxZoom:ge,nodeOrigin:ar,nodeExtent:Ke,zIndexMode:zl,children:[p.jsx(Rue,{onInit:d,onNodeClick:o,onEdgeClick:u,onNodeMouseEnter:j,onNodeMouseMove:Q,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:T,nodeTypes:s,edgeTypes:a,connectionLineType:q,connectionLineStyle:M,connectionLineComponent:G,connectionLineContainerStyle:ie,selectionKeyCode:ne,selectionOnDrag:se,selectionMode:pe,deleteKeyCode:J,multiSelectionKeyCode:be,panActivationKeyCode:ye,zoomActivationKeyCode:Se,onlyRenderVisibleElements:We,defaultViewport:wi,translateExtent:Pe,minZoom:ue,maxZoom:ge,preventScrolling:Ie,zoomOnScroll:ht,zoomOnPinch:kt,zoomOnDoubleClick:Wr,panOnScroll:Qt,panOnScrollSpeed:qt,panOnScrollMode:ot,panOnDrag:En,onPaneClick:wd,onPaneMouseEnter:Hr,onPaneMouseMove:ic,onPaneMouseLeave:sc,onPaneScroll:js,onPaneContextMenu:ac,paneClickDistance:Al,nodeClickDistance:Av,onSelectionContextMenu:X,onSelectionStart:Y,onSelectionEnd:V,onReconnect:kd,onReconnectStart:Rl,onReconnectEnd:Rv,onEdgeContextMenu:Kp,onEdgeDoubleClick:Jp,onEdgeMouseEnter:em,onEdgeMouseMove:Qd,onEdgeMouseLeave:Cd,reconnectRadius:tm,defaultMarkerColor:Ve,noDragClassName:On,noWheelClassName:Ln,noPanClassName:Es,rfId:Dl,disableKeyboardA11y:Ca,nodeExtent:Ke,viewport:oc,onViewportChange:cc}),p.jsx(mce,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:v,onConnectEnd:b,onClickConnectStart:k,onClickConnectEnd:w,nodesDraggable:yt,autoPanOnNodeFocus:Cn,nodesConnectable:Jt,nodesFocusable:jn,edgesFocusable:Er,edgesReconnectable:Ur,elementsSelectable:en,elevateNodesOnSelect:ka,elevateEdgesOnSelect:Qa,minZoom:ue,maxZoom:ge,nodeExtent:Ke,onNodesChange:nm,onEdgesChange:Ui,snapToGrid:ke,snapGrid:_e,connectionMode:z,translateExtent:Pe,connectOnClick:Mv,defaultEdgeOptions:jd,fitView:lc,fitViewOptions:rm,onNodesDelete:F,onEdgesDelete:Z,onDelete:B,onNodeDragStart:A,onNodeDrag:I,onNodeDragStop:W,onSelectionDrag:D,onSelectionDragStart:P,onSelectionDragStop:_,onMove:h,onMoveStart:m,onMoveEnd:g,noPanClassName:Es,nodeOrigin:ar,rfId:Dl,autoPanOnConnect:ja,autoPanOnNodeDrag:on,autoPanSpeed:sm,onError:Ea,connectionRadius:am,isValidConnection:$s,selectNodesOnDrag:De,nodeDragThreshold:lm,connectionDragThreshold:Dv,onBeforeDelete:$,debug:Lv,ariaLabelConfig:cm,zIndexMode:zl}),p.jsx(dce,{onSelectionChange:H}),Fp,p.jsx(ace,{proOptions:Ml,position:im}),p.jsx(sce,{rfId:Dl,disableKeyboardA11y:Ca})]})})}var Zue=QL(Xue);function Iue({dimensions:t,lineWidth:e,variant:n,className:r}){return p.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:gn(["react-flow__background-pattern",n,r])})}function Bue({radius:t,className:e}){return p.jsx("circle",{cx:t,cy:t,r:t,className:gn(["react-flow__background-pattern","dots",e])})}var wl;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(wl||(wl={}));const que={[wl.Dots]:1,[wl.Lines]:1,[wl.Cross]:6},Vue=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function HL({id:t,variant:e=wl.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:o,style:u,className:d,patternClassName:h}){const m=C.useRef(null),{transform:g,patternId:x}=at(Vue,It),v=r||que[e],b=e===wl.Dots,k=e===wl.Cross,w=Array.isArray(n)?n:[n,n],j=[w[0]*g[2]||1,w[1]*g[2]||1],Q=v*g[2],E=Array.isArray(s)?s:[s,s],R=k?[Q,Q]:j,T=[E[0]*g[2]||1+R[0]/2,E[1]*g[2]||1+R[1]/2],A=`${x}${t||""}`;return p.jsxs("svg",{className:gn(["react-flow__background",d]),style:{...u,...Ov,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:m,"data-testid":"rf__background",children:[p.jsx("pattern",{id:A,x:g[0]%j[0],y:g[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:b?p.jsx(Bue,{radius:Q/2,className:h}):p.jsx(Iue,{dimensions:R,lineWidth:i,variant:e,className:h})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}HL.displayName="Background";const Yue=C.memo(HL);function Uue(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Wue(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Hue(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Gue(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Fue(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Kg({children:t,className:e,...n}){return p.jsx("button",{type:"button",className:gn(["react-flow__controls-button",e]),...n,children:t})}const Kue=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function GL({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:o,onInteractiveChange:u,className:d,children:h,position:m="bottom-left",orientation:g="vertical","aria-label":x}){const v=Bt(),{isInteractive:b,minZoomReached:k,maxZoomReached:w,ariaLabelConfig:j}=at(Kue,It),{zoomIn:Q,zoomOut:E,fitView:R}=pQ(),T=()=>{Q(),s==null||s()},A=()=>{E(),a==null||a()},I=()=>{R(i),o==null||o()},W=()=>{v.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),u==null||u(!b)},F=g==="horizontal"?"horizontal":"vertical";return p.jsxs(gv,{className:gn(["react-flow__controls",F,d]),position:m,style:t,"data-testid":"rf__controls","aria-label":x??j["controls.ariaLabel"],children:[e&&p.jsxs(p.Fragment,{children:[p.jsx(Kg,{onClick:T,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:w,children:p.jsx(Uue,{})}),p.jsx(Kg,{onClick:A,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:k,children:p.jsx(Wue,{})})]}),n&&p.jsx(Kg,{className:"react-flow__controls-fitview",onClick:I,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:p.jsx(Hue,{})}),r&&p.jsx(Kg,{className:"react-flow__controls-interactive",onClick:W,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:b?p.jsx(Fue,{}):p.jsx(Gue,{})}),h]})}GL.displayName="Controls";const Jue=C.memo(GL);function ede({id:t,x:e,y:n,width:r,height:i,style:s,color:a,strokeColor:o,strokeWidth:u,className:d,borderRadius:h,shapeRendering:m,selected:g,onClick:x}){const{background:v,backgroundColor:b}=s||{},k=a||v||b;return p.jsx("rect",{className:gn(["react-flow__minimap-node",{selected:g},d]),x:e,y:n,rx:h,ry:h,width:r,height:i,style:{fill:k,stroke:o,strokeWidth:u},shapeRendering:m,onClick:x?w=>x(w,t):void 0})}const tde=C.memo(ede),nde=t=>t.nodes.map(e=>e.id),a1=t=>t instanceof Function?t:()=>t;function rde({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=tde,onClick:a}){const o=at(nde,It),u=a1(e),d=a1(t),h=a1(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:o.map(g=>p.jsx(sde,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:m},g))})}function ide({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:o,onClick:u}){const{node:d,x:h,y:m,width:g,height:x}=at(v=>{const b=v.nodeLookup.get(t);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const k=b.internals.userNode,{x:w,y:j}=b.internals.positionAbsolute,{width:Q,height:E}=ba(k);return{node:k,x:w,y:j,width:Q,height:E}},It);return!d||d.hidden||!JD(d)?null:p.jsx(o,{x:h,y:m,width:g,height:x,style:d.style,selected:!!d.selected,className:r(d),color:e(d),borderRadius:i,strokeColor:n(d),strokeWidth:s,shapeRendering:a,onClick:u,id:d.id})}const sde=C.memo(ide);var ade=C.memo(rde);const lde=200,ode=150,cde=t=>!t.hidden,ude=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?KD(Rp(t.nodeLookup,{filter:cde}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},dde="react-flow__minimap-desc";function FL({style:t,className:e,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:u,maskColor:d,maskStrokeColor:h,maskStrokeWidth:m,position:g="bottom-right",onClick:x,onNodeClick:v,pannable:b=!1,zoomable:k=!1,ariaLabel:w,inversePan:j,zoomStep:Q=1,offsetScale:E=5}){const R=Bt(),T=C.useRef(null),{boundingRect:A,viewBB:I,rfId:W,panZoom:F,translateExtent:Z,flowWidth:B,flowHeight:H,ariaLabelConfig:P}=at(ude,It),D=(t==null?void 0:t.width)??lde,_=(t==null?void 0:t.height)??ode,X=A.width/D,Y=A.height/_,V=Math.max(X,Y),$=V*D,z=V*_,q=E*V,M=A.x-($-A.width)/2-q,G=A.y-(z-A.height)/2-q,ie=$+q*2,J=z+q*2,ne=`${dde}-${W}`,se=C.useRef(0),pe=C.useRef();se.current=V,C.useEffect(()=>{if(T.current&&F)return pe.current=Coe({domNode:T.current,panZoom:F,getTransform:()=>R.getState().transform,getViewScale:()=>se.current}),()=>{var ke;(ke=pe.current)==null||ke.destroy()}},[F]),C.useEffect(()=>{var ke;(ke=pe.current)==null||ke.update({translateExtent:Z,width:B,height:H,inversePan:j,pannable:b,zoomStep:Q,zoomable:k})},[b,k,j,Q,Z,B,H]);const ye=x?ke=>{var De;const[_e,We]=((De=pe.current)==null?void 0:De.pointer(ke))||[0,0];x(ke,{x:_e,y:We})}:void 0,be=v?C.useCallback((ke,_e)=>{const We=R.getState().nodeLookup.get(_e).internals.userNode;v(ke,We)},[]):void 0,Se=w??P["minimap.ariaLabel"];return p.jsx(gv,{position:g,style:{...t,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*V:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:gn(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:D,height:_,viewBox:`${M} ${G} ${ie} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:T,onClick:ye,children:[Se&&p.jsx("title",{id:ne,children:Se}),p.jsx(ade,{onClick:be,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:o}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${M-q},${G-q}h${ie+q*2}v${J+q*2}h${-ie-q*2}z
432
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}FL.displayName="MiniMap";C.memo(FL);const fde=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,hde={[Gu.Line]:"right",[Gu.Handle]:"bottom-right"};function pde({nodeId:t,position:e,variant:n=Gu.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:o=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:g,autoScale:x=!0,shouldResize:v,onResizeStart:b,onResize:k,onResizeEnd:w}){const j=$L(),Q=typeof t=="string"?t:j,E=Bt(),R=C.useRef(null),T=n===Gu.Handle,A=at(C.useCallback(fde(T&&x),[T,x]),It),I=C.useRef(null),W=e??hde[n];C.useEffect(()=>{if(!(!R.current||!Q))return I.current||(I.current=Xoe({domNode:R.current,nodeId:Q,getStoreItems:()=>{const{nodeLookup:Z,transform:B,snapGrid:H,snapToGrid:P,nodeOrigin:D,domNode:_}=E.getState();return{nodeLookup:Z,transform:B,snapGrid:H,snapToGrid:P,nodeOrigin:D,paneDomNode:_}},onChange:(Z,B)=>{const{triggerNodeChanges:H,nodeLookup:P,parentLookup:D,nodeOrigin:_}=E.getState(),X=[],Y={x:Z.x,y:Z.y},V=P.get(Q);if(V&&V.expandParent&&V.parentId){const $=V.origin??_,z=Z.width??V.measured.width??0,q=Z.height??V.measured.height??0,M={id:V.id,parentId:V.parentId,rect:{width:z,height:q,...eL({x:Z.x??V.position.x,y:Z.y??V.position.y},{width:z,height:q},V.parentId,P,$)}},G=hQ([M],P,D,_);X.push(...G),Y.x=Z.x?Math.max($[0]*z,Z.x):void 0,Y.y=Z.y?Math.max($[1]*q,Z.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const $={id:Q,type:"position",position:{...Y}};X.push($)}if(Z.width!==void 0&&Z.height!==void 0){const z={id:Q,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:Z.width,height:Z.height}};X.push(z)}for(const $ of B){const z={...$,type:"position"};X.push(z)}H(X)},onEnd:({width:Z,height:B})=>{const H={id:Q,type:"dimensions",resizing:!1,dimensions:{width:Z,height:B}};E.getState().triggerNodeChanges([H])}})),I.current.update({controlPosition:W,boundaries:{minWidth:o,minHeight:u,maxWidth:d,maxHeight:h},keepAspectRatio:m,resizeDirection:g,onResizeStart:b,onResize:k,onResizeEnd:w,shouldResize:v}),()=>{var Z;(Z=I.current)==null||Z.destroy()}},[W,o,u,d,h,m,b,k,w,v]);const F=W.split("-");return p.jsx("div",{className:gn(["react-flow__resize-control","nodrag",...F,n,r]),ref:R,style:{...i,scale:A,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:s})}C.memo(pde);function mde({data:t}){return p.jsxs("div",{className:"px-4 py-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] shadow-sm min-w-[180px] max-w-[240px]",children:[p.jsx(Fu,{type:"target",position:$e.Top,className:"!bg-[var(--color-accent)]"}),p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)] font-[var(--font-mono)]",children:t.index+1}),p.jsx("span",{className:"text-sm font-bold text-[var(--color-text)] truncate",children:t.label})]}),t.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] line-clamp-2",children:t.description}),t.agent&&p.jsx("span",{className:"inline-block mt-1.5 text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:t.agent}),p.jsx(Fu,{type:"source",position:$e.Bottom,className:"!bg-[var(--color-accent)]"})]})}const gde={step:mde};function Ode({workflow:t,onStepClick:e}){const{nodes:n,edges:r}=C.useMemo(()=>{const o=t.steps.map((d,h)=>({id:`step-${h}`,type:"step",position:{x:250,y:h*120},data:{label:d.title,description:d.description,agent:d.agent,index:h}})),u=t.steps.slice(0,-1).map((d,h)=>({id:`edge-${h}`,source:`step-${h}`,target:`step-${h+1}`,animated:!0,style:{stroke:"var(--color-accent)",strokeWidth:2}}));return{nodes:o,edges:u}},[t.steps]),i=C.useCallback((s,a)=>{const o=parseInt(a.id.replace("step-",""),10);e==null||e(o)},[e]);return p.jsx("div",{className:"h-[500px] rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:p.jsxs(Zue,{nodes:n,edges:r,nodeTypes:gde,onNodeClick:i,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},children:[p.jsx(Yue,{gap:16,size:1,color:"var(--color-border-subtle)"}),p.jsx(Jue,{showInteractive:!1,className:"!bg-[var(--color-surface-raised)] !border-[var(--color-border-subtle)] !shadow-md [&>button]:!bg-[var(--color-surface-raised)] [&>button]:!border-[var(--color-border-subtle)] [&>button]:!text-[var(--color-text)]"})]})})}function vv({title:t,count:e,modules:n,moduleCounts:r,activeModule:i,onModuleChange:s,search:a,onSearchChange:o,searchPlaceholder:u,filteredCount:d,actions:h}){return p.jsxs("div",{className:"mb-6",children:[p.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[p.jsxs("h1",{className:"text-2xl font-extrabold shrink-0",children:[t," (",e,")"]}),n.length>0&&p.jsxs("div",{className:"flex gap-1 flex-wrap",children:[p.jsx("button",{onClick:()=>s("all"),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i==="all"?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"All"}),n.map(m=>p.jsxs("button",{onClick:()=>s(m),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i===m?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[m,r&&r[m]!==void 0&&p.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["(",r[m],")"]})]},m))]}),p.jsxs("div",{className:"flex items-center gap-3 ml-auto shrink-0",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Nl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",placeholder:u??`Search ${t.toLowerCase()}...`,value:a,onChange:m=>o(m.target.value),className:"pl-9 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)] w-64"})]}),h]})]}),d!==void 0&&d!==e&&p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-3",children:["Showing ",d," of ",e," ",t.toLowerCase()]})]})}const DA=/^[a-z][a-z0-9-]*$/;function LA(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function xde({onClose:t,onCreated:e}){const n=Ho(),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState("step-based"),[d,h]=C.useState(""),[m,g]=C.useState(""),[x,v]=C.useState(""),[b,k]=C.useState([]),[w,j]=C.useState(!1),[Q,E]=C.useState(!1),[R,T]=C.useState("create"),[A,I]=C.useState([]),[W,F]=C.useState([]),[Z,B]=C.useState([]),[H,P]=C.useState(null),[D,_]=C.useState(!1);C.useEffect(()=>{fetch("/api/modules").then(J=>J.json()).then(J=>{const ne=J;I(ne.map(se=>({name:se.name}))),ne.length===1&&v(ne[0].name)}).catch(()=>{}),fetch("/api/workflows").then(J=>J.json()).then(J=>{const ne=J,se=new Set;for(const pe of ne)pe.phase&&se.add(pe.phase);F(Array.from(se).sort())}).catch(()=>{}),fetch("/api/agents").then(J=>J.json()).then(J=>B(J)).catch(()=>{})},[]);const X=r.length===0||DA.test(r),Y=d==="__custom"?m.trim():d,V=r.trim().length>0&&DA.test(r)&&x.length>0,$=C.useCallback(J=>{var pe;const ne=(pe=J.target.files)==null?void 0:pe[0];if(!ne)return;const se=new FileReader;se.onload=()=>{const be=se.result.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(be){const Se=be[1],ke=Se.match(/^name:\s*(.+)$/m),_e=Se.match(/^description:\s*"?(.+?)"?$/m),We=Se.match(/^type:\s*(.+)$/m);if(ke&&i(ke[1].trim()),_e&&a(_e[1].trim()),We){const De=We[1].trim();(De==="step-based"||De==="agent-based"||De==="composite")&&u(De)}}else{const Se=ne.name.replace(/\.md$/i,"");i(LA(Se))}T("create")},se.readAsText(ne)},[]),z=()=>k([...b,{title:"",agent:""}]),q=J=>k(b.filter((ne,se)=>se!==J)),M=(J,ne,se)=>{k(b.map((pe,ye)=>ye===J?{...pe,[ne]:se}:pe))},G=[];if(V){const J=Y?`_bmad/${x}/workflows/${Y}/${r}/`:`_bmad/${x}/workflows/${r}/`;G.push(J),G.push("├── workflow.md"),o==="step-based"&&b.length>0&&(G.push("├── steps/"),b.forEach((ne,se)=>{const pe=String(se+1).padStart(2,"0"),ye=LA(ne.title||"untitled"),be=se===b.length-1?"│ └──":"│ ├──";G.push(`${be} step-${pe}-${ye}.md`)}))}const ie=async()=>{var J;if(V){_(!0),P(null);try{const ne=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),description:s.trim(),type:o,phase:Y||void 0,module:x,steps:o==="step-based"?b.filter(se=>se.title.trim()):void 0})});if(!ne.ok){const se=await ne.json();throw new Error(((J=se.error)==null?void 0:J.message)??"Failed to create workflow")}await n.invalidateQueries({queryKey:["workflows"]}),e()}catch(ne){P(ne instanceof Error?ne.message:"Failed to create workflow")}finally{_(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"New Workflow"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"flex gap-1 mb-4 bg-[var(--color-surface-raised)] rounded-md p-0.5 self-start",children:[p.jsx("button",{onClick:()=>T("create"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${R==="create"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Create"}),p.jsx("button",{onClick:()=>T("import"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${R==="import"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Import"})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[R==="import"?p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Upload workflow file"}),p.jsxs("label",{className:"flex items-center justify-center gap-2 w-full px-4 py-6 border-2 border-dashed border-[var(--color-border-subtle)] rounded-lg cursor-pointer hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(LO,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm text-[var(--color-muted)]",children:"Click to upload a .md workflow file"}),p.jsx("input",{type:"file",accept:".md",onChange:$,className:"hidden"})]})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Uploading will parse the file and switch to the Create tab with fields pre-populated. The workflow type is auto-detected from frontmatter."})]}):Q?p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Directory Structure Preview"}),p.jsx("pre",{className:"p-4 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre",children:G.join(`
433
+ `)})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:r,onChange:J=>i(J.target.value),onBlur:()=>j(!0),placeholder:"e.g. create-product-brief",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),w&&!X&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Name must be kebab-case"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:s,onChange:J=>a(J.target.value),placeholder:"What does this workflow do?",rows:2,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Type"}),p.jsx("div",{className:"flex gap-3",children:["step-based","agent-based","composite"].map(J=>p.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[p.jsx("input",{type:"radio",name:"workflow-type",checked:o===J,onChange:()=>u(J),className:"accent-[var(--color-accent)]"}),J==="step-based"?"Step-based":J==="agent-based"?"Agent-based":"Composite"]},J))})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Phase (optional)"}),p.jsxs("select",{value:d,onChange:J=>h(J.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"No phase grouping"}),W.map(J=>p.jsx("option",{value:J,children:J},J)),p.jsx("option",{value:"__custom",children:"Custom..."})]}),d==="__custom"&&p.jsx("input",{type:"text",value:m,onChange:J=>g(J.target.value),placeholder:"e.g. 5-deployment",className:"w-full mt-2 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module"}),p.jsxs("select",{value:x,onChange:J=>v(J.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Select a module..."}),A.map(J=>p.jsx("option",{value:J.name,children:J.name},J.name))]})]}),o==="step-based"&&p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Initial Steps (",b.length,")"]}),p.jsx("div",{className:"space-y-2",children:b.map((J,ne)=>p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs text-[var(--color-muted)] w-6 text-right shrink-0",children:String(ne+1).padStart(2,"0")}),p.jsx("input",{type:"text",value:J.title,onChange:se=>M(ne,"title",se.target.value),placeholder:"Step title...",className:"flex-1 px-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),p.jsxs("select",{value:J.agent,onChange:se=>M(ne,"agent",se.target.value),className:"w-36 px-2 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Agent..."}),Z.map(se=>p.jsx("option",{value:se.name,children:se.title||se.name},se.id))]}),p.jsx("button",{onClick:()=>q(ne),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] shrink-0",children:p.jsx(ld,{size:14})})]},ne))}),p.jsxs("button",{onClick:z,className:"mt-2 flex items-center gap-1.5 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)]",children:[p.jsx(ln,{size:14})," Add step"]})]})]}),H&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:H})]}),p.jsx("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:Q?p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:()=>E(!1),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Back"}),p.jsxs("button",{onClick:ie,disabled:!V||D,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),D?"Creating...":"Create Workflow"]})]}):p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{onClick:()=>E(!0),disabled:!V,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Preview & Create"})]})})]})]})}function qo(t="detail"){const[e,n]=mq(),r=e.get(t),i=C.useCallback(s=>{n(a=>(s?a.set(t,s):a.delete(t),a),{replace:!1})},[t,n]);return[r,i]}const XA={"step-based":"border-[var(--color-border-subtle)] text-[var(--color-muted)]","agent-based":"border-purple-400/50 text-purple-400",composite:"border-blue-400/50 text-blue-400"};function gQ({type:t}){if(!t)return null;const e=t==="step-based"?"Step":t==="agent-based"?"Agent":"Composite";return p.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs border ${XA[t]??XA["step-based"]}`,children:e})}function vde(t){return t.replace(/^\d+-/,"").split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function yde(t){const e=new Map;for(const n of t){const r=n.phase??"__ungrouped";e.has(r)||e.set(r,[]),e.get(r).push(n)}return Array.from(e.entries()).sort(([n],[r])=>{if(n==="__ungrouped")return 1;if(r==="__ungrouped")return-1;const i=parseInt(n)||999,s=parseInt(r)||999;return i-s})}function bde(){const{data:t,isLoading:e,refetch:n}=oM(),[r,i]=C.useState("list"),[s,a]=C.useState(!1),[o,u]=qo("detail"),[d,h]=C.useState("all"),[m,g]=C.useState(""),[x,v]=C.useState(null),{data:b}=cM(x??""),k=C.useMemo(()=>{if(!t)return[];const E=new Set;for(const R of t)R.module&&E.add(R.module);return Array.from(E).sort()},[t]),w=C.useMemo(()=>{if(!t)return{};const E={};for(const R of t)R.module&&(E[R.module]=(E[R.module]??0)+1);return E},[t]),j=C.useMemo(()=>{if(!t)return[];let E=t;if(d!=="all"&&(E=E.filter(R=>R.module===d)),m){const R=m.toLowerCase();E=E.filter(T=>T.name.toLowerCase().includes(R)||T.description&&T.description.toLowerCase().includes(R))}return E},[t,d,m]),Q=C.useMemo(()=>yde(j),[j]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workflows"}),p.jsx("div",{className:"space-y-3",children:[1,2,3].map(E=>p.jsx("div",{className:"h-16 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},E))})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workflows"}),p.jsx(Xi,{icon:Mi,title:"No workflows found",description:"Install a module or create a workflow to get started."})]}):p.jsxs("div",{children:[p.jsxs("div",{children:[p.jsx(vv,{title:"Workflows",count:t.length,modules:k,moduleCounts:w,activeModule:d,onModuleChange:h,search:m,onSearchChange:g,actions:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("button",{onClick:()=>a(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"New Workflow"]}),p.jsxs("div",{className:"flex gap-1 bg-[var(--color-surface-raised)] rounded-md p-0.5",children:[p.jsxs("button",{onClick:()=>i("list"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded min-h-[36px] transition-colors ${r==="list"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[p.jsx(nV,{size:14}),"List"]}),p.jsxs("button",{onClick:()=>i("graph"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded min-h-[36px] transition-colors ${r==="graph"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[p.jsx(K9,{size:14}),"Graph"]})]})]})}),r==="list"&&p.jsx("div",{className:"space-y-6",children:Q.map(([E,R])=>p.jsxs("div",{children:[p.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2 px-1",children:[E==="__ungrouped"?"Ungrouped":vde(E),p.jsxs("span",{className:"ml-2 font-normal",children:["(",R.length,")"]})]}),p.jsx("div",{className:"space-y-2",children:R.map(T=>p.jsxs("button",{onClick:()=>u(o===T.id?null:T.id),className:`w-full flex items-center justify-between p-4 rounded-lg border transition-colors cursor-pointer text-left ${o===T.id?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Mi,{size:18,className:"text-[var(--color-muted)]"}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:T.name}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate max-w-md",children:T.description})]})]}),p.jsxs("div",{className:"flex items-center gap-3 text-xs text-[var(--color-muted)]",children:[p.jsx(gQ,{type:T.type}),p.jsxs("span",{children:[T.stepCount," steps"]}),T.module&&p.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)]",children:T.module})]})]},T.id))})]},E))}),r==="graph"&&p.jsxs("div",{className:"space-y-4",children:[p.jsxs("select",{value:x??"",onChange:E=>v(E.target.value||null),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] outline-none focus:border-[var(--color-accent)] min-h-[36px]",children:[p.jsx("option",{value:"",children:"Select a workflow..."}),t.map(E=>p.jsxs("option",{value:E.id,children:[E.name,E.module?` (${E.module})`:""]},E.id))]}),!x&&p.jsx("div",{className:"flex items-center justify-center h-64 rounded-lg border border-dashed border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:p.jsx("p",{className:"text-sm",children:"Select a workflow above to view its graph"})}),b&&p.jsx(Ode,{workflow:b,onStepClick:()=>{u(x)}})]})]}),o&&p.jsx(oie,{workflowId:o,onClose:()=>u(null)}),s&&p.jsx(xde,{onClose:()=>a(!1),onCreated:()=>{a(!1),n()}})]})}const Sde=["1-analysis","2-planning","3-solutioning","4-implementation"];function wde(t){const e=t.replace(/^\d+-/,"");return e.charAt(0).toUpperCase()+e.slice(1)}function kde({commands:t}){const e=Oa(),n=C.useMemo(()=>{const s=new Map;for(const a of t){const o=a.phase||"anytime";s.has(o)||s.set(o,[]),s.get(o).push(a)}for(const[,a]of s)a.sort((o,u)=>(o.sequence??999)-(u.sequence??999));return s},[t]),r=Sde.filter(s=>n.has(s)),i=n.get("anytime")??[];return r.length===0&&i.length===0?null:p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"The BMAD Process"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Workflow lifecycle from analysis to implementation"})]}),p.jsx("button",{onClick:()=>e("/commands"),className:"text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors cursor-pointer",children:"View all commands →"})]}),p.jsx("div",{className:"flex gap-0 overflow-x-auto pb-2",children:r.map((s,a)=>{const o=n.get(s)??[];return p.jsxs("div",{className:"flex items-start",children:[p.jsxs("div",{className:"min-w-[180px] flex-1",children:[p.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-accent)] mb-3 px-1",children:wde(s)}),p.jsx("div",{className:"flex flex-wrap gap-1.5 px-1",children:o.map(u=>{var d;return p.jsxs("div",{title:`${u.name}
434
+ ${u.description}`,className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs border transition-colors ${u.required?"border-[var(--color-accent)] bg-[var(--color-accent)]/5":"border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)]"}`,children:[u.agentTitle&&p.jsx("span",{className:"text-xs leading-none",role:"img",children:((d=u.agentTitle.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:d[0])??""}),p.jsx("span",{className:"font-[var(--font-mono)] font-bold",children:u.code}),p.jsx("span",{className:"text-[var(--color-muted)] hidden sm:inline truncate max-w-[80px]",children:u.name})]},`${u.code}-${u.module}`)})})]}),a<r.length-1&&p.jsx("div",{className:"flex items-center pt-8 px-2 text-[var(--color-muted)]",children:p.jsx(p9,{size:16})})]},s)})}),i.length>0&&p.jsxs("div",{className:"mt-4 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2 px-1",children:"Anytime"}),p.jsx("div",{className:"flex flex-wrap gap-1.5 px-1",children:i.map(s=>{var a;return p.jsxs("div",{title:`${s.name}
435
+ ${s.description}`,className:"inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)]",children:[s.agentTitle&&p.jsx("span",{className:"text-xs leading-none",role:"img",children:((a=s.agentTitle.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:a[0])??""}),p.jsx("span",{className:"font-[var(--font-mono)] font-bold",children:s.code}),p.jsx("span",{className:"text-[var(--color-muted)] hidden sm:inline truncate max-w-[80px]",children:s.name})]},`${s.code}-${s.module}`)})})]})]})}function Vc({title:t,count:e,to:n}){return p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:t}),p.jsxs(nr,{to:n,className:"text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:["View all (",e,") →"]})]})}const l1=5,o1=8;function Qde(){const t=Oa(),[e,n]=C.useState(null),[r,i]=C.useState([]),[s,a]=C.useState(!0);if(C.useEffect(()=>{Promise.all([fetch("/api/overview").then(u=>u.json()),fetch("/api/commands").then(u=>u.json()).catch(()=>[])]).then(([u,d])=>{n(u),i(d),a(!1)}).catch(()=>a(!1))},[]),s)return p.jsx("div",{className:"space-y-8",children:[1,2,3].map(u=>p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},u))});if(!(e!=null&&e.detected))return p.jsx(Xi,{icon:xV,title:"Welcome to BMAD Studio",description:"No BMAD project detected. Start by creating a BMAD project or point Studio to an existing one with --dir."});const{sections:o}=e;return p.jsxs("div",{children:[p.jsx("h1",{className:"text-3xl font-extrabold mb-10",children:"Overview"}),p.jsxs("div",{className:"space-y-0",children:[o.team&&o.team.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Vc,{title:"Agents",count:o.team.count,to:"/agents"}),p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.team.agents.filter(u=>u.name||u.title).slice(0,o1).map(u=>{const d=u.communicationStyle?u.communicationStyle.length>60?u.communicationStyle.slice(0,60)+"...":u.communicationStyle:void 0;return p.jsxs("button",{onClick:()=>t(`/agents/${u.id}`),className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[u.icon?p.jsx("span",{className:"text-2xl leading-none",role:"img","aria-label":`${u.name} icon`,children:u.icon}):p.jsx("span",{className:"w-7 h-7 rounded-lg bg-[var(--color-accent)] text-white text-xs font-bold flex items-center justify-center shrink-0",children:u.name.charAt(0).toUpperCase()}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("span",{className:"font-bold text-sm block truncate",children:u.name}),u.title&&p.jsx("span",{className:"text-xs text-[var(--color-muted)] block truncate",children:u.title})]})]}),d&&p.jsxs("p",{className:"text-xs italic text-[var(--color-muted)] line-clamp-1 mb-1.5",children:["“",d,"”"]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[u.skillCount," skills"]}),u.module&&p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:u.module})]})]},u.id)})}),o.team.count>o1&&p.jsxs(nr,{to:"/agents",className:"block text-center text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] py-2 mt-2",children:["+ ",o.team.count-o1," more agents"]})]}),o.teams&&o.teams.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Vc,{title:"Teams",count:o.teams.count,to:"/teams"}),p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.teams.teams.map(u=>p.jsxs("button",{onClick:()=>t("/teams"),className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.icon?p.jsx("span",{className:"text-lg leading-none",role:"img","aria-label":`${u.name} icon`,children:u.icon}):p.jsx(hi,{size:18,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"font-bold text-sm truncate",children:u.name})]}),u.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] line-clamp-2 mb-1",children:u.description}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[u.memberCount," members"]})]},u.id))})]}),o.process&&o.process.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Vc,{title:"Workflows",count:o.process.count,to:"/workflows"}),p.jsxs("div",{className:"space-y-2",children:[o.process.workflows.slice(0,l1).map(u=>p.jsxs("button",{onClick:()=>t("/workflows"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Mi,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm font-bold",children:u.name})]}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(gQ,{type:u.type}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[u.stepCount," steps"]}),u.module&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:u.module})]})]},u.id)),o.process.count>l1&&p.jsxs(nr,{to:"/workflows",className:"block text-center text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] py-2",children:["+ ",o.process.count-l1," more workflows"]})]})]}),r.length>0&&p.jsx(kde,{commands:r}),o.toolkit&&o.toolkit.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Vc,{title:"Skills",count:o.toolkit.count,to:"/skills"}),p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:o.toolkit.skills.slice(0,8).map(u=>p.jsxs("button",{onClick:()=>t("/skills"),className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] transition-colors cursor-pointer",children:[p.jsx(sa,{size:14,className:"text-[var(--color-accent)] shrink-0"}),p.jsx("span",{className:"text-sm truncate",children:u.name})]},u.id))}),o.toolkit.count>8&&p.jsxs(nr,{to:"/skills",className:"block text-center text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] py-2 mt-2",children:["+ ",o.toolkit.count-8," more skills"]})]}),o.ideConfigs&&o.ideConfigs.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Vc,{title:"Data Sources",count:o.ideConfigs.count,to:"/connections"}),p.jsx("div",{className:"flex gap-3 flex-wrap",children:o.ideConfigs.ides.map(u=>p.jsxs("button",{onClick:()=>t("/connections"),className:"flex items-center gap-2 px-4 py-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsx(Hk,{size:16,className:"text-[var(--color-success)]"}),p.jsx("span",{className:"text-sm",children:u})]},u))})]}),o.packages&&o.packages.count>0&&p.jsxs("section",{children:[p.jsx(Vc,{title:"Modules",count:o.packages.count,to:"/modules"}),p.jsx("div",{className:"flex gap-4 flex-wrap",children:o.packages.packages.map(u=>p.jsxs("button",{onClick:()=>t("/modules"),className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ch,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"font-bold text-sm",children:u.name})]}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:["v",u.version]})]},u.name))})]})]})]})}async function Cde(){const t=await fetch("/api/agents");if(!t.ok)throw new Error("Failed to fetch agents");return t.json()}function jde(){return xa({queryKey:["agents"],queryFn:Cde,staleTime:3e4})}function Ede({agent:t}){const e=Oa(),n=t.title||t.role||t.name,r=t.title?t.name:void 0;return p.jsxs("div",{onClick:()=>e(`/agents/${t.id}`),onKeyDown:i=>i.key==="Enter"&&e(`/agents/${t.id}`),role:"button",tabIndex:0,className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.icon?p.jsx("span",{className:"text-lg leading-none",role:"img",children:t.icon}):p.jsx("span",{className:"w-5 h-5 rounded bg-[var(--color-accent)] text-white text-[10px] font-bold flex items-center justify-center shrink-0",children:t.name.charAt(0).toUpperCase()}),p.jsx("span",{className:"font-bold text-sm truncate",children:n}),t.hasOverrides&&p.jsx("span",{className:"w-2 h-2 rounded-full bg-[var(--color-warning)] shrink-0",title:"Has overrides"})]}),r&&p.jsxs("p",{className:"text-xs text-[var(--color-muted)] truncate mb-2",children:["(",r,")"]}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-muted)]",children:[p.jsxs("span",{children:[t.skillCount," skills"]}),t.module&&p.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)]",children:t.module})]})]})}function OQ({className:t=""}){return p.jsx("div",{className:`rounded-lg bg-[var(--color-surface-raised)] animate-pulse ${t}`})}function $de({count:t=3,height:e="h-16"}){return p.jsx("div",{className:"space-y-3",children:Array.from({length:t},(n,r)=>p.jsx(OQ,{className:e},r))})}function yv({count:t=3}){return p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:t},(e,n)=>p.jsx(OQ,{className:"h-24"},n))})}function Nde(){const{data:t,isLoading:e,error:n}=jde(),[r,i]=C.useState("all"),[s,a]=C.useState(""),o=C.useMemo(()=>{if(!t)return[];const h=new Set;for(const m of t)m.module&&h.add(m.module);return Array.from(h).sort()},[t]),u=C.useMemo(()=>{if(!t)return{};const h={};for(const m of t)m.module&&(h[m.module]=(h[m.module]??0)+1);return h},[t]),d=C.useMemo(()=>{if(!t)return[];let h=t;if(r!=="all"&&(h=h.filter(m=>m.module===r)),s){const m=s.toLowerCase();h=h.filter(g=>g.name.toLowerCase().includes(m)||g.title.toLowerCase().includes(m)||g.role.toLowerCase().includes(m))}return h},[t,r,s]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Agents"}),p.jsx(yv,{count:4})]}):n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Agents"}),p.jsxs("p",{className:"text-[var(--color-error)]",children:["Failed to load agents: ",n.message]})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Agents"}),p.jsx(Xi,{icon:hi,title:"No agents found",description:"This project doesn't have any agents yet. Load a module or create a custom agent to get started."})]}):p.jsxs("div",{children:[p.jsx(vv,{title:"Agents",count:t.length,modules:o,moduleCounts:u,activeModule:r,onModuleChange:i,search:s,onSearchChange:a,filteredCount:r!=="all"||s?d.length:void 0}),p.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:d.map(h=>p.jsx(Ede,{agent:h},h.id))}),d.length===0&&p.jsx("p",{className:"text-center text-sm text-[var(--color-muted)] py-8",children:"No agents match the current filter"})]})}async function Tde(t){const e=await fetch(`/api/agents/${t}`);if(!e.ok)throw new Error(`Failed to fetch agent ${t}`);return e.json()}function KL(t){return xa({queryKey:["agents",{id:t}],queryFn:()=>Tde(t),enabled:!!t})}function JL(){return xa({queryKey:["teams"],queryFn:async()=>{const t=await fetch("/api/teams");if(!t.ok)throw new Error("Failed to fetch teams");return t.json()},staleTime:3e4})}function Pde(t){return xa({queryKey:["teams",{id:t}],queryFn:async()=>{const e=await fetch(`/api/teams/${t}`);if(!e.ok)throw new Error(`Failed to fetch team ${t}`);return e.json()},enabled:!!t})}function _de(t){return xa({queryKey:["teams",{id:t,include:"party"}],queryFn:async()=>{const e=await fetch(`/api/teams/${t}/party`);if(!e.ok)throw new Error(`Failed to fetch party CSV for ${t}`);return e.json()},enabled:!!t})}var Ade=Symbol.for("preact-signals");function bv(){if(oa>1)oa--;else{var t,e=!1;for((function(){var i=kx;for(kx=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();gh!==void 0;){var n=gh;for(gh=void 0,wx++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&tX(n))try{n.c()}catch(i){e||(t=i,e=!0)}n=r}}if(wx=0,oa--,e)throw t}}function Vo(t){if(oa>0)return t();rk=++Rde,oa++;try{return t()}finally{bv()}}var Ot=void 0;function Nt(t){var e=Ot;Ot=void 0;try{return t()}finally{Ot=e}}var gh=void 0,oa=0,wx=0,Rde=0,rk=0,kx=void 0,Qx=0;function eX(t){if(Ot!==void 0){var e=t.n;if(e===void 0||e.t!==Ot)return e={i:0,S:t,p:Ot.s,n:void 0,t:Ot,e:void 0,x:void 0,r:e},Ot.s!==void 0&&(Ot.s.n=e),Ot.s=e,t.n=e,32&Ot.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Ot.s,e.n=void 0,Ot.s.n=e,Ot.s=e),e}}function ir(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}ir.prototype.brand=Ade;ir.prototype.h=function(){return!0};ir.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:Nt(function(){var r;(r=e.W)==null||r.call(e)}))};ir.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,r=t.x;n!==void 0&&(n.x=r,t.e=void 0),r!==void 0&&(r.e=n,t.x=void 0),t===this.t&&(this.t=r,r===void 0&&Nt(function(){var i;(i=e.Z)==null||i.call(e)}))}};ir.prototype.subscribe=function(t){var e=this;return bi(function(){var n=e.value,r=Ot;Ot=void 0;try{t(n)}finally{Ot=r}},{name:"sub"})};ir.prototype.valueOf=function(){return this.value};ir.prototype.toString=function(){return this.value+""};ir.prototype.toJSON=function(){return this.value};ir.prototype.peek=function(){var t=Ot;Ot=void 0;try{return this.value}finally{Ot=t}};Object.defineProperty(ir.prototype,"value",{get:function(){var t=eX(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(wx>100)throw new Error("Cycle detected");(function(n){oa!==0&&wx===0&&n.l!==rk&&(n.l=rk,kx={S:n,v:n.v,i:n.i,o:kx})})(this),this.v=t,this.i++,Qx++,oa++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{bv()}}}});function Dp(t,e){return new ir(t,e)}function tX(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function nX(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function rX(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function Ko(t,e){ir.call(this,void 0),this.x=t,this.s=void 0,this.g=Qx-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}Ko.prototype=new ir;Ko.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Qx))return!0;if(this.g=Qx,this.f|=1,this.i>0&&!tX(this))return this.f&=-2,!0;var t=Ot;try{nX(this),Ot=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Ot=t,rX(this),this.f&=-2,!0};Ko.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ir.prototype.S.call(this,t)};Ko.prototype.U=function(t){if(this.t!==void 0&&(ir.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Ko.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Ko.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=eX(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function ZA(t,e){return new Ko(t,e)}function iX(t){var e=t.m;if(t.m=void 0,typeof e=="function"){oa++;var n=Ot;Ot=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,xQ(t),r}finally{Ot=n,bv()}}}function xQ(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,iX(t)}function Mde(t){if(Ot!==this)throw new Error("Out-of-order effect");rX(this),Ot=t,this.f&=-2,8&this.f&&xQ(this),bv()}function md(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e==null?void 0:e.name}md.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}};md.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,iX(this),nX(this),oa++;var t=Ot;return Ot=this,Mde.bind(this,t)};md.prototype.N=function(){2&this.f||(this.f|=2,this.u=gh,gh=this)};md.prototype.d=function(){this.f|=8,1&this.f||xQ(this)};md.prototype.dispose=function(){this.d()};function bi(t,e){var n=new md(t,e);try{n.c()}catch(i){throw n.d(),i}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var zde=Object.create,vQ=Object.defineProperty,Dde=Object.defineProperties,Lde=Object.getOwnPropertyDescriptor,Xde=Object.getOwnPropertyDescriptors,IA=Object.getOwnPropertySymbols,Zde=Object.prototype.hasOwnProperty,Ide=Object.prototype.propertyIsEnumerable,Bde=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),gd=t=>{throw TypeError(t)},ik=(t,e,n)=>e in t?vQ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qde=(t,e)=>{for(var n in e||(e={}))Zde.call(e,n)&&ik(t,n,e[n]);if(IA)for(var n of IA(e))Ide.call(e,n)&&ik(t,n,e[n]);return t},Vde=(t,e)=>Dde(t,Xde(e)),BA=(t,e)=>vQ(t,"name",{value:e,configurable:!0}),Yde=t=>{var e;return[,,,zde((e=void 0)!=null?e:null)]},sX=["class","method","getter","setter","accessor","field","value","get","set"],qf=t=>t!==void 0&&typeof t!="function"?gd("Function expected"):t,Ude=(t,e,n,r,i)=>({kind:sX[t],name:e,metadata:r,addInitializer:s=>n._?gd("Already initialized"):i.push(qf(s||null))}),aX=(t,e)=>ik(e,Bde("metadata"),t[3]),no=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},Od=(t,e,n,r,i,s)=>{var a,o,u,d,h,m=e&7,g=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?g?1:2:0,b=sX[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),j=m&&(!x&&!g&&(i=i.prototype),m<5&&(m>3||!x)&&Lde(m<4?i:{get[n](){return po(this,s)},set[n](E){return ol(this,s,E)}},n));m?x&&m<4&&BA(s,(m>2?"set ":m>1?"get ":"")+n):BA(i,n);for(var Q=r.length-1;Q>=0;Q--)d=Ude(m,n,u={},t[3],w),m&&(d.static=g,d.private=x,h=d.access={has:x?E=>Wde(i,E):E=>n in E},m^3&&(h.get=x?E=>(m^1?po:Hde)(E,i,m^4?s:j.get):E=>E[n]),m>2&&(h.set=x?(E,R)=>ol(E,i,R,m^4?s:j.set):(E,R)=>E[n]=R)),o=(0,r[Q])(m?m<4?x?s:j[b]:m>4?void 0:{get:j.get,set:j.set}:i,d),u._=1,m^4||o===void 0?qf(o)&&(m>4?k.unshift(o):m?x?s=o:j[b]=o:i=o):typeof o!="object"||o===null?gd("Object expected"):(qf(a=o.get)&&(j.get=a),qf(a=o.set)&&(j.set=a),qf(a=o.init)&&k.unshift(a));return m||aX(t,i),j&&vQ(i,n,j),x?m^4?s:j:i},yQ=(t,e,n)=>e.has(t)||gd("Cannot "+n),Wde=(t,e)=>Object(e)!==e?gd('Cannot use the "in" operator on this value'):t.has(e),po=(t,e,n)=>(yQ(t,e,"read from private field"),n?n.call(t):e.get(t)),Jg=(t,e,n)=>e.has(t)?gd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ol=(t,e,n,r)=>(yQ(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Hde=(t,e,n)=>(yQ(t,e,"access private method"),n);function Cx(t,e){if(e){let n;return ZA(()=>{const r=t();return r&&n&&e(n,r)?n:(n=r,r)})}return ZA(t)}function Ku(t,e){if(Object.is(t,e))return!0;if(t===null||e===null)return!1;if(typeof t=="function"&&typeof e=="function")return t===e;if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:!t.some((r,i)=>!Ku(r,e[i]));if(typeof t=="object"&&typeof e=="object"){const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:!n.some(s=>!Ku(t[s],e[s]))}return!1}function ft({get:t},e){return{init(n){return Dp(n)},get(){return t.call(this).value},set(n){const r=t.call(this);r.peek()!==n&&(r.value=n)}}}function sn(t,e){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=Cx(t.bind(this)),n.set(this,r)),r.value}}function c1(t=!0){return function(e,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),i=Object.getOwnPropertyDescriptor(r,n.name);i&&Object.defineProperty(r,n.name,Vde(qde({},i),{enumerable:t}))})}}function Lp(...t){const e=t.map(n=>bi(n));return()=>e.forEach(n=>n())}var lX,oX,cX,uX,dX,fX,Kn,bQ,u1,sk,ak,In,SQ,d1,hX,lk,wQ,f1,ok,ck;fX=[ft],dX=[ft],uX=[ft],cX=[c1()],oX=[c1()],lX=[c1()];var Jo=class{constructor(t,e=Object.is){this.defaultValue=t,this.equals=e,no(Kn,5,this),Jg(this,In),Jg(this,bQ,no(Kn,8,this)),no(Kn,11,this),Jg(this,SQ,no(Kn,12,this)),no(Kn,15,this),Jg(this,wQ,no(Kn,16,this)),no(Kn,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return po(this,In,ok)}get initial(){return po(this,In,sk)}get previous(){return po(this,In,hX)}set current(t){const e=Nt(()=>po(this,In,ok));t&&e&&this.equals(e,t)||Vo(()=>{po(this,In,sk)||ol(this,In,t,ak),ol(this,In,e,lk),ol(this,In,t,ck)})}reset(t=this.defaultValue){Vo(()=>{ol(this,In,void 0,lk),ol(this,In,t,ak),ol(this,In,t,ck)})}};Kn=Yde();bQ=new WeakMap;In=new WeakSet;SQ=new WeakMap;wQ=new WeakMap;u1=Od(Kn,20,"#initial",fX,In,bQ),sk=u1.get,ak=u1.set;d1=Od(Kn,20,"#previous",dX,In,SQ),hX=d1.get,lk=d1.set;f1=Od(Kn,20,"#current",uX,In,wQ),ok=f1.get,ck=f1.set;Od(Kn,2,"current",cX,Jo);Od(Kn,2,"initial",oX,Jo);Od(Kn,2,"previous",lX,Jo);aX(Kn,Jo);function h1(t){return Nt(()=>{const e={};for(const n in t)e[n]=t[n];return e})}var Gde=Object.create,pX=Object.defineProperty,Fde=Object.getOwnPropertyDescriptor,qA=Object.getOwnPropertySymbols,Kde=Object.prototype.hasOwnProperty,Jde=Object.prototype.propertyIsEnumerable,mX=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Sv=t=>{throw TypeError(t)},VA=Math.pow,uk=(t,e,n)=>e in t?pX(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,efe=(t,e)=>{for(var n in e||(e={}))Kde.call(e,n)&&uk(t,n,e[n]);if(qA)for(var n of qA(e))Jde.call(e,n)&&uk(t,n,e[n]);return t},tfe=t=>{var e;return[,,,Gde((e=t==null?void 0:t[mX("metadata")])!=null?e:null)]},gX=["class","method","getter","setter","accessor","field","value","get","set"],OX=t=>t!==void 0&&typeof t!="function"?Sv("Function expected"):t,nfe=(t,e,n,r,i)=>({kind:gX[t],name:e,metadata:r,addInitializer:s=>n._?Sv("Already initialized"):i.push(OX(s||null))}),rfe=(t,e)=>uk(e,mX("metadata"),t[3]),ife=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)s[i].call(n);return r},xX=(t,e,n,r,i,s)=>{for(var a,o,u,d,h=e&7,m=!1,g=!1,x=2,v=gX[h+5],b=t[x]||(t[x]=[]),k=(i=i.prototype,Fde(i,n)),w=r.length-1;w>=0;w--)u=nfe(h,n,o={},t[3],b),u.static=m,u.private=g,d=u.access={has:j=>n in j},d.get=j=>j[n],a=(0,r[w])(k[v],u),o._=1,OX(a)&&(k[v]=a);return k&&pX(i,n,k),i},vX=(t,e,n)=>e.has(t)||Sv("Cannot "+n),sfe=(t,e,n)=>(vX(t,e,"read from private field"),e.get(t)),afe=(t,e,n)=>e.has(t)?Sv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),lfe=(t,e,n,r)=>(vX(t,e,"write to private field"),e.set(t,n),n),fs=class dk{constructor(e,n){this.x=e,this.y=n}static delta(e,n){return new dk(e.x-n.x,e.y-n.y)}static distance(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}static equals(e,n){return e.x===n.x&&e.y===n.y}static from({x:e,y:n}){return new dk(e,n)}},Xp=class so{constructor(e,n,r,i){this.left=e,this.top=n,this.width=r,this.height=i,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(e,n){const{top:r,left:i,width:s,height:a,scale:o}=this,u=new so(i+e,r+n,s,a);return u.scale=efe({},o),u}get boundingRectangle(){const{width:e,height:n,left:r,top:i,right:s,bottom:a}=this;return{width:e,height:n,left:r,top:i,right:s,bottom:a}}get center(){const{left:e,top:n,right:r,bottom:i}=this;return new fs((e+r)/2,(n+i)/2)}get area(){const{width:e,height:n}=this;return e*n}equals(e){if(!(e instanceof so))return!1;const{left:n,top:r,width:i,height:s}=this;return n===e.left&&r===e.top&&i===e.width&&s===e.height}containsPoint(e){const{top:n,left:r,bottom:i,right:s}=this;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}intersectionArea(e){return e instanceof so?ofe(this,e):0}intersectionRatio(e){const{area:n}=this,r=this.intersectionArea(e);return r/(e.area+n-r)}get bottom(){const{top:e,height:n}=this;return e+n}get right(){const{left:e,width:n}=this;return e+n}get aspectRatio(){const{width:e,height:n}=this;return e/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:e,left:n,width:r,height:i}){return new so(n,e,r,i)}static delta(e,n,r={x:"center",y:"center"}){const i=(s,a)=>{const o=r[a],u=a==="x"?s.left:s.top,d=a==="x"?s.width:s.height;return o=="start"?u:o=="end"?u+d:u+d/2};return fs.delta({x:i(e,"x"),y:i(e,"y")},{x:i(n,"x"),y:i(n,"y")})}static intersectionRatio(e,n){return so.from(e).intersectionRatio(so.from(n))}};function ofe(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=i-r,o=s-n;return r<i&&n<s?a*o:0}var yX,bX,fk,kO,Zp,wv=class extends(fk=Jo,bX=[sn],yX=[sn],fk){constructor(e){const n=fs.from(e);super(n,(r,i)=>fs.equals(r,i)),ife(Zp,5,this),afe(this,kO,0),this.velocity={x:0,y:0}}get delta(){return fs.delta(this.current,this.initial)}get direction(){const{current:e,previous:n}=this;if(!n)return null;const r={x:e.x-n.x,y:e.y-n.y};return!r.x&&!r.y?null:Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:n}=this,r=fs.from(e),i={x:r.x-n.x,y:r.y-n.y},s=Date.now(),a=s-sfe(this,kO),o=u=>Math.round(u/a*100);Vo(()=>{lfe(this,kO,s),this.velocity={x:o(i.x),y:o(i.y)},super.current=r})}reset(e=this.defaultValue){super.reset(fs.from(e)),this.velocity={x:0,y:0}}};Zp=tfe(fk);kO=new WeakMap;xX(Zp,2,"delta",bX,wv);xX(Zp,2,"direction",yX,wv);rfe(Zp,wv);function hk({x:t,y:e},n){const r=Math.abs(t),i=Math.abs(e);return typeof n=="number"?Math.sqrt(VA(r,2)+VA(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n?i>n.y:!1}var SX=(t=>(t.Horizontal="x",t.Vertical="y",t))(SX||{}),wX=Object.values(SX),cfe=Object.create,kQ=Object.defineProperty,ufe=Object.defineProperties,dfe=Object.getOwnPropertyDescriptor,ffe=Object.getOwnPropertyDescriptors,jx=Object.getOwnPropertySymbols,kX=Object.prototype.hasOwnProperty,QX=Object.prototype.propertyIsEnumerable,CX=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),xd=t=>{throw TypeError(t)},pk=(t,e,n)=>e in t?kQ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jX=(t,e)=>{for(var n in e||(e={}))kX.call(e,n)&&pk(t,n,e[n]);if(jx)for(var n of jx(e))QX.call(e,n)&&pk(t,n,e[n]);return t},EX=(t,e)=>ufe(t,ffe(e)),YA=(t,e)=>kQ(t,"name",{value:e,configurable:!0}),$X=(t,e)=>{var n={};for(var r in t)kX.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&jx)for(var r of jx(t))e.indexOf(r)<0&&QX.call(t,r)&&(n[r]=t[r]);return n},vd=t=>{var e;return[,,,cfe((e=t==null?void 0:t[CX("metadata")])!=null?e:null)]},NX=["class","method","getter","setter","accessor","field","value","get","set"],Vf=t=>t!==void 0&&typeof t!="function"?xd("Function expected"):t,hfe=(t,e,n,r,i)=>({kind:NX[t],name:e,metadata:r,addInitializer:s=>n._?xd("Already initialized"):i.push(Vf(s||null))}),ec=(t,e)=>pk(e,CX("metadata"),t[3]),qe=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},lt=(t,e,n,r,i,s)=>{var a,o,u,d,h,m=e&7,g=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?g?1:2:0,b=NX[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),j=m&&(!x&&!g&&(i=i.prototype),m<5&&(m>3||!x)&&dfe(m<4?i:{get[n](){return kn(this,s)},set[n](E){return di(this,s,E)}},n));m?x&&m<4&&YA(s,(m>2?"set ":m>1?"get ":"")+n):YA(i,n);for(var Q=r.length-1;Q>=0;Q--)d=hfe(m,n,u={},t[3],w),m&&(d.static=g,d.private=x,h=d.access={has:x?E=>pfe(i,E):E=>n in E},m^3&&(h.get=x?E=>(m^1?kn:mfe)(E,i,m^4?s:j.get):E=>E[n]),m>2&&(h.set=x?(E,R)=>di(E,i,R,m^4?s:j.set):(E,R)=>E[n]=R)),o=(0,r[Q])(m?m<4?x?s:j[b]:m>4?void 0:{get:j.get,set:j.set}:i,d),u._=1,m^4||o===void 0?Vf(o)&&(m>4?k.unshift(o):m?x?s=o:j[b]=o:i=o):typeof o!="object"||o===null?xd("Object expected"):(Vf(a=o.get)&&(j.get=a),Vf(a=o.set)&&(j.set=a),Vf(a=o.init)&&k.unshift(a));return m||ec(t,i),j&&kQ(i,n,j),x?m^4?s:j:i},QQ=(t,e,n)=>e.has(t)||xd("Cannot "+n),pfe=(t,e)=>Object(e)!==e?xd('Cannot use the "in" operator on this value'):t.has(e),kn=(t,e,n)=>(QQ(t,e,"read from private field"),n?n.call(t):e.get(t)),$t=(t,e,n)=>e.has(t)?xd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),di=(t,e,n,r)=>(QQ(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),mfe=(t,e,n)=>(QQ(t,e,"access private method"),n);function TX(t,e){return{plugin:t,options:e}}function CQ(t){return e=>TX(t,e)}function jQ(t){return typeof t=="function"?{plugin:t,options:void 0}:t}var PX,np,EQ,QO;PX=[ft];var Cr=class{constructor(t,e){this.manager=t,this.options=e,$t(this,EQ,qe(np,8,this,!1)),qe(np,11,this),$t(this,QO,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return Nt(()=>this.disabled)}configure(t){this.options=t}registerEffect(t){const e=bi(t.bind(this));return kn(this,QO).add(e),e}destroy(){kn(this,QO).forEach(t=>t())}static configure(t){return TX(this,t)}};np=vd(null);EQ=new WeakMap;QO=new WeakMap;lt(np,4,"disabled",PX,Cr,EQ);ec(np,Cr);var Ip=class extends Cr{},CO,p1=class{constructor(t){this.manager=t,this.instances=new Map,$t(this,CO,[])}get values(){return Array.from(this.instances.values())}set values(t){const e=t.map(jQ).reduceRight((r,i)=>r.some(({plugin:s})=>s===i.plugin)?r:[i,...r],[]),n=e.map(({plugin:r})=>r);for(const r of kn(this,CO))if(!n.includes(r)){if(r.prototype instanceof Ip)continue;this.unregister(r)}for(const{plugin:r,options:i}of e)this.register(r,i);di(this,CO,n)}get(t){return this.instances.get(t)}register(t,e){const n=this.instances.get(t);if(n)return n.options!==e&&(n.options=e),n;const r=new t(this.manager,e);return this.instances.set(t,r),r}unregister(t){const e=this.instances.get(t);e&&(e.destroy(),this.instances.delete(t))}destroy(){for(const t of this.instances.values())t.destroy();this.instances.clear()}};CO=new WeakMap;function gfe(t,e){return t.priority===e.priority?t.type===e.type?e.value-t.value:e.type-t.type:e.priority-t.priority}var eO=[],Gc,Fc,Ofe=class extends Cr{constructor(t){super(t),$t(this,Gc),$t(this,Fc),this.computeCollisions=this.computeCollisions.bind(this),di(this,Fc,Dp(eO)),this.destroy=Lp(()=>{const e=this.computeCollisions(),n=Nt(()=>this.manager.dragOperation.position.current);if(e!==eO){const r=kn(this,Gc);if(di(this,Gc,n),r&&n.x==r.x&&n.y==r.y)return}else di(this,Gc,void 0);kn(this,Fc).value=e},()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(t=!0){Nt(()=>{t?kn(this,Fc).value=this.computeCollisions():di(this,Gc,void 0)})}computeCollisions(t,e){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:s,status:a}=r;if(!a.initialized||!s)return eO;const o=[],u=[];for(const d of t??n.droppables){if(d.disabled||i&&!d.accepts(i))continue;const h=e??d.collisionDetector;if(!h)continue;u.push(d),d.shape;const m=Nt(()=>h({droppable:d,dragOperation:r}));m&&(d.collisionPriority!=null&&(m.priority=d.collisionPriority),o.push(m))}return u.length===0?eO:(o.sort(gfe),o)}get collisions(){return kn(this,Fc).value}};Gc=new WeakMap;Fc=new WeakMap;var xfe=class{constructor(){this.registry=new Map}addEventListener(t,e){const{registry:n}=this,r=new Set(n.get(t));return r.add(e),n.set(t,r),()=>this.removeEventListener(t,e)}removeEventListener(t,e){const{registry:n}=this,r=new Set(n.get(t));r.delete(e),n.set(t,r)}dispatch(t,...e){const{registry:n}=this,r=n.get(t);if(r)for(const i of r)i(...e)}},vfe=class extends xfe{constructor(t){super(),this.manager=t}dispatch(t,e){const n=[e,this.manager];super.dispatch(t,...n)}};function jO(t,e=!0){let n=!1;return EX(jX({},t),{cancelable:e,get defaultPrevented(){return n},preventDefault(){e&&(n=!0)}})}var yfe=class extends Ip{constructor(t){super(t);const e=(r,i)=>r.map(({id:s})=>s).join("")===i.map(({id:s})=>s).join("");let n=[];this.destroy=Lp(()=>{const{dragOperation:r,collisionObserver:i}=t;r.status.initializing&&(n=[],i.enable())},()=>{const{collisionObserver:r,monitor:i}=t,{collisions:s}=r;if(r.isDisabled())return;const a=jO({collisions:s});if(i.dispatch("collision",a),a.defaultPrevented||e(s,n))return;n=s;const[o]=s;Nt(()=>{var u;(o==null?void 0:o.id)!==((u=t.dragOperation.target)==null?void 0:u.id)&&(r.disable(),t.actions.setDropTarget(o==null?void 0:o.id).then(()=>{r.enable()}))})})}},Bp=(t=>(t[t.Lowest=0]="Lowest",t[t.Low=1]="Low",t[t.Normal=2]="Normal",t[t.High=3]="High",t[t.Highest=4]="Highest",t))(Bp||{}),qp=(t=>(t[t.Collision=0]="Collision",t[t.ShapeIntersection=1]="ShapeIntersection",t[t.PointerIntersection=2]="PointerIntersection",t))(qp||{}),_X,AX,RX,MX,zX,DX,LX,gi,$Q;LX=[ft],DX=[sn],zX=[sn],MX=[sn],RX=[sn],AX=[sn],_X=[sn];var Sa=class{constructor(){qe(gi,5,this),$t(this,$Q,qe(gi,8,this,"idle")),qe(gi,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){const{value:t}=this;return t!=="idle"&&t!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(t){this.value=t}};gi=vd(null);$Q=new WeakMap;lt(gi,4,"value",LX,Sa,$Q);lt(gi,2,"current",DX,Sa);lt(gi,2,"idle",zX,Sa);lt(gi,2,"initializing",MX,Sa);lt(gi,2,"initialized",RX,Sa);lt(gi,2,"dragging",AX,Sa);lt(gi,2,"dropped",_X,Sa);ec(gi,Sa);var bfe=class{constructor(t){this.manager=t}setDragSource(t){const{dragOperation:e}=this.manager;e.sourceIdentifier=typeof t=="string"||typeof t=="number"?t:t.id}setDropTarget(t){return Nt(()=>{const{dragOperation:e}=this.manager,n=t??null;if(e.targetIdentifier===n)return Promise.resolve(!1);e.targetIdentifier=n;const r=jO({operation:e.snapshot()});return e.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(t){return Nt(()=>{const{dragOperation:e}=this.manager;if(t.source!=null&&this.setDragSource(t.source),!e.source)throw new Error("Cannot start a drag operation without a drag source");if(!e.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:i,coordinates:s}=t;Vo(()=>{e.status.set("initialization-pending"),e.shape=null,e.canceled=!1,e.activatorEvent=i??null,e.position.reset(s)});const a=jO({operation:e.snapshot()});return this.manager.monitor.dispatch("beforedragstart",a),a.defaultPrevented?(e.reset(),r.abort(),r):(e.status.set("initializing"),e.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:o}=e;o.current==="initializing"&&(e.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:i,operation:e.snapshot(),cancelable:!1}))}),r)})}move(t){return Nt(()=>{var e,n;const{dragOperation:r}=this.manager,{status:i,controller:s}=r;if(!i.dragging||!s||s.signal.aborted)return;const a=jO({nativeEvent:t.event,operation:r.snapshot(),by:t.by,to:t.to},(e=t.cancelable)!=null?e:!0);((n=t.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var o,u,d,h,m;if(a.defaultPrevented)return;const g=(m=t.to)!=null?m:{x:r.position.current.x+((u=(o=t.by)==null?void 0:o.x)!=null?u:0),y:r.position.current.y+((h=(d=t.by)==null?void 0:d.y)!=null?h:0)};r.position.current=g})})}stop(t={}){return Nt(()=>{var e,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let s;const a=()=>{const u={resume:()=>{},abort:()=>{}};return s=new Promise((d,h)=>{u.resume=d,u.abort=h}),u};i.abort();const o=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const u=Nt(()=>{var h;return((h=r.source)==null?void 0:h.status)==="dropping"}),d=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(u){const{source:h}=r,m=bi(()=>{(h==null?void 0:h.status)==="idle"&&(m(),d())})}else this.manager.renderer.rendering.then(d)})};r.canceled=(e=t.canceled)!=null?e:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:t.event,operation:r.snapshot(),canceled:(n=t.canceled)!=null?n:!1,suspend:a}),s?s.then(o).catch(()=>r.reset()):o()})}},XX,ZX,IX,BX,yr,NQ,TQ,PQ,_Q;BX=[ft],IX=[ft],ZX=[ft],XX=[ft];var _l=class{constructor(t,e){$t(this,NQ,qe(yr,8,this)),qe(yr,11,this),$t(this,TQ,qe(yr,12,this)),qe(yr,15,this),$t(this,PQ,qe(yr,16,this)),qe(yr,19,this),$t(this,_Q,qe(yr,20,this)),qe(yr,23,this);const{effects:n,id:r,data:i={},disabled:s=!1,register:a=!0}=t;let o=r;this.manager=e,this.id=r,this.data=i,this.disabled=s,this.effects=()=>{var u;return[()=>{const{id:d,manager:h}=this;if(d!==o)return h==null||h.registry.register(this),()=>h==null?void 0:h.registry.unregister(this)},...(u=n==null?void 0:n())!=null?u:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),e&&a&&queueMicrotask(this.register)}register(){var t;return(t=this.manager)==null?void 0:t.registry.register(this)}unregister(){var t;(t=this.manager)==null||t.registry.unregister(this)}destroy(){var t;(t=this.manager)==null||t.registry.unregister(this)}};yr=vd(null);NQ=new WeakMap;TQ=new WeakMap;PQ=new WeakMap;_Q=new WeakMap;lt(yr,4,"manager",BX,_l,NQ);lt(yr,4,"id",IX,_l,TQ);lt(yr,4,"data",ZX,_l,PQ);lt(yr,4,"disabled",XX,_l,_Q);ec(yr,_l);var UA=class{constructor(){this.map=Dp(new Map),this.cleanupFunctions=new WeakMap,this.register=(t,e)=>{const n=this.map.peek(),r=n.get(t),i=()=>this.unregister(t,e);if(r===e)return i;if(r){const o=this.cleanupFunctions.get(r);o==null||o(),this.cleanupFunctions.delete(r)}const s=new Map(n);s.set(t,e),this.map.value=s;const a=Lp(...e.effects());return this.cleanupFunctions.set(e,a),i},this.unregister=(t,e)=>{const n=this.map.peek();if(n.get(t)!==e)return;const r=this.cleanupFunctions.get(e);r==null||r(),this.cleanupFunctions.delete(e);const i=new Map(n);i.delete(t),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(t){return this.map.value.has(t)}get(t){return this.map.value.get(t)}destroy(){for(const t of this){const e=this.cleanupFunctions.get(t);e==null||e(),t.destroy()}this.map.value=new Map}},qX,VX,YX,UX,WX,HX,mk,Jn,AQ,RQ,MQ,ws=class extends(mk=_l,HX=[ft],WX=[ft],UX=[ft],YX=[sn],VX=[sn],qX=[sn],mk){constructor(e,n){var r=e,{modifiers:i,type:s,sensors:a}=r,o=$X(r,["modifiers","type","sensors"]);super(o,n),qe(Jn,5,this),$t(this,AQ,qe(Jn,8,this)),qe(Jn,11,this),$t(this,RQ,qe(Jn,12,this)),qe(Jn,15,this),$t(this,MQ,qe(Jn,16,this,this.isDragSource?"dragging":"idle")),qe(Jn,19,this),this.type=s,this.sensors=a,this.modifiers=i,this.alignment=o.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var e,n;return((n=(e=this.manager)==null?void 0:e.dragOperation.source)==null?void 0:n.id)===this.id}};Jn=vd(mk);AQ=new WeakMap;RQ=new WeakMap;MQ=new WeakMap;lt(Jn,4,"type",HX,ws,AQ);lt(Jn,4,"modifiers",WX,ws,RQ);lt(Jn,4,"status",UX,ws,MQ);lt(Jn,2,"isDropping",YX,ws);lt(Jn,2,"isDragging",VX,ws);lt(Jn,2,"isDragSource",qX,ws);ec(Jn,ws);var GX,FX,KX,JX,eZ,tZ,gk,vn,zQ,DQ,LQ,XQ,ZQ,ks=class extends(gk=_l,tZ=[ft],eZ=[ft],JX=[ft],KX=[ft],FX=[ft],GX=[sn],gk){constructor(e,n){var r=e,{accept:i,collisionDetector:s,collisionPriority:a,type:o}=r,u=$X(r,["accept","collisionDetector","collisionPriority","type"]);super(u,n),qe(vn,5,this),$t(this,zQ,qe(vn,8,this)),qe(vn,11,this),$t(this,DQ,qe(vn,12,this)),qe(vn,15,this),$t(this,LQ,qe(vn,16,this)),qe(vn,19,this),$t(this,XQ,qe(vn,20,this)),qe(vn,23,this),$t(this,ZQ,qe(vn,24,this)),qe(vn,27,this),this.accept=i,this.collisionDetector=s,this.collisionPriority=a,this.type=o}accepts(e){const{accept:n}=this;return n?typeof n=="function"?n(e):e.type?Array.isArray(n)?n.includes(e.type):e.type===n:!1:!0}get isDropTarget(){var e,n;return((n=(e=this.manager)==null?void 0:e.dragOperation.target)==null?void 0:n.id)===this.id}};vn=vd(gk);zQ=new WeakMap;DQ=new WeakMap;LQ=new WeakMap;XQ=new WeakMap;ZQ=new WeakMap;lt(vn,4,"accept",tZ,ks,zQ);lt(vn,4,"type",eZ,ks,DQ);lt(vn,4,"collisionDetector",JX,ks,LQ);lt(vn,4,"collisionPriority",KX,ks,XQ);lt(vn,4,"shape",FX,ks,ZQ);lt(vn,2,"isDropTarget",GX,ks);ec(vn,ks);var Ju=class extends Cr{constructor(t,e){super(t,e),this.manager=t,this.options=e}},Sfe=class extends AbortController{constructor(t,e){super(),this.constraints=t,this.onActivate=e,this.activated=!1;for(const n of t??[])n.controller=this}onEvent(t){var e;if(!this.activated)if((e=this.constraints)!=null&&e.length)for(const n of this.constraints)n.onEvent(t);else this.activate(t)}activate(t){this.activated||(this.activated=!0,this.onActivate(t))}abort(t){this.activated=!1,super.abort(t)}},EO,nZ=class{constructor(t){this.options=t,$t(this,EO)}set controller(t){di(this,EO,t),t.signal.addEventListener("abort",()=>this.abort())}activate(t){var e;(e=kn(this,EO))==null||e.activate(t)}};EO=new WeakMap;var WA=class extends Cr{constructor(t,e){super(t,e),this.manager=t,this.options=e}apply(t){return t.transform}},wfe=class{constructor(t){this.draggables=new UA,this.droppables=new UA,this.plugins=new p1(t),this.sensors=new p1(t),this.modifiers=new p1(t)}register(t,e){if(t instanceof ws)return this.draggables.register(t.id,t);if(t instanceof ks)return this.droppables.register(t.id,t);if(t.prototype instanceof WA)return this.modifiers.register(t,e);if(t.prototype instanceof Ju)return this.sensors.register(t,e);if(t.prototype instanceof Cr)return this.plugins.register(t,e);throw new Error("Invalid instance type")}unregister(t){if(t instanceof _l)return t instanceof ws?this.draggables.unregister(t.id,t):t instanceof ks?this.droppables.unregister(t.id,t):()=>{};if(t.prototype instanceof WA)return this.modifiers.unregister(t);if(t.prototype instanceof Ju)return this.sensors.unregister(t);if(t.prototype instanceof Cr)return this.plugins.unregister(t);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},rZ,iZ,sZ,aZ,lZ,oZ,cZ,uZ,dZ,Yf,$O,Kc,Ht,IQ,BQ,qQ,VQ,YQ,Uf;dZ=[sn],uZ=[ft],cZ=[ft],oZ=[ft],lZ=[ft],aZ=[ft],sZ=[sn],iZ=[sn],rZ=[sn];var qi=class{constructor(t){qe(Ht,5,this),$t(this,Yf),$t(this,$O),$t(this,Kc,new Jo(void 0,(e,n)=>e&&n?e.equals(n):e===n)),this.status=new Sa,$t(this,IQ,qe(Ht,8,this,!1)),qe(Ht,11,this),$t(this,BQ,qe(Ht,12,this,null)),qe(Ht,15,this),$t(this,qQ,qe(Ht,16,this,null)),qe(Ht,19,this),$t(this,VQ,qe(Ht,20,this,null)),qe(Ht,23,this),$t(this,YQ,qe(Ht,24,this,[])),qe(Ht,27,this),this.position=new wv({x:0,y:0}),$t(this,Uf,{x:0,y:0}),di(this,Yf,t)}get shape(){const{current:t,initial:e,previous:n}=kn(this,Kc);return!t||!e?null:{current:t,initial:e,previous:n}}set shape(t){t?kn(this,Kc).current=t:kn(this,Kc).reset()}get source(){var t;const e=this.sourceIdentifier;if(e==null)return null;const n=kn(this,Yf).registry.draggables.get(e);return n&&di(this,$O,n),(t=n??kn(this,$O))!=null?t:null}get target(){var t;const e=this.targetIdentifier;return e!=null&&(t=kn(this,Yf).registry.droppables.get(e))!=null?t:null}get transform(){const{x:t,y:e}=this.position.delta;let n={x:t,y:e};for(const r of this.modifiers)n=r.apply(EX(jX({},this.snapshot()),{transform:n}));return di(this,Uf,n),n}snapshot(){return Nt(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:kn(this,Uf),shape:this.shape?h1(this.shape):null,position:h1(this.position),status:h1(this.status),canceled:this.canceled}))}reset(){Vo(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,kn(this,Kc).reset(),this.position.reset({x:0,y:0}),di(this,Uf,{x:0,y:0}),this.modifiers=[]})}};Ht=vd(null);Yf=new WeakMap;$O=new WeakMap;Kc=new WeakMap;IQ=new WeakMap;BQ=new WeakMap;qQ=new WeakMap;VQ=new WeakMap;YQ=new WeakMap;Uf=new WeakMap;lt(Ht,2,"shape",dZ,qi);lt(Ht,4,"canceled",uZ,qi,IQ);lt(Ht,4,"activatorEvent",cZ,qi,BQ);lt(Ht,4,"sourceIdentifier",oZ,qi,qQ);lt(Ht,4,"targetIdentifier",lZ,qi,VQ);lt(Ht,4,"modifiers",aZ,qi,YQ);lt(Ht,2,"source",sZ,qi);lt(Ht,2,"target",iZ,qi);lt(Ht,2,"transform",rZ,qi);ec(Ht,qi);var kfe={get rendering(){return Promise.resolve()}};function ca(t,e){return typeof t=="function"?t(e):t??e}var Qfe=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(g=>g.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var n;const r=e??{},i=ca(r.plugins,[]),s=ca(r.sensors,[]),a=ca(r.modifiers,[]),o=(n=r.renderer)!=null?n:kfe,u=new vfe(this),d=new wfe(this);this.registry=d,this.monitor=u,this.renderer=o,this.actions=new bfe(this),this.dragOperation=new qi(this),this.collisionObserver=new Ofe(this),this.plugins=[yfe,...i],this.modifiers=a,this.sensors=s;const{destroy:h}=this,m=Lp(()=>{var g,x,v;const b=Nt(()=>this.dragOperation.modifiers),k=this.modifiers;for(const w of b)k.includes(w)||w.destroy();this.dragOperation.modifiers=(v=(x=(g=this.dragOperation.source)==null?void 0:g.modifiers)==null?void 0:x.map(w=>{const{plugin:j,options:Q}=jQ(w);return new j(this,Q)}))!=null?v:k});this.destroy=()=>{m(),h()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},fZ=t=>{throw TypeError(t)},UQ=(t,e,n)=>e.has(t)||fZ("Cannot "+n),He=(t,e,n)=>(UQ(t,e,"read from private field"),e.get(t)),xr=(t,e,n)=>e.has(t)?fZ("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Zr=(t,e,n,r)=>(UQ(t,e,"write to private field"),e.set(t,n),n),hZ=(t,e,n)=>(UQ(t,e,"access private method"),n);function kv(t){return t?t instanceof KeyframeEffect?!0:"getKeyframes"in t&&typeof t.getKeyframes=="function":!1}function Cfe(t,e){const n=t.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:i}=r,a=(kv(i)?i.getKeyframes():[]).filter(e);if(a.length>0)return[a[a.length-1],r]}return null}function Qv(t){const{width:e,height:n,top:r,left:i,bottom:s,right:a}=t.getBoundingClientRect();return{width:e,height:n,top:r,left:i,bottom:s,right:a}}function WQ(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Vp(t){return"nodeType"in t}function Si(t){var e,n,r;return t?WQ(t)?t:Vp(t)?"defaultView"in t?(e=t.defaultView)!=null?e:window:(r=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function HQ(t){const{Document:e}=Si(t);return t instanceof e||"nodeType"in t&&t.nodeType===Node.DOCUMENT_NODE}function Yo(t){return!t||WQ(t)?!1:t instanceof Si(t).HTMLElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("html")}function pZ(t){return t instanceof Si(t).SVGElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("svg")}function tc(t){return t?WQ(t)?t.document:Vp(t)?HQ(t)?t:Yo(t)||pZ(t)?t.ownerDocument:document:document:document}function jfe(t){var e,n,r,i;const{documentElement:s}=tc(t),a=Si(t).visualViewport,o=(e=a==null?void 0:a.width)!=null?e:s.clientWidth,u=(n=a==null?void 0:a.height)!=null?n:s.clientHeight,d=(r=a==null?void 0:a.offsetTop)!=null?r:0,h=(i=a==null?void 0:a.offsetLeft)!=null?i:0;return{top:d,left:h,right:h+o,bottom:d+u,width:o,height:u}}function Efe(t,e){if($fe(t)&&t.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(t);return n==="visible"&&r==="visible"&&i==="visible"}function $fe(t){return t.tagName==="DETAILS"}function Ex(t,e=t.getBoundingClientRect(),n=0){var r,i,s,a,o;let u=e;const{ownerDocument:d}=t,h=(r=d.defaultView)!=null?r:window;let m=t.parentElement;for(;m&&m!==d.documentElement;){if(!Efe(m)){const Q=m.getBoundingClientRect(),E=n*(Q.bottom-Q.top),R=n*(Q.right-Q.left),T=n*(Q.bottom-Q.top),A=n*(Q.right-Q.left);u={top:Math.max(u.top,Q.top-E),right:Math.min(u.right,Q.right+R),bottom:Math.min(u.bottom,Q.bottom+T),left:Math.max(u.left,Q.left-A),width:0,height:0},u.width=u.right-u.left,u.height=u.bottom-u.top}m=m.parentElement}const g=h.visualViewport,x=(i=g==null?void 0:g.offsetTop)!=null?i:0,v=(s=g==null?void 0:g.offsetLeft)!=null?s:0,b=(a=g==null?void 0:g.width)!=null?a:h.innerWidth,k=(o=g==null?void 0:g.height)!=null?o:h.innerHeight,w=n*k,j=n*b;return u={top:Math.max(u.top,x-w),right:Math.min(u.right,v+b+j),bottom:Math.min(u.bottom,x+k+w),left:Math.max(u.left,v-j),width:0,height:0},u.width=u.right-u.left,u.height=u.bottom-u.top,u.width<0&&(u.width=0),u.height<0&&(u.height=0),u}function ed(t){return{x:t.clientX,y:t.clientY}}var mZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ok(t=document,e=new Set){if(e.has(t))return[];e.add(t);const n=[t];for(const r of Array.from(t.querySelectorAll("iframe, frame")))try{const i=r.contentDocument;i&&!e.has(i)&&n.push(...Ok(i,e))}catch{}try{const r=t.defaultView;if(r&&r!==window.top){const i=r.parent;i&&i.document&&i.document!==t&&n.push(...Ok(i.document,e))}}catch{}return n}function GQ(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function gZ(){var t,e;const n=GQ()?window.visualViewport:null;return{x:(t=n==null?void 0:n.offsetLeft)!=null?t:0,y:(e=n==null?void 0:n.offsetTop)!=null?e:0}}function FQ(t){return!t||!Vp(t)?!1:t instanceof Si(t).ShadowRoot}function $x(t){if(t&&Vp(t)){let e=t.getRootNode();if(FQ(e))return e;if(e instanceof Document)return e}return tc(t)}function OZ(t){return t.matchMedia("(prefers-reduced-motion: reduce)").matches}function Nfe(t){const e="input, textarea, select, canvas, [contenteditable]",n=t.cloneNode(!0),r=Array.from(t.querySelectorAll(e));return Array.from(n.querySelectorAll(e)).forEach((s,a)=>{const o=r[a];if(HA(s)&&HA(o)&&(s.type!=="file"&&(s.value=o.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),GA(s)&&GA(o)&&o.width>0&&o.height>0){const u=s.getContext("2d");u==null||u.drawImage(o,0,0)}}),n}function HA(t){return"value"in t}function GA(t){return t.tagName==="CANVAS"}function xZ(t,{x:e,y:n}){const r=t.elementFromPoint(e,n);if(Tfe(r)){const{contentDocument:i}=r;if(i){const{left:s,top:a}=r.getBoundingClientRect();return xZ(i,{x:e-s,y:n-a})}}return r}function Tfe(t){return(t==null?void 0:t.tagName)==="IFRAME"}var FA=new WeakMap;function Pfe(t){return!!t.closest(`
436
+ input:not([disabled]),
437
+ select:not([disabled]),
438
+ textarea:not([disabled]),
439
+ button:not([disabled]),
440
+ a[href],
441
+ [contenteditable]:not([contenteditable="false"])
442
+ `)}var vZ=class{constructor(){this.entries=new Set,this.clear=()=>{for(const t of this.entries){const[e,{type:n,listener:r,options:i}]=t;e.removeEventListener(n,r,i)}this.entries.clear()}}bind(t,e){const n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e],i=[];for(const s of n)for(const a of r){const{type:o,listener:u,options:d}=a,h=[s,a];s.addEventListener(o,u,d),this.entries.add(h),i.push(h)}return function(){for(const[a,{type:o,listener:u,options:d}]of i)a.removeEventListener(o,u,d)}}};function td(t){const e=t==null?void 0:t.ownerDocument.defaultView;if(e&&e.self!==e.parent)return e.frameElement}function _fe(t){const e=new Set;let n=td(t);for(;n;)e.add(n),n=td(n);return e}function Afe(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)}function yZ(t,e){const n=()=>performance.now();let r,i;return function(...s){const a=this;i?(r==null||r(),r=Afe(()=>{t.apply(a,s),i=n()},e-(n()-i))):(t.apply(a,s),i=n())}}function Rfe(t,e){return t===e?!0:!t||!e?!1:t.top==e.top&&t.left==e.left&&t.right==e.right&&t.bottom==e.bottom}function Mfe(t,e=t.getBoundingClientRect()){const{width:n,height:r}=Ex(t,e);return n>0&&r>0}var zfe=mZ?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},NO,Dfe=class extends zfe{constructor(t){super(e=>{if(!He(this,NO)){Zr(this,NO,!0);return}t(e,this)}),xr(this,NO,!1)}};NO=new WeakMap;var KA=Array.from({length:100},(t,e)=>e/100),bZ=75,ao,Nx,il,lo,Wf,Rn,Oh,Hf,Tx,SZ,wZ,kZ=class{constructor(t,e,n={debug:!1,skipInitial:!1}){this.element=t,this.callback=e,xr(this,Tx),this.disconnect=()=>{var s,a,o;Zr(this,Oh,!0),(s=He(this,il))==null||s.disconnect(),(a=He(this,lo))==null||a.disconnect(),He(this,Wf).disconnect(),(o=He(this,Rn))==null||o.remove()},xr(this,ao,!0),xr(this,Nx),xr(this,il),xr(this,lo),xr(this,Wf),xr(this,Rn),xr(this,Oh,!1),xr(this,Hf,yZ(()=>{var s,a,o;const{element:u}=this;if((s=He(this,lo))==null||s.disconnect(),He(this,Oh)||!He(this,ao)||!u.isConnected)return;const d=(a=u.ownerDocument)!=null?a:document,{innerHeight:h,innerWidth:m}=(o=d.defaultView)!=null?o:window,g=u.getBoundingClientRect(),x=Ex(u,g),{top:v,left:b,bottom:k,right:w}=x,j=-Math.floor(v),Q=-Math.floor(b),E=-Math.floor(m-w),R=-Math.floor(h-k),T=`${j}px ${E}px ${R}px ${Q}px`;this.boundingClientRect=g,Zr(this,lo,new IntersectionObserver(A=>{const[I]=A,{intersectionRect:W}=I;(I.intersectionRatio!==1?I.intersectionRatio:Xp.intersectionRatio(W,Ex(u)))!==1&&He(this,Hf).call(this)},{threshold:KA,rootMargin:T,root:d})),He(this,lo).observe(u),hZ(this,Tx,SZ).call(this)},bZ)),this.boundingClientRect=t.getBoundingClientRect(),Zr(this,ao,Mfe(t,this.boundingClientRect));let r=!0;this.callback=s=>{r&&(r=!1,n.skipInitial)||e(s)};const i=t.ownerDocument;n!=null&&n.debug&&(Zr(this,Rn,document.createElement("div")),He(this,Rn).style.background="rgba(0,0,0,0.15)",He(this,Rn).style.position="fixed",He(this,Rn).style.pointerEvents="none",i.body.appendChild(He(this,Rn))),Zr(this,Wf,new IntersectionObserver(s=>{var a,o;const u=s[s.length-1],{boundingClientRect:d,isIntersecting:h}=u,{width:m,height:g}=d,x=He(this,ao);Zr(this,ao,h),!(!m&&!g)&&(x&&!h?((a=He(this,lo))==null||a.disconnect(),this.callback(null),(o=He(this,il))==null||o.disconnect(),Zr(this,il,void 0),He(this,Rn)&&(He(this,Rn).style.visibility="hidden")):He(this,Hf).call(this),h&&!He(this,il)&&(Zr(this,il,new Dfe(He(this,Hf))),He(this,il).observe(t)))},{threshold:KA,root:i})),He(this,ao)&&!n.skipInitial&&this.callback(this.boundingClientRect),He(this,Wf).observe(t)}};ao=new WeakMap;Nx=new WeakMap;il=new WeakMap;lo=new WeakMap;Wf=new WeakMap;Rn=new WeakMap;Oh=new WeakMap;Hf=new WeakMap;Tx=new WeakSet;SZ=function(){He(this,Oh)||(hZ(this,Tx,wZ).call(this),!Rfe(this.boundingClientRect,He(this,Nx))&&(this.callback(this.boundingClientRect),Zr(this,Nx,this.boundingClientRect)))};wZ=function(){if(He(this,Rn)){const{top:t,left:e,width:n,height:r}=Ex(this.element);He(this,Rn).style.overflow="hidden",He(this,Rn).style.visibility="visible",He(this,Rn).style.top=`${Math.floor(t)}px`,He(this,Rn).style.left=`${Math.floor(e)}px`,He(this,Rn).style.width=`${Math.floor(n)}px`,He(this,Rn).style.height=`${Math.floor(r)}px`}};var tO=new WeakMap,nO=new WeakMap;function Lfe(t,e){let n=tO.get(t);return n||(n={disconnect:new kZ(t,i=>{const s=tO.get(t);s&&s.callbacks.forEach(a=>a(i))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(e),tO.set(t,n),()=>{n.callbacks.delete(e),n.callbacks.size===0&&(tO.delete(t),n.disconnect())}}function Xfe(t,e){const n=new Set;for(const r of t){const i=Lfe(r,e);n.add(i)}return()=>n.forEach(r=>r())}function Zfe(t,e){var n;const r=t.ownerDocument;if(!nO.has(r)){const a=new AbortController,o=new Set;document.addEventListener("scroll",u=>o.forEach(d=>d(u)),{capture:!0,passive:!0,signal:a.signal}),nO.set(r,{disconnect:()=>a.abort(),listeners:o})}const{listeners:i,disconnect:s}=(n=nO.get(r))!=null?n:{};return!i||!s?()=>{}:(i.add(e),()=>{i.delete(e),i.size===0&&(s(),nO.delete(r))})}var Gf,Ff,TO,xk,Ife=class{constructor(t,e,n){this.callback=e,xr(this,Gf),xr(this,Ff,!1),xr(this,TO),xr(this,xk,yZ(a=>{if(!He(this,Ff)&&a.target&&"contains"in a.target&&typeof a.target.contains=="function"){for(const o of He(this,TO))if(a.target.contains(o)){this.callback(He(this,Gf).boundingClientRect);break}}},bZ));const r=_fe(t),i=Xfe(r,e),s=Zfe(t,He(this,xk));Zr(this,TO,r),Zr(this,Gf,new kZ(t,e,n)),this.disconnect=()=>{He(this,Ff)||(Zr(this,Ff,!0),i(),s(),He(this,Gf).disconnect())}}};Gf=new WeakMap;Ff=new WeakMap;TO=new WeakMap;xk=new WeakMap;function vk(t){return"showPopover"in t&&"hidePopover"in t&&typeof t.showPopover=="function"&&typeof t.hidePopover=="function"}function rp(t){try{vk(t)&&t.isConnected&&t.hasAttribute("popover")&&!t.matches(":popover-open")&&t.showPopover()}catch{}}function JA(t){return!mZ||!t?!1:t===tc(t).scrollingElement}function QZ(t){var e,n;const r=Si(t),i=JA(t)?jfe(t):Qv(t),s=r.visualViewport,a=JA(t)?{height:(e=s==null?void 0:s.height)!=null?e:r.innerHeight,width:(n=s==null?void 0:s.width)!=null?n:r.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={current:{x:t.scrollLeft,y:t.scrollTop},max:{x:t.scrollWidth-a.width,y:t.scrollHeight-a.height}},u=o.current.y<=0,d=o.current.x<=0,h=o.current.y>=o.max.y,m=o.current.x>=o.max.x;return{rect:i,position:o,isTop:u,isLeft:d,isBottom:h,isRight:m}}function Bfe(t,e){const{isTop:n,isBottom:r,isLeft:i,isRight:s,position:a}=QZ(t),{x:o,y:u}=e??{x:0,y:0},d=!n&&a.current.y+u>0,h=!r&&a.current.y+u<a.max.y,m=!i&&a.current.x+o>0,g=!s&&a.current.x+o<a.max.x;return{top:d,bottom:h,left:m,right:g,x:m||g,y:d||h}}var KQ=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:n,resolvers:r}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const i of n)i();for(const i of r)i()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(n=>this.resolvers.add(n))}},Px=new KQ(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),qfe=new KQ(t=>setTimeout(t,50)),_x=new Map,Vfe=_x.clear.bind(_x);function wa(t,e=!1){if(!e)return eR(t);let n=_x.get(t);return n||(n=eR(t),_x.set(t,n),qfe.schedule(Vfe),n)}function eR(t){return Si(t).getComputedStyle(t)}function Yfe(t,e=wa(t,!0)){return e.position==="fixed"||e.position==="sticky"}function Ufe(t,e=wa(t,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=e[i];return typeof s=="string"?n.test(s):!1})}var Wfe={excludeElement:!0,escapeShadowDOM:!0};function yk(t,e=Wfe){const{limit:n,excludeElement:r,escapeShadowDOM:i}=e,s=new Set;function a(o){if(n!=null&&s.size>=n||!o)return s;if(HQ(o)&&o.scrollingElement!=null&&!s.has(o.scrollingElement))return s.add(o.scrollingElement),s;if(i&&FQ(o))return a(o.host);if(!Yo(o))return pZ(o)?a(o.parentElement):s;if(s.has(o))return s;const u=wa(o,!0);if(r&&o===t||Ufe(o,u)&&s.add(o),Yfe(o,u)){const{scrollingElement:d}=o.ownerDocument;return d&&s.add(d),s}return a(o.parentNode)}return t?a(t):s}function Hfe(t){const[e]=yk(t,{limit:1});return e??null}function nd(t,e=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!t)return n;let r=td(t);for(;r;){if(r===e)return n;const i=Qv(r),{x:s,y:a}=Gfe(r,i);n.x=n.x+i.left,n.y=n.y+i.top,n.scaleX=n.scaleX*s,n.scaleY=n.scaleY*a,r=td(r)}return n}function Gfe(t,e=Qv(t)){const n=Math.round(e.width),r=Math.round(e.height);if(Yo(t))return{x:n/t.offsetWidth,y:r/t.offsetHeight};const i=wa(t,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function Ffe(t){if(t==="none")return null;const e=t.split(" "),n=parseFloat(e[0]),r=parseFloat(e[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function JQ(t){if(t==="none")return null;const[e,n,r="0"]=t.split(" "),i={x:parseFloat(e),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function eC(t){var e,n,r,i,s,a,o,u,d;const{scale:h,transform:m,translate:g}=t,x=Ffe(h),v=JQ(g),b=Kfe(m);if(!b&&!x&&!v)return null;const k={x:(e=x==null?void 0:x.x)!=null?e:1,y:(n=x==null?void 0:x.y)!=null?n:1},w={x:(r=v==null?void 0:v.x)!=null?r:0,y:(i=v==null?void 0:v.y)!=null?i:0},j={x:(s=b==null?void 0:b.x)!=null?s:0,y:(a=b==null?void 0:b.y)!=null?a:0,scaleX:(o=b==null?void 0:b.scaleX)!=null?o:1,scaleY:(u=b==null?void 0:b.scaleY)!=null?u:1};return{x:w.x+j.x,y:w.y+j.y,z:(d=v==null?void 0:v.z)!=null?d:0,scaleX:k.x*j.scaleX,scaleY:k.y*j.scaleY}}function Kfe(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}var fi=(t=>(t[t.Idle=0]="Idle",t[t.Forward=1]="Forward",t[t.Reverse=-1]="Reverse",t))(fi||{}),Jfe={x:.2,y:.2},ehe={x:10,y:10};function the(t,e,n,r=25,i=Jfe,s=ehe){const{x:a,y:o}=e,{rect:u,isTop:d,isBottom:h,isLeft:m,isRight:g}=QZ(t),x=nd(t),v=wa(t,!0),b=eC(v),k=b!==null?(b==null?void 0:b.scaleX)<0:!1,w=b!==null?(b==null?void 0:b.scaleY)<0:!1,j=new Xp(u.left*x.scaleX+x.x,u.top*x.scaleY+x.y,u.width*x.scaleX,u.height*x.scaleY),Q={x:0,y:0},E={x:0,y:0},R={height:j.height*i.y,width:j.width*i.x};return(!d||w&&!h)&&o<=j.top+R.height&&(n==null?void 0:n.y)!==1&&a>=j.left-s.x&&a<=j.right+s.x?(Q.y=w?1:-1,E.y=r*Math.abs((j.top+R.height-o)/R.height)):(!h||w&&!d)&&o>=j.bottom-R.height&&(n==null?void 0:n.y)!==-1&&a>=j.left-s.x&&a<=j.right+s.x&&(Q.y=w?-1:1,E.y=r*Math.abs((j.bottom-R.height-o)/R.height)),(!g||k&&!m)&&a>=j.right-R.width&&(n==null?void 0:n.x)!==-1&&o>=j.top-s.y&&o<=j.bottom+s.y?(Q.x=k?-1:1,E.x=r*Math.abs((j.right-R.width-a)/R.width)):(!m||k&&!g)&&a<=j.left+R.width&&(n==null?void 0:n.x)!==1&&o>=j.top-s.y&&o<=j.bottom+s.y&&(Q.x=k?1:-1,E.x=r*Math.abs((j.left+R.width-a)/R.width)),{direction:Q,speed:E}}function nhe(t){return"scrollIntoViewIfNeeded"in t&&typeof t.scrollIntoViewIfNeeded=="function"}function rhe(t,e=!1){if(nhe(t)){t.scrollIntoViewIfNeeded(e);return}if(!Yo(t))return t.scrollIntoView();var n=Hfe(t);if(!Yo(n))return;const r=wa(n,!0),i=parseInt(r.getPropertyValue("border-top-width")),s=parseInt(r.getPropertyValue("border-left-width")),a=t.offsetTop-n.offsetTop<n.scrollTop,o=t.offsetTop-n.offsetTop+t.clientHeight-i>n.scrollTop+n.clientHeight,u=t.offsetLeft-n.offsetLeft<n.scrollLeft,d=t.offsetLeft-n.offsetLeft+t.clientWidth-s>n.scrollLeft+n.clientWidth,h=a&&!o;(a||o)&&e&&(n.scrollTop=t.offsetTop-n.offsetTop-n.clientHeight/2-i+t.clientHeight/2),(u||d)&&e&&(n.scrollLeft=t.offsetLeft-n.offsetLeft-n.clientWidth/2-s+t.clientWidth/2),(a||o||u||d)&&!e&&t.scrollIntoView(h)}function ihe(t,e,n){const{scaleX:r,scaleY:i,x:s,y:a}=e,o=t.left+s+(1-r)*parseFloat(n),u=t.top+a+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?t.width*r:t.width,h=i?t.height*i:t.height;return{width:d,height:h,top:u,right:o+d,bottom:u+h,left:o}}function she(t,e,n){const{scaleX:r,scaleY:i,x:s,y:a}=e,o=t.left-s-(1-r)*parseFloat(n),u=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?t.width/r:t.width,h=i?t.height/i:t.height;return{width:d,height:h,top:u,right:o+d,bottom:u+h,left:o}}function ahe({element:t,keyframes:e,options:n}){return t.animate(e,n).finished}var lhe=new KQ(t=>setTimeout(t,0)),xh=new Map,ohe=xh.clear.bind(xh);function che(t){const e=t.ownerDocument;let n=xh.get(e);if(n)return n;n=e.getAnimations(),xh.set(e,n),lhe.schedule(ohe);const r=n.filter(i=>kv(i.effect)&&i.effect.target===t);return xh.set(t,r),n}function uhe(t,e){const n=che(t).filter(r=>{var i,s;if(kv(r.effect)){const{target:a}=r.effect;if((s=a&&((i=e.isValidTarget)==null?void 0:i.call(e,a)))!=null?s:!0)return r.effect.getKeyframes().some(u=>{for(const d of e.properties)if(u[d])return!0})}}).map(r=>{const{effect:i,currentTime:s}=r,a=i==null?void 0:i.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof a=="number"&&typeof s=="number"&&s<a)return r.currentTime=a,()=>{r.currentTime=s}});if(n.length>0)return()=>n.forEach(r=>r==null?void 0:r())}var ua=class extends Xp{constructor(t,e={}){var n,r,i,s;const{frameTransform:a=nd(t),ignoreTransforms:o,getBoundingClientRect:u=Qv}=e,d=uhe(t,{properties:["transform","translate","scale","width","height"],isValidTarget:R=>(R!==t||GQ())&&R.contains(t)}),h=u(t);let{top:m,left:g,width:x,height:v}=h,b;const k=wa(t),w=eC(k),j={x:(n=w==null?void 0:w.scaleX)!=null?n:1,y:(r=w==null?void 0:w.scaleY)!=null?r:1},Q=dhe(t,k);d==null||d(),w&&(b=she(h,w,k.transformOrigin),(o||Q)&&(m=b.top,g=b.left,x=b.width,v=b.height));const E={width:(i=b==null?void 0:b.width)!=null?i:x,height:(s=b==null?void 0:b.height)!=null?s:v};if(Q&&!o&&b){const R=ihe(b,Q,k.transformOrigin);m=R.top,g=R.left,x=R.width,v=R.height,j.x=Q.scaleX,j.y=Q.scaleY}a&&(o||(g*=a.scaleX,x*=a.scaleX,m*=a.scaleY,v*=a.scaleY),g+=a.x,m+=a.y),super(g,m,x,v),this.scale=j,this.intrinsicWidth=E.width,this.intrinsicHeight=E.height}};function dhe(t,e){var n;const r=t.getAnimations();let i=null;if(!r.length)return null;for(const s of r){if(s.playState!=="running")continue;const a=kv(s.effect)?s.effect.getKeyframes():[],o=a[a.length-1];if(!o)continue;const{transform:u,translate:d,scale:h}=o;if(u||d||h){const m=eC({transform:typeof u=="string"&&u?u:e.transform,translate:typeof d=="string"&&d?d:e.translate,scale:typeof h=="string"&&h?h:e.scale});m&&(i=i?{x:i.x+m.x,y:i.y+m.y,z:(n=i.z)!=null?n:m.z,scaleX:i.scaleX*m.scaleX,scaleY:i.scaleY*m.scaleY}:m)}}return i}function vh(t){return"style"in t&&typeof t.style=="object"&&t.style!==null&&"setProperty"in t.style&&"removeProperty"in t.style&&typeof t.style.setProperty=="function"&&typeof t.style.removeProperty=="function"}var fhe=class{constructor(t){this.element=t,this.initial=new Map}set(t,e=""){const{element:n}=this;if(vh(n))for(const[r,i]of Object.entries(t)){const s=`${e}${r}`;this.initial.has(s)||this.initial.set(s,n.style.getPropertyValue(s)),n.style.setProperty(s,typeof i=="string"?i:`${i}px`)}}remove(t,e=""){const{element:n}=this;if(vh(n))for(const r of t){const i=`${e}${r}`;n.style.removeProperty(i)}}reset(){const{element:t}=this;if(vh(t)){for(const[e,n]of this.initial)t.style.setProperty(e,n);t.getAttribute("style")===""&&t.removeAttribute("style")}}};function Uo(t){return t?t instanceof Si(t).Element||Vp(t)&&t.nodeType===Node.ELEMENT_NODE:!1}function tC(t){if(!t)return!1;const{KeyboardEvent:e}=Si(t.target);return t instanceof e}function hhe(t){if(!t)return!1;const{PointerEvent:e}=Si(t.target);return t instanceof e}function phe(t){if(!Uo(t))return!1;const{tagName:e}=t;return e==="INPUT"||e==="TEXTAREA"||mhe(t)}function mhe(t){return t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")!=="false"}var m1={};function bk(t){const e=m1[t]==null?0:m1[t]+1;return m1[t]=e,`${t}-${e}`}var ghe=({dragOperation:t,droppable:e})=>{const n=t.position.current;if(!n)return null;const{id:r}=e;if(!e.shape)return null;if(e.shape.containsPoint(n)){const i=fs.distance(e.shape.center,n);return{id:r,value:1/i,type:qp.PointerIntersection,priority:Bp.High}}return null},Ohe=({dragOperation:t,droppable:e})=>{const{shape:n}=t;if(!e.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(e.shape);if(r){const{position:i}=t,s=fs.distance(e.shape.center,i.current),o=r/(n.current.area+e.shape.area-r)/s;return{id:e.id,value:o,type:qp.ShapeIntersection,priority:Bp.Normal}}return null},xhe=t=>{var e;return(e=ghe(t))!=null?e:Ohe(t)},vhe=Object.create,nC=Object.defineProperty,yhe=Object.defineProperties,bhe=Object.getOwnPropertyDescriptor,She=Object.getOwnPropertyDescriptors,Ax=Object.getOwnPropertySymbols,CZ=Object.prototype.hasOwnProperty,jZ=Object.prototype.propertyIsEnumerable,EZ=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),yd=t=>{throw TypeError(t)},Sk=(t,e,n)=>e in t?nC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ip=(t,e)=>{for(var n in e||(e={}))CZ.call(e,n)&&Sk(t,n,e[n]);if(Ax)for(var n of Ax(e))jZ.call(e,n)&&Sk(t,n,e[n]);return t},rC=(t,e)=>yhe(t,She(e)),tR=(t,e)=>nC(t,"name",{value:e,configurable:!0}),$Z=(t,e)=>{var n={};for(var r in t)CZ.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Ax)for(var r of Ax(t))e.indexOf(r)<0&&jZ.call(t,r)&&(n[r]=t[r]);return n},bd=t=>{var e;return[,,,vhe((e=t==null?void 0:t[EZ("metadata")])!=null?e:null)]},NZ=["class","method","getter","setter","accessor","field","value","get","set"],Kf=t=>t!==void 0&&typeof t!="function"?yd("Function expected"):t,whe=(t,e,n,r,i)=>({kind:NZ[t],name:e,metadata:r,addInitializer:s=>n._?yd("Already initialized"):i.push(Kf(s||null))}),nc=(t,e)=>Sk(e,EZ("metadata"),t[3]),an=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},Yr=(t,e,n,r,i,s)=>{var a,o,u,d,h,m=e&7,g=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?g?1:2:0,b=NZ[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),j=m&&(!x&&!g&&(i=i.prototype),m<5&&(m>3||!x)&&bhe(m<4?i:{get[n](){return Mt(this,s)},set[n](E){return tr(this,s,E)}},n));m?x&&m<4&&tR(s,(m>2?"set ":m>1?"get ":"")+n):tR(i,n);for(var Q=r.length-1;Q>=0;Q--)d=whe(m,n,u={},t[3],w),m&&(d.static=g,d.private=x,h=d.access={has:x?E=>khe(i,E):E=>n in E},m^3&&(h.get=x?E=>(m^1?Mt:Wo)(E,i,m^4?s:j.get):E=>E[n]),m>2&&(h.set=x?(E,R)=>tr(E,i,R,m^4?s:j.set):(E,R)=>E[n]=R)),o=(0,r[Q])(m?m<4?x?s:j[b]:m>4?void 0:{get:j.get,set:j.set}:i,d),u._=1,m^4||o===void 0?Kf(o)&&(m>4?k.unshift(o):m?x?s=o:j[b]=o:i=o):typeof o!="object"||o===null?yd("Object expected"):(Kf(a=o.get)&&(j.get=a),Kf(a=o.set)&&(j.set=a),Kf(a=o.init)&&k.unshift(a));return m||nc(t,i),j&&nC(i,n,j),x?m^4?s:j:i},iC=(t,e,n)=>e.has(t)||yd("Cannot "+n),khe=(t,e)=>Object(e)!==e?yd('Cannot use the "in" operator on this value'):t.has(e),Mt=(t,e,n)=>(iC(t,e,"read from private field"),n?n.call(t):e.get(t)),Ft=(t,e,n)=>e.has(t)?yd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),tr=(t,e,n,r)=>(iC(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Wo=(t,e,n)=>(iC(t,e,"access private method"),n),nR={role:"button",roleDescription:"draggable"},Qhe="dnd-kit-description",Che="dnd-kit-announcement",jhe={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},Ehe={dragstart({operation:{source:t}}){if(t)return`Picked up draggable item ${t.id}.`},dragover({operation:{source:t,target:e}}){if(!(!t||t.id===(e==null?void 0:e.id)))return e?`Draggable item ${t.id} was moved over droppable target ${e.id}.`:`Draggable item ${t.id} is no longer over a droppable target.`},dragend({operation:{source:t,target:e},canceled:n}){if(t)return n?`Dragging was cancelled. Draggable item ${t.id} was dropped.`:e?`Draggable item ${t.id} was dropped over droppable target ${e.id}`:`Draggable item ${t.id} was dropped.`}};function $he(t){const e=t.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(e)}function Nhe(t,e){const n=document.createElement("div");return n.id=t,n.style.setProperty("display","none"),n.textContent=e,n}function The(t){const e=document.createElement("div");return e.id=t,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),e.style.setProperty("position","fixed"),e.style.setProperty("width","1px"),e.style.setProperty("height","1px"),e.style.setProperty("margin","-1px"),e.style.setProperty("border","0"),e.style.setProperty("padding","0"),e.style.setProperty("overflow","hidden"),e.style.setProperty("clip","rect(0 0 0 0)"),e.style.setProperty("clip-path","inset(100%)"),e.style.setProperty("white-space","nowrap"),e}var Phe=["dragover","dragmove"],_he=class extends Cr{constructor(t,e){super(t);const{id:n,idPrefix:{description:r=Qhe,announcement:i=Che}={},announcements:s=Ehe,screenReaderInstructions:a=jhe,debounce:o=500}=e??{},u=n?`${r}-${n}`:bk(r),d=n?`${i}-${n}`:bk(i);let h,m,g,x;const v=(R=x)=>{!g||!R||(g==null?void 0:g.nodeValue)!==R&&(g.nodeValue=R)},b=()=>Px.schedule(v),k=Ahe(b,o),w=Object.entries(s).map(([R,T])=>this.manager.monitor.addEventListener(R,(A,I)=>{const W=g;if(!W)return;const F=T==null?void 0:T(A,I);F&&W.nodeValue!==F&&(x=F,Phe.includes(R)?k():(b(),k.cancel()))})),j=()=>{let R=[];h!=null&&h.isConnected||(h=Nhe(u,a.draggable),R.push(h)),m!=null&&m.isConnected||(m=The(d),g=document.createTextNode(""),m.appendChild(g),R.push(m)),R.length>0&&document.body.append(...R)},Q=new Set;function E(){for(const R of Q)R()}this.registerEffect(()=>{var R;Q.clear();for(const T of this.manager.registry.draggables.value){const A=(R=T.handle)!=null?R:T.element;if(A){(!h||!m)&&Q.add(j),(!$he(A)||GQ())&&!A.hasAttribute("tabindex")&&Q.add(()=>A.setAttribute("tabindex","0")),!A.hasAttribute("role")&&A.tagName.toLowerCase()!=="button"&&Q.add(()=>A.setAttribute("role",nR.role)),A.hasAttribute("aria-roledescription")||Q.add(()=>A.setAttribute("aria-roledescription",nR.roleDescription)),A.hasAttribute("aria-describedby")||Q.add(()=>A.setAttribute("aria-describedby",u));for(const W of["aria-pressed","aria-grabbed"]){const F=String(T.isDragging);A.getAttribute(W)!==F&&Q.add(()=>A.setAttribute(W,F))}const I=String(T.disabled);A.getAttribute("aria-disabled")!==I&&Q.add(()=>A.setAttribute("aria-disabled",I))}}Q.size>0&&Px.schedule(E)}),this.destroy=()=>{super.destroy(),h==null||h.remove(),m==null||m.remove(),w.forEach(R=>R())}}};function Ahe(t,e){let n;const r=()=>{clearTimeout(n),n=setTimeout(t,e)};return r.cancel=()=>clearTimeout(n),r}var Rhe=class extends Cr{constructor(t,e){super(t,e),this.manager=t;const n=Cx(()=>{var r;return tc((r=this.manager.dragOperation.source)==null?void 0:r.element)});this.destroy=bi(()=>{var r;const{dragOperation:i}=this.manager,{cursor:s="grabbing",nonce:a}=(r=this.options)!=null?r:{};if(i.status.initialized){const o=n.value,u=o.createElement("style");return a&&u.setAttribute("nonce",a),u.textContent=`* { cursor: ${s} !important; }`,o.head.appendChild(u),()=>u.remove()}})}},Rx=new Map,TZ,PZ,_Z,AZ,wk,yh,da,sC,rd,RZ,MZ,zZ,DZ,rc=class extends(wk=Ip,AZ=[ft],_Z=[sn],PZ=[sn],TZ=[sn],wk){constructor(t){super(t),an(da,5,this),Ft(this,rd),Ft(this,yh,new Set),Ft(this,sC,an(da,8,this,new Set)),an(da,11,this),this.registerEffect(Wo(this,rd,RZ))}register(t){return Mt(this,yh).add(t),()=>{Mt(this,yh).delete(t)}}addRoot(t){return Nt(()=>{const e=new Set(this.additionalRoots);e.add(t),this.additionalRoots=e}),()=>{Nt(()=>{const e=new Set(this.additionalRoots);e.delete(t),this.additionalRoots=e})}}get sourceRoot(){var t;const{source:e}=this.manager.dragOperation;return $x((t=e==null?void 0:e.element)!=null?t:null)}get targetRoot(){var t;const{target:e}=this.manager.dragOperation;return $x((t=e==null?void 0:e.element)!=null?t:null)}get roots(){const{status:t}=this.manager.dragOperation;if(t.initializing||t.initialized){const e=[this.sourceRoot,this.targetRoot].filter(n=>n!=null);return new Set([...e,...this.additionalRoots])}return new Set}};da=bd(wk);yh=new WeakMap;sC=new WeakMap;rd=new WeakSet;RZ=function(){const{roots:t}=this,e=[];for(const n of t)for(const r of Mt(this,yh))e.push(Wo(this,rd,MZ).call(this,n,r));return()=>{for(const n of e)n()}};MZ=function(t,e){let n=Rx.get(t);n||(n=new Map,Rx.set(t,n));let r=n.get(e);if(!r){const s=HQ(t)?Wo(this,rd,zZ).call(this,t,n,e):Wo(this,rd,DZ).call(this,t,n,e);if(!s)return()=>{};r=s,n.set(e,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,r.refCount===0&&r.cleanup())}};zZ=function(t,e,n){const r=t.createElement("style");r.textContent=n,t.head.prepend(r);const i=new MutationObserver(s=>{for(const a of s)for(const o of Array.from(a.removedNodes))if(o===r){t.head.prepend(r);return}});return i.observe(t.head,{childList:!0}),{refCount:0,cleanup:()=>{i.disconnect(),r.remove(),e.delete(n),e.size===0&&Rx.delete(t)}}};DZ=function(t,e,n){"adoptedStyleSheets"in t&&Array.isArray(t.adoptedStyleSheets);const r=t.ownerDocument.defaultView,{CSSStyleSheet:i}=r??{};if(!i)return null;const s=new i;return s.replaceSync(n),t.adoptedStyleSheets.push(s),{refCount:0,cleanup:()=>{var a;if(FQ(t)&&((a=t.host)!=null&&a.isConnected)){const o=t.adoptedStyleSheets.indexOf(s);o!==-1&&t.adoptedStyleSheets.splice(o,1)}e.delete(n),e.size===0&&Rx.delete(t)}}};Yr(da,4,"additionalRoots",AZ,rc,sC);Yr(da,2,"sourceRoot",_Z,rc);Yr(da,2,"targetRoot",PZ,rc);Yr(da,2,"roots",TZ,rc);nc(da,rc);var Yp="data-dnd-",kk=`${Yp}dropping`,Bn="--dnd-",rs=`${Yp}dragging`,Mx=`${Yp}placeholder`,Mhe=[rs,Mx,"popover","aria-pressed","aria-grabbing"],zhe=["view-transition-name"],Dhe=`
443
+ :is(:root,:host) [${rs}] {
444
+ position: fixed !important;
445
+ pointer-events: none !important;
446
+ touch-action: none;
447
+ z-index: calc(infinity);
448
+ will-change: translate;
449
+ top: var(${Bn}top, 0px) !important;
450
+ left: var(${Bn}left, 0px) !important;
451
+ right: unset !important;
452
+ bottom: unset !important;
453
+ width: var(${Bn}width, auto);
454
+ max-width: var(${Bn}width, auto);
455
+ height: var(${Bn}height, auto);
456
+ max-height: var(${Bn}height, auto);
457
+ transition: var(${Bn}transition) !important;
458
+ }
459
+
460
+ :is(:root,:host) [${Mx}] {
461
+ transition: none;
462
+ }
463
+
464
+ :is(:root,:host) [${Mx}='hidden'] {
465
+ visibility: hidden;
466
+ }
467
+
468
+ [${rs}] * {
469
+ pointer-events: none !important;
470
+ }
471
+
472
+ [${rs}]:not([${kk}]) {
473
+ translate: var(${Bn}translate) !important;
474
+ }
475
+
476
+ [${rs}][style*='${Bn}scale'] {
477
+ scale: var(${Bn}scale) !important;
478
+ transform-origin: var(${Bn}transform-origin) !important;
479
+ }
480
+
481
+ @layer dnd-kit {
482
+ :where([${rs}][popover]) {
483
+ overflow: visible;
484
+ background: unset;
485
+ border: unset;
486
+ margin: unset;
487
+ padding: unset;
488
+ color: inherit;
489
+
490
+ &:is(input, button) {
491
+ border: revert;
492
+ background: revert;
493
+ }
494
+ }
495
+ }
496
+ [${rs}]::backdrop, [${Yp}overlay]:not([${rs}]) {
497
+ display: none;
498
+ visibility: hidden;
499
+ }
500
+ `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function Lhe(t,e="hidden"){return Nt(()=>{const{element:n,manager:r}=t;if(!n||!r)return;const i=Xhe(n,r.registry.droppables),s=[],a=Nfe(n),{remove:o}=a;return Zhe(i,a,s),Ihe(a,e),a.remove=()=>{s.forEach(u=>u()),o.call(a)},a})}function Xhe(t,e){const n=new Map;for(const r of e)if(r.element&&(t===r.element||t.contains(r.element))){const i=`${Yp}${bk("dom-id")}`;r.element.setAttribute(i,""),n.set(r,i)}return n}function Zhe(t,e,n){for(const[r,i]of t){if(!r.element)continue;const s=`[${i}]`,a=e.matches(s)?e:e.querySelector(s);if(r.element.removeAttribute(i),!a)continue;const o=r.element;r.proxy=a,a.removeAttribute(i),FA.set(o,a),n.push(()=>{FA.delete(o),r.proxy=void 0})}}function Ihe(t,e="hidden"){t.setAttribute("inert","true"),t.setAttribute("tab-index","-1"),t.setAttribute("aria-hidden","true"),t.setAttribute(Mx,e)}function LZ(t,e){return t===e?!0:td(t)===td(e)}function rR(t){const{target:e}=t;"newState"in t&&t.newState==="closed"&&Uo(e)&&e.hasAttribute("popover")&&requestAnimationFrame(()=>rp(e))}function Qk(t){return t.tagName==="TR"}function Bhe(t,e,n){const r=new MutationObserver(i=>{let s=!1;for(const a of i){if(a.target!==t){s=!0;continue}if(a.type!=="attributes")continue;const o=a.attributeName;if(o.startsWith("aria-")||Mhe.includes(o))continue;const u=t.getAttribute(o);if(o==="style"){if(vh(t)&&vh(e)){const d=t.style;for(const h of Array.from(e.style))d.getPropertyValue(h)===""&&e.style.removeProperty(h);for(const h of Array.from(d)){if(zhe.includes(h)||h.startsWith(Bn))continue;const m=d.getPropertyValue(h);e.style.setProperty(h,m)}}}else u!==null?e.setAttribute(o,u):e.removeAttribute(o)}s&&n&&(e.innerHTML=t.innerHTML)});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function qhe(t,e,n){const r=new MutationObserver(i=>{for(const s of i)if(s.addedNodes.length!==0)for(const a of Array.from(s.addedNodes)){if(a.contains(t)&&t.nextElementSibling!==e){t.insertAdjacentElement("afterend",e),rp(n);return}if(a.contains(e)&&e.previousElementSibling!==t){e.insertAdjacentElement("beforebegin",t),rp(n);return}}});return r.observe(t.ownerDocument.body,{childList:!0,subtree:!0}),r}function Vhe(t){return new ResizeObserver(()=>{var e,n;const r=new ua(t.placeholder,{frameTransform:t.frameTransform,ignoreTransforms:!0}),i=(e=t.transformOrigin)!=null?e:{x:1,y:1},s=(t.width-r.width)*i.x+t.delta.x,a=(t.height-r.height)*i.y+t.delta.y,o=gZ();if(t.styles.set({width:r.width-t.widthOffset,height:r.height-t.heightOffset,top:t.top+a+o.y,left:t.left+s+o.x},Bn),(n=t.getElementMutationObserver())==null||n.takeRecords(),Qk(t.element)&&Qk(t.placeholder)){const u=Array.from(t.element.cells),d=Array.from(t.placeholder.cells);t.getSavedCellWidths()||t.setSavedCellWidths(u.map(h=>h.style.width));for(const[h,m]of u.entries()){const g=d[h];m.style.width=`${g.getBoundingClientRect().width}px`}}t.dragOperation.shape=new ua(t.feedbackElement)})}var Yhe=250,Uhe="ease";function Whe(t){var e,n,r,i;const{animation:s}=t;if(typeof s=="function"){const j=s({element:t.element,feedbackElement:t.feedbackElement,placeholder:t.placeholder,translate:t.translate,moved:t.moved});Promise.resolve(j).then(()=>{t.cleanup(),requestAnimationFrame(t.restoreFocus)});return}const{duration:a=Yhe,easing:o=Uhe}=s??{};rp(t.feedbackElement);const[,u]=(e=Cfe(t.feedbackElement,j=>"translate"in j))!=null?e:[];u==null||u.pause();const d=(n=t.placeholder)!=null?n:t.element,h={frameTransform:LZ(t.feedbackElement,d)?null:void 0},m=new ua(t.feedbackElement,h),g=(r=JQ(wa(t.feedbackElement).translate))!=null?r:t.translate,x=new ua(d,h),v=Xp.delta(m,x,t.alignment),b={x:g.x-v.x,y:g.y-v.y},k=Math.round(m.intrinsicHeight)!==Math.round(x.intrinsicHeight)?{minHeight:[`${m.intrinsicHeight}px`,`${x.intrinsicHeight}px`],maxHeight:[`${m.intrinsicHeight}px`,`${x.intrinsicHeight}px`]}:{},w=Math.round(m.intrinsicWidth)!==Math.round(x.intrinsicWidth)?{minWidth:[`${m.intrinsicWidth}px`,`${x.intrinsicWidth}px`],maxWidth:[`${m.intrinsicWidth}px`,`${x.intrinsicWidth}px`]}:{};t.styles.set({transition:t.transition},Bn),t.feedbackElement.setAttribute(kk,""),(i=t.getElementMutationObserver())==null||i.takeRecords(),ahe({element:t.feedbackElement,keyframes:rC(ip(ip({},k),w),{translate:[`${g.x}px ${g.y}px 0`,`${b.x}px ${b.y}px 0`]}),options:{duration:OZ(Si(t.feedbackElement))?0:t.moved||t.feedbackElement!==t.element?a:0,easing:o}}).then(()=>{t.feedbackElement.removeAttribute(kk),u==null||u.finish(),t.cleanup(),requestAnimationFrame(t.restoreFocus)})}var XZ,Ck,sp,aC,PO,ZZ,IZ,ap=class extends(Ck=Cr,XZ=[ft],Ck){constructor(e,n){super(e,n),Ft(this,PO),Ft(this,aC,an(sp,8,this)),an(sp,11,this),this.state={initial:{},current:{}};const r=e.registry.plugins.get(rc),i=r==null?void 0:r.register(Dhe);if(i){const s=this.destroy.bind(this);this.destroy=()=>{i(),s()}}this.registerEffect(Wo(this,PO,ZZ).bind(this,r)),this.registerEffect(Wo(this,PO,IZ))}};sp=bd(Ck);aC=new WeakMap;PO=new WeakSet;ZZ=function(t){const{overlay:e}=this;if(!e||!t)return;const n=$x(e);if(n)return t.addRoot(n)};IZ=function(){var t,e,n;const{state:r,manager:i,options:s}=this,{dragOperation:a}=i,{position:o,source:u,status:d}=a;if(d.idle){r.current={},r.initial={};return}if(!u)return;const{element:h,feedback:m}=u;if(!h||m==="none"||!d.initialized||d.initializing)return;const{initial:g}=r,x=(t=this.overlay)!=null?t:h,v=nd(x),b=nd(h),k=!LZ(h,x),w=new ua(h,{frameTransform:k?b:null,ignoreTransforms:!k}),j={x:b.scaleX/v.scaleX,y:b.scaleY/v.scaleY};let{width:Q,height:E,top:R,left:T}=w;k&&(Q=Q/j.x,E=E/j.y);const A=new fhe(x),{transition:I,translate:W,boxSizing:F,paddingBlockStart:Z,paddingBlockEnd:B,paddingInlineStart:H,paddingInlineEnd:P,borderInlineStartWidth:D,borderInlineEndWidth:_,borderBlockStartWidth:X,borderBlockEndWidth:Y}=wa(h),V=m==="clone",$=F==="content-box",z=$?parseInt(H)+parseInt(P)+parseInt(D)+parseInt(_):0,q=$?parseInt(Z)+parseInt(B)+parseInt(X)+parseInt(Y):0,M=m!=="move"&&!this.overlay?Lhe(u,V?"clone":"hidden"):null,G=Nt(()=>tC(i.dragOperation.activatorEvent));if(W!=="none"){const Ve=JQ(W);Ve&&!g.translate&&(g.translate=Ve)}if(!g.transformOrigin){const Ve=Nt(()=>o.current);g.transformOrigin={x:(Ve.x-T*v.scaleX-v.x)/(Q*v.scaleX),y:(Ve.y-R*v.scaleY-v.y)/(E*v.scaleY)}}const{transformOrigin:ie}=g,J=R*v.scaleY+v.y,ne=T*v.scaleX+v.x;if(!g.coordinates&&(g.coordinates={x:ne,y:J},j.x!==1||j.y!==1)){const{scaleX:Ve,scaleY:ht}=b,{x:kt,y:Qt}=ie;g.coordinates.x+=(Q*Ve-Q)*kt,g.coordinates.y+=(E*ht-E)*Qt}g.dimensions||(g.dimensions={width:Q,height:E}),g.frameTransform||(g.frameTransform=v);const se={x:g.coordinates.x-ne,y:g.coordinates.y-J},pe={width:(g.dimensions.width*g.frameTransform.scaleX-Q*v.scaleX)*ie.x,height:(g.dimensions.height*g.frameTransform.scaleY-E*v.scaleY)*ie.y},ye={x:se.x/v.scaleX+pe.width,y:se.y/v.scaleY+pe.height},be={left:T+ye.x,top:R+ye.y};x.setAttribute(rs,"true");const Se=Nt(()=>a.transform),ke=(e=g.translate)!=null?e:{x:0,y:0},_e=Se.x*v.scaleX+ke.x,We=Se.y*v.scaleY+ke.y,De=gZ();A.set({width:Q-z,height:E-q,top:be.top+De.y,left:be.left+De.x,translate:`${_e}px ${We}px 0`,transition:I?`${I}, translate 0ms linear`:"",scale:k?`${j.x} ${j.y}`:"","transform-origin":`${ie.x*100}% ${ie.y*100}%`},Bn),M&&(h.insertAdjacentElement("afterend",M),s!=null&&s.rootElement&&(typeof s.rootElement=="function"?s.rootElement(u):s.rootElement).appendChild(h)),vk(x)&&(x.hasAttribute("popover")||x.setAttribute("popover","manual"),rp(x),x.addEventListener("beforetoggle",rR));let yt,Cn,Jt;const jn=Vhe({placeholder:M,element:h,feedbackElement:x,frameTransform:v,transformOrigin:ie,width:Q,height:E,top:R,left:T,widthOffset:z,heightOffset:q,delta:ye,styles:A,dragOperation:a,getElementMutationObserver:()=>yt,getSavedCellWidths:()=>Jt,setSavedCellWidths:Ve=>{Jt=Ve}}),ar=new ua(x);Nt(()=>a.shape=ar);const Er=Si(x),Ur=Ve=>{this.manager.actions.stop({event:Ve})},en=OZ(Er);G&&Er.addEventListener("resize",Ur),Nt(()=>u.status)==="idle"&&requestAnimationFrame(()=>u.status="dragging"),M&&(jn.observe(M),yt=Bhe(h,M,V),Cn=qhe(h,M,x));const wi=(n=i.dragOperation.source)==null?void 0:n.id,ue=()=>{var Ve;if(!G||wi==null)return;const ht=i.registry.draggables.get(wi),kt=(Ve=ht==null?void 0:ht.handle)!=null?Ve:ht==null?void 0:ht.element;Yo(kt)&&kt.focus()},ge=()=>{var Ve;if(yt==null||yt.disconnect(),Cn==null||Cn.disconnect(),jn.disconnect(),Er.removeEventListener("resize",Ur),vk(x)&&(x.removeEventListener("beforetoggle",rR),x.removeAttribute("popover")),x.removeAttribute(rs),A.reset(),Jt&&Qk(h)){const kt=Array.from(h.cells);for(const[Qt,qt]of kt.entries())qt.style.width=(Ve=Jt[Qt])!=null?Ve:""}u.status="idle";const ht=r.current.translate!=null;M&&(ht||M.parentElement!==x.parentElement)&&x.isConnected&&M.replaceWith(x),M==null||M.remove()},Pe=s==null?void 0:s.dropAnimation,Ie=this,Ke=Lp(()=>{var Ve;const{transform:ht,status:kt}=a;if(!(!ht.x&&!ht.y&&!r.current.translate)&&kt.dragging){const Qt=(Ve=g.translate)!=null?Ve:{x:0,y:0},qt={x:ht.x/v.scaleX+Qt.x,y:ht.y/v.scaleY+Qt.y},ot=r.current.translate,Wr=Nt(()=>a.modifiers),En=Nt(()=>{var Hr;return(Hr=a.shape)==null?void 0:Hr.current}),wd=G&&!en?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(A.set({transition:`${I}, translate ${wd}`,translate:`${qt.x}px ${qt.y}px 0`},Bn),yt==null||yt.takeRecords(),En&&En!==ar&&ot&&!Wr.length){const Hr=fs.delta(qt,ot);a.shape=Xp.from(En.boundingRectangle).translate(Hr.x*v.scaleX,Hr.y*v.scaleY)}else a.shape=new ua(x);r.current.translate=qt}},function(){if(a.status.dropped){this.dispose(),u.status="dropping";const Ve=Ie.dropAnimation!==void 0?Ie.dropAnimation:Pe;let ht=r.current.translate;const kt=ht!=null;if(!ht&&h!==x&&(ht={x:0,y:0}),!ht||Ve===null){ge();return}i.renderer.rendering.then(()=>{Whe({element:h,feedbackElement:x,placeholder:M,translate:ht,moved:kt,transition:I,alignment:u.alignment,styles:A,animation:Ve??void 0,getElementMutationObserver:()=>yt,cleanup:ge,restoreFocus:ue})})}});return()=>{ge(),Ke()}};Yr(sp,4,"overlay",XZ,ap,aC);nc(sp,ap);ap.configure=CQ(ap);var Hhe=ap,Rf=!0,Ghe=!1,BZ,qZ,VZ,YZ,yl,lC,oC;YZ=(VZ=[ft],fi.Forward),qZ=(BZ=[ft],fi.Reverse);var lp=class{constructor(){Ft(this,lC,an(yl,8,this,Rf)),an(yl,11,this),Ft(this,oC,an(yl,12,this,Rf)),an(yl,15,this)}isLocked(t){return t===fi.Idle?!1:t==null?this[fi.Forward]===Rf&&this[fi.Reverse]===Rf:this[t]===Rf}unlock(t){t!==fi.Idle&&(this[t]=Ghe)}};yl=bd(null);lC=new WeakMap;oC=new WeakMap;Yr(yl,4,YZ,VZ,lp,lC);Yr(yl,4,qZ,BZ,lp,oC);nc(yl,lp);var Fhe=[fi.Forward,fi.Reverse],iR=class{constructor(){this.x=new lp,this.y=new lp}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},Khe=class extends Cr{constructor(t){super(t);const e=Dp(new iR);let n=null;this.signal=e,bi(()=>{const{status:r}=t.dragOperation;if(!r.initialized){n=null,e.value=new iR;return}const{delta:i}=t.dragOperation.position;if(n){const s={x:sR(i.x,n.x),y:sR(i.y,n.y)},a=e.peek();Vo(()=>{for(const o of wX)for(const u of Fhe)s[o]===u&&a[o].unlock(u);e.value=a})}n=i})}get current(){return this.signal.peek()}};function sR(t,e){return Math.sign(t-e)}var UZ,jk,op,cC,sl,Ek,Cv=class extends(jk=Ip,UZ=[ft],jk){constructor(t){super(t),Ft(this,cC,an(op,8,this,!1)),an(op,11,this),Ft(this,sl),Ft(this,Ek,()=>{if(!Mt(this,sl))return;const{element:s,by:a}=Mt(this,sl);a.y&&(s.scrollTop+=a.y),a.x&&(s.scrollLeft+=a.x)}),this.scroll=s=>{var a;if(this.disabled)return!1;const o=this.getScrollableElements();if(!o)return tr(this,sl,void 0),!1;const{position:u}=this.manager.dragOperation,d=u==null?void 0:u.current;if(d){const{by:h}=s??{},m=h?{x:aR(h.x),y:aR(h.y)}:void 0,g=m?void 0:this.scrollIntentTracker.current;if(g!=null&&g.isLocked())return!1;for(const x of o){const v=Bfe(x,h);if(v.x||v.y){const{speed:b,direction:k}=the(x,d,m);if(g)for(const w of wX)g[w].isLocked(k[w])&&(b[w]=0,k[w]=0);if(k.x||k.y){const{x:w,y:j}=h??k,Q=w*b.x,E=j*b.y;if(Q||E){const R=(a=Mt(this,sl))==null?void 0:a.by;if(this.autoScrolling&&R&&(R.x&&!Q||R.y&&!E))continue;return tr(this,sl,{element:x,by:{x:Q,y:E}}),Px.schedule(Mt(this,Ek)),!0}}}}}return tr(this,sl,void 0),!1};let e=null,n=null;const r=Cx(()=>{const{position:s,source:a}=t.dragOperation;if(!s)return null;const o=xZ($x(a==null?void 0:a.element),s.current);return o&&(e=o),o??e}),i=Cx(()=>{const s=r.value,{documentElement:a}=tc(s);if(!s||s===a){const{target:o}=t.dragOperation,u=o==null?void 0:o.element;if(u){const d=yk(u,{excludeElement:!1});return n=d,d}}if(s){const o=yk(s,{excludeElement:!1});return this.autoScrolling&&n&&o.size<(n==null?void 0:n.size)?n:(n=o,o)}return n=null,null},Ku);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new Khe(t),this.destroy=t.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!tC(t.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};op=bd(jk);cC=new WeakMap;sl=new WeakMap;Ek=new WeakMap;Yr(op,4,"autoScrolling",UZ,Cv,cC);nc(op,Cv);function aR(t){return t>0?fi.Forward:t<0?fi.Reverse:fi.Idle}var Jhe=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const r of e)r();for(const r of n)r()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}},epe=new Jhe(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),tpe=10,WZ=class extends Cr{constructor(t,e){super(t);const n=t.registry.plugins.get(Cv);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=bi(()=>{if(this.disabled)return;const{position:r,status:i}=t.dragOperation;if(i.dragging)if(n.scroll()){n.autoScrolling=!0;const a=setInterval(()=>epe.schedule(n.scroll),tpe);return()=>{clearInterval(a)}}else n.autoScrolling=!1})}},lR={capture:!0,passive:!0},Jf,npe=class extends Ip{constructor(t){super(t),Ft(this,Jf),this.handleScroll=()=>{Mt(this,Jf)==null&&tr(this,Jf,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),tr(this,Jf,void 0)},50))};const{dragOperation:e}=this.manager;this.destroy=bi(()=>{var n,r,i;if(e.status.dragging){const a=(i=(r=(n=e.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?i:document;return a.addEventListener("scroll",this.handleScroll,lR),()=>{a.removeEventListener("scroll",this.handleScroll,lR)}}})}};Jf=new WeakMap;var rpe=class extends Cr{constructor(t,e){super(t,e),this.manager=t,this.destroy=bi(()=>{var n;const{dragOperation:r}=this.manager,{nonce:i}=(n=this.options)!=null?n:{};if(r.status.initialized){const s=document.createElement("style");return i&&s.setAttribute("nonce",i),s.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(s),g1(),document.addEventListener("selectionchange",g1,{capture:!0}),()=>{document.removeEventListener("selectionchange",g1,{capture:!0}),s.remove()}}})}};function g1(){var t;(t=document.getSelection())==null||t.removeAllRanges()}var eh=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(t,e){var n;const r=(n=e.handle)!=null?n:e.element;return t.target!==r}}),Jc,zx=class extends Ju{constructor(e,n){super(e),this.manager=e,this.options=n,Ft(this,Jc,[]),this.listeners=new vZ,this.handleSourceKeyDown=(r,i,s)=>{if(this.disabled||r.defaultPrevented||!Uo(r.target)||i.disabled)return;const{keyboardCodes:a=eh.keyboardCodes,preventActivation:o=eh.preventActivation}=s??{};a.start.includes(r.code)&&this.manager.dragOperation.status.idle&&(o!=null&&o(r,i)||this.handleStart(r,i,s))}}bind(e,n=this.options){return bi(()=>{var i;const s=(i=e.handle)!=null?i:e.element,a=o=>{tC(o)&&this.handleSourceKeyDown(o,e,n)};if(s)return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}})}handleStart(e,n,r){const{element:i}=n;if(!i)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),rhe(i);const{center:s}=new ua(i);if(this.manager.actions.start({event:e,coordinates:{x:s.x,y:s.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const o=tc(i),u=[this.listeners.bind(o,[{type:"keydown",listener:d=>this.handleKeyDown(d,n,r),options:{capture:!0}}])];Mt(this,Jc).push(...u)}handleKeyDown(e,n,r){const{keyboardCodes:i=eh.keyboardCodes}=r??{};if(Yc(e,[...i.end,...i.cancel])){e.preventDefault();const s=Yc(e,i.cancel);this.handleEnd(e,s);return}Yc(e,i.up)?this.handleMove("up",e):Yc(e,i.down)&&this.handleMove("down",e),Yc(e,i.left)?this.handleMove("left",e):Yc(e,i.right)&&this.handleMove("right",e)}handleEnd(e,n){this.manager.actions.stop({event:e,canceled:n}),this.cleanup()}handleMove(e,n){var r,i;const{shape:s}=this.manager.dragOperation,a=n.shiftKey?5:1;let o={x:0,y:0},u=(i=(r=this.options)==null?void 0:r.offset)!=null?i:eh.offset;if(typeof u=="number"&&(u={x:u,y:u}),!!s){switch(e){case"up":o={x:0,y:-u.y*a};break;case"down":o={x:0,y:u.y*a};break;case"left":o={x:-u.x*a,y:0};break;case"right":o={x:u.x*a,y:0};break}(o.x||o.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:o}))}}sideEffects(){const e=this.manager.registry.plugins.get(WZ);(e==null?void 0:e.disabled)===!1&&(e.disable(),Mt(this,Jc).push(()=>{e.enable()}))}cleanup(){Mt(this,Jc).forEach(e=>e()),tr(this,Jc,[])}destroy(){this.cleanup(),this.listeners.clear()}};Jc=new WeakMap;zx.configure=CQ(zx);zx.defaults=eh;var ipe=zx;function Yc(t,e){return e.includes(t.code)}var oo,spe=class extends nZ{constructor(){super(...arguments),Ft(this,oo)}onEvent(t){switch(t.type){case"pointerdown":tr(this,oo,ed(t));break;case"pointermove":if(!Mt(this,oo))return;const{x:e,y:n}=ed(t),r={x:e-Mt(this,oo).x,y:n-Mt(this,oo).y},{tolerance:i}=this.options;if(i&&hk(r,i)){this.abort();return}hk(r,this.options.value)&&this.activate(t);break;case"pointerup":this.abort();break}}abort(){tr(this,oo,void 0)}};oo=new WeakMap;var eu,co,ape=class extends nZ{constructor(){super(...arguments),Ft(this,eu),Ft(this,co)}onEvent(t){switch(t.type){case"pointerdown":tr(this,co,ed(t)),tr(this,eu,setTimeout(()=>this.activate(t),this.options.value));break;case"pointermove":if(!Mt(this,co))return;const{x:e,y:n}=ed(t),r={x:e-Mt(this,co).x,y:n-Mt(this,co).y};hk(r,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){Mt(this,eu)&&(clearTimeout(Mt(this,eu)),tr(this,co,void 0),tr(this,eu,void 0))}};eu=new WeakMap;co=new WeakMap;var au=class{};au.Delay=ape;au.Distance=spe;var $k=Object.freeze({activationConstraints(t,e){var n;const{pointerType:r,target:i}=t;if(!(r==="mouse"&&Uo(i)&&(e.handle===i||(n=e.handle)!=null&&n.contains(i))))return r==="touch"?[new au.Delay({value:250,tolerance:5})]:phe(i)&&!t.defaultPrevented?[new au.Delay({value:200,tolerance:0})]:[new au.Delay({value:200,tolerance:10}),new au.Distance({value:5})]},preventActivation(t,e){var n;const{target:r}=t;return r===e.element||r===e.handle||!Uo(r)||(n=e.handle)!=null&&n.contains(r)?!1:Pfe(r)}}),tu,Dx=class extends Ju{constructor(e,n){super(e),this.manager=e,this.options=n,Ft(this,tu,new Set),this.listeners=new vZ,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:r,coordinates:i}=this.latest;!r||!i||this.manager.actions.move({event:r,to:i})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,n,r=this.options){const{activationConstraints:i=$k.activationConstraints}=r??{};return typeof i=="function"?i(e,n):i}bind(e,n=this.options){return bi(()=>{var i;const s=new AbortController,{signal:a}=s,o=d=>{hhe(d)&&this.handlePointerDown(d,e,n)};let u=[(i=e.handle)!=null?i:e.element];n!=null&&n.activatorElements&&(Array.isArray(n.activatorElements)?u=n.activatorElements:u=n.activatorElements(e));for(const d of u)d&&(upe(d.ownerDocument.defaultView),d.addEventListener("pointerdown",o,{signal:a}));return()=>s.abort()})}handlePointerDown(e,n,r){if(this.disabled||!e.isPrimary||e.button!==0||!Uo(e.target)||n.disabled||ope(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:i=$k.preventActivation}=r??{};if(i!=null&&i(e,n))return;const{target:s}=e,a=Yo(s)&&s.draggable&&s.getAttribute("draggable")==="true",o=nd(n.element),{x:u,y:d}=ed(e);this.initialCoordinates={x:u*o.scaleX+o.x,y:d*o.scaleY+o.y};const h=this.activationConstraints(e,n,r);e.sensor=this;const m=new Sfe(h,b=>this.handleStart(n,b));m.signal.onabort=()=>this.handleCancel(e),m.onEvent(e),this.controller=m;const g=Ok(),x=this.listeners.bind(g,[{type:"pointermove",listener:b=>this.handlePointerMove(b,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:a?this.handleCancel:rO,options:{capture:!0}}]),v=()=>{x(),this.initialCoordinates=void 0};Mt(this,tu).add(v)}handlePointerMove(e,n){var r,i;if(((r=this.controller)==null?void 0:r.activated)===!1){(i=this.controller)==null||i.onEvent(e);return}if(this.manager.dragOperation.status.dragging){const s=ed(e),a=nd(n.element);s.x=s.x*a.scaleX+a.x,s.y=s.y*a.scaleY+a.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=s,Px.schedule(this.handleMove)}}handlePointerUp(e){const{status:n}=this.manager.dragOperation;if(!n.idle){e.preventDefault(),e.stopPropagation();const r=!n.initialized;this.manager.actions.stop({event:e,canceled:r})}this.cleanup()}handleKeyDown(e){e.key==="Escape"&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,n){const{manager:r,initialCoordinates:i}=this;if(!i||!r.dragOperation.status.idle||n.defaultPrevented)return;if(r.actions.start({coordinates:i,event:n,source:e}).signal.aborted)return this.cleanup();n.preventDefault();const o=tc(n.target).body;o.setPointerCapture(n.pointerId);const u=Uo(n.target)?[n.target,o]:o,d=this.listeners.bind(u,[{type:"touchmove",listener:rO,options:{passive:!1}},{type:"click",listener:rO},{type:"contextmenu",listener:rO},{type:"keydown",listener:this.handleKeyDown}]);Mt(this,tu).add(d)}handleCancel(e){const{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},Mt(this,tu).forEach(e=>e()),Mt(this,tu).clear()}destroy(){this.cleanup(),this.listeners.clear()}};tu=new WeakMap;Dx.configure=CQ(Dx);Dx.defaults=$k;var lpe=Dx;function ope(t){return"sensor"in t}function rO(t){t.preventDefault()}function cpe(){}var oR=new WeakSet;function upe(t){!t||oR.has(t)||(t.addEventListener("touchmove",cpe,{capture:!1,passive:!1}),oR.add(t))}var Ou={modifiers:[],plugins:[_he,WZ,Rhe,Hhe,rpe],sensors:[lpe,ipe]},HZ=class extends Qfe{constructor(t={}){const e=ca(t.plugins,Ou.plugins),n=ca(t.sensors,Ou.sensors),r=ca(t.modifiers,Ou.modifiers);super(rC(ip({},t),{plugins:[npe,Cv,rc,...e],sensors:n,modifiers:r}))}},GZ,FZ,KZ,Nk,Ni,uC,dC,fC,Up=class extends(Nk=ws,KZ=[ft],FZ=[ft],GZ=[ft],Nk){constructor(t,e){var n=t,{element:r,effects:i=()=>[],handle:s,feedback:a="default"}=n,o=$Z(n,["element","effects","handle","feedback"]);super(ip({effects:()=>[...i(),()=>{var u,d;const{manager:h}=this;if(!h)return;const g=((d=(u=this.sensors)==null?void 0:u.map(jQ))!=null?d:[...h.sensors]).map(x=>{const v=x instanceof Ju?x:h.registry.register(x.plugin),b=x instanceof Ju?void 0:x.options;return v.bind(this,b)});return function(){g.forEach(v=>v())}}]},o),e),Ft(this,uC,an(Ni,8,this)),an(Ni,11,this),Ft(this,dC,an(Ni,12,this)),an(Ni,15,this),Ft(this,fC,an(Ni,16,this)),an(Ni,19,this),this.element=r,this.handle=s,this.feedback=a}};Ni=bd(Nk);uC=new WeakMap;dC=new WeakMap;fC=new WeakMap;Yr(Ni,4,"handle",KZ,Up,uC);Yr(Ni,4,"element",FZ,Up,dC);Yr(Ni,4,"feedback",GZ,Up,fC);nc(Ni,Up);var JZ,e6,Tk,bl,hC,O1,t6,n6,bh,pC,mC=class extends(Tk=ks,e6=[ft],JZ=[ft],Tk){constructor(t,e){var n=t,{element:r,effects:i=()=>[]}=n,s=$Z(n,["element","effects"]);const{collisionDetector:a=xhe}=s,o=d=>{const{manager:h,element:m}=this;if(!m||d===null){this.shape=void 0;return}if(!h)return;const g=new ua(m),x=Nt(()=>this.shape);return g&&(x!=null&&x.equals(g))?x:(this.shape=g,g)},u=Dp(!1);super(rC(ip({},s),{collisionDetector:a,effects:()=>[...i(),()=>{const{element:d,manager:h}=this;if(!h)return;const{dragOperation:m}=h,{source:g}=m;u.value=!!(g&&m.status.initialized&&d&&!this.disabled&&this.accepts(g))},()=>{const{element:d}=this;if(u.value&&d){const h=new Ife(d,o);return()=>{h.disconnect(),this.shape=void 0}}},()=>{var d;if((d=this.manager)!=null&&d.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),e),Ft(this,bh),Ft(this,hC,an(bl,8,this)),an(bl,11,this),Ft(this,pC,an(bl,12,this)),an(bl,15,this),this.element=r,this.refreshShape=()=>o()}set element(t){tr(this,bh,t,n6)}get element(){var t;return(t=this.proxy)!=null?t:Mt(this,bh,t6)}};bl=bd(Tk);hC=new WeakMap;bh=new WeakSet;pC=new WeakMap;O1=Yr(bl,20,"#element",e6,bh,hC),t6=O1.get,n6=O1.set;Yr(bl,4,"proxy",JZ,mC,pC);nc(bl,mC);function dpe(t){return t!=null&&typeof t=="object"&&"current"in t}function cp(t){var e;if(t!=null)return dpe(t)?(e=t.current)!=null?e:void 0:t}var fpe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Wp=fpe?C.useLayoutEffect:C.useEffect;function hpe(){const t=C.useState(0)[1];return C.useCallback(()=>{t(e=>e+1)},[t])}function r6(t,e){const n=C.useRef(new Map),r=hpe();return Wp(()=>{if(!t){n.current.clear();return}return bi(()=>{var i;let s=!1,a=!1;for(const o of n.current){const[u]=o,d=Nt(()=>o[1]),h=t[u];d!==h&&(s=!0,n.current.set(u,h),a=(i=e==null?void 0:e(u,d,h))!=null?i:!1)}s&&(a?bq.flushSync(r):r())})},[t]),C.useMemo(()=>t&&new Proxy(t,{get(i,s){const a=i[s];return n.current.set(s,a),a}}),[t])}function Uc(t){const e=C.useRef(t);return Wp(()=>{e.current=t},[t]),e}function Vn(t,e,n=C.useEffect,r=Object.is){const i=C.useRef(t);n(()=>{const s=i.current;r(t,s)||(i.current=t,e(t,s))},[e,t])}function Pk(t,e){const n=C.useRef(cp(t));Wp(()=>{const r=cp(t);r!==n.current&&(n.current=r,e(r))})}var ppe=Object.defineProperty,mpe=Object.defineProperties,gpe=Object.getOwnPropertyDescriptors,Lx=Object.getOwnPropertySymbols,i6=Object.prototype.hasOwnProperty,s6=Object.prototype.propertyIsEnumerable,cR=(t,e,n)=>e in t?ppe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,a6=(t,e)=>{for(var n in e||(e={}))i6.call(e,n)&&cR(t,n,e[n]);if(Lx)for(var n of Lx(e))s6.call(e,n)&&cR(t,n,e[n]);return t},l6=(t,e)=>mpe(t,gpe(e)),Ope=(t,e)=>{var n={};for(var r in t)i6.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Lx)for(var r of Lx(t))e.indexOf(r)<0&&s6.call(t,r)&&(n[r]=t[r]);return n},xpe=new HZ,o6=C.createContext(xpe),vpe=C.memo(C.forwardRef(({children:t},e)=>{const[n,r]=C.useState(0),i=C.useRef(null),s=C.useRef(null),a=C.useMemo(()=>({renderer:{get rendering(){var o;return(o=i.current)!=null?o:Promise.resolve()}},trackRendering(o){i.current||(i.current=new Promise(u=>{s.current=u})),C.startTransition(()=>{o(),r(u=>u+1)})}}),[]);return Wp(()=>{var o;(o=s.current)==null||o.call(s),i.current=null},[t,n]),C.useImperativeHandle(e,()=>a),null})),x1=[void 0,Ku];function ype(t){var e=t,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:s,onDragMove:a,onDragOver:o,onDragEnd:u}=e,d=Ope(e,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const h=C.useRef(null),{plugins:m,modifiers:g,sensors:x}=d,v=ca(m,Ou.plugins),b=ca(x,Ou.sensors),k=ca(g,Ou.modifiers),w=Uc(i),j=Uc(s),Q=Uc(o),E=Uc(a),R=Uc(u),T=Uc(r),A=bpe(()=>{var I;return(I=d.manager)!=null?I:new HZ(d)});return C.useEffect(()=>{if(!h.current)throw new Error("Renderer not found");const{renderer:I,trackRendering:W}=h.current,{monitor:F}=A;A.renderer=I;const Z=[F.addEventListener("beforedragstart",B=>{const H=w.current;H&&W(()=>H(B,A))}),F.addEventListener("dragstart",B=>{var H;return(H=j.current)==null?void 0:H.call(j,B,A)}),F.addEventListener("dragover",B=>{const H=Q.current;H&&W(()=>H(B,A))}),F.addEventListener("dragmove",B=>{const H=E.current;H&&W(()=>H(B,A))}),F.addEventListener("dragend",B=>{const H=R.current;H&&W(()=>H(B,A))}),F.addEventListener("collision",B=>{var H;return(H=T.current)==null?void 0:H.call(T,B,A)})];return()=>Z.forEach(B=>B())},[A]),Vn(v,()=>A&&(A.plugins=v),...x1),Vn(b,()=>A&&(A.sensors=b),...x1),Vn(k,()=>A&&(A.modifiers=k),...x1),p.jsxs(o6.Provider,{value:A,children:[p.jsx(vpe,{ref:h,children:n}),n]})}function bpe(t){const e=C.useRef(null);return e.current||(e.current=t()),C.useInsertionEffect(()=>()=>{var n;return(n=e.current)==null?void 0:n.destroy()},[]),e.current}function Spe(){return C.useContext(o6)}function c6(t){var e;const n=(e=Spe())!=null?e:void 0,[r]=C.useState(()=>t(n));return r.manager!==n&&(r.manager=n),Wp(r.register,[n,r]),r}function wpe(t){const{disabled:e,data:n,element:r,handle:i,id:s,modifiers:a,sensors:o}=t,u=c6(h=>new Up(l6(a6({},t),{register:!1,handle:cp(i),element:cp(r)}),h)),d=r6(u,kpe);return Vn(s,()=>u.id=s),Pk(i,h=>u.handle=h),Pk(r,h=>u.element=h),Vn(n,()=>n&&(u.data=n)),Vn(e,()=>u.disabled=e===!0),Vn(o,()=>u.sensors=o),Vn(a,()=>u.modifiers=a,void 0,Ku),Vn(t.feedback,()=>{var h;return u.feedback=(h=t.feedback)!=null?h:"default"}),Vn(t.alignment,()=>u.alignment=t.alignment),{draggable:d,get isDragging(){return d.isDragging},get isDropping(){return d.isDropping},get isDragSource(){return d.isDragSource},handleRef:C.useCallback(h=>{u.handle=h??void 0},[u]),ref:C.useCallback(h=>{var m,g;!h&&((m=u.element)!=null&&m.isConnected)&&!((g=u.manager)!=null&&g.dragOperation.status.idle)||(u.element=h??void 0)},[u])}}function kpe(t,e,n){return!!(t==="isDragSource"&&!n&&e)}var Qpe=Object.create,u6=Object.defineProperty,Cpe=Object.getOwnPropertyDescriptor,d6=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),jv=t=>{throw TypeError(t)},jpe=(t,e,n)=>e in t?u6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Epe=t=>{var e;return[,,,Qpe((e=t==null?void 0:t[d6("metadata")])!=null?e:null)]},f6=["class","method","getter","setter","accessor","field","value","get","set"],h6=t=>t!==void 0&&typeof t!="function"?jv("Function expected"):t,$pe=(t,e,n,r,i)=>({kind:f6[t],name:e,metadata:r,addInitializer:s=>n._?jv("Already initialized"):i.push(h6(s||null))}),Npe=(t,e)=>jpe(e,d6("metadata"),t[3]),Tpe=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)s[i].call(n);return r},p6=(t,e,n,r,i,s)=>{for(var a,o,u,d,h=e&7,m=!1,g=!1,x=2,v=f6[h+5],b=t[x]||(t[x]=[]),k=(i=i.prototype,Cpe(i,n)),w=r.length-1;w>=0;w--)u=$pe(h,n,o={},t[3],b),u.static=m,u.private=g,d=u.access={has:j=>n in j},d.get=j=>j[n],a=(0,r[w])(k[v],u),o._=1,h6(a)&&(k[v]=a);return k&&u6(i,n,k),i},m6=(t,e,n)=>e.has(t)||jv("Cannot "+n),Ppe=(t,e,n)=>(m6(t,e,"read from private field"),e.get(t)),_pe=(t,e,n)=>e.has(t)?jv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ape=(t,e,n,r)=>(m6(t,e,"write to private field"),e.set(t,n),n),mo=class _k{constructor(e,n){this.x=e,this.y=n}static delta(e,n){return new _k(e.x-n.x,e.y-n.y)}static distance(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}static equals(e,n){return e.x===n.x&&e.y===n.y}static from({x:e,y:n}){return new _k(e,n)}},g6,O6,Ak,_O,Hp,gC=class extends(Ak=Jo,O6=[sn],g6=[sn],Ak){constructor(t){const e=mo.from(t);super(e,(n,r)=>mo.equals(n,r)),Tpe(Hp,5,this),_pe(this,_O,0),this.velocity={x:0,y:0}}get delta(){return mo.delta(this.current,this.initial)}get direction(){const{current:t,previous:e}=this;if(!e)return null;const n={x:t.x-e.x,y:t.y-e.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(t){const{current:e}=this,n=mo.from(t),r={x:n.x-e.x,y:n.y-e.y},i=Date.now(),s=i-Ppe(this,_O),a=o=>Math.round(o/s*100);Vo(()=>{Ape(this,_O,i),this.velocity={x:a(r.x),y:a(r.y)},super.current=n})}reset(t=this.defaultValue){super.reset(mo.from(t)),this.velocity={x:0,y:0}}};Hp=Epe(Ak);_O=new WeakMap;p6(Hp,2,"delta",O6,gC);p6(Hp,2,"direction",g6,gC);Npe(Hp,gC);var x6=(t=>(t.Horizontal="x",t.Vertical="y",t))(x6||{});Object.values(x6);var Rpe=({dragOperation:t,droppable:e})=>{const n=t.position.current;if(!n)return null;const{id:r}=e;if(!e.shape)return null;if(e.shape.containsPoint(n)){const i=mo.distance(e.shape.center,n);return{id:r,value:1/i,type:qp.PointerIntersection,priority:Bp.High}}return null},Mpe=({dragOperation:t,droppable:e})=>{const{shape:n}=t;if(!e.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(e.shape);if(r){const{position:i}=t,s=mo.distance(e.shape.center,i.current),o=r/(n.current.area+e.shape.area-r)/s;return{id:e.id,value:o,type:qp.ShapeIntersection,priority:Bp.Normal}}return null},zpe=t=>{var e;return(e=Rpe(t))!=null?e:Mpe(t)};function Dpe(t){const{collisionDetector:e,data:n,disabled:r,element:i,id:s,accept:a,type:o}=t,u=c6(h=>new mC(l6(a6({},t),{register:!1,element:cp(i)}),h)),d=r6(u);return Vn(s,()=>u.id=s),Pk(i,h=>u.element=h),Vn(a,()=>u.accept=a,void 0,Ku),Vn(e,()=>u.collisionDetector=e??zpe),Vn(n,()=>n&&(u.data=n)),Vn(r,()=>u.disabled=r===!0),Vn(o,()=>u.type=o),{droppable:d,get isDropTarget(){return d.isDropTarget},ref:C.useCallback(h=>{var m,g;!h&&((m=u.element)!=null&&m.isConnected)&&!((g=u.manager)!=null&&g.dragOperation.status.idle)||(u.element=h??void 0)},[u])}}function v6(){return xa({queryKey:["skills"],queryFn:async()=>{const t=await fetch("/api/skills");if(!t.ok)throw new Error("Failed to fetch skills");return t.json()},staleTime:3e4})}function Lpe(t){return xa({queryKey:["skills",{id:t}],queryFn:async()=>{const e=await fetch(`/api/skills/${t}`);if(!e.ok)throw new Error(`Failed to fetch skill ${t}`);return e.json()},enabled:!!t})}function Xpe(t,e){const n=t.split(`
501
+ `),r=e.split(`
502
+ `),i=[],s=Math.max(n.length,r.length);for(let a=0;a<s;a++){const o=n[a],u=r[a];o===u?i.push({type:"unchanged",content:o??"",lineNumber:a+1}):(o!==void 0&&i.push({type:"removed",content:o,lineNumber:a+1}),u!==void 0&&i.push({type:"added",content:u,lineNumber:a+1}))}return i}function y6({original:t,modified:e,onConfirm:n,onCancel:r}){if(t===e)return p.jsx("div",{className:"p-8 text-center text-[var(--color-muted)]",children:p.jsx("p",{className:"text-sm",children:"No changes to save"})});const i=Xpe(t,e);return p.jsxs("div",{className:"flex flex-col h-full",children:[p.jsx("div",{className:"flex-1 overflow-auto font-[var(--font-mono)] text-sm",children:i.map((s,a)=>p.jsxs("div",{className:`px-4 py-0.5 ${s.type==="added"?"bg-green-950/30 text-green-400":s.type==="removed"?"bg-red-950/30 text-red-400":"text-[var(--color-text)]"}`,children:[p.jsx("span",{className:"inline-block w-6 text-right mr-3 text-[var(--color-muted)] select-none",children:s.type==="added"?"+":s.type==="removed"?"-":" "}),s.content]},a))}),(n||r)&&p.jsxs("div",{className:"flex justify-end gap-3 px-4 py-3 border-t border-[var(--color-border-subtle)]",children:[r&&p.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),n&&p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md bg-[var(--color-accent)] text-white font-bold hover:bg-[var(--color-accent-hover)] transition-colors",children:"Confirm Save"})]})]})}function Zpe({skill:t,onAdd:e}){const{ref:n,isDragging:r}=wpe({id:`available-${t.id}`,data:{skillName:t.name,skillId:t.id}});return p.jsxs("div",{ref:n,className:`w-full flex items-center gap-2 px-3 py-2 text-left rounded-md hover:bg-[var(--color-surface-raised)] transition-colors group cursor-grab active:cursor-grabbing ${r?"opacity-40":""}`,children:[p.jsx(V9,{size:14,className:"text-[var(--color-muted)] shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("p",{className:"text-sm font-bold truncate",children:t.name}),t.module&&p.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:t.module})]}),t.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate",children:t.description})]}),p.jsx("button",{onClick:i=>{i.stopPropagation(),e()},className:"text-[var(--color-success)] shrink-0 opacity-0 group-hover:opacity-100 transition-opacity hover:scale-110",title:"Add skill",children:p.jsx(ln,{size:14})})]})}function Ipe({children:t,isEmpty:e}){const{ref:n,isDropTarget:r}=Dpe({id:"assigned-skills-zone"});return p.jsxs("div",{ref:n,className:`flex-1 overflow-y-auto p-2 transition-colors ${r?"bg-[var(--color-accent)]/5 ring-2 ring-inset ring-[var(--color-accent)]/30 rounded-lg":""}`,children:[t,e&&!r&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-4",children:"No skills assigned"}),p.jsx("div",{className:`mt-2 py-3 border-2 border-dashed rounded-lg text-center transition-all ${r?"border-[var(--color-accent)] text-[var(--color-accent)]":"border-[var(--color-border-subtle)] text-[var(--color-muted)]"}`,children:p.jsx("p",{className:"text-xs",children:"Drop skills here to assign"})})]})}function Bpe({agentName:t,currentSkills:e,onSave:n,onClose:r}){const{data:i}=v6(),[s,a]=C.useState(e),[o,u]=C.useState(""),[d,h]=C.useState(!1),m=C.useMemo(()=>{if(!i)return[];const k=new Set(s);let w=i.filter(j=>!k.has(j.id)&&!k.has(j.name));if(o){const j=o.toLowerCase();w=w.filter(Q=>Q.name.toLowerCase().includes(j)||Q.description.toLowerCase().includes(j))}return w},[i,s,o]),g=C.useCallback(k=>{a(w=>w.includes(k)?w:[...w,k])},[]),x=C.useCallback(k=>{a(w=>w.filter(j=>j!==k))},[]),v=C.useCallback(k=>{var Q;const{source:w,target:j}=k.operation;(Q=w==null?void 0:w.data)!=null&&Q.skillName&&(j==null?void 0:j.id)==="assigned-skills-zone"&&g(w.data.skillName)},[g]),b=JSON.stringify(s)!==JSON.stringify(e);if(d){const k=e.join(`
503
+ `),w=s.join(`
504
+ `);return p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsx("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)]",children:p.jsxs("h2",{className:"text-lg font-bold",children:["Review Skill Changes: ",t]})}),p.jsx("div",{className:"flex-1 overflow-hidden",children:p.jsx(y6,{original:k,modified:w,onConfirm:()=>n(s),onCancel:()=>h(!1)})})]})}return p.jsx(ype,{onDragEnd:v,children:p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Assign Skills: ",t]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{onClick:()=>h(!0),disabled:!b,className:"px-3 py-1.5 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Review Changes"}),p.jsx("button",{onClick:r,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]})]}),p.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[p.jsxs("div",{className:"w-1/2 border-r border-[var(--color-border-subtle)] flex flex-col",children:[p.jsxs("div",{className:"p-4 border-b border-[var(--color-border-subtle)]",children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Available Skills"}),p.jsxs("div",{className:"relative",children:[p.jsx(Nl,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",placeholder:"Search skills...",value:o,onChange:k=>u(k.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)]"})]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[m.map(k=>p.jsx(Zpe,{skill:k,onAdd:()=>g(k.name)},k.id)),m.length===0&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-4",children:o?"No matching skills":"All skills assigned"})]})]}),p.jsxs("div",{className:"w-1/2 flex flex-col",children:[p.jsx("div",{className:"p-4 border-b border-[var(--color-border-subtle)]",children:p.jsxs("h3",{className:"text-sm font-bold",children:["Assigned Skills (",s.length,")"]})}),p.jsx(Ipe,{isEmpty:s.length===0,children:s.map(k=>p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-md hover:bg-[var(--color-surface-raised)] transition-colors group",children:[p.jsx("span",{className:"text-sm",children:k}),p.jsx("button",{onClick:()=>x(k),className:"text-[var(--color-error)] opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove skill",children:p.jsx(sV,{size:14})})]},k))})]})]})]})})}function qpe({agent:t,onClose:e,onSaved:n}){const r=Ho(),i=t.module==="bmm"||t.module==="core",[s,a]=C.useState(t.title||""),[o,u]=C.useState(t.role||""),[d,h]=C.useState(t.icon||""),[m,g]=C.useState(t.discussion),[x,v]=C.useState(new Set(t.skills)),[b,k]=C.useState([]),[w,j]=C.useState(""),[Q,E]=C.useState(null),[R,T]=C.useState(!1);C.useEffect(()=>{fetch("/api/skills").then(F=>F.json()).then(F=>k(F)).catch(()=>{})},[]);const A=b.filter(F=>{if(!w)return!0;const Z=w.toLowerCase();return F.name.toLowerCase().includes(Z)||F.description.toLowerCase().includes(Z)}),I=F=>{v(Z=>{const B=new Set(Z);return B.has(F)?B.delete(F):B.add(F),B})},W=async()=>{var F,Z;T(!0),E(null);try{const B=Array.from(x);if(B.length!==t.skills.length||B.some(X=>!t.skills.includes(X))){const X=await fetch(`/api/agents/${encodeURIComponent(t.id)}/skills`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({skills:B})});if(!X.ok){const Y=await X.json();throw new Error(((F=Y.error)==null?void 0:F.message)??"Failed to update skills")}}const P=X=>X.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),D=[`title: "${P(s)}"`,`role: "${P(o)}"`,d?`icon: "${P(d)}"`:null,`discussion: ${m}`].filter(X=>X!==null).join(`
505
+ `)+`
506
+ `,_=await fetch(`/api/agents/${encodeURIComponent(t.id)}/override`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:D})});if(!_.ok){const X=await _.json();throw new Error(((Z=X.error)==null?void 0:Z.message)??"Failed to save override")}await r.invalidateQueries({queryKey:["agents"]}),await r.invalidateQueries({queryKey:["agent",t.id]}),n()}catch(B){E(B instanceof Error?B.message:"Failed to save agent")}finally{T(!1)}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-bold",children:"Edit Agent"}),i&&p.jsx("p",{className:"text-xs text-[var(--color-warning)] mt-1",children:"Override mode — base file will not be modified"})]}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Title"}),p.jsx("input",{type:"text",value:s,onChange:F=>a(F.target.value),placeholder:"e.g. Project Manager",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Role"}),p.jsx("textarea",{value:o,onChange:F=>u(F.target.value),rows:2,placeholder:"Describe the agent's role...",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),p.jsx("input",{type:"text",value:d,onChange:F=>h(F.target.value),placeholder:"e.g. a single emoji",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("label",{className:"text-sm font-bold",children:"Discussion mode"}),p.jsx("button",{onClick:()=>g(!m),className:`relative w-10 h-5 rounded-full transition-colors ${m?"bg-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]"}`,children:p.jsx("span",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${m?"translate-x-5":"translate-x-0.5"}`})})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Skills (",x.size," assigned)"]}),p.jsxs("div",{className:"relative mb-2",children:[p.jsx(Nl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",value:w,onChange:F=>j(F.target.value),placeholder:"Search skills...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:A.length===0?p.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No skills found"}):A.map(F=>p.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[p.jsx("input",{type:"checkbox",checked:x.has(F.id),onChange:()=>I(F.id),className:"accent-[var(--color-accent)]"}),p.jsx("span",{className:"truncate font-bold",children:F.name}),p.jsx("span",{className:"text-xs text-[var(--color-muted)] truncate ml-auto",children:F.description})]},F.id))})]}),p.jsxs("div",{className:"text-xs text-[var(--color-muted)] space-y-1 pt-2 border-t border-[var(--color-border-subtle)]",children:[p.jsxs("p",{children:["ID: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.id})]}),p.jsxs("p",{children:["Module: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.module??"custom"})]}),p.jsxs("p",{children:["File: ",p.jsx("code",{className:"font-[var(--font-mono)] break-all",children:t.filePath})]})]}),Q&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:Q})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:W,disabled:R,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(jh,{size:14}),R?"Saving...":"Save Changes"]})]})]})]})}function Vpe(){const{id:t}=$5(),e=Oa(),{notify:n}=ad(),{data:r,isLoading:i,error:s}=KL(t??""),[a,o]=C.useState(!1),[u,d]=C.useState(null),[h,m]=C.useState(!1),[g,x]=C.useState(!1),[v,b]=C.useState(!1),{data:k}=oM(),{data:w}=JL(),j=(w??[]).filter(E=>E.agentIds.includes(t??"")||E.agentIds.includes((r==null?void 0:r.name)??""));function Q(){const E=!a;if(o(E),E&&r&&u===null){m(!0);const R=r.filePath.lastIndexOf("/_bmad/"),T=R>=0?r.filePath.slice(R+7):r.filePath;fetch(`/api/files/${T}`).then(A=>{if(!A.ok)throw new Error("Not found");return A.json()}).then(A=>{d(A.content)}).catch(()=>d("Failed to load source file.")).finally(()=>m(!1))}}return i?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"h-8 w-48 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-40 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):s||!r?p.jsxs("div",{children:[p.jsxs(nr,{to:"/agents",className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[p.jsx(zO,{size:16})," Back to Agents"]}),p.jsx("p",{className:"text-[var(--color-error)]",children:s?`Failed to load agent: ${s.message}`:"Agent not found"})]}):p.jsxs("div",{className:"max-w-3xl",children:[p.jsxs(nr,{to:"/agents",className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[p.jsx(zO,{size:16})," Back to Agents"]}),p.jsxs("div",{className:"mb-8",children:[p.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[r.icon?p.jsx("span",{className:"text-3xl leading-none",role:"img","aria-label":`${r.title||r.name} icon`,children:r.icon}):p.jsx("span",{className:"w-10 h-10 rounded-lg bg-[var(--color-accent)] text-white text-lg font-bold flex items-center justify-center shrink-0",children:r.name.charAt(0).toUpperCase()}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h1",{className:"text-2xl font-extrabold truncate",children:r.title||r.name}),r.title&&p.jsxs("p",{className:"text-sm text-[var(--color-muted)]",children:["(",r.name,")"]})]})]}),p.jsx("p",{className:"text-[var(--color-muted)] text-sm mb-4",children:r.role}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("button",{onClick:()=>b(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:[p.jsx(Nu,{size:14}),"Edit Agent"]}),p.jsxs("button",{onClick:()=>e(`/agents/${t}/override`),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:[p.jsx(Nu,{size:14}),"Edit Override"]}),p.jsxs("a",{href:`vscode://file${r.filePath}`,className:"inline-flex items-center gap-1.5 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors underline underline-offset-2",children:[p.jsx(Wk,{size:14}),"Open in IDE"]})]})]}),(r.identity||r.communicationStyle||r.principles)&&p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-3",children:"Persona"}),p.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-5 space-y-4",children:[r.identity&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Identity"}),p.jsx("p",{className:"text-sm text-[var(--color-text)]",children:r.identity})]}),r.communicationStyle&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Communication Style"}),p.jsxs("p",{className:"text-sm italic text-[var(--color-text)]",children:["“",r.communicationStyle,"”"]})]}),r.principles&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Principles"}),p.jsx("div",{className:"text-sm text-[var(--color-text)] whitespace-pre-line",children:r.principles})]})]})]}),p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-3",children:"Details"}),p.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[p.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx("span",{className:"text-[var(--color-muted)]",children:"Module"}),p.jsx("p",{className:"font-bold",children:r.module??"Unknown"})]}),p.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx("span",{className:"text-[var(--color-muted)]",children:"Discussion Mode"}),p.jsx("p",{className:"font-bold",children:r.discussion?"Enabled":"Disabled"})]})]})]}),p.jsxs("section",{className:"mb-8",children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Skills (",r.skills.length,")"]}),p.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[p.jsx(ln,{size:14}),"Assign"]})]}),r.skills.length>0?p.jsx("div",{className:"flex flex-wrap gap-2",children:r.skills.map(E=>p.jsx("button",{onClick:()=>e("/skills"),className:"px-3 py-1 text-xs rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:text-[var(--color-accent)] transition-colors cursor-pointer",children:E},E))}):p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No skills assigned"})]}),g&&p.jsxs("div",{className:"fixed inset-0 z-40 flex",children:[p.jsx("div",{className:"flex-1 bg-black/40",onClick:()=>x(!1)}),p.jsx("div",{className:"w-[700px] bg-[var(--color-bg)] border-l border-[var(--color-border-subtle)] shadow-xl",children:p.jsx(Bpe,{agentName:r.name,currentSkills:r.skills,onSave:async E=>{try{(await fetch(`/api/agents/${t}/skills`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({skills:E})})).ok?(n("success",`Updated skills for ${r.name}`),x(!1)):n("error","Failed to update skills")}catch{n("error","Failed to update skills")}},onClose:()=>x(!1)})})]}),r.menu.length>0&&p.jsxs("section",{className:"mb-8",children:[p.jsxs("h2",{className:"text-lg font-bold mb-3",children:["Commands (",r.menu.length,")"]}),p.jsx("div",{className:"space-y-2",children:r.menu.map(E=>p.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsxs("div",{children:[p.jsx("span",{className:"font-bold text-sm font-[var(--font-mono)]",children:E.trigger}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-0.5",children:E.input})]}),E.route&&p.jsx("span",{className:"text-xs text-[var(--color-muted)] font-[var(--font-mono)]",children:E.route})]},E.trigger))})]}),p.jsxs("section",{className:"mb-8",children:[p.jsxs("h2",{className:"text-lg font-bold mb-3",children:["Teams (",j.length,")"]}),j.length>0?p.jsx("div",{className:"space-y-2",children:j.map(E=>p.jsxs("button",{onClick:()=>e("/teams"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[E.icon?p.jsx("span",{className:"text-sm leading-none",role:"img","aria-label":`${E.name} icon`,children:E.icon}):p.jsx(hi,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:E.name})]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[E.memberCount," members"]})]},E.id))}):p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"This agent is not part of any team"})]}),k&&k.length>0&&r&&p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-3",children:"Workflow Participation"}),(()=>{const E=r.name.toLowerCase(),R=r.id.toLowerCase(),T=k.filter(A=>{const I=A.name.toLowerCase();return I.includes(R)||I.includes(E)});return T.length===0?p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"This agent is not directly referenced in any workflow names. Agents may still be invoked via workflow steps."}):p.jsx("div",{className:"space-y-2",children:T.map(A=>p.jsxs("button",{onClick:()=>e("/workflows"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Mi,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm font-bold",children:A.name})]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[A.stepCount," steps"]})]},A.id))})})()]}),p.jsxs("section",{children:[p.jsxs("button",{onClick:Q,className:"flex items-center gap-2 text-lg font-bold mb-3 hover:text-[var(--color-accent)] transition-colors",children:[a?p.jsx(ra,{size:18}):p.jsx(ia,{size:18}),"Source"]}),a&&p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-96",children:h?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(mi,{content:u??"",filePath:r.filePath,onChange:()=>{},readOnly:!0})})]}),v&&r&&p.jsx(qpe,{agent:r,onClose:()=>b(!1),onSaved:()=>{b(!1)}})]})}function Ype(){const{id:t}=$5(),{data:e}=KL(t??""),{notify:n}=ad(),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState(!1),[d,h]=C.useState(!1),[m,g]=C.useState(!1);C.useEffect(()=>{if(e&&!d){const v=`_config/agents/${e.id}.customize.yaml`;fetch(`/api/files/${v}`).then(b=>{if(!b.ok)throw new Error("Not found");return b.json()}).then(b=>{const k=b;i(k.content),a(k.content)}).catch(()=>{const b=`# Override customizations for ${e.name}
507
+ # Add custom instructions, modify behavior, or extend capabilities
508
+
509
+ `;i(b),a("")}).finally(()=>h(!0))}},[e,d]);async function x(){if(e){g(!0);try{const v=`_config/agents/${e.id}.customize.yaml`;(await fetch(`/api/files/${v}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})})).ok?(a(r),u(!1),n("success",`Override saved for ${e.name}`)):n("error","Failed to save override")}catch{n("error","Failed to save override")}finally{g(!1)}}}return e?o?p.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[p.jsxs("h1",{className:"text-2xl font-extrabold mb-4",children:["Override Changes: ",e.name]}),m&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-2",children:"Saving..."}),p.jsx(y6,{original:s,modified:r,onConfirm:x,onCancel:()=>u(!1)})]}):p.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs(nr,{to:`/agents/${t}`,className:"flex items-center gap-1 text-sm text-[var(--color-muted)] hover:text-[var(--color-text)]",children:[p.jsx(zO,{size:16})," Back"]}),p.jsxs("h1",{className:"text-xl font-extrabold",children:["Override: ",e.name]})]}),p.jsx("button",{onClick:()=>u(!0),disabled:r===s,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Review Changes"})]}),p.jsx(mi,{content:r,filePath:`_bmad/_config/agents/${e.id}.customize.yaml`,onChange:i,onSave:()=>u(!0)})]}):p.jsxs("div",{children:[p.jsxs(nr,{to:`/agents/${t}`,className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[p.jsx(zO,{size:16})," Back to Agent"]}),p.jsx("p",{className:"text-[var(--color-muted)]",children:"Loading agent..."})]})}function uR(t){const e=t.split(`
510
+ `).filter(s=>s.trim());if(e.length===0)return{headers:[],rows:[]};const n=s=>{const a=[];let o="",u=!1;for(let d=0;d<s.length;d++){const h=s[d];h==='"'?u&&s[d+1]==='"'?(o+='"',d++):u=!u:h===","&&!u?(a.push(o.trim()),o=""):o+=h}return a.push(o.trim()),a},r=n(e[0]),i=e.slice(1).map(n);return{headers:r,rows:i}}function v1(t,e){const n=r=>r.includes(",")||r.includes('"')||r.includes(`
511
+ `)?`"${r.replace(/"/g,'""')}"`:r;return[t,...e].map(r=>r.map(n).join(",")).join(`
512
+ `)}function Xx({content:t,editable:e,onChange:n}){const[r,i]=C.useState(null),[s,a]=C.useState(!0),{headers:o,rows:u}=C.useMemo(()=>uR(t),[t]),[d,h]=C.useState(()=>uR(t).rows),m=C.useMemo(()=>r===null?u:[...u].sort((k,w)=>{const j=k[r]??"",Q=w[r]??"";return s?j.localeCompare(Q):Q.localeCompare(j)}),[u,r,s]),g=k=>{r===k?a(!s):(i(k),a(!0))},x=(k,w,j)=>{const Q=d.map((E,R)=>R===k?E.map((T,A)=>A===w?j:T):E);h(Q),n==null||n(v1(o,Q))},v=k=>{const w=d.filter((j,Q)=>Q!==k);h(w),n==null||n(v1(o,w))},b=()=>{const k=Array(o.length).fill(""),w=[...d,k];h(w),n==null||n(v1(o,w))};return o.length===0?p.jsx("div",{className:"p-4 text-sm text-[var(--color-muted)]",children:"Empty or unparseable CSV content."}):e?p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.jsx("div",{className:"overflow-auto flex-1",children:p.jsxs("table",{className:"w-full text-sm border-collapse",children:[p.jsx("thead",{className:"sticky top-0 z-10",children:p.jsxs("tr",{className:"bg-[var(--color-surface-raised)]",children:[p.jsx("th",{className:"w-6 px-1 py-2 border-b border-[var(--color-border-subtle)]"}),o.map((k,w)=>p.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider text-[var(--color-muted)] border-b border-[var(--color-border-subtle)] whitespace-nowrap",children:k},w))]})}),p.jsx("tbody",{children:d.map((k,w)=>p.jsxs("tr",{className:w%2===0?"bg-[var(--color-bg)]":"bg-[var(--color-surface-raised)]",children:[p.jsx("td",{className:"px-1 py-1 border-b border-[var(--color-border-subtle)]",children:p.jsx("button",{onClick:()=>v(w),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] transition-colors","aria-label":`Delete row ${w+1}`,children:p.jsx(Qn,{size:12})})}),o.map((j,Q)=>p.jsx("td",{className:"px-1 py-1 border-b border-[var(--color-border-subtle)]",children:p.jsx("input",{value:k[Q]??"",onChange:E=>x(w,Q,E.target.value),className:"w-full px-2 py-1 text-sm bg-transparent border border-transparent focus:border-[var(--color-accent)] rounded outline-none"})},Q))]},w))})]})}),p.jsxs("div",{className:"px-3 py-2 border-t border-[var(--color-border-subtle)] flex items-center gap-3",children:[p.jsxs("button",{onClick:b,className:"flex items-center gap-1 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[p.jsx(ln,{size:12}),"Add Row"]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[d.length," rows × ",o.length," columns"]})]})]}):p.jsxs("div",{className:"overflow-auto h-full",children:[p.jsxs("table",{className:"w-full text-sm border-collapse",children:[p.jsx("thead",{className:"sticky top-0 z-10",children:p.jsx("tr",{className:"bg-[var(--color-surface-raised)]",children:o.map((k,w)=>p.jsxs("th",{onClick:()=>g(w),className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider text-[var(--color-muted)] border-b border-[var(--color-border-subtle)] cursor-pointer hover:text-[var(--color-text)] select-none whitespace-nowrap",children:[k,r===w&&p.jsx("span",{className:"ml-1",children:s?"↑":"↓"})]},w))})}),p.jsx("tbody",{children:m.map((k,w)=>p.jsx("tr",{className:w%2===0?"bg-[var(--color-bg)]":"bg-[var(--color-surface-raised)]",children:o.map((j,Q)=>p.jsx("td",{className:"px-3 py-2 border-b border-[var(--color-border-subtle)] whitespace-nowrap max-w-xs truncate",title:k[Q]??"",children:k[Q]??""},Q))},w))})]}),p.jsxs("div",{className:"px-3 py-2 text-xs text-[var(--color-muted)] border-t border-[var(--color-border-subtle)]",children:[u.length," rows × ",o.length," columns"]})]})}function Upe({teamId:t,teamName:e,onClose:n,onDeleted:r}){const[i,s]=C.useState(""),[a,o]=C.useState(null),[u,d]=C.useState(!1),h=i===e,m=async()=>{var g;if(h){d(!0),o(null);try{const x=await fetch(`/api/teams/${t}`,{method:"DELETE"});if(!x.ok){const v=await x.json();throw new Error(((g=v.error)==null?void 0:g.message)??"Failed to delete team")}r()}catch(x){o(x instanceof Error?x.message:"Failed to delete team")}finally{d(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),p.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"delete-team-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx(Tu,{size:20,className:"text-[var(--color-error)]"}),p.jsx("h2",{id:"delete-team-title",className:"text-lg font-bold",children:"Delete Team"})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("p",{className:"text-sm",children:["This will permanently delete the ",p.jsx("strong",{children:e})," team YAML file. The party CSV will be preserved."]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm mb-1",children:["Type ",p.jsx("strong",{children:e})," to confirm:"]}),p.jsx("input",{type:"text",value:i,onChange:g=>s(g.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-error)] focus:outline-none"})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:m,disabled:!h||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-error)] text-white hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ld,{size:14}),u?"Deleting...":"Delete Team"]})]})]})]})}function Wpe({teamId:t,onClose:e,onTeamUpdated:n}){const r=Oa(),i=Ho(),{notify:s}=ad(),{data:a,isLoading:o}=Pde(t),{data:u}=_de(t),[d,h]=C.useState(!1),[m,g]=C.useState(!1),[x,v]=C.useState(!1),[b,k]=C.useState(""),[w,j]=C.useState(""),[Q,E]=C.useState(""),[R,T]=C.useState(new Set),[A,I]=C.useState(""),[W,F]=C.useState([]),[Z,B]=C.useState(!1),[H,P]=C.useState(!1),[D,_]=C.useState("");C.useEffect(()=>{x&&a&&(k(a.name),j(a.icon),E(a.description),T(new Set(a.agentIds)),fetch("/api/agents").then(G=>G.json()).then(G=>F(G)).catch(()=>{}))},[x,a]);const X=C.useMemo(()=>{if(!a)return[];const G=new Set(a.members.map(ie=>ie.agentId));return a.agentIds.filter(ie=>!G.has(ie))},[a]),Y=W.filter(G=>{if(!A)return!0;const ie=A.toLowerCase();return G.name.toLowerCase().includes(ie)||G.title.toLowerCase().includes(ie)||G.role&&G.role.toLowerCase().includes(ie)}),V=G=>{T(ie=>{const J=new Set(ie);return J.has(G)?J.delete(G):J.add(G),J})},$=async()=>{var G;if(a){B(!0);try{const ie=await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b.trim(),icon:w.trim(),description:Q.trim(),agentIds:Array.from(R)})});if(!ie.ok){const J=await ie.json();throw new Error(((G=J.error)==null?void 0:G.message)??"Failed to update team")}s("success",`Team "${b}" updated`),v(!1),await i.invalidateQueries({queryKey:["teams"]}),n==null||n()}catch(ie){s("error",ie instanceof Error?ie.message:"Failed to update team")}finally{B(!1)}}},z=()=>{if(!a)return;const G="name,displayName,title,icon,role,identity,communicationStyle,principles,module,path",ie=a.members.map(J=>{const ne=[J.agentId,J.displayName||J.agentId,J.title||"",J.icon||"",J.role||J.title||"",J.identity||"",J.communicationStyle||"collaborative",J.principles||"",J.module||a.module||"",""],se=pe=>pe.includes(",")||pe.includes('"')?`"${pe.replace(/"/g,'""')}"`:pe;return ne.map(se).join(",")});_([G,...ie].join(`
513
+ `))},q=async()=>{var G;if(a)try{const ie=await fetch(`/api/teams/${t}/party`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:D})});if(!ie.ok){const J=await ie.json();throw new Error(((G=J.error)==null?void 0:G.message)??"Failed to save party CSV")}s("success","Party CSV updated"),P(!1),await i.invalidateQueries({queryKey:["teams"]})}catch(ie){s("error",ie instanceof Error?ie.message:"Failed to save party CSV")}},M=async()=>{g(!1),await i.invalidateQueries({queryKey:["teams"]}),n==null||n(),e()};return p.jsxs("div",{className:"slide-over-backdrop",onClick:G=>{G.target===G.currentTarget&&e()},children:[p.jsx("div",{className:"slide-over-bg",onClick:e}),p.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[(a==null?void 0:a.icon)&&p.jsx("span",{className:"text-xl leading-none",role:"img","aria-label":`${a.name} icon`,children:a.icon}),p.jsx("h2",{className:"text-lg font-bold truncate",children:(a==null?void 0:a.name)??"Loading..."})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[a&&!x&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:()=>v(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Team",children:p.jsx(Nu,{size:16})}),p.jsx("button",{onClick:()=>g(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] transition-colors",title:"Delete Team",children:p.jsx(ld,{size:16})})]}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]})]}),o&&p.jsxs("div",{className:"p-6 space-y-3",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),a&&!x&&p.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:a.description}),a.module&&p.jsx("span",{className:"inline-block mt-2 text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:a.module})]}),p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Members (",a.members.length,")"]}),p.jsx("div",{className:"space-y-2",children:a.members.map(G=>p.jsxs("button",{onClick:()=>r(`/agents/${G.agentId}`),className:"w-full flex items-start gap-3 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[p.jsx("span",{className:"text-lg leading-none mt-0.5",role:"img","aria-label":`${G.displayName} icon`,children:G.icon}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-sm font-bold",children:G.displayName}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:G.title})]}),G.communicationStyle&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1 line-clamp-2",children:G.communicationStyle})]})]},G.agentId))})]}),X.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-2 flex items-center gap-1.5",children:[p.jsx(Tu,{size:14,className:"text-[var(--color-warning)]"}),"Unresolved Agents (",X.length,")"]}),p.jsx("div",{className:"space-y-1",children:X.map(G=>p.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-warning)]/30",children:[p.jsx(Tu,{size:12,className:"text-[var(--color-warning)]"}),p.jsx("span",{className:"text-sm font-[var(--font-mono)]",children:G}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"— not found in party CSV"})]},G))})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Party Mode"}),p.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(To,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:a.partyFile||"No party CSV"})]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[a.members.length," personas"]})]}),a.partyFile&&p.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[p.jsxs("button",{onClick:()=>h(!d),className:"flex items-center gap-1.5 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[d?p.jsx(ra,{size:12}):p.jsx(ia,{size:12}),d?"Hide":"View"," Party Personas"]}),d&&(u==null?void 0:u.content)&&!H&&p.jsxs("button",{onClick:()=>{_(u.content),P(!0)},className:"flex items-center gap-1.5 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[p.jsx(Nu,{size:10}),"Edit Party Personas"]})]})]}),d&&(u==null?void 0:u.content)&&!H&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-64",children:p.jsx(Xx,{content:u.content})}),d&&H&&p.jsxs("div",{className:"mt-2 space-y-2",children:[p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",style:{height:264},children:p.jsx(Xx,{content:D,editable:!0,onChange:G=>_(G)})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:q,className:"px-3 py-1.5 text-xs font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(jh,{size:12}),"Save Party CSV"]}),p.jsx("button",{onClick:()=>P(!1),className:"px-3 py-1.5 text-xs rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{onClick:z,className:"px-3 py-1.5 text-xs rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Generate from Agents"})]})]})]})]}),a&&x&&p.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:b,onChange:G=>k(G.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),p.jsx("input",{type:"text",value:w,onChange:G=>j(G.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:Q,onChange:G=>E(G.target.value),rows:3,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Agents (",R.size," selected)"]}),p.jsxs("div",{className:"relative mb-2",children:[p.jsx(Nl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",value:A,onChange:G=>I(G.target.value),placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:Y.length===0?p.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No agents found"}):Y.map(G=>p.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[p.jsx("input",{type:"checkbox",checked:R.has(G.id),onChange:()=>V(G.id),className:"accent-[var(--color-accent)]"}),p.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[G.icon&&p.jsx("span",{className:"text-sm leading-none","aria-hidden":"true",children:G.icon}),p.jsx("span",{className:"truncate font-bold",children:G.title||G.name})]})]},G.id))})]}),p.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[p.jsxs("button",{onClick:$,disabled:Z||!b.trim(),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(jh,{size:14}),Z?"Saving...":"Save Changes"]}),p.jsx("button",{onClick:()=>v(!1),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"})]})]})]}),m&&a&&p.jsx(Upe,{teamId:t,teamName:a.name,onClose:()=>g(!1),onDeleted:M})]})}function dR({onClose:t,onCreated:e}){const n=Ho(),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState(""),[d,h]=C.useState(""),[m,g]=C.useState(new Set),[x,v]=C.useState(""),[b,k]=C.useState(null),[w,j]=C.useState(!1),[Q,E]=C.useState([]),[R,T]=C.useState([]);C.useEffect(()=>{fetch("/api/modules").then(Z=>Z.json()).then(Z=>{const B=Z;E(B.map(H=>({name:H.name}))),B.length===1&&h(B[0].name)}).catch(()=>{}),fetch("/api/agents").then(Z=>Z.json()).then(Z=>T(Z)).catch(()=>{})},[]);const A=R.filter(Z=>{if(!x)return!0;const B=x.toLowerCase();return Z.name.toLowerCase().includes(B)||Z.title.toLowerCase().includes(B)||Z.role&&Z.role.toLowerCase().includes(B)}),I=r.trim().length>0&&d.length>0,W=async()=>{var Z;if(I){j(!0),k(null);try{const B=await fetch("/api/teams",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),icon:s.trim(),description:o.trim(),agentIds:Array.from(m),module:d})});if(!B.ok){const H=await B.json();throw new Error(((Z=H.error)==null?void 0:Z.message)??"Failed to create team")}await n.invalidateQueries({queryKey:["teams"]}),e()}catch(B){k(B instanceof Error?B.message:"Failed to create team")}finally{j(!1)}}},F=Z=>{g(B=>{const H=new Set(B);return H.has(Z)?H.delete(Z):H.add(Z),H})};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-team-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{id:"create-team-title",className:"text-lg font-bold",children:"Create Team"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:r,onChange:Z=>i(Z.target.value),placeholder:"e.g. Frontend Squad",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),p.jsx("input",{type:"text",value:s,onChange:Z=>a(Z.target.value),placeholder:"e.g. a single emoji",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:o,onChange:Z=>u(Z.target.value),placeholder:"What does this team do?",rows:3,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module"}),p.jsxs("select",{value:d,onChange:Z=>h(Z.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Select a module..."}),Q.map(Z=>p.jsx("option",{value:Z.name,children:Z.name},Z.name))]})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Agents (",m.size," selected)"]}),p.jsxs("div",{className:"relative mb-2",children:[p.jsx(Nl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",value:x,onChange:Z=>v(Z.target.value),placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:A.length===0?p.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No agents found"}):A.map(Z=>p.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[p.jsx("input",{type:"checkbox",checked:m.has(Z.id),onChange:()=>F(Z.id),className:"accent-[var(--color-accent)]"}),p.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[Z.icon&&p.jsx("span",{className:"text-sm leading-none",children:Z.icon}),p.jsx("span",{className:"truncate font-bold",children:Z.title||Z.name}),Z.title&&p.jsxs("span",{className:"text-xs text-[var(--color-muted)] truncate",children:["(",Z.name,")"]})]})]},Z.id))})]}),b&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:b})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:W,disabled:!I||w,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),w?"Creating...":"Create Team"]})]})]})]})}function Hpe({team:t,isSelected:e,onClick:n}){return p.jsxs("button",{onClick:n,className:`p-4 rounded-lg border text-left transition-all cursor-pointer hover:-translate-y-0.5 hover:shadow-md ${e?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.icon&&p.jsx("span",{className:"text-lg leading-none",role:"img","aria-label":`${t.name} icon`,children:t.icon}),p.jsx("span",{className:"font-bold text-sm truncate",children:t.name}),t.module&&p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:t.module})]}),t.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] line-clamp-2 mb-2",children:t.description}),t.agentIds&&t.agentIds.length>0&&p.jsxs("div",{className:"flex items-center gap-1 mb-2 flex-wrap",children:[t.agentIds.slice(0,8).map(r=>p.jsx("span",{title:r,className:"w-6 h-6 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-xs flex items-center justify-center font-bold text-[var(--color-muted)] uppercase shrink-0",children:r.charAt(0)},r)),t.agentIds.length>8&&p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["+",t.agentIds.length-8," more"]})]}),p.jsx("div",{className:"flex items-center justify-between",children:p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[p.jsx(hi,{size:10,className:"inline mr-1"}),t.memberCount," members"]})})]})}function Gpe(){const{data:t,isLoading:e,refetch:n}=JL(),[r,i]=qo("detail"),[s,a]=C.useState("all"),[o,u]=C.useState(""),[d,h]=C.useState(!1),m=C.useMemo(()=>{if(!t)return[];const v=new Set;for(const b of t)b.module&&v.add(b.module);return Array.from(v).sort()},[t]),g=C.useMemo(()=>{if(!t)return[];let v=t;if(s!=="all"&&(v=v.filter(b=>b.module===s)),o){const b=o.toLowerCase();v=v.filter(k=>k.name.toLowerCase().includes(b)||k.description.toLowerCase().includes(b))}return v},[t,s,o]),x=C.useMemo(()=>{if(!t)return{};const v={};for(const b of t)b.module&&(v[b.module]=(v[b.module]??0)+1);return v},[t]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Teams"}),p.jsx(yv,{count:3})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Teams"}),p.jsx(Xi,{icon:hi,title:"No teams found",description:"Teams group agents for collaborative workflows and Party Mode. Create a team to get started.",actions:p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"Create Team"]})}),d&&p.jsx(dR,{onClose:()=>h(!1),onCreated:()=>{h(!1),n()}})]}):p.jsxs("div",{children:[p.jsx(vv,{title:"Teams",count:t.length,modules:m,moduleCounts:x,activeModule:s,onModuleChange:a,search:o,onSearchChange:u,actions:p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"Create Team"]})}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:g.map(v=>p.jsx(Hpe,{team:v,isSelected:r===v.id,onClick:()=>i(r===v.id?null:v.id)},v.id))}),g.length===0&&t.length>0&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-8",children:"No teams match your search."}),r&&p.jsx(Wpe,{teamId:r,onClose:()=>i(null),onTeamUpdated:()=>n()}),d&&p.jsx(dR,{onClose:()=>h(!1),onCreated:()=>{h(!1),n()}})]})}function Ev({open:t,onClose:e,title:n,actions:r,children:i,width:s}){const a=C.useRef(null),o=C.useRef(null);C.useEffect(()=>{var d;t?(o.current=document.activeElement,requestAnimationFrame(()=>{var h;return(h=a.current)==null?void 0:h.focus()})):((d=o.current)==null||d.focus(),o.current=null)},[t]);const u=C.useCallback(d=>{if(d.key==="Escape"){e();return}if(d.key!=="Tab")return;const h=a.current;if(!h)return;const m=Array.from(h.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(v=>!v.closest('[aria-hidden="true"]'));if(m.length===0){d.preventDefault();return}const g=m[0],x=m[m.length-1];d.shiftKey?(document.activeElement===g||document.activeElement===h)&&(d.preventDefault(),x.focus()):document.activeElement===x&&(d.preventDefault(),g.focus())},[e]);return C.useEffect(()=>{if(t)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t,u]),t?p.jsxs("div",{className:"slide-over-backdrop",role:"presentation",children:[p.jsx("div",{className:"slide-over-bg",onClick:e}),p.jsxs("aside",{ref:a,role:"dialog","aria-modal":"true","aria-label":typeof n=="string"?n:void 0,tabIndex:-1,className:"slide-over-panel outline-none",style:{width:s??"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between shrink-0",children:[p.jsx("h2",{className:"text-lg font-bold truncate",children:n}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r,p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors","aria-label":"Close panel",children:p.jsx(Qn,{size:18})})]})]}),p.jsx("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:i})]})]}):null}function Fpe({path:t,className:e,showIcon:n}){return p.jsxs("span",{className:`inline-flex items-center gap-2 text-xs ${e??""}`,children:[n&&p.jsx(Wk,{size:12,className:"text-[var(--color-muted)] shrink-0"}),p.jsx(nr,{to:`/files?path=${encodeURIComponent(t)}`,className:"font-[var(--font-mono)] text-[var(--color-accent)] hover:underline break-all",children:t})]})}function Kpe(t){const e=[],n=/(?:in|from|see|follow)\s+(?:the\s+(?:instructions\s+in\s+)?)?[`"']?(\.\/[\w./-]+)[`"']?/gi;let r;for(;(r=n.exec(t))!==null;)e.push(r[1]);const i=/\.\/([\w-]+\.(?:md|yaml|yml|txt))/g;for(;(r=i.exec(t))!==null;){const a=`./${r[1]}`;e.includes(a)||e.push(a)}const s=e.map(a=>a.replace(/\.+$/,""));return[...new Set(s)]}function Jpe({reference:t,skillFilePath:e}){const[n,r]=C.useState(!1),[i,s]=C.useState(null),[a,o]=C.useState(!1),u=C.useCallback(async()=>{if(n){r(!1);return}if(r(!0),i===null){o(!0);try{const d=e.substring(0,e.lastIndexOf("/")),h=d.lastIndexOf("/_bmad/"),m=h>=0?d.slice(h+7):d,g=t.replace("./",""),x=m?`${m}/${g}`:g,v=await fetch(`/api/files/${x}`);if(v.ok){const b=await v.json();s(b.content)}else s("Could not load file.")}catch{s("Failed to load file.")}finally{o(!1)}}},[n,i,e,t]);return p.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden",children:[p.jsxs("button",{onClick:u,className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-[var(--color-surface-raised)] transition-colors",children:[n?p.jsx(ra,{size:14,className:"text-[var(--color-muted)]"}):p.jsx(ia,{size:14,className:"text-[var(--color-muted)]"}),p.jsx(To,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-xs font-[var(--font-mono)]",children:t})]}),n&&p.jsx("div",{className:"border-t border-[var(--color-border-subtle)] h-48",children:a?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(mi,{content:i??"",filePath:t,onChange:()=>{},readOnly:!0})})]})}function eme({skillId:t,onClose:e}){const{data:n,isLoading:r}=Lpe(t),i=(n==null?void 0:n.content)??"",s=C.useMemo(()=>i?Kpe(i):[],[i]);return p.jsxs(Ev,{open:!0,title:(n==null?void 0:n.name)??"Loading...",onClose:e,children:[r&&p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),n&&p.jsxs(p.Fragment,{children:[p.jsx("div",{children:p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:n.description})}),n.bestFor&&n.bestFor.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Best for"}),p.jsx("div",{className:"flex flex-wrap gap-1",children:n.bestFor.map(a=>p.jsx("span",{className:"px-2 py-0.5 text-xs rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:a},a))})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Content"}),p.jsx("div",{className:"h-64 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(mi,{content:n.content,filePath:n.filePath,onChange:()=>{},readOnly:!0})})]}),s.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Referenced Files"}),p.jsx("div",{className:"space-y-2",children:s.map(a=>p.jsx(Jpe,{reference:a,skillFilePath:n.filePath},a))})]}),p.jsx(Fpe,{path:n.filePath,showIcon:!0})]})]})}function fR(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function tme(t,e,n,r){const i=["---",`name: ${t}`];if(e&&i.push(`description: "${fR(e)}"`),n.length>0){i.push("best_for:");for(const s of n)i.push(` - "${fR(s.trim())}"`)}return i.push("---","",r||`# Skill Instructions
514
+
515
+ <!-- Add skill instructions here -->`),i.join(`
516
+ `)}const hR=/^[a-z][a-z0-9-]*$/;function nme({onClose:t,onCreated:e}){const n=Ho(),[r,i]=C.useState("create"),[s,a]=C.useState(""),[o,u]=C.useState(""),[d,h]=C.useState(""),[m,g]=C.useState(""),[x,v]=C.useState(""),[b,k]=C.useState(!1),[w,j]=C.useState(""),[Q,E]=C.useState([]),[R,T]=C.useState(null),[A,I]=C.useState(!1);C.useEffect(()=>{fetch("/api/modules").then(P=>P.json()).then(P=>{const D=P;E(D.map(_=>({name:_.name}))),D.length===1&&g(D[0].name)}).catch(()=>{})},[]);const W=s.length===0||hR.test(s),F=d.split(",").map(P=>P.trim()).filter(Boolean),Z=s.trim().length>0&&hR.test(s)&&m.length>0,B=C.useCallback(P=>{var X;const D=(X=P.target.files)==null?void 0:X[0];if(!D)return;const _=new FileReader;_.onload=()=>{const Y=_.result,V=Y.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(V){const $=V[1],z=V[2],q=$.match(/^name:\s*(.+)$/m),M=$.match(/^description:\s*"?(.+?)"?$/m),G=$.match(/^best_for:\s*\n((?:\s+-\s+.+\n?)*)/m);if(q&&a(q[1].trim()),M&&u(M[1].trim()),G){const ie=G[1].split(`
517
+ `).map(J=>J.replace(/^\s+-\s+/,"").trim()).filter(Boolean);h(ie.join(", "))}v(z.trim())}else v(Y);i("create")},_.readAsText(D)},[]),H=async()=>{var P;if(Z){I(!0),T(null);try{const D=tme(s.trim(),o.trim(),F,x),_=await fetch(`/api/modules/${encodeURIComponent(m)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"skill",name:s.trim(),content:D})});if(!_.ok){const X=await _.json();throw new Error(((P=X.error)==null?void 0:P.message)??"Failed to create skill")}await n.invalidateQueries({queryKey:["skills"]}),e()}catch(D){T(D instanceof Error?D.message:"Failed to create skill")}finally{I(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-skill-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{id:"create-skill-title",className:"text-lg font-bold",children:"New Skill"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"flex gap-1 mb-4 bg-[var(--color-surface-raised)] rounded-md p-0.5 self-start",children:[p.jsx("button",{onClick:()=>i("create"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${r==="create"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Create"}),p.jsx("button",{onClick:()=>i("import"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${r==="import"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Import"})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[r==="import"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Upload .md file"}),p.jsxs("label",{className:"flex items-center justify-center gap-2 w-full px-4 py-6 border-2 border-dashed border-[var(--color-border-subtle)] rounded-lg cursor-pointer hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(LO,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm text-[var(--color-muted)]",children:"Click to upload or drag a .md file"}),p.jsx("input",{type:"file",accept:".md",onChange:B,className:"hidden"})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Or paste URL"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{type:"text",value:w,onChange:P=>j(P.target.value),placeholder:"https://raw.githubusercontent.com/...",className:"flex-1 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),p.jsx("button",{onClick:async()=>{if(w){try{const P=new URL(w);if(P.protocol!=="https:"&&P.protocol!=="http:"){T("URL must start with http:// or https://");return}}catch{T("Invalid URL");return}try{const P=await fetch(w);if(P.ok){const D=await P.text(),_={target:{files:[new File([D],"import.md")]}};B(_)}}catch{T("Failed to fetch URL")}}},disabled:!w,className:"px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:"Fetch"})]})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Uploading or fetching will parse the file and switch to the Create tab with fields pre-populated."})]}),r==="create"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:s,onChange:P=>a(P.target.value),onBlur:()=>k(!0),placeholder:"e.g. advanced-elicitation",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),b&&!W&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Name must be kebab-case (e.g., my-skill-name)"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:o,onChange:P=>u(P.target.value),placeholder:"What does this skill enable?",rows:2,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Best for (optional)"}),p.jsx("input",{type:"text",value:d,onChange:P=>h(P.target.value),placeholder:"e.g. pm, analyst, architect (comma-separated)",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module"}),p.jsxs("select",{value:m,onChange:P=>g(P.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Select a module..."}),Q.map(P=>p.jsx("option",{value:P.name,children:P.name},P.name))]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Skill Content"}),p.jsx("div",{className:"h-48 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(mi,{content:x,filePath:"new-skill.md",onChange:v,defaultMode:"edit"})})]})]}),R&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:R})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:H,disabled:!Z||A,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),A?"Creating...":"Create Skill"]})]})]})]})}function rme(){const{data:t,isLoading:e,refetch:n}=v6(),[r,i]=C.useState(""),[s,a]=qo("detail"),[o,u]=C.useState("all"),[d,h]=C.useState(!1),m=C.useMemo(()=>{if(!t)return[];const v=new Set;for(const b of t)b.module&&v.add(b.module);return Array.from(v).sort()},[t]),g=C.useMemo(()=>{if(!t)return[];let v=t;if(o!=="all"&&(v=v.filter(b=>b.module===o)),r){const b=r.toLowerCase();v=v.filter(k=>k.name.toLowerCase().includes(b)||k.description.toLowerCase().includes(b))}return v},[t,r,o]),x=C.useMemo(()=>{if(!t)return{};const v={};for(const b of t)b.module&&(v[b.module]=(v[b.module]??0)+1);return v},[t]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Skills"}),p.jsx($de,{count:4})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Skills"}),p.jsx(Xi,{icon:sa,title:"No skills found",description:"Install a module or import skills to get started."})]}):p.jsxs("div",{children:[p.jsxs("div",{children:[p.jsx(vv,{title:"Skills",count:t.length,modules:m,moduleCounts:x,activeModule:o,onModuleChange:u,search:r,onSearchChange:i,actions:p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"New Skill"]})}),p.jsx("div",{className:"space-y-3",children:g.map(v=>p.jsxs("button",{onClick:()=>a(v.id),className:`w-full text-left p-4 rounded-lg flex items-center justify-between transition-colors ${s===v.id?"bg-[var(--color-surface-raised)] border border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(sa,{size:16,className:"text-[var(--color-accent)] shrink-0"}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:v.name}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate max-w-md",children:v.description})]})]}),v.module&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:v.module})]},v.id))})]}),s&&p.jsx(eme,{skillId:s,onClose:()=>a(null)}),d&&p.jsx(nme,{onClose:()=>h(!1),onCreated:()=>{h(!1),n()}})]})}function ime(t){const e={};for(const n of t){if(n.name.startsWith("."))continue;const r=n.path.split("/"),i=r.length>1?r.slice(0,-1).join("/"):"root";e[i]||(e[i]=[]),e[i].push(n)}return e}function sme({folder:t,files:e,selectedPath:n,onSelect:r}){const[i,s]=C.useState(!0),a=t==="root"?"Root":t.split("/").pop()??t;return p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>s(!i),className:"flex items-center gap-2 px-3 py-2 w-full text-left hover:bg-[var(--color-surface-raised)] rounded-md transition-colors",children:[i?p.jsx(ra,{size:14,className:"text-[var(--color-muted)]"}):p.jsx(ia,{size:14,className:"text-[var(--color-muted)]"}),p.jsx(eM,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:a}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",e.length,")"]})]}),i&&p.jsx("div",{className:"ml-4 space-y-0.5",children:e.map(o=>p.jsxs("button",{onClick:()=>r(o.path),className:`w-full flex items-center justify-between px-3 py-2 rounded-md transition-colors cursor-pointer text-left ${n===o.path?"bg-[var(--color-surface-raised)] text-[var(--color-accent)]":"hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(qx,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:o.name})]}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:new Date(o.modifiedAt).toLocaleDateString()})]},o.path))})]})}function ame(){const[t,e]=C.useState([]),[n,r]=C.useState(!0),[i,s]=qo("path"),[a,o]=C.useState(""),[u,d]=C.useState(!1);C.useEffect(()=>{fetch("/api/outputs").then(x=>x.json()).then(x=>{e(x),r(!1)}).catch(()=>r(!1))},[]);const h=C.useMemo(()=>ime(t),[t]),m=C.useMemo(()=>Object.values(h).reduce((x,v)=>x+v.length,0),[h]),g=C.useCallback(async x=>{if(i===x){s(null);return}s(x),d(!0);try{const v=await fetch(`/api/outputs/${x}`);if(v.ok){const b=await v.json();o(b.content)}}catch{o("Failed to load file content.")}finally{d(!1)}},[i]);return n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Outputs"}),p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):m===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Outputs"}),p.jsx(Xi,{icon:qx,title:"No outputs yet",description:"Run workflows to generate output files."})]}):p.jsxs("div",{children:[p.jsxs("h1",{className:"text-2xl font-extrabold mb-8",children:["Outputs (",m,")"]}),p.jsx("div",{className:"space-y-2",children:Object.entries(h).sort(([x],[v])=>x.localeCompare(v)).map(([x,v])=>p.jsx(sme,{folder:x,files:v,selectedPath:i,onSelect:g},x))}),p.jsx(Ev,{open:!!i,title:i??"",onClose:()=>s(null),children:u?p.jsx("div",{className:"h-64 rounded bg-[var(--color-surface-raised)] animate-pulse"}):i!=null&&i.endsWith(".csv")?p.jsx(Xx,{content:a}):p.jsx("div",{className:"h-96 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(mi,{content:a,filePath:i??"",onChange:()=>{},readOnly:!0})})})]})}const b6={jira:To,confluence:B9,figma:N9,github:tM,custom:K5},AO={jira:"Jira",confluence:"Confluence",figma:"Figma",github:"GitHub",custom:"Custom"},lme={jira:{cliTool:"jira-cli",parameters:{project:"",board:""},outputPath:"_bmad-output/data/jira/"},confluence:{cliTool:"confluence-cli",parameters:{space:"",label:""},outputPath:"_bmad-output/data/confluence/"},figma:{cliTool:"figma-export",parameters:{fileKey:"",nodeId:""},outputPath:"_bmad-output/data/figma/"},github:{cliTool:"gh",parameters:{repo:"",query:""},outputPath:"_bmad-output/data/github/"},custom:{cliTool:"",parameters:{},outputPath:"_bmad-output/data/"}},pR={configured:"var(--color-accent)",synced:"var(--color-success)",error:"var(--color-error)","not-configured":"var(--color-muted)"};function ome({onClose:t,onCreated:e}){const[n,r]=C.useState("type"),[i,s]=C.useState(null),[a,o]=C.useState(""),[u,d]=C.useState(""),[h,m]=C.useState({}),[g,x]=C.useState(""),[v,b]=C.useState(""),[k,w]=C.useState(null),[j,Q]=C.useState(!1);function E(A){s(A);const I=lme[A];d(I.cliTool),m({...I.parameters}),b(I.outputPath),r("form")}const R=a.trim().length>0&&u.trim().length>0,T=async()=>{var A;if(!(!R||!i)){Q(!0),w(null);try{const I=await fetch("/api/datasources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a.trim(),type:i,cliTool:u.trim(),parameters:h,outputPath:v.trim()})});if(!I.ok){const W=await I.json();throw new Error(((A=W.error)==null?void 0:A.message)??"Failed to create data source")}e()}catch(I){w(I instanceof Error?I.message:"Failed to create data source")}finally{Q(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:n==="type"?"Add Data Source":`New ${AO[i]} Source`}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),n==="type"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-4",children:"Choose a data source type:"}),Object.keys(AO).map(A=>{const I=b6[A];return p.jsxs("button",{onClick:()=>E(A),className:"w-full flex items-center gap-3 p-3 rounded-lg border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:p.jsx(I,{size:16,className:"text-[var(--color-accent)]"})}),p.jsxs("div",{children:[p.jsx("span",{className:"font-bold text-sm",children:AO[A]}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[A==="jira"&&"Import issues and boards from Jira",A==="confluence"&&"Import pages and spaces from Confluence",A==="figma"&&"Export designs from Figma",A==="github"&&"Pull data from GitHub repositories",A==="custom"&&"Configure a custom CLI tool"]})]})]},A)})]}),n==="form"&&i&&p.jsxs("div",{className:"space-y-4",children:[p.jsx("button",{onClick:()=>r("type"),className:"text-xs text-[var(--color-accent)] hover:underline",children:"← Change type"}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:a,onChange:A=>o(A.target.value),placeholder:"e.g. My Project Board",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"CLI Tool"}),p.jsx("input",{type:"text",value:u,onChange:A=>d(A.target.value),placeholder:"e.g. jira-cli",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),Object.entries(h).map(([A,I])=>p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1 capitalize",children:A}),p.jsx("input",{type:"text",value:I,onChange:W=>m({...h,[A]:W.target.value}),placeholder:`Enter ${A}...`,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]},A)),i==="custom"&&p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("input",{type:"text",value:g,onChange:A=>x(A.target.value),onKeyDown:A=>{A.key==="Enter"&&g.trim()&&(m({...h,[g.trim()]:""}),x(""))},placeholder:"Parameter name",className:"flex-1 px-2 py-1 text-xs rounded border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] focus:border-[var(--color-accent)] focus:outline-none"}),p.jsx("button",{onClick:()=>{g.trim()&&(m({...h,[g.trim()]:""}),x(""))},className:"text-xs text-[var(--color-accent)] hover:underline shrink-0",children:"+ Add"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Output Path"}),p.jsx("input",{type:"text",value:v,onChange:A=>b(A.target.value),placeholder:"_bmad-output/data/",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none font-[var(--font-mono)] text-xs"})]}),k&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:k}),p.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:T,disabled:!R||j,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),j?"Creating...":"Create"]})]})]})]})]})}function cme({command:t,sourceName:e,onClose:n}){const[r,i]=C.useState(!1);function s(){navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})}return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Sync: ",e]}),p.jsx("button",{onClick:n,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-3",children:"Run this command in your terminal to sync data:"}),p.jsxs("div",{className:"relative",children:[p.jsx("pre",{className:"p-4 text-sm font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap border border-[var(--color-border-subtle)]",children:t}),p.jsx("button",{onClick:s,className:"absolute top-2 right-2 p-1.5 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",title:"Copy to clipboard",children:r?p.jsx(Bx,{size:14,className:"text-[var(--color-success)]"}):p.jsx(Q9,{size:14,className:"text-[var(--color-muted)]"})})]}),p.jsx("div",{className:"flex justify-end mt-4",children:p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Close"})})]})]})}function ume(){var B,H;const[t,e]=C.useState(null),[n,r]=C.useState(!0),[i,s]=C.useState(null),[a,o]=C.useState(null),[u,d]=C.useState(!1),[h,m]=C.useState([]),[g,x]=C.useState(!0),[v,b]=C.useState(!1),[k,w]=C.useState(null),[j,Q]=C.useState(null),[E,R]=C.useState(null),T=C.useCallback(async()=>{try{const D=await(await fetch("/api/datasources")).json();m(D)}catch{}finally{x(!1)}},[]);C.useEffect(()=>{fetch("/api/overview").then(P=>P.json()).then(P=>{e(P),r(!1)}).catch(()=>r(!1))},[]),C.useEffect(()=>{T()},[T]);async function A(P){if(i===P){s(null),o(null);return}s(P),d(!0);try{const D=await fetch(`/api/files/_config/ides/${P}.yaml`);if(D.ok){const _=await D.json();o(_.content)}else o(null)}catch{o(null)}finally{d(!1)}}async function I(P){Q(P.id);try{const D=await fetch(`/api/datasources/${encodeURIComponent(P.id)}/sync`,{method:"POST"});if(D.ok){const _=await D.json();w({command:_.command,name:P.name})}}catch{}finally{Q(null)}}async function W(P){if(confirm(`Delete data source "${P.name}"?`)){R(P.id);try{(await fetch(`/api/datasources/${encodeURIComponent(P.id)}`,{method:"DELETE"})).ok&&await T()}catch{}finally{R(null)}}}if(n&&g)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Connections"}),p.jsx(yv,{count:3})]});const F=((H=(B=t==null?void 0:t.sections)==null?void 0:B.ideConfigs)==null?void 0:H.ides)??[],Z=F.length+h.length;return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsxs("h1",{className:"text-2xl font-extrabold",children:["Connections (",Z,")"]}),p.jsxs("button",{onClick:()=>b(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"Add Data Source"]})]}),h.length>0&&p.jsxs("div",{className:"mb-8",children:[p.jsxs("h2",{className:"text-sm font-bold text-[var(--color-muted)] uppercase tracking-wider mb-4",children:["Data Sources (",h.length,")"]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:h.map(P=>{const D=b6[P.type]??K5,_=pR[P.status]??pR["not-configured"];return p.jsxs("div",{className:"p-4 rounded-lg border bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-all",children:[p.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[p.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:p.jsx(D,{size:16,className:"text-[var(--color-accent)]"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("span",{className:"font-bold text-sm block truncate",children:P.name}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:AO[P.type]})]})]}),p.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[p.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:_}}),p.jsx("span",{className:"text-xs capitalize",style:{color:_},children:P.status}),P.lastSync&&p.jsxs("span",{className:"text-xs text-[var(--color-muted)] ml-auto",children:["Last sync: ",new Date(P.lastSync).toLocaleDateString()]})]}),p.jsxs("div",{className:"text-xs text-[var(--color-muted)] mb-3 space-y-1",children:[p.jsxs("p",{className:"font-[var(--font-mono)] truncate",title:P.cliTool,children:["Tool: ",P.cliTool||"(not set)"]}),p.jsxs("p",{className:"font-[var(--font-mono)] truncate",title:P.outputPath,children:["Output: ",P.outputPath]})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("button",{onClick:()=>I(P),disabled:j===P.id,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs rounded-md border border-[var(--color-accent)] text-[var(--color-accent)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:[j===P.id?p.jsx(Po,{size:12,className:"animate-spin"}):p.jsx(hV,{size:12}),"Sync"]}),p.jsx("button",{onClick:()=>W(P),disabled:E===P.id,className:"flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs rounded-md border border-[var(--color-error)] text-[var(--color-error)] hover:bg-[var(--color-error)] hover:text-white transition-colors disabled:opacity-50",children:p.jsx(ld,{size:12})})]})]},P.id)})})]}),F.length>0&&p.jsxs("div",{className:"mb-8",children:[p.jsxs("h2",{className:"text-sm font-bold text-[var(--color-muted)] uppercase tracking-wider mb-4",children:["IDE Connections (",F.length,")"]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:F.map(P=>p.jsxs("button",{onClick:()=>A(P),className:`p-4 rounded-lg border text-left transition-all cursor-pointer hover:-translate-y-0.5 hover:shadow-md ${i===P?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[p.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:p.jsx(lV,{size:16,className:"text-[var(--color-accent)]"})}),p.jsx("span",{className:"font-bold text-sm",children:P})]}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"w-2 h-2 rounded-full bg-[var(--color-success)]"}),p.jsx("span",{className:"text-xs text-[var(--color-success)]",children:"Configured"})]})]},P))})]}),Z===0&&p.jsx(Xi,{icon:Hk,title:"No connections configured",description:"Add data sources to sync external data, or configure IDE integrations in your BMAD project.",actions:p.jsxs("button",{onClick:()=>b(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"Add Data Source"]})}),i&&p.jsxs(Ev,{open:!0,title:i,onClose:()=>{s(null),o(null)},children:[p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Status"}),p.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx(Bx,{size:16,className:"text-[var(--color-success)]"}),p.jsx("span",{className:"text-sm",children:"Connected and active"})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Integration"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-[var(--color-surface-raised)] text-sm",children:[p.jsx(th,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{children:"Agent commands"})]}),p.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-[var(--color-surface-raised)] text-sm",children:[p.jsx(th,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{children:"Skill shortcuts"})]}),p.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-[var(--color-surface-raised)] text-sm",children:[p.jsx(th,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{children:"Workflow triggers"})]})]})]}),u&&p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"}),a&&!u&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Configuration"}),p.jsx("pre",{className:"p-3 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto",children:a})]}),p.jsx("div",{className:"text-xs text-[var(--color-muted)]",children:p.jsxs("p",{children:["Config file: ",p.jsxs("code",{className:"font-[var(--font-mono)]",children:["_bmad/_config/ides/",i,".yaml"]})]})})]}),v&&p.jsx(ome,{onClose:()=>b(!1),onCreated:()=>{b(!1),T()}}),k&&p.jsx(cme,{command:k.command,sourceName:k.name,onClose:()=>w(null)})]})}function dme(t){const e=[],n=t.split(`
518
+ `);let r="",i=[];for(const s of n){const a=s.match(/^#{1,3}\s+(.+)/);a?((r||i.length>0)&&e.push({title:r||"Introduction",content:i.join(`
519
+ `).trim()}),r=a[1],i=[]):i.push(s)}return(r||i.length>0)&&e.push({title:r||"Content",content:i.join(`
520
+ `).trim()}),e}function fme({section:t}){const[e,n]=C.useState(!0);return p.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden",children:[p.jsxs("button",{onClick:()=>n(!e),className:"w-full flex items-center gap-2 px-4 py-3 bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] text-left transition-colors",children:[e?p.jsx(ra,{size:16,className:"text-[var(--color-muted)]"}):p.jsx(ia,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"font-bold text-sm",children:t.title})]}),e&&t.content&&p.jsx("div",{className:"px-4 py-3 text-sm text-[var(--color-text)]",children:p.jsx("pre",{className:"whitespace-pre-wrap font-[var(--font-mono)] text-xs",children:t.content})})]})}function hme(){const[t,e]=C.useState(null),[n,r]=C.useState(!0),[i,s]=C.useState(""),[a,o]=C.useState("structured"),[u,d]=C.useState(!1),[h,m]=C.useState(null),[g,x]=C.useState(""),{notify:v}=ad();C.useEffect(()=>{Promise.allSettled([fetch("/api/files/project-context.md").then(w=>{if(!w.ok)throw new Error("Not found");return w.json()}).then(w=>{const j=w;e(j.content),s(j.content)}),fetch("/api/files/core/config.yaml").then(w=>w.ok?w.json():fetch("/api/files/config.yaml").then(j=>{if(!j.ok)throw new Error("Not found");return j.json()})).then(w=>{const j=w;m(j.content),x(j.content)}).catch(()=>{})]).finally(()=>r(!1))},[]);async function b(){try{(await fetch("/api/files/project-context.md",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:i})})).ok?(e(i),d(!1),v("success","Workspace context saved")):v("error","Failed to save workspace context")}catch{v("error","Failed to save workspace context")}}if(n)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workspace"}),p.jsx(OQ,{className:"h-64"})]});if(t===null&&!u)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workspace"}),p.jsx(Xi,{icon:F5,title:"No workspace context found",description:"Create a project-context.md file in your _bmad/ directory to help agents understand your project.",actions:p.jsx("button",{onClick:()=>{const w=`# Project Context
521
+
522
+ ## Overview
523
+ Describe your project here.
524
+
525
+ ## Tech Stack
526
+ List your technologies.
527
+
528
+ ## Architecture
529
+ Describe your architecture.
530
+ `;e(""),s(w),d(!0)},className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Create Workspace Context"})})]});if(u)return p.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h1",{className:"text-2xl font-extrabold",children:"Edit Workspace Context"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("button",{onClick:()=>{d(!1),s(t??"")},className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{onClick:b,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Save"})]})]}),p.jsx(mi,{content:i,filePath:"_bmad/project-context.md",onChange:s,onSave:b})]});const k=dme(t??"");return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsx("h1",{className:"text-2xl font-extrabold",children:"Workspace"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"flex gap-1 bg-[var(--color-surface-raised)] rounded-md p-0.5",children:["structured","raw","preview","config"].map(w=>p.jsx("button",{onClick:()=>o(w),className:`px-3 py-1.5 text-sm rounded min-h-[36px] transition-colors ${a===w?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:w.charAt(0).toUpperCase()+w.slice(1)},w))}),p.jsx("button",{onClick:()=>d(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Edit"})]})]}),a==="structured"&&p.jsxs("div",{className:"space-y-3",children:[k.map((w,j)=>p.jsx(fme,{section:w},j)),k.length===0&&p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No structured sections found in workspace context."})]}),a==="raw"&&p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:p.jsx("pre",{className:"p-4 text-sm font-[var(--font-mono)] overflow-x-auto whitespace-pre-wrap",children:t})}),a==="preview"&&p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] p-6",children:p.jsx("div",{className:"prose prose-sm max-w-none text-[var(--color-text)] prose-headings:text-[var(--color-text)] prose-headings:font-bold prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg prose-a:text-[var(--color-accent)] prose-strong:text-[var(--color-text)]",children:p.jsx(VM,{children:t??""})})}),a==="config"&&p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx(th,{size:16,className:"text-[var(--color-accent)]"}),p.jsx("h2",{className:"text-sm font-bold",children:"BMAD Configuration"}),p.jsx("span",{className:"text-xs text-[var(--color-muted)] font-[var(--font-mono)]",children:"_bmad/config.yaml"})]}),h!==null?p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-[500px]",children:p.jsx(mi,{content:g,filePath:"_bmad/config.yaml",onChange:x,onSave:async()=>{try{let w=await fetch("/api/files/core/config.yaml",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:g})});w.ok||(w=await fetch("/api/files/config.yaml",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:g})})),w.ok?(m(g),v("success","Configuration saved")):v("error","Failed to save configuration")}catch{v("error","Failed to save configuration")}}})}):p.jsx("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)] text-sm text-[var(--color-muted)]",children:"No config.yaml found in the _bmad/ directory."})]})]})}function pme({moduleName:t,currentVersion:e,currentDescription:n,onClose:r,onSaved:i}){const[s,a]=C.useState(e||"1.0.0"),[o,u]=C.useState(n||""),[d,h]=C.useState(null),[m,g]=C.useState(!1),x=async()=>{var v;g(!0),h(null);try{const b=await fetch(`/api/modules/${encodeURIComponent(t)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:s.trim(),description:o.trim()})});if(!b.ok){const k=await b.json();throw new Error(((v=k.error)==null?void 0:v.message)??"Failed to update module")}i()}catch(b){h(b instanceof Error?b.message:"Failed to update module")}finally{g(!1)}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Edit Module: ",t]}),p.jsx("button",{onClick:r,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:t,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Module name cannot be changed"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),p.jsx("input",{type:"text",value:s,onChange:v=>a(v.target.value),placeholder:"e.g. 1.0.0",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description (optional)"}),p.jsx("textarea",{value:o,onChange:v=>u(v.target.value),rows:3,placeholder:"What does this module provide?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),d&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:d})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:x,disabled:m,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(jh,{size:14}),m?"Saving...":"Save Changes"]})]})]})]})}function mme({onClose:t}){const[e,n]=C.useState("info"),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState("1.0.0"),[d,h]=C.useState([]),[m,g]=C.useState([]),[x,v]=C.useState([]),[b,k]=C.useState(!1),[w,j]=C.useState(new Set),[Q,E]=C.useState(new Set),[R,T]=C.useState(new Set),[A,I]=C.useState(!1),[W,F]=C.useState(null),Z=r.trim().length>0;C.useEffect(()=>{e==="select"&&d.length===0&&m.length===0&&x.length===0&&(k(!0),Promise.all([fetch("/api/agents").then($=>$.json()),fetch("/api/skills").then($=>$.json()),fetch("/api/workflows").then($=>$.json())]).then(([$,z,q])=>{h($),g(z),v(q)}).catch(()=>F("Failed to load entities")).finally(()=>k(!1)))},[e,d.length,m.length,x.length]);const B=w.size+Q.size+R.size,H=C.useMemo(()=>y1(d),[d]),P=C.useMemo(()=>y1(m),[m]),D=C.useMemo(()=>y1(x),[x]);function _($,z,q){const M=new Set($);M.has(q)?M.delete(q):M.add(q),z(M)}function X($,z){z(new Set($.map(q=>q.id)))}function Y($){$(new Set)}async function V(){var $;I(!0),F(null);try{const z=await fetch("/api/packages/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),description:s.trim(),version:o.trim(),agents:Array.from(w),skills:Array.from(Q),workflows:Array.from(R)})});if(!z.ok){const ie=await z.json();throw new Error((($=ie.error)==null?void 0:$.message)??"Export failed")}const q=await z.blob(),M=URL.createObjectURL(q),G=document.createElement("a");G.href=M,G.download=`${r.trim()}.tar.gz`,document.body.appendChild(G),G.click(),document.body.removeChild(G),URL.revokeObjectURL(M),t()}catch(z){F(z instanceof Error?z.message:"Export failed")}finally{I(!1)}}return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-3xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-6",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ch,{size:20,className:"text-[var(--color-accent)]"}),p.jsx("h2",{className:"text-lg font-bold",children:"Export Package"})]}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[p.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${e==="info"?"text-[var(--color-accent)] font-bold":"text-[var(--color-muted)]"}`,children:[p.jsx("span",{className:"w-5 h-5 rounded-full border flex items-center justify-center text-xs border-current",children:e==="select"?p.jsx(x9,{size:12}):"1"}),"Package Info"]}),p.jsx("div",{className:"w-8 h-px bg-[var(--color-border-subtle)]"}),p.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${e==="select"?"text-[var(--color-accent)] font-bold":"text-[var(--color-muted)]"}`,children:[p.jsx("span",{className:"w-5 h-5 rounded-full border flex items-center justify-center text-xs border-current",children:"2"}),"Select Entities"]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[e==="info"&&p.jsxs("div",{className:"space-y-4 max-w-md",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Package Name *"}),p.jsx("input",{type:"text",value:r,onChange:$=>i($.target.value),placeholder:"my-package",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",autoFocus:!0})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:s,onChange:$=>a($.target.value),rows:3,placeholder:"What does this package contain?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),p.jsx("input",{type:"text",value:o,onChange:$=>u($.target.value),placeholder:"1.0.0",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]})]}),e==="select"&&p.jsx(p.Fragment,{children:b?p.jsx("div",{className:"flex items-center justify-center py-12",children:p.jsx(Po,{size:24,className:"animate-spin text-[var(--color-muted)]"})}):p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(b1,{icon:hi,label:"Agents",items:d,grouped:H,selected:w,onToggle:$=>_(w,j,$),onSelectAll:()=>X(d,j),onDeselectAll:()=>Y(j),getLabel:$=>$.title||$.name}),p.jsx(b1,{icon:sa,label:"Skills",items:m,grouped:P,selected:Q,onToggle:$=>_(Q,E,$),onSelectAll:()=>X(m,E),onDeselectAll:()=>Y(E),getLabel:$=>$.name}),p.jsx(b1,{icon:Mi,label:"Workflows",items:x,grouped:D,selected:R,onToggle:$=>_(R,T,$),onSelectAll:()=>X(x,T),onDeselectAll:()=>Y(T),getLabel:$=>$.name})]})})]}),W&&p.jsx("p",{className:"text-sm text-[var(--color-error)] mt-4",children:W}),p.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("div",{className:"text-sm text-[var(--color-muted)]",children:e==="select"&&`${B} entit${B===1?"y":"ies"} selected`}),p.jsxs("div",{className:"flex gap-3",children:[e==="info"&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{onClick:()=>n("select"),disabled:!Z,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]}),e==="select"&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:()=>n("info"),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Back"}),p.jsx("button",{onClick:V,disabled:B===0||A,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:A?p.jsxs(p.Fragment,{children:[p.jsx(Po,{size:14,className:"animate-spin"}),"Exporting..."]}):p.jsxs(p.Fragment,{children:[p.jsx(DO,{size:14}),"Export Package"]})})]})]})]})]})]})}function y1(t){const e=new Map;for(const n of t){const r=n.module??"unknown";e.has(r)||e.set(r,[]),e.get(r).push(n)}return e}function b1({icon:t,label:e,items:n,grouped:r,selected:i,onToggle:s,onSelectAll:a,onDeselectAll:o,getLabel:u}){const d=n.length>0&&i.size===n.length;return p.jsxs("div",{className:"flex flex-col rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:[p.jsx("div",{className:"px-3 py-2 bg-[var(--color-surface-raised)] border-b border-[var(--color-border-subtle)]",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(t,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:e}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",n.length,")"]})]}),p.jsx("button",{onClick:d?o:a,className:"text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:d?"Deselect All":"Select All"})]})}),p.jsxs("div",{className:"flex-1 overflow-y-auto max-h-72 p-1",children:[n.length===0&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] text-center py-4",children:"None available"}),Array.from(r.entries()).map(([h,m])=>p.jsxs("div",{children:[r.size>1&&p.jsx("p",{className:"text-[10px] uppercase font-bold text-[var(--color-muted)] px-2 pt-2 pb-1",children:h}),m.map(g=>p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-[var(--color-surface-raised)] cursor-pointer transition-colors",children:[p.jsx("input",{type:"checkbox",checked:i.has(g.id),onChange:()=>s(g.id),className:"rounded border-[var(--color-border-subtle)] text-[var(--color-accent)] focus:ring-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm truncate",children:u(g)}),r.size<=1&&g.module&&p.jsx("span",{className:"ml-auto text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:g.module})]},g.id))]},h))]})]})}function gme({onClose:t,onInstalled:e,initialSource:n}){const[r,i]=C.useState((n==null?void 0:n.type)??"npm"),[s,a]=C.useState(""),[o,u]=C.useState((n==null?void 0:n.type)==="github"?n.value:""),[d,h]=C.useState(""),[m,g]=C.useState(null),[x,v]=C.useState(null),[b,k]=C.useState({}),[w,j]=C.useState(!1),[Q,E]=C.useState(!1),[R,T]=C.useState(null),[A,I]=C.useState(!1);C.useEffect(()=>{v(null),T(null),k({})},[r]),C.useEffect(()=>{if(n)if(n.prefetchedModuleYaml){const _=n.prefetchedModuleYaml;v({ok:!0,moduleYaml:_,counts:{agents:0,workflows:0,tasks:0},willReplace:!1});const $={};for(const[z,q]of Object.entries(_.variables??{}))$[z]=q.default??"";k($)}else W(n.value)},[]);const W=async _=>{if(_.trim()){j(!0),T(null),v(null),k({});try{const X=await fetch("/api/modules/preview-source",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:{type:r,value:_.trim()}})}),Y=await X.json();if(!X.ok){const z=Y.error,q=typeof z=="object"&&z!==null?z.message??"Fetch failed":String(z??"Fetch failed");throw new Error(q)}const V=Y;v(V);const $={};for(const[z,q]of Object.entries(V.moduleYaml.variables??{}))$[z]=q.default??"";k($)}catch(X){T(X instanceof Error?X.message:"Fetch failed")}finally{j(!1)}}},F=async()=>W(r==="github"?o:d),Z=async()=>{E(!0),T(null);try{if(r==="zip"){if(!m)throw new Error("No zip file selected");const _=new FormData;_.append("file",m),_.append("variables",JSON.stringify(b));const Y=await(await fetch("/api/modules/install/upload",{method:"POST",body:_})).json();if(!Y.ok){const V=Y.error;throw new Error(typeof V=="object"&&V!==null?V.message??"Installation failed":String(V??"Installation failed"))}}else{const Y=await(await fetch("/api/modules/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:{type:r,value:(r==="npm"?s:r==="github"?o:d).trim()},variables:b})})).json();if(!Y.ok){const V=Y.error;throw new Error(typeof V=="object"&&V!==null?V.message??"Installation failed":String(V??"Installation failed"))}}I(!0),setTimeout(()=>e(),1500)}catch(_){T(_ instanceof Error?_.message:"Installation failed")}finally{E(!1)}},B=r==="github"&&o.trim().length>0||r==="local"&&d.trim().length>0,H=Q||A?!1:r==="npm"?s.trim().length>0:r==="zip"?m!==null:x!==null,P=x!=null&&x.willReplace?"Replace":"Install",D=[{id:"npm",label:"npm"},{id:"github",label:"GitHub"},{id:"local",label:"Local path"},{id:"zip",label:"Upload zip"}];return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"Install Module"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsx("div",{className:"flex border-b border-[var(--color-border-subtle)] mb-4",children:D.map(_=>p.jsx("button",{onClick:()=>i(_.id),className:["px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",r===_.id?"border-[var(--color-accent)] text-[var(--color-accent)]":"border-transparent text-[var(--color-muted)] hover:text-[var(--color-text)]"].join(" "),children:_.label},_.id))}),p.jsxs("div",{className:"space-y-4",children:[r==="npm"&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"npm Package Name"}),p.jsx("input",{type:"text",value:s,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Enter"&&H&&!Q&&Z()},placeholder:"e.g. bmad-builder",disabled:Q||A,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-50"}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:["The package must contain a ",p.jsx("code",{className:"font-[var(--font-mono)]",children:"_bmad/"})," directory with module content."]})]}),r==="github"&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"GitHub Source"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{type:"text",value:o,onChange:_=>u(_.target.value),placeholder:"owner/repo or full GitHub URL",disabled:w||Q||A,className:"flex-1 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-50"}),p.jsxs("button",{onClick:F,disabled:!B||w||Q||A,className:"px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[w?p.jsx(Po,{size:14,className:"animate-spin"}):null,w?"Fetching...":"Fetch"]})]})]}),r==="local"&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Local Path"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{type:"text",value:d,onChange:_=>h(_.target.value),placeholder:"/absolute/path/to/module or relative/path",disabled:w||Q||A,className:"flex-1 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-50"}),p.jsxs("button",{onClick:F,disabled:!B||w||Q||A,className:"px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[w?p.jsx(Po,{size:14,className:"animate-spin"}):null,w?"Fetching...":"Fetch"]})]})]}),r==="zip"&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module Zip File"}),p.jsx("input",{type:"file",accept:".zip",onChange:_=>{var X;return g(((X=_.target.files)==null?void 0:X[0])??null)},disabled:Q||A,className:"w-full text-sm text-[var(--color-muted)] file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border file:border-[var(--color-border-subtle)] file:text-sm file:bg-[var(--color-surface-raised)] file:text-[var(--color-text)] hover:file:bg-[var(--color-bg)] disabled:opacity-50"}),m&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:m.name})]}),x&&p.jsxs("div",{className:"rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)] p-4 space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm font-bold",children:x.moduleYaml.name??x.moduleYaml.code}),x.moduleYaml.version&&p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["v",x.moduleYaml.version]})]}),x.moduleYaml.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:x.moduleYaml.description}),p.jsxs("div",{className:"flex gap-4 text-xs text-[var(--color-muted)]",children:[p.jsxs("span",{children:[x.counts.agents," agent",x.counts.agents!==1?"s":""]}),p.jsxs("span",{children:[x.counts.workflows," workflow",x.counts.workflows!==1?"s":""]}),p.jsxs("span",{children:[x.counts.tasks," task",x.counts.tasks!==1?"s":""]})]})]}),(x==null?void 0:x.willReplace)&&p.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-[var(--color-warning)]/10 border border-[var(--color-warning)]/30",children:[p.jsx(Tu,{size:16,className:"text-[var(--color-warning)] mt-0.5 shrink-0"}),p.jsxs("p",{className:"text-xs text-[var(--color-warning)]",children:["This will replace the existing installation of"," ",p.jsx("strong",{children:x.moduleYaml.name??x.moduleYaml.code}),x.moduleYaml.version?` v${x.moduleYaml.version}`:"",". The previous version will be recoverable from snapshot history."]})]}),x&&Object.keys(x.moduleYaml.variables??{}).length>0&&p.jsxs("div",{className:"space-y-3",children:[p.jsx("p",{className:"text-sm font-bold",children:"Module Variables"}),Object.entries(x.moduleYaml.variables).map(([_,X])=>p.jsxs("div",{children:[p.jsx("label",{className:"block text-xs font-medium mb-1 text-[var(--color-muted)]",children:_}),p.jsx("input",{type:"text",value:b[_]??"",onChange:Y=>k(V=>({...V,[_]:Y.target.value})),placeholder:X.prompt,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]},_))]}),Q&&p.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx(Po,{size:16,className:"text-[var(--color-accent)] animate-spin"}),p.jsx("span",{className:"text-sm",children:"Installing module..."})]}),A&&p.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-success)]",children:[p.jsx(Bx,{size:16,className:"text-[var(--color-success)]"}),p.jsx("span",{className:"text-sm font-bold text-[var(--color-success)]",children:"Installed successfully"})]}),R&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:R})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:A?"Close":"Cancel"}),!A&&p.jsxs("button",{onClick:Z,disabled:!H,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(DO,{size:14}),Q?"Installing...":P]})]})]})]})}var iO={exports:{}},S1,mR;function $v(){if(mR)return S1;mR=1;const t="2.0.0",e=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=e-6;return S1={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},S1}var w1,gR;function Nv(){if(gR)return w1;gR=1;var t={};return w1=typeof process=="object"&&t&&t.NODE_DEBUG&&/\bsemver\b/i.test(t.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},w1}var OR;function Gp(){return OR||(OR=1,(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=$v(),s=Nv();e=t.exports={};const a=e.re=[],o=e.safeRe=[],u=e.src=[],d=e.safeSrc=[],h=e.t={};let m=0;const g="[a-zA-Z0-9-]",x=[["\\s",1],["\\d",i],[g,r]],v=k=>{for(const[w,j]of x)k=k.split(`${w}*`).join(`${w}{0,${j}}`).split(`${w}+`).join(`${w}{1,${j}}`);return k},b=(k,w,j)=>{const Q=v(w),E=m++;s(k,E,w),h[k]=E,u[E]=w,d[E]=Q,a[E]=new RegExp(w,j?"g":void 0),o[E]=new RegExp(Q,j?"g":void 0)};b("NUMERICIDENTIFIER","0|[1-9]\\d*"),b("NUMERICIDENTIFIERLOOSE","\\d+"),b("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),b("MAINVERSION",`(${u[h.NUMERICIDENTIFIER]})\\.(${u[h.NUMERICIDENTIFIER]})\\.(${u[h.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${u[h.NUMERICIDENTIFIERLOOSE]})\\.(${u[h.NUMERICIDENTIFIERLOOSE]})\\.(${u[h.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${u[h.NONNUMERICIDENTIFIER]}|${u[h.NUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${u[h.NONNUMERICIDENTIFIER]}|${u[h.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASE",`(?:-(${u[h.PRERELEASEIDENTIFIER]}(?:\\.${u[h.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${u[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[h.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${g}+`),b("BUILD",`(?:\\+(${u[h.BUILDIDENTIFIER]}(?:\\.${u[h.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${u[h.MAINVERSION]}${u[h.PRERELEASE]}?${u[h.BUILD]}?`),b("FULL",`^${u[h.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${u[h.MAINVERSIONLOOSE]}${u[h.PRERELEASELOOSE]}?${u[h.BUILD]}?`),b("LOOSE",`^${u[h.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${u[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${u[h.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${u[h.XRANGEIDENTIFIER]})(?:\\.(${u[h.XRANGEIDENTIFIER]})(?:\\.(${u[h.XRANGEIDENTIFIER]})(?:${u[h.PRERELEASE]})?${u[h.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${u[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[h.XRANGEIDENTIFIERLOOSE]})(?:${u[h.PRERELEASELOOSE]})?${u[h.BUILD]}?)?)?`),b("XRANGE",`^${u[h.GTLT]}\\s*${u[h.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${u[h.GTLT]}\\s*${u[h.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),b("COERCE",`${u[h.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",u[h.COERCEPLAIN]+`(?:${u[h.PRERELEASE]})?(?:${u[h.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",u[h.COERCE],!0),b("COERCERTLFULL",u[h.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${u[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",b("TILDE",`^${u[h.LONETILDE]}${u[h.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${u[h.LONETILDE]}${u[h.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${u[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",b("CARET",`^${u[h.LONECARET]}${u[h.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${u[h.LONECARET]}${u[h.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${u[h.GTLT]}\\s*(${u[h.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${u[h.GTLT]}\\s*(${u[h.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${u[h.GTLT]}\\s*(${u[h.LOOSEPLAIN]}|${u[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${u[h.XRANGEPLAIN]})\\s+-\\s+(${u[h.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${u[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[h.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(iO,iO.exports)),iO.exports}var k1,xR;function OC(){if(xR)return k1;xR=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return k1=r=>r?typeof r!="object"?t:r:e,k1}var Q1,vR;function S6(){if(vR)return Q1;vR=1;const t=/^[0-9]+$/,e=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:r<i?-1:1;const s=t.test(r),a=t.test(i);return s&&a&&(r=+r,i=+i),r===i?0:s&&!a?-1:a&&!s?1:r<i?-1:1};return Q1={compareIdentifiers:e,rcompareIdentifiers:(r,i)=>e(i,r)},Q1}var C1,yR;function sr(){if(yR)return C1;yR=1;const t=Nv(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:n}=$v(),{safeRe:r,t:i}=Gp(),s=OC(),{compareIdentifiers:a}=S6();class o{constructor(d,h){if(h=s(h),d instanceof o){if(d.loose===!!h.loose&&d.includePrerelease===!!h.includePrerelease)return d;d=d.version}else if(typeof d!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof d}".`);if(d.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",d,h),this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease;const m=d.trim().match(h.loose?r[i.LOOSE]:r[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){const x=+g;if(x>=0&&x<n)return x}return g}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(d){if(t("SemVer.compare",this.version,this.options,d),!(d instanceof o)){if(typeof d=="string"&&d===this.version)return 0;d=new o(d,this.options)}return d.version===this.version?0:this.compareMain(d)||this.comparePre(d)}compareMain(d){return d instanceof o||(d=new o(d,this.options)),this.major<d.major?-1:this.major>d.major?1:this.minor<d.minor?-1:this.minor>d.minor?1:this.patch<d.patch?-1:this.patch>d.patch?1:0}comparePre(d){if(d instanceof o||(d=new o(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;let h=0;do{const m=this.prerelease[h],g=d.prerelease[h];if(t("prerelease compare",h,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m===g)continue;return a(m,g)}while(++h)}compareBuild(d){d instanceof o||(d=new o(d,this.options));let h=0;do{const m=this.build[h],g=d.build[h];if(t("build compare",h,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m===g)continue;return a(m,g)}while(++h)}inc(d,h,m){if(d.startsWith("pre")){if(!h&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(h){const g=`-${h}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!g||g[1]!==h)throw new Error(`invalid identifier: ${h}`)}}switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",h,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",h,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",h,m),this.inc("pre",h,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",h,m),this.inc("pre",h,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const g=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let x=this.prerelease.length;for(;--x>=0;)typeof this.prerelease[x]=="number"&&(this.prerelease[x]++,x=-2);if(x===-1){if(h===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(h){let x=[h,g];m===!1&&(x=[h]),a(this.prerelease[0],h)===0?isNaN(this.prerelease[1])&&(this.prerelease=x):this.prerelease=x}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return C1=o,C1}var j1,bR;function Sd(){if(bR)return j1;bR=1;const t=sr();return j1=(n,r,i=!1)=>{if(n instanceof t)return n;try{return new t(n,r)}catch(s){if(!i)return null;throw s}},j1}var E1,SR;function Ome(){if(SR)return E1;SR=1;const t=Sd();return E1=(n,r)=>{const i=t(n,r);return i?i.version:null},E1}var $1,wR;function xme(){if(wR)return $1;wR=1;const t=Sd();return $1=(n,r)=>{const i=t(n.trim().replace(/^[=v]+/,""),r);return i?i.version:null},$1}var N1,kR;function vme(){if(kR)return N1;kR=1;const t=sr();return N1=(n,r,i,s,a)=>{typeof i=="string"&&(a=s,s=i,i=void 0);try{return new t(n instanceof t?n.version:n,i).inc(r,s,a).version}catch{return null}},N1}var T1,QR;function yme(){if(QR)return T1;QR=1;const t=Sd();return T1=(n,r)=>{const i=t(n,null,!0),s=t(r,null,!0),a=i.compare(s);if(a===0)return null;const o=a>0,u=o?i:s,d=o?s:i,h=!!u.prerelease.length;if(!!d.prerelease.length&&!h){if(!d.patch&&!d.minor)return"major";if(d.compareMain(u)===0)return d.minor&&!d.patch?"minor":"patch"}const g=h?"pre":"";return i.major!==s.major?g+"major":i.minor!==s.minor?g+"minor":i.patch!==s.patch?g+"patch":"prerelease"},T1}var P1,CR;function bme(){if(CR)return P1;CR=1;const t=sr();return P1=(n,r)=>new t(n,r).major,P1}var _1,jR;function Sme(){if(jR)return _1;jR=1;const t=sr();return _1=(n,r)=>new t(n,r).minor,_1}var A1,ER;function wme(){if(ER)return A1;ER=1;const t=sr();return A1=(n,r)=>new t(n,r).patch,A1}var R1,$R;function kme(){if($R)return R1;$R=1;const t=Sd();return R1=(n,r)=>{const i=t(n,r);return i&&i.prerelease.length?i.prerelease:null},R1}var M1,NR;function Vi(){if(NR)return M1;NR=1;const t=sr();return M1=(n,r,i)=>new t(n,i).compare(new t(r,i)),M1}var z1,TR;function Qme(){if(TR)return z1;TR=1;const t=Vi();return z1=(n,r,i)=>t(r,n,i),z1}var D1,PR;function Cme(){if(PR)return D1;PR=1;const t=Vi();return D1=(n,r)=>t(n,r,!0),D1}var L1,_R;function xC(){if(_R)return L1;_R=1;const t=sr();return L1=(n,r,i)=>{const s=new t(n,i),a=new t(r,i);return s.compare(a)||s.compareBuild(a)},L1}var X1,AR;function jme(){if(AR)return X1;AR=1;const t=xC();return X1=(n,r)=>n.sort((i,s)=>t(i,s,r)),X1}var Z1,RR;function Eme(){if(RR)return Z1;RR=1;const t=xC();return Z1=(n,r)=>n.sort((i,s)=>t(s,i,r)),Z1}var I1,MR;function Tv(){if(MR)return I1;MR=1;const t=Vi();return I1=(n,r,i)=>t(n,r,i)>0,I1}var B1,zR;function vC(){if(zR)return B1;zR=1;const t=Vi();return B1=(n,r,i)=>t(n,r,i)<0,B1}var q1,DR;function w6(){if(DR)return q1;DR=1;const t=Vi();return q1=(n,r,i)=>t(n,r,i)===0,q1}var V1,LR;function k6(){if(LR)return V1;LR=1;const t=Vi();return V1=(n,r,i)=>t(n,r,i)!==0,V1}var Y1,XR;function yC(){if(XR)return Y1;XR=1;const t=Vi();return Y1=(n,r,i)=>t(n,r,i)>=0,Y1}var U1,ZR;function bC(){if(ZR)return U1;ZR=1;const t=Vi();return U1=(n,r,i)=>t(n,r,i)<=0,U1}var W1,IR;function Q6(){if(IR)return W1;IR=1;const t=w6(),e=k6(),n=Tv(),r=yC(),i=vC(),s=bC();return W1=(o,u,d,h)=>{switch(u){case"===":return typeof o=="object"&&(o=o.version),typeof d=="object"&&(d=d.version),o===d;case"!==":return typeof o=="object"&&(o=o.version),typeof d=="object"&&(d=d.version),o!==d;case"":case"=":case"==":return t(o,d,h);case"!=":return e(o,d,h);case">":return n(o,d,h);case">=":return r(o,d,h);case"<":return i(o,d,h);case"<=":return s(o,d,h);default:throw new TypeError(`Invalid operator: ${u}`)}},W1}var H1,BR;function $me(){if(BR)return H1;BR=1;const t=sr(),e=Sd(),{safeRe:n,t:r}=Gp();return H1=(s,a)=>{if(s instanceof t)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;a=a||{};let o=null;if(!a.rtl)o=s.match(a.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);else{const x=a.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let v;for(;(v=x.exec(s))&&(!o||o.index+o[0].length!==s.length);)(!o||v.index+v[0].length!==o.index+o[0].length)&&(o=v),x.lastIndex=v.index+v[1].length+v[2].length;x.lastIndex=-1}if(o===null)return null;const u=o[2],d=o[3]||"0",h=o[4]||"0",m=a.includePrerelease&&o[5]?`-${o[5]}`:"",g=a.includePrerelease&&o[6]?`+${o[6]}`:"";return e(`${u}.${d}.${h}${m}${g}`,a)},H1}var G1,qR;function Nme(){if(qR)return G1;qR=1;class t{constructor(){this.max=1e3,this.map=new Map}get(n){const r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,r)}return this}}return G1=t,G1}var F1,VR;function Yi(){if(VR)return F1;VR=1;const t=/\s+/g;class e{constructor(D,_){if(_=i(_),D instanceof e)return D.loose===!!_.loose&&D.includePrerelease===!!_.includePrerelease?D:new e(D.raw,_);if(D instanceof s)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=_,this.loose=!!_.loose,this.includePrerelease=!!_.includePrerelease,this.raw=D.trim().replace(t," "),this.set=this.raw.split("||").map(X=>this.parseRange(X.trim())).filter(X=>X.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const X=this.set[0];if(this.set=this.set.filter(Y=>!b(Y[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(const Y of this.set)if(Y.length===1&&k(Y[0])){this.set=[Y];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){D>0&&(this.formatted+="||");const _=this.set[D];for(let X=0;X<_.length;X++)X>0&&(this.formatted+=" "),this.formatted+=_[X].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){const X=((this.options.includePrerelease&&x)|(this.options.loose&&v))+":"+D,Y=r.get(X);if(Y)return Y;const V=this.options.loose,$=V?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];D=D.replace($,B(this.options.includePrerelease)),a("hyphen replace",D),D=D.replace(u[d.COMPARATORTRIM],h),a("comparator trim",D),D=D.replace(u[d.TILDETRIM],m),a("tilde trim",D),D=D.replace(u[d.CARETTRIM],g),a("caret trim",D);let z=D.split(" ").map(ie=>j(ie,this.options)).join(" ").split(/\s+/).map(ie=>Z(ie,this.options));V&&(z=z.filter(ie=>(a("loose invalid filter",ie,this.options),!!ie.match(u[d.COMPARATORLOOSE])))),a("range list",z);const q=new Map,M=z.map(ie=>new s(ie,this.options));for(const ie of M){if(b(ie))return[ie];q.set(ie.value,ie)}q.size>1&&q.has("")&&q.delete("");const G=[...q.values()];return r.set(X,G),G}intersects(D,_){if(!(D instanceof e))throw new TypeError("a Range is required");return this.set.some(X=>w(X,_)&&D.set.some(Y=>w(Y,_)&&X.every(V=>Y.every($=>V.intersects($,_)))))}test(D){if(!D)return!1;if(typeof D=="string")try{D=new o(D,this.options)}catch{return!1}for(let _=0;_<this.set.length;_++)if(H(this.set[_],D,this.options))return!0;return!1}}F1=e;const n=Nme(),r=new n,i=OC(),s=Pv(),a=Nv(),o=sr(),{safeRe:u,t:d,comparatorTrimReplace:h,tildeTrimReplace:m,caretTrimReplace:g}=Gp(),{FLAG_INCLUDE_PRERELEASE:x,FLAG_LOOSE:v}=$v(),b=P=>P.value==="<0.0.0-0",k=P=>P.value==="",w=(P,D)=>{let _=!0;const X=P.slice();let Y=X.pop();for(;_&&X.length;)_=X.every(V=>Y.intersects(V,D)),Y=X.pop();return _},j=(P,D)=>(P=P.replace(u[d.BUILD],""),a("comp",P,D),P=T(P,D),a("caret",P),P=E(P,D),a("tildes",P),P=I(P,D),a("xrange",P),P=F(P,D),a("stars",P),P),Q=P=>!P||P.toLowerCase()==="x"||P==="*",E=(P,D)=>P.trim().split(/\s+/).map(_=>R(_,D)).join(" "),R=(P,D)=>{const _=D.loose?u[d.TILDELOOSE]:u[d.TILDE];return P.replace(_,(X,Y,V,$,z)=>{a("tilde",P,X,Y,V,$,z);let q;return Q(Y)?q="":Q(V)?q=`>=${Y}.0.0 <${+Y+1}.0.0-0`:Q($)?q=`>=${Y}.${V}.0 <${Y}.${+V+1}.0-0`:z?(a("replaceTilde pr",z),q=`>=${Y}.${V}.${$}-${z} <${Y}.${+V+1}.0-0`):q=`>=${Y}.${V}.${$} <${Y}.${+V+1}.0-0`,a("tilde return",q),q})},T=(P,D)=>P.trim().split(/\s+/).map(_=>A(_,D)).join(" "),A=(P,D)=>{a("caret",P,D);const _=D.loose?u[d.CARETLOOSE]:u[d.CARET],X=D.includePrerelease?"-0":"";return P.replace(_,(Y,V,$,z,q)=>{a("caret",P,Y,V,$,z,q);let M;return Q(V)?M="":Q($)?M=`>=${V}.0.0${X} <${+V+1}.0.0-0`:Q(z)?V==="0"?M=`>=${V}.${$}.0${X} <${V}.${+$+1}.0-0`:M=`>=${V}.${$}.0${X} <${+V+1}.0.0-0`:q?(a("replaceCaret pr",q),V==="0"?$==="0"?M=`>=${V}.${$}.${z}-${q} <${V}.${$}.${+z+1}-0`:M=`>=${V}.${$}.${z}-${q} <${V}.${+$+1}.0-0`:M=`>=${V}.${$}.${z}-${q} <${+V+1}.0.0-0`):(a("no pr"),V==="0"?$==="0"?M=`>=${V}.${$}.${z}${X} <${V}.${$}.${+z+1}-0`:M=`>=${V}.${$}.${z}${X} <${V}.${+$+1}.0-0`:M=`>=${V}.${$}.${z} <${+V+1}.0.0-0`),a("caret return",M),M})},I=(P,D)=>(a("replaceXRanges",P,D),P.split(/\s+/).map(_=>W(_,D)).join(" ")),W=(P,D)=>{P=P.trim();const _=D.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return P.replace(_,(X,Y,V,$,z,q)=>{a("xRange",P,X,Y,V,$,z,q);const M=Q(V),G=M||Q($),ie=G||Q(z),J=ie;return Y==="="&&J&&(Y=""),q=D.includePrerelease?"-0":"",M?Y===">"||Y==="<"?X="<0.0.0-0":X="*":Y&&J?(G&&($=0),z=0,Y===">"?(Y=">=",G?(V=+V+1,$=0,z=0):($=+$+1,z=0)):Y==="<="&&(Y="<",G?V=+V+1:$=+$+1),Y==="<"&&(q="-0"),X=`${Y+V}.${$}.${z}${q}`):G?X=`>=${V}.0.0${q} <${+V+1}.0.0-0`:ie&&(X=`>=${V}.${$}.0${q} <${V}.${+$+1}.0-0`),a("xRange return",X),X})},F=(P,D)=>(a("replaceStars",P,D),P.trim().replace(u[d.STAR],"")),Z=(P,D)=>(a("replaceGTE0",P,D),P.trim().replace(u[D.includePrerelease?d.GTE0PRE:d.GTE0],"")),B=P=>(D,_,X,Y,V,$,z,q,M,G,ie,J)=>(Q(X)?_="":Q(Y)?_=`>=${X}.0.0${P?"-0":""}`:Q(V)?_=`>=${X}.${Y}.0${P?"-0":""}`:$?_=`>=${_}`:_=`>=${_}${P?"-0":""}`,Q(M)?q="":Q(G)?q=`<${+M+1}.0.0-0`:Q(ie)?q=`<${M}.${+G+1}.0-0`:J?q=`<=${M}.${G}.${ie}-${J}`:P?q=`<${M}.${G}.${+ie+1}-0`:q=`<=${q}`,`${_} ${q}`.trim()),H=(P,D,_)=>{for(let X=0;X<P.length;X++)if(!P[X].test(D))return!1;if(D.prerelease.length&&!_.includePrerelease){for(let X=0;X<P.length;X++)if(a(P[X].semver),P[X].semver!==s.ANY&&P[X].semver.prerelease.length>0){const Y=P[X].semver;if(Y.major===D.major&&Y.minor===D.minor&&Y.patch===D.patch)return!0}return!1}return!0};return F1}var K1,YR;function Pv(){if(YR)return K1;YR=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(h,m){if(m=n(m),h instanceof e){if(h.loose===!!m.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),a("comparator",h,m),this.options=m,this.loose=!!m.loose,this.parse(h),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(h){const m=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],g=h.match(m);if(!g)throw new TypeError(`Invalid comparator: ${h}`);this.operator=g[1]!==void 0?g[1]:"",this.operator==="="&&(this.operator=""),g[2]?this.semver=new o(g[2],this.options.loose):this.semver=t}toString(){return this.value}test(h){if(a("Comparator.test",h,this.options.loose),this.semver===t||h===t)return!0;if(typeof h=="string")try{h=new o(h,this.options)}catch{return!1}return s(h,this.operator,this.semver,this.options)}intersects(h,m){if(!(h instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(h.value,m).test(this.value):h.operator===""?h.value===""?!0:new u(this.value,m).test(h.semver):(m=n(m),m.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||s(this.semver,"<",h.semver,m)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||s(this.semver,">",h.semver,m)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}K1=e;const n=OC(),{safeRe:r,t:i}=Gp(),s=Q6(),a=Nv(),o=sr(),u=Yi();return K1}var J1,UR;function _v(){if(UR)return J1;UR=1;const t=Yi();return J1=(n,r,i)=>{try{r=new t(r,i)}catch{return!1}return r.test(n)},J1}var eS,WR;function Tme(){if(WR)return eS;WR=1;const t=Yi();return eS=(n,r)=>new t(n,r).set.map(i=>i.map(s=>s.value).join(" ").trim().split(" ")),eS}var tS,HR;function Pme(){if(HR)return tS;HR=1;const t=sr(),e=Yi();return tS=(r,i,s)=>{let a=null,o=null,u=null;try{u=new e(i,s)}catch{return null}return r.forEach(d=>{u.test(d)&&(!a||o.compare(d)===-1)&&(a=d,o=new t(a,s))}),a},tS}var nS,GR;function _me(){if(GR)return nS;GR=1;const t=sr(),e=Yi();return nS=(r,i,s)=>{let a=null,o=null,u=null;try{u=new e(i,s)}catch{return null}return r.forEach(d=>{u.test(d)&&(!a||o.compare(d)===1)&&(a=d,o=new t(a,s))}),a},nS}var rS,FR;function Ame(){if(FR)return rS;FR=1;const t=sr(),e=Yi(),n=Tv();return rS=(i,s)=>{i=new e(i,s);let a=new t("0.0.0");if(i.test(a)||(a=new t("0.0.0-0"),i.test(a)))return a;a=null;for(let o=0;o<i.set.length;++o){const u=i.set[o];let d=null;u.forEach(h=>{const m=new t(h.semver.version);switch(h.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!d||n(m,d))&&(d=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${h.operator}`)}}),d&&(!a||n(a,d))&&(a=d)}return a&&i.test(a)?a:null},rS}var iS,KR;function Rme(){if(KR)return iS;KR=1;const t=Yi();return iS=(n,r)=>{try{return new t(n,r).range||"*"}catch{return null}},iS}var sS,JR;function SC(){if(JR)return sS;JR=1;const t=sr(),e=Pv(),{ANY:n}=e,r=Yi(),i=_v(),s=Tv(),a=vC(),o=bC(),u=yC();return sS=(h,m,g,x)=>{h=new t(h,x),m=new r(m,x);let v,b,k,w,j;switch(g){case">":v=s,b=o,k=a,w=">",j=">=";break;case"<":v=a,b=u,k=s,w="<",j="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(h,m,x))return!1;for(let Q=0;Q<m.set.length;++Q){const E=m.set[Q];let R=null,T=null;if(E.forEach(A=>{A.semver===n&&(A=new e(">=0.0.0")),R=R||A,T=T||A,v(A.semver,R.semver,x)?R=A:k(A.semver,T.semver,x)&&(T=A)}),R.operator===w||R.operator===j||(!T.operator||T.operator===w)&&b(h,T.semver))return!1;if(T.operator===j&&k(h,T.semver))return!1}return!0},sS}var aS,e5;function Mme(){if(e5)return aS;e5=1;const t=SC();return aS=(n,r,i)=>t(n,r,">",i),aS}var lS,t5;function zme(){if(t5)return lS;t5=1;const t=SC();return lS=(n,r,i)=>t(n,r,"<",i),lS}var oS,n5;function Dme(){if(n5)return oS;n5=1;const t=Yi();return oS=(n,r,i)=>(n=new t(n,i),r=new t(r,i),n.intersects(r,i)),oS}var cS,r5;function Lme(){if(r5)return cS;r5=1;const t=_v(),e=Vi();return cS=(n,r,i)=>{const s=[];let a=null,o=null;const u=n.sort((g,x)=>e(g,x,i));for(const g of u)t(g,r,i)?(o=g,a||(a=g)):(o&&s.push([a,o]),o=null,a=null);a&&s.push([a,null]);const d=[];for(const[g,x]of s)g===x?d.push(g):!x&&g===u[0]?d.push("*"):x?g===u[0]?d.push(`<=${x}`):d.push(`${g} - ${x}`):d.push(`>=${g}`);const h=d.join(" || "),m=typeof r.raw=="string"?r.raw:String(r);return h.length<m.length?h:r},cS}var uS,i5;function Xme(){if(i5)return uS;i5=1;const t=Yi(),e=Pv(),{ANY:n}=e,r=_v(),i=Vi(),s=(m,g,x={})=>{if(m===g)return!0;m=new t(m,x),g=new t(g,x);let v=!1;e:for(const b of m.set){for(const k of g.set){const w=u(b,k,x);if(v=v||w!==null,w)continue e}if(v)return!1}return!0},a=[new e(">=0.0.0-0")],o=[new e(">=0.0.0")],u=(m,g,x)=>{if(m===g)return!0;if(m.length===1&&m[0].semver===n){if(g.length===1&&g[0].semver===n)return!0;x.includePrerelease?m=a:m=o}if(g.length===1&&g[0].semver===n){if(x.includePrerelease)return!0;g=o}const v=new Set;let b,k;for(const I of m)I.operator===">"||I.operator===">="?b=d(b,I,x):I.operator==="<"||I.operator==="<="?k=h(k,I,x):v.add(I.semver);if(v.size>1)return null;let w;if(b&&k){if(w=i(b.semver,k.semver,x),w>0)return null;if(w===0&&(b.operator!==">="||k.operator!=="<="))return null}for(const I of v){if(b&&!r(I,String(b),x)||k&&!r(I,String(k),x))return null;for(const W of g)if(!r(I,String(W),x))return!1;return!0}let j,Q,E,R,T=k&&!x.includePrerelease&&k.semver.prerelease.length?k.semver:!1,A=b&&!x.includePrerelease&&b.semver.prerelease.length?b.semver:!1;T&&T.prerelease.length===1&&k.operator==="<"&&T.prerelease[0]===0&&(T=!1);for(const I of g){if(R=R||I.operator===">"||I.operator===">=",E=E||I.operator==="<"||I.operator==="<=",b){if(A&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===A.major&&I.semver.minor===A.minor&&I.semver.patch===A.patch&&(A=!1),I.operator===">"||I.operator===">="){if(j=d(b,I,x),j===I&&j!==b)return!1}else if(b.operator===">="&&!r(b.semver,String(I),x))return!1}if(k){if(T&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===T.major&&I.semver.minor===T.minor&&I.semver.patch===T.patch&&(T=!1),I.operator==="<"||I.operator==="<="){if(Q=h(k,I,x),Q===I&&Q!==k)return!1}else if(k.operator==="<="&&!r(k.semver,String(I),x))return!1}if(!I.operator&&(k||b)&&w!==0)return!1}return!(b&&E&&!k&&w!==0||k&&R&&!b&&w!==0||A||T)},d=(m,g,x)=>{if(!m)return g;const v=i(m.semver,g.semver,x);return v>0?m:v<0||g.operator===">"&&m.operator===">="?g:m},h=(m,g,x)=>{if(!m)return g;const v=i(m.semver,g.semver,x);return v<0?m:v>0||g.operator==="<"&&m.operator==="<="?g:m};return uS=s,uS}var dS,s5;function Zme(){if(s5)return dS;s5=1;const t=Gp(),e=$v(),n=sr(),r=S6(),i=Sd(),s=Ome(),a=xme(),o=vme(),u=yme(),d=bme(),h=Sme(),m=wme(),g=kme(),x=Vi(),v=Qme(),b=Cme(),k=xC(),w=jme(),j=Eme(),Q=Tv(),E=vC(),R=w6(),T=k6(),A=yC(),I=bC(),W=Q6(),F=$me(),Z=Pv(),B=Yi(),H=_v(),P=Tme(),D=Pme(),_=_me(),X=Ame(),Y=Rme(),V=SC(),$=Mme(),z=zme(),q=Dme(),M=Lme(),G=Xme();return dS={parse:i,valid:s,clean:a,inc:o,diff:u,major:d,minor:h,patch:m,prerelease:g,compare:x,rcompare:v,compareLoose:b,compareBuild:k,sort:w,rsort:j,gt:Q,lt:E,eq:R,neq:T,gte:A,lte:I,cmp:W,coerce:F,Comparator:Z,Range:B,satisfies:H,toComparators:P,maxSatisfying:D,minSatisfying:_,minVersion:X,validRange:Y,outside:V,gtr:$,ltr:z,intersects:q,simplifyRange:M,subset:G,SemVer:n,re:t.re,src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers},dS}var Ime=Zme();const Mf=mp(Ime);function Bme({installedModules:t,onInstall:e}){const[n,r]=C.useState(null),[i,s]=C.useState(!0),[a,o]=C.useState(!0),[u,d]=C.useState(!1),[h,m]=C.useState(""),[g,x]=C.useState(null),v=async()=>{o(!0),x(null);try{const j=await(await fetch("/api/registry")).json();if(!j.ok){s(j.configured??!1),r(null);return}s(!0),r(j.index??null)}catch(w){x(w instanceof Error?w.message:"Failed to load registry")}finally{o(!1)}},b=async()=>{d(!0);try{const j=await(await fetch("/api/registry/refresh",{method:"POST"})).json();j.ok&&j.index&&r(j.index)}finally{d(!1)}};if(C.useEffect(()=>{v()},[]),a)return p.jsx("div",{className:"text-sm text-[var(--color-muted)] py-8 text-center",children:"Loading registry..."});if(!i)return p.jsxs("div",{className:"p-8 text-center",children:[p.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-4",children:"No registry configured. Configure one in Settings → Module Registry to browse shared modules from your team."}),p.jsx("a",{href:"/settings",className:"text-[var(--color-accent)] underline text-sm",children:"Configure registry"})]});if(g)return p.jsx("p",{className:"text-sm text-[var(--color-error)] py-4",children:g});if(!n)return null;const k=n.modules.filter(w=>{if(!h.trim())return!0;const j=h.trim().toLowerCase();return w.name.toLowerCase().includes(j)||w.description.toLowerCase().includes(j)||(w.tags??[]).some(Q=>Q.toLowerCase().includes(j))});return p.jsxs("div",{children:[n.indexYamlError&&p.jsxs("div",{className:"mb-3 p-2 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm flex items-center gap-2 text-[var(--color-text)]",children:[p.jsx(Tu,{size:14,className:"text-yellow-500 shrink-0"}),p.jsxs("span",{children:["Registry index file has errors — showing all modules alphabetically. (",n.indexYamlError,")"]})]}),p.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Nl,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{value:h,onChange:w=>m(w.target.value),placeholder:"Search registry...",className:"w-full pl-7 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] outline-none focus:border-[var(--color-accent)]"})]}),p.jsxs("button",{onClick:()=>void b(),disabled:u,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] flex items-center gap-1.5 transition-colors",children:[p.jsx(rM,{size:14,className:u?"animate-spin":""}),"Refresh"]})]}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mb-3",children:["Last synced: ",new Date(n.fetchedAt).toLocaleString()," · ",n.modules.length," module",n.modules.length===1?"":"s"]}),k.length===0?p.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-8",children:"No modules match your search."}):p.jsx("div",{className:"space-y-2",children:k.map(w=>p.jsx(qme,{module:w,installedModules:t,onInstall:e,index:n},w.code))})]})}function qme({module:t,installedModules:e,onInstall:n,index:r}){const i=e.find(d=>d.name===t.code),a=i&&Mf.valid(i.version)&&Mf.valid(t.version)?Mf.gt(t.version,i.version):!1,o=i&&(!Mf.valid(i.version)||!Mf.valid(t.version)),u=`${r.owner}/${r.repo}/${t.code}@${r.branch}`;return p.jsx("div",{className:"p-3 rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[p.jsx("h3",{className:"font-bold text-sm",children:t.name}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["v",t.version]}),t.status&&p.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${t.status==="stable"?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:t.status})]}),t.description&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] mt-1 line-clamp-2",children:t.description}),p.jsxs("div",{className:"flex gap-3 text-xs text-[var(--color-muted)] mt-2",children:[p.jsxs("span",{children:[t.agentCount," agent",t.agentCount===1?"":"s"]}),p.jsxs("span",{children:[t.workflowCount," workflow",t.workflowCount===1?"":"s"]}),p.jsxs("span",{children:[t.taskCount," task",t.taskCount===1?"":"s"]})]}),t.tags&&t.tags.length>0&&p.jsx("div",{className:"flex gap-1 mt-2 flex-wrap",children:t.tags.map(d=>p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:d},d))})]}),p.jsx("div",{className:"shrink-0",children:i&&!a?p.jsxs("span",{className:"flex items-center gap-1 text-sm text-[var(--color-success)] whitespace-nowrap",children:[p.jsx(Bx,{size:14}),"Installed v",i.version,o&&p.jsx("span",{title:`Update detection requires both versions to be valid semver. Installed: "${i.version}", registry: "${t.version}". Compare manually.`,className:"ml-1 text-[var(--color-muted)] cursor-help",children:"ⓘ"})]}):a?p.jsxs("button",{onClick:()=>n({type:"github",value:u,prefetchedModuleYaml:t.rawModuleYaml}),className:"px-3 py-1.5 text-sm rounded-md bg-yellow-500 text-white flex items-center gap-1.5 hover:bg-yellow-600 transition-colors whitespace-nowrap",children:[p.jsx(w9,{size:14}),"Update to v",t.version]}):p.jsx("button",{onClick:()=>n({type:"github",value:u,prefetchedModuleYaml:t.rawModuleYaml}),className:"px-3 py-1.5 text-sm rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Install"})})]})})}function Vme(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Yme({moduleName:t,onClose:e,onRemoved:n}){const[r,i]=C.useState(null),[s,a]=C.useState(null),[o,u]=C.useState(!1),[d,h]=C.useState(null);C.useEffect(()=>{fetch(`/api/modules/${encodeURIComponent(t)}/remove-preview`).then(async v=>{const b=await v.json();if(!v.ok){const k=b==null?void 0:b.error;throw new Error(typeof k=="object"&&k!==null?k.message??"Failed to load preview":String(k??"Failed to load preview"))}i(b)}).catch(v=>{a(v instanceof Error?v.message:"Failed to load preview")})},[t]);const m=async()=>{u(!0),h(null);try{const v=await fetch(`/api/modules/${encodeURIComponent(t)}`,{method:"DELETE"});if(!v.ok){const b=await v.json(),k=b==null?void 0:b.error;throw new Error(typeof k=="object"&&k!==null?k.message??"Failed to remove module":String(k??"Failed to remove module"))}n()}catch(v){h(v instanceof Error?v.message:"Failed to remove module")}finally{u(!1)}},g=r!==null&&r.moduleFiles.count===0&&Object.values(r.ideSkills).every(v=>v.length===0)&&r.preservedDirectories.length===0&&r.crossReferences.length===0,x=r?Object.values(r.ideSkills).reduce((v,b)=>v+b.length,0):0;return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg max-h-[80vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center gap-2 p-6 pb-4 border-b border-[var(--color-border-subtle)]",children:[p.jsx(Tu,{size:20,className:"text-[var(--color-error)] shrink-0"}),p.jsx("div",{className:"flex-1 min-w-0",children:p.jsxs("h2",{className:"text-lg font-bold",children:['Remove module "',t,'"',r!=null&&r.module.version?` v${r.module.version}`:"","?"]})}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] shrink-0",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[s&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:s}),!r&&!s&&p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"Loading preview..."}),r&&p.jsxs(p.Fragment,{children:[r.externalInstallerWarning&&p.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsx(nM,{size:16,className:"text-[var(--color-muted)] mt-0.5 shrink-0"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:r.externalInstallerWarning})]}),g?p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No files found on disk for this module. Removing will only clear the entry from manifest.yaml."}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold mb-2",children:"This will be removed:"}),p.jsxs("ul",{className:"space-y-1 text-sm text-[var(--color-muted)]",children:[r.moduleFiles.count>0&&p.jsxs("li",{children:["Module files: ",r.moduleFiles.count," file",r.moduleFiles.count!==1?"s":""," ","(",Vme(r.moduleFiles.totalBytes),")"]}),x>0&&Object.entries(r.ideSkills).map(([v,b])=>b.length>0?p.jsxs("li",{children:["IDE skills (",v,"): ",b.length," launcher",b.length!==1?"s":"",p.jsx("ul",{className:"ml-4 mt-1 space-y-0.5",children:b.map(k=>p.jsx("li",{className:"text-xs font-mono",children:k},k))})]},v):null),p.jsx("li",{children:"Manifest entry"})]})]}),r.preservedDirectories.length>0&&p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold mb-2",children:"This will be preserved:"}),p.jsx("ul",{className:"space-y-1 text-sm text-[var(--color-muted)]",children:r.preservedDirectories.map(v=>p.jsx("li",{className:"font-mono text-xs",children:v.path},v.path))})]}),r.crossReferences.length>0&&p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold text-[var(--color-warning)] mb-2",children:"Warnings:"}),p.jsx("ul",{className:"space-y-1 text-sm text-[var(--color-muted)]",children:r.crossReferences.map((v,b)=>p.jsxs("li",{children:[p.jsx("span",{className:"font-medium",children:v.sourceModule})," / ",p.jsx("span",{className:"font-mono text-xs",children:v.sourceEntity})," references this module via ",p.jsx("span",{className:"font-mono text-xs",children:v.fieldPath})]},b))}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-2 italic",children:r.crossReferenceScopeNotice})]})]}),r.removalBlocked&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:r.removalBlocked.reason}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Recoverable from snapshot history."})]}),d&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:d})]}),p.jsxs("div",{className:"flex justify-end gap-3 p-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:m,disabled:o||!r||!!r.removalBlocked||!!s,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-error)] text-white hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ld,{size:14}),o?"Removing...":"Remove"]})]})]})]})}function a5({onClose:t,onCreated:e}){const[n,r]=C.useState(""),[i,s]=C.useState("1.0.0"),[a,o]=C.useState(null),[u,d]=C.useState(!1),h=/^[a-z][a-z0-9-]*$/.test(n),m=async()=>{var g;if(h){d(!0),o(null);try{const x=await fetch("/api/modules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n,version:i})});if(!x.ok){const v=await x.json();throw new Error(((g=v.error)==null?void 0:g.message)??"Failed to create module")}e()}catch(x){o(x instanceof Error?x.message:"Failed to create module")}finally{d(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-module-title",className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsx("h2",{id:"create-module-title",className:"text-lg font-bold mb-4",children:"Create Module"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:n,onChange:g=>r(g.target.value),placeholder:"my-module",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),n&&!h&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Lowercase alphanumeric and hyphens only, must start with a letter"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),p.jsx("input",{type:"text",value:i,onChange:g=>s(g.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),n&&h&&p.jsxs("div",{className:"text-xs text-[var(--color-muted)] p-3 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx("p",{className:"font-bold mb-1",children:"Will create:"}),p.jsx("pre",{className:"font-[var(--font-mono)]",children:`_bmad/${n}/
531
+ ├── config.yaml
532
+ ├── agents/
533
+ ├── skills/
534
+ └── workflows/`})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:m,disabled:!h||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),u?"Creating...":"Create"]})]})]})]})}function Ume({moduleName:t,entityType:e,onClose:n,onCreated:r}){const[i,s]=C.useState(""),[a,o]=C.useState(null),[u,d]=C.useState(!1),h=/^[a-z][a-z0-9-]*$/.test(i),m=e==="skill"?"Skill":"Workflow",g=async()=>{var x;if(h){d(!0),o(null);try{const v=await fetch(`/api/modules/${encodeURIComponent(t)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,name:i})});if(!v.ok){const b=await v.json();throw new Error(((x=b.error)==null?void 0:x.message)??`Failed to create ${e}`)}r()}catch(v){o(v instanceof Error?v.message:`Failed to create ${e}`)}finally{d(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("h2",{className:"text-lg font-bold mb-4",children:["Create ",m]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:[m," Name"]}),p.jsx("input",{type:"text",value:i,onChange:x=>s(x.target.value),placeholder:`my-${e}`,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),i&&!h&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Lowercase alphanumeric and hyphens only, must start with a letter"})]}),i&&h&&p.jsxs("div",{className:"text-xs text-[var(--color-muted)] p-3 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx("p",{className:"font-bold mb-1",children:"Will create:"}),p.jsx("code",{className:"font-[var(--font-mono)]",children:e==="skill"?`_bmad/${t}/skills/${i}/SKILL.md`:`_bmad/${t}/workflows/${i}/workflow.md`})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:g,disabled:!h||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),u?"Creating...":`Create ${m}`]})]})]})]})}function Wme({manifest:t,onClose:e}){const n=["# Module Export Manifest",`module: ${t.module}`,`version: ${t.version}`,`source: ${t.source}`,`exportDate: ${t.exportDate}`,`totalEntities: ${t.totalEntities}`,"entities:"," agents:",` count: ${t.entities.agents.count}`," names:",...t.entities.agents.names.map(r=>` - ${r}`)," skills:",` count: ${t.entities.skills.count}`," names:",...t.entities.skills.names.map(r=>` - ${r}`)," workflows:",` count: ${t.entities.workflows.count}`," names:",...t.entities.workflows.names.map(r=>` - ${r}`),"",`# ${t.note}`].join(`
535
+ `);return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Export Manifest: ",t.module]}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex gap-4 text-sm",children:[p.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx(hi,{size:14,className:"text-[var(--color-accent)]"}),p.jsxs("span",{children:[t.entities.agents.count," agents"]})]}),p.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx(sa,{size:14,className:"text-[var(--color-accent)]"}),p.jsxs("span",{children:[t.entities.skills.count," skills"]})]}),p.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx(Mi,{size:14,className:"text-[var(--color-accent)]"}),p.jsxs("span",{children:[t.entities.workflows.count," workflows"]})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"module-manifest.yaml"}),p.jsx("pre",{className:"p-4 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap max-h-72 overflow-y-auto border border-[var(--color-border-subtle)]",children:n})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Full file bundling and archive download is a future enhancement. This manifest provides a summary of module contents."})]}),p.jsx("div",{className:"flex justify-end gap-3 mt-6",children:p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Close"})})]})]})}function Hme(t){const e=t.name.toLowerCase();return e==="skill.md"||e.endsWith("-skill.md")||e.endsWith("_skill.md")?"skill":e==="workflow.md"?"workflow":"agent"}async function Gme(t){const n=(await t.text()).match(/^---\n([\s\S]*?)\n---/);if(n){const r=n[1].toLowerCase();if(r.includes("category:")&&(r.includes("skill")||r.includes("best_for:")))return"skill"}return Hme(t)}function fS({icon:t,label:e,items:n}){const[r,i]=C.useState(!1);return n.length===0?null:p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>i(!r),className:"flex items-center gap-2 w-full text-left py-2",children:[r?p.jsx(ra,{size:14,className:"text-[var(--color-muted)]"}):p.jsx(ia,{size:14,className:"text-[var(--color-muted)]"}),p.jsx(t,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:e}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",n.length,")"]})]}),r&&p.jsx("div",{className:"ml-7 space-y-1 mb-2",children:n.map(s=>p.jsx(nr,{to:s.to,className:"block text-sm text-[var(--color-accent)] hover:underline py-0.5",children:s.name},s.id))})]})}function Fme(){const t=Oa(),[e,n]=C.useState([]),[r,i]=C.useState(!0),[s,a]=qo("detail"),[o,u]=C.useState(!1),[d,h]=C.useState(!1),[m,g]=C.useState(),[x,v]=qo("tab"),b=x==="registry"?"registry":"installed",[k,w]=C.useState(!1),[j,Q]=C.useState(null),[E,R]=C.useState(null),[T,A]=C.useState([]),[I,W]=C.useState(null),[F,Z]=C.useState(!1),[B,H]=C.useState(null),P=C.useRef(null),[D,_]=C.useState(null),[X,Y]=C.useState(!1),[V,$]=C.useState(null),{notify:z}=ad(),q=C.useCallback(async ne=>{var se;$(ne);try{const pe=await fetch(`/api/modules/${encodeURIComponent(ne)}/regenerate-skills`,{method:"POST"}),ye=await pe.json();if(!pe.ok||!ye.ok){const _e=((se=ye==null?void 0:ye.error)==null?void 0:se.message)??(ye==null?void 0:ye.error)??"Failed to regenerate IDE skills";throw new Error(_e)}const be=ye.regenerated??{},Se=Object.values(be).reduce((_e,We)=>_e+We,0),ke=Object.keys(be).length;ke===0?z("info",`No IDE skills generated for "${ne}"`,"No IDEs are configured in manifest.yaml `ides:` — add `claude-code` or `antigravity` and try again."):z("success",`Regenerated ${Se} skill${Se===1?"":"s"} across ${ke} IDE${ke===1?"":"s"}`)}catch(pe){z("error",`Failed to regenerate IDE skills for "${ne}"`,pe instanceof Error?pe.message:String(pe))}finally{$(null)}},[z]),M=C.useCallback(async()=>{try{const se=await(await fetch("/api/modules")).json();n(se)}catch{}finally{i(!1)}},[]);C.useEffect(()=>{fetch("/api/teams").then(ne=>ne.json()).then(ne=>A(ne)).catch(()=>{})},[]),C.useEffect(()=>{M()},[M]);const G=C.useCallback(async(ne,se)=>{H(null);let pe=0,ye=0;for(const be of Array.from(ne)){if(!be.name.endsWith(".md")){ye++;continue}try{const Se=await be.text(),ke=await Gme(be),_e=be.name.replace(/\.md$/i,"");(await fetch(`/api/modules/${encodeURIComponent(se)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:ke,name:_e,content:Se})})).ok?pe++:ye++}catch{ye++}}pe>0&&await M(),ye>0?H(`Uploaded ${pe} file(s), ${ye} failed`):H(`Uploaded ${pe} file(s) successfully`),setTimeout(()=>H(null),4e3)},[M]),ie=C.useCallback(async ne=>{Y(!0);try{const se=await fetch(`/api/modules/${encodeURIComponent(ne)}/export`,{method:"POST"});if(!se.ok)throw new Error("Export failed");const pe=await se.json();_(pe)}catch{H("Export failed"),setTimeout(()=>H(null),3e3)}finally{Y(!1)}},[]);if(r)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Modules"}),p.jsx(yv,{count:3})]});if(e.length===0)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Modules"}),p.jsx(Xi,{icon:Ch,title:"No modules installed",description:"Modules contain agents, skills, and workflows. Install a module or create a new one to get started.",actions:p.jsxs("button",{onClick:()=>u(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"Create Module"]})}),o&&p.jsx(a5,{onClose:()=>u(!1),onCreated:()=>{u(!1),M()}})]});const J=s?e.find(ne=>ne.name===s):null;return p.jsxs("div",{children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsxs("h1",{className:"text-2xl font-extrabold",children:["Modules (",e.length,")"]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:()=>w(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors flex items-center gap-1.5",children:[p.jsx(LO,{size:14}),"Export Package"]}),p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors flex items-center gap-1.5",children:[p.jsx(DO,{size:14}),"Install Module"]}),p.jsxs("button",{onClick:()=>u(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(ln,{size:14}),"Create Module"]})]})]}),p.jsxs("div",{className:"flex border-b border-[var(--color-border-subtle)] mb-4",children:[p.jsx("button",{onClick:()=>v("installed"),className:`px-4 py-2 text-sm font-medium transition-colors ${b==="installed"?"border-b-2 border-[var(--color-accent)] text-[var(--color-text)]":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Installed"}),p.jsx("button",{onClick:()=>v("registry"),className:`px-4 py-2 text-sm font-medium transition-colors ${b==="registry"?"border-b-2 border-[var(--color-accent)] text-[var(--color-text)]":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Registry"})]}),b==="registry"&&p.jsx(Bme,{installedModules:e,onInstall:ne=>{g(ne),h(!0)}}),b==="installed"&&p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(ne=>p.jsxs("button",{onClick:()=>a(s===ne.name?null:ne.name),className:`p-4 rounded-lg border text-left transition-all cursor-pointer hover:-translate-y-0.5 hover:shadow-md ${s===ne.name?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx(Ch,{size:18,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"font-bold text-sm",children:ne.name}),p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:ne.source})]}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mb-2 ml-7",children:["v",ne.version]}),p.jsxs("div",{className:"flex gap-4 text-xs text-[var(--color-muted)]",children:[p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(hi,{size:10}),ne.agentCount," agents"]}),p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(sa,{size:10}),ne.skillCount," skills"]}),p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(Mi,{size:10}),ne.workflowCount," workflows"]})]})]},ne.name))})]}),J&&p.jsxs("div",{className:"slide-over-backdrop",children:[p.jsx("div",{className:"slide-over-bg",onClick:()=>a(null)}),p.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-bold",children:J.name}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[J.source," · v",J.version]})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[p.jsx("button",{onClick:()=>R(J.name),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Module",children:p.jsx(Nu,{size:16})}),p.jsx("button",{onClick:()=>a(null),className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Qn,{size:18})})]})]}),p.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 80px)"},children:[p.jsx(fS,{icon:hi,label:"Agents",items:(J.agents??[]).map(ne=>({id:ne.id,name:ne.title||ne.name,to:`/agents/${ne.id}`}))}),p.jsx(fS,{icon:sa,label:"Skills",items:(J.skills??[]).map(ne=>({id:ne.id,name:ne.name,to:`/skills?detail=${ne.id}`}))}),p.jsx(fS,{icon:Mi,label:"Workflows",items:(J.workflows??[]).map(ne=>({id:ne.id,name:ne.name,to:`/workflows?detail=${ne.id}`}))}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Add Entities"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("button",{onClick:()=>t("/agents"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx(ln,{size:14,className:"text-[var(--color-accent)]"}),p.jsx(hi,{size:14}),"Add Agent",p.jsx("span",{className:"ml-auto text-xs text-[var(--color-muted)]",children:"via Agents page"})]}),p.jsxs("button",{onClick:()=>W("skill"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx(ln,{size:14,className:"text-[var(--color-accent)]"}),p.jsx(sa,{size:14}),"Add Skill"]}),p.jsxs("button",{onClick:()=>W("workflow"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx(ln,{size:14,className:"text-[var(--color-accent)]"}),p.jsx(Mi,{size:14}),"Add Workflow"]})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Upload Entities"}),p.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${F?"border-[var(--color-accent)] bg-[var(--color-accent)]/10":"border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,onDragOver:ne=>{ne.preventDefault(),Z(!0)},onDragLeave:()=>Z(!1),onDrop:ne=>{ne.preventDefault(),Z(!1),ne.dataTransfer.files.length>0&&G(ne.dataTransfer.files,J.name)},onClick:()=>{var ne;return(ne=P.current)==null?void 0:ne.click()},children:[p.jsx("input",{ref:P,type:"file",accept:".md",multiple:!0,className:"hidden",onChange:ne=>{ne.target.files&&ne.target.files.length>0&&(G(ne.target.files,J.name),ne.target.value="")}}),p.jsx(LO,{size:24,className:`mx-auto mb-2 ${F?"text-[var(--color-accent)]":"text-[var(--color-muted)]"}`}),p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"Drop .md files here or click to upload"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Auto-detects: SKILL.md → skills, workflow.md → workflows, others → agents"})]}),B&&p.jsxs("p",{className:"text-xs mt-2 text-[var(--color-accent)]",children:[p.jsx(To,{size:12,className:"inline mr-1"}),B]})]}),(()=>{const ne=T.filter(se=>se.module===J.name);return ne.length===0?null:p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Teams (",ne.length,")"]}),p.jsx("div",{className:"space-y-2",children:ne.map(se=>p.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("span",{className:"flex items-center gap-2 text-sm",children:[se.icon?p.jsx("span",{className:"text-sm leading-none",children:se.icon}):p.jsx(iM,{size:14,className:"text-[var(--color-accent)]"}),se.name]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[se.memberCount," members"]})]},se.id))})]})})(),p.jsxs("div",{className:"text-xs text-[var(--color-muted)]",children:[p.jsxs("p",{children:["Module directory: ",p.jsxs("code",{className:"font-[var(--font-mono)]",children:["_bmad/",J.name,"/"]})]}),J.npmPackage&&p.jsxs("p",{className:"mt-1",children:["npm: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:J.npmPackage})]})]}),p.jsxs("button",{onClick:()=>ie(J.name),disabled:X,className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-accent)] text-[var(--color-accent)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:[p.jsx(DO,{size:14}),X?"Exporting...":"Export Module"]}),p.jsxs("button",{onClick:()=>q(J.name),disabled:V===J.name,title:"Regenerate IDE skill launchers from the current module contents",className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-muted)] hover:text-[var(--color-text)] hover:border-[var(--color-accent)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[V===J.name?p.jsx(Po,{size:14,className:"animate-spin"}):p.jsx(rM,{size:14}),V===J.name?"Regenerating...":"Regenerate IDE Skills"]}),J.source!=="built-in"&&p.jsxs("button",{onClick:()=>Q(J),className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-error)] text-[var(--color-error)] hover:bg-[var(--color-error)] hover:text-white transition-colors",children:[p.jsx(ld,{size:14}),"Remove Module"]})]})]})]}),o&&p.jsx(a5,{onClose:()=>u(!1),onCreated:()=>{u(!1),M()}}),j&&p.jsx(Yme,{moduleName:j.name,onClose:()=>Q(null),onRemoved:()=>{Q(null),a(null),M()}}),I&&J&&p.jsx(Ume,{moduleName:J.name,entityType:I,onClose:()=>W(null),onCreated:()=>{W(null),M()}}),D&&p.jsx(Wme,{manifest:D,onClose:()=>_(null)}),E&&J&&p.jsx(pme,{moduleName:J.name,currentVersion:J.version,onClose:()=>R(null),onSaved:()=>{R(null),M()}}),d&&p.jsx(gme,{onClose:()=>{h(!1),g(void 0)},onInstalled:()=>{h(!1),g(void 0),M()},initialSource:m}),k&&p.jsx(mme,{onClose:()=>w(!1)})]})}function C6({node:t,depth:e=0,selectedPath:n,onSelect:r}){var u;const[i,s]=C.useState(e<2),a=()=>{t.type==="directory"?s(!i):r(t.path)},o=t.type==="file"&&n===t.path;return p.jsxs("div",{children:[p.jsxs("button",{onClick:a,className:`w-full text-left flex items-center gap-2 px-2 py-1.5 text-sm rounded transition-colors ${o?"bg-[var(--color-surface-raised)] text-[var(--color-accent)] font-bold":"hover:bg-[var(--color-surface-raised)]"} ${t.type==="directory"||t.type==="file"?"cursor-pointer":""}`,style:{paddingLeft:`${e*16+8}px`},children:[t.type==="directory"?p.jsx(eM,{size:14,className:i?"text-[var(--color-accent)]":"text-[var(--color-muted)]"}):p.jsx(M9,{size:14,className:o?"text-[var(--color-accent)]":"text-[var(--color-muted)]"}),p.jsx("span",{className:"truncate",children:t.name}),t.type==="file"&&t.size!==void 0&&p.jsx("span",{className:"ml-auto text-xs text-[var(--color-muted)] shrink-0",children:t.size>1024?`${(t.size/1024).toFixed(1)}K`:`${t.size}B`})]}),i&&((u=t.children)==null?void 0:u.map(d=>p.jsx(C6,{node:d,depth:e+1,selectedPath:n,onSelect:r},d.path)))]})}function Kme(){const[t,e]=C.useState([]),[n,r]=C.useState(!0),[i,s]=qo("path"),[a,o]=C.useState(""),[u,d]=C.useState(!1);C.useEffect(()=>{fetch("/api/files").then(m=>m.json()).then(m=>{e(m),r(!1)}).catch(()=>r(!1))},[]);const h=C.useCallback(async m=>{if(i===m){s(null);return}s(m),d(!0);const g=m.lastIndexOf("/_bmad/"),x=g>=0?m.slice(g+7):m;try{const v=await fetch(`/api/files/${x}`);if(v.ok){const b=await v.json();o(b.content)}else o("Failed to load file.")}catch{o("Failed to load file content.")}finally{d(!1)}},[i]);return n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),p.jsx("div",{className:"h-64 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),p.jsx(Xi,{icon:J5,title:"No BMAD files",description:"No _bmad/ directory detected."})]}):p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),p.jsx("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden overflow-y-auto",style:{maxHeight:"calc(100vh - 10rem)"},children:p.jsx("div",{className:"py-1",children:t.map(m=>p.jsx(C6,{node:m,selectedPath:i,onSelect:h},m.path))})}),p.jsx(Ev,{open:!!i,title:i??"",onClose:()=>s(null),children:u?p.jsx("div",{className:"h-64 rounded bg-[var(--color-surface-raised)] animate-pulse"}):i!=null&&i.endsWith(".csv")?p.jsx(Xx,{content:a}):p.jsx("div",{className:"h-96 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(mi,{content:a,filePath:i??"",onChange:()=>{},readOnly:!0})})})]})}function Jme(){const t=Eh(H=>H.theme),e=Eh(H=>H.setTheme),{notify:n}=ad(),[,r]=C.useState({port:4040,theme:"dark"}),[i,s]=C.useState(!0),[a,o]=C.useState("4040"),[u,d]=C.useState(!1),[h,m]=C.useState(!1),[g,x]=C.useState(""),[v,b]=C.useState("main"),[k,w]=C.useState(!1),[j,Q]=C.useState(!1),[E,R]=C.useState("info"),[T,A]=C.useState(!1);C.useEffect(()=>{fetch("/api/settings").then(H=>H.json()).then(H=>{const P=H;r(P),o(String(P.port??4040)),P.registry&&(x(P.registry.repo??""),b(P.registry.branch??"main")),P.logging&&(Q(P.logging.enabled??!1),R(P.logging.level??"info")),s(!1)}).catch(()=>s(!1))},[]);function I(){const H=lM();e(H),d(!0)}function W(H){o(H),d(!0)}async function F(){m(!0);const H=parseInt(a,10);if(isNaN(H)||H<1024||H>65535){n("error","Port must be between 1024 and 65535"),m(!1);return}try{(await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:H,theme:t})})).ok?(r({port:H,theme:t}),d(!1),n("success","Settings saved")):n("error","Failed to save settings")}catch{n("error","Failed to save settings")}finally{m(!1)}}async function Z(){w(!0);try{(await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({registry:{repo:g.trim(),branch:v.trim()||"main"}})})).ok?n("success","Registry settings saved"):n("error","Failed to save registry settings")}catch{n("error","Failed to save registry settings")}finally{w(!1)}}async function B(){A(!0);try{(await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({logging:{enabled:j,level:E}})})).ok?n("success","Logging settings saved — restart the server to apply"):n("error","Failed to save logging settings")}catch{n("error","Failed to save logging settings")}finally{A(!1)}}return i?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Settings"}),p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):p.jsxs("div",{className:"max-w-2xl",children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsx("h1",{className:"text-2xl font-extrabold",children:"Settings"}),p.jsx("button",{onClick:F,disabled:!u||h,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:h?"Saving...":"Save"})]}),p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-4",children:"Studio"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Theme"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Toggle between dark and light mode"})]}),p.jsx("button",{onClick:I,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-bg)] transition-colors",children:t==="dark"?"Switch to Light":"Switch to Dark"})]}),p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Port"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Server port (requires restart)"})]}),p.jsx("input",{type:"number",value:a,onChange:H=>W(H.target.value),min:1024,max:65535,className:"w-24 px-3 py-1.5 text-sm text-right rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] font-[var(--font-mono)] outline-none focus:border-[var(--color-accent)]"})]})]})]}),p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-4",children:"Module Registry"}),p.jsxs("div",{className:"space-y-4",children:[p.jsx("p",{className:"text-sm text-[var(--color-muted)] px-4",children:"Configure a GitHub repo as your team's module registry. Browse and install shared modules from the Registry tab on the Modules page."}),p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Repository"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"GitHub repo in owner/repo format"})]}),p.jsx("input",{type:"text",value:g,onChange:H=>x(H.target.value),placeholder:"owner/repo",className:"w-56 px-3 py-1.5 text-sm rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] font-[var(--font-mono)] outline-none focus:border-[var(--color-accent)]"})]}),p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Branch"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Default: main"})]}),p.jsx("input",{type:"text",value:v,onChange:H=>b(H.target.value),placeholder:"main",className:"w-32 px-3 py-1.5 text-sm rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] font-[var(--font-mono)] outline-none focus:border-[var(--color-accent)]"})]}),p.jsx("div",{className:"flex justify-end",children:p.jsx("button",{onClick:Z,disabled:!g.trim()||k,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:k?"Saving...":"Save"})})]})]}),p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-4",children:"Logging"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("p",{className:"text-sm text-[var(--color-muted)] px-4",children:["Write server logs to ",p.jsx("code",{className:"font-[var(--font-mono)]",children:".bmad-studio/logs/studio.log"})," in your project. Useful for debugging install failures and module errors. Changes take effect after restarting the server."]}),p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Enable file logging"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Append all server logs to the log file"})]}),p.jsx("button",{onClick:()=>Q(!j),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${j?"bg-[var(--color-accent)]":"bg-[var(--color-border-subtle)]"}`,role:"switch","aria-checked":j,children:p.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${j?"translate-x-6":"translate-x-1"}`})})]}),p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Log level"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Minimum severity to log"})]}),p.jsxs("select",{value:E,onChange:H=>R(H.target.value),disabled:!j,className:"px-3 py-1.5 text-sm rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] outline-none focus:border-[var(--color-accent)] disabled:opacity-50 disabled:cursor-not-allowed",children:[p.jsx("option",{value:"trace",children:"trace (very verbose)"}),p.jsx("option",{value:"debug",children:"debug"}),p.jsx("option",{value:"info",children:"info (recommended)"}),p.jsx("option",{value:"warn",children:"warn"}),p.jsx("option",{value:"error",children:"error only"})]})]}),p.jsx("div",{className:"flex justify-end",children:p.jsx("button",{onClick:B,disabled:T,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:T?"Saving...":"Save"})})]})]}),p.jsxs("section",{children:[p.jsx("h2",{className:"text-lg font-bold mb-4",children:"Project"}),p.jsx("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)]",children:p.jsxs("p",{className:"text-sm text-[var(--color-muted)]",children:["Project settings are configured via ",p.jsx("code",{className:"font-[var(--font-mono)]",children:"_bmad/config.yaml"})]})})]})]})}const ege="0.1.0";function sO({href:t,icon:e,title:n,description:r}){return p.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-3 p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(e,{size:18,className:"text-[var(--color-accent)] shrink-0 mt-0.5"}),p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"text-sm font-bold",children:n}),p.jsx(Wk,{size:10,className:"text-[var(--color-muted)]"})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-0.5",children:r})]})]})}const tge=[{q:"What is BMAD?",a:"BMAD (Build Manage Architect Deploy) is an agentic engineering framework that defines AI agents, skills, and workflows as structured markdown files. It provides a method for orchestrating AI agents in software delivery workflows."},{q:"What does BMAD Studio do?",a:"Studio is the configuration and visibility layer for BMAD projects. It reads and writes the same markdown and YAML files that BMAD uses — no database, no hidden state. You can browse agents, visualize workflows, manage skills, and configure your project through a web interface."},{q:"Does Studio execute agents or workflows?",a:"No. Studio configures and visualizes. Your IDE (Claude Code, Cursor, Windsurf, etc.) remains the execution environment. Studio helps you understand and manage the setup; the IDE runs the agents."},{q:"What BMAD version is supported?",a:"Studio targets BMAD v6+. It reads the BMAD version from your project config and warns if the version is unsupported."},{q:"How do I install Studio?",a:"Run `npx bmad-studio` from your BMAD project root. It starts a local server and opens in your browser. No global install required."},{q:"Where does Studio store its data?",a:"Studio reads directly from your _bmad/ directory. Studio-only runtime data (drafts, sync config) lives in .bmad-studio/ which can be deleted at any time with zero impact on your project."},{q:"Can I use Studio without a BMAD project?",a:"Studio will start in setup mode and guide you through initializing a BMAD structure. However, most features require an existing BMAD project to be useful."},{q:"Is my data sent anywhere?",a:"No. Studio runs entirely locally. There are no analytics, no telemetry, and no external network requests. All data stays on your machine."}];function nge(){return p.jsxs("div",{className:"max-w-2xl",children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"About BMAD Studio"}),p.jsxs("p",{className:"text-sm text-[var(--color-muted)] mb-8",children:["Version ",ege]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("p",{className:"text-sm leading-relaxed",children:"BMAD Studio is a browser-based admin interface for the BMAD agentic engineering framework. It helps you visualize, configure, and manage your BMAD project — agents, skills, workflows, teams, and modules — all through an intuitive web UI."}),p.jsx("p",{className:"text-sm leading-relaxed mt-3 text-[var(--color-muted)]",children:"Studio is the configuration and visibility layer. It reads and writes BMAD's existing markdown and YAML files directly, with no database and no hidden state. The IDE remains the execution environment."})]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("h2",{className:"text-sm font-bold mb-3",children:"Links"}),p.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[p.jsx(sO,{href:"https://github.com/jwhiteside/bmad-studio",icon:tM,title:"GitHub Repository",description:"Source code, issues, and releases"}),p.jsx(sO,{href:"https://github.com/bmadcode/BMAD-METHOD",icon:Uk,title:"BMAD Method",description:"The agentic engineering framework"}),p.jsx(sO,{href:"https://github.com/jwhiteside/bmad-studio/blob/main/CONTRIBUTING.md",icon:U9,title:"Contributing",description:"How to report bugs and submit PRs"}),p.jsx(sO,{href:"https://github.com/jwhiteside/bmad-studio/blob/main/LICENSE",icon:bV,title:"MIT License",description:"Free and open-source software"})]})]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("h2",{className:"text-sm font-bold mb-3",children:"Frequently Asked Questions"}),p.jsx("div",{className:"space-y-4",children:tge.map((t,e)=>p.jsxs("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsx("p",{className:"text-sm font-bold mb-1.5",children:t.q}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] leading-relaxed",children:t.a})]},e))})]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("h2",{className:"text-sm font-bold mb-3",children:"Built With"}),p.jsx("div",{className:"flex flex-wrap gap-2",children:["React 19","Fastify 5","TypeScript","Tailwind CSS 4","Vite 6","CodeMirror 6","React Flow"].map(t=>p.jsx("span",{className:"text-xs px-2.5 py-1 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:t},t))})]}),p.jsx("div",{className:"text-xs text-[var(--color-muted)] border-t border-[var(--color-border-subtle)] pt-4",children:p.jsxs("p",{children:["Made by ",p.jsx("a",{href:"https://github.com/jwhiteside",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-accent)] hover:underline",children:"Jonathan Whiteside"}),". Licensed under the MIT License."]})})]})}const rge=[{key:"all",label:"All"},{key:"1-analysis",label:"Analysis"},{key:"2-planning",label:"Planning"},{key:"3-solutioning",label:"Solutioning"},{key:"4-implementation",label:"Implementation"},{key:"anytime",label:"Anytime"}];function ige(t){if(t==="anytime")return"Anytime";if(t==="0-learning")return"Learning";const e=t.replace(/^\d+-/,"");return e.charAt(0).toUpperCase()+e.slice(1)}function sge(){const[t,e]=C.useState([]),[n,r]=C.useState(!0),[i,s]=C.useState("all"),[a,o]=C.useState("all"),[u,d]=C.useState("");C.useEffect(()=>{fetch("/api/commands").then(g=>g.json()).then(g=>{e(g),r(!1)}).catch(()=>r(!1))},[]);const h=C.useMemo(()=>{const g=new Set;for(const x of t)x.module&&g.add(x.module);return Array.from(g).sort()},[t]),m=C.useMemo(()=>{let g=t;if(i!=="all"&&(g=g.filter(x=>x.phase===i)),a!=="all"&&(g=g.filter(x=>x.module===a)),u){const x=u.toLowerCase();g=g.filter(v=>v.name.toLowerCase().includes(x)||v.code.toLowerCase().includes(x)||v.description.toLowerCase().includes(x)||v.agentDisplayName.toLowerCase().includes(x))}return g},[t,i,a,u]);return n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Commands"}),p.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(g=>p.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},g))})]}):t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Commands"}),p.jsx(Xi,{icon:Uk,title:"No commands found",description:"No bmad-help.csv found or it contains no commands."})]}):p.jsxs("div",{children:[p.jsxs("div",{className:"mb-6",children:[p.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[p.jsxs("h1",{className:"text-2xl font-extrabold shrink-0",children:["Commands (",t.length,")"]}),h.length>0&&p.jsxs("div",{className:"flex gap-1 flex-wrap",children:[p.jsx("button",{onClick:()=>o("all"),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${a==="all"?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"All"}),h.map(g=>p.jsx("button",{onClick:()=>o(g),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${a===g?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:g},g))]}),p.jsx("div",{className:"flex items-center gap-3 ml-auto shrink-0",children:p.jsxs("div",{className:"relative",children:[p.jsx(Nl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",placeholder:"Search commands...",value:u,onChange:g=>d(g.target.value),className:"pl-9 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)] w-64"})]})})]}),p.jsx("div",{className:"flex gap-1 flex-wrap mt-4",children:rge.map(g=>p.jsx("button",{onClick:()=>s(g.key),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i===g.key?"bg-[var(--color-accent)] text-white font-bold":"bg-[var(--color-surface-raised)] text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:g.label},g.key))}),m.length!==t.length&&p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-3",children:["Showing ",m.length," of ",t.length," commands"]})]}),p.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border-subtle)]",children:p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"bg-[var(--color-surface-raised)] border-b border-[var(--color-border-subtle)]",children:[p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Code"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Name"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Phase"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Agent"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Required"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Description"})]})}),p.jsx("tbody",{children:m.map(g=>{var v,b;const x=((b=(v=g.agentTitle)==null?void 0:v.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:b[0])??"";return p.jsxs("tr",{className:`border-b border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors ${g.required?"bg-[var(--color-accent)]/3":""}`,children:[p.jsx("td",{className:"px-4 py-3",children:p.jsx("span",{className:`font-[var(--font-mono)] font-bold ${g.required?"text-[var(--color-accent)]":""}`,children:g.code})}),p.jsx("td",{className:"px-4 py-3 font-bold",children:g.name}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:ige(g.phase)})}),p.jsx("td",{className:"px-4 py-3",children:g.agentDisplayName&&p.jsxs("span",{className:"flex items-center gap-1.5",children:[x&&p.jsx("span",{className:"text-sm leading-none",role:"img",children:x}),p.jsx("span",{className:"text-[var(--color-text)]",children:g.agentDisplayName})]})}),p.jsx("td",{className:"px-4 py-3",children:g.required?p.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)]",children:"Required"}):p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"Optional"})}),p.jsx("td",{className:"px-4 py-3 text-[var(--color-muted)] max-w-md",children:p.jsx("span",{className:"line-clamp-2",children:g.description})})]},`${g.code}-${g.module}`)})})]})}),m.length===0&&p.jsx("div",{className:"text-center py-12 text-[var(--color-muted)]",children:p.jsx("p",{className:"text-sm",children:"No commands match your filters."})})]})}const age=new Yq({defaultOptions:{queries:{staleTime:3e4,retry:1}}});function lge(){return p.jsx(Uq,{client:age,children:p.jsx(a9,{children:p.jsx(dq,{children:p.jsx(X8,{children:p.jsxs(_n,{element:p.jsx(GV,{}),children:[p.jsx(_n,{index:!0,element:p.jsx(Qde,{})}),p.jsx(_n,{path:"agents",element:p.jsx(Nde,{})}),p.jsx(_n,{path:"agents/:id",element:p.jsx(Vpe,{})}),p.jsx(_n,{path:"agents/:id/override",element:p.jsx(Ype,{})}),p.jsx(_n,{path:"teams",element:p.jsx(Gpe,{})}),p.jsx(_n,{path:"skills",element:p.jsx(rme,{})}),p.jsx(_n,{path:"workflows",element:p.jsx(bde,{})}),p.jsx(_n,{path:"outputs",element:p.jsx(ame,{})}),p.jsx(_n,{path:"connections",element:p.jsx(ume,{})}),p.jsx(_n,{path:"workspace",element:p.jsx(hme,{})}),p.jsx(_n,{path:"modules",element:p.jsx(Fme,{})}),p.jsx(_n,{path:"files",element:p.jsx(Kme,{})}),p.jsx(_n,{path:"commands",element:p.jsx(sge,{})}),p.jsx(_n,{path:"settings",element:p.jsx(Jme,{})}),p.jsx(_n,{path:"about",element:p.jsx(nge,{})})]})})})})})}aM(_V());XB.createRoot(document.getElementById("root")).render(p.jsx(C.StrictMode,{children:p.jsx(lge,{})}));