react-spring-carousel 3.0.0-beta-2.0.189 → 3.0.0-beta-2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsxs as Ot, jsx as Q } from "react/jsx-runtime";
1
+ import { jsxs as At, jsx as Q } from "react/jsx-runtime";
2
2
  import { useSpring as $t } from "@react-spring/web";
3
- import Z, { useRef as $, useEffect as yt, useState as At } from "react";
4
- function Pt(r, t, e) {
3
+ import Z, { useRef as A, useEffect as _t, useState as Pt } from "react";
4
+ function Nt(r, t, e) {
5
5
  return Math.max(t, Math.min(r, e));
6
6
  }
7
7
  const v = {
@@ -25,11 +25,11 @@ function ct(r, t, e) {
25
25
  return t === 0 || Math.abs(t) === 1 / 0 ? Math.pow(r, e * 5) : r * t * e / (t + e * r);
26
26
  }
27
27
  function ut(r, t, e, n = 0.15) {
28
- return n === 0 ? Pt(r, t, e) : r < t ? -ct(t - r, e - t, n) + t : r > e ? +ct(r - e, e - t, n) + e : r;
28
+ return n === 0 ? Nt(r, t, e) : r < t ? -ct(t - r, e - t, n) + t : r > e ? +ct(r - e, e - t, n) + e : r;
29
29
  }
30
- function Nt(r, [t, e], [n, s]) {
31
- const [[i, u], [a, c]] = r;
32
- return [ut(t, i, u, n), ut(e, a, c, s)];
30
+ function Mt(r, [t, e], [n, s]) {
31
+ const [[o, c], [a, u]] = r;
32
+ return [ut(t, o, c, n), ut(e, a, u, s)];
33
33
  }
34
34
  function Rt(r, t) {
35
35
  if (typeof r != "object" || r === null) return r;
@@ -41,12 +41,12 @@ function Rt(r, t) {
41
41
  }
42
42
  return (t === "string" ? String : Number)(r);
43
43
  }
44
- function Mt(r) {
44
+ function Lt(r) {
45
45
  var t = Rt(r, "string");
46
46
  return typeof t == "symbol" ? t : String(t);
47
47
  }
48
48
  function w(r, t, e) {
49
- return t = Mt(t), t in r ? Object.defineProperty(r, t, {
49
+ return t = Lt(t), t in r ? Object.defineProperty(r, t, {
50
50
  value: e,
51
51
  enumerable: !0,
52
52
  configurable: !0,
@@ -99,27 +99,27 @@ const bt = {
99
99
  function lt(r) {
100
100
  return r ? r[0].toUpperCase() + r.slice(1) : "";
101
101
  }
102
- const Lt = ["enter", "leave"];
103
- function Vt(r = !1, t) {
104
- return r && !Lt.includes(t);
102
+ const Vt = ["enter", "leave"];
103
+ function jt(r = !1, t) {
104
+ return r && !Vt.includes(t);
105
105
  }
106
- function jt(r, t = "", e = !1) {
106
+ function Ut(r, t = "", e = !1) {
107
107
  const n = bt[r], s = n && n[t] || t;
108
- return "on" + lt(r) + lt(s) + (Vt(e, s) ? "Capture" : "");
108
+ return "on" + lt(r) + lt(s) + (jt(e, s) ? "Capture" : "");
109
109
  }
110
- const Ut = ["gotpointercapture", "lostpointercapture"];
111
- function Kt(r) {
110
+ const Kt = ["gotpointercapture", "lostpointercapture"];
111
+ function Bt(r) {
112
112
  let t = r.substring(2).toLowerCase();
113
113
  const e = !!~t.indexOf("passive");
114
114
  e && (t = t.replace("passive", ""));
115
- const n = Ut.includes(t) ? "capturecapture" : "capture", s = !!~t.indexOf(n);
115
+ const n = Kt.includes(t) ? "capturecapture" : "capture", s = !!~t.indexOf(n);
116
116
  return s && (t = t.replace("capture", "")), {
117
117
  device: t,
118
118
  capture: s,
119
119
  passive: e
120
120
  };
121
121
  }
122
- function Bt(r, t = "") {
122
+ function zt(r, t = "") {
123
123
  const e = bt[r], n = e && e[t] || t;
124
124
  return r + n;
125
125
  }
@@ -129,20 +129,20 @@ function H(r) {
129
129
  function wt(r) {
130
130
  return H(r) ? "touch" : "pointerType" in r ? r.pointerType : "mouse";
131
131
  }
132
- function zt(r) {
132
+ function Wt(r) {
133
133
  return Array.from(r.touches).filter((t) => {
134
134
  var e, n;
135
135
  return t.target === r.currentTarget || ((e = r.currentTarget) === null || e === void 0 || (n = e.contains) === null || n === void 0 ? void 0 : n.call(e, t.target));
136
136
  });
137
137
  }
138
- function Wt(r) {
138
+ function Yt(r) {
139
139
  return r.type === "touchend" || r.type === "touchcancel" ? r.changedTouches : r.targetTouches;
140
140
  }
141
141
  function Et(r) {
142
- return H(r) ? Wt(r)[0] : r;
142
+ return H(r) ? Yt(r)[0] : r;
143
143
  }
144
- function Yt(r) {
145
- return zt(r).map((t) => t.identifier);
144
+ function Ft(r) {
145
+ return Wt(r).map((t) => t.identifier);
146
146
  }
147
147
  function tt(r) {
148
148
  const t = Et(r);
@@ -152,20 +152,20 @@ function dt(r) {
152
152
  const t = Et(r);
153
153
  return [t.clientX, t.clientY];
154
154
  }
155
- function Ft(r) {
155
+ function Ht(r) {
156
156
  const t = {};
157
157
  if ("buttons" in r && (t.buttons = r.buttons), "shiftKey" in r) {
158
158
  const {
159
159
  shiftKey: e,
160
160
  altKey: n,
161
161
  metaKey: s,
162
- ctrlKey: i
162
+ ctrlKey: o
163
163
  } = r;
164
164
  Object.assign(t, {
165
165
  shiftKey: e,
166
166
  altKey: n,
167
167
  metaKey: s,
168
- ctrlKey: i
168
+ ctrlKey: o
169
169
  });
170
170
  }
171
171
  return t;
@@ -173,10 +173,10 @@ function Ft(r) {
173
173
  function F(r, ...t) {
174
174
  return typeof r == "function" ? r(...t) : r;
175
175
  }
176
- function Ht() {
176
+ function Gt() {
177
177
  }
178
- function Gt(...r) {
179
- return r.length === 0 ? Ht : r.length === 1 ? r[0] : function() {
178
+ function Xt(...r) {
179
+ return r.length === 0 ? Gt : r.length === 1 ? r[0] : function() {
180
180
  let t;
181
181
  for (const e of r)
182
182
  t = e.apply(this, arguments) || t;
@@ -186,8 +186,8 @@ function Gt(...r) {
186
186
  function ht(r, t) {
187
187
  return Object.assign({}, t, r || {});
188
188
  }
189
- const Xt = 32;
190
- class qt {
189
+ const qt = 32;
190
+ class Jt {
191
191
  constructor(t, e, n) {
192
192
  this.ctrl = t, this.args = e, this.key = n, this.state || (this.state = {}, this.computeValues([0, 0]), this.computeInitial(), this.init && this.init(), this.reset());
193
193
  }
@@ -243,33 +243,33 @@ class qt {
243
243
  shared: s
244
244
  } = this;
245
245
  e.args = this.args;
246
- let i = 0;
247
- if (t && (e.event = t, n.preventDefault && t.cancelable && e.event.preventDefault(), e.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s, Ft(t)), s.down = s.pressed = s.buttons % 2 === 1 || s.touches > 0, i = t.timeStamp - e.timeStamp, e.timeStamp = t.timeStamp, e.elapsedTime = e.timeStamp - e.startTime), e._active) {
246
+ let o = 0;
247
+ if (t && (e.event = t, n.preventDefault && t.cancelable && e.event.preventDefault(), e.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s, Ht(t)), s.down = s.pressed = s.buttons % 2 === 1 || s.touches > 0, o = t.timeStamp - e.timeStamp, e.timeStamp = t.timeStamp, e.elapsedTime = e.timeStamp - e.startTime), e._active) {
248
248
  const l = e._delta.map(Math.abs);
249
249
  v.addTo(e._distance, l);
250
250
  }
251
251
  this.axisIntent && this.axisIntent(t);
252
- const [u, a] = e._movement, [c, p] = n.threshold, {
252
+ const [c, a] = e._movement, [u, p] = n.threshold, {
253
253
  _step: f,
254
254
  values: x
255
255
  } = e;
256
- if (n.hasCustomTransform ? (f[0] === !1 && (f[0] = Math.abs(u) >= c && x[0]), f[1] === !1 && (f[1] = Math.abs(a) >= p && x[1])) : (f[0] === !1 && (f[0] = Math.abs(u) >= c && Math.sign(u) * c), f[1] === !1 && (f[1] = Math.abs(a) >= p && Math.sign(a) * p)), e.intentional = f[0] !== !1 || f[1] !== !1, !e.intentional) return;
257
- const _ = [0, 0];
256
+ if (n.hasCustomTransform ? (f[0] === !1 && (f[0] = Math.abs(c) >= u && x[0]), f[1] === !1 && (f[1] = Math.abs(a) >= p && x[1])) : (f[0] === !1 && (f[0] = Math.abs(c) >= u && Math.sign(c) * u), f[1] === !1 && (f[1] = Math.abs(a) >= p && Math.sign(a) * p)), e.intentional = f[0] !== !1 || f[1] !== !1, !e.intentional) return;
257
+ const y = [0, 0];
258
258
  if (n.hasCustomTransform) {
259
- const [l, R] = x;
260
- _[0] = f[0] !== !1 ? l - f[0] : 0, _[1] = f[1] !== !1 ? R - f[1] : 0;
259
+ const [l, M] = x;
260
+ y[0] = f[0] !== !1 ? l - f[0] : 0, y[1] = f[1] !== !1 ? M - f[1] : 0;
261
261
  } else
262
- _[0] = f[0] !== !1 ? u - f[0] : 0, _[1] = f[1] !== !1 ? a - f[1] : 0;
263
- this.restrictToAxis && !e._blocked && this.restrictToAxis(_);
262
+ y[0] = f[0] !== !1 ? c - f[0] : 0, y[1] = f[1] !== !1 ? a - f[1] : 0;
263
+ this.restrictToAxis && !e._blocked && this.restrictToAxis(y);
264
264
  const P = e.offset, N = e._active && !e._blocked || e.active;
265
- N && (e.first = e._active && !e.active, e.last = !e._active && e.active, e.active = s[this.ingKey] = e._active, t && (e.first && ("bounds" in n && (e._bounds = F(n.bounds, e)), this.setup && this.setup()), e.movement = _, this.computeOffset()));
266
- const [A, C] = e.offset, [[y, z], [T, b]] = e._bounds;
267
- e.overflow = [A < y ? -1 : A > z ? 1 : 0, C < T ? -1 : C > b ? 1 : 0], e._movementBound[0] = e.overflow[0] ? e._movementBound[0] === !1 ? e._movement[0] : e._movementBound[0] : !1, e._movementBound[1] = e.overflow[1] ? e._movementBound[1] === !1 ? e._movement[1] : e._movementBound[1] : !1;
265
+ N && (e.first = e._active && !e.active, e.last = !e._active && e.active, e.active = s[this.ingKey] = e._active, t && (e.first && ("bounds" in n && (e._bounds = F(n.bounds, e)), this.setup && this.setup()), e.movement = y, this.computeOffset()));
266
+ const [$, C] = e.offset, [[_, B], [I, T]] = e._bounds;
267
+ e.overflow = [$ < _ ? -1 : $ > B ? 1 : 0, C < I ? -1 : C > T ? 1 : 0], e._movementBound[0] = e.overflow[0] ? e._movementBound[0] === !1 ? e._movement[0] : e._movementBound[0] : !1, e._movementBound[1] = e.overflow[1] ? e._movementBound[1] === !1 ? e._movement[1] : e._movementBound[1] : !1;
268
268
  const V = e._active ? n.rubberband || [0, 0] : [0, 0];
269
- if (e.offset = Nt(e._bounds, e.offset, V), e.delta = v.sub(e.offset, P), this.computeMovement(), N && (!e.last || i > Xt)) {
269
+ if (e.offset = Mt(e._bounds, e.offset, V), e.delta = v.sub(e.offset, P), this.computeMovement(), N && (!e.last || o > qt)) {
270
270
  e.delta = v.sub(e.offset, P);
271
271
  const l = e.delta.map(Math.abs);
272
- v.addTo(e.distance, l), e.direction = e.delta.map(Math.sign), e._direction = e._delta.map(Math.sign), !e.first && i > 0 && (e.velocity = [l[0] / i, l[1] / i], e.timeDelta = i);
272
+ v.addTo(e.distance, l), e.direction = e.delta.map(Math.sign), e._direction = e._delta.map(Math.sign), !e.first && o > 0 && (e.velocity = [l[0] / o, l[1] / o], e.timeDelta = o);
273
273
  }
274
274
  }
275
275
  emit() {
@@ -284,14 +284,14 @@ class qt {
284
284
  this.eventStore.clean(), this.timeoutStore.clean();
285
285
  }
286
286
  }
287
- function Jt([r, t], e) {
287
+ function Qt([r, t], e) {
288
288
  const n = Math.abs(r), s = Math.abs(t);
289
289
  if (n > s && n > e)
290
290
  return "x";
291
291
  if (s > n && s > e)
292
292
  return "y";
293
293
  }
294
- class Qt extends qt {
294
+ class Zt extends Jt {
295
295
  constructor(...t) {
296
296
  super(...t), w(this, "aliasKey", "xy");
297
297
  }
@@ -311,7 +311,7 @@ class Qt extends qt {
311
311
  const e = this.state, n = this.config;
312
312
  if (!e.axis && t) {
313
313
  const s = typeof n.axisThreshold == "object" ? n.axisThreshold[wt(t)] : n.axisThreshold;
314
- e.axis = Jt(e._movement, s);
314
+ e.axis = Qt(e._movement, s);
315
315
  }
316
316
  e._blocked = (n.lockDirection || !!n.axis) && !e.axis || !!n.axis && n.axis !== e.axis;
317
317
  }
@@ -358,9 +358,9 @@ const pt = (r) => r, mt = 0.15, nt = {
358
358
  const n = r || e.shared.transform;
359
359
  if (this.hasCustomTransform = !!n, process.env.NODE_ENV === "development") {
360
360
  const s = n || pt;
361
- return (i) => {
362
- const u = s(i);
363
- return (!isFinite(u[0]) || !isFinite(u[1])) && console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${u[0]},${[1]}]`), u;
361
+ return (o) => {
362
+ const c = s(o);
363
+ return (!isFinite(c[0]) || !isFinite(c[1])) && console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${c[0]},${[1]}]`), c;
364
364
  };
365
365
  }
366
366
  return n || pt;
@@ -386,18 +386,18 @@ process.env.NODE_ENV === "development" && Object.assign(nt, {
386
386
  return NaN;
387
387
  }
388
388
  });
389
- const Zt = 0, K = h(h({}, nt), {}, {
389
+ const te = 0, U = h(h({}, nt), {}, {
390
390
  axis(r, t, {
391
391
  axis: e
392
392
  }) {
393
393
  if (this.lockDirection = e === "lock", !this.lockDirection) return e;
394
394
  },
395
- axisThreshold(r = Zt) {
395
+ axisThreshold(r = te) {
396
396
  return r;
397
397
  },
398
398
  bounds(r = {}) {
399
399
  if (typeof r == "function")
400
- return (i) => K.bounds(r(i));
400
+ return (o) => U.bounds(r(o));
401
401
  if ("current" in r)
402
402
  return () => r.current;
403
403
  if (typeof HTMLElement == "function" && r instanceof HTMLElement)
@@ -416,7 +416,7 @@ const Zt = 0, K = h(h({}, nt), {}, {
416
416
  ArrowUp: (r, t = 1) => [0, -1 * r * t],
417
417
  ArrowDown: (r, t = 1) => [0, r * t]
418
418
  };
419
- class te extends Qt {
419
+ class ee extends Zt {
420
420
  constructor(...t) {
421
421
  super(...t), w(this, "ingKey", "dragging");
422
422
  }
@@ -434,7 +434,7 @@ class te extends Qt {
434
434
  top: e.top - n.top + t.offset[1],
435
435
  bottom: e.bottom - n.bottom + t.offset[1]
436
436
  };
437
- t._bounds = K.bounds(s);
437
+ t._bounds = U.bounds(s);
438
438
  }
439
439
  }
440
440
  cancel() {
@@ -464,8 +464,8 @@ class te extends Qt {
464
464
  if (!e._pointerActive) return;
465
465
  const s = tt(t);
466
466
  if (e._pointerId !== void 0 && s !== e._pointerId) return;
467
- const i = dt(t);
468
- if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = v.sub(i, e._values), this.computeValues(i)), v.addTo(e._movement, e._delta), this.compute(t), e._delayed && e.intentional) {
467
+ const o = dt(t);
468
+ if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = v.sub(o, e._values), this.computeValues(o)), v.addTo(e._movement, e._delta), this.compute(t), e._delayed && e.intentional) {
469
469
  this.timeoutStore.remove("dragDelay"), e.active = !1, this.startPointerDrag(t);
470
470
  return;
471
471
  }
@@ -494,14 +494,14 @@ class te extends Qt {
494
494
  const s = tt(t);
495
495
  if (e._pointerId !== void 0 && s !== e._pointerId) return;
496
496
  this.state._pointerActive = !1, this.setActive(), this.compute(t);
497
- const [i, u] = e._distance;
498
- if (e.tap = i <= n.tapsThreshold && u <= n.tapsThreshold, e.tap && n.filterTaps)
497
+ const [o, c] = e._distance;
498
+ if (e.tap = o <= n.tapsThreshold && c <= n.tapsThreshold, e.tap && n.filterTaps)
499
499
  e._force = !0;
500
500
  else {
501
- const [a, c] = e._delta, [p, f] = e._movement, [x, _] = n.swipe.velocity, [P, N] = n.swipe.distance, A = n.swipe.duration;
502
- if (e.elapsedTime < A) {
503
- const C = Math.abs(a / e.timeDelta), y = Math.abs(c / e.timeDelta);
504
- C > x && Math.abs(p) > P && (e.swipe[0] = Math.sign(a)), y > _ && Math.abs(f) > N && (e.swipe[1] = Math.sign(c));
501
+ const [a, u] = e._delta, [p, f] = e._movement, [x, y] = n.swipe.velocity, [P, N] = n.swipe.distance, $ = n.swipe.duration;
502
+ if (e.elapsedTime < $) {
503
+ const C = Math.abs(a / e.timeDelta), _ = Math.abs(u / e.timeDelta);
504
+ C > x && Math.abs(p) > P && (e.swipe[0] = Math.sign(a)), _ > y && Math.abs(f) > N && (e.swipe[1] = Math.sign(u));
505
505
  }
506
506
  }
507
507
  this.emit();
@@ -528,7 +528,7 @@ class te extends Qt {
528
528
  this.state._preventScroll && t.cancelable && t.preventDefault();
529
529
  }
530
530
  setupScrollPrevention(t) {
531
- this.state._preventScroll = !1, ee(t);
531
+ this.state._preventScroll = !1, re(t);
532
532
  const e = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
533
533
  passive: !1
534
534
  });
@@ -557,23 +557,23 @@ class te extends Qt {
557
557
  });
558
558
  }
559
559
  }
560
- function ee(r) {
560
+ function re(r) {
561
561
  "persist" in r && typeof r.persist == "function" && r.persist();
562
562
  }
563
- const B = typeof window < "u" && window.document && window.document.createElement;
563
+ const K = typeof window < "u" && window.document && window.document.createElement;
564
564
  function xt() {
565
- return B && "ontouchstart" in window;
566
- }
567
- function re() {
568
- return xt() || B && window.navigator.maxTouchPoints > 1;
565
+ return K && "ontouchstart" in window;
569
566
  }
570
567
  function ne() {
571
- return B && "onpointerdown" in window;
568
+ return xt() || K && window.navigator.maxTouchPoints > 1;
572
569
  }
573
570
  function se() {
574
- return B && "exitPointerLock" in window.document;
571
+ return K && "onpointerdown" in window;
575
572
  }
576
573
  function ie() {
574
+ return K && "exitPointerLock" in window.document;
575
+ }
576
+ function oe() {
577
577
  try {
578
578
  return "constructor" in GestureEvent;
579
579
  } catch {
@@ -581,17 +581,17 @@ function ie() {
581
581
  }
582
582
  }
583
583
  const S = {
584
- isBrowser: B,
585
- gesture: ie(),
584
+ isBrowser: K,
585
+ gesture: oe(),
586
586
  touch: xt(),
587
- touchscreen: re(),
588
- pointer: ne(),
589
- pointerLock: se()
590
- }, oe = 250, ae = 180, ce = 0.5, ue = 50, fe = 250, le = 10, vt = {
587
+ touchscreen: ne(),
588
+ pointer: se(),
589
+ pointerLock: ie()
590
+ }, ae = 250, ce = 180, ue = 0.5, fe = 50, le = 250, de = 10, vt = {
591
591
  mouse: 0,
592
592
  touch: 0,
593
593
  pen: 8
594
- }, St = h(h({}, K), {}, {
594
+ }, Tt = h(h({}, U), {}, {
595
595
  device(r, t, {
596
596
  pointer: {
597
597
  touch: e = !1,
@@ -604,7 +604,7 @@ const S = {
604
604
  preventScrollAxis(r, t, {
605
605
  preventScroll: e
606
606
  }) {
607
- if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && r ? oe : void 0, !(!S.touchscreen || e === !1))
607
+ if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && r ? ae : void 0, !(!S.touchscreen || e === !1))
608
608
  return r || (e !== void 0 ? "y" : void 0);
609
609
  },
610
610
  pointerCapture(r, t, {
@@ -621,13 +621,13 @@ const S = {
621
621
  tapsThreshold: n = 3,
622
622
  axis: s = void 0
623
623
  }) {
624
- const i = v.toVector(r, e ? n : s ? 1 : 0);
625
- return this.filterTaps = e, this.tapsThreshold = n, i;
624
+ const o = v.toVector(r, e ? n : s ? 1 : 0);
625
+ return this.filterTaps = e, this.tapsThreshold = n, o;
626
626
  },
627
627
  swipe({
628
- velocity: r = ce,
629
- distance: t = ue,
630
- duration: e = fe
628
+ velocity: r = ue,
629
+ distance: t = fe,
630
+ duration: e = le
631
631
  } = {}) {
632
632
  return {
633
633
  velocity: this.transform(v.toVector(r)),
@@ -638,7 +638,7 @@ const S = {
638
638
  delay(r = 0) {
639
639
  switch (r) {
640
640
  case !0:
641
- return ae;
641
+ return ce;
642
642
  case !1:
643
643
  return 0;
644
644
  default:
@@ -648,11 +648,11 @@ const S = {
648
648
  axisThreshold(r) {
649
649
  return r ? h(h({}, vt), r) : vt;
650
650
  },
651
- keyboardDisplacement(r = le) {
651
+ keyboardDisplacement(r = de) {
652
652
  return r;
653
653
  }
654
654
  });
655
- process.env.NODE_ENV === "development" && Object.assign(St, {
655
+ process.env.NODE_ENV === "development" && Object.assign(Tt, {
656
656
  useTouch(r) {
657
657
  if (r !== void 0)
658
658
  throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");
@@ -697,20 +697,20 @@ h(h({}, nt), {}, {
697
697
  scaleBounds: e = {},
698
698
  angleBounds: n = {}
699
699
  }) {
700
- const s = (u) => {
701
- const a = ht(F(e, u), {
700
+ const s = (c) => {
701
+ const a = ht(F(e, c), {
702
702
  min: -1 / 0,
703
703
  max: 1 / 0
704
704
  });
705
705
  return [a.min, a.max];
706
- }, i = (u) => {
707
- const a = ht(F(n, u), {
706
+ }, o = (c) => {
707
+ const a = ht(F(n, c), {
708
708
  min: -1 / 0,
709
709
  max: 1 / 0
710
710
  });
711
711
  return [a.min, a.max];
712
712
  };
713
- return typeof e != "function" && typeof n != "function" ? [s(), i()] : (u) => [s(u), i(u)];
713
+ return typeof e != "function" && typeof n != "function" ? [s(), o()] : (c) => [s(c), o(c)];
714
714
  },
715
715
  threshold(r, t, e) {
716
716
  return this.lockDirection = e.axis === "lock", v.toVector(r, this.lockDirection ? [0.1, 3] : 0);
@@ -722,39 +722,39 @@ h(h({}, nt), {}, {
722
722
  return r;
723
723
  }
724
724
  });
725
- h(h({}, K), {}, {
725
+ h(h({}, U), {}, {
726
726
  mouseOnly: (r = !0) => r
727
727
  });
728
- h(h({}, K), {}, {
728
+ h(h({}, U), {}, {
729
729
  mouseOnly: (r = !0) => r
730
730
  });
731
- const Tt = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map();
732
- function de(r) {
733
- Tt.set(r.key, r.engine), rt.set(r.key, r.resolver);
731
+ const St = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map();
732
+ function he(r) {
733
+ St.set(r.key, r.engine), rt.set(r.key, r.resolver);
734
734
  }
735
- const he = {
735
+ const pe = {
736
736
  key: "drag",
737
- engine: te,
738
- resolver: St
737
+ engine: ee,
738
+ resolver: Tt
739
739
  };
740
- function pe(r, t) {
740
+ function me(r, t) {
741
741
  if (r == null) return {};
742
- var e = {}, n = Object.keys(r), s, i;
743
- for (i = 0; i < n.length; i++)
744
- s = n[i], !(t.indexOf(s) >= 0) && (e[s] = r[s]);
742
+ var e = {}, n = Object.keys(r), s, o;
743
+ for (o = 0; o < n.length; o++)
744
+ s = n[o], !(t.indexOf(s) >= 0) && (e[s] = r[s]);
745
745
  return e;
746
746
  }
747
- function me(r, t) {
747
+ function ge(r, t) {
748
748
  if (r == null) return {};
749
- var e = pe(r, t), n, s;
749
+ var e = me(r, t), n, s;
750
750
  if (Object.getOwnPropertySymbols) {
751
- var i = Object.getOwnPropertySymbols(r);
752
- for (s = 0; s < i.length; s++)
753
- n = i[s], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(r, n) && (e[n] = r[n]);
751
+ var o = Object.getOwnPropertySymbols(r);
752
+ for (s = 0; s < o.length; s++)
753
+ n = o[s], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(r, n) && (e[n] = r[n]);
754
754
  }
755
755
  return e;
756
756
  }
757
- const ge = {
757
+ const ve = {
758
758
  target(r) {
759
759
  if (r)
760
760
  return () => "current" in r ? r.current : r;
@@ -777,15 +777,15 @@ const ge = {
777
777
  transform(r) {
778
778
  return r;
779
779
  }
780
- }, ve = ["target", "eventOptions", "window", "enabled", "transform"];
780
+ }, ye = ["target", "eventOptions", "window", "enabled", "transform"];
781
781
  function Y(r = {}, t) {
782
782
  const e = {};
783
783
  for (const [n, s] of Object.entries(t))
784
784
  switch (typeof s) {
785
785
  case "function":
786
786
  if (process.env.NODE_ENV === "development") {
787
- const i = s.call(e, r[n], n, r);
788
- Number.isNaN(i) || (e[n] = i);
787
+ const o = s.call(e, r[n], n, r);
788
+ Number.isNaN(o) || (e[n] = o);
789
789
  } else
790
790
  e[n] = s.call(e, r[n], n, r);
791
791
  break;
@@ -801,18 +801,18 @@ function Y(r = {}, t) {
801
801
  function _e(r, t, e = {}) {
802
802
  const n = r, {
803
803
  target: s,
804
- eventOptions: i,
805
- window: u,
804
+ eventOptions: o,
805
+ window: c,
806
806
  enabled: a,
807
- transform: c
808
- } = n, p = me(n, ve);
807
+ transform: u
808
+ } = n, p = ge(n, ye);
809
809
  if (e.shared = Y({
810
810
  target: s,
811
- eventOptions: i,
812
- window: u,
811
+ eventOptions: o,
812
+ window: c,
813
813
  enabled: a,
814
- transform: c
815
- }, ge), t) {
814
+ transform: u
815
+ }, ve), t) {
816
816
  const f = rt.get(t);
817
817
  e[t] = Y(h({
818
818
  shared: e.shared
@@ -836,19 +836,19 @@ class It {
836
836
  constructor(t, e) {
837
837
  w(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = e;
838
838
  }
839
- add(t, e, n, s, i) {
840
- const u = this._listeners, a = Bt(e, n), c = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, p = h(h({}, c), i);
839
+ add(t, e, n, s, o) {
840
+ const c = this._listeners, a = zt(e, n), u = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, p = h(h({}, u), o);
841
841
  t.addEventListener(a, s, p);
842
842
  const f = () => {
843
- t.removeEventListener(a, s, p), u.delete(f);
843
+ t.removeEventListener(a, s, p), c.delete(f);
844
844
  };
845
- return u.add(f), f;
845
+ return c.add(f), f;
846
846
  }
847
847
  clean() {
848
848
  this._listeners.forEach((t) => t()), this._listeners.clear();
849
849
  }
850
850
  }
851
- class ye {
851
+ class be {
852
852
  constructor() {
853
853
  w(this, "_timeouts", /* @__PURE__ */ new Map());
854
854
  }
@@ -863,7 +863,7 @@ class ye {
863
863
  this._timeouts.forEach((t) => void window.clearTimeout(t)), this._timeouts.clear();
864
864
  }
865
865
  }
866
- class be {
866
+ class we {
867
867
  constructor(t) {
868
868
  w(this, "gestures", /* @__PURE__ */ new Set()), w(this, "_targetEventStore", new It(this)), w(this, "gestureEventStores", {}), w(this, "gestureTimeoutStores", {}), w(this, "handlers", {}), w(this, "config", {}), w(this, "pointerIds", /* @__PURE__ */ new Set()), w(this, "touchIds", /* @__PURE__ */ new Set()), w(this, "state", {
869
869
  shared: {
@@ -872,11 +872,11 @@ class be {
872
872
  ctrlKey: !1,
873
873
  altKey: !1
874
874
  }
875
- }), we(this, t);
875
+ }), Ee(this, t);
876
876
  }
877
877
  setEventIds(t) {
878
878
  if (H(t))
879
- return this.touchIds = new Set(Yt(t)), this.touchIds;
879
+ return this.touchIds = new Set(Ft(t)), this.touchIds;
880
880
  if ("pointerId" in t)
881
881
  return t.type === "pointerup" || t.type === "pointercancel" ? this.pointerIds.delete(t.pointerId) : t.type === "pointerdown" && this.pointerIds.add(t.pointerId), this.pointerIds;
882
882
  }
@@ -899,72 +899,72 @@ class be {
899
899
  let s;
900
900
  if (!(e.target && (s = e.target(), !s))) {
901
901
  if (e.enabled) {
902
- for (const u of this.gestures) {
903
- const a = this.config[u], c = _t(n, a.eventOptions, !!s);
902
+ for (const c of this.gestures) {
903
+ const a = this.config[c], u = yt(n, a.eventOptions, !!s);
904
904
  if (a.enabled) {
905
- const p = Tt.get(u);
906
- new p(this, t, u).bind(c);
905
+ const p = St.get(c);
906
+ new p(this, t, c).bind(u);
907
907
  }
908
908
  }
909
- const i = _t(n, e.eventOptions, !!s);
910
- for (const u in this.nativeHandlers)
911
- i(u, "", (a) => this.nativeHandlers[u](h(h({}, this.state.shared), {}, {
909
+ const o = yt(n, e.eventOptions, !!s);
910
+ for (const c in this.nativeHandlers)
911
+ o(c, "", (a) => this.nativeHandlers[c](h(h({}, this.state.shared), {}, {
912
912
  event: a,
913
913
  args: t
914
914
  })), void 0, !0);
915
915
  }
916
- for (const i in n)
917
- n[i] = Gt(...n[i]);
916
+ for (const o in n)
917
+ n[o] = Xt(...n[o]);
918
918
  if (!s) return n;
919
- for (const i in n) {
919
+ for (const o in n) {
920
920
  const {
921
- device: u,
921
+ device: c,
922
922
  capture: a,
923
- passive: c
924
- } = Kt(i);
925
- this._targetEventStore.add(s, u, "", n[i], {
923
+ passive: u
924
+ } = Bt(o);
925
+ this._targetEventStore.add(s, c, "", n[o], {
926
926
  capture: a,
927
- passive: c
927
+ passive: u
928
928
  });
929
929
  }
930
930
  }
931
931
  }
932
932
  }
933
933
  function L(r, t) {
934
- r.gestures.add(t), r.gestureEventStores[t] = new It(r, t), r.gestureTimeoutStores[t] = new ye();
934
+ r.gestures.add(t), r.gestureEventStores[t] = new It(r, t), r.gestureTimeoutStores[t] = new be();
935
935
  }
936
- function we(r, t) {
936
+ function Ee(r, t) {
937
937
  t.drag && L(r, "drag"), t.wheel && L(r, "wheel"), t.scroll && L(r, "scroll"), t.move && L(r, "move"), t.pinch && L(r, "pinch"), t.hover && L(r, "hover");
938
938
  }
939
- const _t = (r, t, e) => (n, s, i, u = {}, a = !1) => {
940
- var c, p;
941
- const f = (c = u.capture) !== null && c !== void 0 ? c : t.capture, x = (p = u.passive) !== null && p !== void 0 ? p : t.passive;
942
- let _ = a ? n : jt(n, s, f);
943
- e && x && (_ += "Passive"), r[_] = r[_] || [], r[_].push(i);
939
+ const yt = (r, t, e) => (n, s, o, c = {}, a = !1) => {
940
+ var u, p;
941
+ const f = (u = c.capture) !== null && u !== void 0 ? u : t.capture, x = (p = c.passive) !== null && p !== void 0 ? p : t.passive;
942
+ let y = a ? n : Ut(n, s, f);
943
+ e && x && (y += "Passive"), r[y] = r[y] || [], r[y].push(o);
944
944
  };
945
- function Ee(r, t = {}, e, n) {
946
- const s = Z.useMemo(() => new be(r), []);
945
+ function xe(r, t = {}, e, n) {
946
+ const s = Z.useMemo(() => new we(r), []);
947
947
  if (s.applyHandlers(r, n), s.applyConfig(t, e), Z.useEffect(s.effect.bind(s)), Z.useEffect(() => s.clean.bind(s), []), t.target === void 0)
948
948
  return s.bind.bind(s);
949
949
  }
950
- function xe(r, t) {
951
- return de(he), Ee({
950
+ function Te(r, t) {
951
+ return he(pe), xe({
952
952
  drag: r
953
953
  }, t || {}, "drag");
954
954
  }
955
955
  const et = "RSC::Event";
956
956
  function Se() {
957
- const r = $(null);
957
+ const r = A(null);
958
958
  function t(n) {
959
- yt(() => {
959
+ _t(() => {
960
960
  r.current || (r.current = document.createElement("div"));
961
- function s(i) {
962
- n(i.detail);
961
+ function s(o) {
962
+ n(o.detail);
963
963
  }
964
964
  if (r.current)
965
965
  return r.current.addEventListener(et, s, !1), () => {
966
- var i;
967
- (i = r.current) == null || i.removeEventListener(
966
+ var o;
967
+ (o = r.current) == null || o.removeEventListener(
968
968
  et,
969
969
  s,
970
970
  !1
@@ -985,158 +985,148 @@ function Se() {
985
985
  emitEvent: e
986
986
  };
987
987
  }
988
- function Ce({
988
+ function Oe({
989
989
  init: r = !0,
990
990
  items: t,
991
991
  withLoop: e = !1,
992
992
  id: n,
993
993
  itemsPerSlide: s = 1,
994
- gutter: i = 0,
995
- startEndGutter: u = 0,
994
+ gutter: o = 0,
995
+ startEndGutter: c = 0,
996
996
  carouselAxis: a = "x",
997
- slideType: c = "fixed",
997
+ slideType: u = "fixed",
998
998
  startingPosition: p = "start",
999
999
  enableGestures: f = !0,
1000
1000
  slideWhenDragThresholdIsReached: x = !0,
1001
- onInit: _
1001
+ onInit: y
1002
1002
  }) {
1003
- const [P, N] = At(!1), A = $(r), C = $(null), y = $(null), z = $(0), T = $(!e), b = $(!1), V = $(0), l = $(0), [R, G] = $t(
1003
+ const [P, N] = Pt(!1), $ = A(r), C = A(null), _ = A(null), B = A(0), I = A(!e), T = A(!1), V = A(0), l = A(0), [M, G] = $t(
1004
1004
  () => ({
1005
1005
  value: 0,
1006
- onChange({ value: o }) {
1007
- (c === "fixed" || c === "fluid") && C.current.style.setProperty(
1006
+ onChange({ value: i }) {
1007
+ u === "fixed" && C.current.style.setProperty(
1008
1008
  `--${n}-offset-position`,
1009
- `${o.value}px`
1010
- ), c === "freeScroll" && (y.current[a === "x" ? "scrollLeft" : "scrollTop"] = Math.abs(o.value));
1009
+ `${i.value}px`
1010
+ ), u === "freeScroll" && (_.current[a === "x" ? "scrollLeft" : "scrollTop"] = Math.abs(i.value));
1011
1011
  }
1012
1012
  }),
1013
1013
  [a]
1014
- ), Dt = c !== "freeScroll" && e ? [
1015
- ...t.map((o) => ({
1016
- ...o,
1017
- id: `prev-repeated-item-${o.id}`,
1014
+ ), Dt = u !== "freeScroll" && e ? [
1015
+ ...t.map((i) => ({
1016
+ ...i,
1017
+ id: `prev-repeated-item-${i.id}`,
1018
1018
  isClonedItem: !0
1019
1019
  })),
1020
1020
  ...t,
1021
- ...t.map((o) => ({
1022
- ...o,
1023
- id: `next-repeated-item-${o.id}`,
1021
+ ...t.map((i) => ({
1022
+ ...i,
1023
+ id: `next-repeated-item-${i.id}`,
1024
1024
  isClonedItem: !0
1025
1025
  }))
1026
- ] : t, { useListenToCustomEvent: st, emitEvent: j } = Se();
1027
- function X(o) {
1028
- A.current && (b.current || U({
1026
+ ] : t, { useListenToCustomEvent: st, emitEvent: z } = Se();
1027
+ function X(i) {
1028
+ $.current && (T.current || j({
1029
1029
  type: "next",
1030
- toIndex: o,
1030
+ toIndex: i,
1031
1031
  actionType: "click"
1032
1032
  }));
1033
1033
  }
1034
- function q(o) {
1035
- A.current && (T.current || U({
1034
+ function q(i) {
1035
+ $.current && (I.current || j({
1036
1036
  type: "prev",
1037
- toIndex: o,
1037
+ toIndex: i,
1038
1038
  actionType: "click"
1039
1039
  }));
1040
1040
  }
1041
- function U({
1042
- type: o,
1041
+ function j({
1042
+ type: i,
1043
1043
  shouldAnimate: d = !0,
1044
- toIndex: D,
1045
- actionType: E
1044
+ toIndex: E,
1045
+ actionType: b
1046
1046
  }) {
1047
1047
  var ot, at;
1048
1048
  const m = W(), O = !d;
1049
- T.current = !1, b.current = !1;
1050
- let k = R.value.get(), g = 0;
1051
- if (o === "next" && (c === "fixed" || c === "fluid") && (l.current += 1), o === "prev" && (c === "fixed" || c === "fluid") && (l.current === 0 ? l.current = t.length - 1 : l.current -= 1), o === "next" && (c === "fixed" || c === "fluid")) {
1052
- const I = J(
1049
+ I.current = !1, T.current = !1;
1050
+ let D = M.value.get(), g = 0;
1051
+ if (i === "next" && u === "fixed" && (l.current += 1), i === "prev" && u === "fixed" && (l.current === 0 ? l.current = t.length - 1 : l.current -= 1), i === "next" && u === "fixed") {
1052
+ const k = J(
1053
1053
  e ? m * (t.length * 2) : 0
1054
1054
  );
1055
- g = -(l.current * m), e && l.current === t.length && (l.current = 0, k = k + m * t.length, g = 0), !e && Math.abs(g) >= I && (b.current = !0, g = -I);
1055
+ g = -(l.current * m), e && l.current === t.length && (l.current = 0, D = D + m * t.length, g = 0), !e && Math.abs(g) >= k && (T.current = !0, g = -k);
1056
1056
  }
1057
- if (o === "prev" && (c === "fixed" || c === "fluid") && (g = -(l.current * m), l.current === t.length - 1 && (k = k - t.length * m), !e && g >= 0 && (T.current = !0, g = 0)), o === "next" && c === "freeScroll") {
1058
- const I = y.current[a === "x" ? "scrollLeft" : "scrollTop"], M = a === "x" ? y.current.scrollWidth - y.current.clientWidth : y.current.scrollHeight - y.current.clientHeight;
1059
- k = I, g = I + m, (g > M || M - g < 80) && (g = M, b.current = !0);
1057
+ if (i === "prev" && u === "fixed" && (g = -(l.current * m), l.current === t.length - 1 && (D = D - t.length * m), !e && g >= 0 && (I.current = !0, g = 0)), i === "next" && u === "freeScroll") {
1058
+ const k = _.current[a === "x" ? "scrollLeft" : "scrollTop"], R = a === "x" ? _.current.scrollWidth - _.current.clientWidth : _.current.scrollHeight - _.current.clientHeight;
1059
+ D = k, g = k + m, (g > R || R - g < 80) && (g = R, T.current = !0);
1060
1060
  }
1061
- if (o === "prev" && c === "freeScroll") {
1062
- const I = y.current[a === "x" ? "scrollLeft" : "scrollTop"];
1063
- k = I, g = I - m, g <= 0 && (g = 0, b.current = !0);
1061
+ if (i === "prev" && u === "freeScroll") {
1062
+ const k = _.current[a === "x" ? "scrollLeft" : "scrollTop"];
1063
+ D = k, g = k - m, g <= 0 && (g = 0, T.current = !0);
1064
1064
  }
1065
- z.current = g, j(E === "resize" ? {
1065
+ B.current = g, z(b === "resize" ? {
1066
1066
  eventName: "onResize",
1067
- sliceActionType: E,
1068
- slideDirection: o,
1067
+ sliceActionType: b,
1068
+ slideDirection: i,
1069
1069
  currentItem: {
1070
1070
  index: l.current,
1071
1071
  id: ((ot = t.at(l.current)) == null ? void 0 : ot.id) ?? "",
1072
- startReached: T.current,
1073
- endReached: b.current
1072
+ startReached: I.current,
1073
+ endReached: T.current
1074
1074
  }
1075
1075
  } : {
1076
1076
  eventName: "onSlideStartChange",
1077
- sliceActionType: E,
1078
- slideDirection: o,
1077
+ sliceActionType: b,
1078
+ slideDirection: i,
1079
1079
  nextItem: {
1080
1080
  index: l.current,
1081
1081
  id: ((at = t.at(l.current)) == null ? void 0 : at.id) ?? "",
1082
- startReached: T.current,
1083
- endReached: b.current
1082
+ startReached: I.current,
1083
+ endReached: T.current
1084
1084
  }
1085
- }), D !== void 0 && (l.current = D), G.start({
1085
+ }), E !== void 0 && (l.current = E), G.start({
1086
1086
  immediate: O,
1087
1087
  from: {
1088
- value: k
1088
+ value: D
1089
1089
  },
1090
1090
  to: {
1091
1091
  value: g
1092
1092
  },
1093
- onRest({ finished: I }) {
1094
- var M;
1095
- I && c === "fixed" && j({
1093
+ onRest({ finished: k }) {
1094
+ var R;
1095
+ k && u === "fixed" && z({
1096
1096
  eventName: "onSlideChangeComplete",
1097
- sliceActionType: E,
1098
- slideDirection: o,
1097
+ sliceActionType: b,
1098
+ slideDirection: i,
1099
1099
  currentItem: {
1100
1100
  index: l.current,
1101
- id: ((M = t.at(l.current)) == null ? void 0 : M.id) ?? "",
1102
- startReached: T.current,
1103
- endReached: b.current
1104
- }
1105
- }), I && c === "fluid" && j({
1106
- eventName: "onSlideChangeComplete",
1107
- sliceActionType: E,
1108
- slideDirection: o,
1109
- currentItem: {
1110
- index: 0,
1111
- id: "",
1112
- startReached: T.current,
1113
- endReached: b.current
1101
+ id: ((R = t.at(l.current)) == null ? void 0 : R.id) ?? "",
1102
+ startReached: I.current,
1103
+ endReached: T.current
1114
1104
  }
1115
1105
  });
1116
1106
  }
1117
1107
  });
1118
1108
  }
1119
1109
  function W() {
1120
- const o = y.current.children[0];
1110
+ const i = _.current.children[0];
1121
1111
  let d = 0;
1122
- return d = o.getBoundingClientRect()[a === "x" ? "width" : "height"] + i, d;
1112
+ return d = i.getBoundingClientRect()[a === "x" ? "width" : "height"] + o, d;
1123
1113
  }
1124
- function J(o) {
1125
- const d = y.current;
1126
- return d[a === "x" ? "scrollWidth" : "scrollHeight"] - d.getBoundingClientRect()[a === "x" ? "width" : "height"] - o;
1114
+ function J(i) {
1115
+ const d = _.current;
1116
+ return d[a === "x" ? "scrollWidth" : "scrollHeight"] - d.getBoundingClientRect()[a === "x" ? "width" : "height"] - i;
1127
1117
  }
1128
1118
  function kt() {
1129
- let o = 0;
1119
+ let i = 0;
1130
1120
  const d = getComputedStyle(
1131
1121
  document.documentElement
1132
1122
  ).getPropertyValue(`--${n}-start-end-gutter`);
1133
- return d.includes("px") && (o = Number(
1123
+ return d.includes("px") && (i = Number(
1134
1124
  d.replace("px", "")
1135
- )), { totalStartEndGutterCssVar: o };
1125
+ )), { totalStartEndGutterCssVar: i };
1136
1126
  }
1137
- yt(() => {
1138
- function o(E, m) {
1139
- switch (E) {
1127
+ _t(() => {
1128
+ function i(b, m) {
1129
+ switch (b) {
1140
1130
  case "start":
1141
1131
  return 0;
1142
1132
  case "middle-start":
@@ -1151,54 +1141,54 @@ function Ce({
1151
1141
  return 0;
1152
1142
  }
1153
1143
  }
1154
- function d(E) {
1144
+ function d(b) {
1155
1145
  if (C.current) {
1156
1146
  const { totalStartEndGutterCssVar: m } = kt();
1157
1147
  let O = 0;
1158
- e && (O = W() * t.length), O -= W() * o(p, s), O -= m / 2, C.current.style.setProperty(
1148
+ e && (O = W() * t.length), O -= W() * i(p, s), O -= m / 2, C.current.style.setProperty(
1159
1149
  `--${n}-offset-modifier`,
1160
1150
  `${-O}px`
1161
- ), N(!0), E && E();
1151
+ ), N(!0), b && b();
1162
1152
  }
1163
1153
  }
1164
- function D() {
1165
- d(), U({
1154
+ function E() {
1155
+ d(), j({
1166
1156
  type: "next",
1167
1157
  toIndex: l.current,
1168
1158
  shouldAnimate: !1,
1169
1159
  actionType: "resize"
1170
- }), console.log(b.current);
1160
+ });
1171
1161
  }
1172
- if (r && (V.current = W() / 4), r && c !== "freeScroll")
1173
- return d(_), window.addEventListener("resize", D), () => {
1174
- window.removeEventListener("resize", D);
1162
+ if (r && (V.current = W() / 4), r && u === "fixed")
1163
+ return d(y), window.addEventListener("resize", E), () => {
1164
+ window.removeEventListener("resize", E);
1175
1165
  };
1176
- }, [r, e, n, a, i, p, c]);
1177
- const it = f && c !== "freeScroll", Ct = xe(
1178
- (o) => {
1179
- if (!A.current)
1166
+ }, [r, e, n, a, o, p, u]);
1167
+ const it = f && u !== "freeScroll", Ct = Te(
1168
+ (i) => {
1169
+ if (!$.current)
1180
1170
  return;
1181
- const d = o.dragging, D = o.offset[a === "x" ? 0 : 1], E = o.movement[a === "x" ? 0 : 1], m = E > V.current, O = E < -V.current, k = o.velocity;
1182
- d && (j({
1183
- ...o,
1171
+ const d = i.dragging, E = i.offset[a === "x" ? 0 : 1], b = i.movement[a === "x" ? 0 : 1], m = b > V.current, O = b < -V.current, D = i.velocity;
1172
+ d && (z({
1173
+ ...i,
1184
1174
  eventName: "onDrag",
1185
1175
  slideActionType: "drag"
1186
1176
  }), G.start({
1187
- value: D,
1177
+ value: E,
1188
1178
  immediate: !0,
1189
1179
  config: {
1190
- velocity: k
1180
+ velocity: D
1191
1181
  }
1192
- }), x && (m || O) && o.cancel()), o.last && (m ? U({
1182
+ }), x && (m || O) && i.cancel()), i.last && (m ? j({
1193
1183
  actionType: "drag",
1194
1184
  type: "prev"
1195
- }) : O ? U({
1185
+ }) : O ? j({
1196
1186
  actionType: "drag",
1197
1187
  type: "next"
1198
1188
  }) : G.start({
1199
- value: z.current,
1189
+ value: B.current,
1200
1190
  config: {
1201
- velocity: k
1191
+ velocity: D
1202
1192
  }
1203
1193
  }));
1204
1194
  },
@@ -1214,11 +1204,15 @@ function Ce({
1214
1204
  bottom: 0
1215
1205
  })
1216
1206
  },
1217
- from: () => [R.value.get(), R.value.get()]
1207
+ from: () => [M.value.get(), M.value.get()]
1218
1208
  }
1219
1209
  );
1210
+ function Ot(i) {
1211
+ var d, E;
1212
+ return typeof i == "number" ? l.current === i : ((d = t.find((b) => b.id === i)) == null ? void 0 : d.id) === ((E = t[l.current]) == null ? void 0 : E.id);
1213
+ }
1220
1214
  return {
1221
- carouselFragment: /* @__PURE__ */ Ot(
1215
+ carouselFragment: /* @__PURE__ */ At(
1222
1216
  "div",
1223
1217
  {
1224
1218
  ref: C,
@@ -1232,8 +1226,8 @@ function Ce({
1232
1226
  dangerouslySetInnerHTML: {
1233
1227
  __html: `
1234
1228
  :root {
1235
- --${n}-start-end-gutter: ${u * 2}px;
1236
- --${n}-gutter: ${i}px;
1229
+ --${n}-start-end-gutter: ${c * 2}px;
1230
+ --${n}-gutter: ${o}px;
1237
1231
  }
1238
1232
  [data-part-internal="${n}-Container"] {
1239
1233
  display: flex;
@@ -1243,8 +1237,8 @@ function Ce({
1243
1237
  --${n}-items-per-slide: ${s};
1244
1238
  --${n}-offset-position: 0px;
1245
1239
  --${n}-offset-modifier: 0px;
1246
- --${n}-scroll-x-value: ${c !== "freeScroll" && a === "x" ? `calc(var(--${n}-offset-position) + var(--${n}-offset-modifier))` : "0px"};
1247
- --${n}-scroll-y-value: ${c !== "freeScroll" && a === "y" ? `calc(var(--${n}-offset-position) + var(--${n}-offset-modifier))` : "0px"};
1240
+ --${n}-scroll-x-value: ${u !== "freeScroll" && a === "x" ? `calc(var(--${n}-offset-position) + var(--${n}-offset-modifier))` : "0px"};
1241
+ --${n}-scroll-y-value: ${u !== "freeScroll" && a === "y" ? `calc(var(--${n}-offset-position) + var(--${n}-offset-modifier))` : "0px"};
1248
1242
 
1249
1243
  }
1250
1244
  [data-part-internal="${n}-Track"] {
@@ -1260,12 +1254,12 @@ function Ce({
1260
1254
  height: 100%;
1261
1255
  gap: var(--${n}-gutter);
1262
1256
  transform: translate3d(var(--${n}-scroll-x-value), var(--${n}-scroll-y-value), 0px);
1263
- overflow-x: ${c === "freeScroll" ? "auto" : "visible"};
1257
+ overflow-x: ${u === "freeScroll" ? "auto" : "visible"};
1264
1258
  touch-action: ${it ? a === "x" ? "pan-y" : "pan-x" : "auto"};
1265
1259
  }
1266
1260
  [data-part-internal="${n}-Item"] {
1267
1261
  display: flex;
1268
- flex: ${c === "fixed" ? `1 0 calc(100% / var(--${n}-items-per-slide) - calc(var(--${n}-gutter) * (var(--${n}-items-per-slide) - 1)) / var(--${n}-items-per-slide) - calc(var(--${n}-start-end-gutter) / var(--${n}-items-per-slide)))` : "1"};
1262
+ flex: ${u === "fixed" ? `1 0 calc(100% / var(--${n}-items-per-slide) - calc(var(--${n}-gutter) * (var(--${n}-items-per-slide) - 1)) / var(--${n}-items-per-slide) - calc(var(--${n}-start-end-gutter) / var(--${n}-items-per-slide)))` : "1"};
1269
1263
  }
1270
1264
  `
1271
1265
  }
@@ -1274,33 +1268,34 @@ function Ce({
1274
1268
  /* @__PURE__ */ Q(
1275
1269
  "div",
1276
1270
  {
1277
- ref: y,
1271
+ ref: _,
1278
1272
  className: "ReactSpringCarouselTrack",
1279
1273
  "data-part": "Track",
1280
1274
  "data-part-internal": `${n}-Track`,
1281
1275
  ...Ct(),
1282
1276
  onScroll: () => {
1283
- T.current = !1, b.current = !1;
1277
+ I.current = !1, T.current = !1;
1284
1278
  },
1285
- ...c === "freeScroll" ? {
1279
+ ...u === "freeScroll" ? {
1286
1280
  onWheel() {
1287
- T.current = !1, b.current = !1, R.value.stop();
1281
+ I.current = !1, T.current = !1, M.value.stop();
1288
1282
  }
1289
1283
  } : {},
1290
- children: Dt.map((o, d) => /* @__PURE__ */ Q(
1284
+ children: Dt.map((i, d) => /* @__PURE__ */ Q(
1291
1285
  "div",
1292
1286
  {
1293
1287
  className: "ReactSpringCarouselItem",
1294
1288
  "data-part": "Item",
1295
1289
  "data-part-internal": `${n}-Item`,
1296
- "data-id": o.id,
1297
- children: typeof o.renderItem == "function" ? o.renderItem({
1290
+ "data-id": i.id,
1291
+ children: typeof i.renderItem == "function" ? i.renderItem({
1298
1292
  useListenToCustomEvent: st,
1299
1293
  index: d,
1300
- isClonedItem: !!o.isClonedItem
1301
- }) : o.renderItem
1294
+ isClonedItem: !!i.isClonedItem,
1295
+ isActiveItem: Ot
1296
+ }) : i.renderItem
1302
1297
  },
1303
- `${o.id}-${d}`
1298
+ `${i.id}-${d}`
1304
1299
  ))
1305
1300
  }
1306
1301
  )
@@ -1310,21 +1305,21 @@ function Ce({
1310
1305
  useListenToCustomEvent: st,
1311
1306
  slideToNextItem: () => X(),
1312
1307
  slideToPrevItem: () => q(),
1313
- slideToItem: (o) => {
1314
- if (typeof o == "number") {
1315
- if (!t[o]) {
1308
+ slideToItem: (i) => {
1309
+ if (typeof i == "number") {
1310
+ if (!t[i]) {
1316
1311
  console.warn(
1317
- `The item you're trying to slide doesn't exist. index: ${o}`
1312
+ `The item you're trying to slide doesn't exist. index: ${i}`
1318
1313
  );
1319
1314
  return;
1320
1315
  }
1321
- o > l.current ? X(o) : q(o);
1316
+ i > l.current ? X(i) : q(i);
1322
1317
  }
1323
- if (typeof o == "string") {
1324
- const d = t.findIndex((D) => D.id === o);
1318
+ if (typeof i == "string") {
1319
+ const d = t.findIndex((E) => E.id === i);
1325
1320
  if (d < 0) {
1326
1321
  console.warn(
1327
- `The item you're trying to slide doesn't exist. id: ${o}`
1322
+ `The item you're trying to slide doesn't exist. id: ${i}`
1328
1323
  );
1329
1324
  return;
1330
1325
  }
@@ -1334,5 +1329,5 @@ function Ce({
1334
1329
  };
1335
1330
  }
1336
1331
  export {
1337
- Ce as useSpringCarousel
1332
+ Oe as useSpringCarousel
1338
1333
  };