@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/index.js CHANGED
@@ -1,604 +1,670 @@
1
- import { NavigationBase as yt, resolveBaseURLFromPattern as wt, matchRoute as X, LAST_INDEX as L, FIRST_INDEX as C, SINGLE_ELEMENT_LENGTH as T, ScreenBase as Et, RoutePropContext as Pt, RouterBase as bt, PromiseWrapper as St, cloneAndInject as _t, LoadEvent as Lt, historyEntryFromDestination as Tt, useNavigationBase as Rt, useRouterBase as kt, useRouteBase as It, useParamsBase as Ft, Anchor as xt } from "@react-motion-router/core";
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 N, { useContext as Dt, createRef as Ot, startTransition as $, useDebugValue as H, useRef as Mt, useEffect as U, useCallback as V } from "react";
4
- import { GestureTimeline as Kt, springToLinear as Bt, easingToLinear as q } from "web-animations-extension";
5
- var y = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Yt = {}, _ = {};
6
- Object.defineProperty(_, "__esModule", { value: !0 });
7
- var ct;
8
- (function(n) {
9
- n[n.tap = 0] = "tap", n[n.longpress = 1] = "longpress", n[n.pinchstart = 2] = "pinchstart", n[n.pinch = 3] = "pinch", n[n.pinchend = 4] = "pinchend", n[n.rotatestart = 5] = "rotatestart", n[n.rotate = 6] = "rotate", n[n.rotateend = 7] = "rotateend", n[n.swipestart = 8] = "swipestart", n[n.swipe = 9] = "swipe", n[n.swipeend = 10] = "swipeend", n[n.panstart = 11] = "panstart", n[n.pan = 12] = "pan", n[n.panend = 13] = "panend", n[n.doubletap = 14] = "doubletap";
10
- })(ct || (ct = {}));
11
- class Xt extends TouchEvent {
12
- constructor(t, e) {
13
- if (super(t, {
14
- touches: Array.from(e.touches),
15
- targetTouches: Array.from(e.targetTouches),
16
- changedTouches: Array.from(e.changedTouches),
17
- ctrlKey: e.ctrlKey,
18
- shiftKey: e.shiftKey,
19
- altKey: e.altKey,
20
- metaKey: e.metaKey,
21
- bubbles: !0,
22
- cancelable: !0
23
- }), t.includes("end") || e.type.includes("end")) {
24
- this.gestureTarget = e.changedTouches[0].target, this.x = e.changedTouches[0].clientX, this.y = e.changedTouches[0].clientY;
25
- return;
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
- this.gestureTarget = e.touches[0].target, this.x = e.touches[0].clientX, this.y = e.touches[0].clientY;
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
- J.default = Wt;
64
- var x = {}, Gt = y && y.__importDefault || function(n) {
65
- return n && n.__esModule ? n : { default: n };
66
- };
67
- Object.defineProperty(x, "__esModule", { value: !0 });
68
- x.SwipeEndEvent = x.SwipeStartEvent = void 0;
69
- const qt = Gt(_);
70
- var ut;
71
- (function(n) {
72
- n[n.start = 0] = "start", n[n.end = 1] = "end";
73
- })(ut || (ut = {}));
74
- class Q extends qt.default {
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
- super(s, t), this.velocity = e.velocity, this.direction = e.direction;
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
- x.SwipeEndEvent = Jt;
108
- var D = {}, Qt = y && y.__importDefault || function(n) {
109
- return n && n.__esModule ? n : { default: n };
110
- };
111
- Object.defineProperty(D, "__esModule", { value: !0 });
112
- D.PanEndEvent = D.PanStartEvent = void 0;
113
- const te = Qt(_);
114
- var ht;
115
- (function(n) {
116
- n[n.start = 0] = "start", n[n.end = 1] = "end";
117
- })(ht || (ht = {}));
118
- class tt extends te.default {
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
- super(s, t), this.velocity = e.velocity, this.translation = {
132
- x: e.translation.x,
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
- D.default = ee;
147
- class ne extends tt {
148
- constructor(t, e) {
149
- super(t, e, "start");
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
- D.PanStartEvent = ne;
153
- class re extends tt {
154
- constructor(t, e) {
155
- super(t, e, "end");
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
- D.PanEndEvent = re;
159
- var O = {}, se = y && y.__importDefault || function(n) {
160
- return n && n.__esModule ? n : { default: n };
161
- };
162
- Object.defineProperty(O, "__esModule", { value: !0 });
163
- O.PinchEndEvent = O.PinchStartEvent = void 0;
164
- const ie = se(_);
165
- var lt;
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 ae extends et {
189
- constructor(t, e) {
190
- super(t, e);
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
- O.default = ae;
194
- class oe extends et {
195
- constructor(t, e) {
196
- super(t, e, "start");
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
- O.PinchStartEvent = oe;
200
- class ce extends et {
201
- constructor(t, e) {
202
- super(t, e, "end");
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
- O.PinchEndEvent = ce;
206
- var M = {}, ue = y && y.__importDefault || function(n) {
207
- return n && n.__esModule ? n : { default: n };
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
- class le extends nt {
241
- constructor(t, e) {
242
- super(t, e);
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
- M.default = le;
246
- class de extends nt {
247
- constructor(t, e) {
248
- super(t, e, "start");
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
- M.RotateStartEvent = de;
252
- class fe extends nt {
253
- constructor(t, e) {
254
- super(t, e, "end");
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
- M.RotateEndEvent = fe;
258
- var k = {};
259
- Object.defineProperty(k, "__esModule", { value: !0 });
260
- k.closest = k.Vec2 = k.assert = void 0;
261
- function ve(n, t) {
262
- if (!n)
263
- throw new Error(t);
264
- }
265
- k.assert = ve;
266
- class ge {
267
- constructor(t, e) {
268
- this._x = 0, this._y = 0, this._clientX = 0, this._clientY = 0, this._clientX = t, this._clientY = e, this._x = this.translateX(t), this._y = this.translateY(e);
269
- }
270
- translateY(t) {
271
- return -(t - window.innerHeight / 2);
272
- }
273
- translateX(t) {
274
- return t - window.innerWidth / 2;
275
- }
276
- get x() {
277
- return this._x;
278
- }
279
- get y() {
280
- return this._y;
281
- }
282
- get clientX() {
283
- return this._clientX;
284
- }
285
- get clientY() {
286
- return this._clientY;
287
- }
288
- set x(t) {
289
- this._clientX = t, this._x = this.translateX(t);
290
- }
291
- set y(t) {
292
- this._clientY = t, this._y = this.translateY(t);
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
- get magnitude() {
304
- return Math.sqrt(Math.pow(this._x, 2) + Math.pow(this._y, 2));
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
- get clientMagnitude() {
307
- return Math.sqrt(Math.pow(this._clientX, 2) + Math.pow(this._clientY, 2));
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.Vec2 = ge;
311
- function pe(n, t) {
312
- return t.reduce((e, r) => {
313
- let s = Math.abs(e - n), i = Math.abs(r - n);
314
- return s === i ? e > r ? e : r : i < s ? r : e;
315
- });
316
- }
317
- k.closest = pe;
318
- (function(n) {
319
- var t = y && y.__createBinding || (Object.create ? function(h, o, f, P) {
320
- P === void 0 && (P = f), Object.defineProperty(h, P, { enumerable: !0, get: function() {
321
- return o[f];
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
- bind(o) {
388
- this.unbind(this.currentTarget), o.addEventListener("touchmove", this.touchMoveListener, !0), o.addEventListener("touchend", this.touchEndListener, !0), o.addEventListener("touchcancel", this.touchCancelListener, !0), this.currentTarget = o;
305
+ translateY(r) {
306
+ return -(r - window.innerHeight / 2);
389
307
  }
390
- unbind(o) {
391
- o.removeEventListener("touchmove", this.touchMoveListener), o.removeEventListener("touchend", this.touchEndListener), o.removeEventListener("touchcancel", this.touchCancelListener);
308
+ translateX(r) {
309
+ return r - window.innerWidth / 2;
392
310
  }
393
- clean() {
394
- 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;
311
+ get x() {
312
+ return this._x;
395
313
  }
396
- onPointerLeave(o) {
397
- if (!o.touches.length) {
398
- if (this.isSwiping) {
399
- const f = new l.SwipeEndEvent(o, {
400
- velocity: this.velocity,
401
- direction: p[(0, g.closest)(this.octant, [0, 1, 2, 3])]
402
- });
403
- this.dispatchEvent(f), this.isSwiping = !1;
404
- }
405
- if (this.isPanning) {
406
- const f = new v.PanEndEvent(o, {
407
- translation: this.dxDy,
408
- velocity: this.velocity
409
- });
410
- this.dispatchEvent(f), this.isPanning = !1;
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
- if (o.touches.length === 1) {
414
- if (this.scaleBase = 0, this.isPinching) {
415
- const f = new d.PinchEndEvent(o, {
416
- scale: this.scale
417
- });
418
- this.dispatchEvent(f), this.isPinching = !1;
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 (this.isRotating) {
421
- const f = new m.RotateEndEvent(o, {
422
- rotation: this.rotation,
423
- rotationDeg: this.rotationDeg,
424
- anchor: this.anchor
425
- });
426
- this.dispatchEvent(f), this.isRotating = !1;
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
- dispatchEvent(o) {
431
- queueMicrotask(() => {
432
- this.currentTarget.dispatchEvent(o);
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
- this.shouldFire = !0, this.touchStartTime = o.timeStamp, this.touchDown = !0, this.pointers || this.bind(o.touches[0].target), this.pointers = this.touchStart.touches.length;
443
- const P = parseFloat(this.currentTarget.dataset.longpressduration || "0") || this.config.longPressDuration;
444
- if (this.longPressTimeout || (this.longPressTimeout = setTimeout(() => {
445
- if (!this.touchMoved && this.touchDown) {
446
- const E = Date.now() - this.touchStartTime, R = new a.default(this.touchStart, E);
447
- this.dispatchEvent(R), this.isLongPress = !0, this.longPressTimeout = 0;
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
- }, P)), this.touchStart.touches.length > 1) {
450
- const E = new g.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), R = new g.Vec2(this.touchStart.touches[1].clientX, this.touchStart.touches[1].clientY);
451
- this.scaleBase = E.substract(R).magnitude;
452
- } else
453
- this.scaleBase = 0;
454
- }
455
- onTouchMove(o) {
456
- if (!this.shouldFire)
457
- return;
458
- if (this.touchMoved = !0, this.touchMove = o, o.touches.length > 1 && this.touchStart.touches.length > 1 && (o.touches[1].clientX !== this.touchStart.touches[1].clientX || o.touches[1].clientY !== this.touchStart.touches[1].clientY)) {
459
- const b = new g.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY), A = new g.Vec2(this.touchMove.touches[1].clientX, this.touchMove.touches[1].clientY), at = new g.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), ot = b.substract(A);
460
- if (this.scaleBase && Math.abs(this.scaleBase - ot.magnitude) > 10) {
461
- const I = ot.magnitude / this.scaleBase;
462
- if (this.scale = I, this.isPinching) {
463
- const j = new d.default(o, {
464
- scale: I
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(j);
519
+ this.dispatchEvent(K);
467
520
  } else {
468
- const j = new d.PinchStartEvent(o, {
469
- scale: I
521
+ const K = new d.RotateStartEvent(h, {
522
+ anchor: this.anchor,
523
+ rotation: this.rotation,
524
+ rotationDeg: this.rotationDeg
470
525
  });
471
- this.dispatchEvent(j), this.isPinching = !0;
526
+ this.dispatchEvent(K), this.isRotating = !0;
472
527
  }
473
528
  }
474
- this.anchor = b;
475
- let B = Math.atan2(at.clientY - A.clientY, at.clientX - A.clientX);
476
- if (B < 0 ? B += 1.5708 : B -= 1.5708, this.rotation = B, this.rotationDeg = B * 180 / Math.PI, this.anchor = this.anchor, this.isRotating) {
477
- const I = new m.default(o, {
478
- anchor: this.anchor,
479
- rotation: this.rotation,
480
- rotationDeg: this.rotationDeg
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(I);
540
+ this.dispatchEvent(_);
483
541
  } else {
484
- const I = new m.RotateStartEvent(o, {
485
- anchor: this.anchor,
486
- rotation: this.rotation,
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(I), this.isRotating = !0;
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
- const f = new g.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), E = new g.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY).substract(f), R = E.magnitude, it = {
493
- x: E.x / R,
494
- y: E.y / R
495
- }, pt = Math.atan2(it.y, it.x);
496
- this.octant = Math.round(4 * pt / (2 * Math.PI) + 4) % 4;
497
- const mt = (o.timeStamp - this.touchStart.timeStamp) / 1e3, K = E.magnitude / mt;
498
- if (this.isSwiping) {
499
- const b = new l.default(o, {
500
- direction: p[(0, g.closest)(this.octant, [0, 1, 2, 3])],
501
- velocity: K
502
- });
503
- this.dispatchEvent(b);
504
- } else {
505
- const b = new l.SwipeStartEvent(o, {
506
- direction: p[(0, g.closest)(this.octant, [0, 1, 2, 3])],
507
- velocity: K
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
- onTouchEnd(o) {
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
- onTouchCancel(o) {
544
- this.shouldFire && (this.touchCancel = o, this.unbind(this.currentTarget), this.clean());
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
- n.default = w, w.listening = !1, TouchEvent && (window.gestureProvider = new w());
548
- })(Yt);
549
- class me extends Event {
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
- committed;
556
- transition;
557
- constructor(t, e, r, s, i, a, c) {
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 ye extends Event {
629
+ class Qt extends Event {
562
630
  routerId;
563
631
  signal;
564
- committed;
565
- transition;
566
- constructor(t, e, r, s) {
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 we extends Event {
637
+ class $t extends Event {
571
638
  routerId;
572
639
  signal;
573
- committed;
574
- transition;
575
- constructor(t, e, r, s) {
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 Ee extends Event {
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 Pe extends Event {
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 be extends Event {
657
+ class ne extends Event {
592
658
  constructor() {
593
659
  super("gesture-cancel");
594
660
  }
595
661
  }
596
- class vt {
662
+ class M {
597
663
  routerId;
598
664
  #t;
599
665
  index;
600
- constructor(t, e, r) {
601
- this.#t = t, this.routerId = e, this.index = r;
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, r) {
625
- return this.#t.addEventListener(t, e, r), () => this.#t.removeEventListener(t, e, r);
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, r) {
628
- this.#t.addEventListener(t, e, r);
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 Se extends yt {
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 = {}, r = {}) {
646
- return this.navigate(t, e, { ...r, type: "replace" });
714
+ replace(t, e = {}, n = {}) {
715
+ return this.navigate(t, e, { ...n, type: "replace" });
647
716
  }
648
- push(t, e = {}, r = {}) {
649
- return this.navigate(t, e, { ...r, type: "push" });
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 r = window.navigation.traverseTo(t), s = window.navigation.transition, i = s.from.index, a = window.navigation.entries().findIndex((l) => l.key === t), c = new AbortController();
656
- c.signal.addEventListener(
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.traverseTo(s.from.key),
737
+ () => this.controller?.abort,
659
738
  { once: !0 }
660
- ), e.signal?.addEventListener("abort", c.abort, { once: !0 });
661
- let u;
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
- s,
679
- u.signal,
680
- a.committed,
681
- c
743
+ r,
744
+ u
682
745
  );
683
- return this.dispatchEvent?.(l), a;
746
+ return this.dispatchEvent?.(i), u;
684
747
  }
685
748
  goBack(t = {}) {
686
- if (!this.canGoBack())
687
- return;
688
- const e = window.navigation.traverseTo(this.previous.key), r = window.navigation.transition, s = new AbortController();
689
- s.signal.addEventListener("abort", () => this.goForward(), { once: !0 }), t.signal?.addEventListener("abort", s.abort, { once: !0 });
690
- const i = this.createBackEvent(
691
- s.signal,
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
- return this.dispatchEvent?.(i), e;
756
+ const n = this.createBackEvent(e);
757
+ return this.dispatchEvent?.(n), e;
696
758
  }
697
759
  goForward(t = {}) {
698
- if (!this.canGoForward())
699
- return;
700
- const e = window.navigation.traverseTo(this.next.key), r = window.navigation.transition, s = new AbortController();
701
- s.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), t.signal?.addEventListener("abort", s.abort, { once: !0 });
702
- const i = this.createForwardEvent(
703
- s.signal,
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
- return this.dispatchEvent?.(i), e;
708
- }
709
- createBackEvent(t, e, r) {
710
- if (!this.routerId)
711
- throw new Error("Router ID is not set");
712
- return new ye(this.routerId, t, e, r);
713
- }
714
- createForwardEvent(t, e, r) {
715
- if (!this.routerId)
716
- throw new Error("Router ID is not set");
717
- return new we(this.routerId, t, e, r);
718
- }
719
- createNavigateEvent(t, e, r, s, i, a) {
720
- if (!this.routerId)
721
- throw new Error("Router ID is not set");
722
- return new me(
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
- r,
727
- s,
728
- i,
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, r = L, s = !1;
822
- return this.globalEntries.filter((i, a) => {
823
- if (!i.url || s)
824
- return !1;
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
- c.pathname
892
+ o.pathname
828
893
  );
829
- if (!u)
830
- return r !== L && (s = !0), !1;
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
- u.href
899
+ f.href
835
900
  );
836
- if (X(
837
- c.pathname,
838
- c.pathname,
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: v }) => X(
910
+ ({ pattern: l, caseSensitive: d }) => V(
846
911
  l,
847
- c.pathname,
912
+ o.pathname,
848
913
  this.baseURLPattern.pathname,
849
- v
914
+ d
850
915
  )
851
- ) ?? null, r = a, !0;
852
- }).map((i, a) => new vt(i, this.routerId, a));
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 ?? L, e = this.entries.at(C)?.globalIndex ?? L, r = this.entries.at(L)?.globalIndex ?? L;
953
- if (t <= e)
954
- return C;
955
- if (t >= r)
956
- return this.entries.length - T;
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 s = this.globalEntries.slice(
959
- e,
960
- t + T
1061
+ const u = this.globalEntries.slice(
1062
+ r,
1063
+ n + P
961
1064
  );
962
- return this.entries.findLastIndex((i) => s.findLastIndex(
963
- (a) => i.key === a.key
964
- ) > L);
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 - T] ?? null;
1071
+ return this.entries[this.index - P] ?? null;
969
1072
  }
970
1073
  get next() {
971
- return this.entries[this.index + T] ?? null;
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 _e(n) {
984
- return Object.fromEntries(n.entries());
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 Te(n) {
990
- return n && typeof n == "object" && "gesture" in n ? !!n.gesture : !1;
1089
+ function ie(s) {
1090
+ return new URLSearchParams(s).toString();
991
1091
  }
992
- function Re(n) {
993
- return n && typeof n == "object" && "rollback" in n ? !!n.rollback : !1;
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 - r.left) < s;
1095
+ return Math.abs(t - n.left) < r;
1012
1096
  case "left":
1013
- return Math.abs(t - r.right) < s;
1097
+ return Math.abs(t - n.right) < r;
1014
1098
  case "down":
1015
- return Math.abs(e - r.top) < s;
1099
+ return Math.abs(e - n.top) < r;
1016
1100
  case "up":
1017
- return Math.abs(e - r.bottom) < s;
1101
+ return Math.abs(e - n.bottom) < r;
1018
1102
  }
1019
1103
  }
1020
- class rt extends Et {
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 r = t.getState() ?? {}, s = _e(t.url.searchParams), { params: i = {} } = e ?? {};
1035
- return r.params = {
1036
- ...r.params,
1037
- ...s,
1038
- ...i
1039
- }, r;
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 r = /* @__PURE__ */ new Set([
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(([s]) => !r.has(s))
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
- return {};
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.context.baseURLPattern.pathname,
1163
+ this.router.baseURLPattern.pathname,
1087
1164
  this.props.caseSensitive
1088
1165
  );
1089
- return rt.historyEntryStateFromEntry(t, e);
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: r } = this.props, { focused: s } = this.state, { params: i, config: a, resolvedPathname: c } = this;
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: r,
1114
- resolvedPathname: c,
1115
- focused: s,
1116
- params: i,
1117
- config: a
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 r = {
1212
+ const n = {
1126
1213
  ...e ?? {},
1127
1214
  ...t
1128
1215
  };
1129
- window.navigation.updateCurrentEntry({ state: r });
1216
+ window.navigation.updateCurrentEntry({ state: n });
1130
1217
  }
1131
- onClickOutside(t) {
1132
- if (!this.transitionProvider.current?.ref.current)
1133
- return;
1218
+ onclick(t) {
1219
+ if (!this.ref.current) return;
1134
1220
  const e = this.context?.navigation;
1135
- t.composedPath().includes(this.transitionProvider.current.ref.current) || e?.goBack();
1221
+ t.composedPath().includes(this.ref.current) || e?.goBack();
1222
+ }
1223
+ onclose() {
1224
+ this.router.navigation.goBack();
1136
1225
  }
1137
1226
  onEnter(t) {
1138
- const e = this.transitionProvider.current?.ref;
1139
- if (e?.current instanceof HTMLDialogElement && e.current.open === !1) {
1140
- const r = this.context?.navigation;
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
- const e = this.transitionProvider.current?.ref;
1151
- return e?.current instanceof HTMLDialogElement && e.current.close("screen-exit"), super.onExited(t);
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 F(n) {
1155
- return !!(n !== null && typeof n == "object" && Object.hasOwn(n, "current"));
1254
+ function O(s) {
1255
+ return !!(s !== null && typeof s == "object" && Object.hasOwn(s, "current"));
1156
1256
  }
1157
- const ke = {
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 Ie(n, t) {
1166
- return ke[t].includes(n);
1265
+ function oe(s, t) {
1266
+ return ae[t].includes(s);
1167
1267
  }
1168
- function Fe(n) {
1169
- return n === "left" || n === "right" || n === "horizontal";
1268
+ function ce(s) {
1269
+ return s === "left" || s === "right" || s === "horizontal";
1170
1270
  }
1171
- const S = {
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
- }, xe = 0.5, De = 1, Oe = 24;
1178
- function ft({ clientX: n, clientY: t }, e, r) {
1179
- return Y("left", { x: n, y: t }, e, r) && Y("right", { x: n, y: t }, e, r) && Y("down", { x: n, y: t }, e, r) && Y("up", { x: n, y: t }, e, r);
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 Me = (n) => function({
1281
+ const de = ((s) => function({
1182
1282
  ref: e,
1183
- gestureBehaviour: r = "contain",
1184
- uaGestureAreaWidth: s = Oe,
1185
- ...i
1283
+ gestureBehaviour: n = "contain",
1284
+ uaGestureAreaWidth: r = le,
1285
+ ...a
1186
1286
  }) {
1187
- const a = N.useRef(null), c = Dt(
1188
- Pt
1189
- ) ?? null, { gestureAreaWidth: u = 0 } = c?.config ?? {};
1190
- return N.useImperativeHandle(
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
- () => a.current
1193
- ), N.useEffect(() => {
1194
- if (!a.current)
1195
- return;
1196
- const v = a.current, d = (m) => {
1197
- if (!(m instanceof TouchEvent) || r === "none")
1198
- return;
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 v.addEventListener("touchstart", d), () => {
1203
- v.removeEventListener(
1300
+ return f.addEventListener("touchstart", l), () => {
1301
+ f.removeEventListener(
1204
1302
  "touchstart",
1205
- d
1303
+ l
1206
1304
  );
1207
1305
  };
1208
- }, [s, u, r]), /* @__PURE__ */ G(n, { ref: a, ...i });
1209
- }, Ke = new Proxy(
1306
+ }, [r, c, n]), /* @__PURE__ */ G(s, { ref: u, ...a });
1307
+ }), fe = new Proxy(
1210
1308
  {},
1211
1309
  {
1212
- get(n, t) {
1213
- return n[t] ??= Me(t), n[t];
1310
+ get(s, t) {
1311
+ return s[t] ??= de(t), s[t];
1214
1312
  }
1215
1313
  }
1216
1314
  );
1217
- class hn extends bt {
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 Se({
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: (u) => this.getRouterById(u)?.navigation ?? null
1333
+ getNavigatorById: (c) => this.getRouterById(c)?.navigation ?? null
1233
1334
  });
1234
1335
  const {
1235
- gestureAreaWidth: r = S.gestureAreaWidth,
1236
- gestureDirection: s = S.gestureDirection,
1237
- gestureDisabled: i = S.gestureDisabled,
1238
- gestureHysteresis: a = S.gestureHysteresis,
1239
- gestureMinFlingVelocity: c = S.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: s,
1244
- gestureAreaWidth: r,
1245
- gestureHysteresis: a,
1246
- gestureDisabled: i,
1247
- gestureMinFlingVelocity: c,
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 r = e.screenStack.find(
1257
- (s) => F(s.ref) && s.ref.current?.focused
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 = r?.title ?? document.title, {
1260
- gestureDirection: r?.gestureDirection ?? S.gestureDirection,
1261
- gestureAreaWidth: r?.gestureAreaWidth ?? S.gestureAreaWidth,
1262
- gestureMinFlingVelocity: r?.gestureMinFlingVelocity ?? S.gestureMinFlingVelocity,
1263
- gestureHysteresis: r?.gestureHysteresis ?? S.gestureHysteresis,
1264
- gestureDisabled: r?.gestureDisabled ?? S.gestureDisabled,
1265
- documentTitle: r?.title
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 St();
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
- window.navigation.traverseTo(this.state.transition.from.key, {
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
- return !1;
1301
- const e = this.ref.current.getBoundingClientRect(), { direction: r } = t;
1302
- return (r === "down" || r === "right") && !this.navigation.canGoBack() || (r === "up" || r === "left") && !this.navigation.canGoForward() || Y(
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 : Ie(r, this.state.gestureDirection);
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
- return;
1312
- const { direction: e } = t, r = Fe(e) ? "x" : "y";
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
- s = 0, i = this.ref.current.clientWidth;
1408
+ r = 0, a = this.ref.current.clientWidth;
1317
1409
  break;
1318
1410
  case "left":
1319
- s = this.ref.current.clientWidth, i = 0;
1411
+ r = this.ref.current.clientWidth, a = 0;
1320
1412
  break;
1321
1413
  case "down":
1322
- s = 0, i = this.ref.current.clientHeight;
1414
+ r = 0, a = this.ref.current.clientHeight;
1323
1415
  break;
1324
1416
  case "up":
1325
- s = this.ref.current.clientHeight, i = 0;
1417
+ r = this.ref.current.clientHeight, a = 0;
1326
1418
  break;
1327
1419
  }
1328
- this.screenTransitionLayer.current.animation.timeline = new Kt(
1420
+ this.screenTransitionLayer.current.animation.timeline = new At(
1329
1421
  {
1330
1422
  source: this.ref.current,
1331
1423
  type: "swipe",
1332
- axis: r,
1333
- rangeStart: s,
1334
- rangeEnd: i
1424
+ axis: n,
1425
+ rangeStart: r,
1426
+ rangeEnd: a
1335
1427
  }
1336
1428
  );
1337
- const a = !0;
1429
+ const u = !0;
1338
1430
  e === "down" || e === "right" ? window.navigation.traverseTo(this.navigation.previous.key, {
1339
- info: { gesture: a }
1431
+ info: { gesture: u }
1340
1432
  }) : window.navigation.traverseTo(this.navigation.next.key, {
1341
- info: { gesture: a }
1342
- }), this.dispatchEvent(new Ee(t));
1433
+ info: { gesture: u }
1434
+ }), this.dispatchEvent(new te(t));
1343
1435
  }
1344
1436
  onswipeend(t) {
1345
- if (!this.screenTransitionLayer.current)
1346
- return;
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 s = r > 0 ? e > this.state.gestureHysteresis : e < this.state.gestureHysteresis;
1350
- let i = !1;
1351
- t.velocity < this.state.gestureMinFlingVelocity && !s ? (i = !0, this.screenTransitionLayer.current.animation.reverse(), this.dispatchEvent(new be())) : this.dispatchEvent(new Pe(t)), i && this.screenTransitionLayer.current.animation.finished.then(() => {
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
- (r) => r.key === this.state.fromKey
1451
+ (n) => n.key === this.state.fromKey
1361
1452
  ), e = this.state.screenStack.findIndex(
1362
- (r) => r.key === this.state.destinationKey
1453
+ (n) => n.key === this.state.destinationKey
1363
1454
  );
1364
- return e >= C && e < t;
1455
+ return e >= Y && e < t;
1365
1456
  }
1366
1457
  get screens() {
1367
1458
  const t = this.state.screenStack;
1368
- return t.filter((e, r) => {
1369
- const s = e.ref ?? null, i = t.at(r + T)?.ref;
1370
- return F(s) && s.current?.config.keepAlive || F(i) && i.current?.config.presentation === "modal" || F(i) && i.current?.config.presentation === "dialog" || e.key === this.navigation.current?.key || e.key === this.state.fromKey || e.key === this.state.destinationKey;
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(), _t(r, {
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: Ot()
1478
+ ref: $()
1385
1479
  })) : null;
1386
1480
  }
1387
1481
  getScreenRefByKey(t) {
1388
1482
  const e = this.state.screenStack.find(
1389
- (r) => r.key === t
1390
- )?.ref;
1391
- return F(e) ? e : null;
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, r = this.baseURLPattern.pathname;
1395
- return this.mounted && this.shouldIntercept(t) && this.includesRoute(e, r);
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 Lt || this.props.config?.onIntercept?.(t), !t.defaultPrevented)
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
- const { pathname: r } = new URL(t.destination.url), {
1421
- child: s,
1422
- matchInfo: i = null
1423
- } = this.screenChildFromPathname(r) ?? {};
1424
- if (!s)
1425
- return Promise.resolve();
1426
- const { navigation: a } = this, { signal: c } = t, { path: u } = s.props, { transition: l } = t;
1427
- return new Promise((v) => {
1428
- this.setState({ transition: l }, async () => {
1429
- const d = rt.historyEntryStateFromEntry(
1430
- new vt(
1431
- Tt(t.destination),
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
- L
1527
+ D
1434
1528
  ),
1435
- i
1529
+ a
1436
1530
  );
1437
1531
  await Promise.all([
1438
- this.preloadScreen(s),
1439
- s.props.config?.onLoad?.({
1440
- navigation: a,
1441
- signal: c,
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: u,
1446
- resolvedPathname: r,
1539
+ path: c,
1540
+ resolvedPathname: n,
1447
1541
  config: {
1448
1542
  ...this.props.config?.screenConfig,
1449
- ...s.props.config,
1450
- ...d.config
1543
+ ...r.props.config,
1544
+ ...l.config
1451
1545
  },
1452
1546
  params: {
1453
- ...s.props.defaultParams,
1454
- ...i?.params,
1455
- ...d.params
1547
+ ...r.props.defaultParams,
1548
+ ...a?.params,
1549
+ ...l.params
1456
1550
  }
1457
1551
  }
1458
1552
  })
1459
- ]), this.setState({ transition: null }, v);
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 r = t.transition?.from?.key ?? null, s = t.destination.key, i = t.transition, a = [], c = this.navigation.entries;
1468
- return c.forEach((u) => {
1469
- if (!u.url)
1470
- return null;
1471
- const l = this.cloneScreenChildFromPathname(
1472
- u.url.pathname,
1473
- u.key
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 (!l)
1476
- return null;
1477
- a.push(l);
1578
+ if (!f) return null;
1579
+ i.push(f);
1478
1580
  }), new Promise(
1479
- (u, l) => $(() => {
1581
+ (o) => Q(() => {
1480
1582
  this.setState(
1481
- { screenStack: a, fromKey: r, transition: i, destinationKey: s },
1583
+ { screenStack: i, fromKey: n, transition: u, destination: a, destinationKey: r },
1482
1584
  async () => {
1483
- const { initialPathname: v } = this.props.config ?? {}, [d] = c;
1484
- if (v && c.length === T && d.url && !X(
1485
- v,
1486
- d.url.pathname,
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(v).finished.then(() => {
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
- }), u();
1495
- const m = t.signal;
1496
- this.navigation.current?.key === void 0 && l(new Error("Current key is undefined"));
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 = this.state.screenStack, r = t.destination, s = new URL(r.url).pathname, i = window.navigation.currentEntry?.key ?? r.key, a = this.cloneScreenChildFromPathname(
1517
- s,
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
- return e.splice(
1527
- v,
1528
- T,
1529
- a
1530
- ), new Promise(
1531
- (d, m) => $(() => {
1532
- this.setState(
1533
- { destinationKey: i, fromKey: l, transition: u, screenStack: e },
1534
- async () => {
1535
- const g = t.signal, p = this.getScreenRefByKey(
1536
- String(i)
1537
- );
1538
- await this.dispatchLifecycleHandlers(
1539
- p,
1540
- null,
1541
- g
1542
- ).catch(m), this.setState(
1543
- { destinationKey: null, fromKey: null, transition: null },
1544
- d
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({ handler: c });
1673
+ t.intercept({ precommitHandler: e });
1552
1674
  }
1553
1675
  handleDefault(t) {
1554
- const e = this.state.screenStack, r = t.destination, s = new URL(r.url).pathname;
1555
- if (!this.screenChildFromPathname(s))
1556
- return t.preventDefault();
1557
- const i = () => {
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
- l === L && t.navigationType === "traverse" && (l = e.findIndex((p) => u?.from.url ? X(
1565
- p.props.path,
1566
- new URL(u.from.url).pathname,
1567
- this.baseURLPattern.pathname,
1568
- p.props.caseSensitive
1569
- ) : !1));
1570
- const v = (e[l]?.key || u?.from.key) ?? null, d = e.findIndex(
1571
- (p) => p.key === t.destination.key
1572
- ), m = (e[d]?.key || window.navigation.currentEntry?.key) ?? null;
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
- const p = new URL(r.url).pathname, w = this.cloneScreenChildFromPathname(
1575
- p,
1576
- m
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 (!w)
1579
- return Promise.resolve();
1580
- e.splice(
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
- w
1715
+ p
1585
1716
  );
1717
+ } else {
1718
+ const l = this.state.screenStack[c];
1719
+ await this.preloadScreen(l);
1586
1720
  }
1587
- const g = new AbortController();
1721
+ const f = new AbortController();
1588
1722
  return new Promise(
1589
- (p, w) => $(() => {
1723
+ (l, d) => Q(() => {
1590
1724
  this.setState(
1591
- { controller: g, destinationKey: m, fromKey: v, transition: u, screenStack: e },
1725
+ {
1726
+ controller: f,
1727
+ destinationKey: o,
1728
+ fromKey: i,
1729
+ transition: a,
1730
+ destination: r,
1731
+ screenStack: n
1732
+ },
1592
1733
  async () => {
1593
- g.signal.onabort = w;
1594
- const h = t.signal, o = this.getScreenRefByKey(String(v)), f = this.getScreenRefByKey(
1595
- String(m)
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
- E?.updatePlaybackRate(De), E?.finished.catch(w), await P, this.setState(
1605
- {
1606
- destinationKey: null,
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
- let a;
1619
- Te(t.info) ? (a = "after-transition", this.addEventListener("gesture-end", () => t.commit?.(), { once: !0 }), this.addEventListener("gesture-cancel", this.onGestureCancel, {
1620
- once: !0
1621
- })) : a = "immediate";
1622
- const c = { handler: i, commit: a };
1623
- t.intercept(c);
1624
- }
1625
- async dispatchLifecycleHandlers(t, e, r) {
1626
- let s = !1;
1627
- this.addEventListener(
1628
- "routertransitionstart",
1629
- () => s = !0,
1630
- { once: !0 }
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: r } = this, s = this.screenTransitionLayer.current;
1644
- if (s && t && e) {
1645
- s.direction = r ? "reverse" : "normal", t.current?.transitionProvider.current && (t.current.transitionProvider.current.exiting = !1), e.current?.transitionProvider.current && (e.current.transitionProvider.current.exiting = !0);
1646
- const i = s.sharedElementTransitionLayer.current;
1647
- i && (i.outgoingScreen = e, i.incomingScreen = t);
1648
- const a = this.screens.findIndex(
1649
- (c) => c.ref === (r ? e : t)
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 s.screens = this.screens.map((c, u) => (u = u - a + T, F(c.ref) && c.ref.current?.transitionProvider.current ? (c.ref.current.transitionProvider.current.index = u, c.ref) : null)).filter(F), s.transition();
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
- return /* @__PURE__ */ G(Ke.div, { style: { display: "contents" }, children: super.render() });
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 Be() {
1659
- return H("Stack.Navigation"), Rt();
1814
+ function ve() {
1815
+ return W("Stack.Navigation"), Ft();
1660
1816
  }
1661
- function ln() {
1662
- return H("Stack.Router"), kt();
1817
+ function Ze() {
1818
+ return W("Stack.Router"), Kt();
1663
1819
  }
1664
- function dn() {
1665
- return H("Stack.Route"), It();
1820
+ function Je() {
1821
+ return W("Stack.Route"), Bt();
1666
1822
  }
1667
- function fn(n, t) {
1668
- return H("Stack.Params"), Ft(n, t);
1823
+ function Qe(s, t) {
1824
+ return W("Stack.Params"), Ot(s, t);
1669
1825
  }
1670
- function Ye(n, t, e = {}) {
1671
- const r = V(
1672
- (s) => {
1673
- s.forEach((i) => {
1674
- i.isIntersecting && t(i);
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 U(() => {
1680
- const s = new IntersectionObserver(r, e), i = n.current;
1681
- return i && s.observe(i), () => {
1682
- i && s.unobserve(i);
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
- }, [r, n, e]), n;
1840
+ }, [n, s, e]), s;
1685
1841
  }
1686
- function Xe(n, t, { forceThreshold: e = xe } = {}) {
1687
- const r = V(() => t(), [t]), s = V((i) => {
1688
- const a = i.touches[0];
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 U(() => {
1692
- const i = n.current;
1693
- return i?.addEventListener("mouseenter", r), () => i?.removeEventListener("mouseenter", r);
1694
- }), U(() => {
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 vn({
1700
- preload: n,
1701
- params: t,
1702
- searchParams: e = t,
1851
+ function $e({
1852
+ ref: s,
1853
+ preload: t,
1854
+ params: e,
1855
+ searchParams: n = e,
1703
1856
  config: r,
1704
- preloadBehaviour: s = {
1857
+ preloadBehaviour: a = {
1705
1858
  type: "onsight"
1706
1859
  },
1707
- children: i,
1708
- ...a
1860
+ children: u,
1861
+ ...i
1709
1862
  }) {
1710
- const c = Be(), u = s?.type === "onsight" && n, l = s?.type === "onhover" && n, v = s?.type === "force" && n, d = Mt(null);
1711
- Ye(
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
- (p) => {
1714
- !u || !p.isIntersecting || !(p.target instanceof HTMLAnchorElement) || c.preload(p.target.href, { params: t, config: r });
1866
+ (S) => {
1867
+ !o || !(S.target instanceof HTMLAnchorElement) || c.preload(S.target.href, { params: e, config: r });
1715
1868
  },
1716
- u ? s : {}
1717
- ), Xe(
1869
+ o ? a : {}
1870
+ ), ge(
1718
1871
  d,
1719
1872
  () => {
1720
- !l || !d.current || c.preload(d.current.href, { params: t, config: r });
1873
+ !f || !d.current || c.preload(d.current.href, { params: e, config: r });
1721
1874
  },
1722
- l ? s : {}
1723
- ), U(() => {
1724
- !v || !d.current || c.preload(d.current.href, { params: t, config: r });
1725
- }, [n, c, r, v, t]);
1726
- const m = c?.routerId, g = e ? Le(e) : void 0;
1727
- return /* @__PURE__ */ G(
1728
- xt,
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
- ...a,
1731
- "data-router-id": m,
1886
+ ...i,
1887
+ "data-router-id": p,
1732
1888
  ref: d,
1733
- search: g,
1889
+ search: w,
1734
1890
  navigateState: {
1735
1891
  config: r,
1736
- params: t
1892
+ params: e
1737
1893
  },
1738
- children: i
1894
+ children: u
1739
1895
  }
1740
1896
  );
1741
1897
  }
1742
- const gn = [
1898
+ const tn = [
1743
1899
  {
1744
1900
  transform: "translateX(100vw)"
1745
1901
  },
1746
1902
  {
1747
1903
  transform: "translateX(0vw)"
1748
1904
  }
1749
- ], Ce = [
1905
+ ], me = [
1750
1906
  {
1751
1907
  transform: "translateX(100vw)"
1752
1908
  },
1753
1909
  {
1754
1910
  transform: "translateX(0vw)"
1755
1911
  }
1756
- ], pn = [
1912
+ ], en = [
1757
1913
  {
1758
1914
  transform: "translateX(0vw)"
1759
1915
  },
1760
1916
  {
1761
1917
  transform: "translateX(-50vw)"
1762
1918
  }
1763
- ], Ue = [
1919
+ ], ye = [
1764
1920
  {
1765
1921
  transform: "translateX(0vw)"
1766
1922
  },
1767
1923
  {
1768
1924
  transform: "translateX(calc(100vw * -0.3))"
1769
1925
  }
1770
- ], mn = [
1926
+ ], nn = [
1771
1927
  {
1772
1928
  transform: "translateX(-100vw)"
1773
1929
  },
1774
1930
  {
1775
1931
  transform: "translateX(0vw)"
1776
1932
  }
1777
- ], He = [
1933
+ ], Ee = [
1778
1934
  {
1779
1935
  transform: "translateX(-100vw)"
1780
1936
  },
1781
1937
  {
1782
1938
  transform: "translateX(0vw)"
1783
1939
  }
1784
- ], yn = [
1940
+ ], rn = [
1785
1941
  {
1786
1942
  transform: "translateX(0vw)"
1787
1943
  },
1788
1944
  {
1789
1945
  transform: "translateX(50vw)"
1790
1946
  }
1791
- ], Ae = [
1947
+ ], we = [
1792
1948
  {
1793
1949
  transform: "translateX(0vw)"
1794
1950
  },
1795
1951
  {
1796
1952
  transform: "translateX(calc(100vw * 0.3))"
1797
1953
  }
1798
- ], wn = [
1954
+ ], sn = [
1799
1955
  {
1800
1956
  transform: "translateY(100vh)"
1801
1957
  },
1802
1958
  {
1803
1959
  transform: "translateY(0vh)"
1804
1960
  }
1805
- ], je = [
1961
+ ], Se = [
1806
1962
  {
1807
1963
  transform: "translateY(100vh)"
1808
1964
  },
1809
1965
  {
1810
1966
  transform: "translateY(0vh)"
1811
1967
  }
1812
- ], En = [
1968
+ ], an = [
1813
1969
  {
1814
1970
  transform: "translateY(0vh)"
1815
1971
  },
1816
1972
  {
1817
1973
  transform: "translateY(-50vh)"
1818
1974
  }
1819
- ], Pn = [
1975
+ ], on = [
1820
1976
  {
1821
1977
  transform: "translateY(-100vh)"
1822
1978
  },
1823
1979
  {
1824
1980
  transform: "translateY(0vh)"
1825
1981
  }
1826
- ], bn = [
1982
+ ], cn = [
1827
1983
  {
1828
1984
  transform: "translateY(0vh)"
1829
1985
  },
1830
1986
  {
1831
1987
  transform: "translateY(50vh)"
1832
1988
  }
1833
- ], Sn = [
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
- ], _n = [
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
- ], Ln = [
2007
+ ], ln = [
1852
2008
  {
1853
2009
  opacity: 0
1854
2010
  },
1855
2011
  {
1856
2012
  opacity: 1
1857
2013
  }
1858
- ], Tn = [
2014
+ ], dn = [
1859
2015
  {
1860
2016
  opacity: 1
1861
2017
  },
1862
2018
  {
1863
2019
  opacity: 0
1864
2020
  }
1865
- ], Ne = [
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
- ], $e = [
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
- ], Ve = [
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
- ], We = [
2056
+ ], Le = [
1901
2057
  {
1902
2058
  transform: "translateY(100vh)"
1903
2059
  },
1904
2060
  {
1905
2061
  transform: "translateY(0vh)"
1906
2062
  }
1907
- ], Ge = [
2063
+ ], Te = [
1908
2064
  {
1909
2065
  transform: "translateY(0vh)"
1910
2066
  },
1911
2067
  {
1912
2068
  transform: "translateY(-2vh)"
1913
2069
  }
1914
- ], qe = [
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
- ], ze = [
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
- ], Ze = [
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 Je(n) {
1959
- return (t) => 1 - n(1 - t);
2114
+ function ke(s) {
2115
+ return (t) => 1 - s(1 - t);
1960
2116
  }
1961
- function Qe(n) {
1962
- return (t) => Math.pow(t, n);
2117
+ function De(s) {
2118
+ return (t) => Math.pow(t, s);
1963
2119
  }
1964
- const st = {
1965
- ...Bt({
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
- }, gt = {
2128
+ }, Et = {
1973
2129
  duration: 350,
1974
- easing: q(Je(Qe(5)))
1975
- }, tn = {
2130
+ easing: et(ke(De(5)))
2131
+ }, Fe = {
1976
2132
  duration: 150,
1977
2133
  easing: "linear"
1978
- }, en = {
2134
+ }, Oe = {
1979
2135
  duration: 425,
1980
2136
  easing: "cubic-bezier(0.35, 0.45, 0, 1)"
1981
- }, nn = {
2137
+ }, Be = {
1982
2138
  duration: 400,
1983
2139
  easing: "cubic-bezier(0.35, 0.45, 0, 1)"
1984
- }, rn = {
2140
+ }, Ke = {
1985
2141
  duration: 250,
1986
- easing: q((n) => Math.cos((n + 1) * Math.PI) / 2 + 0.5)
1987
- }, sn = {
2142
+ easing: et((s) => Math.cos((s + 1) * Math.PI) / 2 + 0.5)
2143
+ }, Me = {
1988
2144
  duration: 200,
1989
- easing: q((n) => n === 1 ? 1 : Math.pow(n, 2))
2145
+ easing: et((s) => s === 1 ? 1 : Math.pow(s, 2))
1990
2146
  };
1991
- function Rn({ ref: n, direction: t, playbackRate: e, index: r }) {
1992
- let i = [
1993
- Ue,
1994
- Ce
1995
- ][r];
1996
- const a = {
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
- ...st
2155
+ ...rt
2000
2156
  };
2001
- return t === "reverse" && (i = i.toReversed()), new KeyframeEffect(n, i, a);
2157
+ return t === "reverse" && (a = a.toReversed()), new KeyframeEffect(s, a, u);
2002
2158
  }
2003
- function kn({ ref: n, direction: t, playbackRate: e, index: r }) {
2004
- let i = [
2005
- Ae,
2006
- He
2007
- ][r];
2008
- const a = {
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
- ...st
2167
+ ...rt
2012
2168
  };
2013
- return t === "reverse" && (i = i.toReversed()), new KeyframeEffect(n, i, a);
2169
+ return t === "reverse" && (a = a.toReversed()), new KeyframeEffect(s, a, u);
2014
2170
  }
2015
- function In({ ref: n, direction: t, playbackRate: e }) {
2016
- let r = je;
2017
- const s = {
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
- ...st
2176
+ ...rt
2021
2177
  };
2022
- return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(n, r, s);
2178
+ return t === "reverse" && (n = n.toReversed()), new KeyframeEffect(s, n, r);
2023
2179
  }
2024
- function Fn({ ref: n, direction: t, playbackRate: e }) {
2025
- let r = Ne;
2026
- const s = {
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
- ...gt
2185
+ ...Et
2030
2186
  };
2031
- return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(n, r, s);
2187
+ return t === "reverse" && (n = n.toReversed()), new KeyframeEffect(s, n, r);
2032
2188
  }
2033
- function xn({ ref: n, direction: t, index: e, playbackRate: r }) {
2034
- let s = Ze, i;
2035
- e === C ? i = sn : i = rn;
2036
- const a = {
2037
- playbackRate: r,
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
- ...i
2195
+ ...a
2040
2196
  };
2041
- return t === "reverse" && (s = s.toReversed()), new KeyframeEffect(n, s, a);
2197
+ return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(s, r, u);
2042
2198
  }
2043
- function Dn({ ref: n, direction: t, index: e, playbackRate: r }) {
2044
- const i = [
2045
- Ge,
2046
- We
2047
- ][e], a = {
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: r,
2205
+ playbackRate: n,
2050
2206
  fill: "forwards",
2051
- ...en
2207
+ ...Oe
2052
2208
  };
2053
- return new KeyframeEffect(n, i, a);
2209
+ return new KeyframeEffect(s, a, u);
2054
2210
  }
2055
- function On({ ref: n, direction: t, index: e, playbackRate: r }) {
2056
- const s = [
2057
- Ve,
2058
- $e
2211
+ function En({ ref: s, direction: t, index: e, playbackRate: n }) {
2212
+ const r = [
2213
+ _e,
2214
+ be
2059
2215
  ];
2060
- let i;
2061
- e === C ? i = tn : i = gt;
2062
- let a = s[e];
2063
- const c = {
2064
- playbackRate: r,
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
- ...i
2222
+ ...a
2067
2223
  };
2068
- return t === "reverse" && (a = a.toReversed()), new KeyframeEffect(n, a, c);
2224
+ return t === "reverse" && (u = u.toReversed()), new KeyframeEffect(s, u, i);
2069
2225
  }
2070
- function Mn({ ref: n, direction: t, index: e, playbackRate: r }) {
2071
- const i = [
2072
- ze,
2073
- qe
2074
- ][e], a = {
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: r,
2232
+ playbackRate: n,
2077
2233
  fill: "forwards",
2078
- ...nn
2234
+ ...Be
2079
2235
  };
2080
- return new KeyframeEffect(n, i, a);
2236
+ return new KeyframeEffect(s, a, u);
2081
2237
  }
2082
2238
  export {
2083
- vn as Anchor,
2084
- Ln as FadeInKeyframes,
2085
- Tn as FadeOutKeyframes,
2086
- Ke as GestureRegion,
2087
- vt as HistoryEntry,
2088
- Se as Navigation,
2089
- hn as Router,
2090
- rt as Screen,
2091
- wn as SlideInFromBottomKeyframes,
2092
- mn as SlideInFromLeftKeyframes,
2093
- gn as SlideInFromRightKeyframes,
2094
- Pn as SlideInFromTopKeyframes,
2095
- bn as SlideOutToBottomKeyframes,
2096
- pn as SlideOutToLeftKeyframes,
2097
- yn as SlideOutToRightKeyframes,
2098
- En as SlideOutToTopKeyframes,
2099
- Sn as ZoomInKeyframes,
2100
- _n as ZoomOutKeyframes,
2101
- rn as androidBottomSheetSlideInOptions,
2102
- sn as androidBottomSheetSlideOutOptions,
2103
- Ge as androidConcealToBottomKeyframes,
2104
- Fn as androidFadeInFromBottom,
2105
- Ne as androidFadeInFromBottomKeyframes,
2106
- gt as androidFadeInFromBottomOptions,
2107
- xn as androidFadeInFromBottomSheet,
2108
- Ze as androidFadeInFromBottomSheetKeyframes,
2109
- On as androidFadeInFromRight,
2110
- $e as androidFadeInFromRightKeyframes,
2111
- tn as androidFadeOutToBottomOptions,
2112
- Ve as androidFadeOutToLeftKeyframes,
2113
- Dn as androidRevealFromBottom,
2114
- We as androidRevealFromBottomKeyframes,
2115
- en as androidRevealFromBottomOptions,
2116
- Mn as androidScaleFromCentre,
2117
- qe as androidScaleFromCentreKeyframes,
2118
- nn as androidScaleFromCentreOptions,
2119
- ze as androidScaleToCentreKeyframes,
2120
- Me as createGestureRegion,
2121
- st as iOSKeyframeOptions,
2122
- In as iOSSlideInFromBottom,
2123
- je as iOSSlideInFromBottomKeyframes,
2124
- kn as iOSSlideInFromLeft,
2125
- He as iOSSlideInFromLeftKeyframes,
2126
- Rn as iOSSlideInFromRight,
2127
- Ce as iOSSlideInFromRightKeyframes,
2128
- Ue as iOSSlideOutToLeftKeyframes,
2129
- Ae as iOSSlideOutToRightKeyframes,
2130
- Fe as isHorizontalDirection,
2131
- F as isRefObject,
2132
- Ie as isSupportedDirection,
2133
- Be as useNavigation,
2134
- fn as useParams,
2135
- dn as useRoute,
2136
- ln as useRouter
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