@react-motion-router/stack 2.0.0-beta.sha-9f3bd9a → 2.0.0-beta.sha-bcb6b06

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,14 +1,14 @@
1
- import { NavigationBase as dt, resolveBaseURLFromPattern as ft, includesRoute as ut, ScreenBase as vt, matchRoute as N, RouterBase as gt, cloneAndInject as pt, useNavigationBase as mt, useRouterBase as yt, useRouteBase as wt, useParamsBase as Et } from "@react-motion-router/core";
2
- import { createRef as Pt, startTransition as U, useDebugValue as C, useEffect as Y, useState as St, useRef as $, useCallback as bt } from "react";
1
+ import { NavigationBase as ht, resolveBaseURLFromPattern as dt, matchRoute as Y, ScreenBase as ft, RouterBase as vt, cloneAndInject as gt, includesRoute as pt, useNavigationBase as mt, useRouterBase as yt, useRouteBase as wt, useParamsBase as Et } from "@react-motion-router/core";
2
+ import { createRef as Pt, startTransition as N, useDebugValue as j, useEffect as X, useState as St, useRef as $, useCallback as bt } from "react";
3
3
  import { GestureTimeline as _t, springToLinear as Lt, easingToLinear as A } from "web-animations-extension";
4
- import { jsx as lt } from "react/jsx-runtime";
4
+ import { jsx as ut } from "react/jsx-runtime";
5
5
  var g = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Tt = {}, T = {};
6
6
  Object.defineProperty(T, "__esModule", { value: !0 });
7
7
  var rt;
8
8
  (function(n) {
9
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
10
  })(rt || (rt = {}));
11
- class kt extends TouchEvent {
11
+ class Rt extends TouchEvent {
12
12
  constructor(t, e) {
13
13
  if (super(t, {
14
14
  touches: Array.from(e.touches),
@@ -27,12 +27,12 @@ class kt extends TouchEvent {
27
27
  this.gestureTarget = e.touches[0].target, this.x = e.touches[0].clientX, this.y = e.touches[0].clientY;
28
28
  }
29
29
  }
30
- T.default = kt;
31
- var W = {}, Rt = g && g.__importDefault || function(n) {
30
+ T.default = Rt;
31
+ var W = {}, kt = g && g.__importDefault || function(n) {
32
32
  return n && n.__esModule ? n : { default: n };
33
33
  };
34
34
  Object.defineProperty(W, "__esModule", { value: !0 });
35
- const It = Rt(T);
35
+ const It = kt(T);
36
36
  class xt extends It.default {
37
37
  constructor(t, e) {
38
38
  super("longpress", t), this.duration = 0, this.duration = e;
@@ -255,14 +255,14 @@ class ne extends Q {
255
255
  }
256
256
  }
257
257
  K.RotateEndEvent = ne;
258
- var k = {};
259
- Object.defineProperty(k, "__esModule", { value: !0 });
260
- k.closest = k.Vec2 = k.assert = void 0;
258
+ var R = {};
259
+ Object.defineProperty(R, "__esModule", { value: !0 });
260
+ R.closest = R.Vec2 = R.assert = void 0;
261
261
  function re(n, t) {
262
262
  if (!n)
263
263
  throw new Error(t);
264
264
  }
265
- k.assert = re;
265
+ R.assert = re;
266
266
  class se {
267
267
  constructor(t, e) {
268
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);
@@ -307,45 +307,45 @@ class se {
307
307
  return Math.sqrt(Math.pow(this._clientX, 2) + Math.pow(this._clientY, 2));
308
308
  }
309
309
  }
310
- k.Vec2 = se;
310
+ R.Vec2 = se;
311
311
  function ie(n, t) {
312
312
  return t.reduce((e, r) => {
313
313
  let s = Math.abs(e - n), i = Math.abs(r - n);
314
314
  return s === i ? e > r ? e : r : i < s ? r : e;
315
315
  });
316
316
  }
317
- k.closest = ie;
317
+ R.closest = ie;
318
318
  (function(n) {
319
- var t = g && g.__createBinding || (Object.create ? function(c, a, l, m) {
320
- m === void 0 && (m = l), Object.defineProperty(c, m, { enumerable: !0, get: function() {
321
- return a[l];
319
+ var t = g && g.__createBinding || (Object.create ? function(u, a, h, m) {
320
+ m === void 0 && (m = h), Object.defineProperty(u, m, { enumerable: !0, get: function() {
321
+ return a[h];
322
322
  } });
323
- } : function(c, a, l, m) {
324
- m === void 0 && (m = l), c[m] = a[l];
325
- }), e = g && g.__setModuleDefault || (Object.create ? function(c, a) {
326
- Object.defineProperty(c, "default", { enumerable: !0, value: a });
327
- } : function(c, a) {
328
- c.default = a;
329
- }), r = g && g.__importStar || function(c) {
330
- if (c && c.__esModule)
331
- return c;
323
+ } : function(u, a, h, m) {
324
+ m === void 0 && (m = h), u[m] = a[h];
325
+ }), e = g && g.__setModuleDefault || (Object.create ? function(u, a) {
326
+ Object.defineProperty(u, "default", { enumerable: !0, value: a });
327
+ } : function(u, a) {
328
+ u.default = a;
329
+ }), r = g && g.__importStar || function(u) {
330
+ if (u && u.__esModule)
331
+ return u;
332
332
  var a = {};
333
- if (c != null)
334
- for (var l in c)
335
- l !== "default" && Object.prototype.hasOwnProperty.call(c, l) && t(a, c, l);
336
- return e(a, c), a;
337
- }, s = g && g.__importDefault || function(c) {
338
- return c && c.__esModule ? c : { default: c };
333
+ if (u != null)
334
+ for (var h in u)
335
+ h !== "default" && Object.prototype.hasOwnProperty.call(u, h) && t(a, u, h);
336
+ return e(a, u), a;
337
+ }, s = g && g.__importDefault || function(u) {
338
+ return u && u.__esModule ? u : { default: u };
339
339
  };
340
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
341
  const i = s(T);
342
342
  n.GestureEvent = i.default;
343
343
  const o = s(W);
344
344
  n.LongPressEvent = o.default;
345
- const u = s(q);
346
- n.TapEvent = u.default;
347
- const h = s(G);
348
- n.DoubleTapEvent = h.default;
345
+ const c = s(q);
346
+ n.TapEvent = c.default;
347
+ const l = s(G);
348
+ n.DoubleTapEvent = l.default;
349
349
  const f = r(F);
350
350
  n.SwipeEvent = f.default, Object.defineProperty(n, "SwipeEndEvent", { enumerable: !0, get: function() {
351
351
  return f.SwipeEndEvent;
@@ -370,10 +370,10 @@ k.closest = ie;
370
370
  } }), Object.defineProperty(n, "RotateStartEvent", { enumerable: !0, get: function() {
371
371
  return w.RotateStartEvent;
372
372
  } });
373
- const v = k;
373
+ const v = R;
374
374
  var p;
375
- (function(c) {
376
- c[c.right = 0] = "right", c[c.up = 1] = "up", c[c.left = 2] = "left", c[c.down = 3] = "down";
375
+ (function(u) {
376
+ u[u.right = 0] = "right", u[u.up = 1] = "up", u[u.left = 2] = "left", u[u.down = 3] = "down";
377
377
  })(p || (p = {}));
378
378
  class y {
379
379
  constructor() {
@@ -396,34 +396,34 @@ k.closest = ie;
396
396
  onPointerLeave(a) {
397
397
  if (!a.touches.length) {
398
398
  if (this.isSwiping) {
399
- const l = new f.SwipeEndEvent(a, {
399
+ const h = new f.SwipeEndEvent(a, {
400
400
  velocity: this.velocity,
401
401
  direction: p[(0, v.closest)(this.octant, [0, 1, 2, 3])]
402
402
  });
403
- this.dispatchEvent(l), this.isSwiping = !1;
403
+ this.dispatchEvent(h), this.isSwiping = !1;
404
404
  }
405
405
  if (this.isPanning) {
406
- const l = new d.PanEndEvent(a, {
406
+ const h = new d.PanEndEvent(a, {
407
407
  translation: this.dxDy,
408
408
  velocity: this.velocity
409
409
  });
410
- this.dispatchEvent(l), this.isPanning = !1;
410
+ this.dispatchEvent(h), this.isPanning = !1;
411
411
  }
412
412
  }
413
413
  if (a.touches.length === 1) {
414
414
  if (this.scaleBase = 0, this.isPinching) {
415
- const l = new P.PinchEndEvent(a, {
415
+ const h = new P.PinchEndEvent(a, {
416
416
  scale: this.scale
417
417
  });
418
- this.dispatchEvent(l), this.isPinching = !1;
418
+ this.dispatchEvent(h), this.isPinching = !1;
419
419
  }
420
420
  if (this.isRotating) {
421
- const l = new w.RotateEndEvent(a, {
421
+ const h = new w.RotateEndEvent(a, {
422
422
  rotation: this.rotation,
423
423
  rotationDeg: this.rotationDeg,
424
424
  anchor: this.anchor
425
425
  });
426
- this.dispatchEvent(l), this.isRotating = !1;
426
+ this.dispatchEvent(h), this.isRotating = !1;
427
427
  }
428
428
  }
429
429
  }
@@ -434,8 +434,8 @@ k.closest = ie;
434
434
  }
435
435
  onTouchStart(a) {
436
436
  this.currentTarget !== a.touches[0].target && (this.clean(), this.unbind(this.currentTarget), this.pointers = this.touchEnd.touches.length, this.taps = 0), this.touchStart = a;
437
- const l = parseInt(a.touches[0].target.dataset.minpointers || "0") || this.config.minPointers;
438
- if (this.touchStart.touches.length < l) {
437
+ const h = parseInt(a.touches[0].target.dataset.minpointers || "0") || this.config.minPointers;
438
+ if (this.touchStart.touches.length < h) {
439
439
  this.shouldFire = !1;
440
440
  return;
441
441
  }
@@ -456,23 +456,23 @@ k.closest = ie;
456
456
  if (!this.shouldFire)
457
457
  return;
458
458
  if (this.touchMoved = !0, this.touchMove = a, a.touches.length > 1 && this.touchStart.touches.length > 1 && (a.touches[1].clientX !== this.touchStart.touches[1].clientX || a.touches[1].clientY !== this.touchStart.touches[1].clientY)) {
459
- const _ = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY), j = new v.Vec2(this.touchMove.touches[1].clientX, this.touchMove.touches[1].clientY), et = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), nt = _.substract(j);
459
+ const _ = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY), H = new v.Vec2(this.touchMove.touches[1].clientX, this.touchMove.touches[1].clientY), et = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), nt = _.substract(H);
460
460
  if (this.scaleBase && Math.abs(this.scaleBase - nt.magnitude) > 10) {
461
461
  const I = nt.magnitude / this.scaleBase;
462
462
  if (this.scale = I, this.isPinching) {
463
- const H = new P.default(a, {
463
+ const U = new P.default(a, {
464
464
  scale: I
465
465
  });
466
- this.dispatchEvent(H);
466
+ this.dispatchEvent(U);
467
467
  } else {
468
- const H = new P.PinchStartEvent(a, {
468
+ const U = new P.PinchStartEvent(a, {
469
469
  scale: I
470
470
  });
471
- this.dispatchEvent(H), this.isPinching = !0;
471
+ this.dispatchEvent(U), this.isPinching = !0;
472
472
  }
473
473
  }
474
474
  this.anchor = _;
475
- let B = Math.atan2(et.clientY - j.clientY, et.clientX - j.clientX);
475
+ let B = Math.atan2(et.clientY - H.clientY, et.clientX - H.clientX);
476
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
477
  const I = new w.default(a, {
478
478
  anchor: this.anchor,
@@ -489,12 +489,12 @@ k.closest = ie;
489
489
  this.dispatchEvent(I), this.isRotating = !0;
490
490
  }
491
491
  }
492
- const l = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), E = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY).substract(l), b = E.magnitude, R = {
492
+ const h = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), E = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY).substract(h), b = E.magnitude, k = {
493
493
  x: E.x / b,
494
494
  y: E.y / b
495
- }, S = Math.atan2(R.y, R.x);
495
+ }, S = Math.atan2(k.y, k.x);
496
496
  this.octant = Math.round(4 * S / (2 * Math.PI) + 4) % 4;
497
- const X = (a.timeStamp - this.touchStart.timeStamp) / 1e3, M = E.magnitude / X;
497
+ const C = (a.timeStamp - this.touchStart.timeStamp) / 1e3, M = E.magnitude / C;
498
498
  if (this.isSwiping) {
499
499
  const _ = new f.default(a, {
500
500
  direction: p[(0, v.closest)(this.octant, [0, 1, 2, 3])],
@@ -523,17 +523,17 @@ k.closest = ie;
523
523
  }
524
524
  }
525
525
  onTouchEnd(a) {
526
- const l = parseInt(this.currentTarget.dataset.numberoftaps || "0") || this.config.numberOfTaps;
527
- if (this.taps++, this.shouldFire = this.taps > l, this.shouldFire) {
526
+ const h = parseInt(this.currentTarget.dataset.numberoftaps || "0") || this.config.numberOfTaps;
527
+ if (this.taps++, this.shouldFire = this.taps > h, this.shouldFire) {
528
528
  this.touchEnd = a, this.touchEndTime = a.timeStamp;
529
529
  const m = parseFloat(this.currentTarget.dataset.tapdelay || "0") || this.config.tapDelay;
530
530
  if (!this.touchMoved && !this.isLongPress)
531
531
  if (this.taps === 1 || this.touchEndTime - this.lastTouchTime < m) {
532
- if (this.taps % 2 === l) {
533
- const b = new h.default(a);
532
+ if (this.taps % 2 === h) {
533
+ const b = new l.default(a);
534
534
  this.dispatchEvent(b), this.taps = 0;
535
535
  }
536
- const E = new u.default(a);
536
+ const E = new c.default(a);
537
537
  this.dispatchEvent(E);
538
538
  } else
539
539
  this.taps = 0;
@@ -554,8 +554,8 @@ class ae extends Event {
554
554
  signal;
555
555
  committed;
556
556
  transition;
557
- constructor(t, e, r, s, i, o, u) {
558
- super("navigate"), this.routerId = t, this.route = e, this.props = r, this.navigationType = s ?? "push", this.signal = i, this.committed = o, this.transition = u;
557
+ constructor(t, e, r, s, i, o, c) {
558
+ super("navigate"), this.routerId = t, this.route = e, this.props = r, this.navigationType = s ?? "push", this.signal = i, this.committed = o, this.transition = c;
559
559
  }
560
560
  }
561
561
  class oe extends Event {
@@ -634,7 +634,7 @@ class de {
634
634
  return this.#t.getState();
635
635
  }
636
636
  }
637
- class fe extends dt {
637
+ class fe extends ht {
638
638
  router;
639
639
  constructor(t) {
640
640
  super(), this.router = t;
@@ -652,15 +652,15 @@ class fe extends dt {
652
652
  return window.navigation.reload({ state: t });
653
653
  }
654
654
  traverseTo(t, e = {}) {
655
- const r = window.navigation.traverseTo(t), s = window.navigation.transition, i = s.from.index, o = window.navigation.entries().findIndex((f) => f.key === t), u = new AbortController();
656
- u.signal.addEventListener("abort", () => this.traverseTo(s.from.key), { once: !0 }), e.signal?.addEventListener("abort", u.abort, { once: !0 });
657
- let h;
658
- return i > o ? h = this.createBackEvent(u.signal, r.committed, s) : h = this.createForwardEvent(u.signal, r.committed, s), this.dispatchEvent?.(h), r;
655
+ const r = window.navigation.traverseTo(t), s = window.navigation.transition, i = s.from.index, o = window.navigation.entries().findIndex((f) => f.key === t), c = new AbortController();
656
+ c.signal.addEventListener("abort", () => this.traverseTo(s.from.key), { once: !0 }), e.signal?.addEventListener("abort", c.abort, { once: !0 });
657
+ let l;
658
+ return i > o ? l = this.createBackEvent(c.signal, r.committed, s) : l = this.createForwardEvent(c.signal, r.committed, s), this.dispatchEvent?.(l), r;
659
659
  }
660
660
  navigate(t, e = {}, r = {}) {
661
- const { type: s = "push" } = r, i = new URL(t, this.baseURL), o = window.navigation.navigate(i.href, { history: s, state: e }), u = window.navigation.transition, h = new AbortController();
662
- h.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), r.signal?.addEventListener("abort", h.abort, { once: !0 });
663
- const f = this.createNavigateEvent(t, e, s, h.signal, o.committed, u);
661
+ const { type: s = "push" } = r, i = new URL(t, this.baseURL), o = window.navigation.navigate(i.href, { history: s, state: e }), c = window.navigation.transition, l = new AbortController();
662
+ l.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), r.signal?.addEventListener("abort", l.abort, { once: !0 });
663
+ const f = this.createNavigateEvent(t, e, s, l.signal, o.committed, c);
664
664
  return this.dispatchEvent?.(f), o;
665
665
  }
666
666
  goBack(t = {}) {
@@ -712,14 +712,33 @@ class fe extends dt {
712
712
  return window.navigation.entries();
713
713
  }
714
714
  get entries() {
715
- const t = this.router.pathPatterns.filter(({ pattern: r }) => r.endsWith("**"));
716
- let e = !1;
717
- return this.globalEntries.filter((r) => {
718
- if (!r.url)
715
+ const t = this.router.pathPatterns.filter(({ pattern: s }) => s.endsWith("**"));
716
+ let e = null, r = !1;
717
+ return this.globalEntries.filter((s) => {
718
+ if (!s.url)
719
719
  return !1;
720
- const s = new URL(r.url);
721
- return ft(this.baseURLPattern.pathname, s.pathname) ? ut(t, s.pathname, this.baseURLPattern.pathname) ? e ? !1 : e = !0 : (e = !1, !0) : !1;
722
- }).map((r, s) => new de(r, this.routerId, s));
720
+ const i = new URL(s.url), o = dt(this.baseURLPattern.pathname, i.pathname);
721
+ if (!o)
722
+ return !1;
723
+ if (e) {
724
+ const c = new URLPattern(e.pattern, o.href);
725
+ if (Y(
726
+ i.pathname,
727
+ i.pathname,
728
+ c.pathname,
729
+ e.caseSensitive
730
+ ) || r)
731
+ return r = !0, !1;
732
+ }
733
+ return e = t.find(
734
+ ({ pattern: c, caseSensitive: l }) => Y(
735
+ c,
736
+ i.pathname,
737
+ this.baseURLPattern.pathname,
738
+ l
739
+ )
740
+ ) ?? null, !0;
741
+ }).map((s, i) => new de(s, this.routerId, i));
723
742
  }
724
743
  get index() {
725
744
  const t = window.navigation.currentEntry?.index ?? -1, e = this.entries.at(0)?.globalIndex ?? -1, r = this.entries.at(-1)?.globalIndex ?? -1;
@@ -773,7 +792,7 @@ function V(n, t) {
773
792
  return !1;
774
793
  return !0;
775
794
  }
776
- class Je extends vt {
795
+ class Je extends ft {
777
796
  #t;
778
797
  constructor(t, e) {
779
798
  super(t, e);
@@ -789,7 +808,7 @@ class Je extends vt {
789
808
  super.setParams(t), this.setHistoryState(({ params: e }) => ({ params: { ...e, ...t } }));
790
809
  }
791
810
  setConfig(t) {
792
- super.setConfig(t), delete t.footer, delete t.header, delete t.onEnter, delete t.onEntered, delete t.onExit, delete t.onExited, this.setHistoryState(({ config: e }) => ({ config: { ...e, ...t } }));
811
+ super.setConfig(t), delete t.footer, delete t.header, delete t.onEnter, delete t.onEntered, delete t.onExit, delete t.onExited, delete t.animation, console.log(t), this.setHistoryState(({ config: e }) => ({ config: { ...e, ...t } }));
793
812
  }
794
813
  get router() {
795
814
  return this.context;
@@ -803,7 +822,7 @@ class Je extends vt {
803
822
  get historyEntryState() {
804
823
  const t = this.#t;
805
824
  if (t?.url) {
806
- const e = t.getState() ?? {}, r = ve(t.url.searchParams), s = N(
825
+ const e = t.getState() ?? {}, r = ve(t.url.searchParams), s = Y(
807
826
  this.props.path,
808
827
  t.url.pathname,
809
828
  this.context.baseURLPattern.pathname,
@@ -835,12 +854,12 @@ class Je extends vt {
835
854
  };
836
855
  }
837
856
  get routeProp() {
838
- const t = this.setParams.bind(this), e = this.setConfig.bind(this), { path: r } = this.props, { focused: s } = this.state, { params: i, config: o, resolvedPathname: u } = this;
857
+ const t = this.setParams.bind(this), e = this.setConfig.bind(this), { path: r } = this.props, { focused: s } = this.state, { params: i, config: o, resolvedPathname: c } = this;
839
858
  return {
840
859
  setParams: t,
841
860
  setConfig: e,
842
861
  path: r,
843
- resolvedPathname: u,
862
+ resolvedPathname: c,
844
863
  focused: s,
845
864
  params: i,
846
865
  config: o
@@ -866,7 +885,7 @@ class Je extends vt {
866
885
  onEnter(t) {
867
886
  if (this.transitionProvider.current?.ref.current instanceof HTMLDialogElement && this.transitionProvider.current.ref.current.open === !1) {
868
887
  const e = this.context?.navigation;
869
- this.props.config?.presentation === "modal" ? this.transitionProvider.current.ref.current.showModal() : this.transitionProvider.current.ref.current.show(), this.transitionProvider.current.ref.current.style.maxHeight = "unset", this.transitionProvider.current.ref.current.style.maxWidth = "unset", this.transitionProvider.current.ref.current.style.width = "max-content", this.transitionProvider.current.ref.current.style.height = "max-content", this.ref.current && (this.ref.current.style.width = "max-content", this.ref.current.style.height = "max-content");
888
+ this.props.config?.presentation === "modal" ? this.transitionProvider.current.ref.current.showModal() : this.transitionProvider.current.ref.current.show(), this.transitionProvider.current.ref.current.style.maxHeight = "unset", this.transitionProvider.current.ref.current.style.maxWidth = "unset", this.transitionProvider.current.ref.current.style.width = "max-content", this.transitionProvider.current.ref.current.style.height = "max-content";
870
889
  const r = this.onClickOutside.bind(this);
871
890
  this.transitionProvider.current?.ref.current.addEventListener("close", function() {
872
891
  this.returnValue !== "screen-exit" && (this.style.display = "block", e?.goBack()), e?.removeEventListener("click", r);
@@ -924,7 +943,7 @@ class be {
924
943
  }), this.nativeReject?.(t);
925
944
  }
926
945
  }
927
- class Qe extends gt {
946
+ class Qe extends vt {
928
947
  navigation = new fe(this);
929
948
  #t = null;
930
949
  constructor(t, e) {
@@ -934,7 +953,7 @@ class Qe extends gt {
934
953
  gestureDirection: s = L.gestureDirection,
935
954
  gestureDisabled: i = L.gestureDisabled,
936
955
  gestureHysteresis: o = L.gestureHysteresis,
937
- gestureMinFlingVelocity: u = L.gestureMinFlingVelocity
956
+ gestureMinFlingVelocity: c = L.gestureMinFlingVelocity
938
957
  } = t.config?.screenConfig ?? {};
939
958
  this.state = {
940
959
  screenStack: [],
@@ -942,7 +961,7 @@ class Qe extends gt {
942
961
  gestureAreaWidth: r,
943
962
  gestureHysteresis: o,
944
963
  gestureDisabled: i,
945
- gestureMinFlingVelocity: u,
964
+ gestureMinFlingVelocity: c,
946
965
  transition: null,
947
966
  documentTitle: document.title,
948
967
  fromKey: null,
@@ -1080,16 +1099,16 @@ class Qe extends gt {
1080
1099
  const { child: s, matchInfo: i } = this.screenChildFromPathname(t) ?? {};
1081
1100
  if (!s)
1082
1101
  return Promise.resolve(!1);
1083
- const { navigation: o } = this, { signal: u } = r, { path: h } = s.props;
1102
+ const { navigation: o } = this, { signal: c } = r, { path: l } = s.props;
1084
1103
  return await Promise.all([
1085
1104
  this.preloadScreen(s),
1086
1105
  s.props.config?.onLoad?.({
1087
1106
  navigation: o,
1088
- signal: u,
1107
+ signal: c,
1089
1108
  preloading: !0,
1090
1109
  route: {
1091
1110
  focused: !1,
1092
- path: h,
1111
+ path: l,
1093
1112
  resolvedPathname: t,
1094
1113
  config: {
1095
1114
  ...this.props.config?.screenConfig,
@@ -1107,7 +1126,7 @@ class Qe extends gt {
1107
1126
  }
1108
1127
  cloneScreenChildFromPathname(t, e) {
1109
1128
  const { child: r } = this.screenChildFromPathname(t) ?? {};
1110
- return r ? (e ??= crypto.randomUUID(), pt(r, {
1129
+ return r ? (e ??= crypto.randomUUID(), gt(r, {
1111
1130
  config: {
1112
1131
  title: document.title,
1113
1132
  ...this.props.config?.screenConfig,
@@ -1127,7 +1146,7 @@ class Qe extends gt {
1127
1146
  }
1128
1147
  canIntercept(t) {
1129
1148
  const e = new URL(t.destination.url).pathname, r = this.baseURLPattern.pathname;
1130
- return this.mounted && this.shouldIntercept(t) && ut(this.pathPatterns, e, r);
1149
+ return this.mounted && this.shouldIntercept(t) && pt(this.pathPatterns, e, r);
1131
1150
  }
1132
1151
  shouldIntercept(t) {
1133
1152
  return t.canIntercept && !t.formData && !t.hashChange && !t.downloadRequest || !!this.props.config?.shouldIntercept?.(t);
@@ -1149,24 +1168,24 @@ class Qe extends gt {
1149
1168
  }
1150
1169
  handleLoad(t) {
1151
1170
  const e = () => {
1152
- const r = t.transition?.from?.key ?? null, s = t.destination.key, i = t.transition, o = [], u = this.navigation.entries;
1153
- return u.forEach((h) => {
1154
- if (!h.url)
1171
+ const r = t.transition?.from?.key ?? null, s = t.destination.key, i = t.transition, o = [], c = this.navigation.entries;
1172
+ return c.forEach((l) => {
1173
+ if (!l.url)
1155
1174
  return null;
1156
1175
  const f = this.cloneScreenChildFromPathname(
1157
- h.url.pathname,
1158
- h.key
1176
+ l.url.pathname,
1177
+ l.key
1159
1178
  );
1160
1179
  if (!f)
1161
1180
  return null;
1162
1181
  o.push(f);
1163
1182
  }), new Promise(
1164
- (h, f) => U(() => {
1183
+ (l, f) => N(() => {
1165
1184
  this.setState(
1166
1185
  { screenStack: o, fromKey: r, transition: i, destinationKey: s },
1167
1186
  async () => {
1168
- const { initialPathname: d } = this.props.config ?? {}, [P] = u;
1169
- if (d && u.length === 1 && P.url && !N(
1187
+ const { initialPathname: d } = this.props.config ?? {}, [P] = c;
1188
+ if (d && c.length === 1 && P.url && !Y(
1170
1189
  d,
1171
1190
  P.url.pathname,
1172
1191
  this.baseURLPattern.pathname
@@ -1176,7 +1195,7 @@ class Qe extends gt {
1176
1195
  const y = t.destination.getState() ?? {};
1177
1196
  this.navigation.push(t.destination.url, y);
1178
1197
  });
1179
- }), h();
1198
+ }), l();
1180
1199
  const w = t.signal;
1181
1200
  this.navigation.current?.key === void 0 && f(new Error("Current key is undefined"));
1182
1201
  const v = this.getScreenRefByKey(
@@ -1188,7 +1207,7 @@ class Qe extends gt {
1188
1207
  w
1189
1208
  ).catch(f), this.setState(
1190
1209
  { destinationKey: null, fromKey: null, transition: null },
1191
- h
1210
+ l
1192
1211
  );
1193
1212
  }
1194
1213
  );
@@ -1204,30 +1223,30 @@ class Qe extends gt {
1204
1223
  );
1205
1224
  if (!o)
1206
1225
  return t.preventDefault();
1207
- const u = () => {
1208
- const h = this.state.transition !== null, f = this.state.transition ?? window.navigation.transition, d = f?.from?.key ?? null, P = e.findIndex(
1226
+ const c = () => {
1227
+ const l = this.state.transition !== null, f = this.state.transition ?? window.navigation.transition, d = f?.from?.key ?? null, P = e.findIndex(
1209
1228
  (w) => w.key === this.navigation.current?.key
1210
1229
  );
1211
1230
  return e.splice(P, 1, o), new Promise(
1212
- (w, v) => U(() => {
1231
+ (w, v) => N(() => {
1213
1232
  this.setState(
1214
1233
  { destinationKey: i, fromKey: d, transition: f, screenStack: e },
1215
1234
  async () => {
1216
- const p = t.signal, y = this.getScreenRefByKey(String(d)), c = this.getScreenRefByKey(
1235
+ const p = t.signal, y = this.getScreenRefByKey(String(d)), u = this.getScreenRefByKey(
1217
1236
  String(i)
1218
1237
  ), a = this.dispatchLifecycleHandlers(
1219
- c,
1238
+ u,
1220
1239
  null,
1221
1240
  p
1222
1241
  ).catch(v);
1223
- if (h) {
1224
- const l = this.screenTransitionLayer.current?.animation.currentTime ?? 0;
1242
+ if (l) {
1243
+ const h = this.screenTransitionLayer.current?.animation.currentTime ?? 0;
1225
1244
  this.screenTransitionLayer.current?.animation.cancel(), await new Promise(requestAnimationFrame);
1226
1245
  const m = this.screenTransition(
1227
- c,
1246
+ u,
1228
1247
  y
1229
1248
  );
1230
- m && (m.currentTime = l), m?.updatePlaybackRate(1), await m?.finished.catch(v);
1249
+ m && (m.currentTime = h), m?.updatePlaybackRate(1), await m?.finished.catch(v);
1231
1250
  }
1232
1251
  await a, this.setState(
1233
1252
  { destinationKey: null, fromKey: null, transition: null },
@@ -1238,7 +1257,7 @@ class Qe extends gt {
1238
1257
  })
1239
1258
  );
1240
1259
  };
1241
- t.intercept({ handler: u });
1260
+ t.intercept({ handler: c });
1242
1261
  }
1243
1262
  handleDefault(t) {
1244
1263
  const e = this.state.screenStack, r = t.destination, s = new URL(r.url).pathname;
@@ -1247,17 +1266,17 @@ class Qe extends gt {
1247
1266
  const i = () => {
1248
1267
  if (me(t.info))
1249
1268
  return Promise.resolve();
1250
- const h = window.navigation.transition;
1269
+ const l = window.navigation.transition;
1251
1270
  let f = e.findIndex(
1252
- (p) => p.key === h?.from.key
1271
+ (p) => p.key === l?.from.key
1253
1272
  );
1254
- f === -1 && t.navigationType === "traverse" && (f = e.findIndex((p) => h?.from.url ? N(
1273
+ f === -1 && t.navigationType === "traverse" && (f = e.findIndex((p) => l?.from.url ? Y(
1255
1274
  p.props.path,
1256
- new URL(h.from.url).pathname,
1275
+ new URL(l.from.url).pathname,
1257
1276
  this.baseURLPattern.pathname,
1258
1277
  p.props.caseSensitive
1259
1278
  ) : !1));
1260
- const d = (e[f]?.key || h?.from.key) ?? null, P = e.findIndex(
1279
+ const d = (e[f]?.key || l?.from.key) ?? null, P = e.findIndex(
1261
1280
  (p) => p.key === t.destination.key
1262
1281
  ), w = (e[P]?.key || window.navigation.currentEntry?.key) ?? null;
1263
1282
  if (t.navigationType === "push") {
@@ -1276,19 +1295,19 @@ class Qe extends gt {
1276
1295
  }
1277
1296
  const v = new AbortController();
1278
1297
  return new Promise(
1279
- (p, y) => U(() => {
1298
+ (p, y) => N(() => {
1280
1299
  this.setState(
1281
- { controller: v, destinationKey: w, fromKey: d, transition: h, screenStack: e },
1300
+ { controller: v, destinationKey: w, fromKey: d, transition: l, screenStack: e },
1282
1301
  async () => {
1283
1302
  v.signal.onabort = y;
1284
- const c = t.signal, a = this.getScreenRefByKey(String(d)), l = this.getScreenRefByKey(
1303
+ const u = t.signal, a = this.getScreenRefByKey(String(d)), h = this.getScreenRefByKey(
1285
1304
  String(w)
1286
1305
  ), m = this.dispatchLifecycleHandlers(
1287
- l,
1306
+ h,
1288
1307
  a,
1289
- c
1308
+ u
1290
1309
  ).catch(y), E = this.screenTransition(
1291
- l,
1310
+ h,
1292
1311
  a
1293
1312
  );
1294
1313
  E?.updatePlaybackRate(1), E?.finished.catch(y), await m, this.setState(
@@ -1309,8 +1328,8 @@ class Qe extends gt {
1309
1328
  pe(t.info) ? (o = "after-transition", this.addEventListener("gesture-end", () => t.commit?.(), { once: !0 }), this.addEventListener("gesture-cancel", this.onGestureCancel, {
1310
1329
  once: !0
1311
1330
  })) : o = "immediate";
1312
- const u = { handler: i, commit: o };
1313
- t.intercept(u);
1331
+ const c = { handler: i, commit: o };
1332
+ t.intercept(c);
1314
1333
  }
1315
1334
  async dispatchLifecycleHandlers(t, e, r) {
1316
1335
  let s = !1;
@@ -1339,16 +1358,16 @@ class Qe extends gt {
1339
1358
  }
1340
1359
  }
1341
1360
  function _e() {
1342
- return C("Stack.Navigation"), mt();
1361
+ return j("Stack.Navigation"), mt();
1343
1362
  }
1344
1363
  function tn() {
1345
- return C("Stack.Router"), yt();
1364
+ return j("Stack.Router"), yt();
1346
1365
  }
1347
1366
  function en() {
1348
- return C("Stack.Route"), wt();
1367
+ return j("Stack.Route"), wt();
1349
1368
  }
1350
1369
  function nn(n, t) {
1351
- return C("Stack.Params"), Et(n, t);
1370
+ return j("Stack.Params"), Et(n, t);
1352
1371
  }
1353
1372
  function Le(n) {
1354
1373
  const t = _e();
@@ -1363,7 +1382,7 @@ function Te(n, t = {}) {
1363
1382
  },
1364
1383
  [n]
1365
1384
  );
1366
- return Y(() => {
1385
+ return X(() => {
1367
1386
  const s = new IntersectionObserver(r, t), i = e.current;
1368
1387
  return i && s.observe(i), () => {
1369
1388
  i && s.unobserve(i);
@@ -1371,7 +1390,7 @@ function Te(n, t = {}) {
1371
1390
  }, [r, t]), e;
1372
1391
  }
1373
1392
  function ct(n, t, e, r) {
1374
- Y(() => {
1393
+ X(() => {
1375
1394
  const s = n.current;
1376
1395
  if (s)
1377
1396
  return s.addEventListener(t, e, r), () => {
@@ -1379,7 +1398,7 @@ function ct(n, t, e, r) {
1379
1398
  };
1380
1399
  }, [n, t, e, r]);
1381
1400
  }
1382
- function ke(n, { forceThreshold: t = Se } = {}) {
1401
+ function Re(n, { forceThreshold: t = Se } = {}) {
1383
1402
  const e = $(null), r = () => n(!0), s = (i) => {
1384
1403
  const o = i.touches[0];
1385
1404
  o && o.force >= t && n(!0);
@@ -1394,59 +1413,59 @@ function rn({
1394
1413
  href: s,
1395
1414
  navigation: i,
1396
1415
  onClick: o,
1397
- preloadBehaviour: u = {
1416
+ preloadBehaviour: c = {
1398
1417
  type: "onsight"
1399
1418
  },
1400
- children: h,
1419
+ children: l,
1401
1420
  ...f
1402
1421
  }) {
1403
- const d = Le(i), P = u?.type === "onsight", w = u?.type === "onhover", v = u?.type === "force", p = Te(
1422
+ const d = Le(i), P = c?.type === "onsight", w = c?.type === "onhover", v = c?.type === "force", p = Te(
1404
1423
  (S) => {
1405
1424
  !S.isIntersecting || !n || d.preload(s, { params: e });
1406
1425
  },
1407
- P ? u : {}
1408
- ), y = ke(
1426
+ P ? c : {}
1427
+ ), y = Re(
1409
1428
  (S) => {
1410
1429
  !S || !n || d.preload(s, { params: e });
1411
1430
  },
1412
- w ? u : {}
1431
+ w ? c : {}
1413
1432
  );
1414
- Y(() => {
1433
+ X(() => {
1415
1434
  !n || !v || d.preload(s, { params: e });
1416
1435
  }, [n, s, d, v, e]);
1417
- const [c, a] = St(void 0), l = d?.routerId, E = !c?.includes(window.location.origin) ? "noopener noreferrer" : t ? "prev" : "next";
1418
- Y(() => {
1436
+ const [u, a] = St(void 0), h = d?.routerId, E = !u?.includes(window.location.origin) ? "noopener noreferrer" : t ? "prev" : "next";
1437
+ X(() => {
1419
1438
  if (t && d.canGoBack())
1420
1439
  a(d.previous.url?.href);
1421
1440
  else if (s) {
1422
- const S = ge(e), X = new URL(s, d.baseURL);
1423
- X.search = S, a(X.href);
1441
+ const S = ge(e), C = new URL(s, d.baseURL);
1442
+ C.search = S, a(C.href);
1424
1443
  }
1425
1444
  }, [s, e, d, t]);
1426
1445
  const b = (S) => {
1427
1446
  t ? (S.preventDefault(), d.goBack()) : r === "replace" && s && (S.preventDefault(), d.replace(s)), o?.(S);
1428
1447
  };
1429
- let R;
1430
- switch (u?.type) {
1448
+ let k;
1449
+ switch (c?.type) {
1431
1450
  case "onhover":
1432
- R = y;
1451
+ k = y;
1433
1452
  break;
1434
1453
  case "onsight":
1435
- R = p;
1454
+ k = p;
1436
1455
  break;
1437
1456
  default:
1438
- R = null;
1457
+ k = null;
1439
1458
  }
1440
- return /* @__PURE__ */ lt(
1459
+ return /* @__PURE__ */ ut(
1441
1460
  "a",
1442
1461
  {
1443
- href: c,
1444
- "data-router-id": l,
1462
+ href: u,
1463
+ "data-router-id": h,
1445
1464
  onClick: b,
1446
1465
  rel: E,
1447
- ref: R,
1466
+ ref: k,
1448
1467
  ...f,
1449
- children: h
1468
+ children: l
1450
1469
  }
1451
1470
  );
1452
1471
  }
@@ -1457,7 +1476,7 @@ const sn = [
1457
1476
  {
1458
1477
  transform: "translateX(0vw)"
1459
1478
  }
1460
- ], Re = [
1479
+ ], ke = [
1461
1480
  {
1462
1481
  transform: "translateX(100vw)"
1463
1482
  },
@@ -1680,7 +1699,7 @@ const tt = {
1680
1699
  velocity: 0,
1681
1700
  steps: 200
1682
1701
  })
1683
- }, ht = {
1702
+ }, lt = {
1684
1703
  duration: 350,
1685
1704
  easing: A(He(Ue(5)))
1686
1705
  }, Ne = {
@@ -1702,7 +1721,7 @@ const tt = {
1702
1721
  function mn({ ref: n, direction: t, playbackRate: e, index: r }) {
1703
1722
  let i = [
1704
1723
  Ie,
1705
- Re
1724
+ ke
1706
1725
  ][r];
1707
1726
  const o = {
1708
1727
  playbackRate: e,
@@ -1737,7 +1756,7 @@ function En({ ref: n, direction: t, playbackRate: e }) {
1737
1756
  const s = {
1738
1757
  playbackRate: e,
1739
1758
  fill: "forwards",
1740
- ...ht
1759
+ ...lt
1741
1760
  };
1742
1761
  return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(n, r, s);
1743
1762
  }
@@ -1764,18 +1783,19 @@ function Sn({ ref: n, direction: t, index: e, playbackRate: r }) {
1764
1783
  return new KeyframeEffect(n, i, o);
1765
1784
  }
1766
1785
  function bn({ ref: n, direction: t, index: e, playbackRate: r }) {
1767
- let s = [
1786
+ const s = [
1768
1787
  Me,
1769
1788
  Ke
1770
- ], i;
1771
- e === 0 ? i = Ne : i = ht;
1789
+ ];
1790
+ let i;
1791
+ e === 0 ? i = Ne : i = lt;
1772
1792
  let o = s[e];
1773
- const u = {
1793
+ const c = {
1774
1794
  playbackRate: r,
1775
1795
  fill: "forwards",
1776
1796
  ...i
1777
1797
  };
1778
- return t === "reverse" && (o = o.toReversed()), new KeyframeEffect(n, o, u);
1798
+ return t === "reverse" && (o = o.toReversed()), new KeyframeEffect(n, o, c);
1779
1799
  }
1780
1800
  function _n({ ref: n, direction: t, index: e, playbackRate: r }) {
1781
1801
  const i = [
@@ -1791,7 +1811,7 @@ function _n({ ref: n, direction: t, index: e, playbackRate: r }) {
1791
1811
  }
1792
1812
  function Ln({ disabled: n, children: t, ...e }) {
1793
1813
  const r = $(null);
1794
- return Y(() => {
1814
+ return X(() => {
1795
1815
  if (n)
1796
1816
  return;
1797
1817
  const s = (i) => {
@@ -1800,7 +1820,7 @@ function Ln({ disabled: n, children: t, ...e }) {
1800
1820
  return r.current?.addEventListener("swipestart", s), () => {
1801
1821
  r.current?.removeEventListener("swipestart", s);
1802
1822
  };
1803
- }, [r, n]), /* @__PURE__ */ lt(
1823
+ }, [r, n]), /* @__PURE__ */ ut(
1804
1824
  "div",
1805
1825
  {
1806
1826
  ref: r,
@@ -1836,7 +1856,7 @@ export {
1836
1856
  Ye as androidConcealToBottomKeyframes,
1837
1857
  En as androidFadeInFromBottom,
1838
1858
  Oe as androidFadeInFromBottomKeyframes,
1839
- ht as androidFadeInFromBottomOptions,
1859
+ lt as androidFadeInFromBottomOptions,
1840
1860
  Pn as androidFadeInFromBottomSheet,
1841
1861
  je as androidFadeInFromBottomSheetKeyframes,
1842
1862
  bn as androidFadeInFromRight,
@@ -1856,7 +1876,7 @@ export {
1856
1876
  yn as iOSSlideInFromLeft,
1857
1877
  xe as iOSSlideInFromLeftKeyframes,
1858
1878
  mn as iOSSlideInFromRight,
1859
- Re as iOSSlideInFromRightKeyframes,
1879
+ ke as iOSSlideInFromRightKeyframes,
1860
1880
  Ie as iOSSlideOutToLeftKeyframes,
1861
1881
  Fe as iOSSlideOutToRightKeyframes,
1862
1882
  _e as useNavigation,