popost 0.0.0-stage → 4.6.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 (772) hide show
  1. package/LICENSE +12 -0
  2. package/README.md +35 -2
  3. package/SKILL.md +147 -0
  4. package/THIRD_PARTY_NOTICES +11 -0
  5. package/agents/openai.yaml +4 -0
  6. package/assets/canvas/THIRD_PARTY_LICENSES.txt +1339 -0
  7. package/assets/canvas/assets/dist-Ag5yM9-G.js +12 -0
  8. package/assets/canvas/assets/es-C_Ha8SM2.js +2 -0
  9. package/assets/canvas/assets/es-DzkTYs_E.js +38 -0
  10. package/assets/canvas/assets/index-DS6BKqT0.css +1 -0
  11. package/assets/canvas/assets/index-DjfLTPyx.js +72 -0
  12. package/assets/canvas/assets/jszip.min-Cw2BF2G0.js +2 -0
  13. package/assets/canvas/build-info.json +14 -0
  14. package/assets/canvas/index.html +13 -0
  15. package/assets/fonts/NOTICE.txt +168 -0
  16. package/assets/fonts/cjk-brush/LICENSE +93 -0
  17. package/assets/fonts/cjk-calligraphy/LICENSE +93 -0
  18. package/assets/fonts/cjk-cursive/LICENSE +93 -0
  19. package/assets/fonts/cjk-display/LICENSE +93 -0
  20. package/assets/fonts/cjk-rounded/LICENSE +93 -0
  21. package/assets/fonts/cjk-sans/LICENSE +93 -0
  22. package/assets/fonts/cjk-sans-tc/LICENSE +93 -0
  23. package/assets/fonts/cjk-serif/LICENSE +93 -0
  24. package/assets/fonts/cjk-serif-tc/LICENSE +93 -0
  25. package/assets/fonts/cjk-title/LICENSE +93 -0
  26. package/assets/fonts/cjk-wenkai/LICENSE +94 -0
  27. package/assets/fonts/cjk-wenkai-tc/LICENSE +93 -0
  28. package/assets/fonts/clean-sans/LICENSE +93 -0
  29. package/assets/fonts/condensed-sans/LICENSE +93 -0
  30. package/assets/fonts/css/cjk-brush.css +919 -0
  31. package/assets/fonts/css/cjk-calligraphy.css +737 -0
  32. package/assets/fonts/css/cjk-cursive.css +919 -0
  33. package/assets/fonts/css/cjk-display.css +737 -0
  34. package/assets/fonts/css/cjk-rounded.css +929 -0
  35. package/assets/fonts/css/cjk-sans-tc.css +1079 -0
  36. package/assets/fonts/css/cjk-sans.css +809 -0
  37. package/assets/fonts/css/cjk-serif-tc.css +1079 -0
  38. package/assets/fonts/css/cjk-serif.css +809 -0
  39. package/assets/fonts/css/cjk-title.css +919 -0
  40. package/assets/fonts/css/cjk-wenkai-tc.css +2298 -0
  41. package/assets/fonts/css/cjk-wenkai.css +16 -0
  42. package/assets/fonts/css/clean-sans.css +8 -0
  43. package/assets/fonts/css/condensed-sans.css +8 -0
  44. package/assets/fonts/css/editorial-serif.css +8 -0
  45. package/assets/fonts/css/experimental-display.css +8 -0
  46. package/assets/fonts/css/geometric-sans.css +8 -0
  47. package/assets/fonts/css/latin-anton.css +29 -0
  48. package/assets/fonts/css/latin-be-vietnam-pro.css +116 -0
  49. package/assets/fonts/css/latin-bebas-neue.css +19 -0
  50. package/assets/fonts/css/latin-caveat.css +39 -0
  51. package/assets/fonts/css/latin-cormorant-garamond.css +98 -0
  52. package/assets/fonts/css/latin-dancing-script.css +29 -0
  53. package/assets/fonts/css/latin-dm-sans.css +38 -0
  54. package/assets/fonts/css/latin-ibm-plex-mono.css +196 -0
  55. package/assets/fonts/css/latin-inter-tight.css +138 -0
  56. package/assets/fonts/css/latin-inter.css +138 -0
  57. package/assets/fonts/css/latin-jetbrains-mono.css +118 -0
  58. package/assets/fonts/css/latin-lexend.css +29 -0
  59. package/assets/fonts/css/latin-libre-baskerville.css +38 -0
  60. package/assets/fonts/css/latin-lora.css +138 -0
  61. package/assets/fonts/css/latin-manrope.css +59 -0
  62. package/assets/fonts/css/latin-montserrat.css +98 -0
  63. package/assets/fonts/css/latin-open-sans.css +198 -0
  64. package/assets/fonts/css/latin-oswald.css +49 -0
  65. package/assets/fonts/css/latin-pacifico.css +49 -0
  66. package/assets/fonts/css/latin-playfair-display.css +78 -0
  67. package/assets/fonts/css/latin-poppins.css +116 -0
  68. package/assets/fonts/css/latin-roboto.css +178 -0
  69. package/assets/fonts/css/latin-source-serif-4.css +118 -0
  70. package/assets/fonts/css/luxury-serif.css +8 -0
  71. package/assets/fonts/editorial-serif/LICENSE +93 -0
  72. package/assets/fonts/experimental-display/LICENSE +93 -0
  73. package/assets/fonts/geometric-sans/LICENSE +93 -0
  74. package/assets/fonts/latin-anton/LICENSE +93 -0
  75. package/assets/fonts/latin-be-vietnam-pro/LICENSE +93 -0
  76. package/assets/fonts/latin-bebas-neue/LICENSE +93 -0
  77. package/assets/fonts/latin-caveat/LICENSE +93 -0
  78. package/assets/fonts/latin-cormorant-garamond/LICENSE +93 -0
  79. package/assets/fonts/latin-dancing-script/LICENSE +93 -0
  80. package/assets/fonts/latin-dm-sans/LICENSE +93 -0
  81. package/assets/fonts/latin-ibm-plex-mono/LICENSE +93 -0
  82. package/assets/fonts/latin-inter/LICENSE +93 -0
  83. package/assets/fonts/latin-inter-tight/LICENSE +93 -0
  84. package/assets/fonts/latin-jetbrains-mono/LICENSE +93 -0
  85. package/assets/fonts/latin-lexend/LICENSE +93 -0
  86. package/assets/fonts/latin-libre-baskerville/LICENSE +93 -0
  87. package/assets/fonts/latin-lora/LICENSE +93 -0
  88. package/assets/fonts/latin-manrope/LICENSE +93 -0
  89. package/assets/fonts/latin-montserrat/LICENSE +93 -0
  90. package/assets/fonts/latin-open-sans/LICENSE +93 -0
  91. package/assets/fonts/latin-oswald/LICENSE +93 -0
  92. package/assets/fonts/latin-pacifico/LICENSE +93 -0
  93. package/assets/fonts/latin-playfair-display/LICENSE +93 -0
  94. package/assets/fonts/latin-poppins/LICENSE +93 -0
  95. package/assets/fonts/latin-roboto/LICENSE +93 -0
  96. package/assets/fonts/latin-source-serif-4/LICENSE +93 -0
  97. package/assets/fonts/luxury-serif/LICENSE +93 -0
  98. package/assets/fonts/palette.json +3067 -0
  99. package/assets/mock/mock_models.json +25 -0
  100. package/assets/mock/mock_result.png +0 -0
  101. package/assets/project-starter/page.html +9 -0
  102. package/assets/provider-profiles.example.json +38 -0
  103. package/assets/series-plan.example.json +53 -0
  104. package/assets/template-profile.example.json +15 -0
  105. package/dist/cli.js +11852 -0
  106. package/dist/index.js +11633 -0
  107. package/dist/types/args.d.ts +56 -0
  108. package/dist/types/cli.d.ts +2 -0
  109. package/dist/types/cloud/auth-flow.d.ts +30 -0
  110. package/dist/types/cloud/errors.d.ts +6 -0
  111. package/dist/types/cloud/push.d.ts +36 -0
  112. package/dist/types/cloud/service.d.ts +86 -0
  113. package/dist/types/cloud/state.d.ts +32 -0
  114. package/dist/types/commands/account.d.ts +2 -0
  115. package/dist/types/commands/auth.d.ts +8 -0
  116. package/dist/types/commands/cloud.d.ts +2 -0
  117. package/dist/types/commands/core.d.ts +2 -0
  118. package/dist/types/commands/deck.d.ts +2 -0
  119. package/dist/types/commands/font.d.ts +2 -0
  120. package/dist/types/commands/image.d.ts +2 -0
  121. package/dist/types/commands/inspiration.d.ts +2 -0
  122. package/dist/types/commands/install.d.ts +2 -0
  123. package/dist/types/commands/link.d.ts +2 -0
  124. package/dist/types/commands/post-bundle.d.ts +6 -0
  125. package/dist/types/commands/pricing.d.ts +3 -0
  126. package/dist/types/commands/provider.d.ts +3 -0
  127. package/dist/types/commands/render.d.ts +2 -0
  128. package/dist/types/commands/setup.d.ts +2 -0
  129. package/dist/types/commands/sheet.d.ts +2 -0
  130. package/dist/types/commands/template.d.ts +3 -0
  131. package/dist/types/commands/workflow.d.ts +2 -0
  132. package/dist/types/core/errors.d.ts +15 -0
  133. package/dist/types/core/fingerprint.d.ts +3 -0
  134. package/dist/types/core/image-info.d.ts +23 -0
  135. package/dist/types/core/image.d.ts +22 -0
  136. package/dist/types/core/project.d.ts +105 -0
  137. package/dist/types/core/pyjson.d.ts +21 -0
  138. package/dist/types/core/util.d.ts +29 -0
  139. package/dist/types/credentials.d.ts +53 -0
  140. package/dist/types/deck/compile-bundle.d.ts +1 -0
  141. package/dist/types/deck/engine.d.ts +7 -0
  142. package/dist/types/deck/export-deck.d.ts +21 -0
  143. package/dist/types/deck/import-deck.d.ts +20 -0
  144. package/dist/types/deck/pages.d.ts +6 -0
  145. package/dist/types/deck/types.d.ts +49 -0
  146. package/dist/types/device-login.d.ts +13 -0
  147. package/dist/types/editor/canvas-state.d.ts +43 -0
  148. package/dist/types/editor/handoff.d.ts +31 -0
  149. package/dist/types/editor/http-types.d.ts +55 -0
  150. package/dist/types/editor/project-tools.d.ts +7 -0
  151. package/dist/types/editor/request-security.d.ts +3 -0
  152. package/dist/types/editor/routes-cloud.d.ts +7 -0
  153. package/dist/types/editor/routes-get.d.ts +3 -0
  154. package/dist/types/editor/routes-post.d.ts +3 -0
  155. package/dist/types/editor/sanitize.d.ts +15 -0
  156. package/dist/types/editor/save.d.ts +11 -0
  157. package/dist/types/editor/server.d.ts +15 -0
  158. package/dist/types/editor/subcommand.d.ts +11 -0
  159. package/dist/types/fonts/install.d.ts +22 -0
  160. package/dist/types/fonts/palette.d.ts +47 -0
  161. package/dist/types/fonts/project-fonts.d.ts +52 -0
  162. package/dist/types/fonts/source.d.ts +7 -0
  163. package/dist/types/images/batch-jobs.d.ts +51 -0
  164. package/dist/types/images/batch-quote.d.ts +7 -0
  165. package/dist/types/images/batch-run.d.ts +9 -0
  166. package/dist/types/images/capabilities.d.ts +12 -0
  167. package/dist/types/images/edit-plan.d.ts +60 -0
  168. package/dist/types/images/edit.d.ts +9 -0
  169. package/dist/types/images/info.d.ts +16 -0
  170. package/dist/types/images/jobs.d.ts +48 -0
  171. package/dist/types/images/prepare.d.ts +32 -0
  172. package/dist/types/images/references.d.ts +31 -0
  173. package/dist/types/images/retry.d.ts +28 -0
  174. package/dist/types/images/run.d.ts +35 -0
  175. package/dist/types/images/single-job.d.ts +19 -0
  176. package/dist/types/index.d.ts +15 -0
  177. package/dist/types/install/agents.d.ts +24 -0
  178. package/dist/types/install/payload.d.ts +12 -0
  179. package/dist/types/install/skill-install.d.ts +15 -0
  180. package/dist/types/main.d.ts +7 -0
  181. package/dist/types/node-runtime.d.ts +3 -0
  182. package/dist/types/node-secret.d.ts +3 -0
  183. package/dist/types/providers/account.d.ts +8 -0
  184. package/dist/types/providers/adapter.d.ts +58 -0
  185. package/dist/types/providers/api-errors.d.ts +7 -0
  186. package/dist/types/providers/api.d.ts +95 -0
  187. package/dist/types/providers/base.d.ts +89 -0
  188. package/dist/types/providers/canonical.d.ts +4 -0
  189. package/dist/types/providers/cli-args.d.ts +22 -0
  190. package/dist/types/providers/cli-commands.d.ts +12 -0
  191. package/dist/types/providers/cli-config.d.ts +57 -0
  192. package/dist/types/providers/cli-generate.d.ts +35 -0
  193. package/dist/types/providers/cli-quote.d.ts +35 -0
  194. package/dist/types/providers/cli.d.ts +51 -0
  195. package/dist/types/providers/custom-http-util.d.ts +19 -0
  196. package/dist/types/providers/custom-http.d.ts +36 -0
  197. package/dist/types/providers/decimal.d.ts +22 -0
  198. package/dist/types/providers/errors.d.ts +40 -0
  199. package/dist/types/providers/index.d.ts +11 -0
  200. package/dist/types/providers/inspiration-plan.d.ts +43 -0
  201. package/dist/types/providers/inspiration.d.ts +18 -0
  202. package/dist/types/providers/ledger.d.ts +33 -0
  203. package/dist/types/providers/link-bundle.d.ts +53 -0
  204. package/dist/types/providers/link-task.d.ts +54 -0
  205. package/dist/types/providers/link.d.ts +24 -0
  206. package/dist/types/providers/manual-host.d.ts +17 -0
  207. package/dist/types/providers/paths.d.ts +10 -0
  208. package/dist/types/providers/popost-tasks.d.ts +52 -0
  209. package/dist/types/providers/popost-validate.d.ts +7 -0
  210. package/dist/types/providers/popost.d.ts +73 -0
  211. package/dist/types/providers/pricing.d.ts +6 -0
  212. package/dist/types/providers/secrets.d.ts +11 -0
  213. package/dist/types/providers/time.d.ts +11 -0
  214. package/dist/types/render/audit-script.d.ts +7 -0
  215. package/dist/types/render/audit.d.ts +49 -0
  216. package/dist/types/render/browser.d.ts +7 -0
  217. package/dist/types/render/edit.d.ts +26 -0
  218. package/dist/types/render/mime.d.ts +2 -0
  219. package/dist/types/render/offline.d.ts +47 -0
  220. package/dist/types/render/page-select.d.ts +7 -0
  221. package/dist/types/render/png.d.ts +28 -0
  222. package/dist/types/render/sheet-layout.d.ts +67 -0
  223. package/dist/types/render/sheet.d.ts +12 -0
  224. package/dist/types/runtime.d.ts +99 -0
  225. package/dist/types/setup/check.d.ts +14 -0
  226. package/dist/types/setup/context.d.ts +57 -0
  227. package/dist/types/setup/quote.d.ts +3 -0
  228. package/dist/types/setup/run.d.ts +12 -0
  229. package/dist/types/setup/spec.d.ts +53 -0
  230. package/dist/types/setup/steps.d.ts +33 -0
  231. package/dist/types/version.d.ts +2 -0
  232. package/dist/types/workflow/build.d.ts +43 -0
  233. package/dist/types/workflow/community-search.d.ts +34 -0
  234. package/dist/types/workflow/composition-grid.d.ts +44 -0
  235. package/dist/types/workflow/errors.d.ts +11 -0
  236. package/dist/types/workflow/io.d.ts +8 -0
  237. package/dist/types/workflow/page-check.d.ts +13 -0
  238. package/dist/types/workflow/post-bundle.d.ts +33 -0
  239. package/dist/types/workflow/project-bundle.d.ts +10 -0
  240. package/dist/types/workflow/review.d.ts +20 -0
  241. package/dist/types/workflow/series-plan.d.ts +14 -0
  242. package/dist/types/workflow/settings.d.ts +16 -0
  243. package/dist/types/workflow/subcommands.d.ts +9 -0
  244. package/dist/types/workflow/template-plugins.d.ts +62 -0
  245. package/dist/types/workflow/zip-inspect.d.ts +11 -0
  246. package/package.json +69 -4
  247. package/references/asset-architecture.md +11 -0
  248. package/references/create.md +13 -0
  249. package/references/design-system.md +11 -0
  250. package/references/editor-contract.md +21 -0
  251. package/references/fonts.md +29 -0
  252. package/references/generic-scenes.md +139 -0
  253. package/references/host-editor.md +54 -0
  254. package/references/imagery.md +48 -0
  255. package/references/onboarding.md +58 -0
  256. package/references/platform-adaptation.md +13 -0
  257. package/references/post-bundle.md +54 -0
  258. package/references/project-manifest.md +9 -0
  259. package/references/providers.md +57 -0
  260. package/references/quality-review.md +21 -0
  261. package/references/reproduce.md +23 -0
  262. package/references/scene-templates.md +21 -0
  263. package/references/social-series.md +35 -0
  264. package/templates/community/README.md +418 -0
  265. package/templates/community/index.json +5287 -0
  266. package/templates/community/magazine-argument-explainer/README.md +5 -0
  267. package/templates/community/magazine-argument-explainer/SKILL.md +36 -0
  268. package/templates/community/magazine-argument-explainer/template.json +46 -0
  269. package/templates/community/magazine-life-profile/README.md +5 -0
  270. package/templates/community/magazine-life-profile/SKILL.md +36 -0
  271. package/templates/community/magazine-life-profile/template.json +46 -0
  272. package/templates/community/magazine-news-brief/README.md +5 -0
  273. package/templates/community/magazine-news-brief/SKILL.md +36 -0
  274. package/templates/community/magazine-news-brief/template.json +46 -0
  275. package/templates/community/magazine-outfit-breakdown/README.md +5 -0
  276. package/templates/community/magazine-outfit-breakdown/SKILL.md +36 -0
  277. package/templates/community/magazine-outfit-breakdown/template.json +46 -0
  278. package/templates/community/magazine-parallel-workflow/README.md +7 -0
  279. package/templates/community/magazine-parallel-workflow/SKILL.md +36 -0
  280. package/templates/community/magazine-parallel-workflow/template.json +47 -0
  281. package/templates/community/magazine-quote-reading/README.md +7 -0
  282. package/templates/community/magazine-quote-reading/SKILL.md +36 -0
  283. package/templates/community/magazine-quote-reading/template.json +47 -0
  284. package/templates/community/magazine-story-timeline/README.md +5 -0
  285. package/templates/community/magazine-story-timeline/SKILL.md +36 -0
  286. package/templates/community/magazine-story-timeline/template.json +46 -0
  287. package/templates/community/magazine-travel-itinerary/README.md +5 -0
  288. package/templates/community/magazine-travel-itinerary/SKILL.md +36 -0
  289. package/templates/community/magazine-travel-itinerary/template.json +46 -0
  290. package/templates/community/minimal-case-outcome/README.md +7 -0
  291. package/templates/community/minimal-case-outcome/SKILL.md +36 -0
  292. package/templates/community/minimal-case-outcome/template.json +47 -0
  293. package/templates/community/minimal-concept-starter/README.md +7 -0
  294. package/templates/community/minimal-concept-starter/SKILL.md +36 -0
  295. package/templates/community/minimal-concept-starter/template.json +50 -0
  296. package/templates/community/minimal-data-ranking/README.md +7 -0
  297. package/templates/community/minimal-data-ranking/SKILL.md +36 -0
  298. package/templates/community/minimal-data-ranking/template.json +47 -0
  299. package/templates/community/minimal-feedback-loop/README.md +7 -0
  300. package/templates/community/minimal-feedback-loop/SKILL.md +36 -0
  301. package/templates/community/minimal-feedback-loop/template.json +47 -0
  302. package/templates/community/minimal-period-recap/README.md +7 -0
  303. package/templates/community/minimal-period-recap/SKILL.md +36 -0
  304. package/templates/community/minimal-period-recap/template.json +47 -0
  305. package/templates/community/minimal-structure-breakdown/README.md +7 -0
  306. package/templates/community/minimal-structure-breakdown/SKILL.md +36 -0
  307. package/templates/community/minimal-structure-breakdown/template.json +47 -0
  308. package/templates/community/tiktok-accessory-wearing-closeups/README.md +10 -0
  309. package/templates/community/tiktok-accessory-wearing-closeups/SKILL.md +74 -0
  310. package/templates/community/tiktok-accessory-wearing-closeups/references/mother-post.md +23 -0
  311. package/templates/community/tiktok-accessory-wearing-closeups/source.json +30 -0
  312. package/templates/community/tiktok-accessory-wearing-closeups/template.json +53 -0
  313. package/templates/community/tiktok-apparel-unboxing-print/README.md +10 -0
  314. package/templates/community/tiktok-apparel-unboxing-print/SKILL.md +74 -0
  315. package/templates/community/tiktok-apparel-unboxing-print/references/mother-post.md +23 -0
  316. package/templates/community/tiktok-apparel-unboxing-print/source.json +30 -0
  317. package/templates/community/tiktok-apparel-unboxing-print/template.json +53 -0
  318. package/templates/community/tiktok-appliance-spec-use-guide/README.md +12 -0
  319. package/templates/community/tiktok-appliance-spec-use-guide/SKILL.md +76 -0
  320. package/templates/community/tiktok-appliance-spec-use-guide/references/mother-post.md +23 -0
  321. package/templates/community/tiktok-appliance-spec-use-guide/source.json +42 -0
  322. package/templates/community/tiktok-appliance-spec-use-guide/template.json +57 -0
  323. package/templates/community/tiktok-audience-gift-recommendation/README.md +8 -0
  324. package/templates/community/tiktok-audience-gift-recommendation/SKILL.md +62 -0
  325. package/templates/community/tiktok-audience-gift-recommendation/template.json +82 -0
  326. package/templates/community/tiktok-baby-appliance-side-by-side/README.md +13 -0
  327. package/templates/community/tiktok-baby-appliance-side-by-side/SKILL.md +76 -0
  328. package/templates/community/tiktok-baby-appliance-side-by-side/references/mother-post.md +23 -0
  329. package/templates/community/tiktok-baby-appliance-side-by-side/source.json +48 -0
  330. package/templates/community/tiktok-baby-appliance-side-by-side/template.json +58 -0
  331. package/templates/community/tiktok-baby-product-capacity-accessories/README.md +14 -0
  332. package/templates/community/tiktok-baby-product-capacity-accessories/SKILL.md +76 -0
  333. package/templates/community/tiktok-baby-product-capacity-accessories/references/mother-post.md +23 -0
  334. package/templates/community/tiktok-baby-product-capacity-accessories/source.json +54 -0
  335. package/templates/community/tiktok-baby-product-capacity-accessories/template.json +59 -0
  336. package/templates/community/tiktok-bag-material-studio-closeups/README.md +10 -0
  337. package/templates/community/tiktok-bag-material-studio-closeups/SKILL.md +74 -0
  338. package/templates/community/tiktok-bag-material-studio-closeups/references/mother-post.md +23 -0
  339. package/templates/community/tiktok-bag-material-studio-closeups/source.json +30 -0
  340. package/templates/community/tiktok-bag-material-studio-closeups/template.json +53 -0
  341. package/templates/community/tiktok-bag-on-body-size-guide/README.md +14 -0
  342. package/templates/community/tiktok-bag-on-body-size-guide/SKILL.md +76 -0
  343. package/templates/community/tiktok-bag-on-body-size-guide/references/mother-post.md +23 -0
  344. package/templates/community/tiktok-bag-on-body-size-guide/source.json +54 -0
  345. package/templates/community/tiktok-bag-on-body-size-guide/template.json +59 -0
  346. package/templates/community/tiktok-bag-packing-capacity/README.md +13 -0
  347. package/templates/community/tiktok-bag-packing-capacity/SKILL.md +76 -0
  348. package/templates/community/tiktok-bag-packing-capacity/references/mother-post.md +23 -0
  349. package/templates/community/tiktok-bag-packing-capacity/source.json +48 -0
  350. package/templates/community/tiktok-bag-packing-capacity/template.json +58 -0
  351. package/templates/community/tiktok-bedding-setup-fabric/README.md +12 -0
  352. package/templates/community/tiktok-bedding-setup-fabric/SKILL.md +76 -0
  353. package/templates/community/tiktok-bedding-setup-fabric/references/mother-post.md +23 -0
  354. package/templates/community/tiktok-bedding-setup-fabric/source.json +42 -0
  355. package/templates/community/tiktok-bedding-setup-fabric/template.json +57 -0
  356. package/templates/community/tiktok-bedside-storage-before-after/README.md +12 -0
  357. package/templates/community/tiktok-bedside-storage-before-after/SKILL.md +76 -0
  358. package/templates/community/tiktok-bedside-storage-before-after/references/mother-post.md +23 -0
  359. package/templates/community/tiktok-bedside-storage-before-after/source.json +42 -0
  360. package/templates/community/tiktok-bedside-storage-before-after/template.json +57 -0
  361. package/templates/community/tiktok-body-type-fit-comparison/README.md +9 -0
  362. package/templates/community/tiktok-body-type-fit-comparison/SKILL.md +73 -0
  363. package/templates/community/tiktok-body-type-fit-comparison/references/mother-post.md +23 -0
  364. package/templates/community/tiktok-body-type-fit-comparison/source.json +24 -0
  365. package/templates/community/tiktok-body-type-fit-comparison/template.json +51 -0
  366. package/templates/community/tiktok-book-excerpt-emotional-hook/README.md +11 -0
  367. package/templates/community/tiktok-book-excerpt-emotional-hook/SKILL.md +75 -0
  368. package/templates/community/tiktok-book-excerpt-emotional-hook/references/mother-post.md +23 -0
  369. package/templates/community/tiktok-book-excerpt-emotional-hook/source.json +36 -0
  370. package/templates/community/tiktok-book-excerpt-emotional-hook/template.json +55 -0
  371. package/templates/community/tiktok-budget-message-recommendation/README.md +8 -0
  372. package/templates/community/tiktok-budget-message-recommendation/SKILL.md +62 -0
  373. package/templates/community/tiktok-budget-message-recommendation/template.json +76 -0
  374. package/templates/community/tiktok-car-accessory-compatibility/README.md +14 -0
  375. package/templates/community/tiktok-car-accessory-compatibility/SKILL.md +76 -0
  376. package/templates/community/tiktok-car-accessory-compatibility/references/mother-post.md +23 -0
  377. package/templates/community/tiktok-car-accessory-compatibility/source.json +54 -0
  378. package/templates/community/tiktok-car-accessory-compatibility/template.json +59 -0
  379. package/templates/community/tiktok-car-appearance-upgrade/README.md +10 -0
  380. package/templates/community/tiktok-car-appearance-upgrade/SKILL.md +74 -0
  381. package/templates/community/tiktok-car-appearance-upgrade/references/mother-post.md +23 -0
  382. package/templates/community/tiktok-car-appearance-upgrade/source.json +30 -0
  383. package/templates/community/tiktok-car-appearance-upgrade/template.json +53 -0
  384. package/templates/community/tiktok-car-tool-use-cases/README.md +15 -0
  385. package/templates/community/tiktok-car-tool-use-cases/SKILL.md +76 -0
  386. package/templates/community/tiktok-car-tool-use-cases/references/mother-post.md +23 -0
  387. package/templates/community/tiktok-car-tool-use-cases/source.json +60 -0
  388. package/templates/community/tiktok-car-tool-use-cases/template.json +60 -0
  389. package/templates/community/tiktok-childrens-book-family-reading/README.md +11 -0
  390. package/templates/community/tiktok-childrens-book-family-reading/SKILL.md +75 -0
  391. package/templates/community/tiktok-childrens-book-family-reading/references/mother-post.md +23 -0
  392. package/templates/community/tiktok-childrens-book-family-reading/source.json +36 -0
  393. package/templates/community/tiktok-childrens-book-family-reading/template.json +55 -0
  394. package/templates/community/tiktok-cleaning-appliance-feature-demo/README.md +13 -0
  395. package/templates/community/tiktok-cleaning-appliance-feature-demo/SKILL.md +76 -0
  396. package/templates/community/tiktok-cleaning-appliance-feature-demo/references/mother-post.md +23 -0
  397. package/templates/community/tiktok-cleaning-appliance-feature-demo/source.json +48 -0
  398. package/templates/community/tiktok-cleaning-appliance-feature-demo/template.json +58 -0
  399. package/templates/community/tiktok-clothing-colorway-flat-lay/README.md +15 -0
  400. package/templates/community/tiktok-clothing-colorway-flat-lay/SKILL.md +76 -0
  401. package/templates/community/tiktok-clothing-colorway-flat-lay/references/mother-post.md +23 -0
  402. package/templates/community/tiktok-clothing-colorway-flat-lay/source.json +60 -0
  403. package/templates/community/tiktok-clothing-colorway-flat-lay/template.json +60 -0
  404. package/templates/community/tiktok-clothing-colorway-styling/README.md +9 -0
  405. package/templates/community/tiktok-clothing-colorway-styling/SKILL.md +73 -0
  406. package/templates/community/tiktok-clothing-colorway-styling/references/mother-post.md +23 -0
  407. package/templates/community/tiktok-clothing-colorway-styling/source.json +24 -0
  408. package/templates/community/tiktok-clothing-colorway-styling/template.json +51 -0
  409. package/templates/community/tiktok-clothing-front-back-fabric/README.md +13 -0
  410. package/templates/community/tiktok-clothing-front-back-fabric/SKILL.md +76 -0
  411. package/templates/community/tiktok-clothing-front-back-fabric/references/mother-post.md +23 -0
  412. package/templates/community/tiktok-clothing-front-back-fabric/source.json +48 -0
  413. package/templates/community/tiktok-clothing-front-back-fabric/template.json +58 -0
  414. package/templates/community/tiktok-collectible-toy-set-singles/README.md +11 -0
  415. package/templates/community/tiktok-collectible-toy-set-singles/SKILL.md +75 -0
  416. package/templates/community/tiktok-collectible-toy-set-singles/references/mother-post.md +23 -0
  417. package/templates/community/tiktok-collectible-toy-set-singles/source.json +36 -0
  418. package/templates/community/tiktok-collectible-toy-set-singles/template.json +55 -0
  419. package/templates/community/tiktok-comment-product-reveal/README.md +8 -0
  420. package/templates/community/tiktok-comment-product-reveal/SKILL.md +64 -0
  421. package/templates/community/tiktok-comment-product-reveal/template.json +76 -0
  422. package/templates/community/tiktok-computer-unboxing-first-use/README.md +11 -0
  423. package/templates/community/tiktok-computer-unboxing-first-use/SKILL.md +75 -0
  424. package/templates/community/tiktok-computer-unboxing-first-use/references/mother-post.md +23 -0
  425. package/templates/community/tiktok-computer-unboxing-first-use/source.json +36 -0
  426. package/templates/community/tiktok-computer-unboxing-first-use/template.json +55 -0
  427. package/templates/community/tiktok-device-setup-ports-guide/README.md +14 -0
  428. package/templates/community/tiktok-device-setup-ports-guide/SKILL.md +76 -0
  429. package/templates/community/tiktok-device-setup-ports-guide/references/mother-post.md +23 -0
  430. package/templates/community/tiktok-device-setup-ports-guide/source.json +54 -0
  431. package/templates/community/tiktok-device-setup-ports-guide/template.json +59 -0
  432. package/templates/community/tiktok-digital-product-feature-scenarios/README.md +14 -0
  433. package/templates/community/tiktok-digital-product-feature-scenarios/SKILL.md +76 -0
  434. package/templates/community/tiktok-digital-product-feature-scenarios/references/mother-post.md +23 -0
  435. package/templates/community/tiktok-digital-product-feature-scenarios/source.json +54 -0
  436. package/templates/community/tiktok-digital-product-feature-scenarios/template.json +59 -0
  437. package/templates/community/tiktok-drinkware-on-the-go/README.md +11 -0
  438. package/templates/community/tiktok-drinkware-on-the-go/SKILL.md +75 -0
  439. package/templates/community/tiktok-drinkware-on-the-go/references/mother-post.md +23 -0
  440. package/templates/community/tiktok-drinkware-on-the-go/source.json +36 -0
  441. package/templates/community/tiktok-drinkware-on-the-go/template.json +55 -0
  442. package/templates/community/tiktok-electronics-unboxing-accessories/README.md +9 -0
  443. package/templates/community/tiktok-electronics-unboxing-accessories/SKILL.md +73 -0
  444. package/templates/community/tiktok-electronics-unboxing-accessories/references/mother-post.md +23 -0
  445. package/templates/community/tiktok-electronics-unboxing-accessories/source.json +24 -0
  446. package/templates/community/tiktok-electronics-unboxing-accessories/template.json +51 -0
  447. package/templates/community/tiktok-emergency-essentials-checklist/README.md +13 -0
  448. package/templates/community/tiktok-emergency-essentials-checklist/SKILL.md +76 -0
  449. package/templates/community/tiktok-emergency-essentials-checklist/references/mother-post.md +23 -0
  450. package/templates/community/tiktok-emergency-essentials-checklist/source.json +48 -0
  451. package/templates/community/tiktok-emergency-essentials-checklist/template.json +58 -0
  452. package/templates/community/tiktok-fill-in-gift-book-preview/README.md +11 -0
  453. package/templates/community/tiktok-fill-in-gift-book-preview/SKILL.md +75 -0
  454. package/templates/community/tiktok-fill-in-gift-book-preview/references/mother-post.md +23 -0
  455. package/templates/community/tiktok-fill-in-gift-book-preview/source.json +36 -0
  456. package/templates/community/tiktok-fill-in-gift-book-preview/template.json +55 -0
  457. package/templates/community/tiktok-food-unpacking-texture/README.md +8 -0
  458. package/templates/community/tiktok-food-unpacking-texture/SKILL.md +72 -0
  459. package/templates/community/tiktok-food-unpacking-texture/references/mother-post.md +23 -0
  460. package/templates/community/tiktok-food-unpacking-texture/source.json +18 -0
  461. package/templates/community/tiktok-food-unpacking-texture/template.json +49 -0
  462. package/templates/community/tiktok-footwear-colorway-on-foot/README.md +13 -0
  463. package/templates/community/tiktok-footwear-colorway-on-foot/SKILL.md +76 -0
  464. package/templates/community/tiktok-footwear-colorway-on-foot/references/mother-post.md +23 -0
  465. package/templates/community/tiktok-footwear-colorway-on-foot/source.json +48 -0
  466. package/templates/community/tiktok-footwear-colorway-on-foot/template.json +58 -0
  467. package/templates/community/tiktok-footwear-handheld-detail/README.md +10 -0
  468. package/templates/community/tiktok-footwear-handheld-detail/SKILL.md +74 -0
  469. package/templates/community/tiktok-footwear-handheld-detail/references/mother-post.md +23 -0
  470. package/templates/community/tiktok-footwear-handheld-detail/source.json +30 -0
  471. package/templates/community/tiktok-footwear-handheld-detail/template.json +53 -0
  472. package/templates/community/tiktok-footwear-on-foot-outfits/README.md +10 -0
  473. package/templates/community/tiktok-footwear-on-foot-outfits/SKILL.md +74 -0
  474. package/templates/community/tiktok-footwear-on-foot-outfits/references/mother-post.md +23 -0
  475. package/templates/community/tiktok-footwear-on-foot-outfits/source.json +30 -0
  476. package/templates/community/tiktok-footwear-on-foot-outfits/template.json +53 -0
  477. package/templates/community/tiktok-functional-clothing-in-use/README.md +15 -0
  478. package/templates/community/tiktok-functional-clothing-in-use/SKILL.md +76 -0
  479. package/templates/community/tiktok-functional-clothing-in-use/references/mother-post.md +23 -0
  480. package/templates/community/tiktok-functional-clothing-in-use/source.json +60 -0
  481. package/templates/community/tiktok-functional-clothing-in-use/template.json +60 -0
  482. package/templates/community/tiktok-furniture-room-detail/README.md +10 -0
  483. package/templates/community/tiktok-furniture-room-detail/SKILL.md +74 -0
  484. package/templates/community/tiktok-furniture-room-detail/references/mother-post.md +23 -0
  485. package/templates/community/tiktok-furniture-room-detail/source.json +30 -0
  486. package/templates/community/tiktok-furniture-room-detail/template.json +53 -0
  487. package/templates/community/tiktok-furniture-set-dimensions/README.md +14 -0
  488. package/templates/community/tiktok-furniture-set-dimensions/SKILL.md +76 -0
  489. package/templates/community/tiktok-furniture-set-dimensions/references/mother-post.md +23 -0
  490. package/templates/community/tiktok-furniture-set-dimensions/source.json +54 -0
  491. package/templates/community/tiktok-furniture-set-dimensions/template.json +59 -0
  492. package/templates/community/tiktok-furniture-set-feature-breakdown/README.md +14 -0
  493. package/templates/community/tiktok-furniture-set-feature-breakdown/SKILL.md +76 -0
  494. package/templates/community/tiktok-furniture-set-feature-breakdown/references/mother-post.md +23 -0
  495. package/templates/community/tiktok-furniture-set-feature-breakdown/source.json +54 -0
  496. package/templates/community/tiktok-furniture-set-feature-breakdown/template.json +59 -0
  497. package/templates/community/tiktok-gardening-tool-before-after/README.md +18 -0
  498. package/templates/community/tiktok-gardening-tool-before-after/SKILL.md +76 -0
  499. package/templates/community/tiktok-gardening-tool-before-after/references/mother-post.md +23 -0
  500. package/templates/community/tiktok-gardening-tool-before-after/source.json +78 -0
  501. package/templates/community/tiktok-gardening-tool-before-after/template.json +63 -0
  502. package/templates/community/tiktok-gift-box-reveal/README.md +8 -0
  503. package/templates/community/tiktok-gift-box-reveal/SKILL.md +72 -0
  504. package/templates/community/tiktok-gift-box-reveal/references/mother-post.md +23 -0
  505. package/templates/community/tiktok-gift-box-reveal/source.json +18 -0
  506. package/templates/community/tiktok-gift-box-reveal/template.json +49 -0
  507. package/templates/community/tiktok-handheld-product-features/README.md +10 -0
  508. package/templates/community/tiktok-handheld-product-features/SKILL.md +68 -0
  509. package/templates/community/tiktok-handheld-product-features/template.json +78 -0
  510. package/templates/community/tiktok-holiday-gift-building-unboxing/README.md +11 -0
  511. package/templates/community/tiktok-holiday-gift-building-unboxing/SKILL.md +75 -0
  512. package/templates/community/tiktok-holiday-gift-building-unboxing/references/mother-post.md +23 -0
  513. package/templates/community/tiktok-holiday-gift-building-unboxing/source.json +36 -0
  514. package/templates/community/tiktok-holiday-gift-building-unboxing/template.json +55 -0
  515. package/templates/community/tiktok-home-lighting-mood/README.md +9 -0
  516. package/templates/community/tiktok-home-lighting-mood/SKILL.md +73 -0
  517. package/templates/community/tiktok-home-lighting-mood/references/mother-post.md +23 -0
  518. package/templates/community/tiktok-home-lighting-mood/source.json +24 -0
  519. package/templates/community/tiktok-home-lighting-mood/template.json +51 -0
  520. package/templates/community/tiktok-home-product-lifestyle-scenes/README.md +10 -0
  521. package/templates/community/tiktok-home-product-lifestyle-scenes/SKILL.md +74 -0
  522. package/templates/community/tiktok-home-product-lifestyle-scenes/references/mother-post.md +23 -0
  523. package/templates/community/tiktok-home-product-lifestyle-scenes/source.json +30 -0
  524. package/templates/community/tiktok-home-product-lifestyle-scenes/template.json +53 -0
  525. package/templates/community/tiktok-home-product-real-use/README.md +12 -0
  526. package/templates/community/tiktok-home-product-real-use/SKILL.md +76 -0
  527. package/templates/community/tiktok-home-product-real-use/references/mother-post.md +23 -0
  528. package/templates/community/tiktok-home-product-real-use/source.json +42 -0
  529. package/templates/community/tiktok-home-product-real-use/template.json +57 -0
  530. package/templates/community/tiktok-home-storage-before-after/README.md +12 -0
  531. package/templates/community/tiktok-home-storage-before-after/SKILL.md +76 -0
  532. package/templates/community/tiktok-home-storage-before-after/references/mother-post.md +23 -0
  533. package/templates/community/tiktok-home-storage-before-after/source.json +42 -0
  534. package/templates/community/tiktok-home-storage-before-after/template.json +57 -0
  535. package/templates/community/tiktok-home-styling-before-after/README.md +13 -0
  536. package/templates/community/tiktok-home-styling-before-after/SKILL.md +76 -0
  537. package/templates/community/tiktok-home-styling-before-after/references/mother-post.md +23 -0
  538. package/templates/community/tiktok-home-styling-before-after/source.json +48 -0
  539. package/templates/community/tiktok-home-styling-before-after/template.json +58 -0
  540. package/templates/community/tiktok-interest-mood-product-match/README.md +8 -0
  541. package/templates/community/tiktok-interest-mood-product-match/SKILL.md +64 -0
  542. package/templates/community/tiktok-interest-mood-product-match/template.json +76 -0
  543. package/templates/community/tiktok-jewelry-macro-craftsmanship/README.md +11 -0
  544. package/templates/community/tiktok-jewelry-macro-craftsmanship/SKILL.md +75 -0
  545. package/templates/community/tiktok-jewelry-macro-craftsmanship/references/mother-post.md +23 -0
  546. package/templates/community/tiktok-jewelry-macro-craftsmanship/source.json +36 -0
  547. package/templates/community/tiktok-jewelry-macro-craftsmanship/template.json +55 -0
  548. package/templates/community/tiktok-kids-clothing-flat-lay-try-on/README.md +9 -0
  549. package/templates/community/tiktok-kids-clothing-flat-lay-try-on/SKILL.md +73 -0
  550. package/templates/community/tiktok-kids-clothing-flat-lay-try-on/references/mother-post.md +23 -0
  551. package/templates/community/tiktok-kids-clothing-flat-lay-try-on/source.json +24 -0
  552. package/templates/community/tiktok-kids-clothing-flat-lay-try-on/template.json +51 -0
  553. package/templates/community/tiktok-kitchen-appliance-food-results/README.md +11 -0
  554. package/templates/community/tiktok-kitchen-appliance-food-results/SKILL.md +75 -0
  555. package/templates/community/tiktok-kitchen-appliance-food-results/references/mother-post.md +23 -0
  556. package/templates/community/tiktok-kitchen-appliance-food-results/source.json +36 -0
  557. package/templates/community/tiktok-kitchen-appliance-food-results/template.json +55 -0
  558. package/templates/community/tiktok-kitchen-tool-step-demo/README.md +15 -0
  559. package/templates/community/tiktok-kitchen-tool-step-demo/SKILL.md +76 -0
  560. package/templates/community/tiktok-kitchen-tool-step-demo/references/mother-post.md +23 -0
  561. package/templates/community/tiktok-kitchen-tool-step-demo/source.json +60 -0
  562. package/templates/community/tiktok-kitchen-tool-step-demo/template.json +60 -0
  563. package/templates/community/tiktok-lifestyle-hook-finished-results/README.md +10 -0
  564. package/templates/community/tiktok-lifestyle-hook-finished-results/SKILL.md +74 -0
  565. package/templates/community/tiktok-lifestyle-hook-finished-results/references/mother-post.md +23 -0
  566. package/templates/community/tiktok-lifestyle-hook-finished-results/source.json +30 -0
  567. package/templates/community/tiktok-lifestyle-hook-finished-results/template.json +53 -0
  568. package/templates/community/tiktok-lighting-installation-mood/README.md +13 -0
  569. package/templates/community/tiktok-lighting-installation-mood/SKILL.md +76 -0
  570. package/templates/community/tiktok-lighting-installation-mood/references/mother-post.md +23 -0
  571. package/templates/community/tiktok-lighting-installation-mood/source.json +48 -0
  572. package/templates/community/tiktok-lighting-installation-mood/template.json +58 -0
  573. package/templates/community/tiktok-lockscreen-product-reveal/README.md +8 -0
  574. package/templates/community/tiktok-lockscreen-product-reveal/SKILL.md +62 -0
  575. package/templates/community/tiktok-lockscreen-product-reveal/template.json +76 -0
  576. package/templates/community/tiktok-makeup-shade-swatches/README.md +12 -0
  577. package/templates/community/tiktok-makeup-shade-swatches/SKILL.md +76 -0
  578. package/templates/community/tiktok-makeup-shade-swatches/references/mother-post.md +23 -0
  579. package/templates/community/tiktok-makeup-shade-swatches/source.json +42 -0
  580. package/templates/community/tiktok-makeup-shade-swatches/template.json +57 -0
  581. package/templates/community/tiktok-makeup-unboxing-closeups/README.md +11 -0
  582. package/templates/community/tiktok-makeup-unboxing-closeups/SKILL.md +75 -0
  583. package/templates/community/tiktok-makeup-unboxing-closeups/references/mother-post.md +23 -0
  584. package/templates/community/tiktok-makeup-unboxing-closeups/source.json +36 -0
  585. package/templates/community/tiktok-makeup-unboxing-closeups/template.json +55 -0
  586. package/templates/community/tiktok-mirror-try-on-fit/README.md +13 -0
  587. package/templates/community/tiktok-mirror-try-on-fit/SKILL.md +76 -0
  588. package/templates/community/tiktok-mirror-try-on-fit/references/mother-post.md +23 -0
  589. package/templates/community/tiktok-mirror-try-on-fit/source.json +48 -0
  590. package/templates/community/tiktok-mirror-try-on-fit/template.json +58 -0
  591. package/templates/community/tiktok-modest-fashion-try-on-details/README.md +14 -0
  592. package/templates/community/tiktok-modest-fashion-try-on-details/SKILL.md +75 -0
  593. package/templates/community/tiktok-modest-fashion-try-on-details/references/mother-post.md +23 -0
  594. package/templates/community/tiktok-modest-fashion-try-on-details/source.json +54 -0
  595. package/templates/community/tiktok-modest-fashion-try-on-details/template.json +58 -0
  596. package/templates/community/tiktok-nutrition-drink-mixing/README.md +8 -0
  597. package/templates/community/tiktok-nutrition-drink-mixing/SKILL.md +72 -0
  598. package/templates/community/tiktok-nutrition-drink-mixing/references/mother-post.md +23 -0
  599. package/templates/community/tiktok-nutrition-drink-mixing/source.json +18 -0
  600. package/templates/community/tiktok-nutrition-drink-mixing/template.json +49 -0
  601. package/templates/community/tiktok-one-garment-outfit-ideas/README.md +12 -0
  602. package/templates/community/tiktok-one-garment-outfit-ideas/SKILL.md +76 -0
  603. package/templates/community/tiktok-one-garment-outfit-ideas/references/mother-post.md +23 -0
  604. package/templates/community/tiktok-one-garment-outfit-ideas/source.json +42 -0
  605. package/templates/community/tiktok-one-garment-outfit-ideas/template.json +57 -0
  606. package/templates/community/tiktok-outdoor-apparel-colorway-try-on/README.md +10 -0
  607. package/templates/community/tiktok-outdoor-apparel-colorway-try-on/SKILL.md +74 -0
  608. package/templates/community/tiktok-outdoor-apparel-colorway-try-on/references/mother-post.md +23 -0
  609. package/templates/community/tiktok-outdoor-apparel-colorway-try-on/source.json +30 -0
  610. package/templates/community/tiktok-outdoor-apparel-colorway-try-on/template.json +53 -0
  611. package/templates/community/tiktok-outdoor-electronics-specs/README.md +15 -0
  612. package/templates/community/tiktok-outdoor-electronics-specs/SKILL.md +76 -0
  613. package/templates/community/tiktok-outdoor-electronics-specs/references/mother-post.md +23 -0
  614. package/templates/community/tiktok-outdoor-electronics-specs/source.json +60 -0
  615. package/templates/community/tiktok-outdoor-electronics-specs/template.json +60 -0
  616. package/templates/community/tiktok-outdoor-gear-packing-capacity/README.md +11 -0
  617. package/templates/community/tiktok-outdoor-gear-packing-capacity/SKILL.md +75 -0
  618. package/templates/community/tiktok-outdoor-gear-packing-capacity/references/mother-post.md +23 -0
  619. package/templates/community/tiktok-outdoor-gear-packing-capacity/source.json +36 -0
  620. package/templates/community/tiktok-outdoor-gear-packing-capacity/template.json +55 -0
  621. package/templates/community/tiktok-outdoor-gear-spec-guide/README.md +14 -0
  622. package/templates/community/tiktok-outdoor-gear-spec-guide/SKILL.md +76 -0
  623. package/templates/community/tiktok-outdoor-gear-spec-guide/references/mother-post.md +23 -0
  624. package/templates/community/tiktok-outdoor-gear-spec-guide/source.json +54 -0
  625. package/templates/community/tiktok-outdoor-gear-spec-guide/template.json +59 -0
  626. package/templates/community/tiktok-party-game-interaction/README.md +9 -0
  627. package/templates/community/tiktok-party-game-interaction/SKILL.md +73 -0
  628. package/templates/community/tiktok-party-game-interaction/references/mother-post.md +23 -0
  629. package/templates/community/tiktok-party-game-interaction/source.json +24 -0
  630. package/templates/community/tiktok-party-game-interaction/template.json +51 -0
  631. package/templates/community/tiktok-perfume-mood-fragrance-notes/README.md +11 -0
  632. package/templates/community/tiktok-perfume-mood-fragrance-notes/SKILL.md +75 -0
  633. package/templates/community/tiktok-perfume-mood-fragrance-notes/references/mother-post.md +23 -0
  634. package/templates/community/tiktok-perfume-mood-fragrance-notes/source.json +36 -0
  635. package/templates/community/tiktok-perfume-mood-fragrance-notes/template.json +55 -0
  636. package/templates/community/tiktok-personal-care-tool-accessories/README.md +12 -0
  637. package/templates/community/tiktok-personal-care-tool-accessories/SKILL.md +76 -0
  638. package/templates/community/tiktok-personal-care-tool-accessories/references/mother-post.md +23 -0
  639. package/templates/community/tiktok-personal-care-tool-accessories/source.json +42 -0
  640. package/templates/community/tiktok-personal-care-tool-accessories/template.json +57 -0
  641. package/templates/community/tiktok-pet-product-features-reviews/README.md +9 -0
  642. package/templates/community/tiktok-pet-product-features-reviews/SKILL.md +73 -0
  643. package/templates/community/tiktok-pet-product-features-reviews/references/mother-post.md +23 -0
  644. package/templates/community/tiktok-pet-product-features-reviews/source.json +24 -0
  645. package/templates/community/tiktok-pet-product-features-reviews/template.json +51 -0
  646. package/templates/community/tiktok-pet-product-scenarios-specs/README.md +14 -0
  647. package/templates/community/tiktok-pet-product-scenarios-specs/SKILL.md +76 -0
  648. package/templates/community/tiktok-pet-product-scenarios-specs/references/mother-post.md +23 -0
  649. package/templates/community/tiktok-pet-product-scenarios-specs/source.json +54 -0
  650. package/templates/community/tiktok-pet-product-scenarios-specs/template.json +59 -0
  651. package/templates/community/tiktok-problem-action-product-guide/README.md +10 -0
  652. package/templates/community/tiktok-problem-action-product-guide/SKILL.md +70 -0
  653. package/templates/community/tiktok-problem-action-product-guide/template.json +64 -0
  654. package/templates/community/tiktok-reaction-product-twist/README.md +8 -0
  655. package/templates/community/tiktok-reaction-product-twist/SKILL.md +64 -0
  656. package/templates/community/tiktok-reaction-product-twist/template.json +75 -0
  657. package/templates/community/tiktok-relationship-gift-response/README.md +8 -0
  658. package/templates/community/tiktok-relationship-gift-response/SKILL.md +62 -0
  659. package/templates/community/tiktok-relationship-gift-response/template.json +76 -0
  660. package/templates/community/tiktok-routine-before-after-timeline/README.md +9 -0
  661. package/templates/community/tiktok-routine-before-after-timeline/SKILL.md +73 -0
  662. package/templates/community/tiktok-routine-before-after-timeline/references/mother-post.md +23 -0
  663. package/templates/community/tiktok-routine-before-after-timeline/source.json +24 -0
  664. package/templates/community/tiktok-routine-before-after-timeline/template.json +51 -0
  665. package/templates/community/tiktok-scenery-product-reveal/README.md +8 -0
  666. package/templates/community/tiktok-scenery-product-reveal/SKILL.md +62 -0
  667. package/templates/community/tiktok-scenery-product-reveal/template.json +76 -0
  668. package/templates/community/tiktok-selfie-product-discovery/README.md +8 -0
  669. package/templates/community/tiktok-selfie-product-discovery/SKILL.md +64 -0
  670. package/templates/community/tiktok-selfie-product-discovery/template.json +76 -0
  671. package/templates/community/tiktok-sensory-mood-product-reveal/README.md +8 -0
  672. package/templates/community/tiktok-sensory-mood-product-reveal/SKILL.md +62 -0
  673. package/templates/community/tiktok-sensory-mood-product-reveal/template.json +54 -0
  674. package/templates/community/tiktok-skincare-set-price-comparison/README.md +14 -0
  675. package/templates/community/tiktok-skincare-set-price-comparison/SKILL.md +76 -0
  676. package/templates/community/tiktok-skincare-set-price-comparison/references/mother-post.md +23 -0
  677. package/templates/community/tiktok-skincare-set-price-comparison/source.json +54 -0
  678. package/templates/community/tiktok-skincare-set-price-comparison/template.json +59 -0
  679. package/templates/community/tiktok-sms-product-recommendation/README.md +8 -0
  680. package/templates/community/tiktok-sms-product-recommendation/SKILL.md +62 -0
  681. package/templates/community/tiktok-sms-product-recommendation/template.json +76 -0
  682. package/templates/community/tiktok-snack-flavor-packaging/README.md +11 -0
  683. package/templates/community/tiktok-snack-flavor-packaging/SKILL.md +75 -0
  684. package/templates/community/tiktok-snack-flavor-packaging/references/mother-post.md +23 -0
  685. package/templates/community/tiktok-snack-flavor-packaging/source.json +36 -0
  686. package/templates/community/tiktok-snack-flavor-packaging/template.json +55 -0
  687. package/templates/community/tiktok-social-status-recommendation/README.md +8 -0
  688. package/templates/community/tiktok-social-status-recommendation/SKILL.md +64 -0
  689. package/templates/community/tiktok-social-status-recommendation/template.json +76 -0
  690. package/templates/community/tiktok-sportswear-flat-lay-fabric/README.md +11 -0
  691. package/templates/community/tiktok-sportswear-flat-lay-fabric/SKILL.md +75 -0
  692. package/templates/community/tiktok-sportswear-flat-lay-fabric/references/mother-post.md +23 -0
  693. package/templates/community/tiktok-sportswear-flat-lay-fabric/source.json +36 -0
  694. package/templates/community/tiktok-sportswear-flat-lay-fabric/template.json +55 -0
  695. package/templates/community/tiktok-streetwear-try-on/README.md +12 -0
  696. package/templates/community/tiktok-streetwear-try-on/SKILL.md +76 -0
  697. package/templates/community/tiktok-streetwear-try-on/references/mother-post.md +23 -0
  698. package/templates/community/tiktok-streetwear-try-on/source.json +42 -0
  699. package/templates/community/tiktok-streetwear-try-on/template.json +57 -0
  700. package/templates/community/tiktok-supplement-ingredients-serving-guide/README.md +12 -0
  701. package/templates/community/tiktok-supplement-ingredients-serving-guide/SKILL.md +76 -0
  702. package/templates/community/tiktok-supplement-ingredients-serving-guide/references/mother-post.md +23 -0
  703. package/templates/community/tiktok-supplement-ingredients-serving-guide/source.json +42 -0
  704. package/templates/community/tiktok-supplement-ingredients-serving-guide/template.json +57 -0
  705. package/templates/community/tiktok-tableware-color-set-studio/README.md +9 -0
  706. package/templates/community/tiktok-tableware-color-set-studio/SKILL.md +73 -0
  707. package/templates/community/tiktok-tableware-color-set-studio/references/mother-post.md +23 -0
  708. package/templates/community/tiktok-tableware-color-set-studio/source.json +24 -0
  709. package/templates/community/tiktok-tableware-color-set-studio/template.json +51 -0
  710. package/templates/community/tiktok-themed-book-list-flat-lay/README.md +13 -0
  711. package/templates/community/tiktok-themed-book-list-flat-lay/SKILL.md +76 -0
  712. package/templates/community/tiktok-themed-book-list-flat-lay/references/mother-post.md +23 -0
  713. package/templates/community/tiktok-themed-book-list-flat-lay/source.json +48 -0
  714. package/templates/community/tiktok-themed-book-list-flat-lay/template.json +58 -0
  715. package/templates/community/tiktok-tool-specs-use-steps/README.md +12 -0
  716. package/templates/community/tiktok-tool-specs-use-steps/SKILL.md +76 -0
  717. package/templates/community/tiktok-tool-specs-use-steps/references/mother-post.md +23 -0
  718. package/templates/community/tiktok-tool-specs-use-steps/source.json +42 -0
  719. package/templates/community/tiktok-tool-specs-use-steps/template.json +57 -0
  720. package/templates/community/tiktok-trading-card-edition-guide/README.md +11 -0
  721. package/templates/community/tiktok-trading-card-edition-guide/SKILL.md +75 -0
  722. package/templates/community/tiktok-trading-card-edition-guide/references/mother-post.md +23 -0
  723. package/templates/community/tiktok-trading-card-edition-guide/source.json +36 -0
  724. package/templates/community/tiktok-trading-card-edition-guide/template.json +55 -0
  725. package/templates/community/tiktok-travel-product-problem-solution/README.md +12 -0
  726. package/templates/community/tiktok-travel-product-problem-solution/SKILL.md +76 -0
  727. package/templates/community/tiktok-travel-product-problem-solution/references/mother-post.md +23 -0
  728. package/templates/community/tiktok-travel-product-problem-solution/source.json +42 -0
  729. package/templates/community/tiktok-travel-product-problem-solution/template.json +57 -0
  730. package/templates/community/tiktok-two-choice-gift-recommendation/README.md +8 -0
  731. package/templates/community/tiktok-two-choice-gift-recommendation/SKILL.md +62 -0
  732. package/templates/community/tiktok-two-choice-gift-recommendation/template.json +76 -0
  733. package/templates/community/tiktok-underwear-before-after-styling/README.md +12 -0
  734. package/templates/community/tiktok-underwear-before-after-styling/SKILL.md +76 -0
  735. package/templates/community/tiktok-underwear-before-after-styling/references/mother-post.md +23 -0
  736. package/templates/community/tiktok-underwear-before-after-styling/source.json +42 -0
  737. package/templates/community/tiktok-underwear-before-after-styling/template.json +57 -0
  738. package/templates/community/tiktok-vacuum-cleaning-results/README.md +11 -0
  739. package/templates/community/tiktok-vacuum-cleaning-results/SKILL.md +75 -0
  740. package/templates/community/tiktok-vacuum-cleaning-results/references/mother-post.md +23 -0
  741. package/templates/community/tiktok-vacuum-cleaning-results/source.json +36 -0
  742. package/templates/community/tiktok-vacuum-cleaning-results/template.json +55 -0
  743. package/templates/community/tiktok-warm-clothing-fabric-details/README.md +11 -0
  744. package/templates/community/tiktok-warm-clothing-fabric-details/SKILL.md +75 -0
  745. package/templates/community/tiktok-warm-clothing-fabric-details/references/mother-post.md +23 -0
  746. package/templates/community/tiktok-warm-clothing-fabric-details/source.json +36 -0
  747. package/templates/community/tiktok-warm-clothing-fabric-details/template.json +55 -0
  748. package/templates/community/tiktok-waterproof-footwear-outdoors/README.md +9 -0
  749. package/templates/community/tiktok-waterproof-footwear-outdoors/SKILL.md +73 -0
  750. package/templates/community/tiktok-waterproof-footwear-outdoors/references/mother-post.md +23 -0
  751. package/templates/community/tiktok-waterproof-footwear-outdoors/source.json +24 -0
  752. package/templates/community/tiktok-waterproof-footwear-outdoors/template.json +51 -0
  753. package/templates/generic/commerce-sell/scenario.md +48 -0
  754. package/templates/generic/commerce-sell/source.manifest.json +9 -0
  755. package/templates/generic/commerce-sell/template.html +99 -0
  756. package/templates/generic/commerce-sell/template.json +33 -0
  757. package/templates/generic/comparison/scenario.md +45 -0
  758. package/templates/generic/comparison/source.manifest.json +9 -0
  759. package/templates/generic/comparison/template.html +70 -0
  760. package/templates/generic/comparison/template.json +33 -0
  761. package/templates/generic/curated-list/scenario.md +42 -0
  762. package/templates/generic/curated-list/source.manifest.json +9 -0
  763. package/templates/generic/curated-list/template.html +86 -0
  764. package/templates/generic/curated-list/template.json +33 -0
  765. package/templates/generic/step-guide/scenario.md +45 -0
  766. package/templates/generic/step-guide/source.manifest.json +9 -0
  767. package/templates/generic/step-guide/template.html +91 -0
  768. package/templates/generic/step-guide/template.json +34 -0
  769. package/templates/generic/viewpoint/scenario.md +45 -0
  770. package/templates/generic/viewpoint/source.manifest.json +9 -0
  771. package/templates/generic/viewpoint/template.html +83 -0
  772. package/templates/generic/viewpoint/template.json +34 -0
@@ -0,0 +1,72 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return ee(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function A(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+k(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+k(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(A(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},M={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=M,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=E,D=function(){te.postMessage(null)}}else D=function(){_(E,0)};function k(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],N=-1;function P(e){return{current:e}}function F(e){0>N||(e.current=oe[N],oe[N]=null,N--)}function I(e,t){N++,oe[N]=e.current,e.current=t}var L=P(null),R=P(null),se=P(null),z=P(null);function ce(e,t){switch(I(se,t),I(R,e),I(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(L),I(L,e)}function le(){F(L),F(R),F(se)}function B(e){e.memoizedState!==null&&I(z,e);var t=L.current,n=Wd(t,e.type);t!==n&&(I(R,e),I(L,n))}function V(e){R.current===e&&(F(L),F(R)),z.current===e&&(F(z),Qf._currentValue=ae)}var ue,de;function H(e){if(ue===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ue=t&&t[1]||``,de=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ue+e+de}var fe=!1;function pe(e,t){if(!e||fe)return``;fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?H(n):``}function me(e,t){switch(e.tag){case 26:case 27:case 5:return H(e.type);case 16:return H(`Lazy`);case 13:return e.child!==t&&t!==null?H(`Suspense Fallback`):H(`Suspense`);case 19:return H(`SuspenseList`);case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return H(`Activity`);default:return``}}function he(e){try{var t=``,n=null;do t+=me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var U=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,W=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,xe=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,Ee=t.log,De=t.unstable_setDisableYieldValue,G=null,Oe=null;function ke(e){if(typeof Ee==`function`&&De(e),Oe&&typeof Oe.setStrictMode==`function`)try{Oe.setStrictMode(G,e)}catch{}}var Ae=Math.clz32?Math.clz32:Ne,je=Math.log,Me=Math.LN2;function Ne(e){return e>>>=0,e===0?32:31-(je(e)/Me|0)|0}var Pe=256,Fe=262144,Ie=4194304;function Le(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Re(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Le(n))):i=Le(o):i=Le(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Le(n))):i=Le(o)):i=Le(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Be(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ve(){var e=Ie;return Ie<<=1,!(Ie&62914560)&&(Ie=4194304),e}function He(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ue(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function We(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ae(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ge(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ge(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ae(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ke(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ae(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function qe(e,t){var n=t&-t;return n=n&42?1:Je(n),(n&(e.suspendedLanes|t))===0?n:0}function Je(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ye(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Xe(){var e=M.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function Ze(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var Qe=Math.random().toString(36).slice(2),$e=`__reactFiber$`+Qe,et=`__reactProps$`+Qe,tt=`__reactContainer$`+Qe,nt=`__reactEvents$`+Qe,rt=`__reactListeners$`+Qe,it=`__reactHandles$`+Qe,at=`__reactResources$`+Qe,ot=`__reactMarker$`+Qe;function st(e){delete e[$e],delete e[et],delete e[nt],delete e[rt],delete e[it]}function ct(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tt]||n[$e]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[$e])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function K(e){if(e=e[$e]||e[tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ut(e){var t=e[at];return t||=e[at]={hoistableStyles:new Map,hoistableScripts:new Map},t}function dt(e){e[ot]=!0}var ft=new Set,pt={};function mt(e,t){ht(e,t),ht(e+`Capture`,t)}function ht(e,t){for(pt[e]=t,e=0;e<t.length;e++)ft.add(t[e])}var q=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]*$`),J={},gt={};function _t(e){return U.call(gt,e)?!0:U.call(J,e)?!1:q.test(e)?gt[e]=!0:(J[e]=!0,!1)}function vt(e,t,n){if(_t(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function bt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Y(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function xt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function St(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ct(e){if(!e._valueTracker){var t=xt(e)?`checked`:`value`;e._valueTracker=St(e,t,``+e[t])}}function wt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=xt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Tt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Et=/[\n"\\]/g;function Dt(e){return e.replace(Et,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ot(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Y(t)):e.value!==``+Y(t)&&(e.value=``+Y(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):At(e,o,Y(n)):At(e,o,Y(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Y(s):e.removeAttribute(`name`)}function kt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ct(e);return}n=n==null?``:``+Y(n),t=t==null?n:``+Y(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ct(e)}function At(e,t,n){t===`number`&&Tt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function jt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Y(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Mt(e,t,n){if(t!=null&&(t=``+Y(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Y(n)}function Nt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Y(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ct(e)}function Pt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ft=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 It(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ft.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Lt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&It(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&It(e,o,t[o])}function Rt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 zt=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`]]),Bt=/^[\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 Vt(e){return Bt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Ht(){}var Ut=null;function Wt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gt=null,Kt=null;function qt(e){var t=K(e);if(t&&(e=t.stateNode)){var n=e[et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ot(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Dt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[et]||null;if(!a)throw Error(i(90));Ot(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&wt(r)}break a;case`textarea`:Mt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&jt(e,!!n.multiple,t,!1)}}}var Jt=!1;function Yt(e,t,n){if(Jt)return e(t,n);Jt=!0;try{return e(t)}finally{if(Jt=!1,(Gt!==null||Kt!==null)&&(yu(),Gt&&(t=Gt,e=Kt,Kt=Gt=null,qt(t),e)))for(t=0;t<e.length;t++)qt(e[t])}}function Xt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[et]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Zt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Qt=!1;if(Zt)try{var $t={};Object.defineProperty($t,"passive",{get:function(){Qt=!0}}),window.addEventListener(`test`,$t,$t),window.removeEventListener(`test`,$t,$t)}catch{Qt=!1}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t=tn,n=t.length,r,i=`value`in en?en.value:en.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return nn=i.slice(e,1<r?1-r:void 0)}function an(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function on(){return!0}function sn(){return!1}function cn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?on:sn,this.isPropagationStopped=sn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=on)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=on)},persist:function(){},isPersistent:on}),t}var ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},un=cn(ln),dn=m({},ln,{view:0,detail:0}),fn=cn(dn),pn,mn,hn,gn=m({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==hn&&(hn&&e.type===`mousemove`?(pn=e.screenX-hn.screenX,mn=e.screenY-hn.screenY):mn=pn=0,hn=e),pn)},movementY:function(e){return`movementY`in e?e.movementY:mn}}),_n=cn(gn),vn=cn(m({},gn,{dataTransfer:0})),yn=cn(m({},dn,{relatedTarget:0})),bn=cn(m({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=cn(m({},ln,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Sn=cn(m({},ln,{data:0})),Cn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},wn={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`},Tn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function En(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Tn[e])?!!t[e]:!1}function Dn(){return En}var On=cn(m({},dn,{key:function(e){if(e.key){var t=Cn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=an(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?wn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dn,charCode:function(e){return e.type===`keypress`?an(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?an(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),kn=cn(m({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),An=cn(m({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dn})),jn=cn(m({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mn=cn(m({},gn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Nn=cn(m({},ln,{newState:0,oldState:0})),Pn=[9,13,27,32],Fn=Zt&&`CompositionEvent`in window,In=null;Zt&&`documentMode`in document&&(In=document.documentMode);var Ln=Zt&&`TextEvent`in window&&!In,Rn=Zt&&(!Fn||In&&8<In&&11>=In),zn=` `,Bn=!1;function Vn(e,t){switch(e){case`keyup`:return Pn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Hn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Un=!1;function Wn(e,t){switch(e){case`compositionend`:return Hn(t);case`keypress`:return t.which===32?(Bn=!0,zn):null;case`textInput`:return e=t.data,e===zn&&Bn?null:e;default:return null}}function Gn(e,t){if(Un)return e===`compositionend`||!Fn&&Vn(e,t)?(e=rn(),nn=tn=en=null,Un=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Rn&&t.locale!==`ko`?null:t.data;default:return null}}var Kn={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 qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Kn[e.type]:t===`textarea`}function Jn(e,t,n,r){Gt?Kt?Kt.push(r):Kt=[r]:Gt=r,t=Dd(t,`onChange`),0<t.length&&(n=new un(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Xn=null;function Zn(e){yd(e,0)}function Qn(e){if(wt(lt(e)))return e}function $n(e,t){if(e===`change`)return t}var er=!1;if(Zt){var tr;if(Zt){var nr=`oninput`in document;if(!nr){var rr=document.createElement(`div`);rr.setAttribute(`oninput`,`return;`),nr=typeof rr.oninput==`function`}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function ir(){Yn&&(Yn.detachEvent(`onpropertychange`,ar),Xn=Yn=null)}function ar(e){if(e.propertyName===`value`&&Qn(Xn)){var t=[];Jn(t,Xn,e,Wt(e)),Yt(Zn,t)}}function or(e,t,n){e===`focusin`?(ir(),Yn=t,Xn=n,Yn.attachEvent(`onpropertychange`,ar)):e===`focusout`&&ir()}function sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Qn(Xn)}function cr(e,t){if(e===`click`)return Qn(t)}function lr(e,t){if(e===`input`||e===`change`)return Qn(t)}function ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var dr=typeof Object.is==`function`?Object.is:ur;function fr(e,t){if(dr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!U.call(t,i)||!dr(e[i],t[i]))return!1}return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mr(e,t){var n=pr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=pr(n)}}function hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Tt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tt(e.document)}return t}function _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var vr=Zt&&`documentMode`in document&&11>=document.documentMode,yr=null,br=null,xr=null,Sr=!1;function Cr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sr||yr==null||yr!==Tt(r)||(r=yr,`selectionStart`in r&&_r(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xr&&fr(xr,r)||(xr=r,r=Dd(br,`onSelect`),0<r.length&&(t=new un(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=yr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Tr={animationend:wr(`Animation`,`AnimationEnd`),animationiteration:wr(`Animation`,`AnimationIteration`),animationstart:wr(`Animation`,`AnimationStart`),transitionrun:wr(`Transition`,`TransitionRun`),transitionstart:wr(`Transition`,`TransitionStart`),transitioncancel:wr(`Transition`,`TransitionCancel`),transitionend:wr(`Transition`,`TransitionEnd`)},Er={},Dr={};Zt&&(Dr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Tr.animationend.animation,delete Tr.animationiteration.animation,delete Tr.animationstart.animation),`TransitionEvent`in window||delete Tr.transitionend.transition);function Or(e){if(Er[e])return Er[e];if(!Tr[e])return e;var t=Tr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Dr)return Er[e]=t[n];return e}var kr=Or(`animationend`),Ar=Or(`animationiteration`),jr=Or(`animationstart`),Mr=Or(`transitionrun`),Nr=Or(`transitionstart`),Pr=Or(`transitioncancel`),Fr=Or(`transitionend`),Ir=new Map,Lr=`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(` `);Lr.push(`scrollEnd`);function Rr(e,t){Ir.set(e,t),mt(t,[e])}var zr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Br=[],Vr=0,Hr=0;function Ur(){for(var e=Vr,t=Hr=Vr=0;t<e;){var n=Br[t];Br[t++]=null;var r=Br[t];Br[t++]=null;var i=Br[t];Br[t++]=null;var a=Br[t];if(Br[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&qr(n,i,a)}}function Wr(e,t,n,r){Br[Vr++]=e,Br[Vr++]=t,Br[Vr++]=n,Br[Vr++]=r,Hr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Gr(e,t,n,r){return Wr(e,t,n,r),Jr(e)}function Kr(e,t){return Wr(e,null,null,t),Jr(e)}function qr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ae(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Jr(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Yr={};function Xr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(e,t,n,r){return new Xr(e,t,n,r)}function Qr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return n===null?(n=Zr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ei(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ti(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)Qr(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,L.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=Zr(31,n,t,a),e.elementType=O,e.lanes=o,e;case y:return ni(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=Zr(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=Zr(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=Zr(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Zr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ni(e,t,n,r){return e=Zr(7,e,r,t),e.lanes=n,e}function ri(e,t,n){return e=Zr(6,e,null,t),e.lanes=n,e}function ii(e){var t=Zr(18,null,null,0);return t.stateNode=e,t}function ai(e,t,n){return t=Zr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var oi=new WeakMap;function si(e,t){if(typeof e==`object`&&e){var n=oi.get(e);return n===void 0?(t={value:e,source:t,stack:he(t)},oi.set(e,t),t):n}return{value:e,source:t,stack:he(t)}}var ci=[],li=0,ui=null,di=0,fi=[],pi=0,mi=null,hi=1,gi=``;function _i(e,t){ci[li++]=di,ci[li++]=ui,ui=e,di=t}function vi(e,t,n){fi[pi++]=hi,fi[pi++]=gi,fi[pi++]=mi,mi=e;var r=hi;e=gi;var i=32-Ae(r)-1;r&=~(1<<i),n+=1;var a=32-Ae(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,hi=1<<32-Ae(t)+i|n<<i|r,gi=a+e}else hi=1<<a|n<<i|r,gi=e}function yi(e){e.return!==null&&(_i(e,1),vi(e,1,0))}function bi(e){for(;e===ui;)ui=ci[--li],ci[li]=null,di=ci[--li],ci[li]=null;for(;e===mi;)mi=fi[--pi],fi[pi]=null,gi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null}function xi(e,t){fi[pi++]=hi,fi[pi++]=gi,fi[pi++]=mi,hi=t.id,gi=t.overflow,mi=e}var Si=null,Ci=null,X=!1,wi=null,Ti=!1,Ei=Error(i(519));function Di(e){throw Ni(si(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ei}function Oi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[$e]=e,t[et]=r,n){case`dialog`:bd(`cancel`,t),bd(`close`,t);break;case`iframe`:case`object`:case`embed`:bd(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)bd(_d[n],t);break;case`source`:bd(`error`,t);break;case`img`:case`image`:case`link`:bd(`error`,t),bd(`load`,t);break;case`details`:bd(`toggle`,t);break;case`input`:bd(`invalid`,t),kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:bd(`invalid`,t);break;case`textarea`:bd(`invalid`,t),Nt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Nd(t.textContent,n)?(r.popover!=null&&(bd(`beforetoggle`,t),bd(`toggle`,t)),r.onScroll!=null&&bd(`scroll`,t),r.onScrollEnd!=null&&bd(`scrollend`,t),r.onClick!=null&&(t.onclick=Ht),t=!0):t=!1,t||Di(e,!0)}function ki(e){for(Si=e.return;Si;)switch(Si.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:Si=Si.return}}function Ai(e){if(e!==Si)return!1;if(!X)return ki(e),X=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Gd(e.type,e.memoizedProps)),n=!n),n&&Ci&&Di(e),ki(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ci=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ci=uf(e)}else t===27?(t=Ci,Zd(e.type)?(e=lf,lf=null,Ci=e):Ci=t):Ci=Si?cf(e.stateNode.nextSibling):null;return!0}function ji(){Ci=Si=null,X=!1}function Mi(){var e=wi;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),wi=null),e}function Ni(e){wi===null?wi=[e]:wi.push(e)}var Pi=P(null),Fi=null,Ii=null;function Li(e,t,n){I(Pi,t._currentValue),t._currentValue=n}function Ri(e){e._currentValue=Pi.current,F(Pi)}function zi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Bi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),zi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),zi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Vi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;dr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===z.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Bi(t,e,n,r),t.flags|=262144}function Hi(e){for(e=e.firstContext;e!==null;){if(!dr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ui(e){Fi=e,Ii=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Wi(e){return Ki(Fi,e)}function Gi(e,t){return Fi===null&&Ui(e),Ki(e,t)}function Ki(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ii===null){if(e===null)throw Error(i(308));Ii=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ii=Ii.next=t;return n}var qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ji=t.unstable_scheduleCallback,Yi=t.unstable_NormalPriority,Xi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zi(){return{controller:new qi,data:new Map,refCount:0}}function Qi(e){e.refCount--,e.refCount===0&&Ji(Yi,function(){e.controller.abort()})}var $i=null,ea=0,ta=0,na=null;function ra(e,t){if($i===null){var n=$i=[];ea=0,ta=dd(),na={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ea++,t.then(ia,ia),t}function ia(){if(--ea===0&&$i!==null){na!==null&&(na.status=`fulfilled`);var e=$i;$i=null,ta=0,na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function aa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var oa=j.S;j.S=function(e,t){$l=W(),typeof t==`object`&&t&&typeof t.then==`function`&&ra(e,t),oa!==null&&oa(e,t)};var sa=P(null);function ca(){var e=sa.current;return e===null?Pl.pooledCache:e}function la(e,t){t===null?I(sa,sa.current):I(sa,t.pool)}function ua(){var e=ca();return e===null?null:{parent:Xi._currentValue,pool:e}}var da=Error(i(460)),fa=Error(i(474)),pa=Error(i(542)),ma={then:function(){}};function ha(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ht,Ht),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ba(e),e;default:if(typeof t.status==`string`)t.then(Ht,Ht);else{if(e=Pl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ba(e),e}throw va=t,da}}function _a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(va=e,da):e}}var va=null;function ya(){if(va===null)throw Error(i(459));var e=va;return va=null,e}function ba(e){if(e===da||e===pa)throw Error(i(483))}var xa=null,Sa=0;function Ca(e){var t=Sa;return Sa+=1,xa===null&&(xa=[]),ga(xa,e,t)}function wa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ta(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ea(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=$r(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ri(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&_a(i)===t.type)?(t=a(t,n.props),wa(t,n),t.return=e,t):(t=ti(n.type,n.key,n.props,null,e.mode,r),wa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ai(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ti(t.type,t.key,t.props,null,e.mode,n),wa(n,t),n.return=e,n;case v:return t=ai(t,e.mode,n),t.return=e,t;case D:return t=_a(t),f(e,t,n)}if(ie(t)||A(t))return t=ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ca(t),n);if(t.$$typeof===C)return f(e,Gi(e,t),n);Ta(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=_a(n),p(e,t,n,r)}if(ie(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ca(n),r);if(n.$$typeof===C)return p(e,t,Gi(e,n),r);Ta(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=_a(r),m(e,t,n,r,i)}if(ie(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ca(r),i);if(r.$$typeof===C)return m(e,t,n,Gi(t,r),i);Ta(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),X&&_i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return X&&_i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),X&&_i(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),X&&_i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return X&&_i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),X&&_i(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&_a(l)===r.type){n(e,r.sibling),c=a(r,o.props),wa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=ni(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ti(o.type,o.key,o.props,null,e.mode,c),wa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ai(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=_a(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ca(o),c);if(o.$$typeof===C)return b(e,r,Gi(e,o),c);Ta(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ri(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Sa=0;var i=b(e,t,n,r);return xa=null,i}catch(t){if(t===da||t===pa)throw t;var a=Zr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Da=Ea(!0),Oa=Ea(!1),ka=!1;function Aa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Jr(e),qr(e,null,n),t}return Wr(e,r,t,n),Jr(e)}function Pa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ke(e,n)}}function Fa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ia=!1;function La(){if(Ia){var e=na;if(e!==null)throw e}}function Ra(e,t,n,r){Ia=!1;var i=e.updateQueue;ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Il&f)===f:(r&f)===f){f!==0&&f===ta&&(Ia=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:ka=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ba(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)za(n[e],t)}var Va=P(null),Ha=P(0);function Ua(e,t){e=Hl,I(Ha,e),I(Va,t),Hl=e|t.baseLanes}function Wa(){I(Ha,Hl),I(Va,Va.current)}function Ga(){Hl=Ha.current,F(Va),F(Ha)}var Ka=P(null),qa=null;function Ja(e){var t=e.alternate;I($a,$a.current&1),I(Ka,e),qa===null&&(t===null||Va.current!==null||t.memoizedState!==null)&&(qa=e)}function Ya(e){I($a,$a.current),I(Ka,e),qa===null&&(qa=e)}function Xa(e){e.tag===22?(I($a,$a.current),I(Ka,e),qa===null&&(qa=e)):Za(e)}function Za(){I($a,$a.current),I(Ka,Ka.current)}function Qa(e){F(Ka),qa===e&&(qa=null),F($a)}var $a=P(0);function eo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var to=0,Z=null,no=null,ro=null,io=!1,ao=!1,oo=!1,so=0,co=0,lo=null,uo=0;function fo(){throw Error(i(321))}function po(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dr(e[n],t[n]))return!1;return!0}function mo(e,t,n,r,i,a){return to=a,Z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?js:Ms,oo=!1,a=n(r,i),oo=!1,ao&&(a=go(t,n,r,i)),ho(e),a}function ho(e){j.H=As;var t=no!==null&&no.next!==null;if(to=0,ro=no=Z=null,io=!1,co=0,lo=null,t)throw Error(i(300));e===null||Ys||(e=e.dependencies,e!==null&&Hi(e)&&(Ys=!0))}function go(e,t,n,r){Z=e;var a=0;do{if(ao&&(lo=null),co=0,ao=!1,25<=a)throw Error(i(301));if(a+=1,ro=no=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Ns,o=t(n,r)}while(ao);return o}function _o(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?wo(t):t,e=e.useState()[0],(no===null?null:no.memoizedState)!==e&&(Z.flags|=1024),t}function vo(){var e=so!==0;return so=0,e}function yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bo(e){if(io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}io=!1}to=0,ro=no=Z=null,ao=!1,co=so=0,lo=null}function xo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ro===null?Z.memoizedState=ro=e:ro=ro.next=e,ro}function So(){if(no===null){var e=Z.alternate;e=e===null?null:e.memoizedState}else e=no.next;var t=ro===null?Z.memoizedState:ro.next;if(t!==null)ro=t,no=e;else{if(e===null)throw Z.alternate===null?Error(i(467)):Error(i(310));no=e,e={memoizedState:no.memoizedState,baseState:no.baseState,baseQueue:no.baseQueue,queue:no.queue,next:null},ro===null?Z.memoizedState=ro=e:ro=ro.next=e}return ro}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wo(e){var t=co;return co+=1,lo===null&&(lo=[]),e=ga(lo,e,t),t=Z,(ro===null?t.memoizedState:ro.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?js:Ms),e}function To(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return wo(e);if(e.$$typeof===C)return Wi(e)}throw Error(i(438,String(e)))}function Eo(e){var t=null,n=Z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Z.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Co(),Z.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function Do(e,t){return typeof t==`function`?t(e):t}function Oo(e){return ko(So(),no,e)}function ko(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(to&f)===f:(Il&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ta&&(d=!0);else if((to&p)===p){u=u.next,p===ta&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Z.lanes|=p,Wl|=p;f=u.action,oo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Z.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!dr(o,e.memoizedState)&&(Ys=!0,d&&(n=na,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ao(e){var t=So(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);dr(o,t.memoizedState)||(Ys=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function jo(e,t,n){var r=Z,a=So(),o=X;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!dr((no||a).memoizedState,n);if(s&&(a.memoizedState=n,Ys=!0),a=a.queue,ns(Po.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ro!==null&&ro.memoizedState.tag&1){if(r.flags|=2048,Zo(9,{destroy:void 0},No.bind(null,r,a,n,t),null),Pl===null)throw Error(i(349));o||to&127||Mo(r,t,n)}return n}function Mo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Z.updateQueue,t===null?(t=Co(),Z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function No(e,t,n,r){t.value=n,t.getSnapshot=r,Fo(t)&&Io(e)}function Po(e,t,n){return n(function(){Fo(t)&&Io(e)})}function Fo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dr(e,n)}catch{return!0}}function Io(e){var t=Kr(e,2);t!==null&&mu(t,e,2)}function Lo(e){var t=xo();if(typeof e==`function`){var n=e;if(e=n(),oo){ke(!0);try{n()}finally{ke(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:e},t}function Ro(e,t,n,r){return e.baseState=n,ko(e,no,typeof r==`function`?r:Do)}function zo(e,t,n,r,a){if(Ds(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Bo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Bo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Vo(e,t,s)}catch(n){Uo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Vo(e,t,a)}catch(n){Uo(e,t,n)}}function Vo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ho(e,t,n)},function(n){return Uo(e,t,n)}):Ho(e,t,n)}function Ho(e,t,n){t.status=`fulfilled`,t.value=n,Wo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Bo(e,n)))}function Uo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Wo(t),t=t.next;while(t!==r)}e.action=null}function Wo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Go(e,t){return t}function Ko(e,t){if(X){var n=Pl.formState;if(n!==null){a:{var r=Z;if(X){if(Ci){b:{for(var i=Ci,a=Ti;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ci=cf(i.nextSibling),r=i.data===`F!`;break a}}Di(r)}r=!1}r&&(t=n[0])}}return n=xo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:t},n.queue=r,n=ws.bind(null,Z,r),r.dispatch=n,r=Lo(!1),a=Es.bind(null,Z,!1,r.queue),r=xo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=zo.bind(null,Z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function qo(e){return Jo(So(),no,e)}function Jo(e,t,n){if(t=ko(e,t,Go)[0],e=Oo(Do)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=wo(t)}catch(e){throw e===da?pa:e}else r=t;t=So();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Z.flags|=2048,Zo(9,{destroy:void 0},Yo.bind(null,i,n),null)),[r,a,e]}function Yo(e,t){e.action=t}function Xo(e){var t=So(),n=no;if(n!==null)return Jo(t,n,e);So(),t=t.memoizedState,n=So();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Zo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Z.updateQueue,t===null&&(t=Co(),Z.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Qo(){return So().memoizedState}function $o(e,t,n,r){var i=xo();Z.flags|=e,i.memoizedState=Zo(1|t,{destroy:void 0},n,r===void 0?null:r)}function es(e,t,n,r){var i=So();r=r===void 0?null:r;var a=i.memoizedState.inst;no!==null&&r!==null&&po(r,no.memoizedState.deps)?i.memoizedState=Zo(t,a,n,r):(Z.flags|=e,i.memoizedState=Zo(1|t,a,n,r))}function ts(e,t){$o(8390656,8,e,t)}function ns(e,t){es(2048,8,e,t)}function rs(e){Z.flags|=4;var t=Z.updateQueue;if(t===null)t=Co(),Z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function is(e){var t=So().memoizedState;return rs({ref:t,nextImpl:e}),function(){if(Nl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function as(e,t){return es(4,2,e,t)}function os(e,t){return es(4,4,e,t)}function ss(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cs(e,t,n){n=n==null?null:n.concat([e]),es(4,4,ss.bind(null,t,e),n)}function ls(){}function us(e,t){var n=So();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&po(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ds(e,t){var n=So();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&po(t,r[1]))return r[0];if(r=e(),oo){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r}function fs(e,t,n){return n===void 0||to&1073741824&&!(Il&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),Z.lanes|=e,Wl|=e,n)}function ps(e,t,n,r){return dr(n,t)?n:Va.current===null?!(to&42)||to&1073741824&&!(Il&261930)?(Ys=!0,e.memoizedState=n):(e=pu(),Z.lanes|=e,Wl|=e,t):(e=fs(e,n,r),dr(e,t)||(Ys=!0),e)}function ms(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Es(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ts(e,t,aa(c,r),fu(e)):Ts(e,t,r,fu(e))}catch(n){Ts(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function hs(){}function gs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=_s(e).queue;ms(e,a,t,ae,n===null?hs:function(){return vs(e),n(r)})}function _s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vs(e){var t=_s(e);t.next===null&&(t=e.alternate.memoizedState),Ts(e,t.next.queue,{},fu())}function ys(){return Wi(Qf)}function bs(){return So().memoizedState}function xs(){return So().memoizedState}function Ss(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ma(n);var r=Na(t,e,n);r!==null&&(mu(r,t,n),Pa(r,t,n)),t={cache:Zi()},e.payload=t;return}t=t.return}}function Cs(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Os(t,n):(n=Gr(e,t,n,r),n!==null&&(mu(n,e,r),ks(n,t,r)))}function ws(e,t,n){Ts(e,t,n,fu())}function Ts(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Os(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,dr(s,o))return Wr(e,t,i,0),Pl===null&&Ur(),!1}catch{}if(n=Gr(e,t,i,r),n!==null)return mu(n,e,r),ks(n,t,r),!0}return!1}function Es(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(i(479))}else t=Gr(e,n,r,2),t!==null&&mu(t,e,2)}function Ds(e){var t=e.alternate;return e===Z||t!==null&&t===Z}function Os(e,t){ao=io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ks(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ke(e,n)}}var As={readContext:Wi,use:To,useCallback:fo,useContext:fo,useEffect:fo,useImperativeHandle:fo,useLayoutEffect:fo,useInsertionEffect:fo,useMemo:fo,useReducer:fo,useRef:fo,useState:fo,useDebugValue:fo,useDeferredValue:fo,useTransition:fo,useSyncExternalStore:fo,useId:fo,useHostTransitionStatus:fo,useFormState:fo,useActionState:fo,useOptimistic:fo,useMemoCache:fo,useCacheRefresh:fo};As.useEffectEvent=fo;var js={readContext:Wi,use:To,useCallback:function(e,t){return xo().memoizedState=[e,t===void 0?null:t],e},useContext:Wi,useEffect:ts,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),$o(4194308,4,ss.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $o(4194308,4,e,t)},useInsertionEffect:function(e,t){$o(4,2,e,t)},useMemo:function(e,t){var n=xo();t=t===void 0?null:t;var r=e();if(oo){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=xo();if(n!==void 0){var i=n(t);if(oo){ke(!0);try{n(t)}finally{ke(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Cs.bind(null,Z,e),[r.memoizedState,e]},useRef:function(e){var t=xo();return e={current:e},t.memoizedState=e},useState:function(e){e=Lo(e);var t=e.queue,n=ws.bind(null,Z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ls,useDeferredValue:function(e,t){return fs(xo(),e,t)},useTransition:function(){var e=Lo(!1);return e=ms.bind(null,Z,e.queue,!0,!1),xo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Z,a=xo();if(X){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Pl===null)throw Error(i(349));Il&127||Mo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ts(Po.bind(null,r,o,e),[e]),r.flags|=2048,Zo(9,{destroy:void 0},No.bind(null,r,o,n,t),null),n},useId:function(){var e=xo(),t=Pl.identifierPrefix;if(X){var n=gi,r=hi;n=(r&~(1<<32-Ae(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=so++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ys,useFormState:Ko,useActionState:Ko,useOptimistic:function(e){var t=xo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Es.bind(null,Z,!0,n),n.dispatch=t,[e,t]},useMemoCache:Eo,useCacheRefresh:function(){return xo().memoizedState=Ss.bind(null,Z)},useEffectEvent:function(e){var t=xo(),n={impl:e};return t.memoizedState=n,function(){if(Nl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ms={readContext:Wi,use:To,useCallback:us,useContext:Wi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Oo,useRef:Qo,useState:function(){return Oo(Do)},useDebugValue:ls,useDeferredValue:function(e,t){return ps(So(),no.memoizedState,e,t)},useTransition:function(){var e=Oo(Do)[0],t=So().memoizedState;return[typeof e==`boolean`?e:wo(e),t]},useSyncExternalStore:jo,useId:bs,useHostTransitionStatus:ys,useFormState:qo,useActionState:qo,useOptimistic:function(e,t){return Ro(So(),no,e,t)},useMemoCache:Eo,useCacheRefresh:xs};Ms.useEffectEvent=is;var Ns={readContext:Wi,use:To,useCallback:us,useContext:Wi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Ao,useRef:Qo,useState:function(){return Ao(Do)},useDebugValue:ls,useDeferredValue:function(e,t){var n=So();return no===null?fs(n,e,t):ps(n,no.memoizedState,e,t)},useTransition:function(){var e=Ao(Do)[0],t=So().memoizedState;return[typeof e==`boolean`?e:wo(e),t]},useSyncExternalStore:jo,useId:bs,useHostTransitionStatus:ys,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){var n=So();return no===null?(n.baseState=e,[e,n.queue.dispatch]):Ro(n,no,e,t)},useMemoCache:Eo,useCacheRefresh:xs};Ns.useEffectEvent=is;function Ps(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ma(r);i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(mu(t,e,r),Pa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ma(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(mu(t,e,r),Pa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Ma(n);r.tag=2,t!=null&&(r.callback=t),t=Na(e,r,n),t!==null&&(mu(t,e,n),Pa(t,e,n))}};function Is(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!fr(n,r)||!fr(i,a):!0}function Ls(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Fs.enqueueReplaceState(t,t.state,null)}function Rs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function zs(e){zr(e)}function Bs(e){console.error(e)}function Vs(e){zr(e)}function Hs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Us(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ws(e,t,n){return n=Ma(n),n.tag=3,n.payload={element:null},n.callback=function(){Hs(e,t)},n}function Gs(e){return e=Ma(e),e.tag=3,e}function Ks(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Us(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Us(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Vi(t,n,a,!0),n=Ka.current,n!==null){switch(n.tag){case 31:case 13:return qa===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Eu(),!1}if(X)return t=Ka.current,t===null?(r!==Ei&&(t=Error(i(423),{cause:r}),Ni(si(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=si(r,n),a=Ws(e.stateNode,r,a),Fa(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ei&&(e=Error(i(422),{cause:r}),Ni(si(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=si(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=si(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ws(n.stateNode,r,e),Fa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Gs(a),Ks(a,e,n,r),Fa(n,a),!1}n=n.return}while(n!==null);return!1}var Js=Error(i(461)),Ys=!1;function Xs(e,t,n,r){t.child=e===null?Oa(t,null,n,r):Da(t,e.child,n,r)}function Zs(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ui(t),r=mo(e,t,n,o,a,i),s=vo(),e!==null&&!Ys?(yo(e,t,i),xc(e,t,i)):(X&&s&&yi(t),t.flags|=1,Xs(e,t,r,i),t.child)}function Qs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Qr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,$s(e,t,a,r,i)):(e=ti(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Sc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?fr:n,n(o,r)&&e.ref===t.ref)return xc(e,t,i)}return t.flags|=1,e=$r(a,r),e.ref=t.ref,e.return=t,t.child=e}function $s(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(fr(a,r)&&e.ref===t.ref){if(Ys=!1,t.pendingProps=r=a,Sc(e,i))e.flags&131072&&(Ys=!0);else return t.lanes=e.lanes,xc(e,t,i)}}return sc(e,t,n,r,i)}function ec(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&la(t,a===null?null:a.cachePool),a===null?Wa():Ua(t,a),Xa(t);else return r=t.lanes=536870912,nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&la(t,null),Wa(),Za(t)):(la(t,a.cachePool),Ua(t,a),Za(t),t.memoizedState=null);return Xs(e,t,i,n),t.child}function tc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nc(e,t,n,r,i){var a=ca();return a=a===null?null:{parent:Xi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&la(t,null),Wa(),Xa(t),e!==null&&Vi(e,t,r,!0),t.childLanes=i,null}function rc(e,t){return t=gc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ic(e,t,n){return Da(t,e.child,null,n),e=rc(t,t.pendingProps),e.flags|=2,Qa(t),t.memoizedState=null,e}function ac(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(X){if(r.mode===`hidden`)return e=rc(t,r),t.lanes=536870912,tc(null,e);if(Ya(t),(e=Ci)?(e=rf(e,Ti),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mi===null?null:{id:hi,overflow:gi},retryLane:536870912,hydrationErrors:null},n=ii(e),n.return=t,t.child=n,Si=t,Ci=null)):e=null,e===null)throw Di(t);return t.lanes=536870912,null}return rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ya(t),a){if(t.flags&256)t.flags&=-257,t=ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ys||Vi(e,t,n,!1),a=(n&e.childLanes)!==0,Ys||a){if(r=Pl,r!==null&&(s=qe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Kr(e,s),mu(r,e,s),Js;Eu(),t=ic(e,t,n)}else e=o.treeContext,Ci=cf(s.nextSibling),Si=t,X=!0,wi=null,Ti=!1,e!==null&&xi(t,e),t=rc(t,r),t.flags|=4096;return t}return e=$r(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function oc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function sc(e,t,n,r,i){return Ui(t),n=mo(e,t,n,r,void 0,i),r=vo(),e!==null&&!Ys?(yo(e,t,i),xc(e,t,i)):(X&&r&&yi(t),t.flags|=1,Xs(e,t,n,i),t.child)}function cc(e,t,n,r,i,a){return Ui(t),t.updateQueue=null,n=go(t,r,n,i),ho(e),r=vo(),e!==null&&!Ys?(yo(e,t,a),xc(e,t,a)):(X&&r&&yi(t),t.flags|=1,Xs(e,t,n,a),t.child)}function lc(e,t,n,r,i){if(Ui(t),t.stateNode===null){var a=Yr,o=n.contextType;typeof o==`object`&&o&&(a=Wi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Fs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Aa(t),o=n.contextType,a.context=typeof o==`object`&&o?Wi(o):Yr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ps(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Fs.enqueueReplaceState(a,a.state,null),Ra(t,r,a,i),La(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Rs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Yr,typeof u==`object`&&u&&(o=Wi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ls(t,a,r,o),ka=!1;var f=t.memoizedState;a.state=f,Ra(t,r,a,i),La(),l=t.memoizedState,s||f!==l||ka?(typeof d==`function`&&(Ps(t,n,d,r),l=t.memoizedState),(c=ka||Is(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ja(e,t),o=t.memoizedProps,u=Rs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Yr,typeof l==`object`&&l&&(c=Wi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ls(t,a,r,c),ka=!1,f=t.memoizedState,a.state=f,Ra(t,r,a,i),La();var p=t.memoizedState;o!==d||f!==p||ka||e!==null&&e.dependencies!==null&&Hi(e.dependencies)?(typeof s==`function`&&(Ps(t,n,s,r),p=t.memoizedState),(u=ka||Is(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Hi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,oc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Da(t,e.child,null,i),t.child=Da(t,null,n,i)):Xs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=xc(e,t,i),e}function uc(e,t,n,r){return ji(),t.flags|=256,Xs(e,t,n,r),t.child}var dc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fc(e){return{baseLanes:e,cachePool:ua()}}function pc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function mc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!($a.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(X){if(a?Ja(t):Za(t),(e=Ci)?(e=rf(e,Ti),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mi===null?null:{id:hi,overflow:gi},retryLane:536870912,hydrationErrors:null},n=ii(e),n.return=t,t.child=n,Si=t,Ci=null)):e=null,e===null)throw Di(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Za(t),a=t.mode,c=gc({mode:`hidden`,children:c},a),r=ni(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=fc(n),r.childLanes=pc(e,s,n),t.memoizedState=dc,tc(null,r)):(Ja(t),hc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ja(t),t.flags&=-257,t=_c(e,t,n)):t.memoizedState===null?(Za(t),c=r.fallback,a=t.mode,r=gc({mode:`visible`,children:r.children},a),c=ni(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Da(t,e.child,null,n),r=t.child,r.memoizedState=fc(n),r.childLanes=pc(e,s,n),t.memoizedState=dc,t=tc(null,r)):(Za(t),t.child=e.child,t.flags|=128,t=null);else if(Ja(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ni({value:r,source:null,stack:null}),t=_c(e,t,n)}else if(Ys||Vi(e,t,n,!1),s=(n&e.childLanes)!==0,Ys||s){if(s=Pl,s!==null&&(r=qe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Kr(e,r),mu(s,e,r),Js;af(c)||Eu(),t=_c(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ci=cf(c.nextSibling),Si=t,X=!0,wi=null,Ti=!1,e!==null&&xi(t,e),t=hc(t,r.children),t.flags|=4096);return t}return a?(Za(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=$r(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ni(c,a,n,null),c.flags|=2):c=$r(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,tc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=fc(n):(a=c.cachePool,a===null?a=ua():(l=Xi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=pc(e,s,n),t.memoizedState=dc,tc(e.child,r)):(Ja(t),n=e.child,e=n.sibling,n=$r(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function hc(e,t){return t=gc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function gc(e,t){return e=Zr(22,e,null,t),e.lanes=0,e}function _c(e,t,n){return Da(t,e.child,null,n),e=hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zi(e.return,t,n)}function yc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function bc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=$a.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,I($a,o),Xs(e,t,r,n),r=X?di:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vc(e,n,t);else if(e.tag===19)vc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&eo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),yc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&eo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}yc(t,!0,n,null,a,r);break;case`together`:yc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function xc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Vi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=$r(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$r(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Hi(e)))}function Cc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Li(t,Xi,e.memoizedState.cache),ji();break;case 27:case 5:B(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Li(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ya(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ja(t),e=xc(e,t,n),e===null?null:e.sibling):mc(e,t,n):(Ja(t),t.flags|=128,null);Ja(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Vi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return bc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I($a,$a.current),r)break;return null;case 22:return t.lanes=0,ec(e,t,n,t.pendingProps);case 24:Li(t,Xi,e.memoizedState.cache)}return xc(e,t,n)}function wc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ys=!0;else{if(!Sc(e,n)&&!(t.flags&128))return Ys=!1,Cc(e,t,n);Ys=!!(e.flags&131072)}}else Ys=!1,X&&t.flags&1048576&&vi(t,di,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=_a(t.elementType),t.type=e,typeof e==`function`)Qr(e)?(r=Rs(e,r),t.tag=1,t=lc(null,t,e,r,n)):(t.tag=0,t=sc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Zs(null,t,e,r,n);break a}if(a===E){t.tag=14,t=Qs(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return sc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Rs(r,t.pendingProps),lc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ja(e,t),Ra(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Li(t,Xi,r),r!==o.cache&&Bi(t,[Xi],n,!0),La(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=uc(e,t,r,n);break a}if(r!==a){a=si(Error(i(424)),t),Ni(a),t=uc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ci=cf(e.firstChild),Si=t,X=!0,wi=null,Ti=!0,n=Oa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ji(),r===a){t=xc(e,t,n);break a}Xs(e,t,r,n)}t=t.child}return t;case 26:return oc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:X||(n=t.type,e=t.pendingProps,r=Hd(se.current).createElement(n),r[$e]=t,r[et]=e,Id(r,n,e),dt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return B(t),e===null&&X&&(r=t.stateNode=ff(t.type,t.pendingProps,se.current),Si=t,Ti=!0,a=Ci,Zd(t.type)?(lf=a,Ci=cf(r.firstChild)):Ci=a),Xs(e,t,t.pendingProps.children,n),oc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&X&&((a=r=Ci)&&(r=tf(r,t.type,t.pendingProps,Ti),r===null?a=!1:(t.stateNode=r,Si=t,Ci=cf(r.firstChild),Ti=!1,a=!0)),a||Di(t)),B(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=mo(e,t,_o,null,null,n),Qf._currentValue=a),oc(e,t),Xs(e,t,r,n),t.child;case 6:return e===null&&X&&((e=n=Ci)&&(n=nf(n,t.pendingProps,Ti),n===null?e=!1:(t.stateNode=n,Si=t,Ci=null,e=!0)),e||Di(t)),null;case 13:return mc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Da(t,null,r,n):Xs(e,t,r,n),t.child;case 11:return Zs(e,t,t.type,t.pendingProps,n);case 7:return Xs(e,t,t.pendingProps,n),t.child;case 8:return Xs(e,t,t.pendingProps.children,n),t.child;case 12:return Xs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Li(t,t.type,r.value),Xs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ui(t),a=Wi(a),r=r(a),t.flags|=1,Xs(e,t,r,n),t.child;case 14:return Qs(e,t,t.type,t.pendingProps,n);case 15:return $s(e,t,t.type,t.pendingProps,n);case 19:return bc(e,t,n);case 31:return ac(e,t,n);case 22:return ec(e,t,n,t.pendingProps);case 24:return Ui(t),r=Wi(Xi),e===null?(a=ca(),a===null&&(a=Pl,o=Zi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Aa(t),Li(t,Xi,a)):((e.lanes&n)!==0&&(ja(e,t),Ra(t,null,null,n),La()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Li(t,Xi,r),r!==a.cache&&Bi(t,[Xi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Li(t,Xi,r))),Xs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Tc(e){e.flags|=4}function Ec(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Cu())e.flags|=8192;else throw va=ma,fa}}else e.flags&=-16777217}function Dc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t)){if(Cu())e.flags|=8192;else throw va=ma,fa}}function Oc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ve(),e.lanes|=t,Jl|=t)}function kc(e,t){if(!X)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ac(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function jc(e,t,n){var r=t.pendingProps;switch(bi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ac(t),null;case 1:return Ac(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ri(Xi),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ai(t)?Tc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Mi())),Ac(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Tc(t),o===null?(Ac(t),Ec(t,a,null,r,n)):(Ac(t),Dc(t,o))):o?o===e.memoizedState?(Ac(t),t.flags&=-16777217):(Tc(t),Ac(t),Dc(t,o)):(e=e.memoizedProps,e!==r&&Tc(t),Ac(t),Ec(t,a,e,r,n)),null;case 27:if(V(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ac(t),null}e=L.current,Ai(t)?Oi(t,e):(e=ff(a,r,n),t.stateNode=e,Tc(t))}return Ac(t),null;case 5:if(V(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ac(t),null}if(o=L.current,Ai(t))Oi(t,o);else{var s=Hd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[$e]=t,o[et]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Id(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Tc(t)}}return Ac(t),Ec(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Ai(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Si,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[$e]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Di(t,!0)}else e=Hd(e).createTextNode(r),e[$e]=t,t.stateNode=e}return Ac(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ai(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[$e]=t}else ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ac(t),e=!1}else n=Mi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qa(t),t):(Qa(t),null);if(t.flags&128)throw Error(i(558))}return Ac(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ai(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[$e]=t}else ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ac(t),a=!1}else a=Mi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Qa(t),t):(Qa(t),null)}return Qa(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Oc(t,t.updateQueue),Ac(t),null);case 4:return le(),e===null&&Cd(t.stateNode.containerInfo),Ac(t),null;case 10:return Ri(t.type),Ac(t),null;case 19:if(F($a),r=t.memoizedState,r===null)return Ac(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)kc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=eo(e),o!==null){for(t.flags|=128,kc(r,!1),e=o.updateQueue,t.updateQueue=e,Oc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ei(n,e),n=n.sibling;return I($a,$a.current&1|2),X&&_i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&W()>eu&&(t.flags|=128,a=!0,kc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=eo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Oc(t,e),kc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!X)return Ac(t),null}else 2*W()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,kc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ac(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=W(),e.sibling=null,n=$a.current,I($a,a?n&1|2:n&1),X&&_i(t,r.treeForkCount),e);case 22:case 23:return Qa(t),Ga(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ac(t),t.subtreeFlags&6&&(t.flags|=8192)):Ac(t),n=t.updateQueue,n!==null&&Oc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&F(sa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ri(Xi),Ac(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Mc(e,t){switch(bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ri(Xi),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return V(t),null;case 31:if(t.memoizedState!==null){if(Qa(t),t.alternate===null)throw Error(i(340));ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F($a),null;case 4:return le(),null;case 10:return Ri(t.type),null;case 22:case 23:return Qa(t),Ga(),e!==null&&F(sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ri(Xi),null;case 25:return null;default:return null}}function Nc(e,t){switch(bi(t),t.tag){case 3:Ri(Xi),le();break;case 26:case 27:case 5:V(t);break;case 4:le();break;case 31:t.memoizedState!==null&&Qa(t);break;case 13:Qa(t);break;case 19:F($a);break;case 10:Ri(t.type);break;case 22:case 23:Qa(t),Ga(),e!==null&&F(sa);break;case 24:Ri(Xi)}}function Pc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Wu(t,t.return,e)}}function Fc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Ic(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ba(t,n)}catch(t){Wu(e,e.return,t)}}}function Lc(e,t,n){n.props=Rs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function Rc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Wu(e,t,n)}}function zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Wu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Wu(e,t,n)}else n.current=null}}function Bc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Wu(e,e.return,t)}}function Vc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[et]=t}catch(t){Wu(e,e.return,t)}}function Hc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Uc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Hc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ht));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Wc(e,t,n),e=e.sibling;e!==null;)Wc(e,t,n),e=e.sibling}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[$e]=e,t[et]=n}catch(t){Wu(e,e.return,t)}}var qc=!1,Jc=!1,Yc=!1,Xc=typeof WeakSet==`function`?WeakSet:Set,Zc=null;function Qc(e,t){if(e=e.containerInfo,Bd=sp,e=gr(e),_r(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Vd={focusedElem:e,selectionRange:n},sp=!1,Zc=t;Zc!==null;)if(t=Zc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Zc=e;else for(;Zc!==null;){switch(t=Zc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Rs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Wu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Zc=e;break}Zc=t.return}}function $c(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ml(e,n),r&4&&Pc(5,n);break;case 1:if(ml(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Wu(n,n.return,e)}else{var i=Rs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Wu(n,n.return,e)}}}r&64&&Ic(n),r&512&&Rc(n,n.return);break;case 3:if(ml(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ba(e,t)}catch(e){Wu(n,n.return,e)}}break;case 27:t===null&&r&4&&Kc(n);case 26:case 5:ml(e,n),t===null&&r&4&&Bc(n),r&512&&Rc(n,n.return);break;case 12:ml(e,n);break;case 31:ml(e,n),r&4&&al(e,n);break;case 13:ml(e,n),r&4&&ol(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||qc,!r){t=t!==null&&t.memoizedState!==null||Jc,i=qc;var a=Jc;qc=r,(Jc=t)&&!a?gl(e,n,!!(n.subtreeFlags&8772)):ml(e,n),qc=i,Jc=a}break;case 30:break;default:ml(e,n)}}function el(e){var t=e.alternate;t!==null&&(e.alternate=null,el(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&st(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var tl=null,nl=!1;function rl(e,t,n){for(n=n.child;n!==null;)il(e,t,n),n=n.sibling}function il(e,t,n){if(Oe&&typeof Oe.onCommitFiberUnmount==`function`)try{Oe.onCommitFiberUnmount(G,n)}catch{}switch(n.tag){case 26:Jc||zc(n,t),rl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Jc||zc(n,t);var r=tl,i=nl;Zd(n.type)&&(tl=n.stateNode,nl=!1),rl(e,t,n),pf(n.stateNode),tl=r,nl=i;break;case 5:Jc||zc(n,t);case 6:if(r=tl,i=nl,tl=null,rl(e,t,n),tl=r,nl=i,tl!==null){if(nl)try{(tl.nodeType===9?tl.body:tl.nodeName===`HTML`?tl.ownerDocument.body:tl).removeChild(n.stateNode)}catch(e){Wu(n,t,e)}else try{tl.removeChild(n.stateNode)}catch(e){Wu(n,t,e)}}break;case 18:tl!==null&&(nl?(e=tl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(tl,n.stateNode));break;case 4:r=tl,i=nl,tl=n.stateNode.containerInfo,nl=!0,rl(e,t,n),tl=r,nl=i;break;case 0:case 11:case 14:case 15:Fc(2,n,t),Jc||Fc(4,n,t),rl(e,t,n);break;case 1:Jc||(zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Lc(n,t,r)),rl(e,t,n);break;case 21:rl(e,t,n);break;case 22:Jc=(r=Jc)||n.memoizedState!==null,rl(e,t,n),Jc=r;break;default:rl(e,t,n)}}function al(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Wu(t,t.return,e)}}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Wu(t,t.return,e)}}function sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xc),t;default:throw Error(i(435,e.tag))}}function cl(e,t){var n=sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function ll(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){tl=c.stateNode,nl=!1;break a}break;case 5:tl=c.stateNode,nl=!1;break a;case 3:case 4:tl=c.stateNode.containerInfo,nl=!0;break a}c=c.return}if(tl===null)throw Error(i(160));il(o,s,a),tl=null,nl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)dl(t,e),t=t.sibling}var ul=null;function dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ll(t,e),fl(e),r&4&&(Fc(3,e,e.return),Pc(3,e),Fc(5,e,e.return));break;case 1:ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),r&64&&qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ul;if(ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ot]||o[$e]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[$e]=e,dt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[$e]=e,dt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode)}else e.stateNode=If(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Vc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),n!==null&&r&4&&Vc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),e.flags&32){a=e.stateNode;try{Pt(a,``)}catch(t){Wu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Vc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Yc=!0);break;case 6:if(ll(t,e),fl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Wu(e,e.return,t)}}break;case 3:if(Bf=null,a=ul,ul=gf(t.containerInfo),ll(t,e),ul=a,fl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Wu(e,e.return,t)}Yc&&(Yc=!1,pl(e));break;case 4:r=ul,ul=gf(e.stateNode.containerInfo),ll(t,e),fl(e),ul=r;break;case 12:ll(t,e),fl(e);break;case 31:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 13:ll(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=W()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=qc,d=Jc;if(qc=u||a,Jc=d||l,ll(t,e),Jc=d,qc=u,fl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||qc||Jc||hl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Wu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Wu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Wu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,cl(e,n))));break;case 19:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 30:break;case 21:break;default:ll(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Hc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Gc(e,Uc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Pt(o,``),n.flags&=-33),Gc(e,Uc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Wc(e,Uc(e),s);break;default:throw Error(i(161))}}catch(t){Wu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$c(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fc(4,t,t.return),hl(t);break;case 1:zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Lc(t,t.return,n),hl(t);break;case 27:pf(t.stateNode);case 26:case 5:zc(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function gl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:gl(i,a,n),Pc(4,a);break;case 1:if(gl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Wu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)za(c[i],s)}catch(e){Wu(r,r.return,e)}}n&&o&64&&Ic(a),Rc(a,a.return);break;case 27:Kc(a);case 26:case 5:gl(i,a,n),n&&r===null&&o&4&&Bc(a),Rc(a,a.return);break;case 12:gl(i,a,n);break;case 31:gl(i,a,n),n&&o&4&&al(i,a);break;case 13:gl(i,a,n),n&&o&4&&ol(i,a);break;case 22:a.memoizedState===null&&gl(i,a,n),Rc(a,a.return);break;case 30:break;default:gl(i,a,n)}t=t.sibling}}function _l(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Qi(n))}function vl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qi(e))}function yl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:yl(e,t,n,r),i&2048&&Pc(9,t);break;case 1:yl(e,t,n,r);break;case 3:yl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qi(e)));break;case 12:if(i&2048){yl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Wu(t,t.return,e)}}else yl(e,t,n,r);break;case 31:yl(e,t,n,r);break;case 13:yl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?yl(e,t,n,r):(a._visibility|=2,xl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?yl(e,t,n,r):Sl(e,t),i&2048&&_l(o,t);break;case 24:yl(e,t,n,r),i&2048&&vl(t.alternate,t);break;default:yl(e,t,n,r)}}function xl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:xl(a,o,s,c,i),Pc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,xl(a,o,s,c,i)):u._visibility&2?xl(a,o,s,c,i):Sl(a,o),i&&l&2048&&_l(o.alternate,o);break;case 24:xl(a,o,s,c,i),i&&l&2048&&vl(o.alternate,o);break;default:xl(a,o,s,c,i)}t=t.sibling}}function Sl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Sl(n,r),i&2048&&_l(r.alternate,r);break;case 24:Sl(n,r),i&2048&&vl(r.alternate,r);break;default:Sl(n,r)}t=t.sibling}}var Cl=8192;function wl(e,t,n){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)Tl(e,t,n),e=e.sibling}function Tl(e,t,n){switch(e.tag){case 26:wl(e,t,n),e.flags&Cl&&e.memoizedState!==null&&Gf(n,ul,e.memoizedState,e.memoizedProps);break;case 5:wl(e,t,n);break;case 3:case 4:var r=ul;ul=gf(e.stateNode.containerInfo),wl(e,t,n),ul=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,wl(e,t,n),Cl=r):wl(e,t,n));break;default:wl(e,t,n)}}function El(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ol(e),e=e.sibling}function Ol(e){switch(e.tag){case 0:case 11:case 15:Dl(e),e.flags&2048&&Fc(9,e,e.return);break;case 3:Dl(e);break;case 12:Dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kl(e)):Dl(e);break;default:Dl(e)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fc(8,t,t.return),kl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kl(t));break;default:kl(t)}e=e.sibling}}function Al(e,t){for(;Zc!==null;){var n=Zc;switch(n.tag){case 0:case 11:case 15:Fc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Qi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zc=r;else a:for(n=e;Zc!==null;){r=Zc;var i=r.sibling,a=r.return;if(el(r),r===n){Zc=null;break a}if(i!==null){i.return=a,Zc=i;break a}Zc=a}}}var jl={getCacheForType:function(e){var t=Wi(Xi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Wi(Xi).controller.signal}},Ml=typeof WeakMap==`function`?WeakMap:Map,Nl=0,Pl=null,Fl=null,Il=0,Ll=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return Nl&2&&Il!==0?Il&-Il:j.T===null?Xe():dd()}function pu(){if(ql===0){if(!(Il&536870912)||X){var e=Fe;Fe<<=1,!(Fe&3932160)&&(Fe=262144),ql=e}else ql=536870912}return e=Ka.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Pl&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,Il,ql,!1)),Ue(e,n),(!(Nl&2)||e!==Pl)&&(e===Pl&&(!(Nl&2)&&(Gl|=n),Ul===4&&vu(e,Il,ql,!1)),rd(e))}function hu(e,t,n){if(Nl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ze(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}if(n=e.current.alternate,o&&!_u(n)){a=Du(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-W(),10<a)){if(vu(r,t,ql,!zl),Re(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Jd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}break}while(1);rd(e)}function gu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ht},Tl(t,a,d);var m=(a&62914560)===a?Ql-W():(a&4194048)===a?$l-W():0;if(m=qf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!dr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ae(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ge(e,n,t)}function yu(){return Nl&6?!0:(id(0,!1),!1)}function bu(){if(Fl!==null){if(Ll===0)var e=Fl.return;else e=Fl,Ii=Fi=null,bo(e),xa=null,Sa=0,e=Fl;for(;e!==null;)Nc(e.alternate,e),e=e.return;Fl=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Q(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Pl=e,Fl=n=$r(e.current,null),Il=t,Ll=0,Rl=null,zl=!1,Bl=ze(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ae(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Ur(),n}function Su(e,t){Z=null,j.H=As,t===da||t===pa?(t=ya(),Ll=3):t===fa?(t=ya(),Ll=4):Ll=t===Js?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Fl===null&&(Ul=1,Hs(e,si(t,e.current)))}function Cu(){var e=Ka.current;return e===null?!0:(Il&4194048)===Il?qa===null:(Il&62914560)===Il||Il&536870912?e===qa:!1}function wu(){var e=j.H;return j.H=As,e===null?As:e}function Tu(){var e=j.A;return j.A=jl,e}function Eu(){Ul=4,zl||(Il&4194048)!==Il&&Ka.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Pl===null||vu(Pl,Il,ql,!1)}function Du(e,t,n){var r=Nl;Nl|=2;var i=wu(),a=Tu();(Pl!==e||Il!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Ll!==0&&Fl!==null){var s=Fl,c=Rl;switch(Ll){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:Ka.current===null&&(t=!0);var l=Ll;if(Ll=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Ll,Ll=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Ii=Fi=null,Nl=r,j.H=i,j.A=a,Fl===null&&(Pl=null,Il=0,Ur()),o}function Ou(){for(;Fl!==null;)ju(Fl)}function ku(e,t){var n=Nl;Nl|=2;var r=wu(),a=Tu();Pl!==e||Il!==t?(tu=null,eu=W()+500,xu(e,t)):Bl=ze(e,t);a:do try{if(Ll!==0&&Fl!==null){t=Fl;var o=Rl;b:switch(Ll){case 1:Ll=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(ha(o)){Ll=0,Rl=null,Mu(t);break}t=function(){Ll!==2&&Ll!==9||Pl!==e||(Ll=7),rd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:ha(o)?(Ll=0,Rl=null,Mu(t)):(Ll=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Fl.tag){case 26:s=Fl.memoizedState;case 5:case 27:var c=Fl;if(s?Wf(s):c.stateNode.complete){Ll=0,Rl=null;var l=c.sibling;if(l!==null)Fl=l;else{var u=c.return;u===null?Fl=null:(Fl=u,Pu(u))}break b}}Ll=0,Rl=null,Nu(e,t,o,5);break;case 6:Ll=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Ii=Fi=null,j.H=r,j.A=a,Nl=n,Fl===null?(Pl=null,Il=0,Ur(),Ul):0}function Au(){for(;Fl!==null&&!ve();)ju(Fl)}function ju(e){var t=wc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=cc(n,t,t.pendingProps,t.type,void 0,Il);break;case 11:t=cc(n,t,t.pendingProps,t.type.render,t.ref,Il);break;case 5:bo(t);default:Nc(n,t),t=Fl=ei(t,Hl),t=wc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Nu(e,t,n,r){Ii=Fi=null,bo(t),xa=null,Sa=0;var i=t.return;try{if(qs(e,i,t,n,Il)){Ul=1,Hs(e,si(n,e.current)),Fl=null;return}}catch(t){if(i!==null)throw Fl=i,t;Ul=1,Hs(e,si(n,e.current)),Fl=null;return}t.flags&32768?(X||r===1?e=!0:Bl||Il&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ka.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=jc(t.alternate,t,Hl);if(n!==null){Fl=n;return}if(t=t.sibling,t!==null){Fl=t;return}Fl=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Mc(e.alternate,e);if(n!==null){n.flags&=32767,Fl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Fl=e;return}Fl=e=n}while(e!==null);Ul=6,Fl=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(Nl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Hr,We(e,n,o,s,c,l),e===Pl&&(Fl=Pl=null,Il=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ce,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=Nl,Nl|=4;try{Qc(e,t,n)}finally{Nl=s,M.p=a,j.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Nl;Nl|=4;try{dl(t,e);var a=Vd,o=gr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&hr(s.ownerDocument.documentElement,s)){if(c!==null&&_r(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=mr(s,h),v=mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Bd,Vd=Bd=null}finally{Nl=i,M.p=r,j.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Nl;Nl|=4;try{$c(e,t.alternate,t)}finally{Nl=i,M.p=r,j.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,ye();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),Ye(n),t=t.stateNode,Oe&&typeof Oe.onCommitFiberRoot==`function`)try{Oe.onCommitFiberRoot(G,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}ou&3&&Vu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,id(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qi(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=Ye(ou),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Nl&6)throw Error(i(331));var c=Nl;if(Nl|=4,Ol(o.current),bl(o,o.current,s,n),Nl=c,id(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot==`function`)try{Oe.onPostCommitFiberRoot(G,o)}catch{}return!0}finally{M.p=a,j.T=r,Bu(e,t)}}function Uu(e,t,n){t=si(n,t),t=Ws(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(Ue(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=si(n,e),n=Gs(2),r=Na(t,n,2),r!==null&&(Ks(n,r,t,e),Ue(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ml;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Pl===e&&(Il&n)===n&&(Ul===4||Ul===3&&(Il&62914560)===Il&&300>W()-Ql?!(Nl&2)&&xu(e,0):Kl|=n,Jl===Il&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=Ve()),e=Kr(e,t),e!==null&&(Ue(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return ge(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ae(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Il,a=Re(r,r===Pl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ze(r,a)||(n=!0,ld(r,a))}r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&qd()&&(e=nd);for(var t=W(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}ru!==0&&ru!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ae(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Be(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Pl,n=Il,n=Re(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Ye(n)){case 2:case 8:n=Se;break;case 32:n=Ce;break;case 268435456:n=Te;break;default:n=Ce}return r=cd.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=Il;return r=Re(e,e===Pl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),sd(e,W()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Vu())return null;hu(e,t,!0)}function ud(){$(function(){Nl&6?ge(xe,ad):od()})}function dd(){if(nd===0){var e=ta;e===0&&(e=Pe,Pe<<=1,!(Pe&261888)&&(Pe=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Vt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[et]||null).action),o=r.submitter;o&&(t=(t=o[et]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new un(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);gs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),gs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Lr.length;hd++){var gd=Lr[hd];Rr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Rr(kr,`onAnimationEnd`),Rr(Ar,`onAnimationIteration`),Rr(jr,`onAnimationStart`),Rr(`dblclick`,`onDoubleClick`),Rr(`focusin`,`onFocus`),Rr(`focusout`,`onBlur`),Rr(Mr,`onTransitionRun`),Rr(Nr,`onTransitionStart`),Rr(Pr,`onTransitionCancel`),Rr(Fr,`onTransitionEnd`),ht(`onMouseEnter`,[`mouseout`,`mouseover`]),ht(`onMouseLeave`,[`mouseout`,`mouseover`]),ht(`onPointerEnter`,[`pointerout`,`pointerover`]),ht(`onPointerLeave`,[`pointerout`,`pointerover`]),mt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),mt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),mt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),mt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),mt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),mt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){zr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){zr(e)}i.currentTarget=null,a=c}}}}function bd(e,t){var n=t[nt];n===void 0&&(n=t[nt]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,ft.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!Qt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Td(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ct(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Yt(function(){var r=a,i=Wt(n),s=[];a:{var c=Ir.get(e);if(c!==void 0){var l=un,u=e;switch(e){case`keypress`:if(an(n)===0)break a;case`keydown`:case`keyup`:l=On;break;case`focusin`:u=`focus`,l=yn;break;case`focusout`:u=`blur`,l=yn;break;case`beforeblur`:case`afterblur`:l=yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=_n;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=An;break;case kr:case Ar:case jr:l=bn;break;case Fr:l=jn;break;case`scroll`:case`scrollend`:l=fn;break;case`wheel`:l=Mn;break;case`copy`:case`cut`:case`paste`:l=xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=kn;break;case`toggle`:case`beforetoggle`:l=Nn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Xt(m,p),g!=null&&d.push(Ed(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Ut&&(u=n.relatedTarget||n.fromElement)&&(ct(u)||u[tt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ct(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=_n,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=kn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:lt(l),h=u==null?c:lt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ct(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Od,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&kd(s,c,l,d,!1),u!==null&&f!==null&&kd(s,f,u,d,!0)}}a:{if(c=r?lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=$n;else if(qn(c)){if(er)v=lr;else{v=sr;var y=or}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Rt(r.elementType)&&(v=$n):v=cr;if(v&&=v(e,r)){Jn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&At(c,`number`,c.value)}switch(y=r?lt(r):window,e){case`focusin`:(qn(y)||y.contentEditable===`true`)&&(yr=y,br=r,xr=null);break;case`focusout`:xr=br=yr=null;break;case`mousedown`:Sr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Sr=!1,Cr(s,n,i);break;case`selectionchange`:if(vr)break;case`keydown`:case`keyup`:Cr(s,n,i)}var b;if(Fn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Un?Vn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Rn&&n.locale!==`ko`&&(Un||x!==`onCompositionStart`?x===`onCompositionEnd`&&Un&&(b=rn()):(en=i,tn=`value`in en?en.value:en.textContent,Un=!0)),y=Dd(r,x),0<y.length&&(x=new Sn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Hn(n),b!==null&&(x.data=b)))),(b=Ln?Wn(e,n):Gn(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new Sn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Xt(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=Xt(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Xt(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=Xt(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ad=/\r\n?/g,jd=/\u0000|\uFFFD/g;function Md(e){return(typeof e==`string`?e:``+e).replace(Ad,`
9
+ `).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Pt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Pt(e,``+r);break;case`className`:yt(e,`class`,r);break;case`tabIndex`:yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:yt(e,n,r);break;case`style`:Lt(e,r,o);break;case`data`:if(t!==`object`){yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Vt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Vt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Ht);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Vt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:bd(`beforetoggle`,e),bd(`toggle`,e),vt(e,`popover`,r);break;case`xlinkActuate`:bt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:bt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:bt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:bt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:bt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:bt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:vt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=zt.get(n)||n,vt(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Lt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Pt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Pt(e,``+r);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Ht);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!pt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[et]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):vt(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:bd(`error`,e),bd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:bd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Pd(e,t,r,d,n,null)}}kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in bd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&jt(e,!!r,n,!0):jt(e,!!r,t,!1);return;case`textarea`:for(s in bd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Pd(e,t,s,c,n,null)}Nt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Pd(e,t,l,r,n,null)}return;case`dialog`:bd(`beforetoggle`,e),bd(`toggle`,e),bd(`cancel`,e),bd(`close`,e);break;case`iframe`:case`object`:bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)bd(_d[r],e);break;case`image`:bd(`error`,e),bd(`load`,e);break;case`details`:bd(`toggle`,e);break;case`embed`:case`source`:case`link`:bd(`error`,e),bd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,u,r,n,null)}return;default:if(Rt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Pd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}Ot(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Pd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?jt(e,!!n,n?[]:``,!1):jt(e,!!n,t,!0)):jt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Pd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}Mt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Pd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Pd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Pd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Pd(e,t,u,p,r,m)}return;default:if(Rt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Rd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Rd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Wd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Gd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e!==Kd&&(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Q=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,$=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?Jd:function(e){return Yd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body)}n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),st(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ot])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);st(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=M.d;M.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=yu();return e||t}function yf(e){var t=K(e);t!==null&&t.tag===5&&t.type===`form`?vs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Dt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),dt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Dt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Dt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Dt(n.imageSizes)+`"]`)):i+=`[href="`+Dt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Id(t,`link`,e),dt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Dt(r)+`"][href="`+Dt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Id(r,`link`,e),dt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ut(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);dt(c),Id(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=ut(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),dt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=ut(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),dt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=se.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=ut(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=ut(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=ut(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Dt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),dt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Dt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Dt(n.href)+`"]`);if(r)return t.instance=r,dt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),dt(r),Id(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,dt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),dt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,dt(a),a):(r=n,(a=mf.get(o))&&(r=m({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),dt(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ot]||a[$e]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,dt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),dt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=He(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=He(0),this.hiddenUpdates=He(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Zr(3,null,null,t),e.current=a,a.stateNode=e,t=Zi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Aa(a),e}function tp(e){return e?(e=Yr,e):Yr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ma(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Na(e,r,t),n!==null&&(mu(n,e,t),Pa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Kr(e,67108864);t!==null&&mu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=fu();t=Je(t);var n=Kr(e,t);n!==null&&mu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,up(e,t,n,r)}finally{M.p=a,j.T=i}}function lp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,up(e,t,n,r)}finally{M.p=a,j.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Td(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=K(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Le(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ae(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Nl&6)&&(eu=W()+500,id(0,!1))}}break;case 31:case 13:s=Kr(a,2),s!==null&&mu(s,a,2),yu(),ip(a,2)}if(a=dp(r),a===null&&Td(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function dp(e){return e=Wt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ct(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){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(be()){case xe:return 2;case Se:return 8;case Ce:case we:return 32;case Te:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=K(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ct(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ze(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ze(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ut=r,n.target.dispatchEvent(r),Ut=null}else return t=K(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=K(n);a!==null&&(e.splice(t,3),t-=3,gs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[et]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[et]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,fu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),yu(),t[tt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(i(527,Lp,`19.2.8`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{G=zp.inject(Rp),Oe=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=zs,s=Bs,c=Vs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[tt]=t.current,Cd(e),new Fp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=d(),y=_(),b=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),x;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(x||={});var S={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function C(e){return e>=55296&&e<=57343}function w(e){return e>=56320&&e<=57343}function T(e,t){return(e-55296)*1024+9216+t}function ee(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function E(e){return e>=64976&&e<=65007||b.has(e)}var D;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(D||={});var O=65536,te=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=O,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(w(t))return this.pos++,this._addGap(),T(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,x.EOF;return this._err(D.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,x.EOF;let n=this.html.charCodeAt(t);return n===x.CARRIAGE_RETURN?x.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,x.EOF;let e=this.html.charCodeAt(this.pos);return e===x.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,x.LINE_FEED):e===x.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,C(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===x.LINE_FEED||e===x.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){ee(e)?this._err(D.controlCharacterInInputStream):E(e)&&this._err(D.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},k;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(k||={});function A(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var ne=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),re=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function ie(e){return e>=55296&&e<=57343||e>1114111?65533:re.get(e)??e}var j;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(j||={});var M=32,ae;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(ae||={});function oe(e){return e>=j.ZERO&&e<=j.NINE}function N(e){return e>=j.UPPER_A&&e<=j.UPPER_F||e>=j.LOWER_A&&e<=j.LOWER_F}function P(e){return e>=j.UPPER_A&&e<=j.UPPER_Z||e>=j.LOWER_A&&e<=j.LOWER_Z||oe(e)}function F(e){return e===j.EQUALS||P(e)}var I;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(I||={});var L;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(L||={});var R=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=I.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=L.Strict}startEntity(e){this.decodeMode=e,this.state=I.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case I.EntityStart:return e.charCodeAt(t)===j.NUM?(this.state=I.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=I.NamedEntity,this.stateNamedEntity(e,t));case I.NumericStart:return this.stateNumericStart(e,t);case I.NumericDecimal:return this.stateNumericDecimal(e,t);case I.NumericHex:return this.stateNumericHex(e,t);case I.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|M)===j.LOWER_X?(this.state=I.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=I.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(oe(r)||N(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(oe(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===j.SEMI)this.consumed+=1;else if(this.decodeMode===L.Strict)return 0;return this.emitCodePoint(ie(this.result),this.consumed),this.errors&&(e!==j.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&ae.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=se(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===L.Attribute&&(i===0||F(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&ae.VALUE_LENGTH)>>14,i!==0){if(a===j.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==L.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&ae.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~ae.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case I.NamedEntity:return this.result!==0&&(this.decodeMode!==L.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case I.NumericDecimal:return this.emitNumericEntity(0,2);case I.NumericHex:return this.emitNumericEntity(0,3);case I.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case I.EntityStart:return 0}}};function se(e,t,n,r){let i=(t&ae.BRANCH_LENGTH)>>7,a=t&ae.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var z;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(z||={});var ce;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(ce||={});var le;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(le||={});var B;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(B||={});var V;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(V||={});var ue=new Map([[B.A,V.A],[B.ADDRESS,V.ADDRESS],[B.ANNOTATION_XML,V.ANNOTATION_XML],[B.APPLET,V.APPLET],[B.AREA,V.AREA],[B.ARTICLE,V.ARTICLE],[B.ASIDE,V.ASIDE],[B.B,V.B],[B.BASE,V.BASE],[B.BASEFONT,V.BASEFONT],[B.BGSOUND,V.BGSOUND],[B.BIG,V.BIG],[B.BLOCKQUOTE,V.BLOCKQUOTE],[B.BODY,V.BODY],[B.BR,V.BR],[B.BUTTON,V.BUTTON],[B.CAPTION,V.CAPTION],[B.CENTER,V.CENTER],[B.CODE,V.CODE],[B.COL,V.COL],[B.COLGROUP,V.COLGROUP],[B.DD,V.DD],[B.DESC,V.DESC],[B.DETAILS,V.DETAILS],[B.DIALOG,V.DIALOG],[B.DIR,V.DIR],[B.DIV,V.DIV],[B.DL,V.DL],[B.DT,V.DT],[B.EM,V.EM],[B.EMBED,V.EMBED],[B.FIELDSET,V.FIELDSET],[B.FIGCAPTION,V.FIGCAPTION],[B.FIGURE,V.FIGURE],[B.FONT,V.FONT],[B.FOOTER,V.FOOTER],[B.FOREIGN_OBJECT,V.FOREIGN_OBJECT],[B.FORM,V.FORM],[B.FRAME,V.FRAME],[B.FRAMESET,V.FRAMESET],[B.H1,V.H1],[B.H2,V.H2],[B.H3,V.H3],[B.H4,V.H4],[B.H5,V.H5],[B.H6,V.H6],[B.HEAD,V.HEAD],[B.HEADER,V.HEADER],[B.HGROUP,V.HGROUP],[B.HR,V.HR],[B.HTML,V.HTML],[B.I,V.I],[B.IMG,V.IMG],[B.IMAGE,V.IMAGE],[B.INPUT,V.INPUT],[B.IFRAME,V.IFRAME],[B.KEYGEN,V.KEYGEN],[B.LABEL,V.LABEL],[B.LI,V.LI],[B.LINK,V.LINK],[B.LISTING,V.LISTING],[B.MAIN,V.MAIN],[B.MALIGNMARK,V.MALIGNMARK],[B.MARQUEE,V.MARQUEE],[B.MATH,V.MATH],[B.MENU,V.MENU],[B.META,V.META],[B.MGLYPH,V.MGLYPH],[B.MI,V.MI],[B.MO,V.MO],[B.MN,V.MN],[B.MS,V.MS],[B.MTEXT,V.MTEXT],[B.NAV,V.NAV],[B.NOBR,V.NOBR],[B.NOFRAMES,V.NOFRAMES],[B.NOEMBED,V.NOEMBED],[B.NOSCRIPT,V.NOSCRIPT],[B.OBJECT,V.OBJECT],[B.OL,V.OL],[B.OPTGROUP,V.OPTGROUP],[B.OPTION,V.OPTION],[B.P,V.P],[B.PARAM,V.PARAM],[B.PLAINTEXT,V.PLAINTEXT],[B.PRE,V.PRE],[B.RB,V.RB],[B.RP,V.RP],[B.RT,V.RT],[B.RTC,V.RTC],[B.RUBY,V.RUBY],[B.S,V.S],[B.SCRIPT,V.SCRIPT],[B.SEARCH,V.SEARCH],[B.SECTION,V.SECTION],[B.SELECT,V.SELECT],[B.SOURCE,V.SOURCE],[B.SMALL,V.SMALL],[B.SPAN,V.SPAN],[B.STRIKE,V.STRIKE],[B.STRONG,V.STRONG],[B.STYLE,V.STYLE],[B.SUB,V.SUB],[B.SUMMARY,V.SUMMARY],[B.SUP,V.SUP],[B.TABLE,V.TABLE],[B.TBODY,V.TBODY],[B.TEMPLATE,V.TEMPLATE],[B.TEXTAREA,V.TEXTAREA],[B.TFOOT,V.TFOOT],[B.TD,V.TD],[B.TH,V.TH],[B.THEAD,V.THEAD],[B.TITLE,V.TITLE],[B.TR,V.TR],[B.TRACK,V.TRACK],[B.TT,V.TT],[B.U,V.U],[B.UL,V.UL],[B.SVG,V.SVG],[B.VAR,V.VAR],[B.WBR,V.WBR],[B.XMP,V.XMP]]);function de(e){return ue.get(e)??V.UNKNOWN}var H=V,fe={[z.HTML]:new Set([H.ADDRESS,H.APPLET,H.AREA,H.ARTICLE,H.ASIDE,H.BASE,H.BASEFONT,H.BGSOUND,H.BLOCKQUOTE,H.BODY,H.BR,H.BUTTON,H.CAPTION,H.CENTER,H.COL,H.COLGROUP,H.DD,H.DETAILS,H.DIR,H.DIV,H.DL,H.DT,H.EMBED,H.FIELDSET,H.FIGCAPTION,H.FIGURE,H.FOOTER,H.FORM,H.FRAME,H.FRAMESET,H.H1,H.H2,H.H3,H.H4,H.H5,H.H6,H.HEAD,H.HEADER,H.HGROUP,H.HR,H.HTML,H.IFRAME,H.IMG,H.INPUT,H.LI,H.LINK,H.LISTING,H.MAIN,H.MARQUEE,H.MENU,H.META,H.NAV,H.NOEMBED,H.NOFRAMES,H.NOSCRIPT,H.OBJECT,H.OL,H.P,H.PARAM,H.PLAINTEXT,H.PRE,H.SCRIPT,H.SECTION,H.SELECT,H.SOURCE,H.STYLE,H.SUMMARY,H.TABLE,H.TBODY,H.TD,H.TEMPLATE,H.TEXTAREA,H.TFOOT,H.TH,H.THEAD,H.TITLE,H.TR,H.TRACK,H.UL,H.WBR,H.XMP]),[z.MATHML]:new Set([H.MI,H.MO,H.MN,H.MS,H.MTEXT,H.ANNOTATION_XML]),[z.SVG]:new Set([H.TITLE,H.FOREIGN_OBJECT,H.DESC]),[z.XLINK]:new Set,[z.XML]:new Set,[z.XMLNS]:new Set},pe=new Set([H.H1,H.H2,H.H3,H.H4,H.H5,H.H6]),me=new Set([B.STYLE,B.SCRIPT,B.XMP,B.IFRAME,B.NOEMBED,B.NOFRAMES,B.PLAINTEXT]);function he(e,t){return me.has(e)||t&&e===B.NOSCRIPT}var U;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(U||={});var ge={DATA:U.DATA,RCDATA:U.RCDATA,RAWTEXT:U.RAWTEXT,SCRIPT_DATA:U.SCRIPT_DATA,PLAINTEXT:U.PLAINTEXT,CDATA_SECTION:U.CDATA_SECTION};function _e(e){return e>=x.DIGIT_0&&e<=x.DIGIT_9}function ve(e){return e>=x.LATIN_CAPITAL_A&&e<=x.LATIN_CAPITAL_Z}function ye(e){return e>=x.LATIN_SMALL_A&&e<=x.LATIN_SMALL_Z}function W(e){return ye(e)||ve(e)}function be(e){return W(e)||_e(e)}function xe(e){return e+32}function Se(e){return e===x.SPACE||e===x.LINE_FEED||e===x.TABULATION||e===x.FORM_FEED}function Ce(e){return Se(e)||e===x.SOLIDUS||e===x.GREATER_THAN_SIGN}function we(e){return e===x.NULL?D.nullCharacterReference:e>1114111?D.characterReferenceOutsideUnicodeRange:C(e)?D.surrogateCharacterReference:E(e)?D.noncharacterCharacterReference:ee(e)||e===x.CARRIAGE_RETURN?D.controlCharacterReference:null}var Te=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=U.DATA,this.returnState=U.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new te(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new R(ne,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(D.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(D.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=we(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:k.START_TAG,tagName:``,tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:k.END_TAG,tagName:``,tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:k.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:k.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(A(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(D.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=de(e.tagName),e.type===k.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(D.endTagWithAttributes),e.selfClosing&&this._err(D.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case k.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case k.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case k.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:k.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Se(e)?k.WHITESPACE_CHARACTER:e===x.NULL?k.NULL_CHARACTER:k.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(k.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=U.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?L.Attribute:L.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===U.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case U.DATA:this._stateData(e);break;case U.RCDATA:this._stateRcdata(e);break;case U.RAWTEXT:this._stateRawtext(e);break;case U.SCRIPT_DATA:this._stateScriptData(e);break;case U.PLAINTEXT:this._statePlaintext(e);break;case U.TAG_OPEN:this._stateTagOpen(e);break;case U.END_TAG_OPEN:this._stateEndTagOpen(e);break;case U.TAG_NAME:this._stateTagName(e);break;case U.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case U.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case U.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case U.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case U.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case U.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case U.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case U.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case U.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case U.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case U.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case U.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case U.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case U.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case U.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case U.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case U.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case U.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case U.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case U.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case U.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case U.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case U.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case U.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case U.BOGUS_COMMENT:this._stateBogusComment(e);break;case U.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case U.COMMENT_START:this._stateCommentStart(e);break;case U.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case U.COMMENT:this._stateComment(e);break;case U.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case U.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case U.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case U.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case U.COMMENT_END:this._stateCommentEnd(e);break;case U.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case U.DOCTYPE:this._stateDoctype(e);break;case U.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case U.DOCTYPE_NAME:this._stateDoctypeName(e);break;case U.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case U.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case U.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case U.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case U.CDATA_SECTION:this._stateCdataSection(e);break;case U.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case U.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case U.CHARACTER_REFERENCE:this._stateCharacterReference();break;case U.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case x.LESS_THAN_SIGN:this.state=U.TAG_OPEN;break;case x.AMPERSAND:this._startCharacterReference();break;case x.NULL:this._err(D.unexpectedNullCharacter),this._emitCodePoint(e);break;case x.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case x.AMPERSAND:this._startCharacterReference();break;case x.LESS_THAN_SIGN:this.state=U.RCDATA_LESS_THAN_SIGN;break;case x.NULL:this._err(D.unexpectedNullCharacter),this._emitChars(`�`);break;case x.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case x.LESS_THAN_SIGN:this.state=U.RAWTEXT_LESS_THAN_SIGN;break;case x.NULL:this._err(D.unexpectedNullCharacter),this._emitChars(`�`);break;case x.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case x.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_LESS_THAN_SIGN;break;case x.NULL:this._err(D.unexpectedNullCharacter),this._emitChars(`�`);break;case x.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case x.NULL:this._err(D.unexpectedNullCharacter),this._emitChars(`�`);break;case x.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(W(e))this._createStartTagToken(),this.state=U.TAG_NAME,this._stateTagName(e);else switch(e){case x.EXCLAMATION_MARK:this.state=U.MARKUP_DECLARATION_OPEN;break;case x.SOLIDUS:this.state=U.END_TAG_OPEN;break;case x.QUESTION_MARK:this._err(D.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=U.BOGUS_COMMENT,this._stateBogusComment(e);break;case x.EOF:this._err(D.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(D.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=U.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(W(e))this._createEndTagToken(),this.state=U.TAG_NAME,this._stateTagName(e);else switch(e){case x.GREATER_THAN_SIGN:this._err(D.missingEndTagName),this.state=U.DATA;break;case x.EOF:this._err(D.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(D.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this.state=U.BEFORE_ATTRIBUTE_NAME;break;case x.SOLIDUS:this.state=U.SELF_CLOSING_START_TAG;break;case x.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentTagToken();break;case x.NULL:this._err(D.unexpectedNullCharacter),t.tagName+=`�`;break;case x.EOF:this._err(D.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(ve(e)?xe(e):e)}}_stateRcdataLessThanSign(e){e===x.SOLIDUS?this.state=U.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=U.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){W(e)?(this.state=U.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=U.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=U.BEFORE_ATTRIBUTE_NAME,!1;case x.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=U.SELF_CLOSING_START_TAG,!1;case x.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=U.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===x.SOLIDUS?this.state=U.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=U.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){W(e)?(this.state=U.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=U.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case x.SOLIDUS:this.state=U.SCRIPT_DATA_END_TAG_OPEN;break;case x.EXCLAMATION_MARK:this.state=U.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=U.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){W(e)?(this.state=U.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===x.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===x.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case x.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case x.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case x.NULL:this._err(D.unexpectedNullCharacter),this._emitChars(`�`);break;case x.EOF:this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case x.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case x.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case x.NULL:this._err(D.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case x.EOF:this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case x.HYPHEN_MINUS:this._emitChars(`-`);break;case x.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case x.GREATER_THAN_SIGN:this.state=U.SCRIPT_DATA,this._emitChars(`>`);break;case x.NULL:this._err(D.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case x.EOF:this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===x.SOLIDUS?this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:W(e)?(this._emitChars(`<`),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){W(e)?(this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(S.SCRIPT,!1)&&Ce(this.preprocessor.peek(S.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<S.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case x.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case x.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case x.NULL:this._err(D.unexpectedNullCharacter),this._emitChars(`�`);break;case x.EOF:this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case x.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case x.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case x.NULL:this._err(D.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case x.EOF:this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case x.HYPHEN_MINUS:this._emitChars(`-`);break;case x.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case x.GREATER_THAN_SIGN:this.state=U.SCRIPT_DATA,this._emitChars(`>`);break;case x.NULL:this._err(D.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case x.EOF:this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===x.SOLIDUS?(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(S.SCRIPT,!1)&&Ce(this.preprocessor.peek(S.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<S.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.SOLIDUS:case x.GREATER_THAN_SIGN:case x.EOF:this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case x.EQUALS_SIGN:this._err(D.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=U.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:case x.SOLIDUS:case x.GREATER_THAN_SIGN:case x.EOF:this._leaveAttrName(),this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case x.EQUALS_SIGN:this._leaveAttrName(),this.state=U.BEFORE_ATTRIBUTE_VALUE;break;case x.QUOTATION_MARK:case x.APOSTROPHE:case x.LESS_THAN_SIGN:this._err(D.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case x.NULL:this._err(D.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(ve(e)?xe(e):e)}}_stateAfterAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.SOLIDUS:this.state=U.SELF_CLOSING_START_TAG;break;case x.EQUALS_SIGN:this.state=U.BEFORE_ATTRIBUTE_VALUE;break;case x.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentTagToken();break;case x.EOF:this._err(D.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:this.state=U.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case x.APOSTROPHE:this.state=U.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case x.GREATER_THAN_SIGN:this._err(D.missingAttributeValue),this.state=U.DATA,this.emitCurrentTagToken();break;default:this.state=U.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case x.QUOTATION_MARK:this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case x.AMPERSAND:this._startCharacterReference();break;case x.NULL:this._err(D.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case x.EOF:this._err(D.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case x.APOSTROPHE:this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case x.AMPERSAND:this._startCharacterReference();break;case x.NULL:this._err(D.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case x.EOF:this._err(D.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break;case x.AMPERSAND:this._startCharacterReference();break;case x.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break;case x.NULL:this._err(D.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case x.QUOTATION_MARK:case x.APOSTROPHE:case x.LESS_THAN_SIGN:case x.EQUALS_SIGN:case x.GRAVE_ACCENT:this._err(D.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case x.EOF:this._err(D.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break;case x.SOLIDUS:this._leaveAttrValue(),this.state=U.SELF_CLOSING_START_TAG;break;case x.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break;case x.EOF:this._err(D.eofInTag),this._emitEOFToken();break;default:this._err(D.missingWhitespaceBetweenAttributes),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case x.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=U.DATA,this.emitCurrentTagToken();break}case x.EOF:this._err(D.eofInTag),this._emitEOFToken();break;default:this._err(D.unexpectedSolidusInTag),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentComment(t);break;case x.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case x.NULL:this._err(D.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(S.DASH_DASH,!0)?(this._createCommentToken(S.DASH_DASH.length+1),this.state=U.COMMENT_START):this._consumeSequenceIfMatch(S.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(S.DOCTYPE.length+1),this.state=U.DOCTYPE):this._consumeSequenceIfMatch(S.CDATA_START,!0)?this.inForeignNode?this.state=U.CDATA_SECTION:(this._err(D.cdataInHtmlContent),this._createCommentToken(S.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=U.BOGUS_COMMENT):this._ensureHibernation()||(this._err(D.incorrectlyOpenedComment),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case x.HYPHEN_MINUS:this.state=U.COMMENT_START_DASH;break;case x.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=U.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=U.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case x.HYPHEN_MINUS:this.state=U.COMMENT_END;break;case x.GREATER_THAN_SIGN:this._err(D.abruptClosingOfEmptyComment),this.state=U.DATA,this.emitCurrentComment(t);break;case x.EOF:this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=U.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case x.HYPHEN_MINUS:this.state=U.COMMENT_END_DASH;break;case x.LESS_THAN_SIGN:t.data+=`<`,this.state=U.COMMENT_LESS_THAN_SIGN;break;case x.NULL:this._err(D.unexpectedNullCharacter),t.data+=`�`;break;case x.EOF:this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case x.EXCLAMATION_MARK:t.data+=`!`,this.state=U.COMMENT_LESS_THAN_SIGN_BANG;break;case x.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=U.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===x.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=U.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===x.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=U.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==x.GREATER_THAN_SIGN&&e!==x.EOF&&this._err(D.nestedComment),this.state=U.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case x.HYPHEN_MINUS:this.state=U.COMMENT_END;break;case x.EOF:this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=U.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentComment(t);break;case x.EXCLAMATION_MARK:this.state=U.COMMENT_END_BANG;break;case x.HYPHEN_MINUS:t.data+=`-`;break;case x.EOF:this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=U.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case x.HYPHEN_MINUS:t.data+=`--!`,this.state=U.COMMENT_END_DASH;break;case x.GREATER_THAN_SIGN:this._err(D.incorrectlyClosedComment),this.state=U.DATA,this.emitCurrentComment(t);break;case x.EOF:this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=U.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this.state=U.BEFORE_DOCTYPE_NAME;break;case x.GREATER_THAN_SIGN:this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case x.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBeforeDoctypeName),this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(ve(e))this._createDoctypeToken(String.fromCharCode(xe(e))),this.state=U.DOCTYPE_NAME;else switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.NULL:this._err(D.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=U.DOCTYPE_NAME;break;case x.GREATER_THAN_SIGN:{this._err(D.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=U.DATA;break}case x.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=U.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this.state=U.AFTER_DOCTYPE_NAME;break;case x.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentDoctype(t);break;case x.NULL:this._err(D.unexpectedNullCharacter),t.name+=`�`;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(ve(e)?xe(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentDoctype(t);break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(S.PUBLIC,!1)?this.state=U.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(S.SYSTEM,!1)?this.state=U.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(D.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this.state=U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case x.QUOTATION_MARK:this._err(D.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case x.APOSTROPHE:this._err(D.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case x.GREATER_THAN_SIGN:this._err(D.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case x.APOSTROPHE:t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case x.GREATER_THAN_SIGN:this._err(D.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case x.QUOTATION_MARK:this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case x.NULL:this._err(D.unexpectedNullCharacter),t.publicId+=`�`;break;case x.GREATER_THAN_SIGN:this._err(D.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case x.APOSTROPHE:this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case x.NULL:this._err(D.unexpectedNullCharacter),t.publicId+=`�`;break;case x.GREATER_THAN_SIGN:this._err(D.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this.state=U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case x.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentDoctype(t);break;case x.QUOTATION_MARK:this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case x.APOSTROPHE:this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=U.DATA;break;case x.QUOTATION_MARK:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case x.APOSTROPHE:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:this.state=U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case x.QUOTATION_MARK:this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case x.APOSTROPHE:this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case x.GREATER_THAN_SIGN:this._err(D.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case x.APOSTROPHE:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case x.GREATER_THAN_SIGN:this._err(D.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case x.QUOTATION_MARK:this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case x.NULL:this._err(D.unexpectedNullCharacter),t.systemId+=`�`;break;case x.GREATER_THAN_SIGN:this._err(D.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case x.APOSTROPHE:this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case x.NULL:this._err(D.unexpectedNullCharacter),t.systemId+=`�`;break;case x.GREATER_THAN_SIGN:this._err(D.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=U.DATA;break;case x.EOF:this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(D.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=U.DATA;break;case x.NULL:this._err(D.unexpectedNullCharacter);break;case x.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case x.RIGHT_SQUARE_BRACKET:this.state=U.CDATA_SECTION_BRACKET;break;case x.EOF:this._err(D.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===x.RIGHT_SQUARE_BRACKET?this.state=U.CDATA_SECTION_END:(this._emitChars(`]`),this.state=U.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case x.GREATER_THAN_SIGN:this.state=U.DATA;break;case x.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=U.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(x.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&be(this.preprocessor.peek(1))?U.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){be(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===x.SEMICOLON&&this._err(D.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},Ee=new Set([V.DD,V.DT,V.LI,V.OPTGROUP,V.OPTION,V.P,V.RB,V.RP,V.RT,V.RTC]),De=new Set([...Ee,V.CAPTION,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]),G=new Set([V.APPLET,V.CAPTION,V.HTML,V.MARQUEE,V.OBJECT,V.TABLE,V.TD,V.TEMPLATE,V.TH]),Oe=new Set([...G,V.OL,V.UL]),ke=new Set([...G,V.BUTTON]),Ae=new Set([V.ANNOTATION_XML,V.MI,V.MN,V.MO,V.MS,V.MTEXT]),je=new Set([V.DESC,V.FOREIGN_OBJECT,V.TITLE]),Me=new Set([V.TR,V.TEMPLATE,V.HTML]),Ne=new Set([V.TBODY,V.TFOOT,V.THEAD,V.TEMPLATE,V.HTML]),Pe=new Set([V.TABLE,V.TEMPLATE,V.HTML]),Fe=new Set([V.TD,V.TH]),Ie=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=V.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===V.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===z.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==z.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(pe,z.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Fe,z.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Pe,z.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Ne,z.HTML)}clearBackToTableRowContext(){this.clearBackTo(Me,z.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===V.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===V.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case z.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case z.SVG:if(je.has(r))return!1;break;case z.MATHML:if(Ae.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,G)}hasInListItemScope(e){return this.hasInDynamicScope(e,Oe)}hasInButtonScope(e){return this.hasInDynamicScope(e,ke)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case z.HTML:if(pe.has(t))return!0;if(G.has(t))return!1;break;case z.SVG:if(je.has(t))return!1;break;case z.MATHML:if(Ae.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===z.HTML)switch(this.tagIDs[t]){case e:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===z.HTML)switch(this.tagIDs[e]){case V.TBODY:case V.THEAD:case V.TFOOT:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===z.HTML)switch(this.tagIDs[t]){case e:return!0;case V.OPTION:case V.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Ee.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&De.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&De.has(this.currentTagId);)this.pop()}},Le=3,Re;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(Re||={});var ze={type:Re.Marker},Be=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===Re.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<Le)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<Le)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=Le&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(ze)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Re.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Re.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(ze);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===Re.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===Re.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===Re.Element&&t.element===e)}},Ve={createDocument(){return{nodeName:`#document`,mode:le.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};Ve.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(Ve.isTextNode(n)){n.value+=t;return}}Ve.appendChild(e,Ve.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ve.isTextNode(r)?r.value+=t:Ve.insertBefore(e,Ve.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},He=`html`,Ue=`about:legacy-compat`,We=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,Ge=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Ke=[...Ge,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],qe=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),Je=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Ye=[...Je,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function Xe(e,t){return t.some(t=>e.startsWith(t))}function Ze(e){return e.name===He&&e.publicId===null&&(e.systemId===null||e.systemId===Ue)}function Qe(e){if(e.name!==He)return le.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===We)return le.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),qe.has(n))return le.QUIRKS;let e=t===null?Ke:Ge;if(Xe(n,e))return le.QUIRKS;if(e=t===null?Je:Ye,Xe(n,e))return le.LIMITED_QUIRKS}return le.NO_QUIRKS}var $e={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},et=`definitionurl`,tt=`definitionURL`,nt=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),rt=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:z.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:z.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:z.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:z.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:z.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:z.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:z.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:z.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:z.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:z.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:z.XMLNS}]]),it=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),at=new Set([V.B,V.BIG,V.BLOCKQUOTE,V.BODY,V.BR,V.CENTER,V.CODE,V.DD,V.DIV,V.DL,V.DT,V.EM,V.EMBED,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,V.HEAD,V.HR,V.I,V.IMG,V.LI,V.LISTING,V.MENU,V.META,V.NOBR,V.OL,V.P,V.PRE,V.RUBY,V.S,V.SMALL,V.SPAN,V.STRONG,V.STRIKE,V.SUB,V.SUP,V.TABLE,V.TT,V.U,V.UL,V.VAR]);function ot(e){let t=e.tagID;return t===V.FONT&&e.attrs.some(({name:e})=>e===ce.COLOR||e===ce.SIZE||e===ce.FACE)||at.has(t)}function st(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===et){e.attrs[t].name=tt;break}}function ct(e){for(let t=0;t<e.attrs.length;t++){let n=nt.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function K(e){for(let t=0;t<e.attrs.length;t++){let n=rt.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function lt(e){let t=it.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=de(e.tagName))}function ut(e,t){return t===z.MATHML&&(e===V.MI||e===V.MO||e===V.MN||e===V.MS||e===V.MTEXT)}function dt(e,t,n){if(t===z.MATHML&&e===V.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===ce.ENCODING){let t=n[e].value.toLowerCase();return t===$e.TEXT_HTML||t===$e.APPLICATION_XML}}return t===z.SVG&&(e===V.FOREIGN_OBJECT||e===V.DESC||e===V.TITLE)}function ft(e,t,n,r){return(!r||r===z.HTML)&&dt(e,t,n)||(!r||r===z.MATHML)&&ut(e,t)}var pt=`hidden`,mt=8,ht=3,q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(q||={});var J={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},gt=new Set([V.TABLE,V.TBODY,V.TFOOT,V.THEAD,V.TR]),_t={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ve,onParseError:null},vt=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={..._t,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Te(this.options,this),this.activeFormattingElements=new Be(this.treeAdapter),this.fragmentContextID=n?de(this.treeAdapter.getTagName(n)):V.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Ie(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={..._t,...t};e??=n.treeAdapter.createElement(B.TEMPLATE,z.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,z.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===V.TEMPLATE&&i.tmplInsertionModeStack.unshift(q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??J,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===z.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,z.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=ge.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===B.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==z.HTML))switch(this.fragmentContextID){case V.TITLE:case V.TEXTAREA:this.tokenizer.state=ge.RCDATA;break;case V.STYLE:case V.XMP:case V.IFRAME:case V.NOEMBED:case V.NOFRAMES:case V.NOSCRIPT:this.tokenizer.state=ge.RAWTEXT;break;case V.SCRIPT:this.tokenizer.state=ge.SCRIPT_DATA;break;case V.PLAINTEXT:this.tokenizer.state=ge.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,z.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,z.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(B.HTML,z.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,V.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===k.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===V.SVG&&this.treeAdapter.getTagName(t)===B.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===z.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===V.MGLYPH||e.tagID===V.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,z.HTML)}_processToken(e){switch(e.type){case k.CHARACTER:this.onCharacter(e);break;case k.NULL_CHARACTER:this.onNullCharacter(e);break;case k.COMMENT:this.onComment(e);break;case k.DOCTYPE:this.onDoctype(e);break;case k.START_TAG:this._processStartTag(e);break;case k.END_TAG:this.onEndTag(e);break;case k.EOF:this.onEof(e);break;case k.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return ft(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===Re.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(V.P),this.openElements.popUntilTagNamePopped(V.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case V.TR:this.insertionMode=q.IN_ROW;return;case V.TBODY:case V.THEAD:case V.TFOOT:this.insertionMode=q.IN_TABLE_BODY;return;case V.CAPTION:this.insertionMode=q.IN_CAPTION;return;case V.COLGROUP:this.insertionMode=q.IN_COLUMN_GROUP;return;case V.TABLE:this.insertionMode=q.IN_TABLE;return;case V.BODY:this.insertionMode=q.IN_BODY;return;case V.FRAMESET:this.insertionMode=q.IN_FRAMESET;return;case V.SELECT:this._resetInsertionModeForSelect(e);return;case V.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case V.HTML:this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return;case V.TD:case V.TH:if(e>0){this.insertionMode=q.IN_CELL;return}break;case V.HEAD:if(e>0){this.insertionMode=q.IN_HEAD;return}}this.insertionMode=q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===V.TEMPLATE)break;if(e===V.TABLE){this.insertionMode=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(e){return gt.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case V.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===z.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case V.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return fe[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Ir(this,e);return}switch(this.insertionMode){case q.INITIAL:At(this,e);break;case q.BEFORE_HTML:Nt(this,e);break;case q.BEFORE_HEAD:It(this,e);break;case q.IN_HEAD:Bt(this,e);break;case q.IN_HEAD_NO_SCRIPT:Ut(this,e);break;case q.AFTER_HEAD:Kt(this,e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:Yt(this,e);break;case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Gn(this,e);break;case q.IN_TABLE_TEXT:ir(this,e);break;case q.IN_COLUMN_GROUP:dr(this,e);break;case q.AFTER_BODY:Dr(this,e);break;case q.AFTER_AFTER_BODY:Nr(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Fr(this,e);return}switch(this.insertionMode){case q.INITIAL:At(this,e);break;case q.BEFORE_HTML:Nt(this,e);break;case q.BEFORE_HEAD:It(this,e);break;case q.IN_HEAD:Bt(this,e);break;case q.IN_HEAD_NO_SCRIPT:Ut(this,e);break;case q.AFTER_HEAD:Kt(this,e);break;case q.TEXT:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Gn(this,e);break;case q.IN_COLUMN_GROUP:dr(this,e);break;case q.AFTER_BODY:Dr(this,e);break;case q.AFTER_AFTER_BODY:Nr(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Tt(this,e);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:Tt(this,e);break;case q.IN_TABLE_TEXT:ar(this,e);break;case q.AFTER_BODY:Et(this,e);break;case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Dt(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:kt(this,e);break;case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:this._err(e,D.misplacedDoctype);break;case q.IN_TABLE_TEXT:ar(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,D.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Rr(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:At(this,e);break;case q.BEFORE_HTML:jt(this,e);break;case q.BEFORE_HEAD:Pt(this,e);break;case q.IN_HEAD:Lt(this,e);break;case q.IN_HEAD_NO_SCRIPT:Vt(this,e);break;case q.AFTER_HEAD:Wt(this,e);break;case q.IN_BODY:kn(this,e);break;case q.IN_TABLE:er(this,e);break;case q.IN_TABLE_TEXT:ar(this,e);break;case q.IN_CAPTION:sr(this,e);break;case q.IN_COLUMN_GROUP:lr(this,e);break;case q.IN_TABLE_BODY:fr(this,e);break;case q.IN_ROW:mr(this,e);break;case q.IN_CELL:gr(this,e);break;case q.IN_SELECT:vr(this,e);break;case q.IN_SELECT_IN_TABLE:br(this,e);break;case q.IN_TEMPLATE:Sr(this,e);break;case q.AFTER_BODY:Tr(this,e);break;case q.IN_FRAMESET:Or(this,e);break;case q.AFTER_FRAMESET:Ar(this,e);break;case q.AFTER_AFTER_BODY:Mr(this,e);break;case q.AFTER_AFTER_FRAMESET:Pr(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?zr(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:At(this,e);break;case q.BEFORE_HTML:Mt(this,e);break;case q.BEFORE_HEAD:Ft(this,e);break;case q.IN_HEAD:Rt(this,e);break;case q.IN_HEAD_NO_SCRIPT:Ht(this,e);break;case q.AFTER_HEAD:Gt(this,e);break;case q.IN_BODY:Vn(this,e);break;case q.TEXT:Un(this,e);break;case q.IN_TABLE:tr(this,e);break;case q.IN_TABLE_TEXT:ar(this,e);break;case q.IN_CAPTION:cr(this,e);break;case q.IN_COLUMN_GROUP:ur(this,e);break;case q.IN_TABLE_BODY:pr(this,e);break;case q.IN_ROW:hr(this,e);break;case q.IN_CELL:_r(this,e);break;case q.IN_SELECT:yr(this,e);break;case q.IN_SELECT_IN_TABLE:xr(this,e);break;case q.IN_TEMPLATE:Cr(this,e);break;case q.AFTER_BODY:Er(this,e);break;case q.IN_FRAMESET:kr(this,e);break;case q.AFTER_FRAMESET:jr(this,e);break;case q.AFTER_AFTER_BODY:Nr(this,e)}}onEof(e){switch(this.insertionMode){case q.INITIAL:At(this,e);break;case q.BEFORE_HTML:Nt(this,e);break;case q.BEFORE_HEAD:It(this,e);break;case q.IN_HEAD:Bt(this,e);break;case q.IN_HEAD_NO_SCRIPT:Ut(this,e);break;case q.AFTER_HEAD:Kt(this,e);break;case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:Hn(this,e);break;case q.TEXT:Wn(this,e);break;case q.IN_TABLE_TEXT:ar(this,e);break;case q.IN_TEMPLATE:wr(this,e);break;case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Ot(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===x.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:this._insertCharacters(e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Jt(this,e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Gn(this,e);break;case q.IN_TABLE_TEXT:rr(this,e)}}};function yt(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Bn(e,t),n}function bt(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Y(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=ht;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=xt(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function xt(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function St(e,t,n){let r=de(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===V.TEMPLATE&&i===z.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Ct(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function wt(e,t){for(let n=0;n<mt;n++){let n=yt(e,t);if(!n)break;let r=bt(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=Y(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&St(e,a,i),Ct(e,r,n)}}function Tt(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Et(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Dt(e,t){e._appendCommentNode(t,e.document)}function Ot(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function kt(e,t){e._setDocumentType(t);let n=t.forceQuirks?le.QUIRKS:Qe(t);Ze(t)||e._err(t,D.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function At(e,t){e._err(t,D.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,le.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function jt(e,t){t.tagID===V.HTML?(e._insertElement(t,z.HTML),e.insertionMode=q.BEFORE_HEAD):Nt(e,t)}function Mt(e,t){let n=t.tagID;(n===V.HTML||n===V.HEAD||n===V.BODY||n===V.BR)&&Nt(e,t)}function Nt(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function Pt(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.HEAD:e._insertElement(t,z.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break;default:It(e,t)}}function Ft(e,t){let n=t.tagID;n===V.HEAD||n===V.BODY||n===V.HTML||n===V.BR?It(e,t):e._err(t,D.endTagWithoutMatchingOpenElement)}function It(e,t){e._insertFakeElement(B.HEAD,V.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function Lt(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.TITLE:e._switchToTextParsing(t,ge.RCDATA);break;case V.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,ge.RAWTEXT):(e._insertElement(t,z.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break;case V.NOFRAMES:case V.STYLE:e._switchToTextParsing(t,ge.RAWTEXT);break;case V.SCRIPT:e._switchToTextParsing(t,ge.SCRIPT_DATA);break;case V.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break;case V.HEAD:e._err(t,D.misplacedStartTagForHeadElement);break;default:Bt(e,t)}}function Rt(e,t){switch(t.tagID){case V.HEAD:e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break;case V.BODY:case V.BR:case V.HTML:Bt(e,t);break;case V.TEMPLATE:zt(e,t);break;default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function zt(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==V.TEMPLATE&&e._err(t,D.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(V.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,D.endTagWithoutMatchingOpenElement)}function Bt(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function Vt(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.BASEFONT:case V.BGSOUND:case V.HEAD:case V.LINK:case V.META:case V.NOFRAMES:case V.STYLE:Lt(e,t);break;case V.NOSCRIPT:e._err(t,D.nestedNoscriptInHead);break;default:Ut(e,t)}}function Ht(e,t){switch(t.tagID){case V.NOSCRIPT:e.openElements.pop(),e.insertionMode=q.IN_HEAD;break;case V.BR:Ut(e,t);break;default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function Ut(e,t){let n=t.type===k.EOF?D.openElementsLeftAfterEof:D.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function Wt(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.BODY:e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break;case V.FRAMESET:e._insertElement(t,z.HTML),e.insertionMode=q.IN_FRAMESET;break;case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:e._err(t,D.abandonedHeadElementChild),e.openElements.push(e.headElement,V.HEAD),Lt(e,t),e.openElements.remove(e.headElement);break;case V.HEAD:e._err(t,D.misplacedStartTagForHeadElement);break;default:Kt(e,t)}}function Gt(e,t){switch(t.tagID){case V.BODY:case V.HTML:case V.BR:Kt(e,t);break;case V.TEMPLATE:zt(e,t);break;default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function Kt(e,t){e._insertFakeElement(B.BODY,V.BODY),e.insertionMode=q.IN_BODY,qt(e,t)}function qt(e,t){switch(t.type){case k.CHARACTER:Yt(e,t);break;case k.WHITESPACE_CHARACTER:Jt(e,t);break;case k.COMMENT:Tt(e,t);break;case k.START_TAG:kn(e,t);break;case k.END_TAG:Vn(e,t);break;case k.EOF:Hn(e,t)}}function Jt(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Yt(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Xt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Zt(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Qt(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,z.HTML),e.insertionMode=q.IN_FRAMESET)}function $t(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML)}function en(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&pe.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,z.HTML)}function tn(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function nn(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),n||(e.formElement=e.openElements.current))}function rn(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===V.LI&&r===V.LI||(n===V.DD||n===V.DT)&&(r===V.DD||r===V.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==V.ADDRESS&&r!==V.DIV&&r!==V.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML)}function an(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.tokenizer.state=ge.PLAINTEXT}function on(e,t){e.openElements.hasInScope(V.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(V.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1}function sn(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(B.A);n&&(wt(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cn(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ln(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(V.NOBR)&&(wt(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function un(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function dn(e,t){e.treeAdapter.getDocumentMode(e.document)!==le.QUIRKS&&e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function fn(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pn(e){let t=A(e,ce.TYPE);return t!=null&&t.toLowerCase()===pt}function mn(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML),pn(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function hn(e,t){e._appendElement(t,z.HTML),t.ackSelfClosing=!0}function gn(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function _n(e,t){t.tagName=B.IMG,t.tagID=V.IMG,fn(e,t)}function vn(e,t){e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.tokenizer.state=ge.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function yn(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,ge.RAWTEXT)}function bn(e,t){e.framesetOk=!1,e._switchToTextParsing(t,ge.RAWTEXT)}function xn(e,t){e._switchToTextParsing(t,ge.RAWTEXT)}function Sn(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function Cn(e,t){e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function wn(e,t){e.openElements.hasInScope(V.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,z.HTML)}function Tn(e,t){e.openElements.hasInScope(V.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(V.RTC),e._insertElement(t,z.HTML)}function En(e,t){e._reconstructActiveFormattingElements(),st(t),K(t),t.selfClosing?e._appendElement(t,z.MATHML):e._insertElement(t,z.MATHML),t.ackSelfClosing=!0}function Dn(e,t){e._reconstructActiveFormattingElements(),ct(t),K(t),t.selfClosing?e._appendElement(t,z.SVG):e._insertElement(t,z.SVG),t.ackSelfClosing=!0}function On(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function kn(e,t){switch(t.tagID){case V.I:case V.S:case V.B:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.SMALL:case V.STRIKE:case V.STRONG:cn(e,t);break;case V.A:sn(e,t);break;case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:en(e,t);break;case V.P:case V.DL:case V.OL:case V.UL:case V.DIV:case V.DIR:case V.NAV:case V.MAIN:case V.MENU:case V.ASIDE:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.DETAILS:case V.ADDRESS:case V.ARTICLE:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:$t(e,t);break;case V.LI:case V.DD:case V.DT:rn(e,t);break;case V.BR:case V.IMG:case V.WBR:case V.AREA:case V.EMBED:case V.KEYGEN:fn(e,t);break;case V.HR:gn(e,t);break;case V.RB:case V.RTC:wn(e,t);break;case V.RT:case V.RP:Tn(e,t);break;case V.PRE:case V.LISTING:tn(e,t);break;case V.XMP:yn(e,t);break;case V.SVG:Dn(e,t);break;case V.HTML:Xt(e,t);break;case V.BASE:case V.LINK:case V.META:case V.STYLE:case V.TITLE:case V.SCRIPT:case V.BGSOUND:case V.BASEFONT:case V.TEMPLATE:Lt(e,t);break;case V.BODY:Zt(e,t);break;case V.FORM:nn(e,t);break;case V.NOBR:ln(e,t);break;case V.MATH:En(e,t);break;case V.TABLE:dn(e,t);break;case V.INPUT:mn(e,t);break;case V.PARAM:case V.TRACK:case V.SOURCE:hn(e,t);break;case V.IMAGE:_n(e,t);break;case V.BUTTON:on(e,t);break;case V.APPLET:case V.OBJECT:case V.MARQUEE:un(e,t);break;case V.IFRAME:bn(e,t);break;case V.SELECT:Sn(e,t);break;case V.OPTION:case V.OPTGROUP:Cn(e,t);break;case V.NOEMBED:case V.NOFRAMES:xn(e,t);break;case V.FRAMESET:Qt(e,t);break;case V.TEXTAREA:vn(e,t);break;case V.NOSCRIPT:e.options.scriptingEnabled?xn(e,t):On(e,t);break;case V.PLAINTEXT:an(e,t);break;case V.COL:case V.TH:case V.TD:case V.TR:case V.HEAD:case V.FRAME:case V.TBODY:case V.TFOOT:case V.THEAD:case V.CAPTION:case V.COLGROUP:break;default:On(e,t)}}function An(e,t){if(e.openElements.hasInScope(V.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function jn(e,t){e.openElements.hasInScope(V.BODY)&&(e.insertionMode=q.AFTER_BODY,Er(e,t))}function Mn(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Nn(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(V.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(V.FORM):n&&e.openElements.remove(n))}function Pn(e){e.openElements.hasInButtonScope(V.P)||e._insertFakeElement(B.P,V.P),e._closePElement()}function Fn(e){e.openElements.hasInListItemScope(V.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(V.LI),e.openElements.popUntilTagNamePopped(V.LI))}function In(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Ln(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Rn(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function zn(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(B.BR,V.BR),e.openElements.pop(),e.framesetOk=!1}function Bn(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==V.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Vn(e,t){switch(t.tagID){case V.A:case V.B:case V.I:case V.S:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.NOBR:case V.SMALL:case V.STRIKE:case V.STRONG:wt(e,t);break;case V.P:Pn(e);break;case V.DL:case V.UL:case V.OL:case V.DIR:case V.DIV:case V.NAV:case V.PRE:case V.MAIN:case V.MENU:case V.ASIDE:case V.BUTTON:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.ADDRESS:case V.ARTICLE:case V.DETAILS:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.LISTING:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:Mn(e,t);break;case V.LI:Fn(e);break;case V.DD:case V.DT:In(e,t);break;case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:Ln(e);break;case V.BR:zn(e);break;case V.BODY:An(e,t);break;case V.HTML:jn(e,t);break;case V.FORM:Nn(e);break;case V.APPLET:case V.OBJECT:case V.MARQUEE:Rn(e,t);break;case V.TEMPLATE:zt(e,t);break;default:Bn(e,t)}}function Hn(e,t){e.tmplInsertionModeStack.length>0?wr(e,t):Ot(e,t)}function Un(e,t){var n;t.tagID===V.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Wn(e,t){e._err(t,D.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Gn(e,t){if(e.openElements.currentTagId!==void 0&&gt.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case k.CHARACTER:ir(e,t);break;case k.WHITESPACE_CHARACTER:rr(e,t)}else nr(e,t)}function Kn(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,z.HTML),e.insertionMode=q.IN_CAPTION}function qn(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function Jn(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(B.COLGROUP,V.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,lr(e,t)}function Yn(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=q.IN_TABLE_BODY}function Xn(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(B.TBODY,V.TBODY),e.insertionMode=q.IN_TABLE_BODY,fr(e,t)}function Zn(e,t){e.openElements.hasInTableScope(V.TABLE)&&(e.openElements.popUntilTagNamePopped(V.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Qn(e,t){pn(t)?e._appendElement(t,z.HTML):nr(e,t),t.ackSelfClosing=!0}function $n(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,z.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function er(e,t){switch(t.tagID){case V.TD:case V.TH:case V.TR:Xn(e,t);break;case V.STYLE:case V.SCRIPT:case V.TEMPLATE:Lt(e,t);break;case V.COL:Jn(e,t);break;case V.FORM:$n(e,t);break;case V.TABLE:Zn(e,t);break;case V.TBODY:case V.TFOOT:case V.THEAD:Yn(e,t);break;case V.INPUT:Qn(e,t);break;case V.CAPTION:Kn(e,t);break;case V.COLGROUP:qn(e,t);break;default:nr(e,t)}}function tr(e,t){switch(t.tagID){case V.TABLE:e.openElements.hasInTableScope(V.TABLE)&&(e.openElements.popUntilTagNamePopped(V.TABLE),e._resetInsertionMode());break;case V.TEMPLATE:zt(e,t);break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:nr(e,t)}}function nr(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,qt(e,t),e.fosterParentingEnabled=n}function rr(e,t){e.pendingCharacterTokens.push(t)}function ir(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ar(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)nr(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var or=new Set([V.CAPTION,V.COL,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]);function sr(e,t){let n=t.tagID;or.has(n)?e.openElements.hasInTableScope(V.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(V.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,er(e,t)):kn(e,t)}function cr(e,t){let n=t.tagID;switch(n){case V.CAPTION:case V.TABLE:e.openElements.hasInTableScope(V.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(V.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,n===V.TABLE&&tr(e,t));break;case V.BODY:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:Vn(e,t)}}function lr(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.COL:e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.TEMPLATE:Lt(e,t);break;default:dr(e,t)}}function ur(e,t){switch(t.tagID){case V.COLGROUP:e.openElements.currentTagId===V.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case V.TEMPLATE:zt(e,t);break;case V.COL:break;default:dr(e,t)}}function dr(e,t){e.openElements.currentTagId===V.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function fr(e,t){switch(t.tagID){case V.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,z.HTML),e.insertionMode=q.IN_ROW;break;case V.TH:case V.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(B.TR,V.TR),e.insertionMode=q.IN_ROW,mr(e,t);break;case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,er(e,t));break;default:er(e,t)}}function pr(e,t){let n=t.tagID;switch(t.tagID){case V.TBODY:case V.TFOOT:case V.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case V.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,tr(e,t));break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:case V.TR:break;default:tr(e,t)}}function mr(e,t){switch(t.tagID){case V.TH:case V.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,z.HTML),e.insertionMode=q.IN_CELL,e.activeFormattingElements.insertMarker();break;case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:e.openElements.hasInTableScope(V.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,fr(e,t));break;default:er(e,t)}}function hr(e,t){switch(t.tagID){case V.TR:e.openElements.hasInTableScope(V.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break;case V.TABLE:e.openElements.hasInTableScope(V.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,pr(e,t));break;case V.TBODY:case V.TFOOT:case V.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(V.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,pr(e,t));break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:break;default:tr(e,t)}}function gr(e,t){let n=t.tagID;or.has(n)?(e.openElements.hasInTableScope(V.TD)||e.openElements.hasInTableScope(V.TH))&&(e._closeTableCell(),mr(e,t)):kn(e,t)}function _r(e,t){let n=t.tagID;switch(n){case V.TD:case V.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_ROW);break;case V.TABLE:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),hr(e,t));break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:break;default:Vn(e,t)}}function vr(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.OPTION:e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e._insertElement(t,z.HTML);break;case V.OPTGROUP:e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e.openElements.currentTagId===V.OPTGROUP&&e.openElements.pop(),e._insertElement(t,z.HTML);break;case V.HR:e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e.openElements.currentTagId===V.OPTGROUP&&e.openElements.pop(),e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.INPUT:case V.KEYGEN:case V.TEXTAREA:case V.SELECT:e.openElements.hasInSelectScope(V.SELECT)&&(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode(),t.tagID!==V.SELECT&&e._processStartTag(t));break;case V.SCRIPT:case V.TEMPLATE:Lt(e,t)}}function yr(e,t){switch(t.tagID){case V.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===V.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===V.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===V.OPTGROUP&&e.openElements.pop();break;case V.OPTION:e.openElements.currentTagId===V.OPTION&&e.openElements.pop();break;case V.SELECT:e.openElements.hasInSelectScope(V.SELECT)&&(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode());break;case V.TEMPLATE:zt(e,t)}}function br(e,t){let n=t.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode(),e._processStartTag(t)):vr(e,t)}function xr(e,t){let n=t.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode(),e.onEndTag(t)):yr(e,t)}function Sr(e,t){switch(t.tagID){case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:Lt(e,t);break;case V.CAPTION:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,er(e,t);break;case V.COL:e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,lr(e,t);break;case V.TR:e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,fr(e,t);break;case V.TD:case V.TH:e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,mr(e,t);break;default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,kn(e,t)}}function Cr(e,t){t.tagID===V.TEMPLATE&&zt(e,t)}function wr(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(V.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ot(e,t)}function Tr(e,t){t.tagID===V.HTML?kn(e,t):Dr(e,t)}function Er(e,t){if(t.tagID===V.HTML){if(e.fragmentContext||(e.insertionMode=q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===V.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else Dr(e,t)}function Dr(e,t){e.insertionMode=q.IN_BODY,qt(e,t)}function Or(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.FRAMESET:e._insertElement(t,z.HTML);break;case V.FRAME:e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.NOFRAMES:Lt(e,t)}}function kr(e,t){t.tagID===V.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==V.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function Ar(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.NOFRAMES:Lt(e,t)}}function jr(e,t){t.tagID===V.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function Mr(e,t){t.tagID===V.HTML?kn(e,t):Nr(e,t)}function Nr(e,t){e.insertionMode=q.IN_BODY,qt(e,t)}function Pr(e,t){switch(t.tagID){case V.HTML:kn(e,t);break;case V.NOFRAMES:Lt(e,t)}}function Fr(e,t){t.chars=`�`,e._insertCharacters(t)}function Ir(e,t){e._insertCharacters(t),e.framesetOk=!1}function Lr(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==z.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Rr(e,t){if(ot(t))Lr(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===z.MATHML?st(t):r===z.SVG&&(lt(t),ct(t)),K(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function zr(e,t){if(t.tagID===V.P||t.tagID===V.BR){Lr(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===z.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}String.prototype.codePointAt;function Br(e,t){return function(n){let r,i=0,a=``;for(;r=e.exec(n);)i!==r.index&&(a+=n.substring(i,r.index)),a+=t.get(r[0].charCodeAt(0)),i=r.index+1;return a+n.substring(i)}}var Vr=Br(/["&\u00A0]/g,new Map([[34,`&quot;`],[38,`&amp;`],[160,`&nbsp;`]])),Hr=Br(/[&<>\u00A0]/g,new Map([[38,`&amp;`],[60,`&lt;`],[62,`&gt;`],[160,`&nbsp;`]])),Ur=new Set([B.AREA,B.BASE,B.BASEFONT,B.BGSOUND,B.BR,B.COL,B.EMBED,B.FRAME,B.HR,B.IMG,B.INPUT,B.KEYGEN,B.LINK,B.META,B.PARAM,B.SOURCE,B.TRACK,B.WBR]);function Wr(e,t){return t.treeAdapter.isElementNode(e)&&t.treeAdapter.getNamespaceURI(e)===z.HTML&&Ur.has(t.treeAdapter.getTagName(e))}var Gr={treeAdapter:Ve,scriptingEnabled:!0};function Kr(e,t){return Jr(e,{...Gr,...t})}function qr(e,t){let n=``,r=t.treeAdapter.isElementNode(e)&&t.treeAdapter.getTagName(e)===B.TEMPLATE&&t.treeAdapter.getNamespaceURI(e)===z.HTML?t.treeAdapter.getTemplateContent(e):e,i=t.treeAdapter.getChildNodes(r);if(i)for(let e of i)n+=Jr(e,t);return n}function Jr(e,t){return t.treeAdapter.isElementNode(e)?Yr(e,t):t.treeAdapter.isTextNode(e)?Zr(e,t):t.treeAdapter.isCommentNode(e)?Qr(e,t):t.treeAdapter.isDocumentTypeNode(e)?$r(e,t):``}function Yr(e,t){let n=t.treeAdapter.getTagName(e);return`<${n}${Xr(e,t)}>${Wr(e,t)?``:`${qr(e,t)}</${n}>`}`}function Xr(e,{treeAdapter:t}){let n=``;for(let r of t.getAttrList(e)){if(n+=` `,r.namespace)switch(r.namespace){case z.XML:n+=`xml:${r.name}`;break;case z.XMLNS:r.name!==`xmlns`&&(n+=`xmlns:`),n+=r.name;break;case z.XLINK:n+=`xlink:${r.name}`;break;default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${Vr(r.value)}"`}return n}function Zr(e,t){let{treeAdapter:n}=t,r=n.getTextNodeContent(e),i=n.getParentNode(e),a=i&&n.isElementNode(i)&&n.getTagName(i);return a&&n.getNamespaceURI(i)===z.HTML&&he(a,t.scriptingEnabled)?r:Hr(r)}function Qr(e,{treeAdapter:t}){return`<!--${t.getCommentNodeContent(e)}-->`}function $r(e,{treeAdapter:t}){return`<!DOCTYPE ${t.getDocumentTypeNodeName(e)}>`}function ei(e,t){return vt.parse(e,t)}function ti(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=vt.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var ni=class extends Error{};function ri(e,t){let n=0;for(let r of e){if(r.start>r.end||r.start<n||t!==void 0&&r.end>t)throw new ni(`invalid splice [${r.start}, ${r.end})`);n=r.end}}function ii(e,t){ri(t,e.length);let n=``,r=0;for(let i of t)n+=e.slice(r,i.start)+i.text,r=i.end;return n+e.slice(r)}function ai(e,t){ri(t,e.length);let n=[],r=0;for(let i of t){let t=i.start+r;n.push({start:t,end:t+i.text.length,text:e.slice(i.start,i.end)}),r+=i.text.length-(i.end-i.start)}return n}function oi(e,t,n){let r=0;for(let i of e){let e=i.end-i.start;if(i.end<t||i.end===t&&e>0)r+=i.text.length-e;else if(i.start<t||i.start===t&&n>0)return i.start+r+(n>0?i.text.length:0);else if(i.start===t)return t+r;else break}return t+r}function si(e,t){return e.some(e=>e.end>e.start&&e.start<=t&&t<e.end)}function ci(e,t){if(e===t)return[];let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;r>0&&li(e.charCodeAt(r-1))&&r--;let i=0;for(;i<n-r&&e.charCodeAt(e.length-1-i)===t.charCodeAt(t.length-1-i);)i++;return i>0&&ui(e.charCodeAt(e.length-i))&&i--,[{start:r,end:e.length-i,text:t.slice(r,t.length-i)}]}function li(e){return e>=55296&&e<=56319}function ui(e){return e>=56320&&e<=57343}function di(e){let t=[],n=0;for(let r of e)r.start>n&&t.push({t:`r`,n:r.start-n}),r.end>r.start&&t.push({t:`d`,n:r.end-r.start}),r.text&&t.push({t:`i`,s:r.text}),n=r.end;return t}function fi(e){let t=[],n=0,r=null;for(let i of e){if(i.t===`r`){r=null,n+=i.n;continue}r||(r={start:n,end:n,text:``},t.push(r)),i.t===`d`?(r.end+=i.n,n+=i.n):r.text+=i.s}return t.filter(e=>e.end>e.start||e.text!==``)}function pi(e){return e?e.t===`i`?e.s.length:e.n:1/0}function mi(e,t){let n=e[0];if(!n)return;let r=pi(n)-t;r<=0?e.shift():e[0]=n.t===`i`?{t:`i`,s:n.s.slice(t)}:{t:n.t,n:r}}function hi(e,t){let n=di(e),r=di(t),i=[],a=e=>{let t=i[i.length-1];t&&t.t===e.t?t.t===`i`&&e.t===`i`?t.s+=e.s:t.t!==`i`&&e.t!==`i`?t.n+=e.n:i.push(e):i.push(e)};for(;;){let e=n[0],t=r[0];if(!e&&!t)break;if(t&&t.t===`i`){a({t:`i`,s:t.s}),r.shift();continue}if(e&&e.t===`d`){a({t:`d`,n:e.n}),n.shift();continue}let i=Math.min(pi(e),pi(t));if(i===1/0)break;let o=!e||e.t===`r`,s=!t||t.t===`r`;o&&s?a({t:`r`,n:i}):o?a({t:`d`,n:i}):s&&e&&e.t===`i`&&a({t:`i`,s:e.s.slice(0,i)}),mi(n,i),mi(r,i)}return fi(i)}function gi(e=1){let t=e;return{newId:()=>`n${t++}`}}var _i=gi();function vi(e){return e.startTagEnd===e.start}function yi(e,t){for(let n of e.moved??[])if(t>=n.from&&t<n.from+n.length)return n.to+(t-n.from);return si(e.splices,t)?null:oi(e.splices,t,1)}function bi(e,t){let n=new Map;for(let t of e.elements.values())vi(t)||n.set(t.start,t);let r=new Map,i=new Set,a=(e,t)=>{t!==null&&!i.has(t)&&(r.set(e,t),i.add(t))};for(let e of t.index.elements.values()){if(vi(e))continue;let r=yi(t,e.start),i=r===null?void 0:n.get(r);i&&i.tag===e.tag&&a(e.id,i.id)}for(let n of[`html`,`head`,`body`]){let r=t.index[n],i=e[n];r!==null&&i!==null&&a(r,i)}return r}function xi(e,t,n=_i){let r=t?bi(e,t):new Map,i=new Map;for(let[e,t]of r)i.set(t,e);for(let t of e.order)i.has(t)||i.set(t,n.newId());let a=e=>i.get(e),o=new Map;for(let t of e.order){let n=e.elements.get(t);o.set(a(t),{...n,id:a(t),parent:n.parent===null?null:a(n.parent),children:n.children.map(a)})}if(o.size!==e.order.length)throw Error(`assignIds: id collision (id source out of sync)`);let s=e=>e===null?null:a(e);return{source:e.source,elements:o,order:e.order.map(a),html:s(e.html),head:s(e.head),body:s(e.body)}}var Si=new Set([`area`,`base`,`br`,`col`,`embed`,`frame`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),Ci=new Set([`script`,`style`,`textarea`,`title`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`]),X=e=>Si.has(e.toLowerCase()),wi=e=>Ci.has(e.toLowerCase()),Ti=new Set([`html`,`head`,`body`]);function Ei(e){let t=ei(e,{sourceCodeLocationInfo:!0,scriptingEnabled:!1}),n=new Map,r=[],i=new Set,a={html:null,head:null,body:null},o=0,s=(e,t,i)=>{n.set(e.id,e),r.push(e.id),i!==null&&n.get(i)?.children.push(e.id);let o=ki(t,i,a);o&&(a[o]=e.id),c(t,e.id)},c=(e,t)=>{for(let r of Oi(e)){if(Ve.isDocumentTypeNode(r)){o=r.sourceCodeLocation?.endOffset??0;continue}if(!Ve.isElementNode(r))continue;let e=Ai(r,t,n.size);e&&!i.has(e.start)?(i.add(e.start),s(e,r,t)):!e&&Ti.has(r.tagName)?s(ji(r.tagName,t,n.size),r,t):e||c(r,t)}};return c(t,null),Mi(n,a,o,e.length),{source:e,elements:n,order:r,...a}}function Di(e,t=_i){return xi(Ei(e),void 0,t)}function Oi(e){return Ve.isElementNode(e)&&e.tagName===`template`?[...Ve.getTemplateContent(e).childNodes]:[...e.childNodes]}function ki(e,t,n){return e.tagName===`html`&&t===null?`html`:e.tagName===`head`&&t===n.html&&n.head===null?`head`:e.tagName===`body`&&t===n.html&&n.body===null?`body`:null}function Ai(e,t,n){let r=e.sourceCodeLocation;if(!r||!r.startTag)return null;let i=r.attrs?Object.values(r.attrs).sort((e,t)=>e.startOffset-t.startOffset):[],a=[];for(let t=0;t<Math.min(i.length,e.attrs.length);t++){let n=e.attrs[t],r=i[t];a.push({name:n.prefix?`${n.prefix}:${n.name}`:n.name,value:n.value,start:r.startOffset,end:r.endOffset})}return{id:`r${n}`,tag:e.tagName,start:r.startOffset,end:Math.max(r.endOffset,r.startTag.endOffset),startTagEnd:r.startTag.endOffset,endTagStart:r.endTag?r.endTag.startOffset:null,attrs:a,parent:t,children:[]}}function ji(e,t,n){return{id:`r${n}`,tag:e,start:0,end:0,startTagEnd:0,endTagStart:null,attrs:[],parent:t,children:[]}}function Mi(e,t,n,r){let i=t.html===null?void 0:e.get(t.html),a=t.head===null?void 0:e.get(t.head),o=t.body===null?void 0:e.get(t.body),s=e=>!!e&&e.start===e.startTagEnd,c=t=>t.children.reduce((t,n)=>Math.max(t,e.get(n)?.end??0),0);s(i)&&(i.start=i.startTagEnd=n,i.end=r);let l=i?i.startTagEnd:0;if(s(a)&&(a.start=a.startTagEnd=l,a.end=Math.max(l,c(a))),s(o)){let e=Math.max(a?a.end:0,l);o.start=o.startTagEnd=e,o.end=Math.max(e,i?i.endTagStart??i.end:r)}}function Ni(e,t){return e.attrs.find(e=>e.name===t)??e.attrs.find(e=>e.name.toLowerCase()===t.toLowerCase())}function Pi(e,t){return Ni(e,t)?.value??null}function Fi(e){return(Pi(e,`class`)??``).split(/[\t\n\f\r ]+/).filter(Boolean)}function Ii(e,t){return Fi(e).includes(t)}function Li(e,t,n){for(let r=e.elements.get(n)?.parent??null;r!==null;r=e.elements.get(r)?.parent??null)if(r===t)return!0;return!1}function Ri(e,t){return e.source.slice(t.startTagEnd,t.endTagStart??t.end)}function zi(e,t){let n=e.elements.get(t);if(!n)return``;let r=ti(Ve.createElement(n.tag.toLowerCase(),z.HTML,[]),Ri(e,n),{scriptingEnabled:!1}),i=``,a=e=>{for(let t of e.childNodes)Ve.isTextNode(t)?i+=t.value:Ve.isElementNode(t)&&t.tagName!==`template`&&a(t)};return a(r),i}function Bi(e,t){let n=e.slice(t.start,t.end),r=/^[^\s/>=]+(\s*=\s*)?/.exec(n);if(!r||!r[1])return{start:t.end,end:t.end,quote:null,hasValue:!1};let i=t.start+r[0].length,a=e[i];return(a===`"`||a===`'`)&&t.end-i>=2&&e[t.end-1]===a?{start:i+1,end:t.end-1,quote:a,hasValue:!0}:{start:i,end:t.end,quote:null,hasValue:!0}}function Vi(e,t=`"`){let n=e.replace(/&/g,`&amp;`);return t===`"`?n.replace(/"/g,`&quot;`):n.replace(/'/g,`&#39;`)}function Hi(e,t,n){let r=t.start+1+t.tag.length,i=n.start;for(;i>r&&/\s/.test(e[i-1]);)i--;return[i,n.end]}function Ui(e){let t=e.attrs.reduce((e,t)=>Math.max(e,t.end),0);return t>0?t:e.start+1+e.tag.length}function Wi(e,t){return e.lastIndexOf(`
10
+ `,t-1)+1}function Gi(e,t){let n=e.slice(Wi(e,t),t);return/^[ \t]*$/.test(n)?n:null}function Ki(e){let t=e.indexOf(`
11
+ `);return t>0&&e[t-1]===`\r`?`\r
12
+ `:`
13
+ `}var qi=/\s*!\s*important\s*$/i,Ji=/^(?:--[^\s]+|-?[a-zA-Z_][\w-]*)$/;function Yi(e,t){let n=0,r=!0,i=0;for(;i<e.length;){let a=e[i];if(a===`\\`)i+=2;else if(a===`"`||a===`'`){let t=Xi(e,i);if(t<0)return!1;i=t+1}else if(a===`/`&&e[i+1]===`*`){let t=e.indexOf(`*/`,i+2);if(t<0)return!1;i=t+2}else a===`(`||a===`[`||a===`{`?(n===0&&a===`{`&&t(i,a),n++):a===`)`||a===`]`||a===`}`?(n===0?r=!1:n--,n===0&&a===`}`&&t(i,a)):n===0&&t(i,a),i++}return r&&n===0}function Xi(e,t){let n=e[t];for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r;else if(e[r]===`
14
+ `)return-1;return-1}function Zi(e){let t=[],n=0;Yi(e,(e,r)=>{r===`;`&&(t.push({from:n,semi:e}),n=e+1)}),t.push({from:n,semi:null});let r=[];for(let n of t){let t=n.semi??e.length,i=e.slice(n.from,t),a=i.length-i.trimStart().length,o=i.trim();if(o===``)continue;let s=n.from+a,c=s+o.length;r.push({start:s,end:c,semi:n.semi,decl:Qi(e,s,c)})}return r}function Qi(e,t,n){let r=e.slice(t,n),i=-1;if(Yi(r,(e,t)=>{t===`:`&&i<0&&(i=e)}),i<0)return null;let a=r.slice(0,i).replace(/\/\*[\s\S]*?\*\//g,``).trim();if(!Ji.test(a))return null;let o=t+i+1;for(;o<n&&/\s/.test(e[o]);)o++;let s=e.slice(o,n),c=qi.exec(s),l=c?o+c.index:n;return{name:a,value:e.slice(o,l).trim(),important:c!==null,start:t,end:n,valueStart:o,valueEnd:l}}function $i(e){return Zi(e).flatMap(e=>e.decl?[e.decl]:[])}function ea(e){let t=e.trim();return t.startsWith(`--`)?t:t.toLowerCase()}function ta(e){return Ji.test(e.trim())}function na(e){let t=!0;return Yi(e,(e,n)=>{(n===`;`||n===`{`||n===`}`)&&(t=!1)})&&t&&!/\\$/.test(e)}function ra(e,t){let n=ea(t),r=$i(e).filter(e=>ea(e.name)===n),i=r[r.length-1];return i?i.important?`${i.value} !important`:i.value:null}function ia(e,t){let n=e;for(let[e,r]of Object.entries(t)){let t=ea(e),i=r===null?``:r.trim();n=i===``?ca(n,t):oa(n,t,i)}return n}function aa(e,t){return Zi(e).filter(e=>e.decl&&ea(e.decl.name)===t)}function oa(e,t,n){let r=aa(e,t);for(;r.length>1;)e=la(e,r[0]),r=aa(e,t);let i=r[0]?.decl;if(!i)return sa(e,t,n);let a=qi.test(n)?i.end:i.valueEnd;return e.slice(0,i.valueStart)+n+e.slice(a)}function sa(e,t,n){let r=Zi(e),i=r[r.length-1];return i?i.semi===null?`${e.slice(0,i.end)}; ${t}: ${n}${e.slice(i.end)}`:`${e.slice(0,i.semi+1)} ${t}: ${n};${e.slice(i.semi+1)}`:`${t}: ${n}`}function ca(e,t){let n=aa(e,t);for(;n.length>0;)e=la(e,n[0]),n=aa(e,t);return e}function la(e,t){let n=Zi(e),r=n.findIndex(e=>e.start===t.start),i=n[r-1],a=n[r+1],o,s;return a?(o=t.start,s=a.start):t.semi===null?(o=i?i.end:t.start,s=t.end):(o=i&&i.semi!==null?i.semi+1:t.start,s=t.semi+1),e.slice(0,o)+e.slice(s)}var ua={width:1280,height:720};function da(e){let t=(e??``).trim();return t===``?ua:t===`1:1`?{width:1080,height:1080}:t===`3:4`?{width:1080,height:1440}:t===`9:16`?{width:1080,height:1920}:{width:1080,height:1350}}function fa(e,t){for(let n=t.parent;n!==null;n=e.elements.get(n)?.parent??null)if(e.elements.get(n)?.tag===`template`)return!0;return!1}function pa(e,t){for(let n=t.parent;n!==null;){let t=e.elements.get(n);if(!t)return!1;if(Ii(t,`slide`))return!0;n=t.parent}return!1}function ma(e){let t=[];for(let n of e.order){let r=e.elements.get(n);r&&Ii(r,`slide`)&&!pa(e,r)&&!fa(e,r)&&t.push(r)}return t}function ha(e,t){let n=new Set(ma(e).map(e=>e.id));for(let r=t;r!==null;r=e.elements.get(r)?.parent??null)if(n.has(r))return r;return null}function ga(e){if(!e)return null;let t=/^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/i.exec(e),n=t?Number(t[1]):NaN;return Number.isFinite(n)&&n>0?n:null}function _a(e,t){let n=Pi(e,`style`);if(!n)return null;let r=RegExp(`(?:^|[;\\s])${t}\\s*:\\s*([^;]*)`,`gi`),i=null;for(let e=r.exec(n);e;e=r.exec(n))i=e[1].replace(/!important/i,``);return i===null?null:ga(/px\s*$/i.test(i.trim())?i:null)}function va(e,t,n){return ga(Pi(e,`data-popost-${t}`))??_a(e,t)??n}function ya(e,t){let n=da(t);return{width:va(e,`width`,n.width),height:va(e,`height`,n.height)}}function ba(e,t={}){return ma(e).map((e,n)=>({id:e.id,pageKey:Pi(e,`data-popost-page`),name:Pi(e,`data-popost-name`)||`Page ${n+1}`,...ya(e,t.ratio)}))}function xa(e=Sa){return`p-${e(12)}`}function Sa(e){let t=new Uint8Array(Math.ceil(e/2)),n=globalThis.crypto;if(n?.getRandomValues)n.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=Math.floor(Math.random()*256);return Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``).slice(0,e)}function Ca(e){return{kind:`duplicate`,id:e}}function wa(e,t){let n=ma(e);return n.length<=1||!n.some(e=>e.id===t)?null:{kind:`remove`,id:t}}function Ta(e,t,n){let r=ma(e),i=r.findIndex(e=>e.id===t);if(i<0)return null;let a=Math.max(0,Math.min(n,r.length-1));if(a===i)return null;let o=r.filter(e=>e.id!==t),s=o[a];if(s)return s.parent===null?null:{kind:`move`,id:t,parentId:s.parent,beforeId:s.id};let c=o[o.length-1];if(!c||c.parent===null)return null;let l=e.elements.get(c.parent)?.children??[],u=l[l.indexOf(c.id)+1];return{kind:`move`,id:t,parentId:c.parent,beforeId:u===t?l[l.indexOf(t)+1]??null:u??null}}var Ea={img:`image`,picture:`image`,svg:`svg`,video:`video`},Da=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`p`,`li`,`blockquote`,`figcaption`]),Oa=new Set([`style`,`script`,`template`,`noscript`]),ka=new Set([`svg`,`picture`,`video`]),Aa=new WeakMap;function ja(e){let t=Aa.get(e);return t||(t={ctx:new Map,directText:new Map},Aa.set(e,t)),t}var Ma=e=>Oa.has(e.tag.toLowerCase())||Ii(e,`notes`),Na=/&(?:nbsp|ensp|emsp|thinsp|#160|#xa0|#32|#x20|#9|#10|#13);/gi;function Pa(e){let t=e.replace(/<!--[\s\S]*?(?:-->|$)/g,``).replace(/<[!?][^>]*>?/g,``).replace(/<\/?[a-zA-Z][^>]*>?/g,``).replace(Na,` `);return/\S/.test(t)}function Fa(e,t){let n=ja(e).directText,r=n.get(t.id);if(r!==void 0)return r;let i=t.endTagStart??t.end,a=t.startTagEnd,o=!1;for(let n of t.children){let t=e.elements.get(n);if(t){if(t.start>a&&Pa(e.source.slice(a,t.start))){o=!0;break}a=Math.max(a,t.end)}}return!o&&i>a&&(o=Pa(e.source.slice(a,i))),n.set(t.id,o),o}var Ia=e=>Da.has(e.tag.toLowerCase());function La(e,t){return Ii(e,`slide`)&&!t.slideAbove&&!t.templateAbove}function Ra(e,t){let{ctx:n}=ja(e),r=n.get(t);if(r)return r;let i=[];for(let r=t;r!==null&&!n.has(r);){let t=e.elements.get(r);if(!t)break;i.push(t),r=t.parent}for(let t=i.length-1;t>=0;t--){let r=i[t],a=r.parent===null?void 0:e.elements.get(r.parent),o;if(!a)o={root:null,slideAbove:!1,templateAbove:!1,blocked:!1,textAbove:!1};else{let t=Ra(e,a.id),n=La(a,t);o={root:n?a.id:t.root,slideAbove:t.slideAbove||Ii(a,`slide`),templateAbove:t.templateAbove||a.tag.toLowerCase()===`template`,blocked:t.blocked||Ma(a)||ka.has(a.tag.toLowerCase()),textAbove:n?!1:t.textAbove||t.root!==null&&(Ia(a)||Fa(e,a))}}n.set(r.id,o)}return n.get(t)}var za=/url\(|-gradient\(/i;function Ba(e){let t=Pi(e,`style`);if(!t||!/background/i.test(t))return!1;let n=!1;for(let e of $i(t)){let t=e.name.toLowerCase();(t===`background`||t===`background-image`)&&(n=za.test(e.value))}return n}function Va(e){let t=e.tag.toLowerCase();return Ea[t]??(Da.has(t)?`text`:null)}function Ha(e,t,n){return n.root===null||n.blocked||Ma(t)?null:Va(t)||(!n.textAbove&&Fa(e,t)?`text`:Pi(t,`data-layer-id`)!==null||Ba(t)?`box`:null)}function Ua(e,t){let n=e.elements.get(t);return n?Ha(e,n,Ra(e,t)):null}function Wa(e,t){let n=e.elements.get(t);return n?Va(n)||(!Ra(e,t).textAbove&&Fa(e,n)?`text`:`box`):`box`}function Ga(e,t){let n=[];for(let r of e.order){let i=e.elements.get(r);if(!i)continue;let a=Ra(e,r);(t===void 0||a.root===t)&&Ha(e,i,a)!==null&&n.push(r)}return n}var Ka=/^https:\/\/((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*)(?::(\d{1,5}))?$/i;function qa(e){let t=Ka.exec(e.trim());if(!t)return null;let n=t[2];if(n!==void 0&&(Number(n)<1||Number(n)>65535))return null;try{let t=new URL(e.trim());return t.protocol===`https:`?t.origin:null}catch{return null}}function Ja(e){let t=[];for(let n of e){let e=qa(n);if(e&&!t.includes(e)&&t.push(e),t.length===4)break}return t}var Ya=`data-pp-id`,Xa=`data-pp-sel`,Za=`ed-cur`,Qa=new Set([`script`,`iframe`,`object`,`embed`,`base`]),$a=new Set([`href`,`src`,`xlink:href`,`action`,`formaction`]),eo=e=>$a.has(e.toLowerCase());function to(e,t=[]){let n=e?` 'self'`:``;return[`default-src 'none'`,`img-src data: blob: 'self'${Ja(t).map(e=>` ${e}`).join(``)}`,`style-src${n} 'unsafe-inline'`,`font-src data: 'self'`,`script-src 'none'`,`connect-src 'none'`,`form-action 'none'`,`base-uri ${e?`'self'`:`'none'`}`].join(`; `)}function Z(e){return/^javascript:/i.test(e.replace(/[\t\n\r]/g,``).replace(/^[\u0000- ]+/,``))}var no=class{ops=[];insert(e,t,n){this.ops.push({start:e,end:e,text:t,prio:n,seq:this.ops.length})}replace(e,t,n){this.ops.push({start:e,end:t,text:n,prio:9,seq:this.ops.length})}splices(e){let t=[];for(let n of[...e].sort((e,t)=>e[0]-t[0]||t[1]-e[1])){let e=t[t.length-1];(!e||n[0]>=e[1])&&t.push(n)}let n=e=>t.some(([t,n])=>e.start>t&&e.end<n),r=this.ops.filter(e=>!n(e));for(let[e,n]of t)r.push({start:e,end:n,text:``,prio:9,seq:-1});return r.sort((e,t)=>e.start-t.start||Number(e.end>e.start)-Number(t.end>t.start)||e.prio-t.prio||e.seq-t.seq),r.map(({start:e,end:t,text:n})=>({start:e,end:t,text:n}))}};function ro(e,t,n,r){let{source:i}=e,a=t.tag.toLowerCase();if(t.startTagEnd===t.start||i[t.start]!==`<`)return[];if(Qa.has(a)||a===`meta`&&Ni(t,`http-equiv`))return[[t.start,t.end]];let o=t.start+1+t.tag.length,s=` ${Ya}="${t.id}"`,c=Ua(e,t.id);c!==null&&(s+=` ${Xa}="${c}"`);let l=t.id===n,u=!l;for(let n of t.attrs){let a=n.name.toLowerCase();if(a.startsWith(`on`)||a===`data-pp-id`||a===`data-pp-sel`||eo(a)&&Z(n.value)){let[e,a]=Hi(i,t,n);r.replace(e,a,``)}else l&&a===`class`&&(u=!0,io(e,n,r))}return u||(s+=` class="${Za}"`),r.insert(o,s,5),[]}function io(e,t,n){if(t.value.split(/\s+/).includes(`ed-cur`))return;let r=Bi(e.source,t);if(r.quote!==null)n.insert(r.end,r.start===r.end?Za:` ${Za}`,5);else{let e=`${t.value} ${Za}`.trim();n.replace(t.start,t.end,`${t.name}="${Vi(e)}"`)}}function ao(e,t,n,r){let i=[];for(let a of e.order){let o=e.elements.get(a);!o||o.start<t.start||o.end>t.end||i.push(...ro(e,o,n,r))}return i}var oo=e=>e.replace(/<\/(style)/gi,`<\\/$1`),so=e=>/^?(?:\s|<!--[\s\S]*?-->)*<!doctype/i.test(e);function co(e,t){let{source:n}=e,r=new no,i=ao(e,{start:0,end:n.length},t.currentPageId,r),a=t=>t===null?void 0:e.elements.get(t),o=a(e.html),s=a(e.head),c=a(e.body);for(let[e,t]of[[o,0],[s,1],[c,4]])e&&e.startTagEnd===e.start&&r.insert(e.start,`<${e.tag} ${Ya}="${e.id}">`,t);if(s){let e=[`<meta charset="utf-8">`,`<meta http-equiv="Content-Security-Policy" content="${Vi(to(!!t.baseHref,t.imageOrigins))}">`,t.baseHref?`<base href="${Vi(t.baseHref)}">`:``].join(``);r.insert(s.startTagEnd,e,2),r.insert(s.endTagStart??s.end,`<style data-pp-frame>${oo(t.frameCSS)}</style>`,3)}let l=ii(n,r.splices(i));return so(n)?l:`<!doctype html>${l}`}function lo(e,t,n={}){let r=e.elements.get(t);if(!r||r.startTagEnd===r.start)return``;let i=new no,a=ao(e,r,n.currentPageId,i),o=i.splices(a).map(e=>({start:e.start-r.start,end:e.end-r.start,text:e.text}));return ii(e.source.slice(r.start,r.end),o)}var uo=`data-pp-root`,fo=`data-pp-hl`,po=`data-pp-sel`;function mo(e,t){return e.querySelector(`[${Ya}="${t.replace(/["\\]/g,`\\$&`)}"]`)}function ho(e){return e.currentId===null?null:mo(e.doc,e.currentId)}function go(e){let t=[];for(let n of Array.from(e.querySelectorAll(`.slide`))){if(n.parentElement?.closest(`.slide, template`))continue;let e=n.getAttribute(Ya);e&&t.push(e)}return t}function _o(e){let{doc:t}=e;for(let n of e.pageIds){let r=mo(t,n);r&&(r.setAttribute(uo,``),r.classList.toggle(Za,n===e.currentId))}for(let e of Array.from(t.querySelectorAll(`[${fo}]`)))e.removeAttribute(fo);for(let n of e.highlightIds)mo(t,n)?.setAttribute(fo,``)}var vo=`
15
+ html, body { margin: 0; padding: 0; }
16
+ html, body { overflow: hidden !important; scrollbar-width: none; }
17
+ ::-webkit-scrollbar { display: none; }
18
+ [${uo}]:not(.${Za}) { display: none !important; }
19
+ [${po}] { pointer-events: auto !important; }
20
+ * { -webkit-user-select: none; user-select: none; }
21
+ [contenteditable="true"], [contenteditable="true"] [${po}] { pointer-events: auto !important; }
22
+ * { -webkit-user-select: text; user-select: text; }
23
+ [contenteditable="true"] { outline: none; cursor: text; }
24
+ img, svg image { -webkit-user-drag: none; user-drag: none; }
25
+ [${fo}] { outline: 2px solid #ff7a1a !important; outline-offset: -2px; }
26
+ `.trim();function yo(e,t){let n=e.documentElement;n.style.removeProperty(`translate`);let r=t.getBoundingClientRect(),i=-r.left,a=-r.top;return(i!==0||a!==0)&&n.style.setProperty(`translate`,`${i}px ${a}px`),bo(e),{x:i,y:a}}function bo(e){let t=e.scrollingElement??e.documentElement;t.scrollTop!==0&&(t.scrollTop=0),t.scrollLeft!==0&&(t.scrollLeft=0);let n=e.body;n&&n!==t&&(n.scrollTop!==0&&(n.scrollTop=0),n.scrollLeft!==0&&(n.scrollLeft=0))}var xo=`[contenteditable]:not([contenteditable="false"])`;function So(e){let t=e;return t?t.nodeType===1?t:t.parentElement:null}function Co(e,t){let n=So(t);if(!e||!n||!e.contains(n))return{id:null,deepId:null};let r=t=>t&&t!==e&&e.contains(t)?t:null;return{id:r(n.closest(`[data-pp-sel]`))?.getAttribute(`data-pp-id`)??null,deepId:r(n.closest(`[data-pp-id]`))?.getAttribute(`data-pp-id`)??null}}function wo(e){return e.ctrlKey||e.metaKey||[`+`,`=`,`-`,`_`].includes(e.key)?!0:e.key.startsWith(`Arrow`)||[`Delete`,`Backspace`,` `,`PageUp`,`PageDown`,`Enter`,`Escape`,`Tab`].includes(e.key)}function To(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t({name:e.name,type:e.type,dataURL:String(r.result)}),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}function Eo(e){let{state:t,editor:n,emit:r}=e,i=t.doc,a=i.defaultView,o=!0,s=null,c=null,l=null,u=0,d=[],f=(e,t,n,r)=>{e.addEventListener(t,n,r),d.push(()=>e.removeEventListener(t,n,r))},p=()=>ho(t)?.getBoundingClientRect()??{left:0,top:0},m=(e,n)=>{let i=p(),{id:a,deepId:o}=Co(ho(t),n.target);r({type:`pointer`,action:e,id:a,deepId:o,shift:n.shiftKey,alt:n.altKey,meta:n.metaKey||n.ctrlKey,x:n.clientX-i.left,y:n.clientY-i.top})};f(i,`pointerdown`,e=>{if(e.button===0&&e.isPrimary!==!1){if(n.editingId!==null){if(n.contains(e.target))return;n.end(!0)}s=e.pointerId;try{e.target.setPointerCapture?.(e.pointerId)}catch{}m(`down`,e)}}),f(i,`pointermove`,e=>{s!==null&&e.pointerId===s&&m(`move`,e),g(e.target)});let h=e=>{if(s!==null&&e.pointerId===s){s=null;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}m(`up`,e)}};f(i,`pointerup`,e=>{e.button===0&&h(e)}),f(i,`pointercancel`,h),f(i,`dblclick`,e=>{n.contains(e.target)||m(`dblclick`,e)}),f(i,`contextmenu`,e=>{n.contains(e.target)||(e.preventDefault(),m(`contextmenu`,e))}),f(i,`dragstart`,e=>e.preventDefault());function g(e){l=e,!(u||!a)&&(u=a.requestAnimationFrame(()=>{u=0,_(Co(ho(t),l).id)}))}function _(e){!o||e===c||(c=e,r({type:`hover`,id:e}))}let v=()=>{u&&a&&a.cancelAnimationFrame(u),u=0,l=null,_(null)};f(i.documentElement,`pointerleave`,v),f(i.documentElement,`mouseleave`,v),d.push(()=>{u&&a&&a.cancelAnimationFrame(u)}),f(i,`keydown`,e=>{if(e.isComposing||e.keyCode===229)return;let t=So(e.target),i=n.contains(t)||!!t?.closest(xo),a=(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`;i&&!a||(r({type:`key`,key:e.key,code:e.code,ctrl:e.ctrlKey,meta:e.metaKey,shift:e.shiftKey,alt:e.altKey}),(a||wo(e))&&e.preventDefault())},!0),f(i,`wheel`,e=>{e.preventDefault();let t=e.deltaMode===1?16:e.deltaMode===2?a?.innerHeight??1:1;r({type:`wheel`,deltaX:e.deltaX*t,deltaY:e.deltaY*t,ctrl:e.ctrlKey||e.metaKey})},{passive:!1});let y=e=>Array.from(e.dataTransfer?.types??[]).includes(`Files`);return f(i,`dragover`,e=>{(y(e)||n.contains(e.target))&&e.preventDefault()}),f(i,`drop`,e=>{if(e.preventDefault(),n.contains(e.target))return;let a=Array.from(e.dataTransfer?.files??[]).filter(e=>e.type.startsWith(`image/`));if(a.length===0)return;let s=typeof i.elementFromPoint==`function`?i.elementFromPoint(e.clientX,e.clientY):null,{id:c}=Co(ho(t),s??e.target);Promise.all(a.map(To)).then(e=>{o&&r({type:`drop`,id:c,files:e})},()=>void 0)}),()=>{o=!1;for(let e of d.splice(0))e()}}var Do=`http://www.w3.org/1999/xlink`;function Oo(e,t,n,r){let i=e.createRange();return r===`replace`?i.selectNode(n):i.selectNodeContents(n),i.createContextualFragment(t)}function ko(e,t){let n=e.style;if(n)for(let[e,r]of Object.entries(t)){if(r===null||r===``){n.removeProperty(e);continue}let t=/\s*!important\s*$/i.test(r);n.setProperty(e,t?r.replace(/\s*!important\s*$/i,``):r,t?`important`:``)}}function Ao(e,t,n){let r=t.toLowerCase();if(!(r.startsWith(`data-pp-`)||r.startsWith(`on`))&&!(n!==null&&eo(r)&&Z(n)))try{r===`xlink:href`?n===null?e.removeAttributeNS(Do,`href`):e.setAttributeNS(Do,`xlink:href`,n):n===null?e.removeAttribute(t):e.setAttribute(t,n)}catch{}}function jo(e,t,n,r){let i=n===null?null:mo(r,n);e.insertBefore(t,i&&i.parentNode===e&&i!==t?i:null)}function Mo(e,t,n){let r=e.head;if(!r)return;let i=Array.from(r.querySelectorAll(`style[data-popost-font]`)).find(e=>e.getAttribute(`data-popost-font`)===t),a=i??e.createElement(`style`);i||(a.setAttribute(`data-popost-font`,t),r.appendChild(a)),a.textContent=n}function No(e,t){for(let n of t)switch(n.kind){case`style`:{let t=mo(e,n.id);t&&ko(t,n.props);break}case`attr`:{let t=mo(e,n.id);t&&Ao(t,n.name,n.value);break}case`subtrees`:for(let t of n.items){let n=mo(e,t.id);n?.parentNode&&n.replaceWith(Oo(e,t.previewHTML,n,`replace`))}break;case`insert`:{let t=mo(e,n.parentId);t&&jo(t,Oo(e,n.previewHTML,t,`children`),n.beforeId,e);break}case`remove`:mo(e,n.id)?.remove();break;case`move`:{let t=mo(e,n.id),r=mo(e,n.parentId);t&&r&&!t.contains(r)&&jo(r,t,n.beforeId,e);break}case`headStyle`:Mo(e,n.key,n.css)}}var Po=1,Fo=e=>Math.round(e*100)/100;function Io(e,t,n){return e.scrollHeight-e.clientHeight>Po||e.scrollWidth-e.clientWidth>Po||t.x<-1||t.y<-1||t.x+t.width>n.width+Po||t.y+t.height>n.height+Po}function Lo(e,t){let n={rects:{},overflow:[]},r=ho(e);if(!r)return n;let i=r.getBoundingClientRect(),a={width:i.width,height:i.height},o=[];if(t===`page`)for(let e of Array.from(r.querySelectorAll(`[${po}]`))){let t=e.getAttribute(Ya);t&&o.push([t,e])}else for(let n of t){let t=mo(e.doc,n);t&&o.push([n,t])}for(let[e,t]of o){let r=t.getBoundingClientRect(),o={x:Fo(r.left-i.left),y:Fo(r.top-i.top),width:Fo(r.width),height:Fo(r.height)};n.rects[e]=o,t.getAttribute(`data-pp-sel`)===`text`&&Io(t,o,a)&&n.overflow.push(e)}return n}function Ro(e,t,n){let r=mo(e.doc,t),i=e.doc.defaultView;if(!r||!i)return{};let a=i.getComputedStyle(r),o={};for(let e of n)o[e]=a.getPropertyValue(e);return o}var zo=e=>e===`contenteditable`||e===`spellcheck`||e.startsWith(`data-pp-`);function Bo(e){for(let t of Array.from(e.attributes))zo(t.name.toLowerCase())&&e.removeAttribute(t.name)}function Vo(e,t){let n=e.createElement(`template`);n.innerHTML=t;let r=n.content??n;for(let e of Array.from(r.querySelectorAll(`*`)))Bo(e);return n.innerHTML}var Ho={bold:`bold`,italic:`italic`,underline:`underline`,strike:`strikeThrough`},Uo={fontSize:`font-size`,fontFamily:`font-family`,uppercase:`text-transform`};function Wo(e,t){let n=e.getSelection();if(!n||n.rangeCount===0)return null;let r=n.getRangeAt(0);return!r.collapsed&&t.contains(r.commonAncestorContainer)?r:null}function Go(e,t,n){try{return typeof e.execCommand==`function`&&e.execCommand(t,!1,n)}catch{return!1}}var Ko=(e,t)=>e.comparePoint(t,0)>=0&&e.comparePoint(t,t.childNodes.length)<=0;function qo(e){let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);e.remove()}}function Jo(e,t,n,r){let i=e.createElement(`span`);i.appendChild(t.extractContents());for(let e of Array.from(i.querySelectorAll(`[style]`)))e.style.removeProperty(n),e.getAttribute(`style`)?.trim()||e.removeAttribute(`style`);i.style.setProperty(n,r),t.insertNode(i);let a=e.createRange();a.selectNodeContents(i);let o=e.getSelection();o?.removeAllRanges(),o?.addRange(a)}function Yo(e,t,n){let r=Wo(e,t);if(!r)return!1;let{command:i}=n;if(i in Ho)Go(e,`styleWithCSS`,`true`),Go(e,Ho[i]);else if(i===`color`&&`value`in n)Go(e,`styleWithCSS`,`true`),Go(e,`foreColor`,n.value);else if(i===`clear`){Go(e,`removeFormat`);let n=Wo(e,t)??r;for(let e of Array.from(t.querySelectorAll(`span[style]`)))Ko(n,e)&&qo(e)}else if(i in Uo){let t=`value`in n?n.value:`uppercase`;if(i===`uppercase`){let n=r.startContainer,i=n.nodeType===1?n:n.parentElement,a=e.defaultView;i&&a?.getComputedStyle(i).textTransform===`uppercase`&&(t=`none`)}Jo(e,r,Uo[i],t)}else return!1;return!0}function Xo(e,t,n){try{return typeof e.execCommand==`function`&&e.execCommand(t,!1,n)}catch{return!1}}function Zo(e){if(Xo(e,`insertLineBreak`))return;let t=e.getSelection()?.rangeCount?e.getSelection().getRangeAt(0):null;if(!t)return;t.deleteContents();let n=e.createElement(`br`);t.insertNode(n),t.setStartAfter(n),t.collapse(!0)}function Qo(e,t){t.replace(/\r\n?/g,`
27
+ `).split(`
28
+ `).forEach((t,n)=>{if(n>0&&Zo(e),!t||Xo(e,`insertText`,t))return;let r=e.getSelection(),i=r?.rangeCount?r.getRangeAt(0):null;if(!i)return;i.deleteContents();let a=e.createTextNode(t);i.insertNode(a),i.setStartAfter(a),i.collapse(!0)})}function $o(e,t,n){let r=e;if(typeof r.caretRangeFromPoint==`function`)return r.caretRangeFromPoint(t,n);let i=typeof r.caretPositionFromPoint==`function`?r.caretPositionFromPoint(t,n):null;if(!i)return null;let a=e.createRange();return a.setStart(i.offsetNode,i.offset),a.collapse(!0),a}var es=class{deps;cur=null;constructor(e){this.deps=e}get editingId(){return this.cur?.id??null}contains(e){return!!this.cur&&!!e&&this.cur.el.contains(e)}begin(e,t,n,r){let i=this.deps.state.doc;this.cur&&this.cur.id!==e&&this.end(!0);let a=mo(i,e);a&&(this.cur||this.activate(e,a),a.focus({preventScroll:!0}),this.placeCaret(a,t,n,r),this.deps.resetScroll(),this.emitState())}end(e){let t=this.cur;if(!t)return;this.cur=null,t.teardown();let n=this.deps.state.doc,r=Vo(n,t.el.innerHTML),i=e&&r!==t.cleanOriginal;!i&&t.el.innerHTML!==t.originalHTML&&(t.el.innerHTML=t.originalHTML),this.restoreAttr(t.el,`contenteditable`,t.contenteditable),this.restoreAttr(t.el,`spellcheck`,t.spellcheck),n.getSelection()?.removeAllRanges(),t.el.blur(),this.deps.resetScroll(),this.deps.emit(i?{type:`textCommit`,id:t.id,html:r}:{type:`textCancel`,id:t.id})}format(e){let t=this.cur;t&&Yo(this.deps.state.doc,t.el,e)&&this.emitState()}discard(){let e=this.cur;e&&(this.cur=null,e.teardown())}checkConnected(){this.cur&&!this.cur.el.isConnected&&this.discard()}emitState(){let e=this.cur;if(!e)return;let t=this.deps.state.doc,n=e=>{try{return typeof t.queryCommandState==`function`&&t.queryCommandState(e)}catch{return!1}},r={type:`textState`,id:e.id,range:Wo(t,e.el)!==null,active:{bold:n(`bold`),italic:n(`italic`),underline:n(`underline`),strike:n(`strikeThrough`)}};this.deps.emit(r)}restoreAttr(e,t,n){n===null?e.removeAttribute(t):e.setAttribute(t,n)}activate(e,t){let n=this.deps.state.doc,r=t.innerHTML,i={id:e,el:t,originalHTML:r,cleanOriginal:Vo(n,r),contenteditable:t.getAttribute(`contenteditable`),spellcheck:t.getAttribute(`spellcheck`),composing:!1,teardown:()=>void 0};t.setAttribute(`contenteditable`,`true`),t.setAttribute(`spellcheck`,`false`);let a=e=>{i.composing||e.isComposing||e.keyCode===229||(e.key===`Escape`||e.key===`Tab`?(e.preventDefault(),this.end(!0)):e.key===`Enter`&&(e.preventDefault(),Zo(n)))},o=e=>{e.preventDefault(),Qo(n,e.clipboardData?.getData(`text/plain`)??``)},s=()=>this.end(!0),c=()=>void(i.composing=!0),l=()=>void(i.composing=!1),u=()=>{let e=n.getSelection();e?.rangeCount&&t.contains(e.getRangeAt(0).commonAncestorContainer)&&this.emitState()};t.addEventListener(`keydown`,a),t.addEventListener(`paste`,o),t.addEventListener(`blur`,s),t.addEventListener(`compositionstart`,c),t.addEventListener(`compositionend`,l),n.addEventListener(`selectionchange`,u),i.teardown=()=>{t.removeEventListener(`keydown`,a),t.removeEventListener(`paste`,o),t.removeEventListener(`blur`,s),t.removeEventListener(`compositionstart`,c),t.removeEventListener(`compositionend`,l),n.removeEventListener(`selectionchange`,u)},this.cur=i}placeCaret(e,t,n,r){let i=this.deps.state.doc,a=i.getSelection();if(!a)return;let o=null;if(t===`point`&&n!==void 0&&r!==void 0){let t=this.deps.origin(),a=$o(i,n+t.x,r+t.y);a&&e.contains(a.startContainer)&&(o=a)}o||(o=i.createRange(),o.selectNodeContents(e),t!==`all`&&o.collapse(!1)),a.removeAllRanges(),a.addRange(o)}};function ts(e,t,n,r){let i=e.defaultView,a={doc:e,pageIds:[...t],currentId:n??t[0]??null,highlightIds:[]},o=!0,s=0,c=e=>{o&&r(e)},l=new es({state:a,emit:c,resetScroll:()=>bo(e),origin:()=>{let e=ho(a)?.getBoundingClientRect();return{x:e?.left??0,y:e?.top??0}}}),u=()=>{if(!o)return;let t=ho(a);t&&yo(e,t),c({type:`rects`,...Lo(a,`page`)})},d=()=>{if(s||!o)return;let e=()=>{s=0,u()};s=i?i.requestAnimationFrame(e):setTimeout(e,16)},f=i?.ResizeObserver,p=f?new f(()=>d()):null,m=()=>{if(!p)return;p.disconnect(),p.observe(e.documentElement);let t=ho(a);if(t){p.observe(t);for(let e of Array.from(t.querySelectorAll(`[${po}]`)))p.observe(e)}},h=()=>d();e.addEventListener(`load`,h,!0);let g=e.fonts;g?.addEventListener?.(`loadingdone`,h);let _=()=>bo(e);e.addEventListener(`scroll`,_,!0);let v=Eo({state:a,editor:l,emit:c});_o(a);let y=ho(a);return y&&yo(e,y),m(),{start(){c({type:`ready`,pages:[...a.pageIds]}),(g?.ready??Promise.resolve()).then(()=>{o&&(c({type:`fontsReady`}),u())})},send(t){if(o)switch(t.type){case`live`:if(No(e,t.updates),l.checkConnected(),a.pageIds=go(e),_o(a),a.currentId!==null){let t=ho(a);t&&yo(e,t)}m(),d();break;case`currentPage`:a.currentId=t.id,_o(a),m(),u();break;case`beginTextEdit`:l.begin(t.id,t.caret,t.x,t.y);break;case`endTextEdit`:l.end(t.commit);break;case`format`:l.format(t.format);break;case`highlight`:a.highlightIds=[...t.ids],_o(a)}},measure:e=>Lo(a,e),styles:(e,t)=>Ro(a,e,t),dispose(){o&&(l.discard(),o=!1,v(),p?.disconnect(),e.removeEventListener(`load`,h,!0),e.removeEventListener(`scroll`,_,!0),g?.removeEventListener?.(`loadingdone`,h),s&&i&&i.cancelAnimationFrame(s),s=0)}}}var ns=3e4,rs=Symbol(`superseded`);function is(){let e=new Uint8Array(16);return globalThis.crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function as(e,t,n){return new Promise((r,i)=>{let a,o,s=()=>{e.removeEventListener(`load`,c),clearTimeout(a),clearInterval(o)},c=()=>{let n=null;try{n=e.contentDocument}catch{n=null}n&&n.location?.href===`about:blank`&&t!==`about:blank`||(s(),r(n))};n(()=>{s(),r(rs)}),a=setTimeout(()=>{s(),i(Error(`Edit frame did not load in time`))},ns),e.addEventListener(`load`,c),e.src=t;let l=new URL(t,e.ownerDocument?.baseURI).href;o=setInterval(()=>{try{let t=e.contentDocument;t?.location.href===l&&t.readyState!==`loading`&&c()}catch{}},25)})}function os(e){let t=new Set,n=0,r=null,i=null,a=e=>{for(let n of Array.from(t))try{n(e)}catch(e){console.error(`frame listener failed`,e)}},o=()=>{r?.(),r=null,i?.dispose(),i=null};async function s(t,s,c){let l=++n;o();let u=ma(s).map(e=>e.id),d=co(s,{frameCSS:vo,baseHref:e.baseHref,imageOrigins:e.imageOrigins,currentPageId:c.currentPageId??void 0}),f=await e.store.preview(d,(e.nonce??is)());if(l!==n)return;let p=await as(t,f,e=>{r=e});if(p!==rs&&l===n){if(r=null,!p)throw Error(`Edit frame document is not accessible (it must be same-origin with the editor)`);i=ts(p,u,c.currentPageId,a),i.start()}}return{mount:s,send:e=>i?.send(e),measure:e=>i?.measure(e)??{rects:{},overflow:[]},styles:(e,t)=>i?.styles(e,t)??{},on(e){return t.add(e),()=>void t.delete(e)},dispose(){n++,o(),t.clear()}}}function ss(){return window.parent!==window}function cs(e){return ss()?(window.parent.postMessage(e,window.location.origin),!0):!1}function ls(e,t){if(e.source!==window.parent||e.origin!==window.location.origin)return!1;let n=e.data;return typeof n==`object`&&!!n&&n.source===t}function us(e,t){if(!ss()||!ls(e,`popost-workspace`))return!1;let n=e.data;return n.type===`store-changed`&&n.id===t}function ds(e,t){let n=n=>{us(n,e)&&t()};return window.addEventListener(`message`,n),()=>window.removeEventListener(`message`,n)}function fs(e){document.documentElement.classList.toggle(`dark`,e===`dark`)}function ps(e){if(!ss()||!ls(e,`popost-workspace`))return null;let t=e.data;return t.type===`popost-theme`&&(t.mode===`dark`||t.mode===`light`)?t.mode:null}function ms(e,t){e.theme&&fs(e.theme);let n=e=>{let n=ps(e);n&&(fs(n),t?.(n))};return window.addEventListener(`message`,n),()=>window.removeEventListener(`message`,n)}function hs(){let e=window.__POPOST_PARAMS__;return typeof e==`string`&&e!==``?e:window.location.search}function gs(e){let t=new URLSearchParams(e),n=t.get(`theme`);return{popost:t.has(`popost`),file:t.get(`file`)||null,ratio:t.get(`ratio`)||null,lang:t.get(`lang`)===`en`?`en`:`zh`,name:t.get(`name`)||null,embedded:t.get(`embedded`)!==`0`,theme:n===`dark`||n===`light`?n:null,store:t.get(`store`)===`host`?`host`:`browser`}}function _s(e,t){return t===`host`?Ja((new URLSearchParams(e).get(`imageOrigins`)??``).split(`,`)):[]}function vs(){let e=hs();return window.__POPOST_LOCAL__?[]:_s(e,gs(e).store)}function ys(){return gs(hs())}function bs(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function xs(){let e=window.__POPOST_LOCAL__;if(!e||typeof e!=`object`)return null;let{projectId:t,width:n,height:r,name:i,cloud:a,comparison:o}=e;if(typeof t!=`string`||!t||!bs(n)||!bs(r))return null;let s=typeof a==`object`&&a?a.mode:void 0;return{projectId:t,width:n,height:r,...o===!0?{comparison:!0}:{},name:typeof i==`string`&&i?i:`Popost`,...s===`keyed`||s===`anonymous`?{cloud:{mode:s}}:{}}}var Ss=class extends Error{status=409},Cs=12e4,ws=class extends Error{reason;constructor(e,t){super(t),this.reason=e}},Ts=null;function Es(e){let t=Ts;if(!t||!ls(e,`popost-workspace`))return;let n=e.data;if(n.type!==`download-images-result`||n.requestId!==t.requestId||n.id!==t.id)return;let r=typeof n.error==`string`&&n.error?new ws(`host`,n.error):void 0;t.finish(r)}function Ds(e,t,n=Cs){return Ts?Promise.reject(new ws(`busy`,`Download in progress`)):!e||!ss()?Promise.reject(new ws(`unavailable`,`Open this canvas from the project.`)):new Promise((r,i)=>{let a=crypto.randomUUID(),o=setTimeout(()=>s.finish(new ws(`timeout`,`Download timed out. Please retry.`)),n),s={requestId:a,id:e,finish:e=>{clearTimeout(o),window.removeEventListener(`message`,Es),Ts=null,e?i(e):r()}};Ts=s,window.addEventListener(`message`,Es);try{cs({source:`popost-editor`,type:`download-images`,id:e,requestId:a,html:t})}catch(e){s.finish(e instanceof Error?e:Error(String(e)))}})}var Os=6e4,ks=class extends Error{code;constructor(e,t){super(t),this.code=e}},As=new Map;function js(e,t){let n=As.get(e);n&&(As.delete(e),clearTimeout(n.timer),As.size===0&&window.removeEventListener(`message`,Ns),`error`in t?n.reject(t.error):n.resolve(t.result))}function Ms(e){let t=e??{};return new ks(typeof t.code==`string`&&t.code?t.code:`host`,typeof t.message==`string`&&t.message?t.message:`Request failed`)}function Ns(e){if(!ls(e,`popost-workspace`))return;let t=e.data;if(t.type!==`store-result`||typeof t.requestId!=`string`)return;let n=As.get(t.requestId);!n||t.id!==n.id||js(t.requestId,t.ok===!0?{result:t.result}:{error:Ms(t.error)})}function Ps(e,t,n={},r=Os){return!e||!ss()?Promise.reject(new ks(`unavailable`,`Open this canvas from the project.`)):new Promise((i,a)=>{let o=crypto.randomUUID(),s=setTimeout(()=>js(o,{error:new ks(`timeout`,`The project did not respond. Please retry.`)}),r);As.size===0&&window.addEventListener(`message`,Ns),As.set(o,{id:e,resolve:i,reject:a,timer:s});try{cs({...n,source:`popost-editor`,type:`store`,id:e,requestId:o,op:t})}catch(e){js(o,{error:e instanceof Error?e:Error(String(e))})}})}var Fs=`popost-product:`,Is=`popost-workspace-v24`,Ls=`records`,Rs=`项目保存失败,请检查浏览器存储权限。`,zs=new Map,Bs,Vs,Hs=Promise.resolve(),Us;function Ws(){return new Promise((e,t)=>{let n=indexedDB.open(Is,1);n.onupgradeneeded=()=>{n.result.createObjectStore(Ls)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error),n.onblocked=()=>t(Error(`浏览器项目存储被占用,请关闭旧工作台页面后重试。`))})}function Gs(){if(!Bs)throw Error(`项目存储尚未初始化`);return Bs}function Ks(e){return new Promise((t,n)=>{let r=Gs().transaction(Ls,`readwrite`),i=r.objectStore(Ls);for(let[t,n]of e)i.put(n,t);r.oncomplete=()=>t(),r.onabort=r.onerror=()=>n(r.error??Error(`项目存储写入失败`))})}function qs(){return new Promise((e,t)=>{let n=Gs().transaction(Ls,`readonly`),r=n.objectStore(Ls).openCursor();r.onsuccess=()=>{let e=r.result;e&&(zs.set(String(e.key),e.value),e.continue())},n.oncomplete=()=>e(),n.onerror=()=>t(n.error)})}function Js(){let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(!n?.startsWith(Fs))continue;let r=n.slice(15);if(!zs.has(r))try{let t=JSON.parse(localStorage.getItem(n)??`null`);zs.set(r,t),e.push([r,t])}catch{}}return e}function Ys(){return Vs??=(async()=>{Bs=await Ws(),await qs();let e=Js();e.length&&await Ks(e)})(),Vs}function Xs(e,t){if(zs.has(e))return zs.get(e);try{return JSON.parse(localStorage.getItem(Fs+e)||`null`)??t}catch{return t}}function Zs(e){Us=e;let t=e instanceof Error&&e.message?e.message:Rs;throw window.dispatchEvent(new CustomEvent(`popost-storage-error`,{detail:t})),e}function Qs(e,t){let n=structuredClone(t);zs.set(e,n),Hs=Hs.catch(()=>{}).then(async()=>{await Ys(),await Ks([[e,n]]),Us=void 0}).catch(Zs),Hs.catch(()=>{})}async function $s(){if(await Ys(),await Hs,Us)throw Us}function ec(e){return new Promise((t,n)=>{let r=Gs().transaction(Ls,`readonly`).objectStore(Ls).get(e);r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error)})}async function tc(e,t){await Ys();let n=await ec(e)??t;return zs.set(e,n),n}var nc=`公共字体库无法读取`,rc=`该字体不在公共字体库中`;function ic(e){let t=e?.roles;if(!Array.isArray(t))throw Error(nc);return{roles:t}}async function ac(e,t=fetch){let n=await t(e);if(!n.ok)throw Error(nc);return ic(await n.json())}var oc=`palette.json`,sc=`/api/font-palette`;function cc(){return new URL(`../fonts/popost/`,document.baseURI)}function lc(e){let t=e.family.replace(` Variable`,``);return e.label.toLowerCase()===t.toLowerCase()?t:`${e.label} · ${t}`}function uc(e){return{label:lc(e),value:e.family,title:`${e.group} · ${e.weights} · OFL-1.1`,fontId:e.id}}function dc(e){let t=new Map;for(let n of e){let e=n.group||`Fonts`,r=t.get(e);r||(r={label:e,options:[]},t.set(e,r)),r.options.push(uc(n))}return[...t.values()]}var fc=/[㐀-鿿]/u;function pc(e){return fc.test(e)}function mc(e){return e.endsWith(`-tc`)?`cjk-sans-tc`:`cjk-sans`}function hc(e,t){let n=[`"${e.family}"`];return t&&n.push(`"${t.family}"`),n.push(e.fallback||`sans-serif`),n.join(`, `)}function gc(e,t,n){let r=e.find(e=>e.family===t);if(!r)throw Error(rc);let i=e.find(e=>e.id===mc(r.id))??null,a=pc(n)&&i&&i.id!==r.id?i:null;return{role:r,fallback:a,needed:a?[r,a]:[r],stack:hc(r,a)}}var _c=/url\(\s*['"]?([^)'"\s]+)['"]?\s*\)/g,vc=8;function yc(e){return[...new Set([...e.matchAll(_c)].map(e=>e[1]))]}function bc(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}function xc(e,t){return e.replace(_c,(e,n)=>`url("${t.get(n)}")`)}function Sc(e,t,n){return`/* ${e.package}@${e.packageVersion}\n${t}\n*/\n${n}`}async function Cc(e,t,n){let r=await e(t);if(!r.ok)throw Error(n);return r}async function wc(e,t,n,r){let i=new Map,a=0;async function o(){for(;a<t.length;){let o=t[a++],s=await Cc(e,new URL(o,n),`字体文件缺失:`+r);i.set(o,`data:font/woff2;base64,`+bc(new Uint8Array(await s.arrayBuffer())))}}return await Promise.all(Array.from({length:Math.min(vc,t.length)},o)),i}async function Tc(e,t,n=fetch){let r=new URL(e.cssPath??`css/${e.id}.css`,t),i=await(await Cc(n,r,`字体样式缺失:`+e.label)).text(),a=await wc(n,yc(i),r,e.label);return Sc(e,await Dc(e,t,n),xc(i,a))}async function Ec(e,t,n=fetch){let r=new URL(e.cssPath??`css/${e.id}.css`,t),i=await(await Cc(n,r,`字体样式缺失:`+e.label)).text(),a=new Map(yc(i).map(e=>[e,new URL(e,r).pathname]));return Sc(e,await Dc(e,t,n),xc(i,a))}async function Dc(e,t,n){return(await Cc(n,new URL(e.licensePath??`${e.id}/LICENSE`,t),`字体授权文件缺失:`+e.label)).text()}function Oc(e,t=fetch,n=Tc){let r=new Map;return i=>{let a=r.get(i.id);return a||(a=n(i,e,t).catch(e=>{throw r.delete(i.id),e}),r.set(i.id,a)),a}}var kc=6e5;function Ac(e={}){let t=e.fetch??((e,t)=>fetch(e,t)),n=e.fontBase?new URL(String(e.fontBase),document.baseURI):cc(),r=Oc(n,t,e.fonts===`link`?Ec:Tc),i;function a(){return i??=ac(new URL(oc,n),t),i.catch(()=>{i=void 0}),i}async function o(e,t){let n=(await a()).roles,i={};for(let t of e){let e=n.find(e=>e.id===t);if(!e)throw Error(`该字体不在公共字体库中`);i[t]=await r(e)}return{css:i,rev:t.rev}}return{fontPalette:a,fontCSS:o}}async function jc(e){let t=URL.createObjectURL(new Blob([e],{type:`text/html`}));return setTimeout(()=>URL.revokeObjectURL(t),kc),t}var Mc=5,Nc=()=>String(Date.now());function Pc(e){return String(e??``).replace(/\.html$/,``)}function Fc(e){let t=Xs(`state`,{projects:[]}).projects.find(t=>t.id===e);if(!t)throw Error(`Project not found`);return t}function Ic(e){let t=Xs(`initial-decks`,{}),n=t[e];if(n)return n;let r=Xs(`deck-history`,{})[e]??[],i=r[r.length-1];if(!i)return{content:``,source:`current`,createdAt:``};let a={content:i.content||``,source:`earliest-retained-history`,createdAt:new Date().toISOString()};return Qs(`initial-decks`,{...t,[e]:a}),a}async function Lc(e){for(let[t,n]of e)await tc(t,n)}function Rc(e,t,n){return!!e&&!!t&&e!==t&&!n}function zc(e,t){let n=Xs(`deck-history`,{});n[e]=[{name:Nc(),content:t},...n[e]??[]].slice(0,Mc),Qs(`deck-history`,n)}function Bc(e,t={}){let n=Pc(e.file),r=n+`.html`,{fontPalette:i,fontCSS:a}=Ac(t);async function o(){await Ys(),await Lc([[`state`,{projects:[]}],[`decks`,{}]]);let t=Fc(n),i=Xs(`decks`,{})[n];if(!i)throw Error(`Project content missing`);return{content:i,rev:Xs(`revs`,{})[n]||`1`,name:e.name||t.name||n,path:r}}async function s(e,t){await Ys(),await Lc([[`decks`,{}],[`revs`,{}],[`deck-history`,{}],[`initial-decks`,{}]]),Fc(n),Ic(n);let r=Xs(`decks`,{}),i=Xs(`revs`,{});if(Rc(t.rev,i[n],t.force))throw new Ss(`File changed`);zc(n,r[n]??``),r[n]=e,Qs(`decks`,r);let a=Nc();return i[n]=a,Qs(`revs`,i),await $s(),cs({source:`popost-editor`,type:`saved`,id:n}),{rev:a}}async function c(){await Ys(),await tc(`initial-decks`,{}),Fc(n);let e=Ic(n);return{content:e.content,available:!!e.content&&(e.source===`create`||e.source===`earliest-retained-history`),reliable:e.source===`create`,source:e.source,createdAt:e.createdAt}}async function l(e,t){return await Ds(n,e),{rev:t.rev}}return{mode:`browser`,load:o,save:s,initial:c,preview:jc,fontPalette:i,fontCSS:a,downloadAll:l}}var Vc=e=>typeof e==`string`?e:``;function Hc(e,t){if(typeof e!=`string`)throw new ks(`invalid-reply`,`The project returned no ${t}.`);return e}function Uc(e,t={}){let n=Pc(e.file),r=n+`.html`,{fontPalette:i,fontCSS:a}=Ac({fonts:`link`,...t});async function o(){let t=await Ps(n,`load`)??{};return{content:Hc(t.content,`content`),rev:Hc(t.rev,`revision`),name:Vc(t.name)||e.name||n,path:r}}async function s(e,t){try{return{rev:Hc((await Ps(n,`save`,{content:e,rev:t.rev,force:!!t.force})??{}).rev,`revision`)}}catch(e){throw e instanceof ks&&e.code===`conflict`?new Ss(e.message):e}}async function c(){let e=await Ps(n,`initial`)??{},t=Vc(e.content);return{content:t,available:e.available===!0&&t!==``,reliable:e.reliable===!0,source:Vc(e.source)||`host`,createdAt:Vc(e.createdAt)}}async function l(e,t){return await Ds(n,e),{rev:t.rev}}return{mode:`browser`,load:o,save:s,initial:c,preview:jc,fontPalette:i,fontCSS:a,downloadAll:l}}var Wc=e=>new DOMParser().parseFromString(e,`text/html`);function Gc(e,t,n){if(!e||/^(data:|blob:|#)/i.test(e))return e;let r=new URL(e,t);if(r.origin!==n)throw Error(`本地工程不能依赖站外资源,请先导入图片和字体。`);return`../`+r.pathname.slice(1)+r.search+r.hash}function Kc(e,t,n){return e.replace(/url\(\s*(['"]?)([^)'"\s]+)\1\s*\)/gi,(e,r,i)=>`url("${Gc(i,t,n)}")`)}var qc=/^(--|background(?:-|$)|color$|font(?:-|$)|line-height$|letter-spacing$|word-spacing$|text-(?:align|transform|indent|rendering)$|direction$|writing-mode$|white-space$|visibility$)/;function Jc(e){let t=[],n=0,r=``,i=!1,a=0;for(let o=0;o<e.length;o++){let s=e[o];if(i){i=!1;continue}if(s===`\\`){i=!0;continue}if(r){s===r&&(r=``);continue}if(s===`"`||s===`'`){r=s;continue}s===`(`||s===`[`?n++:s===`)`||s===`]`?n--:s===`,`&&!n&&(t.push(e.slice(a,o)),a=o+1)}return t.push(e.slice(a)),t}function Yc(e,t){return[...e].filter(t).map(t=>`${t}:${e.getPropertyValue(t)}${e.getPropertyPriority(t)?`!important`:``}`).join(`;`)}function Xc(e,t,n){if(/^\s*(?::root|html|body)\s*$/.test(e))return`:scope{${Yc(t,e=>qc.test(e))}}`;let r=e.trim().replace(/^(?:(?:html|body|:root)\s+)+/,``),i=r.match(/^[^\s>+~]+/)?.[0],a=r;try{i&&n.matches(i)&&(a+=`,:scope`+r.slice(i.length))}catch{}return`${a}{${t.cssText}}`}function Zc(e,t){let n=new CSSStyleSheet;n.replaceSync(e);let r=[];function i(e){return[...e].map(e=>{if(e.type===CSSRule.FONT_FACE_RULE)return r.push(e.cssText),``;if(e.type===CSSRule.STYLE_RULE){let n=e;return Jc(n.selectorText).map(e=>Xc(e,n.style,t)).join(`
29
+ `)}let n=e.cssRules;return n&&!/^@(?:font-face|keyframes)/i.test(e.cssText)?e.cssText.slice(0,e.cssText.indexOf(`{`)+1)+i(n)+`}`:e.cssText}).join(`
30
+ `)}let a=i(n.cssRules);return r.join(`
31
+ `)+`
32
+ @scope {
33
+ `+a+`
34
+ }`}function Qc(e,t,n){let r=t.get(e.href);return r||(r=n.fetchStylesheet(e).then(t=>Kc(t,e.href,n.origin)),t.set(e.href,r)),r}async function $c(e,t,n,r,i){let a=``;for(let o of e)if(o.tagName===`STYLE`)a+=Kc(o.textContent??``,t,i.origin)+`
35
+ `;else{let e=new URL(o.getAttribute(`href`)??``,t);if(e.origin!==i.origin)throw Error(n);a+=await Qc(e,r,i)+`
36
+ `}return a}function el(e,t,n){let r=e.createElement(`style`);return r.dataset[t]=``,r.textContent=n,r}async function tl(e,t,n,r,i){let a=await $c(e.querySelectorAll(`style,link[rel="stylesheet"]`),n,`请先将字体和样式保存到工程内`,r,i);t.querySelectorAll(`style,link[rel="stylesheet"]`).forEach(e=>e.remove()),t.prepend(el(e,`popostStyle`,Zc(a,t)))}async function nl(e,t,n,r,i){let a=await $c(e.head.querySelectorAll(`style,link[rel="stylesheet"]`),n,`本地样式文件不可指向站外`,r,i);t.querySelectorAll(`style[data-popost-head-style]`).forEach(e=>e.remove()),a.trim()&&t.append(el(e,`popostHeadStyle`,Zc(a,t)))}function rl(e,t,n){for(let r of[e,...e.querySelectorAll(`*`)]){for(let e of[`src`,`href`,`poster`])r.hasAttribute(e)&&r.setAttribute(e,Gc(r.getAttribute(e)??``,t,n));r.hasAttribute(`style`)&&r.setAttribute(`style`,Kc(r.getAttribute(`style`)??``,t,n))}}function il(e,t){e.classList.add(`slide`),e.dataset.popostPage=t.id,e.dataset.popostWidth=String(t.width),e.dataset.popostHeight=String(t.height),e.dataset.popostName=t.name||t.id,e.style.width=t.width+`px`,e.style.height=t.height+`px`,e.style.position||(e.style.position=`relative`),e.style.overflow||(e.style.overflow=`hidden`)}async function al(e,t,n){let r=Wc(e.html),i=r.querySelector(`.slide[data-popost-page],.post,.page`);if(!i)throw Error(`页面 ${e.id} 缺少 .post/.page 画布根节点`);let a=new URL(e.htmlPath,n.origin+`/`).href;return i.hasAttribute(`data-popost-page`)?await nl(r,i,a,t,n):await tl(r,i,a,t,n),rl(i,a,n.origin),il(i,e),i.outerHTML}var ol=`<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0}.slide{box-sizing:border-box}</style></head><body>`;async function sl(e,t){let n=new Map;return ol+(await Promise.all(e.pages.map(e=>al(e,n,t)))).join(`
37
+ `)+`</body></html>`}function cl(){return`p-`+crypto.randomUUID().replace(/-/g,``).slice(0,12)}function ll(e,t,n){let r=e.dataset.popostPage;return(!r||!/^[\w-]{1,64}$/.test(r)||t.has(r))&&(r=n()),t.add(r),e.dataset.popostPage=r,r}function ul(e){let t=new Set;return e.replace(/@font-face\s*\{[^{}]*\}/gi,e=>{let n=e.replace(/\s+/g,` `).trim();return t.has(n)?``:(t.add(n),e)})}function dl(e,t){let n=e.head.cloneNode(!0);return n.querySelectorAll(`script,base,meta[http-equiv]`).forEach(e=>e.remove()),ul(`<!doctype html><html><head><meta charset="utf-8">`+n.innerHTML+`</head><body style="margin:0">`+t.outerHTML+`</body></html>`)}function fl(e,t){let n=Wc(e),r=[...n.querySelectorAll(`.slide`)].filter(e=>!e.parentElement?.closest(`.slide`));if(!r.length)throw Error(`请至少保留一页图文`);let i=new Set,a=t.newPageId??cl;return r.map((e,r)=>{let o=ll(e,i,a),s=t.previousPages.find(e=>e.id===o),c=Number(e.dataset.popostWidth||s?.width||t.defaultSize.width),l=Number(e.dataset.popostHeight||s?.height||t.defaultSize.height);return e.style.width=c+`px`,e.style.height=l+`px`,{id:o,name:e.dataset.popostName||`Page ${r+1}`,width:c,height:l,role:s?.role||`content`,html:dl(n,e)}})}var pl=class extends Error{status;constructor(e,t){super(e),this.status=t}},ml=`/api/export?page=all`,hl=`popost-images.zip`;function gl(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),6e4)}function _l(e,t){let n=async(e,n)=>{let r=await t(e,{method:n===void 0?`GET`:`POST`,headers:n===void 0?{}:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n),cache:`no-store`});return{status:r.status,data:await r.json()}},r=e=>new pl(typeof e.data.error==`string`?e.data.error:`HTTP ${e.status}`,e.status),i=e=>{if(typeof e.data.state!=`string`)throw r(e);return e.data};return{mode:e,async status(){return i(await n(`/api/cloud/status`))},async start(e){let t=await n(`/api/cloud/start`,{lang:e});if(t.status!==200||t.data.ok===!1||typeof t.data.authorizeUrl!=`string`)throw r(t);return{authorizeUrl:t.data.authorizeUrl,expiresAt:String(t.data.expiresAt??``)}},async push(e={}){return i(await n(`/api/cloud/push`,{force:e.force===!0,...e.lang?{lang:e.lang}:{}}))}}}function vl(e,t={}){let n=t.fetch??((e,t)=>fetch(e,t)),r=t.origin??window.location.origin,i=`pages/${e.projectId}.html`,a;async function o(e,t){let r=await n(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?{}:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),cache:`no-store`}),i=await r.json();if(!r.ok||i.ok===!1)throw new pl(i.error||`HTTP ${r.status}`,r.status);return i}let s={origin:r,async fetchStylesheet(e){let t=await n(e);if(!t.ok)throw Error(`样式文件无法读取:`+e.pathname);return t.text()}};async function c(){return a=await o(`/api/project`),await o(`/api/canvas-initial`),{content:await sl(a.manifest,s),rev:a.canvasRev,name:e.name,path:i}}async function l(t,n){let r=fl(t,{previousPages:a?.manifest.pages??[],defaultSize:e}),i;try{i=await o(`/api/project`,{pages:r,canvasRev:n.rev,force:n.force??!1})}catch(e){throw e instanceof pl&&e.status===409?new Ss(e.message):e}return a=await o(`/api/project`),{rev:i.canvasRev}}async function u(){let e=await o(`/api/canvas-initial`);return{content:await sl(e.manifest,s),available:!0,reliable:!0,source:`local-open`,createdAt:e.createdAt}}async function d(e,t){return(await o(`/api/canvas-preview`,{content:e,nonce:t})).url}let f=()=>ac(sc,n);async function p(e,t){let r=await o(`/api/font-install`,{roles:e.join(`,`),resourceOnly:!0,canvasRev:t.rev}),i={};for(let t of e){let e=await n(`/css/${t}.css`,{cache:`no-store`});if(!e.ok)throw Error(`字体样式无法读取`);i[t]=await e.text()}return{css:i,rev:r.canvasRev}}async function m(e,t){let r=await n(`/api/import-image`,{method:`POST`,headers:{"Content-Type":`application/octet-stream`,"X-Popost-Canvas-Rev":t.rev},body:e}),i=await r.json();if(!r.ok||i.ok===!1)throw new pl(i.error||`HTTP ${r.status}`,r.status);return{image:{src:`/`+i.asset.path,name:e.name,width:i.width,height:i.height},rev:i.canvasRev}}async function h(e,t){let r=await l(e,{rev:t.rev,force:!0}),i=await n(ml,{cache:`no-store`});if(!i.ok){let e;try{e=(await i.json()).error}catch{}throw Error(e||`下载失败`)}return gl(await i.blob(),hl),{rev:r.rev}}return{mode:`local`,load:c,save:l,initial:u,preview:d,fontPalette:f,fontCSS:p,uploadImage:m,downloadAll:h,...e.cloud?{cloud:_l(e.cloud.mode,n)}:{}}}var yl={taken:0,declined:0},bl=64,xl=new Set([`input`,`font`,`annotation-xml`,`template`,`frameset`,`frame`]),Sl=new Set(`attributename.attributetype.basefrequency.baseprofile.calcmode.clippathunits.diffuseconstant.edgemode.filterunits.glyphref.gradienttransform.gradientunits.kernelmatrix.kernelunitlength.keypoints.keysplines.keytimes.lengthadjust.limitingconeangle.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.numoctaves.pathlength.patterncontentunits.patterntransform.patternunits.pointsatx.pointsaty.pointsatz.preservealpha.preserveaspectratio.primitiveunits.refx.refy.repeatcount.repeatdur.requiredextensions.requiredfeatures.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.surfacescale.systemlanguage.tablevalues.targetx.targety.textlength.viewbox.viewtarget.xchannelselector.ychannelselector.zoomandpan.definitionurl`.split(`.`));function Cl(e){let t=[],n=!1,r=()=>{n=!0};new Te({sourceCodeLocationInfo:!0},{onStartTag:e=>void t.push(e),onComment:r,onDoctype:r,onEndTag:r,onCharacter:r,onNullCharacter:r,onWhitespaceCharacter:r,onEof:()=>{}}).write(e,!0);let i=t[0];if(n||t.length!==1||!i.location||i.location.startOffset!==0||i.location.endOffset!==e.length)return null;let a=i.location.attrs?Object.values(i.location.attrs).sort((e,t)=>e.startOffset-t.startOffset):[];if(a.length!==i.attrs.length)return null;let o=i.attrs.map((e,t)=>({name:e.name,value:e.value,start:a[t].startOffset,end:a[t].endOffset}));return{name:i.tagName,selfClosing:i.selfClosing,attrs:o}}function wl(e,t){let n=[],r=(e,t)=>e.start>=t.start+1+t.tag.length&&e.end<t.startTagEnd;for(let i of t){let t=n[n.length-1];if(t&&r(i,t.el)){t.splices.push(i);continue}let a;for(let t of e.elements.values())if(t.startTagEnd!==t.start&&r(i,t)){a=t;break}if(!a||e.source[a.start]!==`<`)return null;n.push({el:a,splices:[i]})}return n}function Tl(e,t,n,r){if(xl.has(t.tag.toLowerCase()))return null;let i=e.source.slice(t.start,t.startTagEnd),a=``,o=0,s=0;for(let e of n)a+=i.slice(o,e.start-t.start)+e.text,o=e.end-t.start,s+=e.text.length-(e.end-e.start);a+=i.slice(o);let c=Cl(i),l=Cl(a);if(!c||!l||c.name!==t.tag.toLowerCase()||l.name!==c.name||l.selfClosing!==c.selfClosing||c.attrs.length!==t.attrs.length)return null;let u=new Map;for(let e of t.attrs){if(n.some(t=>t.start<=e.end&&t.end>=e.start))continue;let r=n.reduce((t,n)=>n.end<=e.start?t+n.text.length-(n.end-n.start):t,0);u.set(`${e.start+r-t.start}:${e.end+r-t.start}`,e)}let d=[];for(let e of l.attrs){let n=r+t.start+e.start,i=r+t.start+e.end,a=u.get(`${e.start}:${e.end}`);if(a){if(a.name.toLowerCase()!==e.name||a.value!==e.value)return null;d.push({name:a.name,value:a.value,start:n,end:i});continue}if(Sl.has(e.name)||e.name.includes(`:`)||e.name.startsWith(`xmlns`))return null;d.push({name:e.name,value:e.value,start:n,end:i})}return{attrs:d,delta:s}}function El(e,t,n){let r=Dl(e,t,n);return r?yl.taken++:yl.declined++,r}function Dl(e,t,n){if(t.length===0||t.length>bl)return null;let r=wl(e,t);if(!r)return null;let i=new Map,a=[],o=0;for(let{el:t,splices:n}of r){let r=Tl(e,t,n,o);if(!r)return null;i.set(t.id,r.attrs),a.push({at:t.startTagEnd,delta:r.delta}),o+=r.delta}if(e.source.length+o!==n.length)return null;let s=e=>{let t=0;for(let n of a){if(n.at>e)break;t+=n.delta}return e+t},c=new Map;for(let[t,n]of e.elements){let e=s(n.start),r=s(n.end),a=s(n.startTagEnd),o=n.endTagStart===null?null:s(n.endTagStart),l=i.get(t);if(!l&&e===n.start&&r===n.end&&a===n.startTagEnd&&o===n.endTagStart){c.set(t,n);continue}c.set(t,{...n,start:e,end:r,startTagEnd:a,endTagStart:o,attrs:l??(e===n.start?n.attrs:n.attrs.map(e=>({...e,start:s(e.start),end:s(e.end)})))})}return{source:n,elements:c,order:e.order,html:e.html,head:e.head,body:e.body}}var Ol=class extends Error{code;constructor(e,t){super(t),this.name=`EditError`,this.code=e}},kl=new Set([`html`,`head`,`body`]),Al=new Set([`table`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`,`caption`,`colgroup`,`col`,`select`,`option`,`optgroup`]);function jl(e,t,n){return Il(e,Ll(e,t,n),n)}function Ml(e,t,n){if(t.length===0)return{index:e,splices:[],inverse:[],live:[]};let r=[...t],i=ii(e.source,r);return{index:El(e,r,i)??xi(Ei(i),{index:e,splices:r},n),splices:r,inverse:ai(e.source,r),live:[{kind:`reload`}]}}function Nl(e,t,n,r=[]){let i={index:e,splices:n,moved:r},a=bi(t,i),o=e=>{throw new Ol(`locality`,`edit would change the document structure outside its target (${e})`)},s=(e,t)=>{for(let t of r)if(e>t.from&&e<t.from+t.length)return t.to+(e-t.from);return oi(n,e,t)},c=new Set(r.map(e=>e.from));for(let n of e.elements.values()){if(vi(n)||yi(i,n.start)===null)continue;let e=a.get(n.id),r=e===void 0?void 0:t.elements.get(e);if(!r)return o(`<${n.tag}> lost`);if(n.parent!==null&&!c.has(n.start)){let e=a.get(n.parent);e!==void 0&&r.parent!==e&&o(`<${n.tag}> changed parent`)}r.startTagEnd!==s(n.startTagEnd,-1)&&o(`<${n.tag}> start tag changed`),n.endTagStart!==null&&r.endTagStart!==s(n.endTagStart,1)&&o(`<${n.tag}> end tag moved`)}let l=new Set(a.values()),u=Pl(n);for(let e of t.elements.values())vi(e)||l.has(e.id)||u.some(([t,n])=>e.start>=t&&e.start<n)||o(`unexpected <${e.tag}>`)}function Pl(e){let t=[],n=0;for(let r of e){let e=r.start+n;t.push([e,e+r.text.length]),n+=r.text.length-(r.end-r.start)}return t}function Fl(e,t,n,r,i){let a=Ei(r);return t.skipLocality||Nl(e,a,n,t.moved),xi(a,{index:e,splices:n,moved:t.moved},i)}function Il(e,t,n){let r=t.splices.filter(e=>e.end>e.start||e.text!==``);if(r.length===0)return{index:e,splices:[],inverse:[],live:[]};ri(r,e.source.length);let i=ii(e.source,r),a=(t.attrLocal?El(e,r,i):null)??Fl(e,t,r,i,n),{live:o,createdId:s}=t.live(a),c={index:a,splices:r,inverse:ai(e.source,r),live:o};return s!==void 0&&(c.createdId=s),c}function Ll(e,t,n){switch(t.kind){case`setInnerHTML`:return Xl(e,t.id,t.html);case`setStyle`:return nu(e,t.id,t.props);case`setAttr`:return iu(e,t.id,t.name,t.value);case`remove`:return au(e,t.id);case`duplicate`:return cu(e,t.id,n);case`move`:return uu(e,t.id,t.parentId,t.beforeId);case`insertHTML`:return fu(e,t.parentId,t.beforeId,t.html);case`upsertFontStyle`:return pu(e,t.key,t.css);case`replaceDocument`:return mu(e,t.source)}}function Rl(e,t){let n=e.elements.get(t);if(!n)throw new Ol(`unknown-element`,`unknown element ${t}`);return n}function zl(e){if(vi(e))throw new Ol(`unsupported`,`<${e.tag}> has no start tag in the source`)}function Bl(e,t){let n=t.endTagStart===null&&t.startTagEnd===t.end&&e.source.slice(t.end-2,t.end)===`/>`;if(X(t.tag)||n)throw new Ol(`unsupported`,`<${t.tag}> cannot have content`);return[t.startTagEnd,t.endTagStart??t.end]}var Vl=e=>kl.has(e.tag);function Hl(e,t){let n=e.elements.get(e.elements.get(t)?.parent??``);return n?n.children[n.children.indexOf(t)+1]??null:null}function Ul(e,t){let n=e.toLowerCase();return t===null||n.startsWith(`on`)||n===`data-pp-id`||eo(n)&&Z(t)?null:t}var Wl=(e,t)=>lo(e,t)!==``;function Gl(e,t,n){let r=Gi(e,t),i=n;for(;e[i]===` `||e[i]===` `;)i++;let a=e.startsWith(`\r
38
+ `,i)?2:e[i]===`
39
+ `?1:i>=e.length?0:-1;if(r!==null&&a>=0)return[Wi(e,t),i+a];if(r!==null)return[t,i];if(a>=0){let r=t;for(;e[r-1]===` `||e[r-1]===` `;)r--;return[r,n]}return[t,n]}function Kl(e,t,n){let r=Gi(e,t.start),i=r===null?``:Ki(e)+r;return{pos:t.end,text:i+n,payloadAt:i.length}}function ql(e,t,n){let r=Gi(e,t.start),i=r===null?``:Ki(e)+r;return{pos:t.start,text:n+i,payloadAt:0}}function Jl(e,t,n){let[,r]=Bl(e,t),i=t.children[t.children.length-1],a=i===void 0?void 0:e.elements.get(i);return a&&a.end<=r&&/^\s*$/.test(e.source.slice(a.end,r))?Kl(e.source,a,n):{pos:r,text:n,payloadAt:0}}function Yl(e,t,n,r){let i=Rl(e,t);if(wi(i.tag))throw new Ol(`unsupported`,`<${i.tag}> cannot contain elements`);if(Bl(e,i),n===null)return Jl(e,i,r);let a=Rl(e,n);if(a.parent!==t)throw new Ol(`invalid-op`,`beforeId is not a child of parentId`);return zl(a),ql(e.source,a,r)}function Xl(e,t,n){let r=Rl(e,t),[i,a]=Bl(e,r);return{splices:e.source.slice(i,a)===n?[]:[{start:i,end:a,text:n}],live:e=>Vl(r)?{live:[{kind:`reload`}]}:Wl(e,t)?{live:[{kind:`subtrees`,items:[{id:t,previewHTML:lo(e,t)}]}]}:{live:[]}}}function Zl(e,t){return`${e}="${Vi(t)}"`}function Ql(e,t,n,r){let i=Ni(t,n);if(!i){let e=Ui(t);return{start:e,end:e,text:` ${Zl(n,r)}`}}if(i.value===r)return null;let a=Bi(e.source,i);if(a.hasValue&&a.quote!==null){let t=e.source.slice(a.start,a.end),n=Vi(r,a.quote);t.includes(`\r
40
+ `)&&(n=n.replace(/\r?\n/g,`\r
41
+ `));let[i]=ci(t,n);return i?{start:a.start+i.start,end:a.start+i.end,text:i.text}:null}return{start:i.start,end:i.end,text:Zl(i.name,r)}}function $l(e,t,n){let r=Ni(t,n);if(!r)return null;let[i,a]=Hi(e.source,t,r);return{start:i,end:a,text:``}}function eu(e,t,n,r){let i=[n];if(r){let e=t.elements.get(n);if(e)for(let r of t.order){let a=t.elements.get(r);a&&a.id!==n&&a.start>=e.start&&a.end<=e.end&&i.push(r)}}return i.some(n=>Ua(e,n)!==Ua(t,n))}function tu(e,t,n){if([e,t].some(e=>ma(e).some(e=>e.id===n)))return[{kind:`reload`}];let r=lo(t,n);return r===``?[]:[{kind:`subtrees`,items:[{id:n,previewHTML:r}]}]}function nu(e,t,n){let r=Rl(e,t);zl(r);let i={};for(let[e,t]of Object.entries(n)){if(!ta(e))throw new Ol(`invalid-op`,`invalid CSS property name "${e}"`);if(t!==null&&!na(t))throw new Ol(`invalid-op`,`unsafe CSS value for ${e}`);i[ea(e)]=t}let a=Pi(r,`style`)??``,o=ia(a,i),s=null;return o!==a&&(s=o.trim()===``?$l(e,r,`style`):Ql(e,r,`style`,o)),{splices:s?[s]:[],attrLocal:!0,live:n=>({live:eu(e,n,t,!1)?tu(e,n,t):[{kind:`style`,id:t,props:i}]})}}var ru=/^[A-Za-z_:][A-Za-z0-9_:.-]*$/;function iu(e,t,n,r){let i=Rl(e,t);if(zl(i),!ru.test(n))throw new Ol(`invalid-op`,`invalid attribute name "${n}"`);let a=n.toLowerCase();if(a.startsWith(`on`)||a.startsWith(`data-pp-`))throw new Ol(`invalid-op`,`attribute "${n}" is not allowed`);let o=r===null?$l(e,i,n):Ql(e,i,n,r);return{splices:o?[o]:[],attrLocal:!0,live:i=>({live:eu(e,i,t,a===`class`)?tu(e,i,t):[{kind:`attr`,id:t,name:n,value:Ul(n,r)}]})}}function au(e,t){let n=Rl(e,t);if(Vl(n))throw new Ol(`unsupported`,`<${n.tag}> cannot be removed`);let[r,i]=Gl(e.source,n.start,n.end);return{splices:[{start:r,end:i,text:``}],live:()=>({live:[{kind:`remove`,id:t}]})}}function ou(e,t,n){let r=n.randomHex??Sa,i=new Set(ma(e).map(e=>Pi(e,`data-popost-page`))),a=[];for(let n of ma(e)){let o=Ni(n,`data-popost-page`);if(!o||n.start<t.start||n.end>t.end)continue;let s=xa(r);for(;i.has(s);)s=xa(r);i.add(s);let c=Bi(e.source,o);c.hasValue&&a.push({start:c.start-t.start,end:c.end-t.start,text:s})}return a.sort((e,t)=>e.start-t.start),ii(e.source.slice(t.start,t.end),a)}function su(e,t){for(let n of e.order){let r=e.elements.get(n);if(r&&!vi(r)&&r.start===t)return r}}function cu(e,t,n){let r=Rl(e,t);if(Vl(r))throw new Ol(`unsupported`,`<${r.tag}> cannot be duplicated`);let i=Kl(e.source,r,ou(e,r,n));return{splices:[{start:i.pos,end:i.pos,text:i.text}],live:e=>{let t=su(e,i.pos+i.payloadAt);if(!t)throw new Ol(`locality`,`duplicate did not produce an element`);return{createdId:t.id,live:lu(e,[t])}}}}function lu(e,t){let n=[];for(let r of[...t].reverse()){let t=r.parent===null?void 0:e.elements.get(r.parent);if(!t||Al.has(r.tag)||Al.has(t.tag))return[{kind:`reload`}];let i=lo(e,r.id);i!==``&&n.push({kind:`insert`,parentId:t.id,beforeId:Hl(e,r.id),previewHTML:i})}return n}function uu(e,t,n,r){let i=Rl(e,t);if(Vl(i))throw new Ol(`unsupported`,`<${i.tag}> cannot be moved`);zl(i);let a=Rl(e,n);if(n===t||Li(e,t,n))throw new Ol(`invalid-op`,`cannot move an element into itself`);if(r===t)return du();if(a.id===i.parent){let e=a.children;if(r===(e[e.indexOf(t)+1]??null))return du()}let o=Yl(e,n,r,e.source.slice(i.start,i.end)),[s,c]=Gl(e.source,i.start,i.end);if(o.pos>s&&o.pos<c)throw new Ol(`invalid-op`,`move target lies inside the moved range`);let l={start:s,end:c,text:``},u={start:o.pos,end:o.pos,text:o.text},d=oi([l],o.pos,1)+o.payloadAt;return{splices:[l,u].sort((e,t)=>e.start-t.start||Number(e.end>e.start)-Number(t.end>t.start)),moved:[{from:i.start,to:d,length:i.end-i.start}],live:e=>Al.has(i.tag)||Al.has(a.tag)?{live:[{kind:`reload`}]}:Wl(e,t)?{live:[{kind:`move`,id:t,parentId:n,beforeId:r}]}:{live:[]}}}function du(){return{splices:[],live:()=>({live:[]})}}function fu(e,t,n,r){let i=r.trim();if(i===``)throw new Ol(`invalid-op`,`nothing to insert`);let a=Yl(e,t,n,i),o=a.pos+a.payloadAt;return{splices:[{start:a.pos,end:a.pos,text:a.text}],live:e=>{let n=[...e.elements.values()].filter(e=>!vi(e)&&e.parent===t&&e.start>=o&&e.start<o+i.length).sort((e,t)=>e.start-t.start),r=n[0];if(!r){if(/^<[a-zA-Z]/.test(i))throw new Ol(`locality`,`inserted markup produced no element under the target`);return{live:[{kind:`reload`}]}}let a=``,s=o;for(let t of n)a+=e.source.slice(s,t.start),s=t.end;a+=e.source.slice(s,o+i.length);let c=a.trim()===``?lu(e,n):[{kind:`reload`}];return{createdId:r.id,live:c}}}}function pu(e,t,n){if(t===``||/[\u0000-\u001f]/.test(t))throw new Ol(`invalid-op`,`invalid font key`);if(/<\/style/i.test(n))throw new Ol(`invalid-op`,`css must not contain </style`);let r=e.head===null?void 0:e.elements.get(e.head);if(!r)throw new Ol(`unsupported`,`document has no <head>`);let i=[...e.elements.values()].filter(e=>e.tag===`style`&&Pi(e,`data-popost-font`)===t),a=()=>({live:[{kind:`headStyle`,key:t,css:n}]}),[o,...s]=i;if(!o){let i=Jl(e,r,`<style data-popost-font="${Vi(t)}">${n}</style>`);return{splices:[{start:i.pos,end:i.pos,text:i.text}],live:a}}let c=[],[l,u]=Bl(e,o);e.source.slice(l,u)!==n&&c.push({start:l,end:u,text:n});for(let t of s){let[n,r]=Gl(e.source,t.start,t.end);c.push({start:n,end:r,text:``})}return c.sort((e,t)=>e.start-t.start),{splices:c,live:a}}function mu(e,t){return{splices:ci(e.source,t),skipLocality:!0,live:()=>({live:[{kind:`reload`}]})}}var hu=class{undoStack=[];redoStack=[];open=null;now;mergeWindowMs;maxEntries;constructor(e={}){this.now=e.now??Date.now,this.mergeWindowMs=e.mergeWindowMs??600,this.maxEntries=e.maxEntries??300}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get undoLabel(){return this.undoStack[this.undoStack.length-1]?.label??null}get redoLabel(){return this.redoStack[this.redoStack.length-1]?.label??null}get size(){return this.undoStack.length}push(e){let t=e.at??this.now();this.redoStack=[];let n=this.open;if(n&&e.coalesceKey!==void 0&&n.coalesceKey===e.coalesceKey&&this.undoStack[this.undoStack.length-1]===n&&t-n.at<=this.mergeWindowMs){let r=this.merge(n,e,t);this.undoStack[this.undoStack.length-1]=r,this.open=r,r.splices.length===0&&(this.undoStack.pop(),this.open=null);return}let r={...e,splices:[...e.splices],inverse:[...e.inverse],at:t};this.undoStack.push(r),this.open=r,this.undoStack.length>this.maxEntries&&this.undoStack.splice(0,this.undoStack.length-this.maxEntries)}undo(){let e=this.undoStack.pop()??null;return this.open=null,e&&this.redoStack.push(e),e}redo(){let e=this.redoStack.pop()??null;return this.open=null,e&&this.undoStack.push(e),e}breakCoalescing(){this.open=null}clear(){this.undoStack=[],this.redoStack=[],this.open=null}merge(e,t,n){let r=hi(e.splices,t.splices),i=hi(t.inverse,e.inverse);return{label:t.label,splices:r,inverse:i,coalesceKey:e.coalesceKey,at:n}}},gu=62914560,_u=new Set([`script`,`iframe`,`object`,`embed`,`base`,`form`]),vu=new Set([`href`,`src`,`xlink:href`]);function yu(e){return e.prefix?`${e.prefix}:${e.name}`:e.name}function bu(e){return _u.has(e.tagName)||e.tagName===`meta`&&e.attrs.some(e=>e.name===`http-equiv`&&e.value.toLowerCase()===`refresh`)?!0:e.attrs.some(e=>{let t=yu(e);return/^on/i.test(t)||vu.has(t)&&/^\s*javascript:/i.test(e.value)})}function xu(e){let t=ei(e,{scriptingEnabled:!1}),n=t.mode===`quirks`,r={slides:0,unsafe:!1},i=e=>{for(let t of e.childNodes){if(!Ve.isElementNode(t))continue;bu(t)&&(r.unsafe=!0);let e=(t.attrs.find(e=>e.name===`class`)?.value??``).split(/[\t\n\f\r ]+/);(e.includes(`slide`)||n&&e.some(e=>e.toLowerCase()===`slide`))&&r.slides++,i(t)}};return i(t),r.slides===0?{code:`no-slide`}:r.unsafe?{code:`unsafe`}:{slides:r.slides}}function Su(e,t=gu){return e.length>t?!0:e.length*3<=t?!1:new TextEncoder().encode(e).length>t}function Cu(e){if(e.trim()===``)return{ok:!1,code:`empty`};if(Su(e))return{ok:!1,code:`too-large`};let t=xu(e);return`code`in t?{ok:!1,code:t.code}:{ok:!0,slides:t.slides}}var wu=[`color`,`font-size`,`font-family`,`font-weight`,`font-style`,`text-decoration`,`text-decoration-line`,`text-transform`],Tu=e=>{if(!e)return!1;if(e===`bold`||e===`bolder`)return!0;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=600},Eu=e=>(e??``).split(/\s+/).filter(e=>e!==``&&e!==`none`);function Du(e,t){return e.command===`color`||e.command===`fontSize`?`format:${e.command}:${t.join(`,`)}`:void 0}function Ou(e,t,n){let r=e=>t.map(t=>({kind:`setStyle`,id:t,props:e(t)})),i=(e,t)=>n(e,[t])[t];switch(e.command){case`bold`:{let e=!t.every(e=>Tu(i(e,`font-weight`)));return r(()=>({"font-weight":e?`700`:`400`}))}case`italic`:{let e=!t.every(e=>/^(italic|oblique)/.test(i(e,`font-style`)??``));return r(()=>({"font-style":e?`italic`:`normal`}))}case`underline`:case`strike`:{let n=e.command===`underline`?`underline`:`line-through`,a=e=>Eu(i(e,`text-decoration-line`)),o=!t.every(e=>a(e).includes(n));return r(e=>{let t=a(e).filter(e=>e!==n),r=o?[...t,n]:t;return{"text-decoration-line":r.length?r.join(` `):`none`}})}case`uppercase`:{let e=!t.every(e=>i(e,`text-transform`)===`uppercase`);return r(()=>({"text-transform":e?`uppercase`:`none`}))}case`color`:return r(()=>({color:e.value}));case`fontSize`:return r(()=>({"font-size":e.value}));case`fontFamily`:return r(()=>({"font-family":e.value}));case`clear`:return r(()=>Object.fromEntries(wu.map(e=>[e,null])))}}var ku=new Set([`script`,`noscript`,`object`,`embed`,`iframe`,`frame`,`base`]),Au=new Set([`href`,`src`,`action`,`formaction`,`xlink:href`]),ju=`default-src 'none'; img-src data: blob: https: http:; style-src 'unsafe-inline'; font-src data: https: http:`;function Mu(e){return e.prefix?`${e.prefix}:${e.name}`:e.name}function Nu(e){e.attrs=e.attrs.filter(e=>{let t=Mu(e).toLowerCase();return!t.startsWith(`on`)&&!(Au.has(t)&&/^\s*javascript:/i.test(e.value))})}function Pu(e){return e.childNodes.some(e=>Ve.isElementNode(e)&&e.tagName===`meta`&&e.attrs.some(e=>e.name===`http-equiv`&&e.value.toLowerCase()===`content-security-policy`))}function Fu(e){Ve.isElementNode(e)&&(Nu(e),Iu(`content`in e?e.content.childNodes:e.childNodes))}function Iu(e){for(let t=e.length-1;t>=0;t--){let n=e[t];Ve.isElementNode(n)&&ku.has(n.tagName)?e.splice(t,1):Fu(n)}}function Lu(e){let t=ei(e,{scriptingEnabled:!1}),n=t.childNodes.find(e=>Ve.isElementNode(e)&&e.tagName===`html`);if(!n)return e;Nu(n),Iu(n.childNodes);let r=n.childNodes.find(e=>Ve.isElementNode(e)&&e.tagName===`head`);if(r&&!Pu(r)){let e=Ve.createElement(`meta`,z.HTML,[{name:`http-equiv`,value:`Content-Security-Policy`},{name:`content`,value:ju}]),t=r.childNodes[0];t?Ve.insertBefore(r,e,t):Ve.appendChild(r,e)}return(t.childNodes.some(e=>Ve.isDocumentTypeNode(e))?`<!DOCTYPE html>
42
+ `:``)+Kr(n)}function Ru(e){return`${(e??``).replace(/[\\/:*?"<>|\u0000-\u001f]+/g,`-`).trim().replace(/\.html?$/i,``).trim()||`index`}.html`}function zu(e,t,n=`text/html;charset=utf-8`){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.style.display=`none`,document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),3e3)}var Bu=`no-pages`,Vu=e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(()=>e()):queueMicrotask(e)},Hu=e=>e instanceof Error?e.message:String(e);function Uu(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>{let r=e[n],i=t[n];return i!==void 0&&r.x===i.x&&r.y===i.y&&r.width===i.width&&r.height===i.height})}var Wu=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function Gu(e,t){return e.id===t.id&&e.pageKey===t.pageKey&&e.name===t.name&&e.width===t.width&&e.height===t.height}function Ku(e){return new qu(e)}var qu=class{store;get cloud(){return this.store.cloud}frame;params;schedule;history;ids=gi();ctx;idx;savedSource=``;rev=``;snap;listeners=new Set;noticeListeners=new Set;frameListeners=new Set;iframe=null;frameOff=null;mounted=!1;mountToken=0;overflowBase=null;measureQueued=!1;savePromise=null;palette=null;disposed=!1;constructor(e){this.store=e.store,this.frame=e.frame,this.params=e.params,this.schedule=e.schedule??Vu,this.history=new hu({now:e.now}),this.ctx={newId:()=>this.ids.newId(),randomHex:e.randomHex},this.idx=Di(``,this.ids),this.snap={docState:`loading`,error:null,mode:e.store.mode,name:e.params.name??``,path:``,pages:[],currentPageId:null,selection:[],hoverId:null,editingTextId:null,textState:null,rects:{},overflow:[],saveState:`saved`,canUndo:!1,canRedo:!1,conflict:!1,sourceVersion:0}}getSnapshot=()=>this.snap;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});set(e){let t={...this.snap,...e,canUndo:this.history.canUndo,canRedo:this.history.canRedo};if(!Object.keys(t).every(e=>t[e]===this.snap[e])){this.snap=t;for(let e of[...this.listeners])e()}}notify(e,t,n){let r=n===void 0?{kind:e,key:t}:{kind:e,key:t,detail:n};for(let e of[...this.noticeListeners])e(r)}onNotice=e=>(this.noticeListeners.add(e),()=>{this.noticeListeners.delete(e)});onFrameEvent=e=>(this.frameListeners.add(e),()=>{this.frameListeners.delete(e)});index=()=>this.idx;pageSize=()=>{let e=this.snap.pages.find(e=>e.id===this.snap.currentPageId);return e?{width:e.width,height:e.height}:{...ua}};get ready(){return this.snap.docState===`ready`}dirtyState(){return this.snap.saveState===`saving`?`saving`:this.idx.source===this.savedSource?`saved`:`dirty`}async start(){this.set({docState:`loading`,error:null}),await this.loadDocument(null)}async reload(){for(this.snap.editingTextId&&this.endTextEdit(!1);this.savePromise;)await this.savePromise;let e=this.snap.pages.findIndex(e=>e.id===this.snap.currentPageId);await this.loadDocument(e<0?0:e)}externalChange=async()=>{if(this.ready){for(;this.savePromise;)await this.savePromise;this.snap.editingTextId||this.idx.source!==this.savedSource?this.set({conflict:!0}):await this.reload()}};async loadDocument(e){try{let t=await this.store.load();if(this.disposed)return;let n=Di(t.content,this.ids),r=ba(n,{ratio:this.params.ratio});if(r.length===0)throw Error(Bu);this.idx=n,this.savedSource=t.content,this.rev=t.rev,this.history.clear(),this.overflowBase=null;let i=r[Math.min(e??0,r.length-1)];this.set({docState:`ready`,error:null,name:t.name,path:t.path,pages:r,currentPageId:i.id,selection:[],hoverId:null,editingTextId:null,textState:null,rects:{},overflow:[],saveState:`saved`,conflict:!1,sourceVersion:this.snap.sourceVersion+1}),this.remount()}catch(e){if(this.disposed)return;this.set({docState:`error`,error:Hu(e)})}}attachFrame=e=>{if(e===null){this.frameOff?.(),this.frameOff=null,this.iframe=null,this.mounted=!1,this.mountToken++;return}e===this.iframe&&this.frameOff||(this.iframe=e,this.frameOff??=this.frame.on(e=>this.onFrame(e)),this.remount())};pendingTextEdit=null;remount(){let e=this.iframe;if(!e||!this.ready||this.disposed)return;let t=++this.mountToken;this.mounted=!1,this.snap.editingTextId&&this.set({editingTextId:null,textState:null});let n=this.snap.currentPageId;this.frame.mount(e,this.idx,{currentPageId:n}).then(()=>{if(t!==this.mountToken||this.disposed)return;this.mounted=!0;let e=this.snap.currentPageId;e!==null&&e!==n&&this.frame.send({type:`currentPage`,id:e});let r=this.pendingTextEdit;this.pendingTextEdit=null,r?.(),this.runMeasure()},e=>{t!==this.mountToken||this.disposed||this.set({docState:`error`,error:Hu(e)})})}onFrame(e){switch(e.type){case`ready`:case`fontsReady`:this.mounted&&this.runMeasure();break;case`rects`:this.setMeasure(e.rects,e.overflow);break;case`hover`:this.set({hoverId:e.id});break;case`textState`:if(e.id===this.snap.editingTextId){let t=this.snap.textState;t&&t.range===e.range&&[`bold`,`italic`,`underline`,`strike`].every(n=>!!t.active[n]==!!e.active[n])||this.set({textState:{range:e.range,active:e.active}})}break;case`textCommit`:e.id===this.snap.editingTextId&&(this.set({editingTextId:null,textState:null}),this.runOps([{kind:`setInnerHTML`,id:e.id,html:e.html}],`text`));break;case`textCancel`:e.id===this.snap.editingTextId&&this.set({editingTextId:null,textState:null})}for(let t of[...this.frameListeners])t(e)}setMeasure(e,t){this.set({rects:Uu(this.snap.rects,e)?this.snap.rects:e,overflow:Wu(this.snap.overflow,t)?this.snap.overflow:t})}markOverflowBase(){this.overflowBase??=this.snap.overflow}scheduleMeasure(){this.markOverflowBase(),!this.measureQueued&&(this.measureQueued=!0,this.schedule(()=>{this.measureQueued=!1,this.mounted&&!this.disposed&&this.runMeasure()}))}runMeasure(){let e;try{e=this.frame.measure(`page`)}catch{return}let t=this.overflowBase;this.overflowBase=null,this.setMeasure(e.rects,e.overflow),t&&e.overflow.some(e=>!t.includes(e)&&Wa(this.idx,e)===`text`)&&this.notify(`info`,`textOverflow`)}measure=e=>{if(!this.mounted)return;if(e===`page`){this.runMeasure();return}let t;try{t=this.frame.measure(e)}catch{return}let n=new Set(e);this.set({rects:{...this.snap.rects,...t.rects},overflow:[...this.snap.overflow.filter(e=>!n.has(e)),...t.overflow]})};styles=(e,t)=>{if(!this.mounted)return{};try{return this.frame.styles(e,t)}catch{return{}}};apply=(e,t={})=>{this.runOps([e],t.label??e.kind,t.coalesceKey)};applyBatch=(e,t,n={})=>{this.runOps(e,t,n.coalesceKey)};runOps(e,t,n){if(!this.ready||e.length===0)return!1;this.commitTextEdit();let r=this.idx,i=r,a=[],o=[],s=[],c;try{e.forEach((e,t)=>{let n=jl(i,e,this.ctx);i=n.index,a=t===0?n.splices:hi(a,n.splices),o=t===0?n.inverse:hi(n.inverse,o),s.push(...n.live),n.createdId!==void 0&&(c=n.createdId)})}catch(e){return this.notify(`error`,`editRejected`,e instanceof Ol?e.message:Hu(e)),!1}return i.source===r.source||(this.history.push({label:t,splices:a,inverse:o,coalesceKey:n}),this.install(i,s,c),!0)}undo=()=>{this.step(`undo`)};redo=()=>{this.step(`redo`)};step(e){if(!this.ready)return;this.commitTextEdit();let t=e===`undo`?this.history.undo():this.history.redo();if(!t)return;let n=Ml(this.idx,e===`undo`?t.inverse:t.splices,this.ctx);this.install(n.index,n.live)}install(e,t,n){this.idx=e;let r=this.snap,i=ba(e,{ratio:this.params.ratio}),a=i.length===r.pages.length&&i.every((e,t)=>Gu(e,r.pages[t]))?r.pages:i,o=r.currentPageId,s=!1;if(!a.some(e=>e.id===o)){let e=Math.max(0,r.pages.findIndex(e=>e.id===o));o=a[Math.min(e,a.length-1)]?.id??null,s=!0}let c=r.selection.filter(t=>e.elements.has(t));if(n!==void 0&&e.elements.has(n)){let t=ha(e,n);t!==null&&t!==n&&Ga(e,t).includes(n)&&(c=[n],t!==o&&(o=t,s=!0))}if(c.length===r.selection.length&&c.every((e,t)=>e===r.selection[t])&&(c=r.selection),this.markOverflowBase(),this.set({pages:a,currentPageId:o,selection:c,hoverId:r.hoverId!==null&&e.elements.has(r.hoverId)?r.hoverId:null,sourceVersion:r.sourceVersion+1,saveState:this.snap.saveState===`saving`?`saving`:e.source===this.savedSource?`saved`:`dirty`}),this.iframe){if(!this.mounted||t.some(e=>e.kind===`reload`)){this.remount();return}t.length&&this.frame.send({type:`live`,updates:t}),s&&o!==null&&this.frame.send({type:`currentPage`,id:o}),this.scheduleMeasure()}}select=(e,t={})=>{if(!this.ready)return;let n=new Set(ma(this.idx).map(e=>e.id)),r=[...new Set(e)].filter(e=>this.idx.elements.has(e)&&!n.has(e)),i=this.snap.selection,a,o;if(t.additive){a=[...i],o=[];for(let e of r){let t=a.indexOf(e);t>=0?a.splice(t,1):(a.push(e),o.push(e))}}else a=r,o=r;this.snap.editingTextId&&(a.length!==1||a[0]!==this.snap.editingTextId)&&this.commitTextEdit();let s=o.length?ha(this.idx,o[0]):null;s!==null&&s!==this.snap.currentPageId&&(this.switchPage(s),a=a.filter(e=>ha(this.idx,e)===s)),!Wu(a,i)&&(this.history.breakCoalescing(),this.set({selection:a}))};selectParent=()=>{let e=this.snap.selection[0],t=this.snap.currentPageId;if(!this.ready||e===void 0||t===null)return;let n=new Set(Ga(this.idx,t));for(let r=this.idx.elements.get(e)?.parent??null;r!==null&&r!==t;r=this.idx.elements.get(r)?.parent??null)if(n.has(r)){this.select([r]);return}};setCurrentPage=e=>{!this.ready||e===this.snap.currentPageId||!this.snap.pages.some(t=>t.id===e)||this.switchPage(e)};switchPage(e){this.commitTextEdit(),this.history.breakCoalescing(),this.set({currentPageId:e,selection:[],hoverId:null,rects:{},overflow:[]}),this.overflowBase=null,this.mounted&&(this.frame.send({type:`currentPage`,id:e}),this.runMeasure())}beginTextEdit=(e,t=`end`)=>{let n=typeof t==`string`?{type:`beginTextEdit`,id:e,caret:t}:{type:`beginTextEdit`,id:e,caret:`point`,x:t.x,y:t.y};if(!this.ready||!this.idx.elements.has(e))return;if(!this.mounted){this.pendingTextEdit=()=>{this.snap.selection[0]===e&&this.beginTextEdit(e,t)};return}if(this.snap.editingTextId===e)return;this.commitTextEdit();let r=ha(this.idx,e);r!==null&&r!==this.snap.currentPageId&&this.switchPage(r),this.set({selection:[e],editingTextId:e,textState:null}),this.frame.send(n)};endTextEdit=e=>{this.snap.editingTextId&&(this.mounted&&this.frame.send({type:`endTextEdit`,commit:e}),this.snap.editingTextId&&this.set({editingTextId:null,textState:null}))};commitTextEdit(){this.snap.editingTextId&&this.endTextEdit(!0)}format=e=>{if(!this.ready)return;let t=this.snap.editingTextId;if(t&&this.snap.textState?.range){this.frame.send({type:`format`,format:e});return}let n=(t?[t]:this.snap.selection).filter(e=>this.idx.elements.has(e));if(n.length===0)return;this.commitTextEdit();let r=Ou(e,n,this.styles);this.runOps(r,`format:${e.command}`,Du(e,n))};highlight=e=>{this.mounted&&this.frame.send({type:`highlight`,ids:e.filter(e=>this.idx.elements.has(e))})};livePreview=e=>{let t=e.filter(e=>e.kind!==`reload`);this.mounted&&t.length&&this.frame.send({type:`live`,updates:t})};cancelLivePreview=e=>{let t=[];for(let n of e){let e=this.idx.elements.get(n);e&&(t.push({kind:`attr`,id:n,name:`style`,value:Pi(e,`style`)}),t.push({kind:`attr`,id:n,name:`src`,value:Pi(e,`src`)}))}this.livePreview(t)};save=async(e={})=>{if(!this.ready)return;let t=e.force===!0;if(this.commitTextEdit(),this.snap.conflict&&!t)return;for(;this.savePromise;)await this.savePromise;if(!t&&this.idx.source===this.savedSource||this.snap.conflict&&!t)return;let n=this.runSave(t);this.savePromise=n;try{await n}finally{this.savePromise===n&&(this.savePromise=null)}};async runSave(e){let t=this.idx.source;if(Su(t)){this.set({saveState:`error`}),this.notify(`error`,`saveFailed`,`too-large`);return}this.set({saveState:`saving`});try{let n=await this.store.save(t,{rev:this.rev,force:e});this.rev=n.rev,this.savedSource=t,this.set({saveState:this.idx.source===t?`saved`:`dirty`,conflict:!1})}catch(e){e instanceof Ss||e?.status===409?this.set({saveState:`dirty`,conflict:!0}):(this.set({saveState:`error`}),this.notify(`error`,`saveFailed`,Hu(e)))}}resetToInitial=async()=>{if(!this.ready)return;this.commitTextEdit();let e;try{e=await this.store.initial()}catch(e){this.notify(`error`,`resetUnavailable`,Hu(e));return}if(!e.available){this.notify(`info`,`resetUnavailable`);return}this.runOps([{kind:`replaceDocument`,source:e.content}],`reset`)&&this.notify(`info`,`resetDone`)};replaceSource=e=>{if(!this.ready)return`not-ready`;let t=Cu(e);return t.ok?this.runOps([{kind:`replaceDocument`,source:e}],`code`)?null:`rejected`:t.code};uploadImage=async e=>{if(!this.store.uploadImage)throw Error(`Project asset upload unavailable`);let t=await this.store.uploadImage(e,{rev:this.rev});return this.rev=t.rev,t.image};downloadAll=async()=>{if(!this.ready)return;for(this.commitTextEdit();this.savePromise;)await this.savePromise;let e=this.idx.source;try{let t=await this.store.downloadAll(e,{rev:this.rev});this.rev=t.rev,this.store.mode===`local`&&(this.savedSource=e,this.set({saveState:this.dirtyState(),conflict:!1})),this.notify(`info`,`downloadDone`)}catch(e){this.notify(`error`,`downloadFailed`,e instanceof ws?e.message:Hu(e))}};exportHTML=()=>{if(this.ready){this.commitTextEdit();try{zu(Ru(this.snap.name),Lu(this.idx.source))}catch(e){this.notify(`error`,`downloadFailed`,Hu(e))}}};fontPalette=()=>(this.palette||=this.store.fontPalette().catch(e=>{throw this.palette=null,e}),this.palette);applyFont=async(e,t)=>{if(this.ready){this.commitTextEdit();try{let n=(await this.fontPalette()).roles,r=n.find(t=>t.id===e);if(!r)throw Error(rc);let i=t.filter(e=>this.idx.elements.has(e));if(i.length===0)return;let a=i.map(e=>zi(this.idx,e)).join(`
43
+ `),o=gc(n,r.family,a),s=await this.store.fontCSS(o.needed.map(e=>e.id),{rev:this.rev});this.rev=s.rev;let c=o.needed.map(e=>{let t=s.css[e.id];if(t===void 0)throw Error(`Missing font CSS: ${e.id}`);return{kind:`upsertFontStyle`,key:e.id,css:t}});for(let e of i.filter(e=>this.idx.elements.has(e)))c.push({kind:`setStyle`,id:e,props:{"font-family":o.stack}});this.runOps(c,`font`)}catch(e){this.notify(`error`,`fontFailed`,Hu(e))}}};dispose(){this.disposed=!0,this.mountToken++,this.mounted=!1,this.frameOff?.(),this.frameOff=null,this.listeners.clear(),this.noticeListeners.clear(),this.frameListeners.clear(),this.frame.dispose()}};function Ju(e,t){let n=()=>{let n=e.getSnapshot(),r={"data-doc-state":n.docState,"data-doc-path":n.path,"data-doc-seq":String(n.sourceVersion),"data-slide-count":String(n.pages.length)};for(let[e,n]of Object.entries(r))t.getAttribute(e)!==n&&t.setAttribute(e,n)};return n(),e.subscribe(n)}var Yu=`popost-canvas:lang`,Xu=`gs9_editor_lang`,Zu=`/pages/`;function Qu(e,t,n){return t?Zu:e.store===`host`?`${n}/`:void 0}function $u(e){try{return localStorage.getItem(e)}catch{return null}}function ed(e,t){try{localStorage.setItem(e,t)}catch{}}function td(e){let t=(new URLSearchParams(e).get(`lang`)||$u(`popost-canvas:lang`)||$u(Xu))===`en`?`en`:`zh`;return ed(Yu,t),t}function nd(e,t){return`${t?`• `:``}${e||`Popost`}`}function rd(){let e=hs(),t=td(e),n={...gs(e),lang:t},r=xs(),i=r?vl(r):n.store===`host`?Uc(n):Bc(n),a=Qu(n,r,window.location.origin),o=Ku({store:i,frame:os({store:i,baseHref:a,imageOrigins:r?[]:_s(e,n.store)}),params:n});document.documentElement.lang=t===`en`?`en`:`zh-CN`;let s=ms(n),c=n.store===`host`&&!r?ds(Pc(n.file),()=>void o.externalChange()):()=>{},l=Ju(o,document.body),u=()=>{let e=o.getSnapshot(),t=nd(e.name,e.saveState!==`saved`);document.title!==t&&(document.title=t)};u();let d=o.subscribe(u),f=e=>{o.getSnapshot().saveState!==`saved`&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,f),o.start(),{controller:o,params:n,local:r,lang:t,baseHref:a,dispose(){window.removeEventListener(`beforeunload`,f),d(),l(),s(),c(),o.dispose()}}}var id=()=>{let e=ys();return new URLSearchParams(hs()).get(`tools`)===`1`&&e.store===`host`&&ss()&&Pc(e.file)||null},ad=(e,t,n)=>{let r=id();return r?Ps(r,e,{content:t},n):Promise.reject(Error(`Project host unavailable`))};function od(e){let t=document.getElementById(`frame`)?.contentDocument;return t?t.querySelector(`[${Ya}="${e.replace(/["\\]/g,`\\$&`)}"]`):null}function sd(e){let t=od(e);if(t?.tagName!==`IMG`)return null;let n=t;return n.naturalWidth>0&&n.naturalHeight>0?{width:n.naturalWidth,height:n.naturalHeight}:null}async function cd(e,t=8e3){let n=document.getElementById(`frame`),r=n?.contentWindow,i=n?.contentDocument;!r||!i?.fonts||await Promise.race([(async()=>{if(await new Promise(e=>r.requestAnimationFrame(()=>e())),await i.fonts?.ready,!e)return;let t=[...i.fonts].filter(t=>t.family.replace(/^["']|["']$/g,``)===e);await Promise.all(t.map(e=>e.load().catch(()=>void 0)))})().catch(()=>void 0),new Promise(e=>setTimeout(e,t))])}var ld=`#000000.#333333.#666666.#999999.#cccccc.#eeeeee.#ffffff.#d64545.#ff7a1a.#f5b700.#ffd966.#8bc34a.#2e9e6b.#00a99d.#1e88e5.#3949ab.#7e57c2.#e8369a.#8d6e63.#37474f.#b71c1c.#ffcdd2.#ffe0b2.#fff9c4.#c8e6c9.#b3e5fc.#d1c4e9.#f8bbd0`.split(`.`),ud=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i,dd=/^rgba?\(\s*(\d{1,3})(?:\s*,\s*|\s+)(\d{1,3})(?:\s*,\s*|\s+)(\d{1,3})(?:\s*(?:,|\/)\s*([\d.]+%?))?\s*\)$/i;function fd(e){if(!e||e===`transparent`)return!0;let t=dd.exec(e)?.[4]??/\/\s*([\d.]+%?)\s*\)$/.exec(e)?.[1];return t!==void 0&&Number.parseFloat(t)===0}var pd=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`);function md(e){let t=(e??``).trim(),n=ud.exec(t);if(n){let e=n[1].toLowerCase();return e.length===3?`#${e[0]}${e[0]}${e[1]}${e[1]}${e[2]}${e[2]}`:e.length===8?e.slice(6)===`ff`?`#${e.slice(0,6)}`:null:`#${e}`}let r=dd.exec(t);if(r){let e=r[4];return e!==void 0&&!((e.endsWith(`%`)?Number.parseFloat(e)/100:Number.parseFloat(e))>=1)?null:`#${pd(Number(r[1]))}${pd(Number(r[2]))}${pd(Number(r[3]))}`}return null}var hd=/\sstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi,gd=/<style\b([^>]*)>([\s\S]*?)<\/style>/gi,_d=/#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3})(?![0-9a-z_-])|rgba?\([^)]*\)/gi,vd=/data:[^"')\s]{64,}/gi;function yd(e,t=14){let n=new Map,r=e=>{for(let t of e.replace(vd,``).matchAll(_d)){let e=md(t[0]);e&&n.set(e,(n.get(e)??0)+1)}};for(let t of e.matchAll(hd))r(t[1]??t[2]);for(let t of e.matchAll(gd))/data-popost-font/i.test(t[1])||r(t[2]);return[...n.entries()].map(([e,t],n)=>({hex:e,n:t,at:n})).sort((e,t)=>t.n-e.n||e.at-t.at).slice(0,t).map(e=>e.hex)}function bd(e,t){e.apply(Ca(t),{label:`duplicate page`});let n=e.getSnapshot().pages,r=n[n.findIndex(e=>e.id===t)+1];r&&e.setCurrentPage(r.id)}function xd(e,t){let n=wa(e.index(),t);return n?(e.apply(n,{label:`delete page`}),!0):!1}function Sd(e,t,n){let r=Ta(e.index(),t,n);r&&e.apply(r,{label:`move page`})}var Cd=(e,t)=>t>e?t-1:t;function wd(e){let t=e.getSnapshot().pages,n=t[0],r=t.at(-1);if(!n||!r)return;let i=e.index().elements.get(r.id)?.parent;if(!i)return;let a=od(n.id),o=a?.ownerDocument.defaultView?.getComputedStyle(a),s=document.createElement(`div`);s.className=`slide`;let c=xa();s.dataset.popostPage=c,s.dataset.popostWidth=String(n.width),s.dataset.popostHeight=String(n.height);let l=o?.backgroundColor;s.style.cssText=`width:${n.width}px;height:${n.height}px;position:relative;overflow:hidden;background-image:none`,s.style.backgroundColor=l&&!fd(l)?l:`#fff`;let u=e.index().elements.get(i)?.children??[];e.apply({kind:`insertHTML`,parentId:i,beforeId:u[u.indexOf(r.id)+1]??null,html:s.outerHTML},{label:`add page`});let d=e.getSnapshot().pages.find(e=>e.pageKey===c);d&&e.setCurrentPage(d.id)}var Td=[];function Ed(e){return Td.push(e),()=>{let t=Td.lastIndexOf(e);t>=0&&Td.splice(t,1)}}function Dd(){let e=Td.pop();return e?(e(),!0):!1}var Od=()=>Td.length>0;function kd(e,t){let n=(0,v.useRef)(t);n.current=t,(0,v.useEffect)(()=>{if(e)return Ed(()=>n.current())},[e])}function Ad(e,t,n){for(let r=e.elements.get(t)?.parent??null;r!==null;r=e.elements.get(r)?.parent??null)if(r===n)return!0;return!1}function jd(e,t){let n=t.filter(t=>e.elements.has(t));return n.filter(t=>!n.some(n=>n!==t&&Ad(e,t,n)))}function Md(e,t,n){let r=e.elements.get(t)?.parent;if(!r)return null;let i=e.elements.get(r)?.children??[],a=i.indexOf(t);if(a<0)return null;if(n===`up`){let e=i[a-1];return e===void 0?null:{kind:`move`,id:t,parentId:r,beforeId:e}}return a>=i.length-1?null:{kind:`move`,id:t,parentId:r,beforeId:i[a+2]??null}}var Nd=[`color`,`font-family`,`font-size`,`font-weight`,`font-style`,`text-decoration-line`,`text-transform`,`text-align`,`line-height`,`letter-spacing`,`opacity`];function Pd(e){let t={};for(let n of Nd){let r=e[n];r!==void 0&&r.trim()!==``&&(t[n]=r.trim())}return t}function Fd(e,t){return Object.keys(t).length===0?[]:e.map(e=>({kind:`setStyle`,id:e,props:{...t}}))}var Id=/^(-?\d*\.?\d+)(?:px)?$/,Ld=e=>{let t=Id.exec((e??``).trim());return t?Number(t[1]):null};function Rd(e){let t=(e??``).trim();if(t===``||t===`none`)return{x:0,y:0};let n=t.split(/\s+/);if(n.length>3)return null;let r=n.map(Ld);return r.some(e=>e===null)?null:{x:r[0],y:r[1]??0}}var zd=[`position`,`left`,`top`,`translate`];function Bd(e){let t=e.position;if(t===`absolute`||t===`fixed`){let t=Ld(e.left),n=Ld(e.top);if(t!==null&&n!==null)return{mode:`abs`,left:t,top:n}}let n=Rd(e.translate)??{x:0,y:0};return{mode:`flow`,x:n.x,y:n.y}}var Vd=e=>Math.round(e),Hd=e=>`${Vd(e)}px`;function Ud(e,t,n){return e.mode===`abs`?{left:Hd(e.left+t),top:Hd(e.top+n)}:{translate:`${Hd(e.x+t)} ${Hd(e.y+n)}`}}var Wd=e=>e.length===2,Gd=e=>e===`image`||e===`svg`||e===`video`;function Kd(e){let{handle:t,kind:n,start:r,dx:i,dy:a}=e,o=t.includes(`w`),s=t.startsWith(`n`),c=Math.max(1,r.width),l=Math.max(1,r.height),u=Math.max(8,c+(o?-i:i)),d=l,f={},p=null;return Wd(t)?n===`text`?(p=u/c,d=l*p):d=Gd(n)?u*l/c:Math.max(8,l+(s?-a:a)):Gd(n)&&(d=u*l/c),u=Vd(u),f.width=Hd(u-e.extra.width),(Gd(n)||Wd(t)&&n===`box`)&&(d=Vd(d),f.height=Hd(d-e.extra.height)),p!==null&&(f[`font-size`]=`${Math.max(4,Math.round(e.fontSize*p*2)/2)}px`),{props:f,shift:{x:o?c-u:0,y:s?l-d:0},width:u,height:Vd(d)}}function qd(e){let{controller:t,gestures:n,zoom:r,toast:i,t:a}=e,o=()=>jd(t.index(),t.getSnapshot().selection),s=()=>{let e=o();e.length&&t.applyBatch(e.map(e=>({kind:`duplicate`,id:e})),`duplicate`)},c=()=>{let e=o();e.length!==0&&(t.applyBatch(e.map(e=>({kind:`remove`,id:e})),`delete`),i(a(`toast.deleted`)))},l=e=>{let{selection:n}=t.getSnapshot(),r=n[0];if(n.length!==1||r===void 0)return;let i=Md(t.index(),r,e);i&&t.apply(i,{label:`reorder`})},u=(e,n)=>{let r=o();if(r.length===0)return;let i=r.map(r=>({kind:`setStyle`,id:r,props:Ud(Bd(t.styles(r,zd)),e,n)}));t.applyBatch(i,`nudge`,{coalesceKey:`nudge:${r.join(`,`)}`})},d=e=>{let n=o()[0];if(!n||o().length!==1)return!1;let r=Wa(t.index(),n);if(r!==`image`&&r!==`svg`&&r!==`video`)return!1;let i=t.styles(n,[`width`,`height`]),a=t.getSnapshot().rects[n],s=Number.parseFloat(i.width)||a?.width,c=Number.parseFloat(i.height)||a?.height;if(!s||!c)return!1;let l=e===1?1.1:1/1.1;return t.applyBatch([{kind:`setStyle`,id:n,props:{width:`${Math.max(8,Math.round(s*l))}px`,height:`${Math.max(8,Math.round(c*l))}px`}}],`resize`,{coalesceKey:`keyboard-resize:${n}`}),!0},f=()=>{let e=t.getSnapshot();return e.editingTextId?[e.editingTextId]:[...e.selection]},p=null,m=()=>{let e=f()[0];e!==void 0&&(p=Pd(t.styles(e,[...Nd])),i(a(`toast.styleCopied`)))},h=()=>{if(!p){i(a(`toast.styleNothing`));return}let e=f();e.length!==0&&(t.applyBatch(Fd(e,p),`paste style`),i(a(`toast.stylePasted`)))},g=e=>{let{pages:n,currentPageId:r}=t.getSnapshot(),i=n[n.findIndex(e=>e.id===r)+(e===`next`?1:-1)];i&&t.setCurrentPage(i.id)},_=()=>{if(n.cancel()||Dd())return;let e=t.getSnapshot();e.editingTextId?t.endTextEdit(!0):e.selection.length&&t.select([])};return{run:e=>{let i=t.getSnapshot();switch(e.type){case`save`:return t.save(),!0;case`undo`:return n.cancel(),t.undo(),!0;case`redo`:return n.cancel(),t.redo(),!0;case`zoom`:return e.mode===`fit`?r.fit():r.step(e.mode===`in`?1:-1),!0;case`scaleSelection`:return d(e.direction);case`duplicate`:return s(),!0;case`delete`:return c(),!0;case`edit`:{let e=i.selection[0];return e===void 0||Wa(t.index(),e)!==`text`?!1:(t.beginTextEdit(e,`end`),!0)}case`escape`:return _(),!0;case`nudge`:return u(e.dx,e.dy),!0;case`reorder`:return l(e.direction),!0;case`page`:return g(e.direction),!0;case`copyStyle`:return f().length!==0&&(m(),!0);case`pasteStyle`:return f().length!==0&&(h(),!0)}},duplicateSelection:s,deleteSelection:c,reorderSelection:l,nudgeSelection:u,copyStyle:m,pasteStyle:h,changePage:g,escape:_}}var Jd=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Q=o(((e,t)=>{t.exports=Jd()}))(),Yd={undo:`M6 4 3 7l3 3M3 7h6.5a3.5 3.5 0 0 1 0 7H7`,redo:`m10 4 3 3-3 3M13 7H6.5a3.5 3.5 0 0 0 0 7H9`,reset:`M3 8a5 5 0 1 0 1.6-3.7M3 2.5v3h3`,save:`M3 3h8l2 2v8H3zM5.5 3v3.5h5V3M5.5 13V9.5h5V13`,export:`M8 2v8M5 7l3 3 3-3M3 12.5h10`,download:`M8 2v7.5M5 7l3 3 3-3M2.5 13.5h11`,chevron:`m4 6 4 4 4-4`,close:`m4 4 8 8M12 4l-8 8`,prev:`m10 3-5 5 5 5`,next:`m6 3 5 5-5 5`,grip:`M6 4v.01M10 4v.01M6 8v.01M10 8v.01M6 12v.01M10 12v.01`,parent:`M3 6V3h3M13 6V3h-3M3 10v3h3M13 10v3h-3M6 6h4v4H6z`,duplicate:`M5.5 5.5h7v7h-7zM3.5 10.5v-7h7`,trash:`M3 4.5h10M6.5 4.5V3h3v1.5M4.5 4.5l.6 8.5h5.8l.6-8.5M7 7v4M9 7v4`,forward:`M8 3v8M4.5 7.5 8 11l3.5-3.5M3 13.5h10`,backward:`M8 13V5M4.5 8.5 8 5l3.5 3.5M3 2.5h10`,text:`M3.5 4V3h9v1M8 3v10M6 13h4`,block:`M3 3h10v10H3zM3 7h10`,layers:`m8 2.5 5.5 3L8 8.5l-5.5-3zM2.5 8.5 8 11.5l5.5-3M2.5 11 8 14l5.5-3`,code:`m5.5 4.5-3.5 3.5 3.5 3.5M10.5 4.5 14 8l-3.5 3.5`,warn:`M8 3 14 13H2zM8 7v3M8 11.5v.01`,alignLeft:`M3 4h10M3 7h6M3 10h10M3 13h6`,alignCenter:`M3 4h10M5 7h6M3 10h10M5 13h6`,alignRight:`M3 4h10M7 7h6M3 10h10M7 13h6`,alignJustify:`M3 4h10M3 7h10M3 10h10M3 13h10`,spacing:`M3 3v10M13 3v10M5.5 8h5M7.5 6 5.5 8l2 2M8.5 6l2 2-2 2`,eraser:`m9 3 4 4-5.5 5.5H5L3 10.5zM6 6l4 4M8 12.5h5`,opacity:`M8 2.5s4 4.2 4 7.2a4 4 0 0 1-8 0c0-3 4-7.2 4-7.2z`,image:`M2.5 3.5h11v9h-11zM2.5 11l3.5-3.5 3 3 2-2 2.5 2.5M10.5 6v.01`,compare:`M2 3h5v10H2zM9 3h5v10H9z`,crop:`M4.5 2v9.5H14M2 4.5h9.5V14`,replace:`M3 6h8.5M9 3.5 11.5 6 9 8.5M13 10H4.5M7 7.5 4.5 10 7 12.5`,pencil:`M3 10.5 10.5 3a1.8 1.8 0 0 1 2.5 2.5L5.5 13H3zM9.5 4l2.5 2.5`,brush:`M3 13c1.5 0 2.5-.5 2.5-2 0-1 .5-1.5 1.5-1.5L12.5 4a1.4 1.4 0 0 0-2-2L5 7.5c-.5.5-1 1-1 2C4 11 3 11.5 3 13z`,paste:`M5.5 3h5v2h-5zM4 4h8v9.5H4zM6.5 8h3M6.5 10.5h3`,shape:`M8 2.5 13.5 12.5h-11z`,play:`M5.5 3.5v9l7-4.5z`,minus:`M3 8h10`,gem:`M2 5.5 4.7 2.8h6.6L14 5.5 8 13.2 2 5.5zM2 5.5h12M4.7 2.8l1.2 2.7L8 13.2l2.1-7.7 1.2-2.7`,wrap:`M2 4h12M2 7.5h9a2.2 2.2 0 0 1 0 4.4H6m2-2-2 2 2 2M2 11h1`,plus:`M8 3v10M3 8h10`,cloud:`M4.5 12.5a3 3 0 0 1-.5-5.9A4.2 4.2 0 0 1 12 7a2.8 2.8 0 0 1-.2 5.5z`,upload:`M8 10V2.5M5 5.5 8 2.5l3 3M3 9v4.5h10V9`,check:`m3.5 8.5 3 3 6-7`};function $({name:e,size:t=16}){return(0,Q.jsx)(`svg`,{className:`icon`,width:t,height:t,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,Q.jsx)(`path`,{d:Yd[e]})})}var Xd={"compare.open":`Compare reference`,"compare.close":`Hide comparison`,"compare.reference":`Reference`,"compare.result":`Your design`,"compare.page":`Page {n}`,"compare.empty":`No reference for this page`,"compare.emptyHint":`References follow their original page order`,"compare.loading":`Loading reference…`,"compare.failed":`Could not load references`,"compare.retry":`Retry`,"compare.readonly":`Original · Read only`,"compare.editable":`Editable canvas`,"compare.imageFailed":`Reference image unavailable`,"assets.confirm":`Confirm`,"code.disableWrap":`Turn off wrap`,"code.enableWrap":`Wrap lines`,"code.copy":`Copy`,"code.status.copied":`Full code copied`,"code.status.copyFailed":`Copy failed. Check your browser clipboard permissions.`,"export.pages":`Select pages · {n}/{total}`,"export.all":`Export all`,"export.format":`File format`,"export.resolution":`Resolution`,"export.name":`File name`,"export.editName":`Edit file name`,"export.confirmName":`Confirm file name`,"export.imageFormats":`Image formats`,"export.documentFormats":`Document formats`,"export.standard":`Standard`,"export.high":`High resolution`,"export.paid":`Paid feature`,"export.upgrade":`This feature is available with a paid plan.`,"export.pricing":`Unlock`,"export.progress":`Exporting… {percent}% ({done}/{total})`,"export.done":`ZIP exported`,"export.failed":`Export failed. Try again.`,"history.draftRestored":`Restored to the editor. Save to keep your changes.`,"history.draftFailed":`Could not restore this revision. Try again.`,"zoom.in":`Zoom in`,"zoom.out":`Zoom out`,"panel.add":`Add`,"panel.images":`Add image`,"design.size":`Size`,"design.background":`Background`,"design.cancel":`Cancel`,"design.apply":`Apply`,"add.text":`Add text`,"add.page":`Add page`,"assets.current":`This project`,"assets.history":`Asset history`,"assets.projectHistory":`Project asset history`,"assets.upload":`Upload`,"assets.empty":`No images yet`,"assets.more":`Load more`,"assets.failed":`Could not load images. Try again.`,"colors.expand":`More colors`,"colors.collapse":`Fewer colors`,"topbar.undo":`Undo (Ctrl+Z)`,"topbar.redo":`Redo (Ctrl+Shift+Z)`,"topbar.resetLayout":`Reset to initial layout`,"topbar.save":`Save`,"topbar.saveTitle":`Save (Ctrl+S)`,"topbar.export":`Export`,"topbar.exportHtml":`Save as HTML`,"topbar.downloadImages":`Download all`,"topbar.downloadImagesBusy":`Downloading…`,"save.saved":`All changes saved`,"save.dirty":`Unsaved changes`,"save.saving":`Saving…`,"save.error":`Save failed`,"cloud.save":`Save to Cloud`,"cloud.tooltip":`Manage all your assets on the Popost website`,"cloud.waiting":`Waiting for login…`,"cloud.copyLink":`Copy link`,"cloud.linkCopied":`Link copied`,"cloud.loginLink":`Login link`,"cloud.uploading":`Uploading…`,"cloud.syncing":`Syncing…`,"cloud.saved":`Saved to cloud`,"cloud.synced":`Synced`,"cloud.open":`Open`,"cloud.openTitle":`Open in popost`,"cloud.dirty":`Local changes not uploaded`,"cloud.syncNow":`Sync now`,"cloud.failed":`Upload failed`,"cloud.retry":`Retry`,"cloud.conflict":`Edited on the web`,"cloud.overwrite":`Overwrite`,"cloud.overwriteTitle":`Replace the web copy with this local version`,"cloud.error.UNAUTHORIZED":`The login expired or was already used. Save to Cloud again.`,"cloud.error.STORAGE_FULL":`Your cloud storage is full.`,"cloud.error.RATE_LIMITED":`Too many uploads. Try again in a moment.`,"cloud.error.DECK_INVALID":`The cloud could not accept this project.`,"cloud.error.NETWORK":`Could not reach popost.ai.`,"cloud.error.LOCAL_SAVE_FAILED":`Could not save local edits. Save the project before uploading.`,"cloud.error.generic":`Upload failed. Try again.`,"status.loading":`Loading…`,"status.errorTitle":`Could not open the document`,"status.retry":`Try again`,"error.no-pages":`This document has no pages. A page is a top-level element with class "slide".`,"conflict.title":`Saved elsewhere`,"conflict.body":`This document was changed somewhere else since you opened it. Reload to get the latest version (your unsaved edits are lost), or overwrite it with your version.`,"conflict.reload":`Reload`,"conflict.overwrite":`Overwrite`,"notice.saveFailed":`Save failed`,"notice.editRejected":`That change could not be applied`,"notice.resetDone":`Layout reset to the initial version. Save to keep it.`,"notice.resetUnavailable":`No initial version is available for this document`,"notice.downloadDone":`Download started`,"notice.downloadFailed":`Download failed`,"notice.fontFailed":`Could not apply the font`,"notice.imageFailed":`Could not use the image`,"notice.textOverflow":`Edited text exceeds its box`,"toast.deleted":`Deleted · Ctrl+Z to undo`,"toast.pageDeleted":`Page deleted · Ctrl+Z to undo`,"rail.label":`Panels`,"panel.text":`Text`,"panel.block":`Block`,"panel.layers":`Layers`,"panel.code":`Code`,"panel.close":`Close panel`,"pages.label":`Pages`,"pages.page":`Page {n}`,"pages.prev":`Previous page`,"pages.next":`Next page`,"pages.counter":`{n} / {total}`,"pages.overflowBadge":`Text exceeds its box on this page`,"pages.duplicate":`Duplicate page`,"pages.moveLeft":`Move left`,"pages.moveRight":`Move right`,"pages.delete":`Delete page`,"pages.overflowCount":`{n} text overflow`,"pages.overflowJump":`Jump to the next overflowing text`,"zoom.slider":`Zoom`,"zoom.fit":`Fit to window`,"pill.move":`Drag to move`,"pill.selectParent":`Select parent`,"pill.duplicate":`Duplicate (Ctrl+D)`,"pill.delete":`Delete (Delete)`,"pill.forward":`Bring forward (Alt+↓)`,"pill.backward":`Send backward (Alt+↑)`,"pill.selected":`Selected {n}`,"toolbar.label":`Format`,"toast.styleCopied":`Style copied`,"toast.stylePasted":`Style pasted`,"toast.styleNothing":`Copy a style first (Ctrl+Alt+C)`,"panel.selectHint":`Select a block on the canvas first.`,"toolbar.font":`Font`,"toolbar.fontsLoading":`Loading fonts…`,"toolbar.fontsFailed":`Font library unavailable`,"toolbar.fontMissing":`{name} (not in public library)`,"toolbar.size":`Font size (px)`,"toolbar.sizeDown":`Smaller`,"toolbar.sizeUp":`Larger`,"toolbar.bold":`Bold (Ctrl+B)`,"toolbar.italic":`Italic (Ctrl+I)`,"toolbar.underline":`Underline (Ctrl+U)`,"toolbar.strike":`Strikethrough`,"toolbar.color":`Text colour`,"toolbar.alignLeft":`Align left`,"toolbar.alignCenter":`Align centre`,"toolbar.alignRight":`Align right`,"toolbar.alignJustify":`Justify`,"toolbar.spacing":`Line height and letter spacing`,"toolbar.lineHeight":`Line height`,"toolbar.letterSpacing":`Letter spacing`,"toolbar.uppercase":`Uppercase`,"toolbar.opacity":`Opacity`,"toolbar.clear":`Clear formatting`,"toolbar.copyStyle":`Copy style (Ctrl+Alt+C)`,"toolbar.pasteStyle":`Paste style (Ctrl+Alt+V)`,"toolbar.replaceImage":`Replace image`,"toolbar.crop":`Crop & align`,"toolbar.block":`Block`,"colors.document":`Document colours`,"colors.presets":`Preset colours`,"colors.custom":`Custom colour`,"colors.none":`No colour`,"text.add":`Add text`,"text.addHeading":`Heading`,"text.addSubheading":`Subheading`,"text.addParagraph":`Paragraph`,"text.sampleHeading":`Heading`,"text.sampleSubheading":`Subheading`,"text.sampleParagraph":`Paragraph text`,"text.color":`Text colour`,"block.background":`Background`,"block.radius":`Corner radius`,"block.radius.none":`None`,"block.radius.subtle":`Subtle`,"block.radius.medium":`Medium`,"block.radius.large":`Large`,"block.radius.full":`Full`,"block.padding":`Padding`,"block.padding.none":`None`,"block.padding.narrow":`Narrow`,"block.padding.medium":`Medium`,"block.padding.wide":`Wide`,"block.margin":`Margin`,"block.margin.none":`None`,"block.margin.small":`Small`,"block.margin.medium":`Medium`,"block.margin.large":`Large`,"block.border":`Border`,"block.border.none":`None`,"block.border.solid":`Solid`,"block.border.dashed":`Dashed`,"block.border.dotted":`Dotted`,"block.borderWidth.thin":`Thin`,"block.borderWidth.medium":`Medium`,"block.borderWidth.thick":`Thick`,"block.shadow":`Shadow`,"block.shadow.none":`None`,"block.shadow.soft":`Soft`,"block.shadow.medium":`Medium`,"block.shadow.strong":`Strong`,"block.opacity":`Opacity`,"block.size":`Size`,"block.sizeHint":`Drag the handles on the canvas to resize.`,"block.resetSize":`Reset to original size`,"layers.empty":`This page has no selectable blocks.`,"layers.kind.text":`Text`,"layers.kind.image":`Image`,"layers.kind.svg":`Graphic`,"layers.kind.video":`Video`,"layers.kind.box":`Box`,"code.save":`Save code`,"code.saving":`Saving…`,"code.download":`Download HTML`,"code.status.idle":`Static HTML · editable`,"code.status.dirty":`Unsaved code changes`,"code.status.saved":`Code saved. Canvas and thumbnails updated.`,"code.status.appliedUnsaved":`Code applied to the canvas, but saving the document did not finish.`,"code.status.downloaded":`Downloaded a static HTML copy (no executable scripts)`,"code.err.empty":`Code cannot be empty`,"code.err.too-large":`Code exceeds the 60 MB limit`,"code.err.no-slide":`Keep at least one .slide block`,"code.err.unsafe":`Only static HTML is supported. Scripts, event handlers and embedded content are not allowed`,"code.err.rejected":`Could not update the canvas`,"image.upload":`Upload from computer`,"image.inDocument":`Images in this document`,"image.use":`Use this image`,"image.fromUrl":`Image URL`,"image.apply":`Apply`,"image.loading":`Loading…`,"image.err.notImage":`not an image file`,"image.err.tooLarge":`image is larger than 12 MB`,"image.err.fetch":`the address could not be loaded (it may block other sites)`,"crop.hint":`Drag to reposition the image`,"crop.fill":`Fill container`,"crop.whole":`Show whole`,"crop.done":`Done`},Zd={en:Xd,zh:{"compare.open":`复刻对比`,"compare.close":`收起对比`,"compare.reference":`参考图文`,"compare.result":`当前作品`,"compare.page":`第 {n} 页`,"compare.empty":`这一页暂无参考图文`,"compare.emptyHint":`参考图文按原始顺序与作品逐页对应`,"compare.loading":`正在加载参考图文…`,"compare.failed":`参考图文加载失败`,"compare.retry":`重试`,"compare.readonly":`原始参考 · 只读`,"compare.editable":`可编辑画布`,"compare.imageFailed":`参考图片暂时无法加载`,"assets.confirm":`确定`,"code.disableWrap":`取消自动换行`,"code.enableWrap":`自动换行`,"code.copy":`复制`,"code.status.copied":`已复制完整代码`,"code.status.copyFailed":`复制失败,请检查浏览器的剪贴板权限。`,"export.pages":`选择页面 · {n}/{total}`,"export.all":`导出全部`,"export.format":`文件格式`,"export.resolution":`分辨率`,"export.name":`文件名`,"export.editName":`编辑文件名`,"export.confirmName":`确认文件名`,"export.imageFormats":`图片格式`,"export.documentFormats":`文档格式`,"export.standard":`标准`,"export.high":`高分辨率`,"export.paid":`付费权益`,"export.upgrade":`该功能为付费权益,付费后可使用。`,"export.pricing":`前往解锁`,"export.progress":`正在导出… {percent}%({done}/{total})`,"export.done":`ZIP 已导出`,"export.failed":`导出失败,请重试`,"history.draftRestored":`已还原到编辑器,请保存以保留更改。`,"history.draftFailed":`此版本无法还原,请重试。`,"zoom.in":`放大`,"zoom.out":`缩小`,"panel.add":`增加`,"panel.images":`增加图片`,"design.size":`尺寸`,"design.background":`背景色`,"design.cancel":`取消`,"design.apply":`确定`,"add.text":`增加文字`,"add.page":`增加页面`,"assets.current":`本次素材`,"assets.history":`历史素材`,"assets.projectHistory":`工程素材记录`,"assets.upload":`上传`,"assets.empty":`暂无素材`,"assets.more":`加载更多`,"assets.failed":`素材加载失败,请重试`,"colors.expand":`展开色板`,"colors.collapse":`收起色板`,"topbar.undo":`撤销 (Ctrl+Z)`,"topbar.redo":`重做 (Ctrl+Shift+Z)`,"topbar.resetLayout":`还原初始布局`,"topbar.save":`保存`,"topbar.saveTitle":`保存 (Ctrl+S)`,"topbar.export":`导出`,"topbar.exportHtml":`保存为 HTML`,"topbar.downloadImages":`下载全部`,"topbar.downloadImagesBusy":`下载中…`,"save.saved":`所有更改已保存`,"save.dirty":`有未保存的更改`,"save.saving":`保存中…`,"save.error":`保存失败`,"cloud.save":`保存到云端`,"cloud.tooltip":`在popost网页端管理你的所有资产`,"cloud.waiting":`等待登录…`,"cloud.copyLink":`复制链接`,"cloud.linkCopied":`链接已复制`,"cloud.loginLink":`登录链接`,"cloud.uploading":`上传中…`,"cloud.syncing":`同步中…`,"cloud.saved":`已保存到云端`,"cloud.synced":`已同步`,"cloud.open":`打开`,"cloud.openTitle":`在 popost 打开`,"cloud.dirty":`本地改动未上传`,"cloud.syncNow":`立即同步`,"cloud.failed":`上传失败`,"cloud.retry":`重试`,"cloud.conflict":`网页端已有修改`,"cloud.overwrite":`覆盖`,"cloud.overwriteTitle":`用本地版本替换网页端的版本`,"cloud.error.UNAUTHORIZED":`登录已过期或已使用,请重新点击“保存到云端”。`,"cloud.error.STORAGE_FULL":`云端存储空间已满。`,"cloud.error.RATE_LIMITED":`上传过于频繁,请稍后再试。`,"cloud.error.DECK_INVALID":`云端无法接收这个作品。`,"cloud.error.NETWORK":`无法连接 popost.ai。`,"cloud.error.LOCAL_SAVE_FAILED":`本地改动保存失败。请先保存作品,再上传到云端。`,"cloud.error.generic":`上传失败,请重试。`,"status.loading":`加载中…`,"status.errorTitle":`无法打开文档`,"status.retry":`重试`,"error.no-pages":`文档里没有页面。页面是带 "slide" 类的顶层元素。`,"conflict.title":`已在别处保存`,"conflict.body":`打开之后,这份文档在别处被修改过。可以重新加载最新版本(未保存的修改会丢失),或用你的版本覆盖。`,"conflict.reload":`重新加载`,"conflict.overwrite":`覆盖`,"notice.saveFailed":`保存失败`,"notice.editRejected":`这个修改无法应用`,"notice.resetDone":`已还原为初始布局,记得保存。`,"notice.resetUnavailable":`这份文档没有可还原的初始版本`,"notice.downloadDone":`已开始下载`,"notice.downloadFailed":`下载失败`,"notice.fontFailed":`无法应用该字体`,"notice.imageFailed":`无法使用这张图片`,"notice.textOverflow":`编辑后的文字超出了文本框`,"toast.deleted":`已删除 · Ctrl+Z 撤销`,"toast.pageDeleted":`已删除页面 · Ctrl+Z 撤销`,"rail.label":`面板`,"panel.text":`文字`,"panel.block":`区块`,"panel.layers":`图层`,"panel.code":`代码`,"panel.close":`关闭面板`,"pages.label":`页面`,"pages.page":`第 {n} 页`,"pages.prev":`上一页`,"pages.next":`下一页`,"pages.counter":`{n} / {total}`,"pages.overflowBadge":`这一页有文字超出文本框`,"pages.duplicate":`复制页面`,"pages.moveLeft":`左移`,"pages.moveRight":`右移`,"pages.delete":`删除页面`,"pages.overflowCount":`{n} 处文字溢出`,"pages.overflowJump":`跳到下一处溢出的文字`,"zoom.slider":`缩放`,"zoom.fit":`适应窗口`,"pill.move":`拖动移动`,"pill.selectParent":`选择父级`,"pill.duplicate":`复制 (Ctrl+D)`,"pill.delete":`删除 (Delete)`,"pill.forward":`上移一层 (Alt+↓)`,"pill.backward":`下移一层 (Alt+↑)`,"pill.selected":`已选 {n} 个`,"toolbar.label":`格式`,"toast.styleCopied":`样式已复制`,"toast.stylePasted":`样式已粘贴`,"toast.styleNothing":`请先复制样式 (Ctrl+Alt+C)`,"panel.selectHint":`请先在画布上选中一个区块。`,"toolbar.font":`字体`,"toolbar.fontsLoading":`字体加载中…`,"toolbar.fontsFailed":`字体库加载失败`,"toolbar.fontMissing":`{name}(不在公共字体库)`,"toolbar.size":`字号 (px)`,"toolbar.sizeDown":`减小字号`,"toolbar.sizeUp":`增大字号`,"toolbar.bold":`加粗 (Ctrl+B)`,"toolbar.italic":`斜体 (Ctrl+I)`,"toolbar.underline":`下划线 (Ctrl+U)`,"toolbar.strike":`删除线`,"toolbar.color":`文字颜色`,"toolbar.alignLeft":`左对齐`,"toolbar.alignCenter":`居中对齐`,"toolbar.alignRight":`右对齐`,"toolbar.alignJustify":`两端对齐`,"toolbar.spacing":`行距与字距`,"toolbar.lineHeight":`行距`,"toolbar.letterSpacing":`字距`,"toolbar.uppercase":`大写`,"toolbar.opacity":`不透明度`,"toolbar.clear":`清除格式`,"toolbar.copyStyle":`复制样式 (Ctrl+Alt+C)`,"toolbar.pasteStyle":`粘贴样式 (Ctrl+Alt+V)`,"toolbar.replaceImage":`替换图片`,"toolbar.crop":`裁剪与对齐`,"toolbar.block":`区块`,"colors.document":`文档中的颜色`,"colors.presets":`预设颜色`,"colors.custom":`自定义颜色`,"colors.none":`无颜色`,"text.add":`添加文字`,"text.addHeading":`标题`,"text.addSubheading":`副标题`,"text.addParagraph":`正文`,"text.sampleHeading":`标题`,"text.sampleSubheading":`副标题`,"text.sampleParagraph":`正文文字`,"text.color":`文字颜色`,"block.background":`背景颜色`,"block.radius":`圆角`,"block.radius.none":`无`,"block.radius.subtle":`轻微`,"block.radius.medium":`中等`,"block.radius.large":`较大`,"block.radius.full":`全圆`,"block.padding":`内边距`,"block.padding.none":`无`,"block.padding.narrow":`窄`,"block.padding.medium":`中`,"block.padding.wide":`宽`,"block.margin":`外边距`,"block.margin.none":`无`,"block.margin.small":`小`,"block.margin.medium":`中`,"block.margin.large":`大`,"block.border":`边框`,"block.border.none":`无`,"block.border.solid":`实线`,"block.border.dashed":`虚线`,"block.border.dotted":`点线`,"block.borderWidth.thin":`细`,"block.borderWidth.medium":`中`,"block.borderWidth.thick":`粗`,"block.shadow":`阴影`,"block.shadow.none":`无`,"block.shadow.soft":`柔和`,"block.shadow.medium":`中等`,"block.shadow.strong":`强烈`,"block.opacity":`不透明度`,"block.size":`尺寸`,"block.sizeHint":`在画布上拖动控制点调整大小。`,"block.resetSize":`还原原始尺寸`,"layers.empty":`这一页没有可选中的区块。`,"layers.kind.text":`文字`,"layers.kind.image":`图片`,"layers.kind.svg":`图形`,"layers.kind.video":`视频`,"layers.kind.box":`容器`,"code.save":`保存代码`,"code.saving":`保存中…`,"code.download":`下载 html`,"code.status.idle":`静态 HTML · 可直接编辑`,"code.status.dirty":`有未保存的代码修改`,"code.status.saved":`代码已保存,画布与图文缩略图已更新`,"code.status.appliedUnsaved":`代码已应用到画布,但文档尚未保存成功`,"code.status.downloaded":`已下载 HTML 静态副本(不含可执行脚本)`,"code.err.empty":`代码不能为空`,"code.err.too-large":`代码超过60MB上限`,"code.err.no-slide":`请保留至少一个 .slide 图文区块`,"code.err.unsafe":`仅支持静态 HTML,不允许脚本、事件处理器或嵌入内容`,"code.err.rejected":`无法更新画布`,"image.upload":`从本地上传`,"image.inDocument":`文档中已有的图片`,"image.use":`使用这张图片`,"image.fromUrl":`图片链接`,"image.apply":`应用`,"image.loading":`加载中…`,"image.err.notImage":`不是图片文件`,"image.err.tooLarge":`图片超过 12 MB`,"image.err.fetch":`无法读取该地址(可能不允许其他网站读取)`,"crop.hint":`拖动调整图片位置`,"crop.fill":`填满容器`,"crop.whole":`完整显示`,"crop.done":`完成`}};function Qd(e){let t=Zd[e];return(e,n)=>{let r=t[e]??Xd[e]??e;return n?r.replace(/\{(\w+)\}/g,(e,t)=>t in n?String(n[t]):e):r}}var $d=(0,v.createContext)({lang:`en`,t:Qd(`en`)});function ef({lang:e,children:t}){let n=(0,v.useMemo)(()=>({lang:e,t:Qd(e)}),[e]);return(0,v.createElement)($d.Provider,{value:n},t)}var tf=()=>(0,v.useContext)($d).t,nf=()=>(0,v.useContext)($d).lang,rf={saveFailed:`notice.saveFailed`,editRejected:`notice.editRejected`,resetDone:`notice.resetDone`,resetUnavailable:`notice.resetUnavailable`,downloadDone:`notice.downloadDone`,downloadFailed:`notice.downloadFailed`,fontFailed:`notice.fontFailed`,imageFailed:`notice.imageFailed`,textOverflow:`notice.textOverflow`};function af(e,t){let n=e(rf[t.key]);return t.detail?`${n}: ${t.detail}`:n}function of(e,t){if(!t)return``;let n=`error.${t}`;return n in Xd?e(n):t}var sf=e=>Math.max(0,Math.min(1,e)),cf={left:0,top:0,center:.5,right:1,bottom:1};function lf(e){if(e===void 0)return .5;if(e in cf)return cf[e];if(e.endsWith(`%`)){let t=Number.parseFloat(e);if(Number.isFinite(t))return sf(t/100)}return .5}function uf(e){let t=(e??``).trim().toLowerCase().split(/\s+/).filter(Boolean);return t.length===1&&(t[0]===`top`||t[0]===`bottom`)?{x:.5,y:lf(t[0])}:{x:lf(t[0]),y:lf(t[1])}}var df=e=>`${Math.round(e*1e3)/10}%`;function ff(e){return`${df(e.x)} ${df(e.y)}`}function pf(e,t,n){let r=t.width/e.width,i=t.height/e.height,a=n===`cover`?Math.max(r,i):Math.min(r,i);return{width:e.width*a,height:e.height*a}}function mf(e){let{natural:t,box:n,fit:r,start:i,dx:a,dy:o}=e;if(!(t.width>0&&t.height>0&&n.width>0&&n.height>0))return i;let s=pf(t,n,r),c=(e,t,n,r)=>{let i=n-r;return Math.abs(i)<.5?e:sf(e+t/i)};return{x:c(i.x,a,n.width,s.width),y:c(i.y,o,n.height,s.height)}}function hf(e){return e===`cover`||e===`contain`?e:null}var gf=class extends Error{reason;constructor(e){super(e),this.reason=e}};function _f(e){let t=new Set,n=[];for(let r of e.order){let i=e.elements.get(r);if(!i||i.tag.toLowerCase()!==`img`)continue;let a=Pi(i,`src`);!a||t.has(a)||(t.add(a),n.push({src:a,id:r}))}return n}function vf(e){return/^image\//i.test(e)}function yf(e){if(!vf(e.type))throw new gf(`notImage`);if(e.size>12582912)throw new gf(`tooLarge`)}function bf(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(new gf(`fetch`)),r.readAsDataURL(e)})}async function xf(e){return yf(e),bf(e)}function Sf(e){let t=e.trim();if(!t)return null;if(/^data:image\//i.test(t))return t;try{let e=new URL(/^[a-z][a-z0-9+.-]*:/i.test(t)?t:`https://${t}`);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`blob:`?e.href:null}catch{return null}}async function Cf(e,t=fetch){let n=Sf(e);if(!n)throw new gf(`fetch`);if(n.startsWith(`data:`))return n;let r;try{let e=await t(n);if(!e.ok)throw new gf(`fetch`);r=await e.blob()}catch(e){throw e instanceof gf?e:new gf(`fetch`)}return xf(r)}var wf=(0,v.createContext)(()=>void 0),Tf=()=>(0,v.useContext)(wf),Ef=3200;function Df({children:e}){let[t,n]=(0,v.useState)([]),r=(0,v.useRef)(1),i=(0,v.useRef)(new Set),a=(0,v.useCallback)((e,t=`info`)=>{let a=r.current++;n(n=>[...n.filter(t=>t.text!==e).slice(-3),{id:a,kind:t,text:e}]);let o=setTimeout(()=>{i.current.delete(o),n(e=>e.filter(e=>e.id!==a))},Ef);i.current.add(o)},[]);(0,v.useEffect)(()=>{let e=i.current;return()=>e.forEach(clearTimeout)},[]);let o=(0,v.useMemo)(()=>a,[a]);return(0,Q.jsxs)(wf.Provider,{value:o,children:[e,(0,Q.jsx)(`div`,{className:`toasts`,role:`status`,"aria-live":`polite`,children:t.map(e=>(0,Q.jsx)(`div`,{className:`toast toast-${e.kind}`,children:e.text},e.id))})]})}var Of={notImage:`image.err.notImage`,tooLarge:`image.err.tooLarge`,fetch:`image.err.fetch`};function kf(){let e=tf(),t=Tf();return(0,v.useCallback)(n=>{let r=n instanceof gf?e(Of[n.reason]):n instanceof Error?n.message:``;t(r?`${e(`notice.imageFailed`)}: ${r}`:e(`notice.imageFailed`),`error`)},[e,t])}function Af(e,t,n){let r=e.index().elements.get(t);if(!r)return;let i=[{kind:`setAttr`,id:t,name:`src`,value:n}];Pi(r,`srcset`)!==null&&i.push({kind:`setAttr`,id:t,name:`srcset`,value:null}),e.applyBatch(i,`replace image`)}var jf=(e,t)=>e.index().elements.get(t)?.tag.toLowerCase()===`img`;function Mf(e){let t=kf();(0,v.useEffect)(()=>e.onFrameEvent(n=>{if(n.type!==`drop`||n.id===null||!jf(e,n.id))return;let r=n.files.find(e=>vf(e.type));if(r){if(r.dataURL.length*3/4>12582912){t(new gf(`tooLarge`));return}Af(e,n.id,r.dataURL),e.select([n.id])}}),[e,t])}function Nf({controller:e,id:t,onDone:n}){let r=tf(),i=kf(),a=(0,v.useRef)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),u=_f(e.index()),d=e.index().elements.get(t),f=d?Pi(d,`src`):null,p=async r=>{l(!0);try{Af(e,t,await r()),n()}catch(e){i(e)}finally{l(!1)}};return(0,Q.jsxs)(`div`,{className:`image-picker`,children:[(0,Q.jsxs)(`button`,{type:`button`,id:`img-upload`,className:`btn wide`,disabled:c,onClick:()=>a.current?.click(),children:[(0,Q.jsx)($,{name:`upload`}),` `,r(`image.upload`)]}),(0,Q.jsx)(`input`,{ref:a,id:`img-file`,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&p(()=>xf(t))}}),u.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`swatch-title`,children:r(`image.inDocument`)}),(0,Q.jsx)(`div`,{className:`img-grid`,id:`img-doc-grid`,children:u.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`img-thumb${e.src===f?` current`:``}`,title:r(`image.use`),disabled:c||e.src===f,onClick:()=>void p(async()=>e.src),children:(0,Q.jsx)(`img`,{src:e.src,alt:``})},e.src))})]}),(0,Q.jsx)(`div`,{className:`swatch-title`,children:r(`image.fromUrl`)}),(0,Q.jsxs)(`form`,{className:`img-url`,onSubmit:e=>{e.preventDefault(),o.trim()&&p(()=>Cf(o))},children:[(0,Q.jsx)(`input`,{id:`img-url`,type:`text`,inputMode:`url`,placeholder:`https://…`,value:o,onChange:e=>s(e.target.value),"aria-label":r(`image.fromUrl`)}),(0,Q.jsx)(`button`,{type:`submit`,id:`img-url-apply`,className:`btn`,disabled:c||!o.trim(),children:r(c?`image.loading`:`image.apply`)})]})]})}function Pf({controller:e,snap:t,id:n,scale:r,onExit:i}){let a=tf(),o=(0,v.useRef)(null),s=(0,v.useRef)(!1),c=t.rects[n],l=(0,v.useCallback)(()=>{s.current&&e.cancelLivePreview([n]),s.current=!1,o.current=null,i()},[e,n,i]);kd(!0,l);let u=t.selection.length===1&&t.selection[0]===n&&e.index().elements.has(n);if((0,v.useEffect)(()=>{u||i()},[u,i]),!c)return null;let d=e.styles(n,[`object-fit`,`object-position`]),f=hf(d[`object-fit`]),p={left:c.x*r,top:c.y*r,width:c.width*r,height:c.height*r},m=t=>e.apply({kind:`setStyle`,id:n,props:{"object-fit":t}},{label:`crop`}),h=e=>{e.button===0&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),o.current={startX:e.clientX,startY:e.clientY,start:uf(d[`object-position`]),fit:f??`cover`,last:null})},g=t=>{let i=o.current,a=sd(n);!i||!a||(i.last=ff(mf({natural:a,box:{width:c.width,height:c.height},fit:i.fit,start:i.start,dx:(t.clientX-i.startX)/r,dy:(t.clientY-i.startY)/r})),s.current=!0,e.livePreview([{kind:`style`,id:n,props:{"object-position":i.last,"object-fit":i.fit}}]))},_=t=>{let r=o.current;o.current=null,s.current=!1,t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId),r?.last&&e.apply({kind:`setStyle`,id:n,props:{"object-position":r.last,"object-fit":r.fit}},{label:`crop`})},y=Math.max(4,Math.min(p.top+p.height+10,e.pageSize().height*r-44));return(0,Q.jsxs)(`div`,{className:`crop-layer`,"data-keepfocus":``,onPointerDown:e=>e.target===e.currentTarget&&l(),children:[(0,Q.jsx)(`div`,{id:`crop-box`,className:`crop-box`,style:p,onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:()=>l(),children:(0,Q.jsx)(`span`,{className:`crop-hint`,children:a(`crop.hint`)})}),(0,Q.jsxs)(`div`,{className:`crop-bar`,style:{left:p.left,top:y},role:`toolbar`,children:[(0,Q.jsx)(`button`,{type:`button`,id:`crop-fill`,className:`btn${f===`cover`?` on`:``}`,onClick:()=>m(`cover`),children:a(`crop.fill`)}),(0,Q.jsx)(`button`,{type:`button`,id:`crop-whole`,className:`btn${f===`contain`?` on`:``}`,onClick:()=>m(`contain`),children:a(`crop.whole`)}),(0,Q.jsx)(`button`,{type:`button`,id:`crop-done`,className:`btn primary`,onClick:l,children:a(`crop.done`)})]})]})}var Ff=[`font-weight`,`font-style`,`text-decoration-line`,`text-transform`,`text-align`,`font-size`,`font-family`,`color`,`line-height`,`letter-spacing`,`opacity`],If=e=>{if(!e)return!1;if(e===`bold`||e===`bolder`)return!0;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=600};function Lf(e,t){let n=(e[`text-decoration-line`]??``).split(/\s+/);return{bold:t?!!t.bold:If(e[`font-weight`]),italic:t?!!t.italic:/^(italic|oblique)/.test(e[`font-style`]??``),underline:t?!!t.underline:n.includes(`underline`),strike:t?!!t.strike:n.includes(`line-through`),uppercase:e[`text-transform`]===`uppercase`}}function Rf(e){switch(e){case`center`:case`right`:case`justify`:return e;case`end`:return`right`;default:return`left`}}var zf=e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)?t:NaN},Bf=e=>Number.isFinite(zf(e[`font-size`]))?zf(e[`font-size`]):0;function Vf(e){let t=e[`line-height`],n=Bf(e);if(!t||t===`normal`||n<=0)return 1.2;let r=zf(t);return Number.isFinite(r)?t.endsWith(`px`)?Math.round(r/n*100)/100:r:1.2}function Hf(e){let t=e[`letter-spacing`],n=Bf(e);if(!t||t===`normal`||n<=0)return 0;let r=zf(t);return Number.isFinite(r)?Math.round(r/n*1e3)/1e3:0}function Uf(e){let t=zf(e.opacity);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function Wf(e){return((e??``).split(`,`)[0]?.trim()??``).replace(/^["']|["']$/g,``)}var Gf=e=>Math.round(e*255).toString(16).padStart(2,`0`),Kf=e=>Math.min(1,Math.max(0,e)),qf=(e,t,n)=>{let r=r=>{let i=(r+e/60)%6;return Gf(n-n*t*Math.max(0,Math.min(i,4-i,1)))};return`#${r(5)}${r(3)}${r(1)}`},Jf=e=>{let[t,n,r]=[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)/255),i=Math.max(t,n,r),a=i-Math.min(t,n,r);return{h:((a?(i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a)*60:0)+360)%360,s:i?a/i:0,v:i}},Yf=[20,45,100,155,190,220,250,290,325,350].flatMap(e=>[.94,.7,.4,.18].map((t,n)=>qf(e,t,[.76,.92,.99,1][n]??1)));function Xf({color:e,onPick:t,disabled:n}){let r=md(e.slice(0,7))??`#222222`,[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=Jf(r),d=i??u.h,f=c??(e.length===9?parseInt(e.slice(7),16)/255:1),p=(e,n,r)=>t(n===1?e:`${e}${Gf(n)}`,r),m=(e,t)=>{if(n)return;let r=e.currentTarget.getBoundingClientRect();a(d),p(qf(d,Kf((e.clientX-r.left)/r.width),1-Kf((e.clientY-r.top)/r.height)),f,t)};return(0,Q.jsxs)(`div`,{className:`color-picker`,children:[(0,Q.jsx)(`div`,{className:`color-field`,style:{backgroundColor:qf(d,1,1)},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),m(e,`live`)},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&m(e,`live`)},onPointerUp:e=>m(e,`commit`),children:(0,Q.jsx)(`i`,{style:{left:`${u.s*100}%`,top:`${(1-u.v)*100}%`,background:r}})}),(0,Q.jsx)(`input`,{className:`color-hue`,type:`range`,min:0,max:359,"aria-label":`Hue`,value:d,disabled:n,onChange:e=>{let t=Number(e.currentTarget.value);a(t),p(qf(t,u.s||.8,u.v||1),f,`commit`)}}),(0,Q.jsx)(`input`,{className:`color-alpha`,type:`range`,min:0,max:100,"aria-label":`Opacity`,value:Math.round(f*100),disabled:n,style:{backgroundImage:`linear-gradient(90deg, transparent, ${r})`},onChange:e=>{let t=Number(e.currentTarget.value)/100;l(t),p(r,t,`commit`)}}),(0,Q.jsxs)(`div`,{className:`color-inputs`,children:[(0,Q.jsxs)(`label`,{children:[`HEX`,(0,Q.jsx)(`input`,{"aria-label":`HEX`,value:o??r.toUpperCase(),maxLength:7,disabled:n,onChange:e=>s(e.currentTarget.value),onBlur:()=>{if(o===null)return;let e=o.trim(),t=md(e.startsWith(`#`)?e:`#${e}`);t&&(a(null),p(t,f,`commit`)),s(null)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}})]}),(0,Q.jsxs)(`span`,{children:[Math.round(f*100),`%`]})]})]})}function Zf({docColors:e,current:t,allowNone:n,disabled:r,expanded:i=!1,onPick:a}){let o=tf(),[s,c]=(0,v.useState)(i),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),p=d??t??`#222222`,m=(e,t)=>{f(e),a(e,t)},h=e=>(0,Q.jsx)(`button`,{type:`button`,className:`swatch${e===`transparent`?` none`:``}${p===e?` current`:``}`,style:e===`transparent`?void 0:{background:e},title:e===`transparent`?o(`colors.none`):e,"aria-label":e===`transparent`?o(`colors.none`):e,"data-color":e,disabled:r,onClick:()=>m(e,`commit`)},e);return(0,Q.jsxs)(`div`,{className:`swatches`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn color-toggle`,disabled:r,"aria-expanded":s,onClick:()=>{f(null),c(!s)},children:o(`colors.custom`)}),s&&(0,Q.jsx)(Xf,{color:p===`transparent`?`#ffffff`:p,onPick:m,disabled:r}),e.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`swatch-title`,children:o(`colors.document`)}),(0,Q.jsx)(`div`,{className:`swatch-grid`,"data-swatches":`document`,children:e.map(h)})]}),(0,Q.jsx)(`div`,{className:`swatch-title`,children:o(`colors.presets`)}),(0,Q.jsxs)(`div`,{className:`swatch-grid`,"data-swatches":`presets`,children:[n&&h(`transparent`),ld.map(h),l&&Yf.map(h)]}),(0,Q.jsx)(`button`,{type:`button`,className:`btn color-toggle`,"aria-expanded":l,onClick:()=>u(!l),children:o(l?`colors.collapse`:`colors.expand`)})]})}function Qf(e){return e.editingTextId?[e.editingTextId]:[...e.selection]}function $f(e,t){return(0,v.useMemo)(()=>yd(e.index().source),[e,t])}function ep(e,t,n){let r=Qf(t)[0];return(0,v.useMemo)(()=>r===void 0?{}:e.styles(r,[...n]),[e,r,t.sourceVersion,t.rects,t.editingTextId,t.textState])}function tp(e,t,n){return(0,v.useMemo)(()=>t.map(t=>Wa(e.index(),t)),[e,t.join(`,`),n])}var np=8;function rp({open:e,anchor:t,onClose:n,id:r,className:i,children:a}){let o=(0,v.useRef)(null),[s,c]=(0,v.useState)(null);return kd(e,n),(0,v.useLayoutEffect)(()=>{if(!e){c(null);return}let n=t.current?.getBoundingClientRect(),r=o.current?.offsetWidth??0;n&&c({left:Math.max(np,Math.min(n.left,window.innerWidth-r-np)),top:n.bottom+6})},[e,t]),e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`menu-scrim`,"data-keepfocus":``,onMouseDown:n}),(0,Q.jsx)(`div`,{ref:o,id:r,className:`popover pop-fixed${i?` ${i}`:``}`,style:s??{left:-9999,top:0},role:`dialog`,children:a})]}):null}function ip(e){return(0,v.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var ap=[{id:`left`,icon:`alignLeft`,label:`toolbar.alignLeft`},{id:`center`,icon:`alignCenter`,label:`toolbar.alignCenter`},{id:`right`,icon:`alignRight`,label:`toolbar.alignRight`},{id:`justify`,icon:`alignJustify`,label:`toolbar.alignJustify`}],op=`__doc-font`,sp=1,cp=999;function lp({id:e,label:t,min:n,max:r,step:i,value:a,format:o,onChange:s}){return(0,Q.jsxs)(`label`,{className:`slider-row`,children:[(0,Q.jsx)(`span`,{className:`slider-label`,children:t}),(0,Q.jsx)(`input`,{id:e,type:`range`,min:n,max:r,step:i,value:a,onChange:e=>s(Number(e.target.value))}),(0,Q.jsx)(`output`,{children:o(a)})]})}function up({controller:e,actions:t,onOpenBlock:n,crop:r}){let i=tf(),a=ip(e),o=Qf(a),s=a.docState===`ready`&&o.length>0,c=tp(e,o,a.sourceVersion),l=s&&(a.editingTextId!==null||c.some(e=>e===`text`||e===`box`)),u=a.docState===`ready`&&a.selection.length===1&&a.selection[0]!==void 0&&jf(e,a.selection[0])?a.selection[0]:null,d=ep(e,a,Ff),f=Lf(d,a.editingTextId?a.textState?.active:null),p=Bf(d),m=Rf(d[`text-align`]),h=md(d.color)??`#000000`,g=$f(e,a.sourceVersion),_=a.editingTextId!==null&&a.textState?.range===!0,[y,b]=(0,v.useState)(null),x=()=>b(null),S=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(null),ee=o.join(`,`);(0,v.useEffect)(()=>b(null),[ee]);let[E,D]=(0,v.useState)(null),[O,te]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let t=!0;return e.fontPalette().then(e=>t&&D(e.roles),()=>t&&te(!0)),()=>{t=!1}},[e]);let k=(0,v.useMemo)(()=>E?dc(E):[],[E]),A=Wf(d[`font-family`]),ne=E?.some(e=>e.family===A)??!1,re=!s||A===``?``:ne?A:op,ie=(t,n,r)=>{let i=o.map(e=>({kind:`setStyle`,id:e,props:t}));e.applyBatch(i,n,r?{coalesceKey:`${r}:${ee}`}:void 0)},j=(t,n)=>{_&&n===`live`||(e.format({command:`color`,value:t}),n===`commit`&&x())},M=t=>{Number.isFinite(t)&&e.format({command:`fontSize`,value:`${Math.max(sp,Math.min(cp,Math.round(t)))}px`})},ae=t=>{let n=a.editingTextId;ie({"text-align":t},`align`),n&&e.beginTextEdit(n,`end`)},[oe,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(null),I=P??(p>0?String(Math.round(p*10)/10):``),L=(e,t,n,r)=>(0,Q.jsx)(`button`,{ref:r.ref,type:`button`,id:e,className:`tb-btn small fmt${r.on?` on`:``}`,title:t,"aria-label":t,"aria-pressed":r.on===void 0?void 0:r.on,disabled:r.disabled??!s,onClick:r.onClick,children:n}),R=t=>()=>e.format({command:t});return(0,Q.jsxs)(`div`,{className:`fmt-row`,"data-has-target":s?`1`:`0`,children:[(0,Q.jsxs)(`select`,{id:`tb-font`,className:`fmt-font`,title:i(`toolbar.font`),"aria-label":i(`toolbar.font`),disabled:!l||!E||oe,value:re,onChange:t=>{let n=E?.find(e=>e.family===t.target.value);n&&(N(!0),e.applyFont(n.id,o).then(()=>cd(n.family)).finally(()=>N(!1)))},children:[!E&&(0,Q.jsx)(`option`,{value:``,children:i(O?`toolbar.fontsFailed`:`toolbar.fontsLoading`)}),E&&re===``&&(0,Q.jsx)(`option`,{value:``,disabled:!0,children:i(`toolbar.font`)}),E&&re===op&&(0,Q.jsx)(`option`,{value:op,disabled:!0,children:i(`toolbar.fontMissing`,{name:A})}),k.map(e=>(0,Q.jsx)(`optgroup`,{label:e.label,children:e.options.map(e=>(0,Q.jsx)(`option`,{value:e.value,title:e.title,"data-font-id":e.fontId,children:e.label},e.fontId))},e.label))]}),(0,Q.jsxs)(`span`,{className:`fmt-size`,children:[L(`tb-size-dec`,i(`toolbar.sizeDown`),`−`,{disabled:!l,onClick:()=>M((p||16)-1)}),(0,Q.jsx)(`input`,{id:`tb-size`,type:`number`,min:sp,max:cp,step:1,inputMode:`numeric`,title:i(`toolbar.size`),"aria-label":i(`toolbar.size`),disabled:!l,value:I,onChange:e=>F(e.target.value),onBlur:()=>F(null),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),M(Number(P??I)),F(null))}}),L(`tb-size-inc`,i(`toolbar.sizeUp`),`+`,{disabled:!l,onClick:()=>M((p||16)+1)})]}),(0,Q.jsx)(`span`,{className:`tb-sep`}),L(`tb-bold`,i(`toolbar.bold`),(0,Q.jsx)(`b`,{children:`B`}),{on:f.bold,disabled:!l,onClick:R(`bold`)}),L(`tb-italic`,i(`toolbar.italic`),(0,Q.jsx)(`i`,{children:`I`}),{on:f.italic,disabled:!l,onClick:R(`italic`)}),L(`tb-underline`,i(`toolbar.underline`),(0,Q.jsx)(`u`,{children:`U`}),{on:f.underline,disabled:!l,onClick:R(`underline`)}),L(`tb-strike`,i(`toolbar.strike`),(0,Q.jsx)(`s`,{children:`S`}),{on:f.strike,disabled:!l,onClick:R(`strike`)}),L(`tb-color`,i(`toolbar.color`),(0,Q.jsxs)(`span`,{className:`color-glyph`,children:[`A`,(0,Q.jsx)(`i`,{style:{background:h}})]}),{ref:S,disabled:!l,on:y===`color`,onClick:()=>b(y===`color`?null:`color`)}),(0,Q.jsx)(rp,{open:y===`color`,anchor:S,onClose:x,id:`pop-color`,className:`pop-colors`,children:(0,Q.jsx)(Zf,{docColors:g,current:h,onPick:j})}),(0,Q.jsx)(`span`,{className:`tb-sep`}),ap.map(e=>(0,Q.jsx)(v.Fragment,{children:L(`tb-align-${e.id}`,i(e.label),(0,Q.jsx)($,{name:e.icon}),{on:l&&m===e.id,disabled:!l,onClick:()=>ae(e.id)})},e.id)),L(`tb-spacing`,i(`toolbar.spacing`),(0,Q.jsx)($,{name:`spacing`}),{ref:C,disabled:!l,on:y===`spacing`,onClick:()=>b(y===`spacing`?null:`spacing`)}),(0,Q.jsxs)(rp,{open:y===`spacing`,anchor:C,onClose:x,id:`pop-spacing`,children:[(0,Q.jsx)(lp,{id:`tb-line-height`,label:i(`toolbar.lineHeight`),min:.8,max:3,step:.05,value:Vf(d),format:e=>e.toFixed(2),onChange:e=>ie({"line-height":String(Math.round(e*100)/100)},`line-height`,`lh`)}),(0,Q.jsx)(lp,{id:`tb-letter-spacing`,label:i(`toolbar.letterSpacing`),min:-.1,max:.5,step:.005,value:Hf(d),format:e=>`${Math.round(e*1e3)}‰`,onChange:e=>ie({"letter-spacing":`${Math.round(e*1e3)/1e3}em`},`letter-spacing`,`ls`)})]}),L(`tb-uppercase`,i(`toolbar.uppercase`),(0,Q.jsx)(`span`,{className:`aa`,children:`aA`}),{on:f.uppercase,disabled:!l,onClick:R(`uppercase`)}),L(`tb-opacity`,i(`toolbar.opacity`),(0,Q.jsx)($,{name:`opacity`}),{ref:w,on:y===`opacity`,onClick:()=>b(y===`opacity`?null:`opacity`)}),(0,Q.jsx)(rp,{open:y===`opacity`,anchor:w,onClose:x,id:`pop-opacity`,children:(0,Q.jsx)(lp,{id:`tb-opacity-range`,label:i(`toolbar.opacity`),min:0,max:100,step:1,value:Math.round(Uf(d)*100),format:e=>`${e}%`,onChange:e=>ie({opacity:e>=100?null:String(e/100)},`opacity`,`opacity`)})}),L(`tb-clear`,i(`toolbar.clear`),(0,Q.jsx)($,{name:`eraser`}),{disabled:!l,onClick:R(`clear`)}),(0,Q.jsx)(`span`,{className:`tb-sep`}),L(`tb-copy-style`,i(`toolbar.copyStyle`),(0,Q.jsx)($,{name:`brush`}),{disabled:!l,onClick:t.copyStyle}),L(`tb-paste-style`,i(`toolbar.pasteStyle`),(0,Q.jsx)($,{name:`paste`}),{disabled:!l,onClick:t.pasteStyle}),u!==null&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`tb-sep`}),(0,Q.jsxs)(`button`,{ref:T,type:`button`,id:`tb-replace`,className:`tb-btn small fmt wide${y===`image`?` on`:``}`,title:i(`toolbar.replaceImage`),onClick:()=>b(y===`image`?null:`image`),children:[(0,Q.jsx)($,{name:`replace`}),` `,(0,Q.jsx)(`span`,{className:`fmt-text`,children:i(`toolbar.replaceImage`)})]}),(0,Q.jsx)(rp,{open:y===`image`,anchor:T,onClose:x,id:`pop-image`,className:`pop-image`,children:(0,Q.jsx)(Nf,{controller:e,id:u,onDone:x})}),(0,Q.jsxs)(`button`,{type:`button`,id:`tb-crop`,className:`tb-btn small fmt wide${r.id===u?` on`:``}`,title:i(`toolbar.crop`),onClick:()=>r.setId(r.id===u?null:u),children:[(0,Q.jsx)($,{name:`crop`}),` `,(0,Q.jsx)(`span`,{className:`fmt-text`,children:i(`toolbar.crop`)})]})]}),(0,Q.jsx)(`span`,{className:`fmt-spacer`}),(0,Q.jsxs)(`button`,{type:`button`,id:`tb-block`,className:`tb-btn small fmt wide`,disabled:!s,title:i(`toolbar.block`),onClick:n,children:[(0,Q.jsx)($,{name:`block`}),` `,(0,Q.jsx)(`span`,{className:`fmt-text`,children:i(`toolbar.block`)})]})]})}var dp=112,fp=84,pp=450,mp=`${vo}
44
+ body .slide:not(.ed-cur) { display: none !important; }
45
+ * { pointer-events: none !important; }`;function hp(e,t,n){let[r,i]=(0,v.useState)({}),a=(0,v.useRef)(new Map),o=(0,v.useMemo)(vs,[]),s=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{if(t.docState!==`ready`)return;let r=setTimeout(()=>{let t=e.index(),r=ma(t),c=r[0],l=r[r.length-1];if(!c||!l)return;let u=t.source.slice(0,c.start)+t.source.slice(l.end),d={},f=new Set;for(let e of r){f.add(e.id);let r=t.source.slice(e.start,e.end),i=a.current.get(e.id);(!i||i.shared!==u||i.slice!==r)&&(i={shared:u,slice:r,html:co(t,{frameCSS:mp,baseHref:n,imageOrigins:o,currentPageId:e.id})},a.current.set(e.id,i)),d[e.id]=i.html}for(let e of[...a.current.keys()])f.has(e)||a.current.delete(e);s.current=!0,i(d)},s.current?pp:0);return()=>clearTimeout(r)},[e,t.docState,t.sourceVersion,n,o]),r}function gp(e){let t=e.contentDocument,n=t?.querySelector(`.ed-cur`);if(!t||!n)return;let r=n.getBoundingClientRect();(r.left!==0||r.top!==0)&&t.documentElement.style.setProperty(`translate`,`${-r.left}px ${-r.top}px`)}function _p({page:e,position:t,html:n,active:r,dropBefore:i,dropAfter:a,onOpen:o,onMenu:s,onKey:c,dragProps:l}){let u=tf(),d=Math.min(dp/e.width,fp/e.height),f=u(`pages.page`,{n:t+1});return(0,Q.jsxs)(`div`,{className:`thumb${r?` active`:``}${i?` drop-before`:``}${a?` drop-after`:``}`,role:`button`,tabIndex:0,draggable:!0,title:e.name?`${t+1}. ${e.name}`:f,"aria-label":f,"aria-current":r?`page`:void 0,"data-page-id":e.id,onClick:o,onKeyDown:c,onContextMenu:e=>{e.preventDefault(),s(e.clientX,e.clientY)},...l,children:[(0,Q.jsx)(`div`,{className:`thumb-view`,style:{width:Math.round(e.width*d),height:Math.round(e.height*d)},children:n!==void 0&&(0,Q.jsx)(`iframe`,{className:`thumb-frame`,sandbox:`allow-same-origin`,srcDoc:n,tabIndex:-1,"aria-hidden":`true`,title:f,style:{width:e.width,height:e.height,transform:`scale(${d})`},onLoad:e=>gp(e.currentTarget)})}),(0,Q.jsx)(`span`,{className:`thumb-num`,children:t+1})]})}function vp({controller:e,snap:t,baseHref:n,toast:r}){let i=tf(),a=hp(e,t,n),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null);kd(o!==null,()=>s(null));let{pages:u}=t,d=(0,v.useRef)(null);(0,v.useEffect)(()=>{d.current?.querySelector(`.thumb.active`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[t.currentPageId]);let f=t=>{xd(e,t)&&r(i(`toast.pageDeleted`))},p=e=>u.findIndex(t=>t.id===e),m=t=>n=>{let r=p(t.id),i=n.ctrlKey||n.metaKey,a=!0;n.key===`Delete`||n.key===`Backspace`?f(t.id):i&&n.key.toLowerCase()===`d`?bd(e,t.id):n.altKey&&n.key===`ArrowLeft`?Sd(e,t.id,r-1):n.altKey&&n.key===`ArrowRight`?Sd(e,t.id,r+1):n.key===`Enter`||n.key===` `?e.setCurrentPage(t.id):a=!1,a&&(n.preventDefault(),n.stopPropagation())},h=t=>({onDragStart:e=>{e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id),l({from:t.id,slot:null})},onDragOver:e=>{if(!c)return;e.preventDefault();let n=e.currentTarget.getBoundingClientRect(),r=p(t.id)+ +(e.clientX>n.left+n.width/2);r!==c.slot&&l({from:c.from,slot:r})},onDrop:t=>{t.preventDefault(),c&&c.slot!==null&&Sd(e,c.from,Cd(p(c.from),c.slot)),l(null)},onDragEnd:()=>l(null)}),g=(0,v.useMemo)(()=>o?p(o.id):-1,[o,u]);return(0,Q.jsxs)(`div`,{className:`filmstrip-wrap`,children:[(0,Q.jsx)(`div`,{id:`filmstrip`,className:`filmstrip`,ref:d,role:`list`,"aria-label":i(`pages.label`),children:u.map((n,r)=>(0,Q.jsx)(_p,{page:n,position:r,html:a[n.id],active:n.id===t.currentPageId,dropBefore:c?.slot===r&&c.from!==n.id,dropAfter:c?.slot===u.length&&r===u.length-1,onOpen:()=>e.setCurrentPage(n.id),onMenu:(e,t)=>s({x:e,y:t,id:n.id}),onKey:m(n),dragProps:h(n)},n.id))}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`menu-scrim`,onMouseDown:()=>s(null),onContextMenu:e=>{e.preventDefault(),s(null)}}),(0,Q.jsxs)(`div`,{className:`popover ctx-menu`,role:`menu`,style:{left:Math.min(o.x,window.innerWidth-180),top:Math.max(8,o.y-4-140)},children:[(0,Q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`menu-item`,onClick:()=>{s(null),bd(e,o.id)},children:i(`pages.duplicate`)}),(0,Q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`menu-item`,disabled:g<=0,onClick:()=>{s(null),Sd(e,o.id,g-1)},children:i(`pages.moveLeft`)}),(0,Q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`menu-item`,disabled:g<0||g>=u.length-1,onClick:()=>{s(null),Sd(e,o.id,g+1)},children:i(`pages.moveRight`)}),(0,Q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`menu-item danger`,disabled:u.length<=1,onClick:()=>{s(null),f(o.id)},children:i(`pages.delete`)})]})]})]})}var yp=.5,bp=(e,t)=>[e,e+t/2,e+t];function xp(e,t,n){let r=null;for(let i of e)for(let e of t){let t=Math.abs(e-i);t<=n&&(r===null||t<r.distance)&&(r={adjust:e-i,distance:t})}return r}function Sp(e,t,n,r){let i=[{x:0,y:0,width:n.width,height:n.height},...t],a=i.flatMap(e=>bp(e.x,e.width)),o=i.flatMap(e=>bp(e.y,e.height)),s=xp(bp(e.x,e.width),a,r),c=xp(bp(e.y,e.height),o,r),l=s?.adjust??0,u=c?.adjust??0,d={...e,x:e.x+l,y:e.y+u},f=[],p=(e,t,n,r)=>{let[i,a]=e===`x`?[Math.min(n.y,r.y),Math.max(n.y+n.height,r.y+r.height)]:[Math.min(n.x,r.x),Math.max(n.x+n.width,r.x+r.width)];f.some(n=>n.axis===e&&Math.abs(n.pos-t)<yp&&n.from===i&&n.to===a)||f.push({axis:e,pos:t,from:i,to:a})};if(s)for(let e of i)for(let t of bp(e.x,e.width))bp(d.x,d.width).some(e=>Math.abs(e-t)<yp)&&p(`x`,t,d,e);if(c)for(let e of i)for(let t of bp(e.y,e.height))bp(d.y,d.height).some(e=>Math.abs(e-t)<yp)&&p(`y`,t,d,e);return{dx:l,dy:u,guides:f}}function Cp(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}function wp(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Tp(e,t,n,r){return{x:Math.min(e,n),y:Math.min(t,r),width:Math.abs(n-e),height:Math.abs(r-t)}}var Ep={active:null,guides:[],tip:null,marquee:null},Dp=[...zd,`font-size`,`box-sizing`,`padding-left`,`padding-right`,`padding-top`,`padding-bottom`,`border-left-width`,`border-right-width`,`border-top-width`,`border-bottom-width`],Op=e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)?t:0},kp=class{deps;g=null;view=Ep;constructor(e){this.deps=e}attach(){let e=this.deps.controller.onFrameEvent(e=>this.onFrame(e));return()=>{e(),this.cancel()}}get active(){return this.g!==null}onFrame(e){if(e.type!==`pointer`)return;let t=this.deps.controller;switch(e.action){case`down`:this.down(e);break;case`move`:this.update({x:e.x,y:e.y},e.alt);break;case`up`:this.finish();break;case`dblclick`:this.cancel(),e.id!==null&&Wa(t.index(),e.id)===`text`&&t.beginTextEdit(e.id,{x:e.x,y:e.y});break;case`contextmenu`:e.id!==null&&!t.getSnapshot().selection.includes(e.id)&&t.select([e.id])}}down(e){let t=this.deps.controller;this.g&&this.cancel();let n={x:e.x,y:e.y,scale:1},r=(e.alt||e.meta)&&e.deepId!==null?e.deepId:e.id;if(r===null){let r=e.shift?[...t.getSnapshot().selection]:[];this.g={kind:`marquee`,origin:n,base:r,additive:e.shift,box:null};return}if(e.shift){t.select([r],{additive:!0});return}let i=t.getSnapshot().selection,a=i.includes(r);a||t.select([r]),this.g={kind:`press`,origin:n,items:[...t.getSnapshot().selection],collapseTo:a&&i.length>1?r:null}}startPillMove(e,t){let n=[...this.deps.controller.getSnapshot().selection];n.length!==0&&(this.g={kind:`press`,origin:{x:e,y:t,scale:1/this.deps.getZoom()},items:n,collapseTo:null})}startResize(e,t,n){let r=this.deps.controller,i=r.getSnapshot().selection[0];if(i===void 0||r.getSnapshot().selection.length!==1)return;let a=this.rectOf(i);if(!a)return;let o=r.styles(i,Dp),s=o[`box-sizing`]===`border-box`;this.g={kind:`resize`,origin:{x:t,y:n,scale:1/this.deps.getZoom()},id:i,handle:e,start:a,place:Bd(o),fontSize:Op(o[`font-size`])||16,extra:s?{width:0,height:0}:{width:Op(o[`padding-left`])+Op(o[`padding-right`])+Op(o[`border-left-width`])+Op(o[`border-right-width`]),height:Op(o[`padding-top`])+Op(o[`padding-bottom`])+Op(o[`border-top-width`])+Op(o[`border-bottom-width`])},dx:0,dy:0,changed:!1}}overlayMove(e,t,n){this.update({x:e,y:t},n)}overlayUp(){this.finish()}rectOf(e){let t=this.deps.controller,n=t.getSnapshot().rects[e];return n||=(t.measure([e]),t.getSnapshot().rects[e]),n?{x:n.x,y:n.y,width:n.width,height:n.height}:null}setView(e){this.view=e,this.deps.onView(e)}update(e,t){let n=this.g;if(!n)return;let r=(e.x-n.origin.x)*n.origin.scale,i=(e.y-n.origin.y)*n.origin.scale,a=this.deps.getZoom(),o=Math.hypot(r,i)*a>=3;switch(n.kind){case`press`:o&&this.beginMove(n)&&this.update(e,t);break;case`move`:this.updateMove(n,r,i,t,a);break;case`resize`:this.updateResize(n,r,i);break;case`marquee`:(n.box!==null||o)&&(n.box=Tp(n.origin.x,n.origin.y,e.x,e.y),this.setView({active:`marquee`,guides:[],tip:null,marquee:n.box}))}}beginMove(e){let t=this.deps.controller,n=t.index(),r=jd(n,e.items),i=r.map(e=>this.rectOf(e));if(r.length===0||i.some(e=>e===null))return!1;let a=Cp(i);if(!a)return!1;let o=new Set(r),s=[];for(let[e,i]of Object.entries(t.getSnapshot().rects))o.has(e)||r.some(t=>Ad(n,e,t))||s.push({x:i.x,y:i.y,width:i.width,height:i.height});return this.g={kind:`move`,origin:e.origin,items:r.map(e=>({id:e,place:Bd(t.styles(e,zd))})),start:a,others:s,dx:0,dy:0},!0}moveUpdates(e){return e.items.map(t=>({kind:`style`,id:t.id,props:Ud(t.place,e.dx,e.dy)}))}updateMove(e,t,n,r,i){let a=this.deps.controller,o=t,s=n,c=[];if(!r){let t=Sp({...e.start,x:e.start.x+o,y:e.start.y+s},e.others,a.pageSize(),6/i);o+=t.dx,s+=t.dy,c=t.guides}e.dx=Math.round(o),e.dy=Math.round(s),a.livePreview(this.moveUpdates(e)),a.measure(e.items.map(e=>e.id));let l=Math.round(e.start.x+e.dx),u=Math.round(e.start.y+e.dy);this.setView({active:`move`,guides:c,tip:{x:l,y:u+e.start.height,text:`${Math.round(e.start.width)} × ${Math.round(e.start.height)} · ${e.dx>=0?`+`:``}${e.dx}, ${e.dy>=0?`+`:``}${e.dy}`},marquee:null})}resizeProps(e,t,n){let r=Wa(this.deps.controller.index(),e.id),i=Kd({handle:e.handle,kind:r,start:e.start,dx:t,dy:n,fontSize:e.fontSize,extra:e.extra}),a={...i.props};return(i.shift.x!==0||i.shift.y!==0)&&Object.assign(a,Ud(e.place,i.shift.x,i.shift.y)),{props:a,width:i.width,height:i.height}}updateResize(e,t,n){let r=this.deps.controller;e.changed=!0,e.dx=t,e.dy=n;let{props:i}=this.resizeProps(e,t,n);r.livePreview([{kind:`style`,id:e.id,props:i}]),r.measure([e.id]);let a=r.getSnapshot().rects[e.id]??e.start;this.setView({active:`resize`,guides:[],tip:{x:a.x,y:a.y+a.height,text:`${Math.max(8,Math.round(a.width))} × ${Math.round(a.height)}`},marquee:null})}finish(){let e=this.g;if(!e)return;this.g=null;let t=this.deps.controller;switch(this.setView(Ep),e.kind){case`press`:e.collapseTo!==null&&t.select([e.collapseTo]);break;case`move`:{let n=e.dx===0&&e.dy===0?[]:e.items.map(t=>({kind:`setStyle`,id:t.id,props:Ud(t.place,e.dx,e.dy)}));n.length===0?t.cancelLivePreview(e.items.map(e=>e.id)):t.applyBatch(n,`move`);break}case`resize`:if(!e.changed)break;t.applyBatch([{kind:`setStyle`,id:e.id,props:this.resizeProps(e,e.dx,e.dy).props}],`resize`);break;case`marquee`:this.finishMarquee(e)}}finishMarquee(e){let t=this.deps.controller;if(e.box===null){e.additive||t.select([]);return}let n=e.box,r=t.index(),i=Object.entries(t.getSnapshot().rects).filter(([,e])=>wp(n,e)).map(([e])=>e),a=i.filter(e=>!i.some(t=>t!==e&&Ad(r,t,e)));t.select(e.additive?[...new Set([...e.base,...a])]:a)}cancel(){let e=this.g;return e?(this.g=null,e.kind===`move`?this.deps.controller.cancelLivePreview(e.items.map(e=>e.id)):e.kind===`resize`&&this.deps.controller.cancelLivePreview([e.id]),this.view!==Ep&&this.setView(Ep),!0):!1}},Ap={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]};function jp(e,t){let n=e.ctrl||e.meta,r=e.key.length===1?e.key.toLowerCase():e.key;if(n)return r===`s`?{type:`save`}:e.alt?r===`c`?{type:`copyStyle`}:r===`v`?{type:`pasteStyle`}:null:t.editing?Mp(r):r===`z`?e.shift?{type:`redo`}:{type:`undo`}:r===`y`?{type:`redo`}:r===`d`?t.selectionCount>0?{type:`duplicate`}:null:Mp(r);if(r===`Escape`)return{type:`escape`};if(t.editing)return null;if(t.selectionCount>0){if(t.selectionCount===1&&!e.alt&&(r===`+`||r===`=`||r===`-`||r===`_`))return{type:`scaleSelection`,direction:r===`+`||r===`=`?1:-1};if(r===`Delete`||r===`Backspace`)return{type:`delete`};if(r===`Enter`)return t.selectionCount===1?{type:`edit`}:null;let n=Ap[r];if(n){if(e.alt)return n[0]===0?{type:`reorder`,direction:n[1]<0?`up`:`down`}:null;let t=e.shift?10:1;return{type:`nudge`,dx:n[0]*t,dy:n[1]*t}}return null}return!e.alt&&(r===`+`||r===`=`||r===`-`||r===`_`)?Mp(r):r===`ArrowLeft`||r===`PageUp`?{type:`page`,direction:`prev`}:r===`ArrowRight`||r===`PageDown`?{type:`page`,direction:`next`}:null}function Mp(e){return e===`=`||e===`+`?{type:`zoom`,mode:`in`}:e===`-`||e===`_`?{type:`zoom`,mode:`out`}:e===`0`?{type:`zoom`,mode:`fit`}:null}function Np(e){let t=e;if(!t||typeof t.closest!=`function`)return!1;if(t.isContentEditable)return!0;let n=t.tagName;if(n===`TEXTAREA`||n===`SELECT`||t.closest(`.CodeMirror`))return!0;if(n===`INPUT`){let e=t.type;return e!==`button`&&e!==`checkbox`}return!1}function Pp({controller:e}){let t=tf(),n=(0,v.useRef)(null);return(0,v.useEffect)(()=>n.current?.focus(),[]),(0,Q.jsx)(`div`,{id:`modal-conflict`,className:`modal-backdrop`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`conflict-title`,children:(0,Q.jsxs)(`div`,{className:`modal`,children:[(0,Q.jsx)(`h2`,{id:`conflict-title`,children:t(`conflict.title`)}),(0,Q.jsx)(`p`,{children:t(`conflict.body`)}),(0,Q.jsxs)(`div`,{className:`modal-actions`,children:[(0,Q.jsx)(`button`,{type:`button`,id:`conflict-reload`,className:`btn`,ref:n,onClick:()=>void e.reload(),children:t(`conflict.reload`)}),(0,Q.jsx)(`button`,{type:`button`,id:`conflict-overwrite`,className:`btn primary`,onClick:()=>void e.save({force:!0}),children:t(`conflict.overwrite`)})]})]})})}var Fp={items:[],more:!1};function Ip({controller:e}){let t=tf(),n=kf(),r=ip(e),i=!!id(),a=!!xs(),[o,s]=(0,v.useState)(`current`),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(Fp),[f,p]=(0,v.useState)(Fp),[m,h]=(0,v.useState)(1),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(0),T=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!i&&!a)return;let e=!0;return _(!0),S(!1),(a?fetch(`/api/project-assets?tab=${o}&page=${m}`,{cache:`no-store`}).then(async e=>{if(!e.ok)throw Error(`Project assets unavailable`);return await e.json()}):ad(`assets`,{tab:o,page:o===`history`?m:1})).then(t=>{e&&(o===`current`?d(t):p(e=>({items:m===1?t.items:[...e.items,...t.items],more:t.more})))}).catch(()=>{e&&S(!0)}).finally(()=>{e&&_(!1)}),()=>{e=!1}},[i,a,o,m,C]);let ee=_f(e.index()).map(({src:e},t)=>({src:e,name:`Image ${t+1}`})),E=o===`history`?f.items:[...new Map([...ee,...u.items].map(e=>[e.src,e])).values()],D=(t,n=e.getSnapshot().currentPageId)=>{let r=e.getSnapshot().pages.find(e=>e.id===n);if(!r)return;let i=document.createElement(`img`);i.setAttribute(`src`,a&&t.src.startsWith(`/assets/`)?`..`+t.src:t.src),i.alt=t.name;let o=Math.round(r.width*.46);i.style.cssText=`position:absolute;z-index:90;left:${Math.round(r.width*.1)}px;top:${Math.round(r.height*.12)}px;width:${o}px;height:auto;max-height:${Math.round(r.height*.7)}px;object-fit:contain`,e.apply({kind:`insertHTML`,parentId:r.id,beforeId:null,html:i.outerHTML},{label:`add image`})};return(0,Q.jsxs)(`div`,{className:`image-panel`,"data-panel-body":`images`,children:[(0,Q.jsxs)(`div`,{className:`panel-body`,children:[(0,Q.jsxs)(`div`,{className:`asset-tabs`,role:`tablist`,"aria-label":t(`panel.images`),children:[[`current`,`history`].map(e=>(0,Q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":o===e,disabled:e===`history`&&!i&&!a,onClick:()=>{e!==o&&l(null),e===`history`&&h(1),s(e)},children:t(a&&e===`history`?`assets.projectHistory`:`assets.${e}`)},e)),(0,Q.jsxs)(`button`,{type:`button`,className:`btn`,disabled:y||r.docState!==`ready`,onClick:()=>T.current?.click(),children:[(0,Q.jsx)($,{name:`upload`,size:13}),t(`assets.upload`)]}),(0,Q.jsx)(`input`,{ref:T,type:`file`,accept:`image/*`,hidden:!0,onChange:t=>{let r=t.currentTarget.files?.[0];if(t.currentTarget.value=``,!r)return;let o=e.getSnapshot().currentPageId;b(!0),(i?ad(`upload-asset`,r,18e4):a&&e.uploadImage?e.uploadImage(r):xf(r).then(e=>({src:e,name:r.name}))).then(e=>{D(e,o),h(1),w(e=>e+1)}).catch(n).finally(()=>b(!1))}})]}),g&&(0,Q.jsx)(`p`,{role:`status`,className:`p-hint`,children:t(`status.loading`)}),x&&(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>w(e=>e+1),children:t(`assets.failed`)}),!g&&!x&&E.length===0&&(0,Q.jsx)(`p`,{className:`p-hint`,children:t(`assets.empty`)}),(0,Q.jsx)(`div`,{className:`asset-grid`,children:E.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:e.name,"aria-pressed":c?.src===e.src,onClick:()=>l(t=>t?.src===e.src?null:e),children:(0,Q.jsx)(`img`,{src:e.src,alt:e.name,loading:`lazy`})},e.src))}),o===`history`&&f.more&&(0,Q.jsx)(`button`,{type:`button`,className:`btn`,disabled:g,onClick:()=>h(e=>e+1),children:t(`assets.more`)})]}),c&&(0,Q.jsx)(`footer`,{className:`asset-confirm`,children:(0,Q.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:r.docState!==`ready`||!r.currentPageId,onClick:()=>{D(c),l(null)},children:t(`assets.confirm`)})})]})}var Lp=[{id:`none`,px:0},{id:`subtle`,px:8},{id:`medium`,px:16},{id:`large`,px:32},{id:`full`,px:9999}],Rp=[{id:`none`,px:0},{id:`narrow`,px:12},{id:`medium`,px:24},{id:`wide`,px:48}],zp=[{id:`none`,px:0},{id:`small`,px:12},{id:`medium`,px:24},{id:`large`,px:48}],Bp=[{id:`none`,css:`none`},{id:`soft`,css:`0 4px 14px rgba(0,0,0,0.12)`},{id:`medium`,css:`0 8px 24px rgba(0,0,0,0.22)`},{id:`strong`,css:`0 14px 40px rgba(0,0,0,0.38)`}],Vp=[`none`,`solid`,`dashed`,`dotted`],Hp=[{id:`thin`,px:1},{id:`medium`,px:3},{id:`thick`,px:6}],Up=[`top`,`right`,`bottom`,`left`],Wp=[`top-left`,`top-right`,`bottom-right`,`bottom-left`];function Gp(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)?t:0}function Kp(e,t){return{...Object.fromEntries(Up.map(t=>[`${e}-${t}`,null])),[e]:`${Math.round(t)}px`}}function qp(e){return{...Object.fromEntries(Wp.map(e=>[`border-${e}-radius`,null])),"border-radius":`${Math.round(e)}px`}}function Jp(e,t){return e===`none`?{"border-style":`none`}:{"border-style":e,"border-width":`${Math.max(1,Math.round(t))}px`}}function Yp(e){return{"box-shadow":e}}function Xp(e){let t=(e??``).replace(/\s+/g,``).toLowerCase();return t===``?null:Bp.find(e=>e.css.replace(/\s+/g,``).toLowerCase()===t)?.id??null}function Zp(e){return Vp.includes(e??``)?e:`none`}var Qp=[`background-color`,`border-top-left-radius`,`padding-top`,`margin-top`,`border-top-style`,`border-top-width`,`border-top-color`,`opacity`,`box-shadow`];function $p({items:e,active:t,label:n,onPick:r,prefix:i}){return(0,Q.jsx)(`div`,{className:`chips`,"data-presets":i,children:e.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`chip${t===e.id?` on`:``}`,"data-preset":e.id,onClick:()=>r(e),children:n(e.id)},e.id))})}function em({id:e,value:t,max:n,onChange:r}){return(0,Q.jsxs)(`label`,{className:`slider-row bare`,children:[(0,Q.jsx)(`input`,{id:e,type:`range`,min:0,max:n,step:1,value:Math.min(n,Math.round(t)),onChange:e=>r(Number(e.target.value))}),(0,Q.jsx)(`output`,{children:Math.round(t)>n?`∞`:Math.round(t)})]})}function tm({controller:e}){let t=tf(),n=ip(e),r=Qf(n),i=ep(e,n,Qp),a=$f(e,n.sourceVersion),o=r.join(`,`);if(r.length===0||n.docState!==`ready`)return(0,Q.jsx)(`div`,{className:`panel-body`,"data-panel-body":`block`,children:(0,Q.jsx)(`p`,{className:`p-hint`,children:t(`panel.selectHint`)})});let s=r[0],c=e.index().elements.get(s),l=r.length===1,u=l&&jf(e,s),d=(t,n,i)=>{let a=r.map(e=>({kind:`setStyle`,id:e,props:t}));e.applyBatch(a,n,i?{coalesceKey:`${i}:${o}`}:void 0)},f=(e,t)=>t.find(t=>t.px===Math.round(e))?.id??null,p=e=>n=>t(`${e}.${n}`),m=md(i[`background-color`]),h=(e,t)=>d({"background-color":e},`background`,t===`live`?`bg`:void 0),g=(e,t)=>d({"border-color":e},`border color`,t===`live`?`bc`:void 0),_=Gp(i[`border-top-left-radius`]),v=Gp(i[`padding-top`]),y=Gp(i[`margin-top`]),b=Zp(i[`border-top-style`]),x=Gp(i[`border-top-width`]),S=c?ra(Pi(c,`style`)??``,`box-shadow`):null,C=l?Xp(S)??(S===null&&i[`box-shadow`]===`none`?`none`:null):null,w=(e,n,r)=>(0,Q.jsxs)(`section`,{className:`p-section`,"data-section":r,children:[(0,Q.jsx)(`h3`,{children:t(e)}),n]});return(0,Q.jsxs)(`div`,{className:`panel-body`,"data-panel-body":`block`,children:[r.length>1&&(0,Q.jsx)(`p`,{className:`p-hint`,children:t(`pill.selected`,{n:r.length})}),w(`block.background`,(0,Q.jsx)(Zf,{docColors:a,current:m,allowNone:!0,onPick:h}),`background`),w(`block.radius`,(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($p,{items:Lp,active:f(_,Lp),label:p(`block.radius`),prefix:`radius`,onPick:e=>d(qp(e.px),`radius`)}),(0,Q.jsx)(em,{id:`block-radius`,value:_,max:120,onChange:e=>d(qp(e),`radius`,`radius`)})]}),`radius`),w(`block.padding`,(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($p,{items:Rp,active:f(v,Rp),label:p(`block.padding`),prefix:`padding`,onPick:e=>d(Kp(`padding`,e.px),`padding`)}),(0,Q.jsx)(em,{id:`block-padding`,value:v,max:120,onChange:e=>d(Kp(`padding`,e),`padding`,`padding`)})]}),`padding`),w(`block.margin`,(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($p,{items:zp,active:f(y,zp),label:p(`block.margin`),prefix:`margin`,onPick:e=>d(Kp(`margin`,e.px),`margin`)}),(0,Q.jsx)(em,{id:`block-margin`,value:y,max:120,onChange:e=>d(Kp(`margin`,e),`margin`,`margin`)})]}),`margin`),w(`block.border`,(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`chips`,"data-presets":`border-style`,children:Vp.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`chip${b===e?` on`:``}`,"data-preset":e,onClick:()=>d(Jp(e,x||2),`border`),children:t(`block.border.${e}`)},e))}),(0,Q.jsx)(`div`,{className:`chips`,"data-presets":`border-width`,children:Hp.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`chip${b!==`none`&&Math.round(x)===e.px?` on`:``}`,"data-preset":e.id,onClick:()=>d(Jp(b===`none`?`solid`:b,e.px),`border`),children:t(`block.borderWidth.${e.id}`)},e.id))}),(0,Q.jsx)(Zf,{docColors:a,current:md(i[`border-top-color`]),onPick:g})]}),`border`),w(`block.shadow`,(0,Q.jsx)($p,{items:Bp,active:C,label:p(`block.shadow`),prefix:`shadow`,onPick:e=>d(Yp(e.css),`shadow`)}),`shadow`),w(`block.opacity`,(0,Q.jsx)(em,{id:`block-opacity`,value:Uf(i)*100,max:100,onChange:e=>d({opacity:e>=100?null:String(e/100)},`opacity`,`opacity`)}),`opacity`),u&&w(`block.size`,(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`p-hint`,children:t(`block.sizeHint`)}),(0,Q.jsx)(`button`,{type:`button`,id:`block-reset-size`,className:`btn wide`,onClick:()=>d({width:null,height:null},`reset size`),children:t(`block.resetSize`)})]}),`size`)]})}var nm=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.CodeMirror=r())})(e,(function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),c=!a&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),_=/Android/.test(e),v=g||_||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),S=f&&e.match(/Version\/(\d*\.\d*)/);S&&=Number(S[1]),S&&S>=15&&(f=!1,c=!0);var C=y&&(l||f&&(S==null||S<12.11)),w=n||o&&s>=9;function T(e){return RegExp(`(^|\\s)`+e+`(?:$|\\s)\\s*`)}var ee=function(e,t){var n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:``)}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function D(e,t){return E(e).appendChild(t)}function O(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t==`string`)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function te(e,t,n,r){var i=O(e,t,n,r);return i.setAttribute(`role`,`presentation`),i}var k=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd(`character`,n),r.moveStart(`character`,t),r};function A(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ne(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function re(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?` `:``)+t)}function ie(e,t){for(var n=e.split(` `),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=` `+n[r]);return t}var j=function(e){e.select()};g?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(j=function(e){try{e.select()}catch{}});function M(e){return e.display.wrapper.ownerDocument}function ae(e){return oe(e.display.wrapper)}function oe(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function N(e){return M(e).defaultView}function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function F(e,t,n){for(var r in t||={},e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function I(e,t,n,r,i){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var s=e.indexOf(` `,a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}var L=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};L.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},L.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function R(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var se=50,z={toString:function(){return`CodeMirror.Pass`}},ce={scroll:!1},le={origin:`*mouse`},B={origin:`+move`};function V(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(` `,r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var ue=[``];function de(e){for(;ue.length<=e;)ue.push(H(ue)+` `);return ue[e]}function H(e){return e[e.length-1]}function fe(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function pe(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function me(){}function he(e,t){var n;return Object.create?n=Object.create(e):(me.prototype=e,n=new me),t&&F(t,n),n}var U=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ge(e){return/\w/.test(e)||e>`€`&&(e.toUpperCase()!=e.toLowerCase()||U.test(e))}function _e(e,t){return t?t.source.indexOf(`\\w`)>-1&&ge(e)?!0:t.test(e):ge(e)}function ve(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ye=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function W(e){return e.charCodeAt(0)>=768&&ye.test(e)}function be(e,t,n){for(;(n<0?t>0:t<e.length)&&W(e.charAt(t));)t+=n;return t}function xe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function Se(e,t,n,r){if(!e)return r(t,n,`ltr`,0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?`rtl`:`ltr`,a),i=!0)}i||r(t,n,`ltr`)}var Ce=null;function we(e,t,n){var r;Ce=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n==`before`?r=i:Ce=i),a.from==t&&(a.from!=a.to&&n!=`before`?r=i:Ce=i)}return r??Ce}var Te=(function(){function e(e){return e<=247?`bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN`.charAt(e):1424<=e&&e<=1524?`R`:1536<=e&&e<=1785?`nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111`.charAt(e-1536):1774<=e&&e<=2220?`r`:8192<=e&&e<=8203?`w`:e==8204?`b`:`L`}var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,r=/[LRr]/,i=/[Lb1n]/,a=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,c){var l=c==`ltr`?`L`:`R`;if(s.length==0||c==`ltr`&&!t.test(s))return!1;for(var u=s.length,d=[],f=0;f<u;++f)d.push(e(s.charCodeAt(f)));for(var p=0,m=l;p<u;++p){var h=d[p];h==`m`?d[p]=m:m=h}for(var g=0,_=l;g<u;++g){var v=d[g];v==`1`&&_==`r`?d[g]=`n`:r.test(v)&&(_=v,v==`r`&&(d[g]=`R`))}for(var y=1,b=d[0];y<u-1;++y){var x=d[y];x==`+`&&b==`1`&&d[y+1]==`1`?d[y]=`1`:x==`,`&&b==d[y+1]&&(b==`1`||b==`n`)&&(d[y]=b),b=x}for(var S=0;S<u;++S){var C=d[S];if(C==`,`)d[S]=`N`;else if(C==`%`){var w=void 0;for(w=S+1;w<u&&d[w]==`%`;++w);for(var T=S&&d[S-1]==`!`||w<u&&d[w]==`1`?`1`:`N`,ee=S;ee<w;++ee)d[ee]=T;S=w-1}}for(var E=0,D=l;E<u;++E){var O=d[E];D==`L`&&O==`1`?d[E]=`L`:r.test(O)&&(D=O)}for(var te=0;te<u;++te)if(n.test(d[te])){var k=void 0;for(k=te+1;k<u&&n.test(d[k]);++k);for(var A=(te?d[te-1]:l)==`L`,ne=A==((k<u?d[k]:l)==`L`)?A?`L`:`R`:l,re=te;re<k;++re)d[re]=ne;te=k-1}for(var ie=[],j,M=0;M<u;)if(i.test(d[M])){var ae=M;for(++M;M<u&&i.test(d[M]);++M);ie.push(new o(0,ae,M))}else{var oe=M,N=ie.length,P=+(c==`rtl`);for(++M;M<u&&d[M]!=`L`;++M);for(var F=oe;F<M;)if(a.test(d[F])){oe<F&&(ie.splice(N,0,new o(1,oe,F)),N+=P);var I=F;for(++F;F<M&&a.test(d[F]);++F);ie.splice(N,0,new o(2,I,F)),N+=P,oe=F}else++F;oe<M&&ie.splice(N,0,new o(1,oe,M))}return c==`ltr`&&(ie[0].level==1&&(j=s.match(/^\s+/))&&(ie[0].from=j[0].length,ie.unshift(new o(0,0,j[0].length))),H(ie).level==1&&(j=s.match(/\s+$/))&&(H(ie).to-=j[0].length,ie.push(new o(0,u-j[0].length,u)))),c==`rtl`?ie.reverse():ie}})();function Ee(e,t){var n=e.order;return n??=e.order=Te(e.text,t),n}var De=[],G=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent(`on`+t,n);else{var r=e._handlers||={};r[t]=(r[t]||De).concat(n)}};function Oe(e,t){return e._handlers&&e._handlers[t]||De}function ke(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent(`on`+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=R(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Ae(e,t){var n=Oe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function je(e,t,n){return typeof t==`string`&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ae(e,n||t.type,e,t),Le(t)||t.codemirrorIgnore}function Me(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)R(n,t[r])==-1&&n.push(t[r])}function Ne(e,t){return Oe(e,t).length>0}function Pe(e){e.prototype.on=function(e,t){G(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Fe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return e.defaultPrevented==null?e.returnValue==0:e.defaultPrevented}function Re(e){Fe(e),Ie(e)}function ze(e){return e.target||e.srcElement}function Be(e){var t=e.which;return t??(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),y&&e.ctrlKey&&t==1&&(t=3),t}var Ve=function(){if(o&&s<9)return!1;var e=O(`div`);return`draggable`in e||`dragDrop`in e}(),He;function Ue(e){if(He==null){var t=O(`span`,`​`);D(e,O(`span`,[t,document.createTextNode(`x`)])),e.firstChild.offsetHeight!=0&&(He=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=He?O(`span`,`​`):O(`span`,`\xA0`,null,`display: inline-block; width: 1px; margin-right: -1px`);return n.setAttribute(`cm-text`,``),n}var We;function Ge(e){if(We!=null)return We;var t=D(e,document.createTextNode(`AخA`)),n=k(t,0,1).getBoundingClientRect(),r=k(t,1,2).getBoundingClientRect();return E(e),!n||n.left==n.right?!1:We=r.right-n.right<3}var Ke=`
46
+
47
+ b`.split(/\n/).length==3?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
48
+ `,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)==`\r`?i-1:i),o=a.indexOf(`\r`);o==-1?(n.push(a),t=i+1):(n.push(a.slice(0,o)),t+=o+1)}return n},qe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints(`StartToEnd`,t)!=0},Je=(function(){var e=O(`div`);return`oncopy`in e||(e.setAttribute(`oncopy`,`return;`),typeof e.oncopy==`function`)})(),Ye=null;function Xe(e){if(Ye!=null)return Ye;var t=D(e,O(`span`,`x`)),n=t.getBoundingClientRect(),r=k(t,0,1).getBoundingClientRect();return Ye=Math.abs(n.left-r.left)>1}var Ze={},Qe={};function $e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ze[e]=t}function et(e,t){Qe[e]=t}function tt(e){if(typeof e==`string`&&Qe.hasOwnProperty(e))e=Qe[e];else if(e&&typeof e.name==`string`&&Qe.hasOwnProperty(e.name)){var t=Qe[e.name];typeof t==`string`&&(t={name:t}),e=he(t,e),e.name=t.name}else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return tt(`application/xml`);else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return tt(`application/json`);return typeof e==`string`?{name:e}:e||{name:`null`}}function nt(e,t){t=tt(t);var n=Ze[t.name];if(!n)return nt(e,`text/plain`);var r=n(e,t);if(rt.hasOwnProperty(t.name)){var i=rt[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r[`_`+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var rt={};function it(e,t){F(t,rt.hasOwnProperty(e)?rt[e]:rt[e]={})}function at(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ot(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function st(e,t,n){return!e.startState||e.startState(t,n)}var ct=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};ct.prototype.eol=function(){return this.pos>=this.string.length},ct.prototype.sol=function(){return this.pos==this.lineStart},ct.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ct.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ct.prototype.eat=function(e){var t=this.string.charAt(this.pos);if(typeof e==`string`?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},ct.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ct.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ct.prototype.skipToEnd=function(){this.pos=this.string.length},ct.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ct.prototype.backUp=function(e){this.pos-=e},ct.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=I(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?I(this.string,this.lineStart,this.tabSize):0)},ct.prototype.indentation=function(){return I(this.string,null,this.tabSize)-(this.lineStart?I(this.string,this.lineStart,this.tabSize):0)},ct.prototype.match=function(e,t,n){if(typeof e==`string`){var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}},ct.prototype.current=function(){return this.string.slice(this.start,this.pos)},ct.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ct.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ct.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function K(e,t){if(t-=e.first,t<0||t>=e.size)throw Error(`There is no line `+(t+e.first)+` in the document.`);for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function lt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var a=e.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function ut(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function dt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ft(e){if(e.parent==null)return null;for(var t=e.parent,n=R(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function pt(e,t){var n=e.first;outer:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue outer}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o].height;if(t<s)break;t-=s}return n+o}function mt(e,t){return t>=e.first&&t<e.first+e.size}function ht(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function q(e,t,n){if(n===void 0&&(n=null),!(this instanceof q))return new q(e,t,n);this.line=e,this.ch=t,this.sticky=n}function J(e,t){return e.line-t.line||e.ch-t.ch}function gt(e,t){return e.sticky==t.sticky&&J(e,t)==0}function _t(e){return q(e.line,e.ch)}function vt(e,t){return J(e,t)<0?t:e}function yt(e,t){return J(e,t)<0?e:t}function bt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Y(e,t){if(t.line<e.first)return q(e.first,0);var n=e.first+e.size-1;return t.line>n?q(n,K(e,n).text.length):xt(t,K(e,t.line).text.length)}function xt(e,t){var n=e.ch;return n==null||n>t?q(e.line,t):n<0?q(e.line,0):e}function St(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Y(e,t[r]);return n}var Ct=function(e,t){this.state=e,this.lookAhead=t},wt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};wt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},wt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,``),size:this.baseTokens[this.baseTokenPos]-e}},wt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},wt.fromSaved=function(e,t,n){return t instanceof Ct?new wt(e,at(e.mode,t.state),n,t.lookAhead):new wt(e,at(e.mode,t),n)},wt.prototype.save=function(e){var t=e===!1?this.state:at(this.doc.mode,this.state);return this.maxLookAhead>0?new Ct(t,this.maxLookAhead):t};function Tt(e,t,n,r){var i=[e.state.modeGen],a={};Pt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},a,r);for(var o=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,Pt(e,t.text,s.mode,n,function(e,t){for(var n=c;l<e;){var r=i[c];r>e&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t){if(s.opaque)i.splice(n,c-n,e,`overlay `+t),c=n+2;else for(;n<c;n+=2){var a=i[n+1];i[n+1]=(a?a+` `:``)+`overlay `+t}}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},c=0;c<e.state.overlays.length;++c)s(c);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Et(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Dt(e,ft(t)),i=t.text.length>e.options.maxHighlightLength&&at(e.doc.mode,r.state),a=Tt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&=null,n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Dt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new wt(r,!0,t);var a=Ft(e,t,n),o=a>r.first&&K(r,a-1).stateAfter,s=o?wt.fromSaved(r,o,a):new wt(r,st(r.mode),a);return r.iter(a,t,function(n){Ot(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function Ot(e,t,n,r){var i=e.doc.mode,a=new ct(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==``&&kt(i,n.state);!a.eol();)At(i,a,n.state),a.start=a.pos}function kt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=ot(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function At(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ot(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw Error(`Mode `+e.name+` failed to advance stream.`)}var jt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Mt(e,t,n,r){var i=e.doc,a=i.mode,o;t=Y(i,t);var s=K(i,t.line),c=Dt(e,t.line,n),l=new ct(s.text,e.options.tabSize,c),u;for(r&&(u=[]);(r||l.pos<t.ch)&&!l.eol();)l.start=l.pos,o=At(a,l,c.state),r&&u.push(new jt(l,o,at(i.mode,c.state)));return r?u:new jt(l,o,c.state)}function Nt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?`bgClass`:`textClass`;t[r]==null?t[r]=n[2]:RegExp(`(?:^|\\s)`+n[2]+`(?:$|\\s)`).test(t[r])||(t[r]+=` `+n[2])}return e}function Pt(e,t,n,r,i,a,o){var s=n.flattenSpans;s??=e.options.flattenSpans;var c=0,l=null,u=new ct(t,e.options.tabSize,r),d,f=e.options.addModeClass&&[null];for(t==``&&Nt(kt(n,r.state),a);!u.eol();){if(u.pos>e.options.maxHighlightLength?(s=!1,o&&Ot(e,t,r,u.pos),u.pos=t.length,d=null):d=Nt(At(n,u,r.state,f),a),f){var p=f[0].name;p&&(d=`m-`+(d?p+` `+d:p))}if(!s||l!=d){for(;c<u.start;)c=Math.min(u.start,c+5e3),i(c,l);l=d}u.start=u.pos}for(;c<u.pos;){var m=Math.min(u.pos,c+5e3);i(m,l),c=m}}function Ft(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var c=K(a,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof Ct?l.lookAhead:0)<=a.modeFrontier))return s;var u=I(c.text,null,e.options.tabSize);(i==null||r>u)&&(i=s-1,r=u)}return i}function It(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=K(e,r).stateAfter;if(i&&(!(i instanceof Ct)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Lt=!1,Rt=!1;function zt(){Lt=!0}function Bt(){Rt=!0}function Vt(e,t,n){this.marker=e,this.from=t,this.to=n}function Ht(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ut(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||=[]).push(e[r]);return n}function Wt(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||=new WeakSet);r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Gt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&o.type==`bookmark`&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||=[]).push(new Vt(o,a.from,s?null:a.to))}}return r}function Kt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.to==null||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&o.type==`bookmark`&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||=[]).push(new Vt(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function qt(e,t){if(t.full)return null;var n=mt(e,t.from.line)&&K(e,t.from.line).markedSpans,r=mt(e,t.to.line)&&K(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=J(t.from,t.to)==0,s=Gt(n,i,o),c=Kt(r,a,o),l=t.text.length==1,u=H(t.text).length+(l?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(f.to==null){var p=Ht(c,f.marker);p?l&&(f.to=p.to==null?null:p.to+u):f.to=i}}if(c)for(var m=0;m<c.length;++m){var h=c[m];h.to!=null&&(h.to+=u),h.from==null?Ht(s,h.marker)||(h.from=u,l&&(s||=[]).push(h)):(h.from+=u,l&&(s||=[]).push(h))}s&&=Jt(s),c&&c!=s&&(c=Jt(c));var g=[s];if(!l){var _=t.text.length-2,v;if(_>0&&s)for(var y=0;y<s.length;++y)s[y].to??(v||=[]).push(new Vt(s[y].marker,null,null));for(var b=0;b<_;++b)g.push(v);g.push(c)}return g}function Jt(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Yt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||R(r,n)==-1)&&(r||=[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],s=o.find(0),c=0;c<i.length;++c){var l=i[c];if(!(J(l.to,s.from)<0||J(l.from,s.to)>0)){var u=[c,1],d=J(l.from,s.from),f=J(l.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:l.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}function Xt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Zt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Qt(e){return e.inclusiveLeft?-1:0}function $t(e){return+!!e.inclusiveRight}function en(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=J(r.from,i.from)||Qt(e)-Qt(t);return a?-a:J(r.to,i.to)||$t(e)-$t(t)||t.id-e.id}function tn(e,t){var n=Rt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||en(r,i.marker)<0)&&(r=i.marker);return r}function nn(e){return tn(e,!0)}function rn(e){return tn(e,!1)}function an(e,t){var n=Rt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||en(r,a.marker)<0)&&(r=a.marker)}return r}function on(e,t,n,r,i){var a=K(e,t),o=Rt&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var c=o[s];if(c.marker.collapsed){var l=c.marker.find(0),u=J(l.from,n)||Qt(c.marker)-Qt(i),d=J(l.to,r)||$t(c.marker)-$t(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?J(l.to,n)>=0:J(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?J(l.from,r)<=0:J(l.from,r)<0)))return!0}}}function sn(e){for(var t;t=nn(e);)e=t.find(-1,!0).line;return e}function cn(e){for(var t;t=rn(e);)e=t.find(1,!0).line;return e}function ln(e){for(var t,n;t=rn(e);)e=t.find(1,!0).line,(n||=[]).push(e);return n}function un(e,t){var n=K(e,t),r=sn(n);return n==r?t:ft(r)}function dn(e,t){if(t>e.lastLine())return t;var n=K(e,t),r;if(!fn(e,n))return t;for(;r=rn(n);)n=r.find(1,!0).line;return ft(n)+1}function fn(e,t){var n=Rt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed&&(r.from==null||!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&pn(e,t,r)))return!0}}function pn(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return pn(e,r.line,Ht(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&pn(e,t,i))return!0}function mn(e){e=sn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;t+=s.height}return t}function hn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=nn(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=rn(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function gn(e){var t=e.display,n=e.doc;t.maxLine=K(n,n.first),t.maxLineLength=hn(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=hn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var _n=function(e,t,n){this.text=e,Zt(this,t),this.height=n?n(this):1};_n.prototype.lineNo=function(){return ft(this)},Pe(_n);function vn(e,t,n,r){e.text=t,e.stateAfter&&=null,e.styles&&=null,e.order!=null&&(e.order=null),Xt(e),Zt(e,n);var i=r?r(e):1;i!=e.height&&dt(e,i)}function yn(e){e.parent=null,Xt(e)}var bn={},xn={};function Sn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?xn:bn;return n[e]||(n[e]=e.replace(/\S+/g,`cm-$&`))}function Cn(e,t){var n=te(`span`,null,null,c?`padding-right: .1px`:null),r={pre:te(`pre`,[n],`CodeMirror-line`),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption(`lineWrapping`)};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=Tn,Ge(e.display.measure)&&(o=Ee(a,e.doc.direction))&&(r.addToken=Dn(r.addToken,o)),r.map=[],kn(a,r,Et(e,a,t!=e.display.externalMeasured&&ft(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=ie(a.styleClasses.bgClass,r.bgClass||``)),a.styleClasses.textClass&&(r.textClass=ie(a.styleClasses.textClass,r.textClass||``))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Ue(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(`.cm-tab`))&&(r.content.className=`cm-tab-wrap-hack`)}return Ae(e,`renderLine`,e,t.line,r.pre),r.pre.className&&(r.textClass=ie(r.pre.className,r.textClass||``)),r}function wn(e){var t=O(`span`,`•`,`cm-invalidchar`);return t.title=`\\u`+e.charCodeAt(0).toString(16),t.setAttribute(`aria-label`,t.title),t}function Tn(e,t,n,r,i,a,c){if(t){var l=e.splitSpaces?En(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,f;if(!u.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),o&&s<9&&(d=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var p=0;;){u.lastIndex=p;var m=u.exec(t),h=m?m.index-p:t.length-p;if(h){var g=document.createTextNode(l.slice(p,p+h));o&&s<9?f.appendChild(O(`span`,[g])):f.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!m)break;p+=h+1;var _=void 0;if(m[0]==` `){var v=e.cm.options.tabSize,y=v-e.col%v;_=f.appendChild(O(`span`,de(y),`cm-tab`)),_.setAttribute(`role`,`presentation`),_.setAttribute(`cm-text`,` `),e.col+=y}else m[0]==`\r`||m[0]==`
49
+ `?(_=f.appendChild(O(`span`,m[0]==`\r`?`␍`:`␤`,`cm-invalidchar`)),_.setAttribute(`cm-text`,m[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(m[0]),_.setAttribute(`cm-text`,m[0]),o&&s<9?f.appendChild(O(`span`,[_])):f.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||d||a||c){var b=n||``;r&&(b+=r),i&&(b+=i);var x=O(`span`,[f],b,a);if(c)for(var S in c)c.hasOwnProperty(S)&&S!=`style`&&S!=`class`&&x.setAttribute(S,c[S]);return e.content.appendChild(x)}e.content.appendChild(f)}}function En(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r=``,i=0;i<e.length;i++){var a=e.charAt(i);a==` `&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a=`\xA0`),r+=a,n=a==` `}return r}function Dn(e,t){return function(n,r,i,a,o,s,c){i=i?i+` cm-force-border`:`cm-force-border`;for(var l=n.pos,u=l+r.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>l&&d.from<=l));f++);if(d.to>=u)return e(n,r,i,a,o,s,c);e(n,r.slice(0,d.to-l),i,a,null,s,c),a=null,r=r.slice(d.to-l),l=d.to}}}function On(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||=e.content.appendChild(document.createElement(`span`)),i.setAttribute(`cm-marker`,n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function kn(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(a,a=n[o]),Sn(n[o+1],t.cm.options));return}for(var s=i.length,c=0,l=1,u=``,d,f,p=0,m,h,g,_,v;;){if(p==c){m=h=g=f=``,v=null,_=null,p=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var S=r[x],C=S.marker;if(C.type==`bookmark`&&S.from==c&&C.widgetNode)y.push(C);else if(S.from<=c&&(S.to==null||S.to>c||C.collapsed&&S.to==c&&S.from==c)){if(S.to!=null&&S.to!=c&&p>S.to&&(p=S.to,h=``),C.className&&(m+=` `+C.className),C.css&&(f=(f?f+`;`:``)+C.css),C.startStyle&&S.from==c&&(g+=` `+C.startStyle),C.endStyle&&S.to==p&&(b||=[]).push(C.endStyle,S.to),C.title&&((v||={}).title=C.title),C.attributes)for(var w in C.attributes)(v||={})[w]=C.attributes[w];C.collapsed&&(!_||en(_.marker,C)<0)&&(_=S)}else S.from>c&&p>S.from&&(p=S.from)}if(b)for(var T=0;T<b.length;T+=2)b[T+1]==p&&(h+=` `+b[T]);if(!_||_.from==c)for(var ee=0;ee<y.length;++ee)On(t,0,y[ee]);if(_&&(_.from||0)==c){if(On(t,(_.to==null?s+1:_.to)-c,_.marker,_.from==null),_.to==null)return;_.to==c&&(_=!1)}}if(c>=s)break;for(var E=Math.min(s,p);;){if(u){var D=c+u.length;if(!_){var O=D>E?u.slice(0,E-c):u;t.addToken(t,O,d?d+m:m,g,c+O.length==p?h:``,f,v)}if(D>=E){u=u.slice(E-c),c=E;break}c=D,g=``}u=i.slice(a,a=n[l++]),d=Sn(n[l++],t.cm.options)}}}function An(e,t,n){this.line=t,this.rest=ln(t),this.size=this.rest?ft(H(this.rest))-n+1:1,this.node=this.text=null,this.hidden=fn(e,t)}function jn(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new An(e.doc,K(e.doc,a),a);i=a+o.size,r.push(o)}return r}var Mn=null;function Nn(e){Mn?Mn.ops.push(e):e.ownsGroup=Mn={ops:[e],delayedCallbacks:[]}}function Pn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Fn(e,t){var n=e.ownsGroup;if(n)try{Pn(n)}finally{Mn=null,t(n)}}var In=null;function Ln(e,t){var n=Oe(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Mn?i=Mn.delayedCallbacks:In?i=In:(i=In=[],setTimeout(Rn,0));for(var a=function(e){i.push(function(){return n[e].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function Rn(){var e=In;In=null;for(var t=0;t<e.length;++t)e[t]()}function zn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a==`text`?Un(e,t):a==`gutter`?Gn(e,t,n,r):a==`class`?Wn(e,t):a==`widget`&&Kn(e,t,r)}t.changes=null}function Bn(e){return e.node==e.text&&(e.node=O(`div`,null,null,`position: relative`),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&s<8&&(e.node.style.zIndex=2)),e.node}function Vn(e,t){var n=t.bgClass?t.bgClass+` `+(t.line.bgClass||``):t.line.bgClass;if(n&&(n+=` CodeMirror-linebackground`),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Bn(t);t.background=r.insertBefore(O(`div`,null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Hn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Cn(e,t)}function Un(e,t){var n=t.text.className,r=Hn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Wn(e,t)):n&&(t.text.className=n)}function Wn(e,t){Vn(e,t),t.line.wrapClass?Bn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=``);var n=t.textClass?t.textClass+` `+(t.line.textClass||``):t.line.textClass;t.text.className=n||``}function Gn(e,t,n,r){if(t.gutter&&=(t.node.removeChild(t.gutter),null),t.gutterBackground&&=(t.node.removeChild(t.gutterBackground),null),t.line.gutterClass){var i=Bn(t);t.gutterBackground=O(`div`,null,`CodeMirror-gutter-background `+t.line.gutterClass,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px; width: `+r.gutterTotalWidth+`px`),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=Bn(t),s=t.gutter=O(`div`,null,`CodeMirror-gutter-wrapper`,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px`);if(s.setAttribute(`aria-hidden`,`true`),e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=` `+t.line.gutterClass),e.options.lineNumbers&&(!a||!a[`CodeMirror-linenumbers`])&&(t.lineNumber=s.appendChild(O(`div`,ht(e.options,n),`CodeMirror-linenumber CodeMirror-gutter-elt`,`left: `+r.gutterLeft[`CodeMirror-linenumbers`]+`px; width: `+e.display.lineNumInnerWidth+`px`))),a)for(var c=0;c<e.display.gutterSpecs.length;++c){var l=e.display.gutterSpecs[c].className,u=a.hasOwnProperty(l)&&a[l];u&&s.appendChild(O(`div`,[u],`CodeMirror-gutter-elt`,`left: `+r.gutterLeft[l]+`px; width: `+r.gutterWidth[l]+`px`))}}}function Kn(e,t,n){t.alignable&&=null;for(var r=T(`CodeMirror-linewidget`),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Jn(e,t,n)}function qn(e,t,n,r){var i=Hn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wn(e,t),Gn(e,t,n,r),Jn(e,t,r),t.node}function Jn(e,t,n){if(Yn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Yn(e,t.rest[r],t,n,!1)}function Yn(e,t,n,r,i){if(t.widgets)for(var a=Bn(n),o=0,s=t.widgets;o<s.length;++o){var c=s[o],l=O(`div`,[c.node],`CodeMirror-linewidget`+(c.className?` `+c.className:``));c.handleMouseEvents||l.setAttribute(`cm-ignore-events`,`true`),Xn(c,l,n,r),e.display.input.setUneditable(l),i&&c.above?a.insertBefore(l,n.gutter||n.text):a.appendChild(l),Ln(c,`redraw`)}}function Xn(e,t,n,r){if(e.noHScroll){(n.alignable||=[]).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+`px`,e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+`px`),t.style.width=i+`px`}e.coverGutter&&(t.style.zIndex=5,t.style.position=`relative`,e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+`px`))}function Zn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var n=`position: relative;`;e.coverGutter&&(n+=`margin-left: -`+t.display.gutters.offsetWidth+`px;`),e.noHScroll&&(n+=`width: `+t.display.wrapper.clientWidth+`px;`),D(t.display.measure,O(`div`,[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Qn(e,t){for(var n=ze(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute(`cm-ignore-events`)==`true`||n.parentNode==e.sizer&&n!=e.mover)return!0}function $n(e){return e.lineSpace.offsetTop}function er(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function tr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=D(e.measure,O(`pre`,`x`,`CodeMirror-line-like`)),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function nr(e){return se-e.display.nativeBarWidth}function rr(e){return e.display.scroller.clientWidth-nr(e)-e.display.barWidth}function ir(e){return e.display.scroller.clientHeight-nr(e)-e.display.barHeight}function ar(e,t,n){var r=e.options.lineWrapping,i=r&&rr(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var c=o[s],l=o[s+1];Math.abs(c.bottom-l.bottom)>2&&a.push((c.bottom+l.top)/2-n.top)}}a.push(n.bottom-n.top)}}function or(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ft(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function sr(e,t){t=sn(t);var n=ft(t),r=e.display.externalMeasured=new An(e.doc,t,n);r.lineN=n;var i=r.built=Cn(e,r);return r.text=i.pre,D(e.display.lineMeasure,i.pre),r}function cr(e,t,n,r){return dr(e,ur(e,t),n,r)}function lr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Wr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function ur(e,t){var n=ft(t),r=lr(e,n);r&&!r.text?r=null:r&&r.changes&&(zn(e,r,n,zr(e)),e.curOp.forceUpdate=!0),r||=sr(e,t);var i=or(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function dr(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||``),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||=t.view.text.getBoundingClientRect(),t.hasHeights||=(ar(e,t.view,t.rect),!0),o=hr(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var fr={left:0,right:0,top:0,bottom:0};function pr(e,t,n){for(var r,i,a,o,s,c,l=0;l<e.length;l+=3)if(s=e[l],c=e[l+1],t<s?(i=0,a=1,o=`left`):t<c?(i=t-s,a=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(a=c-s,i=a-1,t>=c&&(o=`right`)),i!=null){if(r=e[l+2],s==c&&n==(r.insertLeft?`left`:`right`)&&(o=n),n==`left`&&i==0)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],o=`left`;if(n==`right`&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],o=`right`;break}return{node:r,start:i,end:a,collapse:o,coverStart:s,coverEnd:c}}function mr(e,t){var n=fr;if(t==`left`)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function hr(e,t,n,r){var i=pr(t.map,n,r),a=i.node,c=i.start,l=i.end,u=i.collapse,d;if(a.nodeType==3){for(var f=0;f<4;f++){for(;c&&W(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+l<i.coverEnd&&W(t.line.text.charAt(i.coverStart+l));)++l;if(d=o&&s<9&&c==0&&l==i.coverEnd-i.coverStart?a.parentNode.getBoundingClientRect():mr(k(a,c,l).getClientRects(),r),d.left||d.right||c==0)break;l=c,--c,u=`right`}o&&s<11&&(d=gr(e.display.measure,d))}else{c>0&&(u=r=`right`);var p;d=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p[r==`right`?p.length-1:0]:a.getBoundingClientRect()}if(o&&s<9&&!c&&(!d||!d.left&&!d.right)){var m=a.parentNode.getClientRects()[0];d=m?{left:m.left,right:m.left+Rr(e.display),top:m.top,bottom:m.bottom}:fr}for(var h=d.top-t.rect.top,g=d.bottom-t.rect.top,_=(h+g)/2,v=t.view.measure.heights,y=0;y<v.length-1&&!(_<v[y]);y++);var b=y?v[y-1]:0,x=v[y],S={left:(u==`right`?d.right:d.left)-t.rect.left,right:(u==`left`?d.left:d.right)-t.rect.left,top:b,bottom:x};return!d.left&&!d.right&&(S.bogus=!0),e.options.singleCursorHeightPerLine||(S.rtop=h,S.rbottom=g),S}function gr(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Xe(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function _r(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function vr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)_r(e.display.view[t])}function yr(e){vr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function br(e){return u&&_?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function xr(e){return u&&_?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Sr(e){var t=sn(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=Zn(t[r]));return n}function Cr(e,t,n,r,i){if(!i){var a=Sr(t);n.top+=a,n.bottom+=a}if(r==`line`)return n;r||=`local`;var o=mn(t);if(r==`local`?o+=$n(e.display):o-=e.display.viewOffset,r==`page`||r==`window`){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(r==`window`?0:xr(M(e)));var c=s.left+(r==`window`?0:br(M(e)));n.left+=c,n.right+=c}return n.top+=o,n.bottom+=o,n}function wr(e,t,n){if(n==`div`)return t;var r=t.left,i=t.top;if(n==`page`)r-=br(M(e)),i-=xr(M(e));else if(n==`local`||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Tr(e,t,n,r,i){return r||=K(e.doc,t.line),Cr(e,r,cr(e,r,t.ch,i),n)}function Er(e,t,n,r,i,a){r||=K(e.doc,t.line),i||=ur(e,r);function o(t,o){var s=dr(e,i,t,o?`right`:`left`,a);return o?s.left=s.right:s.right=s.left,Cr(e,r,s,n)}var s=Ee(r,e.doc.direction),c=t.ch,l=t.sticky;if(c>=r.text.length?(c=r.text.length,l=`before`):c<=0&&(c=0,l=`after`),!s)return o(l==`before`?c-1:c,l==`before`);function u(e,t,n){var r=s[t].level==1;return o(n?e-1:e,r!=n)}var d=we(s,c,l),f=Ce,p=u(c,d,l==`before`);return f!=null&&(p.other=u(c,f,l!=`before`)),p}function Dr(e,t){var n=0;t=Y(e.doc,t),e.options.lineWrapping||(n=Rr(e.display)*t.ch);var r=K(e.doc,t.line),i=mn(r)+$n(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Or(e,t,n,r,i){var a=q(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function kr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Or(r.first,0,null,-1,-1);var i=pt(r,n),a=r.first+r.size-1;if(i>a)return Or(r.first+r.size-1,K(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=K(r,i);;){var s=Nr(e,o,i,t,n),c=an(o,s.ch+ +(s.xRel>0||s.outside>0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;o=K(r,i=l.line)}}function Ar(e,t,n,r){r-=Sr(t);var i=t.text.length,a=xe(function(t){return dr(e,n,t-1).bottom<=r},i,0);return i=xe(function(t){return dr(e,n,t).top>r},a,i),{begin:a,end:i}}function jr(e,t,n,r){n||=ur(e,t);var i=Cr(e,t,dr(e,n,r),`line`).top;return Ar(e,t,n,i)}function Mr(e,t,n,r){return e.bottom<=n?!1:e.top>n||(r?e.left:e.right)>t}function Nr(e,t,n,r,i){i-=mn(t);var a=ur(e,t),o=Sr(t),s=0,c=t.text.length,l=!0,u=Ee(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Fr:Pr)(e,t,n,a,u,r,i);l=d.level!=1,s=l?d.from:d.to-1,c=l?d.to:d.from-1}var f=null,p=null,m=xe(function(t){var n=dr(e,a,t);return n.top+=o,n.bottom+=o,Mr(n,r,i,!1)?(n.top<=i&&n.left<=r&&(f=t,p=n),!0):!1},s,c),h,g,_=!1;if(p){var v=r-p.left<p.right-r,y=v==l;m=f+ +!y,g=y?`after`:`before`,h=v?p.left:p.right}else{!l&&(m==c||m==s)&&m++,g=m==0?`after`:m==t.text.length?`before`:dr(e,a,m-+!!l).bottom+o<=i==l?`after`:`before`;var b=Er(e,q(n,m,g),`line`,t,a);h=b.left,_=i<b.top?-1:+(i>=b.bottom)}return m=be(t.text,m,1),Or(n,m,g,_,r-h)}function Pr(e,t,n,r,i,a,o){var s=xe(function(s){var c=i[s],l=c.level!=1;return Mr(Er(e,q(n,l?c.to:c.from,l?`before`:`after`),`line`,t,r),a,o,!0)},0,i.length-1),c=i[s];if(s>0){var l=c.level!=1,u=Er(e,q(n,l?c.from:c.to,l?`after`:`before`),`line`,t,r);Mr(u,a,o,!0)&&u.top>o&&(c=i[s-1])}return c}function Fr(e,t,n,r,i,a,o){var s=Ar(e,t,r,o),c=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var u=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=l||p.to<=c)){var m=dr(e,r,p.level==1?Math.max(c,p.from):Math.min(l,p.to)-1).right,h=m<a?a-m+1e9:m-a;(!u||d>h)&&(u=p,d=h)}}return u||=i[i.length-1],u.from<c&&(u={from:c,to:u.to,level:u.level}),u.to>l&&(u={from:u.from,to:l,level:u.level}),u}var Ir;function Lr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ir==null){Ir=O(`pre`,null,`CodeMirror-line-like`);for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode(`x`)),Ir.appendChild(O(`br`));Ir.appendChild(document.createTextNode(`x`))}D(e.measure,Ir);var n=Ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),E(e.measure),n||1}function Rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=O(`span`,`xxxxxxxxxx`),n=O(`pre`,[t],`CodeMirror-line-like`);D(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function zr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;n[s]=a.offsetLeft+a.clientLeft+i,r[s]=a.clientWidth}return{fixedPos:Br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Vr(e){var t=Lr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Rr(e.display)-3);return function(i){if(fn(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function Hr(e){var t=e.doc,n=Vr(e);t.iter(function(e){var t=n(e);t!=e.height&&dt(e,t)})}function Ur(e,t,n,r){var i=e.display;if(!n&&ze(t).getAttribute(`cm-not-content`)==`true`)return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch{return null}var c=kr(e,a,o),l;if(r&&c.xRel>0&&(l=K(e.doc,c.line).text).length==c.ch){var u=I(l,l.length,e.options.tabSize)-l.length;c=q(c.line,Math.max(0,Math.round((a-tr(e.display).left)/Rr(e.display))-u))}return c}function Wr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Gr(e,t,n,r){t??=e.doc.first,n??=e.doc.first+e.doc.size,r||=0;var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Rt&&un(e.doc,t)<i.viewTo&&qr(e);else if(n<=i.viewFrom)Rt&&dn(e.doc,n+r)>i.viewFrom?qr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)qr(e);else if(t<=i.viewFrom){var a=Jr(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):qr(e)}else if(n>=i.viewTo){var o=Jr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):qr(e)}else{var s=Jr(e,t,t,-1),c=Jr(e,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(jn(e,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):qr(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function Kr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Wr(e,t)];if(a.node!=null){var o=a.changes||=[];R(o,n)==-1&&o.push(n)}}}function qr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Jr(e,t,n,r){var i=Wr(e,t),a,o=e.display.view;if(!Rt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,c=0;c<i;c++)s+=o[c].size;if(s!=t){if(r>0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,n+=a}for(;un(e.doc,n)!=n;){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-+(r<0)].size,i+=r}return{index:i,lineN:n}}function Yr(e,t,n){var r=e.display;r.view.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=jn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=jn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Wr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(jn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Wr(e,n)))),r.viewTo=n}function Xr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function Zr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Qr(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=e.options.$customCursor;o&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(!(!t&&s==n.sel.primIndex)){var c=n.sel.ranges[s];if(!(c.from().line>=e.display.viewTo||c.to().line<e.display.viewFrom)){var l=c.empty();if(o){var u=o(e,c);u&&$r(e,u,i)}else(l||e.options.showCursorWhenSelecting)&&$r(e,c.head,i);l||ti(e,c,a)}}return r}function $r(e,t,n){var r=Er(e,t,`div`,null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(O(`div`,`\xA0`,`CodeMirror-cursor`));if(i.style.left=r.left+`px`,i.style.top=r.top+`px`,i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+`px`,/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=Tr(e,t,`div`,null,null),o=a.right-a.left;i.style.width=(o>0?o:e.defaultCharWidth())+`px`}if(r.other){var s=n.appendChild(O(`div`,`\xA0`,`CodeMirror-cursor CodeMirror-secondarycursor`));s.style.display=``,s.style.left=r.other.left+`px`,s.style.top=r.other.top+`px`,s.style.height=(r.other.bottom-r.other.top)*.85+`px`}}function ei(e,t){return e.top-t.top||e.left-t.left}function ti(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=tr(e.display),s=o.left,c=Math.max(r.sizerWidth,rr(e)-r.sizer.offsetLeft)-o.right,l=i.direction==`ltr`;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(O(`div`,null,`CodeMirror-selected`,`position: absolute; left: `+e+`px;
50
+ top: `+t+`px; width: `+(n??c-e)+`px;
51
+ height: `+(r-t)+`px`))}function d(t,n,r){var a=K(i,t),o=a.text.length,d,f;function p(n,r){return Tr(e,q(t,n),`div`,a,r)}function m(t,n,r){var i=jr(e,a,null,t),o=n==`ltr`==(r==`after`)?`left`:`right`;return p(r==`after`?i.begin:i.end-(/\s/.test(a.text.charAt(i.end-1))?2:1),o)[o]}var h=Ee(a,i.direction);return Se(h,n||0,r??o,function(e,t,i,a){var g=i==`ltr`,_=p(e,g?`left`:`right`),v=p(t-1,g?`right`:`left`),y=n==null&&e==0,b=r==null&&t==o,x=a==0,S=!h||a==h.length-1;if(v.top-_.top<=3){var C=(l?y:b)&&x,w=(l?b:y)&&S,T=C?s:(g?_:v).left,ee=w?c:(g?v:_).right;u(T,_.top,ee-T,_.bottom)}else{var E,D,O,te;g?(E=l&&y&&x?s:_.left,D=l?c:m(e,i,`before`),O=l?s:m(t,i,`after`),te=l&&b&&S?c:v.right):(E=l?m(e,i,`before`):s,D=!l&&y&&x?c:_.right,O=!l&&b&&S?s:v.left,te=l?m(t,i,`after`):c),u(E,_.top,D-E,_.bottom),_.bottom<v.top&&u(s,_.bottom,null,v.top),u(O,v.top,te-O,v.bottom)}(!d||ei(_,d)<0)&&(d=_),ei(v,d)<0&&(d=v),(!f||ei(_,f)<0)&&(f=_),ei(v,f)<0&&(f=v)}),{start:d,end:f}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var m=K(i,f.line),h=K(i,p.line),g=sn(m)==sn(h),_=d(f.line,f.ch,g?m.text.length+1:null).end,v=d(p.line,g?0:null,p.ch).start;g&&(_.top<v.top-2?(u(_.right,_.top,null,_.bottom),u(s,v.top,v.left,v.bottom)):u(_.right,_.top,v.left-_.right,_.bottom)),_.bottom<v.top&&u(s,_.bottom,null,v.top)}n.appendChild(a)}function ni(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility=``,e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||oi(e),t.cursorDiv.style.visibility=(n=!n)?``:`hidden`},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility=`hidden`)}}function ri(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ai(e))}function ii(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&oi(e))},100)}function ai(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!=`nocursor`&&(e.state.focused||(Ae(e,`focus`,e,t),e.state.focused=!0,re(e.display.wrapper,`CodeMirror-focused`),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ni(e))}function oi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ae(e,`blur`,e,t),e.state.focused=!1,ee(e.display.wrapper,`CodeMirror-focused`)),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function si(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,c=0;c<t.view.length;c++){var l=t.view[c],u=e.options.lineWrapping,d=void 0,f=0;if(!l.hidden){if(i+=l.line.height,o&&s<8){var p=l.node.offsetTop+l.node.offsetHeight;d=p-n,n=p}else{var m=l.node.getBoundingClientRect();d=m.bottom-m.top,!u&&l.text.firstChild&&(f=l.text.firstChild.getBoundingClientRect().right-m.left-1)}var h=l.line.height-d;if((h>.005||h<-.005)&&(i<r&&(a-=h),dt(l.line,d),ci(l.line),l.rest))for(var g=0;g<l.rest.length;g++)ci(l.rest[g]);if(f>e.display.sizerWidth){var _=Math.ceil(f/Rr(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function ci(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function li(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-$n(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=pt(t,r),o=pt(t,i);if(n&&n.ensure){var s=n.ensure.from.line,c=n.ensure.to.line;s<a?(a=s,o=pt(t,mn(K(t,s))+e.wrapper.clientHeight)):Math.min(c,t.lastLine())>=o&&(a=pt(t,mn(K(t,c))-e.wrapper.clientHeight),o=c)}return{from:a,to:Math.max(o,a+1)}}function ui(e,t){if(!je(e,`scrollCursorIntoView`)){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!h){var o=O(`div`,`​`,null,`position: absolute;
52
+ top: `+(t.top-n.viewOffset-$n(e.display))+`px;
53
+ height: `+(t.bottom-t.top+nr(e)+n.barHeight)+`px;
54
+ left: `+t.left+`px; width: `+Math.max(2,t.right-t.left)+`px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function di(e,t,n,r){r??=0;var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==`before`?q(t.line,t.ch+1,`before`):t,t=t.ch?q(t.line,t.sticky==`before`?t.ch-1:t.ch,`after`):t);for(var a=0;a<5;a++){var o=!1,s=Er(e,t),c=!n||n==t?s:Er(e,n);i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r};var l=pi(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(l.scrollTop!=null&&(bi(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),l.scrollLeft!=null&&(Si(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}function fi(e,t){var n=pi(e,t);n.scrollTop!=null&&bi(e,n.scrollTop),n.scrollLeft!=null&&Si(e,n.scrollLeft)}function pi(e,t){var n=e.display,r=Lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=ir(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+er(n),c=t.top<r,l=t.bottom>s-r;if(t.top<i)o.scrollTop=c?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(l?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=rr(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.left<f?o.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>p+f-3&&(o.scrollLeft=t.right+(m?0:10)-p),o}function mi(e,t){t!=null&&(vi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function hi(e){vi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function gi(e,t,n){(t!=null||n!=null)&&vi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function _i(e,t){vi(e),e.curOp.scrollToPos=t}function vi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,yi(e,Dr(e,t.from),Dr(e,t.to),t.margin))}function yi(e,t,n,r){var i=pi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});gi(e,i.scrollLeft,i.scrollTop)}function bi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Xi(e,{top:t}),xi(e,t,!0),n&&Xi(e),Hi(e,100))}function xi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Si(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ea(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ci(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+er(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+nr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var X=function(e,t,n){this.cm=n;var r=this.vert=O(`div`,[O(`div`,null,null,`min-width: 1px`)],`CodeMirror-vscrollbar`),i=this.horiz=O(`div`,[O(`div`,null,null,`height: 100%; min-height: 1px`)],`CodeMirror-hscrollbar`);r.tabIndex=i.tabIndex=-1,e(r),e(i),G(r,`scroll`,function(){r.clientHeight&&t(r.scrollTop,`vertical`)}),G(i,`scroll`,function(){i.clientWidth&&t(i.scrollLeft,`horizontal`)}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=`18px`)};X.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display=`block`,this.vert.style.bottom=t?r+`px`:`0`;var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+`px`}else this.vert.scrollTop=0,this.vert.style.display=``,this.vert.firstChild.style.height=`0`;if(t){this.horiz.style.display=`block`,this.horiz.style.right=n?r+`px`:`0`,this.horiz.style.left=e.barLeft+`px`;var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+`px`}else this.horiz.style.display=``,this.horiz.firstChild.style.width=`0`;return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},X.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,`horiz`)},X.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,`vert`)},X.prototype.zeroWidthHack=function(){var e=y&&!m?`12px`:`18px`;this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility=`hidden`,this.disableHoriz=new L,this.disableVert=new L},X.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility=``;function r(){var i=e.getBoundingClientRect();(n==`vert`?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))==e?t.set(1e3,r):e.style.visibility=`hidden`}t.set(1e3,r)},X.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wi=function(){};wi.prototype.update=function(){return{bottom:0,right:0}},wi.prototype.setScrollLeft=function(){},wi.prototype.setScrollTop=function(){},wi.prototype.clear=function(){};function Ti(e,t){t||=Ci(e);var n=e.display.barWidth,r=e.display.barHeight;Ei(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&si(e),Ei(e,Ci(e)),n=e.display.barWidth,r=e.display.barHeight}function Ei(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+`px`,n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+`px`,n.heightForcer.style.borderBottom=r.bottom+`px solid transparent`,r.right&&r.bottom?(n.scrollbarFiller.style.display=`block`,n.scrollbarFiller.style.height=r.bottom+`px`,n.scrollbarFiller.style.width=r.right+`px`):n.scrollbarFiller.style.display=``,r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display=`block`,n.gutterFiller.style.height=r.bottom+`px`,n.gutterFiller.style.width=t.gutterWidth+`px`):n.gutterFiller.style.display=``}var Di={native:X,null:wi};function Oi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Di[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),G(t,`mousedown`,function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute(`cm-not-content`,`true`)},function(t,n){n==`horizontal`?Si(e,t):bi(e,t)},e),e.display.scrollbars.addClass&&re(e.display.wrapper,e.display.scrollbars.addClass)}var ki=0;function Ai(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ki,markArrays:null},Nn(e.curOp)}function ji(e){var t=e.curOp;t&&Fn(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Mi(e)})}function Mi(e){for(var t=e.ops,n=0;n<t.length;n++)Ni(t[n]);for(var r=0;r<t.length;r++)Pi(t[r]);for(var i=0;i<t.length;i++)Fi(t[i]);for(var a=0;a<t.length;a++)Ii(t[a]);for(var o=0;o<t.length;o++)Li(t[o])}function Ni(e){var t=e.cm,n=t.display;Gi(t),e.updateMaxLine&&gn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Pi(e){e.updatedDisplay=e.mustUpdate&&Ji(e.cm,e.update)}function Fi(e){var t=e.cm,n=t.display;e.updatedDisplay&&si(t),e.barMeasure=Ci(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=cr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+nr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-rr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ii(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+`px`,e.maxScrollLeft<t.doc.scrollLeft&&Si(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ne(ae(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ti(t,e.barMeasure),e.updatedDisplay&&$i(t,e.barMeasure),e.selectionChanged&&ni(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&ri(e.cm)}function Li(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Yi(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&xi(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Si(t,e.scrollLeft,!0,!0),e.scrollToPos&&ui(t,di(t,Y(r,e.scrollToPos.from),Y(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||Ae(i[o],`hide`);if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Ae(a[s],`unhide`);n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ae(t,`changes`,t,e.changeObjs),e.update&&e.update.finish()}function Ri(e,t){if(e.curOp)return t();Ai(e);try{return t()}finally{ji(e)}}function zi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ai(e);try{return t.apply(e,arguments)}finally{ji(e)}}}function Bi(e){return function(){if(this.curOp)return e.apply(this,arguments);Ai(this);try{return e.apply(this,arguments)}finally{ji(this)}}}function Vi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ai(t);try{return e.apply(this,arguments)}finally{ji(t)}}}function Hi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(Ui,e))}function Ui(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Dt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?at(t.mode,r.state):null,c=Tt(e,a,r,!0);s&&(r.state=s),a.styles=c.styles;var l=a.styleClasses,u=c.classes;u?a.styleClasses=u:l&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Ot(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Hi(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ri(e,function(){for(var t=0;t<i.length;t++)Kr(e,i[t],`text`)})}}var Wi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=li(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=rr(e),this.force=n,this.dims=zr(e),this.events=[]};Wi.prototype.signal=function(e,t){Ne(e,t)&&this.events.push(arguments)},Wi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ae.apply(null,this.events[e])};function Gi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=nr(e)+`px`,t.sizer.style.marginBottom=-t.nativeBarWidth+`px`,t.sizer.style.borderRightWidth=nr(e)+`px`,t.scrollbarsClipped=!0)}function Ki(e){if(e.hasFocus())return null;var t=ne(ae(e));if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=N(e).getSelection();r.anchorNode&&r.extend&&A(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function qi(e){if(!(!e||!e.activeElt||e.activeElt==ne(oe(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ji(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return qr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Xr(e)==0)return!1;ta(e)&&(qr(e),t.dims=zr(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),Rt&&(a=un(e.doc,a),o=dn(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Yr(e,a,o),n.viewOffset=mn(K(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+`px`;var c=Xr(e);if(!s&&c==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var l=Ki(e);return c>4&&(n.lineDiv.style.display=`none`),Zi(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=``),n.renderedView=n.view,qi(l),E(n.cursorDiv),E(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Hi(e,400)),n.updateLineNumbers=null,!0}function Yi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==rr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+er(e.display)-ir(e),n.top)}),t.visible=li(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=li(e.display,e.doc,n));if(!Ji(e,t))break;si(e);var i=Ci(e);Zr(e),Ti(e,i),$i(e,i),t.force=!1}t.signal(e,`update`,e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,`viewportChange`,e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Xi(e,t){var n=new Wi(e,t);if(Ji(e,n)){si(e),Yi(e,n);var r=Ci(e);Zr(e),Ti(e,r),$i(e,r),n.finish()}}function Zi(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return c&&y&&e.display.currentWheelTarget==t?t.style.display=`none`:t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(!f.hidden){if(!f.node||f.node.parentNode!=a){var p=qn(e,f,u,n);a.insertBefore(p,o)}else{for(;o!=f.node;)o=s(o);var m=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(R(f.changes,`gutter`)>-1&&(m=!1),zn(e,f,u,n)),m&&(E(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ht(e.options,u)))),o=f.node.nextSibling}}u+=f.size}for(;o;)o=s(o)}function Qi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+`px`,Ln(e,`gutterChanged`,e)}function $i(e,t){e.display.sizer.style.minHeight=t.docHeight+`px`,e.display.heightForcer.style.top=t.docHeight+`px`,e.display.gutters.style.height=t.docHeight+e.display.barHeight+nr(e)+`px`}function ea(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+`px`,o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var c=0;c<s.length;c++)s[c].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+`px`)}}function ta(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ht(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(O(`div`,[O(`div`,n)],`CodeMirror-linenumber CodeMirror-gutter-elt`)),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width=``,r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+`px`,Qi(e.display),!0}return!1}function na(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!=`string`&&(o=a.style,a=a.className),a==`CodeMirror-linenumbers`){if(t)r=!0;else continue}n.push({className:a,style:o})}return t&&!r&&n.push({className:`CodeMirror-linenumbers`,style:null}),n}function ra(e){var t=e.gutters,n=e.gutterSpecs;E(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=t.appendChild(O(`div`,null,`CodeMirror-gutter `+a));o&&(s.style.cssText=o),a==`CodeMirror-linenumbers`&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+`px`)}t.style.display=n.length?``:`none`,Qi(e)}function ia(e){ra(e.display),Gr(e),ea(e)}function aa(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=O(`div`,null,`CodeMirror-scrollbar-filler`),a.scrollbarFiller.setAttribute(`cm-not-content`,`true`),a.gutterFiller=O(`div`,null,`CodeMirror-gutter-filler`),a.gutterFiller.setAttribute(`cm-not-content`,`true`),a.lineDiv=te(`div`,null,`CodeMirror-code`),a.selectionDiv=O(`div`,null,null,`position: relative; z-index: 1`),a.cursorDiv=O(`div`,null,`CodeMirror-cursors`),a.measure=O(`div`,null,`CodeMirror-measure`),a.lineMeasure=O(`div`,null,`CodeMirror-measure`),a.lineSpace=te(`div`,[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,`position: relative; outline: none`),a.mover=O(`div`,[te(`div`,[a.lineSpace],`CodeMirror-lines`)],null,`position: relative`),a.sizer=O(`div`,[a.mover],`CodeMirror-sizer`),a.sizerWidth=null,a.heightForcer=O(`div`,null,null,`position: absolute; height: `+se+`px; width: 1px;`),a.gutters=O(`div`,null,`CodeMirror-gutters`),a.lineGutter=null,a.scroller=O(`div`,[a.sizer,a.heightForcer,a.gutters],`CodeMirror-scroll`),a.scroller.setAttribute(`tabIndex`,`-1`),a.wrapper=O(`div`,[a.scrollbarFiller,a.gutterFiller,a.scroller],`CodeMirror`),u&&d===105&&(a.wrapper.style.clipPath=`inset(0px)`),a.wrapper.setAttribute(`translate`,`no`),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!c&&!(n&&v)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=na(i.gutters,i.lineNumbers),ra(a),r.init(a)}var oa=0,sa=null;o?sa=-.53:n?sa=15:u?sa=-.7:p&&(sa=-1/3);function ca(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n??=e.wheelDelta,{x:t,y:n}}function la(e){var t=ca(e);return t.x*=sa,t.y*=sa,t}function ua(e,t){u&&d==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents=`none`:clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=``},100));var r=ca(t),i=r.x,a=r.y,o=sa;t.deltaMode===0&&(i=t.deltaX,a=t.deltaY,o=1);var s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(i&&p||a&&m){if(a&&y&&c){outer:for(var h=t.target,g=s.view;h!=l;h=h.parentNode)for(var _=0;_<g.length;_++)if(g[_].node==h){e.display.currentWheelTarget=h;break outer}}if(i&&!n&&!f&&o!=null){a&&m&&bi(e,Math.max(0,l.scrollTop+a*o)),Si(e,Math.max(0,l.scrollLeft+i*o)),(!a||a&&m)&&Fe(t),s.wheelStartX=null;return}if(a&&o!=null){var v=a*o,b=e.doc.scrollTop,x=b+s.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):x=Math.min(e.doc.height,x+v+50),Xi(e,{top:b,bottom:x})}oa<20&&t.deltaMode!==0&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX!=null){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(sa=(sa*oa+n)/(oa+1),++oa)}},200)):(s.wheelDX+=i,s.wheelDY+=a))}}var da=function(e,t){this.ranges=e,this.primIndex=t};da.prototype.primary=function(){return this.ranges[this.primIndex]},da.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!gt(n.anchor,r.anchor)||!gt(n.head,r.head))return!1}return!0},da.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new fa(_t(this.ranges[t].anchor),_t(this.ranges[t].head));return new da(e,this.primIndex)},da.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},da.prototype.contains=function(e,t){t||=e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(J(t,r.from())>=0&&J(e,r.to())<=0)return n}return-1};var fa=function(e,t){this.anchor=e,this.head=t};fa.prototype.from=function(){return yt(this.anchor,this.head)},fa.prototype.to=function(){return vt(this.anchor,this.head)},fa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function pa(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return J(e.from(),t.from())}),n=R(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],c=J(s.to(),o.from());if(r&&!o.empty()?c>0:c>=0){var l=yt(s.from(),o.from()),u=vt(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new fa(d?u:l,d?l:u))}}return new da(t,n)}function ma(e,t){return new da([new fa(e,t||e)],0)}function ha(e){return e.text?q(e.from.line+e.text.length-1,H(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ga(e,t){if(J(e,t.from)<0)return e;if(J(e,t.to)<=0)return ha(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ha(t).ch-t.to.ch),q(n,r)}function _a(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new fa(ga(i.anchor,t),ga(i.head,t)))}return pa(e.cm,n,e.sel.primIndex)}function va(e,t,n){return e.line==t.line?q(n.line,e.ch-t.ch+n.ch):q(n.line+(e.line-t.line),e.ch)}function ya(e,t,n){for(var r=[],i=q(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],c=va(s.from,i,a),l=va(ha(s),i,a);if(i=s.to,a=l,n==`around`){var u=e.sel.ranges[o],d=J(u.head,u.anchor)<0;r[o]=new fa(d?l:c,d?c:l)}else r[o]=new fa(c,c)}return new da(r,e.sel.primIndex)}function ba(e){e.doc.mode=nt(e.options,e.doc.modeOption),xa(e)}function xa(e){e.doc.iter(function(e){e.stateAfter&&=null,e.styles&&=null}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Hi(e,100),e.state.modeGen++,e.curOp&&Gr(e)}function Sa(e,t){return t.from.ch==0&&t.to.ch==0&&H(t.text)==``&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ca(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){vn(e,n,i,r),Ln(e,`change`,e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new _n(l[a],i(a),r));return n}var s=t.from,c=t.to,l=t.text,u=K(e,s.line),d=K(e,c.line),f=H(l),p=i(l.length-1),m=c.line-s.line;if(t.full)e.insert(0,o(0,l.length)),e.remove(l.length,e.size-l.length);else if(Sa(e,t)){var h=o(0,l.length-1);a(d,d.text,p),m&&e.remove(s.line,m),h.length&&e.insert(s.line,h)}else if(u==d){if(l.length==1)a(u,u.text.slice(0,s.ch)+f+u.text.slice(c.ch),p);else{var g=o(1,l.length-1);g.push(new _n(f+u.text.slice(c.ch),p,r)),a(u,u.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}}else if(l.length==1)a(u,u.text.slice(0,s.ch)+l[0]+d.text.slice(c.ch),i(0)),e.remove(s.line+1,m);else{a(u,u.text.slice(0,s.ch)+l[0],i(0)),a(d,f+d.text.slice(c.ch),p);var _=o(1,l.length-1);m>1&&e.remove(s.line+1,m-1),e.insert(s.line+1,_)}Ln(e,`change`,e,t)}function wa(e,t,n){function r(e,i,a){if(e.linked)for(var o=0;o<e.linked.length;++o){var s=e.linked[o];if(s.doc!=i){var c=a&&s.sharedHist;n&&!c||(t(s.doc,c),r(s.doc,e,c))}}}r(e,null,!0)}function Ta(e,t){if(t.cm)throw Error(`This document is already in use.`);e.doc=t,t.cm=e,Hr(e),ba(e),Ea(e),e.options.direction=t.direction,e.options.lineWrapping||gn(e),e.options.mode=t.modeOption,Gr(e)}function Ea(e){(e.doc.direction==`rtl`?re:ee)(e.display.lineDiv,`CodeMirror-rtl`)}function Da(e){Ri(e,function(){Ea(e),Gr(e)})}function Oa(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ka(e,t){var n={from:_t(t.from),to:ha(t),text:lt(e,t.from,t.to)};return Ia(e,n,t.from.line,t.to.line+1),wa(e,function(e){return Ia(e,n,t.from.line,t.to.line+1)},!0),n}function Aa(e){for(;e.length&&H(e).ranges;)e.pop()}function ja(e,t){if(t)return Aa(e.done),H(e.done);if(e.done.length&&!H(e.done).ranges)return H(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),H(e.done)}function Ma(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)==`+`&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)==`*`))&&(o=ja(i,i.lastOp==r)))s=H(o.changes),J(t.from,t.to)==0&&J(t.from,s.to)==0?s.to=ha(t):o.changes.push(ka(e,t));else{var c=H(i.done);for((!c||!c.ranges)&&Fa(e.sel,i.done),o={changes:[ka(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||Ae(e,`historyAdded`)}function Na(e,t,n,r){var i=t.charAt(0);return i==`*`||i==`+`&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Pa(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||Na(e,a,H(i.done),t))?i.done[i.done.length-1]=t:Fa(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Aa(i.undone)}function Fa(e,t){var n=H(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ia(e,t,n,r){var i=t[`spans_`+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||=t[`spans_`+e.id]={})[a]=n.markedSpans),++a})}function La(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||=e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function Ra(e,t){var n=t[`spans_`+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(La(n[i]));return r}function za(e,t){var n=Ra(e,t),r=qt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)spans:for(var s=0;s<o.length;++s){for(var c=o[s],l=0;l<a.length;++l)if(a[l].marker==c.marker)continue spans;a.push(c)}else o&&(n[i]=o)}return n}function Ba(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?da.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];r.push({changes:s});for(var c=0;c<o.length;++c){var l=o[c],u=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var d in l)(u=d.match(/^spans_(\d+)$/))&&R(t,Number(u[1]))>-1&&(H(s)[d]=l[d],delete l[d])}}return r}function Va(e,t,n,r){if(r){var i=e.anchor;if(n){var a=J(t,i)<0;a==J(n,i)<0?a!=J(t,n)<0&&(t=n):(i=t,t=n)}return new fa(i,t)}return new fa(n||t,t)}function Ha(e,t,n,r,i){i??=e.cm&&(e.cm.display.shift||e.extend),Ja(e,new da([Va(e.sel.primary(),t,n,i)],0),r)}function Ua(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Va(e.sel.ranges[a],t[a],null,i);Ja(e,pa(e.cm,r,e.sel.primIndex),n)}function Wa(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ja(e,pa(e.cm,i,e.sel.primIndex),r)}function Ga(e,t,n,r){Ja(e,ma(t,n),r)}function Ka(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new fa(Y(e,t[n].anchor),Y(e,t[n].head))},origin:n&&n.origin};return Ae(e,`beforeSelectionChange`,e,r),e.cm&&Ae(e.cm,`beforeSelectionChange`,e.cm,r),r.ranges==t.ranges?t:pa(e.cm,r.ranges,r.ranges.length-1)}function qa(e,t,n){var r=e.history.done,i=H(r);i&&i.ranges?(r[r.length-1]=t,Ya(e,t,n)):Ja(e,t,n)}function Ja(e,t,n){Ya(e,t,n),Pa(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Ya(e,t,n){(Ne(e,`beforeSelectionChange`)||e.cm&&Ne(e.cm,`beforeSelectionChange`))&&(t=Ka(e,t,n));var r=n&&n.bias||(J(t.primary().head,e.sel.primary().head)<0?-1:1);Xa(e,Qa(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption(`readOnly`)!=`nocursor`&&hi(e.cm)}function Xa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Me(e.cm)),Ln(e,`cursorActivity`,e))}function Za(e){Xa(e,Qa(e,e.sel,null,!1))}function Qa(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],c=eo(e,o.anchor,s&&s.anchor,n,r),l=o.head==o.anchor?c:eo(e,o.head,s&&s.head,n,r);(i||c!=o.anchor||l!=o.head)&&(i||=t.ranges.slice(0,a),i[a]=new fa(c,l))}return i?pa(e.cm,i,t.primIndex):t}function $a(e,t,n,r,i){var a=K(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],c=s.marker,l=`selectLeft`in c?!c.selectLeft:c.inclusiveLeft,u=`selectRight`in c?!c.selectRight:c.inclusiveRight;if((s.from==null||(l?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(Ae(c,`beforeCursorEnter`),c.explicitlyCleared)){if(a.markedSpans){--o;continue}break}if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(d=to(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=J(d,n))&&(r<0?f<0:f>0))return $a(e,d,t,r,i)}var p=c.find(r<0?-1:1);return(r<0?l:u)&&(p=to(e,p,r,p.line==t.line?a:null)),p?$a(e,p,t,r,i):null}}return t}function eo(e,t,n,r,i){var a=r||1;return $a(e,t,n,a,i)||!i&&$a(e,t,n,a,!0)||$a(e,t,n,-a,i)||!i&&$a(e,t,n,-a,!0)||(e.cantEdit=!0,q(e.first,0))}function to(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Y(e,q(t.line-1)):null:n>0&&t.ch==(r||K(e,t.line)).text.length?t.line<e.first+e.size-1?q(t.line+1,0):null:new q(t.line,t.ch+n)}function Z(e){e.setSelection(q(e.firstLine(),0),q(e.lastLine()),ce)}function no(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=Y(e,t)),n&&(r.to=Y(e,n)),i&&(r.text=i),a!==void 0&&(r.origin=a)}),Ae(e,`beforeChange`,e,r),e.cm&&Ae(e.cm,`beforeChange`,e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ro(e,t,n){if(e.cm){if(!e.cm.curOp)return zi(e.cm,ro)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Ne(e,`beforeChange`)||e.cm&&Ne(e.cm,`beforeChange`))&&(t=no(e,t,!0),!t))){var r=Lt&&!n&&Yt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)io(e,{from:r[i].from,to:r[i].to,text:i?[``]:t.text,origin:t.origin});else io(e,t)}}function io(e,t){if(t.text.length!=1||t.text[0]!=``||J(t.from,t.to)!=0){var n=_a(e,t);Ma(e,t,n,e.cm?e.cm.curOp.id:NaN),so(e,t,n,qt(e,t));var r=[];wa(e,function(e,n){!n&&R(r,e.history)==-1&&(po(e.history,t),r.push(e.history)),so(e,t,null,qt(e,t))})}}function ao(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,s=t==`undo`?i.done:i.undone,c=t==`undo`?i.undone:i.done,l=0;l<s.length&&(a=s[l],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Fa(a,c),n&&!a.equals(e.sel)){Ja(e,a,{clearRedo:!1});return}o=a}else if(r){s.push(a);return}else break;var u=[];Fa(o,c),c.push({changes:u,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var d=Ne(e,`beforeChange`)||e.cm&&Ne(e.cm,`beforeChange`),f=function(n){var r=a.changes[n];if(r.origin=t,d&&!no(e,r,!1))return s.length=0,{};u.push(ka(e,r)),so(e,r,n?_a(e,r):H(s),za(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:ha(r)});var i=[];wa(e,function(e,t){!t&&R(i,e.history)==-1&&(po(e.history,r),i.push(e.history)),so(e,r,null,za(e,r))})},p=a.changes.length-1;p>=0;--p){var m=f(p);if(m)return m.v}}}}function oo(e,t){if(t!=0&&(e.first+=t,e.sel=new da(fe(e.sel.ranges,function(e){return new fa(q(e.anchor.line+t,e.anchor.ch),q(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Gr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Kr(e.cm,r,`gutter`)}}function so(e,t,n,r){if(e.cm&&!e.cm.curOp)return zi(e.cm,so)(e,t,n,r);if(t.to.line<e.first){oo(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);oo(e,i),t={from:q(e.first,0),to:q(t.to.line+i,t.to.ch),text:[H(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:q(a,K(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=lt(e,t.from,t.to),n||=_a(e,t),e.cm?co(e.cm,t,r):Ca(e,t,r),Ya(e,n,ce),e.cantEdit&&eo(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function co(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=ft(sn(K(r,a.line))),r.iter(c,o.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Me(e),Ca(r,t,n,Vr(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=hn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),It(r,a.line),Hi(e,400);var l=t.text.length-(o.line-a.line)-1;t.full?Gr(e):a.line==o.line&&t.text.length==1&&!Sa(e.doc,t)?Kr(e,a.line,`text`):Gr(e,a.line,o.line+1,l);var u=Ne(e,`changes`),d=Ne(e,`change`);if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&Ln(e,`change`,e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function lo(e,t,n,r,i){var a;r||=n,J(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t==`string`&&(t=e.splitLines(t)),ro(e,{from:n,to:r,text:t,origin:i})}function uo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function fo(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)uo(a.ranges[s].anchor,t,n,r),uo(a.ranges[s].head,t,n,r);continue}for(var c=0;c<a.changes.length;++c){var l=a.changes[c];if(n<l.from.line)l.from=q(l.from.line+r,l.from.ch),l.to=q(l.to.line+r,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function po(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;fo(e.done,n,r,i),fo(e.undone,n,r,i)}function mo(e,t,n,r){var i=t,a=t;return typeof t==`number`?a=K(e,bt(e,t)):i=ft(t),i==null?null:(r(a,i)&&e.cm&&Kr(e.cm,i,n),a)}function ho(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}ho.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,yn(i),Ln(i,`delete`)}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function go(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}go.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ho))){var s=[];this.collapse(s),this.children=[new ho(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var c=new ho(i.lines.slice(s,s+=25));i.height-=c.height,this.children.splice(++r,0,c),c.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new go(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=R(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new go(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var _o=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};_o.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ft(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=Zn(this);dt(n,Math.max(0,n.height-a)),e&&(Ri(e,function(){vo(e,n,-a),Kr(e,r,`widget`)}),Ln(e,`lineWidgetCleared`,e,this,r))}},_o.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Zn(this)-t;i&&(fn(this.doc,r)||dt(r,r.height+i),n&&Ri(n,function(){n.curOp.forceUpdate=!0,vo(n,r,i),Ln(n,`lineWidgetChanged`,n,e,ft(r))}))},Pe(_o);function vo(e,t,n){mn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&mi(e,n)}function yo(e,t,n,r){var i=new _o(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),mo(e,t,`widget`,function(t){var n=t.widgets||=[];if(i.insertAt==null?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!fn(e,t)){var r=mn(t)<e.scrollTop;dt(t,t.height+Zn(i)),r&&mi(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Ln(a,`lineWidgetAdded`,a,i,typeof t==`number`?t:ft(t)),i}var bo=0,xo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++bo};xo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ai(e),Ne(this,`clear`)){var n=this.find();n&&Ln(this,`clear`,n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Ht(o.markedSpans,this);e&&!this.collapsed?Kr(e,ft(o),`text`):e&&(s.to!=null&&(i=ft(o)),s.from!=null&&(r=ft(o))),o.markedSpans=Ut(o.markedSpans,s),s.from==null&&this.collapsed&&!fn(this.doc,o)&&e&&dt(o,Lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var l=sn(this.lines[c]),u=hn(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Gr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Za(e.doc)),e&&Ln(e,`markerCleared`,e,this,r,i),t&&ji(e),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){e==null&&this.type==`bookmark`&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Ht(a.markedSpans,this);if(o.from!=null&&(n=q(t?a:ft(a),o.from),e==-1))return n;if(o.to!=null&&(r=q(t?a:ft(a),o.to),e==1))return r}return n&&{from:n,to:r}},xo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Ri(r,function(){var i=t.line,a=lr(r,ft(t.line));if(a&&(_r(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!fn(n.doc,i)&&n.height!=null){var o=n.height;n.height=null;var s=Zn(n)-o;s&&dt(i,i.height+s)}Ln(r,`markerChanged`,r,e)})},xo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||R(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||=[]).push(this)}this.lines.push(e)},xo.prototype.detachLine=function(e){if(this.lines.splice(R(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||=[]).push(this)}},Pe(xo);function So(e,t,n,r,i){if(r&&r.shared)return wo(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return zi(e.cm,So)(e,t,n,r,i);var a=new xo(e,i),o=J(t,n);if(r&&F(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=te(`span`,[a.replacedWith],`CodeMirror-widget`),r.handleMouseEvents||a.widgetNode.setAttribute(`cm-ignore-events`,`true`),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(on(e,t.line,t,n,a)||t.line!=n.line&&on(e,n.line,t,n,a))throw Error(`Inserting collapsed marker partially overlapping an existing one`);Bt()}a.addToHistory&&Ma(e,{from:t,to:n,origin:`markText`},e.sel,NaN);var s=t.line,c=e.cm,l;if(e.iter(s,n.line+1,function(r){c&&a.collapsed&&!c.options.lineWrapping&&sn(r)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&dt(r,0),Wt(r,new Vt(a,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,n.line+1,function(t){fn(e,t)&&dt(t,0)}),a.clearOnEnter&&G(a,`beforeCursorEnter`,function(){return a.clear()}),a.readOnly&&(zt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++bo,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Gr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)Kr(c,u,`text`);a.atomic&&Za(c.doc),Ln(c,`markerAdded`,c,a)}return a}var Co=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Co.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ln(this,`clear`)}},Co.prototype.find=function(e,t){return this.primary.find(e,t)},Pe(Co);function wo(e,t,n,r,i){r=F(r),r.shared=!1;var a=[So(e,t,n,r,i)],o=a[0],s=r.widgetNode;return wa(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),a.push(So(e,Y(e,t),Y(e,n),r,i));for(var c=0;c<e.linked.length;++c)if(e.linked[c].isParent)return;o=H(a)}),new Co(a,o)}function To(e){return e.findMarks(q(e.first,0),e.clipPos(q(e.lastLine())),function(e){return e.parent})}function Eo(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(J(a,o)){var s=So(e,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function Do(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];wa(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var a=n.markers[i];R(r,a.doc)==-1&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}var Oo=0,ko=function(e,t,n,r,i){if(!(this instanceof ko))return new ko(e,t,n,r,i);n??=0,go.call(this,[new ho([new _n(``,null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=q(n,0);this.sel=ma(a),this.history=new Oa(null),this.id=++Oo,this.modeOption=t,this.lineSep=r,this.direction=i==`rtl`?`rtl`:`ltr`,this.extend=!1,typeof e==`string`&&(e=this.splitLines(e)),Ca(this,{from:a,to:a,text:e}),Ja(this,ma(a),ce)};ko.prototype=he(go.prototype,{constructor:ko,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ut(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Vi(function(e){var t=q(this.first,0),n=this.first+this.size-1;ro(this,{from:t,to:q(n,K(this,n).text.length),text:this.splitLines(e),origin:`setValue`,full:!0},!0),this.cm&&gi(this.cm,0,0),Ja(this,ma(t),ce)}),replaceRange:function(e,t,n,r){t=Y(this,t),n=n?Y(this,n):t,lo(this,e,t,n,r)},getRange:function(e,t,n){var r=lt(this,Y(this,e),Y(this,t));return n===!1?r:n===``?r.join(``):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(mt(this,e))return K(this,e)},getLineNumber:function(e){return ft(e)},getLineHandleVisualStart:function(e){return typeof e==`number`&&(e=K(this,e)),sn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Y(this,e)},getCursor:function(e){var t=this.sel.primary();return e==null||e==`head`?t.head:e==`anchor`?t.anchor:e==`end`||e==`to`||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Vi(function(e,t,n){Ga(this,Y(this,typeof e==`number`?q(e,t||0):e),null,n)}),setSelection:Vi(function(e,t,n){Ga(this,Y(this,e),Y(this,t||e),n)}),extendSelection:Vi(function(e,t,n){Ha(this,Y(this,e),t&&Y(this,t),n)}),extendSelections:Vi(function(e,t){Ua(this,St(this,e),t)}),extendSelectionsBy:Vi(function(e,t){var n=fe(this.sel.ranges,e);Ua(this,St(this,n),t)}),setSelections:Vi(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new fa(Y(this,e[i].anchor),Y(this,e[i].head||e[i].anchor));t??=Math.min(e.length-1,this.sel.primIndex),Ja(this,pa(this.cm,r,t),n)}}),addSelection:Vi(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new fa(Y(this,e),Y(this,t||e))),Ja(this,pa(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=lt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=lt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||`+input`)},replaceSelections:Vi(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var s=t&&t!=`end`&&ya(this,r,t),c=r.length-1;c>=0;c--)ro(this,r[c]);s?qa(this,s):this.cm&&hi(this.cm)}),undo:Vi(function(){ao(this,`undo`)}),redo:Vi(function(){ao(this,`redo`)}),undoSelection:Vi(function(){ao(this,`undo`,!0)}),redoSelection:Vi(function(){ao(this,`redo`,!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Oa(this.history),wa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ba(this.history.done),undone:Ba(this.history.undone)}},setHistory:function(e){var t=this.history=new Oa(this.history);t.done=Ba(e.done.slice(0),null,!0),t.undone=Ba(e.undone.slice(0),null,!0)},setGutterMarker:Vi(function(e,t,n){return mo(this,e,`gutter`,function(e){var r=e.gutterMarkers||={};return r[t]=n,!n&&ve(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Vi(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&mo(t,n,`gutter`,function(){return n.gutterMarkers[e]=null,ve(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e==`number`){if(!mt(this,e)||(t=e,e=K(this,e),!e))return null}else if(t=ft(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Vi(function(e,t,n){return mo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`;if(!e[r])e[r]=n;else if(T(n).test(e[r]))return!1;else e[r]+=` `+n;return!0})}),removeLineClass:Vi(function(e,t,n){return mo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`,i=e[r];if(!i)return!1;if(n==null)e[r]=null;else{var a=i.match(T(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(!a.index||o==i.length?``:` `)+i.slice(o)||null}return!0})}),addLineWidget:Vi(function(e,t,n){return yo(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return So(this,Y(this,e),Y(this,t),n,n&&n.type||`range`)},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Y(this,e),So(this,e,e,n,`bookmark`)},findMarksAt:function(e){e=Y(this,e);var t=[],n=K(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Y(this,e),t=Y(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var c=o[s];!(c.to!=null&&i==e.line&&e.ch>=c.to||c.from==null&&i!=e.line||c.from!=null&&i==t.line&&c.from>=t.ch)&&(!n||n(c.marker))&&r.push(c.marker.parent||c.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),Y(this,q(n,t))},indexFromPos:function(e){e=Y(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new ko(ut(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||={};var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new ko(ut(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||=[]).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Eo(r,To(this)),r},unlinkDoc:function(e){if(e instanceof Us&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Do(To(this));break}}if(e.history==this.history){var n=[e.id];wa(e,function(e){return n.push(e.id)},!0),e.history=new Oa(null),e.history.done=Ba(this.history.done,n),e.history.undone=Ba(this.history.undone,n)}},iterLinkedDocs:function(e){wa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ke(e)},lineSeparator:function(){return this.lineSep||`
55
+ `},setDirection:Vi(function(e){e!=`rtl`&&(e=`ltr`),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Da(this.cm))})}),ko.prototype.eachLine=ko.prototype.iter;var Ao=0;function jo(e){var t=this;if(Po(t),!(je(t,e)||Qn(t.display,e))){Fe(e),o&&(Ao=+new Date);var n=Ur(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly())){if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),s=0,c=function(){++s==i&&zi(t,function(){n=Y(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(a.filter(function(e){return e!=null}).join(t.doc.lineSeparator())),origin:`paste`};ro(t.doc,e),qa(t.doc,ma(Y(t.doc,n),Y(t.doc,ha(e))))})()},l=function(e,n){if(t.options.allowDropFileTypes&&R(t.options.allowDropFileTypes,e.type)==-1){c();return}var r=new FileReader;r.onerror=function(){return c()},r.onload=function(){var e=r.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){c();return}a[n]=e,c()},r.readAsText(e)},u=0;u<r.length;u++)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData(`Text`);if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Ya(t.doc,ma(n,n)),f)for(var p=0;p<f.length;++p)lo(t.doc,``,f[p].anchor,f[p].head,`drag`);t.replaceSelection(d,`around`,`paste`),t.display.input.focus()}}catch{}}}}}function Mo(e,t){if(o&&(!e.state.draggingText||+new Date-Ao<100)){Re(t);return}if(!(je(e,t)||Qn(e.display,t))&&(t.dataTransfer.setData(`Text`,e.getSelection()),t.dataTransfer.effectAllowed=`copyMove`,t.dataTransfer.setDragImage&&!p)){var n=O(`img`,null,null,`position: fixed; left: 0; top: 0;`);n.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`,f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}function No(e,t){var n=Ur(e,t);if(n){var r=document.createDocumentFragment();$r(e,n,r),e.display.dragCursor||(e.display.dragCursor=O(`div`,null,`CodeMirror-cursors CodeMirror-dragcursors`),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),D(e.display.dragCursor,r)}}function Po(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Fo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName(`CodeMirror`),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}var Io=!1;function Lo(){Io||=(Ro(),!0)}function Ro(){var e;G(window,`resize`,function(){e??=setTimeout(function(){e=null,Fo(zo)},100)}),G(window,`blur`,function(){return Fo(oi)})}function zo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Bo={3:`Pause`,8:`Backspace`,9:`Tab`,13:`Enter`,16:`Shift`,17:`Ctrl`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Esc`,32:`Space`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,44:`PrintScrn`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Mod`,92:`Mod`,93:`Mod`,106:`*`,107:`=`,109:`-`,110:`.`,111:`/`,145:`ScrollLock`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`,224:`Mod`,63232:`Up`,63233:`Down`,63234:`Left`,63235:`Right`,63272:`Delete`,63273:`Home`,63275:`End`,63276:`PageUp`,63277:`PageDown`,63302:`Insert`},Vo=0;Vo<10;Vo++)Bo[Vo+48]=Bo[Vo+96]=String(Vo);for(var Ho=65;Ho<=90;Ho++)Bo[Ho]=String.fromCharCode(Ho);for(var Uo=1;Uo<=12;Uo++)Bo[Uo+111]=Bo[Uo+63235]=`F`+Uo;var Wo={};Wo.basic={Left:`goCharLeft`,Right:`goCharRight`,Up:`goLineUp`,Down:`goLineDown`,End:`goLineEnd`,Home:`goLineStartSmart`,PageUp:`goPageUp`,PageDown:`goPageDown`,Delete:`delCharAfter`,Backspace:`delCharBefore`,"Shift-Backspace":`delCharBefore`,Tab:`defaultTab`,"Shift-Tab":`indentAuto`,Enter:`newlineAndIndent`,Insert:`toggleOverwrite`,Esc:`singleSelection`},Wo.pcDefault={"Ctrl-A":`selectAll`,"Ctrl-D":`deleteLine`,"Ctrl-Z":`undo`,"Shift-Ctrl-Z":`redo`,"Ctrl-Y":`redo`,"Ctrl-Home":`goDocStart`,"Ctrl-End":`goDocEnd`,"Ctrl-Up":`goLineUp`,"Ctrl-Down":`goLineDown`,"Ctrl-Left":`goGroupLeft`,"Ctrl-Right":`goGroupRight`,"Alt-Left":`goLineStart`,"Alt-Right":`goLineEnd`,"Ctrl-Backspace":`delGroupBefore`,"Ctrl-Delete":`delGroupAfter`,"Ctrl-S":`save`,"Ctrl-F":`find`,"Ctrl-G":`findNext`,"Shift-Ctrl-G":`findPrev`,"Shift-Ctrl-F":`replace`,"Shift-Ctrl-R":`replaceAll`,"Ctrl-[":`indentLess`,"Ctrl-]":`indentMore`,"Ctrl-U":`undoSelection`,"Shift-Ctrl-U":`redoSelection`,"Alt-U":`redoSelection`,fallthrough:`basic`},Wo.emacsy={"Ctrl-F":`goCharRight`,"Ctrl-B":`goCharLeft`,"Ctrl-P":`goLineUp`,"Ctrl-N":`goLineDown`,"Ctrl-A":`goLineStart`,"Ctrl-E":`goLineEnd`,"Ctrl-V":`goPageDown`,"Shift-Ctrl-V":`goPageUp`,"Ctrl-D":`delCharAfter`,"Ctrl-H":`delCharBefore`,"Alt-Backspace":`delWordBefore`,"Ctrl-K":`killLine`,"Ctrl-T":`transposeChars`,"Ctrl-O":`openLine`},Wo.macDefault={"Cmd-A":`selectAll`,"Cmd-D":`deleteLine`,"Cmd-Z":`undo`,"Shift-Cmd-Z":`redo`,"Cmd-Y":`redo`,"Cmd-Home":`goDocStart`,"Cmd-Up":`goDocStart`,"Cmd-End":`goDocEnd`,"Cmd-Down":`goDocEnd`,"Alt-Left":`goGroupLeft`,"Alt-Right":`goGroupRight`,"Cmd-Left":`goLineLeft`,"Cmd-Right":`goLineRight`,"Alt-Backspace":`delGroupBefore`,"Ctrl-Alt-Backspace":`delGroupAfter`,"Alt-Delete":`delGroupAfter`,"Cmd-S":`save`,"Cmd-F":`find`,"Cmd-G":`findNext`,"Shift-Cmd-G":`findPrev`,"Cmd-Alt-F":`replace`,"Shift-Cmd-Alt-F":`replaceAll`,"Cmd-[":`indentLess`,"Cmd-]":`indentMore`,"Cmd-Backspace":`delWrappedLineLeft`,"Cmd-Delete":`delWrappedLineRight`,"Cmd-U":`undoSelection`,"Shift-Cmd-U":`redoSelection`,"Ctrl-Up":`goDocStart`,"Ctrl-Down":`goDocEnd`,fallthrough:[`basic`,`emacsy`]},Wo.default=y?Wo.macDefault:Wo.pcDefault;function Go(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw Error(`Unrecognized modifier name: `+s)}return n&&(e=`Alt-`+e),r&&(e=`Ctrl-`+e),a&&(e=`Cmd-`+e),i&&(e=`Shift-`+e),e}function Ko(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r==`...`){delete e[n];continue}for(var i=fe(n.split(` `),Go),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(` `),o=r):(s=i.slice(0,a+1).join(` `),o=`...`);var c=t[s];if(!c)t[s]=o;else if(c!=o)throw Error(`Inconsistent bindings for `+s)}delete e[n]}for(var l in t)e[l]=t[l];return e}function qo(e,t,n,r){t=Zo(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return`nothing`;if(i===`...`)return`multi`;if(i!=null&&n(i))return`handled`;if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!=`[object Array]`)return qo(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=qo(e,t.fallthrough[a],n,r);if(o)return o}}}function Jo(e){var t=typeof e==`string`?e:Bo[e.keyCode];return t==`Ctrl`||t==`Alt`||t==`Shift`||t==`Mod`}function Yo(e,t,n){var r=e;return t.altKey&&r!=`Alt`&&(e=`Alt-`+e),(C?t.metaKey:t.ctrlKey)&&r!=`Ctrl`&&(e=`Ctrl-`+e),(C?t.ctrlKey:t.metaKey)&&r!=`Mod`&&(e=`Cmd-`+e),!n&&t.shiftKey&&r!=`Shift`&&(e=`Shift-`+e),e}function Xo(e,t){if(f&&e.keyCode==34&&e.char)return!1;var n=Bo[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Yo(n,e,t))}function Zo(e){return typeof e==`string`?Wo[e]:e}function Qo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&J(a.from,H(r).to)<=0;){var o=r.pop();if(J(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Ri(e,function(){for(var t=r.length-1;t>=0;t--)lo(e.doc,``,r[t].from,r[t].to,`+delete`);hi(e)})}function $o(e,t,n){var r=be(e.text,t+n,n);return r<0||r>e.text.length?null:r}function es(e,t,n){var r=$o(e,t.ch,n);return r==null?null:new q(t.line,r,n<0?`after`:`before`)}function ts(e,t,n,r,i){if(e){t.doc.direction==`rtl`&&(i=-i);var a=Ee(n,t.doc.direction);if(a){var o=i<0?H(a):a[0],s=i<0==(o.level==1)?`after`:`before`,c;if(o.level>0||t.doc.direction==`rtl`){var l=ur(t,n);c=i<0?n.text.length-1:0;var u=dr(t,l,c).top;c=xe(function(e){return dr(t,l,e).top==u},i<0==(o.level==1)?o.from:o.to-1,c),s==`before`&&(c=$o(n,c,1))}else c=i<0?o.to:o.from;return new q(r,c,s)}}return new q(r,i<0?n.text.length:0,i<0?`before`:`after`)}function ns(e,t,n,r){var i=Ee(t,e.doc.direction);if(!i)return es(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky=`before`):n.ch<=0&&(n.ch=0,n.sticky=`after`);var a=we(i,n.ch,n.sticky),o=i[a];if(e.doc.direction==`ltr`&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return es(t,n,r);var s=function(e,n){return $o(t,e instanceof q?e.ch:e,n)},c,l=function(n){return e.options.lineWrapping?(c||=ur(e,t),jr(e,t,c,n)):{begin:0,end:t.text.length}},u=l(n.sticky==`before`?s(n,-1):n.ch);if(e.doc.direction==`rtl`||o.level==1){var d=o.level==1==r<0,f=s(n,d?1:-1);if(f!=null&&(d?f<=o.to&&f<=u.end:f>=o.from&&f>=u.begin)){var p=d?`before`:`after`;return new q(n.line,f,p)}}var m=function(e,t,r){for(var a=function(e,t){return t?new q(n.line,s(e,1),`before`):new q(n.line,e,`after`)};e>=0&&e<i.length;e+=t){var o=i[e],c=t>0==(o.level!=1),l=c?r.begin:s(r.end,-1);if(o.from<=l&&l<o.to||(l=c?o.from:s(o.to,-1),r.begin<=l&&l<r.end))return a(l,c)}},h=m(a+r,r,u);if(h)return h;var g=r>0?u.end:s(u.begin,-1);return g!=null&&!(r>0&&g==t.text.length)&&(h=m(r>0?0:i.length-1,r,l(g)),h)?h:null}var rs={selectAll:Z,singleSelection:function(e){return e.setSelection(e.getCursor(`anchor`),e.getCursor(`head`),ce)},killLine:function(e){return Qo(e,function(t){if(t.empty()){var n=K(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:q(t.head.line+1,0)}:{from:t.head,to:q(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Qo(e,function(t){return{from:q(t.from().line,0),to:Y(e.doc,q(t.to().line+1,0))}})},delLineLeft:function(e){return Qo(e,function(e){return{from:q(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Qo(e,function(t){var n=e.charCoords(t.head,`div`).top+5;return{from:e.coordsChar({left:0,top:n},`div`),to:t.from()}})},delWrappedLineRight:function(e){return Qo(e,function(t){var n=e.charCoords(t.head,`div`).top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`);return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(q(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(q(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return is(e,t.head.line)},{origin:`+move`,bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return os(e,t.head)},{origin:`+move`,bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return as(e,t.head.line)},{origin:`+move`,bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`)},B)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:0,top:n},`div`)},B)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5,r=e.coordsChar({left:0,top:n},`div`);return r.ch<e.getLine(r.line).search(/\S/)?os(e,t.head):r},B)},goLineUp:function(e){return e.moveV(-1,`line`)},goLineDown:function(e){return e.moveV(1,`line`)},goPageUp:function(e){return e.moveV(-1,`page`)},goPageDown:function(e){return e.moveV(1,`page`)},goCharLeft:function(e){return e.moveH(-1,`char`)},goCharRight:function(e){return e.moveH(1,`char`)},goColumnLeft:function(e){return e.moveH(-1,`column`)},goColumnRight:function(e){return e.moveH(1,`column`)},goWordLeft:function(e){return e.moveH(-1,`word`)},goGroupRight:function(e){return e.moveH(1,`group`)},goGroupLeft:function(e){return e.moveH(-1,`group`)},goWordRight:function(e){return e.moveH(1,`word`)},delCharBefore:function(e){return e.deleteH(-1,`codepoint`)},delCharAfter:function(e){return e.deleteH(1,`char`)},delWordBefore:function(e){return e.deleteH(-1,`word`)},delWordAfter:function(e){return e.deleteH(1,`word`)},delGroupBefore:function(e){return e.deleteH(-1,`group`)},delGroupAfter:function(e){return e.deleteH(1,`group`)},indentAuto:function(e){return e.indentSelection(`smart`)},indentMore:function(e){return e.indentSelection(`add`)},indentLess:function(e){return e.indentSelection(`subtract`)},insertTab:function(e){return e.replaceSelection(` `)},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=I(e.getLine(a.line),a.ch,r);t.push(de(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection(`add`):e.execCommand(`insertTab`)},transposeChars:function(e){return Ri(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=K(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new q(i.line,i.ch-1)),i.ch>0)i=new q(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),q(i.line,i.ch-2),i,`+transpose`);else if(i.line>e.doc.first){var o=K(e.doc,i.line-1).text;o&&(i=new q(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),q(i.line-1,o.length-1),i,`+transpose`))}}n.push(new fa(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Ri(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,`+input`);t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);hi(e)})},openLine:function(e){return e.replaceSelection(`
56
+ `,`start`)},toggleOverwrite:function(e){return e.toggleOverwrite()}};function is(e,t){var n=K(e.doc,t),r=sn(n);return r!=n&&(t=ft(r)),ts(!0,e,r,t,1)}function as(e,t){var n=K(e.doc,t),r=cn(n);return r!=n&&(t=ft(r)),ts(!0,e,n,t,-1)}function os(e,t){var n=is(e,t.line),r=K(e.doc,n.line),i=Ee(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return q(n.line,o?0:a,n.sticky)}return n}function ss(e,t,n){if(typeof t==`string`&&(t=rs[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=z}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function cs(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=qo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&qo(t,e.options.extraKeys,n,e)||qo(t,e.options.keyMap,n,e)}var ls=new L;function us(e,t,n,r){var i=e.state.keySeq;if(i){if(Jo(t))return`handled`;if(/\'$/.test(t)?e.state.keySeq=null:ls.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ds(e,i+` `+t,n,r))return!0}return ds(e,t,n,r)}function ds(e,t,n,r){var i=cs(e,t,r);return i==`multi`&&(e.state.keySeq=t),i==`handled`&&Ln(e,`keyHandled`,e,t,n),(i==`handled`||i==`multi`)&&(Fe(n),ni(e)),!!i}function fs(e,t){var n=Xo(t,!0);return n?t.shiftKey&&!e.state.keySeq?us(e,`Shift-`+n,t,function(t){return ss(e,t,!0)})||us(e,n,t,function(t){if(typeof t==`string`?/^go[A-Z]/.test(t):t.motion)return ss(e,t)}):us(e,n,t,function(t){return ss(e,t)}):!1}function ps(e,t,n){return us(e,`'`+n+`'`,t,function(t){return ss(e,t,!0)})}var ms=null;function hs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ne(ae(t)),!je(t,e))){o&&s<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=fs(t,e);f&&(ms=i?r:null,!i&&r==88&&!Je&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection(``,null,`cut`)),n&&!y&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand(`cut`),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&gs(t)}}function gs(e){var t=e.display.lineDiv;re(t,`CodeMirror-crosshair`);function n(e){(e.keyCode==18||!e.altKey)&&(ee(t,`CodeMirror-crosshair`),ke(document,`keyup`,n),ke(document,`mouseover`,n))}G(document,`keyup`,n),G(document,`mouseover`,n)}function _s(e){e.keyCode==16&&(this.doc.sel.shift=!1),je(this,e)}function vs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Qn(t.display,e)||je(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==ms){ms=null,Fe(e);return}if(!(f&&(!e.which||e.which<10)&&fs(t,e))){var i=String.fromCharCode(r??n);i!=`\b`&&(ps(t,e,i)||t.display.input.onKeyPress(e))}}}var ys=400,bs=function(e,t,n){this.time=e,this.pos=t,this.button=n};bs.prototype.compare=function(e,t,n){return this.time+ys>e&&J(t,this.pos)==0&&n==this.button};var xs,Ss;function Cs(e,t){var n=+new Date;return Ss&&Ss.compare(n,e,t)?(xs=Ss=null,`triple`):xs&&xs.compare(n,e,t)?(Ss=new bs(n,e,t),xs=null,`double`):(xs=new bs(n,e,t),Ss=null,`single`)}function ws(e){var t=this,n=t.display;if(!(je(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Qn(n,e)){c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Ns(t,e)){var r=Ur(t,e),i=Be(e),a=r?Cs(r,i):`single`;N(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ts(t,i,r,a,e))&&(i==1?r?Ds(t,r,a,e):ze(e)==n.scroller&&Fe(e):i==2?(r&&Ha(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):ii(t)))}}}function Ts(e,t,n,r,i){var a=`Click`;return r==`double`?a=`Double`+a:r==`triple`&&(a=`Triple`+a),a=(t==1?`Left`:t==2?`Middle`:`Right`)+a,us(e,Yo(a,i),i,function(t){if(typeof t==`string`&&(t=rs[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=z}finally{e.state.suppressEdits=!1}return r})}function Es(e,t,n){var r=e.getOption(`configureMouse`),i=r?r(e,t,n):{};return i.unit??=(b?n.shiftKey&&n.metaKey:n.altKey)?`rectangle`:t==`single`?`char`:t==`double`?`word`:`line`,(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew??=y?n.metaKey:n.ctrlKey,i.moveOnDrag??=!(y?n.altKey:n.ctrlKey),i}function Ds(e,t,n,r){o?setTimeout(P(ri,e),0):e.curOp.focus=ne(ae(e));var i=Es(e,n,r),a=e.doc.sel,s;e.options.dragDrop&&Ve&&!e.isReadOnly()&&n==`single`&&(s=a.contains(t))>-1&&(J((s=a.ranges[s]).from(),t)<0||t.xRel>0)&&(J(s.to(),t)>0||t.xRel<0)?Os(e,r,t,i):As(e,r,t,i)}function Os(e,t,n,r){var i=e.display,a=!1,l=zi(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ii(e)),ke(i.wrapper.ownerDocument,`mouseup`,l),ke(i.wrapper.ownerDocument,`mousemove`,u),ke(i.scroller,`dragstart`,d),ke(i.scroller,`drop`,l),a||(Fe(t),r.addNew||Ha(e.doc,n,null,null,r.extend),c&&!p||o&&s==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),u=function(e){a||=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,G(i.wrapper.ownerDocument,`mouseup`,l),G(i.wrapper.ownerDocument,`mousemove`,u),G(i.scroller,`dragstart`,d),G(i.scroller,`drop`,l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(e,t,n){if(n==`char`)return new fa(t,t);if(n==`word`)return e.findWordAt(t);if(n==`line`)return new fa(q(t.line,0),Y(e.doc,q(t.line+1,0)));var r=n(e,t);return new fa(r.from,r.to)}function As(e,t,n,r){o&&ii(e);var i=e.display,a=e.doc;Fe(t);var s,c,l=a.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=a.sel.contains(n),s=c>-1?u[c]:new fa(n,n)):(s=a.sel.primary(),c=a.sel.primIndex),r.unit==`rectangle`)r.addNew||(s=new fa(n,n)),n=Ur(e,t,!0,!0),c=-1;else{var d=ks(e,n,r.unit);s=r.extend?Va(s,d.anchor,d.head,r.extend):d}r.addNew?c==-1?(c=u.length,Ja(a,pa(e,u.concat([s]),c),{scroll:!1,origin:`*mouse`})):u.length>1&&u[c].empty()&&r.unit==`char`&&!r.extend?(Ja(a,pa(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:`*mouse`}),l=a.sel):Wa(a,c,s,le):(c=0,Ja(a,new da([s],0),le),l=a.sel);var f=n;function p(t){if(J(f,t)!=0){if(f=t,r.unit==`rectangle`){for(var i=[],o=e.options.tabSize,u=I(K(a,n.line).text,n.ch,o),d=I(K(a,t.line).text,t.ch,o),p=Math.min(u,d),m=Math.max(u,d),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));h<=g;h++){var _=K(a,h).text,v=V(_,p,o);p==m?i.push(new fa(q(h,v),q(h,v))):_.length>v&&i.push(new fa(q(h,v),q(h,V(_,m,o))))}i.length||i.push(new fa(n,n)),Ja(a,pa(e,l.ranges.slice(0,c).concat(i),c),{origin:`*mouse`,scroll:!1}),e.scrollIntoView(t)}else{var y=s,b=ks(e,t,r.unit),x=y.anchor,S;J(b.anchor,x)>0?(S=b.head,x=yt(y.from(),b.anchor)):(S=b.anchor,x=vt(y.to(),b.head));var C=l.ranges.slice(0);C[c]=js(e,new fa(Y(a,x),S)),Ja(a,pa(e,C,c),le)}}}var m=i.wrapper.getBoundingClientRect(),h=0;function g(t){var n=++h,o=Ur(e,t,!0,r.unit==`rectangle`);if(o){if(J(o,f)!=0){e.curOp.focus=ne(ae(e)),p(o);var s=li(i,a);(o.line>=s.to||o.line<s.from)&&setTimeout(zi(e,function(){h==n&&g(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(zi(e,function(){h==n&&(i.scroller.scrollTop+=c,g(t))}),50)}}}function _(t){e.state.selectingText=!1,h=1/0,t&&(Fe(t),i.input.focus()),ke(i.wrapper.ownerDocument,`mousemove`,v),ke(i.wrapper.ownerDocument,`mouseup`,y),a.history.lastSelOrigin=null}var v=zi(e,function(e){e.buttons===0||!Be(e)?_(e):g(e)}),y=zi(e,_);e.state.selectingText=y,G(i.wrapper.ownerDocument,`mousemove`,v),G(i.wrapper.ownerDocument,`mouseup`,y)}function js(e,t){var n=t.anchor,r=t.head,i=K(e.doc,n.line);if(J(n,r)==0&&n.sticky==r.sticky)return t;var a=Ee(i);if(!a)return t;var o=we(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return t;var c=o+(s.from==n.ch==(s.level!=1)?0:1);if(c==0||c==a.length)return t;var l;if(r.line!=n.line)l=(r.line-n.line)*(e.doc.direction==`ltr`?1:-1)>0;else{var u=we(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(s.level==1?-1:1);l=u==c-1||u==c?d<0:d>0}var f=a[c+(l?-1:0)],p=l==(f.level==1),m=p?f.from:f.to,h=p?`after`:`before`;return n.ch==m&&n.sticky==h?t:new fa(new q(n.line,m,h),r)}function Ms(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Fe(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!Ne(e,n))return Le(t);a-=s.top-o.viewOffset;for(var c=0;c<e.display.gutterSpecs.length;++c){var l=o.gutters.childNodes[c];if(l&&l.getBoundingClientRect().right>=i){var u=pt(e.doc,a),d=e.display.gutterSpecs[c];return Ae(e,n,e,u,d.className,t),Le(t)}}}function Ns(e,t){return Ms(e,t,`gutterClick`,!0)}function Ps(e,t){Qn(e.display,t)||Fs(e,t)||je(e,t,`contextmenu`)||w||e.display.input.onContextMenu(t)}function Fs(e,t){return Ne(e,`gutterContextMenu`)?Ms(e,t,`gutterContextMenu`,!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,``)+e.options.theme.replace(/(^|\s)\s*/g,` cm-s-`),yr(e)}var Ls={toString:function(){return`CodeMirror.Init`}},Rs={},zs={};function Bs(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=Ls&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ls,n(`value`,``,function(e,t){return e.setValue(t)},!0),n(`mode`,null,function(e,t){e.doc.modeOption=t,ba(e)},!0),n(`indentUnit`,2,ba,!0),n(`indentWithTabs`,!1),n(`smartIndent`,!0),n(`tabSize`,4,function(e){xa(e),yr(e),Gr(e)},!0),n(`lineSeparator`,null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(a==-1)break;i=a+t.length,n.push(q(r,a))}r++});for(var i=n.length-1;i>=0;i--)lo(e.doc,t,n[i],q(n[i].line,n[i].ch+t.length))}}),n(`specialChars`,/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=RegExp(t.source+(t.test(` `)?``:`| `),`g`),n!=Ls&&e.refresh()}),n(`specialCharPlaceholder`,wn,function(e){return e.refresh()},!0),n(`electricChars`,!0),n(`inputStyle`,v?`contenteditable`:`textarea`,function(){throw Error(`inputStyle can not (yet) be changed in a running editor`)},!0),n(`spellcheck`,!1,function(e,t){return e.getInputField().spellcheck=t},!0),n(`autocorrect`,!1,function(e,t){return e.getInputField().autocorrect=t},!0),n(`autocapitalize`,!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n(`rtlMoveVisually`,!x),n(`wholeLineUpdateBefore`,!0),n(`theme`,`default`,function(e){Is(e),ia(e)},!0),n(`keyMap`,`default`,function(e,t,n){var r=Zo(t),i=n!=Ls&&Zo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n(`extraKeys`,null),n(`configureMouse`,null),n(`lineWrapping`,!1,Hs,!0),n(`gutters`,[],function(e,t){e.display.gutterSpecs=na(t,e.options.lineNumbers),ia(e)},!0),n(`fixedGutter`,!0,function(e,t){e.display.gutters.style.left=t?Br(e.display)+`px`:`0`,e.refresh()},!0),n(`coverGutterNextToScrollbar`,!1,function(e){return Ti(e)},!0),n(`scrollbarStyle`,`native`,function(e){Oi(e),Ti(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n(`lineNumbers`,!1,function(e,t){e.display.gutterSpecs=na(e.options.gutters,t),ia(e)},!0),n(`firstLineNumber`,1,ia,!0),n(`lineNumberFormatter`,function(e){return e},ia,!0),n(`showCursorWhenSelecting`,!1,Zr,!0),n(`resetSelectionOnContextMenu`,!0),n(`lineWiseCopyCut`,!0),n(`pasteLinesPerSelection`,!0),n(`selectionsMayTouch`,!1),n(`readOnly`,!1,function(e,t){t==`nocursor`&&(oi(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n(`screenReaderLabel`,null,function(e,t){t=t===``?null:t,e.display.input.screenReaderLabelChanged(t)}),n(`disableInput`,!1,function(e,t){t||e.display.input.reset()},!0),n(`dragDrop`,!0,Vs),n(`allowDropFileTypes`,null),n(`cursorBlinkRate`,530),n(`cursorScrollMargin`,0),n(`cursorHeight`,1,Zr,!0),n(`singleCursorHeightPerLine`,!0,Zr,!0),n(`workTime`,100),n(`workDelay`,100),n(`flattenSpans`,!0,xa,!0),n(`addModeClass`,!1,xa,!0),n(`pollInterval`,100),n(`undoDepth`,200,function(e,t){return e.doc.history.undoDepth=t}),n(`historyEventDelay`,1250),n(`viewportMargin`,10,function(e){return e.refresh()},!0),n(`maxHighlightLength`,1e4,xa,!0),n(`moveInputWithCursor`,!0,function(e,t){t||e.display.input.resetPosition()}),n(`tabindex`,null,function(e,t){return e.display.input.getField().tabIndex=t||``}),n(`autofocus`,null),n(`direction`,`ltr`,function(e,t){return e.doc.setDirection(t)},!0),n(`phrases`,null)}function Vs(e,t,n){if(!t!=!(n&&n!=Ls)){var r=e.display.dragFunctions,i=t?G:ke;i(e.display.scroller,`dragstart`,r.start),i(e.display.scroller,`dragenter`,r.enter),i(e.display.scroller,`dragover`,r.over),i(e.display.scroller,`dragleave`,r.leave),i(e.display.scroller,`drop`,r.drop)}}function Hs(e){e.options.lineWrapping?(re(e.display.wrapper,`CodeMirror-wrap`),e.display.sizer.style.minWidth=``,e.display.sizerWidth=null):(ee(e.display.wrapper,`CodeMirror-wrap`),gn(e)),Hr(e),Gr(e),yr(e),setTimeout(function(){return Ti(e)},100)}function Us(e,t){var n=this;if(!(this instanceof Us))return new Us(e,t);this.options=t=t?F(t):{},F(Rs,t,!1);var r=t.value;typeof r==`string`?r=new ko(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Us.inputStyles[t.inputStyle](this),a=this.display=new aa(e,r,i,t);for(var l in a.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=` CodeMirror-wrap`),Oi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new L,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ws(this),Lo(),Ai(this),this.curOp.forceUpdate=!0,Ta(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ai(n)},20):oi(this),zs)zs.hasOwnProperty(l)&&zs[l](this,t[l],Ls);ta(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Gs.length;++u)Gs[u](this);ji(this),c&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering==`optimizelegibility`&&(a.lineDiv.style.textRendering=`auto`)}Us.defaults=Rs,Us.optionHandlers=zs;function Ws(e){var t=e.display;G(t.scroller,`mousedown`,zi(e,ws)),o&&s<11?G(t.scroller,`dblclick`,zi(e,function(t){if(!je(e,t)){var n=Ur(e,t);if(!(!n||Ns(e,t)||Qn(e.display,t))){Fe(t);var r=e.findWordAt(n);Ha(e.doc,r.anchor,r.head)}}})):G(t.scroller,`dblclick`,function(t){return je(e,t)||Fe(t)}),G(t.scroller,`contextmenu`,function(t){return Ps(e,t)}),G(t.input.getField(),`contextmenu`,function(n){t.scroller.contains(n.target)||Ps(e,n)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function c(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}G(t.scroller,`touchstart`,function(i){if(!je(e,i)&&!a(i)&&!Ns(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),G(t.scroller,`touchmove`,function(){t.activeTouch&&(t.activeTouch.moved=!0)}),G(t.scroller,`touchend`,function(n){var r=t.activeTouch;if(r&&!Qn(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var a=e.coordsChar(t.activeTouch,`page`),o=!r.prev||c(r,r.prev)?new fa(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new fa(q(a.line,0),Y(e.doc,q(a.line+1,0)));e.setSelection(o.anchor,o.head),e.focus(),Fe(n)}i()}),G(t.scroller,`touchcancel`,i),G(t.scroller,`scroll`,function(){t.scroller.clientHeight&&(bi(e,t.scroller.scrollTop),Si(e,t.scroller.scrollLeft,!0),Ae(e,`scroll`,e))}),G(t.scroller,`mousewheel`,function(t){return ua(e,t)}),G(t.scroller,`DOMMouseScroll`,function(t){return ua(e,t)}),G(t.wrapper,`scroll`,function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){je(e,t)||Re(t)},over:function(t){je(e,t)||(No(e,t),Re(t))},start:function(t){return Mo(e,t)},drop:zi(e,jo),leave:function(t){je(e,t)||Po(e)}};var l=t.input.getField();G(l,`keyup`,function(t){return _s.call(e,t)}),G(l,`keydown`,zi(e,hs)),G(l,`keypress`,zi(e,vs)),G(l,`focus`,function(t){return ai(e,t)}),G(l,`blur`,function(t){return oi(e,t)})}var Gs=[];Us.defineInitHook=function(e){return Gs.push(e)};function Ks(e,t,n,r){var i=e.doc,a;n??=`add`,n==`smart`&&(i.mode.indent?a=Dt(e,t).state:n=`prev`);var o=e.options.tabSize,s=K(i,t),c=I(s.text,null,o);s.stateAfter&&=null;var l=s.text.match(/^\s*/)[0],u;if(!r&&!/\S/.test(s.text))u=0,n=`not`;else if(n==`smart`&&(u=i.mode.indent(a,s.text.slice(l.length),s.text),u==z||u>150)){if(!r)return;n=`prev`}n==`prev`?u=t>i.first?I(K(i,t-1).text,null,o):0:n==`add`?u=c+e.options.indentUnit:n==`subtract`?u=c-e.options.indentUnit:typeof n==`number`&&(u=c+n),u=Math.max(0,u);var d=``,f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)f+=o,d+=` `;if(f<u&&(d+=de(u-f)),d!=l)return lo(i,d,q(t,0),q(t,l.length),`+input`),s.stateAfter=null,!0;for(var m=0;m<i.sel.ranges.length;m++){var h=i.sel.ranges[m];if(h.head.line==t&&h.head.ch<l.length){var g=q(t,l.length);Wa(i,m,new fa(g,g));break}}}var qs=null;function Js(e){qs=e}function Ys(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||=a.sel;var o=new Date-200,s=i==`paste`||e.state.pasteIncoming>o,c=Ke(t),l=null;if(s&&r.ranges.length>1){if(qs&&qs.text.join(`
57
+ `)==t){if(r.ranges.length%qs.text.length==0){l=[];for(var u=0;u<qs.text.length;u++)l.push(a.splitLines(qs.text[u]))}}else c.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(l=fe(c,function(e){return[e]}))}for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],m=p.from(),h=p.to();p.empty()&&(n&&n>0?m=q(m.line,m.ch-n):e.state.overwrite&&!s?h=q(h.line,Math.min(K(a,h.line).text.length,h.ch+H(c).length)):s&&qs&&qs.lineWise&&qs.text.join(`
58
+ `)==c.join(`
59
+ `)&&(m=h=q(m.line,0)));var g={from:m,to:h,text:l?l[f%l.length]:c,origin:i||(s?`paste`:e.state.cutIncoming>o?`cut`:`+input`)};ro(e.doc,g),Ln(e,`inputRead`,e,g)}t&&!s&&Zs(e,t),hi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Xs(e,t){var n=e.clipboardData&&e.clipboardData.getData(`Text`);if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Ri(t,function(){return Ys(t,n,0,null,`paste`)}),!0}function Zs(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=Ks(e,i.head.line,`smart`);break}}else a.electricInput&&a.electricInput.test(K(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Ks(e,i.head.line,`smart`));o&&Ln(e,`electricInput`,e,i.head.line)}}}function Qs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:q(i,0),head:q(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function $s(e,t,n,r){e.setAttribute(`autocorrect`,n?`on`:`off`),e.setAttribute(`autocapitalize`,r?`on`:`off`),e.setAttribute(`spellcheck`,!!t)}function ec(){var e=O(`textarea`,null,null,`position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none`),t=O(`div`,[e],null,`overflow: hidden; position: relative; width: 3px; height: 0px;`);return c?e.style.width=`1000px`:e.setAttribute(`wrap`,`off`),g&&(e.style.border=`1px solid black`),t}function tc(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){N(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];(r[e]!=n||e==`mode`)&&(r[e]=n,t.hasOwnProperty(e)&&zi(this,t[e])(this,n,i),Ae(this,`optionChange`,this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?`push`:`unshift`](Zo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Bi(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw Error(`Overlays may not be stateful.`);pe(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Gr(this)}),removeOverlay:Bi(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||typeof e==`string`&&r.name==e){t.splice(n,1),this.state.modeGen++,Gr(this);return}}}),indentLine:Bi(function(e,t,n){typeof t!=`string`&&typeof t!=`number`&&(t=t==null?this.options.smartIndent?`smart`:`prev`:t?`add`:`subtract`),mt(this.doc,e)&&Ks(this,e,t,n)}),indentSelection:Bi(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Ks(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&hi(this));else{var a=i.from(),o=i.to(),s=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-+!o.ch)+1;for(var c=s;c<n;++c)Ks(this,c,e);var l=this.doc.sel.ranges;a.ch==0&&t.length==l.length&&l[r].from().ch>0&&Wa(this.doc,r,new fa(a,l[r].to()),ce)}}}),getTokenAt:function(e,t){return Mt(this,e,t)},getLineTokens:function(e,t){return Mt(this,q(e),t,!0)},getTokenTypeAt:function(e){e=Y(this.doc,e);var t=Et(this,K(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,a;if(i==0)a=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else if(t[o*2+1]<i)n=o+1;else{a=t[o*2+2];break}}var s=a?a.indexOf(`overlay `):-1;return s<0?a:s==0?null:a.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],a=this.getModeAt(e);if(typeof a[t]==`string`)i[a[t]]&&r.push(i[a[t]]);else if(a[t])for(var o=0;o<a[t].length;o++){var s=i[a[t][o]];s&&r.push(s)}else a.helperType&&i[a.helperType]?r.push(i[a.helperType]):i[a.name]&&r.push(i[a.name]);for(var c=0;c<i._global.length;c++){var l=i._global[c];l.pred(a,this)&&R(r,l.val)==-1&&r.push(l.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=bt(n,e??n.first+n.size-1),Dt(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=e==null?r.head:typeof e==`object`?Y(this.doc,e):e?r.from():r.to(),Er(this,n,t||`page`)},charCoords:function(e,t){return Tr(this,Y(this.doc,e),t||`page`)},coordsChar:function(e,t){return e=wr(this,e,t||`page`),kr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=wr(this,{top:e,left:0},t||`page`).top,pt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r=!1,i;if(typeof e==`number`){var a=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>a&&(e=a,r=!0),i=K(this.doc,e)}else i=e;return Cr(this,i,{top:0,left:0},t||`page`,n||r).top+(r?this.doc.height-mn(i):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var a=this.display;e=Er(this,Y(this.doc,e));var o=e.bottom,s=e.left;if(t.style.position=`absolute`,t.setAttribute(`cm-ignore-events`,`true`),this.display.input.setUneditable(t),a.sizer.appendChild(t),r==`over`)o=e.top;else if(r==`above`||r==`near`){var c=Math.max(a.wrapper.clientHeight,this.doc.height),l=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);(r==`above`||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(o=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=o+`px`,t.style.left=t.style.right=``,i==`right`?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right=`0px`):(i==`left`?s=0:i==`middle`&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+`px`),n&&fi(this,{left:s,top:o,right:s+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:Bi(hs),triggerOnKeyPress:Bi(vs),triggerOnKeyUp:_s,triggerOnMouseDown:Bi(ws),execCommand:function(e){if(rs.hasOwnProperty(e))return rs[e].call(null,this)},triggerElectric:Bi(function(e){Zs(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var a=Y(this.doc,e),o=0;o<t&&(a=nc(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Bi(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?nc(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},B)}),deleteH:Bi(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection(``,null,`+delete`):Qo(this,function(n){var i=nc(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,a=r;t<0&&(i=-1,t=-t);for(var o=Y(this.doc,e),s=0;s<t;++s){var c=Er(this,o,`div`);if(a==null?a=c.left:c.left=a,o=rc(this,c,i,n),o.hitSide)break}return o},moveV:Bi(function(e,t){var n=this,r=this.doc,i=[],a=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(o){if(a)return e<0?o.from():o.to();var s=Er(n,o.head,`div`);o.goalColumn!=null&&(s.left=o.goalColumn),i.push(s.left);var c=rc(n,s,e,t);return t==`page`&&o==r.sel.primary()&&mi(n,Tr(n,c,`div`).top-s.top),c},B),i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]}),findWordAt:function(e){var t=this.doc,n=K(t,e.line).text,r=e.ch,i=e.ch;if(n){var a=this.getHelper(e,`wordChars`);(e.sticky==`before`||i==n.length)&&r?--r:++i;for(var o=n.charAt(r),s=_e(o,a)?function(e){return _e(e,a)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!_e(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new fa(q(e.line,r),q(e.line,i))},toggleOverwrite:function(e){(e==null||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?re(this.display.cursorDiv,`CodeMirror-overwrite`):ee(this.display.cursorDiv,`CodeMirror-overwrite`),Ae(this,`overwriteToggle`,this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ne(ae(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bi(function(e,t){gi(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-nr(this)-this.display.barHeight,width:e.scrollWidth-nr(this)-this.display.barWidth,clientHeight:ir(this),clientWidth:rr(this)}},scrollIntoView:Bi(function(e,t){e==null?(e={from:this.doc.sel.primary().head,to:null},t??=this.options.cursorScrollMargin):typeof e==`number`?e={from:q(e,0),to:null}:e.from??(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,e.from.line==null?yi(this,e.from,e.to,e.margin):_i(this,e)}),setSize:Bi(function(e,t){var n=this,r=function(e){return typeof e==`number`||/^\d+$/.test(String(e))?e+`px`:e};e!=null&&(this.display.wrapper.style.width=r(e)),t!=null&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&vr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Kr(n,i,`widget`);break}}++i}),this.curOp.forceUpdate=!0,Ae(this,`refresh`,this)}),operation:function(e){return Ri(this,e)},startOperation:function(){return Ai(this)},endOperation:function(){return ji(this)},refresh:Bi(function(){var e=this.display.cachedTextHeight;Gr(this),this.curOp.forceUpdate=!0,yr(this),gi(this,this.doc.scrollLeft,this.doc.scrollTop),Qi(this.display),(e==null||Math.abs(e-Lr(this.display))>.5||this.options.lineWrapping)&&Hr(this),Ae(this,`refresh`,this)}),swapDoc:Bi(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ta(this,e),yr(this),this.display.input.reset(),gi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ln(this,`swapDoc`,this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Pe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,a){e.registerHelper(t,r,a),n[t]._global.push({pred:i,val:a})}}function nc(e,t,n,r,i){var a=t,o=n,s=K(e,t.line),c=i&&e.direction==`rtl`?-n:n;function l(){var n=t.line+c;return n<e.first||n>=e.first+e.size?!1:(t=new q(n,t.ch,t.sticky),s=K(e,n))}function u(a){var o;if(r==`codepoint`){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))o=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;o=new q(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else o=i?ns(e.cm,s,t,n):es(s,t,n);if(o==null){if(!a&&l())t=ts(i,e.cm,s,t.line,c);else return!1}else t=o;return!0}if(r==`char`||r==`codepoint`)u();else if(r==`column`)u(!0);else if(r==`word`||r==`group`)for(var d=null,f=r==`group`,p=e.cm&&e.cm.getHelper(t,`wordChars`),m=!0;!(n<0&&!u(!m));m=!1){var h=s.text.charAt(t.ch)||`
60
+ `,g=_e(h,p)?`w`:f&&h==`
61
+ `?`n`:!f||/\s/.test(h)?null:`p`;if(f&&!m&&!g&&(g=`s`),d&&d!=g){n<0&&(n=1,u(),t.sticky=`after`);break}if(g&&(d=g),n>0&&!u(!m))break}var _=eo(e,t,a,o,!0);return gt(a,_)&&(_.hitSide=!0),_}function rc(e,t,n,r){var i=e.doc,a=t.left,o;if(r==`page`){var s=Math.min(e.display.wrapper.clientHeight,N(e).innerHeight||i(e).documentElement.clientHeight),c=Math.max(s-.5*Lr(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else r==`line`&&(o=n>0?t.bottom+3:t.top-3);for(var l;l=kr(e,a,o),l.outside;){if(n<0?o<=0:o>=i.height){l.hitSide=!0;break}o+=n*5}return l}var ic=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new L,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ic.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,$s(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}G(i,`paste`,function(e){!a(e)||je(r,e)||Xs(e,r)||s<=11&&setTimeout(zi(r,function(){return t.updateFromDOM()}),20)}),G(i,`compositionstart`,function(e){t.composing={data:e.data,done:!1}}),G(i,`compositionupdate`,function(e){t.composing||={data:e.data,done:!1}}),G(i,`compositionend`,function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),G(i,`touchstart`,function(){return n.forceCompositionEnd()}),G(i,`input`,function(){t.composing||t.readFromDOMSoon()});function o(e){if(!(!a(e)||je(r,e))){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()}),e.type==`cut`&&r.replaceSelection(``,null,`cut`);else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`&&r.operation(function(){r.setSelections(t.ranges,0,ce),r.replaceSelection(``,null,`cut`)})}else return;if(e.clipboardData){e.clipboardData.clearData();var o=qs.text.join(`
62
+ `);if(e.clipboardData.setData(`Text`,o),e.clipboardData.getData(`Text`)==o){e.preventDefault();return}}var s=ec(),c=s.firstChild;$s(c),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),c.value=qs.text.join(`
63
+ `);var l=ne(oe(i));j(c),setTimeout(function(){r.display.lineSpace.removeChild(s),l.focus(),l==i&&n.showPrimarySelection()},50)}}G(i,`copy`,o),G(i,`cut`,o)},ic.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute(`aria-label`,e):this.div.removeAttribute(`aria-label`)},ic.prototype.prepareSelection=function(){var e=Qr(this.cm,!1);return e.focus=ne(oe(this.div))==this.div,e},ic.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ic.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ic.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var o=lc(t,e.anchorNode,e.anchorOffset),s=lc(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&s&&!s.bad&&J(yt(o,s),i)==0&&J(vt(o,s),a)==0)){var c=t.display.view,l=i.line>=t.display.viewFrom&&ac(t,i)||{node:c[0].measure.map[2],offset:0},u=a.line<t.display.viewTo&&ac(t,a);if(!u){var d=c[c.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!l||!u){e.removeAllRanges();return}var p=e.rangeCount&&e.getRangeAt(0),m;try{m=k(l.node,l.offset,u.offset,u.node)}catch{}m&&(!n&&t.state.focused?(e.collapse(l.node,l.offset),m.collapsed||(e.removeAllRanges(),e.addRange(m))):(e.removeAllRanges(),e.addRange(m)),p&&e.anchorNode==null?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}},ic.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},ic.prototype.showMultipleSelections=function(e){D(this.cm.display.cursorDiv,e.cursors),D(this.cm.display.selectionDiv,e.selection)},ic.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ic.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},ic.prototype.focus=function(){this.cm.options.readOnly!=`nocursor`&&((!this.selectionInEditor()||ne(oe(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ic.prototype.blur=function(){this.div.blur()},ic.prototype.getField=function(){return this.div},ic.prototype.supportsTouch=function(){return!0},ic.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Ri(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},ic.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ic.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(_&&u&&this.cm.display.gutterSpecs.length&&oc(e.anchorNode)){this.cm.triggerOnKeyDown({type:`keydown`,keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=lc(t,e.anchorNode,e.anchorOffset),r=lc(t,e.focusNode,e.focusOffset);n&&r&&Ri(t,function(){Ja(t.doc,ma(n,r),ce),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},ic.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=q(r.line-1,K(e.doc,r.line-1).length)),i.ch==K(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=q(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;r.line==t.viewFrom||(a=Wr(e,r.line))==0?(o=ft(t.view[0].line),s=t.view[0].node):(o=ft(t.view[a].line),s=t.view[a-1].node.nextSibling);var c=Wr(e,i.line),l,u;if(c==t.view.length-1?(l=t.viewTo-1,u=t.lineDiv.lastChild):(l=ft(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var d=e.doc.splitLines(cc(e,s,u,o,l)),f=lt(e.doc,q(o,0),q(l,K(e.doc,l).text.length));d.length>1&&f.length>1;)if(H(d)==H(f))d.pop(),f.pop(),l--;else if(d[0]==f[0])d.shift(),f.shift(),o++;else break;for(var p=0,m=0,h=d[0],g=f[0],_=Math.min(h.length,g.length);p<_&&h.charCodeAt(p)==g.charCodeAt(p);)++p;for(var v=H(d),y=H(f),b=Math.min(v.length-(d.length==1?p:0),y.length-(f.length==1?p:0));m<b&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)++m;if(d.length==1&&f.length==1&&o==r.line)for(;p&&p>r.ch&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)p--,m++;d[d.length-1]=v.slice(0,v.length-m).replace(/^\u200b+/,``),d[0]=d[0].slice(p).replace(/\u200b+$/,``);var x=q(o,p),S=q(l,f.length?H(f).length-m:0);if(d.length>1||d[0]||J(x,S))return lo(e.doc,d,x,S,`+input`),!0},ic.prototype.ensurePolled=function(){this.forceCompositionEnd()},ic.prototype.reset=function(){this.forceCompositionEnd()},ic.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ic.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout??=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(e.composing.done)e.composing=null;else return}e.updateFromDOM()},80)},ic.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ri(this.cm,function(){return Gr(e.cm)})},ic.prototype.setUneditable=function(e){e.contentEditable=`false`},ic.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||zi(this.cm,Ys)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},ic.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!=`nocursor`)},ic.prototype.onContextMenu=function(){},ic.prototype.resetPosition=function(){},ic.prototype.needsContentAttribute=!0;function ac(e,t){var n=lr(e,t.line);if(!n||n.hidden)return null;var r=K(e.doc,t.line),i=or(n,r,t.line),a=Ee(r,e.doc.direction),o=`left`;a&&(o=we(a,t.ch)%2?`right`:`left`);var s=pr(i.map,t.ch,o);return s.offset=s.collapse==`right`?s.end:s.start,s}function oc(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function sc(e,t){return t&&(e.bad=!0),e}function cc(e,t,n,r,i){var a=``,o=!1,s=e.doc.lineSeparator(),c=!1;function l(e){return function(t){return t.id==e}}function u(){o&&=(a+=s,c&&(a+=s),c=!1)}function d(e){e&&(u(),a+=e)}function f(t){if(t.nodeType==1){var n=t.getAttribute(`cm-text`);if(n){d(n);return}var a=t.getAttribute(`cm-marker`),p;if(a){var m=e.findMarks(q(r,0),q(i+1,0),l(+a));m.length&&(p=m[0].find(0))&&d(lt(e.doc,p.from,p.to).join(s));return}if(t.getAttribute(`contenteditable`)==`false`)return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0)return;h&&u();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(c=!0),h&&(o=!0)}else t.nodeType==3&&d(t.nodeValue.replace(/\u200b/g,``).replace(/\u00a0/g,` `))}for(;f(t),t!=n;)t=t.nextSibling,c=!1;return a}function lc(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return sc(e.clipPos(q(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return uc(a,t,n)}}function uc(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!A(r,t))return sc(q(ft(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?H(e.rest):e.line;return sc(q(ft(a),a.text.length),i)}var o=t.nodeType==3?t:null,s=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&=o.nodeValue.length);s.parentNode!=r;)s=s.parentNode;var c=e.measure,l=c.maps;function u(t,n,r){for(var i=-1;i<(l?l.length:0);i++)for(var a=i<0?c.map:l[i],o=0;o<a.length;o+=3){var s=a[o+2];if(s==t||s==n){var u=ft(i<0?e.line:e.rest[i]),d=a[o]+r;return(r<0||s!=t)&&(d=a[o+ +!!r]),q(u,d)}}}var d=u(o,s,n);if(d)return sc(d,i);for(var f=s.nextSibling,p=o?o.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0),d)return sc(q(d.line,d.ch-p),i);p+=f.textContent.length}for(var m=s.previousSibling,h=n;m;m=m.previousSibling){if(d=u(m,m.firstChild,-1),d)return sc(q(d.line,d.ch+h),i);h+=m.textContent.length}}var dc=function(e){this.cm=e,this.prevInput=``,this.pollingFast=!1,this.polling=new L,this.hasSelection=!1,this.composing=null,this.resetting=!1};dc.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width=`0px`),G(i,`input`,function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),G(i,`paste`,function(e){je(r,e)||Xs(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(e){if(!je(r,e)){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`?r.setSelections(t.ranges,null,ce):(n.prevInput=``,i.value=t.text.join(`
64
+ `),j(i))}else return;e.type==`cut`&&(r.state.cutIncoming=+new Date)}}G(i,`cut`,a),G(i,`copy`,a),G(e.scroller,`paste`,function(t){if(!(Qn(e,t)||je(r,t))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event(`paste`);a.clipboardData=t.clipboardData,i.dispatchEvent(a)}}),G(e.lineSpace,`selectstart`,function(t){Qn(e,t)||Fe(t)}),G(i,`compositionstart`,function(){var e=r.getCursor(`from`);n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor(`to`),{className:`CodeMirror-composing`})}}),G(i,`compositionend`,function(){n.composing&&=(n.poll(),n.composing.range.clear(),null)})},dc.prototype.createField=function(e){this.wrapper=ec(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;$s(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},dc.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute(`aria-label`,e):this.textarea.removeAttribute(`aria-label`)},dc.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Qr(e);if(e.options.moveInputWithCursor){var i=Er(e,n.sel.primary().head,`div`),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},dc.prototype.showSelection=function(e){var t=this.cm.display;D(t.cursorDiv,e.cursors),D(t.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+`px`,this.wrapper.style.left=e.teLeft+`px`)},dc.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput=``;var n=t.getSelection();this.textarea.value=n,t.state.focused&&j(this.textarea),o&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value=``,o&&s>=9&&(this.hasSelection=null));this.resetting=!1}},dc.prototype.getField=function(){return this.textarea},dc.prototype.supportsTouch=function(){return!1},dc.prototype.focus=function(){if(this.cm.options.readOnly!=`nocursor`&&(!v||ne(oe(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},dc.prototype.blur=function(){this.textarea.blur()},dc.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},dc.prototype.receivedFocus=function(){this.slowPoll()},dc.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},dc.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){!t.poll()&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},dc.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||qe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r=`​`),a==8666)return this.reset(),this.cm.execCommand(`undo`)}for(var c=0,l=Math.min(r.length,i.length);c<l&&r.charCodeAt(c)==i.charCodeAt(c);)++c;return Ri(t,function(){Ys(t,i.slice(c),r.length-c,null,e.composing?`*compose`:null),i.length>1e3||i.indexOf(`
65
+ `)>-1?n.value=e.prevInput=``:e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor(`to`),{className:`CodeMirror-composing`}))}),!0},dc.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},dc.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},dc.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Ur(n,e),l=r.scroller.scrollTop;if(!a||f)return;n.options.resetSelectionOnContextMenu&&n.doc.sel.contains(a)==-1&&zi(n,Ja)(n.doc,ma(a),ce);var u=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText=`position: static`,i.style.cssText=`position: absolute; width: 30px; height: 30px;
66
+ top: `+(e.clientY-p.top-5)+`px; left: `+(e.clientX-p.left-5)+`px;
67
+ z-index: 1000; background: `+(o?`rgba(255, 255, 255, .05)`:`transparent`)+`;
68
+ outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var m;c&&(m=i.ownerDocument.defaultView.scrollY),r.input.focus(),c&&i.ownerDocument.defaultView.scrollTo(null,m),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=` `),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function h(){if(i.selectionStart!=null){var e=n.somethingSelected(),a=`​`+(e?i.value:``);i.value=`⇚`,i.value=a,t.prevInput=e?``:`​`,i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!o||o&&s<9)&&h();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==`​`?zi(n,Z)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}if(o&&s>=9&&h(),w){Re(e);var _=function(){ke(window,`mouseup`,_),setTimeout(g,20)};G(window,`mouseup`,_)}else setTimeout(g,50)},dc.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e==`nocursor`,this.textarea.readOnly=!!e},dc.prototype.setUneditable=function(){},dc.prototype.needsContentAttribute=!1;function fc(e,t){if(t=t?F(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=ne(oe(e));t.autofocus=n==e||e.getAttribute(`autofocus`)!=null&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(G(e.form,`submit`,r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch{}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display=``,e.form&&(ke(e.form,`submit`,r),!t.leaveSubmitMethodAlone&&typeof e.form.submit==`function`&&(e.form.submit=i))}},e.style.display=`none`;var s=Us(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}function pc(e){e.off=ke,e.on=G,e.wheelEventPixels=la,e.Doc=ko,e.splitLines=Ke,e.countColumn=I,e.findColumn=V,e.isWordChar=ge,e.Pass=z,e.signal=Ae,e.Line=_n,e.changeEnd=ha,e.scrollbarModel=Di,e.Pos=q,e.cmpPos=J,e.modes=Ze,e.mimeModes=Qe,e.resolveMode=tt,e.getMode=nt,e.modeExtensions=rt,e.extendMode=it,e.copyState=at,e.startState=st,e.innerMode=ot,e.commands=rs,e.keyMap=Wo,e.keyName=Xo,e.isModifierKey=Jo,e.lookupKey=qo,e.normalizeKeyMap=Ko,e.StringStream=ct,e.SharedTextMarker=Co,e.TextMarker=xo,e.LineWidget=_o,e.e_preventDefault=Fe,e.e_stopPropagation=Ie,e.e_stop=Re,e.addClass=re,e.contains=A,e.rmClass=ee,e.keyNames=Bo}Bs(Us),tc(Us);var mc=`iter insert remove copy getEditor constructor`.split(` `);for(var hc in ko.prototype)ko.prototype.hasOwnProperty(hc)&&R(mc,hc)<0&&(Us.prototype[hc]=(function(e){return function(){return e.apply(this.doc,arguments)}})(ko.prototype[hc]));return Pe(ko),Us.inputStyles={textarea:dc,contenteditable:ic},Us.defineMode=function(e){!Us.defaults.mode&&e!=`null`&&(Us.defaults.mode=e),$e.apply(this,arguments)},Us.defineMIME=et,Us.defineMode(`null`,function(){return{token:function(e){return e.skipToEnd()}}}),Us.defineMIME(`text/plain`,`null`),Us.defineExtension=function(e,t){Us.prototype[e]=t},Us.defineDocExtension=function(e,t){ko.prototype[e]=t},Us.fromTextArea=fc,pc(Us),Us.version=`5.65.20`,Us}))})),rm=c(nm(),1),im=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(nm()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){var t={autoSelfClosers:{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},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{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}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode(`xml`,function(r,i){var a=r.indentUnit,o={},s=i.htmlMode?t:n;for(var c in s)o[c]=s[c];for(var c in i)o[c]=i[c];var l,u;function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return r==`<`?e.eat(`!`)?e.eat(`[`)?e.match(`CDATA[`)?n(m(`atom`,`]]>`)):null:e.match(`--`)?n(m(`comment`,`-->`)):e.match(`DOCTYPE`,!0,!0)?(e.eatWhile(/[\w\._\-]/),n(h(1))):null:e.eat(`?`)?(e.eatWhile(/[\w\._\-]/),t.tokenize=m(`meta`,`?>`),`meta`):(l=e.eat(`/`)?`closeTag`:`openTag`,t.tokenize=f,`tag bracket`):r==`&`?(e.eat(`#`)?e.eat(`x`)?e.eatWhile(/[a-fA-F\d]/)&&e.eat(`;`):e.eatWhile(/[\d]/)&&e.eat(`;`):e.eatWhile(/[\w\.\-:]/)&&e.eat(`;`))?`atom`:`error`:(e.eatWhile(/[^&<]/),null)}d.isInText=!0;function f(e,t){var n=e.next();if(n==`>`||n==`/`&&e.eat(`>`))return t.tokenize=d,l=n==`>`?`endTag`:`selfcloseTag`,`tag bracket`;if(n==`=`)return l=`equals`,null;if(n==`<`){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+` tag error`:`tag error`}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),`word`)}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return`string`};return t.isInAttribute=!0,t}function m(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e){return function(t,n){for(var r;(r=t.next())!=null;)if(r==`<`)return n.tokenize=h(e+1),n.tokenize(t,n);else if(r==`>`){if(e==1){n.tokenize=d;break}return n.tokenize=h(e-1),n.tokenize(t,n)}return`meta`}}function g(e){return e&&e.toLowerCase()}function _(e,t,n){this.prev=e.context,this.tagName=t||``,this.indent=e.indented,this.startOfLine=n,(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&=e.context.prev}function y(e,t){for(var n;;){if(!e.context||(n=e.context.tagName,!o.contextGrabbers.hasOwnProperty(g(n))||!o.contextGrabbers[g(n)].hasOwnProperty(g(t))))return;v(e)}}function b(e,t,n){return e==`openTag`?(n.tagStart=t.column(),x):e==`closeTag`?S:b}function x(e,t,n){return e==`word`?(n.tagName=t.current(),u=`tag`,T):o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,T(e,t,n)):(u=`error`,x)}function S(e,t,n){if(e==`word`){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||o.matchClosing===!1?(u=`tag`,C):(u=`tag error`,w)}return o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,C(e,t,n)):(u=`error`,w)}function C(e,t,n){return e==`endTag`?(v(n),b):(u=`error`,C)}function w(e,t,n){return u=`error`,C(e,t,n)}function T(e,t,n){if(e==`word`)return u=`attribute`,ee;if(e==`endTag`||e==`selfcloseTag`){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e==`selfcloseTag`||o.autoSelfClosers.hasOwnProperty(g(r))?y(n,r):(y(n,r),n.context=new _(n,r,i==n.indented)),b}return u=`error`,T}function ee(e,t,n){return e==`equals`?E:(o.allowMissing||(u=`error`),T(e,t,n))}function E(e,t,n){return e==`string`?D:e==`word`&&o.allowUnquoted?(u=`string`,T):(u=`error`,T(e,t,n))}function D(e,t,n){return e==`string`?D:T(e,t,n)}return{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return e!=null&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;l=null;var n=t.tokenize(e,t);return(n||l)&&n!=`comment`&&(u=null,t.state=t.state(l||n,e,t),u&&(n=u==`error`?n+` error`:u)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return o.multilineTagIndentPastTag===!1?t.tagStart+a*(o.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(o.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;i;)if(i.tagName==s[2]){i=i.prev;break}else if(o.implicitlyClosed.hasOwnProperty(g(i.tagName)))i=i.prev;else break;else if(s)for(;i;){var c=o.contextGrabbers[g(i.tagName)];if(c&&c.hasOwnProperty(g(s[2])))i=i.prev;else break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:`<!--`,blockCommentEnd:`-->`,configuration:o.htmlMode?`html`:`xml`,helperType:o.htmlMode?`html`:`xml`,skipAttribute:function(e){e.state==E&&(e.state=T)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:e.type==`closeTag`}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),e.defineMIME(`text/xml`,`xml`),e.defineMIME(`application/xml`,`xml`),e.mimeModes.hasOwnProperty(`text/html`)||e.defineMIME(`text/html`,{name:`xml`,htmlMode:!0})})})),am=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(nm()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`javascript`,function(t,n){var r=t.indentUnit,i=n.statementIndent,a=n.jsonld,o=n.json||a,s=n.trackScope!==!1,c=n.typescript,l=n.wordCharacters||/[\w$\xa1-\uffff]/,u=function(){function e(e){return{type:e,style:`keyword`}}var t=e(`keyword a`),n=e(`keyword b`),r=e(`keyword c`),i=e(`keyword d`),a=e(`operator`),o={type:`atom`,style:`atom`};return{if:e(`if`),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e(`new`),delete:r,void:r,throw:r,debugger:e(`debugger`),var:e(`var`),const:e(`var`),let:e(`var`),function:e(`function`),catch:e(`catch`),for:e(`for`),switch:e(`switch`),case:e(`case`),default:e(`default`),in:a,typeof:a,instanceof:a,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e(`this`),class:e(`class`),super:e(`atom`),yield:r,export:e(`export`),import:e(`import`),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e){for(var t=!1,n,r=!1;(n=e.next())!=null;){if(!t){if(n==`/`&&!r)return;n==`[`?r=!0:r&&n==`]`&&(r=!1)}t=!t&&n==`\\`}}var m,h;function g(e,t,n){return m=e,h=n,t}function _(e,t){var n=e.next();if(n==`"`||n==`'`)return t.tokenize=v(n),t.tokenize(e,t);if(n==`.`&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g(`number`,`number`);if(n==`.`&&e.match(`..`))return g(`spread`,`meta`);if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if(n==`=`&&e.eat(`>`))return g(`=>`,`operator`);if(n==`0`&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g(`number`,`number`);if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g(`number`,`number`);if(n==`/`)return e.eat(`*`)?(t.tokenize=y,y(e,t)):e.eat(`/`)?(e.skipToEnd(),g(`comment`,`comment`)):dt(e,t,1)?(p(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g(`regexp`,`string-2`)):(e.eat(`=`),g(`operator`,`operator`,e.current()));if(n=="`")return t.tokenize=b,b(e,t);if(n==`#`&&e.peek()==`!`)return e.skipToEnd(),g(`meta`,`meta`);if(n==`#`&&e.eatWhile(l))return g(`variable`,`property`);if(n==`<`&&e.match(`!--`)||n==`-`&&e.match(`->`)&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g(`comment`,`comment`);if(d.test(n))return(n!=`>`||!t.lexical||t.lexical.type!=`>`)&&(e.eat(`=`)?(n==`!`||n==`=`)&&e.eat(`=`):/[<>*+\-|&?]/.test(n)&&(e.eat(n),n==`>`&&e.eat(n))),n==`?`&&e.eat(`.`)?g(`.`):g(`operator`,`operator`,e.current());if(l.test(n)){e.eatWhile(l);var r=e.current();if(t.lastType!=`.`){if(u.propertyIsEnumerable(r)){var i=u[r];return g(i.type,i.style,r)}if(r==`async`&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g(`async`,`keyword`,r)}return g(`variable`,`variable`,r)}}function v(e){return function(t,n){var r=!1,i;if(a&&t.peek()==`@`&&t.match(f))return n.tokenize=_,g(`jsonld-keyword`,`meta`);for(;(i=t.next())!=null&&!(i==e&&!r);)r=!r&&i==`\\`;return r||(n.tokenize=_),g(`string`,`string`)}}function y(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=_;break}n=r==`*`}return g(`comment`,`comment`)}function b(e,t){for(var n=!1,r;(r=e.next())!=null;){if(!n&&(r=="`"||r==`$`&&e.eat(`{`))){t.tokenize=_;break}n=!n&&r==`\\`}return g(`quasi`,`string-2`,e.current())}var x=`([{}])`;function S(e,t){t.fatArrowAt&&=null;var n=e.string.indexOf(`=>`,e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,a=!1,o=n-1;o>=0;--o){var s=e.string.charAt(o),u=x.indexOf(s);if(u>=0&&u<3){if(!i){++o;break}if(--i==0){s==`(`&&(a=!0);break}}else if(u>=3&&u<6)++i;else if(l.test(s))a=!0;else if(/["'\/`]/.test(s))for(;;--o){if(o==0)return;if(e.string.charAt(o-1)==s&&e.string.charAt(o-2)!=`\\`){o--;break}}else if(a&&!i){++o;break}}a&&!i&&(t.fatArrowAt=o)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,r!=null&&(this.align=r)}function T(e,t){if(!s)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function ee(e,t,n,r,i){var a=e.cc;for(E.state=e,E.stream=i,E.marked=null,E.cc=a,E.style=t,e.lexical.hasOwnProperty(`align`)||(e.lexical.align=!0);;)if((a.length?a.pop():o?R:I)(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return E.marked?E.marked:n==`variable`&&T(e,r)?`variable-2`:t}}var E={state:null,column:null,marked:null,cc:null};function D(){for(var e=arguments.length-1;e>=0;e--)E.cc.push(arguments[e])}function O(){return D.apply(null,arguments),!0}function te(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function k(e){var t=E.state;if(E.marked=`def`,s){if(t.context){if(t.lexical.info==`var`&&t.context&&t.context.block){var r=A(e,t.context);if(r!=null){t.context=r;return}}else if(!te(e,t.localVars)){t.localVars=new ie(e,t.localVars);return}}n.globalVars&&!te(e,t.globalVars)&&(t.globalVars=new ie(e,t.globalVars))}}function A(e,t){if(!t)return null;if(t.block){var n=A(e,t.prev);return n?n==t.prev?t:new re(n,t.vars,!0):null}return te(e,t.vars)?t:new re(t.prev,new ie(e,t.vars),!1)}function ne(e){return e==`public`||e==`private`||e==`protected`||e==`abstract`||e==`readonly`}function re(e,t,n){this.prev=e,this.vars=t,this.block=n}function ie(e,t){this.name=e,this.next=t}var j=new ie(`this`,new ie(`arguments`,null));function M(){E.state.context=new re(E.state.context,E.state.localVars,!1),E.state.localVars=j}function ae(){E.state.context=new re(E.state.context,E.state.localVars,!0),E.state.localVars=null}M.lex=ae.lex=!0;function oe(){E.state.localVars=E.state.context.vars,E.state.context=E.state.context.prev}oe.lex=!0;function N(e,t){var n=function(){var n=E.state,r=n.indented;if(n.lexical.type==`stat`)r=n.lexical.indented;else for(var i=n.lexical;i&&i.type==`)`&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,E.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function P(){var e=E.state;e.lexical.prev&&(e.lexical.type==`)`&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}P.lex=!0;function F(e){function t(n){return n==e?O():e==`;`||n==`}`||n==`)`||n==`]`?D():O(t)}return t}function I(e,t){return e==`var`?O(N(`vardef`,t),Ie,F(`;`),P):e==`keyword a`?O(N(`form`),z,I,P):e==`keyword b`?O(N(`form`),I,P):e==`keyword d`?E.stream.match(/^\s*$/,!1)?O():O(N(`stat`),le,F(`;`),P):e==`debugger`?O(F(`;`)):e==`{`?O(N(`}`),ae,xe,P,oe):e==`;`?O():e==`if`?(E.state.lexical.info==`else`&&E.state.cc[E.state.cc.length-1]==P&&E.state.cc.pop()(),O(N(`form`),z,I,P,He)):e==`function`?O(Ke):e==`for`?O(N(`form`),ae,Ue,I,oe,P):e==`class`||c&&t==`interface`?(E.marked=`keyword`,O(N(`form`,e==`class`?e:t),Ze,P)):e==`variable`?c&&t==`declare`?(E.marked=`keyword`,O(I)):c&&(t==`module`||t==`enum`||t==`type`)&&E.stream.match(/^\s*\w/,!1)?(E.marked=`keyword`,t==`enum`?O(K):t==`type`?O(Je,F(`operator`),Ee,F(`;`)):O(N(`form`),Le,F(`{`),N(`}`),xe,P,P)):c&&t==`namespace`?(E.marked=`keyword`,O(N(`form`),R,I,P)):c&&t==`abstract`?(E.marked=`keyword`,O(I)):O(N(`stat`),U):e==`switch`?O(N(`form`),z,F(`{`),N(`}`,`switch`),ae,xe,P,P,oe):e==`case`?O(R,F(`:`)):e=="default"?O(F(`:`)):e==`catch`?O(N(`form`),M,L,I,P,oe):e==`export`?O(N(`stat`),tt,P):e==`import`?O(N(`stat`),rt,P):e==`async`?O(I):t==`@`?O(R,I):D(N(`stat`),R,F(`;`),P)}function L(e){if(e==`(`)return O(Ye,F(`)`))}function R(e,t){return ce(e,t,!1)}function se(e,t){return ce(e,t,!0)}function z(e){return e==`(`?O(N(`)`),le,F(`)`),P):D()}function ce(e,t,n){if(E.state.fatArrowAt==E.stream.start){var r=n?fe:H;if(e==`(`)return O(M,N(`)`),W(Ye,`)`),P,F(`=>`),r,oe);if(e==`variable`)return D(M,Le,F(`=>`),r,oe)}var i=n?V:B;return C.hasOwnProperty(e)?O(i):e==`function`?O(Ke,i):e==`class`||c&&t==`interface`?(E.marked=`keyword`,O(N(`form`),Xe,P)):e==`keyword c`||e==`async`?O(n?se:R):e==`(`?O(N(`)`),le,F(`)`),P,i):e==`operator`||e==`spread`?O(n?se:R):e==`[`?O(N(`]`),ct,P,i):e==`{`?be(_e,`}`,null,i):e==`quasi`?D(ue,i):e==`new`?O(pe(n)):O()}function le(e){return e.match(/[;\}\)\],]/)?D():D(R)}function B(e,t){return e==`,`?O(le):V(e,t,!1)}function V(e,t,n){var r=n==0?B:V,i=n==0?R:se;if(e==`=>`)return O(M,n?fe:H,oe);if(e==`operator`)return/\+\+|--/.test(t)||c&&t==`!`?O(r):c&&t==`<`&&E.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?O(N(`>`),W(Ee,`>`),P,r):t==`?`?O(R,F(`:`),i):O(i);if(e==`quasi`)return D(ue,r);if(e!=`;`){if(e==`(`)return be(se,`)`,`call`,r);if(e==`.`)return O(ge,r);if(e==`[`)return O(N(`]`),le,F(`]`),P,r);if(c&&t==`as`)return E.marked=`keyword`,O(Ee,r);if(e==`regexp`)return E.state.lastType=E.marked=`operator`,E.stream.backUp(E.stream.pos-E.stream.start-1),O(i)}}function ue(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?O(le,de):O(ue):D()}function de(e){if(e==`}`)return E.marked=`string-2`,E.state.tokenize=b,O(ue)}function H(e){return S(E.stream,E.state),D(e==`{`?I:R)}function fe(e){return S(E.stream,E.state),D(e==`{`?I:se)}function pe(e){return function(t){return t==`.`?O(e?he:me):t==`variable`&&c?O(Ne,e?V:B):D(e?se:R)}}function me(e,t){if(t==`target`)return E.marked=`keyword`,O(B)}function he(e,t){if(t==`target`)return E.marked=`keyword`,O(V)}function U(e){return e==`:`?O(P,I):D(B,F(`;`),P)}function ge(e){if(e==`variable`)return E.marked=`property`,O()}function _e(e,t){if(e==`async`)return E.marked=`property`,O(_e);if(e==`variable`||E.style==`keyword`){if(E.marked=`property`,t==`get`||t==`set`)return O(ve);var n;return c&&E.state.fatArrowAt==E.stream.start&&(n=E.stream.match(/^\s*:\s*/,!1))&&(E.state.fatArrowAt=E.stream.pos+n[0].length),O(ye)}if(e==`number`||e==`string`)return E.marked=a?`property`:E.style+` property`,O(ye);if(e==`jsonld-keyword`)return O(ye);if(c&&ne(t))return E.marked=`keyword`,O(_e);if(e==`[`)return O(R,Se,F(`]`),ye);if(e==`spread`)return O(se,ye);if(t==`*`)return E.marked=`keyword`,O(_e);if(e==`:`)return D(ye)}function ve(e){return e==`variable`?(E.marked=`property`,O(Ke)):D(ye)}function ye(e){if(e==`:`)return O(se);if(e==`(`)return D(Ke)}function W(e,t,n){function r(i,a){if(n?n.indexOf(i)>-1:i==`,`){var o=E.state.lexical;return o.info==`call`&&(o.pos=(o.pos||0)+1),O(function(n,r){return n==t||r==t?D():D(e)},r)}return i==t||a==t?O():n&&n.indexOf(`;`)>-1?D(e):O(F(t))}return function(n,i){return n==t||i==t?O():D(e,r)}}function be(e,t,n){for(var r=3;r<arguments.length;r++)E.cc.push(arguments[r]);return O(N(t,n),W(e,t),P)}function xe(e){return e==`}`?O():D(I,xe)}function Se(e,t){if(c){if(e==`:`)return O(Ee);if(t==`?`)return O(Se)}}function Ce(e,t){if(c&&(e==`:`||t==`in`))return O(Ee)}function we(e){if(c&&e==`:`)return E.stream.match(/^\s*\w+\s+is\b/,!1)?O(R,Te,Ee):O(Ee)}function Te(e,t){if(t==`is`)return E.marked=`keyword`,O()}function Ee(e,t){if(t==`keyof`||t==`typeof`||t==`infer`||t==`readonly`)return E.marked=`keyword`,O(t==`typeof`?se:Ee);if(e==`variable`||t==`void`)return E.marked=`type`,O(Me);if(t==`|`||t==`&`)return O(Ee);if(e==`string`||e==`number`||e==`atom`)return O(Me);if(e==`[`)return O(N(`]`),W(Ee,`]`,`,`),P,Me);if(e==`{`)return O(N(`}`),G,P,Me);if(e==`(`)return O(W(je,`)`),De,Me);if(e==`<`)return O(W(Ee,`>`),Ee);if(e==`quasi`)return D(ke,Me)}function De(e){if(e==`=>`)return O(Ee)}function G(e){return e.match(/[\}\)\]]/)?O():e==`,`||e==`;`?O(G):D(Oe,G)}function Oe(e,t){if(e==`variable`||E.style==`keyword`)return E.marked=`property`,O(Oe);if(t==`?`||e==`number`||e==`string`)return O(Oe);if(e==`:`)return O(Ee);if(e==`[`)return O(F(`variable`),Ce,F(`]`),Oe);if(e==`(`)return D(qe,Oe);if(!e.match(/[;\}\)\],]/))return O()}function ke(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?O(Ee,Ae):O(ke):D()}function Ae(e){if(e==`}`)return E.marked=`string-2`,E.state.tokenize=b,O(ke)}function je(e,t){return e==`variable`&&E.stream.match(/^\s*[?:]/,!1)||t==`?`?O(je):e==`:`?O(Ee):e==`spread`?O(je):D(Ee)}function Me(e,t){if(t==`<`)return O(N(`>`),W(Ee,`>`),P,Me);if(t==`|`||e==`.`||t==`&`)return O(Ee);if(e==`[`)return O(Ee,F(`]`),Me);if(t==`extends`||t==`implements`)return E.marked=`keyword`,O(Ee);if(t==`?`)return O(Ee,F(`:`),Ee)}function Ne(e,t){if(t==`<`)return O(N(`>`),W(Ee,`>`),P,Me)}function Pe(){return D(Ee,Fe)}function Fe(e,t){if(t==`=`)return O(Ee)}function Ie(e,t){return t==`enum`?(E.marked=`keyword`,O(K)):D(Le,Se,Be,Ve)}function Le(e,t){if(c&&ne(t))return E.marked=`keyword`,O(Le);if(e==`variable`)return k(t),O();if(e==`spread`)return O(Le);if(e==`[`)return be(ze,`]`);if(e==`{`)return be(Re,`}`)}function Re(e,t){return e==`variable`&&!E.stream.match(/^\s*:/,!1)?(k(t),O(Be)):(e==`variable`&&(E.marked=`property`),e==`spread`?O(Le):e==`}`?D():e==`[`?O(R,F(`]`),F(`:`),Re):O(F(`:`),Le,Be))}function ze(){return D(Le,Be)}function Be(e,t){if(t==`=`)return O(se)}function Ve(e){if(e==`,`)return O(Ie)}function He(e,t){if(e==`keyword b`&&t==`else`)return O(N(`form`,`else`),I,P)}function Ue(e,t){if(t==`await`)return O(Ue);if(e==`(`)return O(N(`)`),We,P)}function We(e){return e==`var`?O(Ie,Ge):e==`variable`?O(Ge):D(Ge)}function Ge(e,t){return e==`)`?O():e==`;`?O(Ge):t==`in`||t==`of`?(E.marked=`keyword`,O(R,Ge)):D(R,Ge)}function Ke(e,t){if(t==`*`)return E.marked=`keyword`,O(Ke);if(e==`variable`)return k(t),O(Ke);if(e==`(`)return O(M,N(`)`),W(Ye,`)`),P,we,I,oe);if(c&&t==`<`)return O(N(`>`),W(Pe,`>`),P,Ke)}function qe(e,t){if(t==`*`)return E.marked=`keyword`,O(qe);if(e==`variable`)return k(t),O(qe);if(e==`(`)return O(M,N(`)`),W(Ye,`)`),P,we,oe);if(c&&t==`<`)return O(N(`>`),W(Pe,`>`),P,qe)}function Je(e,t){if(e==`keyword`||e==`variable`)return E.marked=`type`,O(Je);if(t==`<`)return O(N(`>`),W(Pe,`>`),P)}function Ye(e,t){return t==`@`&&O(R,Ye),e==`spread`?O(Ye):c&&ne(t)?(E.marked=`keyword`,O(Ye)):c&&e==`this`?O(Se,Be):D(Le,Se,Be)}function Xe(e,t){return e==`variable`?Ze(e,t):Qe(e,t)}function Ze(e,t){if(e==`variable`)return k(t),O(Qe)}function Qe(e,t){if(t==`<`)return O(N(`>`),W(Pe,`>`),P,Qe);if(t==`extends`||t==`implements`||c&&e==`,`)return t==`implements`&&(E.marked=`keyword`),O(c?Ee:R,Qe);if(e==`{`)return O(N(`}`),$e,P)}function $e(e,t){if(e==`async`||e==`variable`&&(t==`static`||t==`get`||t==`set`||c&&ne(t))&&E.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return E.marked=`keyword`,O($e);if(e==`variable`||E.style==`keyword`)return E.marked=`property`,O(et,$e);if(e==`number`||e==`string`)return O(et,$e);if(e==`[`)return O(R,Se,F(`]`),et,$e);if(t==`*`)return E.marked=`keyword`,O($e);if(c&&e==`(`)return D(qe,$e);if(e==`;`||e==`,`)return O($e);if(e==`}`)return O();if(t==`@`)return O(R,$e)}function et(e,t){if(t==`!`||t==`?`)return O(et);if(e==`:`)return O(Ee,Be);if(t==`=`)return O(se);var n=E.state.lexical.prev;return D(n&&n.info==`interface`?qe:Ke)}function tt(e,t){return t==`*`?(E.marked=`keyword`,O(st,F(`;`))):t=="default"?(E.marked=`keyword`,O(R,F(`;`))):e==`{`?O(W(nt,`}`),st,F(`;`)):D(I)}function nt(e,t){if(t==`as`)return E.marked=`keyword`,O(F(`variable`));if(e==`variable`)return D(se,nt)}function rt(e){return e==`string`?O():e==`(`?D(R):e==`.`?D(B):D(it,at,st)}function it(e,t){return e==`{`?be(it,`}`):(e==`variable`&&k(t),t==`*`&&(E.marked=`keyword`),O(ot))}function at(e){if(e==`,`)return O(it,at)}function ot(e,t){if(t==`as`)return E.marked=`keyword`,O(it)}function st(e,t){if(t==`from`)return E.marked=`keyword`,O(R)}function ct(e){return e==`]`?O():D(W(se,`]`))}function K(){return D(N(`form`),Le,F(`{`),N(`}`),W(lt,`}`),P,P)}function lt(){return D(Le,Be)}function ut(e,t){return e.lastType==`operator`||e.lastType==`,`||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function dt(e,t,n){return t.tokenize==_&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType==`quasi`&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return{startState:function(e){var t={tokenize:_,lastType:`sof`,cc:[],lexical:new w((e||0)-r,0,`block`,!1),localVars:n.localVars,context:n.localVars&&new re(null,null,!1),indented:e||0};return n.globalVars&&typeof n.globalVars==`object`&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty(`align`)||(t.lexical.align=!1),t.indented=e.indentation(),S(e,t)),t.tokenize!=y&&e.eatSpace())return null;var n=t.tokenize(e,t);return m==`comment`?n:(t.lastType=m==`operator`&&(h==`++`||h==`--`)?`incdec`:m,ee(t,n,m,h,e))},indent:function(t,a){if(t.tokenize==y||t.tokenize==b)return e.Pass;if(t.tokenize!=_)return 0;var o=a&&a.charAt(0),s=t.lexical,c;if(!/^\s*else\b/.test(a))for(var l=t.cc.length-1;l>=0;--l){var u=t.cc[l];if(u==P)s=s.prev;else if(u!=He&&u!=oe)break}for(;(s.type==`stat`||s.type==`form`)&&(o==`}`||(c=t.cc[t.cc.length-1])&&(c==B||c==V)&&!/^[,\.=+\-*:?[\(]/.test(a));)s=s.prev;i&&s.type==`)`&&s.prev.type==`stat`&&(s=s.prev);var d=s.type,f=o==d;return d==`vardef`?s.indented+(t.lastType==`operator`||t.lastType==`,`?s.info.length+1:0):d==`form`&&o==`{`?s.indented:d==`form`?s.indented+r:d==`stat`?s.indented+(ut(t,a)?i||r:0):s.info==`switch`&&!f&&n.doubleIndentSwitch!=0?s.indented+(/^(?:case|default)\b/.test(a)?r:2*r):s.align?s.column+ +!f:s.indented+(f?0:r)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:o?null:`/*`,blockCommentEnd:o?null:`*/`,blockCommentContinue:o?null:` * `,lineComment:o?null:`//`,fold:`brace`,closeBrackets:`()[]{}''""\`\``,helperType:o?`json`:`javascript`,jsonldMode:a,jsonMode:o,expressionAllowed:dt,skipExpression:function(t){ee(t,`atom`,`atom`,`true`,new e.StringStream(``,2,null))}}}),e.registerHelper(`wordChars`,`javascript`,/[\w$]/),e.defineMIME(`text/javascript`,`javascript`),e.defineMIME(`text/ecmascript`,`javascript`),e.defineMIME(`application/javascript`,`javascript`),e.defineMIME(`application/x-javascript`,`javascript`),e.defineMIME(`application/ecmascript`,`javascript`),e.defineMIME(`application/json`,{name:`javascript`,json:!0}),e.defineMIME(`application/x-json`,{name:`javascript`,json:!0}),e.defineMIME(`application/manifest+json`,{name:`javascript`,json:!0}),e.defineMIME(`application/ld+json`,{name:`javascript`,jsonld:!0}),e.defineMIME(`text/typescript`,{name:`javascript`,typescript:!0}),e.defineMIME(`application/typescript`,{name:`javascript`,typescript:!0})})})),om=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(nm()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`css`,function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode(`text/css`));var i=t.indentUnit,a=n.tokenHooks,o=n.documentTypes||{},s=n.mediaTypes||{},c=n.mediaFeatures||{},l=n.mediaValueKeywords||{},u=n.propertyKeywords||{},d=n.nonStandardPropertyKeywords||{},f=n.fontProperties||{},p=n.counterDescriptors||{},m=n.colorKeywords||{},h=n.valueKeywords||{},g=n.allowNested,_=n.lineComment,v=n.supportsAtComponent===!0,y=t.highlightNonStandardPropertyKeywords!==!1,b,x;function S(e,t){return b=t,e}function C(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(r!==!1)return r}if(n==`@`)return e.eatWhile(/[\w\\\-]/),S(`def`,e.current());if(n==`=`||(n==`~`||n==`|`)&&e.eat(`=`))return S(null,`compare`);if(n==`"`||n==`'`)return t.tokenize=w(n),t.tokenize(e,t);if(n==`#`)return e.eatWhile(/[\w\\\-]/),S(`atom`,`hash`);if(n==`!`)return e.match(/^\s*\w*/),S(`keyword`,`important`);if(/\d/.test(n)||n==`.`&&e.eat(/\d/))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(n===`-`){if(/[\d.]/.test(e.peek()))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(e.match(/^-[\w\\\-]*/))return e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?S(`variable-2`,`variable-definition`):S(`variable-2`,`variable`);if(e.match(/^\w+-/))return S(`meta`,`meta`)}else if(/[,+>*\/]/.test(n))return S(null,`select-op`);else if(n==`.`&&e.match(/^-?[_a-z][_a-z0-9-]*/i))return S(`qualifier`,`qualifier`);else if(/[:;{}\[\]\(\)]/.test(n))return S(null,n);else if(e.match(/^[\w-.]+(?=\()/))return/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=T),S(`variable callee`,`variable`);else if(/[\w\\\-]/.test(n))return e.eatWhile(/[\w\\\-]/),S(`property`,`word`);else return S(null,null)}function w(e){return function(t,n){for(var r=!1,i;(i=t.next())!=null;){if(i==e&&!r){e==`)`&&t.backUp(1);break}r=!r&&i==`\\`}return(i==e||!r&&e!=`)`)&&(n.tokenize=null),S(`string`,`string`)}}function T(e,t){return e.next(),t.tokenize=e.match(/^\s*[\"\')]/,!1)?null:w(`)`),S(null,`(`)}function ee(e,t,n){this.type=e,this.indent=t,this.prev=n}function E(e,t,n,r){return e.context=new ee(n,t.indentation()+(r===!1?0:i),e.context),n}function D(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function O(e,t,n){return A[n.context.type](e,t,n)}function te(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return O(e,t,n)}function k(e){var t=e.current().toLowerCase();x=h.hasOwnProperty(t)?`atom`:m.hasOwnProperty(t)?`keyword`:`variable`}var A={};return A.top=function(e,t,n){if(e==`{`)return E(n,t,`block`);if(e==`}`&&n.context.prev)return D(n);if(v&&/@component/i.test(e))return E(n,t,`atComponentBlock`);if(/^@(-moz-)?document$/i.test(e))return E(n,t,`documentTypes`);if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return E(n,t,`atBlock`);if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,`restricted_atBlock_before`;if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return`keyframes`;if(e&&e.charAt(0)==`@`)return E(n,t,`at`);if(e==`hash`)x=`builtin`;else if(e==`word`)x=`tag`;else if(e==`variable-definition`)return`maybeprop`;else if(e==`interpolation`)return E(n,t,`interpolation`);else if(e==`:`)return`pseudo`;else if(g&&e==`(`)return E(n,t,`parens`);return n.context.type},A.block=function(e,t,n){if(e==`word`){var r=t.current().toLowerCase();return u.hasOwnProperty(r)?(x=`property`,`maybeprop`):d.hasOwnProperty(r)?(x=y?`string-2`:`property`,`maybeprop`):g?(x=t.match(/^\s*:(?:\s|$)/,!1)?`property`:`tag`,`block`):(x+=` error`,`maybeprop`)}return e==`meta`?`block`:!g&&(e==`hash`||e==`qualifier`)?(x=`error`,`block`):A.top(e,t,n)},A.maybeprop=function(e,t,n){return e==`:`?E(n,t,`prop`):O(e,t,n)},A.prop=function(e,t,n){if(e==`;`)return D(n);if(e==`{`&&g)return E(n,t,`propBlock`);if(e==`}`||e==`{`)return te(e,t,n);if(e==`(`)return E(n,t,`parens`);if(e==`hash`&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current()))x+=` error`;else if(e==`word`)k(t);else if(e==`interpolation`)return E(n,t,`interpolation`);return`prop`},A.propBlock=function(e,t,n){return e==`}`?D(n):e==`word`?(x=`property`,`maybeprop`):n.context.type},A.parens=function(e,t,n){return e==`{`||e==`}`?te(e,t,n):e==`)`?D(n):e==`(`?E(n,t,`parens`):e==`interpolation`?E(n,t,`interpolation`):(e==`word`&&k(t),`parens`)},A.pseudo=function(e,t,n){return e==`meta`?`pseudo`:e==`word`?(x=`variable-3`,n.context.type):O(e,t,n)},A.documentTypes=function(e,t,n){return e==`word`&&o.hasOwnProperty(t.current())?(x=`tag`,n.context.type):A.atBlock(e,t,n)},A.atBlock=function(e,t,n){if(e==`(`)return E(n,t,`atBlock_parens`);if(e==`}`||e==`;`)return te(e,t,n);if(e==`{`)return D(n)&&E(n,t,g?`block`:`top`);if(e==`interpolation`)return E(n,t,`interpolation`);if(e==`word`){var r=t.current().toLowerCase();x=r==`only`||r==`not`||r==`and`||r==`or`?`keyword`:s.hasOwnProperty(r)?`attribute`:c.hasOwnProperty(r)?`property`:l.hasOwnProperty(r)?`keyword`:u.hasOwnProperty(r)?`property`:d.hasOwnProperty(r)?y?`string-2`:`property`:h.hasOwnProperty(r)?`atom`:m.hasOwnProperty(r)?`keyword`:`error`}return n.context.type},A.atComponentBlock=function(e,t,n){return e==`}`?te(e,t,n):e==`{`?D(n)&&E(n,t,g?`block`:`top`,!1):(e==`word`&&(x=`error`),n.context.type)},A.atBlock_parens=function(e,t,n){return e==`)`?D(n):e==`{`||e==`}`?te(e,t,n,2):A.atBlock(e,t,n)},A.restricted_atBlock_before=function(e,t,n){return e==`{`?E(n,t,`restricted_atBlock`):e==`word`&&n.stateArg==`@counter-style`?(x=`variable`,`restricted_atBlock_before`):O(e,t,n)},A.restricted_atBlock=function(e,t,n){return e==`}`?(n.stateArg=null,D(n)):e==`word`?(x=n.stateArg==`@font-face`&&!f.hasOwnProperty(t.current().toLowerCase())||n.stateArg==`@counter-style`&&!p.hasOwnProperty(t.current().toLowerCase())?`error`:`property`,`maybeprop`):`restricted_atBlock`},A.keyframes=function(e,t,n){return e==`word`?(x=`variable`,`keyframes`):e==`{`?E(n,t,`top`):O(e,t,n)},A.at=function(e,t,n){return e==`;`?D(n):e==`{`||e==`}`?te(e,t,n):(e==`word`?x=`tag`:e==`hash`&&(x=`builtin`),`at`)},A.interpolation=function(e,t,n){return e==`}`?D(n):e==`{`||e==`;`?te(e,t,n):(e==`word`?x=`variable`:e!=`variable`&&e!=`(`&&e!=`)`&&(x=`error`),`interpolation`)},{startState:function(e){return{tokenize:null,state:r?`block`:`top`,stateArg:null,context:new ee(r?`block`:`top`,e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||C)(e,t);return n&&typeof n==`object`&&(b=n[1],n=n[0]),x=n,b!=`comment`&&(t.state=A[t.state](b,e,t)),x},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),a=n.indent;return n.type==`prop`&&(r==`}`||r==`)`)&&(n=n.prev),n.prev&&(r==`}`&&(n.type==`block`||n.type==`top`||n.type==`interpolation`||n.type==`restricted_atBlock`)?(n=n.prev,a=n.indent):(r==`)`&&(n.type==`parens`||n.type==`atBlock_parens`)||r==`{`&&(n.type==`at`||n.type==`atBlock`))&&(a=Math.max(0,n.indent-i))),a},electricChars:`}`,blockCommentStart:`/*`,blockCommentEnd:`*/`,blockCommentContinue:` * `,lineComment:_,fold:`brace`}});function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}var n=[`domain`,`regexp`,`url`,`url-prefix`],r=t(n),i=[`all`,`aural`,`braille`,`handheld`,`print`,`projection`,`screen`,`tty`,`tv`,`embossed`],a=t(i),o=`width.min-width.max-width.height.min-height.max-height.device-width.min-device-width.max-device-width.device-height.min-device-height.max-device-height.aspect-ratio.min-aspect-ratio.max-aspect-ratio.device-aspect-ratio.min-device-aspect-ratio.max-device-aspect-ratio.color.min-color.max-color.color-index.min-color-index.max-color-index.monochrome.min-monochrome.max-monochrome.resolution.min-resolution.max-resolution.scan.grid.orientation.device-pixel-ratio.min-device-pixel-ratio.max-device-pixel-ratio.pointer.any-pointer.hover.any-hover.prefers-color-scheme.dynamic-range.video-dynamic-range`.split(`.`),s=t(o),c=[`landscape`,`portrait`,`none`,`coarse`,`fine`,`on-demand`,`hover`,`interlace`,`progressive`,`dark`,`light`,`standard`,`high`],l=t(c),u=`align-content.align-items.align-self.alignment-adjust.alignment-baseline.all.anchor-point.animation.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-timing-function.appearance.azimuth.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.binding.bleed.block-size.bookmark-label.bookmark-level.bookmark-state.bookmark-target.border.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-decoration-break.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.color.color-profile.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.content.counter-increment.counter-reset.crop.cue.cue-after.cue-before.cursor.direction.display.dominant-baseline.drop-initial-after-adjust.drop-initial-after-align.drop-initial-before-adjust.drop-initial-before-align.drop-initial-size.drop-initial-value.elevation.empty-cells.fit.fit-content.fit-position.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.float-offset.flow-from.flow-into.font.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-size.font-size-adjust.font-stretch.font-style.font-synthesis.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.gap.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-gap.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-gap.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphens.icon.image-orientation.image-rendering.image-resolution.inline-box-align.inset.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.left.letter-spacing.line-break.line-height.line-height-step.line-stacking.line-stacking-ruby.line-stacking-shift.line-stacking-strategy.list-style.list-style-image.list-style-position.list-style-type.margin.margin-bottom.margin-left.margin-right.margin-top.marks.marquee-direction.marquee-loop.marquee-play-count.marquee-speed.marquee-style.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.move-to.nav-down.nav-index.nav-left.nav-right.nav-up.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-style.overflow-wrap.overflow-x.overflow-y.padding.padding-bottom.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.page-policy.pause.pause-after.pause-before.perspective.perspective-origin.pitch.pitch-range.place-content.place-items.place-self.play-during.position.presentation-level.punctuation-trim.quotes.region-break-after.region-break-before.region-break-inside.region-fragment.rendering-intent.resize.rest.rest-after.rest-before.richness.right.rotate.rotation.rotation-point.row-gap.ruby-align.ruby-overhang.ruby-position.ruby-span.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-type.shape-image-threshold.shape-inside.shape-margin.shape-outside.size.speak.speak-as.speak-header.speak-numeral.speak-punctuation.speech-rate.stress.string-set.tab-size.table-layout.target.target-name.target-new.target-position.text-align.text-align-last.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-height.text-indent.text-justify.text-orientation.text-outline.text-overflow.text-rendering.text-shadow.text-size-adjust.text-space-collapse.text-transform.text-underline-position.text-wrap.top.touch-action.transform.transform-origin.transform-style.transition.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-select.vertical-align.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.volume.white-space.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.z-index.clip-path.clip-rule.mask.enable-background.filter.flood-color.flood-opacity.lighting-color.stop-color.stop-opacity.pointer-events.color-interpolation.color-interpolation-filters.color-rendering.fill.fill-opacity.fill-rule.image-rendering.marker.marker-end.marker-mid.marker-start.paint-order.shape-rendering.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-rendering.baseline-shift.dominant-baseline.glyph-orientation-horizontal.glyph-orientation-vertical.text-anchor.writing-mode`.split(`.`),d=t(u),f=`accent-color.aspect-ratio.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.content-visibility.margin-block.margin-block-end.margin-block-start.margin-inline.margin-inline-end.margin-inline-start.overflow-anchor.overscroll-behavior.padding-block.padding-block-end.padding-block-start.padding-inline.padding-inline-end.padding-inline-start.scroll-snap-stop.scrollbar-3d-light-color.scrollbar-arrow-color.scrollbar-base-color.scrollbar-dark-shadow-color.scrollbar-face-color.scrollbar-highlight-color.scrollbar-shadow-color.scrollbar-track-color.searchfield-cancel-button.searchfield-decoration.searchfield-results-button.searchfield-results-decoration.shape-inside.zoom`.split(`.`),p=t(f),m=t([`font-display`,`font-family`,`src`,`unicode-range`,`font-variant`,`font-feature-settings`,`font-stretch`,`font-weight`,`font-style`]),h=t([`additive-symbols`,`fallback`,`negative`,`pad`,`prefix`,`range`,`speak-as`,`suffix`,`symbols`,`system`]),g=`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.darkgrey.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkslategrey.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dimgrey.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.lightgrey.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightslategrey.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.slategrey.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`),_=t(g),v=`above.absolute.activeborder.additive.activecaption.afar.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.amharic.amharic-abegede.antialiased.appworkspace.arabic-indic.armenian.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.binary.bengali.blink.block.block-axis.blur.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.brightness.bullets.button.buttonface.buttonhighlight.buttonshadow.buttontext.calc.cambodian.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.cjk-earthly-branch.cjk-heavenly-stem.cjk-ideographic.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.conic-gradient.contain.content.contents.content-box.context-menu.continuous.contrast.copy.counter.counters.cover.crop.cross.crosshair.cubic-bezier.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.devanagari.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.drop-shadow.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic.ethiopic-abegede.ethiopic-abegede-am-et.ethiopic-abegede-gez.ethiopic-abegede-ti-er.ethiopic-abegede-ti-et.ethiopic-halehame-aa-er.ethiopic-halehame-aa-et.ethiopic-halehame-am-et.ethiopic-halehame-gez.ethiopic-halehame-om-et.ethiopic-halehame-sid-et.ethiopic-halehame-so-et.ethiopic-halehame-ti-er.ethiopic-halehame-ti-et.ethiopic-halehame-tig.ethiopic-numeric.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.georgian.grayscale.graytext.grid.groove.gujarati.gurmukhi.hand.hangul.hangul-consonant.hard-light.hebrew.help.hidden.hide.higher.highlight.highlighttext.hiragana.hiragana-iroha.horizontal.hsl.hsla.hue.hue-rotate.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.japanese-formal.japanese-informal.justify.kannada.katakana.katakana-iroha.keep-all.khmer.korean-hangul-formal.korean-hanja-formal.korean-hanja-informal.landscape.lao.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-alpha.lower-armenian.lower-greek.lower-hexadecimal.lower-latin.lower-norwegian.lower-roman.lowercase.ltr.luminosity.malayalam.manipulation.match.matrix.matrix3d.media-play-button.media-slider.media-sliderthumb.media-volume-slider.media-volume-sliderthumb.medium.menu.menulist.menulist-button.menutext.message-box.middle.min-intrinsic.mix.mongolian.monospace.move.multiple.multiple_mask_images.multiply.myanmar.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.octal.opacity.open-quote.optimizeLegibility.optimizeSpeed.oriya.oromo.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.persian.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.repeating-conic-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.saturate.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.searchfield.searchfield-cancel-button.searchfield-decoration.searchfield-results-button.searchfield-results-decoration.self-start.self-end.semi-condensed.semi-expanded.separate.sepia.serif.show.sidama.simp-chinese-formal.simp-chinese-informal.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.somali.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.square-button.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.tamil.telugu.text.text-bottom.text-top.textarea.textfield.thai.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.tibetan.tigre.tigrinya-er.tigrinya-er-abegede.tigrinya-et.tigrinya-et-abegede.to.top.trad-chinese-formal.trad-chinese-informal.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-alpha.upper-armenian.upper-greek.upper-hexadecimal.upper-latin.upper-norwegian.upper-roman.uppercase.urdu.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`.split(`.`),y=t(v),b=n.concat(i).concat(o).concat(c).concat(u).concat(f).concat(g).concat(v);e.registerHelper(`hintWords`,`css`,b);function x(e,t){for(var n=!1,r;(r=e.next())!=null;){if(n&&r==`/`){t.tokenize=null;break}n=r==`*`}return[`comment`,`comment`]}e.defineMIME(`text/css`,{documentTypes:r,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:h,colorKeywords:_,valueKeywords:y,tokenHooks:{"/":function(e,t){return e.eat(`*`)?(t.tokenize=x,x(e,t)):!1}},name:`css`}),e.defineMIME(`text/x-scss`,{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:`//`,tokenHooks:{"/":function(e,t){return e.eat(`/`)?(e.skipToEnd(),[`comment`,`comment`]):e.eat(`*`)?(t.tokenize=x,x(e,t)):[`operator`,`operator`]},":":function(e){return e.match(/^\s*\{/,!1)?[null,null]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?[`variable-2`,`variable-definition`]:[`variable-2`,`variable`]},"#":function(e){return e.eat(`{`)?[null,`interpolation`]:!1}},name:`css`,helperType:`scss`}),e.defineMIME(`text/x-less`,{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:`//`,tokenHooks:{"/":function(e,t){return e.eat(`/`)?(e.skipToEnd(),[`comment`,`comment`]):e.eat(`*`)?(t.tokenize=x,x(e,t)):[`operator`,`operator`]},"@":function(e){return e.eat(`{`)?[null,`interpolation`]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?[`variable-2`,`variable-definition`]:[`variable-2`,`variable`])},"&":function(){return[`atom`,`atom`]}},name:`css`,helperType:`less`}),e.defineMIME(`text/x-gss`,{documentTypes:r,mediaTypes:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:h,colorKeywords:_,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return e.eat(`*`)?(t.tokenize=x,x(e,t)):!1}},name:`css`,helperType:`gss`})})})),sm=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(nm(),im(),am(),om()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`,`../xml/xml`,`../javascript/javascript`,`../css/css`],n):n(CodeMirror)})(function(e){var t={script:[[`lang`,/(javascript|babel)/i,`javascript`],[`type`,/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,`javascript`],[`type`,/./,`text/plain`],[null,null,`javascript`]],style:[[`lang`,/^css$/i,`css`],[`type`,/^(text\/)?(x-)?(stylesheet|css)$/i,`css`],[`type`,/./,`text/plain`],[null,null,`css`]]};function n(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}var r={};function i(e){return r[e]||(r[e]=RegExp(`\\s+`+e+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function a(e,t){var n=e.match(i(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:``}function o(e,t){return RegExp((t?`^`:``)+`</\\s*`+e+`\\s*>`,`i`)}function s(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],a=i.length-1;a>=0;a--)r.unshift(i[a])}function c(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(!r[0]||r[1].test(a(t,r[0])))return r[2]}}e.defineMode(`htmlmixed`,function(r,i){var a=e.getMode(r,{name:`xml`,htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag,allowMissingTagName:i.allowMissingTagName}),l={},u=i&&i.tags,d=i&&i.scriptTypes;if(s(t,l),u&&s(u,l),d)for(var f=d.length-1;f>=0;f--)l.script.unshift([`type`,d[f].matches,d[f].mode]);function p(t,i){var s=a.token(t,i.htmlState),u=/\btag\b/.test(s),d;if(u&&!/[<>\s\/]/.test(t.current())&&(d=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(d))i.inTag=d+` `;else if(i.inTag&&u&&/>$/.test(t.current())){var f=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var m=t.current()==`>`&&c(l[f[1]],f[2]),h=e.getMode(r,m),g=o(f[1],!0),_=o(f[1],!1);i.token=function(e,t){return e.match(g,!1)?(t.token=p,t.localState=t.localMode=null,null):n(e,_,t.localMode.token(e,t.localState))},i.localMode=h,i.localState=e.startState(h,a.indent(i.htmlState,``,``))}else i.inTag&&(i.inTag+=t.current(),t.eol()&&(i.inTag+=` `));return s}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:e.startState(a)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(a,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?a.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||a}}}},`xml`,`javascript`,`css`),e.defineMIME(`text/html`,`htmlmixed`)})}));im(),am(),om(),sm();function cm(e){let{source:t,elements:n,order:r}=e,i=[];for(let e of r){let r=n.get(e);if(!r||r.startTagEnd<=r.start)continue;let a=r.parent?n.get(r.parent):void 0;if(t[r.start-1]===`>`&&(!a||[`html`,`head`,`body`].includes(a.tag))&&i.push({start:r.start,end:r.start,text:`
69
+ `}),r.startTagEnd-r.start>100&&r.attrs.length>2){let e=[...r.attrs].sort((e,t)=>e.start-t.start);for(let n=1;n<e.length;n++){let r=e[n-1].end,a=e[n].start;/^ +$/.test(t.slice(r,a))&&i.push({start:r,end:a,text:`
70
+ `})}}r.tag===`style`&&r.endTagStart!==null&&r.startTagEnd<r.endTagStart&&(/\s/.test(t[r.startTagEnd]??``)||i.push({start:r.startTagEnd,end:r.startTagEnd,text:`
71
+ `}),/\s/.test(t[r.endTagStart-1]??``)||i.push({start:r.endTagStart,end:r.endTagStart,text:`
72
+ `}))}let a=t;for(let{start:e,end:t,text:n}of i.sort((e,t)=>t.start-e.start))a=a.slice(0,e)+n+a.slice(t);return a}var lm=/(data:[a-z0-9.+/-]*;base64,)([A-Za-z0-9+/=]{1500,})/gi,um=/\[\[popost-data-(\d+):[^\]]*\]\]/g,dm=e=>e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function fm(e){let t=[];return{text:e.replace(lm,(e,n,r)=>(t.push(r),`${n}[[popost-data-${t.length}:${dm(r.length)}]]`)),restore:e=>e.replace(um,(e,n)=>t[Number(n)-1]??e)}}var pm={empty:`code.err.empty`,"too-large":`code.err.too-large`,"no-slide":`code.err.no-slide`,unsafe:`code.err.unsafe`,rejected:`code.err.rejected`,"not-ready":`code.err.rejected`};function mm({controller:e,onClose:t}){let n=tf(),r=ip(e),i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(!1),l=(0,v.useRef)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!0),[g,_]=(0,v.useState)({key:`code.status.idle`}),y=(0,v.useCallback)(e=>{l.current=e,d(e)},[]),b=(0,v.useCallback)(()=>{let t=o.current;if(!t)return;let n=fm(cm(e.index()));s.current=n,c.current=!0,t.setValue(n.text),c.current=!1,y(!1)},[e,y]),x=(0,v.useCallback)(async()=>{let t=o.current,n=s.current;if(!(!t||!n||!l.current||f)){p(!0);try{let r=e.replaceSource(n.restore(t.getValue()));if(r!==null){let e=pm[r];_(e?{key:e,error:!0}:{key:`code.err.rejected`,error:!0,raw:r});return}b(),await e.save();let i=e.getSnapshot();_(i.saveState===`saved`?{key:`code.status.saved`}:{key:`code.status.appliedUnsaved`,error:i.saveState===`error`})}finally{p(!1)}}},[f,e,b]),S=(0,v.useRef)(x);S.current=x,(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=rm.default.fromTextArea(e,{mode:`htmlmixed`,lineNumbers:!0,lineWrapping:!0,tabSize:2,indentUnit:2,viewportMargin:10,extraKeys:{"Ctrl-S":()=>void S.current(),"Cmd-S":()=>void S.current()}});o.current=t,t.on(`change`,()=>{c.current||(y(!0),_({key:`code.status.dirty`}))}),b();let n=a.current,r=n&&typeof ResizeObserver<`u`?new ResizeObserver(()=>t.refresh()):null;n&&r?.observe(n);let s=requestAnimationFrame(()=>t.refresh()),l=setTimeout(()=>t.refresh(),230);return()=>{cancelAnimationFrame(s),clearTimeout(l),r?.disconnect(),t.toTextArea(),o.current=null}},[b,y]);let C=(0,v.useRef)(r.sourceVersion);(0,v.useEffect)(()=>{C.current!==r.sourceVersion&&(C.current=r.sourceVersion,l.current||b())},[r.sourceVersion,b]);let w=()=>{o.current?.setOption(`lineWrapping`,!m),h(!m)},T=async()=>{let e=o.current;if(!(!e||!s.current))try{await navigator.clipboard.writeText(s.current.restore(e.getValue())),_({key:`code.status.copied`})}catch{_({key:`code.status.copyFailed`,error:!0})}},ee=g.raw?`${n(g.key)}: ${g.raw}`:n(g.key);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsx)(`h2`,{children:n(`panel.code`)}),(0,Q.jsxs)(`div`,{className:`code-header-tools`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`tb-btn small`,onClick:w,children:[(0,Q.jsx)($,{name:`wrap`,size:14}),n(m?`code.disableWrap`:`code.enableWrap`)]}),(0,Q.jsxs)(`button`,{type:`button`,className:`tb-btn small`,disabled:r.docState!==`ready`,onClick:()=>void T(),children:[(0,Q.jsx)($,{name:`duplicate`,size:14}),n(`code.copy`)]}),(0,Q.jsx)(`button`,{type:`button`,id:`panel-close`,className:`tb-btn small`,title:n(`panel.close`),"aria-label":n(`panel.close`),onClick:t,children:(0,Q.jsx)($,{name:`close`,size:14})})]})]}),(0,Q.jsxs)(`div`,{className:`panel-body code-panel`,"data-panel-body":`code`,children:[(0,Q.jsx)(`div`,{ref:a,className:`code-host`,children:(0,Q.jsx)(`textarea`,{id:`canvas-code-source`,ref:i,defaultValue:``,spellCheck:!1})}),(0,Q.jsx)(`div`,{id:`code-status`,className:`code-status${g.error?` error`:``}`,role:`status`,children:ee}),(0,Q.jsxs)(`div`,{className:`code-actions`,children:[(0,Q.jsxs)(`button`,{type:`button`,id:`code-save`,className:`btn primary`,disabled:!u||f,onClick:()=>void x(),children:[n(f?`code.saving`:`code.save`),(0,Q.jsx)(`i`,{className:`code-unsaved-dot`,hidden:!u})]}),(0,Q.jsx)(`button`,{type:`button`,id:`code-download-html`,className:`btn`,onClick:()=>{let t=o.current,n=s.current;u&&t&&n?zu(Ru(r.name),Lu(n.restore(t.getValue()))):e.exportHTML(),_({key:`code.status.downloaded`})},children:n(`code.download`)})]})]})]})}var hm=36;function gm(e,t=hm){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n}function _m(e){if(!e||/^data:/i.test(e.trim()))return``;let t=e.split(/[?#]/)[0]?.split(`/`).filter(Boolean).at(-1)??``;try{return decodeURIComponent(t)}catch{return t}}function vm(e,t,n){let r=e.elements.get(t);return r?n===`image`?gm(Pi(r,`alt`)??``)||_m(Pi(r,`src`)):n===`text`?gm(zi(e,t)):gm(Pi(r,`data-layer-id`)??Pi(r,`aria-label`)??``)||gm(zi(e,t)):``}function ym(e,t){if(t===null)return[];let n=Ga(e,t),r=new Set(n),i=new Map;return n.map(n=>{let a=e.elements.get(n),o=a?.parent??null;for(;o!==null&&o!==t&&!r.has(o);)o=e.elements.get(o)?.parent??null;let s=o!==null&&r.has(o)?(i.get(o)??0)+1:0;i.set(n,s);let c=Wa(e,n);return{id:n,kind:c,depth:s,tag:a?.tag.toLowerCase()??``,snippet:vm(e,n,c),parentId:a?.parent??null}})}function bm(e,t,n,r){if(t===n)return null;let i=e.elements.get(t)?.parent;if(!i||e.elements.get(n)?.parent!==i)return null;let a=(e.elements.get(i)?.children??[]).filter(e=>e!==t),o=a.indexOf(n);if(o<0)return null;let s=a[r===`before`?o:o+1]??null,c=(e.elements.get(i)?.children??[]).indexOf(t),l=[...a];return l.splice(s===null?l.length:l.indexOf(s),0,t),l.indexOf(t)===c?null:{kind:`move`,id:t,parentId:i,beforeId:s}}function xm(e,t,n,r){let i=e.elements.get(t)?.parent;if(!i)return null;let a=(e.elements.get(i)?.children??[]).filter(e=>e!==t).indexOf(n);return a<0?null:r===`before`?a:a+1}var Sm={text:`text`,image:`image`,svg:`shape`,video:`play`,box:`block`},Cm={text:`layers.kind.text`,image:`layers.kind.image`,svg:`layers.kind.svg`,video:`layers.kind.video`,box:`layers.kind.box`};function wm({controller:e}){let t=tf(),n=ip(e),r=(0,v.useMemo)(()=>ym(e.index(),n.currentPageId),[e,n.currentPageId,n.sourceVersion]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=(0,v.useRef)(null);(0,v.useEffect)(()=>()=>e.highlight([]),[e]);let l=n.selection.join(`,`);(0,v.useEffect)(()=>{let e=n.selection[0];e!==void 0&&c.current?.querySelector(`[data-layer-id="${e}"]`)?.scrollIntoView({block:`nearest`})},[l,n.selection]);let u=(t,n)=>e.select([n],{additive:t.shiftKey}),d=t=>!i||i===t.id?!1:e.index().elements.get(i)?.parent===t.parentId,f=(e,t)=>{if(!d(t)){s(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientY<n.top+n.height/2?`before`:`after`;(o?.id!==t.id||o.where!==r)&&s({id:t.id,where:r})},p=(t,n)=>{t.preventDefault();let r=i,c=o?.id===n.id?o.where:`after`;if(a(null),s(null),!r||!d(n))return;let l=e.index(),u=bm(l,r,n.id,c);if(!u)return;let f=l.elements.get(r)?.parent,p=xm(l,r,n.id,c);if(e.apply(u,{label:`reorder layer`}),f&&p!==null){let t=e.index().elements.get(f)?.children[p];t!==void 0&&e.select([t])}};return(0,Q.jsxs)(`div`,{className:`panel-body layers`,"data-panel-body":`layers`,children:[r.length===0&&(0,Q.jsx)(`p`,{className:`p-hint`,children:t(`layers.empty`)}),(0,Q.jsx)(`div`,{ref:c,className:`layer-list`,role:`tree`,"aria-label":t(`panel.layers`),onMouseLeave:()=>e.highlight([]),children:r.map(r=>{let c=n.selection.includes(r.id),l=[`layer-row`,c?`selected`:``,i===r.id?`dragging`:``,o?.id===r.id?`drop-${o.where}`:``].filter(Boolean).join(` `);return(0,Q.jsxs)(`div`,{className:l,role:`treeitem`,"aria-selected":c,tabIndex:0,draggable:!0,"data-layer-id":r.id,"data-kind":r.kind,style:{paddingLeft:8+r.depth*14},onClick:e=>u(e,r.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u(e,r.id))},onMouseEnter:()=>e.highlight([r.id]),onDragStart:e=>{a(r.id),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,r.id)},onDragOver:e=>f(e,r),onDrop:e=>p(e,r),onDragEnd:()=>{a(null),s(null)},children:[(0,Q.jsx)(`span`,{className:`layer-icon`,title:t(Cm[r.kind]),children:(0,Q.jsx)($,{name:Sm[r.kind],size:14})}),(0,Q.jsx)(`span`,{className:`layer-kind`,children:t(Cm[r.kind])}),(0,Q.jsx)(`span`,{className:`layer-snippet`,children:r.snippet})]},r.id)})})]})}var Tm=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),Em={heading:{tag:`h1`,size:.07,weight:700,line:1.15},subheading:{tag:`h2`,size:.045,weight:600,line:1.25},paragraph:{tag:`p`,size:.03,weight:400,line:1.5}};function Dm(e,t,n,r=`#222222`){let i=Em[e],a=Math.round(t*.07),o=`position:absolute;z-index:100;left:${a}px;top:${a}px;max-width:${t-2*a}px;margin:0;color:${r};font-size:${Math.round(t*i.size)}px;font-weight:${i.weight};line-height:${i.line}`;return`<${i.tag} style="${o}">${Tm(n)}</${i.tag}>`}var Om=[{kind:`heading`,id:`add-heading`,label:`text.addHeading`,sample:`text.sampleHeading`,icon:`H1`},{kind:`subheading`,id:`add-subheading`,label:`text.addSubheading`,sample:`text.sampleSubheading`,icon:`H2`},{kind:`paragraph`,id:`add-paragraph`,label:`text.addParagraph`,sample:`text.sampleParagraph`,icon:`P`}];function km({controller:e}){let t=tf(),n=ip(e),r=$f(e,n.sourceVersion),i=ep(e,n,[`color`]),a=Qf(n),[o,s]=(0,v.useState)(`#222222`),c=n.editingTextId!==null&&n.textState?.range===!0,l=(r,i)=>{if(n.currentPageId===null)return;e.apply({kind:`insertHTML`,parentId:n.currentPageId,beforeId:null,html:Dm(r,e.pageSize().width,t(i),o)},{label:`add text`});let a=e.getSnapshot().selection[0];a!==void 0&&e.index().elements.has(a)&&e.beginTextEdit(a,`all`)};return(0,Q.jsxs)(`div`,{className:`panel-body`,"data-panel-body":`text`,children:[(0,Q.jsxs)(`section`,{className:`p-section`,children:[(0,Q.jsx)(`h3`,{children:t(`text.add`)}),(0,Q.jsx)(`div`,{className:`add-list`,children:Om.map(e=>(0,Q.jsxs)(`button`,{type:`button`,id:e.id,className:`add-item add-${e.kind}`,disabled:n.docState!==`ready`,onClick:()=>l(e.kind,e.sample),children:[(0,Q.jsx)(`span`,{className:`add-icon`,children:e.icon}),(0,Q.jsx)(`span`,{children:t(e.label)})]},e.kind))})]}),(0,Q.jsxs)(`section`,{className:`p-section`,children:[(0,Q.jsx)(`h3`,{children:t(`text.color`)}),(0,Q.jsx)(Zf,{docColors:r,current:md(i.color)??md(o),onPick:(t,n)=>{c&&n===`live`||(s(t),a.length&&e.format({command:`color`,value:t}))}})]})]})}var Am=[{id:`layers`,icon:`layers`,label:`panel.layers`},{id:`block`,icon:`block`,label:`panel.block`},{id:`code`,icon:`code`,label:`panel.code`}];function jm({open:e,onToggle:t,onAddPage:n}){let r=tf(),[i,a]=(0,v.useState)(!1);return kd(i,()=>a(!1)),(0,Q.jsxs)(`nav`,{className:`rail`,"aria-label":r(`rail.label`),children:[Am.map(n=>(0,Q.jsxs)(`button`,{type:`button`,className:`rail-item${e===n.id?` active`:``}`,"data-panel":n.id,"aria-pressed":e===n.id,title:r(n.label),onClick:()=>t(n.id),children:[(0,Q.jsx)($,{name:n.icon,size:18}),(0,Q.jsx)(`span`,{children:r(n.label)})]},n.id)),(0,Q.jsxs)(`div`,{className:`rail-add`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`rail-item${e===`text`||e===`images`?` active`:``}`,"aria-expanded":i,onClick:()=>a(!i),children:[(0,Q.jsx)($,{name:`plus`,size:18}),(0,Q.jsx)(`span`,{children:r(`panel.add`)})]}),i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`menu-scrim`,onMouseDown:()=>a(!1)}),(0,Q.jsxs)(`div`,{className:`popover add-popover`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`menu-item`,onClick:()=>{a(!1),e!==`text`&&t(`text`)},children:[(0,Q.jsx)($,{name:`text`}),r(`add.text`)]}),(0,Q.jsxs)(`button`,{type:`button`,className:`menu-item`,onClick:()=>{a(!1),e!==`images`&&t(`images`)},children:[(0,Q.jsx)($,{name:`image`}),r(`panel.images`)]}),(0,Q.jsxs)(`button`,{type:`button`,className:`menu-item`,onClick:()=>{a(!1),n()},children:[(0,Q.jsx)($,{name:`plus`}),r(`add.page`)]})]})]})]})]})}function Mm({open:e,controller:t,onClose:n}){let r=tf();if(!e)return(0,Q.jsx)(`aside`,{id:`panel`,className:`panel`,"aria-hidden":`true`});let i={text:(0,Q.jsx)(km,{controller:t}),block:(0,Q.jsx)(tm,{controller:t}),layers:(0,Q.jsx)(wm,{controller:t}),images:(0,Q.jsx)(Ip,{controller:t})};return(0,Q.jsx)(`aside`,{id:`panel`,className:`panel open`,"data-open":e,"data-view":e,children:e===`code`?(0,Q.jsx)(mm,{controller:t,onClose:n}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsx)(`h2`,{children:r(Am.find(t=>t.id===e)?.label??(e===`images`?`panel.images`:`panel.text`))}),(0,Q.jsx)(`button`,{type:`button`,id:`panel-close`,className:`tb-btn small`,title:r(`panel.close`),"aria-label":r(`panel.close`),onClick:n,children:(0,Q.jsx)($,{name:`close`,size:14})})]}),i[e]]})})}var Nm=(e,t,n)=>e.some(e=>e.pageKey!==void 0)?e.find(e=>e.pageKey===n)??null:e[t]??null;function Pm(e){let[t,n]=(0,v.useState)({images:[],status:`loading`}),[r,i]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(!e&&!id())return;let t=!0;return(e?fetch(`/api/comparison`,{cache:`no-store`}).then(async e=>{if(!e.ok)throw Error(`Reference images unavailable`);return(await e.json()).items}):ad(`references`,void 0,1e4)).then(e=>{t&&n({images:e.filter(e=>typeof e?.src==`string`),status:`ready`})}).catch(()=>{t&&n({images:[],status:`failed`})}),()=>{t=!1}},[r,e]),{...t,retry:()=>{n({images:[],status:`loading`}),i(e=>e+1)}}}function Fm({state:e,pageIndex:t,pageKey:n,scale:r}){let i=tf(),a=Nm(e.images,t,n),[o,s]=(0,v.useState)(null),c=a?.width||(o&&o.src===a?.src?o.width:0)||1080,l=a?.height||(o&&o.src===a?.src?o.height:0)||1440;return(0,Q.jsxs)(`section`,{className:`comparison-reference`,"aria-label":i(`compare.reference`),style:{width:Math.round(c*r),height:Math.round(l*r)},children:[(0,Q.jsxs)(`div`,{className:`comparison-caption`,children:[(0,Q.jsx)(`span`,{children:i(`compare.reference`)}),(0,Q.jsxs)(`span`,{children:[i(`compare.page`,{n:t+1}),` · `,i(`compare.readonly`)]})]}),a?(0,Q.jsx)(Im,{image:a,onSize:(e,t)=>s({src:a.src,width:e,height:t})},a.src):(0,Q.jsxs)(`div`,{className:`comparison-empty`,role:`status`,children:[(0,Q.jsx)($,{name:`image`,size:28}),(0,Q.jsx)(`strong`,{children:i(e.status===`loading`?`compare.loading`:e.status===`failed`?`compare.failed`:`compare.empty`)}),e.status===`failed`?(0,Q.jsx)(`button`,{type:`button`,className:`tb-btn outlined`,onClick:e.retry,children:i(`compare.retry`)}):(0,Q.jsx)(`span`,{children:i(`compare.emptyHint`)})]})]})}function Im({image:e,onSize:t}){let n=tf(),[r,i]=(0,v.useState)(!1);return r?(0,Q.jsxs)(`div`,{className:`comparison-empty`,children:[(0,Q.jsx)($,{name:`image`,size:28}),(0,Q.jsx)(`span`,{children:n(`compare.imageFailed`)}),(0,Q.jsx)(`button`,{type:`button`,className:`tb-btn outlined`,onClick:()=>i(!1),children:n(`compare.retry`)})]}):(0,Q.jsx)(`img`,{className:`comparison-image`,src:e.src,alt:e.name||n(`compare.reference`),draggable:!1,onLoad:e=>t(e.currentTarget.naturalWidth,e.currentTarget.naturalHeight),onError:()=>i(!0)})}async function Lm(e,t,n){let r=e?.ownerDocument.defaultView?.getComputedStyle(e),i=/^url\(["']?(.*?)["']?\)$/.exec(r?.backgroundImage??``);if(!r||!i?.[1])return{};if(![`cover`,`contain`].includes(r.backgroundSize))return!/^[-.\d]+px$/.test(r.backgroundPositionX)||!/^[-.\d]+px$/.test(r.backgroundPositionY)?{}:{"background-position":`${parseFloat(r.backgroundPositionX)-n.x}px ${parseFloat(r.backgroundPositionY)-n.y}px`};let a=new Image;a.src=i[1];try{await a.decode()}catch{return{}}let{naturalWidth:o,naturalHeight:s}=a;if(!o||!s)return{};let c=(r.backgroundSize===`cover`?Math.max:Math.min)(t.width/o,t.height/s),l=o*c,u=s*c,d=(e,t)=>e.endsWith(`%`)?t*parseFloat(e)/100:parseFloat(e)||0;return{"background-size":`${l}px ${u}px`,"background-position":`${d(r.backgroundPositionX,t.width-l)-n.x}px ${d(r.backgroundPositionY,t.height-u)-n.y}px`}}function Rm({request:e,controller:t,scale:n,onClose:r}){let i=tf(),a=t.pageSize(),o=Math.max(0,a.width-e.width),s=Math.max(0,a.height-e.height),[c,l]=(0,v.useState)({x:Math.round(o/2),y:Math.round(s/2)}),u=(0,v.useRef)(null);kd(!0,r);let d=e=>{if(!e.currentTarget.hasPointerCapture(e.pointerId)||!u.current)return;let t=u.current;l({x:Math.round(Math.max(0,Math.min(o,t.left+(e.clientX-t.x)/n))),y:Math.round(Math.max(0,Math.min(s,t.top+(e.clientY-t.y)/n)))})},[f,p]=(0,v.useState)(!1),m=async()=>{if(f)return;p(!0);let{pageId:n,width:i,height:o}=e,s=t.index().elements.get(n)?.children??[],l=c.x===0&&c.y===0?[]:s.flatMap(e=>{let t=od(e),n=t?.ownerDocument.defaultView?.getComputedStyle(t);if(!n||n.display===`none`||t?.tagName===`STYLE`)return[];let r=n.transform===`none`?``:` ${n.transform}`;return[{kind:`setStyle`,id:e,props:{transform:`translate(${-c.x}px, ${-c.y}px)${r}`}}]}),u=await Lm(od(n),a,c);if(t.getSnapshot().currentPageId!==n){r();return}t.applyBatch([{kind:`setAttr`,id:n,name:`data-popost-width`,value:String(i)},{kind:`setAttr`,id:n,name:`data-popost-height`,value:String(o)},{kind:`setStyle`,id:n,props:{width:`${i}px`,height:`${o}px`,overflow:`hidden`,...u}},...l],`resize page`),r()};return(0,Q.jsxs)(`div`,{className:`page-resize-layer`,children:[(0,Q.jsxs)(`div`,{className:`page-resize-actions`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:r,children:i(`design.cancel`)}),(0,Q.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:f,onClick:()=>void m(),children:i(`design.apply`)}),(0,Q.jsxs)(`span`,{children:[e.width,` × `,e.height,` px`]})]}),(0,Q.jsx)(`div`,{className:`page-resize-hit`,onPointerDown:e=>{u.current={x:e.clientX,y:e.clientY,left:c.x,top:c.y},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:d,children:(0,Q.jsx)(`div`,{className:`page-resize-frame`,style:{width:e.width*n,height:e.height*n,left:c.x*n,top:c.y*n}})})]})}var zm=[`nw`,`ne`,`sw`,`se`,`w`,`e`],Bm={nw:[0,0],ne:[100,0],sw:[0,100],se:[100,100],w:[0,50],e:[100,50]},Vm={nw:`nwse-resize`,se:`nwse-resize`,ne:`nesw-resize`,sw:`nesw-resize`,w:`ew-resize`,e:`ew-resize`},Hm=236,Um=36,Wm=(e,t)=>({left:e.x*t,top:e.y*t,width:e.width*t,height:e.height*t});function Gm({controller:e,snap:t,scale:n,width:r,gestures:i,view:a,actions:o}){let s=tf(),{rects:c,selection:l,hoverId:u,editingTextId:d}=t,f=l.filter(e=>c[e]),p=Cp(f.map(e=>c[e])),m=f.length===1?f[0]:null,h=d!==null,g=a.active===`move`||a.active===`resize`,_=u!==null&&!l.includes(u)&&!h&&!g?c[u]:void 0,v=e=>({"data-keepfocus":``,onPointerDown:t=>{t.button===0&&(t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture(t.pointerId),e(t))},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&i.overlayMove(e.clientX,e.clientY,e.altKey)},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&(e.currentTarget.releasePointerCapture(e.pointerId),i.overlayUp())},onPointerCancel:()=>{i.cancel()}}),y=p?p.y*n>=48?p.y*n-Um-8:(p.y+p.height)*n+8:0,b=p?Math.max(0,Math.min(p.x*n,r-Hm)):0,x=m?Wa(e.index(),m):null;return(0,Q.jsxs)(`div`,{className:`overlay`,"aria-hidden":!1,children:[_&&(0,Q.jsx)(`div`,{className:`ov-hover`,style:Wm(_,n)}),f.map(e=>(0,Q.jsx)(`div`,{className:`ov-sel${f.length>1?` multi`:``}${h?` editing`:``}`,style:Wm(c[e],n),"data-sel-id":e},e)),p&&f.length>1&&(0,Q.jsx)(`div`,{className:`ov-group`,style:Wm(p,n)}),p&&m&&!h&&(0,Q.jsx)(`div`,{className:`ov-handles`,style:Wm(p,n),children:zm.map(e=>(0,Q.jsx)(`span`,{className:`ov-handle h-${e}`,"data-handle":e,style:{left:`${Bm[e][0]}%`,top:`${Bm[e][1]}%`,cursor:Vm[e]},...v(t=>i.startResize(e,t.clientX,t.clientY))},e))}),p&&!h&&(0,Q.jsxs)(`div`,{className:`ov-pill${g?` hidden`:``}`,style:{left:b,top:y},role:`toolbar`,"data-keepfocus":``,children:[(0,Q.jsx)(`span`,{className:`pill-grip`,title:s(`pill.move`),...v(e=>i.startPillMove(e.clientX,e.clientY)),children:(0,Q.jsx)($,{name:`grip`})}),f.length>1&&(0,Q.jsx)(`span`,{className:`pill-count`,children:s(`pill.selected`,{n:f.length})}),m&&x!==null&&(0,Q.jsx)(`button`,{type:`button`,className:`pill-btn`,"data-act":`parent`,title:s(`pill.selectParent`),onClick:()=>e.selectParent(),children:(0,Q.jsx)($,{name:`parent`})}),(0,Q.jsx)(`button`,{type:`button`,className:`pill-btn`,"data-act":`duplicate`,title:s(`pill.duplicate`),onClick:o.duplicateSelection,children:(0,Q.jsx)($,{name:`duplicate`})}),(0,Q.jsx)(`button`,{type:`button`,className:`pill-btn danger`,"data-act":`delete`,title:s(`pill.delete`),onClick:o.deleteSelection,children:(0,Q.jsx)($,{name:`trash`})}),m&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`pill-btn`,"data-act":`forward`,title:s(`pill.forward`),onClick:()=>o.reorderSelection(`down`),children:(0,Q.jsx)($,{name:`forward`})}),(0,Q.jsx)(`button`,{type:`button`,className:`pill-btn`,"data-act":`backward`,title:s(`pill.backward`),onClick:()=>o.reorderSelection(`up`),children:(0,Q.jsx)($,{name:`backward`})})]})]}),a.guides.map((e,t)=>e.axis===`x`?(0,Q.jsx)(`div`,{className:`ov-guide v`,style:{left:e.pos*n,top:e.from*n,height:(e.to-e.from)*n}},t):(0,Q.jsx)(`div`,{className:`ov-guide h`,style:{top:e.pos*n,left:e.from*n,width:(e.to-e.from)*n}},t)),a.marquee&&(0,Q.jsx)(`div`,{className:`ov-marquee`,style:Wm(a.marquee,n)}),a.tip&&(0,Q.jsx)(`div`,{className:`ov-tip`,style:{left:a.tip.x*n,top:a.tip.y*n+8},children:a.tip.text})]})}var Km=e=>Math.min(300,Math.max(10,e));function qm(e,t,n=32){if(t.width<=0||t.height<=0)return 100;let r=Math.max(1,e.width-n*2),i=Math.max(1,e.height-n*2);return Math.min(300,Math.max(10,Math.min(r/t.width,i/t.height)*100))}function Jm(e,t){return Km(e*(t>0?1.12:1/1.12))}var Ym=(e,t)=>Km(e*Math.exp(-t*.002));function Xm({comparing:e,references:t,controller:n,snap:r,zoom:i,gestures:a,subscribeView:o,actions:s,cropId:c=null,onExitCrop:l,resize:u,onEndResize:d}){let f=tf(),p=r.pages.findIndex(e=>e.id===r.currentPageId),{stageRef:m,wheel:h}=i,g=(0,v.useRef)(null),[_,y]=(0,v.useState)(Ep),b=n.pageSize(),x=i.percent/100,S=Math.round(b.width*x),C=Math.round(b.height*x),w=(0,v.useRef)(null),T=(0,v.useCallback)(e=>{w.current=e,n.attachFrame(e)},[n]);(0,v.useEffect)(()=>o(y),[o]),(0,v.useEffect)(()=>{let e=w.current;if(!e)return;let t=null,n=()=>{t?.(),t=null;let n=e.contentWindow;if(!n)return;let r=e=>{e.key!==`Escape`||!Od()||(e.preventDefault(),e.stopPropagation(),Dd())};n.addEventListener(`keydown`,r,!0),t=()=>n.removeEventListener(`keydown`,r,!0)};return n(),e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n),t?.()}},[]),(0,v.useEffect)(()=>{let e=g.current;if(!e)return;let t=t=>{!t.ctrlKey&&!t.metaKey||(t.preventDefault(),h(t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?e.clientHeight:1)))};e.addEventListener(`wheel`,t,{passive:!1});let r=n.onFrameEvent(t=>{t.type===`wheel`&&(t.ctrl?h(t.deltaY):e.scrollBy(t.deltaX,t.deltaY))});return()=>{e.removeEventListener(`wheel`,t),r()}},[n,h]);let ee=(0,v.useCallback)(e=>{g.current=e,m(e)},[m]);return(0,Q.jsx)(`div`,{className:`stage`,ref:ee,tabIndex:-1,onMouseDown:e=>{let t=e.target;(t===e.currentTarget||t.classList.contains(`stage-pad`))&&(n.select([]),e.currentTarget.focus({preventScroll:!0}))},children:(0,Q.jsxs)(`div`,{className:`stage-pad${e?` comparing`:``}`,style:{padding:32},children:[e&&(0,Q.jsx)(Fm,{state:t,pageIndex:p,pageKey:r.pages[p]?.pageKey??null,scale:x}),(0,Q.jsxs)(`div`,{className:`canvas`,style:{width:S,height:C},children:[e&&(0,Q.jsxs)(`div`,{className:`comparison-caption result-caption`,children:[(0,Q.jsx)(`span`,{children:f(`compare.result`)}),(0,Q.jsxs)(`span`,{children:[f(`compare.page`,{n:p+1}),` · `,f(`compare.editable`)]})]}),(0,Q.jsx)(`iframe`,{id:`frame`,ref:T,title:`canvas`,style:{width:b.width,height:b.height,transform:`scale(${x})`}}),(0,Q.jsx)(Gm,{controller:n,snap:r,scale:x,width:S,gestures:a,view:_,actions:s}),u&&(0,Q.jsx)(Rm,{request:u,controller:n,scale:x,onClose:d},u.pageId),!u&&c!==null&&l&&(0,Q.jsx)(Pf,{controller:n,snap:r,id:c,scale:x,onExit:l})]})]})})}function Zm({snap:e,zoom:t,actions:n}){let r=tf(),i=e.pages.findIndex(t=>t.id===e.currentPageId),a=e.pages.length;return(0,Q.jsxs)(`div`,{className:`statusbar`,children:[(0,Q.jsxs)(`div`,{className:`sb-group`,children:[(0,Q.jsx)(`button`,{type:`button`,id:`btn-prev-page`,className:`tb-btn small`,disabled:i<=0,title:r(`pages.prev`),"aria-label":r(`pages.prev`),onClick:()=>n.changePage(`prev`),children:(0,Q.jsx)($,{name:`prev`,size:14})}),(0,Q.jsx)(`span`,{id:`page-counter`,className:`page-counter`,children:r(`pages.counter`,{n:i+1,total:a})}),(0,Q.jsx)(`button`,{type:`button`,id:`btn-next-page`,className:`tb-btn small`,disabled:i<0||i>=a-1,title:r(`pages.next`),"aria-label":r(`pages.next`),onClick:()=>n.changePage(`next`),children:(0,Q.jsx)($,{name:`next`,size:14})})]}),(0,Q.jsx)(`div`,{className:`sb-spacer`}),(0,Q.jsxs)(`div`,{className:`sb-group zoom-group`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`tb-btn small`,"aria-label":r(`zoom.out`),disabled:t.percent<=10,onClick:()=>t.step(-1),children:(0,Q.jsx)($,{name:`minus`,size:15})}),(0,Q.jsx)(`button`,{type:`button`,className:`tb-btn small`,"aria-label":r(`zoom.in`),disabled:t.percent>=300,onClick:()=>t.step(1),children:(0,Q.jsx)($,{name:`plus`,size:15})}),(0,Q.jsx)(`input`,{id:`zoom-slider`,type:`range`,min:10,max:300,step:1,value:Math.round(t.percent),"aria-label":r(`zoom.slider`),onChange:e=>t.set(Number(e.currentTarget.value))}),(0,Q.jsxs)(`button`,{type:`button`,id:`zoom-label`,className:`zoom-label`,title:r(`zoom.fit`),onClick:t.fit,children:[Math.round(t.percent),`%`]})]})]})}var Qm=2e3;function $m(e,t){let n=`cloud.error.${t??``}`;return n in Zd.en?e(n):e(`cloud.error.generic`)}function eh({href:e,t}){return e?(0,Q.jsx)(`a`,{className:`cloud-link`,href:e,target:`_blank`,rel:`noopener noreferrer`,title:t(`cloud.openTitle`),children:t(`cloud.open`)}):null}function th({mode:e,status:t,link:n,copied:r,busy:i,onStart:a,onPush:o,onRetry:s,onCopy:c}){let l=tf(),u=i===`push`?`uploading`:i===`start`?`starting`:t?.state??`idle`,d=e=>(0,Q.jsx)(`span`,{className:`tb-label`,children:l(e)});if(u===`uploading`)return(0,Q.jsxs)(`span`,{className:`cloud-state`,role:`status`,children:[(0,Q.jsx)(`i`,{className:`spinner small`}),l(e===`keyed`?`cloud.syncing`:`cloud.uploading`)]});if(u===`starting`)return(0,Q.jsxs)(`span`,{className:`cloud-state`,role:`status`,children:[(0,Q.jsx)(`i`,{className:`spinner small`}),l(`cloud.waiting`)]});if(u===`waiting`)return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`cloud-state`,role:`status`,children:[(0,Q.jsx)(`i`,{className:`spinner small`}),l(`cloud.waiting`)]}),(0,Q.jsx)(`button`,{type:`button`,className:`tb-btn outlined cloud-copy`,onClick:c,children:l(r?`cloud.linkCopied`:`cloud.copyLink`)}),n&&(0,Q.jsx)(`input`,{className:`cloud-link-input`,readOnly:!0,value:n,"aria-label":l(`cloud.loginLink`),onFocus:e=>e.currentTarget.select()})]});if(u===`saved`)return(0,Q.jsxs)(`span`,{className:`cloud-state`,role:`status`,children:[(0,Q.jsx)($,{name:`check`,size:14}),l(e===`keyed`?`cloud.synced`:`cloud.saved`),(0,Q.jsx)(eh,{href:t?.webUrl,t:l})]});if(u===`failed`)return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`cloud-state cloud-error`,role:`status`,title:t?.error?.message,children:$m(l,t?.error?.code)}),(0,Q.jsx)(`button`,{type:`button`,className:`tb-btn outlined`,onClick:s,children:l(`cloud.retry`)})]});if(u===`conflict`)return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`cloud-state cloud-error`,role:`status`,children:[l(`cloud.conflict`),(0,Q.jsx)(eh,{href:t?.webUrl,t:l})]}),e===`keyed`?(0,Q.jsx)(`button`,{type:`button`,className:`tb-btn outlined`,title:l(`cloud.overwriteTitle`),onClick:()=>o(!0),children:l(`cloud.overwrite`)}):null]});if(e===`keyed`)return(0,Q.jsxs)(`button`,{type:`button`,className:`tb-btn outlined cloud-btn`,onClick:()=>o(!1),children:[(0,Q.jsx)($,{name:`cloud`}),d(`cloud.syncNow`)]});let f=!!(t?.webUrl&&t.dirty);return(0,Q.jsxs)(`button`,{type:`button`,className:`tb-btn outlined cloud-btn`,title:l(`cloud.tooltip`),"aria-label":l(`cloud.save`),onClick:a,children:[(0,Q.jsx)($,{name:`cloud`}),(0,Q.jsx)(`span`,{className:`tb-label`,children:l(f?`cloud.dirty`:`cloud.save`)})]})}var nh=e=>({code:e instanceof Error&&`status`in e?`ERROR`:`NETWORK`,message:e instanceof Error?e.message:String(e)});function rh({cloud:e,saveState:t,saveLocal:n}){let r=nf(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),g=(0,v.useRef)(!0),_=(0,v.useRef)(`push`);(0,v.useEffect)(()=>(g.current=!0,()=>{g.current=!1}),[]);let y=(0,v.useCallback)(async()=>{try{let t=await e.status();g.current&&a(t)}catch{}},[e]);(0,v.useEffect)(()=>void y(),[y,t]);let b=c!==null||i?.state===`waiting`||i?.state===`uploading`||e.mode===`keyed`&&i?.state===`idle`&&i.dirty;(0,v.useEffect)(()=>{if(!b)return;let e=setInterval(()=>void y(),Qm);return()=>clearInterval(e)},[b,y]);let x=(0,v.useCallback)(async()=>{let t=window.open(`about:blank`,`_blank`);_.current=`start`,s(void 0),h(!1),l(`start`);try{if(!await n()){t?.close(),s({code:`LOCAL_SAVE_FAILED`,message:``});return}let{authorizeUrl:i}=await e.start(r);d(i),p(!t),t&&(t.opener=null,t.location.href=i),_.current=`push`,await y()}catch(e){t?.close(),s(nh(e))}finally{l(null)}},[e,r,y,n]),S=(0,v.useCallback)(async t=>{_.current=`push`,s(void 0),l(`push`);try{if(!await n()){s({code:`LOCAL_SAVE_FAILED`,message:``});return}let i=await e.push({force:t,lang:r});if(i.ok===!1&&i.error?.code===`LOGIN_REQUIRED`){l(null),await x();return}g.current&&a(i)}catch(e){s(nh(e))}finally{l(null)}},[e,r,n,x]),C=(0,v.useCallback)(async()=>{try{await navigator.clipboard.writeText(u??``),h(!0)}catch{p(!0)}},[u]),w=i??{ok:!1,mode:e.mode,state:`idle`,dirty:!0},T=o?{...w,state:`failed`,error:o}:i,ee=e.mode===`anonymous`&&(T?.error?.code===`UNAUTHORIZED`||T?.error?.code===`LOGIN_REQUIRED`);return(0,Q.jsx)(`div`,{className:`cloud`,children:(0,Q.jsx)(th,{mode:e.mode,status:T,link:f&&i?.state===`waiting`?u:null,copied:m,busy:c,onStart:()=>void x(),onPush:e=>void S(e),onRetry:()=>void(ee||_.current===`start`?x():S(!1)),onCopy:()=>void C()})})}var ih=h(),ah=`modulepreload`,oh=function(e,t){return new URL(e,t).href},sh={},ch=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=oh(t,n),t=s(t),t in sh)return;sh[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ah,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},lh=[`png`,`jpg`,`svg`,`psd`,`html`,`pdf`],uh=`position:fixed;left:-20000px;top:0;width:4000px;height:4000px;border:0;`,dh=e=>[...e.querySelectorAll(`.slide`)].filter(e=>!e.parentElement?.closest(`.slide`)),fh=e=>e.replace(/[\\/:*?"<>|\u0000-\u001f]+/g,` `).trim()||`deck`,ph=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),3e3)},mh=async(e,t=!1)=>{let n=document.createElement(`iframe`);n.setAttribute(`sandbox`,`allow-same-origin`),n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1,n.style.cssText=uh;let r=new Promise(e=>{n.onload=()=>e()});n.srcdoc=t?e.replace(/<head>/i,`<head><base href="${location.origin}/pages/"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; base-uri 'self'">`):e,document.body.append(n),await r;let i=n.contentDocument;if(!i)throw n.remove(),Error(`stage unavailable`);return await i.fonts.ready,await Promise.all([...i.images].map(e=>e.decode().catch(()=>void 0))),{frame:n,doc:i}},hh=64e6,gh=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Export resource unavailable`);let n=await t.blob();return new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(String(r.result)),r.onerror=()=>t(r.error),r.readAsDataURL(n)})},_h=async(e,t)=>{let n=t?/(?:\.\.\/|\/)(?:assets|fonts|css)\/[^"'()\s<>,]+/g:/\/(?:api\/assets|fonts)\/[^"'()\s<>]+/g,r=[...new Set(e.match(n)??[])],i=await Promise.all(r.map(async e=>[e,await gh(t?new URL(e,location.origin+`/pages/`).href:e)])),a=new Map(i);return e.replace(n,e=>a.get(e)??e)},vh=async(e,t=()=>{},n=!1)=>{let[{toCanvas:r,toSvg:i},{default:a}]=await Promise.all([ch(()=>import(`./es-C_Ha8SM2.js`),[],import.meta.url),ch(()=>import(`./jszip.min-Cw2BF2G0.js`).then(e=>c(e.default,1)),[],import.meta.url)]),{frame:o,doc:s}=await mh(e.html,n);try{let o=dh(s),l=[...new Set(e.pages)].sort((e,t)=>e-t);if(!l.length||l.some(e=>!o[e]))throw Error(`Invalid export pages`);let u=fh(e.name),d=new a,f=e.format===`pdf`?await(await ch(async()=>{let{PDFDocument:e}=await import(`./es-DzkTYs_E.js`);return{PDFDocument:e}},[],import.meta.url)).PDFDocument.create():null,p=e.format===`psd`?await ch(()=>import(`./dist-Ag5yM9-G.js`).then(e=>c(e.default,1)),[],import.meta.url):null;for(let[a,c]of l.entries()){let m=o[c],h=`${u}-${c+1}.${e.format}`,g=m.offsetWidth,_=m.offsetHeight;if(e.format===`html`){let e=s.documentElement.cloneNode(!0);e.querySelector(`base`)?.remove(),dh(e).forEach((e,t)=>{c!==t&&e.remove()}),d.file(h,await _h(`<!doctype html>${e.outerHTML}`,n))}else{if(!g||!_||g*_*e.scale**2>hh)throw Error(`Export dimensions exceed the browser limit`);let t={pixelRatio:e.scale,skipAutoScale:!0,cacheBust:!1,style:{margin:`0`},width:g,height:_};if(e.format===`svg`){let n=await i(m,t),r=decodeURIComponent(n.slice(n.indexOf(`,`)+1)),a=new DOMParser().parseFromString(r,`image/svg+xml`).documentElement;if(a.localName!==`svg`)throw Error(`Invalid SVG export`);a.setAttribute(`width`,String(g*e.scale)),a.setAttribute(`height`,String(_*e.scale)),a.setAttribute(`viewBox`,`0 0 ${g} ${_}`),d.file(h,new XMLSerializer().serializeToString(a))}else{let n=await r(m,e.format===`jpg`||f?{...t,backgroundColor:`#ffffff`}:t);if(n.width!==g*e.scale||n.height!==_*e.scale)throw Error(`Unexpected export resolution`);if(p){let e=n.getContext(`2d`)?.getImageData(0,0,n.width,n.height);if(!e)throw Error(`Could not read canvas pixels`);d.file(h,p.writePsd({width:n.width,height:n.height,imageData:e,children:[{name:`Artwork`,imageData:e,opacity:1}]}))}else{let t=e.format===`jpg`||f!==null,r=n.toDataURL(t?`image/jpeg`:`image/png`,.95);if(f){let e=await f.embedJpg(r),t=f.addPage([g*.75,_*.75]);t.drawImage(e,{x:0,y:0,width:t.getWidth(),height:t.getHeight()})}else d.file(h,r.slice(r.indexOf(`,`)+1),{base64:!0})}}}t(a+1,l.length,(a+1)/l.length*.9)}f&&d.file(`${u}.pdf`,await f.save()),ph(await d.generateAsync({type:`blob`},({percent:e})=>t(l.length,l.length,.9+e/1e3)),`${u}.zip`)}finally{o.remove()}},yh=[`svg`,`psd`,`pdf`];function bh({controller:e,snap:t,customName:n,onNameChange:r,onClose:i,local:a}){let o=tf(),s=nf(),c=Tf(),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(`png`),[p,m]=(0,v.useState)(1),h=n??(t.name||`Popost`),[g,_]=(0,v.useState)(null),y=(0,v.useRef)(null),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(null),ee=(0,v.useRef)(null),E=(0,v.useRef)(null),[D,O]=(0,v.useState)(!1),[te,k]=(0,v.useState)({completed:0,total:0,fraction:0}),A=t.pages.filter(e=>!l.includes(e.id)),ne=A[0],re=e.index(),ie=(0,v.useMemo)(()=>t.pages.map(e=>co(re,{frameCSS:mp,baseHref:location.origin+(a?`/pages/`:`/`),imageOrigins:vs(),currentPageId:e.id})),[re,t.pages,a]);(0,v.useEffect)(()=>{if(a){let e=!0;return fetch(`/api/export-options`,{cache:`no-store`}).then(e=>e.json()).then(t=>{e&&x(t.premium===!0)}).catch(()=>{}),()=>{e=!1}}let e=!0;ad(`export-options`).then(t=>{e&&x(t.premium)}).catch(()=>{});let t=e=>{if(!ls(e,`popost-workspace`))return;let t=e.data;t.type===`export-progress`&&t.id===id()&&k({completed:t.completed,total:t.total,fraction:t.fraction})};return window.addEventListener(`message`,t),()=>{e=!1,window.removeEventListener(`message`,t)}},[a]);let j=(0,v.useCallback)(()=>{C(null),T(null)},[]);kd(S!==null,()=>{S?.anchor.focus(),j()}),(0,v.useLayoutEffect)(()=>{let e=ee.current,t=E.current;if(!S||!e||!t)return;let n=()=>{let n=S.anchor.getBoundingClientRect(),r=t.getBoundingClientRect();if(n.bottom<=r.top||n.top>=r.bottom){j();return}let i=Math.min(270,window.innerWidth-16),a=window.innerHeight-n.bottom-6-8,o=n.top-6-8,s=e.scrollHeight>a&&o>a;Object.assign(e.style,{width:`${i}px`,left:`${Math.max(8,Math.min(n.right-i,window.innerWidth-i-8))}px`,maxHeight:`${Math.max(0,s?o:a)}px`,top:s?`auto`:`${n.bottom+6}px`,bottom:s?`${window.innerHeight-n.top+6}px`:`auto`})};n(),t.addEventListener(`scroll`,n),window.addEventListener(`resize`,n);let r=t=>{t.target instanceof Node&&!e.contains(t.target)&&!S.anchor.contains(t.target)&&j()};return document.addEventListener(`pointerdown`,r,!0),S.focusOptions&&e.querySelector(`[aria-pressed=true]`)?.focus(),()=>{t.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n),document.removeEventListener(`pointerdown`,r,!0)}},[S,j]);let M=(e,t=!1)=>{let n=g?.trim();e&&n&&r(n),_(null),t&&requestAnimationFrame(()=>y.current?.focus())},ae=async()=>{if(!(!A.length||D)){e.endTextEdit(!0),k({completed:0,total:A.length,fraction:0}),O(!0),j();try{let n={html:Lu(e.index().source),name:g?.trim()||h,pages:t.pages.flatMap((e,t)=>l.includes(e.id)?[]:[t]),format:d,scale:d===`html`?1:p};a?await vh(n,(e,t,n)=>k({completed:e,total:t,fraction:n}),!0):await ad(`export`,n,3e5),c(o(`export.done`),`info`),i()}catch(e){c(e instanceof Error&&e.message?e.message:o(`export.failed`),`error`)}finally{O(!1)}}},oe=(e,t,n)=>{C(r=>r?.kind===e?null:{kind:e,anchor:t,focusOptions:n}),T(null)},N=(e,t)=>t&&(0,Q.jsx)(`button`,{type:`button`,className:`export-gem`,"aria-label":o(`export.paid`),"aria-expanded":w===e,onMouseEnter:()=>T(e),onFocus:()=>T(e),onClick:()=>T(e),children:(0,Q.jsx)($,{name:`gem`,size:15})}),P=(e,t,n)=>{t?T(e):(n(),S?.focusOptions&&S.anchor.focus(),j())},F=e=>w===e&&(0,Q.jsxs)(`div`,{className:`export-upgrade`,children:[(0,Q.jsx)(`span`,{children:o(`export.upgrade`)}),(0,Q.jsx)(`a`,{href:a?`https://popost.ai/${s}/pricing`:`/${s}/pricing`,target:`_blank`,rel:`noopener noreferrer`,children:o(`export.pricing`)})]});return(0,Q.jsxs)(`div`,{id:`pop-export`,ref:E,className:`popover export-panel`,role:`dialog`,"aria-label":o(`topbar.export`),children:[(0,Q.jsxs)(`fieldset`,{disabled:D,children:[(0,Q.jsxs)(`section`,{className:`export-section`,children:[(0,Q.jsxs)(`div`,{className:`export-section-head`,children:[(0,Q.jsx)(`strong`,{children:o(`export.pages`,{n:A.length,total:t.pages.length})}),(0,Q.jsxs)(`label`,{children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:l.length===0,onChange:e=>u(e.currentTarget.checked?[]:t.pages.map(e=>e.id))}),o(`export.all`)]})]}),(0,Q.jsx)(`div`,{className:`export-pages`,children:t.pages.map((e,t)=>{let n=Math.min(78/e.width,78/e.height),r=!l.includes(e.id);return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>u(t=>r?[...t,e.id]:t.filter(t=>t!==e.id)),children:[(0,Q.jsxs)(`span`,{className:`export-thumb`,children:[(0,Q.jsx)(`span`,{style:{width:e.width*n,height:e.height*n},children:(0,Q.jsx)(`iframe`,{title:e.name,"aria-hidden":`true`,tabIndex:-1,sandbox:`allow-same-origin`,onLoad:e=>gp(e.currentTarget),srcDoc:ie[t],style:{width:e.width,height:e.height,transform:`scale(${n})`}})}),r&&(0,Q.jsx)(`i`,{children:(0,Q.jsx)($,{name:`check`,size:12})})]}),(0,Q.jsx)(`b`,{children:e.name}),(0,Q.jsxs)(`small`,{children:[e.width,` × `,e.height]})]},e.id)})})]}),(0,Q.jsxs)(`section`,{className:`export-section export-settings`,children:[(0,Q.jsxs)(`div`,{className:`export-row`,children:[(0,Q.jsx)(`span`,{children:o(`export.format`)}),(0,Q.jsxs)(`button`,{className:`btn`,type:`button`,"aria-expanded":S?.kind===`format`,"aria-controls":S?.kind===`format`?`export-options`:void 0,onClick:e=>oe(`format`,e.currentTarget,e.detail===0),children:[d.toUpperCase(),` `,(0,Q.jsx)($,{name:`chevron`,size:12})]})]}),(0,Q.jsxs)(`div`,{className:`export-row`,children:[(0,Q.jsx)(`span`,{children:o(`export.resolution`)}),(0,Q.jsxs)(`button`,{className:`btn`,type:`button`,disabled:d===`html`,"aria-expanded":S?.kind===`scale`,"aria-controls":S?.kind===`scale`?`export-options`:void 0,onClick:e=>oe(`scale`,e.currentTarget,e.detail===0),children:[o(p===1||d===`html`?`export.standard`:`export.high`),` · `,d===`html`?1:p,`× `,(0,Q.jsx)($,{name:`chevron`,size:12})]})]}),(0,Q.jsxs)(`div`,{className:`export-row`,children:[(0,Q.jsx)(`span`,{children:o(`export.name`)}),g===null?(0,Q.jsxs)(`button`,{type:`button`,className:`btn export-name`,ref:y,title:o(`export.editName`),"aria-label":o(`export.editName`),onClick:()=>_(h),children:[(0,Q.jsx)(`span`,{children:h}),(0,Q.jsx)($,{name:`pencil`,size:14})]}):(0,Q.jsxs)(`form`,{className:`export-name-editor`,onSubmit:e=>{e.preventDefault(),M(!0,!0)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||M(!0)},onKeyDown:e=>{e.key!==`Escape`||e.nativeEvent.isComposing||(e.stopPropagation(),M(!1,!0))},children:[(0,Q.jsx)(`input`,{autoFocus:!0,maxLength:160,"aria-label":o(`export.name`),value:g,onFocus:e=>e.currentTarget.select(),onChange:e=>_(e.currentTarget.value)}),(0,Q.jsx)(`button`,{type:`submit`,className:`btn`,onPointerDown:e=>e.preventDefault(),title:o(`export.confirmName`),"aria-label":o(`export.confirmName`),children:(0,Q.jsx)($,{name:`check`,size:15})})]})]})]})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`btn export-start`,disabled:D||!A.length,onClick:()=>void ae(),children:[D&&(0,Q.jsx)(`i`,{style:{width:`${Math.round(te.fraction*100)}%`}}),(0,Q.jsx)(`span`,{children:D?o(`export.progress`,{percent:Math.round(te.fraction*100),done:te.completed,total:te.total}):o(`topbar.export`)})]}),S&&(0,ih.createPortal)((0,Q.jsx)(`div`,{id:`export-options`,className:`export-select`,ref:ee,role:`group`,"aria-label":o(S.kind===`format`?`export.format`:`export.resolution`),children:S.kind===`format`?(0,Q.jsx)(Q.Fragment,{children:lh.map((e,t)=>{let n=yh.includes(e)&&!b;return(0,Q.jsxs)(`div`,{children:[t===0||t===4?(0,Q.jsx)(`small`,{className:`export-category`,children:o(t===0?`export.imageFormats`:`export.documentFormats`)}):null,(0,Q.jsxs)(`div`,{className:`export-option`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`export-option-label`,"aria-pressed":e===d,onClick:()=>P(e,n,()=>f(e)),children:e.toUpperCase()}),N(e,n)]}),F(e)]},e)})}):(0,Q.jsx)(Q.Fragment,{children:[1,2,3,4].map(e=>{let t=e>1&&!b;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`export-option`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`export-option-label`,"aria-pressed":e===p,onClick:()=>P(e,t,()=>m(e)),children:[o(e===1?`export.standard`:`export.high`),` · `,e,`×`,ne&&(0,Q.jsxs)(`small`,{children:[ne.width*e,` × `,ne.height*e,` px`]})]}),N(e,t)]}),F(e)]},e)})})}),document.body)]})}var xh=[[`1:1`,1080,1080],[`3:4`,1080,1440],[`4:3`,1440,1080],[`16:9`,1920,1080],[`9:16`,1080,1920]],Sh=[[`TikTok`,1080,1920],[`Instagram`,1080,1080],[`Instagram 4:5`,1080,1350],[`X`,1600,900],[`小红书`,1080,1440]],Ch=({width:e,height:t})=>[e,t].every(e=>Number.isInteger(e)&&e>=16&&e<=12e3);function wh({value:e,onChange:t,zh:n,smart:r}){let[i,a]=(0,v.useState)(`common`),[o,s]=(0,v.useState)(null),c=o??e,l=e=>{s(null),Ch(e)&&t(e)};return(0,Q.jsxs)(`div`,{className:`pp-size-picker`,children:[(0,Q.jsxs)(`div`,{className:`pp-size-tabs`,role:`tablist`,"aria-label":n?`尺寸类别`:`Size categories`,children:[(0,Q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":i===`common`,onClick:()=>a(`common`),children:n?`常规`:`Common`}),(0,Q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":i===`social`,onClick:()=>a(`social`),children:n?`社媒`:`Social`})]}),(0,Q.jsxs)(`div`,{className:`pp-size-main`,children:[(0,Q.jsxs)(`form`,{className:`pp-size-inputs`,onSubmit:e=>{e.preventDefault(),l(c)},children:[[`width`,`height`].map(e=>(0,Q.jsxs)(`label`,{children:[e===`width`?`W`:`H`,(0,Q.jsx)(`input`,{"aria-label":e===`width`?n?`宽度`:`Width`:n?`高度`:`Height`,type:`number`,min:`16`,max:`12000`,value:c[e]||``,onChange:t=>s({...c,[e]:Number(t.currentTarget.value)})})]},e)),o&&(0,Q.jsx)(`button`,{type:`submit`,disabled:!Ch(o),children:n?`应用`:`Apply`})]}),i===`common`&&r,(0,Q.jsx)(`div`,{className:`pp-size-presets`,role:`group`,children:(i===`common`?xh:Sh).map(([t,r,i])=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":r===e.width&&i===e.height,onClick:()=>l({width:r,height:i}),children:[(0,Q.jsx)(`i`,{style:{width:22*Math.min(1,r/i),height:22*Math.min(1,i/r)}}),(0,Q.jsxs)(`span`,{children:[t===`小红书`&&!n?`RedNote`:t,(0,Q.jsxs)(`small`,{children:[r,` × `,i]})]})]},t))})]})]})}function Th({controller:e,snap:t,onSize:n}){let r=tf(),i=nf(),[a,o]=(0,v.useState)(null);kd(a!==null,()=>o(null));let s=t.pages.find(e=>e.id===t.currentPageId),c=$f(e,t.sourceVersion),l=s&&od(s.id),u=l?.ownerDocument.defaultView?.getComputedStyle(l).backgroundColor,d=fd(u);return(0,Q.jsxs)(`div`,{className:`tb-group page-design`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`tb-btn`,disabled:!s,"aria-expanded":a===`size`,"aria-label":r(`design.size`),onClick:()=>o(a===`size`?null:`size`),children:[(0,Q.jsx)($,{name:`crop`}),(0,Q.jsx)(`span`,{className:`tb-text`,children:r(`design.size`)}),(0,Q.jsx)(`span`,{className:`tb-caret`,children:(0,Q.jsx)($,{name:`chevron`,size:12})})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`tb-btn`,disabled:!s,"aria-expanded":a===`color`,"aria-label":r(`design.background`),onClick:()=>o(a===`color`?null:`color`),children:[(0,Q.jsx)(`i`,{className:`background-sample`,style:{background:d?void 0:u}}),(0,Q.jsx)(`span`,{className:`tb-text`,children:r(`design.background`)})]}),a&&s&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`menu-scrim`,onMouseDown:()=>o(null)}),(0,Q.jsx)(`div`,{className:`popover page-design-pop ${a}`,children:a===`size`?(0,Q.jsx)(wh,{value:s,zh:i===`zh`,onChange:e=>{o(null),(e.width!==s.width||e.height!==s.height)&&n({...e,pageId:s.id})}}):(0,Q.jsx)(Zf,{expanded:!0,docColors:c,current:d?`transparent`:md(u),allowNone:!0,onPick:(t,n)=>{e.apply({kind:`setStyle`,id:s.id,props:{"background-color":t}},{label:`page background`,coalesceKey:n===`live`?`page background`:void 0})}})})]})]})}var Eh={saved:`save.saved`,dirty:`save.dirty`,saving:`save.saving`,error:`save.error`};function Dh({controller:e,snap:t,onSize:n,comparing:r,onCompare:i,local:a=!1,canCompare:o=!1}){let s=tf(),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=a||!!id();kd(c,()=>l(!1));let p=t.docState===`ready`,m=(0,v.useCallback)(async()=>{await e.save();let t=e.getSnapshot();return t.docState===`ready`&&t.saveState===`saved`},[e]);return(0,Q.jsxs)(`header`,{className:`topbar`,children:[(0,Q.jsxs)(`div`,{className:`tb-group`,children:[(0,Q.jsx)(`button`,{type:`button`,id:`btn-undo`,className:`tb-btn`,disabled:!t.canUndo,title:s(`topbar.undo`),"aria-label":s(`topbar.undo`),onClick:e.undo,children:(0,Q.jsx)($,{name:`undo`})}),(0,Q.jsx)(`button`,{type:`button`,id:`btn-redo`,className:`tb-btn`,disabled:!t.canRedo,title:s(`topbar.redo`),"aria-label":s(`topbar.redo`),onClick:e.redo,children:(0,Q.jsx)($,{name:`redo`})}),(0,Q.jsx)(`span`,{className:`tb-sep`}),(0,Q.jsxs)(`button`,{type:`button`,id:`btn-reset-layout`,className:`tb-btn`,disabled:!p,title:s(`topbar.resetLayout`),onClick:()=>void e.resetToInitial(),children:[(0,Q.jsx)($,{name:`reset`}),(0,Q.jsx)(`span`,{className:`tb-label`,children:s(`topbar.resetLayout`)})]})]}),(0,Q.jsx)(Th,{controller:e,snap:t,onSize:n}),o&&(0,Q.jsxs)(`button`,{type:`button`,className:`tb-btn compare-toggle${r?` active`:``}`,disabled:!p,"aria-pressed":r,"aria-label":s(r?`compare.close`:`compare.open`),onClick:i,children:[(0,Q.jsx)($,{name:`compare`}),(0,Q.jsx)(`span`,{className:`tb-text`,children:s(r?`compare.close`:`compare.open`)})]}),(0,Q.jsx)(`div`,{className:`tb-spacer`}),(0,Q.jsxs)(`span`,{className:`save-state state-${t.saveState}`,role:`status`,children:[(0,Q.jsx)(`i`,{className:`state-dot`}),(0,Q.jsx)(`span`,{className:`save-text`,children:s(Eh[t.saveState])})]}),(0,Q.jsxs)(`div`,{className:`tb-menu`,children:[(0,Q.jsxs)(`button`,{type:`button`,id:`btn-export`,className:`tb-btn outlined`,disabled:!p,"aria-haspopup":f?`dialog`:`menu`,"aria-expanded":c,title:s(`topbar.export`),onClick:()=>l(e=>!e),children:[(0,Q.jsx)($,{name:`export`}),(0,Q.jsx)(`span`,{className:`tb-label`,children:s(`topbar.export`)}),(0,Q.jsx)(`span`,{className:`tb-caret`,children:(0,Q.jsx)($,{name:`chevron`,size:12})})]}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`menu-scrim`,onMouseDown:()=>l(!1)}),f?(0,Q.jsx)(bh,{local:a,controller:e,snap:t,customName:u,onNameChange:d,onClose:()=>l(!1)}):(0,Q.jsxs)(`div`,{id:`pop-export`,className:`popover`,role:`menu`,children:[(0,Q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`menu-item`,onClick:()=>{l(!1),e.downloadAll()},children:s(`topbar.downloadImages`)}),(0,Q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`menu-item`,onClick:()=>{l(!1),e.exportHTML()},children:s(`topbar.exportHtml`)})]})]})]}),e.cloud&&p&&(0,Q.jsx)(rh,{cloud:e.cloud,saveState:t.saveState,saveLocal:m}),(0,Q.jsxs)(`button`,{type:`button`,id:`btn-save`,className:`btn-save`,disabled:!p||t.saveState===`saving`,title:s(`topbar.saveTitle`),onClick:()=>void e.save(),children:[t.saveState!==`saved`&&(0,Q.jsx)(`i`,{className:`save-dot`}),s(`topbar.save`)]})]})}function Oh(e,t=!1){let[n,r]=(0,v.useState)(`fit`),[i,a]=(0,v.useState)({width:0,height:0}),o=(0,v.useRef)(null),s=(0,v.useCallback)(e=>{if(o.current?.disconnect(),o.current=null,!e)return;let t=()=>a(t=>t.width===e.clientWidth&&t.height===e.clientHeight?t:{width:e.clientWidth,height:e.clientHeight});t(),typeof ResizeObserver==`function`&&(o.current=new ResizeObserver(t),o.current.observe(e))},[]);(0,v.useEffect)(()=>()=>o.current?.disconnect(),[]);let c=t?{width:(i.width-64-28)/2+64,height:i.height-40}:i,l=n===`fit`?qm(c,e):n,u=(0,v.useRef)(l),d=(0,v.useRef)(null),f=(0,v.useRef)(null);u.current=l;let p=(0,v.useCallback)(()=>{f.current!==null&&cancelAnimationFrame(f.current),f.current=null,d.current=null},[]);(0,v.useEffect)(()=>p,[p]);let m=(0,v.useCallback)(e=>{if(d.current=e,f.current!==null)return;if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){u.current=e,d.current=null,r(e);return}let t=()=>{let e=d.current;if(e===null)return;let n=e-u.current,i=Math.abs(n)<.12?e:u.current+n*.38;u.current=i,r(i),i===e?(f.current=null,d.current=null):f.current=requestAnimationFrame(t)};f.current=requestAnimationFrame(t)},[]),h=(0,v.useCallback)(e=>{p(),r(Km(e))},[p]),g=(0,v.useCallback)(()=>{p(),r(`fit`)},[p]),_=(0,v.useCallback)(e=>{m(Jm(d.current??u.current,e))},[m]),y=(0,v.useCallback)(e=>{m(Ym(d.current??u.current,e))},[m]),b=(0,v.useCallback)(()=>u.current,[]);return{percent:l,fitting:n===`fit`,stageRef:s,set:h,fit:g,step:_,wheel:y,get:b}}function kh({controller:e,lang:t,baseHref:n}){return(0,Q.jsx)(ef,{lang:t,children:(0,Q.jsx)(Df,{children:(0,Q.jsx)(Nh,{controller:e,baseHref:n})})})}var Ah=900,jh=120;function Mh(e){e.target.closest(`button, [data-keepfocus]`)&&e.preventDefault()}function Nh({controller:e,baseHref:t}){let n=tf(),r=Tf(),i=ip(e),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),d=(0,v.useMemo)(()=>({id:l,setId:u}),[l]),f=(0,v.useCallback)(()=>u(null),[]);Mf(e),(0,v.useEffect)(()=>e.onFrameEvent(t=>{t.type===`pointer`&&t.action===`dblclick`&&t.id!==null&&jf(e,t.id)&&u(t.id)}),[e]);let p=e.pageSize(),m=xs(),h=m?.comparison===!0,[g,_]=(0,v.useState)(()=>h||new URLSearchParams(window.location.search).get(`compare`)===`1`),y=Pm(!!m),b=g,x=Oh(p,b),S=()=>{_(e=>!e),x.fit()},C=(0,v.useRef)(x);C.current=x;let w=(0,v.useRef)(new Set),T=(0,v.useRef)(Ep),ee=(0,v.useCallback)(e=>(w.current.add(e),e(T.current),()=>{w.current.delete(e)}),[]),E=(0,v.useMemo)(()=>new kp({controller:e,getZoom:()=>C.current.get()/100,onView:e=>{T.current=e,w.current.forEach(t=>t(e))}}),[e]);(0,v.useEffect)(()=>E.attach(),[E]);let D=(0,v.useMemo)(()=>qd({controller:e,gestures:E,toast:r,t:n,zoom:{step:e=>C.current.step(e),fit:()=>C.current.fit()}}),[e,E,r,n]);(0,v.useEffect)(()=>{let t=null,i=()=>{if(t===null||e.getSnapshot().docState!==`ready`)return;let i=t;t=null,e.endTextEdit(!0);let a=e.replaceSource(i);r(n(a===null?`history.draftRestored`:`history.draftFailed`),a===null?`info`:`error`)},a=e=>{!ls(e,`popost-workspace`)||e.data.id!==id()||e.data.type!==`restore-draft`||typeof e.data.html!=`string`||(t=e.data.html,i())};window.addEventListener(`message`,a);let o=e.subscribe(i);return()=>{o(),window.removeEventListener(`message`,a)}},[e,n,r]),(0,v.useEffect)(()=>e.onNotice(e=>{e.key!==`textOverflow`&&r(af(n,e),e.kind===`error`?`error`:`info`)}),[e,r,n]),(0,v.useEffect)(()=>{let t=(t,n)=>{let r=e.getSnapshot();if(r.docState!==`ready`||r.conflict)return!1;let i=jp(t,{selectionCount:r.selection.length,editing:r.editingTextId!==null});return!i||n&&i.type!==`save`&&!(i.type===`escape`&&Od())?!1:D.run(i)},n=e=>{if(e.isComposing||e.keyCode===229)return;let n=e.target;if(!e.ctrlKey&&!e.metaKey&&n?.closest(`.rail, #panel`)&&n.tagName===`BUTTON`&&e.key!==`Escape`)return;let r={key:e.key,ctrl:e.ctrlKey,meta:e.metaKey,shift:e.shiftKey,alt:e.altKey};t(r,Np(e.target))&&e.preventDefault()};window.addEventListener(`keydown`,n);let r=e.onFrameEvent(e=>{e.type===`key`&&t({key:e.key,ctrl:e.ctrl,meta:e.meta,shift:e.shift,alt:e.alt},!1)});return()=>{window.removeEventListener(`keydown`,n),r()}},[e,D]),(0,v.useEffect)(()=>{if(window.innerWidth<Ah)return;let e=setTimeout(()=>o(e=>e??`layers`),jh);return()=>clearTimeout(e)},[]);let O=i.docState===`loading`,te=i.docState===`error`;return(0,Q.jsxs)(`div`,{className:`app`,onMouseDownCapture:Mh,children:[(0,Q.jsx)(Dh,{local:!!m,canCompare:!!m||!!id(),controller:e,snap:i,onSize:c,comparing:g,onCompare:S}),(0,Q.jsx)(`div`,{id:`format-toolbar`,className:`format-slot`,role:`toolbar`,"aria-label":n(`toolbar.label`),children:(0,Q.jsx)(up,{controller:e,actions:D,onOpenBlock:()=>o(`block`),crop:d})}),(0,Q.jsxs)(`div`,{className:`workspace`,children:[(0,Q.jsx)(jm,{open:a,onAddPage:()=>wd(e),onToggle:e=>o(t=>t===e?null:e)}),(0,Q.jsx)(Mm,{open:a,controller:e,onClose:()=>o(null)}),(0,Q.jsxs)(`div`,{className:`main`,children:[(0,Q.jsx)(Xm,{comparing:b,references:y,controller:e,snap:i,zoom:x,gestures:E,subscribeView:ee,actions:D,cropId:l,onExitCrop:f,resize:s?.pageId===i.currentPageId?s:null,onEndResize:()=>c(null)}),(0,Q.jsx)(Zm,{snap:i,zoom:x,actions:D}),(0,Q.jsx)(vp,{controller:e,snap:i,baseHref:t,toast:r})]}),O&&(0,Q.jsxs)(`div`,{className:`state-overlay`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`spinner`}),n(`status.loading`)]}),te&&(0,Q.jsxs)(`div`,{className:`state-overlay state-error`,role:`alert`,children:[(0,Q.jsx)(`strong`,{children:n(`status.errorTitle`)}),(0,Q.jsx)(`p`,{children:of(n,i.error)}),(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void e.reload(),children:n(`status.retry`)})]})]}),i.conflict&&(0,Q.jsx)(Pp,{controller:e})]})}var{controller:Ph,lang:Fh,baseHref:Ih}=rd();(0,y.createRoot)(document.getElementById(`root`)).render((0,Q.jsx)(v.StrictMode,{children:(0,Q.jsx)(kh,{controller:Ph,lang:Fh,baseHref:Ih})}));export{l as n,c as r,o as t};