@tempots/dom 24.0.0-next.0 → 24.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.d.ts +0 -1
- package/index.js +298 -338
- package/package.json +1 -1
- package/renderable/render.d.ts +6 -2
- package/dom/ssr.d.ts +0 -0
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var Q = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var i = (s, e, t) =>
|
|
7
|
-
var A = (s, e, t) => (
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
var Ee = (s, e, t) => e in s ? Pe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
|
+
var i = (s, e, t) => Ee(s, typeof e != "symbol" ? e + "" : e, t), X = (s, e, t) => e.has(s) || Q("Cannot " + t);
|
|
7
|
+
var A = (s, e, t) => (X(s, e, "read from private field"), t ? t.call(s) : e.get(s)), Y = (s, e, t) => e.has(s) ? Q("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), B = (s, e, t, r) => (X(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
|
|
8
|
+
const De = (s, e, t) => s + (e - s) * t;
|
|
9
|
+
const Oe = (s, e, t) => {
|
|
10
10
|
const r = Math.max(s.length, e.length);
|
|
11
11
|
let n = "";
|
|
12
12
|
for (let o = 0; o < r; o++) {
|
|
@@ -16,7 +16,7 @@ const Me = (s, e, t) => {
|
|
|
16
16
|
isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * t);
|
|
17
17
|
}
|
|
18
18
|
return n;
|
|
19
|
-
},
|
|
19
|
+
}, Ae = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), Me = (s, e) => e, be = (s) => typeof s == "number" ? De : typeof s == "string" ? Oe : s instanceof Date ? Ae : Me;
|
|
20
20
|
var w;
|
|
21
21
|
class M {
|
|
22
22
|
/**
|
|
@@ -44,9 +44,9 @@ class M {
|
|
|
44
44
|
* @returns `true` if the counter is odd, `false` otherwise.
|
|
45
45
|
*/
|
|
46
46
|
i(this, "isOdd");
|
|
47
|
-
|
|
47
|
+
Y(this, w);
|
|
48
48
|
i(this, "dispose", () => {
|
|
49
|
-
A(this, w) != null && (A(this, w).dispose(),
|
|
49
|
+
A(this, w) != null && (A(this, w).dispose(), B(this, w, void 0));
|
|
50
50
|
});
|
|
51
51
|
this.index = e, this.total = t, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
|
|
52
52
|
}
|
|
@@ -55,11 +55,11 @@ class M {
|
|
|
55
55
|
* @returns `true` if the element is the last element, `false` otherwise.
|
|
56
56
|
*/
|
|
57
57
|
get isLast() {
|
|
58
|
-
return A(this, w) == null &&
|
|
58
|
+
return A(this, w) == null && B(this, w, this.total.map((e) => this.counter === e)), A(this, w);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
w = new WeakMap();
|
|
62
|
-
const
|
|
62
|
+
const b = class b {
|
|
63
63
|
/**
|
|
64
64
|
* Represents a signal with a value of type T.
|
|
65
65
|
*
|
|
@@ -243,7 +243,7 @@ const k = class k {
|
|
|
243
243
|
* @returns A property that holds the mapped value and can be observed for changes.
|
|
244
244
|
*/
|
|
245
245
|
i(this, "mapAsync", (e, t, r, n = (o, l) => o === l) => {
|
|
246
|
-
const o =
|
|
246
|
+
const o = H(t, n);
|
|
247
247
|
let l = 0, c = new AbortController();
|
|
248
248
|
return o.onDispose(
|
|
249
249
|
this.on(async (a) => {
|
|
@@ -288,7 +288,7 @@ const k = class k {
|
|
|
288
288
|
* @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
|
|
289
289
|
* @returns The derived property.
|
|
290
290
|
*/
|
|
291
|
-
i(this, "deriveProp", (e = !0) => this.feedProp(
|
|
291
|
+
i(this, "deriveProp", (e = !0) => this.feedProp(H(this.get()), e));
|
|
292
292
|
/**
|
|
293
293
|
* Returns a signal that emits the count of values received so far.
|
|
294
294
|
* @returns A signal that emits the count of values received so far.
|
|
@@ -340,8 +340,8 @@ const k = class k {
|
|
|
340
340
|
* @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
|
|
341
341
|
* @returns - A Signal that represents the result of the Promise.
|
|
342
342
|
*/
|
|
343
|
-
i(
|
|
344
|
-
const o = new
|
|
343
|
+
i(b, "ofPromise", (e, t, r, n = (o, l) => o === l) => {
|
|
344
|
+
const o = new b(t, n);
|
|
345
345
|
return e.then((l) => o._setAndNotify(l, !1)).catch((l) => {
|
|
346
346
|
r != null ? o._setAndNotify(r(l), !1) : console.error(
|
|
347
347
|
"Unhandled promise rejection in Signal.ofPromise:",
|
|
@@ -354,12 +354,12 @@ i(k, "ofPromise", (e, t, r, n = (o, l) => o === l) => {
|
|
|
354
354
|
* @param value - The value to check.
|
|
355
355
|
* @returns `true` if the value is a Signal, `false` otherwise.
|
|
356
356
|
*/
|
|
357
|
-
i(
|
|
357
|
+
i(b, "is", (e) => (
|
|
358
358
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
359
359
|
e != null && e.$__signal__ === !0
|
|
360
360
|
));
|
|
361
|
-
let d =
|
|
362
|
-
const
|
|
361
|
+
let d = b;
|
|
362
|
+
const ke = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
|
|
363
363
|
class T extends d {
|
|
364
364
|
/**
|
|
365
365
|
* Represents a Signal object.
|
|
@@ -395,7 +395,7 @@ class T extends d {
|
|
|
395
395
|
*/
|
|
396
396
|
i(this, "_scheduleNotify", () => {
|
|
397
397
|
const t = ++this._scheduleCount;
|
|
398
|
-
|
|
398
|
+
ke(() => {
|
|
399
399
|
this._scheduleCount !== t || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
|
|
400
400
|
});
|
|
401
401
|
});
|
|
@@ -417,7 +417,7 @@ class T extends d {
|
|
|
417
417
|
return this.get();
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
const
|
|
420
|
+
const I = class I extends d {
|
|
421
421
|
constructor() {
|
|
422
422
|
super(...arguments);
|
|
423
423
|
/**
|
|
@@ -471,7 +471,7 @@ const V = class V extends d {
|
|
|
471
471
|
* @returns A Prop object representing the isomorphism.
|
|
472
472
|
*/
|
|
473
473
|
i(this, "iso", (t, r, n = (o, l) => o === l) => {
|
|
474
|
-
const o = new
|
|
474
|
+
const o = new I(t(this.get()), n);
|
|
475
475
|
return o.onDispose(this.on((l) => o.set(t(l)))), o.on((l) => this._setAndNotify(r(l), !1)), o;
|
|
476
476
|
});
|
|
477
477
|
/**
|
|
@@ -500,15 +500,15 @@ const V = class V extends d {
|
|
|
500
500
|
* @param value - The value to check.
|
|
501
501
|
* @returns `true` if the value is a Prop, `false` otherwise.
|
|
502
502
|
*/
|
|
503
|
-
i(
|
|
503
|
+
i(I, "is", (t) => (
|
|
504
504
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
505
505
|
t != null && t.$__prop__ === !0
|
|
506
506
|
));
|
|
507
|
-
let
|
|
508
|
-
const
|
|
507
|
+
let N = I;
|
|
508
|
+
const W = (s, e, t = (r, n) => r === n) => {
|
|
509
509
|
const r = new T(s, t);
|
|
510
510
|
return e.forEach((n) => n.setDerivative(r)), r;
|
|
511
|
-
},
|
|
511
|
+
}, Le = (s, e) => W(s, e).dispose, H = (s, e = (t, r) => t === r) => new N(s, e), V = (s, e = (t, r) => t === r) => new d(s, e), K = () => typeof window < "u" ? window : void 0, p = {
|
|
512
512
|
/**
|
|
513
513
|
* Maps a value or a Signal to a new value.
|
|
514
514
|
* If the value is a Signal, it returns a new Signal with the mapped value.
|
|
@@ -531,7 +531,7 @@ const G = (s, e, t = (r, n) => r === n) => {
|
|
|
531
531
|
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
532
532
|
* @returns A Signal instance.
|
|
533
533
|
*/
|
|
534
|
-
toSignal: (s, e) => d.is(s) ? s :
|
|
534
|
+
toSignal: (s, e) => d.is(s) ? s : V(s, e),
|
|
535
535
|
/**
|
|
536
536
|
* Wraps a value in a `Signal` if it is not already a `Signal`.
|
|
537
537
|
* If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
|
|
@@ -565,18 +565,18 @@ const G = (s, e, t = (r, n) => r === n) => {
|
|
|
565
565
|
dispose: (s) => {
|
|
566
566
|
d.is(s) && s.dispose();
|
|
567
567
|
}
|
|
568
|
-
},
|
|
568
|
+
}, at = (...s) => (e, t) => {
|
|
569
569
|
const r = s.filter((n) => d.is(n));
|
|
570
|
-
return
|
|
570
|
+
return W(
|
|
571
571
|
() => e(...s.map((n) => p.get(n))),
|
|
572
572
|
r,
|
|
573
573
|
t
|
|
574
574
|
);
|
|
575
|
-
},
|
|
575
|
+
}, ut = (...s) => (e) => {
|
|
576
576
|
const t = s.filter((r) => d.is(r));
|
|
577
|
-
|
|
577
|
+
Le(() => e(...s.map(p.get)), t);
|
|
578
578
|
};
|
|
579
|
-
class
|
|
579
|
+
class ee {
|
|
580
580
|
constructor() {
|
|
581
581
|
i(this, "_store", /* @__PURE__ */ new Map());
|
|
582
582
|
/**
|
|
@@ -595,7 +595,7 @@ class te {
|
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
const
|
|
598
|
+
const te = ({
|
|
599
599
|
key: s,
|
|
600
600
|
defaultValue: e,
|
|
601
601
|
store: t,
|
|
@@ -604,67 +604,67 @@ const se = ({
|
|
|
604
604
|
equals: o = (c, a) => c === a,
|
|
605
605
|
onLoad: l = (c) => c
|
|
606
606
|
}) => {
|
|
607
|
-
const c = t.getItem(s), a = new
|
|
607
|
+
const c = t.getItem(s), a = new N(
|
|
608
608
|
c != null ? l(n(c)) : typeof e == "function" ? e() : e,
|
|
609
609
|
o
|
|
610
610
|
);
|
|
611
611
|
return a.on((f) => {
|
|
612
612
|
t.setItem(s, r(f));
|
|
613
613
|
}), a;
|
|
614
|
-
},
|
|
614
|
+
}, ht = (s) => {
|
|
615
615
|
var e;
|
|
616
|
-
return
|
|
616
|
+
return te({
|
|
617
617
|
...s,
|
|
618
|
-
store: ((e =
|
|
618
|
+
store: ((e = K()) == null ? void 0 : e.localStorage) ?? new ee()
|
|
619
619
|
});
|
|
620
|
-
},
|
|
620
|
+
}, ft = (s) => {
|
|
621
621
|
var e;
|
|
622
|
-
return
|
|
622
|
+
return te({
|
|
623
623
|
...s,
|
|
624
|
-
store: ((e =
|
|
624
|
+
store: ((e = K()) == null ? void 0 : e.sessionStorage) ?? new ee()
|
|
625
625
|
});
|
|
626
626
|
};
|
|
627
|
-
function
|
|
627
|
+
function Z(s) {
|
|
628
628
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
|
|
629
629
|
}
|
|
630
|
-
const
|
|
631
|
-
const n = (r == null ? void 0 : r.duration) ?? 300, o = (r == null ? void 0 : r.easing) ?? ((y) => y), l = (r == null ? void 0 : r.equals) ?? ((y,
|
|
632
|
-
let c = r == null ? void 0 : r.interpolate, a = s, f = e(), h = performance.now(),
|
|
633
|
-
const
|
|
630
|
+
const $e = (s, e, t, r) => {
|
|
631
|
+
const n = (r == null ? void 0 : r.duration) ?? 300, o = (r == null ? void 0 : r.easing) ?? ((y) => y), l = (r == null ? void 0 : r.equals) ?? ((y, $) => y === $);
|
|
632
|
+
let c = r == null ? void 0 : r.interpolate, a = s, f = e(), h = performance.now(), S = null, O = !0;
|
|
633
|
+
const q = new T(e, l), C = H(s, l);
|
|
634
634
|
C.onDispose(() => {
|
|
635
|
-
|
|
636
|
-
}), C.onDispose(
|
|
637
|
-
y.setDerivative(
|
|
635
|
+
S !== null && cancelAnimationFrame(S);
|
|
636
|
+
}), C.onDispose(q.dispose), t.forEach((y) => {
|
|
637
|
+
y.setDerivative(q), y.onDispose(C.dispose);
|
|
638
638
|
});
|
|
639
|
-
const
|
|
640
|
-
f = y, h = performance.now(), a = C.value, O && (O = !1,
|
|
641
|
-
},
|
|
642
|
-
const
|
|
643
|
-
c == null && (c =
|
|
644
|
-
let
|
|
645
|
-
|
|
639
|
+
const xe = (y) => {
|
|
640
|
+
f = y, h = performance.now(), a = C.value, O && (O = !1, S = Z(G));
|
|
641
|
+
}, G = () => {
|
|
642
|
+
const $ = (performance.now() - h) / p.get(n), Te = o($);
|
|
643
|
+
c == null && (c = be(a));
|
|
644
|
+
let J = c(a, f, Te);
|
|
645
|
+
$ >= 1 ? (O = !0, J = f) : S = Z(G), C.set(J);
|
|
646
646
|
};
|
|
647
|
-
return
|
|
648
|
-
},
|
|
647
|
+
return q.on(xe), C;
|
|
648
|
+
}, dt = (s, e) => {
|
|
649
649
|
const { initialValue: t, ...r } = e ?? {};
|
|
650
|
-
return
|
|
650
|
+
return $e(
|
|
651
651
|
t ?? s.get(),
|
|
652
652
|
s.get,
|
|
653
653
|
[s],
|
|
654
654
|
r
|
|
655
655
|
);
|
|
656
|
-
},
|
|
656
|
+
}, pt = (s, e) => {
|
|
657
657
|
const { signals: t, literals: r } = Object.entries(s).reduce(
|
|
658
658
|
({ signals: o, literals: l }, [c, a]) => (d.is(a) ? o.push([c, a]) : l[c] = a, { signals: o, literals: l }),
|
|
659
659
|
{ signals: [], literals: {} }
|
|
660
660
|
), n = t.map(([, o]) => o);
|
|
661
|
-
return
|
|
662
|
-
},
|
|
661
|
+
return W(() => (t.forEach(([o, l]) => r[o] = l.value), e(r)), n);
|
|
662
|
+
}, se = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), re = /* @__PURE__ */ new Set([
|
|
663
663
|
"rowSpan",
|
|
664
664
|
"colSpan",
|
|
665
665
|
"tabIndex",
|
|
666
666
|
"valueAsNumber"
|
|
667
|
-
]),
|
|
667
|
+
]), ne = /* @__PURE__ */ new Set(["valueAsDate"]), ie = /* @__PURE__ */ new Set([
|
|
668
668
|
"value",
|
|
669
669
|
"textContent",
|
|
670
670
|
"innerText",
|
|
@@ -672,26 +672,26 @@ const Ie = (s, e, t, r) => {
|
|
|
672
672
|
"outerHTML",
|
|
673
673
|
"className",
|
|
674
674
|
"classList"
|
|
675
|
-
]),
|
|
675
|
+
]), Ne = (s, e) => se.has(s) ? (t) => {
|
|
676
676
|
t == null ? e[s] = null : e[s] = !!t;
|
|
677
|
-
} :
|
|
677
|
+
} : re.has(s) ? (t) => {
|
|
678
678
|
t == null ? e[s] = null : e[s] = Number(t);
|
|
679
|
-
} :
|
|
679
|
+
} : ne.has(s) ? (t) => {
|
|
680
680
|
t == null ? e[s] = null : e[s] = t;
|
|
681
|
-
} :
|
|
681
|
+
} : ie.has(s) ? (t) => {
|
|
682
682
|
t == null ? e[s] = null : e[s] = String(t);
|
|
683
683
|
} : (t) => {
|
|
684
684
|
t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
|
|
685
|
-
},
|
|
685
|
+
}, He = (s, e) => se.has(s) ? () => !!e[s] : re.has(s) ? () => Number(e[s]) : ne.has(s) ? () => e[s] : ie.has(s) ? () => String(e[s]) : () => e.getAttribute(s), F = (s) => {
|
|
686
686
|
const e = s;
|
|
687
687
|
e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentElement && s.parentElement.removeChild(s);
|
|
688
|
-
},
|
|
689
|
-
class
|
|
688
|
+
}, Ie = (s) => oe(s) ? s : s.parentElement, oe = (s) => s.nodeType === 1;
|
|
689
|
+
class le extends Error {
|
|
690
690
|
constructor(e) {
|
|
691
691
|
super(`Provider not found: ${e.description}`);
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
class
|
|
694
|
+
class P {
|
|
695
695
|
/**
|
|
696
696
|
* Constructs a new `DOMContext` instance.
|
|
697
697
|
*
|
|
@@ -773,7 +773,7 @@ class b {
|
|
|
773
773
|
* @param element - The DOM element to use in the new `DOMContext` instance.
|
|
774
774
|
* @returns A new `DOMContext` instance with the provided `element`.
|
|
775
775
|
*/
|
|
776
|
-
i(this, "withElement", (e) => new
|
|
776
|
+
i(this, "withElement", (e) => new P(this.document, e, void 0, this.providers));
|
|
777
777
|
/**
|
|
778
778
|
* Creates a new `DOMContext` instance with a reference to a DOM element selected by the provided `selector`.
|
|
779
779
|
* @param selector - The CSS selector for the target DOM element.
|
|
@@ -785,31 +785,13 @@ class b {
|
|
|
785
785
|
throw new Error(`Cannot find element by selector for portal: ${e}`);
|
|
786
786
|
return this.withElement(t);
|
|
787
787
|
});
|
|
788
|
-
// /**
|
|
789
|
-
// * Creates a new `DOMContext` instance with the `isFirstLevel` property set to `true`.
|
|
790
|
-
// * @returns A new `DOMContext` instance with the `isFirstLevel` property set to `true`.
|
|
791
|
-
// */
|
|
792
|
-
// readonly withFirstLevel = (): DOMContext =>
|
|
793
|
-
// new BrowserContext(
|
|
794
|
-
// this.document,
|
|
795
|
-
// this.element,
|
|
796
|
-
// this.reference,
|
|
797
|
-
// this.providers,
|
|
798
|
-
// true
|
|
799
|
-
// )
|
|
800
788
|
/**
|
|
801
789
|
* Creates a new `DOMContext` instance with the specified reference.
|
|
802
790
|
*
|
|
803
791
|
* @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
|
|
804
792
|
* @returns A new `DOMContext` instance with the specified reference.
|
|
805
793
|
*/
|
|
806
|
-
i(this, "withReference", (e) => new
|
|
807
|
-
this.document,
|
|
808
|
-
this.element,
|
|
809
|
-
e,
|
|
810
|
-
this.providers
|
|
811
|
-
// this.isFirstLevel
|
|
812
|
-
));
|
|
794
|
+
i(this, "withReference", (e) => new P(this.document, this.element, e, this.providers));
|
|
813
795
|
/**
|
|
814
796
|
* Returns a new HTMLDOMContext instance with the specified providers merged into
|
|
815
797
|
* the existing providers.
|
|
@@ -817,16 +799,10 @@ class b {
|
|
|
817
799
|
* @param providers - An object containing the providers to be merged into the existing providers.
|
|
818
800
|
* @returns A new HTMLDOMContext instance with the merged providers.
|
|
819
801
|
*/
|
|
820
|
-
i(this, "withProviders", (e) => new
|
|
821
|
-
this.
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
{
|
|
825
|
-
...this.providers,
|
|
826
|
-
...e
|
|
827
|
-
}
|
|
828
|
-
// this.isFirstLevel
|
|
829
|
-
));
|
|
802
|
+
i(this, "withProviders", (e) => new P(this.document, this.element, this.reference, {
|
|
803
|
+
...this.providers,
|
|
804
|
+
...e
|
|
805
|
+
}));
|
|
830
806
|
/**
|
|
831
807
|
* Retrieves a provider for the given provider mark.
|
|
832
808
|
*
|
|
@@ -836,11 +812,11 @@ class b {
|
|
|
836
812
|
*/
|
|
837
813
|
i(this, "getProvider", (e) => {
|
|
838
814
|
if (this.providers[e] === void 0)
|
|
839
|
-
throw new
|
|
815
|
+
throw new le(e);
|
|
840
816
|
return this.providers[e];
|
|
841
817
|
});
|
|
842
818
|
i(this, "clear", (e) => {
|
|
843
|
-
e && (this.reference !== void 0 ?
|
|
819
|
+
e && (this.reference !== void 0 ? F(this.reference) : F(this.element));
|
|
844
820
|
});
|
|
845
821
|
/**
|
|
846
822
|
* Adds classes to the element.
|
|
@@ -895,8 +871,8 @@ class b {
|
|
|
895
871
|
*/
|
|
896
872
|
i(this, "getStyle", (e) => this.element.style.getPropertyValue(e));
|
|
897
873
|
i(this, "makeAccessors", (e) => ({
|
|
898
|
-
get:
|
|
899
|
-
set:
|
|
874
|
+
get: He(e, this.element),
|
|
875
|
+
set: Ne(e, this.element)
|
|
900
876
|
}));
|
|
901
877
|
this.document = e, this.element = t, this.reference = r, this.providers = n;
|
|
902
878
|
}
|
|
@@ -908,18 +884,18 @@ class b {
|
|
|
908
884
|
* @returns A new `DOMContext` instance.
|
|
909
885
|
*/
|
|
910
886
|
static of(e, t) {
|
|
911
|
-
return new
|
|
887
|
+
return new P(e.ownerDocument, e, t, {});
|
|
912
888
|
}
|
|
913
889
|
}
|
|
914
|
-
const g = Symbol("class"), _ = Symbol("style"), x = Symbol("handler"),
|
|
915
|
-
class
|
|
890
|
+
const g = Symbol("class"), _ = Symbol("style"), x = Symbol("handler"), ce = () => Math.random().toString(36).substring(2, 15), Ve = (s) => s.replace(/<[^>]*>?/g, "");
|
|
891
|
+
class ae {
|
|
916
892
|
constructor(e) {
|
|
917
|
-
i(this, "id",
|
|
893
|
+
i(this, "id", ce());
|
|
918
894
|
i(this, "properties", {});
|
|
919
895
|
i(this, "children", []);
|
|
920
896
|
i(this, "isElement", () => !0);
|
|
921
897
|
i(this, "isText", () => !1);
|
|
922
|
-
i(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ?
|
|
898
|
+
i(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? Ve(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
|
|
923
899
|
i(this, "removeChild", (e) => {
|
|
924
900
|
const t = this.children.indexOf(e);
|
|
925
901
|
t !== -1 && this.children.splice(t, 1);
|
|
@@ -1014,21 +990,21 @@ class ue {
|
|
|
1014
990
|
this.parent = e;
|
|
1015
991
|
}
|
|
1016
992
|
}
|
|
1017
|
-
const
|
|
1018
|
-
class
|
|
993
|
+
const Re = (s) => s.replace(/"/g, """), je = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
994
|
+
class qe extends ae {
|
|
1019
995
|
constructor(t, r, n) {
|
|
1020
996
|
super(n);
|
|
1021
997
|
i(this, "isPortal", () => !1);
|
|
1022
998
|
i(this, "toHTML", () => {
|
|
1023
999
|
const t = this.children.map((l) => l.toHTML()).join(""), r = this.namespace ? ` xmlns="${this.namespace}"` : "";
|
|
1024
1000
|
let n = null;
|
|
1025
|
-
const o = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, f]) => `${a}: ${f};`).join(" ")}"` :
|
|
1026
|
-
return
|
|
1001
|
+
const o = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, f]) => `${a}: ${f};`).join(" ")}"` : Fe.has(l) ? ` ${l}` : l === "innerHTML" ? (n = c, "") : l === "innerText" ? (n = je(c), "") : ` ${l}="${Re(c)}"`).join("");
|
|
1002
|
+
return Ue.has(this.tagName) && t === "" ? `<${this.tagName}${r}${o} />` : `<${this.tagName}${r}${o}>${n ?? t}</${this.tagName}>`;
|
|
1027
1003
|
});
|
|
1028
1004
|
this.tagName = t, this.namespace = r;
|
|
1029
1005
|
}
|
|
1030
1006
|
}
|
|
1031
|
-
class
|
|
1007
|
+
class ue extends ae {
|
|
1032
1008
|
constructor(t, r) {
|
|
1033
1009
|
super(r);
|
|
1034
1010
|
i(this, "isPortal", () => !0);
|
|
@@ -1037,9 +1013,9 @@ class he extends ue {
|
|
|
1037
1013
|
this.selector = t;
|
|
1038
1014
|
}
|
|
1039
1015
|
}
|
|
1040
|
-
class
|
|
1016
|
+
class Be {
|
|
1041
1017
|
constructor(e) {
|
|
1042
|
-
i(this, "id",
|
|
1018
|
+
i(this, "id", ce());
|
|
1043
1019
|
i(this, "isElement", () => !1);
|
|
1044
1020
|
i(this, "isText", () => !0);
|
|
1045
1021
|
i(this, "getText", () => this.text);
|
|
@@ -1057,7 +1033,7 @@ class E {
|
|
|
1057
1033
|
this.element.children.push(e);
|
|
1058
1034
|
});
|
|
1059
1035
|
i(this, "makeChildElement", (e, t) => {
|
|
1060
|
-
const r = new
|
|
1036
|
+
const r = new qe(e, t, this.element);
|
|
1061
1037
|
return this.appendOrInsert(r), new E(
|
|
1062
1038
|
r,
|
|
1063
1039
|
void 0,
|
|
@@ -1066,7 +1042,7 @@ class E {
|
|
|
1066
1042
|
);
|
|
1067
1043
|
});
|
|
1068
1044
|
i(this, "makeChildText", (e) => {
|
|
1069
|
-
const t = new
|
|
1045
|
+
const t = new Be(e);
|
|
1070
1046
|
return this.appendOrInsert(t), new E(
|
|
1071
1047
|
this.element,
|
|
1072
1048
|
t,
|
|
@@ -1083,7 +1059,7 @@ class E {
|
|
|
1083
1059
|
});
|
|
1084
1060
|
i(this, "makeRef", () => this.makeChildText(""));
|
|
1085
1061
|
i(this, "makePortal", (e) => {
|
|
1086
|
-
const t = new
|
|
1062
|
+
const t = new ue(e, this.element);
|
|
1087
1063
|
return this.appendOrInsert(t), new E(
|
|
1088
1064
|
t,
|
|
1089
1065
|
void 0,
|
|
@@ -1097,7 +1073,7 @@ class E {
|
|
|
1097
1073
|
}));
|
|
1098
1074
|
i(this, "getProvider", (e) => {
|
|
1099
1075
|
if (this.providers[e] === void 0)
|
|
1100
|
-
throw new
|
|
1076
|
+
throw new le(e);
|
|
1101
1077
|
return this.providers[e];
|
|
1102
1078
|
});
|
|
1103
1079
|
i(this, "clear", (e) => {
|
|
@@ -1115,30 +1091,30 @@ class E {
|
|
|
1115
1091
|
this.element = e, this.reference = t, this.container = r, this.providers = n;
|
|
1116
1092
|
}
|
|
1117
1093
|
}
|
|
1118
|
-
const
|
|
1094
|
+
const Fe = /* @__PURE__ */ new Set([
|
|
1119
1095
|
"checked",
|
|
1120
1096
|
"disabled",
|
|
1121
1097
|
"multiple",
|
|
1122
1098
|
"readonly",
|
|
1123
1099
|
"required",
|
|
1124
1100
|
"selected"
|
|
1125
|
-
]),
|
|
1101
|
+
]), Ue = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), he = (s) => (e) => {
|
|
1126
1102
|
const t = e.makeChildText(s);
|
|
1127
1103
|
return (r) => t.clear(r);
|
|
1128
|
-
},
|
|
1104
|
+
}, fe = (s) => (e) => {
|
|
1129
1105
|
const t = e.makeChildText(s.value), r = s.on((n) => t.setText(n));
|
|
1130
1106
|
return (n) => {
|
|
1131
1107
|
r(), t.clear(n);
|
|
1132
1108
|
};
|
|
1133
|
-
},
|
|
1109
|
+
}, gt = (s) => d.is(s) ? fe(s) : he(s), m = (...s) => (e) => {
|
|
1134
1110
|
const t = s.map((r) => u(r)(e));
|
|
1135
1111
|
return (r) => {
|
|
1136
1112
|
t.forEach((n) => n(r));
|
|
1137
1113
|
};
|
|
1138
1114
|
}, v = () => () => {
|
|
1139
|
-
},
|
|
1115
|
+
}, We = (s) => (e) => (e.addClasses(s), (t) => {
|
|
1140
1116
|
t && e.removeClasses(s);
|
|
1141
|
-
}),
|
|
1117
|
+
}), ze = (s) => (e) => {
|
|
1142
1118
|
let t = [];
|
|
1143
1119
|
const r = s.on((n) => {
|
|
1144
1120
|
e.removeClasses(t), t = (n ?? "").split(" ").filter((o) => o.length > 0), e.addClasses(t);
|
|
@@ -1146,12 +1122,12 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1146
1122
|
return (n) => {
|
|
1147
1123
|
r(), n && e.removeClasses(t), t.length = 0;
|
|
1148
1124
|
};
|
|
1149
|
-
},
|
|
1125
|
+
}, k = (s, e) => (t) => {
|
|
1150
1126
|
const { get: r, set: n } = t.makeAccessors(s), o = r();
|
|
1151
1127
|
return n(e), (l) => {
|
|
1152
1128
|
l && n(o);
|
|
1153
1129
|
};
|
|
1154
|
-
},
|
|
1130
|
+
}, L = (s, e) => (t) => {
|
|
1155
1131
|
const { get: r, set: n } = t.makeAccessors(s), o = r(), l = e.on(n);
|
|
1156
1132
|
return (c) => {
|
|
1157
1133
|
l(), c && n(o);
|
|
@@ -1170,17 +1146,17 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1170
1146
|
* @returns The renderable component for the specified attribute.
|
|
1171
1147
|
*
|
|
1172
1148
|
*/
|
|
1173
|
-
get: (s, e) => e === "class" ? (t) => d.is(t) ?
|
|
1149
|
+
get: (s, e) => e === "class" ? (t) => d.is(t) ? ze(t) : We(
|
|
1174
1150
|
(t ?? "").split(" ").filter((r) => r.length > 0)
|
|
1175
|
-
) : (t) => d.is(t) ?
|
|
1151
|
+
) : (t) => d.is(t) ? L(
|
|
1176
1152
|
e,
|
|
1177
1153
|
t
|
|
1178
|
-
) :
|
|
1154
|
+
) : k(
|
|
1179
1155
|
e,
|
|
1180
1156
|
t
|
|
1181
1157
|
)
|
|
1182
1158
|
}
|
|
1183
|
-
),
|
|
1159
|
+
), mt = new Proxy(
|
|
1184
1160
|
{},
|
|
1185
1161
|
{
|
|
1186
1162
|
/**
|
|
@@ -1191,12 +1167,12 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1191
1167
|
* @returns The renderable component for the specified attribute.
|
|
1192
1168
|
*
|
|
1193
1169
|
*/
|
|
1194
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1170
|
+
get: (s, e) => (t) => d.is(t) ? L(
|
|
1195
1171
|
`data-${e}`,
|
|
1196
1172
|
t
|
|
1197
|
-
) :
|
|
1173
|
+
) : k(`data-${e}`, t)
|
|
1198
1174
|
}
|
|
1199
|
-
),
|
|
1175
|
+
), yt = new Proxy(
|
|
1200
1176
|
{},
|
|
1201
1177
|
{
|
|
1202
1178
|
/**
|
|
@@ -1207,15 +1183,15 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1207
1183
|
* @returns The renderable component for the specified attribute.
|
|
1208
1184
|
*
|
|
1209
1185
|
*/
|
|
1210
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1186
|
+
get: (s, e) => (t) => d.is(t) ? L(
|
|
1211
1187
|
`aria-${e}`,
|
|
1212
1188
|
t
|
|
1213
|
-
) :
|
|
1189
|
+
) : k(
|
|
1214
1190
|
`aria-${e}`,
|
|
1215
1191
|
t
|
|
1216
1192
|
)
|
|
1217
1193
|
}
|
|
1218
|
-
),
|
|
1194
|
+
), wt = new Proxy(
|
|
1219
1195
|
{},
|
|
1220
1196
|
{
|
|
1221
1197
|
/**
|
|
@@ -1226,15 +1202,15 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1226
1202
|
* @returns The renderable component for the specified attribute.
|
|
1227
1203
|
*
|
|
1228
1204
|
*/
|
|
1229
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1205
|
+
get: (s, e) => (t) => d.is(t) ? L(
|
|
1230
1206
|
e,
|
|
1231
1207
|
t
|
|
1232
|
-
) :
|
|
1208
|
+
) : k(
|
|
1233
1209
|
e,
|
|
1234
1210
|
t
|
|
1235
1211
|
)
|
|
1236
1212
|
}
|
|
1237
|
-
),
|
|
1213
|
+
), _t = new Proxy(
|
|
1238
1214
|
{},
|
|
1239
1215
|
{
|
|
1240
1216
|
/**
|
|
@@ -1244,10 +1220,10 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1244
1220
|
* @returns The renderable component for the specified attribute.
|
|
1245
1221
|
*
|
|
1246
1222
|
*/
|
|
1247
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1223
|
+
get: (s, e) => (t) => d.is(t) ? L(
|
|
1248
1224
|
e,
|
|
1249
1225
|
t
|
|
1250
|
-
) :
|
|
1226
|
+
) : k(
|
|
1251
1227
|
e,
|
|
1252
1228
|
t
|
|
1253
1229
|
)
|
|
@@ -1258,23 +1234,23 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1258
1234
|
if (Array.isArray(s))
|
|
1259
1235
|
return m(...s.map(u));
|
|
1260
1236
|
if (typeof s == "string")
|
|
1261
|
-
return
|
|
1237
|
+
return he(s);
|
|
1262
1238
|
if (d.is(s))
|
|
1263
|
-
return
|
|
1239
|
+
return fe(s);
|
|
1264
1240
|
if (typeof s == "function")
|
|
1265
1241
|
return s;
|
|
1266
1242
|
throw new Error(`Unknown type: '${typeof s}' for child: ${s}`);
|
|
1267
|
-
},
|
|
1243
|
+
}, de = (s, ...e) => (t) => {
|
|
1268
1244
|
const r = t.makeChildElement(s, void 0), n = e.map((o) => u(o)(r));
|
|
1269
1245
|
return (o) => {
|
|
1270
1246
|
n.forEach((l) => l(!1)), r.clear(o);
|
|
1271
1247
|
};
|
|
1272
|
-
},
|
|
1248
|
+
}, pe = (s, e, ...t) => (r) => {
|
|
1273
1249
|
const n = r.makeChildElement(s, e), o = t.map((l) => u(l)(n));
|
|
1274
1250
|
return (l) => {
|
|
1275
1251
|
o.forEach((c) => c(!1)), n.clear(l);
|
|
1276
1252
|
};
|
|
1277
|
-
},
|
|
1253
|
+
}, vt = new Proxy(
|
|
1278
1254
|
{},
|
|
1279
1255
|
{
|
|
1280
1256
|
/**
|
|
@@ -1282,9 +1258,9 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1282
1258
|
* @param tagName - The HTML tag name.
|
|
1283
1259
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
1284
1260
|
*/
|
|
1285
|
-
get: (s, e) => (...t) =>
|
|
1261
|
+
get: (s, e) => (...t) => de(e, t.flatMap(u))
|
|
1286
1262
|
}
|
|
1287
|
-
),
|
|
1263
|
+
), St = new Proxy(
|
|
1288
1264
|
{},
|
|
1289
1265
|
{
|
|
1290
1266
|
/**
|
|
@@ -1292,9 +1268,9 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1292
1268
|
* @param type - The input type name.
|
|
1293
1269
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
1294
1270
|
*/
|
|
1295
|
-
get: (s, e) => (...t) =>
|
|
1271
|
+
get: (s, e) => (...t) => de("input", D.type(e), ...t)
|
|
1296
1272
|
}
|
|
1297
|
-
),
|
|
1273
|
+
), Ge = "http://www.w3.org/2000/svg", Ct = new Proxy(
|
|
1298
1274
|
{},
|
|
1299
1275
|
{
|
|
1300
1276
|
/**
|
|
@@ -1302,9 +1278,9 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1302
1278
|
* @param tagName - The SVG tag name.
|
|
1303
1279
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
1304
1280
|
*/
|
|
1305
|
-
get: (s, e) => (...t) =>
|
|
1281
|
+
get: (s, e) => (...t) => pe(e, Ge, t.flatMap(u))
|
|
1306
1282
|
}
|
|
1307
|
-
),
|
|
1283
|
+
), Je = "http://www.w3.org/1998/Math/MathML", xt = new Proxy(
|
|
1308
1284
|
{},
|
|
1309
1285
|
{
|
|
1310
1286
|
/**
|
|
@@ -1312,11 +1288,11 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1312
1288
|
* @param tagName - The Math tag name.
|
|
1313
1289
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
1314
1290
|
*/
|
|
1315
|
-
get: (s, e) => (...t) =>
|
|
1291
|
+
get: (s, e) => (...t) => pe(e, Je, t.flatMap(u))
|
|
1316
1292
|
}
|
|
1317
|
-
),
|
|
1293
|
+
), ge = (s, e) => {
|
|
1318
1294
|
if (typeof e == "function")
|
|
1319
|
-
return
|
|
1295
|
+
return ge(s, { then: e });
|
|
1320
1296
|
const t = e.pending != null ? u(e.pending) : v, r = e.then, n = e.error != null ? (o) => u(e.error(o)) : () => v;
|
|
1321
1297
|
return (o) => {
|
|
1322
1298
|
let l = !0;
|
|
@@ -1333,14 +1309,14 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1333
1309
|
l = !1, f(h), a.clear(h);
|
|
1334
1310
|
};
|
|
1335
1311
|
};
|
|
1336
|
-
},
|
|
1312
|
+
}, Tt = (s, e) => ge(() => s, e), me = (s, e) => (t) => t.on(s, e), Qe = (s) => me("click", (e) => {
|
|
1337
1313
|
e.preventDefault();
|
|
1338
1314
|
const t = e.target;
|
|
1339
1315
|
setTimeout(() => {
|
|
1340
1316
|
const r = t.ownerDocument != null ? t == null ? void 0 : t.checked : void 0;
|
|
1341
1317
|
r != null && s(!r);
|
|
1342
1318
|
}, 0);
|
|
1343
|
-
}),
|
|
1319
|
+
}), R = new Proxy(
|
|
1344
1320
|
{},
|
|
1345
1321
|
{
|
|
1346
1322
|
/**
|
|
@@ -1348,15 +1324,15 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1348
1324
|
* @param fn - The function to call when the event is triggered.
|
|
1349
1325
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
1350
1326
|
*/
|
|
1351
|
-
get: (s, e) => (t) =>
|
|
1327
|
+
get: (s, e) => (t) => me(e, t)
|
|
1352
1328
|
}
|
|
1353
|
-
),
|
|
1329
|
+
), Xe = (s) => (e) => {
|
|
1354
1330
|
const t = e.target;
|
|
1355
1331
|
s(t.value);
|
|
1356
|
-
},
|
|
1332
|
+
}, Ye = (s) => (e) => {
|
|
1357
1333
|
const t = e.target;
|
|
1358
1334
|
s(t.valueAsNumber);
|
|
1359
|
-
},
|
|
1335
|
+
}, Ze = (s) => (e) => {
|
|
1360
1336
|
const t = e.target;
|
|
1361
1337
|
if (t.value === "")
|
|
1362
1338
|
return;
|
|
@@ -1366,7 +1342,7 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1366
1342
|
Number(r[2].substring(0, 2))
|
|
1367
1343
|
);
|
|
1368
1344
|
s(n);
|
|
1369
|
-
},
|
|
1345
|
+
}, Ke = (s) => (e) => {
|
|
1370
1346
|
const t = e.target;
|
|
1371
1347
|
if (t.value === "")
|
|
1372
1348
|
return;
|
|
@@ -1376,25 +1352,25 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1376
1352
|
Number(n[2])
|
|
1377
1353
|
), l = r[1].split(":");
|
|
1378
1354
|
o.setHours(Number(l[0])), o.setMinutes(Number(l[1])), o.setSeconds(Number(l[2])), s(o);
|
|
1379
|
-
},
|
|
1355
|
+
}, Pt = (s) => (e) => {
|
|
1380
1356
|
const t = e.target;
|
|
1381
1357
|
s(t.checked);
|
|
1382
|
-
},
|
|
1358
|
+
}, Et = (s) => (e) => {
|
|
1383
1359
|
e.preventDefault(), s();
|
|
1384
|
-
},
|
|
1360
|
+
}, Dt = (s) => (e) => {
|
|
1385
1361
|
e.stopPropagation(), s();
|
|
1386
|
-
},
|
|
1362
|
+
}, Ot = (s) => (e) => {
|
|
1387
1363
|
e.stopImmediatePropagation(), s();
|
|
1388
|
-
},
|
|
1364
|
+
}, At = (s, e = "input") => m(
|
|
1389
1365
|
D.valueAsDate(s),
|
|
1390
|
-
|
|
1391
|
-
),
|
|
1366
|
+
R[e](Ze(s.set))
|
|
1367
|
+
), Mt = (s, e = "input") => m(
|
|
1392
1368
|
D.valueAsDate(s),
|
|
1393
|
-
|
|
1394
|
-
),
|
|
1369
|
+
R[e](Ke(s.set))
|
|
1370
|
+
), bt = (s, e = "input") => m(
|
|
1395
1371
|
D.valueAsNumber(s),
|
|
1396
|
-
|
|
1397
|
-
),
|
|
1372
|
+
R[e](Ye(s.set))
|
|
1373
|
+
), kt = (s, e = "input") => m(D.value(s), R[e](Xe(s.set))), Lt = (s) => m(D.checked(s), Qe(s.set)), j = (s, e) => {
|
|
1398
1374
|
if (d.is(s))
|
|
1399
1375
|
return (r) => {
|
|
1400
1376
|
const n = r.makeRef();
|
|
@@ -1404,8 +1380,8 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1404
1380
|
const f = c.on((h) => {
|
|
1405
1381
|
if (h !== a) {
|
|
1406
1382
|
l == null || l.dispose(), o == null || o(!0), l = s.map((O) => O[h]);
|
|
1407
|
-
const
|
|
1408
|
-
o = u(
|
|
1383
|
+
const S = e[h](l);
|
|
1384
|
+
o = u(S)(n), a = h;
|
|
1409
1385
|
}
|
|
1410
1386
|
});
|
|
1411
1387
|
return (h) => {
|
|
@@ -1413,20 +1389,20 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1413
1389
|
};
|
|
1414
1390
|
};
|
|
1415
1391
|
const t = Object.keys(s)[0];
|
|
1416
|
-
return u(e[t](
|
|
1417
|
-
},
|
|
1392
|
+
return u(e[t](V(s[t])));
|
|
1393
|
+
}, ye = (s, e, t) => j(
|
|
1418
1394
|
p.map(s, (r) => ({ [r[e]]: r })),
|
|
1419
1395
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1420
1396
|
t
|
|
1421
|
-
),
|
|
1397
|
+
), $t = (s, e) => ye(s, "kind", e), Nt = (s, e) => {
|
|
1422
1398
|
const t = p.map(s, ([r, n]) => ({ [r]: n }));
|
|
1423
|
-
return
|
|
1424
|
-
},
|
|
1399
|
+
return j(t, e);
|
|
1400
|
+
}, Ht = (s, e) => ye(s, "type", e), et = (s, e) => j(
|
|
1425
1401
|
p.map(s, (t) => ({ [t]: !0 })),
|
|
1426
1402
|
e
|
|
1427
|
-
),
|
|
1403
|
+
), It = (s, e = {}) => (t) => {
|
|
1428
1404
|
const r = (e == null ? void 0 : e.firstSeparator) ?? s, n = (e == null ? void 0 : e.lastSeparator) ?? s;
|
|
1429
|
-
return
|
|
1405
|
+
return et(
|
|
1430
1406
|
t.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
|
|
1431
1407
|
{
|
|
1432
1408
|
first: () => r,
|
|
@@ -1434,13 +1410,13 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1434
1410
|
other: () => s
|
|
1435
1411
|
}
|
|
1436
1412
|
);
|
|
1437
|
-
},
|
|
1413
|
+
}, we = (s, e) => (t) => {
|
|
1438
1414
|
const r = Object.values(s).reduce((n, o) => {
|
|
1439
1415
|
const l = t.getProvider(o);
|
|
1440
1416
|
return n[o] = l, n;
|
|
1441
1417
|
}, {});
|
|
1442
1418
|
return u(e(r))(t);
|
|
1443
|
-
},
|
|
1419
|
+
}, Vt = (s, e) => (t) => {
|
|
1444
1420
|
const r = [], n = Object.entries(s).reduce(
|
|
1445
1421
|
(o, [l, c]) => (r.push(
|
|
1446
1422
|
c((a) => (Reflect.set(o, l, a), null))(t)
|
|
@@ -1450,16 +1426,16 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1450
1426
|
return r.push(e(n)(t)), (o) => {
|
|
1451
1427
|
r.forEach((l) => l(o));
|
|
1452
1428
|
};
|
|
1453
|
-
},
|
|
1454
|
-
}),
|
|
1455
|
-
t &&
|
|
1456
|
-
}),
|
|
1429
|
+
}, Rt = (s, e) => we([s], (t) => u(e(t[s]))), jt = (s, e) => we(s, (t) => u(e(t))), qt = (s) => (e) => s(e) ?? (() => {
|
|
1430
|
+
}), Bt = (s) => (e) => (e.appendOrInsert(s), (t) => {
|
|
1431
|
+
t && F(s);
|
|
1432
|
+
}), tt = (s, e, t) => {
|
|
1457
1433
|
if (d.is(s)) {
|
|
1458
1434
|
const r = s;
|
|
1459
1435
|
return (n) => {
|
|
1460
1436
|
const o = n.makeRef();
|
|
1461
1437
|
let l = null, c = !1;
|
|
1462
|
-
const a =
|
|
1438
|
+
const a = H(null), f = r.on((h) => {
|
|
1463
1439
|
h == null ? (l == null || l(!0), l = u((t == null ? void 0 : t()) ?? v)(o), c = !1) : (a.value = h, c || (l == null || l(!0), l = u(e(a))(
|
|
1464
1440
|
o
|
|
1465
1441
|
), c = !0));
|
|
@@ -1474,33 +1450,33 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1474
1450
|
const n = t == null ? void 0 : t();
|
|
1475
1451
|
return n != null ? u(n) : v;
|
|
1476
1452
|
}
|
|
1477
|
-
return u(e(
|
|
1453
|
+
return u(e(V(r)));
|
|
1478
1454
|
}
|
|
1479
|
-
},
|
|
1455
|
+
}, U = (s) => (e) => (t) => s(t, e), _e = (s, e, t) => ve(
|
|
1480
1456
|
s,
|
|
1481
1457
|
() => e,
|
|
1482
1458
|
() => t
|
|
1483
|
-
),
|
|
1459
|
+
), ve = (s, e, t) => tt(
|
|
1484
1460
|
p.map(s, (r) => r ? !0 : null),
|
|
1485
1461
|
e,
|
|
1486
1462
|
t ?? void 0
|
|
1487
|
-
),
|
|
1463
|
+
), Ft = (s, e, t) => st(
|
|
1488
1464
|
s,
|
|
1489
1465
|
() => e,
|
|
1490
1466
|
() => t
|
|
1491
|
-
),
|
|
1467
|
+
), st = (s, e, t) => ve(
|
|
1492
1468
|
p.map(s, (r) => !r),
|
|
1493
1469
|
e,
|
|
1494
1470
|
t
|
|
1495
|
-
),
|
|
1471
|
+
), Se = (s, e, t) => t != null ? Se(s, (r) => {
|
|
1496
1472
|
const n = new M(
|
|
1497
1473
|
r.index,
|
|
1498
1474
|
r.total.map((o) => o - 1)
|
|
1499
1475
|
);
|
|
1500
1476
|
return m(
|
|
1501
|
-
|
|
1477
|
+
U(n.dispose),
|
|
1502
1478
|
u(e(r)),
|
|
1503
|
-
|
|
1479
|
+
_e(r.isLast, v, t(n))
|
|
1504
1480
|
);
|
|
1505
1481
|
}) : d.is(s) ? (r) => {
|
|
1506
1482
|
const n = r.makeRef(), o = Array.from(
|
|
@@ -1523,37 +1499,37 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1523
1499
|
};
|
|
1524
1500
|
} : m(
|
|
1525
1501
|
...Array.from({ length: s }, (r, n) => n).map(
|
|
1526
|
-
(r) => u(e(new M(r,
|
|
1502
|
+
(r) => u(e(new M(r, V(s))))
|
|
1527
1503
|
)
|
|
1528
|
-
),
|
|
1504
|
+
), rt = (s, e, t) => {
|
|
1529
1505
|
if (t != null)
|
|
1530
|
-
return
|
|
1506
|
+
return rt(s, (r, n) => {
|
|
1531
1507
|
const o = new M(
|
|
1532
1508
|
n.index,
|
|
1533
1509
|
n.total.map((l) => l - 1)
|
|
1534
1510
|
);
|
|
1535
1511
|
return m([
|
|
1536
|
-
|
|
1512
|
+
U(o.dispose),
|
|
1537
1513
|
u(e(r, n)),
|
|
1538
|
-
|
|
1514
|
+
_e(n.isLast, v, t(o))
|
|
1539
1515
|
]);
|
|
1540
1516
|
});
|
|
1541
1517
|
{
|
|
1542
1518
|
const r = p.map(s, (o) => o.length), n = p.toSignal(s);
|
|
1543
|
-
return
|
|
1519
|
+
return Se(r, (o) => {
|
|
1544
1520
|
const l = n.map((c) => c[o.index]);
|
|
1545
1521
|
return m(
|
|
1546
|
-
|
|
1522
|
+
U(l.dispose),
|
|
1547
1523
|
u(e(l, o))
|
|
1548
1524
|
);
|
|
1549
1525
|
});
|
|
1550
1526
|
}
|
|
1551
|
-
},
|
|
1527
|
+
}, nt = (s) => (e) => e.isBrowserDOM() ? s(e) ?? (() => {
|
|
1552
1528
|
}) : () => {
|
|
1553
|
-
},
|
|
1529
|
+
}, Ut = (s) => (e) => e.isHeadlessDOM() ? s(e) ?? (() => {
|
|
1554
1530
|
}) : () => {
|
|
1555
|
-
},
|
|
1556
|
-
})),
|
|
1531
|
+
}, Wt = (s) => nt((e) => s(e.element) ?? (() => {
|
|
1532
|
+
})), zt = (s, e) => {
|
|
1557
1533
|
if (d.is(s)) {
|
|
1558
1534
|
const t = s;
|
|
1559
1535
|
return (r) => {
|
|
@@ -1570,7 +1546,7 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1570
1546
|
};
|
|
1571
1547
|
}
|
|
1572
1548
|
return u(e(s));
|
|
1573
|
-
},
|
|
1549
|
+
}, Gt = (s, e, t = () => v) => j(
|
|
1574
1550
|
p.map(
|
|
1575
1551
|
s,
|
|
1576
1552
|
(r) => r.length > 0 ? { notEmpty: r } : { whenEmpty: null }
|
|
@@ -1582,56 +1558,45 @@ const Ge = /* @__PURE__ */ new Set([
|
|
|
1582
1558
|
), z = (s, e) => {
|
|
1583
1559
|
const t = s(e);
|
|
1584
1560
|
return () => t(!0);
|
|
1585
|
-
},
|
|
1561
|
+
}, Jt = (s, e, { doc: t, clear: r } = {}) => {
|
|
1586
1562
|
const n = typeof e == "string" ? (t ?? document).querySelector(e) : e;
|
|
1587
1563
|
if (n === null)
|
|
1588
|
-
throw new
|
|
1564
|
+
throw new it(
|
|
1589
1565
|
`Cannot find element by selector for render: ${e}`
|
|
1590
1566
|
);
|
|
1591
1567
|
r !== !1 && (t ?? n.ownerDocument) != null && n.nodeType === 1 && (n.innerHTML = "");
|
|
1592
|
-
const o =
|
|
1568
|
+
const o = Ie(n), l = oe(n) ? void 0 : n, c = P.of(o, l);
|
|
1593
1569
|
return z(s, c);
|
|
1594
|
-
},
|
|
1595
|
-
|
|
1570
|
+
}, Qt = (s, {
|
|
1571
|
+
startUrl: e = "https://example.com",
|
|
1572
|
+
selector: t = ":root"
|
|
1573
|
+
} = {}) => {
|
|
1574
|
+
const r = p.toSignal(e).deriveProp(), n = new ue(t, void 0), o = new E(n, void 0, { currentURL: r }, {});
|
|
1596
1575
|
return {
|
|
1597
|
-
clear: z(s,
|
|
1598
|
-
root:
|
|
1599
|
-
currentURL:
|
|
1576
|
+
clear: z(s(), o),
|
|
1577
|
+
root: n,
|
|
1578
|
+
currentURL: r
|
|
1600
1579
|
};
|
|
1601
1580
|
};
|
|
1602
|
-
class
|
|
1581
|
+
class it extends Error {
|
|
1603
1582
|
constructor(e) {
|
|
1604
1583
|
super(e);
|
|
1605
1584
|
}
|
|
1606
1585
|
}
|
|
1607
|
-
const
|
|
1586
|
+
const Xt = (s, e) => (t) => {
|
|
1608
1587
|
const r = t.makePortal(s);
|
|
1609
1588
|
return z(u(e), r);
|
|
1610
|
-
},
|
|
1611
|
-
if (S.has(s))
|
|
1612
|
-
throw new Error(`Probe already exists: ${s.description}`);
|
|
1613
|
-
return S.set(s, 0), ht(xe, (n) => {
|
|
1614
|
-
let o = S.get(n);
|
|
1615
|
-
if (o == null)
|
|
1616
|
-
throw new Error(`Probe not found: ${n.description}`);
|
|
1617
|
-
--o === 0 ? (e(), S.delete(n)) : S.set(n, o);
|
|
1618
|
-
}, t);
|
|
1619
|
-
}, dt = (s, e) => nt(xe, (t) => {
|
|
1620
|
-
const r = S.get(s);
|
|
1621
|
-
if (r == null)
|
|
1622
|
-
throw new Error(`Probe not found: ${s.description}`);
|
|
1623
|
-
return S.set(s, r + 1), e(() => t(s));
|
|
1624
|
-
}), Te = Symbol("globalProbe"), os = (s, e) => ft(Te, s, e), ls = (s) => dt(Te, s), pt = (s, e) => (t) => {
|
|
1589
|
+
}, Yt = (s) => Symbol(s), Ce = (s, e) => (t) => u(e)(t.withProviders(s)), Zt = (...s) => s.length > 0 ? s.reduceRight((e, t) => (r) => e(t(r))) : u, Kt = (s, e, t) => Ce({ [s]: e }, u(t)), es = (s, e) => Ce(s, u(e)), ot = (s, e) => (t) => {
|
|
1625
1590
|
const r = t.getStyle(s);
|
|
1626
1591
|
return t.setStyle(s, e), (n) => {
|
|
1627
1592
|
n && t.setStyle(s, r);
|
|
1628
1593
|
};
|
|
1629
|
-
},
|
|
1594
|
+
}, lt = (s, e) => (t) => {
|
|
1630
1595
|
const r = t.getStyle(s);
|
|
1631
1596
|
return e.on((n) => t.setStyle(s, n)), (n) => {
|
|
1632
1597
|
n && t.setStyle(s, r);
|
|
1633
1598
|
};
|
|
1634
|
-
},
|
|
1599
|
+
}, ts = new Proxy(
|
|
1635
1600
|
{},
|
|
1636
1601
|
{
|
|
1637
1602
|
/**
|
|
@@ -1642,117 +1607,112 @@ const rs = (s, e) => (t) => {
|
|
|
1642
1607
|
* @returns The renderable component for the specified attribute.
|
|
1643
1608
|
*
|
|
1644
1609
|
*/
|
|
1645
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1610
|
+
get: (s, e) => (t) => d.is(t) ? lt(e, t) : ot(e, t)
|
|
1646
1611
|
}
|
|
1647
1612
|
);
|
|
1648
1613
|
export {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1614
|
+
Tt as Async,
|
|
1615
|
+
Lt as BindChecked,
|
|
1616
|
+
At as BindDate,
|
|
1617
|
+
Mt as BindDateTime,
|
|
1618
|
+
bt as BindNumber,
|
|
1619
|
+
kt as BindText,
|
|
1620
|
+
P as BrowserContext,
|
|
1656
1621
|
T as Computed,
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1622
|
+
It as Conjunction,
|
|
1623
|
+
Bt as DOMNode,
|
|
1624
|
+
de as El,
|
|
1625
|
+
pe as ElNS,
|
|
1661
1626
|
M as ElementPosition,
|
|
1662
1627
|
v as Empty,
|
|
1663
|
-
|
|
1664
|
-
|
|
1628
|
+
tt as Ensure,
|
|
1629
|
+
rt as ForEach,
|
|
1665
1630
|
m as Fragment,
|
|
1666
1631
|
E as HeadlessContext,
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
at as RenderingError,
|
|
1694
|
-
Pe as Repeat,
|
|
1632
|
+
qe as HeadlessElement,
|
|
1633
|
+
ue as HeadlessPortal,
|
|
1634
|
+
Be as HeadlessText,
|
|
1635
|
+
st as LazyUnless,
|
|
1636
|
+
ve as LazyWhen,
|
|
1637
|
+
zt as MapSignal,
|
|
1638
|
+
ee as MemoryStore,
|
|
1639
|
+
Gt as NotEmpty,
|
|
1640
|
+
nt as OnBrowserCtx,
|
|
1641
|
+
Qe as OnChecked,
|
|
1642
|
+
qt as OnCtx,
|
|
1643
|
+
U as OnDispose,
|
|
1644
|
+
Wt as OnElement,
|
|
1645
|
+
Ut as OnHeadlessCtx,
|
|
1646
|
+
j as OneOf,
|
|
1647
|
+
ye as OneOfField,
|
|
1648
|
+
$t as OneOfKind,
|
|
1649
|
+
Nt as OneOfTuple,
|
|
1650
|
+
Ht as OneOfType,
|
|
1651
|
+
et as OneOfValue,
|
|
1652
|
+
Xt as Portal,
|
|
1653
|
+
N as Prop,
|
|
1654
|
+
Zt as Provide,
|
|
1655
|
+
le as ProviderNotFoundError,
|
|
1656
|
+
it as RenderingError,
|
|
1657
|
+
Se as Repeat,
|
|
1695
1658
|
d as Signal,
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
nt as UseProvider,
|
|
1703
|
-
zt as UseProviders,
|
|
1659
|
+
ge as Task,
|
|
1660
|
+
gt as TextNode,
|
|
1661
|
+
Ft as Unless,
|
|
1662
|
+
Vt as Use,
|
|
1663
|
+
Rt as UseProvider,
|
|
1664
|
+
jt as UseProviders,
|
|
1704
1665
|
p as Value,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1666
|
+
_e as When,
|
|
1667
|
+
Kt as WithProvider,
|
|
1668
|
+
es as WithProviders,
|
|
1669
|
+
Ie as _getSelfOrParentElement,
|
|
1670
|
+
oe as _isElement,
|
|
1671
|
+
He as _makeGetter,
|
|
1672
|
+
Ne as _makeSetter,
|
|
1673
|
+
F as _removeDOMNode,
|
|
1674
|
+
fe as _signalText,
|
|
1675
|
+
he as _staticText,
|
|
1676
|
+
dt as animateSignal,
|
|
1677
|
+
$e as animateSignals,
|
|
1678
|
+
yt as aria,
|
|
1718
1679
|
D as attr,
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
ts as render,
|
|
1680
|
+
mt as dataAttr,
|
|
1681
|
+
Pt as emitChecked,
|
|
1682
|
+
Et as emitPreventDefault,
|
|
1683
|
+
Ot as emitStopImmediatePropagation,
|
|
1684
|
+
Dt as emitStopPropagation,
|
|
1685
|
+
Xe as emitValue,
|
|
1686
|
+
Ze as emitValueAsDate,
|
|
1687
|
+
Ke as emitValueAsDateTime,
|
|
1688
|
+
Ye as emitValueAsNumber,
|
|
1689
|
+
Me as endInterpolate,
|
|
1690
|
+
K as getWindow,
|
|
1691
|
+
be as guessInterpolate,
|
|
1692
|
+
vt as html,
|
|
1693
|
+
St as input,
|
|
1694
|
+
Ae as interpolateDate,
|
|
1695
|
+
De as interpolateNumber,
|
|
1696
|
+
Oe as interpolateString,
|
|
1697
|
+
ht as localStorageProp,
|
|
1698
|
+
W as makeComputed,
|
|
1699
|
+
at as makeComputedOf,
|
|
1700
|
+
pt as makeComputedRecord,
|
|
1701
|
+
Le as makeEffect,
|
|
1702
|
+
ut as makeEffectOf,
|
|
1703
|
+
H as makeProp,
|
|
1704
|
+
Yt as makeProviderMark,
|
|
1705
|
+
V as makeSignal,
|
|
1706
|
+
xt as math,
|
|
1707
|
+
_t as mathAttr,
|
|
1708
|
+
R as on,
|
|
1709
|
+
Jt as render,
|
|
1750
1710
|
z as renderWithContext,
|
|
1751
1711
|
u as renderableOfTNode,
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1712
|
+
Qt as runHeadless,
|
|
1713
|
+
ft as sessionStorageProp,
|
|
1714
|
+
te as storedProp,
|
|
1715
|
+
ts as style,
|
|
1716
|
+
Ct as svg,
|
|
1717
|
+
wt as svgAttr
|
|
1758
1718
|
};
|