react-spring-carousel 3.0.0-beta070 → 3.0.0-beta071

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.
Files changed (30) hide show
  1. package/dist/declarations/modules/index.d.ts +1 -0
  2. package/dist/declarations/modules/useEventsModule.d.ts +5 -0
  3. package/dist/{modules → declarations/modules}/useFullscreenModule.d.ts +1 -7
  4. package/dist/{types → declarations/types}/common.d.ts +1 -1
  5. package/dist/{types → declarations/types}/index.d.ts +0 -1
  6. package/dist/{modules/useEventsModule.d.ts → declarations/types/useEventsModule.types.d.ts} +11 -16
  7. package/dist/declarations/types/useFullscreenModule.types.d.ts +6 -0
  8. package/dist/{types → declarations/types}/useSpringCarousel.types.d.ts +1 -1
  9. package/dist/{types → declarations/types}/useTransitionCarousel.types.d.ts +1 -1
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.js +8 -11
  12. package/dist/index2.cjs +1 -1
  13. package/dist/index2.js +2 -6
  14. package/dist/useEventsModule-0feadbf7.cjs +1 -0
  15. package/dist/useEventsModule-538b90c9.js +33 -0
  16. package/dist/useSpringCarousel.cjs +1 -1
  17. package/dist/useSpringCarousel.js +308 -301
  18. package/dist/useThumbsModule-57ac2128.cjs +27 -0
  19. package/dist/{useThumbsModule-db93025f.js → useThumbsModule-f5b73ecb.js} +242 -272
  20. package/dist/useTransitionCarousel.cjs +1 -1
  21. package/dist/useTransitionCarousel.js +20 -22
  22. package/package.json +1 -1
  23. package/dist/modules/index.d.ts +0 -3
  24. package/dist/useFullscreenModule-55ea7b9d.js +0 -38
  25. package/dist/useFullscreenModule-be189d5b.cjs +0 -1
  26. package/dist/useThumbsModule-0c05dcf5.cjs +0 -27
  27. /package/dist/{index.d.ts → declarations/index.d.ts} +0 -0
  28. /package/dist/{modules → declarations/modules}/useThumbsModule.d.ts +0 -0
  29. /package/dist/{useSpringCarousel.d.ts → declarations/useSpringCarousel.d.ts} +0 -0
  30. /package/dist/{useTransitionCarousel.d.ts → declarations/useTransitionCarousel.d.ts} +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./useThumbsModule-0c05dcf5.cjs"),g=require("@react-spring/web"),o=require("react"),K=require("@use-gesture/react");require("screenfull");const c={initial:{opacity:1,position:"relative"},from:{opacity:0,position:"relative"},enter:{position:"relative",opacity:1},leave:{opacity:1,position:"absolute"}};function Q({init:l=!0,disableGestures:q=!1,items:r,springConfig:M=g.config.default,exitBeforeEnter:N=!1,trail:_,withLoop:s=!1,activeItem:a,toPrevItemSpringProps:h=c,toNextItemSpringProps:v=c,draggingSlideTreshold:b=50,thumbsSlideAxis:$="x"}){const d=o.useRef("next"),p=o.useRef("initial"),S=o.useRef(null),[n,R]=o.useState(a??0),{emitEvent:x,useListenToCustomEvent:I}=u.useEventsModule(),{handleScroll:A,thumbsFragment:D}=u.useThumbsModule({thumbsSlideAxis:$,items:r,renderThumbFnProps:{getIsNextItem:w,getIsPrevItem:k,useListenToCustomEvent:I,activeItem:{index:n,id:r[n].id}}});function O(){return d.current==="prev"?{initial:{...h.initial},from:{...h.from},enter:{...h.enter},leave:{...h.leave}}:d.current==="next"?{initial:{...v.initial},from:{...v.from},enter:{...v.enter},leave:{...v.leave}}:{initial:{...c.initial},from:{...c.from},enter:{...c.enter},leave:{...c.leave}}}o.useEffect(()=>{typeof a=="number"&&a!==n&&R(a)},[a]);function T({to:e,slideType:t,slideMode:i}){d.current=t,p.current=i,x({eventName:"onSlideStartChange",slideActionType:d.current,slideMode:p.current,nextItem:{index:e,id:r[e].id,startReached:e===0,endReached:e===r.length-1}}),R(e),A(n)}function E(e){if(!l)return;const t=n===0;!s&&t||T(s&&t?{to:r.length-1,slideType:"prev",slideMode:e}:{to:n-1,slideType:"prev",slideMode:e})}function j(e){if(!l)return;const t=n===r.length-1;!s&&t||T(s&&t?{to:0,slideType:"next",slideMode:e}:{to:n+1,slideType:"next",slideMode:e})}const W=g.useTransition(n,{config:M,key:null,trail:_,exitBeforeEnter:N,...O(),onRest(e,t,i){e.finished&&i===n&&x({eventName:"onSlideChange",slideActionType:d.current,slideMode:p.current,currentItem:{index:n,id:r[n].id,startReached:n===0,endReached:n===r.length-1}})}}),z=K.useDrag(({last:e,movement:[t]})=>{if(e){const i=t>b,f=t<-b,m=n===0,J=n===r.length-1;if(f){if(!s&&J)return;x({eventName:"onLeftSwipe"}),j("swipe")}else if(i){if(!s&&m)return;x({eventName:"onRightSwipe"}),E("swipe")}}},{enabled:!q});function F(e,t){let i=0;if(typeof e=="string"?i=r.findIndex(f=>f.id===e):i=e,i<0||i>=r.length){if(t)throw new Error(t);console.error(`The item doesn't exist; check that the id provided - ${e} - is correct.`),i=-1}return i}function w(e){const t=F(e,"The item doesn't exist; check the provided id."),i=n;return s&&i===r.length-1?t===0:t===i+1}function k(e){const t=F(e,"The item doesn't exist; check the provided id."),i=n;return s&&i===0?t===r.length-1:t===i-1}const B=W((e,t,i,f)=>{const m=r[t].renderItem;return u.jsxRuntimeExports.jsx(g.a.div,{id:`use-transition-carousel-item-${f}`,className:"use-transition-carousel-item",style:{...e,flex:"1 0 100%",width:"100%",height:"100%"},children:typeof m=="function"?m({useListenToCustomEvent:I,getIsNextItem:w,getIsPrevItem:k,activeItem:{index:n,id:r[n].id}}):m})}),y={useListenToCustomEvent:I,slideToPrevItem:()=>E("click"),slideToNextItem:()=>j("click")},G=u.jsxRuntimeExports.jsx(C.Provider,{value:y,children:D}),H=u.jsxRuntimeExports.jsx(C.Provider,{value:y,children:u.jsxRuntimeExports.jsx("div",{ref:S,...z(),style:{display:"flex",position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:B})});return{...y,carouselFragment:H,thumbsFragment:G}}const C=o.createContext(void 0);function U(){const l=o.useContext(C);if(!l)throw new Error("useTransitionCarouselContext must be used within the carousel.");return l}exports.useTransitionCarousel=Q;exports.useTransitionCarouselContext=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./useThumbsModule-57ac2128.cjs"),g=require("@react-spring/web"),o=require("react"),K=require("./useEventsModule-0feadbf7.cjs"),Q=require("@use-gesture/react"),u={initial:{opacity:1,position:"relative"},from:{opacity:0,position:"relative"},enter:{position:"relative",opacity:1},leave:{opacity:1,position:"absolute"}};function U({init:c=!0,disableGestures:q=!1,items:r,springConfig:M=g.config.default,exitBeforeEnter:N=!1,trail:_,withLoop:s=!1,activeItem:l,toPrevItemSpringProps:h=u,toNextItemSpringProps:v=u,draggingSlideTreshold:b=50,thumbsSlideAxis:$="x"}){const a=o.useRef("next"),p=o.useRef("initial"),S=o.useRef(null),[n,R]=o.useState(l??0),{emitEvent:x,useListenToCustomEvent:I}=K.useEventsModule(),{handleScroll:A,thumbsFragment:D}=m.useThumbsModule({thumbsSlideAxis:$,items:r,renderThumbFnProps:{getIsNextItem:w,getIsPrevItem:k,useListenToCustomEvent:I,activeItem:{index:n,id:r[n].id}}});function O(){return a.current==="prev"?{initial:{...h.initial},from:{...h.from},enter:{...h.enter},leave:{...h.leave}}:a.current==="next"?{initial:{...v.initial},from:{...v.from},enter:{...v.enter},leave:{...v.leave}}:{initial:{...u.initial},from:{...u.from},enter:{...u.enter},leave:{...u.leave}}}o.useEffect(()=>{typeof l=="number"&&l!==n&&R(l)},[l]);function T({to:e,slideType:t,slideMode:i}){a.current=t,p.current=i,x({eventName:"onSlideStartChange",slideActionType:a.current,slideMode:p.current,nextItem:{index:e,id:r[e].id,startReached:e===0,endReached:e===r.length-1}}),R(e),A(n)}function E(e){if(!c)return;const t=n===0;!s&&t||T(s&&t?{to:r.length-1,slideType:"prev",slideMode:e}:{to:n-1,slideType:"prev",slideMode:e})}function j(e){if(!c)return;const t=n===r.length-1;!s&&t||T(s&&t?{to:0,slideType:"next",slideMode:e}:{to:n+1,slideType:"next",slideMode:e})}const W=g.useTransition(n,{config:M,key:null,trail:_,exitBeforeEnter:N,...O(),onRest(e,t,i){e.finished&&i===n&&x({eventName:"onSlideChange",slideActionType:a.current,slideMode:p.current,currentItem:{index:n,id:r[n].id,startReached:n===0,endReached:n===r.length-1}})}}),z=Q.useDrag(({last:e,movement:[t]})=>{if(e){const i=t>b,d=t<-b,f=n===0,J=n===r.length-1;if(d){if(!s&&J)return;x({eventName:"onLeftSwipe"}),j("swipe")}else if(i){if(!s&&f)return;x({eventName:"onRightSwipe"}),E("swipe")}}},{enabled:!q});function F(e,t){let i=0;if(typeof e=="string"?i=r.findIndex(d=>d.id===e):i=e,i<0||i>=r.length){if(t)throw new Error(t);console.error(`The item doesn't exist; check that the id provided - ${e} - is correct.`),i=-1}return i}function w(e){const t=F(e,"The item doesn't exist; check the provided id."),i=n;return s&&i===r.length-1?t===0:t===i+1}function k(e){const t=F(e,"The item doesn't exist; check the provided id."),i=n;return s&&i===0?t===r.length-1:t===i-1}const B=W((e,t,i,d)=>{const f=r[t].renderItem;return m.jsxRuntimeExports.jsx(g.a.div,{id:`use-transition-carousel-item-${d}`,className:"use-transition-carousel-item",style:{...e,flex:"1 0 100%",width:"100%",height:"100%"},children:typeof f=="function"?f({useListenToCustomEvent:I,getIsNextItem:w,getIsPrevItem:k,activeItem:{index:n,id:r[n].id}}):f})}),y={useListenToCustomEvent:I,slideToPrevItem:()=>E("click"),slideToNextItem:()=>j("click")},G=m.jsxRuntimeExports.jsx(C.Provider,{value:y,children:D}),H=m.jsxRuntimeExports.jsx(C.Provider,{value:y,children:m.jsxRuntimeExports.jsx("div",{ref:S,...z(),style:{display:"flex",position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:B})});return{...y,carouselFragment:H,thumbsFragment:G}}const C=o.createContext(void 0);function V(){const c=o.useContext(C);if(!c)throw new Error("useTransitionCarouselContext must be used within the carousel.");return c}exports.useTransitionCarousel=U;exports.useTransitionCarouselContext=V;
@@ -1,8 +1,8 @@
1
- import { u as K, a as O, j as x } from "./useThumbsModule-db93025f.js";
2
- import { useTransition as Q, a as U, config as V } from "@react-spring/web";
3
- import { createContext as X, useRef as y, useState as Y, useEffect as Z, useContext as P } from "react";
1
+ import { u as K, j as x } from "./useThumbsModule-f5b73ecb.js";
2
+ import { useTransition as O, a as Q, config as U } from "@react-spring/web";
3
+ import { createContext as V, useRef as y, useState as X, useEffect as Y, useContext as Z } from "react";
4
+ import { u as P } from "./useEventsModule-538b90c9.js";
4
5
  import { useDrag as L } from "@use-gesture/react";
5
- import "screenfull";
6
6
  const o = {
7
7
  initial: {
8
8
  opacity: 1,
@@ -25,17 +25,17 @@ function se({
25
25
  init: c = !0,
26
26
  disableGestures: w = !1,
27
27
  items: r,
28
- springConfig: N = V.default,
28
+ springConfig: N = U.default,
29
29
  exitBeforeEnter: _ = !1,
30
30
  trail: M,
31
31
  withLoop: s = !1,
32
- activeItem: a,
32
+ activeItem: l,
33
33
  toPrevItemSpringProps: f = o,
34
34
  toNextItemSpringProps: m = o,
35
35
  draggingSlideTreshold: C = 50,
36
36
  thumbsSlideAxis: $ = "x"
37
37
  }) {
38
- const l = y("next"), p = y("initial"), A = y(null), [n, b] = Y(a ?? 0), { emitEvent: h, useListenToCustomEvent: T } = K(), { handleScroll: D, thumbsFragment: S } = O({
38
+ const a = y("next"), p = y("initial"), A = y(null), [n, b] = X(l ?? 0), { emitEvent: h, useListenToCustomEvent: T } = P(), { handleScroll: D, thumbsFragment: S } = K({
39
39
  thumbsSlideAxis: $,
40
40
  items: r,
41
41
  renderThumbFnProps: {
@@ -49,7 +49,7 @@ function se({
49
49
  }
50
50
  });
51
51
  function W() {
52
- return l.current === "prev" ? {
52
+ return a.current === "prev" ? {
53
53
  initial: {
54
54
  ...f.initial
55
55
  },
@@ -62,7 +62,7 @@ function se({
62
62
  leave: {
63
63
  ...f.leave
64
64
  }
65
- } : l.current === "next" ? {
65
+ } : a.current === "next" ? {
66
66
  initial: {
67
67
  ...m.initial
68
68
  },
@@ -90,13 +90,13 @@ function se({
90
90
  }
91
91
  };
92
92
  }
93
- Z(() => {
94
- typeof a == "number" && a !== n && b(a);
95
- }, [a]);
93
+ Y(() => {
94
+ typeof l == "number" && l !== n && b(l);
95
+ }, [l]);
96
96
  function v({ to: e, slideType: t, slideMode: i }) {
97
- l.current = t, p.current = i, h({
97
+ a.current = t, p.current = i, h({
98
98
  eventName: "onSlideStartChange",
99
- slideActionType: l.current,
99
+ slideActionType: a.current,
100
100
  slideMode: p.current,
101
101
  nextItem: {
102
102
  index: e,
@@ -134,7 +134,7 @@ function se({
134
134
  slideMode: e
135
135
  });
136
136
  }
137
- const q = Q(n, {
137
+ const q = O(n, {
138
138
  config: N,
139
139
  key: null,
140
140
  trail: M,
@@ -143,7 +143,7 @@ function se({
143
143
  onRest(e, t, i) {
144
144
  e.finished && i === n && h({
145
145
  eventName: "onSlideChange",
146
- slideActionType: l.current,
146
+ slideActionType: a.current,
147
147
  slideMode: p.current,
148
148
  currentItem: {
149
149
  index: n,
@@ -181,9 +181,7 @@ function se({
181
181
  if (typeof e == "string" ? i = r.findIndex((u) => u.id === e) : i = e, i < 0 || i >= r.length) {
182
182
  if (t)
183
183
  throw new Error(t);
184
- console.error(
185
- `The item doesn't exist; check that the id provided - ${e} - is correct.`
186
- ), i = -1;
184
+ console.error(`The item doesn't exist; check that the id provided - ${e} - is correct.`), i = -1;
187
185
  }
188
186
  return i;
189
187
  }
@@ -198,7 +196,7 @@ function se({
198
196
  const B = q((e, t, i, u) => {
199
197
  const d = r[t].renderItem;
200
198
  return /* @__PURE__ */ x.jsx(
201
- U.div,
199
+ Q.div,
202
200
  {
203
201
  id: `use-transition-carousel-item-${u}`,
204
202
  className: "use-transition-carousel-item",
@@ -244,9 +242,9 @@ function se({
244
242
  thumbsFragment: G
245
243
  };
246
244
  }
247
- const g = X(void 0);
245
+ const g = V(void 0);
248
246
  function oe() {
249
- const c = P(g);
247
+ const c = Z(g);
250
248
  if (!c)
251
249
  throw new Error("useTransitionCarouselContext must be used within the carousel.");
252
250
  return c;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-spring-carousel",
3
- "version": "3.0.0-beta070",
3
+ "version": "3.0.0-beta071",
4
4
  "type": "module",
5
5
  "description": "A new <Carousel /> experience for the web",
6
6
  "homepage": "https://react-spring-carousel.emilianobucci.com",
@@ -1,3 +0,0 @@
1
- export * from './useEventsModule';
2
- export * from './useFullscreenModule';
3
- export * from './useThumbsModule';
@@ -1,38 +0,0 @@
1
- import { useRef as o, useEffect as a } from "react";
2
- import e from "screenfull";
3
- function F({
4
- mainCarouselWrapperRef: c,
5
- onFullScreenChange: r,
6
- handleResize: u
7
- }) {
8
- const t = o(!1);
9
- a(() => {
10
- function n() {
11
- document.fullscreenElement && (l(!0), r(!0), u && u()), document.fullscreenElement || (l(!1), r(!1), u && u());
12
- }
13
- if (e.isEnabled)
14
- return e.on("change", n), () => {
15
- e.isEnabled && e.off("change", n);
16
- };
17
- }, []);
18
- function l(n) {
19
- t.current = n;
20
- }
21
- function f() {
22
- return t.current;
23
- }
24
- function s(n) {
25
- e.isEnabled && e.request(n || c.current);
26
- }
27
- function i() {
28
- e.isEnabled && e.exit();
29
- }
30
- return {
31
- enterFullscreen: s,
32
- exitFullscreen: i,
33
- getIsFullscreen: f
34
- };
35
- }
36
- export {
37
- F as u
38
- };
@@ -1 +0,0 @@
1
- "use strict";const s=require("react"),e=require("screenfull");function a({mainCarouselWrapperRef:c,onFullScreenChange:r,handleResize:u}){const t=s.useRef(!1);s.useEffect(()=>{function n(){document.fullscreenElement&&(l(!0),r(!0),u&&u()),document.fullscreenElement||(l(!1),r(!1),u&&u())}if(e.isEnabled)return e.on("change",n),()=>{e.isEnabled&&e.off("change",n)}},[]);function l(n){t.current=n}function f(){return t.current}function i(n){e.isEnabled&&e.request(n||c.current)}function o(){e.isEnabled&&e.exit()}return{enterFullscreen:i,exitFullscreen:o,getIsFullscreen:f}}exports.useFullscreenModule=a;
@@ -1,27 +0,0 @@
1
- "use strict";const L=require("react"),ir=require("@react-spring/web");exports.jsxRuntimeExports={};var ur={get exports(){return exports.jsxRuntimeExports},set exports(s){exports.jsxRuntimeExports=s}},W={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var xe;function sr(){if(xe)return W;xe=1;var s=L,E=Symbol.for("react.element"),O=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,_=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function j(w,d,P){var m,T={},v=null,b=null;P!==void 0&&(v=""+P),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(b=d.ref);for(m in d)h.call(d,m)&&!f.hasOwnProperty(m)&&(T[m]=d[m]);if(w&&w.defaultProps)for(m in d=w.defaultProps,d)T[m]===void 0&&(T[m]=d[m]);return{$$typeof:E,type:w,key:v,ref:b,props:T,_owner:_.current}}return W.Fragment=O,W.jsx=j,W.jsxs=j,W}var $={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Ce;function lr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var s=L,E=Symbol.for("react.element"),O=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),w=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),R=Symbol.iterator,Y="@@iterator";function N(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[Y];return typeof r=="function"?r:null}var S=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Oe("error",e,t)}}function Oe(e,r,t){{var n=S.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Pe=!1,Se=!1,je=!1,ke=!1,De=!1,re;re=Symbol.for("react.module.reference");function Fe(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===f||De||e===_||e===P||e===m||ke||e===b||Pe||Se||je||typeof e=="object"&&e!==null&&(e.$$typeof===v||e.$$typeof===T||e.$$typeof===j||e.$$typeof===w||e.$$typeof===d||e.$$typeof===re||e.getModuleId!==void 0))}function Ie(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function te(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case O:return"Portal";case f:return"Profiler";case _:return"StrictMode";case P:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return te(r)+".Consumer";case j:var t=e;return te(t._context)+".Provider";case d:return Ie(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:x(e.type)||"Memo";case v:{var i=e,u=i._payload,o=i._init;try{return x(o(u))}catch{return null}}}return null}var k=Object.assign,I=0,ne,ae,oe,ie,ue,se,le;function ce(){}ce.__reactDisabledLog=!0;function Ae(){{if(I===0){ne=console.log,ae=console.info,oe=console.warn,ie=console.error,ue=console.group,se=console.groupCollapsed,le=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function We(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ne}),info:k({},e,{value:ae}),warn:k({},e,{value:oe}),error:k({},e,{value:ie}),group:k({},e,{value:ue}),groupCollapsed:k({},e,{value:se}),groupEnd:k({},e,{value:le})})}I<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=S.ReactCurrentDispatcher,G;function M(e,r,t){{if(G===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);G=n&&n[1]||""}return`
18
- `+G+e}}var H=!1,V;{var $e=typeof WeakMap=="function"?WeakMap:Map;V=new $e}function fe(e,r){if(!e||H)return"";{var t=V.get(e);if(t!==void 0)return t}var n;H=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=J.current,J.current=null,Ae();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(C){n=C}Reflect.construct(e,[],o)}else{try{o.call()}catch(C){n=C}e.call(o.prototype)}}else{try{throw Error()}catch(C){n=C}e()}}catch(C){if(C&&n&&typeof C.stack=="string"){for(var a=C.stack.split(`
19
- `),g=n.stack.split(`
20
- `),l=a.length-1,c=g.length-1;l>=1&&c>=0&&a[l]!==g[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==g[c]){if(l!==1||c!==1)do if(l--,c--,c<0||a[l]!==g[c]){var y=`
21
- `+a[l].replace(" at new "," at ");return e.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,y),y}while(l>=1&&c>=0);break}}}finally{H=!1,J.current=u,We(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",we=F?M(F):"";return typeof e=="function"&&V.set(e,we),we}function Le(e,r,t){return fe(e,!1)}function Ye(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Ye(e));if(typeof e=="string")return M(e);switch(e){case P:return M("Suspense");case m:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Le(e.render);case T:return U(e.type,r,t);case v:{var n=e,i=n._payload,u=n._init;try{return U(u(i),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,de={},ve=S.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);ve.setExtraStackFrame(t)}else ve.setExtraStackFrame(null)}function Ne(e,r,t,n,i){{var u=Function.call.bind(q);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var g=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(B(i),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),B(null)),a instanceof Error&&!(a.message in de)&&(de[a.message]=!0,B(i),p("Failed %s type: %s",t,a.message),B(null))}}}var Me=Array.isArray;function z(e){return Me(e)}function Ve(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ue(e){try{return pe(e),!1}catch{return!0}}function pe(e){return""+e}function he(e){if(Ue(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ve(e)),pe(e)}var A=S.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},me,ge,K;K={};function Be(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Je(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ge(e,r){if(typeof e.ref=="string"&&A.current&&r&&A.current.stateNode!==r){var t=x(A.current.type);K[t]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(A.current.type),e.ref),K[t]=!0)}}function He(e,r){{var t=function(){me||(me=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ze(e,r){{var t=function(){ge||(ge=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Ke=function(e,r,t,n,i,u,o){var a={$$typeof:E,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Xe(e,r,t,n,i){{var u,o={},a=null,g=null;t!==void 0&&(he(t),a=""+t),Je(r)&&(he(r.key),a=""+r.key),Be(r)&&(g=r.ref,Ge(r,i));for(u in r)q.call(r,u)&&!qe.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)o[u]===void 0&&(o[u]=l[u])}if(a||g){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&He(o,c),g&&ze(o,c)}return Ke(e,a,g,i,n,A.current,o)}}var X=S.ReactCurrentOwner,Ee=S.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var Z;Z=!1;function Q(e){return typeof e=="object"&&e!==null&&e.$$typeof===E}function be(){{if(X.current){var e=x(X.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function Ze(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
-
25
- Check your code at `+r+":"+t+"."}return""}}var Re={};function Qe(e){{var r=be();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
-
27
- Check the top-level render call using <`+t+">.")}return r}}function ye(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Qe(r);if(Re[t])return;Re[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),D(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function _e(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Q(n)&&ye(n,r)}else if(Q(e))e._store&&(e._store.validated=!0);else if(e){var i=N(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)Q(o.value)&&ye(o.value,r)}}}function er(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=x(r);Ne(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Z){Z=!0;var i=x(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function rr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function Te(e,r,t,n,i,u){{var o=Fe(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var g=Ze(i);g?a+=g:a+=be();var l;e===null?l="null":z(e)?l="array":e!==void 0&&e.$$typeof===E?(l="<"+(x(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var c=Xe(e,r,t,i,u);if(c==null)return c;if(o){var y=r.children;if(y!==void 0)if(n)if(z(y)){for(var F=0;F<y.length;F++)_e(y[F],e);Object.freeze&&Object.freeze(y)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _e(y,e)}return e===h?rr(c):er(c),c}}function tr(e,r,t){return Te(e,r,t,!0)}function nr(e,r,t){return Te(e,r,t,!1)}var ar=nr,or=tr;$.Fragment=h,$.jsx=ar,$.jsxs=or}()),$}(function(s){process.env.NODE_ENV==="production"?s.exports=sr():s.exports=lr()})(ur);const ee="RSC::Event";function cr(){const s=L.useRef(null);function E(h){L.useEffect(()=>{s.current||(s.current=document.createElement("div"));function _(f){h(f.detail)}if(s.current)return s.current.addEventListener(ee,_,!1),()=>{var f;(f=s.current)==null||f.removeEventListener(ee,_,!1)}},[h])}function O(h){if(s.current){const _=new CustomEvent(ee,{detail:h});s.current.dispatchEvent(_)}}return{useListenToCustomEvent:E,emitEvent:O}}function fr(s){const E=s.getBoundingClientRect();return E.top>=0&&E.left>=0&&E.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&E.right<=(window.innerWidth||document.documentElement.clientWidth)}function dr({thumbsSlideAxis:s="x",withThumbs:E=!1,prepareThumbsData:O,items:h,renderThumbFnProps:_}){const f=L.useRef(null),[j,w]=ir.useSpring(()=>({val:0}));function d(){var v;return Math.round(Number((v=f.current)==null?void 0:v[s==="x"?"scrollWidth":"scrollHeight"])-f.current.getBoundingClientRect()[s==="x"?"width":"height"])}function P(v){var Y;function b(){return f.current?f.current.querySelector(`#thumb-item-${h[v].id}`):null}const R=b();if(R&&f.current&&!fr(R)){const N=R.offsetLeft,S=N>d()?d():N;w.start({from:{val:((Y=f.current)==null?void 0:Y[s==="x"?"scrollLeft":"scrollTop"])??0},to:{val:S},onChange:({value:p})=>{f.current&&(f.current[s==="x"?"scrollLeft":"scrollTop"]=Math.abs(p.val))}})}}function m(){function v(b){return b.map(R=>({id:R.id,renderThumb:R.renderThumb}))}return O?O(v(h)):v(h)}return{thumbsFragment:E?exports.jsxRuntimeExports.jsx("div",{className:"use-spring-carousel-thumbs-wrapper",ref:f,onWheel:()=>j.val.stop(),style:{display:"flex",flex:"1",position:"relative",width:"100%",height:"100%",flexDirection:s==="x"?"row":"column",...s==="x"?{overflowX:"auto"}:{overflowY:"auto",maxHeight:"100%"}},children:m().map(({id:v,renderThumb:b})=>{const R=`thumb-item-${v}`;return exports.jsxRuntimeExports.jsx("div",{id:R,className:"thumb-item",children:typeof b=="function"?b(_):b},R)})}):null,handleScroll:P}}exports.useEventsModule=cr;exports.useThumbsModule=dr;
File without changes