@tanstack/query-devtools 5.51.16 → 5.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2939 +0,0 @@
1
- // ../../node_modules/.pnpm/solid-js@1.8.19/node_modules/solid-js/dist/solid.js
2
- var sharedConfig = {
3
- context: void 0,
4
- registry: void 0,
5
- getContextId() {
6
- return getContextId(this.context.count);
7
- },
8
- getNextContextId() {
9
- return getContextId(this.context.count++);
10
- }
11
- };
12
- function getContextId(count) {
13
- const num = String(count), len = num.length - 1;
14
- return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : "") + num;
15
- }
16
- function setHydrateContext(context) {
17
- sharedConfig.context = context;
18
- }
19
- function nextHydrateContext() {
20
- return {
21
- ...sharedConfig.context,
22
- id: sharedConfig.getNextContextId(),
23
- count: 0
24
- };
25
- }
26
- var equalFn = (a, b) => a === b;
27
- var $PROXY = Symbol("solid-proxy");
28
- var $TRACK = Symbol("solid-track");
29
- var $DEVCOMP = Symbol("solid-dev-component");
30
- var signalOptions = {
31
- equals: equalFn
32
- };
33
- var ERROR = null;
34
- var runEffects = runQueue;
35
- var STALE = 1;
36
- var PENDING = 2;
37
- var UNOWNED = {
38
- owned: null,
39
- cleanups: null,
40
- context: null,
41
- owner: null
42
- };
43
- var NO_INIT = {};
44
- var Owner = null;
45
- var Transition = null;
46
- var Scheduler = null;
47
- var ExternalSourceConfig = null;
48
- var Listener = null;
49
- var Updates = null;
50
- var Effects = null;
51
- var ExecCount = 0;
52
- function createRoot(fn, detachedOwner) {
53
- const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {
54
- owned: null,
55
- cleanups: null,
56
- context: current ? current.context : null,
57
- owner: current
58
- }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
59
- Owner = root;
60
- Listener = null;
61
- try {
62
- return runUpdates(updateFn, true);
63
- } finally {
64
- Listener = listener;
65
- Owner = owner;
66
- }
67
- }
68
- function createSignal(value, options) {
69
- options = options ? Object.assign({}, signalOptions, options) : signalOptions;
70
- const s = {
71
- value,
72
- observers: null,
73
- observerSlots: null,
74
- comparator: options.equals || void 0
75
- };
76
- const setter = (value2) => {
77
- if (typeof value2 === "function") {
78
- if (Transition && Transition.running && Transition.sources.has(s))
79
- value2 = value2(s.tValue);
80
- else
81
- value2 = value2(s.value);
82
- }
83
- return writeSignal(s, value2);
84
- };
85
- return [readSignal.bind(s), setter];
86
- }
87
- function createComputed(fn, value, options) {
88
- const c = createComputation(fn, value, true, STALE);
89
- if (Scheduler && Transition && Transition.running)
90
- Updates.push(c);
91
- else
92
- updateComputation(c);
93
- }
94
- function createRenderEffect(fn, value, options) {
95
- const c = createComputation(fn, value, false, STALE);
96
- if (Scheduler && Transition && Transition.running)
97
- Updates.push(c);
98
- else
99
- updateComputation(c);
100
- }
101
- function createEffect(fn, value, options) {
102
- runEffects = runUserEffects;
103
- const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
104
- if (s)
105
- c.suspense = s;
106
- if (!options || !options.render)
107
- c.user = true;
108
- Effects ? Effects.push(c) : updateComputation(c);
109
- }
110
- function createMemo(fn, value, options) {
111
- options = options ? Object.assign({}, signalOptions, options) : signalOptions;
112
- const c = createComputation(fn, value, true, 0);
113
- c.observers = null;
114
- c.observerSlots = null;
115
- c.comparator = options.equals || void 0;
116
- if (Scheduler && Transition && Transition.running) {
117
- c.tState = STALE;
118
- Updates.push(c);
119
- } else
120
- updateComputation(c);
121
- return readSignal.bind(c);
122
- }
123
- function isPromise(v) {
124
- return v && typeof v === "object" && "then" in v;
125
- }
126
- function createResource(pSource, pFetcher, pOptions) {
127
- let source;
128
- let fetcher;
129
- let options;
130
- if (arguments.length === 2 && typeof pFetcher === "object" || arguments.length === 1) {
131
- source = true;
132
- fetcher = pSource;
133
- options = pFetcher || {};
134
- } else {
135
- source = pSource;
136
- fetcher = pFetcher;
137
- options = pOptions || {};
138
- }
139
- let pr = null, initP = NO_INIT, id = null, loadedUnderTransition = false, scheduled = false, resolved = "initialValue" in options, dynamic = typeof source === "function" && createMemo(source);
140
- const contexts = /* @__PURE__ */ new Set(), [value, setValue] = (options.storage || createSignal)(options.initialValue), [error, setError] = createSignal(void 0), [track, trigger] = createSignal(void 0, {
141
- equals: false
142
- }), [state, setState] = createSignal(resolved ? "ready" : "unresolved");
143
- if (sharedConfig.context) {
144
- id = sharedConfig.getNextContextId();
145
- let v;
146
- if (options.ssrLoadFrom === "initial")
147
- initP = options.initialValue;
148
- else if (sharedConfig.load && (v = sharedConfig.load(id)))
149
- initP = v;
150
- }
151
- function loadEnd(p, v, error2, key) {
152
- if (pr === p) {
153
- pr = null;
154
- key !== void 0 && (resolved = true);
155
- if ((p === initP || v === initP) && options.onHydrated)
156
- queueMicrotask(() => options.onHydrated(key, {
157
- value: v
158
- }));
159
- initP = NO_INIT;
160
- if (Transition && p && loadedUnderTransition) {
161
- Transition.promises.delete(p);
162
- loadedUnderTransition = false;
163
- runUpdates(() => {
164
- Transition.running = true;
165
- completeLoad(v, error2);
166
- }, false);
167
- } else
168
- completeLoad(v, error2);
169
- }
170
- return v;
171
- }
172
- function completeLoad(v, err) {
173
- runUpdates(() => {
174
- if (err === void 0)
175
- setValue(() => v);
176
- setState(err !== void 0 ? "errored" : resolved ? "ready" : "unresolved");
177
- setError(err);
178
- for (const c of contexts.keys())
179
- c.decrement();
180
- contexts.clear();
181
- }, false);
182
- }
183
- function read() {
184
- const c = SuspenseContext && useContext(SuspenseContext), v = value(), err = error();
185
- if (err !== void 0 && !pr)
186
- throw err;
187
- if (Listener && !Listener.user && c) {
188
- createComputed(() => {
189
- track();
190
- if (pr) {
191
- if (c.resolved && Transition && loadedUnderTransition)
192
- Transition.promises.add(pr);
193
- else if (!contexts.has(c)) {
194
- c.increment();
195
- contexts.add(c);
196
- }
197
- }
198
- });
199
- }
200
- return v;
201
- }
202
- function load(refetching = true) {
203
- if (refetching !== false && scheduled)
204
- return;
205
- scheduled = false;
206
- const lookup = dynamic ? dynamic() : source;
207
- loadedUnderTransition = Transition && Transition.running;
208
- if (lookup == null || lookup === false) {
209
- loadEnd(pr, untrack(value));
210
- return;
211
- }
212
- if (Transition && pr)
213
- Transition.promises.delete(pr);
214
- const p = initP !== NO_INIT ? initP : untrack(() => fetcher(lookup, {
215
- value: value(),
216
- refetching
217
- }));
218
- if (!isPromise(p)) {
219
- loadEnd(pr, p, void 0, lookup);
220
- return p;
221
- }
222
- pr = p;
223
- if ("value" in p) {
224
- if (p.status === "success")
225
- loadEnd(pr, p.value, void 0, lookup);
226
- else
227
- loadEnd(pr, void 0, castError(p.value), lookup);
228
- return p;
229
- }
230
- scheduled = true;
231
- queueMicrotask(() => scheduled = false);
232
- runUpdates(() => {
233
- setState(resolved ? "refreshing" : "pending");
234
- trigger();
235
- }, false);
236
- return p.then((v) => loadEnd(p, v, void 0, lookup), (e) => loadEnd(p, void 0, castError(e), lookup));
237
- }
238
- Object.defineProperties(read, {
239
- state: {
240
- get: () => state()
241
- },
242
- error: {
243
- get: () => error()
244
- },
245
- loading: {
246
- get() {
247
- const s = state();
248
- return s === "pending" || s === "refreshing";
249
- }
250
- },
251
- latest: {
252
- get() {
253
- if (!resolved)
254
- return read();
255
- const err = error();
256
- if (err && !pr)
257
- throw err;
258
- return value();
259
- }
260
- }
261
- });
262
- if (dynamic)
263
- createComputed(() => load(false));
264
- else
265
- load(false);
266
- return [read, {
267
- refetch: load,
268
- mutate: setValue
269
- }];
270
- }
271
- function batch(fn) {
272
- return runUpdates(fn, false);
273
- }
274
- function untrack(fn) {
275
- if (!ExternalSourceConfig && Listener === null)
276
- return fn();
277
- const listener = Listener;
278
- Listener = null;
279
- try {
280
- if (ExternalSourceConfig)
281
- return ExternalSourceConfig.untrack(fn);
282
- return fn();
283
- } finally {
284
- Listener = listener;
285
- }
286
- }
287
- function on(deps, fn, options) {
288
- const isArray3 = Array.isArray(deps);
289
- let prevInput;
290
- let defer = options && options.defer;
291
- return (prevValue) => {
292
- let input;
293
- if (isArray3) {
294
- input = Array(deps.length);
295
- for (let i = 0; i < deps.length; i++)
296
- input[i] = deps[i]();
297
- } else
298
- input = deps();
299
- if (defer) {
300
- defer = false;
301
- return prevValue;
302
- }
303
- const result = untrack(() => fn(input, prevInput, prevValue));
304
- prevInput = input;
305
- return result;
306
- };
307
- }
308
- function onMount(fn) {
309
- createEffect(() => untrack(fn));
310
- }
311
- function onCleanup(fn) {
312
- if (Owner === null)
313
- ;
314
- else if (Owner.cleanups === null)
315
- Owner.cleanups = [fn];
316
- else
317
- Owner.cleanups.push(fn);
318
- return fn;
319
- }
320
- function getOwner() {
321
- return Owner;
322
- }
323
- function runWithOwner(o, fn) {
324
- const prev = Owner;
325
- const prevListener = Listener;
326
- Owner = o;
327
- Listener = null;
328
- try {
329
- return runUpdates(fn, true);
330
- } catch (err) {
331
- handleError(err);
332
- } finally {
333
- Owner = prev;
334
- Listener = prevListener;
335
- }
336
- }
337
- function startTransition(fn) {
338
- if (Transition && Transition.running) {
339
- fn();
340
- return Transition.done;
341
- }
342
- const l = Listener;
343
- const o = Owner;
344
- return Promise.resolve().then(() => {
345
- Listener = l;
346
- Owner = o;
347
- let t;
348
- if (Scheduler || SuspenseContext) {
349
- t = Transition || (Transition = {
350
- sources: /* @__PURE__ */ new Set(),
351
- effects: [],
352
- promises: /* @__PURE__ */ new Set(),
353
- disposed: /* @__PURE__ */ new Set(),
354
- queue: /* @__PURE__ */ new Set(),
355
- running: true
356
- });
357
- t.done || (t.done = new Promise((res) => t.resolve = res));
358
- t.running = true;
359
- }
360
- runUpdates(fn, false);
361
- Listener = Owner = null;
362
- return t ? t.done : void 0;
363
- });
364
- }
365
- var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
366
- function useTransition() {
367
- return [transPending, startTransition];
368
- }
369
- function createContext(defaultValue, options) {
370
- const id = Symbol("context");
371
- return {
372
- id,
373
- Provider: createProvider(id),
374
- defaultValue
375
- };
376
- }
377
- function useContext(context) {
378
- let value;
379
- return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
380
- }
381
- function children(fn) {
382
- const children2 = createMemo(fn);
383
- const memo = createMemo(() => resolveChildren(children2()));
384
- memo.toArray = () => {
385
- const c = memo();
386
- return Array.isArray(c) ? c : c != null ? [c] : [];
387
- };
388
- return memo;
389
- }
390
- var SuspenseContext;
391
- function readSignal() {
392
- const runningTransition = Transition && Transition.running;
393
- if (this.sources && (runningTransition ? this.tState : this.state)) {
394
- if ((runningTransition ? this.tState : this.state) === STALE)
395
- updateComputation(this);
396
- else {
397
- const updates = Updates;
398
- Updates = null;
399
- runUpdates(() => lookUpstream(this), false);
400
- Updates = updates;
401
- }
402
- }
403
- if (Listener) {
404
- const sSlot = this.observers ? this.observers.length : 0;
405
- if (!Listener.sources) {
406
- Listener.sources = [this];
407
- Listener.sourceSlots = [sSlot];
408
- } else {
409
- Listener.sources.push(this);
410
- Listener.sourceSlots.push(sSlot);
411
- }
412
- if (!this.observers) {
413
- this.observers = [Listener];
414
- this.observerSlots = [Listener.sources.length - 1];
415
- } else {
416
- this.observers.push(Listener);
417
- this.observerSlots.push(Listener.sources.length - 1);
418
- }
419
- }
420
- if (runningTransition && Transition.sources.has(this))
421
- return this.tValue;
422
- return this.value;
423
- }
424
- function writeSignal(node, value, isComp) {
425
- let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
426
- if (!node.comparator || !node.comparator(current, value)) {
427
- if (Transition) {
428
- const TransitionRunning = Transition.running;
429
- if (TransitionRunning || !isComp && Transition.sources.has(node)) {
430
- Transition.sources.add(node);
431
- node.tValue = value;
432
- }
433
- if (!TransitionRunning)
434
- node.value = value;
435
- } else
436
- node.value = value;
437
- if (node.observers && node.observers.length) {
438
- runUpdates(() => {
439
- for (let i = 0; i < node.observers.length; i += 1) {
440
- const o = node.observers[i];
441
- const TransitionRunning = Transition && Transition.running;
442
- if (TransitionRunning && Transition.disposed.has(o))
443
- continue;
444
- if (TransitionRunning ? !o.tState : !o.state) {
445
- if (o.pure)
446
- Updates.push(o);
447
- else
448
- Effects.push(o);
449
- if (o.observers)
450
- markDownstream(o);
451
- }
452
- if (!TransitionRunning)
453
- o.state = STALE;
454
- else
455
- o.tState = STALE;
456
- }
457
- if (Updates.length > 1e6) {
458
- Updates = [];
459
- if (false)
460
- ;
461
- throw new Error();
462
- }
463
- }, false);
464
- }
465
- }
466
- return value;
467
- }
468
- function updateComputation(node) {
469
- if (!node.fn)
470
- return;
471
- cleanNode(node);
472
- const time = ExecCount;
473
- runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
474
- if (Transition && !Transition.running && Transition.sources.has(node)) {
475
- queueMicrotask(() => {
476
- runUpdates(() => {
477
- Transition && (Transition.running = true);
478
- Listener = Owner = node;
479
- runComputation(node, node.tValue, time);
480
- Listener = Owner = null;
481
- }, false);
482
- });
483
- }
484
- }
485
- function runComputation(node, value, time) {
486
- let nextValue;
487
- const owner = Owner, listener = Listener;
488
- Listener = Owner = node;
489
- try {
490
- nextValue = node.fn(value);
491
- } catch (err) {
492
- if (node.pure) {
493
- if (Transition && Transition.running) {
494
- node.tState = STALE;
495
- node.tOwned && node.tOwned.forEach(cleanNode);
496
- node.tOwned = void 0;
497
- } else {
498
- node.state = STALE;
499
- node.owned && node.owned.forEach(cleanNode);
500
- node.owned = null;
501
- }
502
- }
503
- node.updatedAt = time + 1;
504
- return handleError(err);
505
- } finally {
506
- Listener = listener;
507
- Owner = owner;
508
- }
509
- if (!node.updatedAt || node.updatedAt <= time) {
510
- if (node.updatedAt != null && "observers" in node) {
511
- writeSignal(node, nextValue, true);
512
- } else if (Transition && Transition.running && node.pure) {
513
- Transition.sources.add(node);
514
- node.tValue = nextValue;
515
- } else
516
- node.value = nextValue;
517
- node.updatedAt = time;
518
- }
519
- }
520
- function createComputation(fn, init, pure, state = STALE, options) {
521
- const c = {
522
- fn,
523
- state,
524
- updatedAt: null,
525
- owned: null,
526
- sources: null,
527
- sourceSlots: null,
528
- cleanups: null,
529
- value: init,
530
- owner: Owner,
531
- context: Owner ? Owner.context : null,
532
- pure
533
- };
534
- if (Transition && Transition.running) {
535
- c.state = 0;
536
- c.tState = state;
537
- }
538
- if (Owner === null)
539
- ;
540
- else if (Owner !== UNOWNED) {
541
- if (Transition && Transition.running && Owner.pure) {
542
- if (!Owner.tOwned)
543
- Owner.tOwned = [c];
544
- else
545
- Owner.tOwned.push(c);
546
- } else {
547
- if (!Owner.owned)
548
- Owner.owned = [c];
549
- else
550
- Owner.owned.push(c);
551
- }
552
- }
553
- if (ExternalSourceConfig && c.fn) {
554
- const [track, trigger] = createSignal(void 0, {
555
- equals: false
556
- });
557
- const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
558
- onCleanup(() => ordinary.dispose());
559
- const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
560
- const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
561
- c.fn = (x) => {
562
- track();
563
- return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
564
- };
565
- }
566
- return c;
567
- }
568
- function runTop(node) {
569
- const runningTransition = Transition && Transition.running;
570
- if ((runningTransition ? node.tState : node.state) === 0)
571
- return;
572
- if ((runningTransition ? node.tState : node.state) === PENDING)
573
- return lookUpstream(node);
574
- if (node.suspense && untrack(node.suspense.inFallback))
575
- return node.suspense.effects.push(node);
576
- const ancestors = [node];
577
- while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
578
- if (runningTransition && Transition.disposed.has(node))
579
- return;
580
- if (runningTransition ? node.tState : node.state)
581
- ancestors.push(node);
582
- }
583
- for (let i = ancestors.length - 1; i >= 0; i--) {
584
- node = ancestors[i];
585
- if (runningTransition) {
586
- let top = node, prev = ancestors[i + 1];
587
- while ((top = top.owner) && top !== prev) {
588
- if (Transition.disposed.has(top))
589
- return;
590
- }
591
- }
592
- if ((runningTransition ? node.tState : node.state) === STALE) {
593
- updateComputation(node);
594
- } else if ((runningTransition ? node.tState : node.state) === PENDING) {
595
- const updates = Updates;
596
- Updates = null;
597
- runUpdates(() => lookUpstream(node, ancestors[0]), false);
598
- Updates = updates;
599
- }
600
- }
601
- }
602
- function runUpdates(fn, init) {
603
- if (Updates)
604
- return fn();
605
- let wait = false;
606
- if (!init)
607
- Updates = [];
608
- if (Effects)
609
- wait = true;
610
- else
611
- Effects = [];
612
- ExecCount++;
613
- try {
614
- const res = fn();
615
- completeUpdates(wait);
616
- return res;
617
- } catch (err) {
618
- if (!wait)
619
- Effects = null;
620
- Updates = null;
621
- handleError(err);
622
- }
623
- }
624
- function completeUpdates(wait) {
625
- if (Updates) {
626
- if (Scheduler && Transition && Transition.running)
627
- scheduleQueue(Updates);
628
- else
629
- runQueue(Updates);
630
- Updates = null;
631
- }
632
- if (wait)
633
- return;
634
- let res;
635
- if (Transition) {
636
- if (!Transition.promises.size && !Transition.queue.size) {
637
- const sources = Transition.sources;
638
- const disposed = Transition.disposed;
639
- Effects.push.apply(Effects, Transition.effects);
640
- res = Transition.resolve;
641
- for (const e2 of Effects) {
642
- "tState" in e2 && (e2.state = e2.tState);
643
- delete e2.tState;
644
- }
645
- Transition = null;
646
- runUpdates(() => {
647
- for (const d of disposed)
648
- cleanNode(d);
649
- for (const v of sources) {
650
- v.value = v.tValue;
651
- if (v.owned) {
652
- for (let i = 0, len = v.owned.length; i < len; i++)
653
- cleanNode(v.owned[i]);
654
- }
655
- if (v.tOwned)
656
- v.owned = v.tOwned;
657
- delete v.tValue;
658
- delete v.tOwned;
659
- v.tState = 0;
660
- }
661
- setTransPending(false);
662
- }, false);
663
- } else if (Transition.running) {
664
- Transition.running = false;
665
- Transition.effects.push.apply(Transition.effects, Effects);
666
- Effects = null;
667
- setTransPending(true);
668
- return;
669
- }
670
- }
671
- const e = Effects;
672
- Effects = null;
673
- if (e.length)
674
- runUpdates(() => runEffects(e), false);
675
- if (res)
676
- res();
677
- }
678
- function runQueue(queue) {
679
- for (let i = 0; i < queue.length; i++)
680
- runTop(queue[i]);
681
- }
682
- function scheduleQueue(queue) {
683
- for (let i = 0; i < queue.length; i++) {
684
- const item = queue[i];
685
- const tasks = Transition.queue;
686
- if (!tasks.has(item)) {
687
- tasks.add(item);
688
- Scheduler(() => {
689
- tasks.delete(item);
690
- runUpdates(() => {
691
- Transition.running = true;
692
- runTop(item);
693
- }, false);
694
- Transition && (Transition.running = false);
695
- });
696
- }
697
- }
698
- }
699
- function runUserEffects(queue) {
700
- let i, userLength = 0;
701
- for (i = 0; i < queue.length; i++) {
702
- const e = queue[i];
703
- if (!e.user)
704
- runTop(e);
705
- else
706
- queue[userLength++] = e;
707
- }
708
- if (sharedConfig.context) {
709
- if (sharedConfig.count) {
710
- sharedConfig.effects || (sharedConfig.effects = []);
711
- sharedConfig.effects.push(...queue.slice(0, userLength));
712
- return;
713
- } else if (sharedConfig.effects) {
714
- queue = [...sharedConfig.effects, ...queue];
715
- userLength += sharedConfig.effects.length;
716
- delete sharedConfig.effects;
717
- }
718
- setHydrateContext();
719
- }
720
- for (i = 0; i < userLength; i++)
721
- runTop(queue[i]);
722
- }
723
- function lookUpstream(node, ignore) {
724
- const runningTransition = Transition && Transition.running;
725
- if (runningTransition)
726
- node.tState = 0;
727
- else
728
- node.state = 0;
729
- for (let i = 0; i < node.sources.length; i += 1) {
730
- const source = node.sources[i];
731
- if (source.sources) {
732
- const state = runningTransition ? source.tState : source.state;
733
- if (state === STALE) {
734
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
735
- runTop(source);
736
- } else if (state === PENDING)
737
- lookUpstream(source, ignore);
738
- }
739
- }
740
- }
741
- function markDownstream(node) {
742
- const runningTransition = Transition && Transition.running;
743
- for (let i = 0; i < node.observers.length; i += 1) {
744
- const o = node.observers[i];
745
- if (runningTransition ? !o.tState : !o.state) {
746
- if (runningTransition)
747
- o.tState = PENDING;
748
- else
749
- o.state = PENDING;
750
- if (o.pure)
751
- Updates.push(o);
752
- else
753
- Effects.push(o);
754
- o.observers && markDownstream(o);
755
- }
756
- }
757
- }
758
- function cleanNode(node) {
759
- let i;
760
- if (node.sources) {
761
- while (node.sources.length) {
762
- const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
763
- if (obs && obs.length) {
764
- const n = obs.pop(), s = source.observerSlots.pop();
765
- if (index < obs.length) {
766
- n.sourceSlots[s] = index;
767
- obs[index] = n;
768
- source.observerSlots[index] = s;
769
- }
770
- }
771
- }
772
- }
773
- if (Transition && Transition.running && node.pure) {
774
- if (node.tOwned) {
775
- for (i = node.tOwned.length - 1; i >= 0; i--)
776
- cleanNode(node.tOwned[i]);
777
- delete node.tOwned;
778
- }
779
- reset(node, true);
780
- } else if (node.owned) {
781
- for (i = node.owned.length - 1; i >= 0; i--)
782
- cleanNode(node.owned[i]);
783
- node.owned = null;
784
- }
785
- if (node.cleanups) {
786
- for (i = node.cleanups.length - 1; i >= 0; i--)
787
- node.cleanups[i]();
788
- node.cleanups = null;
789
- }
790
- if (Transition && Transition.running)
791
- node.tState = 0;
792
- else
793
- node.state = 0;
794
- }
795
- function reset(node, top) {
796
- if (!top) {
797
- node.tState = 0;
798
- Transition.disposed.add(node);
799
- }
800
- if (node.owned) {
801
- for (let i = 0; i < node.owned.length; i++)
802
- reset(node.owned[i]);
803
- }
804
- }
805
- function castError(err) {
806
- if (err instanceof Error)
807
- return err;
808
- return new Error(typeof err === "string" ? err : "Unknown error", {
809
- cause: err
810
- });
811
- }
812
- function runErrors(err, fns, owner) {
813
- try {
814
- for (const f of fns)
815
- f(err);
816
- } catch (e) {
817
- handleError(e, owner && owner.owner || null);
818
- }
819
- }
820
- function handleError(err, owner = Owner) {
821
- const fns = ERROR && owner && owner.context && owner.context[ERROR];
822
- const error = castError(err);
823
- if (!fns)
824
- throw error;
825
- if (Effects)
826
- Effects.push({
827
- fn() {
828
- runErrors(error, fns, owner);
829
- },
830
- state: STALE
831
- });
832
- else
833
- runErrors(error, fns, owner);
834
- }
835
- function resolveChildren(children2) {
836
- if (typeof children2 === "function" && !children2.length)
837
- return resolveChildren(children2());
838
- if (Array.isArray(children2)) {
839
- const results = [];
840
- for (let i = 0; i < children2.length; i++) {
841
- const result = resolveChildren(children2[i]);
842
- Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
843
- }
844
- return results;
845
- }
846
- return children2;
847
- }
848
- function createProvider(id, options) {
849
- return function provider(props) {
850
- let res;
851
- createRenderEffect(() => res = untrack(() => {
852
- Owner.context = {
853
- ...Owner.context,
854
- [id]: props.value
855
- };
856
- return children(() => props.children);
857
- }), void 0);
858
- return res;
859
- };
860
- }
861
- var FALLBACK = Symbol("fallback");
862
- function dispose(d) {
863
- for (let i = 0; i < d.length; i++)
864
- d[i]();
865
- }
866
- function mapArray(list, mapFn, options = {}) {
867
- let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
868
- onCleanup(() => dispose(disposers));
869
- return () => {
870
- let newItems = list() || [], newLen = newItems.length, i, j;
871
- newItems[$TRACK];
872
- return untrack(() => {
873
- let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
874
- if (newLen === 0) {
875
- if (len !== 0) {
876
- dispose(disposers);
877
- disposers = [];
878
- items = [];
879
- mapped = [];
880
- len = 0;
881
- indexes && (indexes = []);
882
- }
883
- if (options.fallback) {
884
- items = [FALLBACK];
885
- mapped[0] = createRoot((disposer) => {
886
- disposers[0] = disposer;
887
- return options.fallback();
888
- });
889
- len = 1;
890
- }
891
- } else if (len === 0) {
892
- mapped = new Array(newLen);
893
- for (j = 0; j < newLen; j++) {
894
- items[j] = newItems[j];
895
- mapped[j] = createRoot(mapper);
896
- }
897
- len = newLen;
898
- } else {
899
- temp = new Array(newLen);
900
- tempdisposers = new Array(newLen);
901
- indexes && (tempIndexes = new Array(newLen));
902
- for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)
903
- ;
904
- for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
905
- temp[newEnd] = mapped[end];
906
- tempdisposers[newEnd] = disposers[end];
907
- indexes && (tempIndexes[newEnd] = indexes[end]);
908
- }
909
- newIndices = /* @__PURE__ */ new Map();
910
- newIndicesNext = new Array(newEnd + 1);
911
- for (j = newEnd; j >= start; j--) {
912
- item = newItems[j];
913
- i = newIndices.get(item);
914
- newIndicesNext[j] = i === void 0 ? -1 : i;
915
- newIndices.set(item, j);
916
- }
917
- for (i = start; i <= end; i++) {
918
- item = items[i];
919
- j = newIndices.get(item);
920
- if (j !== void 0 && j !== -1) {
921
- temp[j] = mapped[i];
922
- tempdisposers[j] = disposers[i];
923
- indexes && (tempIndexes[j] = indexes[i]);
924
- j = newIndicesNext[j];
925
- newIndices.set(item, j);
926
- } else
927
- disposers[i]();
928
- }
929
- for (j = start; j < newLen; j++) {
930
- if (j in temp) {
931
- mapped[j] = temp[j];
932
- disposers[j] = tempdisposers[j];
933
- if (indexes) {
934
- indexes[j] = tempIndexes[j];
935
- indexes[j](j);
936
- }
937
- } else
938
- mapped[j] = createRoot(mapper);
939
- }
940
- mapped = mapped.slice(0, len = newLen);
941
- items = newItems.slice(0);
942
- }
943
- return mapped;
944
- });
945
- function mapper(disposer) {
946
- disposers[j] = disposer;
947
- if (indexes) {
948
- const [s, set] = createSignal(j);
949
- indexes[j] = set;
950
- return mapFn(newItems[j], s);
951
- }
952
- return mapFn(newItems[j]);
953
- }
954
- };
955
- }
956
- function indexArray(list, mapFn, options = {}) {
957
- let items = [], mapped = [], disposers = [], signals = [], len = 0, i;
958
- onCleanup(() => dispose(disposers));
959
- return () => {
960
- const newItems = list() || [], newLen = newItems.length;
961
- newItems[$TRACK];
962
- return untrack(() => {
963
- if (newLen === 0) {
964
- if (len !== 0) {
965
- dispose(disposers);
966
- disposers = [];
967
- items = [];
968
- mapped = [];
969
- len = 0;
970
- signals = [];
971
- }
972
- if (options.fallback) {
973
- items = [FALLBACK];
974
- mapped[0] = createRoot((disposer) => {
975
- disposers[0] = disposer;
976
- return options.fallback();
977
- });
978
- len = 1;
979
- }
980
- return mapped;
981
- }
982
- if (items[0] === FALLBACK) {
983
- disposers[0]();
984
- disposers = [];
985
- items = [];
986
- mapped = [];
987
- len = 0;
988
- }
989
- for (i = 0; i < newLen; i++) {
990
- if (i < items.length && items[i] !== newItems[i]) {
991
- signals[i](() => newItems[i]);
992
- } else if (i >= items.length) {
993
- mapped[i] = createRoot(mapper);
994
- }
995
- }
996
- for (; i < items.length; i++) {
997
- disposers[i]();
998
- }
999
- len = signals.length = disposers.length = newLen;
1000
- items = newItems.slice(0);
1001
- return mapped = mapped.slice(0, len);
1002
- });
1003
- function mapper(disposer) {
1004
- disposers[i] = disposer;
1005
- const [s, set] = createSignal(newItems[i]);
1006
- signals[i] = set;
1007
- return mapFn(s, i);
1008
- }
1009
- };
1010
- }
1011
- var hydrationEnabled = false;
1012
- function createComponent(Comp, props) {
1013
- if (hydrationEnabled) {
1014
- if (sharedConfig.context) {
1015
- const c = sharedConfig.context;
1016
- setHydrateContext(nextHydrateContext());
1017
- const r = untrack(() => Comp(props || {}));
1018
- setHydrateContext(c);
1019
- return r;
1020
- }
1021
- }
1022
- return untrack(() => Comp(props || {}));
1023
- }
1024
- function trueFn() {
1025
- return true;
1026
- }
1027
- var propTraps = {
1028
- get(_, property, receiver) {
1029
- if (property === $PROXY)
1030
- return receiver;
1031
- return _.get(property);
1032
- },
1033
- has(_, property) {
1034
- if (property === $PROXY)
1035
- return true;
1036
- return _.has(property);
1037
- },
1038
- set: trueFn,
1039
- deleteProperty: trueFn,
1040
- getOwnPropertyDescriptor(_, property) {
1041
- return {
1042
- configurable: true,
1043
- enumerable: true,
1044
- get() {
1045
- return _.get(property);
1046
- },
1047
- set: trueFn,
1048
- deleteProperty: trueFn
1049
- };
1050
- },
1051
- ownKeys(_) {
1052
- return _.keys();
1053
- }
1054
- };
1055
- function resolveSource(s) {
1056
- return !(s = typeof s === "function" ? s() : s) ? {} : s;
1057
- }
1058
- function resolveSources() {
1059
- for (let i = 0, length = this.length; i < length; ++i) {
1060
- const v = this[i]();
1061
- if (v !== void 0)
1062
- return v;
1063
- }
1064
- }
1065
- function mergeProps(...sources) {
1066
- let proxy = false;
1067
- for (let i = 0; i < sources.length; i++) {
1068
- const s = sources[i];
1069
- proxy = proxy || !!s && $PROXY in s;
1070
- sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
1071
- }
1072
- if (proxy) {
1073
- return new Proxy({
1074
- get(property) {
1075
- for (let i = sources.length - 1; i >= 0; i--) {
1076
- const v = resolveSource(sources[i])[property];
1077
- if (v !== void 0)
1078
- return v;
1079
- }
1080
- },
1081
- has(property) {
1082
- for (let i = sources.length - 1; i >= 0; i--) {
1083
- if (property in resolveSource(sources[i]))
1084
- return true;
1085
- }
1086
- return false;
1087
- },
1088
- keys() {
1089
- const keys = [];
1090
- for (let i = 0; i < sources.length; i++)
1091
- keys.push(...Object.keys(resolveSource(sources[i])));
1092
- return [...new Set(keys)];
1093
- }
1094
- }, propTraps);
1095
- }
1096
- const sourcesMap = {};
1097
- const defined = /* @__PURE__ */ Object.create(null);
1098
- for (let i = sources.length - 1; i >= 0; i--) {
1099
- const source = sources[i];
1100
- if (!source)
1101
- continue;
1102
- const sourceKeys = Object.getOwnPropertyNames(source);
1103
- for (let i2 = sourceKeys.length - 1; i2 >= 0; i2--) {
1104
- const key = sourceKeys[i2];
1105
- if (key === "__proto__" || key === "constructor")
1106
- continue;
1107
- const desc = Object.getOwnPropertyDescriptor(source, key);
1108
- if (!defined[key]) {
1109
- defined[key] = desc.get ? {
1110
- enumerable: true,
1111
- configurable: true,
1112
- get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
1113
- } : desc.value !== void 0 ? desc : void 0;
1114
- } else {
1115
- const sources2 = sourcesMap[key];
1116
- if (sources2) {
1117
- if (desc.get)
1118
- sources2.push(desc.get.bind(source));
1119
- else if (desc.value !== void 0)
1120
- sources2.push(() => desc.value);
1121
- }
1122
- }
1123
- }
1124
- }
1125
- const target = {};
1126
- const definedKeys = Object.keys(defined);
1127
- for (let i = definedKeys.length - 1; i >= 0; i--) {
1128
- const key = definedKeys[i], desc = defined[key];
1129
- if (desc && desc.get)
1130
- Object.defineProperty(target, key, desc);
1131
- else
1132
- target[key] = desc ? desc.value : void 0;
1133
- }
1134
- return target;
1135
- }
1136
- function splitProps(props, ...keys) {
1137
- if ($PROXY in props) {
1138
- const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
1139
- const res = keys.map((k) => {
1140
- return new Proxy({
1141
- get(property) {
1142
- return k.includes(property) ? props[property] : void 0;
1143
- },
1144
- has(property) {
1145
- return k.includes(property) && property in props;
1146
- },
1147
- keys() {
1148
- return k.filter((property) => property in props);
1149
- }
1150
- }, propTraps);
1151
- });
1152
- res.push(new Proxy({
1153
- get(property) {
1154
- return blocked.has(property) ? void 0 : props[property];
1155
- },
1156
- has(property) {
1157
- return blocked.has(property) ? false : property in props;
1158
- },
1159
- keys() {
1160
- return Object.keys(props).filter((k) => !blocked.has(k));
1161
- }
1162
- }, propTraps));
1163
- return res;
1164
- }
1165
- const otherObject = {};
1166
- const objects = keys.map(() => ({}));
1167
- for (const propName of Object.getOwnPropertyNames(props)) {
1168
- const desc = Object.getOwnPropertyDescriptor(props, propName);
1169
- const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1170
- let blocked = false;
1171
- let objectIndex = 0;
1172
- for (const k of keys) {
1173
- if (k.includes(propName)) {
1174
- blocked = true;
1175
- isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
1176
- }
1177
- ++objectIndex;
1178
- }
1179
- if (!blocked) {
1180
- isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
1181
- }
1182
- }
1183
- return [...objects, otherObject];
1184
- }
1185
- function lazy(fn) {
1186
- let comp;
1187
- let p;
1188
- const wrap = (props) => {
1189
- const ctx = sharedConfig.context;
1190
- if (ctx) {
1191
- const [s, set] = createSignal();
1192
- sharedConfig.count || (sharedConfig.count = 0);
1193
- sharedConfig.count++;
1194
- (p || (p = fn())).then((mod) => {
1195
- setHydrateContext(ctx);
1196
- sharedConfig.count--;
1197
- set(() => mod.default);
1198
- setHydrateContext();
1199
- });
1200
- comp = s;
1201
- } else if (!comp) {
1202
- const [s] = createResource(() => (p || (p = fn())).then((mod) => mod.default));
1203
- comp = s;
1204
- }
1205
- let Comp;
1206
- return createMemo(() => (Comp = comp()) && untrack(() => {
1207
- if (false)
1208
- ;
1209
- if (!ctx)
1210
- return Comp(props);
1211
- const c = sharedConfig.context;
1212
- setHydrateContext(ctx);
1213
- const r = Comp(props);
1214
- setHydrateContext(c);
1215
- return r;
1216
- }));
1217
- };
1218
- wrap.preload = () => p || ((p = fn()).then((mod) => comp = () => mod.default), p);
1219
- return wrap;
1220
- }
1221
- var counter = 0;
1222
- function createUniqueId() {
1223
- const ctx = sharedConfig.context;
1224
- return ctx ? sharedConfig.getNextContextId() : `cl-${counter++}`;
1225
- }
1226
- var narrowedError = (name) => `Stale read from <${name}>.`;
1227
- function For(props) {
1228
- const fallback = "fallback" in props && {
1229
- fallback: () => props.fallback
1230
- };
1231
- return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
1232
- }
1233
- function Index(props) {
1234
- const fallback = "fallback" in props && {
1235
- fallback: () => props.fallback
1236
- };
1237
- return createMemo(indexArray(() => props.each, props.children, fallback || void 0));
1238
- }
1239
- function Show(props) {
1240
- const keyed = props.keyed;
1241
- const condition = createMemo(() => props.when, void 0, {
1242
- equals: (a, b) => keyed ? a === b : !a === !b
1243
- });
1244
- return createMemo(() => {
1245
- const c = condition();
1246
- if (c) {
1247
- const child = props.children;
1248
- const fn = typeof child === "function" && child.length > 0;
1249
- return fn ? untrack(() => child(keyed ? c : () => {
1250
- if (!untrack(condition))
1251
- throw narrowedError("Show");
1252
- return props.when;
1253
- })) : child;
1254
- }
1255
- return props.fallback;
1256
- }, void 0, void 0);
1257
- }
1258
- function Switch(props) {
1259
- let keyed = false;
1260
- const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
1261
- const conditions = children(() => props.children), evalConditions = createMemo(() => {
1262
- let conds = conditions();
1263
- if (!Array.isArray(conds))
1264
- conds = [conds];
1265
- for (let i = 0; i < conds.length; i++) {
1266
- const c = conds[i].when;
1267
- if (c) {
1268
- keyed = !!conds[i].keyed;
1269
- return [i, c, conds[i]];
1270
- }
1271
- }
1272
- return [-1];
1273
- }, void 0, {
1274
- equals
1275
- });
1276
- return createMemo(() => {
1277
- const [index, when, cond] = evalConditions();
1278
- if (index < 0)
1279
- return props.fallback;
1280
- const c = cond.children;
1281
- const fn = typeof c === "function" && c.length > 0;
1282
- return fn ? untrack(() => c(keyed ? when : () => {
1283
- if (untrack(evalConditions)[0] !== index)
1284
- throw narrowedError("Match");
1285
- return cond.when;
1286
- })) : c;
1287
- }, void 0, void 0);
1288
- }
1289
- function Match(props) {
1290
- return props;
1291
- }
1292
- var DEV = void 0;
1293
-
1294
- // ../../node_modules/.pnpm/solid-js@1.8.19/node_modules/solid-js/web/dist/web.js
1295
- var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
1296
- var Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
1297
- var ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
1298
- var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
1299
- className: "class",
1300
- htmlFor: "for"
1301
- });
1302
- var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
1303
- class: "className",
1304
- formnovalidate: {
1305
- $: "formNoValidate",
1306
- BUTTON: 1,
1307
- INPUT: 1
1308
- },
1309
- ismap: {
1310
- $: "isMap",
1311
- IMG: 1
1312
- },
1313
- nomodule: {
1314
- $: "noModule",
1315
- SCRIPT: 1
1316
- },
1317
- playsinline: {
1318
- $: "playsInline",
1319
- VIDEO: 1
1320
- },
1321
- readonly: {
1322
- $: "readOnly",
1323
- INPUT: 1,
1324
- TEXTAREA: 1
1325
- }
1326
- });
1327
- function getPropAlias(prop, tagName) {
1328
- const a = PropAliases[prop];
1329
- return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
1330
- }
1331
- var DelegatedEvents = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
1332
- var SVGElements = /* @__PURE__ */ new Set([
1333
- "altGlyph",
1334
- "altGlyphDef",
1335
- "altGlyphItem",
1336
- "animate",
1337
- "animateColor",
1338
- "animateMotion",
1339
- "animateTransform",
1340
- "circle",
1341
- "clipPath",
1342
- "color-profile",
1343
- "cursor",
1344
- "defs",
1345
- "desc",
1346
- "ellipse",
1347
- "feBlend",
1348
- "feColorMatrix",
1349
- "feComponentTransfer",
1350
- "feComposite",
1351
- "feConvolveMatrix",
1352
- "feDiffuseLighting",
1353
- "feDisplacementMap",
1354
- "feDistantLight",
1355
- "feDropShadow",
1356
- "feFlood",
1357
- "feFuncA",
1358
- "feFuncB",
1359
- "feFuncG",
1360
- "feFuncR",
1361
- "feGaussianBlur",
1362
- "feImage",
1363
- "feMerge",
1364
- "feMergeNode",
1365
- "feMorphology",
1366
- "feOffset",
1367
- "fePointLight",
1368
- "feSpecularLighting",
1369
- "feSpotLight",
1370
- "feTile",
1371
- "feTurbulence",
1372
- "filter",
1373
- "font",
1374
- "font-face",
1375
- "font-face-format",
1376
- "font-face-name",
1377
- "font-face-src",
1378
- "font-face-uri",
1379
- "foreignObject",
1380
- "g",
1381
- "glyph",
1382
- "glyphRef",
1383
- "hkern",
1384
- "image",
1385
- "line",
1386
- "linearGradient",
1387
- "marker",
1388
- "mask",
1389
- "metadata",
1390
- "missing-glyph",
1391
- "mpath",
1392
- "path",
1393
- "pattern",
1394
- "polygon",
1395
- "polyline",
1396
- "radialGradient",
1397
- "rect",
1398
- "set",
1399
- "stop",
1400
- "svg",
1401
- "switch",
1402
- "symbol",
1403
- "text",
1404
- "textPath",
1405
- "tref",
1406
- "tspan",
1407
- "use",
1408
- "view",
1409
- "vkern"
1410
- ]);
1411
- var SVGNamespace = {
1412
- xlink: "http://www.w3.org/1999/xlink",
1413
- xml: "http://www.w3.org/XML/1998/namespace"
1414
- };
1415
- function reconcileArrays(parentNode, a, b) {
1416
- let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
1417
- while (aStart < aEnd || bStart < bEnd) {
1418
- if (a[aStart] === b[bStart]) {
1419
- aStart++;
1420
- bStart++;
1421
- continue;
1422
- }
1423
- while (a[aEnd - 1] === b[bEnd - 1]) {
1424
- aEnd--;
1425
- bEnd--;
1426
- }
1427
- if (aEnd === aStart) {
1428
- const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
1429
- while (bStart < bEnd)
1430
- parentNode.insertBefore(b[bStart++], node);
1431
- } else if (bEnd === bStart) {
1432
- while (aStart < aEnd) {
1433
- if (!map || !map.has(a[aStart]))
1434
- a[aStart].remove();
1435
- aStart++;
1436
- }
1437
- } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
1438
- const node = a[--aEnd].nextSibling;
1439
- parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
1440
- parentNode.insertBefore(b[--bEnd], node);
1441
- a[aEnd] = b[bEnd];
1442
- } else {
1443
- if (!map) {
1444
- map = /* @__PURE__ */ new Map();
1445
- let i = bStart;
1446
- while (i < bEnd)
1447
- map.set(b[i], i++);
1448
- }
1449
- const index = map.get(a[aStart]);
1450
- if (index != null) {
1451
- if (bStart < index && index < bEnd) {
1452
- let i = aStart, sequence = 1, t;
1453
- while (++i < aEnd && i < bEnd) {
1454
- if ((t = map.get(a[i])) == null || t !== index + sequence)
1455
- break;
1456
- sequence++;
1457
- }
1458
- if (sequence > index - bStart) {
1459
- const node = a[aStart];
1460
- while (bStart < index)
1461
- parentNode.insertBefore(b[bStart++], node);
1462
- } else
1463
- parentNode.replaceChild(b[bStart++], a[aStart++]);
1464
- } else
1465
- aStart++;
1466
- } else
1467
- a[aStart++].remove();
1468
- }
1469
- }
1470
- }
1471
- var $$EVENTS = "_$DX_DELEGATE";
1472
- function render(code, element, init, options = {}) {
1473
- let disposer;
1474
- createRoot((dispose2) => {
1475
- disposer = dispose2;
1476
- element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
1477
- }, options.owner);
1478
- return () => {
1479
- disposer();
1480
- element.textContent = "";
1481
- };
1482
- }
1483
- function template(html, isCE, isSVG) {
1484
- let node;
1485
- const create = () => {
1486
- const t = document.createElement("template");
1487
- t.innerHTML = html;
1488
- return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
1489
- };
1490
- const fn = isCE ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
1491
- fn.cloneNode = fn;
1492
- return fn;
1493
- }
1494
- function delegateEvents(eventNames, document2 = window.document) {
1495
- const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
1496
- for (let i = 0, l = eventNames.length; i < l; i++) {
1497
- const name = eventNames[i];
1498
- if (!e.has(name)) {
1499
- e.add(name);
1500
- document2.addEventListener(name, eventHandler);
1501
- }
1502
- }
1503
- }
1504
- function clearDelegatedEvents(document2 = window.document) {
1505
- if (document2[$$EVENTS]) {
1506
- for (let name of document2[$$EVENTS].keys())
1507
- document2.removeEventListener(name, eventHandler);
1508
- delete document2[$$EVENTS];
1509
- }
1510
- }
1511
- function setAttribute(node, name, value) {
1512
- if (!!sharedConfig.context && node.isConnected)
1513
- return;
1514
- if (value == null)
1515
- node.removeAttribute(name);
1516
- else
1517
- node.setAttribute(name, value);
1518
- }
1519
- function setAttributeNS(node, namespace, name, value) {
1520
- if (!!sharedConfig.context && node.isConnected)
1521
- return;
1522
- if (value == null)
1523
- node.removeAttributeNS(namespace, name);
1524
- else
1525
- node.setAttributeNS(namespace, name, value);
1526
- }
1527
- function className(node, value) {
1528
- if (!!sharedConfig.context && node.isConnected)
1529
- return;
1530
- if (value == null)
1531
- node.removeAttribute("class");
1532
- else
1533
- node.className = value;
1534
- }
1535
- function addEventListener(node, name, handler, delegate) {
1536
- if (delegate) {
1537
- if (Array.isArray(handler)) {
1538
- node[`$$${name}`] = handler[0];
1539
- node[`$$${name}Data`] = handler[1];
1540
- } else
1541
- node[`$$${name}`] = handler;
1542
- } else if (Array.isArray(handler)) {
1543
- const handlerFn = handler[0];
1544
- node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
1545
- } else
1546
- node.addEventListener(name, handler);
1547
- }
1548
- function classList(node, value, prev = {}) {
1549
- const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
1550
- let i, len;
1551
- for (i = 0, len = prevKeys.length; i < len; i++) {
1552
- const key = prevKeys[i];
1553
- if (!key || key === "undefined" || value[key])
1554
- continue;
1555
- toggleClassKey(node, key, false);
1556
- delete prev[key];
1557
- }
1558
- for (i = 0, len = classKeys.length; i < len; i++) {
1559
- const key = classKeys[i], classValue = !!value[key];
1560
- if (!key || key === "undefined" || prev[key] === classValue || !classValue)
1561
- continue;
1562
- toggleClassKey(node, key, true);
1563
- prev[key] = classValue;
1564
- }
1565
- return prev;
1566
- }
1567
- function style(node, value, prev) {
1568
- if (!value)
1569
- return prev ? setAttribute(node, "style") : value;
1570
- const nodeStyle = node.style;
1571
- if (typeof value === "string")
1572
- return nodeStyle.cssText = value;
1573
- typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
1574
- prev || (prev = {});
1575
- value || (value = {});
1576
- let v, s;
1577
- for (s in prev) {
1578
- value[s] == null && nodeStyle.removeProperty(s);
1579
- delete prev[s];
1580
- }
1581
- for (s in value) {
1582
- v = value[s];
1583
- if (v !== prev[s]) {
1584
- nodeStyle.setProperty(s, v);
1585
- prev[s] = v;
1586
- }
1587
- }
1588
- return prev;
1589
- }
1590
- function spread(node, props = {}, isSVG, skipChildren) {
1591
- const prevProps = {};
1592
- if (!skipChildren) {
1593
- createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
1594
- }
1595
- createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
1596
- createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
1597
- return prevProps;
1598
- }
1599
- function use(fn, element, arg) {
1600
- return untrack(() => fn(element, arg));
1601
- }
1602
- function insert(parent, accessor, marker, initial) {
1603
- if (marker !== void 0 && !initial)
1604
- initial = [];
1605
- if (typeof accessor !== "function")
1606
- return insertExpression(parent, accessor, initial, marker);
1607
- createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
1608
- }
1609
- function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
1610
- props || (props = {});
1611
- for (const prop in prevProps) {
1612
- if (!(prop in props)) {
1613
- if (prop === "children")
1614
- continue;
1615
- prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);
1616
- }
1617
- }
1618
- for (const prop in props) {
1619
- if (prop === "children") {
1620
- if (!skipChildren)
1621
- insertExpression(node, props.children);
1622
- continue;
1623
- }
1624
- const value = props[prop];
1625
- prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);
1626
- }
1627
- }
1628
- function getNextElement(template2) {
1629
- let node, key;
1630
- if (!sharedConfig.context || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
1631
- return template2();
1632
- }
1633
- if (sharedConfig.completed)
1634
- sharedConfig.completed.add(node);
1635
- sharedConfig.registry.delete(key);
1636
- return node;
1637
- }
1638
- function toPropertyName(name) {
1639
- return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
1640
- }
1641
- function toggleClassKey(node, key, value) {
1642
- const classNames = key.trim().split(/\s+/);
1643
- for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
1644
- node.classList.toggle(classNames[i], value);
1645
- }
1646
- function assignProp(node, prop, value, prev, isSVG, skipRef) {
1647
- let isCE, isProp, isChildProp, propAlias, forceProp;
1648
- if (prop === "style")
1649
- return style(node, value, prev);
1650
- if (prop === "classList")
1651
- return classList(node, value, prev);
1652
- if (value === prev)
1653
- return prev;
1654
- if (prop === "ref") {
1655
- if (!skipRef)
1656
- value(node);
1657
- } else if (prop.slice(0, 3) === "on:") {
1658
- const e = prop.slice(3);
1659
- prev && node.removeEventListener(e, prev);
1660
- value && node.addEventListener(e, value);
1661
- } else if (prop.slice(0, 10) === "oncapture:") {
1662
- const e = prop.slice(10);
1663
- prev && node.removeEventListener(e, prev, true);
1664
- value && node.addEventListener(e, value, true);
1665
- } else if (prop.slice(0, 2) === "on") {
1666
- const name = prop.slice(2).toLowerCase();
1667
- const delegate = DelegatedEvents.has(name);
1668
- if (!delegate && prev) {
1669
- const h = Array.isArray(prev) ? prev[0] : prev;
1670
- node.removeEventListener(name, h);
1671
- }
1672
- if (delegate || value) {
1673
- addEventListener(node, name, value, delegate);
1674
- delegate && delegateEvents([name]);
1675
- }
1676
- } else if (prop.slice(0, 5) === "attr:") {
1677
- setAttribute(node, prop.slice(5), value);
1678
- } 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("-"))) {
1679
- if (forceProp) {
1680
- prop = prop.slice(5);
1681
- isProp = true;
1682
- } else if (!!sharedConfig.context && node.isConnected)
1683
- return value;
1684
- if (prop === "class" || prop === "className")
1685
- className(node, value);
1686
- else if (isCE && !isProp && !isChildProp)
1687
- node[toPropertyName(prop)] = value;
1688
- else
1689
- node[propAlias || prop] = value;
1690
- } else {
1691
- const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
1692
- if (ns)
1693
- setAttributeNS(node, ns, prop, value);
1694
- else
1695
- setAttribute(node, Aliases[prop] || prop, value);
1696
- }
1697
- return value;
1698
- }
1699
- function eventHandler(e) {
1700
- const key = `$$${e.type}`;
1701
- let node = e.composedPath && e.composedPath()[0] || e.target;
1702
- if (e.target !== node) {
1703
- Object.defineProperty(e, "target", {
1704
- configurable: true,
1705
- value: node
1706
- });
1707
- }
1708
- Object.defineProperty(e, "currentTarget", {
1709
- configurable: true,
1710
- get() {
1711
- return node || document;
1712
- }
1713
- });
1714
- if (sharedConfig.registry && !sharedConfig.done)
1715
- sharedConfig.done = _$HY.done = true;
1716
- while (node) {
1717
- const handler = node[key];
1718
- if (handler && !node.disabled) {
1719
- const data = node[`${key}Data`];
1720
- data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
1721
- if (e.cancelBubble)
1722
- return;
1723
- }
1724
- node = node._$host || node.parentNode || node.host;
1725
- }
1726
- }
1727
- function insertExpression(parent, value, current, marker, unwrapArray) {
1728
- const hydrating = !!sharedConfig.context && parent.isConnected;
1729
- if (hydrating) {
1730
- !current && (current = [...parent.childNodes]);
1731
- let cleaned = [];
1732
- for (let i = 0; i < current.length; i++) {
1733
- const node = current[i];
1734
- if (node.nodeType === 8 && node.data.slice(0, 2) === "!$")
1735
- node.remove();
1736
- else
1737
- cleaned.push(node);
1738
- }
1739
- current = cleaned;
1740
- }
1741
- while (typeof current === "function")
1742
- current = current();
1743
- if (value === current)
1744
- return current;
1745
- const t = typeof value, multi = marker !== void 0;
1746
- parent = multi && current[0] && current[0].parentNode || parent;
1747
- if (t === "string" || t === "number") {
1748
- if (hydrating)
1749
- return current;
1750
- if (t === "number") {
1751
- value = value.toString();
1752
- if (value === current)
1753
- return current;
1754
- }
1755
- if (multi) {
1756
- let node = current[0];
1757
- if (node && node.nodeType === 3) {
1758
- node.data !== value && (node.data = value);
1759
- } else
1760
- node = document.createTextNode(value);
1761
- current = cleanChildren(parent, current, marker, node);
1762
- } else {
1763
- if (current !== "" && typeof current === "string") {
1764
- current = parent.firstChild.data = value;
1765
- } else
1766
- current = parent.textContent = value;
1767
- }
1768
- } else if (value == null || t === "boolean") {
1769
- if (hydrating)
1770
- return current;
1771
- current = cleanChildren(parent, current, marker);
1772
- } else if (t === "function") {
1773
- createRenderEffect(() => {
1774
- let v = value();
1775
- while (typeof v === "function")
1776
- v = v();
1777
- current = insertExpression(parent, v, current, marker);
1778
- });
1779
- return () => current;
1780
- } else if (Array.isArray(value)) {
1781
- const array = [];
1782
- const currentArray = current && Array.isArray(current);
1783
- if (normalizeIncomingArray(array, value, current, unwrapArray)) {
1784
- createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
1785
- return () => current;
1786
- }
1787
- if (hydrating) {
1788
- if (!array.length)
1789
- return current;
1790
- if (marker === void 0)
1791
- return [...parent.childNodes];
1792
- let node = array[0];
1793
- let nodes = [node];
1794
- while ((node = node.nextSibling) !== marker)
1795
- nodes.push(node);
1796
- return current = nodes;
1797
- }
1798
- if (array.length === 0) {
1799
- current = cleanChildren(parent, current, marker);
1800
- if (multi)
1801
- return current;
1802
- } else if (currentArray) {
1803
- if (current.length === 0) {
1804
- appendNodes(parent, array, marker);
1805
- } else
1806
- reconcileArrays(parent, current, array);
1807
- } else {
1808
- current && cleanChildren(parent);
1809
- appendNodes(parent, array);
1810
- }
1811
- current = array;
1812
- } else if (value.nodeType) {
1813
- if (hydrating && value.parentNode)
1814
- return current = multi ? [value] : value;
1815
- if (Array.isArray(current)) {
1816
- if (multi)
1817
- return current = cleanChildren(parent, current, marker, value);
1818
- cleanChildren(parent, current, null, value);
1819
- } else if (current == null || current === "" || !parent.firstChild) {
1820
- parent.appendChild(value);
1821
- } else
1822
- parent.replaceChild(value, parent.firstChild);
1823
- current = value;
1824
- } else
1825
- ;
1826
- return current;
1827
- }
1828
- function normalizeIncomingArray(normalized, array, current, unwrap) {
1829
- let dynamic = false;
1830
- for (let i = 0, len = array.length; i < len; i++) {
1831
- let item = array[i], prev = current && current[normalized.length], t;
1832
- if (item == null || item === true || item === false)
1833
- ;
1834
- else if ((t = typeof item) === "object" && item.nodeType) {
1835
- normalized.push(item);
1836
- } else if (Array.isArray(item)) {
1837
- dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
1838
- } else if (t === "function") {
1839
- if (unwrap) {
1840
- while (typeof item === "function")
1841
- item = item();
1842
- dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
1843
- } else {
1844
- normalized.push(item);
1845
- dynamic = true;
1846
- }
1847
- } else {
1848
- const value = String(item);
1849
- if (prev && prev.nodeType === 3 && prev.data === value)
1850
- normalized.push(prev);
1851
- else
1852
- normalized.push(document.createTextNode(value));
1853
- }
1854
- }
1855
- return dynamic;
1856
- }
1857
- function appendNodes(parent, array, marker = null) {
1858
- for (let i = 0, len = array.length; i < len; i++)
1859
- parent.insertBefore(array[i], marker);
1860
- }
1861
- function cleanChildren(parent, current, marker, replacement) {
1862
- if (marker === void 0)
1863
- return parent.textContent = "";
1864
- const node = replacement || document.createTextNode("");
1865
- if (current.length) {
1866
- let inserted = false;
1867
- for (let i = current.length - 1; i >= 0; i--) {
1868
- const el = current[i];
1869
- if (node !== el) {
1870
- const isParent = el.parentNode === parent;
1871
- if (!inserted && !i)
1872
- isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
1873
- else
1874
- isParent && el.remove();
1875
- } else
1876
- inserted = true;
1877
- }
1878
- } else
1879
- parent.insertBefore(node, marker);
1880
- return [node];
1881
- }
1882
- function getHydrationKey() {
1883
- return sharedConfig.getNextContextId();
1884
- }
1885
- var RequestContext = Symbol();
1886
- var isServer = false;
1887
- var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1888
- function createElement(tagName, isSVG = false) {
1889
- return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);
1890
- }
1891
- function Portal(props) {
1892
- const {
1893
- useShadow
1894
- } = props, marker = document.createTextNode(""), mount = () => props.mount || document.body, owner = getOwner();
1895
- let content;
1896
- let hydrating = !!sharedConfig.context;
1897
- createEffect(() => {
1898
- if (hydrating)
1899
- getOwner().user = hydrating = false;
1900
- content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
1901
- const el = mount();
1902
- if (el instanceof HTMLHeadElement) {
1903
- const [clean, setClean] = createSignal(false);
1904
- const cleanup = () => setClean(true);
1905
- createRoot((dispose2) => insert(el, () => !clean() ? content() : dispose2(), null));
1906
- onCleanup(cleanup);
1907
- } else {
1908
- const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
1909
- mode: "open"
1910
- }) : container;
1911
- Object.defineProperty(container, "_$host", {
1912
- get() {
1913
- return marker.parentNode;
1914
- },
1915
- configurable: true
1916
- });
1917
- insert(renderRoot, content);
1918
- el.appendChild(container);
1919
- props.ref && props.ref(container);
1920
- onCleanup(() => el.removeChild(container));
1921
- }
1922
- }, void 0, {
1923
- render: !hydrating
1924
- });
1925
- return marker;
1926
- }
1927
- function Dynamic(props) {
1928
- const [p, others] = splitProps(props, ["component"]);
1929
- const cached = createMemo(() => p.component);
1930
- return createMemo(() => {
1931
- const component = cached();
1932
- switch (typeof component) {
1933
- case "function":
1934
- return untrack(() => component(others));
1935
- case "string":
1936
- const isSvg = SVGElements.has(component);
1937
- const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);
1938
- spread(el, others, isSvg);
1939
- return el;
1940
- }
1941
- });
1942
- }
1943
-
1944
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/double-indexed-kv.js
1945
- var DoubleIndexedKV = class {
1946
- constructor() {
1947
- this.keyToValue = /* @__PURE__ */ new Map();
1948
- this.valueToKey = /* @__PURE__ */ new Map();
1949
- }
1950
- set(key, value) {
1951
- this.keyToValue.set(key, value);
1952
- this.valueToKey.set(value, key);
1953
- }
1954
- getByKey(key) {
1955
- return this.keyToValue.get(key);
1956
- }
1957
- getByValue(value) {
1958
- return this.valueToKey.get(value);
1959
- }
1960
- clear() {
1961
- this.keyToValue.clear();
1962
- this.valueToKey.clear();
1963
- }
1964
- };
1965
-
1966
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/registry.js
1967
- var Registry = class {
1968
- constructor(generateIdentifier) {
1969
- this.generateIdentifier = generateIdentifier;
1970
- this.kv = new DoubleIndexedKV();
1971
- }
1972
- register(value, identifier) {
1973
- if (this.kv.getByValue(value)) {
1974
- return;
1975
- }
1976
- if (!identifier) {
1977
- identifier = this.generateIdentifier(value);
1978
- }
1979
- this.kv.set(identifier, value);
1980
- }
1981
- clear() {
1982
- this.kv.clear();
1983
- }
1984
- getIdentifier(value) {
1985
- return this.kv.getByValue(value);
1986
- }
1987
- getValue(identifier) {
1988
- return this.kv.getByKey(identifier);
1989
- }
1990
- };
1991
-
1992
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/class-registry.js
1993
- var ClassRegistry = class extends Registry {
1994
- constructor() {
1995
- super((c) => c.name);
1996
- this.classToAllowedProps = /* @__PURE__ */ new Map();
1997
- }
1998
- register(value, options) {
1999
- if (typeof options === "object") {
2000
- if (options.allowProps) {
2001
- this.classToAllowedProps.set(value, options.allowProps);
2002
- }
2003
- super.register(value, options.identifier);
2004
- } else {
2005
- super.register(value, options);
2006
- }
2007
- }
2008
- getAllowedProps(value) {
2009
- return this.classToAllowedProps.get(value);
2010
- }
2011
- };
2012
-
2013
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/util.js
2014
- function valuesOfObj(record) {
2015
- if ("values" in Object) {
2016
- return Object.values(record);
2017
- }
2018
- const values = [];
2019
- for (const key in record) {
2020
- if (record.hasOwnProperty(key)) {
2021
- values.push(record[key]);
2022
- }
2023
- }
2024
- return values;
2025
- }
2026
- function find(record, predicate) {
2027
- const values = valuesOfObj(record);
2028
- if ("find" in values) {
2029
- return values.find(predicate);
2030
- }
2031
- const valuesNotNever = values;
2032
- for (let i = 0; i < valuesNotNever.length; i++) {
2033
- const value = valuesNotNever[i];
2034
- if (predicate(value)) {
2035
- return value;
2036
- }
2037
- }
2038
- return void 0;
2039
- }
2040
- function forEach(record, run) {
2041
- Object.entries(record).forEach(([key, value]) => run(value, key));
2042
- }
2043
- function includes(arr, value) {
2044
- return arr.indexOf(value) !== -1;
2045
- }
2046
- function findArr(record, predicate) {
2047
- for (let i = 0; i < record.length; i++) {
2048
- const value = record[i];
2049
- if (predicate(value)) {
2050
- return value;
2051
- }
2052
- }
2053
- return void 0;
2054
- }
2055
-
2056
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/custom-transformer-registry.js
2057
- var CustomTransformerRegistry = class {
2058
- constructor() {
2059
- this.transfomers = {};
2060
- }
2061
- register(transformer) {
2062
- this.transfomers[transformer.name] = transformer;
2063
- }
2064
- findApplicable(v) {
2065
- return find(this.transfomers, (transformer) => transformer.isApplicable(v));
2066
- }
2067
- findByName(name) {
2068
- return this.transfomers[name];
2069
- }
2070
- };
2071
-
2072
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/is.js
2073
- var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
2074
- var isUndefined = (payload) => typeof payload === "undefined";
2075
- var isNull = (payload) => payload === null;
2076
- var isPlainObject = (payload) => {
2077
- if (typeof payload !== "object" || payload === null)
2078
- return false;
2079
- if (payload === Object.prototype)
2080
- return false;
2081
- if (Object.getPrototypeOf(payload) === null)
2082
- return true;
2083
- return Object.getPrototypeOf(payload) === Object.prototype;
2084
- };
2085
- var isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;
2086
- var isArray = (payload) => Array.isArray(payload);
2087
- var isString = (payload) => typeof payload === "string";
2088
- var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
2089
- var isBoolean = (payload) => typeof payload === "boolean";
2090
- var isRegExp = (payload) => payload instanceof RegExp;
2091
- var isMap = (payload) => payload instanceof Map;
2092
- var isSet = (payload) => payload instanceof Set;
2093
- var isSymbol = (payload) => getType(payload) === "Symbol";
2094
- var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
2095
- var isError = (payload) => payload instanceof Error;
2096
- var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
2097
- var isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
2098
- var isBigint = (payload) => typeof payload === "bigint";
2099
- var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
2100
- var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
2101
- var isURL = (payload) => payload instanceof URL;
2102
-
2103
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/pathstringifier.js
2104
- var escapeKey = (key) => key.replace(/\./g, "\\.");
2105
- var stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
2106
- var parsePath = (string) => {
2107
- const result = [];
2108
- let segment = "";
2109
- for (let i = 0; i < string.length; i++) {
2110
- let char = string.charAt(i);
2111
- const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
2112
- if (isEscapedDot) {
2113
- segment += ".";
2114
- i++;
2115
- continue;
2116
- }
2117
- const isEndOfSegment = char === ".";
2118
- if (isEndOfSegment) {
2119
- result.push(segment);
2120
- segment = "";
2121
- continue;
2122
- }
2123
- segment += char;
2124
- }
2125
- const lastSegment = segment;
2126
- result.push(lastSegment);
2127
- return result;
2128
- };
2129
-
2130
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/transformer.js
2131
- function simpleTransformation(isApplicable, annotation, transform, untransform) {
2132
- return {
2133
- isApplicable,
2134
- annotation,
2135
- transform,
2136
- untransform
2137
- };
2138
- }
2139
- var simpleRules = [
2140
- simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
2141
- simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
2142
- if (typeof BigInt !== "undefined") {
2143
- return BigInt(v);
2144
- }
2145
- return v;
2146
- }),
2147
- simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
2148
- simpleTransformation(isError, "Error", (v, superJson) => {
2149
- const baseError = {
2150
- name: v.name,
2151
- message: v.message
2152
- };
2153
- superJson.allowedErrorProps.forEach((prop) => {
2154
- baseError[prop] = v[prop];
2155
- });
2156
- return baseError;
2157
- }, (v, superJson) => {
2158
- const e = new Error(v.message);
2159
- e.name = v.name;
2160
- e.stack = v.stack;
2161
- superJson.allowedErrorProps.forEach((prop) => {
2162
- e[prop] = v[prop];
2163
- });
2164
- return e;
2165
- }),
2166
- simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
2167
- const body = regex.slice(1, regex.lastIndexOf("/"));
2168
- const flags = regex.slice(regex.lastIndexOf("/") + 1);
2169
- return new RegExp(body, flags);
2170
- }),
2171
- simpleTransformation(
2172
- isSet,
2173
- "set",
2174
- // (sets only exist in es6+)
2175
- // eslint-disable-next-line es5/no-es6-methods
2176
- (v) => [...v.values()],
2177
- (v) => new Set(v)
2178
- ),
2179
- simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
2180
- simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
2181
- if (isNaNValue(v)) {
2182
- return "NaN";
2183
- }
2184
- if (v > 0) {
2185
- return "Infinity";
2186
- } else {
2187
- return "-Infinity";
2188
- }
2189
- }, Number),
2190
- simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
2191
- return "-0";
2192
- }, Number),
2193
- simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
2194
- ];
2195
- function compositeTransformation(isApplicable, annotation, transform, untransform) {
2196
- return {
2197
- isApplicable,
2198
- annotation,
2199
- transform,
2200
- untransform
2201
- };
2202
- }
2203
- var symbolRule = compositeTransformation((s, superJson) => {
2204
- if (isSymbol(s)) {
2205
- const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
2206
- return isRegistered;
2207
- }
2208
- return false;
2209
- }, (s, superJson) => {
2210
- const identifier = superJson.symbolRegistry.getIdentifier(s);
2211
- return ["symbol", identifier];
2212
- }, (v) => v.description, (_, a, superJson) => {
2213
- const value = superJson.symbolRegistry.getValue(a[1]);
2214
- if (!value) {
2215
- throw new Error("Trying to deserialize unknown symbol");
2216
- }
2217
- return value;
2218
- });
2219
- var constructorToName = [
2220
- Int8Array,
2221
- Uint8Array,
2222
- Int16Array,
2223
- Uint16Array,
2224
- Int32Array,
2225
- Uint32Array,
2226
- Float32Array,
2227
- Float64Array,
2228
- Uint8ClampedArray
2229
- ].reduce((obj, ctor) => {
2230
- obj[ctor.name] = ctor;
2231
- return obj;
2232
- }, {});
2233
- var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
2234
- const ctor = constructorToName[a[1]];
2235
- if (!ctor) {
2236
- throw new Error("Trying to deserialize unknown typed array");
2237
- }
2238
- return new ctor(v);
2239
- });
2240
- function isInstanceOfRegisteredClass(potentialClass, superJson) {
2241
- if (potentialClass?.constructor) {
2242
- const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
2243
- return isRegistered;
2244
- }
2245
- return false;
2246
- }
2247
- var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
2248
- const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
2249
- return ["class", identifier];
2250
- }, (clazz, superJson) => {
2251
- const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
2252
- if (!allowedProps) {
2253
- return { ...clazz };
2254
- }
2255
- const result = {};
2256
- allowedProps.forEach((prop) => {
2257
- result[prop] = clazz[prop];
2258
- });
2259
- return result;
2260
- }, (v, a, superJson) => {
2261
- const clazz = superJson.classRegistry.getValue(a[1]);
2262
- if (!clazz) {
2263
- throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
2264
- }
2265
- return Object.assign(Object.create(clazz.prototype), v);
2266
- });
2267
- var customRule = compositeTransformation((value, superJson) => {
2268
- return !!superJson.customTransformerRegistry.findApplicable(value);
2269
- }, (value, superJson) => {
2270
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
2271
- return ["custom", transformer.name];
2272
- }, (value, superJson) => {
2273
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
2274
- return transformer.serialize(value);
2275
- }, (v, a, superJson) => {
2276
- const transformer = superJson.customTransformerRegistry.findByName(a[1]);
2277
- if (!transformer) {
2278
- throw new Error("Trying to deserialize unknown custom value");
2279
- }
2280
- return transformer.deserialize(v);
2281
- });
2282
- var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
2283
- var transformValue = (value, superJson) => {
2284
- const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
2285
- if (applicableCompositeRule) {
2286
- return {
2287
- value: applicableCompositeRule.transform(value, superJson),
2288
- type: applicableCompositeRule.annotation(value, superJson)
2289
- };
2290
- }
2291
- const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
2292
- if (applicableSimpleRule) {
2293
- return {
2294
- value: applicableSimpleRule.transform(value, superJson),
2295
- type: applicableSimpleRule.annotation
2296
- };
2297
- }
2298
- return void 0;
2299
- };
2300
- var simpleRulesByAnnotation = {};
2301
- simpleRules.forEach((rule) => {
2302
- simpleRulesByAnnotation[rule.annotation] = rule;
2303
- });
2304
- var untransformValue = (json, type, superJson) => {
2305
- if (isArray(type)) {
2306
- switch (type[0]) {
2307
- case "symbol":
2308
- return symbolRule.untransform(json, type, superJson);
2309
- case "class":
2310
- return classRule.untransform(json, type, superJson);
2311
- case "custom":
2312
- return customRule.untransform(json, type, superJson);
2313
- case "typed-array":
2314
- return typedArrayRule.untransform(json, type, superJson);
2315
- default:
2316
- throw new Error("Unknown transformation: " + type);
2317
- }
2318
- } else {
2319
- const transformation = simpleRulesByAnnotation[type];
2320
- if (!transformation) {
2321
- throw new Error("Unknown transformation: " + type);
2322
- }
2323
- return transformation.untransform(json, superJson);
2324
- }
2325
- };
2326
-
2327
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/accessDeep.js
2328
- var getNthKey = (value, n) => {
2329
- const keys = value.keys();
2330
- while (n > 0) {
2331
- keys.next();
2332
- n--;
2333
- }
2334
- return keys.next().value;
2335
- };
2336
- function validatePath(path) {
2337
- if (includes(path, "__proto__")) {
2338
- throw new Error("__proto__ is not allowed as a property");
2339
- }
2340
- if (includes(path, "prototype")) {
2341
- throw new Error("prototype is not allowed as a property");
2342
- }
2343
- if (includes(path, "constructor")) {
2344
- throw new Error("constructor is not allowed as a property");
2345
- }
2346
- }
2347
- var getDeep = (object, path) => {
2348
- validatePath(path);
2349
- for (let i = 0; i < path.length; i++) {
2350
- const key = path[i];
2351
- if (isSet(object)) {
2352
- object = getNthKey(object, +key);
2353
- } else if (isMap(object)) {
2354
- const row = +key;
2355
- const type = +path[++i] === 0 ? "key" : "value";
2356
- const keyOfRow = getNthKey(object, row);
2357
- switch (type) {
2358
- case "key":
2359
- object = keyOfRow;
2360
- break;
2361
- case "value":
2362
- object = object.get(keyOfRow);
2363
- break;
2364
- }
2365
- } else {
2366
- object = object[key];
2367
- }
2368
- }
2369
- return object;
2370
- };
2371
- var setDeep = (object, path, mapper) => {
2372
- validatePath(path);
2373
- if (path.length === 0) {
2374
- return mapper(object);
2375
- }
2376
- let parent = object;
2377
- for (let i = 0; i < path.length - 1; i++) {
2378
- const key = path[i];
2379
- if (isArray(parent)) {
2380
- const index = +key;
2381
- parent = parent[index];
2382
- } else if (isPlainObject(parent)) {
2383
- parent = parent[key];
2384
- } else if (isSet(parent)) {
2385
- const row = +key;
2386
- parent = getNthKey(parent, row);
2387
- } else if (isMap(parent)) {
2388
- const isEnd = i === path.length - 2;
2389
- if (isEnd) {
2390
- break;
2391
- }
2392
- const row = +key;
2393
- const type = +path[++i] === 0 ? "key" : "value";
2394
- const keyOfRow = getNthKey(parent, row);
2395
- switch (type) {
2396
- case "key":
2397
- parent = keyOfRow;
2398
- break;
2399
- case "value":
2400
- parent = parent.get(keyOfRow);
2401
- break;
2402
- }
2403
- }
2404
- }
2405
- const lastKey = path[path.length - 1];
2406
- if (isArray(parent)) {
2407
- parent[+lastKey] = mapper(parent[+lastKey]);
2408
- } else if (isPlainObject(parent)) {
2409
- parent[lastKey] = mapper(parent[lastKey]);
2410
- }
2411
- if (isSet(parent)) {
2412
- const oldValue = getNthKey(parent, +lastKey);
2413
- const newValue = mapper(oldValue);
2414
- if (oldValue !== newValue) {
2415
- parent.delete(oldValue);
2416
- parent.add(newValue);
2417
- }
2418
- }
2419
- if (isMap(parent)) {
2420
- const row = +path[path.length - 2];
2421
- const keyToRow = getNthKey(parent, row);
2422
- const type = +lastKey === 0 ? "key" : "value";
2423
- switch (type) {
2424
- case "key": {
2425
- const newKey = mapper(keyToRow);
2426
- parent.set(newKey, parent.get(keyToRow));
2427
- if (newKey !== keyToRow) {
2428
- parent.delete(keyToRow);
2429
- }
2430
- break;
2431
- }
2432
- case "value": {
2433
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
2434
- break;
2435
- }
2436
- }
2437
- }
2438
- return object;
2439
- };
2440
-
2441
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/plainer.js
2442
- function traverse(tree, walker2, origin = []) {
2443
- if (!tree) {
2444
- return;
2445
- }
2446
- if (!isArray(tree)) {
2447
- forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));
2448
- return;
2449
- }
2450
- const [nodeValue, children2] = tree;
2451
- if (children2) {
2452
- forEach(children2, (child, key) => {
2453
- traverse(child, walker2, [...origin, ...parsePath(key)]);
2454
- });
2455
- }
2456
- walker2(nodeValue, origin);
2457
- }
2458
- function applyValueAnnotations(plain, annotations, superJson) {
2459
- traverse(annotations, (type, path) => {
2460
- plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
2461
- });
2462
- return plain;
2463
- }
2464
- function applyReferentialEqualityAnnotations(plain, annotations) {
2465
- function apply(identicalPaths, path) {
2466
- const object = getDeep(plain, parsePath(path));
2467
- identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
2468
- plain = setDeep(plain, identicalObjectPath, () => object);
2469
- });
2470
- }
2471
- if (isArray(annotations)) {
2472
- const [root, other] = annotations;
2473
- root.forEach((identicalPath) => {
2474
- plain = setDeep(plain, parsePath(identicalPath), () => plain);
2475
- });
2476
- if (other) {
2477
- forEach(other, apply);
2478
- }
2479
- } else {
2480
- forEach(annotations, apply);
2481
- }
2482
- return plain;
2483
- }
2484
- var isDeep = (object, superJson) => isPlainObject(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
2485
- function addIdentity(object, path, identities) {
2486
- const existingSet = identities.get(object);
2487
- if (existingSet) {
2488
- existingSet.push(path);
2489
- } else {
2490
- identities.set(object, [path]);
2491
- }
2492
- }
2493
- function generateReferentialEqualityAnnotations(identitites, dedupe) {
2494
- const result = {};
2495
- let rootEqualityPaths = void 0;
2496
- identitites.forEach((paths) => {
2497
- if (paths.length <= 1) {
2498
- return;
2499
- }
2500
- if (!dedupe) {
2501
- paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
2502
- }
2503
- const [representativePath, ...identicalPaths] = paths;
2504
- if (representativePath.length === 0) {
2505
- rootEqualityPaths = identicalPaths.map(stringifyPath);
2506
- } else {
2507
- result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
2508
- }
2509
- });
2510
- if (rootEqualityPaths) {
2511
- if (isEmptyObject(result)) {
2512
- return [rootEqualityPaths];
2513
- } else {
2514
- return [rootEqualityPaths, result];
2515
- }
2516
- } else {
2517
- return isEmptyObject(result) ? void 0 : result;
2518
- }
2519
- }
2520
- var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
2521
- const primitive = isPrimitive(object);
2522
- if (!primitive) {
2523
- addIdentity(object, path, identities);
2524
- const seen = seenObjects.get(object);
2525
- if (seen) {
2526
- return dedupe ? {
2527
- transformedValue: null
2528
- } : seen;
2529
- }
2530
- }
2531
- if (!isDeep(object, superJson)) {
2532
- const transformed2 = transformValue(object, superJson);
2533
- const result2 = transformed2 ? {
2534
- transformedValue: transformed2.value,
2535
- annotations: [transformed2.type]
2536
- } : {
2537
- transformedValue: object
2538
- };
2539
- if (!primitive) {
2540
- seenObjects.set(object, result2);
2541
- }
2542
- return result2;
2543
- }
2544
- if (includes(objectsInThisPath, object)) {
2545
- return {
2546
- transformedValue: null
2547
- };
2548
- }
2549
- const transformationResult = transformValue(object, superJson);
2550
- const transformed = transformationResult?.value ?? object;
2551
- const transformedValue = isArray(transformed) ? [] : {};
2552
- const innerAnnotations = {};
2553
- forEach(transformed, (value, index) => {
2554
- if (index === "__proto__" || index === "constructor" || index === "prototype") {
2555
- throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
2556
- }
2557
- const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
2558
- transformedValue[index] = recursiveResult.transformedValue;
2559
- if (isArray(recursiveResult.annotations)) {
2560
- innerAnnotations[index] = recursiveResult.annotations;
2561
- } else if (isPlainObject(recursiveResult.annotations)) {
2562
- forEach(recursiveResult.annotations, (tree, key) => {
2563
- innerAnnotations[escapeKey(index) + "." + key] = tree;
2564
- });
2565
- }
2566
- });
2567
- const result = isEmptyObject(innerAnnotations) ? {
2568
- transformedValue,
2569
- annotations: !!transformationResult ? [transformationResult.type] : void 0
2570
- } : {
2571
- transformedValue,
2572
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
2573
- };
2574
- if (!primitive) {
2575
- seenObjects.set(object, result);
2576
- }
2577
- return result;
2578
- };
2579
-
2580
- // ../../node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.js
2581
- function getType2(payload) {
2582
- return Object.prototype.toString.call(payload).slice(8, -1);
2583
- }
2584
- function isArray2(payload) {
2585
- return getType2(payload) === "Array";
2586
- }
2587
- function isPlainObject2(payload) {
2588
- if (getType2(payload) !== "Object")
2589
- return false;
2590
- const prototype = Object.getPrototypeOf(payload);
2591
- return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
2592
- }
2593
- function isNull2(payload) {
2594
- return getType2(payload) === "Null";
2595
- }
2596
- function isOneOf(a, b, c, d, e) {
2597
- return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);
2598
- }
2599
- function isUndefined2(payload) {
2600
- return getType2(payload) === "Undefined";
2601
- }
2602
- var isNullOrUndefined = isOneOf(isNull2, isUndefined2);
2603
-
2604
- // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
2605
- function assignProp2(carry, key, newVal, originalObject, includeNonenumerable) {
2606
- const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
2607
- if (propType === "enumerable")
2608
- carry[key] = newVal;
2609
- if (includeNonenumerable && propType === "nonenumerable") {
2610
- Object.defineProperty(carry, key, {
2611
- value: newVal,
2612
- enumerable: false,
2613
- writable: true,
2614
- configurable: true
2615
- });
2616
- }
2617
- }
2618
- function copy(target, options = {}) {
2619
- if (isArray2(target)) {
2620
- return target.map((item) => copy(item, options));
2621
- }
2622
- if (!isPlainObject2(target)) {
2623
- return target;
2624
- }
2625
- const props = Object.getOwnPropertyNames(target);
2626
- const symbols = Object.getOwnPropertySymbols(target);
2627
- return [...props, ...symbols].reduce((carry, key) => {
2628
- if (isArray2(options.props) && !options.props.includes(key)) {
2629
- return carry;
2630
- }
2631
- const val = target[key];
2632
- const newVal = copy(val, options);
2633
- assignProp2(carry, key, newVal, target, options.nonenumerable);
2634
- return carry;
2635
- }, {});
2636
- }
2637
-
2638
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js
2639
- var SuperJSON = class {
2640
- /**
2641
- * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
2642
- */
2643
- constructor({ dedupe = false } = {}) {
2644
- this.classRegistry = new ClassRegistry();
2645
- this.symbolRegistry = new Registry((s) => s.description ?? "");
2646
- this.customTransformerRegistry = new CustomTransformerRegistry();
2647
- this.allowedErrorProps = [];
2648
- this.dedupe = dedupe;
2649
- }
2650
- serialize(object) {
2651
- const identities = /* @__PURE__ */ new Map();
2652
- const output = walker(object, identities, this, this.dedupe);
2653
- const res = {
2654
- json: output.transformedValue
2655
- };
2656
- if (output.annotations) {
2657
- res.meta = {
2658
- ...res.meta,
2659
- values: output.annotations
2660
- };
2661
- }
2662
- const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
2663
- if (equalityAnnotations) {
2664
- res.meta = {
2665
- ...res.meta,
2666
- referentialEqualities: equalityAnnotations
2667
- };
2668
- }
2669
- return res;
2670
- }
2671
- deserialize(payload) {
2672
- const { json, meta } = payload;
2673
- let result = copy(json);
2674
- if (meta?.values) {
2675
- result = applyValueAnnotations(result, meta.values, this);
2676
- }
2677
- if (meta?.referentialEqualities) {
2678
- result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
2679
- }
2680
- return result;
2681
- }
2682
- stringify(object) {
2683
- return JSON.stringify(this.serialize(object));
2684
- }
2685
- parse(string) {
2686
- return this.deserialize(JSON.parse(string));
2687
- }
2688
- registerClass(v, options) {
2689
- this.classRegistry.register(v, options);
2690
- }
2691
- registerSymbol(v, identifier) {
2692
- this.symbolRegistry.register(v, identifier);
2693
- }
2694
- registerCustom(transformer, name) {
2695
- this.customTransformerRegistry.register({
2696
- name,
2697
- ...transformer
2698
- });
2699
- }
2700
- allowErrorProps(...props) {
2701
- this.allowedErrorProps.push(...props);
2702
- }
2703
- };
2704
- SuperJSON.defaultInstance = new SuperJSON();
2705
- SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
2706
- SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
2707
- SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
2708
- SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
2709
- SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
2710
- SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
2711
- SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
2712
- SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
2713
- var serialize = SuperJSON.serialize;
2714
- var deserialize = SuperJSON.deserialize;
2715
- var stringify = SuperJSON.stringify;
2716
- var parse = SuperJSON.parse;
2717
- var registerClass = SuperJSON.registerClass;
2718
- var registerCustom = SuperJSON.registerCustom;
2719
- var registerSymbol = SuperJSON.registerSymbol;
2720
- var allowErrorProps = SuperJSON.allowErrorProps;
2721
-
2722
- // src/utils.tsx
2723
- function getQueryStatusLabel(query) {
2724
- return query.state.fetchStatus === "fetching" ? "fetching" : !query.getObserversCount() ? "inactive" : query.state.fetchStatus === "paused" ? "paused" : query.isStale() ? "stale" : "fresh";
2725
- }
2726
- function getSidedProp(prop, side) {
2727
- return `${prop}${side.charAt(0).toUpperCase() + side.slice(1)}`;
2728
- }
2729
- function getQueryStatusColor({
2730
- queryState,
2731
- observerCount,
2732
- isStale
2733
- }) {
2734
- return queryState.fetchStatus === "fetching" ? "blue" : !observerCount ? "gray" : queryState.fetchStatus === "paused" ? "purple" : isStale ? "yellow" : "green";
2735
- }
2736
- function getMutationStatusColor({
2737
- status,
2738
- isPaused
2739
- }) {
2740
- return isPaused ? "purple" : status === "error" ? "red" : status === "pending" ? "yellow" : status === "success" ? "green" : "gray";
2741
- }
2742
- function getQueryStatusColorByLabel(label) {
2743
- return label === "fresh" ? "green" : label === "stale" ? "yellow" : label === "paused" ? "purple" : label === "inactive" ? "gray" : "blue";
2744
- }
2745
- var displayValue = (value, beautify = false) => {
2746
- const { json } = serialize(value);
2747
- return JSON.stringify(json, null, beautify ? 2 : void 0);
2748
- };
2749
- var getStatusRank = (q) => q.state.fetchStatus !== "idle" ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
2750
- var queryHashSort = (a, b) => a.queryHash.localeCompare(b.queryHash);
2751
- var dateSort = (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1;
2752
- var statusAndDateSort = (a, b) => {
2753
- if (getStatusRank(a) === getStatusRank(b)) {
2754
- return dateSort(a, b);
2755
- }
2756
- return getStatusRank(a) > getStatusRank(b) ? 1 : -1;
2757
- };
2758
- var sortFns = {
2759
- status: statusAndDateSort,
2760
- "query hash": queryHashSort,
2761
- "last updated": dateSort
2762
- };
2763
- var getMutationStatusRank = (m) => m.state.isPaused ? 0 : m.state.status === "error" ? 2 : m.state.status === "pending" ? 1 : 3;
2764
- var mutationDateSort = (a, b) => a.state.submittedAt < b.state.submittedAt ? 1 : -1;
2765
- var mutationStatusSort = (a, b) => {
2766
- if (getMutationStatusRank(a) === getMutationStatusRank(b)) {
2767
- return mutationDateSort(a, b);
2768
- }
2769
- return getMutationStatusRank(a) > getMutationStatusRank(b) ? 1 : -1;
2770
- };
2771
- var mutationSortFns = {
2772
- status: mutationStatusSort,
2773
- "last updated": mutationDateSort
2774
- };
2775
- var convertRemToPixels = (rem) => {
2776
- return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
2777
- };
2778
- var getPreferredColorScheme = () => {
2779
- const [colorScheme, setColorScheme] = createSignal("dark");
2780
- onMount(() => {
2781
- const query = window.matchMedia("(prefers-color-scheme: dark)");
2782
- setColorScheme(query.matches ? "dark" : "light");
2783
- const listener = (e) => {
2784
- setColorScheme(e.matches ? "dark" : "light");
2785
- };
2786
- query.addEventListener("change", listener);
2787
- onCleanup(() => query.removeEventListener("change", listener));
2788
- });
2789
- return colorScheme;
2790
- };
2791
- var updateNestedDataByPath = (oldData, updatePath, value) => {
2792
- if (updatePath.length === 0) {
2793
- return value;
2794
- }
2795
- if (oldData instanceof Map) {
2796
- const newData = new Map(oldData);
2797
- if (updatePath.length === 1) {
2798
- newData.set(updatePath[0], value);
2799
- return newData;
2800
- }
2801
- const [head, ...tail] = updatePath;
2802
- newData.set(head, updateNestedDataByPath(newData.get(head), tail, value));
2803
- return newData;
2804
- }
2805
- if (oldData instanceof Set) {
2806
- const setAsArray = updateNestedDataByPath(
2807
- Array.from(oldData),
2808
- updatePath,
2809
- value
2810
- );
2811
- return new Set(setAsArray);
2812
- }
2813
- if (Array.isArray(oldData)) {
2814
- const newData = [...oldData];
2815
- if (updatePath.length === 1) {
2816
- newData[updatePath[0]] = value;
2817
- return newData;
2818
- }
2819
- const [head, ...tail] = updatePath;
2820
- newData[head] = updateNestedDataByPath(newData[head], tail, value);
2821
- return newData;
2822
- }
2823
- if (oldData instanceof Object) {
2824
- const newData = { ...oldData };
2825
- if (updatePath.length === 1) {
2826
- newData[updatePath[0]] = value;
2827
- return newData;
2828
- }
2829
- const [head, ...tail] = updatePath;
2830
- newData[head] = updateNestedDataByPath(newData[head], tail, value);
2831
- return newData;
2832
- }
2833
- return oldData;
2834
- };
2835
- var deleteNestedDataByPath = (oldData, deletePath) => {
2836
- if (oldData instanceof Map) {
2837
- const newData = new Map(oldData);
2838
- if (deletePath.length === 1) {
2839
- newData.delete(deletePath[0]);
2840
- return newData;
2841
- }
2842
- const [head, ...tail] = deletePath;
2843
- newData.set(head, deleteNestedDataByPath(newData.get(head), tail));
2844
- return newData;
2845
- }
2846
- if (oldData instanceof Set) {
2847
- const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath);
2848
- return new Set(setAsArray);
2849
- }
2850
- if (Array.isArray(oldData)) {
2851
- const newData = [...oldData];
2852
- if (deletePath.length === 1) {
2853
- return newData.filter((_, idx) => idx.toString() !== deletePath[0]);
2854
- }
2855
- const [head, ...tail] = deletePath;
2856
- newData[head] = deleteNestedDataByPath(newData[head], tail);
2857
- return newData;
2858
- }
2859
- if (oldData instanceof Object) {
2860
- const newData = { ...oldData };
2861
- if (deletePath.length === 1) {
2862
- delete newData[deletePath[0]];
2863
- return newData;
2864
- }
2865
- const [head, ...tail] = deletePath;
2866
- newData[head] = deleteNestedDataByPath(newData[head], tail);
2867
- return newData;
2868
- }
2869
- return oldData;
2870
- };
2871
- var setupStyleSheet = (nonce, target) => {
2872
- if (!nonce)
2873
- return;
2874
- const styleExists = document.querySelector("#_goober") || target?.querySelector("#_goober");
2875
- if (styleExists)
2876
- return;
2877
- const styleTag = document.createElement("style");
2878
- const textNode = document.createTextNode("");
2879
- styleTag.appendChild(textNode);
2880
- styleTag.id = "_goober";
2881
- styleTag.setAttribute("nonce", nonce);
2882
- if (target) {
2883
- target.appendChild(styleTag);
2884
- } else {
2885
- document.head.appendChild(styleTag);
2886
- }
2887
- };
2888
-
2889
- export {
2890
- $TRACK,
2891
- createRoot,
2892
- createSignal,
2893
- createComputed,
2894
- createRenderEffect,
2895
- createEffect,
2896
- createMemo,
2897
- batch,
2898
- untrack,
2899
- on,
2900
- onMount,
2901
- onCleanup,
2902
- getOwner,
2903
- useTransition,
2904
- createContext,
2905
- useContext,
2906
- createComponent,
2907
- mergeProps,
2908
- splitProps,
2909
- lazy,
2910
- createUniqueId,
2911
- For,
2912
- Index,
2913
- Show,
2914
- Switch,
2915
- Match,
2916
- DEV,
2917
- render,
2918
- template,
2919
- delegateEvents,
2920
- clearDelegatedEvents,
2921
- setAttribute,
2922
- isServer,
2923
- Portal,
2924
- Dynamic,
2925
- stringify,
2926
- getQueryStatusLabel,
2927
- getSidedProp,
2928
- getQueryStatusColor,
2929
- getMutationStatusColor,
2930
- getQueryStatusColorByLabel,
2931
- displayValue,
2932
- sortFns,
2933
- mutationSortFns,
2934
- convertRemToPixels,
2935
- getPreferredColorScheme,
2936
- updateNestedDataByPath,
2937
- deleteNestedDataByPath,
2938
- setupStyleSheet
2939
- };