@react-motion-router/stack 2.0.0-beta.sha-c19f37e → 2.0.0-beta.sha-7188e1e
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 +12 -6
- package/build/GestureRegion.d.ts +3 -2
- package/build/HistoryEntry.d.ts +1 -0
- package/build/Navigation.d.ts +3 -0
- package/build/Router.d.ts +4 -3
- package/build/Screen.d.ts +12 -6
- package/build/__tests__/Anchor/index.test.d.ts +1 -0
- package/build/__tests__/Anchor/preload.force.test.d.ts +1 -0
- package/build/__tests__/Anchor/preload.hover.test.d.ts +1 -0
- package/build/__tests__/Anchor/preload.onsight.test.d.ts +1 -0
- package/build/__tests__/Screen/dialog.test.d.ts +1 -0
- package/build/__tests__/Screen/modal.test.d.ts +1 -0
- package/build/common/constants.d.ts +1 -1
- package/build/common/events.d.ts +6 -9
- package/build/common/test-utils.d.ts +1 -0
- package/build/common/types.d.ts +2 -0
- package/build/index.js +1340 -1184
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -1,604 +1,670 @@
|
|
|
1
|
-
import { NavigationBase as
|
|
1
|
+
import { NavigationBase as bt, resolveBaseURLFromPattern as _t, matchRoute as V, SINGLE_ELEMENT_LENGTH as P, historyEntryFromDestination as U, LAST_INDEX as D, FIRST_INDEX as Y, ScreenBase as Lt, RoutePropContext as Tt, RouterBase as Rt, PromiseWrapper as It, cloneAndInject as xt, LoadEvent as kt, AnchorBase as Dt, useNavigationBase as Ft, useParamsBase as Ot, useRouteBase as Bt, useRouterBase as Kt, Anchor as Mt } from "@react-motion-router/core";
|
|
2
2
|
import { jsx as G } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { GestureTimeline as
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
import J, { createRef as $, useContext as Yt, startTransition as Q, useDebugValue as W, useRef as Xt, useEffect as tt, useImperativeHandle as Ct, useCallback as yt } from "react";
|
|
4
|
+
import { GestureTimeline as At, springToLinear as Ut, easingToLinear as et } from "web-animations-extension";
|
|
5
|
+
var b = {}, q = {}, ot;
|
|
6
|
+
function B() {
|
|
7
|
+
if (ot) return q;
|
|
8
|
+
ot = 1, Object.defineProperty(q, "__esModule", { value: !0 });
|
|
9
|
+
var s;
|
|
10
|
+
(function(e) {
|
|
11
|
+
e[e.tap = 0] = "tap", e[e.longpress = 1] = "longpress", e[e.pinchstart = 2] = "pinchstart", e[e.pinch = 3] = "pinch", e[e.pinchend = 4] = "pinchend", e[e.rotatestart = 5] = "rotatestart", e[e.rotate = 6] = "rotate", e[e.rotateend = 7] = "rotateend", e[e.swipestart = 8] = "swipestart", e[e.swipe = 9] = "swipe", e[e.swipeend = 10] = "swipeend", e[e.panstart = 11] = "panstart", e[e.pan = 12] = "pan", e[e.panend = 13] = "panend", e[e.doubletap = 14] = "doubletap";
|
|
12
|
+
})(s || (s = {})), window.TouchEvent === void 0 && (window.TouchEvent = PointerEvent);
|
|
13
|
+
let t = class extends TouchEvent {
|
|
14
|
+
constructor(n, r) {
|
|
15
|
+
if (super(n, {
|
|
16
|
+
touches: Array.from(r.touches),
|
|
17
|
+
targetTouches: Array.from(r.targetTouches),
|
|
18
|
+
changedTouches: Array.from(r.changedTouches),
|
|
19
|
+
ctrlKey: r.ctrlKey,
|
|
20
|
+
shiftKey: r.shiftKey,
|
|
21
|
+
altKey: r.altKey,
|
|
22
|
+
metaKey: r.metaKey,
|
|
23
|
+
bubbles: !0,
|
|
24
|
+
cancelable: !0
|
|
25
|
+
}), n.includes("end") || r.type.includes("end")) {
|
|
26
|
+
this.gestureTarget = r.changedTouches[0].target, this.x = r.changedTouches[0].clientX, this.y = r.changedTouches[0].clientY;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.gestureTarget = r.touches[0].target, this.x = r.touches[0].clientX, this.y = r.touches[0].clientY;
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
_.default = Xt;
|
|
31
|
-
var z = {}, Ct = y && y.__importDefault || function(n) {
|
|
32
|
-
return n && n.__esModule ? n : { default: n };
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(z, "__esModule", { value: !0 });
|
|
35
|
-
const Ut = Ct(_);
|
|
36
|
-
class Ht extends Ut.default {
|
|
37
|
-
constructor(t, e) {
|
|
38
|
-
super("longpress", t), this.duration = 0, this.duration = e;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
z.default = Ht;
|
|
42
|
-
var Z = {}, At = y && y.__importDefault || function(n) {
|
|
43
|
-
return n && n.__esModule ? n : { default: n };
|
|
44
|
-
};
|
|
45
|
-
Object.defineProperty(Z, "__esModule", { value: !0 });
|
|
46
|
-
const jt = At(_);
|
|
47
|
-
class Nt extends jt.default {
|
|
48
|
-
constructor(t) {
|
|
49
|
-
super("tap", t), this.duration = 0;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
Z.default = Nt;
|
|
53
|
-
var J = {}, $t = y && y.__importDefault || function(n) {
|
|
54
|
-
return n && n.__esModule ? n : { default: n };
|
|
55
|
-
};
|
|
56
|
-
Object.defineProperty(J, "__esModule", { value: !0 });
|
|
57
|
-
const Vt = $t(_);
|
|
58
|
-
class Wt extends Vt.default {
|
|
59
|
-
constructor(t) {
|
|
60
|
-
super("doubletap", t);
|
|
61
|
-
}
|
|
31
|
+
};
|
|
32
|
+
return q.default = t, q;
|
|
62
33
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
constructor(t, e, r) {
|
|
76
|
-
let s;
|
|
77
|
-
switch (r) {
|
|
78
|
-
case "start":
|
|
79
|
-
s = "swipestart";
|
|
80
|
-
break;
|
|
81
|
-
case "end":
|
|
82
|
-
s = "swipeend";
|
|
83
|
-
break;
|
|
84
|
-
default:
|
|
85
|
-
s = "swipe";
|
|
34
|
+
var X = {}, ct;
|
|
35
|
+
function Ht() {
|
|
36
|
+
if (ct) return X;
|
|
37
|
+
ct = 1;
|
|
38
|
+
var s = X && X.__importDefault || function(n) {
|
|
39
|
+
return n && n.__esModule ? n : { default: n };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(X, "__esModule", { value: !0 });
|
|
42
|
+
const t = s(B());
|
|
43
|
+
let e = class extends t.default {
|
|
44
|
+
constructor(r, a) {
|
|
45
|
+
super("longpress", r), this.duration = 0, this.duration = a;
|
|
86
46
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
class zt extends Q {
|
|
91
|
-
constructor(t, e) {
|
|
92
|
-
super(t, e);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
x.default = zt;
|
|
96
|
-
class Zt extends Q {
|
|
97
|
-
constructor(t, e) {
|
|
98
|
-
super(t, e, "start");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
x.SwipeStartEvent = Zt;
|
|
102
|
-
class Jt extends Q {
|
|
103
|
-
constructor(t, e) {
|
|
104
|
-
super(t, e, "end");
|
|
105
|
-
}
|
|
47
|
+
};
|
|
48
|
+
return X.default = e, X;
|
|
106
49
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
constructor(t, e, r) {
|
|
120
|
-
let s;
|
|
121
|
-
switch (r) {
|
|
122
|
-
case "start":
|
|
123
|
-
s = "panstart";
|
|
124
|
-
break;
|
|
125
|
-
case "end":
|
|
126
|
-
s = "panend";
|
|
127
|
-
break;
|
|
128
|
-
default:
|
|
129
|
-
s = "pan";
|
|
50
|
+
var C = {}, ut;
|
|
51
|
+
function Nt() {
|
|
52
|
+
if (ut) return C;
|
|
53
|
+
ut = 1;
|
|
54
|
+
var s = C && C.__importDefault || function(n) {
|
|
55
|
+
return n && n.__esModule ? n : { default: n };
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(C, "__esModule", { value: !0 });
|
|
58
|
+
const t = s(B());
|
|
59
|
+
let e = class extends t.default {
|
|
60
|
+
constructor(r) {
|
|
61
|
+
super("tap", r);
|
|
130
62
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
y: e.translation.y,
|
|
134
|
-
magnitude: e.translation.magnitude,
|
|
135
|
-
clientX: e.translation.clientX,
|
|
136
|
-
clientY: e.translation.clientY,
|
|
137
|
-
clientMagnitude: e.translation.clientMagnitude
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
class ee extends tt {
|
|
142
|
-
constructor(t, e) {
|
|
143
|
-
super(t, e);
|
|
144
|
-
}
|
|
63
|
+
};
|
|
64
|
+
return C.default = e, C;
|
|
145
65
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
66
|
+
var A = {}, ht;
|
|
67
|
+
function jt() {
|
|
68
|
+
if (ht) return A;
|
|
69
|
+
ht = 1;
|
|
70
|
+
var s = A && A.__importDefault || function(n) {
|
|
71
|
+
return n && n.__esModule ? n : { default: n };
|
|
72
|
+
};
|
|
73
|
+
Object.defineProperty(A, "__esModule", { value: !0 });
|
|
74
|
+
const t = s(B());
|
|
75
|
+
let e = class extends t.default {
|
|
76
|
+
constructor(r) {
|
|
77
|
+
super("doubletap", r);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return A.default = e, A;
|
|
151
81
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
82
|
+
var L = {}, lt;
|
|
83
|
+
function qt() {
|
|
84
|
+
if (lt) return L;
|
|
85
|
+
lt = 1;
|
|
86
|
+
var s = L && L.__importDefault || function(i) {
|
|
87
|
+
return i && i.__esModule ? i : { default: i };
|
|
88
|
+
};
|
|
89
|
+
Object.defineProperty(L, "__esModule", { value: !0 }), L.SwipeEndEvent = L.SwipeStartEvent = void 0;
|
|
90
|
+
const t = s(B());
|
|
91
|
+
var e;
|
|
92
|
+
(function(i) {
|
|
93
|
+
i[i.start = 0] = "start", i[i.end = 1] = "end";
|
|
94
|
+
})(e || (e = {}));
|
|
95
|
+
class n extends t.default {
|
|
96
|
+
constructor(c, o, f) {
|
|
97
|
+
let l;
|
|
98
|
+
switch (f) {
|
|
99
|
+
case "start":
|
|
100
|
+
l = "swipestart";
|
|
101
|
+
break;
|
|
102
|
+
case "end":
|
|
103
|
+
l = "swipeend";
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
l = "swipe";
|
|
107
|
+
}
|
|
108
|
+
super(l, c), this.velocity = o.velocity, this.direction = o.direction;
|
|
109
|
+
}
|
|
156
110
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
(function(n) {
|
|
167
|
-
n[n.start = 0] = "start", n[n.end = 1] = "end";
|
|
168
|
-
})(lt || (lt = {}));
|
|
169
|
-
class et extends ie.default {
|
|
170
|
-
constructor(t, e, r) {
|
|
171
|
-
let s;
|
|
172
|
-
switch (r) {
|
|
173
|
-
case "start":
|
|
174
|
-
s = "pinchstart";
|
|
175
|
-
break;
|
|
176
|
-
case "end":
|
|
177
|
-
s = "pinchend";
|
|
178
|
-
break;
|
|
179
|
-
default:
|
|
180
|
-
s = "pinch";
|
|
111
|
+
let r = class extends n {
|
|
112
|
+
constructor(c, o) {
|
|
113
|
+
super(c, o);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
L.default = r;
|
|
117
|
+
class a extends n {
|
|
118
|
+
constructor(c, o) {
|
|
119
|
+
super(c, o, "start");
|
|
181
120
|
}
|
|
182
|
-
super(s, t), Object.defineProperty(this, "scale", {
|
|
183
|
-
value: e.scale,
|
|
184
|
-
writable: !1
|
|
185
|
-
});
|
|
186
121
|
}
|
|
187
|
-
|
|
188
|
-
class
|
|
189
|
-
|
|
190
|
-
|
|
122
|
+
L.SwipeStartEvent = a;
|
|
123
|
+
class u extends n {
|
|
124
|
+
constructor(c, o) {
|
|
125
|
+
super(c, o, "end");
|
|
126
|
+
}
|
|
191
127
|
}
|
|
128
|
+
return L.SwipeEndEvent = u, L;
|
|
192
129
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
130
|
+
var T = {}, dt;
|
|
131
|
+
function Vt() {
|
|
132
|
+
if (dt) return T;
|
|
133
|
+
dt = 1;
|
|
134
|
+
var s = T && T.__importDefault || function(i) {
|
|
135
|
+
return i && i.__esModule ? i : { default: i };
|
|
136
|
+
};
|
|
137
|
+
Object.defineProperty(T, "__esModule", { value: !0 }), T.PanEndEvent = T.PanStartEvent = void 0;
|
|
138
|
+
const t = s(B());
|
|
139
|
+
var e;
|
|
140
|
+
(function(i) {
|
|
141
|
+
i[i.start = 0] = "start", i[i.end = 1] = "end";
|
|
142
|
+
})(e || (e = {}));
|
|
143
|
+
class n extends t.default {
|
|
144
|
+
constructor(c, o, f) {
|
|
145
|
+
let l;
|
|
146
|
+
switch (f) {
|
|
147
|
+
case "start":
|
|
148
|
+
l = "panstart";
|
|
149
|
+
break;
|
|
150
|
+
case "end":
|
|
151
|
+
l = "panend";
|
|
152
|
+
break;
|
|
153
|
+
default:
|
|
154
|
+
l = "pan";
|
|
155
|
+
}
|
|
156
|
+
super(l, c), this.velocity = o.velocity, this.translation = {
|
|
157
|
+
x: o.translation.x,
|
|
158
|
+
y: o.translation.y,
|
|
159
|
+
magnitude: o.translation.magnitude,
|
|
160
|
+
clientX: o.translation.clientX,
|
|
161
|
+
clientY: o.translation.clientY,
|
|
162
|
+
clientMagnitude: o.translation.clientMagnitude
|
|
163
|
+
};
|
|
164
|
+
}
|
|
197
165
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
166
|
+
let r = class extends n {
|
|
167
|
+
constructor(c, o) {
|
|
168
|
+
super(c, o);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
T.default = r;
|
|
172
|
+
class a extends n {
|
|
173
|
+
constructor(c, o) {
|
|
174
|
+
super(c, o, "start");
|
|
175
|
+
}
|
|
203
176
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
};
|
|
209
|
-
Object.defineProperty(M, "__esModule", { value: !0 });
|
|
210
|
-
M.RotateEndEvent = M.RotateStartEvent = void 0;
|
|
211
|
-
const he = ue(_);
|
|
212
|
-
var dt;
|
|
213
|
-
(function(n) {
|
|
214
|
-
n[n.start = 0] = "start", n[n.end = 1] = "end";
|
|
215
|
-
})(dt || (dt = {}));
|
|
216
|
-
class nt extends he.default {
|
|
217
|
-
constructor(t, e, r) {
|
|
218
|
-
let s;
|
|
219
|
-
switch (r) {
|
|
220
|
-
case "start":
|
|
221
|
-
s = "rotatestart";
|
|
222
|
-
break;
|
|
223
|
-
case "end":
|
|
224
|
-
s = "rotateend";
|
|
225
|
-
break;
|
|
226
|
-
default:
|
|
227
|
-
s = "rotate";
|
|
177
|
+
T.PanStartEvent = a;
|
|
178
|
+
class u extends n {
|
|
179
|
+
constructor(c, o) {
|
|
180
|
+
super(c, o, "end");
|
|
228
181
|
}
|
|
229
|
-
super(s, t), this.anchor = {
|
|
230
|
-
x: e.anchor.x,
|
|
231
|
-
y: e.anchor.y,
|
|
232
|
-
clientX: e.anchor.clientX,
|
|
233
|
-
clientY: e.anchor.clientY
|
|
234
|
-
}, Object.defineProperty(this, "rotation", {
|
|
235
|
-
value: e.rotation,
|
|
236
|
-
writable: !1
|
|
237
|
-
}), this.rotationDeg = e.rotationDeg;
|
|
238
182
|
}
|
|
183
|
+
return T.PanEndEvent = u, T;
|
|
239
184
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
185
|
+
var R = {}, ft;
|
|
186
|
+
function Gt() {
|
|
187
|
+
if (ft) return R;
|
|
188
|
+
ft = 1;
|
|
189
|
+
var s = R && R.__importDefault || function(i) {
|
|
190
|
+
return i && i.__esModule ? i : { default: i };
|
|
191
|
+
};
|
|
192
|
+
Object.defineProperty(R, "__esModule", { value: !0 }), R.PinchEndEvent = R.PinchStartEvent = void 0;
|
|
193
|
+
const t = s(B());
|
|
194
|
+
var e;
|
|
195
|
+
(function(i) {
|
|
196
|
+
i[i.start = 0] = "start", i[i.end = 1] = "end";
|
|
197
|
+
})(e || (e = {}));
|
|
198
|
+
class n extends t.default {
|
|
199
|
+
constructor(c, o, f) {
|
|
200
|
+
let l;
|
|
201
|
+
switch (f) {
|
|
202
|
+
case "start":
|
|
203
|
+
l = "pinchstart";
|
|
204
|
+
break;
|
|
205
|
+
case "end":
|
|
206
|
+
l = "pinchend";
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
l = "pinch";
|
|
210
|
+
}
|
|
211
|
+
super(l, c), Object.defineProperty(this, "scale", {
|
|
212
|
+
value: o.scale,
|
|
213
|
+
writable: !1
|
|
214
|
+
});
|
|
215
|
+
}
|
|
243
216
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
217
|
+
let r = class extends n {
|
|
218
|
+
constructor(c, o) {
|
|
219
|
+
super(c, o);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
R.default = r;
|
|
223
|
+
class a extends n {
|
|
224
|
+
constructor(c, o) {
|
|
225
|
+
super(c, o, "start");
|
|
226
|
+
}
|
|
249
227
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
228
|
+
R.PinchStartEvent = a;
|
|
229
|
+
class u extends n {
|
|
230
|
+
constructor(c, o) {
|
|
231
|
+
super(c, o, "end");
|
|
232
|
+
}
|
|
255
233
|
}
|
|
234
|
+
return R.PinchEndEvent = u, R;
|
|
256
235
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
function
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
add(t) {
|
|
295
|
-
return this._x += t.x, this._y += t.y, this._clientX += t.clientX, this._clientY += t.clientY, this;
|
|
296
|
-
}
|
|
297
|
-
substract(t) {
|
|
298
|
-
return this._x -= t.x, this._y -= t.y, this._clientX -= t.clientX, this._clientY -= t.clientY, this;
|
|
299
|
-
}
|
|
300
|
-
dot(t) {
|
|
301
|
-
return this._x * t.x + this._y * t.y;
|
|
236
|
+
var I = {}, vt;
|
|
237
|
+
function Wt() {
|
|
238
|
+
if (vt) return I;
|
|
239
|
+
vt = 1;
|
|
240
|
+
var s = I && I.__importDefault || function(i) {
|
|
241
|
+
return i && i.__esModule ? i : { default: i };
|
|
242
|
+
};
|
|
243
|
+
Object.defineProperty(I, "__esModule", { value: !0 }), I.RotateEndEvent = I.RotateStartEvent = void 0;
|
|
244
|
+
const t = s(B());
|
|
245
|
+
var e;
|
|
246
|
+
(function(i) {
|
|
247
|
+
i[i.start = 0] = "start", i[i.end = 1] = "end";
|
|
248
|
+
})(e || (e = {}));
|
|
249
|
+
class n extends t.default {
|
|
250
|
+
constructor(c, o, f) {
|
|
251
|
+
let l;
|
|
252
|
+
switch (f) {
|
|
253
|
+
case "start":
|
|
254
|
+
l = "rotatestart";
|
|
255
|
+
break;
|
|
256
|
+
case "end":
|
|
257
|
+
l = "rotateend";
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
l = "rotate";
|
|
261
|
+
}
|
|
262
|
+
super(l, c), this.anchor = {
|
|
263
|
+
x: o.anchor.x,
|
|
264
|
+
y: o.anchor.y,
|
|
265
|
+
clientX: o.anchor.clientX,
|
|
266
|
+
clientY: o.anchor.clientY
|
|
267
|
+
}, Object.defineProperty(this, "rotation", {
|
|
268
|
+
value: o.rotation,
|
|
269
|
+
writable: !1
|
|
270
|
+
}), this.rotationDeg = o.rotationDeg;
|
|
271
|
+
}
|
|
302
272
|
}
|
|
303
|
-
|
|
304
|
-
|
|
273
|
+
let r = class extends n {
|
|
274
|
+
constructor(c, o) {
|
|
275
|
+
super(c, o);
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
I.default = r;
|
|
279
|
+
class a extends n {
|
|
280
|
+
constructor(c, o) {
|
|
281
|
+
super(c, o, "start");
|
|
282
|
+
}
|
|
305
283
|
}
|
|
306
|
-
|
|
307
|
-
|
|
284
|
+
I.RotateStartEvent = a;
|
|
285
|
+
class u extends n {
|
|
286
|
+
constructor(c, o) {
|
|
287
|
+
super(c, o, "end");
|
|
288
|
+
}
|
|
308
289
|
}
|
|
290
|
+
return I.RotateEndEvent = u, I;
|
|
309
291
|
}
|
|
310
|
-
k
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
} });
|
|
323
|
-
} : function(h, o, f, P) {
|
|
324
|
-
P === void 0 && (P = f), h[P] = o[f];
|
|
325
|
-
}), e = y && y.__setModuleDefault || (Object.create ? function(h, o) {
|
|
326
|
-
Object.defineProperty(h, "default", { enumerable: !0, value: o });
|
|
327
|
-
} : function(h, o) {
|
|
328
|
-
h.default = o;
|
|
329
|
-
}), r = y && y.__importStar || function(h) {
|
|
330
|
-
if (h && h.__esModule)
|
|
331
|
-
return h;
|
|
332
|
-
var o = {};
|
|
333
|
-
if (h != null)
|
|
334
|
-
for (var f in h)
|
|
335
|
-
f !== "default" && Object.prototype.hasOwnProperty.call(h, f) && t(o, h, f);
|
|
336
|
-
return e(o, h), o;
|
|
337
|
-
}, s = y && y.__importDefault || function(h) {
|
|
338
|
-
return h && h.__esModule ? h : { default: h };
|
|
339
|
-
};
|
|
340
|
-
Object.defineProperty(n, "__esModule", { value: !0 }), n.RotateEndEvent = n.RotateEvent = n.RotateStartEvent = n.PinchEndEvent = n.PinchEvent = n.PinchStartEvent = n.PanEndEvent = n.PanEvent = n.PanStartEvent = n.SwipeEndEvent = n.SwipeEvent = n.SwipeStartEvent = n.DoubleTapEvent = n.LongPressEvent = n.GestureEvent = n.TapEvent = void 0;
|
|
341
|
-
const i = s(_);
|
|
342
|
-
n.GestureEvent = i.default;
|
|
343
|
-
const a = s(z);
|
|
344
|
-
n.LongPressEvent = a.default;
|
|
345
|
-
const c = s(Z);
|
|
346
|
-
n.TapEvent = c.default;
|
|
347
|
-
const u = s(J);
|
|
348
|
-
n.DoubleTapEvent = u.default;
|
|
349
|
-
const l = r(x);
|
|
350
|
-
n.SwipeEvent = l.default, Object.defineProperty(n, "SwipeEndEvent", { enumerable: !0, get: function() {
|
|
351
|
-
return l.SwipeEndEvent;
|
|
352
|
-
} }), Object.defineProperty(n, "SwipeStartEvent", { enumerable: !0, get: function() {
|
|
353
|
-
return l.SwipeStartEvent;
|
|
354
|
-
} });
|
|
355
|
-
const v = r(D);
|
|
356
|
-
n.PanEvent = v.default, Object.defineProperty(n, "PanEndEvent", { enumerable: !0, get: function() {
|
|
357
|
-
return v.PanEndEvent;
|
|
358
|
-
} }), Object.defineProperty(n, "PanStartEvent", { enumerable: !0, get: function() {
|
|
359
|
-
return v.PanStartEvent;
|
|
360
|
-
} });
|
|
361
|
-
const d = r(O);
|
|
362
|
-
n.PinchEvent = d.default, Object.defineProperty(n, "PinchEndEvent", { enumerable: !0, get: function() {
|
|
363
|
-
return d.PinchEndEvent;
|
|
364
|
-
} }), Object.defineProperty(n, "PinchStartEvent", { enumerable: !0, get: function() {
|
|
365
|
-
return d.PinchStartEvent;
|
|
366
|
-
} });
|
|
367
|
-
const m = r(M);
|
|
368
|
-
n.RotateEvent = m.default, Object.defineProperty(n, "RotateEndEvent", { enumerable: !0, get: function() {
|
|
369
|
-
return m.RotateEndEvent;
|
|
370
|
-
} }), Object.defineProperty(n, "RotateStartEvent", { enumerable: !0, get: function() {
|
|
371
|
-
return m.RotateStartEvent;
|
|
372
|
-
} });
|
|
373
|
-
const g = k;
|
|
374
|
-
var p;
|
|
375
|
-
(function(h) {
|
|
376
|
-
h[h.right = 0] = "right", h[h.up = 1] = "up", h[h.left = 2] = "left", h[h.down = 3] = "down";
|
|
377
|
-
})(p || (p = {}));
|
|
378
|
-
class w {
|
|
379
|
-
constructor() {
|
|
380
|
-
this.touchStart = new TouchEvent("touchstart") || {}, this.touchMove = new TouchEvent("touchmove") || {}, this.touchEnd = new TouchEvent("touchend") || {}, this.touchCancel = new TouchEvent("touchcancel") || {}, this.velocity = 0, this.dxDy = new g.Vec2(0, 0), this.scale = 1, this.rotation = 0, this.rotationDeg = 0, this.anchor = new g.Vec2(0, 0), this.octant = 0, this.isPanning = !1, this.isPinching = !1, this.isSwiping = !1, this.isRotating = !1, this.touchStartTime = 0, this.touchEndTime = 0, this.lastTouchTime = 0, this.taps = 0, this.scaleBase = 0, this.touchMoved = !1, this.touchDown = !1, this.shouldFire = !1, this.pointers = 0, this.isLongPress = !1, this.longPressTimeout = 0, this.touchStartListener = this.onTouchStart.bind(this), this.touchMoveListener = this.onTouchMove.bind(this), this.touchEndListener = this.onTouchEnd.bind(this), this.touchCancelListener = this.onTouchCancel.bind(this), this.currentTarget = window, this.config = {
|
|
381
|
-
longPressDuration: 500,
|
|
382
|
-
tapDelay: 500,
|
|
383
|
-
minPointers: 1,
|
|
384
|
-
numberOfTaps: 0
|
|
385
|
-
}, w.listening || (TouchEvent && window.addEventListener("touchstart", this.touchStartListener, !0), w.listening = !0);
|
|
292
|
+
var k = {}, pt;
|
|
293
|
+
function zt() {
|
|
294
|
+
if (pt) return k;
|
|
295
|
+
pt = 1, Object.defineProperty(k, "__esModule", { value: !0 }), k.closest = k.Vec2 = k.assert = void 0;
|
|
296
|
+
function s(n, r) {
|
|
297
|
+
if (!n)
|
|
298
|
+
throw new Error(r);
|
|
299
|
+
}
|
|
300
|
+
k.assert = s;
|
|
301
|
+
class t {
|
|
302
|
+
constructor(r, a) {
|
|
303
|
+
this._x = 0, this._y = 0, this._clientX = 0, this._clientY = 0, this._clientX = r, this._clientY = a, this._x = this.translateX(r), this._y = this.translateY(a);
|
|
386
304
|
}
|
|
387
|
-
|
|
388
|
-
|
|
305
|
+
translateY(r) {
|
|
306
|
+
return -(r - window.innerHeight / 2);
|
|
389
307
|
}
|
|
390
|
-
|
|
391
|
-
|
|
308
|
+
translateX(r) {
|
|
309
|
+
return r - window.innerWidth / 2;
|
|
392
310
|
}
|
|
393
|
-
|
|
394
|
-
|
|
311
|
+
get x() {
|
|
312
|
+
return this._x;
|
|
395
313
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
314
|
+
get y() {
|
|
315
|
+
return this._y;
|
|
316
|
+
}
|
|
317
|
+
get clientX() {
|
|
318
|
+
return this._clientX;
|
|
319
|
+
}
|
|
320
|
+
get clientY() {
|
|
321
|
+
return this._clientY;
|
|
322
|
+
}
|
|
323
|
+
set x(r) {
|
|
324
|
+
this._clientX = r, this._x = this.translateX(r);
|
|
325
|
+
}
|
|
326
|
+
set y(r) {
|
|
327
|
+
this._clientY = r, this._y = this.translateY(r);
|
|
328
|
+
}
|
|
329
|
+
add(r) {
|
|
330
|
+
return this._x += r.x, this._y += r.y, this._clientX += r.clientX, this._clientY += r.clientY, this;
|
|
331
|
+
}
|
|
332
|
+
substract(r) {
|
|
333
|
+
return this._x -= r.x, this._y -= r.y, this._clientX -= r.clientX, this._clientY -= r.clientY, this;
|
|
334
|
+
}
|
|
335
|
+
dot(r) {
|
|
336
|
+
return this._x * r.x + this._y * r.y;
|
|
337
|
+
}
|
|
338
|
+
get magnitude() {
|
|
339
|
+
return Math.sqrt(Math.pow(this._x, 2) + Math.pow(this._y, 2));
|
|
340
|
+
}
|
|
341
|
+
get clientMagnitude() {
|
|
342
|
+
return Math.sqrt(Math.pow(this._clientX, 2) + Math.pow(this._clientY, 2));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
k.Vec2 = t;
|
|
346
|
+
function e(n, r) {
|
|
347
|
+
return r.reduce((a, u) => {
|
|
348
|
+
let i = Math.abs(a - n), c = Math.abs(u - n);
|
|
349
|
+
return i === c ? a > u ? a : u : c < i ? u : a;
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
return k.closest = e, k;
|
|
353
|
+
}
|
|
354
|
+
var gt;
|
|
355
|
+
function Zt() {
|
|
356
|
+
return gt || (gt = 1, (function(s) {
|
|
357
|
+
var t = b && b.__createBinding || (Object.create ? (function(v, h, g, E) {
|
|
358
|
+
E === void 0 && (E = g);
|
|
359
|
+
var y = Object.getOwnPropertyDescriptor(h, g);
|
|
360
|
+
(!y || ("get" in y ? !h.__esModule : y.writable || y.configurable)) && (y = { enumerable: !0, get: function() {
|
|
361
|
+
return h[g];
|
|
362
|
+
} }), Object.defineProperty(v, E, y);
|
|
363
|
+
}) : (function(v, h, g, E) {
|
|
364
|
+
E === void 0 && (E = g), v[E] = h[g];
|
|
365
|
+
})), e = b && b.__setModuleDefault || (Object.create ? (function(v, h) {
|
|
366
|
+
Object.defineProperty(v, "default", { enumerable: !0, value: h });
|
|
367
|
+
}) : function(v, h) {
|
|
368
|
+
v.default = h;
|
|
369
|
+
}), n = b && b.__importStar || function(v) {
|
|
370
|
+
if (v && v.__esModule) return v;
|
|
371
|
+
var h = {};
|
|
372
|
+
if (v != null) for (var g in v) g !== "default" && Object.prototype.hasOwnProperty.call(v, g) && t(h, v, g);
|
|
373
|
+
return e(h, v), h;
|
|
374
|
+
}, r = b && b.__importDefault || function(v) {
|
|
375
|
+
return v && v.__esModule ? v : { default: v };
|
|
376
|
+
};
|
|
377
|
+
Object.defineProperty(s, "__esModule", { value: !0 }), s.RotateEndEvent = s.RotateEvent = s.RotateStartEvent = s.PinchEndEvent = s.PinchEvent = s.PinchStartEvent = s.PanEndEvent = s.PanEvent = s.PanStartEvent = s.SwipeEndEvent = s.SwipeEvent = s.SwipeStartEvent = s.DoubleTapEvent = s.LongPressEvent = s.GestureEvent = s.TapEvent = void 0;
|
|
378
|
+
const a = r(B());
|
|
379
|
+
s.GestureEvent = a.default;
|
|
380
|
+
const u = r(Ht());
|
|
381
|
+
s.LongPressEvent = u.default;
|
|
382
|
+
const i = r(Nt());
|
|
383
|
+
s.TapEvent = i.default;
|
|
384
|
+
const c = r(jt());
|
|
385
|
+
s.DoubleTapEvent = c.default;
|
|
386
|
+
const o = n(qt());
|
|
387
|
+
s.SwipeEvent = o.default, Object.defineProperty(s, "SwipeEndEvent", { enumerable: !0, get: function() {
|
|
388
|
+
return o.SwipeEndEvent;
|
|
389
|
+
} }), Object.defineProperty(s, "SwipeStartEvent", { enumerable: !0, get: function() {
|
|
390
|
+
return o.SwipeStartEvent;
|
|
391
|
+
} });
|
|
392
|
+
const f = n(Vt());
|
|
393
|
+
s.PanEvent = f.default, Object.defineProperty(s, "PanEndEvent", { enumerable: !0, get: function() {
|
|
394
|
+
return f.PanEndEvent;
|
|
395
|
+
} }), Object.defineProperty(s, "PanStartEvent", { enumerable: !0, get: function() {
|
|
396
|
+
return f.PanStartEvent;
|
|
397
|
+
} });
|
|
398
|
+
const l = n(Gt());
|
|
399
|
+
s.PinchEvent = l.default, Object.defineProperty(s, "PinchEndEvent", { enumerable: !0, get: function() {
|
|
400
|
+
return l.PinchEndEvent;
|
|
401
|
+
} }), Object.defineProperty(s, "PinchStartEvent", { enumerable: !0, get: function() {
|
|
402
|
+
return l.PinchStartEvent;
|
|
403
|
+
} });
|
|
404
|
+
const d = n(Wt());
|
|
405
|
+
s.RotateEvent = d.default, Object.defineProperty(s, "RotateEndEvent", { enumerable: !0, get: function() {
|
|
406
|
+
return d.RotateEndEvent;
|
|
407
|
+
} }), Object.defineProperty(s, "RotateStartEvent", { enumerable: !0, get: function() {
|
|
408
|
+
return d.RotateStartEvent;
|
|
409
|
+
} });
|
|
410
|
+
const p = zt();
|
|
411
|
+
var w;
|
|
412
|
+
(function(v) {
|
|
413
|
+
v[v.right = 0] = "right", v[v.up = 1] = "up", v[v.left = 2] = "left", v[v.down = 3] = "down";
|
|
414
|
+
})(w || (w = {}));
|
|
415
|
+
class S {
|
|
416
|
+
constructor() {
|
|
417
|
+
this.touchStart = new TouchEvent("touchstart") || {}, this.touchMove = new TouchEvent("touchmove") || {}, this.touchEnd = new TouchEvent("touchend") || {}, this.touchCancel = new TouchEvent("touchcancel") || {}, this.velocity = 0, this.dxDy = new p.Vec2(0, 0), this.scale = 1, this.rotation = 0, this.rotationDeg = 0, this.anchor = new p.Vec2(0, 0), this.octant = 0, this.isPanning = !1, this.isPinching = !1, this.isSwiping = !1, this.isRotating = !1, this.touchStartTime = 0, this.touchEndTime = 0, this.lastTouchTime = 0, this.taps = 0, this.scaleBase = 0, this.touchMoved = !1, this.touchDown = !1, this.shouldFire = !1, this.pointers = 0, this.isLongPress = !1, this.longPressTimeout = 0, this.touchStartListener = this.onTouchStart.bind(this), this.touchMoveListener = this.onTouchMove.bind(this), this.touchEndListener = this.onTouchEnd.bind(this), this.touchCancelListener = this.onTouchCancel.bind(this), this.currentTarget = window, this.config = {
|
|
418
|
+
longPressDuration: 500,
|
|
419
|
+
tapDelay: 500,
|
|
420
|
+
minPointers: 1,
|
|
421
|
+
numberOfTaps: 0
|
|
422
|
+
}, S.listening || (TouchEvent && window.addEventListener("touchstart", this.touchStartListener, !0), S.listening = !0);
|
|
412
423
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
424
|
+
bind(h) {
|
|
425
|
+
this.unbind(this.currentTarget), h.addEventListener("touchmove", this.touchMoveListener, !0), h.addEventListener("touchend", this.touchEndListener, !0), h.addEventListener("touchcancel", this.touchCancelListener, !0), this.currentTarget = h;
|
|
426
|
+
}
|
|
427
|
+
unbind(h) {
|
|
428
|
+
h.removeEventListener("touchmove", this.touchMoveListener), h.removeEventListener("touchend", this.touchEndListener), h.removeEventListener("touchcancel", this.touchCancelListener);
|
|
429
|
+
}
|
|
430
|
+
clean() {
|
|
431
|
+
this.touchMoved = !1, this.touchStartTime = 0, this.touchDown = !1, this.scaleBase = 0, this.longPressTimeout && !this.isLongPress && (clearTimeout(this.longPressTimeout), this.longPressTimeout = 0), this.isLongPress = !1;
|
|
432
|
+
}
|
|
433
|
+
onPointerLeave(h) {
|
|
434
|
+
if (!h.touches.length) {
|
|
435
|
+
if (this.isSwiping) {
|
|
436
|
+
const g = new o.SwipeEndEvent(h, {
|
|
437
|
+
velocity: this.velocity,
|
|
438
|
+
direction: w[(0, p.closest)(this.octant, [0, 1, 2, 3])]
|
|
439
|
+
});
|
|
440
|
+
this.dispatchEvent(g), this.isSwiping = !1;
|
|
441
|
+
}
|
|
442
|
+
if (this.isPanning) {
|
|
443
|
+
const g = new f.PanEndEvent(h, {
|
|
444
|
+
translation: this.dxDy,
|
|
445
|
+
velocity: this.velocity
|
|
446
|
+
});
|
|
447
|
+
this.dispatchEvent(g), this.isPanning = !1;
|
|
448
|
+
}
|
|
419
449
|
}
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
450
|
+
if (h.touches.length === 1) {
|
|
451
|
+
if (this.scaleBase = 0, this.isPinching) {
|
|
452
|
+
const g = new l.PinchEndEvent(h, {
|
|
453
|
+
scale: this.scale
|
|
454
|
+
});
|
|
455
|
+
this.dispatchEvent(g), this.isPinching = !1;
|
|
456
|
+
}
|
|
457
|
+
if (this.isRotating) {
|
|
458
|
+
const g = new d.RotateEndEvent(h, {
|
|
459
|
+
rotation: this.rotation,
|
|
460
|
+
rotationDeg: this.rotationDeg,
|
|
461
|
+
anchor: this.anchor
|
|
462
|
+
});
|
|
463
|
+
this.dispatchEvent(g), this.isRotating = !1;
|
|
464
|
+
}
|
|
427
465
|
}
|
|
428
466
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
onTouchStart(o) {
|
|
436
|
-
this.currentTarget !== o.touches[0].target && (this.clean(), this.unbind(this.currentTarget), this.pointers = this.touchEnd.touches.length, this.taps = 0), this.touchStart = o;
|
|
437
|
-
const f = parseInt(o.touches[0].target.dataset.minpointers || "0") || this.config.minPointers;
|
|
438
|
-
if (this.touchStart.touches.length < f) {
|
|
439
|
-
this.shouldFire = !1;
|
|
440
|
-
return;
|
|
467
|
+
dispatchEvent(h) {
|
|
468
|
+
queueMicrotask(() => {
|
|
469
|
+
this.currentTarget.dispatchEvent(h);
|
|
470
|
+
});
|
|
441
471
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
if (
|
|
446
|
-
|
|
447
|
-
|
|
472
|
+
onTouchStart(h) {
|
|
473
|
+
this.currentTarget !== h.touches[0].target && (this.clean(), this.unbind(this.currentTarget), this.pointers = this.touchEnd.touches.length, this.taps = 0), this.touchStart = h;
|
|
474
|
+
const g = parseInt(h.touches[0].target.dataset.minpointers || "0") || this.config.minPointers;
|
|
475
|
+
if (this.touchStart.touches.length < g) {
|
|
476
|
+
this.shouldFire = !1;
|
|
477
|
+
return;
|
|
448
478
|
}
|
|
449
|
-
|
|
450
|
-
const E =
|
|
451
|
-
this.
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
479
|
+
this.shouldFire = !0, this.touchStartTime = h.timeStamp, this.touchDown = !0, this.pointers || this.bind(h.touches[0].target), this.pointers = this.touchStart.touches.length;
|
|
480
|
+
const E = parseFloat(this.currentTarget.dataset.longpressduration || "0") || this.config.longPressDuration;
|
|
481
|
+
if (this.longPressTimeout || (this.longPressTimeout = setTimeout(() => {
|
|
482
|
+
if (!this.touchMoved && this.touchDown) {
|
|
483
|
+
const y = Date.now() - this.touchStartTime, F = new u.default(this.touchStart, y);
|
|
484
|
+
this.dispatchEvent(F), this.isLongPress = !0, this.longPressTimeout = 0;
|
|
485
|
+
}
|
|
486
|
+
}, E)), this.touchStart.touches.length > 1) {
|
|
487
|
+
const y = new p.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), F = new p.Vec2(this.touchStart.touches[1].clientX, this.touchStart.touches[1].clientY);
|
|
488
|
+
this.scaleBase = y.substract(F).magnitude;
|
|
489
|
+
} else
|
|
490
|
+
this.scaleBase = 0;
|
|
491
|
+
}
|
|
492
|
+
onTouchMove(h) {
|
|
493
|
+
if (!this.shouldFire)
|
|
494
|
+
return;
|
|
495
|
+
if (this.touchMoved = !0, this.touchMove = h, h.touches.length > 1 && this.touchStart.touches.length > 1 && (h.touches[1].clientX !== this.touchStart.touches[1].clientX || h.touches[1].clientY !== this.touchStart.touches[1].clientY)) {
|
|
496
|
+
const _ = new p.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY), z = new p.Vec2(this.touchMove.touches[1].clientX, this.touchMove.touches[1].clientY), it = new p.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), at = _.substract(z);
|
|
497
|
+
if (this.scaleBase && Math.abs(this.scaleBase - at.magnitude) > 10) {
|
|
498
|
+
const K = at.magnitude / this.scaleBase;
|
|
499
|
+
if (this.scale = K, this.isPinching) {
|
|
500
|
+
const Z = new l.default(h, {
|
|
501
|
+
scale: K
|
|
502
|
+
});
|
|
503
|
+
this.dispatchEvent(Z);
|
|
504
|
+
} else {
|
|
505
|
+
const Z = new l.PinchStartEvent(h, {
|
|
506
|
+
scale: K
|
|
507
|
+
});
|
|
508
|
+
this.dispatchEvent(Z), this.isPinching = !0;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
this.anchor = _;
|
|
512
|
+
let N = Math.atan2(it.clientY - z.clientY, it.clientX - z.clientX);
|
|
513
|
+
if (N < 0 ? N += 1.5708 : N -= 1.5708, this.rotation = N, this.rotationDeg = N * 180 / Math.PI, this.anchor = this.anchor, this.isRotating) {
|
|
514
|
+
const K = new d.default(h, {
|
|
515
|
+
anchor: this.anchor,
|
|
516
|
+
rotation: this.rotation,
|
|
517
|
+
rotationDeg: this.rotationDeg
|
|
465
518
|
});
|
|
466
|
-
this.dispatchEvent(
|
|
519
|
+
this.dispatchEvent(K);
|
|
467
520
|
} else {
|
|
468
|
-
const
|
|
469
|
-
|
|
521
|
+
const K = new d.RotateStartEvent(h, {
|
|
522
|
+
anchor: this.anchor,
|
|
523
|
+
rotation: this.rotation,
|
|
524
|
+
rotationDeg: this.rotationDeg
|
|
470
525
|
});
|
|
471
|
-
this.dispatchEvent(
|
|
526
|
+
this.dispatchEvent(K), this.isRotating = !0;
|
|
472
527
|
}
|
|
473
528
|
}
|
|
474
|
-
this.
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
529
|
+
const g = new p.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), y = new p.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY).substract(g), F = y.magnitude, st = {
|
|
530
|
+
x: y.x / F,
|
|
531
|
+
y: y.y / F
|
|
532
|
+
}, St = Math.atan2(st.y, st.x);
|
|
533
|
+
this.octant = Math.round(4 * St / (2 * Math.PI) + 4) % 4;
|
|
534
|
+
const Pt = (h.timeStamp - this.touchStart.timeStamp) / 1e3, H = y.magnitude / Pt;
|
|
535
|
+
if (this.isSwiping) {
|
|
536
|
+
const _ = new o.default(h, {
|
|
537
|
+
direction: w[(0, p.closest)(this.octant, [0, 1, 2, 3])],
|
|
538
|
+
velocity: H
|
|
481
539
|
});
|
|
482
|
-
this.dispatchEvent(
|
|
540
|
+
this.dispatchEvent(_);
|
|
483
541
|
} else {
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
rotationDeg: this.rotationDeg
|
|
542
|
+
const _ = new o.SwipeStartEvent(h, {
|
|
543
|
+
direction: w[(0, p.closest)(this.octant, [0, 1, 2, 3])],
|
|
544
|
+
velocity: H
|
|
488
545
|
});
|
|
489
|
-
this.dispatchEvent(
|
|
546
|
+
this.dispatchEvent(_), this.isSwiping = !0;
|
|
547
|
+
}
|
|
548
|
+
if (this.dxDy = y, this.velocity = H, this.isPanning) {
|
|
549
|
+
const _ = new f.default(h, {
|
|
550
|
+
translation: y,
|
|
551
|
+
velocity: H
|
|
552
|
+
});
|
|
553
|
+
this.dispatchEvent(_);
|
|
554
|
+
} else {
|
|
555
|
+
const _ = new f.PanStartEvent(h, {
|
|
556
|
+
translation: y,
|
|
557
|
+
velocity: H
|
|
558
|
+
});
|
|
559
|
+
this.dispatchEvent(_), this.isPanning = !0;
|
|
490
560
|
}
|
|
491
561
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
this.dispatchEvent(b), this.isSwiping = !0;
|
|
510
|
-
}
|
|
511
|
-
if (this.dxDy = E, this.velocity = K, this.isPanning) {
|
|
512
|
-
const b = new v.default(o, {
|
|
513
|
-
translation: E,
|
|
514
|
-
velocity: K
|
|
515
|
-
});
|
|
516
|
-
this.dispatchEvent(b);
|
|
517
|
-
} else {
|
|
518
|
-
const b = new v.PanStartEvent(o, {
|
|
519
|
-
translation: E,
|
|
520
|
-
velocity: K
|
|
521
|
-
});
|
|
522
|
-
this.dispatchEvent(b), this.isPanning = !0;
|
|
562
|
+
onTouchEnd(h) {
|
|
563
|
+
const g = parseInt(this.currentTarget.dataset.numberoftaps || "0") || this.config.numberOfTaps;
|
|
564
|
+
if (this.taps++, this.shouldFire = this.taps > g, this.shouldFire) {
|
|
565
|
+
this.touchEnd = h, this.touchEndTime = h.timeStamp;
|
|
566
|
+
const E = parseFloat(this.currentTarget.dataset.tapdelay || "0") || this.config.tapDelay;
|
|
567
|
+
if (!this.touchMoved && !this.isLongPress)
|
|
568
|
+
if (this.taps === 1 || this.touchEndTime - this.lastTouchTime < E) {
|
|
569
|
+
if (this.taps % 2 === g) {
|
|
570
|
+
const F = new c.default(h);
|
|
571
|
+
this.dispatchEvent(F), this.taps = 0;
|
|
572
|
+
}
|
|
573
|
+
const y = new i.default(h);
|
|
574
|
+
this.dispatchEvent(y);
|
|
575
|
+
} else
|
|
576
|
+
this.taps = 0;
|
|
577
|
+
}
|
|
578
|
+
this.pointers = this.touchEnd.touches.length, this.lastTouchTime = this.touchEndTime, this.onPointerLeave(h), this.unbind(this.currentTarget), this.clean();
|
|
523
579
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
const f = parseInt(this.currentTarget.dataset.numberoftaps || "0") || this.config.numberOfTaps;
|
|
527
|
-
if (this.taps++, this.shouldFire = this.taps > f, this.shouldFire) {
|
|
528
|
-
this.touchEnd = o, this.touchEndTime = o.timeStamp;
|
|
529
|
-
const P = parseFloat(this.currentTarget.dataset.tapdelay || "0") || this.config.tapDelay;
|
|
530
|
-
if (!this.touchMoved && !this.isLongPress)
|
|
531
|
-
if (this.taps === 1 || this.touchEndTime - this.lastTouchTime < P) {
|
|
532
|
-
if (this.taps % 2 === f) {
|
|
533
|
-
const R = new u.default(o);
|
|
534
|
-
this.dispatchEvent(R), this.taps = 0;
|
|
535
|
-
}
|
|
536
|
-
const E = new c.default(o);
|
|
537
|
-
this.dispatchEvent(E);
|
|
538
|
-
} else
|
|
539
|
-
this.taps = 0;
|
|
580
|
+
onTouchCancel(h) {
|
|
581
|
+
this.shouldFire && (this.touchCancel = h, this.unbind(this.currentTarget), this.clean());
|
|
540
582
|
}
|
|
541
|
-
this.pointers = this.touchEnd.touches.length, this.lastTouchTime = this.touchEndTime, this.onPointerLeave(o), this.unbind(this.currentTarget), this.clean();
|
|
542
583
|
}
|
|
543
|
-
|
|
544
|
-
|
|
584
|
+
S.listening = !1, s.default = S;
|
|
585
|
+
function m(v) {
|
|
586
|
+
const h = v.type;
|
|
587
|
+
v.composedPath().forEach((E) => {
|
|
588
|
+
if (E instanceof HTMLElement) {
|
|
589
|
+
const y = E[wt[h]];
|
|
590
|
+
if (typeof y != "function")
|
|
591
|
+
return;
|
|
592
|
+
y.apply(E, [v]);
|
|
593
|
+
}
|
|
594
|
+
});
|
|
545
595
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
596
|
+
window.GLOBAL_EVENT_DISPATCHER || (window.addEventListener("tap", m, { passive: !0 }), window.addEventListener("longpress", m, { passive: !0 }), window.addEventListener("doubletap", m, { passive: !0 }), window.addEventListener("swipestart", m, { passive: !0 }), window.addEventListener("swipe", m, { passive: !0 }), window.addEventListener("swipeend", m, { passive: !0 }), window.addEventListener("panstart", m, { passive: !0 }), window.addEventListener("pan", m, { passive: !0 }), window.addEventListener("panend", m, { passive: !0 }), window.addEventListener("pinchstart", m, { passive: !0 }), window.addEventListener("pinch", m, { passive: !0 }), window.addEventListener("pinchend", m, { passive: !0 }), window.addEventListener("rotatestart", m, { passive: !0 }), window.addEventListener("rotate", m, { passive: !0 }), window.addEventListener("rotateend", m, { passive: !0 }));
|
|
597
|
+
const wt = {
|
|
598
|
+
tap: "ontap",
|
|
599
|
+
doubletap: "ondoubletap",
|
|
600
|
+
longpress: "onlongpress",
|
|
601
|
+
swipestart: "onswipestart",
|
|
602
|
+
swipe: "onswipe",
|
|
603
|
+
swipeend: "onswipeend",
|
|
604
|
+
panstart: "onpanstart",
|
|
605
|
+
pan: "onpan",
|
|
606
|
+
panend: "onpanend",
|
|
607
|
+
pinchstart: "onpinchstart",
|
|
608
|
+
pinch: "onpinch",
|
|
609
|
+
pinchend: "onpinchend",
|
|
610
|
+
rotatestart: "onrotatestart",
|
|
611
|
+
rotate: "onrotate",
|
|
612
|
+
rotateend: "onrotateend"
|
|
613
|
+
};
|
|
614
|
+
TouchEvent && (window.gestureProvider = new S()), window.GLOBAL_EVENT_DISPATCHER || (window.GLOBAL_EVENT_DISPATCHER = m);
|
|
615
|
+
})(b)), b;
|
|
616
|
+
}
|
|
617
|
+
Zt();
|
|
618
|
+
class Jt extends Event {
|
|
550
619
|
routerId;
|
|
551
620
|
route;
|
|
552
621
|
props;
|
|
553
622
|
navigationType;
|
|
554
623
|
signal;
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
super("navigate"), this.routerId = t, this.route = e, this.props = r, this.navigationType = s ?? "push", this.signal = i, this.committed = a, this.transition = c;
|
|
624
|
+
result;
|
|
625
|
+
constructor(t, e, n, r, a, u) {
|
|
626
|
+
super("navigate"), this.routerId = t, this.route = e, this.props = n, this.navigationType = r ?? "push", this.signal = a, this.result = u;
|
|
559
627
|
}
|
|
560
628
|
}
|
|
561
|
-
class
|
|
629
|
+
class Qt extends Event {
|
|
562
630
|
routerId;
|
|
563
631
|
signal;
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
super("back"), this.routerId = t, this.signal = e, this.committed = r, this.transition = s;
|
|
632
|
+
result;
|
|
633
|
+
constructor(t, e, n) {
|
|
634
|
+
super("back"), this.routerId = t, this.signal = e, this.result = n;
|
|
568
635
|
}
|
|
569
636
|
}
|
|
570
|
-
class
|
|
637
|
+
class $t extends Event {
|
|
571
638
|
routerId;
|
|
572
639
|
signal;
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
super("forward"), this.routerId = t, this.signal = e, this.committed = r, this.transition = s;
|
|
640
|
+
result;
|
|
641
|
+
constructor(t, e, n) {
|
|
642
|
+
super("forward"), this.routerId = t, this.signal = e, this.result = n;
|
|
577
643
|
}
|
|
578
644
|
}
|
|
579
|
-
class
|
|
645
|
+
class te extends Event {
|
|
580
646
|
source;
|
|
581
647
|
constructor(t) {
|
|
582
648
|
super("gesture-start"), this.source = t;
|
|
583
649
|
}
|
|
584
650
|
}
|
|
585
|
-
class
|
|
651
|
+
class ee extends Event {
|
|
586
652
|
source;
|
|
587
653
|
constructor(t) {
|
|
588
654
|
super("gesture-end"), this.source = t;
|
|
589
655
|
}
|
|
590
656
|
}
|
|
591
|
-
class
|
|
657
|
+
class ne extends Event {
|
|
592
658
|
constructor() {
|
|
593
659
|
super("gesture-cancel");
|
|
594
660
|
}
|
|
595
661
|
}
|
|
596
|
-
class
|
|
662
|
+
class M {
|
|
597
663
|
routerId;
|
|
598
664
|
#t;
|
|
599
665
|
index;
|
|
600
|
-
constructor(t, e,
|
|
601
|
-
this.#t = t, this.routerId = e, this.index =
|
|
666
|
+
constructor(t, e, n) {
|
|
667
|
+
this.#t = t, this.routerId = e, this.index = n;
|
|
602
668
|
}
|
|
603
669
|
set ondispose(t) {
|
|
604
670
|
this.#t.ondispose = t;
|
|
@@ -606,6 +672,9 @@ class vt {
|
|
|
606
672
|
get ondispose() {
|
|
607
673
|
return this.#t.ondispose;
|
|
608
674
|
}
|
|
675
|
+
get nativeEntry() {
|
|
676
|
+
return this.#t;
|
|
677
|
+
}
|
|
609
678
|
get id() {
|
|
610
679
|
return this.#t.id;
|
|
611
680
|
}
|
|
@@ -621,11 +690,11 @@ class vt {
|
|
|
621
690
|
get sameDocument() {
|
|
622
691
|
return this.#t.sameDocument;
|
|
623
692
|
}
|
|
624
|
-
addEventListener(t, e,
|
|
625
|
-
return this.#t.addEventListener(t, e,
|
|
693
|
+
addEventListener(t, e, n) {
|
|
694
|
+
return this.#t.addEventListener(t, e, n), () => this.#t.removeEventListener(t, e, n);
|
|
626
695
|
}
|
|
627
|
-
removeEventListener(t, e,
|
|
628
|
-
this.#t.addEventListener(t, e,
|
|
696
|
+
removeEventListener(t, e, n) {
|
|
697
|
+
this.#t.addEventListener(t, e, n);
|
|
629
698
|
}
|
|
630
699
|
dispatchEvent(t) {
|
|
631
700
|
return this.#t.dispatchEvent(t);
|
|
@@ -634,7 +703,7 @@ class vt {
|
|
|
634
703
|
return this.#t.getState();
|
|
635
704
|
}
|
|
636
705
|
}
|
|
637
|
-
class
|
|
706
|
+
class re extends bt {
|
|
638
707
|
config;
|
|
639
708
|
constructor(t) {
|
|
640
709
|
super(t), this.config = t;
|
|
@@ -642,93 +711,90 @@ class Se extends yt {
|
|
|
642
711
|
preload(t, e = {}) {
|
|
643
712
|
return super.preload(t, e);
|
|
644
713
|
}
|
|
645
|
-
replace(t, e = {},
|
|
646
|
-
return this.navigate(t, e, { ...
|
|
714
|
+
replace(t, e = {}, n = {}) {
|
|
715
|
+
return this.navigate(t, e, { ...n, type: "replace" });
|
|
647
716
|
}
|
|
648
|
-
push(t, e = {},
|
|
649
|
-
return this.navigate(t, e, { ...
|
|
717
|
+
push(t, e = {}, n = {}) {
|
|
718
|
+
return this.navigate(t, e, { ...n, type: "push" });
|
|
650
719
|
}
|
|
651
720
|
reload(t = {}) {
|
|
652
721
|
return window.navigation.reload({ state: t });
|
|
653
722
|
}
|
|
654
723
|
traverseTo(t, e = {}) {
|
|
655
|
-
const
|
|
656
|
-
|
|
724
|
+
const n = window.navigation.traverseTo(t), a = window.navigation.transition.from.index, u = window.navigation.entries().findIndex((c) => c.key === t);
|
|
725
|
+
e.signal?.addEventListener(
|
|
726
|
+
"abort",
|
|
727
|
+
() => this.controller?.abort,
|
|
728
|
+
{ once: !0 }
|
|
729
|
+
);
|
|
730
|
+
let i;
|
|
731
|
+
return a > u ? i = this.createBackEvent(n) : i = this.createForwardEvent(n), this.dispatchEvent?.(i), n;
|
|
732
|
+
}
|
|
733
|
+
navigate(t, e = {}, n = {}) {
|
|
734
|
+
const { type: r = "push" } = n, a = new URL(t, this.baseURL), u = window.navigation.navigate(a.href, { history: r, state: e });
|
|
735
|
+
n.signal?.addEventListener(
|
|
657
736
|
"abort",
|
|
658
|
-
() => this.
|
|
737
|
+
() => this.controller?.abort,
|
|
659
738
|
{ once: !0 }
|
|
660
|
-
)
|
|
661
|
-
|
|
662
|
-
return i > a ? u = this.createBackEvent(
|
|
663
|
-
c.signal,
|
|
664
|
-
r.committed,
|
|
665
|
-
s
|
|
666
|
-
) : u = this.createForwardEvent(
|
|
667
|
-
c.signal,
|
|
668
|
-
r.committed,
|
|
669
|
-
s
|
|
670
|
-
), this.dispatchEvent?.(u), r;
|
|
671
|
-
}
|
|
672
|
-
navigate(t, e = {}, r = {}) {
|
|
673
|
-
const { type: s = "push" } = r, i = new URL(t, this.baseURL), a = window.navigation.navigate(i.href, { history: s, state: e }), c = window.navigation.transition, u = new AbortController();
|
|
674
|
-
u.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), r.signal?.addEventListener("abort", u.abort, { once: !0 });
|
|
675
|
-
const l = this.createNavigateEvent(
|
|
739
|
+
);
|
|
740
|
+
const i = this.createNavigateEvent(
|
|
676
741
|
t,
|
|
677
742
|
e,
|
|
678
|
-
|
|
679
|
-
u
|
|
680
|
-
a.committed,
|
|
681
|
-
c
|
|
743
|
+
r,
|
|
744
|
+
u
|
|
682
745
|
);
|
|
683
|
-
return this.dispatchEvent?.(
|
|
746
|
+
return this.dispatchEvent?.(i), u;
|
|
684
747
|
}
|
|
685
748
|
goBack(t = {}) {
|
|
686
|
-
if (!this.canGoBack())
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
e.committed,
|
|
693
|
-
r
|
|
749
|
+
if (!this.canGoBack()) return;
|
|
750
|
+
const e = window.navigation.traverseTo(this.previous.key);
|
|
751
|
+
t.signal?.addEventListener(
|
|
752
|
+
"abort",
|
|
753
|
+
() => this.controller?.abort,
|
|
754
|
+
{ once: !0 }
|
|
694
755
|
);
|
|
695
|
-
|
|
756
|
+
const n = this.createBackEvent(e);
|
|
757
|
+
return this.dispatchEvent?.(n), e;
|
|
696
758
|
}
|
|
697
759
|
goForward(t = {}) {
|
|
698
|
-
if (!this.canGoForward())
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
e.committed,
|
|
705
|
-
r
|
|
760
|
+
if (!this.canGoForward()) return;
|
|
761
|
+
const e = window.navigation.traverseTo(this.next.key);
|
|
762
|
+
t.signal?.addEventListener(
|
|
763
|
+
"abort",
|
|
764
|
+
() => this.controller?.abort,
|
|
765
|
+
{ once: !0 }
|
|
706
766
|
);
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
767
|
+
const n = this.createForwardEvent(e);
|
|
768
|
+
return this.dispatchEvent?.(n), e;
|
|
769
|
+
}
|
|
770
|
+
createBackEvent(t) {
|
|
771
|
+
const e = new AbortController();
|
|
772
|
+
t.finished.catch(() => e.abort());
|
|
773
|
+
const n = e.signal;
|
|
774
|
+
return new Qt(this.routerId, n, t);
|
|
775
|
+
}
|
|
776
|
+
createForwardEvent(t) {
|
|
777
|
+
const e = new AbortController();
|
|
778
|
+
t.finished.catch(() => e.abort());
|
|
779
|
+
const n = e.signal;
|
|
780
|
+
return new $t(this.routerId, n, t);
|
|
781
|
+
}
|
|
782
|
+
createNavigateEvent(t, e, n, r) {
|
|
783
|
+
const a = new AbortController();
|
|
784
|
+
r.finished.catch(() => a.abort());
|
|
785
|
+
const u = a.signal;
|
|
786
|
+
return new Jt(
|
|
723
787
|
this.routerId,
|
|
724
788
|
t,
|
|
725
789
|
e,
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
a
|
|
790
|
+
n,
|
|
791
|
+
u,
|
|
792
|
+
r
|
|
730
793
|
);
|
|
731
794
|
}
|
|
795
|
+
get controller() {
|
|
796
|
+
return this.config.getController();
|
|
797
|
+
}
|
|
732
798
|
get committed() {
|
|
733
799
|
return this.config.getCommitted();
|
|
734
800
|
}
|
|
@@ -818,38 +884,75 @@ class Se extends yt {
|
|
|
818
884
|
*/
|
|
819
885
|
get entries() {
|
|
820
886
|
const t = this.config.getPathPatterns().filter(({ pattern: i }) => i.endsWith("**"));
|
|
821
|
-
let e = null,
|
|
822
|
-
|
|
823
|
-
if (!i.url ||
|
|
824
|
-
|
|
825
|
-
const c = new URL(i.url), u = wt(
|
|
887
|
+
let e = null, n = D, r = !1;
|
|
888
|
+
const a = this.globalEntries.filter((i, c) => {
|
|
889
|
+
if (!i.url || r) return !1;
|
|
890
|
+
const o = new URL(i.url), f = _t(
|
|
826
891
|
this.baseURLPattern.pathname,
|
|
827
|
-
|
|
892
|
+
o.pathname
|
|
828
893
|
);
|
|
829
|
-
if (!
|
|
830
|
-
return
|
|
894
|
+
if (!f)
|
|
895
|
+
return n !== D && (r = !0), !1;
|
|
831
896
|
if (e) {
|
|
832
897
|
const l = new URLPattern(
|
|
833
898
|
e.pattern,
|
|
834
|
-
|
|
899
|
+
f.href
|
|
835
900
|
);
|
|
836
|
-
if (
|
|
837
|
-
|
|
838
|
-
|
|
901
|
+
if (V(
|
|
902
|
+
o.pathname,
|
|
903
|
+
o.pathname,
|
|
839
904
|
l.pathname,
|
|
840
905
|
e.caseSensitive
|
|
841
906
|
))
|
|
842
907
|
return !1;
|
|
843
908
|
}
|
|
844
909
|
return e = t.find(
|
|
845
|
-
({ pattern: l, caseSensitive:
|
|
910
|
+
({ pattern: l, caseSensitive: d }) => V(
|
|
846
911
|
l,
|
|
847
|
-
|
|
912
|
+
o.pathname,
|
|
848
913
|
this.baseURLPattern.pathname,
|
|
849
|
-
|
|
914
|
+
d
|
|
850
915
|
)
|
|
851
|
-
) ?? null,
|
|
852
|
-
}).map((i,
|
|
916
|
+
) ?? null, n = c, !0;
|
|
917
|
+
}).map((i, c) => new M(i, this.routerId, c)), u = this.config.getDestination();
|
|
918
|
+
if (u) {
|
|
919
|
+
const { transition: i } = this;
|
|
920
|
+
switch (i?.navigationType) {
|
|
921
|
+
case "replace":
|
|
922
|
+
a.splice(
|
|
923
|
+
u.index,
|
|
924
|
+
P,
|
|
925
|
+
new M(
|
|
926
|
+
U(
|
|
927
|
+
u
|
|
928
|
+
),
|
|
929
|
+
this.routerId,
|
|
930
|
+
u.index
|
|
931
|
+
)
|
|
932
|
+
);
|
|
933
|
+
break;
|
|
934
|
+
case "push": {
|
|
935
|
+
const c = i.from.index + P, o = a.findIndex((f) => f.key === i.from.key);
|
|
936
|
+
a.splice(
|
|
937
|
+
c,
|
|
938
|
+
1 / 0,
|
|
939
|
+
new M(
|
|
940
|
+
U({
|
|
941
|
+
...u,
|
|
942
|
+
getState() {
|
|
943
|
+
return u.getState();
|
|
944
|
+
},
|
|
945
|
+
index: c
|
|
946
|
+
}),
|
|
947
|
+
this.routerId,
|
|
948
|
+
o + P
|
|
949
|
+
)
|
|
950
|
+
);
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
return a;
|
|
853
956
|
}
|
|
854
957
|
/**
|
|
855
958
|
* Returns the **local history index** for this router, derived from the
|
|
@@ -949,26 +1052,26 @@ class Se extends yt {
|
|
|
949
1052
|
* ```
|
|
950
1053
|
*/
|
|
951
1054
|
get index() {
|
|
952
|
-
const t = window.navigation.currentEntry?.index ??
|
|
953
|
-
if (
|
|
954
|
-
return
|
|
955
|
-
if (
|
|
956
|
-
return this.entries.length -
|
|
1055
|
+
const { transition: t } = this, n = (t?.navigationType === "push" ? t.from.index + P : this.config.getDestination()?.index) ?? window.navigation.currentEntry?.index ?? D, r = this.entries.at(Y)?.globalIndex ?? D, a = this.entries.at(D)?.globalIndex ?? D;
|
|
1056
|
+
if (n <= r)
|
|
1057
|
+
return Y;
|
|
1058
|
+
if (n >= a)
|
|
1059
|
+
return this.entries.length - P;
|
|
957
1060
|
{
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
|
|
1061
|
+
const u = this.globalEntries.slice(
|
|
1062
|
+
r,
|
|
1063
|
+
n + P
|
|
961
1064
|
);
|
|
962
|
-
return this.entries.findLastIndex((i) =>
|
|
963
|
-
(
|
|
964
|
-
) >
|
|
1065
|
+
return this.entries.findLastIndex((i) => u.findLastIndex(
|
|
1066
|
+
(c) => i.key === c.key
|
|
1067
|
+
) > D);
|
|
965
1068
|
}
|
|
966
1069
|
}
|
|
967
1070
|
get previous() {
|
|
968
|
-
return this.entries[this.index -
|
|
1071
|
+
return this.entries[this.index - P] ?? null;
|
|
969
1072
|
}
|
|
970
1073
|
get next() {
|
|
971
|
-
return this.entries[this.index +
|
|
1074
|
+
return this.entries[this.index + P] ?? null;
|
|
972
1075
|
}
|
|
973
1076
|
get current() {
|
|
974
1077
|
return this.entries[this.index];
|
|
@@ -980,63 +1083,38 @@ class Se extends yt {
|
|
|
980
1083
|
return this.next?.url?.origin === globalThis.location.origin;
|
|
981
1084
|
}
|
|
982
1085
|
}
|
|
983
|
-
function
|
|
984
|
-
return Object.fromEntries(
|
|
985
|
-
}
|
|
986
|
-
function Le(n) {
|
|
987
|
-
return new URLSearchParams(n).toString();
|
|
1086
|
+
function se(s) {
|
|
1087
|
+
return Object.fromEntries(s.entries());
|
|
988
1088
|
}
|
|
989
|
-
function
|
|
990
|
-
return
|
|
1089
|
+
function ie(s) {
|
|
1090
|
+
return new URLSearchParams(s).toString();
|
|
991
1091
|
}
|
|
992
|
-
function
|
|
993
|
-
|
|
994
|
-
}
|
|
995
|
-
function W(n, t) {
|
|
996
|
-
if (n === t)
|
|
997
|
-
return !0;
|
|
998
|
-
if (n === null || t === null || typeof n != "object" || typeof t != "object")
|
|
999
|
-
return !1;
|
|
1000
|
-
const e = Object.keys(n), r = Object.keys(t);
|
|
1001
|
-
if (e.length !== r.length)
|
|
1002
|
-
return !1;
|
|
1003
|
-
for (const s of e)
|
|
1004
|
-
if (!r.includes(s) || !W(n[s], t[s]))
|
|
1005
|
-
return !1;
|
|
1006
|
-
return !0;
|
|
1007
|
-
}
|
|
1008
|
-
function Y(n, { x: t, y: e }, r, s) {
|
|
1009
|
-
switch (n) {
|
|
1092
|
+
function j(s, { x: t, y: e }, n, r) {
|
|
1093
|
+
switch (s) {
|
|
1010
1094
|
case "right":
|
|
1011
|
-
return Math.abs(t -
|
|
1095
|
+
return Math.abs(t - n.left) < r;
|
|
1012
1096
|
case "left":
|
|
1013
|
-
return Math.abs(t -
|
|
1097
|
+
return Math.abs(t - n.right) < r;
|
|
1014
1098
|
case "down":
|
|
1015
|
-
return Math.abs(e -
|
|
1099
|
+
return Math.abs(e - n.top) < r;
|
|
1016
1100
|
case "up":
|
|
1017
|
-
return Math.abs(e -
|
|
1101
|
+
return Math.abs(e - n.bottom) < r;
|
|
1018
1102
|
}
|
|
1019
1103
|
}
|
|
1020
|
-
class
|
|
1104
|
+
class nt extends Lt {
|
|
1021
1105
|
#t;
|
|
1106
|
+
ref = $();
|
|
1022
1107
|
constructor(t, e) {
|
|
1023
|
-
super(t, e);
|
|
1024
|
-
const r = this.internalProps.id, s = e.navigation.entries.find((i) => i.key === r);
|
|
1025
|
-
if (!s)
|
|
1026
|
-
throw new Error(`No history entry found for: ${r}`);
|
|
1027
|
-
this.#t = s;
|
|
1028
|
-
}
|
|
1029
|
-
static getDerivedStateFromProps(t) {
|
|
1030
|
-
return t.config?.presentation === "dialog" || t.config?.presentation === "modal" ? { elementType: "dialog" } : { elementType: "div" };
|
|
1108
|
+
super(t, e), this.#t = this.internalProps.entry;
|
|
1031
1109
|
}
|
|
1032
1110
|
static historyEntryStateFromEntry(t, e) {
|
|
1033
1111
|
if (t?.url) {
|
|
1034
|
-
const
|
|
1035
|
-
return
|
|
1036
|
-
...
|
|
1037
|
-
...
|
|
1038
|
-
...
|
|
1039
|
-
},
|
|
1112
|
+
const n = t.getState() ?? {}, r = se(t.url.searchParams), { params: a = {} } = e ?? {};
|
|
1113
|
+
return n.params = {
|
|
1114
|
+
...n.params,
|
|
1115
|
+
...r,
|
|
1116
|
+
...a
|
|
1117
|
+
}, n;
|
|
1040
1118
|
}
|
|
1041
1119
|
return {};
|
|
1042
1120
|
}
|
|
@@ -1047,7 +1125,7 @@ class rt extends Et {
|
|
|
1047
1125
|
}
|
|
1048
1126
|
setConfig(t) {
|
|
1049
1127
|
super.setConfig(t), this.setHistoryState(({ config: e }) => {
|
|
1050
|
-
const
|
|
1128
|
+
const n = /* @__PURE__ */ new Set([
|
|
1051
1129
|
"footer",
|
|
1052
1130
|
"header",
|
|
1053
1131
|
"onEnter",
|
|
@@ -1061,7 +1139,7 @@ class rt extends Et {
|
|
|
1061
1139
|
config: {
|
|
1062
1140
|
...e,
|
|
1063
1141
|
...Object.fromEntries(
|
|
1064
|
-
Object.entries(t).filter(([
|
|
1142
|
+
Object.entries(t).filter(([r]) => !n.has(r))
|
|
1065
1143
|
)
|
|
1066
1144
|
}
|
|
1067
1145
|
};
|
|
@@ -1078,19 +1156,29 @@ class rt extends Et {
|
|
|
1078
1156
|
}
|
|
1079
1157
|
get historyEntryState() {
|
|
1080
1158
|
const t = this.#t;
|
|
1081
|
-
if (!t.url)
|
|
1082
|
-
|
|
1083
|
-
const e = X(
|
|
1159
|
+
if (!t.url) return {};
|
|
1160
|
+
const e = V(
|
|
1084
1161
|
this.props.path,
|
|
1085
1162
|
t.url.pathname,
|
|
1086
|
-
this.
|
|
1163
|
+
this.router.baseURLPattern.pathname,
|
|
1087
1164
|
this.props.caseSensitive
|
|
1088
1165
|
);
|
|
1089
|
-
return
|
|
1166
|
+
return nt.historyEntryStateFromEntry(t, e);
|
|
1167
|
+
}
|
|
1168
|
+
get inert() {
|
|
1169
|
+
if (!this.state.focused)
|
|
1170
|
+
return !0;
|
|
1171
|
+
}
|
|
1172
|
+
get elementType() {
|
|
1173
|
+
const t = this.props.config?.presentation;
|
|
1174
|
+
return t === "dialog" || t === "modal" ? "dialog" : "div";
|
|
1090
1175
|
}
|
|
1091
1176
|
get id() {
|
|
1092
1177
|
return this.internalProps.id.toString();
|
|
1093
1178
|
}
|
|
1179
|
+
get viewTransitionName() {
|
|
1180
|
+
return `${this.router.id}-${this.name}`;
|
|
1181
|
+
}
|
|
1094
1182
|
get params() {
|
|
1095
1183
|
return {
|
|
1096
1184
|
...this.props.defaultParams,
|
|
@@ -1106,55 +1194,67 @@ class rt extends Et {
|
|
|
1106
1194
|
};
|
|
1107
1195
|
}
|
|
1108
1196
|
get routeProp() {
|
|
1109
|
-
const t = this.setParams.bind(this), e = this.setConfig.bind(this), { path:
|
|
1197
|
+
const t = this.setParams.bind(this), e = this.setConfig.bind(this), { path: n } = this.props, { focused: r } = this.state, { params: a, config: u, resolvedPathname: i } = this;
|
|
1110
1198
|
return {
|
|
1111
1199
|
setParams: t,
|
|
1112
1200
|
setConfig: e,
|
|
1113
|
-
path:
|
|
1114
|
-
resolvedPathname:
|
|
1115
|
-
focused:
|
|
1116
|
-
params:
|
|
1117
|
-
config:
|
|
1201
|
+
path: n,
|
|
1202
|
+
resolvedPathname: i,
|
|
1203
|
+
focused: r,
|
|
1204
|
+
params: a,
|
|
1205
|
+
config: u
|
|
1118
1206
|
};
|
|
1119
1207
|
}
|
|
1120
1208
|
setHistoryState(t) {
|
|
1121
|
-
if (!this.state.focused)
|
|
1122
|
-
return;
|
|
1209
|
+
if (!this.state.focused) return;
|
|
1123
1210
|
const e = this.#t.getState() ?? {};
|
|
1124
1211
|
t instanceof Function && (t = t(e));
|
|
1125
|
-
const
|
|
1212
|
+
const n = {
|
|
1126
1213
|
...e ?? {},
|
|
1127
1214
|
...t
|
|
1128
1215
|
};
|
|
1129
|
-
window.navigation.updateCurrentEntry({ state:
|
|
1216
|
+
window.navigation.updateCurrentEntry({ state: n });
|
|
1130
1217
|
}
|
|
1131
|
-
|
|
1132
|
-
if (!this.
|
|
1133
|
-
return;
|
|
1218
|
+
onclick(t) {
|
|
1219
|
+
if (!this.ref.current) return;
|
|
1134
1220
|
const e = this.context?.navigation;
|
|
1135
|
-
t.composedPath().includes(this.
|
|
1221
|
+
t.composedPath().includes(this.ref.current) || e?.goBack();
|
|
1222
|
+
}
|
|
1223
|
+
onclose() {
|
|
1224
|
+
this.router.navigation.goBack();
|
|
1136
1225
|
}
|
|
1137
1226
|
onEnter(t) {
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
this.props.config?.presentation === "modal" ? e.current.showModal() : e.current.show(), e.current.style.maxHeight = "unset", e.current.style.maxWidth = "unset", e.current.style.width = "max-content", e.current.style.height = "max-content";
|
|
1142
|
-
const s = this.onClickOutside.bind(this);
|
|
1143
|
-
e.current.addEventListener("close", function() {
|
|
1144
|
-
this.returnValue !== "screen-exit" && (this.style.display = "block", r?.goBack()), r?.removeEventListener("click", s);
|
|
1145
|
-
}, { once: !0 }), r?.addEventListener("click", s);
|
|
1227
|
+
if (this.ref?.current instanceof HTMLDialogElement && this.ref.current.open === !1) {
|
|
1228
|
+
const e = this.router.navigation;
|
|
1229
|
+
this.props.config?.presentation === "modal" ? this.ref.current.showModal() : this.ref.current.show(), this.ref.current.style.maxHeight = "unset", this.ref.current.style.maxWidth = "unset", this.ref.current.style.width = "max-content", this.ref.current.style.height = "max-content", this.ref.current.addEventListener("close", this, { once: !0 }), e.addEventListener("click", this, { once: !0 });
|
|
1146
1230
|
}
|
|
1147
1231
|
return super.onEnter(t);
|
|
1148
1232
|
}
|
|
1149
1233
|
onExited(t) {
|
|
1150
|
-
|
|
1151
|
-
|
|
1234
|
+
return this.ref.current instanceof HTMLDialogElement && (this.ref.current.removeEventListener("close", this), this.router.navigation.removeEventListener("click", this), this.ref.current.close()), super.onExited(t);
|
|
1235
|
+
}
|
|
1236
|
+
render() {
|
|
1237
|
+
const t = this.elementType;
|
|
1238
|
+
return /* @__PURE__ */ G(
|
|
1239
|
+
t,
|
|
1240
|
+
{
|
|
1241
|
+
id: this.viewTransitionName,
|
|
1242
|
+
ref: this.ref,
|
|
1243
|
+
className: "screen",
|
|
1244
|
+
inert: this.inert,
|
|
1245
|
+
style: {
|
|
1246
|
+
gridArea: "1 / 1",
|
|
1247
|
+
viewTransitionName: this.viewTransitionName
|
|
1248
|
+
},
|
|
1249
|
+
children: super.render()
|
|
1250
|
+
}
|
|
1251
|
+
);
|
|
1152
1252
|
}
|
|
1153
1253
|
}
|
|
1154
|
-
function
|
|
1155
|
-
return !!(
|
|
1254
|
+
function O(s) {
|
|
1255
|
+
return !!(s !== null && typeof s == "object" && Object.hasOwn(s, "current"));
|
|
1156
1256
|
}
|
|
1157
|
-
const
|
|
1257
|
+
const ae = {
|
|
1158
1258
|
horizontal: ["left", "right"],
|
|
1159
1259
|
vertical: ["up", "down"],
|
|
1160
1260
|
up: ["up"],
|
|
@@ -1162,63 +1262,62 @@ const ke = {
|
|
|
1162
1262
|
left: ["left"],
|
|
1163
1263
|
right: ["right"]
|
|
1164
1264
|
};
|
|
1165
|
-
function
|
|
1166
|
-
return
|
|
1265
|
+
function oe(s, t) {
|
|
1266
|
+
return ae[t].includes(s);
|
|
1167
1267
|
}
|
|
1168
|
-
function
|
|
1169
|
-
return
|
|
1268
|
+
function ce(s) {
|
|
1269
|
+
return s === "left" || s === "right" || s === "horizontal";
|
|
1170
1270
|
}
|
|
1171
|
-
const
|
|
1271
|
+
const x = {
|
|
1172
1272
|
gestureHysteresis: 0.5,
|
|
1173
1273
|
gestureMinFlingVelocity: 400,
|
|
1174
1274
|
gestureAreaWidth: 100,
|
|
1175
1275
|
gestureDirection: "right",
|
|
1176
1276
|
gestureDisabled: !1
|
|
1177
|
-
},
|
|
1178
|
-
function
|
|
1179
|
-
return
|
|
1277
|
+
}, ue = 0, he = 1, le = 24;
|
|
1278
|
+
function mt({ clientX: s, clientY: t }, e, n) {
|
|
1279
|
+
return j("left", { x: s, y: t }, e, n) && j("right", { x: s, y: t }, e, n) && j("down", { x: s, y: t }, e, n) && j("up", { x: s, y: t }, e, n);
|
|
1180
1280
|
}
|
|
1181
|
-
const
|
|
1281
|
+
const de = ((s) => function({
|
|
1182
1282
|
ref: e,
|
|
1183
|
-
gestureBehaviour:
|
|
1184
|
-
uaGestureAreaWidth:
|
|
1185
|
-
...
|
|
1283
|
+
gestureBehaviour: n = "contain",
|
|
1284
|
+
uaGestureAreaWidth: r = le,
|
|
1285
|
+
...a
|
|
1186
1286
|
}) {
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1189
|
-
) ?? null, { gestureAreaWidth:
|
|
1190
|
-
return
|
|
1287
|
+
const u = J.useRef(null), i = Yt(
|
|
1288
|
+
Tt
|
|
1289
|
+
) ?? null, { gestureAreaWidth: c = 0 } = i?.config ?? {};
|
|
1290
|
+
return J.useImperativeHandle(
|
|
1191
1291
|
e,
|
|
1192
|
-
() =>
|
|
1193
|
-
),
|
|
1194
|
-
if (!
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
const g = v.getBoundingClientRect();
|
|
1200
|
-
Array.from(m.touches).map((h) => ft(h, g, u)).some(Boolean) && m.stopPropagation(), Array.from(m.touches).map((h) => ft(h, g, s)).some(Boolean) && m.preventDefault();
|
|
1292
|
+
() => u.current
|
|
1293
|
+
), J.useEffect(() => {
|
|
1294
|
+
if (!u.current) return;
|
|
1295
|
+
const f = u.current, l = (d) => {
|
|
1296
|
+
if (!(d instanceof TouchEvent) || n === "none") return;
|
|
1297
|
+
const p = f.getBoundingClientRect();
|
|
1298
|
+
Array.from(d.touches).map((m) => mt(m, p, c)).some(Boolean) && d.stopPropagation(), Array.from(d.touches).map((m) => mt(m, p, r)).some(Boolean) && d.preventDefault();
|
|
1201
1299
|
};
|
|
1202
|
-
return
|
|
1203
|
-
|
|
1300
|
+
return f.addEventListener("touchstart", l), () => {
|
|
1301
|
+
f.removeEventListener(
|
|
1204
1302
|
"touchstart",
|
|
1205
|
-
|
|
1303
|
+
l
|
|
1206
1304
|
);
|
|
1207
1305
|
};
|
|
1208
|
-
}, [
|
|
1209
|
-
},
|
|
1306
|
+
}, [r, c, n]), /* @__PURE__ */ G(s, { ref: u, ...a });
|
|
1307
|
+
}), fe = new Proxy(
|
|
1210
1308
|
{},
|
|
1211
1309
|
{
|
|
1212
|
-
get(
|
|
1213
|
-
return
|
|
1310
|
+
get(s, t) {
|
|
1311
|
+
return s[t] ??= de(t), s[t];
|
|
1214
1312
|
}
|
|
1215
1313
|
}
|
|
1216
1314
|
);
|
|
1217
|
-
class
|
|
1315
|
+
class ze extends Rt {
|
|
1316
|
+
ref = $();
|
|
1218
1317
|
navigation;
|
|
1219
1318
|
#t = null;
|
|
1220
1319
|
constructor(t, e) {
|
|
1221
|
-
super(t, e), this.navigation = new
|
|
1320
|
+
super(t, e), this.navigation = new re({
|
|
1222
1321
|
addEventListener: this.addEventListener.bind(this),
|
|
1223
1322
|
removeEventListener: this.removeEventListener.bind(this),
|
|
1224
1323
|
dispatchEvent: this.dispatchEvent.bind(this),
|
|
@@ -1228,24 +1327,27 @@ class hn extends bt {
|
|
|
1228
1327
|
baseURLPattern: this.baseURLPattern,
|
|
1229
1328
|
getCommitted: () => this.committed,
|
|
1230
1329
|
getTransition: () => this.state.transition,
|
|
1330
|
+
getDestination: () => this.state.destination,
|
|
1331
|
+
getController: () => this.state.controller,
|
|
1231
1332
|
getPathPatterns: () => this.pathPatterns,
|
|
1232
|
-
getNavigatorById: (
|
|
1333
|
+
getNavigatorById: (c) => this.getRouterById(c)?.navigation ?? null
|
|
1233
1334
|
});
|
|
1234
1335
|
const {
|
|
1235
|
-
gestureAreaWidth:
|
|
1236
|
-
gestureDirection:
|
|
1237
|
-
gestureDisabled:
|
|
1238
|
-
gestureHysteresis:
|
|
1239
|
-
gestureMinFlingVelocity:
|
|
1336
|
+
gestureAreaWidth: n = x.gestureAreaWidth,
|
|
1337
|
+
gestureDirection: r = x.gestureDirection,
|
|
1338
|
+
gestureDisabled: a = x.gestureDisabled,
|
|
1339
|
+
gestureHysteresis: u = x.gestureHysteresis,
|
|
1340
|
+
gestureMinFlingVelocity: i = x.gestureMinFlingVelocity
|
|
1240
1341
|
} = t.config?.screenConfig ?? {};
|
|
1241
1342
|
this.state = {
|
|
1242
1343
|
screenStack: [],
|
|
1243
|
-
gestureDirection:
|
|
1244
|
-
gestureAreaWidth:
|
|
1245
|
-
gestureHysteresis:
|
|
1246
|
-
gestureDisabled:
|
|
1247
|
-
gestureMinFlingVelocity:
|
|
1344
|
+
gestureDirection: r,
|
|
1345
|
+
gestureAreaWidth: n,
|
|
1346
|
+
gestureHysteresis: u,
|
|
1347
|
+
gestureDisabled: a,
|
|
1348
|
+
gestureMinFlingVelocity: i,
|
|
1248
1349
|
transition: null,
|
|
1350
|
+
destination: null,
|
|
1249
1351
|
documentTitle: document.title,
|
|
1250
1352
|
fromKey: null,
|
|
1251
1353
|
destinationKey: null,
|
|
@@ -1253,102 +1355,91 @@ class hn extends bt {
|
|
|
1253
1355
|
};
|
|
1254
1356
|
}
|
|
1255
1357
|
static getDerivedStateFromProps(t, e) {
|
|
1256
|
-
const
|
|
1257
|
-
(
|
|
1358
|
+
const n = e.screenStack.find(
|
|
1359
|
+
(r) => O(r.props.ref) && r.props.ref.current?.focused
|
|
1258
1360
|
)?.props.config;
|
|
1259
|
-
return document.title =
|
|
1260
|
-
gestureDirection:
|
|
1261
|
-
gestureAreaWidth:
|
|
1262
|
-
gestureMinFlingVelocity:
|
|
1263
|
-
gestureHysteresis:
|
|
1264
|
-
gestureDisabled:
|
|
1265
|
-
documentTitle:
|
|
1361
|
+
return document.title = n?.title ?? document.title, {
|
|
1362
|
+
gestureDirection: n?.gestureDirection ?? x.gestureDirection,
|
|
1363
|
+
gestureAreaWidth: n?.gestureAreaWidth ?? x.gestureAreaWidth,
|
|
1364
|
+
gestureMinFlingVelocity: n?.gestureMinFlingVelocity ?? x.gestureMinFlingVelocity,
|
|
1365
|
+
gestureHysteresis: n?.gestureHysteresis ?? x.gestureHysteresis,
|
|
1366
|
+
gestureDisabled: n?.gestureDisabled ?? x.gestureDisabled,
|
|
1367
|
+
documentTitle: n?.title
|
|
1266
1368
|
};
|
|
1267
1369
|
}
|
|
1268
1370
|
componentDidMount() {
|
|
1269
1371
|
super.componentDidMount(), window.navigation.addEventListener("currententrychange", this), window.navigation.addEventListener("navigate", this), window.navigation.addEventListener("navigatesuccess", this), window.navigation.addEventListener("navigateerror", this);
|
|
1270
1372
|
}
|
|
1271
|
-
// TODO: figure out how to remove this
|
|
1272
|
-
shouldComponentUpdate(t, e) {
|
|
1273
|
-
return !W(this.props.config, t.config) || !W(this.state, e) || this.props.id !== t.id;
|
|
1274
|
-
}
|
|
1275
1373
|
componentWillUnmount() {
|
|
1276
1374
|
window.navigation.removeEventListener("currententrychange", this), window.navigation.removeEventListener("navigate", this), window.navigation.removeEventListener("navigatesuccess", this), window.navigation.removeEventListener("navigateerror", this);
|
|
1277
1375
|
}
|
|
1278
1376
|
onnavigate(t) {
|
|
1279
|
-
super.onnavigate(t), this.#t = new
|
|
1280
|
-
}
|
|
1281
|
-
oncurrententrychange() {
|
|
1282
|
-
this.#t?.resolve?.(window.navigation.currentEntry);
|
|
1377
|
+
super.onnavigate(t), this.#t = new It();
|
|
1283
1378
|
}
|
|
1284
1379
|
onnavigatesuccess() {
|
|
1285
|
-
this.#t = null;
|
|
1380
|
+
this.#t?.resolve?.(window.navigation.currentEntry), this.#t = null;
|
|
1286
1381
|
}
|
|
1287
1382
|
onnavigateerror({ error: t }) {
|
|
1288
|
-
this.#t?.state === "pending" && this.#t.reject?.(t), this.#t = null;
|
|
1383
|
+
this.#t?.state === "pending" && this.#t.reject?.(t), this.#t = null, this.screenTransitionLayer.current?.animation.playState === "running" && this.screenTransitionLayer.current.animation.cancel();
|
|
1289
1384
|
}
|
|
1290
1385
|
// TODO: change to use handleEvent paradigm
|
|
1386
|
+
// TODO: refactor this to just cancel the current navigation.
|
|
1291
1387
|
onGestureCancel = () => {
|
|
1292
1388
|
if (!this.state.transition)
|
|
1293
1389
|
throw new Error("Rollback failed, transition is null");
|
|
1294
|
-
|
|
1295
|
-
info: { rollback: !0 }
|
|
1296
|
-
});
|
|
1390
|
+
this.state.controller?.abort();
|
|
1297
1391
|
};
|
|
1298
1392
|
canGestureNavigate(t) {
|
|
1299
|
-
if (!this.ref.current || this.state.gestureDisabled)
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
r,
|
|
1393
|
+
if (!this.ref.current || this.state.gestureDisabled) return !1;
|
|
1394
|
+
const e = this.ref.current.getBoundingClientRect(), { direction: n } = t;
|
|
1395
|
+
return (n === "down" || n === "right") && !this.navigation.canGoBack() || (n === "up" || n === "left") && !this.navigation.canGoForward() || j(
|
|
1396
|
+
n,
|
|
1304
1397
|
t,
|
|
1305
1398
|
e,
|
|
1306
1399
|
this.state.gestureAreaWidth
|
|
1307
|
-
) ? !1 :
|
|
1400
|
+
) ? !1 : oe(n, this.state.gestureDirection);
|
|
1308
1401
|
}
|
|
1309
1402
|
onswipestart(t) {
|
|
1310
|
-
if (!this.canGestureNavigate(t) || !this.ref.current || !this.screenTransitionLayer.current)
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
let s, i;
|
|
1403
|
+
if (!this.canGestureNavigate(t) || !this.ref.current || !this.screenTransitionLayer.current) return;
|
|
1404
|
+
const { direction: e } = t, n = ce(e) ? "x" : "y";
|
|
1405
|
+
let r, a;
|
|
1314
1406
|
switch (e) {
|
|
1315
1407
|
case "right":
|
|
1316
|
-
|
|
1408
|
+
r = 0, a = this.ref.current.clientWidth;
|
|
1317
1409
|
break;
|
|
1318
1410
|
case "left":
|
|
1319
|
-
|
|
1411
|
+
r = this.ref.current.clientWidth, a = 0;
|
|
1320
1412
|
break;
|
|
1321
1413
|
case "down":
|
|
1322
|
-
|
|
1414
|
+
r = 0, a = this.ref.current.clientHeight;
|
|
1323
1415
|
break;
|
|
1324
1416
|
case "up":
|
|
1325
|
-
|
|
1417
|
+
r = this.ref.current.clientHeight, a = 0;
|
|
1326
1418
|
break;
|
|
1327
1419
|
}
|
|
1328
|
-
this.screenTransitionLayer.current.animation.timeline = new
|
|
1420
|
+
this.screenTransitionLayer.current.animation.timeline = new At(
|
|
1329
1421
|
{
|
|
1330
1422
|
source: this.ref.current,
|
|
1331
1423
|
type: "swipe",
|
|
1332
|
-
axis:
|
|
1333
|
-
rangeStart:
|
|
1334
|
-
rangeEnd:
|
|
1424
|
+
axis: n,
|
|
1425
|
+
rangeStart: r,
|
|
1426
|
+
rangeEnd: a
|
|
1335
1427
|
}
|
|
1336
1428
|
);
|
|
1337
|
-
const
|
|
1429
|
+
const u = !0;
|
|
1338
1430
|
e === "down" || e === "right" ? window.navigation.traverseTo(this.navigation.previous.key, {
|
|
1339
|
-
info: { gesture:
|
|
1431
|
+
info: { gesture: u }
|
|
1340
1432
|
}) : window.navigation.traverseTo(this.navigation.next.key, {
|
|
1341
|
-
info: { gesture:
|
|
1342
|
-
}), this.dispatchEvent(new
|
|
1433
|
+
info: { gesture: u }
|
|
1434
|
+
}), this.dispatchEvent(new te(t));
|
|
1343
1435
|
}
|
|
1344
1436
|
onswipeend(t) {
|
|
1345
|
-
if (!this.screenTransitionLayer.current)
|
|
1346
|
-
|
|
1347
|
-
const e = this.screenTransitionLayer.current.animation.effect?.getComputedTiming().progress ?? 0, r = this.screenTransitionLayer.current.animation.playbackRate;
|
|
1437
|
+
if (!this.screenTransitionLayer.current) return;
|
|
1438
|
+
const e = this.screenTransitionLayer.current.animation.effect?.getComputedTiming().progress ?? 0, n = this.screenTransitionLayer.current.animation.playbackRate;
|
|
1348
1439
|
this.screenTransitionLayer.current.animation.timeline = document.timeline;
|
|
1349
|
-
const
|
|
1350
|
-
let
|
|
1351
|
-
t.velocity < this.state.gestureMinFlingVelocity && !
|
|
1440
|
+
const r = n > 0 ? e > this.state.gestureHysteresis : e < this.state.gestureHysteresis;
|
|
1441
|
+
let a = !1;
|
|
1442
|
+
t.velocity < this.state.gestureMinFlingVelocity && !r ? (a = !0, this.screenTransitionLayer.current.animation.reverse(), this.onGestureCancel(), this.dispatchEvent(new ne())) : this.dispatchEvent(new ee(t)), a && this.screenTransitionLayer.current.animation.finished.then(() => {
|
|
1352
1443
|
this.state.controller?.abort("gesture-cancel");
|
|
1353
1444
|
});
|
|
1354
1445
|
}
|
|
@@ -1357,22 +1448,24 @@ class hn extends bt {
|
|
|
1357
1448
|
}
|
|
1358
1449
|
get backNavigating() {
|
|
1359
1450
|
const t = this.state.screenStack.findIndex(
|
|
1360
|
-
(
|
|
1451
|
+
(n) => n.key === this.state.fromKey
|
|
1361
1452
|
), e = this.state.screenStack.findIndex(
|
|
1362
|
-
(
|
|
1453
|
+
(n) => n.key === this.state.destinationKey
|
|
1363
1454
|
);
|
|
1364
|
-
return e >=
|
|
1455
|
+
return e >= Y && e < t;
|
|
1365
1456
|
}
|
|
1366
1457
|
get screens() {
|
|
1367
1458
|
const t = this.state.screenStack;
|
|
1368
|
-
return t.filter((e,
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1459
|
+
return t.filter((e, n) => {
|
|
1460
|
+
const r = e.props.ref ?? null, a = t.at(
|
|
1461
|
+
n + P
|
|
1462
|
+
)?.props.ref;
|
|
1463
|
+
return O(r) && r.current?.focused || O(r) && r.current?.config.keepAlive || O(a) && a.current?.config.presentation === "modal" || O(a) && a.current?.config.presentation === "dialog" || e.key === this.navigation.current?.key || e.key === this.state.fromKey || e.key === this.state.destinationKey;
|
|
1371
1464
|
});
|
|
1372
1465
|
}
|
|
1373
|
-
cloneScreenChildFromPathname(t, e) {
|
|
1466
|
+
cloneScreenChildFromPathname(t, e, n) {
|
|
1374
1467
|
const { child: r } = this.screenChildFromPathname(t) ?? {};
|
|
1375
|
-
return r ? (e ??= crypto.randomUUID(),
|
|
1468
|
+
return r ? (e ??= crypto.randomUUID(), xt(r, {
|
|
1376
1469
|
config: {
|
|
1377
1470
|
title: document.title,
|
|
1378
1471
|
...this.props.config?.screenConfig,
|
|
@@ -1380,25 +1473,26 @@ class hn extends bt {
|
|
|
1380
1473
|
},
|
|
1381
1474
|
id: e,
|
|
1382
1475
|
resolvedPathname: t,
|
|
1476
|
+
entry: n,
|
|
1383
1477
|
key: e,
|
|
1384
|
-
ref:
|
|
1478
|
+
ref: $()
|
|
1385
1479
|
})) : null;
|
|
1386
1480
|
}
|
|
1387
1481
|
getScreenRefByKey(t) {
|
|
1388
1482
|
const e = this.state.screenStack.find(
|
|
1389
|
-
(
|
|
1390
|
-
)?.ref;
|
|
1391
|
-
return
|
|
1483
|
+
(n) => n.key === t
|
|
1484
|
+
)?.props.ref;
|
|
1485
|
+
return O(e) ? e : null;
|
|
1392
1486
|
}
|
|
1393
1487
|
canIntercept(t) {
|
|
1394
|
-
const e = new URL(t.destination.url).pathname,
|
|
1395
|
-
return this.mounted && this.shouldIntercept(t) && this.includesRoute(e,
|
|
1488
|
+
const e = new URL(t.destination.url).pathname, n = this.baseURLPattern.pathname;
|
|
1489
|
+
return this.mounted && this.shouldIntercept(t) && this.includesRoute(e, n);
|
|
1396
1490
|
}
|
|
1397
1491
|
shouldIntercept(t) {
|
|
1398
1492
|
return t.canIntercept && !t.formData && !t.hashChange && !t.downloadRequest || !!this.props.config?.shouldIntercept?.(t);
|
|
1399
1493
|
}
|
|
1400
1494
|
intercept(t) {
|
|
1401
|
-
if (t instanceof
|
|
1495
|
+
if (t instanceof kt || this.props.config?.onIntercept?.(t), !t.defaultPrevented)
|
|
1402
1496
|
switch (t.navigationType) {
|
|
1403
1497
|
case "preload":
|
|
1404
1498
|
this.handlePreload(t);
|
|
@@ -1416,47 +1510,47 @@ class hn extends bt {
|
|
|
1416
1510
|
}
|
|
1417
1511
|
}
|
|
1418
1512
|
handlePreload(t) {
|
|
1419
|
-
const e = () => {
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
const { navigation:
|
|
1427
|
-
return new Promise((
|
|
1428
|
-
this.setState({ transition:
|
|
1429
|
-
const
|
|
1430
|
-
new
|
|
1431
|
-
|
|
1513
|
+
const e = async () => {
|
|
1514
|
+
await this.state.transition?.finished;
|
|
1515
|
+
const { pathname: n } = new URL(t.destination.url), {
|
|
1516
|
+
child: r,
|
|
1517
|
+
matchInfo: a = null
|
|
1518
|
+
} = this.screenChildFromPathname(n) ?? {};
|
|
1519
|
+
if (!r) return;
|
|
1520
|
+
const { navigation: u } = this, { signal: i } = t, { path: c } = r.props, o = t.transition;
|
|
1521
|
+
return new Promise((f) => {
|
|
1522
|
+
this.setState({ transition: o }, async () => {
|
|
1523
|
+
const l = nt.historyEntryStateFromEntry(
|
|
1524
|
+
new M(
|
|
1525
|
+
U(t.destination),
|
|
1432
1526
|
this.id,
|
|
1433
|
-
|
|
1527
|
+
D
|
|
1434
1528
|
),
|
|
1435
|
-
|
|
1529
|
+
a
|
|
1436
1530
|
);
|
|
1437
1531
|
await Promise.all([
|
|
1438
|
-
this.preloadScreen(
|
|
1439
|
-
|
|
1440
|
-
navigation:
|
|
1441
|
-
signal:
|
|
1532
|
+
this.preloadScreen(r),
|
|
1533
|
+
r.props.config?.onLoad?.({
|
|
1534
|
+
navigation: u,
|
|
1535
|
+
signal: i,
|
|
1442
1536
|
preloading: !0,
|
|
1443
1537
|
route: {
|
|
1444
1538
|
focused: !1,
|
|
1445
|
-
path:
|
|
1446
|
-
resolvedPathname:
|
|
1539
|
+
path: c,
|
|
1540
|
+
resolvedPathname: n,
|
|
1447
1541
|
config: {
|
|
1448
1542
|
...this.props.config?.screenConfig,
|
|
1449
|
-
...
|
|
1450
|
-
...
|
|
1543
|
+
...r.props.config,
|
|
1544
|
+
...l.config
|
|
1451
1545
|
},
|
|
1452
1546
|
params: {
|
|
1453
|
-
...
|
|
1454
|
-
...
|
|
1455
|
-
...
|
|
1547
|
+
...r.props.defaultParams,
|
|
1548
|
+
...a?.params,
|
|
1549
|
+
...l.params
|
|
1456
1550
|
}
|
|
1457
1551
|
}
|
|
1458
1552
|
})
|
|
1459
|
-
]), this.setState({ transition: null },
|
|
1553
|
+
]), this.setState({ transition: null }, f);
|
|
1460
1554
|
});
|
|
1461
1555
|
});
|
|
1462
1556
|
};
|
|
@@ -1464,373 +1558,435 @@ class hn extends bt {
|
|
|
1464
1558
|
}
|
|
1465
1559
|
handleLoad(t) {
|
|
1466
1560
|
const e = () => {
|
|
1467
|
-
const
|
|
1468
|
-
return c.
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1561
|
+
const n = t.transition?.from?.key ?? null, r = t.destination.key, { destination: a, transition: u } = t, i = [], c = this.navigation.entries;
|
|
1562
|
+
return c.length || c.push(
|
|
1563
|
+
new M(
|
|
1564
|
+
U(
|
|
1565
|
+
a,
|
|
1566
|
+
Y
|
|
1567
|
+
),
|
|
1568
|
+
this.id,
|
|
1569
|
+
Y
|
|
1570
|
+
)
|
|
1571
|
+
), c.forEach((o) => {
|
|
1572
|
+
if (!o.url) return null;
|
|
1573
|
+
const f = this.cloneScreenChildFromPathname(
|
|
1574
|
+
o.url.pathname,
|
|
1575
|
+
o.key,
|
|
1576
|
+
o
|
|
1474
1577
|
);
|
|
1475
|
-
if (!
|
|
1476
|
-
|
|
1477
|
-
a.push(l);
|
|
1578
|
+
if (!f) return null;
|
|
1579
|
+
i.push(f);
|
|
1478
1580
|
}), new Promise(
|
|
1479
|
-
(
|
|
1581
|
+
(o) => Q(() => {
|
|
1480
1582
|
this.setState(
|
|
1481
|
-
{ screenStack:
|
|
1583
|
+
{ screenStack: i, fromKey: n, transition: u, destination: a, destinationKey: r },
|
|
1482
1584
|
async () => {
|
|
1483
|
-
const { initialPathname:
|
|
1484
|
-
if (
|
|
1485
|
-
|
|
1486
|
-
|
|
1585
|
+
const { initialPathname: f } = this.props.config ?? {}, [l] = c;
|
|
1586
|
+
if (f && c.length === P && l.url && !V(
|
|
1587
|
+
f,
|
|
1588
|
+
l.url.pathname,
|
|
1487
1589
|
this.baseURLPattern.pathname
|
|
1488
1590
|
))
|
|
1489
1591
|
return (window.navigation.transition?.finished ?? Promise.resolve()).then(() => {
|
|
1490
|
-
this.navigation.replace(
|
|
1592
|
+
this.navigation.replace(f).finished.then(() => {
|
|
1491
1593
|
const w = t.destination.getState() ?? {};
|
|
1492
1594
|
this.navigation.push(t.destination.url, w);
|
|
1493
1595
|
});
|
|
1494
|
-
}),
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
const g = this.getScreenRefByKey(
|
|
1498
|
-
this.navigation.current.key
|
|
1499
|
-
);
|
|
1500
|
-
await this.dispatchLifecycleHandlers(
|
|
1501
|
-
g,
|
|
1502
|
-
null,
|
|
1503
|
-
m
|
|
1504
|
-
).catch(l), this.setState(
|
|
1505
|
-
{ destinationKey: null, fromKey: null, transition: null },
|
|
1506
|
-
u
|
|
1596
|
+
}), o();
|
|
1597
|
+
const d = this.getScreenRefByKey(
|
|
1598
|
+
String(r)
|
|
1507
1599
|
);
|
|
1600
|
+
await this.prepareScreens(d, null, t.signal), o();
|
|
1508
1601
|
}
|
|
1509
1602
|
);
|
|
1510
1603
|
})
|
|
1511
|
-
)
|
|
1604
|
+
).then(() => {
|
|
1605
|
+
const o = this.getScreenRefByKey(
|
|
1606
|
+
String(r)
|
|
1607
|
+
);
|
|
1608
|
+
return this.commitScreens(o, null, t.signal);
|
|
1609
|
+
}).finally(() => {
|
|
1610
|
+
this.setState(
|
|
1611
|
+
{
|
|
1612
|
+
destinationKey: null,
|
|
1613
|
+
fromKey: null,
|
|
1614
|
+
transition: null,
|
|
1615
|
+
destination: null
|
|
1616
|
+
}
|
|
1617
|
+
);
|
|
1618
|
+
});
|
|
1512
1619
|
};
|
|
1513
1620
|
t.intercept({ handler: e });
|
|
1514
1621
|
}
|
|
1515
1622
|
handleReplace(t) {
|
|
1516
|
-
const e =
|
|
1517
|
-
|
|
1518
|
-
i
|
|
1519
|
-
);
|
|
1520
|
-
if (!a)
|
|
1521
|
-
return t.preventDefault();
|
|
1522
|
-
const c = () => {
|
|
1523
|
-
const u = this.state.transition ?? window.navigation.transition, l = u?.from?.key ?? null, v = e.findIndex(
|
|
1623
|
+
const e = async () => {
|
|
1624
|
+
const n = this.state.screenStack, r = t.destination, a = window.navigation.transition, u = new URL(r.url).pathname, i = window.navigation.currentEntry?.key ?? null, c = a?.from?.key ?? null, o = n.findIndex(
|
|
1524
1625
|
(d) => d.key === this.navigation.current?.key
|
|
1626
|
+
), f = new M(
|
|
1627
|
+
U(
|
|
1628
|
+
r,
|
|
1629
|
+
o
|
|
1630
|
+
),
|
|
1631
|
+
this.id,
|
|
1632
|
+
r.index
|
|
1633
|
+
), l = this.cloneScreenChildFromPathname(
|
|
1634
|
+
u,
|
|
1635
|
+
i,
|
|
1636
|
+
f
|
|
1525
1637
|
);
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
String(
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1638
|
+
if (l)
|
|
1639
|
+
return await this.preloadScreen(l), n.splice(
|
|
1640
|
+
o,
|
|
1641
|
+
P,
|
|
1642
|
+
l
|
|
1643
|
+
), new Promise(
|
|
1644
|
+
(d, p) => Q(() => {
|
|
1645
|
+
this.setState(
|
|
1646
|
+
{ destinationKey: i, fromKey: c, transition: a, destination: r, screenStack: n },
|
|
1647
|
+
async () => {
|
|
1648
|
+
const w = t.signal, S = this.getScreenRefByKey(String(c)), m = this.getScreenRefByKey(
|
|
1649
|
+
String(i)
|
|
1650
|
+
);
|
|
1651
|
+
await this.prepareScreens(
|
|
1652
|
+
m,
|
|
1653
|
+
S,
|
|
1654
|
+
w
|
|
1655
|
+
).catch(p), d();
|
|
1656
|
+
}
|
|
1657
|
+
);
|
|
1658
|
+
})
|
|
1659
|
+
).then(() => {
|
|
1660
|
+
const d = this.getScreenRefByKey(String(c)), p = this.getScreenRefByKey(
|
|
1661
|
+
String(i)
|
|
1547
1662
|
);
|
|
1548
|
-
|
|
1549
|
-
|
|
1663
|
+
return this.commitScreens(p, d, t.signal);
|
|
1664
|
+
}).finally(() => {
|
|
1665
|
+
this.setState({
|
|
1666
|
+
destinationKey: null,
|
|
1667
|
+
fromKey: null,
|
|
1668
|
+
transition: null,
|
|
1669
|
+
destination: null
|
|
1670
|
+
});
|
|
1671
|
+
});
|
|
1550
1672
|
};
|
|
1551
|
-
t.intercept({
|
|
1673
|
+
t.intercept({ precommitHandler: e });
|
|
1552
1674
|
}
|
|
1553
1675
|
handleDefault(t) {
|
|
1554
|
-
const e =
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
if (Re(t.info))
|
|
1559
|
-
return Promise.resolve();
|
|
1560
|
-
const u = window.navigation.transition;
|
|
1561
|
-
let l = e.findIndex(
|
|
1562
|
-
(p) => p.key === u?.from.key
|
|
1676
|
+
const e = async () => {
|
|
1677
|
+
const n = this.state.screenStack, r = t.destination, a = window.navigation.transition;
|
|
1678
|
+
let u = this.navigation.entries.findIndex(
|
|
1679
|
+
(l) => l.globalIndex === a?.from.index
|
|
1563
1680
|
);
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1681
|
+
if (t.navigationType === "traverse" && u === D && a?.from.url) {
|
|
1682
|
+
const l = Dt.findClosestEntryByHref(
|
|
1683
|
+
a.from.url,
|
|
1684
|
+
void 0,
|
|
1685
|
+
this.navigation.entries.map((d) => d.nativeEntry),
|
|
1686
|
+
this.navigation.current.index
|
|
1687
|
+
);
|
|
1688
|
+
u = this.navigation.entries.findIndex(
|
|
1689
|
+
(d) => d.globalIndex === l?.index
|
|
1690
|
+
);
|
|
1691
|
+
}
|
|
1692
|
+
const i = n[u]?.key ?? null;
|
|
1693
|
+
let c = this.navigation.entries.findIndex(
|
|
1694
|
+
(l) => l.globalIndex === r.index
|
|
1695
|
+
), o = n[c]?.key ?? null;
|
|
1573
1696
|
if (t.navigationType === "push") {
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1697
|
+
c = u + P;
|
|
1698
|
+
const l = new URL(r.url).pathname, d = new M(
|
|
1699
|
+
U(
|
|
1700
|
+
r,
|
|
1701
|
+
c
|
|
1702
|
+
),
|
|
1703
|
+
this.id,
|
|
1704
|
+
r.index
|
|
1705
|
+
), p = this.cloneScreenChildFromPathname(
|
|
1706
|
+
l,
|
|
1707
|
+
o,
|
|
1708
|
+
d
|
|
1577
1709
|
);
|
|
1578
|
-
if (!
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
l + T,
|
|
1710
|
+
if (!p) return;
|
|
1711
|
+
await this.preloadScreen(p), o = p.key, n.splice(
|
|
1712
|
+
c,
|
|
1582
1713
|
1 / 0,
|
|
1583
1714
|
// Remove all screens after current
|
|
1584
|
-
|
|
1715
|
+
p
|
|
1585
1716
|
);
|
|
1717
|
+
} else {
|
|
1718
|
+
const l = this.state.screenStack[c];
|
|
1719
|
+
await this.preloadScreen(l);
|
|
1586
1720
|
}
|
|
1587
|
-
const
|
|
1721
|
+
const f = new AbortController();
|
|
1588
1722
|
return new Promise(
|
|
1589
|
-
(
|
|
1723
|
+
(l, d) => Q(() => {
|
|
1590
1724
|
this.setState(
|
|
1591
|
-
{
|
|
1725
|
+
{
|
|
1726
|
+
controller: f,
|
|
1727
|
+
destinationKey: o,
|
|
1728
|
+
fromKey: i,
|
|
1729
|
+
transition: a,
|
|
1730
|
+
destination: r,
|
|
1731
|
+
screenStack: n
|
|
1732
|
+
},
|
|
1592
1733
|
async () => {
|
|
1593
|
-
|
|
1594
|
-
const
|
|
1595
|
-
String(
|
|
1596
|
-
), P = this.dispatchLifecycleHandlers(
|
|
1597
|
-
f,
|
|
1598
|
-
o,
|
|
1599
|
-
h
|
|
1600
|
-
).catch(w), E = this.screenTransition(
|
|
1601
|
-
f,
|
|
1602
|
-
o
|
|
1734
|
+
f.signal.onabort = d;
|
|
1735
|
+
const p = t.signal, w = this.getScreenRefByKey(String(i)), S = this.getScreenRefByKey(
|
|
1736
|
+
String(o)
|
|
1603
1737
|
);
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
fromKey: null,
|
|
1608
|
-
transition: null,
|
|
1609
|
-
controller: null
|
|
1610
|
-
},
|
|
1738
|
+
await this.prepareScreens(
|
|
1739
|
+
S,
|
|
1740
|
+
w,
|
|
1611
1741
|
p
|
|
1742
|
+
).catch(d);
|
|
1743
|
+
const m = this.screenTransition(
|
|
1744
|
+
S,
|
|
1745
|
+
w
|
|
1612
1746
|
);
|
|
1747
|
+
await m?.finished.catch(d), m?.updatePlaybackRate(he), l();
|
|
1613
1748
|
}
|
|
1614
1749
|
);
|
|
1615
1750
|
})
|
|
1616
|
-
)
|
|
1751
|
+
).then(() => {
|
|
1752
|
+
const l = this.getScreenRefByKey(String(i)), d = this.getScreenRefByKey(
|
|
1753
|
+
String(o)
|
|
1754
|
+
);
|
|
1755
|
+
return this.commitScreens(d, l, t.signal);
|
|
1756
|
+
}).finally(() => {
|
|
1757
|
+
this.setState(
|
|
1758
|
+
{
|
|
1759
|
+
destinationKey: null,
|
|
1760
|
+
fromKey: null,
|
|
1761
|
+
transition: null,
|
|
1762
|
+
destination: null,
|
|
1763
|
+
controller: null
|
|
1764
|
+
}
|
|
1765
|
+
);
|
|
1766
|
+
});
|
|
1617
1767
|
};
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
() =>
|
|
1630
|
-
|
|
1631
|
-
), await Promise.all([
|
|
1632
|
-
e?.current?.onExit(r),
|
|
1633
|
-
t?.current?.onEnter(r),
|
|
1634
|
-
t?.current?.load(r)
|
|
1635
|
-
]), s && await new Promise(
|
|
1636
|
-
(i) => this.addEventListener("routertransitionend", i, { once: !0 })
|
|
1637
|
-
), !this.state.controller?.signal.aborted && await Promise.all([
|
|
1638
|
-
e?.current?.onExited(r).then(() => e.current?.blur()),
|
|
1639
|
-
t?.current?.onEntered(r).then(() => t.current?.focus())
|
|
1768
|
+
t.cancelable ? t.intercept({ precommitHandler: e }) : t.intercept({ handler: e });
|
|
1769
|
+
}
|
|
1770
|
+
async prepareScreens(t, e, n) {
|
|
1771
|
+
await Promise.all([
|
|
1772
|
+
e?.current?.onExit(n),
|
|
1773
|
+
t?.current?.onEnter(n),
|
|
1774
|
+
t?.current?.load(n)
|
|
1775
|
+
]);
|
|
1776
|
+
}
|
|
1777
|
+
async commitScreens(t, e, n) {
|
|
1778
|
+
await Promise.all([
|
|
1779
|
+
e?.current?.onExited(n).then(() => e.current?.blur()),
|
|
1780
|
+
t?.current?.onEntered(n).then(() => t.current?.focus())
|
|
1640
1781
|
]);
|
|
1641
1782
|
}
|
|
1642
1783
|
screenTransition(t, e) {
|
|
1643
|
-
const { backNavigating:
|
|
1644
|
-
if (
|
|
1645
|
-
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
const
|
|
1649
|
-
(
|
|
1784
|
+
const { backNavigating: n } = this, r = this.screenTransitionLayer.current;
|
|
1785
|
+
if (r && t && e) {
|
|
1786
|
+
r.direction = n ? "reverse" : "normal", t.current?.transitionProvider.current && (t.current.transitionProvider.current.exiting = !1), e.current?.transitionProvider.current && (e.current.transitionProvider.current.exiting = !0);
|
|
1787
|
+
const a = r.sharedElementTransitionLayer.current;
|
|
1788
|
+
a && (a.outgoingScreen = e, a.incomingScreen = t);
|
|
1789
|
+
const u = this.screens.findIndex(
|
|
1790
|
+
(i) => i.props.ref === (n ? e : t)
|
|
1650
1791
|
);
|
|
1651
|
-
return
|
|
1792
|
+
return r.screens = this.screens.map((i, c) => (c = c - u + P, O(i.props.ref) && i.props.ref.current?.transitionProvider.current ? (i.props.ref.current.transitionProvider.current.index = c, i.props.ref) : null)).filter(O), r.transition();
|
|
1652
1793
|
}
|
|
1653
1794
|
}
|
|
1654
1795
|
render() {
|
|
1655
|
-
|
|
1796
|
+
const t = this.state.gestureDisabled ? "none" : "contain";
|
|
1797
|
+
return /* @__PURE__ */ G(
|
|
1798
|
+
fe.div,
|
|
1799
|
+
{
|
|
1800
|
+
id: this.id,
|
|
1801
|
+
ref: this.ref,
|
|
1802
|
+
className: "stack",
|
|
1803
|
+
style: {
|
|
1804
|
+
display: "grid",
|
|
1805
|
+
contain: "layout",
|
|
1806
|
+
isolation: "isolate"
|
|
1807
|
+
},
|
|
1808
|
+
gestureBehaviour: t,
|
|
1809
|
+
children: super.render()
|
|
1810
|
+
}
|
|
1811
|
+
);
|
|
1656
1812
|
}
|
|
1657
1813
|
}
|
|
1658
|
-
function
|
|
1659
|
-
return
|
|
1814
|
+
function ve() {
|
|
1815
|
+
return W("Stack.Navigation"), Ft();
|
|
1660
1816
|
}
|
|
1661
|
-
function
|
|
1662
|
-
return
|
|
1817
|
+
function Ze() {
|
|
1818
|
+
return W("Stack.Router"), Kt();
|
|
1663
1819
|
}
|
|
1664
|
-
function
|
|
1665
|
-
return
|
|
1820
|
+
function Je() {
|
|
1821
|
+
return W("Stack.Route"), Bt();
|
|
1666
1822
|
}
|
|
1667
|
-
function
|
|
1668
|
-
return
|
|
1823
|
+
function Qe(s, t) {
|
|
1824
|
+
return W("Stack.Params"), Ot(s, t);
|
|
1669
1825
|
}
|
|
1670
|
-
function
|
|
1671
|
-
const
|
|
1672
|
-
(
|
|
1673
|
-
|
|
1674
|
-
|
|
1826
|
+
function pe(s, t, e = {}) {
|
|
1827
|
+
const n = yt(
|
|
1828
|
+
(r) => {
|
|
1829
|
+
r.forEach((a) => {
|
|
1830
|
+
a.isIntersecting && t(a);
|
|
1675
1831
|
});
|
|
1676
1832
|
},
|
|
1677
1833
|
[t]
|
|
1678
1834
|
);
|
|
1679
|
-
return
|
|
1680
|
-
const
|
|
1681
|
-
return
|
|
1682
|
-
|
|
1835
|
+
return tt(() => {
|
|
1836
|
+
const r = new IntersectionObserver(n, e), a = s.current;
|
|
1837
|
+
return a && r.observe(a), () => {
|
|
1838
|
+
a && r.unobserve(a);
|
|
1683
1839
|
};
|
|
1684
|
-
}, [
|
|
1840
|
+
}, [n, s, e]), s;
|
|
1685
1841
|
}
|
|
1686
|
-
function
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1689
|
-
a && a.force >= e && t();
|
|
1842
|
+
function ge(s, t, { pressureThreshold: e = ue } = {}) {
|
|
1843
|
+
const n = yt((r) => {
|
|
1844
|
+
r.pressure >= e && t();
|
|
1690
1845
|
}, [e, t]);
|
|
1691
|
-
return
|
|
1692
|
-
const
|
|
1693
|
-
return
|
|
1694
|
-
}),
|
|
1695
|
-
const i = n.current;
|
|
1696
|
-
return i?.addEventListener("touchstart", s), () => i?.removeEventListener("touchstart", s);
|
|
1697
|
-
}), n;
|
|
1846
|
+
return tt(() => {
|
|
1847
|
+
const r = s.current;
|
|
1848
|
+
return r?.addEventListener("pointerenter", n), () => r?.removeEventListener("pointerenter", n);
|
|
1849
|
+
}), s;
|
|
1698
1850
|
}
|
|
1699
|
-
function
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1851
|
+
function $e({
|
|
1852
|
+
ref: s,
|
|
1853
|
+
preload: t,
|
|
1854
|
+
params: e,
|
|
1855
|
+
searchParams: n = e,
|
|
1703
1856
|
config: r,
|
|
1704
|
-
preloadBehaviour:
|
|
1857
|
+
preloadBehaviour: a = {
|
|
1705
1858
|
type: "onsight"
|
|
1706
1859
|
},
|
|
1707
|
-
children:
|
|
1708
|
-
...
|
|
1860
|
+
children: u,
|
|
1861
|
+
...i
|
|
1709
1862
|
}) {
|
|
1710
|
-
const c =
|
|
1711
|
-
|
|
1863
|
+
const c = ve(), o = a?.type === "onsight" && t, f = a?.type === "onhover" && t, l = a?.type === "force" && t, d = Xt(null);
|
|
1864
|
+
e ??= void 0, pe(
|
|
1712
1865
|
d,
|
|
1713
|
-
(
|
|
1714
|
-
!
|
|
1866
|
+
(S) => {
|
|
1867
|
+
!o || !(S.target instanceof HTMLAnchorElement) || c.preload(S.target.href, { params: e, config: r });
|
|
1715
1868
|
},
|
|
1716
|
-
|
|
1717
|
-
),
|
|
1869
|
+
o ? a : {}
|
|
1870
|
+
), ge(
|
|
1718
1871
|
d,
|
|
1719
1872
|
() => {
|
|
1720
|
-
!
|
|
1873
|
+
!f || !d.current || c.preload(d.current.href, { params: e, config: r });
|
|
1721
1874
|
},
|
|
1722
|
-
|
|
1723
|
-
),
|
|
1724
|
-
!
|
|
1725
|
-
}, [
|
|
1726
|
-
const
|
|
1727
|
-
return
|
|
1728
|
-
|
|
1875
|
+
f ? a : {}
|
|
1876
|
+
), tt(() => {
|
|
1877
|
+
!l || !d.current || c.preload(d.current.href, { params: e, config: r });
|
|
1878
|
+
}, [t, c, r, l, e]);
|
|
1879
|
+
const p = c?.routerId, w = n ? ie(n) : void 0;
|
|
1880
|
+
return Ct(
|
|
1881
|
+
s,
|
|
1882
|
+
() => d.current
|
|
1883
|
+
), /* @__PURE__ */ G(
|
|
1884
|
+
Mt,
|
|
1729
1885
|
{
|
|
1730
|
-
...
|
|
1731
|
-
"data-router-id":
|
|
1886
|
+
...i,
|
|
1887
|
+
"data-router-id": p,
|
|
1732
1888
|
ref: d,
|
|
1733
|
-
search:
|
|
1889
|
+
search: w,
|
|
1734
1890
|
navigateState: {
|
|
1735
1891
|
config: r,
|
|
1736
|
-
params:
|
|
1892
|
+
params: e
|
|
1737
1893
|
},
|
|
1738
|
-
children:
|
|
1894
|
+
children: u
|
|
1739
1895
|
}
|
|
1740
1896
|
);
|
|
1741
1897
|
}
|
|
1742
|
-
const
|
|
1898
|
+
const tn = [
|
|
1743
1899
|
{
|
|
1744
1900
|
transform: "translateX(100vw)"
|
|
1745
1901
|
},
|
|
1746
1902
|
{
|
|
1747
1903
|
transform: "translateX(0vw)"
|
|
1748
1904
|
}
|
|
1749
|
-
],
|
|
1905
|
+
], me = [
|
|
1750
1906
|
{
|
|
1751
1907
|
transform: "translateX(100vw)"
|
|
1752
1908
|
},
|
|
1753
1909
|
{
|
|
1754
1910
|
transform: "translateX(0vw)"
|
|
1755
1911
|
}
|
|
1756
|
-
],
|
|
1912
|
+
], en = [
|
|
1757
1913
|
{
|
|
1758
1914
|
transform: "translateX(0vw)"
|
|
1759
1915
|
},
|
|
1760
1916
|
{
|
|
1761
1917
|
transform: "translateX(-50vw)"
|
|
1762
1918
|
}
|
|
1763
|
-
],
|
|
1919
|
+
], ye = [
|
|
1764
1920
|
{
|
|
1765
1921
|
transform: "translateX(0vw)"
|
|
1766
1922
|
},
|
|
1767
1923
|
{
|
|
1768
1924
|
transform: "translateX(calc(100vw * -0.3))"
|
|
1769
1925
|
}
|
|
1770
|
-
],
|
|
1926
|
+
], nn = [
|
|
1771
1927
|
{
|
|
1772
1928
|
transform: "translateX(-100vw)"
|
|
1773
1929
|
},
|
|
1774
1930
|
{
|
|
1775
1931
|
transform: "translateX(0vw)"
|
|
1776
1932
|
}
|
|
1777
|
-
],
|
|
1933
|
+
], Ee = [
|
|
1778
1934
|
{
|
|
1779
1935
|
transform: "translateX(-100vw)"
|
|
1780
1936
|
},
|
|
1781
1937
|
{
|
|
1782
1938
|
transform: "translateX(0vw)"
|
|
1783
1939
|
}
|
|
1784
|
-
],
|
|
1940
|
+
], rn = [
|
|
1785
1941
|
{
|
|
1786
1942
|
transform: "translateX(0vw)"
|
|
1787
1943
|
},
|
|
1788
1944
|
{
|
|
1789
1945
|
transform: "translateX(50vw)"
|
|
1790
1946
|
}
|
|
1791
|
-
],
|
|
1947
|
+
], we = [
|
|
1792
1948
|
{
|
|
1793
1949
|
transform: "translateX(0vw)"
|
|
1794
1950
|
},
|
|
1795
1951
|
{
|
|
1796
1952
|
transform: "translateX(calc(100vw * 0.3))"
|
|
1797
1953
|
}
|
|
1798
|
-
],
|
|
1954
|
+
], sn = [
|
|
1799
1955
|
{
|
|
1800
1956
|
transform: "translateY(100vh)"
|
|
1801
1957
|
},
|
|
1802
1958
|
{
|
|
1803
1959
|
transform: "translateY(0vh)"
|
|
1804
1960
|
}
|
|
1805
|
-
],
|
|
1961
|
+
], Se = [
|
|
1806
1962
|
{
|
|
1807
1963
|
transform: "translateY(100vh)"
|
|
1808
1964
|
},
|
|
1809
1965
|
{
|
|
1810
1966
|
transform: "translateY(0vh)"
|
|
1811
1967
|
}
|
|
1812
|
-
],
|
|
1968
|
+
], an = [
|
|
1813
1969
|
{
|
|
1814
1970
|
transform: "translateY(0vh)"
|
|
1815
1971
|
},
|
|
1816
1972
|
{
|
|
1817
1973
|
transform: "translateY(-50vh)"
|
|
1818
1974
|
}
|
|
1819
|
-
],
|
|
1975
|
+
], on = [
|
|
1820
1976
|
{
|
|
1821
1977
|
transform: "translateY(-100vh)"
|
|
1822
1978
|
},
|
|
1823
1979
|
{
|
|
1824
1980
|
transform: "translateY(0vh)"
|
|
1825
1981
|
}
|
|
1826
|
-
],
|
|
1982
|
+
], cn = [
|
|
1827
1983
|
{
|
|
1828
1984
|
transform: "translateY(0vh)"
|
|
1829
1985
|
},
|
|
1830
1986
|
{
|
|
1831
1987
|
transform: "translateY(50vh)"
|
|
1832
1988
|
}
|
|
1833
|
-
],
|
|
1989
|
+
], un = [
|
|
1834
1990
|
{
|
|
1835
1991
|
transform: "scale(0.85)",
|
|
1836
1992
|
opacity: 0
|
|
@@ -1839,7 +1995,7 @@ const gn = [
|
|
|
1839
1995
|
transform: "scale(1)",
|
|
1840
1996
|
opacity: 1
|
|
1841
1997
|
}
|
|
1842
|
-
],
|
|
1998
|
+
], hn = [
|
|
1843
1999
|
{
|
|
1844
2000
|
transform: "scale(1)",
|
|
1845
2001
|
opacity: 1
|
|
@@ -1848,21 +2004,21 @@ const gn = [
|
|
|
1848
2004
|
transform: "scale(1.15)",
|
|
1849
2005
|
opacity: 0
|
|
1850
2006
|
}
|
|
1851
|
-
],
|
|
2007
|
+
], ln = [
|
|
1852
2008
|
{
|
|
1853
2009
|
opacity: 0
|
|
1854
2010
|
},
|
|
1855
2011
|
{
|
|
1856
2012
|
opacity: 1
|
|
1857
2013
|
}
|
|
1858
|
-
],
|
|
2014
|
+
], dn = [
|
|
1859
2015
|
{
|
|
1860
2016
|
opacity: 1
|
|
1861
2017
|
},
|
|
1862
2018
|
{
|
|
1863
2019
|
opacity: 0
|
|
1864
2020
|
}
|
|
1865
|
-
],
|
|
2021
|
+
], Pe = [
|
|
1866
2022
|
{
|
|
1867
2023
|
opacity: 0,
|
|
1868
2024
|
transform: "translateY(calc(100vh * 0.08))"
|
|
@@ -1879,7 +2035,7 @@ const gn = [
|
|
|
1879
2035
|
opacity: 1,
|
|
1880
2036
|
transform: "translateY(0vh)"
|
|
1881
2037
|
}
|
|
1882
|
-
],
|
|
2038
|
+
], be = [
|
|
1883
2039
|
{
|
|
1884
2040
|
opacity: 0,
|
|
1885
2041
|
transform: "translateY(96vw)"
|
|
@@ -1888,7 +2044,7 @@ const gn = [
|
|
|
1888
2044
|
opacity: 1,
|
|
1889
2045
|
transform: "translateY(0vw)"
|
|
1890
2046
|
}
|
|
1891
|
-
],
|
|
2047
|
+
], _e = [
|
|
1892
2048
|
{
|
|
1893
2049
|
opacity: 0,
|
|
1894
2050
|
transform: "translateY(0vw)"
|
|
@@ -1897,21 +2053,21 @@ const gn = [
|
|
|
1897
2053
|
opacity: 1,
|
|
1898
2054
|
transform: "translateY(-96vw)"
|
|
1899
2055
|
}
|
|
1900
|
-
],
|
|
2056
|
+
], Le = [
|
|
1901
2057
|
{
|
|
1902
2058
|
transform: "translateY(100vh)"
|
|
1903
2059
|
},
|
|
1904
2060
|
{
|
|
1905
2061
|
transform: "translateY(0vh)"
|
|
1906
2062
|
}
|
|
1907
|
-
],
|
|
2063
|
+
], Te = [
|
|
1908
2064
|
{
|
|
1909
2065
|
transform: "translateY(0vh)"
|
|
1910
2066
|
},
|
|
1911
2067
|
{
|
|
1912
2068
|
transform: "translateY(-2vh)"
|
|
1913
2069
|
}
|
|
1914
|
-
],
|
|
2070
|
+
], Re = [
|
|
1915
2071
|
{
|
|
1916
2072
|
transform: "scale(0.85)",
|
|
1917
2073
|
opacity: 0
|
|
@@ -1928,7 +2084,7 @@ const gn = [
|
|
|
1928
2084
|
transform: "scale(1)",
|
|
1929
2085
|
opacity: 1
|
|
1930
2086
|
}
|
|
1931
|
-
],
|
|
2087
|
+
], Ie = [
|
|
1932
2088
|
{
|
|
1933
2089
|
transform: "scale(1)",
|
|
1934
2090
|
opacity: 1
|
|
@@ -1945,7 +2101,7 @@ const gn = [
|
|
|
1945
2101
|
transform: "scale(1.075)",
|
|
1946
2102
|
opacity: 0
|
|
1947
2103
|
}
|
|
1948
|
-
],
|
|
2104
|
+
], xe = [
|
|
1949
2105
|
{
|
|
1950
2106
|
transform: "translateY(calc(100vh * 0.8))",
|
|
1951
2107
|
opacity: 0
|
|
@@ -1955,184 +2111,184 @@ const gn = [
|
|
|
1955
2111
|
opacity: 1
|
|
1956
2112
|
}
|
|
1957
2113
|
];
|
|
1958
|
-
function
|
|
1959
|
-
return (t) => 1 -
|
|
2114
|
+
function ke(s) {
|
|
2115
|
+
return (t) => 1 - s(1 - t);
|
|
1960
2116
|
}
|
|
1961
|
-
function
|
|
1962
|
-
return (t) => Math.pow(t,
|
|
2117
|
+
function De(s) {
|
|
2118
|
+
return (t) => Math.pow(t, s);
|
|
1963
2119
|
}
|
|
1964
|
-
const
|
|
1965
|
-
...
|
|
2120
|
+
const rt = {
|
|
2121
|
+
...Ut({
|
|
1966
2122
|
mass: 3,
|
|
1967
2123
|
stiffness: 1e3,
|
|
1968
2124
|
damping: 500,
|
|
1969
2125
|
velocity: 0,
|
|
1970
2126
|
steps: 200
|
|
1971
2127
|
})
|
|
1972
|
-
},
|
|
2128
|
+
}, Et = {
|
|
1973
2129
|
duration: 350,
|
|
1974
|
-
easing:
|
|
1975
|
-
},
|
|
2130
|
+
easing: et(ke(De(5)))
|
|
2131
|
+
}, Fe = {
|
|
1976
2132
|
duration: 150,
|
|
1977
2133
|
easing: "linear"
|
|
1978
|
-
},
|
|
2134
|
+
}, Oe = {
|
|
1979
2135
|
duration: 425,
|
|
1980
2136
|
easing: "cubic-bezier(0.35, 0.45, 0, 1)"
|
|
1981
|
-
},
|
|
2137
|
+
}, Be = {
|
|
1982
2138
|
duration: 400,
|
|
1983
2139
|
easing: "cubic-bezier(0.35, 0.45, 0, 1)"
|
|
1984
|
-
},
|
|
2140
|
+
}, Ke = {
|
|
1985
2141
|
duration: 250,
|
|
1986
|
-
easing:
|
|
1987
|
-
},
|
|
2142
|
+
easing: et((s) => Math.cos((s + 1) * Math.PI) / 2 + 0.5)
|
|
2143
|
+
}, Me = {
|
|
1988
2144
|
duration: 200,
|
|
1989
|
-
easing:
|
|
2145
|
+
easing: et((s) => s === 1 ? 1 : Math.pow(s, 2))
|
|
1990
2146
|
};
|
|
1991
|
-
function
|
|
1992
|
-
let
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
][
|
|
1996
|
-
const
|
|
2147
|
+
function fn({ ref: s, direction: t, playbackRate: e, index: n }) {
|
|
2148
|
+
let a = [
|
|
2149
|
+
ye,
|
|
2150
|
+
me
|
|
2151
|
+
][n];
|
|
2152
|
+
const u = {
|
|
1997
2153
|
playbackRate: e,
|
|
1998
2154
|
fill: "forwards",
|
|
1999
|
-
...
|
|
2155
|
+
...rt
|
|
2000
2156
|
};
|
|
2001
|
-
return t === "reverse" && (
|
|
2157
|
+
return t === "reverse" && (a = a.toReversed()), new KeyframeEffect(s, a, u);
|
|
2002
2158
|
}
|
|
2003
|
-
function
|
|
2004
|
-
let
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
][
|
|
2008
|
-
const
|
|
2159
|
+
function vn({ ref: s, direction: t, playbackRate: e, index: n }) {
|
|
2160
|
+
let a = [
|
|
2161
|
+
we,
|
|
2162
|
+
Ee
|
|
2163
|
+
][n];
|
|
2164
|
+
const u = {
|
|
2009
2165
|
playbackRate: e,
|
|
2010
2166
|
fill: "forwards",
|
|
2011
|
-
...
|
|
2167
|
+
...rt
|
|
2012
2168
|
};
|
|
2013
|
-
return t === "reverse" && (
|
|
2169
|
+
return t === "reverse" && (a = a.toReversed()), new KeyframeEffect(s, a, u);
|
|
2014
2170
|
}
|
|
2015
|
-
function
|
|
2016
|
-
let
|
|
2017
|
-
const
|
|
2171
|
+
function pn({ ref: s, direction: t, playbackRate: e }) {
|
|
2172
|
+
let n = Se;
|
|
2173
|
+
const r = {
|
|
2018
2174
|
playbackRate: e,
|
|
2019
2175
|
fill: "forwards",
|
|
2020
|
-
...
|
|
2176
|
+
...rt
|
|
2021
2177
|
};
|
|
2022
|
-
return t === "reverse" && (
|
|
2178
|
+
return t === "reverse" && (n = n.toReversed()), new KeyframeEffect(s, n, r);
|
|
2023
2179
|
}
|
|
2024
|
-
function
|
|
2025
|
-
let
|
|
2026
|
-
const
|
|
2180
|
+
function gn({ ref: s, direction: t, playbackRate: e }) {
|
|
2181
|
+
let n = Pe;
|
|
2182
|
+
const r = {
|
|
2027
2183
|
playbackRate: e,
|
|
2028
2184
|
fill: "forwards",
|
|
2029
|
-
...
|
|
2185
|
+
...Et
|
|
2030
2186
|
};
|
|
2031
|
-
return t === "reverse" && (
|
|
2187
|
+
return t === "reverse" && (n = n.toReversed()), new KeyframeEffect(s, n, r);
|
|
2032
2188
|
}
|
|
2033
|
-
function
|
|
2034
|
-
let
|
|
2035
|
-
e ===
|
|
2036
|
-
const
|
|
2037
|
-
playbackRate:
|
|
2189
|
+
function mn({ ref: s, direction: t, index: e, playbackRate: n }) {
|
|
2190
|
+
let r = xe, a;
|
|
2191
|
+
e === Y ? a = Me : a = Ke;
|
|
2192
|
+
const u = {
|
|
2193
|
+
playbackRate: n,
|
|
2038
2194
|
fill: "forwards",
|
|
2039
|
-
...
|
|
2195
|
+
...a
|
|
2040
2196
|
};
|
|
2041
|
-
return t === "reverse" && (
|
|
2197
|
+
return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(s, r, u);
|
|
2042
2198
|
}
|
|
2043
|
-
function
|
|
2044
|
-
const
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
][e],
|
|
2199
|
+
function yn({ ref: s, direction: t, index: e, playbackRate: n }) {
|
|
2200
|
+
const a = [
|
|
2201
|
+
Te,
|
|
2202
|
+
Le
|
|
2203
|
+
][e], u = {
|
|
2048
2204
|
direction: t,
|
|
2049
|
-
playbackRate:
|
|
2205
|
+
playbackRate: n,
|
|
2050
2206
|
fill: "forwards",
|
|
2051
|
-
...
|
|
2207
|
+
...Oe
|
|
2052
2208
|
};
|
|
2053
|
-
return new KeyframeEffect(
|
|
2209
|
+
return new KeyframeEffect(s, a, u);
|
|
2054
2210
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const
|
|
2057
|
-
|
|
2058
|
-
|
|
2211
|
+
function En({ ref: s, direction: t, index: e, playbackRate: n }) {
|
|
2212
|
+
const r = [
|
|
2213
|
+
_e,
|
|
2214
|
+
be
|
|
2059
2215
|
];
|
|
2060
|
-
let
|
|
2061
|
-
e ===
|
|
2062
|
-
let
|
|
2063
|
-
const
|
|
2064
|
-
playbackRate:
|
|
2216
|
+
let a;
|
|
2217
|
+
e === Y ? a = Fe : a = Et;
|
|
2218
|
+
let u = r[e];
|
|
2219
|
+
const i = {
|
|
2220
|
+
playbackRate: n,
|
|
2065
2221
|
fill: "forwards",
|
|
2066
|
-
...
|
|
2222
|
+
...a
|
|
2067
2223
|
};
|
|
2068
|
-
return t === "reverse" && (
|
|
2224
|
+
return t === "reverse" && (u = u.toReversed()), new KeyframeEffect(s, u, i);
|
|
2069
2225
|
}
|
|
2070
|
-
function
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
][e],
|
|
2226
|
+
function wn({ ref: s, direction: t, index: e, playbackRate: n }) {
|
|
2227
|
+
const a = [
|
|
2228
|
+
Ie,
|
|
2229
|
+
Re
|
|
2230
|
+
][e], u = {
|
|
2075
2231
|
direction: t,
|
|
2076
|
-
playbackRate:
|
|
2232
|
+
playbackRate: n,
|
|
2077
2233
|
fill: "forwards",
|
|
2078
|
-
...
|
|
2234
|
+
...Be
|
|
2079
2235
|
};
|
|
2080
|
-
return new KeyframeEffect(
|
|
2236
|
+
return new KeyframeEffect(s, a, u);
|
|
2081
2237
|
}
|
|
2082
2238
|
export {
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2239
|
+
$e as Anchor,
|
|
2240
|
+
ln as FadeInKeyframes,
|
|
2241
|
+
dn as FadeOutKeyframes,
|
|
2242
|
+
fe as GestureRegion,
|
|
2243
|
+
M as HistoryEntry,
|
|
2244
|
+
re as Navigation,
|
|
2245
|
+
ze as Router,
|
|
2246
|
+
nt as Screen,
|
|
2247
|
+
sn as SlideInFromBottomKeyframes,
|
|
2248
|
+
nn as SlideInFromLeftKeyframes,
|
|
2249
|
+
tn as SlideInFromRightKeyframes,
|
|
2250
|
+
on as SlideInFromTopKeyframes,
|
|
2251
|
+
cn as SlideOutToBottomKeyframes,
|
|
2252
|
+
en as SlideOutToLeftKeyframes,
|
|
2253
|
+
rn as SlideOutToRightKeyframes,
|
|
2254
|
+
an as SlideOutToTopKeyframes,
|
|
2255
|
+
un as ZoomInKeyframes,
|
|
2256
|
+
hn as ZoomOutKeyframes,
|
|
2257
|
+
Ke as androidBottomSheetSlideInOptions,
|
|
2258
|
+
Me as androidBottomSheetSlideOutOptions,
|
|
2259
|
+
Te as androidConcealToBottomKeyframes,
|
|
2260
|
+
gn as androidFadeInFromBottom,
|
|
2261
|
+
Pe as androidFadeInFromBottomKeyframes,
|
|
2262
|
+
Et as androidFadeInFromBottomOptions,
|
|
2263
|
+
mn as androidFadeInFromBottomSheet,
|
|
2264
|
+
xe as androidFadeInFromBottomSheetKeyframes,
|
|
2265
|
+
En as androidFadeInFromRight,
|
|
2266
|
+
be as androidFadeInFromRightKeyframes,
|
|
2267
|
+
Fe as androidFadeOutToBottomOptions,
|
|
2268
|
+
_e as androidFadeOutToLeftKeyframes,
|
|
2269
|
+
yn as androidRevealFromBottom,
|
|
2270
|
+
Le as androidRevealFromBottomKeyframes,
|
|
2271
|
+
Oe as androidRevealFromBottomOptions,
|
|
2272
|
+
wn as androidScaleFromCentre,
|
|
2273
|
+
Re as androidScaleFromCentreKeyframes,
|
|
2274
|
+
Be as androidScaleFromCentreOptions,
|
|
2275
|
+
Ie as androidScaleToCentreKeyframes,
|
|
2276
|
+
de as createGestureRegion,
|
|
2277
|
+
rt as iOSKeyframeOptions,
|
|
2278
|
+
pn as iOSSlideInFromBottom,
|
|
2279
|
+
Se as iOSSlideInFromBottomKeyframes,
|
|
2280
|
+
vn as iOSSlideInFromLeft,
|
|
2281
|
+
Ee as iOSSlideInFromLeftKeyframes,
|
|
2282
|
+
fn as iOSSlideInFromRight,
|
|
2283
|
+
me as iOSSlideInFromRightKeyframes,
|
|
2284
|
+
ye as iOSSlideOutToLeftKeyframes,
|
|
2285
|
+
we as iOSSlideOutToRightKeyframes,
|
|
2286
|
+
ce as isHorizontalDirection,
|
|
2287
|
+
O as isRefObject,
|
|
2288
|
+
oe as isSupportedDirection,
|
|
2289
|
+
ve as useNavigation,
|
|
2290
|
+
Qe as useParams,
|
|
2291
|
+
Je as useRoute,
|
|
2292
|
+
Ze as useRouter
|
|
2137
2293
|
};
|
|
2138
2294
|
//# sourceMappingURL=index.js.map
|