@askrjs/askr 0.0.14 → 0.0.16
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/README.md +30 -287
- package/dist/{chunk-FYTGHAKU.js → chunk-7EBQWZZJ.js} +1 -1
- package/dist/chunk-F2JOQXH7.js +1 -0
- package/dist/chunk-FWVUNA6A.js +2 -0
- package/dist/{chunk-OD6C42QU.js → chunk-XFCLEDZK.js} +1 -1
- package/dist/{chunk-7DNGQWPJ.js → chunk-YJMBDYNG.js} +1 -1
- package/dist/for/index.js +1 -1
- package/dist/foundations/index.js +1 -1
- package/dist/fx/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/navigate-Y45U4P2H.js +1 -0
- package/dist/resources/index.js +1 -1
- package/dist/{route-WP5TWBJE.js → route-33ZUATUA.js} +1 -1
- package/dist/router/index.d.ts +35 -3
- package/dist/router/index.js +1 -1
- package/dist/ssr/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-BJ3TA3ZK.js +0 -1
- package/dist/chunk-LW2VF6A3.js +0 -2
- package/dist/navigate-R2PQVY2C.js +0 -1
package/README.md
CHANGED
|
@@ -1,331 +1,74 @@
|
|
|
1
1
|
# Askr
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**An AI‑first, deterministic TypeScript/JSX runtime for predictable co‑authored code.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Why Askr
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- AI-generated code breaks when frameworks rely on hidden lifecycle, implicit scheduling, or unclear ownership.
|
|
8
|
+
- Askr removes ambiguity: ownership, time, and cancellation are explicit and visible in code.
|
|
9
|
+
- Deterministic renders and first‑class cancellation make small changes (human or AI) safe and auditable.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
- **Let the runtime handle time.** Async, routing, rendering, SSR/hydration, and cleanup are runtime responsibilities.
|
|
11
|
-
- **Use platform primitives.** Cancellation is `AbortController`/`AbortSignal`, not a framework invention.
|
|
11
|
+
## What Askr is / is not
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- **Is:** a tiny runtime that runs plain functions + JSX; async/await is first‑class; cancellation via AbortSignal; deterministic on client and server.
|
|
14
|
+
- **Is not:** a React replacement, a virtual DOM, a component library, or a runtime with hidden lifecycle heuristics.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
- [tests/README.md](tests/README.md)
|
|
16
|
+
## Quick start
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
> **Write normal code. Let the runtime handle time.**
|
|
21
|
-
|
|
22
|
-
Askr exists to remove framework-shaped thinking from application code.
|
|
23
|
-
Async, routing, rendering, SSR, hydration, and cleanup are _runtime responsibilities_.
|
|
24
|
-
Developers should only think about:
|
|
25
|
-
|
|
26
|
-
- functions
|
|
27
|
-
- state
|
|
28
|
-
- HTML
|
|
29
|
-
|
|
30
|
-
## Quick Start
|
|
31
|
-
|
|
32
|
-
**1. Install**
|
|
18
|
+
1. Install:
|
|
33
19
|
|
|
34
20
|
```sh
|
|
35
|
-
npm
|
|
21
|
+
npm install @askrjs/askr
|
|
36
22
|
```
|
|
37
23
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Edit `tsconfig.json`:
|
|
24
|
+
2. Minimal `tsconfig.json`:
|
|
41
25
|
|
|
42
26
|
```json
|
|
43
|
-
{
|
|
44
|
-
"compilerOptions": {
|
|
45
|
-
"jsx": "preserve",
|
|
46
|
-
"jsxImportSource": "@askrjs/askr"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
27
|
+
{ "compilerOptions": { "jsx": "preserve", "jsxImportSource": "@askrjs/askr" } }
|
|
49
28
|
```
|
|
50
29
|
|
|
51
|
-
|
|
30
|
+
3. `src/main.tsx` (Home + User):
|
|
52
31
|
|
|
53
32
|
```ts
|
|
54
|
-
import { createSPA, getRoutes, Link,
|
|
33
|
+
import { createSPA, route, getRoutes, Link, state } from '@askrjs/askr';
|
|
55
34
|
|
|
56
35
|
function Home() {
|
|
57
|
-
const
|
|
36
|
+
const c = state(0);
|
|
58
37
|
return (
|
|
59
|
-
<div
|
|
38
|
+
<div>
|
|
60
39
|
<h1>Home</h1>
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
<p><Link href="/users/42">User 42</Link></p>
|
|
40
|
+
<button onClick={() => c.set(x => x + 1)}>Count: {c()}</button>
|
|
41
|
+
<p><Link href="/user/42">User 42</Link></p>
|
|
64
42
|
</div>
|
|
65
43
|
);
|
|
66
44
|
}
|
|
67
45
|
|
|
68
46
|
function User({ id }: { id: string }) {
|
|
69
|
-
return
|
|
70
|
-
<div style="padding:12px">
|
|
71
|
-
<h1>User {id}</h1>
|
|
72
|
-
<Link href="/">← Back</Link>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
47
|
+
return <div><h1>User {id}</h1><Link href="/">← Back</Link></div>;
|
|
75
48
|
}
|
|
76
49
|
|
|
77
50
|
route('/', () => <Home />);
|
|
78
|
-
route('/
|
|
79
|
-
|
|
51
|
+
route('/user/{id}', ({ id }) => <User id={id} />);
|
|
80
52
|
createSPA({ root: 'app', routes: getRoutes() });
|
|
81
53
|
```
|
|
82
54
|
|
|
83
|
-
|
|
55
|
+
4. `index.html`:
|
|
84
56
|
|
|
85
57
|
```html
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
<body>
|
|
89
|
-
<div id="app"></div>
|
|
90
|
-
<script type="module" src="./src/main.tsx"></script>
|
|
91
|
-
</body>
|
|
92
|
-
</html>
|
|
58
|
+
<div id="app"></div>
|
|
59
|
+
<script type="module" src="./src/main.tsx"></script>
|
|
93
60
|
```
|
|
94
61
|
|
|
95
|
-
|
|
62
|
+
5. Run:
|
|
96
63
|
|
|
97
64
|
```sh
|
|
98
65
|
npx vite
|
|
99
66
|
```
|
|
100
67
|
|
|
101
|
-
Then install the Askr Vite plugin in `vite.config.ts` if needed (automatically handles JSX):
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
import { defineConfig } from 'vite';
|
|
105
|
-
import { askrVitePlugin } from '@askrjs/askr/vite';
|
|
106
|
-
|
|
107
|
-
export default defineConfig({
|
|
108
|
-
plugins: [askrVitePlugin()],
|
|
109
|
-
});
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Done. Click links, increment counters, navigate routes. No hidden state, no effects, no lifecycle.
|
|
113
|
-
|
|
114
|
-
**Key takeaways:**
|
|
115
|
-
|
|
116
|
-
- Write normal functions and HTML
|
|
117
|
-
- Use `state()` for reactive values; call `set()` to update
|
|
118
|
-
- Use `route()` to register and read routes
|
|
119
|
-
- Platform primitives: cancellation is `AbortSignal`, state is plain functions
|
|
120
|
-
|
|
121
|
-
## JSX runtime
|
|
122
|
-
|
|
123
|
-
- Exported subpath: `@askrjs/askr/jsx-runtime` (re-exports `jsx`, `jsxs`, and `Fragment`).
|
|
124
|
-
- For TypeScript projects, set `jsxImportSource` to `@askrjs/askr` (or `@askrjs/askr/jsx-runtime`) in `tsconfig.json` to ensure the automatic JSX transform resolves to this runtime.
|
|
125
|
-
|
|
126
|
-
- Use `class` in JSX attributes (e.g., `<div class="x">`) — the runtime accepts `class` and maps it to the element class name during rendering instead of `className`.
|
|
127
|
-
|
|
128
|
-
### Vite support ✅
|
|
129
|
-
|
|
130
|
-
If you want Vite to work with Askr without extra config, install the plugin and add it to your `vite.config.ts`:
|
|
131
|
-
|
|
132
|
-
```ts
|
|
133
|
-
// vite.config.ts
|
|
134
|
-
import { defineConfig } from 'vite';
|
|
135
|
-
import { askrVitePlugin } from '@askrjs/askr/vite';
|
|
136
|
-
|
|
137
|
-
export default defineConfig({
|
|
138
|
-
plugins: [askrVitePlugin()],
|
|
139
|
-
});
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
The plugin configures esbuild to inject Askr's JSX runtime and adds the runtime to `optimizeDeps`.
|
|
143
|
-
|
|
144
|
-
By default the plugin also enables a small built-in JSX transform (esbuild-based) that rewrites `.jsx`/`.tsx` files to use Askr's automatic JSX runtime. This means you don't need an external JSX plugin to get JSX working and the plugin avoids adding dependencies that reference other frameworks. If you prefer to use your own toolchain, disable it with:
|
|
145
|
-
|
|
146
|
-
```ts
|
|
147
|
-
askrVitePlugin({ transformJsx: false });
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
We believe the best frameworks are the ones you stop thinking about.
|
|
151
|
-
|
|
152
|
-
## Cancellation is not a feature
|
|
153
|
-
|
|
154
|
-
Askr doesn’t introduce a new cancellation concept. When work becomes stale (unmount, route replacement), the runtime aborts an `AbortController` and you should forward a cancellable `signal` into normal APIs. **Important:** route handlers are executed synchronously during navigation and must return a VNode — they must not be `async` functions that return a Promise. For async data use runtime helpers like `resource()` or perform async work inside component mount operations and use `getSignal()` for cancellation.
|
|
155
|
-
|
|
156
|
-
Example (recommended pattern):
|
|
157
|
-
|
|
158
|
-
```ts
|
|
159
|
-
import { route, resource } from '@askrjs/askr';
|
|
160
|
-
|
|
161
|
-
function User({ id }: { id: string }) {
|
|
162
|
-
const user = resource(async ({ signal }) => {
|
|
163
|
-
const res = await fetch(`/api/users/${id}`, { signal });
|
|
164
|
-
return res.json();
|
|
165
|
-
}, [id]);
|
|
166
|
-
|
|
167
|
-
if (user.pending) return <div>Loading...</div>;
|
|
168
|
-
return <pre>{JSON.stringify(user.value, null, 2)}</pre>;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
route('/user/{id}', ({ id }) => <User id={id} />);
|
|
172
|
-
```
|
|
173
|
-
|
|
174
68
|
## Principles
|
|
175
69
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
- lifecycles
|
|
183
|
-
- effects
|
|
184
|
-
- reactivity graphs
|
|
185
|
-
- schedulers
|
|
186
|
-
|
|
187
|
-
Askr teaches nothing.
|
|
188
|
-
|
|
189
|
-
### 2. JavaScript Is the Control Flow
|
|
190
|
-
|
|
191
|
-
Conditionals, loops, early returns, and `async/await` are sufficient.
|
|
192
|
-
|
|
193
|
-
We do not replace JavaScript with framework constructs.
|
|
194
|
-
If JS already expresses it clearly, we do not wrap it.
|
|
195
|
-
|
|
196
|
-
### 3. Determinism by Construction
|
|
197
|
-
|
|
198
|
-
Every state change has a cause.
|
|
199
|
-
Every render has a reason.
|
|
200
|
-
|
|
201
|
-
Askr enforces:
|
|
202
|
-
|
|
203
|
-
- serialized state transitions
|
|
204
|
-
- structured async
|
|
205
|
-
- deterministic rendering
|
|
206
|
-
|
|
207
|
-
Not by convention — by architecture.
|
|
208
|
-
|
|
209
|
-
### 4. Async Is Foundational, Not a Feature
|
|
210
|
-
|
|
211
|
-
Async is not an add-on.
|
|
212
|
-
It is the default.
|
|
213
|
-
|
|
214
|
-
`await` suspends execution.
|
|
215
|
-
Unmount cancels work.
|
|
216
|
-
No effects. No heuristics.
|
|
217
|
-
|
|
218
|
-
### 5. No Virtual DOM
|
|
219
|
-
|
|
220
|
-
Virtual DOM diffing compensates for non-determinism.
|
|
221
|
-
Askr removes the need for it.
|
|
222
|
-
|
|
223
|
-
We prefer:
|
|
224
|
-
|
|
225
|
-
- direct DOM ownership
|
|
226
|
-
- minimal mutation
|
|
227
|
-
- compiler assistance where useful
|
|
228
|
-
|
|
229
|
-
### 6. Ownership, Not Effects
|
|
230
|
-
|
|
231
|
-
Imperative code exists.
|
|
232
|
-
When it does, it must have an owner.
|
|
233
|
-
|
|
234
|
-
Askr provides structural hooks for:
|
|
235
|
-
|
|
236
|
-
- mount
|
|
237
|
-
- update
|
|
238
|
-
- cleanup
|
|
239
|
-
|
|
240
|
-
These hooks describe **ownership**, not reactivity.
|
|
241
|
-
|
|
242
|
-
### 7. SSR Is Normal Execution
|
|
243
|
-
|
|
244
|
-
Server rendering runs the same code as the client.
|
|
245
|
-
Hydration restores state — it does not guess.
|
|
246
|
-
|
|
247
|
-
No replays.
|
|
248
|
-
No warnings.
|
|
249
|
-
No mismatches.
|
|
250
|
-
|
|
251
|
-
### 8. Routing Is Explicit
|
|
252
|
-
|
|
253
|
-
URLs are not files.
|
|
254
|
-
Routes are functions.
|
|
255
|
-
|
|
256
|
-
Askr favors explicit, refactor-safe routing over conventions that break over time.
|
|
257
|
-
|
|
258
|
-
### 9. Components Are Not the Framework
|
|
259
|
-
|
|
260
|
-
Askr ships no UI components.
|
|
261
|
-
|
|
262
|
-
Components are userland.
|
|
263
|
-
Design systems evolve.
|
|
264
|
-
Runtimes should not.
|
|
265
|
-
|
|
266
|
-
### 10. Ergonomics Beat Flexibility
|
|
267
|
-
|
|
268
|
-
Askr optimizes for tired developers.
|
|
269
|
-
|
|
270
|
-
If something only works when you remember rules, it is broken.
|
|
271
|
-
The right thing must be the easiest thing.
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## Routing: `route()` (render-time accessor) 🔧
|
|
276
|
-
|
|
277
|
-
Askr exposes a synchronous, deterministic, read-only render-time route accessor:
|
|
278
|
-
|
|
279
|
-
- `route()` — can only be called during component render and returns a deeply frozen `RouteSnapshot` with:
|
|
280
|
-
- `path` (string)
|
|
281
|
-
- `params` (readonly record of path params)
|
|
282
|
-
- `query` (readonly helper with `get`, `getAll`, `has`, and `toJSON`)
|
|
283
|
-
- `hash` (string | null)
|
|
284
|
-
- `matches` (array of matching route patterns with params)
|
|
285
|
-
|
|
286
|
-
Invariants:
|
|
287
|
-
|
|
288
|
-
- `route()` throws if called outside render
|
|
289
|
-
- Snapshot is stable and deeply immutable for the duration of the render
|
|
290
|
-
- No subscriptions, no async reads, and works in SSR/hydration when `setServerLocation()` is used on the server
|
|
291
|
-
|
|
292
|
-
Example usage:
|
|
293
|
-
|
|
294
|
-
```ts
|
|
295
|
-
export function User() {
|
|
296
|
-
const { params } = route();
|
|
297
|
-
return <h1>User {params.id}</h1>;
|
|
298
|
-
}
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
SSR tip: use `setServerLocation(url)` in server rendering tests to ensure server and client values match during hydration.
|
|
302
|
-
|
|
303
|
-
## What Askr Refuses to Be
|
|
304
|
-
|
|
305
|
-
- A component library
|
|
306
|
-
- A DSL
|
|
307
|
-
- A configuration framework
|
|
308
|
-
- A committee-designed system
|
|
309
|
-
- A place where opinions leak into app code
|
|
310
|
-
|
|
311
|
-
## The Promise
|
|
312
|
-
|
|
313
|
-
If you forget how Askr works,
|
|
314
|
-
come back months later,
|
|
315
|
-
and can still build an app without rereading docs —
|
|
316
|
-
|
|
317
|
-
**Askr has succeeded.**
|
|
318
|
-
|
|
319
|
-
## One Rule Above All Others
|
|
320
|
-
|
|
321
|
-
> **If it takes a meeting to decide, the answer is no.**
|
|
322
|
-
|
|
323
|
-
Askr moves forward through use, not consensus.
|
|
324
|
-
|
|
325
|
-
## Askr
|
|
326
|
-
|
|
327
|
-
Write functions.
|
|
328
|
-
Render HTML.
|
|
329
|
-
Ship software.
|
|
330
|
-
|
|
331
|
-
Everything else is noise.
|
|
70
|
+
- Determinism: renders have causes and are reproducible.
|
|
71
|
+
- Explicit ownership & cancellation: runtime aborts stale work; forward `AbortSignal` to async APIs.
|
|
72
|
+
- Simple primitives: plain functions + JSX + async/await are the API.
|
|
73
|
+
- Minimal surface & pit‑of‑success for AI: predictable, small APIs that are easy to generate correctly.
|
|
74
|
+
- Invariants, tests & benches: documented invariants, explicit edge‑case coverage, and performance benches — behavior is tested and measurable, not a toy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {l,n,a,e,b}from'./chunk-
|
|
1
|
+
import {l,n,a,e,b}from'./chunk-FWVUNA6A.js';function C(l$1){let e=l();if(!e)throw new Error("state() can only be called during component render execution. Move state() calls to the top level of your component function.");let t=n(),s=e.stateValues;if(t<e.stateIndexCheck)throw new Error(`State index violation: state() call at index ${t}, but previously saw index ${e.stateIndexCheck}. This happens when state() is called conditionally (inside if/for/etc). Move all state() calls to the top level of your component function, before any conditionals.`);if(a(t>=e.stateIndexCheck,"[State] State indices must increase monotonically"),e.stateIndexCheck=t,e.firstRenderComplete){if(!e.expectedStateIndices.includes(t))throw new Error(`Hook order violation: state() called at index ${t}, but this index was not in the first render's sequence [${e.expectedStateIndices.join(", ")}]. This usually means state() is inside a conditional or loop. Move all state() calls to the top level of your component function.`)}else e.expectedStateIndices.push(t);if(s[t]){let n=s[t];if(n._owner!==e)throw new Error(`State ownership violation: state() called at index ${t} is owned by a different component instance. State ownership is positional and immutable.`);return n}let o=S(l$1,e);return s[t]=o,o}function S(l$1,e$1){let t=l$1,s=new Map;function o(){o._hasBeenRead=true;let n=l();return n&&n._currentRenderToken!==void 0&&(n._pendingReadStates||(n._pendingReadStates=new Set),n._pendingReadStates.add(o)),t}return o._readers=s,o._owner=e$1,o.set=n=>{if(l()!==null)throw new Error("[Askr] state.set() cannot be called during component render. State mutations during render break the actor model and cause infinite loops. Move state updates to event handlers or use conditional rendering instead.");let r;if(typeof n=="function"?r=n(t):r=n,Object.is(t,r))return;if(e()){t=r;return}t=r;let c=o._readers;if(c){for(let[a,m]of c)if(a.lastRenderToken===m&&!a.hasPendingUpdate){a.hasPendingUpdate=true;let p=a._pendingFlushTask;p?b.enqueue(p):b.enqueue(()=>{a.hasPendingUpdate=false,a.notifyUpdate?.();});}}let u=c?.get(e$1);if(u!==void 0&&e$1.lastRenderToken===u&&!e$1.hasPendingUpdate){e$1.hasPendingUpdate=true;let a=e$1._pendingFlushTask;a?b.enqueue(a):b.enqueue(()=>{e$1.hasPendingUpdate=false,e$1.notifyUpdate?.();});}},o}export{C as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-7EBQWZZJ.js';import {h,f}from'./chunk-FWVUNA6A.js';function m(t,n,a$1){let p=a(h(t,n,a$1?.by))();return {type:f,props:{source:t},_forState:p}}export{m as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-HGMOQ3I7.js';import {b}from'./chunk-37RC6ZT3.js';function pe(e,n,t){if(!e){let r=t?`
|
|
2
|
+
`+JSON.stringify(t,null,2):"";throw new Error(`[Askr Invariant] ${n}${r}`)}}function Re(e,n){pe(e,`[Scheduler Precondition] ${n}`);}function ee(){try{let e=globalThis.__ASKR_FASTLANE;return typeof e?.isBulkCommitActive=="function"?!!e.isBulkCommitActive():!1}catch(e){return false}}var he=class{constructor(){this.q=[];this.head=0;this.running=false;this.inHandler=false;this.depth=0;this.executionDepth=0;this.flushVersion=0;this.kickScheduled=false;this.allowSyncProgress=false;this.waiters=[];this.taskCount=0;}enqueue(n){Re(typeof n=="function","enqueue() requires a function"),!(ee()&&!this.allowSyncProgress)&&(this.q.push(n),this.taskCount++,!this.running&&!this.kickScheduled&&!this.inHandler&&!ee()&&(this.kickScheduled=true,queueMicrotask(()=>{if(this.kickScheduled=false,!this.running&&!ee())try{this.flush();}catch(t){setTimeout(()=>{throw t});}})));}flush(){pe(!this.running,"[Scheduler] flush() called while already running"),this.running=true,this.depth=0;let n=null;try{for(;this.head<this.q.length;){this.depth++;let t=this.q[this.head++];try{this.executionDepth++,t(),this.executionDepth--;}catch(r){this.executionDepth>0&&(this.executionDepth=0),n=r;break}this.taskCount>0&&this.taskCount--;}}finally{if(this.running=false,this.depth=0,this.executionDepth=0,this.head>=this.q.length)this.q.length=0,this.head=0;else if(this.head>0){let t=this.q.length-this.head;for(let r=0;r<t;r++)this.q[r]=this.q[this.head+r];this.q.length=t,this.head=0;}this.flushVersion++,this.resolveWaiters();}if(n)throw n}runWithSyncProgress(n){let t=this.allowSyncProgress;this.allowSyncProgress=true;let i=this.flushVersion;try{let a=n();return !this.running&&this.q.length-this.head>0&&this.flush(),a}finally{try{this.flushVersion===i&&(this.flushVersion++,this.resolveWaiters());}catch(a){}this.allowSyncProgress=t;}}waitForFlush(n,t=2e3){let r=typeof n=="number"?n:this.flushVersion+1;return this.flushVersion>=r?Promise.resolve():new Promise((o,s)=>{let i=setTimeout(()=>{let a=globalThis.__ASKR__||{},u={flushVersion:this.flushVersion,queueLen:this.q.length-this.head,running:this.running,inHandler:this.inHandler,bulk:ee(),namespace:a};s(new Error(`waitForFlush timeout ${t}ms: ${JSON.stringify(u)}`));},t);this.waiters.push({target:r,resolve:o,reject:s,timer:i});})}getState(){return {queueLength:this.q.length-this.head,running:this.running,depth:this.depth,executionDepth:this.executionDepth,taskCount:this.taskCount,flushVersion:this.flushVersion,inHandler:this.inHandler,allowSyncProgress:this.allowSyncProgress}}setInHandler(n){this.inHandler=n;}isInHandler(){return this.inHandler}isExecuting(){return this.running||this.executionDepth>0}clearPendingSyncTasks(){let n=this.q.length-this.head;return n<=0?0:this.running?(this.q.length=this.head,this.taskCount=Math.max(0,this.taskCount-n),queueMicrotask(()=>{try{this.flushVersion++,this.resolveWaiters();}catch(t){}}),n):(this.q.length=0,this.head=0,this.taskCount=Math.max(0,this.taskCount-n),this.flushVersion++,this.resolveWaiters(),n)}resolveWaiters(){if(this.waiters.length===0)return;let n=[],t=[];for(let r of this.waiters)this.flushVersion>=r.target?(r.timer&&clearTimeout(r.timer),n.push(r.resolve)):t.push(r);this.waiters=t;for(let r of n)r();}},N=new he;function we(){return N.isExecuting()}var xe=Symbol("__tempoContextFrame__"),ne=null;function q(e,n){let t=ne;ne=e;try{return n()}finally{ne=t;}}function Rt(e,n){try{return n()}finally{}}function Fe(){return ne}function Me(){try{let e=globalThis;return e.__ASKR_DIAG||(e.__ASKR_DIAG={}),e.__ASKR_DIAG}catch(e){return {}}}function T(e,n){try{let t=Me();t[e]=n;try{let r=globalThis;try{let o=r.__ASKR__||(r.__ASKR__={});try{o[e]=n;}catch(s){}}catch(o){}}catch(r){}}catch(t){}}function v(e){try{let n=Me(),r=(typeof n[e]=="number"?n[e]:0)+1;n[e]=r;try{let o=globalThis,s=o.__ASKR__||(o.__ASKR__={});try{let i=typeof s[e]=="number"?s[e]:0;s[e]=i+1;}catch(i){}}catch(o){}}catch(n){}}function j(e){return !e.startsWith("on")||e.length<=2?null:e.slice(2).charAt(0).toLowerCase()+e.slice(3).toLowerCase()}function $(e){if(e==="wheel"||e==="scroll"||e.startsWith("touch"))return {passive:true}}function W(e,n=false){return t=>{N.setInHandler(true);try{e(t);}catch(r){a.error("[Askr] Event handler error:",r);}finally{if(N.setInHandler(false),n){let r=N.getState();(r.queueLength??0)>0&&!r.running&&queueMicrotask(()=>{try{N.isExecuting()||N.flush();}catch(o){queueMicrotask(()=>{throw o});}});}}}}function ye(e){return e==="children"||e==="key"||e==="ref"}function te(e){return !!(e==="children"||e==="key"||e.startsWith("on")&&e.length>2||e.startsWith("data-"))}function _e(e,n,t){try{if(n==="class"||n==="className")return e.className!==String(t);if(n==="value"||n==="checked")return e[n]!==t;let r=e.getAttribute(n);return t==null||t===!1?r!==null:String(t)!==r}catch{return true}}function Ie(e){for(let n of Object.keys(e))if(!te(n))return true;return false}function Pe(e,n){for(let t of Object.keys(n))if(!te(t)&&_e(e,t,n[t]))return true;return false}function O(e){if(typeof e!="object"||e===null)return;let n=e,t=n.key??n.props?.key;if(t!==void 0)return typeof t=="symbol"?String(t):t}function Oe(e){let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}return n}function re(e){try{v("__DOM_REPLACE_COUNT"),T(`__LAST_DOM_REPLACE_STACK_${e}`,new Error().stack);}catch{}}function oe(e,n){try{T("__LAST_FASTPATH_STATS",e),T("__LAST_FASTPATH_COMMIT_COUNT",1),n&&v(n);}catch{}}function se(e,n,t){(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&(t!==void 0?a.warn(`[Askr][FASTPATH] ${e}`,n,t):n!==void 0?a.warn(`[Askr][FASTPATH] ${e}`,n):a.warn(`[Askr][FASTPATH] ${e}`));}function G(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}var S=new WeakMap;function ie(e){return S.get(e)}function De(e){try{if(S.has(e))return;let n=Oe(e);if(n.size===0){n=new Map;let t=Array.from(e.children);for(let r of t){let o=(r.textContent||"").trim();if(o){n.set(o,r);let s=Number(o);Number.isNaN(s)||n.set(s,r);}}}n.size>0&&S.set(e,n);}catch{}}var Ke=new WeakSet;function dn(e){let n=[];for(let t of e){let r=O(t);r!==void 0&&n.push({key:r,vnode:t});}return n}function fn(e){let n=[];for(let t of e){if(t===-1)continue;let r=0,o=n.length;for(;r<o;){let s=r+o>>1;n[s]<t?r=s+1:o=s;}r===n.length?n.push(t):n[r]=t;}return n.length}function mn(e){for(let{vnode:n}of e){if(typeof n!="object"||n===null)continue;let t=n;if(t.props&&Ie(t.props))return true}return false}function pn(e,n){for(let{key:t,vnode:r}of e){let o=n?.get(t);if(!o||typeof r!="object"||r===null)continue;let i=r.props||{};for(let a of Object.keys(i))if(!te(a)&&_e(o,a,i[a]))return true}return false}function L(e,n,t){let r=dn(n),o=r.length,s=r.map(h=>h.key),i=t?Array.from(t.keys()):[],a=0;for(let h=0;h<s.length;h++){let b=s[h];(h>=i.length||i[h]!==b||!t?.has(b))&&a++;}let f=o>=128&&i.length>0&&a>Math.max(64,Math.floor(o*.1)),l=false,c=0;if(o>=128){let h=Array.from(e.children),b=r.map(({key:F})=>{let P=t?.get(F);return P?.parentElement===e?h.indexOf(P):-1});c=fn(b),l=c<Math.floor(o*.5);}let m=mn(r),g=pn(r,t);return {useFastPath:(f||l)&&!g&&!m,totalKeyed:o,moveCount:a,lisLen:c,hasPropChanges:g}}var Ee=false,V=null;function Le(){Ee=true,V=new WeakSet;try{let e=N.clearPendingSyncTasks?.()??0;}catch{}}function Ve(){Ee=false,V=null;}function X(){return Ee}function Se(e){if(V)try{V.add(e);}catch(n){}}function hn(e){return !!(V&&V.has(e))}function gn(e){let n=e._pendingReadStates??new Set,t=e._lastReadStates??new Set,r=e._currentRenderToken;if(r!==void 0){for(let o of t)if(!n.has(o)){let s=o._readers;s&&s.delete(e);}e.lastRenderToken=r;for(let o of n){let s=o._readers;s||(s=new Map,o._readers=s),s.set(e,e.lastRenderToken??0);}e._lastReadStates=n,e._pendingReadStates=new Set,e._currentRenderToken=void 0;}}function yn(e){if(!e||typeof e!="object"||!("type"in e))return e;let n=e;if(typeof n.type=="symbol"&&(n.type===b||String(n.type)==="Symbol(askr.fragment)")){let t=n.children||n.props?.children;if(Array.isArray(t)&&t.length>0){for(let r of t)if(r&&typeof r=="object"&&"type"in r&&typeof r.type=="string")return r}}return e}function _n(e,n){let t=yn(n);if(!t||typeof t!="object"||!("type"in t))return {useFastPath:false,reason:"not-vnode"};let r=t;if(r==null||typeof r.type!="string")return {useFastPath:false,reason:"not-intrinsic"};let o=e.target;if(!o)return {useFastPath:false,reason:"no-root"};let s=o.children[0];if(!s)return {useFastPath:false,reason:"no-first-child"};if(s.tagName.toLowerCase()!==String(r.type).toLowerCase())return {useFastPath:false,reason:"root-tag-mismatch"};let i=r.children||r.props?.children;if(!Array.isArray(i))return {useFastPath:false,reason:"no-children-array"};for(let d of i)if(typeof d=="object"&&d!==null&&"type"in d&&typeof d.type=="function")return {useFastPath:false,reason:"component-child-present"};if(e.mountOperations.length>0)return {useFastPath:false,reason:"pending-mounts"};try{De(s);}catch{}let a=ie(s),u=L(s,i,a);return !u.useFastPath||u.totalKeyed<128?{...u,useFastPath:false,reason:"renderer-declined"}:{...u,useFastPath:true}}function En(e,n){let t=globalThis.__ASKR_RENDERER?.evaluate;if(typeof t!="function")return a.warn("[Tempo][FASTPATH][DEV] renderer.evaluate not available; declining fast-lane"),false;Le();try{N.runWithSyncProgress(()=>{t(n,e.target);try{gn(e);}catch{}});let o=N.clearPendingSyncTasks?.()??0;return !0}finally{Ve();}}function Sn(e,n){if(!_n(e,n).useFastPath)return false;try{return En(e,n)}catch{return false}}typeof globalThis<"u"&&(globalThis.__ASKR_FASTLANE={isBulkCommitActive:X,enterBulkCommit:Le,exitBulkCommit:Ve,tryRuntimeFastLaneSync:Sn,markFastPathApplied:Se,isFastPathApplied:hn});var z=Symbol("__FOR_BOUNDARY__");function A(e){return typeof e=="object"&&e!==null&&"type"in e}function He(e,n,t){let r=e.__ASKR_INSTANCE;if(r){try{qe(r);}catch(o){a.warn("[Askr] cleanupComponent failed:",o);}try{delete e.__ASKR_INSTANCE;}catch(o){}}}function Ue(e,n){try{let r=e.ownerDocument,o=r?.createTreeWalker;if(typeof o=="function"){let s=o.call(r,e,1),i=s.firstChild();for(;i;)n(i),i=s.nextNode();return}}catch{}let t=e.querySelectorAll("*");for(let r=0;r<t.length;r++)n(t[r]);}function R(e,n){if(!e||!(e instanceof Element))return;let t=false,r=null;try{He(e,r,t);}catch(o){a.warn("[Askr] cleanupInstanceIfPresent failed:",o);}try{Ue(e,o=>{try{He(o,r,t);}catch(s){t?r.push(s):a.warn("[Askr] cleanupInstanceIfPresent descendant cleanup failed:",s);}});}catch(o){a.warn("[Askr] cleanupInstanceIfPresent descendant query failed:",o);}}function ke(e,n){R(e);}var C=new WeakMap;function Be(e){let n=C.get(e);if(n){for(let[t,r]of n)r.options!==void 0?e.removeEventListener(t,r.handler,r.options):e.removeEventListener(t,r.handler);C.delete(e);}}function M(e){e&&(Be(e),Ue(e,Be));}var k=globalThis;function ue(e,n){}var An=(e,n)=>e!=null&&typeof e=="object"&&"id"in e?e.id:n;function zt(e,n,t){let r=typeof e=="function"?null:e,o=Y();return {sourceState:r,items:new Map,orderedKeys:[],byFn:t||An,renderFn:n,parentInstance:o,mounted:false}}var je=1;function $e(e,n,t,r){let o=t,s=Object.assign(()=>o,{set(c){let m=typeof c=="function"?c(o):c;m!==o&&(o=m);}}),i=()=>null,a=ce(`for-item-${e}`,i,{},null);r.parentInstance&&(a.ownerFrame=r.parentInstance.ownerFrame);let u=Y();J(a);let d=We();a._currentRenderToken=je++,a._pendingReadStates=new Set;let f=r.renderFn(n,()=>s());D(a),J(u);let l={key:e,item:n,indexSignal:s,componentInstance:a,vnode:f,_startStateIndex:d};return a._pendingFlushTask=()=>{let c=Y();J(a),a.stateIndexCheck=-1;let m=a.stateValues;for(let p=0;p<m.length;p++){let h=m[p];h&&(h._hasBeenRead=false);}Ge(d),a._currentRenderToken=je++,a._pendingReadStates=new Set;try{let p=r.renderFn(n,()=>s());l.vnode=p,D(a);}finally{J(c);}let g=r.parentInstance;g&&g._enqueueRun?.();},l}function bn(e,n){let t=k.__ASKR_BENCH__?performance.now():0,{items:r,orderedKeys:o,byFn:s}=e,i=o.length,a=n.length;if(i<=a){let l=true;for(let c=0;c<i;c++)if(s(n[c],c)!==o[c]){l=false;break}if(l){let c=[];for(let m=0;m<i;m++){let g=n[m],p=o[m],h=r.get(p);let b=h.item!==g,F=h.indexSignal()!==m;if(b){h.item=g;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=h.componentInstance,h.vnode=e.renderFn(g,()=>h.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}F&&h.indexSignal.set(m),c.push(h.vnode);}for(let m=i;m<a;m++){let g=n[m],p=s(g,m),h=$e(p,g,m,e);r.set(p,h),c.push(h.vnode),o[m]=p;}return k.__ASKR_BENCH__&&ue("reconcile",performance.now()-t),c}}if(a<=i){let l=true;for(let c=0;c<a;c++)if(s(n[c],c)!==o[c]){l=false;break}if(l){let c=[];for(let m=0;m<a;m++){let g=n[m],p=o[m],h=r.get(p);let b=h.item!==g,F=h.indexSignal()!==m;if(b){h.item=g;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=h.componentInstance,h.vnode=e.renderFn(g,()=>h.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}F&&h.indexSignal.set(m),c.push(h.vnode);}for(let m=a;m<i;m++){let g=o[m],p=r.get(g);if(p){let h=p.componentInstance;h.abortController.abort();for(let b of h.cleanupFns)try{b();}catch{}r.delete(g);}}return o.length=a,e.orderedKeys=o,k.__ASKR_BENCH__&&ue("reconcile",performance.now()-t),c}}if(i===a){let l=true;for(let c=0;c<i;c++)if(s(n[c],c)!==o[c]){l=false;break}if(l){let c=[];for(let m=0;m<i;m++){let g=n[m],p=o[m],h=r.get(p);let b=h.item!==g,F=h.indexSignal()!==m;if(b){h.item=g;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=h.componentInstance;let cn=e.renderFn(g,()=>h.indexSignal());h.vnode=cn,k.__ASKR_CURRENT_INSTANCE__=P;}F&&h.indexSignal.set(m),c.push(h.vnode);}return k.__ASKR_BENCH__&&ue("reconcile",performance.now()-t),c}}let u=new Set(o),d=[],f=[];for(let l=0;l<n.length;l++){let c=n[l],m=s(c,l);u.delete(m),d.push(m);let g=r.get(m);if(g){let p=g.item!==c,h=g.indexSignal()!==l;if(p){g.item=c;let b=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=g.componentInstance,g.vnode=e.renderFn(c,()=>g.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=b;}h&&g.indexSignal.set(l),f.push(g.vnode);}else {let p=$e(m,c,l,e);r.set(m,p),f.push(p.vnode);}}for(let l of u){let c=r.get(l);if(c){let m=c.componentInstance;m.abortController.abort();for(let g of m.cleanupFns)try{g();}catch{}r.delete(l);}}return e.orderedKeys=d,k.__ASKR_BENCH__&&ue("reconcile",performance.now()-t),f}function le(e,n){let t=n();if(!Array.isArray(t))throw new Error("For source must evaluate to an array");return bn(e,t)}var Tn=typeof document<"u",Xe=0;function Cn(){let e="__COMPONENT_INSTANCE_ID";try{v(e);let t=globalThis.__ASKR_DIAG,r=t?t[e]:void 0;if(typeof r=="number"&&Number.isFinite(r))return `comp-${r}`}catch{}return Xe++,`comp-${Xe}`}function Nn(e,n,t){let r=W(t,true),o=$(n);o!==void 0?e.addEventListener(n,r,o):e.addEventListener(n,r),C.has(e)||C.set(e,new Map),C.get(e).set(n,{handler:r,original:t,options:o});}function vn(e,n,t){for(let r in n){let o=n[r];if(r==="ref"){Rn(e,o);continue}if(ye(r)||o==null||o===false)continue;let s=j(r);if(s){Nn(e,s,o);continue}r==="class"||r==="className"?e.className=String(o):r==="value"||r==="checked"?wn(e,r,o,t):e.setAttribute(r,String(o));}}function Rn(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function wn(e,n,t,r){n==="value"?((Q(r,"input")||Q(r,"textarea")||Q(r,"select"))&&(e.value=String(t)),e.setAttribute("value",String(t))):n==="checked"&&(Q(r,"input")&&(e.checked=!!t),e.setAttribute("checked",String(!!t)));}function ze(e,n,t){let r=n.key??t?.key;r!==void 0&&e.setAttribute("data-key",String(r));}function _(e){if(!Tn)return null;if(typeof e=="string")return document.createTextNode(e);if(typeof e=="number")return document.createTextNode(String(e));if(!e)return null;if(Array.isArray(e)){let n=document.createDocumentFragment();for(let t of e){let r=_(t);r&&n.appendChild(r);}return n}if(typeof e=="object"&&e!==null&&"type"in e){let n=e.type,t=e.props||{};if(typeof n=="string")return xn(e,n,t);if(typeof n=="function")return Fn(e,n,t);if(n===z)return Pn(e,t);if(typeof n=="symbol"&&(n===b||String(n)==="Symbol(Fragment)"))return Mn(e,t)}return null}function xn(e,n,t){let r=document.createElement(n);ze(r,e,t),vn(r,t,n);let o=t.children??e.children;if(o!=null)if(Array.isArray(o)){for(let s of o){let i=_(s);i&&r.appendChild(i);}}else {let s=_(o);s&&r.appendChild(s);}return r}function Fn(e,n,t){let o=e[xe]||Fe(),s=n;if(s.constructor.name==="AsyncFunction")throw new Error("Async components are not supported. Use resource() for async work.");let a=e.__instance;a||(a=ce(Cn(),s,t||{},null),e.__instance=a),o&&(a.ownerFrame=o);let u=q(o,()=>Qe(a));if(u instanceof Promise)throw new Error("Async components are not supported. Components must return synchronously.");let d=q(o,()=>_(u));if(d instanceof Element)return be(a,d),d;if(!d){let l=document.createComment("");return a._placeholder=l,a.mounted=true,a.notifyUpdate=a._enqueueRun,l}let f=document.createElement("div");return f.appendChild(d),be(a,f),f}function Mn(e,n){let t=document.createDocumentFragment(),r=n.children||e.children;if(r)if(Array.isArray(r))for(let o of r){let s=_(o);s&&t.appendChild(s);}else {let o=_(r);o&&t.appendChild(o);}return t}function In(e,n){return !A(e)||!A(n)?true:e.type!==n.type}function Pn(e,n){let t=e._forState;if(!t)return document.createDocumentFragment();let r=n.source,o=le(t,r),s=[],i=false;for(let u=0;u<o.length;u++){let d=o[u],f=d.key,l=null;if(f!=null&&t.items.has(f)){let c=t.items.get(f);c._dom&&!In(c.vnode,d)&&(l=c._dom);}l||(l=_(d),i=true,f!=null&&t.items.has(f)&&(t.items.get(f)._dom=l??void 0)),s.push(l);}!i&&s.length!==t.orderedKeys.length&&(i=true);let a=document.createDocumentFragment();for(let u=0;u<o.length;u++){let d=o[u],f=d.key,l=s[u];if(l){f!=null&&t.items.has(f)&&t.items.get(f)._dom===l&&I(l,d,true);try{a.appendChild(l);}catch{let c=_(d);c&&(a.appendChild(c),f!=null&&t.items.has(f)&&(t.items.get(f)._dom=c??void 0));}}}return a}function I(e,n,t=true){if(!A(n))return;let r=n.props||{};ze(e,n,r);let o=C.get(e),s=null;for(let i in r){let a=r[i];if(ye(i))continue;let u=j(i);if(a==null||a===false){if(i==="class"||i==="className")e.className="";else if(u&&o?.has(u)){let d=o.get(u);d.options!==void 0?e.removeEventListener(u,d.handler,d.options):e.removeEventListener(u,d.handler),o.delete(u);}else e.removeAttribute(i);continue}if(i==="class"||i==="className")e.className=String(a);else if(i==="value"||i==="checked")e[i]=a;else if(u){o&&o.size>0&&(s??=new Set).add(u);let d=o?.get(u);if(d&&d.original===a)continue;d&&(d.options!==void 0?e.removeEventListener(u,d.handler,d.options):e.removeEventListener(u,d.handler));let f=W(a,true),l=$(u);l!==void 0?e.addEventListener(u,f,l):e.addEventListener(u,f),C.has(e)||C.set(e,new Map),C.get(e).set(u,{handler:f,original:a,options:l});}else e.setAttribute(i,String(a));}if(o&&o.size>0)if(s===null){for(let[i,a]of o)a.options!==void 0?e.removeEventListener(i,a.handler,a.options):e.removeEventListener(i,a.handler);C.delete(e);}else {for(let[i,a]of o)s.has(i)||(a.options!==void 0?e.removeEventListener(i,a.handler,a.options):e.removeEventListener(i,a.handler),o.delete(i));o.size===0&&C.delete(e);}if(t){let i=n.children||r.children;On(e,i);}}function On(e,n){if(!n){e.textContent="";return}if(!Array.isArray(n)&&(typeof n=="string"||typeof n=="number")){e.childNodes.length===1&&e.firstChild?.nodeType===3?e.firstChild.data=String(n):e.textContent=String(n);return}if(Array.isArray(n)){Te(e,n);return}e.textContent="";let t=_(n);t&&e.appendChild(t);}function Te(e,n){let t=Array.from(e.children),r=n.some(i=>typeof i=="string"||typeof i=="number"),o=n.some(i=>A(i));if(r&&o){let i=Array.from(e.childNodes),a=Math.max(i.length,n.length);for(let u=0;u<a;u++){let d=i[u],f=n[u];if(f===void 0&&d){d.nodeType===1&&R(d),d.remove();continue}if(!d&&f!==void 0){let l=_(f);l&&e.appendChild(l);continue}if(!(!d||f===void 0)){if(typeof f=="string"||typeof f=="number")if(d.nodeType===3)d.data=String(f);else {let l=document.createTextNode(String(f));e.replaceChild(l,d);}else if(A(f))if(d.nodeType===1){let l=d;if(typeof f.type=="string")if(B(l.tagName,f.type))I(l,f);else {let c=_(f);c&&(M(l),R(l),e.replaceChild(c,d));}}else {let l=_(f);l&&e.replaceChild(l,d);}}}return}if(n.length===1&&t.length===0&&e.childNodes.length===1){let i=n[0],a=e.firstChild;if((typeof i=="string"||typeof i=="number")&&a?.nodeType===3){a.data=String(i);return}}t.length===0&&e.childNodes.length>0&&(e.textContent="");let s=Math.max(t.length,n.length);for(let i=0;i<s;i++){let a=t[i],u=n[i];if(u===void 0&&a){R(a),a.remove();continue}if(!a&&u!==void 0){let d=_(u);d&&e.appendChild(d);continue}if(!(!a||u===void 0))if(typeof u=="string"||typeof u=="number")a.textContent=String(u);else if(A(u))if(typeof u.type=="string")if(B(a.tagName,u.type))I(a,u);else {let d=_(u);d&&(a instanceof Element&&M(a),R(a),e.replaceChild(d,a));}else {let d=_(u);d&&(a instanceof Element&&M(a),R(a),e.replaceChild(d,a));}else {let d=_(u);d&&(a instanceof Element&&M(a),R(a),e.replaceChild(d,a));}}}function de(e,n){let t=n.length,r=0,o=0,s=G(),i=process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true";for(let d=0;d<t;d++){let{key:f,vnode:l}=n[d],c=e.children[d];if(c&&A(l)&&typeof l.type=="string"){let m=l.type;if(B(c.tagName,m)){let g=l.children||l.props?.children;i&&se("positional idx",d,{chTag:c.tagName,vnodeType:m,chChildNodes:c.childNodes.length,childrenType:Array.isArray(g)?"array":typeof g}),Dn(c,g,l),Ln(c,f,()=>o++),r++;continue}else i&&se("positional tag mismatch",d,{chTag:c.tagName,vnodeType:m});}else i&&se("positional missing or invalid",d,{ch:!!c});Hn(e,d,l);}let a=G()-s;Bn(e,n);let u={n:t,reused:r,updatedKeys:o,t:a};return oe(u,"bulkKeyedPositionalHits"),u}function Dn(e,n,t){typeof n=="string"||typeof n=="number"?H(e,String(n)):Array.isArray(n)&&n.length===1&&(typeof n[0]=="string"||typeof n[0]=="number")?H(e,String(n[0])):Kn(e,t)||I(e,t);}function Kn(e,n){let t=n.children||n.props?.children;if(!Array.isArray(t)||t.length!==2)return false;let r=t[0],o=t[1];if(!A(r)||!A(o)||typeof r.type!="string"||typeof o.type!="string")return false;let s=e.children[0],i=e.children[1];if(!s||!i||!B(s.tagName,r.type)||!B(i.tagName,o.type))return false;let a=r.children||r.props?.children,u=o.children||o.props?.children;if(typeof a=="string"||typeof a=="number")H(s,String(a));else if(Array.isArray(a)&&a.length===1&&(typeof a[0]=="string"||typeof a[0]=="number"))H(s,String(a[0]));else return false;if(typeof u=="string"||typeof u=="number")H(i,String(u));else if(Array.isArray(u)&&u.length===1&&(typeof u[0]=="string"||typeof u[0]=="number"))H(i,String(u[0]));else return false;return true}function H(e,n){e.childNodes.length===1&&e.firstChild?.nodeType===3?e.firstChild.data=n:e.textContent=n;}function Ln(e,n,t){try{let r=String(n);if(e.getAttribute("data-key")===r)return;e.setAttribute("data-key",r),t();}catch{}}function Vn(e){switch(e){case "div":return "DIV";case "span":return "SPAN";case "p":return "P";case "a":return "A";case "button":return "BUTTON";case "input":return "INPUT";case "ul":return "UL";case "ol":return "OL";case "li":return "LI";default:return null}}function Q(e,n){if(e===n)return true;let t=e.length;if(t!==n.length)return false;for(let r=0;r<t;r++){let o=e.charCodeAt(r),s=n.charCodeAt(r);if(o===s)continue;let i=o>=65&&o<=90?o+32:o,a=s>=65&&s<=90?s+32:s;if(i!==a)return false}return true}function B(e,n){let t=Vn(n);return t!==null&&e===t?true:Q(e,n)}function Hn(e,n,t){let r=_(t);if(r){let o=e.children[n];o?(R(o),e.replaceChild(r,o)):e.appendChild(r);}}function Bn(e,n){try{let t=S.get(e),r=t?(t.clear(),t):new Map;for(let o=0;o<n.length;o++){let s=n[o].key,i=e.children[o];i&&r.set(s,i);}S.set(e,r);}catch{}}function Je(e,n){let t=G(),r=Array.from(e.childNodes),o=[],s=0,i=0;for(let f=0;f<n.length;f++){let l=Un(n[f],r[f],o);l==="reused"?s++:l==="created"&&i++;}let a=G()-t,u=$n(e,o);S.delete(e);let d={n:n.length,reused:s,created:i,tBuild:a,tCommit:u};return Wn(d),d}function Un(e,n,t){return typeof e=="string"||typeof e=="number"?qn(String(e),n,t):typeof e=="object"&&e!==null&&"type"in e?jn(e,n,t):"skipped"}function qn(e,n,t){return n&&n.nodeType===3?(n.data=e,t.push(n),"reused"):(t.push(document.createTextNode(e)),"created")}function jn(e,n,t){let r=e;if(typeof r.type=="string"){let s=r.type;if(n&&n.nodeType===1&&B(n.tagName,s))return I(n,e),t.push(n),"reused"}let o=_(e);return o?(t.push(o),"created"):"skipped"}function $n(e,n){let t=Date.now(),r=document.createDocumentFragment();for(let o=0;o<n.length;o++)r.appendChild(n[o]);try{for(let o=e.firstChild;o;){let s=o.nextSibling;o instanceof Element&&M(o),R(o),o=s;}}catch{}return re("bulk-text-replace"),e.replaceChildren(r),Date.now()-t}function Wn(e){try{T("__LAST_BULK_TEXT_FASTPATH_STATS",e),T("__LAST_FASTPATH_STATS",e),T("__LAST_FASTPATH_COMMIT_COUNT",1),v("bulkTextFastpathHits");}catch{}}function Ye(e,n){let t=Number(process.env.ASKR_BULK_TEXT_THRESHOLD)||1024,r=.8,o=Array.isArray(n)?n.length:0;if(o<t)return Ae({phase:"bulk-unkeyed-eligible",reason:"too-small",total:o,threshold:t}),false;let s=Gn(n);if(s.componentFound!==void 0)return Ae({phase:"bulk-unkeyed-eligible",reason:"component-child",index:s.componentFound}),false;let i=s.simple/o,a=i>=r&&e.childNodes.length>=o;return Ae({phase:"bulk-unkeyed-eligible",total:o,simple:s.simple,fraction:i,requiredFraction:r,eligible:a}),a}function Gn(e){let n=0;for(let t=0;t<e.length;t++){let r=e[t];if(typeof r=="string"||typeof r=="number"){n++;continue}if(typeof r=="object"&&r!==null&&"type"in r){let o=r;if(typeof o.type=="function")return {simple:n,componentFound:t};typeof o.type=="string"&&Xn(o)&&n++;}}return {simple:n}}function Xn(e){let n=e.children||e.props?.children;return !!(!n||typeof n=="string"||typeof n=="number"||Array.isArray(n)&&n.length===1&&(typeof n[0]=="string"||typeof n[0]=="number"))}function Ae(e){if(process.env.ASKR_FASTPATH_DEBUG==="1")try{T("__BULK_DIAG",e);}catch{}}function Ze(e,n,t,r){if(typeof document>"u")return null;let o=n.length;if(o===0&&(!r||r.length===0))return null;we()||a.warn("[Askr][FASTPATH][DEV] Fast-path reconciliation invoked outside scheduler execution");let s,i;if(o<=20)try{let l=e.children;s=new Array(l.length);for(let c=0;c<l.length;c++)s[c]=l[c];}catch(l){s=void 0;}else {i=new Map;try{for(let l=e.firstElementChild;l;l=l.nextElementSibling){let c=l.getAttribute("data-key");if(c!==null){i.set(c,l);let m=Number(c);Number.isNaN(m)||i.set(m,l);}}}catch(l){i=void 0;}}let a$1=[],u=0,d=0,f=0;for(let l=0;l<n.length;l++){let{key:c,vnode:m}=n[l];u++;let g;if(o<=20&&s){let p=String(c);for(let h=0;h<s.length;h++){let b=s[h],F=b.getAttribute("data-key");if(F!==null&&(F===p||Number(F)===c)){g=b;break}}g||(g=t?.get(c));}else g=i?.get(c)??t?.get(c);if(g)a$1.push(g),f++;else {let p=_(m);p&&(a$1.push(p),d++);}}if(r&&r.length)for(let l of r){let c=_(l);c&&(a$1.push(c),d++);}try{let l=Date.now(),c=document.createDocumentFragment(),m=0;for(let p=0;p<a$1.length;p++)c.appendChild(a$1[p]),m++;try{for(let p=e.firstChild;p;){let h=p.nextSibling;p instanceof Element&&M(p),R(p),p=h;}}catch(p){}try{v("__DOM_REPLACE_COUNT"),T("__LAST_DOM_REPLACE_STACK_FASTPATH",new Error().stack);}catch(p){}e.replaceChildren(c);try{T("__LAST_FASTPATH_COMMIT_COUNT",1);}catch(p){}try{X()&&Se(e);}catch(p){}let g=new Map;for(let p=0;p<n.length;p++){let h=n[p].key,b=a$1[p];b instanceof Element&&g.set(h,b);}try{let p={n:o,moves:0,lisLen:0,t_lookup:0,t_fragment:Date.now()-l,t_commit:0,t_bookkeeping:0,fragmentAppendCount:m,mapLookups:u,createdNodes:d,reusedCount:f};typeof globalThis<"u"&&(T("__LAST_FASTPATH_STATS",p),T("__LAST_FASTPATH_REUSED",f>0),v("fastpathHistoryPush")),(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH]",JSON.stringify({n:o,createdNodes:d,reusedCount:f}));}catch(p){}try{Ke.add(e);}catch(p){}return g}catch(l){return null}}function fe(e,n){if(e===n)return true;if(e.length!==n.length)return false;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t),o=n.charCodeAt(t);if(r===o)continue;let s=r>=65&&r<=90?r+32:r,i=o>=65&&o<=90?o+32:o;if(s!==i)return false}return true}function Z(e,n,t){let{keyedVnodes:r,unkeyedVnodes:o}=Jn(n),s=t||zn(e),i=Yn(e,n,r,o,s);return i||rt(e,n,r,s)}function zn(e){let n=new Map;try{for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}}catch{}return n}function Jn(e){let n=[],t=[];for(let r=0;r<e.length;r++){let o=e[r],s=O(o);s!==void 0?n.push({key:s,vnode:o}):t.push(o);}return {keyedVnodes:n,unkeyedVnodes:t}}function Yn(e,n,t,r,o){try{let s=Qn(e,n,t,r,o);if(s)return s;let i=Zn(e,t);if(i)return i}catch{}return null}function Qn(e,n,t,r,o){if(L(e,n,o).useFastPath&&t.length>=128||X())try{let i=Ze(e,t,o,r);if(i)return S.set(e,i),i}catch{}return null}function Zn(e,n){let t=n.length;if(t<10||e.children.length!==t||et(e,n)/t<.9||nt(e,n))return null;try{let o=de(e,n);return oe(o,"bulkKeyedPositionalHits"),tt(e),S.get(e)}catch{return null}}function et(e,n){let t=0;try{for(let r=0;r<n.length;r++){let o=n[r].vnode;if(!o||typeof o!="object"||typeof o.type!="string")continue;let s=e.children[r];s&&fe(s.tagName,o.type)&&t++;}}catch{}return t}function nt(e,n){try{for(let t=0;t<n.length;t++){let r=n[t].vnode,o=e.children[t];if(!(!o||!r||typeof r!="object")&&Pe(o,r.props||{}))return !0}}catch{return true}return false}function tt(e){try{let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}S.set(e,n);}catch{}}function rt(e,n,t,r){let o=new Map,s=[],i=new WeakSet,a=ot(e,r,i);for(let u=0;u<n.length;u++){let d=n[u],f=it(d,u,e,a,i,o);f&&s.push(f);}return typeof document>"u"||(ft(e,s),S.delete(e)),o}function ot(e,n,t){return r=>{if(!n)return;let o=n.get(r);if(o&&!t.has(o))return t.add(o),o;let s=String(r),i=n.get(s);if(i&&!t.has(i))return t.add(i),i;let a=Number(s);if(!Number.isNaN(a)){let u=n.get(a);if(u&&!t.has(u))return t.add(u),u}return st(e,r,s,t)}}function st(e,n,t,r){try{for(let o=e.firstElementChild;o;o=o.nextElementSibling){if(r.has(o))continue;let s=o.getAttribute("data-key");if(s===t)return r.add(o),o;if(s!==null){let i=Number(s);if(!Number.isNaN(i)&&i===n)return r.add(o),o}}}catch{}}function it(e,n,t,r,o,s){let i=O(e);return i!==void 0?at(e,i,t,r,s):ut(e,n,t,o)}function at(e,n,t,r,o){let s=r(n);if(s&&s.parentElement===t)try{let a=e;if(a&&typeof a=="object"&&typeof a.type=="string"&&fe(s.tagName,a.type))return I(s,e),o.set(n,s),s}catch{}let i=_(e);return i?(i instanceof Element&&o.set(n,i),i):null}function ut(e,n,t,r){try{let s=t.childNodes[n];if((typeof e=="string"||typeof e=="number")&&s&&s.nodeType===3)return s.data=String(e),r.add(s),s;if(s instanceof Element&<(s,e))return I(s,e),r.add(s),s;let i=ct(t,r);if(i){let a=dt(i,e,r);if(a)return a}}catch{}return _(e)}function lt(e,n){if(!e||typeof n!="object"||n===null||!("type"in n))return false;let t=n,r=e.getAttribute("data-key");return r==null&&typeof t.type=="string"&&fe(e.tagName,t.type)}function ct(e,n){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(!n.has(t)&&t.getAttribute("data-key")===null)return t}function dt(e,n,t){if(typeof n=="string"||typeof n=="number")return e.textContent=String(n),t.add(e),e;if(typeof n=="object"&&n!==null&&"type"in n){let r=n;if(typeof r.type=="string"&&fe(e.tagName,r.type))return I(e,n),t.add(e),e}return null}function ft(e,n){let t=document.createDocumentFragment();for(let r=0;r<n.length;r++)t.appendChild(n[r]);try{for(let r=e.firstChild;r;){let o=r.nextSibling;r instanceof Element&&M(r),R(r),r=o;}}catch{}re("reconcile"),e.replaceChildren(t);}var Ce=new WeakMap;function Ne(e,n){if(e===n)return true;if(e.length!==n.length)return false;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t),o=n.charCodeAt(t);if(r===o)continue;let s=r>=65&&r<=90?r+32:r,i=o>=65&&o<=90?o+32:o;if(s!==i)return false}return true}function mt(e){if(Array.isArray(e)){if(e.length===1){let n=e[0];if(typeof n=="string"||typeof n=="number")return {isSimple:true,text:String(n)}}}else if(typeof e=="string"||typeof e=="number")return {isSimple:true,text:String(e)};return {isSimple:false}}function pt(e,n){return e.childNodes.length===1&&e.firstChild?.nodeType===3?(e.firstChild.data=n,true):false}function nn(e){let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}return n}function tn(e){let n=S.get(e);return n||(n=nn(e),n.size>0&&S.set(e,n)),n.size>0?n:void 0}function rn(e){for(let n=0;n<e.length;n++)if(O(e[n])!==void 0)return true;return false}function on(e,n,t){if(process.env.ASKR_FORCE_BULK_POSREUSE==="1"&&ht(e,n))return;let r=Z(e,n,t);S.set(e,r);}function ht(e,n){try{let t=[];for(let s of n)A(s)&&s.key!==void 0&&t.push({key:s.key,vnode:s});if(t.length===0||t.length!==n.length)return !1;(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH] forced positional bulk keyed reuse (evaluate-level)");let r=de(e,t);if(process.env.ASKR_FASTPATH_DEBUG==="1")try{T("__LAST_FASTPATH_STATS",r),T("__LAST_FASTPATH_COMMIT_COUNT",1),v("bulkKeyedPositionalForced");}catch{}let o=nn(e);return S.set(e,o),!0}catch(t){return (process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH] forced bulk path failed, falling back",t),false}}function gt(e,n){if(Ye(e,n)){Je(e,n);}else Te(e,n);S.delete(e);}function yt(e,n){let t=n._forState;if(!t)return;let r=(n.props||{}).source,o=le(t,r);if(o.length>0){let s=tn(e);try{on(e,o,s);}catch{let i=Z(e,o,s);S.set(e,i);}}else e.textContent="",S.delete(e);}function en(e,n){if(!n){e.textContent="",S.delete(e);return}if(!Array.isArray(n)&&A(n)&&n.type===z){yt(e,n);return}if(!Array.isArray(n)){e.textContent="";let t=_(n);t&&e.appendChild(t),S.delete(e);return}if(rn(n)){let t=tn(e);try{on(e,n,t);}catch{let r=Z(e,n,t);S.set(e,r);}}else gt(e,n);}function ve(e,n){let t=n.children||n.props?.children;if(t&&A(t)&&t.type===z){en(e,t),I(e,n,false);return}t&&!Array.isArray(t)&&(t=[t]);let r=mt(t);r.isSimple&&pt(e,r.text)||en(e,t),I(e,n,false);}function _t(e,n){let t=e.firstElementChild;for(let r=0;r<n.length;r++){let o=n[r],s=t?t.nextElementSibling:null;if(t&&A(o)&&typeof o.type=="string"&&Ne(t.tagName,o.type)){ve(t,o),t=s;continue}let i=_(o);i&&(t?e.replaceChild(i,t):e.appendChild(i)),t=s;}for(;t;){let r=t.nextElementSibling;e.removeChild(t),t=r;}}function Et(e,n){for(let[t,r]of Object.entries(n)){if(t==="children"||t==="key"||r==null||r===false)continue;if(t==="ref"){St(e,r);continue}let o=j(t);if(o){let s=W(r,true),i=$(o);i!==void 0?e.addEventListener(o,s,i):e.addEventListener(o,s),C.has(e)||C.set(e,new Map),C.get(e).set(o,{handler:s,original:r,options:i});continue}t==="class"||t==="className"?e.className=String(r):t==="value"||t==="checked"?e[t]=r:e.setAttribute(t,String(r));}}function St(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function kt(e,n){let t=n.children;if(!Array.isArray(t)||!rn(t))return false;let r=document.createElement(n.type);e.appendChild(r),Et(r,n.props||{});let o=Z(r,t,void 0);return S.set(r,o),true}function At(e){return A(e)&&typeof e.type=="symbol"&&(e.type===b||String(e.type)==="Symbol(askr.fragment)")}function bt(e){let n=e.props?.children||e.children||[];return Array.isArray(n)?n:[n]}function U(e,n,t){if(n&&!(typeof document>"u"))if(t&&Ce.has(t)){let r=Ce.get(t),o=r.start.nextSibling;for(;o&&o!==r.end;){let i=o.nextSibling;o.remove(),o=i;}let s=_(e);s&&n.insertBefore(s,r.end);}else if(t){let r=document.createComment("component-start"),o=document.createComment("component-end");n.appendChild(r),n.appendChild(o),Ce.set(t,{start:r,end:o});let s=_(e);s&&n.insertBefore(s,o);}else {let r=e;if(At(r)){let a=bt(r);if(a.length===1&&A(a[0])&&typeof a[0].type=="string")r=a[0];else {_t(n,a);return}}let s=n.__ASKR_INSTANCE;if(s&&s.target===n)if(A(r)&&typeof r.type=="string"&&Ne(n.tagName,r.type)){ve(n,r);return}else {let a=_(r);if(a&&n.parentNode){a instanceof Element&&(a.__ASKR_INSTANCE=s,s.target=a),M(n),n.parentNode.replaceChild(a,n);return}}let i=n.children[0];if(i&&A(r)&&typeof r.type=="string"&&Ne(i.tagName,r.type))ve(i,r);else {if(n.textContent="",A(r)&&typeof r.type=="string"&&kt(n,r))return;let a=_(r);a&&n.appendChild(a);}}}if(typeof globalThis<"u"){let e=globalThis;e.__ASKR_RENDERER={evaluate:U,isKeyedReorderFastPathEligible:L,getKeyMapForElement:ie};}function ce(e,n,t,r){let o={id:e,fn:n,props:t,target:r,mounted:false,abortController:new AbortController,stateValues:[],evaluationGeneration:0,notifyUpdate:null,_pendingFlushTask:void 0,_pendingRunTask:void 0,_enqueueRun:void 0,stateIndexCheck:-1,expectedStateIndices:[],firstRenderComplete:false,mountOperations:[],cleanupFns:[],hasPendingUpdate:false,ownerFrame:null,ssr:false,cleanupStrict:false,isRoot:false,_currentRenderToken:void 0,lastRenderToken:0,_pendingReadStates:new Set,_lastReadStates:new Set};return o._pendingRunTask=()=>{o.hasPendingUpdate=false,un(o);},o._enqueueRun=()=>{o.hasPendingUpdate||(o.hasPendingUpdate=true,N.enqueue(o._pendingRunTask));},o._pendingFlushTask=()=>{o.hasPendingUpdate=false,o._enqueueRun?.();},o}var x=null,me=0;function Jr(){return x}function J(e){x=e;}function sn(e){if(e.isRoot){for(let n of e.mountOperations){let t=n();t instanceof Promise?t.then(r=>{typeof r=="function"&&e.cleanupFns.push(r);}):typeof t=="function"&&e.cleanupFns.push(t);}e.mountOperations=[];}}function be(e,n){e.target=n;try{n instanceof Element&&(n.__ASKR_INSTANCE=e);}catch(r){}e.notifyUpdate=e._enqueueRun;let t=!e.mounted;e.mounted=true,t&&e.mountOperations.length>0&&sn(e);}var an=0;function un(e){e.notifyUpdate=e._enqueueRun,e._currentRenderToken=++an,e._pendingReadStates=new Set;let n=e.target?e.target.innerHTML:"",t=ln(e);if(t instanceof Promise)throw new Error("Async components are not supported. Components must be synchronous.");{let r=globalThis.__ASKR_FASTLANE;try{if(r?.tryRuntimeFastLaneSync?.(e,t))return}catch{}N.enqueue(()=>{if(!e.target&&e._placeholder){if(t==null){D(e);return}let o=e._placeholder,s=o.parentNode;if(!s){a.warn("[Askr] placeholder no longer in DOM, cannot render component");return}let i=document.createElement("div"),a$1=x;x=e;try{U(t,i),s.replaceChild(i,o),e.target=i,e._placeholder=void 0,i.__ASKR_INSTANCE=e,D(e);}finally{x=a$1;}return}if(e.target){let o=[];try{let s=!e.mounted,i=x;x=e,o=Array.from(e.target.childNodes);try{U(t,e.target);}catch(a$1){try{let u=Array.from(e.target.childNodes);for(let d of u)try{ke(d);}catch(f){a.warn("[Askr] error cleaning up failed commit children:",f);}}catch(u){}try{v("__DOM_REPLACE_COUNT"),T("__LAST_DOM_REPLACE_STACK_COMPONENT_RESTORE",new Error().stack);}catch(u){}throw e.target.replaceChildren(...o),a$1}finally{x=i;}D(e),e.mounted=!0,s&&e.mountOperations.length>0&&sn(e);}catch(s){try{let i=Array.from(e.target.childNodes);for(let a$1 of i)try{ke(a$1);}catch(u){a.warn("[Askr] error cleaning up partial children during rollback:",u);}}catch(i){}try{try{v("__DOM_REPLACE_COUNT"),T("__LAST_DOM_REPLACE_STACK_COMPONENT_ROLLBACK",new Error().stack);}catch(i){}e.target.replaceChildren(...o);}catch{e.target.innerHTML=n;}throw s}}});}}function Qe(e){let n=e._currentRenderToken!==void 0,t=e._currentRenderToken,r=e._pendingReadStates;n||(e._currentRenderToken=++an,e._pendingReadStates=new Set);try{let o=ln(e);return n||D(e),o}finally{e._currentRenderToken=t,e._pendingReadStates=r??new Set;}}function ln(e){e.stateIndexCheck=-1;for(let n of e.stateValues)n&&(n._hasBeenRead=false);e._pendingReadStates=new Set,x=e,me=0;try{let t={signal:e.abortController.signal},r={parent:e.ownerFrame,values:null},o=q(r,()=>e.fn(e.props,t)),s=Date.now()-0;s>5&&a.warn(`[askr] Slow render detected: ${s}ms. Consider optimizing component performance.`),e.firstRenderComplete||(e.firstRenderComplete=!0);for(let i=0;i<e.stateValues.length;i++){let a$1=e.stateValues[i];if(a$1&&!a$1._hasBeenRead)try{let u=e.fn?.name||"<anonymous>";a.warn(`[askr] Unused state variable detected in ${u} at index ${i}. State should be read during render or removed.`);}catch{a.warn("[askr] Unused state variable detected. State should be read during render or removed.");}}return o}finally{x=null;}}function Tt(e){e.abortController=new AbortController,e.notifyUpdate=e._enqueueRun,N.enqueue(()=>un(e));}function Y(){return x}function Qr(){if(!x)throw new Error("getSignal() can only be called during component render execution. Ensure you are calling this from inside your component function.");return x.abortController.signal}function D(e){let n=e._pendingReadStates??new Set,t=e._lastReadStates??new Set,r=e._currentRenderToken;if(r!==void 0){for(let o of t)if(!n.has(o)){let s=o._readers;s&&s.delete(e);}e.lastRenderToken=r;for(let o of n){let s=o._readers;s||(s=new Map,o._readers=s),s.set(e,e.lastRenderToken??0);}e._lastReadStates=n,e._pendingReadStates=new Set,e._currentRenderToken=void 0;}}function Zr(){return me++}function We(){return me}function Ge(e){me=e;}function eo(e){Tt(e);}function qe(e){let n=[];for(let t of e.cleanupFns)try{t();}catch(r){e.cleanupStrict&&n.push(r);}if(e.cleanupFns=[],n.length>0)throw new AggregateError(n,`Cleanup failed for component ${e.id}`);if(e._lastReadStates){for(let t of e._lastReadStates){let r=t._readers;r&&r.delete(e);}e._lastReadStates=new Set;}e.abortController.abort(),e.notifyUpdate=null,e.mounted=false;}export{pe as a,N as b,Rt as c,Fe as d,X as e,z as f,M as g,zt as h,ce as i,Jr as j,J as k,Y as l,Qr as m,Zr as n,eo as o,qe as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,l}from'./chunk-
|
|
1
|
+
import {b,l}from'./chunk-YJMBDYNG.js';import {p,o}from'./chunk-FWVUNA6A.js';var e=null;function f(n,t){e=n,b();}function c(n){if(typeof window>"u")return;let t=l(n);t&&(window.history.pushState({path:n},"",n),e&&(p(e),e.fn=t.handler,e.props=t.params,e.stateValues=[],e.expectedStateIndices=[],e.firstRenderComplete=false,e.stateIndexCheck=-1,e.evaluationGeneration++,e.notifyUpdate=null,e.abortController=new AbortController,o(e)));}function s(n){let t=window.location.pathname;if(!e)return;let o$1=l(t);o$1&&(p(e),e.fn=o$1.handler,e.props=o$1.params,e.stateValues=[],e.expectedStateIndices=[],e.firstRenderComplete=false,e.stateIndexCheck=-1,e.evaluationGeneration++,e.notifyUpdate=null,e.abortController=new AbortController,o(e));}function u(){typeof window<"u"&&window.addEventListener("popstate",s);}function m(){typeof window<"u"&&window.removeEventListener("popstate",s);}export{f as a,c as b,u as c,m as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'./chunk-D2JSJKCW.js';import {j as j$1}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-D2JSJKCW.js';import {j as j$1}from'./chunk-FWVUNA6A.js';import {c}from'./chunk-62D2TNHX.js';var q={};c(q,{_lockRouteRegistrationForTests:()=>T,_unlockRouteRegistrationForTests:()=>U,clearRoutes:()=>C,getLoadedNamespaces:()=>F,getNamespaceRoutes:()=>Q,getRoutes:()=>W,lockRouteRegistration:()=>L,registerRoute:()=>_,resolveRoute:()=>J,route:()=>S,setServerLocation:()=>O,unloadNamespace:()=>j});function h(e,r){let o=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e,i=r.endsWith("/")&&r!=="/"?r.slice(0,-1):r,t=o.split("/").filter(Boolean),n=i.split("/").filter(Boolean);if(n.length===1&&n[0]==="*")return {matched:true,params:{"*":t.length>1?o:t[0]}};if(t.length!==n.length)return {matched:false,params:{}};let s={};for(let a=0;a<n.length;a++){let c=n[a],u=t[a];if(c.startsWith("{")&&c.endsWith("}")){let f=c.slice(1,-1);s[f]=decodeURIComponent(u);}else if(c==="*")s["*"]=u;else if(c!==u)return {matched:false,params:{}}}return {matched:true,params:s}}var l=[],g=new Set,P=Symbol.for("__ASKR_HAS_ROUTES__");function b(e){try{let r=globalThis;r[P]=e;}catch{}}b(false);var p=new Map;function z(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;return r==="/"?0:r.split("/").filter(Boolean).length}function v(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;if(r==="/*")return 0;let o=r.split("/").filter(Boolean),i=0;for(let t of o)t.startsWith("{")&&t.endsWith("}")?i+=2:t==="*"?i+=1:i+=3;return i}var w=null;function O(e){w=e;}function M(e){try{let r=new URL(e,"http://localhost");return {pathname:r.pathname,search:r.search,hash:r.hash}}catch{return {pathname:"/",search:"",hash:""}}}function m(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e)){let o=e[r];o&&typeof o=="object"&&m(o);}}return e}function N(e){let r=new URLSearchParams(e||""),o=new Map;for(let[t,n]of r.entries()){let s=o.get(t);s?s.push(n):o.set(t,[n]);}return m({get(t){let n=o.get(t);return n?n[0]:null},getAll(t){let n=o.get(t);return n?[...n]:[]},has(t){return o.has(t)},toJSON(){let t={};for(let[n,s]of o.entries())t[n]=s.length>1?[...s]:s[0];return t}})}function B(e){let r=W(),o=[];function i(t){let n=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;if(n==="/*")return 0;let s=n.split("/").filter(Boolean),a=0;for(let c of s)c.startsWith("{")&&c.endsWith("}")?a+=2:c==="*"?a+=1:a+=3;return a}for(let t of r){let n=h(e,t.path);n.matched&&o.push({pattern:t.path,params:n.params,name:t.name,namespace:t.namespace,specificity:i(t.path)});}return o.sort((t,n)=>n.specificity-t.specificity),o.map(t=>({path:t.pattern,params:m({...t.params}),name:t.name,namespace:t.namespace}))}var d=false;function L(){d=true;}function T(){d=true;}function U(){d=false;}function S(e,r,o){if(a()==="islands")throw new Error("Routes are not supported with islands. Use createSPA (client) or createSSR (server) instead.");if(typeof e>"u"){let a=j$1();if(!a)throw new Error("route() can only be called during component render execution. Call route() from inside your component function.");let c="/",u="",f="";if(typeof window<"u"&&window.location)c=window.location.pathname||"/",u=window.location.search||"",f=window.location.hash||"";else if(w){let R=M(w);c=R.pathname,u=R.search,f=R.hash;}let A=m({...a.props||{}}),D=N(u),E=B(c);return Object.freeze({path:c,params:A,query:D,hash:f||null,matches:Object.freeze(E)})}let i=j$1();if(i&&i.ssr)throw new Error("route() cannot be called during SSR rendering. Register routes at module load time instead.");if(d)throw new Error("Route registration is locked after app startup. Register routes at module load time before calling createSPA or createSSR.");if(typeof r!="function")throw new Error("route(path, handler) requires a function handler that returns a VNode (e.g. () => <Page />). Passing JSX elements or VNodes directly is not supported.");let t={path:e,handler:r,namespace:o};l.push(t),b(true);let n=z(e),s=p.get(n);s||(s=[],p.set(n,s)),s.push(t),o&&g.add(o);}function W(){return [...l]}function Q(e){return l.filter(r=>r.namespace===e)}function j(e){let r=l.length;for(let o=l.length-1;o>=0;o--)if(l[o].namespace===e){let i=l[o];l.splice(o,1);let t=z(i.path),n=p.get(t);if(n){let s=n.indexOf(i);s>=0&&n.splice(s,1);}}return g.delete(e),r-l.length}function C(){l.length=0,g.clear(),p.clear(),d=false,b(false);}function k(e){if(e!=null&&typeof e=="function")return (r,o)=>{try{return e(r,o)}catch{return e(r)}}}function _(e,r,...o){let i=!e.startsWith("/"),t={path:e,handler:r,children:o.filter(Boolean),_isDescriptor:true};if(!i){let n=k(r);if(r!=null&&!n)throw new Error("registerRoute(path, handler) requires a function handler. Passing JSX elements or VNodes directly is not supported.");n&&S(e,n);for(let s of t.children||[]){let c=`${e==="/"?"":e.replace(/\/$/,"")}/${s.path.replace(/^\//,"")}`.replace(/\/\//g,"/");if(s.handler){let u=k(s.handler);if(!u)throw new Error("registerRoute child handler must be a function. Passing JSX elements directly is not supported.");u&&S(c,u);}s.children&&s.children.length&&_(c,null,...s.children);}return t}return t}function F(){return Array.from(g)}function J(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e,o=r==="/"?0:r.split("/").filter(Boolean).length,i=[],t=p.get(o);if(t)for(let n of t){let s=h(e,n.path);s.matched&&i.push({route:n,specificity:v(n.path),params:s.params});}for(let n of l){if(t?.includes(n))continue;let s=h(e,n.path);s.matched&&i.push({route:n,specificity:v(n.path),params:s.params});}if(i.sort((n,s)=>s.specificity-n.specificity),i.length>0){let n=i[0];return {handler:n.route.handler,params:n.params}}return null}
|
|
2
2
|
export{O as a,L as b,T as c,U as d,S as e,W as f,Q as g,j as h,C as i,_ as j,F as k,J as l,q as m};
|
package/dist/for/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as For}from'../chunk-
|
|
1
|
+
export{a as For}from'../chunk-F2JOQXH7.js';import'../chunk-7EBQWZZJ.js';import'../chunk-FWVUNA6A.js';import'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import'../chunk-37RC6ZT3.js';import'../chunk-62D2TNHX.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunk-
|
|
1
|
+
import {a}from'../chunk-7EBQWZZJ.js';import {c}from'../chunk-HZKAD5DE.js';export{i as applyInteractionPolicy,c as ariaDisabled,d as ariaExpanded,e as ariaSelected,a as composeHandlers,g as composeRefs,k as layout,j as mergeInteractionProps,b as mergeProps,h as pressable,f as setRef}from'../chunk-HZKAD5DE.js';import {b,a as a$1}from'../chunk-4RTKQ7SC.js';export{d as DefaultPortal,c as definePortal}from'../chunk-4RTKQ7SC.js';import'../chunk-FWVUNA6A.js';import'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import {b as b$1,a as a$2}from'../chunk-37RC6ZT3.js';import'../chunk-62D2TNHX.js';function w(e){return `${e.prefix??"askr"}-${String(e.id)}`}function F({node:e,disabled:o,onDismiss:n}){function r(l){o||l.key==="Escape"&&(l.preventDefault?.(),l.stopPropagation?.(),n?.("escape"));}function s(l){if(o)return;let t=l.target;t instanceof Node&&e&&(e.contains(t)||n?.("outside"));}return {onKeyDown:r,onPointerDownCapture:s}}function M({disabled:e,tabIndex:o}){return {tabIndex:e?-1:o===void 0?0:o,...c(e)}}function H({disabled:e,onEnter:o,onLeave:n}){return {onPointerEnter:e?void 0:r=>{o?.(r);},onPointerLeave:e?void 0:r=>{n?.(r);}}}function A(e){let{currentIndex:o,itemCount:n,orientation:r="horizontal",loop:s=false,onNavigate:l,isDisabled:t}=e;function i(u,p){let a=u+p;if(s)a<0&&(a=n-1),a>=n&&(a=0);else if(a<0||a>=n)return;return t?.(a)?a===u?void 0:i(a,p):a}function d(u){let{key:p}=u,a;if((r==="horizontal"||r==="both")&&(p==="ArrowRight"&&(a=1),p==="ArrowLeft"&&(a=-1)),(r==="vertical"||r==="both")&&(p==="ArrowDown"&&(a=1),p==="ArrowUp"&&(a=-1)),a===void 0)return;let f=i(o,a);f!==void 0&&(u.preventDefault?.(),u.stopPropagation?.(),l?.(f));}return {container:{onKeyDown:d},item:u=>({tabIndex:u===o?0:-1,"data-roving-index":u})}}function T(e){return e!==void 0}function g(e,o){let n=T(e);return {value:n?e:o,isControlled:n}}function K(e){let{value:o,defaultValue:n,onChange:r,setInternal:s}=e,{isControlled:l}=g(o,n);function t(i){l||s?.(i),r?.(i);}return {set:t,isControlled:l}}function J(e){let o=a(e.defaultValue),n=e.value!==void 0;function r(){return n?e.value:o()}return r.set=s=>{let l=r(),t=typeof s=="function"?s(l):s;if(!Object.is(l,t)){if(n){e.onChange?.(t);return}o.set(s),e.onChange?.(t);}},r.isControlled=n,r}function X(e){if(e.asChild){let{children:n,asChild:r,...s}=e;return a$1(n)?b(n,s):null}return {$$typeof:a$2,type:b$1,props:{children:e.children},key:null}}function z({present:e,children:o}){return (typeof e=="function"?e():!!e)?{$$typeof:a$2,type:b$1,props:{children:o},key:null}:null}function $(){let e=new Map;function o(l,t){let i={node:l,metadata:t};return e.set(l,i),()=>{e.delete(l);}}function n(){return Array.from(e.values())}function r(){e.clear();}function s(){return e.size}return {register:o,items:n,clear:r,size:s}}function j(){let e=[],o=1;function n(t){let i=o++,d={id:i,options:t};e.push(d);function u(){return e[e.length-1]?.id===i}function p(){let a=e.findIndex(f=>f.id===i);a!==-1&&e.splice(a,1);}return {id:i,isTop:u,unregister:p}}function r(){return e.map(t=>({id:t.id,isTop:()=>e[e.length-1]?.id===t.id,unregister:()=>{let i=e.findIndex(d=>d.id===t.id);i!==-1&&e.splice(i,1);}}))}function s(){let t=e[e.length-1];t&&t.options.onEscape?.();}function l(t){let i=e[e.length-1];if(!i)return;let d=i.options.node;d&&t.target instanceof Node&&d.contains(t.target)||i.options.onOutsidePointer?.(t);}return {register:n,layers:r,handleEscape:s,handleOutsidePointer:l}}export{z as Presence,X as Slot,J as controllableState,$ as createCollection,j as createLayer,F as dismissable,M as focusable,w as formatId,H as hoverable,T as isControlled,K as makeControllable,g as resolveControllable,A as rovingFocus};
|
package/dist/fx/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,b as b$1}from'../chunk-
|
|
1
|
+
import {j,b as b$1}from'../chunk-FWVUNA6A.js';import {a}from'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import'../chunk-37RC6ZT3.js';import'../chunk-62D2TNHX.js';function k(l,t,n){let e=null,{leading:r=false,trailing:i=true}=n||{},o=null,u=null,a=0,s=function(...f){let c=Date.now();o=f,u=this,e!==null&&clearTimeout(e),r&&c-a>=t&&(l.apply(this,f),a=c),i&&(e=setTimeout(()=>{l.apply(u,o),e=null,a=Date.now();},t));};return s.cancel=()=>{e!==null&&(clearTimeout(e),e=null);},s}function E(l,t,n){let e=0,r=null,{leading:i=true,trailing:o=true}=n||{},u=null,a=null,s=function(...f){let c=Date.now();u=f,a=this,i&&c-e>=t?(l.apply(this,f),e=c,r!==null&&(clearTimeout(r),r=null)):!i&&e===0&&(e=c),o&&r===null&&(r=setTimeout(()=>{l.apply(a,u),e=Date.now(),r=null;},t-(c-e)));};return s.cancel=()=>{r!==null&&(clearTimeout(r),r=null);},s}function x(l){let t=false,n;return((...e)=>(t||(t=true,n=l(...e)),n))}function g(l){Promise.resolve().then(l);}function F(l){let t=null,n=null,e=null;return function(...r){n=r,e=this,t===null&&(t=requestAnimationFrame(()=>{l.apply(e,n),t=null;}));}}function I(l,t){typeof requestIdleCallback<"u"?requestIdleCallback(l,t?{timeout:t.timeout}:void 0):Promise.resolve().then(()=>{setTimeout(l,0);});}function b(l){return new Promise(t=>setTimeout(t,l))}async function R(l,t){let{maxAttempts:n=3,delayMs:e=100,backoff:r=o=>e*Math.pow(2,o)}=t||{},i=null;for(let o=0;o<n;o++)try{return await l()}catch(u){if(i=u,o<n-1){let a=r(o);await b(a);}}throw i||new Error("Retry failed")}var h=Object.assign(l=>{},{cancel(){}}),y=Object.assign(l=>{},{cancel(){},flush(){}});function p(){if(j()!==null)throw new Error("[Askr] calling FX handler during render is not allowed. Move calls to event handlers or effects.")}function d(l){b$1.enqueue(()=>{try{l();}catch(t){a.error("[Askr] FX handler error:",t);}});}function C(l,t,n){let{leading:e=false,trailing:r=true}=n||{},i=j();if(i&&i.ssr)return y;let o=null,u=null,a=0,s=function(f){p();let c=Date.now();u=f,o!==null&&(clearTimeout(o),o=null),e&&c-a>=l&&(d(()=>t.call(null,f)),a=c),r&&(o=setTimeout(()=>{u&&d(()=>t.call(null,u)),o=null,a=Date.now();},l));};return s.cancel=()=>{o!==null&&(clearTimeout(o),o=null),u=null;},s.flush=()=>{if(o!==null){clearTimeout(o);let f=u;u=null,o=null,f&&d(()=>t.call(null,f));}},i&&i.cleanupFns.push(()=>{s.cancel();}),s}function A(l,t,n){let{leading:e=true,trailing:r=true}=n||{},i=j();if(i&&i.ssr)return h;let o=0,u=null,a=null,s=function(f){p();let c=Date.now();if(a=f,e&&c-o>=l?(d(()=>t.call(null,f)),o=c,u!==null&&(clearTimeout(u),u=null)):!e&&o===0&&(o=c),r&&u===null){let w=l-(c-o);u=setTimeout(()=>{a&&d(()=>t.call(null,a)),o=Date.now(),u=null;},Math.max(0,w));}};return s.cancel=()=>{u!==null&&(clearTimeout(u),u=null),a=null;},i&&i.cleanupFns.push(()=>s.cancel()),s}function L(l){let t=j();if(t&&t.ssr)return h;let n=null,e=null,r=()=>{n=(typeof requestAnimationFrame<"u"?requestAnimationFrame:u=>setTimeout(()=>u(Date.now()),16))(()=>{if(n=null,e){let u=e;e=null,d(()=>l.call(null,u));}});},i=function(o){p(),e=o,n===null&&r();};return i.cancel=()=>{n!==null&&(typeof cancelAnimationFrame<"u"&&typeof n=="number"?cancelAnimationFrame(n):clearTimeout(n),n=null),e=null;},t&&t.cleanupFns.push(()=>i.cancel()),i}function q(l,t){p();let n=j();if(n&&n.ssr)return ()=>{};let e=setTimeout(()=>{e=null,d(t);},l),r=()=>{e!==null&&(clearTimeout(e),e=null);};return n&&n.cleanupFns.push(r),r}function D(l,t){p();let n=j();if(n&&n.ssr)return ()=>{};let e=null,r=false;typeof requestIdleCallback<"u"?(r=true,e=requestIdleCallback(()=>{e=null,d(l);},t)):e=setTimeout(()=>{e=null,d(l);},0);let i=()=>{e!==null&&(r&&typeof cancelIdleCallback<"u"&&typeof e=="number"?cancelIdleCallback(e):clearTimeout(e),e=null);};return n&&n.cleanupFns.push(i),i}function O(l,t){p();let n=j();if(n&&n.ssr)return {cancel:()=>{}};let{maxAttempts:e=3,delayMs:r=100,backoff:i=s=>r*Math.pow(2,s)}=t||{},o=false,u=s=>{o||b$1.enqueue(()=>{if(o)return;l().then(()=>{},()=>{if(!o&&s+1<e){let c=i(s);setTimeout(()=>{u(s+1);},c);}}).catch(c=>{a.error("[Askr] scheduleRetry error:",c);});});};u(0);let a$1=()=>{o=true;};return n&&n.cleanupFns.push(a$1),{cancel:a$1}}export{k as debounce,C as debounceEvent,g as defer,I as idle,x as once,F as raf,L as rafEvent,R as retry,D as scheduleIdle,O as scheduleRetry,q as scheduleTimeout,E as throttle,A as throttleEvent,b as timeout};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as For}from'./chunk-
|
|
1
|
+
export{a as For}from'./chunk-F2JOQXH7.js';export{a as state}from'./chunk-7EBQWZZJ.js';import {d}from'./chunk-4RTKQ7SC.js';import {b}from'./chunk-D2JSJKCW.js';import {j,g,p,i,o,b as b$1}from'./chunk-FWVUNA6A.js';import'./chunk-HGMOQ3I7.js';import'./chunk-BP2CKUO6.js';import {a,b as b$2}from'./chunk-37RC6ZT3.js';import'./chunk-62D2TNHX.js';var R=Symbol.for("__ASKR_HAS_ROUTES__");var N=0,l=new WeakMap,A=Symbol.for("__tempoCleanup__");function k(e,n){e[A]=()=>{let t=[];try{g(e);}catch(o){t.push(o);}try{let o=e.querySelectorAll("*");for(let s of Array.from(o))try{let r=s.__ASKR_INSTANCE;if(r){try{p(r);}catch(a){t.push(a);}try{delete s.__ASKR_INSTANCE;}catch(a){t.push(a);}}}catch(r){t.push(r);}}catch(o){t.push(o);}try{p(n);}catch(o){t.push(o);}if(t.length>0&&n.cleanupStrict)throw new AggregateError(t,"cleanup failed for app root")};try{let t=Object.getOwnPropertyDescriptor(e,"innerHTML")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"innerHTML")||Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML");t&&(t.get||t.set)&&Object.defineProperty(e,"innerHTML",{get:t.get?function(){return t.get.call(this)}:void 0,set:function(o){if(o===""&&l.get(this)===n){try{g(e);}catch(s){if(n.cleanupStrict)throw s}try{p(n);}catch(s){if(n.cleanupStrict)throw s}}if(t.set)return t.set.call(this,o)},configurable:!0});}catch{}}function w(e,n,t){let o$1=(a$1,c)=>{let i=n(a$1,c),d$1={$$typeof:a,type:d,props:{},key:"__default_portal"};return {$$typeof:a,type:b$2,props:{children:i==null?[d$1]:[i,d$1]}}};Object.defineProperty(o$1,"name",{value:n.name||"Component"});let s=e[A];s&&s();let r=l.get(e);if(r){g(e);try{p(r);}catch{}r.fn=o$1,r.evaluationGeneration++,r.mounted=false,r.expectedStateIndices=[],r.firstRenderComplete=false,r.isRoot=true,t&&typeof t.cleanupStrict=="boolean"&&(r.cleanupStrict=t.cleanupStrict);}else {let a=String(++N);r=i(a,o$1,{},e),l.set(e,r),r.isRoot=true,t&&typeof t.cleanupStrict=="boolean"&&(r.cleanupStrict=t.cleanupStrict);}k(e,r),o(r),b$1.flush();}function L(e){if(b("islands"),!e||typeof e!="object")throw new Error("createIsland requires a config object");if(typeof e.component!="function")throw new Error("createIsland: component must be a function");let n=typeof e.root=="string"?document.getElementById(e.root):e.root;if(!n)throw new Error(`Root element not found: ${e.root}`);if("routes"in e)throw new Error("createIsland does not accept routes; use createSPA for routed apps");try{if(globalThis[R])throw new Error("Routes are not supported with islands. Use createSPA (client) or createSSR (server) instead.")}catch{}w(n,e.component,{cleanupStrict:e.cleanupStrict});}async function M(e){if(b("spa"),!e||typeof e!="object")throw new Error("createSPA requires a config object");if(!Array.isArray(e.routes)||e.routes.length===0)throw new Error("createSPA requires a route table. If you are enhancing existing HTML, use createIsland instead.");let n=typeof e.root=="string"?document.getElementById(e.root):e.root;if(!n)throw new Error(`Root element not found: ${e.root}`);let{clearRoutes:t,route:o,lockRouteRegistration:s,resolveRoute:r}=await import('./route-33ZUATUA.js');t();for(let p of e.routes)o(p.path,p.handler,p.namespace);s();let a=typeof window<"u"?window.location.pathname:"/",c=r(a);if(!c){w(n,()=>({type:"div",children:[]}),{cleanupStrict:false});let{registerAppInstance:p,initializeNavigation:b}=await import('./navigate-Y45U4P2H.js'),E=l.get(n);if(!E)throw new Error("Internal error: app instance missing");p(E,a),b();return}w(n,c.handler,{cleanupStrict:false});let{registerAppInstance:i,initializeNavigation:d}=await import('./navigate-Y45U4P2H.js'),y=l.get(n);if(!y)throw new Error("Internal error: app instance missing");i(y,a),d();}var O=new WeakMap;function _(e){let n=O.get(e);return n||(n=new Map,O.set(e,n)),n}function H(e,n){if(n===void 0&&typeof e=="function"){let a=e();if(a==null)return null;let c=j();if(!c)return a;let i=_(c);return i.has(a)?i.get(a):(i.set(a,a),a)}let t;if(typeof e=="function"&&!("value"in e)?t=e():t=e?.value??e,t==null)return null;let o=j();if(!o)return n(t);let s=_(o);if(s.has(t))return s.get(t);let r=n(t);return s.set(t,r),r}export{L as createIsland,M as createSPA,H as derive};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{d as cleanupNavigation,c as initializeNavigation,b as navigate,a as registerAppInstance}from'./chunk-XFCLEDZK.js';import'./chunk-YJMBDYNG.js';import'./chunk-D2JSJKCW.js';import'./chunk-FWVUNA6A.js';import'./chunk-HGMOQ3I7.js';import'./chunk-BP2CKUO6.js';import'./chunk-37RC6ZT3.js';import'./chunk-62D2TNHX.js';
|
package/dist/resources/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunk-
|
|
1
|
+
import {a}from'../chunk-7EBQWZZJ.js';import {c,a as a$1}from'../chunk-YRY4OLQF.js';import {j,d as d$1,b,c as c$1}from'../chunk-FWVUNA6A.js';export{m as getSignal}from'../chunk-FWVUNA6A.js';import {a as a$2}from'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import'../chunk-37RC6ZT3.js';import'../chunk-62D2TNHX.js';var d=class{constructor(o,a,i){this.value=null;this.pending=true;this.error=null;this.generation=0;this.controller=null;this.deps=null;this.resourceFrame=null;this.subscribers=new Set;this.fn=o,this.deps=a?a.slice():null,this.resourceFrame=i,this.snapshot={value:null,pending:true,error:null,refresh:()=>this.refresh()};}subscribe(o){return this.subscribers.add(o),()=>this.subscribers.delete(o)}notifySubscribers(){this.snapshot.value=this.value,this.snapshot.pending=this.pending,this.snapshot.error=this.error;for(let o of this.subscribers)o();}start(o=false,a=true){let i=this.generation;this.controller?.abort();let l=new AbortController;this.controller=l,this.pending=true,this.error=null,a&&this.notifySubscribers();let u;try{u=c$1(this.resourceFrame,()=>this.fn({signal:l.signal}));}catch(t){this.pending=false,this.error=t,a&&this.notifySubscribers();return}if(!(u instanceof Promise)){this.value=u,this.pending=false,this.error=null,a&&this.notifySubscribers();return}o&&c().throwSSRDataMissing(),u.then(t=>{this.generation===i&&this.controller===l&&(this.value=t,this.pending=false,this.error=null,this.notifySubscribers());}).catch(t=>{if(this.generation===i&&this.controller===l){this.pending=false,this.error=t;try{this.ownerName?a$2.error(`[Askr] Async resource error in ${this.ownerName}:`,t):a$2.error("[Askr] Async resource error:",t);}catch{}this.notifySubscribers();}});}refresh(){this.generation++,this.controller?.abort(),this.start();}abort(){this.controller?.abort();}};function x(b$1,o=[]){let a$2=j(),i=a$2;if(!a$2){let r=c(),e=r.getCurrentRenderData();if(e){let n=r.getNextKey();return n in e||r.throwSSRDataMissing(),{value:e[n],pending:false,error:null,refresh:()=>{}}}throw r.getCurrentSSRContext()&&r.throwSSRDataMissing(),new Error("[Askr] resource() must be called during component render inside an app. Do not create resources at module scope or outside render.")}let l=c(),u=l.getCurrentRenderData();if(u){let r=l.getNextKey();r in u||l.throwSSRDataMissing();let e=u[r],p=a({cell:void 0,snapshot:{value:e,pending:false,error:null,refresh:()=>{}}}),n=p();return n.snapshot.value=e,n.snapshot.pending=false,n.snapshot.error=null,p.set(n),n.snapshot}let t=a({cell:void 0,snapshot:{value:null,pending:true,error:null,refresh:()=>{}}}),c$1=t();if(!c$1.cell){let r=d$1(),e=new d(b$1,o,r);e.ownerName=i.fn?.name||"<anonymous>",c$1.cell=e,c$1.snapshot=e.snapshot;let p=e.subscribe(()=>{let n=t();n.snapshot.value=e.snapshot.value,n.snapshot.pending=e.snapshot.pending,n.snapshot.error=e.snapshot.error,t.set(n);try{i._enqueueRun?.();}catch{}});if(i.cleanupFns.push(()=>{p(),e.abort();}),i.ssr){if(e.start(true,false),!e.pending){let n=t();n.snapshot.value=e.value,n.snapshot.pending=e.pending,n.snapshot.error=e.error;}}else b.enqueue(()=>{try{e.start(!1,!1);}catch(n){let h=t();h.snapshot.value=e.value,h.snapshot.pending=e.pending,h.snapshot.error=n??null,t.set(h),i._enqueueRun?.();return}if(!e.pending){let n=t();n.snapshot.value=e.value,n.snapshot.pending=e.pending,n.snapshot.error=e.error,t.set(n),i._enqueueRun?.();}});}let s=c$1.cell;if(!s.deps||s.deps.length!==o.length||s.deps.some((r,e)=>r!==o[e])){s.deps=o.slice(),s.generation++,s.pending=true,s.error=null;try{if(i.ssr){if(s.start(!0,!1),!s.pending){let r=t();r.snapshot.value=s.value,r.snapshot.pending=s.pending,r.snapshot.error=s.error;}}else b.enqueue(()=>{if(s.start(!1,!1),!s.pending){let r=t();r.snapshot.value=s.value,r.snapshot.pending=s.pending,r.snapshot.error=s.error,t.set(r),i._enqueueRun?.();}});}catch(r){if(r instanceof a$1)throw r;s.error=r,s.pending=false;let e=t();e.snapshot.value=s.value,e.snapshot.pending=s.pending,e.snapshot.error=s.error;}}return c$1.snapshot}export{x as resource};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as _lockRouteRegistrationForTests,d as _unlockRouteRegistrationForTests,i as clearRoutes,k as getLoadedNamespaces,g as getNamespaceRoutes,f as getRoutes,b as lockRouteRegistration,j as registerRoute,l as resolveRoute,e as route,a as setServerLocation,h as unloadNamespace}from'./chunk-
|
|
1
|
+
export{c as _lockRouteRegistrationForTests,d as _unlockRouteRegistrationForTests,i as clearRoutes,k as getLoadedNamespaces,g as getNamespaceRoutes,f as getRoutes,b as lockRouteRegistration,j as registerRoute,l as resolveRoute,e as route,a as setServerLocation,h as unloadNamespace}from'./chunk-YJMBDYNG.js';import'./chunk-D2JSJKCW.js';import'./chunk-FWVUNA6A.js';import'./chunk-HGMOQ3I7.js';import'./chunk-BP2CKUO6.js';import'./chunk-37RC6ZT3.js';import'./chunk-62D2TNHX.js';
|
package/dist/router/index.d.ts
CHANGED
|
@@ -35,23 +35,55 @@ declare function navigate(path: string): void;
|
|
|
35
35
|
*/
|
|
36
36
|
interface LinkProps {
|
|
37
37
|
href: string;
|
|
38
|
+
class?: string;
|
|
38
39
|
children?: unknown;
|
|
40
|
+
/**
|
|
41
|
+
* Optional rel attribute for link relationships.
|
|
42
|
+
* Common values: "noopener", "noreferrer", "nofollow"
|
|
43
|
+
*/
|
|
44
|
+
rel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional target attribute.
|
|
47
|
+
* Use "_blank" for new tab/window.
|
|
48
|
+
*/
|
|
49
|
+
target?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Optional aria-current attribute for indicating current page/location.
|
|
52
|
+
* Use "page" for the current page in navigation.
|
|
53
|
+
*/
|
|
54
|
+
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
|
|
55
|
+
/**
|
|
56
|
+
* Optional aria-label for accessibility when link text isn't descriptive enough.
|
|
57
|
+
*/
|
|
58
|
+
'aria-label'?: string;
|
|
39
59
|
}
|
|
40
60
|
/**
|
|
41
61
|
* Link component that prevents default navigation and uses navigate()
|
|
42
62
|
* Provides declarative way to navigate between routes
|
|
43
63
|
*
|
|
44
|
-
*
|
|
64
|
+
* Accessibility features:
|
|
65
|
+
* - Proper semantic <a> element (not a button)
|
|
66
|
+
* - Supports aria-current for indicating active page
|
|
67
|
+
* - Supports aria-label for descriptive labels
|
|
68
|
+
* - Keyboard accessible (Enter key handled by native <a> element)
|
|
69
|
+
*
|
|
70
|
+
* Respects native browser behaviors:
|
|
45
71
|
* - Middle-click (opens in new tab)
|
|
46
72
|
* - Ctrl/Cmd+click (opens in new tab)
|
|
47
73
|
* - Shift+click (opens in new window)
|
|
74
|
+
* - Alt+click (downloads link)
|
|
48
75
|
* - Right-click context menu
|
|
49
76
|
*
|
|
77
|
+
* Best practices:
|
|
78
|
+
* - Use target="_blank" with rel="noopener noreferrer" for external links
|
|
79
|
+
* - Use aria-current="page" for the current page in navigation
|
|
80
|
+
* - Provide descriptive link text or aria-label
|
|
81
|
+
*
|
|
50
82
|
* Uses applyInteractionPolicy to enforce pit-of-success principles:
|
|
51
83
|
* - Interaction behavior centralized in foundations
|
|
52
|
-
* - Keyboard handling
|
|
84
|
+
* - Keyboard handling automatic
|
|
53
85
|
* - Composable via mergeProps
|
|
54
86
|
*/
|
|
55
|
-
declare function Link({ href, children }: LinkProps):
|
|
87
|
+
declare function Link({ href, class: className, children, rel, target, 'aria-current': ariaCurrent, 'aria-label': ariaLabel, }: LinkProps): JSX.Element;
|
|
56
88
|
|
|
57
89
|
export { Link, type LinkProps, Route, RouteHandler, RouteSnapshot, clearRoutes, getRoutes, navigate, route };
|
package/dist/router/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'../chunk-
|
|
1
|
+
import {b}from'../chunk-XFCLEDZK.js';export{b as navigate}from'../chunk-XFCLEDZK.js';import {i,b as b$2}from'../chunk-HZKAD5DE.js';export{k as layout}from'../chunk-HZKAD5DE.js';export{i as clearRoutes,f as getRoutes,e as route}from'../chunk-YJMBDYNG.js';import'../chunk-D2JSJKCW.js';import'../chunk-FWVUNA6A.js';import'../chunk-HGMOQ3I7.js';import {b as b$1}from'../chunk-BP2CKUO6.js';import'../chunk-37RC6ZT3.js';import'../chunk-62D2TNHX.js';function k({href:r,class:s,children:u,rel:l,target:o,"aria-current":p,"aria-label":c}){let m=i({isNative:true,disabled:false,onPress:f=>{let t=f;(t.button??0)!==0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||o||(t.preventDefault(),b(r));}});return b$1("a",b$2(m,{href:r,class:s,rel:l,target:o,"aria-current":p,"aria-label":c,children:u}))}export{k as Link};
|
package/dist/ssr/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'../chunk-4RTKQ7SC.js';import {b as b$1,a as a$1}from'../chunk-YRY4OLQF.js';export{a as SSRDataMissingError}from'../chunk-YRY4OLQF.js';import {m}from'../chunk-7DNGQWPJ.js';import'../chunk-D2JSJKCW.js';import {j,i,k as k$1}from'../chunk-LW2VF6A3.js';import'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import {b as b$2,a as a$2}from'../chunk-37RC6ZT3.js';import {a}from'../chunk-62D2TNHX.js';var b=null;try{let n=a("async_hooks");n?.AsyncLocalStorage&&(b=new n.AsyncLocalStorage);}catch{}var N=null;function D(n=12345,e={}){return {url:e.url??"",seed:n,data:e.data,params:e.params,signal:e.signal,keyCounter:0,renderData:null}}function _(n,e){if(b)return b.run(n,e);let t=N;N=n;try{return e()}finally{N=t;}}function y(){return b?b.getStore()??null:N}function x(){throw new a$1}function Q(){return y()?.renderData??null}function ee(){let n=y();return n?`r:${n.keyCounter++}`:"r:0"}function T(n){let e=y();e&&(e.renderData=n??null,e.keyCounter=0);}function v(){let n=y();n&&(n.renderData=null,n.keyCounter=0);}var ne="SSR collection/prepass is removed: SSR is strictly synchronous";async function te(n){throw new Error(`${ne}; async resource plans are not supported`)}function fe(n){throw new Error(`${ne}; collectResources is disabled`)}var pe=te;var L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),E=new Map,re=256,le=/[&<>]/g,de=/[&"'<>]/g,ge=/[{}<>\\]/g,Se=/(?:url|expression|javascript)\s*\(/i,I=new Map,me=512,ye=n=>{let e=n.charCodeAt(0);return e===38?"&":e===60?"<":e===62?">":n},he=n=>{let e=n.charCodeAt(0);return e===38?"&":e===34?""":e===39?"'":e===60?"<":e===62?">":n};function Re(n){let e=I.get(n);if(e!==void 0)return e;let t=n.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`);return I.size<me&&I.set(n,t),t}function we(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t===38||t===60||t===62)return true}return false}function X(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t===38||t===34||t===39||t===60||t===62)return true}return false}function h(n){let e=n.length<=64;if(e){let r=E.get(n);if(r!==void 0)return r}if(!we(n))return e&&E.size<re&&E.set(n,n),n;let t=n.replace(le,ye);return e&&E.size<re&&E.set(n,t),t}function k(n){return n.replace(de,he)}function Ce(n){let e=String(n),t=false,r=-1;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);if(s===123||s===125||s===60||s===62||s===92){if(t=true,r>=0)break}else if(s===40&&r<0&&(r=o,t))break}return !t&&r===-1?e:r!==-1&&Se.test(e)?"":t?e.replace(ge,""):e}function J(n){if(!n||typeof n!="object")return null;let e=n,t="";for(let r in e){let o=e[r];if(o==null||o===false)continue;let s=Re(r),a=Ce(String(o));a&&(t+=`${s}:${a};`);}return t||null}function oe(n){return n.length>=3&&n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>=65&&n.charCodeAt(2)<=90}function U(n,e){if(!n||typeof n!="object")return;let t=n;for(let r in t){let o=t[r];if(r==="children"||r==="key"||r==="ref"||r==="dangerouslySetInnerHTML"||oe(r)||r.charCodeAt(0)===95)continue;let s=r==="className"?"class":r;if(s==="style"){let i=typeof o=="string"?o:J(o);if(!i)continue;e.write(' style="'),X(i)?e.write(k(i)):e.write(i),e.write('"');continue}if(o===true){e.write(" "),e.write(s);continue}if(o===false||o===null||o===void 0)continue;let a=String(o);e.write(" "),e.write(s),e.write('="'),X(a)?e.write(k(a)):e.write(a),e.write('"');}}function P(n,e){if(!n||typeof n!="object")return e?.returnDangerousHtml?{attrs:""}:"";let t=[],r,o=n;for(let a in o){let i=o[a];if(a==="children"||a==="key"||a==="ref")continue;if(a==="dangerouslySetInnerHTML"){i&&typeof i=="object"&&"__html"in i&&(r=String(i.__html));continue}if(oe(a)||a.charCodeAt(0)===95)continue;let c=a==="class"||a==="className"?"class":a;if(c==="style"){let p=typeof i=="string"?i:J(i);if(p===null||p==="")continue;t.push(` style="${k(p)}"`);continue}if(i===true)t.push(` ${c}`);else {if(i===false||i===null||i===void 0)continue;{let p=String(i);t.push(` ${c}="${k(p)}"`);}}}let s=t.join("");return e?.returnDangerousHtml?{attrs:s,dangerousHtml:r}:s}var R=class R{constructor(){this.chunks=[];this.bufferChunks=[];this.bufferLen=0;}write(e){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length,this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0));}write2(e,t){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length),t&&(this.bufferChunks.push(t),this.bufferLen+=t.length),this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}write3(e,t,r){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length),t&&(this.bufferChunks.push(t),this.bufferLen+=t.length),r&&(this.bufferChunks.push(r),this.bufferLen+=r.length),this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}end(){this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}toString(){return this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0),this.chunks.join("")}};R.FLUSH_THRESHOLD=32*1024;var w=R,V=class{constructor(e,t){this.onChunk=e;this.onComplete=t;}write(e){e&&this.onChunk(e);}end(){this.onComplete();}};function be(n){return !n||typeof n!="object"?false:typeof n.then=="function"}function xe(n,e,t){let r=n(e??{},{signal:t.signal});return be(r)&&x(),r}function F(n,e,t){let r=n.children;if(r===void 0&&(r=n.props?.children),!(r==null||r===false)){if(Array.isArray(r)){for(let o=0;o<r.length;o++)A(r[o],e,t);return}A(r,e,t);}}function A(n,e,t){if(n==null)return;if(typeof n=="string"){e.write(h(n));return}if(typeof n=="number"){e.write(String(n));return}if(typeof n=="boolean"||typeof n!="object")return;let r=n,o=r.type;if(o===b$2){F(r,e,t);return}if(typeof o=="symbol"){F(r,e,t);return}if(typeof o=="function"){let p=xe(o,r.props,t);A(p,e,t);return}let s=o,a=r.props,i=a?.dangerouslySetInnerHTML,c=i&&typeof i=="object"&&"__html"in i?String(i.__html):void 0;if(L.has(s)){e.write("<"),e.write(s),U(a,e),e.write(" />");return}e.write("<"),e.write(s),U(a,e),e.write(">"),c!==void 0?e.write(c):F(r,e,t),e.write("</"),e.write(s),e.write(">");}var G=new Map;function C(n){let e=G.get(n);return e||(e={open:`<${n}`,close:`</${n}>`,selfClose:`<${n} />`},G.size<256&&G.set(n,e)),e}b$1({getCurrentSSRContext:y,throwSSRDataMissing:x,getCurrentRenderData:Q,getNextKey:ee});function Ye(){}function Ze(){}function Ee(n,e,t){if(!(n==null||n===false)){if(typeof n=="string"){e.write(h(n));return}if(typeof n=="number"){e.write(h(String(n)));return}n&&typeof n=="object"&&"type"in n&&H(n,e,t);}}function K(n,e,t){if(!(!n||!Array.isArray(n)||n.length===0))for(let r=0;r<n.length;r++)Ee(n[r],e,t);}function H(n,e,t){let{type:r,props:o}=n;if(typeof r=="function"){let u=z(r,o,t);H(u,e,t);return}if(typeof r=="symbol"){if(r===b$2){let u=Array.isArray(n.children)?n.children:Array.isArray(o?.children)?o?.children:void 0;K(u,e,t);return}throw new Error(`renderNodeSyncToSink: unsupported VNode symbol type: ${String(r)}`)}let s=r;if(L.has(s)){let u=o?P(o):"",{selfClose:f}=C(s);e.write(u?`${f.slice(0,-3)}${u} />`:f);return}let a=o?o?.dangerouslySetInnerHTML:void 0;if(a!=null){let{attrs:u,dangerousHtml:f}=P(o,{returnDangerousHtml:true}),{open:d,close:l}=C(s);e.write(u?`${d}${u}>`:`${d}>`),f!==void 0?e.write(f):K(n.children,e,t),e.write(l);return}let i=o?P(o):"",c=n.children;if(c===void 0&&o?.children!==void 0){let u=o.children;Array.isArray(u)?c=u:u!==null&&u!==false&&(c=[u]);}if(!c||Array.isArray(c)&&c.length===0){let{open:u,close:f}=C(s);e.write(i?`${u}${i}>${f}`:`${u}>${f}`);return}if(Array.isArray(c)&&c.length===1){let u=c[0];if(typeof u=="string"){let{open:f,close:d}=C(s),l=h(u);e.write(i?`${f}${i}>${l}${d}`:`${f}>${l}${d}`);return}if(typeof u=="number"){let{open:f,close:d}=C(s),l=h(String(u));e.write(i?`${f}${i}>${l}${d}`:`${f}>${l}${d}`);return}}let{open:p,close:S}=C(s);e.write(i?`${p}${i}>`:`${p}>`),K(c,e,t),e.write(S);}function z(n,e,t){{let r=j(),o=i("ssr-temp",n,e||{},null);o.ssr=true,k$1(o);try{let s=n(e||{},{ssr:t});if(s instanceof Promise&&x(),typeof s=="string"||typeof s=="number"||typeof s=="boolean"||s===null||s===void 0){let a=s==null||s===!1?"":String(s);return {$$typeof:a$2,type:b$2,props:{children:a?[a]:[]}}}return s}finally{k$1(r);}}}function ke(n,e,t){let r=t?.seed??12345,o=D(r,{data:t?.data});return _(o,()=>{T(t?.data??null);try{let a=z((c,p)=>{let S=n(c??{},p),u={$$typeof:a$2,type:d,props:{},key:"__default_portal"};return S==null?{$$typeof:a$2,type:b$2,props:{children:[u]}}:{$$typeof:a$2,type:b$2,props:{children:[S,u]}}},e||{},o);if(!a)throw new Error("renderToStringSync: wrapped component returned empty");let i=new w;return H(a,i,o),i.end(),i.toString()}finally{v();}})}function qe(n){let{url:e,routes:t,options:r}=n,{clearRoutes:o,route:s,setServerLocation:a,lockRouteRegistration:i,resolveRoute:c}=m;o();for(let f of t)s(f.path,f.handler,f.namespace);a(e),i();let p=c(e);if(!p)throw new Error(`renderToStringSync: no route found for url: ${e}`);let S=r?.seed??12345,u=D(S,{url:e,data:r?.data});return _(u,()=>{T(r?.data??null);try{let d$1=z((ue,ae)=>{let B=p.handler(ue??{},ae),Y={$$typeof:a$2,type:d,props:{},key:"__default_portal"};return B==null?{$$typeof:a$2,type:b$2,props:{children:[Y]}}:{$$typeof:a$2,type:b$2,props:{children:[B,Y]}}},p.params||{},u),l=new w;return H(d$1,l,u),l.end(),l.toString()}finally{v();}})}function nn(n){if(typeof n=="function")return ke(n);let e=n,t=new w;return ie({...e,sink:t}),t.end(),t.toString()}function tn(n){let e=new V(n.onChunk,n.onComplete);ie({...n,sink:e}),e.end();}function ie(n){let{url:e,routes:t,seed:r=12345,data:o,sink:s}=n,{clearRoutes:a,route:i,setServerLocation:c,lockRouteRegistration:p,resolveRoute:S}=m;a();for(let l of t)i(l.path,l.handler,l.namespace);c(e),p();let u=S(e);if(!u)throw new Error(`SSR: no route found for url: ${e}`);let f=D(r,{url:e,data:o,params:u.params}),d=u.handler(u.params);_(f,()=>{T(o||null);try{A(d,s,f);}finally{v();}});}export{fe as collectResources,Ze as popSSRStrictPurityGuard,Ye as pushSSRStrictPurityGuard,tn as renderToStream,nn as renderToString,ke as renderToStringSync,qe as renderToStringSyncForUrl,te as resolvePlan,pe as resolveResources};
|
|
1
|
+
import {d}from'../chunk-4RTKQ7SC.js';import {b as b$1,a as a$1}from'../chunk-YRY4OLQF.js';export{a as SSRDataMissingError}from'../chunk-YRY4OLQF.js';import {m}from'../chunk-YJMBDYNG.js';import'../chunk-D2JSJKCW.js';import {j,i,k as k$1}from'../chunk-FWVUNA6A.js';import'../chunk-HGMOQ3I7.js';import'../chunk-BP2CKUO6.js';import {b as b$2,a as a$2}from'../chunk-37RC6ZT3.js';import {a}from'../chunk-62D2TNHX.js';var b=null;try{let n=a("async_hooks");n?.AsyncLocalStorage&&(b=new n.AsyncLocalStorage);}catch{}var N=null;function D(n=12345,e={}){return {url:e.url??"",seed:n,data:e.data,params:e.params,signal:e.signal,keyCounter:0,renderData:null}}function _(n,e){if(b)return b.run(n,e);let t=N;N=n;try{return e()}finally{N=t;}}function y(){return b?b.getStore()??null:N}function x(){throw new a$1}function Q(){return y()?.renderData??null}function ee(){let n=y();return n?`r:${n.keyCounter++}`:"r:0"}function T(n){let e=y();e&&(e.renderData=n??null,e.keyCounter=0);}function v(){let n=y();n&&(n.renderData=null,n.keyCounter=0);}var ne="SSR collection/prepass is removed: SSR is strictly synchronous";async function te(n){throw new Error(`${ne}; async resource plans are not supported`)}function fe(n){throw new Error(`${ne}; collectResources is disabled`)}var pe=te;var L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),E=new Map,re=256,le=/[&<>]/g,de=/[&"'<>]/g,ge=/[{}<>\\]/g,Se=/(?:url|expression|javascript)\s*\(/i,I=new Map,me=512,ye=n=>{let e=n.charCodeAt(0);return e===38?"&":e===60?"<":e===62?">":n},he=n=>{let e=n.charCodeAt(0);return e===38?"&":e===34?""":e===39?"'":e===60?"<":e===62?">":n};function Re(n){let e=I.get(n);if(e!==void 0)return e;let t=n.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`);return I.size<me&&I.set(n,t),t}function we(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t===38||t===60||t===62)return true}return false}function X(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t===38||t===34||t===39||t===60||t===62)return true}return false}function h(n){let e=n.length<=64;if(e){let r=E.get(n);if(r!==void 0)return r}if(!we(n))return e&&E.size<re&&E.set(n,n),n;let t=n.replace(le,ye);return e&&E.size<re&&E.set(n,t),t}function k(n){return n.replace(de,he)}function Ce(n){let e=String(n),t=false,r=-1;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);if(s===123||s===125||s===60||s===62||s===92){if(t=true,r>=0)break}else if(s===40&&r<0&&(r=o,t))break}return !t&&r===-1?e:r!==-1&&Se.test(e)?"":t?e.replace(ge,""):e}function J(n){if(!n||typeof n!="object")return null;let e=n,t="";for(let r in e){let o=e[r];if(o==null||o===false)continue;let s=Re(r),a=Ce(String(o));a&&(t+=`${s}:${a};`);}return t||null}function oe(n){return n.length>=3&&n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>=65&&n.charCodeAt(2)<=90}function U(n,e){if(!n||typeof n!="object")return;let t=n;for(let r in t){let o=t[r];if(r==="children"||r==="key"||r==="ref"||r==="dangerouslySetInnerHTML"||oe(r)||r.charCodeAt(0)===95)continue;let s=r==="className"?"class":r;if(s==="style"){let i=typeof o=="string"?o:J(o);if(!i)continue;e.write(' style="'),X(i)?e.write(k(i)):e.write(i),e.write('"');continue}if(o===true){e.write(" "),e.write(s);continue}if(o===false||o===null||o===void 0)continue;let a=String(o);e.write(" "),e.write(s),e.write('="'),X(a)?e.write(k(a)):e.write(a),e.write('"');}}function P(n,e){if(!n||typeof n!="object")return e?.returnDangerousHtml?{attrs:""}:"";let t=[],r,o=n;for(let a in o){let i=o[a];if(a==="children"||a==="key"||a==="ref")continue;if(a==="dangerouslySetInnerHTML"){i&&typeof i=="object"&&"__html"in i&&(r=String(i.__html));continue}if(oe(a)||a.charCodeAt(0)===95)continue;let c=a==="class"||a==="className"?"class":a;if(c==="style"){let p=typeof i=="string"?i:J(i);if(p===null||p==="")continue;t.push(` style="${k(p)}"`);continue}if(i===true)t.push(` ${c}`);else {if(i===false||i===null||i===void 0)continue;{let p=String(i);t.push(` ${c}="${k(p)}"`);}}}let s=t.join("");return e?.returnDangerousHtml?{attrs:s,dangerousHtml:r}:s}var R=class R{constructor(){this.chunks=[];this.bufferChunks=[];this.bufferLen=0;}write(e){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length,this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0));}write2(e,t){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length),t&&(this.bufferChunks.push(t),this.bufferLen+=t.length),this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}write3(e,t,r){e&&(this.bufferChunks.push(e),this.bufferLen+=e.length),t&&(this.bufferChunks.push(t),this.bufferLen+=t.length),r&&(this.bufferChunks.push(r),this.bufferLen+=r.length),this.bufferLen>=R.FLUSH_THRESHOLD&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}end(){this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0);}toString(){return this.bufferLen&&(this.chunks.push(this.bufferChunks.join("")),this.bufferChunks.length=0,this.bufferLen=0),this.chunks.join("")}};R.FLUSH_THRESHOLD=32*1024;var w=R,V=class{constructor(e,t){this.onChunk=e;this.onComplete=t;}write(e){e&&this.onChunk(e);}end(){this.onComplete();}};function be(n){return !n||typeof n!="object"?false:typeof n.then=="function"}function xe(n,e,t){let r=n(e??{},{signal:t.signal});return be(r)&&x(),r}function F(n,e,t){let r=n.children;if(r===void 0&&(r=n.props?.children),!(r==null||r===false)){if(Array.isArray(r)){for(let o=0;o<r.length;o++)A(r[o],e,t);return}A(r,e,t);}}function A(n,e,t){if(n==null)return;if(typeof n=="string"){e.write(h(n));return}if(typeof n=="number"){e.write(String(n));return}if(typeof n=="boolean"||typeof n!="object")return;let r=n,o=r.type;if(o===b$2){F(r,e,t);return}if(typeof o=="symbol"){F(r,e,t);return}if(typeof o=="function"){let p=xe(o,r.props,t);A(p,e,t);return}let s=o,a=r.props,i=a?.dangerouslySetInnerHTML,c=i&&typeof i=="object"&&"__html"in i?String(i.__html):void 0;if(L.has(s)){e.write("<"),e.write(s),U(a,e),e.write(" />");return}e.write("<"),e.write(s),U(a,e),e.write(">"),c!==void 0?e.write(c):F(r,e,t),e.write("</"),e.write(s),e.write(">");}var G=new Map;function C(n){let e=G.get(n);return e||(e={open:`<${n}`,close:`</${n}>`,selfClose:`<${n} />`},G.size<256&&G.set(n,e)),e}b$1({getCurrentSSRContext:y,throwSSRDataMissing:x,getCurrentRenderData:Q,getNextKey:ee});function Ye(){}function Ze(){}function Ee(n,e,t){if(!(n==null||n===false)){if(typeof n=="string"){e.write(h(n));return}if(typeof n=="number"){e.write(h(String(n)));return}n&&typeof n=="object"&&"type"in n&&H(n,e,t);}}function K(n,e,t){if(!(!n||!Array.isArray(n)||n.length===0))for(let r=0;r<n.length;r++)Ee(n[r],e,t);}function H(n,e,t){let{type:r,props:o}=n;if(typeof r=="function"){let u=z(r,o,t);H(u,e,t);return}if(typeof r=="symbol"){if(r===b$2){let u=Array.isArray(n.children)?n.children:Array.isArray(o?.children)?o?.children:void 0;K(u,e,t);return}throw new Error(`renderNodeSyncToSink: unsupported VNode symbol type: ${String(r)}`)}let s=r;if(L.has(s)){let u=o?P(o):"",{selfClose:f}=C(s);e.write(u?`${f.slice(0,-3)}${u} />`:f);return}let a=o?o?.dangerouslySetInnerHTML:void 0;if(a!=null){let{attrs:u,dangerousHtml:f}=P(o,{returnDangerousHtml:true}),{open:d,close:l}=C(s);e.write(u?`${d}${u}>`:`${d}>`),f!==void 0?e.write(f):K(n.children,e,t),e.write(l);return}let i=o?P(o):"",c=n.children;if(c===void 0&&o?.children!==void 0){let u=o.children;Array.isArray(u)?c=u:u!==null&&u!==false&&(c=[u]);}if(!c||Array.isArray(c)&&c.length===0){let{open:u,close:f}=C(s);e.write(i?`${u}${i}>${f}`:`${u}>${f}`);return}if(Array.isArray(c)&&c.length===1){let u=c[0];if(typeof u=="string"){let{open:f,close:d}=C(s),l=h(u);e.write(i?`${f}${i}>${l}${d}`:`${f}>${l}${d}`);return}if(typeof u=="number"){let{open:f,close:d}=C(s),l=h(String(u));e.write(i?`${f}${i}>${l}${d}`:`${f}>${l}${d}`);return}}let{open:p,close:S}=C(s);e.write(i?`${p}${i}>`:`${p}>`),K(c,e,t),e.write(S);}function z(n,e,t){{let r=j(),o=i("ssr-temp",n,e||{},null);o.ssr=true,k$1(o);try{let s=n(e||{},{ssr:t});if(s instanceof Promise&&x(),typeof s=="string"||typeof s=="number"||typeof s=="boolean"||s===null||s===void 0){let a=s==null||s===!1?"":String(s);return {$$typeof:a$2,type:b$2,props:{children:a?[a]:[]}}}return s}finally{k$1(r);}}}function ke(n,e,t){let r=t?.seed??12345,o=D(r,{data:t?.data});return _(o,()=>{T(t?.data??null);try{let a=z((c,p)=>{let S=n(c??{},p),u={$$typeof:a$2,type:d,props:{},key:"__default_portal"};return S==null?{$$typeof:a$2,type:b$2,props:{children:[u]}}:{$$typeof:a$2,type:b$2,props:{children:[S,u]}}},e||{},o);if(!a)throw new Error("renderToStringSync: wrapped component returned empty");let i=new w;return H(a,i,o),i.end(),i.toString()}finally{v();}})}function qe(n){let{url:e,routes:t,options:r}=n,{clearRoutes:o,route:s,setServerLocation:a,lockRouteRegistration:i,resolveRoute:c}=m;o();for(let f of t)s(f.path,f.handler,f.namespace);a(e),i();let p=c(e);if(!p)throw new Error(`renderToStringSync: no route found for url: ${e}`);let S=r?.seed??12345,u=D(S,{url:e,data:r?.data});return _(u,()=>{T(r?.data??null);try{let d$1=z((ue,ae)=>{let B=p.handler(ue??{},ae),Y={$$typeof:a$2,type:d,props:{},key:"__default_portal"};return B==null?{$$typeof:a$2,type:b$2,props:{children:[Y]}}:{$$typeof:a$2,type:b$2,props:{children:[B,Y]}}},p.params||{},u),l=new w;return H(d$1,l,u),l.end(),l.toString()}finally{v();}})}function nn(n){if(typeof n=="function")return ke(n);let e=n,t=new w;return ie({...e,sink:t}),t.end(),t.toString()}function tn(n){let e=new V(n.onChunk,n.onComplete);ie({...n,sink:e}),e.end();}function ie(n){let{url:e,routes:t,seed:r=12345,data:o,sink:s}=n,{clearRoutes:a,route:i,setServerLocation:c,lockRouteRegistration:p,resolveRoute:S}=m;a();for(let l of t)i(l.path,l.handler,l.namespace);c(e),p();let u=S(e);if(!u)throw new Error(`SSR: no route found for url: ${e}`);let f=D(r,{url:e,data:o,params:u.params}),d=u.handler(u.params);_(f,()=>{T(o||null);try{A(d,s,f);}finally{v();}});}export{fe as collectResources,Ze as popSSRStrictPurityGuard,Ye as pushSSRStrictPurityGuard,tn as renderToStream,nn as renderToString,ke as renderToStringSync,qe as renderToStringSyncForUrl,te as resolvePlan,pe as resolveResources};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askrjs/askr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Actor-backed deterministic UI framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"eslint-config-prettier": "^10.1.8",
|
|
93
93
|
"jiti": "^2.6.1",
|
|
94
94
|
"jsdom": "^27.4.0",
|
|
95
|
-
"prettier": "^3.8.
|
|
95
|
+
"prettier": "^3.8.1",
|
|
96
96
|
"tsup": "^8.5.1",
|
|
97
97
|
"tsd": "^0.33.0",
|
|
98
98
|
"typescript": "^5.9.3",
|
package/dist/chunk-BJ3TA3ZK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-FYTGHAKU.js';import {h,f}from'./chunk-LW2VF6A3.js';function m(t,n,a$1){let p=a(h(t,n,a$1?.by))();return {type:f,props:{source:t},_forState:p}}export{m as a};
|
package/dist/chunk-LW2VF6A3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-HGMOQ3I7.js';import {b as b$1}from'./chunk-37RC6ZT3.js';function fe(e,n,t){if(!e){let r=t?`
|
|
2
|
-
`+JSON.stringify(t,null,2):"";throw new Error(`[Askr Invariant] ${n}${r}`)}}function ve(e,n){fe(e,`[Scheduler Precondition] ${n}`);}function Q(){try{let e=globalThis.__ASKR_FASTLANE;return typeof e?.isBulkCommitActive=="function"?!!e.isBulkCommitActive():!1}catch(e){return false}}var me=class{constructor(){this.q=[];this.head=0;this.running=false;this.inHandler=false;this.depth=0;this.executionDepth=0;this.flushVersion=0;this.kickScheduled=false;this.allowSyncProgress=false;this.waiters=[];this.taskCount=0;}enqueue(n){ve(typeof n=="function","enqueue() requires a function"),!(Q()&&!this.allowSyncProgress)&&(this.q.push(n),this.taskCount++,!this.running&&!this.kickScheduled&&!this.inHandler&&!Q()&&(this.kickScheduled=true,queueMicrotask(()=>{if(this.kickScheduled=false,!this.running&&!Q())try{this.flush();}catch(t){setTimeout(()=>{throw t});}})));}flush(){fe(!this.running,"[Scheduler] flush() called while already running"),this.running=true,this.depth=0;let n=null;try{for(;this.head<this.q.length;){this.depth++;let t=this.q[this.head++];try{this.executionDepth++,t(),this.executionDepth--;}catch(r){this.executionDepth>0&&(this.executionDepth=0),n=r;break}this.taskCount>0&&this.taskCount--;}}finally{if(this.running=false,this.depth=0,this.executionDepth=0,this.head>=this.q.length)this.q.length=0,this.head=0;else if(this.head>0){let t=this.q.length-this.head;for(let r=0;r<t;r++)this.q[r]=this.q[this.head+r];this.q.length=t,this.head=0;}this.flushVersion++,this.resolveWaiters();}if(n)throw n}runWithSyncProgress(n){let t=this.allowSyncProgress;this.allowSyncProgress=true;let i=this.flushVersion;try{let a=n();return !this.running&&this.q.length-this.head>0&&this.flush(),a}finally{try{this.flushVersion===i&&(this.flushVersion++,this.resolveWaiters());}catch(a){}this.allowSyncProgress=t;}}waitForFlush(n,t=2e3){let r=typeof n=="number"?n:this.flushVersion+1;return this.flushVersion>=r?Promise.resolve():new Promise((o,s)=>{let i=setTimeout(()=>{let a=globalThis.__ASKR__||{},l={flushVersion:this.flushVersion,queueLen:this.q.length-this.head,running:this.running,inHandler:this.inHandler,bulk:Q(),namespace:a};s(new Error(`waitForFlush timeout ${t}ms: ${JSON.stringify(l)}`));},t);this.waiters.push({target:r,resolve:o,reject:s,timer:i});})}getState(){return {queueLength:this.q.length-this.head,running:this.running,depth:this.depth,executionDepth:this.executionDepth,taskCount:this.taskCount,flushVersion:this.flushVersion,inHandler:this.inHandler,allowSyncProgress:this.allowSyncProgress}}setInHandler(n){this.inHandler=n;}isInHandler(){return this.inHandler}isExecuting(){return this.running||this.executionDepth>0}clearPendingSyncTasks(){let n=this.q.length-this.head;return n<=0?0:this.running?(this.q.length=this.head,this.taskCount=Math.max(0,this.taskCount-n),queueMicrotask(()=>{try{this.flushVersion++,this.resolveWaiters();}catch(t){}}),n):(this.q.length=0,this.head=0,this.taskCount=Math.max(0,this.taskCount-n),this.flushVersion++,this.resolveWaiters(),n)}resolveWaiters(){if(this.waiters.length===0)return;let n=[],t=[];for(let r of this.waiters)this.flushVersion>=r.target?(r.timer&&clearTimeout(r.timer),n.push(r.resolve)):t.push(r);this.waiters=t;for(let r of n)r();}},v=new me;function Ne(){return v.isExecuting()}var Re=Symbol("__tempoContextFrame__"),Z=null;function q(e,n){let t=Z;Z=e;try{return n()}finally{Z=t;}}function Ct(e,n){try{return n()}finally{}}function we(){return Z}function xe(){try{let e=globalThis;return e.__ASKR_DIAG||(e.__ASKR_DIAG={}),e.__ASKR_DIAG}catch(e){return {}}}function b(e,n){try{let t=xe();t[e]=n;try{let r=globalThis;try{let o=r.__ASKR__||(r.__ASKR__={});try{o[e]=n;}catch(s){}}catch(o){}}catch(r){}}catch(t){}}function N(e){try{let n=xe(),r=(typeof n[e]=="number"?n[e]:0)+1;n[e]=r;try{let o=globalThis,s=o.__ASKR__||(o.__ASKR__={});try{let i=typeof s[e]=="number"?s[e]:0;s[e]=i+1;}catch(i){}}catch(o){}}catch(n){}}function j(e){return !e.startsWith("on")||e.length<=2?null:e.slice(2).charAt(0).toLowerCase()+e.slice(3).toLowerCase()}function $(e){if(e==="wheel"||e==="scroll"||e.startsWith("touch"))return {passive:true}}function W(e,n=false){return t=>{v.setInHandler(true);try{e(t);}catch(r){a.error("[Askr] Event handler error:",r);}finally{if(v.setInHandler(false),n){let r=v.getState();(r.queueLength??0)>0&&!r.running&&queueMicrotask(()=>{try{v.isExecuting()||v.flush();}catch(o){queueMicrotask(()=>{throw o});}});}}}}function he(e){return e==="children"||e==="key"||e==="ref"}function ee(e){return !!(e==="children"||e==="key"||e.startsWith("on")&&e.length>2||e.startsWith("data-"))}function ge(e,n,t){try{if(n==="class"||n==="className")return e.className!==String(t);if(n==="value"||n==="checked")return e[n]!==t;let r=e.getAttribute(n);return t==null||t===!1?r!==null:String(t)!==r}catch{return true}}function Fe(e){for(let n of Object.keys(e))if(!ee(n))return true;return false}function Me(e,n){for(let t of Object.keys(n))if(!ee(t)&&ge(e,t,n[t]))return true;return false}function D(e){if(typeof e!="object"||e===null)return;let n=e,t=n.key??n.props?.key;if(t!==void 0)return typeof t=="symbol"?String(t):t}function Ie(e){let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}return n}function ne(e){try{N("__DOM_REPLACE_COUNT"),b(`__LAST_DOM_REPLACE_STACK_${e}`,new Error().stack);}catch{}}function te(e,n){try{b("__LAST_FASTPATH_STATS",e),b("__LAST_FASTPATH_COMMIT_COUNT",1),n&&N(n);}catch{}}function re(e,n,t){(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&(t!==void 0?a.warn(`[Askr][FASTPATH] ${e}`,n,t):n!==void 0?a.warn(`[Askr][FASTPATH] ${e}`,n):a.warn(`[Askr][FASTPATH] ${e}`));}function G(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}var S=new WeakMap;function oe(e){return S.get(e)}function Pe(e){try{if(S.has(e))return;let n=Ie(e);if(n.size===0){n=new Map;let t=Array.from(e.children);for(let r of t){let o=(r.textContent||"").trim();if(o){n.set(o,r);let s=Number(o);Number.isNaN(s)||n.set(s,r);}}}n.size>0&&S.set(e,n);}catch{}}var De=new WeakSet;function an(e){let n=[];for(let t of e){let r=D(t);r!==void 0&&n.push({key:r,vnode:t});}return n}function ln(e){let n=[];for(let t of e){if(t===-1)continue;let r=0,o=n.length;for(;r<o;){let s=r+o>>1;n[s]<t?r=s+1:o=s;}r===n.length?n.push(t):n[r]=t;}return n.length}function un(e){for(let{vnode:n}of e){if(typeof n!="object"||n===null)continue;let t=n;if(t.props&&Fe(t.props))return true}return false}function cn(e,n){for(let{key:t,vnode:r}of e){let o=n?.get(t);if(!o||typeof r!="object"||r===null)continue;let i=r.props||{};for(let a of Object.keys(i))if(!ee(a)&&ge(o,a,i[a]))return true}return false}function L(e,n,t){let r=an(n),o=r.length,s=r.map(h=>h.key),i=t?Array.from(t.keys()):[],a=0;for(let h=0;h<s.length;h++){let A=s[h];(h>=i.length||i[h]!==A||!t?.has(A))&&a++;}let p=o>=128&&i.length>0&&a>Math.max(64,Math.floor(o*.1)),u=false,c=0;if(o>=128){let h=Array.from(e.children),A=r.map(({key:F})=>{let P=t?.get(F);return P?.parentElement===e?h.indexOf(P):-1});c=ln(A),u=c<Math.floor(o*.5);}let f=un(r),g=cn(r,t);return {useFastPath:(p||u)&&!g&&!f,totalKeyed:o,moveCount:a,lisLen:c,hasPropChanges:g}}var ye=false,V=null;function Oe(){ye=true,V=new WeakSet;try{let e=v.clearPendingSyncTasks?.()??0;}catch{}}function Ke(){ye=false,V=null;}function X(){return ye}function _e(e){if(V)try{V.add(e);}catch(n){}}function dn(e){return !!(V&&V.has(e))}function fn(e){let n=e._pendingReadStates??new Set,t=e._lastReadStates??new Set,r=e._currentRenderToken;if(r!==void 0){for(let o of t)if(!n.has(o)){let s=o._readers;s&&s.delete(e);}e.lastRenderToken=r;for(let o of n){let s=o._readers;s||(s=new Map,o._readers=s),s.set(e,e.lastRenderToken??0);}e._lastReadStates=n,e._pendingReadStates=new Set,e._currentRenderToken=void 0;}}function mn(e){if(!e||typeof e!="object"||!("type"in e))return e;let n=e;if(typeof n.type=="symbol"&&(n.type===b$1||String(n.type)==="Symbol(askr.fragment)")){let t=n.children||n.props?.children;if(Array.isArray(t)&&t.length>0){for(let r of t)if(r&&typeof r=="object"&&"type"in r&&typeof r.type=="string")return r}}return e}function pn(e,n){let t=mn(n);if(!t||typeof t!="object"||!("type"in t))return {useFastPath:false,reason:"not-vnode"};let r=t;if(r==null||typeof r.type!="string")return {useFastPath:false,reason:"not-intrinsic"};let o=e.target;if(!o)return {useFastPath:false,reason:"no-root"};let s=o.children[0];if(!s)return {useFastPath:false,reason:"no-first-child"};if(s.tagName.toLowerCase()!==String(r.type).toLowerCase())return {useFastPath:false,reason:"root-tag-mismatch"};let i=r.children||r.props?.children;if(!Array.isArray(i))return {useFastPath:false,reason:"no-children-array"};for(let d of i)if(typeof d=="object"&&d!==null&&"type"in d&&typeof d.type=="function")return {useFastPath:false,reason:"component-child-present"};if(e.mountOperations.length>0)return {useFastPath:false,reason:"pending-mounts"};try{Pe(s);}catch{}let a=oe(s),l=L(s,i,a);return !l.useFastPath||l.totalKeyed<128?{...l,useFastPath:false,reason:"renderer-declined"}:{...l,useFastPath:true}}function hn(e,n){let t=globalThis.__ASKR_RENDERER?.evaluate;if(typeof t!="function")return a.warn("[Tempo][FASTPATH][DEV] renderer.evaluate not available; declining fast-lane"),false;Oe();try{v.runWithSyncProgress(()=>{t(n,e.target);try{fn(e);}catch{}});let o=v.clearPendingSyncTasks?.()??0;return !0}finally{Ke();}}function gn(e,n){if(!pn(e,n).useFastPath)return false;try{return hn(e,n)}catch{return false}}typeof globalThis<"u"&&(globalThis.__ASKR_FASTLANE={isBulkCommitActive:X,enterBulkCommit:Oe,exitBulkCommit:Ke,tryRuntimeFastLaneSync:gn,markFastPathApplied:_e,isFastPathApplied:dn});var Le=Symbol("__FOR_BOUNDARY__");function T(e){return typeof e=="object"&&e!==null&&"type"in e}function Ve(e,n,t){let r=e.__ASKR_INSTANCE;if(r){try{Ue(r);}catch(o){a.warn("[Askr] cleanupComponent failed:",o);}try{delete e.__ASKR_INSTANCE;}catch(o){}}}function Be(e,n){try{let r=e.ownerDocument,o=r?.createTreeWalker;if(typeof o=="function"){let s=o.call(r,e,1),i=s.firstChild();for(;i;)n(i),i=s.nextNode();return}}catch{}let t=e.querySelectorAll("*");for(let r=0;r<t.length;r++)n(t[r]);}function R(e,n){if(!e||!(e instanceof Element))return;let t=false,r=null;try{Ve(e,r,t);}catch(o){a.warn("[Askr] cleanupInstanceIfPresent failed:",o);}try{Be(e,o=>{try{Ve(o,r,t);}catch(s){t?r.push(s):a.warn("[Askr] cleanupInstanceIfPresent descendant cleanup failed:",s);}});}catch(o){a.warn("[Askr] cleanupInstanceIfPresent descendant query failed:",o);}}function Ee(e,n){R(e);}var C=new WeakMap;function He(e){let n=C.get(e);if(n){for(let[t,r]of n)r.options!==void 0?e.removeEventListener(t,r.handler,r.options):e.removeEventListener(t,r.handler);C.delete(e);}}function M(e){e&&(He(e),Be(e,He));}var k=globalThis;function ie(e,n){}var _n=(e,n)=>e!=null&&typeof e=="object"&&"id"in e?e.id:n;function Wt(e,n,t){let r=typeof e=="function"?null:e,o=J();return {sourceState:r,items:new Map,orderedKeys:[],byFn:t||_n,renderFn:n,parentInstance:o,mounted:false}}var qe=1;function je(e,n,t,r){let o=t,s=Object.assign(()=>o,{set(c){let f=typeof c=="function"?c(o):c;f!==o&&(o=f);}}),i=()=>null,a=ae(`for-item-${e}`,i,{},null);r.parentInstance&&(a.ownerFrame=r.parentInstance.ownerFrame);let l=J();z(a);let d=We();a._currentRenderToken=qe++,a._pendingReadStates=new Set;let p=r.renderFn(n,()=>s());O(a),z(l);let u={key:e,item:n,indexSignal:s,componentInstance:a,vnode:p,_startStateIndex:d};return a._pendingFlushTask=()=>{let c=J();z(a),a.stateIndexCheck=-1;let f=a.stateValues;for(let m=0;m<f.length;m++){let h=f[m];h&&(h._hasBeenRead=false);}Ge(d),a._currentRenderToken=qe++,a._pendingReadStates=new Set;try{let m=r.renderFn(n,()=>s());u.vnode=m,O(a);}finally{z(c);}let g=r.parentInstance;g&&g._enqueueRun?.();},u}function En(e,n){let t=k.__ASKR_BENCH__?performance.now():0,{items:r,orderedKeys:o,byFn:s}=e,i=o.length,a=n.length;if(i<=a){let u=true;for(let c=0;c<i;c++)if(s(n[c],c)!==o[c]){u=false;break}if(u){let c=[];for(let f=0;f<i;f++){let g=n[f],m=o[f],h=r.get(m);let A=h.item!==g,F=h.indexSignal()!==f;if(A){h.item=g;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=h.componentInstance,h.vnode=e.renderFn(g,()=>h.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}F&&h.indexSignal.set(f),c.push(h.vnode);}for(let f=i;f<a;f++){let g=n[f],m=s(g,f),h=je(m,g,f,e);r.set(m,h),c.push(h.vnode),o[f]=m;}return k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),c}}if(a<=i){let u=true;for(let c=0;c<a;c++)if(s(n[c],c)!==o[c]){u=false;break}if(u){let c=[];for(let f=0;f<a;f++){let g=n[f],m=o[f],h=r.get(m);let A=h.item!==g,F=h.indexSignal()!==f;if(A){h.item=g;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=h.componentInstance,h.vnode=e.renderFn(g,()=>h.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}F&&h.indexSignal.set(f),c.push(h.vnode);}for(let f=a;f<i;f++){let g=o[f],m=r.get(g);if(m){let h=m.componentInstance;h.abortController.abort();for(let A of h.cleanupFns)try{A();}catch{}r.delete(g);}}return o.length=a,e.orderedKeys=o,k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),c}}if(i===a){let u=true;for(let c=0;c<i;c++)if(s(n[c],c)!==o[c]){u=false;break}if(u){let c=[];for(let f=0;f<i;f++){let g=n[f],m=o[f],h=r.get(m);let A=h.item!==g,F=h.indexSignal()!==f;if(A){h.item=g;let P=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=h.componentInstance,h.vnode=e.renderFn(g,()=>h.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=P;}F&&h.indexSignal.set(f),c.push(h.vnode);}return k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),c}}let l=new Set(o),d=[],p=[];for(let u=0;u<n.length;u++){let c=n[u],f=s(c,u);l.delete(f),d.push(f);let g=r.get(f);if(g){let m=g.item!==c,h=g.indexSignal()!==u;if(m){g.item=c;let A=k.__ASKR_CURRENT_INSTANCE__;k.__ASKR_CURRENT_INSTANCE__=g.componentInstance,g.vnode=e.renderFn(c,()=>g.indexSignal()),k.__ASKR_CURRENT_INSTANCE__=A;}h&&g.indexSignal.set(u),p.push(g.vnode);}else {let m=je(f,c,u,e);r.set(f,m),p.push(m.vnode);}}for(let u of l){let c=r.get(u);if(c){let f=c.componentInstance;f.abortController.abort();for(let g of f.cleanupFns)try{g();}catch{}r.delete(u);}}return e.orderedKeys=d,k.__ASKR_BENCH__&&ie("reconcile",performance.now()-t),p}function $e(e,n){let t=n();if(!Array.isArray(t))throw new Error("For source must evaluate to an array");return En(e,t)}var Sn=typeof document<"u",Xe=0;function kn(){let e="__COMPONENT_INSTANCE_ID";try{N(e);let t=globalThis.__ASKR_DIAG,r=t?t[e]:void 0;if(typeof r=="number"&&Number.isFinite(r))return `comp-${r}`}catch{}return Xe++,`comp-${Xe}`}function An(e,n,t){let r=W(t,true),o=$(n);o!==void 0?e.addEventListener(n,r,o):e.addEventListener(n,r),C.has(e)||C.set(e,new Map),C.get(e).set(n,{handler:r,original:t,options:o});}function bn(e,n,t){for(let r in n){let o=n[r];if(r==="ref"){Tn(e,o);continue}if(he(r)||o==null||o===false)continue;let s=j(r);if(s){An(e,s,o);continue}r==="class"||r==="className"?e.className=String(o):r==="value"||r==="checked"?Cn(e,r,o,t):e.setAttribute(r,String(o));}}function Tn(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function Cn(e,n,t,r){n==="value"?((Y(r,"input")||Y(r,"textarea")||Y(r,"select"))&&(e.value=String(t)),e.setAttribute("value",String(t))):n==="checked"&&(Y(r,"input")&&(e.checked=!!t),e.setAttribute("checked",String(!!t)));}function ze(e,n,t){let r=n.key??t?.key;r!==void 0&&e.setAttribute("data-key",String(r));}function _(e){if(!Sn)return null;if(typeof e=="string")return document.createTextNode(e);if(typeof e=="number")return document.createTextNode(String(e));if(!e)return null;if(Array.isArray(e)){let n=document.createDocumentFragment();for(let t of e){let r=_(t);r&&n.appendChild(r);}return n}if(typeof e=="object"&&e!==null&&"type"in e){let n=e.type,t=e.props||{};if(typeof n=="string")return vn(e,n,t);if(typeof n=="function")return Nn(e,n,t);if(n===Le)return wn(e,t);if(typeof n=="symbol"&&(n===b$1||String(n)==="Symbol(Fragment)"))return Rn(e,t)}return null}function vn(e,n,t){let r=document.createElement(n);ze(r,e,t),bn(r,t,n);let o=t.children??e.children;if(o!=null)if(Array.isArray(o)){for(let s of o){let i=_(s);i&&r.appendChild(i);}}else {let s=_(o);s&&r.appendChild(s);}return r}function Nn(e,n,t){let o=e[Re]||we(),s=n;if(s.constructor.name==="AsyncFunction")throw new Error("Async components are not supported. Use resource() for async work.");let a=e.__instance;a||(a=ae(kn(),s,t||{},null),e.__instance=a),o&&(a.ownerFrame=o);let l=q(o,()=>Qe(a));if(l instanceof Promise)throw new Error("Async components are not supported. Components must return synchronously.");let d=q(o,()=>_(l));if(d instanceof Element)return ke(a,d),d;if(!d){let u=document.createComment("");return a._placeholder=u,a.mounted=true,a.notifyUpdate=a._enqueueRun,u}let p=document.createElement("div");return p.appendChild(d),ke(a,p),p}function Rn(e,n){let t=document.createDocumentFragment(),r=n.children||e.children;if(r)if(Array.isArray(r))for(let o of r){let s=_(o);s&&t.appendChild(s);}else {let o=_(r);o&&t.appendChild(o);}return t}function wn(e,n){let t=e._forState;if(!t)return document.createDocumentFragment();let r=n.source,o=$e(t,r),s=[],i=false;for(let l=0;l<o.length;l++){let d=o[l],p=d.key,u=null;if(p!=null&&t.items.has(p)){let c=t.items.get(p);c._dom&&c.vnode===d&&(u=c._dom);}u||(u=_(d),i=true,p!=null&&t.items.has(p)&&(t.items.get(p)._dom=u??void 0)),s.push(u);}if(!i&&s.length!==t.orderedKeys.length&&(i=true),!i)return document.createDocumentFragment();let a=document.createDocumentFragment();for(let l of s)l&&a.appendChild(l);return a}function I(e,n,t=true){if(!T(n))return;let r=n.props||{};ze(e,n,r);let o=C.get(e),s=null;for(let i in r){let a=r[i];if(he(i))continue;let l=j(i);if(a==null||a===false){if(i==="class"||i==="className")e.className="";else if(l&&o?.has(l)){let d=o.get(l);d.options!==void 0?e.removeEventListener(l,d.handler,d.options):e.removeEventListener(l,d.handler),o.delete(l);}else e.removeAttribute(i);continue}if(i==="class"||i==="className")e.className=String(a);else if(i==="value"||i==="checked")e[i]=a;else if(l){o&&o.size>0&&(s??=new Set).add(l);let d=o?.get(l);if(d&&d.original===a)continue;d&&(d.options!==void 0?e.removeEventListener(l,d.handler,d.options):e.removeEventListener(l,d.handler));let p=W(a,true),u=$(l);u!==void 0?e.addEventListener(l,p,u):e.addEventListener(l,p),C.has(e)||C.set(e,new Map),C.get(e).set(l,{handler:p,original:a,options:u});}else e.setAttribute(i,String(a));}if(o&&o.size>0)if(s===null){for(let[i,a]of o)a.options!==void 0?e.removeEventListener(i,a.handler,a.options):e.removeEventListener(i,a.handler);C.delete(e);}else {for(let[i,a]of o)s.has(i)||(a.options!==void 0?e.removeEventListener(i,a.handler,a.options):e.removeEventListener(i,a.handler),o.delete(i));o.size===0&&C.delete(e);}if(t){let i=n.children||r.children;xn(e,i);}}function xn(e,n){if(!n){e.textContent="";return}if(!Array.isArray(n)&&(typeof n=="string"||typeof n=="number")){e.childNodes.length===1&&e.firstChild?.nodeType===3?e.firstChild.data=String(n):e.textContent=String(n);return}if(Array.isArray(n)){Ae(e,n);return}e.textContent="";let t=_(n);t&&e.appendChild(t);}function Ae(e,n){let t=Array.from(e.children),r=n.some(i=>typeof i=="string"||typeof i=="number"),o=n.some(i=>T(i));if(r&&o){let i=Array.from(e.childNodes),a=Math.max(i.length,n.length);for(let l=0;l<a;l++){let d=i[l],p=n[l];if(p===void 0&&d){d.nodeType===1&&R(d),d.remove();continue}if(!d&&p!==void 0){let u=_(p);u&&e.appendChild(u);continue}if(!(!d||p===void 0)){if(typeof p=="string"||typeof p=="number")if(d.nodeType===3)d.data=String(p);else {let u=document.createTextNode(String(p));e.replaceChild(u,d);}else if(T(p))if(d.nodeType===1){let u=d;if(typeof p.type=="string")if(B(u.tagName,p.type))I(u,p);else {let c=_(p);c&&(M(u),R(u),e.replaceChild(c,d));}}else {let u=_(p);u&&e.replaceChild(u,d);}}}return}if(n.length===1&&t.length===0&&e.childNodes.length===1){let i=n[0],a=e.firstChild;if((typeof i=="string"||typeof i=="number")&&a?.nodeType===3){a.data=String(i);return}}t.length===0&&e.childNodes.length>0&&(e.textContent="");let s=Math.max(t.length,n.length);for(let i=0;i<s;i++){let a=t[i],l=n[i];if(l===void 0&&a){R(a),a.remove();continue}if(!a&&l!==void 0){let d=_(l);d&&e.appendChild(d);continue}if(!(!a||l===void 0))if(typeof l=="string"||typeof l=="number")a.textContent=String(l);else if(T(l))if(typeof l.type=="string")if(B(a.tagName,l.type))I(a,l);else {let d=_(l);d&&(a instanceof Element&&M(a),R(a),e.replaceChild(d,a));}else {let d=_(l);d&&(a instanceof Element&&M(a),R(a),e.replaceChild(d,a));}else {let d=_(l);d&&(a instanceof Element&&M(a),R(a),e.replaceChild(d,a));}}}function le(e,n){let t=n.length,r=0,o=0,s=G(),i=process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true";for(let d=0;d<t;d++){let{key:p,vnode:u}=n[d],c=e.children[d];if(c&&T(u)&&typeof u.type=="string"){let f=u.type;if(B(c.tagName,f)){let g=u.children||u.props?.children;i&&re("positional idx",d,{chTag:c.tagName,vnodeType:f,chChildNodes:c.childNodes.length,childrenType:Array.isArray(g)?"array":typeof g}),Fn(c,g,u),In(c,p,()=>o++),r++;continue}else i&&re("positional tag mismatch",d,{chTag:c.tagName,vnodeType:f});}else i&&re("positional missing or invalid",d,{ch:!!c});Dn(e,d,u);}let a=G()-s;On(e,n);let l={n:t,reused:r,updatedKeys:o,t:a};return te(l,"bulkKeyedPositionalHits"),l}function Fn(e,n,t){typeof n=="string"||typeof n=="number"?H(e,String(n)):Array.isArray(n)&&n.length===1&&(typeof n[0]=="string"||typeof n[0]=="number")?H(e,String(n[0])):Mn(e,t)||I(e,t);}function Mn(e,n){let t=n.children||n.props?.children;if(!Array.isArray(t)||t.length!==2)return false;let r=t[0],o=t[1];if(!T(r)||!T(o)||typeof r.type!="string"||typeof o.type!="string")return false;let s=e.children[0],i=e.children[1];if(!s||!i||!B(s.tagName,r.type)||!B(i.tagName,o.type))return false;let a=r.children||r.props?.children,l=o.children||o.props?.children;if(typeof a=="string"||typeof a=="number")H(s,String(a));else if(Array.isArray(a)&&a.length===1&&(typeof a[0]=="string"||typeof a[0]=="number"))H(s,String(a[0]));else return false;if(typeof l=="string"||typeof l=="number")H(i,String(l));else if(Array.isArray(l)&&l.length===1&&(typeof l[0]=="string"||typeof l[0]=="number"))H(i,String(l[0]));else return false;return true}function H(e,n){e.childNodes.length===1&&e.firstChild?.nodeType===3?e.firstChild.data=n:e.textContent=n;}function In(e,n,t){try{let r=String(n);if(e.getAttribute("data-key")===r)return;e.setAttribute("data-key",r),t();}catch{}}function Pn(e){switch(e){case "div":return "DIV";case "span":return "SPAN";case "p":return "P";case "a":return "A";case "button":return "BUTTON";case "input":return "INPUT";case "ul":return "UL";case "ol":return "OL";case "li":return "LI";default:return null}}function Y(e,n){if(e===n)return true;let t=e.length;if(t!==n.length)return false;for(let r=0;r<t;r++){let o=e.charCodeAt(r),s=n.charCodeAt(r);if(o===s)continue;let i=o>=65&&o<=90?o+32:o,a=s>=65&&s<=90?s+32:s;if(i!==a)return false}return true}function B(e,n){let t=Pn(n);return t!==null&&e===t?true:Y(e,n)}function Dn(e,n,t){let r=_(t);if(r){let o=e.children[n];o?(R(o),e.replaceChild(r,o)):e.appendChild(r);}}function On(e,n){try{let t=S.get(e),r=t?(t.clear(),t):new Map;for(let o=0;o<n.length;o++){let s=n[o].key,i=e.children[o];i&&r.set(s,i);}S.set(e,r);}catch{}}function Je(e,n){let t=G(),r=Array.from(e.childNodes),o=[],s=0,i=0;for(let p=0;p<n.length;p++){let u=Kn(n[p],r[p],o);u==="reused"?s++:u==="created"&&i++;}let a=G()-t,l=Hn(e,o);S.delete(e);let d={n:n.length,reused:s,created:i,tBuild:a,tCommit:l};return Bn(d),d}function Kn(e,n,t){return typeof e=="string"||typeof e=="number"?Ln(String(e),n,t):typeof e=="object"&&e!==null&&"type"in e?Vn(e,n,t):"skipped"}function Ln(e,n,t){return n&&n.nodeType===3?(n.data=e,t.push(n),"reused"):(t.push(document.createTextNode(e)),"created")}function Vn(e,n,t){let r=e;if(typeof r.type=="string"){let s=r.type;if(n&&n.nodeType===1&&B(n.tagName,s))return I(n,e),t.push(n),"reused"}let o=_(e);return o?(t.push(o),"created"):"skipped"}function Hn(e,n){let t=Date.now(),r=document.createDocumentFragment();for(let o=0;o<n.length;o++)r.appendChild(n[o]);try{for(let o=e.firstChild;o;){let s=o.nextSibling;o instanceof Element&&M(o),R(o),o=s;}}catch{}return ne("bulk-text-replace"),e.replaceChildren(r),Date.now()-t}function Bn(e){try{b("__LAST_BULK_TEXT_FASTPATH_STATS",e),b("__LAST_FASTPATH_STATS",e),b("__LAST_FASTPATH_COMMIT_COUNT",1),N("bulkTextFastpathHits");}catch{}}function Ye(e,n){let t=Number(process.env.ASKR_BULK_TEXT_THRESHOLD)||1024,r=.8,o=Array.isArray(n)?n.length:0;if(o<t)return Se({phase:"bulk-unkeyed-eligible",reason:"too-small",total:o,threshold:t}),false;let s=Un(n);if(s.componentFound!==void 0)return Se({phase:"bulk-unkeyed-eligible",reason:"component-child",index:s.componentFound}),false;let i=s.simple/o,a=i>=r&&e.childNodes.length>=o;return Se({phase:"bulk-unkeyed-eligible",total:o,simple:s.simple,fraction:i,requiredFraction:r,eligible:a}),a}function Un(e){let n=0;for(let t=0;t<e.length;t++){let r=e[t];if(typeof r=="string"||typeof r=="number"){n++;continue}if(typeof r=="object"&&r!==null&&"type"in r){let o=r;if(typeof o.type=="function")return {simple:n,componentFound:t};typeof o.type=="string"&&qn(o)&&n++;}}return {simple:n}}function qn(e){let n=e.children||e.props?.children;return !!(!n||typeof n=="string"||typeof n=="number"||Array.isArray(n)&&n.length===1&&(typeof n[0]=="string"||typeof n[0]=="number"))}function Se(e){if(process.env.ASKR_FASTPATH_DEBUG==="1")try{b("__BULK_DIAG",e);}catch{}}function Ze(e,n,t,r){if(typeof document>"u")return null;let o=n.length;if(o===0&&(!r||r.length===0))return null;Ne()||a.warn("[Askr][FASTPATH][DEV] Fast-path reconciliation invoked outside scheduler execution");let s,i;if(o<=20)try{let u=e.children;s=new Array(u.length);for(let c=0;c<u.length;c++)s[c]=u[c];}catch(u){s=void 0;}else {i=new Map;try{for(let u=e.firstElementChild;u;u=u.nextElementSibling){let c=u.getAttribute("data-key");if(c!==null){i.set(c,u);let f=Number(c);Number.isNaN(f)||i.set(f,u);}}}catch(u){i=void 0;}}let a$1=[],l=0,d=0,p=0;for(let u=0;u<n.length;u++){let{key:c,vnode:f}=n[u];l++;let g;if(o<=20&&s){let m=String(c);for(let h=0;h<s.length;h++){let A=s[h],F=A.getAttribute("data-key");if(F!==null&&(F===m||Number(F)===c)){g=A;break}}g||(g=t?.get(c));}else g=i?.get(c)??t?.get(c);if(g)a$1.push(g),p++;else {let m=_(f);m&&(a$1.push(m),d++);}}if(r&&r.length)for(let u of r){let c=_(u);c&&(a$1.push(c),d++);}try{let u=Date.now(),c=document.createDocumentFragment(),f=0;for(let m=0;m<a$1.length;m++)c.appendChild(a$1[m]),f++;try{for(let m=e.firstChild;m;){let h=m.nextSibling;m instanceof Element&&M(m),R(m),m=h;}}catch(m){}try{N("__DOM_REPLACE_COUNT"),b("__LAST_DOM_REPLACE_STACK_FASTPATH",new Error().stack);}catch(m){}e.replaceChildren(c);try{b("__LAST_FASTPATH_COMMIT_COUNT",1);}catch(m){}try{X()&&_e(e);}catch(m){}let g=new Map;for(let m=0;m<n.length;m++){let h=n[m].key,A=a$1[m];A instanceof Element&&g.set(h,A);}try{let m={n:o,moves:0,lisLen:0,t_lookup:0,t_fragment:Date.now()-u,t_commit:0,t_bookkeeping:0,fragmentAppendCount:f,mapLookups:l,createdNodes:d,reusedCount:p};typeof globalThis<"u"&&(b("__LAST_FASTPATH_STATS",m),b("__LAST_FASTPATH_REUSED",p>0),N("fastpathHistoryPush")),(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH]",JSON.stringify({n:o,createdNodes:d,reusedCount:p}));}catch(m){}try{De.add(e);}catch(m){}return g}catch(u){return null}}function ue(e,n){if(e===n)return true;if(e.length!==n.length)return false;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t),o=n.charCodeAt(t);if(r===o)continue;let s=r>=65&&r<=90?r+32:r,i=o>=65&&o<=90?o+32:o;if(s!==i)return false}return true}function ce(e,n,t){let{keyedVnodes:r,unkeyedVnodes:o}=$n(n),s=t||jn(e),i=Wn(e,n,r,o,s);return i||Qn(e,n,r,s)}function jn(e){let n=new Map;try{for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}}catch{}return n}function $n(e){let n=[],t=[];for(let r=0;r<e.length;r++){let o=e[r],s=D(o);s!==void 0?n.push({key:s,vnode:o}):t.push(o);}return {keyedVnodes:n,unkeyedVnodes:t}}function Wn(e,n,t,r,o){try{let s=Gn(e,n,t,r,o);if(s)return s;let i=Xn(e,t);if(i)return i}catch{}return null}function Gn(e,n,t,r,o){if(L(e,n,o).useFastPath&&t.length>=128||X())try{let i=Ze(e,t,o,r);if(i)return S.set(e,i),i}catch{}return null}function Xn(e,n){let t=n.length;if(t<10||zn(e,n)/t<.9||Jn(e,n))return null;try{let o=le(e,n);return te(o,"bulkKeyedPositionalHits"),Yn(e),S.get(e)}catch{return null}}function zn(e,n){let t=0;try{for(let r=0;r<n.length;r++){let o=n[r].vnode;if(!o||typeof o!="object"||typeof o.type!="string")continue;let s=e.children[r];s&&ue(s.tagName,o.type)&&t++;}}catch{}return t}function Jn(e,n){try{for(let t=0;t<n.length;t++){let r=n[t].vnode,o=e.children[t];if(!(!o||!r||typeof r!="object")&&Me(o,r.props||{}))return !0}}catch{return true}return false}function Yn(e){try{let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}S.set(e,n);}catch{}}function Qn(e,n,t,r){let o=new Map,s=[],i=new WeakSet,a=Zn(e,r,i);for(let l=0;l<n.length;l++){let d=n[l],p=nt(d,l,e,a,i,o);p&&s.push(p);}return typeof document>"u"||(at(e,s),S.delete(e)),o}function Zn(e,n,t){return r=>{if(!n)return;let o=n.get(r);if(o&&!t.has(o))return t.add(o),o;let s=String(r),i=n.get(s);if(i&&!t.has(i))return t.add(i),i;let a=Number(s);if(!Number.isNaN(a)){let l=n.get(a);if(l&&!t.has(l))return t.add(l),l}return et(e,r,s,t)}}function et(e,n,t,r){try{for(let o=e.firstElementChild;o;o=o.nextElementSibling){if(r.has(o))continue;let s=o.getAttribute("data-key");if(s===t)return r.add(o),o;if(s!==null){let i=Number(s);if(!Number.isNaN(i)&&i===n)return r.add(o),o}}}catch{}}function nt(e,n,t,r,o,s){let i=D(e);return i!==void 0?tt(e,i,t,r,s):rt(e,n,t,o)}function tt(e,n,t,r,o){let s=r(n);if(s&&s.parentElement===t)try{let a=e;if(a&&typeof a=="object"&&typeof a.type=="string"&&ue(s.tagName,a.type))return I(s,e),o.set(n,s),s}catch{}let i=_(e);return i?(i instanceof Element&&o.set(n,i),i):null}function rt(e,n,t,r){try{let s=t.children[n];if(s&&(typeof e=="string"||typeof e=="number")&&s.nodeType===1)return s.textContent=String(e),r.add(s),s;if(ot(s,e))return I(s,e),r.add(s),s;let i=st(t,r);if(i){let a=it(i,e,r);if(a)return a}}catch{}return _(e)}function ot(e,n){if(!e||typeof n!="object"||n===null||!("type"in n))return false;let t=n,r=e.getAttribute("data-key");return r==null&&typeof t.type=="string"&&ue(e.tagName,t.type)}function st(e,n){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(!n.has(t)&&t.getAttribute("data-key")===null)return t}function it(e,n,t){if(typeof n=="string"||typeof n=="number")return e.textContent=String(n),t.add(e),e;if(typeof n=="object"&&n!==null&&"type"in n){let r=n;if(typeof r.type=="string"&&ue(e.tagName,r.type))return I(e,n),t.add(e),e}return null}function at(e,n){let t=document.createDocumentFragment();for(let r=0;r<n.length;r++)t.appendChild(n[r]);try{for(let r=e.firstChild;r;){let o=r.nextSibling;r instanceof Element&&M(r),R(r),r=o;}}catch{}ne("reconcile"),e.replaceChildren(t);}var be=new WeakMap;function Te(e,n){if(e===n)return true;if(e.length!==n.length)return false;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t),o=n.charCodeAt(t);if(r===o)continue;let s=r>=65&&r<=90?r+32:r,i=o>=65&&o<=90?o+32:o;if(s!==i)return false}return true}function lt(e){if(Array.isArray(e)){if(e.length===1){let n=e[0];if(typeof n=="string"||typeof n=="number")return {isSimple:true,text:String(n)}}}else if(typeof e=="string"||typeof e=="number")return {isSimple:true,text:String(e)};return {isSimple:false}}function ut(e,n){return e.childNodes.length===1&&e.firstChild?.nodeType===3?(e.firstChild.data=n,true):false}function en(e){let n=new Map;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let r=t.getAttribute("data-key");if(r!==null){n.set(r,t);let o=Number(r);Number.isNaN(o)||n.set(o,t);}}return n}function ct(e){let n=S.get(e);return n||(n=en(e),n.size>0&&S.set(e,n)),n.size>0?n:void 0}function nn(e){for(let n=0;n<e.length;n++)if(D(e[n])!==void 0)return true;return false}function dt(e,n,t){if(process.env.ASKR_FORCE_BULK_POSREUSE==="1"&&ft(e,n))return;let r=ce(e,n,t);S.set(e,r);}function ft(e,n){try{let t=[];for(let s of n)T(s)&&s.key!==void 0&&t.push({key:s.key,vnode:s});if(t.length===0||t.length!==n.length)return !1;(process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH] forced positional bulk keyed reuse (evaluate-level)");let r=le(e,t);if(process.env.ASKR_FASTPATH_DEBUG==="1")try{b("__LAST_FASTPATH_STATS",r),b("__LAST_FASTPATH_COMMIT_COUNT",1),N("bulkKeyedPositionalForced");}catch{}let o=en(e);return S.set(e,o),!0}catch(t){return (process.env.ASKR_FASTPATH_DEBUG==="1"||process.env.ASKR_FASTPATH_DEBUG==="true")&&a.warn("[Askr][FASTPATH] forced bulk path failed, falling back",t),false}}function mt(e,n){if(Ye(e,n)){Je(e,n);}else Ae(e,n);S.delete(e);}function pt(e,n){if(!n){e.textContent="",S.delete(e);return}if(!Array.isArray(n)){e.textContent="";let t=_(n);t&&e.appendChild(t),S.delete(e);return}if(nn(n)){let t=ct(e);try{dt(e,n,t);}catch{let r=ce(e,n,t);S.set(e,r);}}else mt(e,n);}function Ce(e,n){let t=n.children||n.props?.children;t&&!Array.isArray(t)&&(t=[t]);let r=lt(t);r.isSimple&&ut(e,r.text)||pt(e,t),I(e,n,false);}function ht(e,n){let t=e.firstElementChild;for(let r=0;r<n.length;r++){let o=n[r],s=t?t.nextElementSibling:null;if(t&&T(o)&&typeof o.type=="string"&&Te(t.tagName,o.type)){Ce(t,o),t=s;continue}let i=_(o);i&&(t?e.replaceChild(i,t):e.appendChild(i)),t=s;}for(;t;){let r=t.nextElementSibling;e.removeChild(t),t=r;}}function gt(e,n){for(let[t,r]of Object.entries(n)){if(t==="children"||t==="key"||r==null||r===false)continue;if(t==="ref"){yt(e,r);continue}let o=j(t);if(o){let s=W(r,true),i=$(o);i!==void 0?e.addEventListener(o,s,i):e.addEventListener(o,s),C.has(e)||C.set(e,new Map),C.get(e).set(o,{handler:s,original:r,options:i});continue}t==="class"||t==="className"?e.className=String(r):t==="value"||t==="checked"?e[t]=r:e.setAttribute(t,String(r));}}function yt(e,n){let t=n;if(t){if(typeof t=="function"){t(e);return}try{t.current=e;}catch{}}}function _t(e,n){let t=n.children;if(!Array.isArray(t)||!nn(t))return false;let r=document.createElement(n.type);e.appendChild(r),gt(r,n.props||{});let o=ce(r,t,void 0);return S.set(r,o),true}function Et(e){return T(e)&&typeof e.type=="symbol"&&(e.type===b$1||String(e.type)==="Symbol(askr.fragment)")}function St(e){let n=e.props?.children||e.children||[];return Array.isArray(n)?n:[n]}function U(e,n,t){if(n&&!(typeof document>"u"))if(t&&be.has(t)){let r=be.get(t),o=r.start.nextSibling;for(;o&&o!==r.end;){let i=o.nextSibling;o.remove(),o=i;}let s=_(e);s&&n.insertBefore(s,r.end);}else if(t){let r=document.createComment("component-start"),o=document.createComment("component-end");n.appendChild(r),n.appendChild(o),be.set(t,{start:r,end:o});let s=_(e);s&&n.insertBefore(s,o);}else {let r=e;if(Et(r)){let a=St(r);if(a.length===1&&T(a[0])&&typeof a[0].type=="string")r=a[0];else {ht(n,a);return}}let s=n.__ASKR_INSTANCE;if(s&&s.target===n)if(T(r)&&typeof r.type=="string"&&Te(n.tagName,r.type)){Ce(n,r);return}else {let a=_(r);if(a&&n.parentNode){a instanceof Element&&(a.__ASKR_INSTANCE=s,s.target=a),M(n),n.parentNode.replaceChild(a,n);return}}let i=n.children[0];if(i&&T(r)&&typeof r.type=="string"&&Te(i.tagName,r.type))Ce(i,r);else {if(n.textContent="",T(r)&&typeof r.type=="string"&&_t(n,r))return;let a=_(r);a&&n.appendChild(a);}}}if(typeof globalThis<"u"){let e=globalThis;e.__ASKR_RENDERER={evaluate:U,isKeyedReorderFastPathEligible:L,getKeyMapForElement:oe};}function ae(e,n,t,r){let o={id:e,fn:n,props:t,target:r,mounted:false,abortController:new AbortController,stateValues:[],evaluationGeneration:0,notifyUpdate:null,_pendingFlushTask:void 0,_pendingRunTask:void 0,_enqueueRun:void 0,stateIndexCheck:-1,expectedStateIndices:[],firstRenderComplete:false,mountOperations:[],cleanupFns:[],hasPendingUpdate:false,ownerFrame:null,ssr:false,cleanupStrict:false,isRoot:false,_currentRenderToken:void 0,lastRenderToken:0,_pendingReadStates:new Set,_lastReadStates:new Set};return o._pendingRunTask=()=>{o.hasPendingUpdate=false,on(o);},o._enqueueRun=()=>{o.hasPendingUpdate||(o.hasPendingUpdate=true,v.enqueue(o._pendingRunTask));},o._pendingFlushTask=()=>{o.hasPendingUpdate=false,o._enqueueRun?.();},o}var x=null,de=0;function $r(){return x}function z(e){x=e;}function tn(e){if(e.isRoot){for(let n of e.mountOperations){let t=n();t instanceof Promise?t.then(r=>{typeof r=="function"&&e.cleanupFns.push(r);}):typeof t=="function"&&e.cleanupFns.push(t);}e.mountOperations=[];}}function ke(e,n){e.target=n;try{n instanceof Element&&(n.__ASKR_INSTANCE=e);}catch(r){}e.notifyUpdate=e._enqueueRun;let t=!e.mounted;e.mounted=true,t&&e.mountOperations.length>0&&tn(e);}var rn=0;function on(e){e.notifyUpdate=e._enqueueRun,e._currentRenderToken=++rn,e._pendingReadStates=new Set;let n=e.target?e.target.innerHTML:"",t=sn(e);if(t instanceof Promise)throw new Error("Async components are not supported. Components must be synchronous.");{let r=globalThis.__ASKR_FASTLANE;try{if(r?.tryRuntimeFastLaneSync?.(e,t))return}catch{}v.enqueue(()=>{if(!e.target&&e._placeholder){if(t==null){O(e);return}let o=e._placeholder,s=o.parentNode;if(!s){a.warn("[Askr] placeholder no longer in DOM, cannot render component");return}let i=document.createElement("div"),a$1=x;x=e;try{U(t,i),s.replaceChild(i,o),e.target=i,e._placeholder=void 0,i.__ASKR_INSTANCE=e,O(e);}finally{x=a$1;}return}if(e.target){let o=[];try{let s=!e.mounted,i=x;x=e,o=Array.from(e.target.childNodes);try{U(t,e.target);}catch(a$1){try{let l=Array.from(e.target.childNodes);for(let d of l)try{Ee(d);}catch(p){a.warn("[Askr] error cleaning up failed commit children:",p);}}catch(l){}try{N("__DOM_REPLACE_COUNT"),b("__LAST_DOM_REPLACE_STACK_COMPONENT_RESTORE",new Error().stack);}catch(l){}throw e.target.replaceChildren(...o),a$1}finally{x=i;}O(e),e.mounted=!0,s&&e.mountOperations.length>0&&tn(e);}catch(s){try{let i=Array.from(e.target.childNodes);for(let a$1 of i)try{Ee(a$1);}catch(l){a.warn("[Askr] error cleaning up partial children during rollback:",l);}}catch(i){}try{try{N("__DOM_REPLACE_COUNT"),b("__LAST_DOM_REPLACE_STACK_COMPONENT_ROLLBACK",new Error().stack);}catch(i){}e.target.replaceChildren(...o);}catch{e.target.innerHTML=n;}throw s}}});}}function Qe(e){let n=e._currentRenderToken!==void 0,t=e._currentRenderToken,r=e._pendingReadStates;n||(e._currentRenderToken=++rn,e._pendingReadStates=new Set);try{let o=sn(e);return n||O(e),o}finally{e._currentRenderToken=t,e._pendingReadStates=r??new Set;}}function sn(e){e.stateIndexCheck=-1;for(let n of e.stateValues)n&&(n._hasBeenRead=false);e._pendingReadStates=new Set,x=e,de=0;try{let t={signal:e.abortController.signal},r={parent:e.ownerFrame,values:null},o=q(r,()=>e.fn(e.props,t)),s=Date.now()-0;s>5&&a.warn(`[askr] Slow render detected: ${s}ms. Consider optimizing component performance.`),e.firstRenderComplete||(e.firstRenderComplete=!0);for(let i=0;i<e.stateValues.length;i++){let a$1=e.stateValues[i];if(a$1&&!a$1._hasBeenRead)try{let l=e.fn?.name||"<anonymous>";a.warn(`[askr] Unused state variable detected in ${l} at index ${i}. State should be read during render or removed.`);}catch{a.warn("[askr] Unused state variable detected. State should be read during render or removed.");}}return o}finally{x=null;}}function kt(e){e.abortController=new AbortController,e.notifyUpdate=e._enqueueRun,v.enqueue(()=>on(e));}function J(){return x}function Gr(){if(!x)throw new Error("getSignal() can only be called during component render execution. Ensure you are calling this from inside your component function.");return x.abortController.signal}function O(e){let n=e._pendingReadStates??new Set,t=e._lastReadStates??new Set,r=e._currentRenderToken;if(r!==void 0){for(let o of t)if(!n.has(o)){let s=o._readers;s&&s.delete(e);}e.lastRenderToken=r;for(let o of n){let s=o._readers;s||(s=new Map,o._readers=s),s.set(e,e.lastRenderToken??0);}e._lastReadStates=n,e._pendingReadStates=new Set,e._currentRenderToken=void 0;}}function Xr(){return de++}function We(){return de}function Ge(e){de=e;}function zr(e){kt(e);}function Ue(e){let n=[];for(let t of e.cleanupFns)try{t();}catch(r){e.cleanupStrict&&n.push(r);}if(e.cleanupFns=[],n.length>0)throw new AggregateError(n,`Cleanup failed for component ${e.id}`);if(e._lastReadStates){for(let t of e._lastReadStates){let r=t._readers;r&&r.delete(e);}e._lastReadStates=new Set;}e.abortController.abort(),e.notifyUpdate=null,e.mounted=false;}export{fe as a,v as b,Ct as c,we as d,X as e,Le as f,M as g,Wt as h,ae as i,$r as j,z as k,J as l,Gr as m,Xr as n,zr as o,Ue as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{d as cleanupNavigation,c as initializeNavigation,b as navigate,a as registerAppInstance}from'./chunk-OD6C42QU.js';import'./chunk-7DNGQWPJ.js';import'./chunk-D2JSJKCW.js';import'./chunk-LW2VF6A3.js';import'./chunk-HGMOQ3I7.js';import'./chunk-BP2CKUO6.js';import'./chunk-37RC6ZT3.js';import'./chunk-62D2TNHX.js';
|