react-pannable
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).ReactPannable={},t.React)}(this,function(t,g){"use strict";function p(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)e.indexOf(n=r[i])<0&&(o[n]=t[n]);return o}function m(){return(m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}g=g&&g.hasOwnProperty("default")?g.default:g;var e,u={create:function(t){var e,n=t.transformTranslate;return m({},p(t,["transformTranslate"]),(e=n)?{transform:"translate3d("+e[0]+"px, "+e[1]+"px, 0)",WebkitTransform:"translate3d("+e[0]+"px, "+e[1]+"px, 0)",msTransform:"translate("+e[0]+"px, "+e[1]+"px)"}:null)}},h=function(i){function t(){for(var o,t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return(o=i.call.apply(i,[this].concat(e))||this).state={target:null,translation:null,interval:null,velocity:null,startPoint:null,movePoint:null,moveTime:null},o.elemRef=g.createRef(),o._onTouchStart=function(t){var e=o.props,n=e.onTouchStart;t.touches&&1===t.touches.length&&e.enabled&&o._track(t.touches[0]),n&&n(t)},o._onTouchMove=function(t){var e=o.props.onTouchMove;t.touches&&1===t.touches.length&&o._move(t.touches[0]),e&&e(t)},o._onTouchEnd=function(t){var e=o.props.onTouchEnd;t.changedTouches&&1===t.changedTouches.length&&o._end(),e&&e(t)},o._onTouchCancel=function(t){var e=o.props.onTouchCancel;t.changedTouches&&1===t.changedTouches.length&&o._end(),e&&e(t)},o._onMouseDown=function(t){var e=o.props,n=e.enabled,i=e.onMouseDown;(o._shouldPreventClick=n)&&(o._removeMousePanListener(),o._addMousePanListener(),o._track(t)),i&&i(t)},o._onMouseMove=function(t){t.preventDefault(),o._move(t)},o._onMouseUp=function(t){t.preventDefault(),o._removeMousePanListener(),o._end()},o._onClick=function(t){var e=o.props.onClick;o._shouldPreventClick&&t.preventDefault(),o._shouldPreventClick=!1,e&&e(t)},o}r(t,i);var e=t.prototype;return e.componentDidUpdate=function(t){var e=this.props.enabled;t.enabled===e||e||this._cancel()},e.componentWillUnmount=function(){this._removeMousePanListener()},e._track=function(t){this.setState({startPoint:{x:t.pageX,y:t.pageY},movePoint:{x:t.pageX,y:t.pageY},moveTime:(new Date).getTime()})},e._move=function(p){p={target:p.target,pageX:p.pageX,pageY:p.pageY},this.setState(function(t,e){var n=e.shouldStart,i=e.onStart,o=e.onMove,r=t.target,a=t.startPoint,s=t.movePoint,c=t.moveTime;if(!a)return null;var l=(new Date).getTime(),d={x:p.pageX,y:p.pageY},u=l-c,h={x:d.x-a.x,y:d.y-a.y},f={x:(d.x-s.x)/u,y:(d.y-s.y)/u},g={translation:h,velocity:f,interval:u,movePoint:d,moveTime:l};r?o({target:r,translation:h,velocity:f,interval:u}):0<Math.sqrt(h.x*h.x+h.y*h.y)&&n({target:p.target,translation:h,velocity:f,interval:u})&&(g.target=p.target,g.startPoint={x:p.pageX,y:p.pageY},g.translation=h={x:0,y:0},i({target:p.target,translation:h,velocity:f,interval:u}));return g})},e._end=function(){this.setState(function(t,e){var n=t.target;return n&&e.onEnd({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._cancel=function(){this.setState(function(t,e){var n=t.target;return n&&e.onCancel({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._addMousePanListener=function(){var t=document.documentElement;t.addEventListener("mousemove",this._onMouseMove,!1),t.addEventListener("mouseup",this._onMouseUp,!1)},e._removeMousePanListener=function(){var t=document.documentElement;t.removeEventListener("mousemove",this._onMouseMove,!1),t.removeEventListener("mouseup",this._onMouseUp,!1)},e.render=function(){var t=this.props,e=t.enabled,n=t.style,i=p(t,["enabled","shouldStart","onStart","onMove","onEnd","onCancel","style"]),o=u.create(m({touchAction:e?"none":"auto"},n));return g.createElement("div",m({},i,{ref:this.elemRef,style:o,onTouchStart:this._onTouchStart,onTouchEnd:this._onTouchEnd,onTouchMove:this._onTouchMove,onTouchCancel:this._onTouchCancel,onMouseDown:this._onMouseDown,onClick:this._onClick}))},t}(g.PureComponent);h.defaultProps={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}};var v=(e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||e.setTimeout&&function(t){return e.setTimeout(t,20)}||function(){},y=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame||e.clearTimeout||function(){};function b(t,e){var n=e.x,i=e.y,o=Math.sqrt(n*n+i*i);return 0===o?{x:0,y:0}:{x:t*(n/o),y:t*(i/o)}}function w(t,e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],c=Math.min(e[s]-n[s],0);return c=Math.max(c,Math.min(t[a],0)),i&&(c=e[s]?e[s]*Math.round(c/e[s]):0),c}return{x:w(t,e,n,i,"x"),y:w(t,e,n,i,"y")}}function l(t,e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],c=Math.min(n[s]-i[s],0);return c=Math.max(c,Math.min(e[a],0)),t[a]<(c=n[s]?n[s]*Math.floor(c/n[s]):0)+.5*n[s]?c:c+n[s]}return{x:l(t,e,n,i,"x"),y:l(t,e,n,i,"y")}}var x=.04,a=function(n){function t(t){var e;return(e=n.call(this,t)||this)._onDragStart=function(t){var r=t.velocity;e.setState(function(t,e){var n=t.contentOffset,i=e.directionalLockEnabled?Math.abs(r.y)<Math.abs(r.x)?{x:1,y:0}:{x:0,y:1}:{x:1,y:1},o={x:i.x*r.x,y:i.y*r.y};return{contentOffset:m({},n),contentVelocity:o,dragging:!0,dragStartOffset:n,dragDirection:i,decelerating:!1}})},e._onDragMove=function(t){var a=t.translation,s=t.interval;e.setState(function(t,e){var n=t.contentOffset,i=t.dragStartOffset,o=t.dragDirection,r=function t(e,n,i,o,r){if(r){var a="y"===r?["y","height","width"]:["x","width","height"],s=a[0],c=a[1],l=a[2],d=e[s],u=Math.min(i[c]-o[c],0),h=.5*Math.min(i[c],i[l]);return 0<d?n[s]?h*(1-h/(h+d)):0:d<u?n[s]?u-h*(1-h/(h-d+u)):u:d}return{x:t(e,n,i,o,"x"),y:t(e,n,i,o,"y")}}({x:i.x+o.x*a.x,y:i.y+o.y*a.y},{x:e.alwaysBounceX,y:e.alwaysBounceY},t.size,t.contentSize);return{contentOffset:r,contentVelocity:{x:(r.x-n.x)/s,y:(r.y-n.y)/s}}})},e._onDragEnd=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.size,o=t.contentSize,r=e.pagingEnabled,a=r?x:.004,s=function t(e,n,i,o){if(o){var r=e[o];return i[o]&&(r+=.5*n[o]*(n[o]/i[o])),r}return"number"==typeof i&&(i=b(i,n)),{x:t(e,n,i,"x"),y:t(e,n,i,"y")}}(n,t.contentVelocity,a);return r&&(s=l(n,s,i,o)),{contentOffset:m({},n),dragging:!1,decelerating:!0,decelerationEndOffset:s,decelerationRate:a}})},e._onDragCancel=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.dragStartOffset;return e.pagingEnabled&&(i=l(n,i,t.size,t.contentSize)),{contentOffset:m({},n),dragging:!1,decelerating:!0,decelerationEndOffset:i,decelerationRate:x}})},e.state={prevContentOffset:null,contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},size:{width:t.width,height:t.height},contentSize:{width:t.contentWidth,height:t.contentHeight},dragging:!1,dragStartOffset:null,dragDirection:null,decelerating:!1,decelerationEndOffset:null,decelerationRate:x},e.boundingRef=g.createRef(),e.contentRef=g.createRef(),e.setContentSize=e.setContentSize.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)),e}r(t,n),t.getDerivedStateFromProps=function(t,e){var n=e.contentOffset,i=e.contentVelocity,o=e.size,r=e.contentSize,a=e.dragging,s=e.decelerating,c=e.decelerationEndOffset,l=e.decelerationRate,d={};if(e.prevContentOffset!==n){var u=s,h=c,f=l;if(u){var g=w(n,o,r,!1);g.x===n.x&&g.y===n.y||(f=x,g.x===h.x&&g.y===h.y||(h=g)),h.x===n.x&&h.y===n.y&&0===i.x&&0===i.y&&(u=!1)}d.prevContentOffset=n,u!==s&&(d.decelerating=u),f!==l&&(d.decelerationRate=f),h!==c&&(d.decelerationEndOffset=h),t.onScroll({contentOffset:n,contentVelocity:i,size:o,contentSize:r,dragging:a,decelerating:u})}return d};var e=t.prototype;return e.componentDidUpdate=function(t,e){var n=this,i=this.props,o=i.width,r=i.height,a=i.contentWidth,s=i.contentHeight,c=i.pagingEnabled,l=i.onResize,d=i.onContentResize;if(t.width!==o||t.height!==r){var u={width:o,height:r};this._setStateWithScroll({size:u}),l(u)}if(t.contentWidth!==a||t.contentHeight!==s){var h={width:a,height:s};this._setStateWithScroll({contentSize:h}),d(h)}if(t.pagingEnabled!==c&&c&&this._setStateWithScroll(null),e.contentOffset!==this.state.contentOffset&&this.state.decelerating){var f=(new Date).getTime();this._deceleratingTimer&&y(this._deceleratingTimer),this._deceleratingTimer=v(function(){n._deceleratingTimer=void 0,n._decelerate((new Date).getTime()-f)})}},e.componentWillUnmount=function(){this._deceleratingTimer&&(y(this._deceleratingTimer),this._deceleratingTimer=void 0)},e.getSize=function(){return this.state.size},e.getContentSize=function(){return this.state.contentSize},e.getContentOffset=function(){return this.state.contentOffset},e.isDragging=function(){return this.state.dragging},e.isDecelerating=function(){return this.state.decelerating},e.getVisibleRect=function(){var t=this.state,e=t.contentOffset,n=t.size;return{x:-e.x,y:-e.y,width:n.width,height:n.height}},e.setContentSize=function(t){this._setStateWithScroll({contentSize:t}),this.props.onContentResize(t)},e.scrollToRect=function(t){var e=t.rect,n=t.align,i=void 0===n?"auto":n;this._setContentOffset(function(t){return function t(e,n,i,o,r){if(r){var a="y"===r?["y","height"]:["x","width"],s=a[0],c=a[1],l=-e[s],d=o[c]-e[c];if("auto"===n[s]){var u=d<0?-1:1;l+=u*Math.max(0,Math.min(u*(i[s]-l),u*d))}else"start"===n[s]?n[s]=0:"center"===n[s]?n[s]=.5:"end"===n[s]&&(n[s]=1),("number"!=typeof n[s]||isNaN(n[s]))&&(n[s]=.5),l+=n[s]*d;return l}return"object"!=typeof n&&(n={x:n,y:n}),{x:t(e,n,i,o,"x"),y:t(e,n,i,o,"y")}}(e,i,t.contentOffset,t.size)},t.animated)},e.scrollTo=function(t){this._setContentOffset(t.offset,t.animated)},e._setContentOffset=function(i,o){this.setState(function(t,e){"function"==typeof i&&(i=i(t,e));var n=t.contentOffset;return t.dragging?null:(i=w(i,t.size,t.contentSize,e.pagingEnabled),o?{contentOffset:m({},n),decelerating:!0,decelerationEndOffset:i,decelerationRate:x}:{contentOffset:i,contentVelocity:{x:0,y:0},decelerating:!1})})},e._setStateWithScroll=function(o){this.setState(function(t,e){var n=t.contentOffset;if(t.dragging)return o;var i=w(n,t.size,t.contentSize,e.pagingEnabled);return i.x===n.x&&i.y===n.y?o:m({},o,{contentOffset:m({},n),decelerating:!0,decelerationEndOffset:i,decelerationRate:x})})},e._decelerate=function(n){this.setState(function(t){if(!t.decelerating)return null;var e=function t(e,n,i,o,r,a,s){if(s){var c,l="y"===s?["y","height"]:["x","width"],d=l[0],u=l[1],h=o[d],f=i[d];if(n[d]){var g=n[d]<0?-1:1,p=g*Math.sqrt(.5*f*f+n[d]*(r[d]-h)),v=(p-f)/n[d];v<0&&(p=f,v=0),(2*p-f)/n[d]<e?(f=0,h=r[d]):0<g*(r[d]-(h+=.5*(i[d]+p)*v-.5*(p+(f=p-n[d]*Math.abs(v-e)))*(v-e)))||(f=(f<0?-1:1)*Math.min(Math.abs(f),Math.sqrt(2*g*n[d]*.25*a[u])))}else h+=f*e;return(c={})[d+"Offset"]=h,c[d+"Velocity"]=f,c}return"number"==typeof n&&(n=b(n,{x:r.x-o.x,y:r.y-o.y})),m({},t(e,n,i,o,r,a,"x"),t(e,n,i,o,r,a,"y"))}(n,t.decelerationRate,t.contentVelocity,t.contentOffset,t.decelerationEndOffset,t.size);return{contentOffset:{x:e.xOffset,y:e.yOffset},contentVelocity:{x:e.xVelocity,y:e.yVelocity}}})},e.render=function(){var t=this.props,e=t.scrollEnabled,n=t.style,i=t.children,o=p(t,["width","height","contentWidth","contentHeight","scrollEnabled","pagingEnabled","directionalLockEnabled","alwaysBounceX","alwaysBounceY","onScroll","onResize","onContentResize","style","children"]),r=this.state,a=r.size,s=r.contentSize,c=r.contentOffset,l=u.create(m({overflow:"hidden",position:"relative",boxSizing:"border-box",width:a.width,height:a.height},n)),d=u.create({position:"relative",boxSizing:"border-box",width:s.width,height:s.height,transformTranslate:[c.x,c.y]});return g.createElement(h,m({},o,{ref:this.boundingRef,style:l,enabled:e,onStart:this._onDragStart,onMove:this._onDragMove,onEnd:this._onDragEnd,onCancel:this._onDragCancel}),g.createElement("div",{ref:this.contentRef,style:d},"function"==typeof i?i(this):i))},t}(g.PureComponent);function s(t){var e=window.getComputedStyle(t)||{},n=t.offsetWidth||0,i=t.offsetHeight||0;return e.paddingLeft&&(n-=parseInt(e.paddingLeft,10)),e.paddingRight&&(n-=parseInt(e.paddingRight,10)),e.borderLeftWidth&&(n-=parseInt(e.borderLeftWidth,10)),e.borderRightWidth&&(n-=parseInt(e.borderRightWidth,10)),e.paddingTop&&(i-=parseInt(e.paddingTop,10)),e.paddingBottom&&(i-=parseInt(e.paddingBottom,10)),e.borderTopWidth&&(i-=parseInt(e.borderTopWidth,10)),e.borderBottomWidth&&(i-=parseInt(e.borderBottomWidth,10)),{width:n,height:i}}function n(t,e){return t(e={exports:{}},e.exports),e.exports}a.defaultProps={children:null,width:0,height:0,contentWidth:0,contentHeight:0,scrollEnabled:!0,pagingEnabled:!1,directionalLockEnabled:!1,alwaysBounceX:!0,alwaysBounceY:!0,onScroll:function(){},onResize:function(){},onContentResize:function(){}};var i=n(function(t){(t.exports={}).forEach=function(t,e){for(var n=0;n<t.length;n++){var i=e(t[n]);if(i)return i}}}),z=n(function(t){var e=t.exports={};e.isIE=function(t){return(-1!=(e=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!=e.indexOf("trident")||-1!=e.indexOf(" edge/"))&&(!t||t===function(){for(var t=3,e=document.createElement("div"),n=e.getElementsByTagName("i");e.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:void 0}());var e},e.isLegacyOpera=function(){return!!window.opera}}),d=n(function(t){(t.exports={}).getOption=function(t,e,n){var i=t[e];return null!=i||void 0===n?i:n}}),S=function(t){var e=(t=t||{}).reporter,n=d.getOption(t,"async",!0),i=d.getOption(t,"auto",!0);i&&!n&&(e&&e.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,r=f(),a=!1;function s(){for(a=!0;r.size();){var t=r;r=f(),t.process()}a=!1}function c(){o=setTimeout(s,0)}return{add:function(t,e){!a&&i&&n&&0===r.size()&&c(),r.add(t,e)},force:function(t){a||(void 0===t&&(t=n),o&&(clearTimeout(o),o=null),t?c():s())}}};function f(){var i={},n=0,o=0,r=0;return{add:function(t,e){e||(e=t,t=0),o<t?o=t:t<r&&(r=t),i[t]||(i[t]=[]),i[t].push(e),n++},process:function(){for(var t=r;t<=o;t++)for(var e=i[t],n=0;n<e.length;n++)(0,e[n])()},size:function(){return n}}}var o="_erd";function c(t){return t[o]}var _={initState:function(t){return t[o]={},c(t)},getState:c,cleanState:function(t){delete t[o]}},I=i.forEach,E=function(t){var x=(t=t||{}).reporter,z=t.batchProcessor,S=t.stateHandler.getState,_=t.idHandler;if(!z)throw Error("Missing required dependency: batchProcessor");if(!x)throw Error("Missing required dependency: reporter.");var E=function(){var t=document.createElement("div");t.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var e=document.createElement("div");e.style.cssText="position: absolute; width: 500px; height: 500px; overflow: scroll; visibility: none; top: -1500px; left: -1500px; visibility: hidden; margin: 0; padding: 0;",e.appendChild(t),document.body.insertBefore(e,document.body.firstChild);var n=500-e.clientWidth,i=500-e.clientHeight;return document.body.removeChild(e),{width:n,height:i}}(),C="erd_scroll_detection_container";function R(t,e,n){if(t.addEventListener)t.addEventListener(e,n);else{if(!t.attachEvent)return x.error("[scroll] Don't know how to add event listeners.");t.attachEvent("on"+e,n)}}function n(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n);else{if(!t.detachEvent)return x.error("[scroll] Don't know how to remove event listeners.");t.detachEvent("on"+e,n)}}function T(t){return S(t).container.childNodes[0].childNodes[0].childNodes[0]}function M(t){return S(t).container.childNodes[0].childNodes[0].childNodes[1]}return function(i,t){if(!document.getElementById(i)){var e=t+"_animation",n=t+"_animation_active",o="/* Created by the element-resize-detector library. */\n";o+="."+t+" > div::-webkit-scrollbar { display: none; }\n\n",o+="."+n+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+e+"; animation-name: "+e+"; }\n",o+="@-webkit-keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(t,e){e=e||function(t){document.head.appendChild(t)};var n=document.createElement("style");n.innerHTML=t,n.id=i,e(n)}(o+="@keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}("erd_scroll_detection_scrollbar_style",C),{makeDetectable:function(a,v,t){function m(){if(a.debug){var t=Array.prototype.slice.call(arguments);if(t.unshift(_.get(v),"Scroll: "),x.log.apply)x.log.apply(null,t);else for(var e=0;e<t.length;e++)x.log(t[e])}}function s(t){var e=S(t).container.childNodes[0],n=window.getComputedStyle(e);return!n.width||-1==n.width.indexOf("px")}function e(){var t=window.getComputedStyle(v),e={};return e.position=t.position,e.width=v.offsetWidth,e.height=v.offsetHeight,e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left,e.widthCSS=t.width,e.heightCSS=t.height,e}function n(){if(m("storeStyle invoked."),S(v)){var t=e();S(v).style=t}else m("Aborting because element has been uninstalled")}function c(t,e,n){S(t).lastWidth=e,S(t).lastHeight=n}function l(){return 2*E.width+1}function d(){return 2*E.height+1}function u(t){return t+10+l()}function h(t){return t+10+d()}function f(t,e,n){var i=T(t),o=M(t),r=u(e),a=h(n),s=2*e+l(),c=2*n+d();i.scrollLeft=r,i.scrollTop=a,o.scrollLeft=s,o.scrollTop=c}function y(){var t=S(v).container;if(!t){(t=document.createElement("div")).className=C,t.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",(S(v).container=t).className+=" "+C+"_animation_active",v.appendChild(t);var e=function(){S(v).onRendered&&S(v).onRendered()};R(t,"animationstart",e),S(v).onAnimationStart=e}return t}function i(){if(m("Injecting elements"),S(v)){!function(){var t=S(v).style;if("static"===t.position){v.style.position="relative";var e=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};e(x,v,t,"top"),e(x,v,t,"right"),e(x,v,t,"bottom"),e(x,v,t,"left")}}();var t=S(v).container;t||(t=y());var e,n,i,o,r=E.width,a=E.height,s="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; left: "+(e=(e=-(1+r))?e+"px":"0")+"; top: "+(n=(n=-(1+a))?n+"px":"0")+"; right: "+(o=(o=-r)?o+"px":"0")+"; bottom: "+(i=(i=-a)?i+"px":"0")+";",c=document.createElement("div"),l=document.createElement("div"),d=document.createElement("div"),u=document.createElement("div"),h=document.createElement("div"),f=document.createElement("div");c.dir="ltr",c.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",l.className=c.className=C,l.style.cssText=s,d.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",u.style.cssText="position: absolute; left: 0; top: 0;",h.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",f.style.cssText="position: absolute; width: 200%; height: 200%;",d.appendChild(u),h.appendChild(f),l.appendChild(d),l.appendChild(h),c.appendChild(l),t.appendChild(c),R(d,"scroll",g),R(h,"scroll",p),S(v).onExpandScroll=g,S(v).onShrinkScroll=p}else m("Aborting because element has been uninstalled");function g(){S(v).onExpand&&S(v).onExpand()}function p(){S(v).onShrink&&S(v).onShrink()}}function o(){function i(t,e,n){var i=T(t).childNodes[0],o=u(e),r=h(n);i.style.width=o+"px",i.style.height=r+"px"}function n(t){var e=v.offsetWidth,n=v.offsetHeight;m("Storing current size",e,n),c(v,e,n),z.add(0,function(){S(v)?o()?(a.debug&&(v.offsetWidth===e&&v.offsetHeight===n||x.warn(_.get(v),"Scroll: Size changed before updating detector elements.")),i(v,e,n)):m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")}),z.add(1,function(){S(v)?o()?f(v,e,n):m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")}),t&&z.add(2,function(){S(v)?o()?t():m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")})}function o(){return!!S(v).container}function r(){m("notifyListenersIfNeeded invoked");var t=S(v);return void 0===S(v).lastNotifiedWidth&&t.lastWidth===t.startSize.width&&t.lastHeight===t.startSize.height?m("Not notifying: Size is the same as the start size, and there has been no notification yet."):t.lastWidth===t.lastNotifiedWidth&&t.lastHeight===t.lastNotifiedHeight?m("Not notifying: Size already notified"):(m("Current size not notified, notifying..."),t.lastNotifiedWidth=t.lastWidth,t.lastNotifiedHeight=t.lastHeight,void I(S(v).listeners,function(t){t(v)}))}function t(){if(m("Scroll detected."),s(v))m("Scroll event fired while unrendered. Ignoring...");else{var t=v.offsetWidth,e=v.offsetHeight;t!==S(v).lastWidth||e!==S(v).lastHeight?(m("Element size changed."),n(r)):m("Element size has not changed ("+t+"x"+e+").")}}if(m("registerListenersAndPositionElements invoked."),S(v)){S(v).onRendered=function(){if(m("startanimation triggered."),s(v))m("Ignoring since element is still unrendered...");else{m("Element rendered.");var t=T(v),e=M(v);0!==t.scrollLeft&&0!==t.scrollTop&&0!==e.scrollLeft&&0!==e.scrollTop||(m("Scrollbars out of sync. Updating detector elements..."),n(r))}},S(v).onExpand=t,S(v).onShrink=t;var e=S(v).style;i(v,e.width,e.height)}else m("Aborting because element has been uninstalled")}function r(){if(m("finalizeDomMutation invoked."),S(v)){var t=S(v).style;c(v,t.width,t.height),f(v,t.width,t.height)}else m("Aborting because element has been uninstalled")}function g(){t(v)}function p(){var t;m("Installing..."),S(v).listeners=[],t=e(),S(v).startSize={width:t.width,height:t.height},m("Element start size",S(v).startSize),z.add(0,n),z.add(1,i),z.add(2,o),z.add(3,r),z.add(4,g)}var b,w;t||(t=v,v=a,a=null),a=a||{},m("Making detectable..."),(w=b=v)!==w.ownerDocument.body&&!w.ownerDocument.body.contains(w)||null===window.getComputedStyle(b)?(m("Element is detached"),y(),m("Waiting until element is attached..."),S(v).onRendered=function(){m("Element is now attached"),p()}):p()},addListener:function(t,e){if(!S(t).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");S(t).listeners.push(e)},uninstall:function(t){var e=S(t);e&&(e.onExpandScroll&&n(T(t),"scroll",e.onExpandScroll),e.onShrinkScroll&&n(M(t),"scroll",e.onShrinkScroll),e.onAnimationStart&&n(e.container,"animationstart",e.onAnimationStart),e.container&&t.removeChild(e.container))}}},C=i.forEach;function R(t){return Array.isArray(t)||void 0!==t.length}function T(t){if(Array.isArray(t))return t;var e=[];return C(t,function(t){e.push(t)}),e}function M(t){return t&&1===t.nodeType}function O(t,e,n){var i=t[e];return null==i&&void 0!==n?n:i}var D=function(e){var u,t,i,o,n;if((e=e||{}).idHandler)u={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var r=(n=1,{generate:function(){return n++}}),a=(i=(t={idGenerator:r,stateHandler:_}).idGenerator,o=t.stateHandler.getState,{get:function(t){var e=o(t);return e&&void 0!==e.id?e.id:null},set:function(t){var e=o(t);if(!e)throw Error("setId required the element to have a resize detection state.");var n=i.generate();return e.id=n}});u=a}var h=e.reporter;h||(h=function(t){function e(){}var n={log:e,warn:e,error:e};if(!t&&window.console){var i=function(t,n){t[n]=function(){var t=console[n];if(t.apply)t.apply(console,arguments);else for(var e=0;e<arguments.length;e++)t(arguments[e])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}(!1===h));var s=O(e,"batchProcessor",S({reporter:h})),f={};f.callOnAdd=!!O(e,"callOnAdd",!0),f.debug=!!O(e,"debug",!1);var c,g,p=function(i){var o={};function r(t){var e=i.get(t);return void 0===e?[]:o[e]||[]}return{get:r,add:function(t,e){var n=i.get(t);o[n]||(o[n]=[]),o[n].push(e)},removeListener:function(t,e){for(var n=r(t),i=0,o=n.length;i<o;++i)if(n[i]===e){n.splice(i,1);break}},removeAllListeners:function(t){var e=r(t);e&&(e.length=0)}}}(u),v=(c={stateHandler:_}.stateHandler.getState,{isDetectable:function(t){var e=c(t);return e&&!!e.isDetectable},markAsDetectable:function(t){c(t).isDetectable=!0},isBusy:function(t){return!!c(t).busy},markBusy:function(t,e){c(t).busy=!!e}}),l=O(e,"strategy","object"),d={reporter:h,batchProcessor:s,stateHandler:_,idHandler:u};if("scroll"===l&&(z.isLegacyOpera()?(h.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),l="object"):z.isIE(9)&&(h.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),l="object")),"scroll"===l)g=E(d);else{if("object"!==l)throw Error("Invalid strategy name: "+l);g=function(t){var s=(t=t||{}).reporter,c=t.batchProcessor,l=t.stateHandler.getState;if(!s)throw Error("Missing required dependency: reporter.");function i(t){return l(t).object}return{makeDetectable:function(t,e,n){n||(n=e,e=t,t=null),t=t||{},z.isIE(8)?n(e):function(n,i){var o=!1,r=window.getComputedStyle(n),t=n.offsetWidth,e=n.offsetHeight;function a(){function t(){if("static"===r.position){n.style.position="relative";var t=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};t(s,n,r,"top"),t(s,n,r,"right"),t(s,n,r,"bottom"),t(s,n,r,"left")}}""!==r.position&&(t(),o=!0);var e=document.createElement("object");e.style.cssText="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;",e.tabIndex=-1,e.type="text/html",e.setAttribute("aria-hidden","true"),e.onload=function(){o||t(),function t(e,n){e.contentDocument?n(e.contentDocument):setTimeout(function(){t(e,n)},100)}(this,function(t){i(n)})},z.isIE()||(e.data="about:blank"),n.appendChild(e),l(n).object=e,z.isIE()&&(e.data="about:blank")}l(n).startSize={width:t,height:e},c?c.add(a):a()}(e,n)},addListener:function(t,e){if(!i(t))throw Error("Element is not detectable by this strategy.");function n(){e(t)}z.isIE(8)?(l(t).object={proxy:n},t.attachEvent("onresize",n)):i(t).contentDocument.defaultView.addEventListener("resize",n)},uninstall:function(t){z.isIE(8)?t.detachEvent("onresize",l(t).object.proxy):t.removeChild(i(t)),delete l(t).object}}}(d)}var m={};return{listenTo:function(t,i,o){function r(e){var t=p.get(e);C(t,function(t){t(e)})}function a(t,e,n){p.add(e,n),t&&n(e)}if(o||(o=i,i=t,t={}),!i)throw Error("At least one element required.");if(!o)throw Error("Listener required.");if(M(i))i=[i];else{if(!R(i))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");i=T(i)}var s=0,c=O(t,"callOnAdd",f.callOnAdd),l=O(t,"onReady",function(){}),d=O(t,"debug",f.debug);C(i,function(t){_.getState(t)||(_.initState(t),u.set(t));var n=u.get(t);if(d&&h.log("Attaching listener to element",n,t),!v.isDetectable(t))return d&&h.log(n,"Not detectable."),v.isBusy(t)?(d&&h.log(n,"System busy making it detectable"),a(c,t,o),m[n]=m[n]||[],void m[n].push(function(){++s===i.length&&l()})):(d&&h.log(n,"Making detectable..."),v.markBusy(t,!0),g.makeDetectable({debug:d},t,function(t){if(d&&h.log(n,"onElementDetectable"),_.getState(t)){v.markAsDetectable(t),v.markBusy(t,!1),g.addListener(t,r),a(c,t,o);var e=_.getState(t);e&&e.startSize&&(e.startSize.width===t.offsetWidth&&e.startSize.height===t.offsetHeight||r(t)),m[n]&&C(m[n],function(t){t()})}else d&&h.log(n,"Element uninstalled before being detectable.");delete m[n],++s===i.length&&l()}));d&&h.log(n,"Already detecable, adding listener."),a(c,t,o),s++}),s===i.length&&l()},removeListener:p.removeListener,removeAllListeners:p.removeAllListeners,uninstall:function(t){if(!t)return h.error("At least one element is required.");if(M(t))t=[t];else{if(!R(t))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");t=T(t)}C(t,function(t){p.removeAllListeners(t),g.uninstall(t),_.cleanState(t)})}}}({strategy:"scroll"}),A=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).resizeRef=g.createRef(),t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateSize()},e.componentDidUpdate=function(t){var e=this.props;t.width===e.width&&t.height===e.height||this._calculateSize()},e.componentWillUnmount=function(){this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0)},e._calculateSize=function(){var t,e=this,n=this.props,i=n.width,o=n.height,r=n.onResize;if(i<0||o<0){if(!this._resizeNode){var a=this.resizeRef.current;if(!a)return;return void D.listenTo(this._resizeNode=a,function(){return e._calculateSize()})}t=s(this._resizeNode)}else this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0),t={width:i,height:o};r(t)},e.render=function(){var t=this.props,e=t.width,n=t.height,i=t.style,o=t.children,r=p(t,["width","height","onResize","style","children"]),a=m({position:"absolute",width:e<0?"auto":e,height:n<0?"auto":n},i);return g.createElement("div",m({},r,{ref:this.resizeRef,style:a}),"function"==typeof o?o(this):o)},t}(g.PureComponent);function P(t,e,n){if(n){var i,o="y"===n?["y","height"]:["x","width"],r=o[0],a=o[1],s=Math.max(t[r],e[r]),c=Math.min(t[r]+t[a],e[r]+e[a]);return(i={})[r]=s-t[r],i[a]=Math.max(0,c-s),i}return m({},P(t,e,"x"),P(t,e,"y"))}function L(t,e,n){if(n){var i="y"===n?["y","height"]:["x","width"],o=i[0],r=i[1],a=t[o]-e[o];return-.25*e[r]<a+t[r]&&a<1.25*e[r]}return L(t,e,"x")&&L(t,e,"y")}A.defaultProps={width:-1,height:-1,onResize:function(){}};var k=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).state={size:{width:0,height:0},layoutAttrs:[],count:{row:0,column:0}},t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateLayout()},e.componentDidUpdate=function(t){var e=this.props;t.direction===e.direction&&t.width===e.width&&t.height===e.height&&t.rowSpacing===e.rowSpacing&&t.columnSpacing===e.columnSpacing&&t.itemCount===e.itemCount&&t.itemWidth===e.itemWidth&&t.itemHeight===e.itemHeight||this._calculateLayout()},e.getSize=function(){return this.state.size},e.getCount=function(){return this.state.count},e.getItemRect=function(t){var e,n,i,o=t.itemIndex,r=t.rowIndex,a=t.columnIndex,s=this.state;void 0!==r&&void 0!==a&&(o=(e={row:r,column:a})[i=(n="x"===this.props.direction?["column","row"]:["row","column"])[1]]+e[n[0]]*s.count[i]);var c=s.layoutAttrs[o];return c?c.rect:null},e._calculateLayout=function(){this.setState(function(t,e){var n=e.onResize,i=function(t,e,n,i,o){var r,a,s="x"===o?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],c=s[0],l=s[1],d=s[2],u=s[3],h=s[4],f=s[5],g=i[d],p=0,v=0,m=0,y=[];g<0?(g=e*t[d],1<e&&(g+=(e-1)*n[f]),m=e):0===t[d]&&0===n[f]?m=e:(m=1,t[d]<g&&(m+=Math.floor((g-t[d])/(t[d]+n[f]))));0<m&&(v=Math.ceil(e/m));for(var b=0;b<v;b++){0<b&&(p+=n[h]);for(var w=0;w<m;w++){var x,z,S=w+b*m,_=0;if(1<m&&(_+=Math.round(w*((g-t[d])/(m-1)))),S<e)y.push(((z={rect:(x={},x[c]=_,x[l]=p,x[d]=t[d],x[u]=t[u],x)})[h+"Index"]=b,z[f+"Index"]=w,z.itemIndex=S,z))}p+=t[u]}return{count:(r={},r[h]=v,r[f]=m,r),size:(a={},a[d]=g,a[u]=p,a),layoutAttrs:y}}({width:e.itemWidth,height:e.itemHeight},e.itemCount,{row:e.rowSpacing,column:e.columnSpacing},{width:e.width,height:e.height},e.direction);return t.size.width===i.size.width&&t.size.height===i.size.height||n(i.size),i})},e._renderItem=function(t,e){var n=(0,this.props.renderItem)(m({},t,{visibleRect:e})),i=n.type,o=n.props,r=o.style,a=p(o,["style"]),s=n.key||t.itemIndex,c=m({position:"absolute",left:t.rect.x,top:t.rect.y,width:t.rect.width,height:t.rect.height},r);return g.createElement(i,m({},a,{key:s,style:c}))},e.render=function(){for(var t=this.props,e=t.itemCount,n=t.visibleRect,i=this.state.layoutAttrs,o=[],r=0;r<e;r++){var a=i[r];a&&L(a.rect,n)&&o.push(this._renderItem(a,P(a.rect,n)))}return o},t}(g.PureComponent);k.defaultProps={direction:"y",width:-1,height:-1,rowSpacing:0,columnSpacing:0,itemCount:0,itemWidth:0,itemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}};var W=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).resizeRef=g.createRef(),t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateSize()},e.componentDidUpdate=function(t){var e=this.props;t.width===e.width&&t.height===e.height&&t.hash===e.hash||this._calculateSize()},e._calculateSize=function(){var t=this.props,e=t.width,n=t.height,i=t.hash;(0,t.onResize)(e<0||n<0?(0,t.getSizeByHash)(i)||s(this.resizeRef.current):{width:e,height:n},i)},e.render=function(){var t=this.props,e=t.width,n=t.height,i=t.style,o=t.children,r=p(t,["width","height","hash","getSizeByHash","onResize","style","children"]),a=m({position:"absolute",width:e<0?"auto":e,height:n<0?"auto":n},i);return g.createElement("div",m({},r,{ref:this.resizeRef,style:a}),"function"==typeof o?o(this):o)},t}(g.PureComponent);W.defaultProps={width:-1,height:-1,hash:"Item",getSizeByHash:function(){return null},onResize:function(){}};var H=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).state={size:{width:0,height:0},layoutAttrs:[],itemHashList:[],itemSizeDict:{}},t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateLayout()},e.componentDidUpdate=function(t){var e=this.props;t.direction===e.direction&&t.width===e.width&&t.height===e.height&&t.spacing===e.spacing&&t.itemCount===e.itemCount&&t.estimatedItemWidth===e.estimatedItemWidth&&t.estimatedItemHeight===e.estimatedItemHeight||this._calculateLayout()},e.getSize=function(){return this.state.size},e.getItemRect=function(t){var e=this.state.layoutAttrs[t.itemIndex];return e?e.rect:null},e._calculateLayout=function(g,p,v){this.setState(function(t,e){var n=e.direction,i=e.spacing,o=e.itemCount,r=e.estimatedItemWidth,a=e.estimatedItemHeight,s=e.onResize,c=t.itemHashList,l=t.itemSizeDict,d=c,u=l;if(void 0!==g){var h;if(d[g]===p)return null;u=m({},u,((h={})[(d=[].concat(d))[g]=p]=v,h))}var f=function(t,e,n,i,o,r){for(var a,s="x"===r?["y","x","height","width"]:["x","y","width","height"],c=s[0],l=s[1],d=s[2],u=s[3],h=0,f=0,g=[],p=0;p<i;p++){var v;0<p&&(f+=o);var m=e[p],y=n[m]||t;g.push({rect:(v={},v[c]=0,v[l]=f,v[d]=y[d],v[u]=y[u],v),itemIndex:p}),f+=y[u],h<y[d]&&(h=y[d])}return{size:(a={},a[d]=h,a[u]=f,a),layoutAttrs:g}}({width:r,height:a},d,u,o,i,n);return d!==c&&(f.itemHashList=d),u!==l&&(f.itemSizeDict=u),t.size.width===f.size.width&&t.size.height===f.size.height||s(f.size),f})},e._renderItem=function(n,t){var i=this,e=this.props,o=e.direction,r=e.width,a=e.height,s=this.state.itemSizeDict,c=(0,e.renderItem)(m({},n,{visibleRect:t,Item:W})),l=c.key||n.itemIndex,d={position:"absolute",left:n.rect.x,top:n.rect.y,width:n.rect.width,height:n.rect.height};c.type!==W&&(c=g.createElement(W,{hash:l},c));var u=c.props,h=u.onResize,f=p(u,["onResize"]);return f.onResize=function(t,e){i._calculateLayout(n.itemIndex,e,t),h(t)},f.getSizeByHash=function(t){return s[t]},"x"===o?f.height=a:f.width=r,g.createElement("div",{key:l,style:d},g.createElement(W,f))},e.render=function(){for(var t=this.props,e=t.itemCount,n=t.visibleRect,i=this.state.layoutAttrs,o=[],r=0;r<e;r++){var a=i[r];a&&L(a.rect,n)&&o.push(this._renderItem(a,P(a.rect,n)))}return o},t}(g.PureComponent);H.defaultProps={direction:"y",width:-1,height:-1,spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}};var N=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).state={size:{width:0,height:0}},t.resizeRef=g.createRef(),t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateSize()},e.componentDidUpdate=function(t){t.width===this.props.width&&t.height===this.props.height||this._calculateSize()},e.componentWillUnmount=function(){this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0)},e._calculateSize=function(){var t,e=this,n=this.props,i=n.width,o=n.height;if(i<0||o<0){if(!this._resizeNode){var r=this.resizeRef.current;if(!r)return;return void D.listenTo(this._resizeNode=r,function(){return e._calculateSize()})}t=s(this._resizeNode)}else this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0),t={width:i,height:o};this.setState({size:t})},e.render=function(){var t=this.props,e=t.width,n=t.height;return g.createElement("div",{ref:this.resizeRef,style:{width:e<0?"100%":e,height:n<0?"100%":n}},(0,t.children)(this.state.size))},t}(g.Component);N.defaultProps={children:function(){return null},width:-1,height:-1};var B=function(e){function t(t){var s;return(s=e.call(this,t)||this)._onPadResize=function(t){var e=s.props,n=e.onResize,i=s.state.pageCount,o=j({direction:e.direction,size:t,contentSize:s.padRef.current.getContentSize()});o!==i&&s.setState({pageCount:o}),n&&n(t)},s._onPadContentResize=function(t){var e=s.props,n=e.onContentResize,i=s.state.pageCount,o=j({direction:e.direction,size:s.padRef.current.getSize(),contentSize:t});o!==i&&s.setState({pageCount:o}),n&&n(t)},s._onPadScroll=function(t){var e=t.dragging,n=t.decelerating,i=s.props,o=i.onScroll,r="x"===i.direction?["x","width"]:["y","height"],a={activeIndex:Math.abs(Math.floor(t.contentOffset[r[0]]/t.size[r[1]]))};s.state.dragging!==e&&(a.dragging=e),s.state.decelerating!==n&&(a.decelerating=n),s.setState(a),o&&o(t)},s._onMouseEnter=function(){s.setState({mouseEntered:!0})},s._onMouseLeave=function(){s.setState({mouseEntered:!1})},s.state={pageCount:0,activeIndex:0,dragging:!1,decelerating:!1,mouseEntered:!1},s.padRef=g.createRef(),s}r(t,e);var n=t.prototype;return n.componentDidMount=function(){var t=this.props,e=t.autoplayEnabled,n=this.padRef.current,i=j({direction:t.direction,size:n.getSize(),contentSize:n.getContentSize()});this.setState({pageCount:i}),e&&this.play()},n.componentDidUpdate=function(t,e){var n=this.props,i=n.direction,o=n.autoplayEnabled,r=this.state,a=r.pageCount,s=r.activeIndex,c=r.dragging,l=r.decelerating,d=r.mouseEntered;if(t.direction!==i||t.width!==n.width||t.contentWidth!==n.contentWidth||t.height!==n.height||t.contentHeight!==n.contentHeight){var u=this.padRef.current,h=(u.getSize(),u.getContentSize(),j(i));h!==a&&this.setState({pageCount:h})}t.autoplayEnabled===o&&e.dragging===c&&e.decelerating===l&&e.activeIndex===s&&e.mouseEntered===d||(!o||c||d||l||a<=s+1?this.pause():this.play())},n.componentWillUnmount=function(){this.pause()},n.getPageCount=function(){return this.state.pageCount},n.getActiveIndex=function(){return this.state.activeIndex},n.play=function(){var t=this,e=this.props.autoplayInterval;this._autoplayTimer&&(this.forward(),clearTimeout(this._autoplayTimer)),this._autoplayTimer=setTimeout(function(){t.play()},e)},n.pause=function(){this._autoplayTimer&&(clearTimeout(this._autoplayTimer),this._autoplayTimer=void 0)},n.setFrame=function(t,e){void 0===e&&(e=!0);var n=this.props.direction,i=this.padRef.current,o=i.getContentOffset(),r=i.getSize();i.scrollTo({offset:0===t?{x:0,y:0}:{x:"x"===n?-t*r.width:o.x,y:"x"===n?o.y:-t*r.height},animated:e})},n.rewind=function(){this.setFrame(this.state.activeIndex-1)},n.forward=function(){this.setFrame(this.state.activeIndex+1)},n.render=function(){var t=this.props,e=t.direction,n=t.children,i=p(t,["direction","autoplayEnabled","autoplayInterval","children"]),o={alwaysBounceX:!1,alwaysBounceY:!1};return"x"===e?o.alwaysBounceX=!0:o.alwaysBounceY=!0,g.createElement(a,m({ref:this.padRef},i,o,{pagingEnabled:!0,onScroll:this._onPadScroll,onResize:this._onPadResize,onContentResize:this._onPadContentResize,onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave}),"function"==typeof n?n(this):n)},t}(g.PureComponent);function j(t){var e=t.size,n="x"===t.direction?"width":"height";return e[n]?Math.round(t.contentSize[n]/e[n]):0}B.defaultProps={direction:"y",autoplayEnabled:!0,autoplayInterval:3e3};var U=function(n){function t(t){var e;return(e=n.call(this,t)||this)._onPlayerFrameChange=function(t){},e.state={playerExisted:!1},e.playerRef=g.createRef(),e}r(t,n);var e=t.prototype;return e.componentDidMount=function(){this.playerRef&&this.setState({playerExisted:!0})},e.componentDidUpdate=function(t,e){},e.componentWillUnmount=function(){},e.slideTo=function(t){},e.slidePrev=function(){},e.slideNext=function(){},e.render=function(){var t=this.props,r=t.loop,a=t.children,s=p(t,["loop","children"]);return g.createElement(B,m({ref:this.playerRef},s),function(t){if(r){var e=t.padRef.current,n=s.direction,i=e?e.getContentSize():{width:s.contentWidth,height:s.conte},o=e?e.getVisibleRect():{x:0,y:0,width:0,height:0};return g.createElement(H,{direction:n,height:i.height,estimatedItemWidth:i.width,estimatedItemHeight:i.height,itemCount:2,renderItem:function(){return g.createElement("div",{style:{position:"relative",width:i.width,height:i.height}},a)},visibleRect:o,onResize:function(t){return e.setContentSize(t)}})}return a})},t}(g.PureComponent);U.defaultProps={direction:"y",loop:!0},t.Pad=a,t.Pannable=h,t.GeneralContent=A,t.GridContent=k,t.ListContent=H,t.ItemContent=W,t.AutoResizing=N,t.Player=B,t.Carousel=U,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).ReactPannable={},t.React)}(this,function(t,g){"use strict";function p(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)e.indexOf(n=r[i])<0&&(o[n]=t[n]);return o}function m(){return(m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}g=g&&g.hasOwnProperty("default")?g.default:g;var e,u={create:function(t){var e,n=t.transformTranslate;return m({},p(t,["transformTranslate"]),(e=n)?{transform:"translate3d("+e[0]+"px, "+e[1]+"px, 0)",WebkitTransform:"translate3d("+e[0]+"px, "+e[1]+"px, 0)",msTransform:"translate("+e[0]+"px, "+e[1]+"px)"}:null)}},h=function(i){function t(){for(var o,t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return(o=i.call.apply(i,[this].concat(e))||this).state={target:null,translation:null,interval:null,velocity:null,startPoint:null,movePoint:null,moveTime:null},o.elemRef=g.createRef(),o._onTouchStart=function(t){var e=o.props,n=e.onTouchStart;t.touches&&1===t.touches.length&&e.enabled&&o._track(t.touches[0]),n&&n(t)},o._onTouchMove=function(t){var e=o.props.onTouchMove;t.touches&&1===t.touches.length&&o._move(t.touches[0]),e&&e(t)},o._onTouchEnd=function(t){var e=o.props.onTouchEnd;t.changedTouches&&1===t.changedTouches.length&&o._end(),e&&e(t)},o._onTouchCancel=function(t){var e=o.props.onTouchCancel;t.changedTouches&&1===t.changedTouches.length&&o._end(),e&&e(t)},o._onMouseDown=function(t){var e=o.props,n=e.enabled,i=e.onMouseDown;(o._shouldPreventClick=n)&&(o._removeMousePanListener(),o._addMousePanListener(),o._track(t)),i&&i(t)},o._onMouseMove=function(t){t.preventDefault(),o._move(t)},o._onMouseUp=function(t){t.preventDefault(),o._removeMousePanListener(),o._end()},o._onClick=function(t){var e=o.props.onClick;o._shouldPreventClick&&t.preventDefault(),o._shouldPreventClick=!1,e&&e(t)},o}r(t,i);var e=t.prototype;return e.componentDidUpdate=function(t){var e=this.props.enabled;t.enabled===e||e||this._cancel()},e.componentWillUnmount=function(){this._removeMousePanListener()},e._track=function(t){this.setState({startPoint:{x:t.pageX,y:t.pageY},movePoint:{x:t.pageX,y:t.pageY},moveTime:(new Date).getTime()})},e._move=function(p){p={target:p.target,pageX:p.pageX,pageY:p.pageY},this.setState(function(t,e){var n=e.shouldStart,i=e.onStart,o=e.onMove,r=t.target,a=t.startPoint,s=t.movePoint,c=t.moveTime;if(!a)return null;var l=(new Date).getTime(),d={x:p.pageX,y:p.pageY},u=l-c,h={x:d.x-a.x,y:d.y-a.y},f={x:(d.x-s.x)/u,y:(d.y-s.y)/u},g={translation:h,velocity:f,interval:u,movePoint:d,moveTime:l};r?o({target:r,translation:h,velocity:f,interval:u}):0<Math.sqrt(h.x*h.x+h.y*h.y)&&n({target:p.target,translation:h,velocity:f,interval:u})&&(g.target=p.target,g.startPoint={x:p.pageX,y:p.pageY},g.translation=h={x:0,y:0},i({target:p.target,translation:h,velocity:f,interval:u}));return g})},e._end=function(){this.setState(function(t,e){var n=t.target;return n&&e.onEnd({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._cancel=function(){this.setState(function(t,e){var n=t.target;return n&&e.onCancel({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._addMousePanListener=function(){var t=document.documentElement;t.addEventListener("mousemove",this._onMouseMove,!1),t.addEventListener("mouseup",this._onMouseUp,!1)},e._removeMousePanListener=function(){var t=document.documentElement;t.removeEventListener("mousemove",this._onMouseMove,!1),t.removeEventListener("mouseup",this._onMouseUp,!1)},e.render=function(){var t=this.props,e=t.enabled,n=t.style,i=p(t,["enabled","shouldStart","onStart","onMove","onEnd","onCancel","style"]),o=u.create(m({touchAction:e?"none":"auto"},n));return g.createElement("div",m({},i,{ref:this.elemRef,style:o,onTouchStart:this._onTouchStart,onTouchEnd:this._onTouchEnd,onTouchMove:this._onTouchMove,onTouchCancel:this._onTouchCancel,onMouseDown:this._onMouseDown,onClick:this._onClick}))},t}(g.PureComponent);h.defaultProps={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}};var v=(e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||e.setTimeout&&function(t){return e.setTimeout(t,20)}||function(){},y=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame||e.clearTimeout||function(){};function b(t,e){var n=e.x,i=e.y,o=Math.sqrt(n*n+i*i);return 0===o?{x:0,y:0}:{x:t*(n/o),y:t*(i/o)}}function w(t,e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],c=Math.min(e[s]-n[s],0);return c=Math.max(c,Math.min(t[a],0)),i&&(c=e[s]?e[s]*Math.round(c/e[s]):0),c}return{x:w(t,e,n,i,"x"),y:w(t,e,n,i,"y")}}function l(t,e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],c=Math.min(n[s]-i[s],0);return c=Math.max(c,Math.min(e[a],0)),t[a]<(c=n[s]?n[s]*Math.floor(c/n[s]):0)+.5*n[s]?c:c+n[s]}return{x:l(t,e,n,i,"x"),y:l(t,e,n,i,"y")}}var x=.04,a=function(n){function t(t){var e;return(e=n.call(this,t)||this)._onDragStart=function(t){var r=t.velocity;e.setState(function(t,e){var n=t.contentOffset,i=e.directionalLockEnabled?Math.abs(r.y)<Math.abs(r.x)?{x:1,y:0}:{x:0,y:1}:{x:1,y:1},o={x:i.x*r.x,y:i.y*r.y};return{contentOffset:m({},n),contentVelocity:o,dragging:!0,dragStartOffset:n,dragDirection:i,decelerating:!1}})},e._onDragMove=function(t){var a=t.translation,s=t.interval;e.setState(function(t,e){var n=t.contentOffset,i=t.dragStartOffset,o=t.dragDirection,r=function t(e,n,i,o,r){if(r){var a="y"===r?["y","height","width"]:["x","width","height"],s=a[0],c=a[1],l=a[2],d=e[s],u=Math.min(i[c]-o[c],0),h=.5*Math.min(i[c],i[l]);return 0<d?n[s]?h*(1-h/(h+d)):0:d<u?n[s]?u-h*(1-h/(h-d+u)):u:d}return{x:t(e,n,i,o,"x"),y:t(e,n,i,o,"y")}}({x:i.x+o.x*a.x,y:i.y+o.y*a.y},{x:e.alwaysBounceX,y:e.alwaysBounceY},t.size,t.contentSize);return{contentOffset:r,contentVelocity:{x:(r.x-n.x)/s,y:(r.y-n.y)/s}}})},e._onDragEnd=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.size,o=t.contentSize,r=e.pagingEnabled,a=r?x:.004,s=function t(e,n,i,o){if(o){var r=e[o];return i[o]&&(r+=.5*n[o]*(n[o]/i[o])),r}return"number"==typeof i&&(i=b(i,n)),{x:t(e,n,i,"x"),y:t(e,n,i,"y")}}(n,t.contentVelocity,a);return r&&(s=l(n,s,i,o)),{contentOffset:m({},n),dragging:!1,decelerating:!0,decelerationEndOffset:s,decelerationRate:a}})},e._onDragCancel=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.dragStartOffset;return e.pagingEnabled&&(i=l(n,i,t.size,t.contentSize)),{contentOffset:m({},n),dragging:!1,decelerating:!0,decelerationEndOffset:i,decelerationRate:x}})},e.state={prevContentOffset:null,contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},size:{width:t.width,height:t.height},contentSize:{width:t.contentWidth,height:t.contentHeight},dragging:!1,dragStartOffset:null,dragDirection:null,decelerating:!1,decelerationEndOffset:null,decelerationRate:x},e.boundingRef=g.createRef(),e.contentRef=g.createRef(),e.setContentSize=e.setContentSize.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)),e}r(t,n),t.getDerivedStateFromProps=function(t,e){var n=e.contentOffset,i=e.contentVelocity,o=e.size,r=e.contentSize,a=e.dragging,s=e.decelerating,c=e.decelerationEndOffset,l=e.decelerationRate,d={};if(e.prevContentOffset!==n){var u=s,h=c,f=l;if(u){var g=w(n,o,r,!1);g.x===n.x&&g.y===n.y||(f=x,(g.x!==n.x&&g.x!==h.x||g.y!==n.y&&g.y!==h.y)&&(h={x:g.x!==n.x?g.x:h.x,y:g.y!==n.y?g.y:h.y})),h.x===n.x&&h.y===n.y&&0===i.x&&0===i.y&&(u=!1)}d.prevContentOffset=n,u!==s&&(d.decelerating=u),f!==l&&(d.decelerationRate=f),h!==c&&(d.decelerationEndOffset=h),t.onScroll({contentOffset:n,contentVelocity:i,size:o,contentSize:r,dragging:a,decelerating:u})}return d};var e=t.prototype;return e.componentDidUpdate=function(t,e){var n=this,i=this.props,o=i.width,r=i.height,a=i.contentWidth,s=i.contentHeight,c=i.pagingEnabled,l=i.onResize,d=i.onContentResize;if(t.width!==o||t.height!==r){var u={width:o,height:r};this._setStateWithScroll({size:u}),l(u)}if(t.contentWidth!==a||t.contentHeight!==s){var h={width:a,height:s};this._setStateWithScroll({contentSize:h}),d(h)}if(t.pagingEnabled!==c&&c&&this._setStateWithScroll(null),e.contentOffset!==this.state.contentOffset&&this.state.decelerating){var f=(new Date).getTime();this._deceleratingTimer&&y(this._deceleratingTimer),this._deceleratingTimer=v(function(){n._deceleratingTimer=void 0,n._decelerate((new Date).getTime()-f)})}},e.componentWillUnmount=function(){this._deceleratingTimer&&(y(this._deceleratingTimer),this._deceleratingTimer=void 0)},e.getSize=function(){return this.state.size},e.getContentSize=function(){return this.state.contentSize},e.getContentOffset=function(){return this.state.contentOffset},e.isDragging=function(){return this.state.dragging},e.isDecelerating=function(){return this.state.decelerating},e.getVisibleRect=function(){var t=this.state,e=t.contentOffset,n=t.size;return{x:-e.x,y:-e.y,width:n.width,height:n.height}},e.setContentSize=function(t){this._setStateWithScroll({contentSize:t}),this.props.onContentResize(t)},e.scrollToRect=function(t){var e=t.rect,n=t.align,i=void 0===n?"auto":n;this._setContentOffset(function(t){return function t(e,n,i,o,r){if(r){var a="y"===r?["y","height"]:["x","width"],s=a[0],c=a[1],l=-e[s],d=o[c]-e[c];if("auto"===n[s]){var u=d<0?-1:1;l+=u*Math.max(0,Math.min(u*(i[s]-l),u*d))}else"start"===n[s]?n[s]=0:"center"===n[s]?n[s]=.5:"end"===n[s]&&(n[s]=1),("number"!=typeof n[s]||isNaN(n[s]))&&(n[s]=.5),l+=n[s]*d;return l}return"object"!=typeof n&&(n={x:n,y:n}),{x:t(e,n,i,o,"x"),y:t(e,n,i,o,"y")}}(e,i,t.contentOffset,t.size)},t.animated)},e.scrollTo=function(t){this._setContentOffset(t.offset,t.animated)},e._setContentOffset=function(i,o){this.setState(function(t,e){"function"==typeof i&&(i=i(t,e));var n=t.contentOffset;return t.dragging?null:(i=w(i,t.size,t.contentSize,e.pagingEnabled),o?{contentOffset:m({},n),decelerating:!0,decelerationEndOffset:i,decelerationRate:x}:{contentOffset:i,contentVelocity:{x:0,y:0},decelerating:!1})})},e._setStateWithScroll=function(o){this.setState(function(t,e){var n=t.contentOffset;if(t.dragging)return o;var i=w(n,t.size,t.contentSize,e.pagingEnabled);return i.x===n.x&&i.y===n.y?o:m({},o,{contentOffset:m({},n),decelerating:!0,decelerationEndOffset:i,decelerationRate:x})})},e._decelerate=function(n){this.setState(function(t){if(!t.decelerating)return null;var e=function t(e,n,i,o,r,a,s){if(s){var c,l="y"===s?["y","height"]:["x","width"],d=l[0],u=l[1],h=o[d],f=i[d];if(n[d]){var g=n[d]<0?-1:1,p=g*Math.sqrt(.5*f*f+n[d]*(r[d]-h)),v=(p-f)/n[d];v<0&&(p=f,v=0),(2*p-f)/n[d]<e?(f=0,h=r[d]):0<g*(r[d]-(h+=.5*(i[d]+p)*v-.5*(p+(f=p-n[d]*Math.abs(v-e)))*(v-e)))||(console.log("slow"),f=(f<0?-1:1)*Math.min(Math.abs(f),Math.sqrt(2*g*n[d]*.25*a[u])))}else h+=f*e;return(c={})[d+"Offset"]=h,c[d+"Velocity"]=f,c}return"number"==typeof n&&(n=b(n,{x:r.x-o.x,y:r.y-o.y})),m({},t(e,n,i,o,r,a,"x"),t(e,n,i,o,r,a,"y"))}(n,t.decelerationRate,t.contentVelocity,t.contentOffset,t.decelerationEndOffset,t.size);return{contentOffset:{x:e.xOffset,y:e.yOffset},contentVelocity:{x:e.xVelocity,y:e.yVelocity}}})},e.render=function(){var t=this.props,e=t.scrollEnabled,n=t.style,i=t.children,o=p(t,["width","height","contentWidth","contentHeight","scrollEnabled","pagingEnabled","directionalLockEnabled","alwaysBounceX","alwaysBounceY","onScroll","onResize","onContentResize","style","children"]),r=this.state,a=r.size,s=r.contentSize,c=r.contentOffset,l=u.create(m({overflow:"hidden",position:"relative",boxSizing:"border-box",width:a.width,height:a.height},n)),d=u.create({position:"relative",boxSizing:"border-box",width:s.width,height:s.height,transformTranslate:[c.x,c.y]});return g.createElement(h,m({},o,{ref:this.boundingRef,style:l,enabled:e,onStart:this._onDragStart,onMove:this._onDragMove,onEnd:this._onDragEnd,onCancel:this._onDragCancel}),g.createElement("div",{ref:this.contentRef,style:d},"function"==typeof i?i(this):i))},t}(g.PureComponent);function s(t){var e=window.getComputedStyle(t)||{},n=t.offsetWidth||0,i=t.offsetHeight||0;return e.paddingLeft&&(n-=parseInt(e.paddingLeft,10)),e.paddingRight&&(n-=parseInt(e.paddingRight,10)),e.borderLeftWidth&&(n-=parseInt(e.borderLeftWidth,10)),e.borderRightWidth&&(n-=parseInt(e.borderRightWidth,10)),e.paddingTop&&(i-=parseInt(e.paddingTop,10)),e.paddingBottom&&(i-=parseInt(e.paddingBottom,10)),e.borderTopWidth&&(i-=parseInt(e.borderTopWidth,10)),e.borderBottomWidth&&(i-=parseInt(e.borderBottomWidth,10)),{width:n,height:i}}function n(t,e){return t(e={exports:{}},e.exports),e.exports}a.defaultProps={children:null,width:0,height:0,contentWidth:0,contentHeight:0,scrollEnabled:!0,pagingEnabled:!1,directionalLockEnabled:!1,alwaysBounceX:!0,alwaysBounceY:!0,onScroll:function(){},onResize:function(){},onContentResize:function(){}};var i=n(function(t){(t.exports={}).forEach=function(t,e){for(var n=0;n<t.length;n++){var i=e(t[n]);if(i)return i}}}),z=n(function(t){var e=t.exports={};e.isIE=function(t){return(-1!=(e=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!=e.indexOf("trident")||-1!=e.indexOf(" edge/"))&&(!t||t===function(){for(var t=3,e=document.createElement("div"),n=e.getElementsByTagName("i");e.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:void 0}());var e},e.isLegacyOpera=function(){return!!window.opera}}),d=n(function(t){(t.exports={}).getOption=function(t,e,n){var i=t[e];return null!=i||void 0===n?i:n}}),S=function(t){var e=(t=t||{}).reporter,n=d.getOption(t,"async",!0),i=d.getOption(t,"auto",!0);i&&!n&&(e&&e.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,r=f(),a=!1;function s(){for(a=!0;r.size();){var t=r;r=f(),t.process()}a=!1}function c(){o=setTimeout(s,0)}return{add:function(t,e){!a&&i&&n&&0===r.size()&&c(),r.add(t,e)},force:function(t){a||(void 0===t&&(t=n),o&&(clearTimeout(o),o=null),t?c():s())}}};function f(){var i={},n=0,o=0,r=0;return{add:function(t,e){e||(e=t,t=0),o<t?o=t:t<r&&(r=t),i[t]||(i[t]=[]),i[t].push(e),n++},process:function(){for(var t=r;t<=o;t++)for(var e=i[t],n=0;n<e.length;n++)(0,e[n])()},size:function(){return n}}}var o="_erd";function c(t){return t[o]}var _={initState:function(t){return t[o]={},c(t)},getState:c,cleanState:function(t){delete t[o]}},I=i.forEach,E=function(t){var x=(t=t||{}).reporter,z=t.batchProcessor,S=t.stateHandler.getState,_=t.idHandler;if(!z)throw Error("Missing required dependency: batchProcessor");if(!x)throw Error("Missing required dependency: reporter.");var E=function(){var t=document.createElement("div");t.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var e=document.createElement("div");e.style.cssText="position: absolute; width: 500px; height: 500px; overflow: scroll; visibility: none; top: -1500px; left: -1500px; visibility: hidden; margin: 0; padding: 0;",e.appendChild(t),document.body.insertBefore(e,document.body.firstChild);var n=500-e.clientWidth,i=500-e.clientHeight;return document.body.removeChild(e),{width:n,height:i}}(),C="erd_scroll_detection_container";function R(t,e,n){if(t.addEventListener)t.addEventListener(e,n);else{if(!t.attachEvent)return x.error("[scroll] Don't know how to add event listeners.");t.attachEvent("on"+e,n)}}function n(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n);else{if(!t.detachEvent)return x.error("[scroll] Don't know how to remove event listeners.");t.detachEvent("on"+e,n)}}function T(t){return S(t).container.childNodes[0].childNodes[0].childNodes[0]}function M(t){return S(t).container.childNodes[0].childNodes[0].childNodes[1]}return function(i,t){if(!document.getElementById(i)){var e=t+"_animation",n=t+"_animation_active",o="/* Created by the element-resize-detector library. */\n";o+="."+t+" > div::-webkit-scrollbar { display: none; }\n\n",o+="."+n+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+e+"; animation-name: "+e+"; }\n",o+="@-webkit-keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(t,e){e=e||function(t){document.head.appendChild(t)};var n=document.createElement("style");n.innerHTML=t,n.id=i,e(n)}(o+="@keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}("erd_scroll_detection_scrollbar_style",C),{makeDetectable:function(a,v,t){function m(){if(a.debug){var t=Array.prototype.slice.call(arguments);if(t.unshift(_.get(v),"Scroll: "),x.log.apply)x.log.apply(null,t);else for(var e=0;e<t.length;e++)x.log(t[e])}}function s(t){var e=S(t).container.childNodes[0],n=window.getComputedStyle(e);return!n.width||-1==n.width.indexOf("px")}function e(){var t=window.getComputedStyle(v),e={};return e.position=t.position,e.width=v.offsetWidth,e.height=v.offsetHeight,e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left,e.widthCSS=t.width,e.heightCSS=t.height,e}function n(){if(m("storeStyle invoked."),S(v)){var t=e();S(v).style=t}else m("Aborting because element has been uninstalled")}function c(t,e,n){S(t).lastWidth=e,S(t).lastHeight=n}function l(){return 2*E.width+1}function d(){return 2*E.height+1}function u(t){return t+10+l()}function h(t){return t+10+d()}function f(t,e,n){var i=T(t),o=M(t),r=u(e),a=h(n),s=2*e+l(),c=2*n+d();i.scrollLeft=r,i.scrollTop=a,o.scrollLeft=s,o.scrollTop=c}function y(){var t=S(v).container;if(!t){(t=document.createElement("div")).className=C,t.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",(S(v).container=t).className+=" "+C+"_animation_active",v.appendChild(t);var e=function(){S(v).onRendered&&S(v).onRendered()};R(t,"animationstart",e),S(v).onAnimationStart=e}return t}function i(){if(m("Injecting elements"),S(v)){!function(){var t=S(v).style;if("static"===t.position){v.style.position="relative";var e=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};e(x,v,t,"top"),e(x,v,t,"right"),e(x,v,t,"bottom"),e(x,v,t,"left")}}();var t=S(v).container;t||(t=y());var e,n,i,o,r=E.width,a=E.height,s="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; left: "+(e=(e=-(1+r))?e+"px":"0")+"; top: "+(n=(n=-(1+a))?n+"px":"0")+"; right: "+(o=(o=-r)?o+"px":"0")+"; bottom: "+(i=(i=-a)?i+"px":"0")+";",c=document.createElement("div"),l=document.createElement("div"),d=document.createElement("div"),u=document.createElement("div"),h=document.createElement("div"),f=document.createElement("div");c.dir="ltr",c.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",l.className=c.className=C,l.style.cssText=s,d.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",u.style.cssText="position: absolute; left: 0; top: 0;",h.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",f.style.cssText="position: absolute; width: 200%; height: 200%;",d.appendChild(u),h.appendChild(f),l.appendChild(d),l.appendChild(h),c.appendChild(l),t.appendChild(c),R(d,"scroll",g),R(h,"scroll",p),S(v).onExpandScroll=g,S(v).onShrinkScroll=p}else m("Aborting because element has been uninstalled");function g(){S(v).onExpand&&S(v).onExpand()}function p(){S(v).onShrink&&S(v).onShrink()}}function o(){function i(t,e,n){var i=T(t).childNodes[0],o=u(e),r=h(n);i.style.width=o+"px",i.style.height=r+"px"}function n(t){var e=v.offsetWidth,n=v.offsetHeight;m("Storing current size",e,n),c(v,e,n),z.add(0,function(){S(v)?o()?(a.debug&&(v.offsetWidth===e&&v.offsetHeight===n||x.warn(_.get(v),"Scroll: Size changed before updating detector elements.")),i(v,e,n)):m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")}),z.add(1,function(){S(v)?o()?f(v,e,n):m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")}),t&&z.add(2,function(){S(v)?o()?t():m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")})}function o(){return!!S(v).container}function r(){m("notifyListenersIfNeeded invoked");var t=S(v);return void 0===S(v).lastNotifiedWidth&&t.lastWidth===t.startSize.width&&t.lastHeight===t.startSize.height?m("Not notifying: Size is the same as the start size, and there has been no notification yet."):t.lastWidth===t.lastNotifiedWidth&&t.lastHeight===t.lastNotifiedHeight?m("Not notifying: Size already notified"):(m("Current size not notified, notifying..."),t.lastNotifiedWidth=t.lastWidth,t.lastNotifiedHeight=t.lastHeight,void I(S(v).listeners,function(t){t(v)}))}function t(){if(m("Scroll detected."),s(v))m("Scroll event fired while unrendered. Ignoring...");else{var t=v.offsetWidth,e=v.offsetHeight;t!==S(v).lastWidth||e!==S(v).lastHeight?(m("Element size changed."),n(r)):m("Element size has not changed ("+t+"x"+e+").")}}if(m("registerListenersAndPositionElements invoked."),S(v)){S(v).onRendered=function(){if(m("startanimation triggered."),s(v))m("Ignoring since element is still unrendered...");else{m("Element rendered.");var t=T(v),e=M(v);0!==t.scrollLeft&&0!==t.scrollTop&&0!==e.scrollLeft&&0!==e.scrollTop||(m("Scrollbars out of sync. Updating detector elements..."),n(r))}},S(v).onExpand=t,S(v).onShrink=t;var e=S(v).style;i(v,e.width,e.height)}else m("Aborting because element has been uninstalled")}function r(){if(m("finalizeDomMutation invoked."),S(v)){var t=S(v).style;c(v,t.width,t.height),f(v,t.width,t.height)}else m("Aborting because element has been uninstalled")}function g(){t(v)}function p(){var t;m("Installing..."),S(v).listeners=[],t=e(),S(v).startSize={width:t.width,height:t.height},m("Element start size",S(v).startSize),z.add(0,n),z.add(1,i),z.add(2,o),z.add(3,r),z.add(4,g)}var b,w;t||(t=v,v=a,a=null),a=a||{},m("Making detectable..."),(w=b=v)!==w.ownerDocument.body&&!w.ownerDocument.body.contains(w)||null===window.getComputedStyle(b)?(m("Element is detached"),y(),m("Waiting until element is attached..."),S(v).onRendered=function(){m("Element is now attached"),p()}):p()},addListener:function(t,e){if(!S(t).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");S(t).listeners.push(e)},uninstall:function(t){var e=S(t);e&&(e.onExpandScroll&&n(T(t),"scroll",e.onExpandScroll),e.onShrinkScroll&&n(M(t),"scroll",e.onShrinkScroll),e.onAnimationStart&&n(e.container,"animationstart",e.onAnimationStart),e.container&&t.removeChild(e.container))}}},C=i.forEach;function R(t){return Array.isArray(t)||void 0!==t.length}function T(t){if(Array.isArray(t))return t;var e=[];return C(t,function(t){e.push(t)}),e}function M(t){return t&&1===t.nodeType}function O(t,e,n){var i=t[e];return null==i&&void 0!==n?n:i}var D=function(e){var u,t,i,o,n;if((e=e||{}).idHandler)u={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var r=(n=1,{generate:function(){return n++}}),a=(i=(t={idGenerator:r,stateHandler:_}).idGenerator,o=t.stateHandler.getState,{get:function(t){var e=o(t);return e&&void 0!==e.id?e.id:null},set:function(t){var e=o(t);if(!e)throw Error("setId required the element to have a resize detection state.");var n=i.generate();return e.id=n}});u=a}var h=e.reporter;h||(h=function(t){function e(){}var n={log:e,warn:e,error:e};if(!t&&window.console){var i=function(t,n){t[n]=function(){var t=console[n];if(t.apply)t.apply(console,arguments);else for(var e=0;e<arguments.length;e++)t(arguments[e])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}(!1===h));var s=O(e,"batchProcessor",S({reporter:h})),f={};f.callOnAdd=!!O(e,"callOnAdd",!0),f.debug=!!O(e,"debug",!1);var c,g,p=function(i){var o={};function r(t){var e=i.get(t);return void 0===e?[]:o[e]||[]}return{get:r,add:function(t,e){var n=i.get(t);o[n]||(o[n]=[]),o[n].push(e)},removeListener:function(t,e){for(var n=r(t),i=0,o=n.length;i<o;++i)if(n[i]===e){n.splice(i,1);break}},removeAllListeners:function(t){var e=r(t);e&&(e.length=0)}}}(u),v=(c={stateHandler:_}.stateHandler.getState,{isDetectable:function(t){var e=c(t);return e&&!!e.isDetectable},markAsDetectable:function(t){c(t).isDetectable=!0},isBusy:function(t){return!!c(t).busy},markBusy:function(t,e){c(t).busy=!!e}}),l=O(e,"strategy","object"),d={reporter:h,batchProcessor:s,stateHandler:_,idHandler:u};if("scroll"===l&&(z.isLegacyOpera()?(h.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),l="object"):z.isIE(9)&&(h.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),l="object")),"scroll"===l)g=E(d);else{if("object"!==l)throw Error("Invalid strategy name: "+l);g=function(t){var s=(t=t||{}).reporter,c=t.batchProcessor,l=t.stateHandler.getState;if(!s)throw Error("Missing required dependency: reporter.");function i(t){return l(t).object}return{makeDetectable:function(t,e,n){n||(n=e,e=t,t=null),t=t||{},z.isIE(8)?n(e):function(n,i){var o=!1,r=window.getComputedStyle(n),t=n.offsetWidth,e=n.offsetHeight;function a(){function t(){if("static"===r.position){n.style.position="relative";var t=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};t(s,n,r,"top"),t(s,n,r,"right"),t(s,n,r,"bottom"),t(s,n,r,"left")}}""!==r.position&&(t(),o=!0);var e=document.createElement("object");e.style.cssText="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;",e.tabIndex=-1,e.type="text/html",e.setAttribute("aria-hidden","true"),e.onload=function(){o||t(),function t(e,n){e.contentDocument?n(e.contentDocument):setTimeout(function(){t(e,n)},100)}(this,function(t){i(n)})},z.isIE()||(e.data="about:blank"),n.appendChild(e),l(n).object=e,z.isIE()&&(e.data="about:blank")}l(n).startSize={width:t,height:e},c?c.add(a):a()}(e,n)},addListener:function(t,e){if(!i(t))throw Error("Element is not detectable by this strategy.");function n(){e(t)}z.isIE(8)?(l(t).object={proxy:n},t.attachEvent("onresize",n)):i(t).contentDocument.defaultView.addEventListener("resize",n)},uninstall:function(t){z.isIE(8)?t.detachEvent("onresize",l(t).object.proxy):t.removeChild(i(t)),delete l(t).object}}}(d)}var m={};return{listenTo:function(t,i,o){function r(e){var t=p.get(e);C(t,function(t){t(e)})}function a(t,e,n){p.add(e,n),t&&n(e)}if(o||(o=i,i=t,t={}),!i)throw Error("At least one element required.");if(!o)throw Error("Listener required.");if(M(i))i=[i];else{if(!R(i))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");i=T(i)}var s=0,c=O(t,"callOnAdd",f.callOnAdd),l=O(t,"onReady",function(){}),d=O(t,"debug",f.debug);C(i,function(t){_.getState(t)||(_.initState(t),u.set(t));var n=u.get(t);if(d&&h.log("Attaching listener to element",n,t),!v.isDetectable(t))return d&&h.log(n,"Not detectable."),v.isBusy(t)?(d&&h.log(n,"System busy making it detectable"),a(c,t,o),m[n]=m[n]||[],void m[n].push(function(){++s===i.length&&l()})):(d&&h.log(n,"Making detectable..."),v.markBusy(t,!0),g.makeDetectable({debug:d},t,function(t){if(d&&h.log(n,"onElementDetectable"),_.getState(t)){v.markAsDetectable(t),v.markBusy(t,!1),g.addListener(t,r),a(c,t,o);var e=_.getState(t);e&&e.startSize&&(e.startSize.width===t.offsetWidth&&e.startSize.height===t.offsetHeight||r(t)),m[n]&&C(m[n],function(t){t()})}else d&&h.log(n,"Element uninstalled before being detectable.");delete m[n],++s===i.length&&l()}));d&&h.log(n,"Already detecable, adding listener."),a(c,t,o),s++}),s===i.length&&l()},removeListener:p.removeListener,removeAllListeners:p.removeAllListeners,uninstall:function(t){if(!t)return h.error("At least one element is required.");if(M(t))t=[t];else{if(!R(t))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");t=T(t)}C(t,function(t){p.removeAllListeners(t),g.uninstall(t),_.cleanState(t)})}}}({strategy:"scroll"}),A=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).resizeRef=g.createRef(),t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateSize()},e.componentDidUpdate=function(t){var e=this.props;t.width===e.width&&t.height===e.height||this._calculateSize()},e.componentWillUnmount=function(){this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0)},e._calculateSize=function(){var t,e=this,n=this.props,i=n.width,o=n.height,r=n.onResize;if(i<0||o<0){if(!this._resizeNode){var a=this.resizeRef.current;if(!a)return;return void D.listenTo(this._resizeNode=a,function(){return e._calculateSize()})}t=s(this._resizeNode)}else this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0),t={width:i,height:o};r(t)},e.render=function(){var t=this.props,e=t.width,n=t.height,i=t.style,o=t.children,r=p(t,["width","height","onResize","style","children"]),a=m({position:"absolute",width:e<0?"auto":e,height:n<0?"auto":n},i);return g.createElement("div",m({},r,{ref:this.resizeRef,style:a}),"function"==typeof o?o(this):o)},t}(g.PureComponent);function P(t,e,n){if(n){var i,o="y"===n?["y","height"]:["x","width"],r=o[0],a=o[1],s=Math.max(t[r],e[r]),c=Math.min(t[r]+t[a],e[r]+e[a]);return(i={})[r]=s-t[r],i[a]=Math.max(0,c-s),i}return m({},P(t,e,"x"),P(t,e,"y"))}function L(t,e,n){if(n){var i="y"===n?["y","height"]:["x","width"],o=i[0],r=i[1],a=t[o]-e[o];return-.25*e[r]<a+t[r]&&a<1.25*e[r]}return L(t,e,"x")&&L(t,e,"y")}A.defaultProps={width:-1,height:-1,onResize:function(){}};var k=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).state={size:{width:0,height:0},layoutAttrs:[],count:{row:0,column:0}},t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateLayout()},e.componentDidUpdate=function(t){var e=this.props;t.direction===e.direction&&t.width===e.width&&t.height===e.height&&t.rowSpacing===e.rowSpacing&&t.columnSpacing===e.columnSpacing&&t.itemCount===e.itemCount&&t.itemWidth===e.itemWidth&&t.itemHeight===e.itemHeight||this._calculateLayout()},e.getSize=function(){return this.state.size},e.getCount=function(){return this.state.count},e.getItemRect=function(t){var e,n,i,o=t.itemIndex,r=t.rowIndex,a=t.columnIndex,s=this.state;void 0!==r&&void 0!==a&&(o=(e={row:r,column:a})[i=(n="x"===this.props.direction?["column","row"]:["row","column"])[1]]+e[n[0]]*s.count[i]);var c=s.layoutAttrs[o];return c?c.rect:null},e._calculateLayout=function(){this.setState(function(t,e){var n=e.onResize,i=function(t,e,n,i,o){var r,a,s="x"===o?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],c=s[0],l=s[1],d=s[2],u=s[3],h=s[4],f=s[5],g=i[d],p=0,v=0,m=0,y=[];g<0?(g=e*t[d],1<e&&(g+=(e-1)*n[f]),m=e):0===t[d]&&0===n[f]?m=e:(m=1,t[d]<g&&(m+=Math.floor((g-t[d])/(t[d]+n[f]))));0<m&&(v=Math.ceil(e/m));for(var b=0;b<v;b++){0<b&&(p+=n[h]);for(var w=0;w<m;w++){var x,z,S=w+b*m,_=0;if(1<m&&(_+=Math.round(w*((g-t[d])/(m-1)))),S<e)y.push(((z={rect:(x={},x[c]=_,x[l]=p,x[d]=t[d],x[u]=t[u],x)})[h+"Index"]=b,z[f+"Index"]=w,z.itemIndex=S,z))}p+=t[u]}return{count:(r={},r[h]=v,r[f]=m,r),size:(a={},a[d]=g,a[u]=p,a),layoutAttrs:y}}({width:e.itemWidth,height:e.itemHeight},e.itemCount,{row:e.rowSpacing,column:e.columnSpacing},{width:e.width,height:e.height},e.direction);return t.size.width===i.size.width&&t.size.height===i.size.height||n(i.size),i})},e._renderItem=function(t,e){var n=(0,this.props.renderItem)(m({},t,{visibleRect:e})),i=n.type,o=n.props,r=o.style,a=p(o,["style"]),s=n.key||t.itemIndex,c=m({position:"absolute",left:t.rect.x,top:t.rect.y,width:t.rect.width,height:t.rect.height},r);return g.createElement(i,m({},a,{key:s,style:c}))},e.render=function(){for(var t=this.props,e=t.itemCount,n=t.visibleRect,i=this.state.layoutAttrs,o=[],r=0;r<e;r++){var a=i[r];a&&L(a.rect,n)&&o.push(this._renderItem(a,P(a.rect,n)))}return o},t}(g.PureComponent);k.defaultProps={direction:"y",width:-1,height:-1,rowSpacing:0,columnSpacing:0,itemCount:0,itemWidth:0,itemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}};var W=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).resizeRef=g.createRef(),t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateSize()},e.componentDidUpdate=function(t){var e=this.props;t.width===e.width&&t.height===e.height&&t.hash===e.hash||this._calculateSize()},e._calculateSize=function(){var t=this.props,e=t.width,n=t.height,i=t.hash;(0,t.onResize)(e<0||n<0?(0,t.getSizeByHash)(i)||s(this.resizeRef.current):{width:e,height:n},i)},e.render=function(){var t=this.props,e=t.width,n=t.height,i=t.style,o=t.children,r=p(t,["width","height","hash","getSizeByHash","onResize","style","children"]),a=m({position:"absolute",width:e<0?"auto":e,height:n<0?"auto":n},i);return g.createElement("div",m({},r,{ref:this.resizeRef,style:a}),"function"==typeof o?o(this):o)},t}(g.PureComponent);W.defaultProps={width:-1,height:-1,hash:"Item",getSizeByHash:function(){return null},onResize:function(){}};var H=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).state={size:{width:0,height:0},layoutAttrs:[],itemHashList:[],itemSizeDict:{}},t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateLayout()},e.componentDidUpdate=function(t){var e=this.props;t.direction===e.direction&&t.width===e.width&&t.height===e.height&&t.spacing===e.spacing&&t.itemCount===e.itemCount&&t.estimatedItemWidth===e.estimatedItemWidth&&t.estimatedItemHeight===e.estimatedItemHeight||this._calculateLayout()},e.getSize=function(){return this.state.size},e.getItemRect=function(t){var e=this.state.layoutAttrs[t.itemIndex];return e?e.rect:null},e._calculateLayout=function(g,p,v){this.setState(function(t,e){var n=e.direction,i=e.spacing,o=e.itemCount,r=e.estimatedItemWidth,a=e.estimatedItemHeight,s=e.onResize,c=t.itemHashList,l=t.itemSizeDict,d=c,u=l;if(void 0!==g){var h;if(d[g]===p)return null;u=m({},u,((h={})[(d=[].concat(d))[g]=p]=v,h))}var f=function(t,e,n,i,o,r){for(var a,s="x"===r?["y","x","height","width"]:["x","y","width","height"],c=s[0],l=s[1],d=s[2],u=s[3],h=0,f=0,g=[],p=0;p<i;p++){var v;0<p&&(f+=o);var m=e[p],y=n[m]||t;g.push({rect:(v={},v[c]=0,v[l]=f,v[d]=y[d],v[u]=y[u],v),itemIndex:p}),f+=y[u],h<y[d]&&(h=y[d])}return{size:(a={},a[d]=h,a[u]=f,a),layoutAttrs:g}}({width:r,height:a},d,u,o,i,n);return d!==c&&(f.itemHashList=d),u!==l&&(f.itemSizeDict=u),t.size.width===f.size.width&&t.size.height===f.size.height||s(f.size),f})},e._renderItem=function(n,t){var i=this,e=this.props,o=e.direction,r=e.width,a=e.height,s=this.state.itemSizeDict,c=(0,e.renderItem)(m({},n,{visibleRect:t,Item:W})),l=c.key||n.itemIndex,d={position:"absolute",left:n.rect.x,top:n.rect.y,width:n.rect.width,height:n.rect.height};c.type!==W&&(c=g.createElement(W,{hash:l},c));var u=c.props,h=u.onResize,f=p(u,["onResize"]);return f.onResize=function(t,e){i._calculateLayout(n.itemIndex,e,t),h(t)},f.getSizeByHash=function(t){return s[t]},"x"===o?f.height=a:f.width=r,g.createElement("div",{key:l,style:d},g.createElement(W,f))},e.render=function(){for(var t=this.props,e=t.itemCount,n=t.visibleRect,i=this.state.layoutAttrs,o=[],r=0;r<e;r++){var a=i[r];a&&L(a.rect,n)&&o.push(this._renderItem(a,P(a.rect,n)))}return o},t}(g.PureComponent);H.defaultProps={direction:"y",width:-1,height:-1,spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){}};var N=function(o){function t(){for(var t,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=o.call.apply(o,[this].concat(n))||this).state={size:{width:0,height:0}},t.resizeRef=g.createRef(),t}r(t,o);var e=t.prototype;return e.componentDidMount=function(){this._calculateSize()},e.componentDidUpdate=function(t){t.width===this.props.width&&t.height===this.props.height||this._calculateSize()},e.componentWillUnmount=function(){this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0)},e._calculateSize=function(){var t,e=this,n=this.props,i=n.width,o=n.height;if(i<0||o<0){if(!this._resizeNode){var r=this.resizeRef.current;if(!r)return;return void D.listenTo(this._resizeNode=r,function(){return e._calculateSize()})}t=s(this._resizeNode)}else this._resizeNode&&(D.uninstall(this._resizeNode),this._resizeNode=void 0),t={width:i,height:o};this.setState({size:t})},e.render=function(){var t=this.props,e=t.width,n=t.height;return g.createElement("div",{ref:this.resizeRef,style:{width:e<0?"100%":e,height:n<0?"100%":n}},(0,t.children)(this.state.size))},t}(g.Component);N.defaultProps={children:function(){return null},width:-1,height:-1};var B=function(e){function t(t){var s;return(s=e.call(this,t)||this)._onPadResize=function(t){var e=s.props,n=e.onResize,i=s.state.pageCount,o=j({direction:e.direction,size:t,contentSize:s.padRef.current.getContentSize()});o!==i&&s.setState({pageCount:o}),n&&n(t)},s._onPadContentResize=function(t){var e=s.props,n=e.onContentResize,i=s.state.pageCount,o=j({direction:e.direction,size:s.padRef.current.getSize(),contentSize:t});o!==i&&s.setState({pageCount:o}),n&&n(t)},s._onPadScroll=function(t){var e=t.dragging,n=t.decelerating,i=s.props,o=i.onScroll,r="x"===i.direction?["x","width"]:["y","height"],a={activeIndex:Math.abs(Math.floor(t.contentOffset[r[0]]/t.size[r[1]]))};s.state.dragging!==e&&(a.dragging=e),s.state.decelerating!==n&&(a.decelerating=n),s.setState(a),o&&o(t)},s._onMouseEnter=function(){s.setState({mouseEntered:!0})},s._onMouseLeave=function(){s.setState({mouseEntered:!1})},s.state={pageCount:0,activeIndex:0,dragging:!1,decelerating:!1,mouseEntered:!1},s.padRef=g.createRef(),s}r(t,e);var n=t.prototype;return n.componentDidMount=function(){var t=this.props,e=t.autoplayEnabled,n=this.padRef.current,i=j({direction:t.direction,size:n.getSize(),contentSize:n.getContentSize()});this.setState({pageCount:i}),e&&this.play()},n.componentDidUpdate=function(t,e){var n=this.props,i=n.direction,o=n.autoplayEnabled,r=this.state,a=r.pageCount,s=r.activeIndex,c=r.dragging,l=r.decelerating,d=r.mouseEntered;if(t.direction!==i||t.width!==n.width||t.contentWidth!==n.contentWidth||t.height!==n.height||t.contentHeight!==n.contentHeight){var u=this.padRef.current,h=(u.getSize(),u.getContentSize(),j(i));h!==a&&this.setState({pageCount:h})}t.autoplayEnabled===o&&e.dragging===c&&e.decelerating===l&&e.activeIndex===s&&e.mouseEntered===d||(!o||c||d||l||a<=s+1?this.pause():this.play())},n.componentWillUnmount=function(){this.pause()},n.getPageCount=function(){return this.state.pageCount},n.getActiveIndex=function(){return this.state.activeIndex},n.play=function(){var t=this,e=this.props.autoplayInterval;this._autoplayTimer&&(this.forward(),clearTimeout(this._autoplayTimer)),this._autoplayTimer=setTimeout(function(){t.play()},e)},n.pause=function(){this._autoplayTimer&&(clearTimeout(this._autoplayTimer),this._autoplayTimer=void 0)},n.setFrame=function(t,e){void 0===e&&(e=!0);var n=this.props.direction,i=this.padRef.current,o=i.getContentOffset(),r=i.getSize();i.scrollTo({offset:0===t?{x:0,y:0}:{x:"x"===n?-t*r.width:o.x,y:"x"===n?o.y:-t*r.height},animated:e})},n.rewind=function(){this.setFrame(this.state.activeIndex-1)},n.forward=function(){this.setFrame(this.state.activeIndex+1)},n.render=function(){var t=this.props,e=t.direction,n=t.children,i=p(t,["direction","autoplayEnabled","autoplayInterval","children"]),o={alwaysBounceX:!1,alwaysBounceY:!1};return"x"===e?o.alwaysBounceX=!0:o.alwaysBounceY=!0,g.createElement(a,m({ref:this.padRef},i,o,{pagingEnabled:!0,onScroll:this._onPadScroll,onResize:this._onPadResize,onContentResize:this._onPadContentResize,onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave}),"function"==typeof n?n(this):n)},t}(g.PureComponent);function j(t){var e=t.size,n="x"===t.direction?"width":"height";return e[n]?Math.round(t.contentSize[n]/e[n]):0}B.defaultProps={direction:"y",autoplayEnabled:!0,autoplayInterval:3e3};var U=function(n){function t(t){var e;return(e=n.call(this,t)||this)._onPlayerFrameChange=function(t){},e.state={playerExisted:!1},e.playerRef=g.createRef(),e}r(t,n);var e=t.prototype;return e.componentDidMount=function(){this.playerRef&&this.setState({playerExisted:!0})},e.componentDidUpdate=function(t,e){},e.componentWillUnmount=function(){},e.slideTo=function(t){},e.slidePrev=function(){},e.slideNext=function(){},e.render=function(){var t=this.props,r=t.loop,a=t.children,s=p(t,["loop","children"]);return g.createElement(B,m({ref:this.playerRef},s),function(t){if(r){var e=t.padRef.current,n=s.direction,i=e?e.getContentSize():{width:s.contentWidth,height:s.conte},o=e?e.getVisibleRect():{x:0,y:0,width:0,height:0};return g.createElement(H,{direction:n,height:i.height,estimatedItemWidth:i.width,estimatedItemHeight:i.height,itemCount:2,renderItem:function(){return g.createElement("div",{style:{position:"relative",width:i.width,height:i.height}},a)},visibleRect:o,onResize:function(t){return e.setContentSize(t)}})}return a})},t}(g.PureComponent);U.defaultProps={direction:"y",loop:!0},t.Pad=a,t.Pannable=h,t.GeneralContent=A,t.GridContent=k,t.ListContent=H,t.ItemContent=W,t.AutoResizing=N,t.Player=B,t.Carousel=U,Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -187,4 +187,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
if (adjustedContentOffset.x !== nextDecelerationEndOffset.x || adjustedContentOffset.y !== nextDecelerationEndOffset.y) { | ||
nextDecelerationEndOffset = adjustedContentOffset; | ||
if (adjustedContentOffset.x !== contentOffset.x && adjustedContentOffset.x !== nextDecelerationEndOffset.x || adjustedContentOffset.y !== contentOffset.y && adjustedContentOffset.y !== nextDecelerationEndOffset.y) { | ||
nextDecelerationEndOffset = { | ||
x: adjustedContentOffset.x !== contentOffset.x ? adjustedContentOffset.x : nextDecelerationEndOffset.x, | ||
y: adjustedContentOffset.y !== contentOffset.y ? adjustedContentOffset.y : nextDecelerationEndOffset.y | ||
}; | ||
} | ||
@@ -191,0 +194,0 @@ } |
@@ -161,2 +161,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
if (direction * (offsetEnd[x] - offsetX) <= 0) { | ||
console.log('slow'); | ||
var direction2 = velocityX < 0 ? -1 : 1; | ||
@@ -163,0 +164,0 @@ velocityX = direction2 * Math.min(Math.abs(velocityX), Math.sqrt(2 * direction * acc[x] * 0.25 * size[width])); |
@@ -203,4 +203,7 @@ "use strict"; | ||
if (adjustedContentOffset.x !== nextDecelerationEndOffset.x || adjustedContentOffset.y !== nextDecelerationEndOffset.y) { | ||
nextDecelerationEndOffset = adjustedContentOffset; | ||
if (adjustedContentOffset.x !== contentOffset.x && adjustedContentOffset.x !== nextDecelerationEndOffset.x || adjustedContentOffset.y !== contentOffset.y && adjustedContentOffset.y !== nextDecelerationEndOffset.y) { | ||
nextDecelerationEndOffset = { | ||
x: adjustedContentOffset.x !== contentOffset.x ? adjustedContentOffset.x : nextDecelerationEndOffset.x, | ||
y: adjustedContentOffset.y !== contentOffset.y ? adjustedContentOffset.y : nextDecelerationEndOffset.y | ||
}; | ||
} | ||
@@ -207,0 +210,0 @@ } |
@@ -177,2 +177,3 @@ "use strict"; | ||
if (direction * (offsetEnd[x] - offsetX) <= 0) { | ||
console.log('slow'); | ||
var direction2 = velocityX < 0 ? -1 : 1; | ||
@@ -179,0 +180,0 @@ velocityX = direction2 * Math.min(Math.abs(velocityX), Math.sqrt(2 * direction * acc[x] * 0.25 * size[width])); |
{ | ||
"name": "react-pannable", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "Simulate pan gesture and scroll view for touch devices with React", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -95,6 +95,17 @@ import React from 'react'; | ||
if ( | ||
adjustedContentOffset.x !== nextDecelerationEndOffset.x || | ||
adjustedContentOffset.y !== nextDecelerationEndOffset.y | ||
(adjustedContentOffset.x !== contentOffset.x && | ||
adjustedContentOffset.x !== nextDecelerationEndOffset.x) || | ||
(adjustedContentOffset.y !== contentOffset.y && | ||
adjustedContentOffset.y !== nextDecelerationEndOffset.y) | ||
) { | ||
nextDecelerationEndOffset = adjustedContentOffset; | ||
nextDecelerationEndOffset = { | ||
x: | ||
adjustedContentOffset.x !== contentOffset.x | ||
? adjustedContentOffset.x | ||
: nextDecelerationEndOffset.x, | ||
y: | ||
adjustedContentOffset.y !== contentOffset.y | ||
? adjustedContentOffset.y | ||
: nextDecelerationEndOffset.y, | ||
}; | ||
} | ||
@@ -101,0 +112,0 @@ } |
@@ -156,2 +156,3 @@ function getAcc(rate, { x, y }) { | ||
if (direction * (offsetEnd[x] - offsetX) <= 0) { | ||
console.log('slow'); | ||
const direction2 = velocityX < 0 ? -1 : 1; | ||
@@ -158,0 +159,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
394932
9839