react-spring-carousel 3.0.0-beta-2.0.263 → 3.0.0-beta-2.0.3

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,10 +1,10 @@
1
- import { jsxs as At, jsx as q } from "react/jsx-runtime";
2
- import { useSpring as Pt } from "@react-spring/web";
3
- import J, { useRef as D, useEffect as tt, useState as $t } from "react";
1
+ import { jsxs as At, jsx as X } from "react/jsx-runtime";
2
+ import { useSpring as $t } from "@react-spring/web";
3
+ import q, { useRef as k, useEffect as Z, useState as Pt } from "react";
4
4
  function Nt(r, t, e) {
5
5
  return Math.max(t, Math.min(r, e));
6
6
  }
7
- const g = {
7
+ const y = {
8
8
  toVector(r, t) {
9
9
  return r === void 0 && (r = t), Array.isArray(r) ? r : [r, r];
10
10
  },
@@ -28,8 +28,8 @@ function ut(r, t, e, n = 0.15) {
28
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
30
  function Mt(r, [t, e], [n, s]) {
31
- const [[o, c], [a, d]] = r;
32
- return [ut(t, o, c, n), ut(e, a, d, s)];
31
+ const [[o, a], [u, h]] = r;
32
+ return [ut(t, o, a, n), ut(e, u, h, s)];
33
33
  }
34
34
  function Rt(r, t) {
35
35
  if (typeof r != "object" || r === null) return r;
@@ -45,7 +45,7 @@ function Lt(r) {
45
45
  var t = Rt(r, "string");
46
46
  return typeof t == "symbol" ? t : String(t);
47
47
  }
48
- function y(r, t, e) {
48
+ function w(r, t, e) {
49
49
  return t = Lt(t), t in r ? Object.defineProperty(r, t, {
50
50
  value: e,
51
51
  enumerable: !0,
@@ -53,7 +53,7 @@ function y(r, t, e) {
53
53
  writable: !0
54
54
  }) : r[t] = e, r;
55
55
  }
56
- function ft(r, t) {
56
+ function lt(r, t) {
57
57
  var e = Object.keys(r);
58
58
  if (Object.getOwnPropertySymbols) {
59
59
  var n = Object.getOwnPropertySymbols(r);
@@ -63,12 +63,12 @@ function ft(r, t) {
63
63
  }
64
64
  return e;
65
65
  }
66
- function h(r) {
66
+ function d(r) {
67
67
  for (var t = 1; t < arguments.length; t++) {
68
68
  var e = arguments[t] != null ? arguments[t] : {};
69
- t % 2 ? ft(Object(e), !0).forEach(function(n) {
70
- y(r, n, e[n]);
71
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(e)) : ft(Object(e)).forEach(function(n) {
69
+ t % 2 ? lt(Object(e), !0).forEach(function(n) {
70
+ w(r, n, e[n]);
71
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(e)) : lt(Object(e)).forEach(function(n) {
72
72
  Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(e, n));
73
73
  });
74
74
  }
@@ -96,7 +96,7 @@ const _t = {
96
96
  end: "end"
97
97
  }
98
98
  };
99
- function lt(r) {
99
+ function ft(r) {
100
100
  return r ? r[0].toUpperCase() + r.slice(1) : "";
101
101
  }
102
102
  const Vt = ["enter", "leave"];
@@ -105,7 +105,7 @@ function jt(r = !1, t) {
105
105
  }
106
106
  function Ut(r, t = "", e = !1) {
107
107
  const n = _t[r], s = n && n[t] || t;
108
- return "on" + lt(r) + lt(s) + (jt(e, s) ? "Capture" : "");
108
+ return "on" + ft(r) + ft(s) + (jt(e, s) ? "Capture" : "");
109
109
  }
110
110
  const Kt = ["gotpointercapture", "lostpointercapture"];
111
111
  function Bt(r) {
@@ -135,16 +135,16 @@ function Yt(r) {
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 Ft(r) {
138
+ function Gt(r) {
139
139
  return r.type === "touchend" || r.type === "touchcancel" ? r.changedTouches : r.targetTouches;
140
140
  }
141
141
  function wt(r) {
142
- return Y(r) ? Ft(r)[0] : r;
142
+ return Y(r) ? Gt(r)[0] : r;
143
143
  }
144
- function Wt(r) {
144
+ function Ft(r) {
145
145
  return Yt(r).map((t) => t.identifier);
146
146
  }
147
- function Q(r) {
147
+ function J(r) {
148
148
  const t = wt(r);
149
149
  return Y(r) ? t.identifier : t.pointerId;
150
150
  }
@@ -152,7 +152,7 @@ function dt(r) {
152
152
  const t = wt(r);
153
153
  return [t.clientX, t.clientY];
154
154
  }
155
- function Gt(r) {
155
+ function Wt(r) {
156
156
  const t = {};
157
157
  if ("buttons" in r && (t.buttons = r.buttons), "shiftKey" in r) {
158
158
  const {
@@ -244,38 +244,38 @@ class Jt {
244
244
  } = this;
245
245
  e.args = this.args;
246
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, Gt(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
- const I = e._delta.map(Math.abs);
249
- g.addTo(e._distance, I);
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, Wt(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
+ const l = e._delta.map(Math.abs);
249
+ y.addTo(e._distance, l);
250
250
  }
251
251
  this.axisIntent && this.axisIntent(t);
252
- const [c, a] = e._movement, [d, p] = n.threshold, {
253
- _step: u,
254
- values: E
252
+ const [a, u] = e._movement, [h, p] = n.threshold, {
253
+ _step: c,
254
+ values: b
255
255
  } = e;
256
- if (n.hasCustomTransform ? (u[0] === !1 && (u[0] = Math.abs(c) >= d && E[0]), u[1] === !1 && (u[1] = Math.abs(a) >= p && E[1])) : (u[0] === !1 && (u[0] = Math.abs(c) >= d && Math.sign(c) * d), u[1] === !1 && (u[1] = Math.abs(a) >= p && Math.sign(a) * p)), e.intentional = u[0] !== !1 || u[1] !== !1, !e.intentional) return;
256
+ if (n.hasCustomTransform ? (c[0] === !1 && (c[0] = Math.abs(a) >= h && b[0]), c[1] === !1 && (c[1] = Math.abs(u) >= p && b[1])) : (c[0] === !1 && (c[0] = Math.abs(a) >= h && Math.sign(a) * h), c[1] === !1 && (c[1] = Math.abs(u) >= p && Math.sign(u) * p)), e.intentional = c[0] !== !1 || c[1] !== !1, !e.intentional) return;
257
257
  const m = [0, 0];
258
258
  if (n.hasCustomTransform) {
259
- const [I, l] = E;
260
- m[0] = u[0] !== !1 ? I - u[0] : 0, m[1] = u[1] !== !1 ? l - u[1] : 0;
259
+ const [l, L] = b;
260
+ m[0] = c[0] !== !1 ? l - c[0] : 0, m[1] = c[1] !== !1 ? L - c[1] : 0;
261
261
  } else
262
- m[0] = u[0] !== !1 ? c - u[0] : 0, m[1] = u[1] !== !1 ? a - u[1] : 0;
262
+ m[0] = c[0] !== !1 ? a - c[0] : 0, m[1] = c[1] !== !1 ? u - c[1] : 0;
263
263
  this.restrictToAxis && !e._blocked && this.restrictToAxis(m);
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 = z(n.bounds, e)), this.setup && this.setup()), e.movement = m, this.computeOffset()));
266
- const [k, C] = e.offset, [[$, j], [T, O]] = e._bounds;
267
- e.overflow = [k < $ ? -1 : k > j ? 1 : 0, C < T ? -1 : C > O ? 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
- const A = e._active ? n.rubberband || [0, 0] : [0, 0];
269
- if (e.offset = Mt(e._bounds, e.offset, A), e.delta = g.sub(e.offset, P), this.computeMovement(), N && (!e.last || o > qt)) {
270
- e.delta = g.sub(e.offset, P);
271
- const I = e.delta.map(Math.abs);
272
- g.addTo(e.distance, I), e.direction = e.delta.map(Math.sign), e._direction = e._delta.map(Math.sign), !e.first && o > 0 && (e.velocity = [I[0] / o, I[1] / o], e.timeDelta = o);
264
+ const $ = e.offset, D = e._active && !e._blocked || e.active;
265
+ D && (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 = z(n.bounds, e)), this.setup && this.setup()), e.movement = m, this.computeOffset()));
266
+ const [S, A] = e.offset, [[P, x], [C, O]] = e._bounds;
267
+ e.overflow = [S < P ? -1 : S > x ? 1 : 0, A < C ? -1 : A > O ? 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
+ const R = e._active ? n.rubberband || [0, 0] : [0, 0];
269
+ if (e.offset = Mt(e._bounds, e.offset, R), e.delta = y.sub(e.offset, $), this.computeMovement(), D && (!e.last || o > qt)) {
270
+ e.delta = y.sub(e.offset, $);
271
+ const l = e.delta.map(Math.abs);
272
+ y.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() {
276
276
  const t = this.state, e = this.shared, n = this.config;
277
277
  if (t._active || this.clean(), (t._blocked || !t.intentional) && !t._force && !n.triggerAllEvents) return;
278
- const s = this.handler(h(h(h({}, e), t), {}, {
278
+ const s = this.handler(d(d(d({}, e), t), {}, {
279
279
  [this.aliasKey]: t.values
280
280
  }));
281
281
  s !== void 0 && (t.memo = s);
@@ -293,7 +293,7 @@ function Qt([r, t], e) {
293
293
  }
294
294
  class Zt extends Jt {
295
295
  constructor(...t) {
296
- super(...t), y(this, "aliasKey", "xy");
296
+ super(...t), w(this, "aliasKey", "xy");
297
297
  }
298
298
  reset() {
299
299
  super.reset(), this.state.axis = void 0;
@@ -302,10 +302,10 @@ class Zt extends Jt {
302
302
  this.state.offset = [0, 0], this.state.lastOffset = [0, 0];
303
303
  }
304
304
  computeOffset() {
305
- this.state.offset = g.add(this.state.lastOffset, this.state.movement);
305
+ this.state.offset = y.add(this.state.lastOffset, this.state.movement);
306
306
  }
307
307
  computeMovement() {
308
- this.state.movement = g.sub(this.state.offset, this.state.lastOffset);
308
+ this.state.movement = y.sub(this.state.offset, this.state.lastOffset);
309
309
  }
310
310
  axisIntent(t) {
311
311
  const e = this.state, n = this.config;
@@ -327,12 +327,12 @@ class Zt extends Jt {
327
327
  }
328
328
  }
329
329
  }
330
- const pt = (r) => r, mt = 0.15, rt = {
330
+ const pt = (r) => r, gt = 0.15, et = {
331
331
  enabled(r = !0) {
332
332
  return r;
333
333
  },
334
334
  eventOptions(r, t, e) {
335
- return h(h({}, e.shared.eventOptions), r);
335
+ return d(d({}, e.shared.eventOptions), r);
336
336
  },
337
337
  preventDefault(r = !1) {
338
338
  return r;
@@ -343,33 +343,33 @@ const pt = (r) => r, mt = 0.15, rt = {
343
343
  rubberband(r = 0) {
344
344
  switch (r) {
345
345
  case !0:
346
- return [mt, mt];
346
+ return [gt, gt];
347
347
  case !1:
348
348
  return [0, 0];
349
349
  default:
350
- return g.toVector(r);
350
+ return y.toVector(r);
351
351
  }
352
352
  },
353
353
  from(r) {
354
354
  if (typeof r == "function") return r;
355
- if (r != null) return g.toVector(r);
355
+ if (r != null) return y.toVector(r);
356
356
  },
357
357
  transform(r, t, e) {
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
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;
362
+ const a = s(o);
363
+ return (!isFinite(a[0]) || !isFinite(a[1])) && console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${a[0]},${[1]}]`), a;
364
364
  };
365
365
  }
366
366
  return n || pt;
367
367
  },
368
368
  threshold(r) {
369
- return g.toVector(r, 0);
369
+ return y.toVector(r, 0);
370
370
  }
371
371
  };
372
- process.env.NODE_ENV === "development" && Object.assign(rt, {
372
+ process.env.NODE_ENV === "development" && Object.assign(et, {
373
373
  domTarget(r) {
374
374
  if (r !== void 0)
375
375
  throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
@@ -386,7 +386,7 @@ process.env.NODE_ENV === "development" && Object.assign(rt, {
386
386
  return NaN;
387
387
  }
388
388
  });
389
- const te = 0, L = h(h({}, rt), {}, {
389
+ const te = 0, V = d(d({}, et), {}, {
390
390
  axis(r, t, {
391
391
  axis: e
392
392
  }) {
@@ -397,7 +397,7 @@ const te = 0, L = h(h({}, rt), {}, {
397
397
  },
398
398
  bounds(r = {}) {
399
399
  if (typeof r == "function")
400
- return (o) => L.bounds(r(o));
400
+ return (o) => V.bounds(r(o));
401
401
  if ("current" in r)
402
402
  return () => r.current;
403
403
  if (typeof HTMLElement == "function" && r instanceof HTMLElement)
@@ -410,7 +410,7 @@ const te = 0, L = h(h({}, rt), {}, {
410
410
  } = r;
411
411
  return [[t, e], [n, s]];
412
412
  }
413
- }), gt = {
413
+ }), mt = {
414
414
  ArrowRight: (r, t = 1) => [r * t, 0],
415
415
  ArrowLeft: (r, t = 1) => [-1 * r * t, 0],
416
416
  ArrowUp: (r, t = 1) => [0, -1 * r * t],
@@ -418,7 +418,7 @@ const te = 0, L = h(h({}, rt), {}, {
418
418
  };
419
419
  class ee extends Zt {
420
420
  constructor(...t) {
421
- super(...t), y(this, "ingKey", "dragging");
421
+ super(...t), w(this, "ingKey", "dragging");
422
422
  }
423
423
  reset() {
424
424
  super.reset();
@@ -434,7 +434,7 @@ class ee extends Zt {
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 = L.bounds(s);
437
+ t._bounds = V.bounds(s);
438
438
  }
439
439
  }
440
440
  cancel() {
@@ -453,7 +453,7 @@ class ee extends Zt {
453
453
  const e = this.config, n = this.state;
454
454
  if (t.buttons != null && (Array.isArray(e.pointerButtons) ? !e.pointerButtons.includes(t.buttons) : e.pointerButtons !== -1 && e.pointerButtons !== t.buttons)) return;
455
455
  const s = this.ctrl.setEventIds(t);
456
- e.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && n._pointerActive) && (this.start(t), this.setupPointer(t), n._pointerId = Q(t), n._pointerActive = !0, this.computeValues(dt(t)), this.computeInitial(), e.preventScrollAxis && bt(t) !== "mouse" ? (n._active = !1, this.setupScrollPrevention(t)) : e.delay > 0 ? (this.setupDelayTrigger(t), e.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
456
+ e.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && n._pointerActive) && (this.start(t), this.setupPointer(t), n._pointerId = J(t), n._pointerActive = !0, this.computeValues(dt(t)), this.computeInitial(), e.preventScrollAxis && bt(t) !== "mouse" ? (n._active = !1, this.setupScrollPrevention(t)) : e.delay > 0 ? (this.setupDelayTrigger(t), e.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
457
457
  }
458
458
  startPointerDrag(t) {
459
459
  const e = this.state;
@@ -462,10 +462,10 @@ class ee extends Zt {
462
462
  pointerMove(t) {
463
463
  const e = this.state, n = this.config;
464
464
  if (!e._pointerActive) return;
465
- const s = Q(t);
465
+ const s = J(t);
466
466
  if (e._pointerId !== void 0 && s !== e._pointerId) return;
467
467
  const o = dt(t);
468
- if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = g.sub(o, e._values), this.computeValues(o)), g.addTo(e._movement, e._delta), this.compute(t), e._delayed && e.intentional) {
468
+ if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = y.sub(o, e._values), this.computeValues(o)), y.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
  }
@@ -491,17 +491,17 @@ class ee extends Zt {
491
491
  }
492
492
  const e = this.state, n = this.config;
493
493
  if (!e._active || !e._pointerActive) return;
494
- const s = Q(t);
494
+ const s = J(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 [o, c] = e._distance;
498
- if (e.tap = o <= n.tapsThreshold && c <= n.tapsThreshold, e.tap && n.filterTaps)
497
+ const [o, a] = e._distance;
498
+ if (e.tap = o <= n.tapsThreshold && a <= n.tapsThreshold, e.tap && n.filterTaps)
499
499
  e._force = !0;
500
500
  else {
501
- const [a, d] = e._delta, [p, u] = e._movement, [E, m] = n.swipe.velocity, [P, N] = n.swipe.distance, k = n.swipe.duration;
502
- if (e.elapsedTime < k) {
503
- const C = Math.abs(a / e.timeDelta), $ = Math.abs(d / e.timeDelta);
504
- C > E && Math.abs(p) > P && (e.swipe[0] = Math.sign(a)), $ > m && Math.abs(u) > N && (e.swipe[1] = Math.sign(d));
501
+ const [u, h] = e._delta, [p, c] = e._movement, [b, m] = n.swipe.velocity, [$, D] = n.swipe.distance, S = n.swipe.duration;
502
+ if (e.elapsedTime < S) {
503
+ const A = Math.abs(u / e.timeDelta), P = Math.abs(h / e.timeDelta);
504
+ A > b && Math.abs(p) > $ && (e.swipe[0] = Math.sign(u)), P > m && Math.abs(c) > D && (e.swipe[1] = Math.sign(h));
505
505
  }
506
506
  }
507
507
  this.emit();
@@ -540,14 +540,14 @@ class ee extends Zt {
540
540
  }, this.config.delay);
541
541
  }
542
542
  keyDown(t) {
543
- const e = gt[t.key];
543
+ const e = mt[t.key];
544
544
  if (e) {
545
545
  const n = this.state, s = t.shiftKey ? 10 : t.altKey ? 0.1 : 1;
546
- this.start(t), n._delta = e(this.config.keyboardDisplacement, s), n._keyboardActive = !0, g.addTo(n._movement, n._delta), this.compute(t), this.emit();
546
+ this.start(t), n._delta = e(this.config.keyboardDisplacement, s), n._keyboardActive = !0, y.addTo(n._movement, n._delta), this.compute(t), this.emit();
547
547
  }
548
548
  }
549
549
  keyUp(t) {
550
- t.key in gt && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
550
+ t.key in mt && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
551
551
  }
552
552
  bind(t) {
553
553
  const e = this.config.device;
@@ -560,18 +560,18 @@ class ee extends Zt {
560
560
  function re(r) {
561
561
  "persist" in r && typeof r.persist == "function" && r.persist();
562
562
  }
563
- const V = typeof window < "u" && window.document && window.document.createElement;
563
+ const j = typeof window < "u" && window.document && window.document.createElement;
564
564
  function Et() {
565
- return V && "ontouchstart" in window;
565
+ return j && "ontouchstart" in window;
566
566
  }
567
567
  function ne() {
568
- return Et() || V && window.navigator.maxTouchPoints > 1;
568
+ return Et() || j && window.navigator.maxTouchPoints > 1;
569
569
  }
570
570
  function se() {
571
- return V && "onpointerdown" in window;
571
+ return j && "onpointerdown" in window;
572
572
  }
573
573
  function ie() {
574
- return V && "exitPointerLock" in window.document;
574
+ return j && "exitPointerLock" in window.document;
575
575
  }
576
576
  function oe() {
577
577
  try {
@@ -580,18 +580,18 @@ function oe() {
580
580
  return !1;
581
581
  }
582
582
  }
583
- const x = {
584
- isBrowser: V,
583
+ const I = {
584
+ isBrowser: j,
585
585
  gesture: oe(),
586
586
  touch: Et(),
587
587
  touchscreen: ne(),
588
588
  pointer: se(),
589
589
  pointerLock: ie()
590
- }, ae = 250, ce = 180, ue = 0.5, fe = 50, le = 250, de = 10, vt = {
590
+ }, ae = 250, ce = 180, ue = 0.5, le = 50, fe = 250, de = 10, vt = {
591
591
  mouse: 0,
592
592
  touch: 0,
593
593
  pen: 8
594
- }, Tt = h(h({}, L), {}, {
594
+ }, Tt = d(d({}, V), {}, {
595
595
  device(r, t, {
596
596
  pointer: {
597
597
  touch: e = !1,
@@ -599,12 +599,12 @@ const x = {
599
599
  mouse: s = !1
600
600
  } = {}
601
601
  }) {
602
- return this.pointerLock = n && x.pointerLock, x.touch && e ? "touch" : this.pointerLock ? "mouse" : x.pointer && !s ? "pointer" : x.touch ? "touch" : "mouse";
602
+ return this.pointerLock = n && I.pointerLock, I.touch && e ? "touch" : this.pointerLock ? "mouse" : I.pointer && !s ? "pointer" : I.touch ? "touch" : "mouse";
603
603
  },
604
604
  preventScrollAxis(r, t, {
605
605
  preventScroll: e
606
606
  }) {
607
- if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && r ? ae : void 0, !(!x.touchscreen || e === !1))
607
+ if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && r ? ae : void 0, !(!I.touchscreen || e === !1))
608
608
  return r || (e !== void 0 ? "y" : void 0);
609
609
  },
610
610
  pointerCapture(r, t, {
@@ -621,17 +621,17 @@ const x = {
621
621
  tapsThreshold: n = 3,
622
622
  axis: s = void 0
623
623
  }) {
624
- const o = g.toVector(r, e ? n : s ? 1 : 0);
624
+ const o = y.toVector(r, e ? n : s ? 1 : 0);
625
625
  return this.filterTaps = e, this.tapsThreshold = n, o;
626
626
  },
627
627
  swipe({
628
628
  velocity: r = ue,
629
- distance: t = fe,
630
- duration: e = le
629
+ distance: t = le,
630
+ duration: e = fe
631
631
  } = {}) {
632
632
  return {
633
- velocity: this.transform(g.toVector(r)),
634
- distance: this.transform(g.toVector(t)),
633
+ velocity: this.transform(y.toVector(r)),
634
+ distance: this.transform(y.toVector(t)),
635
635
  duration: e
636
636
  };
637
637
  },
@@ -646,7 +646,7 @@ const x = {
646
646
  }
647
647
  },
648
648
  axisThreshold(r) {
649
- return r ? h(h({}, vt), r) : vt;
649
+ return r ? d(d({}, vt), r) : vt;
650
650
  },
651
651
  keyboardDisplacement(r = de) {
652
652
  return r;
@@ -679,41 +679,41 @@ process.env.NODE_ENV === "development" && Object.assign(Tt, {
679
679
  return NaN;
680
680
  }
681
681
  });
682
- h(h({}, rt), {}, {
682
+ d(d({}, et), {}, {
683
683
  device(r, t, {
684
684
  shared: e,
685
685
  pointer: {
686
686
  touch: n = !1
687
687
  } = {}
688
688
  }) {
689
- if (e.target && !x.touch && x.gesture) return "gesture";
690
- if (x.touch && n) return "touch";
691
- if (x.touchscreen) {
692
- if (x.pointer) return "pointer";
693
- if (x.touch) return "touch";
689
+ if (e.target && !I.touch && I.gesture) return "gesture";
690
+ if (I.touch && n) return "touch";
691
+ if (I.touchscreen) {
692
+ if (I.pointer) return "pointer";
693
+ if (I.touch) return "touch";
694
694
  }
695
695
  },
696
696
  bounds(r, t, {
697
697
  scaleBounds: e = {},
698
698
  angleBounds: n = {}
699
699
  }) {
700
- const s = (c) => {
701
- const a = ht(z(e, c), {
700
+ const s = (a) => {
701
+ const u = ht(z(e, a), {
702
702
  min: -1 / 0,
703
703
  max: 1 / 0
704
704
  });
705
- return [a.min, a.max];
706
- }, o = (c) => {
707
- const a = ht(z(n, c), {
705
+ return [u.min, u.max];
706
+ }, o = (a) => {
707
+ const u = ht(z(n, a), {
708
708
  min: -1 / 0,
709
709
  max: 1 / 0
710
710
  });
711
- return [a.min, a.max];
711
+ return [u.min, u.max];
712
712
  };
713
- return typeof e != "function" && typeof n != "function" ? [s(), o()] : (c) => [s(c), o(c)];
713
+ return typeof e != "function" && typeof n != "function" ? [s(), o()] : (a) => [s(a), o(a)];
714
714
  },
715
715
  threshold(r, t, e) {
716
- return this.lockDirection = e.axis === "lock", g.toVector(r, this.lockDirection ? [0.1, 3] : 0);
716
+ return this.lockDirection = e.axis === "lock", y.toVector(r, this.lockDirection ? [0.1, 3] : 0);
717
717
  },
718
718
  modifierKey(r) {
719
719
  return r === void 0 ? "ctrlKey" : r;
@@ -722,31 +722,31 @@ h(h({}, rt), {}, {
722
722
  return r;
723
723
  }
724
724
  });
725
- h(h({}, L), {}, {
725
+ d(d({}, V), {}, {
726
726
  mouseOnly: (r = !0) => r
727
727
  });
728
- h(h({}, L), {}, {
728
+ d(d({}, V), {}, {
729
729
  mouseOnly: (r = !0) => r
730
730
  });
731
- const xt = /* @__PURE__ */ new Map(), et = /* @__PURE__ */ new Map();
731
+ const xt = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map();
732
732
  function he(r) {
733
- xt.set(r.key, r.engine), et.set(r.key, r.resolver);
733
+ xt.set(r.key, r.engine), tt.set(r.key, r.resolver);
734
734
  }
735
735
  const pe = {
736
736
  key: "drag",
737
737
  engine: ee,
738
738
  resolver: Tt
739
739
  };
740
- function me(r, t) {
740
+ function ge(r, t) {
741
741
  if (r == null) return {};
742
742
  var e = {}, n = Object.keys(r), s, o;
743
743
  for (o = 0; o < n.length; o++)
744
744
  s = n[o], !(t.indexOf(s) >= 0) && (e[s] = r[s]);
745
745
  return e;
746
746
  }
747
- function ge(r, t) {
747
+ function me(r, t) {
748
748
  if (r == null) return {};
749
- var e = me(r, t), n, s;
749
+ var e = ge(r, t), n, s;
750
750
  if (Object.getOwnPropertySymbols) {
751
751
  var o = Object.getOwnPropertySymbols(r);
752
752
  for (s = 0; s < o.length; s++)
@@ -762,7 +762,7 @@ const ve = {
762
762
  enabled(r = !0) {
763
763
  return r;
764
764
  },
765
- window(r = x.isBrowser ? window : void 0) {
765
+ window(r = I.isBrowser ? window : void 0) {
766
766
  return r;
767
767
  },
768
768
  eventOptions({
@@ -802,47 +802,47 @@ function _e(r, t, e = {}) {
802
802
  const n = r, {
803
803
  target: s,
804
804
  eventOptions: o,
805
- window: c,
806
- enabled: a,
807
- transform: d
808
- } = n, p = ge(n, ye);
805
+ window: a,
806
+ enabled: u,
807
+ transform: h
808
+ } = n, p = me(n, ye);
809
809
  if (e.shared = B({
810
810
  target: s,
811
811
  eventOptions: o,
812
- window: c,
813
- enabled: a,
814
- transform: d
812
+ window: a,
813
+ enabled: u,
814
+ transform: h
815
815
  }, ve), t) {
816
- const u = et.get(t);
817
- e[t] = B(h({
816
+ const c = tt.get(t);
817
+ e[t] = B(d({
818
818
  shared: e.shared
819
- }, p), u);
819
+ }, p), c);
820
820
  } else
821
- for (const u in p) {
822
- const E = et.get(u);
823
- if (E)
824
- e[u] = B(h({
821
+ for (const c in p) {
822
+ const b = tt.get(c);
823
+ if (b)
824
+ e[c] = B(d({
825
825
  shared: e.shared
826
- }, p[u]), E);
827
- else if (process.env.NODE_ENV === "development" && !["drag", "pinch", "scroll", "wheel", "move", "hover"].includes(u)) {
828
- if (u === "domTarget")
826
+ }, p[c]), b);
827
+ else if (process.env.NODE_ENV === "development" && !["drag", "pinch", "scroll", "wheel", "move", "hover"].includes(c)) {
828
+ if (c === "domTarget")
829
829
  throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
830
- console.warn(`[@use-gesture]: Unknown config key \`${u}\` was used. Please read the documentation for further information.`);
830
+ console.warn(`[@use-gesture]: Unknown config key \`${c}\` was used. Please read the documentation for further information.`);
831
831
  }
832
832
  }
833
833
  return e;
834
834
  }
835
835
  class It {
836
836
  constructor(t, e) {
837
- y(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = e;
837
+ w(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = e;
838
838
  }
839
839
  add(t, e, n, s, o) {
840
- const c = this._listeners, a = zt(e, n), d = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, p = h(h({}, d), o);
841
- t.addEventListener(a, s, p);
842
- const u = () => {
843
- t.removeEventListener(a, s, p), c.delete(u);
840
+ const a = this._listeners, u = zt(e, n), h = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, p = d(d({}, h), o);
841
+ t.addEventListener(u, s, p);
842
+ const c = () => {
843
+ t.removeEventListener(u, s, p), a.delete(c);
844
844
  };
845
- return c.add(u), u;
845
+ return a.add(c), c;
846
846
  }
847
847
  clean() {
848
848
  this._listeners.forEach((t) => t()), this._listeners.clear();
@@ -850,7 +850,7 @@ class It {
850
850
  }
851
851
  class be {
852
852
  constructor() {
853
- y(this, "_timeouts", /* @__PURE__ */ new Map());
853
+ w(this, "_timeouts", /* @__PURE__ */ new Map());
854
854
  }
855
855
  add(t, e, n = 140, ...s) {
856
856
  this.remove(t), this._timeouts.set(t, window.setTimeout(e, n, ...s));
@@ -865,7 +865,7 @@ class be {
865
865
  }
866
866
  class we {
867
867
  constructor(t) {
868
- y(this, "gestures", /* @__PURE__ */ new Set()), y(this, "_targetEventStore", new It(this)), y(this, "gestureEventStores", {}), y(this, "gestureTimeoutStores", {}), y(this, "handlers", {}), y(this, "config", {}), y(this, "pointerIds", /* @__PURE__ */ new Set()), y(this, "touchIds", /* @__PURE__ */ new Set()), y(this, "state", {
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: {
870
870
  shiftKey: !1,
871
871
  metaKey: !1,
@@ -876,7 +876,7 @@ class we {
876
876
  }
877
877
  setEventIds(t) {
878
878
  if (Y(t))
879
- return this.touchIds = new Set(Wt(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,17 +899,17 @@ class we {
899
899
  let s;
900
900
  if (!(e.target && (s = e.target(), !s))) {
901
901
  if (e.enabled) {
902
- for (const c of this.gestures) {
903
- const a = this.config[c], d = yt(n, a.eventOptions, !!s);
904
- if (a.enabled) {
905
- const p = xt.get(c);
906
- new p(this, t, c).bind(d);
902
+ for (const a of this.gestures) {
903
+ const u = this.config[a], h = yt(n, u.eventOptions, !!s);
904
+ if (u.enabled) {
905
+ const p = xt.get(a);
906
+ new p(this, t, a).bind(h);
907
907
  }
908
908
  }
909
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
- event: a,
910
+ for (const a in this.nativeHandlers)
911
+ o(a, "", (u) => this.nativeHandlers[a](d(d({}, this.state.shared), {}, {
912
+ event: u,
913
913
  args: t
914
914
  })), void 0, !0);
915
915
  }
@@ -918,33 +918,33 @@ class we {
918
918
  if (!s) return n;
919
919
  for (const o in n) {
920
920
  const {
921
- device: c,
922
- capture: a,
923
- passive: d
921
+ device: a,
922
+ capture: u,
923
+ passive: h
924
924
  } = Bt(o);
925
- this._targetEventStore.add(s, c, "", n[o], {
926
- capture: a,
927
- passive: d
925
+ this._targetEventStore.add(s, a, "", n[o], {
926
+ capture: u,
927
+ passive: h
928
928
  });
929
929
  }
930
930
  }
931
931
  }
932
932
  }
933
- function R(r, t) {
933
+ function M(r, t) {
934
934
  r.gestures.add(t), r.gestureEventStores[t] = new It(r, t), r.gestureTimeoutStores[t] = new be();
935
935
  }
936
936
  function Ee(r, t) {
937
- t.drag && R(r, "drag"), t.wheel && R(r, "wheel"), t.scroll && R(r, "scroll"), t.move && R(r, "move"), t.pinch && R(r, "pinch"), t.hover && R(r, "hover");
937
+ t.drag && M(r, "drag"), t.wheel && M(r, "wheel"), t.scroll && M(r, "scroll"), t.move && M(r, "move"), t.pinch && M(r, "pinch"), t.hover && M(r, "hover");
938
938
  }
939
- const yt = (r, t, e) => (n, s, o, c = {}, a = !1) => {
940
- var d, p;
941
- const u = (d = c.capture) !== null && d !== void 0 ? d : t.capture, E = (p = c.passive) !== null && p !== void 0 ? p : t.passive;
942
- let m = a ? n : Ut(n, s, u);
943
- e && E && (m += "Passive"), r[m] = r[m] || [], r[m].push(o);
939
+ const yt = (r, t, e) => (n, s, o, a = {}, u = !1) => {
940
+ var h, p;
941
+ const c = (h = a.capture) !== null && h !== void 0 ? h : t.capture, b = (p = a.passive) !== null && p !== void 0 ? p : t.passive;
942
+ let m = u ? n : Ut(n, s, c);
943
+ e && b && (m += "Passive"), r[m] = r[m] || [], r[m].push(o);
944
944
  };
945
945
  function Te(r, t = {}, e, n) {
946
- const s = J.useMemo(() => new we(r), []);
947
- if (s.applyHandlers(r, n), s.applyConfig(t, e), J.useEffect(s.effect.bind(s)), J.useEffect(() => s.clean.bind(s), []), t.target === void 0)
946
+ const s = q.useMemo(() => new we(r), []);
947
+ if (s.applyHandlers(r, n), s.applyConfig(t, e), q.useEffect(s.effect.bind(s)), q.useEffect(() => s.clean.bind(s), []), t.target === void 0)
948
948
  return s.bind.bind(s);
949
949
  }
950
950
  function xe(r, t) {
@@ -952,20 +952,20 @@ function xe(r, t) {
952
952
  drag: r
953
953
  }, t || {}, "drag");
954
954
  }
955
- const Z = "RSC::Event";
955
+ const Q = "RSC::Event";
956
956
  function Ie() {
957
- const r = D(null);
957
+ const r = k(null);
958
958
  function t(n) {
959
- tt(() => {
959
+ Z(() => {
960
960
  r.current || (r.current = document.createElement("div"));
961
961
  function s(o) {
962
962
  n(o.detail);
963
963
  }
964
964
  if (r.current)
965
- return r.current.addEventListener(Z, s, !1), () => {
965
+ return r.current.addEventListener(Q, s, !1), () => {
966
966
  var o;
967
967
  (o = r.current) == null || o.removeEventListener(
968
- Z,
968
+ Q,
969
969
  s,
970
970
  !1
971
971
  );
@@ -974,7 +974,7 @@ function Ie() {
974
974
  }
975
975
  function e(n) {
976
976
  if (r.current) {
977
- const s = new CustomEvent(Z, {
977
+ const s = new CustomEvent(Q, {
978
978
  detail: n
979
979
  });
980
980
  r.current.dispatchEvent(s);
@@ -991,20 +991,19 @@ function Oe({
991
991
  withLoop: e = !1,
992
992
  id: n,
993
993
  itemsPerSlide: s = 1,
994
- gutter: o = 0,
995
- startEndGutter: c = 0,
994
+ responsiveGutter: o = [{ breakpoint: 0, gutter: 0, startEndGutter: 0 }],
996
995
  carouselAxis: a = "x",
997
- startingPosition: d = "start",
998
- enableGestures: p = !0,
999
- slideWhenDragThresholdIsReached: u = !0,
1000
- onInit: E,
1001
- initialActiveItem: m = 0
996
+ startingPosition: u = "start",
997
+ enableGestures: h = !0,
998
+ slideWhenDragThresholdIsReached: p = !0,
999
+ onInit: c,
1000
+ initialActiveItem: b = 0
1002
1001
  }) {
1003
- const [P, N] = $t(!1), k = D(r), C = D(null), $ = D(null), j = D(0), T = D(0), O = D(!e), A = D(!1), I = D(0), l = D(0), [F, W] = Pt(
1002
+ const [m, $] = Pt(!1), D = k(r), S = k(null), A = k(null), P = k(0), x = k(0), C = k(!e), O = k(!1), R = k(0), l = k(0), [L, G] = $t(
1004
1003
  () => ({
1005
1004
  value: 0,
1006
1005
  onChange({ value: i }) {
1007
- C.current.style.setProperty(
1006
+ S.current.style.setProperty(
1008
1007
  `--${n}-offset-position`,
1009
1008
  `${i.value}px`
1010
1009
  );
@@ -1023,128 +1022,138 @@ function Oe({
1023
1022
  id: `next-repeated-item-${i.id}`,
1024
1023
  isClonedItem: !0
1025
1024
  }))
1026
- ] : t, { useListenToCustomEvent: nt, emitEvent: U } = Ie();
1027
- function G(i) {
1028
- k.current && (A.current || M({
1025
+ ] : t, { useListenToCustomEvent: rt, emitEvent: U } = Ie();
1026
+ function kt() {
1027
+ const { totalGutterCssVar: i } = nt();
1028
+ return i;
1029
+ }
1030
+ function F(i) {
1031
+ D.current && (O.current || N({
1029
1032
  type: "next",
1030
1033
  toIndex: i,
1031
1034
  actionType: "click"
1032
1035
  }));
1033
1036
  }
1034
- function H(i) {
1035
- k.current && (O.current || M({
1037
+ function W(i) {
1038
+ D.current && (C.current || N({
1036
1039
  type: "prev",
1037
1040
  toIndex: i,
1038
1041
  actionType: "click"
1039
1042
  }));
1040
1043
  }
1041
- function M({
1044
+ function N({
1042
1045
  type: i,
1043
1046
  shouldAnimate: f = !0,
1044
- toIndex: _,
1045
- actionType: v
1047
+ toIndex: v,
1048
+ actionType: g
1046
1049
  }) {
1047
1050
  var it, ot;
1048
- const S = !f;
1049
- O.current = !1, A.current = !1;
1050
- let b = F.value.get(), w = 0;
1051
- if (i === "next" && (l.current += 1), i === "prev" && (l.current === 0 ? l.current = t.length - 1 : l.current -= 1), _ !== void 0 && (l.current = _), i === "next") {
1052
- const K = X(
1053
- e ? T.current * (t.length * 2) : 0
1051
+ const _ = !f;
1052
+ C.current = !1, O.current = !1;
1053
+ let E = L.value.get(), T = 0;
1054
+ if (i === "next" && (l.current += 1), i === "prev" && (l.current === 0 ? l.current = t.length - 1 : l.current -= 1), v !== void 0 && (l.current = v), i === "next") {
1055
+ const K = H(
1056
+ e ? x.current * (t.length * 2) : 0
1054
1057
  );
1055
- w = -(l.current * T.current), e && l.current === t.length && (l.current = 0, b = b + T.current * t.length, w = 0), !e && Math.abs(w) >= K && (A.current = !0, w = -K);
1058
+ T = -(l.current * x.current), e && l.current === t.length && (l.current = 0, E = E + x.current * t.length, T = 0), !e && Math.abs(T) >= K && (O.current = !0, T = -K);
1056
1059
  }
1057
- i === "prev" && (w = -(l.current * T.current), l.current === t.length - 1 && (b = b - t.length * T.current), !e && w >= 0 && (O.current = !0, w = 0)), j.current = w, v === "resize" ? (w = -(l.current * T.current), U({
1060
+ i === "prev" && (T = -(l.current * x.current), l.current === t.length - 1 && (E = E - t.length * x.current), !e && T >= 0 && (C.current = !0, T = 0)), P.current = T, g === "resize" ? (T = -(l.current * x.current), U({
1058
1061
  eventName: "onResize",
1059
- sliceActionType: v,
1062
+ sliceActionType: g,
1060
1063
  slideDirection: i,
1061
1064
  currentItem: {
1062
1065
  index: l.current,
1063
1066
  id: ((it = t.at(l.current)) == null ? void 0 : it.id) ?? "",
1064
- startReached: O.current,
1065
- endReached: A.current
1067
+ startReached: C.current,
1068
+ endReached: O.current
1066
1069
  }
1067
1070
  })) : U({
1068
1071
  eventName: "onSlideStartChange",
1069
- sliceActionType: v,
1072
+ sliceActionType: g,
1070
1073
  slideDirection: i,
1071
1074
  nextItem: {
1072
1075
  index: l.current,
1073
1076
  id: ((ot = t.at(l.current)) == null ? void 0 : ot.id) ?? "",
1074
- startReached: O.current,
1075
- endReached: A.current
1077
+ startReached: C.current,
1078
+ endReached: O.current
1076
1079
  }
1077
- }), W.start({
1078
- immediate: S,
1080
+ }), G.start({
1081
+ immediate: _,
1079
1082
  from: {
1080
- value: b
1083
+ value: E
1081
1084
  },
1082
1085
  to: {
1083
- value: w
1086
+ value: T
1084
1087
  },
1085
1088
  onRest({ finished: K }) {
1086
1089
  var at;
1087
1090
  K && U({
1088
1091
  eventName: "onSlideChangeComplete",
1089
- sliceActionType: v,
1092
+ sliceActionType: g,
1090
1093
  slideDirection: i,
1091
1094
  currentItem: {
1092
1095
  index: l.current,
1093
1096
  id: ((at = t.at(l.current)) == null ? void 0 : at.id) ?? "",
1094
- startReached: O.current,
1095
- endReached: A.current
1097
+ startReached: C.current,
1098
+ endReached: O.current
1096
1099
  }
1097
1100
  });
1098
1101
  }
1099
1102
  });
1100
1103
  }
1101
1104
  function Dt() {
1102
- const i = $.current.children[0];
1105
+ const i = A.current.children[0];
1103
1106
  let f = 0;
1104
- return f = i.getBoundingClientRect()[a === "x" ? "width" : "height"] + o, f;
1107
+ return f = i.getBoundingClientRect()[a === "x" ? "width" : "height"] + kt(), f;
1105
1108
  }
1106
- function X(i) {
1107
- const f = $.current;
1109
+ function H(i) {
1110
+ const f = A.current;
1108
1111
  return f[a === "x" ? "scrollWidth" : "scrollHeight"] - f.getBoundingClientRect()[a === "x" ? "width" : "height"] - i;
1109
1112
  }
1110
- function kt() {
1111
- let i = 0;
1112
- const f = getComputedStyle(
1113
- document.documentElement
1114
- ).getPropertyValue(`--${n}-start-end-gutter`);
1115
- return f.includes("px") && (i = Number(
1116
- f.replace("px", "")
1117
- )), { totalStartEndGutterCssVar: i };
1118
- }
1119
- tt(() => {
1120
- function i(v, S) {
1121
- switch (v) {
1113
+ function nt() {
1114
+ let i = 0, f = 0;
1115
+ if (S.current) {
1116
+ const v = window.getComputedStyle(
1117
+ S.current
1118
+ ), g = v.getPropertyValue(`--${n}-start-end-gutter`).trim();
1119
+ g.includes("px") && (i = Number(
1120
+ g.replace("px", "")
1121
+ ));
1122
+ const _ = v.getPropertyValue(`--${n}-gutter`).trim();
1123
+ _.includes("px") && (f = Number(_.replace("px", "")));
1124
+ }
1125
+ return { totalStartEndGutterCssVar: i, totalGutterCssVar: f };
1126
+ }
1127
+ Z(() => {
1128
+ function i(g, _) {
1129
+ switch (g) {
1122
1130
  case "start":
1123
1131
  return 0;
1124
1132
  case "middle-start":
1125
- return Math.floor((S - 1) * 0.25);
1133
+ return Math.floor((_ - 1) * 0.25);
1126
1134
  case "center":
1127
- return Math.floor((S - 1) * 0.5);
1135
+ return Math.floor((_ - 1) * 0.5);
1128
1136
  case "middle-end":
1129
- return Math.floor((S - 1) * 0.75);
1137
+ return Math.floor((_ - 1) * 0.75);
1130
1138
  case "end":
1131
- return S - 1;
1139
+ return _ - 1;
1132
1140
  default:
1133
1141
  return 0;
1134
1142
  }
1135
1143
  }
1136
- function f(v) {
1137
- if (T.current = Dt(), I.current = T.current / 4, C.current) {
1138
- const { totalStartEndGutterCssVar: S } = kt();
1139
- let b = 0;
1140
- e && (b = T.current * t.length), b -= T.current * i(d, s), b -= S / 2, C.current.style.setProperty(
1144
+ function f(g) {
1145
+ if (x.current = Dt(), R.current = x.current / 4, S.current) {
1146
+ const { totalStartEndGutterCssVar: _ } = nt();
1147
+ console.log({ totalStartEndGutterCssVar: _ });
1148
+ let E = 0;
1149
+ e && (E = x.current * t.length), E -= x.current * i(u, s), E -= _ / 2, S.current.style.setProperty(
1141
1150
  `--${n}-offset-modifier`,
1142
- `${-b}px`
1143
- ), N(!0), v && v();
1151
+ `${-E}px`
1152
+ ), $(!0), g && g();
1144
1153
  }
1145
1154
  }
1146
- function _() {
1147
- console.log("resize"), f(), M({
1155
+ function v() {
1156
+ f(), N({
1148
1157
  type: "resize",
1149
1158
  toIndex: l.current,
1150
1159
  shouldAnimate: !1,
@@ -1152,42 +1161,42 @@ function Oe({
1152
1161
  });
1153
1162
  }
1154
1163
  if (r)
1155
- return k.current = !0, f(E), window.addEventListener("resize", _), () => {
1156
- window.removeEventListener("resize", _);
1164
+ return D.current = !0, f(c), window.addEventListener("resize", v), () => {
1165
+ window.removeEventListener("resize", v);
1157
1166
  };
1158
- }, [r, e, n, a, o, d]), tt(() => {
1159
- r && m !== l.current && M({
1167
+ }, [r, e, n, a, o, u]), Z(() => {
1168
+ r && b !== l.current && N({
1160
1169
  type: "next",
1161
- toIndex: m,
1170
+ toIndex: b,
1162
1171
  actionType: "resize",
1163
1172
  shouldAnimate: !1
1164
1173
  });
1165
- }, [r, m]);
1166
- const st = p, Ct = xe(
1174
+ }, [r, b]);
1175
+ const st = h, Ct = xe(
1167
1176
  (i) => {
1168
- if (!k.current)
1177
+ if (!D.current)
1169
1178
  return;
1170
- const f = i.dragging, _ = i.offset[a === "x" ? 0 : 1], v = i.movement[a === "x" ? 0 : 1], S = v > I.current, b = v < -I.current, w = i.velocity;
1179
+ const f = i.dragging, v = i.offset[a === "x" ? 0 : 1], g = i.movement[a === "x" ? 0 : 1], _ = g > R.current, E = g < -R.current, T = i.velocity;
1171
1180
  f && (U({
1172
1181
  ...i,
1173
1182
  eventName: "onDrag",
1174
1183
  slideActionType: "drag"
1175
- }), W.start({
1176
- value: _,
1184
+ }), G.start({
1185
+ value: v,
1177
1186
  immediate: !0,
1178
1187
  config: {
1179
- velocity: w
1188
+ velocity: T
1180
1189
  }
1181
- }), u && (S || b) && i.cancel()), i.last && (S ? (M({
1190
+ }), p && (_ || E) && i.cancel()), i.last && (_ ? (N({
1182
1191
  actionType: "drag",
1183
1192
  type: "prev"
1184
- }), i.cancel()) : b ? (M({
1193
+ }), i.cancel()) : E ? (N({
1185
1194
  actionType: "drag",
1186
1195
  type: "next"
1187
- }), i.cancel()) : (W.start({
1188
- value: j.current,
1196
+ }), i.cancel()) : (G.start({
1197
+ value: P.current,
1189
1198
  config: {
1190
- velocity: w
1199
+ velocity: T
1191
1200
  }
1192
1201
  }), i.cancel()));
1193
1202
  },
@@ -1198,37 +1207,33 @@ function Oe({
1198
1207
  ...e ? {} : {
1199
1208
  bounds: () => ({
1200
1209
  right: 0,
1201
- left: -X(0),
1202
- top: -X(0),
1210
+ left: -H(0),
1211
+ top: -H(0),
1203
1212
  bottom: 0
1204
1213
  })
1205
1214
  },
1206
- from: () => [F.value.get(), F.value.get()]
1215
+ from: () => [L.value.get(), L.value.get()]
1207
1216
  }
1208
1217
  );
1209
1218
  function Ot(i) {
1210
- var f, _;
1211
- return typeof i == "number" ? l.current === i : ((f = t.find((v) => v.id === i)) == null ? void 0 : f.id) === ((_ = t[l.current]) == null ? void 0 : _.id);
1219
+ var f, v;
1220
+ return typeof i == "number" ? l.current === i : ((f = t.find((g) => g.id === i)) == null ? void 0 : f.id) === ((v = t[l.current]) == null ? void 0 : v.id);
1212
1221
  }
1213
1222
  return {
1214
1223
  carouselFragment: /* @__PURE__ */ At(
1215
1224
  "div",
1216
1225
  {
1217
- ref: C,
1226
+ ref: S,
1218
1227
  className: "ReactSpringCarouselContainer",
1219
1228
  "data-part": "Container",
1220
1229
  "data-part-internal": `${n}-Container`,
1221
1230
  ...Ct(),
1222
1231
  children: [
1223
- /* @__PURE__ */ q(
1232
+ /* @__PURE__ */ X(
1224
1233
  "style",
1225
1234
  {
1226
1235
  dangerouslySetInnerHTML: {
1227
1236
  __html: `
1228
- :root {
1229
- --${n}-start-end-gutter: ${c * 2}px;
1230
- --${n}-gutter: ${o}px;
1231
- }
1232
1237
  [data-part-internal="${n}-Container"] {
1233
1238
  display: flex;
1234
1239
  width: 100%;
@@ -1239,16 +1244,14 @@ function Oe({
1239
1244
  --${n}-offset-modifier: 0px;
1240
1245
  --${n}-scroll-x-value: ${a === "x" ? `calc(var(--${n}-offset-position) + var(--${n}-offset-modifier))` : "0px"};
1241
1246
  --${n}-scroll-y-value: ${a === "y" ? `calc(var(--${n}-offset-position) + var(--${n}-offset-modifier))` : "0px"};
1242
- touch-action: ${st ? a === "x" ? "pan-y" : "pan-x" : "auto"};
1247
+ touch-action: ${st ? a === "x" ? "pan-y" : "pan-x" : "auto"};
1243
1248
  }
1244
1249
  [data-part-internal="${n}-Track"] {
1245
1250
  display: flex;
1246
1251
  position: relative;
1247
1252
  --initial-offset-modifier: calc(calc(-100% - var(--${n}-gutter) + calc(var(--${n}-start-end-gutter) / 2 / ${t.length} * ${s}) + var(--${n}-start-end-gutter)) * ${t.length} / ${s});
1248
-
1249
-
1250
- left: ${e && a === "x" && !P ? "var(--initial-offset-modifier)" : "0px"};
1251
- top: ${e && a === "y" && !P ? "var(--initial-offset-modifier)" : "0px"};
1253
+ left: ${e && a === "x" && !m ? "var(--initial-offset-modifier)" : "0px"};
1254
+ top: ${e && a === "y" && !m ? "var(--initial-offset-modifier)" : "0px"};
1252
1255
  flex-direction: ${a === "x" ? "row" : "column"};
1253
1256
  width: 100%;
1254
1257
  height: 100%;
@@ -1259,21 +1262,31 @@ function Oe({
1259
1262
  display: flex;
1260
1263
  flex: 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)))
1261
1264
  }
1265
+ ${o && o.length > 0 ? o.sort((i, f) => i.breakpoint - f.breakpoint).map(
1266
+ (i) => `
1267
+ @media (min-width: ${i.breakpoint}px) {
1268
+ [data-part-internal="${n}-Container"] {
1269
+ --${n}-gutter: ${i.gutter || 0}px;
1270
+ --${n}-start-end-gutter: ${(i.startEndGutter || 0) * 2}px;
1271
+ }
1272
+ }
1273
+ `
1274
+ ).join("") : ""}
1262
1275
  `
1263
1276
  }
1264
1277
  }
1265
1278
  ),
1266
- /* @__PURE__ */ q(
1279
+ /* @__PURE__ */ X(
1267
1280
  "div",
1268
1281
  {
1269
- ref: $,
1282
+ ref: A,
1270
1283
  className: "ReactSpringCarouselTrack",
1271
1284
  "data-part": "Track",
1272
1285
  "data-part-internal": `${n}-Track`,
1273
1286
  onScroll: () => {
1274
- O.current = !1, A.current = !1;
1287
+ C.current = !1, O.current = !1;
1275
1288
  },
1276
- children: St.map((i, f) => /* @__PURE__ */ q(
1289
+ children: St.map((i, f) => /* @__PURE__ */ X(
1277
1290
  "div",
1278
1291
  {
1279
1292
  className: "ReactSpringCarouselItem",
@@ -1281,7 +1294,7 @@ function Oe({
1281
1294
  "data-part-internal": `${n}-Item`,
1282
1295
  "data-id": i.id,
1283
1296
  children: typeof i.renderItem == "function" ? i.renderItem({
1284
- useListenToCustomEvent: nt,
1297
+ useListenToCustomEvent: rt,
1285
1298
  index: f,
1286
1299
  isClonedItem: !!i.isClonedItem,
1287
1300
  isActiveItem: Ot
@@ -1294,9 +1307,9 @@ function Oe({
1294
1307
  ]
1295
1308
  }
1296
1309
  ),
1297
- useListenToCustomEvent: nt,
1298
- slideToNextItem: () => G(),
1299
- slideToPrevItem: () => H(),
1310
+ useListenToCustomEvent: rt,
1311
+ slideToNextItem: () => F(),
1312
+ slideToPrevItem: () => W(),
1300
1313
  slideToItem: (i) => {
1301
1314
  if (typeof i == "number") {
1302
1315
  if (!t[i]) {
@@ -1305,17 +1318,17 @@ function Oe({
1305
1318
  );
1306
1319
  return;
1307
1320
  }
1308
- i > l.current ? G(i) : H(i);
1321
+ i > l.current ? F(i) : W(i);
1309
1322
  }
1310
1323
  if (typeof i == "string") {
1311
- const f = t.findIndex((_) => _.id === i);
1324
+ const f = t.findIndex((v) => v.id === i);
1312
1325
  if (f < 0) {
1313
1326
  console.warn(
1314
1327
  `The item you're trying to slide doesn't exist. id: ${i}`
1315
1328
  );
1316
1329
  return;
1317
1330
  }
1318
- f > l.current ? G(f) : H(f);
1331
+ f > l.current ? F(f) : W(f);
1319
1332
  }
1320
1333
  }
1321
1334
  };