react-leaf-carousel
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.InfiniteCarousel=t(require("react")):e.InfiniteCarousel=t(e.React)}(window,function(n){return i={},r.m=o=[function(e,t,n){e.exports=n(6)()},function(e,t){e.exports=n},function(e,t,n){var o=n(16);"string"==typeof o&&(o=[[e.i,o,""]]);var r={insert:"head",singleton:!1};n(18)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){var o=n(8),r=o&&n(9),i=n(13),a={media:function(e,t){e=i(e),"function"==typeof t&&(t={match:t}),o&&r.register(e,t),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:e,handler:t})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(e){o&&r.unregister(e.query,e.handler)})}};e.exports=a},function(t,e,n){(function(e){var n=e&&e.pid?e.pid.toString(36):"";function o(){var e=Date.now(),t=o.last||e;return o.last=t<e?e:t+1}t.exports=t.exports.default=function(e,t){return(e||"")+""+n+o().toString(36)+(t||"")},t.exports.process=function(e,t){return(e||"")+n+o().toString(36)+(t||"")},t.exports.time=function(e,t){return(e||"")+o().toString(36)+(t||"")}}).call(this,n(15))},function(e,t){e.exports={isFunction:function(e){return"function"==typeof e},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},each:function(e,t){for(var n=0,o=e.length;n<o&&!1!==t(e[n],n);n++);}}},function(e,t,n){"use strict";var s=n(7);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,i){if(i!==s){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return n.PropTypes=n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){var n=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=n},function(e,t,n){var o=n(10);e.exports=new o},function(e,t,n){var i=n(11),o=n(5),a=o.each,s=o.isFunction,c=o.isArray;function r(){if(!window.matchMedia)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!window.matchMedia("only all").matches}r.prototype={constructor:r,register:function(t,e,n){var o=this.queries,r=n&&this.browserIsIncapable;return o[t]||(o[t]=new i(t,r)),s(e)&&(e={match:e}),c(e)||(e=[e]),a(e,function(e){s(e)&&(e={match:e}),o[t].addHandler(e)}),this},unregister:function(e,t){var n=this.queries[e];return n&&(t?n.removeHandler(t):(n.clear(),delete this.queries[e])),this}},e.exports=r},function(e,t,n){var o=n(12),r=n(5).each;function i(e,t){this.query=e,this.isUnconditional=t,this.handlers=[],this.mql=window.matchMedia(e);var n=this;this.listener=function(e){n.mql=e.currentTarget||e,n.assess()},this.mql.addListener(this.listener)}i.prototype={constuctor:i,addHandler:function(e){var t=new o(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(n){var o=this.handlers;r(o,function(e,t){if(e.equals(n))return e.destroy(),!o.splice(t,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){r(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";r(this.handlers,function(e){e[t]()})}},e.exports=i},function(e,t){function n(e){(this.options=e).deferSetup||this.setup()}n.prototype={constructor:n,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){this.initialised||this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},e.exports=n},function(e,t,n){function r(o){var r="",i=Object.keys(o);return i.forEach(function(e,t){var n=o[e];!function(e){return/[height|width]$/.test(e)}(e=a(e))||"number"!=typeof n||(n+="px"),r+=!0===n?e:!1===n?"not "+e:"("+e+": "+n+")",t<i.length-1&&(r+=" and ")}),r}var a=n(14);e.exports=function(n){var o="";return"string"==typeof n?n:n instanceof Array?(n.forEach(function(e,t){o+=r(e),t<n.length-1&&(o+=", ")}),o):r(n)}},function(e,t){e.exports=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}).toLowerCase()}},function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c,l=[],u=!1,d=-1;function f(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!u){var e=s(f);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||u||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,n){(e.exports=n(17)(!1)).push([e.i,".InfiniteCarousel {\n position: relative;\n}\n\n.InfiniteCarouselFrame {\n width: 100%;\n overflow: hidden;\n}\n\n.InfiniteCarouselScrollTrack {\n overflow-x: scroll;\n overflow-y: hidden;\n white-space: nowrap;\n -webkit-overflow-scrolling: touch;\n overflow: -moz-scrollbars-none;\n -webkit-box-sizing: border-box;\n}\n\n.InfiniteCarouselScrollTrack::-webkit-scrollbar {\n display: none;\n}\n\n.InfiniteCarouselSlide img {\n width: 100%;\n}\n\n.InfiniteCarouselPaging {\n position: absolute;\n left: 50%;\n bottom: -60px;\n padding: 0;\n transform: translateX(-20%);\n font-family: Arial;\n letter-spacing: 2px;\n color: #888;\n}\n\n.InfiniteCarouselDots {\n position: absolute;\n left: 50%;\n bottom: 0;\n padding: 0;\n transform: translateX(-50%);\n}\n\n.InfiniteCarouselDot {\n display: inline-block;\n list-style: none;\n margin: 0 5px;\n border: 0;\n background: none;\n cursor: pointer;\n}\n\n.InfiniteCarouselDotIcon {\n display: block;\n background-color: #e5e5e5;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n}\n\n.InfiniteCarouselDotActiveIcon {\n background-color: #48799a;\n}\n\n.InfiniteCarouselArrow {\n display: block;\n background: none;\n border: none;\n position: absolute;\n top: 50%;\n z-index: 2;\n outline: none;\n transform: translateY(-50%);\n cursor: pointer;\n}\n\n.InfiniteCarouselArrowPrev {\n left: 15px;\n right: auto;\n}\n\n.InfiniteCarouselArrowNext {\n left: auto;\n right: 15px;\n}\n\n.InfiniteCarouselArrowIcon {\n display: inline-block;\n padding: 10px;\n border: solid #e5e5e5;\n border-width: 0 5px 5px 0;\n}\n\n.InfiniteCarouselArrowNextIcon {\n transform: rotate(-45deg);\n}\n\n.InfiniteCarouselArrowPrevIcon {\n transform: rotate(135deg);\n}\n",""])},function(e,t,n){"use strict";e.exports=function(n){var s=[];return s.toString=function(){return this.map(function(e){var t=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}(o),i=o.sources.map(function(e){return"/*# sourceURL=".concat(o.sourceRoot).concat(e," */")});return[n].concat(i).concat([r]).join("\n")}return[n].join("\n")}(e,n);return e[2]?"@media ".concat(e[2],"{").concat(t,"}"):t}).join("")},s.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},o=0;o<this.length;o++){var r=this[o][0];null!=r&&(n[r]=!0)}for(var i=0;i<e.length;i++){var a=e[i];null!=a[0]&&n[a[0]]||(t&&!a[2]?a[2]=t:t&&(a[2]="(".concat(a[2],") and (").concat(t,")")),s.push(a))}},s}},function(e,t,r){"use strict";var n,o,u={},i=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},a=(o={},function(e){if(void 0===o[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}o[e]=t}return o[e]});function d(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],a=t.base?i[0]+t.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};o[a]?o[a].parts.push(s):n.push(o[a]={id:a,parts:[s]})}return n}function f(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=u[o.id],i=0;if(r){for(r.refs++;i<r.parts.length;i++)r.parts[i](o.parts[i]);for(;i<o.parts.length;i++)r.parts.push(v(o.parts[i],t))}else{for(var a=[];i<o.parts.length;i++)a.push(v(o.parts[i],t));u[o.id]={id:o.id,refs:1,parts:a}}}}function s(t){var n=document.createElement("style");if(void 0===t.attributes.nonce){var e=r.nc;e&&(t.attributes.nonce=e)}if(Object.keys(t.attributes).forEach(function(e){n.setAttribute(e,t.attributes[e])}),"function"==typeof t.insert)t.insert(n);else{var o=a(t.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}return n}var c,l=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function p(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=l(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}var h=null,g=0;function v(t,e){var n,o,r;if(e.singleton){var i=g++;n=h=h||s(e),o=p.bind(null,n,i,!1),r=p.bind(null,n,i,!0)}else n=s(e),o=function(e,t,n){var o=n.css,r=n.media,i=n.sourceMap;if(r&&e.setAttribute("media",r),i&&btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}.bind(null,n,e),r=function(){!function(e){if(null===e.parentNode)return;e.parentNode.removeChild(e)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}e.exports=function(e,c){(c=c||{}).attributes="object"==typeof c.attributes?c.attributes:{},c.singleton||"boolean"==typeof c.singleton||(c.singleton=i());var l=d(e,c);return f(l,c),function(e){for(var t=[],n=0;n<l.length;n++){var o=l[n],r=u[o.id];r&&(r.refs--,t.push(r))}e&&f(d(e,c),c);for(var i=0;i<t.length;i++){var a=t[i];if(0===a.refs){for(var s=0;s<a.parts.length;s++)a.parts[s]();delete u[a.id]}}}}},function(e,t,n){"use strict";n.r(t);var C=n(1),x=n.n(C),o=n(0),r=n.n(o),u=n(3),i=n(4),a=n.n(i);function O(){return"ontouchstart"in document.documentElement}function d(e,t){return e-t}n(2);function s(e){var t,n=e.carouselName,o=e.next,r=e.onClick;t=o?"InfiniteCarouselArrowNext":"InfiniteCarouselArrowPrev";var i;i=o?"InfiniteCarouselArrowNextIcon":"InfiniteCarouselArrowPrevIcon";var a="".concat("InfiniteCarouselArrow"," ").concat(t),s="".concat("InfiniteCarouselArrowIcon"," ").concat(i),c="".concat(n,"-button-").concat(o?"next":"previous");return x.a.createElement("button",{name:c,"data-testid":c,className:a,onClick:r,type:"button"},x.a.createElement("i",{className:s}))}s.propTypes={carouselName:r.a.string.isRequired,next:r.a.bool,onClick:r.a.func.isRequired},s.defaultProps={next:!0};var I=s;function c(e){for(var t,n,o=e.carouselName,r=e.numberOfDots,i=e.activePage,a=e.onClick,s=[],c=0;c<r;c+=1)t="InfiniteCarouselDotIcon ".concat(c===i?"InfiniteCarouselDotActiveIcon":""),n="".concat(o,"-dots-").concat(c),s.push(x.a.createElement("button",{name:n,"data-testid":n,className:"InfiniteCarouselDot","data-index":c,key:c+1,onClick:a,type:"button"},x.a.createElement("i",{className:t})));return x.a.createElement("ul",{"data-testid":"".concat(o,"-dots"),className:"InfiniteCarouselDots"},s)}c.propTypes={carouselName:r.a.string.isRequired,numberOfDots:r.a.number.isRequired,activePage:r.a.number.isRequired,onClick:r.a.func.isRequired};var k=c;function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function v(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b=function(){function t(e){var S;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(S=v(this,m(t).call(this,e))).setupBreakpointSettings=function(e){var t=S.props,a=t.children,s=t.scrollOnDevice,c=S.state.scrollOnDeviceProps,n=e.map(function(e){return e.breakpoint}),l={};if(e.forEach(function(e){l[e.breakpoint]=e.settings}),0<n.length){n.sort(d),n.forEach(function(o,e){var r,i;i=(r=0===e?0:n[e-1],o-1);var t={minWidth:r,maxWidth:i};Object(u.media)(t,function(){var e=s&&O()?c:{},t=E({},S.defaultProps,{},S.props,{},l[o],{},e),n=S.getChildrenList(a,t.slidesToShow);S.setState({settings:t,children:n,lowerBreakpoint:r,higherBreakpoint:i},S.setDimensions)})}),n.reverse();var o={minWidth:n[0]};Object(u.media)(o,function(){var e=s&&O()?c:{},t=E({},S.defaultProps,{},S.props,{},e),n=S.getChildrenList(a,t.slidesToShow);S.setState({settings:t,children:n,lowerBreakpoint:void 0,higherBreakpoint:void 0},S.setDimensions)})}},S.getSideSize=function(e,t,n){var o=S.state.settings,r=o.incrementalSides,i=o.sideSize;return void 0!==e&&void 0!==t&&r?50*(n-e)/(t-e)/100:i},S.setDimensions=function(){var e,t,n=S.state,o=n.settings,r=n.lowerBreakpoint,i=n.higherBreakpoint,a=n.children,s=n.currentIndex,c=S.props,l=c.children,u=c.scrollOnDevice&&O(),d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=S.getSideSize(r,i,d),p=C.Children.count(l),h=u?p:C.Children.count(a),g=function(e){return e.getBoundingClientRect().width||e.offsetWidth||0}(S.frame)/(S.props.showSides?o.slidesToShow+2*f:o.slidesToShow)-2*o.slidesSpacing,v=l.length,m=Math.ceil(s/o.slidesToShow),y=Math.ceil(v/o.slidesToShow),b=v>o.slidesToShow?y:1,w=b<=1;t=w||u?(e=a.map(function(e,t){return t}),[].concat(e)):(e=S.getLazyLoadedIndexes(l,s),S.getVisibleIndexes(l,s)),S.setState({activePage:m,childrenCount:p,slidesCount:h,slidesWidth:g,slidePages:b,singlePage:w,lazyLoadedList:e,visibleSlideList:t,sideSize:f})},S.getVisibleIndexes=function(e,t){var n,o,r=[],i=S.state.settings,a=i.showSides?1:0;if(n=e.length+i.slidesToShow+a,0===t){o=n+i.slidesToShow-1;for(var s=n;s<=o;s+=1)r.push(s)}if(n=0+a,t===e.length-i.slidesToShow){o=n+i.slidesToShow-1;for(var c=n;c<=o;c+=1)r.push(c)}o=(n=t+i.slidesToShow+a)+(i.slidesToShow-1);for(var l=n;l<=o;l+=1)r.push(l);return r},S.getLazyLoadedIndexes=function(e,t){var n,o,r=S.state.lazyLoadedList,i=S.state.settings,a=i.showSides?1:0,s=[].concat(r);if(n=e.length+i.slidesToShow+a,0===t&&r.indexOf(n)<0){o=n+i.slidesToShow+a-1;for(var c=n;c<=o;c+=1)s.push(c)}n=0;var l=t===e.length-i.slidesToShow,u=s.indexOf(n)<0;if(l&&u){o=n+i.slidesToShow+a-1;for(var d=n;d<=o;d+=1)s.push(d)}o=(n=t+i.slidesToShow+a)+(i.slidesToShow-1),i.showSides&&(n-=1,o+=1);for(var f=n;f<=o;f+=1)r.indexOf(f)<0&&s.push(f);return s},S.getChildrenList=function(e,t){var n=S.props,o=n.scrollOnDevice,r=n.showSides;return Array.isArray(e)?o&&O()?e:e.length>t&&r?[].concat(f(e.slice(e.length-t-1,e.length)),f(e),f(e.slice(0,t+1))):e.length>t?[].concat(f(e.slice(e.length-t,e.length)),f(e),f(e.slice(0,t))):e:[e]},S.getTargetIndex=function(e,t){var n=S.state,o=n.childrenCount,r=n.currentIndex,i=o%t;return e<0?0===r?o-t:0:o<=e?0!=i?0:e-o:0!=i&&e===o-i?e-(t-i):e},S.onDotClick=function(e){e.preventDefault();var t=S.state,n=t.settings,o=t.animating,r=t.autoCycleTimer,i=n.slidesToShow,a=n.autoCycle;if(!o){a&&r&&(clearInterval(r),S.setState({autoCycleTimer:null}));var s=e.target.parentElement.getAttribute("data-index"),c=S.getTargetIndex(s*i,i);S.handleTrack(s*i,c),n.autoCycle&&S.playAutoCycle()}},S.onWindowResized=function(){S.setDimensions()},S.onMouseEnter=function(){var e=S.state.settings,t=e.autoCycle,n=e.pauseOnHover;t&&n&&S.pauseAutoCycle()},S.onMouseOver=function(){var e=S.state.settings,t=e.autoCycle,n=e.pauseOnHover;t&&n&&S.pauseAutoCycle()},S.onMouseLeave=function(){var e=S.state.settings,t=e.autoCycle,n=e.pauseOnHover;t&&n&&S.playAutoCycle()},S.onSwipeStart=function(e){var t=S.state.settings,n=!0===t.swipe,o=t.draggable&&-1===e.type.indexOf("mouse");if(n&&o){var r=void 0!==e.touches?e.touches[0].pageX:e.clientX,i=void 0!==e.touches?e.touches[0].pageY:e.clientY;S.setState({dragging:!0,touchObject:{startX:r,startY:i}})}},S.onSwipeMove=function(e){var t=S.state,n=t.dragging,o=t.animating;if(n){if(!o){var r=void 0!==e.touches?e.touches[0].pageX:e.clientX,i=void 0!==e.touches?e.touches[0].pageY:e.clientY,a=S.state.touchObject,s=function(e,t,n,o){var r=e-t,i=n-o,a=Math.round(180*Math.atan2(i,r)/Math.PI);return a<0&&(a=360-Math.abs(a)),a<=45&&0<=a?1:a<=360&&315<=a?1:135<=a&&a<=225?-1:0}(a.startX,r,a.startY,i);0!==s&&e.preventDefault();var c=Math.round(Math.sqrt(Math.pow(r-a.startX,2)));S.setState({touchObject:{startX:a.startX,startY:a.startY,endX:r,endY:i,length:c,direction:s}})}}else e.preventDefault()},S.onSwipeEnd=function(){var e=S.state,t=e.touchObject,n=e.slidesWidth,o=e.autoCycleTimer,r=e.settings,i=e.currentIndex,a=t.length;if(0!==a&&n/2<a){var s,c;r.autoCycle&&o&&(clearInterval(o),S.setState({autoCycleTimer:null})),1===t.direction?(s=i+r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll)):(s=i-r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll),s<0&&0!==i&&(s=0)),S.handleTrack(s,c),r.autoCycle&&S.playAutoCycle()}else{S.setState({animating:!0,touchObject:{direction:-1*t.direction}},function(){setTimeout(function(){S.setState({animating:!1,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}})},r.animationDuration)})}},S.getTrackStyles=function(){var e=S.state.settings,t=S.state,n=t.touchObject,o=t.singlePage,r=t.sideSize,i=t.animating,a=t.slidesWidth,s=t.slidesCount,c=t.currentIndex,l=a+2*e.slidesSpacing;l*=s+2*e.slidesToShow;var u=a+2*e.slidesSpacing,d=e.showSides?1:0,f=u*(e.slidesToShow+d),p=i?"transform ".concat(e.animationDuration,"ms ease"):"",h=f+u*c+(e.swipe&&n.length?n.length*n.direction:0),g=u*r;return e.showSides&&(h-=g),{position:"relative",display:"block",width:o?"100%":l,height:"auto",padding:0,transition:p,transform:o?"none":"translate(".concat(-h,"px, 0px)"),boxSizing:"border-box",MozBoxSizing:"border-box",marginLeft:o&&e.showSides?"".concat(g,"px"):"0px"}},S.getScrollTrackStyles={clear:"both",position:"relative",display:"block",width:"100%",height:"auto",padding:0,boxSizing:"border-box",MozBoxSizing:"border-box"},S.getSlideStyles=function(e){var t=S.state,n=t.slidesWidth,o=t.settings,r=S.props.scrollOnDevice&&O()?"none":"left",i=e?"1":o.sidesOpacity;return{position:"relative",float:r,display:"inline-block",width:Number.isNaN(n)?1:n,height:"auto",margin:"0 ".concat(o.slidesSpacing,"px"),opacity:i}},S.getFormatedChildren=function(e,r,i){return C.Children.map(e,function(e,t){var n=S.state.settings,o=0<=i.indexOf(t);return!n.lazyLoad||0<=r.indexOf(t)?x.a.createElement("li",{className:"InfiniteCarouselSlide",key:a()("slide-"),style:S.getSlideStyles(o)},e):x.a.createElement("li",{className:"InfiniteCarouselSlide",key:a()("slide-"),style:S.getSlideStyles(o)},x.a.createElement("noscript",null,e),x.a.createElement("img",{alt:"placeholder",src:n.placeholderImageSrc}))})},S.autoCycle=function(){var e=S.state,t=e.settings,n=e.currentIndex+t.slidesToScroll,o=S.getTargetIndex(n,t.slidesToScroll);S.handleTrack(n,o)},S.playAutoCycle=function(){var e=S.state.settings;if(e.autoCycle){var t=setInterval(S.autoCycle,e.cycleInterval);S.setState({autoCycleTimer:t})}},S.pauseAutoCycle=function(){var e=S.state.autoCycleTimer;e&&(clearInterval(e),S.setState({autoCycleTimer:null}))},S.handleTrack=function(e,t){function n(){setTimeout(function(){S.setState({currentIndex:t,animating:!1,dragging:!1})},a.animationDuration)}var o=S.props,r=o.children,i=o.onSlideChange,a=S.state.settings,s=Math.ceil(t/a.slidesToShow),c=S.getLazyLoadedIndexes(r,t),l=S.getVisibleIndexes(r,t);e<0?S.setState({currentIndex:e,activePage:s,animating:!0,lazyLoadedList:c,visibleSlideList:l,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},n):e>=r.length?S.setState({currentIndex:e,activePage:s,animating:!0,lazyLoadedList:c,visibleSlideList:l,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},n):S.setState({currentIndex:t,activePage:s,animating:!0,lazyLoadedList:c,visibleSlideList:l,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},function(){setTimeout(function(){S.setState({animating:!1,dragging:!1})},a.animationDuration)}),i&&i(s)},S.moveToNext=function(e){var t=S.props.onNextClick,n=S.state,o=n.animating,r=n.settings,i=n.currentIndex,a=n.autoCycleTimer;if(e.preventDefault(),t&&t(e),!o){r.autoCycle&&a&&(clearInterval(a),S.setState({autoCycleTimer:null}));var s=i+r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll);S.handleTrack(s,c),r.autoCycle&&S.playAutoCycle()}},S.moveToPrevious=function(e){var t=S.props.onPreviousClick,n=S.state,o=n.animating,r=n.settings,i=n.currentIndex,a=n.autoCycleTimer;if(e.preventDefault(),t&&t(e),!o){r.autoCycle&&a&&(clearInterval(a),S.setState({autoCycleTimer:null}));var s=i-r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll);s<0&&0!==i&&(s=0),S.handleTrack(s,c),r.autoCycle&&S.playAutoCycle()}},S.init=function(){var e,t=S.props,n=t.children,o=t.slidesToShow,r=t.scrollOnDevice,i=t.responsive,a=t.breakpoints,s=S.state.scrollOnDeviceProps,c=S.getChildrenList(n,o);e=r&&O()?E({},S.defaultProps,{},S.props,{},s):E({},S.defaultProps,{},S.props),S.setState({children:c,settings:e},function(){S.playAutoCycle()}),i&&S.setupBreakpointSettings(a)},S.storeFrameRef=function(e){null!==e&&(S.frame=e)},S.state={currentIndex:0,activePage:0,children:[],lazyLoadedList:[],visibleSlideList:[],childrenCount:0,slidesCount:0,slidesWidth:1,slidePages:1,singlePage:!0,settings:{},autoCycleTimer:null,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1},scrollOnDeviceProps:{arrows:!1,dots:!1,lazyLoad:!1,autoCycle:!1},lowerBreakpoint:void 0,higherBreakpoint:void 0},S}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(t,C["Component"]),function(e,t,n){t&&g(e.prototype,t),n&&g(e,n)}(t,[{key:"componentDidMount",value:function(){this.init(),this.setDimensions(),window&&(window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized))}},{key:"componentWillUnmount",value:function(){window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized);var e=this.state.autoCycleTimer;e&&clearInterval(e)}},{key:"render",value:function(){var e,t,n,o=this.props,r=o.scrollOnDevice,i=o.pagingSeparator,a=o.name,s=r&&O(),c=this.state,l=c.settings,u=c.singlePage,d=c.activePage,f=c.slidePages,p=c.dragging;if(l.arrows&&!u&&!s){if(null==l.prevArrow)e=x.a.createElement(I,{carouselName:a,next:!1,onClick:this.moveToPrevious});else{var h={onClick:this.moveToPrevious};e=x.a.cloneElement(l.prevArrow,h)}if(null==l.nextArrow)t=x.a.createElement(I,{carouselName:a,onClick:this.moveToNext});else{var g={onClick:this.moveToNext};t=x.a.cloneElement(l.nextArrow,g)}}!l.dots||u||s||(n=x.a.createElement(k,{carouselName:a,activePage:d,numberOfDots:f,onClick:this.onDotClick})),!l.paging||u||s||(n=x.a.createElement("span",{"data-testid":"".concat(a,"-paging"),className:"InfiniteCarouselPaging"},"".concat(d+1," ").concat(i," ").concat(f)));var v,m,y=this.state,b=y.children,w=y.lazyLoadedList,S=y.visibleSlideList,C=this.getFormatedChildren(b,w,S);m=r&&O()?(v=E({},this.getScrollTrackStyles),"InfiniteCarouselScrollTrack"):(v=E({},this.getTrackStyles()),"");var T=r&&O();return x.a.createElement("div",{id:a,"data-testid":a,className:"InfiniteCarousel",onFocus:this.onMouseOver,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseOver:this.onMouseOver},e,x.a.createElement("div",{className:"InfiniteCarouselFrame",ref:this.storeFrameRef},x.a.createElement("ul",{className:m,style:v,onMouseDown:T?null:this.onSwipeStart,onMouseLeave:p||!T?this.onSwipeEnd:null,onMouseMove:p||!T?this.onSwipeMove:null,onMouseUp:T?null:this.onSwipeEnd,onTouchCancel:p||!T?this.onSwipeEnd:null,onTouchEnd:T?null:this.onSwipeEnd,onTouchMove:p||!T?this.onSwipeMove:null,onTouchStart:T?null:this.onSwipeStart},C)),t,n)}}]),t}();b.propTypes={children:r.a.oneOfType([r.a.arrayOf(r.a.node),r.a.node]),name:r.a.string,arrows:r.a.bool,dots:r.a.bool,paging:r.a.bool,pagingSeparator:r.a.string,lazyLoad:r.a.bool,swipe:r.a.bool,draggable:r.a.bool,animationDuration:r.a.number,slidesToShow:r.a.number,slidesToScroll:r.a.number,slidesSpacing:r.a.number,autoCycle:r.a.bool,cycleInterval:r.a.number,pauseOnHover:r.a.bool,responsive:r.a.bool,breakpoints:r.a.arrayOf(r.a.object),placeholderImageSrc:r.a.string,nextArrow:r.a.element,prevArrow:r.a.element,scrollOnDevice:r.a.bool,showSides:r.a.bool,sidesOpacity:r.a.number,sideSize:r.a.number,incrementalSides:r.a.bool,onSlideChange:r.a.func,onNextClick:r.a.func,onPreviousClick:r.a.func},b.defaultProps={children:[],name:"infinite-carousel",arrows:!0,dots:!1,paging:!1,lazyLoad:!1,swipe:!0,draggable:!1,animationDuration:500,slidesToShow:1,slidesToScroll:1,slidesSpacing:10,autoCycle:!1,cycleInterval:5e3,pauseOnHover:!0,responsive:!0,breakpoints:[],placeholderImageSrc:"",pagingSeparator:"/",nextArrow:null,prevArrow:null,scrollOnDevice:!1,showSides:!1,sidesOpacity:1,sideSize:.5,incrementalSides:!1,onSlideChange:void 0,onNextClick:void 0,onPreviousClick:void 0};t.default=b}],r.c=i,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=19);function r(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return o[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var o,i}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.InfiniteCarousel=t(require("react")):e.InfiniteCarousel=t(e.React)}(window,function(n){return i={},r.m=o=[function(e,t,n){e.exports=n(6)()},function(e,t){e.exports=n},function(t,e,n){(function(e){var n=e&&e.pid?e.pid.toString(36):"";function o(){var e=Date.now(),t=o.last||e;return o.last=t<e?e:t+1}t.exports=t.exports.default=function(e,t){return(e||"")+""+n+o().toString(36)+(t||"")},t.exports.process=function(e,t){return(e||"")+n+o().toString(36)+(t||"")},t.exports.time=function(e,t){return(e||"")+o().toString(36)+(t||"")}}).call(this,n(15))},function(e,t,n){var o=n(16);"string"==typeof o&&(o=[[e.i,o,""]]);var r={insert:"head",singleton:!1};n(18)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){var o=n(8),r=o&&n(9),i=n(13),a={media:function(e,t){e=i(e),"function"==typeof t&&(t={match:t}),o&&r.register(e,t),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:e,handler:t})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(e){o&&r.unregister(e.query,e.handler)})}};e.exports=a},function(e,t){e.exports={isFunction:function(e){return"function"==typeof e},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},each:function(e,t){for(var n=0,o=e.length;n<o&&!1!==t(e[n],n);n++);}}},function(e,t,n){"use strict";var s=n(7);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,i){if(i!==s){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return n.PropTypes=n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){var n=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=n},function(e,t,n){var o=n(10);e.exports=new o},function(e,t,n){var i=n(11),o=n(5),a=o.each,s=o.isFunction,c=o.isArray;function r(){if(!window.matchMedia)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!window.matchMedia("only all").matches}r.prototype={constructor:r,register:function(t,e,n){var o=this.queries,r=n&&this.browserIsIncapable;return o[t]||(o[t]=new i(t,r)),s(e)&&(e={match:e}),c(e)||(e=[e]),a(e,function(e){s(e)&&(e={match:e}),o[t].addHandler(e)}),this},unregister:function(e,t){var n=this.queries[e];return n&&(t?n.removeHandler(t):(n.clear(),delete this.queries[e])),this}},e.exports=r},function(e,t,n){var o=n(12),r=n(5).each;function i(e,t){this.query=e,this.isUnconditional=t,this.handlers=[],this.mql=window.matchMedia(e);var n=this;this.listener=function(e){n.mql=e.currentTarget||e,n.assess()},this.mql.addListener(this.listener)}i.prototype={constuctor:i,addHandler:function(e){var t=new o(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(n){var o=this.handlers;r(o,function(e,t){if(e.equals(n))return e.destroy(),!o.splice(t,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){r(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";r(this.handlers,function(e){e[t]()})}},e.exports=i},function(e,t){function n(e){(this.options=e).deferSetup||this.setup()}n.prototype={constructor:n,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){this.initialised||this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},e.exports=n},function(e,t,n){function r(o){var r="",i=Object.keys(o);return i.forEach(function(e,t){var n=o[e];!function(e){return/[height|width]$/.test(e)}(e=a(e))||"number"!=typeof n||(n+="px"),r+=!0===n?e:!1===n?"not "+e:"("+e+": "+n+")",t<i.length-1&&(r+=" and ")}),r}var a=n(14);e.exports=function(n){var o="";return"string"==typeof n?n:n instanceof Array?(n.forEach(function(e,t){o+=r(e),t<n.length-1&&(o+=", ")}),o):r(n)}},function(e,t){e.exports=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}).toLowerCase()}},function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c,l=[],u=!1,d=-1;function f(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!u){var e=s(f);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||u||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,n){(e.exports=n(17)(!1)).push([e.i,".InfiniteCarousel {\n position: relative;\n}\n\n.InfiniteCarouselFrame {\n width: 100%;\n overflow: hidden;\n}\n\n.InfiniteCarouselScrollTrack {\n overflow-x: scroll;\n overflow-y: hidden;\n white-space: nowrap;\n -webkit-overflow-scrolling: touch;\n overflow: -moz-scrollbars-none;\n -webkit-box-sizing: border-box;\n}\n\n.InfiniteCarouselScrollTrack::-webkit-scrollbar {\n display: none;\n}\n\n.InfiniteCarouselSlide img {\n width: 100%;\n}\n\n.InfiniteCarouselPaging {\n position: absolute;\n left: 50%;\n bottom: -60px;\n padding: 0;\n transform: translateX(-20%);\n font-family: Arial;\n letter-spacing: 2px;\n color: #888;\n}\n\n.InfiniteCarouselDots {\n position: absolute;\n left: 50%;\n bottom: 0;\n padding: 0;\n transform: translateX(-50%);\n}\n\n.InfiniteCarouselDot {\n display: inline-block;\n list-style: none;\n margin: 0 5px;\n border: 0;\n background: none;\n cursor: pointer;\n}\n\n.InfiniteCarouselDotIcon {\n display: block;\n background-color: #e5e5e5;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n}\n\n.InfiniteCarouselDotActiveIcon {\n background-color: #48799a;\n}\n\n.InfiniteCarouselArrow {\n display: block;\n background: none;\n border: none;\n position: absolute;\n top: 50%;\n z-index: 2;\n outline: none;\n transform: translateY(-50%);\n cursor: pointer;\n}\n\n.InfiniteCarouselArrowPrev {\n left: 15px;\n right: auto;\n}\n\n.InfiniteCarouselArrowNext {\n left: auto;\n right: 15px;\n}\n\n.InfiniteCarouselArrowIcon {\n display: inline-block;\n padding: 10px;\n border: solid #e5e5e5;\n border-width: 0 5px 5px 0;\n}\n\n.InfiniteCarouselArrowNextIcon {\n transform: rotate(-45deg);\n}\n\n.InfiniteCarouselArrowPrevIcon {\n transform: rotate(135deg);\n}\n",""])},function(e,t,n){"use strict";e.exports=function(n){var s=[];return s.toString=function(){return this.map(function(e){var t=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}(o),i=o.sources.map(function(e){return"/*# sourceURL=".concat(o.sourceRoot).concat(e," */")});return[n].concat(i).concat([r]).join("\n")}return[n].join("\n")}(e,n);return e[2]?"@media ".concat(e[2],"{").concat(t,"}"):t}).join("")},s.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},o=0;o<this.length;o++){var r=this[o][0];null!=r&&(n[r]=!0)}for(var i=0;i<e.length;i++){var a=e[i];null!=a[0]&&n[a[0]]||(t&&!a[2]?a[2]=t:t&&(a[2]="(".concat(a[2],") and (").concat(t,")")),s.push(a))}},s}},function(e,t,r){"use strict";var n,o,u={},i=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},a=(o={},function(e){if(void 0===o[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}o[e]=t}return o[e]});function d(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],a=t.base?i[0]+t.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};o[a]?o[a].parts.push(s):n.push(o[a]={id:a,parts:[s]})}return n}function f(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=u[o.id],i=0;if(r){for(r.refs++;i<r.parts.length;i++)r.parts[i](o.parts[i]);for(;i<o.parts.length;i++)r.parts.push(v(o.parts[i],t))}else{for(var a=[];i<o.parts.length;i++)a.push(v(o.parts[i],t));u[o.id]={id:o.id,refs:1,parts:a}}}}function s(t){var n=document.createElement("style");if(void 0===t.attributes.nonce){var e=r.nc;e&&(t.attributes.nonce=e)}if(Object.keys(t.attributes).forEach(function(e){n.setAttribute(e,t.attributes[e])}),"function"==typeof t.insert)t.insert(n);else{var o=a(t.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}return n}var c,l=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function p(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=l(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}var h=null,g=0;function v(t,e){var n,o,r;if(e.singleton){var i=g++;n=h=h||s(e),o=p.bind(null,n,i,!1),r=p.bind(null,n,i,!0)}else n=s(e),o=function(e,t,n){var o=n.css,r=n.media,i=n.sourceMap;if(r&&e.setAttribute("media",r),i&&btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}.bind(null,n,e),r=function(){!function(e){if(null===e.parentNode)return;e.parentNode.removeChild(e)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}e.exports=function(e,c){(c=c||{}).attributes="object"==typeof c.attributes?c.attributes:{},c.singleton||"boolean"==typeof c.singleton||(c.singleton=i());var l=d(e,c);return f(l,c),function(e){for(var t=[],n=0;n<l.length;n++){var o=l[n],r=u[o.id];r&&(r.refs--,t.push(r))}e&&f(d(e,c),c);for(var i=0;i<t.length;i++){var a=t[i];if(0===a.refs){for(var s=0;s<a.parts.length;s++)a.parts[s]();delete u[a.id]}}}}},function(e,t,n){"use strict";n.r(t);var C=n(1),x=n.n(C),o=n(0),r=n.n(o),d=n(4),i=n(2),f=n.n(i);function O(){return"ontouchstart"in document.documentElement}function a(e,t){return e-t}n(3);function s(e){var t,n=e.carouselName,o=e.next,r=e.onClick;t=o?"InfiniteCarouselArrowNext":"InfiniteCarouselArrowPrev";var i;i=o?"InfiniteCarouselArrowNextIcon":"InfiniteCarouselArrowPrevIcon";var a="".concat("InfiniteCarouselArrow"," ").concat(t),s="".concat("InfiniteCarouselArrowIcon"," ").concat(i),c="".concat(n,"-button-").concat(o?"next":"previous");return x.a.createElement("button",{name:c,"data-testid":c,className:a,onClick:r,type:"button"},x.a.createElement("i",{className:s}))}s.propTypes={carouselName:r.a.string.isRequired,next:r.a.bool,onClick:r.a.func.isRequired},s.defaultProps={next:!0};var I=s;function c(e){for(var t,n,o=e.carouselName,r=e.numberOfDots,i=e.activePage,a=e.onClick,s=[],c=0;c<r;c+=1)t="InfiniteCarouselDotIcon ".concat(c===i?"InfiniteCarouselDotActiveIcon":""),n="".concat(o,"-dots-").concat(c),s.push(x.a.createElement("button",{name:n,"data-testid":n,className:"InfiniteCarouselDot","data-index":c,key:c+1,onClick:a,type:"button"},x.a.createElement("i",{className:t})));return x.a.createElement("ul",{"data-testid":"".concat(o,"-dots"),className:"InfiniteCarouselDots"},s)}c.propTypes={carouselName:r.a.string.isRequired,numberOfDots:r.a.number.isRequired,activePage:r.a.number.isRequired,onClick:r.a.func.isRequired};var k=c;function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function v(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b=function(){function t(e){var S;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(S=v(this,m(t).call(this,e))).setupBreakpointSettings=function(){var e=S.props,s=e.children,c=e.scrollOnDevice,t=e.breakpoints,l=S.state.scrollOnDeviceProps,n=t.map(function(e){return e.breakpoint}),u={};if(t.forEach(function(e){u[e.breakpoint]=e.settings}),0<n.length){n.sort(a),n.forEach(function(r,e){var i,a;a=(i=0===e?0:n[e-1],r-1);var t={minWidth:i,maxWidth:a};Object(d.media)(t,function(){var e=c&&O()?l:{},t=E({},S.defaultProps,{},S.props,{},u[r],{},e),n=S.getChildrenList(s,t.slidesToShow),o=n.map(function(e){return f()("slide-")});S.setState({settings:t,children:n,slideUniqueIds:o,lowerBreakpoint:i,higherBreakpoint:a},S.setDimensions)})}),n.reverse();var o={minWidth:n[0]};Object(d.media)(o,function(){var e=c&&O()?l:{},t=E({},S.defaultProps,{},S.props,{},e),n=S.getChildrenList(s,t.slidesToShow),o=n.map(function(e){return f()("slide-")});S.setState({settings:t,children:n,slideUniqueIds:o,lowerBreakpoint:void 0,higherBreakpoint:void 0},S.setDimensions)})}},S.getSideSize=function(e,t,n){var o=S.state.settings,r=o.incrementalSides,i=o.sideSize;return void 0!==e&&void 0!==t&&r?50*(n-e)/(t-e)/100:i},S.setDimensions=function(){var e,t,n=S.state,o=n.settings,r=n.lowerBreakpoint,i=n.higherBreakpoint,a=n.children,s=n.currentIndex,c=S.props,l=c.children,u=c.scrollOnDevice&&O(),d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=S.getSideSize(r,i,d),p=C.Children.count(l),h=u?p:C.Children.count(a),g=function(e){return e.getBoundingClientRect().width||e.offsetWidth||0}(S.frame)/(S.props.showSides?o.slidesToShow+2*f:o.slidesToShow)-2*o.slidesSpacing,v=l.length,m=Math.ceil(s/o.slidesToShow),y=Math.ceil(v/o.slidesToShow),b=v>o.slidesToShow?y:1,w=b<=1;t=w||u?(e=a.map(function(e,t){return t}),[].concat(e)):(e=S.getLazyLoadedIndexes(l,s),S.getVisibleIndexes(l,s)),S.setState({activePage:m,childrenCount:p,slidesCount:h,slidesWidth:g,slidePages:b,singlePage:w,lazyLoadedList:e,visibleSlideList:t,sideSize:f})},S.getVisibleIndexes=function(e,t){var n,o,r=[],i=S.state.settings,a=i.showSides?1:0;if(n=e.length+i.slidesToShow+a,0===t){o=n+i.slidesToShow-1;for(var s=n;s<=o;s+=1)r.push(s)}if(n=0+a,t===e.length-i.slidesToShow){o=n+i.slidesToShow-1;for(var c=n;c<=o;c+=1)r.push(c)}o=(n=t+i.slidesToShow+a)+(i.slidesToShow-1);for(var l=n;l<=o;l+=1)r.push(l);return r},S.getLazyLoadedIndexes=function(e,t){var n,o,r=S.state.lazyLoadedList,i=S.state.settings,a=i.showSides?1:0,s=[].concat(r);if(n=e.length+i.slidesToShow+a,0===t&&r.indexOf(n)<0){o=n+i.slidesToShow+a-1;for(var c=n;c<=o;c+=1)s.push(c)}n=0;var l=t===e.length-i.slidesToShow,u=s.indexOf(n)<0;if(l&&u){o=n+i.slidesToShow+a-1;for(var d=n;d<=o;d+=1)s.push(d)}o=(n=t+i.slidesToShow+a)+(i.slidesToShow-1),i.showSides&&(n-=1,o+=1);for(var f=n;f<=o;f+=1)r.indexOf(f)<0&&s.push(f);return s},S.getChildrenList=function(e,t){var n=S.props,o=n.scrollOnDevice,r=n.showSides;return Array.isArray(e)?o&&O()?e:e.length>t&&r?[].concat(u(e.slice(e.length-t-1,e.length)),u(e),u(e.slice(0,t+1))):e.length>t?[].concat(u(e.slice(e.length-t,e.length)),u(e),u(e.slice(0,t))):e:[e]},S.getTargetIndex=function(e,t){var n=S.state,o=n.childrenCount,r=n.currentIndex,i=o%t;return e<0?0===r?o-t:0:o<=e?0!=i?0:e-o:0!=i&&e===o-i?e-(t-i):e},S.onDotClick=function(e){e.preventDefault();var t=S.state,n=t.settings,o=t.animating,r=t.autoCycleTimer,i=n.slidesToShow,a=n.autoCycle;if(!o){a&&r&&(clearInterval(r),S.setState({autoCycleTimer:null}));var s=e.target.parentElement.getAttribute("data-index"),c=S.getTargetIndex(s*i,i);S.handleTrack(s*i,c),n.autoCycle&&S.playAutoCycle()}},S.onWindowResized=function(){S.setDimensions()},S.onMouseEnter=function(){var e=S.state.settings,t=e.autoCycle,n=e.pauseOnHover;t&&n&&S.pauseAutoCycle()},S.onMouseOver=function(){var e=S.state.settings,t=e.autoCycle,n=e.pauseOnHover;t&&n&&S.pauseAutoCycle()},S.onMouseLeave=function(){var e=S.state.settings,t=e.autoCycle,n=e.pauseOnHover;t&&n&&S.playAutoCycle()},S.onSwipeStart=function(e){var t=S.state.settings,n=t.swipe,o=t.draggable;if(!1===n||"ontouchend"in document&&!1===n)return null;if(!1===o&&-1!==e.type.indexOf("mouse"))return null;var r=void 0!==e.touches?e.touches[0].pageX:e.clientX,i=void 0!==e.touches?e.touches[0].pageY:e.clientY;return S.setState({dragging:!0,touchObject:{startX:r,startY:i}}),!0},S.onSwipeMove=function(e){var t=S.state,n=t.dragging,o=t.animating;if(n){if(!o){var r=void 0!==e.touches?e.touches[0].pageX:e.clientX,i=void 0!==e.touches?e.touches[0].pageY:e.clientY,a=S.state.touchObject,s=function(e,t,n,o){var r=e-t,i=n-o,a=Math.round(180*Math.atan2(i,r)/Math.PI);return a<0&&(a=360-Math.abs(a)),a<=45&&0<=a?1:a<=360&&315<=a?1:135<=a&&a<=225?-1:0}(a.startX,r,a.startY,i);0!==s&&e.preventDefault();var c=Math.round(Math.sqrt(Math.pow(r-a.startX,2)));S.setState({touchObject:{startX:a.startX,startY:a.startY,endX:r,endY:i,length:c,direction:s}})}}else e.preventDefault()},S.onSwipeEnd=function(){var e=S.state,t=e.touchObject,n=e.slidesWidth,o=e.autoCycleTimer,r=e.settings,i=e.currentIndex,a=t.length;if(0!==a&&n/2<a){var s,c;r.autoCycle&&o&&(clearInterval(o),S.setState({autoCycleTimer:null})),1===t.direction?(s=i+r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll)):(s=i-r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll),s<0&&0!==i&&(s=0)),S.handleTrack(s,c),r.autoCycle&&S.playAutoCycle()}else{S.setState({animating:!0,touchObject:{direction:-1*t.direction}},function(){setTimeout(function(){S.setState({animating:!1,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}})},r.animationDuration)})}},S.getTrackStyles=function(){var e=S.state.settings,t=S.state,n=t.touchObject,o=t.singlePage,r=t.sideSize,i=t.animating,a=t.slidesWidth,s=t.slidesCount,c=t.currentIndex,l=a+2*e.slidesSpacing;l*=s+2*e.slidesToShow;var u=a+2*e.slidesSpacing,d=e.showSides?1:0,f=u*(e.slidesToShow+d),p=i?"transform ".concat(e.animationDuration,"ms ease"):"",h=f+u*c+(e.swipe&&n.length?n.length*n.direction:0),g=u*r;return e.showSides&&(h-=g),{position:"relative",display:"block",width:o?"100%":l,height:"auto",padding:0,transition:p,transform:o?"none":"translate(".concat(-h,"px, 0px)"),boxSizing:"border-box",MozBoxSizing:"border-box",marginLeft:o&&e.showSides?"".concat(g,"px"):"0px"}},S.getScrollTrackStyles={clear:"both",position:"relative",display:"block",width:"100%",height:"auto",padding:0,boxSizing:"border-box",MozBoxSizing:"border-box"},S.getSlideStyles=function(e){var t=S.state,n=t.slidesWidth,o=t.settings,r=S.props.scrollOnDevice&&O()?"none":"left",i=e?"1":o.sidesOpacity;return{position:"relative",float:r,display:"inline-block",width:Number.isNaN(n)?1:n,height:"auto",margin:"0 ".concat(o.slidesSpacing,"px"),opacity:i}},S.getFormatedChildren=function(e,a,s){return C.Children.map(e,function(e,t){var n=S.state,o=n.settings,r=n.slideUniqueIds,i=0<=s.indexOf(t);return!o.lazyLoad||0<=a.indexOf(t)?x.a.createElement("li",{className:"InfiniteCarouselSlide",key:r[t],style:S.getSlideStyles(i)},e):x.a.createElement("li",{className:"InfiniteCarouselSlide",key:r[t],style:S.getSlideStyles(i)},x.a.createElement("noscript",null,e),x.a.createElement("img",{alt:"placeholder",src:o.placeholderImageSrc}))})},S.autoCycle=function(){var e=S.state,t=e.settings,n=e.currentIndex+t.slidesToScroll,o=S.getTargetIndex(n,t.slidesToScroll);S.handleTrack(n,o)},S.playAutoCycle=function(){var e=S.state.settings;if(e.autoCycle){var t=setInterval(S.autoCycle,e.cycleInterval);S.setState({autoCycleTimer:t})}},S.pauseAutoCycle=function(){var e=S.state.autoCycleTimer;e&&(clearInterval(e),S.setState({autoCycleTimer:null}))},S.handleTrack=function(e,t){function n(){setTimeout(function(){S.setState({currentIndex:t,animating:!1,dragging:!1})},a.animationDuration)}var o=S.props,r=o.children,i=o.onSlideChange,a=S.state.settings,s=Math.ceil(t/a.slidesToShow),c=S.getLazyLoadedIndexes(r,t),l=S.getVisibleIndexes(r,t);e<0?S.setState({currentIndex:e,activePage:s,animating:!0,lazyLoadedList:c,visibleSlideList:l,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},n):e>=r.length?S.setState({currentIndex:e,activePage:s,animating:!0,lazyLoadedList:c,visibleSlideList:l,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},n):S.setState({currentIndex:t,activePage:s,animating:!0,lazyLoadedList:c,visibleSlideList:l,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},function(){setTimeout(function(){S.setState({animating:!1,dragging:!1})},a.animationDuration)}),i&&i(s)},S.moveToNext=function(e){var t=S.props.onNextClick,n=S.state,o=n.animating,r=n.settings,i=n.currentIndex,a=n.autoCycleTimer;if(e.preventDefault(),t&&t(e),!o){r.autoCycle&&a&&(clearInterval(a),S.setState({autoCycleTimer:null}));var s=i+r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll);S.handleTrack(s,c),r.autoCycle&&S.playAutoCycle()}},S.moveToPrevious=function(e){var t=S.props.onPreviousClick,n=S.state,o=n.animating,r=n.settings,i=n.currentIndex,a=n.autoCycleTimer;if(e.preventDefault(),t&&t(e),!o){r.autoCycle&&a&&(clearInterval(a),S.setState({autoCycleTimer:null}));var s=i-r.slidesToScroll,c=S.getTargetIndex(s,r.slidesToScroll);s<0&&0!==i&&(s=0),S.handleTrack(s,c),r.autoCycle&&S.playAutoCycle()}},S.getSettingsForScrollOnDevice=function(){var e=S.props.scrollOnDevice,t=S.state.scrollOnDeviceProps;return e&&O()?E({},S.defaultProps,{},S.props,{},t):E({},S.defaultProps,{},S.props)},S.init=function(){if(S.props.responsive)S.setupBreakpointSettings();else{var e=S.props.children,t=S.getSettingsForScrollOnDevice(),n=t.slidesToShow,o=S.getChildrenList(e,n),r=o.map(function(e){return f()("slide-")});S.setState({children:o,slideUniqueIds:r,settings:t},function(){S.setDimensions(),S.playAutoCycle()})}},S.storeFrameRef=function(e){null!==e&&(S.frame=e)},S.state={currentIndex:0,activePage:0,children:[],lazyLoadedList:[],visibleSlideList:[],childrenCount:0,slidesCount:0,slidesWidth:1,slidePages:1,singlePage:!0,settings:{},autoCycleTimer:null,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1},scrollOnDeviceProps:{arrows:!1,dots:!1,lazyLoad:!1,autoCycle:!1},lowerBreakpoint:void 0,higherBreakpoint:void 0,slideUniqueIds:[]},S}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(t,C["Component"]),function(e,t,n){t&&g(e.prototype,t),n&&g(e,n)}(t,[{key:"componentDidMount",value:function(){this.init(),window&&(window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized))}},{key:"componentWillUnmount",value:function(){window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized);var e=this.state.autoCycleTimer;e&&clearInterval(e)}},{key:"render",value:function(){var e,t,n,o=this.props,r=o.scrollOnDevice,i=o.pagingSeparator,a=o.name,s=r&&O(),c=this.state,l=c.settings,u=c.singlePage,d=c.activePage,f=c.slidePages,p=c.dragging;if(l.arrows&&!u&&!s){if(null==l.prevArrow)e=x.a.createElement(I,{carouselName:a,next:!1,onClick:this.moveToPrevious});else{var h={onClick:this.moveToPrevious};e=x.a.cloneElement(l.prevArrow,h)}if(null==l.nextArrow)t=x.a.createElement(I,{carouselName:a,onClick:this.moveToNext});else{var g={onClick:this.moveToNext};t=x.a.cloneElement(l.nextArrow,g)}}!l.dots||u||s||(n=x.a.createElement(k,{carouselName:a,activePage:d,numberOfDots:f,onClick:this.onDotClick})),!l.paging||u||s||(n=x.a.createElement("span",{"data-testid":"".concat(a,"-paging"),className:"InfiniteCarouselPaging"},"".concat(d+1," ").concat(i," ").concat(f)));var v,m,y=this.state,b=y.children,w=y.lazyLoadedList,S=y.visibleSlideList,C=this.getFormatedChildren(b,w,S);m=r&&O()?(v=E({},this.getScrollTrackStyles),"InfiniteCarouselScrollTrack"):(v=E({},this.getTrackStyles()),"");var T=r&&O();return x.a.createElement("div",{id:a,"data-testid":a,className:"InfiniteCarousel",onFocus:this.onMouseOver,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseOver:this.onMouseOver},e,x.a.createElement("div",{className:"InfiniteCarouselFrame",ref:this.storeFrameRef},x.a.createElement("ul",{className:m,style:v,onMouseDown:T?null:this.onSwipeStart,onMouseLeave:p||!T?this.onSwipeEnd:null,onMouseMove:p||!T?this.onSwipeMove:null,onMouseUp:T?null:this.onSwipeEnd,onTouchCancel:p||!T?this.onSwipeEnd:null,onTouchEnd:T?null:this.onSwipeEnd,onTouchMove:p||!T?this.onSwipeMove:null,onTouchStart:T?null:this.onSwipeStart},C)),t,n)}}]),t}();b.propTypes={children:r.a.oneOfType([r.a.arrayOf(r.a.node),r.a.node]),name:r.a.string,arrows:r.a.bool,dots:r.a.bool,paging:r.a.bool,pagingSeparator:r.a.string,lazyLoad:r.a.bool,swipe:r.a.bool,draggable:r.a.bool,animationDuration:r.a.number,slidesToShow:r.a.number,slidesToScroll:r.a.number,slidesSpacing:r.a.number,autoCycle:r.a.bool,cycleInterval:r.a.number,pauseOnHover:r.a.bool,responsive:r.a.bool,breakpoints:r.a.arrayOf(r.a.object),placeholderImageSrc:r.a.string,nextArrow:r.a.element,prevArrow:r.a.element,scrollOnDevice:r.a.bool,showSides:r.a.bool,sidesOpacity:r.a.number,sideSize:r.a.number,incrementalSides:r.a.bool,onSlideChange:r.a.func,onNextClick:r.a.func,onPreviousClick:r.a.func},b.defaultProps={children:[],name:"infinite-carousel",arrows:!0,dots:!1,paging:!1,lazyLoad:!1,swipe:!0,draggable:!1,animationDuration:500,slidesToShow:1,slidesToScroll:1,slidesSpacing:10,autoCycle:!1,cycleInterval:5e3,pauseOnHover:!0,responsive:!0,breakpoints:[],placeholderImageSrc:"",pagingSeparator:"/",nextArrow:null,prevArrow:null,scrollOnDevice:!1,showSides:!1,sidesOpacity:1,sideSize:.5,incrementalSides:!1,onSlideChange:void 0,onNextClick:void 0,onPreviousClick:void 0};t.default=b}],r.c=i,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=19);function r(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return o[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var o,i}); |
{ | ||
"name": "react-leaf-carousel", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "React simple infinite carousel with lazy loading and responsive support", | ||
@@ -86,2 +86,2 @@ "scripts": { | ||
} | ||
} | ||
} |
@@ -9,5 +9,6 @@ import React from 'react'; | ||
<InfiniteCarousel | ||
swipe | ||
dots | ||
lazyload | ||
paging | ||
scrollOnDevice | ||
showSides | ||
@@ -14,0 +15,0 @@ responsive |
104
src/index.js
@@ -51,2 +51,3 @@ import React, { Component, Children } from 'react'; | ||
higherBreakpoint: undefined, | ||
slideUniqueIds: [], | ||
}; | ||
@@ -57,3 +58,2 @@ } | ||
this.init(); | ||
this.setDimensions(); | ||
@@ -83,4 +83,8 @@ if (!window) { | ||
setupBreakpointSettings = breakpointsSettings => { | ||
const { children: propChildren, scrollOnDevice: propScrollOnDevice } = this.props; | ||
setupBreakpointSettings = () => { | ||
const { | ||
children: propChildren, | ||
scrollOnDevice: propScrollOnDevice, | ||
breakpoints: breakpointsSettings, | ||
} = this.props; | ||
const { scrollOnDeviceProps: stateScrollOnDeviceProps } = this.state; | ||
@@ -119,2 +123,3 @@ const breakpoints = breakpointsSettings.map(element => element.breakpoint); | ||
const children = this.getChildrenList(propChildren, newSettings.slidesToShow); | ||
const slideUniqueIds = children.map(child => uniqid('slide-')); // eslint-disable-line no-unused-vars | ||
this.setState( | ||
@@ -124,2 +129,3 @@ { | ||
children, | ||
slideUniqueIds, | ||
lowerBreakpoint, | ||
@@ -139,4 +145,9 @@ higherBreakpoint, | ||
const scrollOnDeviceProps = scrollOnDevice ? stateScrollOnDeviceProps : {}; | ||
const newSettings = { ...this.defaultProps, ...this.props, ...scrollOnDeviceProps }; | ||
const newSettings = { | ||
...this.defaultProps, | ||
...this.props, | ||
...scrollOnDeviceProps, | ||
}; | ||
const children = this.getChildrenList(propChildren, newSettings.slidesToShow); | ||
const slideUniqueIds = children.map(child => uniqid('slide-')); // eslint-disable-line no-unused-vars | ||
this.setState( | ||
@@ -146,2 +157,3 @@ { | ||
children, | ||
slideUniqueIds, | ||
lowerBreakpoint: undefined, | ||
@@ -403,25 +415,23 @@ higherBreakpoint: undefined, | ||
} = this.state; | ||
const isSwipable = swipe === true; | ||
const isDraggable = draggable && e.type.indexOf('mouse') === -1; | ||
/* if ( | ||
this.state.settings.swipe === false || | ||
('ontouchend' in document && this.state.settings.swipe === false) | ||
) { | ||
if (swipe === false || ('ontouchend' in document && swipe === false)) { | ||
return null; | ||
} else if (this.state.settings.draggable === false && e.type.indexOf('mouse') !== -1) { | ||
} | ||
if (draggable === false && e.type.indexOf('mouse') !== -1) { | ||
return null; | ||
} */ | ||
} | ||
if (isSwipable && isDraggable) { | ||
const startX = e.touches !== undefined ? e.touches[0].pageX : e.clientX; | ||
const startY = e.touches !== undefined ? e.touches[0].pageY : e.clientY; | ||
const startX = e.touches !== undefined ? e.touches[0].pageX : e.clientX; | ||
const startY = e.touches !== undefined ? e.touches[0].pageY : e.clientY; | ||
this.setState({ | ||
dragging: true, | ||
touchObject: { | ||
startX, | ||
startY, | ||
}, | ||
}); | ||
} | ||
this.setState({ | ||
dragging: true, | ||
touchObject: { | ||
startX, | ||
startY, | ||
}, | ||
}); | ||
return true; | ||
}; | ||
@@ -548,2 +558,4 @@ | ||
const transform = !singlePage ? `translate(${-trackPosition}px, 0px)` : 'none'; | ||
return { | ||
@@ -556,3 +568,3 @@ position: 'relative', | ||
transition, | ||
transform: !singlePage ? `translate(${-trackPosition}px, 0px)` : 'none', | ||
transform, | ||
boxSizing: 'border-box', | ||
@@ -596,3 +608,3 @@ MozBoxSizing: 'border-box', | ||
Children.map(children, (child, index) => { | ||
const { settings } = this.state; | ||
const { settings, slideUniqueIds } = this.state; | ||
const isVisible = visibleSlideList.indexOf(index) >= 0; | ||
@@ -604,3 +616,3 @@ | ||
className="InfiniteCarouselSlide" | ||
key={uniqid('slide-')} | ||
key={slideUniqueIds[index]} | ||
style={this.getSlideStyles(isVisible)} | ||
@@ -616,3 +628,3 @@ > | ||
className="InfiniteCarouselSlide" | ||
key={uniqid('slide-')} | ||
key={slideUniqueIds[index]} | ||
style={this.getSlideStyles(isVisible)} | ||
@@ -797,6 +809,5 @@ > | ||
init = () => { | ||
const { children, slidesToShow, scrollOnDevice, responsive, breakpoints } = this.props; | ||
getSettingsForScrollOnDevice = () => { | ||
const { scrollOnDevice } = this.props; | ||
const { scrollOnDeviceProps } = this.state; | ||
const newChildren = this.getChildrenList(children, slidesToShow); | ||
let settings; | ||
@@ -815,15 +826,26 @@ if (scrollOnDevice && isTouchDevice()) { | ||
} | ||
return settings; | ||
}; | ||
this.setState( | ||
{ | ||
children: newChildren, | ||
settings, | ||
}, | ||
() => { | ||
this.playAutoCycle(); | ||
} | ||
); | ||
init = () => { | ||
const { responsive } = this.props; | ||
if (responsive) { | ||
this.setupBreakpointSettings(breakpoints); | ||
this.setupBreakpointSettings(); | ||
} else { | ||
const { children } = this.props; | ||
const settings = this.getSettingsForScrollOnDevice(); | ||
const { slidesToShow } = settings; | ||
const newChildren = this.getChildrenList(children, slidesToShow); | ||
const slideUniqueIds = newChildren.map(child => uniqid('slide-')); // eslint-disable-line no-unused-vars | ||
this.setState( | ||
{ | ||
children: newChildren, | ||
slideUniqueIds, | ||
settings, | ||
}, | ||
() => { | ||
this.setDimensions(); | ||
this.playAutoCycle(); | ||
} | ||
); | ||
} | ||
@@ -830,0 +852,0 @@ }; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
346734
22
1389
0