react-use-gesture
Advanced tools
Comparing version 8.1.0-beta.3 to 8.1.0-beta.4
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;function r(e,t){return e.map((function(e,n){return e+t[n]}))}function o(e,t){return e.map((function(e,n){return e-t[n]}))}function i(e){return Math.hypot.apply(Math,e)}function a(e,t){void 0===t&&(t=e);var n=i(t),r=0===n?0:1/n,o=t.map((function(e){return r*e}));return{distance:i(e),direction:o}}function s(e,t,n){var r=i(t),o=0===r?0:1/r,a=0===n?0:1/n,s=a*r,u=t.map((function(e){return a*e})),c=t.map((function(e){return o*e}));return{velocities:u,velocity:s,distance:i(e),direction:c}}function u(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function c(e,t,n){return 0===t||Infinity===Math.abs(t)?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function l(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-c(t-e,n-t,r)+t:e>n?+c(e-n,n-t,r)+n:e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function v(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function m(){}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?m:1===t.length?t[0]:function(){for(var e,n,r=g(t);!(n=r()).done;){var o=n.value;e=o.apply(this,arguments)||e}return e}}function S(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function w(e,t){return Object.assign({},t,e||{})}function b(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function _(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=_(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}var T={threshold:function(e){return void 0===e&&(e=0),S(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return S(.15);case!1:return S(0);default:return S(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:S(e)},transform:!0},G=d({},T,{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return G.bounds(e(t))};var t=e.left,n=e.right,r=e.top,o=e.bottom;return[[void 0===t?-Infinity:t,void 0===n?Infinity:n],[void 0===r?-Infinity:r,void 0===o?Infinity:o]]}}),M="undefined"!=typeof window&&window.document&&window.document.createElement,O={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=M?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=t.capture;return{passive:void 0===n||n,capture:void 0!==r&&r}},transform:!0},x=d({},T,{bounds:function(e,t,n){var r=n.distanceBounds,o=void 0===r?{}:r,i=n.angleBounds,a=void 0===i?{}:i,s=function(e){var t=w(b(o,e),{min:-Infinity,max:Infinity});return[t.min,t.max]},u=function(e){var t=w(b(a,e),{min:-Infinity,max:Infinity});return[t.min,t.max]};return"function"!=typeof o&&"function"!=typeof a?[s(),u()]:function(e){return[s(e),u(e)]}}}),E=d({},G,{experimental_preventWindowScrollY:function(e){return void 0===e&&(e=!1),e},threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=n.axis,s=S(e,o?3:void 0!==i&&i||(void 0===a?void 0:a)?1:0);return this.filterTaps=o,s},swipeVelocity:function(e){return void 0===e&&(e=.5),S(e)},swipeDistance:function(e){return void 0===e&&(e=60),S(e)},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function P(e){return void 0===e&&(e={}),_(e,O)}function I(e){return void 0===e&&(e={}),_(e,G)}function K(e){return void 0===e&&(e={}),_(e,x)}function D(e){return void 0===e&&(e={}),_(e,E)}function C(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.move=I(i),a}function k(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.hover=d({enabled:!0},i),a}function j(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=D(i),a}function H(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.pinch=K(i),a}function W(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.scroll=I(i),a}function A(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.wheel=I(i),a}function Y(e){return d({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-Infinity,Infinity],[-Infinity,Infinity]],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:m,canceled:!1,memo:void 0,args:void 0},e)}function L(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},drag:Y({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),pinch:Y({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:Y({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:Y({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:Y({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var R=new Map,V=function(e){return e},X=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=d({},n.controller.state.shared,n.state,n.mapStateValues(n.state),{touches:n.controller.pointerIds.size}),i=n.handler(o);return n.state.memo=void 0!==i?i:n.state.memo,o}}var t,n=e.prototype;return n.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},n.updateGestureState=function(e){Object.assign(this.state,e)},n.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},n.getMovement=function(e){var t=this.config,n=t.rubberband,i=t.threshold,a=this.state,s=a._bounds,u=a._initial,c=a._active,l=a._intentional,v=a.lastOffset,f=a.movement,h=this.getInternalMovement(e,this.state),p=this.transform(i).map(Math.abs),g=!1===l[0]?B(h[0],p[0]):l[0],m=!1===l[1]?B(h[1],p[1]):l[1],y=this.checkIntentionality([g,m],h);if(y._blocked)return d({},y,{_movement:h,delta:[0,0]});var S=y._intentional,w=h,b=[!1!==S[0]?h[0]-S[0]:0,!1!==S[1]?h[1]-S[1]:0],_=r(b,v),T=c?n:[0,0];return b=U(s,r(b,u),T),d({},y,{intentional:!1!==S[0]||!1!==S[1],_initial:u,_movement:w,movement:b,values:e,offset:U(s,_,T),delta:o(b,f)})},n.clean=function(){this.clearTimeout()},(t=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}},{key:"transform",get:function(){return this.config.transform||this.controller.config.transform||V}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function B(e,t){return Math.abs(e)>=t&&u(e)*t}function U(e,t,n){var r=t[1],o=n[1],i=e[0],a=e[1],s=a[0],u=a[1];return[l(t[0],i[0],i[1],n[0]),l(r,s,u,o)]}function z(e,t,n){var r=e.state,o=t.timeStamp;return{_lastEventType:t.type,event:t,timeStamp:o,elapsedTime:n?0:o-r.startTime,previous:r.values}}function F(e,t,n){var r=e.config,o=e.stateKey,i=e.args,a=e.state.offset,s=n.timeStamp,u=r.initial,c=r.bounds,l=d({},L()[o],{_active:!0,args:i,values:t,initial:t,offset:a,lastOffset:a,startTime:s});return d({},l,{_initial:b(u,l),_bounds:b(c,l)})}function q(e){if("touches"in e){var t=e.targetTouches;return t.length>0?t:e.changedTouches}return null}function $(e){var t="buttons"in e?e.buttons:0,n=q(e),r=n&&n.length||0;return{touches:r,down:r>0||t>0,buttons:t,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}var N=function(e){return e};function J(e,t){void 0===t&&(t=N);var n=q(e),r=n?n[0]:e;return t([r.clientX,r.clientY])}function Q(e,t){void 0===t&&(t=N);var n=e.currentTarget;return t([n.scrollX||n.scrollLeft||0,n.scrollY||n.scrollTop||0])}function Z(e,t){return void 0===t&&(t=N),t([e.deltaX,e.deltaY])}function ee(e,t){return void 0===t&&(t=N),t([260*e.scale,e.rotation])}function te(e,t){var n;void 0===t&&(t=N);var r=e.targetTouches,o=r[0],i=r[1],a=i.clientX-o.clientX,s=i.clientY-o.clientY,u=(i.clientX+o.clientX)/2,c=(i.clientY+o.clientY)/2,l="nativeEvent"in e?e.nativeEvent:e;return{values:t([Math.hypot(a,s),null!=(n=l.rotation)?n:-180*Math.atan2(a,s)/Math.PI]),origin:t([u,c])}}function ne(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.call.apply(e,[this,d({},t,{event:n})].concat(o))}}var re=function(e){var t=this;this.classes=e,this.pointerIds=new Set,this.supportsTouchEvents="undefined"!=typeof window&&"ontouchstart"in window,this.supportsGestureEvents=function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),this.bind=function(){for(var e={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];for(var i,a=g(t.classes);!(i=a()).done;){var s=i.value;new s(t,r).addBindings(e)}for(var u=0,c=Object.entries(t.nativeRefs);u<c.length;u++){var l=c[u],v=l[0],f=l[1];ve(e,v,ne(f,d({},t.state.shared,{args:r})))}return t.config.domTarget?ue(t,e):ce(t,e)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=de(t.config),n=t.config.eventOptions;e&&he(e,le(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(n){for(var i in o)he(n,o[i],r);e.windowListeners={}}}(t)},this.state=L(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function oe(e,t){e.pointerIds.add(t)}function ie(e,t){e.pointerIds.delete(t)}function ae(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=r.eventOptions),r.window&&(he(r.window,o[t],n),delete o[t])}function se(e,t,n,r){var o=e.config,i=e.windowListeners;void 0===n&&(n=[]),void 0===r&&(r=o.eventOptions),o.window&&(he(o.window,i[t],r),fe(o.window,i[t]=n,r))}function ue(e,t){var n=e.config,r=e.domListeners,o=de(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;he(o,le(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var u=s[a],c=u[1],l=u[0].slice(2).toLowerCase();r.push([l,y.apply(void 0,c)])}fe(o,r,i)}function ce(e,t){for(var n={},r=e.config.eventOptions.capture?"Capture":"",o=0,i=Object.entries(t);o<i.length;o++){var a=i[o],s=a[0],u=a[1],c=Array.isArray(u)?u:[u];n[s+r]=y.apply(void 0,c)}return n}function le(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function de(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function ve(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function fe(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.addEventListener(i[0],i[1],n)}}function he(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.removeEventListener(i[0],i[1],n)}}function pe(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;return e.drag&&t.add(R.get("drag")),e.wheel&&t.add(R.get("wheel")),e.scroll&&t.add(R.get("scroll")),e.move&&t.add(R.get("move")),e.pinch&&t.add(R.get("pinch")),e.hover&&t.add(R.get("hover")),t}(e),i=n.useMemo((function(){return new re(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?ge:i.bind}function ge(){}var me=function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return o(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);return n._blocked||Object.assign(n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp)),n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(X);function ye(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}var Se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.setPointerCapture=function(e){var n=e.target,r=e.pointerId;n&&"setPointerCapture"in n&&(n.setPointerCapture(r),t.updateGestureState({_dragTarget:n,_dragPointerId:r}))},t.releasePointerCapture=function(){var e=t.state,n=e._dragTarget,r=e._dragPointerId;if(r&&n&&"releasePointerCapture"in n&&(!("hasPointerCapture"in n)||n.hasPointerCapture(r)))try{n.releasePointerCapture(r)}catch(e){}},t.preventScroll=function(e){t.state._dragPreventScroll&&e.cancelable&&e.preventDefault()},t.shouldPreventWindowScrollY=t.config.experimental_preventWindowScrollY&&t.controller.supportsTouchEvents,t.setUpWindowScrollDetection=function(e){ye(e),se(t.controller,t.stateKey,[["touchmove",t.preventScroll],["touchend",t.clean.bind(h(t))],["touchcancel",t.clean.bind(h(t))]],{passive:!1}),t.setTimeout(t.startDrag.bind(h(t)),250,e)},t.setUpDelayedDragTrigger=function(e){t.state._dragDelayed=!0,ye(e),t.setTimeout(t.startDrag.bind(h(t)),t.config.delay,e)},t.setStartState=function(e){var n=J(e,t.transform);t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{_pointerId:e.pointerId})),t.updateGestureState(t.getMovement(n))},t.onDragStart=function(e){oe(t.controller,e.pointerId),t.enabled&&!t.state._active&&(t.setStartState(e),t.setPointerCapture(e),t.shouldPreventWindowScrollY?t.setUpWindowScrollDetection(e):t.config.delay>0?t.setUpDelayedDragTrigger(e):t.startDrag(e,!0))},t.onDragChange=function(e){if(!t.state.canceled&&t.state._active&&t.state._pointerId===e.pointerId){var n=J(e,t.transform),r=t.getKinematics(n,e);if(!t.state._dragStarted){if(t.state._dragDelayed)return void t.startDrag(e);if(!t.shouldPreventWindowScrollY)return;if(t.state._dragPreventScroll||!r.axis)return;if("x"!==r.axis)return void(t.state._active=!1);t.startDrag(e)}var o=$(e);if(o.down){t.updateSharedState(o);var a=z(h(t),e),s=i(r._movement),u=t.state._dragIsTap;u&&s>=3&&(u=!1),t.updateGestureState(d({},a,r,{_dragIsTap:u})),t.fireGestureHandler()}else t.onDragEnd(e)}},t.onDragEnd=function(e){if(ie(t.controller,e.pointerId),t.state._pointerId===e.pointerId&&(t.clean(),t.state._pointerId===e.pointerId)){t.state._active=!1;var n=t.state._dragIsTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],c=a[1],l=t.state._intentional,v=l[0],f=l[1],p=t.config.swipeVelocity,g=p[0],m=p[1],y=t.config.swipeDistance,S=y[0],w=y[1],b=d({},z(h(t),e),t.getMovement(t.state.values)),_=[0,0];b.elapsedTime<220&&(!1!==v&&Math.abs(o)>g&&Math.abs(s)>S&&(_[0]=u(o)),!1!==f&&Math.abs(i)>m&&Math.abs(c)>w&&(_[1]=u(i))),t.updateSharedState({down:!1,buttons:0,touches:0}),t.updateGestureState(d({},b,{tap:n,swipe:_})),t.fireGestureHandler(t.config.filterTaps&&!0===n)}},t.clean=function(){e.prototype.clean.call(h(t)),t.state._dragStarted=!1,t.releasePointerCapture(),ae(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0,_active:!1}),t.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onClick=function(e){t.state._dragIsTap||e.stopPropagation()},t}v(t,e);var n=t.prototype;return n.startDrag=function(e,t){void 0===t&&(t=!1),this.state._active&&!this.state._dragStarted&&(t||this.setStartState(e),this.updateGestureState({_dragStarted:!0,_dragPreventScroll:!0,cancel:this.onCancel}),this.clearTimeout(),this.fireGestureHandler())},n.addBindings=function(e){ve(e,"onPointerDown",this.onDragStart),ve(e,"onPointerMove",this.onDragChange),ve(e,"onPointerUp",this.onDragEnd),ve(e,"onPointerCancel",this.onDragEnd),this.config.filterTaps&&ve(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(me);function we(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}function be(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i,a;if(Array.isArray(t)){if((r=t.length)!==n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if("function"==typeof Map&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;for(a=t.entries();!(o=a.next()).done;)if(!e(o.value[1],n.get(o.value[0])))return!1;return!0}if("function"==typeof Set&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;if("undefined"!=typeof Element&&t instanceof Element)return!1;for(o=r;0!=o--;)if(!("_owner"===i[o]&&t.$$typeof||e(t[i[o]],n[i[o]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}var _e=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="pinching",t.stateKey="pinch",t.pinchShouldStart=function(e){var n=$(e);return t.enabled&&2===n.touches},t.onPinchStart=function(e){if(t.pinchShouldStart(e)){var n=te(e,t.transform),r=n.values,o=n.origin;t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),r,e),z(h(t),e,!0),{cancel:t.onCancel,origin:o})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()}},t.onPinchChange=function(e){var n=t.state;if(!n.canceled&&n._active){var r=$(e);t.updateSharedState(r);var o=te(e,t.transform),i=o.origin,a=t.getKinematics(o.values,e);t.updateGestureState(d({},z(h(t),e),a,{origin:i})),t.fireGestureHandler()}},t.onPinchEnd=function(e){t.clean(),t.state._active&&(t.updateSharedState({down:!1,touches:0}),t.updateGestureState(d({},z(h(t),e),t.getMovement(t.state.values),{_active:!1})),t.fireGestureHandler())},t.onCancel=function(){t.state.canceled||(t.updateGestureState({_active:!1,canceled:!0}),t.updateSharedState({down:!1,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onGestureStart=function(e){if(t.enabled){e.preventDefault();var n=ee(e,t.transform);t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{origin:[e.clientX,e.clientY],cancel:t.onCancel})),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()}},t.onGestureChange=function(e){var n=t.state;if(!n.canceled&&n._active){e.preventDefault();var r=$(e);t.updateSharedState(r);var o=ee(e,t.transform),i=t.getKinematics(o,e);t.updateGestureState(d({},z(h(t),e),i,{origin:[e.clientX,e.clientY]})),t.fireGestureHandler()}},t.onGestureEnd=function(e){t.clean(),t.state._active&&(t.updateSharedState({down:!1,touches:0}),t.updateGestureState(d({},z(h(t),e),t.getMovement(t.state.values),{_active:!1,origin:[e.clientX,e.clientY]})),t.fireGestureHandler())},t.wheelShouldRun=function(e){return t.enabled&&e.ctrlKey},t.getWheelValuesFromEvent=function(e){var n=Z(e,t.transform)[1],r=t.state.values,o=r[1];return{values:[r[0]-n,void 0!==o?o:0],origin:[e.clientX,e.clientY],delta:[0,n]}},t.onWheel=function(e){t.wheelShouldRun(e)&&(t.setTimeout(t.onWheelEnd),t.state._active?t.onWheelChange(e):t.onWheelStart(e))},t.onWheelStart=function(e){var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.delta,i=n.origin;e.cancelable&&e.preventDefault(),t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),r,e),z(h(t),e,!0),{initial:t.state.values,offset:r,delta:o,origin:i})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()},t.onWheelChange=function(e){t.updateSharedState($(e));var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.origin,i=n.delta;t.updateGestureState(d({},z(h(t),e),t.getKinematics(r,e),{origin:o,delta:i})),t.fireGestureHandler()},t.onWheelEnd=function(){t.clean(),t.state._active&&(t.state._active=!1,t.updateGestureState(t.getMovement(t.state.values)),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){this.controller.config.domTarget&&!this.controller.supportsTouchEvents&&this.controller.supportsGestureEvents?(ve(e,"onGestureStart",this.onGestureStart),ve(e,"onGestureChange",this.onGestureChange),ve(e,"onGestureEnd",this.onGestureEnd)):(ve(e,"onTouchStart",this.onPinchStart),ve(e,"onTouchMove",this.onPinchChange),ve(e,"onTouchEnd",this.onPinchEnd),ve(e,"onTouchCancel",this.onPinchEnd),ve(e,"onWheel",this.onWheel))},t}(function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){var n=t.values[1],r=e[0],i=e[1],a=void 0===i?n:i,s=a-n,c=t.turns;return Math.abs(s)>270&&(c+=u(s)),o([r,a-360*c],t.initial)},n.getKinematics=function(e,t){var n=this.getMovement(e);return d({turns:(e[1]-n.movement[1]-this.state.initial[1])/360},n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp))},n.mapStateValues=function(e){return{da:e.values,vdva:e.velocities}},t}(X)),Te=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="wheeling",t.stateKey="wheel",t.debounced=!0,t.handleEvent=function(e){if((!e.ctrlKey||!("pinch"in t.controller.handlers))&&t.enabled){t.setTimeout(t.onEnd),t.updateSharedState($(e));var n=r(Z(e,t.transform),t.state.values);if(t.state._active)t.updateGestureState(d({},z(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{initial:t.state.values}));var o=t.getMovement(n),i=a(o.delta);t.updateGestureState(o),t.updateGestureState(i)}t.fireGestureHandler()}},t.onEnd=function(){if(t.clean(),t.state._active){var e=t.getMovement(t.state.values);t.updateGestureState(e),t.updateGestureState({_active:!1,velocities:[0,0],velocity:0}),t.fireGestureHandler()}},t}return v(t,e),t.prototype.addBindings=function(e){ve(e,"onWheel",this.handleEvent)},t}(me),Ge=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="moving",t.stateKey="move",t.debounced=!0,t.onMove=function(e){t.enabled&&(t.setTimeout(t.onMoveEnd),t.state._active?t.onMoveChange(e):t.onMoveStart(e))},t.onMoveStart=function(e){t.updateSharedState($(e));var n=J(e,t.transform);t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0))),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()},t.onMoveChange=function(e){t.updateSharedState($(e));var n=J(e,t.transform);t.updateGestureState(d({},z(h(t),e),t.getKinematics(n,e))),t.fireGestureHandler()},t.onMoveEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(t.getMovement(t.state.values)),t.updateGestureState({velocities:[0,0],velocity:0,_active:!1}),t.fireGestureHandler())},t.hoverTransform=function(){return t.controller.config.hover.transform||t.controller.config.transform},t.onPointerEnter=function(e){if(t.controller.state.shared.hovering=!0,t.controller.config.enabled){if(t.controller.config.hover.enabled){var n=J(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,z(h(t),e,!0),{args:t.args,values:n,active:!0,hovering:!0});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}"move"in t.controller.handlers&&t.onMoveStart(e)}},t.onPointerLeave=function(e){if(t.controller.state.shared.hovering=!1,"move"in t.controller.handlers&&t.onMoveEnd(),t.controller.config.hover.enabled){var n=J(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,z(h(t),e),{args:t.args,values:n,active:!1});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}},t}return v(t,e),t.prototype.addBindings=function(e){"move"in this.controller.handlers&&ve(e,"onPointerMove",this.onMove),"hover"in this.controller.handlers&&(ve(e,"onPointerEnter",this.onPointerEnter),ve(e,"onPointerLeave",this.onPointerLeave))},t}(me),Me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="scrolling",t.stateKey="scroll",t.debounced=!0,t.handleEvent=function(e){if(t.enabled){t.clearTimeout(),t.setTimeout(t.onEnd);var n=Q(e,t.transform);if(t.updateSharedState($(e)),t.state._active)t.updateGestureState(d({},z(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{initial:t.state.values}));var r=t.getMovement(n),o=a(r.delta);t.updateGestureState(r),t.updateGestureState(o)}t.fireGestureHandler()}},t.onEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(d({},t.getMovement(t.state.values),{_active:!1,velocities:[0,0],velocity:0})),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){ve(e,"onScroll",this.handleEvent)},t}(me),Oe=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function xe(e,t){var n=t+"Start",r=t+"End";return function(o){var i=void 0;return o.first&&n in e&&e[n](o),t in e&&(i=e[t](o)),o.last&&r in e&&e[r](o),i}}exports.addV=r,exports.rubberbandIfOutOfBounds=l,exports.subV=o,exports.useDrag=function(e,n){void 0===n&&(n={}),R.set("drag",Se);var r=t.useRef();return r.current||(r.current=we(j,be)),pe({drag:e},r.current(n))},exports.useGesture=function(e,t){void 0===t&&(t={});var n=function(e){var t={},n={},r=new Set;for(var o in e)Oe.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}(e),r=n[0],o=n[1],i=n[2];R.set("drag",Se),R.set("hover",Ge),R.set("move",Ge),R.set("pinch",_e),R.set("scroll",Me),R.set("wheel",Te);var a=function(e,t){void 0===e&&(e={}),void 0===t&&(t=new Set);var n=e.drag,r=e.wheel,o=e.move,i=e.scroll,a=e.pinch,s=e.hover,u=P({domTarget:e.domTarget,eventOptions:e.eventOptions,transform:e.transform,window:e.window,enabled:e.enabled});return t.has("onDrag")&&(u.drag=D(n)),t.has("onWheel")&&(u.wheel=I(r)),t.has("onScroll")&&(u.scroll=I(i)),t.has("onMove")&&(u.move=I(o)),t.has("onPinch")&&(u.pinch=K(a)),t.has("onHover")&&(u.hover=d({enabled:!0},s)),u}(t,i),s={};return i.has("onDrag")&&(s.drag=xe(r,"onDrag")),i.has("onWheel")&&(s.wheel=xe(r,"onWheel")),i.has("onScroll")&&(s.scroll=xe(r,"onScroll")),i.has("onMove")&&(s.move=xe(r,"onMove")),i.has("onPinch")&&(s.pinch=xe(r,"onPinch")),i.has("onHover")&&(s.hover=r.onHover),pe(s,a,o)},exports.useHover=function(e,n){void 0===n&&(n={}),R.set("hover",Ge);var r=t.useRef();return r.current||(r.current=we(k,be)),pe({hover:e},r.current(n))},exports.useMove=function(e,n){void 0===n&&(n={}),R.set("move",Ge);var r=t.useRef();return r.current||(r.current=we(C,be)),pe({move:e},r.current(n))},exports.usePinch=function(e,n){void 0===n&&(n={}),R.set("pinch",_e);var r=t.useRef();return r.current||(r.current=we(H,be)),pe({pinch:e},r.current(n))},exports.useScroll=function(e,n){void 0===n&&(n={}),R.set("scroll",Me);var r=t.useRef();return r.current||(r.current=we(W,be)),pe({scroll:e},r.current(n))},exports.useWheel=function(e,n){void 0===n&&(n={}),R.set("wheel",Te);var r=t.useRef();return r.current||(r.current=we(A,be)),pe({wheel:e},r.current(n))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;function r(e,t){return e.map((function(e,n){return e+t[n]}))}function o(e,t){return e.map((function(e,n){return e-t[n]}))}function i(e){return Math.hypot.apply(Math,e)}function a(e,t){void 0===t&&(t=e);var n=i(t),r=0===n?0:1/n,o=t.map((function(e){return r*e}));return{distance:i(e),direction:o}}function s(e,t,n){var r=i(t),o=0===r?0:1/r,a=0===n?0:1/n,s=a*r,u=t.map((function(e){return a*e})),c=t.map((function(e){return o*e}));return{velocities:u,velocity:s,distance:i(e),direction:c}}function u(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function c(e,t,n){return 0===t||Infinity===Math.abs(t)?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function l(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-c(t-e,n-t,r)+t:e>n?+c(e-n,n-t,r)+n:e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function v(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function m(){}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?m:1===t.length?t[0]:function(){for(var e,n,r=g(t);!(n=r()).done;){var o=n.value;e=o.apply(this,arguments)||e}return e}}function S(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function w(e,t){return Object.assign({},t,e||{})}function b(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function _(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=_(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}var T={threshold:function(e){return void 0===e&&(e=0),S(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return S(.15);case!1:return S(0);default:return S(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:S(e)},transform:!0},G=d({},T,{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return G.bounds(e(t))};var t=e.left,n=e.right,r=e.top,o=e.bottom;return[[void 0===t?-Infinity:t,void 0===n?Infinity:n],[void 0===r?-Infinity:r,void 0===o?Infinity:o]]}}),M="undefined"!=typeof window&&window.document&&window.document.createElement,O={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=M?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=t.capture;return{passive:void 0===n||n,capture:void 0!==r&&r}},transform:!0},x=d({},T,{bounds:function(e,t,n){var r=n.distanceBounds,o=void 0===r?{}:r,i=n.angleBounds,a=void 0===i?{}:i,s=function(e){var t=w(b(o,e),{min:-Infinity,max:Infinity});return[t.min,t.max]},u=function(e){var t=w(b(a,e),{min:-Infinity,max:Infinity});return[t.min,t.max]};return"function"!=typeof o&&"function"!=typeof a?[s(),u()]:function(e){return[s(e),u(e)]}}}),E=d({},G,{experimental_preventWindowScrollY:function(e){return void 0===e&&(e=!1),e},threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=n.axis,s=S(e,o?3:void 0!==i&&i||(void 0===a?void 0:a)?1:0);return this.filterTaps=o,s},swipeVelocity:function(e){return void 0===e&&(e=.5),S(e)},swipeDistance:function(e){return void 0===e&&(e=60),S(e)},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function P(e){return void 0===e&&(e={}),_(e,O)}function I(e){return void 0===e&&(e={}),_(e,G)}function K(e){return void 0===e&&(e={}),_(e,x)}function D(e){return void 0===e&&(e={}),_(e,E)}function C(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.move=I(i),a}function k(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.hover=d({enabled:!0},i),a}function j(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=D(i),a}function H(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.pinch=K(i),a}function W(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.scroll=I(i),a}function A(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=f(e,["domTarget","eventOptions","window","enabled"]),a=P({domTarget:t,eventOptions:n,window:r,enabled:o});return a.wheel=I(i),a}function Y(e){return d({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-Infinity,Infinity],[-Infinity,Infinity]],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:m,canceled:!1,memo:void 0,args:void 0},e)}function L(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},drag:Y({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),pinch:Y({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:Y({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:Y({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:Y({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var R=new Map,V=function(e){return e},X=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=d({},n.controller.state.shared,n.state,n.mapStateValues(n.state),{touches:n.controller.state.shared.touches||n.controller.pointerIds.size}),i=n.handler(o);return n.state.memo=void 0!==i?i:n.state.memo,o}}var t,n=e.prototype;return n.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},n.updateGestureState=function(e){Object.assign(this.state,e)},n.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},n.getMovement=function(e){var t=this.config,n=t.rubberband,i=t.threshold,a=this.state,s=a._bounds,u=a._initial,c=a._active,l=a._intentional,v=a.lastOffset,f=a.movement,h=this.getInternalMovement(e,this.state),p=this.transform(i).map(Math.abs),g=!1===l[0]?B(h[0],p[0]):l[0],m=!1===l[1]?B(h[1],p[1]):l[1],y=this.checkIntentionality([g,m],h);if(y._blocked)return d({},y,{_movement:h,delta:[0,0]});var S=y._intentional,w=h,b=[!1!==S[0]?h[0]-S[0]:0,!1!==S[1]?h[1]-S[1]:0],_=r(b,v),T=c?n:[0,0];return b=U(s,r(b,u),T),d({},y,{intentional:!1!==S[0]||!1!==S[1],_initial:u,_movement:w,movement:b,values:e,offset:U(s,_,T),delta:o(b,f)})},n.clean=function(){this.clearTimeout()},(t=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}},{key:"transform",get:function(){return this.config.transform||this.controller.config.transform||V}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function B(e,t){return Math.abs(e)>=t&&u(e)*t}function U(e,t,n){var r=t[1],o=n[1],i=e[0],a=e[1],s=a[0],u=a[1];return[l(t[0],i[0],i[1],n[0]),l(r,s,u,o)]}function z(e,t,n){var r=e.state,o=t.timeStamp;return{_lastEventType:t.type,event:t,timeStamp:o,elapsedTime:n?0:o-r.startTime,previous:r.values}}function F(e,t,n){var r=e.config,o=e.stateKey,i=e.args,a=e.state.offset,s=n.timeStamp,u=r.initial,c=r.bounds,l=d({},L()[o],{_active:!0,args:i,values:t,initial:t,offset:a,lastOffset:a,startTime:s});return d({},l,{_initial:b(u,l),_bounds:b(c,l)})}function q(e){if("touches"in e){var t=e.targetTouches;return t.length>0?t:e.changedTouches}return null}function $(e){var t="buttons"in e?e.buttons:0,n=q(e),r=n&&n.length||0;return{touches:r,down:r>0||t>0,buttons:t,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}var N=function(e){return e};function J(e,t){void 0===t&&(t=N);var n=q(e),r=n?n[0]:e;return t([r.clientX,r.clientY])}function Q(e,t){void 0===t&&(t=N);var n=e.currentTarget;return t([n.scrollX||n.scrollLeft||0,n.scrollY||n.scrollTop||0])}function Z(e,t){void 0===t&&(t=N);var n=e.deltaX,r=e.deltaY,o=e.deltaMode;return 1===o?(n*=40,r*=40):2===o&&(n*=800,r*=800),t([n,r])}function ee(e,t){return void 0===t&&(t=N),t([260*e.scale,e.rotation])}function te(e,t){var n;void 0===t&&(t=N);var r=e.targetTouches,o=r[0],i=r[1],a=i.clientX-o.clientX,s=i.clientY-o.clientY,u=(i.clientX+o.clientX)/2,c=(i.clientY+o.clientY)/2,l="nativeEvent"in e?e.nativeEvent:e;return{values:t([Math.hypot(a,s),null!=(n=l.rotation)?n:-180*Math.atan2(a,s)/Math.PI]),origin:t([u,c])}}function ne(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.call.apply(e,[this,d({},t,{event:n})].concat(o))}}var re=function(e){var t=this;this.classes=e,this.pointerIds=new Set,this.supportsTouchEvents="undefined"!=typeof window&&"ontouchstart"in window,this.supportsGestureEvents=function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),this.bind=function(){for(var e={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];for(var i,a=g(t.classes);!(i=a()).done;){var s=i.value;new s(t,r).addBindings(e)}for(var u=0,c=Object.entries(t.nativeRefs);u<c.length;u++){var l=c[u],v=l[0],f=l[1];ve(e,v,ne(f,d({},t.state.shared,{args:r})))}return t.config.domTarget?ue(t,e):ce(t,e)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=de(t.config),n=t.config.eventOptions;e&&he(e,le(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(n){for(var i in o)he(n,o[i],r);e.windowListeners={}}}(t)},this.state=L(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function oe(e,t){e.pointerIds.add(t)}function ie(e,t){e.pointerIds.delete(t)}function ae(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=r.eventOptions),r.window&&(he(r.window,o[t],n),delete o[t])}function se(e,t,n,r){var o=e.config,i=e.windowListeners;void 0===n&&(n=[]),void 0===r&&(r=o.eventOptions),o.window&&(he(o.window,i[t],r),fe(o.window,i[t]=n,r))}function ue(e,t){var n=e.config,r=e.domListeners,o=de(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;he(o,le(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var u=s[a],c=u[1],l=u[0].slice(2).toLowerCase();r.push([l,y.apply(void 0,c)])}fe(o,r,i)}function ce(e,t){for(var n={},r=e.config.eventOptions.capture?"Capture":"",o=0,i=Object.entries(t);o<i.length;o++){var a=i[o],s=a[0],u=a[1],c=Array.isArray(u)?u:[u];n[s+r]=y.apply(void 0,c)}return n}function le(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function de(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function ve(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function fe(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.addEventListener(i[0],i[1],n)}}function he(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=g(t);!(r=o()).done;){var i=r.value;e.removeEventListener(i[0],i[1],n)}}function pe(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;return e.drag&&t.add(R.get("drag")),e.wheel&&t.add(R.get("wheel")),e.scroll&&t.add(R.get("scroll")),e.move&&t.add(R.get("move")),e.pinch&&t.add(R.get("pinch")),e.hover&&t.add(R.get("hover")),t}(e),i=n.useMemo((function(){return new re(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?ge:i.bind}function ge(){}var me=function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return o(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);return n._blocked||Object.assign(n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp)),n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(X);function ye(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}var Se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.setPointerCapture=function(e){var n=e.target,r=e.pointerId;n&&"setPointerCapture"in n&&(n.setPointerCapture(r),t.updateGestureState({_dragTarget:n,_dragPointerId:r}))},t.releasePointerCapture=function(){var e=t.state,n=e._dragTarget,r=e._dragPointerId;if(r&&n&&"releasePointerCapture"in n&&(!("hasPointerCapture"in n)||n.hasPointerCapture(r)))try{n.releasePointerCapture(r)}catch(e){}},t.preventScroll=function(e){t.state._dragPreventScroll&&e.cancelable&&e.preventDefault()},t.shouldPreventWindowScrollY=t.config.experimental_preventWindowScrollY&&t.controller.supportsTouchEvents,t.setUpWindowScrollDetection=function(e){ye(e),se(t.controller,t.stateKey,[["touchmove",t.preventScroll],["touchend",t.clean.bind(h(t))],["touchcancel",t.clean.bind(h(t))]],{passive:!1}),t.setTimeout(t.startDrag.bind(h(t)),250,e)},t.setUpDelayedDragTrigger=function(e){t.state._dragDelayed=!0,ye(e),t.setTimeout(t.startDrag.bind(h(t)),t.config.delay,e)},t.setStartState=function(e){var n=J(e,t.transform);t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{_pointerId:e.pointerId})),t.updateGestureState(t.getMovement(n))},t.onDragStart=function(e){oe(t.controller,e.pointerId),t.enabled&&!t.state._active&&(t.setStartState(e),t.setPointerCapture(e),t.shouldPreventWindowScrollY?t.setUpWindowScrollDetection(e):t.config.delay>0?t.setUpDelayedDragTrigger(e):t.startDrag(e,!0))},t.onDragChange=function(e){if(!t.state.canceled&&t.state._active&&t.state._pointerId===e.pointerId){var n=J(e,t.transform),r=t.getKinematics(n,e);if(!t.state._dragStarted){if(t.state._dragDelayed)return void t.startDrag(e);if(!t.shouldPreventWindowScrollY)return;if(t.state._dragPreventScroll||!r.axis)return;if("x"!==r.axis)return void(t.state._active=!1);t.startDrag(e)}var o=$(e);if(o.down){t.updateSharedState(o);var a=z(h(t),e),s=i(r._movement),u=t.state._dragIsTap;u&&s>=3&&(u=!1),t.updateGestureState(d({},a,r,{_dragIsTap:u})),t.fireGestureHandler()}else t.onDragEnd(e)}},t.onDragEnd=function(e){if(ie(t.controller,e.pointerId),t.state._pointerId===e.pointerId&&(t.clean(),t.state._pointerId===e.pointerId)){t.state._active=!1;var n=t.state._dragIsTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],c=a[1],l=t.state._intentional,v=l[0],f=l[1],p=t.config.swipeVelocity,g=p[0],m=p[1],y=t.config.swipeDistance,S=y[0],w=y[1],b=d({},z(h(t),e),t.getMovement(t.state.values)),_=[0,0];b.elapsedTime<220&&(!1!==v&&Math.abs(o)>g&&Math.abs(s)>S&&(_[0]=u(o)),!1!==f&&Math.abs(i)>m&&Math.abs(c)>w&&(_[1]=u(i))),t.updateSharedState({down:!1,buttons:0,touches:0}),t.updateGestureState(d({},b,{tap:n,swipe:_})),t.fireGestureHandler(t.config.filterTaps&&!0===n)}},t.clean=function(){e.prototype.clean.call(h(t)),t.state._dragStarted=!1,t.releasePointerCapture(),ae(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0,_active:!1}),t.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onClick=function(e){t.state._dragIsTap||e.stopPropagation()},t}v(t,e);var n=t.prototype;return n.startDrag=function(e,t){void 0===t&&(t=!1),this.state._active&&!this.state._dragStarted&&(t||this.setStartState(e),this.updateGestureState({_dragStarted:!0,_dragPreventScroll:!0,cancel:this.onCancel}),this.clearTimeout(),this.fireGestureHandler())},n.addBindings=function(e){ve(e,"onPointerDown",this.onDragStart),ve(e,"onPointerMove",this.onDragChange),ve(e,"onPointerUp",this.onDragEnd),ve(e,"onPointerCancel",this.onDragEnd),this.config.filterTaps&&ve(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(me);function we(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}function be(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i,a;if(Array.isArray(t)){if((r=t.length)!==n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if("function"==typeof Map&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;for(a=t.entries();!(o=a.next()).done;)if(!e(o.value[1],n.get(o.value[0])))return!1;return!0}if("function"==typeof Set&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;if("undefined"!=typeof Element&&t instanceof Element)return!1;for(o=r;0!=o--;)if(!("_owner"===i[o]&&t.$$typeof||e(t[i[o]],n[i[o]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}var _e=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="pinching",t.stateKey="pinch",t.pinchShouldStart=function(e){var n=$(e);return t.enabled&&2===n.touches},t.onPinchStart=function(e){if(t.pinchShouldStart(e)){var n=te(e,t.transform),r=n.values,o=n.origin;t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),r,e),z(h(t),e,!0),{cancel:t.onCancel,origin:o})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()}},t.onPinchChange=function(e){var n=t.state;if(!n.canceled&&n._active){var r=$(e);t.updateSharedState(r);var o=te(e,t.transform),i=o.origin,a=t.getKinematics(o.values,e);t.updateGestureState(d({},z(h(t),e),a,{origin:i})),t.fireGestureHandler()}},t.onPinchEnd=function(e){t.clean(),t.state._active&&(t.updateSharedState({down:!1,touches:0}),t.updateGestureState(d({},z(h(t),e),t.getMovement(t.state.values),{_active:!1})),t.fireGestureHandler())},t.onCancel=function(){t.state.canceled||(t.updateGestureState({_active:!1,canceled:!0}),t.updateSharedState({down:!1,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onGestureStart=function(e){if(t.enabled){e.preventDefault();var n=ee(e,t.transform);t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{origin:[e.clientX,e.clientY],cancel:t.onCancel})),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()}},t.onGestureChange=function(e){var n=t.state;if(!n.canceled&&n._active){e.preventDefault();var r=$(e);t.updateSharedState(r);var o=ee(e,t.transform),i=t.getKinematics(o,e);t.updateGestureState(d({},z(h(t),e),i,{origin:[e.clientX,e.clientY]})),t.fireGestureHandler()}},t.onGestureEnd=function(e){t.clean(),t.state._active&&(t.updateSharedState({down:!1,touches:0}),t.updateGestureState(d({},z(h(t),e),t.getMovement(t.state.values),{_active:!1,origin:[e.clientX,e.clientY]})),t.fireGestureHandler())},t.wheelShouldRun=function(e){return t.enabled&&e.ctrlKey},t.getWheelValuesFromEvent=function(e){var n=Z(e,t.transform)[1],r=t.state.values,o=r[1];return{values:[r[0]-n,void 0!==o?o:0],origin:[e.clientX,e.clientY],delta:[0,n]}},t.onWheel=function(e){t.wheelShouldRun(e)&&(t.setTimeout(t.onWheelEnd),t.state._active?t.onWheelChange(e):t.onWheelStart(e))},t.onWheelStart=function(e){var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.delta,i=n.origin;e.cancelable&&e.preventDefault(),t.updateSharedState($(e)),t.updateGestureState(d({},F(h(t),r,e),z(h(t),e,!0),{initial:t.state.values,offset:r,delta:o,origin:i})),t.updateGestureState(t.getMovement(r)),t.fireGestureHandler()},t.onWheelChange=function(e){t.updateSharedState($(e));var n=t.getWheelValuesFromEvent(e),r=n.values,o=n.origin,i=n.delta;t.updateGestureState(d({},z(h(t),e),t.getKinematics(r,e),{origin:o,delta:i})),t.fireGestureHandler()},t.onWheelEnd=function(){t.clean(),t.state._active&&(t.state._active=!1,t.updateGestureState(t.getMovement(t.state.values)),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){this.controller.config.domTarget&&!this.controller.supportsTouchEvents&&this.controller.supportsGestureEvents?(ve(e,"onGestureStart",this.onGestureStart),ve(e,"onGestureChange",this.onGestureChange),ve(e,"onGestureEnd",this.onGestureEnd)):(ve(e,"onTouchStart",this.onPinchStart),ve(e,"onTouchMove",this.onPinchChange),ve(e,"onTouchEnd",this.onPinchEnd),ve(e,"onTouchCancel",this.onPinchEnd),ve(e,"onWheel",this.onWheel))},t}(function(e){function t(){return e.apply(this,arguments)||this}v(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){var n=t.values[1],r=e[0],i=e[1],a=void 0===i?n:i,s=a-n,c=t.turns;return Math.abs(s)>270&&(c+=u(s)),o([r,a-360*c],t.initial)},n.getKinematics=function(e,t){var n=this.getMovement(e);return d({turns:(e[1]-n.movement[1]-this.state.initial[1])/360},n,s(n.movement,n.delta,t.timeStamp-this.state.timeStamp))},n.mapStateValues=function(e){return{da:e.values,vdva:e.velocities}},t}(X)),Te=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="wheeling",t.stateKey="wheel",t.debounced=!0,t.handleEvent=function(e){if((!e.ctrlKey||!("pinch"in t.controller.handlers))&&t.enabled){t.setTimeout(t.onEnd),t.updateSharedState($(e));var n=r(Z(e,t.transform),t.state.values);if(t.state._active)t.updateGestureState(d({},z(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{initial:t.state.values}));var o=t.getMovement(n),i=a(o.delta);t.updateGestureState(o),t.updateGestureState(i)}t.fireGestureHandler()}},t.onEnd=function(){if(t.clean(),t.state._active){var e=t.getMovement(t.state.values);t.updateGestureState(e),t.updateGestureState({_active:!1,velocities:[0,0],velocity:0}),t.fireGestureHandler()}},t}return v(t,e),t.prototype.addBindings=function(e){ve(e,"onWheel",this.handleEvent)},t}(me),Ge=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="moving",t.stateKey="move",t.debounced=!0,t.onMove=function(e){t.enabled&&(t.setTimeout(t.onMoveEnd),t.state._active?t.onMoveChange(e):t.onMoveStart(e))},t.onMoveStart=function(e){t.updateSharedState($(e));var n=J(e,t.transform);t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0))),t.updateGestureState(t.getMovement(n)),t.fireGestureHandler()},t.onMoveChange=function(e){t.updateSharedState($(e));var n=J(e,t.transform);t.updateGestureState(d({},z(h(t),e),t.getKinematics(n,e))),t.fireGestureHandler()},t.onMoveEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(t.getMovement(t.state.values)),t.updateGestureState({velocities:[0,0],velocity:0,_active:!1}),t.fireGestureHandler())},t.hoverTransform=function(){return t.controller.config.hover.transform||t.controller.config.transform},t.onPointerEnter=function(e){if(t.controller.state.shared.hovering=!0,t.controller.config.enabled){if(t.controller.config.hover.enabled){var n=J(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,z(h(t),e,!0),{args:t.args,values:n,active:!0,hovering:!0});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}"move"in t.controller.handlers&&t.onMoveStart(e)}},t.onPointerLeave=function(e){if(t.controller.state.shared.hovering=!1,"move"in t.controller.handlers&&t.onMoveEnd(),t.controller.config.hover.enabled){var n=J(e,t.hoverTransform()),r=d({},t.controller.state.shared,t.state,z(h(t),e),{args:t.args,values:n,active:!1});t.controller.handlers.hover(d({},r,t.mapStateValues(r)))}},t}return v(t,e),t.prototype.addBindings=function(e){"move"in this.controller.handlers&&ve(e,"onPointerMove",this.onMove),"hover"in this.controller.handlers&&(ve(e,"onPointerEnter",this.onPointerEnter),ve(e,"onPointerLeave",this.onPointerLeave))},t}(me),Me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="scrolling",t.stateKey="scroll",t.debounced=!0,t.handleEvent=function(e){if(t.enabled){t.clearTimeout(),t.setTimeout(t.onEnd);var n=Q(e,t.transform);if(t.updateSharedState($(e)),t.state._active)t.updateGestureState(d({},z(h(t),e),t.getKinematics(n,e)));else{t.updateGestureState(d({},F(h(t),n,e),z(h(t),e,!0),{initial:t.state.values}));var r=t.getMovement(n),o=a(r.delta);t.updateGestureState(r),t.updateGestureState(o)}t.fireGestureHandler()}},t.onEnd=function(){t.clean(),t.state._active&&(t.updateGestureState(d({},t.getMovement(t.state.values),{_active:!1,velocities:[0,0],velocity:0})),t.fireGestureHandler())},t}return v(t,e),t.prototype.addBindings=function(e){ve(e,"onScroll",this.handleEvent)},t}(me),Oe=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function xe(e,t){var n=t+"Start",r=t+"End";return function(o){var i=void 0;return o.first&&n in e&&e[n](o),t in e&&(i=e[t](o)),o.last&&r in e&&e[r](o),i}}exports.addV=r,exports.rubberbandIfOutOfBounds=l,exports.subV=o,exports.useDrag=function(e,n){void 0===n&&(n={}),R.set("drag",Se);var r=t.useRef();return r.current||(r.current=we(j,be)),pe({drag:e},r.current(n))},exports.useGesture=function(e,t){void 0===t&&(t={});var n=function(e){var t={},n={},r=new Set;for(var o in e)Oe.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}(e),r=n[0],o=n[1],i=n[2];R.set("drag",Se),R.set("hover",Ge),R.set("move",Ge),R.set("pinch",_e),R.set("scroll",Me),R.set("wheel",Te);var a=function(e,t){void 0===e&&(e={}),void 0===t&&(t=new Set);var n=e.drag,r=e.wheel,o=e.move,i=e.scroll,a=e.pinch,s=e.hover,u=P({domTarget:e.domTarget,eventOptions:e.eventOptions,transform:e.transform,window:e.window,enabled:e.enabled});return t.has("onDrag")&&(u.drag=D(n)),t.has("onWheel")&&(u.wheel=I(r)),t.has("onScroll")&&(u.scroll=I(i)),t.has("onMove")&&(u.move=I(o)),t.has("onPinch")&&(u.pinch=K(a)),t.has("onHover")&&(u.hover=d({enabled:!0},s)),u}(t,i),s={};return i.has("onDrag")&&(s.drag=xe(r,"onDrag")),i.has("onWheel")&&(s.wheel=xe(r,"onWheel")),i.has("onScroll")&&(s.scroll=xe(r,"onScroll")),i.has("onMove")&&(s.move=xe(r,"onMove")),i.has("onPinch")&&(s.pinch=xe(r,"onPinch")),i.has("onHover")&&(s.hover=r.onHover),pe(s,a,o)},exports.useHover=function(e,n){void 0===n&&(n={}),R.set("hover",Ge);var r=t.useRef();return r.current||(r.current=we(k,be)),pe({hover:e},r.current(n))},exports.useMove=function(e,n){void 0===n&&(n={}),R.set("move",Ge);var r=t.useRef();return r.current||(r.current=we(C,be)),pe({move:e},r.current(n))},exports.usePinch=function(e,n){void 0===n&&(n={}),R.set("pinch",_e);var r=t.useRef();return r.current||(r.current=we(H,be)),pe({pinch:e},r.current(n))},exports.useScroll=function(e,n){void 0===n&&(n={}),R.set("scroll",Me);var r=t.useRef();return r.current||(r.current=we(W,be)),pe({scroll:e},r.current(n))},exports.useWheel=function(e,n){void 0===n&&(n={}),R.set("wheel",Te);var r=t.useRef();return r.current||(r.current=we(A,be)),pe({wheel:e},r.current(n))}; | ||
//# sourceMappingURL=react-use-gesture.cjs.production.min.js.map |
{ | ||
"name": "react-use-gesture", | ||
"version": "8.1.0-beta.3", | ||
"version": "8.1.0-beta.4", | ||
"description": "React hook for receiving gestures https://use-gesture.netlify.app", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
641096
5460