@manyducks.co/dolla 2.0.0-alpha.55 → 2.0.0-alpha.56
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/dist/core/context.d.ts +38 -25
- package/dist/core/env.d.ts +2 -8
- package/dist/core/index.d.ts +3 -5
- package/dist/core/logger.d.ts +2 -2
- package/dist/core/markup.d.ts +43 -42
- package/dist/core/mount.d.ts +1 -1
- package/dist/core/nodes/dom.d.ts +6 -6
- package/dist/core/nodes/dynamic.d.ts +13 -15
- package/dist/core/nodes/html.d.ts +9 -21
- package/dist/core/nodes/portal.d.ts +8 -12
- package/dist/core/nodes/repeat.d.ts +13 -18
- package/dist/core/nodes/view.d.ts +10 -23
- package/dist/core/ref.d.ts +2 -6
- package/dist/core/symbols.d.ts +1 -1
- package/dist/core/views/default-crash-view.d.ts +1 -1
- package/dist/core/views/fragment.d.ts +1 -2
- package/dist/fragment-BahD_BJA.js +7 -0
- package/dist/fragment-BahD_BJA.js.map +1 -0
- package/dist/http.js +1 -1
- package/dist/i18n.js +2 -2
- package/dist/index.js +41 -41
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/{logger-CXdzxt1e.js → logger-sSxIw5od.js} +100 -100
- package/dist/logger-sSxIw5od.js.map +1 -0
- package/dist/markup-DS7yYBga.js +844 -0
- package/dist/markup-DS7yYBga.js.map +1 -0
- package/dist/router/index.d.ts +1 -1
- package/dist/router/router.d.ts +6 -6
- package/dist/{router-B-rtBG7i.js → router-D43DV_bv.js} +184 -183
- package/dist/router-D43DV_bv.js.map +1 -0
- package/dist/router.js +1 -1
- package/dist/router.js.map +1 -1
- package/dist/{typeChecking-lgllKIVq.js → typeChecking-BJ-ymQ2F.js} +5 -10
- package/dist/{typeChecking-lgllKIVq.js.map → typeChecking-BJ-ymQ2F.js.map} +1 -1
- package/dist/types.d.ts +12 -13
- package/package.json +1 -1
- package/dist/core/nodes/fragment.d.ts +0 -19
- package/dist/core/nodes/outlet.d.ts +0 -19
- package/dist/fragment-VXM-P2tT.js +0 -7
- package/dist/fragment-VXM-P2tT.js.map +0 -1
- package/dist/logger-CXdzxt1e.js.map +0 -1
- package/dist/markup-yTuFdC0t.js +0 -923
- package/dist/markup-yTuFdC0t.js.map +0 -1
- package/dist/router-B-rtBG7i.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { o as
|
|
2
|
-
import { $ as
|
|
3
|
-
import { m as t, w as
|
|
4
|
-
import { c as
|
|
5
|
-
import { R as
|
|
6
|
-
import { a as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
1
|
+
import { o as h } from "./logger-sSxIw5od.js";
|
|
2
|
+
import { $ as k, f as D, d as F, e as I, g as _, b as q, p as v, c as B, h as V, i as $, s as P, a as S } from "./logger-sSxIw5od.js";
|
|
3
|
+
import { m as t, w as y, C as s, L as i, r as u } from "./markup-DS7yYBga.js";
|
|
4
|
+
import { c as z, p as A, a as Y, u as G } from "./markup-DS7yYBga.js";
|
|
5
|
+
import { R as p, M as w, U as b } from "./router-D43DV_bv.js";
|
|
6
|
+
import { a as x } from "./typeChecking-BJ-ymQ2F.js";
|
|
7
|
+
const c = Symbol("Ref.EMPTY");
|
|
8
|
+
function C(e = c) {
|
|
9
9
|
return function() {
|
|
10
10
|
if (arguments.length === 0) {
|
|
11
|
-
if (e ===
|
|
11
|
+
if (e === c)
|
|
12
12
|
throw new Error("Ref getter was called, but ref has no value! Be sure to set your refs before accessing them.");
|
|
13
13
|
} else if (arguments.length === 1)
|
|
14
14
|
e = arguments[0];
|
|
@@ -17,7 +17,7 @@ function k(e = f) {
|
|
|
17
17
|
return e;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function E(e) {
|
|
21
21
|
return t(
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
@@ -35,7 +35,7 @@ function x(e) {
|
|
|
35
35
|
"p",
|
|
36
36
|
{ style: { marginBottom: "0.25rem" } },
|
|
37
37
|
t("span", { style: { fontFamily: "monospace" } }, e.loggerName),
|
|
38
|
-
|
|
38
|
+
y(
|
|
39
39
|
e.tag,
|
|
40
40
|
t(
|
|
41
41
|
"span",
|
|
@@ -77,40 +77,40 @@ function x(e) {
|
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
let o = !1;
|
|
80
|
-
async function
|
|
81
|
-
if (
|
|
80
|
+
async function R(e, n, r) {
|
|
81
|
+
if (x(Element, n, "Expected an element or a selector string. Got type: %t, value: %v"), o)
|
|
82
82
|
throw new Error("A Dolla app is already mounted.");
|
|
83
|
-
let
|
|
84
|
-
const a = (r == null ? void 0 : r.context) ?? new
|
|
85
|
-
|
|
86
|
-
o &&
|
|
87
|
-
}),
|
|
88
|
-
async function
|
|
89
|
-
o && (
|
|
83
|
+
let m, l, g = (r == null ? void 0 : r.crashView) ?? E;
|
|
84
|
+
const a = (r == null ? void 0 : r.context) ?? new s("App");
|
|
85
|
+
h((d) => {
|
|
86
|
+
o && f(), u(t(g, d), a).mount(n);
|
|
87
|
+
}), s.emit(i.WILL_MOUNT, a), e instanceof p ? (l = e, m = await l[w](n, a)) : m = u(t(e), a), m.mount(n), o = !0, s.emit(i.DID_MOUNT, a);
|
|
88
|
+
async function f() {
|
|
89
|
+
o && (s.emit(i.WILL_UNMOUNT, a), m.unmount(!1), l && await l[b](), o = !1, s.emit(i.DID_UNMOUNT, a));
|
|
90
90
|
}
|
|
91
|
-
return
|
|
91
|
+
return f;
|
|
92
92
|
}
|
|
93
93
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
k as $,
|
|
95
|
+
z as createContext,
|
|
96
|
+
D as createLogger,
|
|
97
|
+
F as deepEqual,
|
|
98
|
+
I as effect,
|
|
99
|
+
_ as get,
|
|
100
|
+
q as getEnv,
|
|
101
101
|
t as m,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
102
|
+
R as mount,
|
|
103
|
+
v as peek,
|
|
104
|
+
A as portal,
|
|
105
|
+
C as ref,
|
|
106
|
+
u as render,
|
|
107
|
+
Y as repeat,
|
|
108
|
+
B as setEnv,
|
|
109
|
+
V as setLogFilter,
|
|
110
|
+
$ as setLogLevels,
|
|
111
|
+
P as shallowEqual,
|
|
112
|
+
S as strictEqual,
|
|
113
|
+
G as unless,
|
|
114
|
+
y as when
|
|
115
115
|
};
|
|
116
116
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/core/ref.ts","../src/core/views/default-crash-view.ts","../src/core/mount.ts"],"sourcesContent":["const EMPTY_REF = Symbol(\"Ref.EMPTY\");\n\n/**\n * A hybrid getter/setter function that stores the last value it was called with.\n * Guarantees a value is held at runtime by throwing an error if no value is set.\n */\nexport interface Ref<T> {\n /**\n * Returns the currently stored value of the ref, or throws an error if no value has been set.\n */\n (): T;\n\n /**\n * Stores a new value to the ref and returns that value.\n */\n (value: T): T;\n}\n\n/**\n * Creates a
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/core/ref.ts","../src/core/views/default-crash-view.ts","../src/core/mount.ts"],"sourcesContent":["const EMPTY_REF = Symbol(\"Ref.EMPTY\");\n\n/**\n * A hybrid getter/setter function that stores the last value it was called with.\n * Guarantees a value is held at runtime by throwing an error if no value is set.\n */\nexport interface Ref<T> {\n /**\n * Returns the currently stored value of the ref, or throws an error if no value has been set.\n */\n (): T;\n\n /**\n * Stores a new value to the ref and returns that value.\n */\n (value: T): T;\n}\n\n/**\n * Creates a Ref.\n */\nexport function ref<T>(value?: T): Ref<T>;\n\nexport function ref(value = EMPTY_REF) {\n return function () {\n if (arguments.length === 0) {\n if (value === EMPTY_REF) {\n throw new Error(`Ref getter was called, but ref has no value! Be sure to set your refs before accessing them.`);\n }\n } else if (arguments.length === 1) {\n value = arguments[0];\n } else {\n throw new Error(`Ref called with too many arguments. Expected 0 or 1 arguments.`);\n }\n\n return value;\n };\n}\n","import { when, m } from \"../markup.js\";\n\n/**\n * Props passed to the crash view when a crash occurs.\n */\nexport type CrashViewProps = {\n /**\n * JavaScript Error object.\n */\n error: Error;\n\n /**\n * A string to identify the logger that reported this error.\n */\n loggerName: string;\n\n /**\n * Unique identifier to pinpoint the specific view that reported the crash.\n */\n tag?: string;\n\n /**\n * Label for the tag.\n */\n tagName?: string;\n};\n\nexport function DefaultCrashView(props: CrashViewProps) {\n return m(\n \"div\",\n {\n style: {\n backgroundColor: \"#880000\",\n color: \"#fff\",\n padding: \"2rem\",\n position: \"fixed\",\n inset: 0,\n fontSize: \"20px\",\n },\n },\n m(\"h1\", { style: { marginBottom: \"0.5rem\" } }, \"The app has crashed\"),\n m(\n \"p\",\n { style: { marginBottom: \"0.25rem\" } },\n m(\"span\", { style: { fontFamily: \"monospace\" } }, props.loggerName),\n when(\n props.tag,\n m(\n \"span\",\n { style: { fontFamily: \"monospace\", opacity: 0.5 } },\n ` [${props.tagName ? `${props.tagName}: ` : \"\"}${props.tag}]`,\n ),\n ),\n \" says:\",\n ),\n m(\n \"blockquote\",\n {\n style: {\n backgroundColor: \"#991111\",\n padding: \"0.25em\",\n borderRadius: \"6px\",\n fontFamily: \"monospace\",\n marginBottom: \"1rem\",\n },\n },\n m(\n \"span\",\n {\n style: {\n display: \"inline-block\",\n backgroundColor: \"red\",\n padding: \"0.1em 0.4em\",\n marginRight: \"0.5em\",\n borderRadius: \"4px\",\n fontSize: \"0.9em\",\n fontWeight: \"bold\",\n },\n },\n props.error.name,\n ),\n props.error.message,\n ),\n m(\"p\", {}, \"Please see the browser console for details.\"),\n );\n}\n","import { MOUNT, Router, UNMOUNT } from \"../router/router\";\nimport { assertInstanceOf } from \"../typeChecking\";\nimport type { View } from \"../types\";\nimport { Context, LifecycleEvent } from \"./context\";\nimport { type LoggerErrorContext, onLoggerCrash } from \"./logger\";\nimport { m, type MarkupNode, render } from \"./markup\";\nimport { DefaultCrashView } from \"./views/default-crash-view\";\n\nlet isMounted = false;\n\nexport type UnmountFn = () => Promise<void>;\nexport interface MountOptions {\n crashView?: View<LoggerErrorContext>;\n\n /**\n * An existing Context to use as the root, otherwise a new one will be created.\n * Use this to provide top-level stores and state to the whole app.\n */\n context?: Context;\n}\n\nexport async function mount(view: View<{}>, domNode: Element, options?: MountOptions): Promise<UnmountFn>;\nexport async function mount(router: Router, domNode: Element, options?: MountOptions): Promise<UnmountFn>;\n\nexport async function mount(view: any, rootElement: Element, options?: MountOptions): Promise<UnmountFn> {\n assertInstanceOf(Element, rootElement, \"Expected an element or a selector string. Got type: %t, value: %v\");\n\n if (isMounted) {\n throw new Error(`A Dolla app is already mounted.`);\n }\n\n let rootView: MarkupNode;\n let router: Router | undefined;\n let crashView = options?.crashView ?? DefaultCrashView;\n\n const rootContext = options?.context ?? new Context(\"App\");\n\n onLoggerCrash((ctx) => {\n if (isMounted) {\n unmount();\n }\n\n // Mount the crash page\n render(m(crashView, ctx), rootContext).mount(rootElement);\n });\n\n Context.emit(LifecycleEvent.WILL_MOUNT, rootContext);\n\n if (view instanceof Router) {\n router = view;\n rootView = await router[MOUNT](rootElement, rootContext);\n } else {\n // First, initialize the root view. The router store needs this to connect the initial route.\n rootView = render(m(view), rootContext);\n }\n\n rootView.mount(rootElement);\n isMounted = true;\n\n Context.emit(LifecycleEvent.DID_MOUNT, rootContext);\n\n async function unmount() {\n if (!isMounted) return;\n\n Context.emit(LifecycleEvent.WILL_UNMOUNT, rootContext);\n\n rootView.unmount(false);\n\n if (router) {\n await router[UNMOUNT]();\n }\n\n isMounted = false;\n\n Context.emit(LifecycleEvent.DID_UNMOUNT, rootContext);\n }\n\n return unmount;\n}\n"],"names":["EMPTY_REF","ref","value","DefaultCrashView","props","m","when","isMounted","mount","view","rootElement","options","assertInstanceOf","rootView","router","crashView","rootContext","Context","onLoggerCrash","ctx","unmount","render","LifecycleEvent","Router","MOUNT","UNMOUNT"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function jsxDEV(element: any, props: any, key: any, isStaticChildren: any, source: any, self: any): import("./core/markup").Markup
|
|
1
|
+
export function jsxDEV(element: any, props: any, key: any, isStaticChildren: any, source: any, self: any): import("./core/markup").Markup<Record<any, any>>;
|
|
2
2
|
export { Fragment } from "./core/views/fragment";
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as o } from "./markup-
|
|
2
|
-
import { F as m } from "./fragment-
|
|
1
|
+
import { m as o } from "./markup-DS7yYBga.js";
|
|
2
|
+
import { F as m } from "./fragment-BahD_BJA.js";
|
|
3
3
|
function f(e, r, t, n, l, u) {
|
|
4
4
|
const i = { ...s(["children", "key"], r) }, c = Array.isArray(r.children) ? r.children : [r.children];
|
|
5
5
|
return o(e, i, ...c);
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSX function for elements with dynamic children.
|
|
3
3
|
*/
|
|
4
|
-
export function jsx(element: any, props: any, key: any): import("./core/markup").Markup
|
|
4
|
+
export function jsx(element: any, props: any, key: any): import("./core/markup").Markup<Record<any, any>>;
|
|
5
5
|
/**
|
|
6
6
|
* JSX function for elements with static children.
|
|
7
7
|
*/
|
|
8
|
-
export function jsxs(element: any, props: any, key: any): import("./core/markup").Markup
|
|
8
|
+
export function jsxs(element: any, props: any, key: any): import("./core/markup").Markup<Record<any, any>>;
|
|
9
9
|
export { Fragment } from "./core/views/fragment";
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as t } from "./markup-
|
|
2
|
-
import { F as m } from "./fragment-
|
|
1
|
+
import { m as t } from "./markup-DS7yYBga.js";
|
|
2
|
+
import { F as m } from "./fragment-BahD_BJA.js";
|
|
3
3
|
function d(e, n, i) {
|
|
4
4
|
return t(e, n ? { ...u(["children", "key"], n) } : void 0, n.children);
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as E, t as q, b as B } from "./typeChecking-BJ-ymQ2F.js";
|
|
2
2
|
var v = /* @__PURE__ */ ((e) => (e[e.Computed = 1] = "Computed", e[e.Effect = 2] = "Effect", e[e.Tracking = 4] = "Tracking", e[e.Notified = 8] = "Notified", e[e.Recursed = 16] = "Recursed", e[e.Dirty = 32] = "Dirty", e[e.PendingComputed = 64] = "PendingComputed", e[e.PendingEffect = 128] = "PendingEffect", e[e.Propagated = 224] = "Propagated", e))(v || {});
|
|
3
3
|
function _({
|
|
4
4
|
updateComputed: e,
|
|
@@ -23,7 +23,7 @@ function _({
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
const u = n.subsTail;
|
|
26
|
-
if (!(u !== void 0 && u.sub === s &&
|
|
26
|
+
if (!(u !== void 0 && u.sub === s && T(u, s)))
|
|
27
27
|
return o(n, s, c, i);
|
|
28
28
|
},
|
|
29
29
|
/**
|
|
@@ -39,14 +39,14 @@ function _({
|
|
|
39
39
|
let s = 32, i = n, c = 0;
|
|
40
40
|
e: do {
|
|
41
41
|
const u = n.sub, a = u.flags;
|
|
42
|
-
if (!(a & 244) && (u.flags = a | s | 8, !0) || a & 16 && !(a & 4) && (u.flags = a & -17 | s | 8, !0) || !(a & 224) &&
|
|
42
|
+
if (!(a & 244) && (u.flags = a | s | 8, !0) || a & 16 && !(a & 4) && (u.flags = a & -17 | s | 8, !0) || !(a & 224) && T(n, u) && (u.flags = a | 16 | s | 8, u.subs !== void 0)) {
|
|
43
43
|
const g = u.subs;
|
|
44
44
|
if (g !== void 0) {
|
|
45
45
|
g.nextSub !== void 0 ? (g.prevSub = i, n = i = g, s = 64, ++c) : (n = g, s = a & 2 ? 128 : 64);
|
|
46
46
|
continue;
|
|
47
47
|
}
|
|
48
48
|
a & 2 && (r !== void 0 ? r.depsTail.nextDep = u.deps : f = u, r = u);
|
|
49
|
-
} else a & (4 | s) ? !(a & s) && a & 224 &&
|
|
49
|
+
} else a & (4 | s) ? !(a & s) && a & 224 && T(n, u) && (u.flags = a | s) : (u.flags = a | s | 8, (a & 10) === 2 && (r !== void 0 ? r.depsTail.nextDep = u.deps : f = u, r = u));
|
|
50
50
|
if ((n = i.nextSub) !== void 0) {
|
|
51
51
|
i = n, s = c ? 64 : 32;
|
|
52
52
|
continue;
|
|
@@ -226,7 +226,7 @@ function _({
|
|
|
226
226
|
(i & 96) === 64 && (s.flags = i | 32 | 8, (i & 10) === 2 && (r !== void 0 ? r.depsTail.nextDep = s.deps : f = s, r = s)), n = n.nextSub;
|
|
227
227
|
} while (n !== void 0);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function T(n, s) {
|
|
230
230
|
const i = s.depsTail;
|
|
231
231
|
if (i !== void 0) {
|
|
232
232
|
let c = s.deps;
|
|
@@ -257,13 +257,13 @@ function _({
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
var {
|
|
260
|
-
link:
|
|
261
|
-
propagate:
|
|
260
|
+
link: ae,
|
|
261
|
+
propagate: le,
|
|
262
262
|
updateDirtyFlag: X,
|
|
263
263
|
startTracking: L,
|
|
264
264
|
endTracking: A,
|
|
265
|
-
processEffectNotifications:
|
|
266
|
-
processComputedUpdate:
|
|
265
|
+
processEffectNotifications: de,
|
|
266
|
+
processComputedUpdate: pe,
|
|
267
267
|
processPendingInnerEffects: I
|
|
268
268
|
} = _({
|
|
269
269
|
updateComputed(e) {
|
|
@@ -295,23 +295,23 @@ function K(e) {
|
|
|
295
295
|
return e.flags & 128 ? (I(e, e.flags), !0) : !1;
|
|
296
296
|
}
|
|
297
297
|
const {
|
|
298
|
-
link:
|
|
298
|
+
link: m,
|
|
299
299
|
propagate: Q,
|
|
300
300
|
updateDirtyFlag: Y,
|
|
301
|
-
startTracking:
|
|
302
|
-
endTracking:
|
|
301
|
+
startTracking: O,
|
|
302
|
+
endTracking: b,
|
|
303
303
|
processEffectNotifications: Z,
|
|
304
304
|
processComputedUpdate: F,
|
|
305
305
|
processPendingInnerEffects: ee
|
|
306
306
|
} = _({
|
|
307
307
|
updateComputed(e) {
|
|
308
308
|
const t = p;
|
|
309
|
-
p = e,
|
|
309
|
+
p = e, O(e);
|
|
310
310
|
try {
|
|
311
311
|
const f = e.current, r = e.getter(f);
|
|
312
312
|
return e.equals(f, r) ? !1 : (e.current = r, !0);
|
|
313
313
|
} finally {
|
|
314
|
-
p = t,
|
|
314
|
+
p = t, b(e);
|
|
315
315
|
}
|
|
316
316
|
},
|
|
317
317
|
notifyEffect(e) {
|
|
@@ -319,29 +319,71 @@ const {
|
|
|
319
319
|
return t & v.Dirty || t & v.PendingComputed && Y(e, t) ? V(e) : ee(e, e.flags), !0;
|
|
320
320
|
}
|
|
321
321
|
});
|
|
322
|
+
function $(e, t) {
|
|
323
|
+
const f = {
|
|
324
|
+
current: e,
|
|
325
|
+
subs: void 0,
|
|
326
|
+
subsTail: void 0
|
|
327
|
+
}, r = (t == null ? void 0 : t.equals) ?? Object.is, o = function() {
|
|
328
|
+
if (arguments.length > 0) {
|
|
329
|
+
let l = arguments[0];
|
|
330
|
+
if (typeof l == "function" && (l = l(f.current)), !r(f.current, l)) {
|
|
331
|
+
f.current = l;
|
|
332
|
+
const d = f.subs;
|
|
333
|
+
d !== void 0 && (Q(d), Z());
|
|
334
|
+
}
|
|
335
|
+
} else
|
|
336
|
+
return p !== void 0 && m(f, p), f.current;
|
|
337
|
+
};
|
|
338
|
+
return o._type = U, o;
|
|
339
|
+
}
|
|
340
|
+
function te(e, t) {
|
|
341
|
+
if (E(e) && e._type === j)
|
|
342
|
+
return e._type === U ? () => e() : e;
|
|
343
|
+
const f = {
|
|
344
|
+
current: void 0,
|
|
345
|
+
equals: (t == null ? void 0 : t.equals) ?? Object.is,
|
|
346
|
+
subs: void 0,
|
|
347
|
+
subsTail: void 0,
|
|
348
|
+
deps: void 0,
|
|
349
|
+
depsTail: void 0,
|
|
350
|
+
flags: v.Computed | v.Dirty,
|
|
351
|
+
getter: (o) => {
|
|
352
|
+
const l = e(o);
|
|
353
|
+
return N(l);
|
|
354
|
+
}
|
|
355
|
+
}, r = function() {
|
|
356
|
+
if (arguments.length > 0)
|
|
357
|
+
throw new Error("Signals cannot be set as their values are derived from the sources they depend on.");
|
|
358
|
+
p !== void 0 && m(f, p);
|
|
359
|
+
const o = f.flags;
|
|
360
|
+
return o & (v.Dirty | v.PendingComputed) && F(f, o), f.current;
|
|
361
|
+
};
|
|
362
|
+
return r._type = j, r;
|
|
363
|
+
}
|
|
322
364
|
let p;
|
|
323
365
|
const h = [];
|
|
324
|
-
let
|
|
325
|
-
function
|
|
326
|
-
|
|
327
|
-
|
|
366
|
+
let D = !1;
|
|
367
|
+
function ne() {
|
|
368
|
+
D || (D = !0, queueMicrotask(() => {
|
|
369
|
+
D = !1;
|
|
328
370
|
for (let e = 0; e < h.length; e++) {
|
|
329
371
|
const t = h[e], f = p;
|
|
330
|
-
p = t,
|
|
372
|
+
p = t, O(t);
|
|
331
373
|
try {
|
|
332
374
|
t.cleanup && (z(), t.cleanup(), R()), t.cleanup = t.fn() ?? void 0;
|
|
333
375
|
} finally {
|
|
334
|
-
p = f,
|
|
376
|
+
p = f, b(t);
|
|
335
377
|
}
|
|
336
378
|
}
|
|
337
379
|
h.length = 0;
|
|
338
380
|
}));
|
|
339
381
|
}
|
|
340
382
|
function V(e) {
|
|
341
|
-
h.push(e),
|
|
383
|
+
h.push(e), ne();
|
|
342
384
|
}
|
|
343
|
-
function
|
|
344
|
-
|
|
385
|
+
function re() {
|
|
386
|
+
O(this), b(this), queueMicrotask(() => {
|
|
345
387
|
h.splice(h.indexOf(this), 1), this.cleanup && this.cleanup();
|
|
346
388
|
});
|
|
347
389
|
}
|
|
@@ -352,13 +394,13 @@ function z() {
|
|
|
352
394
|
function R() {
|
|
353
395
|
p = k.pop();
|
|
354
396
|
}
|
|
355
|
-
const
|
|
356
|
-
function
|
|
397
|
+
const j = Symbol("SIGNAL"), U = Symbol("SOURCE");
|
|
398
|
+
function se(e) {
|
|
357
399
|
let t;
|
|
358
|
-
return z(), t =
|
|
400
|
+
return z(), t = N(e), R(), t;
|
|
359
401
|
}
|
|
360
|
-
function
|
|
361
|
-
return
|
|
402
|
+
function N(e) {
|
|
403
|
+
return E(e) ? e() : e;
|
|
362
404
|
}
|
|
363
405
|
function ge(e) {
|
|
364
406
|
const t = {
|
|
@@ -369,58 +411,16 @@ function ge(e) {
|
|
|
369
411
|
depsTail: void 0,
|
|
370
412
|
flags: v.Effect
|
|
371
413
|
};
|
|
372
|
-
return p !== void 0 &&
|
|
414
|
+
return p !== void 0 && m(t, p), V(t), re.bind(t);
|
|
373
415
|
}
|
|
374
416
|
function ve(e, t) {
|
|
375
|
-
return
|
|
376
|
-
}
|
|
377
|
-
function j(e, t) {
|
|
378
|
-
const f = {
|
|
379
|
-
current: e,
|
|
380
|
-
subs: void 0,
|
|
381
|
-
subsTail: void 0
|
|
382
|
-
}, r = (t == null ? void 0 : t.equals) ?? Object.is, o = function() {
|
|
383
|
-
if (arguments.length > 0) {
|
|
384
|
-
let l = arguments[0];
|
|
385
|
-
if (typeof l == "function" && (l = l(f.current)), !r(f.current, l)) {
|
|
386
|
-
f.current = l;
|
|
387
|
-
const d = f.subs;
|
|
388
|
-
d !== void 0 && (Q(d), Z());
|
|
389
|
-
}
|
|
390
|
-
} else
|
|
391
|
-
return p !== void 0 && O(f, p), f.current;
|
|
392
|
-
};
|
|
393
|
-
return o._type = U, o;
|
|
394
|
-
}
|
|
395
|
-
function re(e, t) {
|
|
396
|
-
if (D(e) && e._type === $)
|
|
397
|
-
return e._type === U ? () => e() : e;
|
|
398
|
-
const f = {
|
|
399
|
-
current: void 0,
|
|
400
|
-
equals: (t == null ? void 0 : t.equals) ?? Object.is,
|
|
401
|
-
subs: void 0,
|
|
402
|
-
subsTail: void 0,
|
|
403
|
-
deps: void 0,
|
|
404
|
-
depsTail: void 0,
|
|
405
|
-
flags: v.Computed | v.Dirty,
|
|
406
|
-
getter: (o) => {
|
|
407
|
-
const l = e(o);
|
|
408
|
-
return T(l);
|
|
409
|
-
}
|
|
410
|
-
}, r = function() {
|
|
411
|
-
if (arguments.length > 0)
|
|
412
|
-
throw new Error("Signals cannot be set as their values are derived from the sources they depend on.");
|
|
413
|
-
p !== void 0 && O(f, p);
|
|
414
|
-
const o = f.flags;
|
|
415
|
-
return o & (v.Dirty | v.PendingComputed) && F(f, o), f.current;
|
|
416
|
-
};
|
|
417
|
-
return r._type = $, r;
|
|
417
|
+
return E(e) ? te(e, t) : $(e === void 0 ? void 0 : e, t);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const fe = () => {
|
|
420
420
|
};
|
|
421
|
-
let
|
|
421
|
+
let S = 1;
|
|
422
422
|
function he() {
|
|
423
|
-
return
|
|
423
|
+
return S = S % Number.MAX_SAFE_INTEGER + 1, S.toString(36) + Date.now().toString(36);
|
|
424
424
|
}
|
|
425
425
|
function ye(e, t) {
|
|
426
426
|
return Object.is(e, t);
|
|
@@ -449,7 +449,7 @@ function xe(e, t) {
|
|
|
449
449
|
if (e[o] !== t[o]) return !1;
|
|
450
450
|
return !0;
|
|
451
451
|
case "set":
|
|
452
|
-
if (
|
|
452
|
+
if (E(e.symmetricDifference))
|
|
453
453
|
return e.symmetricDifference(t).size === 0;
|
|
454
454
|
for (const o of e.keys())
|
|
455
455
|
if (e[o] !== t.get(o)) return !1;
|
|
@@ -457,20 +457,20 @@ function xe(e, t) {
|
|
|
457
457
|
}
|
|
458
458
|
return !1;
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function w(e, t) {
|
|
461
461
|
if (e === t) return !0;
|
|
462
462
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
463
463
|
if (e.constructor !== t.constructor) return !1;
|
|
464
464
|
var f, r, o;
|
|
465
465
|
if (Array.isArray(e)) {
|
|
466
466
|
if (f = e.length, f != t.length) return !1;
|
|
467
|
-
for (r = f; r-- !== 0; ) if (!
|
|
467
|
+
for (r = f; r-- !== 0; ) if (!w(e[r], t[r])) return !1;
|
|
468
468
|
return !0;
|
|
469
469
|
}
|
|
470
470
|
if (e instanceof Map && t instanceof Map) {
|
|
471
471
|
if (e.size !== t.size) return !1;
|
|
472
472
|
for (r of e.entries()) if (!t.has(r[0])) return !1;
|
|
473
|
-
for (r of e.entries()) if (!
|
|
473
|
+
for (r of e.entries()) if (!w(r[1], t.get(r[0]))) return !1;
|
|
474
474
|
return !0;
|
|
475
475
|
}
|
|
476
476
|
if (e instanceof Set && t instanceof Set) {
|
|
@@ -490,19 +490,19 @@ function m(e, t) {
|
|
|
490
490
|
for (r = f; r-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(t, o[r])) return !1;
|
|
491
491
|
for (r = f; r-- !== 0; ) {
|
|
492
492
|
var l = o[r];
|
|
493
|
-
if (!
|
|
493
|
+
if (!w(e[l], t[l])) return !1;
|
|
494
494
|
}
|
|
495
495
|
return !0;
|
|
496
496
|
}
|
|
497
497
|
return e !== e && t !== t;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Ee(e, t) {
|
|
500
500
|
const f = {};
|
|
501
501
|
for (const r in t)
|
|
502
502
|
e.includes(r) || (f[r] = t[r]);
|
|
503
503
|
return f;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function ie(e) {
|
|
506
506
|
let t = 0;
|
|
507
507
|
for (let f = 0; f < e.length; f++)
|
|
508
508
|
t = (t + e.charCodeAt(f) * 10) % 360;
|
|
@@ -531,10 +531,10 @@ function M(e) {
|
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
let G = "production";
|
|
534
|
-
function
|
|
534
|
+
function ue() {
|
|
535
535
|
return G;
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function Te(e) {
|
|
538
538
|
G = e;
|
|
539
539
|
}
|
|
540
540
|
let y = {
|
|
@@ -543,22 +543,22 @@ let y = {
|
|
|
543
543
|
warn: "development",
|
|
544
544
|
error: !0
|
|
545
545
|
}, W = M("*,-dolla.*"), x = [];
|
|
546
|
-
function
|
|
546
|
+
function De(e) {
|
|
547
547
|
return x.push(e), function() {
|
|
548
548
|
x.splice(x.indexOf(e), 1);
|
|
549
549
|
};
|
|
550
550
|
}
|
|
551
551
|
function Se(e, t) {
|
|
552
|
-
const f = (t == null ? void 0 : t.console) ??
|
|
553
|
-
let l =
|
|
554
|
-
if (y[o] === !1 || B(y[o]) && y[o] !==
|
|
555
|
-
return
|
|
552
|
+
const f = (t == null ? void 0 : t.console) ?? oe(), r = (o) => {
|
|
553
|
+
let l = se(e);
|
|
554
|
+
if (y[o] === !1 || B(y[o]) && y[o] !== ue() || !W(l))
|
|
555
|
+
return fe;
|
|
556
556
|
{
|
|
557
557
|
let d = `%c${l}`;
|
|
558
558
|
return t != null && t.tag ? t.tagName ? d += ` %c[${t.tagName}: %c${t.tag}%c]` : d += ` %c[%c${t.tag}%c]` : d += "%c%c%c", f[o].bind(
|
|
559
559
|
f,
|
|
560
560
|
d,
|
|
561
|
-
`color:${
|
|
561
|
+
`color:${ie(d)};font-weight:bold`,
|
|
562
562
|
"color:#777",
|
|
563
563
|
"color:#aaa",
|
|
564
564
|
"color:#777"
|
|
@@ -581,7 +581,7 @@ function Se(e, t) {
|
|
|
581
581
|
crash(o) {
|
|
582
582
|
const l = {
|
|
583
583
|
error: o,
|
|
584
|
-
loggerName:
|
|
584
|
+
loggerName: N(e),
|
|
585
585
|
tag: t == null ? void 0 : t.tag,
|
|
586
586
|
tagName: t == null ? void 0 : t.tagName
|
|
587
587
|
};
|
|
@@ -600,7 +600,7 @@ function me(e) {
|
|
|
600
600
|
f && (y[t] = f);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function oe() {
|
|
604
604
|
if (typeof window < "u" && window.console)
|
|
605
605
|
return window.console;
|
|
606
606
|
if (typeof global < "u" && global.console)
|
|
@@ -609,18 +609,18 @@ function ue() {
|
|
|
609
609
|
export {
|
|
610
610
|
ve as $,
|
|
611
611
|
ye as a,
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
612
|
+
ue as b,
|
|
613
|
+
Te as c,
|
|
614
|
+
w as d,
|
|
615
615
|
ge as e,
|
|
616
616
|
Se as f,
|
|
617
|
-
|
|
617
|
+
N as g,
|
|
618
618
|
we as h,
|
|
619
619
|
me as i,
|
|
620
620
|
he as j,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
Ee as k,
|
|
622
|
+
De as o,
|
|
623
|
+
se as p,
|
|
624
624
|
xe as s
|
|
625
625
|
};
|
|
626
|
-
//# sourceMappingURL=logger-
|
|
626
|
+
//# sourceMappingURL=logger-sSxIw5od.js.map
|