@tanstack/router-devtools-core 1.133.0 → 1.133.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/{BaseTanStackRouterDevtoolsPanel-Cbvcs84k.js → BaseTanStackRouterDevtoolsPanel-KIEU40vQ.js} +53 -55
  2. package/dist/{BaseTanStackRouterDevtoolsPanel-Cbvcs84k.js.map → BaseTanStackRouterDevtoolsPanel-KIEU40vQ.js.map} +1 -1
  3. package/dist/{BaseTanStackRouterDevtoolsPanel-CiObEXSM.cjs → BaseTanStackRouterDevtoolsPanel-z0YMII09.cjs} +228 -230
  4. package/dist/{BaseTanStackRouterDevtoolsPanel-CiObEXSM.cjs.map → BaseTanStackRouterDevtoolsPanel-z0YMII09.cjs.map} +1 -1
  5. package/dist/FloatingTanStackRouterDevtools-7aOMOekg.cjs +281 -0
  6. package/dist/{FloatingTanStackRouterDevtools-BMhRQRk5.cjs.map → FloatingTanStackRouterDevtools-7aOMOekg.cjs.map} +1 -1
  7. package/dist/{FloatingTanStackRouterDevtools-KvPiI7YB.js → FloatingTanStackRouterDevtools-kcMbkHXI.js} +4 -6
  8. package/dist/{FloatingTanStackRouterDevtools-KvPiI7YB.js.map → FloatingTanStackRouterDevtools-kcMbkHXI.js.map} +1 -1
  9. package/dist/cjs/TanStackRouterDevtoolsCore.d.cts +4 -5
  10. package/dist/cjs/TanStackRouterDevtoolsPanelCore.d.cts +2 -3
  11. package/dist/cjs/index.cjs +1 -1
  12. package/dist/esm/TanStackRouterDevtoolsCore.d.ts +4 -5
  13. package/dist/esm/TanStackRouterDevtoolsPanelCore.d.ts +2 -3
  14. package/dist/esm/index.js +2 -2
  15. package/dist/index-CC1CXbDA.cjs +1792 -0
  16. package/dist/index-CC1CXbDA.cjs.map +1 -0
  17. package/dist/index-DX7UIGS3.js +1793 -0
  18. package/dist/index-DX7UIGS3.js.map +1 -0
  19. package/package.json +15 -3
  20. package/src/TanStackRouterDevtoolsCore.tsx +4 -6
  21. package/src/TanStackRouterDevtoolsPanelCore.tsx +2 -4
  22. package/dist/FloatingTanStackRouterDevtools-BMhRQRk5.cjs +0 -283
  23. package/dist/index-Bz4rofgr.js +0 -222
  24. package/dist/index-Bz4rofgr.js.map +0 -1
  25. package/dist/index-sVJ8jjbP.cjs +0 -221
  26. package/dist/index-sVJ8jjbP.cjs.map +0 -1
@@ -0,0 +1,1792 @@
1
+ "use strict";
2
+ const sharedConfig = {
3
+ context: void 0,
4
+ registry: void 0,
5
+ effects: void 0,
6
+ done: false,
7
+ getContextId() {
8
+ return getContextId(this.context.count);
9
+ },
10
+ getNextContextId() {
11
+ return getContextId(this.context.count++);
12
+ }
13
+ };
14
+ function getContextId(count) {
15
+ const num = String(count), len = num.length - 1;
16
+ return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : "") + num;
17
+ }
18
+ function setHydrateContext(context) {
19
+ sharedConfig.context = context;
20
+ }
21
+ const IS_DEV = false;
22
+ const equalFn = (a, b) => a === b;
23
+ const $PROXY = Symbol("solid-proxy");
24
+ const SUPPORTS_PROXY = typeof Proxy === "function";
25
+ const $TRACK = Symbol("solid-track");
26
+ const signalOptions = {
27
+ equals: equalFn
28
+ };
29
+ let runEffects = runQueue;
30
+ const STALE = 1;
31
+ const PENDING = 2;
32
+ const UNOWNED = {
33
+ owned: null,
34
+ cleanups: null,
35
+ context: null,
36
+ owner: null
37
+ };
38
+ const NO_INIT = {};
39
+ var Owner = null;
40
+ let Transition = null;
41
+ let ExternalSourceConfig = null;
42
+ let Listener = null;
43
+ let Updates = null;
44
+ let Effects = null;
45
+ let ExecCount = 0;
46
+ function createRoot(fn, detachedOwner) {
47
+ const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {
48
+ owned: null,
49
+ cleanups: null,
50
+ context: current ? current.context : null,
51
+ owner: current
52
+ }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
53
+ Owner = root;
54
+ Listener = null;
55
+ try {
56
+ return runUpdates(updateFn, true);
57
+ } finally {
58
+ Listener = listener;
59
+ Owner = owner;
60
+ }
61
+ }
62
+ function createSignal(value, options) {
63
+ options = options ? Object.assign({}, signalOptions, options) : signalOptions;
64
+ const s = {
65
+ value,
66
+ observers: null,
67
+ observerSlots: null,
68
+ comparator: options.equals || void 0
69
+ };
70
+ const setter = (value2) => {
71
+ if (typeof value2 === "function") {
72
+ value2 = value2(s.value);
73
+ }
74
+ return writeSignal(s, value2);
75
+ };
76
+ return [readSignal.bind(s), setter];
77
+ }
78
+ function createComputed(fn, value, options) {
79
+ const c = createComputation(fn, value, true, STALE);
80
+ updateComputation(c);
81
+ }
82
+ function createRenderEffect(fn, value, options) {
83
+ const c = createComputation(fn, value, false, STALE);
84
+ updateComputation(c);
85
+ }
86
+ function createEffect(fn, value, options) {
87
+ runEffects = runUserEffects;
88
+ const c = createComputation(fn, value, false, STALE);
89
+ if (!options || !options.render) c.user = true;
90
+ Effects ? Effects.push(c) : updateComputation(c);
91
+ }
92
+ function createMemo(fn, value, options) {
93
+ options = options ? Object.assign({}, signalOptions, options) : signalOptions;
94
+ const c = createComputation(fn, value, true, 0);
95
+ c.observers = null;
96
+ c.observerSlots = null;
97
+ c.comparator = options.equals || void 0;
98
+ updateComputation(c);
99
+ return readSignal.bind(c);
100
+ }
101
+ function isPromise(v) {
102
+ return v && typeof v === "object" && "then" in v;
103
+ }
104
+ function createResource(pSource, pFetcher, pOptions) {
105
+ let source;
106
+ let fetcher;
107
+ let options;
108
+ {
109
+ source = true;
110
+ fetcher = pSource;
111
+ options = {};
112
+ }
113
+ let pr = null, initP = NO_INIT, id = null, scheduled = false, resolved = "initialValue" in options, dynamic = typeof source === "function" && createMemo(source);
114
+ const contexts = /* @__PURE__ */ new Set(), [value, setValue] = (options.storage || createSignal)(options.initialValue), [error, setError] = createSignal(void 0), [track, trigger] = createSignal(void 0, {
115
+ equals: false
116
+ }), [state, setState] = createSignal(resolved ? "ready" : "unresolved");
117
+ if (sharedConfig.context) {
118
+ id = sharedConfig.getNextContextId();
119
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;
120
+ else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
121
+ }
122
+ function loadEnd(p, v, error2, key) {
123
+ if (pr === p) {
124
+ pr = null;
125
+ key !== void 0 && (resolved = true);
126
+ if ((p === initP || v === initP) && options.onHydrated)
127
+ queueMicrotask(
128
+ () => options.onHydrated(key, {
129
+ value: v
130
+ })
131
+ );
132
+ initP = NO_INIT;
133
+ completeLoad(v, error2);
134
+ }
135
+ return v;
136
+ }
137
+ function completeLoad(v, err) {
138
+ runUpdates(() => {
139
+ if (err === void 0) setValue(() => v);
140
+ setState(err !== void 0 ? "errored" : resolved ? "ready" : "unresolved");
141
+ setError(err);
142
+ for (const c of contexts.keys()) c.decrement();
143
+ contexts.clear();
144
+ }, false);
145
+ }
146
+ function read() {
147
+ const c = SuspenseContext, v = value(), err = error();
148
+ if (err !== void 0 && !pr) throw err;
149
+ if (Listener && !Listener.user && c) ;
150
+ return v;
151
+ }
152
+ function load(refetching = true) {
153
+ if (refetching !== false && scheduled) return;
154
+ scheduled = false;
155
+ const lookup = dynamic ? dynamic() : source;
156
+ if (lookup == null || lookup === false) {
157
+ loadEnd(pr, untrack(value));
158
+ return;
159
+ }
160
+ const p = initP !== NO_INIT ? initP : untrack(
161
+ () => fetcher(lookup, {
162
+ value: value(),
163
+ refetching
164
+ })
165
+ );
166
+ if (!isPromise(p)) {
167
+ loadEnd(pr, p, void 0, lookup);
168
+ return p;
169
+ }
170
+ pr = p;
171
+ if ("value" in p) {
172
+ if (p.status === "success") loadEnd(pr, p.value, void 0, lookup);
173
+ else loadEnd(pr, void 0, castError(p.value), lookup);
174
+ return p;
175
+ }
176
+ scheduled = true;
177
+ queueMicrotask(() => scheduled = false);
178
+ runUpdates(() => {
179
+ setState(resolved ? "refreshing" : "pending");
180
+ trigger();
181
+ }, false);
182
+ return p.then(
183
+ (v) => loadEnd(p, v, void 0, lookup),
184
+ (e) => loadEnd(p, void 0, castError(e), lookup)
185
+ );
186
+ }
187
+ Object.defineProperties(read, {
188
+ state: {
189
+ get: () => state()
190
+ },
191
+ error: {
192
+ get: () => error()
193
+ },
194
+ loading: {
195
+ get() {
196
+ const s = state();
197
+ return s === "pending" || s === "refreshing";
198
+ }
199
+ },
200
+ latest: {
201
+ get() {
202
+ if (!resolved) return read();
203
+ const err = error();
204
+ if (err && !pr) throw err;
205
+ return value();
206
+ }
207
+ }
208
+ });
209
+ if (dynamic) createComputed(() => load(false));
210
+ else load(false);
211
+ return [
212
+ read,
213
+ {
214
+ refetch: load,
215
+ mutate: setValue
216
+ }
217
+ ];
218
+ }
219
+ function untrack(fn) {
220
+ if (Listener === null) return fn();
221
+ const listener = Listener;
222
+ Listener = null;
223
+ try {
224
+ if (ExternalSourceConfig) ;
225
+ return fn();
226
+ } finally {
227
+ Listener = listener;
228
+ }
229
+ }
230
+ function onCleanup(fn) {
231
+ if (Owner === null) ;
232
+ else if (Owner.cleanups === null) Owner.cleanups = [fn];
233
+ else Owner.cleanups.push(fn);
234
+ return fn;
235
+ }
236
+ const [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
237
+ function createContext(defaultValue, options) {
238
+ const id = Symbol("context");
239
+ return {
240
+ id,
241
+ Provider: createProvider(id),
242
+ defaultValue
243
+ };
244
+ }
245
+ function useContext(context) {
246
+ let value;
247
+ return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
248
+ }
249
+ function children(fn) {
250
+ const children2 = createMemo(fn);
251
+ const memo = createMemo(() => resolveChildren(children2()));
252
+ memo.toArray = () => {
253
+ const c = memo();
254
+ return Array.isArray(c) ? c : c != null ? [c] : [];
255
+ };
256
+ return memo;
257
+ }
258
+ let SuspenseContext;
259
+ function readSignal() {
260
+ if (this.sources && this.state) {
261
+ if (this.state === STALE) updateComputation(this);
262
+ else {
263
+ const updates = Updates;
264
+ Updates = null;
265
+ runUpdates(() => lookUpstream(this), false);
266
+ Updates = updates;
267
+ }
268
+ }
269
+ if (Listener) {
270
+ const sSlot = this.observers ? this.observers.length : 0;
271
+ if (!Listener.sources) {
272
+ Listener.sources = [this];
273
+ Listener.sourceSlots = [sSlot];
274
+ } else {
275
+ Listener.sources.push(this);
276
+ Listener.sourceSlots.push(sSlot);
277
+ }
278
+ if (!this.observers) {
279
+ this.observers = [Listener];
280
+ this.observerSlots = [Listener.sources.length - 1];
281
+ } else {
282
+ this.observers.push(Listener);
283
+ this.observerSlots.push(Listener.sources.length - 1);
284
+ }
285
+ }
286
+ return this.value;
287
+ }
288
+ function writeSignal(node, value, isComp) {
289
+ let current = node.value;
290
+ if (!node.comparator || !node.comparator(current, value)) {
291
+ node.value = value;
292
+ if (node.observers && node.observers.length) {
293
+ runUpdates(() => {
294
+ for (let i = 0; i < node.observers.length; i += 1) {
295
+ const o = node.observers[i];
296
+ const TransitionRunning = Transition && Transition.running;
297
+ if (TransitionRunning && Transition.disposed.has(o)) ;
298
+ if (TransitionRunning ? !o.tState : !o.state) {
299
+ if (o.pure) Updates.push(o);
300
+ else Effects.push(o);
301
+ if (o.observers) markDownstream(o);
302
+ }
303
+ if (!TransitionRunning) o.state = STALE;
304
+ }
305
+ if (Updates.length > 1e6) {
306
+ Updates = [];
307
+ if (IS_DEV) ;
308
+ throw new Error();
309
+ }
310
+ }, false);
311
+ }
312
+ }
313
+ return value;
314
+ }
315
+ function updateComputation(node) {
316
+ if (!node.fn) return;
317
+ cleanNode(node);
318
+ const time = ExecCount;
319
+ runComputation(
320
+ node,
321
+ node.value,
322
+ time
323
+ );
324
+ }
325
+ function runComputation(node, value, time) {
326
+ let nextValue;
327
+ const owner = Owner, listener = Listener;
328
+ Listener = Owner = node;
329
+ try {
330
+ nextValue = node.fn(value);
331
+ } catch (err) {
332
+ if (node.pure) {
333
+ {
334
+ node.state = STALE;
335
+ node.owned && node.owned.forEach(cleanNode);
336
+ node.owned = null;
337
+ }
338
+ }
339
+ node.updatedAt = time + 1;
340
+ return handleError(err);
341
+ } finally {
342
+ Listener = listener;
343
+ Owner = owner;
344
+ }
345
+ if (!node.updatedAt || node.updatedAt <= time) {
346
+ if (node.updatedAt != null && "observers" in node) {
347
+ writeSignal(node, nextValue);
348
+ } else node.value = nextValue;
349
+ node.updatedAt = time;
350
+ }
351
+ }
352
+ function createComputation(fn, init, pure, state = STALE, options) {
353
+ const c = {
354
+ fn,
355
+ state,
356
+ updatedAt: null,
357
+ owned: null,
358
+ sources: null,
359
+ sourceSlots: null,
360
+ cleanups: null,
361
+ value: init,
362
+ owner: Owner,
363
+ context: Owner ? Owner.context : null,
364
+ pure
365
+ };
366
+ if (Owner === null) ;
367
+ else if (Owner !== UNOWNED) {
368
+ {
369
+ if (!Owner.owned) Owner.owned = [c];
370
+ else Owner.owned.push(c);
371
+ }
372
+ }
373
+ return c;
374
+ }
375
+ function runTop(node) {
376
+ if (node.state === 0) return;
377
+ if (node.state === PENDING) return lookUpstream(node);
378
+ if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
379
+ const ancestors = [node];
380
+ while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
381
+ if (node.state) ancestors.push(node);
382
+ }
383
+ for (let i = ancestors.length - 1; i >= 0; i--) {
384
+ node = ancestors[i];
385
+ if (node.state === STALE) {
386
+ updateComputation(node);
387
+ } else if (node.state === PENDING) {
388
+ const updates = Updates;
389
+ Updates = null;
390
+ runUpdates(() => lookUpstream(node, ancestors[0]), false);
391
+ Updates = updates;
392
+ }
393
+ }
394
+ }
395
+ function runUpdates(fn, init) {
396
+ if (Updates) return fn();
397
+ let wait = false;
398
+ if (!init) Updates = [];
399
+ if (Effects) wait = true;
400
+ else Effects = [];
401
+ ExecCount++;
402
+ try {
403
+ const res = fn();
404
+ completeUpdates(wait);
405
+ return res;
406
+ } catch (err) {
407
+ if (!wait) Effects = null;
408
+ Updates = null;
409
+ handleError(err);
410
+ }
411
+ }
412
+ function completeUpdates(wait) {
413
+ if (Updates) {
414
+ runQueue(Updates);
415
+ Updates = null;
416
+ }
417
+ if (wait) return;
418
+ const e = Effects;
419
+ Effects = null;
420
+ if (e.length) runUpdates(() => runEffects(e), false);
421
+ }
422
+ function runQueue(queue) {
423
+ for (let i = 0; i < queue.length; i++) runTop(queue[i]);
424
+ }
425
+ function runUserEffects(queue) {
426
+ let i, userLength = 0;
427
+ for (i = 0; i < queue.length; i++) {
428
+ const e = queue[i];
429
+ if (!e.user) runTop(e);
430
+ else queue[userLength++] = e;
431
+ }
432
+ if (sharedConfig.context) {
433
+ if (sharedConfig.count) {
434
+ sharedConfig.effects || (sharedConfig.effects = []);
435
+ sharedConfig.effects.push(...queue.slice(0, userLength));
436
+ return;
437
+ }
438
+ setHydrateContext();
439
+ }
440
+ if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {
441
+ queue = [...sharedConfig.effects, ...queue];
442
+ userLength += sharedConfig.effects.length;
443
+ delete sharedConfig.effects;
444
+ }
445
+ for (i = 0; i < userLength; i++) runTop(queue[i]);
446
+ }
447
+ function lookUpstream(node, ignore) {
448
+ node.state = 0;
449
+ for (let i = 0; i < node.sources.length; i += 1) {
450
+ const source = node.sources[i];
451
+ if (source.sources) {
452
+ const state = source.state;
453
+ if (state === STALE) {
454
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
455
+ runTop(source);
456
+ } else if (state === PENDING) lookUpstream(source, ignore);
457
+ }
458
+ }
459
+ }
460
+ function markDownstream(node) {
461
+ for (let i = 0; i < node.observers.length; i += 1) {
462
+ const o = node.observers[i];
463
+ if (!o.state) {
464
+ o.state = PENDING;
465
+ if (o.pure) Updates.push(o);
466
+ else Effects.push(o);
467
+ o.observers && markDownstream(o);
468
+ }
469
+ }
470
+ }
471
+ function cleanNode(node) {
472
+ let i;
473
+ if (node.sources) {
474
+ while (node.sources.length) {
475
+ const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
476
+ if (obs && obs.length) {
477
+ const n = obs.pop(), s = source.observerSlots.pop();
478
+ if (index < obs.length) {
479
+ n.sourceSlots[s] = index;
480
+ obs[index] = n;
481
+ source.observerSlots[index] = s;
482
+ }
483
+ }
484
+ }
485
+ }
486
+ if (node.tOwned) {
487
+ for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
488
+ delete node.tOwned;
489
+ }
490
+ if (node.owned) {
491
+ for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
492
+ node.owned = null;
493
+ }
494
+ if (node.cleanups) {
495
+ for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
496
+ node.cleanups = null;
497
+ }
498
+ node.state = 0;
499
+ }
500
+ function castError(err) {
501
+ if (err instanceof Error) return err;
502
+ return new Error(typeof err === "string" ? err : "Unknown error", {
503
+ cause: err
504
+ });
505
+ }
506
+ function handleError(err, owner = Owner) {
507
+ const error = castError(err);
508
+ throw error;
509
+ }
510
+ function resolveChildren(children2) {
511
+ if (typeof children2 === "function" && !children2.length) return resolveChildren(children2());
512
+ if (Array.isArray(children2)) {
513
+ const results = [];
514
+ for (let i = 0; i < children2.length; i++) {
515
+ const result = resolveChildren(children2[i]);
516
+ Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
517
+ }
518
+ return results;
519
+ }
520
+ return children2;
521
+ }
522
+ function createProvider(id, options) {
523
+ return function provider(props) {
524
+ let res;
525
+ createRenderEffect(
526
+ () => res = untrack(() => {
527
+ Owner.context = {
528
+ ...Owner.context,
529
+ [id]: props.value
530
+ };
531
+ return children(() => props.children);
532
+ }),
533
+ void 0
534
+ );
535
+ return res;
536
+ };
537
+ }
538
+ const FALLBACK = Symbol("fallback");
539
+ function dispose(d) {
540
+ for (let i = 0; i < d.length; i++) d[i]();
541
+ }
542
+ function mapArray(list, mapFn, options = {}) {
543
+ let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
544
+ onCleanup(() => dispose(disposers));
545
+ return () => {
546
+ let newItems = list() || [], newLen = newItems.length, i, j;
547
+ newItems[$TRACK];
548
+ return untrack(() => {
549
+ let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
550
+ if (newLen === 0) {
551
+ if (len !== 0) {
552
+ dispose(disposers);
553
+ disposers = [];
554
+ items = [];
555
+ mapped = [];
556
+ len = 0;
557
+ indexes && (indexes = []);
558
+ }
559
+ if (options.fallback) {
560
+ items = [FALLBACK];
561
+ mapped[0] = createRoot((disposer) => {
562
+ disposers[0] = disposer;
563
+ return options.fallback();
564
+ });
565
+ len = 1;
566
+ }
567
+ } else if (len === 0) {
568
+ mapped = new Array(newLen);
569
+ for (j = 0; j < newLen; j++) {
570
+ items[j] = newItems[j];
571
+ mapped[j] = createRoot(mapper);
572
+ }
573
+ len = newLen;
574
+ } else {
575
+ temp = new Array(newLen);
576
+ tempdisposers = new Array(newLen);
577
+ indexes && (tempIndexes = new Array(newLen));
578
+ for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++) ;
579
+ for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
580
+ temp[newEnd] = mapped[end];
581
+ tempdisposers[newEnd] = disposers[end];
582
+ indexes && (tempIndexes[newEnd] = indexes[end]);
583
+ }
584
+ newIndices = /* @__PURE__ */ new Map();
585
+ newIndicesNext = new Array(newEnd + 1);
586
+ for (j = newEnd; j >= start; j--) {
587
+ item = newItems[j];
588
+ i = newIndices.get(item);
589
+ newIndicesNext[j] = i === void 0 ? -1 : i;
590
+ newIndices.set(item, j);
591
+ }
592
+ for (i = start; i <= end; i++) {
593
+ item = items[i];
594
+ j = newIndices.get(item);
595
+ if (j !== void 0 && j !== -1) {
596
+ temp[j] = mapped[i];
597
+ tempdisposers[j] = disposers[i];
598
+ indexes && (tempIndexes[j] = indexes[i]);
599
+ j = newIndicesNext[j];
600
+ newIndices.set(item, j);
601
+ } else disposers[i]();
602
+ }
603
+ for (j = start; j < newLen; j++) {
604
+ if (j in temp) {
605
+ mapped[j] = temp[j];
606
+ disposers[j] = tempdisposers[j];
607
+ if (indexes) {
608
+ indexes[j] = tempIndexes[j];
609
+ indexes[j](j);
610
+ }
611
+ } else mapped[j] = createRoot(mapper);
612
+ }
613
+ mapped = mapped.slice(0, len = newLen);
614
+ items = newItems.slice(0);
615
+ }
616
+ return mapped;
617
+ });
618
+ function mapper(disposer) {
619
+ disposers[j] = disposer;
620
+ if (indexes) {
621
+ const [s, set] = createSignal(j);
622
+ indexes[j] = set;
623
+ return mapFn(newItems[j], s);
624
+ }
625
+ return mapFn(newItems[j]);
626
+ }
627
+ };
628
+ }
629
+ function createComponent(Comp, props) {
630
+ return untrack(() => Comp(props || {}));
631
+ }
632
+ function trueFn() {
633
+ return true;
634
+ }
635
+ const propTraps = {
636
+ get(_, property, receiver) {
637
+ if (property === $PROXY) return receiver;
638
+ return _.get(property);
639
+ },
640
+ has(_, property) {
641
+ if (property === $PROXY) return true;
642
+ return _.has(property);
643
+ },
644
+ set: trueFn,
645
+ deleteProperty: trueFn,
646
+ getOwnPropertyDescriptor(_, property) {
647
+ return {
648
+ configurable: true,
649
+ enumerable: true,
650
+ get() {
651
+ return _.get(property);
652
+ },
653
+ set: trueFn,
654
+ deleteProperty: trueFn
655
+ };
656
+ },
657
+ ownKeys(_) {
658
+ return _.keys();
659
+ }
660
+ };
661
+ function resolveSource(s) {
662
+ return !(s = typeof s === "function" ? s() : s) ? {} : s;
663
+ }
664
+ function resolveSources() {
665
+ for (let i = 0, length = this.length; i < length; ++i) {
666
+ const v = this[i]();
667
+ if (v !== void 0) return v;
668
+ }
669
+ }
670
+ function mergeProps(...sources) {
671
+ let proxy = false;
672
+ for (let i = 0; i < sources.length; i++) {
673
+ const s = sources[i];
674
+ proxy = proxy || !!s && $PROXY in s;
675
+ sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
676
+ }
677
+ if (SUPPORTS_PROXY && proxy) {
678
+ return new Proxy(
679
+ {
680
+ get(property) {
681
+ for (let i = sources.length - 1; i >= 0; i--) {
682
+ const v = resolveSource(sources[i])[property];
683
+ if (v !== void 0) return v;
684
+ }
685
+ },
686
+ has(property) {
687
+ for (let i = sources.length - 1; i >= 0; i--) {
688
+ if (property in resolveSource(sources[i])) return true;
689
+ }
690
+ return false;
691
+ },
692
+ keys() {
693
+ const keys = [];
694
+ for (let i = 0; i < sources.length; i++)
695
+ keys.push(...Object.keys(resolveSource(sources[i])));
696
+ return [...new Set(keys)];
697
+ }
698
+ },
699
+ propTraps
700
+ );
701
+ }
702
+ const sourcesMap = {};
703
+ const defined = /* @__PURE__ */ Object.create(null);
704
+ for (let i = sources.length - 1; i >= 0; i--) {
705
+ const source = sources[i];
706
+ if (!source) continue;
707
+ const sourceKeys = Object.getOwnPropertyNames(source);
708
+ for (let i2 = sourceKeys.length - 1; i2 >= 0; i2--) {
709
+ const key = sourceKeys[i2];
710
+ if (key === "__proto__" || key === "constructor") continue;
711
+ const desc = Object.getOwnPropertyDescriptor(source, key);
712
+ if (!defined[key]) {
713
+ defined[key] = desc.get ? {
714
+ enumerable: true,
715
+ configurable: true,
716
+ get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
717
+ } : desc.value !== void 0 ? desc : void 0;
718
+ } else {
719
+ const sources2 = sourcesMap[key];
720
+ if (sources2) {
721
+ if (desc.get) sources2.push(desc.get.bind(source));
722
+ else if (desc.value !== void 0) sources2.push(() => desc.value);
723
+ }
724
+ }
725
+ }
726
+ }
727
+ const target = {};
728
+ const definedKeys = Object.keys(defined);
729
+ for (let i = definedKeys.length - 1; i >= 0; i--) {
730
+ const key = definedKeys[i], desc = defined[key];
731
+ if (desc && desc.get) Object.defineProperty(target, key, desc);
732
+ else target[key] = desc ? desc.value : void 0;
733
+ }
734
+ return target;
735
+ }
736
+ function splitProps(props, ...keys) {
737
+ if (SUPPORTS_PROXY && $PROXY in props) {
738
+ const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
739
+ const res = keys.map((k) => {
740
+ return new Proxy(
741
+ {
742
+ get(property) {
743
+ return k.includes(property) ? props[property] : void 0;
744
+ },
745
+ has(property) {
746
+ return k.includes(property) && property in props;
747
+ },
748
+ keys() {
749
+ return k.filter((property) => property in props);
750
+ }
751
+ },
752
+ propTraps
753
+ );
754
+ });
755
+ res.push(
756
+ new Proxy(
757
+ {
758
+ get(property) {
759
+ return blocked.has(property) ? void 0 : props[property];
760
+ },
761
+ has(property) {
762
+ return blocked.has(property) ? false : property in props;
763
+ },
764
+ keys() {
765
+ return Object.keys(props).filter((k) => !blocked.has(k));
766
+ }
767
+ },
768
+ propTraps
769
+ )
770
+ );
771
+ return res;
772
+ }
773
+ const otherObject = {};
774
+ const objects = keys.map(() => ({}));
775
+ for (const propName of Object.getOwnPropertyNames(props)) {
776
+ const desc = Object.getOwnPropertyDescriptor(props, propName);
777
+ const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
778
+ let blocked = false;
779
+ let objectIndex = 0;
780
+ for (const k of keys) {
781
+ if (k.includes(propName)) {
782
+ blocked = true;
783
+ isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
784
+ }
785
+ ++objectIndex;
786
+ }
787
+ if (!blocked) {
788
+ isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
789
+ }
790
+ }
791
+ return [...objects, otherObject];
792
+ }
793
+ function lazy(fn) {
794
+ let comp;
795
+ let p;
796
+ const wrap = (props) => {
797
+ const ctx = sharedConfig.context;
798
+ if (ctx) {
799
+ const [s, set] = createSignal();
800
+ sharedConfig.count || (sharedConfig.count = 0);
801
+ sharedConfig.count++;
802
+ (p || (p = fn())).then((mod) => {
803
+ !sharedConfig.done && setHydrateContext(ctx);
804
+ sharedConfig.count--;
805
+ set(() => mod.default);
806
+ setHydrateContext();
807
+ });
808
+ comp = s;
809
+ } else if (!comp) {
810
+ const [s] = createResource(() => (p || (p = fn())).then((mod) => mod.default));
811
+ comp = s;
812
+ }
813
+ let Comp;
814
+ return createMemo(
815
+ () => (Comp = comp()) ? untrack(() => {
816
+ if (IS_DEV) ;
817
+ if (!ctx || sharedConfig.done) return Comp(props);
818
+ const c = sharedConfig.context;
819
+ setHydrateContext(ctx);
820
+ const r = Comp(props);
821
+ setHydrateContext(c);
822
+ return r;
823
+ }) : ""
824
+ );
825
+ };
826
+ wrap.preload = () => p || ((p = fn()).then((mod) => comp = () => mod.default), p);
827
+ return wrap;
828
+ }
829
+ let counter = 0;
830
+ function createUniqueId() {
831
+ const ctx = sharedConfig.context;
832
+ return ctx ? sharedConfig.getNextContextId() : `cl-${counter++}`;
833
+ }
834
+ const narrowedError = (name) => `Stale read from <${name}>.`;
835
+ function For(props) {
836
+ const fallback = "fallback" in props && {
837
+ fallback: () => props.fallback
838
+ };
839
+ return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
840
+ }
841
+ function Show(props) {
842
+ const keyed = props.keyed;
843
+ const conditionValue = createMemo(() => props.when, void 0, void 0);
844
+ const condition = keyed ? conditionValue : createMemo(conditionValue, void 0, {
845
+ equals: (a, b) => !a === !b
846
+ });
847
+ return createMemo(
848
+ () => {
849
+ const c = condition();
850
+ if (c) {
851
+ const child = props.children;
852
+ const fn = typeof child === "function" && child.length > 0;
853
+ return fn ? untrack(
854
+ () => child(
855
+ keyed ? c : () => {
856
+ if (!untrack(condition)) throw narrowedError("Show");
857
+ return conditionValue();
858
+ }
859
+ )
860
+ ) : child;
861
+ }
862
+ return props.fallback;
863
+ },
864
+ void 0,
865
+ void 0
866
+ );
867
+ }
868
+ function Switch(props) {
869
+ const chs = children(() => props.children);
870
+ const switchFunc = createMemo(() => {
871
+ const ch = chs();
872
+ const mps = Array.isArray(ch) ? ch : [ch];
873
+ let func = () => void 0;
874
+ for (let i = 0; i < mps.length; i++) {
875
+ const index = i;
876
+ const mp = mps[i];
877
+ const prevFunc = func;
878
+ const conditionValue = createMemo(
879
+ () => prevFunc() ? void 0 : mp.when,
880
+ void 0,
881
+ void 0
882
+ );
883
+ const condition = mp.keyed ? conditionValue : createMemo(conditionValue, void 0, {
884
+ equals: (a, b) => !a === !b
885
+ });
886
+ func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : void 0);
887
+ }
888
+ return func;
889
+ });
890
+ return createMemo(
891
+ () => {
892
+ const sel = switchFunc()();
893
+ if (!sel) return props.fallback;
894
+ const [index, conditionValue, mp] = sel;
895
+ const child = mp.children;
896
+ const fn = typeof child === "function" && child.length > 0;
897
+ return fn ? untrack(
898
+ () => child(
899
+ mp.keyed ? conditionValue() : () => {
900
+ if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
901
+ return conditionValue();
902
+ }
903
+ )
904
+ ) : child;
905
+ },
906
+ void 0,
907
+ void 0
908
+ );
909
+ }
910
+ function Match(props) {
911
+ return props;
912
+ }
913
+ const booleans = [
914
+ "allowfullscreen",
915
+ "async",
916
+ "autofocus",
917
+ "autoplay",
918
+ "checked",
919
+ "controls",
920
+ "default",
921
+ "disabled",
922
+ "formnovalidate",
923
+ "hidden",
924
+ "indeterminate",
925
+ "inert",
926
+ "ismap",
927
+ "loop",
928
+ "multiple",
929
+ "muted",
930
+ "nomodule",
931
+ "novalidate",
932
+ "open",
933
+ "playsinline",
934
+ "readonly",
935
+ "required",
936
+ "reversed",
937
+ "seamless",
938
+ "selected"
939
+ ];
940
+ const Properties = /* @__PURE__ */ new Set([
941
+ "className",
942
+ "value",
943
+ "readOnly",
944
+ "formNoValidate",
945
+ "isMap",
946
+ "noModule",
947
+ "playsInline",
948
+ ...booleans
949
+ ]);
950
+ const ChildProperties = /* @__PURE__ */ new Set([
951
+ "innerHTML",
952
+ "textContent",
953
+ "innerText",
954
+ "children"
955
+ ]);
956
+ const Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
957
+ className: "class",
958
+ htmlFor: "for"
959
+ });
960
+ const PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
961
+ class: "className",
962
+ formnovalidate: {
963
+ $: "formNoValidate",
964
+ BUTTON: 1,
965
+ INPUT: 1
966
+ },
967
+ ismap: {
968
+ $: "isMap",
969
+ IMG: 1
970
+ },
971
+ nomodule: {
972
+ $: "noModule",
973
+ SCRIPT: 1
974
+ },
975
+ playsinline: {
976
+ $: "playsInline",
977
+ VIDEO: 1
978
+ },
979
+ readonly: {
980
+ $: "readOnly",
981
+ INPUT: 1,
982
+ TEXTAREA: 1
983
+ }
984
+ });
985
+ function getPropAlias(prop, tagName) {
986
+ const a = PropAliases[prop];
987
+ return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
988
+ }
989
+ const DelegatedEvents = /* @__PURE__ */ new Set([
990
+ "beforeinput",
991
+ "click",
992
+ "dblclick",
993
+ "contextmenu",
994
+ "focusin",
995
+ "focusout",
996
+ "input",
997
+ "keydown",
998
+ "keyup",
999
+ "mousedown",
1000
+ "mousemove",
1001
+ "mouseout",
1002
+ "mouseover",
1003
+ "mouseup",
1004
+ "pointerdown",
1005
+ "pointermove",
1006
+ "pointerout",
1007
+ "pointerover",
1008
+ "pointerup",
1009
+ "touchend",
1010
+ "touchmove",
1011
+ "touchstart"
1012
+ ]);
1013
+ const SVGElements = /* @__PURE__ */ new Set([
1014
+ "altGlyph",
1015
+ "altGlyphDef",
1016
+ "altGlyphItem",
1017
+ "animate",
1018
+ "animateColor",
1019
+ "animateMotion",
1020
+ "animateTransform",
1021
+ "circle",
1022
+ "clipPath",
1023
+ "color-profile",
1024
+ "cursor",
1025
+ "defs",
1026
+ "desc",
1027
+ "ellipse",
1028
+ "feBlend",
1029
+ "feColorMatrix",
1030
+ "feComponentTransfer",
1031
+ "feComposite",
1032
+ "feConvolveMatrix",
1033
+ "feDiffuseLighting",
1034
+ "feDisplacementMap",
1035
+ "feDistantLight",
1036
+ "feDropShadow",
1037
+ "feFlood",
1038
+ "feFuncA",
1039
+ "feFuncB",
1040
+ "feFuncG",
1041
+ "feFuncR",
1042
+ "feGaussianBlur",
1043
+ "feImage",
1044
+ "feMerge",
1045
+ "feMergeNode",
1046
+ "feMorphology",
1047
+ "feOffset",
1048
+ "fePointLight",
1049
+ "feSpecularLighting",
1050
+ "feSpotLight",
1051
+ "feTile",
1052
+ "feTurbulence",
1053
+ "filter",
1054
+ "font",
1055
+ "font-face",
1056
+ "font-face-format",
1057
+ "font-face-name",
1058
+ "font-face-src",
1059
+ "font-face-uri",
1060
+ "foreignObject",
1061
+ "g",
1062
+ "glyph",
1063
+ "glyphRef",
1064
+ "hkern",
1065
+ "image",
1066
+ "line",
1067
+ "linearGradient",
1068
+ "marker",
1069
+ "mask",
1070
+ "metadata",
1071
+ "missing-glyph",
1072
+ "mpath",
1073
+ "path",
1074
+ "pattern",
1075
+ "polygon",
1076
+ "polyline",
1077
+ "radialGradient",
1078
+ "rect",
1079
+ "set",
1080
+ "stop",
1081
+ "svg",
1082
+ "switch",
1083
+ "symbol",
1084
+ "text",
1085
+ "textPath",
1086
+ "tref",
1087
+ "tspan",
1088
+ "use",
1089
+ "view",
1090
+ "vkern"
1091
+ ]);
1092
+ const SVGNamespace = {
1093
+ xlink: "http://www.w3.org/1999/xlink",
1094
+ xml: "http://www.w3.org/XML/1998/namespace"
1095
+ };
1096
+ function reconcileArrays(parentNode, a, b) {
1097
+ let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
1098
+ while (aStart < aEnd || bStart < bEnd) {
1099
+ if (a[aStart] === b[bStart]) {
1100
+ aStart++;
1101
+ bStart++;
1102
+ continue;
1103
+ }
1104
+ while (a[aEnd - 1] === b[bEnd - 1]) {
1105
+ aEnd--;
1106
+ bEnd--;
1107
+ }
1108
+ if (aEnd === aStart) {
1109
+ const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
1110
+ while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
1111
+ } else if (bEnd === bStart) {
1112
+ while (aStart < aEnd) {
1113
+ if (!map || !map.has(a[aStart])) a[aStart].remove();
1114
+ aStart++;
1115
+ }
1116
+ } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
1117
+ const node = a[--aEnd].nextSibling;
1118
+ parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
1119
+ parentNode.insertBefore(b[--bEnd], node);
1120
+ a[aEnd] = b[bEnd];
1121
+ } else {
1122
+ if (!map) {
1123
+ map = /* @__PURE__ */ new Map();
1124
+ let i = bStart;
1125
+ while (i < bEnd) map.set(b[i], i++);
1126
+ }
1127
+ const index = map.get(a[aStart]);
1128
+ if (index != null) {
1129
+ if (bStart < index && index < bEnd) {
1130
+ let i = aStart, sequence = 1, t;
1131
+ while (++i < aEnd && i < bEnd) {
1132
+ if ((t = map.get(a[i])) == null || t !== index + sequence) break;
1133
+ sequence++;
1134
+ }
1135
+ if (sequence > index - bStart) {
1136
+ const node = a[aStart];
1137
+ while (bStart < index) parentNode.insertBefore(b[bStart++], node);
1138
+ } else parentNode.replaceChild(b[bStart++], a[aStart++]);
1139
+ } else aStart++;
1140
+ } else a[aStart++].remove();
1141
+ }
1142
+ }
1143
+ }
1144
+ const $$EVENTS = "_$DX_DELEGATE";
1145
+ function render(code, element, init, options = {}) {
1146
+ let disposer;
1147
+ createRoot((dispose2) => {
1148
+ disposer = dispose2;
1149
+ element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
1150
+ }, options.owner);
1151
+ return () => {
1152
+ disposer();
1153
+ element.textContent = "";
1154
+ };
1155
+ }
1156
+ function template(html, isImportNode, isSVG, isMathML) {
1157
+ let node;
1158
+ const create = () => {
1159
+ const t = document.createElement("template");
1160
+ t.innerHTML = html;
1161
+ return t.content.firstChild;
1162
+ };
1163
+ const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
1164
+ fn.cloneNode = fn;
1165
+ return fn;
1166
+ }
1167
+ function delegateEvents(eventNames, document2 = window.document) {
1168
+ const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
1169
+ for (let i = 0, l = eventNames.length; i < l; i++) {
1170
+ const name = eventNames[i];
1171
+ if (!e.has(name)) {
1172
+ e.add(name);
1173
+ document2.addEventListener(name, eventHandler);
1174
+ }
1175
+ }
1176
+ }
1177
+ function setAttribute(node, name, value) {
1178
+ if (isHydrating(node)) return;
1179
+ if (value == null) node.removeAttribute(name);
1180
+ else node.setAttribute(name, value);
1181
+ }
1182
+ function setAttributeNS(node, namespace, name, value) {
1183
+ if (isHydrating(node)) return;
1184
+ if (value == null) node.removeAttributeNS(namespace, name);
1185
+ else node.setAttributeNS(namespace, name, value);
1186
+ }
1187
+ function setBoolAttribute(node, name, value) {
1188
+ if (isHydrating(node)) return;
1189
+ value ? node.setAttribute(name, "") : node.removeAttribute(name);
1190
+ }
1191
+ function className(node, value) {
1192
+ if (isHydrating(node)) return;
1193
+ if (value == null) node.removeAttribute("class");
1194
+ else node.className = value;
1195
+ }
1196
+ function addEventListener(node, name, handler, delegate) {
1197
+ if (delegate) {
1198
+ if (Array.isArray(handler)) {
1199
+ node[`$$${name}`] = handler[0];
1200
+ node[`$$${name}Data`] = handler[1];
1201
+ } else node[`$$${name}`] = handler;
1202
+ } else if (Array.isArray(handler)) {
1203
+ const handlerFn = handler[0];
1204
+ node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
1205
+ } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
1206
+ }
1207
+ function classList(node, value, prev = {}) {
1208
+ const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
1209
+ let i, len;
1210
+ for (i = 0, len = prevKeys.length; i < len; i++) {
1211
+ const key = prevKeys[i];
1212
+ if (!key || key === "undefined" || value[key]) continue;
1213
+ toggleClassKey(node, key, false);
1214
+ delete prev[key];
1215
+ }
1216
+ for (i = 0, len = classKeys.length; i < len; i++) {
1217
+ const key = classKeys[i], classValue = !!value[key];
1218
+ if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
1219
+ toggleClassKey(node, key, true);
1220
+ prev[key] = classValue;
1221
+ }
1222
+ return prev;
1223
+ }
1224
+ function style(node, value, prev) {
1225
+ if (!value) return prev ? setAttribute(node, "style") : value;
1226
+ const nodeStyle = node.style;
1227
+ if (typeof value === "string") return nodeStyle.cssText = value;
1228
+ typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
1229
+ prev || (prev = {});
1230
+ value || (value = {});
1231
+ let v, s;
1232
+ for (s in prev) {
1233
+ value[s] == null && nodeStyle.removeProperty(s);
1234
+ delete prev[s];
1235
+ }
1236
+ for (s in value) {
1237
+ v = value[s];
1238
+ if (v !== prev[s]) {
1239
+ nodeStyle.setProperty(s, v);
1240
+ prev[s] = v;
1241
+ }
1242
+ }
1243
+ return prev;
1244
+ }
1245
+ function spread(node, props = {}, isSVG, skipChildren) {
1246
+ const prevProps = {};
1247
+ if (!skipChildren) {
1248
+ createRenderEffect(
1249
+ () => prevProps.children = insertExpression(node, props.children, prevProps.children)
1250
+ );
1251
+ }
1252
+ createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
1253
+ createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
1254
+ return prevProps;
1255
+ }
1256
+ function use(fn, element, arg) {
1257
+ return untrack(() => fn(element, arg));
1258
+ }
1259
+ function insert(parent, accessor, marker, initial) {
1260
+ if (marker !== void 0 && !initial) initial = [];
1261
+ if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
1262
+ createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
1263
+ }
1264
+ function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
1265
+ props || (props = {});
1266
+ for (const prop in prevProps) {
1267
+ if (!(prop in props)) {
1268
+ if (prop === "children") continue;
1269
+ prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);
1270
+ }
1271
+ }
1272
+ for (const prop in props) {
1273
+ if (prop === "children") {
1274
+ continue;
1275
+ }
1276
+ const value = props[prop];
1277
+ prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);
1278
+ }
1279
+ }
1280
+ function getNextElement(template2) {
1281
+ let node, key, hydrating = isHydrating();
1282
+ if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
1283
+ return template2();
1284
+ }
1285
+ if (sharedConfig.completed) sharedConfig.completed.add(node);
1286
+ sharedConfig.registry.delete(key);
1287
+ return node;
1288
+ }
1289
+ function isHydrating(node) {
1290
+ return !!sharedConfig.context && !sharedConfig.done && (!node || node.isConnected);
1291
+ }
1292
+ function toPropertyName(name) {
1293
+ return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
1294
+ }
1295
+ function toggleClassKey(node, key, value) {
1296
+ const classNames = key.trim().split(/\s+/);
1297
+ for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
1298
+ node.classList.toggle(classNames[i], value);
1299
+ }
1300
+ function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
1301
+ let isCE, isProp, isChildProp, propAlias, forceProp;
1302
+ if (prop === "style") return style(node, value, prev);
1303
+ if (prop === "classList") return classList(node, value, prev);
1304
+ if (value === prev) return prev;
1305
+ if (prop === "ref") {
1306
+ if (!skipRef) value(node);
1307
+ } else if (prop.slice(0, 3) === "on:") {
1308
+ const e = prop.slice(3);
1309
+ prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
1310
+ value && node.addEventListener(e, value, typeof value !== "function" && value);
1311
+ } else if (prop.slice(0, 10) === "oncapture:") {
1312
+ const e = prop.slice(10);
1313
+ prev && node.removeEventListener(e, prev, true);
1314
+ value && node.addEventListener(e, value, true);
1315
+ } else if (prop.slice(0, 2) === "on") {
1316
+ const name = prop.slice(2).toLowerCase();
1317
+ const delegate = DelegatedEvents.has(name);
1318
+ if (!delegate && prev) {
1319
+ const h = Array.isArray(prev) ? prev[0] : prev;
1320
+ node.removeEventListener(name, h);
1321
+ }
1322
+ if (delegate || value) {
1323
+ addEventListener(node, name, value, delegate);
1324
+ delegate && delegateEvents([name]);
1325
+ }
1326
+ } else if (prop.slice(0, 5) === "attr:") {
1327
+ setAttribute(node, prop.slice(5), value);
1328
+ } else if (prop.slice(0, 5) === "bool:") {
1329
+ setBoolAttribute(node, prop.slice(5), value);
1330
+ } else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
1331
+ if (forceProp) {
1332
+ prop = prop.slice(5);
1333
+ isProp = true;
1334
+ } else if (isHydrating(node)) return value;
1335
+ if (prop === "class" || prop === "className") className(node, value);
1336
+ else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
1337
+ else node[propAlias || prop] = value;
1338
+ } else {
1339
+ const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
1340
+ if (ns) setAttributeNS(node, ns, prop, value);
1341
+ else setAttribute(node, Aliases[prop] || prop, value);
1342
+ }
1343
+ return value;
1344
+ }
1345
+ function eventHandler(e) {
1346
+ if (sharedConfig.registry && sharedConfig.events) {
1347
+ if (sharedConfig.events.find(([el, ev]) => ev === e)) return;
1348
+ }
1349
+ let node = e.target;
1350
+ const key = `$$${e.type}`;
1351
+ const oriTarget = e.target;
1352
+ const oriCurrentTarget = e.currentTarget;
1353
+ const retarget = (value) => Object.defineProperty(e, "target", {
1354
+ configurable: true,
1355
+ value
1356
+ });
1357
+ const handleNode = () => {
1358
+ const handler = node[key];
1359
+ if (handler && !node.disabled) {
1360
+ const data = node[`${key}Data`];
1361
+ data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
1362
+ if (e.cancelBubble) return;
1363
+ }
1364
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
1365
+ return true;
1366
+ };
1367
+ const walkUpTree = () => {
1368
+ while (handleNode() && (node = node._$host || node.parentNode || node.host)) ;
1369
+ };
1370
+ Object.defineProperty(e, "currentTarget", {
1371
+ configurable: true,
1372
+ get() {
1373
+ return node || document;
1374
+ }
1375
+ });
1376
+ if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
1377
+ if (e.composedPath) {
1378
+ const path = e.composedPath();
1379
+ retarget(path[0]);
1380
+ for (let i = 0; i < path.length - 2; i++) {
1381
+ node = path[i];
1382
+ if (!handleNode()) break;
1383
+ if (node._$host) {
1384
+ node = node._$host;
1385
+ walkUpTree();
1386
+ break;
1387
+ }
1388
+ if (node.parentNode === oriCurrentTarget) {
1389
+ break;
1390
+ }
1391
+ }
1392
+ } else walkUpTree();
1393
+ retarget(oriTarget);
1394
+ }
1395
+ function insertExpression(parent, value, current, marker, unwrapArray) {
1396
+ const hydrating = isHydrating(parent);
1397
+ if (hydrating) {
1398
+ !current && (current = [...parent.childNodes]);
1399
+ let cleaned = [];
1400
+ for (let i = 0; i < current.length; i++) {
1401
+ const node = current[i];
1402
+ if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
1403
+ else cleaned.push(node);
1404
+ }
1405
+ current = cleaned;
1406
+ }
1407
+ while (typeof current === "function") current = current();
1408
+ if (value === current) return current;
1409
+ const t = typeof value, multi = marker !== void 0;
1410
+ parent = multi && current[0] && current[0].parentNode || parent;
1411
+ if (t === "string" || t === "number") {
1412
+ if (hydrating) return current;
1413
+ if (t === "number") {
1414
+ value = value.toString();
1415
+ if (value === current) return current;
1416
+ }
1417
+ if (multi) {
1418
+ let node = current[0];
1419
+ if (node && node.nodeType === 3) {
1420
+ node.data !== value && (node.data = value);
1421
+ } else node = document.createTextNode(value);
1422
+ current = cleanChildren(parent, current, marker, node);
1423
+ } else {
1424
+ if (current !== "" && typeof current === "string") {
1425
+ current = parent.firstChild.data = value;
1426
+ } else current = parent.textContent = value;
1427
+ }
1428
+ } else if (value == null || t === "boolean") {
1429
+ if (hydrating) return current;
1430
+ current = cleanChildren(parent, current, marker);
1431
+ } else if (t === "function") {
1432
+ createRenderEffect(() => {
1433
+ let v = value();
1434
+ while (typeof v === "function") v = v();
1435
+ current = insertExpression(parent, v, current, marker);
1436
+ });
1437
+ return () => current;
1438
+ } else if (Array.isArray(value)) {
1439
+ const array = [];
1440
+ const currentArray = current && Array.isArray(current);
1441
+ if (normalizeIncomingArray(array, value, current, unwrapArray)) {
1442
+ createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
1443
+ return () => current;
1444
+ }
1445
+ if (hydrating) {
1446
+ if (!array.length) return current;
1447
+ if (marker === void 0) return current = [...parent.childNodes];
1448
+ let node = array[0];
1449
+ if (node.parentNode !== parent) return current;
1450
+ const nodes = [node];
1451
+ while ((node = node.nextSibling) !== marker) nodes.push(node);
1452
+ return current = nodes;
1453
+ }
1454
+ if (array.length === 0) {
1455
+ current = cleanChildren(parent, current, marker);
1456
+ if (multi) return current;
1457
+ } else if (currentArray) {
1458
+ if (current.length === 0) {
1459
+ appendNodes(parent, array, marker);
1460
+ } else reconcileArrays(parent, current, array);
1461
+ } else {
1462
+ current && cleanChildren(parent);
1463
+ appendNodes(parent, array);
1464
+ }
1465
+ current = array;
1466
+ } else if (value.nodeType) {
1467
+ if (hydrating && value.parentNode) return current = multi ? [value] : value;
1468
+ if (Array.isArray(current)) {
1469
+ if (multi) return current = cleanChildren(parent, current, marker, value);
1470
+ cleanChildren(parent, current, null, value);
1471
+ } else if (current == null || current === "" || !parent.firstChild) {
1472
+ parent.appendChild(value);
1473
+ } else parent.replaceChild(value, parent.firstChild);
1474
+ current = value;
1475
+ } else ;
1476
+ return current;
1477
+ }
1478
+ function normalizeIncomingArray(normalized, array, current, unwrap) {
1479
+ let dynamic = false;
1480
+ for (let i = 0, len = array.length; i < len; i++) {
1481
+ let item = array[i], prev = current && current[normalized.length], t;
1482
+ if (item == null || item === true || item === false) ;
1483
+ else if ((t = typeof item) === "object" && item.nodeType) {
1484
+ normalized.push(item);
1485
+ } else if (Array.isArray(item)) {
1486
+ dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
1487
+ } else if (t === "function") {
1488
+ if (unwrap) {
1489
+ while (typeof item === "function") item = item();
1490
+ dynamic = normalizeIncomingArray(
1491
+ normalized,
1492
+ Array.isArray(item) ? item : [item],
1493
+ Array.isArray(prev) ? prev : [prev]
1494
+ ) || dynamic;
1495
+ } else {
1496
+ normalized.push(item);
1497
+ dynamic = true;
1498
+ }
1499
+ } else {
1500
+ const value = String(item);
1501
+ if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
1502
+ else normalized.push(document.createTextNode(value));
1503
+ }
1504
+ }
1505
+ return dynamic;
1506
+ }
1507
+ function appendNodes(parent, array, marker = null) {
1508
+ for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
1509
+ }
1510
+ function cleanChildren(parent, current, marker, replacement) {
1511
+ if (marker === void 0) return parent.textContent = "";
1512
+ const node = replacement || document.createTextNode("");
1513
+ if (current.length) {
1514
+ let inserted = false;
1515
+ for (let i = current.length - 1; i >= 0; i--) {
1516
+ const el = current[i];
1517
+ if (node !== el) {
1518
+ const isParent = el.parentNode === parent;
1519
+ if (!inserted && !i)
1520
+ isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
1521
+ else isParent && el.remove();
1522
+ } else inserted = true;
1523
+ }
1524
+ } else parent.insertBefore(node, marker);
1525
+ return [node];
1526
+ }
1527
+ function getHydrationKey() {
1528
+ return sharedConfig.getNextContextId();
1529
+ }
1530
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1531
+ function createElement(tagName, isSVG = false) {
1532
+ return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);
1533
+ }
1534
+ function createDynamic(component, props) {
1535
+ const cached = createMemo(component);
1536
+ return createMemo(() => {
1537
+ const component2 = cached();
1538
+ switch (typeof component2) {
1539
+ case "function":
1540
+ return untrack(() => component2(props));
1541
+ case "string":
1542
+ const isSvg = SVGElements.has(component2);
1543
+ const el = sharedConfig.context ? getNextElement() : createElement(component2, isSvg);
1544
+ spread(el, props, isSvg);
1545
+ return el;
1546
+ }
1547
+ });
1548
+ }
1549
+ function Dynamic(props) {
1550
+ const [, others] = splitProps(props, ["component"]);
1551
+ return createDynamic(() => props.component, others);
1552
+ }
1553
+ const ShadowDomTargetContext = createContext(
1554
+ void 0
1555
+ );
1556
+ const DevtoolsOnCloseContext = createContext(void 0);
1557
+ const useDevtoolsOnClose = () => {
1558
+ const context = useContext(DevtoolsOnCloseContext);
1559
+ if (!context) {
1560
+ throw new Error(
1561
+ "useDevtoolsOnClose must be used within a TanStackRouterDevtools component"
1562
+ );
1563
+ }
1564
+ return context;
1565
+ };
1566
+ class TanStackRouterDevtoolsCore {
1567
+ #router;
1568
+ #routerState;
1569
+ #position;
1570
+ #initialIsOpen;
1571
+ #shadowDOMTarget;
1572
+ #panelProps;
1573
+ #closeButtonProps;
1574
+ #toggleButtonProps;
1575
+ #containerElement;
1576
+ #isMounted = false;
1577
+ #Component;
1578
+ #dispose;
1579
+ constructor(config) {
1580
+ this.#router = createSignal(config.router);
1581
+ this.#routerState = createSignal(config.routerState);
1582
+ this.#position = config.position ?? "bottom-left";
1583
+ this.#initialIsOpen = config.initialIsOpen ?? false;
1584
+ this.#shadowDOMTarget = config.shadowDOMTarget;
1585
+ this.#panelProps = config.panelProps;
1586
+ this.#closeButtonProps = config.closeButtonProps;
1587
+ this.#toggleButtonProps = config.toggleButtonProps;
1588
+ this.#containerElement = config.containerElement;
1589
+ }
1590
+ mount(el) {
1591
+ if (this.#isMounted) {
1592
+ throw new Error("Devtools is already mounted");
1593
+ }
1594
+ const dispose2 = render(() => {
1595
+ const [router] = this.#router;
1596
+ const [routerState] = this.#routerState;
1597
+ const position = this.#position;
1598
+ const initialIsOpen = this.#initialIsOpen;
1599
+ const shadowDOMTarget = this.#shadowDOMTarget;
1600
+ const panelProps = this.#panelProps;
1601
+ const closeButtonProps = this.#closeButtonProps;
1602
+ const toggleButtonProps = this.#toggleButtonProps;
1603
+ const containerElement = this.#containerElement;
1604
+ let Devtools;
1605
+ if (this.#Component) {
1606
+ Devtools = this.#Component;
1607
+ } else {
1608
+ Devtools = lazy(() => Promise.resolve().then(() => require("./FloatingTanStackRouterDevtools-7aOMOekg.cjs")));
1609
+ this.#Component = Devtools;
1610
+ }
1611
+ return createComponent(ShadowDomTargetContext.Provider, {
1612
+ value: shadowDOMTarget,
1613
+ get children() {
1614
+ return createComponent(Devtools, {
1615
+ position,
1616
+ initialIsOpen,
1617
+ router,
1618
+ routerState,
1619
+ shadowDOMTarget,
1620
+ panelProps,
1621
+ closeButtonProps,
1622
+ toggleButtonProps,
1623
+ containerElement
1624
+ });
1625
+ }
1626
+ });
1627
+ }, el);
1628
+ this.#isMounted = true;
1629
+ this.#dispose = dispose2;
1630
+ }
1631
+ unmount() {
1632
+ if (!this.#isMounted) {
1633
+ throw new Error("Devtools is not mounted");
1634
+ }
1635
+ this.#dispose?.();
1636
+ this.#isMounted = false;
1637
+ }
1638
+ setRouter(router) {
1639
+ this.#router[1](router);
1640
+ }
1641
+ setRouterState(routerState) {
1642
+ this.#routerState[1](routerState);
1643
+ }
1644
+ setOptions(options) {
1645
+ if (options.position !== void 0) {
1646
+ this.#position = options.position;
1647
+ }
1648
+ if (options.initialIsOpen !== void 0) {
1649
+ this.#initialIsOpen = options.initialIsOpen;
1650
+ }
1651
+ if (options.shadowDOMTarget !== void 0) {
1652
+ this.#shadowDOMTarget = options.shadowDOMTarget;
1653
+ }
1654
+ if (options.containerElement !== void 0) {
1655
+ this.#containerElement = options.containerElement;
1656
+ }
1657
+ }
1658
+ }
1659
+ class TanStackRouterDevtoolsPanelCore {
1660
+ #router;
1661
+ #routerState;
1662
+ #style;
1663
+ #className;
1664
+ #shadowDOMTarget;
1665
+ #isMounted = false;
1666
+ #setIsOpen;
1667
+ #dispose;
1668
+ #Component;
1669
+ constructor(config) {
1670
+ const {
1671
+ router,
1672
+ routerState,
1673
+ shadowDOMTarget,
1674
+ setIsOpen,
1675
+ style: style2,
1676
+ className: className2
1677
+ } = config;
1678
+ this.#router = createSignal(router);
1679
+ this.#routerState = createSignal(routerState);
1680
+ this.#style = createSignal(style2);
1681
+ this.#className = createSignal(className2);
1682
+ this.#shadowDOMTarget = shadowDOMTarget;
1683
+ this.#setIsOpen = setIsOpen;
1684
+ }
1685
+ mount(el) {
1686
+ if (this.#isMounted) {
1687
+ throw new Error("Devtools is already mounted");
1688
+ }
1689
+ const dispose2 = render(() => {
1690
+ const [router] = this.#router;
1691
+ const [routerState] = this.#routerState;
1692
+ const [style2] = this.#style;
1693
+ const [className2] = this.#className;
1694
+ const shadowDOMTarget = this.#shadowDOMTarget;
1695
+ const setIsOpen = this.#setIsOpen;
1696
+ let BaseTanStackRouterDevtoolsPanel;
1697
+ if (this.#Component) {
1698
+ BaseTanStackRouterDevtoolsPanel = this.#Component;
1699
+ } else {
1700
+ BaseTanStackRouterDevtoolsPanel = lazy(() => Promise.resolve().then(() => require("./BaseTanStackRouterDevtoolsPanel-z0YMII09.cjs")).then((n) => n.BaseTanStackRouterDevtoolsPanel$1));
1701
+ this.#Component = BaseTanStackRouterDevtoolsPanel;
1702
+ }
1703
+ return createComponent(ShadowDomTargetContext.Provider, {
1704
+ value: shadowDOMTarget,
1705
+ get children() {
1706
+ return createComponent(DevtoolsOnCloseContext.Provider, {
1707
+ value: {
1708
+ onCloseClick: () => {
1709
+ }
1710
+ },
1711
+ get children() {
1712
+ return createComponent(BaseTanStackRouterDevtoolsPanel, {
1713
+ router,
1714
+ routerState,
1715
+ shadowDOMTarget,
1716
+ setIsOpen,
1717
+ style: style2,
1718
+ className: className2
1719
+ });
1720
+ }
1721
+ });
1722
+ }
1723
+ });
1724
+ }, el);
1725
+ this.#isMounted = true;
1726
+ this.#dispose = dispose2;
1727
+ }
1728
+ unmount() {
1729
+ if (!this.#isMounted) {
1730
+ throw new Error("Devtools is not mounted");
1731
+ }
1732
+ this.#dispose?.();
1733
+ this.#isMounted = false;
1734
+ }
1735
+ setRouter(router) {
1736
+ this.#router[1](router);
1737
+ }
1738
+ setRouterState(routerState) {
1739
+ this.#routerState[1](routerState);
1740
+ }
1741
+ setStyle(style2) {
1742
+ this.#style[1](style2);
1743
+ }
1744
+ setClassName(className2) {
1745
+ this.#className[1](className2);
1746
+ }
1747
+ setOptions(options) {
1748
+ if (options.shadowDOMTarget !== void 0) {
1749
+ this.#shadowDOMTarget = options.shadowDOMTarget;
1750
+ }
1751
+ if (options.router !== void 0) {
1752
+ this.setRouter(options.router);
1753
+ }
1754
+ if (options.routerState !== void 0) {
1755
+ this.setRouterState(options.routerState);
1756
+ }
1757
+ if (options.style !== void 0) {
1758
+ this.setStyle(options.style);
1759
+ }
1760
+ if (options.className !== void 0) {
1761
+ this.setClassName(options.className);
1762
+ }
1763
+ }
1764
+ }
1765
+ exports.DevtoolsOnCloseContext = DevtoolsOnCloseContext;
1766
+ exports.Dynamic = Dynamic;
1767
+ exports.For = For;
1768
+ exports.Match = Match;
1769
+ exports.ShadowDomTargetContext = ShadowDomTargetContext;
1770
+ exports.Show = Show;
1771
+ exports.Switch = Switch;
1772
+ exports.TanStackRouterDevtoolsCore = TanStackRouterDevtoolsCore;
1773
+ exports.TanStackRouterDevtoolsPanelCore = TanStackRouterDevtoolsPanelCore;
1774
+ exports.addEventListener = addEventListener;
1775
+ exports.className = className;
1776
+ exports.createComponent = createComponent;
1777
+ exports.createEffect = createEffect;
1778
+ exports.createMemo = createMemo;
1779
+ exports.createRenderEffect = createRenderEffect;
1780
+ exports.createSignal = createSignal;
1781
+ exports.createUniqueId = createUniqueId;
1782
+ exports.delegateEvents = delegateEvents;
1783
+ exports.insert = insert;
1784
+ exports.mergeProps = mergeProps;
1785
+ exports.onCleanup = onCleanup;
1786
+ exports.setAttribute = setAttribute;
1787
+ exports.spread = spread;
1788
+ exports.template = template;
1789
+ exports.untrack = untrack;
1790
+ exports.useContext = useContext;
1791
+ exports.useDevtoolsOnClose = useDevtoolsOnClose;
1792
+ //# sourceMappingURL=index-CC1CXbDA.cjs.map