react-spring-carousel 3.0.0-beta090.51 → 3.0.0-beta090.53

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 (58) hide show
  1. package/.storybook/main.ts +17 -0
  2. package/.storybook/preview.ts +15 -0
  3. package/README.md +50 -0
  4. package/eslint.config.js +28 -0
  5. package/index.html +13 -0
  6. package/lib/events.ts +39 -0
  7. package/lib/index.tsx +980 -0
  8. package/lib/types.ts +44 -0
  9. package/lib/useEventsModule.ts +51 -0
  10. package/lib/utils.ts +42 -0
  11. package/lib/vite-env.d.ts +1 -0
  12. package/package.json +36 -84
  13. package/src/stories/Button.stories.ts +52 -0
  14. package/src/stories/Button.tsx +48 -0
  15. package/src/stories/Configure.mdx +364 -0
  16. package/src/stories/Main.stories.ts +14 -0
  17. package/src/stories/Main.tsx +87 -0
  18. package/src/stories/assets/accessibility.png +0 -0
  19. package/src/stories/assets/accessibility.svg +1 -0
  20. package/src/stories/assets/addon-library.png +0 -0
  21. package/src/stories/assets/assets.png +0 -0
  22. package/src/stories/assets/avif-test-image.avif +0 -0
  23. package/src/stories/assets/context.png +0 -0
  24. package/src/stories/assets/discord.svg +1 -0
  25. package/src/stories/assets/docs.png +0 -0
  26. package/src/stories/assets/figma-plugin.png +0 -0
  27. package/src/stories/assets/github.svg +1 -0
  28. package/src/stories/assets/share.png +0 -0
  29. package/src/stories/assets/styling.png +0 -0
  30. package/src/stories/assets/testing.png +0 -0
  31. package/src/stories/assets/theming.png +0 -0
  32. package/src/stories/assets/tutorials.svg +1 -0
  33. package/src/stories/assets/youtube.svg +1 -0
  34. package/src/stories/button.css +30 -0
  35. package/src/stories/main.css +37 -0
  36. package/src/storybook.global.styles.css +5 -0
  37. package/tsconfig.app.json +24 -0
  38. package/tsconfig.json +7 -0
  39. package/tsconfig.node.json +22 -0
  40. package/vite.config.ts +30 -0
  41. package/dist/index.cjs.js +0 -28
  42. package/dist/index.cjs.js.map +0 -1
  43. package/dist/index.es.js +0 -1728
  44. package/dist/index.es.js.map +0 -1
  45. package/dist/types/index.d.ts +0 -3
  46. package/dist/types/modules/index.d.ts +0 -1
  47. package/dist/types/modules/useEventsModule.d.ts +0 -5
  48. package/dist/types/modules/useFullscreenModule.d.ts +0 -6
  49. package/dist/types/modules/useThumbsModule.d.ts +0 -6
  50. package/dist/types/types/common.d.ts +0 -36
  51. package/dist/types/types/index.d.ts +0 -4
  52. package/dist/types/types/useEventsModule.types.d.ts +0 -46
  53. package/dist/types/types/useFullscreenModule.types.d.ts +0 -6
  54. package/dist/types/types/useSpringCarousel.types.d.ts +0 -130
  55. package/dist/types/types/useThumbsModule.types.d.ts +0 -9
  56. package/dist/types/types/useTransitionCarousel.types.d.ts +0 -37
  57. package/dist/types/useSpringCarousel.d.ts +0 -12
  58. package/dist/types/useTransitionCarousel.d.ts +0 -5
package/vite.config.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from "vite";
2
+ import react from "@vitejs/plugin-react-swc";
3
+ import dts from "vite-plugin-dts";
4
+ import { resolve } from "path";
5
+
6
+ export default defineConfig({
7
+ plugins: [
8
+ react(),
9
+ dts({
10
+ include: ["lib"],
11
+ rollupTypes: true,
12
+ tsconfigPath: resolve(__dirname, "tsconfig.app.json"),
13
+ }),
14
+ ],
15
+ build: {
16
+ lib: {
17
+ entry: resolve(__dirname, "lib/index.tsx"),
18
+ formats: ["es"],
19
+ name: "React Spring Carousel",
20
+ },
21
+ rollupOptions: {
22
+ external: [
23
+ "react",
24
+ "react-dom",
25
+ "react/jsx-runtime",
26
+ "@react-spring/web",
27
+ ],
28
+ },
29
+ },
30
+ });
package/dist/index.cjs.js DELETED
@@ -1,28 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),Q=require("@react-spring/web"),cr=require("@use-gesture/react"),gr=require("resize-observer-polyfill"),Re=require("screenfull");var L={},pr={get exports(){return L},set exports(n){L=n}},Ae={};/**
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 ar;function mr(){if(ar)return Ae;ar=1;var n=l,p=Symbol.for("react.element"),m=Symbol.for("react.fragment"),$=Object.prototype.hasOwnProperty,U=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function w(f,d,v){var N,A={},I=null,o=null;v!==void 0&&(I=""+v),d.key!==void 0&&(I=""+d.key),d.ref!==void 0&&(o=d.ref);for(N in d)$.call(d,N)&&!h.hasOwnProperty(N)&&(A[N]=d[N]);if(f&&f.defaultProps)for(N in d=f.defaultProps,d)A[N]===void 0&&(A[N]=d[N]);return{$$typeof:p,type:f,key:I,ref:o,props:A,_owner:U.current}}return Ae.Fragment=m,Ae.jsx=w,Ae.jsxs=w,Ae}var Le={};/**
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 or;function yr(){return or||(or=1,process.env.NODE_ENV!=="production"&&function(){var n=l,p=Symbol.for("react.element"),m=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),o=Symbol.for("react.offscreen"),B=Symbol.iterator,b="@@iterator";function ae(e){if(e===null||typeof e!="object")return null;var t=B&&e[B]||e[b];return typeof t=="function"?t:null}var F=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(e){{for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];ne("error",e,i)}}function ne(e,t,i){{var s=F.ReactDebugCurrentFrame,E=s.getStackAddendum();E!==""&&(t+="%s",i=i.concat([E]));var _=i.map(function(y){return String(y)});_.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,_)}}var De=!1,ie=!1,Y=!1,ue=!1,oe=!1,z;z=Symbol.for("react.module.reference");function Ee(e){return!!(typeof e=="string"||typeof e=="function"||e===$||e===h||oe||e===U||e===v||e===N||ue||e===o||De||ie||Y||typeof e=="object"&&e!==null&&(e.$$typeof===I||e.$$typeof===A||e.$$typeof===w||e.$$typeof===f||e.$$typeof===d||e.$$typeof===z||e.getModuleId!==void 0))}function G(e,t,i){var s=e.displayName;if(s)return s;var E=t.displayName||t.name||"";return E!==""?i+"("+E+")":i}function M(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&O("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 $:return"Fragment";case m:return"Portal";case h:return"Profiler";case U:return"StrictMode";case v:return"Suspense";case N:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var t=e;return M(t)+".Consumer";case w:var i=e;return M(i._context)+".Provider";case d:return G(e,e.render,"ForwardRef");case A:var s=e.displayName||null;return s!==null?s:x(e.type)||"Memo";case I:{var E=e,_=E._payload,y=E._init;try{return x(y(_))}catch{return null}}}return null}var R=Object.assign,C=0,D,ge,pe,c,T,k,X;function H(){}H.__reactDisabledLog=!0;function He(){{if(C===0){D=console.log,ge=console.info,pe=console.warn,c=console.error,T=console.group,k=console.groupCollapsed,X=console.groupEnd;var e={configurable:!0,enumerable:!0,value:H,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}C++}}function Ie(){{if(C--,C===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},e,{value:D}),info:R({},e,{value:ge}),warn:R({},e,{value:pe}),error:R({},e,{value:c}),group:R({},e,{value:T}),groupCollapsed:R({},e,{value:k}),groupEnd:R({},e,{value:X})})}C<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=F.ReactCurrentDispatcher,q;function ce(e,t,i){{if(q===void 0)try{throw Error()}catch(E){var s=E.stack.trim().match(/\n( *(at )?)/);q=s&&s[1]||""}return`
18
- `+q+e}}var me=!1,ke;{var Qe=typeof WeakMap=="function"?WeakMap:Map;ke=new Qe}function We(e,t){if(!e||me)return"";{var i=ke.get(e);if(i!==void 0)return i}var s;me=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var _;_=ee.current,ee.current=null,He();try{if(t){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(he){s=he}Reflect.construct(e,[],y)}else{try{y.call()}catch(he){s=he}e.call(y.prototype)}}else{try{throw Error()}catch(he){s=he}e()}}catch(he){if(he&&s&&typeof he.stack=="string"){for(var g=he.stack.split(`
19
- `),J=s.stack.split(`
20
- `),S=g.length-1,V=J.length-1;S>=1&&V>=0&&g[S]!==J[V];)V--;for(;S>=1&&V>=0;S--,V--)if(g[S]!==J[V]){if(S!==1||V!==1)do if(S--,V--,V<0||g[S]!==J[V]){var Z=`
21
- `+g[S].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),typeof e=="function"&&ke.set(e,Z),Z}while(S>=1&&V>=0);break}}}finally{me=!1,ee.current=_,Ie(),Error.prepareStackTrace=E}var $e=e?e.displayName||e.name:"",ur=$e?ce($e):"";return typeof e=="function"&&ke.set(e,ur),ur}function Je(e,t,i){return We(e,!1)}function ze(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Pe(e,t,i){if(e==null)return"";if(typeof e=="function")return We(e,ze(e));if(typeof e=="string")return ce(e);switch(e){case v:return ce("Suspense");case N:return ce("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Je(e.render);case A:return Pe(e.type,t,i);case I:{var s=e,E=s._payload,_=s._init;try{return Pe(_(E),t,i)}catch{}}}return""}var P=Object.prototype.hasOwnProperty,se={},W=F.ReactDebugCurrentFrame;function je(e){if(e){var t=e._owner,i=Pe(e.type,e._source,t?t.type:null);W.setExtraStackFrame(i)}else W.setExtraStackFrame(null)}function Te(e,t,i,s,E){{var _=Function.call.bind(P);for(var y in e)if(_(e,y)){var g=void 0;try{if(typeof e[y]!="function"){var J=Error((s||"React class")+": "+i+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw J.name="Invariant Violation",J}g=e[y](t,y,s,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(S){g=S}g&&!(g instanceof Error)&&(je(E),O("%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).",s||"React class",i,y,typeof g),je(null)),g instanceof Error&&!(g.message in se)&&(se[g.message]=!0,je(E),O("Failed %s type: %s",i,g.message),je(null))}}}var we=Array.isArray;function ye(e){return we(e)}function re(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,i=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function Ce(e){try{return le(e),!1}catch{return!0}}function le(e){return""+e}function fe(e){if(Ce(e))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",re(e)),le(e)}var _e=F.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},Ke,Ze,Ne;Ne={};function Fe(e){if(P.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ge(e){if(P.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function be(e,t){if(typeof e.ref=="string"&&_e.current&&t&&_e.current.stateNode!==t){var i=x(_e.current.type);Ne[i]||(O('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(_e.current.type),e.ref),Ne[i]=!0)}}function Se(e,t){{var i=function(){Ke||(Ke=!0,O("%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)",t))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function Ve(e,t){{var i=function(){Ze||(Ze=!0,O("%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)",t))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var Ye=function(e,t,i,s,E,_,y){var g={$$typeof:p,type:e,key:t,ref:i,props:y,_owner:_};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function qe(e,t,i,s,E){{var _,y={},g=null,J=null;i!==void 0&&(fe(i),g=""+i),Ge(t)&&(fe(t.key),g=""+t.key),Fe(t)&&(J=t.ref,be(t,E));for(_ in t)P.call(t,_)&&!Xe.hasOwnProperty(_)&&(y[_]=t[_]);if(e&&e.defaultProps){var S=e.defaultProps;for(_ in S)y[_]===void 0&&(y[_]=S[_])}if(g||J){var V=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&Se(y,V),J&&Ve(y,V)}return Ye(e,g,J,E,s,_e.current,y)}}var Ue=F.ReactCurrentOwner,Oe=F.ReactDebugCurrentFrame;function xe(e){if(e){var t=e._owner,i=Pe(e.type,e._source,t?t.type:null);Oe.setExtraStackFrame(i)}else Oe.setExtraStackFrame(null)}var Be;Be=!1;function r(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function a(){{if(Ue.current){var e=x(Ue.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function u(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),i=e.lineNumber;return`
24
-
25
- Check your code at `+t+":"+i+"."}return""}}var j={};function K(e){{var t=a();if(!t){var i=typeof e=="string"?e:e.displayName||e.name;i&&(t=`
26
-
27
- Check the top-level render call using <`+i+">.")}return t}}function de(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=K(t);if(j[i])return;j[i]=!0;var s="";e&&e._owner&&e._owner!==Ue.current&&(s=" It was passed a child from "+x(e._owner.type)+"."),xe(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,s),xe(null)}}function ve(e,t){{if(typeof e!="object")return;if(ye(e))for(var i=0;i<e.length;i++){var s=e[i];r(s)&&de(s,t)}else if(r(e))e._store&&(e._store.validated=!0);else if(e){var E=ae(e);if(typeof E=="function"&&E!==e.entries)for(var _=E.call(e),y;!(y=_.next()).done;)r(y.value)&&de(y.value,t)}}}function er(e){{var t=e.type;if(t==null||typeof t=="string")return;var i;if(typeof t=="function")i=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===d||t.$$typeof===A))i=t.propTypes;else return;if(i){var s=x(t);Te(i,e.props,"prop",s,e)}else if(t.PropTypes!==void 0&&!Be){Be=!0;var E=x(t);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function te(e){{for(var t=Object.keys(e.props),i=0;i<t.length;i++){var s=t[i];if(s!=="children"&&s!=="key"){xe(e),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),xe(null);break}}e.ref!==null&&(xe(e),O("Invalid attribute `ref` supplied to `React.Fragment`."),xe(null))}}function rr(e,t,i,s,E,_){{var y=Ee(e);if(!y){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 J=u(E);J?g+=J:g+=a();var S;e===null?S="null":ye(e)?S="array":e!==void 0&&e.$$typeof===p?(S="<"+(x(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):S=typeof e,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,g)}var V=qe(e,t,i,E,_);if(V==null)return V;if(y){var Z=t.children;if(Z!==void 0)if(s)if(ye(Z)){for(var $e=0;$e<Z.length;$e++)ve(Z[$e],e);Object.freeze&&Object.freeze(Z)}else O("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 ve(Z,e)}return e===$?te(V):er(V),V}}function fr(e,t,i){return rr(e,t,i,!0)}function dr(e,t,i){return rr(e,t,i,!1)}var vr=dr,hr=fr;Le.Fragment=$,Le.jsx=vr,Le.jsxs=hr}()),Le}(function(n){process.env.NODE_ENV==="production"?n.exports=mr():n.exports=yr()})(pr);const tr="RSC::Event";function sr(){const n=l.useRef(null);function p($){l.useEffect(()=>{n.current||(n.current=document.createElement("div"));function U(h){$(h.detail)}if(n.current)return n.current.addEventListener(tr,U,!1),()=>{var h;(h=n.current)==null||h.removeEventListener(tr,U,!1)}},[$])}function m($){if(n.current){const U=new CustomEvent(tr,{detail:$});n.current.dispatchEvent(U)}}return{useListenToCustomEvent:p,emitEvent:m}}function br({mainCarouselWrapperRef:n,onFullScreenChange:p,handleResize:m}){const $=l.useRef(!1);l.useEffect(()=>{function d(){document.fullscreenElement&&(U(!0),p(!0),m&&m()),document.fullscreenElement||(U(!1),p(!1),m&&m())}if(Re.isEnabled)return Re.on("change",d),()=>{Re.isEnabled&&Re.off("change",d)}},[]);function U(d){$.current=d}function h(){return $.current}function w(d){Re.isEnabled&&Re.request(d||n.current)}function f(){Re.isEnabled&&Re.exit()}return{enterFullscreen:w,exitFullscreen:f,getIsFullscreen:h}}function xr(n){const p=n.getBoundingClientRect();return p.top>=0&&p.left>=0&&p.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&p.right<=(window.innerWidth||document.documentElement.clientWidth)}function lr({thumbsSlideAxis:n="x",withThumbs:p=!1,prepareThumbsData:m,items:$,renderThumbFnProps:U}){const h=l.useRef(null),[w,f]=Q.useSpring(()=>({val:0}));function d(){var I;return h.current?Math.round(Number((I=h.current)==null?void 0:I[n==="x"?"scrollWidth":"scrollHeight"])-h.current.getBoundingClientRect()[n==="x"?"width":"height"]):0}function v(I){var b;function o(){return h.current?h.current.querySelector(`#thumb-item-${$[I].id}`):null}const B=o();if(B&&h.current&&!xr(B)){const ae=B.offsetLeft,F=ae>d()?d():ae;f.start({from:{val:((b=h.current)==null?void 0:b[n==="x"?"scrollLeft":"scrollTop"])??0},to:{val:F},onChange:({value:O})=>{h.current&&(h.current[n==="x"?"scrollLeft":"scrollTop"]=Math.abs(O.val))}})}}function N(){function I(o){return o.map(B=>({id:B.id,renderThumb:B.renderThumb}))}return m?m(I($)):I($)}return{thumbsFragment:p?L.jsx("div",{className:"use-spring-carousel-thumbs-wrapper",ref:h,onWheel:()=>w.val.stop(),style:{display:"flex",flex:"1",position:"relative",width:"100%",height:"100%",flexDirection:n==="x"?"row":"column",...n==="x"?{overflowX:"auto"}:{overflowY:"auto",maxHeight:"100%"}},children:N().map(({id:I,renderThumb:o})=>{const B=`thumb-item-${I}`;return L.jsx("div",{id:B,className:"thumb-item",children:typeof o=="function"?o(U):o},B)})}):null,handleScroll:v}}function Rr({items:n,init:p=!0,withThumbs:m,thumbsSlideAxis:$="x",itemsPerSlide:U=1,slideType:h="fixed",gutter:w=0,withLoop:f=!1,startEndGutter:d=0,carouselSlideAxis:v="x",disableGestures:N=!1,draggingSlideTreshold:A,slideWhenThresholdIsReached:I=!1,freeScroll:o,enableFreeScrollDrag:B,initialStartingPosition:b,prepareThumbsData:ae,initialActiveItem:F=0,animateWhenActiveItemChange:O=!0,slideGroupOfItems:ne=!1,__unstable_stretch_tems__:De=!0,slideAmount:ie}){const Y=U,ue=l.useRef(!1),oe=l.useRef(A??0),z=l.useRef("initial"),Ee=l.useRef("initial"),G=l.useRef("initial"),M=l.useRef(F),x=l.useRef(F===0),R=l.useRef(h==="fixed"&&F===n.length-1),C=l.useRef(null),D=l.useRef(null),ge=l.useRef(0),pe=l.useRef(0),c=l.useRef(0),T=l.useRef(f),k=l.useRef(h),X=l.useRef(o),H=l.useRef(!1),Ie=l.useCallback(()=>f?[...n.map(r=>({...r,id:`prev-repeated-item-${r.id}`})),...n,...n.map(r=>({...r,id:`next-repeated-item-${r.id}`}))]:[...n],[n,f])(),[ee,q]=Q.useSpring(()=>({val:0,pause:!p,onChange:({value:r})=>{o&&C.current?(v==="x"?C.current.scrollLeft=Math.abs(r.val):C.current.scrollTop=Math.abs(r.val),Fe()):D.current&&(v==="x"?D.current.style.transform=`translate3d(${r.val}px, 0px,0px)`:D.current.style.transform=`translate3d(0px,${r.val}px,0px)`)}}),[o]),{emitEvent:ce,useListenToCustomEvent:me}=sr(),{thumbsFragment:ke,handleScroll:Qe}=lr({withThumbs:!!m,thumbsSlideAxis:$,prepareThumbsData:ae,items:n,renderThumbFnProps:{getIsActiveItem:qe,getIsPrevItem:Ye,useListenToCustomEvent:me,getIsNextItem:Ve}}),{enterFullscreen:We,exitFullscreen:Je,getIsFullscreen:ze}=br({mainCarouselWrapperRef:C,handleResize:()=>ye(),onFullScreenChange:r=>{ce({eventName:"onFullscreenChange",isFullscreen:r})}});function Pe(r){return h==="fixed"&&!o?{marginRight:`${r?0:w}px`,flex:`${De?"1":"0"} 0 calc(100% / ${Y} - ${w*(Y-1)/Y}px)`}:{marginRight:`${r?0:w}px`}}const P=l.useCallback(()=>{var u;if(typeof ie=="number"&&ie>0&&(h==="fluid"||o))return ie;const r=ne?C.current:(u=C.current)==null?void 0:u.querySelector(".use-spring-carousel-item");if(!r)throw Error("No carousel items available!");let a=r.getBoundingClientRect()[v==="x"?"width":"height"];return ne||(a+=w),ne&&(a+=w-d*2),a},[v,o,w,ie,ne,h,d]);function se({from:r,to:a,nextActiveItem:u,immediate:j=!1,slideMode:K}){Ee.current=K,typeof u=="number"&&(o||(M.current=u),ce({eventName:"onSlideStartChange",slideActionType:z.current,slideMode:Ee.current,nextItem:{startReached:x.current,endReached:R.current,index:o?-1:M.current,id:o?"":n[M.current].id}})),c.current=a,q.start({immediate:j,from:{val:r},to:{val:a},config:{...Q.config.default,velocity:ee.val.velocity},onRest(de){!j&&de.finished&&ce({eventName:"onSlideChange",slideActionType:z.current,slideMode:Ee.current,currentItem:{startReached:x.current,endReached:R.current,index:o?-1:M.current,id:o?"":n[M.current].id}})}}),m&&!j&&Qe(M.current)}const W=l.useCallback(()=>{var r;return D.current?f?P()*n.length:Math.round(Number((r=D.current)==null?void 0:r[v==="x"?"scrollWidth":"scrollHeight"])-D.current.getBoundingClientRect()[v==="x"?"width":"height"]-d*2):0},[v,P,n.length,d,f]);function je(){const r=`calc(100% - ${d*2}px)`;return{width:v==="x"?r:"100%",height:v==="y"?r:"100%"}}const Te=l.useCallback(()=>{var a;const r=(a=D.current)==null?void 0:a.querySelector(".use-spring-carousel-item");if(!r)throw Error("No carousel items available!");return r.getBoundingClientRect()[v==="x"?"width":"height"]+w},[v,w]),we=l.useCallback(r=>{const a=v==="x"?"left":"top",u=D.current;u&&(f?(u.style.top="0px",u.style.left="0px",u.style[a]=`-${r-d}px`,x.current=!1,R.current=!1):(u.style.left="0px",u.style.top="0px"))},[v,d,f]),ye=l.useCallback((r=!1)=>{if(D.current&&r&&(D.current.style.transform="translate3d(0px, 0px,0px)",D.current.style.left="0",D.current.style.top="0"),h==="fixed"&&we(b==="center"?Te()*n.length-P()*Math.round((Y-1)/2):b==="end"?Te()*n.length-P()*Math.round(Y-1):Te()*n.length),h==="fluid"){if(we(Te()*n.length),R.current&&W()!==Math.abs(c.current)&&!f){const a=-W();c.current=a,q.start({immediate:!0,val:c.current});return}if(Math.abs(c.current)>0&&W()!==Math.abs(c.current)&&!f&&!o&&G.current==="backward"){const a=ge.current-W(),u=c.current+a;return q.start({immediate:!0,val:u}),()=>{c.current=u}}return}if(!o&&h==="fixed"){const a=-(P()*M.current);if(Math.abs(a)>W()&&!f){const u=-W();R.current=!0,c.current=u,q.start({immediate:!0,val:c.current})}else c.current=a,q.start({immediate:!0,val:a});setTimeout(()=>{ue.current=!1},0)}},[o,Te,P,W,b,n.length,Y,we,q,h,f]);function re(){return o&&C.current?C.current[v==="x"?"scrollLeft":"scrollTop"]:ee.val.get()}function Ce(r,a){if(o&&r==="next"){const u=c.current+P();return u>W()?W():u}if(o&&r==="prev"){const u=c.current-P();return u<0?0:u}return r==="next"?typeof a=="number"?-(a*P()):c.current-P():typeof a=="number"?-(a*P()):c.current+P()}function le({type:r,index:a,immediate:u}){if(!p||H.current||x.current&&!f)return;R.current&&(G.current="backward"),z.current="prev",R.current=!1;const j=typeof a=="number"?a:M.current-1;if(o&&Fe(),!f){const K=o?Ce("prev",a)-P()/3<0:Ce("prev",a)+P()/3>0;if(x.current)return;if(K){x.current=!0,R.current=!1,se({slideMode:r,from:re(),to:0,nextActiveItem:0,immediate:u});return}}if(f&&(x.current||j<0)){x.current=!1,R.current=!0,se({slideMode:r,from:re()-P()*n.length,to:-(P()*n.length)+P(),nextActiveItem:n.length-1,immediate:u});return}j===0&&(x.current=!0),(j===n.length-1||j===-1)&&(R.current=!0),se({slideMode:r,from:re(),to:Ce("prev",a),nextActiveItem:j,immediate:u})}function fe({type:r,index:a,immediate:u}){if(!p||H.current||R.current&&!f)return;x.current&&(G.current="forward"),z.current="next",x.current=!1;const j=a||M.current+1;if(o&&Fe(),!f){const K=Math.abs(Ce("next",a))>W()-P()/3;if(R.current)return;if(K){x.current=!1,R.current=!0,se({slideMode:r,from:re(),to:o?W():-W(),nextActiveItem:j,immediate:u});return}}if(f&&(R.current||j>n.length-1)){R.current=!1,x.current=!0,se({slideMode:r,from:re()+P()*n.length,to:0,nextActiveItem:0,immediate:u});return}j===0&&(x.current=!0),j===n.length-1&&(R.current=!0),se({slideMode:r,from:re(),to:Ce("next",a),nextActiveItem:j,immediate:u})}function _e(){A?oe.current=A:oe.current=Math.floor(P()/2/2)}function Xe(){D.current&&(ge.current=W(),T.current=f,k.current=h,X.current=o,pe.current=window.innerWidth,c.current=0,Se({id:M.current,immediate:!0,shouldReset:!0}),_e(),ye())}const Ke=p&&!N&&!o||!!o&&!!B,Ze=cr.useDrag(r=>{const a=r.dragging,u=r.offset[v==="x"?0:1],j=r.movement[v==="x"?0:1],K=r.direction[v==="x"?0:1],de=j>oe.current,ve=j<-oe.current,er=W(),te=r.velocity;if(a){if(K>0?z.current="prev":z.current="next",ce({...r,eventName:"onDrag",slideActionType:z.current}),o){if(u>0){q.start({from:{val:re()},to:{val:0},config:{velocity:te,friction:50,tension:1e3}}),r.cancel();return}q.start({from:{val:re()},to:{val:-u},config:{velocity:te,friction:50,tension:1e3}});return}q.start({val:u,config:{velocity:te,friction:50,tension:1e3}}),I&&ve?(fe({type:"drag"}),r.cancel()):I&&de&&(le({type:"drag"}),r.cancel()),er-Math.abs(u)<-(P()*2)&&r.cancel();return}if(r.last&&o&&u>0){q.start({from:{val:re()},to:{val:0},config:{velocity:te,friction:50,tension:1e3}});return}r.last&&!r.canceled&&o&&(z.current==="prev"&&le({type:"drag"}),z.current==="next"&&fe({type:"drag"})),r.last&&!r.canceled&&!o&&(Y===n.length?q.start({val:c.current,config:{...Q.config.default,velocity:te}}):ve?!f&&R.current?q.start({val:-W(),config:{...Q.config.default,velocity:te}}):fe({type:"drag"}):de?!f&&x.current?q.start({val:0,config:{...Q.config.default,velocity:te}}):le({type:"drag"}):q.start({val:c.current,config:{...Q.config.default,velocity:te}})),r.last&&r.canceled&&q.start({val:c.current,config:{...Q.config.default,velocity:te}})},{enabled:Ke,axis:v,from:()=>o&&C.current?[-C.current.scrollLeft,-C.current.scrollTop]:v==="x"?[ee.val.get(),ee.val.get()]:[ee.val.get(),ee.val.get()]});function Ne(){return o?v==="x"?{overflowX:"auto"}:{overflowY:"auto"}:{}}function Fe(){C.current&&(c.current=C.current[v==="x"?"scrollLeft":"scrollTop"],C.current[v==="x"?"scrollLeft":"scrollTop"]===0&&(x.current=!0,R.current=!1),C.current[v==="x"?"scrollLeft":"scrollTop"]>0&&C.current[v==="x"?"scrollLeft":"scrollTop"]<W()&&(x.current=!1,R.current=!1),C.current[v==="x"?"scrollLeft":"scrollTop"]===W()&&(x.current=!1,R.current=!0))}function Ge(){return o?{onWheel(){ee.val.stop(),Fe()}}:{}}function be(r,a){let u=0;if(typeof r=="string"?u=n.findIndex(j=>j.id===r):u=r,u<0||u>=n.length){if(a)throw new Error(a);console.error(`The item doesn't exist; check that the id provided - ${r} - is correct.`),u=-1}return u}function Se({id:r,immediate:a,shouldReset:u,type:j}){if(!p||H.current)return;x.current=!1,R.current=!1;const K=be(r,"The item you want to slide to doesn't exist; check the provided id.");if(K===M.current&&!u)return;const de=be(n[M.current].id),ve=be(n[K].id);ve>de?fe({type:j||u?"initial":"click",index:ve,immediate:a}):le({type:j||u?"initial":"click",index:ve,immediate:a})}function Ve(r){const a=be(r,"The item doesn't exist; check the provided id."),u=M.current;return f&&u===n.length-1?a===0:a===u+1}function Ye(r){const a=be(r,"The item doesn't exist; check the provided id."),u=M.current;return f&&u===0?a===n.length-1:a===u-1}function qe(r){return be(r,"The item you want to check doesn't exist; check the provided id.")===M.current}function Ue(){return N?"unset":v==="x"?"pan-y":"pan-x"}const Oe=o?{useListenToCustomEvent:me,enterFullscreen:We,exitFullscreen:Je,getIsFullscreen:ze,slideToPrevItem:(r=!0)=>{le({type:"click",immediate:!r})},slideToNextItem:(r=!0)=>{fe({type:"click",immediate:!r})}}:{useListenToCustomEvent:me,enterFullscreen:We,exitFullscreen:Je,getIsFullscreen:ze,slideToPrevItem:(r=!0)=>{le({type:"click",immediate:!r})},slideToNextItem:(r=!0)=>{fe({type:"click",immediate:!r})},slideToItem:(r,a=!0)=>{Se({id:r,immediate:!a})},getIsNextItem:Ve,getIsPrevItem:Ye,getIsActiveItem:qe};Q.useIsomorphicLayoutEffect(()=>{D.current&&p&&(ue.current=!0,Xe())},[p]),l.useEffect(()=>{M.current!==F&&(ue.current=!0,Se({id:F,immediate:!O}))},[F]),l.useEffect(()=>{if(p){if(F>n.length-1)throw new Error(`initialActiveItem (${F}) is greater than the total quantity available items (${n.length}).`);Y>n.length&&console.warn(`itemsPerSlide (${Y}) is greater than the total quantity available items (${n.length}). Fallback to ${n.length})`)}},[F,n.length,Y,p]),l.useEffect(()=>{pe.current=window.innerWidth},[]),l.useEffect(()=>{if(p){if(f&&o)throw new Error("`withLoop` and `freeScroll` can't be used together.");if(o&&h==="fixed")throw new Error("`freeScroll` can't be used when `scrollType: fixed`.");if(B&&(h!=="fluid"||!o))throw new Error("`enableFreeScrollDrag` must be used with `slideType: fluid` and `freeScroll=true`");if(ne&&o)throw new Error("`slideGroupOfItems` and `freeScroll` can't be used together.");if(typeof ie=="number"&&ie>0&&h==="fixed")throw new Error("`slideAmount` must be used with `slideType: fluid`");ue.current=!0,Xe()}},[b,Y,d,w,p,f,h,o,B,ne]),l.useEffect(()=>{if(!p)return;function r(){document.hidden?H.current=!0:H.current=!1}return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)}},[p]),l.useEffect(()=>{if(C.current){let r;const a=new gr(()=>{if(!H.current&&!ue.current){pe.current=window.innerWidth;const u=ye();window.clearTimeout(r),r=setTimeout(()=>{ge.current=W(),typeof u=="function"&&u()},100)}});return a.observe(C.current),()=>{a.disconnect()}}},[ye,W]);const xe=L.jsx(nr.Provider,{value:Oe,children:ke}),Be=L.jsx(nr.Provider,{value:Oe,children:L.jsx("div",{className:"use-spring-carousel-main-wrapper",ref:C,...Ge(),style:{display:"flex",position:"relative",width:"100%",height:"100%",...Ne()},children:L.jsxs("div",{className:"use-spring-carousel-track-wrapper",ref:D,...Ze(),style:{position:"relative",display:"flex",flexDirection:v==="x"?"row":"column",touchAction:Ue(),...je()},children:[(o||!f)&&d?L.jsx("div",{style:{flexShrink:0,width:d}}):null,Ie.map((r,a)=>L.jsx(l.Fragment,{children:L.jsx("div",{className:"use-spring-carousel-item","data-testid":"use-spring-carousel-item-wrapper",style:{display:"flex",position:"relative",...h==="fixed"?{flex:"1"}:{},...Pe(a===Ie.findIndex(u=>u.id===Ie[Ie.length-1].id))},children:typeof r.renderItem=="function"?r.renderItem({getIsActiveItem:qe,getIsNextItem:Ve,getIsPrevItem:Ye,useListenToCustomEvent:me}):r.renderItem})},`${r.id}-${a}`)),(o||!f)&&d?L.jsx("div",{style:{flexShrink:0,width:d}}):null]})})});return{...Oe,carouselFragment:Be,thumbsFragment:xe}}const nr=l.createContext(void 0);function Er(){const n=l.useContext(nr);if(!n)throw new Error("useSpringCarouselContext must be used within the carousel.");return n}const Me={initial:{opacity:1,position:"relative"},from:{opacity:0,position:"relative"},enter:{position:"relative",opacity:1},leave:{opacity:1,position:"absolute"}};function Tr({init:n=!0,disableGestures:p=!1,items:m,springConfig:$=Q.config.default,exitBeforeEnter:U=!1,trail:h,withLoop:w=!1,activeItem:f,toPrevItemSpringProps:d=Me,toNextItemSpringProps:v=Me,draggingSlideTreshold:N=50,thumbsSlideAxis:A="x"}){const I=l.useRef("next"),o=l.useRef("initial"),B=l.useRef(null),[b,ae]=l.useState(f??0),{emitEvent:F,useListenToCustomEvent:O}=sr(),{handleScroll:ne,thumbsFragment:De}=lr({thumbsSlideAxis:A,items:m,renderThumbFnProps:{getIsNextItem:M,getIsPrevItem:x,useListenToCustomEvent:O,activeItem:{index:b,id:m[b].id}}});function ie(){return I.current==="prev"?{initial:{...d.initial},from:{...d.from},enter:{...d.enter},leave:{...d.leave}}:I.current==="next"?{initial:{...v.initial},from:{...v.from},enter:{...v.enter},leave:{...v.leave}}:{initial:{...Me.initial},from:{...Me.from},enter:{...Me.enter},leave:{...Me.leave}}}l.useEffect(()=>{typeof f=="number"&&f!==b&&ae(f)},[f]);function Y({to:c,slideType:T,slideMode:k}){I.current=T,o.current=k,F({eventName:"onSlideStartChange",slideActionType:I.current,slideMode:o.current,nextItem:{index:c,id:m[c].id,startReached:c===0,endReached:c===m.length-1}}),ae(c),ne(b)}function ue(c){if(!n)return;const T=b===0;!w&&T||Y(w&&T?{to:m.length-1,slideType:"prev",slideMode:c}:{to:b-1,slideType:"prev",slideMode:c})}function oe(c){if(!n)return;const T=b===m.length-1;!w&&T||Y(w&&T?{to:0,slideType:"next",slideMode:c}:{to:b+1,slideType:"next",slideMode:c})}const z=Q.useTransition(b,{config:$,key:null,trail:h,exitBeforeEnter:U,...ie(),onRest(c,T,k){c.finished&&k===b&&F({eventName:"onSlideChange",slideActionType:I.current,slideMode:o.current,currentItem:{index:b,id:m[b].id,startReached:b===0,endReached:b===m.length-1}})}}),Ee=cr.useDrag(({last:c,movement:[T]})=>{if(c){const k=T>N,X=T<-N,H=b===0,He=b===m.length-1;if(X){if(!w&&He)return;F({eventName:"onLeftSwipe"}),oe("swipe")}else if(k){if(!w&&H)return;F({eventName:"onRightSwipe"}),ue("swipe")}}},{enabled:!p});function G(c,T){let k=0;if(typeof c=="string"?k=m.findIndex(X=>X.id===c):k=c,k<0||k>=m.length){if(T)throw new Error(T);console.error(`The item doesn't exist; check that the id provided - ${c} - is correct.`),k=-1}return k}function M(c){const T=G(c,"The item doesn't exist; check the provided id."),k=b;return w&&k===m.length-1?T===0:T===k+1}function x(c){const T=G(c,"The item doesn't exist; check the provided id."),k=b;return w&&k===0?T===m.length-1:T===k-1}const R=z((c,T,k,X)=>{const H=m[T].renderItem;return L.jsx(Q.a.div,{id:`use-transition-carousel-item-${X}`,className:"use-transition-carousel-item",style:{...c,flex:"1 0 100%",width:"100%",height:"100%"},children:typeof H=="function"?H({useListenToCustomEvent:O,getIsNextItem:M,getIsPrevItem:x,activeItem:{index:b,id:m[b].id}}):H})});function C(){return p?"unset":"pan-y"}const D={useListenToCustomEvent:O,slideToPrevItem:()=>ue("click"),slideToNextItem:()=>oe("click"),activeItem:b,slideToItem:c=>{const T=G(c,"The item you want to slide to doesn't exist; check the provided id.");if(c===b)return;const k=G(m[b].id),X=G(m[T].id);Y({to:X,slideType:X>k?"next":"prev",slideMode:"click"})}},ge=L.jsx(ir.Provider,{value:D,children:De}),pe=L.jsx(ir.Provider,{value:D,children:L.jsx("div",{className:"use-transition-carousel-wrapper",ref:B,...Ee(),style:{display:"flex",position:"relative",width:"100%",height:"100%",overflow:"hidden",touchAction:C()},children:R})});return{...D,carouselFragment:pe,thumbsFragment:ge}}const ir=l.createContext(void 0);function wr(){const n=l.useContext(ir);if(!n)throw new Error("useTransitionCarouselContext must be used within the carousel.");return n}exports.useSpringCarousel=Rr;exports.useSpringCarouselContext=Er;exports.useTransitionCarousel=Tr;exports.useTransitionCarouselContext=wr;
28
- //# sourceMappingURL=index.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/modules/useEventsModule.ts","../src/modules/useFullscreenModule.ts","../src/modules/useThumbsModule.tsx","../src/useSpringCarousel.tsx","../src/useTransitionCarousel.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%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).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('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', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { useEffect, useRef } from 'react'\n\nimport { EventHandler, Events } from '../types/useEventsModule.types'\n\nconst eventLabel = 'RSC::Event'\n\nexport function useEventsModule<T extends 'use-spring' | 'use-transition'>() {\n const targetEvent = useRef<HTMLDivElement | null>(null)\n\n function useListenToCustomEvent(eventHandler: EventHandler<T>) {\n useEffect(() => {\n if (!targetEvent.current) {\n targetEvent.current = document.createElement('div')\n }\n\n function handleEvent(event: CustomEvent<Events<T>>) {\n eventHandler(event.detail)\n }\n\n if (targetEvent.current) {\n // @ts-ignore\n targetEvent.current.addEventListener(eventLabel, handleEvent, false)\n return () => {\n // @ts-ignore\n targetEvent.current?.removeEventListener(eventLabel, handleEvent, false)\n }\n }\n }, [eventHandler])\n }\n function emitEvent(event: Events<T>) {\n if (targetEvent.current) {\n const newEvent = new CustomEvent(eventLabel, {\n detail: event,\n })\n targetEvent.current.dispatchEvent(newEvent)\n }\n }\n\n return {\n useListenToCustomEvent,\n emitEvent,\n }\n}\n","import { useEffect, useRef } from 'react'\nimport screenfull from 'screenfull'\n\nimport { FullscreenModule } from '../types/useFullscreenModule.types'\n\nexport function useFullscreenModule({\n mainCarouselWrapperRef,\n onFullScreenChange,\n handleResize,\n}: FullscreenModule) {\n const isFullscreen = useRef(false)\n\n useEffect(() => {\n function handleFullscreenChange() {\n if (document.fullscreenElement) {\n setIsFullscreen(true)\n onFullScreenChange(true)\n handleResize && handleResize()\n }\n\n if (!document.fullscreenElement) {\n setIsFullscreen(false)\n onFullScreenChange(false)\n handleResize && handleResize()\n }\n }\n\n if (screenfull.isEnabled) {\n screenfull.on('change', handleFullscreenChange)\n return () => {\n if (screenfull.isEnabled) {\n screenfull.off('change', handleFullscreenChange)\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n function setIsFullscreen(_isFullscreen: boolean) {\n isFullscreen.current = _isFullscreen\n }\n\n function getIsFullscreen() {\n return isFullscreen.current\n }\n\n function enterFullscreen(elementRef?: HTMLElement) {\n if (screenfull.isEnabled) {\n screenfull.request((elementRef || mainCarouselWrapperRef.current) as Element)\n }\n }\n\n function exitFullscreen() {\n screenfull.isEnabled && screenfull.exit()\n }\n\n return {\n enterFullscreen,\n exitFullscreen,\n getIsFullscreen,\n }\n}\n","import { useSpring } from '@react-spring/web'\nimport { useRef } from 'react'\n\nimport { PrepareThumbsData } from '../types'\nimport { UseThumbsModule } from '../types/useThumbsModule.types'\n\nfunction isInViewport(el: HTMLElement) {\n const rect = el.getBoundingClientRect()\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth)\n )\n}\n\nexport function useThumbsModule<T extends 'use-spring' | 'use-transition'>({\n thumbsSlideAxis = 'x',\n withThumbs = false,\n prepareThumbsData,\n items,\n renderThumbFnProps,\n}: UseThumbsModule<T>) {\n const wrapperRef = useRef<HTMLDivElement | null>(null)\n const [spring, setSpring] = useSpring(() => ({\n val: 0,\n }))\n\n function getTotalScrollValue() {\n if (!wrapperRef.current) return 0\n return Math.round(\n Number(wrapperRef.current?.[thumbsSlideAxis === 'x' ? 'scrollWidth' : 'scrollHeight']) -\n wrapperRef.current.getBoundingClientRect()[thumbsSlideAxis === 'x' ? 'width' : 'height'],\n )\n }\n\n function handleScroll(activeItem: number) {\n function getThumbNode() {\n if (wrapperRef.current) {\n return wrapperRef.current.querySelector(\n `#thumb-item-${items[activeItem].id}`,\n ) as HTMLElement\n }\n return null\n }\n\n const thumbNode = getThumbNode()\n if (thumbNode && wrapperRef.current) {\n if (!isInViewport(thumbNode)) {\n const offset = thumbNode.offsetLeft\n const val = offset > getTotalScrollValue() ? getTotalScrollValue() : offset\n\n setSpring.start({\n from: {\n val: wrapperRef.current?.[thumbsSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop'] ?? 0,\n },\n to: {\n val,\n },\n onChange: ({ value }) => {\n if (wrapperRef.current) {\n wrapperRef.current[thumbsSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop'] = Math.abs(\n value.val,\n )\n }\n },\n })\n }\n }\n }\n\n function handlePrepareThumbsData() {\n function getPreparedItems(\n _items: ReturnType<PrepareThumbsData<T>>,\n ): ReturnType<PrepareThumbsData<T>> {\n return _items.map((i) => ({\n id: i.id,\n renderThumb: i.renderThumb,\n }))\n }\n\n if (prepareThumbsData) {\n return prepareThumbsData(getPreparedItems(items))\n }\n return getPreparedItems(items)\n }\n\n const thumbsFragment = withThumbs ? (\n <div\n className=\"use-spring-carousel-thumbs-wrapper\"\n ref={wrapperRef}\n onWheel={() => spring.val.stop()}\n style={{\n display: 'flex',\n flex: '1',\n position: 'relative',\n width: '100%',\n height: '100%',\n flexDirection: thumbsSlideAxis === 'x' ? 'row' : 'column',\n ...(thumbsSlideAxis === 'x'\n ? { overflowX: 'auto' }\n : {\n overflowY: 'auto',\n maxHeight: '100%',\n }),\n }}\n >\n {handlePrepareThumbsData().map(({ id, renderThumb }) => {\n const thumbId = `thumb-item-${id}`\n return (\n <div key={thumbId} id={thumbId} className=\"thumb-item\">\n {typeof renderThumb === 'function' ? renderThumb(renderThumbFnProps) : renderThumb}\n </div>\n )\n })}\n </div>\n ) : null\n\n return {\n thumbsFragment,\n handleScroll,\n }\n}\n","import { config, useIsomorphicLayoutEffect, useSpring } from '@react-spring/web'\nimport { useDrag } from '@use-gesture/react'\nimport React, { createContext, Fragment, useCallback, useContext, useEffect, useRef } from 'react'\nimport ResizeObserver from 'resize-observer-polyfill'\n\nimport { useEventsModule } from './modules/useEventsModule'\nimport { useFullscreenModule } from './modules/useFullscreenModule'\nimport { useThumbsModule } from './modules/useThumbsModule'\nimport {\n ItemWithThumb,\n SlideActionType,\n SlideMode,\n SlideType,\n UseSpringFreeScrollReturnType,\n UseSpringReturnType,\n} from './types'\nimport {\n Complete,\n FixedWithLoop,\n FixedWithNoLoop,\n FluidWithFreeScroll,\n FluidWithNoFreeScroll,\n} from './types/useSpringCarousel.types'\n\ntype ReturnType<T> = T extends true ? UseSpringFreeScrollReturnType : UseSpringReturnType\n\nfunction useSpringCarousel(props: FixedWithLoop): ReturnType<false>\nfunction useSpringCarousel(props: FixedWithNoLoop): ReturnType<false>\nfunction useSpringCarousel(props: FluidWithFreeScroll): ReturnType<true>\nfunction useSpringCarousel(props: FluidWithNoFreeScroll): ReturnType<false>\nfunction useSpringCarousel(props: Complete): ReturnType<true>\nfunction useSpringCarousel(props: Complete): ReturnType<false>\n\nfunction useSpringCarousel({\n items,\n init = true,\n withThumbs,\n thumbsSlideAxis = 'x',\n itemsPerSlide: _itemsPerSlide = 1,\n slideType = 'fixed',\n gutter = 0,\n withLoop = false,\n startEndGutter = 0,\n carouselSlideAxis = 'x',\n disableGestures = false,\n draggingSlideTreshold: _draggingSlideTreshold,\n slideWhenThresholdIsReached = false,\n freeScroll,\n enableFreeScrollDrag,\n initialStartingPosition,\n prepareThumbsData,\n initialActiveItem = 0,\n animateWhenActiveItemChange = true,\n slideGroupOfItems = false,\n __unstable_stretch_tems__ = true,\n slideAmount,\n}: Complete): ReturnType<typeof freeScroll> {\n const itemsPerSlide = _itemsPerSlide\n const resizeByPropChange = useRef(false)\n const draggingSlideTreshold = useRef(_draggingSlideTreshold ?? 0)\n const slideActionType = useRef<SlideActionType>('initial')\n const slideModeType = useRef<SlideMode>('initial')\n\n /**\n * After the user hits start/end edges of the carousel,\n * we check where the user is going. This is useful\n * to correctly resize the carousel when the carousel is going\n * backward after reaching the last item in fluid slide mode\n */\n const directionAfterReachingEdges = useRef<'forward' | 'backward' | 'initial'>('initial')\n\n const activeItem = useRef(initialActiveItem)\n const firstItemReached = useRef(initialActiveItem === 0)\n const lastItemReached = useRef(slideType === 'fixed' && initialActiveItem === items.length - 1)\n const mainCarouselWrapperRef = useRef<HTMLDivElement | null>(null)\n const carouselTrackWrapperRef = useRef<HTMLDivElement | null>(null)\n\n const prevTotalScrollValue = useRef(0)\n const prevWindowWidth = useRef(0)\n const prevSlidedValue = useRef(0)\n const prevWithLoop = useRef(withLoop)\n const prevSlideType = useRef(slideType)\n const prevFreeScroll = useRef(freeScroll)\n const windowIsHidden = useRef(false)\n\n const getItems = useCallback(() => {\n if (withLoop) {\n return [\n ...items.map((i) => ({\n ...i,\n id: `prev-repeated-item-${i.id}`,\n })),\n ...items,\n ...items.map((i) => ({\n ...i,\n id: `next-repeated-item-${i.id}`,\n })),\n ]\n }\n return [...items]\n }, [items, withLoop])\n const internalItems = getItems()\n\n const [spring, setSpring] = useSpring(\n () => ({\n val: 0,\n pause: !init,\n onChange: ({ value }) => {\n if (freeScroll && mainCarouselWrapperRef.current) {\n if (carouselSlideAxis === 'x') {\n mainCarouselWrapperRef.current.scrollLeft = Math.abs(value.val)\n } else {\n mainCarouselWrapperRef.current.scrollTop = Math.abs(value.val)\n }\n setStartEndItemReachedOnFreeScroll()\n } else if (carouselTrackWrapperRef.current) {\n if (carouselSlideAxis === 'x') {\n carouselTrackWrapperRef.current.style.transform = `translate3d(${value.val}px, 0px,0px)`\n } else {\n carouselTrackWrapperRef.current.style.transform = `translate3d(0px,${value.val}px,0px)`\n }\n }\n },\n }),\n [freeScroll],\n )\n const { emitEvent, useListenToCustomEvent } = useEventsModule<'use-spring'>()\n const { thumbsFragment, handleScroll } = useThumbsModule<'use-spring'>({\n withThumbs: !!withThumbs,\n thumbsSlideAxis,\n prepareThumbsData,\n items: items as ItemWithThumb<'use-spring'>[],\n renderThumbFnProps: {\n getIsActiveItem,\n getIsPrevItem,\n useListenToCustomEvent,\n getIsNextItem,\n },\n })\n const { enterFullscreen, exitFullscreen, getIsFullscreen } = useFullscreenModule({\n mainCarouselWrapperRef,\n handleResize: () => adjustCarouselWrapperPosition(),\n onFullScreenChange: (val) => {\n emitEvent({\n eventName: 'onFullscreenChange',\n isFullscreen: val,\n })\n },\n })\n\n function getItemStyles(isLastItem: boolean) {\n if (slideType === 'fixed' && !freeScroll) {\n return {\n marginRight: `${isLastItem ? 0 : gutter}px`,\n flex: `${__unstable_stretch_tems__ ? '1' : '0'} 0 calc(100% / ${itemsPerSlide} - ${\n (gutter * (itemsPerSlide - 1)) / itemsPerSlide\n }px)`,\n }\n }\n return {\n ...{ marginRight: `${isLastItem ? 0 : gutter}px` },\n }\n }\n const getSlideValue = useCallback(() => {\n if (\n typeof slideAmount === 'number' &&\n slideAmount > 0 &&\n (slideType === 'fluid' || freeScroll)\n ) {\n return slideAmount\n }\n\n const carouselItem = slideGroupOfItems\n ? mainCarouselWrapperRef.current\n : mainCarouselWrapperRef.current?.querySelector('.use-spring-carousel-item')\n\n if (!carouselItem) {\n throw Error('No carousel items available!')\n }\n\n let main = carouselItem.getBoundingClientRect()[carouselSlideAxis === 'x' ? 'width' : 'height']\n\n if (!slideGroupOfItems) {\n main += gutter\n }\n if (slideGroupOfItems) {\n main += gutter - startEndGutter * 2\n }\n\n return main\n }, [\n carouselSlideAxis,\n freeScroll,\n gutter,\n slideAmount,\n slideGroupOfItems,\n slideType,\n startEndGutter,\n ])\n\n type SlideToItem = {\n from: number\n to: number\n nextActiveItem?: number\n immediate?: boolean\n slideMode: SlideMode\n }\n\n function slideToItem({ from, to, nextActiveItem, immediate = false, slideMode }: SlideToItem) {\n slideModeType.current = slideMode\n\n if (typeof nextActiveItem === 'number') {\n if (!freeScroll) {\n activeItem.current = nextActiveItem\n }\n emitEvent({\n eventName: 'onSlideStartChange',\n slideActionType: slideActionType.current,\n slideMode: slideModeType.current,\n nextItem: {\n startReached: firstItemReached.current,\n endReached: lastItemReached.current,\n index: freeScroll ? -1 : activeItem.current,\n id: freeScroll ? '' : items[activeItem.current].id,\n },\n })\n }\n\n prevSlidedValue.current = to\n setSpring.start({\n immediate,\n from: {\n val: from,\n },\n to: {\n val: to,\n },\n config: {\n ...config.default,\n velocity: spring.val.velocity,\n },\n onRest(value) {\n if (!immediate && value.finished) {\n emitEvent({\n eventName: 'onSlideChange',\n slideActionType: slideActionType.current,\n slideMode: slideModeType.current,\n currentItem: {\n startReached: firstItemReached.current,\n endReached: lastItemReached.current,\n index: freeScroll ? -1 : activeItem.current,\n id: freeScroll ? '' : items[activeItem.current].id,\n },\n })\n }\n },\n })\n if (withThumbs && !immediate) {\n handleScroll(activeItem.current)\n }\n }\n const getTotalScrollValue = useCallback(() => {\n if (!carouselTrackWrapperRef.current) return 0\n if (withLoop) {\n return getSlideValue() * items.length\n }\n return Math.round(\n Number(\n carouselTrackWrapperRef.current?.[\n carouselSlideAxis === 'x' ? 'scrollWidth' : 'scrollHeight'\n ],\n ) -\n carouselTrackWrapperRef.current.getBoundingClientRect()[\n carouselSlideAxis === 'x' ? 'width' : 'height'\n ] -\n startEndGutter * 2,\n )\n }, [carouselSlideAxis, getSlideValue, items.length, startEndGutter, withLoop])\n function getAnimatedWrapperStyles() {\n const percentValue = `calc(100% - ${startEndGutter * 2}px)`\n return {\n width: carouselSlideAxis === 'x' ? percentValue : '100%',\n height: carouselSlideAxis === 'y' ? percentValue : '100%',\n }\n }\n\n const getCarouselItemWidth = useCallback(() => {\n const carouselItem = carouselTrackWrapperRef.current?.querySelector('.use-spring-carousel-item')\n if (!carouselItem) {\n throw Error('No carousel items available!')\n }\n return (\n carouselItem.getBoundingClientRect()[carouselSlideAxis === 'x' ? 'width' : 'height'] + gutter\n )\n }, [carouselSlideAxis, gutter])\n\n const setPosition = useCallback(\n (v: number) => {\n const positionProperty = carouselSlideAxis === 'x' ? 'left' : 'top'\n const ref = carouselTrackWrapperRef.current\n if (!ref) return\n\n if (withLoop) {\n ref.style.top = '0px'\n ref.style.left = '0px'\n ref.style[positionProperty] = `-${v - startEndGutter}px`\n\n firstItemReached.current = false\n lastItemReached.current = false\n } else {\n ref.style.left = '0px'\n ref.style.top = '0px'\n }\n },\n [carouselSlideAxis, startEndGutter, withLoop],\n )\n\n const adjustCarouselWrapperPosition = useCallback(\n (shouldResetPosition = false) => {\n if (carouselTrackWrapperRef.current && shouldResetPosition) {\n carouselTrackWrapperRef.current.style.transform = `translate3d(0px, 0px,0px)`\n carouselTrackWrapperRef.current.style.left = `0`\n carouselTrackWrapperRef.current.style.top = `0`\n }\n\n if (slideType === 'fixed') {\n if (initialStartingPosition === 'center') {\n setPosition(\n getCarouselItemWidth() * items.length -\n getSlideValue() * Math.round((itemsPerSlide - 1) / 2),\n )\n } else if (initialStartingPosition === 'end') {\n setPosition(\n getCarouselItemWidth() * items.length - getSlideValue() * Math.round(itemsPerSlide - 1),\n )\n } else {\n setPosition(getCarouselItemWidth() * items.length)\n }\n }\n\n if (slideType === 'fluid') {\n setPosition(getCarouselItemWidth() * items.length)\n /**\n * User reached the last item and now is resizing the container that becomes smaller/bigger.\n * Example: on mobile devices the user rotates the device\n */\n if (\n lastItemReached.current &&\n getTotalScrollValue() !== Math.abs(prevSlidedValue.current) &&\n !withLoop\n ) {\n const newVal = -getTotalScrollValue()\n prevSlidedValue.current = newVal\n setSpring.start({\n immediate: true,\n val: prevSlidedValue.current,\n })\n return\n }\n\n if (\n Math.abs(prevSlidedValue.current) > 0 &&\n getTotalScrollValue() !== Math.abs(prevSlidedValue.current) &&\n !withLoop &&\n !freeScroll &&\n directionAfterReachingEdges.current === 'backward'\n ) {\n const diff = prevTotalScrollValue.current - getTotalScrollValue()\n const next = prevSlidedValue.current + diff\n\n setSpring.start({\n immediate: true,\n val: next,\n })\n\n return () => {\n prevSlidedValue.current = next\n }\n }\n\n return\n }\n\n if (!freeScroll && slideType === 'fixed') {\n const nextValue = -(getSlideValue() * activeItem.current)\n\n /**\n * Here we make sure to always show the latest item as the\n * latest item visible in the carousel viewport.\n */\n if (Math.abs(nextValue) > getTotalScrollValue() && !withLoop) {\n const val = -getTotalScrollValue()\n lastItemReached.current = true\n prevSlidedValue.current = val\n setSpring.start({\n immediate: true,\n val: prevSlidedValue.current,\n })\n } else {\n prevSlidedValue.current = nextValue\n setSpring.start({\n immediate: true,\n val: nextValue,\n })\n }\n\n setTimeout(() => {\n resizeByPropChange.current = false\n }, 0)\n }\n },\n [\n freeScroll,\n getCarouselItemWidth,\n getSlideValue,\n getTotalScrollValue,\n initialStartingPosition,\n items.length,\n itemsPerSlide,\n setPosition,\n setSpring,\n slideType,\n withLoop,\n ],\n )\n function getFromValue() {\n if (freeScroll && mainCarouselWrapperRef.current) {\n return mainCarouselWrapperRef.current[carouselSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop']\n }\n return spring.val.get()\n }\n function getToValue(type: 'next' | 'prev', index?: number) {\n if (freeScroll && type === 'next') {\n const next = prevSlidedValue.current + getSlideValue()\n if (next > getTotalScrollValue()) {\n return getTotalScrollValue()\n }\n return next\n }\n\n if (freeScroll && type === 'prev') {\n const next = prevSlidedValue.current - getSlideValue()\n if (next < 0) {\n return 0\n }\n return next\n }\n\n if (type === 'next') {\n if (typeof index === 'number') {\n return -(index * getSlideValue())\n }\n return prevSlidedValue.current - getSlideValue()\n }\n\n if (typeof index === 'number') {\n return -(index * getSlideValue())\n }\n return prevSlidedValue.current + getSlideValue()\n }\n\n type SlideToPrevNextItem = {\n type: SlideMode\n index?: number\n immediate?: boolean\n }\n function slideToPrevItem({ type, index, immediate }: SlideToPrevNextItem) {\n if (!init || windowIsHidden.current || (firstItemReached.current && !withLoop)) return\n\n if (lastItemReached.current) {\n directionAfterReachingEdges.current = 'backward'\n }\n\n slideActionType.current = 'prev'\n lastItemReached.current = false\n\n const nextItem = typeof index === 'number' ? index : activeItem.current - 1\n\n if (freeScroll) {\n setStartEndItemReachedOnFreeScroll()\n }\n\n if (!withLoop) {\n const nextItemWillExceed = freeScroll\n ? getToValue('prev', index) - getSlideValue() / 3 < 0\n : getToValue('prev', index) + getSlideValue() / 3 > 0\n\n if (firstItemReached.current) return\n if (nextItemWillExceed) {\n firstItemReached.current = true\n lastItemReached.current = false\n\n slideToItem({\n slideMode: type,\n from: getFromValue(),\n to: 0,\n nextActiveItem: 0,\n immediate,\n })\n return\n }\n }\n if (withLoop && (firstItemReached.current || nextItem < 0)) {\n firstItemReached.current = false\n lastItemReached.current = true\n slideToItem({\n slideMode: type,\n from: getFromValue() - getSlideValue() * items.length,\n to: -(getSlideValue() * items.length) + getSlideValue(),\n nextActiveItem: items.length - 1,\n immediate,\n })\n return\n }\n if (nextItem === 0) {\n firstItemReached.current = true\n }\n if (nextItem === items.length - 1 || nextItem === -1) {\n lastItemReached.current = true\n }\n slideToItem({\n slideMode: type,\n from: getFromValue(),\n to: getToValue('prev', index),\n nextActiveItem: nextItem,\n immediate,\n })\n }\n function slideToNextItem({ type, index, immediate }: SlideToPrevNextItem) {\n if (!init || windowIsHidden.current || (lastItemReached.current && !withLoop)) return\n\n if (firstItemReached.current) {\n directionAfterReachingEdges.current = 'forward'\n }\n\n slideActionType.current = 'next'\n firstItemReached.current = false\n\n const nextItem = index || activeItem.current + 1\n\n if (freeScroll) {\n setStartEndItemReachedOnFreeScroll()\n }\n\n if (!withLoop) {\n const nextItemWillExceed =\n Math.abs(getToValue('next', index)) > getTotalScrollValue() - getSlideValue() / 3\n\n if (lastItemReached.current) return\n if (nextItemWillExceed) {\n firstItemReached.current = false\n lastItemReached.current = true\n\n slideToItem({\n slideMode: type,\n from: getFromValue(),\n to: freeScroll ? getTotalScrollValue() : -getTotalScrollValue(),\n nextActiveItem: nextItem,\n immediate,\n })\n return\n }\n }\n if (withLoop && (lastItemReached.current || nextItem > items.length - 1)) {\n lastItemReached.current = false\n firstItemReached.current = true\n slideToItem({\n slideMode: type,\n from: getFromValue() + getSlideValue() * items.length,\n to: 0,\n nextActiveItem: 0,\n immediate,\n })\n return\n }\n if (nextItem === 0) {\n firstItemReached.current = true\n }\n if (nextItem === items.length - 1) {\n lastItemReached.current = true\n }\n slideToItem({\n slideMode: type,\n from: getFromValue(),\n to: getToValue('next', index),\n nextActiveItem: nextItem,\n immediate,\n })\n }\n function setDraggingSliderTreshold() {\n if (_draggingSlideTreshold) {\n draggingSlideTreshold.current = _draggingSlideTreshold\n } else {\n draggingSlideTreshold.current = Math.floor(getSlideValue() / 2 / 2)\n }\n }\n function initializeCarousel() {\n if (carouselTrackWrapperRef.current) {\n prevTotalScrollValue.current = getTotalScrollValue()\n prevWithLoop.current = withLoop\n prevSlideType.current = slideType\n prevFreeScroll.current = freeScroll\n prevWindowWidth.current = window.innerWidth\n prevSlidedValue.current = 0\n\n internalSlideToItem({ id: activeItem.current, immediate: true, shouldReset: true })\n setDraggingSliderTreshold()\n adjustCarouselWrapperPosition()\n }\n }\n\n const enableDrag =\n (init && !disableGestures && !freeScroll) || (!!freeScroll && !!enableFreeScrollDrag)\n\n const bindDrag = useDrag(\n (state) => {\n const isDragging = state.dragging\n const movement = state.offset[carouselSlideAxis === 'x' ? 0 : 1]\n const currentMovement = state.movement[carouselSlideAxis === 'x' ? 0 : 1]\n const direction = state.direction[carouselSlideAxis === 'x' ? 0 : 1]\n\n const prevItemTreshold = currentMovement > draggingSlideTreshold.current\n const nextItemTreshold = currentMovement < -draggingSlideTreshold.current\n const tot = getTotalScrollValue()\n\n const velocity = state.velocity\n\n if (isDragging) {\n if (direction > 0) {\n slideActionType.current = 'prev'\n } else {\n slideActionType.current = 'next'\n }\n\n emitEvent({\n ...state,\n eventName: 'onDrag',\n slideActionType: slideActionType.current,\n })\n\n if (freeScroll) {\n if (movement > 0) {\n setSpring.start({\n from: {\n val: getFromValue(),\n },\n to: {\n val: 0,\n },\n config: {\n velocity: velocity,\n friction: 50,\n tension: 1000,\n },\n })\n state.cancel()\n return\n }\n\n setSpring.start({\n from: {\n val: getFromValue(),\n },\n to: {\n val: -movement,\n },\n config: {\n velocity: velocity,\n friction: 50,\n tension: 1000,\n },\n })\n return\n }\n\n setSpring.start({\n val: movement,\n config: {\n velocity: velocity,\n friction: 50,\n tension: 1000,\n },\n })\n\n if (slideWhenThresholdIsReached && nextItemTreshold) {\n slideToNextItem({ type: 'drag' })\n state.cancel()\n } else if (slideWhenThresholdIsReached && prevItemTreshold) {\n slideToPrevItem({ type: 'drag' })\n state.cancel()\n }\n\n const res = tot - Math.abs(movement)\n\n if (res < -(getSlideValue() * 2)) {\n state.cancel()\n }\n\n return\n }\n\n if (state.last && freeScroll && movement > 0) {\n setSpring.start({\n from: {\n val: getFromValue(),\n },\n to: {\n val: 0,\n },\n config: {\n velocity: velocity,\n friction: 50,\n tension: 1000,\n },\n })\n return\n }\n if (state.last && !state.canceled && freeScroll) {\n if (slideActionType.current === 'prev') {\n slideToPrevItem({ type: 'drag' })\n }\n if (slideActionType.current === 'next') {\n slideToNextItem({ type: 'drag' })\n }\n }\n if (state.last && !state.canceled && !freeScroll) {\n if (itemsPerSlide === items.length) {\n setSpring.start({\n val: prevSlidedValue.current,\n config: {\n ...config.default,\n velocity: velocity,\n },\n })\n } else if (nextItemTreshold) {\n if (!withLoop && lastItemReached.current) {\n setSpring.start({\n val: -getTotalScrollValue(),\n config: {\n ...config.default,\n velocity: velocity,\n },\n })\n } else {\n slideToNextItem({ type: 'drag' })\n }\n } else if (prevItemTreshold) {\n if (!withLoop && firstItemReached.current) {\n setSpring.start({\n val: 0,\n config: {\n ...config.default,\n velocity: velocity,\n },\n })\n } else {\n slideToPrevItem({ type: 'drag' })\n }\n } else {\n setSpring.start({\n val: prevSlidedValue.current,\n config: {\n ...config.default,\n velocity: velocity,\n },\n })\n }\n }\n if (state.last && state.canceled) {\n setSpring.start({\n val: prevSlidedValue.current,\n config: {\n ...config.default,\n velocity: velocity,\n },\n })\n }\n },\n {\n enabled: enableDrag,\n axis: carouselSlideAxis,\n from: () => {\n if (freeScroll && mainCarouselWrapperRef.current) {\n return [\n -mainCarouselWrapperRef.current.scrollLeft,\n -mainCarouselWrapperRef.current.scrollTop,\n ]\n }\n if (carouselSlideAxis === 'x') {\n return [spring.val.get(), spring.val.get()]\n }\n return [spring.val.get(), spring.val.get()]\n },\n },\n )\n\n function getWrapperOverflowStyles() {\n if (freeScroll) {\n if (carouselSlideAxis === 'x') {\n return {\n overflowX: 'auto',\n }\n }\n return {\n overflowY: 'auto',\n }\n }\n return {}\n }\n function setStartEndItemReachedOnFreeScroll() {\n if (mainCarouselWrapperRef.current) {\n prevSlidedValue.current =\n mainCarouselWrapperRef.current[carouselSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop']\n if (\n mainCarouselWrapperRef.current[carouselSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop'] === 0\n ) {\n firstItemReached.current = true\n lastItemReached.current = false\n }\n if (\n mainCarouselWrapperRef.current[carouselSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop'] >\n 0 &&\n mainCarouselWrapperRef.current[carouselSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop'] <\n getTotalScrollValue()\n ) {\n firstItemReached.current = false\n lastItemReached.current = false\n }\n\n if (\n mainCarouselWrapperRef.current[carouselSlideAxis === 'x' ? 'scrollLeft' : 'scrollTop'] ===\n getTotalScrollValue()\n ) {\n firstItemReached.current = false\n lastItemReached.current = true\n }\n }\n }\n function getScrollHandlers() {\n if (freeScroll) {\n return {\n onWheel() {\n spring.val.stop()\n setStartEndItemReachedOnFreeScroll()\n },\n }\n }\n return {}\n }\n function findItemIndex(id: string | number, error?: string) {\n let itemIndex = 0\n\n if (typeof id === 'string') {\n itemIndex = items.findIndex((item) => item.id === id)\n } else {\n itemIndex = id\n }\n if (itemIndex < 0 || itemIndex >= items.length) {\n if (error) {\n throw new Error(error)\n }\n console.error(`The item doesn't exist; check that the id provided - ${id} - is correct.`)\n itemIndex = -1\n }\n\n return itemIndex\n }\n type InternalSlideToItem = {\n id: string | number\n immediate?: boolean\n shouldReset?: boolean\n type?: SlideType\n }\n function internalSlideToItem({ id, immediate, shouldReset, type }: InternalSlideToItem) {\n if (!init || windowIsHidden.current) return\n\n firstItemReached.current = false\n lastItemReached.current = false\n\n const itemIndex = findItemIndex(\n id,\n \"The item you want to slide to doesn't exist; check the provided id.\",\n )\n\n if (itemIndex === activeItem.current && !shouldReset) {\n return\n }\n\n const currentItem = findItemIndex(items[activeItem.current].id)\n const newActiveItem = findItemIndex(items[itemIndex].id)\n\n if (newActiveItem > currentItem) {\n slideToNextItem({\n type: type || shouldReset ? 'initial' : 'click',\n index: newActiveItem,\n immediate,\n })\n } else {\n slideToPrevItem({\n type: type || shouldReset ? 'initial' : 'click',\n index: newActiveItem,\n immediate,\n })\n }\n }\n function getIsNextItem(id: string | number) {\n const itemIndex = findItemIndex(id, \"The item doesn't exist; check the provided id.\")\n const _activeItem = activeItem.current\n if (withLoop && _activeItem === items.length - 1) {\n return itemIndex === 0\n }\n return itemIndex === _activeItem + 1\n }\n function getIsPrevItem(id: string | number) {\n const itemIndex = findItemIndex(id, \"The item doesn't exist; check the provided id.\")\n const _activeItem = activeItem.current\n if (withLoop && _activeItem === 0) {\n return itemIndex === items.length - 1\n }\n return itemIndex === _activeItem - 1\n }\n function getIsActiveItem(id: string | number) {\n return (\n findItemIndex(id, \"The item you want to check doesn't exist; check the provided id.\") ===\n activeItem.current\n )\n }\n function getTouchAction() {\n if (disableGestures) {\n return 'unset'\n }\n\n if (carouselSlideAxis === 'x') {\n return 'pan-y'\n }\n return 'pan-x'\n }\n\n const res = freeScroll\n ? {\n useListenToCustomEvent,\n enterFullscreen,\n exitFullscreen,\n getIsFullscreen,\n slideToPrevItem: (animate = true) => {\n slideToPrevItem({\n type: 'click',\n immediate: !animate,\n })\n },\n slideToNextItem: (animate = true) => {\n slideToNextItem({\n type: 'click',\n immediate: !animate,\n })\n },\n }\n : {\n useListenToCustomEvent,\n enterFullscreen,\n exitFullscreen,\n getIsFullscreen,\n slideToPrevItem: (animate = true) => {\n slideToPrevItem({\n type: 'click',\n immediate: !animate,\n })\n },\n slideToNextItem: (animate = true) => {\n slideToNextItem({\n type: 'click',\n immediate: !animate,\n })\n },\n slideToItem: (id: string | number, animate = true) => {\n internalSlideToItem({ id, immediate: !animate })\n },\n getIsNextItem,\n getIsPrevItem,\n getIsActiveItem,\n }\n\n // uwc-debug-below\n useIsomorphicLayoutEffect(() => {\n /**\n * Set initial track position when carousel is initialized\n */\n if (carouselTrackWrapperRef.current && init) {\n resizeByPropChange.current = true\n initializeCarousel()\n }\n }, [init])\n useEffect(() => {\n if (activeItem.current !== initialActiveItem) {\n resizeByPropChange.current = true\n internalSlideToItem({\n id: initialActiveItem,\n immediate: !animateWhenActiveItemChange,\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [initialActiveItem])\n useEffect(() => {\n if (init) {\n if (initialActiveItem > items.length - 1) {\n throw new Error(\n `initialActiveItem (${initialActiveItem}) is greater than the total quantity available items (${items.length}).`,\n )\n }\n if (itemsPerSlide > items.length) {\n console.warn(\n `itemsPerSlide (${itemsPerSlide}) is greater than the total quantity available items (${items.length}). Fallback to ${items.length})`,\n )\n }\n }\n }, [initialActiveItem, items.length, itemsPerSlide, init])\n useEffect(() => {\n prevWindowWidth.current = window.innerWidth\n }, [])\n\n /**\n * When these props change we reset the carousel\n */\n useEffect(() => {\n if (init) {\n if (withLoop && freeScroll) {\n throw new Error(\"`withLoop` and `freeScroll` can't be used together.\")\n }\n if (freeScroll && slideType === 'fixed') {\n throw new Error(\"`freeScroll` can't be used when `scrollType: fixed`.\")\n }\n if (enableFreeScrollDrag && (slideType !== 'fluid' || !freeScroll)) {\n throw new Error(\n '`enableFreeScrollDrag` must be used with `slideType: fluid` and `freeScroll=true`',\n )\n }\n if (slideGroupOfItems && freeScroll) {\n throw new Error(\"`slideGroupOfItems` and `freeScroll` can't be used together.\")\n }\n if (typeof slideAmount === 'number' && slideAmount > 0 && slideType === 'fixed') {\n throw new Error('`slideAmount` must be used with `slideType: fluid`')\n }\n\n resizeByPropChange.current = true\n initializeCarousel()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n initialStartingPosition,\n itemsPerSlide,\n startEndGutter,\n gutter,\n init,\n withLoop,\n slideType,\n freeScroll,\n enableFreeScrollDrag,\n slideGroupOfItems,\n ])\n\n useEffect(() => {\n if (!init) return\n function handleVisibilityChange() {\n if (document.hidden) {\n windowIsHidden.current = true\n } else {\n windowIsHidden.current = false\n }\n }\n document.addEventListener('visibilitychange', handleVisibilityChange)\n return () => {\n document.removeEventListener('visibilitychange', handleVisibilityChange)\n }\n }, [init])\n\n useEffect(() => {\n if (mainCarouselWrapperRef.current) {\n let timer: NodeJS.Timeout\n const observer = new ResizeObserver(() => {\n if (windowIsHidden.current) return\n if (!resizeByPropChange.current) {\n prevWindowWidth.current = window.innerWidth\n const cb = adjustCarouselWrapperPosition()\n window.clearTimeout(timer)\n\n timer = setTimeout(() => {\n prevTotalScrollValue.current = getTotalScrollValue()\n if (typeof cb === 'function') {\n cb()\n }\n }, 100)\n }\n })\n observer.observe(mainCarouselWrapperRef.current)\n return () => {\n observer.disconnect()\n }\n }\n }, [adjustCarouselWrapperPosition, getTotalScrollValue])\n\n const _thumbsFragment = <Context.Provider value={res}>{thumbsFragment}</Context.Provider>\n\n const carouselFragment = (\n <Context.Provider value={res}>\n <div\n className=\"use-spring-carousel-main-wrapper\"\n ref={mainCarouselWrapperRef}\n {...getScrollHandlers()}\n style={{\n display: 'flex',\n position: 'relative',\n width: '100%',\n height: '100%',\n ...(getWrapperOverflowStyles() as React.CSSProperties),\n }}\n >\n <div\n className=\"use-spring-carousel-track-wrapper\"\n ref={carouselTrackWrapperRef}\n {...bindDrag()}\n style={{\n position: 'relative',\n display: 'flex',\n flexDirection: carouselSlideAxis === 'x' ? 'row' : 'column',\n touchAction: getTouchAction(),\n ...getAnimatedWrapperStyles(),\n }}\n >\n {(freeScroll || !withLoop) && startEndGutter ? (\n <div\n style={{\n flexShrink: 0,\n width: startEndGutter,\n }}\n />\n ) : null}\n {internalItems.map((item, index) => {\n return (\n <Fragment key={`${item.id}-${index}`}>\n <div\n className=\"use-spring-carousel-item\"\n data-testid=\"use-spring-carousel-item-wrapper\"\n style={{\n display: 'flex',\n position: 'relative',\n ...(slideType === 'fixed' ? { flex: '1' } : {}),\n ...getItemStyles(\n index ===\n internalItems.findIndex(\n (i) => i.id === internalItems[internalItems.length - 1].id,\n ),\n ),\n }}\n >\n {typeof item.renderItem === 'function'\n ? item.renderItem({\n getIsActiveItem,\n getIsNextItem,\n getIsPrevItem,\n useListenToCustomEvent,\n })\n : item.renderItem}\n </div>\n </Fragment>\n )\n })}\n {(freeScroll || !withLoop) && startEndGutter ? (\n <div\n style={{\n flexShrink: 0,\n width: startEndGutter,\n }}\n />\n ) : null}\n </div>\n </div>\n </Context.Provider>\n )\n\n return { ...res, carouselFragment, thumbsFragment: _thumbsFragment }\n}\n\ntype ContextProps<T = undefined> = Omit<\n ReturnType<T extends 'free-scroll' ? true : false>,\n 'carouselFragment' | 'thumbsFragment'\n>\n\nconst Context = createContext<ContextProps | ContextProps<'free-scroll'> | undefined>(undefined)\n\nfunction useSpringCarouselContext<T>() {\n const context = useContext(Context)\n if (!context) {\n throw new Error('useSpringCarouselContext must be used within the carousel.')\n }\n return context as ContextProps<T>\n}\n\nexport { useSpringCarousel, useSpringCarouselContext }\n","import { a, config, useTransition } from '@react-spring/web'\nimport { useDrag } from '@use-gesture/react'\nimport { createContext, useContext, useEffect, useRef, useState } from 'react'\n\nimport { useThumbsModule } from './modules'\nimport { useEventsModule } from './modules/useEventsModule'\nimport {\n ItemWithThumb,\n SlideActionType,\n TransitionSlideMode,\n UseTransitionCarouselProps,\n UseTransitionCarouselReturnProps,\n} from './types'\n\nconst defaultAnimationProps = {\n initial: {\n opacity: 1,\n position: 'relative',\n },\n from: {\n opacity: 0,\n position: 'relative',\n },\n enter: {\n position: 'relative',\n opacity: 1,\n },\n leave: {\n opacity: 1,\n position: 'absolute',\n },\n}\n\nfunction useTransitionCarousel({\n init = true,\n disableGestures = false,\n items,\n springConfig = config.default,\n exitBeforeEnter = false,\n trail,\n withLoop = false,\n activeItem: externalActiveItem,\n toPrevItemSpringProps = defaultAnimationProps,\n toNextItemSpringProps = defaultAnimationProps,\n draggingSlideTreshold = 50,\n thumbsSlideAxis = 'x',\n}: UseTransitionCarouselProps): UseTransitionCarouselReturnProps {\n const slideActionType = useRef<SlideActionType>('next')\n const slideModeType = useRef<TransitionSlideMode>('initial')\n const mainCarouselWrapperRef = useRef<HTMLDivElement | null>(null)\n const [activeItem, setActiveItem] = useState(externalActiveItem ?? 0)\n const { emitEvent, useListenToCustomEvent } = useEventsModule<'use-transition'>()\n const { handleScroll, thumbsFragment } = useThumbsModule<'use-transition'>({\n thumbsSlideAxis,\n items: items as ItemWithThumb<'use-transition'>[],\n renderThumbFnProps: {\n getIsNextItem,\n getIsPrevItem,\n useListenToCustomEvent,\n activeItem: {\n index: activeItem,\n id: items[activeItem].id,\n },\n },\n })\n\n function getConfig() {\n if (slideActionType.current === 'prev') {\n return {\n initial: {\n ...toPrevItemSpringProps.initial,\n },\n from: {\n ...toPrevItemSpringProps.from,\n },\n enter: {\n ...toPrevItemSpringProps.enter,\n },\n leave: {\n ...toPrevItemSpringProps.leave,\n },\n }\n }\n if (slideActionType.current === 'next') {\n return {\n initial: {\n ...toNextItemSpringProps.initial,\n },\n from: {\n ...toNextItemSpringProps.from,\n },\n enter: {\n ...toNextItemSpringProps.enter,\n },\n leave: {\n ...toNextItemSpringProps.leave,\n },\n }\n }\n return {\n initial: {\n ...defaultAnimationProps.initial,\n },\n from: {\n ...defaultAnimationProps.from,\n },\n enter: {\n ...defaultAnimationProps.enter,\n },\n leave: {\n ...defaultAnimationProps.leave,\n },\n }\n }\n\n useEffect(() => {\n if (typeof externalActiveItem === 'number' && externalActiveItem !== activeItem) {\n setActiveItem(externalActiveItem)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [externalActiveItem])\n\n type SlideToItem = {\n to: number\n slideType: SlideActionType\n slideMode: TransitionSlideMode\n }\n\n function slideToItem({ to, slideType, slideMode }: SlideToItem) {\n slideActionType.current = slideType\n slideModeType.current = slideMode\n emitEvent({\n eventName: 'onSlideStartChange',\n slideActionType: slideActionType.current,\n slideMode: slideModeType.current,\n nextItem: {\n index: to,\n id: items[to].id,\n startReached: to === 0,\n endReached: to === items.length - 1,\n },\n })\n setActiveItem(to)\n handleScroll(activeItem)\n }\n\n function slideToPrevItem(slideMode: TransitionSlideMode) {\n if (!init) return\n const isFirstItem = activeItem === 0\n\n if (!withLoop && isFirstItem) return\n\n if (withLoop && isFirstItem) {\n slideToItem({\n to: items.length - 1,\n slideType: 'prev',\n slideMode,\n })\n } else {\n slideToItem({\n to: activeItem - 1,\n slideType: 'prev',\n slideMode,\n })\n }\n }\n function slideToNextItem(slideMode: TransitionSlideMode) {\n if (!init) return\n const isLastItem = activeItem === items.length - 1\n\n if (!withLoop && isLastItem) return\n\n if (withLoop && isLastItem) {\n slideToItem({\n to: 0,\n slideType: 'next',\n slideMode,\n })\n } else {\n slideToItem({\n to: activeItem + 1,\n slideType: 'next',\n slideMode,\n })\n }\n }\n\n const transitions = useTransition(activeItem, {\n config: springConfig,\n key: null,\n trail,\n exitBeforeEnter,\n ...getConfig(),\n onRest(value, _, index) {\n if (value.finished && index === activeItem) {\n emitEvent({\n eventName: 'onSlideChange',\n slideActionType: slideActionType.current,\n slideMode: slideModeType.current,\n currentItem: {\n index: activeItem,\n id: items[activeItem].id,\n startReached: activeItem === 0,\n endReached: activeItem === items.length - 1,\n },\n })\n }\n },\n })\n\n const bindSwipe = useDrag(\n ({ last, movement: [mx] }) => {\n if (last) {\n const prevItemTreshold = mx > draggingSlideTreshold\n const nextItemTreshold = mx < -draggingSlideTreshold\n const isFirstItem = activeItem === 0\n const isLastItem = activeItem === items.length - 1\n\n if (nextItemTreshold) {\n if (!withLoop && isLastItem) return\n\n emitEvent({\n eventName: 'onLeftSwipe',\n })\n slideToNextItem('swipe')\n } else if (prevItemTreshold) {\n if (!withLoop && isFirstItem) return\n\n emitEvent({\n eventName: 'onRightSwipe',\n })\n slideToPrevItem('swipe')\n }\n }\n },\n {\n enabled: !disableGestures,\n },\n )\n\n function findItemIndex(id: string | number, error?: string) {\n let itemIndex = 0\n\n if (typeof id === 'string') {\n itemIndex = items.findIndex((item) => item.id === id)\n } else {\n itemIndex = id\n }\n if (itemIndex < 0 || itemIndex >= items.length) {\n if (error) {\n throw new Error(error)\n }\n console.error(`The item doesn't exist; check that the id provided - ${id} - is correct.`)\n itemIndex = -1\n }\n\n return itemIndex\n }\n function getIsNextItem(id: string | number) {\n const itemIndex = findItemIndex(id, \"The item doesn't exist; check the provided id.\")\n const _activeItem = activeItem\n if (withLoop && _activeItem === items.length - 1) {\n return itemIndex === 0\n }\n return itemIndex === _activeItem + 1\n }\n function getIsPrevItem(id: string | number) {\n const itemIndex = findItemIndex(id, \"The item doesn't exist; check the provided id.\")\n const _activeItem = activeItem\n if (withLoop && _activeItem === 0) {\n return itemIndex === items.length - 1\n }\n return itemIndex === _activeItem - 1\n }\n\n const itemsFragment = transitions((styles, item, _, indx) => {\n const renderItem = items[item].renderItem\n return (\n <a.div\n id={`use-transition-carousel-item-${indx}`}\n className=\"use-transition-carousel-item\"\n style={{\n ...styles,\n flex: '1 0 100%',\n width: '100%',\n height: '100%',\n }}\n >\n {typeof renderItem === 'function'\n ? renderItem({\n useListenToCustomEvent,\n getIsNextItem,\n getIsPrevItem,\n activeItem: {\n index: activeItem,\n id: items[activeItem].id,\n },\n })\n : renderItem}\n </a.div>\n )\n })\n\n function getTouchAction() {\n if (disableGestures) {\n return 'unset'\n }\n return 'pan-y'\n }\n\n const result = {\n useListenToCustomEvent,\n slideToPrevItem: () => slideToPrevItem('click'),\n slideToNextItem: () => slideToNextItem('click'),\n activeItem,\n slideToItem: (index: number) => {\n const itemIndex = findItemIndex(\n index,\n \"The item you want to slide to doesn't exist; check the provided id.\",\n )\n\n if (index === activeItem) {\n return\n }\n\n const currentItem = findItemIndex(items[activeItem].id)\n const newActiveItem = findItemIndex(items[itemIndex].id)\n\n slideToItem({\n to: newActiveItem,\n slideType: newActiveItem > currentItem ? 'next' : 'prev',\n slideMode: 'click',\n })\n },\n }\n\n const _thumbsFragment = <Context.Provider value={result}>{thumbsFragment}</Context.Provider>\n const carouselFragment = (\n <Context.Provider value={result}>\n <div\n className=\"use-transition-carousel-wrapper\"\n ref={mainCarouselWrapperRef}\n {...bindSwipe()}\n style={{\n display: 'flex',\n position: 'relative',\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n touchAction: getTouchAction(),\n }}\n >\n {itemsFragment}\n </div>\n </Context.Provider>\n )\n\n return {\n ...result,\n carouselFragment,\n thumbsFragment: _thumbsFragment,\n }\n}\n\ntype ContextProps = Omit<UseTransitionCarouselReturnProps, 'carouselFragment' | 'thumbsFragment'>\n\nconst Context = createContext<ContextProps | undefined>(undefined)\n\nfunction useTransitionCarouselContext() {\n const context = useContext(Context)\n if (!context) {\n throw new Error('useTransitionCarouselContext must be used within the carousel.')\n }\n return context\n}\n\nexport { useTransitionCarousel, useTransitionCarouselContext }\n"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","i","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","module","require$$1","eventLabel","useEventsModule","targetEvent","useRef","useListenToCustomEvent","eventHandler","useEffect","handleEvent","event","_a","emitEvent","newEvent","useFullscreenModule","mainCarouselWrapperRef","onFullScreenChange","handleResize","isFullscreen","handleFullscreenChange","setIsFullscreen","screenfull","_isFullscreen","getIsFullscreen","enterFullscreen","elementRef","exitFullscreen","isInViewport","el","rect","useThumbsModule","thumbsSlideAxis","withThumbs","prepareThumbsData","items","renderThumbFnProps","wrapperRef","spring","setSpring","useSpring","getTotalScrollValue","handleScroll","activeItem","getThumbNode","thumbNode","offset","val","handlePrepareThumbsData","getPreparedItems","_items","id","renderThumb","thumbId","useSpringCarousel","_itemsPerSlide","slideType","gutter","withLoop","startEndGutter","carouselSlideAxis","disableGestures","_draggingSlideTreshold","slideWhenThresholdIsReached","freeScroll","enableFreeScrollDrag","initialStartingPosition","initialActiveItem","animateWhenActiveItemChange","slideGroupOfItems","__unstable_stretch_tems__","slideAmount","itemsPerSlide","resizeByPropChange","draggingSlideTreshold","slideActionType","slideModeType","directionAfterReachingEdges","firstItemReached","lastItemReached","carouselTrackWrapperRef","prevTotalScrollValue","prevWindowWidth","prevSlidedValue","prevWithLoop","prevSlideType","prevFreeScroll","windowIsHidden","internalItems","useCallback","setStartEndItemReachedOnFreeScroll","thumbsFragment","getIsActiveItem","getIsPrevItem","getIsNextItem","adjustCarouselWrapperPosition","getItemStyles","isLastItem","getSlideValue","carouselItem","main","slideToItem","from","to","nextActiveItem","immediate","slideMode","getAnimatedWrapperStyles","percentValue","getCarouselItemWidth","setPosition","v","positionProperty","shouldResetPosition","newVal","diff","next","nextValue","getFromValue","getToValue","index","slideToPrevItem","nextItem","nextItemWillExceed","slideToNextItem","setDraggingSliderTreshold","initializeCarousel","internalSlideToItem","enableDrag","bindDrag","useDrag","state","isDragging","movement","currentMovement","direction","prevItemTreshold","nextItemTreshold","tot","velocity","getWrapperOverflowStyles","getScrollHandlers","findItemIndex","itemIndex","shouldReset","currentItem","newActiveItem","_activeItem","getTouchAction","res","animate","useIsomorphicLayoutEffect","handleVisibilityChange","timer","observer","ResizeObserver","cb","_thumbsFragment","Context","carouselFragment","Fragment","createContext","useSpringCarouselContext","useContext","defaultAnimationProps","useTransitionCarousel","springConfig","exitBeforeEnter","trail","externalActiveItem","toPrevItemSpringProps","toNextItemSpringProps","setActiveItem","useState","getConfig","isFirstItem","transitions","useTransition","_","bindSwipe","last","mx","itemsFragment","styles","indx","renderItem","result","useTransitionCarouselContext"],"mappings":";;;;;;;;6CASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GA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