@react-motion-router/core 2.0.0-beta.sha-c19f37e → 2.0.0-beta.sha-9a4805f
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/build/Anchor.d.ts +8 -6
- package/build/RouterBase.d.ts +4 -1
- package/build/ScreenBase.d.ts +7 -6
- package/build/ScreenTransitionLayer.d.ts +0 -1
- package/build/ScreenTransitionProvider.d.ts +12 -27
- package/build/ViewTransitionSharedElement.d.ts +14 -0
- package/build/__tests__/Anchor/common/constants.d.ts +1 -0
- package/build/__tests__/common/utils.d.ts +4 -0
- package/build/common/events.d.ts +1 -1
- package/build/common/test-utils.d.ts +1 -1
- package/build/common/types.d.ts +9 -5
- package/build/common/utils.d.ts +1 -1
- package/build/index.js +641 -692
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
class
|
|
5
|
-
ref =
|
|
6
|
-
static contextType =
|
|
1
|
+
import { jsx as R, jsxs as ee, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import we, { createContext as mt, Component as vt, createRef as Y, useContext as at, useImperativeHandle as ne, Suspense as xt, isValidElement as ie, cloneElement as se, lazy as Ee, Children as Xt, useDebugValue as be, useSyncExternalStore as re, useRef as Vt, useEffect as ae, useCallback as Te } from "react";
|
|
3
|
+
const oe = mt(null);
|
|
4
|
+
class Qe extends vt {
|
|
5
|
+
ref = Y();
|
|
6
|
+
static contextType = oe;
|
|
7
7
|
componentDidMount() {
|
|
8
8
|
this.scene.addNode(this);
|
|
9
9
|
}
|
|
@@ -44,7 +44,7 @@ class Je extends at {
|
|
|
44
44
|
this.ref.current && (this.ref.current.style.visibility = "visible");
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ R(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
50
|
ref: this.ref,
|
|
@@ -55,65 +55,35 @@ class Je extends at {
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const Kt =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
ref: d.current,
|
|
83
|
-
index: l,
|
|
84
|
-
screens: m,
|
|
85
|
-
exiting: f,
|
|
86
|
-
timeline: a,
|
|
87
|
-
direction: n,
|
|
88
|
-
playbackRate: o,
|
|
89
|
-
hasUAVisualTransition: r
|
|
90
|
-
}) ?? null;
|
|
91
|
-
}
|
|
92
|
-
setZIndex(t) {
|
|
93
|
-
return new Promise((e) => this.setState({ zIndex: t }, e));
|
|
94
|
-
}
|
|
95
|
-
render() {
|
|
96
|
-
const t = this.props.renderAs, e = this.props.focused ? void 0 : "";
|
|
97
|
-
return /* @__PURE__ */ T(
|
|
98
|
-
t,
|
|
99
|
-
{
|
|
100
|
-
id: this.props.id,
|
|
101
|
-
className: "screen-transition-provider",
|
|
102
|
-
ref: this.ref,
|
|
103
|
-
inert: e,
|
|
104
|
-
style: {
|
|
105
|
-
gridArea: "1 / 1",
|
|
106
|
-
width: "100%",
|
|
107
|
-
height: "100%",
|
|
108
|
-
transformOrigin: "center center",
|
|
109
|
-
zIndex: this.state.zIndex
|
|
110
|
-
},
|
|
111
|
-
children: this.props.children
|
|
58
|
+
const Kt = mt(null), tn = 2147483647, en = 100, nn = 0, sn = 0, rn = 1, le = -1, O = 0, J = 1, an = 0;
|
|
59
|
+
function Re(i) {
|
|
60
|
+
const t = at(Kt);
|
|
61
|
+
return ne(
|
|
62
|
+
i.ref,
|
|
63
|
+
() => ({
|
|
64
|
+
index: O,
|
|
65
|
+
exiting: !1,
|
|
66
|
+
get screenElementRef() {
|
|
67
|
+
return i.screenElementRef;
|
|
68
|
+
},
|
|
69
|
+
get animationEffect() {
|
|
70
|
+
const e = i.animation, { animation: n, direction: s, hasUAVisualTransition: a } = t, { timeline: o, playbackRate: l } = n, { index: f, exiting: d, screenElementRef: m } = this, { viewTransitionName: T } = i, E = t.screens.map((K) => K.current?.name);
|
|
71
|
+
return e?.({
|
|
72
|
+
ref: m.current,
|
|
73
|
+
index: f,
|
|
74
|
+
screens: E,
|
|
75
|
+
exiting: d,
|
|
76
|
+
timeline: o,
|
|
77
|
+
direction: s,
|
|
78
|
+
playbackRate: l,
|
|
79
|
+
viewTransitionName: T,
|
|
80
|
+
hasUAVisualTransition: a
|
|
81
|
+
}) ?? null;
|
|
112
82
|
}
|
|
113
|
-
)
|
|
114
|
-
|
|
83
|
+
})
|
|
84
|
+
), i.children;
|
|
115
85
|
}
|
|
116
|
-
const
|
|
86
|
+
const ce = mt(null), gt = mt(null), ue = mt(null);
|
|
117
87
|
class Se {
|
|
118
88
|
id;
|
|
119
89
|
nodes = /* @__PURE__ */ new Map();
|
|
@@ -149,17 +119,15 @@ class Se {
|
|
|
149
119
|
return !this.nodes.size;
|
|
150
120
|
}
|
|
151
121
|
}
|
|
152
|
-
class
|
|
122
|
+
class ke extends vt {
|
|
153
123
|
sharedElementScene;
|
|
154
|
-
#t =
|
|
155
|
-
ref = z();
|
|
124
|
+
#t = Y();
|
|
156
125
|
nestedRouterData;
|
|
157
|
-
static contextType =
|
|
126
|
+
static contextType = gt;
|
|
158
127
|
state = {
|
|
159
128
|
focused: !1,
|
|
160
129
|
config: {},
|
|
161
|
-
params: {}
|
|
162
|
-
elementType: "div"
|
|
130
|
+
params: {}
|
|
163
131
|
};
|
|
164
132
|
constructor(t, e) {
|
|
165
133
|
super(t), this.sharedElementScene = new Se(
|
|
@@ -169,6 +137,10 @@ class Re extends at {
|
|
|
169
137
|
parentRouter: e
|
|
170
138
|
};
|
|
171
139
|
}
|
|
140
|
+
handleEvent(t) {
|
|
141
|
+
const e = `on${t.type}`;
|
|
142
|
+
this[e]?.(t);
|
|
143
|
+
}
|
|
172
144
|
setParams(t) {
|
|
173
145
|
this.setState(({ params: e }) => ({ params: { ...e, ...t } }));
|
|
174
146
|
}
|
|
@@ -179,7 +151,7 @@ class Re extends at {
|
|
|
179
151
|
return this.state.focused;
|
|
180
152
|
}
|
|
181
153
|
get name() {
|
|
182
|
-
return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") :
|
|
154
|
+
return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : q(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
|
|
183
155
|
}
|
|
184
156
|
blur() {
|
|
185
157
|
return new Promise((t) => {
|
|
@@ -192,9 +164,9 @@ class Re extends at {
|
|
|
192
164
|
});
|
|
193
165
|
}
|
|
194
166
|
async load(t) {
|
|
195
|
-
const e = this.props.component, n = this.props.config?.header?.component,
|
|
167
|
+
const e = this.props.component, n = this.props.config?.header?.component, s = this.props.config?.footer?.component;
|
|
196
168
|
let a;
|
|
197
|
-
|
|
169
|
+
q(e) ? a = await e.load() : a = { default: e }, q(n) && await n.load(), q(s) && await s.load();
|
|
198
170
|
const o = this.context.navigation, l = this.routeProp, f = !1;
|
|
199
171
|
return await this.props.config?.onLoad?.({ navigation: o, route: l, signal: t, preloading: f }), a;
|
|
200
172
|
}
|
|
@@ -237,123 +209,106 @@ class Re extends at {
|
|
|
237
209
|
return this.#t;
|
|
238
210
|
}
|
|
239
211
|
render() {
|
|
240
|
-
const t = this.context.navigation, e = this.routeProp, n = this.props.component,
|
|
241
|
-
return /* @__PURE__ */
|
|
242
|
-
|
|
212
|
+
const t = this.context.navigation, e = this.routeProp, n = this.props.component, s = e.config.header?.component, a = e.config.footer?.component;
|
|
213
|
+
return /* @__PURE__ */ R(
|
|
214
|
+
Re,
|
|
243
215
|
{
|
|
244
216
|
ref: this.#t,
|
|
245
|
-
|
|
246
|
-
|
|
217
|
+
screenElementRef: this.ref,
|
|
218
|
+
viewTransitionName: this.viewTransitionName,
|
|
247
219
|
animation: e.config.animation,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
220
|
+
children: /* @__PURE__ */ R(oe.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ R(ue.Provider, { value: e, children: /* @__PURE__ */ ee(ce.Provider, { value: this.nestedRouterData, children: [
|
|
221
|
+
/* @__PURE__ */ R(xt, { fallback: /* @__PURE__ */ R(
|
|
222
|
+
Z,
|
|
223
|
+
{
|
|
224
|
+
component: e.config.header?.fallback,
|
|
225
|
+
route: e,
|
|
226
|
+
navigation: t
|
|
227
|
+
}
|
|
228
|
+
), children: /* @__PURE__ */ R(
|
|
229
|
+
Z,
|
|
230
|
+
{
|
|
231
|
+
component: s,
|
|
232
|
+
route: e,
|
|
233
|
+
navigation: t
|
|
234
|
+
}
|
|
235
|
+
) }),
|
|
236
|
+
/* @__PURE__ */ R(xt, { fallback: /* @__PURE__ */ R(
|
|
237
|
+
Z,
|
|
238
|
+
{
|
|
239
|
+
component: this.props.fallback,
|
|
240
|
+
route: e,
|
|
241
|
+
navigation: t
|
|
242
|
+
}
|
|
243
|
+
), children: /* @__PURE__ */ R(
|
|
244
|
+
Z,
|
|
245
|
+
{
|
|
246
|
+
component: n,
|
|
247
|
+
route: e,
|
|
248
|
+
navigation: t
|
|
249
|
+
}
|
|
250
|
+
) }),
|
|
251
|
+
/* @__PURE__ */ R(
|
|
252
|
+
xt,
|
|
253
|
+
{
|
|
254
|
+
fallback: /* @__PURE__ */ R(
|
|
255
|
+
Z,
|
|
281
256
|
{
|
|
282
|
-
component:
|
|
257
|
+
component: e.config.footer?.fallback,
|
|
283
258
|
route: e,
|
|
284
259
|
navigation: t
|
|
285
260
|
}
|
|
286
|
-
),
|
|
287
|
-
|
|
261
|
+
),
|
|
262
|
+
children: /* @__PURE__ */ R(
|
|
263
|
+
Z,
|
|
288
264
|
{
|
|
289
|
-
component:
|
|
265
|
+
component: a,
|
|
290
266
|
route: e,
|
|
291
267
|
navigation: t
|
|
292
268
|
}
|
|
293
|
-
) }),
|
|
294
|
-
/* @__PURE__ */ T(
|
|
295
|
-
xt,
|
|
296
|
-
{
|
|
297
|
-
fallback: /* @__PURE__ */ T(
|
|
298
|
-
_,
|
|
299
|
-
{
|
|
300
|
-
component: e.config.footer?.fallback,
|
|
301
|
-
route: e,
|
|
302
|
-
navigation: t
|
|
303
|
-
}
|
|
304
|
-
),
|
|
305
|
-
children: /* @__PURE__ */ T(
|
|
306
|
-
_,
|
|
307
|
-
{
|
|
308
|
-
component: a,
|
|
309
|
-
route: e,
|
|
310
|
-
navigation: t
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
}
|
|
314
269
|
)
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
)
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
] }) }) })
|
|
318
273
|
}
|
|
319
274
|
);
|
|
320
275
|
}
|
|
321
276
|
}
|
|
322
|
-
function
|
|
323
|
-
|
|
277
|
+
function Z({ component: i, route: t, navigation: e }) {
|
|
278
|
+
q(i) && i.module?.default && (i = i.module.default);
|
|
324
279
|
const n = i ?? null;
|
|
325
|
-
return typeof n == "function" || he(n) ? /* @__PURE__ */
|
|
280
|
+
return typeof n == "function" || he(n) ? /* @__PURE__ */ R(
|
|
326
281
|
n,
|
|
327
282
|
{
|
|
328
283
|
navigation: e,
|
|
329
284
|
route: t
|
|
330
285
|
}
|
|
331
|
-
) :
|
|
286
|
+
) : ie(n) ? se(n, {
|
|
332
287
|
navigation: e,
|
|
333
288
|
route: t
|
|
334
|
-
}) : /* @__PURE__ */
|
|
289
|
+
}) : /* @__PURE__ */ R(ye, { children: n });
|
|
335
290
|
}
|
|
336
|
-
function
|
|
337
|
-
return
|
|
291
|
+
function xe(i) {
|
|
292
|
+
return ie(i) ? Object.getPrototypeOf(i.type) === ke : !1;
|
|
338
293
|
}
|
|
339
294
|
function he(i) {
|
|
340
295
|
return typeof i == "object" && i !== null && i.$$typeof === Symbol.for("react.lazy");
|
|
341
296
|
}
|
|
342
|
-
function
|
|
297
|
+
function q(i) {
|
|
343
298
|
return he(i) && "load" in i;
|
|
344
299
|
}
|
|
345
|
-
function
|
|
300
|
+
function Ce(i) {
|
|
346
301
|
return "style" in i && i.style instanceof CSSStyleDeclaration;
|
|
347
302
|
}
|
|
348
|
-
var
|
|
303
|
+
var Le = Object.defineProperty, Me = (i, t, e) => t in i ? Le(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, V = (i, t, e) => (Me(i, typeof t != "symbol" ? t + "" : t, e), e), Bt = (i, t, e) => {
|
|
349
304
|
if (!t.has(i))
|
|
350
305
|
throw TypeError("Cannot " + e);
|
|
351
|
-
},
|
|
306
|
+
}, r = (i, t, e) => (Bt(i, t, "read from private field"), e ? e.call(i) : t.get(i)), g = (i, t, e) => {
|
|
352
307
|
if (t.has(i))
|
|
353
308
|
throw TypeError("Cannot add the same private member more than once");
|
|
354
309
|
t instanceof WeakSet ? t.add(i) : t.set(i, e);
|
|
355
|
-
}, c = (i, t, e, n) => (Bt(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e),
|
|
356
|
-
const
|
|
310
|
+
}, c = (i, t, e, n) => (Bt(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), v = (i, t, e) => (Bt(i, t, "access private method"), e);
|
|
311
|
+
const ft = {
|
|
357
312
|
delay: 0,
|
|
358
313
|
direction: "normal",
|
|
359
314
|
duration: "auto",
|
|
@@ -362,19 +317,19 @@ const pt = {
|
|
|
362
317
|
fill: "auto",
|
|
363
318
|
iterationStart: 0,
|
|
364
319
|
iterations: 1
|
|
365
|
-
}, qt = 1e3,
|
|
320
|
+
}, qt = 1e3, Pe = window.Animation, yt = window.KeyframeEffect;
|
|
366
321
|
function Yt(i) {
|
|
367
322
|
return Array.isArray(i);
|
|
368
323
|
}
|
|
369
|
-
function
|
|
324
|
+
function _(i) {
|
|
370
325
|
return typeof i == "object" && i === null;
|
|
371
326
|
}
|
|
372
|
-
function
|
|
373
|
-
return
|
|
327
|
+
function u(i, t) {
|
|
328
|
+
return _(i) || typeof i == "number" ? i : (t || ([t] = Object.keys(i.type())), i.to(t).value);
|
|
374
329
|
}
|
|
375
|
-
function
|
|
376
|
-
let { duration: e = "auto", iterations: n = 1, playbackRate:
|
|
377
|
-
if (
|
|
330
|
+
function De(i, t = ft) {
|
|
331
|
+
let { duration: e = "auto", iterations: n = 1, playbackRate: s = 1 } = t;
|
|
332
|
+
if (_(i))
|
|
378
333
|
return i;
|
|
379
334
|
if (typeof i == "number" || i.type().percent === void 0)
|
|
380
335
|
throw new DOMException(
|
|
@@ -387,7 +342,7 @@ function Pe(i, t = pt) {
|
|
|
387
342
|
e = e.to("ms").value;
|
|
388
343
|
else if (typeof e == "string")
|
|
389
344
|
throw new TypeError("Unknown effect duration keyword.");
|
|
390
|
-
const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(
|
|
345
|
+
const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(s), f = a + l + o;
|
|
391
346
|
return ot(
|
|
392
347
|
i.to("percent").value,
|
|
393
348
|
[0, 100],
|
|
@@ -395,7 +350,7 @@ function Pe(i, t = pt) {
|
|
|
395
350
|
);
|
|
396
351
|
}
|
|
397
352
|
function kt(i) {
|
|
398
|
-
if (
|
|
353
|
+
if (_(i) || typeof i == "number")
|
|
399
354
|
return i;
|
|
400
355
|
if (i.type().time !== void 0)
|
|
401
356
|
throw new DOMException(
|
|
@@ -404,78 +359,78 @@ function kt(i) {
|
|
|
404
359
|
);
|
|
405
360
|
return i.to("ms").value;
|
|
406
361
|
}
|
|
407
|
-
function
|
|
408
|
-
const e = t.length - 1, n = Math.floor(i * e),
|
|
409
|
-
return
|
|
362
|
+
function _t(i, t) {
|
|
363
|
+
const e = t.length - 1, n = Math.floor(i * e), s = t[n], a = t[Math.min(n + 1, e)], o = i * e - n;
|
|
364
|
+
return s + o * (a - s);
|
|
410
365
|
}
|
|
411
|
-
function
|
|
412
|
-
let n = 0,
|
|
366
|
+
function Ne(i, t, e) {
|
|
367
|
+
let n = 0, s = 0;
|
|
413
368
|
for (const [a, o] of Object.entries(i)) {
|
|
414
369
|
const { min: l, max: f } = t, d = e[a] ?? 1, m = (o - l[a]) / (f[a] - l[a]) * d;
|
|
415
|
-
n += m,
|
|
370
|
+
n += m, s += d;
|
|
416
371
|
}
|
|
417
|
-
return n /
|
|
372
|
+
return n / s;
|
|
418
373
|
}
|
|
419
374
|
function ot(i, t, e, n = {}) {
|
|
420
|
-
let
|
|
375
|
+
let s;
|
|
421
376
|
if (typeof i == "number" && Yt(t)) {
|
|
422
377
|
const o = { x: t[0] }, l = { x: t[1] };
|
|
423
378
|
t = { min: o, max: l }, i = { x: i };
|
|
424
379
|
} else
|
|
425
380
|
throw new TypeError("Input and input range must have the same dimensions.");
|
|
426
|
-
if (
|
|
427
|
-
return
|
|
381
|
+
if (s = Ne(i, t, n), s = Ue(s, 0, 1), Yt(e))
|
|
382
|
+
return _t(s, e);
|
|
428
383
|
const a = {};
|
|
429
384
|
for (const o of Object.keys(e.min)) {
|
|
430
385
|
const l = e.min[o], f = e.max[o], d = [l, f];
|
|
431
|
-
a[o] =
|
|
386
|
+
a[o] = _t(s, d);
|
|
432
387
|
}
|
|
433
388
|
return a;
|
|
434
389
|
}
|
|
435
|
-
function
|
|
390
|
+
function Ue(i, t, e) {
|
|
436
391
|
return i < t ? t : e && i > e ? e : i;
|
|
437
392
|
}
|
|
438
|
-
function
|
|
393
|
+
function Ht(i) {
|
|
439
394
|
let {
|
|
440
395
|
duration: t = "auto",
|
|
441
396
|
iterations: e = 1,
|
|
442
397
|
playbackRate: n = 1,
|
|
443
|
-
delay:
|
|
398
|
+
delay: s = 0,
|
|
444
399
|
endDelay: a = 0,
|
|
445
400
|
localTime: o = null,
|
|
446
401
|
progress: l = null
|
|
447
402
|
} = i;
|
|
448
403
|
const f = new CSSUnitValue(100, "percent");
|
|
449
404
|
if (t === "auto")
|
|
450
|
-
t = qt,
|
|
405
|
+
t = qt, s = 0, a = 0;
|
|
451
406
|
else if (t instanceof CSSNumericValue)
|
|
452
407
|
t = t.to("ms").value;
|
|
453
408
|
else if (typeof t == "string")
|
|
454
409
|
throw TypeError("Unknown effect duration keyword.");
|
|
455
|
-
const d = t / e, m = d * e / Math.abs(n),
|
|
456
|
-
t = new CSSUnitValue(d /
|
|
410
|
+
const d = t / e, m = d * e / Math.abs(n), T = s + m + a;
|
|
411
|
+
t = new CSSUnitValue(d / T * 100, "percent");
|
|
457
412
|
const E = CSS.percent(t.to("percent").value * e / Math.abs(n));
|
|
458
|
-
return o !== null && (l =
|
|
413
|
+
return o !== null && (l = u(o, "percent") / f.value), {
|
|
459
414
|
...i,
|
|
460
415
|
progress: l,
|
|
461
416
|
activeDuration: E,
|
|
462
417
|
duration: t,
|
|
463
418
|
iterations: e,
|
|
464
|
-
delay:
|
|
419
|
+
delay: s,
|
|
465
420
|
endDelay: a,
|
|
466
421
|
endTime: f
|
|
467
422
|
};
|
|
468
423
|
}
|
|
469
|
-
function
|
|
470
|
-
let { activeDuration: e = 0, localTime: n = null, endTime:
|
|
471
|
-
if (
|
|
424
|
+
function de(i, t) {
|
|
425
|
+
let { activeDuration: e = 0, localTime: n = null, endTime: s = 1 / 0, delay: a = 0 } = i;
|
|
426
|
+
if (s = u(s), e = u(e), n = u(n), n == null || n === void 0)
|
|
472
427
|
return "idle";
|
|
473
|
-
const o = Math.max(Math.min(a,
|
|
428
|
+
const o = Math.max(Math.min(a, s), 0), l = Math.max(Math.min(a + e, s), 0);
|
|
474
429
|
return n < o || t === "backwards" && n === o ? "before" : n > l || t === "forwards" && n === l ? "after" : "active";
|
|
475
430
|
}
|
|
476
|
-
function
|
|
477
|
-
let { localTime: e = null, delay: n = 0, activeDuration:
|
|
478
|
-
if (
|
|
431
|
+
function Ae(i, t) {
|
|
432
|
+
let { localTime: e = null, delay: n = 0, activeDuration: s = 0, fill: a } = i;
|
|
433
|
+
if (s = u(s), e = u(e), e == null || e === void 0)
|
|
479
434
|
return null;
|
|
480
435
|
switch (t) {
|
|
481
436
|
case "before":
|
|
@@ -483,68 +438,68 @@ function Ue(i, t) {
|
|
|
483
438
|
case "active":
|
|
484
439
|
return e - n;
|
|
485
440
|
case "after":
|
|
486
|
-
return a === "forwards" || a === "both" ? Math.max(Math.min(e - n,
|
|
441
|
+
return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, s), 0) : null;
|
|
487
442
|
default:
|
|
488
443
|
return null;
|
|
489
444
|
}
|
|
490
445
|
}
|
|
491
|
-
function
|
|
492
|
-
const { duration: n = 0, iterations:
|
|
446
|
+
function We(i, t, e) {
|
|
447
|
+
const { duration: n = 0, iterations: s = 1, iterationStart: a = 0 } = i;
|
|
493
448
|
if (typeof n != "number")
|
|
494
449
|
throw new TypeError("Duration cannot be unresolved");
|
|
495
450
|
let o = 0;
|
|
496
|
-
return n === 0 ? t === "before" ? o = 0 : o =
|
|
451
|
+
return n === 0 ? t === "before" ? o = 0 : o = s : o = e / kt(n), o + a;
|
|
497
452
|
}
|
|
498
453
|
function Ie(i, t, e, n) {
|
|
499
|
-
const { iterations:
|
|
500
|
-
if (
|
|
454
|
+
const { iterations: s = 1, iterationStart: a = 0, activeDuration: o = 0 } = i;
|
|
455
|
+
if (_(e))
|
|
501
456
|
return null;
|
|
502
457
|
let l = 0;
|
|
503
|
-
return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n &&
|
|
458
|
+
return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && s !== 0 && (l = 1), l;
|
|
504
459
|
}
|
|
505
|
-
function
|
|
506
|
-
const { iterations: e = 1 } = i, n =
|
|
507
|
-
if (
|
|
460
|
+
function fe(i, t) {
|
|
461
|
+
const { iterations: e = 1 } = i, n = Ae(i, t);
|
|
462
|
+
if (_(n))
|
|
508
463
|
return null;
|
|
509
464
|
if (t === "after" && e === 1 / 0)
|
|
510
465
|
return 1 / 0;
|
|
511
|
-
const
|
|
512
|
-
return Ie(i, t,
|
|
466
|
+
const s = We(i, t, n);
|
|
467
|
+
return Ie(i, t, s, n) === 1 ? Math.floor(s) - 1 : Math.floor(s);
|
|
513
468
|
}
|
|
514
|
-
class
|
|
469
|
+
class $e extends Event {
|
|
515
470
|
constructor(t) {
|
|
516
|
-
super("update", { bubbles: !1, cancelable: !1, composed: !1 }),
|
|
471
|
+
super("update", { bubbles: !1, cancelable: !1, composed: !1 }), V(this, "currentTime"), this.currentTime = t;
|
|
517
472
|
}
|
|
518
473
|
}
|
|
519
474
|
var U, Q;
|
|
520
475
|
class b extends EventTarget {
|
|
521
476
|
constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
|
|
522
|
-
super(),
|
|
477
|
+
super(), g(this, U, void 0), g(this, Q, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), c(this, Q, CSS.percent(0)), c(this, U, t);
|
|
523
478
|
}
|
|
524
479
|
onGesture(t) {
|
|
525
|
-
const e =
|
|
480
|
+
const e = r(this, U).source.getBoundingClientRect();
|
|
526
481
|
let n = 0;
|
|
527
|
-
const
|
|
482
|
+
const s = {
|
|
528
483
|
x: t.x - e.left,
|
|
529
484
|
y: t.y - e.top
|
|
530
485
|
};
|
|
531
|
-
switch (
|
|
486
|
+
switch (r(this, U).type) {
|
|
532
487
|
case "swipe": {
|
|
533
|
-
const { rangeStart: a, rangeEnd: o } =
|
|
488
|
+
const { rangeStart: a, rangeEnd: o } = r(this, U), l = r(this, U).axis;
|
|
534
489
|
n = ot(
|
|
535
|
-
|
|
536
|
-
[
|
|
490
|
+
s[l],
|
|
491
|
+
[u(a, "px"), u(o, "px")],
|
|
537
492
|
[0, 100]
|
|
538
493
|
);
|
|
539
494
|
break;
|
|
540
495
|
}
|
|
541
496
|
case "pan": {
|
|
542
|
-
const { rangeStart: a, rangeEnd: o } =
|
|
497
|
+
const { rangeStart: a, rangeEnd: o } = r(this, U), { x: l, y: f } = s;
|
|
543
498
|
n = ot(
|
|
544
499
|
{ x: l, y: f },
|
|
545
500
|
{
|
|
546
|
-
min: { x:
|
|
547
|
-
max: { x:
|
|
501
|
+
min: { x: u(a.x, "px"), y: u(a.y, "px") },
|
|
502
|
+
max: { x: u(o.x, "px"), y: u(o.y, "px") }
|
|
548
503
|
},
|
|
549
504
|
[0, 100],
|
|
550
505
|
{ x: 1, y: 1 }
|
|
@@ -552,25 +507,25 @@ class b extends EventTarget {
|
|
|
552
507
|
break;
|
|
553
508
|
}
|
|
554
509
|
case "pinch": {
|
|
555
|
-
const { rangeStart: a, rangeEnd: o } =
|
|
510
|
+
const { rangeStart: a, rangeEnd: o } = r(this, U), { scale: l } = t;
|
|
556
511
|
n = ot(
|
|
557
512
|
l,
|
|
558
|
-
[
|
|
513
|
+
[u(a, ""), u(o, "")],
|
|
559
514
|
// figure out which unit
|
|
560
515
|
[0, 100]
|
|
561
516
|
);
|
|
562
517
|
break;
|
|
563
518
|
}
|
|
564
519
|
case "rotate": {
|
|
565
|
-
const { rangeStart: a, rangeEnd: o } =
|
|
520
|
+
const { rangeStart: a, rangeEnd: o } = r(this, U), { rotation: l } = t;
|
|
566
521
|
n = ot(
|
|
567
522
|
l,
|
|
568
|
-
[
|
|
523
|
+
[u(a, "deg"), u(o, "deg")],
|
|
569
524
|
[0, 100]
|
|
570
525
|
);
|
|
571
526
|
}
|
|
572
527
|
}
|
|
573
|
-
c(this, Q, CSS.percent(n)), this.dispatchEvent(new
|
|
528
|
+
c(this, Q, CSS.percent(n)), this.dispatchEvent(new $e(r(this, Q)));
|
|
574
529
|
}
|
|
575
530
|
addEventListener(t, e, n) {
|
|
576
531
|
super.addEventListener(t, e, n);
|
|
@@ -579,7 +534,7 @@ class b extends EventTarget {
|
|
|
579
534
|
super.removeEventListener(t, e, n);
|
|
580
535
|
}
|
|
581
536
|
get currentTime() {
|
|
582
|
-
return
|
|
537
|
+
return r(this, Q);
|
|
583
538
|
}
|
|
584
539
|
get phase() {
|
|
585
540
|
return "active";
|
|
@@ -590,10 +545,10 @@ const N = /* @__PURE__ */ new WeakMap();
|
|
|
590
545
|
var lt;
|
|
591
546
|
class wt extends yt {
|
|
592
547
|
constructor(t, e = null) {
|
|
593
|
-
super(t),
|
|
548
|
+
super(t), g(this, lt, null), c(this, lt, e);
|
|
594
549
|
}
|
|
595
550
|
get parent() {
|
|
596
|
-
return
|
|
551
|
+
return r(this, lt);
|
|
597
552
|
}
|
|
598
553
|
getTiming() {
|
|
599
554
|
var t;
|
|
@@ -614,7 +569,7 @@ class wt extends yt {
|
|
|
614
569
|
throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
|
|
615
570
|
if (e.iterations === 1 / 0)
|
|
616
571
|
throw TypeError("Effect iterations cannot be Infinity for non-monotonic timelines.");
|
|
617
|
-
return
|
|
572
|
+
return Ht(e);
|
|
618
573
|
}
|
|
619
574
|
return e;
|
|
620
575
|
}
|
|
@@ -626,10 +581,10 @@ class wt extends yt {
|
|
|
626
581
|
duration: n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration,
|
|
627
582
|
...t
|
|
628
583
|
};
|
|
629
|
-
let
|
|
630
|
-
for (;
|
|
631
|
-
const a =
|
|
632
|
-
t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration =
|
|
584
|
+
let s = r(this, lt);
|
|
585
|
+
for (; s; ) {
|
|
586
|
+
const a = s.getTiming();
|
|
587
|
+
t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration = u(a.duration, "ms")), s = s.parent;
|
|
633
588
|
}
|
|
634
589
|
if (((e = N.get(this)) == null ? void 0 : e.timeline) instanceof b) {
|
|
635
590
|
if (t?.duration === 1 / 0)
|
|
@@ -642,15 +597,15 @@ class wt extends yt {
|
|
|
642
597
|
}
|
|
643
598
|
lt = /* @__PURE__ */ new WeakMap();
|
|
644
599
|
var A, tt;
|
|
645
|
-
const
|
|
600
|
+
const Oe = class Et {
|
|
646
601
|
constructor(t) {
|
|
647
|
-
|
|
602
|
+
g(this, A, []), g(this, tt, null), c(this, A, t.map((e) => (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), e)));
|
|
648
603
|
}
|
|
649
604
|
get parent() {
|
|
650
|
-
return
|
|
605
|
+
return r(this, tt);
|
|
651
606
|
}
|
|
652
607
|
get children() {
|
|
653
|
-
const t =
|
|
608
|
+
const t = r(this, A);
|
|
654
609
|
return {
|
|
655
610
|
length: t.length,
|
|
656
611
|
item(e) {
|
|
@@ -659,30 +614,30 @@ const $e = class Et {
|
|
|
659
614
|
};
|
|
660
615
|
}
|
|
661
616
|
get firstChild() {
|
|
662
|
-
return
|
|
617
|
+
return r(this, A).at(0) ?? null;
|
|
663
618
|
}
|
|
664
619
|
get lastChild() {
|
|
665
|
-
return
|
|
620
|
+
return r(this, A).at(-1) ?? null;
|
|
666
621
|
}
|
|
667
622
|
clone() {
|
|
668
623
|
return structuredClone(this);
|
|
669
624
|
}
|
|
670
625
|
append(...t) {
|
|
671
626
|
t.forEach((e) => {
|
|
672
|
-
|
|
627
|
+
r(this, A).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, A).push(e));
|
|
673
628
|
});
|
|
674
629
|
}
|
|
675
630
|
prepend(...t) {
|
|
676
631
|
t.forEach((e) => {
|
|
677
|
-
|
|
632
|
+
r(this, A).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, A).unshift(e));
|
|
678
633
|
});
|
|
679
634
|
}
|
|
680
635
|
};
|
|
681
636
|
A = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap();
|
|
682
|
-
let
|
|
683
|
-
class
|
|
637
|
+
let zt = Oe;
|
|
638
|
+
class rt {
|
|
684
639
|
constructor() {
|
|
685
|
-
|
|
640
|
+
V(this, "promise"), V(this, "state"), V(this, "nativeResolve"), V(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
|
|
686
641
|
this.nativeResolve = t, this.nativeReject = e;
|
|
687
642
|
});
|
|
688
643
|
}
|
|
@@ -696,11 +651,11 @@ class st {
|
|
|
696
651
|
}), (e = this.nativeReject) == null || e.call(this, t);
|
|
697
652
|
}
|
|
698
653
|
}
|
|
699
|
-
var et,
|
|
700
|
-
class
|
|
701
|
-
constructor(t, e =
|
|
702
|
-
super(t),
|
|
703
|
-
...
|
|
654
|
+
var et, Lt, pe;
|
|
655
|
+
class je extends zt {
|
|
656
|
+
constructor(t, e = ft) {
|
|
657
|
+
super(t), g(this, Lt), g(this, et, void 0), c(this, et, {
|
|
658
|
+
...ft,
|
|
704
659
|
...e
|
|
705
660
|
});
|
|
706
661
|
}
|
|
@@ -711,12 +666,12 @@ class Oe extends Ht {
|
|
|
711
666
|
super.append(...t), t.forEach((e) => e.updateTiming());
|
|
712
667
|
}
|
|
713
668
|
getTiming() {
|
|
714
|
-
return
|
|
669
|
+
return r(this, et);
|
|
715
670
|
}
|
|
716
671
|
getComputedTiming() {
|
|
717
672
|
var t, e;
|
|
718
|
-
const n = this.getTiming(),
|
|
719
|
-
n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o,
|
|
673
|
+
const n = this.getTiming(), s = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime: l = 0 } = ((e = this.children.item(this.children.length - 1)) == null ? void 0 : e.getComputedTiming()) ?? {};
|
|
674
|
+
n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, s.endTime = l;
|
|
720
675
|
for (let C = 0; C < this.children.length; C++) {
|
|
721
676
|
const L = this.children.item(C);
|
|
722
677
|
if (!L)
|
|
@@ -725,17 +680,17 @@ class Oe extends Ht {
|
|
|
725
680
|
duration: M = "auto",
|
|
726
681
|
activeDuration: Gt = 0
|
|
727
682
|
} = L.getComputedTiming();
|
|
728
|
-
|
|
683
|
+
s.activeDuration = s.activeDuration ? u(s.activeDuration, "ms") + u(Gt, "ms") : Gt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, M = M instanceof CSSNumericValue ? M.to("ms").value : M, typeof M != "string" && (n.duration === "auto" ? n.duration = u(M, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + M : M));
|
|
729
684
|
}
|
|
730
|
-
const { timeline: f, startTime: d, currentTime: m } = N.get(this) ?? {},
|
|
731
|
-
let { duration: E = 0, iterations:
|
|
685
|
+
const { timeline: f, startTime: d, currentTime: m } = N.get(this) ?? {}, T = f instanceof b ? "percent" : "ms";
|
|
686
|
+
let { duration: E = 0, iterations: K = 1 } = s;
|
|
732
687
|
if (E === "auto" && (E = 0), typeof E == "string")
|
|
733
688
|
throw new TypeError("Unknown effect duration keyword.");
|
|
734
|
-
return
|
|
689
|
+
return s.duration = E, s.activeDuration = kt(E) * K, s.startTime = d ?? void 0, s.localTime = m, s.currentIteration = fe(s, de(s, r(this, Lt, pe))), f instanceof b ? Ht(s) : (f instanceof DocumentTimeline && (s.progress = m && u(m, T) / u(l, T)), s);
|
|
735
690
|
}
|
|
736
691
|
updateTiming(t) {
|
|
737
692
|
c(this, et, {
|
|
738
|
-
...
|
|
693
|
+
...r(this, et),
|
|
739
694
|
...t
|
|
740
695
|
});
|
|
741
696
|
for (let e = 0; e < this.children.length; e++) {
|
|
@@ -744,28 +699,28 @@ class Oe extends Ht {
|
|
|
744
699
|
}
|
|
745
700
|
}
|
|
746
701
|
}
|
|
747
|
-
et = /* @__PURE__ */ new WeakMap(),
|
|
702
|
+
et = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakSet(), pe = function() {
|
|
748
703
|
const { playbackRate: i = 1 } = N.get(this) ?? {};
|
|
749
704
|
return i < 0 ? "backwards" : "forwards";
|
|
750
705
|
};
|
|
751
|
-
var p, x, dt, w,
|
|
752
|
-
const
|
|
706
|
+
var p, x, dt, w, S, P, h, y, k, G, j, ct, W, bt, Mt, nt, ut, z, it, Pt, Zt, Dt, Jt, Nt, Qt, H, X, ht, Tt, Ut, I, F, D, $, Rt, At, Wt;
|
|
707
|
+
const me = class extends EventTarget {
|
|
753
708
|
constructor(t, e) {
|
|
754
|
-
super(),
|
|
709
|
+
super(), g(this, bt), g(this, nt), g(this, z), g(this, Pt), g(this, Dt), g(this, Nt), g(this, H), g(this, Tt), g(this, I), g(this, D), V(this, "id", ""), V(this, "oncancel", null), V(this, "onfinish", null), V(this, "onremove", null), g(this, p, void 0), g(this, x, void 0), g(this, dt, "active"), g(this, w, {
|
|
755
710
|
task: null,
|
|
756
711
|
playbackRate: null
|
|
757
|
-
}),
|
|
758
|
-
|
|
759
|
-
}),
|
|
712
|
+
}), g(this, S, new rt()), g(this, P, new rt()), g(this, h, null), g(this, y, null), g(this, k, []), g(this, G, null), g(this, j, !1), g(this, ct, 0), g(this, W, 1), g(this, ht, () => {
|
|
713
|
+
v(this, H, X).call(this);
|
|
714
|
+
}), g(this, Rt, () => {
|
|
760
715
|
var n;
|
|
761
|
-
if (
|
|
716
|
+
if (r(this, P).state !== "pending" || this.playState !== "finished")
|
|
762
717
|
return;
|
|
763
|
-
|
|
764
|
-
const
|
|
718
|
+
r(this, P).resolve(this);
|
|
719
|
+
const s = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
|
|
765
720
|
"finish",
|
|
766
721
|
{
|
|
767
722
|
get currentTime() {
|
|
768
|
-
return
|
|
723
|
+
return s;
|
|
769
724
|
},
|
|
770
725
|
get timelineTime() {
|
|
771
726
|
return a;
|
|
@@ -776,8 +731,8 @@ const pe = class extends EventTarget {
|
|
|
776
731
|
var l;
|
|
777
732
|
this.dispatchEvent(o), (l = this.onfinish) == null || l.call(this, o);
|
|
778
733
|
});
|
|
779
|
-
}),
|
|
780
|
-
var n,
|
|
734
|
+
}), g(this, At, () => {
|
|
735
|
+
var n, s;
|
|
781
736
|
const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, l = new AnimationPlaybackEvent(
|
|
782
737
|
"cancel",
|
|
783
738
|
{
|
|
@@ -789,21 +744,21 @@ const pe = class extends EventTarget {
|
|
|
789
744
|
}
|
|
790
745
|
}
|
|
791
746
|
);
|
|
792
|
-
this.dispatchEvent(l), (
|
|
793
|
-
}),
|
|
747
|
+
this.dispatchEvent(l), (s = this.oncancel) == null || s.call(this, l);
|
|
748
|
+
}), g(this, Wt, () => {
|
|
794
749
|
var n;
|
|
795
|
-
const
|
|
796
|
-
this.dispatchEvent(
|
|
797
|
-
}),
|
|
750
|
+
const s = new Event("remove");
|
|
751
|
+
this.dispatchEvent(s), (n = this.onremove) == null || n.call(this, s);
|
|
752
|
+
}), r(this, S).resolve(this), c(this, x, t ?? null), c(this, p, e ?? document.timeline), r(this, x) && N.set(r(this, x), this), v(this, Tt, Ut).call(this), e instanceof b && e.addEventListener("update", r(this, ht));
|
|
798
753
|
}
|
|
799
754
|
reverse() {
|
|
800
755
|
var t;
|
|
801
|
-
const { endTime: e = 0 } = ((t =
|
|
802
|
-
if (!
|
|
803
|
-
o && (
|
|
756
|
+
const { endTime: e = 0 } = ((t = r(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, W), s = u(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || s && s > 0 || !a);
|
|
757
|
+
if (!r(this, p) || !o) {
|
|
758
|
+
o && (r(this, w).playbackRate = -n);
|
|
804
759
|
return;
|
|
805
760
|
}
|
|
806
|
-
if (
|
|
761
|
+
if (r(this, p).currentTime === null)
|
|
807
762
|
throw new DOMException(
|
|
808
763
|
"Cannot reverse an animation with no active timeline",
|
|
809
764
|
"InvalidStateError"
|
|
@@ -812,56 +767,56 @@ const pe = class extends EventTarget {
|
|
|
812
767
|
}
|
|
813
768
|
play() {
|
|
814
769
|
const t = this.playState === "paused" && this.pending, e = this.currentTime;
|
|
815
|
-
(
|
|
770
|
+
(r(this, w).playbackRate ?? this.playbackRate) === 0 && e === null && c(this, y, 0), e === null && c(this, j, !0), (this.playState === "finished" || t) && (c(this, h, null), c(this, y, null), c(this, j, !0)), r(this, y) && c(this, h, null), r(this, w).task && (r(this, w).task = null), !(r(this, h) !== null && r(this, y) === null && !t && r(this, w).playbackRate === null) && (v(this, H, X).call(this), v(this, nt, ut).call(this), r(this, w).task = "play", v(this, I, F).call(this, !1));
|
|
816
771
|
}
|
|
817
772
|
pause() {
|
|
818
|
-
this.playState !== "paused" && (this.currentTime === null && c(this,
|
|
773
|
+
this.playState !== "paused" && (this.currentTime === null && c(this, j, !0), r(this, w).task && (r(this, w).task = null), v(this, nt, ut).call(this), r(this, w).task = "pause");
|
|
819
774
|
}
|
|
820
775
|
persist() {
|
|
821
|
-
|
|
776
|
+
r(this, k).forEach((t) => t.persist()), c(this, dt, "persisted");
|
|
822
777
|
}
|
|
823
778
|
finish() {
|
|
824
779
|
var t;
|
|
825
|
-
const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n =
|
|
780
|
+
const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, W);
|
|
826
781
|
if (n === 0 || n > 0 && e === 1 / 0)
|
|
827
782
|
throw new DOMException("InvalidStateError");
|
|
828
|
-
|
|
829
|
-
let
|
|
830
|
-
if (n > 0 ?
|
|
831
|
-
const a =
|
|
832
|
-
|
|
833
|
-
const o =
|
|
834
|
-
c(this,
|
|
783
|
+
v(this, D, $).call(this);
|
|
784
|
+
let s;
|
|
785
|
+
if (n > 0 ? s = e : s = 0, v(this, bt, Mt).call(this, s), this.startTime === null && r(this, p) !== null && r(this, p).currentTime !== null && s !== null) {
|
|
786
|
+
const a = r(this, p) instanceof b ? "percent" : "ms";
|
|
787
|
+
s = u(s, a);
|
|
788
|
+
const o = u(r(this, p).currentTime, a);
|
|
789
|
+
c(this, h, o - s / n);
|
|
835
790
|
}
|
|
836
|
-
|
|
791
|
+
r(this, w).task === "pause" && r(this, h) !== null && (c(this, y, null), v(this, z, it).call(this), r(this, S).resolve(this)), r(this, w).task === "play" && r(this, h) !== null && (v(this, z, it).call(this), r(this, S).resolve(this)), v(this, I, F).call(this, !0), r(this, k).forEach((a) => a.finish());
|
|
837
792
|
}
|
|
838
793
|
commitStyles() {
|
|
839
|
-
|
|
794
|
+
r(this, k).forEach((t) => {
|
|
840
795
|
t.effect instanceof wt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
|
|
841
796
|
});
|
|
842
797
|
}
|
|
843
798
|
cancel() {
|
|
844
|
-
this.playState !== "idle" && (
|
|
799
|
+
this.playState !== "idle" && (v(this, D, $).call(this), r(this, S).reject(new DOMException("The user aborted a request", "AbortError")), v(this, z, it).call(this), c(this, S, new rt()), r(this, P).state === "pending" && r(this, P).reject(new DOMException("The user aborted a request", "AbortError")), c(this, P, new rt()), r(this, k).forEach((t) => t.cancel())), c(this, h, null), c(this, y, null);
|
|
845
800
|
}
|
|
846
801
|
updatePlaybackRate(t) {
|
|
847
802
|
var e;
|
|
848
|
-
|
|
803
|
+
r(this, w).playbackRate = t;
|
|
849
804
|
const n = this.playState;
|
|
850
|
-
if (
|
|
805
|
+
if (r(this, S).state !== "pending")
|
|
851
806
|
switch (n) {
|
|
852
807
|
case "idle":
|
|
853
808
|
case "paused":
|
|
854
|
-
|
|
809
|
+
v(this, D, $).call(this);
|
|
855
810
|
break;
|
|
856
811
|
case "finished": {
|
|
857
|
-
const
|
|
812
|
+
const s = r(this, p) instanceof b ? "percent" : "ms", a = ((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null;
|
|
858
813
|
if (t === 0)
|
|
859
|
-
c(this,
|
|
814
|
+
c(this, h, u(a, s));
|
|
860
815
|
else if (a !== null) {
|
|
861
816
|
let o = null;
|
|
862
|
-
o = (
|
|
817
|
+
o = (u(a, s) - (r(this, h) ?? 0)) * this.playbackRate, r(this, h) !== null && o !== null && c(this, h, (u(a, s) - o) / t);
|
|
863
818
|
}
|
|
864
|
-
|
|
819
|
+
v(this, D, $).call(this), v(this, I, F).call(this, !1), v(this, H, X).call(this);
|
|
865
820
|
break;
|
|
866
821
|
}
|
|
867
822
|
default:
|
|
@@ -875,210 +830,210 @@ const pe = class extends EventTarget {
|
|
|
875
830
|
super.removeEventListener(t, e, n);
|
|
876
831
|
}
|
|
877
832
|
set playbackRate(t) {
|
|
878
|
-
c(this,
|
|
833
|
+
c(this, W, t), r(this, k).forEach((e) => {
|
|
879
834
|
e.playbackRate *= t;
|
|
880
835
|
});
|
|
881
836
|
}
|
|
882
837
|
set startTime(t) {
|
|
883
|
-
c(this,
|
|
838
|
+
c(this, h, u(t)), r(this, k).forEach((e) => e.startTime = t);
|
|
884
839
|
}
|
|
885
840
|
set currentTime(t) {
|
|
886
841
|
var e;
|
|
887
|
-
const n =
|
|
888
|
-
if (
|
|
842
|
+
const n = r(this, p) instanceof b ? "percent" : "ms", s = u(((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null, n);
|
|
843
|
+
if (_(t) && !_(s))
|
|
889
844
|
throw new TypeError("currentTime may not be changed from resolved to unresolved.");
|
|
890
|
-
c(this,
|
|
845
|
+
c(this, j, !1), r(this, y) !== null || r(this, h) === null || s === null || this.playbackRate === 0 ? c(this, y, u(t, n)) : c(this, h, s - u(t, n) / this.playbackRate), (r(this, p) === null || s === null) && c(this, h, null), c(this, G, null), v(this, bt, Mt).call(this, t), r(this, w).task === "pause" && (c(this, y, u(t, n)), v(this, D, $).call(this), c(this, h, null), v(this, z, it).call(this), r(this, S).resolve(this)), v(this, I, F).call(this, !0);
|
|
891
846
|
}
|
|
892
847
|
set timeline(t) {
|
|
893
848
|
var e, n;
|
|
894
|
-
const
|
|
895
|
-
if (
|
|
849
|
+
const s = this.timeline;
|
|
850
|
+
if (s === t)
|
|
896
851
|
return;
|
|
897
|
-
|
|
898
|
-
const a = this.playState, o =
|
|
852
|
+
r(this, p) instanceof b && r(this, p).removeEventListener("update", r(this, ht));
|
|
853
|
+
const a = this.playState, o = s instanceof b ? "percent" : "ms", l = u(this.currentTime, o), { progress: f = null, endTime: d = 0 } = ((e = r(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, m = u(d, o), T = s instanceof b, E = t instanceof b, K = t instanceof DocumentTimeline, C = this.pending;
|
|
899
854
|
if (E)
|
|
900
|
-
c(this, p, t), t.addEventListener("update",
|
|
901
|
-
else if (
|
|
902
|
-
if (c(this, p, t),
|
|
855
|
+
c(this, p, t), t.addEventListener("update", r(this, ht)), v(this, D, $).call(this), c(this, j, !0), c(this, h, null), c(this, y, null), (a === "running" || a === "finished") && ((!r(this, S) || r(this, S).state === "resolved") && v(this, nt, ut).call(this), r(this, w).task = "play", r(this, k).forEach((L) => L.pause())), a === "paused" && f !== null && c(this, y, f * m), C && ((!r(this, S) || r(this, S).state === "resolved") && v(this, nt, ut).call(this), a === "paused" ? r(this, w).task = "pause" : r(this, w).task = "play"), r(this, h) !== null && c(this, y, null), v(this, I, F).call(this, !1);
|
|
856
|
+
else if (K) {
|
|
857
|
+
if (c(this, p, t), T) {
|
|
903
858
|
if (l !== null && f !== null) {
|
|
904
|
-
const { endTime: L = 0 } = ((n =
|
|
859
|
+
const { endTime: L = 0 } = ((n = r(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, M = u(L, "ms");
|
|
905
860
|
this.currentTime = f * M;
|
|
906
861
|
}
|
|
907
862
|
switch (a) {
|
|
908
863
|
case "paused":
|
|
909
|
-
|
|
864
|
+
r(this, k).forEach((L) => L.pause());
|
|
910
865
|
break;
|
|
911
866
|
case "running":
|
|
912
867
|
case "finished":
|
|
913
|
-
|
|
868
|
+
r(this, k).forEach((L) => L.play());
|
|
914
869
|
}
|
|
915
870
|
}
|
|
916
871
|
} else
|
|
917
872
|
throw TypeError("Unsupported timeline: " + t);
|
|
918
873
|
}
|
|
919
874
|
set effect(t) {
|
|
920
|
-
if (t !==
|
|
921
|
-
if (this.pending &&
|
|
875
|
+
if (t !== r(this, x)) {
|
|
876
|
+
if (this.pending && v(this, z, it).call(this), r(this, x) && N.delete(r(this, x)), t) {
|
|
922
877
|
const e = N.get(t);
|
|
923
878
|
e && (e.effect = null), N.set(t, this);
|
|
924
879
|
}
|
|
925
|
-
c(this, x, t),
|
|
880
|
+
c(this, x, t), v(this, Tt, Ut).call(this), v(this, I, F).call(this, !1);
|
|
926
881
|
}
|
|
927
882
|
}
|
|
928
883
|
get ready() {
|
|
929
|
-
return
|
|
884
|
+
return r(this, S).promise;
|
|
930
885
|
}
|
|
931
886
|
get finished() {
|
|
932
|
-
return
|
|
887
|
+
return r(this, P).promise;
|
|
933
888
|
}
|
|
934
889
|
get playState() {
|
|
935
890
|
var t;
|
|
936
891
|
let { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {};
|
|
937
|
-
const n =
|
|
938
|
-
return e =
|
|
892
|
+
const n = r(this, p) instanceof b ? "percent" : "ms", s = u(this.startTime, n), a = u(this.currentTime, n);
|
|
893
|
+
return e = u(e, n), a === null && s === null && r(this, w).task === null ? "idle" : r(this, w).task === "pause" || s === null && r(this, w).task !== "play" ? "paused" : a !== null && (r(this, W) > 0 && a >= e || r(this, W) < 0 && a <= 0) ? "finished" : "running";
|
|
939
894
|
}
|
|
940
895
|
get playbackRate() {
|
|
941
|
-
return
|
|
896
|
+
return r(this, W);
|
|
942
897
|
}
|
|
943
898
|
get replaceState() {
|
|
944
|
-
return
|
|
899
|
+
return r(this, dt);
|
|
945
900
|
}
|
|
946
901
|
get pending() {
|
|
947
|
-
return
|
|
902
|
+
return r(this, S).state === "pending";
|
|
948
903
|
}
|
|
949
904
|
get currentTime() {
|
|
950
905
|
var t;
|
|
951
906
|
const e = ((t = this.timeline) == null ? void 0 : t.currentTime) ?? null;
|
|
952
|
-
if (
|
|
907
|
+
if (r(this, y)) {
|
|
953
908
|
if (typeof e == "number")
|
|
954
|
-
return
|
|
955
|
-
const a =
|
|
956
|
-
return new CSSUnitValue(
|
|
909
|
+
return r(this, y);
|
|
910
|
+
const a = r(this, p) instanceof b ? "percent" : "ms";
|
|
911
|
+
return new CSSUnitValue(r(this, y), a);
|
|
957
912
|
}
|
|
958
|
-
if (e === null ||
|
|
913
|
+
if (e === null || r(this, h) === null)
|
|
959
914
|
return null;
|
|
960
|
-
const n =
|
|
961
|
-
let
|
|
962
|
-
return
|
|
915
|
+
const n = r(this, p) instanceof b ? "percent" : "ms";
|
|
916
|
+
let s = (u(e, n) - r(this, h)) * this.playbackRate;
|
|
917
|
+
return s === -0 && (s = 0), typeof e == "number" ? s : new CSSUnitValue(s, n);
|
|
963
918
|
}
|
|
964
919
|
get startTime() {
|
|
965
920
|
var t;
|
|
966
|
-
if (
|
|
921
|
+
if (r(this, h) === null)
|
|
967
922
|
return null;
|
|
968
923
|
if (typeof (((t = this.timeline) == null ? void 0 : t.currentTime) ?? null) == "number")
|
|
969
|
-
return
|
|
970
|
-
const e =
|
|
971
|
-
return new CSSUnitValue(
|
|
924
|
+
return r(this, h);
|
|
925
|
+
const e = r(this, p) instanceof b ? "percent" : "ms";
|
|
926
|
+
return new CSSUnitValue(r(this, h), e);
|
|
972
927
|
}
|
|
973
928
|
get timeline() {
|
|
974
|
-
return
|
|
929
|
+
return r(this, p);
|
|
975
930
|
}
|
|
976
931
|
get effect() {
|
|
977
|
-
return
|
|
932
|
+
return r(this, x);
|
|
978
933
|
}
|
|
979
934
|
};
|
|
980
|
-
p = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(),
|
|
935
|
+
p = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakSet(), Mt = function(i) {
|
|
981
936
|
var t;
|
|
982
|
-
const e =
|
|
937
|
+
const e = u(((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null);
|
|
983
938
|
if (i === null && e !== null)
|
|
984
939
|
throw new TypeError();
|
|
985
|
-
i === null || e === null || (i =
|
|
986
|
-
}, nt = /* @__PURE__ */ new WeakSet(),
|
|
987
|
-
|
|
940
|
+
i === null || e === null || (i = u(i), c(this, j, !1), r(this, y) !== null || r(this, h) === null || r(this, p) instanceof b && r(this, p).phase === "inactive" || r(this, W) === 0 ? c(this, y, i) : c(this, h, e - i / r(this, W)), r(this, p) instanceof b && r(this, p).phase === "inactive" && c(this, h, null), c(this, G, null));
|
|
941
|
+
}, nt = /* @__PURE__ */ new WeakSet(), ut = function() {
|
|
942
|
+
r(this, S).state !== "pending" && c(this, S, new rt()), cancelAnimationFrame(r(this, ct)), c(this, ct, requestAnimationFrame(() => {
|
|
988
943
|
var i;
|
|
989
|
-
(((i =
|
|
944
|
+
(((i = r(this, p)) == null ? void 0 : i.currentTime) ?? null) !== null && (v(this, Nt, Qt).call(this), r(this, w).task === "play" && (r(this, h) !== null || r(this, y) !== null) ? v(this, Pt, Zt).call(this) : r(this, w).task === "pause" && v(this, Dt, Jt).call(this), Promise.all(r(this, k).map((t) => t.finished)).then(r(this, Rt)), Promise.all(r(this, k).map((t) => new Promise((e) => t.onremove = e))).then(r(this, Wt)), Promise.all(r(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(r(this, At)).then(() => c(this, dt, "removed")));
|
|
990
945
|
}));
|
|
991
|
-
},
|
|
992
|
-
cancelAnimationFrame(
|
|
993
|
-
},
|
|
946
|
+
}, z = /* @__PURE__ */ new WeakSet(), it = function() {
|
|
947
|
+
cancelAnimationFrame(r(this, ct)), r(this, w).task = null;
|
|
948
|
+
}, Pt = /* @__PURE__ */ new WeakSet(), Zt = function() {
|
|
994
949
|
var i;
|
|
995
950
|
const t = ((i = this.timeline) == null ? void 0 : i.currentTime) ?? null;
|
|
996
951
|
if (t === null)
|
|
997
952
|
return;
|
|
998
|
-
const e =
|
|
999
|
-
if (
|
|
1000
|
-
|
|
1001
|
-
else if (
|
|
1002
|
-
const n = (
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
},
|
|
953
|
+
const e = r(this, p) instanceof b ? "percent" : "ms";
|
|
954
|
+
if (r(this, y) !== null)
|
|
955
|
+
v(this, D, $).call(this), this.playbackRate === 0 ? c(this, h, u(t, e)) : (c(this, h, u(t, e) - r(this, y) / this.playbackRate), c(this, y, null));
|
|
956
|
+
else if (r(this, h) !== null && r(this, w).playbackRate !== null) {
|
|
957
|
+
const n = (u(t, e) - r(this, h)) * this.playbackRate;
|
|
958
|
+
v(this, D, $).call(this);
|
|
959
|
+
const s = this.playbackRate;
|
|
960
|
+
s === 0 ? (c(this, y, null), c(this, h, u(t, e))) : c(this, h, u(t, e) - n / s);
|
|
961
|
+
}
|
|
962
|
+
r(this, S).state === "pending" && r(this, S).resolve(this), v(this, I, F).call(this, !1), v(this, H, X).call(this), r(this, w).task = null, this.timeline instanceof DocumentTimeline && r(this, k).forEach((n) => n.play());
|
|
963
|
+
}, Dt = /* @__PURE__ */ new WeakSet(), Jt = function() {
|
|
1009
964
|
var i;
|
|
1010
965
|
const t = ((i = this.timeline) == null ? void 0 : i.currentTime) ?? null;
|
|
1011
966
|
if (t === null)
|
|
1012
967
|
return;
|
|
1013
|
-
const e =
|
|
1014
|
-
|
|
1015
|
-
},
|
|
1016
|
-
if (
|
|
1017
|
-
if (
|
|
1018
|
-
const i =
|
|
1019
|
-
c(this,
|
|
968
|
+
const e = r(this, p) instanceof b ? "percent" : "ms", n = t;
|
|
969
|
+
r(this, h) !== null && r(this, y) === null && c(this, y, (u(n, e) - r(this, h)) * this.playbackRate), v(this, D, $).call(this), c(this, h, null), r(this, S).resolve(this), v(this, I, F).call(this, !1), v(this, H, X).call(this), r(this, w).task = null, r(this, k).forEach((s) => s.pause());
|
|
970
|
+
}, Nt = /* @__PURE__ */ new WeakSet(), Qt = function() {
|
|
971
|
+
if (r(this, j) && !(!r(this, p) || !r(this, p).currentTime) && !(this.playState === "idle" || this.playState === "paused" && r(this, y) !== null)) {
|
|
972
|
+
if (r(this, p) instanceof b) {
|
|
973
|
+
const i = r(this, w).playbackRate ?? this.playbackRate;
|
|
974
|
+
c(this, h, i >= 0 ? 0 : 100);
|
|
1020
975
|
} else
|
|
1021
|
-
c(this,
|
|
976
|
+
c(this, h, u(r(this, p).currentTime, "ms"));
|
|
1022
977
|
c(this, y, null);
|
|
1023
978
|
}
|
|
1024
|
-
},
|
|
979
|
+
}, H = /* @__PURE__ */ new WeakSet(), X = function() {
|
|
1025
980
|
var i;
|
|
1026
|
-
const t = ((i =
|
|
981
|
+
const t = ((i = r(this, p)) == null ? void 0 : i.currentTime) ?? null;
|
|
1027
982
|
if (t === null)
|
|
1028
983
|
return;
|
|
1029
|
-
const e =
|
|
1030
|
-
let
|
|
1031
|
-
if (
|
|
1032
|
-
const a =
|
|
1033
|
-
|
|
1034
|
-
} else if (
|
|
1035
|
-
|
|
984
|
+
const e = r(this, x), n = r(this, p) instanceof b ? De(t, e?.getTiming()) : kt(t);
|
|
985
|
+
let s = null;
|
|
986
|
+
if (r(this, h) !== null) {
|
|
987
|
+
const a = u(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
|
|
988
|
+
s = (n - r(this, h)) * this.playbackRate, s += a;
|
|
989
|
+
} else if (r(this, y) !== null)
|
|
990
|
+
s = r(this, y);
|
|
1036
991
|
else
|
|
1037
992
|
return;
|
|
1038
|
-
|
|
1039
|
-
},
|
|
993
|
+
r(this, k).forEach((a) => a.currentTime = s);
|
|
994
|
+
}, ht = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakSet(), Ut = function() {
|
|
1040
995
|
var i;
|
|
1041
|
-
const t =
|
|
1042
|
-
if (t instanceof
|
|
996
|
+
const t = r(this, x), e = [];
|
|
997
|
+
if (t instanceof zt)
|
|
1043
998
|
for (let n = 0; n < t.children.length; n++) {
|
|
1044
|
-
const
|
|
1045
|
-
if (t instanceof
|
|
999
|
+
const s = new me(t.children.item(n));
|
|
1000
|
+
if (t instanceof je && n > 0) {
|
|
1046
1001
|
const { endTime: a = null } = ((i = e[n - 1].effect) == null ? void 0 : i.getComputedTiming()) ?? {};
|
|
1047
|
-
|
|
1002
|
+
s.startTime = u(a, "ms");
|
|
1048
1003
|
}
|
|
1049
|
-
e.push(
|
|
1004
|
+
e.push(s);
|
|
1050
1005
|
}
|
|
1051
1006
|
else {
|
|
1052
|
-
const n =
|
|
1053
|
-
e.push(new
|
|
1007
|
+
const n = r(this, p) instanceof b ? document.timeline : r(this, p);
|
|
1008
|
+
e.push(new Pe(t, n));
|
|
1054
1009
|
}
|
|
1055
1010
|
c(this, k, e);
|
|
1056
|
-
},
|
|
1011
|
+
}, I = /* @__PURE__ */ new WeakSet(), F = function(i) {
|
|
1057
1012
|
var t, e;
|
|
1058
|
-
const n = ((t =
|
|
1059
|
-
if (a &&
|
|
1060
|
-
let { delay: o = 0, endDelay: l = 0, iterations: f = 1, duration: d = "auto" } = ((e =
|
|
1061
|
-
const m =
|
|
1013
|
+
const n = ((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null, s = r(this, p) instanceof b ? "percent" : "ms", a = u(this.currentTime, s);
|
|
1014
|
+
if (a && r(this, h) !== null && !this.pending) {
|
|
1015
|
+
let { delay: o = 0, endDelay: l = 0, iterations: f = 1, duration: d = "auto" } = ((e = r(this, x)) == null ? void 0 : e.getTiming()) ?? {};
|
|
1016
|
+
const m = r(this, w).playbackRate ?? this.playbackRate;
|
|
1062
1017
|
if (d === "auto")
|
|
1063
|
-
d =
|
|
1018
|
+
d = r(this, p) instanceof b ? qt : 0;
|
|
1064
1019
|
else if (d instanceof CSSNumericValue)
|
|
1065
1020
|
d = d.to("ms").value;
|
|
1066
1021
|
else if (typeof d == "string")
|
|
1067
1022
|
throw new TypeError("Unknown effect duration keyword.");
|
|
1068
|
-
const
|
|
1069
|
-
let E =
|
|
1070
|
-
m > 0 && a >=
|
|
1023
|
+
const T = o + d * f + l;
|
|
1024
|
+
let E = u(r(this, G), s);
|
|
1025
|
+
m > 0 && a >= T && r(this, G) !== null ? ((E === null || E < T) && (E = T), c(this, y, i ? a : E)) : m < 0 && a <= 0 ? ((E === null || E > 0) && (E = 0), c(this, y, i ? a : E)) : m !== 0 && (i && r(this, y) !== null && (n !== null ? c(this, h, u(n, s) - r(this, y) / m) : c(this, h, null)), c(this, y, null));
|
|
1071
1026
|
}
|
|
1072
|
-
|
|
1027
|
+
v(this, H, X).call(this), c(this, G, this.currentTime), this.playState === "finished" ? r(this, P).state === "pending" && r(this, Rt).call(this) : r(this, P).state === "resolved" && c(this, P, new rt());
|
|
1073
1028
|
}, D = /* @__PURE__ */ new WeakSet(), $ = function() {
|
|
1074
|
-
|
|
1075
|
-
},
|
|
1076
|
-
let
|
|
1077
|
-
var
|
|
1078
|
-
class
|
|
1079
|
-
constructor(t, e =
|
|
1080
|
-
super(t),
|
|
1081
|
-
...
|
|
1029
|
+
r(this, w).playbackRate && (this.playbackRate = r(this, w).playbackRate), r(this, w).playbackRate = null;
|
|
1030
|
+
}, Rt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap();
|
|
1031
|
+
let Fe = me;
|
|
1032
|
+
var st, It, ve;
|
|
1033
|
+
class $t extends zt {
|
|
1034
|
+
constructor(t, e = ft) {
|
|
1035
|
+
super(t), g(this, It), g(this, st, void 0), c(this, st, {
|
|
1036
|
+
...ft,
|
|
1082
1037
|
...e
|
|
1083
1038
|
}), t.forEach((n) => n.updateTiming());
|
|
1084
1039
|
}
|
|
@@ -1089,32 +1044,32 @@ class Ot extends Ht {
|
|
|
1089
1044
|
super.append(...t), t.forEach((e) => e.updateTiming());
|
|
1090
1045
|
}
|
|
1091
1046
|
getTiming() {
|
|
1092
|
-
return
|
|
1047
|
+
return r(this, st);
|
|
1093
1048
|
}
|
|
1094
1049
|
getComputedTiming() {
|
|
1095
1050
|
const t = this.getTiming(), e = { ...t };
|
|
1096
1051
|
for (let m = 0; m < this.children.length; m++) {
|
|
1097
|
-
const
|
|
1098
|
-
if (!
|
|
1052
|
+
const T = this.children.item(m);
|
|
1053
|
+
if (!T)
|
|
1099
1054
|
continue;
|
|
1100
1055
|
let {
|
|
1101
1056
|
delay: E = 0,
|
|
1102
|
-
endDelay:
|
|
1057
|
+
endDelay: K = 0,
|
|
1103
1058
|
duration: C = "auto",
|
|
1104
1059
|
activeDuration: L = 0,
|
|
1105
1060
|
endTime: M = 0
|
|
1106
|
-
} =
|
|
1107
|
-
t.delay = t.delay ? Math.min(t.delay, E) : E, t.endDelay = t.endDelay ? Math.max(t.endDelay,
|
|
1061
|
+
} = T.getComputedTiming();
|
|
1062
|
+
t.delay = t.delay ? Math.min(t.delay, E) : E, t.endDelay = t.endDelay ? Math.max(t.endDelay, K) : K, e.endTime = e.endTime ? Math.max(u(e.endTime, "ms"), u(M, "ms")) : M, e.activeDuration = e.activeDuration ? Math.max(u(e.activeDuration, "ms"), u(L, "ms")) : L, t.duration = t.duration instanceof CSSNumericValue ? t.duration.to("ms").value : t.duration, C = C instanceof CSSNumericValue ? C.to("ms").value : C, typeof C != "string" && (t.duration === "auto" ? t.duration = u(C, "ms") : typeof t.duration != "string" && (t.duration = t.duration ? Math.max(t.duration, C) : C));
|
|
1108
1063
|
}
|
|
1109
|
-
const { timeline: n, startTime:
|
|
1064
|
+
const { timeline: n, startTime: s, currentTime: a } = N.get(this) ?? {}, o = n instanceof b ? "percent" : "ms";
|
|
1110
1065
|
let { duration: l = 0, iterations: f = 1, endTime: d = 0 } = e;
|
|
1111
1066
|
if (l === "auto" && (l = 0), typeof l == "string")
|
|
1112
1067
|
throw new TypeError("Unknown effect duration keyword.");
|
|
1113
|
-
return e.duration = l, e.activeDuration = kt(l) * f, e.startTime =
|
|
1068
|
+
return e.duration = l, e.activeDuration = kt(l) * f, e.startTime = s ?? void 0, e.localTime = a, e.currentIteration = fe(e, de(e, r(this, It, ve))), n instanceof b ? Ht(e) : (n instanceof DocumentTimeline && (e.progress = a && u(a, o) / u(d, o)), e);
|
|
1114
1069
|
}
|
|
1115
1070
|
updateTiming(t) {
|
|
1116
|
-
c(this,
|
|
1117
|
-
...
|
|
1071
|
+
c(this, st, {
|
|
1072
|
+
...r(this, st),
|
|
1118
1073
|
...t
|
|
1119
1074
|
});
|
|
1120
1075
|
for (let e = 0; e < this.children.length; e++) {
|
|
@@ -1123,16 +1078,16 @@ class Ot extends Ht {
|
|
|
1123
1078
|
}
|
|
1124
1079
|
}
|
|
1125
1080
|
}
|
|
1126
|
-
|
|
1081
|
+
st = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakSet(), ve = function() {
|
|
1127
1082
|
const { playbackRate: i = 1 } = N.get(this) ?? {};
|
|
1128
1083
|
return i < 0 ? "backwards" : "forwards";
|
|
1129
1084
|
};
|
|
1130
|
-
function
|
|
1085
|
+
function Ot(i, t) {
|
|
1131
1086
|
i.endsWith("*") || (i += "**");
|
|
1132
1087
|
const e = window.location.origin, n = new URLPattern(i, e).exec(t, e);
|
|
1133
1088
|
if (!n)
|
|
1134
1089
|
return null;
|
|
1135
|
-
const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(
|
|
1090
|
+
const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(le) ?? "";
|
|
1136
1091
|
return new URL(
|
|
1137
1092
|
t.replace(a, ""),
|
|
1138
1093
|
window.location.origin
|
|
@@ -1140,40 +1095,40 @@ function Vt(i, t) {
|
|
|
1140
1095
|
}
|
|
1141
1096
|
function te(i, t, e = `${window.location.origin}/`, n = !0) {
|
|
1142
1097
|
n || (i = i.toLowerCase(), t = t.toLowerCase());
|
|
1143
|
-
const
|
|
1144
|
-
if (!
|
|
1098
|
+
const s = Ot(e, t)?.href;
|
|
1099
|
+
if (!s)
|
|
1145
1100
|
return null;
|
|
1146
1101
|
const a = new URLPattern({
|
|
1147
|
-
baseURL:
|
|
1102
|
+
baseURL: s,
|
|
1148
1103
|
pathname: i
|
|
1149
|
-
}).exec({ pathname: t, baseURL:
|
|
1104
|
+
}).exec({ pathname: t, baseURL: s }), o = a?.pathname.groups ?? {};
|
|
1150
1105
|
return a ? {
|
|
1151
1106
|
params: o,
|
|
1152
1107
|
caseSensitive: n
|
|
1153
1108
|
} : null;
|
|
1154
1109
|
}
|
|
1155
|
-
function
|
|
1110
|
+
function Ve(i, t = window) {
|
|
1156
1111
|
return new Promise((e) => {
|
|
1157
1112
|
queueMicrotask(() => e(
|
|
1158
1113
|
t.dispatchEvent(i)
|
|
1159
1114
|
));
|
|
1160
1115
|
});
|
|
1161
1116
|
}
|
|
1162
|
-
function
|
|
1163
|
-
const t =
|
|
1117
|
+
function ln(i) {
|
|
1118
|
+
const t = Ee(i);
|
|
1164
1119
|
return t.load = async () => (t.module ??= await i(), t.module), t;
|
|
1165
1120
|
}
|
|
1166
|
-
function
|
|
1121
|
+
function cn() {
|
|
1167
1122
|
return !!window.navigation;
|
|
1168
1123
|
}
|
|
1169
|
-
function
|
|
1124
|
+
function un() {
|
|
1170
1125
|
return !!globalThis.URLPattern;
|
|
1171
1126
|
}
|
|
1172
1127
|
async function hn() {
|
|
1173
1128
|
const { URLPattern: i } = await import("urlpattern-polyfill");
|
|
1174
1129
|
globalThis.URLPattern = i;
|
|
1175
1130
|
}
|
|
1176
|
-
async function
|
|
1131
|
+
async function dn() {
|
|
1177
1132
|
const { applyPolyfill: i } = await import("@virtualstate/navigation");
|
|
1178
1133
|
i({
|
|
1179
1134
|
history: !0,
|
|
@@ -1183,25 +1138,25 @@ async function un() {
|
|
|
1183
1138
|
persistState: !0
|
|
1184
1139
|
});
|
|
1185
1140
|
}
|
|
1186
|
-
async function
|
|
1141
|
+
async function Ke(i) {
|
|
1187
1142
|
const t = [];
|
|
1188
1143
|
for (const e of i)
|
|
1189
1144
|
t.push(await e);
|
|
1190
1145
|
return t;
|
|
1191
1146
|
}
|
|
1192
|
-
function
|
|
1147
|
+
function Be(i) {
|
|
1193
1148
|
return i.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
|
|
1194
1149
|
}
|
|
1195
|
-
function
|
|
1196
|
-
return
|
|
1150
|
+
function fn(i, t) {
|
|
1151
|
+
return se(i, t);
|
|
1197
1152
|
}
|
|
1198
|
-
function
|
|
1153
|
+
function qe(i, t) {
|
|
1199
1154
|
const e = { ...i };
|
|
1200
1155
|
for (const n of t)
|
|
1201
1156
|
delete e[n];
|
|
1202
1157
|
return e;
|
|
1203
1158
|
}
|
|
1204
|
-
function
|
|
1159
|
+
function He(i, t) {
|
|
1205
1160
|
return Object.create(
|
|
1206
1161
|
EventTarget.prototype,
|
|
1207
1162
|
{
|
|
@@ -1224,7 +1179,7 @@ function qe(i) {
|
|
|
1224
1179
|
configurable: !1
|
|
1225
1180
|
},
|
|
1226
1181
|
index: {
|
|
1227
|
-
value: i.index,
|
|
1182
|
+
value: t ?? i.index,
|
|
1228
1183
|
enumerable: !0,
|
|
1229
1184
|
writable: !1,
|
|
1230
1185
|
configurable: !1
|
|
@@ -1250,8 +1205,8 @@ function qe(i) {
|
|
|
1250
1205
|
}
|
|
1251
1206
|
);
|
|
1252
1207
|
}
|
|
1253
|
-
class ze extends
|
|
1254
|
-
ref =
|
|
1208
|
+
class ze extends vt {
|
|
1209
|
+
ref = Y();
|
|
1255
1210
|
#t = null;
|
|
1256
1211
|
#e = null;
|
|
1257
1212
|
state = {
|
|
@@ -1270,24 +1225,24 @@ class ze extends at {
|
|
|
1270
1225
|
return this.#e;
|
|
1271
1226
|
}
|
|
1272
1227
|
getKeyframeProperties(t, e) {
|
|
1273
|
-
const n = {},
|
|
1228
|
+
const n = {}, s = window.getComputedStyle(t);
|
|
1274
1229
|
for (const a of e) {
|
|
1275
1230
|
let o;
|
|
1276
|
-
a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o =
|
|
1231
|
+
a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = Be(a), n[o] = s.getPropertyValue(a);
|
|
1277
1232
|
}
|
|
1278
1233
|
return n;
|
|
1279
1234
|
}
|
|
1280
1235
|
copyStyles(t, e, n) {
|
|
1281
|
-
if (!
|
|
1236
|
+
if (!Ce(t))
|
|
1282
1237
|
return;
|
|
1283
|
-
const
|
|
1238
|
+
const s = window.getComputedStyle(t);
|
|
1284
1239
|
for (const a of n) {
|
|
1285
|
-
const o =
|
|
1240
|
+
const o = s.getPropertyValue(a), l = s.getPropertyPriority(a);
|
|
1286
1241
|
e.style.setProperty(a, o, l);
|
|
1287
1242
|
}
|
|
1288
1243
|
}
|
|
1289
1244
|
getAnimationEffect(t, e) {
|
|
1290
|
-
const n = new Array(),
|
|
1245
|
+
const n = new Array(), s = {
|
|
1291
1246
|
fill: "both",
|
|
1292
1247
|
duration: "auto",
|
|
1293
1248
|
easing: "ease"
|
|
@@ -1301,7 +1256,7 @@ class ze extends at {
|
|
|
1301
1256
|
{ transform: o, opacity: 1 },
|
|
1302
1257
|
{ transform: l, opacity: 0 }
|
|
1303
1258
|
],
|
|
1304
|
-
|
|
1259
|
+
s
|
|
1305
1260
|
)
|
|
1306
1261
|
), n.push(
|
|
1307
1262
|
new KeyframeEffect(
|
|
@@ -1310,7 +1265,7 @@ class ze extends at {
|
|
|
1310
1265
|
{ transform: o },
|
|
1311
1266
|
{ transform: l }
|
|
1312
1267
|
],
|
|
1313
|
-
|
|
1268
|
+
s
|
|
1314
1269
|
)
|
|
1315
1270
|
);
|
|
1316
1271
|
break;
|
|
@@ -1323,7 +1278,7 @@ class ze extends at {
|
|
|
1323
1278
|
{ opacity: 0, offset: 0.5 },
|
|
1324
1279
|
{ transform: l, opacity: 0 }
|
|
1325
1280
|
],
|
|
1326
|
-
|
|
1281
|
+
s
|
|
1327
1282
|
)
|
|
1328
1283
|
), n.push(
|
|
1329
1284
|
new KeyframeEffect(
|
|
@@ -1333,7 +1288,7 @@ class ze extends at {
|
|
|
1333
1288
|
{ opacity: 0, offset: 0.5 },
|
|
1334
1289
|
{ transform: l, opacity: 1 }
|
|
1335
1290
|
],
|
|
1336
|
-
|
|
1291
|
+
s
|
|
1337
1292
|
)
|
|
1338
1293
|
);
|
|
1339
1294
|
break;
|
|
@@ -1345,7 +1300,7 @@ class ze extends at {
|
|
|
1345
1300
|
{ transform: o, opacity: 1 },
|
|
1346
1301
|
{ transform: l, opacity: 0 }
|
|
1347
1302
|
],
|
|
1348
|
-
|
|
1303
|
+
s
|
|
1349
1304
|
)
|
|
1350
1305
|
), n.push(
|
|
1351
1306
|
new KeyframeEffect(
|
|
@@ -1354,7 +1309,7 @@ class ze extends at {
|
|
|
1354
1309
|
{ transform: o },
|
|
1355
1310
|
{ transform: l }
|
|
1356
1311
|
],
|
|
1357
|
-
|
|
1312
|
+
s
|
|
1358
1313
|
)
|
|
1359
1314
|
);
|
|
1360
1315
|
break;
|
|
@@ -1378,13 +1333,13 @@ class ze extends at {
|
|
|
1378
1333
|
height: `${e.rect.height}px`
|
|
1379
1334
|
}
|
|
1380
1335
|
],
|
|
1381
|
-
|
|
1336
|
+
s
|
|
1382
1337
|
)
|
|
1383
1338
|
);
|
|
1384
1339
|
break;
|
|
1385
1340
|
}
|
|
1386
1341
|
}
|
|
1387
|
-
return new
|
|
1342
|
+
return new $t(n);
|
|
1388
1343
|
}
|
|
1389
1344
|
get animationEffect() {
|
|
1390
1345
|
const t = this.outgoingScreen?.current?.sharedElementScene, e = this.incomingScreen?.current?.sharedElementScene;
|
|
@@ -1392,15 +1347,15 @@ class ze extends at {
|
|
|
1392
1347
|
return null;
|
|
1393
1348
|
t.previousScene = null, e.previousScene = t;
|
|
1394
1349
|
const n = new Array();
|
|
1395
|
-
for (const [
|
|
1396
|
-
const o = a.getBoundingClientRect(), l = t.nodes.get(
|
|
1350
|
+
for (const [s, a] of Array.from(e.nodes.entries())) {
|
|
1351
|
+
const o = a.getBoundingClientRect(), l = t.nodes.get(s);
|
|
1397
1352
|
if (!l?.canTransition || !a.canTransition)
|
|
1398
1353
|
continue;
|
|
1399
1354
|
const f = l.getBoundingClientRect(), d = a.clone(), m = l.clone();
|
|
1400
1355
|
if (!m || !d)
|
|
1401
1356
|
continue;
|
|
1402
|
-
const
|
|
1403
|
-
a.transitionType !== "morph" ? (m.id = `${
|
|
1357
|
+
const T = Array.from(/* @__PURE__ */ new Set([...l.styles, ...a.styles]));
|
|
1358
|
+
a.transitionType !== "morph" ? (m.id = `${s}-start`, m.style.position = "absolute", m.style.gridArea = "1 / 1", m.style.margin = "0", this.copyStyles(l.ref.current?.firstElementChild, m, T), this.copyStyles(a.ref.current?.firstElementChild, d, T), m.style.width = `${f.width}px`, m.style.height = `${f.height}px`, d.style.width = `${o.width}px`, d.style.height = `${o.height}px`, this.ref.current?.prepend(m)) : (this.copyStyles(l.ref.current?.firstElementChild, d, T), d.style.width = `${f.width}px`, d.style.height = `${f.height}px`), d.id = `${s}${a.transitionType === "morph" ? "" : "-end"}`, d.style.position = "absolute", d.style.gridArea = "1 / 1", d.style.margin = "0", this.ref.current?.prepend(d), l.hide(), a.hide();
|
|
1404
1359
|
const E = async () => {
|
|
1405
1360
|
this.props.direction === "forwards" ? a.unhide() : l.unhide(), d.remove(), m.remove();
|
|
1406
1361
|
};
|
|
@@ -1409,10 +1364,10 @@ class ze extends at {
|
|
|
1409
1364
|
{ instance: a, clone: d, rect: o }
|
|
1410
1365
|
));
|
|
1411
1366
|
}
|
|
1412
|
-
return new
|
|
1367
|
+
return new $t(n);
|
|
1413
1368
|
}
|
|
1414
1369
|
render() {
|
|
1415
|
-
return /* @__PURE__ */
|
|
1370
|
+
return /* @__PURE__ */ R("dialog", { className: "shared-element-layer", ref: this.ref, style: {
|
|
1416
1371
|
maxWidth: "unset",
|
|
1417
1372
|
maxHeight: "unset",
|
|
1418
1373
|
width: "100vw",
|
|
@@ -1422,15 +1377,15 @@ class ze extends at {
|
|
|
1422
1377
|
border: "none",
|
|
1423
1378
|
backgroundColor: "transparent",
|
|
1424
1379
|
isolation: "isolate"
|
|
1425
|
-
}, children: /* @__PURE__ */
|
|
1380
|
+
}, children: /* @__PURE__ */ R("style", { children: `
|
|
1426
1381
|
.shared-element-layer::backdrop {display: none}
|
|
1427
1382
|
.shared-element-layer[open] {display:grid}
|
|
1428
1383
|
` }) });
|
|
1429
1384
|
}
|
|
1430
1385
|
}
|
|
1431
|
-
class
|
|
1432
|
-
sharedElementTransitionLayer =
|
|
1433
|
-
animation = new
|
|
1386
|
+
class Ge extends vt {
|
|
1387
|
+
sharedElementTransitionLayer = Y();
|
|
1388
|
+
animation = new Fe();
|
|
1434
1389
|
#t = "normal";
|
|
1435
1390
|
#e = [];
|
|
1436
1391
|
state = {
|
|
@@ -1463,8 +1418,8 @@ class He extends at {
|
|
|
1463
1418
|
return this.props.hasUAVisualTransition;
|
|
1464
1419
|
}
|
|
1465
1420
|
transition() {
|
|
1466
|
-
const t = new
|
|
1467
|
-
this.screens.map((
|
|
1421
|
+
const t = new $t(
|
|
1422
|
+
this.screens.map((s) => s.current?.transitionProvider?.current?.animationEffect ?? null).filter((s) => s !== null)
|
|
1468
1423
|
), e = this.sharedElementTransitionLayer.current?.animationEffect, n = t.getComputedTiming().duration;
|
|
1469
1424
|
return e && (e.updateTiming({
|
|
1470
1425
|
duration: n instanceof CSSNumericValue ? n.to("ms").value : n
|
|
@@ -1477,7 +1432,7 @@ class He extends at {
|
|
|
1477
1432
|
}
|
|
1478
1433
|
render() {
|
|
1479
1434
|
return /* @__PURE__ */ ee(Kt.Provider, { value: this, children: [
|
|
1480
|
-
/* @__PURE__ */
|
|
1435
|
+
/* @__PURE__ */ R(
|
|
1481
1436
|
ze,
|
|
1482
1437
|
{
|
|
1483
1438
|
ref: this.sharedElementTransitionLayer,
|
|
@@ -1485,24 +1440,11 @@ class He extends at {
|
|
|
1485
1440
|
direction: this.animation.playbackRate > 0 ? "forwards" : "backwards"
|
|
1486
1441
|
}
|
|
1487
1442
|
),
|
|
1488
|
-
|
|
1489
|
-
"div",
|
|
1490
|
-
{
|
|
1491
|
-
className: this.props.id,
|
|
1492
|
-
style: {
|
|
1493
|
-
width: "100%",
|
|
1494
|
-
height: "100%",
|
|
1495
|
-
display: "grid",
|
|
1496
|
-
contain: "layout",
|
|
1497
|
-
isolation: "isolate"
|
|
1498
|
-
},
|
|
1499
|
-
children: this.props.children
|
|
1500
|
-
}
|
|
1501
|
-
)
|
|
1443
|
+
this.props.children
|
|
1502
1444
|
] });
|
|
1503
1445
|
}
|
|
1504
1446
|
}
|
|
1505
|
-
class
|
|
1447
|
+
class Xe {
|
|
1506
1448
|
promise;
|
|
1507
1449
|
state;
|
|
1508
1450
|
#t;
|
|
@@ -1520,20 +1462,20 @@ class Ge {
|
|
|
1520
1462
|
}), this.#e?.(t);
|
|
1521
1463
|
}
|
|
1522
1464
|
}
|
|
1523
|
-
class
|
|
1465
|
+
class jt extends Event {
|
|
1524
1466
|
#t;
|
|
1525
1467
|
#e = !1;
|
|
1526
|
-
#
|
|
1527
|
-
#
|
|
1528
|
-
#
|
|
1468
|
+
#s = !0;
|
|
1469
|
+
#r = !1;
|
|
1470
|
+
#n = null;
|
|
1529
1471
|
#f = null;
|
|
1530
|
-
#
|
|
1531
|
-
#
|
|
1532
|
-
#
|
|
1472
|
+
#c;
|
|
1473
|
+
#a;
|
|
1474
|
+
#u = new AbortController();
|
|
1533
1475
|
#h = !1;
|
|
1534
1476
|
#i = [];
|
|
1535
|
-
#
|
|
1536
|
-
#
|
|
1477
|
+
#o = null;
|
|
1478
|
+
#d = new Xe();
|
|
1537
1479
|
hasUAVisualTransition = !1;
|
|
1538
1480
|
constructor(t, e) {
|
|
1539
1481
|
super("navigate", { cancelable: !1, bubbles: !1, composed: !1 }), this.#t = t;
|
|
@@ -1542,7 +1484,7 @@ class ge extends Event {
|
|
|
1542
1484
|
} = e ?? {};
|
|
1543
1485
|
if (!n)
|
|
1544
1486
|
throw new Error("Destination is null");
|
|
1545
|
-
this.#
|
|
1487
|
+
this.#c = {
|
|
1546
1488
|
getState() {
|
|
1547
1489
|
return n.getState();
|
|
1548
1490
|
},
|
|
@@ -1551,32 +1493,32 @@ class ge extends Event {
|
|
|
1551
1493
|
index: n.index,
|
|
1552
1494
|
id: n.id,
|
|
1553
1495
|
sameDocument: !0
|
|
1554
|
-
}, this.#
|
|
1496
|
+
}, this.#a = this.#u.signal, window.navigation.addEventListener(
|
|
1555
1497
|
"navigate",
|
|
1556
|
-
this.#
|
|
1557
|
-
{ signal: this.#
|
|
1498
|
+
this.#l,
|
|
1499
|
+
{ signal: this.#a }
|
|
1558
1500
|
);
|
|
1559
1501
|
}
|
|
1560
|
-
#
|
|
1561
|
-
t !== this ? this.#
|
|
1502
|
+
#l = (t) => {
|
|
1503
|
+
t !== this ? this.#u.abort() : this.#i.length || window.navigation.removeEventListener("navigate", this.#l);
|
|
1562
1504
|
};
|
|
1563
1505
|
intercept(t) {
|
|
1564
1506
|
if (this.#h)
|
|
1565
1507
|
throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
|
|
1566
1508
|
const e = t?.handler?.();
|
|
1567
|
-
e && this.#i.push(e), this.#i.length === J &&
|
|
1568
|
-
this.#h = !0, window.removeEventListener("navigate", this.#
|
|
1509
|
+
e && this.#i.push(e), this.#i.length === J && Ke(this.#i).then(() => {
|
|
1510
|
+
this.#h = !0, window.removeEventListener("navigate", this.#l), this.#d.resolve();
|
|
1569
1511
|
});
|
|
1570
1512
|
}
|
|
1571
1513
|
scroll() {
|
|
1572
1514
|
throw new Error("Method not implemented.");
|
|
1573
1515
|
}
|
|
1574
1516
|
get transition() {
|
|
1575
|
-
return this.#
|
|
1576
|
-
finished: this.#
|
|
1517
|
+
return this.#o || (this.#o = {
|
|
1518
|
+
finished: this.#d.promise,
|
|
1577
1519
|
from: window.navigation.currentEntry,
|
|
1578
1520
|
navigationType: this.#t
|
|
1579
|
-
}), this.#
|
|
1521
|
+
}), this.#o;
|
|
1580
1522
|
}
|
|
1581
1523
|
get navigationType() {
|
|
1582
1524
|
return this.#t;
|
|
@@ -1585,34 +1527,35 @@ class ge extends Event {
|
|
|
1585
1527
|
return this.#e;
|
|
1586
1528
|
}
|
|
1587
1529
|
get canIntercept() {
|
|
1588
|
-
return this.#
|
|
1530
|
+
return this.#s;
|
|
1589
1531
|
}
|
|
1590
1532
|
get hashChange() {
|
|
1591
|
-
return this.#
|
|
1533
|
+
return this.#r;
|
|
1592
1534
|
}
|
|
1593
1535
|
get formData() {
|
|
1594
|
-
return this.#
|
|
1536
|
+
return this.#n;
|
|
1595
1537
|
}
|
|
1596
1538
|
get downloadRequest() {
|
|
1597
1539
|
return this.#f;
|
|
1598
1540
|
}
|
|
1599
1541
|
get destination() {
|
|
1600
|
-
return this.#
|
|
1542
|
+
return this.#c;
|
|
1601
1543
|
}
|
|
1602
1544
|
get signal() {
|
|
1603
|
-
return this.#
|
|
1545
|
+
return this.#a;
|
|
1604
1546
|
}
|
|
1605
1547
|
}
|
|
1606
|
-
class
|
|
1607
|
-
|
|
1608
|
-
|
|
1548
|
+
class St extends vt {
|
|
1549
|
+
// TODO: move this out of RouterBase and leave only an abstract declaration
|
|
1550
|
+
ref = Y();
|
|
1551
|
+
screenTransitionLayer = Y();
|
|
1609
1552
|
parent = null;
|
|
1610
1553
|
#t = null;
|
|
1611
1554
|
loadDispatched = !1;
|
|
1612
|
-
|
|
1555
|
+
#e = null;
|
|
1613
1556
|
parentScreen = null;
|
|
1614
1557
|
static rootRouterRef = null;
|
|
1615
|
-
static contextType =
|
|
1558
|
+
static contextType = ce;
|
|
1616
1559
|
constructor(t, e) {
|
|
1617
1560
|
super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null;
|
|
1618
1561
|
}
|
|
@@ -1623,15 +1566,18 @@ class Rt extends at {
|
|
|
1623
1566
|
if (this.parent)
|
|
1624
1567
|
this.parent.child = this;
|
|
1625
1568
|
else {
|
|
1626
|
-
const t =
|
|
1569
|
+
const t = St.rootRouterRef?.deref();
|
|
1627
1570
|
if (this !== t && t?.mounted)
|
|
1628
1571
|
throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
|
|
1629
|
-
|
|
1572
|
+
St.rootRouterRef = new WeakRef(this), window.navigation.addEventListener(
|
|
1630
1573
|
"navigate",
|
|
1631
1574
|
this
|
|
1632
1575
|
);
|
|
1633
1576
|
}
|
|
1634
|
-
this.#
|
|
1577
|
+
if (this.#s(), !this.loadDispatched) {
|
|
1578
|
+
const t = this.parent?.activeEvent?.destination;
|
|
1579
|
+
this.#e = new jt("load", { destination: t }), window.navigation.dispatchEvent(this.#e), this.loadDispatched = !0;
|
|
1580
|
+
}
|
|
1635
1581
|
}
|
|
1636
1582
|
componentWillUnmount() {
|
|
1637
1583
|
this.#r(), this.isRoot && window.navigation.removeEventListener(
|
|
@@ -1639,13 +1585,19 @@ class Rt extends at {
|
|
|
1639
1585
|
this
|
|
1640
1586
|
);
|
|
1641
1587
|
}
|
|
1588
|
+
interceptHandler = () => {
|
|
1589
|
+
let t;
|
|
1590
|
+
return this.#e instanceof jt ? t = this.#e.transition : t = window.navigation.transition, t?.finished.finally(() => this.#e = null), Promise.resolve();
|
|
1591
|
+
};
|
|
1642
1592
|
onnavigate(t) {
|
|
1643
1593
|
const n = [...this.#n()].findLast(
|
|
1644
|
-
(
|
|
1594
|
+
(s) => s.canIntercept(t)
|
|
1645
1595
|
);
|
|
1646
|
-
n && (n.intercept(t),
|
|
1596
|
+
n && (this.#e = t, n.intercept(t), t.defaultPrevented ? this.#e = null : t.intercept({
|
|
1597
|
+
handler: this.interceptHandler
|
|
1598
|
+
}));
|
|
1647
1599
|
}
|
|
1648
|
-
#
|
|
1600
|
+
#s() {
|
|
1649
1601
|
this.constructor.events.forEach((e) => {
|
|
1650
1602
|
this.ref.current?.addEventListener(e, this);
|
|
1651
1603
|
});
|
|
@@ -1655,21 +1607,21 @@ class Rt extends at {
|
|
|
1655
1607
|
this.ref.current?.removeEventListener(e, this);
|
|
1656
1608
|
});
|
|
1657
1609
|
}
|
|
1658
|
-
*#n(t =
|
|
1610
|
+
*#n(t = St.rootRouterRef?.deref() ?? null) {
|
|
1659
1611
|
let e = t;
|
|
1660
1612
|
for (; e; )
|
|
1661
1613
|
yield e, e = e.child;
|
|
1662
1614
|
}
|
|
1663
1615
|
getRouterById(t, e) {
|
|
1664
|
-
return [...this.#n(e)].find((
|
|
1616
|
+
return [...this.#n(e)].find((s) => s.id === t) ?? null;
|
|
1665
1617
|
}
|
|
1666
1618
|
dispatchEvent(t) {
|
|
1667
1619
|
const e = this.ref.current ?? void 0;
|
|
1668
|
-
return
|
|
1620
|
+
return Ve(t, e);
|
|
1669
1621
|
}
|
|
1670
1622
|
addEventListener(t, e, n) {
|
|
1671
|
-
const
|
|
1672
|
-
return
|
|
1623
|
+
const s = this.ref.current;
|
|
1624
|
+
return s ? (s.addEventListener(t, e, n), () => s.removeEventListener(t, e, n)) : () => {
|
|
1673
1625
|
};
|
|
1674
1626
|
}
|
|
1675
1627
|
removeEventListener(t, e, n) {
|
|
@@ -1681,7 +1633,7 @@ class Rt extends at {
|
|
|
1681
1633
|
}
|
|
1682
1634
|
screenChildFromPathname(t) {
|
|
1683
1635
|
for (const e of Xt.toArray(this.props.children)) {
|
|
1684
|
-
if (!
|
|
1636
|
+
if (!xe(e))
|
|
1685
1637
|
continue;
|
|
1686
1638
|
const n = te(
|
|
1687
1639
|
e.props.path,
|
|
@@ -1699,11 +1651,17 @@ class Rt extends at {
|
|
|
1699
1651
|
}
|
|
1700
1652
|
preloadScreen(t) {
|
|
1701
1653
|
const e = t.props.config, n = [];
|
|
1702
|
-
return
|
|
1654
|
+
return q(t.props.component) && n.push(t.props.component.load()), q(e?.header?.component) && n.push(e?.header?.component.load()), q(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
|
|
1703
1655
|
});
|
|
1704
1656
|
}
|
|
1705
1657
|
includesRoute(t, e = window.location.origin) {
|
|
1706
|
-
return this.pathPatterns.some(({ pattern: n, caseSensitive:
|
|
1658
|
+
return this.pathPatterns.some(({ pattern: n, caseSensitive: s }) => te(n, t, e, s));
|
|
1659
|
+
}
|
|
1660
|
+
get activeEvent() {
|
|
1661
|
+
return this.#e;
|
|
1662
|
+
}
|
|
1663
|
+
get hasUAVisualTransition() {
|
|
1664
|
+
return !!this.#e?.hasUAVisualTransition;
|
|
1707
1665
|
}
|
|
1708
1666
|
get id() {
|
|
1709
1667
|
if (this.props.id)
|
|
@@ -1716,19 +1674,19 @@ class Rt extends at {
|
|
|
1716
1674
|
}
|
|
1717
1675
|
get baseURL() {
|
|
1718
1676
|
const t = this.isRoot ? window.location.pathname : this.parentScreen.resolvedPathname, e = this.baseURLPattern.pathname;
|
|
1719
|
-
return
|
|
1677
|
+
return Ot(e, t);
|
|
1720
1678
|
}
|
|
1721
1679
|
get baseURLPattern() {
|
|
1722
1680
|
let t = window.location.origin + "/", e = this.props.config?.basePath;
|
|
1723
1681
|
if (e || (this.isRoot ? e = "/" : e = "."), this.parent && this.parentScreen) {
|
|
1724
1682
|
const {
|
|
1725
1683
|
resolvedPathname: n = window.location.pathname,
|
|
1726
|
-
path:
|
|
1684
|
+
path: s
|
|
1727
1685
|
} = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({
|
|
1728
1686
|
baseURL: a,
|
|
1729
|
-
pathname:
|
|
1687
|
+
pathname: s
|
|
1730
1688
|
});
|
|
1731
|
-
t =
|
|
1689
|
+
t = Ot(
|
|
1732
1690
|
o.pathname,
|
|
1733
1691
|
n
|
|
1734
1692
|
).href;
|
|
@@ -1755,28 +1713,18 @@ class Rt extends at {
|
|
|
1755
1713
|
}
|
|
1756
1714
|
render() {
|
|
1757
1715
|
if (this.navigation)
|
|
1758
|
-
return /* @__PURE__ */
|
|
1759
|
-
|
|
1716
|
+
return /* @__PURE__ */ R(gt.Provider, { value: this, children: /* @__PURE__ */ R(
|
|
1717
|
+
Ge,
|
|
1760
1718
|
{
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
children: /* @__PURE__ */ T(vt.Provider, { value: this, children: /* @__PURE__ */ T(
|
|
1766
|
-
He,
|
|
1767
|
-
{
|
|
1768
|
-
id: `${this.id}-transition-layer`,
|
|
1769
|
-
ref: this.screenTransitionLayer,
|
|
1770
|
-
navigation: this.navigation,
|
|
1771
|
-
hasUAVisualTransition: this.hasUAVisualTransition,
|
|
1772
|
-
children: this.screens
|
|
1773
|
-
}
|
|
1774
|
-
) })
|
|
1719
|
+
ref: this.screenTransitionLayer,
|
|
1720
|
+
navigation: this.navigation,
|
|
1721
|
+
hasUAVisualTransition: this.hasUAVisualTransition,
|
|
1722
|
+
children: this.screens
|
|
1775
1723
|
}
|
|
1776
|
-
);
|
|
1724
|
+
) });
|
|
1777
1725
|
}
|
|
1778
1726
|
}
|
|
1779
|
-
class
|
|
1727
|
+
class Ye {
|
|
1780
1728
|
#t = /* @__PURE__ */ new Map();
|
|
1781
1729
|
mutationObserver;
|
|
1782
1730
|
constructor() {
|
|
@@ -1800,12 +1748,12 @@ class Xe {
|
|
|
1800
1748
|
const e = this.formatMetaKey(t), n = this.#t.get(e);
|
|
1801
1749
|
if (!n)
|
|
1802
1750
|
return;
|
|
1803
|
-
let
|
|
1804
|
-
return n.includes(",") && n.includes("=") ?
|
|
1751
|
+
let s;
|
|
1752
|
+
return n.includes(",") && n.includes("=") ? s = n.split(/,\s*/).map((a) => a.split("=")) : s = n, s;
|
|
1805
1753
|
}
|
|
1806
1754
|
set(t, e) {
|
|
1807
|
-
const n = this.formatMetaKey(t),
|
|
1808
|
-
this.#t.set(n,
|
|
1755
|
+
const n = this.formatMetaKey(t), s = this.formatMetaContent(e);
|
|
1756
|
+
this.#t.set(n, s), typeof t == "string" && (t = ["name", t]), this.updateMetaElement(t, s);
|
|
1809
1757
|
}
|
|
1810
1758
|
has(t) {
|
|
1811
1759
|
const e = this.formatMetaKey(t);
|
|
@@ -1837,10 +1785,10 @@ class Xe {
|
|
|
1837
1785
|
return;
|
|
1838
1786
|
e.removedNodes.forEach((n) => {
|
|
1839
1787
|
if (n.nodeName === "META") {
|
|
1840
|
-
const
|
|
1841
|
-
if (!
|
|
1788
|
+
const s = Array.from(n.attributes).find((l) => l.nodeName !== "content");
|
|
1789
|
+
if (!s || !s.value)
|
|
1842
1790
|
return;
|
|
1843
|
-
const a = [
|
|
1791
|
+
const a = [s.nodeName, s.value], o = this.formatMetaKey(a);
|
|
1844
1792
|
this.#t.has(o) && this.#t.delete(o);
|
|
1845
1793
|
}
|
|
1846
1794
|
}), e.addedNodes.forEach((n) => {
|
|
@@ -1852,7 +1800,7 @@ class Xe {
|
|
|
1852
1800
|
const e = Array.from(t.attributes).find((o) => o.nodeName !== "content"), n = Array.from(t.attributes).find((o) => o.nodeName === "content");
|
|
1853
1801
|
if (!e || !e.value)
|
|
1854
1802
|
return;
|
|
1855
|
-
const
|
|
1803
|
+
const s = [e.nodeName, e.value], a = this.formatMetaKey(s);
|
|
1856
1804
|
this.#t.set(a, n?.value);
|
|
1857
1805
|
}
|
|
1858
1806
|
formatMetaKey(t) {
|
|
@@ -1860,8 +1808,8 @@ class Xe {
|
|
|
1860
1808
|
if (typeof t == "string")
|
|
1861
1809
|
e = `name="${t}"`;
|
|
1862
1810
|
else {
|
|
1863
|
-
const [n,
|
|
1864
|
-
e = `${n}="${
|
|
1811
|
+
const [n, s] = t;
|
|
1812
|
+
e = `${n}="${s}"`;
|
|
1865
1813
|
}
|
|
1866
1814
|
return e;
|
|
1867
1815
|
}
|
|
@@ -1872,13 +1820,13 @@ class Xe {
|
|
|
1872
1820
|
return typeof t == "string" ? e = t : e = t.map((n) => n.join("=")).join(", "), e;
|
|
1873
1821
|
}
|
|
1874
1822
|
updateMetaElement(t, e) {
|
|
1875
|
-
const n = document.querySelector(`meta[${this.formatMetaKey(t)}]`) || document.createElement("meta"), [
|
|
1876
|
-
n.setAttribute(
|
|
1823
|
+
const n = document.querySelector(`meta[${this.formatMetaKey(t)}]`) || document.createElement("meta"), [s, a] = t;
|
|
1824
|
+
n.setAttribute(s, a), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
|
|
1877
1825
|
}
|
|
1878
1826
|
}
|
|
1879
|
-
class
|
|
1827
|
+
class Ft {
|
|
1880
1828
|
static rootNavigatorRef = null;
|
|
1881
|
-
metaData = new
|
|
1829
|
+
metaData = new Ye();
|
|
1882
1830
|
addEventListener;
|
|
1883
1831
|
removeEventListener;
|
|
1884
1832
|
dispatchEvent;
|
|
@@ -1888,22 +1836,22 @@ class jt {
|
|
|
1888
1836
|
baseURLPattern;
|
|
1889
1837
|
getNavigatorById;
|
|
1890
1838
|
constructor(t) {
|
|
1891
|
-
const e =
|
|
1892
|
-
(!e || !e.isInDocument) && (
|
|
1839
|
+
const e = Ft.rootNavigatorRef?.deref();
|
|
1840
|
+
(!e || !e.isInDocument) && (Ft.rootNavigatorRef = new WeakRef(this)), this.addEventListener = t.addEventListener, this.removeEventListener = t.removeEventListener, this.dispatchEvent = t.dispatchEvent, this.parent = t.parent, this.routerId = t.routerId, this.baseURL = t.baseURL, this.baseURLPattern = t.baseURLPattern, this.getNavigatorById = t.getNavigatorById;
|
|
1893
1841
|
}
|
|
1894
1842
|
preload(t, e) {
|
|
1895
|
-
const n = new URL(t, this.baseURL).href,
|
|
1843
|
+
const n = new URL(t, this.baseURL).href, s = {
|
|
1896
1844
|
getState() {
|
|
1897
1845
|
return e;
|
|
1898
1846
|
},
|
|
1899
|
-
index:
|
|
1847
|
+
index: le,
|
|
1900
1848
|
sameDocument: !0,
|
|
1901
1849
|
url: n,
|
|
1902
1850
|
id: null,
|
|
1903
1851
|
key: null
|
|
1904
|
-
}, a = new
|
|
1852
|
+
}, a = new jt("preload", { destination: s });
|
|
1905
1853
|
window.navigation.dispatchEvent(a);
|
|
1906
|
-
const o =
|
|
1854
|
+
const o = He(s);
|
|
1907
1855
|
return {
|
|
1908
1856
|
finished: a.transition.finished.then(() => o),
|
|
1909
1857
|
committed: Promise.resolve(o)
|
|
@@ -1913,25 +1861,25 @@ class jt {
|
|
|
1913
1861
|
return !!document.getElementById(`${this.routerId}`);
|
|
1914
1862
|
}
|
|
1915
1863
|
}
|
|
1916
|
-
function
|
|
1917
|
-
const i =
|
|
1864
|
+
function pn() {
|
|
1865
|
+
const i = at(gt);
|
|
1918
1866
|
if (i)
|
|
1919
1867
|
return i.navigation;
|
|
1920
1868
|
throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
|
|
1921
1869
|
}
|
|
1922
|
-
function pn() {
|
|
1923
|
-
return ft(vt);
|
|
1924
|
-
}
|
|
1925
1870
|
function mn() {
|
|
1926
|
-
|
|
1927
|
-
|
|
1871
|
+
return at(gt);
|
|
1872
|
+
}
|
|
1873
|
+
function vn() {
|
|
1874
|
+
be("Motion");
|
|
1875
|
+
const i = at(gt), e = at(Kt).animation, n = 1;
|
|
1928
1876
|
return re(
|
|
1929
|
-
(
|
|
1877
|
+
(s) => {
|
|
1930
1878
|
const a = async () => {
|
|
1931
1879
|
do
|
|
1932
1880
|
await new Promise((o) => {
|
|
1933
1881
|
requestAnimationFrame(o);
|
|
1934
|
-
}),
|
|
1882
|
+
}), s();
|
|
1935
1883
|
while (e.playState === "running");
|
|
1936
1884
|
};
|
|
1937
1885
|
return i.addEventListener("routertransitionstart", a), () => {
|
|
@@ -1939,54 +1887,54 @@ function mn() {
|
|
|
1939
1887
|
};
|
|
1940
1888
|
},
|
|
1941
1889
|
() => {
|
|
1942
|
-
const { progress:
|
|
1943
|
-
return
|
|
1890
|
+
const { progress: s } = e?.effect?.getComputedTiming() ?? {};
|
|
1891
|
+
return s ?? n;
|
|
1944
1892
|
}
|
|
1945
1893
|
);
|
|
1946
1894
|
}
|
|
1947
|
-
function
|
|
1948
|
-
const i =
|
|
1895
|
+
function _e() {
|
|
1896
|
+
const i = at(ue);
|
|
1949
1897
|
if (i)
|
|
1950
1898
|
return i;
|
|
1951
1899
|
throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
|
|
1952
1900
|
}
|
|
1953
1901
|
function gn(i, t) {
|
|
1954
|
-
const e =
|
|
1955
|
-
|
|
1956
|
-
|
|
1902
|
+
const e = _e(), n = t instanceof Function ? t() : t, s = Vt(e);
|
|
1903
|
+
ae(() => {
|
|
1904
|
+
s.current = e;
|
|
1957
1905
|
}, [e]);
|
|
1958
|
-
const a =
|
|
1959
|
-
const { params: f, setParams: d } =
|
|
1906
|
+
const a = Te((l) => {
|
|
1907
|
+
const { params: f, setParams: d } = s.current;
|
|
1960
1908
|
l instanceof Function && (l = l(f[i] ?? n)), d({ [i]: l });
|
|
1961
1909
|
}, [n, i]);
|
|
1962
1910
|
return [e.params[i] ?? n, a];
|
|
1963
1911
|
}
|
|
1964
|
-
const
|
|
1965
|
-
function
|
|
1912
|
+
const pt = "--rerender";
|
|
1913
|
+
function yn() {
|
|
1966
1914
|
return re(
|
|
1967
1915
|
(i) => (globalThis.addEventListener(
|
|
1968
|
-
|
|
1916
|
+
pt,
|
|
1969
1917
|
i,
|
|
1970
1918
|
{ once: !0 }
|
|
1971
1919
|
), () => {
|
|
1972
|
-
globalThis.removeEventListener(
|
|
1920
|
+
globalThis.removeEventListener(pt, i);
|
|
1973
1921
|
}),
|
|
1974
1922
|
() => document.timeline.currentTime
|
|
1975
1923
|
);
|
|
1976
1924
|
}
|
|
1977
|
-
function
|
|
1978
|
-
const t =
|
|
1979
|
-
t.current = i,
|
|
1925
|
+
function wn(i) {
|
|
1926
|
+
const t = Vt(i);
|
|
1927
|
+
t.current = i, ae(() => {
|
|
1980
1928
|
const e = t.current;
|
|
1981
|
-
return globalThis.addEventListener(
|
|
1982
|
-
globalThis.removeEventListener(
|
|
1929
|
+
return globalThis.addEventListener(pt, e), () => {
|
|
1930
|
+
globalThis.removeEventListener(pt, e);
|
|
1983
1931
|
};
|
|
1984
1932
|
});
|
|
1985
1933
|
}
|
|
1986
|
-
function
|
|
1987
|
-
globalThis.dispatchEvent(new Event(
|
|
1934
|
+
function En() {
|
|
1935
|
+
globalThis.dispatchEvent(new Event(pt));
|
|
1988
1936
|
}
|
|
1989
|
-
function
|
|
1937
|
+
function bn(i, t) {
|
|
1990
1938
|
return Object.create(EventTarget.prototype, {
|
|
1991
1939
|
id: {
|
|
1992
1940
|
value: crypto.randomUUID(),
|
|
@@ -2033,11 +1981,11 @@ function En(i, t) {
|
|
|
2033
1981
|
}
|
|
2034
1982
|
});
|
|
2035
1983
|
}
|
|
2036
|
-
function
|
|
1984
|
+
function Tn() {
|
|
2037
1985
|
if (!window.navigation)
|
|
2038
1986
|
throw new Error("window.navigation is not available in this environment");
|
|
2039
1987
|
}
|
|
2040
|
-
async function
|
|
1988
|
+
async function Rn() {
|
|
2041
1989
|
await new Promise((i) => {
|
|
2042
1990
|
window.navigation.addEventListener(
|
|
2043
1991
|
"navigatesuccess",
|
|
@@ -2046,47 +1994,47 @@ async function Tn() {
|
|
|
2046
1994
|
);
|
|
2047
1995
|
});
|
|
2048
1996
|
}
|
|
2049
|
-
async function Ct(i) {
|
|
2050
|
-
await window.navigation.navigate(i).finished;
|
|
1997
|
+
async function Ct(i, t) {
|
|
1998
|
+
await window.navigation.navigate(i, { history: t }).finished;
|
|
2051
1999
|
}
|
|
2052
2000
|
async function Sn(i) {
|
|
2053
2001
|
await window.navigation.traverseTo(i).finished;
|
|
2054
2002
|
}
|
|
2055
|
-
async function
|
|
2003
|
+
async function kn() {
|
|
2056
2004
|
const i = window.navigation.entries()[0];
|
|
2057
2005
|
await window.navigation.traverseTo(i.key).finished;
|
|
2058
2006
|
}
|
|
2059
|
-
async function
|
|
2007
|
+
async function xn() {
|
|
2060
2008
|
await Ct("/one"), await Ct("/two"), await Ct("/three");
|
|
2061
2009
|
}
|
|
2062
|
-
const
|
|
2010
|
+
const ge = (i) => {
|
|
2063
2011
|
i.intercept({
|
|
2064
2012
|
handler() {
|
|
2065
2013
|
return Promise.resolve();
|
|
2066
2014
|
}
|
|
2067
2015
|
});
|
|
2068
2016
|
};
|
|
2069
|
-
async function xn() {
|
|
2070
|
-
window.navigation.addEventListener("navigate", ve);
|
|
2071
|
-
}
|
|
2072
2017
|
async function Cn() {
|
|
2073
|
-
window.navigation.
|
|
2018
|
+
window.navigation.addEventListener("navigate", ge);
|
|
2074
2019
|
}
|
|
2075
|
-
|
|
2020
|
+
async function Ln() {
|
|
2021
|
+
window.navigation.removeEventListener("navigate", ge);
|
|
2022
|
+
}
|
|
2023
|
+
class B extends we.Component {
|
|
2076
2024
|
constructor(t) {
|
|
2077
2025
|
super(t), this.state = {
|
|
2078
2026
|
href: this.href
|
|
2079
2027
|
};
|
|
2080
2028
|
}
|
|
2081
|
-
anchorRef =
|
|
2029
|
+
anchorRef = Y();
|
|
2082
2030
|
static directionFromRel(t) {
|
|
2083
2031
|
return t?.split(" ").findLast((e) => e === "next" || e === "prev") ?? "prev";
|
|
2084
2032
|
}
|
|
2085
|
-
static findClosestEntryByHref(t, e, n,
|
|
2086
|
-
if (!Array.isArray(n) ||
|
|
2033
|
+
static findClosestEntryByHref(t, e, n, s) {
|
|
2034
|
+
if (!Array.isArray(n) || s < O || s >= n.length || n.length === J)
|
|
2087
2035
|
return;
|
|
2088
|
-
let a =
|
|
2089
|
-
const l =
|
|
2036
|
+
let a = s - J, o = s + J;
|
|
2037
|
+
const l = B.directionFromRel(e);
|
|
2090
2038
|
for (l === "next" && (a = O), l === "prev" && (o = n.length); a >= O || o < n.length; ) {
|
|
2091
2039
|
if (a >= O && n[a]?.url === t)
|
|
2092
2040
|
return n[a];
|
|
@@ -2096,7 +2044,7 @@ class K extends Lt.Component {
|
|
|
2096
2044
|
}
|
|
2097
2045
|
}
|
|
2098
2046
|
static findClosestEntry(t, e, n) {
|
|
2099
|
-
switch (
|
|
2047
|
+
switch (B.directionFromRel(t)) {
|
|
2100
2048
|
case "prev":
|
|
2101
2049
|
return e[n - J];
|
|
2102
2050
|
case "next":
|
|
@@ -2104,64 +2052,45 @@ class K extends Lt.Component {
|
|
|
2104
2052
|
}
|
|
2105
2053
|
}
|
|
2106
2054
|
componentDidMount() {
|
|
2107
|
-
window.navigation?.addEventListener("navigatesuccess", this.
|
|
2055
|
+
window.navigation?.addEventListener("navigatesuccess", this), this.anchorRef.current?.addEventListener("click", this);
|
|
2108
2056
|
}
|
|
2109
2057
|
componentWillUnmount() {
|
|
2110
|
-
window.navigation?.removeEventListener("navigatesuccess", this.
|
|
2058
|
+
window.navigation?.removeEventListener("navigatesuccess", this), this.anchorRef.current?.removeEventListener("click", this);
|
|
2059
|
+
}
|
|
2060
|
+
handleEvent(t) {
|
|
2061
|
+
const e = `on${t.type}`;
|
|
2062
|
+
this[e]?.(t);
|
|
2111
2063
|
}
|
|
2112
|
-
|
|
2064
|
+
onnavigatesuccess() {
|
|
2113
2065
|
const { href: t } = this;
|
|
2114
2066
|
this.setState({ href: t });
|
|
2115
|
-
};
|
|
2116
|
-
get href() {
|
|
2117
|
-
const { href: t, traverse: e, reload: n, historyEntryKey: r, rel: a } = this.props;
|
|
2118
|
-
if (t === void 0 && e) {
|
|
2119
|
-
let o;
|
|
2120
|
-
return r ? o = window.navigation?.entries().find((l) => l.key === r) : a && (t ? o = K.findClosestEntryByHref(
|
|
2121
|
-
t,
|
|
2122
|
-
a,
|
|
2123
|
-
window.navigation.entries(),
|
|
2124
|
-
window.navigation.currentEntry?.index ?? O
|
|
2125
|
-
) : o = K.findClosestEntry(
|
|
2126
|
-
a,
|
|
2127
|
-
window.navigation.entries(),
|
|
2128
|
-
window.navigation.currentEntry?.index ?? O
|
|
2129
|
-
)), o?.url;
|
|
2130
|
-
} else if (n)
|
|
2131
|
-
return ".";
|
|
2132
|
-
return t;
|
|
2133
|
-
}
|
|
2134
|
-
get search() {
|
|
2135
|
-
return this.props.search ? this.props.search.startsWith("?") ? this.props.search : `?${this.props.search}` : "";
|
|
2136
2067
|
}
|
|
2137
|
-
|
|
2138
|
-
if (this.props.onClick?.(t), t.defaultPrevented)
|
|
2139
|
-
return;
|
|
2068
|
+
onclick(t) {
|
|
2140
2069
|
t.preventDefault();
|
|
2141
2070
|
const e = window.navigation, {
|
|
2142
2071
|
rel: n,
|
|
2143
|
-
historyEntryKey:
|
|
2072
|
+
historyEntryKey: s,
|
|
2144
2073
|
reload: a,
|
|
2145
2074
|
replace: o,
|
|
2146
2075
|
traverse: l,
|
|
2147
2076
|
navigateInfo: f,
|
|
2148
2077
|
navigateState: d
|
|
2149
2078
|
} = this.props, m = this.anchorRef.current?.href;
|
|
2150
|
-
if (
|
|
2151
|
-
e.traverseTo(
|
|
2079
|
+
if (s) {
|
|
2080
|
+
e.traverseTo(s, { info: f });
|
|
2152
2081
|
return;
|
|
2153
2082
|
}
|
|
2154
2083
|
if (l) {
|
|
2155
|
-
const
|
|
2084
|
+
const T = e.entries();
|
|
2156
2085
|
let E;
|
|
2157
|
-
if (m ? E =
|
|
2086
|
+
if (m ? E = B.findClosestEntryByHref(
|
|
2158
2087
|
m,
|
|
2159
2088
|
n,
|
|
2160
|
-
|
|
2089
|
+
T,
|
|
2161
2090
|
e.currentEntry?.index ?? O
|
|
2162
|
-
) : E =
|
|
2091
|
+
) : E = B.findClosestEntry(
|
|
2163
2092
|
n,
|
|
2164
|
-
|
|
2093
|
+
T,
|
|
2165
2094
|
e.currentEntry?.index ?? O
|
|
2166
2095
|
), E) {
|
|
2167
2096
|
e.traverseTo(E.key, { info: f });
|
|
@@ -2177,12 +2106,33 @@ class K extends Lt.Component {
|
|
|
2177
2106
|
return;
|
|
2178
2107
|
}
|
|
2179
2108
|
m && e.navigate(m, { info: f, state: d });
|
|
2180
|
-
}
|
|
2109
|
+
}
|
|
2110
|
+
get href() {
|
|
2111
|
+
const { href: t, traverse: e, reload: n, historyEntryKey: s, rel: a } = this.props;
|
|
2112
|
+
if (t === void 0 && e) {
|
|
2113
|
+
let o;
|
|
2114
|
+
return s ? o = window.navigation?.entries().find((l) => l.key === s) : t ? o = B.findClosestEntryByHref(
|
|
2115
|
+
t,
|
|
2116
|
+
a,
|
|
2117
|
+
window.navigation.entries(),
|
|
2118
|
+
window.navigation.currentEntry?.index ?? O
|
|
2119
|
+
) : o = B.findClosestEntry(
|
|
2120
|
+
a,
|
|
2121
|
+
window.navigation.entries(),
|
|
2122
|
+
window.navigation.currentEntry?.index ?? O
|
|
2123
|
+
), o?.url;
|
|
2124
|
+
} else if (n)
|
|
2125
|
+
return ".";
|
|
2126
|
+
return t;
|
|
2127
|
+
}
|
|
2128
|
+
get search() {
|
|
2129
|
+
return this.props.search ? this.props.search.startsWith("?") ? this.props.search : `?${this.props.search}` : "";
|
|
2130
|
+
}
|
|
2181
2131
|
render() {
|
|
2182
2132
|
const {
|
|
2183
2133
|
rel: t,
|
|
2184
2134
|
children: e
|
|
2185
|
-
} = this.props, { href: n } = this.state, { search:
|
|
2135
|
+
} = this.props, { href: n } = this.state, { search: s } = this, a = qe(this.props, [
|
|
2186
2136
|
"historyEntryKey",
|
|
2187
2137
|
"navigateInfo",
|
|
2188
2138
|
"navigateState",
|
|
@@ -2190,80 +2140,79 @@ class K extends Lt.Component {
|
|
|
2190
2140
|
"replace",
|
|
2191
2141
|
"traverse"
|
|
2192
2142
|
]);
|
|
2193
|
-
return /* @__PURE__ */
|
|
2143
|
+
return /* @__PURE__ */ R(
|
|
2194
2144
|
"a",
|
|
2195
2145
|
{
|
|
2196
2146
|
...a,
|
|
2197
2147
|
ref: this.anchorRef,
|
|
2198
|
-
href: n ? `${n}${
|
|
2148
|
+
href: n ? `${n}${s}` : void 0,
|
|
2199
2149
|
rel: t,
|
|
2200
|
-
onClick: this.handleClick,
|
|
2201
2150
|
children: e
|
|
2202
2151
|
}
|
|
2203
2152
|
);
|
|
2204
2153
|
}
|
|
2205
2154
|
}
|
|
2206
|
-
function
|
|
2207
|
-
const e =
|
|
2208
|
-
return
|
|
2155
|
+
function Mn({ ref: i, ...t }) {
|
|
2156
|
+
const e = Vt(null);
|
|
2157
|
+
return ne(
|
|
2209
2158
|
i,
|
|
2210
2159
|
() => e.current?.anchorRef.current ?? null
|
|
2211
|
-
), /* @__PURE__ */
|
|
2160
|
+
), /* @__PURE__ */ R(B, { ref: e, ...t });
|
|
2212
2161
|
}
|
|
2213
2162
|
export {
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2163
|
+
Mn as Anchor,
|
|
2164
|
+
B as AnchorBase,
|
|
2165
|
+
an as EMPTY_COLLECTION_LENGTH,
|
|
2217
2166
|
O as FIRST_INDEX,
|
|
2218
|
-
|
|
2219
|
-
|
|
2167
|
+
le as LAST_INDEX,
|
|
2168
|
+
jt as LoadEvent,
|
|
2220
2169
|
rn as MAX_NORM_PROGRESS,
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2170
|
+
en as MAX_PROGRESS,
|
|
2171
|
+
tn as MAX_Z_INDEX,
|
|
2172
|
+
sn as MIN_NORM_PROGRESS,
|
|
2173
|
+
nn as MIN_PROGRESS,
|
|
2174
|
+
Ft as NavigationBase,
|
|
2175
|
+
ce as NestedRouterContext,
|
|
2176
|
+
Ke as PromiseAllSequential,
|
|
2177
|
+
Xe as PromiseWrapper,
|
|
2178
|
+
ue as RoutePropContext,
|
|
2179
|
+
St as RouterBase,
|
|
2180
|
+
gt as RouterContext,
|
|
2232
2181
|
J as SINGLE_ELEMENT_LENGTH,
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2182
|
+
ke as ScreenBase,
|
|
2183
|
+
Qe as SharedElement,
|
|
2184
|
+
Tn as assertNavigationAvailable,
|
|
2185
|
+
fn as cloneAndInject,
|
|
2186
|
+
bn as createHistoryEntry,
|
|
2187
|
+
Ve as dispatchEvent,
|
|
2188
|
+
He as historyEntryFromDestination,
|
|
2189
|
+
Cn as installInterceptor,
|
|
2190
|
+
q as isLazyExoticComponent,
|
|
2242
2191
|
he as isNativeLazyExoticComponent,
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2192
|
+
cn as isNavigationSupported,
|
|
2193
|
+
Ce as isStylableElement,
|
|
2194
|
+
un as isURLPatternSupported,
|
|
2195
|
+
xe as isValidScreenChild,
|
|
2196
|
+
ln as lazy,
|
|
2248
2197
|
te as matchRoute,
|
|
2249
2198
|
Ct as navTo,
|
|
2250
|
-
|
|
2251
|
-
|
|
2199
|
+
qe as omit,
|
|
2200
|
+
dn as polyfillNavigation,
|
|
2252
2201
|
hn as polyfillURLPattern,
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2202
|
+
Ot as resolveBaseURLFromPattern,
|
|
2203
|
+
xn as seedHistory,
|
|
2204
|
+
Be as toCamelCase,
|
|
2256
2205
|
Sn as traverseTo,
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2206
|
+
kn as traverseToStart,
|
|
2207
|
+
En as triggerRerender,
|
|
2208
|
+
Ln as uninstallInterceptor,
|
|
2209
|
+
vn as useMotion,
|
|
2210
|
+
pn as useNavigationBase,
|
|
2262
2211
|
gn as useParamsBase,
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2212
|
+
yn as useRerender,
|
|
2213
|
+
wn as useRerenderCallback,
|
|
2214
|
+
_e as useRouteBase,
|
|
2215
|
+
mn as useRouterBase,
|
|
2216
|
+
Rn as waitForNavigateSuccess
|
|
2268
2217
|
};
|
|
2269
2218
|
//# sourceMappingURL=index.js.map
|