solid-js 1.9.5 → 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/dev.cjs +21 -10
  2. package/dist/dev.js +327 -557
  3. package/dist/server.js +81 -178
  4. package/dist/solid.cjs +21 -10
  5. package/dist/solid.js +283 -486
  6. package/h/dist/h.js +9 -40
  7. package/h/jsx-runtime/dist/jsx.js +1 -1
  8. package/h/jsx-runtime/types/index.d.ts +8 -11
  9. package/h/jsx-runtime/types/jsx.d.ts +2947 -1021
  10. package/h/types/hyperscript.d.ts +11 -11
  11. package/html/dist/html.cjs +2 -2
  12. package/html/dist/html.js +96 -221
  13. package/html/types/lit.d.ts +33 -52
  14. package/package.json +3 -3
  15. package/store/dist/dev.js +43 -123
  16. package/store/dist/server.js +8 -20
  17. package/store/dist/store.js +40 -114
  18. package/store/types/index.d.ts +7 -21
  19. package/store/types/modifiers.d.ts +3 -6
  20. package/store/types/mutable.d.ts +2 -5
  21. package/store/types/server.d.ts +5 -25
  22. package/store/types/store.d.ts +61 -218
  23. package/types/index.d.ts +11 -78
  24. package/types/jsx.d.ts +2091 -278
  25. package/types/reactive/array.d.ts +4 -12
  26. package/types/reactive/observable.d.ts +16 -22
  27. package/types/reactive/scheduler.d.ts +6 -9
  28. package/types/reactive/signal.d.ts +145 -236
  29. package/types/render/Suspense.d.ts +5 -5
  30. package/types/render/component.d.ts +37 -73
  31. package/types/render/flow.d.ts +31 -43
  32. package/types/render/hydration.d.ts +15 -15
  33. package/types/server/index.d.ts +2 -57
  34. package/types/server/reactive.d.ts +45 -76
  35. package/types/server/rendering.d.ts +98 -169
  36. package/universal/dist/dev.cjs +3 -1
  37. package/universal/dist/dev.js +15 -29
  38. package/universal/dist/universal.cjs +3 -1
  39. package/universal/dist/universal.js +15 -29
  40. package/universal/types/index.d.ts +1 -3
  41. package/universal/types/universal.d.ts +1 -0
  42. package/web/dist/dev.cjs +8 -5
  43. package/web/dist/dev.js +96 -643
  44. package/web/dist/server.cjs +9 -6
  45. package/web/dist/server.js +116 -646
  46. package/web/dist/web.cjs +8 -5
  47. package/web/dist/web.js +94 -631
  48. package/web/storage/dist/storage.js +3 -3
  49. package/web/types/core.d.ts +2 -10
  50. package/web/types/index.d.ts +11 -31
  51. package/web/types/server-mock.d.ts +32 -47
package/dist/dev.js CHANGED
@@ -52,11 +52,9 @@ function enqueue(taskQueue, task) {
52
52
  let m = 0;
53
53
  let n = taskQueue.length - 1;
54
54
  while (m <= n) {
55
- const k = (n + m) >> 1;
55
+ const k = n + m >> 1;
56
56
  const cmp = task.expirationTime - taskQueue[k].expirationTime;
57
- if (cmp > 0) m = k + 1;
58
- else if (cmp < 0) n = k - 1;
59
- else return k;
57
+ if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;
60
58
  }
61
59
  return m;
62
60
  }
@@ -183,25 +181,20 @@ function createRoot(fn, detachedOwner) {
183
181
  owner = Owner,
184
182
  unowned = fn.length === 0,
185
183
  current = detachedOwner === undefined ? owner : detachedOwner,
186
- root = unowned
187
- ? {
188
- owned: null,
189
- cleanups: null,
190
- context: null,
191
- owner: null
192
- }
193
- : {
194
- owned: null,
195
- cleanups: null,
196
- context: current ? current.context : null,
197
- owner: current
198
- },
199
- updateFn = unowned
200
- ? () =>
201
- fn(() => {
202
- throw new Error("Dispose method must be an explicit argument to createRoot function");
203
- })
204
- : () => fn(() => untrack(() => cleanNode(root)));
184
+ root = unowned ? {
185
+ owned: null,
186
+ cleanups: null,
187
+ context: null,
188
+ owner: null
189
+ } : {
190
+ owned: null,
191
+ cleanups: null,
192
+ context: current ? current.context : null,
193
+ owner: current
194
+ },
195
+ updateFn = unowned ? () => fn(() => {
196
+ throw new Error("Dispose method must be an explicit argument to createRoot function");
197
+ }) : () => fn(() => untrack(() => cleanNode(root)));
205
198
  DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);
206
199
  Owner = root;
207
200
  Listener = null;
@@ -231,26 +224,23 @@ function createSignal(value, options) {
231
224
  }
232
225
  const setter = value => {
233
226
  if (typeof value === "function") {
234
- if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);
235
- else value = value(s.value);
227
+ if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);else value = value(s.value);
236
228
  }
237
229
  return writeSignal(s, value);
238
230
  };
239
231
  return [readSignal.bind(s), setter];
240
232
  }
241
233
  function createComputed(fn, value, options) {
242
- const c = createComputation(fn, value, true, STALE, options);
243
- if (Scheduler && Transition && Transition.running) Updates.push(c);
244
- else updateComputation(c);
234
+ const c = createComputation(fn, value, true, STALE, options );
235
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
245
236
  }
246
237
  function createRenderEffect(fn, value, options) {
247
- const c = createComputation(fn, value, false, STALE, options);
248
- if (Scheduler && Transition && Transition.running) Updates.push(c);
249
- else updateComputation(c);
238
+ const c = createComputation(fn, value, false, STALE, options );
239
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
250
240
  }
251
241
  function createEffect(fn, value, options) {
252
242
  runEffects = runUserEffects;
253
- const c = createComputation(fn, value, false, STALE, options),
243
+ const c = createComputation(fn, value, false, STALE, options ),
254
244
  s = SuspenseContext && useContext(SuspenseContext);
255
245
  if (s) c.suspense = s;
256
246
  if (!options || !options.render) c.user = true;
@@ -258,16 +248,10 @@ function createEffect(fn, value, options) {
258
248
  }
259
249
  function createReaction(onInvalidate, options) {
260
250
  let fn;
261
- const c = createComputation(
262
- () => {
263
- fn ? fn() : untrack(onInvalidate);
264
- fn = undefined;
265
- },
266
- undefined,
267
- false,
268
- 0,
269
- options
270
- ),
251
+ const c = createComputation(() => {
252
+ fn ? fn() : untrack(onInvalidate);
253
+ fn = undefined;
254
+ }, undefined, false, 0, options ),
271
255
  s = SuspenseContext && useContext(SuspenseContext);
272
256
  if (s) c.suspense = s;
273
257
  c.user = true;
@@ -278,7 +262,7 @@ function createReaction(onInvalidate, options) {
278
262
  }
279
263
  function createMemo(fn, value, options) {
280
264
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
281
- const c = createComputation(fn, value, true, 0, options);
265
+ const c = createComputation(fn, value, true, 0, options );
282
266
  c.observers = null;
283
267
  c.observerSlots = null;
284
268
  c.comparator = options.equals || undefined;
@@ -320,19 +304,15 @@ function createResource(pSource, pFetcher, pOptions) {
320
304
  [state, setState] = createSignal(resolved ? "ready" : "unresolved");
321
305
  if (sharedConfig.context) {
322
306
  id = sharedConfig.getNextContextId();
323
- if (options.ssrLoadFrom === "initial") initP = options.initialValue;
324
- else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
307
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
325
308
  }
326
309
  function loadEnd(p, v, error, key) {
327
310
  if (pr === p) {
328
311
  pr = null;
329
312
  key !== undefined && (resolved = true);
330
- if ((p === initP || v === initP) && options.onHydrated)
331
- queueMicrotask(() =>
332
- options.onHydrated(key, {
333
- value: v
334
- })
335
- );
313
+ if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
314
+ value: v
315
+ }));
336
316
  initP = NO_INIT;
337
317
  if (Transition && p && loadedUnderTransition) {
338
318
  Transition.promises.delete(p);
@@ -363,8 +343,7 @@ function createResource(pSource, pFetcher, pOptions) {
363
343
  createComputed(() => {
364
344
  track();
365
345
  if (pr) {
366
- if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);
367
- else if (!contexts.has(c)) {
346
+ if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);else if (!contexts.has(c)) {
368
347
  c.increment();
369
348
  contexts.add(c);
370
349
  }
@@ -383,35 +362,36 @@ function createResource(pSource, pFetcher, pOptions) {
383
362
  return;
384
363
  }
385
364
  if (Transition && pr) Transition.promises.delete(pr);
386
- const p =
387
- initP !== NO_INIT
388
- ? initP
389
- : untrack(() =>
390
- fetcher(lookup, {
391
- value: value(),
392
- refetching
393
- })
394
- );
395
- if (!isPromise(p)) {
365
+ let error;
366
+ const p = initP !== NO_INIT ? initP : untrack(() => {
367
+ try {
368
+ return fetcher(lookup, {
369
+ value: value(),
370
+ refetching
371
+ });
372
+ } catch (fetcherError) {
373
+ error = fetcherError;
374
+ }
375
+ });
376
+ if (error !== undefined) {
377
+ loadEnd(pr, undefined, castError(error), lookup);
378
+ return;
379
+ } else if (!isPromise(p)) {
396
380
  loadEnd(pr, p, undefined, lookup);
397
381
  return p;
398
382
  }
399
383
  pr = p;
400
- if ("value" in p) {
401
- if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);
402
- else loadEnd(pr, undefined, castError(p.value), lookup);
384
+ if ("v" in p) {
385
+ if (p.s === 1) loadEnd(pr, p.v, undefined, lookup);else loadEnd(pr, undefined, castError(p.v), lookup);
403
386
  return p;
404
387
  }
405
388
  scheduled = true;
406
- queueMicrotask(() => (scheduled = false));
389
+ queueMicrotask(() => scheduled = false);
407
390
  runUpdates(() => {
408
391
  setState(resolved ? "refreshing" : "pending");
409
392
  trigger();
410
393
  }, false);
411
- return p.then(
412
- v => loadEnd(p, v, undefined, lookup),
413
- e => loadEnd(p, undefined, castError(e), lookup)
414
- );
394
+ return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
415
395
  }
416
396
  Object.defineProperties(read, {
417
397
  state: {
@@ -435,81 +415,51 @@ function createResource(pSource, pFetcher, pOptions) {
435
415
  }
436
416
  }
437
417
  });
438
- if (dynamic) createComputed(() => load(false));
439
- else load(false);
440
- return [
441
- read,
442
- {
443
- refetch: load,
444
- mutate: setValue
445
- }
446
- ];
418
+ let owner = Owner;
419
+ if (dynamic) createComputed(() => (owner = Owner, load(false)));else load(false);
420
+ return [read, {
421
+ refetch: info => runWithOwner(owner, () => load(info)),
422
+ mutate: setValue
423
+ }];
447
424
  }
448
425
  function createDeferred(source, options) {
449
426
  let t,
450
427
  timeout = options ? options.timeoutMs : undefined;
451
- const node = createComputation(
452
- () => {
453
- if (!t || !t.fn)
454
- t = requestCallback(
455
- () => setDeferred(() => node.value),
456
- timeout !== undefined
457
- ? {
458
- timeout
459
- }
460
- : undefined
461
- );
462
- return source();
463
- },
464
- undefined,
465
- true
466
- );
467
- const [deferred, setDeferred] = createSignal(
468
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
469
- options
470
- );
428
+ const node = createComputation(() => {
429
+ if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {
430
+ timeout
431
+ } : undefined);
432
+ return source();
433
+ }, undefined, true);
434
+ const [deferred, setDeferred] = createSignal(Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, options);
471
435
  updateComputation(node);
472
- setDeferred(() =>
473
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
474
- );
436
+ setDeferred(() => Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
475
437
  return deferred;
476
438
  }
477
439
  function createSelector(source, fn = equalFn, options) {
478
440
  const subs = new Map();
479
- const node = createComputation(
480
- p => {
481
- const v = source();
482
- for (const [key, val] of subs.entries())
483
- if (fn(key, v) !== fn(key, p)) {
484
- for (const c of val.values()) {
485
- c.state = STALE;
486
- if (c.pure) Updates.push(c);
487
- else Effects.push(c);
488
- }
489
- }
490
- return v;
491
- },
492
- undefined,
493
- true,
494
- STALE,
495
- options
496
- );
441
+ const node = createComputation(p => {
442
+ const v = source();
443
+ for (const [key, val] of subs.entries()) if (fn(key, v) !== fn(key, p)) {
444
+ for (const c of val.values()) {
445
+ c.state = STALE;
446
+ if (c.pure) Updates.push(c);else Effects.push(c);
447
+ }
448
+ }
449
+ return v;
450
+ }, undefined, true, STALE, options );
497
451
  updateComputation(node);
498
452
  return key => {
499
453
  const listener = Listener;
500
454
  if (listener) {
501
455
  let l;
502
- if ((l = subs.get(key))) l.add(listener);
503
- else subs.set(key, (l = new Set([listener])));
456
+ if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
504
457
  onCleanup(() => {
505
458
  l.delete(listener);
506
459
  !l.size && subs.delete(key);
507
460
  });
508
461
  }
509
- return fn(
510
- key,
511
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
512
- );
462
+ return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
513
463
  };
514
464
  }
515
465
  function batch(fn) {
@@ -549,10 +499,7 @@ function onMount(fn) {
549
499
  createEffect(() => untrack(fn));
550
500
  }
551
501
  function onCleanup(fn) {
552
- if (Owner === null)
553
- console.warn("cleanups created outside a `createRoot` or `render` will never be run");
554
- else if (Owner.cleanups === null) Owner.cleanups = [fn];
555
- else Owner.cleanups.push(fn);
502
+ if (Owner === null) console.warn("cleanups created outside a `createRoot` or `render` will never be run");else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);
556
503
  return fn;
557
504
  }
558
505
  function catchError(fn, handler) {
@@ -606,17 +553,15 @@ function startTransition(fn) {
606
553
  Owner = o;
607
554
  let t;
608
555
  if (Scheduler || SuspenseContext) {
609
- t =
610
- Transition ||
611
- (Transition = {
612
- sources: new Set(),
613
- effects: [],
614
- promises: new Set(),
615
- disposed: new Set(),
616
- queue: new Set(),
617
- running: true
618
- });
619
- t.done || (t.done = new Promise(res => (t.resolve = res)));
556
+ t = Transition || (Transition = {
557
+ sources: new Set(),
558
+ effects: [],
559
+ promises: new Set(),
560
+ disposed: new Set(),
561
+ queue: new Set(),
562
+ running: true
563
+ });
564
+ t.done || (t.done = new Promise(res => t.resolve = res));
620
565
  t.running = true;
621
566
  }
622
567
  runUpdates(fn, false);
@@ -624,7 +569,7 @@ function startTransition(fn) {
624
569
  return t ? t.done : undefined;
625
570
  });
626
571
  }
627
- const [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);
572
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
628
573
  function useTransition() {
629
574
  return [transPending, startTransition];
630
575
  }
@@ -633,18 +578,12 @@ function resumeEffects(e) {
633
578
  e.length = 0;
634
579
  }
635
580
  function devComponent(Comp, props) {
636
- const c = createComputation(
637
- () =>
638
- untrack(() => {
639
- Object.assign(Comp, {
640
- [$DEVCOMP]: true
641
- });
642
- return Comp(props);
643
- }),
644
- undefined,
645
- true,
646
- 0
647
- );
581
+ const c = createComputation(() => untrack(() => {
582
+ Object.assign(Comp, {
583
+ [$DEVCOMP]: true
584
+ });
585
+ return Comp(props);
586
+ }), undefined, true, 0);
648
587
  c.props = props;
649
588
  c.observers = null;
650
589
  c.observerSlots = null;
@@ -655,8 +594,7 @@ function devComponent(Comp, props) {
655
594
  }
656
595
  function registerGraph(value) {
657
596
  if (Owner) {
658
- if (Owner.sourceMap) Owner.sourceMap.push(value);
659
- else Owner.sourceMap = [value];
597
+ if (Owner.sourceMap) Owner.sourceMap.push(value);else Owner.sourceMap = [value];
660
598
  value.graph = Owner;
661
599
  }
662
600
  if (DevHooks.afterRegisterGraph) DevHooks.afterRegisterGraph(value);
@@ -671,15 +609,13 @@ function createContext(defaultValue, options) {
671
609
  }
672
610
  function useContext(context) {
673
611
  let value;
674
- return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined
675
- ? value
676
- : context.defaultValue;
612
+ return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined ? value : context.defaultValue;
677
613
  }
678
614
  function children(fn) {
679
615
  const children = createMemo(fn);
680
616
  const memo = createMemo(() => resolveChildren(children()), undefined, {
681
617
  name: "children"
682
- });
618
+ }) ;
683
619
  memo.toArray = () => {
684
620
  const c = memo();
685
621
  return Array.isArray(c) ? c : c != null ? [c] : [];
@@ -692,7 +628,10 @@ function getSuspenseContext() {
692
628
  }
693
629
  function enableExternalSource(factory, untrack = fn => fn()) {
694
630
  if (ExternalSourceConfig) {
695
- const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;
631
+ const {
632
+ factory: oldFactory,
633
+ untrack: oldUntrack
634
+ } = ExternalSourceConfig;
696
635
  ExternalSourceConfig = {
697
636
  factory: (fn, trigger) => {
698
637
  const oldSource = oldFactory(fn, trigger);
@@ -717,8 +656,7 @@ function enableExternalSource(factory, untrack = fn => fn()) {
717
656
  function readSignal() {
718
657
  const runningTransition = Transition && Transition.running;
719
658
  if (this.sources && (runningTransition ? this.tState : this.state)) {
720
- if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
721
- else {
659
+ if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);else {
722
660
  const updates = Updates;
723
661
  Updates = null;
724
662
  runUpdates(() => lookUpstream(this), false);
@@ -746,12 +684,11 @@ function readSignal() {
746
684
  return this.value;
747
685
  }
748
686
  function writeSignal(node, value, isComp) {
749
- let current =
750
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
687
+ let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
751
688
  if (!node.comparator || !node.comparator(current, value)) {
752
689
  if (Transition) {
753
690
  const TransitionRunning = Transition.running;
754
- if (TransitionRunning || (!isComp && Transition.sources.has(node))) {
691
+ if (TransitionRunning || !isComp && Transition.sources.has(node)) {
755
692
  Transition.sources.add(node);
756
693
  node.tValue = value;
757
694
  }
@@ -764,12 +701,10 @@ function writeSignal(node, value, isComp) {
764
701
  const TransitionRunning = Transition && Transition.running;
765
702
  if (TransitionRunning && Transition.disposed.has(o)) continue;
766
703
  if (TransitionRunning ? !o.tState : !o.state) {
767
- if (o.pure) Updates.push(o);
768
- else Effects.push(o);
704
+ if (o.pure) Updates.push(o);else Effects.push(o);
769
705
  if (o.observers) markDownstream(o);
770
706
  }
771
- if (!TransitionRunning) o.state = STALE;
772
- else o.tState = STALE;
707
+ if (!TransitionRunning) o.state = STALE;else o.tState = STALE;
773
708
  }
774
709
  if (Updates.length > 10e5) {
775
710
  Updates = [];
@@ -785,11 +720,7 @@ function updateComputation(node) {
785
720
  if (!node.fn) return;
786
721
  cleanNode(node);
787
722
  const time = ExecCount;
788
- runComputation(
789
- node,
790
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
791
- time
792
- );
723
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
793
724
  if (Transition && !Transition.running && Transition.sources.has(node)) {
794
725
  queueMicrotask(() => {
795
726
  runUpdates(() => {
@@ -854,15 +785,11 @@ function createComputation(fn, init, pure, state = STALE, options) {
854
785
  c.state = 0;
855
786
  c.tState = state;
856
787
  }
857
- if (Owner === null)
858
- console.warn("computations created outside a `createRoot` or `render` will never be disposed");
859
- else if (Owner !== UNOWNED) {
788
+ if (Owner === null) console.warn("computations created outside a `createRoot` or `render` will never be disposed");else if (Owner !== UNOWNED) {
860
789
  if (Transition && Transition.running && Owner.pure) {
861
- if (!Owner.tOwned) Owner.tOwned = [c];
862
- else Owner.tOwned.push(c);
790
+ if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);
863
791
  } else {
864
- if (!Owner.owned) Owner.owned = [c];
865
- else Owner.owned.push(c);
792
+ if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);
866
793
  }
867
794
  }
868
795
  if (options && options.name) c.name = options.name;
@@ -915,8 +842,7 @@ function runUpdates(fn, init) {
915
842
  if (Updates) return fn();
916
843
  let wait = false;
917
844
  if (!init) Updates = [];
918
- if (Effects) wait = true;
919
- else Effects = [];
845
+ if (Effects) wait = true;else Effects = [];
920
846
  ExecCount++;
921
847
  try {
922
848
  const res = fn();
@@ -930,8 +856,7 @@ function runUpdates(fn, init) {
930
856
  }
931
857
  function completeUpdates(wait) {
932
858
  if (Updates) {
933
- if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
934
- else runQueue(Updates);
859
+ if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);
935
860
  Updates = null;
936
861
  }
937
862
  if (wait) return;
@@ -971,8 +896,7 @@ function completeUpdates(wait) {
971
896
  }
972
897
  const e = Effects;
973
898
  Effects = null;
974
- if (e.length) runUpdates(() => runEffects(e), false);
975
- else DevHooks.afterUpdate && DevHooks.afterUpdate();
899
+ if (e.length) runUpdates(() => runEffects(e), false);else DevHooks.afterUpdate && DevHooks.afterUpdate();
976
900
  if (res) res();
977
901
  }
978
902
  function runQueue(queue) {
@@ -1000,8 +924,7 @@ function runUserEffects(queue) {
1000
924
  userLength = 0;
1001
925
  for (i = 0; i < queue.length; i++) {
1002
926
  const e = queue[i];
1003
- if (!e.user) runTop(e);
1004
- else queue[userLength++] = e;
927
+ if (!e.user) runTop(e);else queue[userLength++] = e;
1005
928
  }
1006
929
  if (sharedConfig.context) {
1007
930
  if (sharedConfig.count) {
@@ -1020,15 +943,13 @@ function runUserEffects(queue) {
1020
943
  }
1021
944
  function lookUpstream(node, ignore) {
1022
945
  const runningTransition = Transition && Transition.running;
1023
- if (runningTransition) node.tState = 0;
1024
- else node.state = 0;
946
+ if (runningTransition) node.tState = 0;else node.state = 0;
1025
947
  for (let i = 0; i < node.sources.length; i += 1) {
1026
948
  const source = node.sources[i];
1027
949
  if (source.sources) {
1028
950
  const state = runningTransition ? source.tState : source.state;
1029
951
  if (state === STALE) {
1030
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
1031
- runTop(source);
952
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
1032
953
  } else if (state === PENDING) lookUpstream(source, ignore);
1033
954
  }
1034
955
  }
@@ -1038,10 +959,8 @@ function markDownstream(node) {
1038
959
  for (let i = 0; i < node.observers.length; i += 1) {
1039
960
  const o = node.observers[i];
1040
961
  if (runningTransition ? !o.tState : !o.state) {
1041
- if (runningTransition) o.tState = PENDING;
1042
- else o.state = PENDING;
1043
- if (o.pure) Updates.push(o);
1044
- else Effects.push(o);
962
+ if (runningTransition) o.tState = PENDING;else o.state = PENDING;
963
+ if (o.pure) Updates.push(o);else Effects.push(o);
1045
964
  o.observers && markDownstream(o);
1046
965
  }
1047
966
  }
@@ -1078,8 +997,7 @@ function cleanNode(node) {
1078
997
  for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1079
998
  node.cleanups = null;
1080
999
  }
1081
- if (Transition && Transition.running) node.tState = 0;
1082
- else node.state = 0;
1000
+ if (Transition && Transition.running) node.tState = 0;else node.state = 0;
1083
1001
  delete node.sourceMap;
1084
1002
  }
1085
1003
  function reset(node, top) {
@@ -1101,21 +1019,19 @@ function runErrors(err, fns, owner) {
1101
1019
  try {
1102
1020
  for (const f of fns) f(err);
1103
1021
  } catch (e) {
1104
- handleError(e, (owner && owner.owner) || null);
1022
+ handleError(e, owner && owner.owner || null);
1105
1023
  }
1106
1024
  }
1107
1025
  function handleError(err, owner = Owner) {
1108
1026
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
1109
1027
  const error = castError(err);
1110
1028
  if (!fns) throw error;
1111
- if (Effects)
1112
- Effects.push({
1113
- fn() {
1114
- runErrors(error, fns, owner);
1115
- },
1116
- state: STALE
1117
- });
1118
- else runErrors(error, fns, owner);
1029
+ if (Effects) Effects.push({
1030
+ fn() {
1031
+ runErrors(error, fns, owner);
1032
+ },
1033
+ state: STALE
1034
+ });else runErrors(error, fns, owner);
1119
1035
  }
1120
1036
  function resolveChildren(children) {
1121
1037
  if (typeof children === "function" && !children.length) return resolveChildren(children());
@@ -1132,26 +1048,19 @@ function resolveChildren(children) {
1132
1048
  function createProvider(id, options) {
1133
1049
  return function provider(props) {
1134
1050
  let res;
1135
- createRenderEffect(
1136
- () =>
1137
- (res = untrack(() => {
1138
- Owner.context = {
1139
- ...Owner.context,
1140
- [id]: props.value
1141
- };
1142
- return children(() => props.children);
1143
- })),
1144
- undefined,
1145
- options
1146
- );
1051
+ createRenderEffect(() => res = untrack(() => {
1052
+ Owner.context = {
1053
+ ...Owner.context,
1054
+ [id]: props.value
1055
+ };
1056
+ return children(() => props.children);
1057
+ }), undefined, options);
1147
1058
  return res;
1148
1059
  };
1149
1060
  }
1150
1061
  function onError(fn) {
1151
1062
  ERROR || (ERROR = Symbol("error"));
1152
- if (Owner === null)
1153
- console.warn("error handlers created outside a `createRoot` or `render` will never be run");
1154
- else if (Owner.context === null || !Owner.context[ERROR]) {
1063
+ if (Owner === null) console.warn("error handlers created outside a `createRoot` or `render` will never be run");else if (Owner.context === null || !Owner.context[ERROR]) {
1155
1064
  Owner.context = {
1156
1065
  ...Owner.context,
1157
1066
  [ERROR]: [fn]
@@ -1180,8 +1089,7 @@ function observable(input) {
1180
1089
  if (!(observer instanceof Object) || observer == null) {
1181
1090
  throw new TypeError("Expected the observer to be an object.");
1182
1091
  }
1183
- const handler =
1184
- typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1092
+ const handler = typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1185
1093
  if (!handler) {
1186
1094
  return {
1187
1095
  unsubscribe() {}
@@ -1212,7 +1120,7 @@ function from(producer, initalValue = undefined) {
1212
1120
  });
1213
1121
  if ("subscribe" in producer) {
1214
1122
  const unsub = producer.subscribe(v => set(() => v));
1215
- onCleanup(() => ("unsubscribe" in unsub ? unsub.unsubscribe() : unsub()));
1123
+ onCleanup(() => "unsubscribe" in unsub ? unsub.unsubscribe() : unsub());
1216
1124
  } else {
1217
1125
  const clean = producer(set);
1218
1126
  onCleanup(clean);
@@ -1256,7 +1164,8 @@ function mapArray(list, mapFn, options = {}) {
1256
1164
  });
1257
1165
  len = 1;
1258
1166
  }
1259
- } else if (len === 0) {
1167
+ }
1168
+ else if (len === 0) {
1260
1169
  mapped = new Array(newLen);
1261
1170
  for (j = 0; j < newLen; j++) {
1262
1171
  items[j] = newItems[j];
@@ -1267,16 +1176,8 @@ function mapArray(list, mapFn, options = {}) {
1267
1176
  temp = new Array(newLen);
1268
1177
  tempdisposers = new Array(newLen);
1269
1178
  indexes && (tempIndexes = new Array(newLen));
1270
- for (
1271
- start = 0, end = Math.min(len, newLen);
1272
- start < end && items[start] === newItems[start];
1273
- start++
1274
- );
1275
- for (
1276
- end = len - 1, newEnd = newLen - 1;
1277
- end >= start && newEnd >= start && items[end] === newItems[newEnd];
1278
- end--, newEnd--
1279
- ) {
1179
+ for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);
1180
+ for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
1280
1181
  temp[newEnd] = mapped[end];
1281
1182
  tempdisposers[newEnd] = disposers[end];
1282
1183
  indexes && (tempIndexes[newEnd] = indexes[end]);
@@ -1310,7 +1211,7 @@ function mapArray(list, mapFn, options = {}) {
1310
1211
  }
1311
1212
  } else mapped[j] = createRoot(mapper);
1312
1213
  }
1313
- mapped = mapped.slice(0, (len = newLen));
1214
+ mapped = mapped.slice(0, len = newLen);
1314
1215
  items = newItems.slice(0);
1315
1216
  }
1316
1217
  return mapped;
@@ -1320,7 +1221,7 @@ function mapArray(list, mapFn, options = {}) {
1320
1221
  if (indexes) {
1321
1222
  const [s, set] = createSignal(j, {
1322
1223
  name: "index"
1323
- });
1224
+ }) ;
1324
1225
  indexes[j] = set;
1325
1226
  return mapFn(newItems[j], s);
1326
1227
  }
@@ -1379,13 +1280,13 @@ function indexArray(list, mapFn, options = {}) {
1379
1280
  }
1380
1281
  len = signals.length = disposers.length = newLen;
1381
1282
  items = newItems.slice(0);
1382
- return (mapped = mapped.slice(0, len));
1283
+ return mapped = mapped.slice(0, len);
1383
1284
  });
1384
1285
  function mapper(disposer) {
1385
1286
  disposers[i] = disposer;
1386
1287
  const [s, set] = createSignal(newItems[i], {
1387
1288
  name: "value"
1388
- });
1289
+ }) ;
1389
1290
  signals[i] = set;
1390
1291
  return mapFn(s, i);
1391
1292
  }
@@ -1401,7 +1302,7 @@ function createComponent(Comp, props) {
1401
1302
  if (sharedConfig.context) {
1402
1303
  const c = sharedConfig.context;
1403
1304
  setHydrateContext(nextHydrateContext());
1404
- const r = devComponent(Comp, props || {});
1305
+ const r = devComponent(Comp, props || {}) ;
1405
1306
  setHydrateContext(c);
1406
1307
  return r;
1407
1308
  }
@@ -1450,33 +1351,29 @@ function mergeProps(...sources) {
1450
1351
  let proxy = false;
1451
1352
  for (let i = 0; i < sources.length; i++) {
1452
1353
  const s = sources[i];
1453
- proxy = proxy || (!!s && $PROXY in s);
1454
- sources[i] = typeof s === "function" ? ((proxy = true), createMemo(s)) : s;
1354
+ proxy = proxy || !!s && $PROXY in s;
1355
+ sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
1455
1356
  }
1456
1357
  if (SUPPORTS_PROXY && proxy) {
1457
- return new Proxy(
1458
- {
1459
- get(property) {
1460
- for (let i = sources.length - 1; i >= 0; i--) {
1461
- const v = resolveSource(sources[i])[property];
1462
- if (v !== undefined) return v;
1463
- }
1464
- },
1465
- has(property) {
1466
- for (let i = sources.length - 1; i >= 0; i--) {
1467
- if (property in resolveSource(sources[i])) return true;
1468
- }
1469
- return false;
1470
- },
1471
- keys() {
1472
- const keys = [];
1473
- for (let i = 0; i < sources.length; i++)
1474
- keys.push(...Object.keys(resolveSource(sources[i])));
1475
- return [...new Set(keys)];
1358
+ return new Proxy({
1359
+ get(property) {
1360
+ for (let i = sources.length - 1; i >= 0; i--) {
1361
+ const v = resolveSource(sources[i])[property];
1362
+ if (v !== undefined) return v;
1363
+ }
1364
+ },
1365
+ has(property) {
1366
+ for (let i = sources.length - 1; i >= 0; i--) {
1367
+ if (property in resolveSource(sources[i])) return true;
1476
1368
  }
1369
+ return false;
1477
1370
  },
1478
- propTraps
1479
- );
1371
+ keys() {
1372
+ const keys = [];
1373
+ for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));
1374
+ return [...new Set(keys)];
1375
+ }
1376
+ }, propTraps);
1480
1377
  }
1481
1378
  const sourcesMap = {};
1482
1379
  const defined = Object.create(null);
@@ -1489,20 +1386,15 @@ function mergeProps(...sources) {
1489
1386
  if (key === "__proto__" || key === "constructor") continue;
1490
1387
  const desc = Object.getOwnPropertyDescriptor(source, key);
1491
1388
  if (!defined[key]) {
1492
- defined[key] = desc.get
1493
- ? {
1494
- enumerable: true,
1495
- configurable: true,
1496
- get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))
1497
- }
1498
- : desc.value !== undefined
1499
- ? desc
1500
- : undefined;
1389
+ defined[key] = desc.get ? {
1390
+ enumerable: true,
1391
+ configurable: true,
1392
+ get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
1393
+ } : desc.value !== undefined ? desc : undefined;
1501
1394
  } else {
1502
1395
  const sources = sourcesMap[key];
1503
1396
  if (sources) {
1504
- if (desc.get) sources.push(desc.get.bind(source));
1505
- else if (desc.value !== undefined) sources.push(() => desc.value);
1397
+ if (desc.get) sources.push(desc.get.bind(source));else if (desc.value !== undefined) sources.push(() => desc.value);
1506
1398
  }
1507
1399
  }
1508
1400
  }
@@ -1512,8 +1404,7 @@ function mergeProps(...sources) {
1512
1404
  for (let i = definedKeys.length - 1; i >= 0; i--) {
1513
1405
  const key = definedKeys[i],
1514
1406
  desc = defined[key];
1515
- if (desc && desc.get) Object.defineProperty(target, key, desc);
1516
- else target[key] = desc ? desc.value : undefined;
1407
+ if (desc && desc.get) Object.defineProperty(target, key, desc);else target[key] = desc ? desc.value : undefined;
1517
1408
  }
1518
1409
  return target;
1519
1410
  }
@@ -1521,60 +1412,47 @@ function splitProps(props, ...keys) {
1521
1412
  if (SUPPORTS_PROXY && $PROXY in props) {
1522
1413
  const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
1523
1414
  const res = keys.map(k => {
1524
- return new Proxy(
1525
- {
1526
- get(property) {
1527
- return k.includes(property) ? props[property] : undefined;
1528
- },
1529
- has(property) {
1530
- return k.includes(property) && property in props;
1531
- },
1532
- keys() {
1533
- return k.filter(property => property in props);
1534
- }
1415
+ return new Proxy({
1416
+ get(property) {
1417
+ return k.includes(property) ? props[property] : undefined;
1535
1418
  },
1536
- propTraps
1537
- );
1538
- });
1539
- res.push(
1540
- new Proxy(
1541
- {
1542
- get(property) {
1543
- return blocked.has(property) ? undefined : props[property];
1544
- },
1545
- has(property) {
1546
- return blocked.has(property) ? false : property in props;
1547
- },
1548
- keys() {
1549
- return Object.keys(props).filter(k => !blocked.has(k));
1550
- }
1419
+ has(property) {
1420
+ return k.includes(property) && property in props;
1551
1421
  },
1552
- propTraps
1553
- )
1554
- );
1422
+ keys() {
1423
+ return k.filter(property => property in props);
1424
+ }
1425
+ }, propTraps);
1426
+ });
1427
+ res.push(new Proxy({
1428
+ get(property) {
1429
+ return blocked.has(property) ? undefined : props[property];
1430
+ },
1431
+ has(property) {
1432
+ return blocked.has(property) ? false : property in props;
1433
+ },
1434
+ keys() {
1435
+ return Object.keys(props).filter(k => !blocked.has(k));
1436
+ }
1437
+ }, propTraps));
1555
1438
  return res;
1556
1439
  }
1557
1440
  const otherObject = {};
1558
1441
  const objects = keys.map(() => ({}));
1559
1442
  for (const propName of Object.getOwnPropertyNames(props)) {
1560
1443
  const desc = Object.getOwnPropertyDescriptor(props, propName);
1561
- const isDefaultDesc =
1562
- !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1444
+ const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1563
1445
  let blocked = false;
1564
1446
  let objectIndex = 0;
1565
1447
  for (const k of keys) {
1566
1448
  if (k.includes(propName)) {
1567
1449
  blocked = true;
1568
- isDefaultDesc
1569
- ? (objects[objectIndex][propName] = desc.value)
1570
- : Object.defineProperty(objects[objectIndex], propName, desc);
1450
+ isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
1571
1451
  }
1572
1452
  ++objectIndex;
1573
1453
  }
1574
1454
  if (!blocked) {
1575
- isDefaultDesc
1576
- ? (otherObject[propName] = desc.value)
1577
- : Object.defineProperty(otherObject, propName, desc);
1455
+ isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
1578
1456
  }
1579
1457
  }
1580
1458
  return [...objects, otherObject];
@@ -1600,24 +1478,19 @@ function lazy(fn) {
1600
1478
  comp = s;
1601
1479
  }
1602
1480
  let Comp;
1603
- return createMemo(() =>
1604
- (Comp = comp())
1605
- ? untrack(() => {
1606
- if (IS_DEV)
1607
- Object.assign(Comp, {
1608
- [$DEVCOMP]: true
1609
- });
1610
- if (!ctx || sharedConfig.done) return Comp(props);
1611
- const c = sharedConfig.context;
1612
- setHydrateContext(ctx);
1613
- const r = Comp(props);
1614
- setHydrateContext(c);
1615
- return r;
1616
- })
1617
- : ""
1618
- );
1481
+ return createMemo(() => (Comp = comp()) ? untrack(() => {
1482
+ if (IS_DEV) Object.assign(Comp, {
1483
+ [$DEVCOMP]: true
1484
+ });
1485
+ if (!ctx || sharedConfig.done) return Comp(props);
1486
+ const c = sharedConfig.context;
1487
+ setHydrateContext(ctx);
1488
+ const r = Comp(props);
1489
+ setHydrateContext(c);
1490
+ return r;
1491
+ }) : "");
1619
1492
  };
1620
- wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);
1493
+ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);
1621
1494
  return wrap;
1622
1495
  }
1623
1496
  let counter = 0;
@@ -1626,69 +1499,46 @@ function createUniqueId() {
1626
1499
  return ctx ? sharedConfig.getNextContextId() : `cl-${counter++}`;
1627
1500
  }
1628
1501
 
1629
- const narrowedError = name =>
1630
- `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.`;
1502
+ const narrowedError = name => `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.` ;
1631
1503
  function For(props) {
1632
1504
  const fallback = "fallback" in props && {
1633
1505
  fallback: () => props.fallback
1634
1506
  };
1635
- return createMemo(
1636
- mapArray(() => props.each, props.children, fallback || undefined),
1637
- undefined,
1638
- {
1639
- name: "value"
1640
- }
1641
- );
1507
+ return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
1508
+ name: "value"
1509
+ }) ;
1642
1510
  }
1643
1511
  function Index(props) {
1644
1512
  const fallback = "fallback" in props && {
1645
1513
  fallback: () => props.fallback
1646
1514
  };
1647
- return createMemo(
1648
- indexArray(() => props.each, props.children, fallback || undefined),
1649
- undefined,
1650
- {
1651
- name: "value"
1652
- }
1653
- );
1515
+ return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
1516
+ name: "value"
1517
+ }) ;
1654
1518
  }
1655
1519
  function Show(props) {
1656
1520
  const keyed = props.keyed;
1657
1521
  const conditionValue = createMemo(() => props.when, undefined, {
1658
1522
  name: "condition value"
1659
- });
1660
- const condition = keyed
1661
- ? conditionValue
1662
- : createMemo(conditionValue, undefined, {
1663
- equals: (a, b) => !a === !b,
1664
- name: "condition"
1665
- });
1666
- return createMemo(
1667
- () => {
1668
- const c = condition();
1669
- if (c) {
1670
- const child = props.children;
1671
- const fn = typeof child === "function" && child.length > 0;
1672
- return fn
1673
- ? untrack(() =>
1674
- child(
1675
- keyed
1676
- ? c
1677
- : () => {
1678
- if (!untrack(condition)) throw narrowedError("Show");
1679
- return conditionValue();
1680
- }
1681
- )
1682
- )
1683
- : child;
1684
- }
1685
- return props.fallback;
1686
- },
1687
- undefined,
1688
- {
1689
- name: "value"
1523
+ } );
1524
+ const condition = keyed ? conditionValue : createMemo(conditionValue, undefined, {
1525
+ equals: (a, b) => !a === !b,
1526
+ name: "condition"
1527
+ } );
1528
+ return createMemo(() => {
1529
+ const c = condition();
1530
+ if (c) {
1531
+ const child = props.children;
1532
+ const fn = typeof child === "function" && child.length > 0;
1533
+ return fn ? untrack(() => child(keyed ? c : () => {
1534
+ if (!untrack(condition)) throw narrowedError("Show");
1535
+ return conditionValue();
1536
+ })) : child;
1690
1537
  }
1691
- );
1538
+ return props.fallback;
1539
+ }, undefined, {
1540
+ name: "value"
1541
+ } );
1692
1542
  }
1693
1543
  function Switch(props) {
1694
1544
  const chs = children(() => props.children);
@@ -1700,44 +1550,30 @@ function Switch(props) {
1700
1550
  const index = i;
1701
1551
  const mp = mps[i];
1702
1552
  const prevFunc = func;
1703
- const conditionValue = createMemo(() => (prevFunc() ? undefined : mp.when), undefined, {
1553
+ const conditionValue = createMemo(() => prevFunc() ? undefined : mp.when, undefined, {
1704
1554
  name: "condition value"
1705
- });
1706
- const condition = mp.keyed
1707
- ? conditionValue
1708
- : createMemo(conditionValue, undefined, {
1709
- equals: (a, b) => !a === !b,
1710
- name: "condition"
1711
- });
1555
+ } );
1556
+ const condition = mp.keyed ? conditionValue : createMemo(conditionValue, undefined, {
1557
+ equals: (a, b) => !a === !b,
1558
+ name: "condition"
1559
+ } );
1712
1560
  func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);
1713
1561
  }
1714
1562
  return func;
1715
1563
  });
1716
- return createMemo(
1717
- () => {
1718
- const sel = switchFunc()();
1719
- if (!sel) return props.fallback;
1720
- const [index, conditionValue, mp] = sel;
1721
- const child = mp.children;
1722
- const fn = typeof child === "function" && child.length > 0;
1723
- return fn
1724
- ? untrack(() =>
1725
- child(
1726
- mp.keyed
1727
- ? conditionValue()
1728
- : () => {
1729
- if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
1730
- return conditionValue();
1731
- }
1732
- )
1733
- )
1734
- : child;
1735
- },
1736
- undefined,
1737
- {
1738
- name: "eval conditions"
1739
- }
1740
- );
1564
+ return createMemo(() => {
1565
+ const sel = switchFunc()();
1566
+ if (!sel) return props.fallback;
1567
+ const [index, conditionValue, mp] = sel;
1568
+ const child = mp.children;
1569
+ const fn = typeof child === "function" && child.length > 0;
1570
+ return fn ? untrack(() => child(mp.keyed ? conditionValue() : () => {
1571
+ if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
1572
+ return conditionValue();
1573
+ })) : child;
1574
+ }, undefined, {
1575
+ name: "eval conditions"
1576
+ } );
1741
1577
  }
1742
1578
  function Match(props) {
1743
1579
  return props;
@@ -1748,34 +1584,28 @@ function resetErrorBoundaries() {
1748
1584
  }
1749
1585
  function ErrorBoundary(props) {
1750
1586
  let err;
1751
- if (sharedConfig.context && sharedConfig.load)
1752
- err = sharedConfig.load(sharedConfig.getContextId());
1587
+ if (sharedConfig.context && sharedConfig.load) err = sharedConfig.load(sharedConfig.getContextId());
1753
1588
  const [errored, setErrored] = createSignal(err, {
1754
1589
  name: "errored"
1755
- });
1590
+ } );
1756
1591
  Errors || (Errors = new Set());
1757
1592
  Errors.add(setErrored);
1758
1593
  onCleanup(() => Errors.delete(setErrored));
1759
- return createMemo(
1760
- () => {
1761
- let e;
1762
- if ((e = errored())) {
1763
- const f = props.fallback;
1764
- if (typeof f !== "function" || f.length == 0) console.error(e);
1765
- return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1766
- }
1767
- return catchError(() => props.children, setErrored);
1768
- },
1769
- undefined,
1770
- {
1771
- name: "value"
1594
+ return createMemo(() => {
1595
+ let e;
1596
+ if (e = errored()) {
1597
+ const f = props.fallback;
1598
+ if ((typeof f !== "function" || f.length == 0)) console.error(e);
1599
+ return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1772
1600
  }
1773
- );
1601
+ return catchError(() => props.children, setErrored);
1602
+ }, undefined, {
1603
+ name: "value"
1604
+ } );
1774
1605
  }
1775
1606
 
1776
- const suspenseListEquals = (a, b) =>
1777
- a.showContent === b.showContent && a.showFallback === b.showFallback;
1778
- const SuspenseListContext = /* #__PURE__ */ createContext();
1607
+ const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
1608
+ const SuspenseListContext = /* #__PURE__ */createContext();
1779
1609
  function SuspenseList(props) {
1780
1610
  let [wrapper, setWrapper] = createSignal(() => ({
1781
1611
  inFallback: false
@@ -1786,51 +1616,51 @@ function SuspenseList(props) {
1786
1616
  if (listContext) {
1787
1617
  show = listContext.register(createMemo(() => wrapper()().inFallback));
1788
1618
  }
1789
- const resolved = createMemo(
1790
- prev => {
1791
- const reveal = props.revealOrder,
1792
- tail = props.tail,
1793
- { showContent = true, showFallback = true } = show ? show() : {},
1794
- reg = registry(),
1795
- reverse = reveal === "backwards";
1796
- if (reveal === "together") {
1797
- const all = reg.every(inFallback => !inFallback());
1798
- const res = reg.map(() => ({
1799
- showContent: all && showContent,
1619
+ const resolved = createMemo(prev => {
1620
+ const reveal = props.revealOrder,
1621
+ tail = props.tail,
1622
+ {
1623
+ showContent = true,
1624
+ showFallback = true
1625
+ } = show ? show() : {},
1626
+ reg = registry(),
1627
+ reverse = reveal === "backwards";
1628
+ if (reveal === "together") {
1629
+ const all = reg.every(inFallback => !inFallback());
1630
+ const res = reg.map(() => ({
1631
+ showContent: all && showContent,
1632
+ showFallback
1633
+ }));
1634
+ res.inFallback = !all;
1635
+ return res;
1636
+ }
1637
+ let stop = false;
1638
+ let inFallback = prev.inFallback;
1639
+ const res = [];
1640
+ for (let i = 0, len = reg.length; i < len; i++) {
1641
+ const n = reverse ? len - i - 1 : i,
1642
+ s = reg[n]();
1643
+ if (!stop && !s) {
1644
+ res[n] = {
1645
+ showContent,
1800
1646
  showFallback
1801
- }));
1802
- res.inFallback = !all;
1803
- return res;
1804
- }
1805
- let stop = false;
1806
- let inFallback = prev.inFallback;
1807
- const res = [];
1808
- for (let i = 0, len = reg.length; i < len; i++) {
1809
- const n = reverse ? len - i - 1 : i,
1810
- s = reg[n]();
1811
- if (!stop && !s) {
1812
- res[n] = {
1813
- showContent,
1814
- showFallback
1815
- };
1816
- } else {
1817
- const next = !stop;
1818
- if (next) inFallback = true;
1819
- res[n] = {
1820
- showContent: next,
1821
- showFallback: !tail || (next && tail === "collapsed") ? showFallback : false
1822
- };
1823
- stop = true;
1824
- }
1647
+ };
1648
+ } else {
1649
+ const next = !stop;
1650
+ if (next) inFallback = true;
1651
+ res[n] = {
1652
+ showContent: next,
1653
+ showFallback: !tail || next && tail === "collapsed" ? showFallback : false
1654
+ };
1655
+ stop = true;
1825
1656
  }
1826
- if (!stop) inFallback = false;
1827
- res.inFallback = inFallback;
1828
- return res;
1829
- },
1830
- {
1831
- inFallback: false
1832
1657
  }
1833
- );
1658
+ if (!stop) inFallback = false;
1659
+ res.inFallback = inFallback;
1660
+ return res;
1661
+ }, {
1662
+ inFallback: false
1663
+ });
1834
1664
  setWrapper(() => resolved);
1835
1665
  return createComponent(SuspenseListContext.Provider, {
1836
1666
  value: {
@@ -1875,27 +1705,23 @@ function Suspense(props) {
1875
1705
  const key = sharedConfig.getContextId();
1876
1706
  let ref = sharedConfig.load(key);
1877
1707
  if (ref) {
1878
- if (typeof ref !== "object" || ref.status !== "success") p = ref;
1879
- else sharedConfig.gather(key);
1708
+ if (typeof ref !== "object" || ref.s !== 1) p = ref;else sharedConfig.gather(key);
1880
1709
  }
1881
1710
  if (p && p !== "$$f") {
1882
1711
  const [s, set] = createSignal(undefined, {
1883
1712
  equals: false
1884
1713
  });
1885
1714
  flicker = s;
1886
- p.then(
1887
- () => {
1888
- if (sharedConfig.done) return set();
1889
- sharedConfig.gather(key);
1890
- setHydrateContext(ctx);
1891
- set();
1892
- setHydrateContext();
1893
- },
1894
- err => {
1895
- error = err;
1896
- set();
1897
- }
1898
- );
1715
+ p.then(() => {
1716
+ if (sharedConfig.done) return set();
1717
+ sharedConfig.gather(key);
1718
+ setHydrateContext(ctx);
1719
+ set();
1720
+ setHydrateContext();
1721
+ }, err => {
1722
+ error = err;
1723
+ set();
1724
+ });
1899
1725
  }
1900
1726
  }
1901
1727
  const listContext = useContext(SuspenseListContext);
@@ -1910,14 +1736,17 @@ function Suspense(props) {
1910
1736
  ctx = sharedConfig.context;
1911
1737
  if (flicker) {
1912
1738
  flicker();
1913
- return (flicker = undefined);
1739
+ return flicker = undefined;
1914
1740
  }
1915
1741
  if (ctx && p === "$$f") setHydrateContext();
1916
1742
  const rendered = createMemo(() => props.children);
1917
1743
  return createMemo(prev => {
1918
1744
  const inFallback = store.inFallback(),
1919
- { showContent = true, showFallback = true } = show ? show() : {};
1920
- if ((!inFallback || (p && p !== "$$f")) && showContent) {
1745
+ {
1746
+ showContent = true,
1747
+ showFallback = true
1748
+ } = show ? show() : {};
1749
+ if ((!inFallback || p && p !== "$$f") && showContent) {
1921
1750
  store.resolved = true;
1922
1751
  dispose && dispose();
1923
1752
  dispose = ctx = p = undefined;
@@ -1947,68 +1776,9 @@ const DEV = {
1947
1776
  hooks: DevHooks,
1948
1777
  writeSignal,
1949
1778
  registerGraph
1950
- };
1779
+ } ;
1951
1780
  if (globalThis) {
1952
- if (!globalThis.Solid$$) globalThis.Solid$$ = true;
1953
- else
1954
- console.warn(
1955
- "You appear to have multiple instances of Solid. This can lead to unexpected behavior."
1956
- );
1781
+ if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
1957
1782
  }
1958
1783
 
1959
- export {
1960
- $DEVCOMP,
1961
- $PROXY,
1962
- $TRACK,
1963
- DEV,
1964
- ErrorBoundary,
1965
- For,
1966
- Index,
1967
- Match,
1968
- Show,
1969
- Suspense,
1970
- SuspenseList,
1971
- Switch,
1972
- batch,
1973
- cancelCallback,
1974
- catchError,
1975
- children,
1976
- createComponent,
1977
- createComputed,
1978
- createContext,
1979
- createDeferred,
1980
- createEffect,
1981
- createMemo,
1982
- createReaction,
1983
- createRenderEffect,
1984
- createResource,
1985
- createRoot,
1986
- createSelector,
1987
- createSignal,
1988
- createUniqueId,
1989
- enableExternalSource,
1990
- enableHydration,
1991
- enableScheduling,
1992
- equalFn,
1993
- from,
1994
- getListener,
1995
- getOwner,
1996
- indexArray,
1997
- lazy,
1998
- mapArray,
1999
- mergeProps,
2000
- observable,
2001
- on,
2002
- onCleanup,
2003
- onError,
2004
- onMount,
2005
- requestCallback,
2006
- resetErrorBoundaries,
2007
- runWithOwner,
2008
- sharedConfig,
2009
- splitProps,
2010
- startTransition,
2011
- untrack,
2012
- useContext,
2013
- useTransition
2014
- };
1784
+ export { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, catchError, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };