for-humanity 0.12.0 → 0.13.1

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 (226) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +16 -9
  3. package/dist/browser.js +14 -16
  4. package/dist/cli.css +2 -968
  5. package/dist/cli.js +92 -2318
  6. package/dist/config.js +1 -0
  7. package/dist/constant/copy.d.ts +100 -0
  8. package/dist/constant/site.d.ts +20 -0
  9. package/dist/constant/status.d.ts +19 -0
  10. package/dist/copy-C1uzvEnr.js +103 -0
  11. package/dist/group-path-XAThmzvC.js +10 -0
  12. package/dist/load-site-B-u5-jv0.js +2343 -0
  13. package/dist/logger-Dv1i9xSV.js +9 -0
  14. package/dist/mermaid/THIRD-PARTY-NOTICES.txt +3134 -0
  15. package/dist/mermaid/chunk--TN-qHgG.js +2 -0
  16. package/dist/mermaid/chunk-0kM1Lv4D.js +2 -0
  17. package/dist/mermaid/chunk-3FHei3pH.js +2001 -0
  18. package/dist/mermaid/chunk-3_2p2GqN.js +2 -0
  19. package/dist/mermaid/chunk-6HLei9i0.js +84 -0
  20. package/dist/mermaid/chunk-7Sz3kAwl.js +2214 -0
  21. package/dist/mermaid/chunk-7Tarqbpa.js +18047 -0
  22. package/dist/mermaid/chunk-9kkt8lzL.js +10 -0
  23. package/dist/mermaid/chunk-B--pNBQF.js +884 -0
  24. package/dist/mermaid/chunk-B4F-pysn.js +4241 -0
  25. package/dist/mermaid/chunk-B58sEIY_.js +14 -0
  26. package/dist/mermaid/chunk-B9_UWzSH.js +1517 -0
  27. package/dist/mermaid/chunk-BB8uZHwY.js +75 -0
  28. package/dist/mermaid/chunk-BFfk0LEc.js +717 -0
  29. package/dist/mermaid/chunk-BKri0qr7.js +89 -0
  30. package/dist/mermaid/chunk-BL404pH5.js +26 -0
  31. package/dist/mermaid/chunk-BLeiQSWo.js +354 -0
  32. package/dist/mermaid/chunk-BOmH_UFd.js +2 -0
  33. package/dist/mermaid/chunk-BSej9Nhy.js +1361 -0
  34. package/dist/mermaid/chunk-BYzrzvCI.js +12 -0
  35. package/dist/mermaid/chunk-BariMtWr.js +3020 -0
  36. package/dist/mermaid/chunk-BcrBoMwH.js +2352 -0
  37. package/dist/mermaid/chunk-Bok8z-Yo.js +67 -0
  38. package/dist/mermaid/chunk-BpTHLKQM.js +1970 -0
  39. package/dist/mermaid/chunk-BqjuxRsC.js +733 -0
  40. package/dist/mermaid/chunk-BuvPd-s5.js +1073 -0
  41. package/dist/mermaid/chunk-BvVehae3.js +5069 -0
  42. package/dist/mermaid/chunk-C-JABYpd.js +3075 -0
  43. package/dist/mermaid/chunk-C9XlTm4w.js +2 -0
  44. package/dist/mermaid/chunk-CApNbSU9.js +6 -0
  45. package/dist/mermaid/chunk-CCM2AH-C.js +9 -0
  46. package/dist/mermaid/chunk-CD1E0F_N.js +2 -0
  47. package/dist/mermaid/chunk-CDWvKG7D.js +2 -0
  48. package/dist/mermaid/chunk-CEVPpC1F.js +34 -0
  49. package/dist/mermaid/chunk-CLDr12lf.js +47504 -0
  50. package/dist/mermaid/chunk-CLVYqOBI.js +61 -0
  51. package/dist/mermaid/chunk-CLeOkFb5.js +15 -0
  52. package/dist/mermaid/chunk-CLgRAtOz.js +37 -0
  53. package/dist/mermaid/chunk-CMqFNUBl.js +134 -0
  54. package/dist/mermaid/chunk-CTPaBJXB.js +2 -0
  55. package/dist/mermaid/chunk-CVi6IGBL.js +2 -0
  56. package/dist/mermaid/chunk-CWV_EN-4.js +4745 -0
  57. package/dist/mermaid/chunk-CZ0dAs3g.js +2 -0
  58. package/dist/mermaid/chunk-C_YGy4Fn.js +236 -0
  59. package/dist/mermaid/chunk-CcVH22Yt.js +100 -0
  60. package/dist/mermaid/chunk-CgG6CD9_.js +7175 -0
  61. package/dist/mermaid/chunk-CgOP6IDB.js +3397 -0
  62. package/dist/mermaid/chunk-Cgg2UTSf.js +13 -0
  63. package/dist/mermaid/chunk-ChJfJJ1A.js +214 -0
  64. package/dist/mermaid/chunk-Ck5XRA46.js +447 -0
  65. package/dist/mermaid/chunk-Ckuw16cl.js +203 -0
  66. package/dist/mermaid/chunk-CpAbRCbF.js +1880 -0
  67. package/dist/mermaid/chunk-CuYekbSv.js +2 -0
  68. package/dist/mermaid/chunk-CwS4wZ5a.js +2 -0
  69. package/dist/mermaid/chunk-D-bcrBO3.js +82 -0
  70. package/dist/mermaid/chunk-D3IEAkCW.js +76 -0
  71. package/dist/mermaid/chunk-D8XfBJ_K.js +645 -0
  72. package/dist/mermaid/chunk-D9Ddd9y4.js +2228 -0
  73. package/dist/mermaid/chunk-DBh1mIbK.js +12 -0
  74. package/dist/mermaid/chunk-DD6Df6Ic.js +5 -0
  75. package/dist/mermaid/chunk-DGVDaXjx.js +8 -0
  76. package/dist/mermaid/chunk-DK9KqIXj.js +632 -0
  77. package/dist/mermaid/chunk-DORnIAsy.js +4487 -0
  78. package/dist/mermaid/chunk-DU69_VcF.js +363 -0
  79. package/dist/mermaid/chunk-DVNvSFoz.js +2144 -0
  80. package/dist/mermaid/chunk-DZe-4kde.js +20 -0
  81. package/dist/mermaid/chunk-D_a06Rz4.js +287 -0
  82. package/dist/mermaid/chunk-DfyFJJi2.js +972 -0
  83. package/dist/mermaid/chunk-DhKYPp1Z.js +2 -0
  84. package/dist/mermaid/chunk-DjFqgNTG.js +94 -0
  85. package/dist/mermaid/chunk-DmbDDrr-.js +65 -0
  86. package/dist/mermaid/chunk-DpuxlyL_.js +696 -0
  87. package/dist/mermaid/chunk-DqGhppWe.js +2 -0
  88. package/dist/mermaid/chunk-DqPZxHXa.js +5 -0
  89. package/dist/mermaid/chunk-Dt_1Jyif.js +293 -0
  90. package/dist/mermaid/chunk-DyQBE_NW.js +1935 -0
  91. package/dist/mermaid/chunk-JckyC4mW.js +1009 -0
  92. package/dist/mermaid/chunk-K7Myuj2-.js +1334 -0
  93. package/dist/mermaid/chunk-KuPYb48V.js +275 -0
  94. package/dist/mermaid/chunk-MFVRUoO0.js +4020 -0
  95. package/dist/mermaid/chunk-MbInCS_6.js +28 -0
  96. package/dist/mermaid/chunk-MexOLyKV.js +355 -0
  97. package/dist/mermaid/chunk-NnbDtJzg.js +21856 -0
  98. package/dist/mermaid/chunk-SGpOYZbI.js +2139 -0
  99. package/dist/mermaid/chunk-TbxLDlcU.js +198 -0
  100. package/dist/mermaid/chunk-TftHqGLg.js +490 -0
  101. package/dist/mermaid/chunk-UjQ8vA_Z.js +4138 -0
  102. package/dist/mermaid/chunk-YgmVTKqc.js +16 -0
  103. package/dist/mermaid/chunk-_a9EZE1v.js +1798 -0
  104. package/dist/mermaid/chunk-dTb8jqeP.js +2 -0
  105. package/dist/mermaid/chunk-fFdMfF8S.js +2240 -0
  106. package/dist/mermaid/chunk-feYbMzBj.js +1267 -0
  107. package/dist/mermaid/chunk-g3Pn8DkW.js +46 -0
  108. package/dist/mermaid/chunk-hM77LvCb.js +19832 -0
  109. package/dist/mermaid/chunk-hUDb-eAW.js +527 -0
  110. package/dist/mermaid/chunk-tpABtZ-3.js +4252 -0
  111. package/dist/mermaid/chunk-xIbz3oFK.js +59 -0
  112. package/dist/mermaid/chunk-yBz-vst0.js +976 -0
  113. package/dist/mermaid/mermaid-BhtR3wyB.js +1145 -0
  114. package/dist/run-site-command-cqCjpIlc.js +129 -0
  115. package/dist/site-config-bllORGpm.js +90 -0
  116. package/dist/site.js +1 -0
  117. package/dist/start-dev-server-x7Ja5uwv.js +184 -0
  118. package/dist/to-change-queue-DbEnZGNK.js +34 -0
  119. package/dist/to-error-message-pF6_7wGK.js +16 -0
  120. package/dist/type/group-path.d.ts +7 -0
  121. package/dist/type/site-config.d.ts +57 -0
  122. package/package.json +34 -17
  123. package/src/component/widget/cursor-face/_constant/cursor-face.ts +0 -14
  124. package/src/component/widget/cursor-face/wg-cursor-face.css +0 -15
  125. package/src/component/widget/cursor-face/wg-cursor-face.tsx +0 -153
  126. package/src/component/widget/navigation/_constant/locale.ts +0 -9
  127. package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -33
  128. package/src/component/widget/navigation/_constant/navigation.ts +0 -9
  129. package/src/component/widget/navigation/_constant/reading-line.ts +0 -4
  130. package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +0 -59
  131. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-branches.ts +0 -15
  132. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-group-branches.ts +0 -70
  133. package/src/component/widget/navigation/_function/to-doc-groups/to-doc-groups.ts +0 -15
  134. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +0 -13
  135. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +0 -13
  136. package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +0 -18
  137. package/src/component/widget/navigation/_function/to-navigation-json.ts +0 -8
  138. package/src/component/widget/navigation/_function/to-toc-groups.ts +0 -38
  139. package/src/component/widget/navigation/_type/doc-branch.ts +0 -11
  140. package/src/component/widget/navigation/_type/doc-group.ts +0 -24
  141. package/src/component/widget/navigation/_type/navigation-data.ts +0 -75
  142. package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -17
  143. package/src/component/widget/navigation/_type/toc-group.ts +0 -39
  144. package/src/component/widget/navigation/_wg-navigation-nav-list.css +0 -48
  145. package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +0 -61
  146. package/src/component/widget/navigation/_wg-navigation-nav.css +0 -21
  147. package/src/component/widget/navigation/_wg-navigation-nav.tsx +0 -33
  148. package/src/component/widget/navigation/_wg-navigation-scroll.tsx +0 -117
  149. package/src/component/widget/navigation/_wg-navigation-toc.css +0 -91
  150. package/src/component/widget/navigation/_wg-navigation-toc.tsx +0 -114
  151. package/src/component/widget/navigation/wg-navigation.css +0 -282
  152. package/src/component/widget/navigation/wg-navigation.tsx +0 -420
  153. package/src/component/widget/prose/_constant/heading-highlight.ts +0 -4
  154. package/src/component/widget/prose/_constant/section.ts +0 -7
  155. package/src/component/widget/prose/_constant/status.ts +0 -9
  156. package/src/component/widget/prose/_function/has-block-content.ts +0 -30
  157. package/src/component/widget/prose/_function/rehype-head.ts +0 -31
  158. package/src/component/widget/prose/_function/rehype-sections/_to-section-headings.ts +0 -20
  159. package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +0 -21
  160. package/src/component/widget/prose/_function/rehype-tables.ts +0 -22
  161. package/src/component/widget/prose/_function/remark-blocks.ts +0 -112
  162. package/src/component/widget/prose/_function/remark-flow.ts +0 -26
  163. package/src/component/widget/prose/_function/remark-links.ts +0 -33
  164. package/src/component/widget/prose/_function/remark-parts.ts +0 -26
  165. package/src/component/widget/prose/_function/remark-status.ts +0 -59
  166. package/src/component/widget/prose/_function/remark-swatch.ts +0 -16
  167. package/src/component/widget/prose/_function/remark-unknown-directives.ts +0 -25
  168. package/src/component/widget/prose/wg-prose.css +0 -484
  169. package/src/component/widget/prose/wg-prose.tsx +0 -43
  170. package/src/component/widget/shell/wg-shell.css +0 -63
  171. package/src/component/widget/shell/wg-shell.tsx +0 -88
  172. package/src/component/widget/shell-controls/wg-shell-controls.css +0 -4
  173. package/src/component/widget/shell-controls/wg-shell-controls.tsx +0 -170
  174. package/src/constant/asset.ts +0 -63
  175. package/src/constant/copy.ts +0 -133
  176. package/src/constant/doc.ts +0 -13
  177. package/src/constant/font.ts +0 -34
  178. package/src/constant/site.ts +0 -24
  179. package/src/constant/status.ts +0 -15
  180. package/src/entry/browser/browser.tsx +0 -22
  181. package/src/entry/cli/_constant/cli.ts +0 -19
  182. package/src/entry/cli/_constant/crawling.ts +0 -14
  183. package/src/entry/cli/_constant/snippet.ts +0 -21
  184. package/src/entry/cli/_function/create-app.tsx +0 -57
  185. package/src/entry/cli/_function/create-dev-app.ts +0 -87
  186. package/src/entry/cli/_function/create-processor/_rehype-assets.ts +0 -70
  187. package/src/entry/cli/_function/create-processor/_rehype-heading-ids.ts +0 -34
  188. package/src/entry/cli/_function/create-processor/_remark-report.ts +0 -15
  189. package/src/entry/cli/_function/create-processor/_remark-snippets.ts +0 -117
  190. package/src/entry/cli/_function/create-processor/_shiki-transformers.ts +0 -91
  191. package/src/entry/cli/_function/create-processor/create-processor.ts +0 -64
  192. package/src/entry/cli/_function/read-docs.ts +0 -128
  193. package/src/entry/cli/_function/read-home.ts +0 -32
  194. package/src/entry/cli/_function/to-crawling-app.ts +0 -42
  195. package/src/entry/cli/cli.test.ts +0 -804
  196. package/src/entry/cli/cli.ts +0 -206
  197. package/src/env.d.ts +0 -6
  198. package/src/page/doc/pg-doc.tsx +0 -35
  199. package/src/page/home/pg-home.tsx +0 -40
  200. package/src/store/navigation/create-navigation-stores.test.ts +0 -74
  201. package/src/store/navigation/create-navigation-stores.ts +0 -59
  202. package/src/store/navigation/navigation-state.ts +0 -36
  203. package/src/store/navigation/navigation-storage.ts +0 -9
  204. package/src/store/navigation/to-navigation-scroll-state.ts +0 -42
  205. package/src/style/base.css +0 -28
  206. package/src/style/token.css +0 -188
  207. package/src/type/doc-content.ts +0 -15
  208. package/src/type/doc-data.ts +0 -38
  209. package/src/type/doc-file-data.ts +0 -21
  210. package/src/type/doc-heading.ts +0 -17
  211. package/src/type/doc-outline.ts +0 -16
  212. package/src/type/doc-section.ts +0 -9
  213. package/src/type/doc.ts +0 -20
  214. package/src/type/group-path.ts +0 -7
  215. package/src/type/site-assets.ts +0 -25
  216. package/src/type/site-config.ts +0 -73
  217. package/src/type/vfile-data.d.ts +0 -10
  218. package/src/util/async/to-change-queue.test.ts +0 -58
  219. package/src/util/async/to-change-queue.ts +0 -43
  220. package/src/util/dom/find-hash-target.ts +0 -18
  221. package/src/util/dom/reveal-hash-target.ts +0 -15
  222. package/src/util/error/to-error-message.ts +0 -10
  223. package/src/util/file/to-asset-path.ts +0 -26
  224. package/src/util/font/to-font-css.test.ts +0 -41
  225. package/src/util/font/to-font-css.ts +0 -28
  226. package/src/util/mermaid/render-flow.js +0 -321
package/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.13.1 — 2026-10-16
6
+
7
+ **Upgrade:** CLI commands, configuration and Node.js requirements remain unchanged. Navigation scroll positions saved by older versions may reset once after upgrading.
8
+
9
+ **Known issue:** The previously recorded intermittent Windows cursor check (`NAV-010`) remains deferred. See [Maintenance](https://for-humanity.fyi/maintenance/#known-windows-check-issue).
10
+
11
+ - Let Zustand persist own navigation scroll storage and hydration; remove direct storage reads, legacy layout-key compatibility and duplicate restoration helpers.
12
+ - Validate saved navigation positions once with a shared Zod schema, discard malformed snapshots, and compare navigation data without traversing DOM links on every scroll event.
13
+ - Keep code-block and caption backgrounds in the prose stylesheet, remove inline container colors and token overrides outside their owner, and share metadata decisions across both elements.
14
+
15
+ ## 0.13.0 — 2026-10-16
16
+
17
+ **Upgrade:** Node.js 22.12.0 or later is now required; upgrade Node before installing. Existing `dev`, `build`, `preview` commands and `.mjs` configurations remain supported. To use typed configuration, replace the `.mjs` file with `for-humanity.config.ts`; keep only one configuration file per document folder. Development and preview servers bind to localhost.
18
+
19
+ **Known issue:** The Windows browser check for cursor visibility after a reload (`NAV-010`) intermittently fails. The other browser checks and installed-package dev/preview checks pass; further cursor lifecycle investigation is deferred. See [Maintenance](https://for-humanity.fyi/maintenance/#known-windows-check-issue).
20
+
21
+ - Render page titles, metadata and resource tags with a request-local Unhead server instance; deduplicate links, preserve literal metadata text, and keep CSS and font loading in the initial HTML.
22
+ - Use Citty for CLI commands and help/version output, reject unsupported options and extra paths before running, and format build results and document warnings with Consola.
23
+ - Load source development CSS through HTML stylesheet links before the first paint; preserve CSS HMR and refresh the stylesheet list when files are added or removed.
24
+ - Mark the prebuilt Mermaid module URL as an intentional runtime import to avoid Vite development warnings while preserving lazy loading.
25
+ - Serve static previews through Vite with explicit site output paths, document 404s and preserved font cache headers; bind to localhost, reject missing builds and occupied ports, and remove the direct Hono Node server dependency.
26
+ - Share document preparation and Hono routes between static builds and a single Vite development server; replace custom file watching and SSE with Vite updates, preserve the last valid document snapshot, and support source TSX reloads and CSS HMR.
27
+ - Avoid an extra browser reload after the first successful development request; verify recovery from an invalid initial document and shutdown after a pending file change.
28
+ - Pre-optimize browser JSX runtimes to prevent missing development chunks, and retain the last mouse position when reloading after window focus is lost.
29
+ - Remove seven unused color and radius tokens and align the design reference with the active styles.
30
+
31
+ - Replace direct esbuild package and browser fixture builds with Vite 8 and shared typed build configuration; preserve synchronous browser initialization and Mermaid license notices.
32
+ - Raise the package minimum Node.js version to 22.12.0 and include Vite for the development and preview commands.
33
+
34
+ - Support `for-humanity.config.ts` and publish a documented `SiteConfig` input type and generated declarations; retain `.mjs` support and reject duplicate configuration files.
35
+ - Type-check build and maintenance tools, exclude repository tests from packages, and verify configuration types in an installed consumer project.
36
+ - Split CLI and navigation checks into isolated scenarios with Korean GIVEN/WHEN/THEN conventions and Playwright failure reports.
37
+ - Fix relative links from nested documents on Windows and clean up Mermaid load errors when their widget unmounts.
38
+ - Run repository tests with standalone Vitest and split Mermaid browser checks into isolated Playwright scenarios with failure traces.
39
+
40
+ - Replace the custom ASCII grid renderer with locally hosted Mermaid 12, loaded only on pages with diagrams, with official themes, system dark mode and isolated SVG styles.
41
+ - Support Mermaid's built-in diagram types, including Tree View, and add a diagram writing guide with flowchart, sequence, state, ER and tree examples.
42
+ - Keep readable diagram source when JavaScript is disabled or loading/rendering fails. Diagram syntax errors now appear in the browser instead of stopping the build.
43
+
5
44
  ## 0.12.0 — 2026-10-13
6
45
 
7
46
  - Add a `[file name]` fence meta that draws a title bar with the file name and language above the code block, sharing the `bad`/`good` tone.
package/README.md CHANGED
@@ -12,7 +12,7 @@ Write Markdown. Keep the context. Share a static site.
12
12
 
13
13
  [![MIT](https://img.shields.io/badge/license-MIT-1111aa?style=flat-square)](https://github.com/minu-ha/for-humanity/blob/main/LICENSE)
14
14
  [![npm](https://img.shields.io/npm/v/for-humanity?style=flat-square)](https://www.npmjs.com/package/for-humanity)
15
- ![Node 22+](https://img.shields.io/badge/node-22%2B-444444?style=flat-square)
15
+ ![Node 22.12.0+](https://img.shields.io/badge/node-22.12.0%2B-444444?style=flat-square)
16
16
  ![Hono JSX](https://img.shields.io/badge/Hono-JSX-444444?style=flat-square)
17
17
  ![Prototype](https://img.shields.io/badge/status-prototype-9a6400?style=flat-square)
18
18
 
@@ -24,16 +24,16 @@ Write Markdown. Keep the context. Share a static site.
24
24
 
25
25
  - **Find your place.** Pages grouped by purpose, a reading order, a tree of contents and the current reading position.
26
26
  - **Keep the detail.** Notes for context, native disclosures for implementation details, and links that open folded sections.
27
- - **Show the connections.** Tables, highlighted code, Mermaid flowcharts, status badges and color swatches.
27
+ - **Show the connections.** Tables, highlighted code, official Mermaid diagrams including flowcharts, sequences and directory trees, status badges and color swatches.
28
28
  - **Share the result.** Static HTML, self-hosted fonts and a small browser script. Browser interactions stay separate from Markdown rendering.
29
29
  - **Read your way.** System-matched light and dark themes, keyboard navigation and a layout for narrow screens.
30
30
 
31
31
  ## Quick start
32
32
 
33
- Node.js 22 or later and pnpm. Install the CLI in your document project:
33
+ Node.js 22.12.0 or later and pnpm. Install the CLI in your document project:
34
34
 
35
35
  ```sh
36
- pnpm add -D --save-exact for-humanity@0.12.0
36
+ pnpm add -D --save-exact for-humanity@0.13.1
37
37
  mkdir docs
38
38
  ```
39
39
 
@@ -52,12 +52,14 @@ pnpm exec for-humanity preview docs
52
52
 
53
53
  If your Markdown files are in the project root, use `.` instead of `docs`. The root `README.md` becomes the home page; root `AGENTS.md` and `CLAUDE.md` stay out of the site.
54
54
 
55
- Version `0.12.0` supports `dev`, `build` and `preview`. `init` is planned; see the [Roadmap](https://github.com/minu-ha/for-humanity/blob/main/templates/document/roadmap.md) and [Changelog](https://github.com/minu-ha/for-humanity/blob/main/CHANGELOG.md).
55
+ Version `0.13.1` supports `dev`, `build` and `preview`. `init` is planned; see the [Roadmap](https://github.com/minu-ha/for-humanity/blob/main/templates/document/roadmap.md) and [Changelog](https://github.com/minu-ha/for-humanity/blob/main/CHANGELOG.md).
56
56
  Cloudflare Pages can host the generated site. See [Deployment](https://github.com/minu-ha/for-humanity/blob/main/templates/document/deployment.md) for the build settings.
57
57
  Set an optional public root `url` in the site configuration to generate `robots.txt` and `sitemap.xml`; projects without a URL emit neither file. See [Crawling](https://github.com/minu-ha/for-humanity/blob/main/templates/document/crawling.md).
58
58
 
59
59
  ### Develop the kit
60
60
 
61
+ Version 0.13.0 requires Node.js 22.12.0 or later. Repository development uses one Vite server with Hono, source TSX reloads and CSS HMR.
62
+
61
63
  To work on the CLI or read this library's guides and examples locally, run the project from source:
62
64
 
63
65
  ```sh
@@ -75,7 +77,7 @@ pnpm preview # Preview the static site
75
77
  pnpm build:pages # Add Cloudflare Pages headers and a 404 page
76
78
  ```
77
79
 
78
- Changes pushed to `main` update the documentation site. A stable version tag such as `v0.12.0` runs checks, publishes the package to npm, then creates a GitHub Release with the same package file.
80
+ Changes pushed to `main` update the documentation site. A stable version tag such as `v0.13.1` runs checks, publishes the package to npm, then creates a GitHub Release with the same package file.
79
81
  The npm README updates with each package release. See [Maintenance](https://github.com/minu-ha/for-humanity/blob/main/templates/document/maintenance.md#packaging-and-release) for the release steps.
80
82
 
81
83
  ## Make it yours
@@ -83,16 +85,21 @@ The npm README updates with each package release. See [Maintenance](https://gith
83
85
  A document folder is enough to get started. Without a site configuration, the sidebar shows **for humanity**. The pixel face appears in the browser tab, and follows the mouse on desktop when the site sets `cursorFace: true`.
84
86
  The folder's `README.md` becomes the home page at `/`, with no frontmatter required. Click the site name to return home.
85
87
  This repository generates [the documentation home](https://github.com/minu-ha/for-humanity/blob/main/templates/document/README.md) from its root README.md and [the site changelog](https://github.com/minu-ha/for-humanity/blob/main/templates/document/changelog.md) from CHANGELOG.md. Edit those source files, then run `pnpm sync:docs`; `pnpm dev` and `pnpm build` also sync them on startup.
86
- Set your own name in `for-humanity.config.mjs`:
88
+ Set your own name in `for-humanity.config.ts`, using the exported `SiteConfig` type for editor completion and static checking:
89
+
90
+ ```ts
91
+ import type {SiteConfig} from "for-humanity";
87
92
 
88
- ```js
89
93
  export default {
90
94
  title: "Project notes",
91
95
  description: "Decisions, working notes and the details behind them.",
92
96
  navigation: ["Getting started", "Guide", "Reference", "Examples"],
93
- };
97
+ } satisfies SiteConfig;
94
98
  ```
95
99
 
100
+ Existing `for-humanity.config.mjs` files remain supported. When migrating to TypeScript, replace the old file with the `.ts` file.
101
+ Use one configuration file per document folder. The CLI validates values at startup; run `tsc --noEmit` in your project for static type checking.
102
+
96
103
  See [Commands](https://github.com/minu-ha/for-humanity/blob/main/templates/document/commands.md) for using another document folder, and [Settings](https://github.com/minu-ha/for-humanity/blob/main/templates/document/settings.md) for configuration.
97
104
  Each document other than the root README chooses a `group` and optional `order`. Pages stay independent; groups do not need parent documents or nested folders. Document names may share the same first letter.
98
105
  Use `group: Guide` for one group or `group: [Projects, Example project, Research]` for nested navigation. Group paths do not change document URLs.
package/dist/browser.js CHANGED
@@ -1,39 +1,37 @@
1
- "use strict";(()=>{var U=Symbol("RENDERER"),ee=Symbol("ERROR_HANDLER"),S=Symbol("STASH"),qe=Symbol("INTERNAL"),Xe=Symbol("MEMO"),_e=Symbol("PERMALINK");var wt=e=>(e[qe]=!0,e);var W={Stringify:1,BeforeStream:2,Stream:3},k=(e,t)=>{let n=new String(e);return n.isEscaped=!0,n.callbacks=t,n},zo=/[&<>'"]/,ve=async(e,t)=>{let n="";t||=[];let r=await Promise.all(e);for(let o=r.length-1;n+=r[o],o--,!(o<0);o--){let i=r[o];typeof i=="object"&&t.push(...i.callbacks||[]);let a=i.isEscaped;if(i=await(typeof i=="object"?i.toString():i),typeof i=="object"&&t.push(...i.callbacks||[]),i.isEscaped??a)n+=i;else{let c=[n];G(i,c),n=c[0]}}return k(n,t)},G=(e,t)=>{let n=e.search(zo);if(n===-1){t[0]+=e;return}let r,o,i=0;for(o=n;o<e.length;o++){switch(e.charCodeAt(o)){case 34:r="&quot;";break;case 39:r="&#39;";break;case 38:r="&amp;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}t[0]+=e.substring(i,o)+r,i=o+1}t[0]+=e.substring(i,o)},$t=e=>{let t=e.callbacks;if(!t?.length)return e;let n=[e],r={};return t.forEach(o=>o({phase:W.Stringify,buffer:n,context:r})),n[0]},ke=async(e,t,n,r,o)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let i=e.callbacks;if(!i?.length)return Promise.resolve(e);o?o[0]+=e:o=[e];let a=Promise.all(i.map(c=>c({phase:t,buffer:o,context:r}))).then(c=>Promise.all(c.filter(Boolean).map(f=>ke(f,t,!1,r,o))).then(()=>o[0]));return n?k(await a,i):a};var ye={title:[],script:["src"],style:["data-href"],link:["href"],meta:["name","httpEquiv","charset","itemProp"]},Ee={},Ze="data-precedence",Je=e=>e.rel==="stylesheet"&&"precedence"in e,Ye=(e,t)=>e==="link"?t:ye[e].length>0;var xn=Object.defineProperty,Qe=(e,t)=>{let n={};for(var r in e)xn(n,r,{get:e[r],enumerable:!0});return t||xn(n,Symbol.toStringTag,{value:"Module"}),n};var ue=e=>Array.isArray(e)?e:[e];var et=Qe({button:()=>To,form:()=>Ao,input:()=>Mo,link:()=>Po,meta:()=>Co,script:()=>Eo,style:()=>Zo,title:()=>ko}),bn=new WeakMap,wn=(e,t,n,r)=>({buffer:o,context:i})=>{if(!o)return;let a=bn.get(i)||{};bn.set(i,a);let c=a[e]||=[],f=!1,u=ye[e],p=Ye(e,r!==void 0);if(p){e:for(let[,s]of c)if(!(e==="link"&&!(s.rel==="stylesheet"&&s["data-precedence"]!==void 0))){for(let l of u)if((s?.[l]??null)===n?.[l]){f=!0;break e}}}if(f?o[0]=o[0].replaceAll(t,""):p||e==="link"?c.push([t,n,r]):c.unshift([t,n,r]),o[0].indexOf("</head>")!==-1){let s;if(e==="link"||r!==void 0){let l=[];s=c.map(([d,,m],h)=>{if(m===void 0)return[d,Number.MAX_SAFE_INTEGER,h];let _=l.indexOf(m);return _===-1&&(l.push(m),_=l.length-1),[d,_,h]}).sort((d,m)=>d[1]-m[1]||d[2]-m[2]).map(([d])=>d)}else s=c.map(([l])=>l);s.forEach(l=>{o[0]=o[0].replaceAll(l,"")}),o[0]=o[0].replace(/(?=<\/head>)/,()=>s.join(""))}},Pe=(e,t,n)=>F([new N(e,n,ue(t??[]))]),Ce=(e,t,n,r)=>{if("itemProp"in n)return Pe(e,t,n);let{precedence:o,blocking:i,...a}=n;o=r?o??"":void 0,r&&(a[Ze]=o);let c=new N(e,a,ue(t||[])).toString();return c instanceof Promise?c.then(f=>k(f,[...f.callbacks||[],wn(e,f,a,o)])):k(c,[wn(e,c,a,o)])},ko=({children:e,...t})=>{let n=tt();if(n){let r=M(n);if(r==="svg"||r==="head")return new N("title",t,ue(e??[]))}return Ce("title",e,t,!1)},Eo=({children:e,...t})=>{let n=tt();return["src","async"].some(r=>!t[r])||n&&M(n)==="head"?Pe("script",e,t):Ce("script",e,t,!1)},Zo=({children:e,...t})=>["href","precedence"].every(n=>n in t)?(t["data-href"]=t.href,delete t.href,Ce("style",e,t,!0)):Pe("style",e,t),Po=({children:e,...t})=>["onLoad","onError"].some(n=>n in t)||t.rel==="stylesheet"&&(!("precedence"in t)||"disabled"in t)?Pe("link",e,t):Ce("link",e,t,Je(t)),Co=({children:e,...t})=>{let n=tt();return n&&M(n)==="head"?Pe("meta",e,t):Ce("meta",e,t,!1)},$n=(e,{children:t,...n})=>new N(e,n,ue(t??[])),Ao=e=>(typeof e.action=="function"&&(e.action=_e in e.action?e.action[_e]:void 0),$n("form",e)),Sn=(e,t)=>(typeof t.formAction=="function"&&(t.formAction=_e in t.formAction?t.formAction[_e]:void 0),$n(e,t)),Mo=e=>Sn("input",e),To=e=>Sn("button",e);var No=new Map([["className","class"],["htmlFor","for"],["crossOrigin","crossorigin"],["httpEquiv","http-equiv"],["itemProp","itemprop"],["fetchPriority","fetchpriority"],["noModule","nomodule"],["formAction","formaction"]]),xe=e=>No.get(e)||e,Ro=/[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,St=new Set,zn=1024,Oo=/^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,kn=new Set,Io=256,Ae=(e,t,n)=>{e.size>=t&&e.clear(),e.add(n)},Zn=e=>kn.has(e)?!0:typeof e!="string"?!1:e.length===0?!0:Oo.test(e)?!1:(Ae(kn,Io,e),!0),kt=e=>{if(St.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let r=e.charCodeAt(n);if(!(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===95||r===46||r===58))return Ro.test(e)?!1:(Ae(St,zn,e),!0)}return Ae(St,zn,e),!0},Lo=/[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/,zt=new Set,En=1024,Do=e=>{if(zt.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let r=e.charCodeAt(n);if(!(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===95))return Lo.test(e)?!1:(Ae(zt,En,e),!0)}return Ae(zt,En,e),!0},jo=/[;"'\\/\[\](){}]/,Fo=e=>{if(!jo.test(e))return!1;let t=0,n=[];for(let r=0,o=e.length;r<o;r++){let i=e.charCodeAt(r);if(i===92){if(r===o-1)return!0;r++}else if(t!==0){if(i===10||i===12||i===13)return!0;i===t&&(t=0)}else if(i===47&&e.charCodeAt(r+1)===42){let a=e.indexOf("*/",r+2);if(a===-1)return!0;r=a+1}else if(i===34||i===39)t=i;else if(i===40)n.push(41);else if(i===91)n.push(93);else{if(i===123||i===125)return!0;if(i===41||i===93){if(n[n.length-1]!==i)return!0;n.pop()}else if(i===59&&n.length===0)return!0}}return t!==0||n.length!==0},Me=(e,t)=>{for(let[n,r]of Object.entries(e)){let o=n[0]==="-"||!/[A-Z]/.test(n)?n:n.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`);if(!Do(o))continue;if(r==null){t(o,null);continue}let i;if(typeof r=="number")i=o.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?!.*gap)(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/)?`${r}`:`${r}px`;else if(typeof r=="string"){if(Fo(r))continue;i=r}else continue;t(o,i)}};var Te,tt=()=>Te,Bo=e=>/[A-Z]/.test(e)&&e.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e,Uo=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Ho=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Pn=(e,t)=>e.then(n=>{if(typeof n!="string"&&!Array.isArray(n)&&!(n instanceof N))return n;let r=Array.isArray(n)?n:[n],o=()=>{let i=[""];return be(r,i),i.length===1?k(i[0],i.callbacks):ve(i,i.callbacks)};return t?t(o):Re(o)}),be=(e,t)=>{for(let n=0,r=e.length;n<r;n++){let o=e[n];if(typeof o=="string")G(o,t);else{if(typeof o=="boolean"||o===null||o===void 0)continue;if(o instanceof N)o.toStringToBuffer(t);else if(typeof o=="number")t[0]+=o;else if(o.isEscaped){t[0]+=o;let i=o.callbacks;i&&(t.callbacks||=[],t.callbacks.push(...i))}else o instanceof Promise?t.unshift("",o):be(o,t)}}},F=e=>Re(()=>{let t=[""];return be(e,t),t.length===1?k(t[0],t.callbacks):ve(t,t.callbacks)}),te=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof N)&&!(e instanceof Promise)&&!e.isEscaped&&typeof e.toString=="function",ne=e=>{let t=e.toString(),n=r=>F([String(r)]);return t instanceof Promise?t.then(n):n(t)},N=class{tag;props;key;children;isEscaped=!0;constructor(e,t,n){if(typeof e!="function"&&!Zn(e))throw new Error(`Invalid JSX tag name: ${e}`);this.tag=e,this.props=t,this.children=n}get type(){return this.tag}get ref(){return this.props.ref||null}toString(){return Re(()=>{let t=[""];return this.toStringToBuffer(t),t.length===1?"callbacks"in t?$t(k(t[0],t.callbacks)).toString():t[0]:ve(t,t.callbacks)})}toStringToBuffer(e){let t=this.tag,n=this.props,{children:r}=this;e[0]+=`<${t}`;let o=t==="svg"||Te&&M(Te)==="svg"?i=>Bo(xe(i)):i=>xe(i);for(let[i,a]of Object.entries(n))if(i=o(i),!!kt(i)&&i!=="children"){if(i==="style"&&typeof a=="object"){let c="";Me(a,(f,u)=>{u!=null&&(c+=`${c?";":""}${f}:${u}`)}),e[0]+=' style="',G(c,e),e[0]+='"'}else if(typeof a=="string")e[0]+=` ${i}="`,G(a,e),e[0]+='"';else if(a!=null)if(typeof a=="number"||a.isEscaped)e[0]+=` ${i}="${a}"`;else if(typeof a=="boolean"&&Ho.includes(i))a&&(e[0]+=` ${i}=""`);else if(i==="dangerouslySetInnerHTML"){if(r.length>0)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");r=[k(a.__html)]}else if(a instanceof Promise)e[0]+=` ${i}="`,e.unshift('"',a);else if(typeof a=="function"){if(!i.startsWith("on")&&i!=="ref")throw new Error(`Invalid prop '${i}' of type 'function' supplied to '${t}'.`)}else e[0]+=` ${i}="`,G(a.toString(),e),e[0]+='"'}if(Uo.includes(t)&&r.length===0){e[0]+="/>";return}e[0]+=">",be(r,e),e[0]+=`</${t}>`}},Et=class extends N{toStringToBuffer(e){let{children:t}=this,n={...this.props};t.length&&(n.children=t.length===1?t[0]:t);let r=this.tag.call(null,n);typeof r=="boolean"||r==null||(r instanceof Promise?H.length===0?e.unshift("",Pn(r)):e.unshift("",Pn(r,le())):r instanceof N?r.toStringToBuffer(e):Array.isArray(r)?be(r,e):typeof r=="number"||r.isEscaped?(e[0]+=r,r.callbacks&&(e.callbacks||=[],e.callbacks.push(...r.callbacks))):G(r,e))}},Zt=class extends N{toStringToBuffer(e){be(this.children,e)}},Pt=(e,t,...n)=>{t??={},n.length&&(t.children=n.length===1?n[0]:n);let r=t.key;delete t.key;let o=Ne(e,t,n);return o.key=r,o},Cn=!1,Ne=(e,t,n)=>{if(!Cn){for(let r in Ee)et[r][U]=Ee[r];Cn=!0}return typeof e=="function"?new Et(e,t,n):et[e]?new Et(et[e],t,n):e==="svg"||e==="head"?(Te||=Oe(""),new N(e,t,[new Et(Te,{value:e},n)])):new N(e,t,n)};var R=({children:e})=>new Zt("",{children:e},Array.isArray(e)?e:e?[e]:[]);var H=[],An=!1,Ct,At,Mt=0,Tt=!1,Mn=()=>{if(An)return Ct;An=!0;let e=globalThis,t;for(let n of[()=>e.process?.getBuiltinModule?.("node:async_hooks")?.AsyncLocalStorage,()=>e.process?.mainModule?.require?.("node:async_hooks")?.AsyncLocalStorage]){try{t=n()}catch{}if(t)break}return t&&(Ct=new t),Ct},Ie=()=>Mn()?.getStore()||At,Tn=()=>{Mt>0&&!Tt&&(Tt=!0,console.warn("hono/jsx: AsyncLocalStorage is unavailable in this runtime, so useContext() after an await in an async component falls back to the context default value during server-side rendering. To get provided values across await boundaries, use a runtime with AsyncLocalStorage (Node.js >= 20.16, Deno, Bun, or Cloudflare Workers with the nodejs_compat flag)."))},Nn=(e,t)=>{if(!e)return Tn(),t.values;let n=e.get(t);return n||(n=[t.values[0]],e.set(t,n)),n},Rn=(e,t)=>{if(!e)return Tn(),t.values.at(-1);let n=e.get(t);return n?.length?n.at(-1):t.values[0]},Vo=e=>(e?H.filter(t=>e.has(t)):H).map(t=>[t,Rn(e,t)]),Ko=(e,t,n)=>Re(()=>{let r=Ie(),o=n.map(([a,c])=>{let f=Nn(r,a);return f.push(c),f}),i=()=>{o.forEach(a=>{a.pop()})};try{let a=e();return a instanceof Promise?a.finally(i):(i(),a)}catch(a){throw i(),a}},t),Re=(e,t)=>{if(Ie())return e();let n=t??new WeakMap,r=Mn();if(r)return r.run(n,e);At=n;let o;try{o=e()}finally{At=void 0}return!Tt&&o instanceof Promise&&(Mt++,o=o.finally(()=>{Mt--})),o},le=()=>{let e=Ie(),t=Vo(e);return n=>Ko(n,e,t)},Oe=e=>{let t=[e],n=(r=>{let o=Nn(Ie(),n);o.push(r.value);let i;try{i=typeof r.children=="string"?F([r.children]):te(r.children)?ne(r.children):r.children?(Array.isArray(r.children)?new Zt("",{},r.children):r.children).toString():k("")}catch(a){throw o.pop(),a}return i instanceof Promise?i.finally(()=>o.pop()).then(a=>k(a,a.callbacks)):(o.pop(),k(i))});return n.values=t,n.Provider=n,n[U]=Nt(t),H.push(n),n},M=e=>Rn(Ie(),e);var Nt=e=>({value:t,children:n})=>{if(!n)return;let r={children:[{tag:wt(()=>{e.push(t)}),props:{}}]};Array.isArray(n)?r.children.push(...n.flat()):r.children.push(n),r.children.push({tag:wt(()=>{e.pop()}),props:{}});let o={tag:"",props:r,type:""};return o[ee]=i=>{throw e.pop(),i},o},Le=e=>{let t=[e],n=Nt(t);return n.values=t,n.Provider=n,H.push(n),n};var Wo=0;var Go=2,qo=3,Xo=4,Rt=new WeakMap,Ot=(e,t)=>!e||!t||e.length!==t.length||t.some((n,r)=>n!==e[r]);var Jo;var On=[];var O=e=>{let t=()=>typeof e=="function"?e():e,n=D.at(-1);if(!n)return[t(),()=>{}];let[,r]=n,o=r[S][1][Wo]||=[],i=r[S][0]++;return o[i]||=[t(),a=>{let c=Jo,f=o[i];if(typeof a=="function"&&(a=a(f[0])),!Object.is(a,f[0]))if(f[0]=a,On.length){let[u,p]=On.at(-1);Promise.all([u===3?r:De([u,!1,c],r),p]).then(([s])=>{if(!s||!(u===2||u===3))return;let l=s.vC;requestAnimationFrame(()=>{setTimeout(()=>{l===s.vC&&De([u===3?1:0,!1,c],s)})})})}else De([0,!1,c],r)}]};var In=(e,t,n)=>{let r=D.at(-1);if(!r)return;let[,o]=r,i=o[S][1][1]||=[],a=o[S][0]++,[c,,f]=i[a]||=[];if(Ot(c,n)){f&&f();let u=()=>{p[e]=void 0,p[2]=t()},p=[n,void 0,void 0,void 0,void 0];p[e]=u,i[a]=p}},nt=(e,t)=>In(3,e,t),I=(e,t)=>In(1,e,t);var fe=(e,t)=>{let n=D.at(-1);if(!n)return e;let[,r]=n,o=r[S][1][Go]||=[],i=r[S][0]++,a=o[i];return Ot(a?.[1],t)?o[i]=[e,t]:e=o[i][0],e};function E(e){let t=D.at(-1);if(!t)return{current:e};let[,n]=t,r=n[S][1][Xo]||=[],o=n[S][0]++;return r[o]||={current:e}}var rt=e=>{let t=Rt.get(e);if(t){if(t.length===2)throw t[1];return t[0]}throw e.then(n=>Rt.set(e,[n]),n=>Rt.set(e,[void 0,n])),e},ot=(e,t)=>{let n=D.at(-1);if(!n)return e();let[,r]=n,o=r[S][1][qo]||=[],i=r[S][0]++,a=o[i];return Ot(a?.[1],t)&&(o[i]=[e(),t]),o[i][0]};var Fe="_hp",Yo={Change:"Input",DoubleClick:"DblClick"},Qo={svg:"2000/svg",math:"1998/Math/MathML"},D=[],je=new WeakMap,we,Hn=()=>we,T=e=>"t"in e,It={onClick:["click",!1]},Ln=e=>{if(!e.startsWith("on"))return;if(It[e])return It[e];let t=e.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(t){let[,n,r]=t;return It[e]=[(Yo[n]||n).toLowerCase(),!!r]}},Dn=(e,t)=>we&&e instanceof SVGElement&&/[A-Z]/.test(t)&&(t in e.style||t.match(/^(?:o|pai|str|u|ve)/))?t.replace(/([A-Z])/g,"-$1").toLowerCase():t,Vn=e=>e==null||e===!1?null:e,ei=(e,t)=>{"value"in t&&(e.value=Vn(t.value),!e.multiple&&e.selectedIndex===-1&&(e.selectedIndex=0))},jn=e=>e instanceof DOMException&&e.name==="InvalidCharacterError",ti=(e,t,n)=>{t||={};for(let r in t){let o=t[r];if(r!=="children"&&(!n||n[r]!==o)){r=xe(r);let i=Ln(r);if(i){if(n?.[r]!==o&&(n&&e.removeEventListener(i[0],n[r],i[1]),o!=null)){if(typeof o!="function")throw new Error(`Event handler for "${r}" is not a function`);e.addEventListener(i[0],o,i[1])}}else if(r==="dangerouslySetInnerHTML"&&o)e.innerHTML=o.__html;else if(r==="ref"){je.get(e)?.();let a;typeof o=="function"?a=o(e)||(()=>o(null)):o&&"current"in o&&(o.current=e,a=()=>o.current=null),je.set(e,a)}else if(r==="style"){let a=e.style;typeof o=="string"?a.cssText=o:(a.cssText="",o!=null&&Me(o,a.setProperty.bind(a)))}else{if(r==="value"){let c=e.nodeName;if(c==="SELECT")continue;if((c==="INPUT"||c==="TEXTAREA")&&(e.value=Vn(o),c==="TEXTAREA")){e.textContent=o;continue}}else(r==="checked"&&e.nodeName==="INPUT"||r==="selected"&&e.nodeName==="OPTION")&&(e[r]=o);let a=Dn(e,r);try{o==null||o===!1?e.removeAttribute(a):o===!0?e.setAttribute(a,""):typeof o=="string"||typeof o=="number"?e.setAttribute(a,o):e.setAttribute(a,o.toString())}catch(c){if(!jn(c))throw c}}}}if(n)for(let r in n){let o=n[r];if(r!=="children"&&!(r in t)){r=xe(r);let i=Ln(r);if(i)e.removeEventListener(i[0],o,i[1]);else if(r==="ref")je.get(e)?.(),je.delete(e);else try{e.removeAttribute(Dn(e,r))}catch(a){if(!jn(a))throw a}}}},ni=(e,t)=>{t[S][0]=0,D.push([e,t]);let n=t.tag[U]||t.tag,r=n.defaultProps?{...n.defaultProps,...t.props}:t.props;try{return[n.call(null,r)]}finally{D.pop()}},Kn=(e,t,n,r,o)=>{e.vR?.length&&(r.push(...e.vR),delete e.vR),typeof e.tag=="function"&&e[S][1][1]?.forEach(i=>o.push(i)),e.vC.forEach(i=>{if(T(i))n.push(i);else if(typeof i.tag=="function"||i.tag===""){i.c=t;let a=n.length;if(Kn(i,t,n,r,o),i.s){for(let c=a;c<n.length;c++)n[c].s=!0;i.s=!1}}else n.push(i),i.vR?.length&&(r.push(...i.vR),delete i.vR)})},ri=e=>{for(;e&&(e.tag===Fe||!e.e);)e=e.tag===Fe||!e.vC?.[0]?e.nN:e.vC[0];return e?.e},Wn=e=>{T(e)||(e[S]?.[1][1]?.forEach(t=>t[2]?.()),je.get(e.e)?.(),e.p===2&&e.vC?.forEach(t=>t.p=2),e.vC?.forEach(Wn)),e.p||(e.e?.remove(),delete e.e),typeof e.tag=="function"&&(pe.delete(e),it.delete(e),delete e[S][3],e.a=!0)},Lt=(e,t,n)=>{e.c=t,Gn(e,t,n)},Fn=(e,t)=>{if(t){for(let n=0,r=e.length;n<r;n++)if(e[n]===t)return n}},Bn=Symbol(),Gn=(e,t,n)=>{let r=[],o=[],i=[];Kn(e,t,r,o,i),o.forEach(Wn);let a=n?void 0:t.childNodes,c,f=null;if(n)c=-1;else if(!a.length)c=0;else{let u=Fn(a,ri(e.nN));u!==void 0?(f=a[u],c=u):c=Fn(a,r.find(p=>p.tag!==Fe&&p.e)?.e)??-1,c===-1&&(n=!0)}for(let u=0,p=r.length;u<p;u++,c++){let s=r[u],l;if(s.s&&s.e)l=s.e,s.s=!1;else{let d=n||!s.e;T(s)?(s.e&&s.d&&(s.e.textContent=s.t),s.d=!1,l=s.e||=document.createTextNode(s.t)):(l=s.e||=s.n?document.createElementNS(s.n,s.tag):document.createElement(s.tag),ti(l,s.props,s.pP),Gn(s,l,d),s.tag==="select"&&ei(l,s.props))}s.tag===Fe?c--:n?l.parentNode||t.appendChild(l):a[c]!==l&&a[c-1]!==l&&(a[c+1]===l?t.appendChild(a[c]):t.insertBefore(l,f||a[c]||null))}if(e.pP&&(e.pP=void 0),i.length){let u=[],p=[];i.forEach(([,s,,l,d])=>{s&&u.push(s),l&&p.push(l),d?.()}),u.forEach(s=>s()),p.length&&requestAnimationFrame(()=>{p.forEach(s=>s())})}},oi=(e,t)=>!!(e&&e.length===t.length&&e.every((n,r)=>n[1]===t[r][1])),ii=e=>{let t=new Map;for(let n of e){let r=n.key;if(t.has(r))return;t.set(r,n)}return t},it=new WeakMap,st=(e,t,n)=>{let r=!n&&t.pC;n&&(t.pC||=t.vC);let o;try{n||=typeof t.tag=="function"?ni(e,t):ue(t.props.children),n[0]?.tag===""&&n[0][ee]&&(o=n[0][ee],e[5].push([e,o,t]));let i=r?[...t.pC]:t.vC?[...t.vC]:void 0,a=[],c,f=(i?.length||0)*2,u;for(let p=0;p<n.length;p++){if(Array.isArray(n[p])){n.splice(p,1,...n[p].flat(1/0)),p--;continue}let s=Dt(n[p]);if(s){typeof s.tag=="function"&&!s.tag[qe]&&(H.length>0&&(s[S][2]=H.map(d=>[d,d.values.at(-1)])),e[5]?.length&&(s[S][3]=e[5].at(-1)));let l;if(u&&s.key===void 0&&!T(s)&&(i=[...u.values()],u=void 0),u){let d=s.key,m=u.get(d);m&&(T(s)?T(m):m.tag===s.tag&&m.key===d)&&(l=m,u.delete(d))}else if(i&&i.length){let d=i[0];if(T(s)?T(d):!T(d)&&(s.key!==void 0?d.key===s.key&&d.tag===s.tag:d.tag===s.tag))l=i.shift();else{let m=i.findIndex(T(s)?h=>T(h):s.key!==void 0?h=>h.key===s.key&&h.tag===s.tag:h=>h.tag===s.tag);f-=m===-1?i.length:m,m!==-1&&(l=i[m],i.splice(m,1)),f<0&&(f=1/0,u=ii(i))}}if(l)if(T(s))l.t!==s.t&&(l.t=s.t,l.d=!0),s=l;else{let d=l.pP=l.props;if(l.props=s.props,l.f||=s.f||t.f,typeof s.tag=="function"){let m=l[S][2];l[S][2]=s[S][2]||[],l[S][3]=s[S][3],!l.f&&((l.o||l)===s.o||l.tag[Xe]?.(d,l.props))&&oi(m,l[S][2])&&(l.s=!0)}s=l}else if(!T(s)&&we){let d=M(we);d&&(s.n=d)}if(!T(s)&&!s.s&&(st(e,s),delete s.f),a.push(s),c&&!c.s&&!s.s)for(let d=c;d&&!T(d);d=d.vC?.at(-1))d.nN=s;c=s}}i=u?[...u.values()]:i,t.vR=r?[...t.vC,...i||[]]:i||[],t.vC=a,r&&delete t.pC}catch(i){if(t.f=!0,i===Bn){if(o)return;throw i}let[a,c,f]=t[S]?.[3]||[];if(c){let u=()=>De([0,!1,e[2]],f),p=it.get(f)||[];p.push(u),it.set(f,p);let s=c(i,()=>{let l=it.get(f);if(l){let d=l.indexOf(u);if(d!==-1)return l.splice(d,1),u()}});if(s){if(e[0]===1)e[1]=!0;else if(st(e,f,[s]),(c.length===1||e!==a)&&f.c){Lt(f,f.c,!1);return}throw Bn}}throw i}finally{o&&e[5].pop()}},Dt=e=>{if(!(e==null||typeof e=="boolean")){if(typeof e=="string"||typeof e=="number")return{t:e.toString(),d:!0};if("vR"in e&&(e={tag:e.tag,props:e.props,key:e.key,f:e.f,type:e.tag,ref:e.props.ref,o:e.o||e}),typeof e.tag=="function")e[S]=[0,[]];else{let t=Qo[e.tag];t&&(we||=Le(""),e.props.children=[{tag:we,props:{value:e.n=`http://www.w3.org/${t}`,children:e.props.children}}])}return e}},qn=(e,t,n)=>{e.c===t&&(e.c=n,e.vC.forEach(r=>qn(r,t,n)))},Un=(e,t)=>{t[S][2]?.forEach(([n,r])=>{n.values.push(r)});try{st(e,t,void 0)}catch{return}if(t.a){delete t.a;return}t[S][2]?.forEach(([n])=>{n.values.pop()}),(e[0]!==1||!e[1])&&Lt(t,t.c,!1)},pe=new WeakMap,ct=[],De=async(e,t)=>{e[5]||=[];let n=pe.get(t);n&&n[0](void 0);let r,o=new Promise(i=>r=i);if(pe.set(t,[r,()=>{e[2]?e[2](e,t,i=>{Un(i,t)}).then(()=>r(t)):(Un(e,t),r(t))}]),ct.length)ct.at(-1).add(t);else{await Promise.resolve();let i=pe.get(t);i&&(pe.delete(t),i[1]())}return o},Xn=(e,t)=>{let n=[];n[5]=[],n[4]=!0,st(n,e,void 0),n[4]=!1;let r=document.createDocumentFragment();Lt(e,r,!0),qn(e,r,t),t.replaceChildren(r)};var at=e=>{let t=new Set;ct.push(t),e(),t.forEach(n=>{let r=pe.get(n);r&&(pe.delete(n),r[1]())}),ct.pop()},jt=(e,t,n)=>({tag:Fe,props:{children:e},key:n,e:t,p:1});var Jn=(e,t={})=>{let n;return Object.keys(t).length>0&&console.warn("createRoot options are not supported yet"),{render(r){if(n===null)throw new Error("Cannot update an unmounted root");n?n(r):Xn(Dt({tag:()=>{let[o,i]=O(r);return n=i,o},props:{}}),e)},unmount(){n?.(null),n=null}}};function Qn(e,t){return typeof t=="bigint"?t.toString():t}var Bt=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function er(e){return new Bt(e)}function tr(e){return e==null}function nr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var Yn=Symbol("evaluating");function rr(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Yn)return r===void 0&&(r=Yn,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function or(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}var Ut="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ut(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function oe(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function sr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function ie(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function cr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function lt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Be(e){return typeof e=="string"?e:e?.message}function Ht(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function $e(e,t,n){var r;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Be(e.inst?._zod.def?.error?.(e))??Be(i?.(e))??Be(t?.error?.(e))??Be(n.customError?.(e))??Be(n.localeError?.(e))??"Invalid input",c={};for(let f of Object.keys(e))f==="inst"||f==="schema"||f==="continue"||f==="input"||f==="__proto__"||(c[f]=e[f]);return c.path??(c.path=[]),c.message=a,t?.reportInput&&(c.input=e.input),c}var si=/[\uD800-\uDBFF]/;function ar(e){let t=e.length;if(!si.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function ur(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lr(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ci(e,n,r.value)}}function de(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Vt(e,t,n){return de(e,t,n,!1)}function ci(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:de(this,t,n.bind(this))},set(r){de(this,t,r)}})}function ai(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ft,re=!1,ui={configurable:!0,get(){re=!0}};function q(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Ft!==e._zod){Ft=void 0;return}Ft=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ui);let o=re;re=!1;try{let i=n(this);return re?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),re=re||o,i}catch(i){throw delete this[t],re=re||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function fr(e,t,n,r){let o=ai(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}var pr;var Kt={value:void 0,enumerable:!1},dr="captureStackTrace"in Error?Error:null;function li(e){let t=dr;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return dr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function C(e,t,n,r){let o={};function i(l){this.def=l,this.constr=s,this.traits=new Set}i.prototype=o;let a=n,c=a&&new WeakSet;function f(l,d){if(l._zod){if(l._zod.traits.has(e))return}else{Kt.value=new i(d);try{Object.defineProperty(l,"_zod",Kt)}finally{Kt.value=void 0}}if(l._zod.traits.add(e),t(l,d),c){let h=Object.getPrototypeOf(l),_=l._zod.constr.prototype,z=h;for(;z&&z!==_;)z=Object.getPrototypeOf(z);let w=z??h;c.has(w)||(c.add(w),lr(w,a))}let m=s.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in l||(l[h]=m[h].bind(l)))}let u=r?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function s(l){let d=r?.Parent?li(p):this;f(d,l);let m=d._zod.deferred;if(m){for(let _ of m)_();d._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(d),d}return Object.defineProperty(s,"init",{value:f}),Object.defineProperty(s,Symbol.hasInstance,{value:l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var X=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(pr=globalThis).__zod_globalConfig??(pr.__zod_globalConfig={});var Ue=globalThis.__zod_globalConfig;function Se(e){return e&&Object.assign(Ue,e),Ue}function fi(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Qn,2)),e.message}function pi(e){this._zod.message=e}var di={get:fi,set:pi,enumerable:!0,configurable:!0},Gt={value:void 0,enumerable:!1},mr=new WeakSet([Object.prototype,Error.prototype]),hr=(e,t)=>{e.name="$ZodError",Gt.value=t,Object.defineProperty(e,"issues",Gt),Gt.value=void 0,Object.defineProperty(e,"message",di);let n=Object.getPrototypeOf(e);mr.has(n)||(mr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},cc=C("$ZodError",hr),He=C("$ZodError",hr,void 0,{Parent:Error});var hi=e=>{let t=(n,r,o,i)=>{let a=o?{...o,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},a);if(c instanceof Promise)throw new X;if(c.issues.length){let f=new(i?.Err??e)(c.issues.map(u=>$e(u,a,Se())));throw Ut(f,i?.callee??t),f}return c.value};return t},qt=hi(He),gi=e=>{let t=async(n,r,o,i)=>{let a=o?{...o,async:!0}:{async:!0},c=n._zod.run({value:r,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){let f=new(i?.Err??e)(c.issues.map(u=>$e(u,a,Se())));throw Ut(f,i?.callee??t),f}return c.value};return t},Xt=gi(He),_i=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new X;return i.issues.length?gr(e,i.issues,o):{success:!0,data:i.value}},Jt=_i(He);function gr(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>$e(o,n,Se()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}var vi=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?gr(e,i.issues,o):{success:!0,data:i.value}},Yt=vi(He);var _r=/^[\s\S]{0,}$/;var vr=/^-?\d+(?:\.\d+)?$/,yr=/^(?:true|false)$/i;var Qt=C("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var xi=e=>{let t=e.value;return!tr(t)&&t.length!==void 0};var br=C("$ZodCheckMinLength",(e,t)=>{var n;Qt.init(e,t),(n=e._zod.def).when??(n.when=xi),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?ar(o):i)>=t.minimum)return;let c=ur(o);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var wr={major:4,minor:6,patch:5};var J=C("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wr;let r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let i of o)for(let a of i._zod.onattach)a(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,f,u)=>{if(c.memo)return c;let p=ie(c),s;for(let l of f){if(l._zod.def.when){if(cr(c)||!l._zod.def.when(c))continue}else if(p)continue;let d=c.issues.length,m=l._zod.check(c);if(m instanceof Promise&&u?.async===!1)throw new X;if(s||m instanceof Promise)s=(s??Promise.resolve()).then(async()=>{await m,c.issues.length!==d&&(Ht(c.issues,d,e),p||(p=ie(c,d)))});else{if(c.issues.length===d)continue;Ht(c.issues,d,e),p||(p=ie(c,d))}}return s?s.then(()=>c):c},a=(c,f,u)=>{if(ie(c))return c.aborted=!0,c;let p=i(f,o,u);if(p instanceof Promise){if(u.async===!1)throw new X;return p.then(s=>e._zod.parse(s,u))}return e._zod.parse(p,u)};e._zod.run=(c,f)=>{if(f.skipChecks)return e._zod.parse(c,f);if(f.direction==="backward"){let p=e._zod.parse({value:c.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(s=>a(s,c,f)):a(p,c,f)}let u=e._zod.parse(c,f);if(u instanceof Promise){if(f.async===!1)throw new X;return u.then(p=>i(p,o,f))}return i(u,o,f)}}},{get"~standard"(){return Vt(this,"~standard",Si(this))},set"~standard"(e){de(this,"~standard",e)}}),zr=(e,t)=>e.issues.length?{issues:e.issues.map(n=>$e(n,t,Se()))}:{value:e.value};async function $i(e,t){let n={async:!0};return zr(await e._zod.run({value:t,issues:[]},n),n)}function Si(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return zr(r,n)}catch{}return $i(e,t)},vendor:"zod",version:1}}var kr=C("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=t.pattern??_r,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}});var Er=C("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=vr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}});var Zr=C("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=yr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}});function $r(e,t,n){e.issues.length&&t.issues.push(...lt(n,e.issues)),t.value[n]=e.value}var Pr=C("$ZodArray",(e,t)=>{J.init(e,t);let n=Ue.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),o):Array(i.length);let a=[],c=o?.abortEarly;for(let f=0;f<i.length;f++){let u=i[f],p=t.element._zod.run({value:u,issues:[]},o);if(p instanceof Promise)a.push(p.then(s=>$r(s,r,f)));else if($r(p,r,f),c&&p.issues.length!==0&&ie(p))break}return a.length?Promise.all(a).then(()=>r):r}});function ft(e,t,n,r,o,i){let a=n in r,c=i==="optional";if(!(!a&&c&&o==="optional")){if(e.issues.length){if(o!==void 0&&c&&!a)return;t.issues.push(...lt(n,e.issues))}if(!a&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(a||o==="defaulted"&&!c)&&(t.value[n]=void 0):t.value[n]=e.value}}var zi=[];function ki(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:zi,o=r.length?[...t,...r]:t;for(let a of o)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let i=sr(e.shape);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function Ei(e,t,n,r,o,i,a){let c=[],f=o.keySet,u=o.catchall._zod,p=u.def.type,s=u.optin,l=u.optout,d=0;for(let m in t){if(a&&n.issues.length!==d){if(ie(n,d))break;d=n.issues.length}if(f.has(m))continue;if(m==="__proto__"){p==="never"&&c.push(m);continue}if(p==="never"){c.push(m);continue}let h=u.run({value:t[m],issues:[]},r);h instanceof Promise?e.push(h.then(_=>ft(_,n,m,t,s,l))):ft(h,n,m,t,s,l)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Cr=C("$ZodObject",(e,t)=>{J.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let u=()=>{let p={...r};return Object.defineProperty(t,"shape",{value:p}),u.raw=p,p};u.raw=r,Object.defineProperty(t,"shape",{get:u})}let o=er(()=>ki(t));q(e,"propValues",u=>{let p=u.def.shape,s={};for(let l in p){let d=p[l]._zod;if(d.values){Object.prototype.hasOwnProperty.call(s,l)||or(s,l,new Set);for(let m of d.values)s[l].add(m);d.optin!==void 0&&s[l].add(void 0)}}return s});let i=ir,a=t.catchall,c,f=Ue.memoizer;f?.attach(e),e._zod.parse=(u,p)=>{c??(c=o.value);let s=u.value;if(!i(s))return u.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),u;u.value=f?f.alloc(e,u,{},p):{};let l=[],d=c.shape,m=p?.abortEarly,h=u.issues.length;for(let _ of c.allKeys){if(m&&u.issues.length!==h){if(ie(u,h))break;h=u.issues.length}if(_==="__proto__")continue;let z=d[_],w=z._zod.optin,A=z._zod.optout,v=z._zod.run({value:s[_],issues:[]},p);v instanceof Promise?l.push(v.then($=>ft($,u,_,s,w,A))):ft(v,u,_,s,w,A)}return a?Ei(l,s,u,p,o.value,e,m===!0):l.length?Promise.all(l).then(()=>u):u}});function Sr(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ar=C("$ZodOptional",(e,t)=>{J.init(e,t),q(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",q(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),q(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${nr(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(i=>Sr(n,i)):Sr(n,o)}return t.innerType._zod.run(n,r)}});var Mr=C("$ZodLazy",(e,t)=>{J.init(e,t),rr(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),q(e,"pattern",n=>n.innerType?._zod?.pattern),q(e,"propValues",n=>n.innerType?._zod?.propValues),q(e,"optin",n=>n.innerType?._zod?.optin??void 0),q(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)});function Tr(e){return e.checks&&(e.checks=[...e.checks]),e}function Nr(e,t){return new e(Tr({type:"string",...oe(t)}))}function Rr(e,t){return new e(Tr({type:"number",checks:[],...oe(t)}))}function Or(e,t){return new e({type:"boolean",...oe(t)})}function en(e,t){return new br({check:"min_length",...oe(t),minimum:e})}var he=C("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){de(this,"with",e)},parse(e,t){return qt(this,e,t,{callee:this.parse})},parseAsync(e,t){return Xt(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Jt(this,e,t)},safeParseAsync(e,t){return Yt(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0})},clone(e,t){return ut(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),Ci=C("ZodMiniString",(e,t)=>{kr.init(e,t),he.init(e,t)});function B(e){return Nr(Ci,e)}var Ai=C("ZodMiniNumber",(e,t)=>{Er.init(e,t),he.init(e,t)});function Ir(e){return Rr(Ai,e)}var Mi=C("ZodMiniBoolean",(e,t)=>{Zr.init(e,t),he.init(e,t)});function pt(e){return Or(Mi,e)}var Ti=C("ZodMiniArray",(e,t)=>{Pr.init(e,t),he.init(e,t)});function Y(e,t){return new Ti({type:"array",element:e,...oe(t)})}var Ni=C("ZodMiniObject",(e,t)=>{Cr.init(e,t),he.init(e,t),fr(e,"shape",n=>n._zod.def.shape,!1)});function se(e,t){let n={type:"object",shape:e??{},...oe(t)};return new Ni(n)}var Ri=C("ZodMiniOptional",(e,t)=>{Ar.init(e,t),he.init(e,t)});function tn(e){return new Ri({type:"optional",innerType:e})}var Oi=C("ZodMiniLazy",(e,t)=>{Mr.init(e,t),he.init(e,t)});function nn(e){return new Oi({type:"lazy",getter:e})}var Dr=se({id:B(),name:B(),label:B(),active:pt(),children:nn(()=>Y(Dr))}),jr=se({name:B(),path:Y(B()),docs:Y(Dr),groups:nn(()=>Y(jr))}),Lr=se({depth:Ir(),slug:B(),text:B()}),Fr=se({title:B(),groups:Y(jr),outline:Y(se({part:tn(B()),sections:Y(se({heading:Lr,part:tn(B()),subs:Y(se({heading:Lr}))})).check(en(1))})),home:pt(),cursorFace:pt()});function Br(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Br(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Di(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Br(e))&&(r&&(r+=" "),r+=t);return r}var x=Di;var Hr=Le({pending:!1,data:null,method:null,action:null}),Ur=new Set,Vr=e=>{Ur.add(e),e.finally(()=>Ur.delete(e))};var sn=Qe({button:()=>to,clearCache:()=>ji,composeRef:()=>dt,form:()=>Yr,input:()=>eo,link:()=>qr,meta:()=>Xr,script:()=>Wr,style:()=>Gr,title:()=>Kr}),ji=()=>{rn=Object.create(null),on=Object.create(null)},dt=(e,t)=>ot(()=>n=>{let r;e&&(typeof e=="function"?r=e(n)||(()=>{e(null)}):e&&"current"in e&&(e.current=n,r=()=>{e.current=null}));let o=t(n);return()=>{o?.(),r?.()}},[e]),rn=Object.create(null),on=Object.create(null),Ve=(e,t,n,r,o)=>{if(t?.itemProp)return{tag:e,props:t,type:e,ref:t.ref};let i=document.head,{onLoad:a,onError:c,precedence:f,blocking:u,...p}=t,s=null,l=!1,d=ye[e],m=Ye(e,r),h=v=>v.getAttribute("rel")==="stylesheet"&&v.getAttribute("data-precedence")!==null,_;if(m){let v=i.querySelectorAll(e);e:for(let $ of v)if(!(e==="link"&&!h($))){for(let y of d)if($.getAttribute(y)===t[y]){s=$;break e}}if(!s){let $=d.reduce((y,P)=>t[P]===void 0?y:`${y}-${P}-${t[P]}`,e);l=!on[$],s=on[$]||=(()=>{let y=document.createElement(e);for(let P of d)t[P]!==void 0&&y.setAttribute(P,t[P]);return t.rel&&y.setAttribute("rel",t.rel),y})()}}else _=i.querySelectorAll(e);f=r?f??"":void 0,r&&(p[Ze]=f);let z=fe(v=>{if(m){if(e==="link"&&f!==void 0){let y=!1;for(let P of i.querySelectorAll(e)){let L=P.getAttribute(Ze);if(L===null){i.insertBefore(v,P);return}if(y&&L!==f){i.insertBefore(v,P);return}L===f&&(y=!0)}i.appendChild(v);return}let $=!1;for(let y of i.querySelectorAll(e)){if($&&y.getAttribute("data-precedence")!==f){i.insertBefore(v,y);return}y.getAttribute("data-precedence")===f&&($=!0)}i.appendChild(v)}else if(e==="link")i.contains(v)||i.appendChild(v);else if(_){let $=!1;for(let y of _)if(y===v){$=!0;break}$||i.insertBefore(v,i.contains(_[0])?_[0]:i.querySelector(e)),_=void 0}},[m,f,e]),w=dt(t.ref,v=>{let $=d[0];if(n===2&&(v.innerHTML=""),(l||_)&&z(v),!c&&!a||!$)return;let y=rn[v.getAttribute($)]||=new Promise((P,L)=>{v.addEventListener("load",P),v.addEventListener("error",L)});a&&(y=y.then(a)),c&&(y=y.catch(c)),y.catch(()=>{})});if(o&&u==="render"){let v=ye[e][0];if(v&&t[v]){let $=t[v],y=rn[$]||=new Promise((P,L)=>{z(s),s.addEventListener("load",P),s.addEventListener("error",L)});rt(y)}}let A={tag:e,type:e,props:{...p,ref:w},ref:w};return A.p=n,s&&(A.e=s),jt(A,i)},Kr=e=>{let t=Hn();return(t&&M(t))?.endsWith("svg")?{tag:"title",props:e,type:"title",ref:e.ref}:Ve("title",e,void 0,!1,!1)},Wr=e=>!e||["src","async"].some(t=>!e[t])?{tag:"script",props:e,type:"script",ref:e.ref}:Ve("script",e,1,!1,!0),Gr=e=>!e||!["href","precedence"].every(t=>t in e)?{tag:"style",props:e,type:"style",ref:e.ref}:(e["data-href"]=e.href,delete e.href,Ve("style",e,2,!0,!0)),qr=e=>!e||["onLoad","onError"].some(t=>t in e)||e.rel==="stylesheet"&&(!("precedence"in e)||"disabled"in e)?{tag:"link",props:e,type:"link",ref:e.ref}:Ve("link",e,1,Je(e),!0),Xr=e=>Ve("meta",e,void 0,!1,!1),Jr=Symbol(),Yr=e=>{let{action:t,...n}=e;typeof t!="function"&&(n.action=t);let[r,o]=O([null,!1]),i=fe(async u=>{let p=u.isTrusted?t:u.detail[Jr];if(typeof p!="function")return;u.preventDefault();let s=new FormData(u.target);o([s,!0]);let l=p(s);l instanceof Promise&&(Vr(l),await l),o([null,!0])},[]),a=dt(e.ref,u=>(u.addEventListener("submit",i),()=>{u.removeEventListener("submit",i)})),[c,f]=r;return r[1]=!1,{tag:Hr,props:{value:{pending:c!==null,data:c,method:c?"post":null,action:c?t:null},children:{tag:"form",props:{...n,ref:a},type:"form",ref:a}},f}},Qr=(e,{formAction:t,...n})=>{if(typeof t=="function"){let r=fe(o=>{o.preventDefault(),o.currentTarget.form.dispatchEvent(new CustomEvent("submit",{detail:{[Jr]:t}}))},[]);n.ref=dt(n.ref,o=>(o.addEventListener("click",r),()=>{o.removeEventListener("click",r)}))}return{tag:e,props:n,type:e,ref:n.ref}},eo=e=>Qr("input",e),to=e=>Qr("button",e);Object.assign(Ee,{title:Kr,script:Wr,style:Gr,link:qr,meta:Xr,form:Yr,input:eo,button:to});var cn=(e,t,n)=>(typeof e=="string"&&sn[e]&&(e=sn[e]),{tag:e,type:e,props:t,key:n,ref:t.ref}),Ke=e=>cn("",e,void 0);var an=(({children:e,fallback:t,fallbackRender:n,onError:r})=>{let o=Ke({children:e});return o[ee]=i=>{if(i instanceof Promise)throw i;return r?.(i),n?.(i)||t},o}),un=(({children:e,fallback:t})=>{let n=Ke({children:e});return n[ee]=(r,o)=>{if(!(r instanceof Promise))throw r;return r.finally(o),t},n});var Fi=0,mt=async e=>{try{return e.flat().map(no)}catch(t){if(t instanceof Promise){let n=le();return await t,n(()=>mt(e))}else throw t}},no=e=>{if(e==null||typeof e=="boolean")return"";if(typeof e=="string"||Array.isArray(e))return F([e]);if(te(e))return ne(e);{let t=e.toString();return t instanceof Promise?t:k(t)}},ro=async({children:e,fallback:t,fallbackRender:n,onError:r})=>{if(!e)return k("");Array.isArray(e)||(e=[e]);let o=M(ln)?.scriptNonce,i,a=()=>i||=le(),c,f=()=>c||=(async()=>{let s=await t;if(s==null)return;if(typeof s=="string"||Array.isArray(s))return a()(()=>F([s]));if(te(s))return a()(()=>ne(s));let l=await a()(()=>s.toString());return k(l,l.callbacks||s.callbacks)})(),u=async s=>{let l=await f();return a()(async()=>{r?.(s);let d=l!==void 0?l:n&&Pt(R,{},n(s))||"",m=await R({children:d}).toString();return k(m,m.callbacks||d.callbacks)})},p=[];try{p=e.map(no)}catch(s){let l=a();s instanceof Promise?p=[s.then(()=>l(()=>mt(e))).catch(d=>u(d))]:p=[await u(s)]}if(p.some(s=>s instanceof Promise)){a();let s=Fi++,l=RegExp(`(<template id="E:${s}"></template>)(.*?)(<!--E:${s}-->)`,"s"),d=!1,m=async({error:z,buffer:w})=>{if(d)return"";d=!0;let A=await u(z),v=A.callbacks;return w?(w[0]=w[0].replace(l,()=>A),v?.length?k("",v):""):k(`<template data-hono-target="E:${s}">${A}</template><script>
1
+ (function(){var e=Symbol(`RENDERER`),t=Symbol(`ERROR_HANDLER`),n=Symbol(`STASH`),r=Symbol(`INTERNAL`),i=Symbol(`MEMO`),a=Symbol(`PERMALINK`),o=e=>(e[r]=!0,e),s={Stringify:1,BeforeStream:2,Stream:3},c=(e,t)=>{let n=new String(e);return n.isEscaped=!0,n.callbacks=t,n},l=/[&<>'"]/,u=async(e,t)=>{let n=``;t||=[];let r=await Promise.all(e);for(let e=r.length-1;n+=r[e],e--,!(e<0);e--){let i=r[e];typeof i==`object`&&t.push(...i.callbacks||[]);let a=i.isEscaped;if(i=await(typeof i==`object`?i.toString():i),typeof i==`object`&&t.push(...i.callbacks||[]),i.isEscaped??a)n+=i;else{let e=[n];d(i,e),n=e[0]}}return c(n,t)},d=(e,t)=>{let n=e.search(l);if(n===-1){t[0]+=e;return}let r,i,a=0;for(i=n;i<e.length;i++){switch(e.charCodeAt(i)){case 34:r=`&quot;`;break;case 39:r=`&#39;`;break;case 38:r=`&amp;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}t[0]+=e.substring(a,i)+r,a=i+1}t[0]+=e.substring(a,i)},f=e=>{let t=e.callbacks;if(!t?.length)return e;let n=[e],r={};return t.forEach(e=>e({phase:s.Stringify,buffer:n,context:r})),n[0]},p=async(e,t,n,r,i)=>{typeof e==`object`&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let a=e.callbacks;if(!a?.length)return Promise.resolve(e);i?i[0]+=e:i=[e];let o=Promise.all(a.map(e=>e({phase:t,buffer:i,context:r}))).then(e=>Promise.all(e.filter(Boolean).map(e=>p(e,t,!1,r,i))).then(()=>i[0]));return n?c(await o,a):o},m={title:[],script:[`src`],style:[`data-href`],link:[`href`],meta:[`name`,`httpEquiv`,`charset`,`itemProp`]},h={},g=`data-precedence`,_=e=>e.rel===`stylesheet`&&`precedence`in e,ee=(e,t)=>e===`link`?t:m[e].length>0,v=Object.defineProperty,te=(e,t)=>{let n={};for(var r in e)v(n,r,{get:e[r],enumerable:!0});return t||v(n,Symbol.toStringTag,{value:`Module`}),n},y=e=>Array.isArray(e)?e:[e],b=te({button:()=>fe,form:()=>le,input:()=>de,link:()=>se,meta:()=>C,script:()=>ae,style:()=>oe,title:()=>ie}),ne=new WeakMap,re=(e,t,n,r)=>({buffer:i,context:a})=>{if(!i)return;let o=ne.get(a)||{};ne.set(a,o);let s=o[e]||=[],c=!1,l=m[e],u=ee(e,r!==void 0);if(u){LOOP:for(let[,t]of s)if(e!==`link`||t.rel===`stylesheet`&&t[`data-precedence`]!==void 0){for(let e of l)if((t?.[e]??null)===n?.[e]){c=!0;break LOOP}}}if(c?i[0]=i[0].replaceAll(t,``):u||e===`link`?s.push([t,n,r]):s.unshift([t,n,r]),i[0].indexOf(`</head>`)!==-1){let t;if(e===`link`||r!==void 0){let e=[];t=s.map(([t,,n],r)=>{if(n===void 0)return[t,2**53-1,r];let i=e.indexOf(n);return i===-1&&(e.push(n),i=e.length-1),[t,i,r]}).sort((e,t)=>e[1]-t[1]||e[2]-t[2]).map(([e])=>e)}else t=s.map(([e])=>e);t.forEach(e=>{i[0]=i[0].replaceAll(e,``)}),i[0]=i[0].replace(/(?=<\/head>)/,()=>t.join(``))}},x=(e,t,n)=>T([new E(e,n,y(t??[]))]),S=(e,t,n,r)=>{if(`itemProp`in n)return x(e,t,n);let{precedence:i,blocking:a,...o}=n;i=r?i??``:void 0,r&&(o[g]=i);let s=new E(e,o,y(t||[])).toString();return s instanceof Promise?s.then(t=>c(t,[...t.callbacks||[],re(e,t,o,i)])):c(s,[re(e,s,o,i)])},ie=({children:e,...t})=>{let n=Me();if(n){let r=k(n);if(r===`svg`||r===`head`)return new E(`title`,t,y(e??[]))}return S(`title`,e,t,!1)},ae=({children:e,...t})=>{let n=Me();return[`src`,`async`].some(e=>!t[e])||n&&k(n)===`head`?x(`script`,e,t):S(`script`,e,t,!1)},oe=({children:e,...t})=>[`href`,`precedence`].every(e=>e in t)?(t[`data-href`]=t.href,delete t.href,S(`style`,e,t,!0)):x(`style`,e,t),se=({children:e,...t})=>[`onLoad`,`onError`].some(e=>e in t)||t.rel===`stylesheet`&&(!(`precedence`in t)||`disabled`in t)?x(`link`,e,t):S(`link`,e,t,_(t)),C=({children:e,...t})=>{let n=Me();return n&&k(n)===`head`?x(`meta`,e,t):S(`meta`,e,t,!1)},ce=(e,{children:t,...n})=>new E(e,n,y(t??[])),le=e=>(typeof e.action==`function`&&(e.action=a in e.action?e.action[a]:void 0),ce(`form`,e)),ue=(e,t)=>(typeof t.formAction==`function`&&(t.formAction=a in t.formAction?t.formAction[a]:void 0),ce(e,t)),de=e=>ue(`input`,e),fe=e=>ue(`button`,e),pe=new Map([[`className`,`class`],[`htmlFor`,`for`],[`crossOrigin`,`crossorigin`],[`httpEquiv`,`http-equiv`],[`itemProp`,`itemprop`],[`fetchPriority`,`fetchpriority`],[`noModule`,`nomodule`],[`formAction`,`formaction`]]),me=e=>pe.get(e)||e,he=/[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,ge=new Set,_e=1024,ve=/^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,ye=new Set,be=256,xe=(e,t,n)=>{e.size>=t&&e.clear(),e.add(n)},Se=e=>ye.has(e)?!0:typeof e==`string`?e.length===0||!ve.test(e)&&(xe(ye,be,e),!0):!1,Ce=e=>{if(ge.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(!(t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===45||t===95||t===46||t===58))return!he.test(e)&&(xe(ge,_e,e),!0)}return xe(ge,_e,e),!0},we=/[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/,Te=new Set,Ee=1024,De=e=>{if(Te.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(!(t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===45||t===95))return!we.test(e)&&(xe(Te,Ee,e),!0)}return xe(Te,Ee,e),!0},Oe=/[;"'\\/\[\](){}]/,ke=e=>{if(!Oe.test(e))return!1;let t=0,n=[];for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(a===92){if(r===i-1)return!0;r++}else if(t!==0){if(a===10||a===12||a===13)return!0;a===t&&(t=0)}else if(a===47&&e.charCodeAt(r+1)===42){let t=e.indexOf(`*/`,r+2);if(t===-1)return!0;r=t+1}else if(a===34||a===39)t=a;else if(a===40)n.push(41);else if(a===91)n.push(93);else if(a===123||a===125)return!0;else if(a===41||a===93){if(n[n.length-1]!==a)return!0;n.pop()}else if(a===59&&n.length===0)return!0}return t!==0||n.length!==0},Ae=(e,t)=>{for(let[n,r]of Object.entries(e)){let e=n[0]===`-`||!/[A-Z]/.test(n)?n:n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);if(!De(e))continue;if(r==null){t(e,null);continue}let i;if(typeof r==`number`)i=e.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?!.*gap)(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/)?`${r}`:`${r}px`;else if(typeof r==`string`){if(ke(r))continue;i=r}else continue;t(e,i)}},je=void 0,Me=()=>je,Ne=e=>/[A-Z]/.test(e)&&e.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/)?e.replace(/([A-Z])/g,`-$1`).toLowerCase():e,Pe=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Fe=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.defer.disabled.download.formnovalidate.hidden.inert.ismap.itemscope.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.selected`.split(`.`),Ie=(e,t)=>e.then(e=>{if(typeof e!=`string`&&!Array.isArray(e)&&!(e instanceof E))return e;let n=Array.isArray(e)?e:[e],r=()=>{let e=[``];return w(n,e),e.length===1?c(e[0],e.callbacks):u(e,e.callbacks)};return t?t(r):nt(r)}),w=(e,t)=>{for(let n=0,r=e.length;n<r;n++){let r=e[n];if(typeof r==`string`)d(r,t);else if(typeof r==`boolean`||r==null)continue;else if(r instanceof E)r.toStringToBuffer(t);else if(typeof r==`number`)t[0]+=r;else if(r.isEscaped){t[0]+=r;let e=r.callbacks;e&&(t.callbacks||=[],t.callbacks.push(...e))}else r instanceof Promise?t.unshift(``,r):w(r,t)}},T=e=>nt(()=>{let t=[``];return w(e,t),t.length===1?c(t[0],t.callbacks):u(t,t.callbacks)}),Le=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof E)&&!(e instanceof Promise)&&!e.isEscaped&&typeof e.toString==`function`,Re=e=>{let t=e.toString(),n=e=>T([String(e)]);return t instanceof Promise?t.then(n):n(t)},E=class{tag;props;key;children;isEscaped=!0;constructor(e,t,n){if(typeof e!=`function`&&!Se(e))throw Error(`Invalid JSX tag name: ${e}`);this.tag=e,this.props=t,this.children=n}get type(){return this.tag}get ref(){return this.props.ref||null}toString(){return nt(()=>{let e=[``];return this.toStringToBuffer(e),e.length===1?`callbacks`in e?f(c(e[0],e.callbacks)).toString():e[0]:u(e,e.callbacks)})}toStringToBuffer(e){let t=this.tag,n=this.props,{children:r}=this;e[0]+=`<${t}`;let i=t===`svg`||je&&k(je)===`svg`?e=>Ne(me(e)):e=>me(e);for(let[a,o]of Object.entries(n))if(a=i(a),Ce(a)&&a!==`children`){if(a===`style`&&typeof o==`object`){let t=``;Ae(o,(e,n)=>{n!=null&&(t+=`${t?`;`:``}${e}:${n}`)}),e[0]+=` style="`,d(t,e),e[0]+=`"`}else if(typeof o==`string`)e[0]+=` ${a}="`,d(o,e),e[0]+=`"`;else if(o!=null){if(typeof o==`number`||o.isEscaped)e[0]+=` ${a}="${o}"`;else if(typeof o==`boolean`&&Fe.includes(a))o&&(e[0]+=` ${a}=""`);else if(a===`dangerouslySetInnerHTML`){if(r.length>0)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");r=[c(o.__html)]}else if(o instanceof Promise)e[0]+=` ${a}="`,e.unshift(`"`,o);else if(typeof o==`function`){if(!a.startsWith(`on`)&&a!==`ref`)throw Error(`Invalid prop '${a}' of type 'function' supplied to '${t}'.`)}else e[0]+=` ${a}="`,d(o.toString(),e),e[0]+=`"`}}Pe.includes(t)&&r.length===0?e[0]+=`/>`:(e[0]+=`>`,w(r,e),e[0]+=`</${t}>`)}},ze=class extends E{toStringToBuffer(e){let{children:t}=this,n={...this.props};t.length&&(n.children=t.length===1?t[0]:t);let r=this.tag.call(null,n);typeof r!=`boolean`&&r!=null&&(r instanceof Promise?O.length===0?e.unshift(``,Ie(r)):e.unshift(``,Ie(r,rt())):r instanceof E?r.toStringToBuffer(e):Array.isArray(r)?w(r,e):typeof r==`number`||r.isEscaped?(e[0]+=r,r.callbacks&&(e.callbacks||=[],e.callbacks.push(...r.callbacks))):d(r,e))}},Be=class extends E{toStringToBuffer(e){w(this.children,e)}},Ve=(e,t,...n)=>{t??={},n.length&&(t.children=n.length===1?n[0]:n);let r=t.key;delete t.key;let i=Ue(e,t,n);return i.key=r,i},He=!1,Ue=(t,n,r)=>{if(!He){for(let t in h)b[t][e]=h[t];He=!0}return typeof t==`function`?new ze(t,n,r):b[t]?new ze(b[t],n,r):t===`svg`||t===`head`?(je||=it(``),new E(t,n,[new ze(je,{value:t},r)])):new E(t,n,r)},D=({children:e})=>new Be(``,{children:e},Array.isArray(e)?e:e?[e]:[]),O=[],We=!1,Ge,Ke,qe=0,Je=!1,Ye=()=>{if(We)return Ge;We=!0;let e=globalThis,t;for(let n of[()=>e.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncLocalStorage,()=>e.process?.mainModule?.require?.(`node:async_hooks`)?.AsyncLocalStorage]){try{t=n()}catch{}if(t)break}return t&&(Ge=new t),Ge},Xe=()=>Ye()?.getStore()||Ke,Ze=()=>{qe>0&&!Je&&(Je=!0,console.warn(`hono/jsx: AsyncLocalStorage is unavailable in this runtime, so useContext() after an await in an async component falls back to the context default value during server-side rendering. To get provided values across await boundaries, use a runtime with AsyncLocalStorage (Node.js >= 20.16, Deno, Bun, or Cloudflare Workers with the nodejs_compat flag).`))},Qe=(e,t)=>{if(!e)return Ze(),t.values;let n=e.get(t);return n||(n=[t.values[0]],e.set(t,n)),n},$e=(e,t)=>{if(!e)return Ze(),t.values.at(-1);let n=e.get(t);return n?.length?n.at(-1):t.values[0]},et=e=>(e?O.filter(t=>e.has(t)):O).map(t=>[t,$e(e,t)]),tt=(e,t,n)=>nt(()=>{let t=Xe(),r=n.map(([e,n])=>{let r=Qe(t,e);return r.push(n),r}),i=()=>{r.forEach(e=>{e.pop()})};try{let t=e();return t instanceof Promise?t.finally(i):(i(),t)}catch(e){throw i(),e}},t),nt=(e,t)=>{if(Xe())return e();let n=t??new WeakMap,r=Ye();if(r)return r.run(n,e);Ke=n;let i;try{i=e()}finally{Ke=void 0}return!Je&&i instanceof Promise&&(qe++,i=i.finally(()=>{qe--})),i},rt=()=>{let e=Xe(),t=et(e);return n=>tt(n,e,t)},it=t=>{let n=[t],r=(e=>{let t=Qe(Xe(),r);t.push(e.value);let n;try{n=typeof e.children==`string`?T([e.children]):Le(e.children)?Re(e.children):e.children?(Array.isArray(e.children)?new Be(``,{},e.children):e.children).toString():c(``)}catch(e){throw t.pop(),e}return n instanceof Promise?n.finally(()=>t.pop()).then(e=>c(e,e.callbacks)):(t.pop(),c(n))});return r.values=n,r.Provider=r,r[e]=at(n),O.push(r),r},k=e=>$e(Xe(),e),at=e=>({value:n,children:r})=>{if(!r)return;let i={children:[{tag:o(()=>{e.push(n)}),props:{}}]};Array.isArray(r)?i.children.push(...r.flat()):i.children.push(r),i.children.push({tag:o(()=>{e.pop()}),props:{}});let a={tag:``,props:i,type:``};return a[t]=t=>{throw e.pop(),t},a},ot=e=>{let t=[e],n=at(t);return n.values=t,n.Provider=n,O.push(n),n},st=0,ct=2,lt=3,ut=4,dt=new WeakMap,ft=(e,t)=>!e||!t||e.length!==t.length||t.some((t,n)=>t!==e[n]),pt=void 0,mt=[],A=e=>{let t=()=>typeof e==`function`?e():e,r=P.at(-1);if(!r)return[t(),()=>{}];let[,i]=r,a=i[n][1][st]||=[],o=i[n][0]++;return a[o]||=[t(),e=>{let t=pt,n=a[o];if(typeof e==`function`&&(e=e(n[0])),!Object.is(e,n[0])){if(n[0]=e,mt.length){let[e,n]=mt.at(-1);Promise.all([e===3?i:Kt([e,!1,t],i),n]).then(([n])=>{if(!n||e!==2&&e!==3)return;let r=n.vC;requestAnimationFrame(()=>{setTimeout(()=>{r===n.vC&&Kt([+(e===3),!1,t],n)})})})}else Kt([0,!1,t],i)}}]},ht=(e,t,r)=>{let i=P.at(-1);if(!i)return;let[,a]=i,o=a[n][1][1]||=[],s=a[n][0]++,[c,,l]=o[s]||=[];if(ft(c,r)){l&&l();let n=()=>{i[e]=void 0,i[2]=t()},i=[r,void 0,void 0,void 0,void 0];i[e]=n,o[s]=i}},gt=(e,t)=>ht(3,e,t),j=(e,t)=>ht(1,e,t),_t=(e,t)=>{let r=P.at(-1);if(!r)return e;let[,i]=r,a=i[n][1][ct]||=[],o=i[n][0]++,s=a[o];return ft(s?.[1],t)?a[o]=[e,t]:e=a[o][0],e};function M(e){let t=P.at(-1);if(!t)return{current:e};let[,r]=t,i=r[n][1][ut]||=[],a=r[n][0]++;return i[a]||={current:e}}var vt=e=>{let t=dt.get(e);if(t){if(t.length===2)throw t[1];return t[0]}throw e.then(t=>dt.set(e,[t]),t=>dt.set(e,[void 0,t])),e},yt=(e,t)=>{let r=P.at(-1);if(!r)return e();let[,i]=r,a=i[n][1][lt]||=[],o=i[n][0]++,s=a[o];return ft(s?.[1],t)&&(a[o]=[e(),t]),a[o][0]},N=`_hp`,bt={Change:`Input`,DoubleClick:`DblClick`},xt={svg:`2000/svg`,math:`1998/Math/MathML`},P=[],F=new WeakMap,I=void 0,St=()=>I,L=e=>`t`in e,Ct={onClick:[`click`,!1]},wt=e=>{if(!e.startsWith(`on`))return;if(Ct[e])return Ct[e];let t=e.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(t){let[,n,r]=t;return Ct[e]=[(bt[n]||n).toLowerCase(),!!r]}},Tt=(e,t)=>I&&e instanceof SVGElement&&/[A-Z]/.test(t)&&(t in e.style||t.match(/^(?:o|pai|str|u|ve)/))?t.replace(/([A-Z])/g,`-$1`).toLowerCase():t,Et=e=>e==null||e===!1?null:e,Dt=(e,t)=>{`value`in t&&(e.value=Et(t.value),!e.multiple&&e.selectedIndex===-1&&(e.selectedIndex=0))},Ot=e=>e instanceof DOMException&&e.name===`InvalidCharacterError`,kt=(e,t,n)=>{t||={};for(let r in t){let i=t[r];if(r!==`children`&&(!n||n[r]!==i)){r=me(r);let t=wt(r);if(t){if(n?.[r]!==i&&(n&&e.removeEventListener(t[0],n[r],t[1]),i!=null)){if(typeof i!=`function`)throw Error(`Event handler for "${r}" is not a function`);e.addEventListener(t[0],i,t[1])}}else if(r===`dangerouslySetInnerHTML`&&i)e.innerHTML=i.__html;else if(r===`ref`){F.get(e)?.();let t;typeof i==`function`?t=i(e)||(()=>i(null)):i&&`current`in i&&(i.current=e,t=()=>i.current=null),F.set(e,t)}else if(r===`style`){let t=e.style;typeof i==`string`?t.cssText=i:(t.cssText=``,i!=null&&Ae(i,t.setProperty.bind(t)))}else{if(r===`value`){let t=e.nodeName;if(t===`SELECT`)continue;if((t===`INPUT`||t===`TEXTAREA`)&&(e.value=Et(i),t===`TEXTAREA`)){e.textContent=i;continue}}else(r===`checked`&&e.nodeName===`INPUT`||r===`selected`&&e.nodeName===`OPTION`)&&(e[r]=i);let t=Tt(e,r);try{i==null||i===!1?e.removeAttribute(t):i===!0?e.setAttribute(t,``):typeof i==`string`||typeof i==`number`?e.setAttribute(t,i):e.setAttribute(t,i.toString())}catch(e){if(!Ot(e))throw e}}}}if(n)for(let r in n){let i=n[r];if(r!==`children`&&!(r in t)){r=me(r);let t=wt(r);if(t)e.removeEventListener(t[0],i,t[1]);else if(r===`ref`)F.get(e)?.(),F.delete(e);else try{e.removeAttribute(Tt(e,r))}catch(e){if(!Ot(e))throw e}}}},At=(t,r)=>{r[n][0]=0,P.push([t,r]);let i=r.tag[e]||r.tag,a=i.defaultProps?{...i.defaultProps,...r.props}:r.props;try{return[i.call(null,a)]}finally{P.pop()}},jt=(e,t,r,i,a)=>{e.vR?.length&&(i.push(...e.vR),delete e.vR),typeof e.tag==`function`&&e[n][1][1]?.forEach(e=>a.push(e)),e.vC.forEach(e=>{if(L(e))r.push(e);else if(typeof e.tag==`function`||e.tag===``){e.c=t;let n=r.length;if(jt(e,t,r,i,a),e.s){for(let e=n;e<r.length;e++)r[e].s=!0;e.s=!1}}else r.push(e),e.vR?.length&&(i.push(...e.vR),delete e.vR)})},Mt=e=>{for(;e&&(e.tag===N||!e.e);)e=e.tag===N||!e.vC?.[0]?e.nN:e.vC[0];return e?.e},Nt=e=>{L(e)||(e[n]?.[1][1]?.forEach(e=>e[2]?.()),F.get(e.e)?.(),e.p===2&&e.vC?.forEach(e=>e.p=2),e.vC?.forEach(Nt)),e.p||(e.e?.remove(),delete e.e),typeof e.tag==`function`&&(R.delete(e),Bt.delete(e),delete e[n][3],e.a=!0)},Pt=(e,t,n)=>{e.c=t,Lt(e,t,n)},Ft=(e,t)=>{if(t){for(let n=0,r=e.length;n<r;n++)if(e[n]===t)return n}},It=Symbol(),Lt=(e,t,n)=>{let r=[],i=[],a=[];jt(e,t,r,i,a),i.forEach(Nt);let o=n?void 0:t.childNodes,s,c=null;if(n)s=-1;else if(!o.length)s=0;else{let t=Ft(o,Mt(e.nN));t===void 0?s=Ft(o,r.find(e=>e.tag!==N&&e.e)?.e)??-1:(c=o[t],s=t),s===-1&&(n=!0)}for(let e=0,i=r.length;e<i;e++,s++){let i=r[e],a;if(i.s&&i.e)a=i.e,i.s=!1;else{let e=n||!i.e;L(i)?(i.e&&i.d&&(i.e.textContent=i.t),i.d=!1,a=i.e||=document.createTextNode(i.t)):(a=i.e||=i.n?document.createElementNS(i.n,i.tag):document.createElement(i.tag),kt(a,i.props,i.pP),Lt(i,a,e),i.tag===`select`&&Dt(a,i.props))}i.tag===N?s--:n?a.parentNode||t.appendChild(a):o[s]!==a&&o[s-1]!==a&&(o[s+1]===a?t.appendChild(o[s]):t.insertBefore(a,c||o[s]||null))}if(e.pP&&=void 0,a.length){let e=[],t=[];a.forEach(([,n,,r,i])=>{n&&e.push(n),r&&t.push(r),i?.()}),e.forEach(e=>e()),t.length&&requestAnimationFrame(()=>{t.forEach(e=>e())})}},Rt=(e,t)=>!!(e&&e.length===t.length&&e.every((e,n)=>e[1]===t[n][1])),zt=e=>{let t=new Map;for(let n of e){let e=n.key;if(t.has(e))return;t.set(e,n)}return t},Bt=new WeakMap,Vt=(e,a,o)=>{let s=!o&&a.pC;o&&(a.pC||=a.vC);let c;try{o||=typeof a.tag==`function`?At(e,a):y(a.props.children),o[0]?.tag===``&&o[0][t]&&(c=o[0][t],e[5].push([e,c,a]));let l=s?[...a.pC]:a.vC?[...a.vC]:void 0,u=[],d,f=(l?.length||0)*2,p;for(let t=0;t<o.length;t++){if(Array.isArray(o[t])){o.splice(t,1,...o[t].flat(1/0)),t--;continue}let s=Ht(o[t]);if(s){typeof s.tag==`function`&&!s.tag[r]&&(O.length>0&&(s[n][2]=O.map(e=>[e,e.values.at(-1)])),e[5]?.length&&(s[n][3]=e[5].at(-1)));let t;if(p&&s.key===void 0&&!L(s)&&(l=[...p.values()],p=void 0),p){let e=s.key,n=p.get(e);n&&(L(s)?L(n):n.tag===s.tag&&n.key===e)&&(t=n,p.delete(e))}else if(l&&l.length){let e=l[0];if(L(s)?L(e):!L(e)&&(s.key===void 0||e.key===s.key)&&e.tag===s.tag)t=l.shift();else{let e=l.findIndex(L(s)?e=>L(e):s.key===void 0?e=>e.tag===s.tag:e=>e.key===s.key&&e.tag===s.tag);f-=e===-1?l.length:e,e!==-1&&(t=l[e],l.splice(e,1)),f<0&&(f=1/0,p=zt(l))}}if(t){if(L(s))t.t!==s.t&&(t.t=s.t,t.d=!0),s=t;else{let e=t.pP=t.props;if(t.props=s.props,t.f||=s.f||a.f,typeof s.tag==`function`){let r=t[n][2];t[n][2]=s[n][2]||[],t[n][3]=s[n][3],!t.f&&((t.o||t)===s.o||t.tag[i]?.(e,t.props))&&Rt(r,t[n][2])&&(t.s=!0)}s=t}}else if(!L(s)&&I){let e=k(I);e&&(s.n=e)}if(!L(s)&&!s.s&&(Vt(e,s),delete s.f),u.push(s),d&&!d.s&&!s.s)for(let e=d;e&&!L(e);e=e.vC?.at(-1))e.nN=s;d=s}}l=p?[...p.values()]:l,a.vR=s?[...a.vC,...l||[]]:l||[],a.vC=u,s&&delete a.pC}catch(t){if(a.f=!0,t===It){if(c)return;throw t}let[r,i,o]=a[n]?.[3]||[];if(i){let n=()=>Kt([0,!1,e[2]],o),a=Bt.get(o)||[];a.push(n),Bt.set(o,a);let s=i(t,()=>{let e=Bt.get(o);if(e){let t=e.indexOf(n);if(t!==-1)return e.splice(t,1),n()}});if(s){if(e[0]===1)e[1]=!0;else if(Vt(e,o,[s]),(i.length===1||e!==r)&&o.c){Pt(o,o.c,!1);return}throw It}}throw t}finally{c&&e[5].pop()}},Ht=e=>{if(e!=null&&typeof e!=`boolean`){if(typeof e==`string`||typeof e==`number`)return{t:e.toString(),d:!0};if(`vR`in e&&(e={tag:e.tag,props:e.props,key:e.key,f:e.f,type:e.tag,ref:e.props.ref,o:e.o||e}),typeof e.tag==`function`)e[n]=[0,[]];else{let t=xt[e.tag];t&&(I||=ot(``),e.props.children=[{tag:I,props:{value:e.n=`http://www.w3.org/${t}`,children:e.props.children}}])}return e}},Ut=(e,t,n)=>{e.c===t&&(e.c=n,e.vC.forEach(e=>Ut(e,t,n)))},Wt=(e,t)=>{t[n][2]?.forEach(([e,t])=>{e.values.push(t)});try{Vt(e,t,void 0)}catch{return}t.a?delete t.a:(t[n][2]?.forEach(([e])=>{e.values.pop()}),(e[0]!==1||!e[1])&&Pt(t,t.c,!1))},R=new WeakMap,Gt=[],Kt=async(e,t)=>{e[5]||=[];let n=R.get(t);n&&n[0](void 0);let r,i=new Promise(e=>r=e);if(R.set(t,[r,()=>{e[2]?e[2](e,t,e=>{Wt(e,t)}).then(()=>r(t)):(Wt(e,t),r(t))}]),Gt.length)Gt.at(-1).add(t);else{await Promise.resolve();let e=R.get(t);e&&(R.delete(t),e[1]())}return i},qt=(e,t)=>{let n=[];n[5]=[],n[4]=!0,Vt(n,e,void 0),n[4]=!1;let r=document.createDocumentFragment();Pt(e,r,!0),Ut(e,r,t),t.replaceChildren(r)},Jt=e=>{let t=new Set;Gt.push(t),e(),t.forEach(e=>{let t=R.get(e);t&&(R.delete(e),t[1]())}),Gt.pop()},Yt=(e,t,n)=>({tag:N,props:{children:e},key:n,e:t,p:1}),Xt=(e,t={})=>{let n;return Object.keys(t).length>0&&console.warn(`createRoot options are not supported yet`),{render(t){if(n===null)throw Error(`Cannot update an unmounted root`);n?n(t):qt(Ht({tag:()=>{let[e,r]=A(t);return n=r,e},props:{}}),e)},unmount(){n?.(null),n=null}}};function Zt(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Qt(e,t){return typeof t==`bigint`?t.toString():t}var $t=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function en(e){return new $t(e)}function tn(e){return e==null}function nn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var rn=Symbol(`evaluating`);function an(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==rn)return r===void 0&&(r=rn,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function on(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}var sn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function cn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ln(e){if(cn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return cn(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}var un=new Set([`string`,`number`,`symbol`]);function dn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function fn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function pn(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function B(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function mn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function V(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function hn(e){return typeof e==`string`?e:e?.message}function gn(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function H(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:hn(e.inst?._zod.def?.error?.(e))??hn(a?.(e))??hn(t?.error?.(e))??hn(n.customError?.(e))??hn(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var _n=/[\uD800-\uDBFF]/;function vn(e){let t=e.length;if(!_n.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function yn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function bn(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Cn(e,n,r.value)}}function xn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Sn(e,t,n){return xn(e,t,n,!1)}function Cn(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:xn(this,t,n.bind(this))},set(e){xn(this,t,e)}})}function wn(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Tn,U=!1,En={configurable:!0,get(){U=!0}};function W(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Tn!==e._zod?Tn=void 0:(Tn=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,En);let e=U;U=!1;try{let r=n(this);return U?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),U||=e,r}catch(n){throw delete this[t],U||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Dn(e,t,n,r){let i=wn(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var On,kn={value:void 0,enumerable:!1},An=`captureStackTrace`in Error?Error:null;function jn(e){let t=An;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return An=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function G(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){kn.value=new a(r);try{Object.defineProperty(n,"_zod",kn)}finally{kn.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),bn(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?jn(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Mn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(On=globalThis).__zod_globalConfig??(On.__zod_globalConfig={});var Nn=globalThis.__zod_globalConfig;function K(e){return e&&Object.assign(Nn,e),Nn}function Pn(){let e=this._zod;return e.message??=JSON.stringify(e.def,Qt,2),e.message}function Fn(e){this._zod.message=e}var In={get:Pn,set:Fn,enumerable:!0,configurable:!0},Ln={value:void 0,enumerable:!1},Rn=new WeakSet([Object.prototype,Error.prototype]),zn=(e,t)=>{e.name=`$ZodError`,Ln.value=t,Object.defineProperty(e,"issues",Ln),Ln.value=void 0,Object.defineProperty(e,"message",In);let n=Object.getPrototypeOf(e);Rn.has(n)||(Rn.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))};G(`$ZodError`,zn);var Bn=G(`$ZodError`,zn,void 0,{Parent:Error}),Vn=(e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Mn;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>H(e,o,K())));throw sn(n,a?.callee??t),n}return s.value};return t})(Bn),Hn=(e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>H(e,o,K())));throw sn(n,a?.callee??t),n}return s.value};return t})(Bn),Un=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Mn;return a.issues.length?Wn(e,a.issues,i):{success:!0,data:a.value}})(Bn);function Wn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>H(e,n,K()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Gn=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Wn(e,a.issues,i):{success:!0,data:a.value}})(Bn),Kn=/^[\s\S]{0,}$/,qn=/^-?\d+(?:\.\d+)?$/,Jn=/^(?:true|false)$/i,Yn=G(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Xn=e=>{let t=e.value;return!tn(t)&&t.length!==void 0},Zn={number:`number`,bigint:`bigint`,object:`date`},Qn=G(`$ZodCheckGreaterThan`,(e,t)=>{Yn.init(e,t);let n=Zn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Zn[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$n=G(`$ZodCheckMinLength`,(e,t)=>{var n;Yn.init(e,t),(n=e._zod.def).when??(n.when=Xn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?vn(r):i)>=t.minimum)return;let a=yn(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),er={major:4,minor:6,patch:5},q=G(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=er;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=B(t),a;for(let o of n){if(o._zod.def.when){if(mn(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Mn;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(gn(t.issues,n,e),i||=B(t,n))});else{if(t.issues.length===n)continue;gn(t.issues,n,e),i||=B(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(B(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Mn;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Mn;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Sn(this,`~standard`,rr(this))},set"~standard"(e){xn(this,`~standard`,e)}}),tr=(e,t)=>e.issues.length?{issues:e.issues.map(e=>H(e,t,K()))}:{value:e.value};async function nr(e,t){let n={async:!0};return tr(await e._zod.run({value:t,issues:[]},n),n)}function rr(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return tr(r,n)}catch{}return nr(e,t)},vendor:`zod`,version:1}}var ir=G(`$ZodString`,(e,t)=>{q.init(e,t),e._zod.pattern=t.pattern??Kn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),ar=G(`$ZodNumber`,(e,t)=>{q.init(e,t),e._zod.pattern=qn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),or=G(`$ZodBoolean`,(e,t)=>{q.init(e,t),e._zod.pattern=Jn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}});function sr(e,t,n){e.issues.length&&t.issues.push(...V(n,e.issues)),t.value[n]=e.value}var cr=G(`$ZodArray`,(e,t)=>{q.init(e,t);let n=Nn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>sr(t,r,e)));else if(sr(c,r,e),s&&c.issues.length!==0&&B(c))break}return o.length?Promise.all(o).then(()=>r):r}});function lr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...V(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var ur=[];function dr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ur,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=pn(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function fr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(B(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>lr(e,n,i,t,d,f))):lr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var pr=G(`$ZodObject`,(e,t)=>{q.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=en(()=>dr(t));W(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||on(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=cn,o=t.catchall,s,c=Nn.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(B(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>lr(n,t,e,r,a,o))):lr(s,t,e,r,a,o)}return o?fr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),mr=G(`$ZodRecord`,(e,t)=>{q.init(e,t);let n=Nn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!ln(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>H(e,i,K())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...V(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...V(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&qn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>H(e,i,K())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...V(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...V(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),hr=G(`$ZodEnum`,(e,t)=>{q.init(e,t);let n=Zt(t.entries),r=new Set(n);e._zod.values=r,W(e,`pattern`,e=>{let t=Zt(e.def.entries).filter(e=>un.has(typeof e));return RegExp(t.length?`^(${t.map(e=>dn(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}});function gr(e,t){return e.value=t.issues.length?void 0:t.value,e}var _r=G(`$ZodOptional`,(e,t)=>{q.init(e,t),W(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,W(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),W(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${nn(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>gr(e,t)):gr(e,r)}return t.innerType._zod.run(e,n)}}),vr=G(`$ZodLazy`,(e,t)=>{q.init(e,t),an(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),W(e,`pattern`,e=>e.innerType?._zod?.pattern),W(e,`propValues`,e=>e.innerType?._zod?.propValues),W(e,`optin`,e=>e.innerType?._zod?.optin??void 0),W(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)});function yr(e){return e.checks&&=[...e.checks],e}function br(e,t){return new e(yr({type:`string`,...z(t)}))}function xr(e,t){return new e(yr({type:`number`,checks:[],...z(t)}))}function Sr(e,t){return new e({type:`boolean`,...z(t)})}function Cr(e,t){return new Qn({check:`greater_than`,...z(t),value:e,inclusive:!0})}function wr(e,t){return new $n({check:`min_length`,...z(t),minimum:e})}var J=G(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);q.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){xn(this,`with`,e)},parse(e,t){return Vn(this,e,t,{callee:this.parse})},parseAsync(e,t){return Hn(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Un(this,e,t)},safeParseAsync(e,t){return Gn(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0})},clone(e,t){return fn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),Tr=G(`ZodMiniString`,(e,t)=>{ir.init(e,t),J.init(e,t)});function Y(e){return br(Tr,e)}var Er=G(`ZodMiniNumber`,(e,t)=>{ar.init(e,t),J.init(e,t)});function Dr(e){return xr(Er,e)}var Or=G(`ZodMiniBoolean`,(e,t)=>{or.init(e,t),J.init(e,t)});function kr(e){return Sr(Or,e)}var Ar=G(`ZodMiniArray`,(e,t)=>{cr.init(e,t),J.init(e,t)});function X(e,t){return new Ar({type:`array`,element:e,...z(t)})}var jr=G(`ZodMiniObject`,(e,t)=>{pr.init(e,t),J.init(e,t),Dn(e,`shape`,e=>e._zod.def.shape,!1)});function Z(e,t){return new jr({type:`object`,shape:e??{},...z(t)})}var Mr=G(`ZodMiniRecord`,(e,t)=>{mr.init(e,t),J.init(e,t)});function Nr(e,t,n){return new Mr({type:`record`,keyType:e,valueType:t,...z(n),partial:!0})}var Pr=G(`ZodMiniEnum`,(e,t)=>{hr.init(e,t),J.init(e,t),e.options=[...e._zod.values]});function Fr(e,t){return new Pr({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...z(t)})}var Ir=G(`ZodMiniOptional`,(e,t)=>{_r.init(e,t),J.init(e,t)});function Lr(e){return new Ir({type:`optional`,innerType:e})}var Rr=G(`ZodMiniLazy`,(e,t)=>{vr.init(e,t),J.init(e,t)});function zr(e){return new Rr({type:`lazy`,getter:e})}var Br=Z({id:Y(),name:Y(),label:Y(),active:kr(),children:zr(()=>X(Br))}),Vr=Z({name:Y(),path:X(Y()),docs:X(Br),groups:zr(()=>X(Vr))}),Hr=Z({depth:Dr(),slug:Y(),text:Y()}),Ur=Z({title:Y(),groups:X(Vr),outline:X(Z({part:Lr(Y()),sections:X(Z({heading:Hr,part:Lr(Y()),subs:X(Z({heading:Hr}))})).check(wr(1))})),home:kr(),cursorFace:kr()});function Wr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Wr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Q(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wr(e))&&(r&&(r+=` `),r+=t);return r}var Gr=ot({pending:!1,data:null,method:null,action:null}),Kr=new Set,qr=e=>{Kr.add(e),e.finally(()=>Kr.delete(e))},Jr=te({button:()=>li,clearCache:()=>Yr,composeRef:()=>Xr,form:()=>oi,input:()=>ci,link:()=>ri,meta:()=>ii,script:()=>ti,style:()=>ni,title:()=>ei}),Yr=()=>{Zr=Object.create(null),Qr=Object.create(null)},Xr=(e,t)=>yt(()=>n=>{let r;e&&(typeof e==`function`?r=e(n)||(()=>{e(null)}):e&&`current`in e&&(e.current=n,r=()=>{e.current=null}));let i=t(n);return()=>{i?.(),r?.()}},[e]),Zr=Object.create(null),Qr=Object.create(null),$r=(e,t,n,r,i)=>{if(t?.itemProp)return{tag:e,props:t,type:e,ref:t.ref};let a=document.head,{onLoad:o,onError:s,precedence:c,blocking:l,...u}=t,d=null,f=!1,p=m[e],h=ee(e,r),_=e=>e.getAttribute(`rel`)===`stylesheet`&&e.getAttribute(`data-precedence`)!==null,v;if(h){let n=a.querySelectorAll(e);LOOP:for(let r of n)if(e!==`link`||_(r)){for(let e of p)if(r.getAttribute(e)===t[e]){d=r;break LOOP}}if(!d){let n=p.reduce((e,n)=>t[n]===void 0?e:`${e}-${n}-${t[n]}`,e);f=!Qr[n],d=Qr[n]||=(()=>{let n=document.createElement(e);for(let e of p)t[e]!==void 0&&n.setAttribute(e,t[e]);return t.rel&&n.setAttribute(`rel`,t.rel),n})()}}else v=a.querySelectorAll(e);c=r?c??``:void 0,r&&(u[g]=c);let te=_t(t=>{if(h){if(e===`link`&&c!==void 0){let n=!1;for(let r of a.querySelectorAll(e)){let e=r.getAttribute(g);if(e===null||n&&e!==c){a.insertBefore(t,r);return}e===c&&(n=!0)}a.appendChild(t);return}let n=!1;for(let r of a.querySelectorAll(e)){if(n&&r.getAttribute(`data-precedence`)!==c){a.insertBefore(t,r);return}r.getAttribute(`data-precedence`)===c&&(n=!0)}a.appendChild(t)}else if(e===`link`)a.contains(t)||a.appendChild(t);else if(v){let n=!1;for(let e of v)if(e===t){n=!0;break}n||a.insertBefore(t,a.contains(v[0])?v[0]:a.querySelector(e)),v=void 0}},[h,c,e]),y=Xr(t.ref,e=>{let t=p[0];if(n===2&&(e.innerHTML=``),(f||v)&&te(e),!s&&!o||!t)return;let r=Zr[e.getAttribute(t)]||=new Promise((t,n)=>{e.addEventListener(`load`,t),e.addEventListener(`error`,n)});o&&(r=r.then(o)),s&&(r=r.catch(s)),r.catch(()=>{})});if(i&&l===`render`){let n=m[e][0];if(n&&t[n]){let e=t[n];vt(Zr[e]||=new Promise((e,t)=>{te(d),d.addEventListener(`load`,e),d.addEventListener(`error`,t)}))}}let b={tag:e,type:e,props:{...u,ref:y},ref:y};return b.p=n,d&&(b.e=d),Yt(b,a)},ei=e=>{let t=St();return(t&&k(t))?.endsWith(`svg`)?{tag:`title`,props:e,type:`title`,ref:e.ref}:$r(`title`,e,void 0,!1,!1)},ti=e=>!e||[`src`,`async`].some(t=>!e[t])?{tag:`script`,props:e,type:`script`,ref:e.ref}:$r(`script`,e,1,!1,!0),ni=e=>!e||![`href`,`precedence`].every(t=>t in e)?{tag:`style`,props:e,type:`style`,ref:e.ref}:(e[`data-href`]=e.href,delete e.href,$r(`style`,e,2,!0,!0)),ri=e=>!e||[`onLoad`,`onError`].some(t=>t in e)||e.rel===`stylesheet`&&(!(`precedence`in e)||`disabled`in e)?{tag:`link`,props:e,type:`link`,ref:e.ref}:$r(`link`,e,1,_(e),!0),ii=e=>$r(`meta`,e,void 0,!1,!1),ai=Symbol(),oi=e=>{let{action:t,...n}=e;typeof t!=`function`&&(n.action=t);let[r,i]=A([null,!1]),a=_t(async e=>{let n=e.isTrusted?t:e.detail[ai];if(typeof n!=`function`)return;e.preventDefault();let r=new FormData(e.target);i([r,!0]);let a=n(r);a instanceof Promise&&(qr(a),await a),i([null,!0])},[]),o=Xr(e.ref,e=>(e.addEventListener(`submit`,a),()=>{e.removeEventListener(`submit`,a)})),[s,c]=r;return r[1]=!1,{tag:Gr,props:{value:{pending:s!==null,data:s,method:s?`post`:null,action:s?t:null},children:{tag:`form`,props:{...n,ref:o},type:`form`,ref:o}},f:c}},si=(e,{formAction:t,...n})=>{if(typeof t==`function`){let e=_t(e=>{e.preventDefault(),e.currentTarget.form.dispatchEvent(new CustomEvent(`submit`,{detail:{[ai]:t}}))},[]);n.ref=Xr(n.ref,t=>(t.addEventListener(`click`,e),()=>{t.removeEventListener(`click`,e)}))}return{tag:e,props:n,type:e,ref:n.ref}},ci=e=>si(`input`,e),li=e=>si(`button`,e);Object.assign(h,{title:ei,script:ti,style:ni,link:ri,meta:ii,form:oi,input:ci,button:li});var $=(e,t,n)=>(typeof e==`string`&&Jr[e]&&(e=Jr[e]),{tag:e,type:e,props:t,key:n,ref:t.ref}),ui=e=>$(``,e,void 0),di=(({children:e,fallback:n,fallbackRender:r,onError:i})=>{let a=ui({children:e});return a[t]=e=>{if(e instanceof Promise)throw e;return i?.(e),r?.(e)||n},a}),fi=(({children:e,fallback:n})=>{let r=ui({children:e});return r[t]=(e,t)=>{if(!(e instanceof Promise))throw e;return e.finally(t),n},r}),pi=0,mi=async e=>{try{return e.flat().map(hi)}catch(t){if(t instanceof Promise){let n=rt();return await t,n(()=>mi(e))}throw t}},hi=e=>{if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||Array.isArray(e))return T([e]);if(Le(e))return Re(e);{let t=e.toString();return t instanceof Promise?t:c(t)}},gi=async({children:e,fallback:t,fallbackRender:n,onError:r})=>{if(!e)return c(``);Array.isArray(e)||(e=[e]);let i=k(_i)?.scriptNonce,a,o=()=>a||=rt(),l,u=()=>l||=(async()=>{let e=await t;if(e==null)return;if(typeof e==`string`||Array.isArray(e))return o()(()=>T([e]));if(Le(e))return o()(()=>Re(e));let n=await o()(()=>e.toString());return c(n,n.callbacks||e.callbacks)})(),d=async e=>{let t=await u();return o()(async()=>{r?.(e);let i=t===void 0?n&&Ve(D,{},n(e))||``:t,a=await D({children:i}).toString();return c(a,a.callbacks||i.callbacks)})},f=[];try{f=e.map(hi)}catch(t){let n=o();f=t instanceof Promise?[t.then(()=>n(()=>mi(e))).catch(e=>d(e))]:[await d(t)]}if(f.some(e=>e instanceof Promise)){o();let e=pi++,t=RegExp(`(<template id="E:${e}"></template>)(.*?)(<!--E:${e}-->)`,`s`),n=!1,r=async({error:r,buffer:i})=>{if(n)return``;n=!0;let a=await d(r),o=a.callbacks;return i?(i[0]=i[0].replace(t,()=>a),o?.length?c(``,o):``):c(`<template data-hono-target="E:${e}">${a}</template><script>
2
2
  ((d,c,n) => {
3
3
  c=d.currentScript.previousSibling
4
- d=d.getElementById('E:${s}')
4
+ d=d.getElementById('E:${e}')
5
5
  if(!d)return
6
- do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='E:${s}')
6
+ do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='E:${e}')
7
7
  d.replaceWith(c.content)
8
8
  })(document)
9
- <\/script>`,v)},h,_=Promise.all(p).catch(z=>h=z);return k(`<template id="E:${s}"></template><!--E:${s}-->`,[({phase:z,buffer:w,context:A})=>{if(z!==W.BeforeStream)return _.then(async v=>{if(h)throw h;v=v.flat();let $=v.join(""),y=w?"":`<template data-hono-target="E:${s}">${$}</template><script${o?` nonce="${o}"`:""}>
9
+ <\/script>`,o)},a,l=Promise.all(f).catch(e=>a=e);return c(`<template id="E:${e}"></template><!--E:${e}-->`,[({phase:n,buffer:o,context:u})=>{if(n!==s.BeforeStream)return l.then(async l=>{if(a)throw a;l=l.flat();let d=l.join(``),f=o?``:`<template data-hono-target="E:${e}">${d}</template><script${i?` nonce="${i}"`:``}>
10
10
  ((d,c) => {
11
11
  c=d.currentScript.previousSibling
12
- d=d.getElementById('E:${s}')
12
+ d=d.getElementById('E:${e}')
13
13
  if(!d)return
14
14
  d.parentElement.insertBefore(c.content,d.nextSibling)
15
15
  })(document)
16
- <\/script>`;if(v.every(Q=>!Q.callbacks?.length))return w&&(w[0]=w[0].replace(l,()=>$)),y;w&&(w[0]=w[0].replace(l,(Q,ze,V,We)=>`${ze}${$}${We}`));let P=v.map(Q=>Q.callbacks||[]).flat();z===W.Stream&&(y=await ke(y,W.BeforeStream,!0,A));let L=0,ce=P.map(Q=>(...ze)=>Q(...ze)?.then(V=>(L++,w?(L===P.length&&(w[0]=w[0].replace(l,(We,Ge,ae)=>ae)),w[0]+=V,k("",V.callbacks)):k(V+(L!==P.length?"":`<script>
16
+ <\/script>`;if(l.every(e=>!e.callbacks?.length))return o&&(o[0]=o[0].replace(t,()=>d)),f;o&&(o[0]=o[0].replace(t,(e,t,n,r)=>`${t}${d}${r}`));let m=l.map(e=>e.callbacks||[]).flat();n===s.Stream&&(f=await p(f,s.BeforeStream,!0,u));let h=0,g=m.map(n=>(...i)=>n(...i)?.then(n=>(h++,o?(h===m.length&&(o[0]=o[0].replace(t,(e,t,n)=>n)),o[0]+=n,c(``,n.callbacks)):c(n+(h===m.length?`<script>
17
17
  ((d,c,n) => {
18
- d=d.getElementById('E:${s}')
18
+ d=d.getElementById('E:${e}')
19
19
  if(!d)return
20
20
  n=d.nextSibling
21
- while(n.nodeType!=8||n.nodeValue!='E:${s}'){n=n.nextSibling}
21
+ while(n.nodeType!=8||n.nodeValue!='E:${e}'){n=n.nextSibling}
22
22
  n.remove()
23
23
  d.remove()
24
24
  })(document)
25
- <\/script>`),V.callbacks))).catch(V=>m({error:V,buffer:w})));return k(y,ce)}).catch(v=>m({error:v,buffer:w}))}])}else return R({children:p})};ro[U]=an;var ln=Oe(null),Bi=0,Ui=e=>typeof e=="string"||Array.isArray(e)?F([e]):e==null||typeof e=="boolean"?"":te(e)?ne(e):e.toString(),oo=async({children:e,fallback:t})=>{Array.isArray(e)||(e=[e]);let n=M(ln)?.scriptNonce,r=[],o={[S]:[0,[]]},i=()=>{D.pop()};try{o[S][0]=0,D.push([[],o]),r=e.map(Ui)}catch(a){if(a instanceof Promise){let c=le();r=[a.then(()=>c(()=>(o[S][0]=0,D.push([[],o]),mt(e).finally(i))))]}else throw a}finally{i()}if(r.some(a=>a instanceof Promise)){let a=Bi++,c=await(typeof t=="string"||Array.isArray(t)?F([t]):te(t)?ne(t):t.toString());return k(`<template id="H:${a}"></template>${c}<!--/$-->`,[...c.callbacks||[],({phase:f,buffer:u,context:p})=>{if(f!==W.BeforeStream)return Promise.all(r).then(async s=>{s=s.flat();let l=s.join("");u&&(u[0]=u[0].replace(new RegExp(`<template id="H:${a}"></template>.*?<!--/\\$-->`,"s"),()=>l));let d=u?"":`<template data-hono-target="H:${a}">${l}</template><script${n?` nonce="${n}"`:""}>
25
+ <\/script>`:``),n.callbacks))).catch(e=>r({error:e,buffer:o})));return c(f,g)}).catch(e=>r({error:e,buffer:o}))}])}return D({children:f})};gi[e]=di;var _i=it(null),vi=0,yi=e=>typeof e==`string`||Array.isArray(e)?T([e]):e==null||typeof e==`boolean`?``:Le(e)?Re(e):e.toString(),bi=async({children:e,fallback:t})=>{Array.isArray(e)||(e=[e]);let r=k(_i)?.scriptNonce,i=[],a={[n]:[0,[]]},o=()=>{P.pop()};try{a[n][0]=0,P.push([[],a]),i=e.map(yi)}catch(t){if(t instanceof Promise){let r=rt();i=[t.then(()=>r(()=>(a[n][0]=0,P.push([[],a]),mi(e).finally(o))))]}else throw t}finally{o()}if(i.some(e=>e instanceof Promise)){let e=vi++,n=await(typeof t==`string`||Array.isArray(t)?T([t]):Le(t)?Re(t):t.toString());return c(`<template id="H:${e}"></template>${n}<!--/$-->`,[...n.callbacks||[],({phase:t,buffer:n,context:a})=>{if(t!==s.BeforeStream)return Promise.all(i).then(async i=>{i=i.flat();let o=i.join(``);n&&(n[0]=n[0].replace(RegExp(`<template id="H:${e}"></template>.*?<!--/\\$-->`,`s`),()=>o));let l=n?``:`<template data-hono-target="H:${e}">${o}</template><script${r?` nonce="${r}"`:``}>
26
26
  ((d,c,n) => {
27
27
  c=d.currentScript.previousSibling
28
- d=d.getElementById('H:${a}')
28
+ d=d.getElementById('H:${e}')
29
29
  if(!d)return
30
30
  do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='/$')
31
31
  d.replaceWith(c.content)
32
32
  })(document)
33
- <\/script>`,m=s.map(h=>h.callbacks||[]).flat();return m.length?(f===W.Stream&&(d=await ke(d,W.BeforeStream,!0,p)),k(d,m)):d})}])}else return k(r.join(""))};oo[U]=un;var op=new TextEncoder;var ht="fh-cursor-face";var io="/_fh/reload",so="/favicon.svg";function g(e,t,n){let r;if(!t||!("children"in t))r=Ne(e,t,[]);else{let o=t.children;r=Array.isArray(o)?Ne(e,t,o):Ne(e,t,[o])}return r.key=n,r}var ao=e=>{let t=E(null),n=E(null),r=E({x:0,y:0,frame:0}),o=()=>{cancelAnimationFrame(r.current.frame),r.current.frame=0,t.current?.classList.remove("wg_cursorFace__root--visible")},i=()=>{n.current?.matches||o()},a=()=>{r.current.frame===0&&(r.current.frame=requestAnimationFrame(()=>{r.current.frame=0;let s=t.current;s!==null&&(s.style.transform=`translate3d(
34
- ${Math.max(0,Math.min(r.current.x+16,document.documentElement.clientWidth-s.width-16))}px,
35
- ${Math.max(0,Math.min(r.current.y+16,document.documentElement.clientHeight-s.height-16))}px,
33
+ <\/script>`,u=i.map(e=>e.callbacks||[]).flat();return u.length?(t===s.Stream&&(l=await p(l,s.BeforeStream,!0,a)),c(l,u)):l})}])}return c(i.join(``))};bi[e]=fi,new TextEncoder;var xi=`fh-cursor-face`,Si=`/favicon.svg`,Ci=e=>{let t=M(null),n=M(null),r=M({x:0,y:0,frame:0,hasPointer:!1}),i=()=>{cancelAnimationFrame(r.current.frame),r.current.frame=0,t.current?.classList.remove(`wg_cursorFace__root--visible`)},a=()=>{n.current?.matches||(r.current.hasPointer=!1,i())},o=()=>{r.current.frame===0&&(r.current.frame=requestAnimationFrame(()=>{r.current.frame=0;let e=t.current;e!==null&&(e.style.transform=`translate3d(
34
+ ${Math.max(0,Math.min(r.current.x+16,document.documentElement.clientWidth-e.width-16))}px,
35
+ ${Math.max(0,Math.min(r.current.y+16,document.documentElement.clientHeight-e.height-16))}px,
36
36
  0
37
- )`,s.classList.add("wg_cursorFace__root--visible"))}))},c=s=>{if(!n.current?.matches||s.pointerType!=="mouse"){o();return}r.current.x=s.clientX,r.current.y=s.clientY,a()},f=()=>{t.current?.classList.contains("wg_cursorFace__root--visible")&&a()},u=()=>{if(t.current?.classList.contains("wg_cursorFace__root--visible"))try{sessionStorage.setItem(ht,JSON.stringify({x:r.current.x,y:r.current.y}))}catch{}},p=()=>{try{let s=sessionStorage.getItem(ht);if(sessionStorage.removeItem(ht),s===null||!n.current?.matches)return;let l=JSON.parse(s);typeof l=="object"&&l!==null&&"x"in l&&"y"in l&&typeof l.x=="number"&&typeof l.y=="number"&&Number.isFinite(l.x)&&Number.isFinite(l.y)&&(r.current.x=l.x,r.current.y=l.y,a())}catch{}};return I(()=>{if(!e.ready)return;let s=new AbortController,l=matchMedia("(hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference)");return n.current=l,p(),document.addEventListener("pointermove",c,{passive:!0,signal:s.signal}),document.addEventListener("pointerdown",c,{passive:!0,signal:s.signal}),document.documentElement.addEventListener("pointerleave",o,{signal:s.signal}),addEventListener("blur",o,{signal:s.signal}),addEventListener("resize",f,{signal:s.signal}),addEventListener("pagehide",u,{signal:s.signal}),addEventListener("pageshow",p,{signal:s.signal}),l.addEventListener("change",i,{signal:s.signal}),()=>{s.abort(),n.current=null,o()}},[e.ready]),g("img",{ref:e.ready?t:void 0,className:x("wg_cursorFace__root"),src:so,width:24,height:24,alt:"","aria-hidden":"true",draggable:!1,"data-cursor-face":""})};var fn="(width < 1024px)",pn="(width >= 1360px)";var uo=e=>{let t=document.querySelector("[data-navigation]"),n=document.querySelector('[data-navigation-scroll="documents"]'),r=document.querySelector('[data-navigation-scroll="outline"]');if(!(!t||!n||!r)){t.dataset.navigationLayout=e.layout;try{let o=sessionStorage.getItem(e.key),i=o===null?void 0:JSON.parse(o),a=typeof i=="object"&&i!==null&&"version"in i&&i.version===e.version&&"state"in i?e.toState(i.state):{positions:{}},c=sessionStorage.getItem(`${e.key}:${e.layout==="drawer"?"drawer":"desktop"}`),f=a.positions[e.layout]===void 0&&c!==null?e.toState({positions:{[e.layout]:JSON.parse(c)}}).positions[e.layout]:void 0,u=a.positions[e.layout]??f,p=[...t.querySelectorAll(".wg_navigationNav__root a[href]")].map(s=>`${s.pathname}:${s.textContent}`).join(`
38
- `);if(u===void 0||u.navigation!==p)return;n.scrollTop=u.documents,u.pathname===location.pathname&&(r.scrollTop=u.outline)}catch{}}};var _t=e=>{let t=[...e.group.docs.map(n=>({kind:"document",key:`doc:${n.id}`,doc:n})),...e.group.groups.map(n=>({kind:"group",key:`group:${JSON.stringify(n.path)}`,group:n}))];return g("ul",{className:x("wg_navigationNavList__root"),"aria-label":e.group.name,children:t.map(n=>g("li",{className:x("wg_navigationNavList__item"),children:[n.kind==="document"&&g(R,{children:[g("a",{className:x("wg_navigationNavList__link",{"wg_navigationNavList__link--active":n.doc.active}),href:`/${n.doc.id}/`,title:n.doc.label,"aria-current":n.doc.active?"page":void 0,children:n.doc.name}),n.doc.children.length>0&&g(_t,{group:{name:n.doc.name,path:e.group.path,docs:n.doc.children,groups:[]}})]}),n.kind==="group"&&g(R,{children:[g("span",{className:x("wg_navigationNavList__branch"),children:n.group.name}),g(_t,{group:n.group})]})]},n.key))})};var lo="Document navigation",fo="Open navigation",po="Close navigation",mo="Navigation";var dn="On this page";var mn=e=>g("nav",{className:x("wg_navigationNav__root"),"aria-label":lo,children:g("div",{className:x("wg_navigationNav__docs"),children:e.groups.map(t=>g("section",{className:x("wg_navigationNav__docGroup"),"aria-label":t.name,children:[g("div",{className:x("wg_navigationNav__group"),children:t.name}),g(_t,{group:t})]},JSON.stringify(t.path)))})});var vt=e=>{let[t,n]=O({above:!1,below:!1}),r=E(0),o=()=>{if(r.current=0,e.portRef.current===null)return;let c=e.portRef.current.scrollTop>1,f=e.portRef.current.scrollHeight-e.portRef.current.clientHeight-e.portRef.current.scrollTop>1;n(u=>u.above===c&&u.below===f?u:{above:c,below:f})},i=()=>{r.current===0&&(r.current=requestAnimationFrame(o))},a=c=>{e.onScroll?.(),i()};return I(()=>{if(!e.ready||e.portRef.current===null)return;let c=new ResizeObserver(i);c.observe(e.portRef.current),e.portRef.current.firstElementChild!==null&&c.observe(e.portRef.current.firstElementChild);let f=!0;return addEventListener("pageshow",i),e.portRef.current.isConnected?o():queueMicrotask(()=>{f&&o()}),()=>{f=!1,c.disconnect(),removeEventListener("pageshow",i),cancelAnimationFrame(r.current),r.current=0}},[e.portRef,e.ready]),I(()=>{e.ready&&e.portRef.current?.isConnected&&o()},[e.children,e.ready]),g("div",{ref:e.ready?e.portRef:void 0,className:x("wg_navigation__scroll",e.kind==="documents"&&"wg_navigation__documents",e.kind==="outline"&&"wg_navigation__headings",e.ready&&"wg_navigation__scroll--ready",e.ready&&t.above&&"wg_navigation__scroll--above",e.ready&&t.below&&"wg_navigation__scroll--below"),"data-navigation-scroll":e.kind,onClick:e.onClick,onScroll:a,children:e.children})};var yt=e=>{if(!e)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch(t){if(t instanceof URIError)return null;throw t}};var ho=e=>{let[t,n]=O();return I(()=>{let o=e.groups.flatMap(f=>f.sections).flatMap(f=>[f.heading,...f.subs.map(u=>u.heading)]),i={id:0},a=()=>{i.id=0;let f=o.flatMap(u=>{let p=yt(`#${u.slug}`);return p?.checkVisibility()?[{slug:u.slug,top:p.getBoundingClientRect().top-Number.parseFloat(getComputedStyle(p).scrollMarginTop)}]:[]});n(f.findLast(u=>u.top<=1)?.slug??f[0]?.slug)},c=()=>{i.id===0&&(i.id=requestAnimationFrame(a))};return addEventListener("scroll",c,{passive:!0}),addEventListener("resize",c),addEventListener("toggle",c,!0),addEventListener("pageshow",c),document.addEventListener("DOMContentLoaded",c),document.readyState!=="loading"&&a(),()=>{cancelAnimationFrame(i.id),removeEventListener("scroll",c),removeEventListener("resize",c),removeEventListener("toggle",c,!0),removeEventListener("pageshow",c),document.removeEventListener("DOMContentLoaded",c)}},[e.groups]),g("nav",{className:x("wg_navigationToc__root"),"aria-label":dn,children:[g("div",{className:x("wg_navigationToc__label"),children:dn}),e.groups.map(r=>g("div",{className:x("wg_navigationToc__groupSection",{"wg_navigationToc__groupSection--named":r.part!==void 0}),children:[r.part!==void 0&&g("div",{className:x("wg_navigationToc__group"),children:r.part}),g("ul",{className:x("wg_navigationToc__list"),children:r.sections.map(o=>g("li",{className:x("wg_navigationToc__item"),children:[g("a",{className:x("wg_navigationToc__link",{"wg_navigationToc__link--active":o.heading.slug===t}),href:`#${o.heading.slug}`,"data-toc-link":"","aria-current":o.heading.slug===t?"location":void 0,children:o.heading.text}),o.subs.length>0&&g("ul",{className:x("wg_navigationToc__sub"),children:o.subs.map(i=>g("li",{className:x("wg_navigationToc__subItem"),children:g("a",{className:x("wg_navigationToc__subLink",{"wg_navigationToc__subLink--active":i.heading.slug===t}),href:`#${i.heading.slug}`,"data-toc-sub-link":"","aria-current":i.heading.slug===t?"location":void 0,children:i.heading.text})},i.heading.slug))})]},o.heading.slug))})]},r.sections[0].heading.slug))]})};var xt="for-humanity:navigation-scroll";var bt=e=>{let t=r=>{if(!(typeof r!="object"||r===null||!("navigation"in r)||typeof r.navigation!="string"||!("pathname"in r)||typeof r.pathname!="string"||!("documents"in r)||typeof r.documents!="number"||!Number.isFinite(r.documents)||r.documents<0||!("outline"in r)||typeof r.outline!="number"||!Number.isFinite(r.outline)||r.outline<0))return{navigation:r.navigation,pathname:r.pathname,documents:r.documents,outline:r.outline}};if(typeof e!="object"||e===null||!("positions"in e)||typeof e.positions!="object"||e.positions===null)return{positions:{}};let n={wide:t("wide"in e.positions?e.positions.wide:void 0),desktop:t("desktop"in e.positions?e.positions.desktop:void 0),drawer:t("drawer"in e.positions?e.positions.drawer:void 0)};return{positions:Object.fromEntries(Object.entries(n).filter(r=>r[1]!==void 0))}};var ge=e=>{let t=yt(e);for(let n=t?.closest("details");n;n=n.parentElement?.closest("details"))n.open=!0;return t};var go=e=>{let[t,n]=O(()=>e.stores===void 0?"desktop":matchMedia(fn).matches?"drawer":matchMedia(pn).matches?"wide":"desktop"),[r,o]=O(!1),i=E(null),a=E(null),c=E(null),f=E(null),u=E(null),p=E(null),s=E(null),l=E(null),d=E(null),m=E(null),h=E(t),_=E(null),z=E(!0),w=()=>d.current===null||m.current===null?h.current:d.current.matches?"drawer":m.current.matches?"wide":"desktop",A=()=>h.current==="drawer"?c.current:i.current,v=()=>h.current==="drawer"?f.current:a.current,$=()=>{let b=A();if(b!==null)return[...b.querySelectorAll(".wg_navigationNav__root a[href]")].map(Z=>`${Z.pathname}:${Z.textContent}`).join(`
39
- `)},y=()=>{let b=v();if(e.stores===void 0||b===null||u.current===null||z.current||h.current!==w()||h.current==="drawer"&&p.current?.open!==!0)return;let Z=$();if(Z===void 0)return;let j={navigation:Z,pathname:location.pathname,documents:b.scrollTop,outline:u.current.scrollTop};e.stores.scroll.setState(K=>({positions:{...K.positions,[h.current]:j}}))},P=()=>{h.current=w();let b=v(),Z=A();if(e.stores===void 0||b===null||u.current===null||Z===null||h.current==="drawer"&&p.current?.open!==!0)return;let j=$();if(j===void 0)return;let K=e.stores.scroll.getState().positions[h.current];b.scrollTop=0,u.current.scrollTop=0,K===void 0?uo({key:xt,version:1,layout:h.current,toState:bt}):K.navigation===j&&(b.scrollTop=K.documents,K.pathname===location.pathname&&(u.current.scrollTop=K.outline)),Z.dataset.navigationLayout=h.current,z.current=!1,y(),b.dispatchEvent(new Event("scroll")),u.current.dispatchEvent(new Event("scroll"))},L=b=>{p.current?.open!==!0&&(document.body.classList.remove("wg_shell__root--drawerOpen"),o(!1))},ce=()=>{y(),p.current?.close(),document.body.classList.remove("wg_shell__root--drawerOpen"),o(!1)},Q=b=>{w()!=="drawer"||p.current===null||p.current.open||(p.current.showModal(),document.body.classList.add("wg_shell__root--drawerOpen"),o(!0),P())},ze=b=>{ce()},V=b=>{b.preventDefault(),ce()},We=b=>{if(p.current===null||b.target!==p.current)return;let Z=p.current.getBoundingClientRect();(b.clientX<Z.left||b.clientX>Z.right||b.clientY<Z.top||b.clientY>Z.bottom)&&ce()},Ge=b=>{if(y(),p.current?.open!==!0||b.defaultPrevented||b.button!==0||b.metaKey||b.ctrlKey||b.shiftKey||b.altKey||!(b.target instanceof Element))return;let Z=b.target.closest("a[href]");if(!(!(Z instanceof HTMLAnchorElement)||Z.target!==""&&Z.target!=="_self"||Z.hasAttribute("download"))&&(ce(),Z.origin===location.origin&&Z.pathname===location.pathname&&Z.search===location.search&&Z.hash)){let j=ge(Z.hash);j!==null&&(j.tabIndex=-1,j.focus({preventScroll:!0}))}},ae=()=>{let b=w();b!==h.current&&(document.activeElement instanceof HTMLElement&&(_.current={navigation:document.activeElement.closest("[data-navigation]")!==null,drawer:document.activeElement===s.current||document.activeElement.closest("[data-navigation-drawer]")!==null,href:document.activeElement.getAttribute("href")}),b!=="drawer"&&ce(),z.current=!0,h.current=b,at(()=>n(b)))},yn=b=>{!b.persisted||e.stores===void 0||(z.current=!0,at(()=>e.stores?.scroll.persist.rehydrate()),ae(),P())};return I(()=>{if(e.stores!==void 0)return d.current=matchMedia(fn),m.current=matchMedia(pn),d.current.addEventListener("change",ae),m.current.addEventListener("change",ae),addEventListener("pagehide",y),addEventListener("pageshow",yn),()=>{d.current?.removeEventListener("change",ae),m.current?.removeEventListener("change",ae),d.current=null,m.current=null,removeEventListener("pagehide",y),removeEventListener("pageshow",yn),document.body.classList.remove("wg_shell__root--drawerOpen")}},[e.stores]),I(()=>{if(e.stores===void 0)return;let b=!0,Z=()=>{if(!b||(P(),_.current===null))return;let j=A();if(t==="drawer")_.current.navigation&&s.current?.focus({preventScroll:!0});else if(_.current.navigation&&j!==null){let K=_.current.href;[...j.querySelectorAll("a[href]")].find(So=>So.getAttribute("href")===K)?.focus({preventScroll:!0})}else _.current.drawer&&l.current?.focus({preventScroll:!0});_.current=null};return v()?.isConnected?Z():queueMicrotask(Z),()=>{b=!1}},[t,e.stores]),g(R,{children:[g("div",{className:x("wg_navigation__sidebar",e.stores!==void 0&&"wg_navigation__sidebar--navigationReady"),children:[g("div",{className:x("wg_navigation__brandRow"),children:[g("a",{ref:e.stores===void 0?void 0:l,className:x("wg_navigation__brand"),href:"/","aria-current":e.data.home?"page":void 0,children:e.data.title}),g("button",{ref:e.stores===void 0?void 0:s,className:x("wg_navigation__menuToggle",e.stores!==void 0&&t==="drawer"&&"wg_navigation__menuToggle--visible"),type:"button","aria-label":fo,"aria-controls":"fh-navigation-drawer","aria-expanded":String(r),"data-navigation-open":"",onClick:Q,children:g("svg",{className:x("wg_navigation__menuIcon"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:g("path",{d:"M4 6h16M4 12h16M4 18h16"})})})]}),t!=="drawer"&&g("div",{ref:e.stores===void 0?void 0:i,className:x("wg_navigation__navigation"),"data-navigation":"",children:g(vt,{portRef:a,kind:"documents",ready:e.stores!==void 0,onScroll:y,onClick:Ge,children:g(mn,{groups:e.data.groups})})})]}),g("aside",{className:x("wg_navigation__tocRail"),"data-navigation-rail":"",children:g("div",{className:x("wg_navigation__outline"),"data-navigation-outline":"",children:g(vt,{portRef:u,kind:"outline",ready:e.stores!==void 0,onScroll:y,onClick:Ge,children:e.data.outline.length>0&&g(ho,{groups:e.data.outline})})})}),g("dialog",{ref:e.stores===void 0?void 0:p,className:x("wg_navigation__drawer"),id:"fh-navigation-drawer","aria-labelledby":"fh-navigation-title","data-navigation-drawer":"",onClose:L,onCancel:V,onClick:We,children:[g("div",{className:x("wg_navigation__drawerHeader"),children:[g("h2",{className:x("wg_navigation__drawerTitle"),id:"fh-navigation-title",children:mo}),g("button",{className:x("wg_navigation__drawerClose"),type:"button","aria-label":po,"data-navigation-close":"",onClick:ze,children:g("svg",{className:x("wg_navigation__menuIcon"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:g("path",{d:"m6 6 12 12M18 6 6 18"})})})]}),g("div",{className:x("wg_navigation__drawerContent"),"data-navigation-content":"",children:t==="drawer"&&g("div",{ref:e.stores===void 0?void 0:c,className:x("wg_navigation__navigation"),"data-navigation":"",children:g(vt,{portRef:f,kind:"documents",ready:e.stores!==void 0,onScroll:y,onClick:Ge,children:g(mn,{groups:e.data.groups})})})})]})]})};var vo=e=>{let t=E(null),n=E(0),r=E(null),o=E(null),i=E(null),a=()=>{clearTimeout(n.current),n.current=0,r.current?.abort(),r.current=null,t.current?.classList.remove("wg_prose__headingText--highlighted"),t.current=null},c=m=>{m.target===document&&(clearTimeout(n.current),r.current?.abort(),r.current=null,n.current=window.setTimeout(a,3e3))},f=m=>{a(),t.current=m===null?null:m.querySelector(".wg_prose__headingText"),t.current!==null&&(t.current.classList.add("wg_prose__headingText--highlighted"),n.current=window.setTimeout(a,3e3),r.current=new AbortController,document.addEventListener("scrollend",c,{signal:r.current.signal}))},u=m=>{if(m.defaultPrevented||m.button!==0||m.metaKey||m.ctrlKey||m.shiftKey||m.altKey)return;let h=m.target instanceof Element?m.target.closest("a[href]"):null;if(h instanceof HTMLAnchorElement&&(h.target===""||h.target==="_self")&&!h.hasAttribute("download")&&h.origin===location.origin&&h.pathname===location.pathname&&h.search===location.search&&h.hash){let _=ge(h.hash);h.hash===location.hash&&f(_)}},p=()=>{let m=ge(location.hash);m?.scrollIntoView(),f(m)},s=()=>{i.current?.abort()},l=async()=>{let m=o.current,h=location.hash,_=ge(h);await document.fonts.ready,!(m===null||m.signal.aborted)&&(_!==null&&!i.current?.signal.aborted&&h===location.hash&&(_.scrollIntoView({behavior:"instant"}),f(_)),document.documentElement.style.removeProperty("scroll-behavior"))},d=()=>{ge(location.hash),document.readyState==="complete"&&l()};return I(()=>{let m=new AbortController;o.current=m,i.current=new AbortController,document.documentElement.style.scrollBehavior="auto",document.addEventListener("click",u,{signal:m.signal}),addEventListener("hashchange",p,{signal:m.signal}),addEventListener("load",l,{once:!0,signal:m.signal});for(let h of["wheel","touchmove","keydown","mousedown"])addEventListener(h,s,{once:!0,passive:!0,signal:m.signal});return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",d,{once:!0,signal:m.signal}):d(),()=>{m.abort(),o.current=null,i.current?.abort(),i.current=null,a(),document.documentElement.style.removeProperty("scroll-behavior")}},[]),nt(()=>{if(!e.reload||o.current===null)return;let m=new EventSource(io);return m.onmessage=()=>location.reload(),()=>m.close()},[e.reload]),g(R,{children:[g("div",{className:x("wg_shellControls__navigation"),children:g(go,{data:e.data,stores:e.stores})}),e.data.cursorFace&&g(ao,{ready:e.stores!==void 0})]})};function _n(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;let a=f=>f===null?null:JSON.parse(f,t?.reviver),c=(i=n.getItem(o))!=null?i:null;return c instanceof Promise?c.then(a):a(c)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t?.replacer)),removeItem:o=>n.removeItem(o)}}var gn=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(r){return gn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return gn(r)(n)}}}},us=(e,t)=>(n,r,o)=>{let i={storage:_n(()=>window.localStorage),partialize:_=>_,version:0,merge:(_,z)=>({...z,..._}),...t},a=!1,c=0,f=new Set,u=new Set,p=i.storage;if(!p)return e((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(..._)},r,o);let s=()=>{let _=i.partialize({...r()});return p.setItem(i.name,{state:_,version:i.version})},l=o.setState;o.setState=(_,z)=>(l(_,z),s());let d=e((..._)=>(n(..._),s()),r,o);o.getInitialState=()=>d;let m,h=()=>{var _,z;if(!p)return;let w=++c;a=!1,f.forEach(v=>{var $;return v(($=r())!=null?$:d)});let A=((z=i.onRehydrateStorage)==null?void 0:z.call(i,(_=r())!=null?_:d))||void 0;return gn(p.getItem.bind(p))(i.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==i.version){if(i.migrate){let $=i.migrate(v.state,v.version);return $ instanceof Promise?$.then(y=>[!0,y]):[!0,$]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var $;if(w!==c)return;let[y,P]=v;if(m=i.merge(P,($=r())!=null?$:d),n(m,!0),y)return s()}).then(()=>{w===c&&(A?.(r(),void 0),m=r(),a=!0,u.forEach(v=>v(m)))}).catch(v=>{w===c&&A?.(void 0,v)})};return o.persist={setOptions:_=>{i={...i,..._},_.storage&&(p=_.storage)},clearStorage:()=>{++c,p?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:_=>(f.add(_),()=>{f.delete(_)}),onFinishHydration:_=>(u.add(_),()=>{u.delete(_)})},i.skipHydration||h(),m||d},yo=us;var xo=e=>{let t,n=new Set,r=(u,p)=>{let s=typeof u=="function"?u(t):u;if(!Object.is(s,t)){let l=t;t=p??(typeof s!="object"||s===null)?s:Object.assign({},t,s),n.forEach(d=>d(t,l))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>f,subscribe:u=>(n.add(u),()=>n.delete(u))},f=t=e(r,o,c);return c},bo=(e=>e?xo(e):xo);var wo=e=>{let t=n=>({getItem:r=>n().getItem(r),setItem:(r,o)=>{try{return n().setItem(r,o)}catch{}},removeItem:r=>{try{return n().removeItem(r)}catch{}}});return{scroll:bo()(yo(()=>({positions:{}}),{name:xt,version:1,storage:_n(()=>t(e.session)),merge:n=>bt(n),migrate:()=>({positions:{}})}))}};var vn=document.querySelector("[data-shell-browser-root]"),$o=document.getElementById("fh-navigation-data");if(vn!==null&&$o!==null)try{let e=JSON.parse($o.textContent),t=Fr.parse(e),n=wo({session:()=>sessionStorage});Jn(vn).render(g(vo,{data:t,stores:n,reload:vn.hasAttribute("data-shell-reload")}))}catch(e){console.error("for-humanity browser initialization failed",e)}})();
37
+ )`,e.classList.add(`wg_cursorFace__root--visible`))}))},s=e=>{!n.current?.matches||e.pointerType!==`mouse`?(r.current.hasPointer=!1,i()):(r.current.x=e.clientX,r.current.y=e.clientY,r.current.hasPointer=!0,o())},c=()=>{t.current?.classList.contains(`wg_cursorFace__root--visible`)&&o()},l=()=>{if(r.current.hasPointer)try{sessionStorage.setItem(xi,JSON.stringify({x:r.current.x,y:r.current.y}))}catch{}},u=()=>{try{let e=sessionStorage.getItem(xi);if(sessionStorage.removeItem(xi),e===null||!n.current?.matches)return;let t=JSON.parse(e);typeof t==`object`&&t&&`x`in t&&`y`in t&&typeof t.x==`number`&&typeof t.y==`number`&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&(r.current.x=t.x,r.current.y=t.y,r.current.hasPointer=!0,o())}catch{}};return j(()=>{if(!e.ready)return;let t=new AbortController,r=matchMedia(`(hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference)`);return n.current=r,u(),document.addEventListener(`pointermove`,s,{passive:!0,signal:t.signal}),document.addEventListener(`pointerdown`,s,{passive:!0,signal:t.signal}),document.documentElement.addEventListener(`pointerleave`,i,{signal:t.signal}),addEventListener(`blur`,i,{signal:t.signal}),addEventListener(`resize`,c,{signal:t.signal}),addEventListener(`pagehide`,l,{signal:t.signal}),addEventListener(`pageshow`,u,{signal:t.signal}),r.addEventListener(`change`,a,{signal:t.signal}),()=>{t.abort(),n.current=null,i()}},[e.ready]),$(`img`,{ref:e.ready?t:void 0,className:Q(`wg_cursorFace__root`),src:Si,width:24,height:24,alt:``,"aria-hidden":`true`,draggable:!1,"data-cursor-face":``})},wi=`다이어그램을 불러오지 못했습니다. 원문을 확인해 주세요.`,Ti=`다이어그램을 그리지 못했습니다. 원문을 확인해 주세요.`,Ei=5e4,Di={startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,maxTextSize:Ei},Oi={...Di,theme:`redux-dark-color`,themeVariables:{treeView:{labelColor:`currentColor`,lineColor:`currentColor`}}},ki=e=>{let t={requested:0,completed:0,running:!1};return async()=>{if(t.requested+=1,!t.running){t.running=!0;try{for(;t.completed!==t.requested;){let n=t.requested;try{await e.run()}catch(t){e.onError(t)}finally{t.completed=n}}}finally{t.running=!1}}}},Ai=e=>(gt(()=>{let t=new AbortController,n=matchMedia(`(prefers-color-scheme: dark)`),r=new Set,i=new Set,a=new Set,o=e=>{if(e.target instanceof Element&&e.target.closest(`[title]`)!==null)for(let e of a){e.hidden=!1;let t=e.getBoundingClientRect();e.style.left=`${scrollX+Math.max(0,Math.min(t.left,document.documentElement.clientWidth-t.width))}px`}},s=()=>{for(let e of a)e.hidden=!0},c=ki({run:async()=>{let c=[...document.querySelectorAll(`.wg_mermaid__root[data-mermaid]`)],l=c[0]?.dataset.mermaidModule;if(l===void 0||t.signal.aborted)return;let u=n.matches?`dark`:`light`,d=c.filter(e=>e.checkVisibility({visibilityProperty:!0})&&e.dataset.mermaidTheme!==u);if(d.length===0)return;let f=await import(l);if(await document.fonts.ready,!t.signal.aborted){for(let e of d){if(t.signal.aborted||!e.isConnected||n.matches!==(u===`dark`))return;let c=e.querySelector(`.wg_mermaid__source`),l=e.querySelector(`.wg_mermaid__result`),d=e.querySelector(`.wg_mermaid__error`);if(c===null||l===null||d===null)continue;let p=document.createElement(`div`);p.className=`wg_mermaid__measurement`,r.add(p),document.body.append(p);try{if(c.textContent.length>5e4)throw Error(`Mermaid source exceeds ${Ei} characters`);f.default.initialize(u===`dark`?Oi:Di);let r=await f.default.render(`fh-mermaid-${crypto.getRandomValues(new Uint32Array(4)).join(`-`)}`,c.textContent,p);if(t.signal.aborted||!e.isConnected||n.matches!==(u===`dark`))return;let i=l.shadowRoot??l.attachShadow({mode:`open`}),m=document.createElement(`div`);m.innerHTML=r.svg,i.replaceChildren(m),r.bindFunctions?.(m),m.addEventListener(`mouseover`,o,{signal:t.signal}),m.addEventListener(`mouseout`,s,{signal:t.signal});let h=document.querySelector(`.mermaidTooltip`);h!==null&&(h.classList.add(`wg_mermaid__tooltip`),a.add(h)),l.hidden=!1,c.hidden=!0,d.hidden=!0,e.dataset.mermaidStatus=`rendered`}catch(n){if(t.signal.aborted)return;l.hidden=!0,c.hidden=!1,d.textContent=Ti,d.hidden=!1,e.dataset.mermaidStatus=`error`,console.error(`for-humanity Mermaid rendering failed`,n)}finally{p.remove(),r.delete(p)}e.dataset.mermaidTheme=u,i.add(e)}e.onRendered?.()}},onError:e=>{if(!t.signal.aborted){for(let e of document.querySelectorAll(`.wg_mermaid__root[data-mermaid]`)){let t=e.querySelector(`.wg_mermaid__error`);t!==null&&(i.add(e),t.textContent=wi,t.hidden=!1)}console.error(`for-humanity Mermaid loading failed`,e)}}}),l=()=>{s(),c()};return n.addEventListener(`change`,l,{signal:t.signal}),addEventListener(`resize`,s,{signal:t.signal}),document.addEventListener(`toggle`,l,{capture:!0,signal:t.signal}),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,l,{once:!0,signal:t.signal}):l(),()=>{t.abort();for(let e of r)e.remove();r.clear();for(let e of a)e.remove();a.clear();for(let e of i){let t=e.querySelector(`.wg_mermaid__source`),n=e.querySelector(`.wg_mermaid__result`),r=e.querySelector(`.wg_mermaid__error`);n?.shadowRoot?.replaceChildren(),n!==null&&(n.hidden=!0),t!==null&&(t.hidden=!1),r!==null&&(r.hidden=!0),delete e.dataset.mermaidTheme,delete e.dataset.mermaidStatus}i.clear()}},[e.onRendered]),null),ji=`(width < 1024px)`,Mi=`(width >= 1360px)`,Ni=e=>{let t=[...e.group.docs.map(e=>({kind:`document`,key:`doc:${e.id}`,doc:e})),...e.group.groups.map(e=>({kind:`group`,key:`group:${JSON.stringify(e.path)}`,group:e}))];return $(`ul`,{className:Q(`wg_navigationNavList__root`),"aria-label":e.group.name,children:t.map(t=>$(`li`,{className:Q(`wg_navigationNavList__item`),children:[t.kind===`document`&&$(D,{children:[$(`a`,{className:Q(`wg_navigationNavList__link`,{"wg_navigationNavList__link--active":t.doc.active}),href:`/${t.doc.id}/`,title:t.doc.label,"aria-current":t.doc.active?`page`:void 0,children:t.doc.name}),t.doc.children.length>0&&$(Ni,{group:{name:t.doc.name,path:e.group.path,docs:t.doc.children,groups:[]}})]}),t.kind===`group`&&$(D,{children:[$(`span`,{className:Q(`wg_navigationNavList__branch`),children:t.group.name}),$(Ni,{group:t.group})]})]},t.key))})},Pi=`Document navigation`,Fi=`Open navigation`,Ii=`Close navigation`,Li=`Navigation`,Ri=`On this page`,zi=e=>$(`nav`,{className:Q(`wg_navigationNav__root`),"aria-label":Pi,children:$(`div`,{className:Q(`wg_navigationNav__docs`),children:e.groups.map(e=>$(`section`,{className:Q(`wg_navigationNav__docGroup`),"aria-label":e.name,children:[$(`div`,{className:Q(`wg_navigationNav__group`),children:e.name}),$(Ni,{group:e})]},JSON.stringify(e.path)))})}),Bi=e=>{let[t,n]=A({above:!1,below:!1}),r=M(0),i=()=>{if(r.current=0,e.portRef.current===null)return;let t=e.portRef.current.scrollTop>1,i=e.portRef.current.scrollHeight-e.portRef.current.clientHeight-e.portRef.current.scrollTop>1;n(e=>e.above===t&&e.below===i?e:{above:t,below:i})},a=()=>{r.current===0&&(r.current=requestAnimationFrame(i))};return j(()=>{if(!e.ready||e.portRef.current===null)return;let t=new ResizeObserver(a);t.observe(e.portRef.current),e.portRef.current.firstElementChild!==null&&t.observe(e.portRef.current.firstElementChild);let n=!0;return addEventListener(`pageshow`,a),e.portRef.current.isConnected?i():queueMicrotask(()=>{n&&i()}),()=>{n=!1,t.disconnect(),removeEventListener(`pageshow`,a),cancelAnimationFrame(r.current),r.current=0}},[e.portRef,e.ready]),j(()=>{e.ready&&e.portRef.current?.isConnected&&i()},[e.children,e.ready]),$(`div`,{ref:e.ready?e.portRef:void 0,className:Q(`wg_navigation__scroll`,e.kind===`documents`&&`wg_navigation__documents`,e.kind===`outline`&&`wg_navigation__headings`,e.ready&&`wg_navigation__scroll--ready`,e.ready&&t.above&&`wg_navigation__scroll--above`,e.ready&&t.below&&`wg_navigation__scroll--below`),"data-navigation-scroll":e.kind,onClick:e.onClick,onScroll:t=>{e.onScroll?.(),a()},children:e.children})},Vi=e=>{if(!e)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch(e){if(e instanceof URIError)return null;throw e}},Hi=e=>{let[t,n]=A();return j(()=>{let t=e.groups.flatMap(e=>e.sections).flatMap(e=>[e.heading,...e.subs.map(e=>e.heading)]),r={id:0},i=()=>{r.id=0;let e=t.flatMap(e=>{let t=Vi(`#${e.slug}`);return t?.checkVisibility()?[{slug:e.slug,top:t.getBoundingClientRect().top-Number.parseFloat(getComputedStyle(t).scrollMarginTop)}]:[]});n(e.findLast(e=>e.top<=1)?.slug??e[0]?.slug)},a=()=>{r.id===0&&(r.id=requestAnimationFrame(i))};return addEventListener(`scroll`,a,{passive:!0}),addEventListener(`resize`,a),addEventListener(`toggle`,a,!0),addEventListener(`pageshow`,a),document.addEventListener(`DOMContentLoaded`,a),document.readyState!==`loading`&&i(),()=>{cancelAnimationFrame(r.id),removeEventListener(`scroll`,a),removeEventListener(`resize`,a),removeEventListener(`toggle`,a,!0),removeEventListener(`pageshow`,a),document.removeEventListener(`DOMContentLoaded`,a)}},[e.groups]),$(`nav`,{className:Q(`wg_navigationToc__root`),"aria-label":Ri,children:[$(`div`,{className:Q(`wg_navigationToc__label`),children:Ri}),e.groups.map(e=>$(`div`,{className:Q(`wg_navigationToc__groupSection`,{"wg_navigationToc__groupSection--named":e.part!==void 0}),children:[e.part!==void 0&&$(`div`,{className:Q(`wg_navigationToc__group`),children:e.part}),$(`ul`,{className:Q(`wg_navigationToc__list`),children:e.sections.map(e=>$(`li`,{className:Q(`wg_navigationToc__item`),children:[$(`a`,{className:Q(`wg_navigationToc__link`,{"wg_navigationToc__link--active":e.heading.slug===t}),href:`#${e.heading.slug}`,"data-toc-link":``,"aria-current":e.heading.slug===t?`location`:void 0,children:e.heading.text}),e.subs.length>0&&$(`ul`,{className:Q(`wg_navigationToc__sub`),children:e.subs.map(e=>$(`li`,{className:Q(`wg_navigationToc__subItem`),children:$(`a`,{className:Q(`wg_navigationToc__subLink`,{"wg_navigationToc__subLink--active":e.heading.slug===t}),href:`#${e.heading.slug}`,"data-toc-sub-link":``,"aria-current":e.heading.slug===t?`location`:void 0,children:e.heading.text})},e.heading.slug))})]},e.heading.slug))})]},e.sections[0].heading.slug))]})},Ui=e=>{let t=Vi(e);for(let e=t?.closest(`details`);e;e=e.parentElement?.closest(`details`))e.open=!0;return t},Wi=e=>{let[t,n]=A(()=>e.stores===void 0?`desktop`:matchMedia(`(width < 1024px)`).matches?`drawer`:matchMedia(`(width >= 1360px)`).matches?`wide`:`desktop`),[r,i]=A(!1),a=M(null),o=M(null),s=M(null),c=M(null),l=M(null),u=M(null),d=M(null),f=M(null),p=M(null),m=M(null),h=M(t),g=M(null),_=M(!0),ee=JSON.stringify(e.data.groups,(e,t)=>e===`active`?void 0:t),v=()=>p.current===null||m.current===null?h.current:p.current.matches?`drawer`:m.current.matches?`wide`:`desktop`,te=()=>h.current===`drawer`?s.current:a.current,y=()=>h.current===`drawer`?c.current:o.current,b=()=>{let t=y(),n=l.current;e.stores===void 0||t===null||n===null||_.current||h.current!==v()||h.current===`drawer`&&u.current?.open!==!0||e.stores.scroll.setState(e=>({positions:{...e.positions,[h.current]:{navigation:ee,pathname:location.pathname,documents:t.scrollTop,outline:n.scrollTop}}}))},ne=()=>{h.current=v();let t=y();if(e.stores===void 0||t===null||l.current===null||h.current===`drawer`&&u.current?.open!==!0)return;let n=e.stores.scroll.getState().positions[h.current];n?.navigation===ee?(t.scrollTop=n.documents,l.current.scrollTop=n.pathname===location.pathname?n.outline:0):(t.scrollTop=0,l.current.scrollTop=0),_.current=!1,b(),t.dispatchEvent(new Event(`scroll`)),l.current.dispatchEvent(new Event(`scroll`))},re=e=>{u.current?.open!==!0&&(document.body.classList.remove(`wg_shell__root--drawerOpen`),i(!1))},x=()=>{b(),u.current?.close(),document.body.classList.remove(`wg_shell__root--drawerOpen`),i(!1)},S=e=>{v()!==`drawer`||u.current===null||u.current.open||(u.current.showModal(),document.body.classList.add(`wg_shell__root--drawerOpen`),i(!0),ne())},ie=e=>{x()},ae=e=>{e.preventDefault(),x()},oe=e=>{if(u.current===null||e.target!==u.current)return;let t=u.current.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&x()},se=e=>{if(b(),u.current?.open!==!0||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||!(e.target instanceof Element))return;let t=e.target.closest(`a[href]`);if(!(!(t instanceof HTMLAnchorElement)||t.target!==``&&t.target!==`_self`||t.hasAttribute(`download`))&&(x(),t.origin===location.origin&&t.pathname===location.pathname&&t.search===location.search&&t.hash)){let e=Ui(t.hash);e!==null&&(e.tabIndex=-1,e.focus({preventScroll:!0}))}},C=()=>{let e=v();e!==h.current&&(document.activeElement instanceof HTMLElement&&(g.current={navigation:document.activeElement.closest(`[data-navigation]`)!==null,drawer:document.activeElement===d.current||document.activeElement.closest(`[data-navigation-drawer]`)!==null,href:document.activeElement.getAttribute(`href`)}),e!==`drawer`&&x(),_.current=!0,h.current=e,Jt(()=>n(e)))},ce=t=>{t.persisted&&e.stores!==void 0&&(_.current=!0,e.stores.scroll.persist.rehydrate(),C(),ne())};return j(()=>{if(e.stores!==void 0)return p.current=matchMedia(ji),m.current=matchMedia(Mi),p.current.addEventListener(`change`,C),m.current.addEventListener(`change`,C),addEventListener(`pagehide`,b),addEventListener(`pageshow`,ce),()=>{p.current?.removeEventListener(`change`,C),m.current?.removeEventListener(`change`,C),p.current=null,m.current=null,removeEventListener(`pagehide`,b),removeEventListener(`pageshow`,ce),document.body.classList.remove(`wg_shell__root--drawerOpen`)}},[e.stores]),j(()=>{if(e.stores===void 0)return;let n=!0,r=()=>{if(!n||(ne(),g.current===null))return;let e=te();if(t===`drawer`)g.current.navigation&&d.current?.focus({preventScroll:!0});else if(g.current.navigation&&e!==null){let t=g.current.href;[...e.querySelectorAll(`a[href]`)].find(e=>e.getAttribute(`href`)===t)?.focus({preventScroll:!0})}else g.current.drawer&&f.current?.focus({preventScroll:!0});g.current=null};return y()?.isConnected?r():queueMicrotask(r),()=>{n=!1}},[t,e.stores]),$(D,{children:[$(`div`,{className:Q(`wg_navigation__sidebar`,e.stores!==void 0&&`wg_navigation__sidebar--navigationReady`),children:[$(`div`,{className:Q(`wg_navigation__brandRow`),children:[$(`a`,{ref:e.stores===void 0?void 0:f,className:Q(`wg_navigation__brand`),href:`/`,"aria-current":e.data.home?`page`:void 0,children:e.data.title}),$(`button`,{ref:e.stores===void 0?void 0:d,className:Q(`wg_navigation__menuToggle`,e.stores!==void 0&&t===`drawer`&&`wg_navigation__menuToggle--visible`),type:`button`,"aria-label":Fi,"aria-controls":`fh-navigation-drawer`,"aria-expanded":String(r),"data-navigation-open":``,onClick:S,children:$(`svg`,{className:Q(`wg_navigation__menuIcon`),viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:$(`path`,{d:`M4 6h16M4 12h16M4 18h16`})})})]}),t!==`drawer`&&$(`div`,{ref:e.stores===void 0?void 0:a,className:Q(`wg_navigation__navigation`),"data-navigation":``,"data-navigation-layout":t,children:$(Bi,{portRef:o,kind:`documents`,ready:e.stores!==void 0,onScroll:b,onClick:se,children:$(zi,{groups:e.data.groups})})})]}),$(`aside`,{className:Q(`wg_navigation__tocRail`),"data-navigation-rail":``,children:$(`div`,{className:Q(`wg_navigation__outline`),"data-navigation-outline":``,children:$(Bi,{portRef:l,kind:`outline`,ready:e.stores!==void 0,onScroll:b,onClick:se,children:e.data.outline.length>0&&$(Hi,{groups:e.data.outline})})})}),$(`dialog`,{ref:e.stores===void 0?void 0:u,className:Q(`wg_navigation__drawer`),id:`fh-navigation-drawer`,"aria-labelledby":`fh-navigation-title`,"data-navigation-drawer":``,onClose:re,onCancel:ae,onClick:oe,children:[$(`div`,{className:Q(`wg_navigation__drawerHeader`),children:[$(`h2`,{className:Q(`wg_navigation__drawerTitle`),id:`fh-navigation-title`,children:Li}),$(`button`,{className:Q(`wg_navigation__drawerClose`),type:`button`,"aria-label":Ii,"data-navigation-close":``,onClick:ie,children:$(`svg`,{className:Q(`wg_navigation__menuIcon`),viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:$(`path`,{d:`m6 6 12 12M18 6 6 18`})})})]}),$(`div`,{className:Q(`wg_navigation__drawerContent`),"data-navigation-content":``,children:t===`drawer`&&$(`div`,{ref:e.stores===void 0?void 0:s,className:Q(`wg_navigation__navigation`),"data-navigation":``,"data-navigation-layout":t,children:$(Bi,{portRef:c,kind:`documents`,ready:e.stores!==void 0,onScroll:b,onClick:se,children:$(zi,{groups:e.data.groups})})})})]})]})},Gi=3e3,Ki=e=>{let t=M(null),n=M(0),r=M(null),i=M(null),a=M(null),o=()=>{clearTimeout(n.current),n.current=0,r.current?.abort(),r.current=null,t.current?.classList.remove(`wg_prose__headingText--highlighted`),t.current=null},s=e=>{e.target===document&&(clearTimeout(n.current),r.current?.abort(),r.current=null,n.current=window.setTimeout(o,Gi))},c=e=>{o(),t.current=e===null?null:e.querySelector(`.wg_prose__headingText`),t.current!==null&&(t.current.classList.add(`wg_prose__headingText--highlighted`),n.current=window.setTimeout(o,Gi),r.current=new AbortController,document.addEventListener(`scrollend`,s,{signal:r.current.signal}))},l=e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target instanceof Element?e.target.closest(`a[href]`):null;if(t instanceof HTMLAnchorElement&&(t.target===``||t.target===`_self`)&&!t.hasAttribute(`download`)&&t.origin===location.origin&&t.pathname===location.pathname&&t.search===location.search&&t.hash){let e=Ui(t.hash);t.hash===location.hash&&c(e)}},u=()=>{let e=Ui(location.hash);e?.scrollIntoView(),c(e)},d=()=>{a.current?.abort()},f=async()=>{let e=i.current,t=location.hash,n=Ui(t);await document.fonts.ready,!(e===null||e.signal.aborted)&&(n!==null&&!a.current?.signal.aborted&&t===location.hash&&(n.scrollIntoView({behavior:`instant`}),c(n)),document.documentElement.style.removeProperty(`scroll-behavior`))},p=()=>{Ui(location.hash),document.readyState===`complete`&&f()};return j(()=>{let e=new AbortController;i.current=e,a.current=new AbortController,document.documentElement.style.scrollBehavior=`auto`,document.addEventListener(`click`,l,{signal:e.signal}),addEventListener(`hashchange`,u,{signal:e.signal}),addEventListener(`load`,f,{once:!0,signal:e.signal});for(let t of[`wheel`,`touchmove`,`keydown`,`mousedown`])addEventListener(t,d,{once:!0,passive:!0,signal:e.signal});return document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,p,{once:!0,signal:e.signal}):p(),()=>{e.abort(),i.current=null,a.current?.abort(),a.current=null,o(),document.documentElement.style.removeProperty(`scroll-behavior`)}},[]),$(D,{children:[$(`div`,{className:Q(`wg_shellControls__navigation`),children:$(Wi,{data:e.data,stores:e.stores})}),e.data.cursorFace&&$(Ci,{ready:e.stores!==void 0}),$(Ai,{onRendered:f})]})};function qi(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var Ji=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return Ji(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return Ji(t)(e)}}}},Yi=(e,t)=>(n,r,i)=>{let a={storage:qi(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return Ji(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},Xi=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Zi=(e=>e?Xi(e):Xi),Qi=Z({positions:Nr(Fr([`wide`,`desktop`,`drawer`]),Z({navigation:Y(),pathname:Y(),documents:Dr().check(Cr(0)),outline:Dr().check(Cr(0))}))}),$i=`for-humanity:navigation-scroll`,ea=e=>{let t=qi(()=>({getItem:t=>e.session().getItem(t),setItem:(t,n)=>{try{return e.session().setItem(t,n)}catch{}},removeItem:t=>{try{return e.session().removeItem(t)}catch{}}}));return{scroll:Zi()(Yi(()=>({positions:{}}),{name:$i,version:1,storage:t,merge:(e,t)=>{let n=Qi.safeParse(e);return n.success?n.data:t}}))}},ta=document.querySelector(`[data-shell-browser-root]`),na=document.getElementById(`fh-navigation-data`);if(ta!==null&&na!==null)try{let e=JSON.parse(na.textContent),t=Ur.parse(e),n=ea({session:()=>sessionStorage});Xt(ta).render($(Ki,{data:t,stores:n}))}catch(e){console.error(`for-humanity browser initialization failed`,e)}})();