UNPKG

react-stupid-carousel

Version:

Simple Stupid Responsive React Infinite Carousel

2 lines 25.2 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactStupidCarousel=e(require("react")):t.ReactStupidCarousel=e(t.React)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){return function(e){var n,r;return r=n=function(n){function r(){var e,n,i,a;o(this,r);for(var u=arguments.length,c=Array(u),f=0;f<u;f++)c[f]=arguments[f];return n=i=s(this,(e=r.__proto__||Object.getPrototypeOf(r)).call.apply(e,[this].concat(c))),i.state={contentRect:{entry:{},client:{},offset:{},scroll:{},bounds:{},margin:{}}},i.measure=function(e){var n=(0,g.default)(i._node,t||(0,b.default)(i.props));e&&(n.entry=e[0].contentRect),i.setState({contentRect:n}),"function"==typeof i.props.onResize&&i.props.onResize(n)},i._handleRef=function(t){i._resizeObserver&&(t?i._resizeObserver.observe(t):i._resizeObserver.disconnect(i._node)),i._node=t,"function"==typeof i.props.innerRef&&i.props.innerRef(t)},a=n,s(i,a)}return a(r,n),f(r,[{key:"componentWillMount",value:function(){this._resizeObserver=new v.default(this.measure)}},{key:"render",value:function(){var t=this.props,n=(t.innerRef,t.onResize,i(t,["innerRef","onResize"]));return(0,l.createElement)(e,c({},n,{measureRef:this._handleRef,measure:this.measure,contentRect:this.state.contentRect}))}}]),r}(l.Component),n.propTypes={client:h.default.bool,offset:h.default.bool,scroll:h.default.bool,bounds:h.default.bool,margin:h.default.bool,innerRef:h.default.func,onResize:h.default.func,children:h.default.func},r}}Object.defineProperty(e,"__esModule",{value:!0});var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=n(0),d=(r(l),n(5)),h=r(d),p=n(10),v=r(p),m=n(11),b=r(m),y=n(12),g=r(y);e.default=u,t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),c=r(u),f=n(3),l=r(f),d=n(13),h=(r(d),function(t){function e(t){i(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.getItemElement=function(t,e,r){return void 0==r&&(r="slide-"+e),c.default.createElement("li",{"data-slide-index":e,className:"stupid-carousel-slide "+(n.state.activeSlide===e?"active":""),key:r,id:r,style:{width:n.state.slideWidth,order:n.reorderOneSlide(e),padding:"0 "+n.padding+"px 0"},ref:function(t){n.slideElements[e]=t}},t)},n.state={activeSlide:n.props.startSlide||0,slideWidth:0,stageLeft:0,animateLeft:0,transitionData:{}},n.id=n.props.carouselId||"",n.speed=n.props.carouselSpeed||500,n.padding=n.props.slidePadding||0,n.easing=n.props.carouselEasing||"linear",n.slideElements=[],n.itemCount=n.props.children.length,n.reactItems=n.props.children,n.isAnimating=!1,n.resetStagePosition=n.resetStagePosition.bind(n),n.goToSlide=n.goToSlide.bind(n),n.nextSlide=n.nextSlide.bind(n),n.prevSlide=n.prevSlide.bind(n),n}return s(e,t),a(e,[{key:"reorderOneSlide",value:function(t){var e=t-this.state.activeSlide;return e<0&&(e=this.itemCount+e),e}},{key:"setDimensions",value:function(t){var e=this;this.setState({slideWidth:t.bounds.width+2*this.padding},function(){e.setState({animateLeft:-e.padding})})}},{key:"resetStagePosition",value:function(){var t=this,e=this.state.transitionData.targetIndex;this.isAnimating=!1,this.setState({animateLeft:-this.padding,stageLeft:0,activeSlide:e,transitionData:{direction:1}},function(){t.newReorderAllSlides()})}},{key:"_moveStage",value:function(){var t=this.state,e=t.slideWidth,n=(t.distance,t.transitionData);this.isAnimating=!0,this.sliderElement.addEventListener("transitionend",this.resetStagePosition),n.direction?this.setState({animateLeft:-(e*n.distance+(2*this.padding*n.distance-this.padding))}):this.setState({animateLeft:e*n.distance-this.padding})}},{key:"animateStagePosition",value:function(){var t=this,e=this.state,n=e.slideWidth,r=e.transitionData;this.isAnimating=!1,r.direction?this.setState({stageLeft:0},function(){t._moveStage()}):this.setState({stageLeft:-n*(this.itemCount-1)},function(){t._moveStage()})}},{key:"newReorderAllSlides",value:function(){var t=this.state,e=t.activeSlide,n=t.transitionData,r=this.itemCount-1;if(n.direction)for(var i=0;i<=r;i++){var o=i-e;o<0&&(o=i+r-e+1),this.slideElements[i].style.order=o}else for(var s=0;s<=r;s++){var a=s+(r-e);a>r&&(a=s-e-1),this.slideElements[s].style.order=a}}},{key:"initTransitionData",value:function(t){var e=this.state.activeSlide,n=e<t?t-e:this.itemCount-e+t,r=e>t?e-t:e+this.itemCount-t;return n<=r?{direction:1,distance:n,targetIndex:t}:{direction:0,distance:r,targetIndex:t}}},{key:"goToSlide",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e!=this.state.activeSlide&&this.setState({transitionData:this.initTransitionData(e)},function(){t.newReorderAllSlides(),t.animateStagePosition()})}},{key:"nextSlide",value:function(){var t=this.state.activeSlide+1;t>=this.itemCount&&(t=this.itemCount-t),this.goToSlide(t)}},{key:"prevSlide",value:function(){var t=this.state.activeSlide-1;t<0&&(t=this.itemCount-t-2),this.goToSlide(t)}},{key:"render",value:function(){var t=this,e=this.state,n=e.slideWidth,r=e.stageLeft,i=e.animateLeft,o={width:n*this.itemCount,left:r,marginLeft:i+"px",WebkitTransition:this.isAnimating?"margin-left "+this.speed+"ms "+this.easing:"0ms",MozTransition:this.isAnimating?"margin-left "+this.speed+"ms "+this.easing:"0ms",OTransition:this.isAnimating?"margin-left "+this.speed+"ms "+this.easing:"0ms",transition:this.isAnimating?"margin-left "+this.speed+"ms "+this.easing:"0ms"};return c.default.createElement(l.default,{bounds:!0,onResize:function(e){t.setDimensions(e)}},function(e){var n=e.measureRef;return c.default.createElement("div",{id:t.id+"-container",className:"stupid-carousel-container",ref:n},c.default.createElement("div",{id:t.id+"-slider",className:"stupid-carousel-slider",style:o,ref:function(e){t.sliderElement=e}},c.default.createElement("ul",{id:t.id+"-list",className:"stupid-carousel-list"},t.reactItems.map(function(e,n){return t.getItemElement(e,n,e.props["data-slideid"])}))))})}}]),e}(u.Component));e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.withContentRect=e.default=void 0;var i=n(4),o=r(i),s=n(1),a=r(s);e.default=o.default,e.withContentRect=a.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){var e=t.measure,n=t.measureRef,r=t.contentRect;return(0,t.children)({measure:e,measureRef:n,contentRect:r})}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=(r(o),n(1)),a=r(s);e.default=(0,a.default)()(i),t.exports=e.default},function(t,e,n){t.exports=n(6)()},function(t,e,n){"use strict";var r=n(7),i=n(8),o=n(9);t.exports=function(){function t(t,e,n,r,s,a){a!==o&&i(!1,"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")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";function r(t,e,n,r,o,s,a,u){if(i(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,o,s,a,u],l=0;c=new Error(e.replace(/%s/g,function(){return f[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var i=function(t){};t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";function r(t){return parseFloat(t)||0}function i(t){return Array.prototype.slice.call(arguments,1).reduce(function(e,n){return e+r(t["border-"+n+"-width"])},0)}function o(t){for(var e=["top","right","bottom","left"],n={},i=0,o=e;i<o.length;i+=1){var s=o[i],a=t["padding-"+s];n[s]=r(a)}return n}function s(t){var e=t.getBBox();return l(0,0,e.width,e.height)}function a(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return O;var s=getComputedStyle(t),a=o(s),c=a.left+a.right,f=a.top+a.bottom,d=r(s.width),h=r(s.height);if("border-box"===s.boxSizing&&(Math.round(d+c)!==e&&(d-=i(s,"left","right")+c),Math.round(h+f)!==n&&(h-=i(s,"top","bottom")+f)),!u(t)){var p=Math.round(d+c)-e,v=Math.round(h+f)-n;1!==Math.abs(p)&&(d-=p),1!==Math.abs(v)&&(h-=v)}return l(a.left,a.top,d,h)}function u(t){return t===document.documentElement}function c(t){return h?x(t)?s(t):a(t):O}function f(t){var e=t.x,n=t.y,r=t.width,i=t.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return w(s,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),s}function l(t,e,n,r){return{x:t,y:e,width:n,height:r}}Object.defineProperty(e,"__esModule",{value:!0});var d=function(){function t(t,e){var n=-1;return t.some(function(t,r){return t[0]===e&&(n=r,!0)}),n}return"undefined"!=typeof Map?Map:function(){function e(){this.__entries__=[]}var n={size:{}};return n.size.get=function(){return this.__entries__.length},e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var i=r[n];t.call(e,i[1],i[0])}},Object.defineProperties(e.prototype,n),e}()}(),h="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,p=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),v=2,m=function(t,e){function n(){o&&(o=!1,t()),s&&i()}function r(){p(n)}function i(){var t=Date.now();if(o){if(t-a<v)return;s=!0}else o=!0,s=!1,setTimeout(r,e);a=t}var o=!1,s=!1,a=0;return i},b=["top","right","bottom","left","width","height","size","weight"],y="undefined"!=typeof navigator&&/Trident\/.*rv:11/.test(navigator.userAgent),g="undefined"!=typeof MutationObserver&&!y,_=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=m(this.refresh.bind(this),20)};_.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},_.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},_.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},_.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},_.prototype.connect_=function(){h&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),g?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},_.prototype.disconnect_=function(){h&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},_.prototype.onTransitionEnd_=function(t){var e=t.propertyName;b.some(function(t){return!!~e.indexOf(t)})&&this.refresh()},_.getInstance=function(){return this.instance_||(this.instance_=new _),this.instance_},_.instance_=null;var w=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n+=1){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},O=l(0,0,0,0),x=function(){return"undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof SVGGraphicsElement}:function(t){return t instanceof SVGElement&&"function"==typeof t.getBBox}}(),E=function(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=l(0,0,0,0),this.target=t};E.prototype.isActive=function(){var t=c(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},E.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t};var R=function(t,e){var n=f(e);w(this,{target:t,contentRect:n})},S=function(t,e,n){if("function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.activeObservations_=[],this.observations_=new d,this.callback_=t,this.controller_=e,this.callbackCtx_=n};S.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new E(t)),this.controller_.addObserver(this),this.controller_.refresh())}},S.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},S.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},S.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},S.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new R(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},S.prototype.clearActive=function(){this.activeObservations_.splice(0)},S.prototype.hasActive=function(){return this.activeObservations_.length>0};var T="undefined"!=typeof WeakMap?new WeakMap:new d,j=function(t){if(!(this instanceof j))throw new TypeError("Cannot call a class as a function");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=_.getInstance(),n=new S(t,e,this);T.set(this,n)};["observe","unobserve","disconnect"].forEach(function(t){j.prototype[t]=function(){return(e=T.get(this))[t].apply(e,arguments);var e}});var A=function(){return"undefined"!=typeof ResizeObserver?ResizeObserver:j}();e.default=A},function(t,e,n){"use strict";function r(t){var e=[];return i.forEach(function(n){t[n]&&e.push(n)}),e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=["client","offset","scroll","bounds","margin"];t.exports=e.default},function(t,e,n){"use strict";function r(t,e){var n={};if(e.indexOf("client")>-1&&(n.client={top:t.clientTop,left:t.clientLeft,width:t.clientWidth,height:t.clientHeight}),e.indexOf("offset")>-1&&(n.offset={top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}),e.indexOf("scroll")>-1&&(n.scroll={top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}),e.indexOf("bounds")>-1){var r=t.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(e.indexOf("margin")>-1){var i=getComputedStyle(t);n.margin={top:parseInt(i.marginTop),right:parseInt(i.marginRight),bottom:parseInt(i.marginBottom),left:parseInt(i.marginLeft)}}return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e,n){var r=n(14);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0};i.transform=void 0;n(16)(r,i);r.locals&&(t.exports=r.locals)},function(t,e,n){e=t.exports=n(15)(void 0),e.push([t.i,"div.stupid-carousel-container{width:100%;position:relative;overflow:hidden}div.stupid-carousel-container div.stupid-carousel-slider{position:relative}div.stupid-carousel-container div.stupid-carousel-slider ul.stupid-carousel-list{box-sizing:border-box;display:flex;flex-flow:row;flex-grow:1;padding:0;margin:0}div.stupid-carousel-container div.stupid-carousel-slider ul.stupid-carousel-list li.stupid-carousel-slide{box-sizing:border-box;flex-shrink:0;display:flex;list-style-type:none}",""])},function(t,e){function n(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([o]).join("\n")}return[n].join("\n")}function r(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r=n(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var s=t[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))}},e}},function(t,e,n){function r(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=p[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(f(r.parts[o],e))}else{for(var s=[],o=0;o<r.parts.length;o++)s.push(f(r.parts[o],e));p[r.id]={id:r.id,refs:1,parts:s}}}}function i(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],s=e.base?o[0]+e.base:o[0],a=o[1],u=o[2],c=o[3],f={css:a,media:u,sourceMap:c};r[s]?r[s].parts.push(f):n.push(r[s]={id:s,parts:[f]})}return n}function o(t,e){var n=m(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=g[g.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),g.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=m(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,i)}}function s(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=g.indexOf(t);e>=0&&g.splice(e,1)}function a(t){var e=document.createElement("style");return t.attrs.type="text/css",c(e,t.attrs),o(t,e),e}function u(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",c(e,t.attrs),o(t,e),e}function c(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function f(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o=e.transform(t.css)))return function(){};t.css=o}if(e.singleton){var c=y++;n=b||(b=a(e)),r=l.bind(null,n,c,!1),i=l.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(e),r=h.bind(null,n,e),i=function(){s(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),r=d.bind(null,n),i=function(){s(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function l(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(e,i);else{var o=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}function d(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function h(t,e,n){var r=n.css,i=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(r=_(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var s=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}var p={},v=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),m=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}(function(t){return document.querySelector(t)}),b=null,y=0,g=[],_=n(17);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=v()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=i(t,e);return r(n,e),function(t){for(var o=[],s=0;s<n.length;s++){var a=n[s],u=p[a.id];u.refs--,o.push(u)}if(t){r(i(t,e),e)}for(var s=0;s<o.length;s++){var u=o[s];if(0===u.refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete p[u.id]}}}};var w=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i))return t;var o;return o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")"})}}])}); //# sourceMappingURL=index.js.map