@manyducks.co/dolla 2.0.0-alpha.16 → 2.0.0-alpha.17
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/index.js +535 -498
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/modules/dolla.d.ts +3 -2
- package/dist/passthrough-J9nMzwTV.js +1391 -0
- package/dist/passthrough-J9nMzwTV.js.map +1 -0
- package/dist/utils.d.ts +0 -1
- package/dist/view.d.ts +24 -3
- package/package.json +1 -1
- package/dist/passthrough-DUh0_zQF.js +0 -1398
- package/dist/passthrough-DUh0_zQF.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
2
|
var ct = (i) => {
|
|
3
3
|
throw TypeError(i);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var S = (i, e, t) =>
|
|
7
|
-
var s = (i, e, t) => (Je(i, e, "read from private field"), t ? t.call(i) : e.get(i)),
|
|
5
|
+
var Lt = (i, e, t) => e in i ? xt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
6
|
+
var S = (i, e, t) => Lt(i, typeof e != "symbol" ? e + "" : e, t), Je = (i, e, t) => e.has(i) || ct("Cannot " + t);
|
|
7
|
+
var s = (i, e, t) => (Je(i, e, "read from private field"), t ? t.call(i) : e.get(i)), h = (i, e, t) => e.has(i) ? ct("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), b = (i, e, t, r) => (Je(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t), $ = (i, e, t) => (Je(i, e, "access private method"), t);
|
|
8
8
|
var ut = (i, e, t, r) => ({
|
|
9
|
-
set _(
|
|
10
|
-
b(i, e,
|
|
9
|
+
set _(n) {
|
|
10
|
+
b(i, e, n, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
13
|
return s(i, e, r);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { h as ht, c as Rt, i as
|
|
17
|
-
import {
|
|
18
|
-
function
|
|
16
|
+
import { h as ht, c as Rt, i as Xe, g as Dt, a as ie, d as ye, b as lt, e as C, t as ft, f as vt, j as Nt, k as Ze, P as Et, l as dt, m as jt, n as Mt, o as Tt, v as qt, p as At, q as _t, r as pt, s as gt, u as Ft, w as _e, x as Fe, V as Ct, y as Vt, z as Ut } from "./passthrough-J9nMzwTV.js";
|
|
17
|
+
import { A as br, B as vr, C as Er } from "./passthrough-J9nMzwTV.js";
|
|
18
|
+
function Ht(i) {
|
|
19
19
|
return ht`
|
|
20
20
|
<div
|
|
21
21
|
style=${{
|
|
@@ -62,12 +62,12 @@ function Vt(i) {
|
|
|
62
62
|
</div>
|
|
63
63
|
`;
|
|
64
64
|
}
|
|
65
|
-
var J, ze,
|
|
66
|
-
class
|
|
65
|
+
var J, ze, j, A;
|
|
66
|
+
class It {
|
|
67
67
|
constructor() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
h(this, j);
|
|
69
|
+
h(this, J, []);
|
|
70
|
+
h(this, ze, Wt());
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Adds a new middleware that will apply to subsequent requests.
|
|
@@ -81,32 +81,32 @@ class qt {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
async get(e, t) {
|
|
84
|
-
return
|
|
84
|
+
return $(this, j, A).call(this, "get", e, t);
|
|
85
85
|
}
|
|
86
86
|
async put(e, t) {
|
|
87
|
-
return
|
|
87
|
+
return $(this, j, A).call(this, "put", e, t);
|
|
88
88
|
}
|
|
89
89
|
async patch(e, t) {
|
|
90
|
-
return
|
|
90
|
+
return $(this, j, A).call(this, "patch", e, t);
|
|
91
91
|
}
|
|
92
92
|
async post(e, t) {
|
|
93
|
-
return
|
|
93
|
+
return $(this, j, A).call(this, "post", e, t);
|
|
94
94
|
}
|
|
95
95
|
async delete(e, t) {
|
|
96
|
-
return
|
|
96
|
+
return $(this, j, A).call(this, "delete", e, t);
|
|
97
97
|
}
|
|
98
98
|
async head(e, t) {
|
|
99
|
-
return
|
|
99
|
+
return $(this, j, A).call(this, "head", e, t);
|
|
100
100
|
}
|
|
101
101
|
async options(e, t) {
|
|
102
|
-
return
|
|
102
|
+
return $(this, j, A).call(this, "options", e, t);
|
|
103
103
|
}
|
|
104
104
|
async trace(e, t) {
|
|
105
|
-
return
|
|
105
|
+
return $(this, j, A).call(this, "trace", e, t);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
J = new WeakMap(), ze = new WeakMap(),
|
|
109
|
-
return
|
|
108
|
+
J = new WeakMap(), ze = new WeakMap(), j = new WeakSet(), A = async function(e, t, r) {
|
|
109
|
+
return Bt({
|
|
110
110
|
...r,
|
|
111
111
|
method: e,
|
|
112
112
|
uri: t,
|
|
@@ -114,27 +114,27 @@ J = new WeakMap(), ze = new WeakMap(), T = new WeakSet(), j = async function(e,
|
|
|
114
114
|
fetch: s(this, ze)
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
|
-
function
|
|
117
|
+
function Wt() {
|
|
118
118
|
if (typeof window < "u" && window.fetch)
|
|
119
119
|
return window.fetch.bind(window);
|
|
120
120
|
if (typeof global < "u" && global.fetch)
|
|
121
121
|
return global.fetch.bind(global);
|
|
122
122
|
throw new Error("Running in neither browser nor node. Please run this app in one of the supported environments.");
|
|
123
123
|
}
|
|
124
|
-
class
|
|
124
|
+
class Gt extends Error {
|
|
125
125
|
constructor(t) {
|
|
126
|
-
const { status: r, statusText:
|
|
127
|
-
super(
|
|
126
|
+
const { status: r, statusText: n, method: a, uri: o } = t, p = `${r} ${n}: Request failed (${a.toUpperCase()} ${o})`;
|
|
127
|
+
super(p);
|
|
128
128
|
S(this, "response");
|
|
129
129
|
this.response = t;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
async function
|
|
133
|
-
const { headers: e, query: t, fetch: r, middleware:
|
|
132
|
+
async function Bt(i) {
|
|
133
|
+
const { headers: e, query: t, fetch: r, middleware: n } = i, a = {
|
|
134
134
|
method: i.method,
|
|
135
135
|
uri: i.uri,
|
|
136
136
|
get sameOrigin() {
|
|
137
|
-
return !
|
|
137
|
+
return !a.uri.startsWith("http");
|
|
138
138
|
},
|
|
139
139
|
query: new URLSearchParams(),
|
|
140
140
|
headers: new Headers(),
|
|
@@ -142,80 +142,110 @@ async function It(i) {
|
|
|
142
142
|
};
|
|
143
143
|
if (e)
|
|
144
144
|
if (e instanceof Map || e instanceof Headers)
|
|
145
|
-
e.forEach((l,
|
|
146
|
-
|
|
145
|
+
e.forEach((l, f) => {
|
|
146
|
+
a.headers.set(f, l);
|
|
147
147
|
});
|
|
148
148
|
else if (e != null && typeof e == "object" && !Array.isArray(e))
|
|
149
149
|
for (const l in e) {
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const f = e[l];
|
|
151
|
+
f instanceof Date ? a.headers.set(l, f.toISOString()) : f != null && a.headers.set(l, String(f));
|
|
152
152
|
}
|
|
153
153
|
else
|
|
154
154
|
throw new TypeError(`Unknown headers type. Got: ${e}`);
|
|
155
155
|
if (t)
|
|
156
156
|
if (t instanceof Map || t instanceof URLSearchParams)
|
|
157
|
-
t.forEach((l,
|
|
158
|
-
|
|
157
|
+
t.forEach((l, f) => {
|
|
158
|
+
a.query.set(f, l);
|
|
159
159
|
});
|
|
160
160
|
else if (t != null && typeof t == "object" && !Array.isArray(t))
|
|
161
161
|
for (const l in t) {
|
|
162
|
-
const
|
|
163
|
-
|
|
162
|
+
const f = t[l];
|
|
163
|
+
f instanceof Date ? a.query.set(l, f.toISOString()) : f != null && a.query.set(l, String(f));
|
|
164
164
|
}
|
|
165
165
|
else
|
|
166
166
|
throw new TypeError(`Unknown query params type. Got: ${t}`);
|
|
167
167
|
let o;
|
|
168
|
-
const
|
|
169
|
-
const l =
|
|
170
|
-
let
|
|
171
|
-
!
|
|
172
|
-
const
|
|
173
|
-
method:
|
|
174
|
-
headers:
|
|
175
|
-
body:
|
|
176
|
-
}), u = Object.fromEntries(
|
|
168
|
+
const p = async () => {
|
|
169
|
+
const l = a.query.toString(), f = l.length > 0 ? a.uri + "?" + l : a.uri;
|
|
170
|
+
let m;
|
|
171
|
+
!a.headers.has("content-type") && Xe(a.body) ? (a.headers.set("content-type", "application/json"), m = JSON.stringify(a.body)) : m = a.body;
|
|
172
|
+
const g = await r(f, {
|
|
173
|
+
method: a.method,
|
|
174
|
+
headers: a.headers,
|
|
175
|
+
body: m
|
|
176
|
+
}), u = Object.fromEntries(g.headers.entries()), y = u["content-type"];
|
|
177
177
|
let k;
|
|
178
|
-
y != null && y.includes("application/json") ? k = await
|
|
179
|
-
method:
|
|
180
|
-
uri:
|
|
181
|
-
status:
|
|
182
|
-
statusText:
|
|
178
|
+
y != null && y.includes("application/json") ? k = await g.json() : y != null && y.includes("application/x-www-form-urlencoded") ? k = await g.formData() : k = await g.text(), o = {
|
|
179
|
+
method: a.method,
|
|
180
|
+
uri: a.uri,
|
|
181
|
+
status: g.status,
|
|
182
|
+
statusText: g.statusText,
|
|
183
183
|
headers: u,
|
|
184
184
|
body: k
|
|
185
185
|
};
|
|
186
186
|
};
|
|
187
|
-
if (
|
|
188
|
-
const l = (
|
|
189
|
-
const
|
|
190
|
-
return async () =>
|
|
187
|
+
if (n.length > 0) {
|
|
188
|
+
const l = (f = 0) => {
|
|
189
|
+
const m = n[f], g = n[f + 1] ? l(f + 1) : p;
|
|
190
|
+
return async () => m(a, async () => (await g(), o));
|
|
191
191
|
};
|
|
192
192
|
await l()();
|
|
193
193
|
} else
|
|
194
|
-
await
|
|
194
|
+
await p();
|
|
195
195
|
if (o.status < 200 || o.status >= 400)
|
|
196
|
-
throw new
|
|
196
|
+
throw new Gt(o);
|
|
197
197
|
return o;
|
|
198
198
|
}
|
|
199
|
+
var Ye, mt;
|
|
200
|
+
function zt() {
|
|
201
|
+
return mt || (mt = 1, Ye = function i(e, t) {
|
|
202
|
+
if (e === t) return !0;
|
|
203
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
204
|
+
if (e.constructor !== t.constructor) return !1;
|
|
205
|
+
var r, n, a;
|
|
206
|
+
if (Array.isArray(e)) {
|
|
207
|
+
if (r = e.length, r != t.length) return !1;
|
|
208
|
+
for (n = r; n-- !== 0; )
|
|
209
|
+
if (!i(e[n], t[n])) return !1;
|
|
210
|
+
return !0;
|
|
211
|
+
}
|
|
212
|
+
if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
|
|
213
|
+
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
|
|
214
|
+
if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
|
|
215
|
+
if (a = Object.keys(e), r = a.length, r !== Object.keys(t).length) return !1;
|
|
216
|
+
for (n = r; n-- !== 0; )
|
|
217
|
+
if (!Object.prototype.hasOwnProperty.call(t, a[n])) return !1;
|
|
218
|
+
for (n = r; n-- !== 0; ) {
|
|
219
|
+
var o = a[n];
|
|
220
|
+
if (!i(e[o], t[o])) return !1;
|
|
221
|
+
}
|
|
222
|
+
return !0;
|
|
223
|
+
}
|
|
224
|
+
return e !== e && t !== t;
|
|
225
|
+
}), Ye;
|
|
226
|
+
}
|
|
227
|
+
var Kt = zt();
|
|
228
|
+
const Qt = /* @__PURE__ */ Dt(Kt);
|
|
199
229
|
var Ke, oe, re, et, $t;
|
|
200
|
-
class
|
|
230
|
+
class Jt {
|
|
201
231
|
constructor(e, t) {
|
|
202
|
-
|
|
232
|
+
h(this, re);
|
|
203
233
|
S(this, "dolla");
|
|
204
234
|
S(this, "config");
|
|
205
|
-
|
|
206
|
-
|
|
235
|
+
h(this, Ke, !1);
|
|
236
|
+
h(this, oe, /* @__PURE__ */ new Map());
|
|
207
237
|
this.config = e, this.dolla = t;
|
|
208
238
|
}
|
|
209
239
|
async load() {
|
|
210
240
|
let e;
|
|
211
241
|
if (!s(this, Ke)) {
|
|
212
242
|
if (lt(this.config.fetch)) {
|
|
213
|
-
if (e = await this.config.fetch(), !
|
|
243
|
+
if (e = await this.config.fetch(), !Xe(e))
|
|
214
244
|
throw new Error(`Fetch function did not return an object of language strings: ${e}`);
|
|
215
|
-
} else if (
|
|
245
|
+
} else if (C(this.config.path)) {
|
|
216
246
|
const t = await this.dolla.http.get(this.config.path);
|
|
217
247
|
if (t.status >= 200 && t.status < 300)
|
|
218
|
-
if (
|
|
248
|
+
if (Xe(t.body))
|
|
219
249
|
e = t.body;
|
|
220
250
|
else
|
|
221
251
|
throw new Error(
|
|
@@ -226,7 +256,7 @@ class Wt {
|
|
|
226
256
|
}
|
|
227
257
|
}
|
|
228
258
|
if (e) {
|
|
229
|
-
const t =
|
|
259
|
+
const t = $(this, re, et).call(this, e);
|
|
230
260
|
for (const r of t)
|
|
231
261
|
s(this, oe).set(r[0], r[1]);
|
|
232
262
|
} else
|
|
@@ -243,17 +273,17 @@ class Wt {
|
|
|
243
273
|
}
|
|
244
274
|
Ke = new WeakMap(), oe = new WeakMap(), re = new WeakSet(), et = function(e, t = []) {
|
|
245
275
|
const r = [];
|
|
246
|
-
for (const
|
|
247
|
-
switch (ft(e[
|
|
276
|
+
for (const n in e)
|
|
277
|
+
switch (ft(e[n])) {
|
|
248
278
|
case "string":
|
|
249
|
-
r.push([[...t,
|
|
279
|
+
r.push([[...t, n].join("."), $(this, re, $t).call(this, e[n])]);
|
|
250
280
|
break;
|
|
251
281
|
case "object":
|
|
252
|
-
r.push(
|
|
282
|
+
r.push(...$(this, re, et).call(this, e[n], [...t, n]));
|
|
253
283
|
break;
|
|
254
284
|
default:
|
|
255
285
|
throw new Error(
|
|
256
|
-
`Expected to find a string or object at ${[...t,
|
|
286
|
+
`Expected to find a string or object at ${[...t, n].join(".")}. Got: ${ft(e[n])}`
|
|
257
287
|
);
|
|
258
288
|
}
|
|
259
289
|
return r;
|
|
@@ -265,104 +295,104 @@ Ke = new WeakMap(), oe = new WeakMap(), re = new WeakSet(), et = function(e, t =
|
|
|
265
295
|
const r = {
|
|
266
296
|
segments: []
|
|
267
297
|
};
|
|
268
|
-
let
|
|
269
|
-
const
|
|
270
|
-
|
|
298
|
+
let n = "", a = 0, o = 0, p, l, f;
|
|
299
|
+
const m = () => {
|
|
300
|
+
p = {
|
|
271
301
|
type: 1,
|
|
272
302
|
name: "",
|
|
273
303
|
formats: []
|
|
274
304
|
};
|
|
275
|
-
},
|
|
305
|
+
}, g = () => {
|
|
276
306
|
l = {
|
|
277
307
|
name: "",
|
|
278
308
|
options: {}
|
|
279
309
|
};
|
|
280
310
|
};
|
|
281
|
-
for (;
|
|
282
|
-
if (o !== 0 && e[
|
|
283
|
-
|
|
311
|
+
for (; a < e.length; ) {
|
|
312
|
+
if (o !== 0 && e[a] === " ") {
|
|
313
|
+
a++;
|
|
284
314
|
continue;
|
|
285
315
|
}
|
|
286
316
|
switch (o) {
|
|
287
317
|
case 0:
|
|
288
|
-
e[
|
|
318
|
+
e[a] === "{" && e[a + 1] === "{" ? (o = 1, a += 2, n.length > 0 && (r.segments.push({ type: 0, text: n }), n = ""), m()) : (n += e[a], a++);
|
|
289
319
|
break;
|
|
290
320
|
case 1:
|
|
291
|
-
e[
|
|
321
|
+
e[a] === "|" ? (o = 2, a += 1, p.name = n, n = "", g()) : e[a] === "}" && e[a + 1] === "}" ? (o = 0, a += 2, p.name = n, n = "", r.segments.push(p)) : (n += e[a], a++);
|
|
292
322
|
break;
|
|
293
323
|
case 2:
|
|
294
|
-
e[
|
|
324
|
+
e[a] === "(" ? (o = 3, a += 1, l.name = n, n = "") : e[a] === "}" && e[a + 1] === "}" ? (o = 0, a += 2, p.formats.push(l), r.segments.push(p)) : (n += e[a], a++);
|
|
295
325
|
break;
|
|
296
326
|
case 3:
|
|
297
|
-
e[
|
|
327
|
+
e[a] === ")" || (e[a] === ":" ? (o = 4, a += 1, f = n, n = "") : e[a] === "}" && e[a + 1] === "}" || (n += e[a], a++));
|
|
298
328
|
break;
|
|
299
329
|
case 4:
|
|
300
|
-
e[
|
|
330
|
+
e[a] === ")" ? (o = 5, a += 1, l.options[f] = n, n = "", p.formats.push(l)) : e[a] === "," ? (o = 3, a += 1, l.options[f] = n, n = "") : e[a] === "}" && e[a + 1] === "}" || (n += e[a], a++);
|
|
301
331
|
break;
|
|
302
332
|
case 5:
|
|
303
|
-
e[
|
|
333
|
+
e[a] === "|" ? (o = 2, a += 1, g()) : e[a] === "}" && e[a + 1] === "}" && (o = 0, a += 2, r.segments.push(p));
|
|
304
334
|
break;
|
|
305
335
|
}
|
|
306
336
|
}
|
|
307
|
-
return o === 0 &&
|
|
337
|
+
return o === 0 && n.length > 0 && r.segments.push({ type: 0, text: n }), r;
|
|
308
338
|
};
|
|
309
|
-
var ve,
|
|
310
|
-
class
|
|
339
|
+
var ve, V, L, Ee, $e, ke, Pe, R, kt, tt, rt, nt, Pt;
|
|
340
|
+
class Yt {
|
|
311
341
|
constructor(e) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
342
|
+
h(this, R);
|
|
343
|
+
h(this, ve);
|
|
344
|
+
h(this, V);
|
|
345
|
+
h(this, L, /* @__PURE__ */ new Map());
|
|
346
|
+
h(this, Ee, []);
|
|
347
|
+
h(this, $e, /* @__PURE__ */ new Map());
|
|
348
|
+
h(this, ke, "auto");
|
|
319
349
|
S(this, "$locale");
|
|
320
|
-
|
|
321
|
-
b(this, ve, e), b(this,
|
|
350
|
+
h(this, Pe);
|
|
351
|
+
b(this, ve, e), b(this, V, e.createLogger("dolla/i18n"));
|
|
322
352
|
const [t, r] = ie();
|
|
323
|
-
this.$locale = t, b(this, Pe, r), this.addFormat("number", (
|
|
324
|
-
s(this,
|
|
353
|
+
this.$locale = t, b(this, Pe, r), this.addFormat("number", (n, a, o) => $(this, R, tt).call(this, Number(a), o)), this.addFormat("datetime", (n, a, o) => $(this, R, rt).call(this, a, o)), this.addFormat("list", (n, a, o) => $(this, R, nt).call(this, a, o)), e.beforeMount(async () => {
|
|
354
|
+
s(this, L).size > 0 && await this.setLocale(s(this, ke));
|
|
325
355
|
});
|
|
326
356
|
}
|
|
327
357
|
get locales() {
|
|
328
|
-
return [...s(this,
|
|
358
|
+
return [...s(this, L).keys()];
|
|
329
359
|
}
|
|
330
360
|
setup(e) {
|
|
331
361
|
if (e.translations.forEach((t) => {
|
|
332
|
-
s(this,
|
|
362
|
+
s(this, L).set(t.locale, new Jt(t, s(this, ve)));
|
|
333
363
|
}), e.locale && e.locale !== "auto") {
|
|
334
364
|
if (!e.translations.some((r) => r.locale === e.locale))
|
|
335
365
|
throw new Error(`Initial locale '${e.locale}' is not registered in the locales array.`);
|
|
336
366
|
b(this, ke, e.locale);
|
|
337
367
|
}
|
|
338
|
-
s(this,
|
|
339
|
-
`${s(this,
|
|
368
|
+
s(this, V).info(
|
|
369
|
+
`${s(this, L).size} language${s(this, L).size === 1 ? "" : "s"} supported: '${[...s(this, L).keys()].join("', '")}'`
|
|
340
370
|
);
|
|
341
371
|
}
|
|
342
372
|
async setLocale(e) {
|
|
343
|
-
var
|
|
373
|
+
var n;
|
|
344
374
|
let t;
|
|
345
375
|
if (e === "auto") {
|
|
346
|
-
let
|
|
376
|
+
let a = [];
|
|
347
377
|
if (typeof navigator == "object") {
|
|
348
378
|
const o = navigator;
|
|
349
|
-
((
|
|
379
|
+
((n = o.languages) == null ? void 0 : n.length) > 0 ? a.push(...o.languages) : o.language ? a.push(o.language) : o.browserLanguage ? a.push(o.browserLanguage) : o.userLanguage && a.push(o.userLanguage);
|
|
350
380
|
}
|
|
351
|
-
for (const o of
|
|
352
|
-
s(this,
|
|
381
|
+
for (const o of a)
|
|
382
|
+
s(this, L).has(o) && (t = o);
|
|
353
383
|
} else
|
|
354
|
-
s(this,
|
|
384
|
+
s(this, L).has(e) && (t = e);
|
|
355
385
|
if (t == null) {
|
|
356
|
-
const
|
|
357
|
-
|
|
386
|
+
const a = s(this, L).keys().next().value;
|
|
387
|
+
a && (t = a);
|
|
358
388
|
}
|
|
359
|
-
if (!t || !s(this,
|
|
389
|
+
if (!t || !s(this, L).has(t))
|
|
360
390
|
throw new Error(`Locale '${e}' has no translation.`);
|
|
361
|
-
const r = s(this,
|
|
391
|
+
const r = s(this, L).get(t);
|
|
362
392
|
try {
|
|
363
|
-
await r.load(), b(this,
|
|
364
|
-
} catch (
|
|
365
|
-
|
|
393
|
+
await r.load(), b(this, Ee, []), s(this, Pe).call(this, t), s(this, V).info("set language to " + t);
|
|
394
|
+
} catch (a) {
|
|
395
|
+
a instanceof Error && s(this, V).crash(a);
|
|
366
396
|
}
|
|
367
397
|
}
|
|
368
398
|
/**
|
|
@@ -379,16 +409,16 @@ class Gt {
|
|
|
379
409
|
throw new Error(
|
|
380
410
|
`The 't' function cannot be destructured. If you need a standalone version you can import it like so: 'import { t } from "@manyducks.co/dolla"'`
|
|
381
411
|
);
|
|
382
|
-
let r = [],
|
|
383
|
-
for (const
|
|
384
|
-
r.push(
|
|
385
|
-
return ye([this.$locale, ...
|
|
386
|
-
if (
|
|
412
|
+
let r = [], n = [];
|
|
413
|
+
for (const a in t)
|
|
414
|
+
r.push(a), n.push(t[a]);
|
|
415
|
+
return ye([this.$locale, ...n], (a, ...o) => {
|
|
416
|
+
if (a == null)
|
|
387
417
|
return "[NO LOCALE SET]";
|
|
388
|
-
const
|
|
418
|
+
const p = {};
|
|
389
419
|
for (let l = 0; l < o.length; l++)
|
|
390
|
-
|
|
391
|
-
return
|
|
420
|
+
p[r[l]] = o[l];
|
|
421
|
+
return $(this, R, kt).call(this, a, e, p);
|
|
392
422
|
});
|
|
393
423
|
}
|
|
394
424
|
/**
|
|
@@ -406,7 +436,7 @@ class Gt {
|
|
|
406
436
|
* t("greeting", {name: "world"}); // State<"Hello, WORLD!">
|
|
407
437
|
*/
|
|
408
438
|
addFormat(e, t) {
|
|
409
|
-
s(this,
|
|
439
|
+
s(this, $e).set(e, t);
|
|
410
440
|
}
|
|
411
441
|
/**
|
|
412
442
|
* Creates an `Intl.Collator` configured for the current locale.
|
|
@@ -423,7 +453,7 @@ class Gt {
|
|
|
423
453
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
|
|
424
454
|
*/
|
|
425
455
|
number(e, t) {
|
|
426
|
-
return ye([this.$locale, e], (r,
|
|
456
|
+
return ye([this.$locale, e], (r, n) => $(this, R, tt).call(this, n, t));
|
|
427
457
|
}
|
|
428
458
|
/**
|
|
429
459
|
* Returns a State containing the date formatted for the current locale. Uses `Intl.DateTimeFormat` under the hood.
|
|
@@ -435,7 +465,7 @@ class Gt {
|
|
|
435
465
|
* const $formatted = Dolla.i18n.dateTime(date, { dateFormat: "short" });
|
|
436
466
|
*/
|
|
437
467
|
dateTime(e, t) {
|
|
438
|
-
return ye([this.$locale, e], (r,
|
|
468
|
+
return ye([this.$locale, e], (r, n) => $(this, R, rt).call(this, n, t));
|
|
439
469
|
}
|
|
440
470
|
/**
|
|
441
471
|
* Returns a State containing the date formatted for the current locale. Uses `Intl.DateTimeFormat` under the hood.
|
|
@@ -447,44 +477,44 @@ class Gt {
|
|
|
447
477
|
* const $formatted = Dolla.i18n.list(list, { });
|
|
448
478
|
*/
|
|
449
479
|
list(e, t) {
|
|
450
|
-
return ye([this.$locale, e], (r,
|
|
480
|
+
return ye([this.$locale, e], (r, n) => $(this, R, nt).call(this, n, t));
|
|
451
481
|
}
|
|
452
482
|
}
|
|
453
|
-
ve = new WeakMap(),
|
|
483
|
+
ve = new WeakMap(), V = new WeakMap(), L = new WeakMap(), Ee = new WeakMap(), $e = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), R = new WeakSet(), kt = function(e, t, r) {
|
|
454
484
|
var l;
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
const
|
|
485
|
+
const n = $(this, R, Pt).call(this, t, r);
|
|
486
|
+
if (n) return n;
|
|
487
|
+
const a = s(this, L).get(e);
|
|
458
488
|
if (r.context != null && (t += "_" + r.context), r.count != null)
|
|
459
489
|
if (r.ordinal) {
|
|
460
|
-
const
|
|
461
|
-
|
|
490
|
+
const f = `${t}_ordinal_(=${r.count})`;
|
|
491
|
+
a.hasTemplate(f) ? t = f : t += "_ordinal_" + new Intl.PluralRules(e, { type: "ordinal" }).select(r.count);
|
|
462
492
|
} else {
|
|
463
|
-
const
|
|
464
|
-
|
|
493
|
+
const f = `${t}_(=${r.count})`;
|
|
494
|
+
a.hasTemplate(f) ? t = f : t += "_" + new Intl.PluralRules(e).select(r.count);
|
|
465
495
|
}
|
|
466
|
-
const o =
|
|
467
|
-
let
|
|
468
|
-
for (const
|
|
469
|
-
if (
|
|
470
|
-
|
|
471
|
-
else if (
|
|
472
|
-
let
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
for (const u of
|
|
476
|
-
const y = s(this,
|
|
496
|
+
const o = a.getTemplate(t);
|
|
497
|
+
let p = "";
|
|
498
|
+
for (const f of o.segments)
|
|
499
|
+
if (f.type === 0)
|
|
500
|
+
p += f.text;
|
|
501
|
+
else if (f.type === 1) {
|
|
502
|
+
let m = Xt(r, f.name);
|
|
503
|
+
const g = ((l = r.formatOverrides) == null ? void 0 : l[f.name]) ?? [...f.formats];
|
|
504
|
+
f.name === "count" && g.length === 0 && g.push({ name: "number", options: {} });
|
|
505
|
+
for (const u of g) {
|
|
506
|
+
const y = s(this, $e).get(u.name);
|
|
477
507
|
if (y == null) {
|
|
478
508
|
const k = new Error(
|
|
479
509
|
`Failed to load format '${u.name}' when processing '${t}', template: ${o}`
|
|
480
510
|
);
|
|
481
|
-
throw s(this,
|
|
511
|
+
throw s(this, V).crash(k), k;
|
|
482
512
|
}
|
|
483
|
-
|
|
513
|
+
m = y(e, m, u.options);
|
|
484
514
|
}
|
|
485
|
-
|
|
515
|
+
p += m;
|
|
486
516
|
}
|
|
487
|
-
return
|
|
517
|
+
return p;
|
|
488
518
|
}, tt = function(e, t) {
|
|
489
519
|
return new Intl.NumberFormat(this.$locale.get(), t).format(e);
|
|
490
520
|
}, rt = function(e, t) {
|
|
@@ -495,34 +525,34 @@ ve = new WeakMap(), q = new WeakMap(), R = new WeakMap(), $e = new WeakMap(), Ee
|
|
|
495
525
|
return new Intl.ListFormat(this.$locale.get(), t).format(e);
|
|
496
526
|
}, // relativeTime(): State<string> {
|
|
497
527
|
// }
|
|
498
|
-
|
|
499
|
-
for (const r of s(this,
|
|
500
|
-
if (r[0] === e &&
|
|
528
|
+
Pt = function(e, t) {
|
|
529
|
+
for (const r of s(this, Ee))
|
|
530
|
+
if (r[0] === e && Qt(r[1], t))
|
|
501
531
|
return r[2];
|
|
502
532
|
};
|
|
503
|
-
function
|
|
504
|
-
const t = String(e).split(/[\.\[\]]/).filter((
|
|
533
|
+
function Xt(i, e) {
|
|
534
|
+
const t = String(e).split(/[\.\[\]]/).filter((n) => n.trim() !== "");
|
|
505
535
|
let r = i;
|
|
506
536
|
for (; t.length > 0; ) {
|
|
507
|
-
const
|
|
508
|
-
r != null ? r = r[
|
|
537
|
+
const n = t.shift();
|
|
538
|
+
r != null ? r = r[n] : r = void 0;
|
|
509
539
|
}
|
|
510
540
|
return r;
|
|
511
541
|
}
|
|
512
|
-
var Y, Se, U, H, le,
|
|
513
|
-
class
|
|
542
|
+
var Y, Se, U, H, le, _, ce, Ce;
|
|
543
|
+
class Zt {
|
|
514
544
|
constructor(e) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
545
|
+
h(this, ce);
|
|
546
|
+
h(this, Y);
|
|
547
|
+
h(this, Se);
|
|
518
548
|
// Keyed updates ensure only the most recent callback queued with a certain key
|
|
519
549
|
// will be called, keeping DOM operations to a minimum.
|
|
520
|
-
|
|
550
|
+
h(this, U, /* @__PURE__ */ new Map());
|
|
521
551
|
// All unkeyed updates are run on every batch.
|
|
522
|
-
|
|
552
|
+
h(this, H, []);
|
|
523
553
|
// All read callbacks are run before updates on every batch.
|
|
524
|
-
|
|
525
|
-
|
|
554
|
+
h(this, le, []);
|
|
555
|
+
h(this, _, !1);
|
|
526
556
|
b(this, Y, e), b(this, Se, e.createLogger("dolla/render"));
|
|
527
557
|
}
|
|
528
558
|
/**
|
|
@@ -536,7 +566,7 @@ class zt {
|
|
|
536
566
|
e(), r();
|
|
537
567
|
}) : s(this, H).push(() => {
|
|
538
568
|
e(), r();
|
|
539
|
-
}), !s(this,
|
|
569
|
+
}), !s(this, _) && s(this, Y).isMounted && (b(this, _, !0), $(this, ce, Ce).call(this));
|
|
540
570
|
});
|
|
541
571
|
}
|
|
542
572
|
/**
|
|
@@ -548,13 +578,13 @@ class zt {
|
|
|
548
578
|
return new Promise((t) => {
|
|
549
579
|
s(this, le).push(() => {
|
|
550
580
|
e(), t();
|
|
551
|
-
}), !s(this,
|
|
581
|
+
}), !s(this, _) && s(this, Y).isMounted && (b(this, _, !0), $(this, ce, Ce).call(this));
|
|
552
582
|
});
|
|
553
583
|
}
|
|
554
584
|
}
|
|
555
|
-
Y = new WeakMap(), Se = new WeakMap(), U = new WeakMap(), H = new WeakMap(), le = new WeakMap(),
|
|
585
|
+
Y = new WeakMap(), Se = new WeakMap(), U = new WeakMap(), H = new WeakMap(), le = new WeakMap(), _ = new WeakMap(), ce = new WeakSet(), Ce = function() {
|
|
556
586
|
const e = s(this, U).size + s(this, H).length;
|
|
557
|
-
if ((!s(this, Y).isMounted || e === 0) && b(this,
|
|
587
|
+
if ((!s(this, Y).isMounted || e === 0) && b(this, _, !1), !s(this, _)) {
|
|
558
588
|
for (const t of s(this, le))
|
|
559
589
|
t();
|
|
560
590
|
b(this, le, []);
|
|
@@ -567,7 +597,7 @@ Y = new WeakMap(), Se = new WeakMap(), U = new WeakMap(), H = new WeakMap(), le
|
|
|
567
597
|
s(this, U).clear();
|
|
568
598
|
for (const t of s(this, H))
|
|
569
599
|
t();
|
|
570
|
-
b(this, H, []),
|
|
600
|
+
b(this, H, []), $(this, ce, Ce).call(this);
|
|
571
601
|
});
|
|
572
602
|
};
|
|
573
603
|
function de() {
|
|
@@ -579,16 +609,16 @@ function de() {
|
|
|
579
609
|
return i;
|
|
580
610
|
}, de.apply(null, arguments);
|
|
581
611
|
}
|
|
582
|
-
var
|
|
612
|
+
var T;
|
|
583
613
|
(function(i) {
|
|
584
614
|
i.Pop = "POP", i.Push = "PUSH", i.Replace = "REPLACE";
|
|
585
|
-
})(
|
|
615
|
+
})(T || (T = {}));
|
|
586
616
|
var Ie = process.env.NODE_ENV !== "production" ? function(i) {
|
|
587
617
|
return Object.freeze(i);
|
|
588
618
|
} : function(i) {
|
|
589
619
|
return i;
|
|
590
620
|
};
|
|
591
|
-
function
|
|
621
|
+
function Ve(i, e) {
|
|
592
622
|
if (!i) {
|
|
593
623
|
typeof console < "u" && console.warn(e);
|
|
594
624
|
try {
|
|
@@ -597,38 +627,38 @@ function qe(i, e) {
|
|
|
597
627
|
}
|
|
598
628
|
}
|
|
599
629
|
}
|
|
600
|
-
var We = "beforeunload",
|
|
601
|
-
function
|
|
630
|
+
var We = "beforeunload", er = "hashchange", St = "popstate";
|
|
631
|
+
function tr(i) {
|
|
602
632
|
i === void 0 && (i = {});
|
|
603
|
-
var e = i, t = e.window, r = t === void 0 ? document.defaultView : t,
|
|
604
|
-
function
|
|
605
|
-
var w = r.location, c = w.pathname,
|
|
606
|
-
return [
|
|
633
|
+
var e = i, t = e.window, r = t === void 0 ? document.defaultView : t, n = r.history;
|
|
634
|
+
function a() {
|
|
635
|
+
var w = r.location, c = w.pathname, d = w.search, v = w.hash, E = n.state || {};
|
|
636
|
+
return [E.idx, Ie({
|
|
607
637
|
pathname: c,
|
|
608
|
-
search:
|
|
638
|
+
search: d,
|
|
609
639
|
hash: v,
|
|
610
|
-
state:
|
|
611
|
-
key:
|
|
640
|
+
state: E.usr || null,
|
|
641
|
+
key: E.key || "default"
|
|
612
642
|
})];
|
|
613
643
|
}
|
|
614
644
|
var o = null;
|
|
615
|
-
function
|
|
645
|
+
function p() {
|
|
616
646
|
if (o)
|
|
617
647
|
y.call(o), o = null;
|
|
618
648
|
else {
|
|
619
|
-
var w =
|
|
649
|
+
var w = T.Pop, c = a(), d = c[0], v = c[1];
|
|
620
650
|
if (y.length)
|
|
621
|
-
if (
|
|
622
|
-
var
|
|
623
|
-
|
|
651
|
+
if (d != null) {
|
|
652
|
+
var E = m - d;
|
|
653
|
+
E && (o = {
|
|
624
654
|
action: w,
|
|
625
655
|
location: v,
|
|
626
656
|
retry: function() {
|
|
627
|
-
F(
|
|
657
|
+
F(E * -1);
|
|
628
658
|
}
|
|
629
|
-
}, F(
|
|
659
|
+
}, F(E));
|
|
630
660
|
} else
|
|
631
|
-
process.env.NODE_ENV !== "production" &&
|
|
661
|
+
process.env.NODE_ENV !== "production" && Ve(
|
|
632
662
|
!1,
|
|
633
663
|
// TODO: Write up a doc that explains our blocking strategy in
|
|
634
664
|
// detail and link to it here so people can understand better what
|
|
@@ -639,80 +669,80 @@ function Qt(i) {
|
|
|
639
669
|
ne(w);
|
|
640
670
|
}
|
|
641
671
|
}
|
|
642
|
-
r.addEventListener(
|
|
643
|
-
var l =
|
|
644
|
-
|
|
645
|
-
idx:
|
|
672
|
+
r.addEventListener(St, p);
|
|
673
|
+
var l = T.Pop, f = a(), m = f[0], g = f[1], u = Be(), y = Be();
|
|
674
|
+
m == null && (m = 0, n.replaceState(de({}, n.state, {
|
|
675
|
+
idx: m
|
|
646
676
|
}), ""));
|
|
647
677
|
function k(w) {
|
|
648
678
|
return typeof w == "string" ? w : Ue(w);
|
|
649
679
|
}
|
|
650
680
|
function pe(w, c) {
|
|
651
681
|
return c === void 0 && (c = null), Ie(de({
|
|
652
|
-
pathname:
|
|
682
|
+
pathname: g.pathname,
|
|
653
683
|
hash: "",
|
|
654
684
|
search: ""
|
|
655
685
|
}, typeof w == "string" ? at(w) : w, {
|
|
656
686
|
state: c,
|
|
657
|
-
key:
|
|
687
|
+
key: Ot()
|
|
658
688
|
}));
|
|
659
689
|
}
|
|
660
|
-
function
|
|
690
|
+
function ge(w, c) {
|
|
661
691
|
return [{
|
|
662
692
|
usr: w.state,
|
|
663
693
|
key: w.key,
|
|
664
694
|
idx: c
|
|
665
695
|
}, k(w)];
|
|
666
696
|
}
|
|
667
|
-
function
|
|
697
|
+
function me(w, c, d) {
|
|
668
698
|
return !y.length || (y.call({
|
|
669
699
|
action: w,
|
|
670
700
|
location: c,
|
|
671
|
-
retry:
|
|
701
|
+
retry: d
|
|
672
702
|
}), !1);
|
|
673
703
|
}
|
|
674
704
|
function ne(w) {
|
|
675
705
|
l = w;
|
|
676
|
-
var c =
|
|
677
|
-
|
|
706
|
+
var c = a();
|
|
707
|
+
m = c[0], g = c[1], u.call({
|
|
678
708
|
action: l,
|
|
679
|
-
location:
|
|
709
|
+
location: g
|
|
680
710
|
});
|
|
681
711
|
}
|
|
682
712
|
function ae(w, c) {
|
|
683
|
-
var
|
|
684
|
-
function
|
|
713
|
+
var d = T.Push, v = pe(w, c);
|
|
714
|
+
function E() {
|
|
685
715
|
ae(w, c);
|
|
686
716
|
}
|
|
687
|
-
if (
|
|
688
|
-
var
|
|
717
|
+
if (me(d, v, E)) {
|
|
718
|
+
var O = ge(v, m + 1), D = O[0], M = O[1];
|
|
689
719
|
try {
|
|
690
|
-
|
|
720
|
+
n.pushState(D, "", M);
|
|
691
721
|
} catch {
|
|
692
|
-
r.location.assign(
|
|
722
|
+
r.location.assign(M);
|
|
693
723
|
}
|
|
694
|
-
ne(
|
|
724
|
+
ne(d);
|
|
695
725
|
}
|
|
696
726
|
}
|
|
697
727
|
function we(w, c) {
|
|
698
|
-
var
|
|
699
|
-
function
|
|
728
|
+
var d = T.Replace, v = pe(w, c);
|
|
729
|
+
function E() {
|
|
700
730
|
we(w, c);
|
|
701
731
|
}
|
|
702
|
-
if (
|
|
703
|
-
var
|
|
704
|
-
|
|
732
|
+
if (me(d, v, E)) {
|
|
733
|
+
var O = ge(v, m), D = O[0], M = O[1];
|
|
734
|
+
n.replaceState(D, "", M), ne(d);
|
|
705
735
|
}
|
|
706
736
|
}
|
|
707
737
|
function F(w) {
|
|
708
|
-
|
|
738
|
+
n.go(w);
|
|
709
739
|
}
|
|
710
740
|
var Q = {
|
|
711
741
|
get action() {
|
|
712
742
|
return l;
|
|
713
743
|
},
|
|
714
744
|
get location() {
|
|
715
|
-
return
|
|
745
|
+
return g;
|
|
716
746
|
},
|
|
717
747
|
createHref: k,
|
|
718
748
|
push: ae,
|
|
@@ -728,45 +758,45 @@ function Qt(i) {
|
|
|
728
758
|
return u.push(c);
|
|
729
759
|
},
|
|
730
760
|
block: function(c) {
|
|
731
|
-
var
|
|
761
|
+
var d = y.push(c);
|
|
732
762
|
return y.length === 1 && r.addEventListener(We, Ge), function() {
|
|
733
|
-
|
|
763
|
+
d(), y.length || r.removeEventListener(We, Ge);
|
|
734
764
|
};
|
|
735
765
|
}
|
|
736
766
|
};
|
|
737
767
|
return Q;
|
|
738
768
|
}
|
|
739
|
-
function
|
|
769
|
+
function rr(i) {
|
|
740
770
|
i === void 0 && (i = {});
|
|
741
|
-
var e = i, t = e.window, r = t === void 0 ? document.defaultView : t,
|
|
742
|
-
function
|
|
743
|
-
var c = at(r.location.hash.substr(1)),
|
|
744
|
-
return [
|
|
771
|
+
var e = i, t = e.window, r = t === void 0 ? document.defaultView : t, n = r.history;
|
|
772
|
+
function a() {
|
|
773
|
+
var c = at(r.location.hash.substr(1)), d = c.pathname, v = d === void 0 ? "/" : d, E = c.search, O = E === void 0 ? "" : E, D = c.hash, M = D === void 0 ? "" : D, q = n.state || {};
|
|
774
|
+
return [q.idx, Ie({
|
|
745
775
|
pathname: v,
|
|
746
|
-
search:
|
|
747
|
-
hash:
|
|
748
|
-
state:
|
|
749
|
-
key:
|
|
776
|
+
search: O,
|
|
777
|
+
hash: M,
|
|
778
|
+
state: q.usr || null,
|
|
779
|
+
key: q.key || "default"
|
|
750
780
|
})];
|
|
751
781
|
}
|
|
752
782
|
var o = null;
|
|
753
|
-
function
|
|
783
|
+
function p() {
|
|
754
784
|
if (o)
|
|
755
785
|
y.call(o), o = null;
|
|
756
786
|
else {
|
|
757
|
-
var c =
|
|
787
|
+
var c = T.Pop, d = a(), v = d[0], E = d[1];
|
|
758
788
|
if (y.length)
|
|
759
789
|
if (v != null) {
|
|
760
|
-
var
|
|
761
|
-
|
|
790
|
+
var O = m - v;
|
|
791
|
+
O && (o = {
|
|
762
792
|
action: c,
|
|
763
|
-
location:
|
|
793
|
+
location: E,
|
|
764
794
|
retry: function() {
|
|
765
|
-
Q(
|
|
795
|
+
Q(O * -1);
|
|
766
796
|
}
|
|
767
|
-
}, Q(
|
|
797
|
+
}, Q(O));
|
|
768
798
|
} else
|
|
769
|
-
process.env.NODE_ENV !== "production" &&
|
|
799
|
+
process.env.NODE_ENV !== "production" && Ve(
|
|
770
800
|
!1,
|
|
771
801
|
// TODO: Write up a doc that explains our blocking strategy in
|
|
772
802
|
// detail and link to it here so people can understand better
|
|
@@ -777,91 +807,91 @@ function Jt(i) {
|
|
|
777
807
|
ae(c);
|
|
778
808
|
}
|
|
779
809
|
}
|
|
780
|
-
r.addEventListener(
|
|
781
|
-
var c =
|
|
782
|
-
Ue(
|
|
810
|
+
r.addEventListener(St, p), r.addEventListener(er, function() {
|
|
811
|
+
var c = a(), d = c[1];
|
|
812
|
+
Ue(d) !== Ue(g) && p();
|
|
783
813
|
});
|
|
784
|
-
var l =
|
|
785
|
-
|
|
786
|
-
idx:
|
|
814
|
+
var l = T.Pop, f = a(), m = f[0], g = f[1], u = Be(), y = Be();
|
|
815
|
+
m == null && (m = 0, n.replaceState(de({}, n.state, {
|
|
816
|
+
idx: m
|
|
787
817
|
}), ""));
|
|
788
818
|
function k() {
|
|
789
|
-
var c = document.querySelector("base"),
|
|
819
|
+
var c = document.querySelector("base"), d = "";
|
|
790
820
|
if (c && c.getAttribute("href")) {
|
|
791
|
-
var v = r.location.href,
|
|
792
|
-
|
|
821
|
+
var v = r.location.href, E = v.indexOf("#");
|
|
822
|
+
d = E === -1 ? v : v.slice(0, E);
|
|
793
823
|
}
|
|
794
|
-
return
|
|
824
|
+
return d;
|
|
795
825
|
}
|
|
796
826
|
function pe(c) {
|
|
797
827
|
return k() + "#" + (typeof c == "string" ? c : Ue(c));
|
|
798
828
|
}
|
|
799
|
-
function
|
|
800
|
-
return
|
|
801
|
-
pathname:
|
|
829
|
+
function ge(c, d) {
|
|
830
|
+
return d === void 0 && (d = null), Ie(de({
|
|
831
|
+
pathname: g.pathname,
|
|
802
832
|
hash: "",
|
|
803
833
|
search: ""
|
|
804
834
|
}, typeof c == "string" ? at(c) : c, {
|
|
805
|
-
state:
|
|
806
|
-
key:
|
|
835
|
+
state: d,
|
|
836
|
+
key: Ot()
|
|
807
837
|
}));
|
|
808
838
|
}
|
|
809
|
-
function
|
|
839
|
+
function me(c, d) {
|
|
810
840
|
return [{
|
|
811
841
|
usr: c.state,
|
|
812
842
|
key: c.key,
|
|
813
|
-
idx:
|
|
843
|
+
idx: d
|
|
814
844
|
}, pe(c)];
|
|
815
845
|
}
|
|
816
|
-
function ne(c,
|
|
846
|
+
function ne(c, d, v) {
|
|
817
847
|
return !y.length || (y.call({
|
|
818
848
|
action: c,
|
|
819
|
-
location:
|
|
849
|
+
location: d,
|
|
820
850
|
retry: v
|
|
821
851
|
}), !1);
|
|
822
852
|
}
|
|
823
853
|
function ae(c) {
|
|
824
854
|
l = c;
|
|
825
|
-
var
|
|
826
|
-
|
|
855
|
+
var d = a();
|
|
856
|
+
m = d[0], g = d[1], u.call({
|
|
827
857
|
action: l,
|
|
828
|
-
location:
|
|
858
|
+
location: g
|
|
829
859
|
});
|
|
830
860
|
}
|
|
831
|
-
function we(c,
|
|
832
|
-
var v =
|
|
833
|
-
function
|
|
834
|
-
we(c,
|
|
861
|
+
function we(c, d) {
|
|
862
|
+
var v = T.Push, E = ge(c, d);
|
|
863
|
+
function O() {
|
|
864
|
+
we(c, d);
|
|
835
865
|
}
|
|
836
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
837
|
-
var
|
|
866
|
+
if (process.env.NODE_ENV !== "production" && Ve(E.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(c) + ")"), ne(v, E, O)) {
|
|
867
|
+
var D = me(E, m + 1), M = D[0], q = D[1];
|
|
838
868
|
try {
|
|
839
|
-
|
|
869
|
+
n.pushState(M, "", q);
|
|
840
870
|
} catch {
|
|
841
|
-
r.location.assign(
|
|
871
|
+
r.location.assign(q);
|
|
842
872
|
}
|
|
843
873
|
ae(v);
|
|
844
874
|
}
|
|
845
875
|
}
|
|
846
|
-
function F(c,
|
|
847
|
-
var v =
|
|
848
|
-
function
|
|
849
|
-
F(c,
|
|
876
|
+
function F(c, d) {
|
|
877
|
+
var v = T.Replace, E = ge(c, d);
|
|
878
|
+
function O() {
|
|
879
|
+
F(c, d);
|
|
850
880
|
}
|
|
851
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
852
|
-
var
|
|
853
|
-
|
|
881
|
+
if (process.env.NODE_ENV !== "production" && Ve(E.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(c) + ")"), ne(v, E, O)) {
|
|
882
|
+
var D = me(E, m), M = D[0], q = D[1];
|
|
883
|
+
n.replaceState(M, "", q), ae(v);
|
|
854
884
|
}
|
|
855
885
|
}
|
|
856
886
|
function Q(c) {
|
|
857
|
-
|
|
887
|
+
n.go(c);
|
|
858
888
|
}
|
|
859
889
|
var w = {
|
|
860
890
|
get action() {
|
|
861
891
|
return l;
|
|
862
892
|
},
|
|
863
893
|
get location() {
|
|
864
|
-
return
|
|
894
|
+
return g;
|
|
865
895
|
},
|
|
866
896
|
createHref: pe,
|
|
867
897
|
push: we,
|
|
@@ -873,11 +903,11 @@ function Jt(i) {
|
|
|
873
903
|
forward: function() {
|
|
874
904
|
Q(1);
|
|
875
905
|
},
|
|
876
|
-
listen: function(
|
|
877
|
-
return u.push(
|
|
906
|
+
listen: function(d) {
|
|
907
|
+
return u.push(d);
|
|
878
908
|
},
|
|
879
|
-
block: function(
|
|
880
|
-
var v = y.push(
|
|
909
|
+
block: function(d) {
|
|
910
|
+
var v = y.push(d);
|
|
881
911
|
return y.length === 1 && r.addEventListener(We, Ge), function() {
|
|
882
912
|
v(), y.length || r.removeEventListener(We, Ge);
|
|
883
913
|
};
|
|
@@ -908,12 +938,12 @@ function Be() {
|
|
|
908
938
|
}
|
|
909
939
|
};
|
|
910
940
|
}
|
|
911
|
-
function
|
|
941
|
+
function Ot() {
|
|
912
942
|
return Math.random().toString(36).substr(2, 8);
|
|
913
943
|
}
|
|
914
944
|
function Ue(i) {
|
|
915
|
-
var e = i.pathname, t = e === void 0 ? "/" : e, r = i.search,
|
|
916
|
-
return
|
|
945
|
+
var e = i.pathname, t = e === void 0 ? "/" : e, r = i.search, n = r === void 0 ? "" : r, a = i.hash, o = a === void 0 ? "" : a;
|
|
946
|
+
return n && n !== "?" && (t += n.charAt(0) === "?" ? n : "?" + n), o && o !== "#" && (t += o.charAt(0) === "#" ? o : "#" + o), t;
|
|
917
947
|
}
|
|
918
948
|
function at(i) {
|
|
919
949
|
var e = {};
|
|
@@ -926,25 +956,25 @@ function at(i) {
|
|
|
926
956
|
return e;
|
|
927
957
|
}
|
|
928
958
|
function be(i) {
|
|
929
|
-
return
|
|
959
|
+
return vt(i, "Expected `path` to be a string. Got type: %t, value: %v"), i.split("/").map((e) => e.trim()).filter((e) => e !== "");
|
|
930
960
|
}
|
|
931
961
|
function se(i) {
|
|
932
962
|
var t;
|
|
933
|
-
|
|
963
|
+
Nt(
|
|
934
964
|
(r) => lt(r == null ? void 0 : r.toString),
|
|
935
965
|
i,
|
|
936
966
|
"Expected `parts` to be an array of objects with a .toString() method. Got type: %t, value: %v"
|
|
937
967
|
), i = i.filter((r) => r).flatMap(String);
|
|
938
968
|
let e = (t = i.shift()) == null ? void 0 : t.toString();
|
|
939
969
|
if (e) {
|
|
940
|
-
for (const r of i.map((
|
|
970
|
+
for (const r of i.map((n) => n.toString()))
|
|
941
971
|
r.startsWith(".") ? e = He(e, r) : e[e.length - 1] !== "/" ? r[0] !== "/" ? e += "/" + r : e += r : r[0] === "/" ? e += r.slice(1) : e += r;
|
|
942
972
|
e && e !== "/" && e.endsWith("/") && (e = e.slice(0, e.length - 1));
|
|
943
973
|
}
|
|
944
974
|
return e ?? "";
|
|
945
975
|
}
|
|
946
976
|
function He(i, e) {
|
|
947
|
-
if (
|
|
977
|
+
if (vt(i, "Expected `base` to be a string. Got type: %t, value: %v"), e == null && (e = i, i = ""), e.startsWith("/"))
|
|
948
978
|
return e;
|
|
949
979
|
let t = i;
|
|
950
980
|
for (; ; )
|
|
@@ -964,80 +994,80 @@ function st(i) {
|
|
|
964
994
|
if (!i) return {};
|
|
965
995
|
i.startsWith("?") && (i = i.slice(1));
|
|
966
996
|
const e = i.split("&").filter((t) => t.trim() !== "").map((t) => {
|
|
967
|
-
const [r,
|
|
968
|
-
return
|
|
997
|
+
const [r, n] = t.split("=").map((a) => a.trim());
|
|
998
|
+
return n.toLowerCase() === "true" ? [r, !0] : n.toLowerCase() === "false" ? [r, !1] : isNaN(Number(n)) ? [r, n] : [r, Number(n)];
|
|
969
999
|
});
|
|
970
1000
|
return Object.fromEntries(e);
|
|
971
1001
|
}
|
|
972
1002
|
function wt(i, e, t = {}) {
|
|
973
1003
|
var o;
|
|
974
|
-
const [r,
|
|
975
|
-
e: for (const
|
|
976
|
-
const { fragments: l } =
|
|
977
|
-
if (!(((o = l[l.length - 1]) == null ? void 0 : o.type) === 3) && l.length !==
|
|
1004
|
+
const [r, n] = e.split("?"), a = be(r);
|
|
1005
|
+
e: for (const p of i) {
|
|
1006
|
+
const { fragments: l } = p;
|
|
1007
|
+
if (!(((o = l[l.length - 1]) == null ? void 0 : o.type) === 3) && l.length !== a.length || t.willMatch && !t.willMatch(p))
|
|
978
1008
|
continue e;
|
|
979
|
-
const
|
|
1009
|
+
const m = [];
|
|
980
1010
|
t: for (let u = 0; u < l.length; u++) {
|
|
981
|
-
const y =
|
|
1011
|
+
const y = a[u], k = l[u];
|
|
982
1012
|
if (y == null && k.type !== 3)
|
|
983
1013
|
continue e;
|
|
984
1014
|
switch (k.type) {
|
|
985
1015
|
case 1:
|
|
986
1016
|
if (k.name.toLowerCase() === y.toLowerCase()) {
|
|
987
|
-
|
|
1017
|
+
m.push(k);
|
|
988
1018
|
break;
|
|
989
1019
|
} else
|
|
990
1020
|
continue e;
|
|
991
1021
|
case 2:
|
|
992
|
-
|
|
1022
|
+
m.push({ ...k, value: y });
|
|
993
1023
|
break;
|
|
994
1024
|
case 3:
|
|
995
|
-
|
|
1025
|
+
m.push({ ...k, value: a.slice(u).join("/") });
|
|
996
1026
|
break t;
|
|
997
1027
|
case 4:
|
|
998
1028
|
if (isNaN(Number(y)))
|
|
999
1029
|
continue e;
|
|
1000
|
-
|
|
1030
|
+
m.push({ ...k, value: Number(y) });
|
|
1001
1031
|
break;
|
|
1002
1032
|
default:
|
|
1003
1033
|
throw new Error(`Unknown fragment type: ${k.type}`);
|
|
1004
1034
|
}
|
|
1005
1035
|
}
|
|
1006
|
-
const
|
|
1007
|
-
for (const u of
|
|
1008
|
-
u.type === 2 && (
|
|
1036
|
+
const g = {};
|
|
1037
|
+
for (const u of m)
|
|
1038
|
+
u.type === 2 && (g[u.name] = decodeURIComponent(u.value)), u.type === 4 && (g[u.name] = u.value), u.type === 3 && (g.wildcard = "/" + decodeURIComponent(u.value));
|
|
1009
1039
|
return {
|
|
1010
|
-
path: "/" +
|
|
1040
|
+
path: "/" + m.map((u) => u.value).join("/"),
|
|
1011
1041
|
pattern: "/" + l.map((u) => u.type === 2 ? `{${u.name}}` : u.type === 4 ? `{#${u.name}}` : u.name).join("/"),
|
|
1012
|
-
params:
|
|
1013
|
-
query: st(
|
|
1014
|
-
meta:
|
|
1042
|
+
params: g,
|
|
1043
|
+
query: st(n),
|
|
1044
|
+
meta: p.meta
|
|
1015
1045
|
};
|
|
1016
1046
|
}
|
|
1017
1047
|
}
|
|
1018
|
-
function
|
|
1019
|
-
const e = [], t = [], r = [],
|
|
1048
|
+
function nr(i) {
|
|
1049
|
+
const e = [], t = [], r = [], n = [];
|
|
1020
1050
|
for (const o of i) {
|
|
1021
|
-
const { fragments:
|
|
1022
|
-
|
|
1051
|
+
const { fragments: p } = o;
|
|
1052
|
+
p.some(
|
|
1023
1053
|
(l) => l.type === 3
|
|
1024
1054
|
/* Wildcard */
|
|
1025
|
-
) ?
|
|
1055
|
+
) ? n.push(o) : p.some(
|
|
1026
1056
|
(l) => l.type === 4
|
|
1027
1057
|
/* NumericParam */
|
|
1028
|
-
) ? t.push(o) :
|
|
1058
|
+
) ? t.push(o) : p.some(
|
|
1029
1059
|
(l) => l.type === 2
|
|
1030
1060
|
/* Param */
|
|
1031
1061
|
) ? r.push(o) : e.push(o);
|
|
1032
1062
|
}
|
|
1033
|
-
const
|
|
1034
|
-
return e.sort(
|
|
1063
|
+
const a = (o, p) => o.fragments.length > p.fragments.length ? -1 : 1;
|
|
1064
|
+
return e.sort(a), t.sort(a), r.sort(a), n.sort(a), [...e, ...t, ...r, ...n];
|
|
1035
1065
|
}
|
|
1036
|
-
function
|
|
1066
|
+
function ar(i) {
|
|
1037
1067
|
const e = be(i), t = [];
|
|
1038
1068
|
for (let r = 0; r < e.length; r++) {
|
|
1039
|
-
const
|
|
1040
|
-
if (
|
|
1069
|
+
const n = e[r];
|
|
1070
|
+
if (n === "*") {
|
|
1041
1071
|
if (r !== e.length - 1)
|
|
1042
1072
|
throw new Error(`Wildcard must be at the end of a pattern. Received: ${i}`);
|
|
1043
1073
|
t.push({
|
|
@@ -1045,74 +1075,82 @@ function Xt(i) {
|
|
|
1045
1075
|
name: "*",
|
|
1046
1076
|
value: null
|
|
1047
1077
|
});
|
|
1048
|
-
} else
|
|
1049
|
-
type:
|
|
1050
|
-
name:
|
|
1078
|
+
} else n.at(0) === "{" && n.at(-1) === "}" ? t.push({
|
|
1079
|
+
type: n[1] === "#" ? 4 : 2,
|
|
1080
|
+
name: n[1] === "#" ? n.slice(2, -1) : n.slice(1, -1),
|
|
1051
1081
|
value: null
|
|
1052
1082
|
}) : t.push({
|
|
1053
1083
|
type: 1,
|
|
1054
|
-
name:
|
|
1055
|
-
value:
|
|
1084
|
+
name: n,
|
|
1085
|
+
value: n
|
|
1056
1086
|
});
|
|
1057
1087
|
}
|
|
1058
1088
|
return t;
|
|
1059
1089
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1090
|
+
const yt = (i, e) => {
|
|
1091
|
+
if (Object.keys(i).length !== Object.keys(e).length)
|
|
1092
|
+
return !1;
|
|
1093
|
+
for (const t in i)
|
|
1094
|
+
if (i[t] !== e[t])
|
|
1095
|
+
return !1;
|
|
1096
|
+
return !0;
|
|
1097
|
+
};
|
|
1098
|
+
var Oe, N, X, xe, P, Qe, I, Le, Z, ee, ue, he, fe, Re, K, it, ot;
|
|
1099
|
+
class sr {
|
|
1062
1100
|
constructor(e, t) {
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1101
|
+
h(this, K);
|
|
1102
|
+
h(this, Oe);
|
|
1103
|
+
h(this, N);
|
|
1104
|
+
h(this, X);
|
|
1105
|
+
h(this, xe, Ze());
|
|
1106
|
+
h(this, P);
|
|
1107
|
+
h(this, Qe, 0);
|
|
1108
|
+
h(this, I, []);
|
|
1109
|
+
h(this, Le);
|
|
1110
|
+
h(this, Z, []);
|
|
1073
1111
|
// Callbacks that need to be called on unmount.
|
|
1074
|
-
|
|
1112
|
+
h(this, ee, []);
|
|
1075
1113
|
/**
|
|
1076
1114
|
* The currently matched route pattern, if any.
|
|
1077
1115
|
*/
|
|
1078
1116
|
S(this, "$pattern");
|
|
1079
|
-
|
|
1117
|
+
h(this, ue);
|
|
1080
1118
|
/**
|
|
1081
1119
|
* The current URL path.
|
|
1082
1120
|
*/
|
|
1083
1121
|
S(this, "$path");
|
|
1084
|
-
|
|
1122
|
+
h(this, he);
|
|
1085
1123
|
/**
|
|
1086
1124
|
* The current named path params.
|
|
1087
1125
|
*/
|
|
1088
1126
|
S(this, "$params");
|
|
1089
|
-
|
|
1127
|
+
h(this, fe);
|
|
1090
1128
|
/**
|
|
1091
1129
|
* The current query params. Changes to this object will be reflected in the URL.
|
|
1092
1130
|
*/
|
|
1093
1131
|
S(this, "$query");
|
|
1094
|
-
|
|
1095
|
-
b(this,
|
|
1096
|
-
const [r,
|
|
1132
|
+
h(this, Re);
|
|
1133
|
+
b(this, Oe, e), b(this, N, e.createLogger("dolla/router")), b(this, X, t);
|
|
1134
|
+
const [r, n] = ie(null), [a, o] = ie(""), [p, l] = ie({}, { equals: yt }), [f, m] = ie(
|
|
1097
1135
|
st(typeof window > "u" ? "" : window.location.search ?? ""),
|
|
1098
|
-
{ equals:
|
|
1136
|
+
{ equals: yt }
|
|
1099
1137
|
);
|
|
1100
|
-
this.$pattern = r, b(this, ue,
|
|
1101
|
-
s(this, P) != null && (s(this, xe).watch([
|
|
1138
|
+
this.$pattern = r, b(this, ue, n), this.$path = a, b(this, he, o), this.$params = p, b(this, fe, l), this.$query = f, b(this, Re, m), e.beforeMount(() => {
|
|
1139
|
+
s(this, P) != null && (s(this, xe).watch([f], (g) => {
|
|
1102
1140
|
const u = new URLSearchParams();
|
|
1103
|
-
for (const k in
|
|
1104
|
-
u.set(k, String(
|
|
1141
|
+
for (const k in g)
|
|
1142
|
+
u.set(k, String(g[k]));
|
|
1105
1143
|
const y = "?" + u.toString();
|
|
1106
1144
|
y != s(this, P).location.search && s(this, P).replace({
|
|
1107
1145
|
pathname: s(this, P).location.pathname,
|
|
1108
1146
|
search: y
|
|
1109
1147
|
});
|
|
1110
|
-
}), s(this, ee).push(s(this, P).listen(
|
|
1111
|
-
|
|
1112
|
-
let u =
|
|
1113
|
-
s(this,
|
|
1148
|
+
}), s(this, ee).push(s(this, P).listen($(this, K, ot).bind(this))), $(this, K, ot).call(this, s(this, P)), s(this, ee).push(
|
|
1149
|
+
lr(s(this, X).rootElement, (g) => {
|
|
1150
|
+
let u = g.getAttribute("href");
|
|
1151
|
+
s(this, N).info("Intercepted link click", g, u), /^https?:\/\/|^\//.test(u) || (u = se([s(this, P).location.pathname, u])), s(this, P).push(u);
|
|
1114
1152
|
})
|
|
1115
|
-
), s(this,
|
|
1153
|
+
), s(this, N).info("Intercepting <a> clicks within root element:", s(this, X).rootElement));
|
|
1116
1154
|
}), e.onUnmount(() => {
|
|
1117
1155
|
for (; s(this, ee).length > 0; )
|
|
1118
1156
|
s(this, ee).pop()();
|
|
@@ -1120,26 +1158,26 @@ class Zt {
|
|
|
1120
1158
|
});
|
|
1121
1159
|
}
|
|
1122
1160
|
setup(e) {
|
|
1123
|
-
if (s(this,
|
|
1124
|
-
s(this,
|
|
1161
|
+
if (s(this, Oe).isMounted) {
|
|
1162
|
+
s(this, N).crash(
|
|
1125
1163
|
new Error("Dolla is already mounted. Router setup must be called before Dolla.mount is called.")
|
|
1126
1164
|
);
|
|
1127
1165
|
return;
|
|
1128
1166
|
}
|
|
1129
|
-
e.style === "hash" ? b(this, P,
|
|
1130
|
-
e.routes.flatMap((t) =>
|
|
1167
|
+
e.style === "hash" ? b(this, P, rr()) : b(this, P, tr()), b(this, Z, nr(
|
|
1168
|
+
e.routes.flatMap((t) => $(this, K, it).call(this, t)).map((t) => ({
|
|
1131
1169
|
pattern: t.pattern,
|
|
1132
1170
|
meta: t.meta,
|
|
1133
|
-
fragments:
|
|
1171
|
+
fragments: ar(t.pattern)
|
|
1134
1172
|
}))
|
|
1135
1173
|
));
|
|
1136
1174
|
for (const t of s(this, Z))
|
|
1137
1175
|
if (t.meta.redirect) {
|
|
1138
1176
|
let r;
|
|
1139
|
-
if (!lt(t.meta.redirect)) if (
|
|
1177
|
+
if (!lt(t.meta.redirect)) if (C(t.meta.redirect)) {
|
|
1140
1178
|
if (r = t.meta.redirect, !wt(s(this, Z), r, {
|
|
1141
|
-
willMatch(
|
|
1142
|
-
return
|
|
1179
|
+
willMatch(a) {
|
|
1180
|
+
return a !== t;
|
|
1143
1181
|
}
|
|
1144
1182
|
}))
|
|
1145
1183
|
throw new Error(
|
|
@@ -1158,7 +1196,7 @@ class Zt {
|
|
|
1158
1196
|
*/
|
|
1159
1197
|
go(e, t = {}) {
|
|
1160
1198
|
if (s(this, P) == null) {
|
|
1161
|
-
s(this,
|
|
1199
|
+
s(this, N).crash(
|
|
1162
1200
|
new Error(
|
|
1163
1201
|
"Router.go was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
|
|
1164
1202
|
)
|
|
@@ -1173,7 +1211,7 @@ class Zt {
|
|
|
1173
1211
|
*/
|
|
1174
1212
|
back(e = 1) {
|
|
1175
1213
|
if (s(this, P) == null) {
|
|
1176
|
-
s(this,
|
|
1214
|
+
s(this, N).crash(
|
|
1177
1215
|
new Error(
|
|
1178
1216
|
"Router.back was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
|
|
1179
1217
|
)
|
|
@@ -1187,7 +1225,7 @@ class Zt {
|
|
|
1187
1225
|
*/
|
|
1188
1226
|
forward(e = 1) {
|
|
1189
1227
|
if (s(this, P) == null) {
|
|
1190
|
-
s(this,
|
|
1228
|
+
s(this, N).crash(
|
|
1191
1229
|
new Error(
|
|
1192
1230
|
"Router.forward was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
|
|
1193
1231
|
)
|
|
@@ -1197,7 +1235,7 @@ class Zt {
|
|
|
1197
1235
|
s(this, P).go(e);
|
|
1198
1236
|
}
|
|
1199
1237
|
}
|
|
1200
|
-
|
|
1238
|
+
Oe = new WeakMap(), N = new WeakMap(), X = new WeakMap(), xe = new WeakMap(), P = new WeakMap(), Qe = new WeakMap(), I = new WeakMap(), Le = new WeakMap(), Z = new WeakMap(), ee = new WeakMap(), ue = new WeakMap(), he = new WeakMap(), fe = new WeakMap(), Re = new WeakMap(), K = new WeakSet(), /**
|
|
1201
1239
|
* Parses a route definition object into a set of matchable routes.
|
|
1202
1240
|
*
|
|
1203
1241
|
* @param route - Route config object.
|
|
@@ -1212,41 +1250,41 @@ it = function(e, t = [], r = []) {
|
|
|
1212
1250
|
throw new Error("Route cannot have both a 'redirect' and a 'view'.");
|
|
1213
1251
|
if (!e.view && !e.routes && !e.redirect)
|
|
1214
1252
|
throw new Error("Route must have a 'view', a 'redirect', or a set of nested 'routes'.");
|
|
1215
|
-
let
|
|
1253
|
+
let n = [];
|
|
1216
1254
|
for (const l of t)
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
const
|
|
1255
|
+
n.push(...be(l.path));
|
|
1256
|
+
n.push(...be(e.path)), n[n.length - 1] === "*" && n.pop();
|
|
1257
|
+
const a = [];
|
|
1220
1258
|
if (e.redirect) {
|
|
1221
1259
|
let l = e.redirect;
|
|
1222
|
-
return
|
|
1223
|
-
pattern: "/" + se([...
|
|
1260
|
+
return C(l) && (l = He(se(n), l), l.startsWith("/") || (l = "/" + l)), a.push({
|
|
1261
|
+
pattern: "/" + se([...n, ...be(e.path)]),
|
|
1224
1262
|
meta: {
|
|
1225
1263
|
redirect: l
|
|
1226
1264
|
}
|
|
1227
|
-
}),
|
|
1265
|
+
}), a;
|
|
1228
1266
|
}
|
|
1229
|
-
let o =
|
|
1267
|
+
let o = Et;
|
|
1230
1268
|
if (typeof e.view == "function")
|
|
1231
1269
|
o = e.view;
|
|
1232
1270
|
else if (e.view)
|
|
1233
1271
|
throw new TypeError(`Route '${e.path}' expected a view function or undefined. Got: ${e.view}`);
|
|
1234
|
-
const
|
|
1272
|
+
const p = { id: ut(this, Qe)._++, view: o };
|
|
1235
1273
|
if (e.routes)
|
|
1236
1274
|
for (const l of e.routes)
|
|
1237
|
-
|
|
1275
|
+
a.push(...$(this, K, it).call(this, l, [...t, e], [...r, p]));
|
|
1238
1276
|
else
|
|
1239
|
-
|
|
1277
|
+
a.push({
|
|
1240
1278
|
pattern: parent ? se([...t.map((l) => l.path), e.path]) : e.path,
|
|
1241
1279
|
meta: {
|
|
1242
1280
|
pattern: e.path,
|
|
1243
|
-
layers: [...r,
|
|
1281
|
+
layers: [...r, p],
|
|
1244
1282
|
beforeMatch: e.beforeMatch
|
|
1245
1283
|
}
|
|
1246
1284
|
});
|
|
1247
|
-
return
|
|
1285
|
+
return a;
|
|
1248
1286
|
}, ot = async function({ location: e }) {
|
|
1249
|
-
e.search !== s(this,
|
|
1287
|
+
e.search !== s(this, Le) && (b(this, Le, e.search), s(this, Re).call(this, st(e.search)));
|
|
1250
1288
|
const t = wt(s(this, Z), e.pathname);
|
|
1251
1289
|
if (!t) {
|
|
1252
1290
|
s(this, ue).call(this, null), s(this, he).call(this, e.pathname), s(this, fe).call(this, {
|
|
@@ -1261,8 +1299,8 @@ it = function(e, t = [], r = []) {
|
|
|
1261
1299
|
}
|
|
1262
1300
|
}), t.meta.redirect != null)
|
|
1263
1301
|
if (typeof t.meta.redirect == "string") {
|
|
1264
|
-
const r =
|
|
1265
|
-
s(this,
|
|
1302
|
+
const r = cr(t.meta.redirect, t.params);
|
|
1303
|
+
s(this, N).info(`↩️ redirecting from '${t.path}' to '${r}'`), s(this, P).replace(r);
|
|
1266
1304
|
} else if (typeof t.meta.redirect == "function") {
|
|
1267
1305
|
const r = {
|
|
1268
1306
|
path: t.path,
|
|
@@ -1270,89 +1308,89 @@ it = function(e, t = [], r = []) {
|
|
|
1270
1308
|
params: t.params,
|
|
1271
1309
|
query: t.query
|
|
1272
1310
|
};
|
|
1273
|
-
let
|
|
1274
|
-
if (typeof
|
|
1311
|
+
let n = await t.meta.redirect(r);
|
|
1312
|
+
if (typeof n != "string")
|
|
1275
1313
|
throw new Error("Redirect function must return a path to redirect to.");
|
|
1276
|
-
|
|
1314
|
+
n.startsWith("/") || (n = He(t.path, n)), s(this, N).info(`Redirecting to: '${n}'`), s(this, P).replace(n);
|
|
1277
1315
|
} else
|
|
1278
1316
|
throw new TypeError("Redirect must either be a path string or a function.");
|
|
1279
|
-
else if (s(this,
|
|
1317
|
+
else if (s(this, N).info(`📍 navigating to '${t.path}'`), s(this, he).call(this, t.path), s(this, fe).call(this, t.params), t.pattern !== this.$pattern.get()) {
|
|
1280
1318
|
s(this, ue).call(this, t.pattern);
|
|
1281
1319
|
const r = t.meta.layers;
|
|
1282
|
-
for (let
|
|
1283
|
-
const
|
|
1284
|
-
if ((o == null ? void 0 : o.id) !==
|
|
1285
|
-
b(this, I, s(this, I).slice(0,
|
|
1286
|
-
const
|
|
1320
|
+
for (let n = 0; n < r.length; n++) {
|
|
1321
|
+
const a = r[n], o = s(this, I)[n];
|
|
1322
|
+
if ((o == null ? void 0 : o.id) !== a.id) {
|
|
1323
|
+
b(this, I, s(this, I).slice(0, n));
|
|
1324
|
+
const p = s(this, I).at(-1);
|
|
1287
1325
|
o && o.node.isMounted && o.node.unmount();
|
|
1288
1326
|
let l;
|
|
1289
|
-
|
|
1327
|
+
p ? l = p.node.setChildView(a.view) : l = s(this, X).rootView.setChildView(a.view), s(this, I).push({ id: a.id, node: l });
|
|
1290
1328
|
}
|
|
1291
1329
|
}
|
|
1292
1330
|
}
|
|
1293
1331
|
};
|
|
1294
|
-
const
|
|
1295
|
-
function
|
|
1296
|
-
function r(
|
|
1297
|
-
return !
|
|
1332
|
+
const ir = /(noopener|noreferrer) (noopener|noreferrer)/, or = /^[\w-_]+:/;
|
|
1333
|
+
function lr(i, e, t = window) {
|
|
1334
|
+
function r(a) {
|
|
1335
|
+
return !a || a === i ? null : a.localName !== "a" || a.href === void 0 ? r(a.parentNode) : a;
|
|
1298
1336
|
}
|
|
1299
|
-
function a
|
|
1300
|
-
if (
|
|
1337
|
+
function n(a) {
|
|
1338
|
+
if (a.button && a.button !== 0 || a.ctrlKey || a.metaKey || a.altKey || a.shiftKey || a.defaultPrevented)
|
|
1301
1339
|
return;
|
|
1302
|
-
const o = r(
|
|
1303
|
-
o && (t.location.protocol !== o.protocol || t.location.hostname !== o.hostname || t.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" &&
|
|
1340
|
+
const o = r(a.target);
|
|
1341
|
+
o && (t.location.protocol !== o.protocol || t.location.hostname !== o.hostname || t.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" && ir.test(o.getAttribute("rel")) || or.test(o.getAttribute("href")) || (a.preventDefault(), e(o)));
|
|
1304
1342
|
}
|
|
1305
|
-
return i.addEventListener("click",
|
|
1306
|
-
i.removeEventListener("click",
|
|
1343
|
+
return i.addEventListener("click", n), function() {
|
|
1344
|
+
i.removeEventListener("click", n);
|
|
1307
1345
|
};
|
|
1308
1346
|
}
|
|
1309
|
-
function
|
|
1347
|
+
function cr(i, e) {
|
|
1310
1348
|
for (const t in e) {
|
|
1311
1349
|
const r = e[t].toString();
|
|
1312
1350
|
i = i.replace(`{${t}}`, r).replace(`{#${t}}`, r);
|
|
1313
1351
|
}
|
|
1314
1352
|
return i;
|
|
1315
1353
|
}
|
|
1316
|
-
var W,
|
|
1317
|
-
class
|
|
1354
|
+
var W, De, G, te, Ne, je, Me, Te, qe, Ae, B, x, z;
|
|
1355
|
+
class ur {
|
|
1318
1356
|
constructor() {
|
|
1319
1357
|
S(this, "http");
|
|
1320
1358
|
S(this, "i18n");
|
|
1321
1359
|
S(this, "render");
|
|
1322
1360
|
S(this, "router");
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1361
|
+
h(this, W, !1);
|
|
1362
|
+
h(this, De, "production");
|
|
1363
|
+
h(this, G);
|
|
1364
|
+
h(this, te);
|
|
1365
|
+
h(this, Ne, Ht);
|
|
1366
|
+
h(this, je, Ze());
|
|
1367
|
+
h(this, Me, []);
|
|
1368
|
+
h(this, Te, []);
|
|
1369
|
+
h(this, qe, []);
|
|
1370
|
+
h(this, Ae, []);
|
|
1371
|
+
h(this, B, {
|
|
1334
1372
|
root: this,
|
|
1335
1373
|
data: {}
|
|
1336
1374
|
});
|
|
1337
|
-
|
|
1375
|
+
h(this, x, {
|
|
1338
1376
|
info: "development",
|
|
1339
1377
|
log: "development",
|
|
1340
1378
|
warn: "development",
|
|
1341
1379
|
error: !0
|
|
1342
1380
|
});
|
|
1343
|
-
|
|
1344
|
-
S(this, "watch", s(this,
|
|
1381
|
+
h(this, z, dt("*,-dolla/*"));
|
|
1382
|
+
S(this, "watch", s(this, je).watch);
|
|
1345
1383
|
S(this, "createState", ie);
|
|
1346
|
-
S(this, "createSettableState",
|
|
1384
|
+
S(this, "createSettableState", jt);
|
|
1347
1385
|
S(this, "toSettableState", Mt);
|
|
1348
|
-
S(this, "toState",
|
|
1349
|
-
S(this, "valueOf",
|
|
1386
|
+
S(this, "toState", Tt);
|
|
1387
|
+
S(this, "valueOf", qt);
|
|
1350
1388
|
S(this, "derive", ye);
|
|
1351
1389
|
S(this, "createWatcher", Ze);
|
|
1352
|
-
S(this, "createRef",
|
|
1353
|
-
S(this, "isRef",
|
|
1390
|
+
S(this, "createRef", At);
|
|
1391
|
+
S(this, "isRef", _t);
|
|
1354
1392
|
const e = this;
|
|
1355
|
-
this.http = new
|
|
1393
|
+
this.http = new It(), this.i18n = new Yt(this), this.render = new Zt(this), this.router = new sr(this, {
|
|
1356
1394
|
get rootElement() {
|
|
1357
1395
|
return s(e, G);
|
|
1358
1396
|
},
|
|
@@ -1372,21 +1410,21 @@ class ar {
|
|
|
1372
1410
|
* Environment affects which log messages will print and how much debugging info is included in the DOM.
|
|
1373
1411
|
*/
|
|
1374
1412
|
getEnv() {
|
|
1375
|
-
return s(this,
|
|
1413
|
+
return s(this, De);
|
|
1376
1414
|
}
|
|
1377
1415
|
/**
|
|
1378
1416
|
* Sets the environment that this app is running in.
|
|
1379
1417
|
* Environment affects which log messages will print and how much debugging info is included in the DOM.
|
|
1380
1418
|
*/
|
|
1381
1419
|
setEnv(e) {
|
|
1382
|
-
b(this,
|
|
1420
|
+
b(this, De, e);
|
|
1383
1421
|
}
|
|
1384
1422
|
/**
|
|
1385
1423
|
* Sets the view that will be shown when the `crash` method is called on any logger.
|
|
1386
1424
|
* When a crash is reported the app will be unmounted and replaced with this crash page.
|
|
1387
1425
|
*/
|
|
1388
1426
|
setCrashView(e) {
|
|
1389
|
-
b(this,
|
|
1427
|
+
b(this, Ne, e);
|
|
1390
1428
|
}
|
|
1391
1429
|
/**
|
|
1392
1430
|
* Sets a context variable and returns its value. Context variables are accessible on the app and in child views.
|
|
@@ -1409,21 +1447,21 @@ class ar {
|
|
|
1409
1447
|
async mount(e, t) {
|
|
1410
1448
|
if (s(this, W))
|
|
1411
1449
|
throw new Error("Dolla is already mounted.");
|
|
1412
|
-
if (
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1450
|
+
if (C(e)) {
|
|
1451
|
+
const n = document.querySelector(e);
|
|
1452
|
+
pt(HTMLElement, n, `Selector '${e}' did not match any element.`), b(this, G, n);
|
|
1415
1453
|
} else
|
|
1416
|
-
|
|
1454
|
+
pt(HTMLElement, e, "Expected an HTML element or a selector string. Got type: %t, value: %v"), b(this, G, e);
|
|
1417
1455
|
let r;
|
|
1418
|
-
t ? r = gt(t) : r = gt(
|
|
1419
|
-
for (const
|
|
1420
|
-
|
|
1456
|
+
t ? r = gt(t) : r = gt(Et), b(this, te, this.constructView(r.type, r.props)), await Promise.all(s(this, Me).map((n) => n())), s(this, te).mount(s(this, G)), b(this, W, !0);
|
|
1457
|
+
for (const n of s(this, Te))
|
|
1458
|
+
n();
|
|
1421
1459
|
}
|
|
1422
1460
|
async unmount() {
|
|
1423
1461
|
var e;
|
|
1424
1462
|
if (s(this, W)) {
|
|
1425
|
-
await Promise.all(s(this,
|
|
1426
|
-
for (const t of s(this,
|
|
1463
|
+
await Promise.all(s(this, qe).map((t) => t())), (e = s(this, te)) == null || e.unmount(), s(this, je).stopAll(), b(this, W, !1);
|
|
1464
|
+
for (const t of s(this, Ae))
|
|
1427
1465
|
t();
|
|
1428
1466
|
}
|
|
1429
1467
|
}
|
|
@@ -1432,26 +1470,26 @@ class ar {
|
|
|
1432
1470
|
* it will be awaited before mounting finishes. Use this to perform initial setup before the app is displayed to the user.
|
|
1433
1471
|
*/
|
|
1434
1472
|
beforeMount(e) {
|
|
1435
|
-
s(this,
|
|
1473
|
+
s(this, Me).push(e);
|
|
1436
1474
|
}
|
|
1437
1475
|
/**
|
|
1438
1476
|
* Registers a `callback` to run after the app is mounted.
|
|
1439
1477
|
*/
|
|
1440
1478
|
onMount(e) {
|
|
1441
|
-
s(this,
|
|
1479
|
+
s(this, Te).push(e);
|
|
1442
1480
|
}
|
|
1443
1481
|
/**
|
|
1444
1482
|
* Registers a `callback` to run after `Dolla.unmount` is called, before the app is unmounted. If `callback` returns a Promise,
|
|
1445
1483
|
* it will be awaited before unmounting finishes. Use this to perform cleanup.
|
|
1446
1484
|
*/
|
|
1447
1485
|
beforeUnmount(e) {
|
|
1448
|
-
s(this,
|
|
1486
|
+
s(this, qe).push(e);
|
|
1449
1487
|
}
|
|
1450
1488
|
/**
|
|
1451
1489
|
* Registers a `callback` to run after the app is unmounted.
|
|
1452
1490
|
*/
|
|
1453
1491
|
onUnmount(e) {
|
|
1454
|
-
s(this,
|
|
1492
|
+
s(this, Ae).push(e);
|
|
1455
1493
|
}
|
|
1456
1494
|
/**
|
|
1457
1495
|
* Update log type toggles. Values that are not passed will remain unchanged.
|
|
@@ -1466,19 +1504,21 @@ class ar {
|
|
|
1466
1504
|
b(this, z, dt(e));
|
|
1467
1505
|
}
|
|
1468
1506
|
createLogger(e, t) {
|
|
1469
|
-
const r =
|
|
1507
|
+
const r = (t == null ? void 0 : t.console) ?? Ft(), n = this;
|
|
1470
1508
|
return {
|
|
1509
|
+
setName(a) {
|
|
1510
|
+
return e = a, this;
|
|
1511
|
+
},
|
|
1471
1512
|
get info() {
|
|
1472
|
-
var
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
return Ce;
|
|
1513
|
+
var a;
|
|
1514
|
+
if (s(n, x).info === !1 || C(s(n, x).info) && s(n, x).info !== n.getEnv() || !s(a = n, z).call(a, e))
|
|
1515
|
+
return _e;
|
|
1476
1516
|
{
|
|
1477
|
-
let
|
|
1478
|
-
return t != null && t.uid ?
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
`color:${Fe(
|
|
1517
|
+
let o = `%c${e}`;
|
|
1518
|
+
return t != null && t.uid ? o += ` %c[uid: %c${t.uid}%c]` : o += "%c%c%c", r.info.bind(
|
|
1519
|
+
r,
|
|
1520
|
+
o,
|
|
1521
|
+
`color:${Fe(o)};font-weight:bold`,
|
|
1482
1522
|
"color:#777",
|
|
1483
1523
|
"color:#aaa",
|
|
1484
1524
|
"color:#777"
|
|
@@ -1486,16 +1526,15 @@ class ar {
|
|
|
1486
1526
|
}
|
|
1487
1527
|
},
|
|
1488
1528
|
get log() {
|
|
1489
|
-
var
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
return Ce;
|
|
1529
|
+
var a;
|
|
1530
|
+
if (s(n, x).log === !1 || C(s(n, x).log) && s(n, x).log !== n.getEnv() || !s(a = n, z).call(a, e))
|
|
1531
|
+
return _e;
|
|
1493
1532
|
{
|
|
1494
|
-
let
|
|
1495
|
-
return t != null && t.uid ?
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
`color:${Fe(
|
|
1533
|
+
let o = `%c${e}`;
|
|
1534
|
+
return t != null && t.uid ? o += ` %c[uid: %c${t.uid}%c]` : o += "%c%c%c", r.log.bind(
|
|
1535
|
+
r,
|
|
1536
|
+
o,
|
|
1537
|
+
`color:${Fe(o)};font-weight:bold`,
|
|
1499
1538
|
"color:#777",
|
|
1500
1539
|
"color:#aaa",
|
|
1501
1540
|
"color:#777"
|
|
@@ -1503,16 +1542,15 @@ class ar {
|
|
|
1503
1542
|
}
|
|
1504
1543
|
},
|
|
1505
1544
|
get warn() {
|
|
1506
|
-
var
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
return Ce;
|
|
1545
|
+
var a;
|
|
1546
|
+
if (s(n, x).warn === !1 || C(s(n, x).warn) && s(n, x).warn !== n.getEnv() || !s(a = n, z).call(a, e))
|
|
1547
|
+
return _e;
|
|
1510
1548
|
{
|
|
1511
|
-
let
|
|
1512
|
-
return t != null && t.uid ?
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
`color:${Fe(
|
|
1549
|
+
let o = `%c${e}`;
|
|
1550
|
+
return t != null && t.uid ? o += ` %c[uid: %c${t.uid}%c]` : o += "%c%c%c", r.warn.bind(
|
|
1551
|
+
r,
|
|
1552
|
+
o,
|
|
1553
|
+
`color:${Fe(o)};font-weight:bold`,
|
|
1516
1554
|
"color:#777",
|
|
1517
1555
|
"color:#aaa",
|
|
1518
1556
|
"color:#777"
|
|
@@ -1520,28 +1558,27 @@ class ar {
|
|
|
1520
1558
|
}
|
|
1521
1559
|
},
|
|
1522
1560
|
get error() {
|
|
1523
|
-
var
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
return Ce;
|
|
1561
|
+
var a;
|
|
1562
|
+
if (s(n, x).error === !1 || C(s(n, x).error) && s(n, x).error !== n.getEnv() || !s(a = n, z).call(a, e))
|
|
1563
|
+
return _e;
|
|
1527
1564
|
{
|
|
1528
|
-
let
|
|
1529
|
-
return t != null && t.uid ?
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
`color:${Fe(
|
|
1565
|
+
let o = `%c${e}`;
|
|
1566
|
+
return t != null && t.uid ? o += ` %c[uid: %c${t.uid}%c]` : o += "%c%c%c", r.error.bind(
|
|
1567
|
+
r,
|
|
1568
|
+
o,
|
|
1569
|
+
`color:${Fe(o)};font-weight:bold`,
|
|
1533
1570
|
"color:#777",
|
|
1534
1571
|
"color:#aaa",
|
|
1535
1572
|
"color:#777"
|
|
1536
1573
|
);
|
|
1537
1574
|
}
|
|
1538
1575
|
},
|
|
1539
|
-
crash(
|
|
1540
|
-
throw n.isMounted && (n.unmount(), n.constructView(s(n,
|
|
1541
|
-
error:
|
|
1542
|
-
loggerName:
|
|
1576
|
+
crash(a) {
|
|
1577
|
+
throw n.isMounted && (n.unmount(), n.constructView(s(n, Ne), {
|
|
1578
|
+
error: a,
|
|
1579
|
+
loggerName: e,
|
|
1543
1580
|
uid: t == null ? void 0 : t.uid
|
|
1544
|
-
}).mount(s(n, G))),
|
|
1581
|
+
}).mount(s(n, G))), a;
|
|
1545
1582
|
}
|
|
1546
1583
|
};
|
|
1547
1584
|
}
|
|
@@ -1549,41 +1586,41 @@ class ar {
|
|
|
1549
1586
|
*
|
|
1550
1587
|
*/
|
|
1551
1588
|
constructView(e, t, r = []) {
|
|
1552
|
-
return
|
|
1589
|
+
return new Ct(s(this, B), e, t, r);
|
|
1553
1590
|
}
|
|
1554
1591
|
/**
|
|
1555
1592
|
*
|
|
1556
1593
|
*/
|
|
1557
1594
|
constructMarkup(e) {
|
|
1558
|
-
return
|
|
1595
|
+
return Vt(Ut(s(this, B), e));
|
|
1559
1596
|
}
|
|
1560
1597
|
}
|
|
1561
|
-
W = new WeakMap(),
|
|
1562
|
-
const
|
|
1563
|
-
function
|
|
1598
|
+
W = new WeakMap(), De = new WeakMap(), G = new WeakMap(), te = new WeakMap(), Ne = new WeakMap(), je = new WeakMap(), Me = new WeakMap(), Te = new WeakMap(), qe = new WeakMap(), Ae = new WeakMap(), B = new WeakMap(), x = new WeakMap(), z = new WeakMap();
|
|
1599
|
+
const bt = new ur(), pr = bt.i18n.t.bind(bt.i18n);
|
|
1600
|
+
function gr(i) {
|
|
1564
1601
|
typeof window < "u" && (window.DOLLA_DEV_DEBUG = i);
|
|
1565
1602
|
}
|
|
1566
|
-
function
|
|
1603
|
+
function mr() {
|
|
1567
1604
|
return typeof window < "u" ? window.DOLLA_DEV_DEBUG === !0 : !1;
|
|
1568
1605
|
}
|
|
1569
1606
|
export {
|
|
1570
1607
|
Rt as cond,
|
|
1571
1608
|
gt as createMarkup,
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1609
|
+
At as createRef,
|
|
1610
|
+
jt as createSettableState,
|
|
1611
|
+
br as createSetter,
|
|
1575
1612
|
ie as createState,
|
|
1576
|
-
|
|
1613
|
+
bt as default,
|
|
1577
1614
|
ye as derive,
|
|
1578
|
-
|
|
1615
|
+
mr as getDevDebug,
|
|
1579
1616
|
ht as html,
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1617
|
+
_t as isRef,
|
|
1618
|
+
vr as portal,
|
|
1619
|
+
Er as repeat,
|
|
1620
|
+
gr as setDevDebug,
|
|
1621
|
+
pr as t,
|
|
1585
1622
|
Mt as toSettableState,
|
|
1586
|
-
|
|
1587
|
-
|
|
1623
|
+
Tt as toState,
|
|
1624
|
+
qt as valueOf
|
|
1588
1625
|
};
|
|
1589
1626
|
//# sourceMappingURL=index.js.map
|