Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-pannable

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pannable - npm Package Compare versions

Comparing version 6.0.6 to 6.0.7

27

cjs/infinite/InfiniteInner.js

@@ -17,4 +17,3 @@ "use strict";

var InfiniteInner = _react.default.memo(function (props) {
var direction = props.direction,
pad = props.pad,
var pad = props.pad,
padMethods = props.padMethods,

@@ -81,26 +80,2 @@ layout = props.layout,

}, [state.scrollTo]);
(0, _hooks.useIsomorphicLayoutEffect)(function () {
if (!state.scroll) {
return;
}
var prevBound;
delegateRef.current.setBound(function (padState) {
prevBound = padState.bound;
return direction === 'x' ? {
x: -1,
y: prevBound.y
} : {
x: prevBound.x,
y: -1
};
});
return function () {
if (prevBound) {
delegateRef.current.setBound(function () {
return prevBound;
});
}
};
}, [state.scroll, direction]);
return _react.default.createElement(_react.default.Fragment, null, render(state, methodsRef.current));

@@ -107,0 +82,0 @@ });

@@ -62,8 +62,2 @@ "use strict";

});
},
setBound: function setBound(fn) {
dispatch({
type: 'setBound',
payload: fn(prevStateRef.current)
});
}

@@ -70,0 +64,0 @@ });

88

cjs/pad/padReducer.js

@@ -78,5 +78,2 @@ "use strict";

case 'setBound':
return validateReducer(setBoundReducer(state, action), action);
default:

@@ -286,9 +283,2 @@ return state;

var setBoundReducer = function setBoundReducer(state, action) {
var bound = action.payload;
return _objectSpread(_objectSpread({}, state), {}, {
bound: bound
});
};
var scrollToReducer = function scrollToReducer(state, action) {

@@ -309,6 +299,14 @@ var drag = state.drag,

_action$payload$anima = _action$payload.animated,
animated = _action$payload$anima === void 0 ? false : _action$payload$anima;
animated = _action$payload$anima === void 0 ? -1 : _action$payload$anima;
var nextRect = rect;
var nextAnimated = drag ? false : animated;
var nextAnimated = animated;
if (typeof nextAnimated === 'boolean') {
nextAnimated = nextAnimated ? 1 : -1;
}
if (drag) {
nextAnimated = -1;
}
if (!nextRect) {

@@ -351,44 +349,52 @@ if (point) {

if (!animated) {
if (drag) {
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset,
drag: _objectSpread(_objectSpread({}, drag), {}, {
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y
}
}),
deceleration: null
});
}
if (animated === 1) {
var decelerationEndOffset = (0, _motion.getDecelerationEndOffset)(offset, {
x: 0,
y: 0
}, size, pagingEnabled, DECELERATION_RATE_STRONG);
return _objectSpread(_objectSpread({}, state), {}, {
drag: null,
deceleration: createDeceleration(decelerationEndOffset, DECELERATION_RATE_STRONG, contentOffset, contentVelocity)
});
}
if (deceleration) {
var _decelerationEndOffset2 = (0, _motion.getDecelerationEndOffset)({
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y
}, {
x: 0,
y: 0
}, size, pagingEnabled, deceleration.rate);
if (drag) {
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset,
drag: _objectSpread(_objectSpread({}, drag), {}, {
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y
}
}),
deceleration: null
});
}
if (deceleration) {
if (animated === 0) {
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset,
drag: null,
deceleration: createDeceleration(_decelerationEndOffset2, deceleration.rate, offset, contentVelocity)
deceleration: null
});
}
var _decelerationEndOffset2 = (0, _motion.getDecelerationEndOffset)({
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y
}, {
x: 0,
y: 0
}, size, pagingEnabled, deceleration.rate);
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset
contentOffset: offset,
drag: null,
deceleration: createDeceleration(_decelerationEndOffset2, deceleration.rate, offset, contentVelocity)
});
}
var decelerationEndOffset = (0, _motion.getDecelerationEndOffset)(offset, {
x: 0,
y: 0
}, size, pagingEnabled, DECELERATION_RATE_STRONG);
return _objectSpread(_objectSpread({}, state), {}, {
drag: null,
deceleration: createDeceleration(decelerationEndOffset, DECELERATION_RATE_STRONG, contentOffset, contentVelocity)
contentOffset: offset
});

@@ -395,0 +401,0 @@ };

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactPannable={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),o={exports:{}};(o.exports={}).forEach=function(e,t){for(var n=0;e.length>n;n++){var r=t(e[n]);if(r)return r}};var i={exports:{}},a=i.exports={};a.isIE=function(e){return(-1!==(t=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/"))&&(!e||e===function(){var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(n[0]);return e>4?e:undefined}());var t},a.isLegacyOpera=function(){return!!window.opera};var c={exports:{}};(c.exports={}).getOption=function(e,t,n){var r=e[t];if(null==r&&void 0!==n)return n;return r};var l=c.exports;function u(){var e={},t=0,n=0,r=0;return{add:function(o,i){i||(i=o,o=0),o>n?n=o:r>o&&(r=o),e[o]||(e[o]=[]),e[o].push(i),t++},process:function(){for(var t=r;n>=t;t++)for(var o=e[t],i=0;o.length>i;i++){(0,o[i])()}},size:function(){return t}}}function s(e){return e._erd}var d=i.exports,f=o.exports.forEach,h=o.exports.forEach,p=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var n=t(e);return n&&!!n.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,n){t(e).busy=!!n}}},v=function(e){var t={};function n(n){var r=e.get(n);return void 0===r?[]:t[r]||[]}return{get:n,add:function(n,r){var o=e.get(n);t[o]||(t[o]=[]),t[o].push(r)},removeListener:function(e,t){for(var r=n(e),o=0,i=r.length;i>o;++o)if(r[o]===t){r.splice(o,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}},y=function(){var e=1;return{generate:function(){return e++}}},g=function(e){var t=e.idGenerator,n=e.stateHandler.getState;return{get:function(e){var t=n(e);return t&&void 0!==t.id?t.id:null},set:function(e){var r=n(e);if(!r)throw Error("setId required the element to have a resize detection state.");var o=t.generate();return r.id=o,o}}},b=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var r=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var n=0;arguments.length>n;n++)e(arguments[n])}};r(n,"log"),r(n,"warn"),r(n,"error")}return n},m=i.exports,O=function(e){var t=(e=e||{}).reporter,n=l.getOption(e,"async",!0),r=l.getOption(e,"auto",!0);r&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,i=u(),a=!1;function c(){for(a=!0;i.size();){var e=i;i=u(),e.process()}a=!1}function s(){o=setTimeout(c,0)}return{add:function(e,t){!a&&r&&n&&0===i.size()&&s(),i.add(e,t)},force:function(e){a||(void 0===e&&(e=n),o&&(clearTimeout(o),o=null),e?s():c())}}},w={initState:function(e){return e._erd={},s(e)},getState:s,cleanState:function(e){delete e._erd}},x=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState;if(!t)throw Error("Missing required dependency: reporter.");function o(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function i(e){return r(e).object}return{makeDetectable:function(e,i,a){a||(a=i,i=e,e=null),e=e||{},d.isIE(8)?a(i):function(i,a){var c=o(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),l=!1,u=window.getComputedStyle(i),s=i.offsetWidth,f=i.offsetHeight;function h(){function n(){if("static"===u.position){i.style.setProperty("position","relative",e.important?"important":"");var n=function(t,n,r,o){var i=r[o];"auto"!==i&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(i)&&(t.warn("An element that is positioned static has style."+o+"="+i+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+o+" will be set to 0. Element: ",n),n.style.setProperty(o,"0",e.important?"important":""))};n(t,i,u,"top"),n(t,i,u,"right"),n(t,i,u,"bottom"),n(t,i,u,"left")}}""!==u.position&&(n(),l=!0);var o=document.createElement("object");o.style.cssText=c,o.tabIndex=-1,o.type="text/html",o.setAttribute("aria-hidden","true"),o.onload=function(){l||n(),function e(t,n){if(!t.contentDocument){var o=r(t);return o.checkForObjectDocumentTimeoutId&&window.clearTimeout(o.checkForObjectDocumentTimeoutId),void(o.checkForObjectDocumentTimeoutId=setTimeout((function(){o.checkForObjectDocumentTimeoutId=0,e(t,n)}),100))}n(t.contentDocument)}(this,(function(e){a(i)}))},d.isIE()||(o.data="about:blank"),r(i)&&(i.appendChild(o),r(i).object=o,d.isIE()&&(o.data="about:blank"))}r(i).startSize={width:s,height:f},n?n.add(h):h()}(i,a)},addListener:function(e,t){function n(){t(e)}if(d.isIE(8))r(e).object={proxy:n},e.attachEvent("onresize",n);else{var o=i(e);if(!o)throw Error("Element is not detectable by this strategy.");o.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(e){if(r(e)){var t=i(e);t&&(d.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),r(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(r(e).checkForObjectDocumentTimeoutId),delete r(e).object)}}}},j=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState,o=e.idHandler;if(!n)throw Error("Missing required dependency: batchProcessor");if(!t)throw Error("Missing required dependency: reporter.");var i=function(){var e=500,t=500,n=document.createElement("div");n.style.cssText=l(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var r=document.createElement("div");r.style.cssText=l(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),r.appendChild(n),document.body.insertBefore(r,document.body.firstChild);var o=e-r.clientWidth,i=t-r.clientHeight;return document.body.removeChild(r),{width:o,height:i}}(),a="erd_scroll_detection_container";function c(e){!function(e,t,n){function r(n,r){r=r||function(t){e.head.appendChild(t)};var o=e.createElement("style");return o.innerHTML=n,o.id=t,r(o),o}if(!e.getElementById(t)){var o=n+"_animation",i=n+"_animation_active",a="/* Created by the element-resize-detector library. */\n";a+="."+n+" > div::-webkit-scrollbar { "+l(["display: none"])+" }\n\n",a+="."+i+" { "+l(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+o,"animation-name: "+o])+" }\n",a+="@-webkit-keyframes "+o+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",r(a+="@keyframes "+o+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",a)}function l(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function u(e,n,r){if(e.addEventListener)e.addEventListener(n,r);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,r)}}function s(e,n,r){if(e.removeEventListener)e.removeEventListener(n,r);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,r)}}function d(e){return r(e).container.childNodes[0].childNodes[0].childNodes[0]}function h(e){return r(e).container.childNodes[0].childNodes[0].childNodes[1]}return c(window.document),{makeDetectable:function(e,c,s){function p(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(o.get(c),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var r=0;n.length>r;r++)t.log(n[r])}}function v(e){var t=r(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function y(){var e=window.getComputedStyle(c),t={};return t.position=e.position,t.width=c.offsetWidth,t.height=c.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function g(){if(p("storeStyle invoked."),r(c)){var e=y();r(c).style=e}else p("Aborting because element has been uninstalled")}function b(e,t,n){r(e).lastWidth=t,r(e).lastHeight=n}function m(){return 2*i.width+1}function O(){return 2*i.height+1}function w(e){return e+10+m()}function x(e){return e+10+O()}function j(e,t,n){var r=d(e),o=h(e),i=w(t),a=x(n),c=function(e){return 2*e+m()}(t),l=function(e){return 2*e+O()}(n);r.scrollLeft=i,r.scrollTop=a,o.scrollLeft=c,o.scrollTop=l}function E(){var e=r(c).container;if(!e){(e=document.createElement("div")).className=a,e.style.cssText=l(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),r(c).container=e,function(e){e.className+=" "+a+"_animation_active"}(e),c.appendChild(e);var t=function(){r(c).onRendered&&r(c).onRendered()};u(e,"animationstart",t),r(c).onAnimationStart=t}return e}function S(){if(p("Injecting elements"),r(c)){!function(){var n=r(c).style;if("static"===n.position){c.style.setProperty("position","relative",e.important?"important":"");var o=function(e,t,n,r){var o=n[r];"auto"!==o&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(o)&&(e.warn("An element that is positioned static has style."+r+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+r+" will be set to 0. Element: ",t),t.style[r]=0)};o(t,c,n,"top"),o(t,c,n,"right"),o(t,c,n,"bottom"),o(t,c,n,"left")}}();var n=r(c).container;n||(n=E());var o,s,d,f,h=i.width,v=i.height,y=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),g=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(o=(o=-(1+h))?o+"px":"0"),"top: "+(s=(s=-(1+v))?s+"px":"0"),"right: "+(f=(f=-h)?f+"px":"0"),"bottom: "+(d=(d=-v)?d+"px":"0")])),b=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),m=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),O=l(["position: absolute","left: 0","top: 0"]),w=l(["position: absolute","width: 200%","height: 200%"]),x=document.createElement("div"),j=document.createElement("div"),S=document.createElement("div"),P=document.createElement("div"),z=document.createElement("div"),D=document.createElement("div");x.dir="ltr",x.style.cssText=y,x.className=a,j.className=a,j.style.cssText=g,S.style.cssText=b,P.style.cssText=O,z.style.cssText=m,D.style.cssText=w,S.appendChild(P),z.appendChild(D),j.appendChild(S),j.appendChild(z),x.appendChild(j),n.appendChild(x),u(S,"scroll",I),u(z,"scroll",R),r(c).onExpandScroll=I,r(c).onShrinkScroll=R}else p("Aborting because element has been uninstalled");function I(){r(c).onExpand&&r(c).onExpand()}function R(){r(c).onShrink&&r(c).onShrink()}}function P(){function i(t,n,r){var o=function(e){return d(e).childNodes[0]}(t),i=w(n),a=x(r);o.style.setProperty("width",i+"px",e.important?"important":""),o.style.setProperty("height",a+"px",e.important?"important":"")}function a(a){var u=c.offsetWidth,s=c.offsetHeight,d=u!==r(c).lastWidth||s!==r(c).lastHeight;p("Storing current size",u,s),b(c,u,s),n.add(0,(function(){if(d)if(r(c))if(l()){if(e.debug)c.offsetWidth===u&&c.offsetHeight===s||t.warn(o.get(c),"Scroll: Size changed before updating detector elements.");i(c,u,s)}else p("Aborting because element container has not been initialized");else p("Aborting because element has been uninstalled")})),n.add(1,(function(){r(c)?l()?j(c,u,s):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")})),d&&a&&n.add(2,(function(){r(c)?l()?a():p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")}))}function l(){return!!r(c).container}function u(){p("notifyListenersIfNeeded invoked");var e=r(c);return void 0===r(c).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?p("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?p("Not notifying: Size already notified"):(p("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void f(r(c).listeners,(function(e){e(c)})))}function s(){p("Scroll detected."),v(c)?p("Scroll event fired while unrendered. Ignoring..."):a(u)}if(p("registerListenersAndPositionElements invoked."),r(c)){r(c).onRendered=function(){if(p("startanimation triggered."),v(c))p("Ignoring since element is still unrendered...");else{p("Element rendered.");var e=d(c),t=h(c);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(p("Scrollbars out of sync. Updating detector elements..."),a(u))}},r(c).onExpand=s,r(c).onShrink=s;var y=r(c).style;i(c,y.width,y.height)}else p("Aborting because element has been uninstalled")}function z(){if(p("finalizeDomMutation invoked."),r(c)){var e=r(c).style;b(c,e.width,e.height),j(c,e.width,e.height)}else p("Aborting because element has been uninstalled")}function D(){s(c)}function I(){var e;p("Installing..."),r(c).listeners=[],e=y(),r(c).startSize={width:e.width,height:e.height},p("Element start size",r(c).startSize),n.add(0,g),n.add(1,S),n.add(2,P),n.add(3,z),n.add(4,D)}s||(s=c,c=e,e=null),e=e||{},p("Making detectable..."),!function(e){return!function(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}(e)||null===window.getComputedStyle(e)}(c)?I():(p("Element is detached"),E(),p("Waiting until element is attached..."),r(c).onRendered=function(){p("Element is now attached"),I()})},addListener:function(e,t){if(!r(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");r(e).listeners.push(t)},uninstall:function(e){var t=r(e);t&&(t.onExpandScroll&&s(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&s(h(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&s(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:c}};function E(e){return Array.isArray(e)||void 0!==e.length}function S(e){if(Array.isArray(e))return e;var t=[];return h(e,(function(e){t.push(e)})),t}function P(e){return e&&1===e.nodeType}var z;function D(e,t,n){var r=e[t];return null==r&&void 0!==n?n:r}function I(){return"undefined"==typeof window?null:(z||(z=function(e){var t;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var n=y(),r=g({idGenerator:n,stateHandler:w});t=r}var o=e.reporter;o||(o=b(!1===o));var i=D(e,"batchProcessor",O({reporter:o})),a={};a.callOnAdd=!!D(e,"callOnAdd",!0),a.debug=!!D(e,"debug",!1);var c,l=v(t),u=p({stateHandler:w}),s=D(e,"strategy","object"),d=D(e,"important",!1),f={reporter:o,batchProcessor:i,stateHandler:w,idHandler:t,important:d};if("scroll"===s&&(m.isLegacyOpera()?(o.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),s="object"):m.isIE(9)&&(o.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),s="object")),"scroll"===s)c=j(f);else{if("object"!==s)throw Error("Invalid strategy name: "+s);c=x(f)}var z={};return{listenTo:function(e,n,r){function i(e){var t=l.get(e);h(t,(function(t){t(e)}))}function s(e,t,n){l.add(t,n),e&&n(t)}if(r||(r=n,n=e,e={}),!n)throw Error("At least one element required.");if(!r)throw Error("Listener required.");if(P(n))n=[n];else{if(!E(n))return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=S(n)}var f=0,p=D(e,"callOnAdd",a.callOnAdd),v=D(e,"onReady",(function(){})),y=D(e,"debug",a.debug);h(n,(function(e){w.getState(e)||(w.initState(e),t.set(e));var a=t.get(e);if(y&&o.log("Attaching listener to element",a,e),!u.isDetectable(e))return y&&o.log(a,"Not detectable."),u.isBusy(e)?(y&&o.log(a,"System busy making it detectable"),s(p,e,r),z[a]=z[a]||[],void z[a].push((function(){++f===n.length&&v()}))):(y&&o.log(a,"Making detectable..."),u.markBusy(e,!0),c.makeDetectable({debug:y,important:d},e,(function(e){if(y&&o.log(a,"onElementDetectable"),w.getState(e)){u.markAsDetectable(e),u.markBusy(e,!1),c.addListener(e,i),s(p,e,r);var t=w.getState(e);t&&t.startSize&&(t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||i(e)),z[a]&&h(z[a],(function(e){e()}))}else y&&o.log(a,"Element uninstalled before being detectable.");delete z[a],++f===n.length&&v()})));y&&o.log(a,"Already detecable, adding listener."),s(p,e,r),f++})),f===n.length&&v()},removeListener:l.removeListener,removeAllListeners:l.removeAllListeners,uninstall:function(e){if(!e)return o.error("At least one element is required.");if(P(e))e=[e];else{if(!E(e))return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=S(e)}h(e,(function(e){l.removeAllListeners(e),c.uninstall(e),w.cleanState(e)}))},initDocument:function(e){c.initDocument&&c.initDocument(e)}}}({strategy:"scroll"})),z)}function R(e,t){return!(!e||!t)&&(e===t||e.width===t.width&&e.height===t.height)}var M="undefined"==typeof window?t.useEffect:t.useLayoutEffect,T=["width","height","onResize","render","children"];function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(){return(A=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var H=r.default.memo((function(e){var n=e.width,o=e.height,i=e.onResize,a=e.render,c=e.children,l=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,T),u=t.useMemo((function(){return void 0!==n&&void 0!==o?{width:n,height:o}:null}),[n,o]),s=t.useState(),d=s[0],f=s[1],h=t.useRef(d),p=t.useRef(null),v={onResize:i},y=t.useRef(v);y.current=v;var g=t.useCallback((function(){var e=p.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};f((function(e){return R(e,t)?e:t}))}}),[]);M((function(){var e=h.current;h.current=d,d&&!R(e,d)&&y.current.onResize&&y.current.onResize(d)}),[d]),M((function(){if(u)f((function(e){return R(e,u)?e:u}));else{g();var e=I(),t=p.current;if(e&&t)return e.listenTo(t,g),function(){e.uninstall(t)}}}),[u,g]);var b=t.useMemo((function(){var e={width:"100%",height:"100%"};return l.style&&A(e,l.style),void 0!==n&&(e.width=n),void 0!==o&&(e.height=o),e}),[n,o,l.style]);l.style=b;var m=c;return d?a&&(m=a(d)):m=null,r.default.createElement("div",C(C({},l),{},{ref:p}),m)}));function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){B(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _={target:null,translation:null,velocity:{x:0,y:0},interval:0,startPoint:{x:0,y:0},movePoint:{x:0,y:0},moveTime:0,cancelled:!0},F=function(e,t){switch(t.type){case"reset":return _;case"track":return q(e,t);case"move":return V(e,t);case"start":return X(e);case"end":return Y(e);default:return e}},q=function(e,t){var n=t.payload,r=n.target,o=n.point,i=(new Date).getTime();return N(N({},e),{},{target:r,translation:null,velocity:{x:0,y:0},interval:0,startPoint:o,movePoint:o,moveTime:i})},V=function(e,t){var n=t.payload.point,r=e.startPoint,o=e.movePoint,i=e.moveTime,a=e.translation;if(!e.target)return e;var c=(new Date).getTime(),l=c-i,u={x:(n.x-o.x)/l,y:(n.y-o.y)/l};if(!a)return N(N({},e),{},{velocity:u,interval:l,movePoint:n,moveTime:c});var s={x:n.x-r.x,y:n.y-r.y};return N(N({},e),{},{translation:s,velocity:u,interval:l,movePoint:n,moveTime:c})},X=function(e){var t=e.movePoint;return!e.target||e.translation?e:N(N({},e),{},{translation:{x:0,y:0},startPoint:t})},Y=function(e){return e.target?N(N({},e),{},{target:null,translation:null,cancelled:!1}):e},G=["transformTranslate","userSelectNone"];var U={create:function(e){var t=e.transformTranslate,n=e.userSelectNone,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,G);return t&&function(e,t){t.transform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.WebkitTransform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.msTransform="translate("+e.x+"px, "+e.y+"px)"}(t,r),n&&function(e){e.userSelect="none",e.WebkitUserSelect="none",e.MozUserSelect="none",e.msUserSelect="none"}(r),r}};function J(e,t,n,r){var o=function(){};return e&&e.addEventListener&&(e.addEventListener(t,n,r),o=function(){e.removeEventListener(t,n,r)}),o}var K=["disabled","shouldStart","onStart","onMove","onEnd","onCancel","render","children"];function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach((function(t){$(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(){return(ee=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var te="undefined"!=typeof window&&"ontouchstart"in window,ne=r.default.memo((function(e){var n=e.disabled,o=e.shouldStart,i=e.onStart,a=e.onMove,c=e.onEnd,l=e.onCancel,u=e.render,s=e.children,d=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,K),f=t.useReducer(F,_),h=f[0],p=f[1],v=t.useRef(h),y=t.useRef(null),g={shouldStart:o,onStart:i,onMove:a,onEnd:c,onCancel:l},b=t.useRef(g);b.current=g;var m=!!h.translation;M((function(){var e=v.current;if(v.current=h,h.target&&!h.translation){var t={x:h.movePoint.x-h.startPoint.x,y:h.movePoint.y-h.startPoint.y};if(Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))>0)b.current.shouldStart?b.current.shouldStart({target:h.target,translation:t,velocity:h.velocity,interval:h.interval})&&p({type:"start"}):p({type:"start"})}if(e.translation!==h.translation)if(h.translation){var n={target:h.target,translation:h.translation,velocity:h.velocity,interval:h.interval};e.translation?b.current.onMove&&b.current.onMove(n):b.current.onStart&&b.current.onStart(n)}else if(e.translation){var r={target:e.target,translation:e.translation,velocity:e.velocity,interval:e.interval};h.cancelled?b.current.onCancel&&b.current.onCancel(r):b.current.onEnd&&b.current.onEnd(r)}}),[h]),M((function(){if(n)h.target&&p({type:"reset"});else{var e=y.current;if(e){var t=function(e,t){p({type:"track",payload:{target:e,point:t}})},r=function(e){p({type:"move",payload:{point:e}})},o=function(){p({type:"end",payload:null})};if(h.target){if(te){var i=function(e){m&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),o()},a=J(e,"touchmove",(function(e){if(m&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),1===e.touches.length){var t=e.touches[0];r({x:t.pageX,y:t.pageY})}else o()})),c=J(e,"touchend",i),l=J(e,"touchcancel",i);return function(){a(),c(),l()}}var u=document.body,s=J(u,"mousemove",(function(e){m&&(e.preventDefault(),e.stopImmediatePropagation()),void 0===e.buttons||1===e.buttons?r({x:e.pageX,y:e.pageY}):o()})),d=J(u,"mouseup",(function(e){m&&(e.preventDefault(),e.stopImmediatePropagation()),o()}));return function(){s(),d()}}if(te){var f=J(e,"touchstart",(function(e){if(1===e.touches.length){var n=e.touches[0];t(n.target,{x:n.pageX,y:n.pageY})}}));return function(){f()}}var v=J(e,"mousedown",(function(e){!e.target||void 0!==e.buttons&&1!==e.buttons||t(e.target,{x:e.pageX,y:e.pageY})}));return function(){v()}}}}),[n,h.target,m]);var O=t.useMemo((function(){var e={};return m&&ee(e,U.create({touchAction:"none",pointerEvents:"none",userSelectNone:!0})),d.style&&ee(e,d.style),e}),[m,d.style]);return d.style=O,r.default.createElement("div",Z(Z({},d),{},{ref:y}),u?u(h):s)}));function re(e){function t(t){return Math.max(-2.5,Math.min(e[t],2.5))}var n={x:t("x"),y:t("y")};return n.x===e.x&&n.y===e.y?e:n}function oe(e,t,n,r,o,i){function a(a){var c="x"===a?["width","left","right"]:["height","top","bottom"],l=c[0],u=t[l],s=e[a];if(-1===o[a])return s;var d=Math.min(u-(r[c[1]]+n[l]+r[c[2]]),0);return i&&u>0&&(d=u*Math.ceil(d/u)),Math.max(d,Math.min(s,0))}var c={x:a("x"),y:a("y")};return c.x===e.x&&c.y===e.y?e:c}function ie(e,t,n,r,o){var i,a,c,l="number"==typeof o?(i=o,0===(c=Math.sqrt((a=t).x*a.x+a.y*a.y))?{x:0,y:0}:{x:i*(a.x/c),y:i*(a.y/c)}):o;function u(o){var i="x"===o?"width":"height",a=e[o],c=t[o];if(r&&n[i]>0){var u=a/n[i];a=n[i]*(u=c>.5?Math.ceil(u):-.5>c?Math.floor(u):Math.round(u))}else l[o]&&(a+=c*(c/l[o])/2);return a}return{x:u("x"),y:u("y")}}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ue=.025,se={size:{width:0,height:0},contentSize:{width:0,height:0},contentInset:{top:0,right:0,bottom:0,left:0},contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},drag:null,deceleration:null,bound:{x:1,y:1},pagingEnabled:!1,directionalLockEnabled:!1,pannable:_},de=function(e,t){switch(t.type){case"setState":return he(fe(e,t));case"dragStart":return pe(e);case"dragMove":return ve(e);case"dragEnd":return ye(e);case"dragCancel":return ge(e);case"decelerate":return he(be(e));case"scrollTo":return he(Oe(e,t));case"setBound":return he(me(e,t));default:return e}},fe=function(e,t){return ce(ce({},e),t.payload)},he=function(e){var t=e.size,n=e.contentSize,r=e.contentInset,o=e.contentOffset,i=e.contentVelocity,a=e.drag,c=e.deceleration,l=e.pagingEnabled,u=e.bound,s=ue;if(c){var d=c.endOffset,f=oe(o,t,n,r,u,l);if(d!==oe(d,t,n,r,u,l)&&o!==f){var h=o,p=re(i);return 0===u.x&&(p=ce(ce({},p),{},{x:0}),h=ce(ce({},h),{},{x:f.x})),0===u.y&&(p=ce(ce({},p),{},{y:0}),h=ce(ce({},h),{},{y:f.y})),c.rate!==s&&(d=ie(h,p,t,l,s)),d=oe(d,t,n,r,u,l),ce(ce({},e),{},{contentOffset:h,contentVelocity:p,drag:null,deceleration:je(d,s,h,p)})}}else if(!a){var v=ie(o,i,t,l,s);if((v=oe(v,t,n,r,u,l)).x!==o.x||v.y!==o.y)return ce(ce({},e),{},{drag:null,deceleration:je(v,s,o,i)})}return e},pe=function(e){var t=e.contentOffset,n=e.pannable.velocity;if(!n)return e;var r={x:1,y:1};e.directionalLockEnabled&&(Math.abs(n.x)>Math.abs(n.y)?r.y=0:r.x=0);var o={x:r.x*n.x,y:r.y*n.y};return ce(ce({},e),{},{contentVelocity:o,drag:{direction:r,startOffset:t},deceleration:null})},ve=function(e){var t=e.contentOffset,n=e.drag,r=e.pannable,o=r.translation,i=r.interval;if(!n||!o||!i)return e;var a={x:n.startOffset.x+n.direction.x*o.x,y:n.startOffset.y+n.direction.y*o.y},c={x:((a=function(e,t,n,r,o){function i(i){var a="x"===i?["width","height","left","right"]:["height","width","top","bottom"],c=a[0],l=a[1],u=e[i],s=o[i];if(-1===s)return u;var d=Math.min(t[c]-(r[a[2]]+n[c]+r[a[3]]),0),f=Math.min(t[c],t[l])/2;return u>0?0===s?0:f*(1-f/(f+u)):d>u?0===s?d:d-f*(1-f/(f-u+d)):u}var a={x:i("x"),y:i("y")};return a.x===e.x&&a.y===e.y?e:a}(a,e.size,e.contentSize,e.contentInset,e.bound)).x-t.x)/i,y:(a.y-t.y)/i};return ce(ce({},e),{},{contentOffset:a,contentVelocity:c})},ye=function(e){var t=e.contentOffset,n=e.size,r=e.pagingEnabled,o=r?ue:.0025,i=re(e.contentVelocity),a=ie(t,i,n,r,o);return ce(ce({},e),{},{contentVelocity:i,drag:null,deceleration:je(a,o,t,i)})},ge=function(e){var t=e.contentOffset,n=e.drag,r=e.size,o=e.pagingEnabled;if(!n)return e;var i=re(e.contentVelocity),a=ie(n.startOffset,{x:0,y:0},r,o,.025);return ce(ce({},e),{},{contentVelocity:i,drag:null,deceleration:je(a,.025,t,i)})},be=function(e){var t=e.deceleration;if(!t)return e;var n=xe(t),r=n.offset,o=n.velocity,i=n.didEnd;return ce(ce({},e),{},{contentOffset:r,contentVelocity:o,drag:null,deceleration:i?null:t})},me=function(e,t){var n=t.payload;return ce(ce({},e),{},{bound:n})},Oe=function(e,t){var n=e.contentOffset,r=e.size,o=t.payload,i=o.offset,a=void 0===i?{x:0,y:0}:i,c=o.point,l=o.align,u=void 0===l?0:l,s=o.animated,d=o.rect,f=!e.drag&&(void 0!==s&&s);d||(d=c?ce(ce({},c),{},{width:0,height:0}):{x:-a.x,y:-a.y,width:0,height:0});var h=function(e,t,n,r){var o="object"==typeof t?t:{x:t,y:t};function i(t){var i="x"===t?"width":"height",a=-e[t],c=o[t],l=r[i]-e[i];if("auto"===c){var u=0>l?-1:1;a+=u*Math.max(0,Math.min(u*(n[t]-a),u*l))}else"start"===c?c=0:"center"===c?c=.5:"end"===c&&(c=1),a+=c*l;return a}return{x:i("x"),y:i("y")}}(d,u,n,r);return we(e,{type:"setContentOffset",payload:{offset:h,animated:f}})},we=function(e,t){var n=e.contentOffset,r=e.contentVelocity,o=e.drag,i=e.deceleration,a=e.size,c=e.pagingEnabled,l=t.payload,u=l.offset;if(!l.animated){if(o)return ce(ce({},e),{},{contentOffset:u,drag:ce(ce({},o),{},{startOffset:{x:o.startOffset.x+u.x-n.x,y:o.startOffset.y+u.y-n.y}}),deceleration:null});if(i){var s=ie({x:i.endOffset.x+u.x-n.x,y:i.endOffset.y+u.y-n.y},{x:0,y:0},a,c,i.rate);return ce(ce({},e),{},{contentOffset:u,drag:null,deceleration:je(s,i.rate,u,r)})}return ce(ce({},e),{},{contentOffset:u})}var d=ie(u,{x:0,y:0},a,c,ue);return ce(ce({},e),{},{drag:null,deceleration:je(d,ue,n,r)})};function xe(e){var t=e.points,n=e.duration,r=e.startTime,o=e.endOffset;function i(e,r){var o=t[e],i=o[0],a=o[1],c=o[2],l=o[3];return[i-3*(i-a)*r+3*(i-2*a+c)*Math.pow(r,2)-(i-3*a+3*c-l)*Math.pow(r,3),(-3*(i-a)+6*(i-2*a+c)*r-3*(i-3*a+3*c-l)*Math.pow(r,2))/n]}var a=(new Date).getTime(),c=1;if(n>0&&(c=(a-r)/n),0>c||c>=1)return{offset:o,velocity:{x:0,y:0},didEnd:!0};var l=i("x",c),u=l[0],s=l[1],d=i("y",c);return{offset:{x:u,y:d[0]},velocity:{x:s,y:d[1]},didEnd:!1}}function je(e,t,n,r){var o=(new Date).getTime(),i=0;if(0>=t)throw Error("Rate needs more than 0.");var a,c={x:e.x-n.x,y:e.y-n.y},l=Math.sqrt(Math.pow(c.x,2)+Math.pow(c.y,2));if(l){var u=Math.sqrt(Math.pow(a=(r.x*c.x+r.y*c.y)/l,2)/2+t*l),s=(u-a)/t;0>s&&(u=a,s=0),i=s+u/t}else a=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),i=(Math.sqrt(2)+1)*a/t;return{endOffset:e,rate:t,duration:i,startTime:o,points:{x:[n.x,n.x+r.x*(i/3),e.x,e.x],y:[n.y,n.y+r.y*(i/3),e.y,e.y]}}}var Ee,Se,Pe=r.default.createContext({visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}});if("undefined"!=typeof window){Ee=window.requestAnimationFrame,Se=window.cancelAnimationFrame;for(var ze=["ms","moz","webkit","o"],De=window,Ie=0;!Ee&&4>Ie;)Ee=De[ze[Ie]+"RequestAnimationFrame"],Se=De[ze[Ie]+"CancelAnimationFrame"]||De[ze[Ie]+"CancelRequestAnimationFrame"],Ie++;if(!Ee){var Re=0;Ee=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-Re)),r=window.setTimeout((function(){e(t+n)}),n);return Re=t+n,r},Se=function(e){window.clearTimeout(e)}}}var Me=r.default.memo((function(e){var n=e.pannable,o=e.size,i=e.bound,a=e.contentInset,c=e.pagingEnabled,l=e.directionalLockEnabled,u=e.onScroll,s=e.onStartDragging,d=e.onEndDragging,f=e.onStartDecelerating,h=e.onEndDecelerating,p=e.onResizeContent,v=e.renderBackground,y=e.renderOverlay,g=e.render,b=t.useReducer(de,se),m=b[0],O=b[1],w=t.useRef(m),x={onScroll:u,onStartDragging:s,onEndDragging:d,onStartDecelerating:f,onEndDecelerating:h,onResizeContent:p},j=t.useRef(x);j.current=x;var E=t.useRef({scrollTo:function(e){O({type:"scrollTo",payload:e})},setBound:function(e){O({type:"setBound",payload:e(w.current)})}}),S=t.useCallback((function(e){O({type:"setState",payload:{contentSize:e}})}),[]);M((function(){O({type:"setState",payload:{pannable:n}})}),[n]),M((function(){O({type:"setState",payload:{size:o,bound:i,contentInset:a,pagingEnabled:c,directionalLockEnabled:l}})}),[o,i,a,c,l]),M((function(){var e=w.current;w.current=m,e.pannable.translation!==m.pannable.translation&&O(m.pannable.translation?e.pannable.translation?{type:"dragMove"}:{type:"dragStart"}:m.pannable.cancelled?{type:"dragCancel"}:{type:"dragEnd"}),e.contentSize!==m.contentSize&&j.current.onResizeContent&&j.current.onResizeContent(m.contentSize);var t={size:m.size,contentSize:m.contentSize,contentInset:m.contentInset,contentOffset:m.contentOffset,contentVelocity:m.contentVelocity,dragging:!!m.drag,decelerating:!!m.deceleration};if(e.contentOffset!==m.contentOffset&&j.current.onScroll&&j.current.onScroll(t),e.drag!==m.drag&&(e.drag?m.drag||j.current.onEndDragging&&j.current.onEndDragging(t):j.current.onStartDragging&&j.current.onStartDragging(t)),e.deceleration!==m.deceleration&&(e.deceleration?m.deceleration||j.current.onEndDecelerating&&j.current.onEndDecelerating(t):j.current.onStartDecelerating&&j.current.onStartDecelerating(t)),m.deceleration){var n=Ee((function(){O({type:"decelerate"})}));return function(){Se(n)}}}),[m]);var P=v?v(m,E.current):null,z=y?y(m,E.current):null,D=g(m,E.current),I=t.useMemo((function(){return U.create({position:"absolute",left:m.contentInset.left,top:m.contentInset.top,width:m.contentSize.width,height:m.contentSize.height,transformTranslate:m.contentOffset,willChange:"transform",overflow:"hidden"})}),[m.contentOffset,m.contentSize,m.contentInset]),R=t.useMemo((function(){return{visibleRect:{x:-m.contentOffset.x,y:-m.contentOffset.y,width:m.size.width,height:m.size.height},onResize:S}}),[m.contentOffset,m.size,S]);return r.default.createElement(r.default.Fragment,null,P,r.default.createElement("div",{style:I},r.default.createElement(Pe.Provider,{value:R},D)),z)})),Te=["width","height","boundX","boundY","contentInsetTop","contentInsetRight","contentInsetBottom","contentInsetLeft","pagingEnabled","directionalLockEnabled","onScroll","onStartDragging","onEndDragging","onStartDecelerating","onEndDecelerating","onResizeContent","renderBackground","renderOverlay","render","scrollTo","children"];function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){Le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ae(){return(Ae=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var He=r.default.memo((function(e){var n=e.width,o=e.height,i=e.boundX,a=void 0===i?1:i,c=e.boundY,l=void 0===c?1:c,u=e.contentInsetTop,s=void 0===u?0:u,d=e.contentInsetRight,f=void 0===d?0:d,h=e.contentInsetBottom,p=void 0===h?0:h,v=e.contentInsetLeft,y=void 0===v?0:v,g=e.pagingEnabled,b=void 0!==g&&g,m=e.directionalLockEnabled,O=void 0!==m&&m,w=e.onScroll,x=e.onStartDragging,j=e.onEndDragging,E=e.onStartDecelerating,S=e.onEndDecelerating,P=e.onResizeContent,z=e.renderBackground,D=e.renderOverlay,I=e.render,R=e.scrollTo,T=e.children,k=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,Te),C=t.useMemo((function(){return{width:n,height:o}}),[n,o]),L=t.useMemo((function(){return{x:a,y:l}}),[a,l]),A=t.useMemo((function(){return{top:s,right:f,bottom:p,left:y}}),[s,f,p,y]),H=t.useRef(),W=t.useRef(),N={shouldStart:k.shouldStart},B=t.useRef(N);B.current=N;var _=t.useCallback((function(e){if(B.current.shouldStart)return B.current.shouldStart(e);var t=H.current;return!!t&&!!function(e,t,n,r,o){var i=Math.abs(e.x)>Math.abs(e.y)?["x","width","left","right"]:["y","height","top","bottom"],a=i[1],c=i[2],l=i[3];if(0!==o[i[0]])return!0;return r[c]+n[a]+r[l]>t[a]}(e.velocity,t.size,t.contentSize,t.contentInset,t.bound)}),[]);M((function(){if(R){var e=W.current;e&&e.scrollTo(R)}}),[R]);var F=t.useMemo((function(){var e={overflow:"hidden",position:"relative",width:C.width,height:C.height};return k.style&&Ae(e,k.style),e}),[C,k.style]);return k.style=F,k.shouldStart=_,r.default.createElement(ne,Ce(Ce({},k),{},{render:function(e){return r.default.createElement(Me,{pannable:e,size:C,bound:L,contentInset:A,pagingEnabled:b,directionalLockEnabled:O,onScroll:w,onStartDragging:x,onEndDragging:j,onStartDecelerating:E,onEndDecelerating:S,onResizeContent:P,renderBackground:z,renderOverlay:D,render:function(e,t){return H.current=e,W.current=t,I?I(e,t):T}})}}))}));var We=["width","height","autoResizing","render","children"];function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Be(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach((function(t){_e(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(){return(Fe=Object.assign||function(e){for(var t=1;arguments.length>t;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 qe(){}var Ve={position:"absolute",top:0,left:0},Xe=r.default.memo((function(e){var n=e.width,o=e.height,i=e.autoResizing,a=void 0!==i&&i,c=e.render,l=e.children,u=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,We),s=t.useContext(Pe),d=null!=n?n:s.width,f=null!=o?o:s.height,h=t.useMemo((function(){return void 0!==d&&void 0!==f?{width:d,height:f}:null}),[d,f]),p=t.useState(null),v=p[0],y=p[1],g=t.useRef(v),b=t.useRef(null),m={onResize:s.onResize},O=t.useRef(m);O.current=m;var w=t.useCallback((function(){var e=b.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};y((function(e){return R(e,t)?e:t}))}}),[]);M((function(){var e=g.current;g.current=v,v&&!R(e,v)&&O.current.onResize(v)}),[v]),M((function(){if(h)y((function(e){return R(e,h)?e:h}));else if(w(),a){var e=I(),t=b.current;if(e&&t)return e.listenTo(t,w),function(){e.uninstall(t)}}}),[h,a,w]);var x=t.useMemo((function(){var e={position:"absolute"};return void 0!==d&&(e.width=d),void 0!==f&&(e.height=f),e}),[d,f]),j=l;c&&(j=c()),h||(j=r.default.createElement("div",{style:Ve},r.default.createElement("div",{style:x,ref:b},j)));var E=t.useMemo((function(){var e={position:"relative"};return v&&(e.width=v.width,e.height=v.height),u.style&&Fe(e,u.style),e}),[v,u.style]);return u.style=E,r.default.createElement("div",Be({},u),r.default.createElement(Pe.Provider,{value:Be(Be({},s),{},{width:d,height:f,onResize:qe})},j))}));function Ye(e,t){function n(n){var r,o="x"===n?"width":"height";return(r={})[n]=t[n]-e[n],r[o]=t[o],r}var r=n("x"),o=r.x,i=r.width,a=n("y");return{x:o,y:a.y,width:i,height:a.height}}function Ge(e,t){if(!t)return!0;function n(n){var r="x"===n?"width":"height";return e[n]+e[r]>=t[n]-t[r]/4&&t[n]+5*t[r]/4>=e[n]}return n("x")&&n("y")}var Ue=["itemWidth","itemHeight","itemCount","renderItem","direction","rowSpacing","columnSpacing","width","height","render","children"];function Je(){return(Je=Object.assign||function(e){for(var t=1;arguments.length>t;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 Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach((function(t){Ze(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $e(){}var et=r.default.memo((function(e){return null})),tt=r.default.memo((function(e){var n=e.itemWidth,o=e.itemHeight,i=e.itemCount,a=e.renderItem,c=e.direction,l=void 0===c?"y":c,u=e.rowSpacing,s=void 0===u?0:u,d=e.columnSpacing,f=void 0===d?0:d,h=e.width,p=e.height,v=e.render,y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,Ue),g=t.useContext(Pe),b=null!=h?h:g.width,m=null!=p?p:g.height,O=t.useMemo((function(){return function(e){var t,n,r=e.spacing,o=e.itemSize,i=e.itemCount,a="x"===e.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],c=a[0],l=a[1],u=a[2],s=a[3],d=a[4],f=a[5],h=e.size[u],p=0,v=0,y=0,g=[];void 0===h?(y=i,0===o[u]?h=0:(h=i*o[u],i>1&&(h+=(i-1)*r[f]))):0===o[u]?y=i:(y=1,h>o[u]&&(y+=Math.floor((h-o[u])/(o[u]+r[f]))));y>0&&(v=Math.ceil(i/y));for(var b=0;v>b;b++){b>0&&(p+=r[d]);for(var m=0;y>m;m++){var O,w,x=m+b*y,j=0;if(y>1&&(j+=Math.round(m*((h-o[u])/(y-1)))),x>=i)break;g.push(((w={rect:(O={},O[c]=j,O[l]=p,O[u]=o[u],O[s]=o[s],O)})[d+"Index"]=b,w[f+"Index"]=m,w.itemIndex=x,w))}p+=o[s]}return{size:(t={},t[u]=h,t[s]=p,t),count:(n={},n[d]=v,n[f]=y,n),layoutList:g}}({direction:l,size:{width:b,height:m},spacing:{row:s,column:f},itemSize:{width:n,height:o},itemCount:i})}),[l,b,m,s,f,n,o,i]),w=t.useRef(),x={onResize:g.onResize},j=t.useRef(x);j.current=x,M((function(){var e=w.current;w.current=O.size,R(e,O.size)||j.current.onResize(O.size)}),[O.size]);var E=O.layoutList.map((function(e){return function(e){var t=e.rect,i=e.itemIndex,c=e.visibleRect,l=e.needsRender,u=e.Item,s=!1,d=a(e),f="GridContent_"+i;if(r.default.isValidElement(d)&&d.type===u){d.key&&(f=d.key);var h=d.props;void 0!==h.forceRender&&(s=h.forceRender),d=d.props.children}if(!l&&!s)return null;var p={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height};return r.default.createElement(Pe.Provider,{key:f,value:Qe(Qe({},g),{},{width:n,height:o,visibleRect:c,onResize:$e})},r.default.createElement("div",{style:p},d))}(Qe(Qe({},e),{},{visibleRect:Ye(e.rect,g.visibleRect),needsRender:Ge(e.rect,g.visibleRect),Item:et}))}));v&&v(O);var S=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return O.size&&(e.width=O.size.width,e.height=O.size.height),y.style&&Je(e,y.style),e}),[O.size,y.style]);return y.style=S,r.default.createElement("div",Qe({},y),E)}));var nt=["itemCount","renderItem","direction","width","height","spacing","estimatedItemWidth","estimatedItemHeight","render","children"];function rt(){return(rt=Object.assign||function(e){for(var t=1;arguments.length>t;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 ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function it(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach((function(t){at(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function at(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ct=r.default.memo((function(e){return null})),lt=r.default.memo((function(e){var n=e.itemCount,o=e.renderItem,i=e.direction,a=void 0===i?"y":i,c=e.width,l=e.height,u=e.spacing,s=void 0===u?0:u,d=e.estimatedItemWidth,f=void 0===d?0:d,h=e.estimatedItemHeight,p=void 0===h?0:h,v=e.render,y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,nt),g=t.useContext(Pe),b=null!=c?c:g.width,m=null!=l?l:g.height,O=t.useState([]),w=O[0],x=O[1],j=t.useState({}),E=j[0],S=j[1],P=t.useMemo((function(){return function(e,t,n){var r,o,i,a=e.size,c=e.spacing,l=e.estimatedItemSize,u=e.itemCount,s="x"===e.direction?["y","x","height","width"]:["x","y","width","height"],d=s[0],f=s[1],h=s[2],p=s[3],v=0,y=0,g=[],b={};void 0!==a[h]&&(b[h]=a[h]);for(var m=0;u>m;m++){var O,w=t[m]||null,x=w&&n[w]||null,j=((O={})[d]=0,O[f]=y,O);if(x)rt(j,x);else{var E,S=l[h],P=l[p];j[h]=null!==(E=b[h])&&void 0!==E?E:"function"==typeof S?S(m):S,j[p]="function"==typeof P?P(m):P}g.push({rect:j,itemIndex:m,itemHash:w,itemSize:x}),j[p]>0&&(y+=j[p],u-1>m&&(y+=c)),j[h]>v&&(v=j[h])}return{size:(i={},i[h]=null!==(r=b[h])&&void 0!==r?r:v,i[p]=null!==(o=b[p])&&void 0!==o?o:y,i),layoutList:g}}({direction:a,size:{width:b,height:m},spacing:s,estimatedItemSize:{width:f,height:p},itemCount:n},w,E)}),[b,m,a,s,f,p,n,w,E]),z=t.useRef(),D={onResize:g.onResize},I=t.useRef(D);I.current=D,M((function(){var e=z.current;z.current=P.size,R(e,P.size)||I.current.onResize(P.size)}),[P.size]);var T=[];var k=P.layoutList.map((function(e){return function(e){var t=e.rect,n=e.itemIndex,i=e.itemSize,c=e.visibleRect,l=e.needsRender,u=e.Item,s=!1,d=o(e),f="ListContent_"+n,h=null;if(r.default.isValidElement(d)&&d.type===u){d.key&&(f=d.key);var p=d.props;void 0!==p.forceRender&&(s=p.forceRender),void 0!==p.hash&&(h=p.hash),d=d.props.children}null===h&&(h=f);var v=!l&&!s;if(i||-1===T.indexOf(h)||(v=!0),T[n]=h,v)return null;var y={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height},b=it({},g);return b.visibleRect=c,b.onResize=function(e){S((function(t){var n;return h?R(t[h],e)?t:it(it({},t),{},((n={})[h]=e,n)):t}))},"x"===a?b.height=P.size.height:b.width=P.size.width,r.default.createElement(Pe.Provider,{key:f,value:b},r.default.createElement("div",{style:y},d))}(it(it({},e),{},{visibleRect:Ye(e.rect,g.visibleRect),needsRender:Ge(e.rect,g.visibleRect),Item:ct}))}));(function(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(w,T)||x(T),v&&v(P);var C=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return P.size&&(e.width=P.size.width,e.height=P.size.height),y.style&&rt(e,y.style),e}),[P.size,y.style]);return y.style=C,r.default.createElement("div",it({},y),k)}));function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function st(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(n),!0).forEach((function(t){dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ft={loopCount:2,loopOffset:0,loopWidth:0,direction:"x",pad:se,scrollTo:null},ht=function(e,t){switch(t.type){case"setState":return vt(pt(e,t));default:return e}},pt=function(e,t){return st(st({},e),t.payload)},vt=function(e){var t=e.loopCount,n=e.loopWidth,r=e.loopOffset,o=e.direction,i=e.pad,a=i.size,c=i.contentOffset,l="y"===o?"height":"width",u=i.contentSize[l]/t,s=2;if(0!==u&&(s+=Math.floor(a[l]/u)),n!==u||t!==s)return st(st({},e),{},{loopCount:s,loopWidth:u});var d=function(e,t,n,r,o){var i;if(1===r||0===n)return[e,0];var a="y"===o?["height","y","x"]:["width","x","y"],c=a[1],l=a[2],u=t[a[0]],s=(u-n*(r-1))/2,d=(u-n*(r+1))/2,f=e[c],h=0;if(f>=d&&s>=f)return[e,0];d>f?h=Math.floor((s-f)/n):f>s&&(h=-Math.floor((f-d)/n));return[(i={},i[c]=f+=n*h,i[l]=e[l],i),h]}(c,a,n,t,o),f=d[0],h=d[1];return c!==f?st(st({},e),{},{loopOffset:r+h,scrollTo:{offset:f,animated:!1}}):e};var yt=r.default.memo((function(e){var n=e.pad,o=e.padMethods,i=e.direction,a=e.render,c=t.useReducer(ht,ft),l=c[0],u=c[1],s={scrollTo:o.scrollTo},d=t.useRef(s);return d.current=s,M((function(){u({type:"setState",payload:{pad:n}})}),[n]),M((function(){u({type:"setState",payload:{direction:i}})}),[i]),M((function(){l.scrollTo&&d.current.scrollTo(l.scrollTo)}),[l.scrollTo]),r.default.createElement(lt,{direction:i,width:l.pad.size.width,height:l.pad.size.height,itemCount:l.loopCount,renderItem:function(e){return r.default.createElement(e.Item,{key:e.itemIndex+l.loopOffset,hash:"Loop",forceRender:!0},a(l))}})})),gt=["direction","render","children"];function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){Ot(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wt=r.default.memo((function(e){var t,n,o=e.direction,i=void 0===o?"x":o,a=e.render,c=e.children,l=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,gt),u=l.directionalLockEnabled;(l.directionalLockEnabled=void 0===u||u,"x"===i)?l.boundX=null!==(t=l.boundX)&&void 0!==t?t:-1:l.boundY=null!==(n=l.boundY)&&void 0!==n?n:-1;return r.default.createElement(He,mt(mt({},l),{},{render:function(e,t){return r.default.createElement(yt,{pad:e,padMethods:t,direction:i,render:function(e){return a?a(e):c}})}}))}));function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(n),!0).forEach((function(t){Et(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var St={pad:se,activeIndex:0,direction:"x",loop:!0,itemCount:0,scrollTo:null,playing:!1},Pt=function(e,t){switch(t.type){case"setState":return Dt(zt(e,t));case"scrollToIndex":return It(e,t);case"next":return Rt(e,t);case"play":return Mt(e,t);default:return e}},zt=function(e,t){return jt(jt({},e),t.payload)},Dt=function(e,t){var n=e.activeIndex,r=e.pad,o=function(e,t,n,r){var o="y"===r?["height","y"]:["width","x"],i=o[1],a=t[o[0]],c=0;a>0&&(c=Math.round(-e[i]/a));return c%n}(r.contentOffset,r.size,e.itemCount,e.direction);return n===o?e:jt(jt({},e),{},{activeIndex:o})},It=function(e,t){var n=e.activeIndex,r=e.itemCount,o=e.direction,i=e.loop,a=e.pad,c=a.contentOffset,l=a.size,u=t.payload.animated,s=t.payload.index;"function"==typeof s&&(s=s({activeIndex:n,itemCount:r})),i||(s=Math.max(0,Math.min(s,r-1)));var d=function(e,t,n,r){var o,i="y"===r?["height","y","x"]:["width","x","y"],a=i[1],c=i[2];return(o={})[a]=t[a]-e*n[i[0]],o[c]=t[c],o}(s-n,c,l,o);return jt(jt({},e),{},{scrollTo:{offset:d,animated:u}})},Rt=function(e,t){var n=e.activeIndex+1;return e.loop||(n%=e.itemCount),It(e,{type:"scrollToIndex",payload:{index:n,animated:t.payload.animated}})},Mt=function(e,t){return jt(jt({},e),{},{playing:t.payload})};var Tt=r.default.memo((function(e){var n=e.pad,o=e.padMethods,i=e.direction,a=e.loop,c=e.autoplayEnabled,l=e.autoplayInterval,u=e.itemCount,s=e.onActiveIndexChange,d=e.render,f=t.useReducer(Pt,St),h=f[0],p=f[1],v=t.useRef(h),y={onActiveIndexChange:s,scrollTo:o.scrollTo},g=t.useRef(y);g.current=y;var b=t.useRef({scrollToIndex:function(e){p({type:"scrollToIndex",payload:e})},play:function(e){p({type:"play",payload:e})}});return M((function(){p({type:"setState",payload:{pad:n}})}),[n]),M((function(){p({type:"setState",payload:{direction:i,loop:a,itemCount:u}})}),[i,a,u]),M((function(){var e=v.current;(v.current=h,e.activeIndex!==h.activeIndex)&&(g.current.onActiveIndexChange&&g.current.onActiveIndexChange({activeIndex:h.activeIndex,itemCount:h.itemCount}))}),[h]),M((function(){h.scrollTo&&g.current.scrollTo(h.scrollTo)}),[h.scrollTo]),M((function(){if(h.playing){var e=setInterval((function(){p({type:"next",payload:{animated:!0}})}),l);return function(){clearInterval(e)}}}),[h.playing,l]),M((function(){b.current.play(c&&!h.pad.drag)}),[c,h.pad.drag]),r.default.createElement(r.default.Fragment,null,d(h,b.current))})),kt=["itemCount","renderItem","direction","loop","autoplayEnabled","autoplayInterval","onActiveIndexChange","scrollToIndex","render","children"];function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(n),!0).forEach((function(t){At(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function At(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ht=r.default.memo((function(e){var n=e.itemCount,o=e.renderItem,i=e.direction,a=void 0===i?"x":i,c=e.loop,l=void 0===c||c,u=e.autoplayEnabled,s=void 0===u||u,d=e.autoplayInterval,f=void 0===d?5e3:d,h=e.onActiveIndexChange,p=e.scrollToIndex,v=e.render,y=e.children,g=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,kt),b=g.width,m=g.height,O=g.pagingEnabled,w=void 0===O||O,x=g.directionalLockEnabled,j=void 0===x||x,E=g.renderOverlay,S=g.onMouseEnter,P=g.onMouseLeave,z=t.useRef(),D={onMouseEnter:S,onMouseLeave:P},I=t.useRef(D);I.current=D;var R,T,k=t.useCallback((function(e){var t=z.current;t&&t.play(!1),I.current.onMouseEnter&&I.current.onMouseEnter(e)}),[]),C=t.useCallback((function(e){var t=z.current;t&&t.play(!0),I.current.onMouseLeave&&I.current.onMouseLeave(e)}),[]);(M((function(){if(p){var e=z.current;e&&e.scrollToIndex(p)}}),[p]),g.pagingEnabled=w,g.directionalLockEnabled=j,s&&(g.onMouseEnter=k,g.onMouseLeave=C),"x"===a)?g.boundY=null!==(R=g.boundY)&&void 0!==R?R:0:g.boundX=null!==(T=g.boundX)&&void 0!==T?T:0;g.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(Tt,{pad:e,padMethods:t,direction:a,loop:l,autoplayEnabled:s,autoplayInterval:f,itemCount:n,onActiveIndexChange:h,render:function(e,t){return z.current=t,v?v(e,t):y}}),E?E(e,t):null)};var L=r.default.createElement(tt,{width:b,height:m,itemWidth:b,itemHeight:m,direction:a,itemCount:n,renderItem:o});return l?r.default.createElement(wt,Lt({direction:a},g),L):r.default.createElement(He,Lt({},g),L)}));function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){Bt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _t={pad:se,scroll:null,scrollTo:null},Ft=function(e,t){switch(t.type){case"setState":return qt(e,t);case"scrollTo":return Vt(e,t);case"scrollEnd":return Xt(e);case"scrollRecalculate":return Yt(e,t);default:return e}},qt=function(e,t){return Nt(Nt({},e),t.payload)},Vt=function(e,t){var n=t.payload,r=n.params,o=n.layout,i=Nt({},r),a=r.index,c=r.reverseRect;return void 0!==a?i.rect=function(e,t){var n=t.box,r=t.body,o={x:0,y:0,width:0,height:0};n&&n.layoutList[1]&&(o=n.layoutList[1].rect);if(r){var i=r.layoutList[e=Math.max(0,Math.min(e,r.layoutList.length-1))];o={x:o.x+i.rect.x,y:o.y+i.rect.y,width:i.rect.width,height:i.rect.height}}return o}(a,o):void 0!==c&&(i.rect=function(e,t){var n=t.box,r={x:0,y:0,width:e.width,height:e.height};n&&(r.x=n.size.width-r.width-e.x,r.y=n.size.height-r.height-e.y);return r}(c,o)),Nt(Nt({},e),{},{scrollTo:i,scroll:e.scroll||r})},Xt=function(e,t){return Nt(Nt({},e),{},{scroll:null})},Yt=function(e,t){var n=e.scroll;return n?Vt(e,{type:"scrollTo",payload:{params:n,layout:t.payload.layout}}):e};var Gt=r.default.memo((function(e){var n=e.direction,o=e.pad,i=e.padMethods,a=e.layout,c=e.render,l=t.useReducer(Ft,_t),u=l[0],s=l[1],d=t.useRef(u),f=t.useRef(a),h=t.useRef(i);h.current=i;var p=t.useRef({scrollTo:function(e){s({type:"scrollTo",payload:{params:e,layout:f.current}})}});return t.useMemo((function(){s({type:"setState",payload:{pad:o}})}),[o]),M((function(){var e=d.current;d.current=u,u.scroll&&(e.pad.contentSize!==u.pad.contentSize?s({type:"scrollRecalculate",payload:{layout:f.current}}):u.pad.deceleration||u.scroll.animated&&!e.pad.deceleration||setTimeout((function(){s({type:"scrollEnd"})}),0))}),[u]),M((function(){u.scrollTo&&h.current.scrollTo(u.scrollTo)}),[u.scrollTo]),M((function(){var e;if(u.scroll)return h.current.setBound((function(t){return e=t.bound,"x"===n?{x:-1,y:e.y}:{x:e.x,y:-1}})),function(){e&&h.current.setBound((function(){return e}))}}),[u.scroll,n]),r.default.createElement(r.default.Fragment,null,c(u,p.current))})),Ut=["itemCount","renderItem","direction","spacing","estimatedItemWidth","estimatedItemHeight","renderHeader","renderFooter","scrollTo","render","children"];function Jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qt=r.default.memo((function(e){var n,o,i=e.itemCount,a=e.renderItem,c=e.direction,l=void 0===c?"y":c,u=e.spacing,s=void 0===u?0:u,d=e.estimatedItemWidth,f=void 0===d?0:d,h=e.estimatedItemHeight,p=void 0===h?0:h,v=e.renderHeader,y=e.renderFooter,g=e.scrollTo,b=e.render,m=e.children,O=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,Ut),w=O.width,x=O.height,j=O.renderOverlay,E=O.directionalLockEnabled,S=void 0===E||E,P=t.useRef({}),z=t.useRef();(M((function(){if(g){var e=z.current;e&&e.scrollTo(g)}}),[g]),O.directionalLockEnabled=S,"x"===l)?O.boundY=null!==(n=O.boundY)&&void 0!==n?n:0:O.boundX=null!==(o=O.boundX)&&void 0!==o?o:0;return O.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(Gt,{direction:l,pad:e,padMethods:t,layout:P.current,render:function(e,t){return z.current=t,b?b(e,t):m}}),j?j(e,t):null)},r.default.createElement(He,function(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jt(Object(n),!0).forEach((function(t){Kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},O),r.default.createElement(lt,{width:w,height:x,direction:l,itemCount:3,renderItem:function(e){var t=e.itemIndex,n=e.Item;return 0===t?v?v(e):null:2===t?y?y(e):null:r.default.createElement(n,{forceRender:!0},r.default.createElement(lt,{width:w,height:x,direction:l,spacing:s,itemCount:i,estimatedItemWidth:f,estimatedItemHeight:p,renderItem:a,render:function(e){return P.current.body=e,null}}))},render:function(e){return P.current.box=e,null}}))}));e.AutoResizing=H,e.Carousel=Ht,e.GridContent=tt,e.Infinite=Qt,e.ItemContent=Xe,e.ListContent=lt,e.Loop=wt,e.Pad=He,e.Pannable=ne,e.calculateDeceleration=xe,e.context=Pe,e.createDeceleration=je,e.initialCarouselState=St,e.initialInfiniteState=_t,e.initialLoopState=ft,e.initialPadState=se,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactPannable={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),o={exports:{}};(o.exports={}).forEach=function(e,t){for(var n=0;e.length>n;n++){var r=t(e[n]);if(r)return r}};var i={exports:{}},a=i.exports={};a.isIE=function(e){return(-1!==(t=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/"))&&(!e||e===function(){var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(n[0]);return e>4?e:undefined}());var t},a.isLegacyOpera=function(){return!!window.opera};var c={exports:{}};(c.exports={}).getOption=function(e,t,n){var r=e[t];if(null==r&&void 0!==n)return n;return r};var l=c.exports;function u(){var e={},t=0,n=0,r=0;return{add:function(o,i){i||(i=o,o=0),o>n?n=o:r>o&&(r=o),e[o]||(e[o]=[]),e[o].push(i),t++},process:function(){for(var t=r;n>=t;t++)for(var o=e[t],i=0;o.length>i;i++){(0,o[i])()}},size:function(){return t}}}function s(e){return e._erd}var d=i.exports,f=o.exports.forEach,h=o.exports.forEach,p=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var n=t(e);return n&&!!n.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,n){t(e).busy=!!n}}},v=function(e){var t={};function n(n){var r=e.get(n);return void 0===r?[]:t[r]||[]}return{get:n,add:function(n,r){var o=e.get(n);t[o]||(t[o]=[]),t[o].push(r)},removeListener:function(e,t){for(var r=n(e),o=0,i=r.length;i>o;++o)if(r[o]===t){r.splice(o,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}},y=function(){var e=1;return{generate:function(){return e++}}},g=function(e){var t=e.idGenerator,n=e.stateHandler.getState;return{get:function(e){var t=n(e);return t&&void 0!==t.id?t.id:null},set:function(e){var r=n(e);if(!r)throw Error("setId required the element to have a resize detection state.");var o=t.generate();return r.id=o,o}}},b=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var r=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var n=0;arguments.length>n;n++)e(arguments[n])}};r(n,"log"),r(n,"warn"),r(n,"error")}return n},m=i.exports,O=function(e){var t=(e=e||{}).reporter,n=l.getOption(e,"async",!0),r=l.getOption(e,"auto",!0);r&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,i=u(),a=!1;function c(){for(a=!0;i.size();){var e=i;i=u(),e.process()}a=!1}function s(){o=setTimeout(c,0)}return{add:function(e,t){!a&&r&&n&&0===i.size()&&s(),i.add(e,t)},force:function(e){a||(void 0===e&&(e=n),o&&(clearTimeout(o),o=null),e?s():c())}}},w={initState:function(e){return e._erd={},s(e)},getState:s,cleanState:function(e){delete e._erd}},x=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState;if(!t)throw Error("Missing required dependency: reporter.");function o(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function i(e){return r(e).object}return{makeDetectable:function(e,i,a){a||(a=i,i=e,e=null),e=e||{},d.isIE(8)?a(i):function(i,a){var c=o(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),l=!1,u=window.getComputedStyle(i),s=i.offsetWidth,f=i.offsetHeight;function h(){function n(){if("static"===u.position){i.style.setProperty("position","relative",e.important?"important":"");var n=function(t,n,r,o){var i=r[o];"auto"!==i&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(i)&&(t.warn("An element that is positioned static has style."+o+"="+i+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+o+" will be set to 0. Element: ",n),n.style.setProperty(o,"0",e.important?"important":""))};n(t,i,u,"top"),n(t,i,u,"right"),n(t,i,u,"bottom"),n(t,i,u,"left")}}""!==u.position&&(n(),l=!0);var o=document.createElement("object");o.style.cssText=c,o.tabIndex=-1,o.type="text/html",o.setAttribute("aria-hidden","true"),o.onload=function(){l||n(),function e(t,n){if(!t.contentDocument){var o=r(t);return o.checkForObjectDocumentTimeoutId&&window.clearTimeout(o.checkForObjectDocumentTimeoutId),void(o.checkForObjectDocumentTimeoutId=setTimeout((function(){o.checkForObjectDocumentTimeoutId=0,e(t,n)}),100))}n(t.contentDocument)}(this,(function(e){a(i)}))},d.isIE()||(o.data="about:blank"),r(i)&&(i.appendChild(o),r(i).object=o,d.isIE()&&(o.data="about:blank"))}r(i).startSize={width:s,height:f},n?n.add(h):h()}(i,a)},addListener:function(e,t){function n(){t(e)}if(d.isIE(8))r(e).object={proxy:n},e.attachEvent("onresize",n);else{var o=i(e);if(!o)throw Error("Element is not detectable by this strategy.");o.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(e){if(r(e)){var t=i(e);t&&(d.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),r(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(r(e).checkForObjectDocumentTimeoutId),delete r(e).object)}}}},j=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,r=e.stateHandler.getState,o=e.idHandler;if(!n)throw Error("Missing required dependency: batchProcessor");if(!t)throw Error("Missing required dependency: reporter.");var i=function(){var e=500,t=500,n=document.createElement("div");n.style.cssText=l(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var r=document.createElement("div");r.style.cssText=l(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),r.appendChild(n),document.body.insertBefore(r,document.body.firstChild);var o=e-r.clientWidth,i=t-r.clientHeight;return document.body.removeChild(r),{width:o,height:i}}(),a="erd_scroll_detection_container";function c(e){!function(e,t,n){function r(n,r){r=r||function(t){e.head.appendChild(t)};var o=e.createElement("style");return o.innerHTML=n,o.id=t,r(o),o}if(!e.getElementById(t)){var o=n+"_animation",i=n+"_animation_active",a="/* Created by the element-resize-detector library. */\n";a+="."+n+" > div::-webkit-scrollbar { "+l(["display: none"])+" }\n\n",a+="."+i+" { "+l(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+o,"animation-name: "+o])+" }\n",a+="@-webkit-keyframes "+o+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",r(a+="@keyframes "+o+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",a)}function l(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function u(e,n,r){if(e.addEventListener)e.addEventListener(n,r);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,r)}}function s(e,n,r){if(e.removeEventListener)e.removeEventListener(n,r);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,r)}}function d(e){return r(e).container.childNodes[0].childNodes[0].childNodes[0]}function h(e){return r(e).container.childNodes[0].childNodes[0].childNodes[1]}return c(window.document),{makeDetectable:function(e,c,s){function p(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(o.get(c),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var r=0;n.length>r;r++)t.log(n[r])}}function v(e){var t=r(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function y(){var e=window.getComputedStyle(c),t={};return t.position=e.position,t.width=c.offsetWidth,t.height=c.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function g(){if(p("storeStyle invoked."),r(c)){var e=y();r(c).style=e}else p("Aborting because element has been uninstalled")}function b(e,t,n){r(e).lastWidth=t,r(e).lastHeight=n}function m(){return 2*i.width+1}function O(){return 2*i.height+1}function w(e){return e+10+m()}function x(e){return e+10+O()}function j(e,t,n){var r=d(e),o=h(e),i=w(t),a=x(n),c=function(e){return 2*e+m()}(t),l=function(e){return 2*e+O()}(n);r.scrollLeft=i,r.scrollTop=a,o.scrollLeft=c,o.scrollTop=l}function E(){var e=r(c).container;if(!e){(e=document.createElement("div")).className=a,e.style.cssText=l(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),r(c).container=e,function(e){e.className+=" "+a+"_animation_active"}(e),c.appendChild(e);var t=function(){r(c).onRendered&&r(c).onRendered()};u(e,"animationstart",t),r(c).onAnimationStart=t}return e}function S(){if(p("Injecting elements"),r(c)){!function(){var n=r(c).style;if("static"===n.position){c.style.setProperty("position","relative",e.important?"important":"");var o=function(e,t,n,r){var o=n[r];"auto"!==o&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(o)&&(e.warn("An element that is positioned static has style."+r+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+r+" will be set to 0. Element: ",t),t.style[r]=0)};o(t,c,n,"top"),o(t,c,n,"right"),o(t,c,n,"bottom"),o(t,c,n,"left")}}();var n=r(c).container;n||(n=E());var o,s,d,f,h=i.width,v=i.height,y=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),g=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(o=(o=-(1+h))?o+"px":"0"),"top: "+(s=(s=-(1+v))?s+"px":"0"),"right: "+(f=(f=-h)?f+"px":"0"),"bottom: "+(d=(d=-v)?d+"px":"0")])),b=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),m=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),O=l(["position: absolute","left: 0","top: 0"]),w=l(["position: absolute","width: 200%","height: 200%"]),x=document.createElement("div"),j=document.createElement("div"),S=document.createElement("div"),P=document.createElement("div"),z=document.createElement("div"),D=document.createElement("div");x.dir="ltr",x.style.cssText=y,x.className=a,j.className=a,j.style.cssText=g,S.style.cssText=b,P.style.cssText=O,z.style.cssText=m,D.style.cssText=w,S.appendChild(P),z.appendChild(D),j.appendChild(S),j.appendChild(z),x.appendChild(j),n.appendChild(x),u(S,"scroll",I),u(z,"scroll",R),r(c).onExpandScroll=I,r(c).onShrinkScroll=R}else p("Aborting because element has been uninstalled");function I(){r(c).onExpand&&r(c).onExpand()}function R(){r(c).onShrink&&r(c).onShrink()}}function P(){function i(t,n,r){var o=function(e){return d(e).childNodes[0]}(t),i=w(n),a=x(r);o.style.setProperty("width",i+"px",e.important?"important":""),o.style.setProperty("height",a+"px",e.important?"important":"")}function a(a){var u=c.offsetWidth,s=c.offsetHeight,d=u!==r(c).lastWidth||s!==r(c).lastHeight;p("Storing current size",u,s),b(c,u,s),n.add(0,(function(){if(d)if(r(c))if(l()){if(e.debug)c.offsetWidth===u&&c.offsetHeight===s||t.warn(o.get(c),"Scroll: Size changed before updating detector elements.");i(c,u,s)}else p("Aborting because element container has not been initialized");else p("Aborting because element has been uninstalled")})),n.add(1,(function(){r(c)?l()?j(c,u,s):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")})),d&&a&&n.add(2,(function(){r(c)?l()?a():p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")}))}function l(){return!!r(c).container}function u(){p("notifyListenersIfNeeded invoked");var e=r(c);return void 0===r(c).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?p("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?p("Not notifying: Size already notified"):(p("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void f(r(c).listeners,(function(e){e(c)})))}function s(){p("Scroll detected."),v(c)?p("Scroll event fired while unrendered. Ignoring..."):a(u)}if(p("registerListenersAndPositionElements invoked."),r(c)){r(c).onRendered=function(){if(p("startanimation triggered."),v(c))p("Ignoring since element is still unrendered...");else{p("Element rendered.");var e=d(c),t=h(c);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(p("Scrollbars out of sync. Updating detector elements..."),a(u))}},r(c).onExpand=s,r(c).onShrink=s;var y=r(c).style;i(c,y.width,y.height)}else p("Aborting because element has been uninstalled")}function z(){if(p("finalizeDomMutation invoked."),r(c)){var e=r(c).style;b(c,e.width,e.height),j(c,e.width,e.height)}else p("Aborting because element has been uninstalled")}function D(){s(c)}function I(){var e;p("Installing..."),r(c).listeners=[],e=y(),r(c).startSize={width:e.width,height:e.height},p("Element start size",r(c).startSize),n.add(0,g),n.add(1,S),n.add(2,P),n.add(3,z),n.add(4,D)}s||(s=c,c=e,e=null),e=e||{},p("Making detectable..."),!function(e){return!function(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}(e)||null===window.getComputedStyle(e)}(c)?I():(p("Element is detached"),E(),p("Waiting until element is attached..."),r(c).onRendered=function(){p("Element is now attached"),I()})},addListener:function(e,t){if(!r(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");r(e).listeners.push(t)},uninstall:function(e){var t=r(e);t&&(t.onExpandScroll&&s(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&s(h(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&s(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:c}};function E(e){return Array.isArray(e)||void 0!==e.length}function S(e){if(Array.isArray(e))return e;var t=[];return h(e,(function(e){t.push(e)})),t}function P(e){return e&&1===e.nodeType}var z;function D(e,t,n){var r=e[t];return null==r&&void 0!==n?n:r}function I(){return"undefined"==typeof window?null:(z||(z=function(e){var t;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var n=y(),r=g({idGenerator:n,stateHandler:w});t=r}var o=e.reporter;o||(o=b(!1===o));var i=D(e,"batchProcessor",O({reporter:o})),a={};a.callOnAdd=!!D(e,"callOnAdd",!0),a.debug=!!D(e,"debug",!1);var c,l=v(t),u=p({stateHandler:w}),s=D(e,"strategy","object"),d=D(e,"important",!1),f={reporter:o,batchProcessor:i,stateHandler:w,idHandler:t,important:d};if("scroll"===s&&(m.isLegacyOpera()?(o.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),s="object"):m.isIE(9)&&(o.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),s="object")),"scroll"===s)c=j(f);else{if("object"!==s)throw Error("Invalid strategy name: "+s);c=x(f)}var z={};return{listenTo:function(e,n,r){function i(e){var t=l.get(e);h(t,(function(t){t(e)}))}function s(e,t,n){l.add(t,n),e&&n(t)}if(r||(r=n,n=e,e={}),!n)throw Error("At least one element required.");if(!r)throw Error("Listener required.");if(P(n))n=[n];else{if(!E(n))return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=S(n)}var f=0,p=D(e,"callOnAdd",a.callOnAdd),v=D(e,"onReady",(function(){})),y=D(e,"debug",a.debug);h(n,(function(e){w.getState(e)||(w.initState(e),t.set(e));var a=t.get(e);if(y&&o.log("Attaching listener to element",a,e),!u.isDetectable(e))return y&&o.log(a,"Not detectable."),u.isBusy(e)?(y&&o.log(a,"System busy making it detectable"),s(p,e,r),z[a]=z[a]||[],void z[a].push((function(){++f===n.length&&v()}))):(y&&o.log(a,"Making detectable..."),u.markBusy(e,!0),c.makeDetectable({debug:y,important:d},e,(function(e){if(y&&o.log(a,"onElementDetectable"),w.getState(e)){u.markAsDetectable(e),u.markBusy(e,!1),c.addListener(e,i),s(p,e,r);var t=w.getState(e);t&&t.startSize&&(t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||i(e)),z[a]&&h(z[a],(function(e){e()}))}else y&&o.log(a,"Element uninstalled before being detectable.");delete z[a],++f===n.length&&v()})));y&&o.log(a,"Already detecable, adding listener."),s(p,e,r),f++})),f===n.length&&v()},removeListener:l.removeListener,removeAllListeners:l.removeAllListeners,uninstall:function(e){if(!e)return o.error("At least one element is required.");if(P(e))e=[e];else{if(!E(e))return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=S(e)}h(e,(function(e){l.removeAllListeners(e),c.uninstall(e),w.cleanState(e)}))},initDocument:function(e){c.initDocument&&c.initDocument(e)}}}({strategy:"scroll"})),z)}function R(e,t){return!(!e||!t)&&(e===t||e.width===t.width&&e.height===t.height)}var M="undefined"==typeof window?t.useEffect:t.useLayoutEffect,T=["width","height","onResize","render","children"];function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(){return(A=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var H=r.default.memo((function(e){var n=e.width,o=e.height,i=e.onResize,a=e.render,c=e.children,l=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,T),u=t.useMemo((function(){return void 0!==n&&void 0!==o?{width:n,height:o}:null}),[n,o]),s=t.useState(),d=s[0],f=s[1],h=t.useRef(d),p=t.useRef(null),v={onResize:i},y=t.useRef(v);y.current=v;var g=t.useCallback((function(){var e=p.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};f((function(e){return R(e,t)?e:t}))}}),[]);M((function(){var e=h.current;h.current=d,d&&!R(e,d)&&y.current.onResize&&y.current.onResize(d)}),[d]),M((function(){if(u)f((function(e){return R(e,u)?e:u}));else{g();var e=I(),t=p.current;if(e&&t)return e.listenTo(t,g),function(){e.uninstall(t)}}}),[u,g]);var b=t.useMemo((function(){var e={width:"100%",height:"100%"};return l.style&&A(e,l.style),void 0!==n&&(e.width=n),void 0!==o&&(e.height=o),e}),[n,o,l.style]);l.style=b;var m=c;return d?a&&(m=a(d)):m=null,r.default.createElement("div",C(C({},l),{},{ref:p}),m)}));function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F={target:null,translation:null,velocity:{x:0,y:0},interval:0,startPoint:{x:0,y:0},movePoint:{x:0,y:0},moveTime:0,cancelled:!0},q=function(e,t){switch(t.type){case"reset":return F;case"track":return V(e,t);case"move":return B(e,t);case"start":return X(e);case"end":return Y(e);default:return e}},V=function(e,t){var n=t.payload,r=n.target,o=n.point,i=(new Date).getTime();return N(N({},e),{},{target:r,translation:null,velocity:{x:0,y:0},interval:0,startPoint:o,movePoint:o,moveTime:i})},B=function(e,t){var n=t.payload.point,r=e.startPoint,o=e.movePoint,i=e.moveTime,a=e.translation;if(!e.target)return e;var c=(new Date).getTime(),l=c-i,u={x:(n.x-o.x)/l,y:(n.y-o.y)/l};if(!a)return N(N({},e),{},{velocity:u,interval:l,movePoint:n,moveTime:c});var s={x:n.x-r.x,y:n.y-r.y};return N(N({},e),{},{translation:s,velocity:u,interval:l,movePoint:n,moveTime:c})},X=function(e){var t=e.movePoint;return!e.target||e.translation?e:N(N({},e),{},{translation:{x:0,y:0},startPoint:t})},Y=function(e){return e.target?N(N({},e),{},{target:null,translation:null,cancelled:!1}):e},G=["transformTranslate","userSelectNone"];var U={create:function(e){var t=e.transformTranslate,n=e.userSelectNone,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,G);return t&&function(e,t){t.transform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.WebkitTransform="translate3d("+e.x+"px, "+e.y+"px, 0)",t.msTransform="translate("+e.x+"px, "+e.y+"px)"}(t,r),n&&function(e){e.userSelect="none",e.WebkitUserSelect="none",e.MozUserSelect="none",e.msUserSelect="none"}(r),r}};function J(e,t,n,r){var o=function(){};return e&&e.addEventListener&&(e.addEventListener(t,n,r),o=function(){e.removeEventListener(t,n,r)}),o}var K=["disabled","shouldStart","onStart","onMove","onEnd","onCancel","render","children"];function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach((function(t){$(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(){return(ee=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var te="undefined"!=typeof window&&"ontouchstart"in window,ne=r.default.memo((function(e){var n=e.disabled,o=e.shouldStart,i=e.onStart,a=e.onMove,c=e.onEnd,l=e.onCancel,u=e.render,s=e.children,d=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,K),f=t.useReducer(q,F),h=f[0],p=f[1],v=t.useRef(h),y=t.useRef(null),g={shouldStart:o,onStart:i,onMove:a,onEnd:c,onCancel:l},b=t.useRef(g);b.current=g;var m=!!h.translation;M((function(){var e=v.current;if(v.current=h,h.target&&!h.translation){var t={x:h.movePoint.x-h.startPoint.x,y:h.movePoint.y-h.startPoint.y};if(Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))>0)b.current.shouldStart?b.current.shouldStart({target:h.target,translation:t,velocity:h.velocity,interval:h.interval})&&p({type:"start"}):p({type:"start"})}if(e.translation!==h.translation)if(h.translation){var n={target:h.target,translation:h.translation,velocity:h.velocity,interval:h.interval};e.translation?b.current.onMove&&b.current.onMove(n):b.current.onStart&&b.current.onStart(n)}else if(e.translation){var r={target:e.target,translation:e.translation,velocity:e.velocity,interval:e.interval};h.cancelled?b.current.onCancel&&b.current.onCancel(r):b.current.onEnd&&b.current.onEnd(r)}}),[h]),M((function(){if(n)h.target&&p({type:"reset"});else{var e=y.current;if(e){var t=function(e,t){p({type:"track",payload:{target:e,point:t}})},r=function(e){p({type:"move",payload:{point:e}})},o=function(){p({type:"end",payload:null})};if(h.target){if(te){var i=function(e){m&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),o()},a=J(e,"touchmove",(function(e){if(m&&e.cancelable&&(e.preventDefault(),e.stopImmediatePropagation()),1===e.touches.length){var t=e.touches[0];r({x:t.pageX,y:t.pageY})}else o()})),c=J(e,"touchend",i),l=J(e,"touchcancel",i);return function(){a(),c(),l()}}var u=document.body,s=J(u,"mousemove",(function(e){m&&(e.preventDefault(),e.stopImmediatePropagation()),void 0===e.buttons||1===e.buttons?r({x:e.pageX,y:e.pageY}):o()})),d=J(u,"mouseup",(function(e){m&&(e.preventDefault(),e.stopImmediatePropagation()),o()}));return function(){s(),d()}}if(te){var f=J(e,"touchstart",(function(e){if(1===e.touches.length){var n=e.touches[0];t(n.target,{x:n.pageX,y:n.pageY})}}));return function(){f()}}var v=J(e,"mousedown",(function(e){!e.target||void 0!==e.buttons&&1!==e.buttons||t(e.target,{x:e.pageX,y:e.pageY})}));return function(){v()}}}}),[n,h.target,m]);var O=t.useMemo((function(){var e={};return m&&ee(e,U.create({touchAction:"none",pointerEvents:"none",userSelectNone:!0})),d.style&&ee(e,d.style),e}),[m,d.style]);return d.style=O,r.default.createElement("div",Z(Z({},d),{},{ref:y}),u?u(h):s)}));function re(e){function t(t){return Math.max(-2.5,Math.min(e[t],2.5))}var n={x:t("x"),y:t("y")};return n.x===e.x&&n.y===e.y?e:n}function oe(e,t,n,r,o,i){function a(a){var c="x"===a?["width","left","right"]:["height","top","bottom"],l=c[0],u=t[l],s=e[a];if(-1===o[a])return s;var d=Math.min(u-(r[c[1]]+n[l]+r[c[2]]),0);return i&&u>0&&(d=u*Math.ceil(d/u)),Math.max(d,Math.min(s,0))}var c={x:a("x"),y:a("y")};return c.x===e.x&&c.y===e.y?e:c}function ie(e,t,n,r,o){var i,a,c,l="number"==typeof o?(i=o,0===(c=Math.sqrt((a=t).x*a.x+a.y*a.y))?{x:0,y:0}:{x:i*(a.x/c),y:i*(a.y/c)}):o;function u(o){var i="x"===o?"width":"height",a=e[o],c=t[o];if(r&&n[i]>0){var u=a/n[i];a=n[i]*(u=c>.5?Math.ceil(u):-.5>c?Math.floor(u):Math.round(u))}else l[o]&&(a+=c*(c/l[o])/2);return a}return{x:u("x"),y:u("y")}}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ue=.025,se={size:{width:0,height:0},contentSize:{width:0,height:0},contentInset:{top:0,right:0,bottom:0,left:0},contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},drag:null,deceleration:null,bound:{x:1,y:1},pagingEnabled:!1,directionalLockEnabled:!1,pannable:F},de=function(e,t){switch(t.type){case"setState":return he(fe(e,t));case"dragStart":return pe(e);case"dragMove":return ve(e);case"dragEnd":return ye(e);case"dragCancel":return ge(e);case"decelerate":return he(be(e));case"scrollTo":return he(me(e,t));default:return e}},fe=function(e,t){return ce(ce({},e),t.payload)},he=function(e){var t=e.size,n=e.contentSize,r=e.contentInset,o=e.contentOffset,i=e.contentVelocity,a=e.drag,c=e.deceleration,l=e.pagingEnabled,u=e.bound,s=ue;if(c){var d=c.endOffset,f=oe(o,t,n,r,u,l);if(d!==oe(d,t,n,r,u,l)&&o!==f){var h=o,p=re(i);return 0===u.x&&(p=ce(ce({},p),{},{x:0}),h=ce(ce({},h),{},{x:f.x})),0===u.y&&(p=ce(ce({},p),{},{y:0}),h=ce(ce({},h),{},{y:f.y})),c.rate!==s&&(d=ie(h,p,t,l,s)),d=oe(d,t,n,r,u,l),ce(ce({},e),{},{contentOffset:h,contentVelocity:p,drag:null,deceleration:xe(d,s,h,p)})}}else if(!a){var v=ie(o,i,t,l,s);if((v=oe(v,t,n,r,u,l)).x!==o.x||v.y!==o.y)return ce(ce({},e),{},{drag:null,deceleration:xe(v,s,o,i)})}return e},pe=function(e){var t=e.contentOffset,n=e.pannable.velocity;if(!n)return e;var r={x:1,y:1};e.directionalLockEnabled&&(Math.abs(n.x)>Math.abs(n.y)?r.y=0:r.x=0);var o={x:r.x*n.x,y:r.y*n.y};return ce(ce({},e),{},{contentVelocity:o,drag:{direction:r,startOffset:t},deceleration:null})},ve=function(e){var t=e.contentOffset,n=e.drag,r=e.pannable,o=r.translation,i=r.interval;if(!n||!o||!i)return e;var a={x:n.startOffset.x+n.direction.x*o.x,y:n.startOffset.y+n.direction.y*o.y},c={x:((a=function(e,t,n,r,o){function i(i){var a="x"===i?["width","height","left","right"]:["height","width","top","bottom"],c=a[0],l=a[1],u=e[i],s=o[i];if(-1===s)return u;var d=Math.min(t[c]-(r[a[2]]+n[c]+r[a[3]]),0),f=Math.min(t[c],t[l])/2;return u>0?0===s?0:f*(1-f/(f+u)):d>u?0===s?d:d-f*(1-f/(f-u+d)):u}var a={x:i("x"),y:i("y")};return a.x===e.x&&a.y===e.y?e:a}(a,e.size,e.contentSize,e.contentInset,e.bound)).x-t.x)/i,y:(a.y-t.y)/i};return ce(ce({},e),{},{contentOffset:a,contentVelocity:c})},ye=function(e){var t=e.contentOffset,n=e.size,r=e.pagingEnabled,o=r?ue:.0025,i=re(e.contentVelocity),a=ie(t,i,n,r,o);return ce(ce({},e),{},{contentVelocity:i,drag:null,deceleration:xe(a,o,t,i)})},ge=function(e){var t=e.contentOffset,n=e.drag,r=e.size,o=e.pagingEnabled;if(!n)return e;var i=re(e.contentVelocity),a=ie(n.startOffset,{x:0,y:0},r,o,.025);return ce(ce({},e),{},{contentVelocity:i,drag:null,deceleration:xe(a,.025,t,i)})},be=function(e){var t=e.deceleration;if(!t)return e;var n=we(t),r=n.offset,o=n.velocity,i=n.didEnd;return ce(ce({},e),{},{contentOffset:r,contentVelocity:o,drag:null,deceleration:i?null:t})},me=function(e,t){var n=e.contentOffset,r=e.size,o=t.payload,i=o.offset,a=void 0===i?{x:0,y:0}:i,c=o.point,l=o.align,u=void 0===l?0:l,s=o.animated,d=o.rect,f=void 0===s?-1:s;"boolean"==typeof f&&(f=f?1:-1),e.drag&&(f=-1),d||(d=c?ce(ce({},c),{},{width:0,height:0}):{x:-a.x,y:-a.y,width:0,height:0});var h=function(e,t,n,r){var o="object"==typeof t?t:{x:t,y:t};function i(t){var i="x"===t?"width":"height",a=-e[t],c=o[t],l=r[i]-e[i];if("auto"===c){var u=0>l?-1:1;a+=u*Math.max(0,Math.min(u*(n[t]-a),u*l))}else"start"===c?c=0:"center"===c?c=.5:"end"===c&&(c=1),a+=c*l;return a}return{x:i("x"),y:i("y")}}(d,u,n,r);return Oe(e,{type:"setContentOffset",payload:{offset:h,animated:f}})},Oe=function(e,t){var n=e.contentOffset,r=e.contentVelocity,o=e.drag,i=e.deceleration,a=e.size,c=e.pagingEnabled,l=t.payload,u=l.offset,s=l.animated;if(1===s){var d=ie(u,{x:0,y:0},a,c,ue);return ce(ce({},e),{},{drag:null,deceleration:xe(d,ue,n,r)})}if(o)return ce(ce({},e),{},{contentOffset:u,drag:ce(ce({},o),{},{startOffset:{x:o.startOffset.x+u.x-n.x,y:o.startOffset.y+u.y-n.y}}),deceleration:null});if(i){if(0===s)return ce(ce({},e),{},{contentOffset:u,drag:null,deceleration:null});var f=ie({x:i.endOffset.x+u.x-n.x,y:i.endOffset.y+u.y-n.y},{x:0,y:0},a,c,i.rate);return ce(ce({},e),{},{contentOffset:u,drag:null,deceleration:xe(f,i.rate,u,r)})}return ce(ce({},e),{},{contentOffset:u})};function we(e){var t=e.points,n=e.duration,r=e.startTime,o=e.endOffset;function i(e,r){var o=t[e],i=o[0],a=o[1],c=o[2],l=o[3];return[i-3*(i-a)*r+3*(i-2*a+c)*Math.pow(r,2)-(i-3*a+3*c-l)*Math.pow(r,3),(-3*(i-a)+6*(i-2*a+c)*r-3*(i-3*a+3*c-l)*Math.pow(r,2))/n]}var a=(new Date).getTime(),c=1;if(n>0&&(c=(a-r)/n),0>c||c>=1)return{offset:o,velocity:{x:0,y:0},didEnd:!0};var l=i("x",c),u=l[0],s=l[1],d=i("y",c);return{offset:{x:u,y:d[0]},velocity:{x:s,y:d[1]},didEnd:!1}}function xe(e,t,n,r){var o=(new Date).getTime(),i=0;if(0>=t)throw Error("Rate needs more than 0.");var a,c={x:e.x-n.x,y:e.y-n.y},l=Math.sqrt(Math.pow(c.x,2)+Math.pow(c.y,2));if(l){var u=Math.sqrt(Math.pow(a=(r.x*c.x+r.y*c.y)/l,2)/2+t*l),s=(u-a)/t;0>s&&(u=a,s=0),i=s+u/t}else a=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),i=(Math.sqrt(2)+1)*a/t;return{endOffset:e,rate:t,duration:i,startTime:o,points:{x:[n.x,n.x+r.x*(i/3),e.x,e.x],y:[n.y,n.y+r.y*(i/3),e.y,e.y]}}}var je,Ee,Se=r.default.createContext({visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}});if("undefined"!=typeof window){je=window.requestAnimationFrame,Ee=window.cancelAnimationFrame;for(var Pe=["ms","moz","webkit","o"],ze=window,De=0;!je&&4>De;)je=ze[Pe[De]+"RequestAnimationFrame"],Ee=ze[Pe[De]+"CancelAnimationFrame"]||ze[Pe[De]+"CancelRequestAnimationFrame"],De++;if(!je){var Ie=0;je=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-Ie)),r=window.setTimeout((function(){e(t+n)}),n);return Ie=t+n,r},Ee=function(e){window.clearTimeout(e)}}}var Re=r.default.memo((function(e){var n=e.pannable,o=e.size,i=e.bound,a=e.contentInset,c=e.pagingEnabled,l=e.directionalLockEnabled,u=e.onScroll,s=e.onStartDragging,d=e.onEndDragging,f=e.onStartDecelerating,h=e.onEndDecelerating,p=e.onResizeContent,v=e.renderBackground,y=e.renderOverlay,g=e.render,b=t.useReducer(de,se),m=b[0],O=b[1],w=t.useRef(m),x={onScroll:u,onStartDragging:s,onEndDragging:d,onStartDecelerating:f,onEndDecelerating:h,onResizeContent:p},j=t.useRef(x);j.current=x;var E=t.useRef({scrollTo:function(e){O({type:"scrollTo",payload:e})}}),S=t.useCallback((function(e){O({type:"setState",payload:{contentSize:e}})}),[]);M((function(){O({type:"setState",payload:{pannable:n}})}),[n]),M((function(){O({type:"setState",payload:{size:o,bound:i,contentInset:a,pagingEnabled:c,directionalLockEnabled:l}})}),[o,i,a,c,l]),M((function(){var e=w.current;w.current=m,e.pannable.translation!==m.pannable.translation&&O(m.pannable.translation?e.pannable.translation?{type:"dragMove"}:{type:"dragStart"}:m.pannable.cancelled?{type:"dragCancel"}:{type:"dragEnd"}),e.contentSize!==m.contentSize&&j.current.onResizeContent&&j.current.onResizeContent(m.contentSize);var t={size:m.size,contentSize:m.contentSize,contentInset:m.contentInset,contentOffset:m.contentOffset,contentVelocity:m.contentVelocity,dragging:!!m.drag,decelerating:!!m.deceleration};if(e.contentOffset!==m.contentOffset&&j.current.onScroll&&j.current.onScroll(t),e.drag!==m.drag&&(e.drag?m.drag||j.current.onEndDragging&&j.current.onEndDragging(t):j.current.onStartDragging&&j.current.onStartDragging(t)),e.deceleration!==m.deceleration&&(e.deceleration?m.deceleration||j.current.onEndDecelerating&&j.current.onEndDecelerating(t):j.current.onStartDecelerating&&j.current.onStartDecelerating(t)),m.deceleration){var n=je((function(){O({type:"decelerate"})}));return function(){Ee(n)}}}),[m]);var P=v?v(m,E.current):null,z=y?y(m,E.current):null,D=g(m,E.current),I=t.useMemo((function(){return U.create({position:"absolute",left:m.contentInset.left,top:m.contentInset.top,width:m.contentSize.width,height:m.contentSize.height,transformTranslate:m.contentOffset,willChange:"transform",overflow:"hidden"})}),[m.contentOffset,m.contentSize,m.contentInset]),R=t.useMemo((function(){return{visibleRect:{x:-m.contentOffset.x,y:-m.contentOffset.y,width:m.size.width,height:m.size.height},onResize:S}}),[m.contentOffset,m.size,S]);return r.default.createElement(r.default.Fragment,null,P,r.default.createElement("div",{style:I},r.default.createElement(Se.Provider,{value:R},D)),z)})),Me=["width","height","boundX","boundY","contentInsetTop","contentInsetRight","contentInsetBottom","contentInsetLeft","pagingEnabled","directionalLockEnabled","onScroll","onStartDragging","onEndDragging","onStartDecelerating","onEndDecelerating","onResizeContent","renderBackground","renderOverlay","render","scrollTo","children"];function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ke(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach((function(t){Ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(){return(Le=Object.assign||function(e){for(var t=1;arguments.length>t;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)}var Ae=r.default.memo((function(e){var n=e.width,o=e.height,i=e.boundX,a=void 0===i?1:i,c=e.boundY,l=void 0===c?1:c,u=e.contentInsetTop,s=void 0===u?0:u,d=e.contentInsetRight,f=void 0===d?0:d,h=e.contentInsetBottom,p=void 0===h?0:h,v=e.contentInsetLeft,y=void 0===v?0:v,g=e.pagingEnabled,b=void 0!==g&&g,m=e.directionalLockEnabled,O=void 0!==m&&m,w=e.onScroll,x=e.onStartDragging,j=e.onEndDragging,E=e.onStartDecelerating,S=e.onEndDecelerating,P=e.onResizeContent,z=e.renderBackground,D=e.renderOverlay,I=e.render,R=e.scrollTo,T=e.children,k=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,Me),C=t.useMemo((function(){return{width:n,height:o}}),[n,o]),L=t.useMemo((function(){return{x:a,y:l}}),[a,l]),A=t.useMemo((function(){return{top:s,right:f,bottom:p,left:y}}),[s,f,p,y]),H=t.useRef(),W=t.useRef(),N={shouldStart:k.shouldStart},_=t.useRef(N);_.current=N;var F=t.useCallback((function(e){if(_.current.shouldStart)return _.current.shouldStart(e);var t=H.current;return!!t&&!!function(e,t,n,r,o){var i=Math.abs(e.x)>Math.abs(e.y)?["x","width","left","right"]:["y","height","top","bottom"],a=i[1],c=i[2],l=i[3];if(0!==o[i[0]])return!0;return r[c]+n[a]+r[l]>t[a]}(e.velocity,t.size,t.contentSize,t.contentInset,t.bound)}),[]);M((function(){if(R){var e=W.current;e&&e.scrollTo(R)}}),[R]);var q=t.useMemo((function(){var e={overflow:"hidden",position:"relative",width:C.width,height:C.height};return k.style&&Le(e,k.style),e}),[C,k.style]);return k.style=q,k.shouldStart=F,r.default.createElement(ne,ke(ke({},k),{},{render:function(e){return r.default.createElement(Re,{pannable:e,size:C,bound:L,contentInset:A,pagingEnabled:b,directionalLockEnabled:O,onScroll:w,onStartDragging:x,onEndDragging:j,onStartDecelerating:E,onEndDecelerating:S,onResizeContent:P,renderBackground:z,renderOverlay:D,render:function(e,t){return H.current=e,W.current=t,I?I(e,t):T}})}}))}));var He=["width","height","autoResizing","render","children"];function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ne(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?We(Object(n),!0).forEach((function(t){_e(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(){return(Fe=Object.assign||function(e){for(var t=1;arguments.length>t;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 qe(){}var Ve={position:"absolute",top:0,left:0},Be=r.default.memo((function(e){var n=e.width,o=e.height,i=e.autoResizing,a=void 0!==i&&i,c=e.render,l=e.children,u=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,He),s=t.useContext(Se),d=null!=n?n:s.width,f=null!=o?o:s.height,h=t.useMemo((function(){return void 0!==d&&void 0!==f?{width:d,height:f}:null}),[d,f]),p=t.useState(null),v=p[0],y=p[1],g=t.useRef(v),b=t.useRef(null),m={onResize:s.onResize},O=t.useRef(m);O.current=m;var w=t.useCallback((function(){var e=b.current;if(e){var t={width:e.offsetWidth,height:e.offsetHeight};y((function(e){return R(e,t)?e:t}))}}),[]);M((function(){var e=g.current;g.current=v,v&&!R(e,v)&&O.current.onResize(v)}),[v]),M((function(){if(h)y((function(e){return R(e,h)?e:h}));else if(w(),a){var e=I(),t=b.current;if(e&&t)return e.listenTo(t,w),function(){e.uninstall(t)}}}),[h,a,w]);var x=t.useMemo((function(){var e={position:"absolute"};return void 0!==d&&(e.width=d),void 0!==f&&(e.height=f),e}),[d,f]),j=l;c&&(j=c()),h||(j=r.default.createElement("div",{style:Ve},r.default.createElement("div",{style:x,ref:b},j)));var E=t.useMemo((function(){var e={position:"relative"};return v&&(e.width=v.width,e.height=v.height),u.style&&Fe(e,u.style),e}),[v,u.style]);return u.style=E,r.default.createElement("div",Ne({},u),r.default.createElement(Se.Provider,{value:Ne(Ne({},s),{},{width:d,height:f,onResize:qe})},j))}));function Xe(e,t){function n(n){var r,o="x"===n?"width":"height";return(r={})[n]=t[n]-e[n],r[o]=t[o],r}var r=n("x"),o=r.x,i=r.width,a=n("y");return{x:o,y:a.y,width:i,height:a.height}}function Ye(e,t){if(!t)return!0;function n(n){var r="x"===n?"width":"height";return e[n]+e[r]>=t[n]-t[r]/4&&t[n]+5*t[r]/4>=e[n]}return n("x")&&n("y")}var Ge=["itemWidth","itemHeight","itemCount","renderItem","direction","rowSpacing","columnSpacing","width","height","render","children"];function Ue(){return(Ue=Object.assign||function(e){for(var t=1;arguments.length>t;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 Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ke(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(n),!0).forEach((function(t){Qe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(){}var $e=r.default.memo((function(e){return null})),et=r.default.memo((function(e){var n=e.itemWidth,o=e.itemHeight,i=e.itemCount,a=e.renderItem,c=e.direction,l=void 0===c?"y":c,u=e.rowSpacing,s=void 0===u?0:u,d=e.columnSpacing,f=void 0===d?0:d,h=e.width,p=e.height,v=e.render,y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,Ge),g=t.useContext(Se),b=null!=h?h:g.width,m=null!=p?p:g.height,O=t.useMemo((function(){return function(e){var t,n,r=e.spacing,o=e.itemSize,i=e.itemCount,a="x"===e.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],c=a[0],l=a[1],u=a[2],s=a[3],d=a[4],f=a[5],h=e.size[u],p=0,v=0,y=0,g=[];void 0===h?(y=i,0===o[u]?h=0:(h=i*o[u],i>1&&(h+=(i-1)*r[f]))):0===o[u]?y=i:(y=1,h>o[u]&&(y+=Math.floor((h-o[u])/(o[u]+r[f]))));y>0&&(v=Math.ceil(i/y));for(var b=0;v>b;b++){b>0&&(p+=r[d]);for(var m=0;y>m;m++){var O,w,x=m+b*y,j=0;if(y>1&&(j+=Math.round(m*((h-o[u])/(y-1)))),x>=i)break;g.push(((w={rect:(O={},O[c]=j,O[l]=p,O[u]=o[u],O[s]=o[s],O)})[d+"Index"]=b,w[f+"Index"]=m,w.itemIndex=x,w))}p+=o[s]}return{size:(t={},t[u]=h,t[s]=p,t),count:(n={},n[d]=v,n[f]=y,n),layoutList:g}}({direction:l,size:{width:b,height:m},spacing:{row:s,column:f},itemSize:{width:n,height:o},itemCount:i})}),[l,b,m,s,f,n,o,i]),w=t.useRef(),x={onResize:g.onResize},j=t.useRef(x);j.current=x,M((function(){var e=w.current;w.current=O.size,R(e,O.size)||j.current.onResize(O.size)}),[O.size]);var E=O.layoutList.map((function(e){return function(e){var t=e.rect,i=e.itemIndex,c=e.visibleRect,l=e.needsRender,u=e.Item,s=!1,d=a(e),f="GridContent_"+i;if(r.default.isValidElement(d)&&d.type===u){d.key&&(f=d.key);var h=d.props;void 0!==h.forceRender&&(s=h.forceRender),d=d.props.children}if(!l&&!s)return null;var p={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height};return r.default.createElement(Se.Provider,{key:f,value:Ke(Ke({},g),{},{width:n,height:o,visibleRect:c,onResize:Ze})},r.default.createElement("div",{style:p},d))}(Ke(Ke({},e),{},{visibleRect:Xe(e.rect,g.visibleRect),needsRender:Ye(e.rect,g.visibleRect),Item:$e}))}));v&&v(O);var S=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return O.size&&(e.width=O.size.width,e.height=O.size.height),y.style&&Ue(e,y.style),e}),[O.size,y.style]);return y.style=S,r.default.createElement("div",Ke({},y),E)}));var tt=["itemCount","renderItem","direction","width","height","spacing","estimatedItemWidth","estimatedItemHeight","render","children"];function nt(){return(nt=Object.assign||function(e){for(var t=1;arguments.length>t;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 rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ot(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var at=r.default.memo((function(e){return null})),ct=r.default.memo((function(e){var n=e.itemCount,o=e.renderItem,i=e.direction,a=void 0===i?"y":i,c=e.width,l=e.height,u=e.spacing,s=void 0===u?0:u,d=e.estimatedItemWidth,f=void 0===d?0:d,h=e.estimatedItemHeight,p=void 0===h?0:h,v=e.render,y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,tt),g=t.useContext(Se),b=null!=c?c:g.width,m=null!=l?l:g.height,O=t.useState([]),w=O[0],x=O[1],j=t.useState({}),E=j[0],S=j[1],P=t.useMemo((function(){return function(e,t,n){var r,o,i,a=e.size,c=e.spacing,l=e.estimatedItemSize,u=e.itemCount,s="x"===e.direction?["y","x","height","width"]:["x","y","width","height"],d=s[0],f=s[1],h=s[2],p=s[3],v=0,y=0,g=[],b={};void 0!==a[h]&&(b[h]=a[h]);for(var m=0;u>m;m++){var O,w=t[m]||null,x=w&&n[w]||null,j=((O={})[d]=0,O[f]=y,O);if(x)nt(j,x);else{var E,S=l[h],P=l[p];j[h]=null!==(E=b[h])&&void 0!==E?E:"function"==typeof S?S(m):S,j[p]="function"==typeof P?P(m):P}g.push({rect:j,itemIndex:m,itemHash:w,itemSize:x}),j[p]>0&&(y+=j[p],u-1>m&&(y+=c)),j[h]>v&&(v=j[h])}return{size:(i={},i[h]=null!==(r=b[h])&&void 0!==r?r:v,i[p]=null!==(o=b[p])&&void 0!==o?o:y,i),layoutList:g}}({direction:a,size:{width:b,height:m},spacing:s,estimatedItemSize:{width:f,height:p},itemCount:n},w,E)}),[b,m,a,s,f,p,n,w,E]),z=t.useRef(),D={onResize:g.onResize},I=t.useRef(D);I.current=D,M((function(){var e=z.current;z.current=P.size,R(e,P.size)||I.current.onResize(P.size)}),[P.size]);var T=[];var k=P.layoutList.map((function(e){return function(e){var t=e.rect,n=e.itemIndex,i=e.itemSize,c=e.visibleRect,l=e.needsRender,u=e.Item,s=!1,d=o(e),f="ListContent_"+n,h=null;if(r.default.isValidElement(d)&&d.type===u){d.key&&(f=d.key);var p=d.props;void 0!==p.forceRender&&(s=p.forceRender),void 0!==p.hash&&(h=p.hash),d=d.props.children}null===h&&(h=f);var v=!l&&!s;if(i||-1===T.indexOf(h)||(v=!0),T[n]=h,v)return null;var y={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height},b=ot({},g);return b.visibleRect=c,b.onResize=function(e){S((function(t){var n;return h?R(t[h],e)?t:ot(ot({},t),{},((n={})[h]=e,n)):t}))},"x"===a?b.height=P.size.height:b.width=P.size.width,r.default.createElement(Se.Provider,{key:f,value:b},r.default.createElement("div",{style:y},d))}(ot(ot({},e),{},{visibleRect:Xe(e.rect,g.visibleRect),needsRender:Ye(e.rect,g.visibleRect),Item:at}))}));(function(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(w,T)||x(T),v&&v(P);var C=t.useMemo((function(){var e={position:"relative",overflow:"hidden"};return P.size&&(e.width=P.size.width,e.height=P.size.height),y.style&&nt(e,y.style),e}),[P.size,y.style]);return y.style=C,r.default.createElement("div",ot({},y),k)}));function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ut(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(n),!0).forEach((function(t){st(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function st(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dt={loopCount:2,loopOffset:0,loopWidth:0,direction:"x",pad:se,scrollTo:null},ft=function(e,t){switch(t.type){case"setState":return pt(ht(e,t));default:return e}},ht=function(e,t){return ut(ut({},e),t.payload)},pt=function(e){var t=e.loopCount,n=e.loopWidth,r=e.loopOffset,o=e.direction,i=e.pad,a=i.size,c=i.contentOffset,l="y"===o?"height":"width",u=i.contentSize[l]/t,s=2;if(0!==u&&(s+=Math.floor(a[l]/u)),n!==u||t!==s)return ut(ut({},e),{},{loopCount:s,loopWidth:u});var d=function(e,t,n,r,o){var i;if(1===r||0===n)return[e,0];var a="y"===o?["height","y","x"]:["width","x","y"],c=a[1],l=a[2],u=t[a[0]],s=(u-n*(r-1))/2,d=(u-n*(r+1))/2,f=e[c],h=0;if(f>=d&&s>=f)return[e,0];d>f?h=Math.floor((s-f)/n):f>s&&(h=-Math.floor((f-d)/n));return[(i={},i[c]=f+=n*h,i[l]=e[l],i),h]}(c,a,n,t,o),f=d[0],h=d[1];return c!==f?ut(ut({},e),{},{loopOffset:r+h,scrollTo:{offset:f,animated:!1}}):e};var vt=r.default.memo((function(e){var n=e.pad,o=e.padMethods,i=e.direction,a=e.render,c=t.useReducer(ft,dt),l=c[0],u=c[1],s={scrollTo:o.scrollTo},d=t.useRef(s);return d.current=s,M((function(){u({type:"setState",payload:{pad:n}})}),[n]),M((function(){u({type:"setState",payload:{direction:i}})}),[i]),M((function(){l.scrollTo&&d.current.scrollTo(l.scrollTo)}),[l.scrollTo]),r.default.createElement(ct,{direction:i,width:l.pad.size.width,height:l.pad.size.height,itemCount:l.loopCount,renderItem:function(e){return r.default.createElement(e.Item,{key:e.itemIndex+l.loopOffset,hash:"Loop",forceRender:!0},a(l))}})})),yt=["direction","render","children"];function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(n),!0).forEach((function(t){mt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ot=r.default.memo((function(e){var t,n,o=e.direction,i=void 0===o?"x":o,a=e.render,c=e.children,l=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,yt),u=l.directionalLockEnabled;(l.directionalLockEnabled=void 0===u||u,"x"===i)?l.boundX=null!==(t=l.boundX)&&void 0!==t?t:-1:l.boundY=null!==(n=l.boundY)&&void 0!==n?n:-1;return r.default.createElement(Ae,bt(bt({},l),{},{render:function(e,t){return r.default.createElement(vt,{pad:e,padMethods:t,direction:i,render:function(e){return a?a(e):c}})}}))}));function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(n),!0).forEach((function(t){jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Et={pad:se,activeIndex:0,direction:"x",loop:!0,itemCount:0,scrollTo:null,playing:!1},St=function(e,t){switch(t.type){case"setState":return zt(Pt(e,t));case"scrollToIndex":return Dt(e,t);case"next":return It(e,t);case"play":return Rt(e,t);default:return e}},Pt=function(e,t){return xt(xt({},e),t.payload)},zt=function(e,t){var n=e.activeIndex,r=e.pad,o=function(e,t,n,r){var o="y"===r?["height","y"]:["width","x"],i=o[1],a=t[o[0]],c=0;a>0&&(c=Math.round(-e[i]/a));return c%n}(r.contentOffset,r.size,e.itemCount,e.direction);return n===o?e:xt(xt({},e),{},{activeIndex:o})},Dt=function(e,t){var n=e.activeIndex,r=e.itemCount,o=e.direction,i=e.loop,a=e.pad,c=a.contentOffset,l=a.size,u=t.payload.animated,s=t.payload.index;"function"==typeof s&&(s=s({activeIndex:n,itemCount:r})),i||(s=Math.max(0,Math.min(s,r-1)));var d=function(e,t,n,r){var o,i="y"===r?["height","y","x"]:["width","x","y"],a=i[1],c=i[2];return(o={})[a]=t[a]-e*n[i[0]],o[c]=t[c],o}(s-n,c,l,o);return xt(xt({},e),{},{scrollTo:{offset:d,animated:u}})},It=function(e,t){var n=e.activeIndex+1;return e.loop||(n%=e.itemCount),Dt(e,{type:"scrollToIndex",payload:{index:n,animated:t.payload.animated}})},Rt=function(e,t){return xt(xt({},e),{},{playing:t.payload})};var Mt=r.default.memo((function(e){var n=e.pad,o=e.padMethods,i=e.direction,a=e.loop,c=e.autoplayEnabled,l=e.autoplayInterval,u=e.itemCount,s=e.onActiveIndexChange,d=e.render,f=t.useReducer(St,Et),h=f[0],p=f[1],v=t.useRef(h),y={onActiveIndexChange:s,scrollTo:o.scrollTo},g=t.useRef(y);g.current=y;var b=t.useRef({scrollToIndex:function(e){p({type:"scrollToIndex",payload:e})},play:function(e){p({type:"play",payload:e})}});return M((function(){p({type:"setState",payload:{pad:n}})}),[n]),M((function(){p({type:"setState",payload:{direction:i,loop:a,itemCount:u}})}),[i,a,u]),M((function(){var e=v.current;(v.current=h,e.activeIndex!==h.activeIndex)&&(g.current.onActiveIndexChange&&g.current.onActiveIndexChange({activeIndex:h.activeIndex,itemCount:h.itemCount}))}),[h]),M((function(){h.scrollTo&&g.current.scrollTo(h.scrollTo)}),[h.scrollTo]),M((function(){if(h.playing){var e=setInterval((function(){p({type:"next",payload:{animated:!0}})}),l);return function(){clearInterval(e)}}}),[h.playing,l]),M((function(){b.current.play(c&&!h.pad.drag)}),[c,h.pad.drag]),r.default.createElement(r.default.Fragment,null,d(h,b.current))})),Tt=["itemCount","renderItem","direction","loop","autoplayEnabled","autoplayInterval","onActiveIndexChange","scrollToIndex","render","children"];function kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kt(Object(n),!0).forEach((function(t){Lt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var At=r.default.memo((function(e){var n=e.itemCount,o=e.renderItem,i=e.direction,a=void 0===i?"x":i,c=e.loop,l=void 0===c||c,u=e.autoplayEnabled,s=void 0===u||u,d=e.autoplayInterval,f=void 0===d?5e3:d,h=e.onActiveIndexChange,p=e.scrollToIndex,v=e.render,y=e.children,g=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,Tt),b=g.width,m=g.height,O=g.pagingEnabled,w=void 0===O||O,x=g.directionalLockEnabled,j=void 0===x||x,E=g.renderOverlay,S=g.onMouseEnter,P=g.onMouseLeave,z=t.useRef(),D={onMouseEnter:S,onMouseLeave:P},I=t.useRef(D);I.current=D;var R,T,k=t.useCallback((function(e){var t=z.current;t&&t.play(!1),I.current.onMouseEnter&&I.current.onMouseEnter(e)}),[]),C=t.useCallback((function(e){var t=z.current;t&&t.play(!0),I.current.onMouseLeave&&I.current.onMouseLeave(e)}),[]);(M((function(){if(p){var e=z.current;e&&e.scrollToIndex(p)}}),[p]),g.pagingEnabled=w,g.directionalLockEnabled=j,s&&(g.onMouseEnter=k,g.onMouseLeave=C),"x"===a)?g.boundY=null!==(R=g.boundY)&&void 0!==R?R:0:g.boundX=null!==(T=g.boundX)&&void 0!==T?T:0;g.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(Mt,{pad:e,padMethods:t,direction:a,loop:l,autoplayEnabled:s,autoplayInterval:f,itemCount:n,onActiveIndexChange:h,render:function(e,t){return z.current=t,v?v(e,t):y}}),E?E(e,t):null)};var L=r.default.createElement(et,{width:b,height:m,itemWidth:b,itemHeight:m,direction:a,itemCount:n,renderItem:o});return l?r.default.createElement(Ot,Ct({direction:a},g),L):r.default.createElement(Ae,Ct({},g),L)}));function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(n),!0).forEach((function(t){Nt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _t={pad:se,scroll:null,scrollTo:null},Ft=function(e,t){switch(t.type){case"setState":return qt(e,t);case"scrollTo":return Vt(e,t);case"scrollEnd":return Bt(e);case"scrollRecalculate":return Xt(e,t);default:return e}},qt=function(e,t){return Wt(Wt({},e),t.payload)},Vt=function(e,t){var n=t.payload,r=n.params,o=n.layout,i=Wt({},r),a=r.index,c=r.reverseRect;return void 0!==a?i.rect=function(e,t){var n=t.box,r=t.body,o={x:0,y:0,width:0,height:0};n&&n.layoutList[1]&&(o=n.layoutList[1].rect);if(r){var i=r.layoutList[e=Math.max(0,Math.min(e,r.layoutList.length-1))];o={x:o.x+i.rect.x,y:o.y+i.rect.y,width:i.rect.width,height:i.rect.height}}return o}(a,o):void 0!==c&&(i.rect=function(e,t){var n=t.box,r={x:0,y:0,width:e.width,height:e.height};n&&(r.x=n.size.width-r.width-e.x,r.y=n.size.height-r.height-e.y);return r}(c,o)),Wt(Wt({},e),{},{scrollTo:i,scroll:e.scroll||r})},Bt=function(e,t){return Wt(Wt({},e),{},{scroll:null})},Xt=function(e,t){var n=e.scroll;return n?Vt(e,{type:"scrollTo",payload:{params:n,layout:t.payload.layout}}):e};var Yt=r.default.memo((function(e){var n=e.pad,o=e.padMethods,i=e.layout,a=e.render,c=t.useReducer(Ft,_t),l=c[0],u=c[1],s=t.useRef(l),d=t.useRef(i),f=t.useRef(o);f.current=o;var h=t.useRef({scrollTo:function(e){u({type:"scrollTo",payload:{params:e,layout:d.current}})}});return t.useMemo((function(){u({type:"setState",payload:{pad:n}})}),[n]),M((function(){var e=s.current;s.current=l,l.scroll&&(e.pad.contentSize!==l.pad.contentSize?u({type:"scrollRecalculate",payload:{layout:d.current}}):l.pad.deceleration||l.scroll.animated&&!e.pad.deceleration||setTimeout((function(){u({type:"scrollEnd"})}),0))}),[l]),M((function(){l.scrollTo&&f.current.scrollTo(l.scrollTo)}),[l.scrollTo]),r.default.createElement(r.default.Fragment,null,a(l,h.current))})),Gt=["itemCount","renderItem","direction","spacing","estimatedItemWidth","estimatedItemHeight","renderHeader","renderFooter","scrollTo","render","children"];function Ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kt=r.default.memo((function(e){var n,o,i=e.itemCount,a=e.renderItem,c=e.direction,l=void 0===c?"y":c,u=e.spacing,s=void 0===u?0:u,d=e.estimatedItemWidth,f=void 0===d?0:d,h=e.estimatedItemHeight,p=void 0===h?0:h,v=e.renderHeader,y=e.renderFooter,g=e.scrollTo,b=e.render,m=e.children,O=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);return o}(e,Gt),w=O.width,x=O.height,j=O.renderOverlay,E=O.directionalLockEnabled,S=void 0===E||E,P=t.useRef({}),z=t.useRef();(M((function(){if(g){var e=z.current;e&&e.scrollTo(g)}}),[g]),O.directionalLockEnabled=S,"x"===l)?O.boundY=null!==(n=O.boundY)&&void 0!==n?n:0:O.boundX=null!==(o=O.boundX)&&void 0!==o?o:0;return O.renderOverlay=function(e,t){return r.default.createElement(r.default.Fragment,null,r.default.createElement(Yt,{direction:l,pad:e,padMethods:t,layout:P.current,render:function(e,t){return z.current=t,b?b(e,t):m}}),j?j(e,t):null)},r.default.createElement(Ae,function(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(n),!0).forEach((function(t){Jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},O),r.default.createElement(ct,{width:w,height:x,direction:l,itemCount:3,renderItem:function(e){var t=e.itemIndex,n=e.Item;return 0===t?v?v(e):null:2===t?y?y(e):null:r.default.createElement(n,{forceRender:!0},r.default.createElement(ct,{width:w,height:x,direction:l,spacing:s,itemCount:i,estimatedItemWidth:f,estimatedItemHeight:p,renderItem:a,render:function(e){return P.current.body=e,null}}))},render:function(e){return P.current.box=e,null}}))}));e.AutoResizing=H,e.Carousel=At,e.GridContent=et,e.Infinite=Kt,e.ItemContent=Be,e.ListContent=ct,e.Loop=Ot,e.Pad=Ae,e.Pannable=ne,e.calculateDeceleration=we,e.context=Se,e.createDeceleration=xe,e.initialCarouselState=Et,e.initialInfiniteState=_t,e.initialLoopState=dt,e.initialPadState=se,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -5,4 +5,3 @@ import reducer, { initialInfiniteState } from './infiniteReducer';

export var InfiniteInner = React.memo(function (props) {
var direction = props.direction,
pad = props.pad,
var pad = props.pad,
padMethods = props.padMethods,

@@ -69,28 +68,4 @@ layout = props.layout,

}, [state.scrollTo]);
useIsomorphicLayoutEffect(function () {
if (!state.scroll) {
return;
}
var prevBound;
delegateRef.current.setBound(function (padState) {
prevBound = padState.bound;
return direction === 'x' ? {
x: -1,
y: prevBound.y
} : {
x: prevBound.x,
y: -1
};
});
return function () {
if (prevBound) {
delegateRef.current.setBound(function () {
return prevBound;
});
}
};
}, [state.scroll, direction]);
return React.createElement(React.Fragment, null, render(state, methodsRef.current));
});
export default InfiniteInner;

@@ -45,8 +45,2 @@ import PadContext from './PadContext';

});
},
setBound: function setBound(fn) {
dispatch({
type: 'setBound',
payload: fn(prevStateRef.current)
});
}

@@ -53,0 +47,0 @@ });

@@ -68,5 +68,2 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

case 'setBound':
return validateReducer(setBoundReducer(state, action), action);
default:

@@ -275,9 +272,2 @@ return state;

var setBoundReducer = function setBoundReducer(state, action) {
var bound = action.payload;
return _objectSpread(_objectSpread({}, state), {}, {
bound: bound
});
};
var scrollToReducer = function scrollToReducer(state, action) {

@@ -298,6 +288,14 @@ var drag = state.drag,

_action$payload$anima = _action$payload.animated,
animated = _action$payload$anima === void 0 ? false : _action$payload$anima;
animated = _action$payload$anima === void 0 ? -1 : _action$payload$anima;
var nextRect = rect;
var nextAnimated = drag ? false : animated;
var nextAnimated = animated;
if (typeof nextAnimated === 'boolean') {
nextAnimated = nextAnimated ? 1 : -1;
}
if (drag) {
nextAnimated = -1;
}
if (!nextRect) {

@@ -340,44 +338,52 @@ if (point) {

if (!animated) {
if (drag) {
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset,
drag: _objectSpread(_objectSpread({}, drag), {}, {
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y
}
}),
deceleration: null
});
}
if (animated === 1) {
var decelerationEndOffset = getDecelerationEndOffset(offset, {
x: 0,
y: 0
}, size, pagingEnabled, DECELERATION_RATE_STRONG);
return _objectSpread(_objectSpread({}, state), {}, {
drag: null,
deceleration: createDeceleration(decelerationEndOffset, DECELERATION_RATE_STRONG, contentOffset, contentVelocity)
});
}
if (deceleration) {
var _decelerationEndOffset2 = getDecelerationEndOffset({
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y
}, {
x: 0,
y: 0
}, size, pagingEnabled, deceleration.rate);
if (drag) {
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset,
drag: _objectSpread(_objectSpread({}, drag), {}, {
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y
}
}),
deceleration: null
});
}
if (deceleration) {
if (animated === 0) {
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset,
drag: null,
deceleration: createDeceleration(_decelerationEndOffset2, deceleration.rate, offset, contentVelocity)
deceleration: null
});
}
var _decelerationEndOffset2 = getDecelerationEndOffset({
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y
}, {
x: 0,
y: 0
}, size, pagingEnabled, deceleration.rate);
return _objectSpread(_objectSpread({}, state), {}, {
contentOffset: offset
contentOffset: offset,
drag: null,
deceleration: createDeceleration(_decelerationEndOffset2, deceleration.rate, offset, contentVelocity)
});
}
var decelerationEndOffset = getDecelerationEndOffset(offset, {
x: 0,
y: 0
}, size, pagingEnabled, DECELERATION_RATE_STRONG);
return _objectSpread(_objectSpread({}, state), {}, {
drag: null,
deceleration: createDeceleration(decelerationEndOffset, DECELERATION_RATE_STRONG, contentOffset, contentVelocity)
contentOffset: offset
});

@@ -384,0 +390,0 @@ };

@@ -5,3 +5,3 @@ import reducer, { initialInfiniteState, } from './infiniteReducer';

export const InfiniteInner = React.memo((props) => {
const { direction, pad, padMethods, layout, render } = props;
const { pad, padMethods, layout, render } = props;
const [state, dispatch] = useReducer(reducer, initialInfiniteState);

@@ -49,21 +49,4 @@ const prevStateRef = useRef(state);

}, [state.scrollTo]);
useIsomorphicLayoutEffect(() => {
if (!state.scroll) {
return;
}
let prevBound;
delegateRef.current.setBound((padState) => {
prevBound = padState.bound;
return direction === 'x'
? { x: -1, y: prevBound.y }
: { x: prevBound.x, y: -1 };
});
return () => {
if (prevBound) {
delegateRef.current.setBound(() => prevBound);
}
};
}, [state.scroll, direction]);
return React.createElement(React.Fragment, null, render(state, methodsRef.current));
});
export default InfiniteInner;

@@ -25,5 +25,2 @@ import PadContext from './PadContext';

},
setBound(fn) {
dispatch({ type: 'setBound', payload: fn(prevStateRef.current) });
},
});

@@ -30,0 +27,0 @@ const contentOnResize = useCallback((contentSize) => {

@@ -34,4 +34,2 @@ import { initialPannableState } from '../pannableReducer';

return validateReducer(scrollToReducer(state, action), action);
case 'setBound':
return validateReducer(setBoundReducer(state, action), action);
default:

@@ -190,14 +188,13 @@ return state;

};
const setBoundReducer = (state, action) => {
const bound = action.payload;
return {
...state,
bound,
};
};
const scrollToReducer = (state, action) => {
const { drag, contentOffset, size } = state;
const { offset = { x: 0, y: 0 }, point, rect, align = 0, animated = false, } = action.payload;
const { offset = { x: 0, y: 0 }, point, rect, align = 0, animated = -1, } = action.payload;
let nextRect = rect;
const nextAnimated = drag ? false : animated;
let nextAnimated = animated;
if (typeof nextAnimated === 'boolean') {
nextAnimated = nextAnimated ? 1 : -1;
}
if (drag) {
nextAnimated = -1;
}
if (!nextRect) {

@@ -223,22 +220,26 @@ if (point) {

const { offset, animated } = action.payload;
if (!animated) {
if (drag) {
return {
...state,
contentOffset: offset,
drag: {
...drag,
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y,
},
if (animated === 1) {
const decelerationEndOffset = getDecelerationEndOffset(offset, { x: 0, y: 0 }, size, pagingEnabled, DECELERATION_RATE_STRONG);
return {
...state,
drag: null,
deceleration: createDeceleration(decelerationEndOffset, DECELERATION_RATE_STRONG, contentOffset, contentVelocity),
};
}
if (drag) {
return {
...state,
contentOffset: offset,
drag: {
...drag,
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y,
},
deceleration: null,
};
}
if (deceleration) {
const decelerationEndOffset = getDecelerationEndOffset({
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y,
}, { x: 0, y: 0 }, size, pagingEnabled, deceleration.rate);
},
deceleration: null,
};
}
if (deceleration) {
if (animated === 0) {
return {

@@ -248,15 +249,19 @@ ...state,

drag: null,
deceleration: createDeceleration(decelerationEndOffset, deceleration.rate, offset, contentVelocity),
deceleration: null,
};
}
const decelerationEndOffset = getDecelerationEndOffset({
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y,
}, { x: 0, y: 0 }, size, pagingEnabled, deceleration.rate);
return {
...state,
contentOffset: offset,
drag: null,
deceleration: createDeceleration(decelerationEndOffset, deceleration.rate, offset, contentVelocity),
};
}
const decelerationEndOffset = getDecelerationEndOffset(offset, { x: 0, y: 0 }, size, pagingEnabled, DECELERATION_RATE_STRONG);
return {
...state,
drag: null,
deceleration: createDeceleration(decelerationEndOffset, DECELERATION_RATE_STRONG, contentOffset, contentVelocity),
contentOffset: offset,
};

@@ -263,0 +268,0 @@ };

{
"name": "react-pannable",
"version": "6.0.6",
"version": "6.0.7",
"description": "Flexible and Customizable Layouts for Scrolling Content with React",

@@ -5,0 +5,0 @@ "keywords": [

@@ -53,3 +53,3 @@ import {

align?: Record<XY, Align> | Align;
animated?: boolean;
animated?: boolean | -1 | 0 | 1;
};

@@ -59,3 +59,2 @@

scrollTo: (params: PadScrollTo) => void;
setBound: (fn: (state: PadState) => Record<XY, Bound>) => void;
};

@@ -107,4 +106,2 @@

return validateReducer(scrollToReducer(state, action), action);
case 'setBound':
return validateReducer(setBoundReducer(state, action), action);
default:

@@ -394,14 +391,2 @@ return state;

const setBoundReducer: Reducer<PadState, Action<Record<XY, Bound>>> = (
state,
action
) => {
const bound = action.payload!;
return {
...state,
bound,
};
};
const scrollToReducer: Reducer<PadState, Action<PadScrollTo>> = (

@@ -417,7 +402,14 @@ state,

align = 0,
animated = false,
animated = -1,
} = action.payload!;
let nextRect = rect;
const nextAnimated = drag ? false : animated;
let nextAnimated = animated;
if (typeof nextAnimated === 'boolean') {
nextAnimated = nextAnimated ? 1 : -1;
}
if (drag) {
nextAnimated = -1;
}
if (!nextRect) {

@@ -447,3 +439,6 @@ if (point) {

const setContentOffsetReducer: Reducer<PadState, Action> = (state, action) => {
const setContentOffsetReducer: Reducer<
PadState,
Action<{ offset: Point; animated: -1 | 0 | 1 }>
> = (state, action) => {
const {

@@ -457,31 +452,42 @@ contentOffset,

} = state;
const { offset, animated } = action.payload;
const { offset, animated } = action.payload!;
if (!animated) {
if (drag) {
return {
...state,
contentOffset: offset,
drag: {
...drag,
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y,
},
if (animated === 1) {
const decelerationEndOffset = getDecelerationEndOffset(
offset,
{ x: 0, y: 0 },
size,
pagingEnabled,
DECELERATION_RATE_STRONG
);
return {
...state,
drag: null,
deceleration: createDeceleration(
decelerationEndOffset,
DECELERATION_RATE_STRONG,
contentOffset,
contentVelocity
),
};
}
if (drag) {
return {
...state,
contentOffset: offset,
drag: {
...drag,
startOffset: {
x: drag.startOffset.x + offset.x - contentOffset.x,
y: drag.startOffset.y + offset.y - contentOffset.y,
},
deceleration: null,
};
}
if (deceleration) {
const decelerationEndOffset = getDecelerationEndOffset(
{
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y,
},
{ x: 0, y: 0 },
size,
pagingEnabled,
deceleration.rate
);
},
deceleration: null,
};
}
if (deceleration) {
if (animated === 0) {
return {

@@ -491,34 +497,33 @@ ...state,

drag: null,
deceleration: createDeceleration(
decelerationEndOffset,
deceleration.rate,
offset,
contentVelocity
),
deceleration: null,
};
}
const decelerationEndOffset = getDecelerationEndOffset(
{
x: deceleration.endOffset.x + offset.x - contentOffset.x,
y: deceleration.endOffset.y + offset.y - contentOffset.y,
},
{ x: 0, y: 0 },
size,
pagingEnabled,
deceleration.rate
);
return {
...state,
contentOffset: offset,
drag: null,
deceleration: createDeceleration(
decelerationEndOffset,
deceleration.rate,
offset,
contentVelocity
),
};
}
const decelerationEndOffset = getDecelerationEndOffset(
offset,
{ x: 0, y: 0 },
size,
pagingEnabled,
DECELERATION_RATE_STRONG
);
return {
...state,
drag: null,
deceleration: createDeceleration(
decelerationEndOffset,
DECELERATION_RATE_STRONG,
contentOffset,
contentVelocity
),
contentOffset: offset,
};

@@ -525,0 +530,0 @@ };

@@ -29,7 +29,6 @@ import { XY, Size, Time, Bound, Action, Inset, Point, Rect, Align } from '../interfaces';

align?: Record<XY, Align> | Align;
animated?: boolean;
animated?: boolean | -1 | 0 | 1;
};
export declare type PadMethods = {
scrollTo: (params: PadScrollTo) => void;
setBound: (fn: (state: PadState) => Record<XY, Bound>) => void;
};

@@ -36,0 +35,0 @@ export declare type PadState = {

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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc