for-humanity 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.14.0 — 2026-10-19
6
+
7
+ **Breaking change:** Configuration now belongs in the project root. CLI paths identify a project, not a Markdown folder. Move published documents into `content/public`, local-only documents into `content/private`, and the site home into `content/README.md`; use `content.root`, `content.public` and `content.private` to customize these paths. Existing flat document folders are not automatically published. See the [migration guide](https://for-humanity.fyi/migration/). Node.js 22.12.0 or later is still required.
8
+
9
+ - Focus public documentation on installation, configuration, authoring and deployment. Keep internal plans, release operations, development history and fictional project studies in local-only content.
10
+ - Show both document collections in `dev`; build and preview only the public site in `content/dist`.
11
+ - Preserve public document URLs and reserve `/private/` for local internal pages. Exclude internal pages, navigation data, sitemap entries and their assets from public builds.
12
+ - Reject public references to internal Markdown, images and snippets, including raw HTML and symlink targets.
13
+ - Move this repository's documentation to `content` and its configuration to the project root.
14
+ - Include a reusable `template/` starter with public/private folders and document migration from flat Markdown projects.
15
+ - Reject content-root symlinks into build output, Git metadata and installed dependencies.
16
+
17
+ ## 0.13.1 — 2026-10-16
18
+
19
+ **Upgrade:** CLI commands, configuration and Node.js requirements remain unchanged. Navigation scroll positions saved by older versions may reset once after upgrading.
20
+
21
+ **Known issue:** The previously recorded intermittent Windows cursor check (`NAV-010`) remains deferred. See [Maintenance](https://for-humanity.fyi/maintenance/#known-windows-check-issue).
22
+
23
+ - Let Zustand persist own navigation scroll storage and hydration; remove direct storage reads, legacy layout-key compatibility and duplicate restoration helpers.
24
+ - 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.
25
+ - 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.
26
+
5
27
  ## 0.13.0 — 2026-10-16
6
28
 
7
29
  **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.
package/README.md CHANGED
@@ -13,122 +13,97 @@ Write Markdown. Keep the context. Share a static site.
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
15
  ![Node 22.12.0+](https://img.shields.io/badge/node-22.12.0%2B-444444?style=flat-square)
16
- ![Hono JSX](https://img.shields.io/badge/Hono-JSX-444444?style=flat-square)
17
16
  ![Prototype](https://img.shields.io/badge/status-prototype-9a6400?style=flat-square)
18
17
 
19
- [Quick start](#quick-start) · [Guide](https://github.com/minu-ha/for-humanity/blob/main/templates/document/writing.md) · [API](https://github.com/minu-ha/for-humanity/blob/main/templates/document/api.md) · [Deployment](https://github.com/minu-ha/for-humanity/blob/main/templates/document/deployment.md) · [Korean](https://github.com/minu-ha/for-humanity/blob/main/language/README.ko.md)
18
+ [Quick start](#quick-start) · [Guide](https://github.com/minu-ha/for-humanity/blob/main/content/public/writing.md) · [Reference](https://github.com/minu-ha/for-humanity/blob/main/content/public/api.md) · [Deployment](https://github.com/minu-ha/for-humanity/blob/main/content/public/deployment.md) · [Korean](https://github.com/minu-ha/for-humanity/blob/main/language/README.ko.md)
20
19
 
21
20
  </div>
22
21
 
23
- ## A little structure. Room to read.
22
+ ## Write, organize, publish
24
23
 
25
- - **Find your place.** Pages grouped by purpose, a reading order, a tree of contents and the current reading position.
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, official Mermaid diagrams including flowcharts, sequences and directory trees, status badges and color swatches.
28
- - **Share the result.** Static HTML, self-hosted fonts and a small browser script. Browser interactions stay separate from Markdown rendering.
29
- - **Read your way.** System-matched light and dark themes, keyboard navigation and a layout for narrow screens.
24
+ Write Markdown with code examples, tables, images and Mermaid diagrams. Organize pages into groups and nested navigation. Use notes for context and collapsible details for longer explanations.
25
+
26
+ The result is a static site with bundled fonts, light and dark themes, keyboard navigation and a layout that adapts to narrow screens.
30
27
 
31
28
  ## Quick start
32
29
 
33
- Node.js 22.12.0 or later and pnpm. Install the CLI in your document project:
30
+ You need Node.js 22.12.0 or later and pnpm. In a project with a `package.json`, install the package:
34
31
 
35
32
  ```sh
36
- pnpm add -D --save-exact for-humanity@0.13.0
37
- mkdir docs
33
+ pnpm add -D --save-exact for-humanity@0.14.0
38
34
  ```
39
35
 
40
- Create `docs/README.md` for the home page, then start the development server:
36
+ Copy `for-humanity.config.ts` and the `content` folder from `node_modules/for-humanity/template` into your project. If you already have documentation, follow [Migration](https://github.com/minu-ha/for-humanity/blob/main/content/public/migration.md) before moving files.
41
37
 
42
- ```sh
43
- pnpm exec for-humanity dev docs
44
- ```
38
+ Edit `content/README.md` for your home page:
45
39
 
46
- Open [localhost:4321](http://localhost:4321). Build and preview your static site:
40
+ ```markdown
41
+ # Project notes
47
42
 
48
- ```sh
49
- pnpm exec for-humanity build docs # Generate docs/dist
50
- pnpm exec for-humanity preview docs
43
+ Welcome to the project documentation.
51
44
  ```
52
45
 
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
-
55
- Version `0.13.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).
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
- 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
-
59
- ### Develop the kit
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
-
63
- To work on the CLI or read this library's guides and examples locally, run the project from source:
46
+ Start the local server:
64
47
 
65
48
  ```sh
66
- git clone https://github.com/minu-ha/for-humanity.git
67
- cd for-humanity
68
- pnpm install
69
- pnpm dev
49
+ pnpm exec for-humanity dev
70
50
  ```
71
51
 
72
- Open [localhost:4321](http://localhost:4321) to read this library's usage guides, API reference and fictional examples.
52
+ Open [localhost:4321](http://localhost:4321). Edit the Markdown file and save to update the page. Follow [Commands](https://github.com/minu-ha/for-humanity/blob/main/content/public/commands.md) to add your first document.
53
+
54
+ Build and inspect the site before deployment:
73
55
 
74
56
  ```sh
75
- pnpm build # Generate templates/document/dist
76
- pnpm preview # Preview the static site
77
- pnpm build:pages # Add Cloudflare Pages headers and a 404 page
57
+ pnpm exec for-humanity build
58
+ pnpm exec for-humanity preview
78
59
  ```
79
60
 
80
- Changes pushed to `main` update the documentation site. A stable version tag such as `v0.13.0` runs checks, publishes the package to npm, then creates a GitHub Release with the same package file.
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.
61
+ Deploy the generated `content/dist` directory and add it to `.gitignore`. See [Deployment](https://github.com/minu-ha/for-humanity/blob/main/content/public/deployment.md) for hosting settings.
62
+
63
+ Keep published documents in `content/public` and local notes in `content/private`. The local server shows both; builds include only public documents and the home page. Folder names are configurable.
82
64
 
83
65
  ## Make it yours
84
66
 
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`.
86
- The folder's `README.md` becomes the home page at `/`, with no frontmatter required. Click the site name to return home.
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.
88
- Set your own name in `for-humanity.config.ts`, using the exported `SiteConfig` type for editor completion and static checking:
67
+ Set the site name and the order of navigation groups:
89
68
 
90
69
  ```ts
91
70
  import type {SiteConfig} from "for-humanity";
92
71
 
93
72
  export default {
94
73
  title: "Project notes",
95
- description: "Decisions, working notes and the details behind them.",
96
- navigation: ["Getting started", "Guide", "Reference", "Examples"],
74
+ description: "A guide to using the project.",
75
+ navigation: ["Getting started", "Guide", "Reference"],
97
76
  } satisfies SiteConfig;
98
77
  ```
99
78
 
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.
79
+ Save this as `for-humanity.config.ts` in the project root, alongside `package.json`. Existing `.mjs` configuration is also supported; keep only one configuration file.
102
80
 
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.
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.
105
- Use `group: Guide` for one group or `group: [Projects, Example project, Research]` for nested navigation. Group paths do not change document URLs.
106
- Use `parent: writing` to place a document below another document in the same group. File-relative references such as `parent: ./readme` also work. Parent pages remain clickable and each page keeps its own URL; see [Navigation](https://github.com/minu-ha/for-humanity/blob/main/templates/document/navigation.md).
81
+ Each document declares a title, description and navigation group in frontmatter. See [Writing](https://github.com/minu-ha/for-humanity/blob/main/content/public/writing.md) for a complete example and [Settings](https://github.com/minu-ha/for-humanity/blob/main/content/public/settings.md) for available options.
107
82
 
108
- ## Write with context
83
+ ## Keep useful detail
109
84
 
110
85
  ```markdown
111
- :::note[Scope]
112
- What this document covers and what still needs a decision.
86
+ :::note[Before you start]
87
+ Check the requirements before following the steps.
113
88
  :::
114
89
 
115
- :::details[Implementation]
116
- The contract, code or reasoning behind the visible result.
90
+ :::details[More information]
91
+ Add examples or explanations readers can open when needed.
117
92
  :::
118
93
  ```
119
94
 
120
- [Parts](https://github.com/minu-ha/for-humanity/blob/main/templates/document/parts.md) pairs source examples with their rendered results. The [Design example](https://github.com/minu-ha/for-humanity/blob/main/templates/document/blueprint.md) uses a fictional reading-list app to show a screen flow, decisions, open questions and illustrative API contracts.
95
+ [Parts](https://github.com/minu-ha/for-humanity/blob/main/content/public/parts.md) shows the syntax alongside its rendered output.
121
96
 
122
97
  ## Documentation
123
98
 
124
- | Group | Read |
125
- | ----- | ---- |
126
- | Getting started | [Commands](https://github.com/minu-ha/for-humanity/blob/main/templates/document/commands.md) · [Deployment](https://github.com/minu-ha/for-humanity/blob/main/templates/document/deployment.md) |
127
- | Guide | [Writing](https://github.com/minu-ha/for-humanity/blob/main/templates/document/writing.md) · [Parts](https://github.com/minu-ha/for-humanity/blob/main/templates/document/parts.md) · [Settings](https://github.com/minu-ha/for-humanity/blob/main/templates/document/settings.md) |
128
- | Reference | [API](https://github.com/minu-ha/for-humanity/blob/main/templates/document/api.md) |
129
- | Releases | [Official releases](https://github.com/minu-ha/for-humanity/blob/main/templates/document/releases.md) · [Changelog](https://github.com/minu-ha/for-humanity/blob/main/templates/document/changelog.md) |
130
- | Examples | [Fictional design example](https://github.com/minu-ha/for-humanity/blob/main/templates/document/blueprint.md) |
131
- | Development | [Architecture](https://github.com/minu-ha/for-humanity/blob/main/templates/document/architecture.md) · [Design](https://github.com/minu-ha/for-humanity/blob/main/templates/document/design.md) · [Maintenance](https://github.com/minu-ha/for-humanity/blob/main/templates/document/maintenance.md) · [Roadmap](https://github.com/minu-ha/for-humanity/blob/main/templates/document/roadmap.md) |
99
+ | Task | Guide |
100
+ | --- | --- |
101
+ | Install and run | [Commands](https://github.com/minu-ha/for-humanity/blob/main/content/public/commands.md) |
102
+ | Write and organize pages | [Writing](https://github.com/minu-ha/for-humanity/blob/main/content/public/writing.md) · [Navigation](https://github.com/minu-ha/for-humanity/blob/main/content/public/navigation.md) |
103
+ | Add rich content | [Parts](https://github.com/minu-ha/for-humanity/blob/main/content/public/parts.md) · [Diagrams](https://github.com/minu-ha/for-humanity/blob/main/content/public/diagrams.md) · [Images](https://github.com/minu-ha/for-humanity/blob/main/content/public/images.md) |
104
+ | Configure the site | [Settings](https://github.com/minu-ha/for-humanity/blob/main/content/public/settings.md) · [Reference](https://github.com/minu-ha/for-humanity/blob/main/content/public/api.md) |
105
+ | Publish | [Deployment](https://github.com/minu-ha/for-humanity/blob/main/content/public/deployment.md) · [Crawling](https://github.com/minu-ha/for-humanity/blob/main/content/public/crawling.md) |
106
+ | Update | [Releases](https://github.com/minu-ha/for-humanity/blob/main/content/public/releases.md) · [Migration](https://github.com/minu-ha/for-humanity/blob/main/content/public/migration.md) |
132
107
 
133
108
  ## License
134
109
 
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
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,v=(e,t)=>e===`link`?t:m[e].length>0,y=Object.defineProperty,b=(e,t)=>{let n={};for(var r in e)y(n,r,{get:e[r],enumerable:!0});return t||y(n,Symbol.toStringTag,{value:`Module`}),n},x=e=>Array.isArray(e)?e:[e],S=b({button:()=>ue,form:()=>se,input:()=>le,link:()=>ae,meta:()=>T,script:()=>re,style:()=>ie,title:()=>ne}),ee=new WeakMap,te=(e,t,n,r)=>({buffer:i,context:a})=>{if(!i)return;let o=ee.get(a)||{};ee.set(a,o);let s=o[e]||=[],c=!1,l=m[e],u=v(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(``))}},C=(e,t,n)=>k([new A(e,n,x(t??[]))]),w=(e,t,n,r)=>{if(`itemProp`in n)return C(e,t,n);let{precedence:i,blocking:a,...o}=n;i=r?i??``:void 0,r&&(o[g]=i);let s=new A(e,o,x(t||[])).toString();return s instanceof Promise?s.then(t=>c(t,[...t.callbacks||[],te(e,t,o,i)])):c(s,[te(e,s,o,i)])},ne=({children:e,...t})=>{let n=Oe();if(n){let r=N(n);if(r===`svg`||r===`head`)return new A(`title`,t,x(e??[]))}return w(`title`,e,t,!1)},re=({children:e,...t})=>{let n=Oe();return[`src`,`async`].some(e=>!t[e])||n&&N(n)===`head`?C(`script`,e,t):w(`script`,e,t,!1)},ie=({children:e,...t})=>[`href`,`precedence`].every(e=>e in t)?(t[`data-href`]=t.href,delete t.href,w(`style`,e,t,!0)):C(`style`,e,t),ae=({children:e,...t})=>[`onLoad`,`onError`].some(e=>e in t)||t.rel===`stylesheet`&&(!(`precedence`in t)||`disabled`in t)?C(`link`,e,t):w(`link`,e,t,_(t)),T=({children:e,...t})=>{let n=Oe();return n&&N(n)===`head`?C(`meta`,e,t):w(`meta`,e,t,!1)},oe=(e,{children:t,...n})=>new A(e,n,x(t??[])),se=e=>(typeof e.action==`function`&&(e.action=a in e.action?e.action[a]:void 0),oe(`form`,e)),ce=(e,t)=>(typeof t.formAction==`function`&&(t.formAction=a in t.formAction?t.formAction[a]:void 0),oe(e,t)),le=e=>ce(`input`,e),ue=e=>ce(`button`,e),de=new Map([[`className`,`class`],[`htmlFor`,`for`],[`crossOrigin`,`crossorigin`],[`httpEquiv`,`http-equiv`],[`itemProp`,`itemprop`],[`fetchPriority`,`fetchpriority`],[`noModule`,`nomodule`],[`formAction`,`formaction`]]),fe=e=>de.get(e)||e,pe=/[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,me=new Set,he=1024,ge=/^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,_e=new Set,ve=256,E=(e,t,n)=>{e.size>=t&&e.clear(),e.add(n)},ye=e=>_e.has(e)?!0:typeof e==`string`?e.length===0||!ge.test(e)&&(E(_e,ve,e),!0):!1,be=e=>{if(me.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!pe.test(e)&&(E(me,he,e),!0)}return E(me,he,e),!0},xe=/[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/,Se=new Set,Ce=1024,we=e=>{if(Se.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!xe.test(e)&&(E(Se,Ce,e),!0)}return E(Se,Ce,e),!0},Te=/[;"'\\/\[\](){}]/,Ee=e=>{if(!Te.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},De=(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(!we(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(Ee(r))continue;i=r}else continue;t(e,i)}},D=void 0,Oe=()=>D,ke=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,Ae=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],je=`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(`.`),Me=(e,t)=>e.then(e=>{if(typeof e!=`string`&&!Array.isArray(e)&&!(e instanceof A))return e;let n=Array.isArray(e)?e:[e],r=()=>{let e=[``];return O(n,e),e.length===1?c(e[0],e.callbacks):u(e,e.callbacks)};return t?t(r):Qe(r)}),O=(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 A)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):O(r,t)}},k=e=>Qe(()=>{let t=[``];return O(e,t),t.length===1?c(t[0],t.callbacks):u(t,t.callbacks)}),Ne=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof A)&&!(e instanceof Promise)&&!e.isEscaped&&typeof e.toString==`function`,Pe=e=>{let t=e.toString(),n=e=>k([String(e)]);return t instanceof Promise?t.then(n):n(t)},A=class{tag;props;key;children;isEscaped=!0;constructor(e,t,n){if(typeof e!=`function`&&!ye(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 Qe(()=>{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`||D&&N(D)===`svg`?e=>ke(fe(e)):e=>fe(e);for(let[a,o]of Object.entries(n))if(a=i(a),be(a)&&a!==`children`){if(a===`style`&&typeof o==`object`){let t=``;De(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`&&je.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]+=`"`}}Ae.includes(t)&&r.length===0?e[0]+=`/>`:(e[0]+=`>`,O(r,e),e[0]+=`</${t}>`)}},Fe=class extends A{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?M.length===0?e.unshift(``,Me(r)):e.unshift(``,Me(r,$e())):r instanceof A?r.toStringToBuffer(e):Array.isArray(r)?O(r,e):typeof r==`number`||r.isEscaped?(e[0]+=r,r.callbacks&&(e.callbacks||=[],e.callbacks.push(...r.callbacks))):d(r,e))}},Ie=class extends A{toStringToBuffer(e){O(this.children,e)}},Le=(e,t,...n)=>{t??={},n.length&&(t.children=n.length===1?n[0]:n);let r=t.key;delete t.key;let i=ze(e,t,n);return i.key=r,i},Re=!1,ze=(t,n,r)=>{if(!Re){for(let t in h)S[t][e]=h[t];Re=!0}return typeof t==`function`?new Fe(t,n,r):S[t]?new Fe(S[t],n,r):t===`svg`||t===`head`?(D||=et(``),new A(t,n,[new Fe(D,{value:t},r)])):new A(t,n,r)},j=({children:e})=>new Ie(``,{children:e},Array.isArray(e)?e:e?[e]:[]),M=[],Be=!1,Ve,He,Ue=0,We=!1,Ge=()=>{if(Be)return Ve;Be=!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&&(Ve=new t),Ve},Ke=()=>Ge()?.getStore()||He,qe=()=>{Ue>0&&!We&&(We=!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).`))},Je=(e,t)=>{if(!e)return qe(),t.values;let n=e.get(t);return n||(n=[t.values[0]],e.set(t,n)),n},Ye=(e,t)=>{if(!e)return qe(),t.values.at(-1);let n=e.get(t);return n?.length?n.at(-1):t.values[0]},Xe=e=>(e?M.filter(t=>e.has(t)):M).map(t=>[t,Ye(e,t)]),Ze=(e,t,n)=>Qe(()=>{let t=Ke(),r=n.map(([e,n])=>{let r=Je(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),Qe=(e,t)=>{if(Ke())return e();let n=t??new WeakMap,r=Ge();if(r)return r.run(n,e);He=n;let i;try{i=e()}finally{He=void 0}return!We&&i instanceof Promise&&(Ue++,i=i.finally(()=>{Ue--})),i},$e=()=>{let e=Ke(),t=Xe(e);return n=>Ze(n,e,t)},et=t=>{let n=[t],r=(e=>{let t=Je(Ke(),r);t.push(e.value);let n;try{n=typeof e.children==`string`?k([e.children]):Ne(e.children)?Pe(e.children):e.children?(Array.isArray(e.children)?new Ie(``,{},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]=tt(n),M.push(r),r},N=e=>Ye(Ke(),e),tt=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},nt=e=>{let t=[e],n=tt(t);return n.values=t,n.Provider=n,M.push(n),n},rt=0,it=2,at=3,ot=4,st=new WeakMap,ct=(e,t)=>!e||!t||e.length!==t.length||t.some((t,n)=>t!==e[n]),lt=void 0,ut=[],P=e=>{let t=()=>typeof e==`function`?e():e,r=L.at(-1);if(!r)return[t(),()=>{}];let[,i]=r,a=i[n][1][rt]||=[],o=i[n][0]++;return a[o]||=[t(),e=>{let t=lt,n=a[o];if(typeof e==`function`&&(e=e(n[0])),!Object.is(e,n[0])){if(n[0]=e,ut.length){let[e,n]=ut.at(-1);Promise.all([e===3?i:Ut([e,!1,t],i),n]).then(([n])=>{if(!n||e!==2&&e!==3)return;let r=n.vC;requestAnimationFrame(()=>{setTimeout(()=>{r===n.vC&&Ut([+(e===3),!1,t],n)})})})}else Ut([0,!1,t],i)}}]},dt=(e,t,r)=>{let i=L.at(-1);if(!i)return;let[,a]=i,o=a[n][1][1]||=[],s=a[n][0]++,[c,,l]=o[s]||=[];if(ct(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}},ft=(e,t)=>dt(3,e,t),F=(e,t)=>dt(1,e,t),pt=(e,t)=>{let r=L.at(-1);if(!r)return e;let[,i]=r,a=i[n][1][it]||=[],o=i[n][0]++,s=a[o];return ct(s?.[1],t)?a[o]=[e,t]:e=a[o][0],e};function I(e){let t=L.at(-1);if(!t)return{current:e};let[,r]=t,i=r[n][1][ot]||=[],a=r[n][0]++;return i[a]||={current:e}}var mt=e=>{let t=st.get(e);if(t){if(t.length===2)throw t[1];return t[0]}throw e.then(t=>st.set(e,[t]),t=>st.set(e,[void 0,t])),e},ht=(e,t)=>{let r=L.at(-1);if(!r)return e();let[,i]=r,a=i[n][1][at]||=[],o=i[n][0]++,s=a[o];return ct(s?.[1],t)&&(a[o]=[e(),t]),a[o][0]},gt=`_hp`,_t={Change:`Input`,DoubleClick:`DblClick`},vt={svg:`2000/svg`,math:`1998/Math/MathML`},L=[],R=new WeakMap,z=void 0,yt=()=>z,B=e=>`t`in e,bt={onClick:[`click`,!1]},xt=e=>{if(!e.startsWith(`on`))return;if(bt[e])return bt[e];let t=e.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(t){let[,n,r]=t;return bt[e]=[(_t[n]||n).toLowerCase(),!!r]}},St=(e,t)=>z&&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,Ct=e=>e==null||e===!1?null:e,wt=(e,t)=>{`value`in t&&(e.value=Ct(t.value),!e.multiple&&e.selectedIndex===-1&&(e.selectedIndex=0))},Tt=e=>e instanceof DOMException&&e.name===`InvalidCharacterError`,Et=(e,t,n)=>{t||={};for(let r in t){let i=t[r];if(r!==`children`&&(!n||n[r]!==i)){r=fe(r);let t=xt(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`){R.get(e)?.();let t;typeof i==`function`?t=i(e)||(()=>i(null)):i&&`current`in i&&(i.current=e,t=()=>i.current=null),R.set(e,t)}else if(r===`style`){let t=e.style;typeof i==`string`?t.cssText=i:(t.cssText=``,i!=null&&De(i,t.setProperty.bind(t)))}else{if(r===`value`){let t=e.nodeName;if(t===`SELECT`)continue;if((t===`INPUT`||t===`TEXTAREA`)&&(e.value=Ct(i),t===`TEXTAREA`)){e.textContent=i;continue}}else(r===`checked`&&e.nodeName===`INPUT`||r===`selected`&&e.nodeName===`OPTION`)&&(e[r]=i);let t=St(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(!Tt(e))throw e}}}}if(n)for(let r in n){let i=n[r];if(r!==`children`&&!(r in t)){r=fe(r);let t=xt(r);if(t)e.removeEventListener(t[0],i,t[1]);else if(r===`ref`)R.get(e)?.(),R.delete(e);else try{e.removeAttribute(St(e,r))}catch(e){if(!Tt(e))throw e}}}},Dt=(t,r)=>{r[n][0]=0,L.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{L.pop()}},Ot=(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(B(e))r.push(e);else if(typeof e.tag==`function`||e.tag===``){e.c=t;let n=r.length;if(Ot(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)})},kt=e=>{for(;e&&(e.tag===gt||!e.e);)e=e.tag===gt||!e.vC?.[0]?e.nN:e.vC[0];return e?.e},At=e=>{B(e)||(e[n]?.[1][1]?.forEach(e=>e[2]?.()),R.get(e.e)?.(),e.p===2&&e.vC?.forEach(e=>e.p=2),e.vC?.forEach(At)),e.p||(e.e?.remove(),delete e.e),typeof e.tag==`function`&&(V.delete(e),Lt.delete(e),delete e[n][3],e.a=!0)},jt=(e,t,n)=>{e.c=t,Pt(e,t,n)},Mt=(e,t)=>{if(t){for(let n=0,r=e.length;n<r;n++)if(e[n]===t)return n}},Nt=Symbol(),Pt=(e,t,n)=>{let r=[],i=[],a=[];Ot(e,t,r,i,a),i.forEach(At);let o=n?void 0:t.childNodes,s,c=null;if(n)s=-1;else if(!o.length)s=0;else{let t=Mt(o,kt(e.nN));t===void 0?s=Mt(o,r.find(e=>e.tag!==gt&&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;B(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),Et(a,i.props,i.pP),Pt(i,a,e),i.tag===`select`&&wt(a,i.props))}i.tag===gt?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())})}},Ft=(e,t)=>!!(e&&e.length===t.length&&e.every((e,n)=>e[1]===t[n][1])),It=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},Lt=new WeakMap,Rt=(e,a,o)=>{let s=!o&&a.pC;o&&(a.pC||=a.vC);let c;try{o||=typeof a.tag==`function`?Dt(e,a):x(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=zt(o[t]);if(s){typeof s.tag==`function`&&!s.tag[r]&&(M.length>0&&(s[n][2]=M.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&&!B(s)&&(l=[...p.values()],p=void 0),p){let e=s.key,n=p.get(e);n&&(B(s)?B(n):n.tag===s.tag&&n.key===e)&&(t=n,p.delete(e))}else if(l&&l.length){let e=l[0];if(B(s)?B(e):!B(e)&&(s.key===void 0||e.key===s.key)&&e.tag===s.tag)t=l.shift();else{let e=l.findIndex(B(s)?e=>B(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=It(l))}}if(t){if(B(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))&&Ft(r,t[n][2])&&(t.s=!0)}s=t}}else if(!B(s)&&z){let e=N(z);e&&(s.n=e)}if(!B(s)&&!s.s&&(Rt(e,s),delete s.f),u.push(s),d&&!d.s&&!s.s)for(let e=d;e&&!B(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===Nt){if(c)return;throw t}let[r,i,o]=a[n]?.[3]||[];if(i){let n=()=>Ut([0,!1,e[2]],o),a=Lt.get(o)||[];a.push(n),Lt.set(o,a);let s=i(t,()=>{let e=Lt.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(Rt(e,o,[s]),(i.length===1||e!==r)&&o.c){jt(o,o.c,!1);return}throw Nt}}throw t}finally{c&&e[5].pop()}},zt=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=vt[e.tag];t&&(z||=nt(``),e.props.children=[{tag:z,props:{value:e.n=`http://www.w3.org/${t}`,children:e.props.children}}])}return e}},Bt=(e,t,n)=>{e.c===t&&(e.c=n,e.vC.forEach(e=>Bt(e,t,n)))},Vt=(e,t)=>{t[n][2]?.forEach(([e,t])=>{e.values.push(t)});try{Rt(e,t,void 0)}catch{return}t.a?delete t.a:(t[n][2]?.forEach(([e])=>{e.values.pop()}),(e[0]!==1||!e[1])&&jt(t,t.c,!1))},V=new WeakMap,Ht=[],Ut=async(e,t)=>{e[5]||=[];let n=V.get(t);n&&n[0](void 0);let r,i=new Promise(e=>r=e);if(V.set(t,[r,()=>{e[2]?e[2](e,t,e=>{Vt(e,t)}).then(()=>r(t)):(Vt(e,t),r(t))}]),Ht.length)Ht.at(-1).add(t);else{await Promise.resolve();let e=V.get(t);e&&(V.delete(t),e[1]())}return i},Wt=(e,t)=>{let n=[];n[5]=[],n[4]=!0,Rt(n,e,void 0),n[4]=!1;let r=document.createDocumentFragment();jt(e,r,!0),Bt(e,r,t),t.replaceChildren(r)},Gt=e=>{let t=new Set;Ht.push(t),e(),t.forEach(e=>{let t=V.get(e);t&&(V.delete(e),t[1]())}),Ht.pop()},Kt=(e,t,n)=>({tag:gt,props:{children:e},key:n,e:t,p:1}),qt=(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):Wt(zt({tag:()=>{let[e,r]=P(t);return n=r,e},props:{}}),e)},unmount(){n?.(null),n=null}}};function Jt(e,t){return typeof t==`bigint`?t.toString():t}var Yt=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 Xt(e){return new Yt(e)}function Zt(e){return e==null}function Qt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var $t=Symbol(`evaluating`);function en(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==$t)return r===void 0&&(r=$t,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}var nn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function rn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function an(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(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 on(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function U(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 sn(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 cn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ln(e){return typeof e==`string`?e:e?.message}function un(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function dn(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:ln(e.inst?._zod.def?.error?.(e))??ln(a?.(e))??ln(t?.error?.(e))??ln(n.customError?.(e))??ln(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 fn=/[\uD800-\uDBFF]/;function pn(e){let t=e.length;if(!fn.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 mn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function hn(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):vn(e,n,r.value)}}function gn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function _n(e,t,n){return gn(e,t,n,!1)}function vn(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:gn(this,t,n.bind(this))},set(e){gn(this,t,e)}})}function yn(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var bn,W=!1,xn={configurable:!0,get(){W=!0}};function G(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&bn!==e._zod?bn=void 0:(bn=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,xn);let e=W;W=!1;try{let r=n(this);return W?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),W||=e,r}catch(n){throw delete this[t],W||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Sn(e,t,n,r){let i=yn(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 Cn,wn={value:void 0,enumerable:!1},Tn=`captureStackTrace`in Error?Error:null;function En(e){let t=Tn;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Tn=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function K(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){wn.value=new a(r);try{Object.defineProperty(n,"_zod",wn)}finally{wn.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),hn(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?En(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 Dn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(Cn=globalThis).__zod_globalConfig??(Cn.__zod_globalConfig={});var On=globalThis.__zod_globalConfig;function kn(e){return e&&Object.assign(On,e),On}function An(){let e=this._zod;return e.message??=JSON.stringify(e.def,Jt,2),e.message}function jn(e){this._zod.message=e}var Mn={get:An,set:jn,enumerable:!0,configurable:!0},Nn={value:void 0,enumerable:!1},Pn=new WeakSet([Object.prototype,Error.prototype]),Fn=(e,t)=>{e.name=`$ZodError`,Nn.value=t,Object.defineProperty(e,"issues",Nn),Nn.value=void 0,Object.defineProperty(e,"message",Mn);let n=Object.getPrototypeOf(e);Pn.has(n)||(Pn.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})}}))};K(`$ZodError`,Fn);var In=K(`$ZodError`,Fn,void 0,{Parent:Error}),Ln=(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 Dn;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>dn(e,o,kn())));throw nn(n,a?.callee??t),n}return s.value};return t})(In),Rn=(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=>dn(e,o,kn())));throw nn(n,a?.callee??t),n}return s.value};return t})(In),zn=(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 Dn;return a.issues.length?Bn(e,a.issues,i):{success:!0,data:a.value}})(In);function Bn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>dn(e,n,kn()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Vn=(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?Bn(e,a.issues,i):{success:!0,data:a.value}})(In),Hn=/^[\s\S]{0,}$/,Un=/^-?\d+(?:\.\d+)?$/,Wn=/^(?:true|false)$/i,Gn=K(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Kn=e=>{let t=e.value;return!Zt(t)&&t.length!==void 0},qn=K(`$ZodCheckMinLength`,(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=Kn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?pn(r):i)>=t.minimum)return;let a=mn(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Jn={major:4,minor:6,patch:5},q=K(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jn;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=U(t),a;for(let o of n){if(o._zod.def.when){if(sn(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 Dn;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(un(t.issues,n,e),i||=U(t,n))});else{if(t.issues.length===n)continue;un(t.issues,n,e),i||=U(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(U(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Dn;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 Dn;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return _n(this,`~standard`,Zn(this))},set"~standard"(e){gn(this,`~standard`,e)}}),Yn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>dn(e,t,kn()))}:{value:e.value};async function Xn(e,t){let n={async:!0};return Yn(await e._zod.run({value:t,issues:[]},n),n)}function Zn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Yn(r,n)}catch{}return Xn(e,t)},vendor:`zod`,version:1}}var Qn=K(`$ZodString`,(e,t)=>{q.init(e,t),e._zod.pattern=t.pattern??Hn,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}}),$n=K(`$ZodNumber`,(e,t)=>{q.init(e,t),e._zod.pattern=Un,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}}),er=K(`$ZodBoolean`,(e,t)=>{q.init(e,t),e._zod.pattern=Wn,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 tr(e,t,n){e.issues.length&&t.issues.push(...cn(n,e.issues)),t.value[n]=e.value}var nr=K(`$ZodArray`,(e,t)=>{q.init(e,t);let n=On.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=>tr(t,r,e)));else if(tr(c,r,e),s&&c.issues.length!==0&&U(c))break}return o.length?Promise.all(o).then(()=>r):r}});function rr(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(...cn(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 ir=[];function ar(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ir,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=on(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function or(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(U(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=>rr(e,n,i,t,d,f))):rr(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 sr=K(`$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=Xt(()=>ar(t));G(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)||tn(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=rn,o=t.catchall,s,c=On.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(U(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=>rr(n,t,e,r,a,o))):rr(s,t,e,r,a,o)}return o?or(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}});function cr(e,t){return e.value=t.issues.length?void 0:t.value,e}var lr=K(`$ZodOptional`,(e,t)=>{q.init(e,t),G(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,G(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),G(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Qt(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=>cr(e,t)):cr(e,r)}return t.innerType._zod.run(e,n)}}),ur=K(`$ZodLazy`,(e,t)=>{q.init(e,t),en(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),G(e,`pattern`,e=>e.innerType?._zod?.pattern),G(e,`propValues`,e=>e.innerType?._zod?.propValues),G(e,`optin`,e=>e.innerType?._zod?.optin??void 0),G(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)});function dr(e){return e.checks&&=[...e.checks],e}function fr(e,t){return new e(dr({type:`string`,...H(t)}))}function pr(e,t){return new e(dr({type:`number`,checks:[],...H(t)}))}function mr(e,t){return new e({type:`boolean`,...H(t)})}function hr(e,t){return new qn({check:`min_length`,...H(t),minimum:e})}var J=K(`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){gn(this,`with`,e)},parse(e,t){return Ln(this,e,t,{callee:this.parse})},parseAsync(e,t){return Rn(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return zn(this,e,t)},safeParseAsync(e,t){return Vn(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 an(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)}}),gr=K(`ZodMiniString`,(e,t)=>{Qn.init(e,t),J.init(e,t)});function Y(e){return fr(gr,e)}var _r=K(`ZodMiniNumber`,(e,t)=>{$n.init(e,t),J.init(e,t)});function vr(e){return pr(_r,e)}var yr=K(`ZodMiniBoolean`,(e,t)=>{er.init(e,t),J.init(e,t)});function br(e){return mr(yr,e)}var xr=K(`ZodMiniArray`,(e,t)=>{nr.init(e,t),J.init(e,t)});function X(e,t){return new xr({type:`array`,element:e,...H(t)})}var Sr=K(`ZodMiniObject`,(e,t)=>{sr.init(e,t),J.init(e,t),Sn(e,`shape`,e=>e._zod.def.shape,!1)});function Z(e,t){return new Sr({type:`object`,shape:e??{},...H(t)})}var Cr=K(`ZodMiniOptional`,(e,t)=>{lr.init(e,t),J.init(e,t)});function wr(e){return new Cr({type:`optional`,innerType:e})}var Tr=K(`ZodMiniLazy`,(e,t)=>{ur.init(e,t),J.init(e,t)});function Er(e){return new Tr({type:`lazy`,getter:e})}var Dr=Z({id:Y(),name:Y(),label:Y(),active:br(),children:Er(()=>X(Dr))}),Or=Z({name:Y(),path:X(Y()),docs:X(Dr),groups:Er(()=>X(Or))}),kr=Z({depth:vr(),slug:Y(),text:Y()}),Ar=Z({title:Y(),groups:X(Or),outline:X(Z({part:wr(Y()),sections:X(Z({heading:kr,part:wr(Y()),subs:X(Z({heading:kr}))})).check(hr(1))})),home:br(),cursorFace:br()});function jr(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=jr(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=jr(e))&&(r&&(r+=` `),r+=t);return r}var Mr=nt({pending:!1,data:null,method:null,action:null}),Nr=new Set,Pr=e=>{Nr.add(e),e.finally(()=>Nr.delete(e))},Fr=b({button:()=>Xr,clearCache:()=>Ir,composeRef:()=>Lr,form:()=>qr,input:()=>Yr,link:()=>Wr,meta:()=>Gr,script:()=>Hr,style:()=>Ur,title:()=>Vr}),Ir=()=>{Rr=Object.create(null),zr=Object.create(null)},Lr=(e,t)=>ht(()=>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]),Rr=Object.create(null),zr=Object.create(null),Br=(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=v(e,r),_=e=>e.getAttribute(`rel`)===`stylesheet`&&e.getAttribute(`data-precedence`)!==null,y;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=!zr[n],d=zr[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 y=a.querySelectorAll(e);c=r?c??``:void 0,r&&(u[g]=c);let b=pt(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(y){let n=!1;for(let e of y)if(e===t){n=!0;break}n||a.insertBefore(t,a.contains(y[0])?y[0]:a.querySelector(e)),y=void 0}},[h,c,e]),x=Lr(t.ref,e=>{let t=p[0];if(n===2&&(e.innerHTML=``),(f||y)&&b(e),!s&&!o||!t)return;let r=Rr[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];mt(Rr[e]||=new Promise((e,t)=>{b(d),d.addEventListener(`load`,e),d.addEventListener(`error`,t)}))}}let S={tag:e,type:e,props:{...u,ref:x},ref:x};return S.p=n,d&&(S.e=d),Kt(S,a)},Vr=e=>{let t=yt();return(t&&N(t))?.endsWith(`svg`)?{tag:`title`,props:e,type:`title`,ref:e.ref}:Br(`title`,e,void 0,!1,!1)},Hr=e=>!e||[`src`,`async`].some(t=>!e[t])?{tag:`script`,props:e,type:`script`,ref:e.ref}:Br(`script`,e,1,!1,!0),Ur=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,Br(`style`,e,2,!0,!0)),Wr=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}:Br(`link`,e,1,_(e),!0),Gr=e=>Br(`meta`,e,void 0,!1,!1),Kr=Symbol(),qr=e=>{let{action:t,...n}=e;typeof t!=`function`&&(n.action=t);let[r,i]=P([null,!1]),a=pt(async e=>{let n=e.isTrusted?t:e.detail[Kr];if(typeof n!=`function`)return;e.preventDefault();let r=new FormData(e.target);i([r,!0]);let a=n(r);a instanceof Promise&&(Pr(a),await a),i([null,!0])},[]),o=Lr(e.ref,e=>(e.addEventListener(`submit`,a),()=>{e.removeEventListener(`submit`,a)})),[s,c]=r;return r[1]=!1,{tag:Mr,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}},Jr=(e,{formAction:t,...n})=>{if(typeof t==`function`){let e=pt(e=>{e.preventDefault(),e.currentTarget.form.dispatchEvent(new CustomEvent(`submit`,{detail:{[Kr]:t}}))},[]);n.ref=Lr(n.ref,t=>(t.addEventListener(`click`,e),()=>{t.removeEventListener(`click`,e)}))}return{tag:e,props:n,type:e,ref:n.ref}},Yr=e=>Jr(`input`,e),Xr=e=>Jr(`button`,e);Object.assign(h,{title:Vr,script:Hr,style:Ur,link:Wr,meta:Gr,form:qr,input:Yr,button:Xr});var $=(e,t,n)=>(typeof e==`string`&&Fr[e]&&(e=Fr[e]),{tag:e,type:e,props:t,key:n,ref:t.ref}),Zr=e=>$(``,e,void 0),Qr=(({children:e,fallback:n,fallbackRender:r,onError:i})=>{let a=Zr({children:e});return a[t]=e=>{if(e instanceof Promise)throw e;return i?.(e),r?.(e)||n},a}),$r=(({children:e,fallback:n})=>{let r=Zr({children:e});return r[t]=(e,t)=>{if(!(e instanceof Promise))throw e;return e.finally(t),n},r}),ei=0,ti=async e=>{try{return e.flat().map(ni)}catch(t){if(t instanceof Promise){let n=$e();return await t,n(()=>ti(e))}throw t}},ni=e=>{if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||Array.isArray(e))return k([e]);if(Ne(e))return Pe(e);{let t=e.toString();return t instanceof Promise?t:c(t)}},ri=async({children:e,fallback:t,fallbackRender:n,onError:r})=>{if(!e)return c(``);Array.isArray(e)||(e=[e]);let i=N(ii)?.scriptNonce,a,o=()=>a||=$e(),l,u=()=>l||=(async()=>{let e=await t;if(e==null)return;if(typeof e==`string`||Array.isArray(e))return o()(()=>k([e]));if(Ne(e))return o()(()=>Pe(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&&Le(j,{},n(e))||``:t,a=await j({children:i}).toString();return c(a,a.callbacks||i.callbacks)})},f=[];try{f=e.map(ni)}catch(t){let n=o();f=t instanceof Promise?[t.then(()=>n(()=>ti(e))).catch(e=>d(e))]:[await d(t)]}if(f.some(e=>e instanceof Promise)){o();let e=ei++,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>
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
4
  d=d.getElementById('E:${e}')
@@ -22,7 +22,7 @@ while(n.nodeType!=8||n.nodeValue!='E:${e}'){n=n.nextSibling}
22
22
  n.remove()
23
23
  d.remove()
24
24
  })(document)
25
- <\/script>`:``),n.callbacks))).catch(e=>r({error:e,buffer:o})));return c(f,g)}).catch(e=>r({error:e,buffer:o}))}])}return j({children:f})};ri[e]=Qr;var ii=et(null),ai=0,oi=e=>typeof e==`string`||Array.isArray(e)?k([e]):e==null||typeof e==`boolean`?``:Ne(e)?Pe(e):e.toString(),si=async({children:e,fallback:t})=>{Array.isArray(e)||(e=[e]);let r=N(ii)?.scriptNonce,i=[],a={[n]:[0,[]]},o=()=>{L.pop()};try{a[n][0]=0,L.push([[],a]),i=e.map(oi)}catch(t){if(t instanceof Promise){let r=$e();i=[t.then(()=>r(()=>(a[n][0]=0,L.push([[],a]),ti(e).finally(o))))]}else throw t}finally{o()}if(i.some(e=>e instanceof Promise)){let e=ai++,n=await(typeof t==`string`||Array.isArray(t)?k([t]):Ne(t)?Pe(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}"`:``}>
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
28
  d=d.getElementById('H:${e}')
@@ -30,10 +30,8 @@ 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>`,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(``))};si[e]=$r,new TextEncoder;var ci=`fh-cursor-face`,li=`/favicon.svg`,ui=e=>{let t=I(null),n=I(null),r=I({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(
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
34
  ${Math.max(0,Math.min(r.current.x+16,document.documentElement.clientWidth-e.width-16))}px,
35
35
  ${Math.max(0,Math.min(r.current.y+16,document.documentElement.clientHeight-e.height-16))}px,
36
36
  0
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(ci,JSON.stringify({x:r.current.x,y:r.current.y}))}catch{}},u=()=>{try{let e=sessionStorage.getItem(ci);if(sessionStorage.removeItem(ci),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 F(()=>{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:li,width:24,height:24,alt:``,"aria-hidden":`true`,draggable:!1,"data-cursor-face":``})},di=`다이어그램을 불러오지 못했습니다. 원문을 확인해 주세요.`,fi=`다이어그램을 그리지 못했습니다. 원문을 확인해 주세요.`,pi=5e4,mi={startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,maxTextSize:pi},hi={...mi,theme:`redux-dark-color`,themeVariables:{treeView:{labelColor:`currentColor`,lineColor:`currentColor`}}},gi=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}}}},_i=e=>(ft(()=>{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=gi({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 ${pi} characters`);f.default.initialize(u===`dark`?hi:mi);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=fi,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=di,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),vi=`(width < 1024px)`,yi=`(width >= 1360px)`,bi=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 i=sessionStorage.getItem(e.key),a=i===null?void 0:JSON.parse(i),o=typeof a==`object`&&a&&`version`in a&&a.version===e.version&&`state`in a?e.toState(a.state):{positions:{}},s=sessionStorage.getItem(`${e.key}:${e.layout===`drawer`?`drawer`:`desktop`}`),c=o.positions[e.layout]===void 0&&s!==null?e.toState({positions:{[e.layout]:JSON.parse(s)}}).positions[e.layout]:void 0,l=o.positions[e.layout]??c,u=[...t.querySelectorAll(`.wg_navigationNav__root a[href]`)].map(e=>`${e.pathname}:${e.textContent}`).join(`
38
- `);if(l===void 0||l.navigation!==u)return;n.scrollTop=l.documents,l.pathname===location.pathname&&(r.scrollTop=l.outline)}catch{}}},xi=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`&&$(j,{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&&$(xi,{group:{name:t.doc.name,path:e.group.path,docs:t.doc.children,groups:[]}})]}),t.kind===`group`&&$(j,{children:[$(`span`,{className:Q(`wg_navigationNavList__branch`),children:t.group.name}),$(xi,{group:t.group})]})]},t.key))})},Si=`Document navigation`,Ci=`Open navigation`,wi=`Close navigation`,Ti=`Navigation`,Ei=`On this page`,Di=e=>$(`nav`,{className:Q(`wg_navigationNav__root`),"aria-label":Si,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}),$(xi,{group:e})]},JSON.stringify(e.path)))})}),Oi=e=>{let[t,n]=P({above:!1,below:!1}),r=I(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 F(()=>{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]),F(()=>{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})},ki=e=>{if(!e)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch(e){if(e instanceof URIError)return null;throw e}},Ai=e=>{let[t,n]=P();return F(()=>{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=ki(`#${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":Ei,children:[$(`div`,{className:Q(`wg_navigationToc__label`),children:Ei}),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))]})},ji=`for-humanity:navigation-scroll`,Mi=e=>{let t=e=>{if(!(typeof e!=`object`||!e||!(`navigation`in e)||typeof e.navigation!=`string`||!(`pathname`in e)||typeof e.pathname!=`string`||!(`documents`in e)||typeof e.documents!=`number`||!Number.isFinite(e.documents)||e.documents<0||!(`outline`in e)||typeof e.outline!=`number`||!Number.isFinite(e.outline)||e.outline<0))return{navigation:e.navigation,pathname:e.pathname,documents:e.documents,outline:e.outline}};if(typeof e!=`object`||!e||!(`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(e=>e[1]!==void 0))}},Ni=e=>{let t=ki(e);for(let e=t?.closest(`details`);e;e=e.parentElement?.closest(`details`))e.open=!0;return t},Pi=e=>{let[t,n]=P(()=>e.stores===void 0?`desktop`:matchMedia(`(width < 1024px)`).matches?`drawer`:matchMedia(`(width >= 1360px)`).matches?`wide`:`desktop`),[r,i]=P(!1),a=I(null),o=I(null),s=I(null),c=I(null),l=I(null),u=I(null),d=I(null),f=I(null),p=I(null),m=I(null),h=I(t),g=I(null),_=I(!0),v=()=>p.current===null||m.current===null?h.current:p.current.matches?`drawer`:m.current.matches?`wide`:`desktop`,y=()=>h.current===`drawer`?s.current:a.current,b=()=>h.current===`drawer`?c.current:o.current,x=()=>{let e=y();if(e!==null)return[...e.querySelectorAll(`.wg_navigationNav__root a[href]`)].map(e=>`${e.pathname}:${e.textContent}`).join(`
39
- `)},S=()=>{let t=b();if(e.stores===void 0||t===null||l.current===null||_.current||h.current!==v()||h.current===`drawer`&&u.current?.open!==!0)return;let n=x();if(n===void 0)return;let r={navigation:n,pathname:location.pathname,documents:t.scrollTop,outline:l.current.scrollTop};e.stores.scroll.setState(e=>({positions:{...e.positions,[h.current]:r}}))},ee=()=>{h.current=v();let t=b(),n=y();if(e.stores===void 0||t===null||l.current===null||n===null||h.current===`drawer`&&u.current?.open!==!0)return;let r=x();if(r===void 0)return;let i=e.stores.scroll.getState().positions[h.current];t.scrollTop=0,l.current.scrollTop=0,i===void 0?bi({key:ji,version:1,layout:h.current,toState:Mi}):i.navigation===r&&(t.scrollTop=i.documents,i.pathname===location.pathname&&(l.current.scrollTop=i.outline)),n.dataset.navigationLayout=h.current,_.current=!1,S(),t.dispatchEvent(new Event(`scroll`)),l.current.dispatchEvent(new Event(`scroll`))},te=e=>{u.current?.open!==!0&&(document.body.classList.remove(`wg_shell__root--drawerOpen`),i(!1))},C=()=>{S(),u.current?.close(),document.body.classList.remove(`wg_shell__root--drawerOpen`),i(!1)},w=e=>{v()!==`drawer`||u.current===null||u.current.open||(u.current.showModal(),document.body.classList.add(`wg_shell__root--drawerOpen`),i(!0),ee())},ne=e=>{C()},re=e=>{e.preventDefault(),C()},ie=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)&&C()},ae=e=>{if(S(),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`))&&(C(),t.origin===location.origin&&t.pathname===location.pathname&&t.search===location.search&&t.hash)){let e=Ni(t.hash);e!==null&&(e.tabIndex=-1,e.focus({preventScroll:!0}))}},T=()=>{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`&&C(),_.current=!0,h.current=e,Gt(()=>n(e)))},oe=t=>{t.persisted&&e.stores!==void 0&&(_.current=!0,Gt(()=>e.stores?.scroll.persist.rehydrate()),T(),ee())};return F(()=>{if(e.stores!==void 0)return p.current=matchMedia(vi),m.current=matchMedia(yi),p.current.addEventListener(`change`,T),m.current.addEventListener(`change`,T),addEventListener(`pagehide`,S),addEventListener(`pageshow`,oe),()=>{p.current?.removeEventListener(`change`,T),m.current?.removeEventListener(`change`,T),p.current=null,m.current=null,removeEventListener(`pagehide`,S),removeEventListener(`pageshow`,oe),document.body.classList.remove(`wg_shell__root--drawerOpen`)}},[e.stores]),F(()=>{if(e.stores===void 0)return;let n=!0,r=()=>{if(!n||(ee(),g.current===null))return;let e=y();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 b()?.isConnected?r():queueMicrotask(r),()=>{n=!1}},[t,e.stores]),$(j,{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":Ci,"aria-controls":`fh-navigation-drawer`,"aria-expanded":String(r),"data-navigation-open":``,onClick:w,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":``,children:$(Oi,{portRef:o,kind:`documents`,ready:e.stores!==void 0,onScroll:S,onClick:ae,children:$(Di,{groups:e.data.groups})})})]}),$(`aside`,{className:Q(`wg_navigation__tocRail`),"data-navigation-rail":``,children:$(`div`,{className:Q(`wg_navigation__outline`),"data-navigation-outline":``,children:$(Oi,{portRef:l,kind:`outline`,ready:e.stores!==void 0,onScroll:S,onClick:ae,children:e.data.outline.length>0&&$(Ai,{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:te,onCancel:re,onClick:ie,children:[$(`div`,{className:Q(`wg_navigation__drawerHeader`),children:[$(`h2`,{className:Q(`wg_navigation__drawerTitle`),id:`fh-navigation-title`,children:Ti}),$(`button`,{className:Q(`wg_navigation__drawerClose`),type:`button`,"aria-label":wi,"data-navigation-close":``,onClick:ne,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":``,children:$(Oi,{portRef:c,kind:`documents`,ready:e.stores!==void 0,onScroll:S,onClick:ae,children:$(Di,{groups:e.data.groups})})})})]})]})},Fi=3e3,Ii=e=>{let t=I(null),n=I(0),r=I(null),i=I(null),a=I(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,Fi))},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,Fi),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=Ni(t.hash);t.hash===location.hash&&c(e)}},u=()=>{let e=Ni(location.hash);e?.scrollIntoView(),c(e)},d=()=>{a.current?.abort()},f=async()=>{let e=i.current,t=location.hash,n=Ni(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=()=>{Ni(location.hash),document.readyState===`complete`&&f()};return F(()=>{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`)}},[]),$(j,{children:[$(`div`,{className:Q(`wg_shellControls__navigation`),children:$(Pi,{data:e.data,stores:e.stores})}),e.data.cursorFace&&$(ui,{ready:e.stores!==void 0}),$(_i,{onRendered:f})]})};function Li(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 Ri=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return Ri(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return Ri(t)(e)}}}},zi=(e,t)=>(n,r,i)=>{let a={storage:Li(()=>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 Ri(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},Bi=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},Vi=(e=>e?Bi(e):Bi),Hi=e=>{let t=e=>({getItem:t=>e().getItem(t),setItem:(t,n)=>{try{return e().setItem(t,n)}catch{}},removeItem:t=>{try{return e().removeItem(t)}catch{}}});return{scroll:Vi()(zi(()=>({positions:{}}),{name:ji,version:1,storage:Li(()=>t(e.session)),merge:e=>Mi(e),migrate:()=>({positions:{}})}))}},Ui=document.querySelector(`[data-shell-browser-root]`),Wi=document.getElementById(`fh-navigation-data`);if(Ui!==null&&Wi!==null)try{let e=JSON.parse(Wi.textContent),t=Ar.parse(e),n=Hi({session:()=>sessionStorage});qt(Ui).render($(Ii,{data:t,stores:n}))}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)}})();