-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9-d2869d873a1b30f89b75.js
2 lines (2 loc) · 34 KB
/
9-d2869d873a1b30f89b75.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{158:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(159);t.API=n.default;var r=o(198);t.Client=r.default;var i=o(199);t.Server=i.default},159:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.listeners={}}return e.prototype.socketEvent=function(e){try{var t=JSON.parse(e)}catch(i){return}if(t instanceof Object&&!0===t.widgetbot&&t.id===this.id){var o=t.event,n=t.data,r=this.listeners[o];r&&r.forEach(function(e){return e(n)})}},e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),console.debug("[embed-api] on '"+e+"'",t)},e}();t.default=n},169:function(e,t,o){"use strict";(function(e){var n=o(0),r=o.n(n),i=o(170),s=o(4),a=o.n(s),l=o(171);function c(e,t){var o,n=(o=e,!isNaN(parseFloat(o))&&isFinite(o)?parseFloat(o):"px"===o.slice(-2)?parseFloat(o.slice(0,-2)):void 0);if("number"==typeof n)return n;var r=function(e){if("%"===e.slice(-1))return parseFloat(e.slice(0,-1))/100}(e);return"number"==typeof r?r*t:void 0}var u={above:"above",inside:"inside",below:"below",invisible:"invisible"};var f="<Waypoint> expected to receive a single React element child.\n\nSee https://goo.gl/LrBNgw for more info.";function p(e){if(e)try{r.a.Children.only(e)}catch(t){throw new Error(f)}}function d(e){return"string"==typeof e.type}var h="<Waypoint> needs a DOM element to compute boundaries. The child you passed is neither a DOM element (e.g. <div>) nor does it use the innerRef prop.\n\nSee https://goo.gl/LrBNgw for more info.";var v=void 0,y=[];function m(e){y.push(e),v||(v=setTimeout(function(){v=null;for(var e=void 0;e=y.shift();)e()},0));var t=!0;return function(){return function(){if(t){t=!1;var o=y.indexOf(e);-1!==o&&(y.splice(o,1),!y.length&&v&&(clearTimeout(v),v=null))}}}()}var b=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}();var g={topOffset:"0px",bottomOffset:"0px",horizontal:!1,onEnter:function(){return function(){}}(),onLeave:function(){return function(){}}(),onPositionChange:function(){return function(){}}(),fireOnRapidScroll:!0},w=void 0!==r.a.PureComponent?r.a.PureComponent:r.a.Component,S=function(t){function o(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.refElement=function(e){return t._ref=e},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,w),b(o,[{key:"componentWillMount",value:function(){return function(){p(this.props.children)}}()},{key:"componentDidMount",value:function(){return function(){var e=this;o.getWindow()&&(this.cancelOnNextTick=m(function(){e.cancelOnNextTick=null,function(e,t){if(e&&!d(e)&&!t)throw new Error(h)}(e.props.children,e._ref),e._handleScroll=e._handleScroll.bind(e),e.scrollableAncestor=e._findScrollableAncestor(),e.scrollEventListenerUnsubscribe=Object(i.a)(e.scrollableAncestor,"scroll",e._handleScroll,{passive:!0}),e.resizeEventListenerUnsubscribe=Object(i.a)(window,"resize",e._handleScroll,{passive:!0}),e._handleScroll(null)}))}}()},{key:"componentWillReceiveProps",value:function(){return function(e){p(e.children)}}()},{key:"componentDidUpdate",value:function(){return function(){var e=this;o.getWindow()&&this.scrollableAncestor&&(this.cancelOnNextTick||(this.cancelOnNextTick=m(function(){e.cancelOnNextTick=null,e._handleScroll(null)})))}}()},{key:"componentWillUnmount",value:function(){return function(){o.getWindow()&&(this.scrollEventListenerUnsubscribe&&this.scrollEventListenerUnsubscribe(),this.resizeEventListenerUnsubscribe&&this.resizeEventListenerUnsubscribe(),this.cancelOnNextTick&&this.cancelOnNextTick())}}()},{key:"_findScrollableAncestor",value:function(){return function(){var t=this.props,o=t.horizontal,n=t.scrollableAncestor;if(n)return function(t){return"window"===t?e.window:t}(n);for(var r=this._ref;r.parentNode;){if((r=r.parentNode)===document.body)return window;var i=window.getComputedStyle(r),s=(o?i.getPropertyValue("overflow-x"):i.getPropertyValue("overflow-y"))||i.getPropertyValue("overflow");if("auto"===s||"scroll"===s)return r}return window}}()},{key:"_handleScroll",value:function(){return function(e){if(this._ref){var t=this._getBounds(),o=function(e){return e.viewportBottom-e.viewportTop==0?u.invisible:e.viewportTop<=e.waypointTop&&e.waypointTop<=e.viewportBottom?u.inside:e.viewportTop<=e.waypointBottom&&e.waypointBottom<=e.viewportBottom?u.inside:e.waypointTop<=e.viewportTop&&e.viewportBottom<=e.waypointBottom?u.inside:e.viewportBottom<e.waypointTop?u.below:e.waypointTop<e.viewportTop?u.above:u.invisible}(t),n=this._previousPosition;if(this._previousPosition=o,n!==o){var r={currentPosition:o,previousPosition:n,event:e,waypointTop:t.waypointTop,waypointBottom:t.waypointBottom,viewportTop:t.viewportTop,viewportBottom:t.viewportBottom};this.props.onPositionChange.call(this,r),o===u.inside?this.props.onEnter.call(this,r):n===u.inside&&this.props.onLeave.call(this,r);var i=n===u.below&&o===u.above,s=n===u.above&&o===u.below;this.props.fireOnRapidScroll&&(i||s)&&(this.props.onEnter.call(this,{currentPosition:u.inside,previousPosition:n,event:e,waypointTop:t.waypointTop,waypointBottom:t.waypointBottom,viewportTop:t.viewportTop,viewportBottom:t.viewportBottom}),this.props.onLeave.call(this,{currentPosition:o,previousPosition:u.inside,event:e,waypointTop:t.waypointTop,waypointBottom:t.waypointBottom,viewportTop:t.viewportTop,viewportBottom:t.viewportBottom}))}}}}()},{key:"_getBounds",value:function(){return function(){var e=this.props.horizontal,t=this._ref.getBoundingClientRect(),o=t.left,n=t.top,r=t.right,i=t.bottom,s=e?o:n,a=e?r:i,l=void 0,u=void 0;this.scrollableAncestor===window?(l=e?window.innerWidth:window.innerHeight,u=0):(l=e?this.scrollableAncestor.offsetWidth:this.scrollableAncestor.offsetHeight,u=e?this.scrollableAncestor.getBoundingClientRect().left:this.scrollableAncestor.getBoundingClientRect().top);var f=this.props,p=f.bottomOffset;return{waypointTop:s,waypointBottom:a,viewportTop:u+c(f.topOffset,l),viewportBottom:u+l-c(p,l)}}}()},{key:"render",value:function(){return function(){var e=this,t=this.props.children;if(!t)return r.a.createElement("span",{ref:this.refElement,style:{fontSize:0}});if(d(t)||Object(l.isForwardRef)(t.type)){var o=function(o){e.refElement(o),t.ref&&("function"==typeof t.ref?t.ref(o):t.ref.current=o)};return r.a.cloneElement(t,{ref:o})}return r.a.cloneElement(t,{innerRef:this.refElement})}}()}]),o}();S.propTypes={children:a.a.node,debug:a.a.bool,onEnter:a.a.func,onLeave:a.a.func,onPositionChange:a.a.func,fireOnRapidScroll:a.a.bool,scrollableAncestor:a.a.any,horizontal:a.a.bool,topOffset:a.a.oneOfType([a.a.string,a.a.number]),bottomOffset:a.a.oneOfType([a.a.string,a.a.number])},S.above=u.above,S.below=u.below,S.inside=u.inside,S.invisible=u.invisible,S.getWindow=function(){if("undefined"!=typeof window)return window},S.defaultProps=g,S.displayName="Waypoint",t.a=S}).call(this,o(74))},170:function(e,t,o){"use strict";o.d(t,"a",function(){return c});var n=!("undefined"==typeof window||!window.document||!window.document.createElement);var r=void 0;function i(){return void 0===r&&(r=function(){if(!n)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),o=function(){};window.addEventListener("testPassiveEventSupport",o,t),window.removeEventListener("testPassiveEventSupport",o,t)}catch(r){}return e}()),r}function s(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function a(e){this.target=e,this.events={}}a.prototype.getEventHandlers=function(){return function(e,t){var o,n=String(e)+" "+String((o=t)?!0===o?100:(o.capture<<0)+(o.passive<<1)+(o.once<<2):0);return this.events[n]||(this.events[n]={handlers:[],handleEvent:void 0},this.events[n].nextHandlers=this.events[n].handlers),this.events[n]}}(),a.prototype.handleEvent=function(){return function(e,t,o){var n=this.getEventHandlers(e,t);n.handlers=n.nextHandlers,n.handlers.forEach(function(e){e&&e(o)})}}(),a.prototype.add=function(){return function(e,t,o){var n=this,r=this.getEventHandlers(e,o);s(r),0===r.nextHandlers.length&&(r.handleEvent=this.handleEvent.bind(this,e,o),this.target.addEventListener(e,r.handleEvent,o)),r.nextHandlers.push(t);var i=!0;return function(){if(i){i=!1,s(r);var a=r.nextHandlers.indexOf(t);r.nextHandlers.splice(a,1),0===r.nextHandlers.length&&(n.target&&n.target.removeEventListener(e,r.handleEvent,o),r.handleEvent=void 0)}}}}();var l="__consolidated_events_handlers__";function c(e,t,o,n){e[l]||(e[l]=new a(e));var r=function(e){if(e)return i()?e:!!e.capture}(n);return e[l].add(t,o,r)}},171:function(e,t,o){"use strict";e.exports=o(172)},172:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,f=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,v=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116;function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case f:case p:case s:case l:case a:case h:return e;default:switch(e=e&&e.$$typeof){case u:case d:case c:return e;default:return t}}case y:case v:case i:return t}}}function b(e){return m(e)===p}t.typeOf=m,t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=s,t.Lazy=y,t.Memo=v,t.Portal=i,t.Profiler=l,t.StrictMode=a,t.Suspense=h,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===p||e===l||e===a||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===v||e.$$typeof===c||e.$$typeof===u||e.$$typeof===d)},t.isAsyncMode=function(e){return b(e)||m(e)===f},t.isConcurrentMode=b,t.isContextConsumer=function(e){return m(e)===u},t.isContextProvider=function(e){return m(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return m(e)===d},t.isFragment=function(e){return m(e)===s},t.isLazy=function(e){return m(e)===y},t.isMemo=function(e){return m(e)===v},t.isPortal=function(e){return m(e)===i},t.isProfiler=function(e){return m(e)===l},t.isStrictMode=function(e){return m(e)===a},t.isSuspense=function(e){return m(e)===h}},173:function(e,t,o){"use strict";var n=o(8);t.__esModule=!0,t.default=void 0;var r,i=n(o(7)),s=n(o(34)),a=n(o(76)),l=n(o(75)),c=n(o(0)),u=n(o(4)),f=function(e){var t=(0,l.default)({},e);return t.resolutions&&(t.fixed=t.resolutions,delete t.resolutions),t.sizes&&(t.fluid=t.sizes,delete t.sizes),t},p=Object.create({}),d=function(e){var t=f(e),o=t.fluid?t.fluid.src:t.fixed.src;return p[o]||!1},h=new WeakMap;var v=function(e,t){var o=(void 0===r&&"undefined"!=typeof window&&window.IntersectionObserver&&(r=new window.IntersectionObserver(function(e){e.forEach(function(e){if(h.has(e.target)){var t=h.get(e.target);(e.isIntersecting||e.intersectionRatio>0)&&(r.unobserve(e.target),h.delete(e.target),t())}})},{rootMargin:"200px"})),r);return o&&(o.observe(e),h.set(e,t)),function(){o.unobserve(e),h.delete(e)}},y=function(e){var t=e.src?'src="'+e.src+'" ':'src="" ',o=e.sizes?'sizes="'+e.sizes+'" ':"",n=e.srcSetWebp?"<source type='image/webp' srcset=\""+e.srcSetWebp+'" '+o+"/>":"",r=e.srcSet?'srcset="'+e.srcSet+'" ':"",i=e.title?'title="'+e.title+'" ':"",s=e.alt?'alt="'+e.alt+'" ':'alt="" ';return"<picture>"+n+"<img "+(e.width?'width="'+e.width+'" ':"")+(e.height?'height="'+e.height+'" ':"")+o+r+t+s+i+(e.crossOrigin?'crossorigin="'+e.crossOrigin+'" ':"")+'style="position:absolute;top:0;left:0;opacity:1;width:100%;height:100%;object-fit:cover;object-position:center"/></picture>'},m=c.default.forwardRef(function(e,t){var o=e.sizes,n=e.srcSet,r=e.src,i=e.style,s=e.onLoad,u=e.onError,f=(0,a.default)(e,["sizes","srcSet","src","style","onLoad","onError"]);return c.default.createElement("img",(0,l.default)({sizes:o,srcSet:n,src:r},f,{onLoad:s,onError:u,ref:t,style:(0,l.default)({position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"},i)}))});m.propTypes={style:u.default.object,onError:u.default.func,onLoad:u.default.func};var b=function(e){function t(t){var o;o=e.call(this,t)||this;var n=!0,r=!1,i=t.fadeIn,a=d(t);!a&&"undefined"!=typeof window&&window.IntersectionObserver&&(n=!1,r=!0),"undefined"==typeof window&&(n=!1),t.critical&&(n=!0,r=!1);var l=!(t.critical&&!t.fadeIn);return o.state={isVisible:n,imgLoaded:!1,imgCached:!1,IOSupported:r,fadeIn:i,hasNoScript:l,seenBefore:a},o.imageRef=c.default.createRef(),o.handleImageLoaded=o.handleImageLoaded.bind((0,s.default)((0,s.default)(o))),o.handleRef=o.handleRef.bind((0,s.default)((0,s.default)(o))),o}(0,i.default)(t,e);var o=t.prototype;return o.componentDidMount=function(){if(this.state.isVisible&&"function"==typeof this.props.onStartLoad&&this.props.onStartLoad({wasCached:d(this.props)}),this.props.critical){var e=this.imageRef.current;e&&e.complete&&this.handleImageLoaded()}},o.componentWillUnmount=function(){this.cleanUpListeners&&this.cleanUpListeners()},o.handleRef=function(e){var t=this;this.state.IOSupported&&e&&(this.cleanUpListeners=v(e,function(){var e=d(t.props);t.state.isVisible||"function"!=typeof t.props.onStartLoad||t.props.onStartLoad({wasCached:e}),t.setState({isVisible:!0},function(){return t.setState({imgLoaded:e,imgCached:!!t.imageRef.current.currentSrc})})}))},o.handleImageLoaded=function(){var e,t,o;e=this.props,t=f(e),o=t.fluid?t.fluid.src:t.fixed.src,p[o]=!0,this.setState({imgLoaded:!0}),this.state.seenBefore&&this.setState({fadeIn:!1}),this.props.onLoad&&this.props.onLoad()},o.render=function(){var e=f(this.props),t=e.title,o=e.alt,n=e.className,r=e.style,i=void 0===r?{}:r,s=e.imgStyle,a=void 0===s?{}:s,u=e.placeholderStyle,p=void 0===u?{}:u,d=e.placeholderClassName,h=e.fluid,v=e.fixed,b=e.backgroundColor,g=e.Tag,w=e.itemProp,S=this.state.imgLoaded||!1===this.state.fadeIn,_=!0===this.state.fadeIn&&!this.state.imgCached,E=(0,l.default)({opacity:S?1:0,transition:_?"opacity 0.5s":"none"},a),O="boolean"==typeof b?"lightgray":b,x={transitionDelay:"0.5s"},P=(0,l.default)({opacity:this.state.imgLoaded?0:1},_&&x,a,p),T={title:t,alt:this.state.isVisible?"":o,style:P,className:d};if(h){var j=h;return c.default.createElement(g,{className:(n||"")+" gatsby-image-wrapper",style:(0,l.default)({position:"relative",overflow:"hidden"},i),ref:this.handleRef,key:"fluid-"+JSON.stringify(j.srcSet)},c.default.createElement(g,{style:{width:"100%",paddingBottom:100/j.aspectRatio+"%"}}),O&&c.default.createElement(g,{title:t,style:(0,l.default)({backgroundColor:O,position:"absolute",top:0,bottom:0,opacity:this.state.imgLoaded?0:1,right:0,left:0},_&&x)}),j.base64&&c.default.createElement(m,(0,l.default)({src:j.base64},T)),j.tracedSVG&&c.default.createElement(m,(0,l.default)({src:j.tracedSVG},T)),this.state.isVisible&&c.default.createElement("picture",null,j.srcSetWebp&&c.default.createElement("source",{type:"image/webp",srcSet:j.srcSetWebp,sizes:j.sizes}),c.default.createElement(m,{alt:o,title:t,sizes:j.sizes,src:j.src,crossOrigin:this.props.crossOrigin,srcSet:j.srcSet,style:E,ref:this.imageRef,onLoad:this.handleImageLoaded,onError:this.props.onError,itemProp:w})),this.state.hasNoScript&&c.default.createElement("noscript",{dangerouslySetInnerHTML:{__html:y((0,l.default)({alt:o,title:t},j))}}))}if(v){var L=v,C=(0,l.default)({position:"relative",overflow:"hidden",display:"inline-block",width:L.width,height:L.height},i);return"inherit"===i.display&&delete C.display,c.default.createElement(g,{className:(n||"")+" gatsby-image-wrapper",style:C,ref:this.handleRef,key:"fixed-"+JSON.stringify(L.srcSet)},O&&c.default.createElement(g,{title:t,style:(0,l.default)({backgroundColor:O,width:L.width,opacity:this.state.imgLoaded?0:1,height:L.height},_&&x)}),L.base64&&c.default.createElement(m,(0,l.default)({src:L.base64},T)),L.tracedSVG&&c.default.createElement(m,(0,l.default)({src:L.tracedSVG},T)),this.state.isVisible&&c.default.createElement("picture",null,L.srcSetWebp&&c.default.createElement("source",{type:"image/webp",srcSet:L.srcSetWebp,sizes:L.sizes}),c.default.createElement(m,{alt:o,title:t,width:L.width,height:L.height,sizes:L.sizes,src:L.src,crossOrigin:this.props.crossOrigin,srcSet:L.srcSet,style:E,ref:this.imageRef,onLoad:this.handleImageLoaded,onError:this.props.onError,itemProp:w})),this.state.hasNoScript&&c.default.createElement("noscript",{dangerouslySetInnerHTML:{__html:y((0,l.default)({alt:o,title:t},L))}}))}return null},t}(c.default.Component);b.defaultProps={critical:!1,fadeIn:!0,alt:"",Tag:"div"};var g=u.default.shape({width:u.default.number.isRequired,height:u.default.number.isRequired,src:u.default.string.isRequired,srcSet:u.default.string.isRequired,base64:u.default.string,tracedSVG:u.default.string,srcWebp:u.default.string,srcSetWebp:u.default.string}),w=u.default.shape({aspectRatio:u.default.number.isRequired,src:u.default.string.isRequired,srcSet:u.default.string.isRequired,sizes:u.default.string.isRequired,base64:u.default.string,tracedSVG:u.default.string,srcWebp:u.default.string,srcSetWebp:u.default.string});b.propTypes={resolutions:g,sizes:w,fixed:g,fluid:w,fadeIn:u.default.bool,title:u.default.string,alt:u.default.string,className:u.default.oneOfType([u.default.string,u.default.object]),critical:u.default.bool,crossOrigin:u.default.oneOfType([u.default.string,u.default.bool]),style:u.default.object,imgStyle:u.default.object,placeholderStyle:u.default.object,placeholderClassName:u.default.string,backgroundColor:u.default.oneOfType([u.default.string,u.default.bool]),onLoad:u.default.func,onError:u.default.func,onStartLoad:u.default.func,Tag:u.default.string,itemProp:u.default.string};var S=b;t.default=S},175:function(e,t,o){"use strict";var n=o(8);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(o(75)),i=n(o(36)),s=n(o(176)),a=n(o(180)),l=n(o(181)),c=n(o(183)),u=n(o(34)),f=n(o(184)),p=n(o(185)),d=n(o(4)),h=n(o(0)),v=n(o(187)),y=n(o(188));var m=function(e){function t(e){var o;return(0,a.default)(this,t),(o=(0,l.default)(this,(0,c.default)(t).call(this,e))).state={targetItems:[],inViewState:[],isScrolledPast:[]},o._handleSpy=o._handleSpy.bind((0,u.default)(o)),o}return(0,p.default)(t,e),(0,f.default)(t,null,[{key:"propTypes",get:function(){return{items:d.default.arrayOf(d.default.string).isRequired,currentClassName:d.default.string.isRequired,scrolledPastClassName:d.default.string,style:d.default.object,componentTag:d.default.oneOfType([d.default.string,d.default.func]),offset:d.default.number,rootEl:d.default.string,onUpdate:d.default.func}}},{key:"defaultProps",get:function(){return{items:[],currentClassName:"",style:{},componentTag:"ul",offset:0,onUpdate:function(){}}}}]),(0,f.default)(t,[{key:"_initSpyTarget",value:function(e){return e.map(function(e){return document.getElementById(e)})}},{key:"_fillArray",value:function(e,t){for(var o=[],n=0,r=e.length;n<r;n++)o[n]=t;return o}},{key:"_isScrolled",value:function(){return this._getScrollDimension().scrollTop>0}},{key:"_getScrollDimension",value:function(){var e=document,t=this.props.rootEl;return{scrollTop:t?e.querySelector(t).scrollTop:e.documentElement.scrollTop||e.body.parentNode.scrollTop||e.body.scrollTop,scrollHeight:t?e.querySelector(t).scrollHeight:e.documentElement.scrollHeight||e.body.parentNode.scrollHeight||e.body.scrollHeight}}},{key:"_getElemsViewState",value:function(e){for(var t=[],o=[],n=[],r=e||this.state.targetItems,i=!1,a=0,l=r.length;a<l;a++){var c=r[a],u=!i&&this._isInView(c);u?(i=!0,t.push(c)):o.push(c);var f=a===l-1,p=this._isScrolled();this._isAtBottom()&&this._isInView(c)&&!u&&f&&p&&(o.pop(),o.push.apply(o,(0,s.default)(t)),t=[c],n=this._fillArray(n,!1),u=!0),n.push(u)}return{inView:t,outView:o,viewStatusList:n,scrolledPast:this.props.scrolledPastClassName&&this._getScrolledPast(n)}}},{key:"_isInView",value:function(e){if(!e)return!1;var t,o=this.props,n=o.rootEl,r=o.offset;n&&(t=document.querySelector(n).getBoundingClientRect());var i=e.getBoundingClientRect(),s=n?t.height:window.innerHeight,a=this._getScrollDimension().scrollTop,l=a+s,c=n?i.top+a-t.top+r:i.top+a+r,u=c+e.offsetHeight;return c<l&&u>a}},{key:"_isAtBottom",value:function(){var e=this.props.rootEl,t=this._getScrollDimension(),o=t.scrollTop,n=t.scrollHeight;return o+(e?document.querySelector(e).getBoundingClientRect().height:window.innerHeight)>=n}},{key:"_getScrolledPast",value:function(e){if(!e.some(function(e){return e}))return e;var t=!1;return e.map(function(e){return e&&!t?(t=!0,!1):!t})}},{key:"_spy",value:function(e){var t=this,o=this._getElemsViewState(e),n=this.state.inViewState;this.setState({inViewState:o.viewStatusList,isScrolledPast:o.scrolledPast},function(){t._update(n)})}},{key:"_update",value:function(e){var t,o;(t=this.state.inViewState,o=e,t.length===o.length&&t.every(function(e,t){return e===o[t]}))||this.props.onUpdate(this.state.targetItems[this.state.inViewState.indexOf(!0)])}},{key:"_handleSpy",value:function(){(0,y.default)(this._spy(),100)}},{key:"_initFromProps",value:function(){var e=this._initSpyTarget(this.props.items);this.setState({targetItems:e}),this._spy(e)}},{key:"offEvent",value:function(){(this.props.rootEl?document.querySelector(this.props.rootEl):window).removeEventListener("scroll",this._handleSpy)}},{key:"onEvent",value:function(){(this.props.rootEl?document.querySelector(this.props.rootEl):window).addEventListener("scroll",this._handleSpy)}},{key:"componentDidMount",value:function(){this._initFromProps(),this.onEvent()}},{key:"componentWillUnmount",value:function(){this.offEvent()}},{key:"componentWillReceiveProps",value:function(){this._initFromProps()}},{key:"render",value:function(){var e=this,t=this.props.componentTag,o=this.props,n=o.children,s=o.className,a=o.scrolledPastClassName,l=o.style,c=0,u=h.default.Children.map(n,function(t,o){var n;if(!t)return null;var s=t.type,l=a&&e.state.isScrolledPast[o],u=(0,v.default)((n={},(0,i.default)(n,"".concat(t.props.className),t.props.className),(0,i.default)(n,"".concat(e.props.currentClassName),e.state.inViewState[o]),(0,i.default)(n,"".concat(e.props.scrolledPastClassName),l),n));return h.default.createElement(s,(0,r.default)({},t.props,{className:u,key:c++}),t.props.children)}),f=(0,v.default)((0,i.default)({},"".concat(s),s));return h.default.createElement(t,{className:f,style:l},u)}}]),t}(h.default.Component);t.default=m},176:function(e,t,o){var n=o(177),r=o(178),i=o(179);e.exports=function(e){return n(e)||r(e)||i()}},177:function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,o=new Array(e.length);t<e.length;t++)o[t]=e[t];return o}}},178:function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},179:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},180:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},181:function(e,t,o){var n=o(182),r=o(34);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?r(e):t}},182:function(e,t){function o(e){return(o="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 n(t){return"function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?e.exports=n=function(e){return o(e)}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)},n(t)}e.exports=n},183:function(e,t){function o(t){return e.exports=o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(t)}e.exports=o},184:function(e,t){function o(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}},185:function(e,t,o){var n=o(186);e.exports=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&&n(e,t)}},186:function(e,t){function o(t,n){return e.exports=o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(t,n)}e.exports=o},187:function(e,t,o){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var s=r.apply(null,n);s&&e.push(s)}else if("object"===i)for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},188:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){var t,o,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){var r=+new Date;t&&r<t+n?(clearTimeout(o),o=setTimeout(function(){t=r,e()},n)):(t=r,e())}};t.default=n},189:function(e,t,o){!function(){"use strict";e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var o,n=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||l,scrollIntoView:n.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(o=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(o)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var o=function(e){for(;e!==t.body&&!1===p(e);)e=e.parentNode||e.host;return e}(this),n=o.getBoundingClientRect(),r=this.getBoundingClientRect();o!==t.body?(h.call(this,o,o.scrollLeft+r.left-n.left,o.scrollTop+r.top-n.top),"fixed"!==e.getComputedStyle(o).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function f(t,o){var n=e.getComputedStyle(t,null)["overflow"+o];return"auto"===n||"scroll"===n}function p(e){var t=u(e,"Y")&&f(e,"Y"),o=u(e,"X")&&f(e,"X");return t||o}function d(t){var o,n,i,a,l=(s()-t.startTime)/r;a=l=l>1?1:l,o=.5*(1-Math.cos(Math.PI*a)),n=t.startX+(t.x-t.startX)*o,i=t.startY+(t.y-t.startY)*o,t.method.call(t.scrollable,n,i),n===t.x&&i===t.y||e.requestAnimationFrame(d.bind(e,t))}function h(o,n,r){var a,c,u,f,p=s();o===t.body?(a=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,f=i.scroll):(a=o,c=o.scrollLeft,u=o.scrollTop,f=l),d({scrollable:a,method:f,startTime:p,startX:c,startY:u,x:n,y:r})}}}}()},197:function(e,t,o){"use strict";var n,r=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},function(e,t){function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0});var s=o(158),a=o(0),l=o(200),c=o(201),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={url:null,id:c.generateUUID()},t.api=new s.Client({id:t.state.id,iframe:null}),t}return r(t,e),t.getDerivedStateFromProps=function(e,t){return{url:e.shard+"/channels/"+e.server+(e.channel?"/"+e.channel:"")+"/"+c.searchParams(i({},e.options,{api:t.id}))}},t.prototype.componentDidMount=function(){var e=this.props.onAPI;e&&e(this.api)},t.prototype.render=function(){var e=this,t=this.props,o=t.defer,n=t.className,r=t.style,s=t.height,c=t.width;return a.createElement("div",{className:n,style:i({},l.Root({width:c,height:s}),r)},a.createElement("iframe",{src:o?"":this.state.url,ref:function(t){return e.api.iframe=t},style:l.Embed}))},t.defaultProps={server:"299881420891881473",shard:"https://widgetbot.io",options:{},defer:!1},t}(a.PureComponent);t.default=u,function(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}(o(158));var f=o(158);t.API=f.Client},198:function(e,t,o){"use strict";var n,r=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},function(e,t){function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var o=e.call(this)||this;return o.server={emit:function(e,t){var n=o.listeners[e];n&&n.forEach(function(e){return e(t)})}},Object.assign(o,t),window.addEventListener("message",function(e){var t=e.data;return o.socketEvent(t)}),o}return r(t,e),t.prototype.emit=function(e,t){if(!window.parent)return!1;var o=JSON.stringify({widgetbot:!0,id:this.id,event:e,data:t});return!!this.iframe.contentWindow&&(this.iframe.contentWindow.postMessage(o,"*"),!0)},t}(o(159).default);t.default=i},199:function(e,t,o){"use strict";var n,r=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},function(e,t){function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var o=e.call(this)||this;return o.targetOrigin="*",o.client={emit:function(e,t){var n=o.listeners[e];n&&n.forEach(function(e){return e(t)})}},Object.assign(o,t),window.addEventListener("message",function(e){var t=e.data;return o.socketEvent(t)}),o}return r(t,e),t.prototype.emit=function(e,t){if(console.debug("[embed-api] emit '"+e+"'",t),!window.parent)return!1;var o=JSON.stringify({widgetbot:!0,id:this.id,event:e,data:t});return window.parent.postMessage(o,this.targetOrigin),!0},t}(o(159).default);t.default=i},200:function(e,t,o){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.Root=function(e){var t=e.width,o=e.height;return n({},o&&{height:+o?o+"px":o},t&&{width:+t?t+"px":t},{display:"inline-block",overflow:"hidden",backgroundColor:"rgb(54, 57, 62)",borderRadius:7,verticalAlign:"top"})},t.Embed={width:"100%",height:"100%",border:"none"}},201:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateUUID=function(){var e=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var o=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?o:3&o|8).toString(16)})},t.searchParams=function(e){return void 0===e&&(e={}),"?"+Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}}}]);
//# sourceMappingURL=9-d2869d873a1b30f89b75.js.map