@manyducks.co/dolla 2.0.0-alpha.40 → 2.0.0-alpha.42
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/README.md +70 -5
- package/dist/core/markup.d.ts +1 -1
- package/dist/core/nodes/dom.d.ts +1 -1
- package/dist/core/nodes/dynamic.d.ts +1 -1
- package/dist/core/nodes/html.d.ts +1 -1
- package/dist/core/nodes/list.d.ts +1 -1
- package/dist/core/nodes/outlet.d.ts +1 -1
- package/dist/core/nodes/view.d.ts +1 -1
- package/dist/core/signals.d.ts +82 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +371 -358
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/markup-DQdkb3ri.js +1518 -0
- package/dist/markup-DQdkb3ri.js.map +1 -0
- package/dist/translate/index.d.ts +1 -1
- package/notes/atomic.md +64 -1
- package/notes/context-routes.md +7 -2
- package/notes/custom-nodes.md +17 -0
- package/notes/readme-scratch.md +16 -0
- package/package.json +1 -1
- package/dist/markup-DIfh0nwz.js +0 -1442
- package/dist/markup-DIfh0nwz.js.map +0 -1
- package/notes/context-vars.md +0 -21
package/dist/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
var zt = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var $t = (a) => {
|
|
3
|
+
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var Bt = (
|
|
6
|
-
var w = (
|
|
7
|
-
var
|
|
8
|
-
var Rt = (
|
|
9
|
-
set _(
|
|
10
|
-
d(
|
|
5
|
+
var Bt = (a, t, e) => t in a ? zt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
6
|
+
var w = (a, t, e) => Bt(a, typeof t != "symbol" ? t + "" : t, e), mt = (a, t, e) => t.has(a) || $t("Cannot " + e);
|
|
7
|
+
var i = (a, t, e) => (mt(a, t, "read from private field"), e ? e.call(a) : t.get(a)), u = (a, t, e) => t.has(a) ? $t("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, e), d = (a, t, e, s) => (mt(a, t, "write to private field"), s ? s.call(a, e) : t.set(a, e), e), f = (a, t, e) => (mt(a, t, "access private method"), e);
|
|
8
|
+
var Rt = (a, t, e, s) => ({
|
|
9
|
+
set _(r) {
|
|
10
|
+
d(a, t, r, e);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return a
|
|
13
|
+
return i(a, t, s);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { a as Kt, b as Ft, i as
|
|
17
|
-
import { w as Ue,
|
|
18
|
-
function Ne(
|
|
16
|
+
import { a as Kt, b as Ft, i as H, I as Ot, c as Ut, d as O, s as _t, e as Qt, f as S, g as V, P as jt, h as Jt, t as St, j as lt, k as Xt, l as Mt, m as xt, S as Yt, n as Tt, o as Nt, p as Zt, V as te, q as ee, r as se, u as ne, v as re } from "./markup-DQdkb3ri.js";
|
|
17
|
+
import { w as Ue, z as je, C as Ce, y as Ie, B as Ve, x as De, A as qe } from "./markup-DQdkb3ri.js";
|
|
18
|
+
function Ne(a) {
|
|
19
19
|
return function() {
|
|
20
20
|
if (arguments.length === 1)
|
|
21
|
-
|
|
21
|
+
a = arguments[0];
|
|
22
22
|
else if (arguments.length > 1)
|
|
23
23
|
throw new Error(`Too many arguments. Expected 0 or 1. Got: ${arguments.length}`);
|
|
24
|
-
return
|
|
24
|
+
return a;
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return Ft(
|
|
27
|
+
function B(a) {
|
|
28
|
+
return Ft(a, "Expected `path` to be a string. Got type: %t, value: %v"), a.split("/").map((t) => t.trim()).filter((t) => t !== "");
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function q(a) {
|
|
31
31
|
var e;
|
|
32
32
|
Kt(
|
|
33
|
-
(s) =>
|
|
34
|
-
|
|
33
|
+
(s) => H(s == null ? void 0 : s.toString),
|
|
34
|
+
a,
|
|
35
35
|
"Expected `parts` to be an array of objects with a .toString() method. Got type: %t, value: %v"
|
|
36
|
-
),
|
|
37
|
-
let t = (e =
|
|
36
|
+
), a = a.filter((s) => s).flatMap(String);
|
|
37
|
+
let t = (e = a.shift()) == null ? void 0 : e.toString();
|
|
38
38
|
if (t) {
|
|
39
|
-
for (const s of
|
|
39
|
+
for (const s of a.map((r) => r.toString()))
|
|
40
40
|
s.startsWith(".") ? t = ct(t, s) : t[t.length - 1] !== "/" ? s[0] !== "/" ? t += "/" + s : t += s : s[0] === "/" ? t += s.slice(1) : t += s;
|
|
41
41
|
t && t !== "/" && t.endsWith("/") && (t = t.slice(0, t.length - 1));
|
|
42
42
|
}
|
|
43
43
|
return t ?? "";
|
|
44
44
|
}
|
|
45
|
-
function ct(
|
|
46
|
-
if (Ft(
|
|
45
|
+
function ct(a, t) {
|
|
46
|
+
if (Ft(a, "Expected `base` to be a string. Got type: %t, value: %v"), t == null && (t = a, a = ""), t.startsWith("/"))
|
|
47
47
|
return t;
|
|
48
|
-
let e =
|
|
48
|
+
let e = a;
|
|
49
49
|
for (; ; )
|
|
50
50
|
if (t.startsWith("..")) {
|
|
51
51
|
for (let s = e.length; s > 0; --s)
|
|
@@ -57,71 +57,71 @@ function ct(i, t) {
|
|
|
57
57
|
t = t.replace(/^\.\/?/, "");
|
|
58
58
|
else
|
|
59
59
|
break;
|
|
60
|
-
return
|
|
60
|
+
return q([e, t]);
|
|
61
61
|
}
|
|
62
|
-
function ae(
|
|
63
|
-
if (!
|
|
64
|
-
|
|
65
|
-
const t =
|
|
66
|
-
const [s,
|
|
67
|
-
return
|
|
62
|
+
function ae(a) {
|
|
63
|
+
if (!a) return {};
|
|
64
|
+
a.startsWith("?") && (a = a.slice(1));
|
|
65
|
+
const t = a.split("&").filter((e) => e.trim() !== "").map((e) => {
|
|
66
|
+
const [s, r] = e.split("=").map((n) => n.trim());
|
|
67
|
+
return r.toLowerCase() === "true" ? [s, !0] : r.toLowerCase() === "false" ? [s, !1] : isNaN(Number(r)) ? [s, r] : [s, Number(r)];
|
|
68
68
|
});
|
|
69
69
|
return Object.fromEntries(t);
|
|
70
70
|
}
|
|
71
|
-
function Ct(
|
|
71
|
+
function Ct(a, t, e = {}) {
|
|
72
72
|
var o;
|
|
73
|
-
const [s,
|
|
74
|
-
t: for (const c of
|
|
73
|
+
const [s, r] = t.split("?"), n = B(s);
|
|
74
|
+
t: for (const c of a) {
|
|
75
75
|
const { fragments: l } = c;
|
|
76
|
-
if (!(((o = l[l.length - 1]) == null ? void 0 : o.type) === 3) && l.length !==
|
|
76
|
+
if (!(((o = l[l.length - 1]) == null ? void 0 : o.type) === 3) && l.length !== n.length || e.willMatch && !e.willMatch(c))
|
|
77
77
|
continue t;
|
|
78
|
-
const
|
|
78
|
+
const b = [];
|
|
79
79
|
e: for (let h = 0; h < l.length; h++) {
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
80
|
+
const M = n[h], k = l[h];
|
|
81
|
+
if (M == null && k.type !== 3)
|
|
82
82
|
continue t;
|
|
83
83
|
switch (k.type) {
|
|
84
84
|
case 1:
|
|
85
|
-
if (k.name.toLowerCase() ===
|
|
86
|
-
|
|
85
|
+
if (k.name.toLowerCase() === M.toLowerCase()) {
|
|
86
|
+
b.push(k);
|
|
87
87
|
break;
|
|
88
88
|
} else
|
|
89
89
|
continue t;
|
|
90
90
|
case 2:
|
|
91
|
-
|
|
91
|
+
b.push({ ...k, value: M });
|
|
92
92
|
break;
|
|
93
93
|
case 3:
|
|
94
|
-
|
|
94
|
+
b.push({ ...k, value: n.slice(h).join("/") });
|
|
95
95
|
break e;
|
|
96
96
|
case 4:
|
|
97
|
-
if (isNaN(Number(
|
|
97
|
+
if (isNaN(Number(M)))
|
|
98
98
|
continue t;
|
|
99
|
-
|
|
99
|
+
b.push({ ...k, value: Number(M) });
|
|
100
100
|
break;
|
|
101
101
|
default:
|
|
102
102
|
throw new Error(`Unknown fragment type: ${k.type}`);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
for (const h of
|
|
107
|
-
h.type === 2 && (
|
|
105
|
+
const v = {};
|
|
106
|
+
for (const h of b)
|
|
107
|
+
h.type === 2 && (v[h.name] = decodeURIComponent(h.value)), h.type === 4 && (v[h.name] = h.value), h.type === 3 && (v.wildcard = "/" + decodeURIComponent(h.value));
|
|
108
108
|
return {
|
|
109
|
-
path: "/" +
|
|
109
|
+
path: "/" + b.map((h) => h.value).join("/"),
|
|
110
110
|
pattern: "/" + l.map((h) => h.type === 2 ? `{${h.name}}` : h.type === 4 ? `{#${h.name}}` : h.name).join("/"),
|
|
111
|
-
params:
|
|
112
|
-
query: ae(
|
|
111
|
+
params: v,
|
|
112
|
+
query: ae(r),
|
|
113
113
|
meta: c.meta
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
function ie(
|
|
118
|
-
const t = [], e = [], s = [],
|
|
119
|
-
for (const o of
|
|
117
|
+
function ie(a) {
|
|
118
|
+
const t = [], e = [], s = [], r = [];
|
|
119
|
+
for (const o of a) {
|
|
120
120
|
const { fragments: c } = o;
|
|
121
121
|
c.some(
|
|
122
122
|
(l) => l.type === 3
|
|
123
123
|
/* Wildcard */
|
|
124
|
-
) ?
|
|
124
|
+
) ? r.push(o) : c.some(
|
|
125
125
|
(l) => l.type === 4
|
|
126
126
|
/* NumericParam */
|
|
127
127
|
) ? e.push(o) : c.some(
|
|
@@ -129,121 +129,121 @@ function ie(i) {
|
|
|
129
129
|
/* Param */
|
|
130
130
|
) ? s.push(o) : t.push(o);
|
|
131
131
|
}
|
|
132
|
-
const
|
|
133
|
-
return t.sort(
|
|
132
|
+
const n = (o, c) => o.fragments.length > c.fragments.length ? -1 : 1;
|
|
133
|
+
return t.sort(n), e.sort(n), s.sort(n), r.sort(n), [...t, ...e, ...s, ...r];
|
|
134
134
|
}
|
|
135
|
-
function oe(
|
|
136
|
-
const t =
|
|
135
|
+
function oe(a) {
|
|
136
|
+
const t = B(a), e = [];
|
|
137
137
|
for (let s = 0; s < t.length; s++) {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
138
|
+
const r = t[s];
|
|
139
|
+
if (r === "*") {
|
|
140
140
|
if (s !== t.length - 1)
|
|
141
|
-
throw new Error(`Wildcard must be at the end of a pattern. Received: ${
|
|
141
|
+
throw new Error(`Wildcard must be at the end of a pattern. Received: ${a}`);
|
|
142
142
|
e.push({
|
|
143
143
|
type: 3,
|
|
144
144
|
name: "*",
|
|
145
145
|
value: null
|
|
146
146
|
});
|
|
147
|
-
} else
|
|
148
|
-
type:
|
|
149
|
-
name:
|
|
147
|
+
} else r.at(0) === "{" && r.at(-1) === "}" ? e.push({
|
|
148
|
+
type: r[1] === "#" ? 4 : 2,
|
|
149
|
+
name: r[1] === "#" ? r.slice(2, -1) : r.slice(1, -1),
|
|
150
150
|
value: null
|
|
151
151
|
}) : e.push({
|
|
152
152
|
type: 1,
|
|
153
|
-
name:
|
|
154
|
-
value:
|
|
153
|
+
name: r,
|
|
154
|
+
value: r
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
return e;
|
|
158
158
|
}
|
|
159
|
-
function Pe(
|
|
160
|
-
return new he(
|
|
159
|
+
function Pe(a) {
|
|
160
|
+
return new he(a);
|
|
161
161
|
}
|
|
162
162
|
const It = Symbol.for("DollaRouterMountMethod"), Vt = Symbol.for("DollaRouterUnmountMethod");
|
|
163
|
-
function pt(
|
|
164
|
-
return (
|
|
163
|
+
function pt(a) {
|
|
164
|
+
return (a == null ? void 0 : a[Ot]) === !0;
|
|
165
165
|
}
|
|
166
|
-
async function le(
|
|
167
|
-
return
|
|
166
|
+
async function le(a, t) {
|
|
167
|
+
return a[It](t);
|
|
168
168
|
}
|
|
169
|
-
async function ce(
|
|
170
|
-
return
|
|
169
|
+
async function ce(a) {
|
|
170
|
+
return a[Vt]();
|
|
171
171
|
}
|
|
172
|
-
var Lt,
|
|
172
|
+
var Lt, K, _, ht, x, G, Q, U, j, T, m, wt, Dt, qt, z, Gt, gt, yt;
|
|
173
173
|
class he {
|
|
174
174
|
constructor(t) {
|
|
175
175
|
u(this, m);
|
|
176
176
|
w(this, Lt, !0);
|
|
177
|
-
u(this,
|
|
178
|
-
u(this,
|
|
177
|
+
u(this, K);
|
|
178
|
+
u(this, _);
|
|
179
179
|
u(this, ht, 0);
|
|
180
|
-
u(this,
|
|
181
|
-
u(this,
|
|
182
|
-
u(this,
|
|
180
|
+
u(this, x, []);
|
|
181
|
+
u(this, G, []);
|
|
182
|
+
u(this, Q, !1);
|
|
183
183
|
/**
|
|
184
184
|
* Use hash routing when true. Configured in router options.
|
|
185
185
|
*/
|
|
186
|
-
u(this,
|
|
186
|
+
u(this, U, !1);
|
|
187
187
|
// Callbacks that need to be called on unmount.
|
|
188
|
-
u(this,
|
|
188
|
+
u(this, j, []);
|
|
189
189
|
/**
|
|
190
190
|
* The current match object.
|
|
191
191
|
*/
|
|
192
|
-
u(this,
|
|
192
|
+
u(this, T, Ut());
|
|
193
193
|
/**
|
|
194
194
|
* The currently matched route pattern, if any.
|
|
195
195
|
*/
|
|
196
|
-
w(this, "pattern",
|
|
196
|
+
w(this, "pattern", O(() => {
|
|
197
197
|
var t;
|
|
198
|
-
return (t =
|
|
198
|
+
return (t = i(this, T).get()) == null ? void 0 : t.pattern;
|
|
199
199
|
}));
|
|
200
200
|
/**
|
|
201
201
|
* The current URL path.
|
|
202
202
|
*/
|
|
203
|
-
w(this, "path",
|
|
203
|
+
w(this, "path", O(() => {
|
|
204
204
|
var t;
|
|
205
|
-
return ((t =
|
|
205
|
+
return ((t = i(this, T).get()) == null ? void 0 : t.path) ?? window.location.pathname;
|
|
206
206
|
}));
|
|
207
207
|
/**
|
|
208
208
|
* The current named path params.
|
|
209
209
|
*/
|
|
210
|
-
w(this, "params",
|
|
210
|
+
w(this, "params", O(() => {
|
|
211
211
|
var t;
|
|
212
|
-
return ((t =
|
|
212
|
+
return ((t = i(this, T).get()) == null ? void 0 : t.params) ?? {};
|
|
213
213
|
}, { equals: _t }));
|
|
214
214
|
/**
|
|
215
215
|
* The current query params. Changes to this object will be reflected in the URL.
|
|
216
216
|
*/
|
|
217
|
-
w(this, "query",
|
|
217
|
+
w(this, "query", O(() => {
|
|
218
218
|
var t;
|
|
219
|
-
return ((t =
|
|
219
|
+
return ((t = i(this, T).get()) == null ? void 0 : t.query) ?? {};
|
|
220
220
|
}, { equals: _t }));
|
|
221
|
-
Qt(t, "Options must be an object. Got: %t"), t.hash && d(this,
|
|
221
|
+
Qt(t, "Options must be an object. Got: %t"), t.hash && d(this, U, !0), d(this, G, ie(
|
|
222
222
|
t.routes.flatMap((e) => f(this, m, yt).call(this, e)).map((e) => ({
|
|
223
223
|
pattern: e.pattern,
|
|
224
224
|
meta: e.meta,
|
|
225
225
|
fragments: oe(e.pattern)
|
|
226
226
|
}))
|
|
227
|
-
)), pe(
|
|
227
|
+
)), pe(i(this, G));
|
|
228
228
|
}
|
|
229
229
|
async [(Lt = Ot, It)](t) {
|
|
230
|
-
d(this,
|
|
230
|
+
d(this, K, t), d(this, _, t.createLogger("Dolla.router"));
|
|
231
231
|
const e = () => {
|
|
232
|
-
f(this, m,
|
|
232
|
+
f(this, m, z).call(this);
|
|
233
233
|
};
|
|
234
|
-
window.addEventListener("popstate", e),
|
|
234
|
+
window.addEventListener("popstate", e), i(this, j).push(() => window.removeEventListener("popstate", e));
|
|
235
235
|
const s = t.getRootElement();
|
|
236
|
-
|
|
237
|
-
de(s, (
|
|
238
|
-
let
|
|
239
|
-
|
|
236
|
+
i(this, j).push(
|
|
237
|
+
de(s, (r) => {
|
|
238
|
+
let n = r.getAttribute("href");
|
|
239
|
+
i(this, _).info("intercepted click on <a> tag", r), /^https?:\/\/|^\//.test(n) || (n = q([window.location.pathname, n])), f(this, m, wt).call(this, n);
|
|
240
240
|
})
|
|
241
|
-
),
|
|
241
|
+
), i(this, _).info("will intercept clicks on <a> tags within root element", s), d(this, Q, !0), await f(this, m, z).call(this);
|
|
242
242
|
}
|
|
243
243
|
async [Vt]() {
|
|
244
|
-
for (const t of
|
|
244
|
+
for (const t of i(this, j))
|
|
245
245
|
t();
|
|
246
|
-
d(this,
|
|
246
|
+
d(this, j, []);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* Navigate backward. Pass a number of steps to hit the back button that many times.
|
|
@@ -266,71 +266,83 @@ class he {
|
|
|
266
266
|
*/
|
|
267
267
|
go(t, e = {}) {
|
|
268
268
|
let s;
|
|
269
|
-
Array.isArray(t) ? s =
|
|
269
|
+
Array.isArray(t) ? s = q(t) : s = t.toString(), s = ct(window.location.pathname, s), e.preserveQuery && (s += window.location.search), e.replace ? f(this, m, Dt).call(this, s) : f(this, m, wt).call(this, s);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
K = new WeakMap(), _ = new WeakMap(), ht = new WeakMap(), x = new WeakMap(), G = new WeakMap(), Q = new WeakMap(), U = new WeakMap(), j = new WeakMap(), T = new WeakMap(), m = new WeakSet(), wt = function(t, e) {
|
|
273
273
|
var s;
|
|
274
|
-
(s =
|
|
274
|
+
(s = i(this, _)) == null || s.info("(push)", t), window.history.pushState(e, "", i(this, U) ? "/#" + t : t), f(this, m, z).call(this, t);
|
|
275
275
|
}, Dt = function(t, e) {
|
|
276
276
|
var s;
|
|
277
|
-
(s =
|
|
277
|
+
(s = i(this, _)) == null || s.info("(replace)", t), window.history.replaceState(e, "", i(this, U) ? "/#" + t : t), f(this, m, z).call(this, t);
|
|
278
278
|
}, qt = function() {
|
|
279
|
-
return
|
|
280
|
-
},
|
|
279
|
+
return i(this, U) ? new URL(window.location.hash.slice(1), window.location.origin) : new URL(window.location.pathname, window.location.origin);
|
|
280
|
+
}, z = async function(t) {
|
|
281
281
|
var c;
|
|
282
|
-
const e =
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
282
|
+
const e = i(this, _), s = (c = i(this, K)) == null ? void 0 : c.getRootView(), r = t ? new URL(t, window.location.origin) : f(this, m, qt).call(this), { match: n, journey: o } = await f(this, m, gt).call(this, r);
|
|
283
|
+
for (const l of o)
|
|
284
|
+
switch (l.kind) {
|
|
285
|
+
case "match":
|
|
286
|
+
e == null || e.info(`📍 ${l.message}`);
|
|
287
|
+
break;
|
|
288
|
+
case "redirect":
|
|
289
|
+
e == null || e.info(`↩️ ${l.message}`);
|
|
290
|
+
break;
|
|
291
|
+
case "miss":
|
|
292
|
+
e == null || e.info(`💀 ${l.message}`);
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
if (n) {
|
|
296
|
+
const l = this.pattern.peek();
|
|
297
|
+
i(this, T).set(n), s && n.pattern !== l && f(this, m, Gt).call(this, s, n);
|
|
286
298
|
} else
|
|
287
|
-
|
|
288
|
-
return { match:
|
|
299
|
+
i(this, Q) && e.crash(new we(`Failed to match route '${r.pathname}'`));
|
|
300
|
+
return { match: n, journey: o };
|
|
289
301
|
}, /**
|
|
290
302
|
* Takes a matched route and mounts it.
|
|
291
303
|
*/
|
|
292
304
|
Gt = function(t, e) {
|
|
293
305
|
const s = e.meta.layers;
|
|
294
|
-
for (let
|
|
295
|
-
const
|
|
296
|
-
if ((o == null ? void 0 : o.id) !==
|
|
297
|
-
d(this,
|
|
298
|
-
const c =
|
|
299
|
-
|
|
306
|
+
for (let r = 0; r < s.length; r++) {
|
|
307
|
+
const n = s[r], o = i(this, x)[r];
|
|
308
|
+
if ((o == null ? void 0 : o.id) !== n.id) {
|
|
309
|
+
d(this, x, i(this, x).slice(0, r)), o == null || o.view.unmount();
|
|
310
|
+
const c = i(this, x).at(-1), p = ((c == null ? void 0 : c.view) ?? t).setChildView(n.view);
|
|
311
|
+
i(this, x).push({ id: n.id, view: p });
|
|
300
312
|
}
|
|
301
313
|
}
|
|
302
314
|
}, gt = async function(t, e = []) {
|
|
303
|
-
const s = Ct(
|
|
315
|
+
const s = Ct(i(this, G), t.pathname);
|
|
304
316
|
if (!s)
|
|
305
317
|
return {
|
|
306
318
|
match: null,
|
|
307
319
|
journey: [...e, { kind: "miss", message: `no match for '${t.pathname}'` }]
|
|
308
320
|
};
|
|
309
|
-
let
|
|
321
|
+
let r = s.meta.redirect;
|
|
310
322
|
if (s.meta.beforeMatch && await s.meta.beforeMatch({
|
|
311
323
|
// TODO: Allow setting context variables from here? Would apply to the context of the matched view.
|
|
312
|
-
redirect: (
|
|
313
|
-
|
|
324
|
+
redirect: (n) => {
|
|
325
|
+
r = n;
|
|
314
326
|
}
|
|
315
|
-
}),
|
|
316
|
-
let
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
else if (
|
|
327
|
+
}), r != null) {
|
|
328
|
+
let n;
|
|
329
|
+
if (S(r))
|
|
330
|
+
n = me(r, s.params);
|
|
331
|
+
else if (H(r)) {
|
|
320
332
|
const o = {
|
|
321
333
|
path: s.path,
|
|
322
334
|
pattern: s.pattern,
|
|
323
335
|
params: s.params,
|
|
324
336
|
query: s.query
|
|
325
337
|
};
|
|
326
|
-
if (
|
|
338
|
+
if (n = await r(o), !S(n))
|
|
327
339
|
throw new Error("Redirect function must return a path to redirect to.");
|
|
328
|
-
|
|
340
|
+
n.startsWith("/") || (n = ct(s.path, n));
|
|
329
341
|
} else
|
|
330
342
|
throw new TypeError("Redirect must either be a path string or a function.");
|
|
331
|
-
return f(this, m, gt).call(this, new URL(
|
|
343
|
+
return f(this, m, gt).call(this, new URL(n, window.location.origin), [
|
|
332
344
|
...e,
|
|
333
|
-
{ kind: "redirect", message: `redirecting '${s.path}' -> '${
|
|
345
|
+
{ kind: "redirect", message: `redirecting '${s.path}' -> '${n}'` }
|
|
334
346
|
]);
|
|
335
347
|
} else
|
|
336
348
|
return { match: s, journey: [...e, { kind: "match", message: `matched route '${s.path}'` }] };
|
|
@@ -341,7 +353,7 @@ Gt = function(t, e) {
|
|
|
341
353
|
* @param layers - Array of parent layers. Passed when this function calls itself on nested routes.
|
|
342
354
|
*/
|
|
343
355
|
yt = function(t, e = [], s = []) {
|
|
344
|
-
if (!
|
|
356
|
+
if (!V(t) || !S(t.path))
|
|
345
357
|
throw new TypeError(`Route configs must be objects with a 'path' string property. Got: ${t}`);
|
|
346
358
|
if (t.redirect && t.routes)
|
|
347
359
|
throw new Error("Route cannot have both a 'redirect' and nested 'routes'.");
|
|
@@ -349,70 +361,70 @@ yt = function(t, e = [], s = []) {
|
|
|
349
361
|
throw new Error("Route cannot have both a 'redirect' and a 'view'.");
|
|
350
362
|
if (!t.view && !t.routes && !t.redirect)
|
|
351
363
|
throw new Error("Route must have a 'view', a 'redirect', or a set of nested 'routes'.");
|
|
352
|
-
let
|
|
364
|
+
let r = [];
|
|
353
365
|
for (const l of e)
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const
|
|
366
|
+
r.push(...B(l.path));
|
|
367
|
+
r.push(...B(t.path)), r[r.length - 1] === "*" && r.pop();
|
|
368
|
+
const n = [];
|
|
357
369
|
if (t.redirect) {
|
|
358
370
|
let l = t.redirect;
|
|
359
|
-
return
|
|
360
|
-
pattern: "/" +
|
|
371
|
+
return S(l) && (l = ct(q(r), l), l.startsWith("/") || (l = "/" + l)), n.push({
|
|
372
|
+
pattern: "/" + q([...r, ...B(t.path)]),
|
|
361
373
|
meta: {
|
|
362
374
|
redirect: l
|
|
363
375
|
}
|
|
364
|
-
}),
|
|
376
|
+
}), n;
|
|
365
377
|
}
|
|
366
378
|
let o = jt;
|
|
367
|
-
if (
|
|
379
|
+
if (H(t.view))
|
|
368
380
|
o = t.view;
|
|
369
381
|
else if (t.view)
|
|
370
382
|
throw new TypeError(`Route '${t.path}' expected a view function or undefined. Got: ${t.view}`);
|
|
371
383
|
const c = { id: Rt(this, ht)._++, view: o };
|
|
372
384
|
if (t.routes)
|
|
373
385
|
for (const l of t.routes)
|
|
374
|
-
|
|
386
|
+
n.push(...f(this, m, yt).call(this, l, [...e, t], [...s, c]));
|
|
375
387
|
else
|
|
376
|
-
|
|
377
|
-
pattern: parent ?
|
|
388
|
+
n.push({
|
|
389
|
+
pattern: parent ? q([...e.map((l) => l.path), t.path]) : t.path,
|
|
378
390
|
meta: {
|
|
379
391
|
pattern: t.path,
|
|
380
392
|
layers: [...s, c],
|
|
381
393
|
beforeMatch: t.beforeMatch
|
|
382
394
|
}
|
|
383
395
|
});
|
|
384
|
-
return
|
|
396
|
+
return n;
|
|
385
397
|
};
|
|
386
398
|
const ue = /(noopener|noreferrer) (noopener|noreferrer)/, fe = /^[\w-_]+:/;
|
|
387
|
-
function de(
|
|
388
|
-
function s(
|
|
389
|
-
return !
|
|
399
|
+
function de(a, t, e = window) {
|
|
400
|
+
function s(n) {
|
|
401
|
+
return !n || n === a ? null : n.localName !== "a" || n.href === void 0 ? s(n.parentNode) : n;
|
|
390
402
|
}
|
|
391
|
-
function n
|
|
392
|
-
if (
|
|
403
|
+
function r(n) {
|
|
404
|
+
if (n.button && n.button !== 0 || n.ctrlKey || n.metaKey || n.altKey || n.shiftKey || n.defaultPrevented)
|
|
393
405
|
return;
|
|
394
|
-
const o = s(
|
|
395
|
-
o && (e.location.protocol !== o.protocol || e.location.hostname !== o.hostname || e.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" && ue.test(o.getAttribute("rel")) || fe.test(o.getAttribute("href")) || (
|
|
406
|
+
const o = s(n.target);
|
|
407
|
+
o && (e.location.protocol !== o.protocol || e.location.hostname !== o.hostname || e.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" && ue.test(o.getAttribute("rel")) || fe.test(o.getAttribute("href")) || (n.preventDefault(), t(o)));
|
|
396
408
|
}
|
|
397
|
-
return
|
|
398
|
-
|
|
409
|
+
return a.addEventListener("click", r), function() {
|
|
410
|
+
a.removeEventListener("click", r);
|
|
399
411
|
};
|
|
400
412
|
}
|
|
401
|
-
function me(
|
|
413
|
+
function me(a, t) {
|
|
402
414
|
for (const e in t) {
|
|
403
415
|
const s = t[e].toString();
|
|
404
|
-
|
|
416
|
+
a = a.replace(`{${e}}`, s).replace(`{#${e}}`, s);
|
|
405
417
|
}
|
|
406
|
-
return
|
|
418
|
+
return a;
|
|
407
419
|
}
|
|
408
|
-
function pe(
|
|
409
|
-
for (const t of
|
|
420
|
+
function pe(a) {
|
|
421
|
+
for (const t of a)
|
|
410
422
|
if (t.meta.redirect) {
|
|
411
423
|
let e;
|
|
412
|
-
if (!
|
|
413
|
-
if (e = t.meta.redirect, !Ct(
|
|
414
|
-
willMatch(
|
|
415
|
-
return
|
|
424
|
+
if (!H(t.meta.redirect)) if (S(t.meta.redirect)) {
|
|
425
|
+
if (e = t.meta.redirect, !Ct(a, e, {
|
|
426
|
+
willMatch(r) {
|
|
427
|
+
return r !== t;
|
|
416
428
|
}
|
|
417
429
|
}))
|
|
418
430
|
throw new Error(`Found a redirect to an undefined URL. From '${t.pattern}' to '${t.meta.redirect}'`);
|
|
@@ -422,11 +434,11 @@ function pe(i) {
|
|
|
422
434
|
}
|
|
423
435
|
class we extends Error {
|
|
424
436
|
}
|
|
425
|
-
var
|
|
437
|
+
var C, ut, E, R;
|
|
426
438
|
class ge {
|
|
427
439
|
constructor() {
|
|
428
|
-
u(this,
|
|
429
|
-
u(this,
|
|
440
|
+
u(this, E);
|
|
441
|
+
u(this, C, []);
|
|
430
442
|
u(this, ut, ye());
|
|
431
443
|
}
|
|
432
444
|
/**
|
|
@@ -436,42 +448,42 @@ class ge {
|
|
|
436
448
|
* @param middleware - A middleware function that will intercept requests.
|
|
437
449
|
*/
|
|
438
450
|
use(t) {
|
|
439
|
-
return
|
|
440
|
-
|
|
451
|
+
return i(this, C).push(t), () => {
|
|
452
|
+
i(this, C).splice(i(this, C).indexOf(t), 1);
|
|
441
453
|
};
|
|
442
454
|
}
|
|
443
455
|
async get(t, e) {
|
|
444
|
-
return f(this,
|
|
456
|
+
return f(this, E, R).call(this, "get", t, e);
|
|
445
457
|
}
|
|
446
458
|
async put(t, e) {
|
|
447
|
-
return f(this,
|
|
459
|
+
return f(this, E, R).call(this, "put", t, e);
|
|
448
460
|
}
|
|
449
461
|
async patch(t, e) {
|
|
450
|
-
return f(this,
|
|
462
|
+
return f(this, E, R).call(this, "patch", t, e);
|
|
451
463
|
}
|
|
452
464
|
async post(t, e) {
|
|
453
|
-
return f(this,
|
|
465
|
+
return f(this, E, R).call(this, "post", t, e);
|
|
454
466
|
}
|
|
455
467
|
async delete(t, e) {
|
|
456
|
-
return f(this,
|
|
468
|
+
return f(this, E, R).call(this, "delete", t, e);
|
|
457
469
|
}
|
|
458
470
|
async head(t, e) {
|
|
459
|
-
return f(this,
|
|
471
|
+
return f(this, E, R).call(this, "head", t, e);
|
|
460
472
|
}
|
|
461
473
|
async options(t, e) {
|
|
462
|
-
return f(this,
|
|
474
|
+
return f(this, E, R).call(this, "options", t, e);
|
|
463
475
|
}
|
|
464
476
|
async trace(t, e) {
|
|
465
|
-
return f(this,
|
|
477
|
+
return f(this, E, R).call(this, "trace", t, e);
|
|
466
478
|
}
|
|
467
479
|
}
|
|
468
|
-
|
|
469
|
-
return new
|
|
480
|
+
C = new WeakMap(), ut = new WeakMap(), E = new WeakSet(), R = async function(t, e, s) {
|
|
481
|
+
return new ke({
|
|
470
482
|
...s,
|
|
471
483
|
method: t,
|
|
472
484
|
uri: e,
|
|
473
|
-
middleware:
|
|
474
|
-
fetch:
|
|
485
|
+
middleware: i(this, C),
|
|
486
|
+
fetch: i(this, ut)
|
|
475
487
|
}).fetch();
|
|
476
488
|
};
|
|
477
489
|
function ye() {
|
|
@@ -483,7 +495,7 @@ function ye() {
|
|
|
483
495
|
}
|
|
484
496
|
class be extends Error {
|
|
485
497
|
constructor(e) {
|
|
486
|
-
const { status: s, statusText:
|
|
498
|
+
const { status: s, statusText: r, method: n, url: o } = e, c = `${s} ${r}: Request failed (${n.toUpperCase()} ${o.toString()})`;
|
|
487
499
|
super(c);
|
|
488
500
|
w(this, "response");
|
|
489
501
|
this.response = e;
|
|
@@ -506,7 +518,7 @@ class ve {
|
|
|
506
518
|
t.forEach((e, s) => {
|
|
507
519
|
this.headers.set(s, e);
|
|
508
520
|
});
|
|
509
|
-
else if (
|
|
521
|
+
else if (V(t))
|
|
510
522
|
for (const e in t) {
|
|
511
523
|
const s = t[e];
|
|
512
524
|
s instanceof Date ? this.headers.set(e, s.toISOString()) : s != null && this.headers.set(e, String(s));
|
|
@@ -520,7 +532,7 @@ class ve {
|
|
|
520
532
|
t.forEach((e, s) => {
|
|
521
533
|
this.url.searchParams.set(s, e);
|
|
522
534
|
});
|
|
523
|
-
else if (
|
|
535
|
+
else if (V(t))
|
|
524
536
|
for (const e in t) {
|
|
525
537
|
const s = t[e];
|
|
526
538
|
s instanceof Date ? this.url.searchParams.set(e, s.toISOString()) : s != null && this.url.searchParams.set(e, String(s));
|
|
@@ -529,7 +541,7 @@ class ve {
|
|
|
529
541
|
throw new TypeError(`Unknown query params type. Got: ${t}`);
|
|
530
542
|
}
|
|
531
543
|
}
|
|
532
|
-
class
|
|
544
|
+
class ke {
|
|
533
545
|
constructor(t) {
|
|
534
546
|
w(this, "_middleware");
|
|
535
547
|
w(this, "_fetch");
|
|
@@ -540,8 +552,8 @@ class Ee {
|
|
|
540
552
|
async fetch() {
|
|
541
553
|
if (this._middleware.length > 0) {
|
|
542
554
|
const t = (e = 0) => {
|
|
543
|
-
const s = this._middleware[e],
|
|
544
|
-
return async () => s(this._request, async () => (await
|
|
555
|
+
const s = this._middleware[e], r = this._middleware[e + 1] ? t(e + 1) : this._handler.bind(this);
|
|
556
|
+
return async () => s(this._request, async () => (await r(), this._response));
|
|
545
557
|
};
|
|
546
558
|
await t()();
|
|
547
559
|
} else
|
|
@@ -554,46 +566,46 @@ class Ee {
|
|
|
554
566
|
async _handler() {
|
|
555
567
|
let t;
|
|
556
568
|
const e = this._request;
|
|
557
|
-
!e.headers.has("content-type") &&
|
|
569
|
+
!e.headers.has("content-type") && V(e.body) ? (e.headers.set("content-type", "application/json"), t = JSON.stringify(e.body)) : t = e.body;
|
|
558
570
|
const s = await this._fetch(e.url.toString(), {
|
|
559
571
|
method: e.method,
|
|
560
572
|
headers: e.headers,
|
|
561
573
|
body: t
|
|
562
|
-
}),
|
|
563
|
-
let
|
|
564
|
-
|
|
574
|
+
}), r = s.headers.get("content-type");
|
|
575
|
+
let n;
|
|
576
|
+
r != null && r.includes("application/json") ? n = await s.json() : r != null && r.includes("application/x-www-form-urlencoded") ? n = await s.formData() : n = await s.text(), this._response = {
|
|
565
577
|
method: e.method,
|
|
566
578
|
url: e.url,
|
|
567
579
|
status: s.status,
|
|
568
580
|
statusText: s.statusText,
|
|
569
581
|
headers: s.headers,
|
|
570
|
-
body:
|
|
582
|
+
body: n
|
|
571
583
|
};
|
|
572
584
|
}
|
|
573
585
|
}
|
|
574
|
-
var ft,
|
|
575
|
-
class
|
|
586
|
+
var ft, W, D, bt, Wt;
|
|
587
|
+
class Ee {
|
|
576
588
|
constructor(t, e) {
|
|
577
|
-
u(this,
|
|
589
|
+
u(this, D);
|
|
578
590
|
w(this, "dolla");
|
|
579
591
|
w(this, "config");
|
|
580
592
|
u(this, ft, !1);
|
|
581
|
-
u(this,
|
|
593
|
+
u(this, W, /* @__PURE__ */ new Map());
|
|
582
594
|
this.config = t, this.dolla = e;
|
|
583
595
|
}
|
|
584
596
|
async load() {
|
|
585
597
|
let t;
|
|
586
|
-
if (!
|
|
587
|
-
if (
|
|
598
|
+
if (!i(this, ft)) {
|
|
599
|
+
if (V(this.config.strings))
|
|
588
600
|
t = this.config.strings;
|
|
589
|
-
else if (
|
|
590
|
-
if (t = await this.config.fetch(), !
|
|
601
|
+
else if (H(this.config.fetch)) {
|
|
602
|
+
if (t = await this.config.fetch(), !V(t))
|
|
591
603
|
throw new Error(`Fetch function did not return an object of language strings: ${t}`);
|
|
592
|
-
} else if (
|
|
604
|
+
} else if (S(this.config.path)) {
|
|
593
605
|
const e = await fetch(this.config.path);
|
|
594
606
|
if (e.ok) {
|
|
595
607
|
const s = await e.json();
|
|
596
|
-
if (
|
|
608
|
+
if (V(s))
|
|
597
609
|
t = s;
|
|
598
610
|
else
|
|
599
611
|
throw new Error(
|
|
@@ -604,34 +616,34 @@ class $e {
|
|
|
604
616
|
}
|
|
605
617
|
}
|
|
606
618
|
if (t) {
|
|
607
|
-
const e = f(this,
|
|
619
|
+
const e = f(this, D, bt).call(this, t);
|
|
608
620
|
for (const s of e)
|
|
609
|
-
|
|
621
|
+
i(this, W).set(s[0], s[1]);
|
|
610
622
|
} else
|
|
611
623
|
throw new Error("Language could not be loaded.");
|
|
612
624
|
}
|
|
613
625
|
getTemplate(t) {
|
|
614
|
-
return
|
|
626
|
+
return i(this, W).get(t) ?? {
|
|
615
627
|
segments: [{ type: 0, text: `[MISSING: ${t}]` }]
|
|
616
628
|
};
|
|
617
629
|
}
|
|
618
630
|
hasTemplate(t) {
|
|
619
|
-
return
|
|
631
|
+
return i(this, W).has(t);
|
|
620
632
|
}
|
|
621
633
|
}
|
|
622
|
-
ft = new WeakMap(),
|
|
634
|
+
ft = new WeakMap(), W = new WeakMap(), D = new WeakSet(), bt = function(t, e = []) {
|
|
623
635
|
const s = [];
|
|
624
|
-
for (const
|
|
625
|
-
switch (St(t[
|
|
636
|
+
for (const r in t)
|
|
637
|
+
switch (St(t[r])) {
|
|
626
638
|
case "string":
|
|
627
|
-
s.push([[...e,
|
|
639
|
+
s.push([[...e, r].join("."), f(this, D, Wt).call(this, t[r])]);
|
|
628
640
|
break;
|
|
629
641
|
case "object":
|
|
630
|
-
s.push(...f(this,
|
|
642
|
+
s.push(...f(this, D, bt).call(this, t[r], [...e, r]));
|
|
631
643
|
break;
|
|
632
644
|
default:
|
|
633
645
|
throw new Error(
|
|
634
|
-
`Expected to find a string or object at ${[...e,
|
|
646
|
+
`Expected to find a string or object at ${[...e, r].join(".")}. Got: ${St(t[r])}`
|
|
635
647
|
);
|
|
636
648
|
}
|
|
637
649
|
return s;
|
|
@@ -643,104 +655,104 @@ ft = new WeakMap(), A = new WeakMap(), q = new WeakSet(), bt = function(t, e = [
|
|
|
643
655
|
const s = {
|
|
644
656
|
segments: []
|
|
645
657
|
};
|
|
646
|
-
let
|
|
647
|
-
const
|
|
658
|
+
let r = "", n = 0, o = 0, c, l, p;
|
|
659
|
+
const b = () => {
|
|
648
660
|
c = {
|
|
649
661
|
type: 1,
|
|
650
662
|
name: "",
|
|
651
663
|
formats: []
|
|
652
664
|
};
|
|
653
|
-
},
|
|
665
|
+
}, v = () => {
|
|
654
666
|
l = {
|
|
655
667
|
name: "",
|
|
656
668
|
options: {}
|
|
657
669
|
};
|
|
658
670
|
};
|
|
659
|
-
for (;
|
|
660
|
-
if (o !== 0 && t[
|
|
661
|
-
|
|
671
|
+
for (; n < t.length; ) {
|
|
672
|
+
if (o !== 0 && t[n] === " ") {
|
|
673
|
+
n++;
|
|
662
674
|
continue;
|
|
663
675
|
}
|
|
664
676
|
switch (o) {
|
|
665
677
|
case 0:
|
|
666
|
-
t[
|
|
678
|
+
t[n] === "{" && t[n + 1] === "{" ? (o = 1, n += 2, r.length > 0 && (s.segments.push({ type: 0, text: r }), r = ""), b()) : (r += t[n], n++);
|
|
667
679
|
break;
|
|
668
680
|
case 1:
|
|
669
|
-
t[
|
|
681
|
+
t[n] === "|" ? (o = 2, n += 1, c.name = r, r = "", v()) : t[n] === "}" && t[n + 1] === "}" ? (o = 0, n += 2, c.name = r, r = "", s.segments.push(c)) : (r += t[n], n++);
|
|
670
682
|
break;
|
|
671
683
|
case 2:
|
|
672
|
-
t[
|
|
684
|
+
t[n] === "(" ? (o = 3, n += 1, l.name = r, r = "") : t[n] === "}" && t[n + 1] === "}" ? (o = 0, n += 2, c.formats.push(l), s.segments.push(c)) : (r += t[n], n++);
|
|
673
685
|
break;
|
|
674
686
|
case 3:
|
|
675
|
-
t[
|
|
687
|
+
t[n] === ")" || (t[n] === ":" ? (o = 4, n += 1, p = r, r = "") : t[n] === "}" && t[n + 1] === "}" || (r += t[n], n++));
|
|
676
688
|
break;
|
|
677
689
|
case 4:
|
|
678
|
-
t[
|
|
690
|
+
t[n] === ")" ? (o = 5, n += 1, l.options[p] = r, r = "", c.formats.push(l)) : t[n] === "," ? (o = 3, n += 1, l.options[p] = r, r = "") : t[n] === "}" && t[n + 1] === "}" || (r += t[n], n++);
|
|
679
691
|
break;
|
|
680
692
|
case 5:
|
|
681
|
-
t[
|
|
693
|
+
t[n] === "|" ? (o = 2, n += 1, v()) : t[n] === "}" && t[n + 1] === "}" && (o = 0, n += 2, s.segments.push(c));
|
|
682
694
|
break;
|
|
683
695
|
}
|
|
684
696
|
}
|
|
685
|
-
return o === 0 &&
|
|
697
|
+
return o === 0 && r.length > 0 && s.segments.push({ type: 0, text: r }), s;
|
|
686
698
|
};
|
|
687
|
-
var
|
|
688
|
-
class
|
|
699
|
+
var J, N, g, X, Y, Z, $, y, At, vt, kt, Et, Ht;
|
|
700
|
+
class $e {
|
|
689
701
|
constructor(t) {
|
|
690
702
|
u(this, y);
|
|
691
|
-
u(this,
|
|
692
|
-
u(this,
|
|
703
|
+
u(this, J);
|
|
704
|
+
u(this, N);
|
|
693
705
|
u(this, g, /* @__PURE__ */ new Map());
|
|
694
|
-
u(this,
|
|
695
|
-
u(this,
|
|
696
|
-
u(this,
|
|
697
|
-
u(this,
|
|
698
|
-
d(this,
|
|
699
|
-
|
|
706
|
+
u(this, X, []);
|
|
707
|
+
u(this, Y, /* @__PURE__ */ new Map());
|
|
708
|
+
u(this, Z, "auto");
|
|
709
|
+
u(this, $, Ut(""));
|
|
710
|
+
d(this, J, t), d(this, N, t.createLogger("Dolla.i18n")), this.addFormat("number", (e, s, r) => f(this, y, vt).call(this, Number(s), r)), this.addFormat("datetime", (e, s, r) => f(this, y, kt).call(this, s, r)), this.addFormat("list", (e, s, r) => f(this, y, Et).call(this, s, r)), t.beforeMount(async () => {
|
|
711
|
+
i(this, g).size > 0 && await this.setLocale(i(this, Z));
|
|
700
712
|
});
|
|
701
713
|
}
|
|
702
714
|
get locale() {
|
|
703
|
-
return
|
|
715
|
+
return i(this, $);
|
|
704
716
|
}
|
|
705
717
|
get locales() {
|
|
706
|
-
return [...
|
|
718
|
+
return [...i(this, g).keys()];
|
|
707
719
|
}
|
|
708
720
|
setup(t) {
|
|
709
721
|
if (t.translations.forEach((e) => {
|
|
710
|
-
|
|
722
|
+
i(this, g).set(e.locale, new Ee(e, i(this, J)));
|
|
711
723
|
}), t.locale && t.locale !== "auto") {
|
|
712
724
|
if (!t.translations.some((s) => s.locale === t.locale))
|
|
713
725
|
throw new Error(`Initial locale '${t.locale}' is not registered in the locales array.`);
|
|
714
|
-
d(this,
|
|
726
|
+
d(this, Z, t.locale);
|
|
715
727
|
}
|
|
716
|
-
|
|
717
|
-
`${
|
|
728
|
+
i(this, N).info(
|
|
729
|
+
`${i(this, g).size} language${i(this, g).size === 1 ? "" : "s"} supported: '${[...i(this, g).keys()].join("', '")}'`
|
|
718
730
|
);
|
|
719
731
|
}
|
|
720
732
|
async setLocale(t) {
|
|
721
|
-
var
|
|
733
|
+
var r;
|
|
722
734
|
let e;
|
|
723
735
|
if (t === "auto") {
|
|
724
|
-
let
|
|
736
|
+
let n = [];
|
|
725
737
|
if (typeof navigator < "u") {
|
|
726
738
|
const o = navigator;
|
|
727
|
-
((
|
|
739
|
+
((r = o.languages) == null ? void 0 : r.length) > 0 ? n.push(...o.languages) : o.language ? n.push(o.language) : o.browserLanguage ? n.push(o.browserLanguage) : o.userLanguage && n.push(o.userLanguage);
|
|
728
740
|
}
|
|
729
|
-
for (const o of
|
|
730
|
-
|
|
741
|
+
for (const o of n)
|
|
742
|
+
i(this, g).has(o) && (e = o);
|
|
731
743
|
} else
|
|
732
|
-
|
|
744
|
+
i(this, g).has(t) && (e = t);
|
|
733
745
|
if (e == null) {
|
|
734
|
-
const
|
|
735
|
-
|
|
746
|
+
const n = i(this, g).keys().next().value;
|
|
747
|
+
n && (e = n);
|
|
736
748
|
}
|
|
737
|
-
if (!e || !
|
|
749
|
+
if (!e || !i(this, g).has(e))
|
|
738
750
|
throw new Error(`Locale '${t}' has no translation.`);
|
|
739
|
-
const s =
|
|
751
|
+
const s = i(this, g).get(e);
|
|
740
752
|
try {
|
|
741
|
-
await s.load(), d(this,
|
|
742
|
-
} catch (
|
|
743
|
-
|
|
753
|
+
await s.load(), d(this, X, []), i(this, $).set(e), i(this, N).info("set language to " + e);
|
|
754
|
+
} catch (n) {
|
|
755
|
+
n instanceof Error && i(this, N).crash(n);
|
|
744
756
|
}
|
|
745
757
|
}
|
|
746
758
|
/**
|
|
@@ -757,11 +769,11 @@ class ke {
|
|
|
757
769
|
throw new Error(
|
|
758
770
|
`The 't' function cannot be destructured. If you need a standalone version you can import it like so: 'import { t } from "@manyducks.co/dolla"'`
|
|
759
771
|
);
|
|
760
|
-
return
|
|
772
|
+
return O(() => {
|
|
761
773
|
const s = {};
|
|
762
|
-
for (const
|
|
763
|
-
s[
|
|
764
|
-
return f(this, y, At).call(this,
|
|
774
|
+
for (const r in e)
|
|
775
|
+
s[r] = lt(e[r]);
|
|
776
|
+
return f(this, y, At).call(this, i(this, $).get(), t, s);
|
|
765
777
|
});
|
|
766
778
|
}
|
|
767
779
|
/**
|
|
@@ -779,16 +791,16 @@ class ke {
|
|
|
779
791
|
* t("greeting", {name: "world"}); // State<"Hello, WORLD!">
|
|
780
792
|
*/
|
|
781
793
|
addFormat(t, e) {
|
|
782
|
-
|
|
794
|
+
i(this, Y).set(t, e);
|
|
783
795
|
}
|
|
784
796
|
/**
|
|
785
797
|
* Creates an `Intl.Collator` configured for the current locale.
|
|
786
|
-
* NOTE: The
|
|
798
|
+
* NOTE: The locale is tracked if called within a signal tracking context.
|
|
787
799
|
*
|
|
788
800
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options
|
|
789
801
|
*/
|
|
790
802
|
collator(t) {
|
|
791
|
-
return new Intl.Collator(
|
|
803
|
+
return new Intl.Collator(i(this, $).get(), t);
|
|
792
804
|
}
|
|
793
805
|
/**
|
|
794
806
|
* Formats a number for the current locale. Uses `Intl.NumberFormat` under the hood.
|
|
@@ -796,7 +808,7 @@ class ke {
|
|
|
796
808
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
|
|
797
809
|
*/
|
|
798
810
|
number(t, e) {
|
|
799
|
-
return
|
|
811
|
+
return O(() => f(this, y, vt).call(this, lt(t), e));
|
|
800
812
|
}
|
|
801
813
|
/**
|
|
802
814
|
* Formats a date for the current locale. Uses `Intl.DateTimeFormat` under the hood.
|
|
@@ -808,7 +820,7 @@ class ke {
|
|
|
808
820
|
* const $formatted = Dolla.i18n.dateTime(date, { dateFormat: "short" });
|
|
809
821
|
*/
|
|
810
822
|
dateTime(t, e) {
|
|
811
|
-
return
|
|
823
|
+
return O(() => f(this, y, kt).call(this, lt(t), e));
|
|
812
824
|
}
|
|
813
825
|
/**
|
|
814
826
|
* Formats a list for the current locale. Uses `Intl.ListFormat` under the hood.
|
|
@@ -820,67 +832,67 @@ class ke {
|
|
|
820
832
|
* const $formatted = Dolla.i18n.list(list, { });
|
|
821
833
|
*/
|
|
822
834
|
list(t, e) {
|
|
823
|
-
return
|
|
835
|
+
return O(() => f(this, y, Et).call(this, lt(t), e));
|
|
824
836
|
}
|
|
825
837
|
}
|
|
826
|
-
|
|
838
|
+
J = new WeakMap(), N = new WeakMap(), g = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), Z = new WeakMap(), $ = new WeakMap(), y = new WeakSet(), At = function(t, e, s) {
|
|
827
839
|
var l;
|
|
828
|
-
const
|
|
829
|
-
if (
|
|
830
|
-
const
|
|
840
|
+
const r = f(this, y, Ht).call(this, e, s);
|
|
841
|
+
if (r) return r;
|
|
842
|
+
const n = i(this, g).get(t);
|
|
831
843
|
if (s.context != null && (e += "_" + s.context), s.count != null)
|
|
832
844
|
if (s.ordinal) {
|
|
833
845
|
const p = `${e}_ordinal_(=${s.count})`;
|
|
834
|
-
|
|
846
|
+
n.hasTemplate(p) ? e = p : e += "_ordinal_" + new Intl.PluralRules(t, { type: "ordinal" }).select(s.count);
|
|
835
847
|
} else {
|
|
836
848
|
const p = `${e}_(=${s.count})`;
|
|
837
|
-
|
|
849
|
+
n.hasTemplate(p) ? e = p : e += "_" + new Intl.PluralRules(t).select(s.count);
|
|
838
850
|
}
|
|
839
|
-
const o =
|
|
851
|
+
const o = n.getTemplate(e);
|
|
840
852
|
let c = "";
|
|
841
853
|
for (const p of o.segments)
|
|
842
854
|
if (p.type === 0)
|
|
843
855
|
c += p.text;
|
|
844
856
|
else if (p.type === 1) {
|
|
845
|
-
let
|
|
846
|
-
const
|
|
847
|
-
p.name === "count" &&
|
|
848
|
-
for (const h of
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
857
|
+
let b = Re(s, p.name);
|
|
858
|
+
const v = ((l = s.formatOverrides) == null ? void 0 : l[p.name]) ?? [...p.formats];
|
|
859
|
+
p.name === "count" && v.length === 0 && v.push({ name: "number", options: {} });
|
|
860
|
+
for (const h of v) {
|
|
861
|
+
const M = i(this, Y).get(h.name);
|
|
862
|
+
if (M == null) {
|
|
851
863
|
const k = new Error(
|
|
852
864
|
`Failed to load format '${h.name}' when processing '${e}', template: ${o}`
|
|
853
865
|
);
|
|
854
|
-
throw
|
|
866
|
+
throw i(this, N).crash(k), k;
|
|
855
867
|
}
|
|
856
|
-
|
|
868
|
+
b = M(t, b, h.options);
|
|
857
869
|
}
|
|
858
|
-
c +=
|
|
870
|
+
c += b;
|
|
859
871
|
}
|
|
860
872
|
return c;
|
|
861
873
|
}, vt = function(t, e) {
|
|
862
|
-
return new Intl.NumberFormat(
|
|
874
|
+
return new Intl.NumberFormat(i(this, $).get(), e).format(t);
|
|
875
|
+
}, kt = function(t, e) {
|
|
876
|
+
return new Intl.DateTimeFormat(i(this, $).get(), e).format(S(t) ? new Date(t) : t);
|
|
863
877
|
}, Et = function(t, e) {
|
|
864
|
-
return new Intl.
|
|
865
|
-
}, $t = function(t, e) {
|
|
866
|
-
return new Intl.ListFormat(a(this, b).value, e).format(t);
|
|
878
|
+
return new Intl.ListFormat(i(this, $).get(), e).format(t);
|
|
867
879
|
}, // relativeTime(): State<string> {
|
|
868
880
|
// }
|
|
869
881
|
Ht = function(t, e) {
|
|
870
|
-
for (const s of
|
|
882
|
+
for (const s of i(this, X))
|
|
871
883
|
if (s[0] === t && Jt(s[1], e))
|
|
872
884
|
return s[2];
|
|
873
885
|
};
|
|
874
|
-
function Re(
|
|
875
|
-
const e = String(t).split(/[\.\[\]]/).filter((
|
|
876
|
-
let s =
|
|
886
|
+
function Re(a, t) {
|
|
887
|
+
const e = String(t).split(/[\.\[\]]/).filter((r) => r.trim() !== "");
|
|
888
|
+
let s = a;
|
|
877
889
|
for (; e.length > 0; ) {
|
|
878
|
-
const
|
|
879
|
-
s != null ? s = s[
|
|
890
|
+
const r = e.shift();
|
|
891
|
+
s != null ? s = s[r] : s = void 0;
|
|
880
892
|
}
|
|
881
893
|
return s;
|
|
882
894
|
}
|
|
883
|
-
function _e(
|
|
895
|
+
function _e(a) {
|
|
884
896
|
return Mt`
|
|
885
897
|
<div
|
|
886
898
|
style=${{
|
|
@@ -894,8 +906,8 @@ function _e(i) {
|
|
|
894
906
|
>
|
|
895
907
|
<h1 style=${{ marginBottom: "0.5rem" }}>The app has crashed</h1>
|
|
896
908
|
<p style=${{ marginBottom: "0.25rem" }}>
|
|
897
|
-
<span style=${{ fontFamily: "monospace" }}>${
|
|
898
|
-
${Xt(
|
|
909
|
+
<span style=${{ fontFamily: "monospace" }}>${a.loggerName}</span>
|
|
910
|
+
${Xt(a.uid, Mt`<span style=${{ fontFamily: "monospace", opacity: 0.5 }}> [uid: ${a.uid}]</span>`)}
|
|
899
911
|
${" "}says:
|
|
900
912
|
</p>
|
|
901
913
|
<blockquote
|
|
@@ -918,102 +930,102 @@ function _e(i) {
|
|
|
918
930
|
fontWeight: "bold"
|
|
919
931
|
}}
|
|
920
932
|
>
|
|
921
|
-
${
|
|
933
|
+
${a.error.name}
|
|
922
934
|
</span>
|
|
923
|
-
${
|
|
935
|
+
${a.error.message}
|
|
924
936
|
</blockquote>
|
|
925
937
|
|
|
926
938
|
<p>Please see the browser console for details.</p>
|
|
927
939
|
</div>
|
|
928
940
|
`;
|
|
929
941
|
}
|
|
930
|
-
var L,
|
|
942
|
+
var P, tt, L, I, et, A, st, nt, rt, at, F, it, ot, dt;
|
|
931
943
|
class Se {
|
|
932
944
|
constructor() {
|
|
933
945
|
// TODO: Take these off the global Dolla object.
|
|
934
946
|
w(this, "http");
|
|
935
947
|
w(this, "i18n");
|
|
936
|
-
u(this,
|
|
937
|
-
u(this,
|
|
938
|
-
u(this,
|
|
939
|
-
u(this,
|
|
940
|
-
u(this,
|
|
941
|
-
u(this,
|
|
942
|
-
u(this,
|
|
948
|
+
u(this, P, !1);
|
|
949
|
+
u(this, tt, "production");
|
|
950
|
+
u(this, L);
|
|
951
|
+
u(this, I);
|
|
952
|
+
u(this, et, _e);
|
|
953
|
+
u(this, A);
|
|
954
|
+
u(this, st, []);
|
|
943
955
|
u(this, nt, []);
|
|
956
|
+
u(this, rt, []);
|
|
944
957
|
u(this, at, []);
|
|
945
|
-
u(this,
|
|
946
|
-
u(this, O, {
|
|
958
|
+
u(this, F, {
|
|
947
959
|
root: this,
|
|
948
960
|
stores: /* @__PURE__ */ new Map(),
|
|
949
961
|
viewName: "Dolla"
|
|
950
962
|
});
|
|
951
|
-
u(this,
|
|
963
|
+
u(this, it, {
|
|
952
964
|
info: "development",
|
|
953
965
|
log: "development",
|
|
954
966
|
warn: "development",
|
|
955
967
|
error: !0
|
|
956
968
|
});
|
|
957
|
-
u(this,
|
|
969
|
+
u(this, ot, xt("*,-Dolla.*"));
|
|
958
970
|
// Registration functions for modules.
|
|
959
971
|
// All modules will be registered before mount.
|
|
960
972
|
u(this, dt, []);
|
|
961
|
-
this.http = new ge(), this.i18n = new
|
|
973
|
+
this.http = new ge(), this.i18n = new $e(this);
|
|
962
974
|
}
|
|
963
975
|
/**
|
|
964
976
|
* True when the app is connected to a DOM node and displayed to the user.
|
|
965
977
|
*/
|
|
966
978
|
get isMounted() {
|
|
967
|
-
return
|
|
979
|
+
return i(this, P);
|
|
968
980
|
}
|
|
969
981
|
/**
|
|
970
982
|
* Get the current environment that this app is running in.
|
|
971
983
|
* Environment affects which log messages will print and how much debugging info is included in the DOM.
|
|
972
984
|
*/
|
|
973
985
|
getEnv() {
|
|
974
|
-
return
|
|
986
|
+
return i(this, tt);
|
|
975
987
|
}
|
|
976
988
|
/**
|
|
977
989
|
* Sets the environment that this app is running in.
|
|
978
990
|
* Environment affects which log messages will print and how much debugging info is included in the DOM.
|
|
979
991
|
*/
|
|
980
992
|
setEnv(t) {
|
|
981
|
-
d(this,
|
|
993
|
+
d(this, tt, t);
|
|
982
994
|
}
|
|
983
995
|
/**
|
|
984
996
|
* Sets the view that will be shown when the `crash` method is called on any logger.
|
|
985
997
|
* When a crash is reported the app will be unmounted and replaced with this crash page.
|
|
986
998
|
*/
|
|
987
999
|
setCrashView(t) {
|
|
988
|
-
d(this,
|
|
1000
|
+
d(this, et, t);
|
|
989
1001
|
}
|
|
990
1002
|
/**
|
|
991
1003
|
* Returns the HTMLElement Dolla is mounted to. This will return undefined until Dolla.mount() is called.
|
|
992
1004
|
*/
|
|
993
1005
|
getRootElement() {
|
|
994
|
-
return
|
|
1006
|
+
return i(this, L);
|
|
995
1007
|
}
|
|
996
1008
|
/**
|
|
997
1009
|
* Returns the top level view Dolla is rendering inside the root element. This will return undefined until Dolla.mount() is called.
|
|
998
1010
|
*/
|
|
999
1011
|
getRootView() {
|
|
1000
|
-
return
|
|
1012
|
+
return i(this, I);
|
|
1001
1013
|
}
|
|
1002
1014
|
provide(t, e) {
|
|
1003
1015
|
const s = new Yt(t, e);
|
|
1004
|
-
if (s.attach(
|
|
1016
|
+
if (s.attach(i(this, F)))
|
|
1005
1017
|
return s.value;
|
|
1006
1018
|
{
|
|
1007
|
-
let
|
|
1008
|
-
return console.warn(`An instance of ${
|
|
1019
|
+
let n = t.name ? `'${t.name}'` : "this store";
|
|
1020
|
+
return console.warn(`An instance of ${n} was already attached to this context.`), this.get(t);
|
|
1009
1021
|
}
|
|
1010
1022
|
}
|
|
1011
1023
|
/**
|
|
1012
1024
|
* Gets the nearest instance of a store. Throws an error if the store isn't provided higher in the tree.
|
|
1013
1025
|
*/
|
|
1014
1026
|
get(t) {
|
|
1015
|
-
if (
|
|
1016
|
-
const e =
|
|
1027
|
+
if (H(t)) {
|
|
1028
|
+
const e = i(this, F).stores.get(t);
|
|
1017
1029
|
if (e == null)
|
|
1018
1030
|
throw new Tt("Store not found on this context.");
|
|
1019
1031
|
return e.value;
|
|
@@ -1021,26 +1033,26 @@ class Se {
|
|
|
1021
1033
|
throw new Tt("Invalid store.");
|
|
1022
1034
|
}
|
|
1023
1035
|
async mount(t, e) {
|
|
1024
|
-
if (
|
|
1036
|
+
if (i(this, P))
|
|
1025
1037
|
throw new Error("Dolla is already mounted.");
|
|
1026
|
-
if (
|
|
1027
|
-
const
|
|
1028
|
-
Nt(HTMLElement,
|
|
1038
|
+
if (S(t)) {
|
|
1039
|
+
const n = document.querySelector(t);
|
|
1040
|
+
Nt(HTMLElement, n, `Selector '${t}' did not match any element.`), d(this, L, n);
|
|
1029
1041
|
} else
|
|
1030
|
-
Nt(HTMLElement, t, "Expected an HTML element or a selector string. Got type: %t, value: %v"), d(this,
|
|
1031
|
-
pt(e) && d(this,
|
|
1032
|
-
const s = pt(e) ? jt : e,
|
|
1033
|
-
d(this,
|
|
1034
|
-
for (const
|
|
1035
|
-
|
|
1036
|
-
for (const
|
|
1037
|
-
|
|
1042
|
+
Nt(HTMLElement, t, "Expected an HTML element or a selector string. Got type: %t, value: %v"), d(this, L, t);
|
|
1043
|
+
pt(e) && d(this, A, e);
|
|
1044
|
+
const s = pt(e) ? jt : e, r = Zt(s);
|
|
1045
|
+
d(this, I, this.constructView(r.type, r.props)), await Promise.all(i(this, dt).map((n) => n())), pt(e) && await le(e, this), await Promise.all(i(this, st).map((n) => n())), i(this, I).mount(i(this, L)), d(this, P, !0);
|
|
1046
|
+
for (const n of i(this, F).stores.values())
|
|
1047
|
+
n.handleMount();
|
|
1048
|
+
for (const n of i(this, nt))
|
|
1049
|
+
n();
|
|
1038
1050
|
}
|
|
1039
1051
|
async unmount() {
|
|
1040
1052
|
var t;
|
|
1041
|
-
if (
|
|
1042
|
-
await Promise.all(
|
|
1043
|
-
for (const e of
|
|
1053
|
+
if (i(this, P)) {
|
|
1054
|
+
await Promise.all(i(this, rt).map((e) => e())), (t = i(this, I)) == null || t.unmount(!1), i(this, A) && await ce(i(this, A)), d(this, P, !1);
|
|
1055
|
+
for (const e of i(this, at))
|
|
1044
1056
|
e();
|
|
1045
1057
|
}
|
|
1046
1058
|
}
|
|
@@ -1049,26 +1061,26 @@ class Se {
|
|
|
1049
1061
|
* it will be awaited before mounting finishes. Use this to perform initial setup before the app is displayed to the user.
|
|
1050
1062
|
*/
|
|
1051
1063
|
beforeMount(t) {
|
|
1052
|
-
|
|
1064
|
+
i(this, st).push(t);
|
|
1053
1065
|
}
|
|
1054
1066
|
/**
|
|
1055
1067
|
* Registers a `callback` to run after the app is mounted.
|
|
1056
1068
|
*/
|
|
1057
1069
|
onMount(t) {
|
|
1058
|
-
|
|
1070
|
+
i(this, nt).push(t);
|
|
1059
1071
|
}
|
|
1060
1072
|
/**
|
|
1061
1073
|
* Registers a `callback` to run after `Dolla.unmount` is called, before the app is unmounted. If `callback` returns a Promise,
|
|
1062
1074
|
* it will be awaited before unmounting finishes. Use this to perform cleanup.
|
|
1063
1075
|
*/
|
|
1064
1076
|
beforeUnmount(t) {
|
|
1065
|
-
|
|
1077
|
+
i(this, rt).push(t);
|
|
1066
1078
|
}
|
|
1067
1079
|
/**
|
|
1068
1080
|
* Registers a `callback` to run after the app is unmounted.
|
|
1069
1081
|
*/
|
|
1070
1082
|
onUnmount(t) {
|
|
1071
|
-
|
|
1083
|
+
i(this, at).push(t);
|
|
1072
1084
|
}
|
|
1073
1085
|
/**
|
|
1074
1086
|
* Update log type toggles. Values that are not passed will remain unchanged.
|
|
@@ -1076,22 +1088,22 @@ class Se {
|
|
|
1076
1088
|
setLoggles(t) {
|
|
1077
1089
|
for (const e in t) {
|
|
1078
1090
|
const s = t[e];
|
|
1079
|
-
s && (
|
|
1091
|
+
s && (i(this, it)[e] = s);
|
|
1080
1092
|
}
|
|
1081
1093
|
}
|
|
1082
1094
|
setLogFilter(t) {
|
|
1083
|
-
d(this,
|
|
1095
|
+
d(this, ot, xt(t));
|
|
1084
1096
|
}
|
|
1085
1097
|
createLogger(t, e) {
|
|
1086
|
-
const s = (e == null ? void 0 : e.console) ?? Me(),
|
|
1087
|
-
if (
|
|
1088
|
-
return
|
|
1098
|
+
const s = (e == null ? void 0 : e.console) ?? Me(), r = this, n = i(this, it), o = (c) => {
|
|
1099
|
+
if (n[c] === !1 || S(n[c]) && n[c] !== r.getEnv() || !i(this, ot).call(this, t))
|
|
1100
|
+
return ne;
|
|
1089
1101
|
{
|
|
1090
1102
|
let l = `%c${t}`;
|
|
1091
1103
|
return e != null && e.uid ? l += ` %c[uid: %c${e.uid}%c]` : l += "%c%c%c", s[c].bind(
|
|
1092
1104
|
s,
|
|
1093
1105
|
l,
|
|
1094
|
-
`color:${
|
|
1106
|
+
`color:${re(l)};font-weight:bold`,
|
|
1095
1107
|
"color:#777",
|
|
1096
1108
|
"color:#aaa",
|
|
1097
1109
|
"color:#777"
|
|
@@ -1115,11 +1127,11 @@ class Se {
|
|
|
1115
1127
|
return o("error");
|
|
1116
1128
|
},
|
|
1117
1129
|
crash(c) {
|
|
1118
|
-
|
|
1130
|
+
r.isMounted && (r.unmount(), r.constructView(i(r, et), {
|
|
1119
1131
|
error: c,
|
|
1120
1132
|
loggerName: t,
|
|
1121
1133
|
uid: e == null ? void 0 : e.uid
|
|
1122
|
-
}).mount(
|
|
1134
|
+
}).mount(i(r, L)));
|
|
1123
1135
|
}
|
|
1124
1136
|
};
|
|
1125
1137
|
}
|
|
@@ -1127,16 +1139,16 @@ class Se {
|
|
|
1127
1139
|
*
|
|
1128
1140
|
*/
|
|
1129
1141
|
constructView(t, e, s = []) {
|
|
1130
|
-
return new te(
|
|
1142
|
+
return new te(i(this, F), t, e, s);
|
|
1131
1143
|
}
|
|
1132
1144
|
/**
|
|
1133
1145
|
*
|
|
1134
1146
|
*/
|
|
1135
1147
|
constructMarkup(t) {
|
|
1136
|
-
return ee(se(
|
|
1148
|
+
return ee(se(i(this, F), t));
|
|
1137
1149
|
}
|
|
1138
1150
|
}
|
|
1139
|
-
|
|
1151
|
+
P = new WeakMap(), tt = new WeakMap(), L = new WeakMap(), I = new WeakMap(), et = new WeakMap(), A = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), at = new WeakMap(), F = new WeakMap(), it = new WeakMap(), ot = new WeakMap(), dt = new WeakMap();
|
|
1140
1152
|
function Me() {
|
|
1141
1153
|
if (typeof window < "u" && window.console)
|
|
1142
1154
|
return window.console;
|
|
@@ -1146,22 +1158,23 @@ function Me() {
|
|
|
1146
1158
|
const Pt = new Se(), Le = Pt.i18n.t.bind(Pt.i18n);
|
|
1147
1159
|
export {
|
|
1148
1160
|
Ut as atom,
|
|
1149
|
-
|
|
1161
|
+
O as compose,
|
|
1150
1162
|
Xt as cond,
|
|
1151
1163
|
Zt as createMarkup,
|
|
1152
1164
|
Pe as createRouter,
|
|
1153
1165
|
Jt as deepEqual,
|
|
1154
1166
|
Pt as default,
|
|
1155
1167
|
Ue as effect,
|
|
1156
|
-
|
|
1168
|
+
lt as get,
|
|
1169
|
+
je as getTracked,
|
|
1157
1170
|
Mt as html,
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1171
|
+
Ce as list,
|
|
1172
|
+
Ie as peek,
|
|
1173
|
+
Ve as portal,
|
|
1161
1174
|
Ne as ref,
|
|
1162
|
-
|
|
1175
|
+
De as set,
|
|
1163
1176
|
_t as shallowEqual,
|
|
1164
|
-
|
|
1177
|
+
qe as strictEqual,
|
|
1165
1178
|
Le as t
|
|
1166
1179
|
};
|
|
1167
1180
|
//# sourceMappingURL=index.js.map
|